@mastra/deployer-cloud 1.17.0 → 1.18.0-alpha.0

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/studio/assets/{chunk-ZCJMLMGS-AgWPVILX.js → chunk-ZCJMLMGS-Dn_OeDs5.js} +1 -1
  3. package/dist/studio/assets/{index-CaAVpDzx.js → index-B0DJvOas.js} +1 -1
  4. package/dist/studio/assets/{index-C9l4pS3L.js → index-B4qKXjKr.js} +1 -1
  5. package/dist/studio/assets/{index-BU8sJWnm.js → index-B9ls1ybt.js} +1 -1
  6. package/dist/studio/assets/{index-vpG_Uogz.js → index-B9q08_EN.js} +1 -1
  7. package/dist/studio/assets/{index-7nbvipT1.js → index-BOZnSpqn.js} +1 -1
  8. package/dist/studio/assets/{index-CmagytQ4.js → index-BZoQ-eCy.js} +1 -1
  9. package/dist/studio/assets/{index-BfmviWar.js → index-CE3fi9kq.js} +1 -1
  10. package/dist/studio/assets/{index-ChzWl4Pi.js → index-COZezMQ6.js} +1 -1
  11. package/dist/studio/assets/{index-DX8k1Ij6.js → index-Cll9sYRS.js} +1 -1
  12. package/dist/studio/assets/{index-qDaZO4pH.js → index-Cpo0mxI6.js} +1 -1
  13. package/dist/studio/assets/{index-BbAvQTNN.js → index-CqmD5Z0h.js} +1 -1
  14. package/dist/studio/assets/{index-CwZuPfD1.js → index-CstqGswn.js} +1 -1
  15. package/dist/studio/assets/{index-DrXCDkhv.js → index-D3BhNk62.js} +1 -1
  16. package/dist/studio/assets/{index-DvP12bdZ.js → index-DYEA3vXC.js} +1 -1
  17. package/dist/studio/assets/{index-BKw6IeKY.js → index-HnLIlXpI.js} +1 -1
  18. package/dist/studio/assets/{index-FInefdtZ.js → index-IMWk_B5X.js} +1 -1
  19. package/dist/studio/assets/{index-36MEBaXD.js → index-So5-kAzB.js} +1 -1
  20. package/dist/studio/assets/{index-BYbxGxDm.js → index-Vn_AsM_r.js} +1 -1
  21. package/dist/studio/assets/{main-CaYT3ONY.js → main-VpxKq_yt.js} +6 -6
  22. package/dist/studio/assets/{token-APYSY3BW-RPVF55TR-BUa4m6n5.js → token-APYSY3BW-RPVF55TR-DyzKZA6C.js} +1 -1
  23. package/dist/studio/assets/token-util-RMHT2CPJ-VVUHOXBL-BVs4tK1U.js +1 -0
  24. package/dist/studio/index.html +1 -1
  25. package/package.json +6 -6
  26. package/versions.json +1 -1
  27. package/dist/studio/assets/token-util-RMHT2CPJ-VVUHOXBL-Dzo4_r1w.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./token-util-RMHT2CPJ-VVUHOXBL-Dzo4_r1w.js","./chunk-ZCJMLMGS-AgWPVILX.js","./index-ChzWl4Pi.js","./token-APYSY3BW-RPVF55TR-BUa4m6n5.js","./index-7nbvipT1.js","./index-CaAVpDzx.js","./index-CwZuPfD1.js","./index-DrXCDkhv.js","./index-36MEBaXD.js","./index-BfmviWar.js","./index-DvP12bdZ.js","./index-BbAvQTNN.js","./index-vpG_Uogz.js","./index-CmagytQ4.js","./index-BU8sJWnm.js","./index-BYbxGxDm.js","./index-qDaZO4pH.js","./index-BKw6IeKY.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-C9l4pS3L.js","./index-FInefdtZ.js","./index-DX8k1Ij6.js"])))=>i.map(i=>d[i]);
2
- import{_ as Qe}from"./index-ChzWl4Pi.js";function Tze(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var XD=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var m7={exports:{}},DE={};var Exe;function bkt(){if(Exe)return DE;Exe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var o in a)o!=="key"&&(s[o]=a[o])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:i,ref:a!==void 0?a:null,props:s}}return DE.Fragment=t,DE.jsx=n,DE.jsxs=n,DE}var Cxe;function xkt(){return Cxe||(Cxe=1,m7.exports=bkt()),m7.exports}var l=xkt(),g7={exports:{}},dr={},jxe;function wkt(){if(jxe)return dr;jxe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=h&&F[h]||F["@@iterator"],typeof F=="function"?F:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function S(F,R,Q){this.props=F,this.context=R,this.refs=b,this.updater=Q||g}S.prototype.isReactComponent={},S.prototype.setState=function(F,R){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,R,"setState")},S.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function O(){}O.prototype=S.prototype;function k(F,R,Q){this.props=F,this.context=R,this.refs=b,this.updater=Q||g}var E=k.prototype=new O;E.constructor=k,v(E,S.prototype),E.isPureReactComponent=!0;var C=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function I(F,R,Q){var W=Q.ref;return{$$typeof:t,type:F,key:R,ref:W!==void 0?W:null,props:Q}}function P(F,R){return I(F.type,R,F.props)}function M(F){return typeof F=="object"&&F!==null&&F.$$typeof===t}function B(F){var R={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(Q){return R[Q]})}var D=/\/+/g;function V(F,R){return typeof F=="object"&&F!==null&&F.key!=null?B(""+F.key):R.toString(36)}function q(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(T,T):(F.status="pending",F.then(function(R){F.status==="pending"&&(F.status="fulfilled",F.value=R)},function(R){F.status==="pending"&&(F.status="rejected",F.reason=R)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function z(F,R,Q,W,te){var se=typeof F;(se==="undefined"||se==="boolean")&&(F=null);var re=!1;if(F===null)re=!0;else switch(se){case"bigint":case"string":case"number":re=!0;break;case"object":switch(F.$$typeof){case t:case n:re=!0;break;case f:return re=F._init,z(re(F._payload),R,Q,W,te)}}if(re)return te=te(F),re=W===""?"."+V(F,0):W,C(te)?(Q="",re!=null&&(Q=re.replace(D,"$&/")+"/"),z(te,R,Q,"",function(de){return de})):te!=null&&(M(te)&&(te=P(te,Q+(te.key==null||F&&F.key===te.key?"":(""+te.key).replace(D,"$&/")+"/")+re)),R.push(te)),1;re=0;var ae=W===""?".":W+":";if(C(F))for(var oe=0;oe<F.length;oe++)W=F[oe],se=ae+V(W,oe),re+=z(W,R,Q,se,te);else if(oe=m(F),typeof oe=="function")for(F=oe.call(F),oe=0;!(W=F.next()).done;)W=W.value,se=ae+V(W,oe++),re+=z(W,R,Q,se,te);else if(se==="object"){if(typeof F.then=="function")return z(q(F),R,Q,W,te);throw R=String(F),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return re}function H(F,R,Q){if(F==null)return F;var W=[],te=0;return z(F,W,"","",function(se){return R.call(Q,se,te++)}),W}function G(F){if(F._status===-1){var R=F._result;R=R(),R.then(function(Q){(F._status===0||F._status===-1)&&(F._status=1,F._result=Q)},function(Q){(F._status===0||F._status===-1)&&(F._status=2,F._result=Q)}),F._status===-1&&(F._status=0,F._result=R)}if(F._status===1)return F._result.default;throw F._result}var L=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(R))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",F);return}console.error(F)},Z={map:H,forEach:function(F,R,Q){H(F,function(){R.apply(this,arguments)},Q)},count:function(F){var R=0;return H(F,function(){R++}),R},toArray:function(F){return H(F,function(R){return R})||[]},only:function(F){if(!M(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return dr.Activity=p,dr.Children=Z,dr.Component=S,dr.Fragment=r,dr.Profiler=s,dr.PureComponent=k,dr.StrictMode=a,dr.Suspense=u,dr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,dr.__COMPILER_RUNTIME={__proto__:null,c:function(F){return j.H.useMemoCache(F)}},dr.cache=function(F){return function(){return F.apply(null,arguments)}},dr.cacheSignal=function(){return null},dr.cloneElement=function(F,R,Q){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var W=v({},F.props),te=F.key;if(R!=null)for(se in R.key!==void 0&&(te=""+R.key),R)!A.call(R,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&R.ref===void 0||(W[se]=R[se]);var se=arguments.length-2;if(se===1)W.children=Q;else if(1<se){for(var re=Array(se),ae=0;ae<se;ae++)re[ae]=arguments[ae+2];W.children=re}return I(F.type,te,W)},dr.createContext=function(F){return F={$$typeof:o,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:i,_context:F},F},dr.createElement=function(F,R,Q){var W,te={},se=null;if(R!=null)for(W in R.key!==void 0&&(se=""+R.key),R)A.call(R,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(te[W]=R[W]);var re=arguments.length-2;if(re===1)te.children=Q;else if(1<re){for(var ae=Array(re),oe=0;oe<re;oe++)ae[oe]=arguments[oe+2];te.children=ae}if(F&&F.defaultProps)for(W in re=F.defaultProps,re)te[W]===void 0&&(te[W]=re[W]);return I(F,se,te)},dr.createRef=function(){return{current:null}},dr.forwardRef=function(F){return{$$typeof:c,render:F}},dr.isValidElement=M,dr.lazy=function(F){return{$$typeof:f,_payload:{_status:-1,_result:F},_init:G}},dr.memo=function(F,R){return{$$typeof:d,type:F,compare:R===void 0?null:R}},dr.startTransition=function(F){var R=j.T,Q={};j.T=Q;try{var W=F(),te=j.S;te!==null&&te(Q,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(T,L)}catch(se){L(se)}finally{R!==null&&Q.types!==null&&(R.types=Q.types),j.T=R}},dr.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},dr.use=function(F){return j.H.use(F)},dr.useActionState=function(F,R,Q){return j.H.useActionState(F,R,Q)},dr.useCallback=function(F,R){return j.H.useCallback(F,R)},dr.useContext=function(F){return j.H.useContext(F)},dr.useDebugValue=function(){},dr.useDeferredValue=function(F,R){return j.H.useDeferredValue(F,R)},dr.useEffect=function(F,R){return j.H.useEffect(F,R)},dr.useEffectEvent=function(F){return j.H.useEffectEvent(F)},dr.useId=function(){return j.H.useId()},dr.useImperativeHandle=function(F,R,Q){return j.H.useImperativeHandle(F,R,Q)},dr.useInsertionEffect=function(F,R){return j.H.useInsertionEffect(F,R)},dr.useLayoutEffect=function(F,R){return j.H.useLayoutEffect(F,R)},dr.useMemo=function(F,R){return j.H.useMemo(F,R)},dr.useOptimistic=function(F,R){return j.H.useOptimistic(F,R)},dr.useReducer=function(F,R,Q){return j.H.useReducer(F,R,Q)},dr.useRef=function(F){return j.H.useRef(F)},dr.useState=function(F){return j.H.useState(F)},dr.useSyncExternalStore=function(F,R,Q){return j.H.useSyncExternalStore(F,R,Q)},dr.useTransition=function(){return j.H.useTransition()},dr.version="19.2.4",dr}var Txe;function Jk(){return Txe||(Txe=1,g7.exports=wkt()),g7.exports}var x=Jk();const Oe=yo(x),Rw=Tze({__proto__:null,default:Oe},[x]);var v7={exports:{}},$E={},y7={exports:{}},b7={};var Nxe;function Skt(){return Nxe||(Nxe=1,(function(e){function t(q,z){var H=q.length;q.push(z);e:for(;0<H;){var G=H-1>>>1,L=q[G];if(0<a(L,z))q[G]=z,q[H]=L,H=G;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var z=q[0],H=q.pop();if(H!==z){q[0]=H;e:for(var G=0,L=q.length,Z=L>>>1;G<Z;){var F=2*(G+1)-1,R=q[F],Q=F+1,W=q[Q];if(0>a(R,H))Q<L&&0>a(W,R)?(q[G]=W,q[Q]=H,G=Q):(q[G]=R,q[F]=H,G=F);else if(Q<L&&0>a(W,H))q[G]=W,q[Q]=H,G=Q;else break e}}return z}function a(q,z){var H=q.sortIndex-z.sortIndex;return H!==0?H:q.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],u=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function k(q){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=q)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function E(q){if(g=!1,k(q),!m)if(n(c)!==null)m=!0,C||(C=!0,M());else{var z=n(u);z!==null&&V(E,z.startTime-q)}}var C=!1,T=-1,j=5,A=-1;function I(){return v?!0:!(e.unstable_now()-A<j)}function P(){if(v=!1,C){var q=e.unstable_now();A=q;var z=!0;try{e:{m=!1,g&&(g=!1,S(T),T=-1),h=!0;var H=p;try{t:{for(k(q),f=n(c);f!==null&&!(f.expirationTime>q&&I());){var G=f.callback;if(typeof G=="function"){f.callback=null,p=f.priorityLevel;var L=G(f.expirationTime<=q);if(q=e.unstable_now(),typeof L=="function"){f.callback=L,k(q),z=!0;break t}f===n(c)&&r(c),k(q)}else r(c);f=n(c)}if(f!==null)z=!0;else{var Z=n(u);Z!==null&&V(E,Z.startTime-q),z=!1}}break e}finally{f=null,p=H,h=!1}z=void 0}}finally{z?M():C=!1}}}var M;if(typeof O=="function")M=function(){O(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=P,M=function(){D.postMessage(null)}}else M=function(){b(P,0)};function V(q,z){T=b(function(){q(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(q){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var H=p;p=z;try{return q()}finally{p=H}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(q,z){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var H=p;p=q;try{return z()}finally{p=H}},e.unstable_scheduleCallback=function(q,z,H){var G=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?G+H:G):H=G,q){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=H+L,q={id:d++,callback:z,priorityLevel:q,startTime:H,expirationTime:L,sortIndex:-1},H>G?(q.sortIndex=H,t(u,q),n(c)===null&&q===n(u)&&(g?(S(T),T=-1):g=!0,V(E,H-G))):(q.sortIndex=L,t(c,q),m||h||(m=!0,C||(C=!0,M()))),q},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(q){var z=p;return function(){var H=p;p=z;try{return q.apply(this,arguments)}finally{p=H}}}})(b7)),b7}var Axe;function Okt(){return Axe||(Axe=1,y7.exports=Skt()),y7.exports}var x7={exports:{}},Dl={};var Ixe;function kkt(){if(Ixe)return Dl;Ixe=1;var e=Jk();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Dl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dl.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return s(c,u,null,d)},Dl.flushSync=function(c){var u=i.T,d=r.p;try{if(i.T=null,r.p=2,c)return c()}finally{i.T=u,r.p=d,r.d.f()}},Dl.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},Dl.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Dl.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:h}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:p,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Dl.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=o(u.as,u.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(c)},Dl.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin);r.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Dl.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=o(u.as,u.crossOrigin);r.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(c)},Dl.requestFormReset=function(c){r.d.r(c)},Dl.unstable_batchedUpdates=function(c,u){return c(u)},Dl.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Dl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Dl.version="19.2.4",Dl}var Rxe;function Nze(){if(Rxe)return x7.exports;Rxe=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),x7.exports=kkt(),x7.exports}var Pxe;function _kt(){if(Pxe)return $E;Pxe=1;var e={env:{}};var t=Okt(),n=Jk(),r=Nze();function a(y){var w="https://react.dev/errors/"+y;if(1<arguments.length){w+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)w+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+y+"; visit "+w+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function i(y){var w=y,_=y;if(y.alternate)for(;w.return;)w=w.return;else{y=w;do w=y,(w.flags&4098)!==0&&(_=w.return),y=w.return;while(y)}return w.tag===3?_:null}function o(y){if(y.tag===13){var w=y.memoizedState;if(w===null&&(y=y.alternate,y!==null&&(w=y.memoizedState)),w!==null)return w.dehydrated}return null}function c(y){if(y.tag===31){var w=y.memoizedState;if(w===null&&(y=y.alternate,y!==null&&(w=y.memoizedState)),w!==null)return w.dehydrated}return null}function u(y){if(i(y)!==y)throw Error(a(188))}function d(y){var w=y.alternate;if(!w){if(w=i(y),w===null)throw Error(a(188));return w!==y?null:y}for(var _=y,N=w;;){var $=_.return;if($===null)break;var U=$.alternate;if(U===null){if(N=$.return,N!==null){_=N;continue}break}if($.child===U.child){for(U=$.child;U;){if(U===_)return u($),y;if(U===N)return u($),w;U=U.sibling}throw Error(a(188))}if(_.return!==N.return)_=$,N=U;else{for(var ee=!1,ce=$.child;ce;){if(ce===_){ee=!0,_=$,N=U;break}if(ce===N){ee=!0,N=$,_=U;break}ce=ce.sibling}if(!ee){for(ce=U.child;ce;){if(ce===_){ee=!0,_=U,N=$;break}if(ce===N){ee=!0,N=U,_=$;break}ce=ce.sibling}if(!ee)throw Error(a(189))}}if(_.alternate!==N)throw Error(a(190))}if(_.tag!==3)throw Error(a(188));return _.stateNode.current===_?y:w}function f(y){var w=y.tag;if(w===5||w===26||w===27||w===6)return y;for(y=y.child;y!==null;){if(w=f(y),w!==null)return w;y=y.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),k=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function B(y){return y===null||typeof y!="object"?null:(y=M&&y[M]||y["@@iterator"],typeof y=="function"?y:null)}var D=Symbol.for("react.client.reference");function V(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===D?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case v:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof y=="object")switch(y.$$typeof){case g:return"Portal";case k:return y.displayName||"Context";case O:return(y._context.displayName||"Context")+".Consumer";case E:var w=y.render;return y=y.displayName,y||(y=w.displayName||w.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case j:return w=y.displayName||null,w!==null?w:V(y.type)||"Memo";case A:w=y._payload,y=y._init;try{return V(y(w))}catch{}}return null}var q=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function F(y){return{current:y}}function R(y){0>Z||(y.current=L[Z],L[Z]=null,Z--)}function Q(y,w){Z++,L[Z]=y.current,y.current=w}var W=F(null),te=F(null),se=F(null),re=F(null);function ae(y,w){switch(Q(se,w),Q(te,y),Q(W,null),w.nodeType){case 9:case 11:y=(y=w.documentElement)&&(y=y.namespaceURI)?Zbe(y):0;break;default:if(y=w.tagName,w=w.namespaceURI)w=Zbe(w),y=Ybe(w,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}R(W),Q(W,y)}function oe(){R(W),R(te),R(se)}function de(y){y.memoizedState!==null&&Q(re,y);var w=W.current,_=Ybe(w,y.type);w!==_&&(Q(te,y),Q(W,_))}function K(y){te.current===y&&(R(W),R(te)),re.current===y&&(R(re),IE._currentValue=G)}var ne,ie;function ve(y){if(ne===void 0)try{throw Error()}catch(_){var w=_.stack.trim().match(/\n( *(at )?)/);ne=w&&w[1]||"",ie=-1<_.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./token-util-RMHT2CPJ-VVUHOXBL-BVs4tK1U.js","./chunk-ZCJMLMGS-Dn_OeDs5.js","./index-COZezMQ6.js","./token-APYSY3BW-RPVF55TR-DyzKZA6C.js","./index-BOZnSpqn.js","./index-B0DJvOas.js","./index-CstqGswn.js","./index-D3BhNk62.js","./index-So5-kAzB.js","./index-CE3fi9kq.js","./index-DYEA3vXC.js","./index-CqmD5Z0h.js","./index-B9q08_EN.js","./index-BZoQ-eCy.js","./index-B9ls1ybt.js","./index-Vn_AsM_r.js","./index-Cpo0mxI6.js","./index-HnLIlXpI.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-B4qKXjKr.js","./index-IMWk_B5X.js","./index-Cll9sYRS.js"])))=>i.map(i=>d[i]);
2
+ import{_ as Qe}from"./index-COZezMQ6.js";function Tze(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var XD=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var m7={exports:{}},DE={};var Exe;function bkt(){if(Exe)return DE;Exe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var o in a)o!=="key"&&(s[o]=a[o])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:i,ref:a!==void 0?a:null,props:s}}return DE.Fragment=t,DE.jsx=n,DE.jsxs=n,DE}var Cxe;function xkt(){return Cxe||(Cxe=1,m7.exports=bkt()),m7.exports}var l=xkt(),g7={exports:{}},dr={},jxe;function wkt(){if(jxe)return dr;jxe=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(F){return F===null||typeof F!="object"?null:(F=h&&F[h]||F["@@iterator"],typeof F=="function"?F:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function S(F,R,Q){this.props=F,this.context=R,this.refs=b,this.updater=Q||g}S.prototype.isReactComponent={},S.prototype.setState=function(F,R){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,R,"setState")},S.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function O(){}O.prototype=S.prototype;function k(F,R,Q){this.props=F,this.context=R,this.refs=b,this.updater=Q||g}var E=k.prototype=new O;E.constructor=k,v(E,S.prototype),E.isPureReactComponent=!0;var C=Array.isArray;function T(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function I(F,R,Q){var W=Q.ref;return{$$typeof:t,type:F,key:R,ref:W!==void 0?W:null,props:Q}}function P(F,R){return I(F.type,R,F.props)}function M(F){return typeof F=="object"&&F!==null&&F.$$typeof===t}function B(F){var R={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(Q){return R[Q]})}var D=/\/+/g;function V(F,R){return typeof F=="object"&&F!==null&&F.key!=null?B(""+F.key):R.toString(36)}function q(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(T,T):(F.status="pending",F.then(function(R){F.status==="pending"&&(F.status="fulfilled",F.value=R)},function(R){F.status==="pending"&&(F.status="rejected",F.reason=R)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function z(F,R,Q,W,te){var se=typeof F;(se==="undefined"||se==="boolean")&&(F=null);var re=!1;if(F===null)re=!0;else switch(se){case"bigint":case"string":case"number":re=!0;break;case"object":switch(F.$$typeof){case t:case n:re=!0;break;case f:return re=F._init,z(re(F._payload),R,Q,W,te)}}if(re)return te=te(F),re=W===""?"."+V(F,0):W,C(te)?(Q="",re!=null&&(Q=re.replace(D,"$&/")+"/"),z(te,R,Q,"",function(de){return de})):te!=null&&(M(te)&&(te=P(te,Q+(te.key==null||F&&F.key===te.key?"":(""+te.key).replace(D,"$&/")+"/")+re)),R.push(te)),1;re=0;var ae=W===""?".":W+":";if(C(F))for(var oe=0;oe<F.length;oe++)W=F[oe],se=ae+V(W,oe),re+=z(W,R,Q,se,te);else if(oe=m(F),typeof oe=="function")for(F=oe.call(F),oe=0;!(W=F.next()).done;)W=W.value,se=ae+V(W,oe++),re+=z(W,R,Q,se,te);else if(se==="object"){if(typeof F.then=="function")return z(q(F),R,Q,W,te);throw R=String(F),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return re}function H(F,R,Q){if(F==null)return F;var W=[],te=0;return z(F,W,"","",function(se){return R.call(Q,se,te++)}),W}function G(F){if(F._status===-1){var R=F._result;R=R(),R.then(function(Q){(F._status===0||F._status===-1)&&(F._status=1,F._result=Q)},function(Q){(F._status===0||F._status===-1)&&(F._status=2,F._result=Q)}),F._status===-1&&(F._status=0,F._result=R)}if(F._status===1)return F._result.default;throw F._result}var L=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(R))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",F);return}console.error(F)},Z={map:H,forEach:function(F,R,Q){H(F,function(){R.apply(this,arguments)},Q)},count:function(F){var R=0;return H(F,function(){R++}),R},toArray:function(F){return H(F,function(R){return R})||[]},only:function(F){if(!M(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return dr.Activity=p,dr.Children=Z,dr.Component=S,dr.Fragment=r,dr.Profiler=s,dr.PureComponent=k,dr.StrictMode=a,dr.Suspense=u,dr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,dr.__COMPILER_RUNTIME={__proto__:null,c:function(F){return j.H.useMemoCache(F)}},dr.cache=function(F){return function(){return F.apply(null,arguments)}},dr.cacheSignal=function(){return null},dr.cloneElement=function(F,R,Q){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var W=v({},F.props),te=F.key;if(R!=null)for(se in R.key!==void 0&&(te=""+R.key),R)!A.call(R,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&R.ref===void 0||(W[se]=R[se]);var se=arguments.length-2;if(se===1)W.children=Q;else if(1<se){for(var re=Array(se),ae=0;ae<se;ae++)re[ae]=arguments[ae+2];W.children=re}return I(F.type,te,W)},dr.createContext=function(F){return F={$$typeof:o,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:i,_context:F},F},dr.createElement=function(F,R,Q){var W,te={},se=null;if(R!=null)for(W in R.key!==void 0&&(se=""+R.key),R)A.call(R,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(te[W]=R[W]);var re=arguments.length-2;if(re===1)te.children=Q;else if(1<re){for(var ae=Array(re),oe=0;oe<re;oe++)ae[oe]=arguments[oe+2];te.children=ae}if(F&&F.defaultProps)for(W in re=F.defaultProps,re)te[W]===void 0&&(te[W]=re[W]);return I(F,se,te)},dr.createRef=function(){return{current:null}},dr.forwardRef=function(F){return{$$typeof:c,render:F}},dr.isValidElement=M,dr.lazy=function(F){return{$$typeof:f,_payload:{_status:-1,_result:F},_init:G}},dr.memo=function(F,R){return{$$typeof:d,type:F,compare:R===void 0?null:R}},dr.startTransition=function(F){var R=j.T,Q={};j.T=Q;try{var W=F(),te=j.S;te!==null&&te(Q,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(T,L)}catch(se){L(se)}finally{R!==null&&Q.types!==null&&(R.types=Q.types),j.T=R}},dr.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},dr.use=function(F){return j.H.use(F)},dr.useActionState=function(F,R,Q){return j.H.useActionState(F,R,Q)},dr.useCallback=function(F,R){return j.H.useCallback(F,R)},dr.useContext=function(F){return j.H.useContext(F)},dr.useDebugValue=function(){},dr.useDeferredValue=function(F,R){return j.H.useDeferredValue(F,R)},dr.useEffect=function(F,R){return j.H.useEffect(F,R)},dr.useEffectEvent=function(F){return j.H.useEffectEvent(F)},dr.useId=function(){return j.H.useId()},dr.useImperativeHandle=function(F,R,Q){return j.H.useImperativeHandle(F,R,Q)},dr.useInsertionEffect=function(F,R){return j.H.useInsertionEffect(F,R)},dr.useLayoutEffect=function(F,R){return j.H.useLayoutEffect(F,R)},dr.useMemo=function(F,R){return j.H.useMemo(F,R)},dr.useOptimistic=function(F,R){return j.H.useOptimistic(F,R)},dr.useReducer=function(F,R,Q){return j.H.useReducer(F,R,Q)},dr.useRef=function(F){return j.H.useRef(F)},dr.useState=function(F){return j.H.useState(F)},dr.useSyncExternalStore=function(F,R,Q){return j.H.useSyncExternalStore(F,R,Q)},dr.useTransition=function(){return j.H.useTransition()},dr.version="19.2.4",dr}var Txe;function Jk(){return Txe||(Txe=1,g7.exports=wkt()),g7.exports}var x=Jk();const Oe=yo(x),Rw=Tze({__proto__:null,default:Oe},[x]);var v7={exports:{}},$E={},y7={exports:{}},b7={};var Nxe;function Skt(){return Nxe||(Nxe=1,(function(e){function t(q,z){var H=q.length;q.push(z);e:for(;0<H;){var G=H-1>>>1,L=q[G];if(0<a(L,z))q[G]=z,q[H]=L,H=G;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var z=q[0],H=q.pop();if(H!==z){q[0]=H;e:for(var G=0,L=q.length,Z=L>>>1;G<Z;){var F=2*(G+1)-1,R=q[F],Q=F+1,W=q[Q];if(0>a(R,H))Q<L&&0>a(W,R)?(q[G]=W,q[Q]=H,G=Q):(q[G]=R,q[F]=H,G=F);else if(Q<L&&0>a(W,H))q[G]=W,q[Q]=H,G=Q;else break e}}return z}function a(q,z){var H=q.sortIndex-z.sortIndex;return H!==0?H:q.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],u=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function k(q){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=q)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function E(q){if(g=!1,k(q),!m)if(n(c)!==null)m=!0,C||(C=!0,M());else{var z=n(u);z!==null&&V(E,z.startTime-q)}}var C=!1,T=-1,j=5,A=-1;function I(){return v?!0:!(e.unstable_now()-A<j)}function P(){if(v=!1,C){var q=e.unstable_now();A=q;var z=!0;try{e:{m=!1,g&&(g=!1,S(T),T=-1),h=!0;var H=p;try{t:{for(k(q),f=n(c);f!==null&&!(f.expirationTime>q&&I());){var G=f.callback;if(typeof G=="function"){f.callback=null,p=f.priorityLevel;var L=G(f.expirationTime<=q);if(q=e.unstable_now(),typeof L=="function"){f.callback=L,k(q),z=!0;break t}f===n(c)&&r(c),k(q)}else r(c);f=n(c)}if(f!==null)z=!0;else{var Z=n(u);Z!==null&&V(E,Z.startTime-q),z=!1}}break e}finally{f=null,p=H,h=!1}z=void 0}}finally{z?M():C=!1}}}var M;if(typeof O=="function")M=function(){O(P)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=P,M=function(){D.postMessage(null)}}else M=function(){b(P,0)};function V(q,z){T=b(function(){q(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(q){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var H=p;p=z;try{return q()}finally{p=H}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(q,z){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var H=p;p=q;try{return z()}finally{p=H}},e.unstable_scheduleCallback=function(q,z,H){var G=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?G+H:G):H=G,q){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=H+L,q={id:d++,callback:z,priorityLevel:q,startTime:H,expirationTime:L,sortIndex:-1},H>G?(q.sortIndex=H,t(u,q),n(c)===null&&q===n(u)&&(g?(S(T),T=-1):g=!0,V(E,H-G))):(q.sortIndex=L,t(c,q),m||h||(m=!0,C||(C=!0,M()))),q},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(q){var z=p;return function(){var H=p;p=z;try{return q.apply(this,arguments)}finally{p=H}}}})(b7)),b7}var Axe;function Okt(){return Axe||(Axe=1,y7.exports=Skt()),y7.exports}var x7={exports:{}},Dl={};var Ixe;function kkt(){if(Ixe)return Dl;Ixe=1;var e=Jk();function t(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Dl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dl.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return s(c,u,null,d)},Dl.flushSync=function(c){var u=i.T,d=r.p;try{if(i.T=null,r.p=2,c)return c()}finally{i.T=u,r.p=d,r.d.f()}},Dl.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},Dl.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Dl.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,h=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:p,fetchPriority:h}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:p,fetchPriority:h,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Dl.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=o(u.as,u.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(c)},Dl.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=o(d,u.crossOrigin);r.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Dl.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=o(u.as,u.crossOrigin);r.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(c)},Dl.requestFormReset=function(c){r.d.r(c)},Dl.unstable_batchedUpdates=function(c,u){return c(u)},Dl.useFormState=function(c,u,d){return i.H.useFormState(c,u,d)},Dl.useFormStatus=function(){return i.H.useHostTransitionStatus()},Dl.version="19.2.4",Dl}var Rxe;function Nze(){if(Rxe)return x7.exports;Rxe=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),x7.exports=kkt(),x7.exports}var Pxe;function _kt(){if(Pxe)return $E;Pxe=1;var e={env:{}};var t=Okt(),n=Jk(),r=Nze();function a(y){var w="https://react.dev/errors/"+y;if(1<arguments.length){w+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)w+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+y+"; visit "+w+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(y){return!(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)}function i(y){var w=y,_=y;if(y.alternate)for(;w.return;)w=w.return;else{y=w;do w=y,(w.flags&4098)!==0&&(_=w.return),y=w.return;while(y)}return w.tag===3?_:null}function o(y){if(y.tag===13){var w=y.memoizedState;if(w===null&&(y=y.alternate,y!==null&&(w=y.memoizedState)),w!==null)return w.dehydrated}return null}function c(y){if(y.tag===31){var w=y.memoizedState;if(w===null&&(y=y.alternate,y!==null&&(w=y.memoizedState)),w!==null)return w.dehydrated}return null}function u(y){if(i(y)!==y)throw Error(a(188))}function d(y){var w=y.alternate;if(!w){if(w=i(y),w===null)throw Error(a(188));return w!==y?null:y}for(var _=y,N=w;;){var $=_.return;if($===null)break;var U=$.alternate;if(U===null){if(N=$.return,N!==null){_=N;continue}break}if($.child===U.child){for(U=$.child;U;){if(U===_)return u($),y;if(U===N)return u($),w;U=U.sibling}throw Error(a(188))}if(_.return!==N.return)_=$,N=U;else{for(var ee=!1,ce=$.child;ce;){if(ce===_){ee=!0,_=$,N=U;break}if(ce===N){ee=!0,N=$,_=U;break}ce=ce.sibling}if(!ee){for(ce=U.child;ce;){if(ce===_){ee=!0,_=U,N=$;break}if(ce===N){ee=!0,N=U,_=$;break}ce=ce.sibling}if(!ee)throw Error(a(189))}}if(_.alternate!==N)throw Error(a(190))}if(_.tag!==3)throw Error(a(188));return _.stateNode.current===_?y:w}function f(y){var w=y.tag;if(w===5||w===26||w===27||w===6)return y;for(y=y.child;y!==null;){if(w=f(y),w!==null)return w;y=y.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),k=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function B(y){return y===null||typeof y!="object"?null:(y=M&&y[M]||y["@@iterator"],typeof y=="function"?y:null)}var D=Symbol.for("react.client.reference");function V(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===D?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case v:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof y=="object")switch(y.$$typeof){case g:return"Portal";case k:return y.displayName||"Context";case O:return(y._context.displayName||"Context")+".Consumer";case E:var w=y.render;return y=y.displayName,y||(y=w.displayName||w.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case j:return w=y.displayName||null,w!==null?w:V(y.type)||"Memo";case A:w=y._payload,y=y._init;try{return V(y(w))}catch{}}return null}var q=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},L=[],Z=-1;function F(y){return{current:y}}function R(y){0>Z||(y.current=L[Z],L[Z]=null,Z--)}function Q(y,w){Z++,L[Z]=y.current,y.current=w}var W=F(null),te=F(null),se=F(null),re=F(null);function ae(y,w){switch(Q(se,w),Q(te,y),Q(W,null),w.nodeType){case 9:case 11:y=(y=w.documentElement)&&(y=y.namespaceURI)?Zbe(y):0;break;default:if(y=w.tagName,w=w.namespaceURI)w=Zbe(w),y=Ybe(w,y);else switch(y){case"svg":y=1;break;case"math":y=2;break;default:y=0}}R(W),Q(W,y)}function oe(){R(W),R(te),R(se)}function de(y){y.memoizedState!==null&&Q(re,y);var w=W.current,_=Ybe(w,y.type);w!==_&&(Q(te,y),Q(W,_))}function K(y){te.current===y&&(R(W),R(te)),re.current===y&&(R(re),IE._currentValue=G)}var ne,ie;function ve(y){if(ne===void 0)try{throw Error()}catch(_){var w=_.stack.trim().match(/\n( *(at )?)/);ne=w&&w[1]||"",ie=-1<_.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<_.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+ne+y+ie}var ge=!1;function ke(y,w){if(!y||ge)return"";ge=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var N={DetermineComponentFrameRoot:function(){try{if(w){var at=function(){throw Error()};if(Object.defineProperty(at.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(at,[])}catch(Ze){var Ve=Ze}Reflect.construct(y,[],at)}else{try{at.call()}catch(Ze){Ve=Ze}y.call(at.prototype)}}else{try{throw Error()}catch(Ze){Ve=Ze}(at=y())&&typeof at.catch=="function"&&at.catch(function(){})}}catch(Ze){if(Ze&&Ve&&typeof Ze.stack=="string")return[Ze.stack,Ve.stack]}return[null,null]}};N.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var $=Object.getOwnPropertyDescriptor(N.DetermineComponentFrameRoot,"name");$&&$.configurable&&Object.defineProperty(N.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var U=N.DetermineComponentFrameRoot(),ee=U[0],ce=U[1];if(ee&&ce){var Ee=ee.split(`
5
5
  `),Be=ce.split(`
@@ -56,7 +56,7 @@ Error message: ${Joe(n)}`,cause:n}),this[d0e]=!0,this.value=t}static isInstance(
56
56
  ]))`;continue}else if(a[u]==="$"){s+=`($|(?=[\r
57
57
  ]))`;continue}}if(r.s&&a[u]==="."){s+=o?`${a[u]}\r
58
58
  `:`[${a[u]}\r
59
- ]`;continue}s+=a[u],a[u]==="\\"?i=!0:o&&a[u]==="]"?o=!1:!o&&a[u]==="["&&(o=!0)}return s}function GVe(e,t){var n,r,a,s,i,o;const c={type:"object",additionalProperties:(n=Ka(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===$e.ZodString&&((a=e.keyType._def.checks)!=null&&a.length)){const{type:u,...d}=QVe(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)===$e.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===$e.ZodBranded&&e.keyType._def.type._def.typeName===$e.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:u,...d}=qVe(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function yTt(e,t){if(t.mapStrategy==="record")return GVe(e,t);const n=Ka(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||jd(),r=Ka(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||jd();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function bTt(e){const t=e.values,r=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),a=Array.from(new Set(r.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r}}function xTt(){return{not:jd()}}function wTt(){return{type:"null"}}var $ee={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function STt(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in $ee&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((a,s)=>{const i=$ee[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((a,s)=>{const i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];default:return a}},[]);if(r.length===n.length){const a=r.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,a)=>[...r,...a._def.values.filter(s=>!r.includes(s))],[])};return OTt(e,t)}var OTt=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,a)=>Ka(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function kTt(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[$ee[e.innerType._def.typeName],"null"]};const n=Ka(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function _Tt(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function ETt(e,t){const n={type:"object",properties:{}},r=[],a=e.shape();for(const i in a){let o=a[i];if(o===void 0||o._def===void 0)continue;const c=jTt(o),u=Ka(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(n.properties[i]=u,c||r.push(i))}r.length&&(n.required=r);const s=CTt(e,t);return s!==void 0&&(n.additionalProperties=s),n}function CTt(e,t){if(e.catchall._def.typeName!=="ZodNever")return Ka(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 jTt(e){try{return e.isOptional()}catch{return!0}}var TTt=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Ka(e.innerType._def,t);const r=Ka(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:jd()},r]}:jd()},NTt=(e,t)=>{if(t.pipeStrategy==="input")return Ka(e.in._def,t);if(t.pipeStrategy==="output")return Ka(e.out._def,t);const n=Ka(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Ka(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(a=>a!==void 0)}};function ATt(e,t){return Ka(e.type._def,t)}function ITt(e,t){const r={type:"array",uniqueItems:!0,items:Ka(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function RTt(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Ka(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ka(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Ka(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function PTt(){return{not:jd()}}function MTt(){return jd()}var DTt=(e,t)=>Ka(e.innerType._def,t),$Tt=(e,t,n)=>{switch(t){case $e.ZodString:return QVe(e,n);case $e.ZodNumber:return _Tt(e);case $e.ZodObject:return ETt(e,n);case $e.ZodBigInt:return iTt(e);case $e.ZodBoolean:return oTt();case $e.ZodDate:return HVe(e,n);case $e.ZodUndefined:return PTt();case $e.ZodNull:return wTt();case $e.ZodArray:return sTt(e,n);case $e.ZodUnion:case $e.ZodDiscriminatedUnion:return STt(e,n);case $e.ZodIntersection:return hTt(e,n);case $e.ZodTuple:return RTt(e,n);case $e.ZodRecord:return GVe(e,n);case $e.ZodLiteral:return mTt(e);case $e.ZodEnum:return fTt(e);case $e.ZodNativeEnum:return bTt(e);case $e.ZodNullable:return kTt(e,n);case $e.ZodOptional:return TTt(e,n);case $e.ZodMap:return yTt(e,n);case $e.ZodSet:return ITt(e,n);case $e.ZodLazy:return()=>e.getter()._def;case $e.ZodPromise:return ATt(e,n);case $e.ZodNaN:case $e.ZodNever:return xTt();case $e.ZodEffects:return dTt(e,n);case $e.ZodAny:return jd();case $e.ZodUnknown:return MTt();case $e.ZodDefault:return uTt(e,n);case $e.ZodBranded:return qVe(e,n);case $e.ZodReadonly:return DTt(e,n);case $e.ZodCatch:return lTt(e,n);case $e.ZodPipeline:return NTt(e,n);case $e.ZodFunction:case $e.ZodVoid:case $e.ZodSymbol:return;default:return(r=>{})()}};function Ka(e,t,n=!1){var r;const a=t.seen.get(e);if(t.override){const c=(r=t.override)==null?void 0:r.call(t,e,t,a,n);if(c!==rTt)return c}if(a&&!n){const c=LTt(a,t);if(c!==void 0)return c}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=$Tt(e,e.typeName,t),o=typeof i=="function"?Ka(i(),t):i;if(o&&FTt(e,t,o),t.postProcess){const c=t.postProcess(o,e,t);return s.jsonSchema=o,c}return s.jsonSchema=o,o}var LTt=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:nTt(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),jd()):t.$refStrategy==="seen"?jd():void 0}},FTt=(e,t,n)=>(e.description&&(n.description=e.description),n),zTt=e=>{const t=aTt(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},BTt=(e,t)=>{var n;const r=zTt(t);let a=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,f])=>{var p;return{...u,[d]:(p=Ka(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:jd()}},{}):void 0;const s=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(n=Ka(e._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:jd(),o=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;o!==void 0&&(i.title=o);const c=s===void 0?a?{...i,[r.definitionPath]:a}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...a,[s]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},UTt=BTt;function VTt(e,t){var n;const r=(n=void 0)!=null?n:!1;return tle(()=>UTt(e,{$refStrategy:r?"root":"none"}),{validate:async a=>{const s=await e.safeParseAsync(a);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function qTt(e,t){var n;const r=(n=void 0)!=null?n:!1;return tle(()=>rD(DA(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async a=>{const s=await foe(e,a);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function HTt(e){return"_zod"in e}function Qp(e,t){return HTt(e)?qTt(e):VTt(e)}var Lee=Symbol.for("vercel.ai.schema");function b5(e){let t;return()=>(t==null&&(t=e()),t)}function tle(e,{validate:t}={}){return{[Lee]:!0,_type:void 0,[d$]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function QTt(e){return typeof e=="object"&&e!==null&&Lee in e&&e[Lee]===!0&&"jsonSchema"in e&&"validate"in e}function GTt(e){return e==null?tle({properties:{},additionalProperties:!1}):QTt(e)?e:typeof e=="function"?e():Qp(e)}function WTt(e){return e?.replace(/\/$/,"")}var ZTt={},WVe=CL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-context.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(p,h)=>{for(var m in h)n(p,m,{get:h[m],enumerable:!0})},o=(p,h,m,g)=>{if(h&&typeof h=="object"||typeof h=="function")for(let v of a(h))!s.call(p,v)&&v!==m&&n(p,v,{get:()=>h[v],enumerable:!(g=r(h,v))||g.enumerable});return p},c=p=>o(n({},"__esModule",{value:!0}),p),u={};i(u,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>f}),t.exports=c(u);var d=Symbol.for("@vercel/request-context");function f(){return globalThis[d]?.get?.()??{}}}}),YTt=CL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(m,g)=>{for(var v in g)n(m,v,{get:g[v],enumerable:!0})},o=(m,g,v,b)=>{if(g&&typeof g=="object"||typeof g=="function")for(let S of a(g))!s.call(m,S)&&S!==v&&n(m,S,{get:()=>g[S],enumerable:!(b=r(g,S))||b.enumerable});return m},c=m=>o(n({},"__esModule",{value:!0}),m),u={};i(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>h}),t.exports=c(u);var d=WVe(),f=Rkt();async function p(){let m="",g;try{m=h()}catch(v){g=v}try{const[{getTokenPayload:v,isExpired:b},{refreshToken:S}]=await Promise.all([await Qe(()=>import("./token-util-RMHT2CPJ-VVUHOXBL-Dzo4_r1w.js"),__vite__mapDeps([0,1,2]),import.meta.url),await Qe(()=>import("./token-APYSY3BW-RPVF55TR-BUa4m6n5.js"),__vite__mapDeps([3,1,2]),import.meta.url)]);(!m||b(v(m)))&&(await S(),m=h())}catch(v){let b=g instanceof Error?g.message:"";throw v instanceof Error&&(b=`${b}
59
+ ]`;continue}s+=a[u],a[u]==="\\"?i=!0:o&&a[u]==="]"?o=!1:!o&&a[u]==="["&&(o=!0)}return s}function GVe(e,t){var n,r,a,s,i,o;const c={type:"object",additionalProperties:(n=Ka(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===$e.ZodString&&((a=e.keyType._def.checks)!=null&&a.length)){const{type:u,...d}=QVe(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)===$e.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((i=e.keyType)==null?void 0:i._def.typeName)===$e.ZodBranded&&e.keyType._def.type._def.typeName===$e.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:u,...d}=qVe(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function yTt(e,t){if(t.mapStrategy==="record")return GVe(e,t);const n=Ka(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||jd(),r=Ka(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||jd();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function bTt(e){const t=e.values,r=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),a=Array.from(new Set(r.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r}}function xTt(){return{not:jd()}}function wTt(){return{type:"null"}}var $ee={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function STt(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in $ee&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((a,s)=>{const i=$ee[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((a,s)=>{const i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];default:return a}},[]);if(r.length===n.length){const a=r.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,a)=>[...r,...a._def.values.filter(s=>!r.includes(s))],[])};return OTt(e,t)}var OTt=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,a)=>Ka(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function kTt(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[$ee[e.innerType._def.typeName],"null"]};const n=Ka(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function _Tt(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function ETt(e,t){const n={type:"object",properties:{}},r=[],a=e.shape();for(const i in a){let o=a[i];if(o===void 0||o._def===void 0)continue;const c=jTt(o),u=Ka(o._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});u!==void 0&&(n.properties[i]=u,c||r.push(i))}r.length&&(n.required=r);const s=CTt(e,t);return s!==void 0&&(n.additionalProperties=s),n}function CTt(e,t){if(e.catchall._def.typeName!=="ZodNever")return Ka(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 jTt(e){try{return e.isOptional()}catch{return!0}}var TTt=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Ka(e.innerType._def,t);const r=Ka(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:jd()},r]}:jd()},NTt=(e,t)=>{if(t.pipeStrategy==="input")return Ka(e.in._def,t);if(t.pipeStrategy==="output")return Ka(e.out._def,t);const n=Ka(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Ka(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(a=>a!==void 0)}};function ATt(e,t){return Ka(e.type._def,t)}function ITt(e,t){const r={type:"array",uniqueItems:!0,items:Ka(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function RTt(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Ka(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ka(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Ka(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function PTt(){return{not:jd()}}function MTt(){return jd()}var DTt=(e,t)=>Ka(e.innerType._def,t),$Tt=(e,t,n)=>{switch(t){case $e.ZodString:return QVe(e,n);case $e.ZodNumber:return _Tt(e);case $e.ZodObject:return ETt(e,n);case $e.ZodBigInt:return iTt(e);case $e.ZodBoolean:return oTt();case $e.ZodDate:return HVe(e,n);case $e.ZodUndefined:return PTt();case $e.ZodNull:return wTt();case $e.ZodArray:return sTt(e,n);case $e.ZodUnion:case $e.ZodDiscriminatedUnion:return STt(e,n);case $e.ZodIntersection:return hTt(e,n);case $e.ZodTuple:return RTt(e,n);case $e.ZodRecord:return GVe(e,n);case $e.ZodLiteral:return mTt(e);case $e.ZodEnum:return fTt(e);case $e.ZodNativeEnum:return bTt(e);case $e.ZodNullable:return kTt(e,n);case $e.ZodOptional:return TTt(e,n);case $e.ZodMap:return yTt(e,n);case $e.ZodSet:return ITt(e,n);case $e.ZodLazy:return()=>e.getter()._def;case $e.ZodPromise:return ATt(e,n);case $e.ZodNaN:case $e.ZodNever:return xTt();case $e.ZodEffects:return dTt(e,n);case $e.ZodAny:return jd();case $e.ZodUnknown:return MTt();case $e.ZodDefault:return uTt(e,n);case $e.ZodBranded:return qVe(e,n);case $e.ZodReadonly:return DTt(e,n);case $e.ZodCatch:return lTt(e,n);case $e.ZodPipeline:return NTt(e,n);case $e.ZodFunction:case $e.ZodVoid:case $e.ZodSymbol:return;default:return(r=>{})()}};function Ka(e,t,n=!1){var r;const a=t.seen.get(e);if(t.override){const c=(r=t.override)==null?void 0:r.call(t,e,t,a,n);if(c!==rTt)return c}if(a&&!n){const c=LTt(a,t);if(c!==void 0)return c}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=$Tt(e,e.typeName,t),o=typeof i=="function"?Ka(i(),t):i;if(o&&FTt(e,t,o),t.postProcess){const c=t.postProcess(o,e,t);return s.jsonSchema=o,c}return s.jsonSchema=o,o}var LTt=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:nTt(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),jd()):t.$refStrategy==="seen"?jd():void 0}},FTt=(e,t,n)=>(e.description&&(n.description=e.description),n),zTt=e=>{const t=aTt(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},BTt=(e,t)=>{var n;const r=zTt(t);let a=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,f])=>{var p;return{...u,[d]:(p=Ka(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:jd()}},{}):void 0;const s=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=(n=Ka(e._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:jd(),o=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;o!==void 0&&(i.title=o);const c=s===void 0?a?{...i,[r.definitionPath]:a}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...a,[s]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},UTt=BTt;function VTt(e,t){var n;const r=(n=void 0)!=null?n:!1;return tle(()=>UTt(e,{$refStrategy:r?"root":"none"}),{validate:async a=>{const s=await e.safeParseAsync(a);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function qTt(e,t){var n;const r=(n=void 0)!=null?n:!1;return tle(()=>rD(DA(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async a=>{const s=await foe(e,a);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function HTt(e){return"_zod"in e}function Qp(e,t){return HTt(e)?qTt(e):VTt(e)}var Lee=Symbol.for("vercel.ai.schema");function b5(e){let t;return()=>(t==null&&(t=e()),t)}function tle(e,{validate:t}={}){return{[Lee]:!0,_type:void 0,[d$]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function QTt(e){return typeof e=="object"&&e!==null&&Lee in e&&e[Lee]===!0&&"jsonSchema"in e&&"validate"in e}function GTt(e){return e==null?tle({properties:{},additionalProperties:!1}):QTt(e)?e:typeof e=="function"?e():Qp(e)}function WTt(e){return e?.replace(/\/$/,"")}var ZTt={},WVe=CL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-context.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(p,h)=>{for(var m in h)n(p,m,{get:h[m],enumerable:!0})},o=(p,h,m,g)=>{if(h&&typeof h=="object"||typeof h=="function")for(let v of a(h))!s.call(p,v)&&v!==m&&n(p,v,{get:()=>h[v],enumerable:!(g=r(h,v))||g.enumerable});return p},c=p=>o(n({},"__esModule",{value:!0}),p),u={};i(u,{SYMBOL_FOR_REQ_CONTEXT:()=>d,getContext:()=>f}),t.exports=c(u);var d=Symbol.for("@vercel/request-context");function f(){return globalThis[d]?.get?.()??{}}}}),YTt=CL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(m,g)=>{for(var v in g)n(m,v,{get:g[v],enumerable:!0})},o=(m,g,v,b)=>{if(g&&typeof g=="object"||typeof g=="function")for(let S of a(g))!s.call(m,S)&&S!==v&&n(m,S,{get:()=>g[S],enumerable:!(b=r(g,S))||b.enumerable});return m},c=m=>o(n({},"__esModule",{value:!0}),m),u={};i(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>h}),t.exports=c(u);var d=WVe(),f=Rkt();async function p(){let m="",g;try{m=h()}catch(v){g=v}try{const[{getTokenPayload:v,isExpired:b},{refreshToken:S}]=await Promise.all([await Qe(()=>import("./token-util-RMHT2CPJ-VVUHOXBL-BVs4tK1U.js"),__vite__mapDeps([0,1,2]),import.meta.url),await Qe(()=>import("./token-APYSY3BW-RPVF55TR-DyzKZA6C.js"),__vite__mapDeps([3,1,2]),import.meta.url)]);(!m||b(v(m)))&&(await S(),m=h())}catch(v){let b=g instanceof Error?g.message:"";throw v instanceof Error&&(b=`${b}
60
60
  ${v.message}`),b?new f.VercelOidcTokenError(b):v}return m}function h(){const m=(0,d.getContext)().headers?.["x-vercel-oidc-token"]??ZTt.VERCEL_OIDC_TOKEN;if(!m)throw new Error("The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?");return m}}}),ZVe=CL({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/index.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(p,h)=>{for(var m in h)n(p,m,{get:h[m],enumerable:!0})},o=(p,h,m,g)=>{if(h&&typeof h=="object"||typeof h=="function")for(let v of a(h))!s.call(p,v)&&v!==m&&n(p,v,{get:()=>h[v],enumerable:!(g=r(h,v))||g.enumerable});return p},c=p=>o(n({},"__esModule",{value:!0}),p),u={};i(u,{getContext:()=>f.getContext,getVercelOidcToken:()=>d.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync}),t.exports=c(u);var d=YTt(),f=WVe()}}),XTt=Rze(ZVe()),KTt=Rze(ZVe()),JTt="vercel.ai.gateway.error",_7=Symbol.for(JTt),y0e,b0e,Rc=class YVe extends(b0e=Error,y0e=_7,b0e){constructor({message:t,statusCode:n=500,cause:r}){super(t),this[y0e]=!0,this.statusCode=n,this.cause=r}static isInstance(t){return YVe.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&_7 in t&&t[_7]===!0}},XVe="GatewayAuthenticationError",eNt=`vercel.ai.gateway.error.${XVe}`,x0e=Symbol.for(eNt),w0e,S0e,KVe=class JVe extends(S0e=Rc,w0e=x0e,S0e){constructor({message:t="Authentication failed",statusCode:n=401,cause:r}={}){super({message:t,statusCode:n,cause:r}),this[w0e]=!0,this.name=XVe,this.type="authentication_error"}static isInstance(t){return Rc.hasMarker(t)&&x0e in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:r="Authentication failed",statusCode:a=401,cause:s}){let i;return t?i=`AI Gateway authentication failed: Invalid API key.
61
61
 
62
62
  Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
@@ -205,7 +205,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
205
205
  constructor(\${params}) {
206
206
  \${}
207
207
  }
208
- }`,{label:"class",detail:"definition",type:"keyword"}),tu('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),tu('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],yrt=ode.concat([tu("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),tu("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),tu("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),t_e=new xet,brt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function XE(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const Kin=["FunctionDeclaration"],Jin={FunctionDeclaration:XE("function"),ClassDeclaration:XE("class"),ClassExpression:()=>!0,EnumDeclaration:XE("constant"),TypeAliasDeclaration:XE("type"),NamespaceDeclaration:XE("namespace"),VariableDefinition(e,t){e.matchContext(Kin)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function xrt(e,t){let n=t_e.get(t);if(n)return n;let r=[],a=!0;function s(i,o){let c=e.sliceString(i.from,i.to);r.push({label:c,type:o})}return t.cursor(Ga.IncludeAnonymous).iterate(i=>{if(a)a=!1;else if(i.name){let o=Jin[i.name];if(o&&o(i,s)||brt.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of xrt(e,i.node))r.push(o);return!1}}),t_e.set(t,r),r}const b4=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,lde=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function wrt(e){let t=us(e.state).resolveInner(e.pos,-1);if(lde.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&b4.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let a=t;a;a=a.parent)brt.has(a.name)&&(r=r.concat(xrt(e.state.doc,a)));return{options:r,from:n?t.from:e.pos,validFor:b4}}function cU(e,t,n){var r;let a=[];for(;;){let s=t.firstChild,i;if(s?.name=="VariableName")return a.push(e(s)),{path:a.reverse(),name:n};if(s?.name=="MemberExpression"&&((r=i=s.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")a.push(e(i)),t=s;else return null}}function Srt(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=us(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?cU(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?cU(t,n.parent,""):lde.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&b4.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?cU(t,n,""):e.explicit?{path:[],name:""}:null}function eon(e,t){let n=e,r=[],a=new Set;for(let s=0;;s++){for(let o of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||a.has(o))continue;a.add(o);let c;try{c=n[o]}catch{continue}r.push({label:o,type:typeof c=="function"?/^[A-Z]/.test(o)?"class":t?"function":"method":t?"variable":"property",boost:-s})}let i=Object.getPrototypeOf(e);if(!i)return r;e=i}}function ton(e){let t=new Map;return n=>{let r=Srt(n);if(!r)return null;let a=e;for(let i of r.path)if(a=a[i],!a)return null;let s=t.get(a);return s||t.set(a,s=eon(a,!r.path.length)),{from:n.pos-r.name.length,options:s,validFor:b4}}}const If=rw.define({name:"javascript",parser:Xin.configure({props:[Xw.add({IfStatement:vO({except:/^\s*({|else\b)/}),TryStatement:vO({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Xnn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Ynn({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":vO({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Kw.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Fue,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,r=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?e.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Ort={test:e=>/^JSX/.test(e.name),facet:B6({commentTokens:{block:{open:"{/*",close:"*/}"}}})},cde=If.configure({dialect:"ts"},"typescript"),ude=If.configure({dialect:"jsx",props:[Due.add(e=>e.isTop?[Ort]:void 0)]}),dde=If.configure({dialect:"jsx ts",props:[Due.add(e=>e.isTop?[Ort]:void 0)]},"typescript");let krt=e=>({label:e,type:"keyword"});const _rt="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(krt),non=_rt.concat(["declare","implements","private","protected","public"].map(krt));function x4(e={}){let t=e.jsx?e.typescript?dde:ude:e.typescript?cde:If,n=e.typescript?yrt.concat(non):ode.concat(_rt);return new sw(t,[If.data.of({autocomplete:Drn(lde,xnt(n))}),If.data.of({autocomplete:wrt}),e.jsx?Ert:[]])}function ron(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function n_e(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const aon=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Ert=vt.inputHandler.of((e,t,n,r,a)=>{if((aon?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!If.isActiveAt(e.state,t,-1))return!1;let s=a(),{state:i}=s,o=i.changeByRange(c=>{var u;let{head:d}=c,f=us(i).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==d-2&&((p=n_e(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:Je.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=ron(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=n_e(i.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function son(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((n,r)=>{var a;!((a=n.meta.docs)===null||a===void 0)&&a.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,a=[];for(let{from:s,to:i}of If.findRegions(r)){let o=r.doc.lineAt(s),c={line:o.number-1,col:s-o.from,pos:s};for(let u of e.verify(r.sliceDoc(s,i),t))a.push(ion(u,r.doc,c))}return a}}function r_e(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function ion(e,t,n){let r=r_e(e.line,e.column,t,n),a={from:r,to:e.endLine!=null&&e.endColumn!=1?r_e(e.endLine,e.endColumn,t,n):r,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:s,text:i}=e.fix,o=s[0]+n.pos-r,c=s[1]+n.pos-r;a.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+o,to:d+c,insert:i},scrollIntoView:!0})}}]}return a}const AM=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Ert,completionPath:Srt,esLint:son,javascript:x4,javascriptLanguage:If,jsxLanguage:ude,localCompletionSource:wrt,scopeCompletionSource:ton,snippets:ode,tsxLanguage:dde,typescriptLanguage:cde,typescriptSnippets:yrt},Symbol.toStringTag,{value:"Module"})),KE=["_blank","_self","_top","_parent"],uU=["ascii","utf-8","utf-16","latin1","latin1"],dU=["get","post","put","delete"],fU=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Yu=["true","false"],Nn={},oon={a:{attrs:{href:null,ping:null,type:null,media:null,target:KE,hreflang:null}},abbr:Nn,address:Nn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Nn,aside:Nn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Nn,base:{attrs:{href:null,target:KE}},bdi:Nn,bdo:Nn,blockquote:{attrs:{cite:null}},body:Nn,br:Nn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:fU,formmethod:dU,formnovalidate:["novalidate"],formtarget:KE,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Nn,center:Nn,cite:Nn,code:Nn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Nn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Nn,div:Nn,dl:Nn,dt:Nn,em:Nn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Nn,figure:Nn,footer:Nn,form:{attrs:{action:null,name:null,"accept-charset":uU,autocomplete:["on","off"],enctype:fU,method:dU,novalidate:["novalidate"],target:KE}},h1:Nn,h2:Nn,h3:Nn,h4:Nn,h5:Nn,h6:Nn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Nn,hgroup:Nn,hr:Nn,html:{attrs:{manifest:null}},i:Nn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:fU,formmethod:dU,formnovalidate:["novalidate"],formtarget:KE,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Nn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Nn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Nn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:uU,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Nn,noscript:Nn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Nn,param:{attrs:{name:null,value:null}},pre:Nn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Nn,rt:Nn,ruby:Nn,samp:Nn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:uU}},section:Nn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Nn,source:{attrs:{src:null,type:null,media:null}},span:Nn,strong:Nn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Nn,summary:Nn,sup:Nn,table:Nn,tbody:Nn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Nn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Nn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Nn,time:{attrs:{datetime:null}},title:Nn,tr:Nn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Nn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Nn},Crt={accesskey:null,class:null,contenteditable:Yu,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Yu,autocorrect:Yu,autocapitalize:Yu,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Yu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Yu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Yu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Yu,"aria-hidden":Yu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Yu,"aria-multiselectable":Yu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Yu,"aria-relevant":null,"aria-required":Yu,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},jrt="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of jrt)Crt[e]=null;let gN=class{constructor(t,n){this.tags={...oon,...t},this.globalAttrs={...Crt,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};gN.default=new gN;function pk(e,t,n=e.length){if(!t)return"";let r=t.firstChild,a=r&&r.getChild("TagName");return a?e.sliceString(a.from,Math.min(a.to,n)):""}function hk(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function Trt(e,t,n){let r=n.tags[pk(e,hk(t))];return r?.children||n.allTags}function fde(e,t){let n=[];for(let r=hk(t);r&&!r.type.isTop;r=hk(r.parent)){let a=pk(e,r);if(a&&r.lastChild.name=="CloseTag")break;a&&n.indexOf(a)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(a)}return n}const Nrt=/^[:\-\.\w\u00b7-\uffff]*$/;function a_e(e,t,n,r,a){let s=/\s*>/.test(e.sliceDoc(a,a+5))?"":">",i=hk(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:a,options:Trt(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(fde(e.doc,n).map((o,c)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function s_e(e,t,n,r){let a=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:fde(e.doc,t).map((s,i)=>({label:s,apply:s+a,type:"type",boost:99-i})),validFor:Nrt}}function lon(e,t,n,r){let a=[],s=0;for(let i of Trt(e.doc,n,t))a.push({label:"<"+i,type:"type"});for(let i of fde(e.doc,n))a.push({label:"</"+i+">",type:"type",boost:99-s++});return{from:r,to:r,options:a,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function con(e,t,n,r,a){let s=hk(n),i=s?t.tags[pk(e.doc,s)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:a,options:c.map(u=>({label:u,type:"property"})),validFor:Nrt}}function uon(e,t,n,r,a){var s;let i=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=hk(n),p=f?t.tags[pk(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,a).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(a,a+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:p+m+h,type:"constant"})}}return{from:r,to:a,options:o,validFor:c}}function Art(e,t){let{state:n,pos:r}=t,a=us(n).resolveInner(r,-1),s=a.resolve(r);for(let i=r,o;s==a&&(o=a.childBefore(i));){let c=o.lastChild;if(!c||!c.type.isError||c.from<c.to)break;s=a=o,i=c.from}return a.name=="TagName"?a.parent&&/CloseTag$/.test(a.parent.name)?s_e(n,a,a.from,r):a_e(n,e,a,a.from,r):a.name=="StartTag"||a.name=="IncompleteTag"?a_e(n,e,a,r,r):a.name=="StartCloseTag"||a.name=="IncompleteCloseTag"?s_e(n,a,r,r):a.name=="OpenTag"||a.name=="SelfClosingTag"||a.name=="AttributeName"?con(n,e,a,a.name=="AttributeName"?a.from:r,r):a.name=="Is"||a.name=="AttributeValue"||a.name=="UnquotedAttributeValue"?uon(n,e,a,a.name=="Is"?r:a.from,r):t.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?lon(n,e,a,r):null}function Irt(e){return Art(gN.default,e)}function Rrt(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new gN(t,n):gN.default;return a=>Art(r,a)}const don=If.parser.configure({top:"SingleExpression"}),Prt=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:cde.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:ude.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:dde.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:don},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:If.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:mN.parser}],Mrt=[{name:"style",parser:mN.parser.configure({top:"Styles"})}].concat(jrt.map(e=>({name:e,parser:If.parser}))),Drt=rw.define({name:"html",parser:zsn.configure({props:[Xw.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let r=e.node;;){let a=r.lastChild;if(!a||a.name!="Element"||a.to!=r.to)break;t=r=a}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),Kw.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),pnt.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Uj=Drt.configure({wrap:lrt(Prt,Mrt)});function $rt(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=lrt((e.nestedLanguages||[]).concat(Prt),(e.nestedAttributes||[]).concat(Mrt)));let r=n?Drt.configure({wrap:n,dialect:t}):t?Uj.configure({dialect:t}):Uj;return new sw(r,[Uj.data.of({autocomplete:Rrt(e)}),e.autoCloseTags!==!1?Lrt:[],x4().support,grt().support])}const i_e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Lrt=vt.inputHandler.of((e,t,n,r,a)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!Uj.isActiveAt(e.state,t,-1))return!1;let s=a(),{state:i}=s,o=i.changeByRange(c=>{var u,d,f;let p=i.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,m=us(i).resolveInner(h,-1),g;if(p&&r==">"&&m.name=="EndTag"){let v=m.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=pk(i.doc,v.parent,h))&&!i_e.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`</${g}>`;return{range:c,changes:{from:h,to:b,insert:S}}}}else if(p&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=pk(i.doc,v,h))&&!i_e.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${g}>`;return{range:Je.cursor(h+S.length,-1),changes:{from:h,to:b,insert:S}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),fon=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Lrt,html:$rt,htmlCompletionSource:Irt,htmlCompletionSourceWith:Rrt,htmlLanguage:Uj},Symbol.toStringTag,{value:"Module"})),Frt=B6({commentTokens:{block:{open:"<!--",close:"-->"}}}),zrt=new cr,Brt=Uan.configure({props:[Kw.add(e=>!e.is("Block")||e.is("Document")||Fne(e)!=null||pon(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),zrt.add(Fne),Xw.add({Document:()=>null}),Fy.add({Document:Frt})]});function Fne(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function pon(e){return e.name=="OrderedList"||e.name=="BulletList"}function hon(e,t){let n=e;for(;;){let r=n.nextSibling,a;if(!r||(a=Fne(r.type))!=null&&a<=t)break;n=r}return n.to}const mon=tnt.of((e,t,n)=>{for(let r=us(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let a=r.type.prop(zrt);if(a==null)continue;let s=hon(r,a);if(s>n)return{from:n,to:s}}return null});function pde(e){return new md(Frt,e,[],"markdown")}const Urt=pde(Brt),gon=Brt.configure([Jan,tsn,esn,nsn,{props:[Kw.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),lw=pde(gon);function von(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=qe.matchLanguageName(e,n,!0),r instanceof qe)return r.support?r.support.language.parser:aw.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class pU{constructor(t,n,r,a,s,i,o){this.node=t,this.from=n,this.to=r,this.spaceBefore=a,this.spaceAfter=s,this.type=i,this.item=o}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let a=this.to-this.from-r.length-this.spaceAfter.length;a>0;a--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+qrt(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function Vrt(e,t){let n=[],r=[];for(let a=e;a;a=a.parent){if(a.name=="FencedCode")return r;(a.name=="ListItem"||a.name=="Blockquote")&&n.push(a)}for(let a=n.length-1;a>=0;a--){let s=n[a],i,o=t.lineAt(s.from),c=s.from-o.from;if(s.name=="Blockquote"&&(i=/^ *>( ?)/.exec(o.text.slice(c))))r.push(new pU(s,c,c+i[0].length,"",i[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(o.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),r.push(new pU(s.parent,c,c+d,i[1],u,i[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),r.push(new pU(s.parent,c,c+d,i[1],u,f,s))}}return r}function qrt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function hU(e,t,n,r=0){for(let a=-1,s=e;;){if(s.name=="ListItem"){let o=qrt(s,t),c=+o[2];if(a>=0){if(c!=a+1)return;n.push({from:s.from+o[1].length,to:s.from+o[0].length,insert:String(a+2+r)})}a=c}let i=s.nextSibling;if(!i)break;s=i}}function hde(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(w_)!=" ")return e;let r=Fp(e,4,n),a="";for(let s=r;s>0;)s>=4?(a+=" ",s-=4):(a+=" ",s--);return a+e.slice(n)}const Hrt=(e={})=>({state:t,dispatch:n})=>{let r=us(t),{doc:a}=t,s=null,i=t.changeByRange(o=>{if(!o.empty||!lw.isActiveAt(t,o.from,-1)&&!lw.isActiveAt(t,o.from,1))return s={range:o};let c=o.from,u=a.lineAt(c),d=Vrt(r.resolveInner(c,-1),a);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:o};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:o};let p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){let b=f.node.firstChild,S=f.node.getChild("ListItem","ListItem");if(b.to>=c||S&&S.to<c||u.from>0&&!/[^\s>]/.test(a.lineAt(u.from-1).text)||e.nonTightLists===!1){let O=d.length>1?d[d.length-2]:null,k,E="";O&&O.item?(k=u.from+O.from,E=O.marker(a,1)):k=u.from+(O?O.to:0);let C=[{from:k,to:c,insert:E}];return f.node.name=="OrderedList"&&hU(f.item,a,C,-2),O&&O.node.name=="OrderedList"&&hU(O.item,a,C),{range:Je.cursor(k+E.length),changes:C}}else{let O=l_e(d,t,u);return{range:Je.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&u.from){let b=a.lineAt(u.from-1),S=/>\s*$/.exec(b.text);if(S&&S.index==f.from){let O=t.changes([{from:b.from+S.index,to:b.to},{from:u.from+f.from,to:u.to}]);return{range:o.map(O),changes:O}}}let h=[];f.node.name=="OrderedList"&&hU(f.item,a,h);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let b=0,S=d.length-1;b<=S;b++)g+=b==S&&!m?d[b].marker(a,1):d[b].blank(b<S?Fp(u.text,4,d[b+1].from)-g.length:null);let v=c;for(;v>u.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return g=hde(g,t),yon(f.node,t.doc)&&(g=l_e(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:Je.cursor(v+g.length+1),changes:h}});return s?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},Qrt=Hrt();function o_e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function yon(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let a=t.lineAt(n.to),s=t.lineAt(r.from),i=/^[\s>]*$/.test(a.text);return a.number+(i?0:1)<s.number}function l_e(e,t,n){let r="";for(let a=0,s=e.length-2;a<=s;a++)r+=e[a].blank(a<s?Fp(n.text,4,e[a+1].from)-r.length:null,a<s);return hde(r,t)}function bon(e,t){let n=e.resolveInner(t,-1),r=t;o_e(n)&&(r=n.from,n=n.parent);for(let a;a=n.childBefore(r);)if(o_e(a))r=a.from;else if(a.name=="OrderedList"||a.name=="BulletList")n=a.lastChild,r=n.to;else break;return n}const Grt=({state:e,dispatch:t})=>{let n=us(e),r=null,a=e.changeByRange(s=>{let i=s.from,{doc:o}=e;if(s.empty&&lw.isActiveAt(e,s.from)){let c=o.lineAt(i),u=Vrt(bon(n,i),o);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:Je.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let p=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(Fp(c.text,4,d.to)-Fp(c.text,4,d.from));return p==c.from&&(h=hde(h,e)),{range:Je.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:Je.cursor(p),changes:{from:p,to:i}}}}}return r={range:s}});return r?!1:(t(e.update(a,{scrollIntoView:!0,userEvent:"delete"})),!0)},Wrt=[{key:"Enter",run:Qrt},{key:"Backspace",run:Grt}],Zrt=$rt({matchClosingTags:!1});function mde(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:a}=Urt,completeHTMLTags:s=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=Zrt}=e;if(!(a instanceof H6))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[o.support,mon],d;i&&u.push(Yrt),n instanceof sw?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?von(t,d):void 0;c.push(qan({codeParser:f,htmlParser:o.language.parser})),r&&u.push(Zp.high(x_.of(Wrt)));let p=pde(a.configure(c));return s&&u.push(p.data.of({autocomplete:xon})),new sw(p,u)}function xon(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let a=us(t).resolveInner(n,-1);for(;a&&!a.type.isTop;){if(a.name=="CodeBlock"||a.name=="FencedCode"||a.name=="ProcessingInstructionBlock"||a.name=="CommentBlock"||a.name=="Link"||a.name=="Image")return null;a=a.parent}return{from:n-r[0].length,to:n,options:won(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let mU=null;function won(){if(mU)return mU;let e=Irt(new Hue(Tr.create({extensions:Zrt}),0,!0));return mU=e?e.options:[]}const Son=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Yrt=vt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let a=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!a||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(a)||(/^www\./.test(a)&&(a="https://"+a),!lw.isActiveAt(t.state,r.from,1)))return!1;let s=us(t.state),i=!1;return s.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||Son.test(o.name))&&(i=!0)},leave:o=>{o.to<r.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${a})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Oon=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Urt,deleteMarkupBackward:Grt,insertNewlineContinueMarkup:Qrt,insertNewlineContinueMarkupCommand:Hrt,markdown:mde,markdownKeymap:Wrt,markdownLanguage:lw,pasteURLAsLink:Yrt},Symbol.toStringTag,{value:"Module"}));function ct(e){return new sw(Bue.define(e))}function uy(e){return Qe(()=>import("./index-7nbvipT1.js"),__vite__mapDeps([4,2]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const Xrt=[qe.of({name:"C",extensions:["c","h","ino"],load(){return Qe(()=>import("./index-CaAVpDzx.js"),__vite__mapDeps([5,2]),import.meta.url).then(e=>e.cpp())}}),qe.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Qe(()=>import("./index-CaAVpDzx.js"),__vite__mapDeps([5,2]),import.meta.url).then(e=>e.cpp())}}),qe.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return uy("Cassandra")}}),qe.of({name:"CSS",extensions:["css"],load(){return Qe(()=>Promise.resolve().then(()=>xin),void 0,import.meta.url).then(e=>e.css())}}),qe.of({name:"Go",extensions:["go"],load(){return Qe(()=>import("./index-CwZuPfD1.js"),__vite__mapDeps([6,2]),import.meta.url).then(e=>e.go())}}),qe.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Qe(()=>Promise.resolve().then(()=>fon),void 0,import.meta.url).then(e=>e.html())}}),qe.of({name:"Java",extensions:["java"],load(){return Qe(()=>import("./index-DrXCDkhv.js"),__vite__mapDeps([7,2]),import.meta.url).then(e=>e.java())}}),qe.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Qe(()=>Promise.resolve().then(()=>AM),void 0,import.meta.url).then(e=>e.javascript())}}),qe.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Qe(()=>import("./index-36MEBaXD.js"),__vite__mapDeps([8,2]),import.meta.url).then(e=>e.jinja())}}),qe.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Qe(()=>Promise.resolve().then(()=>Prn),void 0,import.meta.url).then(e=>e.json())}}),qe.of({name:"JSX",extensions:["jsx"],load(){return Qe(()=>Promise.resolve().then(()=>AM),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),qe.of({name:"LESS",extensions:["less"],load(){return Qe(()=>import("./index-BfmviWar.js"),__vite__mapDeps([9,2]),import.meta.url).then(e=>e.less())}}),qe.of({name:"Liquid",extensions:["liquid"],load(){return Qe(()=>import("./index-DvP12bdZ.js"),__vite__mapDeps([10,2]),import.meta.url).then(e=>e.liquid())}}),qe.of({name:"MariaDB SQL",load(){return uy("MariaSQL")}}),qe.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Qe(()=>Promise.resolve().then(()=>Oon),void 0,import.meta.url).then(e=>e.markdown())}}),qe.of({name:"MS SQL",load(){return uy("MSSQL")}}),qe.of({name:"MySQL",load(){return uy("MySQL")}}),qe.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Qe(()=>import("./index-BbAvQTNN.js"),__vite__mapDeps([11,2]),import.meta.url).then(e=>e.php())}}),qe.of({name:"PLSQL",extensions:["pls"],load(){return uy("PLSQL")}}),qe.of({name:"PostgreSQL",load(){return uy("PostgreSQL")}}),qe.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Qe(()=>import("./index-vpG_Uogz.js"),__vite__mapDeps([12,2]),import.meta.url).then(e=>e.python())}}),qe.of({name:"Rust",extensions:["rs"],load(){return Qe(()=>import("./index-CmagytQ4.js"),__vite__mapDeps([13,2]),import.meta.url).then(e=>e.rust())}}),qe.of({name:"Sass",extensions:["sass"],load(){return Qe(()=>import("./index-BU8sJWnm.js"),__vite__mapDeps([14,2]),import.meta.url).then(e=>e.sass({indented:!0}))}}),qe.of({name:"SCSS",extensions:["scss"],load(){return Qe(()=>import("./index-BU8sJWnm.js"),__vite__mapDeps([14,2]),import.meta.url).then(e=>e.sass())}}),qe.of({name:"SQL",extensions:["sql"],load(){return uy("StandardSQL")}}),qe.of({name:"SQLite",load(){return uy("SQLite")}}),qe.of({name:"TSX",extensions:["tsx"],load(){return Qe(()=>Promise.resolve().then(()=>AM),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),qe.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Qe(()=>Promise.resolve().then(()=>AM),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),qe.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Qe(()=>import("./index-BYbxGxDm.js"),__vite__mapDeps([15,2]),import.meta.url).then(e=>e.wast())}}),qe.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Qe(()=>import("./index-qDaZO4pH.js"),__vite__mapDeps([16,2]),import.meta.url).then(e=>e.xml())}}),qe.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Qe(()=>import("./index-BKw6IeKY.js"),__vite__mapDeps([17,2]),import.meta.url).then(e=>e.yaml())}}),qe.of({name:"APL",extensions:["dyalog","apl"],load(){return Qe(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>ct(e.apl))}}),qe.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Qe(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>ct(e.asciiArmor))}}),qe.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Qe(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>ct(e.asn1({})))}}),qe.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Qe(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>ct(e.asterisk))}}),qe.of({name:"Brainfuck",extensions:["b","bf"],load(){return Qe(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>ct(e.brainfuck))}}),qe.of({name:"Cobol",extensions:["cob","cpy"],load(){return Qe(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>ct(e.cobol))}}),qe.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.csharp))}}),qe.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),qe.of({name:"ClojureScript",extensions:["cljs"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),qe.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Qe(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>ct(e.gss))}}),qe.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Qe(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>ct(e.cmake))}}),qe.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Qe(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>ct(e.coffeeScript))}}),qe.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Qe(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>ct(e.commonLisp))}}),qe.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Qe(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>ct(e.cypher))}}),qe.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Qe(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>ct(e.cython))}}),qe.of({name:"Crystal",extensions:["cr"],load(){return Qe(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>ct(e.crystal))}}),qe.of({name:"D",extensions:["d"],load(){return Qe(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>ct(e.d))}}),qe.of({name:"Dart",extensions:["dart"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.dart))}}),qe.of({name:"diff",extensions:["diff","patch"],load(){return Qe(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>ct(e.diff))}}),qe.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Qe(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([18,19]),import.meta.url).then(e=>ct(e.dockerFile))}}),qe.of({name:"DTD",extensions:["dtd"],load(){return Qe(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>ct(e.dtd))}}),qe.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Qe(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>ct(e.dylan))}}),qe.of({name:"EBNF",load(){return Qe(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>ct(e.ebnf))}}),qe.of({name:"ECL",extensions:["ecl"],load(){return Qe(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>ct(e.ecl))}}),qe.of({name:"edn",extensions:["edn"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),qe.of({name:"Eiffel",extensions:["e"],load(){return Qe(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>ct(e.eiffel))}}),qe.of({name:"Elm",extensions:["elm"],load(){return Qe(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>ct(e.elm))}}),qe.of({name:"Erlang",extensions:["erl"],load(){return Qe(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>ct(e.erlang))}}),qe.of({name:"Esper",load(){return Qe(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>ct(e.esper))}}),qe.of({name:"Factor",extensions:["factor"],load(){return Qe(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([20,19]),import.meta.url).then(e=>ct(e.factor))}}),qe.of({name:"FCL",load(){return Qe(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>ct(e.fcl))}}),qe.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Qe(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>ct(e.forth))}}),qe.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Qe(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>ct(e.fortran))}}),qe.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Qe(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.fSharp))}}),qe.of({name:"Gas",extensions:["s"],load(){return Qe(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>ct(e.gas))}}),qe.of({name:"Gherkin",extensions:["feature"],load(){return Qe(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>ct(e.gherkin))}}),qe.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Qe(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>ct(e.groovy))}}),qe.of({name:"Haskell",extensions:["hs"],load(){return Qe(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>ct(e.haskell))}}),qe.of({name:"Haxe",extensions:["hx"],load(){return Qe(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.haxe))}}),qe.of({name:"HXML",extensions:["hxml"],load(){return Qe(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.hxml))}}),qe.of({name:"HTTP",load(){return Qe(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>ct(e.http))}}),qe.of({name:"IDL",extensions:["pro"],load(){return Qe(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>ct(e.idl))}}),qe.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Qe(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>ct(e.jsonld))}}),qe.of({name:"Julia",extensions:["jl"],load(){return Qe(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>ct(e.julia))}}),qe.of({name:"Kotlin",extensions:["kt","kts"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.kotlin))}}),qe.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Qe(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>ct(e.liveScript))}}),qe.of({name:"Lua",extensions:["lua"],load(){return Qe(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>ct(e.lua))}}),qe.of({name:"mIRC",extensions:["mrc"],load(){return Qe(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>ct(e.mirc))}}),qe.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Qe(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>ct(e.mathematica))}}),qe.of({name:"Modelica",extensions:["mo"],load(){return Qe(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>ct(e.modelica))}}),qe.of({name:"MUMPS",extensions:["mps"],load(){return Qe(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>ct(e.mumps))}}),qe.of({name:"Mbox",extensions:["mbox"],load(){return Qe(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>ct(e.mbox))}}),qe.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Qe(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>ct(e.nginx))}}),qe.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Qe(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([21,19]),import.meta.url).then(e=>ct(e.nsis))}}),qe.of({name:"NTriples",extensions:["nt","nq"],load(){return Qe(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>ct(e.ntriples))}}),qe.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveC))}}),qe.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveCpp))}}),qe.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Qe(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.oCaml))}}),qe.of({name:"Octave",extensions:["m"],load(){return Qe(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>ct(e.octave))}}),qe.of({name:"Oz",extensions:["oz"],load(){return Qe(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>ct(e.oz))}}),qe.of({name:"Pascal",extensions:["p","pas"],load(){return Qe(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>ct(e.pascal))}}),qe.of({name:"Perl",extensions:["pl","pm"],load(){return Qe(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>ct(e.perl))}}),qe.of({name:"Pig",extensions:["pig"],load(){return Qe(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>ct(e.pig))}}),qe.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Qe(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>ct(e.powerShell))}}),qe.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Qe(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>ct(e.properties))}}),qe.of({name:"ProtoBuf",extensions:["proto"],load(){return Qe(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>ct(e.protobuf))}}),qe.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Qe(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([22,23]),import.meta.url).then(e=>ct(e.pug))}}),qe.of({name:"Puppet",extensions:["pp"],load(){return Qe(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>ct(e.puppet))}}),qe.of({name:"Q",extensions:["q"],load(){return Qe(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>ct(e.q))}}),qe.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Qe(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>ct(e.r))}}),qe.of({name:"RPM Changes",load(){return Qe(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmChanges))}}),qe.of({name:"RPM Spec",extensions:["spec"],load(){return Qe(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmSpec))}}),qe.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Qe(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>ct(e.ruby))}}),qe.of({name:"SAS",extensions:["sas"],load(){return Qe(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>ct(e.sas))}}),qe.of({name:"Scala",extensions:["scala"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.scala))}}),qe.of({name:"Scheme",extensions:["scm","ss"],load(){return Qe(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>ct(e.scheme))}}),qe.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Qe(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>ct(e.shell))}}),qe.of({name:"Sieve",extensions:["siv","sieve"],load(){return Qe(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>ct(e.sieve))}}),qe.of({name:"Smalltalk",extensions:["st"],load(){return Qe(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>ct(e.smalltalk))}}),qe.of({name:"Solr",load(){return Qe(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>ct(e.solr))}}),qe.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Qe(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.sml))}}),qe.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Qe(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>ct(e.sparql))}}),qe.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Qe(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>ct(e.spreadsheet))}}),qe.of({name:"Squirrel",extensions:["nut"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.squirrel))}}),qe.of({name:"Stylus",extensions:["styl"],load(){return Qe(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>ct(e.stylus))}}),qe.of({name:"Swift",extensions:["swift"],load(){return Qe(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>ct(e.swift))}}),qe.of({name:"sTeX",load(){return Qe(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),qe.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Qe(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),qe.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Qe(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),qe.of({name:"Tcl",extensions:["tcl"],load(){return Qe(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>ct(e.tcl))}}),qe.of({name:"Textile",extensions:["textile"],load(){return Qe(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>ct(e.textile))}}),qe.of({name:"TiddlyWiki",load(){return Qe(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>ct(e.tiddlyWiki))}}),qe.of({name:"Tiki wiki",load(){return Qe(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>ct(e.tiki))}}),qe.of({name:"TOML",extensions:["toml"],load(){return Qe(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>ct(e.toml))}}),qe.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Qe(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>ct(e.troff))}}),qe.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Qe(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>ct(e.ttcn))}}),qe.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Qe(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>ct(e.ttcnCfg))}}),qe.of({name:"Turtle",extensions:["ttl"],load(){return Qe(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>ct(e.turtle))}}),qe.of({name:"Web IDL",extensions:["webidl"],load(){return Qe(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>ct(e.webIDL))}}),qe.of({name:"VB.NET",extensions:["vb"],load(){return Qe(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>ct(e.vb))}}),qe.of({name:"VBScript",extensions:["vbs"],load(){return Qe(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>ct(e.vbScript))}}),qe.of({name:"Velocity",extensions:["vtl"],load(){return Qe(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>ct(e.velocity))}}),qe.of({name:"Verilog",extensions:["v"],load(){return Qe(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),qe.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Qe(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>ct(e.vhdl))}}),qe.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Qe(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>ct(e.xQuery))}}),qe.of({name:"Yacas",extensions:["ys"],load(){return Qe(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>ct(e.yacas))}}),qe.of({name:"Z80",extensions:["z80"],load(){return Qe(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>ct(e.z80))}}),qe.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.mscgen))}}),qe.of({name:"Xù",extensions:["xu"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.xu))}}),qe.of({name:"MsGenny",extensions:["msgenny"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.msgenny))}}),qe.of({name:"Vue",extensions:["vue"],load(){return Qe(()=>import("./index-C9l4pS3L.js"),__vite__mapDeps([24,2]),import.meta.url).then(e=>e.vue())}}),qe.of({name:"Angular Template",load(){return Qe(()=>import("./index-FInefdtZ.js"),__vite__mapDeps([25,2]),import.meta.url).then(e=>e.angular())}})];var kon=e=>{var{theme:t,settings:n={},styles:r=[]}=e,a={".cm-gutters":{}},s={};n.background&&(s.backgroundColor=n.background),n.backgroundImage&&(s.backgroundImage=n.backgroundImage),n.foreground&&(s.color=n.foreground),n.fontSize&&(s.fontSize=n.fontSize),(n.background||n.foreground)&&(a["&"]=s),n.fontFamily&&(a["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(a[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(a[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(a[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(a[".cm-content"]={caretColor:n.caret},a[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var i={};n.gutterActiveForeground&&(i.color=n.gutterActiveForeground),n.lineHighlight&&(a[".cm-activeLine"]={backgroundColor:n.lineHighlight},i.backgroundColor=n.lineHighlight),a[".cm-activeLineGutter"]=i,n.selection&&(a["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(a["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var o=vt.theme(a,{dark:t==="dark"}),c=S_.define(r),u=[o,zue(c)];return u},_on={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},Eon=[{tag:fe.comment,color:"#6272a4"},{tag:fe.string,color:"#f1fa8c"},{tag:fe.atom,color:"#bd93f9"},{tag:fe.meta,color:"#f8f8f2"},{tag:[fe.keyword,fe.operator,fe.tagName],color:"#ff79c6"},{tag:[fe.function(fe.propertyName),fe.propertyName],color:"#66d9ef"},{tag:[fe.definition(fe.variableName),fe.function(fe.variableName),fe.className,fe.attributeName],color:"#50fa7b"},{tag:fe.atom,color:"#bd93f9"}],Q6=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return kon({theme:t,settings:bb({},_on,n),styles:[...Eon,...r]})};Q6();const Con=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=vde(e.state,n.from);return r.line?jon(e):r.block?Non(e):!1};function gde(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let a=e(t,n);return a?(r(n.update(a)),!0):!1}}const jon=gde(Ron,0),Ton=gde(Krt,0),Non=gde((e,t)=>Krt(e,t,Ion(t)),0);function vde(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const JE=50;function Aon(e,{open:t,close:n},r,a){let s=e.sliceDoc(r-JE,r),i=e.sliceDoc(a,a+JE),o=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(i)[0].length,u=s.length-o;if(s.slice(u-t.length,u)==t&&i.slice(c,c+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:a+c,margin:c&&1}};let d,f;a-r<=2*JE?d=f=e.sliceDoc(r,a):(d=e.sliceDoc(r,r+JE),f=e.sliceDoc(a-JE,a));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(m,m+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:a-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function Ion(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),a=n.to<=r.to?r:e.doc.lineAt(n.to);a.from>r.from&&a.from==n.to&&(a=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>r.from?t[s].to=a.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:a.to})}return t}function Krt(e,t,n=t.selection.ranges){let r=n.map(s=>vde(t,s.from).block);if(!r.every(s=>s))return null;let a=n.map((s,i)=>Aon(t,r[i],s.from,s.to));if(e!=2&&!a.every(s=>s))return{changes:t.changes(n.map((s,i)=>a[i]?[]:[{from:s.from,insert:r[i].open+" "},{from:s.to,insert:" "+r[i].close}]))};if(e!=1&&a.some(s=>s)){let s=[];for(let i=0,o;i<a.length;i++)if(o=a[i]){let c=r[i],{open:u,close:d}=o;s.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:s}}return null}function Ron(e,t,n=t.selection.ranges){let r=[],a=-1;for(let{from:s,to:i}of n){let o=r.length,c=1e9,u=vde(t,s).line;if(u){for(let d=s;d<=i;){let f=t.doc.lineAt(d);if(f.from>a&&(s==i||i>f.from)){a=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,m=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:m,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=o;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==o+1&&(r[o].single=!0)}}if(e!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&s.push({from:o.from+u,insert:c+" "});let i=t.changes(s);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:i,comment:o,token:c}of r)if(o>=0){let u=i.from+o,d=u+c.length;i.text[d-i.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const zne=Am.define(),Pon=Am.define(),Mon=Zt.define(),Jrt=Zt.define({combine(e){return Im(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,a)=>t(r,a)||n(r,a)})}}),eat=Yi.define({create(){return Yh.empty},update(e,t){let n=t.state.facet(Jrt),r=t.annotation(zne);if(r){let c=mu.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=w4(d,d.length,n.minDepth,c):d=rat(d,t.startState.selection),new Yh(u==0?r.rest:d,u==0?d:r.rest)}let a=t.annotation(Pon);if((a=="full"||a=="before")&&(e=e.isolate()),t.annotation(lo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=mu.fromTransaction(t),i=t.annotation(lo.time),o=t.annotation(lo.userEvent);return s?e=e.addChanges(s,i,o,n,t):t.selection&&(e=e.addSelection(t.startState.selection,i,o,n.newGroupDelay)),(a=="full"||a=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Yh(e.done.map(mu.fromJSON),e.undone.map(mu.fromJSON))}});function Don(e={}){return[eat,Jrt.of(e),vt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?tat:t.inputType=="historyRedo"?Bne:null;return r?(t.preventDefault(),r(n)):!1}})]}function G6(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let a=n.field(eat,!1);if(!a)return!1;let s=a.pop(e,n,t);return s?(r(s),!0):!1}}const tat=G6(0,!1),Bne=G6(1,!1),$on=G6(0,!0),Lon=G6(1,!0);class mu{constructor(t,n,r,a,s){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=a,this.selectionsAfter=s}setSelAfter(t){return new mu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(a=>a.toJSON())}}static fromJSON(t){return new mu(t.changes&&ao.fromJSON(t.changes),[],t.mapped&&sm.fromJSON(t.mapped),t.startSelection&&Je.fromJSON(t.startSelection),t.selectionsAfter.map(Je.fromJSON))}static fromTransaction(t,n){let r=kf;for(let a of t.startState.facet(Mon)){let s=a(t);s.length&&(r=r.concat(s))}return!r.length&&t.changes.empty?null:new mu(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,kf)}static selection(t){return new mu(void 0,kf,void 0,void 0,t)}}function w4(e,t,n,r){let a=t+1>n+20?t-n-1:0,s=e.slice(a,t);return s.push(r),s}function Fon(e,t){let n=[],r=!1;return e.iterChangedRanges((a,s)=>n.push(a,s)),t.iterChangedRanges((a,s,i,o)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];o>=u&&i<=d&&(r=!0)}}),r}function zon(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function nat(e,t){return e.length?t.length?e.concat(t):e:t}const kf=[],Bon=200;function rat(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Bon));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),w4(e,e.length-1,1e9,n.setSelAfter(r)))}else return[mu.selection([t])]}function Uon(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function gU(e,t){if(!e.length)return e;let n=e.length,r=kf;for(;n;){let a=Von(e[n-1],t,r);if(a.changes&&!a.changes.empty||a.effects.length){let s=e.slice(0,n);return s[n-1]=a,s}else t=a.mapped,n--,r=a.selectionsAfter}return r.length?[mu.selection(r)]:kf}function Von(e,t,n){let r=nat(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):kf,n);if(!e.changes)return mu.selection(r);let a=e.changes.map(t),s=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(s):s;return new mu(a,Xn.mapEffects(e.effects,t),i,e.startSelection.map(s),r)}const qon=/^(input\.type|delete)($|\.)/;class Yh{constructor(t,n,r=0,a=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=a}isolate(){return this.prevTime?new Yh(this.done,this.undone):this}addChanges(t,n,r,a,s){let i=this.done,o=i[i.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!r||qon.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<a.newGroupDelay&&a.joinToEvent(s,Fon(o.changes,t.changes))||r=="input.type.compose")?i=w4(i,i.length-1,a.minDepth,new mu(t.changes.compose(o.changes),nat(Xn.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,kf)):i=w4(i,i.length,a.minDepth,t),new Yh(i,kf,n,r)}addSelection(t,n,r,a){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:kf;return s.length>0&&n-this.prevTime<a&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&zon(s[s.length-1],t)?this:new Yh(rat(this.done,t),this.undone,n,r)}addMapping(t){return new Yh(gU(this.done,t),gU(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let a=t==0?this.done:this.undone;if(a.length==0)return null;let s=a[a.length-1],i=s.selectionsAfter[0]||n.selection;if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:zne.of({side:t,rest:Uon(a),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=a.length==1?kf:a.slice(0,a.length-1);return s.mapped&&(o=gU(o,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:zne.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Yh.empty=new Yh(kf,kf);const Hon=[{key:"Mod-z",run:tat,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Bne,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Bne,preventDefault:!0},{key:"Mod-u",run:$on,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Lon,preventDefault:!0}];function k_(e,t){return Je.create(e.ranges.map(t),e.mainIndex)}function Yp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Xp({state:e,dispatch:t},n){let r=k_(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Yp(e,r)),!0)}function W6(e,t){return Je.cursor(t?e.to:e.from)}function aat(e,t){return Xp(e,n=>n.empty?e.moveByChar(n,t):W6(n,t))}function ic(e){return e.textDirectionAt(e.state.selection.main.head)==xs.LTR}const sat=e=>aat(e,!ic(e)),iat=e=>aat(e,ic(e));function oat(e,t){return Xp(e,n=>n.empty?e.moveByGroup(n,t):W6(n,t))}const Qon=e=>oat(e,!ic(e)),Gon=e=>oat(e,ic(e));function Won(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Z6(e,t,n){let r=us(e).resolveInner(t.head),a=n?cr.closedBy:cr.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;Won(e,u,a)?r=u:c=n?u.to:u.from}let s=r.type.prop(a),i,o;return s&&(i=n?Zh(e,r.from,1):Zh(e,r.to,-1))&&i.matched?o=n?i.end.to:i.end.from:o=n?r.to:r.from,Je.cursor(o,n?-1:1)}const Zon=e=>Xp(e,t=>Z6(e.state,t,!ic(e))),Yon=e=>Xp(e,t=>Z6(e.state,t,ic(e)));function lat(e,t){return Xp(e,n=>{if(!n.empty)return W6(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const cat=e=>lat(e,!1),uat=e=>lat(e,!0);function dat(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,a;if(t){for(let s of e.state.facet(vt.scrollMargins)){let i=s(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}a=e.scrollDOM.clientHeight-n-r}else a=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,a-5)}}function fat(e,t){let n=dat(e),{state:r}=e,a=k_(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):W6(i,t));if(a.eq(r.selection))return!1;let s;if(n.selfScroll){let i=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),c=o.top+n.marginTop,u=o.bottom-n.marginBottom;i&&i.top>c&&i.bottom<u&&(s=vt.scrollIntoView(a.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Yp(r,a),{effects:s}),!0}const c_e=e=>fat(e,!1),Une=e=>fat(e,!0);function Gb(e,t,n){let r=e.lineBlockAt(t.head),a=e.moveToLineBoundary(t,n);if(a.head==t.head&&a.head!=(n?r.to:r.from)&&(a=e.moveToLineBoundary(t,n,!1)),!n&&a.head==r.from&&r.length){let s=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&t.head!=r.from+s&&(a=Je.cursor(r.from+s))}return a}const Xon=e=>Xp(e,t=>Gb(e,t,!0)),Kon=e=>Xp(e,t=>Gb(e,t,!1)),Jon=e=>Xp(e,t=>Gb(e,t,!ic(e))),eln=e=>Xp(e,t=>Gb(e,t,ic(e))),tln=e=>Xp(e,t=>Je.cursor(e.lineBlockAt(t.head).from,1)),nln=e=>Xp(e,t=>Je.cursor(e.lineBlockAt(t.head).to,-1));function rln(e,t,n){let r=!1,a=k_(e.selection,s=>{let i=Zh(e,s.head,-1)||Zh(e,s.head,1)||s.head>0&&Zh(e,s.head-1,1)||s.head<e.doc.length&&Zh(e,s.head+1,-1);if(!i||!i.end)return s;r=!0;let o=i.start.from==s.head?i.end.to:i.end.from;return Je.cursor(o)});return r?(t(Yp(e,a)),!0):!1}const aln=({state:e,dispatch:t})=>rln(e,t);function Yf(e,t){let n=k_(e.state.selection,r=>{let a=t(r);return Je.range(r.anchor,a.head,a.goalColumn,a.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(Yp(e.state,n)),!0)}function pat(e,t){return Yf(e,n=>e.moveByChar(n,t))}const hat=e=>pat(e,!ic(e)),mat=e=>pat(e,ic(e));function gat(e,t){return Yf(e,n=>e.moveByGroup(n,t))}const sln=e=>gat(e,!ic(e)),iln=e=>gat(e,ic(e)),oln=e=>Yf(e,t=>Z6(e.state,t,!ic(e))),lln=e=>Yf(e,t=>Z6(e.state,t,ic(e)));function vat(e,t){return Yf(e,n=>e.moveVertically(n,t))}const yat=e=>vat(e,!1),bat=e=>vat(e,!0);function xat(e,t){return Yf(e,n=>e.moveVertically(n,t,dat(e).height))}const u_e=e=>xat(e,!1),d_e=e=>xat(e,!0),cln=e=>Yf(e,t=>Gb(e,t,!0)),uln=e=>Yf(e,t=>Gb(e,t,!1)),dln=e=>Yf(e,t=>Gb(e,t,!ic(e))),fln=e=>Yf(e,t=>Gb(e,t,ic(e))),pln=e=>Yf(e,t=>Je.cursor(e.lineBlockAt(t.head).from)),hln=e=>Yf(e,t=>Je.cursor(e.lineBlockAt(t.head).to)),f_e=({state:e,dispatch:t})=>(t(Yp(e,{anchor:0})),!0),p_e=({state:e,dispatch:t})=>(t(Yp(e,{anchor:e.doc.length})),!0),h_e=({state:e,dispatch:t})=>(t(Yp(e,{anchor:e.selection.main.anchor,head:0})),!0),m_e=({state:e,dispatch:t})=>(t(Yp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),mln=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),gln=({state:e,dispatch:t})=>{let n=Y6(e).map(({from:r,to:a})=>Je.range(r,Math.min(a+1,e.doc.length)));return t(e.update({selection:Je.create(n),userEvent:"select"})),!0},vln=({state:e,dispatch:t})=>{let n=k_(e.selection,r=>{let a=us(e),s=a.resolveStack(r.from,1);if(r.empty){let i=a.resolveStack(r.from,-1);i.node.from>=s.node.from&&i.node.to<=s.node.to&&(s=i)}for(let i=s;i;i=i.next){let{node:o}=i;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&i.next)return Je.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(Yp(e,n)),!0)};function wat(e,t){let{state:n}=e,r=n.selection,a=n.selection.ranges.slice();for(let s of n.selection.ranges){let i=n.doc.lineAt(s.head);if(t?i.to<e.state.doc.length:i.from>0)for(let o=s;;){let c=e.moveVertically(o,t);if(c.head<i.from||c.head>i.to){a.some(u=>u.head==c.head)||a.push(c);break}else{if(c.head==o.head)break;o=c}}}return a.length==r.ranges.length?!1:(e.dispatch(Yp(n,Je.create(a,a.length-1))),!0)}const yln=e=>wat(e,!1),bln=e=>wat(e,!0),xln=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Je.create([n.main]):n.main.empty||(r=Je.create([Je.cursor(n.main.head)])),r?(t(Yp(e,r)),!0):!1};function EI(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,a=r.changeByRange(s=>{let{from:i,to:o}=s;if(i==o){let c=t(s);c<i?(n="delete.backward",c=IM(e,c,!1)):c>i&&(n="delete.forward",c=IM(e,c,!0)),i=Math.min(i,c),o=Math.max(o,c)}else i=IM(e,i,!1),o=IM(e,o,!0);return i==o?{range:s}:{changes:{from:i,to:o},range:Je.cursor(i,i<s.head?-1:1)}});return a.changes.empty?!1:(e.dispatch(r.update(a,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?vt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function IM(e,t,n){if(e instanceof vt)for(let r of e.state.facet(vt.atomicRanges).map(a=>a(e)))r.between(t,t,(a,s)=>{a<t&&s>t&&(t=n?s:a)});return t}const Sat=(e,t,n)=>EI(e,r=>{let a=r.from,{state:s}=e,i=s.doc.lineAt(a),o,c;if(n&&!t&&a>i.from&&a<i.from+200&&!/[^ \t]/.test(o=i.text.slice(0,a-i.from))){if(o[o.length-1]==" ")return a-1;let u=Fp(o,s.tabSize),d=u%iw(s)||iw(s);for(let f=0;f<d&&o[o.length-1-f]==" ";f++)a--;c=a}else c=Xo(i.text,a-i.from,t,t)+i.from,c==a&&i.number!=(t?s.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,a-i.from))&&(c=Xo(i.text,c-i.from,!1,!1)+i.from);return c}),Vne=e=>Sat(e,!1,!0),Oat=e=>Sat(e,!0,!1),kat=(e,t)=>EI(e,n=>{let r=n.head,{state:a}=e,s=a.doc.lineAt(r),i=a.charCategorizer(r);for(let o=null;;){if(r==(t?s.to:s.from)){r==n.head&&s.number!=(t?a.doc.lines:1)&&(r+=t?1:-1);break}let c=Xo(s.text,r-s.from,t)+s.from,u=s.text.slice(Math.min(r,c)-s.from,Math.max(r,c)-s.from),d=i(u);if(o!=null&&d!=o)break;(u!=" "||r!=n.head)&&(o=d),r=c}return r}),_at=e=>kat(e,!1),wln=e=>kat(e,!0),Sln=e=>EI(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Oln=e=>EI(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),kln=e=>EI(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),_ln=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Ea.of(["",""])},range:Je.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Eln=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let a=r.from,s=e.doc.lineAt(a),i=a==s.from?a-1:Xo(s.text,a-s.from,!1)+s.from,o=a==s.to?a+1:Xo(s.text,a-s.from,!0)+s.from;return{changes:{from:i,to:o,insert:e.doc.slice(a,o).append(e.doc.slice(i,a))},range:Je.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Y6(e){let t=[],n=-1;for(let r of e.selection.ranges){let a=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=e.doc.lineAt(r.to-1)),n>=a.number){let i=t[t.length-1];i.to=s.to,i.ranges.push(r)}else t.push({from:a.from,to:s.to,ranges:[r]});n=s.number+1}return t}function Eat(e,t,n){if(e.readOnly)return!1;let r=[],a=[];for(let s of Y6(e)){if(n?s.to==e.doc.length:s.from==0)continue;let i=e.doc.lineAt(n?s.to+1:s.from-1),o=i.length+1;if(n){r.push({from:s.to,to:i.to},{from:s.from,insert:i.text+e.lineBreak});for(let c of s.ranges)a.push(Je.range(Math.min(e.doc.length,c.anchor+o),Math.min(e.doc.length,c.head+o)))}else{r.push({from:i.from,to:s.from},{from:s.to,insert:e.lineBreak+i.text});for(let c of s.ranges)a.push(Je.range(c.anchor-o,c.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Je.create(a,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Cln=({state:e,dispatch:t})=>Eat(e,t,!1),jln=({state:e,dispatch:t})=>Eat(e,t,!0);function Cat(e,t,n){if(e.readOnly)return!1;let r=[];for(let s of Y6(e))n?r.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):r.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let a=e.changes(r);return t(e.update({changes:a,selection:e.selection.map(a,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Tln=({state:e,dispatch:t})=>Cat(e,t,!1),Nln=({state:e,dispatch:t})=>Cat(e,t,!0),Aln=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Y6(t).map(({from:a,to:s})=>(a>0?a--:s<t.doc.length&&s++,{from:a,to:s}))),r=k_(t.selection,a=>{let s;if(e.lineWrapping){let i=e.lineBlockAt(a.head),o=e.coordsAtPos(a.head,a.assoc||1);o&&(s=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(a,!0,s)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Iln(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=us(e).resolveInner(t),r=n.childBefore(t),a=n.childAfter(t),s;return r&&a&&r.to<=t&&a.from>=t&&(s=r.type.prop(cr.closedBy))&&s.indexOf(a.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(r.to,a.from))?{from:r.to,to:a.from}:null}const g_e=jat(!1),Rln=jat(!0);function jat(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(a=>{let{from:s,to:i}=a,o=t.doc.lineAt(s),c=!e&&s==i&&Iln(t,s);e&&(s=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new U6(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=$ue(u,s);for(d==null&&(d=Fp(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;c?{from:s,to:i}=c:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let f=["",oN(t,d)];return c&&f.push(oN(t,u.lineIndent(o.from,-1))),{changes:{from:s,to:i,insert:Ea.of(f)},range:Je.cursor(s+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function yde(e,t){let n=-1;return e.changeByRange(r=>{let a=[];for(let i=r.from;i<=r.to;){let o=e.doc.lineAt(i);o.number>n&&(r.empty||r.to>o.from)&&(t(o,a,r),n=o.number),i=o.to+1}let s=e.changes(a);return{changes:a,range:Je.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const Pln=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new U6(e,{overrideIndentation:s=>{let i=n[s];return i??-1}}),a=yde(e,(s,i,o)=>{let c=$ue(r,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=oN(e,c);(u!=d||o.from<s.from+u.length)&&(n[s.from]=c,i.push({from:s.from,to:s.from+u.length,insert:d}))});return a.changes.empty||t(e.update(a,{userEvent:"indent"})),!0},Tat=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(yde(e,(n,r)=>{r.push({from:n.from,insert:e.facet(w_)})}),{userEvent:"input.indent"})),!0),Nat=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(yde(e,(n,r)=>{let a=/^\s*/.exec(n.text)[0];if(!a)return;let s=Fp(a,e.tabSize),i=0,o=oN(e,Math.max(0,s-iw(e)));for(;i<a.length&&i<o.length&&a.charCodeAt(i)==o.charCodeAt(i);)i++;r.push({from:n.from+i,to:n.from+a.length,insert:o.slice(i)})}),{userEvent:"delete.dedent"})),!0),Mln=e=>(e.setTabFocusMode(),!0),Dln=[{key:"Ctrl-b",run:sat,shift:hat,preventDefault:!0},{key:"Ctrl-f",run:iat,shift:mat},{key:"Ctrl-p",run:cat,shift:yat},{key:"Ctrl-n",run:uat,shift:bat},{key:"Ctrl-a",run:tln,shift:pln},{key:"Ctrl-e",run:nln,shift:hln},{key:"Ctrl-d",run:Oat},{key:"Ctrl-h",run:Vne},{key:"Ctrl-k",run:Sln},{key:"Ctrl-Alt-h",run:_at},{key:"Ctrl-o",run:_ln},{key:"Ctrl-t",run:Eln},{key:"Ctrl-v",run:Une}],$ln=[{key:"ArrowLeft",run:sat,shift:hat,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Qon,shift:sln,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Jon,shift:dln,preventDefault:!0},{key:"ArrowRight",run:iat,shift:mat,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Gon,shift:iln,preventDefault:!0},{mac:"Cmd-ArrowRight",run:eln,shift:fln,preventDefault:!0},{key:"ArrowUp",run:cat,shift:yat,preventDefault:!0},{mac:"Cmd-ArrowUp",run:f_e,shift:h_e},{mac:"Ctrl-ArrowUp",run:c_e,shift:u_e},{key:"ArrowDown",run:uat,shift:bat,preventDefault:!0},{mac:"Cmd-ArrowDown",run:p_e,shift:m_e},{mac:"Ctrl-ArrowDown",run:Une,shift:d_e},{key:"PageUp",run:c_e,shift:u_e},{key:"PageDown",run:Une,shift:d_e},{key:"Home",run:Kon,shift:uln,preventDefault:!0},{key:"Mod-Home",run:f_e,shift:h_e},{key:"End",run:Xon,shift:cln,preventDefault:!0},{key:"Mod-End",run:p_e,shift:m_e},{key:"Enter",run:g_e,shift:g_e},{key:"Mod-a",run:mln},{key:"Backspace",run:Vne,shift:Vne,preventDefault:!0},{key:"Delete",run:Oat,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:_at,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:wln,preventDefault:!0},{mac:"Mod-Backspace",run:Oln,preventDefault:!0},{mac:"Mod-Delete",run:kln,preventDefault:!0}].concat(Dln.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Lln=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Zon,shift:oln},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Yon,shift:lln},{key:"Alt-ArrowUp",run:Cln},{key:"Shift-Alt-ArrowUp",run:Tln},{key:"Alt-ArrowDown",run:jln},{key:"Shift-Alt-ArrowDown",run:Nln},{key:"Mod-Alt-ArrowUp",run:yln},{key:"Mod-Alt-ArrowDown",run:bln},{key:"Escape",run:xln},{key:"Mod-Enter",run:Rln},{key:"Alt-l",mac:"Ctrl-l",run:gln},{key:"Mod-i",run:vln,preventDefault:!0},{key:"Mod-[",run:Nat},{key:"Mod-]",run:Tat},{key:"Mod-Alt-\\",run:Pln},{key:"Shift-Mod-k",run:Aln},{key:"Shift-Mod-\\",run:aln},{key:"Mod-/",run:Con},{key:"Alt-A",run:Ton},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Mln}].concat($ln),Fln={key:"Tab",run:Tat,shift:Nat},v_e=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class mk{constructor(t,n,r=0,a=t.length,s,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,a),this.bufferStart=r,this.normalize=s?o=>s(v_e(o)):v_e,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return iu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=bue(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=$h(t);let a=this.normalize(n);if(a.length)for(let s=0,i=r;;s++){let o=a.charCodeAt(s),c=this.match(o,i,this.bufferPos+this.bufferStart);if(s==a.length-1){if(c)return this.value=c,this;break}i==r&&s<n.length&&n.charCodeAt(s)==o&&i++}}}match(t,n,r){let a=null;for(let s=0;s<this.matches.length;s+=2){let i=this.matches[s],o=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?a={from:this.matches[s+1],to:r}:(this.matches[s]++,o=!0)),o||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?a={from:n,to:r}:this.matches.push(1,n)),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}}typeof Symbol<"u"&&(mk.prototype[Symbol.iterator]=function(){return this});const Aat={from:-1,to:-1,match:/.*/.exec("")},bde="gm"+(/x/.unicode==null?"":"u");class Iat{constructor(t,n,r,a=0,s=t.length){if(this.text=t,this.to=s,this.curLine="",this.done=!1,this.value=Aat,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Rat(t,n,r,a,s);this.re=new RegExp(n,bde+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(a);this.curLineStart=i.from,this.matchPos=S4(t,a),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,a=r+n[0].length;if(this.matchPos=S4(this.text,a+(r==a?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<a||r>this.value.to)&&(!this.test||this.test(r,a,n)))return this.value={from:r,to:a,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const vU=new WeakMap;class bO{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let a=vU.get(t);if(!a||a.from>=r||a.to<=n){let o=new bO(n,t.sliceString(n,r));return vU.set(t,o),o}if(a.from==n&&a.to==r)return a;let{text:s,from:i}=a;return i>n&&(s=t.sliceString(n,i)+s,i=n),a.to<r&&(s+=t.sliceString(a.to,r)),vU.set(t,new bO(i,s)),new bO(n,s.slice(n-i,r-i))}}class Rat{constructor(t,n,r,a,s){this.text=t,this.to=s,this.done=!1,this.value=Aat,this.matchPos=S4(t,a),this.re=new RegExp(n,bde+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=bO.get(t,a,this.chunkEnd(a+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,a=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,a,n)))return this.value={from:r,to:a,match:n},this.matchPos=S4(this.text,a+(r==a?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Iat.prototype[Symbol.iterator]=Rat.prototype[Symbol.iterator]=function(){return this});function zln(e){try{return new RegExp(e,bde),!0}catch{return!1}}function S4(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function qne(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=gs("input",{class:"cm-textfield",name:"line",value:t}),r=gs("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),e.dispatch({effects:Vj.of(!1)}),e.focus()):s.keyCode==13&&(s.preventDefault(),a())},onsubmit:s=>{s.preventDefault(),a()}},gs("label",e.state.phrase("Go to line"),": ",n)," ",gs("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),gs("button",{name:"close",onclick:()=>{e.dispatch({effects:Vj.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function a(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!s)return;let{state:i}=e,o=i.doc.lineAt(i.selection.main.head),[,c,u,d,f]=s,p=d?+d.slice(1):0,h=u?+u:o.number;if(u&&f){let v=h/100;c&&(v=v*(c=="-"?-1:1)+o.number/i.doc.lines),h=Math.round(i.doc.lines*v)}else u&&c&&(h=h*(c=="-"?-1:1)+o.number);let m=i.doc.line(Math.max(1,Math.min(i.doc.lines,h))),g=Je.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[Vj.of(!1),vt.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}return{dom:r}}const Vj=Xn.define(),y_e=Yi.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(Vj)&&(e=n.value);return e},provide:e=>iN.from(e,t=>t?qne:null)}),Bln=e=>{let t=sN(e,qne);if(!t){let n=[Vj.of(!0)];e.state.field(y_e,!1)==null&&n.push(Xn.appendConfig.of([y_e,Uln])),e.dispatch({effects:n}),t=sN(e,qne)}return t&&t.dom.querySelector("input").select(),!0},Uln=vt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),Vln={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},qln=Zt.define({combine(e){return Im(e,Vln,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Hln(e){return[Yln,Zln]}const Qln=tn.mark({class:"cm-selectionMatch"}),Gln=tn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function b_e(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=ni.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=ni.Word)}function Wln(e,t,n,r){return e(t.sliceDoc(n,n+1))==ni.Word&&e(t.sliceDoc(r-1,r))==ni.Word}const Zln=mi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(qln),{state:n}=e,r=n.selection;if(r.ranges.length>1)return tn.none;let a=r.main,s,i=null;if(a.empty){if(!t.highlightWordAroundCursor)return tn.none;let c=n.wordAt(a.head);if(!c)return tn.none;i=n.charCategorizer(a.head),s=n.sliceDoc(c.from,c.to)}else{let c=a.to-a.from;if(c<t.minSelectionLength||c>200)return tn.none;if(t.wholeWords){if(s=n.sliceDoc(a.from,a.to),i=n.charCategorizer(a.head),!(b_e(i,n,a.from,a.to)&&Wln(i,n,a.from,a.to)))return tn.none}else if(s=n.sliceDoc(a.from,a.to),!s)return tn.none}let o=[];for(let c of e.visibleRanges){let u=new mk(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||b_e(i,n,d,f))&&(a.empty&&d<=a.from&&f>=a.to?o.push(Gln.range(d,f)):(d>=a.to||f<=a.from)&&o.push(Qln.range(d,f)),o.length>t.maxMatches))return tn.none}}return tn.set(o)}},{decorations:e=>e.decorations}),Yln=vt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Xln=({state:e,dispatch:t})=>{let{selection:n}=e,r=Je.create(n.ranges.map(a=>e.wordAt(a.head)||Je.cursor(a.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Kln(e,t){let{main:n,ranges:r}=e.selection,a=e.wordAt(n.head),s=a&&a.from==n.from&&a.to==n.to;for(let i=!1,o=new mk(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new mk(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),i=!0}else{if(i&&r.some(c=>c.from==o.value.from))continue;if(s){let c=e.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const Jln=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return Xln({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=r))return!1;let a=Kln(e,r);return a?(t(e.update({selection:e.selection.addRange(Je.range(a.from,a.to),!1),effects:vt.scrollIntoView(a.to)})),!0):!1},__=Zt.define({combine(e){return Im(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new dcn(t),scrollToMatch:t=>vt.scrollIntoView(t)})}});class Pat{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||zln(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
208
+ }`,{label:"class",detail:"definition",type:"keyword"}),tu('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),tu('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],yrt=ode.concat([tu("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),tu("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),tu("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),t_e=new xet,brt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function XE(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const Kin=["FunctionDeclaration"],Jin={FunctionDeclaration:XE("function"),ClassDeclaration:XE("class"),ClassExpression:()=>!0,EnumDeclaration:XE("constant"),TypeAliasDeclaration:XE("type"),NamespaceDeclaration:XE("namespace"),VariableDefinition(e,t){e.matchContext(Kin)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function xrt(e,t){let n=t_e.get(t);if(n)return n;let r=[],a=!0;function s(i,o){let c=e.sliceString(i.from,i.to);r.push({label:c,type:o})}return t.cursor(Ga.IncludeAnonymous).iterate(i=>{if(a)a=!1;else if(i.name){let o=Jin[i.name];if(o&&o(i,s)||brt.has(i.name))return!1}else if(i.to-i.from>8192){for(let o of xrt(e,i.node))r.push(o);return!1}}),t_e.set(t,r),r}const b4=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,lde=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function wrt(e){let t=us(e.state).resolveInner(e.pos,-1);if(lde.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&b4.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let a=t;a;a=a.parent)brt.has(a.name)&&(r=r.concat(xrt(e.state.doc,a)));return{options:r,from:n?t.from:e.pos,validFor:b4}}function cU(e,t,n){var r;let a=[];for(;;){let s=t.firstChild,i;if(s?.name=="VariableName")return a.push(e(s)),{path:a.reverse(),name:n};if(s?.name=="MemberExpression"&&((r=i=s.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")a.push(e(i)),t=s;else return null}}function Srt(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=us(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?cU(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?cU(t,n.parent,""):lde.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&b4.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?cU(t,n,""):e.explicit?{path:[],name:""}:null}function eon(e,t){let n=e,r=[],a=new Set;for(let s=0;;s++){for(let o of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||a.has(o))continue;a.add(o);let c;try{c=n[o]}catch{continue}r.push({label:o,type:typeof c=="function"?/^[A-Z]/.test(o)?"class":t?"function":"method":t?"variable":"property",boost:-s})}let i=Object.getPrototypeOf(e);if(!i)return r;e=i}}function ton(e){let t=new Map;return n=>{let r=Srt(n);if(!r)return null;let a=e;for(let i of r.path)if(a=a[i],!a)return null;let s=t.get(a);return s||t.set(a,s=eon(a,!r.path.length)),{from:n.pos-r.name.length,options:s,validFor:b4}}}const If=rw.define({name:"javascript",parser:Xin.configure({props:[Xw.add({IfStatement:vO({except:/^\s*({|else\b)/}),TryStatement:vO({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Xnn,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Ynn({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":vO({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Kw.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Fue,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name=="JSXSelfClosingTag")return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){var t;let n=(t=e.firstChild)===null||t===void 0?void 0:t.nextSibling,r=e.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?e.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Ort={test:e=>/^JSX/.test(e.name),facet:B6({commentTokens:{block:{open:"{/*",close:"*/}"}}})},cde=If.configure({dialect:"ts"},"typescript"),ude=If.configure({dialect:"jsx",props:[Due.add(e=>e.isTop?[Ort]:void 0)]}),dde=If.configure({dialect:"jsx ts",props:[Due.add(e=>e.isTop?[Ort]:void 0)]},"typescript");let krt=e=>({label:e,type:"keyword"});const _rt="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(krt),non=_rt.concat(["declare","implements","private","protected","public"].map(krt));function x4(e={}){let t=e.jsx?e.typescript?dde:ude:e.typescript?cde:If,n=e.typescript?yrt.concat(non):ode.concat(_rt);return new sw(t,[If.data.of({autocomplete:Drn(lde,xnt(n))}),If.data.of({autocomplete:wrt}),e.jsx?Ert:[]])}function ron(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function n_e(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const aon=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Ert=vt.inputHandler.of((e,t,n,r,a)=>{if((aon?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!If.isActiveAt(e.state,t,-1))return!1;let s=a(),{state:i}=s,o=i.changeByRange(c=>{var u;let{head:d}=c,f=us(i).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(i.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==d-2&&((p=n_e(i.doc,m.firstChild,d))||((u=m.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${p}>`;return{range:Je.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let h=ron(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(p=n_e(i.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function son(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((n,r)=>{var a;!((a=n.meta.docs)===null||a===void 0)&&a.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,a=[];for(let{from:s,to:i}of If.findRegions(r)){let o=r.doc.lineAt(s),c={line:o.number-1,col:s-o.from,pos:s};for(let u of e.verify(r.sliceDoc(s,i),t))a.push(ion(u,r.doc,c))}return a}}function r_e(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function ion(e,t,n){let r=r_e(e.line,e.column,t,n),a={from:r,to:e.endLine!=null&&e.endColumn!=1?r_e(e.endLine,e.endColumn,t,n):r,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:s,text:i}=e.fix,o=s[0]+n.pos-r,c=s[1]+n.pos-r;a.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+o,to:d+c,insert:i},scrollIntoView:!0})}}]}return a}const AM=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Ert,completionPath:Srt,esLint:son,javascript:x4,javascriptLanguage:If,jsxLanguage:ude,localCompletionSource:wrt,scopeCompletionSource:ton,snippets:ode,tsxLanguage:dde,typescriptLanguage:cde,typescriptSnippets:yrt},Symbol.toStringTag,{value:"Module"})),KE=["_blank","_self","_top","_parent"],uU=["ascii","utf-8","utf-16","latin1","latin1"],dU=["get","post","put","delete"],fU=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Yu=["true","false"],Nn={},oon={a:{attrs:{href:null,ping:null,type:null,media:null,target:KE,hreflang:null}},abbr:Nn,address:Nn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Nn,aside:Nn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Nn,base:{attrs:{href:null,target:KE}},bdi:Nn,bdo:Nn,blockquote:{attrs:{cite:null}},body:Nn,br:Nn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:fU,formmethod:dU,formnovalidate:["novalidate"],formtarget:KE,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Nn,center:Nn,cite:Nn,code:Nn,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Nn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Nn,div:Nn,dl:Nn,dt:Nn,em:Nn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Nn,figure:Nn,footer:Nn,form:{attrs:{action:null,name:null,"accept-charset":uU,autocomplete:["on","off"],enctype:fU,method:dU,novalidate:["novalidate"],target:KE}},h1:Nn,h2:Nn,h3:Nn,h4:Nn,h5:Nn,h6:Nn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Nn,hgroup:Nn,hr:Nn,html:{attrs:{manifest:null}},i:Nn,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:fU,formmethod:dU,formnovalidate:["novalidate"],formtarget:KE,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Nn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Nn,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Nn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:uU,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Nn,noscript:Nn,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Nn,param:{attrs:{name:null,value:null}},pre:Nn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Nn,rt:Nn,ruby:Nn,samp:Nn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:uU}},section:Nn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Nn,source:{attrs:{src:null,type:null,media:null}},span:Nn,strong:Nn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Nn,summary:Nn,sup:Nn,table:Nn,tbody:Nn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Nn,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Nn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Nn,time:{attrs:{datetime:null}},title:Nn,tr:Nn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Nn,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Nn},Crt={accesskey:null,class:null,contenteditable:Yu,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Yu,autocorrect:Yu,autocapitalize:Yu,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Yu,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Yu,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Yu,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Yu,"aria-hidden":Yu,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Yu,"aria-multiselectable":Yu,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Yu,"aria-relevant":null,"aria-required":Yu,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},jrt="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of jrt)Crt[e]=null;let gN=class{constructor(t,n){this.tags={...oon,...t},this.globalAttrs={...Crt,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};gN.default=new gN;function pk(e,t,n=e.length){if(!t)return"";let r=t.firstChild,a=r&&r.getChild("TagName");return a?e.sliceString(a.from,Math.min(a.to,n)):""}function hk(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function Trt(e,t,n){let r=n.tags[pk(e,hk(t))];return r?.children||n.allTags}function fde(e,t){let n=[];for(let r=hk(t);r&&!r.type.isTop;r=hk(r.parent)){let a=pk(e,r);if(a&&r.lastChild.name=="CloseTag")break;a&&n.indexOf(a)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(a)}return n}const Nrt=/^[:\-\.\w\u00b7-\uffff]*$/;function a_e(e,t,n,r,a){let s=/\s*>/.test(e.sliceDoc(a,a+5))?"":">",i=hk(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:a,options:Trt(e.doc,i,t).map(o=>({label:o,type:"type"})).concat(fde(e.doc,n).map((o,c)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function s_e(e,t,n,r){let a=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:fde(e.doc,t).map((s,i)=>({label:s,apply:s+a,type:"type",boost:99-i})),validFor:Nrt}}function lon(e,t,n,r){let a=[],s=0;for(let i of Trt(e.doc,n,t))a.push({label:"<"+i,type:"type"});for(let i of fde(e.doc,n))a.push({label:"</"+i+">",type:"type",boost:99-s++});return{from:r,to:r,options:a,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function con(e,t,n,r,a){let s=hk(n),i=s?t.tags[pk(e.doc,s)]:null,o=i&&i.attrs?Object.keys(i.attrs):[],c=i&&i.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:a,options:c.map(u=>({label:u,type:"property"})),validFor:Nrt}}function uon(e,t,n,r,a){var s;let i=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],c;if(i){let u=e.sliceDoc(i.from,i.to),d=t.globalAttrs[u];if(!d){let f=hk(n),p=f?t.tags[pk(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,a).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(a,a+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:p+m+h,type:"constant"})}}return{from:r,to:a,options:o,validFor:c}}function Art(e,t){let{state:n,pos:r}=t,a=us(n).resolveInner(r,-1),s=a.resolve(r);for(let i=r,o;s==a&&(o=a.childBefore(i));){let c=o.lastChild;if(!c||!c.type.isError||c.from<c.to)break;s=a=o,i=c.from}return a.name=="TagName"?a.parent&&/CloseTag$/.test(a.parent.name)?s_e(n,a,a.from,r):a_e(n,e,a,a.from,r):a.name=="StartTag"||a.name=="IncompleteTag"?a_e(n,e,a,r,r):a.name=="StartCloseTag"||a.name=="IncompleteCloseTag"?s_e(n,a,r,r):a.name=="OpenTag"||a.name=="SelfClosingTag"||a.name=="AttributeName"?con(n,e,a,a.name=="AttributeName"?a.from:r,r):a.name=="Is"||a.name=="AttributeValue"||a.name=="UnquotedAttributeValue"?uon(n,e,a,a.name=="Is"?r:a.from,r):t.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?lon(n,e,a,r):null}function Irt(e){return Art(gN.default,e)}function Rrt(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new gN(t,n):gN.default;return a=>Art(r,a)}const don=If.parser.configure({top:"SingleExpression"}),Prt=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:cde.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:ude.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:dde.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:don},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:If.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:mN.parser}],Mrt=[{name:"style",parser:mN.parser.configure({top:"Styles"})}].concat(jrt.map(e=>({name:e,parser:If.parser}))),Drt=rw.define({name:"html",parser:zsn.configure({props:[Xw.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let r=e.node;;){let a=r.lastChild;if(!a||a.name!="Element"||a.to!=r.to)break;t=r=a}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),Kw.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),pnt.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Uj=Drt.configure({wrap:lrt(Prt,Mrt)});function $rt(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=lrt((e.nestedLanguages||[]).concat(Prt),(e.nestedAttributes||[]).concat(Mrt)));let r=n?Drt.configure({wrap:n,dialect:t}):t?Uj.configure({dialect:t}):Uj;return new sw(r,[Uj.data.of({autocomplete:Rrt(e)}),e.autoCloseTags!==!1?Lrt:[],x4().support,grt().support])}const i_e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Lrt=vt.inputHandler.of((e,t,n,r,a)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!Uj.isActiveAt(e.state,t,-1))return!1;let s=a(),{state:i}=s,o=i.changeByRange(c=>{var u,d,f;let p=i.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,m=us(i).resolveInner(h,-1),g;if(p&&r==">"&&m.name=="EndTag"){let v=m.parent;if(((d=(u=v.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=pk(i.doc,v.parent,h))&&!i_e.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`</${g}>`;return{range:c,changes:{from:h,to:b,insert:S}}}}else if(p&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=pk(i.doc,v,h))&&!i_e.has(g)){let b=h+(i.doc.sliceString(h,h+1)===">"?1:0),S=`${g}>`;return{range:Je.cursor(h+S.length,-1),changes:{from:h,to:b,insert:S}}}}return{range:c}});return o.changes.empty?!1:(e.dispatch([s,i.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),fon=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Lrt,html:$rt,htmlCompletionSource:Irt,htmlCompletionSourceWith:Rrt,htmlLanguage:Uj},Symbol.toStringTag,{value:"Module"})),Frt=B6({commentTokens:{block:{open:"<!--",close:"-->"}}}),zrt=new cr,Brt=Uan.configure({props:[Kw.add(e=>!e.is("Block")||e.is("Document")||Fne(e)!=null||pon(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),zrt.add(Fne),Xw.add({Document:()=>null}),Fy.add({Document:Frt})]});function Fne(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function pon(e){return e.name=="OrderedList"||e.name=="BulletList"}function hon(e,t){let n=e;for(;;){let r=n.nextSibling,a;if(!r||(a=Fne(r.type))!=null&&a<=t)break;n=r}return n.to}const mon=tnt.of((e,t,n)=>{for(let r=us(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let a=r.type.prop(zrt);if(a==null)continue;let s=hon(r,a);if(s>n)return{from:n,to:s}}return null});function pde(e){return new md(Frt,e,[],"markdown")}const Urt=pde(Brt),gon=Brt.configure([Jan,tsn,esn,nsn,{props:[Kw.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),lw=pde(gon);function von(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=qe.matchLanguageName(e,n,!0),r instanceof qe)return r.support?r.support.language.parser:aw.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class pU{constructor(t,n,r,a,s,i,o){this.node=t,this.from=n,this.to=r,this.spaceBefore=a,this.spaceAfter=s,this.type=i,this.item=o}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let a=this.to-this.from-r.length-this.spaceAfter.length;a>0;a--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+qrt(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function Vrt(e,t){let n=[],r=[];for(let a=e;a;a=a.parent){if(a.name=="FencedCode")return r;(a.name=="ListItem"||a.name=="Blockquote")&&n.push(a)}for(let a=n.length-1;a>=0;a--){let s=n[a],i,o=t.lineAt(s.from),c=s.from-o.from;if(s.name=="Blockquote"&&(i=/^ *>( ?)/.exec(o.text.slice(c))))r.push(new pU(s,c,c+i[0].length,"",i[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(o.text.slice(c)))){let u=i[3],d=i[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),r.push(new pU(s.parent,c,c+d,i[1],u,i[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(c)))){let u=i[4],d=i[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=i[2];i[3]&&(f+=i[3].replace(/[xX]/," ")),r.push(new pU(s.parent,c,c+d,i[1],u,f,s))}}return r}function qrt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function hU(e,t,n,r=0){for(let a=-1,s=e;;){if(s.name=="ListItem"){let o=qrt(s,t),c=+o[2];if(a>=0){if(c!=a+1)return;n.push({from:s.from+o[1].length,to:s.from+o[0].length,insert:String(a+2+r)})}a=c}let i=s.nextSibling;if(!i)break;s=i}}function hde(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(w_)!=" ")return e;let r=Fp(e,4,n),a="";for(let s=r;s>0;)s>=4?(a+=" ",s-=4):(a+=" ",s--);return a+e.slice(n)}const Hrt=(e={})=>({state:t,dispatch:n})=>{let r=us(t),{doc:a}=t,s=null,i=t.changeByRange(o=>{if(!o.empty||!lw.isActiveAt(t,o.from,-1)&&!lw.isActiveAt(t,o.from,1))return s={range:o};let c=o.from,u=a.lineAt(c),d=Vrt(r.resolveInner(c,-1),a);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return s={range:o};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return s={range:o};let p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){let b=f.node.firstChild,S=f.node.getChild("ListItem","ListItem");if(b.to>=c||S&&S.to<c||u.from>0&&!/[^\s>]/.test(a.lineAt(u.from-1).text)||e.nonTightLists===!1){let O=d.length>1?d[d.length-2]:null,k,E="";O&&O.item?(k=u.from+O.from,E=O.marker(a,1)):k=u.from+(O?O.to:0);let C=[{from:k,to:c,insert:E}];return f.node.name=="OrderedList"&&hU(f.item,a,C,-2),O&&O.node.name=="OrderedList"&&hU(O.item,a,C),{range:Je.cursor(k+E.length),changes:C}}else{let O=l_e(d,t,u);return{range:Je.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&u.from){let b=a.lineAt(u.from-1),S=/>\s*$/.exec(b.text);if(S&&S.index==f.from){let O=t.changes([{from:b.from+S.index,to:b.to},{from:u.from+f.from,to:u.to}]);return{range:o.map(O),changes:O}}}let h=[];f.node.name=="OrderedList"&&hU(f.item,a,h);let m=f.item&&f.item.from<u.from,g="";if(!m||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let b=0,S=d.length-1;b<=S;b++)g+=b==S&&!m?d[b].marker(a,1):d[b].blank(b<S?Fp(u.text,4,d[b+1].from)-g.length:null);let v=c;for(;v>u.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return g=hde(g,t),yon(f.node,t.doc)&&(g=l_e(d,t,u)+t.lineBreak+g),h.push({from:v,to:c,insert:t.lineBreak+g}),{range:Je.cursor(v+g.length+1),changes:h}});return s?!1:(n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0)},Qrt=Hrt();function o_e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function yon(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let a=t.lineAt(n.to),s=t.lineAt(r.from),i=/^[\s>]*$/.test(a.text);return a.number+(i?0:1)<s.number}function l_e(e,t,n){let r="";for(let a=0,s=e.length-2;a<=s;a++)r+=e[a].blank(a<s?Fp(n.text,4,e[a+1].from)-r.length:null,a<s);return hde(r,t)}function bon(e,t){let n=e.resolveInner(t,-1),r=t;o_e(n)&&(r=n.from,n=n.parent);for(let a;a=n.childBefore(r);)if(o_e(a))r=a.from;else if(a.name=="OrderedList"||a.name=="BulletList")n=a.lastChild,r=n.to;else break;return n}const Grt=({state:e,dispatch:t})=>{let n=us(e),r=null,a=e.changeByRange(s=>{let i=s.from,{doc:o}=e;if(s.empty&&lw.isActiveAt(e,s.from)){let c=o.lineAt(i),u=Vrt(bon(n,i),o);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(i-c.from>f&&!/\S/.test(c.text.slice(f,i-c.from)))return{range:Je.cursor(c.from+f),changes:{from:c.from+f,to:i}};if(i-c.from==f&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let p=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let h=d.blank(Fp(c.text,4,d.to)-Fp(c.text,4,d.from));return p==c.from&&(h=hde(h,e)),{range:Je.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<i)return{range:Je.cursor(p),changes:{from:p,to:i}}}}}return r={range:s}});return r?!1:(t(e.update(a,{scrollIntoView:!0,userEvent:"delete"})),!0)},Wrt=[{key:"Enter",run:Qrt},{key:"Backspace",run:Grt}],Zrt=$rt({matchClosingTags:!1});function mde(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:a}=Urt,completeHTMLTags:s=!0,pasteURLAsLink:i=!0,htmlTagLanguage:o=Zrt}=e;if(!(a instanceof H6))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[o.support,mon],d;i&&u.push(Yrt),n instanceof sw?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?von(t,d):void 0;c.push(qan({codeParser:f,htmlParser:o.language.parser})),r&&u.push(Zp.high(x_.of(Wrt)));let p=pde(a.configure(c));return s&&u.push(p.data.of({autocomplete:xon})),new sw(p,u)}function xon(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let a=us(t).resolveInner(n,-1);for(;a&&!a.type.isTop;){if(a.name=="CodeBlock"||a.name=="FencedCode"||a.name=="ProcessingInstructionBlock"||a.name=="CommentBlock"||a.name=="Link"||a.name=="Image")return null;a=a.parent}return{from:n-r[0].length,to:n,options:won(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let mU=null;function won(){if(mU)return mU;let e=Irt(new Hue(Tr.create({extensions:Zrt}),0,!0));return mU=e?e.options:[]}const Son=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Yrt=vt.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let a=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!a||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(a)||(/^www\./.test(a)&&(a="https://"+a),!lw.isActiveAt(t.state,r.from,1)))return!1;let s=us(t.state),i=!1;return s.iterate({from:r.from,to:r.to,enter:o=>{(o.from>r.from||Son.test(o.name))&&(i=!0)},leave:o=>{o.to<r.to&&(i=!0)}}),i?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${a})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Oon=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Urt,deleteMarkupBackward:Grt,insertNewlineContinueMarkup:Qrt,insertNewlineContinueMarkupCommand:Hrt,markdown:mde,markdownKeymap:Wrt,markdownLanguage:lw,pasteURLAsLink:Yrt},Symbol.toStringTag,{value:"Module"}));function ct(e){return new sw(Bue.define(e))}function uy(e){return Qe(()=>import("./index-BOZnSpqn.js"),__vite__mapDeps([4,2]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const Xrt=[qe.of({name:"C",extensions:["c","h","ino"],load(){return Qe(()=>import("./index-B0DJvOas.js"),__vite__mapDeps([5,2]),import.meta.url).then(e=>e.cpp())}}),qe.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Qe(()=>import("./index-B0DJvOas.js"),__vite__mapDeps([5,2]),import.meta.url).then(e=>e.cpp())}}),qe.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return uy("Cassandra")}}),qe.of({name:"CSS",extensions:["css"],load(){return Qe(()=>Promise.resolve().then(()=>xin),void 0,import.meta.url).then(e=>e.css())}}),qe.of({name:"Go",extensions:["go"],load(){return Qe(()=>import("./index-CstqGswn.js"),__vite__mapDeps([6,2]),import.meta.url).then(e=>e.go())}}),qe.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Qe(()=>Promise.resolve().then(()=>fon),void 0,import.meta.url).then(e=>e.html())}}),qe.of({name:"Java",extensions:["java"],load(){return Qe(()=>import("./index-D3BhNk62.js"),__vite__mapDeps([7,2]),import.meta.url).then(e=>e.java())}}),qe.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Qe(()=>Promise.resolve().then(()=>AM),void 0,import.meta.url).then(e=>e.javascript())}}),qe.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return Qe(()=>import("./index-So5-kAzB.js"),__vite__mapDeps([8,2]),import.meta.url).then(e=>e.jinja())}}),qe.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Qe(()=>Promise.resolve().then(()=>Prn),void 0,import.meta.url).then(e=>e.json())}}),qe.of({name:"JSX",extensions:["jsx"],load(){return Qe(()=>Promise.resolve().then(()=>AM),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),qe.of({name:"LESS",extensions:["less"],load(){return Qe(()=>import("./index-CE3fi9kq.js"),__vite__mapDeps([9,2]),import.meta.url).then(e=>e.less())}}),qe.of({name:"Liquid",extensions:["liquid"],load(){return Qe(()=>import("./index-DYEA3vXC.js"),__vite__mapDeps([10,2]),import.meta.url).then(e=>e.liquid())}}),qe.of({name:"MariaDB SQL",load(){return uy("MariaSQL")}}),qe.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Qe(()=>Promise.resolve().then(()=>Oon),void 0,import.meta.url).then(e=>e.markdown())}}),qe.of({name:"MS SQL",load(){return uy("MSSQL")}}),qe.of({name:"MySQL",load(){return uy("MySQL")}}),qe.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Qe(()=>import("./index-CqmD5Z0h.js"),__vite__mapDeps([11,2]),import.meta.url).then(e=>e.php())}}),qe.of({name:"PLSQL",extensions:["pls"],load(){return uy("PLSQL")}}),qe.of({name:"PostgreSQL",load(){return uy("PostgreSQL")}}),qe.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Qe(()=>import("./index-B9q08_EN.js"),__vite__mapDeps([12,2]),import.meta.url).then(e=>e.python())}}),qe.of({name:"Rust",extensions:["rs"],load(){return Qe(()=>import("./index-BZoQ-eCy.js"),__vite__mapDeps([13,2]),import.meta.url).then(e=>e.rust())}}),qe.of({name:"Sass",extensions:["sass"],load(){return Qe(()=>import("./index-B9ls1ybt.js"),__vite__mapDeps([14,2]),import.meta.url).then(e=>e.sass({indented:!0}))}}),qe.of({name:"SCSS",extensions:["scss"],load(){return Qe(()=>import("./index-B9ls1ybt.js"),__vite__mapDeps([14,2]),import.meta.url).then(e=>e.sass())}}),qe.of({name:"SQL",extensions:["sql"],load(){return uy("StandardSQL")}}),qe.of({name:"SQLite",load(){return uy("SQLite")}}),qe.of({name:"TSX",extensions:["tsx"],load(){return Qe(()=>Promise.resolve().then(()=>AM),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),qe.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Qe(()=>Promise.resolve().then(()=>AM),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),qe.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Qe(()=>import("./index-Vn_AsM_r.js"),__vite__mapDeps([15,2]),import.meta.url).then(e=>e.wast())}}),qe.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Qe(()=>import("./index-Cpo0mxI6.js"),__vite__mapDeps([16,2]),import.meta.url).then(e=>e.xml())}}),qe.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Qe(()=>import("./index-HnLIlXpI.js"),__vite__mapDeps([17,2]),import.meta.url).then(e=>e.yaml())}}),qe.of({name:"APL",extensions:["dyalog","apl"],load(){return Qe(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>ct(e.apl))}}),qe.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Qe(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>ct(e.asciiArmor))}}),qe.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Qe(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>ct(e.asn1({})))}}),qe.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Qe(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>ct(e.asterisk))}}),qe.of({name:"Brainfuck",extensions:["b","bf"],load(){return Qe(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>ct(e.brainfuck))}}),qe.of({name:"Cobol",extensions:["cob","cpy"],load(){return Qe(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>ct(e.cobol))}}),qe.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.csharp))}}),qe.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),qe.of({name:"ClojureScript",extensions:["cljs"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),qe.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Qe(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>ct(e.gss))}}),qe.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Qe(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>ct(e.cmake))}}),qe.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Qe(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>ct(e.coffeeScript))}}),qe.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Qe(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>ct(e.commonLisp))}}),qe.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Qe(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>ct(e.cypher))}}),qe.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Qe(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>ct(e.cython))}}),qe.of({name:"Crystal",extensions:["cr"],load(){return Qe(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>ct(e.crystal))}}),qe.of({name:"D",extensions:["d"],load(){return Qe(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>ct(e.d))}}),qe.of({name:"Dart",extensions:["dart"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.dart))}}),qe.of({name:"diff",extensions:["diff","patch"],load(){return Qe(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>ct(e.diff))}}),qe.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Qe(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([18,19]),import.meta.url).then(e=>ct(e.dockerFile))}}),qe.of({name:"DTD",extensions:["dtd"],load(){return Qe(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>ct(e.dtd))}}),qe.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Qe(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>ct(e.dylan))}}),qe.of({name:"EBNF",load(){return Qe(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>ct(e.ebnf))}}),qe.of({name:"ECL",extensions:["ecl"],load(){return Qe(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>ct(e.ecl))}}),qe.of({name:"edn",extensions:["edn"],load(){return Qe(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ct(e.clojure))}}),qe.of({name:"Eiffel",extensions:["e"],load(){return Qe(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>ct(e.eiffel))}}),qe.of({name:"Elm",extensions:["elm"],load(){return Qe(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>ct(e.elm))}}),qe.of({name:"Erlang",extensions:["erl"],load(){return Qe(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>ct(e.erlang))}}),qe.of({name:"Esper",load(){return Qe(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>ct(e.esper))}}),qe.of({name:"Factor",extensions:["factor"],load(){return Qe(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([20,19]),import.meta.url).then(e=>ct(e.factor))}}),qe.of({name:"FCL",load(){return Qe(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>ct(e.fcl))}}),qe.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Qe(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>ct(e.forth))}}),qe.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Qe(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>ct(e.fortran))}}),qe.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Qe(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.fSharp))}}),qe.of({name:"Gas",extensions:["s"],load(){return Qe(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>ct(e.gas))}}),qe.of({name:"Gherkin",extensions:["feature"],load(){return Qe(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>ct(e.gherkin))}}),qe.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Qe(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>ct(e.groovy))}}),qe.of({name:"Haskell",extensions:["hs"],load(){return Qe(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>ct(e.haskell))}}),qe.of({name:"Haxe",extensions:["hx"],load(){return Qe(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.haxe))}}),qe.of({name:"HXML",extensions:["hxml"],load(){return Qe(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ct(e.hxml))}}),qe.of({name:"HTTP",load(){return Qe(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>ct(e.http))}}),qe.of({name:"IDL",extensions:["pro"],load(){return Qe(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>ct(e.idl))}}),qe.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Qe(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>ct(e.jsonld))}}),qe.of({name:"Julia",extensions:["jl"],load(){return Qe(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>ct(e.julia))}}),qe.of({name:"Kotlin",extensions:["kt","kts"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.kotlin))}}),qe.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Qe(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>ct(e.liveScript))}}),qe.of({name:"Lua",extensions:["lua"],load(){return Qe(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>ct(e.lua))}}),qe.of({name:"mIRC",extensions:["mrc"],load(){return Qe(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>ct(e.mirc))}}),qe.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Qe(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>ct(e.mathematica))}}),qe.of({name:"Modelica",extensions:["mo"],load(){return Qe(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>ct(e.modelica))}}),qe.of({name:"MUMPS",extensions:["mps"],load(){return Qe(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>ct(e.mumps))}}),qe.of({name:"Mbox",extensions:["mbox"],load(){return Qe(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>ct(e.mbox))}}),qe.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Qe(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>ct(e.nginx))}}),qe.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Qe(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([21,19]),import.meta.url).then(e=>ct(e.nsis))}}),qe.of({name:"NTriples",extensions:["nt","nq"],load(){return Qe(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>ct(e.ntriples))}}),qe.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveC))}}),qe.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.objectiveCpp))}}),qe.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Qe(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.oCaml))}}),qe.of({name:"Octave",extensions:["m"],load(){return Qe(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>ct(e.octave))}}),qe.of({name:"Oz",extensions:["oz"],load(){return Qe(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>ct(e.oz))}}),qe.of({name:"Pascal",extensions:["p","pas"],load(){return Qe(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>ct(e.pascal))}}),qe.of({name:"Perl",extensions:["pl","pm"],load(){return Qe(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>ct(e.perl))}}),qe.of({name:"Pig",extensions:["pig"],load(){return Qe(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>ct(e.pig))}}),qe.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Qe(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>ct(e.powerShell))}}),qe.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Qe(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>ct(e.properties))}}),qe.of({name:"ProtoBuf",extensions:["proto"],load(){return Qe(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>ct(e.protobuf))}}),qe.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return Qe(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([22,23]),import.meta.url).then(e=>ct(e.pug))}}),qe.of({name:"Puppet",extensions:["pp"],load(){return Qe(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>ct(e.puppet))}}),qe.of({name:"Q",extensions:["q"],load(){return Qe(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>ct(e.q))}}),qe.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Qe(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>ct(e.r))}}),qe.of({name:"RPM Changes",load(){return Qe(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmChanges))}}),qe.of({name:"RPM Spec",extensions:["spec"],load(){return Qe(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ct(e.rpmSpec))}}),qe.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Qe(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>ct(e.ruby))}}),qe.of({name:"SAS",extensions:["sas"],load(){return Qe(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>ct(e.sas))}}),qe.of({name:"Scala",extensions:["scala"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.scala))}}),qe.of({name:"Scheme",extensions:["scm","ss"],load(){return Qe(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>ct(e.scheme))}}),qe.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Qe(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>ct(e.shell))}}),qe.of({name:"Sieve",extensions:["siv","sieve"],load(){return Qe(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>ct(e.sieve))}}),qe.of({name:"Smalltalk",extensions:["st"],load(){return Qe(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>ct(e.smalltalk))}}),qe.of({name:"Solr",load(){return Qe(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>ct(e.solr))}}),qe.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Qe(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ct(e.sml))}}),qe.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Qe(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>ct(e.sparql))}}),qe.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Qe(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>ct(e.spreadsheet))}}),qe.of({name:"Squirrel",extensions:["nut"],load(){return Qe(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ct(e.squirrel))}}),qe.of({name:"Stylus",extensions:["styl"],load(){return Qe(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>ct(e.stylus))}}),qe.of({name:"Swift",extensions:["swift"],load(){return Qe(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>ct(e.swift))}}),qe.of({name:"sTeX",load(){return Qe(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),qe.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Qe(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ct(e.stex))}}),qe.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Qe(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),qe.of({name:"Tcl",extensions:["tcl"],load(){return Qe(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>ct(e.tcl))}}),qe.of({name:"Textile",extensions:["textile"],load(){return Qe(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>ct(e.textile))}}),qe.of({name:"TiddlyWiki",load(){return Qe(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>ct(e.tiddlyWiki))}}),qe.of({name:"Tiki wiki",load(){return Qe(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>ct(e.tiki))}}),qe.of({name:"TOML",extensions:["toml"],load(){return Qe(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>ct(e.toml))}}),qe.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Qe(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>ct(e.troff))}}),qe.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Qe(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>ct(e.ttcn))}}),qe.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Qe(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>ct(e.ttcnCfg))}}),qe.of({name:"Turtle",extensions:["ttl"],load(){return Qe(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>ct(e.turtle))}}),qe.of({name:"Web IDL",extensions:["webidl"],load(){return Qe(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>ct(e.webIDL))}}),qe.of({name:"VB.NET",extensions:["vb"],load(){return Qe(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>ct(e.vb))}}),qe.of({name:"VBScript",extensions:["vbs"],load(){return Qe(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>ct(e.vbScript))}}),qe.of({name:"Velocity",extensions:["vtl"],load(){return Qe(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>ct(e.velocity))}}),qe.of({name:"Verilog",extensions:["v"],load(){return Qe(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ct(e.verilog))}}),qe.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Qe(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>ct(e.vhdl))}}),qe.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return Qe(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>ct(e.xQuery))}}),qe.of({name:"Yacas",extensions:["ys"],load(){return Qe(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>ct(e.yacas))}}),qe.of({name:"Z80",extensions:["z80"],load(){return Qe(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>ct(e.z80))}}),qe.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.mscgen))}}),qe.of({name:"Xù",extensions:["xu"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.xu))}}),qe.of({name:"MsGenny",extensions:["msgenny"],load(){return Qe(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ct(e.msgenny))}}),qe.of({name:"Vue",extensions:["vue"],load(){return Qe(()=>import("./index-B4qKXjKr.js"),__vite__mapDeps([24,2]),import.meta.url).then(e=>e.vue())}}),qe.of({name:"Angular Template",load(){return Qe(()=>import("./index-IMWk_B5X.js"),__vite__mapDeps([25,2]),import.meta.url).then(e=>e.angular())}})];var kon=e=>{var{theme:t,settings:n={},styles:r=[]}=e,a={".cm-gutters":{}},s={};n.background&&(s.backgroundColor=n.background),n.backgroundImage&&(s.backgroundImage=n.backgroundImage),n.foreground&&(s.color=n.foreground),n.fontSize&&(s.fontSize=n.fontSize),(n.background||n.foreground)&&(a["&"]=s),n.fontFamily&&(a["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(a[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(a[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(a[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(a[".cm-content"]={caretColor:n.caret},a[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var i={};n.gutterActiveForeground&&(i.color=n.gutterActiveForeground),n.lineHighlight&&(a[".cm-activeLine"]={backgroundColor:n.lineHighlight},i.backgroundColor=n.lineHighlight),a[".cm-activeLineGutter"]=i,n.selection&&(a["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(a["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var o=vt.theme(a,{dark:t==="dark"}),c=S_.define(r),u=[o,zue(c)];return u},_on={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},Eon=[{tag:fe.comment,color:"#6272a4"},{tag:fe.string,color:"#f1fa8c"},{tag:fe.atom,color:"#bd93f9"},{tag:fe.meta,color:"#f8f8f2"},{tag:[fe.keyword,fe.operator,fe.tagName],color:"#ff79c6"},{tag:[fe.function(fe.propertyName),fe.propertyName],color:"#66d9ef"},{tag:[fe.definition(fe.variableName),fe.function(fe.variableName),fe.className,fe.attributeName],color:"#50fa7b"},{tag:fe.atom,color:"#bd93f9"}],Q6=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return kon({theme:t,settings:bb({},_on,n),styles:[...Eon,...r]})};Q6();const Con=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=vde(e.state,n.from);return r.line?jon(e):r.block?Non(e):!1};function gde(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let a=e(t,n);return a?(r(n.update(a)),!0):!1}}const jon=gde(Ron,0),Ton=gde(Krt,0),Non=gde((e,t)=>Krt(e,t,Ion(t)),0);function vde(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const JE=50;function Aon(e,{open:t,close:n},r,a){let s=e.sliceDoc(r-JE,r),i=e.sliceDoc(a,a+JE),o=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(i)[0].length,u=s.length-o;if(s.slice(u-t.length,u)==t&&i.slice(c,c+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:a+c,margin:c&&1}};let d,f;a-r<=2*JE?d=f=e.sliceDoc(r,a):(d=e.sliceDoc(r,r+JE),f=e.sliceDoc(a-JE,a));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(m,m+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:a-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function Ion(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),a=n.to<=r.to?r:e.doc.lineAt(n.to);a.from>r.from&&a.from==n.to&&(a=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>r.from?t[s].to=a.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:a.to})}return t}function Krt(e,t,n=t.selection.ranges){let r=n.map(s=>vde(t,s.from).block);if(!r.every(s=>s))return null;let a=n.map((s,i)=>Aon(t,r[i],s.from,s.to));if(e!=2&&!a.every(s=>s))return{changes:t.changes(n.map((s,i)=>a[i]?[]:[{from:s.from,insert:r[i].open+" "},{from:s.to,insert:" "+r[i].close}]))};if(e!=1&&a.some(s=>s)){let s=[];for(let i=0,o;i<a.length;i++)if(o=a[i]){let c=r[i],{open:u,close:d}=o;s.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:s}}return null}function Ron(e,t,n=t.selection.ranges){let r=[],a=-1;for(let{from:s,to:i}of n){let o=r.length,c=1e9,u=vde(t,s).line;if(u){for(let d=s;d<=i;){let f=t.doc.lineAt(d);if(f.from>a&&(s==i||i>f.from)){a=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,m=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:m,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=o;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==o+1&&(r[o].single=!0)}}if(e!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&s.push({from:o.from+u,insert:c+" "});let i=t.changes(s);return{changes:i,selection:t.selection.map(i,1)}}else if(e!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:i,comment:o,token:c}of r)if(o>=0){let u=i.from+o,d=u+c.length;i.text[d-i.from]==" "&&d++,s.push({from:u,to:d})}return{changes:s}}return null}const zne=Am.define(),Pon=Am.define(),Mon=Zt.define(),Jrt=Zt.define({combine(e){return Im(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,a)=>t(r,a)||n(r,a)})}}),eat=Yi.define({create(){return Yh.empty},update(e,t){let n=t.state.facet(Jrt),r=t.annotation(zne);if(r){let c=mu.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=w4(d,d.length,n.minDepth,c):d=rat(d,t.startState.selection),new Yh(u==0?r.rest:d,u==0?d:r.rest)}let a=t.annotation(Pon);if((a=="full"||a=="before")&&(e=e.isolate()),t.annotation(lo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=mu.fromTransaction(t),i=t.annotation(lo.time),o=t.annotation(lo.userEvent);return s?e=e.addChanges(s,i,o,n,t):t.selection&&(e=e.addSelection(t.startState.selection,i,o,n.newGroupDelay)),(a=="full"||a=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Yh(e.done.map(mu.fromJSON),e.undone.map(mu.fromJSON))}});function Don(e={}){return[eat,Jrt.of(e),vt.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?tat:t.inputType=="historyRedo"?Bne:null;return r?(t.preventDefault(),r(n)):!1}})]}function G6(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let a=n.field(eat,!1);if(!a)return!1;let s=a.pop(e,n,t);return s?(r(s),!0):!1}}const tat=G6(0,!1),Bne=G6(1,!1),$on=G6(0,!0),Lon=G6(1,!0);class mu{constructor(t,n,r,a,s){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=a,this.selectionsAfter=s}setSelAfter(t){return new mu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(a=>a.toJSON())}}static fromJSON(t){return new mu(t.changes&&ao.fromJSON(t.changes),[],t.mapped&&sm.fromJSON(t.mapped),t.startSelection&&Je.fromJSON(t.startSelection),t.selectionsAfter.map(Je.fromJSON))}static fromTransaction(t,n){let r=kf;for(let a of t.startState.facet(Mon)){let s=a(t);s.length&&(r=r.concat(s))}return!r.length&&t.changes.empty?null:new mu(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,kf)}static selection(t){return new mu(void 0,kf,void 0,void 0,t)}}function w4(e,t,n,r){let a=t+1>n+20?t-n-1:0,s=e.slice(a,t);return s.push(r),s}function Fon(e,t){let n=[],r=!1;return e.iterChangedRanges((a,s)=>n.push(a,s)),t.iterChangedRanges((a,s,i,o)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];o>=u&&i<=d&&(r=!0)}}),r}function zon(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function nat(e,t){return e.length?t.length?e.concat(t):e:t}const kf=[],Bon=200;function rat(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Bon));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),w4(e,e.length-1,1e9,n.setSelAfter(r)))}else return[mu.selection([t])]}function Uon(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function gU(e,t){if(!e.length)return e;let n=e.length,r=kf;for(;n;){let a=Von(e[n-1],t,r);if(a.changes&&!a.changes.empty||a.effects.length){let s=e.slice(0,n);return s[n-1]=a,s}else t=a.mapped,n--,r=a.selectionsAfter}return r.length?[mu.selection(r)]:kf}function Von(e,t,n){let r=nat(e.selectionsAfter.length?e.selectionsAfter.map(o=>o.map(t)):kf,n);if(!e.changes)return mu.selection(r);let a=e.changes.map(t),s=t.mapDesc(e.changes,!0),i=e.mapped?e.mapped.composeDesc(s):s;return new mu(a,Xn.mapEffects(e.effects,t),i,e.startSelection.map(s),r)}const qon=/^(input\.type|delete)($|\.)/;class Yh{constructor(t,n,r=0,a=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=a}isolate(){return this.prevTime?new Yh(this.done,this.undone):this}addChanges(t,n,r,a,s){let i=this.done,o=i[i.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!r||qon.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime<a.newGroupDelay&&a.joinToEvent(s,Fon(o.changes,t.changes))||r=="input.type.compose")?i=w4(i,i.length-1,a.minDepth,new mu(t.changes.compose(o.changes),nat(Xn.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,kf)):i=w4(i,i.length,a.minDepth,t),new Yh(i,kf,n,r)}addSelection(t,n,r,a){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:kf;return s.length>0&&n-this.prevTime<a&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&zon(s[s.length-1],t)?this:new Yh(rat(this.done,t),this.undone,n,r)}addMapping(t){return new Yh(gU(this.done,t),gU(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let a=t==0?this.done:this.undone;if(a.length==0)return null;let s=a[a.length-1],i=s.selectionsAfter[0]||n.selection;if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:zne.of({side:t,rest:Uon(a),selection:i}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=a.length==1?kf:a.slice(0,a.length-1);return s.mapped&&(o=gU(o,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:zne.of({side:t,rest:o,selection:i}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Yh.empty=new Yh(kf,kf);const Hon=[{key:"Mod-z",run:tat,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Bne,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Bne,preventDefault:!0},{key:"Mod-u",run:$on,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Lon,preventDefault:!0}];function k_(e,t){return Je.create(e.ranges.map(t),e.mainIndex)}function Yp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Xp({state:e,dispatch:t},n){let r=k_(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Yp(e,r)),!0)}function W6(e,t){return Je.cursor(t?e.to:e.from)}function aat(e,t){return Xp(e,n=>n.empty?e.moveByChar(n,t):W6(n,t))}function ic(e){return e.textDirectionAt(e.state.selection.main.head)==xs.LTR}const sat=e=>aat(e,!ic(e)),iat=e=>aat(e,ic(e));function oat(e,t){return Xp(e,n=>n.empty?e.moveByGroup(n,t):W6(n,t))}const Qon=e=>oat(e,!ic(e)),Gon=e=>oat(e,ic(e));function Won(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Z6(e,t,n){let r=us(e).resolveInner(t.head),a=n?cr.closedBy:cr.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;Won(e,u,a)?r=u:c=n?u.to:u.from}let s=r.type.prop(a),i,o;return s&&(i=n?Zh(e,r.from,1):Zh(e,r.to,-1))&&i.matched?o=n?i.end.to:i.end.from:o=n?r.to:r.from,Je.cursor(o,n?-1:1)}const Zon=e=>Xp(e,t=>Z6(e.state,t,!ic(e))),Yon=e=>Xp(e,t=>Z6(e.state,t,ic(e)));function lat(e,t){return Xp(e,n=>{if(!n.empty)return W6(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const cat=e=>lat(e,!1),uat=e=>lat(e,!0);function dat(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,a;if(t){for(let s of e.state.facet(vt.scrollMargins)){let i=s(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}a=e.scrollDOM.clientHeight-n-r}else a=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,a-5)}}function fat(e,t){let n=dat(e),{state:r}=e,a=k_(r.selection,i=>i.empty?e.moveVertically(i,t,n.height):W6(i,t));if(a.eq(r.selection))return!1;let s;if(n.selfScroll){let i=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),c=o.top+n.marginTop,u=o.bottom-n.marginBottom;i&&i.top>c&&i.bottom<u&&(s=vt.scrollIntoView(a.main.head,{y:"start",yMargin:i.top-c}))}return e.dispatch(Yp(r,a),{effects:s}),!0}const c_e=e=>fat(e,!1),Une=e=>fat(e,!0);function Gb(e,t,n){let r=e.lineBlockAt(t.head),a=e.moveToLineBoundary(t,n);if(a.head==t.head&&a.head!=(n?r.to:r.from)&&(a=e.moveToLineBoundary(t,n,!1)),!n&&a.head==r.from&&r.length){let s=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&t.head!=r.from+s&&(a=Je.cursor(r.from+s))}return a}const Xon=e=>Xp(e,t=>Gb(e,t,!0)),Kon=e=>Xp(e,t=>Gb(e,t,!1)),Jon=e=>Xp(e,t=>Gb(e,t,!ic(e))),eln=e=>Xp(e,t=>Gb(e,t,ic(e))),tln=e=>Xp(e,t=>Je.cursor(e.lineBlockAt(t.head).from,1)),nln=e=>Xp(e,t=>Je.cursor(e.lineBlockAt(t.head).to,-1));function rln(e,t,n){let r=!1,a=k_(e.selection,s=>{let i=Zh(e,s.head,-1)||Zh(e,s.head,1)||s.head>0&&Zh(e,s.head-1,1)||s.head<e.doc.length&&Zh(e,s.head+1,-1);if(!i||!i.end)return s;r=!0;let o=i.start.from==s.head?i.end.to:i.end.from;return Je.cursor(o)});return r?(t(Yp(e,a)),!0):!1}const aln=({state:e,dispatch:t})=>rln(e,t);function Yf(e,t){let n=k_(e.state.selection,r=>{let a=t(r);return Je.range(r.anchor,a.head,a.goalColumn,a.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(Yp(e.state,n)),!0)}function pat(e,t){return Yf(e,n=>e.moveByChar(n,t))}const hat=e=>pat(e,!ic(e)),mat=e=>pat(e,ic(e));function gat(e,t){return Yf(e,n=>e.moveByGroup(n,t))}const sln=e=>gat(e,!ic(e)),iln=e=>gat(e,ic(e)),oln=e=>Yf(e,t=>Z6(e.state,t,!ic(e))),lln=e=>Yf(e,t=>Z6(e.state,t,ic(e)));function vat(e,t){return Yf(e,n=>e.moveVertically(n,t))}const yat=e=>vat(e,!1),bat=e=>vat(e,!0);function xat(e,t){return Yf(e,n=>e.moveVertically(n,t,dat(e).height))}const u_e=e=>xat(e,!1),d_e=e=>xat(e,!0),cln=e=>Yf(e,t=>Gb(e,t,!0)),uln=e=>Yf(e,t=>Gb(e,t,!1)),dln=e=>Yf(e,t=>Gb(e,t,!ic(e))),fln=e=>Yf(e,t=>Gb(e,t,ic(e))),pln=e=>Yf(e,t=>Je.cursor(e.lineBlockAt(t.head).from)),hln=e=>Yf(e,t=>Je.cursor(e.lineBlockAt(t.head).to)),f_e=({state:e,dispatch:t})=>(t(Yp(e,{anchor:0})),!0),p_e=({state:e,dispatch:t})=>(t(Yp(e,{anchor:e.doc.length})),!0),h_e=({state:e,dispatch:t})=>(t(Yp(e,{anchor:e.selection.main.anchor,head:0})),!0),m_e=({state:e,dispatch:t})=>(t(Yp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),mln=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),gln=({state:e,dispatch:t})=>{let n=Y6(e).map(({from:r,to:a})=>Je.range(r,Math.min(a+1,e.doc.length)));return t(e.update({selection:Je.create(n),userEvent:"select"})),!0},vln=({state:e,dispatch:t})=>{let n=k_(e.selection,r=>{let a=us(e),s=a.resolveStack(r.from,1);if(r.empty){let i=a.resolveStack(r.from,-1);i.node.from>=s.node.from&&i.node.to<=s.node.to&&(s=i)}for(let i=s;i;i=i.next){let{node:o}=i;if((o.from<r.from&&o.to>=r.to||o.to>r.to&&o.from<=r.from)&&i.next)return Je.range(o.to,o.from)}return r});return n.eq(e.selection)?!1:(t(Yp(e,n)),!0)};function wat(e,t){let{state:n}=e,r=n.selection,a=n.selection.ranges.slice();for(let s of n.selection.ranges){let i=n.doc.lineAt(s.head);if(t?i.to<e.state.doc.length:i.from>0)for(let o=s;;){let c=e.moveVertically(o,t);if(c.head<i.from||c.head>i.to){a.some(u=>u.head==c.head)||a.push(c);break}else{if(c.head==o.head)break;o=c}}}return a.length==r.ranges.length?!1:(e.dispatch(Yp(n,Je.create(a,a.length-1))),!0)}const yln=e=>wat(e,!1),bln=e=>wat(e,!0),xln=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Je.create([n.main]):n.main.empty||(r=Je.create([Je.cursor(n.main.head)])),r?(t(Yp(e,r)),!0):!1};function EI(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,a=r.changeByRange(s=>{let{from:i,to:o}=s;if(i==o){let c=t(s);c<i?(n="delete.backward",c=IM(e,c,!1)):c>i&&(n="delete.forward",c=IM(e,c,!0)),i=Math.min(i,c),o=Math.max(o,c)}else i=IM(e,i,!1),o=IM(e,o,!0);return i==o?{range:s}:{changes:{from:i,to:o},range:Je.cursor(i,i<s.head?-1:1)}});return a.changes.empty?!1:(e.dispatch(r.update(a,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?vt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function IM(e,t,n){if(e instanceof vt)for(let r of e.state.facet(vt.atomicRanges).map(a=>a(e)))r.between(t,t,(a,s)=>{a<t&&s>t&&(t=n?s:a)});return t}const Sat=(e,t,n)=>EI(e,r=>{let a=r.from,{state:s}=e,i=s.doc.lineAt(a),o,c;if(n&&!t&&a>i.from&&a<i.from+200&&!/[^ \t]/.test(o=i.text.slice(0,a-i.from))){if(o[o.length-1]==" ")return a-1;let u=Fp(o,s.tabSize),d=u%iw(s)||iw(s);for(let f=0;f<d&&o[o.length-1-f]==" ";f++)a--;c=a}else c=Xo(i.text,a-i.from,t,t)+i.from,c==a&&i.number!=(t?s.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(i.text.slice(c-i.from,a-i.from))&&(c=Xo(i.text,c-i.from,!1,!1)+i.from);return c}),Vne=e=>Sat(e,!1,!0),Oat=e=>Sat(e,!0,!1),kat=(e,t)=>EI(e,n=>{let r=n.head,{state:a}=e,s=a.doc.lineAt(r),i=a.charCategorizer(r);for(let o=null;;){if(r==(t?s.to:s.from)){r==n.head&&s.number!=(t?a.doc.lines:1)&&(r+=t?1:-1);break}let c=Xo(s.text,r-s.from,t)+s.from,u=s.text.slice(Math.min(r,c)-s.from,Math.max(r,c)-s.from),d=i(u);if(o!=null&&d!=o)break;(u!=" "||r!=n.head)&&(o=d),r=c}return r}),_at=e=>kat(e,!1),wln=e=>kat(e,!0),Sln=e=>EI(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Oln=e=>EI(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),kln=e=>EI(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),_ln=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Ea.of(["",""])},range:Je.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Eln=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let a=r.from,s=e.doc.lineAt(a),i=a==s.from?a-1:Xo(s.text,a-s.from,!1)+s.from,o=a==s.to?a+1:Xo(s.text,a-s.from,!0)+s.from;return{changes:{from:i,to:o,insert:e.doc.slice(a,o).append(e.doc.slice(i,a))},range:Je.cursor(o)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Y6(e){let t=[],n=-1;for(let r of e.selection.ranges){let a=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=e.doc.lineAt(r.to-1)),n>=a.number){let i=t[t.length-1];i.to=s.to,i.ranges.push(r)}else t.push({from:a.from,to:s.to,ranges:[r]});n=s.number+1}return t}function Eat(e,t,n){if(e.readOnly)return!1;let r=[],a=[];for(let s of Y6(e)){if(n?s.to==e.doc.length:s.from==0)continue;let i=e.doc.lineAt(n?s.to+1:s.from-1),o=i.length+1;if(n){r.push({from:s.to,to:i.to},{from:s.from,insert:i.text+e.lineBreak});for(let c of s.ranges)a.push(Je.range(Math.min(e.doc.length,c.anchor+o),Math.min(e.doc.length,c.head+o)))}else{r.push({from:i.from,to:s.from},{from:s.to,insert:e.lineBreak+i.text});for(let c of s.ranges)a.push(Je.range(c.anchor-o,c.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Je.create(a,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Cln=({state:e,dispatch:t})=>Eat(e,t,!1),jln=({state:e,dispatch:t})=>Eat(e,t,!0);function Cat(e,t,n){if(e.readOnly)return!1;let r=[];for(let s of Y6(e))n?r.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):r.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)});let a=e.changes(r);return t(e.update({changes:a,selection:e.selection.map(a,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Tln=({state:e,dispatch:t})=>Cat(e,t,!1),Nln=({state:e,dispatch:t})=>Cat(e,t,!0),Aln=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Y6(t).map(({from:a,to:s})=>(a>0?a--:s<t.doc.length&&s++,{from:a,to:s}))),r=k_(t.selection,a=>{let s;if(e.lineWrapping){let i=e.lineBlockAt(a.head),o=e.coordsAtPos(a.head,a.assoc||1);o&&(s=i.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(a,!0,s)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Iln(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=us(e).resolveInner(t),r=n.childBefore(t),a=n.childAfter(t),s;return r&&a&&r.to<=t&&a.from>=t&&(s=r.type.prop(cr.closedBy))&&s.indexOf(a.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(r.to,a.from))?{from:r.to,to:a.from}:null}const g_e=jat(!1),Rln=jat(!0);function jat(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(a=>{let{from:s,to:i}=a,o=t.doc.lineAt(s),c=!e&&s==i&&Iln(t,s);e&&(s=i=(i<=o.to?o:t.doc.lineAt(i)).to);let u=new U6(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=$ue(u,s);for(d==null&&(d=Fp(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;c?{from:s,to:i}=c:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let f=["",oN(t,d)];return c&&f.push(oN(t,u.lineIndent(o.from,-1))),{changes:{from:s,to:i,insert:Ea.of(f)},range:Je.cursor(s+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function yde(e,t){let n=-1;return e.changeByRange(r=>{let a=[];for(let i=r.from;i<=r.to;){let o=e.doc.lineAt(i);o.number>n&&(r.empty||r.to>o.from)&&(t(o,a,r),n=o.number),i=o.to+1}let s=e.changes(a);return{changes:a,range:Je.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const Pln=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new U6(e,{overrideIndentation:s=>{let i=n[s];return i??-1}}),a=yde(e,(s,i,o)=>{let c=$ue(r,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=oN(e,c);(u!=d||o.from<s.from+u.length)&&(n[s.from]=c,i.push({from:s.from,to:s.from+u.length,insert:d}))});return a.changes.empty||t(e.update(a,{userEvent:"indent"})),!0},Tat=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(yde(e,(n,r)=>{r.push({from:n.from,insert:e.facet(w_)})}),{userEvent:"input.indent"})),!0),Nat=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(yde(e,(n,r)=>{let a=/^\s*/.exec(n.text)[0];if(!a)return;let s=Fp(a,e.tabSize),i=0,o=oN(e,Math.max(0,s-iw(e)));for(;i<a.length&&i<o.length&&a.charCodeAt(i)==o.charCodeAt(i);)i++;r.push({from:n.from+i,to:n.from+a.length,insert:o.slice(i)})}),{userEvent:"delete.dedent"})),!0),Mln=e=>(e.setTabFocusMode(),!0),Dln=[{key:"Ctrl-b",run:sat,shift:hat,preventDefault:!0},{key:"Ctrl-f",run:iat,shift:mat},{key:"Ctrl-p",run:cat,shift:yat},{key:"Ctrl-n",run:uat,shift:bat},{key:"Ctrl-a",run:tln,shift:pln},{key:"Ctrl-e",run:nln,shift:hln},{key:"Ctrl-d",run:Oat},{key:"Ctrl-h",run:Vne},{key:"Ctrl-k",run:Sln},{key:"Ctrl-Alt-h",run:_at},{key:"Ctrl-o",run:_ln},{key:"Ctrl-t",run:Eln},{key:"Ctrl-v",run:Une}],$ln=[{key:"ArrowLeft",run:sat,shift:hat,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Qon,shift:sln,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Jon,shift:dln,preventDefault:!0},{key:"ArrowRight",run:iat,shift:mat,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Gon,shift:iln,preventDefault:!0},{mac:"Cmd-ArrowRight",run:eln,shift:fln,preventDefault:!0},{key:"ArrowUp",run:cat,shift:yat,preventDefault:!0},{mac:"Cmd-ArrowUp",run:f_e,shift:h_e},{mac:"Ctrl-ArrowUp",run:c_e,shift:u_e},{key:"ArrowDown",run:uat,shift:bat,preventDefault:!0},{mac:"Cmd-ArrowDown",run:p_e,shift:m_e},{mac:"Ctrl-ArrowDown",run:Une,shift:d_e},{key:"PageUp",run:c_e,shift:u_e},{key:"PageDown",run:Une,shift:d_e},{key:"Home",run:Kon,shift:uln,preventDefault:!0},{key:"Mod-Home",run:f_e,shift:h_e},{key:"End",run:Xon,shift:cln,preventDefault:!0},{key:"Mod-End",run:p_e,shift:m_e},{key:"Enter",run:g_e,shift:g_e},{key:"Mod-a",run:mln},{key:"Backspace",run:Vne,shift:Vne,preventDefault:!0},{key:"Delete",run:Oat,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:_at,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:wln,preventDefault:!0},{mac:"Mod-Backspace",run:Oln,preventDefault:!0},{mac:"Mod-Delete",run:kln,preventDefault:!0}].concat(Dln.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Lln=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Zon,shift:oln},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Yon,shift:lln},{key:"Alt-ArrowUp",run:Cln},{key:"Shift-Alt-ArrowUp",run:Tln},{key:"Alt-ArrowDown",run:jln},{key:"Shift-Alt-ArrowDown",run:Nln},{key:"Mod-Alt-ArrowUp",run:yln},{key:"Mod-Alt-ArrowDown",run:bln},{key:"Escape",run:xln},{key:"Mod-Enter",run:Rln},{key:"Alt-l",mac:"Ctrl-l",run:gln},{key:"Mod-i",run:vln,preventDefault:!0},{key:"Mod-[",run:Nat},{key:"Mod-]",run:Tat},{key:"Mod-Alt-\\",run:Pln},{key:"Shift-Mod-k",run:Aln},{key:"Shift-Mod-\\",run:aln},{key:"Mod-/",run:Con},{key:"Alt-A",run:Ton},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Mln}].concat($ln),Fln={key:"Tab",run:Tat,shift:Nat},v_e=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class mk{constructor(t,n,r=0,a=t.length,s,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,a),this.bufferStart=r,this.normalize=s?o=>s(v_e(o)):v_e,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return iu(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=bue(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=$h(t);let a=this.normalize(n);if(a.length)for(let s=0,i=r;;s++){let o=a.charCodeAt(s),c=this.match(o,i,this.bufferPos+this.bufferStart);if(s==a.length-1){if(c)return this.value=c,this;break}i==r&&s<n.length&&n.charCodeAt(s)==o&&i++}}}match(t,n,r){let a=null;for(let s=0;s<this.matches.length;s+=2){let i=this.matches[s],o=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?a={from:this.matches[s+1],to:r}:(this.matches[s]++,o=!0)),o||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?a={from:n,to:r}:this.matches.push(1,n)),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}}typeof Symbol<"u"&&(mk.prototype[Symbol.iterator]=function(){return this});const Aat={from:-1,to:-1,match:/.*/.exec("")},bde="gm"+(/x/.unicode==null?"":"u");class Iat{constructor(t,n,r,a=0,s=t.length){if(this.text=t,this.to=s,this.curLine="",this.done=!1,this.value=Aat,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Rat(t,n,r,a,s);this.re=new RegExp(n,bde+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let i=t.lineAt(a);this.curLineStart=i.from,this.matchPos=S4(t,a),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,a=r+n[0].length;if(this.matchPos=S4(this.text,a+(r==a?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<a||r>this.value.to)&&(!this.test||this.test(r,a,n)))return this.value={from:r,to:a,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const vU=new WeakMap;class bO{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let a=vU.get(t);if(!a||a.from>=r||a.to<=n){let o=new bO(n,t.sliceString(n,r));return vU.set(t,o),o}if(a.from==n&&a.to==r)return a;let{text:s,from:i}=a;return i>n&&(s=t.sliceString(n,i)+s,i=n),a.to<r&&(s+=t.sliceString(a.to,r)),vU.set(t,new bO(i,s)),new bO(n,s.slice(n-i,r-i))}}class Rat{constructor(t,n,r,a,s){this.text=t,this.to=s,this.done=!1,this.value=Aat,this.matchPos=S4(t,a),this.re=new RegExp(n,bde+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=bO.get(t,a,this.chunkEnd(a+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,a=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,a,n)))return this.value={from:r,to:a,match:n},this.matchPos=S4(this.text,a+(r==a?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=bO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Iat.prototype[Symbol.iterator]=Rat.prototype[Symbol.iterator]=function(){return this});function zln(e){try{return new RegExp(e,bde),!0}catch{return!1}}function S4(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function qne(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=gs("input",{class:"cm-textfield",name:"line",value:t}),r=gs("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),e.dispatch({effects:Vj.of(!1)}),e.focus()):s.keyCode==13&&(s.preventDefault(),a())},onsubmit:s=>{s.preventDefault(),a()}},gs("label",e.state.phrase("Go to line"),": ",n)," ",gs("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),gs("button",{name:"close",onclick:()=>{e.dispatch({effects:Vj.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function a(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!s)return;let{state:i}=e,o=i.doc.lineAt(i.selection.main.head),[,c,u,d,f]=s,p=d?+d.slice(1):0,h=u?+u:o.number;if(u&&f){let v=h/100;c&&(v=v*(c=="-"?-1:1)+o.number/i.doc.lines),h=Math.round(i.doc.lines*v)}else u&&c&&(h=h*(c=="-"?-1:1)+o.number);let m=i.doc.line(Math.max(1,Math.min(i.doc.lines,h))),g=Je.cursor(m.from+Math.max(0,Math.min(p,m.length)));e.dispatch({effects:[Vj.of(!1),vt.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}return{dom:r}}const Vj=Xn.define(),y_e=Yi.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(Vj)&&(e=n.value);return e},provide:e=>iN.from(e,t=>t?qne:null)}),Bln=e=>{let t=sN(e,qne);if(!t){let n=[Vj.of(!0)];e.state.field(y_e,!1)==null&&n.push(Xn.appendConfig.of([y_e,Uln])),e.dispatch({effects:n}),t=sN(e,qne)}return t&&t.dom.querySelector("input").select(),!0},Uln=vt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),Vln={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},qln=Zt.define({combine(e){return Im(e,Vln,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Hln(e){return[Yln,Zln]}const Qln=tn.mark({class:"cm-selectionMatch"}),Gln=tn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function b_e(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=ni.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=ni.Word)}function Wln(e,t,n,r){return e(t.sliceDoc(n,n+1))==ni.Word&&e(t.sliceDoc(r-1,r))==ni.Word}const Zln=mi.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(qln),{state:n}=e,r=n.selection;if(r.ranges.length>1)return tn.none;let a=r.main,s,i=null;if(a.empty){if(!t.highlightWordAroundCursor)return tn.none;let c=n.wordAt(a.head);if(!c)return tn.none;i=n.charCategorizer(a.head),s=n.sliceDoc(c.from,c.to)}else{let c=a.to-a.from;if(c<t.minSelectionLength||c>200)return tn.none;if(t.wholeWords){if(s=n.sliceDoc(a.from,a.to),i=n.charCategorizer(a.head),!(b_e(i,n,a.from,a.to)&&Wln(i,n,a.from,a.to)))return tn.none}else if(s=n.sliceDoc(a.from,a.to),!s)return tn.none}let o=[];for(let c of e.visibleRanges){let u=new mk(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!i||b_e(i,n,d,f))&&(a.empty&&d<=a.from&&f>=a.to?o.push(Gln.range(d,f)):(d>=a.to||f<=a.from)&&o.push(Qln.range(d,f)),o.length>t.maxMatches))return tn.none}}return tn.set(o)}},{decorations:e=>e.decorations}),Yln=vt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Xln=({state:e,dispatch:t})=>{let{selection:n}=e,r=Je.create(n.ranges.map(a=>e.wordAt(a.head)||Je.cursor(a.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Kln(e,t){let{main:n,ranges:r}=e.selection,a=e.wordAt(n.head),s=a&&a.from==n.from&&a.to==n.to;for(let i=!1,o=new mk(e.doc,t,r[r.length-1].to);;)if(o.next(),o.done){if(i)return null;o=new mk(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),i=!0}else{if(i&&r.some(c=>c.from==o.value.from))continue;if(s){let c=e.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const Jln=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return Xln({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=r))return!1;let a=Kln(e,r);return a?(t(e.update({selection:e.selection.addRange(Je.range(a.from,a.to),!1),effects:vt.scrollIntoView(a.to)})),!0):!1},__=Zt.define({combine(e){return Im(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new dcn(t),scrollToMatch:t=>vt.scrollIntoView(t)})}});class Pat{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||zln(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
209
209
  `:r=="r"?"\r":r=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new rcn(this):new tcn(this)}getCursor(t,n=0,r){let a=t.doc?t:Tr.create({doc:t});return r==null&&(r=a.doc.length),this.regexp?E1(this,a,n,r):_1(this,a,n,r)}}class Mat{constructor(t){this.spec=t}}function _1(e,t,n,r){return new mk(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),e.wholeWord?ecn(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function ecn(e,t){return(n,r,a,s)=>((s>n||s+a.length<r)&&(s=Math.max(0,n-2),a=e.sliceString(s,Math.min(e.length,r+2))),(t(O4(a,n-s))!=ni.Word||t(k4(a,n-s))!=ni.Word)&&(t(k4(a,r-s))!=ni.Word||t(O4(a,r-s))!=ni.Word))}class tcn extends Mat{constructor(t){super(t)}nextMatch(t,n,r){let a=_1(this.spec,t,r,t.doc.length).nextOverlapping();if(a.done){let s=Math.min(t.doc.length,n+this.spec.unquoted.length);a=_1(this.spec,t,0,s).nextOverlapping()}return a.done||a.value.from==n&&a.value.to==r?null:a.value}prevMatchInRange(t,n,r){for(let a=r;;){let s=Math.max(n,a-1e4-this.spec.unquoted.length),i=_1(this.spec,t,s,a),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(s==n)return null;a-=1e4}}prevMatch(t,n,r){let a=this.prevMatchInRange(t,0,n);return a||(a=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),a&&(a.from!=n||a.to!=r)?a:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=_1(this.spec,t,0,t.doc.length),a=[];for(;!r.next().done;){if(a.length>=n)return null;a.push(r.value)}return a}highlight(t,n,r,a){let s=_1(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)a(s.value.from,s.value.to)}}function E1(e,t,n,r){return new Iat(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?ncn(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function O4(e,t){return e.slice(Xo(e,t,!1),t)}function k4(e,t){return e.slice(t,Xo(e,t))}function ncn(e){return(t,n,r)=>!r[0].length||(e(O4(r.input,r.index))!=ni.Word||e(k4(r.input,r.index))!=ni.Word)&&(e(k4(r.input,r.index+r[0].length))!=ni.Word||e(O4(r.input,r.index+r[0].length))!=ni.Word)}class rcn extends Mat{nextMatch(t,n,r){let a=E1(this.spec,t,r,t.doc.length).next();return a.done&&(a=E1(this.spec,t,0,n).next()),a.done?null:a.value}prevMatchInRange(t,n,r){for(let a=1;;a++){let s=Math.max(n,r-a*1e4),i=E1(this.spec,t,s,r),o=null;for(;!i.next().done;)o=i.value;if(o&&(s==n||o.from>s+10))return o;if(s==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let a=r.length;a>0;a--){let s=+r.slice(0,a);if(s>0&&s<t.match.length)return t.match[s]+r.slice(a)}return n})}matchAll(t,n){let r=E1(this.spec,t,0,t.doc.length),a=[];for(;!r.next().done;){if(a.length>=n)return null;a.push(r.value)}return a}highlight(t,n,r,a){let s=E1(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!s.next().done;)a(s.value.from,s.value.to)}}const vN=Xn.define(),xde=Xn.define(),Yy=Yi.define({create(e){return new yU(Hne(e).create(),null)},update(e,t){for(let n of t.effects)n.is(vN)?e=new yU(n.value.create(),e.panel):n.is(xde)&&(e=new yU(e.query,n.value?wde:null));return e},provide:e=>iN.from(e,t=>t.panel)});class yU{constructor(t,n){this.query=t,this.panel=n}}const acn=tn.mark({class:"cm-searchMatch"}),scn=tn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),icn=mi.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Yy))}update(e){let t=e.state.field(Yy);(t!=e.startState.field(Yy)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return tn.none;let{view:n}=this,r=new Au;for(let a=0,s=n.visibleRanges,i=s.length;a<i;a++){let{from:o,to:c}=s[a];for(;a<i-1&&c>s[a+1].from-500;)c=s[++a].to;e.highlight(n.state,o,c,(u,d)=>{let f=n.state.selection.ranges.some(p=>p.from==u&&p.to==d);r.add(u,d,f?scn:acn)})}return r.finish()}},{decorations:e=>e.decorations});function CI(e){return t=>{let n=t.state.field(Yy,!1);return n&&n.query.spec.valid?e(t,n):Lat(t)}}const _4=CI((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let a=Je.single(r.from,r.to),s=e.state.facet(__);return e.dispatch({selection:a,effects:[Sde(e,r),s.scrollToMatch(a.main,e)],userEvent:"select.search"}),$at(e),!0}),E4=CI((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,a=t.prevMatch(n,r,r);if(!a)return!1;let s=Je.single(a.from,a.to),i=e.state.facet(__);return e.dispatch({selection:s,effects:[Sde(e,a),i.scrollToMatch(s.main,e)],userEvent:"select.search"}),$at(e),!0}),ocn=CI((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Je.create(n.map(r=>Je.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),lcn=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:a}=n.main,s=[],i=0;for(let o=new mk(e.doc,e.sliceDoc(r,a));!o.next().done;){if(s.length>1e3)return!1;o.value.from==r&&(i=s.length),s.push(Je.range(o.value.from,o.value.to))}return t(e.update({selection:Je.create(s,i),userEvent:"select.search.matches"})),!0},x_e=CI((e,{query:t})=>{let{state:n}=e,{from:r,to:a}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,r,r);if(!s)return!1;let i=s,o=[],c,u,d=[];i.from==r&&i.to==a&&(u=n.toText(t.getReplacement(i)),o.push({from:i.from,to:i.to,insert:u}),i=t.nextMatch(n,i.from,i.to),d.push(vt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=e.state.changes(o);return i&&(c=Je.single(i.from,i.to).map(f),d.push(Sde(e,i)),d.push(n.facet(__).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),ccn=CI((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(a=>{let{from:s,to:i}=a;return{from:s,to:i,insert:t.getReplacement(a)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:vt.announce.of(r),userEvent:"input.replace.all"}),!0});function wde(e){return e.state.facet(__).createPanel(e)}function Hne(e,t){var n,r,a,s,i;let o=e.selection.main,c=o.empty||o.to>o.from+100?"":e.sliceDoc(o.from,o.to);if(t&&!c)return t;let u=e.facet(__);return new Pat({search:((n=t?.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(a=t?.literal)!==null&&a!==void 0?a:u.literal,regexp:(s=t?.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(i=t?.wholeWord)!==null&&i!==void 0?i:u.wholeWord})}function Dat(e){let t=sN(e,wde);return t&&t.dom.querySelector("[main-field]")}function $at(e){let t=Dat(e);t&&t==e.root.activeElement&&t.select()}const Lat=e=>{let t=e.state.field(Yy,!1);if(t&&t.panel){let n=Dat(e);if(n&&n!=e.root.activeElement){let r=Hne(e.state,t.query.spec);r.valid&&e.dispatch({effects:vN.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[xde.of(!0),t?vN.of(Hne(e.state,t.query.spec)):Xn.appendConfig.of(pcn)]});return!0},Fat=e=>{let t=e.state.field(Yy,!1);if(!t||!t.panel)return!1;let n=sN(e,wde);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:xde.of(!1)}),!0},ucn=[{key:"Mod-f",run:Lat,scope:"editor search-panel"},{key:"F3",run:_4,shift:E4,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:_4,shift:E4,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Fat,scope:"editor search-panel"},{key:"Mod-Shift-l",run:lcn},{key:"Mod-Alt-g",run:Bln},{key:"Mod-d",run:Jln,preventDefault:!0}];class dcn{constructor(t){this.view=t;let n=this.query=t.state.field(Yy).query.spec;this.commit=this.commit.bind(this),this.searchField=gs("input",{value:n.search,placeholder:Xu(t,"Find"),"aria-label":Xu(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=gs("input",{value:n.replace,placeholder:Xu(t,"Replace"),"aria-label":Xu(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=gs("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=gs("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=gs("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(a,s,i){return gs("button",{class:"cm-button",name:a,onclick:s,type:"button"},i)}this.dom=gs("div",{onkeydown:a=>this.keydown(a),class:"cm-search"},[this.searchField,r("next",()=>_4(t),[Xu(t,"next")]),r("prev",()=>E4(t),[Xu(t,"previous")]),r("select",()=>ocn(t),[Xu(t,"all")]),gs("label",null,[this.caseField,Xu(t,"match case")]),gs("label",null,[this.reField,Xu(t,"regexp")]),gs("label",null,[this.wordField,Xu(t,"by word")]),...t.state.readOnly?[]:[gs("br"),this.replaceField,r("replace",()=>x_e(t),[Xu(t,"replace")]),r("replaceAll",()=>ccn(t),[Xu(t,"replace all")])],gs("button",{name:"close",onclick:()=>Fat(t),"aria-label":Xu(t,"close"),type:"button"},["×"])])}commit(){let t=new Pat({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:vN.of(t)}))}keydown(t){ztn(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?E4:_4)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),x_e(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(vN)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(__).top}}function Xu(e,t){return e.state.phrase(t)}const RM=30,PM=/[\s\.,:;?!]/;function Sde(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),a=e.state.doc.lineAt(n).to,s=Math.max(r.from,t-RM),i=Math.min(a,n+RM),o=e.state.sliceDoc(s,i);if(s!=r.from){for(let c=0;c<RM;c++)if(!PM.test(o[c+1])&&PM.test(o[c])){o=o.slice(c);break}}if(i!=a){for(let c=o.length-1;c>o.length-RM;c--)if(!PM.test(o[c-1])&&PM.test(o[c])){o=o.slice(0,c);break}}return vt.announce.of(`${e.state.phrase("current match")}. ${o} ${e.state.phrase("on line")} ${r.number}.`)}const fcn=vt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),pcn=[Yy,Zp.low(icn),fcn];class w_e{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class s0{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let a=r.facet(yN).markerFilter;a&&(t=a(t,r));let s=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),i=new Au,o=[],c=0;for(let d=0;;){let f=d==s.length?null:s[d];if(!f&&!o.length)break;let p,h;for(o.length?(p=c,h=o.reduce((g,v)=>Math.min(g,v.to),f&&f.from>p?f.from:1e8)):(p=f.from,h=f.to,o.push(f),d++);d<s.length;){let g=s[d];if(g.from==p&&(g.to>g.from||g.to==p))o.push(g),d++,h=Math.min(g.to,h);else{h=Math.min(g.from,h);break}}let m=Ecn(o);if(o.some(g=>g.from==g.to||g.from==g.to-1&&r.doc.lineAt(g.from).to==g.from))i.add(p,p,tn.widget({widget:new Scn(m),diagnostics:o.slice()}));else{let g=o.reduce((v,b)=>b.markClass?v+" "+b.markClass:v,"");i.add(p,h,tn.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:o.slice(),inclusiveEnd:o.some(v=>v.to>h)}))}c=h;for(let g=0;g<o.length;g++)o[g].to<=c&&o.splice(g--,1)}let u=i.finish();return new s0(u,n,gk(u))}}function gk(e,t=null,n=0){let r=null;return e.between(n,1e9,(a,s,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new w_e(a,s,t||i.diagnostics[0]);else{if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new w_e(r.from,s,r.diagnostic)}}),r}function hcn(e,t){let n=t.pos,r=t.end||n,a=e.state.facet(yN).hideOn(e,n,r);if(a!=null)return a;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(i=>i.is(zat))||e.changes.touchesRange(s.from,Math.max(s.to,r)))}function mcn(e,t){return e.field(gd,!1)?t:t.concat(Xn.appendConfig.of(Ccn))}const zat=Xn.define(),Ode=Xn.define(),Bat=Xn.define(),gd=Yi.define({create(){return new s0(tn.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,a=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);r=gk(n,e.selected.diagnostic,s)||gk(n,null,s)}!n.size&&a&&t.state.facet(yN).autoPanel&&(a=null),e=new s0(n,a,r)}for(let n of t.effects)if(n.is(zat)){let r=t.state.facet(yN).autoPanel?n.value.length?bN.open:null:e.panel;e=s0.init(n.value,r,t.state)}else n.is(Ode)?e=new s0(e.diagnostics,n.value?bN.open:null,e.selected):n.is(Bat)&&(e=new s0(e.diagnostics,e.panel,n.value));return e},provide:e=>[iN.from(e,t=>t.panel),vt.decorations.from(e,t=>t.diagnostics)]}),gcn=tn.mark({class:"cm-lintRange cm-lintRange-active"});function vcn(e,t,n){let{diagnostics:r}=e.state.field(gd),a,s=-1,i=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(t<u||n<0)))return a=d.diagnostics,s=c,i=u,!1});let o=e.state.facet(yN).tooltipFilter;return a&&o&&(a=o(a,e.state)),a?{pos:s,end:i,above:e.state.doc.lineAt(s).to<i,create(){return{dom:ycn(e,a)}}}:null}function ycn(e,t){return gs("ul",{class:"cm-tooltip-lint"},t.map(n=>Vat(e,n,!1)))}const bcn=e=>{let t=e.state.field(gd,!1);(!t||!t.panel)&&e.dispatch({effects:mcn(e.state,[Ode.of(!0)])});let n=sN(e,bN.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},S_e=e=>{let t=e.state.field(gd,!1);return!t||!t.panel?!1:(e.dispatch({effects:Ode.of(!1)}),!0)},xcn=e=>{let t=e.state.field(gd,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},wcn=[{key:"Mod-Shift-m",run:bcn,preventDefault:!0},{key:"F8",run:xcn}],yN=Zt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Im(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:O_e,tooltipFilter:O_e,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,a,s)=>t(r,a,s)||n(r,a,s):t:n,autoPanel:(t,n)=>t||n})}}});function O_e(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function Uat(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let a=n[r];if(/[a-zA-Z]/.test(a)&&!t.some(s=>s.toLowerCase()==a.toLowerCase())){t.push(a);continue e}}t.push("")}return t}function Vat(e,t,n){var r;let a=n?Uat(t.actions):[];return gs("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},gs("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((s,i)=>{let o=!1,c=h=>{if(h.preventDefault(),o)return;o=!0;let m=gk(e.state.field(gd).diagnostics,t);m&&s.apply(e,m.from,m.to)},{name:u}=s,d=a[i]?u.indexOf(a[i]):-1,f=d<0?u:[u.slice(0,d),gs("u",u.slice(d,d+1)),u.slice(d+1)],p=s.markClass?" "+s.markClass:"";return gs("button",{type:"button",class:"cm-diagnosticAction"+p,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${a[i]})"`}.`},f)}),t.source&&gs("div",{class:"cm-diagnosticSource"},t.source))}class Scn extends Ud{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return gs("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class k_e{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Vat(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class bN{constructor(t){this.view=t,this.items=[];let n=a=>{if(a.keyCode==27)S_e(this.view),this.view.focus();else if(a.keyCode==38||a.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(a.keyCode==40||a.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(a.keyCode==36)this.moveSelection(0);else if(a.keyCode==35)this.moveSelection(this.items.length-1);else if(a.keyCode==13)this.view.focus();else if(a.keyCode>=65&&a.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],i=Uat(s.actions);for(let o=0;o<i.length;o++)if(i[o].toUpperCase().charCodeAt(0)==a.keyCode){let c=gk(this.view.state.field(gd).diagnostics,s);c&&s.actions[o].apply(t,c.from,c.to)}}else return;a.preventDefault()},r=a=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(a.target)&&this.moveSelection(s)};this.list=gs("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=gs("div",{class:"cm-panel-lint"},this.list,gs("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>S_e(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(gd).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(gd),r=0,a=!1,s=null,i=new Set;for(t.between(0,this.view.state.doc.length,(o,c,{spec:u})=>{for(let d of u.diagnostics){if(i.has(d))continue;i.add(d);let f=-1,p;for(let h=r;h<this.items.length;h++)if(this.items[h].diagnostic==d){f=h;break}f<0?(p=new k_e(this.view,d),this.items.splice(r,0,p),a=!0):(p=this.items[f],f>r&&(this.items.splice(r,f-r),a=!0)),n&&p.diagnostic==n.diagnostic?p.dom.hasAttribute("aria-selected")||(p.dom.setAttribute("aria-selected","true"),s=p):p.dom.hasAttribute("aria-selected")&&p.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)a=!0,this.items.pop();this.items.length==0&&(this.items.push(new k_e(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),a=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:c})=>{let u=c.height/this.list.offsetHeight;o.top<c.top?this.list.scrollTop-=(c.top-o.top)/u:o.bottom>c.bottom&&(this.list.scrollTop+=(o.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),a&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(gd),r=gk(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Bat.of(r)})}static open(t){return new bN(t)}}function Ocn(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function MM(e){return Ocn(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const kcn=vt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:MM("#d11")},".cm-lintRange-warning":{backgroundImage:MM("orange")},".cm-lintRange-info":{backgroundImage:MM("#999")},".cm-lintRange-hint":{backgroundImage:MM("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function _cn(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function Ecn(e){let t="hint",n=1;for(let r of e){let a=_cn(r.severity);a>n&&(n=a,t=r.severity)}return t}const Ccn=[gd,vt.decorations.compute([gd],e=>{let{selected:t,panel:n}=e.field(gd);return!t||!n||t.from==t.to?tn.none:tn.set([gcn.range(t.from,t.to)])}),Cnn(vcn,{hideOn:hcn}),kcn];var __e=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(San)),t.defaultKeymap!==!1&&(r=r.concat(Lln)),t.searchKeymap!==!1&&(r=r.concat(ucn)),t.historyKeymap!==!1&&(r=r.concat(Hon)),t.foldKeymap!==!1&&(r=r.concat(orn)),t.completionKeymap!==!1&&(r=r.concat(Nnt)),t.lintKeymap!==!1&&(r=r.concat(wcn));var a=[];return t.lineNumbers!==!1&&a.push($nn()),t.highlightActiveLineGutter!==!1&&a.push(znn()),t.highlightSpecialChars!==!1&&a.push(nnn()),t.history!==!1&&a.push(Don()),t.foldGutter!==!1&&a.push(drn()),t.drawSelection!==!1&&a.push(Qtn()),t.dropCursor!==!1&&a.push(Xtn()),t.allowMultipleSelections!==!1&&a.push(Tr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&a.push(Jnn()),t.syntaxHighlighting!==!1&&a.push(zue(mrn,{fallback:!0})),t.bracketMatching!==!1&&a.push(Srn()),t.closeBrackets!==!1&&a.push(yan()),t.autocompletion!==!1&&a.push(Tnt()),t.rectangularSelection!==!1&&a.push(gnn()),n!==!1&&a.push(bnn()),t.highlightActiveLine!==!1&&a.push(lnn()),t.highlightSelectionMatches!==!1&&a.push(Hln()),t.tabSize&&typeof t.tabSize=="number"&&a.push(w_.of(" ".repeat(t.tabSize))),a.concat([x_.of(r.flat())]).filter(Boolean)};const jcn="#e5c07b",E_e="#e06c75",Tcn="#56b6c2",Ncn="#ffffff",SD="#abb2bf",Qne="#7d8799",Acn="#61afef",Icn="#98c379",C_e="#d19a66",Rcn="#c678dd",Pcn="#21252b",j_e="#2c313a",T_e="#282c34",bU="#353a42",Mcn="#3E4451",N_e="#528bff",Dcn=vt.theme({"&":{color:SD,backgroundColor:T_e},".cm-content":{caretColor:N_e},".cm-cursor, .cm-dropCursor":{borderLeftColor:N_e},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Mcn},".cm-panels":{backgroundColor:Pcn,color:SD},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:T_e,color:Qne,border:"none"},".cm-activeLineGutter":{backgroundColor:j_e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:bU},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bU,borderBottomColor:bU},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:j_e,color:SD}}},{dark:!0}),$cn=S_.define([{tag:fe.keyword,color:Rcn},{tag:[fe.name,fe.deleted,fe.character,fe.propertyName,fe.macroName],color:E_e},{tag:[fe.function(fe.variableName),fe.labelName],color:Acn},{tag:[fe.color,fe.constant(fe.name),fe.standard(fe.name)],color:C_e},{tag:[fe.definition(fe.name),fe.separator],color:SD},{tag:[fe.typeName,fe.className,fe.number,fe.changed,fe.annotation,fe.modifier,fe.self,fe.namespace],color:jcn},{tag:[fe.operator,fe.operatorKeyword,fe.url,fe.escape,fe.regexp,fe.link,fe.special(fe.string)],color:Tcn},{tag:[fe.meta,fe.comment],color:Qne},{tag:fe.strong,fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.link,color:Qne,textDecoration:"underline"},{tag:fe.heading,fontWeight:"bold",color:E_e},{tag:[fe.atom,fe.bool,fe.special(fe.variableName)],color:C_e},{tag:[fe.processingInstruction,fe.string,fe.inserted],color:Icn},{tag:fe.invalid,color:Ncn}]),Lcn=[Dcn,zue($cn)];var Fcn=vt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),zcn=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:a=!1,theme:s="light",placeholder:i="",basicSetup:o=!0}=t,c=[];switch(n&&c.unshift(x_.of([Fln])),o&&(typeof o=="boolean"?c.unshift(__e()):c.unshift(__e(o))),i&&c.unshift(fnn(i)),s){case"light":c.push(Fcn);break;case"dark":c.push(Lcn);break;case"none":break;default:c.push(s);break}return r===!1&&c.push(vt.editable.of(!1)),a&&c.push(Tr.readOnly.of(!0)),[...c]},Bcn=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class Ucn{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}let A_e=class{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}};var xU=null,Vcn=()=>typeof window>"u"?new A_e:(xU||(xU=new A_e),xU),I_e=Am.define(),qcn=200,Hcn=[];function Qcn(e){var{value:t,selection:n,onChange:r,onStatistics:a,onCreateEditor:s,onUpdate:i,extensions:o=Hcn,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:p=null,width:h=null,minWidth:m=null,maxWidth:g=null,placeholder:v="",editable:b=!0,readOnly:S=!1,indentWithTab:O=!0,basicSetup:k=!0,root:E,initialState:C}=e,[T,j]=x.useState(),[A,I]=x.useState(),[P,M]=x.useState(),B=x.useState(()=>({current:null}))[0],D=x.useState(()=>({current:null}))[0],V=vt.theme({"&":{height:d,minHeight:f,maxHeight:p,width:h,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),q=vt.updateListener.of(G=>{if(G.docChanged&&typeof r=="function"&&!G.transactions.some(F=>F.annotation(I_e))){B.current?B.current.reset():(B.current=new Ucn(()=>{if(D.current){var F=D.current;D.current=null,F()}B.current=null},qcn),Vcn().add(B.current));var L=G.state.doc,Z=L.toString();r(Z,G)}a&&a(Bcn(G))}),z=zcn({theme:u,editable:b,readOnly:S,placeholder:v,indentWithTab:O,basicSetup:k}),H=[q,V,...z];return i&&typeof i=="function"&&H.push(vt.updateListener.of(i)),H=H.concat(o),x.useLayoutEffect(()=>{if(T&&!P){var G={doc:t,selection:n,extensions:H},L=C?Tr.fromJSON(C.json,G,C.fields):Tr.create(G);if(M(L),!A){var Z=new vt({state:L,parent:T,root:E});I(Z),s&&s(Z,L)}}return()=>{A&&(M(void 0),I(void 0))}},[T,P]),x.useEffect(()=>{e.container&&j(e.container)},[e.container]),x.useEffect(()=>()=>{A&&(A.destroy(),I(void 0)),B.current&&(B.current.cancel(),B.current=null)},[A]),x.useEffect(()=>{c&&A&&A.focus()},[c,A]),x.useEffect(()=>{A&&A.dispatch({effects:Xn.reconfigure.of(H)})},[u,o,d,f,p,h,m,g,v,b,S,O,k,r,i]),x.useEffect(()=>{if(t!==void 0){var G=A?A.state.doc.toString():"";if(A&&t!==G){var L=B.current&&!B.current.isDone,Z=()=>{A&&t!==A.state.doc.toString()&&A.dispatch({changes:{from:0,to:A.state.doc.toString().length,insert:t||""},annotations:[I_e.of(!0)]})};L?D.current=Z:Z()}}},[t,A]),{state:P,setState:M,view:A,setView:I,container:T,setContainer:j}}var Gcn=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Id=x.forwardRef((e,t)=>{var{className:n,value:r="",selection:a,extensions:s=[],onChange:i,onStatistics:o,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:f="light",height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:b,basicSetup:S,placeholder:O,indentWithTab:k,editable:E,readOnly:C,root:T,initialState:j}=e,A=Qce(e,Gcn),I=x.useRef(null),{state:P,view:M,container:B,setContainer:D}=Qcn({root:T,value:r,autoFocus:d,theme:f,height:p,minHeight:h,maxHeight:m,width:g,minWidth:v,maxWidth:b,basicSetup:S,placeholder:O,indentWithTab:k,editable:E,readOnly:C,selection:a,onChange:i,onStatistics:o,onCreateEditor:c,onUpdate:u,extensions:s,initialState:j});x.useImperativeHandle(t,()=>({editor:I.current,state:P,view:M}),[I,B,P,M]);var V=x.useCallback(z=>{I.current=z,D(z)},[D]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var q=typeof f=="string"?"cm-theme-"+f:"cm-theme";return l.jsx("div",bb({ref:V,className:""+q+(n?" "+n:"")},A))});Id.displayName="CodeMirror";function Wcn(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Zcn=e=>{switch(e){case"success":return Kcn;case"info":return eun;case"warning":return Jcn;case"error":return tun;default:return null}},Ycn=Array(12).fill(0),Xcn=({visible:e,className:t})=>Oe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Oe.createElement("div",{className:"sonner-spinner"},Ycn.map((n,r)=>Oe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Kcn=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Jcn=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),eun=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tun=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nun=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Oe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Oe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),run=()=>{const[e,t]=Oe.useState(document.hidden);return Oe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Gne=1;class aun{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Gne++,i=this.toasts.find(c=>c.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:r}),{...c,...t,id:s,dismissible:o,title:r}):c):this.addToast({title:r,...a,dismissible:o,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const o=a.then(async u=>{if(i=["resolve",u],Oe.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(iun(u)&&!u.ok){s=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,m=typeof f=="object"&&!Oe.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...m})}else if(u instanceof Error){s=!1;const f=typeof n.error=="function"?await n.error(u):n.error,p=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!Oe.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...m})}else if(n.success!==void 0){s=!1;const f=typeof n.success=="function"?await n.success(u):n.success,p=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!Oe.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:p,...m})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,h=typeof d=="object"&&!Oe.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...h})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>o.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||Gne++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const nu=new aun,sun=(e,t)=>{const n=t?.id||Gne++;return nu.addToast({title:e,...t,id:n}),n},iun=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oun=sun,lun=()=>nu.toasts,cun=()=>nu.getActiveToasts(),Jl=Object.assign(oun,{success:nu.success,info:nu.info,warning:nu.warning,error:nu.error,custom:nu.custom,message:nu.message,promise:nu.promise,dismiss:nu.dismiss,loading:nu.loading},{getHistory:lun,getToasts:cun});Wcn("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function DM(e){return e.label!==void 0}const uun=3,dun="24px",fun="16px",R_e=4e3,pun=356,hun=14,mun=45,gun=200;function yh(...e){return e.filter(Boolean).join(" ")}function vun(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const yun=e=>{var t,n,r,a,s,i,o,c,u;const{invert:d,toast:f,unstyled:p,interacting:h,setHeights:m,visibleToasts:g,heights:v,index:b,toasts:S,expanded:O,removeToast:k,defaultRichColors:E,closeButton:C,style:T,cancelButtonStyle:j,actionButtonStyle:A,className:I="",descriptionClassName:P="",duration:M,position:B,gap:D,expandByDefault:V,classNames:q,icons:z,closeButtonAriaLabel:H="Close toast"}=e,[G,L]=Oe.useState(null),[Z,F]=Oe.useState(null),[R,Q]=Oe.useState(!1),[W,te]=Oe.useState(!1),[se,re]=Oe.useState(!1),[ae,oe]=Oe.useState(!1),[de,K]=Oe.useState(!1),[ne,ie]=Oe.useState(0),[ve,ge]=Oe.useState(0),ke=Oe.useRef(f.duration||M||R_e),je=Oe.useRef(null),me=Oe.useRef(null),_e=b===0,J=b+1<=g,X=f.type,ue=f.dismissible!==!1,ye=f.className||"",Ce=f.descriptionClassName||"",le=Oe.useMemo(()=>v.findIndex(kt=>kt.toastId===f.id)||0,[v,f.id]),we=Oe.useMemo(()=>{var kt;return(kt=f.closeButton)!=null?kt:C},[f.closeButton,C]),Ae=Oe.useMemo(()=>f.duration||M||R_e,[f.duration,M]),Me=Oe.useRef(0),Xe=Oe.useRef(0),Ot=Oe.useRef(0),Wt=Oe.useRef(null),[wn,It]=B.split("-"),rt=Oe.useMemo(()=>v.reduce((kt,Bt,Dn)=>Dn>=le?kt:kt+Bt.height,0),[v,le]),Ue=run(),tt=f.invert||d,Ke=X==="loading";Xe.current=Oe.useMemo(()=>le*D+rt,[le,rt]),Oe.useEffect(()=>{ke.current=Ae},[Ae]),Oe.useEffect(()=>{Q(!0)},[]),Oe.useEffect(()=>{const kt=me.current;if(kt){const Bt=kt.getBoundingClientRect().height;return ge(Bt),m(Dn=>[{toastId:f.id,height:Bt,position:f.position},...Dn]),()=>m(Dn=>Dn.filter(Sn=>Sn.toastId!==f.id))}},[m,f.id]),Oe.useLayoutEffect(()=>{if(!R)return;const kt=me.current,Bt=kt.style.height;kt.style.height="auto";const Dn=kt.getBoundingClientRect().height;kt.style.height=Bt,ge(Dn),m(Sn=>Sn.find(on=>on.toastId===f.id)?Sn.map(on=>on.toastId===f.id?{...on,height:Dn}:on):[{toastId:f.id,height:Dn,position:f.position},...Sn])},[R,f.title,f.description,m,f.id,f.jsx,f.action,f.cancel]);const it=Oe.useCallback(()=>{te(!0),ie(Xe.current),m(kt=>kt.filter(Bt=>Bt.toastId!==f.id)),setTimeout(()=>{k(f)},gun)},[f,k,m,Xe]);Oe.useEffect(()=>{if(f.promise&&X==="loading"||f.duration===1/0||f.type==="loading")return;let kt;return O||h||Ue?(()=>{if(Ot.current<Me.current){const Sn=new Date().getTime()-Me.current;ke.current=ke.current-Sn}Ot.current=new Date().getTime()})():ke.current!==1/0&&(Me.current=new Date().getTime(),kt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),it()},ke.current)),()=>clearTimeout(kt)},[O,h,f,X,Ue,it]),Oe.useEffect(()=>{f.delete&&(it(),f.onDismiss==null||f.onDismiss.call(f,f))},[it,f.delete]);function Mt(){var kt;if(z?.loading){var Bt;return Oe.createElement("div",{className:yh(q?.loader,f==null||(Bt=f.classNames)==null?void 0:Bt.loader,"sonner-loader"),"data-visible":X==="loading"},z.loading)}return Oe.createElement(Xcn,{className:yh(q?.loader,f==null||(kt=f.classNames)==null?void 0:kt.loader),visible:X==="loading"})}const mt=f.icon||z?.[X]||Zcn(X);var dt,En;return Oe.createElement("li",{tabIndex:0,ref:me,className:yh(I,ye,q?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,q?.default,q?.[X],f==null||(n=f.classNames)==null?void 0:n[X]),"data-sonner-toast":"","data-rich-colors":(dt=f.richColors)!=null?dt:E,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":R,"data-promise":!!f.promise,"data-swiped":de,"data-removed":W,"data-visible":J,"data-y-position":wn,"data-x-position":It,"data-index":b,"data-front":_e,"data-swiping":se,"data-dismissible":ue,"data-type":X,"data-invert":tt,"data-swipe-out":ae,"data-swipe-direction":Z,"data-expanded":!!(O||V&&R),"data-testid":f.testId,style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${W?ne:Xe.current}px`,"--initial-height":V?"auto":`${ve}px`,...T,...f.style},onDragEnd:()=>{re(!1),L(null),Wt.current=null},onPointerDown:kt=>{kt.button!==2&&(Ke||!ue||(je.current=new Date,ie(Xe.current),kt.target.setPointerCapture(kt.pointerId),kt.target.tagName!=="BUTTON"&&(re(!0),Wt.current={x:kt.clientX,y:kt.clientY})))},onPointerUp:()=>{var kt,Bt,Dn;if(ae||!ue)return;Wt.current=null;const Sn=Number(((kt=me.current)==null?void 0:kt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),cn=Number(((Bt=me.current)==null?void 0:Bt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),on=new Date().getTime()-((Dn=je.current)==null?void 0:Dn.getTime()),Dt=G==="x"?Sn:cn,Fs=Math.abs(Dt)/on;if(Math.abs(Dt)>=mun||Fs>.11){ie(Xe.current),f.onDismiss==null||f.onDismiss.call(f,f),F(G==="x"?Sn>0?"right":"left":cn>0?"down":"up"),it(),oe(!0);return}else{var Yr,be;(Yr=me.current)==null||Yr.style.setProperty("--swipe-amount-x","0px"),(be=me.current)==null||be.style.setProperty("--swipe-amount-y","0px")}K(!1),re(!1),L(null)},onPointerMove:kt=>{var Bt,Dn,Sn;if(!Wt.current||!ue||((Bt=window.getSelection())==null?void 0:Bt.toString().length)>0)return;const on=kt.clientY-Wt.current.y,Dt=kt.clientX-Wt.current.x;var Fs;const Yr=(Fs=e.swipeDirections)!=null?Fs:vun(B);!G&&(Math.abs(Dt)>1||Math.abs(on)>1)&&L(Math.abs(Dt)>Math.abs(on)?"x":"y");let be={x:0,y:0};const Te=Le=>1/(1.5+Math.abs(Le)/20);if(G==="y"){if(Yr.includes("top")||Yr.includes("bottom"))if(Yr.includes("top")&&on<0||Yr.includes("bottom")&&on>0)be.y=on;else{const Le=on*Te(on);be.y=Math.abs(Le)<Math.abs(on)?Le:on}}else if(G==="x"&&(Yr.includes("left")||Yr.includes("right")))if(Yr.includes("left")&&Dt<0||Yr.includes("right")&&Dt>0)be.x=Dt;else{const Le=Dt*Te(Dt);be.x=Math.abs(Le)<Math.abs(Dt)?Le:Dt}(Math.abs(be.x)>0||Math.abs(be.y)>0)&&K(!0),(Dn=me.current)==null||Dn.style.setProperty("--swipe-amount-x",`${be.x}px`),(Sn=me.current)==null||Sn.style.setProperty("--swipe-amount-y",`${be.y}px`)}},we&&!f.jsx&&X!=="loading"?Oe.createElement("button",{"aria-label":H,"data-disabled":Ke,"data-close-button":!0,onClick:Ke||!ue?()=>{}:()=>{it(),f.onDismiss==null||f.onDismiss.call(f,f)},className:yh(q?.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(En=z?.close)!=null?En:nun):null,(X||f.icon||f.promise)&&f.icon!==null&&(z?.[X]!==null||f.icon)?Oe.createElement("div",{"data-icon":"",className:yh(q?.icon,f==null||(a=f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Mt():null,f.type!=="loading"?mt:null):null,Oe.createElement("div",{"data-content":"",className:yh(q?.content,f==null||(s=f.classNames)==null?void 0:s.content)},Oe.createElement("div",{"data-title":"",className:yh(q?.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?Oe.createElement("div",{"data-description":"",className:yh(P,Ce,q?.description,f==null||(o=f.classNames)==null?void 0:o.description)},typeof f.description=="function"?f.description():f.description):null),Oe.isValidElement(f.cancel)?f.cancel:f.cancel&&DM(f.cancel)?Oe.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:kt=>{DM(f.cancel)&&ue&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,kt),it())},className:yh(q?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Oe.isValidElement(f.action)?f.action:f.action&&DM(f.action)?Oe.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||A,onClick:kt=>{DM(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,kt),!kt.defaultPrevented&&it())},className:yh(q?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function P_e(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function bun(e,t){const n={};return[e,t].forEach((r,a)=>{const s=a===1,i=s?"--mobile-offset":"--offset",o=s?fun:dun;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${i}-${u}`]=o:n[`${i}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),n}const qat=Oe.forwardRef(function(t,n){const{id:r,invert:a,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:d,mobileOffset:f,theme:p="light",richColors:h,duration:m,style:g,visibleToasts:v=uun,toastOptions:b,dir:S=P_e(),gap:O=hun,icons:k,containerAriaLabel:E="Notifications"}=t,[C,T]=Oe.useState([]),j=Oe.useMemo(()=>r?C.filter(R=>R.toasterId===r):C.filter(R=>!R.toasterId),[C,r]),A=Oe.useMemo(()=>Array.from(new Set([s].concat(j.filter(R=>R.position).map(R=>R.position)))),[j,s]),[I,P]=Oe.useState([]),[M,B]=Oe.useState(!1),[D,V]=Oe.useState(!1),[q,z]=Oe.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=Oe.useRef(null),G=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=Oe.useRef(null),Z=Oe.useRef(!1),F=Oe.useCallback(R=>{T(Q=>{var W;return(W=Q.find(te=>te.id===R.id))!=null&&W.delete||nu.dismiss(R.id),Q.filter(({id:te})=>te!==R.id)})},[]);return Oe.useEffect(()=>nu.subscribe(R=>{if(R.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(W=>W.id===R.id?{...W,delete:!0}:W))});return}setTimeout(()=>{Tle.flushSync(()=>{T(Q=>{const W=Q.findIndex(te=>te.id===R.id);return W!==-1?[...Q.slice(0,W),{...Q[W],...R},...Q.slice(W+1)]:[R,...Q]})})})}),[C]),Oe.useEffect(()=>{if(p!=="system"){z(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const R=window.matchMedia("(prefers-color-scheme: dark)");try{R.addEventListener("change",({matches:Q})=>{z(Q?"dark":"light")})}catch{R.addListener(({matches:W})=>{try{z(W?"dark":"light")}catch(te){console.error(te)}})}},[p]),Oe.useEffect(()=>{C.length<=1&&B(!1)},[C]),Oe.useEffect(()=>{const R=Q=>{var W;if(i.every(re=>Q[re]||Q.code===re)){var se;B(!0),(se=H.current)==null||se.focus()}Q.code==="Escape"&&(document.activeElement===H.current||(W=H.current)!=null&&W.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[i]),Oe.useEffect(()=>{if(H.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Z.current=!1)}},[H.current]),Oe.createElement("section",{ref:n,"aria-label":`${E} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((R,Q)=>{var W;const[te,se]=R.split("-");return j.length?Oe.createElement("ol",{key:R,dir:S==="auto"?P_e():S,tabIndex:-1,ref:H,className:u,"data-sonner-toaster":!0,"data-sonner-theme":q,"data-y-position":te,"data-x-position":se,style:{"--front-toast-height":`${((W=I[0])==null?void 0:W.height)||0}px`,"--width":`${pun}px`,"--gap":`${O}px`,...g,...bun(d,f)},onBlur:re=>{Z.current&&!re.currentTarget.contains(re.relatedTarget)&&(Z.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,L.current=re.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{D||B(!1)},onDragEnd:()=>B(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},j.filter(re=>!re.position&&Q===0||re.position===R).map((re,ae)=>{var oe,de;return Oe.createElement(yun,{key:re.id,icons:k,index:ae,toast:re,defaultRichColors:h,duration:(oe=b?.duration)!=null?oe:m,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:a,visibleToasts:v,closeButton:(de=b?.closeButton)!=null?de:c,interacting:D,position:R,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:F,toasts:j.filter(K=>K.position==re.position),heights:I.filter(K=>K.position==re.position),setHeights:P,expandByDefault:o,gap:O,expanded:M,swipeDirections:t.swipeDirections})})):null}))});function xun(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wun(e,t,n){const a=A6((n||{}).ignore||[]),s=Sun(t);let i=-1;for(;++i<s.length;)det(e,"text",o);function o(u,d){let f=-1,p;for(;++f<d.length;){const h=d[f],m=p?p.children:void 0;if(a(h,m?m.indexOf(h):void 0,p))return;p=h}if(p)return c(u,d)}function c(u,d){const f=d[d.length-1],p=s[i][0],h=s[i][1];let m=0;const v=f.children.indexOf(u);let b=!1,S=[];p.lastIndex=0;let O=p.exec(u.value);for(;O;){const k=O.index,E={index:O.index,input:O.input,stack:[...d,u]};let C=h(...O,E);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=k+1:(m!==k&&S.push({type:"text",value:u.value.slice(m,k)}),Array.isArray(C)?S.push(...C):C&&S.push(C),m=k+O[0].length,b=!0),!p.global)break;O=p.exec(u.value)}return b?(m<u.value.length&&S.push({type:"text",value:u.value.slice(m)}),f.children.splice(v,1,...S)):S=[u],v+S.length}}function Sun(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([Oun(a[0]),kun(a[1])])}return t}function Oun(e){return typeof e=="string"?new RegExp(xun(e),"g"):e}function kun(e){return typeof e=="function"?e:function(){return e}}const wU="phrasing",SU=["autolink","link","image","label"];function _un(){return{transforms:[Iun],enter:{literalAutolink:Cun,literalAutolinkEmail:OU,literalAutolinkHttp:OU,literalAutolinkWww:OU},exit:{literalAutolink:Aun,literalAutolinkEmail:Nun,literalAutolinkHttp:jun,literalAutolinkWww:Tun}}}function Eun(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:wU,notInConstruct:SU},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:wU,notInConstruct:SU},{character:":",before:"[ps]",after:"\\/",inConstruct:wU,notInConstruct:SU}]}}function Cun(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function OU(e){this.config.enter.autolinkProtocol.call(this,e)}function jun(e){this.config.exit.autolinkProtocol.call(this,e)}function Tun(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Nun(e){this.config.exit.autolinkEmail.call(this,e)}function Aun(e){this.exit(e)}function Iun(e){wun(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Run],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Pun]],{ignore:["link","linkReference"]})}function Run(e,t,n,r,a){let s="";if(!Hat(a)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Mun(n)))return!1;const i=Dun(n+r);if(!i[0])return!1;const o={type:"link",title:null,url:s+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[o,{type:"text",value:i[1]}]:o}function Pun(e,t,n,r){return!Hat(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Mun(e){const 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 Dun(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=OSe(e,"(");let s=OSe(e,")");for(;r!==-1&&a>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Hat(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||K0(n)||j6(n))&&(!t||n!==47)}Qat.peek=Hun;function $un(){this.buffer()}function Lun(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fun(){this.buffer()}function zun(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Bun(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Rp(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Uun(e){this.exit(e)}function Vun(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Rp(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qun(e){this.exit(e)}function Hun(){return"["}function Qat(e,t,n,r){const a=n.createTracker(r);let s=a.move("[^");const i=n.enter("footnoteReference"),o=n.enter("reference");return s+=a.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),i(),s+=a.move("]"),s}function Qun(){return{enter:{gfmFootnoteCallString:$un,gfmFootnoteCall:Lun,gfmFootnoteDefinitionLabelString:Fun,gfmFootnoteDefinition:zun},exit:{gfmFootnoteCallString:Bun,gfmFootnoteCall:Uun,gfmFootnoteDefinitionLabelString:Vun,gfmFootnoteDefinition:qun}}}function Gun(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Qat},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,s,i){const o=s.createTracker(i);let c=o.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=o.move(s.safe(s.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
210
210
  `:" ")+s.indentLines(s.containerFlow(r,o.current()),t?Gat:Wun))),u(),c}}function Wun(e,t,n){return t===0?e:Gat(e,t,n)}function Gat(e,t,n){return(n?"":" ")+e}const Zun=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Wat.peek=edn;function Yun(){return{canContainEols:["delete"],enter:{strikethrough:Kun},exit:{strikethrough:Jun}}}function Xun(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Zun}],handlers:{delete:Wat}}}function Kun(e){this.enter({type:"delete",children:[]},e)}function Jun(e){this.exit(e)}function Wat(e,t,n,r){const a=n.createTracker(r),s=n.enter("strikethrough");let i=a.move("~~");return i+=n.containerPhrasing(e,{...a.current(),before:i,after:"~"}),i+=a.move("~~"),s(),i}function edn(){return"~"}function tdn(e){return e.length}function ndn(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||tdn,s=[],i=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const g=[],v=[];let b=-1;for(e[d].length>u&&(u=e[d].length);++b<e[d].length;){const S=rdn(e[d][b]);if(n.alignDelimiters!==!1){const O=a(S);v[b]=O,(c[b]===void 0||O>c[b])&&(c[b]=O)}g.push(S)}i[d]=g,o[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=M_e(r[f]);else{const g=M_e(r);for(;++f<u;)s[f]=g}f=-1;const p=[],h=[];for(;++f<u;){const g=s[f];let v="",b="";g===99?(v=":",b=":"):g===108?v=":":g===114&&(b=":");let S=n.alignDelimiters===!1?1:Math.max(1,c[f]-v.length-b.length);const O=v+"-".repeat(S)+b;n.alignDelimiters!==!1&&(S=v.length+S+b.length,S>c[f]&&(c[f]=S),h[f]=S),p[f]=O}i.splice(1,0,p),o.splice(1,0,h),d=-1;const m=[];for(;++d<i.length;){const g=i[d],v=o[d];f=-1;const b=[];for(;++f<u;){const S=g[f]||"";let O="",k="";if(n.alignDelimiters!==!1){const E=c[f]-(v[f]||0),C=s[f];C===114?O=" ".repeat(E):C===99?E%2?(O=" ".repeat(E/2+.5),k=" ".repeat(E/2-.5)):(O=" ".repeat(E/2),k=O):k=" ".repeat(E)}n.delimiterStart!==!1&&!f&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&S==="")&&(n.delimiterStart!==!1||f)&&b.push(" "),n.alignDelimiters!==!1&&b.push(O),b.push(S),n.alignDelimiters!==!1&&b.push(k),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&b.push("|")}m.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
211
211
  `)}function rdn(e){return e==null?"":String(e)}function M_e(e){const 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}function adn(e,t,n,r){const a=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const i=n.indentLines(n.containerFlow(e,s.current()),sdn);return a(),i}function sdn(e,t,n){return">"+(n?"":" ")+e}function idn(e,t){return D_e(e,t.inConstruct,!0)&&!D_e(e,t.notInConstruct,!1)}function D_e(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function $_e(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
@@ -454,7 +454,7 @@ ${te.current.stack}
454
454
  `&&(I=`
455
455
  `);var G=0,L=!1;this.parse=function(Z,F,R){if(typeof Z!="string")throw new Error("Input must be a string");var Q=Z.length,W=A.length,te=I.length,se=P.length,re=T(M),ae=[],oe=[],de=[],K=G=0;if(!Z)return ye();if(D||D!==!1&&Z.indexOf(z)===-1){for(var ne=Z.split(I),ie=0;ie<ne.length;ie++){if(de=ne[ie],G+=de.length,ie!==ne.length-1)G+=I.length;else if(R)return ye();if(!P||de.substring(0,se)!==P){if(re){if(ae=[],_e(de.split(A)),Ce(),L)return ye()}else _e(de.split(A));if(B&&B<=ie)return ae=ae.slice(0,B),ye(!0)}}return ye()}for(var ve=Z.indexOf(A,G),ge=Z.indexOf(I,G),ke=new RegExp(v(H)+v(z),"g"),je=Z.indexOf(z,G);;)if(Z[G]===z)for(je=G,G++;;){if((je=Z.indexOf(z,je+1))===-1)return R||oe.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ae.length,index:G}),X();if(je===Q-1)return X(Z.substring(G,je).replace(ke,z));if(z===H&&Z[je+1]===H)je++;else if(z===H||je===0||Z[je-1]!==H){ve!==-1&&ve<je+1&&(ve=Z.indexOf(A,je+1));var me=J((ge=ge!==-1&&ge<je+1?Z.indexOf(I,je+1):ge)===-1?ve:Math.min(ve,ge));if(Z.substr(je+1+me,W)===A){de.push(Z.substring(G,je).replace(ke,z)),Z[G=je+1+me+W]!==z&&(je=Z.indexOf(z,G)),ve=Z.indexOf(A,G),ge=Z.indexOf(I,G);break}if(me=J(ge),Z.substring(je+1+me,je+1+me+te)===I){if(de.push(Z.substring(G,je).replace(ke,z)),ue(je+1+me+te),ve=Z.indexOf(A,G),je=Z.indexOf(z,G),re&&(Ce(),L))return ye();if(B&&ae.length>=B)return ye(!0);break}oe.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ae.length,index:G}),je++}}else if(P&&de.length===0&&Z.substring(G,G+se)===P){if(ge===-1)return ye();G=ge+te,ge=Z.indexOf(I,G),ve=Z.indexOf(A,G)}else if(ve!==-1&&(ve<ge||ge===-1))de.push(Z.substring(G,ve)),G=ve+W,ve=Z.indexOf(A,G);else{if(ge===-1)break;if(de.push(Z.substring(G,ge)),ue(ge+te),re&&(Ce(),L))return ye();if(B&&ae.length>=B)return ye(!0)}return X();function _e(le){ae.push(le),K=G}function J(le){var we=0;return we=le!==-1&&(le=Z.substring(je+1,le))&&le.trim()===""?le.length:we}function X(le){return R||(le===void 0&&(le=Z.substring(G)),de.push(le),G=Q,_e(de),re&&Ce()),ye()}function ue(le){G=le,_e(de),de=[],ge=Z.indexOf(I,G)}function ye(le){if(j.header&&!F&&ae.length&&!q){var we=ae[0],Ae=Object.create(null),Me=new Set(we);let Xe=!1;for(let Ot=0;Ot<we.length;Ot++){let Wt=we[Ot];if(Ae[Wt=T(j.transformHeader)?j.transformHeader(Wt,Ot):Wt]){let wn,It=Ae[Wt];for(;wn=Wt+"_"+It,It++,Me.has(wn););Me.add(wn),we[Ot]=wn,Ae[Wt]++,Xe=!0,(V=V===null?{}:V)[wn]=Wt}else Ae[Wt]=1,we[Ot]=Wt;Me.add(Wt)}Xe&&console.warn("Duplicate headers found and renamed."),q=!0}return{data:ae,errors:oe,meta:{delimiter:A,linebreak:I,aborted:L,truncated:!!le,cursor:K+(F||0),renamedHeaders:V}}}function Ce(){M(ye()),ae=[],oe=[]}},this.abort=function(){L=!0},this.getCharIndex=function(){return G}}function S(j){var A=j.data,I=o[A.workerId],P=!1;if(A.error)I.userError(A.error,A.file);else if(A.results&&A.results.data){var M={abort:function(){P=!0,O(A.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(T(I.userStep)){for(var B=0;B<A.results.data.length&&(I.userStep({data:A.results.data[B],errors:A.results.errors,meta:A.results.meta},M),!P);B++);delete A.results}else T(I.userChunk)&&(I.userChunk(A.results,M,A.file),delete A.results)}A.finished&&!P&&O(A.workerId,A.results)}function O(j,A){var I=o[j];T(I.userComplete)&&I.userComplete(A),I.terminate(),delete o[j]}function k(){throw new Error("Not implemented.")}function E(j){if(typeof j!="object"||j===null)return j;var A,I=Array.isArray(j)?[]:{};for(A in j)I[A]=E(j[A]);return I}function C(j,A){return function(){j.apply(A,arguments)}}function T(j){return typeof j=="function"}return u.parse=function(j,A){var I=(A=A||{}).dynamicTyping||!1;if(T(I)&&(A.dynamicTypingFunction=I,I={}),A.dynamicTyping=I,A.transform=!!T(A.transform)&&A.transform,!A.worker||!u.WORKERS_SUPPORTED)return I=null,u.NODE_STREAM_INPUT,typeof j=="string"?(j=(P=>P.charCodeAt(0)!==65279?P:P.slice(1))(j),I=new(A.download?f:h)(A)):j.readable===!0&&T(j.read)&&T(j.on)?I=new m(A):(r.File&&j instanceof File||j instanceof Object)&&(I=new p(A)),I.stream(j);(I=(()=>{var P;return!!u.WORKERS_SUPPORTED&&(P=(()=>{var M=r.URL||r.webkitURL||null,B=n.toString();return u.BLOB_URL||(u.BLOB_URL=M.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",B,")();"],{type:"text/javascript"})))})(),(P=new r.Worker(P)).onmessage=S,P.id=c++,o[P.id]=P)})()).userStep=A.step,I.userChunk=A.chunk,I.userComplete=A.complete,I.userError=A.error,A.step=T(A.step),A.chunk=T(A.chunk),A.complete=T(A.complete),A.error=T(A.error),delete A.worker,I.postMessage({input:j,config:A,workerId:I.id})},u.unparse=function(j,A){var I=!1,P=!0,M=",",B=`\r
456
456
  `,D='"',V=D+D,q=!1,z=null,H=!1,G=((()=>{if(typeof A=="object"){if(typeof A.delimiter!="string"||u.BAD_DELIMITERS.filter(function(F){return A.delimiter.indexOf(F)!==-1}).length||(M=A.delimiter),typeof A.quotes!="boolean"&&typeof A.quotes!="function"&&!Array.isArray(A.quotes)||(I=A.quotes),typeof A.skipEmptyLines!="boolean"&&typeof A.skipEmptyLines!="string"||(q=A.skipEmptyLines),typeof A.newline=="string"&&(B=A.newline),typeof A.quoteChar=="string"&&(D=A.quoteChar),typeof A.header=="boolean"&&(P=A.header),Array.isArray(A.columns)){if(A.columns.length===0)throw new Error("Option columns is empty");z=A.columns}A.escapeChar!==void 0&&(V=A.escapeChar+D),A.escapeFormulae instanceof RegExp?H=A.escapeFormulae:typeof A.escapeFormulae=="boolean"&&A.escapeFormulae&&(H=/^[=+\-@\t\r].*$/)}})(),new RegExp(v(D),"g"));if(typeof j=="string"&&(j=JSON.parse(j)),Array.isArray(j)){if(!j.length||Array.isArray(j[0]))return L(null,j,q);if(typeof j[0]=="object")return L(z||Object.keys(j[0]),j,q)}else if(typeof j=="object")return typeof j.data=="string"&&(j.data=JSON.parse(j.data)),Array.isArray(j.data)&&(j.fields||(j.fields=j.meta&&j.meta.fields||z),j.fields||(j.fields=Array.isArray(j.data[0])?j.fields:typeof j.data[0]=="object"?Object.keys(j.data[0]):[]),Array.isArray(j.data[0])||typeof j.data[0]=="object"||(j.data=[j.data])),L(j.fields||[],j.data||[],q);throw new Error("Unable to serialize unrecognized input");function L(F,R,Q){var W="",te=(typeof F=="string"&&(F=JSON.parse(F)),typeof R=="string"&&(R=JSON.parse(R)),Array.isArray(F)&&0<F.length),se=!Array.isArray(R[0]);if(te&&P){for(var re=0;re<F.length;re++)0<re&&(W+=M),W+=Z(F[re],re);0<R.length&&(W+=B)}for(var ae=0;ae<R.length;ae++){var oe=(te?F:R[ae]).length,de=!1,K=te?Object.keys(R[ae]).length===0:R[ae].length===0;if(Q&&!te&&(de=Q==="greedy"?R[ae].join("").trim()==="":R[ae].length===1&&R[ae][0].length===0),Q==="greedy"&&te){for(var ne=[],ie=0;ie<oe;ie++){var ve=se?F[ie]:ie;ne.push(R[ae][ve])}de=ne.join("").trim()===""}if(!de){for(var ge=0;ge<oe;ge++){0<ge&&!K&&(W+=M);var ke=te&&se?F[ge]:ge;W+=Z(R[ae][ke],ge)}ae<R.length-1&&(!Q||0<oe&&!K)&&(W+=B)}}return W}function Z(F,R){var Q,W;return F==null?"":F.constructor===Date?JSON.stringify(F).slice(1,25):(W=!1,H&&typeof F=="string"&&H.test(F)&&(F="'"+F,W=!0),Q=F.toString().replace(G,V),(W=W||I===!0||typeof I=="function"&&I(F,R)||Array.isArray(I)&&I[R]||((te,se)=>{for(var re=0;re<se.length;re++)if(-1<te.indexOf(se[re]))return!0;return!1})(Q,u.BAD_DELIMITERS)||-1<Q.indexOf(M)||Q.charAt(0)===" "||Q.charAt(Q.length-1)===" ")?D+Q+D:Q)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
457
- `,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!s&&!!r.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=b,u.ParserHandle=g,u.NetworkStreamer=f,u.FileStreamer=p,u.StringStreamer=h,u.ReadableStreamStreamer=m,r.jQuery&&((a=r.jQuery).fn.parse=function(j){var A=j.config||{},I=[];return this.each(function(B){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var D=0;D<this.files.length;D++)I.push({file:this.files[D],inputElem:this,instanceConfig:a.extend({},A)})}),P(),this;function P(){if(I.length===0)T(j.complete)&&j.complete();else{var B,D,V,q,z=I[0];if(T(j.before)){var H=j.before(z.file,z.inputElem);if(typeof H=="object"){if(H.action==="abort")return B="AbortError",D=z.file,V=z.inputElem,q=H.reason,void(T(j.error)&&j.error({name:B},D,V,q));if(H.action==="skip")return void M();typeof H.config=="object"&&(z.instanceConfig=a.extend(z.instanceConfig,H.config))}else if(H==="skip")return void M()}var G=z.instanceConfig.complete;z.instanceConfig.complete=function(L){T(G)&&G(L,z.file,z.inputElem),M()},u.parse(z.file,z.instanceConfig)}}function M(){I.splice(0,1),P()}}),i&&(r.onmessage=function(j){j=j.data,u.WORKER_ID===void 0&&j&&(u.WORKER_ID=j.workerId),typeof j.input=="string"?r.postMessage({workerId:u.WORKER_ID,results:u.parse(j.input,j.config),finished:!0}):(r.File&&j.input instanceof File||j.input instanceof Object)&&(j=u.parse(j.input,j.config))&&r.postMessage({workerId:u.WORKER_ID,results:j,finished:!0})}),(f.prototype=Object.create(d.prototype)).constructor=f,(p.prototype=Object.create(d.prototype)).constructor=p,(h.prototype=Object.create(h.prototype)).constructor=h,(m.prototype=Object.create(d.prototype)).constructor=m,u})})(UD)),UD.exports}var UJn=BJn();const Mvt=yo(UJn);var QLe=1,VJn=.9,qJn=.8,HJn=.17,uJ=.1,dJ=.999,QJn=.9999,GJn=.99,WJn=/[\\\/_+.#"@\[\(\{&]/,ZJn=/[\\\/_+.#"@\[\(\{&]/g,YJn=/[\s-]/,Dvt=/[\s-]/g;function Gae(e,t,n,r,a,s,i){if(s===t.length)return a===e.length?QLe:GJn;var o=`${a},${s}`;if(i[o]!==void 0)return i[o];for(var c=r.charAt(s),u=n.indexOf(c,a),d=0,f,p,h,m;u>=0;)f=Gae(e,t,n,r,u+1,s+1,i),f>d&&(u===a?f*=QLe:WJn.test(e.charAt(u-1))?(f*=qJn,h=e.slice(a,u-1).match(ZJn),h&&a>0&&(f*=Math.pow(dJ,h.length))):YJn.test(e.charAt(u-1))?(f*=VJn,m=e.slice(a,u-1).match(Dvt),m&&a>0&&(f*=Math.pow(dJ,m.length))):(f*=HJn,a>0&&(f*=Math.pow(dJ,u-a))),e.charAt(u)!==t.charAt(s)&&(f*=QJn)),(f<uJ&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(p=Gae(e,t,n,r,u+1,s+2,i),p*uJ>f&&(f=p*uJ)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[o]=d,d}function GLe(e){return e.toLowerCase().replace(Dvt," ")}function XJn(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Gae(e,t,GLe(e),GLe(t),0,0,{})}var _C='[cmdk-group=""]',fJ='[cmdk-group-items=""]',KJn='[cmdk-group-heading=""]',$vt='[cmdk-item=""]',WLe=`${$vt}:not([aria-disabled="true"])`,Wae="cmdk-item-select",N1="data-value",JJn=(e,t,n)=>XJn(e,t,n),Lvt=x.createContext(void 0),pR=()=>x.useContext(Lvt),Fvt=x.createContext(void 0),_me=()=>x.useContext(Fvt),zvt=x.createContext(void 0),Bvt=x.forwardRef((e,t)=>{let n=A1(()=>{var F,R;return{search:"",value:(R=(F=e.value)!=null?F:e.defaultValue)!=null?R:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=A1(()=>new Set),a=A1(()=>new Map),s=A1(()=>new Map),i=A1(()=>new Set),o=Uvt(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...b}=e,S=Zi(),O=Zi(),k=Zi(),E=x.useRef(null),C=uer();jw(()=>{if(d!==void 0){let F=d.trim();n.current.value=F,T.emit()}},[d]),jw(()=>{C(6,B)},[]);let T=x.useMemo(()=>({subscribe:F=>(i.current.add(F),()=>i.current.delete(F)),snapshot:()=>n.current,setState:(F,R,Q)=>{var W,te,se,re;if(!Object.is(n.current[F],R)){if(n.current[F]=R,F==="search")M(),I(),C(1,P);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(k);ae?ae.focus():(W=document.getElementById(S))==null||W.focus()}if(C(7,()=>{var ae;n.current.selectedItemId=(ae=D())==null?void 0:ae.id,T.emit()}),Q||C(5,B),((te=o.current)==null?void 0:te.value)!==void 0){let ae=R??"";(re=(se=o.current).onValueChange)==null||re.call(se,ae);return}}T.emit()}},emit:()=>{i.current.forEach(F=>F())}}),[]),j=x.useMemo(()=>({value:(F,R,Q)=>{var W;R!==((W=s.current.get(F))==null?void 0:W.value)&&(s.current.set(F,{value:R,keywords:Q}),n.current.filtered.items.set(F,A(R,Q)),C(2,()=>{I(),T.emit()}))},item:(F,R)=>(r.current.add(F),R&&(a.current.has(R)?a.current.get(R).add(F):a.current.set(R,new Set([F]))),C(3,()=>{M(),I(),n.current.value||P(),T.emit()}),()=>{s.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let Q=D();C(4,()=>{M(),Q?.getAttribute("id")===F&&P(),T.emit()})}),group:F=>(a.current.has(F)||a.current.set(F,new Set),()=>{s.current.delete(F),a.current.delete(F)}),filter:()=>o.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:S,inputId:k,labelId:O,listInnerRef:E}),[]);function A(F,R){var Q,W;let te=(W=(Q=o.current)==null?void 0:Q.filter)!=null?W:JJn;return F?te(F,n.current.search,R):0}function I(){if(!n.current.search||o.current.shouldFilter===!1)return;let F=n.current.filtered.items,R=[];n.current.filtered.groups.forEach(W=>{let te=a.current.get(W),se=0;te.forEach(re=>{let ae=F.get(re);se=Math.max(ae,se)}),R.push([W,se])});let Q=E.current;V().sort((W,te)=>{var se,re;let ae=W.getAttribute("id"),oe=te.getAttribute("id");return((se=F.get(oe))!=null?se:0)-((re=F.get(ae))!=null?re:0)}).forEach(W=>{let te=W.closest(fJ);te?te.appendChild(W.parentElement===te?W:W.closest(`${fJ} > *`)):Q.appendChild(W.parentElement===Q?W:W.closest(`${fJ} > *`))}),R.sort((W,te)=>te[1]-W[1]).forEach(W=>{var te;let se=(te=E.current)==null?void 0:te.querySelector(`${_C}[${N1}="${encodeURIComponent(W[0])}"]`);se?.parentElement.appendChild(se)})}function P(){let F=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),R=F?.getAttribute(N1);T.setState("value",R||void 0)}function M(){var F,R,Q,W;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let se of r.current){let re=(R=(F=s.current.get(se))==null?void 0:F.value)!=null?R:"",ae=(W=(Q=s.current.get(se))==null?void 0:Q.keywords)!=null?W:[],oe=A(re,ae);n.current.filtered.items.set(se,oe),oe>0&&te++}for(let[se,re]of a.current)for(let ae of re)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(se);break}n.current.filtered.count=te}function B(){var F,R,Q;let W=D();W&&(((F=W.parentElement)==null?void 0:F.firstChild)===W&&((Q=(R=W.closest(_C))==null?void 0:R.querySelector(KJn))==null||Q.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function D(){var F;return(F=E.current)==null?void 0:F.querySelector(`${$vt}[aria-selected="true"]`)}function V(){var F;return Array.from(((F=E.current)==null?void 0:F.querySelectorAll(WLe))||[])}function q(F){let R=V()[F];R&&T.setState("value",R.getAttribute(N1))}function z(F){var R;let Q=D(),W=V(),te=W.findIndex(re=>re===Q),se=W[te+F];(R=o.current)!=null&&R.loop&&(se=te+F<0?W[W.length-1]:te+F===W.length?W[0]:W[te+F]),se&&T.setState("value",se.getAttribute(N1))}function H(F){let R=D(),Q=R?.closest(_C),W;for(;Q&&!W;)Q=F>0?ler(Q,_C):cer(Q,_C),W=Q?.querySelector(WLe);W?T.setState("value",W.getAttribute(N1)):z(F)}let G=()=>q(V().length-1),L=F=>{F.preventDefault(),F.metaKey?G():F.altKey?H(1):z(1)},Z=F=>{F.preventDefault(),F.metaKey?q(0):F.altKey?H(-1):z(-1)};return x.createElement(bo.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:F=>{var R;(R=b.onKeyDown)==null||R.call(b,F);let Q=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||Q))switch(F.key){case"n":case"j":{v&&F.ctrlKey&&L(F);break}case"ArrowDown":{L(F);break}case"p":case"k":{v&&F.ctrlKey&&Z(F);break}case"ArrowUp":{Z(F);break}case"Home":{F.preventDefault(),q(0);break}case"End":{F.preventDefault(),G();break}case"Enter":{F.preventDefault();let W=D();if(W){let te=new Event(Wae);W.dispatchEvent(te)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:fer},c),$z(e,F=>x.createElement(Fvt.Provider,{value:T},x.createElement(Lvt.Provider,{value:j},F))))}),eer=x.forwardRef((e,t)=>{var n,r;let a=Zi(),s=x.useRef(null),i=x.useContext(zvt),o=pR(),c=Uvt(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i?.forceMount;jw(()=>{if(!u)return o.item(a,i?.id)},[u]);let d=Vvt(a,s,[e.value,e.children,s],e.keywords),f=_me(),p=Ab(C=>C.value&&C.value===d.current),h=Ab(C=>u||o.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);x.useEffect(()=>{let C=s.current;if(!(!C||e.disabled))return C.addEventListener(Wae,m),()=>C.removeEventListener(Wae,m)},[h,e.onSelect,e.disabled]);function m(){var C,T;g(),(T=(C=c.current).onSelect)==null||T.call(C,d.current)}function g(){f.setState("value",d.current,!0)}if(!h)return null;let{disabled:v,value:b,onSelect:S,forceMount:O,keywords:k,...E}=e;return x.createElement(bo.div,{ref:dm(s,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||o.getDisablePointerSelection()?void 0:g,onClick:v?void 0:m},e.children)}),ter=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...s}=e,i=Zi(),o=x.useRef(null),c=x.useRef(null),u=Zi(),d=pR(),f=Ab(h=>a||d.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);jw(()=>d.group(i),[]),Vvt(i,o,[e.value,e.heading,c]);let p=x.useMemo(()=>({id:i,forceMount:a}),[a]);return x.createElement(bo.div,{ref:dm(o,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),$z(e,h=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},x.createElement(zvt.Provider,{value:p},h))))}),ner=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),s=Ab(i=>!i.search);return!n&&!s?null:x.createElement(bo.div,{ref:dm(a,t),...r,"cmdk-separator":"",role:"separator"})}),rer=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,s=_me(),i=Ab(u=>u.search),o=Ab(u=>u.selectedItemId),c=pR();return x.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),x.createElement(bo.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:a?e.value:i,onChange:u=>{a||s.setState("search",u.target.value),n?.(u.target.value)}})}),aer=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,s=x.useRef(null),i=x.useRef(null),o=Ab(u=>u.selectedItemId),c=pR();return x.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,p=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(f),p.unobserve(u)}}},[]),x.createElement(bo.div,{ref:dm(s,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},$z(e,u=>x.createElement("div",{ref:dm(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),ser=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:s,container:i,...o}=e;return x.createElement(X5,{open:n,onOpenChange:r},x.createElement(K5,{container:i},x.createElement(iI,{"cmdk-overlay":"",className:a}),x.createElement(oI,{"aria-label":e.label,"cmdk-dialog":"",className:s},x.createElement(Bvt,{ref:t,...o}))))}),ier=x.forwardRef((e,t)=>Ab(n=>n.filtered.count===0)?x.createElement(bo.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),oer=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...s}=e;return x.createElement(bo.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},$z(e,i=>x.createElement("div",{"aria-hidden":!0},i)))}),zu=Object.assign(Bvt,{List:aer,Item:eer,Input:rer,Group:ter,Separator:ner,Dialog:ser,Empty:ier,Loading:oer});function ler(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function cer(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Uvt(e){let t=x.useRef(e);return jw(()=>{t.current=e}),t}var jw=typeof window>"u"?x.useEffect:x.useLayoutEffect;function A1(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ab(e){let t=_me(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Vvt(e,t,n,r=[]){let a=x.useRef(),s=pR();return jw(()=>{var i;let o=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():a.current}})(),c=r.map(u=>u.trim());s.value(e,o,c),(i=t.current)==null||i.setAttribute(N1,o),a.current=o}),a}var uer=()=>{let[e,t]=x.useState(),n=A1(()=>new Map);return jw(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function der(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function $z({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(der(t),{ref:t.ref},n(t.props.children)):n(t)}var fer={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};class io{constructor(t,n,r,a){this.fromA=t,this.toA=n,this.fromB=r,this.toB=a}offset(t,n=t){return new io(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}}function Tw(e,t,n,r,a,s){if(e==r)return[];let i=Cme(e,t,n,r,a,s),o=jme(e,t+i,n,r,a+i,s);t+=i,n-=o,a+=i,s-=o;let c=n-t,u=s-a;if(!c||!u)return[new io(t,n,a,s)];if(c>u){let f=e.slice(t,n).indexOf(r.slice(a,s));if(f>-1)return[new io(t,t+f,a,a),new io(t+f+u,n,s,s)]}else if(u>c){let f=r.slice(a,s).indexOf(e.slice(t,n));if(f>-1)return[new io(t,t,a,a+f),new io(n,n,a+f+c,s)]}if(c==1||u==1)return[new io(t,n,a,s)];let d=Qvt(e,t,n,r,a,s);if(d){let[f,p,h]=d;return Tw(e,t,f,r,a,p).concat(Tw(e,f+h,n,r,p+h,s))}return per(e,t,n,r,a,s)}let oj=1e9,lj=0,Eme=!1;function per(e,t,n,r,a,s){let i=n-t,o=s-a;if(oj<1e9&&Math.min(i,o)>oj*16||lj>0&&Date.now()>lj)return Math.min(i,o)>oj*64?[new io(t,n,a,s)]:ZLe(e,t,n,r,a,s);let c=Math.ceil((i+o)/2);pJ.reset(c),hJ.reset(c);let u=(h,m)=>e.charCodeAt(t+h)==r.charCodeAt(a+m),d=(h,m)=>e.charCodeAt(n-h-1)==r.charCodeAt(s-m-1),f=(i-o)%2!=0?hJ:null,p=f?null:pJ;for(let h=0;h<c;h++){if(h>oj||lj>0&&!(h&63)&&Date.now()>lj)return ZLe(e,t,n,r,a,s);let m=pJ.advance(h,i,o,c,f,!1,u)||hJ.advance(h,i,o,c,p,!0,d);if(m)return her(e,t,n,t+m[0],r,a,s,a+m[1])}return[new io(t,n,a,s)]}class qvt{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,n,r,a,s,i,o){for(let c=-t+this.start;c<=t-this.end;c+=2){let u=a+c,d=c==-t||c!=t&&this.vec[u-1]<this.vec[u+1]?this.vec[u+1]:this.vec[u-1]+1,f=d-c;for(;d<n&&f<r&&o(d,f);)d++,f++;if(this.vec[u]=d,d>n)this.end+=2;else if(f>r)this.start+=2;else if(s){let p=a+(n-r)-c;if(p>=0&&p<this.len&&s.vec[p]!=-1)if(i){let h=s.vec[p];if(h>=n-d)return[h,a+h-p]}else{let h=n-s.vec[p];if(d>=h)return[d,f]}}}return null}}const pJ=new qvt,hJ=new qvt;function her(e,t,n,r,a,s,i,o){let c=!1;return!Fk(e,r)&&++r==n&&(c=!0),!Fk(a,o)&&++o==i&&(c=!0),c?[new io(t,n,s,i)]:Tw(e,t,r,a,s,o).concat(Tw(e,r,n,a,o,i))}function Hvt(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n=n<<1;return n}function Cme(e,t,n,r,a,s){if(t==n||t==s||e.charCodeAt(t)!=r.charCodeAt(a))return 0;let i=Hvt(n-t,s-a);for(let o=t,c=a;;){let u=o+i,d=c+i;if(u>n||d>s||e.slice(o,u)!=r.slice(c,d)){if(i==1)return o-t-(Fk(e,o)?0:1);i=i>>1}else{if(u==n||d==s)return u-t;o=u,c=d}}}function jme(e,t,n,r,a,s){if(t==n||a==s||e.charCodeAt(n-1)!=r.charCodeAt(s-1))return 0;let i=Hvt(n-t,s-a);for(let o=n,c=s;;){let u=o-i,d=c-i;if(u<t||d<a||e.slice(u,o)!=r.slice(d,c)){if(i==1)return n-o-(Fk(e,o)?0:1);i=i>>1}else{if(u==t||d==a)return n-u;o=u,c=d}}}function Zae(e,t,n,r,a,s,i,o){let c=r.slice(a,s),u=null;for(;;){if(u||i<o)return u;for(let d=t+i;;){Fk(e,d)||d++;let f=d+i;if(Fk(e,f)||(f+=f==d+1?1:-1),f>=n)break;let p=e.slice(d,f),h=-1;for(;(h=c.indexOf(p,h+1))!=-1;){let m=Cme(e,f,n,r,a+h+p.length,s),g=jme(e,t,d,r,a,a+h),v=p.length+m+g;(!u||u[2]<v)&&(u=[d-g,a+h-g,v])}d=f}if(o<0)return u;i=i>>1}}function Qvt(e,t,n,r,a,s){let i=n-t,o=s-a;if(i<o){let c=Qvt(r,a,s,e,t,n);return c&&[c[1],c[0],c[2]]}return i<4||o*2<i?null:Zae(e,t,n,r,a,s,Math.floor(i/4),-1)}function ZLe(e,t,n,r,a,s){Eme=!0;let i=n-t,o=s-a,c;if(i<o){let p=Zae(r,a,s,e,t,n,Math.floor(i/6),50);c=p&&[p[1],p[0],p[2]]}else c=Zae(e,t,n,r,a,s,Math.floor(o/6),50);if(!c)return[new io(t,n,a,s)];let[u,d,f]=c;return Tw(e,t,u,r,a,d).concat(Tw(e,u+f,n,r,d+f,s))}function Gvt(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],a=e[n];r.toA>a.fromA-t&&r.toB>a.fromB-t&&(e[n-1]=new io(r.fromA,a.toA,r.fromB,a.toB),e.splice(n--,1))}}function mer(e,t,n){for(;;){Gvt(n,1);let r=!1;for(let a=0;a<n.length;a++){let s=n[a],i,o;(i=Cme(e,s.fromA,s.toA,t,s.fromB,s.toB))&&(s=n[a]=new io(s.fromA+i,s.toA,s.fromB+i,s.toB)),(o=jme(e,s.fromA,s.toA,t,s.fromB,s.toB))&&(s=n[a]=new io(s.fromA,s.toA-o,s.fromB,s.toB-o));let c=s.toA-s.fromA,u=s.toB-s.fromB;if(c&&u)continue;let d=s.fromA-(a?n[a-1].toA:0),f=(a<n.length-1?n[a+1].fromA:e.length)-s.toA;if(!d||!f)continue;let p=c?e.slice(s.fromA,s.toA):t.slice(s.fromB,s.toB);d<=p.length&&e.slice(s.fromA-d,s.fromA)==p.slice(p.length-d)?(n[a]=new io(s.fromA-d,s.toA-d,s.fromB-d,s.toB-d),r=!0):f<=p.length&&e.slice(s.toA,s.toA+f)==p.slice(0,f)&&(n[a]=new io(s.fromA+f,s.toA+f,s.fromB+f,s.toB+f),r=!0)}if(!r)break}return n}function ger(e,t,n){for(let r=0,a=0;a<e.length;a++){let s=e[a],i=s.toA-s.fromA,o=s.toB-s.fromB;if(i&&o||i>3||o>3){let c=a==e.length-1?t.length:e[a+1].fromA,u=s.fromA-r,d=c-s.toA,f=XLe(t,s.fromA,u),p=YLe(t,s.toA,d),h=s.fromA-f,m=p-s.toA;if((!i||!o)&&h&&m){let g=Math.max(i,o),[v,b,S]=i?[t,s.fromA,s.toA]:[n,s.fromB,s.toB];g>h&&t.slice(f,s.fromA)==v.slice(S-h,S)?(s=e[a]=new io(f,f+i,s.fromB-h,s.toB-h),f=s.fromA,p=YLe(t,s.toA,c-s.toA)):g>m&&t.slice(s.toA,p)==v.slice(b,b+m)&&(s=e[a]=new io(p-i,p,s.fromB+m,s.toB+m),p=s.toA,f=XLe(t,s.fromA,s.fromA-r)),h=s.fromA-f,m=p-s.toA}if(h||m)s=e[a]=new io(s.fromA-h,s.toA+m,s.fromB-h,s.toB+m);else if(i){if(!o){let g=JLe(t,s.fromA,s.toA),v,b=g<0?-1:KLe(t,s.toA,s.fromA);g>-1&&(v=g-s.fromA)<=d&&t.slice(s.fromA,g)==t.slice(s.toA,s.toA+v)?s=e[a]=s.offset(v):b>-1&&(v=s.toA-b)<=u&&t.slice(s.fromA-v,s.fromA)==t.slice(b,s.toA)&&(s=e[a]=s.offset(-v))}}else{let g=JLe(n,s.fromB,s.toB),v,b=g<0?-1:KLe(n,s.toB,s.fromB);g>-1&&(v=g-s.fromB)<=d&&n.slice(s.fromB,g)==n.slice(s.toB,s.toB+v)?s=e[a]=s.offset(v):b>-1&&(v=s.toB-b)<=u&&n.slice(s.fromB-v,s.fromB)==n.slice(b,s.toB)&&(s=e[a]=s.offset(-v))}}r=s.toA}return Gvt(e,3),e}let A0;try{A0=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Wvt(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Zvt(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?Wvt(n)?1:0:A0?!Kvt(n)||t==e.length-1?A0.test(String.fromCharCode(n))?1:0:A0.test(e.slice(t,t+2))?2:0:0}function Yvt(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?Wvt(n)?1:0:A0?!Jvt(n)||t==1?A0.test(String.fromCharCode(n))?1:0:A0.test(e.slice(t-2,t))?2:0:0}const Xvt=8;function YLe(e,t,n){if(t==e.length||!Yvt(e,t))return t;for(let r=t,a=t+n,s=0;s<Xvt;s++){let i=Zvt(e,r);if(!i||r+i>a)return r;r+=i}return t}function XLe(e,t,n){if(!t||!Zvt(e,t))return t;for(let r=t,a=t-n,s=0;s<Xvt;s++){let i=Yvt(e,r);if(!i||r-i<a)return r;r-=i}return t}function KLe(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function JLe(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}const Kvt=e=>e>=55296&&e<=56319,Jvt=e=>e>=56320&&e<=57343;function Fk(e,t){return!t||t==e.length||!Kvt(e.charCodeAt(t-1))||!Jvt(e.charCodeAt(t))}function ver(e,t,n){var r;let a=n?.override;return a?a(e,t):(oj=((r=n?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,lj=n?.timeout?Date.now()+n.timeout:0,Eme=!1,mer(e,t,Tw(e,0,e.length,t,0,t.length)))}function eyt(){return!Eme}function tyt(e,t,n){return ger(ver(e,t,n),e,t)}const Bh=Zt.define({combine:e=>e[0]}),Yae=Xn.define(),yer=Zt.define(),zk=Yi.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(Yae)&&(e=n.value);for(let n of t.state.facet(yer))e=n(e,t);return e}});class TO{constructor(t,n,r,a,s,i=!0){this.changes=t,this.fromA=n,this.toA=r,this.fromB=a,this.toB=s,this.precise=i}offset(t,n){return t||n?new TO(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(t,n,r){let a=tyt(t.toString(),n.toString(),r);return nyt(a,t,n,0,0,eyt())}static updateA(t,n,r,a,s){return a5e(r5e(t,a,!0,r.length),t,n,r,s)}static updateB(t,n,r,a,s){return a5e(r5e(t,a,!1,n.length),t,n,r,s)}}function e5e(e,t,n,r){let a=n.lineAt(e),s=r.lineAt(t);return a.to==e&&s.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[a.from,s.from]}function t5e(e,t,n,r){let a=n.lineAt(e),s=r.lineAt(t);return a.from==e&&s.from==t?[e,t]:[a.to+1,s.to+1]}function nyt(e,t,n,r,a,s){let i=[];for(let o=0;o<e.length;o++){let c=e[o],[u,d]=e5e(c.fromA+r,c.fromB+a,t,n),[f,p]=t5e(c.toA+r,c.toB+a,t,n),h=[c.offset(-u+r,-d+a)];for(;o<e.length-1;){let m=e[o+1],[g,v]=e5e(m.fromA+r,m.fromB+a,t,n);if(g>f+1&&v>p+1)break;h.push(m.offset(-u+r,-d+a)),[f,p]=t5e(m.toA+r,m.toB+a,t,n),o++}i.push(new TO(h,u,Math.max(u,f),d,Math.max(d,p),s))}return i}const E2=1e3;function n5e(e,t,n,r){let a=0,s=e.length;for(;;){if(a==s){let d=0,f=0;a&&({toA:d,toB:f}=e[a-1]);let p=t-(n?d:f);return[d+p,f+p]}let i=a+s>>1,o=e[i],[c,u]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(c>t)s=i;else if(u<=t)a=i+1;else return r?[o.fromA,o.fromB]:[o.toA,o.toB]}}function r5e(e,t,n,r){let a=[];return t.iterChangedRanges((s,i,o,c)=>{let u=0,d=n?t.length:r,f=0,p=n?r:t.length;s>E2&&([u,f]=n5e(e,s-E2,n,!0)),i<t.length-E2&&([d,p]=n5e(e,i+E2,n,!1));let h=c-o-(i-s),m,[g,v]=n?[h,0]:[0,h];a.length&&(m=a[a.length-1]).toA>=u?a[a.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:p,diffA:m.diffA+g,diffB:m.diffB+v}:a.push({fromA:u,toA:d,fromB:f,toB:p,diffA:g,diffB:v})}),a}function a5e(e,t,n,r,a){if(!e.length)return t;let s=[];for(let i=0,o=0,c=0,u=0;;i++){let d=i==e.length?null:e[i],f=d?d.fromA+o:n.length,p=d?d.fromB+c:r.length;for(;u<t.length;){let v=t[u];if(d&&(v.toA+o>f||v.toB+c>p))break;s.push(v.offset(o,c)),u++}if(!d)break;let h=d.toA+o+d.diffA,m=d.toB+c+d.diffB,g=tyt(n.sliceString(f,h),r.sliceString(p,m),a);for(let v of nyt(g,n,r,f,p,eyt()))s.push(v);for(o+=d.diffA,c+=d.diffB;u<t.length;){let v=t[u];if(v.fromA+o>h&&v.fromB+c>m)break;u++}}return s}const ber={scanLimit:500},ryt=mi.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=o5e(e))}update(e){(e.docChanged||e.viewportChanged||xer(e.startState,e.state)||wer(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=o5e(e.view))}},{decorations:e=>e.deco}),C2=Zp.low(Ztt({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(ryt))===null||t===void 0?void 0:t.gutter)||Pr.empty}}));function xer(e,t){return e.field(zk,!1)!=t.field(zk,!1)}function wer(e,t){return e.facet(Bh)!=t.facet(Bh)}const s5e=tn.line({class:"cm-changedLine"}),Ser=tn.mark({class:"cm-changedText"}),Oer=tn.mark({tagName:"ins",class:"cm-insertedLine"}),ker=tn.mark({tagName:"del",class:"cm-deletedLine"}),i5e=new class extends hm{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function _er(e,t,n,r,a,s){let i=n?e.fromA:e.fromB,o=n?e.toA:e.toB,c=0;if(i!=o){a.add(i,i,s5e),a.add(i,o,n?ker:Oer),s&&s.add(i,i,i5e);for(let u=t.iterRange(i,o-1),d=i;!u.next().done;){if(u.lineBreak){d++,a.add(d,d,s5e),s&&s.add(d,d,i5e);continue}let f=d+u.value.length;if(r)for(;c<e.changes.length;){let p=e.changes[c],h=i+(n?p.fromA:p.fromB),m=i+(n?p.toA:p.toB),g=Math.max(d,h),v=Math.min(f,m);if(g<v&&a.add(g,v,Ser),m<f)c++;else break}d=f}}}function o5e(e){let t=e.state.field(zk),{side:n,highlightChanges:r,markGutter:a,overrideChunk:s}=e.state.facet(Bh),i=n=="a",o=new Au,c=a?new Au:null,{from:u,to:d}=e.viewport;for(let f of t){if((i?f.fromA:f.fromB)>=d)break;(i?f.toA:f.toB)>u&&(!s||!s(e.state,f,o,c))&&_er(f,e.state.doc,i,r,o,c)}return{deco:o.finish(),gutter:c&&c.finish()}}class j2 extends Ud{constructor(t){super(),this.height=t}eq(t){return this.height==t.height}toDOM(){let t=document.createElement("div");return t.className="cm-mergeSpacer",t.style.height=this.height+"px",t}updateDOM(t){return t.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const J3=Xn.define({map:(e,t)=>e.map(t)}),cj=Yi.define({create:()=>tn.none,update:(e,t)=>{for(let n of t.effects)if(n.is(J3))return n.value;return e.map(t.changes)},provide:e=>vt.decorations.from(e)}),T2=.01;function l5e(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function Eer(e,t,n){let r=new Au,a=new Au,s=e.state.field(cj).iter(),i=t.state.field(cj).iter(),o=0,c=0,u=0,d=0,f=e.viewport,p=t.viewport;for(let v=0;;v++){let b=v<n.length?n[v]:null,S=b?b.fromA:e.state.doc.length,O=b?b.fromB:t.state.doc.length;if(o<S){let k=e.lineBlockAt(o).top+u,E=t.lineBlockAt(c).top+d,C=k-E;C<-T2?(u-=C,r.add(o,o,tn.widget({widget:new j2(-C),block:!0,side:-1}))):C>T2&&(d+=C,a.add(c,c,tn.widget({widget:new j2(C),block:!0,side:-1})))}if(S>o+1e3&&o<f.from&&S>f.from&&c<p.from&&O>p.from){let k=Math.min(f.from-o,p.from-c);o+=k,c+=k,v--}else if(b)o=b.toA,c=b.toB;else break;for(;s.value&&s.from<o;)u-=s.value.spec.widget.height,s.next();for(;i.value&&i.from<c;)d-=i.value.spec.widget.height,i.next()}for(;s.value;)u-=s.value.spec.widget.height,s.next();for(;i.value;)d-=i.value.spec.widget.height,i.next();let h=e.contentHeight+u-(t.contentHeight+d);h<T2?r.add(e.state.doc.length,e.state.doc.length,tn.widget({widget:new j2(-h),block:!0,side:1})):h>T2&&a.add(t.state.doc.length,t.state.doc.length,tn.widget({widget:new j2(h),block:!0,side:1}));let m=r.finish(),g=a.finish();l5e(m,e.state.field(cj))||e.dispatch({effects:J3.of(m)}),l5e(g,t.state.field(cj))||t.dispatch({effects:J3.of(g)})}const Xae=Xn.define({map:(e,t)=>t.mapPos(e)});class Cer extends Ud{constructor(t){super(),this.lines=t}eq(t){return this.lines==t.lines}toDOM(t){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=t.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",r=>{let a=t.posAtDOM(r.target);t.dispatch({effects:Xae.of(a)});let{side:s,sibling:i}=t.state.facet(Bh);i&&i().dispatch({effects:Xae.of(jer(a,t.state.field(zk),s=="a"))})}),n}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function jer(e,t,n){let r=0,a=0;for(let s=0;;s++){let i=s<t.length?t[s]:null;if(!i||(n?i.fromA:i.fromB)>=e)return a+(e-r);[r,a]=n?[i.toA,i.toB]:[i.toB,i.toA]}}const Ter=Yi.define({create(e){return tn.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(Xae)&&(e=e.update({filter:r=>r!=n.value}));return e},provide:e=>vt.decorations.from(e)});function c5e({margin:e=3,minSize:t=4}){return Ter.init(n=>Ner(n,e,t))}function Ner(e,t,n){let r=new Au,a=e.facet(Bh).side=="a",s=e.field(zk),i=1;for(let o=0;;o++){let c=o<s.length?s[o]:null,u=o?i+t:1,d=c?e.doc.lineAt(a?c.fromA:c.fromB).number-1-t:e.doc.lines,f=d-u+1;if(f>=n&&r.add(e.doc.line(u).from,e.doc.line(d).to,tn.replace({widget:new Cer(f),block:!0})),!c)break;i=e.doc.lineAt(Math.min(e.doc.length,a?c.toA:c.toB)).number}return r.finish()}const Aer=vt.styleModule.of(new Yg({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),Ier=vt.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),u5e=new b_,N2=new b_;class Rer{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||ber;let n=[Zp.low(ryt),Ier,Aer,cj,vt.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(p=>p.effects.some(h=>h.is(J3)))&&this.measure()})],r=[Bh.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&r.push(C2);let a=Tr.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],vt.editorAttributes.of({class:"cm-merge-a"}),N2.of(r),n]}),s=[Bh.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&s.push(C2);let i=Tr.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],vt.editorAttributes.of({class:"cm-merge-b"}),N2.of(s),n]});this.chunks=TO.build(a.doc,i.doc,this.diffConf);let o=[zk.init(()=>this.chunks),u5e.of(t.collapseUnchanged?c5e(t.collapseUnchanged):[])];a=a.update({effects:Xn.appendConfig.of(o)}).state,i=i.update({effects:Xn.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let c=t.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(c=="a-b"?u:d),this.editorDOM.appendChild(c=="a-b"?d:u),this.a=new vt({state:a,parent:u,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new vt({state:i,parent:d,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!t.revertControls,t.revertControls=="b-to-a",t.renderRevertControl),t.parent&&t.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(t,n){if(t.some(r=>r.docChanged)){let r=t[t.length-1],a=t.reduce((i,o)=>i.compose(o.changes),ao.empty(t[0].startState.doc.length));this.chunks=n==this.a?TO.updateA(this.chunks,r.newDoc,this.b.state.doc,a,this.diffConf):TO.updateB(this.chunks,this.a.state.doc,r.newDoc,a,this.diffConf),n.update([...t,r.state.update({effects:Yae.of(this.chunks)})]);let s=n==this.a?this.b:this.a;s.update([s.state.update({effects:Yae.of(this.chunks)})]),this.scheduleMeasure()}else n.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let s=t.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let i=this.a.dom.parentNode,o=this.b.dom.parentNode;i.remove(),o.remove(),this.editorDOM.insertBefore(s?i:o,this.editorDOM.firstChild),this.editorDOM.appendChild(s?o:i),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let s=!!this.revertDOM,i=this.revertToA,o=this.renderRevert;"revertControls"in t&&(s=!!t.revertControls,i=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(o=t.renderRevertControl),this.setupRevertControls(s,i,o)}let n="highlightChanges"in t,r="gutter"in t,a="collapseUnchanged"in t;if(n||r||a){let s=[],i=[];if(n||r){let o=this.a.state.facet(Bh),c=r?t.gutter!==!1:o.markGutter,u=n?t.highlightChanges!==!1:o.highlightChanges;s.push(N2.reconfigure([Bh.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:c}),c?C2:[]])),i.push(N2.reconfigure([Bh.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:c}),c?C2:[]]))}if(a){let o=u5e.reconfigure(t.collapseUnchanged?c5e(t.collapseUnchanged):[]);s.push(o),i.push(o)}this.a.dispatch({effects:s}),this.b.dispatch({effects:i})}this.scheduleMeasure()}setupRevertControls(t,n,r){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!t&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):t&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",a=>this.revertClicked(a)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let t=this.dom.ownerDocument.defaultView||window;this.measuring=t.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){Eer(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,n=t.firstChild,r=this.a.viewport,a=this.b.viewport;for(let s=0;s<this.chunks.length;s++){let i=this.chunks[s];if(i.fromA>r.to||i.fromB>a.to)break;if(i.fromA<r.from||i.fromB<a.from)continue;let o=this.a.lineBlockAt(i.fromA).top+"px";for(;n&&+n.dataset.chunk<s;)n=d5e(n);n&&n.dataset.chunk==String(s)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):t.insertBefore(this.renderRevertButton(o,s),n)}for(;n;)n=d5e(n)}renderRevertButton(t,n){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let a=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",a),r.setAttribute("title",a),r.textContent=this.revertToLeft?"⇜":"⇝"}return r.style.top=t,r.setAttribute("data-chunk",String(n)),r}revertClicked(t){let n=t.target,r;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(r=this.chunks[n.dataset.chunk])){let[a,s,i,o,c,u]=this.revertToA?[this.b,this.a,r.fromB,r.toB,r.fromA,r.toA]:[this.a,this.b,r.fromA,r.toA,r.fromB,r.toB],d=a.state.sliceDoc(i,Math.max(i,o-1));i!=o&&u<=s.state.doc.length&&(d+=a.state.lineBreak),s.dispatch({changes:{from:c,to:Math.min(s.state.doc.length,u),insert:d},userEvent:"revert"}),t.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function d5e(e){let t=e.nextSibling;return e.remove(),t}const f5e={modelSettings:{maxRetries:2,maxSteps:5,chatWithGenerateLegacy:!1,chatWithGenerate:!1}};function Per({agentId:e,defaultSettings:t}){const[n,r]=x.useState(t),a=`mastra-agent-store-${e}`;return x.useEffect(()=>{try{const o=localStorage.getItem(a),c=o?JSON.parse(o):{},u={...c,modelSettings:{...f5e.modelSettings,...c?.modelSettings??{},...t?.modelSettings??{}}};r(u)}catch{}},[a,t]),{settings:n,setSettings:o=>{r(c=>({...c,...o})),localStorage.setItem(a,JSON.stringify({...o,agentId:e}))},resetAll:()=>{const o={modelSettings:{...f5e.modelSettings,...t?.modelSettings??{}}};r(o),localStorage.removeItem(a)}}}const ayt=x.createContext({});function Tme({children:e,agentId:t,defaultSettings:n}){const{settings:r,setSettings:a,resetAll:s}=Per({agentId:t,defaultSettings:n});return l.jsx(ayt.Provider,{value:{settings:r,setSettings:a,resetAll:s},children:e})}const Nme=()=>x.useContext(ayt),Fr=ble()($Mt(e=>({requestContext:{},theme:"dark",setRequestContext:t=>e({requestContext:t}),setTheme:t=>e({theme:t})}),{name:"mastra-playground-store"})),Ame=x.createContext(null);function Lz({children:e}){const{requestContext:t}=Fr(),[n,r]=x.useState(t),a=i=>r(i),s=()=>{r({})};return l.jsx(Ame.Provider,{value:{schemaValues:n,setSchemaValues:a,clearSchemaValues:s},children:e})}function syt(){const e=x.useContext(Ame);if(!e)throw new Error("useSchemaRequestContext must be used within a SchemaRequestContextProvider");return e}function ol(){const{requestContext:e}=Fr(),n=x.useContext(Ame)?.schemaValues??{};return{...e??{},...n}}const iyt=({threadId:e,agentId:t,memory:n})=>{const r=We(),{requestContext:a}=Fr();return jt({queryKey:["memory","messages",e,t,"requestContext"],queryFn:async()=>e?await r.listThreadMessages(e,{agentId:t,requestContext:a}):null,enabled:n&&!!e,staleTime:0,gcTime:0,retry:!1,refetchOnWindowFocus:!1})},Mer=({multiple:e=!0,onChange:t}={})=>{const n=D8t(s=>!s.isEditing),r=rI(),a=x.useCallback(()=>{const s=document.createElement("input");s.type="file",s.multiple=e,s.hidden=!0;const i=r.getState().attachmentAccept;i&&i!=="*"&&(s.accept=i),document.body.appendChild(s),s.onchange=o=>{const c=o.target.files;if(c){for(const u of c)r.addAttachment(u),t?.(Array.from(c));document.body.removeChild(s)}},s.oncancel=()=>{(!s.files||s.files.length===0)&&document.body.removeChild(s)},s.click()},[r,e]);if(!n)return a},Yl={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},hR="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",Der="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",$er="rounded-md",Ime="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",Rme="outline-none focus-visible:outline-none focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",Pme="disabled:opacity-50 disabled:cursor-not-allowed";function oyt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=oyt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lyt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=oyt(e))&&(r&&(r+=" "),r+=t);return r}const Ler=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Fer=(e,t)=>({classGroupId:e,validator:t}),cyt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),eL="-",p5e=[],zer="arbitrary..",Ber=e=>{const t=Ver(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Uer(i);const o=i.split(eL),c=o[0]===""&&o.length>1?1:0;return uyt(o,c,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const c=r[i],u=n[i];return c?u?Ler(u,c):c:u||p5e}return n[i]||p5e}}},uyt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const u=uyt(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const o=t===0?e.join(eL):e.slice(t).join(eL),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},Uer=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?zer+r:void 0})(),Ver=e=>{const{theme:t,classGroups:n}=e;return qer(n,t)},qer=(e,t)=>{const n=cyt();for(const r in e){const a=e[r];Mme(a,n,r,t)}return n},Mme=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const i=e[s];Her(i,t,n,r)}},Her=(e,t,n,r)=>{if(typeof e=="string"){Qer(e,t,n);return}if(typeof e=="function"){Ger(e,t,n,r);return}Wer(e,t,n,r)},Qer=(e,t,n)=>{const r=e===""?t:dyt(t,e);r.classGroupId=n},Ger=(e,t,n,r)=>{if(Zer(e)){Mme(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Fer(n,e))},Wer=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let i=0;i<s;i++){const[o,c]=a[i];Mme(c,dyt(t,o),n,r)}},dyt=(e,t)=>{let n=e;const r=t.split(eL),a=r.length;for(let s=0;s<a;s++){const i=r[s];let o=n.nextPart.get(i);o||(o=cyt(),n.nextPart.set(i,o)),n=o}return n},Zer=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Yer=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in n?n[s]=i:a(s,i)}}},Kae="!",h5e=":",Xer=[],m5e=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),Ker=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const s=[];let i=0,o=0,c=0,u;const d=a.length;for(let g=0;g<d;g++){const v=a[g];if(i===0&&o===0){if(v===h5e){s.push(a.slice(c,g)),c=g+1;continue}if(v==="/"){u=g;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=s.length===0?a:a.slice(c);let p=f,h=!1;f.endsWith(Kae)?(p=f.slice(0,-1),h=!0):f.startsWith(Kae)&&(p=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return m5e(s,h,p,m)};if(t){const a=t+h5e,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):m5e(Xer,!1,i,void 0,!0)}if(n){const a=r;r=s=>n({className:s,parseClassName:a})}return r},Jer=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let s=0;s<n.length;s++){const i=n[s],o=i[0]==="[",c=t.has(i);o||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},etr=e=>({cache:Yer(e.cacheSize),parseClassName:Ker(e),sortModifiers:Jer(e),...Ber(e)}),ttr=/\s+/,ntr=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],o=e.trim().split(ttr);let c="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!g,b=r(v?m.substring(0,g):m);if(!b){if(!v){c=d+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=d+(c.length>0?" "+c:c);continue}v=!1}const S=p.length===0?"":p.length===1?p[0]:s(p).join(":"),O=h?S+Kae:S,k=O+b;if(i.indexOf(k)>-1)continue;i.push(k);const E=a(b,v);for(let C=0;C<E.length;++C){const T=E[C];i.push(O+T)}c=d+(c.length>0?" "+c:c)}return c},rtr=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=fyt(n))&&(a&&(a+=" "),a+=r);return a},fyt=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=fyt(e[r]))&&(n&&(n+=" "),n+=t);return n},g5e=(e,...t)=>{let n,r,a,s;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=etr(u),r=n.cache.get,a=n.cache.set,s=o,o(c)},o=c=>{const u=r(c);if(u)return u;const d=ntr(c,n);return a(c,d),d};return s=i,(...c)=>s(rtr(...c))},atr=[],_o=e=>{const t=n=>n[e]||atr;return t.isThemeGetter=!0,t},pyt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hyt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,str=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,itr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,otr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ltr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ctr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,utr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gy=e=>str.test(e),jr=e=>!!e&&!Number.isNaN(Number(e)),vy=e=>!!e&&Number.isInteger(Number(e)),mJ=e=>e.endsWith("%")&&jr(e.slice(0,-1)),dg=e=>itr.test(e),myt=()=>!0,dtr=e=>otr.test(e)&&!ltr.test(e),Dme=()=>!1,ftr=e=>ctr.test(e),ptr=e=>utr.test(e),htr=e=>!pn(e)&&!yn(e),mtr=e=>ex(e,yyt,Dme),pn=e=>pyt.test(e),Bx=e=>ex(e,byt,dtr),v5e=e=>ex(e,Otr,jr),gtr=e=>ex(e,wyt,myt),vtr=e=>ex(e,xyt,Dme),y5e=e=>ex(e,gyt,Dme),ytr=e=>ex(e,vyt,ptr),A2=e=>ex(e,Syt,ftr),yn=e=>hyt.test(e),EC=e=>uS(e,byt),btr=e=>uS(e,xyt),b5e=e=>uS(e,gyt),xtr=e=>uS(e,yyt),wtr=e=>uS(e,vyt),I2=e=>uS(e,Syt,!0),Str=e=>uS(e,wyt,!0),ex=(e,t,n)=>{const r=pyt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uS=(e,t,n=!1)=>{const r=hyt.exec(e);return r?r[1]?t(r[1]):n:!1},gyt=e=>e==="position"||e==="percentage",vyt=e=>e==="image"||e==="url",yyt=e=>e==="length"||e==="size"||e==="bg-size",byt=e=>e==="length",Otr=e=>e==="number",xyt=e=>e==="family-name",wyt=e=>e==="number"||e==="weight",Syt=e=>e==="shadow",x5e=()=>{const e=_o("color"),t=_o("font"),n=_o("text"),r=_o("font-weight"),a=_o("tracking"),s=_o("leading"),i=_o("breakpoint"),o=_o("container"),c=_o("spacing"),u=_o("radius"),d=_o("shadow"),f=_o("inset-shadow"),p=_o("text-shadow"),h=_o("drop-shadow"),m=_o("blur"),g=_o("perspective"),v=_o("aspect"),b=_o("ease"),S=_o("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...k(),yn,pn],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[yn,pn,c],A=()=>[gy,"full","auto",...j()],I=()=>[vy,"none","subgrid",yn,pn],P=()=>["auto",{span:["full",vy,yn,pn]},vy,yn,pn],M=()=>[vy,"auto",yn,pn],B=()=>["auto","min","max","fr",yn,pn],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...j()],z=()=>[gy,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[gy,"screen","full","dvw","lvw","svw","min","max","fit",...j()],G=()=>[gy,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,yn,pn],Z=()=>[...k(),b5e,y5e,{position:[yn,pn]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],R=()=>["auto","cover","contain",xtr,mtr,{size:[yn,pn]}],Q=()=>[mJ,EC,Bx],W=()=>["","none","full",u,yn,pn],te=()=>["",jr,EC,Bx],se=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[jr,mJ,b5e,y5e],oe=()=>["","none",m,yn,pn],de=()=>["none",jr,yn,pn],K=()=>["none",jr,yn,pn],ne=()=>[jr,yn,pn],ie=()=>[gy,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[dg],breakpoint:[dg],color:[myt],container:[dg],"drop-shadow":[dg],ease:["in","out","in-out"],font:[htr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[dg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[dg],shadow:[dg],spacing:["px",jr],text:[dg],"text-shadow":[dg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gy,pn,yn,v]}],container:["container"],columns:[{columns:[jr,pn,yn,o]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[vy,"auto",yn,pn]}],basis:[{basis:[gy,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[jr,gy,"auto","initial","none",pn]}],grow:[{grow:["",jr,yn,pn]}],shrink:[{shrink:["",jr,yn,pn]}],order:[{order:[vy,"first","last","none",yn,pn]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...G()]}],"min-block-size":[{"min-block":["auto",...G()]}],"max-block-size":[{"max-block":["none",...G()]}],w:[{w:[o,"screen",...z()]}],"min-w":[{"min-w":[o,"screen","none",...z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,EC,Bx]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Str,gtr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",mJ,pn]}],"font-family":[{font:[btr,vtr,t]}],"font-features":[{"font-features":[pn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,yn,pn]}],"line-clamp":[{"line-clamp":[jr,"none",yn,v5e]}],leading:[{leading:[s,...j()]}],"list-image":[{"list-image":["none",yn,pn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",yn,pn]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[jr,"from-font","auto",yn,Bx]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[jr,"auto",yn,pn]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",yn,pn]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",yn,pn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vy,yn,pn],radial:["",yn,pn],conic:[vy,yn,pn]},wtr,ytr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[jr,yn,pn]}],"outline-w":[{outline:["",jr,EC,Bx]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,I2,A2]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,I2,A2]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[jr,Bx]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,I2,A2]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[jr,yn,pn]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[jr]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[yn,pn]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[jr]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",yn,pn]}],filter:[{filter:["","none",yn,pn]}],blur:[{blur:oe()}],brightness:[{brightness:[jr,yn,pn]}],contrast:[{contrast:[jr,yn,pn]}],"drop-shadow":[{"drop-shadow":["","none",h,I2,A2]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",jr,yn,pn]}],"hue-rotate":[{"hue-rotate":[jr,yn,pn]}],invert:[{invert:["",jr,yn,pn]}],saturate:[{saturate:[jr,yn,pn]}],sepia:[{sepia:["",jr,yn,pn]}],"backdrop-filter":[{"backdrop-filter":["","none",yn,pn]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[jr,yn,pn]}],"backdrop-contrast":[{"backdrop-contrast":[jr,yn,pn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",jr,yn,pn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jr,yn,pn]}],"backdrop-invert":[{"backdrop-invert":["",jr,yn,pn]}],"backdrop-opacity":[{"backdrop-opacity":[jr,yn,pn]}],"backdrop-saturate":[{"backdrop-saturate":[jr,yn,pn]}],"backdrop-sepia":[{"backdrop-sepia":["",jr,yn,pn]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",yn,pn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[jr,"initial",yn,pn]}],ease:[{ease:["linear","initial",b,yn,pn]}],delay:[{delay:[jr,yn,pn]}],animate:[{animate:["none",S,yn,pn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,yn,pn]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[yn,pn,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",yn,pn]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",yn,pn]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[jr,EC,Bx,v5e]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ktr=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:a={},override:s={}})=>(uj(e,"cacheSize",t),uj(e,"prefix",n),uj(e,"experimentalParseClassName",r),R2(e.theme,s.theme),R2(e.classGroups,s.classGroups),R2(e.conflictingClassGroups,s.conflictingClassGroups),R2(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),uj(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),P2(e.theme,a.theme),P2(e.classGroups,a.classGroups),P2(e.conflictingClassGroups,a.conflictingClassGroups),P2(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Oyt(e,a,"orderSensitiveModifiers"),e),uj=(e,t,n)=>{n!==void 0&&(e[t]=n)},R2=(e,t)=>{if(t)for(const n in t)uj(e,n,t[n])},P2=(e,t)=>{if(t)for(const n in t)Oyt(e,t,n)},Oyt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},_tr=(e,...t)=>typeof e=="function"?g5e(x5e,e,...t):g5e(()=>ktr(x5e(),e),...t),Etr=Object.keys({...C6,..._Zt}),Ctr=Object.keys(AZt),jtr=Object.keys(EZt),Ttr=Object.keys(CZt),Ntr=Object.keys(kZt),Ux=Object.keys(NZt),Atr=Object.keys(jZt).concat(Object.keys(TZt)),Itr=_tr({extend:{theme:{color:Etr,spacing:Ctr,radius:Ntr,leading:Ttr,shadow:Atr},classGroups:{"font-size":[{text:jtr}],h:[{h:Ux}],w:[{w:Ux}],size:[{size:Ux}],"min-h":[{"min-h":Ux}],"min-w":[{"min-w":Ux}],"max-h":[{"max-h":Ux}],"max-w":[{"max-w":Ux}]}}});function Y(...e){return Itr(lyt(e))}const Rtr={sm:`${Yl.sm} text-ui-sm px-[.75em]`,md:`${Yl.md} text-ui-md px-[.75em]`,default:`${Yl.default} text-ui-md px-[.85em] `,lg:`${Yl.lg} text-ui-lg px-[1em] `},Ptr={default:"bg-surface3 border-2 border-border1 hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral5",primary:"bg-surface4 border-2 border-border2 hover:text-neutral6 hover:bg-surface5 active:bg-surface6 text-neutral6",cta:"bg-accent1/50 hover:bg-accent1/80 text-neutral5 font-semibold",ghost:"bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",inputLike:Ime,light:"",outline:""},Mtr=Y("flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100",Pme,Rme),Dtr={light:"default",outline:"default"};function $tr(e){return Dtr[e]??e}function z_(e){const t=$tr(e?.variant||"default"),n=e?.size||"default";return Y(Mtr,Ptr[t],Rtr[n],e?.iconOnly&&"[&>svg]:opacity-75")}function kyt(e){const t=[];return Oe.Children.forEach(e,n=>{Oe.isValidElement(n)&&n.type===Oe.Fragment?t.push(...kyt(n.props.children)):t.push(n)}),t}function Ltr(e){const t=kyt(e);return t.length>0&&t.every(n=>Oe.isValidElement(n))}const he=Oe.forwardRef(({className:e,as:t,size:n="default",variant:r="default",disabled:a,children:s,...i},o)=>{const c=t||"button",u=Ltr(s);return l.jsx(c,{ref:o,disabled:a,className:Y(z_({variant:r,size:n,iconOnly:u}),e),...i,children:s})});he.displayName="Button";const Fo=U5t,er=V5t,tr=q5t,Kn=x.forwardRef(({className:e,sideOffset:t=4,children:n,...r},a)=>l.jsx(H5t,{children:l.jsxs(cGe,{ref:a,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface6 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r,children:[n,l.jsx(Q5t,{className:"fill-surface6"})]})}));Kn.displayName=cGe.displayName;const hi=Oe.forwardRef(({tooltipContent:e,...t},n)=>l.jsxs(er,{children:[l.jsx(tr,{asChild:!0,children:l.jsx(he,{ref:n,...t})}),e&&l.jsx(Kn,{children:e})]}));hi.displayName="ButtonWithTooltip";const Mr=X5,_yt=bZe,Ftr=K5,Eyt=x.forwardRef(({className:e,...t},n)=>l.jsx(iI,{ref:n,className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Eyt.displayName=iI.displayName;const Nr=x.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Ftr,{children:[l.jsx(Eyt,{}),l.jsxs(oI,{ref:r,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]","gap-4 border border-border1 bg-surface3 py-6 shadow-dialog rounded-lg","duration-slow","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...n,children:[t,l.jsxs(t6,{className:Y("absolute right-4 top-4 rounded-md p-1","text-neutral3 hover:text-neutral6 hover:bg-surface4","transition-all duration-normal ease-out-custom","focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","disabled:pointer-events-none"),children:[l.jsx(Sr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Nr.displayName=oI.displayName;const Dr=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});Dr.displayName="DialogHeader";const Hp=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Hp.displayName="DialogFooter";const $r=({className:e,...t})=>l.jsx("div",{className:Y("overflow-y-auto px-6 max-h-[50vh]",e),...t});$r.displayName="DialogBody";const Ar=x.forwardRef(({className:e,...t},n)=>l.jsx(J5,{ref:n,className:Y("text-ui-md font-medium",e),...t}));Ar.displayName=J5.displayName;const ys=x.forwardRef(({className:e,...t},n)=>l.jsx(e6,{ref:n,className:Y("sr-only",e),...t}));ys.displayName=e6.displayName;const w5e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,S5e=lyt,$me=(e,t)=>n=>{var r;if(t?.variants==null)return S5e(e,n?.class,n?.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(u=>{const d=n?.[u],f=s?.[u];if(d===null)return null;const p=w5e(d)||w5e(f);return a[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...s,...o}[g]):{...s,...o}[g]===v})?[...u,f,p]:u},[]);return S5e(e,i,c,n?.class,n?.className)},ztr=$me(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(Ime,Rme,Pme),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Yl.sm} text-ui-sm px-[.75em]`,md:`${Yl.md} text-ui-md px-[.75em]`,default:`${Yl.default} text-ui-md px-[.85em]`,lg:`${Yl.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),an=x.forwardRef(({className:e,size:t,testId:n,variant:r,type:a,error:s,...i},o)=>l.jsx("input",{type:a,className:Y(ztr({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:o,"aria-invalid":s,...i}));an.displayName="Input";const Btr=$me("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=x.forwardRef(({className:e,...t},n)=>l.jsx(UJe,{ref:n,className:Y(Btr(),e),...t}));xt.displayName=UJe.displayName;const Utr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},Vtr={mono:"font-mono"},pe=({as:e="p",className:t,variant:n="ui-md",font:r,...a})=>l.jsx(e,{className:Y(Utr[n],r&&Vtr[r],t),...a}),$s=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),l.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),Cyt=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M63.0002 0.968262C28.5152 0.968262 0.55957 15.6484 0.55957 33.7573V51.2428C0.55957 69.3517 28.5152 84.0319 63.0002 84.0319C97.4853 84.0319 125.441 69.3517 125.441 51.2428V33.7573C125.441 15.6484 97.4853 0.968262 63.0002 0.968262Z",stroke:"#707070"}),l.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636V49.8363C6.67773 65.0322 31.894 77.351 62.9998 77.351C94.1055 77.351 119.322 65.0322 119.322 49.8363V35.1636Z",fill:"#2E2E2E",fillOpacity:"0.9"}),l.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636M119.322 35.1636C119.322 19.9677 94.1055 7.64893 62.9998 7.64893C31.894 7.64893 6.67773 19.9677 6.67773 35.1636M119.322 35.1636V49.8363C119.322 65.0322 94.1055 77.351 62.9998 77.351C31.894 77.351 6.67773 65.0322 6.67773 49.8363V35.1636",stroke:"#424242"}),l.jsxs("g",{clipPath:"url(#clip0_21421_19519)",children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5383 47.0955C45.0714 50.3122 53.9322 52.1193 63.1714 52.1193C72.4106 52.1193 81.2714 50.3122 87.8045 47.0955C94.3376 43.8787 98.0078 39.5159 98.0078 34.9668C98.0078 30.4177 94.3376 26.0549 87.8045 22.8381C81.2714 19.6214 72.4106 17.8143 63.1714 17.8143C53.9322 17.8143 45.0714 19.6214 38.5383 22.8381C32.0052 26.0549 28.3349 30.4177 28.3349 34.9668C28.3349 39.5159 32.0052 43.8787 38.5383 47.0955ZM42.9089 34.9668L35.8005 34.9668C35.8004 32.3013 37.4056 29.6956 40.4132 27.4793C43.4207 25.263 47.6956 23.5355 52.6971 22.5154C57.6986 21.4954 63.2022 21.2285 68.5118 21.7485C73.8214 22.2685 78.6986 23.552 82.5266 25.4368C86.3546 27.3216 88.9615 29.723 90.0176 32.3373C91.0737 34.9517 90.5316 37.6614 88.4599 40.1241C86.3881 42.5867 82.8797 44.6915 78.3784 46.1723C73.8771 47.6532 68.585 48.4435 63.1714 48.4435V44.9435C63.1717 43.9778 62.7855 43.0215 62.035 42.1293C61.2845 41.2372 60.1843 40.4265 58.7973 39.7438L53.4695 37.1205C52.0828 36.4376 50.4364 35.8959 48.6244 35.5263C46.8124 35.1568 44.8702 34.9667 42.9089 34.9668Z",fill:"#A9A9A9"}),l.jsx("path",{d:"M77.2474 28.0361C75.3808 27.1171 72.8492 26.6007 70.2094 26.6007C67.5696 26.6007 65.038 27.1171 63.1714 28.0361L61.4119 28.9025C59.5453 29.8215 58.4966 31.068 58.4966 32.3678C58.4966 33.6676 59.5453 34.9141 61.4119 35.8331C63.2785 36.7522 65.8101 37.2685 68.4499 37.2685C71.0897 37.2685 73.6213 36.7522 75.4879 35.8331L77.2474 34.9668C79.114 34.0477 80.1627 32.8012 80.1627 31.5015C80.1627 30.2017 79.114 28.9552 77.2474 28.0361Z",fill:"#A9A9A9"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21421_19519",children:l.jsx("rect",{width:"62.7591",height:"62.7591",fill:"white",transform:"matrix(0.897148 0.441731 -0.897148 0.441731 63.1714 7.24365)"})})})]}),qtr=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),l.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),Lme=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),Fme=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),fi=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),zme=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:l.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_22095",children:l.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),jyt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[l.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"#4285F4"}),l.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"#34A853"}),l.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"#FBBC05"}),l.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"#EA4335"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_20513",children:l.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),Htr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},xe=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:Y("block",Htr[n],t),...r,children:e}),Qtr=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),l.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),l.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),Tyt=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),Gtr=e=>l.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M10.1266 5.67745C10.3409 5.0225 10.2695 4.2961 9.92413 3.70069C9.40017 2.78376 8.34034 2.31934 7.30433 2.53369C6.85182 2.02164 6.18496 1.73584 5.49428 1.73584C4.43445 1.73584 3.50561 2.41461 3.17218 3.4149C2.49342 3.55779 1.90992 3.97458 1.56458 4.5819C1.04062 5.49883 1.1597 6.64202 1.86228 7.42796C1.64793 8.09482 1.73129 8.80931 2.07663 9.40472C2.60059 10.3217 3.66042 10.798 4.69643 10.5717C5.16085 11.0838 5.8158 11.3815 6.50648 11.3815C7.56631 11.3815 8.49515 10.7027 8.82858 9.70243C9.50735 9.55953 10.0908 9.14274 10.4362 8.53542C10.9601 7.61849 10.8411 6.46339 10.1266 5.67745ZM6.50648 10.7503C6.07778 10.7503 5.67291 10.6074 5.35138 10.3336C5.36329 10.3217 5.39902 10.3097 5.41093 10.2978L7.32815 9.19037C7.42341 9.13083 7.48295 9.03557 7.48295 8.91648V6.21332L8.29271 6.67774C8.30462 6.67774 8.30462 6.68965 8.30462 6.70156V8.9403C8.31653 9.94059 7.50677 10.7503 6.50648 10.7503ZM2.62441 9.09511C2.41006 8.72595 2.33861 8.29726 2.41006 7.88047C2.42197 7.89238 2.44578 7.90429 2.4696 7.91619L4.38682 9.02366C4.48209 9.0832 4.60117 9.0832 4.69643 9.02366L7.04235 7.66612V8.60687C7.04235 8.61878 7.04235 8.63069 7.03044 8.63069L5.0894 9.75006C4.23201 10.2502 3.12455 9.9525 2.62441 9.09511ZM2.12426 4.90342C2.33861 4.53427 2.67204 4.26038 3.06501 4.10557V6.39195C3.06501 6.49912 3.12455 6.60629 3.21982 6.66583L5.56573 8.02337L4.75597 8.48779C4.74407 8.48779 4.73216 8.4997 4.73216 8.48779L2.79112 7.36842C1.90992 6.86827 1.62412 5.76081 2.12426 4.90342ZM8.79285 6.45149L6.44694 5.09395L7.2567 4.62953C7.2686 4.62953 7.28051 4.61762 7.28051 4.62953L9.22155 5.7489C10.0908 6.24905 10.3766 7.35651 9.8765 8.2139C9.66215 8.58305 9.32872 8.85694 8.93575 8.99984V6.72538C8.94766 6.6182 8.88812 6.51103 8.79285 6.45149ZM9.5907 5.23685C9.5788 5.22494 9.55498 5.21303 9.53116 5.20113L7.61394 4.09366C7.51868 4.03412 7.39959 4.03412 7.30433 4.09366L4.95841 5.4512V4.51045C4.95841 4.49854 4.95841 4.48663 4.97032 4.48663L6.91136 3.36726C7.78066 2.86712 8.87621 3.16482 9.37636 4.03412C9.5907 4.39137 9.66215 4.82006 9.5907 5.23685ZM4.51781 6.904L3.70805 6.43958C3.69615 6.43958 3.69615 6.42767 3.69615 6.41576V4.17702C3.69615 3.17673 4.5059 2.36697 5.50619 2.36697C5.93489 2.36697 6.33977 2.50987 6.66129 2.78376C6.64938 2.79567 6.62556 2.80758 6.60175 2.81949L4.68453 3.92695C4.58926 3.98649 4.52972 4.08176 4.52972 4.20084V6.904H4.51781ZM4.95841 5.95134L6.00634 5.34402L7.05426 5.95134V7.15407L6.00634 7.76139L4.95841 7.15407V5.95134Z",fill:"currentColor"})}),Bme=e=>l.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),Wtr=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),vo=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),B_=e=>l.jsx(yZt,{...e}),Mo=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),Ztr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636V49.8363C6.67773 65.0322 31.894 77.351 62.9998 77.351C94.1055 77.351 119.322 65.0322 119.322 49.8363V35.1636Z",fill:"#2E2E2E",fillOpacity:"0.9"}),l.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636M119.322 35.1636C119.322 19.9677 94.1055 7.64893 62.9998 7.64893C31.894 7.64893 6.67773 19.9677 6.67773 35.1636M119.322 35.1636V49.8363C119.322 65.0322 94.1055 77.351 62.9998 77.351C31.894 77.351 6.67773 65.0322 6.67773 49.8363V35.1636",stroke:"#424242"}),l.jsx("path",{d:"M63.0002 0.968262C28.5152 0.968262 0.55957 15.6484 0.55957 33.7573V51.2428C0.55957 69.3517 28.5152 84.0319 63.0002 84.0319C97.4853 84.0319 125.441 69.3517 125.441 51.2428V33.7573C125.441 15.6484 97.4853 0.968262 63.0002 0.968262Z",stroke:"#707070"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M74.9374 21.357C76.2127 20.7291 78.2804 20.7291 79.5557 21.357L90.8129 26.8997C92.0882 27.5276 92.0882 28.5458 90.8129 29.1737L83.1638 32.9399C81.8885 33.5678 79.8207 33.5678 78.5454 32.9399L75.8033 31.5898L68.3324 35.2682L64.1502 39.696C63.8908 39.481 63.6138 39.2568 63.3231 39.0227L63.1495 38.883C62.2893 38.1914 61.2677 37.3701 60.6254 36.6376C60.5446 36.5456 60.4618 36.4463 60.3812 36.3407C60.1669 36.3011 59.9652 36.2603 59.7782 36.2205C58.2906 35.9043 56.6225 35.4013 55.2179 34.9777L54.9342 34.8922C54.4589 34.7491 54.0034 34.6127 53.5666 34.4849L62.5594 32.4258L70.0304 28.7473L67.2882 27.3972C66.0129 26.7692 66.0129 25.7512 67.2882 25.1232L74.9374 21.357ZM53.5666 34.4849C53.5666 34.4849 53.5666 34.4849 53.5666 34.4849L46.1603 36.1808L47.516 36.8483C48.7913 37.4762 48.7912 38.4943 47.516 39.1222L39.8668 42.8884C38.5916 43.5163 36.5238 43.5164 35.2485 42.8884L23.9913 37.3457C22.7159 36.7177 22.716 35.6996 23.9913 35.0717L31.6404 31.3055C32.9156 30.6776 34.9834 30.6776 36.2587 31.3055L38.5358 32.4267C39.6899 31.9483 40.9309 31.4611 42.153 31.0313C43.6354 30.5099 45.4001 29.9605 47.091 29.683C49.7278 29.2502 52.3729 29.7072 53.9892 30.0537C55.8019 30.4425 57.6745 31.0055 59.1934 31.4628C60.6081 31.8887 61.6949 32.2154 62.5594 32.4258L53.5666 34.4849ZM46.1603 36.1808L53.5666 34.4849C52.5189 34.1784 51.5786 33.9213 50.7293 33.7392C49.9958 33.5819 49.6114 33.5441 49.4794 33.5326C48.964 33.6384 48.0924 33.8823 46.8983 34.3023C46.0703 34.5936 45.1981 34.9293 44.3325 35.2808L46.1603 36.1808ZM64.1502 39.696L68.3324 35.2682C68.7598 35.6939 69.4232 36.229 70.2883 36.9256C71.2171 37.6735 72.3605 38.5954 73.15 39.488C73.8539 40.2838 74.7818 41.5862 73.9029 42.8844C73.3394 43.717 72.2235 44.5859 71.1648 45.3159C70.2916 45.9175 69.3021 46.5286 68.3305 47.0968L70.6077 48.218C71.8829 48.8459 71.8829 49.864 70.6077 50.4919L62.9585 54.2582C61.6833 54.8861 59.6154 54.8861 58.3402 54.2582L47.083 48.7154C45.8077 48.0875 45.8077 47.0694 47.083 46.4415L54.7321 42.6752C56.0074 42.0474 58.0751 42.0473 59.3505 42.6752L60.7062 43.3428L64.1502 39.696ZM64.1502 39.696L60.7062 43.3428L62.5339 44.2427C63.2478 43.8165 63.9298 43.3871 64.5213 42.9794C65.3742 42.3914 65.8695 41.9622 66.0846 41.7085C66.0613 41.6436 65.9844 41.4543 65.6649 41.0931C65.295 40.6749 64.773 40.212 64.1502 39.696Z",fill:"#A9A9A9"})]}),Mu=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),l.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),Ytr=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),Xtr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",fill:"#2E2E2E",fillOpacity:"0.9"}),l.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",stroke:"#424242"}),l.jsx("path",{d:"M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",stroke:"#707070"}),l.jsx("path",{d:"M51.5215 39.9726C50.5464 40.4477 48.9738 40.4435 48.009 39.9634C47.0442 39.4833 47.0526 38.709 48.0277 38.2339L69.7191 27.6672C72.7243 26.2032 72.7347 23.8181 69.7605 22.3476L69.6898 22.313C66.6927 20.8686 61.8895 20.8864 58.9368 22.3528L30.3946 36.5278C29.4288 37.0074 27.8561 37.0107 26.882 36.5352C25.9078 36.0597 25.901 35.2853 26.8668 34.8057L55.4092 20.6308C60.2847 18.2094 68.2157 18.1801 73.1645 20.5651L73.2814 20.6222C76.1808 22.0558 77.3624 24.0157 76.8227 25.8782C80.6339 25.5828 84.6694 26.1476 87.6364 27.5775C92.6525 29.9949 92.7059 33.962 87.7554 36.4119L61.5441 49.3836C61.282 49.5133 61.281 49.7227 61.5417 49.853L67.0252 52.5932C67.988 53.0743 67.9763 53.8486 66.9992 54.3226C66.0221 54.7966 64.4495 54.7909 63.4867 54.3098L58.0033 51.5695C55.8306 50.4838 55.8392 48.7391 58.0226 47.6585L84.2339 34.6868C87.2382 33.2 87.2058 30.7925 84.1617 29.3254C81.1488 27.8734 76.1811 27.9317 73.2127 29.4058L51.5215 39.9726Z",fill:"#A9A9A9"}),l.jsx("path",{d:"M63.0028 23.8809C64.0019 23.4098 65.5873 23.4146 66.5747 23.8972C67.562 24.3798 67.5831 25.1603 66.6338 25.6556L66.5879 25.679L45.1511 36.3113C42.2204 37.7649 42.2292 40.1117 45.1707 41.56C48.1228 43.0135 52.91 43.0118 55.8578 41.5563L76.8564 31.1875L76.9037 31.1648C77.9049 30.6949 79.4903 30.7013 80.4755 31.185C81.4763 31.6764 81.4785 32.4741 80.4806 32.9669L59.4821 43.3356C54.5363 45.7777 46.5044 45.7806 41.5516 43.342C36.6166 40.9121 36.602 36.9747 41.519 34.5359L62.9558 23.9037L63.0028 23.8809Z",fill:"#A9A9A9"})]}),Ktr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",fill:"#2E2E2E",fillOpacity:"0.9"}),l.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",stroke:"#424242"}),l.jsx("path",{d:"M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",stroke:"#707070"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M95.8997 32.6647C98.4806 33.9355 98.4744 36.0012 95.8997 37.2689L89.6657 40.3384C87.0848 41.6091 82.8892 41.6061 80.3146 40.3384L74.0805 37.2689C71.4996 35.9981 71.5059 33.9324 74.0805 32.6647L80.3146 29.5952C82.8955 28.3244 87.091 28.3275 89.6657 29.5952L95.8997 32.6647ZM74.0805 21.9215C76.6614 23.1923 76.6552 25.258 74.0805 26.5257L67.8465 29.5952C65.2656 30.866 61.0701 30.8629 58.4954 29.5952L52.2613 26.5257C49.6804 25.255 49.6867 23.1892 52.2613 21.9215L58.4954 18.852C61.0763 17.5813 65.2718 17.5843 67.8465 18.852L74.0805 21.9215ZM74.0805 43.4079C76.6614 44.6786 76.6552 46.7444 74.0805 48.0121L67.8465 51.0816C65.2656 52.3523 61.0701 52.3493 58.4954 51.0816L52.2613 48.0121C49.6804 46.7413 49.6867 44.6756 52.2613 43.4079L58.4954 40.3384C61.0763 39.0676 65.2718 39.0707 67.8465 40.3384L74.0805 43.4079ZM52.2613 32.6647C54.8422 33.9355 54.836 36.0012 52.2613 37.2689L46.0273 40.3384C43.4464 41.6091 39.2509 41.6061 36.6762 40.3384L30.4422 37.2689C27.8613 35.9981 27.8675 33.9324 30.4422 32.6647L36.6762 29.5952C39.2571 28.3244 43.4526 28.3275 46.0273 29.5952L52.2613 32.6647Z",fill:"#A9A9A9"})]});function sb(e){return l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),l.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),l.jsx("path",{d:"M15 2v2"}),l.jsx("path",{d:"M15 20v2"}),l.jsx("path",{d:"M2 15h2"}),l.jsx("path",{d:"M2 9h2"}),l.jsx("path",{d:"M20 15h2"}),l.jsx("path",{d:"M20 9h2"}),l.jsx("path",{d:"M9 2v2"}),l.jsx("path",{d:"M9 20v2"})]})}const Jtr={jpg:"image/jpg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",pdf:"application/pdf"},enr=async e=>{try{const t=await fetch(e,{method:"HEAD"});if(!t.ok)throw new Error("Failed to get file content type");const n=t.headers.get("content-type");if(!n)throw new Error("Failed to get file content type");return n}catch{const r=new URL(e).pathname.split(".").pop();if(!r)return;const a=r.toLowerCase();return Jtr[a]}},tnr=({onOpenChange:e,open:t})=>{const n=rI(),r=Mer({onChange:()=>e(!1)}),a=async s=>{s.preventDefault();const o=new FormData(s.target).get("url-attachment")?.toString();if(o){const c=new File([],o,{type:await enr(o)});n.addAttachment(c),e(!1)}};return l.jsx(Mr,{onOpenChange:e,open:t,children:l.jsxs(Nr,{children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"Add attachment"}),l.jsx(ys,{children:"Add a file attachment via URL or from your computer"})]}),l.jsxs($r,{children:[l.jsxs("form",{onSubmit:a,className:"flex flex-row items-end gap-4",children:[l.jsxs("div",{className:"w-full space-y-1",children:[l.jsx(xt,{htmlFor:"url-attachment",className:"text-neutral3 text-ui-md",children:"Public URL"}),l.jsx(an,{type:"text",name:"url-attachment",id:"url-attachment",className:"w-full",placeholder:"https://placehold.co/600x400/png"})]}),l.jsxs(he,{type:"submit",className:"!h-8",variant:"light",children:[l.jsx(xe,{children:l.jsx(qGt,{})}),"Add"]})]}),l.jsx("hr",{className:"my-2 border border-border1"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(pe,{variant:"ui-md",className:"text-neutral3",children:"Or from your computer"}),l.jsxs("button",{onClick:r,className:"w-full h-40 border border-border1 rounded-lg text-neutral3 border-dashed flex flex-col items-center justify-center gap-2 hover:bg-surface2 active:bg-surface3",children:[l.jsx(NQt,{className:"size-12"}),l.jsx(pe,{variant:"header-md",children:"Add a local file"})]})]})]})]})})},nnr=e=>{const[t,n]=x.useState(void 0);return x.useEffect(()=>{if(!e){n(void 0);return}const r=URL.createObjectURL(e);return n(r),()=>{URL.revokeObjectURL(r)}},[e]),t},rnr=()=>{const{file:e,src:t}=cD(IWe(n=>{if(n.file)return n.file.name.startsWith("https://")?{src:n.file.name}:{file:n.file};const r=n.content?.filter(a=>a.type==="image")[0]?.image;return r?{src:r}:{}}));return nnr(e)??t},anr=()=>{const e=rI(),[t,n]=x.useState(!1);return x.useEffect(()=>{e.subscribe(()=>{const r=e.getState().attachments;n(r.length>0)})},[e]),t},snr=e=>{const[t,n]=x.useState({isLoading:!1,text:""});return x.useEffect(()=>{if(!e)return;(async()=>{n(s=>({...s,isLoading:!0}));const a=await e.text();n(s=>({...s,isLoading:!1,text:a}))})()},[e]),t},tL="h-full w-full flex items-center justify-center",Nyt=({data:e,url:t})=>{const[n,r]=x.useState(!1);return t?l.jsx("a",{href:t,className:tL,target:"_blank",rel:"noreferrer noopener",children:l.jsx(Nu,{className:"text-accent2","aria-label":"View PDF"})}):l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>r(!0),className:tL,type:"button",children:l.jsx(Nu,{className:"text-accent2","aria-label":"View PDF"})}),l.jsx(inr,{data:e,open:n,onOpenChange:r})]})},inr=({data:e,open:t,onOpenChange:n})=>l.jsx(Mr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{className:"max-w-4xl",children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"PDF preview"}),l.jsx(ys,{children:"Preview of the PDF document"})]}),l.jsx($r,{children:t&&l.jsx("iframe",{src:e,width:"100%",height:"600px"})})]})}),Ayt=({src:e})=>{const[t,n]=x.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>n(!0),type:"button",className:tL,children:l.jsx("img",{src:e,className:"object-cover aspect-ratio max-h-[140px] max-w-[320px]",alt:"Preview"})}),l.jsx(onr,{src:e,open:t,onOpenChange:n})]})},onr=({src:e,open:t,onOpenChange:n})=>l.jsx(Mr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{className:"max-w-4xl",children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"Image preview"}),l.jsx(ys,{children:"Preview of the image"})]}),l.jsx($r,{children:t&&l.jsx("img",{src:e,alt:"Image"})})]})}),Iyt=({data:e})=>{const[t,n]=x.useState(!1),r=e.replace(/<attachment[^>]*>/,"").replace(/<\/attachment>/g,"");return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>n(!0),className:tL,type:"button",children:l.jsx(Nu,{className:"text-neutral3"})}),l.jsx(lnr,{data:r,open:t,onOpenChange:n})]})},lnr=({data:e,open:t,onOpenChange:n})=>l.jsx(Mr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{className:"max-w-4xl h-[80vh]",children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"Text preview"}),l.jsx(ys,{children:"Preview of the text file"})]}),l.jsx($r,{children:t&&l.jsx("div",{className:"whitespace-pre-wrap",children:e})})]})}),cnr={sm:`${Yl.sm} w-form-sm`,md:`${Yl.md} w-form-md`,lg:`${Yl.lg} w-form-lg`,default:`${Yl.default}`},unr={sm:"sm",md:"default",lg:"lg",default:"default"},dnr={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none"},fnr="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",cs=Oe.forwardRef(({className:e,children:t,tooltip:n,size:r="md",variant:a="default",disabled:s,...i},o)=>l.jsxs(er,{children:[l.jsx(tr,{asChild:!0,children:l.jsx("button",{ref:o,disabled:s,"aria-label":typeof n=="string"?n:void 0,className:Y(fnr,hR,dnr[a],cnr[r],s&&"active:scale-100",e),...i,children:l.jsx(xe,{size:unr[r],children:t})})}),l.jsx(Kn,{children:n})]}));cs.displayName="IconButton";const pnr={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Jt({color:e,className:t,size:n="md"}){return l.jsx("svg",{className:Y("animate-spin",pnr[n],t),style:{animationDuration:"800ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}const Ryt=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;typeof a=="string"?t(a):n(new Error("Failed to convert file to base64."))},r.onerror=a=>{n(a)},r.readAsDataURL(e)}),hnr=({document:e})=>{const{isLoading:t,text:n}=snr(e.file);return l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t?l.jsx(Jt,{className:"animate-spin"}):l.jsx(Iyt,{data:n})})},mnr=({document:e})=>{const[t,n]=x.useState({isLoading:!1,text:""});x.useEffect(()=>{let a=!1;return(async()=>{if(!e.file)return;n(o=>({...o,isLoading:!0}));const i=await Ryt(e.file);a||n(o=>({...o,isLoading:!1,text:i}))})(),()=>{a=!0}},[e]);const r=e.file?.name.startsWith("https://");return l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.isLoading?l.jsx(Jt,{className:"animate-spin"}):l.jsx(Nyt,{data:t.text,url:r?e.file?.name:void 0})})},gnr=()=>{const e=cD(i=>i.type==="image"),t=cD(i=>i.type==="document"?i:void 0),n=rnr(),r=cD(i=>i.source!=="message"),s=t?.file?.name.startsWith("https://")?t?.file?.name:n;return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"relative",children:[l.jsx($5,{children:l.jsxs(er,{children:[l.jsx(WKe,{children:l.jsx(tr,{asChild:!0,children:l.jsx("div",{className:"overflow-hidden size-16 rounded-lg bg-surface3 border border-border1 ",children:e?l.jsx(Ayt,{src:s??""}):t?.contentType==="application/pdf"?l.jsx(mnr,{document:t}):t?l.jsx(hnr,{document:t}):null})})}),l.jsx(Kn,{side:"top",children:l.jsx(ZKe,{})})]})}),r&&l.jsx(vnr,{})]})})},vnr=()=>l.jsx(zqt,{asChild:!0,children:l.jsx(cs,{variant:"light",size:"md",tooltip:"Remove file",className:"absolute -right-3 -top-3 text-neutral3 hover:text-neutral6 bg-surface1 hover:bg-surface2 rounded-full p-1",children:l.jsx(xe,{children:l.jsx(xb,{})})})}),ynr=()=>anr()?l.jsx("div",{className:"flex w-full flex-row items-center gap-4 pb-2",children:l.jsx($We,{components:{Attachment:gnr}})}):null;function bnr({containerRef:e}){const[t,n]=x.useState([]),[r,a]=x.useState(null),s=x.useRef(""),i=x.useRef(0),o=x.useCallback(()=>{const u=e.current;if(!u){s.current!==""&&(s.current="",n([]));return}const d=u.getBoundingClientRect(),f=Array.from(u.querySelectorAll("[data-om-badge]"));if(f.length===0){s.current!==""&&(s.current="",n([]));return}const p=[];for(let m=0;m<f.length;m++){const g=f[m],v=g.getAttribute("data-om-badge")||"",b=g.getAttribute("data-om-state")||"complete",S=g.getAttribute("data-om-type")||"observation",O=g.getBoundingClientRect();let k;const E=xnr(f,m,S);if(E){const A=parseFloat(getComputedStyle(E).marginBottom)||0;k=E.getBoundingClientRect().bottom+A-d.top}else k=0;const C=parseFloat(getComputedStyle(g).marginBottom)||0,j=O.bottom+C-d.top-k;j<=0||p.push({cycleId:v,omType:S,state:b,top:k,height:j})}const h=JSON.stringify(p);h!==s.current&&(s.current=h,n(p))},[e]);if(x.useEffect(()=>{const u=e.current;if(!u)return;o();const d=new ResizeObserver(()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(o)});d.observe(u);const f=new MutationObserver(()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(o)});return f.observe(u,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(i.current),d.disconnect(),f.disconnect()}},[o,e]),x.useEffect(()=>{const u=e.current;if(!u)return;const d=p=>{const h=p.target.closest("[data-om-badge]");h&&a(h.getAttribute("data-om-badge"))},f=p=>{p.target.closest("[data-om-badge]")&&a(null)};return u.addEventListener("mouseover",d),u.addEventListener("mouseout",f),()=>{u.removeEventListener("mouseover",d),u.removeEventListener("mouseout",f)}},[e]),t.length===0)return null;const c=t[t.length-1]?.cycleId??null;return l.jsx("div",{className:"pointer-events-none absolute inset-0",style:{zIndex:0},children:t.map(u=>{const d=u.cycleId===c,f=u.cycleId===r,p=r?f:d;return l.jsx(wnr,{highlight:u,visible:p},u.cycleId)})})}function xnr(e,t,n){for(let r=t-1;r>=0;r--){const a=e[r];if(a.getAttribute("data-om-state")!=="failed"&&(n==="observation"||a.getAttribute("data-om-type")==="reflection"))return a}return null}function wnr({highlight:e,visible:t}){const n=Snr(e.state),r=e.state.startsWith("buffering");return l.jsx("div",{className:"absolute left-0 right-0 transition-opacity duration-200",style:{top:e.top,height:e.height,border:`3px ${r?"dashed":"solid"} ${n}`,borderRadius:"0.5rem",opacity:t?1:0}})}function Snr(e){switch(e){case"complete":return"rgba(34, 197, 94, 0.4)";case"loading":return"rgba(59, 130, 246, 0.4)";case"failed":return"rgba(239, 68, 68, 0.4)";case"disconnected":return"rgba(234, 179, 8, 0.4)";case"buffering":return"rgba(168, 85, 247, 0.4)";case"buffering-complete":return"rgba(168, 85, 247, 0.4)";case"buffering-failed":return"rgba(239, 68, 68, 0.4)";case"activated":return"rgba(34, 197, 94, 0.4)";default:return"rgba(34, 197, 94, 0.4)"}}const Vn={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},tx={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},Onr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},knr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},ut=({icon:e,variant:t="default",className:n,children:r,...a})=>l.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",Vn.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":Onr[t],n),...a,children:[e&&l.jsx("span",{className:knr[t],children:l.jsx(xe,{children:e})}),r]}),Fz=({children:e,initialCollapsed:t=!0,icon:n,title:r,collapsible:a=!0,extraInfo:s,"data-testid":i})=>{const[o,c]=x.useState(t);return x.useEffect(()=>{c(t)},[t]),l.jsxs("div",{className:"mb-4","data-testid":i,children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[l.jsxs("button",{onClick:a?()=>c(u=>!u):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!a,type:"button",children:[l.jsx(xe,{children:l.jsx(Gw,{className:Y("transition-all",o?"rotate-90":"rotate-180")})}),l.jsx(ut,{icon:n,children:r})]}),s]}),!o&&l.jsx("div",{className:"pt-2",children:l.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})};function _nr(e,t=5){if(!e?.properties)return[];const n=[];function r(a,s,i){if(i>t)return;const o=Array.isArray(a.type)?a.type.join(" | "):a.type;if(n.push({path:s,label:s,description:a.description??a.title,type:o}),a.properties)for(const[c,u]of Object.entries(a.properties))r(u,`${s}.${c}`,i+1);if(a.items?.properties)for(const[c,u]of Object.entries(a.items.properties))r(u,`${s}[].${c}`,i+1)}for(const[a,s]of Object.entries(e.properties))r(s,a,1);return n}function Enr(e){const t=_nr(e);return Tnt({override:[Cnr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function Cnr(e){return t=>{const r=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!r)return null;const a=r[1]??"",s=t.pos-a.length,i=a?e.filter(c=>c.path.toLowerCase().startsWith(a.toLowerCase())):e;if(i.length===0)return null;const o=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,p)=>{const g=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:g},selection:{anchor:f+g.length}})}}));return{from:s,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const jnr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,Tnr=tn.mark({class:"cm-variable-highlight"}),O5e=new Htt({regexp:jnr,decoration:()=>Tnr}),Nnr=mi.fromClass(class{decorations;constructor(e){this.decorations=O5e.createDeco(e)}update(e){this.decorations=O5e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),Anr=Nnr,Inr={duration:5e3,cancel:{label:l.jsx(xe,{children:l.jsx(Sr,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-lg gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card [&>[data-content]]:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"!bg-transparent hover:!bg-surface2 !border-none !rounded-md !p-1.5 !m-0 !text-neutral3 hover:!text-neutral6 shrink-0 transition-all",actionButton:"!bg-white flex items-center justify-center font-medium !text-black order-last hover:opacity-80"}};function Ed(e){const{classNames:t,...n}=Inr,{classNames:r,...a}=e||{};return{...n,classNames:{...t,title:Y(t?.title,r?.title),toast:Y(t?.toast,r?.toast),cancelButton:Y(t?.cancelButton,r?.cancelButton),actionButton:Y(t?.actionButton,r?.actionButton),description:Y(t?.description,r?.description)},...a}}const De=(e,t={})=>{if(Array.isArray(e))return e.forEach(n=>Jl(n,Ed(t)));if(Oe.isValidElement(e))return Jl(e,Ed(t));if(typeof e=="string")return Jl(e,Ed(t));throw new Error("Invalid message type")};De.success=(e,t={})=>{const n={...t,icon:l.jsx(xe,{className:"text-accent1 shrink-0",children:l.jsx(b6,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Jl.success(e,Ed(n));case"object":return e.forEach(r=>Jl.success(r,Ed(n)))}};De.error=(e,t={})=>{const n={...t,icon:l.jsx(xe,{className:"text-accent2 shrink-0",children:l.jsx(xb,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Jl.error(e,Ed(n));case"object":return e.forEach(r=>Jl.error(r,Ed(n)))}};De.warning=(e,t={})=>{const n={...t,icon:l.jsx(xe,{className:"text-accent6 shrink-0",children:l.jsx(Af,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Jl.warning(e,Ed(n));case"object":return e.forEach(r=>Jl.warning(r,Ed(n)))}};De.info=(e,t={})=>{const n={...t,icon:l.jsx(xe,{className:"text-accent3 shrink-0",children:l.jsx(Gl,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Jl.info(e,Ed(n));case"object":return e.forEach(r=>Jl.info(r,Ed(n)))}};De.custom=(e,t={})=>Jl(e,Ed(t));De.dismiss=e=>{e&&Jl.dismiss(e)};De.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:a,onError:s,options:i={}})=>Jl.promise(e,{loading:t??"Loading...",success:o=>(a?.(o),n),error:o=>(s?.(o),r||o?.message||"Error..."),...Ed(i)});function Vf({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=x.useState(!1),a=x.useRef(null),s=x.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{De.success(t),r(!0),a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{De.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:s}}function ho({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:a}){const[s,i]=x.useState(!1),{handleCopy:o}=Vf({text:e,copyMessage:t}),c=()=>{o(),i(!0),setTimeout(()=>i(!1),2e3)};return l.jsxs(er,{children:[l.jsx(tr,{asChild:!0,children:l.jsx(he,{onClick:c,type:"button",size:r,className:a,"aria-label":s?"Copied!":n,children:s?l.jsx(va,{}):l.jsx(tc,{})})}),l.jsx(Kn,{children:s?"Copied!":n})]})}const kv=()=>x.useMemo(()=>{const e=Q6({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)"},styles:[{tag:[fe.className,fe.propertyName],color:"var(--neutral6)"},{tag:fe.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[fe.heading1,fe.heading2,fe.heading3,fe.heading4,fe.heading5,fe.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:fe.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:fe.link,color:"var(--accent3)",textDecoration:"underline"},{tag:fe.url,color:"var(--accent3)"},{tag:fe.monospace,color:"var(--neutral6)"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=vt.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]},[]),os=x.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:a,language:s="json",highlightVariables:i=!1,placeholder:o,schema:c,autoFocus:u,lineNumbers:d=!0,...f},p)=>{const h=kv(),m=e?JSON.stringify(e,null,2):t??"",g=x.useMemo(()=>{const v=[];return s==="json"?v.push(Sd):s==="markdown"&&(v.push(mde({base:lw,codeLanguages:Xrt})),v.push(vt.lineWrapping)),i&&s==="markdown"&&v.push(Anr),c&&s==="markdown"&&v.push(Enr(c)),v},[s,i,c]);return l.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",a),...f,children:[r&&l.jsx(ho,{content:m,className:"absolute top-2 right-2 z-20"}),l.jsx(Id,{ref:p,value:m,theme:h,extensions:g,onChange:n,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function Rnr(e,t){const{codeToTokens:n,bundledLanguages:r}=await Qe(async()=>{const{codeToTokens:s,bundledLanguages:i}=await import("./index-DX8k1Ij6.js");return{codeToTokens:s,bundledLanguages:i}},__vite__mapDeps([26,2]),import.meta.url);if(!(t in r))return null;const{tokens:a}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return a}const Pnr=({selectionReason:e,open:t,onOpenChange:n,input:r})=>{let a=null;if(r)try{a=typeof r=="object"?l.jsx(os,{data:r}):l.jsx(os,{data:JSON.parse(r)})}catch{a=l.jsx("pre",{className:"whitespace-pre-wrap",children:r})}return l.jsx(Mr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"Agent Network Metadata"}),l.jsx(ys,{children:"View the metadata of the agent's network choice."})]}),l.jsxs($r,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(pe,{className:"text-neutral3",children:"Selection Reason"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),a&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(pe,{className:"text-neutral3",children:"Input"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:a})]})]})]})})},Ume=({selectionReason:e,input:t})=>{const[n,r]=x.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(cs,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>r(a=>!a),children:l.jsx(VWt,{className:"text-neutral3 size-5"})}),l.jsx(Pnr,{selectionReason:e||"",open:n,onOpenChange:r,input:t})]})},Pyt=x.createContext(void 0);function Mnr({children:e,approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:a,approveNetworkToolcall:s,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:c,networkToolCallApprovals:u}){return l.jsx(Pyt.Provider,{value:{approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:a,approveNetworkToolcall:s,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:c,networkToolCallApprovals:u},children:e})}function Dnr(){const e=x.useContext(Pyt);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const mR=({toolCalled:e,toolCallId:t,toolApprovalMetadata:n,toolName:r,isNetwork:a,isGenerateMode:s})=>{const{approveToolcall:i,declineToolcall:o,approveToolcallGenerate:c,declineToolcallGenerate:u,isRunning:d,toolCallApprovals:f,approveNetworkToolcall:p,declineNetworkToolcall:h,networkToolCallApprovals:m}=Dnr(),g=()=>{a?p(r,n?.runId):s?c(t):i(t)},v=()=>{a?h(r,n?.runId):s?u(t):o(t)},b=a?m?.[n?.runId?`${n.runId}-${r}`:r]?.status:f?.[t]?.status;return n&&!e?l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Approval required"}),l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxs(he,{onClick:g,disabled:d||!!b,className:b==="approved"?"!text-accent1":"",children:[l.jsx(xe,{children:l.jsx(va,{})}),"Approve"]}),l.jsxs(he,{onClick:v,disabled:d||!!b,className:b==="declined"?"!text-accent2":"",children:[l.jsx(xe,{children:l.jsx(Sr,{})}),"Decline"]})]})]}):null},$nr=({agentId:e,messages:t=[],metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u=!1})=>{const d=n?.mode==="network"?n.selectionReason:void 0,f=n?.mode==="network"?n.agentInput:void 0;let p=t.length>0;i&&(p=c??t.every(m=>m.type==="text"?!0:!!m.toolOutput));let h=typeof o=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):l.jsx(os,{data:o,"data-testid":"tool-suspend-payload"});return l.jsxs(Fz,{"data-testid":"agent-badge",icon:l.jsx($s,{className:"text-accent1"}),title:e,initialCollapsed:u,extraInfo:n?.mode==="network"&&l.jsx(Ume,{selectionReason:d??"",input:f}),children:[t.map((m,g)=>{if(m.type==="text")return l.jsx(met,{children:m.content},g);let v;try{v=typeof m.toolOutput=="string"?JSON.parse(m.toolOutput):m.toolOutput}catch{v=m.toolOutput}return l.jsx(Oe.Fragment,{children:l.jsx(pbt,{toolName:m.toolName,argsText:typeof m.args=="string"?m.args:JSON.stringify(m.args),result:v,args:m.args,status:{type:"complete"},type:"tool-call",toolCallId:m.toolCallId,addResult:()=>{},resume:()=>{},metadata:{mode:"stream"}})},g)}),h!==void 0&&o&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Agent suspend payload"}),h]}),l.jsx(mR,{toolCalled:p,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,isGenerateMode:n?.mode==="generate"})]})};function In({className:e,...t}){return l.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:translate-x-[-100%]","before:animate-[shimmer_2s_infinite]","before:bg-gradient-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const Vme=()=>l.jsx(Fz,{icon:l.jsx(Jt,{color:C6.neutral3}),title:l.jsx(In,{className:"ml-2 w-12 h-2"}),collapsible:!1}),Lnr=({agentId:e,result:t,metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u})=>{const{data:d,isLoading:f}=iyt({threadId:t?.subAgentThreadId,agentId:e,memory:!0});if(f)return l.jsx(Vme,{});const p=d?.messages?kHe(d.messages):[],h=t?.childMessages??G6t(p);return l.jsx($nr,{agentId:e,messages:h,metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u})},zz=({copiedDuration:e=1500}={})=>{const[t,n]=x.useState(!1);return{isCopied:t,copyToClipboard:a=>{a&&navigator.clipboard.writeText(a).then(()=>{n(!0),setTimeout(()=>n(!1),e)})}}},Myt=x.createContext({Link:x.forwardRef(()=>null),navigate:()=>{},paths:{agentLink:()=>"",agentsLink:()=>"",agentToolLink:()=>"",agentSkillLink:()=>"",agentThreadLink:()=>"",agentNewThreadLink:()=>"",workflowsLink:()=>"",workflowLink:()=>"",networkLink:()=>"",networkNewThreadLink:()=>"",networkThreadLink:()=>"",scorerLink:()=>"",cmsScorersCreateLink:()=>"",cmsScorerEditLink:()=>"",cmsAgentCreateLink:()=>"",cmsAgentEditLink:()=>"",promptBlockLink:()=>"",promptBlocksLink:()=>"",cmsPromptBlockCreateLink:()=>"",cmsPromptBlockEditLink:()=>"",toolLink:()=>"",skillLink:()=>"",workspacesLink:()=>"",workspaceLink:()=>"",workspaceSkillLink:()=>"",processorsLink:()=>"",processorLink:()=>"",mcpServerLink:()=>"",mcpServerToolLink:()=>"",workflowRunLink:()=>"",datasetLink:()=>"",datasetItemLink:()=>"",datasetExperimentLink:()=>""}}),Dyt=({children:e,Link:t,navigate:n,paths:r})=>l.jsx(Myt.Provider,{value:{Link:t,navigate:n,paths:r},children:e}),Nt=()=>{const e=x.useContext(Myt);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},Fnr=({toolName:e,args:t,result:n,toolCallId:r,toolApprovalMetadata:a,isNetwork:s,toolCalled:i})=>{const[o,c]=x.useState(!a),{isCopied:u,copyToClipboard:d}=zz();x.useEffect(()=>{c(!a)},[a]);const{Link:f}=Nt();let p={path:"."};try{p=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h=".",maxDepth:m,showHidden:g,dirsOnly:v,exclude:b,extension:S}=p,O=[];m!==void 0&&m!==3&&O.push(`depth: ${m}`),g&&O.push("hidden"),v&&O.push("dirs only"),b&&O.push(`exclude: ${b}`),S&&O.push(`ext: ${S}`);let k="",E="";if(typeof n=="string"&&n){const M=n.lastIndexOf(`
457
+ `,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!s&&!!r.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=b,u.ParserHandle=g,u.NetworkStreamer=f,u.FileStreamer=p,u.StringStreamer=h,u.ReadableStreamStreamer=m,r.jQuery&&((a=r.jQuery).fn.parse=function(j){var A=j.config||{},I=[];return this.each(function(B){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var D=0;D<this.files.length;D++)I.push({file:this.files[D],inputElem:this,instanceConfig:a.extend({},A)})}),P(),this;function P(){if(I.length===0)T(j.complete)&&j.complete();else{var B,D,V,q,z=I[0];if(T(j.before)){var H=j.before(z.file,z.inputElem);if(typeof H=="object"){if(H.action==="abort")return B="AbortError",D=z.file,V=z.inputElem,q=H.reason,void(T(j.error)&&j.error({name:B},D,V,q));if(H.action==="skip")return void M();typeof H.config=="object"&&(z.instanceConfig=a.extend(z.instanceConfig,H.config))}else if(H==="skip")return void M()}var G=z.instanceConfig.complete;z.instanceConfig.complete=function(L){T(G)&&G(L,z.file,z.inputElem),M()},u.parse(z.file,z.instanceConfig)}}function M(){I.splice(0,1),P()}}),i&&(r.onmessage=function(j){j=j.data,u.WORKER_ID===void 0&&j&&(u.WORKER_ID=j.workerId),typeof j.input=="string"?r.postMessage({workerId:u.WORKER_ID,results:u.parse(j.input,j.config),finished:!0}):(r.File&&j.input instanceof File||j.input instanceof Object)&&(j=u.parse(j.input,j.config))&&r.postMessage({workerId:u.WORKER_ID,results:j,finished:!0})}),(f.prototype=Object.create(d.prototype)).constructor=f,(p.prototype=Object.create(d.prototype)).constructor=p,(h.prototype=Object.create(h.prototype)).constructor=h,(m.prototype=Object.create(d.prototype)).constructor=m,u})})(UD)),UD.exports}var UJn=BJn();const Mvt=yo(UJn);var QLe=1,VJn=.9,qJn=.8,HJn=.17,uJ=.1,dJ=.999,QJn=.9999,GJn=.99,WJn=/[\\\/_+.#"@\[\(\{&]/,ZJn=/[\\\/_+.#"@\[\(\{&]/g,YJn=/[\s-]/,Dvt=/[\s-]/g;function Gae(e,t,n,r,a,s,i){if(s===t.length)return a===e.length?QLe:GJn;var o=`${a},${s}`;if(i[o]!==void 0)return i[o];for(var c=r.charAt(s),u=n.indexOf(c,a),d=0,f,p,h,m;u>=0;)f=Gae(e,t,n,r,u+1,s+1,i),f>d&&(u===a?f*=QLe:WJn.test(e.charAt(u-1))?(f*=qJn,h=e.slice(a,u-1).match(ZJn),h&&a>0&&(f*=Math.pow(dJ,h.length))):YJn.test(e.charAt(u-1))?(f*=VJn,m=e.slice(a,u-1).match(Dvt),m&&a>0&&(f*=Math.pow(dJ,m.length))):(f*=HJn,a>0&&(f*=Math.pow(dJ,u-a))),e.charAt(u)!==t.charAt(s)&&(f*=QJn)),(f<uJ&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(p=Gae(e,t,n,r,u+1,s+2,i),p*uJ>f&&(f=p*uJ)),f>d&&(d=f),u=n.indexOf(c,u+1);return i[o]=d,d}function GLe(e){return e.toLowerCase().replace(Dvt," ")}function XJn(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Gae(e,t,GLe(e),GLe(t),0,0,{})}var _C='[cmdk-group=""]',fJ='[cmdk-group-items=""]',KJn='[cmdk-group-heading=""]',$vt='[cmdk-item=""]',WLe=`${$vt}:not([aria-disabled="true"])`,Wae="cmdk-item-select",N1="data-value",JJn=(e,t,n)=>XJn(e,t,n),Lvt=x.createContext(void 0),pR=()=>x.useContext(Lvt),Fvt=x.createContext(void 0),_me=()=>x.useContext(Fvt),zvt=x.createContext(void 0),Bvt=x.forwardRef((e,t)=>{let n=A1(()=>{var F,R;return{search:"",value:(R=(F=e.value)!=null?F:e.defaultValue)!=null?R:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=A1(()=>new Set),a=A1(()=>new Map),s=A1(()=>new Map),i=A1(()=>new Set),o=Uvt(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...b}=e,S=Zi(),O=Zi(),k=Zi(),E=x.useRef(null),C=uer();jw(()=>{if(d!==void 0){let F=d.trim();n.current.value=F,T.emit()}},[d]),jw(()=>{C(6,B)},[]);let T=x.useMemo(()=>({subscribe:F=>(i.current.add(F),()=>i.current.delete(F)),snapshot:()=>n.current,setState:(F,R,Q)=>{var W,te,se,re;if(!Object.is(n.current[F],R)){if(n.current[F]=R,F==="search")M(),I(),C(1,P);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(k);ae?ae.focus():(W=document.getElementById(S))==null||W.focus()}if(C(7,()=>{var ae;n.current.selectedItemId=(ae=D())==null?void 0:ae.id,T.emit()}),Q||C(5,B),((te=o.current)==null?void 0:te.value)!==void 0){let ae=R??"";(re=(se=o.current).onValueChange)==null||re.call(se,ae);return}}T.emit()}},emit:()=>{i.current.forEach(F=>F())}}),[]),j=x.useMemo(()=>({value:(F,R,Q)=>{var W;R!==((W=s.current.get(F))==null?void 0:W.value)&&(s.current.set(F,{value:R,keywords:Q}),n.current.filtered.items.set(F,A(R,Q)),C(2,()=>{I(),T.emit()}))},item:(F,R)=>(r.current.add(F),R&&(a.current.has(R)?a.current.get(R).add(F):a.current.set(R,new Set([F]))),C(3,()=>{M(),I(),n.current.value||P(),T.emit()}),()=>{s.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let Q=D();C(4,()=>{M(),Q?.getAttribute("id")===F&&P(),T.emit()})}),group:F=>(a.current.has(F)||a.current.set(F,new Set),()=>{s.current.delete(F),a.current.delete(F)}),filter:()=>o.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:S,inputId:k,labelId:O,listInnerRef:E}),[]);function A(F,R){var Q,W;let te=(W=(Q=o.current)==null?void 0:Q.filter)!=null?W:JJn;return F?te(F,n.current.search,R):0}function I(){if(!n.current.search||o.current.shouldFilter===!1)return;let F=n.current.filtered.items,R=[];n.current.filtered.groups.forEach(W=>{let te=a.current.get(W),se=0;te.forEach(re=>{let ae=F.get(re);se=Math.max(ae,se)}),R.push([W,se])});let Q=E.current;V().sort((W,te)=>{var se,re;let ae=W.getAttribute("id"),oe=te.getAttribute("id");return((se=F.get(oe))!=null?se:0)-((re=F.get(ae))!=null?re:0)}).forEach(W=>{let te=W.closest(fJ);te?te.appendChild(W.parentElement===te?W:W.closest(`${fJ} > *`)):Q.appendChild(W.parentElement===Q?W:W.closest(`${fJ} > *`))}),R.sort((W,te)=>te[1]-W[1]).forEach(W=>{var te;let se=(te=E.current)==null?void 0:te.querySelector(`${_C}[${N1}="${encodeURIComponent(W[0])}"]`);se?.parentElement.appendChild(se)})}function P(){let F=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),R=F?.getAttribute(N1);T.setState("value",R||void 0)}function M(){var F,R,Q,W;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let se of r.current){let re=(R=(F=s.current.get(se))==null?void 0:F.value)!=null?R:"",ae=(W=(Q=s.current.get(se))==null?void 0:Q.keywords)!=null?W:[],oe=A(re,ae);n.current.filtered.items.set(se,oe),oe>0&&te++}for(let[se,re]of a.current)for(let ae of re)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(se);break}n.current.filtered.count=te}function B(){var F,R,Q;let W=D();W&&(((F=W.parentElement)==null?void 0:F.firstChild)===W&&((Q=(R=W.closest(_C))==null?void 0:R.querySelector(KJn))==null||Q.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function D(){var F;return(F=E.current)==null?void 0:F.querySelector(`${$vt}[aria-selected="true"]`)}function V(){var F;return Array.from(((F=E.current)==null?void 0:F.querySelectorAll(WLe))||[])}function q(F){let R=V()[F];R&&T.setState("value",R.getAttribute(N1))}function z(F){var R;let Q=D(),W=V(),te=W.findIndex(re=>re===Q),se=W[te+F];(R=o.current)!=null&&R.loop&&(se=te+F<0?W[W.length-1]:te+F===W.length?W[0]:W[te+F]),se&&T.setState("value",se.getAttribute(N1))}function H(F){let R=D(),Q=R?.closest(_C),W;for(;Q&&!W;)Q=F>0?ler(Q,_C):cer(Q,_C),W=Q?.querySelector(WLe);W?T.setState("value",W.getAttribute(N1)):z(F)}let G=()=>q(V().length-1),L=F=>{F.preventDefault(),F.metaKey?G():F.altKey?H(1):z(1)},Z=F=>{F.preventDefault(),F.metaKey?q(0):F.altKey?H(-1):z(-1)};return x.createElement(bo.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:F=>{var R;(R=b.onKeyDown)==null||R.call(b,F);let Q=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||Q))switch(F.key){case"n":case"j":{v&&F.ctrlKey&&L(F);break}case"ArrowDown":{L(F);break}case"p":case"k":{v&&F.ctrlKey&&Z(F);break}case"ArrowUp":{Z(F);break}case"Home":{F.preventDefault(),q(0);break}case"End":{F.preventDefault(),G();break}case"Enter":{F.preventDefault();let W=D();if(W){let te=new Event(Wae);W.dispatchEvent(te)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:fer},c),$z(e,F=>x.createElement(Fvt.Provider,{value:T},x.createElement(Lvt.Provider,{value:j},F))))}),eer=x.forwardRef((e,t)=>{var n,r;let a=Zi(),s=x.useRef(null),i=x.useContext(zvt),o=pR(),c=Uvt(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i?.forceMount;jw(()=>{if(!u)return o.item(a,i?.id)},[u]);let d=Vvt(a,s,[e.value,e.children,s],e.keywords),f=_me(),p=Ab(C=>C.value&&C.value===d.current),h=Ab(C=>u||o.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);x.useEffect(()=>{let C=s.current;if(!(!C||e.disabled))return C.addEventListener(Wae,m),()=>C.removeEventListener(Wae,m)},[h,e.onSelect,e.disabled]);function m(){var C,T;g(),(T=(C=c.current).onSelect)==null||T.call(C,d.current)}function g(){f.setState("value",d.current,!0)}if(!h)return null;let{disabled:v,value:b,onSelect:S,forceMount:O,keywords:k,...E}=e;return x.createElement(bo.div,{ref:dm(s,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||o.getDisablePointerSelection()?void 0:g,onClick:v?void 0:m},e.children)}),ter=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...s}=e,i=Zi(),o=x.useRef(null),c=x.useRef(null),u=Zi(),d=pR(),f=Ab(h=>a||d.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);jw(()=>d.group(i),[]),Vvt(i,o,[e.value,e.heading,c]);let p=x.useMemo(()=>({id:i,forceMount:a}),[a]);return x.createElement(bo.div,{ref:dm(o,t),...s,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),$z(e,h=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},x.createElement(zvt.Provider,{value:p},h))))}),ner=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),s=Ab(i=>!i.search);return!n&&!s?null:x.createElement(bo.div,{ref:dm(a,t),...r,"cmdk-separator":"",role:"separator"})}),rer=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,s=_me(),i=Ab(u=>u.search),o=Ab(u=>u.selectedItemId),c=pR();return x.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),x.createElement(bo.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:a?e.value:i,onChange:u=>{a||s.setState("search",u.target.value),n?.(u.target.value)}})}),aer=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,s=x.useRef(null),i=x.useRef(null),o=Ab(u=>u.selectedItemId),c=pR();return x.useEffect(()=>{if(i.current&&s.current){let u=i.current,d=s.current,f,p=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(f),p.unobserve(u)}}},[]),x.createElement(bo.div,{ref:dm(s,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},$z(e,u=>x.createElement("div",{ref:dm(i,c.listInnerRef),"cmdk-list-sizer":""},u)))}),ser=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:s,container:i,...o}=e;return x.createElement(X5,{open:n,onOpenChange:r},x.createElement(K5,{container:i},x.createElement(iI,{"cmdk-overlay":"",className:a}),x.createElement(oI,{"aria-label":e.label,"cmdk-dialog":"",className:s},x.createElement(Bvt,{ref:t,...o}))))}),ier=x.forwardRef((e,t)=>Ab(n=>n.filtered.count===0)?x.createElement(bo.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),oer=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...s}=e;return x.createElement(bo.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},$z(e,i=>x.createElement("div",{"aria-hidden":!0},i)))}),zu=Object.assign(Bvt,{List:aer,Item:eer,Input:rer,Group:ter,Separator:ner,Dialog:ser,Empty:ier,Loading:oer});function ler(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function cer(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Uvt(e){let t=x.useRef(e);return jw(()=>{t.current=e}),t}var jw=typeof window>"u"?x.useEffect:x.useLayoutEffect;function A1(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ab(e){let t=_me(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Vvt(e,t,n,r=[]){let a=x.useRef(),s=pR();return jw(()=>{var i;let o=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():a.current}})(),c=r.map(u=>u.trim());s.value(e,o,c),(i=t.current)==null||i.setAttribute(N1,o),a.current=o}),a}var uer=()=>{let[e,t]=x.useState(),n=A1(()=>new Map);return jw(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function der(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function $z({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(der(t),{ref:t.ref},n(t.props.children)):n(t)}var fer={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};class io{constructor(t,n,r,a){this.fromA=t,this.toA=n,this.fromB=r,this.toB=a}offset(t,n=t){return new io(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}}function Tw(e,t,n,r,a,s){if(e==r)return[];let i=Cme(e,t,n,r,a,s),o=jme(e,t+i,n,r,a+i,s);t+=i,n-=o,a+=i,s-=o;let c=n-t,u=s-a;if(!c||!u)return[new io(t,n,a,s)];if(c>u){let f=e.slice(t,n).indexOf(r.slice(a,s));if(f>-1)return[new io(t,t+f,a,a),new io(t+f+u,n,s,s)]}else if(u>c){let f=r.slice(a,s).indexOf(e.slice(t,n));if(f>-1)return[new io(t,t,a,a+f),new io(n,n,a+f+c,s)]}if(c==1||u==1)return[new io(t,n,a,s)];let d=Qvt(e,t,n,r,a,s);if(d){let[f,p,h]=d;return Tw(e,t,f,r,a,p).concat(Tw(e,f+h,n,r,p+h,s))}return per(e,t,n,r,a,s)}let oj=1e9,lj=0,Eme=!1;function per(e,t,n,r,a,s){let i=n-t,o=s-a;if(oj<1e9&&Math.min(i,o)>oj*16||lj>0&&Date.now()>lj)return Math.min(i,o)>oj*64?[new io(t,n,a,s)]:ZLe(e,t,n,r,a,s);let c=Math.ceil((i+o)/2);pJ.reset(c),hJ.reset(c);let u=(h,m)=>e.charCodeAt(t+h)==r.charCodeAt(a+m),d=(h,m)=>e.charCodeAt(n-h-1)==r.charCodeAt(s-m-1),f=(i-o)%2!=0?hJ:null,p=f?null:pJ;for(let h=0;h<c;h++){if(h>oj||lj>0&&!(h&63)&&Date.now()>lj)return ZLe(e,t,n,r,a,s);let m=pJ.advance(h,i,o,c,f,!1,u)||hJ.advance(h,i,o,c,p,!0,d);if(m)return her(e,t,n,t+m[0],r,a,s,a+m[1])}return[new io(t,n,a,s)]}class qvt{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,n,r,a,s,i,o){for(let c=-t+this.start;c<=t-this.end;c+=2){let u=a+c,d=c==-t||c!=t&&this.vec[u-1]<this.vec[u+1]?this.vec[u+1]:this.vec[u-1]+1,f=d-c;for(;d<n&&f<r&&o(d,f);)d++,f++;if(this.vec[u]=d,d>n)this.end+=2;else if(f>r)this.start+=2;else if(s){let p=a+(n-r)-c;if(p>=0&&p<this.len&&s.vec[p]!=-1)if(i){let h=s.vec[p];if(h>=n-d)return[h,a+h-p]}else{let h=n-s.vec[p];if(d>=h)return[d,f]}}}return null}}const pJ=new qvt,hJ=new qvt;function her(e,t,n,r,a,s,i,o){let c=!1;return!Fk(e,r)&&++r==n&&(c=!0),!Fk(a,o)&&++o==i&&(c=!0),c?[new io(t,n,s,i)]:Tw(e,t,r,a,s,o).concat(Tw(e,r,n,a,o,i))}function Hvt(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n=n<<1;return n}function Cme(e,t,n,r,a,s){if(t==n||t==s||e.charCodeAt(t)!=r.charCodeAt(a))return 0;let i=Hvt(n-t,s-a);for(let o=t,c=a;;){let u=o+i,d=c+i;if(u>n||d>s||e.slice(o,u)!=r.slice(c,d)){if(i==1)return o-t-(Fk(e,o)?0:1);i=i>>1}else{if(u==n||d==s)return u-t;o=u,c=d}}}function jme(e,t,n,r,a,s){if(t==n||a==s||e.charCodeAt(n-1)!=r.charCodeAt(s-1))return 0;let i=Hvt(n-t,s-a);for(let o=n,c=s;;){let u=o-i,d=c-i;if(u<t||d<a||e.slice(u,o)!=r.slice(d,c)){if(i==1)return n-o-(Fk(e,o)?0:1);i=i>>1}else{if(u==t||d==a)return n-u;o=u,c=d}}}function Zae(e,t,n,r,a,s,i,o){let c=r.slice(a,s),u=null;for(;;){if(u||i<o)return u;for(let d=t+i;;){Fk(e,d)||d++;let f=d+i;if(Fk(e,f)||(f+=f==d+1?1:-1),f>=n)break;let p=e.slice(d,f),h=-1;for(;(h=c.indexOf(p,h+1))!=-1;){let m=Cme(e,f,n,r,a+h+p.length,s),g=jme(e,t,d,r,a,a+h),v=p.length+m+g;(!u||u[2]<v)&&(u=[d-g,a+h-g,v])}d=f}if(o<0)return u;i=i>>1}}function Qvt(e,t,n,r,a,s){let i=n-t,o=s-a;if(i<o){let c=Qvt(r,a,s,e,t,n);return c&&[c[1],c[0],c[2]]}return i<4||o*2<i?null:Zae(e,t,n,r,a,s,Math.floor(i/4),-1)}function ZLe(e,t,n,r,a,s){Eme=!0;let i=n-t,o=s-a,c;if(i<o){let p=Zae(r,a,s,e,t,n,Math.floor(i/6),50);c=p&&[p[1],p[0],p[2]]}else c=Zae(e,t,n,r,a,s,Math.floor(o/6),50);if(!c)return[new io(t,n,a,s)];let[u,d,f]=c;return Tw(e,t,u,r,a,d).concat(Tw(e,u+f,n,r,d+f,s))}function Gvt(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],a=e[n];r.toA>a.fromA-t&&r.toB>a.fromB-t&&(e[n-1]=new io(r.fromA,a.toA,r.fromB,a.toB),e.splice(n--,1))}}function mer(e,t,n){for(;;){Gvt(n,1);let r=!1;for(let a=0;a<n.length;a++){let s=n[a],i,o;(i=Cme(e,s.fromA,s.toA,t,s.fromB,s.toB))&&(s=n[a]=new io(s.fromA+i,s.toA,s.fromB+i,s.toB)),(o=jme(e,s.fromA,s.toA,t,s.fromB,s.toB))&&(s=n[a]=new io(s.fromA,s.toA-o,s.fromB,s.toB-o));let c=s.toA-s.fromA,u=s.toB-s.fromB;if(c&&u)continue;let d=s.fromA-(a?n[a-1].toA:0),f=(a<n.length-1?n[a+1].fromA:e.length)-s.toA;if(!d||!f)continue;let p=c?e.slice(s.fromA,s.toA):t.slice(s.fromB,s.toB);d<=p.length&&e.slice(s.fromA-d,s.fromA)==p.slice(p.length-d)?(n[a]=new io(s.fromA-d,s.toA-d,s.fromB-d,s.toB-d),r=!0):f<=p.length&&e.slice(s.toA,s.toA+f)==p.slice(0,f)&&(n[a]=new io(s.fromA+f,s.toA+f,s.fromB+f,s.toB+f),r=!0)}if(!r)break}return n}function ger(e,t,n){for(let r=0,a=0;a<e.length;a++){let s=e[a],i=s.toA-s.fromA,o=s.toB-s.fromB;if(i&&o||i>3||o>3){let c=a==e.length-1?t.length:e[a+1].fromA,u=s.fromA-r,d=c-s.toA,f=XLe(t,s.fromA,u),p=YLe(t,s.toA,d),h=s.fromA-f,m=p-s.toA;if((!i||!o)&&h&&m){let g=Math.max(i,o),[v,b,S]=i?[t,s.fromA,s.toA]:[n,s.fromB,s.toB];g>h&&t.slice(f,s.fromA)==v.slice(S-h,S)?(s=e[a]=new io(f,f+i,s.fromB-h,s.toB-h),f=s.fromA,p=YLe(t,s.toA,c-s.toA)):g>m&&t.slice(s.toA,p)==v.slice(b,b+m)&&(s=e[a]=new io(p-i,p,s.fromB+m,s.toB+m),p=s.toA,f=XLe(t,s.fromA,s.fromA-r)),h=s.fromA-f,m=p-s.toA}if(h||m)s=e[a]=new io(s.fromA-h,s.toA+m,s.fromB-h,s.toB+m);else if(i){if(!o){let g=JLe(t,s.fromA,s.toA),v,b=g<0?-1:KLe(t,s.toA,s.fromA);g>-1&&(v=g-s.fromA)<=d&&t.slice(s.fromA,g)==t.slice(s.toA,s.toA+v)?s=e[a]=s.offset(v):b>-1&&(v=s.toA-b)<=u&&t.slice(s.fromA-v,s.fromA)==t.slice(b,s.toA)&&(s=e[a]=s.offset(-v))}}else{let g=JLe(n,s.fromB,s.toB),v,b=g<0?-1:KLe(n,s.toB,s.fromB);g>-1&&(v=g-s.fromB)<=d&&n.slice(s.fromB,g)==n.slice(s.toB,s.toB+v)?s=e[a]=s.offset(v):b>-1&&(v=s.toB-b)<=u&&n.slice(s.fromB-v,s.fromB)==n.slice(b,s.toB)&&(s=e[a]=s.offset(-v))}}r=s.toA}return Gvt(e,3),e}let A0;try{A0=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Wvt(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Zvt(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?Wvt(n)?1:0:A0?!Kvt(n)||t==e.length-1?A0.test(String.fromCharCode(n))?1:0:A0.test(e.slice(t,t+2))?2:0:0}function Yvt(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?Wvt(n)?1:0:A0?!Jvt(n)||t==1?A0.test(String.fromCharCode(n))?1:0:A0.test(e.slice(t-2,t))?2:0:0}const Xvt=8;function YLe(e,t,n){if(t==e.length||!Yvt(e,t))return t;for(let r=t,a=t+n,s=0;s<Xvt;s++){let i=Zvt(e,r);if(!i||r+i>a)return r;r+=i}return t}function XLe(e,t,n){if(!t||!Zvt(e,t))return t;for(let r=t,a=t-n,s=0;s<Xvt;s++){let i=Yvt(e,r);if(!i||r-i<a)return r;r-=i}return t}function KLe(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function JLe(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}const Kvt=e=>e>=55296&&e<=56319,Jvt=e=>e>=56320&&e<=57343;function Fk(e,t){return!t||t==e.length||!Kvt(e.charCodeAt(t-1))||!Jvt(e.charCodeAt(t))}function ver(e,t,n){var r;let a=n?.override;return a?a(e,t):(oj=((r=n?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,lj=n?.timeout?Date.now()+n.timeout:0,Eme=!1,mer(e,t,Tw(e,0,e.length,t,0,t.length)))}function eyt(){return!Eme}function tyt(e,t,n){return ger(ver(e,t,n),e,t)}const Bh=Zt.define({combine:e=>e[0]}),Yae=Xn.define(),yer=Zt.define(),zk=Yi.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(Yae)&&(e=n.value);for(let n of t.state.facet(yer))e=n(e,t);return e}});class TO{constructor(t,n,r,a,s,i=!0){this.changes=t,this.fromA=n,this.toA=r,this.fromB=a,this.toB=s,this.precise=i}offset(t,n){return t||n?new TO(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(t,n,r){let a=tyt(t.toString(),n.toString(),r);return nyt(a,t,n,0,0,eyt())}static updateA(t,n,r,a,s){return a5e(r5e(t,a,!0,r.length),t,n,r,s)}static updateB(t,n,r,a,s){return a5e(r5e(t,a,!1,n.length),t,n,r,s)}}function e5e(e,t,n,r){let a=n.lineAt(e),s=r.lineAt(t);return a.to==e&&s.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[a.from,s.from]}function t5e(e,t,n,r){let a=n.lineAt(e),s=r.lineAt(t);return a.from==e&&s.from==t?[e,t]:[a.to+1,s.to+1]}function nyt(e,t,n,r,a,s){let i=[];for(let o=0;o<e.length;o++){let c=e[o],[u,d]=e5e(c.fromA+r,c.fromB+a,t,n),[f,p]=t5e(c.toA+r,c.toB+a,t,n),h=[c.offset(-u+r,-d+a)];for(;o<e.length-1;){let m=e[o+1],[g,v]=e5e(m.fromA+r,m.fromB+a,t,n);if(g>f+1&&v>p+1)break;h.push(m.offset(-u+r,-d+a)),[f,p]=t5e(m.toA+r,m.toB+a,t,n),o++}i.push(new TO(h,u,Math.max(u,f),d,Math.max(d,p),s))}return i}const E2=1e3;function n5e(e,t,n,r){let a=0,s=e.length;for(;;){if(a==s){let d=0,f=0;a&&({toA:d,toB:f}=e[a-1]);let p=t-(n?d:f);return[d+p,f+p]}let i=a+s>>1,o=e[i],[c,u]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(c>t)s=i;else if(u<=t)a=i+1;else return r?[o.fromA,o.fromB]:[o.toA,o.toB]}}function r5e(e,t,n,r){let a=[];return t.iterChangedRanges((s,i,o,c)=>{let u=0,d=n?t.length:r,f=0,p=n?r:t.length;s>E2&&([u,f]=n5e(e,s-E2,n,!0)),i<t.length-E2&&([d,p]=n5e(e,i+E2,n,!1));let h=c-o-(i-s),m,[g,v]=n?[h,0]:[0,h];a.length&&(m=a[a.length-1]).toA>=u?a[a.length-1]={fromA:m.fromA,fromB:m.fromB,toA:d,toB:p,diffA:m.diffA+g,diffB:m.diffB+v}:a.push({fromA:u,toA:d,fromB:f,toB:p,diffA:g,diffB:v})}),a}function a5e(e,t,n,r,a){if(!e.length)return t;let s=[];for(let i=0,o=0,c=0,u=0;;i++){let d=i==e.length?null:e[i],f=d?d.fromA+o:n.length,p=d?d.fromB+c:r.length;for(;u<t.length;){let v=t[u];if(d&&(v.toA+o>f||v.toB+c>p))break;s.push(v.offset(o,c)),u++}if(!d)break;let h=d.toA+o+d.diffA,m=d.toB+c+d.diffB,g=tyt(n.sliceString(f,h),r.sliceString(p,m),a);for(let v of nyt(g,n,r,f,p,eyt()))s.push(v);for(o+=d.diffA,c+=d.diffB;u<t.length;){let v=t[u];if(v.fromA+o>h&&v.fromB+c>m)break;u++}}return s}const ber={scanLimit:500},ryt=mi.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=o5e(e))}update(e){(e.docChanged||e.viewportChanged||xer(e.startState,e.state)||wer(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=o5e(e.view))}},{decorations:e=>e.deco}),C2=Zp.low(Ztt({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(ryt))===null||t===void 0?void 0:t.gutter)||Pr.empty}}));function xer(e,t){return e.field(zk,!1)!=t.field(zk,!1)}function wer(e,t){return e.facet(Bh)!=t.facet(Bh)}const s5e=tn.line({class:"cm-changedLine"}),Ser=tn.mark({class:"cm-changedText"}),Oer=tn.mark({tagName:"ins",class:"cm-insertedLine"}),ker=tn.mark({tagName:"del",class:"cm-deletedLine"}),i5e=new class extends hm{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function _er(e,t,n,r,a,s){let i=n?e.fromA:e.fromB,o=n?e.toA:e.toB,c=0;if(i!=o){a.add(i,i,s5e),a.add(i,o,n?ker:Oer),s&&s.add(i,i,i5e);for(let u=t.iterRange(i,o-1),d=i;!u.next().done;){if(u.lineBreak){d++,a.add(d,d,s5e),s&&s.add(d,d,i5e);continue}let f=d+u.value.length;if(r)for(;c<e.changes.length;){let p=e.changes[c],h=i+(n?p.fromA:p.fromB),m=i+(n?p.toA:p.toB),g=Math.max(d,h),v=Math.min(f,m);if(g<v&&a.add(g,v,Ser),m<f)c++;else break}d=f}}}function o5e(e){let t=e.state.field(zk),{side:n,highlightChanges:r,markGutter:a,overrideChunk:s}=e.state.facet(Bh),i=n=="a",o=new Au,c=a?new Au:null,{from:u,to:d}=e.viewport;for(let f of t){if((i?f.fromA:f.fromB)>=d)break;(i?f.toA:f.toB)>u&&(!s||!s(e.state,f,o,c))&&_er(f,e.state.doc,i,r,o,c)}return{deco:o.finish(),gutter:c&&c.finish()}}class j2 extends Ud{constructor(t){super(),this.height=t}eq(t){return this.height==t.height}toDOM(){let t=document.createElement("div");return t.className="cm-mergeSpacer",t.style.height=this.height+"px",t}updateDOM(t){return t.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const J3=Xn.define({map:(e,t)=>e.map(t)}),cj=Yi.define({create:()=>tn.none,update:(e,t)=>{for(let n of t.effects)if(n.is(J3))return n.value;return e.map(t.changes)},provide:e=>vt.decorations.from(e)}),T2=.01;function l5e(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function Eer(e,t,n){let r=new Au,a=new Au,s=e.state.field(cj).iter(),i=t.state.field(cj).iter(),o=0,c=0,u=0,d=0,f=e.viewport,p=t.viewport;for(let v=0;;v++){let b=v<n.length?n[v]:null,S=b?b.fromA:e.state.doc.length,O=b?b.fromB:t.state.doc.length;if(o<S){let k=e.lineBlockAt(o).top+u,E=t.lineBlockAt(c).top+d,C=k-E;C<-T2?(u-=C,r.add(o,o,tn.widget({widget:new j2(-C),block:!0,side:-1}))):C>T2&&(d+=C,a.add(c,c,tn.widget({widget:new j2(C),block:!0,side:-1})))}if(S>o+1e3&&o<f.from&&S>f.from&&c<p.from&&O>p.from){let k=Math.min(f.from-o,p.from-c);o+=k,c+=k,v--}else if(b)o=b.toA,c=b.toB;else break;for(;s.value&&s.from<o;)u-=s.value.spec.widget.height,s.next();for(;i.value&&i.from<c;)d-=i.value.spec.widget.height,i.next()}for(;s.value;)u-=s.value.spec.widget.height,s.next();for(;i.value;)d-=i.value.spec.widget.height,i.next();let h=e.contentHeight+u-(t.contentHeight+d);h<T2?r.add(e.state.doc.length,e.state.doc.length,tn.widget({widget:new j2(-h),block:!0,side:1})):h>T2&&a.add(t.state.doc.length,t.state.doc.length,tn.widget({widget:new j2(h),block:!0,side:1}));let m=r.finish(),g=a.finish();l5e(m,e.state.field(cj))||e.dispatch({effects:J3.of(m)}),l5e(g,t.state.field(cj))||t.dispatch({effects:J3.of(g)})}const Xae=Xn.define({map:(e,t)=>t.mapPos(e)});class Cer extends Ud{constructor(t){super(),this.lines=t}eq(t){return this.lines==t.lines}toDOM(t){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=t.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",r=>{let a=t.posAtDOM(r.target);t.dispatch({effects:Xae.of(a)});let{side:s,sibling:i}=t.state.facet(Bh);i&&i().dispatch({effects:Xae.of(jer(a,t.state.field(zk),s=="a"))})}),n}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function jer(e,t,n){let r=0,a=0;for(let s=0;;s++){let i=s<t.length?t[s]:null;if(!i||(n?i.fromA:i.fromB)>=e)return a+(e-r);[r,a]=n?[i.toA,i.toB]:[i.toB,i.toA]}}const Ter=Yi.define({create(e){return tn.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(Xae)&&(e=e.update({filter:r=>r!=n.value}));return e},provide:e=>vt.decorations.from(e)});function c5e({margin:e=3,minSize:t=4}){return Ter.init(n=>Ner(n,e,t))}function Ner(e,t,n){let r=new Au,a=e.facet(Bh).side=="a",s=e.field(zk),i=1;for(let o=0;;o++){let c=o<s.length?s[o]:null,u=o?i+t:1,d=c?e.doc.lineAt(a?c.fromA:c.fromB).number-1-t:e.doc.lines,f=d-u+1;if(f>=n&&r.add(e.doc.line(u).from,e.doc.line(d).to,tn.replace({widget:new Cer(f),block:!0})),!c)break;i=e.doc.lineAt(Math.min(e.doc.length,a?c.toA:c.toB)).number}return r.finish()}const Aer=vt.styleModule.of(new Yg({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),Ier=vt.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),u5e=new b_,N2=new b_;class Rer{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||ber;let n=[Zp.low(ryt),Ier,Aer,cj,vt.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(p=>p.effects.some(h=>h.is(J3)))&&this.measure()})],r=[Bh.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&r.push(C2);let a=Tr.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],vt.editorAttributes.of({class:"cm-merge-a"}),N2.of(r),n]}),s=[Bh.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&s.push(C2);let i=Tr.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],vt.editorAttributes.of({class:"cm-merge-b"}),N2.of(s),n]});this.chunks=TO.build(a.doc,i.doc,this.diffConf);let o=[zk.init(()=>this.chunks),u5e.of(t.collapseUnchanged?c5e(t.collapseUnchanged):[])];a=a.update({effects:Xn.appendConfig.of(o)}).state,i=i.update({effects:Xn.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let c=t.orientation||"a-b",u=document.createElement("div");u.className="cm-mergeViewEditor";let d=document.createElement("div");d.className="cm-mergeViewEditor",this.editorDOM.appendChild(c=="a-b"?u:d),this.editorDOM.appendChild(c=="a-b"?d:u),this.a=new vt({state:a,parent:u,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new vt({state:i,parent:d,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!t.revertControls,t.revertControls=="b-to-a",t.renderRevertControl),t.parent&&t.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(t,n){if(t.some(r=>r.docChanged)){let r=t[t.length-1],a=t.reduce((i,o)=>i.compose(o.changes),ao.empty(t[0].startState.doc.length));this.chunks=n==this.a?TO.updateA(this.chunks,r.newDoc,this.b.state.doc,a,this.diffConf):TO.updateB(this.chunks,this.a.state.doc,r.newDoc,a,this.diffConf),n.update([...t,r.state.update({effects:Yae.of(this.chunks)})]);let s=n==this.a?this.b:this.a;s.update([s.state.update({effects:Yae.of(this.chunks)})]),this.scheduleMeasure()}else n.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let s=t.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let i=this.a.dom.parentNode,o=this.b.dom.parentNode;i.remove(),o.remove(),this.editorDOM.insertBefore(s?i:o,this.editorDOM.firstChild),this.editorDOM.appendChild(s?o:i),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let s=!!this.revertDOM,i=this.revertToA,o=this.renderRevert;"revertControls"in t&&(s=!!t.revertControls,i=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(o=t.renderRevertControl),this.setupRevertControls(s,i,o)}let n="highlightChanges"in t,r="gutter"in t,a="collapseUnchanged"in t;if(n||r||a){let s=[],i=[];if(n||r){let o=this.a.state.facet(Bh),c=r?t.gutter!==!1:o.markGutter,u=n?t.highlightChanges!==!1:o.highlightChanges;s.push(N2.reconfigure([Bh.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:c}),c?C2:[]])),i.push(N2.reconfigure([Bh.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:c}),c?C2:[]]))}if(a){let o=u5e.reconfigure(t.collapseUnchanged?c5e(t.collapseUnchanged):[]);s.push(o),i.push(o)}this.a.dispatch({effects:s}),this.b.dispatch({effects:i})}this.scheduleMeasure()}setupRevertControls(t,n,r){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!t&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):t&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",a=>this.revertClicked(a)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let t=this.dom.ownerDocument.defaultView||window;this.measuring=t.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){Eer(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,n=t.firstChild,r=this.a.viewport,a=this.b.viewport;for(let s=0;s<this.chunks.length;s++){let i=this.chunks[s];if(i.fromA>r.to||i.fromB>a.to)break;if(i.fromA<r.from||i.fromB<a.from)continue;let o=this.a.lineBlockAt(i.fromA).top+"px";for(;n&&+n.dataset.chunk<s;)n=d5e(n);n&&n.dataset.chunk==String(s)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):t.insertBefore(this.renderRevertButton(o,s),n)}for(;n;)n=d5e(n)}renderRevertButton(t,n){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let a=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",a),r.setAttribute("title",a),r.textContent=this.revertToLeft?"⇜":"⇝"}return r.style.top=t,r.setAttribute("data-chunk",String(n)),r}revertClicked(t){let n=t.target,r;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(r=this.chunks[n.dataset.chunk])){let[a,s,i,o,c,u]=this.revertToA?[this.b,this.a,r.fromB,r.toB,r.fromA,r.toA]:[this.a,this.b,r.fromA,r.toA,r.fromB,r.toB],d=a.state.sliceDoc(i,Math.max(i,o-1));i!=o&&u<=s.state.doc.length&&(d+=a.state.lineBreak),s.dispatch({changes:{from:c,to:Math.min(s.state.doc.length,u),insert:d},userEvent:"revert"}),t.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function d5e(e){let t=e.nextSibling;return e.remove(),t}const f5e={modelSettings:{maxRetries:2,maxSteps:5,chatWithGenerateLegacy:!1,chatWithGenerate:!1}};function Per({agentId:e,defaultSettings:t}){const[n,r]=x.useState(t),a=`mastra-agent-store-${e}`;return x.useEffect(()=>{try{const o=localStorage.getItem(a),c=o?JSON.parse(o):{},u={...c,modelSettings:{...f5e.modelSettings,...c?.modelSettings??{},...t?.modelSettings??{}}};r(u)}catch{}},[a,t]),{settings:n,setSettings:o=>{r(c=>({...c,...o})),localStorage.setItem(a,JSON.stringify({...o,agentId:e}))},resetAll:()=>{const o={modelSettings:{...f5e.modelSettings,...t?.modelSettings??{}}};r(o),localStorage.removeItem(a)}}}const ayt=x.createContext({});function Tme({children:e,agentId:t,defaultSettings:n}){const{settings:r,setSettings:a,resetAll:s}=Per({agentId:t,defaultSettings:n});return l.jsx(ayt.Provider,{value:{settings:r,setSettings:a,resetAll:s},children:e})}const Nme=()=>x.useContext(ayt),Fr=ble()($Mt(e=>({requestContext:{},theme:"dark",setRequestContext:t=>e({requestContext:t}),setTheme:t=>e({theme:t})}),{name:"mastra-playground-store"})),Ame=x.createContext(null);function Lz({children:e}){const{requestContext:t}=Fr(),[n,r]=x.useState(t),a=i=>r(i),s=()=>{r({})};return l.jsx(Ame.Provider,{value:{schemaValues:n,setSchemaValues:a,clearSchemaValues:s},children:e})}function syt(){const e=x.useContext(Ame);if(!e)throw new Error("useSchemaRequestContext must be used within a SchemaRequestContextProvider");return e}function ol(){const{requestContext:e}=Fr(),n=x.useContext(Ame)?.schemaValues??{};return{...e??{},...n}}const iyt=({threadId:e,agentId:t,memory:n})=>{const r=We(),{requestContext:a}=Fr();return jt({queryKey:["memory","messages",e,t,"requestContext"],queryFn:async()=>e?await r.listThreadMessages(e,{agentId:t,requestContext:a}):null,enabled:n&&!!e,staleTime:0,gcTime:0,retry:!1,refetchOnWindowFocus:!1})},Mer=({multiple:e=!0,onChange:t}={})=>{const n=D8t(s=>!s.isEditing),r=rI(),a=x.useCallback(()=>{const s=document.createElement("input");s.type="file",s.multiple=e,s.hidden=!0;const i=r.getState().attachmentAccept;i&&i!=="*"&&(s.accept=i),document.body.appendChild(s),s.onchange=o=>{const c=o.target.files;if(c){for(const u of c)r.addAttachment(u),t?.(Array.from(c));document.body.removeChild(s)}},s.oncancel=()=>{(!s.files||s.files.length===0)&&document.body.removeChild(s)},s.click()},[r,e]);if(!n)return a},Yl={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},hR="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",Der="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",$er="rounded-md",Ime="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",Rme="outline-none focus-visible:outline-none focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",Pme="disabled:opacity-50 disabled:cursor-not-allowed";function oyt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=oyt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lyt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=oyt(e))&&(r&&(r+=" "),r+=t);return r}const Ler=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Fer=(e,t)=>({classGroupId:e,validator:t}),cyt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),eL="-",p5e=[],zer="arbitrary..",Ber=e=>{const t=Ver(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Uer(i);const o=i.split(eL),c=o[0]===""&&o.length>1?1:0;return uyt(o,c,t)},getConflictingClassGroupIds:(i,o)=>{if(o){const c=r[i],u=n[i];return c?u?Ler(u,c):c:u||p5e}return n[i]||p5e}}},uyt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const u=uyt(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const o=t===0?e.join(eL):e.slice(t).join(eL),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(o))return d.classGroupId}},Uer=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?zer+r:void 0})(),Ver=e=>{const{theme:t,classGroups:n}=e;return qer(n,t)},qer=(e,t)=>{const n=cyt();for(const r in e){const a=e[r];Mme(a,n,r,t)}return n},Mme=(e,t,n,r)=>{const a=e.length;for(let s=0;s<a;s++){const i=e[s];Her(i,t,n,r)}},Her=(e,t,n,r)=>{if(typeof e=="string"){Qer(e,t,n);return}if(typeof e=="function"){Ger(e,t,n,r);return}Wer(e,t,n,r)},Qer=(e,t,n)=>{const r=e===""?t:dyt(t,e);r.classGroupId=n},Ger=(e,t,n,r)=>{if(Zer(e)){Mme(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Fer(n,e))},Wer=(e,t,n,r)=>{const a=Object.entries(e),s=a.length;for(let i=0;i<s;i++){const[o,c]=a[i];Mme(c,dyt(t,o),n,r)}},dyt=(e,t)=>{let n=e;const r=t.split(eL),a=r.length;for(let s=0;s<a;s++){const i=r[s];let o=n.nextPart.get(i);o||(o=cyt(),n.nextPart.set(i,o)),n=o}return n},Zer=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Yer=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in n?n[s]=i:a(s,i)}}},Kae="!",h5e=":",Xer=[],m5e=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),Ker=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const s=[];let i=0,o=0,c=0,u;const d=a.length;for(let g=0;g<d;g++){const v=a[g];if(i===0&&o===0){if(v===h5e){s.push(a.slice(c,g)),c=g+1;continue}if(v==="/"){u=g;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=s.length===0?a:a.slice(c);let p=f,h=!1;f.endsWith(Kae)?(p=f.slice(0,-1),h=!0):f.startsWith(Kae)&&(p=f.slice(1),h=!0);const m=u&&u>c?u-c:void 0;return m5e(s,h,p,m)};if(t){const a=t+h5e,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):m5e(Xer,!1,i,void 0,!0)}if(n){const a=r;r=s=>n({className:s,parseClassName:a})}return r},Jer=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let s=0;s<n.length;s++){const i=n[s],o=i[0]==="[",c=t.has(i);o||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},etr=e=>({cache:Yer(e.cacheSize),parseClassName:Ker(e),sortModifiers:Jer(e),...Ber(e)}),ttr=/\s+/,ntr=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],o=e.trim().split(ttr);let c="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let v=!!g,b=r(v?m.substring(0,g):m);if(!b){if(!v){c=d+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=d+(c.length>0?" "+c:c);continue}v=!1}const S=p.length===0?"":p.length===1?p[0]:s(p).join(":"),O=h?S+Kae:S,k=O+b;if(i.indexOf(k)>-1)continue;i.push(k);const E=a(b,v);for(let C=0;C<E.length;++C){const T=E[C];i.push(O+T)}c=d+(c.length>0?" "+c:c)}return c},rtr=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=fyt(n))&&(a&&(a+=" "),a+=r);return a},fyt=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=fyt(e[r]))&&(n&&(n+=" "),n+=t);return n},g5e=(e,...t)=>{let n,r,a,s;const i=c=>{const u=t.reduce((d,f)=>f(d),e());return n=etr(u),r=n.cache.get,a=n.cache.set,s=o,o(c)},o=c=>{const u=r(c);if(u)return u;const d=ntr(c,n);return a(c,d),d};return s=i,(...c)=>s(rtr(...c))},atr=[],_o=e=>{const t=n=>n[e]||atr;return t.isThemeGetter=!0,t},pyt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hyt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,str=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,itr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,otr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ltr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ctr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,utr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gy=e=>str.test(e),jr=e=>!!e&&!Number.isNaN(Number(e)),vy=e=>!!e&&Number.isInteger(Number(e)),mJ=e=>e.endsWith("%")&&jr(e.slice(0,-1)),dg=e=>itr.test(e),myt=()=>!0,dtr=e=>otr.test(e)&&!ltr.test(e),Dme=()=>!1,ftr=e=>ctr.test(e),ptr=e=>utr.test(e),htr=e=>!pn(e)&&!yn(e),mtr=e=>ex(e,yyt,Dme),pn=e=>pyt.test(e),Bx=e=>ex(e,byt,dtr),v5e=e=>ex(e,Otr,jr),gtr=e=>ex(e,wyt,myt),vtr=e=>ex(e,xyt,Dme),y5e=e=>ex(e,gyt,Dme),ytr=e=>ex(e,vyt,ptr),A2=e=>ex(e,Syt,ftr),yn=e=>hyt.test(e),EC=e=>uS(e,byt),btr=e=>uS(e,xyt),b5e=e=>uS(e,gyt),xtr=e=>uS(e,yyt),wtr=e=>uS(e,vyt),I2=e=>uS(e,Syt,!0),Str=e=>uS(e,wyt,!0),ex=(e,t,n)=>{const r=pyt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uS=(e,t,n=!1)=>{const r=hyt.exec(e);return r?r[1]?t(r[1]):n:!1},gyt=e=>e==="position"||e==="percentage",vyt=e=>e==="image"||e==="url",yyt=e=>e==="length"||e==="size"||e==="bg-size",byt=e=>e==="length",Otr=e=>e==="number",xyt=e=>e==="family-name",wyt=e=>e==="number"||e==="weight",Syt=e=>e==="shadow",x5e=()=>{const e=_o("color"),t=_o("font"),n=_o("text"),r=_o("font-weight"),a=_o("tracking"),s=_o("leading"),i=_o("breakpoint"),o=_o("container"),c=_o("spacing"),u=_o("radius"),d=_o("shadow"),f=_o("inset-shadow"),p=_o("text-shadow"),h=_o("drop-shadow"),m=_o("blur"),g=_o("perspective"),v=_o("aspect"),b=_o("ease"),S=_o("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...k(),yn,pn],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],j=()=>[yn,pn,c],A=()=>[gy,"full","auto",...j()],I=()=>[vy,"none","subgrid",yn,pn],P=()=>["auto",{span:["full",vy,yn,pn]},vy,yn,pn],M=()=>[vy,"auto",yn,pn],B=()=>["auto","min","max","fr",yn,pn],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...j()],z=()=>[gy,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[gy,"screen","full","dvw","lvw","svw","min","max","fit",...j()],G=()=>[gy,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],L=()=>[e,yn,pn],Z=()=>[...k(),b5e,y5e,{position:[yn,pn]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],R=()=>["auto","cover","contain",xtr,mtr,{size:[yn,pn]}],Q=()=>[mJ,EC,Bx],W=()=>["","none","full",u,yn,pn],te=()=>["",jr,EC,Bx],se=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[jr,mJ,b5e,y5e],oe=()=>["","none",m,yn,pn],de=()=>["none",jr,yn,pn],K=()=>["none",jr,yn,pn],ne=()=>[jr,yn,pn],ie=()=>[gy,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[dg],breakpoint:[dg],color:[myt],container:[dg],"drop-shadow":[dg],ease:["in","out","in-out"],font:[htr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[dg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[dg],shadow:[dg],spacing:["px",jr],text:[dg],"text-shadow":[dg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gy,pn,yn,v]}],container:["container"],columns:[{columns:[jr,pn,yn,o]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[vy,"auto",yn,pn]}],basis:[{basis:[gy,"full","auto",o,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[jr,gy,"auto","initial","none",pn]}],grow:[{grow:["",jr,yn,pn]}],shrink:[{shrink:["",jr,yn,pn]}],order:[{order:[vy,"first","last","none",yn,pn]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...G()]}],"min-block-size":[{"min-block":["auto",...G()]}],"max-block-size":[{"max-block":["none",...G()]}],w:[{w:[o,"screen",...z()]}],"min-w":[{"min-w":[o,"screen","none",...z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,EC,Bx]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Str,gtr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",mJ,pn]}],"font-family":[{font:[btr,vtr,t]}],"font-features":[{"font-features":[pn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,yn,pn]}],"line-clamp":[{"line-clamp":[jr,"none",yn,v5e]}],leading:[{leading:[s,...j()]}],"list-image":[{"list-image":["none",yn,pn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",yn,pn]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[jr,"from-font","auto",yn,Bx]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[jr,"auto",yn,pn]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",yn,pn]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",yn,pn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vy,yn,pn],radial:["",yn,pn],conic:[vy,yn,pn]},wtr,ytr]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[jr,yn,pn]}],"outline-w":[{outline:["",jr,EC,Bx]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,I2,A2]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,I2,A2]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[jr,Bx]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,I2,A2]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[jr,yn,pn]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[jr]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[yn,pn]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[jr]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",yn,pn]}],filter:[{filter:["","none",yn,pn]}],blur:[{blur:oe()}],brightness:[{brightness:[jr,yn,pn]}],contrast:[{contrast:[jr,yn,pn]}],"drop-shadow":[{"drop-shadow":["","none",h,I2,A2]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",jr,yn,pn]}],"hue-rotate":[{"hue-rotate":[jr,yn,pn]}],invert:[{invert:["",jr,yn,pn]}],saturate:[{saturate:[jr,yn,pn]}],sepia:[{sepia:["",jr,yn,pn]}],"backdrop-filter":[{"backdrop-filter":["","none",yn,pn]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[jr,yn,pn]}],"backdrop-contrast":[{"backdrop-contrast":[jr,yn,pn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",jr,yn,pn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jr,yn,pn]}],"backdrop-invert":[{"backdrop-invert":["",jr,yn,pn]}],"backdrop-opacity":[{"backdrop-opacity":[jr,yn,pn]}],"backdrop-saturate":[{"backdrop-saturate":[jr,yn,pn]}],"backdrop-sepia":[{"backdrop-sepia":["",jr,yn,pn]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",yn,pn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[jr,"initial",yn,pn]}],ease:[{ease:["linear","initial",b,yn,pn]}],delay:[{delay:[jr,yn,pn]}],animate:[{animate:["none",S,yn,pn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,yn,pn]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[yn,pn,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",yn,pn]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",yn,pn]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[jr,EC,Bx,v5e]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ktr=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:a={},override:s={}})=>(uj(e,"cacheSize",t),uj(e,"prefix",n),uj(e,"experimentalParseClassName",r),R2(e.theme,s.theme),R2(e.classGroups,s.classGroups),R2(e.conflictingClassGroups,s.conflictingClassGroups),R2(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),uj(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),P2(e.theme,a.theme),P2(e.classGroups,a.classGroups),P2(e.conflictingClassGroups,a.conflictingClassGroups),P2(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Oyt(e,a,"orderSensitiveModifiers"),e),uj=(e,t,n)=>{n!==void 0&&(e[t]=n)},R2=(e,t)=>{if(t)for(const n in t)uj(e,n,t[n])},P2=(e,t)=>{if(t)for(const n in t)Oyt(e,t,n)},Oyt=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},_tr=(e,...t)=>typeof e=="function"?g5e(x5e,e,...t):g5e(()=>ktr(x5e(),e),...t),Etr=Object.keys({...C6,..._Zt}),Ctr=Object.keys(AZt),jtr=Object.keys(EZt),Ttr=Object.keys(CZt),Ntr=Object.keys(kZt),Ux=Object.keys(NZt),Atr=Object.keys(jZt).concat(Object.keys(TZt)),Itr=_tr({extend:{theme:{color:Etr,spacing:Ctr,radius:Ntr,leading:Ttr,shadow:Atr},classGroups:{"font-size":[{text:jtr}],h:[{h:Ux}],w:[{w:Ux}],size:[{size:Ux}],"min-h":[{"min-h":Ux}],"min-w":[{"min-w":Ux}],"max-h":[{"max-h":Ux}],"max-w":[{"max-w":Ux}]}}});function Y(...e){return Itr(lyt(e))}const Rtr={sm:`${Yl.sm} text-ui-sm px-[.75em]`,md:`${Yl.md} text-ui-md px-[.75em]`,default:`${Yl.default} text-ui-md px-[.85em] `,lg:`${Yl.lg} text-ui-lg px-[1em] `},Ptr={default:"bg-surface3 border-2 border-border1 hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral5",primary:"bg-surface4 border-2 border-border2 hover:text-neutral6 hover:bg-surface5 active:bg-surface6 text-neutral6",cta:"bg-accent1/50 hover:bg-accent1/80 text-neutral5 font-semibold",ghost:"bg-transparent border-2 border-transparent hover:text-neutral6 hover:bg-surface4 active:bg-surface5 text-neutral4",inputLike:Ime,light:"",outline:""},Mtr=Y("flex items-center justify-center gap-[.75em] leading-0 transition-colors duration-200 ease-out-custom rounded-lg","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mx-[-.3em]","[&>svg]:opacity-50 [&:hover>svg]:opacity-100",Pme,Rme),Dtr={light:"default",outline:"default"};function $tr(e){return Dtr[e]??e}function z_(e){const t=$tr(e?.variant||"default"),n=e?.size||"default";return Y(Mtr,Ptr[t],Rtr[n],e?.iconOnly&&"[&>svg]:opacity-75")}function kyt(e){const t=[];return Oe.Children.forEach(e,n=>{Oe.isValidElement(n)&&n.type===Oe.Fragment?t.push(...kyt(n.props.children)):t.push(n)}),t}function Ltr(e){const t=kyt(e);return t.length>0&&t.every(n=>Oe.isValidElement(n))}const he=Oe.forwardRef(({className:e,as:t,size:n="default",variant:r="default",disabled:a,children:s,...i},o)=>{const c=t||"button",u=Ltr(s);return l.jsx(c,{ref:o,disabled:a,className:Y(z_({variant:r,size:n,iconOnly:u}),e),...i,children:s})});he.displayName="Button";const Fo=U5t,er=V5t,tr=q5t,Kn=x.forwardRef(({className:e,sideOffset:t=4,children:n,...r},a)=>l.jsx(H5t,{children:l.jsxs(cGe,{ref:a,sideOffset:t,className:Y("z-50 overflow-hidden rounded-md bg-surface6 px-3 py-1.5 text-xs text-neutral4 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r,children:[n,l.jsx(Q5t,{className:"fill-surface6"})]})}));Kn.displayName=cGe.displayName;const hi=Oe.forwardRef(({tooltipContent:e,...t},n)=>l.jsxs(er,{children:[l.jsx(tr,{asChild:!0,children:l.jsx(he,{ref:n,...t})}),e&&l.jsx(Kn,{children:e})]}));hi.displayName="ButtonWithTooltip";const Mr=X5,_yt=bZe,Ftr=K5,Eyt=x.forwardRef(({className:e,...t},n)=>l.jsx(iI,{ref:n,className:Y("fixed inset-0 z-50 bg-overlay backdrop-blur-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Eyt.displayName=iI.displayName;const Nr=x.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Ftr,{children:[l.jsx(Eyt,{}),l.jsxs(oI,{ref:r,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%]","gap-4 border border-border1 bg-surface3 py-6 shadow-dialog rounded-lg","duration-slow","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]","data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...n,children:[t,l.jsxs(t6,{className:Y("absolute right-4 top-4 rounded-md p-1","text-neutral3 hover:text-neutral6 hover:bg-surface4","transition-all duration-normal ease-out-custom","focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring","disabled:pointer-events-none"),children:[l.jsx(Sr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Nr.displayName=oI.displayName;const Dr=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});Dr.displayName="DialogHeader";const Hp=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Hp.displayName="DialogFooter";const $r=({className:e,...t})=>l.jsx("div",{className:Y("overflow-y-auto px-6 max-h-[50vh]",e),...t});$r.displayName="DialogBody";const Ar=x.forwardRef(({className:e,...t},n)=>l.jsx(J5,{ref:n,className:Y("text-ui-md font-medium",e),...t}));Ar.displayName=J5.displayName;const ys=x.forwardRef(({className:e,...t},n)=>l.jsx(e6,{ref:n,className:Y("sr-only",e),...t}));ys.displayName=e6.displayName;const w5e=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,S5e=lyt,$me=(e,t)=>n=>{var r;if(t?.variants==null)return S5e(e,n?.class,n?.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(u=>{const d=n?.[u],f=s?.[u];if(d===null)return null;const p=w5e(d)||w5e(f);return a[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...s,...o}[g]):{...s,...o}[g]===v})?[...u,f,p]:u},[]);return S5e(e,i,c,n?.class,n?.className)},ztr=$me(Y("flex w-full text-neutral6 border bg-transparent","transition-all duration-normal ease-out-custom","placeholder:text-neutral2 placeholder:transition-opacity placeholder:duration-normal","focus:placeholder:opacity-70"),{variants:{variant:{default:Y(Ime,Rme,Pme),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Yl.sm} text-ui-sm px-[.75em]`,md:`${Yl.md} text-ui-md px-[.75em]`,default:`${Yl.default} text-ui-md px-[.85em]`,lg:`${Yl.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),an=x.forwardRef(({className:e,size:t,testId:n,variant:r,type:a,error:s,...i},o)=>l.jsx("input",{type:a,className:Y(ztr({variant:r,size:t}),s&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:o,"aria-invalid":s,...i}));an.displayName="Input";const Btr=$me("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xt=x.forwardRef(({className:e,...t},n)=>l.jsx(UJe,{ref:n,className:Y(Btr(),e),...t}));xt.displayName=UJe.displayName;const Utr={"ui-xs":"text-ui-xs leading-ui-xs","ui-sm":"text-ui-sm leading-ui-sm","ui-smd":"text-ui-smd leading-ui-smd","ui-md":"text-ui-md leading-ui-md","ui-lg":"text-ui-lg leading-ui-lg","header-xs":"text-header-xs leading-header-xs","header-sm":"text-header-sm leading-header-sm","header-md":"text-header-md leading-header-md","header-lg":"text-header-lg leading-header-lg","header-xl":"text-header-xl leading-header-xl"},Vtr={mono:"font-mono"},pe=({as:e="p",className:t,variant:n="ui-md",font:r,...a})=>l.jsx(e,{className:Y(Utr[n],r&&Vtr[r],t),...a}),$s=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 15C10.3565 15 12.137 14.2625 13.4497 12.9497C14.7625 11.637 15.5 9.85652 15.5 8C15.5 6.14348 14.7625 4.36301 13.4497 3.05025C12.137 1.7375 10.3565 1 8.5 1C6.64348 1 4.86301 1.7375 3.55025 3.05025C2.2375 4.36301 1.5 6.14348 1.5 8C1.5 9.85652 2.2375 11.637 3.55025 12.9497C4.86301 14.2625 6.64348 15 8.5 15ZM5.621 10.879L4.611 11.889C3.84179 11.1198 3.31794 10.1398 3.1057 9.07291C2.89346 8.00601 3.00236 6.90013 3.41864 5.89512C3.83491 4.89012 4.53986 4.03112 5.44434 3.42676C6.34881 2.8224 7.41219 2.49983 8.5 2.49983C9.58781 2.49983 10.6512 2.8224 11.5557 3.42676C12.4601 4.03112 13.1651 4.89012 13.5814 5.89512C13.9976 6.90013 14.1065 8.00601 13.8943 9.07291C13.6821 10.1398 13.1582 11.1198 12.389 11.889L11.379 10.879C11.1004 10.6003 10.7696 10.3792 10.4055 10.2284C10.0414 10.0776 9.6511 9.99995 9.257 10H7.743C7.3489 9.99995 6.95865 10.0776 6.59455 10.2284C6.23045 10.3792 5.89963 10.6003 5.621 10.879Z",fill:"currentColor"}),l.jsx("path",{d:"M8.5 4C7.96957 4 7.46086 4.21071 7.08579 4.58579C6.71071 4.96086 6.5 5.46957 6.5 6V6.5C6.5 7.03043 6.71071 7.53914 7.08579 7.91421C7.46086 8.28929 7.96957 8.5 8.5 8.5C9.03043 8.5 9.53914 8.28929 9.91421 7.91421C10.2893 7.53914 10.5 7.03043 10.5 6.5V6C10.5 5.46957 10.2893 4.96086 9.91421 4.58579C9.53914 4.21071 9.03043 4 8.5 4Z",fill:"currentColor"})]}),Cyt=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M63.0002 0.968262C28.5152 0.968262 0.55957 15.6484 0.55957 33.7573V51.2428C0.55957 69.3517 28.5152 84.0319 63.0002 84.0319C97.4853 84.0319 125.441 69.3517 125.441 51.2428V33.7573C125.441 15.6484 97.4853 0.968262 63.0002 0.968262Z",stroke:"#707070"}),l.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636V49.8363C6.67773 65.0322 31.894 77.351 62.9998 77.351C94.1055 77.351 119.322 65.0322 119.322 49.8363V35.1636Z",fill:"#2E2E2E",fillOpacity:"0.9"}),l.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636M119.322 35.1636C119.322 19.9677 94.1055 7.64893 62.9998 7.64893C31.894 7.64893 6.67773 19.9677 6.67773 35.1636M119.322 35.1636V49.8363C119.322 65.0322 94.1055 77.351 62.9998 77.351C31.894 77.351 6.67773 65.0322 6.67773 49.8363V35.1636",stroke:"#424242"}),l.jsxs("g",{clipPath:"url(#clip0_21421_19519)",children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5383 47.0955C45.0714 50.3122 53.9322 52.1193 63.1714 52.1193C72.4106 52.1193 81.2714 50.3122 87.8045 47.0955C94.3376 43.8787 98.0078 39.5159 98.0078 34.9668C98.0078 30.4177 94.3376 26.0549 87.8045 22.8381C81.2714 19.6214 72.4106 17.8143 63.1714 17.8143C53.9322 17.8143 45.0714 19.6214 38.5383 22.8381C32.0052 26.0549 28.3349 30.4177 28.3349 34.9668C28.3349 39.5159 32.0052 43.8787 38.5383 47.0955ZM42.9089 34.9668L35.8005 34.9668C35.8004 32.3013 37.4056 29.6956 40.4132 27.4793C43.4207 25.263 47.6956 23.5355 52.6971 22.5154C57.6986 21.4954 63.2022 21.2285 68.5118 21.7485C73.8214 22.2685 78.6986 23.552 82.5266 25.4368C86.3546 27.3216 88.9615 29.723 90.0176 32.3373C91.0737 34.9517 90.5316 37.6614 88.4599 40.1241C86.3881 42.5867 82.8797 44.6915 78.3784 46.1723C73.8771 47.6532 68.585 48.4435 63.1714 48.4435V44.9435C63.1717 43.9778 62.7855 43.0215 62.035 42.1293C61.2845 41.2372 60.1843 40.4265 58.7973 39.7438L53.4695 37.1205C52.0828 36.4376 50.4364 35.8959 48.6244 35.5263C46.8124 35.1568 44.8702 34.9667 42.9089 34.9668Z",fill:"#A9A9A9"}),l.jsx("path",{d:"M77.2474 28.0361C75.3808 27.1171 72.8492 26.6007 70.2094 26.6007C67.5696 26.6007 65.038 27.1171 63.1714 28.0361L61.4119 28.9025C59.5453 29.8215 58.4966 31.068 58.4966 32.3678C58.4966 33.6676 59.5453 34.9141 61.4119 35.8331C63.2785 36.7522 65.8101 37.2685 68.4499 37.2685C71.0897 37.2685 73.6213 36.7522 75.4879 35.8331L77.2474 34.9668C79.114 34.0477 80.1627 32.8012 80.1627 31.5015C80.1627 30.2017 79.114 28.9552 77.2474 28.0361Z",fill:"#A9A9A9"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21421_19519",children:l.jsx("rect",{width:"62.7591",height:"62.7591",fill:"white",transform:"matrix(0.897148 0.441731 -0.897148 0.441731 63.1714 7.24365)"})})})]}),qtr=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M11.0313 7.97578C11.0313 9.34436 9.92183 10.4538 8.55324 10.4538C7.18466 10.4538 6.0752 9.34436 6.0752 7.97578C6.0752 6.60719 7.18466 5.49773 8.55324 5.49773C9.92183 5.49773 11.0313 6.60719 11.0313 7.97578ZM11.0313 7.97578H14.573",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"}),l.jsx("path",{d:"M12.967 4.46154C11.9273 3.14431 10.3165 2.29883 8.50814 2.29883C5.37277 2.29883 2.83105 4.84055 2.83105 7.97591C2.83105 11.1113 5.37277 13.653 8.50814 13.653C10.3165 13.653 11.9273 12.8075 12.967 11.4903",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})]}),Lme=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.97865 4.57004C8.22604 4.75795 8.27426 5.11082 8.08635 5.35821L6.05486 8.03279C5.94873 8.17251 5.78348 8.25471 5.60803 8.25505C5.43257 8.2554 5.267 8.17385 5.16032 8.03454L3.80937 6.27034C3.6205 6.02369 3.66733 5.67063 3.91398 5.48176C4.16063 5.29288 4.51369 5.33972 4.70257 5.58637L5.6051 6.76498L7.19048 4.67774C7.37839 4.43036 7.73126 4.38213 7.97865 4.57004Z",fill:"currentColor"})]}),Fme=e=>l.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.99982 2.0625C3.8252 2.0625 2.06232 3.82538 2.06232 6C2.06232 8.17462 3.8252 9.9375 5.99982 9.9375C8.17444 9.9375 9.93732 8.17462 9.93732 6C9.93732 3.82538 8.17444 2.0625 5.99982 2.0625ZM0.937317 6C0.937317 3.20406 3.20388 0.9375 5.99982 0.9375C8.79576 0.9375 11.0623 3.20406 11.0623 6C11.0623 8.79594 8.79576 11.0625 5.99982 11.0625C3.20388 11.0625 0.937317 8.79594 0.937317 6Z",fill:"currentColor"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.89741 4.10293C8.11707 4.32261 8.11706 4.67877 7.89738 4.89843L6.79517 6.00058L7.8962 7.10155C8.11588 7.32122 8.11589 7.67737 7.89623 7.89705C7.67656 8.11673 7.32041 8.11674 7.10073 7.89707L5.99965 6.79605L4.89856 7.89707C4.67889 8.11673 4.32273 8.11672 4.10307 7.89704C3.88341 7.67737 3.88342 7.32121 4.10309 7.10155L5.20413 6.00058L4.10191 4.89843C3.88224 4.67877 3.88223 4.32262 4.10189 4.10294C4.32155 3.88326 4.67771 3.88325 4.89738 4.10292L5.99965 5.20511L7.10191 4.10291C7.32159 3.88325 7.67774 3.88326 7.89741 4.10293Z",fill:"currentColor"})]}),fi=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.1747 3.18598L7.02554 1.95209C7.11557 1.89207 7.31087 1.87106 7.41016 1.90924L12.4139 3.83377C12.4683 3.85467 12.546 3.96798 12.546 4.03118V13.0167C12.546 13.265 12.7473 13.4663 12.9956 13.4663C13.2439 13.4663 13.4452 13.265 13.4452 13.0167V4.03118C13.4452 3.59605 13.1384 3.14906 12.7367 2.99456L7.73293 1.07004C7.36225 0.927472 6.86056 0.981451 6.52679 1.20396L4.20445 2.75219L3.90419 2.95236L3.90647 2.95824C3.69329 3.05449 3.55469 3.27599 3.55469 3.57581V11.7119C3.55469 12.2084 3.93067 12.7499 4.39251 12.9206L9.89804 14.955C10.3608 15.126 10.7359 14.8596 10.7359 14.3659V5.83295C10.7359 5.33662 10.3498 4.81289 9.88389 4.66643L5.1747 3.18598Z",fill:"currentColor"})}),zme=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("g",{clipPath:"url(#clip0_21999_22095)",children:l.jsx("path",{d:"M7.5 0.75C3.6325 0.75 0.5 3.8825 0.5 7.75C0.5 10.8475 2.50375 13.4637 5.28625 14.3912C5.63625 14.4525 5.7675 14.2425 5.7675 14.0587C5.7675 13.8925 5.75875 13.3412 5.75875 12.755C4 13.0787 3.545 12.3262 3.405 11.9325C3.32625 11.7312 2.985 11.11 2.6875 10.9437C2.4425 10.8125 2.0925 10.4887 2.67875 10.48C3.23 10.4712 3.62375 10.9875 3.755 11.1975C4.385 12.2562 5.39125 11.9587 5.79375 11.775C5.855 11.32 6.03875 11.0137 6.24 10.8387C4.6825 10.6637 3.055 10.06 3.055 7.3825C3.055 6.62125 3.32625 5.99125 3.7725 5.50125C3.7025 5.32625 3.4575 4.60875 3.8425 3.64625C3.8425 3.64625 4.42875 3.4625 5.7675 4.36375C6.3275 4.20625 6.9225 4.1275 7.5175 4.1275C8.1125 4.1275 8.7075 4.20625 9.2675 4.36375C10.6062 3.45375 11.1925 3.64625 11.1925 3.64625C11.5775 4.60875 11.3325 5.32625 11.2625 5.50125C11.7087 5.99125 11.98 6.6125 11.98 7.3825C11.98 10.0687 10.3438 10.6637 8.78625 10.8387C9.04 11.0575 9.25875 11.4775 9.25875 12.1337C9.25875 13.07 9.25 13.8225 9.25 14.0587C9.25 14.2425 9.38125 14.4612 9.73125 14.3912C11.1209 13.9221 12.3284 13.029 13.1839 11.8377C14.0393 10.6463 14.4996 9.21668 14.5 7.75C14.5 3.8825 11.3675 0.75 7.5 0.75Z",fill:"currentColor"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_22095",children:l.jsx("rect",{width:"14",height:"14",fill:"currentColor",transform:"translate(0.5 0.75)"})})})]}),jyt=e=>l.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsxs("g",{clipPath:"url(#clip0_21999_20513)",children:[l.jsx("path",{d:"M13.5037 7.54867C13.5037 7.1144 13.4648 6.69683 13.3924 6.29596H7.62436V8.66776H10.9204C10.7756 9.43052 10.3413 10.0764 9.68994 10.5106V12.0529H11.6776C12.8356 10.9839 13.5037 9.41382 13.5037 7.54867Z",fill:"#4285F4"}),l.jsx("path",{d:"M7.62415 13.5339C9.27773 13.5339 10.6643 12.9882 11.6776 12.0529L9.68994 10.5106C9.14431 10.8781 8.44816 11.1009 7.62415 11.1009C6.03182 11.1009 4.67889 10.0263 4.19451 8.57877H2.15677V10.16C3.1645 12.1587 5.23008 13.5339 7.62415 13.5339Z",fill:"#34A853"}),l.jsx("path",{d:"M4.19472 8.57315C4.07223 8.20569 3.99985 7.81595 3.99985 7.40952C3.99985 7.00308 4.07223 6.61335 4.19472 6.24589V4.66469H2.15698C1.73941 5.4887 1.5 6.41849 1.5 7.40952C1.5 8.40055 1.73941 9.33034 2.15698 10.1543L3.74374 8.91834L4.19472 8.57315Z",fill:"#FBBC05"}),l.jsx("path",{d:"M7.62415 3.72376C8.5261 3.72376 9.32783 4.03555 9.96811 4.63685L11.7219 2.88306C10.6585 1.89202 9.27773 1.28516 7.62415 1.28516C5.23008 1.28516 3.16471 2.66036 2.15698 4.66469L4.19472 6.24589C4.6791 4.79832 6.03182 3.72376 7.62415 3.72376Z",fill:"#EA4335"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_21999_20513",children:l.jsx("rect",{width:"12.2487",height:"12.2487",fill:"white",transform:"translate(1.375 1.28516)"})})})]}),Htr={sm:"[&>svg]:h-icon-sm [&>svg]:w-icon-sm",default:"[&>svg]:h-icon-default [&>svg]:w-icon-default",lg:"[&>svg]:h-icon-lg [&>svg]:w-icon-lg"},xe=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:Y("block",Htr[n],t),...r,children:e}),Qtr=e=>l.jsxs("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M4.31445 3.16083C3.78402 3.16083 3.27531 3.37154 2.90024 3.74661C2.52517 4.12169 2.31445 4.63039 2.31445 5.16083V5.66083C2.31445 6.19126 2.52517 6.69997 2.90024 7.07504C3.27531 7.45011 3.78402 7.66083 4.31445 7.66083C4.84489 7.66083 5.35359 7.45011 5.72867 7.07504C6.10374 6.69997 6.31445 6.19126 6.31445 5.66083V5.16083C6.31445 4.63039 6.10374 4.12169 5.72867 3.74661C5.35359 3.37154 4.84489 3.16083 4.31445 3.16083Z",fill:"currentColor"}),l.jsx("path",{d:"M6.76666 9.50235C6.57678 9.28532 6.30244 9.16083 6.01407 9.16083H4.50201C4.10791 9.16078 3.71766 9.23838 3.35356 9.38921C3.11733 9.48706 2.8951 9.6145 2.69205 9.76806C2.48056 9.928 2.38001 10.1888 2.38001 10.454V13.0642C2.38001 13.6165 2.82773 14.0642 3.38001 14.0642H8.55436C9.4135 14.0642 9.87269 13.0523 9.30695 12.4057L6.76666 9.50235Z",fill:"currentColor"}),l.jsx("rect",{x:"7.92188",y:"6.46759",width:"1.41089",height:"1.56773",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"10.4258",y:"4.35107",width:"1.41089",height:"3.72998",rx:"0.705445",fill:"currentColor"}),l.jsx("rect",{x:"12.9287",y:"2.23419",width:"1.41089",height:"5.75781",rx:"0.705445",fill:"currentColor"})]}),Tyt=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M3.8674 9.19968L4.14554 10.8649C4.23965 11.4283 4.75254 11.8237 5.32137 11.7713L5.58252 11.7472C6.56555 11.6567 7.43309 12.3868 7.51181 13.3708L7.59308 14.3867C7.60422 14.5259 7.71868 14.6342 7.85825 14.6376L9.91053 14.6876C10.1066 14.6924 10.2434 14.4948 10.17 14.3129L8.90452 11.1782C8.80956 10.9429 8.65085 10.7389 8.44626 10.5889L7.90134 10.1895C7.70604 10.0464 7.55223 9.85411 7.45759 9.63124C7.15011 8.90712 6.6579 7.71234 6.37054 6.88944C6.19204 6.3783 5.79931 6.29158 5.45492 6.21553C4.98179 6.11106 4.5999 6.02673 4.99001 4.88985C5.66408 2.92541 8.06015 2.07904 10.6601 3.33088C12.6488 4.2884 13.1187 6.35416 13.0328 7.58237C13.0297 7.62768 13.0214 7.67186 13.0094 7.71566C12.8829 8.17534 12.368 8.40491 11.9415 8.19169L10.3022 7.37201C10.2069 7.32439 10.0927 7.33657 10.0096 7.40322L8.64809 8.49559C8.55405 8.57104 8.52072 8.69931 8.56615 8.811L10.8995 14.5478C10.9404 14.6483 11.0369 14.715 11.1454 14.7177L12.0572 14.7399C12.2581 14.7448 12.3951 14.5382 12.3124 14.3551L11.8681 13.3706C11.4211 12.3803 11.6047 11.2192 12.3354 10.4151L13.4616 9.17575C13.7473 8.86125 13.9224 8.46187 13.9599 8.03858L13.9763 7.85359C14.2866 4.35298 11.377 1.41272 7.87336 1.68639C6.03919 1.82965 4.45399 3.02228 3.80807 4.74492L3.70275 5.02579C3.5828 5.34571 3.62741 5.70411 3.82213 5.98485L3.88946 6.08192C4.12183 6.41695 4.0958 6.86726 3.82637 7.17328L3.06705 8.03572C2.96261 8.15435 2.98058 8.33664 3.10617 8.43259L3.66059 8.85617C3.77064 8.94026 3.84458 9.06307 3.8674 9.19968Z",fill:"currentColor"})}),Gtr=e=>l.jsx("svg",{width:"12",height:"13",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M10.1266 5.67745C10.3409 5.0225 10.2695 4.2961 9.92413 3.70069C9.40017 2.78376 8.34034 2.31934 7.30433 2.53369C6.85182 2.02164 6.18496 1.73584 5.49428 1.73584C4.43445 1.73584 3.50561 2.41461 3.17218 3.4149C2.49342 3.55779 1.90992 3.97458 1.56458 4.5819C1.04062 5.49883 1.1597 6.64202 1.86228 7.42796C1.64793 8.09482 1.73129 8.80931 2.07663 9.40472C2.60059 10.3217 3.66042 10.798 4.69643 10.5717C5.16085 11.0838 5.8158 11.3815 6.50648 11.3815C7.56631 11.3815 8.49515 10.7027 8.82858 9.70243C9.50735 9.55953 10.0908 9.14274 10.4362 8.53542C10.9601 7.61849 10.8411 6.46339 10.1266 5.67745ZM6.50648 10.7503C6.07778 10.7503 5.67291 10.6074 5.35138 10.3336C5.36329 10.3217 5.39902 10.3097 5.41093 10.2978L7.32815 9.19037C7.42341 9.13083 7.48295 9.03557 7.48295 8.91648V6.21332L8.29271 6.67774C8.30462 6.67774 8.30462 6.68965 8.30462 6.70156V8.9403C8.31653 9.94059 7.50677 10.7503 6.50648 10.7503ZM2.62441 9.09511C2.41006 8.72595 2.33861 8.29726 2.41006 7.88047C2.42197 7.89238 2.44578 7.90429 2.4696 7.91619L4.38682 9.02366C4.48209 9.0832 4.60117 9.0832 4.69643 9.02366L7.04235 7.66612V8.60687C7.04235 8.61878 7.04235 8.63069 7.03044 8.63069L5.0894 9.75006C4.23201 10.2502 3.12455 9.9525 2.62441 9.09511ZM2.12426 4.90342C2.33861 4.53427 2.67204 4.26038 3.06501 4.10557V6.39195C3.06501 6.49912 3.12455 6.60629 3.21982 6.66583L5.56573 8.02337L4.75597 8.48779C4.74407 8.48779 4.73216 8.4997 4.73216 8.48779L2.79112 7.36842C1.90992 6.86827 1.62412 5.76081 2.12426 4.90342ZM8.79285 6.45149L6.44694 5.09395L7.2567 4.62953C7.2686 4.62953 7.28051 4.61762 7.28051 4.62953L9.22155 5.7489C10.0908 6.24905 10.3766 7.35651 9.8765 8.2139C9.66215 8.58305 9.32872 8.85694 8.93575 8.99984V6.72538C8.94766 6.6182 8.88812 6.51103 8.79285 6.45149ZM9.5907 5.23685C9.5788 5.22494 9.55498 5.21303 9.53116 5.20113L7.61394 4.09366C7.51868 4.03412 7.39959 4.03412 7.30433 4.09366L4.95841 5.4512V4.51045C4.95841 4.49854 4.95841 4.48663 4.97032 4.48663L6.91136 3.36726C7.78066 2.86712 8.87621 3.16482 9.37636 4.03412C9.5907 4.39137 9.66215 4.82006 9.5907 5.23685ZM4.51781 6.904L3.70805 6.43958C3.69615 6.43958 3.69615 6.42767 3.69615 6.41576V4.17702C3.69615 3.17673 4.5059 2.36697 5.50619 2.36697C5.93489 2.36697 6.33977 2.50987 6.66129 2.78376C6.64938 2.79567 6.62556 2.80758 6.60175 2.81949L4.68453 3.92695C4.58926 3.98649 4.52972 4.08176 4.52972 4.20084V6.904H4.51781ZM4.95841 5.95134L6.00634 5.34402L7.05426 5.95134V7.15407L6.00634 7.76139L4.95841 7.15407V5.95134Z",fill:"currentColor"})}),Bme=e=>l.jsx("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.40864 11.9983C7.58064 11.9733 6.84164 11.6153 6.31564 11.0563C6.31464 11.0563 6.31464 11.0553 6.31464 11.0553C5.78864 10.4963 5.47564 9.73633 5.50064 8.90833C5.52564 8.08033 5.88464 7.34133 6.44364 6.81533C7.00264 6.28833 7.76264 5.97633 8.59064 6.00133C9.41864 6.02633 10.1576 6.38433 10.6836 6.94333H10.6846C11.2106 7.50333 11.5236 8.26233 11.4986 9.09033C11.4726 9.91833 11.1146 10.6583 10.5556 11.1843C9.99664 11.7103 9.23664 12.0233 8.40864 11.9983ZM16.1266 8.15033L14.3606 7.74033C14.2316 7.14133 14.0146 6.57633 13.7216 6.05733L14.7726 4.57933C14.9116 4.38533 14.8926 4.12033 14.7296 3.94633L13.9206 3.08733C13.7576 2.91333 13.4946 2.87933 13.2916 3.00533L11.7526 3.96533C11.2526 3.64133 10.7016 3.39033 10.1116 3.22633L9.80964 1.43833C9.76964 1.20333 9.56964 1.02833 9.33164 1.02133L8.15264 0.985326C7.91364 0.978326 7.70364 1.14033 7.64964 1.37233L7.24064 3.13933C6.64164 3.26733 6.07664 3.48433 5.55664 3.77733L4.07864 2.72633C3.88464 2.58833 3.61964 2.60633 3.44664 2.76933L2.58664 3.57833C2.41364 3.74133 2.37964 4.00533 2.50564 4.20733L3.46564 5.74633C3.14164 6.24633 2.89064 6.79833 2.72564 7.38833L0.937635 7.68933C0.702635 7.72933 0.528635 7.92933 0.520635 8.16733L0.485635 9.34733C0.477635 9.58533 0.639635 9.79533 0.872635 9.84933L2.63864 10.2583C2.76764 10.8573 2.98464 11.4233 3.27764 11.9423L2.22564 13.4203C2.08764 13.6143 2.10564 13.8793 2.26964 14.0523L3.07864 14.9123C3.24164 15.0853 3.50464 15.1203 3.70664 14.9933L5.24564 14.0333C5.74663 14.3583 6.29764 14.6093 6.88764 14.7733L7.18964 16.5613C7.22864 16.7963 7.42864 16.9713 7.66764 16.9783L8.84663 17.0143C9.08564 17.0213 9.29564 16.8593 9.34964 16.6273L9.75864 14.8603C10.3576 14.7323 10.9226 14.5153 11.4416 14.2213L12.9206 15.2733C13.1146 15.4113 13.3786 15.3933 13.5526 15.2293L14.4116 14.4213C14.5856 14.2573 14.6196 13.9943 14.4936 13.7923L13.5336 12.2533C13.8576 11.7523 14.1086 11.2013 14.2726 10.6113L16.0616 10.3103C16.2966 10.2703 16.4706 10.0703 16.4776 9.83233L16.5136 8.65233C16.5206 8.41433 16.3586 8.20433 16.1266 8.15033Z",fill:"currentColor"})}),Wtr=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M5.25684 12.6387L10.4003 3.36133H11.7432L6.5997 12.6387H5.25684Z",fill:"currentColor"})}),vo=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5605 1.42351C8.0791 0.904904 8.92215 0.906157 9.4395 1.42351L10.6922 2.67617C11.2108 3.19477 11.2095 4.03782 10.6922 4.55517L9.4395 5.80783C8.9209 6.32643 8.07785 6.32518 7.5605 5.80783L6.30784 4.55517C5.78923 4.03656 5.79049 3.19352 6.30784 2.67617L7.5605 1.42351ZM3.17618 5.80783C3.69478 5.28923 4.53782 5.29048 5.05517 5.80783L6.30784 7.0605C6.82644 7.5791 6.82519 8.42214 6.30784 8.93949L5.05517 10.1922C4.53657 10.7108 3.69353 10.7095 3.17618 10.1922L1.92351 8.93949C1.40491 8.42089 1.40616 7.57785 1.92351 7.0605L3.17618 5.80783ZM11.9448 5.80783C12.4634 5.28923 13.3065 5.29048 13.8238 5.80783L15.0765 7.0605C15.5951 7.5791 15.5938 8.42214 15.0765 8.93949L13.8238 10.1922C13.3052 10.7108 12.4622 10.7095 11.9448 10.1922L10.6922 8.93949C10.1736 8.42089 10.1748 7.57785 10.6922 7.0605L11.9448 5.80783ZM7.5605 10.1922C8.0791 9.67355 8.92215 9.67481 9.4395 10.1922L10.6922 11.4448C11.2108 11.9634 11.2095 12.8065 10.6922 13.3238L9.4395 14.5765C8.9209 15.0951 8.07785 15.0938 7.5605 14.5765L6.30784 13.3238C5.78923 12.8052 5.79049 11.9622 6.30784 11.4448L7.5605 10.1922Z",fill:"currentColor"})}),B_=e=>l.jsx(yZt,{...e}),Mo=e=>l.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.24388 2.4018C6.24388 2.0394 6.53767 1.74561 6.90008 1.74561H10.0991C10.4614 1.74561 10.7553 2.0394 10.7553 2.4018V4.57546C10.7553 4.93787 10.4614 5.23166 10.0991 5.23166H9.31982V7.35469L10.0033 9.22664C9.90442 9.20146 9.80035 9.1761 9.6915 9.14986L9.62652 9.13422C9.30473 9.05687 8.92256 8.96501 8.61993 8.84491C8.5819 8.82981 8.54147 8.81292 8.49957 8.79391C8.45767 8.81292 8.41724 8.82981 8.3792 8.84491C8.07657 8.96501 7.6944 9.05687 7.37261 9.13422L7.30763 9.14986C7.19879 9.1761 7.09471 9.20146 6.99577 9.22664L7.67932 7.35469V5.23166H6.90008C6.53767 5.23166 6.24388 4.93787 6.24388 4.57546V2.4018ZM6.99577 9.22664C6.99577 9.22664 6.99578 9.22664 6.99577 9.22664L6.43283 10.7683H6.81806C7.18047 10.7683 7.47426 11.0622 7.47426 11.4245V13.5982C7.47426 13.9606 7.18047 14.2544 6.81806 14.2544H3.61909C3.25668 14.2544 2.96289 13.9606 2.96289 13.5982V11.4245C2.96289 11.0622 3.25668 10.7683 3.61909 10.7683H4.26617C4.2921 10.4663 4.32783 10.1494 4.37744 9.85171C4.43762 9.49063 4.52982 9.08135 4.68998 8.76102C4.93975 8.2615 5.44743 8.01751 5.7771 7.88788C6.14684 7.74249 6.57537 7.63889 6.92317 7.55505C7.24707 7.47696 7.49576 7.41679 7.67932 7.35469L6.99577 9.22664ZM6.43283 10.7683L6.99577 9.22664C6.75846 9.28705 6.55067 9.34646 6.37745 9.41458C6.22784 9.47341 6.1623 9.51712 6.14023 9.53254C6.09752 9.63631 6.04409 9.83055 5.99562 10.1214C5.96201 10.3231 5.93498 10.5439 5.91341 10.7683H6.43283ZM10.0033 9.22664L9.31982 7.35469C9.50338 7.41679 9.75206 7.47696 10.076 7.55505C10.4238 7.63889 10.8523 7.74249 11.2221 7.88788C11.5517 8.01751 12.0594 8.2615 12.3091 8.76102C12.4693 9.08135 12.5615 9.49063 12.6217 9.85171C12.6713 10.1494 12.707 10.4663 12.733 10.7683H13.38C13.7424 10.7683 14.0362 11.0622 14.0362 11.4245V13.5982C14.0362 13.9606 13.7424 14.2544 13.38 14.2544H10.1811C9.81867 14.2544 9.52488 13.9606 9.52488 13.5982V11.4245C9.52488 11.0622 9.81867 10.7683 10.1811 10.7683H10.5663L10.0033 9.22664ZM10.0033 9.22664L10.5663 10.7683H11.0857C11.0642 10.5439 11.0372 10.3231 11.0035 10.1214C10.9551 9.83055 10.9016 9.63631 10.8589 9.53254C10.8369 9.51712 10.7713 9.47341 10.6217 9.41458C10.4485 9.34646 10.2407 9.28705 10.0033 9.22664Z",fill:"currentColor"})}),Ztr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636V49.8363C6.67773 65.0322 31.894 77.351 62.9998 77.351C94.1055 77.351 119.322 65.0322 119.322 49.8363V35.1636Z",fill:"#2E2E2E",fillOpacity:"0.9"}),l.jsx("path",{d:"M119.322 35.1636C119.322 50.3595 94.1055 62.6782 62.9998 62.6782C31.894 62.6782 6.67773 50.3595 6.67773 35.1636M119.322 35.1636C119.322 19.9677 94.1055 7.64893 62.9998 7.64893C31.894 7.64893 6.67773 19.9677 6.67773 35.1636M119.322 35.1636V49.8363C119.322 65.0322 94.1055 77.351 62.9998 77.351C31.894 77.351 6.67773 65.0322 6.67773 49.8363V35.1636",stroke:"#424242"}),l.jsx("path",{d:"M63.0002 0.968262C28.5152 0.968262 0.55957 15.6484 0.55957 33.7573V51.2428C0.55957 69.3517 28.5152 84.0319 63.0002 84.0319C97.4853 84.0319 125.441 69.3517 125.441 51.2428V33.7573C125.441 15.6484 97.4853 0.968262 63.0002 0.968262Z",stroke:"#707070"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M74.9374 21.357C76.2127 20.7291 78.2804 20.7291 79.5557 21.357L90.8129 26.8997C92.0882 27.5276 92.0882 28.5458 90.8129 29.1737L83.1638 32.9399C81.8885 33.5678 79.8207 33.5678 78.5454 32.9399L75.8033 31.5898L68.3324 35.2682L64.1502 39.696C63.8908 39.481 63.6138 39.2568 63.3231 39.0227L63.1495 38.883C62.2893 38.1914 61.2677 37.3701 60.6254 36.6376C60.5446 36.5456 60.4618 36.4463 60.3812 36.3407C60.1669 36.3011 59.9652 36.2603 59.7782 36.2205C58.2906 35.9043 56.6225 35.4013 55.2179 34.9777L54.9342 34.8922C54.4589 34.7491 54.0034 34.6127 53.5666 34.4849L62.5594 32.4258L70.0304 28.7473L67.2882 27.3972C66.0129 26.7692 66.0129 25.7512 67.2882 25.1232L74.9374 21.357ZM53.5666 34.4849C53.5666 34.4849 53.5666 34.4849 53.5666 34.4849L46.1603 36.1808L47.516 36.8483C48.7913 37.4762 48.7912 38.4943 47.516 39.1222L39.8668 42.8884C38.5916 43.5163 36.5238 43.5164 35.2485 42.8884L23.9913 37.3457C22.7159 36.7177 22.716 35.6996 23.9913 35.0717L31.6404 31.3055C32.9156 30.6776 34.9834 30.6776 36.2587 31.3055L38.5358 32.4267C39.6899 31.9483 40.9309 31.4611 42.153 31.0313C43.6354 30.5099 45.4001 29.9605 47.091 29.683C49.7278 29.2502 52.3729 29.7072 53.9892 30.0537C55.8019 30.4425 57.6745 31.0055 59.1934 31.4628C60.6081 31.8887 61.6949 32.2154 62.5594 32.4258L53.5666 34.4849ZM46.1603 36.1808L53.5666 34.4849C52.5189 34.1784 51.5786 33.9213 50.7293 33.7392C49.9958 33.5819 49.6114 33.5441 49.4794 33.5326C48.964 33.6384 48.0924 33.8823 46.8983 34.3023C46.0703 34.5936 45.1981 34.9293 44.3325 35.2808L46.1603 36.1808ZM64.1502 39.696L68.3324 35.2682C68.7598 35.6939 69.4232 36.229 70.2883 36.9256C71.2171 37.6735 72.3605 38.5954 73.15 39.488C73.8539 40.2838 74.7818 41.5862 73.9029 42.8844C73.3394 43.717 72.2235 44.5859 71.1648 45.3159C70.2916 45.9175 69.3021 46.5286 68.3305 47.0968L70.6077 48.218C71.8829 48.8459 71.8829 49.864 70.6077 50.4919L62.9585 54.2582C61.6833 54.8861 59.6154 54.8861 58.3402 54.2582L47.083 48.7154C45.8077 48.0875 45.8077 47.0694 47.083 46.4415L54.7321 42.6752C56.0074 42.0474 58.0751 42.0473 59.3505 42.6752L60.7062 43.3428L64.1502 39.696ZM64.1502 39.696L60.7062 43.3428L62.5339 44.2427C63.2478 43.8165 63.9298 43.3871 64.5213 42.9794C65.3742 42.3914 65.8695 41.9622 66.0846 41.7085C66.0613 41.6436 65.9844 41.4543 65.6649 41.0931C65.295 40.6749 64.773 40.212 64.1502 39.696Z",fill:"#A9A9A9"})]}),Mu=e=>l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M6.53918 9.32122C6.34324 9.51508 6.02724 9.51338 5.83338 9.31744C5.63952 9.1215 5.6412 8.80551 5.83713 8.61164L10.1958 4.29931C10.7996 3.70186 10.8017 2.72852 10.2041 2.12839L10.1899 2.11428C9.58767 1.52481 8.62251 1.53208 8.0292 2.13052L2.29396 7.91536C2.0999 8.1111 1.78388 8.11246 1.58813 7.9184C1.39239 7.72433 1.39103 7.40831 1.58509 7.21257L7.32036 1.42774C8.30005 0.439581 9.89369 0.427613 10.8881 1.40094L10.9116 1.42425C11.4942 2.00929 11.7316 2.80913 11.6232 3.56922C12.389 3.44866 13.1999 3.67918 13.7961 4.26273C14.804 5.24929 14.8147 6.86824 13.82 7.86808L8.5531 13.1619C8.50045 13.2148 8.50024 13.3002 8.55263 13.3534L9.65448 14.4717C9.84794 14.668 9.8456 14.984 9.64925 15.1775C9.45291 15.3709 9.13691 15.3686 8.94345 15.1723L7.84163 14.054C7.40505 13.6109 7.40677 12.8988 7.8455 12.4579L13.1124 7.16405C13.7161 6.55727 13.7095 5.57478 13.0979 4.97606C12.4925 4.38347 11.4942 4.40725 10.8978 5.00886L6.53918 9.32122Z",fill:"currentColor"}),l.jsx("path",{d:"M8.84622 2.75411C9.04697 2.56188 9.36555 2.56381 9.56395 2.76076C9.76234 2.95771 9.76658 3.27625 9.57582 3.4784L9.56661 3.48794L5.25912 7.82701C4.67023 8.42022 4.672 9.37798 5.26305 9.96904C5.85624 10.5622 6.81818 10.5615 7.41052 9.9675L11.6299 5.73599L11.6395 5.72671C11.8406 5.53493 12.1592 5.53756 12.3572 5.73496C12.5583 5.93548 12.5587 6.26104 12.3582 6.46214L8.13877 10.6937C7.14498 11.6903 5.53105 11.6915 4.53584 10.6963C3.5442 9.70461 3.54127 8.09774 4.52928 7.10248L8.83677 2.76342L8.84622 2.75411Z",fill:"currentColor"})]}),Ytr=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M1.5 8.5V8C1.5 7.60218 1.65804 7.22064 1.93934 6.93934C2.22064 6.65804 2.60218 6.5 3 6.5H13C13.3978 6.5 13.7794 6.65804 14.0607 6.93934C14.342 7.22064 14.5 7.60218 14.5 8V8.5M8.70667 4.20667L7.29333 2.79333C7.20048 2.70037 7.09022 2.62661 6.96886 2.57628C6.84749 2.52595 6.71739 2.50003 6.586 2.5H3C2.60218 2.5 2.22064 2.65804 1.93934 2.93934C1.65804 3.22064 1.5 3.60218 1.5 4V12C1.5 12.3978 1.65804 12.7794 1.93934 13.0607C2.22064 13.342 2.60218 13.5 3 13.5H13C13.3978 13.5 13.7794 13.342 14.0607 13.0607C14.342 12.7794 14.5 12.3978 14.5 12V6C14.5 5.60218 14.342 5.22064 14.0607 4.93934C13.7794 4.65804 13.3978 4.5 13 4.5H9.414C9.14887 4.49977 8.89402 4.39426 8.70667 4.20667Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),Xtr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",fill:"#2E2E2E",fillOpacity:"0.9"}),l.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",stroke:"#424242"}),l.jsx("path",{d:"M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",stroke:"#707070"}),l.jsx("path",{d:"M51.5215 39.9726C50.5464 40.4477 48.9738 40.4435 48.009 39.9634C47.0442 39.4833 47.0526 38.709 48.0277 38.2339L69.7191 27.6672C72.7243 26.2032 72.7347 23.8181 69.7605 22.3476L69.6898 22.313C66.6927 20.8686 61.8895 20.8864 58.9368 22.3528L30.3946 36.5278C29.4288 37.0074 27.8561 37.0107 26.882 36.5352C25.9078 36.0597 25.901 35.2853 26.8668 34.8057L55.4092 20.6308C60.2847 18.2094 68.2157 18.1801 73.1645 20.5651L73.2814 20.6222C76.1808 22.0558 77.3624 24.0157 76.8227 25.8782C80.6339 25.5828 84.6694 26.1476 87.6364 27.5775C92.6525 29.9949 92.7059 33.962 87.7554 36.4119L61.5441 49.3836C61.282 49.5133 61.281 49.7227 61.5417 49.853L67.0252 52.5932C67.988 53.0743 67.9763 53.8486 66.9992 54.3226C66.0221 54.7966 64.4495 54.7909 63.4867 54.3098L58.0033 51.5695C55.8306 50.4838 55.8392 48.7391 58.0226 47.6585L84.2339 34.6868C87.2382 33.2 87.2058 30.7925 84.1617 29.3254C81.1488 27.8734 76.1811 27.9317 73.2127 29.4058L51.5215 39.9726Z",fill:"#A9A9A9"}),l.jsx("path",{d:"M63.0028 23.8809C64.0019 23.4098 65.5873 23.4146 66.5747 23.8972C67.562 24.3798 67.5831 25.1603 66.6338 25.6556L66.5879 25.679L45.1511 36.3113C42.2204 37.7649 42.2292 40.1117 45.1707 41.56C48.1228 43.0135 52.91 43.0118 55.8578 41.5563L76.8564 31.1875L76.9037 31.1648C77.9049 30.6949 79.4903 30.7013 80.4755 31.185C81.4763 31.6764 81.4785 32.4741 80.4806 32.9669L59.4821 43.3356C54.5363 45.7777 46.5044 45.7806 41.5516 43.342C36.6166 40.9121 36.602 36.9747 41.519 34.5359L62.9558 23.9037L63.0028 23.8809Z",fill:"#A9A9A9"})]}),Ktr=e=>l.jsxs("svg",{width:"126",height:"85",viewBox:"0 0 126 85",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",fill:"#2E2E2E",fillOpacity:"0.9"}),l.jsx("path",{d:"M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",stroke:"#424242"}),l.jsx("path",{d:"M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",stroke:"#707070"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M95.8997 32.6647C98.4806 33.9355 98.4744 36.0012 95.8997 37.2689L89.6657 40.3384C87.0848 41.6091 82.8892 41.6061 80.3146 40.3384L74.0805 37.2689C71.4996 35.9981 71.5059 33.9324 74.0805 32.6647L80.3146 29.5952C82.8955 28.3244 87.091 28.3275 89.6657 29.5952L95.8997 32.6647ZM74.0805 21.9215C76.6614 23.1923 76.6552 25.258 74.0805 26.5257L67.8465 29.5952C65.2656 30.866 61.0701 30.8629 58.4954 29.5952L52.2613 26.5257C49.6804 25.255 49.6867 23.1892 52.2613 21.9215L58.4954 18.852C61.0763 17.5813 65.2718 17.5843 67.8465 18.852L74.0805 21.9215ZM74.0805 43.4079C76.6614 44.6786 76.6552 46.7444 74.0805 48.0121L67.8465 51.0816C65.2656 52.3523 61.0701 52.3493 58.4954 51.0816L52.2613 48.0121C49.6804 46.7413 49.6867 44.6756 52.2613 43.4079L58.4954 40.3384C61.0763 39.0676 65.2718 39.0707 67.8465 40.3384L74.0805 43.4079ZM52.2613 32.6647C54.8422 33.9355 54.836 36.0012 52.2613 37.2689L46.0273 40.3384C43.4464 41.6091 39.2509 41.6061 36.6762 40.3384L30.4422 37.2689C27.8613 35.9981 27.8675 33.9324 30.4422 32.6647L36.6762 29.5952C39.2571 28.3244 43.4526 28.3275 46.0273 29.5952L52.2613 32.6647Z",fill:"#A9A9A9"})]});function sb(e){return l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("rect",{width:"16",height:"16",x:"4",y:"4",rx:"2"}),l.jsx("rect",{width:"6",height:"6",x:"9",y:"9",rx:"1"}),l.jsx("path",{d:"M15 2v2"}),l.jsx("path",{d:"M15 20v2"}),l.jsx("path",{d:"M2 15h2"}),l.jsx("path",{d:"M2 9h2"}),l.jsx("path",{d:"M20 15h2"}),l.jsx("path",{d:"M20 9h2"}),l.jsx("path",{d:"M9 2v2"}),l.jsx("path",{d:"M9 20v2"})]})}const Jtr={jpg:"image/jpg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",pdf:"application/pdf"},enr=async e=>{try{const t=await fetch(e,{method:"HEAD"});if(!t.ok)throw new Error("Failed to get file content type");const n=t.headers.get("content-type");if(!n)throw new Error("Failed to get file content type");return n}catch{const r=new URL(e).pathname.split(".").pop();if(!r)return;const a=r.toLowerCase();return Jtr[a]}},tnr=({onOpenChange:e,open:t})=>{const n=rI(),r=Mer({onChange:()=>e(!1)}),a=async s=>{s.preventDefault();const o=new FormData(s.target).get("url-attachment")?.toString();if(o){const c=new File([],o,{type:await enr(o)});n.addAttachment(c),e(!1)}};return l.jsx(Mr,{onOpenChange:e,open:t,children:l.jsxs(Nr,{children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"Add attachment"}),l.jsx(ys,{children:"Add a file attachment via URL or from your computer"})]}),l.jsxs($r,{children:[l.jsxs("form",{onSubmit:a,className:"flex flex-row items-end gap-4",children:[l.jsxs("div",{className:"w-full space-y-1",children:[l.jsx(xt,{htmlFor:"url-attachment",className:"text-neutral3 text-ui-md",children:"Public URL"}),l.jsx(an,{type:"text",name:"url-attachment",id:"url-attachment",className:"w-full",placeholder:"https://placehold.co/600x400/png"})]}),l.jsxs(he,{type:"submit",className:"!h-8",variant:"light",children:[l.jsx(xe,{children:l.jsx(qGt,{})}),"Add"]})]}),l.jsx("hr",{className:"my-2 border border-border1"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(pe,{variant:"ui-md",className:"text-neutral3",children:"Or from your computer"}),l.jsxs("button",{onClick:r,className:"w-full h-40 border border-border1 rounded-lg text-neutral3 border-dashed flex flex-col items-center justify-center gap-2 hover:bg-surface2 active:bg-surface3",children:[l.jsx(NQt,{className:"size-12"}),l.jsx(pe,{variant:"header-md",children:"Add a local file"})]})]})]})]})})},nnr=e=>{const[t,n]=x.useState(void 0);return x.useEffect(()=>{if(!e){n(void 0);return}const r=URL.createObjectURL(e);return n(r),()=>{URL.revokeObjectURL(r)}},[e]),t},rnr=()=>{const{file:e,src:t}=cD(IWe(n=>{if(n.file)return n.file.name.startsWith("https://")?{src:n.file.name}:{file:n.file};const r=n.content?.filter(a=>a.type==="image")[0]?.image;return r?{src:r}:{}}));return nnr(e)??t},anr=()=>{const e=rI(),[t,n]=x.useState(!1);return x.useEffect(()=>{e.subscribe(()=>{const r=e.getState().attachments;n(r.length>0)})},[e]),t},snr=e=>{const[t,n]=x.useState({isLoading:!1,text:""});return x.useEffect(()=>{if(!e)return;(async()=>{n(s=>({...s,isLoading:!0}));const a=await e.text();n(s=>({...s,isLoading:!1,text:a}))})()},[e]),t},tL="h-full w-full flex items-center justify-center",Nyt=({data:e,url:t})=>{const[n,r]=x.useState(!1);return t?l.jsx("a",{href:t,className:tL,target:"_blank",rel:"noreferrer noopener",children:l.jsx(Nu,{className:"text-accent2","aria-label":"View PDF"})}):l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>r(!0),className:tL,type:"button",children:l.jsx(Nu,{className:"text-accent2","aria-label":"View PDF"})}),l.jsx(inr,{data:e,open:n,onOpenChange:r})]})},inr=({data:e,open:t,onOpenChange:n})=>l.jsx(Mr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{className:"max-w-4xl",children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"PDF preview"}),l.jsx(ys,{children:"Preview of the PDF document"})]}),l.jsx($r,{children:t&&l.jsx("iframe",{src:e,width:"100%",height:"600px"})})]})}),Ayt=({src:e})=>{const[t,n]=x.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>n(!0),type:"button",className:tL,children:l.jsx("img",{src:e,className:"object-cover aspect-ratio max-h-[140px] max-w-[320px]",alt:"Preview"})}),l.jsx(onr,{src:e,open:t,onOpenChange:n})]})},onr=({src:e,open:t,onOpenChange:n})=>l.jsx(Mr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{className:"max-w-4xl",children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"Image preview"}),l.jsx(ys,{children:"Preview of the image"})]}),l.jsx($r,{children:t&&l.jsx("img",{src:e,alt:"Image"})})]})}),Iyt=({data:e})=>{const[t,n]=x.useState(!1),r=e.replace(/<attachment[^>]*>/,"").replace(/<\/attachment>/g,"");return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>n(!0),className:tL,type:"button",children:l.jsx(Nu,{className:"text-neutral3"})}),l.jsx(lnr,{data:r,open:t,onOpenChange:n})]})},lnr=({data:e,open:t,onOpenChange:n})=>l.jsx(Mr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{className:"max-w-4xl h-[80vh]",children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"Text preview"}),l.jsx(ys,{children:"Preview of the text file"})]}),l.jsx($r,{children:t&&l.jsx("div",{className:"whitespace-pre-wrap",children:e})})]})}),cnr={sm:`${Yl.sm} w-form-sm`,md:`${Yl.md} w-form-md`,lg:`${Yl.lg} w-form-lg`,default:`${Yl.default}`},unr={sm:"sm",md:"default",lg:"lg",default:"default"},dnr={default:"bg-surface2 hover:bg-surface4 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",light:"bg-surface3 hover:bg-surface5 text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",outline:"bg-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",ghost:"bg-transparent border-transparent hover:bg-surface2 text-neutral3 hover:text-neutral6 disabled:opacity-50 disabled:cursor-not-allowed",primary:"bg-accent1 hover:bg-accent1/90 text-surface1 font-medium hover:shadow-glow-accent1 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:shadow-none"},fnr="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",cs=Oe.forwardRef(({className:e,children:t,tooltip:n,size:r="md",variant:a="default",disabled:s,...i},o)=>l.jsxs(er,{children:[l.jsx(tr,{asChild:!0,children:l.jsx("button",{ref:o,disabled:s,"aria-label":typeof n=="string"?n:void 0,className:Y(fnr,hR,dnr[a],cnr[r],s&&"active:scale-100",e),...i,children:l.jsx(xe,{size:unr[r],children:t})})}),l.jsx(Kn,{children:n})]}));cs.displayName="IconButton";const pnr={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function Jt({color:e,className:t,size:n="md"}){return l.jsx("svg",{className:Y("animate-spin",pnr[n],t),style:{animationDuration:"800ms",animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:e||"currentColor",className:"text-accent1"})})}const Ryt=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;typeof a=="string"?t(a):n(new Error("Failed to convert file to base64."))},r.onerror=a=>{n(a)},r.readAsDataURL(e)}),hnr=({document:e})=>{const{isLoading:t,text:n}=snr(e.file);return l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t?l.jsx(Jt,{className:"animate-spin"}):l.jsx(Iyt,{data:n})})},mnr=({document:e})=>{const[t,n]=x.useState({isLoading:!1,text:""});x.useEffect(()=>{let a=!1;return(async()=>{if(!e.file)return;n(o=>({...o,isLoading:!0}));const i=await Ryt(e.file);a||n(o=>({...o,isLoading:!1,text:i}))})(),()=>{a=!0}},[e]);const r=e.file?.name.startsWith("https://");return l.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.isLoading?l.jsx(Jt,{className:"animate-spin"}):l.jsx(Nyt,{data:t.text,url:r?e.file?.name:void 0})})},gnr=()=>{const e=cD(i=>i.type==="image"),t=cD(i=>i.type==="document"?i:void 0),n=rnr(),r=cD(i=>i.source!=="message"),s=t?.file?.name.startsWith("https://")?t?.file?.name:n;return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"relative",children:[l.jsx($5,{children:l.jsxs(er,{children:[l.jsx(WKe,{children:l.jsx(tr,{asChild:!0,children:l.jsx("div",{className:"overflow-hidden size-16 rounded-lg bg-surface3 border border-border1 ",children:e?l.jsx(Ayt,{src:s??""}):t?.contentType==="application/pdf"?l.jsx(mnr,{document:t}):t?l.jsx(hnr,{document:t}):null})})}),l.jsx(Kn,{side:"top",children:l.jsx(ZKe,{})})]})}),r&&l.jsx(vnr,{})]})})},vnr=()=>l.jsx(zqt,{asChild:!0,children:l.jsx(cs,{variant:"light",size:"md",tooltip:"Remove file",className:"absolute -right-3 -top-3 text-neutral3 hover:text-neutral6 bg-surface1 hover:bg-surface2 rounded-full p-1",children:l.jsx(xe,{children:l.jsx(xb,{})})})}),ynr=()=>anr()?l.jsx("div",{className:"flex w-full flex-row items-center gap-4 pb-2",children:l.jsx($We,{components:{Attachment:gnr}})}):null;function bnr({containerRef:e}){const[t,n]=x.useState([]),[r,a]=x.useState(null),s=x.useRef(""),i=x.useRef(0),o=x.useCallback(()=>{const u=e.current;if(!u){s.current!==""&&(s.current="",n([]));return}const d=u.getBoundingClientRect(),f=Array.from(u.querySelectorAll("[data-om-badge]"));if(f.length===0){s.current!==""&&(s.current="",n([]));return}const p=[];for(let m=0;m<f.length;m++){const g=f[m],v=g.getAttribute("data-om-badge")||"",b=g.getAttribute("data-om-state")||"complete",S=g.getAttribute("data-om-type")||"observation",O=g.getBoundingClientRect();let k;const E=xnr(f,m,S);if(E){const A=parseFloat(getComputedStyle(E).marginBottom)||0;k=E.getBoundingClientRect().bottom+A-d.top}else k=0;const C=parseFloat(getComputedStyle(g).marginBottom)||0,j=O.bottom+C-d.top-k;j<=0||p.push({cycleId:v,omType:S,state:b,top:k,height:j})}const h=JSON.stringify(p);h!==s.current&&(s.current=h,n(p))},[e]);if(x.useEffect(()=>{const u=e.current;if(!u)return;o();const d=new ResizeObserver(()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(o)});d.observe(u);const f=new MutationObserver(()=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(o)});return f.observe(u,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(i.current),d.disconnect(),f.disconnect()}},[o,e]),x.useEffect(()=>{const u=e.current;if(!u)return;const d=p=>{const h=p.target.closest("[data-om-badge]");h&&a(h.getAttribute("data-om-badge"))},f=p=>{p.target.closest("[data-om-badge]")&&a(null)};return u.addEventListener("mouseover",d),u.addEventListener("mouseout",f),()=>{u.removeEventListener("mouseover",d),u.removeEventListener("mouseout",f)}},[e]),t.length===0)return null;const c=t[t.length-1]?.cycleId??null;return l.jsx("div",{className:"pointer-events-none absolute inset-0",style:{zIndex:0},children:t.map(u=>{const d=u.cycleId===c,f=u.cycleId===r,p=r?f:d;return l.jsx(wnr,{highlight:u,visible:p},u.cycleId)})})}function xnr(e,t,n){for(let r=t-1;r>=0;r--){const a=e[r];if(a.getAttribute("data-om-state")!=="failed"&&(n==="observation"||a.getAttribute("data-om-type")==="reflection"))return a}return null}function wnr({highlight:e,visible:t}){const n=Snr(e.state),r=e.state.startsWith("buffering");return l.jsx("div",{className:"absolute left-0 right-0 transition-opacity duration-200",style:{top:e.top,height:e.height,border:`3px ${r?"dashed":"solid"} ${n}`,borderRadius:"0.5rem",opacity:t?1:0}})}function Snr(e){switch(e){case"complete":return"rgba(34, 197, 94, 0.4)";case"loading":return"rgba(59, 130, 246, 0.4)";case"failed":return"rgba(239, 68, 68, 0.4)";case"disconnected":return"rgba(234, 179, 8, 0.4)";case"buffering":return"rgba(168, 85, 247, 0.4)";case"buffering-complete":return"rgba(168, 85, 247, 0.4)";case"buffering-failed":return"rgba(239, 68, 68, 0.4)";case"activated":return"rgba(34, 197, 94, 0.4)";default:return"rgba(34, 197, 94, 0.4)"}}const Vn={colors:"transition-colors duration-normal ease-out-custom",all:"transition-all duration-normal ease-out-custom",opacity:"transition-opacity duration-normal ease-out-custom",allSlow:"transition-all duration-slow ease-out-custom"},tx={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},Onr={default:"text-neutral3 bg-surface4",success:"text-accent1 bg-accent1Dark",error:"text-accent2 bg-accent2Dark",info:"text-accent5 bg-accent5Dark",warning:"text-accent6 bg-accent6Dark"},knr={default:"text-neutral3",success:"text-accent1",error:"text-accent2",info:"text-accent5",warning:"text-accent6"},ut=({icon:e,variant:t="default",className:n,children:r,...a})=>l.jsxs("div",{className:Y("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",Vn.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":Onr[t],n),...a,children:[e&&l.jsx("span",{className:knr[t],children:l.jsx(xe,{children:e})}),r]}),Fz=({children:e,initialCollapsed:t=!0,icon:n,title:r,collapsible:a=!0,extraInfo:s,"data-testid":i})=>{const[o,c]=x.useState(t);return x.useEffect(()=>{c(t)},[t]),l.jsxs("div",{className:"mb-4","data-testid":i,children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[l.jsxs("button",{onClick:a?()=>c(u=>!u):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!a,type:"button",children:[l.jsx(xe,{children:l.jsx(Gw,{className:Y("transition-all",o?"rotate-90":"rotate-180")})}),l.jsx(ut,{icon:n,children:r})]}),s]}),!o&&l.jsx("div",{className:"pt-2",children:l.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})};function _nr(e,t=5){if(!e?.properties)return[];const n=[];function r(a,s,i){if(i>t)return;const o=Array.isArray(a.type)?a.type.join(" | "):a.type;if(n.push({path:s,label:s,description:a.description??a.title,type:o}),a.properties)for(const[c,u]of Object.entries(a.properties))r(u,`${s}.${c}`,i+1);if(a.items?.properties)for(const[c,u]of Object.entries(a.items.properties))r(u,`${s}[].${c}`,i+1)}for(const[a,s]of Object.entries(e.properties))r(s,a,1);return n}function Enr(e){const t=_nr(e);return Tnt({override:[Cnr(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function Cnr(e){return t=>{const r=t.state.sliceDoc(Math.max(0,t.pos-50),t.pos).match(/\{\{([a-zA-Z0-9_.\[\]]*)?$/);if(!r)return null;const a=r[1]??"",s=t.pos-a.length,i=a?e.filter(c=>c.path.toLowerCase().startsWith(a.toLowerCase())):e;if(i.length===0)return null;const o=i.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,p)=>{const g=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:g},selection:{anchor:f+g.length}})}}));return{from:s,options:o,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const jnr=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,Tnr=tn.mark({class:"cm-variable-highlight"}),O5e=new Htt({regexp:jnr,decoration:()=>Tnr}),Nnr=mi.fromClass(class{decorations;constructor(e){this.decorations=O5e.createDeco(e)}update(e){this.decorations=O5e.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),Anr=Nnr,Inr={duration:5e3,cancel:{label:l.jsx(xe,{children:l.jsx(Sr,{})}),onClick:()=>{}},unstyled:!0,classNames:{toast:"bg-surface3 w-full h-auto rounded-lg gap-2 border border-border1 px-3 py-2 flex items-center justify-between pointer-events-auto shadow-card [&>[data-content]]:flex-1",title:"text-xs font-medium text-neutral5",description:"text-xs text-neutral3",cancelButton:"!bg-transparent hover:!bg-surface2 !border-none !rounded-md !p-1.5 !m-0 !text-neutral3 hover:!text-neutral6 shrink-0 transition-all",actionButton:"!bg-white flex items-center justify-center font-medium !text-black order-last hover:opacity-80"}};function Ed(e){const{classNames:t,...n}=Inr,{classNames:r,...a}=e||{};return{...n,classNames:{...t,title:Y(t?.title,r?.title),toast:Y(t?.toast,r?.toast),cancelButton:Y(t?.cancelButton,r?.cancelButton),actionButton:Y(t?.actionButton,r?.actionButton),description:Y(t?.description,r?.description)},...a}}const De=(e,t={})=>{if(Array.isArray(e))return e.forEach(n=>Jl(n,Ed(t)));if(Oe.isValidElement(e))return Jl(e,Ed(t));if(typeof e=="string")return Jl(e,Ed(t));throw new Error("Invalid message type")};De.success=(e,t={})=>{const n={...t,icon:l.jsx(xe,{className:"text-accent1 shrink-0",children:l.jsx(b6,{})}),classNames:{...t.classNames,toast:Y("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Jl.success(e,Ed(n));case"object":return e.forEach(r=>Jl.success(r,Ed(n)))}};De.error=(e,t={})=>{const n={...t,icon:l.jsx(xe,{className:"text-accent2 shrink-0",children:l.jsx(xb,{})}),classNames:{...t.classNames,toast:Y("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Jl.error(e,Ed(n));case"object":return e.forEach(r=>Jl.error(r,Ed(n)))}};De.warning=(e,t={})=>{const n={...t,icon:l.jsx(xe,{className:"text-accent6 shrink-0",children:l.jsx(Af,{})}),classNames:{...t.classNames,toast:Y("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Jl.warning(e,Ed(n));case"object":return e.forEach(r=>Jl.warning(r,Ed(n)))}};De.info=(e,t={})=>{const n={...t,icon:l.jsx(xe,{className:"text-accent3 shrink-0",children:l.jsx(Gl,{})}),classNames:{...t.classNames,toast:Y("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:Y("text-xs text-neutral5",t.classNames?.title),description:Y("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Jl.info(e,Ed(n));case"object":return e.forEach(r=>Jl.info(r,Ed(n)))}};De.custom=(e,t={})=>Jl(e,Ed(t));De.dismiss=e=>{e&&Jl.dismiss(e)};De.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:a,onError:s,options:i={}})=>Jl.promise(e,{loading:t??"Loading...",success:o=>(a?.(o),n),error:o=>(s?.(o),r||o?.message||"Error..."),...Ed(i)});function Vf({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=x.useState(!1),a=x.useRef(null),s=x.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{De.success(t),r(!0),a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{De.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:s}}function ho({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:a}){const[s,i]=x.useState(!1),{handleCopy:o}=Vf({text:e,copyMessage:t}),c=()=>{o(),i(!0),setTimeout(()=>i(!1),2e3)};return l.jsxs(er,{children:[l.jsx(tr,{asChild:!0,children:l.jsx(he,{onClick:c,type:"button",size:r,className:a,"aria-label":s?"Copied!":n,children:s?l.jsx(va,{}):l.jsx(tc,{})})}),l.jsx(Kn,{children:s?"Copied!":n})]})}const kv=()=>x.useMemo(()=>{const e=Q6({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)"},styles:[{tag:[fe.className,fe.propertyName],color:"var(--neutral6)"},{tag:fe.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[fe.heading1,fe.heading2,fe.heading3,fe.heading4,fe.heading5,fe.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:fe.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:fe.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:fe.link,color:"var(--accent3)",textDecoration:"underline"},{tag:fe.url,color:"var(--accent3)"},{tag:fe.monospace,color:"var(--neutral6)"},{tag:fe.strikethrough,textDecoration:"line-through"},{tag:fe.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=vt.theme({".cm-editor":{backgroundColor:"transparent"},".cm-content":{color:"var(--neutral6)"},".cm-lineNumbers .cm-gutterElement":{color:"var(--neutral2)"},".cm-activeLineGutter":{color:"var(--neutral3)"},".cm-cursor":{borderLeftColor:"var(--neutral6)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--accent3) 22%, transparent)"},".cm-tooltip-autocomplete":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",borderRadius:"6px",boxShadow:"0 8px 16px rgba(0, 0, 0, 0.2)"},".cm-tooltip-autocomplete > ul":{fontFamily:"var(--geist-mono)"},".cm-completionLabel":{color:"var(--neutral6)"},".cm-completionDetail":{color:"var(--neutral3)",fontSize:"0.7rem",marginLeft:"auto",paddingLeft:"12px"},".cm-completionInfo":{backgroundColor:"var(--surface2)",border:"1px solid var(--border1)",color:"var(--neutral3)",padding:"8px 12px"},".cm-completionIcon":{display:"none"},"ul.cm-completionList li[aria-selected]":{backgroundColor:"var(--surface4)",color:"var(--neutral6)"},".cm-line .cm-variable-highlight":{color:"var(--accent6) !important",fontWeight:"500"}});return[e,t]},[]),os=x.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:a,language:s="json",highlightVariables:i=!1,placeholder:o,schema:c,autoFocus:u,lineNumbers:d=!0,...f},p)=>{const h=kv(),m=e?JSON.stringify(e,null,2):t??"",g=x.useMemo(()=>{const v=[];return s==="json"?v.push(Sd):s==="markdown"&&(v.push(mde({base:lw,codeLanguages:Xrt})),v.push(vt.lineWrapping)),i&&s==="markdown"&&v.push(Anr),c&&s==="markdown"&&v.push(Enr(c)),v},[s,i,c]);return l.jsxs("div",{className:Y("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",a),...f,children:[r&&l.jsx(ho,{content:m,className:"absolute top-2 right-2 z-20"}),l.jsx(Id,{ref:p,value:m,theme:h,extensions:g,onChange:n,"aria-label":"Code editor",placeholder:o,height:"100%",style:{height:"100%"},autoFocus:u,basicSetup:{lineNumbers:d}})]})});async function Rnr(e,t){const{codeToTokens:n,bundledLanguages:r}=await Qe(async()=>{const{codeToTokens:s,bundledLanguages:i}=await import("./index-Cll9sYRS.js");return{codeToTokens:s,bundledLanguages:i}},__vite__mapDeps([26,2]),import.meta.url);if(!(t in r))return null;const{tokens:a}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return a}const Pnr=({selectionReason:e,open:t,onOpenChange:n,input:r})=>{let a=null;if(r)try{a=typeof r=="object"?l.jsx(os,{data:r}):l.jsx(os,{data:JSON.parse(r)})}catch{a=l.jsx("pre",{className:"whitespace-pre-wrap",children:r})}return l.jsx(Mr,{open:t,onOpenChange:n,children:l.jsxs(Nr,{children:[l.jsxs(Dr,{children:[l.jsx(Ar,{children:"Agent Network Metadata"}),l.jsx(ys,{children:"View the metadata of the agent's network choice."})]}),l.jsxs($r,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(pe,{className:"text-neutral3",children:"Selection Reason"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),a&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(pe,{className:"text-neutral3",children:"Input"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:a})]})]})]})})},Ume=({selectionReason:e,input:t})=>{const[n,r]=x.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(cs,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>r(a=>!a),children:l.jsx(VWt,{className:"text-neutral3 size-5"})}),l.jsx(Pnr,{selectionReason:e||"",open:n,onOpenChange:r,input:t})]})},Pyt=x.createContext(void 0);function Mnr({children:e,approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:a,approveNetworkToolcall:s,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:c,networkToolCallApprovals:u}){return l.jsx(Pyt.Provider,{value:{approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:a,approveNetworkToolcall:s,declineNetworkToolcall:i,isRunning:o,toolCallApprovals:c,networkToolCallApprovals:u},children:e})}function Dnr(){const e=x.useContext(Pyt);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const mR=({toolCalled:e,toolCallId:t,toolApprovalMetadata:n,toolName:r,isNetwork:a,isGenerateMode:s})=>{const{approveToolcall:i,declineToolcall:o,approveToolcallGenerate:c,declineToolcallGenerate:u,isRunning:d,toolCallApprovals:f,approveNetworkToolcall:p,declineNetworkToolcall:h,networkToolCallApprovals:m}=Dnr(),g=()=>{a?p(r,n?.runId):s?c(t):i(t)},v=()=>{a?h(r,n?.runId):s?u(t):o(t)},b=a?m?.[n?.runId?`${n.runId}-${r}`:r]?.status:f?.[t]?.status;return n&&!e?l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Approval required"}),l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxs(he,{onClick:g,disabled:d||!!b,className:b==="approved"?"!text-accent1":"",children:[l.jsx(xe,{children:l.jsx(va,{})}),"Approve"]}),l.jsxs(he,{onClick:v,disabled:d||!!b,className:b==="declined"?"!text-accent2":"",children:[l.jsx(xe,{children:l.jsx(Sr,{})}),"Decline"]})]})]}):null},$nr=({agentId:e,messages:t=[],metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u=!1})=>{const d=n?.mode==="network"?n.selectionReason:void 0,f=n?.mode==="network"?n.agentInput:void 0;let p=t.length>0;i&&(p=c??t.every(m=>m.type==="text"?!0:!!m.toolOutput));let h=typeof o=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):l.jsx(os,{data:o,"data-testid":"tool-suspend-payload"});return l.jsxs(Fz,{"data-testid":"agent-badge",icon:l.jsx($s,{className:"text-accent1"}),title:e,initialCollapsed:u,extraInfo:n?.mode==="network"&&l.jsx(Ume,{selectionReason:d??"",input:f}),children:[t.map((m,g)=>{if(m.type==="text")return l.jsx(met,{children:m.content},g);let v;try{v=typeof m.toolOutput=="string"?JSON.parse(m.toolOutput):m.toolOutput}catch{v=m.toolOutput}return l.jsx(Oe.Fragment,{children:l.jsx(pbt,{toolName:m.toolName,argsText:typeof m.args=="string"?m.args:JSON.stringify(m.args),result:v,args:m.args,status:{type:"complete"},type:"tool-call",toolCallId:m.toolCallId,addResult:()=>{},resume:()=>{},metadata:{mode:"stream"}})},g)}),h!==void 0&&o&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Agent suspend payload"}),h]}),l.jsx(mR,{toolCalled:p,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,isGenerateMode:n?.mode==="generate"})]})};function In({className:e,...t}){return l.jsx("div",{className:Y("rounded-md bg-surface4 relative overflow-hidden","before:absolute before:inset-0","before:translate-x-[-100%]","before:animate-[shimmer_2s_infinite]","before:bg-gradient-to-r before:from-transparent before:via-surface5/20 before:to-transparent",e),...t})}const Vme=()=>l.jsx(Fz,{icon:l.jsx(Jt,{color:C6.neutral3}),title:l.jsx(In,{className:"ml-2 w-12 h-2"}),collapsible:!1}),Lnr=({agentId:e,result:t,metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u})=>{const{data:d,isLoading:f}=iyt({threadId:t?.subAgentThreadId,agentId:e,memory:!0});if(f)return l.jsx(Vme,{});const p=d?.messages?kHe(d.messages):[],h=t?.childMessages??G6t(p);return l.jsx($nr,{agentId:e,messages:h,metadata:n,toolCallId:r,toolApprovalMetadata:a,toolName:s,isNetwork:i,suspendPayload:o,toolCalled:c,isComplete:u})},zz=({copiedDuration:e=1500}={})=>{const[t,n]=x.useState(!1);return{isCopied:t,copyToClipboard:a=>{a&&navigator.clipboard.writeText(a).then(()=>{n(!0),setTimeout(()=>n(!1),e)})}}},Myt=x.createContext({Link:x.forwardRef(()=>null),navigate:()=>{},paths:{agentLink:()=>"",agentsLink:()=>"",agentToolLink:()=>"",agentSkillLink:()=>"",agentThreadLink:()=>"",agentNewThreadLink:()=>"",workflowsLink:()=>"",workflowLink:()=>"",networkLink:()=>"",networkNewThreadLink:()=>"",networkThreadLink:()=>"",scorerLink:()=>"",cmsScorersCreateLink:()=>"",cmsScorerEditLink:()=>"",cmsAgentCreateLink:()=>"",cmsAgentEditLink:()=>"",promptBlockLink:()=>"",promptBlocksLink:()=>"",cmsPromptBlockCreateLink:()=>"",cmsPromptBlockEditLink:()=>"",toolLink:()=>"",skillLink:()=>"",workspacesLink:()=>"",workspaceLink:()=>"",workspaceSkillLink:()=>"",processorsLink:()=>"",processorLink:()=>"",mcpServerLink:()=>"",mcpServerToolLink:()=>"",workflowRunLink:()=>"",datasetLink:()=>"",datasetItemLink:()=>"",datasetExperimentLink:()=>""}}),Dyt=({children:e,Link:t,navigate:n,paths:r})=>l.jsx(Myt.Provider,{value:{Link:t,navigate:n,paths:r},children:e}),Nt=()=>{const e=x.useContext(Myt);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},Fnr=({toolName:e,args:t,result:n,toolCallId:r,toolApprovalMetadata:a,isNetwork:s,toolCalled:i})=>{const[o,c]=x.useState(!a),{isCopied:u,copyToClipboard:d}=zz();x.useEffect(()=>{c(!a)},[a]);const{Link:f}=Nt();let p={path:"."};try{p=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h=".",maxDepth:m,showHidden:g,dirsOnly:v,exclude:b,extension:S}=p,O=[];m!==void 0&&m!==3&&O.push(`depth: ${m}`),g&&O.push("hidden"),v&&O.push("dirs only"),b&&O.push(`exclude: ${b}`),S&&O.push(`ext: ${S}`);let k="",E="";if(typeof n=="string"&&n){const M=n.lastIndexOf(`
458
458
 
459
459
  `);M!==-1?(k=n.slice(0,M),E=n.slice(M+2)):k=n}const C=!!k,T=i??C,j=Wn(M=>M.message),I=x.useMemo(()=>j.content.find(B=>B.type==="data"&&B.name==="workspace-metadata"&&B.data?.toolCallId===r),[j.content,r])?.data,P=()=>{!k||u||d(k)};return l.jsxs("div",{className:"mb-4","data-testid":"file-tree-badge",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs("button",{onClick:()=>c(M=>!M),className:"flex items-center gap-2 min-w-0",type:"button",children:[l.jsx(xe,{children:l.jsx(Gw,{className:Y("transition-all",o?"rotate-90":"rotate-180")})}),l.jsxs(ut,{icon:l.jsx(yGt,{className:"text-accent6",size:16}),children:["List Files ",l.jsx("span",{className:"text-neutral6 font-normal ml-1",children:h}),O.length>0&&l.jsxs("span",{className:"text-neutral4 font-normal ml-1",children:["(",O.join(", "),")"]})]})]}),I?.filesystem&&l.jsxs(f,{href:I.id?`/workspaces/${I.id}?path=${encodeURIComponent(h)}`:"/workspaces",className:"flex items-center gap-1.5 text-xs text-neutral6 px-1.5 py-0.5 rounded bg-surface3 border border-border1 hover:bg-surface4 hover:border-border2 transition-colors",children:[l.jsx(Mte,{className:"size-3"}),l.jsx("span",{children:I.name||I.filesystem.name})]}),o&&C&&E&&l.jsx("span",{className:"text-neutral6 text-xs",children:E})]}),!o&&l.jsxs("div",{className:"pt-2",children:[a&&!T&&l.jsxs("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),l.jsx(os,{data:p,"data-testid":"tool-args"})]}),l.jsx(mR,{toolCalled:T,toolCallId:r,toolApprovalMetadata:a,toolName:e,isNetwork:s})]}),T&&k&&l.jsxs("div",{className:"rounded-md border border-border1 bg-surface2 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border1 bg-surface3",children:[E&&l.jsx("span",{className:"text-neutral6 text-xs",children:E}),l.jsx(cs,{variant:"light",size:"sm",tooltip:"Copy tree",onClick:P,disabled:!k,children:l.jsxs("span",{className:"grid",children:[l.jsx("span",{style:{gridArea:"1/1"},className:Y("transition-transform",u?"scale-100":"scale-0"),children:l.jsx(va,{size:14})}),l.jsx("span",{style:{gridArea:"1/1"},className:Y("transition-transform",u?"scale-0":"scale-100"),children:l.jsx(tc,{size:14})})]})})]}),l.jsx("pre",{className:"p-3 text-xs font-mono text-mastra-el-6 overflow-x-auto whitespace-pre max-h-[300px] overflow-y-auto",children:k})]}),T&&!C&&l.jsx("div",{className:"rounded-md border border-border1 bg-surface2 px-3 py-2",children:l.jsx("span",{className:"text-xs text-neutral6",children:"Loading..."})})]})]})};function Bk({children:e}){const t=e.replace(/\\n/g,`
460
460
  `);return l.jsx(met,{remarkPlugins:[hst],components:Bnr,className:"space-y-3",children:t})}const $yt=Oe.memo(({children:e,language:t,...n})=>{const[r,a]=x.useState([]);return x.useEffect(()=>{Rnr(e,t).then(s=>{s&&a(s)})},[e,t]),r.length?l.jsx("pre",{...n,children:l.jsx("code",{children:r.map((s,i)=>l.jsxs(l.Fragment,{children:[l.jsx("span",{children:s.map((o,c)=>{const u=typeof o.htmlStyle=="string"?void 0:o.htmlStyle;return l.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:u,children:o.content},c)})},i),i!==r.length-1&&`
@@ -507,4 +507,4 @@ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}
507
507
  `),c=s;c<o.length;c++){var u=o[c];if(!(u.length>1024)){var d=SFe.test(u)?u.replace(SFe,"$1"):u;if(!d.match(/\S*Error: /)){for(var f of n){var p=f(d,e);if(p){i.push(p);break}}if(i.length>=OFe)break}}}return(function(h){if(!h.length)return[];var m=Array.from(h);return m.reverse(),m.slice(0,OFe).map((g=>{return Lt({},g,{filename:g.filename||(v=m,v[v.length-1]||{}).filename,function:g.function||Zk});var v}))})(i)}})("web:javascript",Jxr,n0r)}class a0r{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=oo(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return dL(t,"DOMException")}isDOMError(t){return dL(t,"DOMError")}}class s0r{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class i0r{constructor(){}match(t){return dL(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r,a=n.apply(t.error);return a||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var o0r=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class l0r{match(t){return typeof t=="string"}coerce(t,n){var r,[a,s]=this.getInfos(t);return{type:a??"Error",value:s??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,a=t.match(o0r);return a&&(n=a[1],r=a[2]),[n,r]}}var c0r=["fatal","error","warning","log","info","debug"];function wSt(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var a=n.slice(0,r).join(", ");if(!(a.length>t))return r===n.length||a.length<=t?a:a.slice(0,t)+"..."}return""}class u0r{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,a=this.getErrorPropertyFromObject(t);return a?n.apply(a):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return $ge(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+wSt(t)}isSeverityLevel(t){return oo(t)&&!Fse(t)&&c0r.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(Gxr(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class d0r{match(t){return $ge(t)}coerce(t,n){var r,a=t.constructor.name;return{type:a,value:a+" captured as exception with keys: "+wSt(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class f0r{match(t){return rSt(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class p0r{match(t){return dL(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!$ge(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,a=this.getUnhandledRejectionReason(t);return rSt(a)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(a),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(a)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var SSt=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k:function(a){if(Ge&&(ff.DEBUG||Fn.POSTHOG_DEBUG||n)&&!Ht(Ge.console)&&Ge.console){for(var s=("__rrweb_original__"in Ge.console[a])?Ge.console[a].__rrweb_original__:Ge.console[a],i=arguments.length,o=new Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];s(e,...o)}},info:function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];r.k("log",...s)},warn:function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];r.k("warn",...s)},error:function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];r.k("error",...s)},critical:function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];console.error(e,...s)},uninitializedWarning:a=>{r.error("You must initialize PostHog before calling "+a)},createLogger:(a,s)=>SSt(e+" "+a,s)};return r},Gt=SSt("[PostHog.js]"),bi=Gt.createLogger,h0r=bi("[ExternalScriptsLoader]"),kFe=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return h0r.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Vt?.querySelectorAll("script");if(r){for(var a,s=function(){if(r[i].src===t){var c=r[i];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(u=>{c.__posthog_loading_callback_fired=!0,n(void 0,u)})),c.onerror=u=>n(u),{v:void 0})}},i=0;i<r.length;i++)if(a=s())return a.v}var o=()=>{if(!Vt)return n("document not found");var c=Vt.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=t,c.onload=f=>{c.__posthog_loading_callback_fired=!0,n(void 0,f)},c.onerror=f=>n(f),e.config.prepare_external_dependency_script&&(c=e.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")Vt.head.appendChild(c);else{var u,d=Vt.querySelectorAll("body > script");d.length>0?(u=d[0].parentNode)==null||u.insertBefore(c,d[0]):Vt.body.appendChild(c)}};Vt!=null&&Vt.body?o():Vt?.addEventListener("DOMContentLoaded",o)};Fn.__PosthogExtensions__=Fn.__PosthogExtensions__||{},Fn.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/"+t+".js?v="+e.version;if(t==="remote-config"&&(r="/array/"+e.config.token+"/config.js"),t==="toolbar"){var a=3e5;r=r+"&t="+Math.floor(Date.now()/a)*a}var s=e.requestRouter.endpointFor("assets",r);kFe(e,s,n)},Fn.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);kFe(e,r,n)};var pL={};function ob(e,t,n){if(Aa(e)){if(fFe&&e.forEach===fFe)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,a=e.length;r<a;r++)if(r in e&&t.call(n,e[r],r)===pL)return}}}function Is(e,t,n){if(!Jr(e)){if(Aa(e))return ob(e,t,n);if(Ixr(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===pL)return}else for(var a in e)if(nSt.call(e,a)&&t.call(n,e[a],a)===pL)return}}var qi=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ob(n,(function(a){for(var s in a)a[s]!==void 0&&(e[s]=a[s])})),e},Yk=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ob(n,(function(a){ob(a,(function(s){e.push(s)}))})),e};function ZD(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var _Fe=function(e){try{return e()}catch{return}},m0r=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(a){Gt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Gt.critical(a)}}},Uge=function(e){var t={};return Is(e,(function(n,r){(oo(n)&&n.length>0||Om(n))&&(t[r]=n)})),t};function g0r(e,t){return n=e,r=s=>oo(s)&&!sh(t)?s.slice(0,t):s,a=new Set,(function s(i,o){return i!==Object(i)?r?r(i,o):i:a.has(i)?void 0:(a.add(i),Aa(i)?(c=[],ob(i,(u=>{c.push(s(u))}))):(c={},Is(i,((u,d)=>{a.has(u)||(c[d]=s(u,d))}))),c);var c})(n);var n,r,a}var v0r=["herokuapp.com","vercel.app","netlify.app"];function y0r(e){var t=e?.hostname;if(!oo(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of v0r)if(n===r)return!1;return!0}function OSt(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function ro(e,t,n,r){var{capture:a=!1,passive:s=!0}=r??{};e?.addEventListener(t,n,{capture:a,passive:s})}function kSt(e){return e.name==="ph_toolbar_internal"}var _St="$people_distinct_id",mj="__alias",gj="__timers",EFe="$autocapture_disabled_server_side",qse="$heatmaps_enabled_server_side",CFe="$exception_capture_enabled_server_side",Hse="$error_tracking_suppression_rules",jFe="$error_tracking_capture_extension_exceptions",TFe="$web_vitals_enabled_server_side",ESt="$dead_clicks_enabled_server_side",NFe="$product_tours_enabled_server_side",AFe="$web_vitals_allowed_metrics",Z2="$session_recording_remote_config",hL="$sesid",CSt="$session_is_sampled",nO="$enabled_feature_flags",vj="$early_access_features",Qse="$feature_flag_details",yj="$stored_person_properties",r0="$stored_group_properties",Gse="$surveys",nT="$flag_call_reported",Wse="$flag_call_reported_session_id",Zse="$feature_flag_errors",mL="$feature_flag_evaluated_at",Nh="$user_state",Yse="$client_session_props",Xse="$capture_rate_limit",Kse="$initial_campaign_params",Jse="$initial_referrer_info",gL="$initial_person_info",vL="$epp",jSt="__POSTHOG_TOOLBAR__",RC="$posthog_cookieless",b0r=[_St,mj,"__cmpns",gj,"$session_recording_enabled_server_side",qse,hL,nO,Hse,Nh,vj,Qse,r0,yj,Gse,nT,Wse,Zse,mL,Yse,Xse,Kse,Jse,vL,gL];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Om(e)&&isFinite(e)&&Math.floor(e)===e});var IFe="0123456789abcdef";class yL{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,a){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(a)||t<0||n<0||r<0||a<0||t>0xffffffffffff||n>4095||r>1073741823||a>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=a>>>24,s[13]=a>>>16,s[14]=a>>>8,s[15]=a,new yL(s)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+IFe.charAt(this.bytes[n]>>>4)+IFe.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new yL(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class x0r{constructor(){this.P=0,this.T=0,this.R=new w0r}generate(){var t=this.generateOrAbort();if(Ht(t)){this.P=0;var n=this.generateOrAbort();if(Ht(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.P)this.P=t,this.I();else{if(!(t+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.I())}return yL.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.R.nextUint32())}I(){this.T=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}}var RFe,TSt=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Ge&&!Ht(Ge.crypto)&&crypto.getRandomValues&&(TSt=e=>crypto.getRandomValues(e));class w0r{constructor(){this.C=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.C.length&&(TSt(this.C),this.O=0),this.C[this.O++]}}var Hy=()=>S0r().toString(),S0r=()=>(RFe||(RFe=new x0r)).generate(),PC="",O0r=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function k0r(e,t){if(t){var n=(function(a,s){if(s===void 0&&(s=Vt),PC)return PC;if(!s||["localhost","127.0.0.1"].includes(a))return"";for(var i=a.split("."),o=Math.min(i.length,8),c="dmn_chk_"+Hy();!PC&&o--;){var u=i.slice(o).join("."),d=c+"=1;domain=."+u+";path=/";s.cookie=d+";max-age=3",s.cookie.includes(c)&&(s.cookie=d+";max-age=0",PC=u)}return PC})(e);if(!n){var r=(a=>{var s=a.match(O0r);return s?s[0]:""})(e);r!==n&&Gt.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Uh={F:()=>!!Vt,M:function(e){Gt.error("cookieStore error: "+e)},A:function(e){if(Vt){try{for(var t=e+"=",n=Vt.cookie.split(";").filter((s=>s.length)),r=0;r<n.length;r++){for(var a=n[r];a.charAt(0)==" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return decodeURIComponent(a.substring(t.length,a.length))}}catch{}return null}},D:function(e){var t;try{t=JSON.parse(Uh.A(e))||{}}catch{}return t},L:function(e,t,n,r,a){if(Vt)try{var s="",i="",o=k0r(Vt.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),s="; expires="+c.toUTCString()}a&&(i="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+i;return u.length>3686.4&&Gt.warn("cookieStore warning: large cookie, len="+u.length),Vt.cookie=u,u}catch{return}},j:function(e,t){if(Vt!=null&&Vt.cookie)try{Uh.L(e,"",-1,t)}catch{return}}},ZJ=null,di={F:function(){if(!sh(ZJ))return ZJ;var e=!0;if(Ht(Ge))e=!1;else try{var t="__mplssupport__";di.L(t,"xyz"),di.A(t)!=='"xyz"'&&(e=!1),di.j(t)}catch{e=!1}return e||Gt.error("localStorage unsupported; falling back to cookie store"),ZJ=e,e},M:function(e){Gt.error("localStorage error: "+e)},A:function(e){try{return Ge?.localStorage.getItem(e)}catch(t){di.M(t)}return null},D:function(e){try{return JSON.parse(di.A(e))||{}}catch{}return null},L:function(e,t){try{Ge?.localStorage.setItem(e,JSON.stringify(t))}catch(n){di.M(n)}},j:function(e){try{Ge?.localStorage.removeItem(e)}catch(t){di.M(t)}}},_0r=["$device_id","distinct_id",hL,CSt,vL,gL,Nh],Y2={},E0r={F:function(){return!0},M:function(e){Gt.error("memoryStorage error: "+e)},A:function(e){return Y2[e]||null},D:function(e){return Y2[e]||null},L:function(e,t){Y2[e]=t},j:function(e){delete Y2[e]}},Qx=null,vl={F:function(){if(!sh(Qx))return Qx;if(Qx=!0,Ht(Ge))Qx=!1;else try{var e="__support__";vl.L(e,"xyz"),vl.A(e)!=='"xyz"'&&(Qx=!1),vl.j(e)}catch{Qx=!1}return Qx},M:function(e){Gt.error("sessionStorage error: ",e)},A:function(e){try{return Ge?.sessionStorage.getItem(e)}catch(t){vl.M(t)}return null},D:function(e){try{return JSON.parse(vl.A(e))||null}catch{}return null},L:function(e,t){try{Ge?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){vl.M(n)}},j:function(e){try{Ge?.sessionStorage.removeItem(e)}catch(t){vl.M(t)}}},xg=(function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e})({});class C0r{constructor(t){this._instance=t}get N(){return this._instance.config}get consent(){return this.U()?xg.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===xg.DENIED||this.consent===xg.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===xg.DENIED}optInOut(t){this.B.L(this.q,t?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.j(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get H(){var t=this.B.A(this.q);return QJ(t)?xg.GRANTED:Vr(Mxr,t)?xg.DENIED:xg.PENDING}get B(){if(!this.V){var t=this.N.opt_out_capturing_persistence_type;this.V=t==="localStorage"?di:Uh;var n=t==="localStorage"?Uh:di;n.A(this.q)&&(this.V.A(this.q)||this.optInOut(QJ(n.A(this.q))),n.j(this.q,this.N.cross_subdomain_cookie))}return this.V}U(){return!!this.N.respect_dnt&&!!OSt([bd?.doNotTrack,bd?.msDoNotTrack,Fn.doNotTrack],(t=>QJ(t)))}}var X2=bi("[Dead Clicks]"),j0r=()=>!0,T0r=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(ESt)),r=e.instance.config.capture_dead_clicks;return qg(r)?r:!!Ao(r)||n};class PFe{get lazyLoadedDeadClicksAutocapture(){return this.W}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[ESt]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.G((()=>{this.Y()})):this.stop()}G(t){var n,r;(n=Fn.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=Fn.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(a=>{a?X2.error("failed to load script",a):t()}))}Y(){var t;if(Vt){if(!this.W&&(t=Fn.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Ao(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.W=Fn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.W.start(Vt),X2.info("starting...")}}else X2.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,X2.info("stopping..."))}}var YJ=bi("[SegmentIntegration]");function N0r(e,t){var n=e.config.segment;if(!n)return t();(function(r,a){var s=r.config.segment;if(!s)return a();var i=c=>{var u=()=>c.anonymousId()||Hy();r.config.get_device_id=u,c.id()&&(r.register({distinct_id:c.id(),$device_id:u()}),r.persistence.set_property(Nh,"identified")),a()},o=s.user();"then"in o&&Pg(o.then)?o.then(i):i(o)})(e,(()=>{n.register((r=>{Promise&&Promise.resolve||YJ.warn("This browser does not have Promise support, and can not use the segment integration");var a=(s,i)=>{if(!i)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(YJ.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(YJ.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var o=r.calculateEventProperties(i,s.event.properties);return s.event.properties=Object.assign({},o,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>a(s,s.event.event),page:s=>a(s,"$pageview"),identify:s=>a(s,"$identify"),screen:s=>a(s,"$screen")}})(e)).then((()=>{t()}))}))}var NSt="posthog-js";function ASt(e,t){var{organization:n,projectId:r,prefix:a,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}=t===void 0?{}:t;return o=>{var c,u,d,f,p;if(!(s==="*"||s.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());o.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var m,g=((c=o.exception)==null?void 0:c.values)||[],v=g.map((S=>Lt({},S,{stacktrace:S.stacktrace?Lt({},S.stacktrace,{type:"raw",frames:(S.stacktrace.frames||[]).map((O=>Lt({},O,{platform:"web:javascript"})))}):void 0}))),b={$exception_message:((u=g[0])==null?void 0:u.value)||o.message,$exception_type:(d=g[0])==null?void 0:d.type,$exception_level:o.level,$exception_list:v,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=g[0])==null?void 0:f.value)||o.message,$sentry_exception_type:(p=g[0])==null?void 0:p.type,$sentry_tags:o.tags};return n&&r&&(b.$sentry_url=(a||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+o.event_id),i&&((m=e.exceptions)==null||m.sendExceptionEvent(b)),o}}class A0r{constructor(t,n,r,a,s,i){this.name=NSt,this.setupOnce=function(o){o(ASt(t,{organization:n,projectId:r,prefix:a,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}}class MFe{constructor(t){this.J=(n,r,a)=>{a&&(a.noSessionId||a.activityTimeout||a.sessionPastMaximumLength)&&(Gt.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:a}),this.K=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.X()}X(){var t;this.Z=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.J)}destroy(){var t;(t=this.Z)==null||t.call(this),this.Z=void 0}doPageView(t,n){var r,a=this.tt(t,n);return this.K={pathname:(r=Ge?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),a}doPageLeave(t){var n;return this.tt(t,(n=this.K)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.K)==null?void 0:t.pageViewId}}tt(t,n){var r=this.K;if(!r)return{$pageview_id:n};var a={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:o,maxScrollY:c,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(Ht(i)||Ht(o)||Ht(c)||Ht(u)||Ht(d)||Ht(f))){i=Math.ceil(i),o=Math.ceil(o),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);var p=i<=1?1:tm(o/i,0,1,Gt),h=i<=1?1:tm(c/i,0,1,Gt),m=u<=1?1:tm(d/u,0,1,Gt),g=u<=1?1:tm(f/u,0,1,Gt);a=qi(a,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:m,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:g})}}return r.pathname&&(a.$prev_pageview_pathname=r.pathname),r.timestamp&&(a.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),a}}var bL=e=>{var t=Vt?.createElement("a");return Ht(t)?null:(t.href=e,t)},I0r=function(e,t){var n,r;t===void 0&&(t="&");var a=[];return Is(e,(function(s,i){Ht(s)||Ht(i)||i==="undefined"||(n=encodeURIComponent((o=>o instanceof File)(s)?s.name:s.toString()),r=encodeURIComponent(i),a[a.length]=r+"="+n)})),a.join(t)},xL=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),a=0;a<r.length;a++){var s=r[a].split("=");if(s[0]===t){n=s;break}}if(!Aa(n)||n.length<2)return"";var i=n[1];try{i=decodeURIComponent(i)}catch{Gt.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},xA=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),a=r[0]||"",s=r[1],i=a.split("?"),o=i[1],c=i[0],u=(o||"").split("&"),d=[],f=0;f<u.length;f++){var p=u[f].split("=");Aa(p)&&(t.includes(p[0])?d.push(p[0]+"="+n):d.push(u[f]))}var h=c;return o!=null&&(h+="?"+d.join("&")),s!=null&&(h+="#"+s),h},wL=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},K2="https?://(.*)",Xk=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],R0r=Yk(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Xk),wA="<masked>",P0r=["li_fat_id"];function ISt(e,t,n){if(!Vt)return{};var r,a=t?Yk([],Xk,n||[]):[],s=RSt(xA(Vt.URL,a,wA),e),i=(r={},Is(P0r,(function(o){var c=Uh.A(o);r[o]=c||null})),r);return qi(i,s)}function RSt(e,t){var n=R0r.concat(t||[]),r={};return Is(n,(function(a){var s=xL(e,a);r[a]=s||null})),r}function PSt(e){var t=(function(s){return s?s.search(K2+"google.([^/?]*)")===0?"google":s.search(K2+"bing.com")===0?"bing":s.search(K2+"yahoo.com")===0?"yahoo":s.search(K2+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!sh(t)){r.$search_engine=t;var a=Vt?xL(Vt.referrer,n):"";a.length&&(r.ph_keyword=a)}return r}function DFe(){return navigator.language||navigator.userLanguage}function MSt(){return Vt?.referrer||"$direct"}function DSt(e,t){var n=e?Yk([],Xk,t||[]):[],r=bl?.href.substring(0,1e3);return{r:MSt().substring(0,1e3),u:r?xA(r,n,wA):void 0}}function $St(e){var t,{r:n,u:r}=e,a={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=bL(n))==null?void 0:t.host};if(r){a.$current_url=r;var s=bL(r);a.$host=s?.host,a.$pathname=s?.pathname;var i=RSt(r);qi(a,i)}if(n){var o=PSt(n);qi(a,o)}return a}function LSt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function M0r(){try{return new Date().getTimezoneOffset()}catch{return}}function D0r(e,t){var n,r,a,s;if(!ru)return{};var i,o,c,u,d,f,p,h,m=e?Yk([],Xk,t||[]):[],[g,v]=(function(b){for(var S=0;S<xFe.length;S++){var[O,k]=xFe[S],E=O.exec(b),C=E&&(Pg(k)?k(E,b):k);if(C)return C}return["",""]})(ru);return qi(Uge({$os:g,$os_version:v,$browser:bSt(ru,navigator.vendor),$device:wFe(ru),$device_type:(o=ru,c={userAgentDataPlatform:(n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform,maxTouchPoints:(r=navigator)==null?void 0:r.maxTouchPoints,screenWidth:Ge==null||(a=Ge.screen)==null?void 0:a.width,screenHeight:Ge==null||(s=Ge.screen)==null?void 0:s.height,devicePixelRatio:Ge?.devicePixelRatio},h=wFe(o),h===sSt||h===aSt||h==="Kobo"||h==="Kindle Fire"||h===ySt?Gk:h===yA||h===PO||h===bA||h===Bse?"Console":h===oSt?"Wearable":h?Cd:c?.userAgentDataPlatform==="Android"&&((u=c?.maxTouchPoints)!==null&&u!==void 0?u:0)>0?Math.min((d=c?.screenWidth)!==null&&d!==void 0?d:0,(f=c?.screenHeight)!==null&&f!==void 0?f:0)/((p=c?.devicePixelRatio)!==null&&p!==void 0?p:1)>=600?Gk:Cd:"Desktop"),$timezone:LSt(),$timezone_offset:M0r()}),{$current_url:xA(bl?.href,m,wA),$host:bl?.host,$pathname:bl?.pathname,$raw_user_agent:ru.length>1e3?ru.substring(0,997)+"...":ru,$browser_version:Qxr(ru,navigator.vendor),$browser_language:DFe(),$browser_language_prefix:(i=DFe(),typeof i=="string"?i.split("-")[0]:void 0),$screen_height:Ge?.screen.height,$screen_width:Ge?.screen.width,$viewport_height:Ge?.innerHeight,$viewport_width:Ge?.innerWidth,$lib:ff.LIB_NAME,$lib_version:ff.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var $0r=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class XJ{constructor(t,n){this.N=t,this.props={},this.it=!1,this.et=(r=>{var a="";return r.token&&(a=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+a+"_posthog"})(t),this.B=this.rt(t),this.load(),t.debug&&Gt.info("Persistence loaded",t.persistence,Lt({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.st}rt(t){$0r.indexOf(t.persistence.toLowerCase())===-1&&(Gt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(a){a===void 0&&(a=[]);var s=[..._0r,...a];return Lt({},di,{D:function(i){try{var o={};try{o=Uh.D(i)||{}}catch{}var c=qi(o,JSON.parse(di.A(i)||"{}"));return di.L(i,c),c}catch{}return null},L:function(i,o,c,u,d,f){try{di.L(i,o,void 0,void 0,f);var p={};s.forEach((h=>{o[h]&&(p[h]=o[h])})),Object.keys(p).length&&Uh.L(i,p,c,u,d,f)}catch(h){di.M(h)}},j:function(i,o){try{Ge?.localStorage.removeItem(i),Uh.j(i,o)}catch(c){di.M(c)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&di.F()?di:r==="localstorage+cookie"&&n.F()?n:r==="sessionstorage"&&vl.F()?vl:r==="memory"?E0r:r==="cookie"?Uh:n.F()?n:Uh}nt(t){var n=t??this.N.feature_flag_cache_ttl_ms;if(!n||n<=0)return!1;var r=this.props[mL];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return Is(this.props,((n,r)=>{if(r===nO&&Ao(n)){if(!this.nt())for(var a=Object.keys(n),s=0;s<a.length;s++)t["$feature/"+a[s]]=n[a[s]]}else o=r,c=!1,(sh(i=b0r)?c:pFe&&i.indexOf===pFe?i.indexOf(o)!=-1:(Is(i,(function(u){if(c||(c=u===o))return pL})),c))||(t[r]=n);var i,o,c})),t}load(){if(!this.st){var t=this.B.D(this.et);t&&(this.props=qi({},t))}}save(){this.st||this.B.L(this.et,this.props,this.ot,this.ut,this.ht,this.N.debug)}remove(){this.B.j(this.et,!1),this.B.j(this.et,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Ao(t)){Ht(n)&&(n="None"),this.ot=Ht(r)?this.dt:r;var a=!1;if(Is(t,((s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==n||(this.props[i]=s,a=!0)})),a)return this.save(),!0}return!1}register(t,n){if(Ao(t)){this.ot=Ht(n)?this.dt:n;var r=!1;if(Is(t,((a,s)=>{t.hasOwnProperty(s)&&this.props[s]!==a&&(this.props[s]=a,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.it){var t=ISt(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);tO(Uge(t))||this.register(t),this.it=!0}}update_search_keyword(){var t;this.register((t=Vt?.referrer)?PSt(t):{})}update_referrer_info(){var t;this.register_once({$referrer:MSt(),$referring_domain:Vt!=null&&Vt.referrer&&((t=bL(Vt.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Kse]||this.props[Jse]||this.register_once({[gL]:DSt(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Is([Jse,Kse],(i=>{var o=this.props[i];o&&Is(o,(function(c,u){t["$initial_"+Lse(u)]=c}))}));var n,r,a=this.props[gL];if(a){var s=(n=$St(a),r={},Is(n,(function(i,o){r["$initial_"+Lse(o)]=i})),r);qi(t,s)}return t}safe_merge(t){return Is(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.dt=this.ot=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((i,o)=>{if(i.length!==o.length)return!1;var c=[...i].sort(),u=[...o].sort();return c.every(((d,f)=>d===u[f]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var a=this.rt(t),s=this.props;this.clear(),this.B=a,this.props=s,this.save()}}set_disabled(t){this.st=t,this.st?this.remove():this.save()}set_cross_subdomain(t){t!==this.ut&&(this.ut=t,this.remove(),this.save())}set_secure(t){t!==this.ht&&(this.ht=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[gj]||{};r[t]=n,this.props[gj]=r,this.save()}remove_event_timer(t){var n=(this.props[gj]||{})[t];return Ht(n)||(delete this.props[gj][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var MC={Activation:"events",Cancellation:"cancelEvents"},KJ={Popover:"popover",API:"api",Widget:"widget"},bj={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},JJ={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},eie={Popover:"popover",Inline:"inline"},L0r=(function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e.BANNER_ACTION_CLICKED="product tour banner action clicked",e})({}),$Fe=(function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",e.TOUR_TYPE="$product_tour_type",e})({}),LFe=bi("[RateLimiter]");class F0r{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((a=>{LFe.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void LFe.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,a;t===void 0&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:i}=this,o=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Xse))!==null&&n!==void 0?n:{tokens:s,last:o};c.tokens+=(o-c.last)/1e3*i,c.last=o,c.tokens>s&&(c.tokens=s);var u=c.tokens<1;return u||t||(c.tokens=Math.max(0,c.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+i+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(a=this.instance.persistence)==null||a.set_property(Xse,c),{isRateLimited:u,remainingTokens:c.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var DC=bi("[RemoteConfig]");class FSt{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=Fn._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}vt(t){var n,r;(n=Fn.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=Fn.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}ct(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return DC.info("Using preloaded remote config",this.remoteConfig),this.ft(this.remoteConfig),void this._t();if(this._instance.bt())return void DC.warn("Remote config is disabled. Falling back to local config.");this.vt((t=>{if(!t)return DC.info("No config found after loading remote JS config. Falling back to JSON."),void this.ct((n=>{this.ft(n),this._t()}));this.ft(t),this._t()}))}catch(t){DC.error("Error loading remote config",t)}}stop(){this.yt&&(clearInterval(this.yt),this.yt=void 0)}refresh(){this._instance.bt()||Vt?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}_t(){var t;if(!this.yt){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.yt=setInterval((()=>{this.refresh()}),n))}}ft(t){var n;t||DC.error("Failed to fetch remote config from PostHog."),this._instance.ft(t??{}),t?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var Cg=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),$f=Uint8Array,wu=Uint16Array,Kk=Uint32Array,Vge=new $f([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),qge=new $f([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),FFe=new $f([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zSt=function(e,t){for(var n=new wu(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var a=new Kk(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)a[s]=s-n[r]<<5|r;return[n,a]},BSt=zSt(Vge,2),z0r=BSt[0],tie=BSt[1];z0r[28]=258,tie[258]=28;for(var zFe=zSt(qge,0)[1],USt=new wu(32768),Gs=0;Gs<32768;++Gs){var Gx=(43690&Gs)>>>1|(21845&Gs)<<1;Gx=(61680&(Gx=(52428&Gx)>>>2|(13107&Gx)<<2))>>>4|(3855&Gx)<<4,USt[Gs]=((65280&Gx)>>>8|(255&Gx)<<8)>>>1}var rT=function(e,t,n){for(var r=e.length,a=0,s=new wu(t);a<r;++a)++s[e[a]-1];var i,o=new wu(t);for(a=0;a<t;++a)o[a]=o[a-1]+s[a-1]<<1;for(i=new wu(r),a=0;a<r;++a)i[a]=USt[o[e[a]-1]++]>>>15-e[a];return i},Iw=new $f(288);for(Gs=0;Gs<144;++Gs)Iw[Gs]=8;for(Gs=144;Gs<256;++Gs)Iw[Gs]=9;for(Gs=256;Gs<280;++Gs)Iw[Gs]=7;for(Gs=280;Gs<288;++Gs)Iw[Gs]=8;var SL=new $f(32);for(Gs=0;Gs<32;++Gs)SL[Gs]=5;var B0r=rT(Iw,9),U0r=rT(SL,5),VSt=function(e){return(e/8>>0)+(7&e&&1)},qSt=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof wu?wu:e instanceof Kk?Kk:$f)(n-t);return r.set(e.subarray(t,n)),r},fg=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},$C=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},eee=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,s=n.slice();if(!a)return[new $f(0),0];if(a==1){var i=new $f(n[0].s+1);return i[n[0].s]=1,[i,1]}n.sort((function(E,C){return E.f-C.f})),n.push({s:-1,f:25001});var o=n[0],c=n[1],u=0,d=1,f=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};d!=a-1;)o=n[n[u].f<n[f].f?u++:f++],c=n[u!=d&&n[u].f<n[f].f?u++:f++],n[d++]={s:-1,f:o.f+c.f,l:o,r:c};var p=s[0].s;for(r=1;r<a;++r)s[r].s>p&&(p=s[r].s);var h=new wu(p+1),m=nie(n[d-1],h,0);if(m>t){r=0;var g=0,v=m-t,b=1<<v;for(s.sort((function(E,C){return h[C.s]-h[E.s]||E.f-C.f}));r<a;++r){var S=s[r].s;if(!(h[S]>t))break;g+=b-(1<<m-h[S]),h[S]=t}for(g>>>=v;g>0;){var O=s[r].s;h[O]<t?g-=1<<t-h[O]++-1:++r}for(;r>=0&&g;--r){var k=s[r].s;h[k]==t&&(--h[k],++g)}m=t}return[new $f(h),m]},nie=function(e,t,n){return e.s==-1?Math.max(nie(e.l,t,n+1),nie(e.r,t,n+1)):t[e.s]=n},BFe=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new wu(++t),r=0,a=e[0],s=1,i=function(c){n[r++]=c},o=1;o<=t;++o)if(e[o]==a&&o!=t)++s;else{if(!a&&s>2){for(;s>138;s-=138)i(32754);s>2&&(i(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(i(a),--s;s>6;s-=6)i(8304);s>2&&(i(s-3<<5|8208),s=0)}for(;s--;)i(a);s=1,a=e[o]}return[n.subarray(0,r),t]},LC=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},rie=function(e,t,n){var r=n.length,a=VSt(t+2);e[a]=255&r,e[a+1]=r>>>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var s=0;s<r;++s)e[a+s+4]=n[s];return 8*(a+4+r)},UFe=function(e,t,n,r,a,s,i,o,c,u,d){fg(t,d++,n),++a[256];for(var f=eee(a,15),p=f[0],h=f[1],m=eee(s,15),g=m[0],v=m[1],b=BFe(p),S=b[0],O=b[1],k=BFe(g),E=k[0],C=k[1],T=new wu(19),j=0;j<S.length;++j)T[31&S[j]]++;for(j=0;j<E.length;++j)T[31&E[j]]++;for(var A=eee(T,7),I=A[0],P=A[1],M=19;M>4&&!I[FFe[M-1]];--M);var B,D,V,q,z=u+5<<3,H=LC(a,Iw)+LC(s,SL)+i,G=LC(a,p)+LC(s,g)+i+14+3*M+LC(T,I)+(2*T[16]+3*T[17]+7*T[18]);if(z<=H&&z<=G)return rie(t,d,e.subarray(c,c+u));if(fg(t,d,1+(G<H)),d+=2,G<H){B=rT(p,h),D=p,V=rT(g,v),q=g;var L=rT(I,P);for(fg(t,d,O-257),fg(t,d+5,C-1),fg(t,d+10,M-4),d+=14,j=0;j<M;++j)fg(t,d+3*j,I[FFe[j]]);d+=3*M;for(var Z=[S,E],F=0;F<2;++F){var R=Z[F];for(j=0;j<R.length;++j){var Q=31&R[j];fg(t,d,L[Q]),d+=I[Q],Q>15&&(fg(t,d,R[j]>>>5&127),d+=R[j]>>>12)}}}else B=B0r,D=Iw,V=U0r,q=SL;for(j=0;j<o;++j)if(r[j]>255){Q=r[j]>>>18&31,$C(t,d,B[Q+257]),d+=D[Q+257],Q>7&&(fg(t,d,r[j]>>>23&31),d+=Vge[Q]);var W=31&r[j];$C(t,d,V[W]),d+=q[W],W>3&&($C(t,d,r[j]>>>5&8191),d+=qge[W])}else $C(t,d,B[r[j]]),d+=D[r[j]];return $C(t,d,B[256]),d+D[256]},V0r=new Kk([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),q0r=(function(){for(var e=new Kk(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),H0r=function(e,t,n,r,a){return(function(s,i,o,c,u,d){var f=s.length,p=new $f(c+f+5*(1+Math.floor(f/7e3))+u),h=p.subarray(c,p.length-u),m=0;if(!i||f<8)for(var g=0;g<=f;g+=65535){var v=g+65535;v<f?m=rie(h,m,s.subarray(g,v)):(h[g]=d,m=rie(h,m,s.subarray(g,f)))}else{for(var b=V0r[i-1],S=b>>>13,O=8191&b,k=(1<<o)-1,E=new wu(32768),C=new wu(k+1),T=Math.ceil(o/3),j=2*T,A=function(ke){return(s[ke]^s[ke+1]<<T^s[ke+2]<<j)&k},I=new Kk(25e3),P=new wu(288),M=new wu(32),B=0,D=0,V=(g=0,0),q=0,z=0;g<f;++g){var H=A(g),G=32767&g,L=C[H];if(E[G]=L,C[H]=G,q<=g){var Z=f-g;if((B>7e3||V>24576)&&Z>423){m=UFe(s,h,0,I,P,M,D,V,z,g-z,m),V=B=D=0,z=g;for(var F=0;F<286;++F)P[F]=0;for(F=0;F<30;++F)M[F]=0}var R=2,Q=0,W=O,te=G-L&32767;if(Z>2&&H==A(g-te))for(var se=Math.min(S,Z)-1,re=Math.min(32767,g),ae=Math.min(258,Z);te<=re&&--W&&G!=L;){if(s[g+R]==s[g+R-te]){for(var oe=0;oe<ae&&s[g+oe]==s[g+oe-te];++oe);if(oe>R){if(R=oe,Q=te,oe>se)break;var de=Math.min(te,oe-2),K=0;for(F=0;F<de;++F){var ne=g-te+F+32768&32767,ie=ne-E[ne]+32768&32767;ie>K&&(K=ie,L=ne)}}}te+=(G=L)-(L=E[G])+32768&32767}if(Q){I[V++]=268435456|tie[R]<<18|zFe[Q];var ve=31&tie[R],ge=31&zFe[Q];D+=Vge[ve]+qge[ge],++P[257+ve],++M[ge],q=g+R,++B}else I[V++]=s[g],++P[s[g]]}}m=UFe(s,h,d,I,P,M,D,V,z,g-z,m)}return qSt(p,0,c+VSt(m)+u)})(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},tee=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Q0r(e,t){t===void 0&&(t={});var n=(function(){var o=4294967295;return{p:function(c){for(var u=o,d=0;d<c.length;++d)u=q0r[255&u^c[d]]^u>>>8;o=u},d:function(){return 4294967295^o}}})(),r=e.length;n.p(e);var a,s=H0r(e,t,10+((a=t).filename&&a.filename.length+1||0),8),i=s.length;return(function(o,c){var u=c.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=c.level<2?4:c.level==9?2:0,o[9]=3,c.mtime!=0&&tee(o,4,Math.floor(new Date(c.mtime||Date.now())/1e3)),u){o[3]=8;for(var d=0;d<=u.length;++d)o[d+10]=u.charCodeAt(d)}})(s,t),tee(s,i-8,n.d()),tee(s,i-4,r),s}var G0r=function(e){var t,n,r,a,s="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
508
508
  `).replace(/\r/g,`
509
509
  `)).length,a=0;a<r;a++){var i=e.charCodeAt(a),o=null;i<128?n++:o=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),sh(o)||(n>t&&(s+=e.substring(t,n)),s+=o,t=n=a+1)}return n>t&&(s+=e.substring(t,e.length)),s},W0r=!!$se||!!Dse,OL=function(e,t,n){var r;n===void 0&&(n=!0);var[a,s]=e.split("?"),i=Lt({},t),o=(r=s?.split("&").map((u=>{var d,[f,p]=u.split("="),h=n&&(d=i[f])!==null&&d!==void 0?d:p;return delete i[f],f+"="+h})))!==null&&r!==void 0?r:[],c=I0r(i);return c&&o.push(c),a+"?"+o.join("&")},xj=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),nee=e=>{var{data:t,compression:n}=e;if(t){if(n===Cg.GZipJS){var r=Q0r((function(o,c){var u=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var d=new $f(o.length+(o.length>>>1)),f=0,p=function(v){d[f++]=v},h=0;h<u;++h){if(f+5>d.length){var m=new $f(f+8+(u-h<<1));m.set(d),d=m}var g=o.charCodeAt(h);g<128||c?p(g):g<2048?(p(192|g>>>6),p(128|63&g)):g>55295&&g<57344?(p(240|(g=65536+(1047552&g)|1023&o.charCodeAt(++h))>>>18),p(128|g>>>12&63),p(128|g>>>6&63),p(128|63&g)):(p(224|g>>>12),p(128|g>>>6&63),p(128|63&g))}return qSt(d,0,f)})(xj(t)),{mtime:0});return{contentType:"text/plain",body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Cg.Base64){var a=(function(o){var c,u,d,f,p,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,g=0,v="",b=[];if(!o)return o;o=G0r(o);do c=(p=o.charCodeAt(m++)<<16|o.charCodeAt(m++)<<8|o.charCodeAt(m++))>>18&63,u=p>>12&63,d=p>>6&63,f=63&p,b[g++]=h.charAt(c)+h.charAt(u)+h.charAt(d)+h.charAt(f);while(m<o.length);switch(v=b.join(""),o.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v})(xj(t)),s=(o=>"data="+encodeURIComponent(typeof o=="string"?o:xj(o)))(a);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var i=xj(t);return{contentType:"application/json",body:i,estimatedSize:new Blob([i]).size}}},YD=[];Dse&&YD.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:a,estimatedSize:s}=(t=nee(e))!==null&&t!==void 0?t:{},i=new Headers;Is(e.headers,(function(d,f){i.append(f,d)})),r&&i.append("Content-Type",r);var o=e.url,c=null;if(hFe){var u=new hFe;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}Dse(o,Lt({method:e?.method||"GET",headers:i,keepalive:e.method==="POST"&&(s||0)<52428.8,body:a,signal:(n=c)==null?void 0:n.signal},e.fetchOptions)).then((d=>d.text().then((f=>{var p={statusCode:d.status,text:f};if(d.status===200)try{p.json=JSON.parse(f)}catch(h){Gt.error(h)}e.callback==null||e.callback(p)})))).catch((d=>{Gt.error(d),e.callback==null||e.callback({statusCode:0,error:d})})).finally((()=>c?clearTimeout(c.timeout):null))}}),$se&&YD.push({transport:"XHR",method:e=>{var t,n=new $se;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:a}=(t=nee(e))!==null&&t!==void 0?t:{};Is(e.headers,(function(s,i){n.setRequestHeader(i,s)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(s)}},n.send(a)}}),bd!=null&&bd.sendBeacon&&YD.push({transport:"sendBeacon",method:e=>{var t=OL(e.url,{beacon:"1"});try{var n,{contentType:r,body:a}=(n=nee(e))!==null&&n!==void 0?n:{},s=typeof a=="string"?new Blob([a],{type:r}):a;bd.sendBeacon(t,s)}catch{}}});var aie=3e3;class Z0r{constructor(t,n){this.wt=!0,this.Et=[],this.St=tm(n?.flush_interval_ms||aie,250,5e3,Gt.createLogger("flush interval"),aie),this.xt=t}enqueue(t){this.Et.push(t),this.$t||this.kt()}unload(){this.Pt();var t=this.Et.length>0?this.Tt():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.xt(Lt({},r,{transport:"sendBeacon"}))}))}enable(){this.wt=!1,this.kt()}kt(){var t=this;this.wt||(this.$t=setTimeout((()=>{if(this.Pt(),this.Et.length>0){var n=this.Tt(),r=function(){var s=n[a],i=new Date().getTime();s.data&&Aa(s.data)&&Is(s.data,(o=>{o.offset=Math.abs(o.timestamp-i),delete o.timestamp})),t.xt(s)};for(var a in n)r()}}),this.St))}Pt(){clearTimeout(this.$t),this.$t=void 0}Tt(){var t={};return Is(this.Et,(n=>{var r,a=n,s=(a?a.batchKey:null)||a.url;Ht(t[s])&&(t[s]=Lt({},a,{data:[]})),(r=t[s].data)==null||r.push(a.data)})),this.Et=[],t}}var Y0r=["retriesPerformedSoFar"];class X0r{constructor(t){this.Rt=!1,this.It=3e3,this.Et=[],this._instance=t,this.Et=[],this.Ct=!0,!Ht(Ge)&&"onLine"in Ge.navigator&&(this.Ct=Ge.navigator.onLine,this.Ot=()=>{this.Ct=!0,this.Ft()},this.Mt=()=>{this.Ct=!1},ro(Ge,"online",this.Ot),ro(Ge,"offline",this.Mt))}get length(){return this.Et.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=eSt(t,Y0r);P1(n)&&(r.url=OL(r.url,{retry_count:n})),this._instance._send_request(Lt({},r,{callback:a=>{a.statusCode!==200&&(a.statusCode<400||a.statusCode>=500)&&(n??0)<10?this.At(Lt({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(a)}}))}At(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(i){var o=3e3*Math.pow(2,i),c=o/2,u=Math.min(18e5,o),d=(Math.random()-.5)*(u-c);return Math.ceil(u+d)})(n),a=Date.now()+r;this.Et.push({retryAt:a,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),Gt.warn(s),this.Rt||(this.Rt=!0,this.Dt())}Dt(){if(this.Lt&&clearTimeout(this.Lt),this.Et.length===0)return this.Rt=!1,void(this.Lt=void 0);this.Lt=setTimeout((()=>{this.Ct&&this.Et.length>0&&this.Ft(),this.Dt()}),this.It)}Ft(){var t=Date.now(),n=[],r=this.Et.filter((s=>s.retryAt<t||(n.push(s),!1)));if(this.Et=n,r.length>0)for(var{requestOptions:a}of r)this.retriableRequest(a)}unload(){for(var{requestOptions:t}of(this.Lt&&(clearTimeout(this.Lt),this.Lt=void 0),this.Rt=!1,Ht(Ge)||(this.Ot&&(Ge.removeEventListener("online",this.Ot),this.Ot=void 0),this.Mt&&(Ge.removeEventListener("offline",this.Mt),this.Mt=void 0)),this.Et))try{this._instance._send_request(Lt({},t,{transport:"sendBeacon"}))}catch(n){Gt.error(n)}this.Et=[]}}class K0r{constructor(t){this.jt=()=>{var n,r,a,s;this.Nt||(this.Nt={});var i=this.scrollElement(),o=this.scrollY(),c=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+(i?.clientHeight||0),d=i?.scrollHeight||0;this.Nt.lastScrollY=Math.ceil(o),this.Nt.maxScrollY=Math.max(o,(n=this.Nt.maxScrollY)!==null&&n!==void 0?n:0),this.Nt.maxScrollHeight=Math.max(c,(r=this.Nt.maxScrollHeight)!==null&&r!==void 0?r:0),this.Nt.lastContentY=u,this.Nt.maxContentY=Math.max(u,(a=this.Nt.maxContentY)!==null&&a!==void 0?a:0),this.Nt.maxContentHeight=Math.max(d,(s=this.Nt.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}getContext(){return this.Nt}resetContext(){var t=this.Nt;return setTimeout(this.jt,0),t}startMeasuringScrollPosition(){ro(Ge,"scroll",this.jt,{capture:!0}),ro(Ge,"scrollend",this.jt,{capture:!0}),ro(Ge,"resize",this.jt)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Ge?.document.documentElement;var t=Aa(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=Ge?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Ge&&(Ge.scrollY||Ge.pageYOffset||Ge.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Ge&&(Ge.scrollX||Ge.pageXOffset||Ge.document.documentElement.scrollLeft)||0}}var J0r=e=>DSt(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class VFe{constructor(t,n,r,a){this.Ut=s=>{var i=this.zt();if(!i||i.sessionId!==s){var o={sessionId:s,props:this.Ht(this._instance)};this.Bt.register({[Yse]:o})}},this._instance=t,this.qt=n,this.Bt=r,this.Ht=a||J0r,this.qt.onSessionId(this.Ut)}zt(){return this.Bt.props[Yse]}getSetOnceProps(){var t,n=(t=this.zt())==null?void 0:t.props;return n?"r"in n?$St(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Is(Uge(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+Lse(r)]=n})),t}}class Hge{constructor(){this.Vt={},this.Vt={}}on(t,n){return this.Vt[t]||(this.Vt[t]=[]),this.Vt[t].push(n),()=>{this.Vt[t]=this.Vt[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.Vt[t]||[])r(n);for(var a of this.Vt["*"]||[])a(t,n)}}var ree=bi("[SessionId]");class qFe{on(t,n){return this.Wt.on(t,n)}constructor(t,n,r){var a;if(this.Gt=[],this.Yt=void 0,this.Wt=new Hge,this.Jt=(d,f)=>!(!P1(d)||!P1(f))&&Math.abs(d-f)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=t.config,this.Bt=t.persistence,this.Kt=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Qt=n||Hy,this.Zt=r||Hy;var s=this.N.persistence_name||this.N.token,i=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*tm(i,60,36e3,ree.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ti(),this.ii="ph_"+s+"_window_id",this.ei="ph_"+s+"_primary_window_exists",this.ri()){var o=vl.D(this.ii),c=vl.D(this.ei);o&&!c?this.Kt=o:vl.j(this.ii),vl.L(this.ei,!0)}if((a=this.N.bootstrap)!=null&&a.sessionID)try{var u=(d=>{var f=d.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.N.bootstrap.sessionID);this.si(this.N.bootstrap.sessionID,new Date().getTime(),u)}catch(d){ree.error("Invalid sessionID in bootstrap",d)}this.ni()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ht(this.Gt)&&(this.Gt=[]),this.Gt.push(t),this.Xt&&t(this.Xt,this.Kt),()=>{this.Gt=this.Gt.filter((n=>n!==t))}}ri(){return this.N.persistence!=="memory"&&!this.Bt.st&&vl.F()}oi(t){t!==this.Kt&&(this.Kt=t,this.ri()&&vl.L(this.ii,t))}ai(){return this.Kt?this.Kt:this.ri()?vl.D(this.ii):null}si(t,n,r){t===this.Xt&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Xt=t,this.Bt.register({[hL]:[n,t,r]}))}li(){var t=this.Bt.props[hL];return Aa(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.si(null,null,null)}destroy(){clearTimeout(this.ui),this.ui=void 0,this.Yt&&Ge&&(Ge.removeEventListener("beforeunload",this.Yt,{capture:!1}),this.Yt=void 0),this.Gt=[]}ni(){this.Yt=()=>{this.ri()&&vl.j(this.ei)},ro(Ge,"beforeunload",this.Yt,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[a,s,i]=this.li(),o=this.ai(),c=P1(i)&&Math.abs(r-i)>864e5,u=!1,d=!s,f=!d&&!t&&this.Jt(r,a);d||f||c?(s=this.Qt(),o=this.Zt(),ree.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}}),i=r,u=!0):o||(o=this.Zt(),u=!0);var p=P1(a)&&t&&!c?a:r,h=P1(i)?i:new Date().getTime();return this.oi(o),this.si(s,p,h),t||this.ti(),u&&this.Gt.forEach((m=>m(s,o,u?{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}:void 0))),{sessionId:s,windowId:o,sessionStartTimestamp:h,changeReason:u?{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:a}}ti(){clearTimeout(this.ui),this.ui=setTimeout((()=>{var[t]=this.li();if(this.Jt(new Date().getTime(),t)){var n=this.Xt;this.resetSessionId(),this.Wt.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var HSt=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&vFe(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((a=>vFe(a?.brand,t))))return!0}catch{}return!!e.webdriver},kL=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function HFe(e,t,n){return xj({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var QSt={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>kL(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!kL(n,r))))),icontains:(e,t)=>t.map(J2).some((n=>e.map(J2).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(J2).every((n=>e.map(J2).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((a=>r>parseFloat(a)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((a=>r<parseFloat(a)))}))},J2=e=>e.toLowerCase();function GSt(e,t){return!e||Object.entries(e).every((n=>{var[r,a]=n,s=t?.[r];if(Ht(s)||sh(s))return!1;var i=[String(s)],o=QSt[a.operator];return!!o&&o(a.values,i)}))}var wj=(function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e})({}),QFe="i.posthog.com";class ewr{constructor(t){this.hi={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+QFe,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.hi[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=wj.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=wj.EU:this.hi[this.apiHost]=wj.CUSTOM),this.hi[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===wj.CUSTOM)return this.apiHost+n;var r=QFe+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var hs=bi("[Surveys]"),WSt="seenSurvey_",twr=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},GFe=e=>((t,n)=>{var r=""+t+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+t+n.id+"_"+n.current_iteration),r})(WSt,e),nwr=[KJ.Popover,KJ.Widget,KJ.API],rwr={ignoreConditions:!1,ignoreDelay:!1,displayType:eie.Popover},awr=bi("[PostHog ExternalIntegrations]"),swr={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class iwr{constructor(t){this._instance=t}G(t,n){var r;(r=Fn.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(a=>{if(a)return awr.error("failed to load script",a);n()}))}startIfEnabledOrStop(){var t=this,n=function(i){var o,c,u;!a||(o=Fn.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[i]||t.G(swr[i],(()=>{var d;(d=Fn.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[i])==null||d.start(t._instance)})),!a&&(c=Fn.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[i]&&((u=Fn.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[r,a]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var aT={},aee=0,sie=()=>{},M1="posthog",ZSt=!W0r&&ru?.indexOf("MSIE")===-1&&ru?.indexOf("Mozilla")===-1,WFe=e=>{var t;return Lt({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:y0r(Vt?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:sie,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:bl&&oo(bl?.search)&&bl.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(Ge==null||(t=Ge.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;Gt.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:aie},error_tracking:{},_onCapture:sie,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},ZFe=e=>{var t={};Ht(e.process_person)||(t.person_profiles=e.process_person),Ht(e.xhr_headers)||(t.request_headers=e.xhr_headers),Ht(e.cookie_name)||(t.persistence_name=e.cookie_name),Ht(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Ht(e.store_google)||(t.save_campaign_params=e.store_google),Ht(e.verbose)||(t.debug=e.verbose);var n=qi({},t,e);return Aa(e.property_blacklist)&&(Ht(e.property_denylist)?n.property_denylist=e.property_blacklist:Aa(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:Gt.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class owr{constructor(){this.__forceAllowLocalhost=!1}get di(){return this.__forceAllowLocalhost}set di(t){Gt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Vh{vi(t,n){if(t){var r=this.ci.indexOf(t);r!==-1&&this.ci.splice(r,1)}return this.ci.push(n),n.initialize==null||n.initialize(),n}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new owr,this.fi=!1,this.version=ff.LIB_VERSION,this.pi=new Hge,this.ci=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=WFe(),this.SentryIntegration=A0r,this.sentryIntegration=r=>(function(a,s){var i=ASt(a,s);return{name:NSt,processEvent:o=>i(o)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.gi=!1,this.mi=null,this.bi=null,this.yi=null,this.scrollManager=new K0r(this),this.pageViewManager=new MFe(this),this.rateLimiter=new F0r(this),this.requestRouter=new ewr(this),this.consent=new C0r(this),this.externalIntegrations=new iwr(this);var n=(t=Vh.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,a,s)=>{var i=oo(r)?{[r]:a}:r;this.setPersonProperties(i),s?.({})},set_once:(r,a,s)=>{var i=oo(r)?{[r]:a}:r;this.setPersonProperties(void 0,i),s?.({})}},this.on("eventCaptured",(r=>Gt.info('send "'+r?.event+'"',r)))}init(t,n,r){if(r&&r!==M1){var a,s=(a=aT[r])!==null&&a!==void 0?a:new Vh;return s._init(t,n,r),aT[r]=s,aT[M1][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var a;if(n===void 0&&(n={}),Ht(t)||Fse(t))return Gt.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.wi(n.debug),this.Ei=n,this.Si=[],n.person_profiles?this.bi=n.person_profiles:n.process_person&&(this.bi=n.process_person),this.set_config(qi({},WFe(n.defaults),ZFe(n),{name:r,token:t})),this.config.on_xhr_error&&Gt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Cg.GZipJS;var s=this.xi();this.persistence=new XJ(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new XJ(Lt({},this.config,{persistence:"sessionStorage"}),s);var i=Lt({},this.persistence.props),o=Lt({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new Z0r((m=>this.ki(m)),this.config.request_queue_config),this.Pi=new X0r(this),this.__request_queue=[];var c=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(c||(this.sessionManager=new qFe(this),this.sessionPropsManager=new VFe(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Gt.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ti(c)}),0)):(Gt.info("Initializing extensions synchronously"),this.Ti(c)),ff.DEBUG=ff.DEBUG||this.config.debug,ff.DEBUG&&Gt.info("Starting in debug mode",{this:this,config:n,thisC:Lt({},this.config),p:i,s:o}),((a=n.bootstrap)==null?void 0:a.distinctID)!==void 0){var u,d,f=this.config.get_device_id(Hy()),p=(u=n.bootstrap)!=null&&u.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(Nh,(d=n.bootstrap)!=null&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:p})}if(c)this.register_once({distinct_id:RC,$device_id:null},"");else if(!this.get_distinct_id()){var h=this.config.get_device_id(Hy());this.register_once({distinct_id:h,$device_id:h},""),this.persistence.set_property(Nh,"anonymous")}return ro(Ge,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?N0r(this,(()=>this.Ri())):this.Ri(),Pg(this.config._onCapture)&&this.config._onCapture!==sie&&(Gt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(m=>this.config._onCapture(m.event,m)))),this.config.ip&&Gt.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ti(t){var n,r,a,s,i,o,c,u=performance.now(),d=Lt({},Vh.__defaultExtensionClasses,this.config.__extensionClasses),f=[];d.featureFlags&&this.ci.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new d.featureFlags(this)),d.exceptions&&this.ci.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new d.exceptions(this)),d.historyAutocapture&&this.ci.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.ci.push(new d.tracingHeaders(this)),d.siteApps&&this.ci.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.ci.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||f.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.ci.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.ci.push(this.surveys=(a=this.surveys)!==null&&a!==void 0?a:new d.surveys(this)),d.logs&&this.ci.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new d.logs(this)),d.conversations&&this.ci.push(this.conversations=(i=this.conversations)!==null&&i!==void 0?i:new d.conversations(this)),d.productTours&&this.ci.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.ci.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.ci.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.ci.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.ci.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,T0r)),d.toolbar&&this.ci.push(this.toolbar=(o=this.toolbar)!==null&&o!==void 0?o:new d.toolbar(this)),d.experiments&&this.ci.push(this.experiments=(c=this.experiments)!==null&&c!==void 0?c:new d.experiments(this)),this.ci.forEach((p=>{p.initialize&&f.push((()=>{p.initialize==null||p.initialize()}))})),f.push((()=>{if(this.Ii){var p=this.Ii;this.Ii=void 0,this.ft(p)}})),this.Ci(f,u)}Ci(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.Ci(t,n)}),0);var r=t.shift();if(r)try{r()}catch(s){Gt.error("Error initializing extension:",s)}}var a=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:a}),this.config.__preview_deferred_init_extensions&&Gt.info("PostHog extensions initialized ("+a+"ms)")}ft(t){var n;if(!Vt||!Vt.body)return Gt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.ft(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Ii=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Vr(t.supportedCompression,Cg.GZipJS)?Cg.GZipJS:Vr(t.supportedCompression,Cg.Base64)?Cg.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.bi?this.bi:"identified_only"}),this.ci.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t)))}Ri(){try{this.config.loaded(this)}catch(r){Gt.critical("`loaded` function failed",r)}if(this.Oi(),this.config.internal_or_test_user_hostname&&bl!=null&&bl.hostname){var t=bl.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Fi()}),1),this.Mi=new FSt(this),this.Mi.load()}Oi(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.$i)==null||t.enable())}_dom_loaded(){this.is_capturing()&&ob(this.__request_queue,(t=>this.ki(t))),this.__request_queue=[],this.Oi()}_handle_unload(){var t,n,r;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Ai()&&this.capture("$pageleave"),(n=this.$i)==null||n.unload(),(r=this.Pi)==null||r.unload()):this.Ai()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(ZSt?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=OL(t.url,{ip:this.config.ip?1:0}),t.headers=Lt({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,a,s,i=Lt({},n);i.timeout=i.timeout||6e4,i.url=OL(i.url,{_:new Date().getTime().toString(),ver:ff.JS_SDK_VERSION,compression:i.compression});var o=(r=i.transport)!==null&&r!==void 0?r:"fetch",c=YD.filter((d=>!i.disableTransport||!d.transport||!i.disableTransport.includes(d.transport))),u=(a=(s=OSt(c,(d=>d.transport===o)))==null?void 0:s.method)!==null&&a!==void 0?a:c[0].method;if(!u)throw new Error("No available transport method");u(i)})(Lt({},t,{callback:n=>{var r,a;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(a=this.config).on_request_error)==null||r.call(a,n)),t.callback==null||t.callback(n)}}))))}ki(t){this.Pi?this.Pi.retriableRequest(t):this._send_request(t)}_execute_array(t){aee++;try{var n,r=[],a=[],s=[];ob(t,(o=>{o&&(n=o[0],Aa(n)?s.push(o):Pg(o)?o.call(this):Aa(o)&&n==="alias"?r.push(o):Aa(o)&&n.indexOf("capture")!==-1&&Pg(this[n])?s.push(o):a.push(o))}));var i=function(o,c){ob(o,(function(u){if(Aa(u[0])){var d=c;Is(u,(function(f){d=d[f[0]].apply(d,f.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),c)};i(r,this),i(a,this),i(s,this)}finally{aee--}}push(t){if(aee>0&&Aa(t)&&oo(t[0])){var n=Vh.prototype[t[0]];Pg(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!Ht(t)&&oo(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var i=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){n!=null&&n.$current_url&&!oo(n?.$current_url)&&(Gt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.Di||Gt.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,c=r?.timestamp||o,u=Hy(),d={uuid:u,event:t,properties:this.calculateEventProperties(t,n||{},c,u)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&s&&(d.event="$bot_pageview",d.properties.$browser_type="bot"),i&&(d.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),r?.$set&&(d.$set=r?.$set);var f,p=t!=="$groupidentify",h=this.Li(r?.$set_once,p);if(h&&(d.$set_once=h),(d=g0r(d,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=c,Ht(r?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=o),t===bj.DISMISSED||t===bj.SENT){var m=n?.[JJ.SURVEY_ID],g=n?.[JJ.SURVEY_ITERATION];f={id:m,current_iteration:g},localStorage.getItem(GFe(f))||localStorage.setItem(GFe(f),"true"),d.$set=Lt({},d.$set,{[twr({id:m,current_iteration:g},t===bj.SENT?"responded":"dismissed")]:!0})}else t===bj.SHOWN&&(d.$set=Lt({},d.$set,{[JJ.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===L0r.SHOWN){var v=n?.[$Fe.TOUR_TYPE];v&&(d.$set=Lt({},d.$set,{[$Fe.TOUR_LAST_SEEN_DATE+"/"+v]:new Date().toISOString()}))}var b=Lt({},d.properties.$set,d.$set);if(tO(b)||this.setPersonPropertiesForFlags(b),!Jr(this.config.before_send)){var S=this.ji(d);if(!S)return;d=S}this.pi.emit("eventCaptured",d);var O={method:"POST",url:(a=r?._url)!==null&&a!==void 0?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.ki(O):this.$i.enqueue(O),d}Gt.critical("This capture call is ignored due to client rate limiting.")}}else Gt.error("No event name provided to posthog.capture")}else Gt.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,a,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var i=s?void 0:this.persistence.remove_event_timer(t),o=Lt({},n);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),t==="$snapshot"){var c=Lt({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=c.distinct_id,(!oo(o.distinct_id)&&!Om(o.distinct_id)||Fse(o.distinct_id))&&Gt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,d=D0r(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());o.$session_id=f,o.$window_id=p}this.sessionPropsManager&&qi(o,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&qi(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(h=this.Pi)==null?void 0:h.length}catch(b){o.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===wj.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||s?t!=="$pageleave"||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,a),o=qi(o,u),t==="$pageview"&&Vt&&(o.title=Vt.title),!Ht(i)){var m=r.getTime()-i;o.$duration=parseFloat((m/1e3).toFixed(3))}ru&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=qi({},d,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Aa(this.config.property_denylist)?Is(this.config.property_denylist,(function(b){delete o[b]})):Gt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(Gt.error("sanitize_properties is deprecated. Use before_send instead"),o=g(o,t));var v=this.Ni();return o.$process_person_profile=v,v&&!s&&this.Ui("_calculate_event_properties"),o}Li(t,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.Ni()||this.fi)return t;var a=this.persistence.get_initial_props(),s=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),i=qi({},a,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Gt.error("sanitize_properties is deprecated. Use before_send instead"),i=o(i,"$set_once")),n&&(this.fi=!0),tO(i)?void 0:i}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var a;(a=this.persistence)==null||a.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}zi(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var a;(a=this.featureFlags)==null||a.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var a;(a=this.featureFlags)==null||a.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var a;return n===void 0&&(n=!1),(a=this.featureFlags)==null?void 0:a.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.pi.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:"Surveys module not available"}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:"Surveys module not available"})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:"Surveys module not available"})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=rwr),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:"Surveys module not available"}}canRenderSurveyAsync(t,n){var r,a;return n===void 0&&(n=!1),(r=(a=this.surveys)==null?void 0:a.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:"Surveys module not available"})}identify(t,n,r){if(!this.__loaded||!this.persistence)return Gt.uninitializedWarning("posthog.identify");if(Om(t)&&(t=t.toString(),Gt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))Gt.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==RC){if(this.Ui("posthog.identify")){var a=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==a&&t!==this.get_property(mj)&&(this.unregister(mj),this.register({distinct_id:t}));var i,o=(this.persistence.get_property(Nh)||"anonymous")==="anonymous";t!==a&&o?(this.persistence.set_property(Nh,"identified"),this.setPersonPropertiesForFlags(Lt({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:a},{$set:n||{},$set_once:r||{}}),this.yi=HFe(t,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(a)):(n||r)&&this.setPersonProperties(n,r),t!==a&&(this.reloadFeatureFlags(),this.unregister(nT))}}else Gt.critical('The string "'+RC+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Gt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.Ui("posthog.setPersonProperties")){var r=HFe(this.get_distinct_id(),t,n);this.yi!==r?(this.setPersonPropertiesForFlags(Lt({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.yi=r):Gt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var a=this.getGroups();a[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Lt({},a,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),a[t]===n||r||this.reloadFeatureFlags()}else Gt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.Ui("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,a,s,i,o,c;if(Gt.info("reset"),!this.__loaded)return Gt.uninitializedWarning("posthog.reset");var u=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(a=this.surveys)==null||a.reset(),(s=this.Mi)==null||s.stop(),(i=this.featureFlags)==null||i.reset(),(o=this.persistence)==null||o.set_property(Nh,"anonymous"),(c=this.sessionManager)==null||c.resetSessionId(),this.yi=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:RC,$device_id:null},"");else{var d=this.config.get_device_id(Hy());this.register_once({distinct_id:d,$device_id:t?d:u},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),this.reloadFeatureFlags()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),a=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var s,i=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return a;a+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-i,0)}return a}alias(t,n){return t===this.get_property(_St)?(Gt.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ui("posthog.alias")?(Ht(n)&&(n=this.get_distinct_id()),t!==n?(this.zi(mj,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(Gt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=Lt({},this.config);if(Ao(t)){var r,a,s,i,o,c,u,d,f;qi(this.config,ZFe(t));var p=this.xi();(r=this.persistence)==null||r.update_config(this.config,n,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new XJ(Lt({},this.config,{persistence:"sessionStorage"}),p);var h=this.wi(this.config.debug);qg(h)&&(this.config.debug=h),qg(this.config.debug)&&(this.config.debug?(ff.DEBUG=!0,di.F()&&di.L("ph_debug",!0),Gt.info("set_config",{config:t,oldConfig:n,newConfig:Lt({},this.config)})):(ff.DEBUG=!1,di.F()&&di.j("ph_debug"))),(a=this.exceptionObserver)==null||a.onConfigChange(),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(i=this.autocapture)==null||i.startIfEnabled(),(o=this.heatmaps)==null||o.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.Hi(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){ff.LIB_NAME=t,ff.LIB_VERSION=n}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var a,s,i,o,c;(a=this.sessionManager)==null||a.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)==null||c.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),a=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Lt({},a,n))}}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:M1;return n!==M1&&(n=M1+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(Nh))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Nh))==="identified"}Ni(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&tO(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[mj])&&((n=this.persistence)==null||(n=n.props)==null||!n[vL]))}Ai(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ni()||this.Ui("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Ui("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Ui(t){return this.config.person_profiles==="never"?(Gt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zi(vL,!0),!0)}xi(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!n}Hi(){var t,n,r,a,s=this.xi();return((t=this.persistence)==null?void 0:t.st)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.st)!==s&&((a=this.sessionPersistence)==null||a.set_disabled(s)),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,a,s,i,o;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=new qFe(this),this.pageViewManager=new MFe(this),this.persistence&&(this.sessionPropsManager=new VFe(this,this.sessionManager,this.persistence));var c=(s=(i=this.config.__extensionClasses)==null?void 0:i.sessionRecording)!==null&&s!==void 0?s:(o=Vh.__defaultExtensionClasses)==null?void 0:o.sessionRecording;c&&(this.sessionRecording=this.vi(this.sessionRecording,new c(this)))}var u,d;this.consent.optInOut(!0),this.Hi(),this.Oi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((u=this.surveys)==null||u.loadIfEnabled()),(Ht(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((d=t?.captureEventName)!==null&&d!==void 0?d:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Fi()}else Gt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Hi(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:RC,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.Fi())):Gt.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===xg.GRANTED?"granted":t===xg.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Hi()}_is_bot(){return bd?HSt(bd,this.config.custom_blocked_useragents):void 0}Fi(){Vt&&(Vt.visibilityState==="visible"?this.gi||(this.gi=!0,this.capture("$pageview",{title:Vt.title},{send_instantly:!0}),this.mi&&(Vt.removeEventListener("visibilitychange",this.mi),this.mi=null)):this.mi||(this.mi=this.Fi.bind(this),ro(Vt,"visibilitychange",this.mi)))}debug(t){t===!1?(Ge?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Ge?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}bt(){var t,n,r,a,s,i,o,c=this.Ei||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Gt.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",a=!1,s=Gt,i=(n="advanced_disable_flags")in(t=c)&&!Jr(t[n]),o=r in t&&!Jr(t[r]),i?t[n]:o?(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):a)}ji(t){if(Jr(this.config.before_send))return t;var n=Aa(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var a of n){if(r=a(r),Jr(r)){var s="Event '"+t.event+"' was rejected in beforeSend function";return Rxr(t.event)?Gt.warn(s+". This can cause unexpected behavior."):Gt.info(s),null}r.properties&&!tO(r.properties)||Gt.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.K)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}wi(t){var n=qg(t)&&!t,r=di.F()&&di.A("ph_debug")==="true";return!n&&(!!r||t)}}Vh.__defaultExtensionClasses={},(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=m0r(e.prototype[t[n]])})(Vh,["identify"]);function YFe(e){return e instanceof Element&&(e.id===jSt||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function d9(e){return!!e&&e.nodeType===1}function lb(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function YSt(e){return!!e&&e.nodeType===3}function XSt(e){return!!e&&e.nodeType===11}function Qge(e){return e?c9(e).split(/\s+/):[]}function XFe(e){var t=Ge?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function _L(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Qge(t)}function KSt(e){return Jr(e)?null:c9(e).split(/(\s+)/).filter((t=>SA(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function TR(e){var t="";return iie(e)&&!n1t(e)&&e.childNodes&&e.childNodes.length&&Is(e.childNodes,(function(n){var r;YSt(n)&&n.textContent&&(t+=(r=KSt(n.textContent))!==null&&r!==void 0?r:"")})),c9(t)}function KFe(e){return Ht(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Gge=["a","button","form","input","select","textarea","label"];function JSt(e,t){if(Ht(t))return!0;var n,r=function(s){if(t.some((i=>s.matches(i))))return{v:!0}};for(var a of e)if(n=r(a))return n.v;return!1}function e1t(e){var t=e.parentNode;return!(!t||!d9(t))&&t}var lwr=["next","previous","prev",">","<"],JFe=10,eze=[".ph-no-rageclick",".ph-no-capture"];function cwr(e,t){if(!Ge||Wge(e))return!1;var n,r,a;if(qg(t)?(n=!!t&&eze,r=void 0):(n=(a=t?.css_selector_ignorelist)!==null&&a!==void 0?a:eze,r=t?.content_ignorelist),n===!1)return!1;var{targetElementList:s}=t1t(e,!1);return!(function(i,o){if(i===!1||Ht(i))return!1;var c;if(i===!0)c=lwr;else{if(!Aa(i))return!1;if(i.length>JFe)return Gt.error("[PostHog] content_ignorelist array cannot exceed "+JFe+" items. Use css_selector_ignorelist for more complex matching."),!1;c=i.map((u=>u.toLowerCase()))}return o.some((u=>{var{safeText:d,ariaLabel:f}=u;return c.some((p=>d.includes(p)||f.includes(p)))}))})(r,s.map((i=>{var o;return{safeText:TR(i).toLowerCase(),ariaLabel:((o=i.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!JSt(s,n)}var Wge=e=>!e||lb(e,"html")||!d9(e),t1t=(e,t)=>{if(!Ge||Wge(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],a=e;a.parentNode&&!lb(a,"body");)if(XSt(a.parentNode))r.push(a.parentNode.host),a=a.parentNode.host;else{var s=e1t(a);if(!s)break;if(t||Gge.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var i=Ge.getComputedStyle(s);i&&i.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),a=s}return{parentIsUsefulElement:n,targetElementList:r}};function uwr(e,t,n,r,a){var s,i,o,c;if(n===void 0&&(n=void 0),!Ge||Wge(e)||(s=n)!=null&&s.url_allowlist&&!XFe(n.url_allowlist)||(i=n)!=null&&i.url_ignorelist&&XFe(n.url_ignorelist))return!1;if((o=n)!=null&&o.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((m=>t.type===m)))return!1}var{parentIsUsefulElement:d,targetElementList:f}=t1t(e,r);if(!(function(m,g){var v=g?.element_allowlist;if(Ht(v))return!0;var b,S=function(k){if(v.some((E=>k.tagName.toLowerCase()===E)))return{v:!0}};for(var O of m)if(b=S(O))return b.v;return!1})(f,n)||!JSt(f,(c=n)==null?void 0:c.css_selector_allowlist))return!1;var p=Ge.getComputedStyle(e);if(p&&p.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(a||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(a||["change","click"]).indexOf(t.type)>=0;default:return d?(a||["click"]).indexOf(t.type)>=0:(a||["click"]).indexOf(t.type)>=0&&(Gge.indexOf(h)>-1||e.getAttribute("contenteditable")==="true")}}function iie(e){for(var t=e;t.parentNode&&!lb(t,"body");t=t.parentNode){var n=_L(t);if(Vr(n,"ph-sensitive")||Vr(n,"ph-no-capture"))return!1}if(Vr(_L(e),"ph-include"))return!0;var r=e.type||"";if(oo(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!(oo(a)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,"")))}function n1t(e){return!!(lb(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||lb(e,"select")||lb(e,"textarea")||e.getAttribute("contenteditable")==="true")}var r1t="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",dwr=new RegExp("^(?:"+r1t+")$"),fwr=new RegExp(r1t),a1t="\\d{3}-?\\d{2}-?\\d{4}",pwr=new RegExp("^("+a1t+")$"),hwr=new RegExp("("+a1t+")");function SA(e,t){return t===void 0&&(t=!0),!(Jr(e)||oo(e)&&(e=c9(e),(t?dwr:fwr).test((e||"").replace(/[- ]/g,""))||(t?pwr:hwr).test(e)))}function s1t(e){var t=TR(e);return SA(t=(t+" "+i1t(e)).trim())?t:""}function i1t(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Is(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var a=TR(n);t=(t+" "+a).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+i1t(n)).trim())}catch(s){Gt.error("[AutoCapture]",s)}})),t}function mwr(e){return(function(t){var n=t.map((r=>{var a,s,i="";if(r.tag_name&&(i+=r.tag_name),r.attr_class)for(var o of(r.attr_class.sort(),r.attr_class))i+="."+o.replace(/"/g,"");var c=Lt({},r.text?{text:r.text}:{},{"nth-child":(a=r.nth_child)!==null&&a!==void 0?a:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return ZD(c).sort(((d,f)=>{var[p]=d,[h]=f;return p.localeCompare(h)})).forEach((d=>{var[f,p]=d;return u[tze(f.toString())]=tze(p.toString())})),i+=":",i+=ZD(u).map((d=>{var[f,p]=d;return f+'="'+p+'"'})).join("")}));return n.join(";")})((function(t){return t.map((n=>{var r,a,s={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(a=n.attr__href)==null?void 0:a.slice(0,2048),attr_class:gwr(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return ZD(n).filter((i=>{var[o]=i;return o.indexOf("attr__")===0})).forEach((i=>{var[o,c]=i;return s.attributes[o]=c})),s}))})(e))}function tze(e){return e.replace(/"|\\"/g,'\\"')}function gwr(e){var t=e.attr__class;return t?Aa(t)?t:Qge(t):void 0}class nze{constructor(t){this.disabled=t===!1;var n=Ao(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var a=this.clicks[this.clicks.length-1];if(a&&Math.abs(t-a.x)+Math.abs(n-a.y)<this.thresholdPx&&r-a.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var see="$copy_autocapture",rze=bi("[AutoCapture]");function iee(e,t){return t.length>e?t.slice(0,e)+"...":t}function vwr(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!d9(t));return t}function ywr(e,t,n,r){var a=e.tagName.toLowerCase(),s={tag_name:a};Gge.indexOf(a)>-1&&!n&&(a.toLowerCase()==="a"||a.toLowerCase()==="button"?s.$el_text=iee(1024,s1t(e)):s.$el_text=iee(1024,TR(e)));var i=_L(e);i.length>0&&(s.classes=i.filter((function(d){return d!==""}))),Is(e.attributes,(function(d){var f;if((!n1t(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(r==null||!r.includes(d.name))&&!t&&SA(d.value)&&(f=d.name,!oo(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=Qge(p).join(" ")),s["attr__"+d.name]=iee(1024,p)}}));for(var o=1,c=1,u=e;u=vwr(u);)o++,u.tagName===e.tagName&&c++;return s.nth_child=o,s.nth_of_type=c,s}function bwr(e,t){for(var n,r,{e:a,maskAllElementAttributes:s,maskAllText:i,elementAttributeIgnoreList:o,elementsChainAsString:c}=t,u=[e],d=e;d.parentNode&&!lb(d,"body");)XSt(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var f,p=[],h={},m=!1,g=!1;if(Is(u,(k=>{var E=iie(k);k.tagName.toLowerCase()==="a"&&(m=k.getAttribute("href"),m=E&&m&&SA(m)&&m),Vr(_L(k),"ph-no-capture")&&(g=!0),p.push(ywr(k,s,i,o));var C=(function(T){if(!iie(T))return{};var j={};return Is(T.attributes,(function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){var I=A.name.replace("data-ph-capture-attribute-",""),P=A.value;I&&P&&SA(P)&&(j[I]=P)}})),j})(k);qi(h,C)})),g)return{props:{},explicitNoCapture:g};if(i||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?p[0].$el_text=s1t(e):p[0].$el_text=TR(e)),m){var v,b;p[0].attr__href=m;var S=(v=bL(m))==null?void 0:v.host,O=Ge==null||(b=Ge.location)==null?void 0:b.host;S&&O&&S!==O&&(f=m)}return{props:qi({$event_type:a.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:mwr(p)},(n=p[0])!=null&&n.$el_text?{$el_text:(r=p[0])==null?void 0:r.$el_text}:{},f&&a.type==="click"?{$external_click_url:f}:{},h)}}var FC=bi("[ExceptionAutocapture]");function aze(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],a=n(r);return Pg(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}var xwr=bi("[TracingHeaders]"),yy=bi("[Web Vitals]"),sze=9e5,ize="disabled",oze="lazy_loading",zC="awaiting_config",eD="missing_config";bi("[SessionRecording]");var oie="[SessionRecording]",Wx=bi(oie),wwr=bi("[Heatmaps]");function lze(e){return Ao(e)&&"clientX"in e&&"clientY"in e&&Om(e.clientX)&&Om(e.clientY)}var cze=bi("[Product Tours]"),oee="ph_product_tours",Swr=["$set_once","$set"],by=bi("[SiteApps]");function b1(e,t,n){if(Jr(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class Owr{constructor(t){this.Bi=new Hge,this.qi=(n,r)=>this.Vi(n,r)&&this.Wi(n,r)&&this.Gi(n,r)&&this.Yi(n,r),this.Vi=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=t,this.Ji=new Set,this.Ki=new Set}init(){var t;if(!Ht((t=this._instance)==null?void 0:t._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook(((r,a)=>{this.on(r,a)}))}}register(t){var n,r;if(!Ht((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((i=>{var o,c;(o=this.Ki)==null||o.add(i),(c=i.steps)==null||c.forEach((u=>{var d;(d=this.Ji)==null||d.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var a,s=new Set;t.forEach((i=>{var o;(o=i.steps)==null||o.forEach((c=>{c!=null&&c.selector&&s.add(c?.selector)}))})),(a=this._instance)==null||a.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.Ji.has(t)||this.Ji.has(n?.event))&&this.Ki&&((r=this.Ki)==null?void 0:r.size)>0&&this.Ki.forEach((a=>{this.Xi(n,a)&&this.Bi.emit("actionCaptured",a.name)}))}Qi(t){this.onAction("actionCaptured",(n=>t(n)))}Xi(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.qi(t,r))return!0;return!1}onAction(t,n){return this.Bi.on(t,n)}Wi(t,n){if(n!=null&&n.url){var r,a=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!a||typeof a!="string"||!b1(a,n.url,n.url_matching||"contains"))return!1}return!0}Gi(t,n){return!!this.Zi(t,n)&&!!this.te(t,n)&&!!this.ie(t,n)}Zi(t,n){var r;if(n==null||!n.href)return!0;var a=this.ee(t);if(a.length>0)return a.some((o=>b1(o.href,n.href,n.href_matching||"exact")));var s,i=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!i&&b1((s=i.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}te(t,n){var r;if(n==null||!n.text)return!0;var a=this.ee(t);if(a.length>0)return a.some((u=>b1(u.text,n.text,n.text_matching||"exact")||b1(u.$el_text,n.text,n.text_matching||"exact")));var s,i,o,c=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(s=(function(u){for(var d,f=[],p=/(?::|")text="(.*?)"/g;!Jr(d=p.exec(u));)f.includes(d[1])||f.push(d[1]);return f})(c),i=n.text,o=n.text_matching||"exact",s.some((u=>b1(u,i,o))))}ie(t,n){var r,a;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var i=(t==null||(a=t.properties)==null?void 0:a.$elements_chain)||"";if(n.selector_regex&&i)try{return new RegExp(n.selector_regex).test(i)}catch{return!1}return!1}ee(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t?.properties.$elements}Yi(t,n){return n==null||!n.properties||n.properties.length===0||GSt(n.properties.reduce(((r,a)=>{var s=Aa(a.value)?a.value.map(String):a.value!=null?[String(a.value)]:[];return r[a.key]={values:s,operator:a.operator||"exact"},r}),{}),t?.properties)}}class kwr{constructor(t){this._instance=t,this.re=new Map,this.se=new Map,this.ne=new Map}oe(t,n){return!!t&&GSt(t.propertyFilters,n?.properties)}ae(t,n){var r=new Map;return t.forEach((a=>{var s;(s=a.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((i=>{if(i!=null&&i.name){var o=r.get(i.name)||[];o.push(a.id),r.set(i.name,o)}}))})),r}le(t,n,r){var a=(r===MC.Activation?this.re:this.se).get(t),s=[];return this.ue((i=>{s=i.filter((o=>a?.includes(o.id)))})),s.filter((i=>{var o,c=(o=i.conditions)==null||(o=o[r])==null||(o=o.values)==null?void 0:o.find((u=>u.name===t));return this.oe(c,n)}))}register(t){var n;Ht((n=this._instance)==null?void 0:n._addCaptureHook)||(this.he(t),this.de(t))}de(t){var n=t.filter((r=>{var a,s;return((a=r.conditions)==null?void 0:a.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.ve==null&&(this.ve=new Owr(this._instance),this.ve.init(),this.ve.Qi((r=>{this.onAction(r)}))),n.forEach((r=>{var a,s,i,o,c;r.conditions&&(a=r.conditions)!=null&&a.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((o=this.ve)==null||o.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((u=>{if(u&&u.name){var d=this.ne.get(u.name);d&&d.push(r.id),this.ne.set(u.name,d||[r.id])}})))})))}he(t){var n,r=t.filter((s=>{var i,o;return((i=s.conditions)==null?void 0:i.events)&&((o=s.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),a=t.filter((s=>{var i,o;return((i=s.conditions)==null?void 0:i.cancelEvents)&&((o=s.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));(r.length!==0||a.length!==0)&&((n=this._instance)==null||n._addCaptureHook(((s,i)=>{this.onEvent(s,i)})),this.re=this.ae(t,MC.Activation),this.se=this.ae(t,MC.Cancellation))}onEvent(t,n){var r,a=this.ce(),s=this.fe(),i=this.pe(),o=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(i===t&&n&&o.length>0){var c,u;a.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:o});var d=(n==null||(c=n.properties)==null?void 0:c.$survey_id)||(n==null||(u=n.properties)==null?void 0:u.$product_tour_id);if(d){var f=o.indexOf(d);f>=0&&(o.splice(f,1),this._e(o))}}else{if(this.se.has(t)){var p=this.le(t,n,MC.Cancellation);p.length>0&&(a.info("cancel event matched, cancelling items",{event:t,itemsToCancel:p.map((m=>m.id))}),p.forEach((m=>{var g=o.indexOf(m.id);g>=0&&o.splice(g,1),this.ge(m.id)})),this._e(o))}if(this.re.has(t)){a.info("event name matched",{event:t,eventPayload:n,items:this.re.get(t)});var h=this.le(t,n,MC.Activation);this._e(o.concat(h.map((m=>m.id))||[]))}}}onAction(t){var n,r=this.fe(),a=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ne.has(t)&&this._e(a.concat(this.ne.get(t)||[]))}_e(t){var n,r=this.ce(),a=this.fe(),s=[...new Set(t)].filter((i=>!this.me(i)));r.info("updating activated items",{activatedItems:s}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[a]:s})}getActivatedIds(){var t,n=this.fe(),r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r||[]}getEventToItemsMap(){return this.re}be(){return this.ve}}class _wr extends kwr{constructor(t){super(t)}fe(){return"$surveys_activated"}pe(){return bj.SHOWN}ue(t){var n;(n=this._instance)==null||n.getSurveys(t)}ge(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}ce(){return hs}me(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Ewr=Ge!=null&&Ge.location?wL(Ge.location.hash,"__posthog")||wL(location.hash,"state"):null,uze="_postHogToolbarParams",dze=bi("[Toolbar]"),Oy=(function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e})(Oy||{}),eu=bi("[FeatureFlags]"),BC=bi("[FeatureFlags]",{debugEnabled:!0}),Cwr="errors_while_computing_flags",jwr="flag_missing",Twr="quota_limited",Nwr="timeout",Awr="connection_error",Iwr="unknown_error",Rwr=e=>"api_error_"+e,lee="$active_feature_flags",x1="$override_feature_flags",fze="$feature_flag_payloads",UC="$override_feature_flag_payloads",pze="$feature_flag_request_id",hze=e=>{var t={};for(var[n,r]of ZD(e||{}))r&&(t[n]=r);return t},Pwr=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((n=>t[n].enabled)).filter((n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]})))):eu.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},Mwr=(function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e})({}),cee=bi("[Error tracking]"),Dwr={icontains:(e,t)=>!!Ge&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Ge&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!Ge&&kL(t.href,e),not_regex:(e,t)=>!!Ge&&!kL(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Ll{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((a=>{Ll.ye("retrieved web experiments from the server"),n.we=new Map,a.forEach((s=>{if(s.feature_flag_key){var i;n.we&&(Ll.ye("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=n.we)==null||i.set(s.feature_flag_key,s));var o=n._instance.getFeatureFlag(s.feature_flag_key);oo(o)&&s.variants[o]&&n.Ee(s.name,o,s.variants[o].transforms)}else if(s.variants)for(var c in s.variants){var u=s.variants[c];Ll.Se(u)&&n.Ee(s.name,c,u.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Ll.ye("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Jr(this.we))return this.we=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ll.ye("applying feature flags",t),t.forEach((n=>{var r;if(this.we&&(r=this.we)!=null&&r.has(n)){var a,s=this._instance.getFeatureFlag(n),i=(a=this.we)==null?void 0:a.get(n);s&&i!=null&&i.variants[s]&&this.Ee(i.name,s,i.variants[s].transforms)}}))}}previewWebExperiment(){var t=Ll.getWindowLocation();if(t!=null&&t.search){var n=xL(t?.search,"__experiment_id"),r=xL(t?.search,"__experiment_variant");n&&r&&(Ll.ye("previewing web experiments "+n+" && "+r),this.getWebExperiments((a=>{this.xe(parseInt(n),r,a)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var a=this._instance.get_property("$web_experiments");if(a&&!n)return t(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return t([]);var i=s.json.experiments||[];return t(i)}})}xe(t,n,r){var a=r.filter((s=>s.id===t));a&&a.length>0&&(Ll.ye("Previewing web experiment ["+a[0].name+"] with variant ["+n+"]"),this.Ee(a[0].name,n,a[0].variants[n].transforms))}static Se(t){return!Jr(t.conditions)&&Ll.$e(t)&&Ll.ke(t)}static $e(t){var n;if(Jr(t.conditions)||Jr((n=t.conditions)==null?void 0:n.url))return!0;var r,a,s,i=Ll.getWindowLocation();return!!i&&((r=t.conditions)==null||!r.url||Dwr[(a=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&a!==void 0?a:"icontains"](t.conditions.url,i))}static getWindowLocation(){return Ge?.location}static ke(t){var n;if(Jr(t.conditions)||Jr((n=t.conditions)==null?void 0:n.utm))return!0;var r=ISt();if(r.utm_source){var a,s,i,o,c,u,d,f,p=(a=t.conditions)==null||(a=a.utm)==null||!a.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,h=(i=t.conditions)==null||(i=i.utm)==null||!i.utm_source||((o=t.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==r.utm_source,m=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_medium||((u=t.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,g=(d=t.conditions)==null||(d=d.utm)==null||!d.utm_term||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return p&&m&&g&&h}return!1}static ye(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];Gt.info("[WebExperiments] "+t,r)}Ee(t,n,r){this._is_bot()?Ll.ye("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((a=>{if(a.selector){var s;Ll.ye("applying transform of variant "+n+" for experiment "+t+" ",a);var i=(s=document)==null?void 0:s.querySelectorAll(a.selector);i?.forEach((o=>{var c=o;a.html&&(c.innerHTML=a.html),a.css&&c.setAttribute("style",a.css)}))}})):Ll.ye("Control variants leave the page unmodified.")}_is_bot(){return bd&&this._instance?HSt(bd,this._instance.config.custom_blocked_useragents):void 0}}var uf=bi("[Conversations]"),f9={featureFlags:class{constructor(e){this.Pe=!1,this.Te=!1,this.Re=!1,this.Ie=!1,this.Ce=!1,this.Oe=!1,this.Fe=!1,this.Me=!1,this._instance=e,this.featureFlagEventHandlers=[]}Ae(){var e,t;return(e=(t=this._instance.persistence)==null?void 0:t.nt(this._instance.config.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}De(){return!!this.Ae()&&(this.Me||this.Re||(this.Me=!0,eu.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Le(){var e,t=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Fe||(eu.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Fe=!0),t!=null&&t.length?t.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||eu.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}je(){return this.Le().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var a,s,i=(a=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&a!==void 0?a:{},o=Object.keys(r).filter((u=>!!r[u])).reduce(((u,d)=>(u[d]=r[d]||!1,u)),{}),c=Object.keys(i).filter((u=>o[u])).reduce(((u,d)=>(i[d]&&(u[d]=i[d]),u)),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:c})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},a=n!=null&&n.merge?this.getFlagPayloads():{},s=Lt({},r,e),i=Lt({},a,t),o={};for(var[c,u]of Object.entries(s)){var d=typeof u=="string";o[c]={key:c,enabled:!!d||!!u,variant:d?u:void 0,reason:void 0,metadata:Ht(i?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:i[c]}}}this.receivedFeatureFlags({flags:o})}get hasLoadedFlags(){return this.Te}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Qse),t=this._instance.get_property(x1),n=this._instance.get_property(UC);if(!n&&!t)return e||{};var r=qi({},e||{}),a=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of a){var i,o,c=r[s],u=t?.[s],d=Ht(u)?(i=c?.enabled)!==null&&i!==void 0&&i:!!u,f=Ht(u)?c.variant:typeof u=="string"?u:void 0,p=n?.[s],h=Lt({},c,{enabled:d,variant:d?f??c?.variant:void 0});d!==c?.enabled&&(h.original_enabled=c?.enabled),f!==c?.variant&&(h.original_variant=c?.variant),p&&(h.metadata=Lt({},c?.metadata,{payload:p,original_payload:c==null||(o=c.metadata)==null?void 0:o.payload})),r[s]=h}return this.Pe||(eu.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Pe=!0),r}getFlagVariants(){var e=this._instance.get_property(nO),t=this._instance.get_property(x1);if(!t)return e||{};for(var n=qi({},e),r=Object.keys(t),a=0;a<r.length;a++)n[r[a]]=t[r[a]];return this.Pe||(eu.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Pe=!0),n}getFlagPayloads(){var e=this._instance.get_property(fze),t=this._instance.get_property(UC);if(!t)return e||{};for(var n=qi({},e||{}),r=Object.keys(t),a=0;a<r.length;a++)n[r[a]]=t[r[a]];return this.Pe||(eu.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Pe=!0),n}reloadFeatureFlags(){this.Ie||this._instance.config.advanced_disable_feature_flags||this.Ne||(this._instance.pi.emit("featureFlagsReloading",!0),this.Ne=setTimeout((()=>{this.Ue()}),5))}ze(){clearTimeout(this.Ne),this.Ne=void 0}ensureFlagsLoaded(){this.Te||this.Re||this.Ne||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Ie=e}Ue(e){var t;if(this.ze(),!this._instance.bt())if(this.Re)this.Ce=!0;else{var n=this._instance.config.token,r=this._instance.get_property("$device_id"),a={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Lt({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(yj)||{}),group_properties:this._instance.get_property(r0),timezone:LSt()};sh(r)||Ht(r)||(a.$device_id=r),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(a.disable_flags=!0),this.je()&&(a.evaluation_contexts=this.Le());var s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",i=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+s);this.Re=!0,this._instance._send_request({method:"POST",url:i,data:a,compression:this._instance.config.disable_compression?void 0:Cg.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var c,u,d,f=!0;if(o.statusCode===200&&(this.Ce||(this.$anon_distinct_id=void 0),f=!1),this.Re=!1,!a.disable_flags||this.Ce){this.Oe=!f;var p=[];o.error?o.error instanceof Error?p.push(o.error.name==="AbortError"?Nwr:Awr):p.push(Iwr):o.statusCode!==200&&p.push(Rwr(o.statusCode)),(c=o.json)!=null&&c.errorsWhileComputingFlags&&p.push(Cwr);var h=!((u=o.json)==null||(u=u.quotaLimited)==null||!u.includes(Mwr.FeatureFlags));if(h&&p.push(Twr),(d=this._instance.persistence)==null||d.register({[Zse]:p}),h)eu.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var m;a.disable_flags||this.receivedFeatureFlags((m=o.json)!==null&&m!==void 0?m:{},f),this.Ce&&(this.Ce=!1,this.Ue())}}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.Oe)if(this.Te||this.getFlags()&&this.getFlags().length>0){if(!this.De()){var r=this.getFeatureFlagResult(e,t);return(n=r?.variant)!==null&&n!==void 0?n:r?.enabled}}else eu.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.Oe)if(this.Te||this.getFlags()&&this.getFlags().length>0){if(!this.De()){var n=this.getFlagVariants(),r=e in n,a=n[e],s=this.getFlagPayloads()[e],i=String(a),o=this._instance.get_property(pze)||void 0,c=this._instance.get_property(mL)||void 0,u=this._instance.get_property(nT)||{};if(this._instance.config.advanced_feature_flags_dedup_per_session){var d,f=this._instance.get_session_id(),p=this._instance.get_property(Wse);f&&f!==p&&(u={},(d=this._instance.persistence)==null||d.register({[nT]:u,[Wse]:f}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(i))){var h,m,g,v,b,S,O,k,E,C;Aa(u[e])?u[e].push(i):u[e]=[i],(h=this._instance.persistence)==null||h.register({[nT]:u});var T=this.getFeatureFlagDetails(e),j=[...(m=this._instance.get_property(Zse))!==null&&m!==void 0?m:[]];Ht(a)&&j.push(jwr);var A={$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:s||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((g=this._instance.config.bootstrap)==null||(g=g.featureFlags)==null?void 0:g[e])||null,$feature_flag_bootstrapped_payload:((v=this._instance.config.bootstrap)==null||(v=v.featureFlagPayloads)==null?void 0:v[e])||null,$used_bootstrap_value:!this.Oe};Ht(T==null||(b=T.metadata)==null?void 0:b.version)||(A.$feature_flag_version=T.metadata.version);var I,P=(S=T==null||(O=T.reason)==null?void 0:O.description)!==null&&S!==void 0?S:T==null||(k=T.reason)==null?void 0:k.code;P&&(A.$feature_flag_reason=P),T!=null&&(E=T.metadata)!=null&&E.id&&(A.$feature_flag_id=T.metadata.id),Ht(T?.original_variant)&&Ht(T?.original_enabled)||(A.$feature_flag_original_response=Ht(T.original_variant)?T.original_enabled:T.original_variant),T!=null&&(C=T.metadata)!=null&&C.original_payload&&(A.$feature_flag_original_payload=T==null||(I=T.metadata)==null?void 0:I.original_payload),j.length&&(A.$feature_flag_error=j.join(",")),this._instance.capture("$feature_flag_called",A)}if(r){var M=s;if(!Ht(s))try{M=JSON.parse(s)}catch{}return{key:e,enabled:!!a,variant:typeof a=="string"?a:void 0,payload:M}}}}else eu.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,t){var n=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.je()&&(r.evaluation_contexts=this.Le()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this._instance.config.disable_compression?void 0:Cg.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:a=>{var s,i=(s=a.json)==null?void 0:s.featureFlagPayloads;t(i?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.Oe){if(this.Te||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return Ht(n)?void 0:!!n}eu.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this._instance.persistence){this.Te=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(s,i,o,c,u){o===void 0&&(o={}),c===void 0&&(c={}),u===void 0&&(u={});var d=Pwr(s),f=d.flags,p=d.featureFlags,h=d.featureFlagPayloads;if(p){var m=s.requestId,g=s.evaluatedAt;if(Aa(p)){eu.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(p)for(var b=0;b<p.length;b++)v[p[b]]=!0;i&&i.register({[lee]:p,[nO]:v})}else{var S=p,O=h,k=f;if(s.errorsWhileComputingFlags)if(f){var E=new Set(Object.keys(f).filter((C=>{var T;return!((T=f[C])!=null&&T.failed)})));S=Lt({},o,Object.fromEntries(Object.entries(S).filter((C=>{var[T]=C;return E.has(T)})))),O=Lt({},c,Object.fromEntries(Object.entries(O||{}).filter((C=>{var[T]=C;return E.has(T)})))),k=Lt({},u,Object.fromEntries(Object.entries(k||{}).filter((C=>{var[T]=C;return E.has(T)}))))}else S=Lt({},o,S),O=Lt({},c,O),k=Lt({},u,k);i&&i.register(Lt({[lee]:Object.keys(hze(S)),[nO]:S||{},[fze]:O||{},[Qse]:k||{}},m?{[pze]:m}:{},g?{[mL]:g}:{}))}}})(e,this._instance.persistence,n,r,a),t||(this.Me=!1),this.He(t)}}override(e,t){t===void 0&&(t=!1),eu.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return eu.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(x1),this._instance.persistence.unregister(UC),this.He(),BC.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.Pe=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(x1),BC.info("Flag overrides cleared");else if(n.flags){if(Aa(n.flags)){for(var r={},a=0;a<n.flags.length;a++)r[n.flags[a]]=!0;this._instance.persistence.register({[x1]:r})}else this._instance.persistence.register({[x1]:n.flags});BC.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(UC),BC.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[UC]:n.payloads}),BC.info("Payload overrides set",{payloads:n.payloads}))),void this.He()}this.He()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Te){var{flags:t,flagVariants:n}=this.Be();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,a=(this._instance.get_property(vj)||[]).find((c=>c.flagKey===e)),s={["$feature_enrollment/"+e]:t},i={$feature_flag:e,$feature_enrollment:t,$set:s};a&&(i.$early_access_feature_name=a.name),n&&(i.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",i),this.setPersonPropertiesForFlags(s,!1);var o=Lt({},this.getFlagVariants(),{[e]:t});(r=this._instance.persistence)==null||r.register({[lee]:Object.keys(hze(o)),[nO]:o}),this.He()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(vj),a=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+a),method:"GET",callback:s=>{var i,o;if(s.json){var c=s.json.earlyAccessFeatures;return(i=this._instance.persistence)==null||i.unregister(vj),(o=this._instance.persistence)==null||o.register({[vj]:c}),e(c)}}})}Be(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((n=>t[n])),flagVariants:Object.keys(t).filter((n=>t[n])).reduce(((n,r)=>(n[r]=t[r],n)),{})}}He(e){var{flags:t,flagVariants:n}=this.Be();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(yj)||{};this._instance.register({[yj]:Lt({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(yj)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(r0)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Lt({},n[r],e[r]),delete e[r]})),this._instance.register({[r0]:Lt({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(r0)||{};this._instance.register({[r0]:Lt({},t,{[e]:{}})})}else this._instance.unregister(r0)}reset(){this.Te=!1,this.Re=!1,this.Ie=!1,this.Ce=!1,this.Oe=!1,this.$anon_distinct_id=void 0,this.ze(),this.Pe=!1}}},$wr={sessionRecording:class{get started(){var e;return!((e=this.qe)==null||!e.isStarted)}get status(){var e,t;return this.Ve===zC||this.Ve===eD?this.Ve:(e=(t=this.qe)==null?void 0:t.status)!==null&&e!==void 0?e:this.Ve}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ve=ize,this.We=void 0,this._instance=e,!this._instance.sessionManager)throw Wx.error("started without valid sessionManager"),new Error(oie+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(oie+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ge(){var e,t=!((e=this._instance.get_property(Z2))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Ge&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.Ge||(t=this.qe)==null||!t.isStarted){var n=!Ht(Object.assign)&&!Ht(Array.from);this.Ge&&n?(this.Ye(e),Wx.info("starting")):(this.Ve=ize,this.stopRecording())}}Ye(e){var t,n,r;this.Ge&&(this.Ve!==zC&&this.Ve!==eD&&(this.Ve=oze),Fn!=null&&(t=Fn.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=Fn.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Je(e):(r=Fn.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ke,(a=>{if(a)return Wx.error("could not load recorder",a);this.Je(e)})))}stopRecording(){var e,t;(e=this.We)==null||e.call(this),this.We=void 0,(t=this.qe)==null||t.stop()}Xe(){var e,t;(e=this.We)==null||e.call(this),this.We=void 0,(t=this.qe)==null||t.discard()}Qe(){var e;(e=this._instance.persistence)==null||e.unregister(CSt)}Ze(e,t){if(Jr(e))return null;var n,r=Om(e)?e:parseFloat(e);return typeof(n=r)=="number"&&Number.isFinite(n)&&n>=0&&n<=1?r:(Wx.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null)}tr(e){if(this._instance.persistence){var t,n,r=this._instance.persistence,a=()=>{var s,i=e.sessionRecording===!1?void 0:e.sessionRecording,o=this.Ze((s=this._instance.config.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),c=this.Ze(i?.sampleRate,"remote config sampleRate"),u=o??c;Jr(u)&&this.Qe();var d=i?.minimumDurationMilliseconds;r.register({[Z2]:Lt({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:Lt({capturePerformance:e.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:u,minimumDurationMilliseconds:Ht(d)?null:d,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};a(),(t=this.We)==null||t.call(this),this.We=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(a)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.tr(e),void this.Xe()):(this.tr(e),void this.startIfEnabledOrStop()):(this.Ve===zC&&(this.Ve=eD,Wx.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.qe)!=null&&n.log?this.qe.log(e,t):Wx.warn("log called before recorder was ready")}get Ke(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Z2);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}ir(){var e,t=this._instance.get_property(Z2);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return Date.now()-n<=36e5}Je(e){var t,n;if((t=Fn.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");if(this.qe||(this.qe=(n=Fn.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.qe._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ir())return this.Ve===eD||this.Ve===zC?void 0:(this.Ve=zC,Wx.info("persisted remote config is stale, requesting fresh config before starting"),void new FSt(this._instance).load());this.Ve=oze,this.qe.start(e)}onRRwebEmit(e){var t;(t=this.qe)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.qe||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.qe)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.qe||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.qe)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.qe||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.qe)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.qe)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.qe)==null||!n.tryAddCustomEvent(e,t))}}},Lwr={autocapture:class{constructor(e){this.er=!1,this.rr=null,this.sr=!1,this.instance=e,this.rageclicks=new nze(e.config.rageclick),this.nr=null}initialize(){this.startIfEnabled()}get N(){var e,t,n=Ao(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}ar(){if(this.isBrowserSupported()){if(Ge&&Vt){var e=n=>{n=n||Ge?.event;try{this.lr(n)}catch(r){rze.error("Failed to capture event",r)}};if(ro(Vt,"submit",e,{capture:!0}),ro(Vt,"change",e,{capture:!0}),ro(Vt,"click",e,{capture:!0}),this.N.capture_copied_text){var t=n=>{n=n||Ge?.event,this.lr(n,see)};ro(Vt,"copy",t,{capture:!0}),ro(Vt,"cut",t,{capture:!0})}}}else rze.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.er&&(this.ar(),this.er=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.sr=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[EFe]:!!e.autocapture_opt_out}),this.rr=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.nr=e}getElementSelectors(e){var t,n=[];return(t=this.nr)==null||t.forEach((r=>{var a=Vt?.querySelectorAll(r);a?.forEach((s=>{e===s&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[EFe],r=this.rr;if(sh(r)&&!qg(n)&&!this.instance.bt())return!1;var a=(t=this.rr)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!a}lr(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=KFe(e);YSt(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&cwr(r,this.instance.config.rageclick)&&this.lr(e,"$rageclick");var a=t===see;if(r&&uwr(r,e,this.N,a,a?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:i}=bwr(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.sr});if(i)return!1;var o=this.getElementSelectors(r);if(o&&o.length>0&&(s.$element_selectors=o),t===see){var c,u=KSt(Ge==null||(c=Ge.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=d}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return Pg(Vt?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ur=(Ge==null||(t=Ge.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Gt.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.hr&&this.hr(),this.hr=void 0,Gt.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Ge&&Ge.history){var n=this;(e=Ge.history.pushState)!=null&&e.__posthog_wrapped__||aze(Ge.history,"pushState",(r=>function(a,s,i){r.call(this,a,s,i),n.dr("pushState")})),(t=Ge.history.replaceState)!=null&&t.__posthog_wrapped__||aze(Ge.history,"replaceState",(r=>function(a,s,i){r.call(this,a,s,i),n.dr("replaceState")})),this.vr()}}dr(e){try{var t,n=Ge==null||(t=Ge.location)==null?void 0:t.pathname;if(!n)return;n!==this.ur&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ur=n}catch(r){Gt.error("Error capturing "+e+" pageview",r)}}vr(){if(!this.hr){var e=()=>{this.dr("popstate")};ro(Ge,"popstate",e),this.hr=()=>{Ge&&Ge.removeEventListener("popstate",e)}}}},heatmaps:class{constructor(e){var t;this.cr=!1,this.er=!1,this.pr=null,this.instance=e,this.cr=!((t=this.instance.persistence)==null||!t.props[qse]),this.rageclicks=new nze(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Ao(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Jr(this.instance.config.capture_heatmaps)?Jr(this.instance.config.enable_heatmaps)?this.cr:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.er)return;wwr.info("starting..."),this._r(),this.gr()}else{var e;clearInterval((e=this.pr)!==null&&e!==void 0?e:void 0),this.mr(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[qse]:t}),this.cr=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}br(e){this.yr(e.originalEvent,"deadclick")}gr(){this.pr&&clearInterval(this.pr),this.pr=(function(e){return e?.visibilityState==="visible"})(Vt)?setInterval(this.Ft.bind(this),this.flushIntervalMilliseconds):null}_r(){Ge&&Vt&&(this.wr=this.Ft.bind(this),ro(Ge,"beforeunload",this.wr),this.Er=e=>this.yr(e||Ge?.event),ro(Vt,"click",this.Er,{capture:!0}),this.Sr=e=>this.$r(e||Ge?.event),ro(Vt,"mousemove",this.Sr,{capture:!0}),this.kr=new PFe(this.instance,j0r,this.br.bind(this)),this.kr.startIfEnabledOrStop(),this.Pr=this.gr.bind(this),ro(Vt,"visibilitychange",this.Pr),this.er=!0)}mr(){var e;Ge&&Vt&&(this.wr&&Ge.removeEventListener("beforeunload",this.wr),this.Er&&Vt.removeEventListener("click",this.Er,{capture:!0}),this.Sr&&Vt.removeEventListener("mousemove",this.Sr,{capture:!0}),this.Pr&&Vt.removeEventListener("visibilitychange",this.Pr),clearTimeout(this.Tr),(e=this.kr)==null||e.stop(),this.er=!1)}Rr(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),s=(function(i,o,c){for(var u=i;u&&d9(u)&&!lb(u,"body");){if(u===c)return!1;if(Vr(o,Ge?.getComputedStyle(u).position))return!0;u=e1t(u)}return!1})(KFe(e),["fixed","sticky"],a);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}yr(e,t){var n;if(t===void 0&&(t="click"),!YFe(e.target)&&lze(e)){var r=this.Rr(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Ir(Lt({},r,{type:"rageclick"})),this.Ir(r)}}$r(e){!YFe(e.target)&&lze(e)&&(clearTimeout(this.Tr),this.Tr=setTimeout((()=>{this.Ir(this.Rr(e,"mousemove"))}),500))}Ir(e){if(Ge){var t=Ge.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,a=n?Yk([],Xk,r||[]):[],s=xA(t,a,wA);this.C=this.C||{},this.C[s]||(this.C[s]=[]),this.C[s].push(e)}}Ft(){this.C&&!tO(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:PFe,webVitalsAutocapture:class{constructor(e){var t;this.cr=!1,this.er=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Cr=()=>{clearTimeout(this.Or),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce(((n,r)=>Lt({},n,{["$web_vitals_"+r.name+"_event"]:Lt({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Fr=n=>{var r,a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(Ht(a))yy.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Mr();Ht(s)||(Jr(n?.name)||Jr(n?.value)?yy.error("Invalid metric received",n):this.Ar&&n.value>=this.Ar?yy.error("Ignoring metric with value >= "+this.Ar,n):(this.C.url!==s&&(this.Cr(),this.Or=setTimeout(this.Cr,this.flushToCaptureTimeoutMs)),Ht(this.C.url)&&(this.C.url=s),this.C.firstMetricTimestamp=Ht(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.C.metrics.push(Lt({},n,{$current_url:s,$session_id:a.sessionId,$window_id:a.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Cr()))}},this.Dr=()=>{if(!this.er){var n,r,a,s,i=Fn.__PosthogExtensions__;Ht(i)||Ht(i.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:a,onINP:s}=i.postHogWebVitalsCallbacks),n&&r&&a&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Fr.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Fr.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&a(this.Fr.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Fr.bind(this)),this.er=!0):yy.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.cr=!((t=this._instance.persistence)==null||!t.props[TFe]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Ao(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return Jr(n)?((t=this._instance.persistence)==null?void 0:t.props[AFe])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Ao(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Ao(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Ar(){var e=Ao(this._instance.config.capture_performance)&&Om(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:sze;return 0<e&&e<=6e4?sze:e}get isEnabled(){var e=bl?.protocol;if(e!=="http:"&&e!=="https:")return yy.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Ao(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:qg(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return qg(t)?t:this.cr}startIfEnabled(){this.isEnabled&&!this.er&&(yy.info("enabled, starting..."),this.G(this.Dr))}onRemoteConfig(e){if("capturePerformance"in e){var t=Ao(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Ao(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[TFe]:t}),this._instance.persistence.register({[AFe]:n})),this.cr=t,this.startIfEnabled()}}G(e){var t,n;if((t=Fn.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=Fn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,(a=>{a?yy.error("failed to load script",a):e()}))}}Mr(){var e=Ge?Ge.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=t?Yk([],Xk,n||[]):[];return xA(e,r,wA)}yy.error("Could not determine current URL")}}},Fwr={exceptionObserver:class{constructor(e){var t,n,r;this.Dr=()=>{var a;if(Ge&&this.isEnabled&&(a=Fn.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var s=Fn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Fn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,o=Fn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Lr&&this.N.capture_unhandled_errors&&(this.Lr=s(this.captureException.bind(this))),!this.jr&&this.N.capture_unhandled_rejections&&(this.jr=i(this.captureException.bind(this))),!this.Nr&&this.N.capture_console_errors&&(this.Nr=o(this.captureException.bind(this)))}catch(c){FC.error("failed to start",c),this.Ur()}}},this._instance=e,this.zr=!((t=this._instance.persistence)==null||!t.props[CFe]),this.Hr=new Dxr({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:FC}),this.N=this.Br(),this.startIfEnabledOrStop()}Br(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ao(e)?t=Lt({},t,e):(Ht(e)?this.zr:e)&&(t=Lt({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(FC.info("enabled"),this.Ur(),this.G(this.Dr)):this.Ur()}G(e){var t,n;(t=Fn.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=Fn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return FC.error("failed to load script",r);e()}))}Ur(){var e,t,n;(e=this.Lr)==null||e.call(this),this.Lr=void 0,(t=this.jr)==null||t.call(this),this.jr=void 0,(n=this.Nr)==null||n.call(this),this.Nr=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.zr=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[CFe]:this.zr}),this.N=this.Br(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.Br()}captureException(e){var t,n,r,a=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.Hr.consumeRateLimit(a)?FC.info("Skipping exception capture because of client rate limiting.",{exception:a}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.qr=[],this.Vr=new Zxr([new a0r,new p0r,new i0r,new s0r,new d0r,new u0r,new l0r,new f0r],r0r()),this._instance=e,this.qr=(t=(n=this._instance.persistence)==null?void 0:n.get_property(Hse))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var a=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.qr=a,this._instance.persistence&&this._instance.persistence.register({[Hse]:this.qr,[jFe]:s})}}get Wr(){var e,t=!!this._instance.get_property(jFe),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Vr.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Gr(t)){if(this.Yr(t))return void cee.info("Skipping exception capture because a suppression rule matched");if(!this.Wr&&this.Jr(t))return void cee.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Kr(t))return void cee.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",Di:!0})}Yr(e){if(e.length===0)return!1;var t=e.reduce(((n,r)=>{var{type:a,value:s}=r;return oo(a)&&a.length>0&&n.$exception_types.push(a),oo(s)&&s.length>0&&n.$exception_values.push(s),n}),{$exception_types:[],$exception_values:[]});return this.qr.some((n=>{var r=n.values.map((a=>{var s,i=QSt[a.operator],o=Aa(a.value)?a.value:[a.value],c=(s=t[a.key])!==null&&s!==void 0?s:[];return o.length>0&&i(o,c)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}Jr(e){return e.flatMap((t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}Kr(e){if(e.length>0){var t,n,r,a,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],i=s[s.length-1];return(r=i==null||(a=i.filename)==null?void 0:a.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Gr(e){return!Jr(e)&&Aa(e)}}},zwr=Lt({productTours:class{constructor(e){this.Xr=null,this.Qr=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[NFe]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Xr||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(NFe)||this.G((()=>this.Zr()))}G(e){var t,n;(t=Fn.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=Fn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?cze.error("Could not load product tours script",r):e()}))}Zr(){var e;!this.Xr&&(e=Fn.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Xr=Fn.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Aa(this.Qr)||t){var n=this._instance.persistence;if(n){var r=n.props[oee];if(Aa(r)&&!t)return this.Qr=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:a=>{var s=a.statusCode;if(s!==200||!a.json){var i="Product Tours API could not be loaded, status: "+s;return cze.error(i),void e([],{isLoaded:!1,error:i})}var o=Aa(a.json.product_tours)?a.json.product_tours:[];this.Qr=o,n&&n.register({[oee]:o}),e(o,{isLoaded:!0})}})}else e(this.Qr,{isLoaded:!0})}getActiveProductTours(e){Jr(this.Xr)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Xr.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Xr)==null||t.showTourById(e)}previewTour(e){this.Xr?this.Xr.previewTour(e):this.G((()=>{var t;this.Zr(),(t=this.Xr)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Xr)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Xr)==null||e.nextStep()}previousStep(){var e;(e=this.Xr)==null||e.previousStep()}clearCache(){var e;this.Qr=null,(e=this._instance.persistence)==null||e.unregister(oee)}resetTour(e){var t;(t=this.Xr)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Xr)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Xr)==null||t.cancelPendingTour(e)}}},f9),Bwr={siteApps:class{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var n=this.globalsForEvent(t);this.ts.push(n),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return(e=Fn._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,n,r,a,s,i,o;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[f,p]of Object.entries(d))c[f]={id:u[f],type:f,properties:p};var{$set_once:h,$set:m}=e;return{event:Lt({},eSt(e,Swr),{properties:Lt({},e.properties,m?{$set:Lt({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},m)}:{},h?{$set_once:Lt({},(r=(a=e.properties)==null?void 0:a.$set_once)!==null&&r!==void 0?r:{},h)}:{}),elements_chain:(s=(i=e.properties)==null?void 0:i.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(o=e.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var i;!t.errored&&this.ts.length&&(by.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach((o=>t.processEvent==null?void 0:t.processEvent(o))),t.processedBuffer=!0),Object.values(this.apps).every((o=>o.processedBuffer||o.errored))&&((i=this.rs)==null||i.call(this))},r=!1,a=i=>{t.errored=!i,t.loaded=!0,by.info("Site app with id "+e.id+" "+(i?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:i=>{a(i)}});s&&(t.processEvent=s),r=!0}catch(i){by.error("Error while initializing PostHog app with config id "+e.id,i),a(!1)}if(r&&t.loaded)try{n()}catch(i){by.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ss(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ns(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){by.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,a=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",(c=>this.ns(c)))):void by.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.rs)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(c){var u;Fn["__$$ph_site_app_"+c]=a._instance,(u=Fn.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(a._instance,o,(d=>{if(d)return by.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:i,url:o}of e.siteApps)s(i)}else by.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Uwr={tracingHeaders:class{constructor(e){this.os=void 0,this.ls=void 0,this.Dr=()=>{var t,n;Ht(this.os)&&((t=Fn.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Ht(this.ls)&&((n=Fn.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}G(e){var t,n;(t=Fn.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=Fn.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return xwr.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.G(this.Dr):((e=this.os)==null||e.call(this),(t=this.ls)==null||t.call(this),this.os=void 0,this.ls=void 0)}}},Vwr=Lt({surveys:class{constructor(e){this.us=void 0,this._surveyManager=null,this.hs=!1,this.ds=[],this.vs=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(Jr(t))return hs.warn("Flags not loaded yet. Not loading surveys.");var n=Aa(t);this.us=n?t.length>0:t,hs.info("flags response received, isSurveysEnabled: "+this.us),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(WSt)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.hs)hs.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)hs.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())hs.info("Not loading surveys in cookieless mode without consent.");else{var e=Fn?.__PosthogExtensions__;if(e){if(!Ht(this.us)||this._instance.config.advanced_enable_surveys){var t=this.us||this._instance.config.advanced_enable_surveys;this.hs=!0;try{var n=e.generateSurveys;if(n)return void this.cs(n,t);var r=e.loadExternalDependency;if(!r)return void this.fs("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(a=>{a||!e.generateSurveys?this.fs("Could not load surveys script",a):this.cs(e.generateSurveys,t)}))}catch(a){throw this.fs("Error initializing surveys",a),a}finally{this.hs=!1}}}else hs.error("PostHog Extensions not found.")}}cs(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new _wr(this._instance),hs.info("Surveys loaded successfully"),this.ps({isLoaded:!0})}fs(e,t){hs.error(e,t),this.ps({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ds.push(e),this._surveyManager&&this.ps({isLoaded:!0}),()=>{this.ds=this.ds.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return hs.info("Disabled. Not loading surveys."),e([]);var n,r=this._instance.get_property(Gse);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.vs?this.vs.then((a=>{var{surveys:s,context:i}=a;return e(s,i)})):(typeof Promise<"u"&&(this.vs=new Promise((a=>{n=a}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:a=>{var s;this.vs=null;var i=a.statusCode;if(i!==200||!a.json){var o="Surveys API could not be loaded, status: "+i;hs.error(o);var c={isLoaded:!1,error:o};return e([],c),void(n==null||n({surveys:[],context:c}))}var u,d=a.json.surveys||[],f=d.filter((h=>(function(m){return!(!m.start_date||m.end_date)})(h)&&((function(m){var g;return!((g=m.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(h)||(function(m){var g;return!((g=m.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(h))));f.length>0&&((u=this._surveyEventReceiver)==null||u.register(f)),(s=this._instance.persistence)==null||s.register({[Gse]:d});var p={isLoaded:!0};e(d,p),n?.({surveys:d,context:p})}}))}ps(e){for(var t of this.ds)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){hs.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!Jr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);hs.warn("init was not called")}_s(e){var t=null;return this.getSurveys((n=>{var r;t=(r=n.find((a=>a.id===e)))!==null&&r!==void 0?r:null})),t}gs(e){if(Jr(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this._s(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Jr(this._surveyManager))return hs.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gs(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Jr(this._surveyManager)?(hs.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((n=>{this.getSurveys((r=>{var a,s=(a=r.find((o=>o.id===e)))!==null&&a!==void 0?a:null;if(s){var i=this.gs(s);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,n){var r;if(Jr(this._surveyManager))hs.warn("init was not called");else{var a=typeof e=="string"?this._s(e):e;if(a!=null&&a.id)if(nwr.includes(a.type)){var s=Vt?.querySelector(t);if(s)return(r=a.appearance)!=null&&r.surveyPopupDelaySeconds?(hs.info("Rendering survey "+a.id+" with delay of "+a.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var i,o;hs.info("Rendering survey "+a.id+" with delay of "+((i=a.appearance)==null?void 0:i.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(a,s,n),hs.info("Survey "+a.id+" rendered")}),1e3*a.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(a,s,n);hs.warn("Survey element not found")}else hs.warn("Surveys of type "+a.type+" cannot be rendered in the app");else hs.warn("Survey not found")}}displaySurvey(e,t){var n;if(Jr(this._surveyManager))hs.warn("init was not called");else{var r=this._s(e);if(r){var a=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(a=Lt({},r,{appearance:Lt({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==eie.Popover&&t.initialResponses&&hs.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var s=this.canRenderSurvey(r);if(!s.visible)return void hs.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==eie.Inline?this._surveyManager.handlePopoverSurvey(a,t):this.renderSurvey(a,t.selector,t.properties)}else hs.warn("Survey not found")}}cancelPendingSurvey(e){Jr(this._surveyManager)?hs.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},f9),qwr={toolbar:class{constructor(e){this.instance=e}bs(e){Fn.ph_toolbar_state=e}ys(){var e;return(e=Fn.ph_toolbar_state)!==null&&e!==void 0?e:Oy.UNINITIALIZED}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),kSt(this.instance.config)||!Ge||!Vt)return!1;e=e??Ge.location,n=n??Ge.history;try{if(!t){try{Ge.localStorage.setItem("test","test"),Ge.localStorage.removeItem("test")}catch{return!1}t=Ge?.localStorage}var r,a=Ewr||wL(e.hash,"__posthog")||wL(e.hash,"state"),s=a?_Fe((()=>JSON.parse(atob(decodeURIComponent(a)))))||_Fe((()=>JSON.parse(decodeURIComponent(a)))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(uze)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}ws(e){var t=Fn.ph_load_toolbar||Fn.ph_load_editor;!Jr(t)&&Pg(t)?t(e,this.instance):dze.warn("No toolbar load function found")}loadToolbar(e){var t=!(Vt==null||!Vt.getElementById(jSt));if(!Ge||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Lt({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Ge.localStorage.setItem(uze,JSON.stringify(Lt({},r,{source:void 0}))),this.ys()===Oy.LOADED)this.ws(r);else if(this.ys()===Oy.UNINITIALIZED){var a;this.bs(Oy.LOADING),(a=Fn.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return dze.error("[Toolbar] Failed to load",s),void this.bs(Oy.UNINITIALIZED);this.bs(Oy.LOADED),this.ws(r)})),ro(Ge,"turbolinks:load",(()=>{this.bs(Oy.UNINITIALIZED),this.loadToolbar(r)}))}return!0}Es(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},Hwr=Lt({experiments:Ll},f9),Qwr={conversations:class{constructor(e){this.Ss=void 0,this._conversationsManager=null,this.xs=!1,this.$s=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Jr(t)||(qg(t)?this.Ss=t:(this.Ss=t.enabled,this.$s=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ss=void 0,this.$s=null}loadIfEnabled(){if(!(this._conversationsManager||this.xs||this._instance.config.disable_conversations||kSt(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=Fn?.__PosthogExtensions__;if(e&&!Ht(this.Ss)&&this.Ss)if(this.$s&&this.$s.token){this.xs=!0;try{var t=e.initConversations;if(t)return this.ks(t),void(this.xs=!1);var n=e.loadExternalDependency;if(!n)return void this.Ps("PostHog loadExternalDependency extension not found.");n(this._instance,"conversations",(r=>{r||!e.initConversations?this.Ps("Could not load conversations script",r):this.ks(e.initConversations),this.xs=!1}))}catch(r){this.Ps("Error initializing conversations",r),this.xs=!1}}else uf.error("Conversations enabled but missing token in remote config.")}}ks(e){if(this.$s)try{this._conversationsManager=e(this.$s,this._instance),uf.info("Conversations loaded successfully")}catch(t){this.Ps("Error completing conversations initialization",t)}else uf.error("Cannot complete initialization: remote config is null")}Ps(e,t){uf.error(e,t),this._conversationsManager=null,this.xs=!1}show(){this._conversationsManager?this._conversationsManager.show():uf.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ss===!0&&!sh(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return bg((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(uf.warn("Conversations not available yet."),null)}))()}getMessages(e,t){var n=this;return bg((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(uf.warn("Conversations not available yet."),null)}))()}markAsRead(e){var t=this;return bg((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(uf.warn("Conversations not available yet."),null)}))()}getTickets(e){var t=this;return bg((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(uf.warn("Conversations not available yet."),null)}))()}requestRestoreLink(e){var t=this;return bg((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(uf.warn("Conversations not available yet."),null)}))()}restoreFromToken(e){var t=this;return bg((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(uf.warn("Conversations not available yet."),null)}))()}restoreFromUrlToken(){var e=this;return bg((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(uf.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}}},Gwr={logs:class{constructor(e){var t;this.Ts=!1,this.Rs=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.Ts=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!Jr(n)&&n&&(this.Ts=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ts&&!this.Rs){var e=bi("[logs]"),t=Fn?.__PosthogExtensions__;if(t){var n=t.loadExternalDependency;n?n(this._instance,"logs",(r=>{var a;r||(a=t.logs)==null||!a.initializeLogs?e.error("Could not load logs script",r):(t.logs.initializeLogs(this._instance),this.Rs=!0)})):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}},Wwr=Lt({},f9,$wr,Lwr,Fwr,zwr,Bwr,Vwr,Uwr,qwr,Hwr,Qwr,Gwr);Vh.__defaultExtensionClasses=Lt({},Wwr);var mze,jg=(mze=aT[M1]=new Vh,(function(){function e(){e.done||(e.done=!0,ZSt=!1,Is(aT,(function(t){t._dom_loaded()})))}Vt!=null&&Vt.addEventListener?Vt.readyState==="complete"?e():ro(Vt,"DOMContentLoaded",e,{capture:!1}):Ge&&Gt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),mze),o1t=x.createContext({client:jg,bootstrap:void 0});function l1t(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var s=0,i=r;s<i.length;s++){var o=i[s];if(!a.includes(o)||!l1t(e[o],t[o],n))return!1}return!0}function Zwr(e){var t,n,r=e.children,a=e.client,s=e.apiKey,i=e.options,o=x.useRef(null),c=x.useMemo(function(){return a?(s&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),i&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),a):(s||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),jg)},[a,s,JSON.stringify(i)]);return x.useEffect(function(){if(!a){var u=o.current;u?(s!==u.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),i&&!l1t(i,u.options)&&jg.set_config(i),o.current={apiKey:s,options:i??{}}):(jg.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),jg.init(s,i),o.current={apiKey:s,options:i??{}})}},[a,s,JSON.stringify(i)]),Oe.createElement(o1t.Provider,{value:{client:c,bootstrap:(t=i?.bootstrap)!==null&&t!==void 0?t:(n=a?.config)===null||n===void 0?void 0:n.bootstrap}},r)}var uee=function(e){return typeof e=="function"},lie=function(e,t){return lie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},lie(e,t)};function Ywr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");lie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Xwr={componentStack:null,exceptionEvent:null,error:null},Kwr={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){Ywr(t,e);function t(n){var r=e.call(this,n)||this;return r.state=Xwr,r}return t.prototype.componentDidCatch=function(n,r){var a=this.props.additionalProperties,s;uee(a)?s=a(n):typeof a=="object"&&(s=a);var i=this.context.client,o=i.captureException(n,s),c=r.componentStack;this.setState({error:n,componentStack:c??null,exceptionEvent:o})},t.prototype.render=function(){var n=this.props,r=n.children,a=n.fallback,s=this.state;if(s.componentStack==null)return uee(r)?r():r;var i=uee(a)?Oe.createElement(a,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):a;return Oe.isValidElement(i)?i:(console.warn(Kwr.INVALID_FALLBACK),Oe.createElement(Oe.Fragment,null))},t.contextType=o1t,t})(Oe.Component);function Jwr({children:e}){return x.useEffect(()=>{if("brave"in navigator){console.info("[Analytics]: Telemetry is disabled for browser constraints.");return}if(window.MASTRA_TELEMETRY_DISABLED){console.info("[Analytics]: Telemetry is disabled.");return}jg.init("phc_SBLpZVAB6jmHOct9CABq3PF0Yn5FU3G2FgT4xUr2XrT",{api_host:"https://us.posthog.com"}),jg.register({mastraSource:"playground"})},[]),l.jsx(Zwr,{client:jg,children:e})}const eSr=["/swagger-ui","/openapi.json"],c1t=x.forwardRef(({children:e,href:t,...n},r)=>t&&eSr.some(s=>t.startsWith(s))?l.jsx("a",{ref:r,href:t,...n,children:e}):l.jsx(Ft,{ref:r,to:t,viewTransition:!0,...n,children:e})),u1t="experimental-ui:",d1t="current",Zge=Oe.createContext(null);function Mv(e){const t=Oe.useContext(Zge);if(!t)throw new Error("useExperimentalUI must be used within an ExperimentalUIProvider.");return{variant:t.getVariant(e),setVariant:n=>t.setVariant(e,n)}}function tSr(){return Oe.useContext(Zge)}function nSr(e,t){const n=window.localStorage.getItem(u1t+e);return n&&t.has(n)?n:d1t}function rSr({experiments:e,children:t}){const n=Oe.useMemo(()=>new Map(e.map(c=>[c.key,new Set(c.variants.map(u=>u.value))])),[e]),[r,a]=Oe.useState({});Oe.useLayoutEffect(()=>{const c={};for(const u of e){const d=n.get(u.key);c[u.key]=nSr(u.key,d)}a(c)},[e,n]);const s=Oe.useCallback(c=>r[c]??d1t,[r]),i=Oe.useCallback((c,u)=>{window.localStorage.setItem(u1t+c,u),a(d=>({...d,[c]:u}))},[]),o=Oe.useMemo(()=>({experiments:e,getVariant:s,setVariant:i}),[e,s,i]);return l.jsx(Zge.Provider,{value:o,children:t})}function aSr(){const{data:e={},isLoading:t,error:n}=rh(),{variant:r}=Mv("entity-list-page"),[a,s]=x.useState(""),{canCreateAgent:i}=nge(),{Link:o,paths:c}=Nt(),u=c.cmsAgentCreateLink(),d=i&&!!u;return r==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:t,children:[l.jsx($s,{})," Agents"]})}),l.jsxs(ht.Column,{className:"flex justify-end gap-2",children:[d&&l.jsx(hi,{as:o,to:u,tooltipContent:"Create an agent",children:l.jsx(KO,{})}),l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/agents/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Agents documentation",children:l.jsx(Xl,{})})]})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:s,label:"Filter agents",placeholder:"Filter by name or instructions"})})]}),l.jsx(Rfr,{agents:e,isLoading:t,error:n,search:a})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx($s,{})}),"Agents"]}),l.jsxs(Xa,{children:[d&&l.jsxs(he,{variant:"light",as:o,to:u,children:[l.jsx(xe,{children:l.jsx(KO,{})}),"Create an agent"]}),l.jsxs(he,{variant:"ghost",size:"md",as:Ft,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",children:[l.jsx(fi,{}),"Agents documentation"]})]})]}),l.jsx(gi,{isCentered:!t&&Object.keys(e||{}).length===0,children:l.jsx(cir,{agents:e,isLoading:t,error:n})})]})}function sSr({agentId:e,threadId:t,threads:n,isLoading:r}){const{mutateAsync:a}=Fsr(),{paths:s,navigate:i}=Nt(),o=async c=>{await a({threadId:c,agentId:e}),c===t&&i(s.agentNewThreadLink(e))};return l.jsx(tlr,{resourceId:e,resourceType:"agent",threads:n||[],isLoading:r,threadId:t,onDelete:o})}function gze(){const{agentId:e,threadId:t}=fs(),[n]=ll(),{data:r,isLoading:a,error:s}=qd(e),{data:i}=q_(e),o=qc(),c=t==="new",u=x.useMemo(()=>Hi(),[t]),d=!!i?.result,{data:f,isLoading:p,refetch:h}=Mbt({agentId:e,isMemoryEnabled:d,resourceId:e});x.useEffect(()=>{t||o(`/agents/${e}/chat/new`)},[t,e,o]);const m=n.get("messageId")??void 0,g=x.useMemo(()=>{if(!r)return{modelSettings:{}};const S=r.defaultOptions,{maxOutputTokens:O,...k}=S?.modelSettings??{};return{modelSettings:{...k,...O!==void 0&&{maxTokens:O},...S?.maxSteps!==void 0&&{maxSteps:S.maxSteps},...S?.providerOptions!==void 0&&{providerOptions:S.providerOptions}}}},[r]);if(s&&ra(s))return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"agents"})});if(a)return null;if(!r)return l.jsx("div",{className:"text-center py-4",children:"Agent not found"});if(!t)return null;const v=c?u:t,b=async()=>{await h(),c&&o(`/agents/${e}/chat/${u}`)};return l.jsx(qme,{entityId:e,entityType:"agent",children:l.jsx(Tme,{agentId:e,defaultSettings:g,children:l.jsx(Ebt,{agentId:e,threadId:v,resourceId:e,children:l.jsx(wbt,{children:l.jsx(Tbt,{children:l.jsx(dbt,{children:l.jsx(_lr,{agentId:e,leftSlot:d&&l.jsx(sSr,{agentId:e,threadId:v,threads:f||[],isLoading:p}),rightSlot:l.jsx(Slr,{agentId:e,threadId:v}),children:l.jsx(tge,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,threadId:v,memory:d,refreshThreadList:b,modelList:r?.modelList,messageId:m,isNewThread:c},v)})},`${e}-${v}`)})})})})})}const tD="__custom__",iSr=()=>{const e=obt(),{requestContext:t,setRequestContext:n}=Fr(),r=x.useMemo(()=>{if(!e)return tD;const s=JSON.stringify(t??{});for(const[i,o]of Object.entries(e))if(JSON.stringify(o)===s)return i;return tD},[e,t]),a=s=>{if(s===tD){n({});return}if(!e)return;const i=e[s];i&&n(i)};return l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(ib,{className:"h-5 w-8 shrink-0"}),"Mastra Studio",l.jsx(Ase,{})]}),e&&Object.keys(e).length>0&&l.jsx(Xa,{children:l.jsxs(Zs,{value:r,onValueChange:a,children:[l.jsx(Rs,{size:"sm",className:"w-[200px]",children:l.jsx(Ys,{placeholder:"Select a preset..."})}),l.jsxs(Ps,{children:[l.jsx(Qr,{value:tD,children:"Custom"}),Object.keys(e).map(s=>l.jsx(Qr,{value:s,children:s},s))]})]})})]})};function vze(){const{agentId:e,threadId:t}=fs(),[n]=ll(),{data:r,isLoading:a}=qd(e),{data:s}=q_(e),i=qc(),o=t==="new",c=x.useMemo(()=>Hi(),[t]),u=!!s?.result,{refetch:d}=Mbt({resourceId:e,agentId:e,isMemoryEnabled:u});x.useEffect(()=>{u&&(t||i(`/agents/${e}/session/new`))},[u,t,e,i]);const f=n.get("messageId")??void 0,p=x.useMemo(()=>{if(!r)return{modelSettings:{}};const g=r.defaultOptions,{maxOutputTokens:v,...b}=g?.modelSettings??{};return{modelSettings:{...b,...v!==void 0&&{maxTokens:v},...g?.maxSteps!==void 0&&{maxSteps:g.maxSteps},...g?.providerOptions!==void 0&&{providerOptions:g.providerOptions}}}},[r]);if(a)return null;if(!r)return l.jsx("div",{className:"text-center py-4",children:"Agent not found"});const h=o?c:t??c,m=async()=>{await d(),o&&i(`/agents/${e}/session/${c}`)};return l.jsx(qme,{entityId:e,entityType:"agent",children:l.jsx(Tme,{agentId:e,defaultSettings:p,children:l.jsx(Lz,{children:l.jsx(Ebt,{agentId:e,threadId:h,resourceId:e,children:l.jsx(wbt,{children:l.jsx(Tbt,{children:l.jsx(dbt,{children:l.jsxs(xn,{children:[l.jsx(iSr,{}),l.jsx("div",{className:"grid overflow-y-auto relative bg-surface1 h-full pt-6",children:l.jsx(tge,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,threadId:h,memory:u,refreshThreadList:m,modelList:r?.modelList,messageId:f,isNewThread:o,hideModelSwitcher:!0},h)})]})})})})})})})})}function oSr(){const{agentId:e}=fs(),{navigate:t}=Nt(),{data:n,isLoading:r,error:a}=qd(e),{data:s,isLoading:i}=oge(e,{status:"draft"}),o=n?.source==="code",c=r||i,u=x.useMemo(()=>s||(n?pge(n):{}),[s,n]),{form:d,handlePublish:f,handleSaveDraft:p,isSubmitting:h,isSavingDraft:m}=n9({mode:"edit",agentId:e??"",dataSource:u,isCodeAgentOverride:o,hasStoredOverride:o&&!!s,onSuccess:()=>{}}),[g,v]=x.useState(()=>{const b=sessionStorage.getItem(`pending-scorer-items-${e}`);if(b){sessionStorage.removeItem(`pending-scorer-items-${e}`);try{return JSON.parse(b)}catch{return null}}return null});return a&&ra(a)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"agents"})}):c?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Jt,{className:"h-6 w-6"})}):n?l.jsx(Jme,{form:d,mode:"edit",agentId:e,isSubmitting:h,isSavingDraft:m,handlePublish:f,handleSaveDraft:p,isCodeAgentOverride:o,readOnly:!1,children:l.jsx(cfr,{agentId:e,onSwitchToReview:()=>t(`/agents/${e}/review`),pendingScorerItems:g,onPendingScorerItemsConsumed:()=>v(null)})}):l.jsx("div",{className:"text-center py-4",children:"Agent not found"})}function lSr(){const{agentId:e}=fs(),[t,n]=x.useState(null),{data:r,isLoading:a,error:s}=qd(e),{data:i,isLoading:o}=oge(e,{status:"draft"}),{data:c}=q_(e),u=r?.source==="code",d=a||o,f=!!c?.result,{data:p}=yxt({agentId:e??"",versionId:t??""}),{data:h}=gS({agentId:e??"",params:{sortDirection:"DESC"}}),m=i?.activeVersionId,g=h?.versions?.[0],v=!!(g&&g.id!==m),b=!!t&&!!p,S=b&&t!==g?.id,O=x.useMemo(()=>b&&p?p:i||(r?pge(r):{}),[b,p,i,r]),{form:k,handlePublish:E,handleSaveDraft:C,isSubmitting:T,isSavingDraft:j,isDirty:A}=n9({mode:"edit",agentId:e??"",dataSource:O,isCodeAgentOverride:u,hasStoredOverride:u&&!!i,onSuccess:()=>{}}),I=x.useCallback(P=>{P===g?.id?n(null):n(P)},[g?.id]);return s&&ra(s)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"agents"})}):d?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Jt,{className:"h-6 w-6"})}):r?l.jsx(Jme,{form:k,mode:"edit",agentId:e,isSubmitting:T,isSavingDraft:j,handlePublish:E,handleSaveDraft:C,isCodeAgentOverride:u,readOnly:S,children:l.jsx(ddr,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,hasMemory:f,activeVersionId:m,selectedVersionId:t??void 0,latestVersionId:g?.id,onVersionSelect:I,isDirty:A,isSavingDraft:j,isPublishing:T,hasDraft:v,readOnly:S,onSaveDraft:C,onPublish:E})}):l.jsx("div",{className:"text-center py-4",children:"Agent not found"})}function cSr(){const{agentId:e}=fs(),{navigate:t}=Nt(),{data:n,isLoading:r,error:a}=qd(e);if(a&&ra(a))return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"agents"})});if(r)return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Jt,{className:"h-6 w-6"})});if(!n)return l.jsx("div",{className:"text-center py-4",children:"Agent not found"});const s=i=>{sessionStorage.setItem(`pending-scorer-items-${e}`,JSON.stringify(i)),t(`/agents/${e}/evaluate`)};return l.jsx(mfr,{agentId:e,onCreateScorer:s})}function uSr(){const{agentId:e}=fs();return l.jsx(Afr,{agentId:e})}function dSr(){return l.jsx(Jcr,{})}function fSr(){const{navigate:e,paths:t}=Nt(),n=lc(),{form:r,handlePublish:a,isSubmitting:s,canPublish:i}=n9({mode:"create",onSuccess:o=>e(t.agentLink(o))});return l.jsxs(xn,{children:[l.jsxs($n,{className:"bg-surface1",children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx($s,{})}),"Create an agent"]}),l.jsx(Xa,{children:l.jsx(he,{variant:"primary",onClick:a,disabled:s||!i,className:"w-full",children:s?l.jsxs(l.Fragment,{children:[l.jsx(Jt,{className:"h-4 w-4"}),"Creating..."]}):l.jsxs(l.Fragment,{children:[l.jsx(xe,{children:l.jsx(aQe,{})}),"Create agent"]})})})]}),l.jsx(E0t,{form:r,mode:"create",isSubmitting:s,handlePublish:a,basePath:"/cms/agents/create",currentPath:n.pathname,children:l.jsx(Qk,{})})]})}function yze({agentId:e,selectedVersionId:t,versionData:n,readOnly:r=!1,form:a,handlePublish:s,handleSaveDraft:i,isSubmitting:o,isSavingDraft:c,onVersionSelect:u,activeVersionId:d,latestVersionId:f,hideVersionPanel:p=!1,isCodeAgentOverride:h=!1}){const[,m]=ll(),g=lc(),S=!!t&&!!n&&t!==f?l.jsxs(Pf,{variant:"info",className:"mb-4",children:[l.jsx(Mf,{children:"This is a previous version"}),l.jsx(cv,{as:"p",children:"You are seeing a specific version of the agent."}),l.jsx("div",{className:"pt-2",children:l.jsx(he,{type:"button",variant:"light",size:"sm",onClick:()=>m({}),children:"View latest version"})})]}):void 0,O=p?void 0:l.jsx(Xur,{agentId:e,selectedVersionId:t??void 0,onVersionSelect:u,activeVersionId:d});return l.jsx(E0t,{form:a,mode:"edit",agentId:e,isSubmitting:o,isSavingDraft:c,handlePublish:s,handleSaveDraft:i,readOnly:r,isCodeAgentOverride:h,basePath:`/cms/agents/${e}/edit`,currentPath:g.pathname,banner:S,versionId:t??void 0,rightPanel:O,children:l.jsx(Qk,{})})}function pSr(){const{agentId:e}=fs(),{navigate:t,paths:n}=Nt(),r=qc(),a=lc(),[s,i]=ll(),o=s.get("versionId"),{data:c,isLoading:u}=qd(e),{data:d,isLoading:f}=oge(e,{status:"draft"}),p=c?.source==="code",h=d??null,m=u||f,g=`/cms/agents/${e}/edit`,v=a.pathname===g||a.pathname===`${g}/`;x.useEffect(()=>{p&&v&&r(`${g}/instruction-blocks${a.search}${a.hash}`,{replace:!0})},[p,v,r,g,a.search,a.hash]);const{data:b}=yxt({agentId:e??"",versionId:o??""}),{data:S}=gS({agentId:e??"",params:{sortDirection:"DESC"}}),O=h?.activeVersionId,k=S?.versions?.[0],E=!!(k&&k.id!==O),C=!!o&&!!b,T=x.useMemo(()=>C&&b?b:h||(c?pge(c):{}),[C,b,h,c]),j=h?.name??c?.name,{form:A,handlePublish:I,handleSaveDraft:P,isSubmitting:M,isSavingDraft:B,isDirty:D}=n9({mode:"edit",agentId:e??"",dataSource:T,isCodeAgentOverride:p,hasStoredOverride:p&&!!d,onSuccess:H=>t(n.agentLink(H))}),V=x.useCallback(H=>{i(H?{versionId:H}:{})},[i]),q=!m&&!h&&!c,z=!m&&!!e&&(!!h||!!c);return l.jsxs(xn,{children:[l.jsxs($n,{className:"bg-surface1",children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx($s,{})}),m&&l.jsx(In,{className:"h-6 w-[200px]"}),q&&"Agent not found",z&&`Edit agent: ${j}`,z&&E&&l.jsx(ut,{variant:"info",children:"Unpublished changes"})]}),z&&l.jsxs(Xa,{children:[l.jsx(he,{onClick:P,disabled:!D||B||M,children:B?l.jsxs(l.Fragment,{children:[l.jsx(Jt,{className:"h-4 w-4"}),"Saving..."]}):l.jsxs(l.Fragment,{children:[l.jsx(X4t,{}),"Save"]})}),l.jsx(he,{variant:"primary",onClick:I,disabled:!E&&!D||M||B,children:M?l.jsxs(l.Fragment,{children:[l.jsx(Jt,{className:"h-4 w-4"}),"Publishing..."]}):l.jsxs(l.Fragment,{children:[l.jsx(aQe,{}),"Publish"]})})]})]}),q?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Agent not found"}),l.jsx("div",{className:"hidden",children:l.jsx(yze,{agentId:e??"",selectedVersionId:o,versionData:b,readOnly:!0,form:A,handlePublish:I,handleSaveDraft:P,isSubmitting:M,isSavingDraft:B,onVersionSelect:V,activeVersionId:O,latestVersionId:k?.id})})]}):l.jsx(yze,{agentId:e??"",selectedVersionId:o,versionData:b,form:A,handlePublish:I,handleSaveDraft:P,isSubmitting:M,isSavingDraft:B,onVersionSelect:V,activeVersionId:O,latestVersionId:k?.id,hideVersionPanel:p&&!d,isCodeAgentOverride:p})]})}function hSr(){return l.jsx(Dcr,{})}function mSr(){return l.jsx(Yxt,{})}function gSr(){return l.jsx(rur,{})}function vSr(){return l.jsx(eur,{})}function ySr(){return l.jsx(Bur,{})}function bSr(){return l.jsx(Jxt,{})}function xSr(){return l.jsx(dur,{})}function wSr(){return l.jsx(nur,{})}function SSr(){const{navigate:e,paths:t}=Nt();return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Xl,{})}),"Create a prompt block"]})}),l.jsx(ecr,{onSuccess:n=>e(t.cmsPromptBlockEditLink(n.id))})]})}function bze(e){return{name:e.name,description:e.description||void 0,content:e.content,rules:e.rules||void 0,requestContextSchema:e.variables||void 0}}function OSr({block:e,blockId:t,selectedVersionId:n,hasDraft:r}){const a=We(),s=es(),{navigate:i,paths:o}=Nt(),{updateStoredPromptBlock:c}=Yz(t),[u,d]=x.useState(!1),[f,p]=x.useState(!1),{data:h}=icr({blockId:t,versionId:n??""}),m=!!n&&!!h,g=m?h:e,v=x.useMemo(()=>({name:g.name||"",description:g.description||"",content:g.content||"",rules:g.rules,variables:g.requestContextSchema}),[g]),{form:b}=Pxt({initialValues:v}),[S,O]=x.useState(0);x.useEffect(()=>{v&&!b.formState.isDirty&&(b.reset(v),O(C=>C+1))},[v,b]);const k=x.useCallback(async()=>{if(!await b.trigger()){De.error("Please fill in all required fields");return}p(!0);try{const T=bze(b.getValues());await c.mutateAsync(T),b.reset(b.getValues()),De.success("Draft saved")}catch(T){De.error(`Failed to save draft: ${T instanceof Error?T.message:"Unknown error"}`)}finally{p(!1)}},[b,c]),E=x.useCallback(async()=>{if(!await b.trigger()){De.error("Please fill in all required fields");return}d(!0);try{const T=bze(b.getValues());await c.mutateAsync(T);const A=(await a.getStoredPromptBlock(t).listVersions({sortDirection:"DESC",perPage:1})).versions[0];if(!A)throw new Error("No version found to publish");await a.getStoredPromptBlock(t).activateVersion(A.id),s.invalidateQueries({queryKey:["stored-prompt-blocks"]}),s.invalidateQueries({queryKey:["stored-prompt-block"]}),s.invalidateQueries({queryKey:["prompt-block-versions",t]}),De.success("Prompt block published"),i(o.promptBlocksLink())}catch(T){De.error(`Failed to publish: ${T instanceof Error?T.message:"Unknown error"}`)}finally{d(!1)}},[b,c,a,t,i,o,s]);return l.jsxs(Pb,{leftSlot:l.jsx(Rxt,{form:b,onPublish:E,onSaveDraft:k,isSubmitting:u,isSavingDraft:f,isDirty:b.formState.isDirty,hasDraft:r,formResetKey:S,mode:"edit",blockId:t}),children:[m&&l.jsxs(Pf,{variant:"info",className:"m-4 mb-0",children:[l.jsx(Mf,{children:"This is a previous version"}),l.jsx(cv,{as:"p",children:"You are seeing a specific version of the prompt block."})]}),l.jsx("form",{className:"h-full",children:l.jsx(Sxt,{form:b})})]})}function kSr(){const{promptBlockId:e}=fs(),[t,n]=ll(),r=t.get("versionId"),{data:a,isLoading:s}=wxt(e,{status:"draft"}),{data:i}=Mxt({blockId:e??"",params:{sortDirection:"DESC"}}),o=a?.activeVersionId,c=i?.versions?.[0],u=!!(c&&(!o||c.id!==o)),d=x.useCallback(f=>{n(f?{versionId:f}:{})},[n]);return s?l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Xl,{})}),l.jsx(In,{className:"h-6 w-[200px]"})]})}),l.jsx(Pb,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Jt,{className:"h-8 w-8"})}),children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Jt,{className:"h-8 w-8"})})})]}):!a||!e?l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Xl,{})}),"Prompt block not found"]})}),l.jsx(Pb,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Prompt block not found"}),children:l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Prompt block not found"})})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Xl,{})}),"Edit prompt block: ",a.name,u&&l.jsx(ut,{variant:"info",children:"Unpublished changes"})]}),l.jsx(Xa,{children:l.jsx(lcr,{blockId:e,value:r??"",onValueChange:d,activeVersionId:o})})]}),l.jsx(OSr,{block:a,blockId:e,selectedVersionId:r,hasDraft:u})]})}function _Sr(){const{navigate:e,paths:t}=Nt();return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(nm,{})}),"Create a scorer"]})}),l.jsx(Lor,{onSuccess:n=>e(t.scorerLink(n.id))})]})}function xze(e){return{name:e.name,description:e.description||void 0,type:e.type,model:e.model,instructions:e.instructions||void 0,scoreRange:e.scoreRange,defaultSampling:e.defaultSampling?.type==="ratio"&&typeof e.defaultSampling.rate=="number"?e.defaultSampling:{type:"none"}}}function ESr({scorer:e,scorerId:t,selectedVersionId:n}){const r=We(),a=es(),{navigate:s,paths:i}=Nt(),{updateStoredScorer:o}=sge(t),[c,u]=x.useState(!1),[d,f]=x.useState(!1),p=x.useRef(null),{data:h}=zor({scorerId:t,versionId:n??""}),m=!!n&&!!h,g=m?h:e,v=x.useMemo(()=>({name:g.name||"",description:g.description||"",type:"llm-judge",model:{provider:g.model?.provider||"",name:g.model?.name||""},instructions:g.instructions||"",scoreRange:{min:g.scoreRange?.min??0,max:g.scoreRange?.max??1},defaultSampling:g.defaultSampling}),[g]),{form:b}=axt({initialValues:v});x.useEffect(()=>{v&&b.reset(v)},[v,b]);const S=x.useCallback(async()=>{if(!await b.trigger()){De.error("Please fill in all required fields");return}f(!0);try{const E=xze(b.getValues());await o.mutateAsync(E),De.success("Draft saved")}catch(E){De.error(`Failed to save draft: ${E instanceof Error?E.message:"Unknown error"}`)}finally{f(!1)}},[b,o]),O=x.useCallback(async()=>{if(!await b.trigger()){De.error("Please fill in all required fields");return}u(!0);try{const E=xze(b.getValues());await o.mutateAsync(E);const T=(await r.getStoredScorer(t).listVersions({sortDirection:"DESC",perPage:1})).versions[0];T&&await r.getStoredScorer(t).activateVersion(T.id),a.invalidateQueries({queryKey:["scorers"]}),a.invalidateQueries({queryKey:["stored-scorers"]}),De.success("Scorer published"),s(i.scorerLink(t))}catch(E){De.error(`Failed to publish scorer: ${E instanceof Error?E.message:"Unknown error"}`)}finally{u(!1)}},[b,o,r,t,s,i,a]);return l.jsxs(Pb,{leftSlot:l.jsx(nxt,{form:b,onPublish:O,onSaveDraft:S,isSubmitting:c,isSavingDraft:d,formRef:p,mode:"edit"}),children:[m&&l.jsxs(Pf,{variant:"info",className:"m-4 mb-0",children:[l.jsx(Mf,{children:"This is a previous version"}),l.jsx(cv,{as:"p",children:"You are seeing a specific version of the scorer."})]}),l.jsx("form",{ref:p,className:"h-full",children:l.jsx(rxt,{form:b})})]})}function CSr(){const{scorerId:e}=fs(),[t,n]=ll(),r=t.get("versionId"),{data:a,isLoading:s}=$or(e,{status:"draft"}),{data:i}=sxt({scorerId:e??"",params:{sortDirection:"DESC"}}),o=a?.activeVersionId,c=i?.versions?.[0],u=!!(c&&o&&c.id!==o),d=x.useCallback(f=>{n(f?{versionId:f}:{})},[n]);return s?l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(nm,{})}),l.jsx(In,{className:"h-6 w-[200px]"})]})}),l.jsx(Pb,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Jt,{className:"h-8 w-8"})}),children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Jt,{className:"h-8 w-8"})})})]}):!a||!e?l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(nm,{})}),"Scorer not found"]})}),l.jsx(Pb,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"}),children:l.jsx("div",{className:"flex items-center justify-center h-full text-neutral3",children:"Scorer not found"})})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(nm,{})}),"Edit scorer: ",a.name,u&&l.jsx(ut,{variant:"info",children:"Unpublished changes"})]}),l.jsx(Xa,{children:l.jsx(Uor,{scorerId:e,value:r??"",onValueChange:d,variant:"outline",activeVersionId:o})})]}),l.jsx(ESr,{scorer:a,scorerId:e,selectedVersionId:r})]})}function jSr(){const{Link:e}=Nt(),[t,n]=x.useState(!1),{navigate:r,paths:a}=Nt(),{data:s,isLoading:i,error:o}=jv(),{variant:c}=Mv("entity-list-page"),[u,d]=x.useState(""),f=s?.datasets??[],p=h=>{n(!1),r(a.datasetLink(h))};return c==="new-proposal"?l.jsxs(l.Fragment,{children:[l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:i,children:[l.jsx(Pc,{})," Datasets"]})}),l.jsxs(ht.Column,{className:"flex justify-end gap-2",children:[l.jsx(hi,{as:"a",href:"https://mastra.ai/reference/datasets/dataset",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Dataset documentation",children:l.jsx(Xl,{})}),l.jsxs(he,{variant:"primary",onClick:()=>n(!0),children:[l.jsx(KO,{}),"Create Dataset"]})]})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:d,label:"Filter datasets",placeholder:"Filter by name or description"})})]}),l.jsx(Bhr,{datasets:f,isLoading:i,error:o,search:u})]}),l.jsx(Cse,{open:t,onOpenChange:n,onSuccess:p})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsxs(Xa,{children:[l.jsxs(he,{variant:"light",onClick:()=>n(!0),children:[l.jsx(xe,{children:l.jsx(KO,{})}),"Create Dataset"]}),l.jsxs(he,{as:e,to:"https://mastra.ai/reference/datasets/dataset",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Datasets documentation"]})]})]}),l.jsx(gi,{isCentered:!i&&f.length===0,children:l.jsx(Lhr,{datasets:f,isLoading:i,error:o,onCreateClick:()=>n(!0)})}),l.jsx(Cse,{open:t,onOpenChange:n,onSuccess:p})]})}function TSr(){const{datasetId:e}=fs(),t=qc(),[n,r]=x.useState(!1),[a,s]=x.useState(!1),[i,o]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(null),{data:p,error:h}=Tv(e??"");if(!e)return l.jsx(xn,{children:l.jsx(gi,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(h&&ra(h))return l.jsx(xn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"datasets"})})});const m=b=>{t(`/datasets/${e}/experiments/${b}`)},g=()=>{t("/datasets")},v=b=>{f(b?.version??null)};return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(Ghr,{value:e,variant:"ghost"})})]})}),l.jsxs(gi,{className:"content-stretch",children:[l.jsx(tgr,{datasetId:e,onAddItemClick:()=>s(!0),onEditClick:()=>o(!0),onDeleteClick:()=>u(!0),activeDatasetVersion:d,onVersionSelect:v,experimentTriggerSlot:l.jsxs(he,{variant:"primary",onClick:()=>r(!0),children:[l.jsx(W4t,{}),d!=null?`Run on v${d}`:"Run Experiment"]})}),l.jsx(ogr,{datasetId:e,version:d??void 0,open:n,onOpenChange:r,onSuccess:m}),l.jsx(rgr,{datasetId:e,open:a,onOpenChange:s}),p&&l.jsx(Hhr,{open:i,onOpenChange:o,dataset:{id:p.id,name:p.name,description:p?.description||"",inputSchema:p.inputSchema,groundTruthSchema:p.groundTruthSchema}}),p&&l.jsx(Qhr,{open:c,onOpenChange:u,datasetId:p.id,datasetName:p.name,onSuccess:g})]})]})}function NSr(){const{datasetId:e,experimentId:t}=fs(),{data:n}=Tv(e??""),{data:r,isLoading:a,error:s}=Sse(e,t),{data:i,isLoading:o,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=hge({datasetId:e,experimentId:t,experimentStatus:r?.status});return!e||!t?null:a?l.jsx(xn,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Jt,{})})}):s&&ra(s)?l.jsx(xn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"datasets"})})}):s||!r?l.jsx(xn,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",s instanceof Error?s.message:"Unknown error"]})}):l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{as:Ft,to:`/datasets/${e}`,children:n?.name}),l.jsx(_n,{isCurrent:!0,as:"span",children:"Experiment"})]})}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-1 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsx(jgr,{experimentId:t,experiment:r}),l.jsx(_gr,{experimentId:t,experimentStatus:r?.status,results:i??[],isLoading:o,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function ASr(){const{datasetId:e}=fs(),[t,n]=ll(),{data:r,error:a}=Tv(e??""),s=t.get("baseline")??"",i=t.get("contender")??"";return a&&ra(a)?l.jsx(xn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"datasets"})})}):!e||!s||!i?l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsxs(_n,{isCurrent:!0,as:"span",children:[l.jsx(xe,{children:l.jsx(_j,{})}),"Compare Experiments"]})]})}),l.jsx(gi,{children:l.jsxs("div",{className:"text-neutral4 text-center py-8",children:[l.jsx("p",{children:"Select two experiments to compare."}),l.jsxs("p",{className:"text-sm mt-2",children:["Use the URL format: /datasets/","{datasetId}","/experiments?baseline=","{experimentIdA}","&contender=","{experimentIdB}"]})]})})]}):l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{as:Ft,to:`/datasets/${e}`,children:r?.name??e?.slice(0,8)}),l.jsxs(_n,{isCurrent:!0,as:"span",children:[l.jsx(xe,{children:l.jsx(_j,{})}),"Experiments Comparison"]})]})}),l.jsx(gi,{children:l.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[l.jsxs(ht,{children:[l.jsxs(ht.Column,{children:[l.jsxs(ht.Title,{children:[l.jsx(_j,{})," Dataset Experiments Comparison"]}),l.jsxs(ht.Description,{children:["Comparing"," ",l.jsx(Ft,{to:`/datasets/${e}/experiments/${s}`,children:s.slice(0,8)})," vs"," ",l.jsx(Ft,{to:`/datasets/${e}/experiments/${i}`,children:i.slice(0,8)})]})]}),l.jsx(ht.Column,{children:l.jsxs(he,{as:Ft,to:`/datasets/${e}`,children:[l.jsx(XO,{}),"Back to Dataset"]})})]}),l.jsx(Igr,{datasetId:e,experimentIdA:s,experimentIdB:i,onSwap:()=>{n({baseline:i,contender:s})}})]})})]})}function ISr(){const{datasetId:e,itemId:t}=fs(),{Link:n}=Nt(),r=qc(),{data:a,isLoading:s,error:i}=bge(e??"",t??""),{updateItem:o,deleteItem:c}=li(),{data:u}=Tv(e??""),d=a?.[0]??null,f=d?.isDeleted??!1,[p,h]=x.useState(null),m=x.useMemo(()=>!d||f?{input:"",groundTruth:"",metadata:""}:{input:JSON.stringify(d.input,null,2),groundTruth:d.groundTruth?JSON.stringify(d.groundTruth,null,2):"",metadata:d.metadata?JSON.stringify(d.metadata,null,2):""},[d,f]),g=d?.datasetVersion??0,[v,b]=x.useState(!1),[S,O]=x.useState(m.input),[k,E]=x.useState(m.groundTruth),[C,T]=x.useState(m.metadata),[j,A]=x.useState(g);g!==j&&(A(g),O(m.input),E(m.groundTruth),T(m.metadata));const[I,P]=x.useState(!1),M=F=>{h(f?F:F.isLatest?null:F)},B=()=>{h(null)},D=!f&&p!=null,V=()=>{D||b(!0)},q=()=>{D||P(!0)},z=async()=>{if(!e||!t)return;let F;try{F=JSON.parse(S)}catch{De.error("Input must be valid JSON");return}let R;if(k.trim())try{R=JSON.parse(k)}catch{De.error("Ground Truth must be valid JSON");return}let Q;if(C.trim())try{Q=JSON.parse(C)}catch{De.error("Metadata must be valid JSON");return}try{await o.mutateAsync({datasetId:e,itemId:t,input:F,groundTruth:R,metadata:Q}),De.success("Item updated successfully"),b(!1)}catch(W){De.error(`Failed to update item: ${W instanceof Error?W.message:"Unknown error"}`)}},H=()=>{d&&(O(JSON.stringify(d.input,null,2)),E(d.groundTruth?JSON.stringify(d.groundTruth,null,2):""),T(d.metadata?JSON.stringify(d.metadata,null,2):"")),b(!1)},G=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),De.success("Item deleted successfully"),P(!1),r(`/datasets/${e}`)}catch(F){De.error(`Failed to delete item: ${F instanceof Error?F.message:"Unknown error"}`)}},L=p??d,Z=L?{id:t??"",datasetId:e??"",datasetVersion:L.datasetVersion,input:L.input,groundTruth:L.groundTruth,metadata:L.metadata,createdAt:L.createdAt,updatedAt:L.updatedAt}:null;return i&&ra(i)?l.jsx(xn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"datasets"})})}):s?null:!e||!t||!a||a.length===0?l.jsx(xn,{children:l.jsx(gi,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):l.jsxs(l.Fragment,{children:[l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{as:Ft,to:`/datasets/${e}`,children:u?.name}),l.jsx(_n,{isCurrent:!0,as:"span",children:"Item"})]})}),l.jsx("div",{className:"h-full overflow-hidden px-6 pb-4",children:l.jsxs("div",{className:"grid gap-6 max-w-[60rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsxs(ht,{children:[l.jsxs(ht.Column,{children:[l.jsxs(ht.Title,{children:[l.jsx(T4t,{}),t," ",l.jsx(ho,{content:t})]}),l.jsx(ht.Description,{children:l.jsxs(oa,{children:["Item of ",l.jsx(Pc,{})," ",u?.name]})}),l.jsxs(ht.Description,{children:[l.jsxs(oa,{children:[l.jsx(f4t,{})," Created at"," ",d?.createdAt?Gn(new Date(d.createdAt),"MMM d, yyyy"):""]}),l.jsxs(oa,{children:[l.jsx(C5,{})," Latest version v",d?.datasetVersion??""]})]})]}),l.jsx(ht.Column,{children:!v&&!f&&l.jsxs(Po,{children:[l.jsxs(he,{onClick:V,disabled:D,title:D?"Return to latest version to edit":void 0,children:[l.jsx(q4t,{})," Edit"]}),l.jsxs(he,{onClick:q,disabled:D,title:D?"Return to latest version to delete":void 0,children:[l.jsx(s3t,{})," Delete"]})]})})]}),l.jsxs(ix,{className:v?"grid-cols-1":"grid-cols-[1fr_auto]",children:[l.jsxs(_r,{withRightSeparator:!v,children:[f&&d&&l.jsxs(Zo,{variant:"destructive",children:[l.jsx(Xee,{}),l.jsxs(Zo.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&D&&p&&l.jsx(l.Fragment,{children:l.jsxs(Zo,{variant:"warning",children:[l.jsx(Xee,{}),l.jsxs(Zo.Message,{children:["Viewing version v",p.datasetVersion]}),l.jsxs(Zo.Button,{onClick:B,children:[l.jsx(i4t,{})," Return to the latest version"]})]})}),v?l.jsx(X0t,{inputValue:S,setInputValue:O,groundTruthValue:k,setGroundTruthValue:E,metadataValue:C,setMetadataValue:T,validationErrors:null,onSave:z,onCancel:H,isSaving:o.isPending}):Z?l.jsx(s9,{item:Z,Link:n}):l.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!v&&l.jsx(_r,{children:l.jsx(Rgr,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:M,onCompareVersionsClick:F=>{r(`/datasets/${e}/items/${t}/versions?ids=${F.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})]}),l.jsx(Qt,{open:I,onOpenChange:P,children:l.jsxs(Qt.Content,{children:[l.jsxs(Qt.Header,{children:[l.jsx(Qt.Title,{children:"Delete Item"}),l.jsx(Qt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),l.jsxs(Qt.Footer,{children:[l.jsx(Qt.Cancel,{children:"Cancel"}),l.jsx(Qt.Action,{onClick:G,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function wze(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function RSr(){const{datasetId:e}=fs(),[t,n]=ll(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:a,error:s}=Tv(e??""),{Link:i}=Nt(),[o,c]=x.useState(!1),{data:u}=kse(e??"",r[0]??""),{data:d}=kse(e??"",r[1]??"");return s&&ra(s)?l.jsx(xn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"datasets"})})}):!e||r.length<2?l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),l.jsx(gi,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two items to compare."})})})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{as:Ft,to:`/datasets/${e}`,children:a?.name||e?.slice(0,8)}),l.jsx(_n,{isCurrent:!0,as:"span",children:"Compare Items"})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:`/datasets/${e}`,variant:"outline",children:[l.jsx(xe,{children:l.jsx(XO,{})}),"Back to Dataset"]})})]}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":o}),children:[l.jsxs(ht,{children:[l.jsxs(ht.Column,{children:[l.jsxs(ht.Title,{children:[l.jsx(_j,{}),"Compare Dataset Items"]}),l.jsx(ht.Description,{children:l.jsxs(oa,{children:["Comparing ",r.length," items of"," ",l.jsx(Ft,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:a?.name||e?.slice(0,8)})]})})]}),l.jsx(ht.Column,{children:l.jsxs(Po,{children:[l.jsxs(he,{as:Ft,to:`/datasets/${e}`,children:[l.jsx(XO,{}),"Back to Dataset"]}),l.jsx(he,{variant:"primary",onClick:()=>c(f=>!f),children:o?l.jsxs(l.Fragment,{children:[l.jsx(sQe,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(k4t,{})," Diff View"]})})]})})]}),l.jsx(ix,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>l.jsxs(x.Fragment,{children:[l.jsx(PSr,{datasetId:e,itemId:f,Link:i,idx:p,itemIds:r,showContent:!o,onItemChange:h=>{const m=[...r];m[p]=h,n({items:m.join(",")})}}),p==0&&l.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),o&&u&&d&&l.jsx(cwt,{codeA:wze(u),codeB:wze(d)})]})})]})}function PSr({datasetId:e,itemId:t,Link:n,idx:r,itemIds:a,onItemChange:s,showContent:i=!0}){const{data:o,isLoading:c}=kse(e,t),{data:u}=qk(e),d=new Set(a.filter((p,h)=>h!==r)),f=(u??[]).map(p=>({value:p.id,label:p.id,disabled:d.has(p.id)}));return l.jsxs(_r,{children:[l.jsxs(_r.Toolbar,{className:"flex gap-4",children:[l.jsx(Zz,{label:"Item",name:`compare-item-${r}`,value:t,onValueChange:s,options:f,placeholder:"Select item",labelIsHidden:!0}),l.jsxs(he,{as:n,to:`/datasets/${e}/items/${t}`,children:[l.jsx(C5,{}),"Versions"]})]}),i&&l.jsx(_r.Content,{children:c?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):o?l.jsxs(l.Fragment,{children:[l.jsx(K0t,{item:o}),l.jsx(s9,{item:o,Link:n})]}):l.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function Sze(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function MSr(){const{datasetId:e,itemId:t}=fs(),[n,r]=ll(),[a,s]=x.useState(!1),i=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:o,error:c}=Tv(e??""),{Link:u}=Nt(),{data:d}=bge(e??"",t??""),{data:f}=Nse(e??"",t??"",i[0]??0,o?.version),{data:p}=Nse(e??"",t??"",i[1]??0,o?.version);return c&&ra(c)?l.jsx(xn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"datasets"})})}):!e||!t||i.length<2?l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),l.jsx(gi,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two versions to compare."})})})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{as:Ft,to:`/datasets/${e}`,children:o?.name}),l.jsx(_n,{as:Ft,to:`/datasets/${e}/items/${t}`,children:"Item"}),l.jsx(_n,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[l.jsx(xe,{children:l.jsx(XO,{})}),"Back to Item"]})})]}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:Y("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":a}),children:[l.jsxs(ht,{children:[l.jsxs(ht.Column,{children:[l.jsxs(ht.Title,{children:[l.jsx(_j,{}),"Compare Dataset Item Versions"]}),l.jsx(ht.Description,{children:l.jsxs(oa,{children:["Comparing ",i.length," versions of"," ",l.jsx(Ft,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),l.jsx(ht.Column,{children:l.jsxs(Po,{children:[l.jsxs(he,{as:Ft,to:`/datasets/${e}/items/${t}`,children:[l.jsx(XO,{}),"Back to Item"]}),l.jsx(he,{variant:"primary",onClick:()=>s(h=>!h),children:a?l.jsxs(l.Fragment,{children:[l.jsx(sQe,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(D4t,{})," Diff View"]})})]})})]}),l.jsx(ix,{className:"grid-cols-[1fr_3vw_1fr]",children:i.map((h,m)=>l.jsxs(x.Fragment,{children:[l.jsx(DSr,{datasetId:e,itemId:t,datasetVersion:h,latestVersion:o?.version,allVersions:d??[],versionNumbers:i,Link:u,idx:m,showContent:!a,onVersionChange:g=>{const v=[...i];v[m]=g,r({ids:v.join(",")})}}),m===0&&l.jsx("div",{className:Y("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},h))}),a&&f&&p&&l.jsx(cwt,{codeA:Sze(f),codeB:Sze(p)})]})})]})}function DSr({datasetId:e,itemId:t,datasetVersion:n,latestVersion:r,allVersions:a,versionNumbers:s,Link:i,idx:o,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=Nse(e,t,n,r),p=new Set(s.filter((g,v)=>v!==o)),h=a.map(g=>{const v=typeof g.updatedAt=="string"?new Date(g.updatedAt):g.updatedAt;return{value:String(g.datasetVersion),label:l.jsxs(l.Fragment,{children:[l.jsxs("b",{children:["v. ",g.datasetVersion]})," - ",Gn(v,"MMM d, yyyy h:mm a"),g.isLatest?l.jsx(Wi,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:p.has(g.datasetVersion)}}),m=d?{id:d.id,datasetId:e,datasetVersion:d.datasetVersion,input:d.input,groundTruth:d.groundTruth,metadata:d.metadata,createdAt:d.createdAt,updatedAt:d.updatedAt}:null;return l.jsxs(_r,{children:[l.jsxs(_r.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[l.jsx(C5,{className:"w-6 h-6 opacity-50"}),l.jsx(Zz,{label:"Version",name:`compare-version-${o}`,value:String(n),onValueChange:g=>u(Number(g)),options:h,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&l.jsx(_r.Content,{children:f?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!m?l.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",n," not found"]}):l.jsx(s9,{item:m,Link:i})})]})}function $Sr(){const{datasetId:e}=fs(),[t]=ll(),n=t.get("ids")?.split(",").map(Number).filter(g=>!isNaN(g)&&g>0)??[],r=qc(),{data:a,error:s}=Tv(e??""),i=qk(e??"",void 0,n[0]??null),o=qk(e??"",void 0,n[1]??null),c=x.useMemo(()=>i.data??[],[i.data]),u=x.useMemo(()=>o.data??[],[o.data]),d=x.useMemo(()=>{const g=new Map;for(const v of[...c,...u])g.has(v.id)||g.set(v.id,{id:v.id,createdAt:new Date(v.createdAt)});return[...g.values()].sort((v,b)=>b.createdAt.getTime()-v.createdAt.getTime())},[c,u]),f=x.useMemo(()=>new Map(c.map(g=>[g.id,g])),[c]),p=x.useMemo(()=>new Map(u.map(g=>[g.id,g])),[u]);if(s&&ra(s))return l.jsx(xn,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"datasets"})})});if(!e||n.length<2)return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),l.jsx(gi,{children:l.jsx("div",{className:"text-neutral4 text-center py-8",children:l.jsx("p",{children:"Select at least two versions to compare."})})})]});const h=(g,v,b)=>{r(`/datasets/${e}/items/${g}/versions?ids=${v?.datasetVersion??""},${b?.datasetVersion??""}`)},m=(g,v)=>{r(`/datasets/${e}/versions?ids=${g},${v}`,{replace:!0})};return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/datasets",children:[l.jsx(xe,{children:l.jsx(Pc,{})}),"Datasets"]}),l.jsx(_n,{as:Ft,to:`/datasets/${e}`,children:a?.name||e?.slice(0,8)}),l.jsxs(_n,{isCurrent:!0,as:"span",children:[l.jsx(xe,{children:l.jsx(Gwe,{})}),"Compare Versions"]})]})}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:"grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",children:[l.jsxs(ht,{children:[l.jsxs(ht.Column,{children:[l.jsxs(ht.Title,{children:[l.jsx(Gwe,{})," Compare Dataset Versions"]}),l.jsx(ht.Description,{children:l.jsxs(oa,{children:[l.jsx(C5,{})," Comparing ",n.length," versions of"," ",a?.name||e?.slice(0,8)]})})]}),l.jsx(ht.Column,{children:l.jsxs(he,{as:Ft,to:`/datasets/${e}`,children:[l.jsx(XO,{}),"Back to Dataset"]})})]}),l.jsx(ix,{children:l.jsxs(_r,{children:[l.jsx(Dgr,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:m}),l.jsx(zgr,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})]})}function LSr(){const[e]=ll(),t=qc(),n=e.get("redirect")||"/",a=e.get("mode")==="signup"?"signup":"signin",s=e.get("error_description")||e.get("error")||null,i=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(bwt,{redirectUri:n,onSuccess:i,initialMode:a,errorMessage:s})}const FSr=()=>{const{data:e=[],isLoading:t,error:n}=SR(),{variant:r}=Mv("entity-list-page"),[a,s]=x.useState(""),i=!t&&e.length===0;return r==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:t,children:[l.jsx(Mu,{})," MCP Servers"]})}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to MCP documentation",children:l.jsx(Xl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:s,label:"Filter MCP servers",placeholder:"Filter by name"})})]}),l.jsx(yvr,{mcpServers:e,isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Mu,{})}),"MCP Servers"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"MCP documentation"]})})]}),l.jsx(gi,{isCentered:i,children:l.jsx(pvr,{mcpServers:e,isLoading:t,error:n})})]})},zSr=()=>{const{serverId:e}=fs(),{data:t=[],isLoading:n}=SR(),r=t.find(a=>a.id===e);return l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/mcps",children:[l.jsx(xe,{children:l.jsx(Mu,{})}),"MCP Servers"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(Xxt,{value:e,variant:"ghost"})})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"MCP documentation"]})})]}),l.jsx(wvr,{isLoading:n,server:r})]})},BSr=()=>{const{data:e}=SR(),{serverId:t,toolId:n}=fs(),{data:r,isLoading:a}=uwt(t,n),s=e?.find(c=>c.id===t),i=r?.name,o=s?.name||"";return a||!r?null:l.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/mcps",children:[l.jsx(xe,{children:l.jsx(Mu,{})}),"MCP Servers"]}),l.jsx(_n,{as:Ft,to:`/mcps/${t}`,children:o}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:i})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"MCP documentation"]})})]}),l.jsx(xvr,{toolId:n,serverId:t})]})},dee="period";function USr(){const{experimentalFeaturesEnabled:e}=wwt(),[t,n]=ll(),r=t.get(dee),a=bpr(r)?r:"24h",s=x.useCallback(i=>{n(o=>{const c=new URLSearchParams(o);return i==="24h"?c.delete(dee):c.set(dee,i),c},{replace:!0})},[n]);return e?l.jsx(kpr,{initialPreset:a,onPresetChange:s,children:l.jsxs("div",{className:"w-full px-[3vw] mx-auto grid h-full grid-rows-[auto_1fr] overflow-y-auto",children:[l.jsxs(ht,{withMargins:!1,className:"mt-6 mb-4",children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{children:[l.jsx(rQe,{})," Metrics"]})}),l.jsxs(ht.Column,{className:"flex justify-end gap-2",children:[l.jsx(uhr,{}),l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/observability/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Metrics documentation",children:l.jsx(Xl,{})})]})]}),l.jsx(lhr,{})]})}):null}const VSr=(e,t)=>{const n=We();return jt({queryKey:["trace",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return await n.getTrace(e)},enabled:!!e,refetchInterval:3e3,...t})},qSr=async({client:e,page:t,perPage:n,filters:r})=>e.listTraces({pagination:{page:t,perPage:n},filters:r}),HSr=25;function QSr(e,t,n){if(e?.pagination?.hasMore)return n+1}function GSr(e){const t=new Set,n=e.pages.flatMap(a=>a.spans??[]).filter(a=>t.has(a.traceId)?!1:(t.add(a.traceId),!0)),r={};for(const a of e.pages)a.threadTitles&&Object.assign(r,a.threadTitles);return{spans:n,threadTitles:r}}const WSr=({filters:e})=>{const t=We(),{inView:n,setRef:r}=gR(),a=c_({queryKey:["traces",e],queryFn:({pageParam:c})=>qSr({client:t,page:c,perPage:HSr,filters:e}),initialPageParam:0,getNextPageParam:QSr,select:GSr,placeholderData:oFt,retry:!1,refetchInterval:c=>ra(c.state.error)?!1:3e3}),{hasNextPage:s,isFetchingNextPage:i,fetchNextPage:o}=a;return x.useEffect(()=>{n&&s&&!i&&o()},[n,s,i,o]),{...a,setEndOfListElement:r}};function ZSr(){const e=qc(),[t,n]=ll(),[r,a]=x.useState(),[s,i]=x.useState({value:"all",label:"All",type:"all"}),[o,c]=x.useState(()=>new Date(Date.now()-1440*60*1e3)),[u,d]=x.useState(void 0),[f,p]=x.useState(!1),[h,m]=x.useState(!1),[g,v]=x.useState(""),[b,S]=x.useState([]),[O,k]=x.useState(!1),[E,C]=x.useState({}),[T,j]=x.useState("last-24h"),[A,I]=x.useState({}),{data:P={},isLoading:M}=rh(),{data:B,isLoading:D}=Cv(),{data:V={},isLoading:q}=ah(),{data:z=[]}=whr(),{data:H=[]}=Shr(),{data:G=[]}=Ohr(),{data:L,isLoading:Z}=VSr(r,{enabled:!!r}),F=t.get("traceId"),R=t.get("spanId"),Q=t.get("tab"),W=t.get("scoreId"),te=x.useMemo(()=>{if(Object.keys(E).length!==0)return E},[E]),{data:se,isLoading:re,isFetchingNextPage:ae,hasNextPage:oe,setEndOfListElement:de,error:K,isError:ne}=WSr({filters:{...s?.type!=="all"&&{entityId:s?.value,entityType:s?.type},...o&&{startedAt:{start:o}},...u&&{endedAt:{end:u}},...b.length>0&&{tags:b},...O&&{status:"error"},...te&&{metadata:te},...Object.fromEntries(Object.entries(A).filter(([,Ke])=>Ke.trim()))}}),ie=x.useMemo(()=>se?.spans??[],[se?.spans]),ve=x.useDeferredValue(g),ge=x.useMemo(()=>{if(!ve.trim())return ie;const Ke=ve.trim().toLowerCase();return ie.filter(it=>{if(it.traceId?.toLowerCase().includes(Ke)||it.name?.toLowerCase().includes(Ke)||it.entityId?.toLowerCase().includes(Ke)||it.entityName?.toLowerCase().includes(Ke))return!0;const Mt=it.metadata;if(Mt&&typeof Mt=="object"){for(const mt of Object.values(Mt))if(String(mt).toLowerCase().includes(Ke))return!0}return!1})},[ie,ve]),ke=se?.threadTitles??{},je=x.useRef({}),me=x.useRef({}),_e=x.useMemo(()=>{let Ke=!1;const it=je.current;for(const mt of ie){const dt=mt.metadata;if(dt&&typeof dt=="object")for(const[En,kt]of Object.entries(dt)){if(kt==null)continue;it[En]||(it[En]=new Set,Ke=!0);const Bt=String(kt);it[En].has(Bt)||(it[En].add(Bt),Ke=!0)}}if(!Ke)return me.current;const Mt=Object.fromEntries(Object.entries(it).map(([mt,dt])=>[mt,[...dt].sort()]));return me.current=Mt,Mt},[ie]),J=x.useRef({}),X=x.useRef({}),ue=x.useMemo(()=>{let Ke=!1;const it=J.current;for(const mt of ie)for(const dt of Z0t){const En=mt[dt];En!=null&&typeof En=="string"&&En.trim()&&(it[dt]||(it[dt]=new Set,Ke=!0),it[dt].has(En)||(it[dt].add(En),Ke=!0))}for(const mt of H)it.environment||(it.environment=new Set,Ke=!0),it.environment.has(mt)||(it.environment.add(mt),Ke=!0);for(const mt of G)it.serviceName||(it.serviceName=new Set,Ke=!0),it.serviceName.has(mt)||(it.serviceName.add(mt),Ke=!0);if(!Ke)return X.current;const Mt=Object.fromEntries(Object.entries(it).map(([mt,dt])=>[mt,[...dt].sort()]));return X.current=Mt,Mt},[ie,H,G]);F&&F!==r&&(a(F),m(!0));const ye=x.useMemo(()=>(Object.entries(P)||[]).map(([Ke,it])=>({value:it.id,label:it.name,type:tv.AGENT})),[P]),Ce=x.useMemo(()=>(Object.entries(B||{})||[]).map(([,Ke])=>({value:Ke.name,label:Ke.name,type:tv.WORKFLOW_RUN})),[B]),le=x.useMemo(()=>[{value:"all",label:"All",type:"all"},...ye,...Ce],[ye,Ce]),we=t.get("entity"),Ae=le.find(Ke=>Ke.value===we);Ae&&Ae.value!==s?.value&&i(Ae);const Me=()=>{a(void 0),n({entity:"all",traceId:""}),m(!1),c(void 0),d(void 0),p(!1),v(""),S([]),k(!1),C({}),j("last-24h"),I({}),je.current={},me.current={},J.current={},X.current={}},Xe=(Ke,it)=>{if(it==="from")return c(Ke);d(Ke)},Ot=Ke=>{Ke?.value&&n({entity:Ke.value})},Wt=Ke=>{if(Ke===r)return a(void 0);a(Ke),m(!0)},wn=ne?ovr(K):void 0,It=x.useMemo(()=>{if(!f)return ge.map(mt=>({id:mt.traceId}));const{groups:Ke,ungrouped:it}=W0t(ge),Mt=[];for(const mt of Ke)for(const dt of mt.traces)Mt.push({id:dt.traceId});for(const mt of it)Mt.push({id:mt.traceId});return Mt},[ge,f]);if(K&&ra(K))return l.jsxs(co,{children:[l.jsx(co.Top,{children:l.jsxs(ht,{withMargins:!1,children:[l.jsxs(ht.Column,{children:[l.jsxs(ht.Title,{children:[l.jsx(S$,{})," Observability"]}),l.jsx(ht.Description,{children:"Explore observability traces for your entities"})]}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Observability documentation",tooltipContent:"Go to Observability documentation",children:l.jsx(Xl,{})})})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"traces"})})]});const rt=s?.value!=="all"||o||u||g.trim()||b.length>0||O||Object.keys(E).length>0||Object.values(A).some(Ke=>Ke.trim()),Ue=Hz({entries:It,id:r,update:a}),tt=Qz({entries:It,id:r,update:a});return l.jsxs(l.Fragment,{children:[l.jsxs(co,{className:"grid-rows-[auto_1fr] overflow-y-auto",children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsxs(ht.Column,{children:[l.jsxs(ht.Title,{isLoading:re,children:[l.jsx(S$,{})," Observability"]}),l.jsx(ht.Description,{children:"Explore observability traces for your entities"})]}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",rel:"noopener noreferrer","aria-label":"Observability documentation",tooltipContent:"Go to Observability documentation",children:l.jsx(Xl,{})})})]}),l.jsx(hhr,{onEntityChange:Ot,onReset:Me,selectedEntity:s,entityOptions:le,onDateChange:Xe,selectedDateFrom:o,selectedDateTo:u,isLoading:re||M||D,groupByThread:f,onGroupByThreadChange:p,searchQuery:g,onSearchChange:v,selectedTags:b,availableTags:z,onTagsChange:S,errorOnly:O,onErrorOnlyChange:k,selectedMetadata:E,availableMetadata:_e,onMetadataChange:C,datePreset:T,onDatePresetChange:j,contextFilters:A,availableContextValues:ue,onContextFiltersChange:I})]}),re?l.jsx(qbt,{columns:a9}):l.jsx(vhr,{traces:ge,selectedTraceId:r,onTraceClick:Wt,errorMsg:wn?.error,setEndOfListElement:de,filtersApplied:!!rt,isFetchingNextPage:ae,hasNextPage:oe,groupByThread:f,threadTitles:ke})]}),l.jsx(mge,{traceSpans:L?.spans,traceId:r,initialSpanId:R||void 0,initialSpanTab:Q==="scores"?"scores":"details",initialScoreId:W||void 0,traceDetails:ge.find(Ke=>Ke.traceId===r),isOpen:h,onClose:()=>{e("/observability"),m(!1)},onNext:Ue,onPrevious:tt,isLoadingSpans:Z,computeTraceLink:(Ke,it)=>`/observability?traceId=${Ke}${it?`&spanId=${it}`:""}`,scorers:V,isLoadingScorers:q})]})}function YSr(){const{Link:e,paths:t}=Nt(),{data:n,isLoading:r}=xxt(),{isCmsAvailable:a}=age(),{variant:s}=Mv("entity-list-page"),[i,o]=x.useState(""),c=n?.promptBlocks??[];return s==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:r,children:[l.jsx(IT,{})," Prompts"]})}),l.jsxs(ht.Column,{className:"flex justify-end gap-2",children:[l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Prompts documentation",children:l.jsx(Xl,{})}),a&&l.jsxs(he,{as:Ft,to:t.cmsPromptBlockCreateLink(),variant:"primary",children:[l.jsx(KO,{}),"Create Prompt"]})]})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:o,label:"Filter prompts",placeholder:"Filter by name or description"})})]}),l.jsx(ucr,{promptBlocks:c,isLoading:r,search:i,onSearch:o})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(IT,{})}),"Prompts"]}),l.jsxs(Xa,{children:[a&&l.jsxs(he,{variant:"light",as:e,to:t.cmsPromptBlockCreateLink(),children:[l.jsx(xe,{children:l.jsx(KO,{})}),"Create a prompt block"]}),l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Documentation"]})]})]}),l.jsx(gi,{isCentered:!r&&c.length===0,children:l.jsx(rcr,{isLoading:r,promptBlocks:c})})]})}function XSr(){return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(iQe,{})}),"Request Context"]})}),l.jsx(gi,{children:l.jsx(fir,{children:l.jsx($bt,{})})})]})}function KSr(){const{data:e={},isLoading:t,error:n}=ah(),{variant:r}=Mv("entity-list-page"),[a,s]=x.useState("");return r==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:t,children:[l.jsx(nm,{})," Scorers"]})}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/evals/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Scorers documentation",children:l.jsx(Xl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:s,label:"Filter scorers",placeholder:"Filter by name"})})]}),l.jsx(Xir,{scorers:e,isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(nm,{})}),"Scorers"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Scorers documentation"]})})]}),l.jsx(gi,{isCentered:!t&&Object.keys(e||{}).length===0,children:l.jsx(Gir,{isLoading:t,scorers:e,error:n})})]})}function JSr(){const{scorerId:e}=fs(),[t,n]=ll(),[r,a]=x.useState(),[s,i]=x.useState(0),[o,c]=x.useState(!1),[u,d]=x.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:f,isLoading:p,error:h}=Vir(e),{data:m={},isLoading:g,error:v}=rh(),{data:b,isLoading:S,error:O}=Cv(),{data:k,isLoading:E,error:C}=Uir({scorerId:e,page:s,entityId:u?.value==="all"?void 0:u?.value,entityType:u?.type==="ALL"?void 0:u?.type}),T=x.useMemo(()=>f?.agentIds?.filter(F=>m[F]).map(F=>({value:F,label:m[F].name,type:"AGENT"}))||[],[f?.agentIds,m]),j=x.useMemo(()=>f?.workflowIds?.map(F=>({value:F,label:F,type:"WORKFLOW"}))||[],[f?.workflowIds]),A=x.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...T,...j],[T,j]),I=t.get("entity"),P=A.find(F=>F.value===I);if(P&&P.value!==u?.value&&d(P),x.useEffect(()=>{if(h){const F=h instanceof Error?h.message:"Failed to load scorer";De.error(`Error loading scorer: ${F}`)}},[h]),x.useEffect(()=>{if(v){const F=v instanceof Error?v.message:"Failed to load agents";De.error(`Error loading agents: ${F}`)}},[v]),x.useEffect(()=>{if(O){const F=O instanceof Error?O.message:"Failed to load workflows";De.error(`Error loading workflows: ${F}`)}},[O]),h&&ra(h))return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/scorers",children:[l.jsx(xe,{children:l.jsx(nm,{})}),"Scorers"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"scorers"})})]});if(p||h||v||O)return null;const M=f?.agentIds?.map(F=>({name:F,id:Object.entries(m).find(([,R])=>R.name===F)?.[0]}))||[],B=f?.workflowIds?.map(F=>({name:F,id:Object.entries(b||{}).find(([,R])=>R.name===F)?.[0]}))||[],V=[{key:"entities",label:"Entities",value:([...M.map(F=>({id:F.id,name:F.name,type:"AGENT"})),...B.map(F=>({id:F.id,name:F.name,type:"WORKFLOW"}))]||[]).map(F=>({id:F.id,name:F.name||F.id,path:`${F.type==="AGENT"?"/agents":"/workflows"}/${F.name}`}))}],q=F=>{F?.value&&n({entity:F.value})},z=k?.scores||[],H=k?.pagination,G=F=>{a(F),c(!0)},L=Hz({entries:z,id:r,update:a}),Z=Qz({entries:z,id:r,update:a});return l.jsxs(l.Fragment,{children:[l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/scorers",children:[l.jsx(xe,{children:l.jsx(nm,{})}),"Scorers"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(qir,{value:e,variant:"ghost"})})]}),l.jsxs(Xa,{children:[f?.scorer?.source==="stored"&&l.jsxs(he,{variant:"light",as:Ft,to:`/cms/scorers/${e}/edit`,children:[l.jsx(xe,{children:l.jsx(Q4t,{})}),"Edit"]}),l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Scorers documentation"]})]})]}),l.jsx("div",{className:Y("grid overflow-y-auto h-full"),children:l.jsxs("div",{className:Y("max-w-[100rem] w-full px-12 mx-auto grid content-start gap-8 h-full"),children:[l.jsx(HD,{title:f?.scorer?.config?.name||"loading",description:f?.scorer?.config?.description||"loading",icon:l.jsx(nm,{})}),l.jsx(mS,{data:V,LinkComponent:Ft,isLoading:g||S}),l.jsx(Bir,{selectedEntity:u,entityOptions:A,onEntityChange:q,onReset:()=>n({entity:"all"}),isLoading:E||g||S}),E?l.jsx("div",{className:"h-full w-full flex items-center justify-center",children:l.jsx(Jt,{})}):l.jsx(_ir,{scores:z,selectedScoreId:r,pagination:{total:H?.total||0,hasMore:H?.hasMore||!1,perPage:H?.perPage||0,page:H?.page||0},onScoreClick:G,onPageChange:i,errorMsg:C?.message})]})})]}),l.jsx(Gbt,{scorerName:f?.scorer?.config?.name,score:e1r(z.find(F=>F.id===r)),isOpen:o,onClose:()=>c(!1),onNext:L,onPrevious:Z,computeTraceLink:(F,R)=>`/observability?traceId=${F}${R?`&spanId=${R}`:""}`})]})}const e1r=e=>{if(e)return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}},t1r=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],n1r=()=>{const{baseUrl:e,headers:t,themeToggleEnabled:n}=Gz(),{theme:r,setTheme:a}=Fr(),[s,i]=x.useState(r),o=x.useRef(r);return x.useEffect(()=>{i(r),o.current=r},[r]),l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Bme,{})}),"Settings"]})}),l.jsx(gi,{children:l.jsxs("div",{className:"max-w-2xl mx-auto w-full mt-8 space-y-8",children:[n?l.jsx("section",{className:"rounded-lg border border-border1 bg-surface3 p-4",children:l.jsxs("div",{className:"space-y-3",children:[l.jsx("h2",{className:"text-icon6 font-medium",children:"Theme"}),l.jsx(Zz,{name:"theme",label:"Theme mode",value:s,onValueChange:c=>{const u=c;o.current=u,i(u)},options:t1r.map(c=>({...c}))})]})}):null,l.jsx(txt,{initialConfig:{baseUrl:e,headers:t},onSave:()=>{n&&a(o.current)}})]})})]})};function r1r(){const[e]=ll(),t=qc(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(bwt,{redirectUri:n,onSuccess:r,initialMode:"signup"})}async function f1t(){const e=await fetch("https://mastra.ai/api/templates.json");if(!e.ok)throw new Error(`Failed to fetch templates: ${e.statusText}`);const t=await e.json(),n=[{title:"Weather Agent",slug:"weather-agent",githubUrl:"https://github.com/mastra-ai/weather-agent",description:"Get weather information of any city.",longDescription:"One Agent, one Workflow and one Tool to bring you the weather in your city.",imageURL:"",tags:["Agent","Workflow","Tool"],useCase:"",supportedProviders:["openai","anthropic","google","groq"],agents:["weatherAgent"],tools:["weatherTool"],workflows:["weatherWorkflow"]},...t],r=Array.from(new Set(n.flatMap(s=>s.tags))),a=Array.from(new Set(n.flatMap(s=>s.supportedProviders)));return{templates:n,tags:r,providers:a}}async function a1r({repo:e,owner:t}){const n=await fetch(`https://api.github.com/repos/${t}/${e}`);if(!n.ok)throw new Error(`Failed to fetch template: ${n.statusText}`);const r=await n.json();if(!r.is_template)throw new Error("Repo is not a template, please update the repo settings to make it a template");return{title:r.name,slug:r.name,description:r.description??"",imageURL:"",tags:[],useCase:"",longDescription:r.description??"",githubUrl:r.html_url,supportedProviders:[]}}async function s1r({repoOrSlug:e,owner:t}){const{templates:n}=await f1t(),r=n.find(a=>a.slug===e);if(!r){if(e.startsWith("template-")){const s=n.find(i=>`template-${i.slug}`===e);if(s)return s}const a=await a1r({repo:e,owner:t});if(a)return a;throw new Error(`Template ${e} not found`)}return r}async function i1r({repo:e,owner:t,branch:n}){const r=`https://raw.githubusercontent.com/${t}/${e}/${n}/.env.example`,a=await fetch(r);return a.ok?(await a.text()).split(`
510
- `).reduce((o,c)=>{if(!c||c.startsWith("#"))return o;const[u,d]=c.split("=");return u&&(o[u]=d?.split("")?.every(f=>f==="*")?"":d?.replaceAll('"',"")),o},{}):{}}const o1r=()=>jt({queryKey:["mastra-templates"],queryFn:f1t}),l1r=({repoOrSlug:e,owner:t})=>jt({queryKey:["template-repo",e,t],queryFn:()=>s1r({repoOrSlug:e,owner:t})}),c1r=({repo:e,owner:t,branch:n})=>jt({queryKey:["template-repo-env-vars",e,t,n],queryFn:()=>i1r({repo:e,owner:t,branch:n})}),u1r=()=>{const e=We();return jt({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},d1r=()=>{const e=We();return qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},f1r=()=>{const e=We();return qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},Oze=e=>{if(typeof e=="string")return e;if(e==null)return"Unknown error";if(e instanceof Error)return typeof e.message=="string"&&e.message.length>0?e.message:"Unknown error";if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)},kze=(e,t,n)=>{let r={...t};if(!(r.payload?.workflowState?.steps&&Object.keys(r.payload.workflowState.steps).length>0)&&n?.allSteps&&(r.payload={...r.payload,workflowState:{...r.payload?.workflowState,steps:Object.keys(n.allSteps).reduce((s,i)=>(s[i]={id:i,description:n.allSteps[i].description,status:"pending"},s),{})}}),e.type==="start"||e.type==="workflow-start"){const s={};n?.allSteps&&Object.entries(n.allSteps).forEach(([o,c])=>{s[o]={id:c.id,description:c.description,status:"pending"}});const i=e.runId||e.payload?.runId;r={...r,runId:i,eventTimestamp:new Date().toISOString(),status:"running",phase:"initializing",payload:{workflowState:{status:"running",steps:s},currentStep:null}}}if(e.type==="step-start"||e.type==="workflow-step-start"){const s=e.payload.id;r={...r,phase:"processing",payload:{...r.payload,currentStep:{id:s,status:"running",startTime:new Date,...e.payload},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[s]:{...r.payload.workflowState.steps[s],status:"running",startTime:new Date,...e.payload}}}}}}if(e.type==="step-result"||e.type==="workflow-step-result"){const s=e.payload.id,i=e.payload.status,o=e.payload.error;if(r={...r,payload:{...r.payload,currentStep:{...r.payload.currentStep,status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[s]:{...r.payload.workflowState.steps[s],status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date}}}}},i==="failed"&&o){const c=Oze(o);r={...r,status:"failed",error:c,phase:"error",failedStep:{id:s,error:c,description:e.payload.description||s},payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}}if((e.type==="step-finish"||e.type==="workflow-step-finish")&&(r={...r,payload:{...r.payload,currentStep:null}}),(e.type==="finish"||e.type==="workflow-finish")&&(r.phase==="error"||r.status==="failed"?r={...r,completedAt:new Date}:r={...r,status:e.payload.status||"completed",phase:"completed",payload:{...r.payload,currentStep:null,workflowState:{...r.payload.workflowState,status:e.payload.status||"completed"}},completedAt:new Date}),e.type==="error"){const s=Oze(e.payload.error);r={...r,status:"failed",error:s,phase:"error",payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}return{newState:r}},p1r=(e,t)=>{try{localStorage.setItem(`template-install-${e}`,JSON.stringify({state:t,timestamp:Date.now()}))}catch(n){console.warn("Failed to save template state to localStorage:",n)}},p1t=(e,t)=>{const[n,r]=x.useState({}),[a,s]=x.useState(!1);return{streamResult:n,isStreaming:a,processStream:async(o,c)=>{if(s(!0),r({}),!o)throw new Error("No stream returned");const u=o.getReader();let d={runId:c||t,eventTimestamp:new Date().toISOString(),phase:"running",payload:{workflowState:{steps:{}},currentStep:null}};try{for(;;){const{done:f,value:p}=await u.read();if(f)break;const{newState:h}=kze(p,d,e);if(d=h,r(h),p.runId||c||t){const m=p.runId||c||t;p1r(m,h)}}}catch(f){console.error("💥 [processStream] Error processing template installation stream:",f);const{newState:p}=kze({type:"error",payload:{error:f instanceof Error?f.message:"Unknown error"}},d,e);r(p)}finally{s(!1),u.releaseLock()}}}},h1r=e=>{const t=We(),{streamResult:n,isStreaming:r,processStream:a}=p1t(e);return{streamInstall:qn({mutationFn:async({inputData:i,selectedModel:o,runId:c})=>{for(let d=1;d<=3;d++)try{const f=t.getAgentBuilderAction("merge-template"),p=new YA;p.set("selectedModel",o);const h=await f.stream({inputData:i,requestContext:p},c);await a(h,c);return}catch(f){console.error(`💥 [streamInstall] Attempt ${d} failed:`,f);const p=f?.message?.includes("Failed to fetch")||f?.message?.includes("NetworkError")||f?.message?.includes("network error")||f?.message?.includes("fetch")||f?.code==="NETWORK_ERROR"||f?.name==="TypeError";if(console.warn(`Stream attempt ${d}/3 failed:`,f),p){const h=c?`Network error during template installation (likely hot reload). Please refresh the page to resume from where you left off using runId: ${c}`:"Network error during template installation (likely hot reload). Please try again.";throw console.error("🔌 Stream network error:",h),new Error(h)}throw console.error("❌ [streamInstall] Non-network error or max retries reached, throwing:",f),f}}}),streamResult:n,isStreaming:r}},m1r=e=>{const t=We(),{streamResult:n,isStreaming:r,processStream:a}=p1t(e);return{observeInstall:qn({mutationFn:async({runId:i})=>{for(let u=1;u<=3;u++)try{const f=await t.getAgentBuilderAction("merge-template").observeStream({runId:i});await a(f,i);return}catch(d){console.error(`💥 [observeInstall] Attempt ${u} failed:`,d);const f=d?.message?.includes("Failed to fetch")||d?.message?.includes("NetworkError")||d?.message?.includes("network error")||d?.message?.includes("fetch")||d?.code==="NETWORK_ERROR"||d?.name==="TypeError";if(console.warn(`ObserveStream attempt ${u}/3 failed:`,d),f&&u<3){console.info(`🔄 ObserveStream network error detected (likely hot reload), retrying in 2000ms... (attempt ${u+1}/3)`),await new Promise(p=>setTimeout(p,2e3));continue}throw console.error("❌ [observeInstall] Non-network error or max retries reached, throwing:",d),d}}}),streamResult:n,isStreaming:r}};function g1r(){const{data:e,isLoading:t}=o1r(),{templates:n,tags:r,providers:a}=e??{templates:[],tags:[],providers:[]},[s,i]=x.useState("all"),[o,c]=x.useState("all"),[u,d]=x.useState(""),f=[{value:"all",label:"Any tag"}];(r||[]).forEach(S=>{f.push({value:S,label:S})});const p=[{value:"all",label:"Any provider"}];(a||[]).forEach(S=>{p.push({value:S,label:S})});const h=(S,O)=>{O==="tag"?i(S):O==="provider"&&c(S)},m=S=>{d(S)},g=()=>{i("all"),c("all"),d("")},v=n.filter(S=>!(u&&!S.title.toLowerCase().includes(u)&&!S.description.toLowerCase().includes(u)||s!=="all"&&!S.tags.includes(s)||o!=="all"&&!S.supportedProviders.includes(o))),b=u||s!=="all"||o!=="all";return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Ele,{})}),"Templates"]})}),l.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(ipr,{selectedTag:s,onTagChange:S=>h(S,"tag"),tagOptions:f,selectedProvider:o,onProviderChange:S=>h(S,"provider"),providerOptions:p,searchTerm:u,onSearchChange:m,onReset:b?g:void 0,className:"max-w-[80rem]",isLoading:t}),l.jsx(lpr,{templates:v,linkComponent:Ft,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const v1r="1.17.0";function y1r(){const{templateSlug:e}=fs(),[t,n]=ll(),[r,a]=x.useState(""),[s,i]=x.useState(""),[o,c]=x.useState(""),[u,d]=x.useState({}),[f,p]=x.useState([]),[h,m]=x.useState(null),[g,v]=x.useState(!1),[b,S]=x.useState(""),[O,k]=x.useState(!1),[E,C]=x.useState(!1),[T,j]=x.useState([]),{data:A,isLoading:I}=l1r({repoOrSlug:e,owner:"mastra-ai"}),M=v1r?.includes("beta")??!1?"beta":"main",{data:B,isLoading:D}=c1r({repo:A?.githubUrl?new URL(A.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:M}),{data:V,isLoading:q}=u1r(),{mutateAsync:z,isPending:H}=d1r(),{mutateAsync:G}=f1r(),{streamInstall:L,streamResult:Z,isStreaming:F}=h1r(V),{observeInstall:R,streamResult:Q,isStreaming:W}=m1r(V);x.useEffect(()=>{const ne=t.get("runId");ne&&!g&&!h&&!F&&!W&&(console.info("🔄 Checking completed run after hot reload:",{runId:ne}),S(ne),G({runId:ne}).then(ie=>{const ve=ie.snapshot;if(ve?.status==="success"&&ve?.result?.success)v(!0);else if(ve?.result?.success===!1)if(ve?.result?.validationResults&&!ve?.result?.validationResults?.valid&&ve?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ke,errors:je}=ve.result.validationResults,me=`Template installation completed but ${ke} validation issue${ke>1?"s":""} remain unresolved.`;m(me),j(je||[])}else{const ke=ve?.result?.message||ve?.result?.error||"Template installation failed";m(typeof ke=="string"?ke:String(ke))}}).catch(ie=>{console.error("❌ Failed to fetch run details:",ie),m("Failed to retrieve installation status after reload")}))},[t,g,h,F,W,G]),x.useEffect(()=>{const ne=t.get("runId"),ie=t.get("resume"),ve=t.get("provider");if(ne&&ie==="true"&&ve&&!F&&!W&&!O&&!E&&V){S(ne),k(!0);try{G({runId:ne}).then(ge=>{if(ge.snapshot?.status==="running")return R.mutateAsync({runId:ne})}).then(()=>{n(ge=>{const ke=new URLSearchParams(ge);return ke.delete("resume"),ke})}).catch(ge=>{console.error("❌ Failed to resume template installation:",ge),ge.message?.includes("404")||ge.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(ge){console.error("❌ Auto-resume failed with error:",ge),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,F,W,O,E,V,G,R,n]);const te=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],se=[{key:"tools",label:"Tools",value:A?.tools?.length?A.tools.map(ne=>ne).join(", "):"n/a",icon:l.jsx(vo,{})},{key:"agents",label:"Agents",value:A?.agents?.length?A.agents.map(ne=>ne).join(", "):"n/a",icon:l.jsx($s,{})},{key:"workflows",label:"Workflows",value:A?.workflows?.length?A.workflows.map(ne=>ne).join(", "):"n/a",icon:l.jsx(c3t,{})},{key:"providers",label:"Providers",value:A?.supportedProviders?.length?A.supportedProviders.join(", "):"n/a",icon:l.jsx(u4t,{})},{key:"tags",label:"Tags",value:A?.tags?.length?A.tags.join(", "):"n/a",icon:l.jsx(r3t,{})}],re=[{...se[0]},{...se[1]},{...se[2]}].filter(ne=>ne.value!=="n/a");x.useEffect(()=>{B&&d(B)},[B]),x.useEffect(()=>{const ne=Z||Q;ne?.phase==="error"&&ne?.error&&m(typeof ne.error=="string"?ne.error:String(ne.error))},[Z?.phase,Z?.error,Q?.phase,Q?.error]);const ae=ne=>{a(ne)},oe=async ne=>(i(ne.provider),c(ne.modelId),{message:"Model updated successfully"}),de=async()=>{const ne=Object.entries(u).reduce((ie,[ve,ge])=>(ge===""&&ie.push(ve),ie),[]);if(ne.length>0){p(ne);return}if(A){m(null),v(!1),S(""),C(!0);try{const ve={repo:A.githubUrl||`https://github.com/mastra-ai/template-${A.slug}`,ref:M,slug:A.slug,variables:u},{runId:ge}=await z({});S(ge),n(ke=>{const je=new URLSearchParams(ke);return je.set("runId",ge),je.set("resume","true"),je.set("provider",r||"openai"),je}),await L.mutateAsync({inputData:ve,selectedModel:{provider:s,modelId:o},runId:ge})}catch(ie){C(!1),m(ie?.message||"Template installation failed"),console.error("Template installation failed",ie)}}},K=ne=>{const{name:ie,value:ve}=ne.target;ve.trim()===""?p(ge=>[...ge,ie]):p(ge=>ge.filter(ke=>ke!==ie)),d(ge=>({...ge,[ie]:ve}))};return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/templates",children:[l.jsx(xe,{children:l.jsx(Ele,{})}),"Templates"]}),l.jsx(_n,{as:Ft,to:`/templates/${A?.slug}`,isCurrent:!0,children:A?.title&&A.title})]})}),l.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:l.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[l.jsx(cpr,{isLoading:I,title:A?.title,description:A?.longDescription,imageURL:A?.imageURL,githubUrl:A?.githubUrl,infoData:se,templateSlug:e}),A&&l.jsxs(l.Fragment,{children:[(F||W)&&l.jsx(mpr,{name:A.title,streamResult:W?Q:Z,runId:b,workflowInfo:V}),g&&l.jsx(gpr,{name:A.title,installedEntities:re,linkComponent:Ft}),h&&l.jsx(vpr,{errorMsg:h,validationErrors:T.length>0?T:Z?.validationResults?.errors||Q?.validationResults?.errors}),!F&&!W&&!g&&!h&&l.jsx(upr,{providerOptions:te,selectedProvider:r,onProviderChange:ae,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:de,handleVariableChange:K,isLoadingEnvVars:D||q,isInstalling:H,defaultModelProvider:s,defaultModelId:o,onModelUpdate:oe})]})]})})]})}const b1r=()=>{const{toolId:e,agentId:t}=fs();return l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/agents",children:[l.jsx(xe,{children:l.jsx($s,{})}),"Agents"]}),l.jsx(_n,{as:Ft,to:`/agents/${t}/chat`,children:t}),l.jsx(_n,{as:Ft,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Tools documentation"]})})]}),l.jsx(flr,{toolId:e,agentId:t})]})},x1r=()=>{const{toolId:e}=fs();return l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/tools",children:[l.jsx(xe,{children:l.jsx(vo,{})}),"Tools"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(spr,{value:e,variant:"ghost"})})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Tools documentation"]})})]}),l.jsx(apr,{toolId:e})]})};function w1r(){const{data:e,isLoading:t,error:n}=Cv(),{variant:r}=Mv("entity-list-page"),[a,s]=x.useState(""),i=!t&&Object.keys(e||{}).length===0;return r==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:t,children:[l.jsx(Mo,{})," Workflows"]})}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:l.jsx(Xl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),l.jsx(Iar,{workflows:e||{},isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Mo,{})}),"Workflows"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Workflows documentation"]})})]}),l.jsx(gi,{isCentered:i,children:l.jsx(bar,{workflows:e||{},isLoading:t,error:n})})]})}const _ze=()=>{const{workflowId:e}=fs(),{data:t,isLoading:n,error:r}=vR(e);return r&&ra(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"workflows"})}):l.jsx(nbt,{workflowId:e,workflow:t??void 0,isLoading:n})};function Eze(){const{workspaceId:e}=fs(),[t,n]=ll(),r=qc(),[a,s]=x.useState(!1),[i,o]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(null),[p,h]=x.useState(null),[m,g]=x.useState(!1),v=t.get("file"),b=t.get("tab"),{data:S,error:O,isLoading:k}=y0t(),E=S?.workspaces??[],C=e??E[0]?.id,{data:T,isLoading:j,error:A}=Sur(C),I=ra(O)||ra(A),P=t.get("path")||".",M=Qre(O)||Qre(A),B=C?E.find(Ue=>Ue.id===C):void 0,D=Ue=>{const tt=new URLSearchParams(t);for(const[Ke,it]of Object.entries(Ue))it===null?tt.delete(Ke):tt.set(Ke,it);n(tt)},V=Ue=>{g(!1),s(!1),r(`/workspaces/${Ue}`)},q=Ue=>{D({path:Ue==="."||Ue===""?null:Ue,file:null})},z=Ue=>{D({file:Ue})},H=Ue=>{D({tab:Ue})},G=P,L=v,{data:Z,isLoading:F,error:R,refetch:Q}=Our(G,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:C}),W=_ur(),te=Eur(),{data:se,isLoading:re}=b0t(L??"",{enabled:!!L,workspaceId:C}),{data:ae,isLoading:oe,refetch:de}=jur({workspaceId:C}),K=Mur(),ne=Dur(),ie=$ur(),ve=T?.isWorkspaceConfigured??!1,ge=T?.capabilities?.hasFilesystem??!1,ke=T?.capabilities?.hasSkills??!1,je=T?.capabilities?.canBM25??!1,me=T?.capabilities?.canVector??!1,_e=B?.safety?.readOnly??!1,J=ge&&!_e,X=T?.mounts,ue=X?.filter(Ue=>!Ue.readOnly).map(Ue=>({path:Ue.path,displayName:Ue.displayName,icon:Ue.icon,provider:Ue.provider,name:Ue.name})),ye=X&&X.length>1?X.map(Ue=>Ue.path):void 0,Ce=x.useCallback(Ue=>{C&&K.mutate({...Ue,workspaceId:C},{onSuccess:async tt=>{if(tt.success){u(!1);const{data:Ke,error:it}=await de();if(it||!Ke){De.success(`Skill "${tt.skillName}" installed successfully (${tt.filesWritten} files)`);return}Ke.skills.some(mt=>mt.name===tt.skillName)?De.success(`Skill "${tt.skillName}" installed successfully (${tt.filesWritten} files)`):(g(!0),De.warning(`Skill "${tt.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else De.error("Failed to install skill")},onError:tt=>{De.error(`Failed to install skill: ${tt instanceof Error?tt.message:"Unknown error"}`)}})},[C,K,de]),le=x.useCallback(Ue=>{C&&(h(Ue),ne.mutate({workspaceId:C,skillName:Ue},{onSuccess:tt=>{if(h(null),tt.updated.length>0){const Ke=tt.updated[0];Ke.success?(De.success(`Skill "${Ue}" updated successfully (${Ke.filesWritten} files)`),de()):De.error(`Failed to update skill: ${Ke.error??"Unknown error"}`)}else De.error("Failed to update skill: No update result returned")},onError:tt=>{h(null),De.error(`Failed to update skill: ${tt instanceof Error?tt.message:"Unknown error"}`)}}))},[C,ne,de]),we=x.useCallback(Ue=>{C&&(f(Ue),ie.mutate({workspaceId:C,skillName:Ue},{onSuccess:tt=>{f(null),tt.success?(De.success(`Skill "${tt.skillName}" removed successfully`),de()):De.error(`Failed to remove skill "${tt.skillName}"`)},onError:tt=>{f(null),De.error(`Failed to remove skill: ${tt instanceof Error?tt.message:"Unknown error"}`)}}))},[C,ie,de]),Me=b==="files"&&ge?"files":b==="skills"&&ke?"skills":ge?"files":ke?"skills":"files",Xe=ae?.skills??[],Ot=ae?.isSkillsConfigured??!1,Wt=Z?.entries??[],wn=ge&&(je||me),It=ke&&Ot&&Xe.length>0,rt=wn||It;return I?l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"workspaces"})})]}):M?l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[l.jsx(HD,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Eh,{})}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[l.jsx("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-amber-500/10 mb-6",children:l.jsx(Xee,{className:"h-8 w-8 text-amber-500"})}),l.jsx("h2",{className:"text-xl font-semibold text-neutral6 mb-2",children:"Workspace Not Supported"}),l.jsxs("p",{className:"text-neutral4 max-w-md mb-6",children:["The workspace feature requires a newer version of ",l.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),". Please upgrade your dependencies to enable workspace functionality."]}),l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Learn More"]})]})]})})]}):k?l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Jt,{})})]}):!j&&!k&&!ve?l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[l.jsx(HD,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Eh,{})}),l.jsx(Avr,{})]})})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(Xa,{children:[rt&&l.jsxs(he,{variant:"light",onClick:()=>s(!a),children:[l.jsx(xe,{children:l.jsx(e3t,{className:"h-4 w-4"})}),"Search"]}),l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Workspaces documentation"]})]})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start gap-6 h-full w-full",children:[l.jsx(HD,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Eh,{})}),E.length>1&&l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>o(!i),className:"flex items-center gap-2 px-3 py-2 text-sm border border-border1 rounded-lg bg-surface2 hover:bg-surface3 transition-colors w-full max-w-md",children:[B?.source==="agent"?l.jsx(sD,{className:"h-4 w-4 text-accent1"}):l.jsx(U7,{className:"h-4 w-4 text-neutral4"}),l.jsxs("span",{className:"flex-1 text-left truncate",children:[B?.name??"Select workspace",B?.source==="agent"&&B.agentName&&l.jsxs("span",{className:"text-neutral4 ml-1",children:["(",B.agentName,")"]})]}),l.jsx(g4t,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&l.jsx("div",{className:"absolute z-50 mt-1 w-full max-w-md bg-surface2 border border-border1 rounded-lg shadow-lg overflow-hidden",children:E.map(Ue=>l.jsxs("button",{onClick:()=>{V(Ue.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${B?.id===Ue.id?"bg-surface3":""}`,children:[Ue.source==="agent"?l.jsx(sD,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):l.jsx(U7,{className:"h-4 w-4 text-neutral4 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:Ue.name}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:Ue.source==="agent"?`Agent: ${Ue.agentName}`:"Global workspace"})]}),l.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[Ue.safety?.readOnly&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),Ue.capabilities.hasFilesystem&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Ue.capabilities.hasSandbox&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Ue.capabilities.hasSkills&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Ue.id))})]}),E.length===1&&B&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[B.source==="agent"?l.jsx(sD,{className:"h-4 w-4 text-accent1"}):l.jsx(U7,{className:"h-4 w-4"}),l.jsx("span",{children:B.name}),B.source==="agent"&&B.agentName&&l.jsxs("span",{className:"text-neutral3",children:["(",B.agentName,")"]}),_e&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),a&&rt&&C&&l.jsx(S1r,{workspaceId:C,canSearchFiles:wn,canSearchSkills:It,canBM25:je,canVector:me,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:Ue=>{D({file:Ue,tab:"files"})},onViewSkillResult:(Ue,tt)=>{C&&r(`/workspaces/${C}/skills/${encodeURIComponent(Ue)}?path=${encodeURIComponent(tt)}`)}},C),l.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[ge&&l.jsxs("button",{onClick:()=>H("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Me==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(IT,{className:"h-4 w-4"}),"Files"]}),ke&&l.jsxs("button",{onClick:()=>H("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Me==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(O$,{className:"h-4 w-4"}),"Skills",Ot&&Xe.length>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:Xe.length})]})]}),l.jsxs("div",{className:"pb-8",children:[Me==="files"&&ge&&l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(Cvr,{entries:Wt,currentPath:G,isLoading:F,error:R,onNavigate:q,onFileSelect:z,onRefresh:()=>Q(),onCreateDirectory:_e?void 0:Ue=>te.mutate({path:Ue,workspaceId:C}),onDelete:_e?void 0:Ue=>W.mutate({path:Ue,recursive:!0,force:!0,workspaceId:C})}),L&&l.jsx(Nvr,{path:L,content:se?.content??"",isLoading:re,mimeType:se?.mimeType,onClose:()=>z(null)})]})}),Me==="skills"&&ke&&l.jsx(zvr,{skills:Xe,isLoading:oe,isSkillsConfigured:Ot,hasUndiscoveredAgentSkills:m,basePath:C?`/workspaces/${C}/skills`:"/workspaces",onAddSkill:J?()=>u(!0):void 0,onUpdateSkill:J?le:void 0,onRemoveSkill:J?we:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:ye}),!ge&&!ke&&l.jsx("div",{className:"py-12 text-center text-neutral4",children:l.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),C&&J&&l.jsx(Qvr,{open:c,onOpenChange:u,workspaceId:C,onInstall:Ce,isInstalling:K.isPending,installedSkillIds:Xe.filter(Ue=>Ue.skillsShSource).map(Ue=>`${Ue.skillsShSource.owner}/${Ue.skillsShSource.repo}/${Ue.name}`),installedSkillNames:Xe.filter(Ue=>!Ue.skillsShSource).map(Ue=>Ue.name),writableMounts:ue,installedSkillPaths:Object.fromEntries(Xe.filter(Ue=>Ue.path).map(Ue=>[Ue.name,Ue.path]))})]})}function S1r({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:a,showInitWarning:s,onViewFileResult:i,onViewSkillResult:o}){const c=Cur(),u=Aur();return l.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(IT,{className:"h-4 w-4"}),"Search Indexed Files"]}),s&&l.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",l.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",l.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),l.jsx(Ivr,{onSearch:d=>c.mutate({...d,workspaceId:e}),isSearching:c.isPending,searchResults:c.data?{...c.data,results:c.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:r,canVector:a,onViewResult:i})]}),n&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(O$,{className:"h-4 w-4"}),"Search Skills"]}),l.jsx(Pvr,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>o(d.skillName,d.skillPath)})]})]})}function O1r(e,t){return e==null||t==null?null:e in t?e:null}function k1r(){const{skillName:e,workspaceId:t}=fs(),[n]=ll(),r=es(),a=e?decodeURIComponent(e):"",s=n.get("path"),i=s?decodeURIComponent(s):void 0,o=n.get("agentId"),c=o?decodeURIComponent(o):null,d=r.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=O1r(c,d),p=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[h,m]=x.useState(null),{data:g,isLoading:v,error:b}=Tur(a,{workspaceId:t,path:i}),{data:S}=b0t(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:O,isLoading:k}=Nur(a,h??"",{enabled:!!h,workspaceId:t,path:i}),E=C=>f?l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:p,children:[l.jsx(xe,{children:l.jsx(sD,{className:"h-4 w-4"})}),f]}),l.jsxs(_n,{as:"span",to:"",isCurrent:!0,children:[l.jsx(xe,{children:l.jsx(O$,{className:"h-4 w-4"})}),C]})]}):l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:p,children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(_n,{as:Ft,to:p,children:[l.jsx(xe,{children:l.jsx(O$,{className:"h-4 w-4"})}),"Skills"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:C})]});return v?l.jsxs(xn,{children:[l.jsx($n,{children:E("Loading...")}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):b&&ra(b)?l.jsxs(xn,{children:[l.jsx($n,{children:E("Permission Denied")}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"workspaces"})})]}):b||!g?l.jsxs(xn,{children:[l.jsx($n,{children:E("Error")}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),l.jsx("p",{className:"text-sm text-neutral3",children:b?.message??"Skill not found"})]})})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[E(g.name),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:l.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:l.jsx(qvr,{skill:g,rawSkillMd:S?.content,onReferenceClick:m})})}),l.jsx(Hvr,{open:!!h,onOpenChange:C=>!C&&m(null),skillName:g.name,referencePath:h??"",content:O?.content,isLoading:k})]})}function _1r({pathname:e}){const t=tSr();if(!t)return null;const{experiments:n,getVariant:r,setVariant:a}=t,s=e?n.filter(i=>!i.path||(Array.isArray(i.path)?i.path.includes(e):i.path===e)):n;return s.length===0?null:l.jsxs(nh,{children:[l.jsx(Kf,{asChild:!0,children:l.jsxs(he,{"aria-label":"Experimental UI",size:"sm",className:"mr-auto ml-3 bg-blue-600 text-white",children:[l.jsx(I4t,{})," UI"]})}),l.jsx(Vd,{side:"top",align:"start",className:"w-auto p-4",children:l.jsx("div",{className:"grid gap-4",children:s.map(i=>l.jsxs("div",{children:[l.jsx("span",{className:"text-ui-md text-neutral4",children:i.name}),l.jsx(U_,{value:r(i.key),onValueChange:o=>a(i.key,o),className:"mt-2",children:i.variants.map(o=>l.jsxs("label",{className:"flex items-center gap-3 text-ui-md text-neutral3 cursor-pointer",children:[l.jsx(xu,{value:o.value}),o.label]},o.value))})]},i.key))})})]})}const E1r=[{key:"main",links:[{name:"Agents",url:"/agents",icon:l.jsx($s,{}),isOnMastraPlatform:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:l.jsx(IT,{}),isOnMastraPlatform:!0},{name:"Workflows",url:"/workflows",icon:l.jsx(Mo,{}),isOnMastraPlatform:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:l.jsx(w4t,{}),isOnMastraPlatform:!1,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:l.jsx(Mu,{}),isOnMastraPlatform:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:l.jsx(vo,{}),isOnMastraPlatform:!0,requiredPermission:"tools:read"},{name:"Scorers",url:"/scorers",icon:l.jsx(nm,{}),isOnMastraPlatform:!0,requiredPermission:"scorers:read"},{name:"Workspaces",url:"/workspaces",icon:l.jsx(Eh,{}),isOnMastraPlatform:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:l.jsx(iQe,{}),isOnMastraPlatform:!0}]},{key:"observability",separator:!0,links:[{name:"Metrics",url:"/metrics",icon:l.jsx(rQe,{}),isOnMastraPlatform:!0,requiresExperimentalFeatures:!0,isExperimental:!0},{name:"Observability",url:"/observability",icon:l.jsx(S$,{}),isOnMastraPlatform:!0,requiredPermission:"observability:read"},{name:"Datasets",url:"/datasets",icon:l.jsx(Pc,{}),isOnMastraPlatform:!1,requiredPermission:"datasets:read"}]},{key:"Templates",separator:!0,links:[{name:"Templates",url:"/templates",icon:l.jsx(Ele,{}),isOnMastraPlatform:!1}]},{key:"Settings",separator:!0,links:[{name:"Settings",url:"/settings",icon:l.jsx(Bme,{}),isOnMastraPlatform:!1}]}],C1r={links:[{name:"Mastra APIs",url:"/swagger-ui",icon:l.jsx(E4t,{}),isOnMastraPlatform:!1},{name:"Documentation",url:"https://mastra.ai/en/docs",icon:l.jsx(Xl,{}),isOnMastraPlatform:!0},{name:"Github",url:"https://github.com/mastra-ai/mastra",icon:l.jsx(zme,{}),isOnMastraPlatform:!0},{name:"Community",url:"https://discord.gg/BTYqqHKUrf",icon:l.jsx(B4t,{}),isOnMastraPlatform:!0}]};function j1r(){const{state:e}=lwt(),n=lc().pathname,r=window?.MASTRA_HIDE_CLOUD_CTA==="true",a=window?.MASTRA_TEMPLATES==="true",{experimentalFeaturesEnabled:s}=wwt(),{isMastraPlatform:i}=gwt(),{data:o}=V_(),{isCmsAvailable:c,isLoading:u}=age(),{hasPermission:d,hasAnyPermission:f,rbacEnabled:p,isAuthenticated:h,isLoading:m}=_v(),g=o&&bR(o),v=new Set(["/prompts"]),b=S=>S.requiresExperimentalFeatures&&!s||v.has(S.url)&&!c&&!u||i&&!S.isOnMastraPlatform?!1:p&&h&&m?!0:!(S.requiredPermission&&!d(S.requiredPermission)||S.requiredAnyPermission&&!f(S.requiredAnyPermission));return l.jsxs(gc,{footerSlot:l.jsx(_1r,{pathname:n}),children:[l.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:e==="collapsed"?l.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[l.jsx(ib,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),g&&l.jsx(Ase,{})]}):g?l.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(ib,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),l.jsx(Ase,{})]}):l.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[l.jsx(ib,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),l.jsx(gc.Nav,{children:E1r.filter(S=>S.key==="Templates"?a:!0).map(S=>{const O=S.links.filter(b),k=O.length>0&&S?.separator;return l.jsxs(gc.NavSection,{children:[S?.title?l.jsx(gc.NavHeader,{state:e,children:S.title}):l.jsx(l.Fragment,{children:k&&l.jsx(gc.NavSeparator,{})}),l.jsx(gc.NavList,{children:O.map(E=>{const C=n.startsWith(E.url);return l.jsx(gc.NavLink,{state:e,link:E,isActive:C},E.name)})})]},S.key)})}),l.jsxs(gc.Bottom,{children:[l.jsx(gc.Nav,{children:l.jsxs(gc.NavSection,{children:[l.jsx(gc.NavSeparator,{}),l.jsxs(gc.NavList,{children:[C1r.links.filter(b).map(S=>l.jsx(gc.NavLink,{link:S,state:e},S.name)),!r&&!i?l.jsx(gc.NavLink,{link:{name:"Share",url:"https://mastra.ai/cloud",icon:l.jsx(y4t,{}),variant:"featured",tooltipMsg:"You're running Mastra Studio locally. Want your team to collaborate?",isOnMastraPlatform:!1},state:e}):null]})]})}),e!=="collapsed"&&l.jsxs(l.Fragment,{children:[l.jsx(gc.NavSeparator,{}),l.jsx(Tor,{collapsed:!1})]})]})]})}const T1r=x.createContext({theme:"dark",setTheme:()=>null}),N1r=e=>e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function h1t({children:e,defaultTheme:t="dark"}){const{themeToggleEnabled:n}=Gz(),r=Fr(o=>o.theme),a=Fr(o=>o.setTheme),i=n?r==="light"||r==="system"?r:"dark":t;return x.useEffect(()=>{const o=window.document.documentElement,c=f=>{const p=N1r(f);o.classList.remove("light","dark"),o.classList.add(p)};if(c(i),i!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>c("system");return u.addEventListener("change",d),()=>{u.removeEventListener("change",d)}},[i]),l.jsx(T1r.Provider,{value:{theme:i,setTheme:a},children:e})}const m1t=[{key:"entity-list-page",name:"Entity List page UI",path:["/agents","/prompts","/tools","/datasets","/scorers","/mcps","/workflows","/processors"],variants:[{value:"current",label:"Current state"},{value:"new-proposal",label:"New proposal"}]}],A1r=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"});function I1r({children:e}){const{data:t,isFetched:n}=V_(),r=n&&t?.enabled&&!bR(t),a=n&&!r,{pathname:s}=lc(),i=s==="/metrics",{variant:o}=Mv("entity-list-page"),c=m1t.find(f=>f.key==="entity-list-page"),u=Array.isArray(c?.path)?c.path:c?.path?[c.path]:[],d=o==="new-proposal"&&u.includes(s);return l.jsxs(l.Fragment,{children:[l.jsx(eyr,{}),l.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&l.jsx(j1r,{}),l.jsx("div",{className:Y("bg-surface2 my-3 rounded-lg border border-border1 overflow-y-auto mr-3",{"h-[calc(100%-1.5rem)] mx-3":r,"bg-transparent my-0 mr-0":d||i}),children:l.jsx(xwt,{children:e})})]})]})}const R1r=({children:e})=>{const{experimentalUIEnabled:t}=A1r();return l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(qat,{position:"bottom-right"}),l.jsx(h1t,{defaultTheme:"dark",attribute:"class",children:l.jsx(Fo,{delayDuration:0,children:l.jsx(rSr,{experiments:t?m1t:[],children:l.jsx(evr,{children:l.jsx(I1r,{children:e})})})})})]})},P1r=({children:e})=>l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(qat,{position:"bottom-right"}),l.jsx(h1t,{defaultTheme:"dark",attribute:"class",children:l.jsx(Fo,{delayDuration:0,children:l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx(xwt,{children:e})})})})]});function M1r({agentId:e}){return l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/agents",children:[l.jsx(xe,{children:l.jsx($s,{})}),"Agents"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(olr,{value:e,variant:"ghost"})})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Agents documentation"]})})]})}const D1r=({children:e})=>{const{agentId:t}=fs(),n=lc(),{isCmsAvailable:r}=age(),{hasObservability:a}=Ror(),s=EL.has("datasets"),i=r&&s,o=a&&s,{data:c}=qd(t),u=Nc(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,p=n.pathname.includes("/playground")?"versions":n.pathname.includes("/evaluate")?"evaluate":n.pathname.includes("/review")?"review":n.pathname.includes("/traces")?"traces":"chat",h=(p==="versions"||p==="evaluate"||p==="review")&&(i||o),m=l.jsxs(xn,{className:"grid-rows-[auto_auto_1fr]",children:[l.jsx(M1r,{agentId:t}),l.jsx(bfr,{agentId:t,activeTab:p,showPlayground:i,showObservability:o,rightSlot:h?l.jsx(xfr,{requestContextSchema:f}):void 0}),e]});return!i&&!o?m:l.jsx(Lz,{children:l.jsx(Dsr,{defaultProvider:u,defaultModel:d,children:l.jsx(sfr,{children:l.jsx($sr,{children:m})})})})};function $1r(){const{data:e={},isLoading:t,error:n}=yge(),{variant:r}=Mv("entity-list-page"),[a,s]=x.useState(""),i=!t&&Object.keys(e).length===0;return r==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:t,children:[l.jsx(sb,{})," Processors"]})}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Processors documentation",children:l.jsx(Xl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),l.jsx(Vfr,{processors:e,isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(sb,{})}),"Processors"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Processors documentation"]})})]}),l.jsx(gi,{isCentered:i,children:l.jsx(Lfr,{processors:e,isLoading:t,error:n})})]})}function L1r(){const{processorId:e}=fs(),{data:t,isLoading:n,error:r}=L0t(e);return r&&ra(r)?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/processors",children:[l.jsx(xe,{children:l.jsx(sb,{})}),"Processors"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"processors"})})]}):!n&&t?.isWorkflow?l.jsx(Vbr,{to:`/workflows/${e}/graph`,replace:!0}):n?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/processors",children:[l.jsx(xe,{children:l.jsx(sb,{})}),"Processors"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(In,{className:"h-6 w-32"})})]})}),l.jsxs("div",{className:"p-6",children:[l.jsx(In,{className:"h-8 w-48 mb-4"}),l.jsx(In,{className:"h-32 w-full"})]})]}):l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/processors",children:[l.jsx(xe,{children:l.jsx(sb,{})}),"Processors"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(Zfr,{value:e,variant:"ghost"})})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Processors documentation"]})})]}),l.jsx(Qfr,{processorId:e})]})}function F1r(){const{data:e={},isLoading:t}=rh(),{data:n={},isLoading:r,error:a}=e9(),{variant:s}=Mv("entity-list-page"),[i,o]=x.useState(""),c=t||r,u=Object.keys(n).length>0,d=Object.values(e).some(p=>p.tools&&Object.keys(p.tools).length>0),f=!c&&!u&&!d;return s==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:c,children:[l.jsx(vo,{})," Tools"]})}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Tools documentation",children:l.jsx(Xl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:o,label:"Filter tools",placeholder:"Filter by name"})})]}),l.jsx(npr,{tools:n,agents:e,isLoading:c,error:a,search:i,onSearch:o})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(vo,{})}),"Tools"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Tools documentation"]})})]}),l.jsx(gi,{isCentered:f,children:l.jsx(Kfr,{tools:n,agents:e,isLoading:c,error:a})})]})}const g1t={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,n,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${n?`&path=${encodeURIComponent(n)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,n)=>n?`/agents/${e}/chat/${t}?messageId=${n}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${Hi()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspacesLink:()=>"/workspaces",processorsLink:()=>"/processors",processorLink:e=>`/processors/${e}`,mcpServerLink:e=>`/mcps/${e}`,mcpServerToolLink:(e,t)=>`/mcps/${e}/tools/${t}`,workflowRunLink:(e,t)=>`/workflows/${e}/graph/${t}`,datasetLink:e=>`/datasets/${e}`,datasetItemLink:(e,t)=>`/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/datasets/${e}/experiments/${t}`},z1r=()=>{const e=qc(),t=n=>e(n,{viewTransition:!0});return l.jsx(Dyt,{Link:c1t,navigate:t,paths:g1t,children:l.jsx(R1r,{children:l.jsx(Qk,{})})})},B1r=()=>{const e=qc(),t=n=>e(n,{viewTransition:!0});return l.jsx(Dyt,{Link:c1t,navigate:t,paths:g1t,children:l.jsx(P1r,{children:l.jsx(Qk,{})})})},U1r=!!window.MASTRA_CLOUD_API_ENDPOINT,Cze=EL.has("datasets"),jze=[{index:!0,element:l.jsx(hSr,{})},{path:"instruction-blocks",element:l.jsx(mSr,{})},{path:"tools",element:l.jsx(bSr,{})},{path:"agents",element:l.jsx(dSr,{})},{path:"scorers",element:l.jsx(vSr,{})},{path:"workflows",element:l.jsx(wSr,{})},{path:"skills",element:l.jsx(ySr,{})},{path:"memory",element:l.jsx(gSr,{})},{path:"variables",element:l.jsx(xSr,{})}],V1r=[{path:"/login",element:l.jsx(LSr,{})},{path:"/signup",element:l.jsx(r1r,{})},{element:l.jsx(B1r,{}),children:[{path:"/agents/:agentId/session",element:l.jsx(vze,{})},{path:"/agents/:agentId/session/:threadId",element:l.jsx(vze,{})}]},{element:l.jsx(z1r,{}),children:[...U1r?[]:[{path:"/settings",element:l.jsx(n1r,{})},{path:"/templates",element:l.jsx(g1r,{})},{path:"/templates/:templateSlug",element:l.jsx(y1r,{})}],{path:"/scorers",element:l.jsx(KSr,{})},{path:"/scorers/:scorerId",element:l.jsx(JSr,{})},{path:"/metrics",element:l.jsx(USr,{})},{path:"/observability",element:l.jsx(ZSr,{})},{path:"/agents",element:l.jsx(aSr,{})},{path:"/cms/agents/create",element:l.jsx(fSr,{}),children:jze},{path:"/cms/agents/:agentId/edit",element:l.jsx(pSr,{}),children:jze},{path:"/cms/scorers/create",element:l.jsx(_Sr,{})},{path:"/cms/scorers/:scorerId/edit",element:l.jsx(CSr,{})},{path:"/prompts",element:l.jsx(YSr,{})},{path:"/cms/prompts/create",element:l.jsx(SSr,{})},{path:"/cms/prompts/:promptBlockId/edit",element:l.jsx(kSr,{})},{path:"/agents/:agentId/tools/:toolId",element:l.jsx(b1r,{})},{path:"/agents/:agentId",element:l.jsx(D1r,{children:l.jsx(Qk,{})}),children:[{index:!0,loader:({params:e})=>BJ(`/agents/${e.agentId}/chat`)},{path:"chat",element:l.jsx(gze,{})},{path:"chat/:threadId",element:l.jsx(gze,{})},...Cze?[{path:"playground",element:l.jsx(lSr,{})},{path:"evaluate",element:l.jsx(oSr,{})},{path:"review",element:l.jsx(cSr,{})}]:[],{path:"traces",element:l.jsx(uSr,{})}]},{path:"/tools",element:l.jsx(F1r,{})},{path:"/tools/:toolId",element:l.jsx(x1r,{})},{path:"/processors",element:l.jsx($1r,{})},{path:"/processors/:processorId",element:l.jsx(L1r,{})},{path:"/mcps",element:l.jsx(FSr,{})},{path:"/mcps/:serverId",element:l.jsx(zSr,{})},{path:"/mcps/:serverId/tools/:toolId",element:l.jsx(BSr,{})},{path:"/workspaces",element:l.jsx(Eze,{})},{path:"/workspaces/:workspaceId",element:l.jsx(Eze,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:l.jsx(k1r,{})},{path:"/workflows",element:l.jsx(w1r,{})},{path:"/workflows/:workflowId",element:l.jsx(jxr,{children:l.jsx(Qk,{})}),children:[{index:!0,loader:({params:e})=>BJ(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:l.jsx(_ze,{})},{path:"graph/:runId",element:l.jsx(_ze,{})}]},...Cze?[{path:"/datasets",element:l.jsx(jSr,{})},{path:"/datasets/:datasetId",element:l.jsx(TSr,{})},{path:"/datasets/:datasetId/items/:itemId",element:l.jsx(ISr,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:l.jsx(MSr,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:l.jsx(NSr,{})},{path:"/datasets/:datasetId/experiments",element:l.jsx(ASr,{})},{path:"/datasets/:datasetId/items",element:l.jsx(RSr,{})},{path:"/datasets/:datasetId/versions",element:l.jsx($Sr,{})}]:[],{index:!0,loader:()=>BJ("/agents")},{path:"/request-context",element:l.jsx(XSr,{})}]}];function q1r(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:a}=Gz();if(a)return null;if(!t)return l.jsx(Ior,{});const s=mxr(V1r,{basename:e});return l.jsx(B6t,{baseUrl:t,headers:n,apiPrefix:r,children:l.jsx(Jwr,{children:l.jsx(zbr,{router:s})})})}function H1r(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",n=window.MASTRA_SERVER_PORT||4111,r=window.MASTRA_API_PREFIX||"/api",a=window.MASTRA_CLOUD_API_ENDPOINT||"",s=window.MASTRA_AUTO_DETECT_URL==="true",i=window.MASTRA_THEME_TOGGLE==="true",o=a||(s?window.location.origin:`${e}://${t}:${n}`);return l.jsx(ivr,{children:l.jsx(Oor,{endpoint:o,defaultApiPrefix:r,themeToggleEnabled:i,children:l.jsx(q1r,{})})})}Ckt.createRoot(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(H1r,{})}));const tkr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{wet as A,hrt as B,ket as C,pnt as D,Bd as E,If as F,G1r as G,Rkt as H,Ga as I,tkr as J,rw as L,xet as N,CL as _,G5t as a,c6t as b,COr as c,OSe as d,sw as e,s6t as f,vO as g,l6t as h,Xw as i,Kw as j,Yw as k,Drn as l,xnt as m,J0 as n,us as o,Xnn as p,Ynn as q,Fue as r,Ble as s,fe as t,e4 as u,tu as v,K5t as w,vt as x,Je as y,$rt as z};
510
+ `).reduce((o,c)=>{if(!c||c.startsWith("#"))return o;const[u,d]=c.split("=");return u&&(o[u]=d?.split("")?.every(f=>f==="*")?"":d?.replaceAll('"',"")),o},{}):{}}const o1r=()=>jt({queryKey:["mastra-templates"],queryFn:f1t}),l1r=({repoOrSlug:e,owner:t})=>jt({queryKey:["template-repo",e,t],queryFn:()=>s1r({repoOrSlug:e,owner:t})}),c1r=({repo:e,owner:t,branch:n})=>jt({queryKey:["template-repo-env-vars",e,t,n],queryFn:()=>i1r({repo:e,owner:t,branch:n})}),u1r=()=>{const e=We();return jt({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},d1r=()=>{const e=We();return qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},f1r=()=>{const e=We();return qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},Oze=e=>{if(typeof e=="string")return e;if(e==null)return"Unknown error";if(e instanceof Error)return typeof e.message=="string"&&e.message.length>0?e.message:"Unknown error";if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)},kze=(e,t,n)=>{let r={...t};if(!(r.payload?.workflowState?.steps&&Object.keys(r.payload.workflowState.steps).length>0)&&n?.allSteps&&(r.payload={...r.payload,workflowState:{...r.payload?.workflowState,steps:Object.keys(n.allSteps).reduce((s,i)=>(s[i]={id:i,description:n.allSteps[i].description,status:"pending"},s),{})}}),e.type==="start"||e.type==="workflow-start"){const s={};n?.allSteps&&Object.entries(n.allSteps).forEach(([o,c])=>{s[o]={id:c.id,description:c.description,status:"pending"}});const i=e.runId||e.payload?.runId;r={...r,runId:i,eventTimestamp:new Date().toISOString(),status:"running",phase:"initializing",payload:{workflowState:{status:"running",steps:s},currentStep:null}}}if(e.type==="step-start"||e.type==="workflow-step-start"){const s=e.payload.id;r={...r,phase:"processing",payload:{...r.payload,currentStep:{id:s,status:"running",startTime:new Date,...e.payload},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[s]:{...r.payload.workflowState.steps[s],status:"running",startTime:new Date,...e.payload}}}}}}if(e.type==="step-result"||e.type==="workflow-step-result"){const s=e.payload.id,i=e.payload.status,o=e.payload.error;if(r={...r,payload:{...r.payload,currentStep:{...r.payload.currentStep,status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[s]:{...r.payload.workflowState.steps[s],status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date}}}}},i==="failed"&&o){const c=Oze(o);r={...r,status:"failed",error:c,phase:"error",failedStep:{id:s,error:c,description:e.payload.description||s},payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}}if((e.type==="step-finish"||e.type==="workflow-step-finish")&&(r={...r,payload:{...r.payload,currentStep:null}}),(e.type==="finish"||e.type==="workflow-finish")&&(r.phase==="error"||r.status==="failed"?r={...r,completedAt:new Date}:r={...r,status:e.payload.status||"completed",phase:"completed",payload:{...r.payload,currentStep:null,workflowState:{...r.payload.workflowState,status:e.payload.status||"completed"}},completedAt:new Date}),e.type==="error"){const s=Oze(e.payload.error);r={...r,status:"failed",error:s,phase:"error",payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}return{newState:r}},p1r=(e,t)=>{try{localStorage.setItem(`template-install-${e}`,JSON.stringify({state:t,timestamp:Date.now()}))}catch(n){console.warn("Failed to save template state to localStorage:",n)}},p1t=(e,t)=>{const[n,r]=x.useState({}),[a,s]=x.useState(!1);return{streamResult:n,isStreaming:a,processStream:async(o,c)=>{if(s(!0),r({}),!o)throw new Error("No stream returned");const u=o.getReader();let d={runId:c||t,eventTimestamp:new Date().toISOString(),phase:"running",payload:{workflowState:{steps:{}},currentStep:null}};try{for(;;){const{done:f,value:p}=await u.read();if(f)break;const{newState:h}=kze(p,d,e);if(d=h,r(h),p.runId||c||t){const m=p.runId||c||t;p1r(m,h)}}}catch(f){console.error("💥 [processStream] Error processing template installation stream:",f);const{newState:p}=kze({type:"error",payload:{error:f instanceof Error?f.message:"Unknown error"}},d,e);r(p)}finally{s(!1),u.releaseLock()}}}},h1r=e=>{const t=We(),{streamResult:n,isStreaming:r,processStream:a}=p1t(e);return{streamInstall:qn({mutationFn:async({inputData:i,selectedModel:o,runId:c})=>{for(let d=1;d<=3;d++)try{const f=t.getAgentBuilderAction("merge-template"),p=new YA;p.set("selectedModel",o);const h=await f.stream({inputData:i,requestContext:p},c);await a(h,c);return}catch(f){console.error(`💥 [streamInstall] Attempt ${d} failed:`,f);const p=f?.message?.includes("Failed to fetch")||f?.message?.includes("NetworkError")||f?.message?.includes("network error")||f?.message?.includes("fetch")||f?.code==="NETWORK_ERROR"||f?.name==="TypeError";if(console.warn(`Stream attempt ${d}/3 failed:`,f),p){const h=c?`Network error during template installation (likely hot reload). Please refresh the page to resume from where you left off using runId: ${c}`:"Network error during template installation (likely hot reload). Please try again.";throw console.error("🔌 Stream network error:",h),new Error(h)}throw console.error("❌ [streamInstall] Non-network error or max retries reached, throwing:",f),f}}}),streamResult:n,isStreaming:r}},m1r=e=>{const t=We(),{streamResult:n,isStreaming:r,processStream:a}=p1t(e);return{observeInstall:qn({mutationFn:async({runId:i})=>{for(let u=1;u<=3;u++)try{const f=await t.getAgentBuilderAction("merge-template").observeStream({runId:i});await a(f,i);return}catch(d){console.error(`💥 [observeInstall] Attempt ${u} failed:`,d);const f=d?.message?.includes("Failed to fetch")||d?.message?.includes("NetworkError")||d?.message?.includes("network error")||d?.message?.includes("fetch")||d?.code==="NETWORK_ERROR"||d?.name==="TypeError";if(console.warn(`ObserveStream attempt ${u}/3 failed:`,d),f&&u<3){console.info(`🔄 ObserveStream network error detected (likely hot reload), retrying in 2000ms... (attempt ${u+1}/3)`),await new Promise(p=>setTimeout(p,2e3));continue}throw console.error("❌ [observeInstall] Non-network error or max retries reached, throwing:",d),d}}}),streamResult:n,isStreaming:r}};function g1r(){const{data:e,isLoading:t}=o1r(),{templates:n,tags:r,providers:a}=e??{templates:[],tags:[],providers:[]},[s,i]=x.useState("all"),[o,c]=x.useState("all"),[u,d]=x.useState(""),f=[{value:"all",label:"Any tag"}];(r||[]).forEach(S=>{f.push({value:S,label:S})});const p=[{value:"all",label:"Any provider"}];(a||[]).forEach(S=>{p.push({value:S,label:S})});const h=(S,O)=>{O==="tag"?i(S):O==="provider"&&c(S)},m=S=>{d(S)},g=()=>{i("all"),c("all"),d("")},v=n.filter(S=>!(u&&!S.title.toLowerCase().includes(u)&&!S.description.toLowerCase().includes(u)||s!=="all"&&!S.tags.includes(s)||o!=="all"&&!S.supportedProviders.includes(o))),b=u||s!=="all"||o!=="all";return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Ele,{})}),"Templates"]})}),l.jsxs("div",{className:Y("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(ipr,{selectedTag:s,onTagChange:S=>h(S,"tag"),tagOptions:f,selectedProvider:o,onProviderChange:S=>h(S,"provider"),providerOptions:p,searchTerm:u,onSearchChange:m,onReset:b?g:void 0,className:"max-w-[80rem]",isLoading:t}),l.jsx(lpr,{templates:v,linkComponent:Ft,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const v1r="1.18.0-alpha.0";function y1r(){const{templateSlug:e}=fs(),[t,n]=ll(),[r,a]=x.useState(""),[s,i]=x.useState(""),[o,c]=x.useState(""),[u,d]=x.useState({}),[f,p]=x.useState([]),[h,m]=x.useState(null),[g,v]=x.useState(!1),[b,S]=x.useState(""),[O,k]=x.useState(!1),[E,C]=x.useState(!1),[T,j]=x.useState([]),{data:A,isLoading:I}=l1r({repoOrSlug:e,owner:"mastra-ai"}),M=v1r?.includes("beta")??!1?"beta":"main",{data:B,isLoading:D}=c1r({repo:A?.githubUrl?new URL(A.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:M}),{data:V,isLoading:q}=u1r(),{mutateAsync:z,isPending:H}=d1r(),{mutateAsync:G}=f1r(),{streamInstall:L,streamResult:Z,isStreaming:F}=h1r(V),{observeInstall:R,streamResult:Q,isStreaming:W}=m1r(V);x.useEffect(()=>{const ne=t.get("runId");ne&&!g&&!h&&!F&&!W&&(console.info("🔄 Checking completed run after hot reload:",{runId:ne}),S(ne),G({runId:ne}).then(ie=>{const ve=ie.snapshot;if(ve?.status==="success"&&ve?.result?.success)v(!0);else if(ve?.result?.success===!1)if(ve?.result?.validationResults&&!ve?.result?.validationResults?.valid&&ve?.result?.validationResults?.remainingErrors>0){const{remainingErrors:ke,errors:je}=ve.result.validationResults,me=`Template installation completed but ${ke} validation issue${ke>1?"s":""} remain unresolved.`;m(me),j(je||[])}else{const ke=ve?.result?.message||ve?.result?.error||"Template installation failed";m(typeof ke=="string"?ke:String(ke))}}).catch(ie=>{console.error("❌ Failed to fetch run details:",ie),m("Failed to retrieve installation status after reload")}))},[t,g,h,F,W,G]),x.useEffect(()=>{const ne=t.get("runId"),ie=t.get("resume"),ve=t.get("provider");if(ne&&ie==="true"&&ve&&!F&&!W&&!O&&!E&&V){S(ne),k(!0);try{G({runId:ne}).then(ge=>{if(ge.snapshot?.status==="running")return R.mutateAsync({runId:ne})}).then(()=>{n(ge=>{const ke=new URLSearchParams(ge);return ke.delete("resume"),ke})}).catch(ge=>{console.error("❌ Failed to resume template installation:",ge),ge.message?.includes("404")||ge.message?.includes("not found")?m("Template installation run not found. It may have expired or been completed."):m("Failed to resume template installation. Please try again.")})}catch(ge){console.error("❌ Auto-resume failed with error:",ge),m("Failed to resume template installation. Please refresh and try again.")}}},[t,e,F,W,O,E,V,G,R,n]);const te=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],se=[{key:"tools",label:"Tools",value:A?.tools?.length?A.tools.map(ne=>ne).join(", "):"n/a",icon:l.jsx(vo,{})},{key:"agents",label:"Agents",value:A?.agents?.length?A.agents.map(ne=>ne).join(", "):"n/a",icon:l.jsx($s,{})},{key:"workflows",label:"Workflows",value:A?.workflows?.length?A.workflows.map(ne=>ne).join(", "):"n/a",icon:l.jsx(c3t,{})},{key:"providers",label:"Providers",value:A?.supportedProviders?.length?A.supportedProviders.join(", "):"n/a",icon:l.jsx(u4t,{})},{key:"tags",label:"Tags",value:A?.tags?.length?A.tags.join(", "):"n/a",icon:l.jsx(r3t,{})}],re=[{...se[0]},{...se[1]},{...se[2]}].filter(ne=>ne.value!=="n/a");x.useEffect(()=>{B&&d(B)},[B]),x.useEffect(()=>{const ne=Z||Q;ne?.phase==="error"&&ne?.error&&m(typeof ne.error=="string"?ne.error:String(ne.error))},[Z?.phase,Z?.error,Q?.phase,Q?.error]);const ae=ne=>{a(ne)},oe=async ne=>(i(ne.provider),c(ne.modelId),{message:"Model updated successfully"}),de=async()=>{const ne=Object.entries(u).reduce((ie,[ve,ge])=>(ge===""&&ie.push(ve),ie),[]);if(ne.length>0){p(ne);return}if(A){m(null),v(!1),S(""),C(!0);try{const ve={repo:A.githubUrl||`https://github.com/mastra-ai/template-${A.slug}`,ref:M,slug:A.slug,variables:u},{runId:ge}=await z({});S(ge),n(ke=>{const je=new URLSearchParams(ke);return je.set("runId",ge),je.set("resume","true"),je.set("provider",r||"openai"),je}),await L.mutateAsync({inputData:ve,selectedModel:{provider:s,modelId:o},runId:ge})}catch(ie){C(!1),m(ie?.message||"Template installation failed"),console.error("Template installation failed",ie)}}},K=ne=>{const{name:ie,value:ve}=ne.target;ve.trim()===""?p(ge=>[...ge,ie]):p(ge=>ge.filter(ke=>ke!==ie)),d(ge=>({...ge,[ie]:ve}))};return l.jsxs(xn,{children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/templates",children:[l.jsx(xe,{children:l.jsx(Ele,{})}),"Templates"]}),l.jsx(_n,{as:Ft,to:`/templates/${A?.slug}`,isCurrent:!0,children:A?.title&&A.title})]})}),l.jsx("div",{className:Y("w-full lg:px-12 h-full overflow-y-scroll"),children:l.jsxs("div",{className:"p-6 w-full max-w-[80rem] mx-auto grid gap-y-4",children:[l.jsx(cpr,{isLoading:I,title:A?.title,description:A?.longDescription,imageURL:A?.imageURL,githubUrl:A?.githubUrl,infoData:se,templateSlug:e}),A&&l.jsxs(l.Fragment,{children:[(F||W)&&l.jsx(mpr,{name:A.title,streamResult:W?Q:Z,runId:b,workflowInfo:V}),g&&l.jsx(gpr,{name:A.title,installedEntities:re,linkComponent:Ft}),h&&l.jsx(vpr,{errorMsg:h,validationErrors:T.length>0?T:Z?.validationResults?.errors||Q?.validationResults?.errors}),!F&&!W&&!g&&!h&&l.jsx(upr,{providerOptions:te,selectedProvider:r,onProviderChange:ae,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:de,handleVariableChange:K,isLoadingEnvVars:D||q,isInstalling:H,defaultModelProvider:s,defaultModelId:o,onModelUpdate:oe})]})]})})]})}const b1r=()=>{const{toolId:e,agentId:t}=fs();return l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/agents",children:[l.jsx(xe,{children:l.jsx($s,{})}),"Agents"]}),l.jsx(_n,{as:Ft,to:`/agents/${t}/chat`,children:t}),l.jsx(_n,{as:Ft,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Tools documentation"]})})]}),l.jsx(flr,{toolId:e,agentId:t})]})},x1r=()=>{const{toolId:e}=fs();return l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/tools",children:[l.jsx(xe,{children:l.jsx(vo,{})}),"Tools"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(spr,{value:e,variant:"ghost"})})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Tools documentation"]})})]}),l.jsx(apr,{toolId:e})]})};function w1r(){const{data:e,isLoading:t,error:n}=Cv(),{variant:r}=Mv("entity-list-page"),[a,s]=x.useState(""),i=!t&&Object.keys(e||{}).length===0;return r==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:t,children:[l.jsx(Mo,{})," Workflows"]})}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Workflows documentation",children:l.jsx(Xl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:s,label:"Filter workflows",placeholder:"Filter by name or description"})})]}),l.jsx(Iar,{workflows:e||{},isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Mo,{})}),"Workflows"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Workflows documentation"]})})]}),l.jsx(gi,{isCentered:i,children:l.jsx(bar,{workflows:e||{},isLoading:t,error:n})})]})}const _ze=()=>{const{workflowId:e}=fs(),{data:t,isLoading:n,error:r}=vR(e);return r&&ra(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"workflows"})}):l.jsx(nbt,{workflowId:e,workflow:t??void 0,isLoading:n})};function Eze(){const{workspaceId:e}=fs(),[t,n]=ll(),r=qc(),[a,s]=x.useState(!1),[i,o]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(null),[p,h]=x.useState(null),[m,g]=x.useState(!1),v=t.get("file"),b=t.get("tab"),{data:S,error:O,isLoading:k}=y0t(),E=S?.workspaces??[],C=e??E[0]?.id,{data:T,isLoading:j,error:A}=Sur(C),I=ra(O)||ra(A),P=t.get("path")||".",M=Qre(O)||Qre(A),B=C?E.find(Ue=>Ue.id===C):void 0,D=Ue=>{const tt=new URLSearchParams(t);for(const[Ke,it]of Object.entries(Ue))it===null?tt.delete(Ke):tt.set(Ke,it);n(tt)},V=Ue=>{g(!1),s(!1),r(`/workspaces/${Ue}`)},q=Ue=>{D({path:Ue==="."||Ue===""?null:Ue,file:null})},z=Ue=>{D({file:Ue})},H=Ue=>{D({tab:Ue})},G=P,L=v,{data:Z,isLoading:F,error:R,refetch:Q}=Our(G,{enabled:T?.isWorkspaceConfigured&&T?.capabilities?.hasFilesystem,workspaceId:C}),W=_ur(),te=Eur(),{data:se,isLoading:re}=b0t(L??"",{enabled:!!L,workspaceId:C}),{data:ae,isLoading:oe,refetch:de}=jur({workspaceId:C}),K=Mur(),ne=Dur(),ie=$ur(),ve=T?.isWorkspaceConfigured??!1,ge=T?.capabilities?.hasFilesystem??!1,ke=T?.capabilities?.hasSkills??!1,je=T?.capabilities?.canBM25??!1,me=T?.capabilities?.canVector??!1,_e=B?.safety?.readOnly??!1,J=ge&&!_e,X=T?.mounts,ue=X?.filter(Ue=>!Ue.readOnly).map(Ue=>({path:Ue.path,displayName:Ue.displayName,icon:Ue.icon,provider:Ue.provider,name:Ue.name})),ye=X&&X.length>1?X.map(Ue=>Ue.path):void 0,Ce=x.useCallback(Ue=>{C&&K.mutate({...Ue,workspaceId:C},{onSuccess:async tt=>{if(tt.success){u(!1);const{data:Ke,error:it}=await de();if(it||!Ke){De.success(`Skill "${tt.skillName}" installed successfully (${tt.filesWritten} files)`);return}Ke.skills.some(mt=>mt.name===tt.skillName)?De.success(`Skill "${tt.skillName}" installed successfully (${tt.filesWritten} files)`):(g(!0),De.warning(`Skill "${tt.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else De.error("Failed to install skill")},onError:tt=>{De.error(`Failed to install skill: ${tt instanceof Error?tt.message:"Unknown error"}`)}})},[C,K,de]),le=x.useCallback(Ue=>{C&&(h(Ue),ne.mutate({workspaceId:C,skillName:Ue},{onSuccess:tt=>{if(h(null),tt.updated.length>0){const Ke=tt.updated[0];Ke.success?(De.success(`Skill "${Ue}" updated successfully (${Ke.filesWritten} files)`),de()):De.error(`Failed to update skill: ${Ke.error??"Unknown error"}`)}else De.error("Failed to update skill: No update result returned")},onError:tt=>{h(null),De.error(`Failed to update skill: ${tt instanceof Error?tt.message:"Unknown error"}`)}}))},[C,ne,de]),we=x.useCallback(Ue=>{C&&(f(Ue),ie.mutate({workspaceId:C,skillName:Ue},{onSuccess:tt=>{f(null),tt.success?(De.success(`Skill "${tt.skillName}" removed successfully`),de()):De.error(`Failed to remove skill "${tt.skillName}"`)},onError:tt=>{f(null),De.error(`Failed to remove skill: ${tt instanceof Error?tt.message:"Unknown error"}`)}}))},[C,ie,de]),Me=b==="files"&&ge?"files":b==="skills"&&ke?"skills":ge?"files":ke?"skills":"files",Xe=ae?.skills??[],Ot=ae?.isSkillsConfigured??!1,Wt=Z?.entries??[],wn=ge&&(je||me),It=ke&&Ot&&Xe.length>0,rt=wn||It;return I?l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"workspaces"})})]}):M?l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[l.jsx(HD,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Eh,{})}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[l.jsx("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-amber-500/10 mb-6",children:l.jsx(Xee,{className:"h-8 w-8 text-amber-500"})}),l.jsx("h2",{className:"text-xl font-semibold text-neutral6 mb-2",children:"Workspace Not Supported"}),l.jsxs("p",{className:"text-neutral4 max-w-md mb-6",children:["The workspace feature requires a newer version of ",l.jsx("code",{className:"text-neutral5",children:"@mastra/core"}),". Please upgrade your dependencies to enable workspace functionality."]}),l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Learn More"]})]})]})})]}):k?l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Jt,{})})]}):!j&&!k&&!ve?l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start h-full w-full",children:[l.jsx(HD,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Eh,{})}),l.jsx(Avr,{})]})})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(Xa,{children:[rt&&l.jsxs(he,{variant:"light",onClick:()=>s(!a),children:[l.jsx(xe,{children:l.jsx(e3t,{className:"h-4 w-4"})}),"Search"]}),l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Workspaces documentation"]})]})]}),l.jsx("div",{className:"grid overflow-y-auto h-full",children:l.jsxs("div",{className:"max-w-[100rem] px-[3rem] mx-auto grid content-start gap-6 h-full w-full",children:[l.jsx(HD,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Eh,{})}),E.length>1&&l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>o(!i),className:"flex items-center gap-2 px-3 py-2 text-sm border border-border1 rounded-lg bg-surface2 hover:bg-surface3 transition-colors w-full max-w-md",children:[B?.source==="agent"?l.jsx(sD,{className:"h-4 w-4 text-accent1"}):l.jsx(U7,{className:"h-4 w-4 text-neutral4"}),l.jsxs("span",{className:"flex-1 text-left truncate",children:[B?.name??"Select workspace",B?.source==="agent"&&B.agentName&&l.jsxs("span",{className:"text-neutral4 ml-1",children:["(",B.agentName,")"]})]}),l.jsx(g4t,{className:`h-4 w-4 text-neutral4 transition-transform ${i?"rotate-180":""}`})]}),i&&l.jsx("div",{className:"absolute z-50 mt-1 w-full max-w-md bg-surface2 border border-border1 rounded-lg shadow-lg overflow-hidden",children:E.map(Ue=>l.jsxs("button",{onClick:()=>{V(Ue.id),o(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${B?.id===Ue.id?"bg-surface3":""}`,children:[Ue.source==="agent"?l.jsx(sD,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):l.jsx(U7,{className:"h-4 w-4 text-neutral4 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-medium text-neutral6 truncate",children:Ue.name}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:Ue.source==="agent"?`Agent: ${Ue.agentName}`:"Global workspace"})]}),l.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[Ue.safety?.readOnly&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"}),Ue.capabilities.hasFilesystem&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Ue.capabilities.hasSandbox&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Ue.capabilities.hasSkills&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Ue.id))})]}),E.length===1&&B&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[B.source==="agent"?l.jsx(sD,{className:"h-4 w-4 text-accent1"}):l.jsx(U7,{className:"h-4 w-4"}),l.jsx("span",{children:B.name}),B.source==="agent"&&B.agentName&&l.jsxs("span",{className:"text-neutral3",children:["(",B.agentName,")"]}),_e&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),a&&rt&&C&&l.jsx(S1r,{workspaceId:C,canSearchFiles:wn,canSearchSkills:It,canBM25:je,canVector:me,showInitWarning:!j&&T?.status!=="ready",onViewFileResult:Ue=>{D({file:Ue,tab:"files"})},onViewSkillResult:(Ue,tt)=>{C&&r(`/workspaces/${C}/skills/${encodeURIComponent(Ue)}?path=${encodeURIComponent(tt)}`)}},C),l.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[ge&&l.jsxs("button",{onClick:()=>H("files"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Me==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(IT,{className:"h-4 w-4"}),"Files"]}),ke&&l.jsxs("button",{onClick:()=>H("skills"),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Me==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(O$,{className:"h-4 w-4"}),"Skills",Ot&&Xe.length>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:Xe.length})]})]}),l.jsxs("div",{className:"pb-8",children:[Me==="files"&&ge&&l.jsx("div",{className:"space-y-4",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(Cvr,{entries:Wt,currentPath:G,isLoading:F,error:R,onNavigate:q,onFileSelect:z,onRefresh:()=>Q(),onCreateDirectory:_e?void 0:Ue=>te.mutate({path:Ue,workspaceId:C}),onDelete:_e?void 0:Ue=>W.mutate({path:Ue,recursive:!0,force:!0,workspaceId:C})}),L&&l.jsx(Nvr,{path:L,content:se?.content??"",isLoading:re,mimeType:se?.mimeType,onClose:()=>z(null)})]})}),Me==="skills"&&ke&&l.jsx(zvr,{skills:Xe,isLoading:oe,isSkillsConfigured:Ot,hasUndiscoveredAgentSkills:m,basePath:C?`/workspaces/${C}/skills`:"/workspaces",onAddSkill:J?()=>u(!0):void 0,onUpdateSkill:J?le:void 0,onRemoveSkill:J?we:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:ye}),!ge&&!ke&&l.jsx("div",{className:"py-12 text-center text-neutral4",children:l.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),C&&J&&l.jsx(Qvr,{open:c,onOpenChange:u,workspaceId:C,onInstall:Ce,isInstalling:K.isPending,installedSkillIds:Xe.filter(Ue=>Ue.skillsShSource).map(Ue=>`${Ue.skillsShSource.owner}/${Ue.skillsShSource.repo}/${Ue.name}`),installedSkillNames:Xe.filter(Ue=>!Ue.skillsShSource).map(Ue=>Ue.name),writableMounts:ue,installedSkillPaths:Object.fromEntries(Xe.filter(Ue=>Ue.path).map(Ue=>[Ue.name,Ue.path]))})]})}function S1r({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:a,showInitWarning:s,onViewFileResult:i,onViewSkillResult:o}){const c=Cur(),u=Aur();return l.jsxs("div",{className:"border border-border1 rounded-lg p-4 bg-surface2 space-y-4",children:[t&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(IT,{className:"h-4 w-4"}),"Search Indexed Files"]}),s&&l.jsxs("p",{className:"text-xs text-amber-400 mb-3",children:["File search requires ",l.jsx("code",{className:"text-amber-300",children:"workspace.init()"})," to index files from your configured ",l.jsx("code",{className:"text-amber-300",children:"autoIndexPaths"}),"."]}),l.jsx(Ivr,{onSearch:d=>c.mutate({...d,workspaceId:e}),isSearching:c.isPending,searchResults:c.data?{...c.data,results:c.data.results.filter(d=>!d.id.startsWith("skill:"))}:void 0,canBM25:r,canVector:a,onViewResult:i})]}),n&&l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-neutral5 mb-3 flex items-center gap-2",children:[l.jsx(O$,{className:"h-4 w-4"}),"Search Skills"]}),l.jsx(Pvr,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>o(d.skillName,d.skillPath)})]})]})}function O1r(e,t){return e==null||t==null?null:e in t?e:null}function k1r(){const{skillName:e,workspaceId:t}=fs(),[n]=ll(),r=es(),a=e?decodeURIComponent(e):"",s=n.get("path"),i=s?decodeURIComponent(s):void 0,o=n.get("agentId"),c=o?decodeURIComponent(o):null,d=r.getQueriesData({queryKey:["agents"]})?.[0]?.[1]??null,f=O1r(c,d),p=f?`/agents/${f}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[h,m]=x.useState(null),{data:g,isLoading:v,error:b}=Tur(a,{workspaceId:t,path:i}),{data:S}=b0t(g?.path?`${g.path}/SKILL.md`:"",{enabled:!!g?.path,workspaceId:t}),{data:O,isLoading:k}=Nur(a,h??"",{enabled:!!h,workspaceId:t,path:i}),E=C=>f?l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:p,children:[l.jsx(xe,{children:l.jsx(sD,{className:"h-4 w-4"})}),f]}),l.jsxs(_n,{as:"span",to:"",isCurrent:!0,children:[l.jsx(xe,{children:l.jsx(O$,{className:"h-4 w-4"})}),C]})]}):l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:p,children:[l.jsx(xe,{children:l.jsx(Eh,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(_n,{as:Ft,to:p,children:[l.jsx(xe,{children:l.jsx(O$,{className:"h-4 w-4"})}),"Skills"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:C})]});return v?l.jsxs(xn,{children:[l.jsx($n,{children:E("Loading...")}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsx("div",{className:"h-8 w-8 border-2 border-accent1 border-t-transparent rounded-full animate-spin"})})]}):b&&ra(b)?l.jsxs(xn,{children:[l.jsx($n,{children:E("Permission Denied")}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"workspaces"})})]}):b||!g?l.jsxs(xn,{children:[l.jsx($n,{children:E("Error")}),l.jsx("div",{className:"grid place-items-center h-full",children:l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load skill"}),l.jsx("p",{className:"text-sm text-neutral3",children:b?.message??"Skill not found"})]})})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[E(g.name),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[l.jsx(xe,{children:l.jsx(fi,{})}),"Documentation"]})})]}),l.jsx("div",{className:"grid overflow-y-auto overflow-x-hidden h-full",children:l.jsx("div",{className:"max-w-[100rem] px-[3rem] mx-auto py-8 h-full w-full overflow-x-hidden",children:l.jsx(qvr,{skill:g,rawSkillMd:S?.content,onReferenceClick:m})})}),l.jsx(Hvr,{open:!!h,onOpenChange:C=>!C&&m(null),skillName:g.name,referencePath:h??"",content:O?.content,isLoading:k})]})}function _1r({pathname:e}){const t=tSr();if(!t)return null;const{experiments:n,getVariant:r,setVariant:a}=t,s=e?n.filter(i=>!i.path||(Array.isArray(i.path)?i.path.includes(e):i.path===e)):n;return s.length===0?null:l.jsxs(nh,{children:[l.jsx(Kf,{asChild:!0,children:l.jsxs(he,{"aria-label":"Experimental UI",size:"sm",className:"mr-auto ml-3 bg-blue-600 text-white",children:[l.jsx(I4t,{})," UI"]})}),l.jsx(Vd,{side:"top",align:"start",className:"w-auto p-4",children:l.jsx("div",{className:"grid gap-4",children:s.map(i=>l.jsxs("div",{children:[l.jsx("span",{className:"text-ui-md text-neutral4",children:i.name}),l.jsx(U_,{value:r(i.key),onValueChange:o=>a(i.key,o),className:"mt-2",children:i.variants.map(o=>l.jsxs("label",{className:"flex items-center gap-3 text-ui-md text-neutral3 cursor-pointer",children:[l.jsx(xu,{value:o.value}),o.label]},o.value))})]},i.key))})})]})}const E1r=[{key:"main",links:[{name:"Agents",url:"/agents",icon:l.jsx($s,{}),isOnMastraPlatform:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:l.jsx(IT,{}),isOnMastraPlatform:!0},{name:"Workflows",url:"/workflows",icon:l.jsx(Mo,{}),isOnMastraPlatform:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:l.jsx(w4t,{}),isOnMastraPlatform:!1,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:l.jsx(Mu,{}),isOnMastraPlatform:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:l.jsx(vo,{}),isOnMastraPlatform:!0,requiredPermission:"tools:read"},{name:"Scorers",url:"/scorers",icon:l.jsx(nm,{}),isOnMastraPlatform:!0,requiredPermission:"scorers:read"},{name:"Workspaces",url:"/workspaces",icon:l.jsx(Eh,{}),isOnMastraPlatform:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:l.jsx(iQe,{}),isOnMastraPlatform:!0}]},{key:"observability",separator:!0,links:[{name:"Metrics",url:"/metrics",icon:l.jsx(rQe,{}),isOnMastraPlatform:!0,requiresExperimentalFeatures:!0,isExperimental:!0},{name:"Observability",url:"/observability",icon:l.jsx(S$,{}),isOnMastraPlatform:!0,requiredPermission:"observability:read"},{name:"Datasets",url:"/datasets",icon:l.jsx(Pc,{}),isOnMastraPlatform:!1,requiredPermission:"datasets:read"}]},{key:"Templates",separator:!0,links:[{name:"Templates",url:"/templates",icon:l.jsx(Ele,{}),isOnMastraPlatform:!1}]},{key:"Settings",separator:!0,links:[{name:"Settings",url:"/settings",icon:l.jsx(Bme,{}),isOnMastraPlatform:!1}]}],C1r={links:[{name:"Mastra APIs",url:"/swagger-ui",icon:l.jsx(E4t,{}),isOnMastraPlatform:!1},{name:"Documentation",url:"https://mastra.ai/en/docs",icon:l.jsx(Xl,{}),isOnMastraPlatform:!0},{name:"Github",url:"https://github.com/mastra-ai/mastra",icon:l.jsx(zme,{}),isOnMastraPlatform:!0},{name:"Community",url:"https://discord.gg/BTYqqHKUrf",icon:l.jsx(B4t,{}),isOnMastraPlatform:!0}]};function j1r(){const{state:e}=lwt(),n=lc().pathname,r=window?.MASTRA_HIDE_CLOUD_CTA==="true",a=window?.MASTRA_TEMPLATES==="true",{experimentalFeaturesEnabled:s}=wwt(),{isMastraPlatform:i}=gwt(),{data:o}=V_(),{isCmsAvailable:c,isLoading:u}=age(),{hasPermission:d,hasAnyPermission:f,rbacEnabled:p,isAuthenticated:h,isLoading:m}=_v(),g=o&&bR(o),v=new Set(["/prompts"]),b=S=>S.requiresExperimentalFeatures&&!s||v.has(S.url)&&!c&&!u||i&&!S.isOnMastraPlatform?!1:p&&h&&m?!0:!(S.requiredPermission&&!d(S.requiredPermission)||S.requiredAnyPermission&&!f(S.requiredAnyPermission));return l.jsxs(gc,{footerSlot:l.jsx(_1r,{pathname:n}),children:[l.jsx("div",{className:"pt-3 mb-4 -ml-0.5 sticky top-0 bg-surface1 z-10",children:e==="collapsed"?l.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[l.jsx(ib,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),g&&l.jsx(Ase,{})]}):g?l.jsxs("span",{className:"flex items-center justify-between pl-3 pr-2",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(ib,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),l.jsx(Ase,{})]}):l.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[l.jsx(ib,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),l.jsx(gc.Nav,{children:E1r.filter(S=>S.key==="Templates"?a:!0).map(S=>{const O=S.links.filter(b),k=O.length>0&&S?.separator;return l.jsxs(gc.NavSection,{children:[S?.title?l.jsx(gc.NavHeader,{state:e,children:S.title}):l.jsx(l.Fragment,{children:k&&l.jsx(gc.NavSeparator,{})}),l.jsx(gc.NavList,{children:O.map(E=>{const C=n.startsWith(E.url);return l.jsx(gc.NavLink,{state:e,link:E,isActive:C},E.name)})})]},S.key)})}),l.jsxs(gc.Bottom,{children:[l.jsx(gc.Nav,{children:l.jsxs(gc.NavSection,{children:[l.jsx(gc.NavSeparator,{}),l.jsxs(gc.NavList,{children:[C1r.links.filter(b).map(S=>l.jsx(gc.NavLink,{link:S,state:e},S.name)),!r&&!i?l.jsx(gc.NavLink,{link:{name:"Share",url:"https://mastra.ai/cloud",icon:l.jsx(y4t,{}),variant:"featured",tooltipMsg:"You're running Mastra Studio locally. Want your team to collaborate?",isOnMastraPlatform:!1},state:e}):null]})]})}),e!=="collapsed"&&l.jsxs(l.Fragment,{children:[l.jsx(gc.NavSeparator,{}),l.jsx(Tor,{collapsed:!1})]})]})]})}const T1r=x.createContext({theme:"dark",setTheme:()=>null}),N1r=e=>e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function h1t({children:e,defaultTheme:t="dark"}){const{themeToggleEnabled:n}=Gz(),r=Fr(o=>o.theme),a=Fr(o=>o.setTheme),i=n?r==="light"||r==="system"?r:"dark":t;return x.useEffect(()=>{const o=window.document.documentElement,c=f=>{const p=N1r(f);o.classList.remove("light","dark"),o.classList.add(p)};if(c(i),i!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>c("system");return u.addEventListener("change",d),()=>{u.removeEventListener("change",d)}},[i]),l.jsx(T1r.Provider,{value:{theme:i,setTheme:a},children:e})}const m1t=[{key:"entity-list-page",name:"Entity List page UI",path:["/agents","/prompts","/tools","/datasets","/scorers","/mcps","/workflows","/processors"],variants:[{value:"current",label:"Current state"},{value:"new-proposal",label:"New proposal"}]}],A1r=()=>({experimentalUIEnabled:typeof window<"u"&&window.MASTRA_EXPERIMENTAL_UI==="true"});function I1r({children:e}){const{data:t,isFetched:n}=V_(),r=n&&t?.enabled&&!bR(t),a=n&&!r,{pathname:s}=lc(),i=s==="/metrics",{variant:o}=Mv("entity-list-page"),c=m1t.find(f=>f.key==="entity-list-page"),u=Array.isArray(c?.path)?c.path:c?.path?[c.path]:[],d=o==="new-proposal"&&u.includes(s);return l.jsxs(l.Fragment,{children:[l.jsx(eyr,{}),l.jsxs("div",{className:a?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[a&&l.jsx(j1r,{}),l.jsx("div",{className:Y("bg-surface2 my-3 rounded-lg border border-border1 overflow-y-auto mr-3",{"h-[calc(100%-1.5rem)] mx-3":r,"bg-transparent my-0 mr-0":d||i}),children:l.jsx(xwt,{children:e})})]})]})}const R1r=({children:e})=>{const{experimentalUIEnabled:t}=A1r();return l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(qat,{position:"bottom-right"}),l.jsx(h1t,{defaultTheme:"dark",attribute:"class",children:l.jsx(Fo,{delayDuration:0,children:l.jsx(rSr,{experiments:t?m1t:[],children:l.jsx(evr,{children:l.jsx(I1r,{children:e})})})})})]})},P1r=({children:e})=>l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(qat,{position:"bottom-right"}),l.jsx(h1t,{defaultTheme:"dark",attribute:"class",children:l.jsx(Fo,{delayDuration:0,children:l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx(xwt,{children:e})})})})]});function M1r({agentId:e}){return l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/agents",children:[l.jsx(xe,{children:l.jsx($s,{})}),"Agents"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(olr,{value:e,variant:"ghost"})})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Agents documentation"]})})]})}const D1r=({children:e})=>{const{agentId:t}=fs(),n=lc(),{isCmsAvailable:r}=age(),{hasObservability:a}=Ror(),s=EL.has("datasets"),i=r&&s,o=a&&s,{data:c}=qd(t),u=Nc(c?.provider??""),d=c?.modelId??"",f=c?.requestContextSchema,p=n.pathname.includes("/playground")?"versions":n.pathname.includes("/evaluate")?"evaluate":n.pathname.includes("/review")?"review":n.pathname.includes("/traces")?"traces":"chat",h=(p==="versions"||p==="evaluate"||p==="review")&&(i||o),m=l.jsxs(xn,{className:"grid-rows-[auto_auto_1fr]",children:[l.jsx(M1r,{agentId:t}),l.jsx(bfr,{agentId:t,activeTab:p,showPlayground:i,showObservability:o,rightSlot:h?l.jsx(xfr,{requestContextSchema:f}):void 0}),e]});return!i&&!o?m:l.jsx(Lz,{children:l.jsx(Dsr,{defaultProvider:u,defaultModel:d,children:l.jsx(sfr,{children:l.jsx($sr,{children:m})})})})};function $1r(){const{data:e={},isLoading:t,error:n}=yge(),{variant:r}=Mv("entity-list-page"),[a,s]=x.useState(""),i=!t&&Object.keys(e).length===0;return r==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:t,children:[l.jsx(sb,{})," Processors"]})}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Processors documentation",children:l.jsx(Xl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:s,label:"Filter processors",placeholder:"Filter by name"})})]}),l.jsx(Vfr,{processors:e,isLoading:t,error:n,search:a,onSearch:s})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(sb,{})}),"Processors"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Processors documentation"]})})]}),l.jsx(gi,{isCentered:i,children:l.jsx(Lfr,{processors:e,isLoading:t,error:n})})]})}function L1r(){const{processorId:e}=fs(),{data:t,isLoading:n,error:r}=L0t(e);return r&&ra(r)?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/processors",children:[l.jsx(xe,{children:l.jsx(sb,{})}),"Processors"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Ta,{resource:"processors"})})]}):!n&&t?.isWorkflow?l.jsx(Vbr,{to:`/workflows/${e}/graph`,replace:!0}):n?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx($n,{children:l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/processors",children:[l.jsx(xe,{children:l.jsx(sb,{})}),"Processors"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(In,{className:"h-6 w-32"})})]})}),l.jsxs("div",{className:"p-6",children:[l.jsx(In,{className:"h-8 w-48 mb-4"}),l.jsx(In,{className:"h-32 w-full"})]})]}):l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs($n,{children:[l.jsxs(Xs,{children:[l.jsxs(_n,{as:Ft,to:"/processors",children:[l.jsx(xe,{children:l.jsx(sb,{})}),"Processors"]}),l.jsx(_n,{as:"span",to:"",isCurrent:!0,children:l.jsx(Zfr,{value:e,variant:"ghost"})})]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Processors documentation"]})})]}),l.jsx(Qfr,{processorId:e})]})}function F1r(){const{data:e={},isLoading:t}=rh(),{data:n={},isLoading:r,error:a}=e9(),{variant:s}=Mv("entity-list-page"),[i,o]=x.useState(""),c=t||r,u=Object.keys(n).length>0,d=Object.values(e).some(p=>p.tools&&Object.keys(p.tools).length>0),f=!c&&!u&&!d;return s==="new-proposal"?l.jsxs(co,{children:[l.jsxs(co.Top,{children:[l.jsxs(ht,{withMargins:!1,children:[l.jsx(ht.Column,{children:l.jsxs(ht.Title,{isLoading:c,children:[l.jsx(vo,{})," Tools"]})}),l.jsx(ht.Column,{className:"flex justify-end gap-2",children:l.jsx(hi,{as:"a",href:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",rel:"noopener noreferrer",tooltipContent:"Go to Tools documentation",children:l.jsx(Xl,{})})})]}),l.jsx("div",{className:"max-w-[30rem]",children:l.jsx(ox,{onSearch:o,label:"Filter tools",placeholder:"Filter by name"})})]}),l.jsx(npr,{tools:n,agents:e,isLoading:c,error:a,search:i,onSearch:o})]}):l.jsxs(xn,{children:[l.jsxs($n,{children:[l.jsxs(Ya,{children:[l.jsx(xe,{children:l.jsx(vo,{})}),"Tools"]}),l.jsx(Xa,{children:l.jsxs(he,{as:Ft,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(fi,{}),"Tools documentation"]})})]}),l.jsx(gi,{isCentered:f,children:l.jsx(Kfr,{tools:n,agents:e,isLoading:c,error:a})})]})}const g1t={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,n,r)=>r?`/workspaces/${r}/skills/${encodeURIComponent(t)}?agentId=${encodeURIComponent(e)}${n?`&path=${encodeURIComponent(n)}`:""}`:"/workspaces",agentsLink:()=>"/agents",agentNewThreadLink:e=>`/agents/${e}/chat/new`,agentThreadLink:(e,t,n)=>n?`/agents/${e}/chat/${t}?messageId=${n}`:`/agents/${e}/chat/${t}`,workflowsLink:()=>"/workflows",workflowLink:e=>`/workflows/${e}`,networkLink:e=>`/networks/v-next/${e}/chat`,networkNewThreadLink:e=>`/networks/v-next/${e}/chat/${Hi()}`,networkThreadLink:(e,t)=>`/networks/v-next/${e}/chat/${t}`,scorerLink:e=>`/scorers/${e}`,cmsScorersCreateLink:()=>"/cms/scorers/create",cmsScorerEditLink:e=>`/cms/scorers/${e}/edit`,cmsAgentCreateLink:()=>"/cms/agents/create",cmsAgentEditLink:e=>`/cms/agents/${e}/edit`,promptBlockLink:e=>`/prompts/${e}`,promptBlocksLink:()=>"/prompts",cmsPromptBlockCreateLink:()=>"/cms/prompts/create",cmsPromptBlockEditLink:e=>`/cms/prompts/${e}/edit`,toolLink:e=>`/tools/${e}`,skillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${encodeURIComponent(e)}${t?`?path=${encodeURIComponent(t)}`:""}`:"/workspaces",workspacesLink:()=>"/workspaces",processorsLink:()=>"/processors",processorLink:e=>`/processors/${e}`,mcpServerLink:e=>`/mcps/${e}`,mcpServerToolLink:(e,t)=>`/mcps/${e}/tools/${t}`,workflowRunLink:(e,t)=>`/workflows/${e}/graph/${t}`,datasetLink:e=>`/datasets/${e}`,datasetItemLink:(e,t)=>`/datasets/${e}/items/${t}`,datasetExperimentLink:(e,t)=>`/datasets/${e}/experiments/${t}`},z1r=()=>{const e=qc(),t=n=>e(n,{viewTransition:!0});return l.jsx(Dyt,{Link:c1t,navigate:t,paths:g1t,children:l.jsx(R1r,{children:l.jsx(Qk,{})})})},B1r=()=>{const e=qc(),t=n=>e(n,{viewTransition:!0});return l.jsx(Dyt,{Link:c1t,navigate:t,paths:g1t,children:l.jsx(P1r,{children:l.jsx(Qk,{})})})},U1r=!!window.MASTRA_CLOUD_API_ENDPOINT,Cze=EL.has("datasets"),jze=[{index:!0,element:l.jsx(hSr,{})},{path:"instruction-blocks",element:l.jsx(mSr,{})},{path:"tools",element:l.jsx(bSr,{})},{path:"agents",element:l.jsx(dSr,{})},{path:"scorers",element:l.jsx(vSr,{})},{path:"workflows",element:l.jsx(wSr,{})},{path:"skills",element:l.jsx(ySr,{})},{path:"memory",element:l.jsx(gSr,{})},{path:"variables",element:l.jsx(xSr,{})}],V1r=[{path:"/login",element:l.jsx(LSr,{})},{path:"/signup",element:l.jsx(r1r,{})},{element:l.jsx(B1r,{}),children:[{path:"/agents/:agentId/session",element:l.jsx(vze,{})},{path:"/agents/:agentId/session/:threadId",element:l.jsx(vze,{})}]},{element:l.jsx(z1r,{}),children:[...U1r?[]:[{path:"/settings",element:l.jsx(n1r,{})},{path:"/templates",element:l.jsx(g1r,{})},{path:"/templates/:templateSlug",element:l.jsx(y1r,{})}],{path:"/scorers",element:l.jsx(KSr,{})},{path:"/scorers/:scorerId",element:l.jsx(JSr,{})},{path:"/metrics",element:l.jsx(USr,{})},{path:"/observability",element:l.jsx(ZSr,{})},{path:"/agents",element:l.jsx(aSr,{})},{path:"/cms/agents/create",element:l.jsx(fSr,{}),children:jze},{path:"/cms/agents/:agentId/edit",element:l.jsx(pSr,{}),children:jze},{path:"/cms/scorers/create",element:l.jsx(_Sr,{})},{path:"/cms/scorers/:scorerId/edit",element:l.jsx(CSr,{})},{path:"/prompts",element:l.jsx(YSr,{})},{path:"/cms/prompts/create",element:l.jsx(SSr,{})},{path:"/cms/prompts/:promptBlockId/edit",element:l.jsx(kSr,{})},{path:"/agents/:agentId/tools/:toolId",element:l.jsx(b1r,{})},{path:"/agents/:agentId",element:l.jsx(D1r,{children:l.jsx(Qk,{})}),children:[{index:!0,loader:({params:e})=>BJ(`/agents/${e.agentId}/chat`)},{path:"chat",element:l.jsx(gze,{})},{path:"chat/:threadId",element:l.jsx(gze,{})},...Cze?[{path:"playground",element:l.jsx(lSr,{})},{path:"evaluate",element:l.jsx(oSr,{})},{path:"review",element:l.jsx(cSr,{})}]:[],{path:"traces",element:l.jsx(uSr,{})}]},{path:"/tools",element:l.jsx(F1r,{})},{path:"/tools/:toolId",element:l.jsx(x1r,{})},{path:"/processors",element:l.jsx($1r,{})},{path:"/processors/:processorId",element:l.jsx(L1r,{})},{path:"/mcps",element:l.jsx(FSr,{})},{path:"/mcps/:serverId",element:l.jsx(zSr,{})},{path:"/mcps/:serverId/tools/:toolId",element:l.jsx(BSr,{})},{path:"/workspaces",element:l.jsx(Eze,{})},{path:"/workspaces/:workspaceId",element:l.jsx(Eze,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:l.jsx(k1r,{})},{path:"/workflows",element:l.jsx(w1r,{})},{path:"/workflows/:workflowId",element:l.jsx(jxr,{children:l.jsx(Qk,{})}),children:[{index:!0,loader:({params:e})=>BJ(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:l.jsx(_ze,{})},{path:"graph/:runId",element:l.jsx(_ze,{})}]},...Cze?[{path:"/datasets",element:l.jsx(jSr,{})},{path:"/datasets/:datasetId",element:l.jsx(TSr,{})},{path:"/datasets/:datasetId/items/:itemId",element:l.jsx(ISr,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:l.jsx(MSr,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:l.jsx(NSr,{})},{path:"/datasets/:datasetId/experiments",element:l.jsx(ASr,{})},{path:"/datasets/:datasetId/items",element:l.jsx(RSr,{})},{path:"/datasets/:datasetId/versions",element:l.jsx($Sr,{})}]:[],{index:!0,loader:()=>BJ("/agents")},{path:"/request-context",element:l.jsx(XSr,{})}]}];function q1r(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:a}=Gz();if(a)return null;if(!t)return l.jsx(Ior,{});const s=mxr(V1r,{basename:e});return l.jsx(B6t,{baseUrl:t,headers:n,apiPrefix:r,children:l.jsx(Jwr,{children:l.jsx(zbr,{router:s})})})}function H1r(){const e=window.MASTRA_SERVER_PROTOCOL||"http",t=window.MASTRA_SERVER_HOST||"localhost",n=window.MASTRA_SERVER_PORT||4111,r=window.MASTRA_API_PREFIX||"/api",a=window.MASTRA_CLOUD_API_ENDPOINT||"",s=window.MASTRA_AUTO_DETECT_URL==="true",i=window.MASTRA_THEME_TOGGLE==="true",o=a||(s?window.location.origin:`${e}://${t}:${n}`);return l.jsx(ivr,{children:l.jsx(Oor,{endpoint:o,defaultApiPrefix:r,themeToggleEnabled:i,children:l.jsx(q1r,{})})})}Ckt.createRoot(document.getElementById("root")).render(l.jsx(x.StrictMode,{children:l.jsx(H1r,{})}));const tkr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{wet as A,hrt as B,ket as C,pnt as D,Bd as E,If as F,G1r as G,Rkt as H,Ga as I,tkr as J,rw as L,xet as N,CL as _,G5t as a,c6t as b,COr as c,OSe as d,sw as e,s6t as f,vO as g,l6t as h,Xw as i,Kw as j,Yw as k,Drn as l,xnt as m,J0 as n,us as o,Xnn as p,Ynn as q,Fue as r,Ble as s,fe as t,e4 as u,tu as v,K5t as w,vt as x,Je as y,$rt as z};