@mastra/deployer-cloud 1.15.0-alpha.2 → 1.15.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/studio/assets/{chunk-ZCJMLMGS-UBJWRUy6.js → chunk-ZCJMLMGS-ywyJ2T_n.js} +1 -1
- package/dist/studio/assets/{index-DN58jL8t.js → index-B1rhwhE7.js} +1 -1
- package/dist/studio/assets/{index-DJriR7yS.js → index-BJMc51Hz.js} +1 -1
- package/dist/studio/assets/{index-DU38eqy6.js → index-BhR-xhPW.js} +1 -1
- package/dist/studio/assets/{index-BJLZpMwN.js → index-BmdI5Etm.js} +1 -1
- package/dist/studio/assets/{index-Dq7bjvJV.js → index-Bo-k2QR6.js} +1 -1
- package/dist/studio/assets/{index-2WKb2JXV.js → index-BvLhhfBj.js} +1 -1
- package/dist/studio/assets/{index-DW-r7c5D.js → index-D3kQdmAX.js} +1 -1
- package/dist/studio/assets/{index-Bw4uFMdt.js → index-D6FzeZM6.js} +1 -1
- package/dist/studio/assets/{index-wONkO2F2.js → index-DDnnd4IP.js} +1 -1
- package/dist/studio/assets/{index-DFDYXtiQ.js → index-DUBeZ9vI.js} +1 -1
- package/dist/studio/assets/{index-DQJr6Gv5.js → index-U38BugWW.js} +1 -1
- package/dist/studio/assets/{index-BWN90KeJ.js → index-YV0XHlhV.js} +1 -1
- package/dist/studio/assets/{index-DN6hwH_A.js → index-ZrOwCgQi.js} +1 -1
- package/dist/studio/assets/{index-CvWCPr5d.js → index-ipntDTZg.js} +1 -1
- package/dist/studio/assets/{index-CHvHWf0T.js → index-khWoa2hy.js} +1 -1
- package/dist/studio/assets/{index-CWCYUog7.js → index-mipr_ryQ.js} +1 -1
- package/dist/studio/assets/{index-BDu36wuR.js → index-vKFuEiUr.js} +1 -1
- package/dist/studio/assets/{index-DHagWC3Q.js → index-wIotD8Zx.js} +1 -1
- package/dist/studio/assets/{main-BulFryyp.js → main-Brb2jPV1.js} +6 -6
- package/dist/studio/assets/{token-APYSY3BW-RPVF55TR--RVNSBkE.js → token-APYSY3BW-RPVF55TR-DPjuHLW9.js} +1 -1
- package/dist/studio/assets/token-util-RMHT2CPJ-VVUHOXBL-Ca9Odi-N.js +1 -0
- package/dist/studio/index.html +1 -1
- package/package.json +6 -6
- package/dist/studio/assets/token-util-RMHT2CPJ-VVUHOXBL-Dz7dvBZ8.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{_ as He}from"./index-wONkO2F2.js";function Cje(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var RI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bL={exports:{}},xO={};var Vue;function uit(){if(Vue)return xO;Vue=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var o=null;if(a!==void 0&&(o=""+a),s.key!==void 0&&(o=""+s.key),"key"in s){a={};for(var i in s)i!=="key"&&(a[i]=s[i])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:a}}return xO.Fragment=t,xO.jsx=n,xO.jsxs=n,xO}var que;function dit(){return que||(que=1,bL.exports=uit()),bL.exports}var l=dit(),yL={exports:{}},ar={},Hue;function fit(){if(Hue)return ar;Hue=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=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 g(z){return z===null||typeof z!="object"?null:(z=h&&z[h]||z["@@iterator"],typeof z=="function"?z:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(z,I,Q){this.props=z,this.context=I,this.refs=x,this.updater=Q||b}w.prototype.isReactComponent={},w.prototype.setState=function(z,I){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,I,"setState")},w.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function O(){}O.prototype=w.prototype;function k(z,I,Q){this.props=z,this.context=I,this.refs=x,this.updater=Q||b}var E=k.prototype=new O;E.constructor=k,y(E,w.prototype),E.isPureReactComponent=!0;var C=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function R(z,I,Q){var W=Q.ref;return{$$typeof:t,type:z,key:I,ref:W!==void 0?W:null,props:Q}}function P(z,I){return R(z.type,I,z.props)}function M(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function U(z){var I={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Q){return I[Q]})}var D=/\/+/g;function q(z,I){return typeof z=="object"&&z!==null&&z.key!=null?U(""+z.key):I.toString(36)}function V(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(N,N):(z.status="pending",z.then(function(I){z.status==="pending"&&(z.status="fulfilled",z.value=I)},function(I){z.status==="pending"&&(z.status="rejected",z.reason=I)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function B(z,I,Q,W,J){var ne=typeof z;(ne==="undefined"||ne==="boolean")&&(z=null);var te=!1;if(z===null)te=!0;else switch(ne){case"bigint":case"string":case"number":te=!0;break;case"object":switch(z.$$typeof){case t:case n:te=!0;break;case f:return te=z._init,B(te(z._payload),I,Q,W,J)}}if(te)return J=J(z),te=W===""?"."+q(z,0):W,C(J)?(Q="",te!=null&&(Q=te.replace(D,"$&/")+"/"),B(J,I,Q,"",function(ve){return ve})):J!=null&&(M(J)&&(J=P(J,Q+(J.key==null||z&&z.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+te)),I.push(J)),1;te=0;var ae=W===""?".":W+":";if(C(z))for(var ce=0;ce<z.length;ce++)W=z[ce],ne=ae+q(W,ce),te+=B(W,I,Q,ne,J);else if(ce=g(z),typeof ce=="function")for(z=ce.call(z),ce=0;!(W=z.next()).done;)W=W.value,ne=ae+q(W,ce++),te+=B(W,I,Q,ne,J);else if(ne==="object"){if(typeof z.then=="function")return B(V(z),I,Q,W,J);throw I=String(z),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return te}function H(z,I,Q){if(z==null)return z;var W=[],J=0;return B(z,W,"","",function(ne){return I.call(Q,ne,J++)}),W}function G(z){if(z._status===-1){var I=z._result;I=I(),I.then(function(Q){(z._status===0||z._status===-1)&&(z._status=1,z._result=Q)},function(Q){(z._status===0||z._status===-1)&&(z._status=2,z._result=Q)}),z._status===-1&&(z._status=0,z._result=I)}if(z._status===1)return z._result.default;throw z._result}var L=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(I))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",z);return}console.error(z)},Z={map:H,forEach:function(z,I,Q){H(z,function(){I.apply(this,arguments)},Q)},count:function(z){var I=0;return H(z,function(){I++}),I},toArray:function(z){return H(z,function(I){return I})||[]},only:function(z){if(!M(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return ar.Activity=p,ar.Children=Z,ar.Component=w,ar.Fragment=r,ar.Profiler=a,ar.PureComponent=k,ar.StrictMode=s,ar.Suspense=u,ar.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ar.__COMPILER_RUNTIME={__proto__:null,c:function(z){return T.H.useMemoCache(z)}},ar.cache=function(z){return function(){return z.apply(null,arguments)}},ar.cacheSignal=function(){return null},ar.cloneElement=function(z,I,Q){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var W=y({},z.props),J=z.key;if(I!=null)for(ne in I.key!==void 0&&(J=""+I.key),I)!j.call(I,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&I.ref===void 0||(W[ne]=I[ne]);var ne=arguments.length-2;if(ne===1)W.children=Q;else if(1<ne){for(var te=Array(ne),ae=0;ae<ne;ae++)te[ae]=arguments[ae+2];W.children=te}return R(z.type,J,W)},ar.createContext=function(z){return z={$$typeof:i,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:o,_context:z},z},ar.createElement=function(z,I,Q){var W,J={},ne=null;if(I!=null)for(W in I.key!==void 0&&(ne=""+I.key),I)j.call(I,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(J[W]=I[W]);var te=arguments.length-2;if(te===1)J.children=Q;else if(1<te){for(var ae=Array(te),ce=0;ce<te;ce++)ae[ce]=arguments[ce+2];J.children=ae}if(z&&z.defaultProps)for(W in te=z.defaultProps,te)J[W]===void 0&&(J[W]=te[W]);return R(z,ne,J)},ar.createRef=function(){return{current:null}},ar.forwardRef=function(z){return{$$typeof:c,render:z}},ar.isValidElement=M,ar.lazy=function(z){return{$$typeof:f,_payload:{_status:-1,_result:z},_init:G}},ar.memo=function(z,I){return{$$typeof:d,type:z,compare:I===void 0?null:I}},ar.startTransition=function(z){var I=T.T,Q={};T.T=Q;try{var W=z(),J=T.S;J!==null&&J(Q,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(N,L)}catch(ne){L(ne)}finally{I!==null&&Q.types!==null&&(I.types=Q.types),T.T=I}},ar.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ar.use=function(z){return T.H.use(z)},ar.useActionState=function(z,I,Q){return T.H.useActionState(z,I,Q)},ar.useCallback=function(z,I){return T.H.useCallback(z,I)},ar.useContext=function(z){return T.H.useContext(z)},ar.useDebugValue=function(){},ar.useDeferredValue=function(z,I){return T.H.useDeferredValue(z,I)},ar.useEffect=function(z,I){return T.H.useEffect(z,I)},ar.useEffectEvent=function(z){return T.H.useEffectEvent(z)},ar.useId=function(){return T.H.useId()},ar.useImperativeHandle=function(z,I,Q){return T.H.useImperativeHandle(z,I,Q)},ar.useInsertionEffect=function(z,I){return T.H.useInsertionEffect(z,I)},ar.useLayoutEffect=function(z,I){return T.H.useLayoutEffect(z,I)},ar.useMemo=function(z,I){return T.H.useMemo(z,I)},ar.useOptimistic=function(z,I){return T.H.useOptimistic(z,I)},ar.useReducer=function(z,I,Q){return T.H.useReducer(z,I,Q)},ar.useRef=function(z){return T.H.useRef(z)},ar.useState=function(z){return T.H.useState(z)},ar.useSyncExternalStore=function(z,I,Q){return T.H.useSyncExternalStore(z,I,Q)},ar.useTransition=function(){return T.H.useTransition()},ar.version="19.2.4",ar}var Que;function LS(){return Que||(Que=1,yL.exports=fit()),yL.exports}var S=LS();const be=vu(S),FS=Cje({__proto__:null,default:be},[S]);var vL={exports:{}},wO={},xL={exports:{}},wL={};var Gue;function pit(){return Gue||(Gue=1,(function(e){function t(V,B){var H=V.length;V.push(B);e:for(;0<H;){var G=H-1>>>1,L=V[G];if(0<s(L,B))V[G]=B,V[H]=L,H=G;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var B=V[0],H=V.pop();if(H!==B){V[0]=H;e:for(var G=0,L=V.length,Z=L>>>1;G<Z;){var z=2*(G+1)-1,I=V[z],Q=z+1,W=V[Q];if(0>s(I,H))Q<L&&0>s(W,I)?(V[G]=W,V[Q]=H,G=Q):(V[G]=I,V[z]=H,G=z);else if(Q<L&&0>s(W,H))V[G]=W,V[Q]=H,G=Q;else break e}}return B}function s(V,B){var H=V.sortIndex-B.sortIndex;return H!==0?H:V.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,i=o.now();e.unstable_now=function(){return o.now()-i}}var c=[],u=[],d=1,f=null,p=3,h=!1,g=!1,b=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function k(V){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=V)r(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function E(V){if(b=!1,k(V),!g)if(n(c)!==null)g=!0,C||(C=!0,M());else{var B=n(u);B!==null&&q(E,B.startTime-V)}}var C=!1,N=-1,T=5,j=-1;function R(){return y?!0:!(e.unstable_now()-j<T)}function P(){if(y=!1,C){var V=e.unstable_now();j=V;var B=!0;try{e:{g=!1,b&&(b=!1,w(N),N=-1),h=!0;var H=p;try{t:{for(k(V),f=n(c);f!==null&&!(f.expirationTime>V&&R());){var G=f.callback;if(typeof G=="function"){f.callback=null,p=f.priorityLevel;var L=G(f.expirationTime<=V);if(V=e.unstable_now(),typeof L=="function"){f.callback=L,k(V),B=!0;break t}f===n(c)&&r(c),k(V)}else r(c);f=n(c)}if(f!==null)B=!0;else{var Z=n(u);Z!==null&&q(E,Z.startTime-V),B=!1}}break e}finally{f=null,p=H,h=!1}B=void 0}}finally{B?M():C=!1}}}var M;if(typeof O=="function")M=function(){O(P)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,D=U.port2;U.port1.onmessage=P,M=function(){D.postMessage(null)}}else M=function(){x(P,0)};function q(V,B){N=x(function(){V(e.unstable_now())},B)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(V){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var H=p;p=B;try{return V()}finally{p=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(V,B){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var H=p;p=V;try{return B()}finally{p=H}},e.unstable_scheduleCallback=function(V,B,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,V){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,V={id:d++,callback:B,priorityLevel:V,startTime:H,expirationTime:L,sortIndex:-1},H>G?(V.sortIndex=H,t(u,V),n(c)===null&&V===n(u)&&(b?(w(N),N=-1):b=!0,q(E,H-G))):(V.sortIndex=L,t(c,V),g||h||(g=!0,C||(C=!0,M()))),V},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(V){var B=p;return function(){var H=p;p=B;try{return V.apply(this,arguments)}finally{p=H}}}})(wL)),wL}var Wue;function hit(){return Wue||(Wue=1,xL.exports=pit()),xL.exports}var SL={exports:{}},$i={};var Zue;function mit(){if(Zue)return $i;Zue=1;var e=LS();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},s=Symbol.for("react.portal");function a(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function i(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return $i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$i.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 a(c,u,null,d)},$i.flushSync=function(c){var u=o.T,d=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=u,r.p=d,r.d.f()}},$i.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))},$i.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},$i.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=i(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})}},$i.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=i(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)},$i.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=i(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})}},$i.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=i(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)},$i.requestFormReset=function(c){r.d.r(c)},$i.unstable_batchedUpdates=function(c,u){return c(u)},$i.useFormState=function(c,u,d){return o.H.useFormState(c,u,d)},$i.useFormStatus=function(){return o.H.useHostTransitionStatus()},$i.version="19.2.4",$i}var Yue;function Tje(){if(Yue)return SL.exports;Yue=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(),SL.exports=mit(),SL.exports}var Xue;function git(){if(Xue)return wO;Xue=1;var e={env:{}};var t=hit(),n=LS(),r=Tje();function s(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)v+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(m){return!(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)}function o(m){var v=m,_=m;if(m.alternate)for(;v.return;)v=v.return;else{m=v;do v=m,(v.flags&4098)!==0&&(_=v.return),m=v.return;while(m)}return v.tag===3?_:null}function i(m){if(m.tag===13){var v=m.memoizedState;if(v===null&&(m=m.alternate,m!==null&&(v=m.memoizedState)),v!==null)return v.dehydrated}return null}function c(m){if(m.tag===31){var v=m.memoizedState;if(v===null&&(m=m.alternate,m!==null&&(v=m.memoizedState)),v!==null)return v.dehydrated}return null}function u(m){if(o(m)!==m)throw Error(s(188))}function d(m){var v=m.alternate;if(!v){if(v=o(m),v===null)throw Error(s(188));return v!==m?null:m}for(var _=m,A=v;;){var $=_.return;if($===null)break;var F=$.alternate;if(F===null){if(A=$.return,A!==null){_=A;continue}break}if($.child===F.child){for(F=$.child;F;){if(F===_)return u($),m;if(F===A)return u($),v;F=F.sibling}throw Error(s(188))}if(_.return!==A.return)_=$,A=F;else{for(var Y=!1,oe=$.child;oe;){if(oe===_){Y=!0,_=$,A=F;break}if(oe===A){Y=!0,A=$,_=F;break}oe=oe.sibling}if(!Y){for(oe=F.child;oe;){if(oe===_){Y=!0,_=F,A=$;break}if(oe===A){Y=!0,A=F,_=$;break}oe=oe.sibling}if(!Y)throw Error(s(189))}}if(_.alternate!==A)throw Error(s(190))}if(_.tag!==3)throw Error(s(188));return _.stateNode.current===_?m:v}function f(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(v=f(m),v!==null)return v;m=m.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=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"),N=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function U(m){return m===null||typeof m!="object"?null:(m=M&&m[M]||m["@@iterator"],typeof m=="function"?m:null)}var D=Symbol.for("react.client.reference");function q(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===D?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case C:return"Suspense";case N:return"SuspenseList";case R:return"Activity"}if(typeof m=="object")switch(m.$$typeof){case b:return"Portal";case k:return m.displayName||"Context";case O:return(m._context.displayName||"Context")+".Consumer";case E:var v=m.render;return m=m.displayName,m||(m=v.displayName||v.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case T:return v=m.displayName||null,v!==null?v:q(m.type)||"Memo";case j:v=m._payload,m=m._init;try{return q(m(v))}catch{}}return null}var V=Array.isArray,B=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 z(m){return{current:m}}function I(m){0>Z||(m.current=L[Z],L[Z]=null,Z--)}function Q(m,v){Z++,L[Z]=m.current,m.current=v}var W=z(null),J=z(null),ne=z(null),te=z(null);function ae(m,v){switch(Q(ne,v),Q(J,m),Q(W,null),v.nodeType){case 9:case 11:m=(m=v.documentElement)&&(m=m.namespaceURI)?fue(m):0;break;default:if(m=v.tagName,v=v.namespaceURI)v=fue(v),m=pue(v,m);else switch(m){case"svg":m=1;break;case"math":m=2;break;default:m=0}}I(W),Q(W,m)}function ce(){I(W),I(J),I(ne)}function ve(m){m.memoizedState!==null&&Q(te,m);var v=W.current,_=pue(v,m.type);v!==_&&(Q(J,m),Q(W,_))}function ee(m){J.current===m&&(I(W),I(J)),te.current===m&&(I(te),gO._currentValue=G)}var re,ie;function ge(m){if(re===void 0)try{throw Error()}catch(_){var v=_.stack.trim().match(/\n( *(at )?)/);re=v&&v[1]||"",ie=-1<_.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BmdI5Etm.js","./index-DDnnd4IP.js","./index-YV0XHlhV.js","./index-BvLhhfBj.js","./index-vKFuEiUr.js","./index-U38BugWW.js","./index-DUBeZ9vI.js","./index-ZrOwCgQi.js","./index-D6FzeZM6.js","./index-B1rhwhE7.js","./index-mipr_ryQ.js","./index-BJMc51Hz.js","./index-ipntDTZg.js","./index-D3kQdmAX.js","./index-Bo-k2QR6.js","./dockerfile-BKs6k2Af.js","./simple-mode-GW_nhZxv.js","./factor-kuTfRLto.js","./nsis-LdVXkNf5.js","./pug-DeIclll2.js","./javascript-iXu5QeM3.js","./index-khWoa2hy.js","./index-BhR-xhPW.js","./token-util-RMHT2CPJ-VVUHOXBL-Ca9Odi-N.js","./chunk-ZCJMLMGS-ywyJ2T_n.js","./token-APYSY3BW-RPVF55TR-DPjuHLW9.js","./index-wIotD8Zx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as He}from"./index-DDnnd4IP.js";function Cje(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var RI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bL={exports:{}},xO={};var Vue;function uit(){if(Vue)return xO;Vue=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var o=null;if(a!==void 0&&(o=""+a),s.key!==void 0&&(o=""+s.key),"key"in s){a={};for(var i in s)i!=="key"&&(a[i]=s[i])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:a}}return xO.Fragment=t,xO.jsx=n,xO.jsxs=n,xO}var que;function dit(){return que||(que=1,bL.exports=uit()),bL.exports}var l=dit(),yL={exports:{}},ar={},Hue;function fit(){if(Hue)return ar;Hue=1;var e={env:{}};var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=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 g(z){return z===null||typeof z!="object"?null:(z=h&&z[h]||z["@@iterator"],typeof z=="function"?z:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(z,I,Q){this.props=z,this.context=I,this.refs=x,this.updater=Q||b}w.prototype.isReactComponent={},w.prototype.setState=function(z,I){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,I,"setState")},w.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function O(){}O.prototype=w.prototype;function k(z,I,Q){this.props=z,this.context=I,this.refs=x,this.updater=Q||b}var E=k.prototype=new O;E.constructor=k,y(E,w.prototype),E.isPureReactComponent=!0;var C=Array.isArray;function N(){}var T={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function R(z,I,Q){var W=Q.ref;return{$$typeof:t,type:z,key:I,ref:W!==void 0?W:null,props:Q}}function P(z,I){return R(z.type,I,z.props)}function M(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function U(z){var I={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Q){return I[Q]})}var D=/\/+/g;function q(z,I){return typeof z=="object"&&z!==null&&z.key!=null?U(""+z.key):I.toString(36)}function V(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(N,N):(z.status="pending",z.then(function(I){z.status==="pending"&&(z.status="fulfilled",z.value=I)},function(I){z.status==="pending"&&(z.status="rejected",z.reason=I)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function B(z,I,Q,W,J){var ne=typeof z;(ne==="undefined"||ne==="boolean")&&(z=null);var te=!1;if(z===null)te=!0;else switch(ne){case"bigint":case"string":case"number":te=!0;break;case"object":switch(z.$$typeof){case t:case n:te=!0;break;case f:return te=z._init,B(te(z._payload),I,Q,W,J)}}if(te)return J=J(z),te=W===""?"."+q(z,0):W,C(J)?(Q="",te!=null&&(Q=te.replace(D,"$&/")+"/"),B(J,I,Q,"",function(ve){return ve})):J!=null&&(M(J)&&(J=P(J,Q+(J.key==null||z&&z.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+te)),I.push(J)),1;te=0;var ae=W===""?".":W+":";if(C(z))for(var ce=0;ce<z.length;ce++)W=z[ce],ne=ae+q(W,ce),te+=B(W,I,Q,ne,J);else if(ce=g(z),typeof ce=="function")for(z=ce.call(z),ce=0;!(W=z.next()).done;)W=W.value,ne=ae+q(W,ce++),te+=B(W,I,Q,ne,J);else if(ne==="object"){if(typeof z.then=="function")return B(V(z),I,Q,W,J);throw I=String(z),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return te}function H(z,I,Q){if(z==null)return z;var W=[],J=0;return B(z,W,"","",function(ne){return I.call(Q,ne,J++)}),W}function G(z){if(z._status===-1){var I=z._result;I=I(),I.then(function(Q){(z._status===0||z._status===-1)&&(z._status=1,z._result=Q)},function(Q){(z._status===0||z._status===-1)&&(z._status=2,z._result=Q)}),z._status===-1&&(z._status=0,z._result=I)}if(z._status===1)return z._result.default;throw z._result}var L=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(I))return}else if(typeof e=="object"&&typeof e.emit=="function"){e.emit("uncaughtException",z);return}console.error(z)},Z={map:H,forEach:function(z,I,Q){H(z,function(){I.apply(this,arguments)},Q)},count:function(z){var I=0;return H(z,function(){I++}),I},toArray:function(z){return H(z,function(I){return I})||[]},only:function(z){if(!M(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return ar.Activity=p,ar.Children=Z,ar.Component=w,ar.Fragment=r,ar.Profiler=a,ar.PureComponent=k,ar.StrictMode=s,ar.Suspense=u,ar.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ar.__COMPILER_RUNTIME={__proto__:null,c:function(z){return T.H.useMemoCache(z)}},ar.cache=function(z){return function(){return z.apply(null,arguments)}},ar.cacheSignal=function(){return null},ar.cloneElement=function(z,I,Q){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var W=y({},z.props),J=z.key;if(I!=null)for(ne in I.key!==void 0&&(J=""+I.key),I)!j.call(I,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&I.ref===void 0||(W[ne]=I[ne]);var ne=arguments.length-2;if(ne===1)W.children=Q;else if(1<ne){for(var te=Array(ne),ae=0;ae<ne;ae++)te[ae]=arguments[ae+2];W.children=te}return R(z.type,J,W)},ar.createContext=function(z){return z={$$typeof:i,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:o,_context:z},z},ar.createElement=function(z,I,Q){var W,J={},ne=null;if(I!=null)for(W in I.key!==void 0&&(ne=""+I.key),I)j.call(I,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(J[W]=I[W]);var te=arguments.length-2;if(te===1)J.children=Q;else if(1<te){for(var ae=Array(te),ce=0;ce<te;ce++)ae[ce]=arguments[ce+2];J.children=ae}if(z&&z.defaultProps)for(W in te=z.defaultProps,te)J[W]===void 0&&(J[W]=te[W]);return R(z,ne,J)},ar.createRef=function(){return{current:null}},ar.forwardRef=function(z){return{$$typeof:c,render:z}},ar.isValidElement=M,ar.lazy=function(z){return{$$typeof:f,_payload:{_status:-1,_result:z},_init:G}},ar.memo=function(z,I){return{$$typeof:d,type:z,compare:I===void 0?null:I}},ar.startTransition=function(z){var I=T.T,Q={};T.T=Q;try{var W=z(),J=T.S;J!==null&&J(Q,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(N,L)}catch(ne){L(ne)}finally{I!==null&&Q.types!==null&&(I.types=Q.types),T.T=I}},ar.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ar.use=function(z){return T.H.use(z)},ar.useActionState=function(z,I,Q){return T.H.useActionState(z,I,Q)},ar.useCallback=function(z,I){return T.H.useCallback(z,I)},ar.useContext=function(z){return T.H.useContext(z)},ar.useDebugValue=function(){},ar.useDeferredValue=function(z,I){return T.H.useDeferredValue(z,I)},ar.useEffect=function(z,I){return T.H.useEffect(z,I)},ar.useEffectEvent=function(z){return T.H.useEffectEvent(z)},ar.useId=function(){return T.H.useId()},ar.useImperativeHandle=function(z,I,Q){return T.H.useImperativeHandle(z,I,Q)},ar.useInsertionEffect=function(z,I){return T.H.useInsertionEffect(z,I)},ar.useLayoutEffect=function(z,I){return T.H.useLayoutEffect(z,I)},ar.useMemo=function(z,I){return T.H.useMemo(z,I)},ar.useOptimistic=function(z,I){return T.H.useOptimistic(z,I)},ar.useReducer=function(z,I,Q){return T.H.useReducer(z,I,Q)},ar.useRef=function(z){return T.H.useRef(z)},ar.useState=function(z){return T.H.useState(z)},ar.useSyncExternalStore=function(z,I,Q){return T.H.useSyncExternalStore(z,I,Q)},ar.useTransition=function(){return T.H.useTransition()},ar.version="19.2.4",ar}var Que;function LS(){return Que||(Que=1,yL.exports=fit()),yL.exports}var S=LS();const be=vu(S),FS=Cje({__proto__:null,default:be},[S]);var vL={exports:{}},wO={},xL={exports:{}},wL={};var Gue;function pit(){return Gue||(Gue=1,(function(e){function t(V,B){var H=V.length;V.push(B);e:for(;0<H;){var G=H-1>>>1,L=V[G];if(0<s(L,B))V[G]=B,V[H]=L,H=G;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var B=V[0],H=V.pop();if(H!==B){V[0]=H;e:for(var G=0,L=V.length,Z=L>>>1;G<Z;){var z=2*(G+1)-1,I=V[z],Q=z+1,W=V[Q];if(0>s(I,H))Q<L&&0>s(W,I)?(V[G]=W,V[Q]=H,G=Q):(V[G]=I,V[z]=H,G=z);else if(Q<L&&0>s(W,H))V[G]=W,V[Q]=H,G=Q;else break e}}return B}function s(V,B){var H=V.sortIndex-B.sortIndex;return H!==0?H:V.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,i=o.now();e.unstable_now=function(){return o.now()-i}}var c=[],u=[],d=1,f=null,p=3,h=!1,g=!1,b=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function k(V){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=V)r(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function E(V){if(b=!1,k(V),!g)if(n(c)!==null)g=!0,C||(C=!0,M());else{var B=n(u);B!==null&&q(E,B.startTime-V)}}var C=!1,N=-1,T=5,j=-1;function R(){return y?!0:!(e.unstable_now()-j<T)}function P(){if(y=!1,C){var V=e.unstable_now();j=V;var B=!0;try{e:{g=!1,b&&(b=!1,w(N),N=-1),h=!0;var H=p;try{t:{for(k(V),f=n(c);f!==null&&!(f.expirationTime>V&&R());){var G=f.callback;if(typeof G=="function"){f.callback=null,p=f.priorityLevel;var L=G(f.expirationTime<=V);if(V=e.unstable_now(),typeof L=="function"){f.callback=L,k(V),B=!0;break t}f===n(c)&&r(c),k(V)}else r(c);f=n(c)}if(f!==null)B=!0;else{var Z=n(u);Z!==null&&q(E,Z.startTime-V),B=!1}}break e}finally{f=null,p=H,h=!1}B=void 0}}finally{B?M():C=!1}}}var M;if(typeof O=="function")M=function(){O(P)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,D=U.port2;U.port1.onmessage=P,M=function(){D.postMessage(null)}}else M=function(){x(P,0)};function q(V,B){N=x(function(){V(e.unstable_now())},B)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(V){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var H=p;p=B;try{return V()}finally{p=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(V,B){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var H=p;p=V;try{return B()}finally{p=H}},e.unstable_scheduleCallback=function(V,B,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,V){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,V={id:d++,callback:B,priorityLevel:V,startTime:H,expirationTime:L,sortIndex:-1},H>G?(V.sortIndex=H,t(u,V),n(c)===null&&V===n(u)&&(b?(w(N),N=-1):b=!0,q(E,H-G))):(V.sortIndex=L,t(c,V),g||h||(g=!0,C||(C=!0,M()))),V},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(V){var B=p;return function(){var H=p;p=B;try{return V.apply(this,arguments)}finally{p=H}}}})(wL)),wL}var Wue;function hit(){return Wue||(Wue=1,xL.exports=pit()),xL.exports}var SL={exports:{}},$i={};var Zue;function mit(){if(Zue)return $i;Zue=1;var e=LS();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},s=Symbol.for("react.portal");function a(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function i(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return $i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$i.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 a(c,u,null,d)},$i.flushSync=function(c){var u=o.T,d=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=u,r.p=d,r.d.f()}},$i.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))},$i.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},$i.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=i(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})}},$i.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=i(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)},$i.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=i(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})}},$i.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=i(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)},$i.requestFormReset=function(c){r.d.r(c)},$i.unstable_batchedUpdates=function(c,u){return c(u)},$i.useFormState=function(c,u,d){return o.H.useFormState(c,u,d)},$i.useFormStatus=function(){return o.H.useHostTransitionStatus()},$i.version="19.2.4",$i}var Yue;function Tje(){if(Yue)return SL.exports;Yue=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(),SL.exports=mit(),SL.exports}var Xue;function git(){if(Xue)return wO;Xue=1;var e={env:{}};var t=hit(),n=LS(),r=Tje();function s(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)v+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(m){return!(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)}function o(m){var v=m,_=m;if(m.alternate)for(;v.return;)v=v.return;else{m=v;do v=m,(v.flags&4098)!==0&&(_=v.return),m=v.return;while(m)}return v.tag===3?_:null}function i(m){if(m.tag===13){var v=m.memoizedState;if(v===null&&(m=m.alternate,m!==null&&(v=m.memoizedState)),v!==null)return v.dehydrated}return null}function c(m){if(m.tag===31){var v=m.memoizedState;if(v===null&&(m=m.alternate,m!==null&&(v=m.memoizedState)),v!==null)return v.dehydrated}return null}function u(m){if(o(m)!==m)throw Error(s(188))}function d(m){var v=m.alternate;if(!v){if(v=o(m),v===null)throw Error(s(188));return v!==m?null:m}for(var _=m,A=v;;){var $=_.return;if($===null)break;var F=$.alternate;if(F===null){if(A=$.return,A!==null){_=A;continue}break}if($.child===F.child){for(F=$.child;F;){if(F===_)return u($),m;if(F===A)return u($),v;F=F.sibling}throw Error(s(188))}if(_.return!==A.return)_=$,A=F;else{for(var Y=!1,oe=$.child;oe;){if(oe===_){Y=!0,_=$,A=F;break}if(oe===A){Y=!0,A=$,_=F;break}oe=oe.sibling}if(!Y){for(oe=F.child;oe;){if(oe===_){Y=!0,_=F,A=$;break}if(oe===A){Y=!0,A=F,_=$;break}oe=oe.sibling}if(!Y)throw Error(s(189))}}if(_.alternate!==A)throw Error(s(190))}if(_.tag!==3)throw Error(s(188));return _.stateNode.current===_?m:v}function f(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(v=f(m),v!==null)return v;m=m.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=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"),N=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function U(m){return m===null||typeof m!="object"?null:(m=M&&m[M]||m["@@iterator"],typeof m=="function"?m:null)}var D=Symbol.for("react.client.reference");function q(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===D?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case C:return"Suspense";case N:return"SuspenseList";case R:return"Activity"}if(typeof m=="object")switch(m.$$typeof){case b:return"Portal";case k:return m.displayName||"Context";case O:return(m._context.displayName||"Context")+".Consumer";case E:var v=m.render;return m=m.displayName,m||(m=v.displayName||v.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case T:return v=m.displayName||null,v!==null?v:q(m.type)||"Memo";case j:v=m._payload,m=m._init;try{return q(m(v))}catch{}}return null}var V=Array.isArray,B=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 z(m){return{current:m}}function I(m){0>Z||(m.current=L[Z],L[Z]=null,Z--)}function Q(m,v){Z++,L[Z]=m.current,m.current=v}var W=z(null),J=z(null),ne=z(null),te=z(null);function ae(m,v){switch(Q(ne,v),Q(J,m),Q(W,null),v.nodeType){case 9:case 11:m=(m=v.documentElement)&&(m=m.namespaceURI)?fue(m):0;break;default:if(m=v.tagName,v=v.namespaceURI)v=fue(v),m=pue(v,m);else switch(m){case"svg":m=1;break;case"math":m=2;break;default:m=0}}I(W),Q(W,m)}function ce(){I(W),I(J),I(ne)}function ve(m){m.memoizedState!==null&&Q(te,m);var v=W.current,_=pue(v,m.type);v!==_&&(Q(J,m),Q(W,_))}function ee(m){J.current===m&&(I(W),I(J)),te.current===m&&(I(te),gO._currentValue=G)}var re,ie;function ge(m){if(re===void 0)try{throw Error()}catch(_){var v=_.stack.trim().match(/\n( *(at )?)/);re=v&&v[1]||"",ie=-1<_.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<_.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+re+m+ie}var me=!1;function we(m,v){if(!m||me)return"";me=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var A={DetermineComponentFrameRoot:function(){try{if(v){var tt=function(){throw Error()};if(Object.defineProperty(tt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(tt,[])}catch(Ge){var Ue=Ge}Reflect.construct(m,[],tt)}else{try{tt.call()}catch(Ge){Ue=Ge}m.call(tt.prototype)}}else{try{throw Error()}catch(Ge){Ue=Ge}(tt=m())&&typeof tt.catch=="function"&&tt.catch(function(){})}}catch(Ge){if(Ge&&Ue&&typeof Ge.stack=="string")return[Ge.stack,Ue.stack]}return[null,null]}};A.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var $=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");$&&$.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var F=A.DetermineComponentFrameRoot(),Y=F[0],oe=F[1];if(Y&&oe){var xe=Y.split(`
|
|
5
5
|
`),Le=oe.split(`
|
|
@@ -128,7 +128,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
128
128
|
constructor(\${params}) {
|
|
129
129
|
\${}
|
|
130
130
|
}
|
|
131
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),Ql('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ql('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],HLe=Yee.concat([Ql("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ql("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ql("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),$0e=new Z4e,QLe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function jO(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const I6t=["FunctionDeclaration"],P6t={FunctionDeclaration:jO("function"),ClassDeclaration:jO("class"),ClassExpression:()=>!0,EnumDeclaration:jO("constant"),TypeAliasDeclaration:jO("type"),NamespaceDeclaration:jO("namespace"),VariableDefinition(e,t){e.matchContext(I6t)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function GLe(e,t){let n=$0e.get(t);if(n)return n;let r=[],s=!0;function a(o,i){let c=e.sliceString(o.from,o.to);r.push({label:c,type:i})}return t.cursor(js.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let i=P6t[o.name];if(i&&i(o,a)||QLe.has(o.name))return!1}else if(o.to-o.from>8192){for(let i of GLe(e,o.node))r.push(i);return!1}}),$0e.set(t,r),r}const _P=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Xee=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function WLe(e){let t=Qs(e.state).resolveInner(e.pos,-1);if(Xee.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&_P.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)QLe.has(s.name)&&(r=r.concat(GLe(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:_P}}function vU(e,t,n){var r;let s=[];for(;;){let a=t.firstChild,o;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:n};if(a?.name=="MemberExpression"&&((r=o=a.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")s.push(e(o)),t=a;else return null}}function ZLe(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=Qs(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?vU(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?vU(t,n.parent,""):Xee.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&_P.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?vU(t,n,""):e.explicit?{path:[],name:""}:null}function M6t(e,t){let n=e,r=[],s=new Set;for(let a=0;;a++){for(let i of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(i)||s.has(i))continue;s.add(i);let c;try{c=n[i]}catch{continue}r.push({label:i,type:typeof c=="function"?/^[A-Z]/.test(i)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let o=Object.getPrototypeOf(e);if(!o)return r;e=o}}function $6t(e){let t=new Map;return n=>{let r=ZLe(n);if(!r)return null;let s=e;for(let o of r.path)if(s=s[o],!s)return null;let a=t.get(s);return a||t.set(s,a=M6t(s,!r.path.length)),{from:n.pos-r.name.length,options:a,validFor:_P}}}const ad=dv.define({name:"javascript",parser:R6t.configure({props:[nx.add({IfStatement:dw({except:/^\s*({|else\b)/}),TryStatement:dw({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:R4t,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:j4t({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":dw({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}}),rx.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Tee,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:"$"}}),YLe={test:e=>/^JSX/.test(e.name),facet:j$({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Kee=ad.configure({dialect:"ts"},"typescript"),Jee=ad.configure({dialect:"jsx",props:[_ee.add(e=>e.isTop?[YLe]:void 0)]}),ete=ad.configure({dialect:"jsx ts",props:[_ee.add(e=>e.isTop?[YLe]:void 0)]},"typescript");let XLe=e=>({label:e,type:"keyword"});const KLe="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(XLe),D6t=KLe.concat(["declare","implements","private","protected","public"].map(XLe));function EP(e={}){let t=e.jsx?e.typescript?ete:Jee:e.typescript?Kee:ad,n=e.typescript?HLe.concat(D6t):Yee.concat(KLe);return new pv(t,[ad.data.of({autocomplete:b3t(Xee,G5e(n))}),ad.data.of({autocomplete:WLe}),e.jsx?JLe:[]])}function L6t(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 D0e(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 F6t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),JLe=ct.inputHandler.of((e,t,n,r,s)=>{if((F6t?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!ad.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:o}=a,i=o.changeByRange(c=>{var u;let{head:d}=c,f=Qs(o).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.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,g=h.parent;if(g&&h.from==d-2&&((p=D0e(o.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${p}>`;return{range:Ze.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(r==">"){let h=L6t(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(p=D0e(o.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return i.changes.empty?!1:(e.dispatch([a,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function z6t(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 s;!((s=n.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,s=[];for(let{from:a,to:o}of ad.findRegions(r)){let i=r.doc.lineAt(a),c={line:i.number-1,col:a-i.from,pos:a};for(let u of e.verify(r.sliceDoc(a,o),t))s.push(B6t(u,r.doc,c))}return s}}function L0e(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function B6t(e,t,n){let r=L0e(e.line,e.column,t,n),s={from:r,to:e.endLine!=null&&e.endColumn!=1?L0e(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:a,text:o}=e.fix,i=a[0]+n.pos-r,c=a[1]+n.pos-r;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+i,to:d+c,insert:o},scrollIntoView:!0})}}]}return s}const Oj=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:JLe,completionPath:ZLe,esLint:z6t,javascript:EP,javascriptLanguage:ad,jsxLanguage:Jee,localCompletionSource:WLe,scopeCompletionSource:$6t,snippets:Yee,tsxLanguage:ete,typescriptLanguage:Kee,typescriptSnippets:HLe},Symbol.toStringTag,{value:"Module"})),RO=["_blank","_self","_top","_parent"],xU=["ascii","utf-8","utf-16","latin1","latin1"],wU=["get","post","put","delete"],SU=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],$c=["true","false"],xn={},U6t={a:{attrs:{href:null,ping:null,type:null,media:null,target:RO,hreflang:null}},abbr:xn,address:xn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:xn,aside:xn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:xn,base:{attrs:{href:null,target:RO}},bdi:xn,bdo:xn,blockquote:{attrs:{cite:null}},body:xn,br:xn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:SU,formmethod:wU,formnovalidate:["novalidate"],formtarget:RO,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:xn,center:xn,cite:xn,code:xn,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:xn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:xn,div:xn,dl:xn,dt:xn,em:xn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:xn,figure:xn,footer:xn,form:{attrs:{action:null,name:null,"accept-charset":xU,autocomplete:["on","off"],enctype:SU,method:wU,novalidate:["novalidate"],target:RO}},h1:xn,h2:xn,h3:xn,h4:xn,h5:xn,h6:xn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:xn,hgroup:xn,hr:xn,html:{attrs:{manifest:null}},i:xn,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:SU,formmethod:wU,formnovalidate:["novalidate"],formtarget:RO,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:xn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:xn,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:xn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:xU,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:xn,noscript:xn,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:xn,param:{attrs:{name:null,value:null}},pre:xn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:xn,rt:xn,ruby:xn,samp:xn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:xU}},section:xn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:xn,source:{attrs:{src:null,type:null,media:null}},span:xn,strong:xn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:xn,summary:xn,sup:xn,table:xn,tbody:xn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:xn,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:xn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:xn,time:{attrs:{datetime:null}},title:xn,tr:xn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:xn,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:xn},e6e={accesskey:null,class:null,contenteditable:$c,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:$c,autocorrect:$c,autocapitalize:$c,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":$c,"aria-autocomplete":["inline","list","both","none"],"aria-busy":$c,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":$c,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":$c,"aria-hidden":$c,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":$c,"aria-multiselectable":$c,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":$c,"aria-relevant":null,"aria-required":$c,"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},t6e="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 t6e)e6e[e]=null;let mE=class{constructor(t,n){this.tags={...U6t,...t},this.globalAttrs={...e6e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};mE.default=new mE;function qw(e,t,n=e.length){if(!t)return"";let r=t.firstChild,s=r&&r.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,n)):""}function Hw(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function n6e(e,t,n){let r=n.tags[qw(e,Hw(t))];return r?.children||n.allTags}function tte(e,t){let n=[];for(let r=Hw(t);r&&!r.type.isTop;r=Hw(r.parent)){let s=qw(e,r);if(s&&r.lastChild.name=="CloseTag")break;s&&n.indexOf(s)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(s)}return n}const r6e=/^[:\-\.\w\u00b7-\uffff]*$/;function F0e(e,t,n,r,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",o=Hw(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:s,options:n6e(e.doc,o,t).map(i=>({label:i,type:"type"})).concat(tte(e.doc,n).map((i,c)=>({label:"/"+i,apply:"/"+i+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function z0e(e,t,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:tte(e.doc,t).map((a,o)=>({label:a,apply:a+s,type:"type",boost:99-o})),validFor:r6e}}function V6t(e,t,n,r){let s=[],a=0;for(let o of n6e(e.doc,n,t))s.push({label:"<"+o,type:"type"});for(let o of tte(e.doc,n))s.push({label:"</"+o+">",type:"type",boost:99-a++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function q6t(e,t,n,r,s){let a=Hw(n),o=a?t.tags[qw(e.doc,a)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?i:i.length?i.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:r6e}}function H6t(e,t,n,r,s){var a;let o=(a=n.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),i=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=Hw(n),p=f?t.tags[qw(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,s).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let g of d)i.push({label:g,apply:p+g+h,type:"constant"})}}return{from:r,to:s,options:i,validFor:c}}function s6e(e,t){let{state:n,pos:r}=t,s=Qs(n).resolveInner(r,-1),a=s.resolve(r);for(let o=r,i;a==s&&(i=s.childBefore(o));){let c=i.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=i,o=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?z0e(n,s,s.from,r):F0e(n,e,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?F0e(n,e,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?z0e(n,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?q6t(n,e,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?H6t(n,e,s,s.name=="Is"?r:s.from,r):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?V6t(n,e,s,r):null}function a6e(e){return s6e(mE.default,e)}function o6e(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new mE(t,n):mE.default;return s=>s6e(r,s)}const Q6t=ad.parser.configure({top:"SingleExpression"}),i6e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Kee.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Jee.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ete.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Q6t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:ad.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:hE.parser}],l6e=[{name:"style",parser:hE.parser.configure({top:"Styles"})}].concat(t6e.map(e=>({name:e,parser:ad.parser}))),c6e=dv.define({name:"html",parser:wLt.configure({props:[nx.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 s=r.lastChild;if(!s||s.name!="Element"||s.to!=r.to)break;t=r=s}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),rx.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}}}),z5e.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),l_=c6e.configure({wrap:MLe(i6e,l6e)});function u6e(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=MLe((e.nestedLanguages||[]).concat(i6e),(e.nestedAttributes||[]).concat(l6e)));let r=n?c6e.configure({wrap:n,dialect:t}):t?l_.configure({dialect:t}):l_;return new pv(r,[l_.data.of({autocomplete:o6e(e)}),e.autoCloseTags!==!1?d6e:[],EP().support,VLe().support])}const B0e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),d6e=ct.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!l_.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:o}=a,i=o.changeByRange(c=>{var u,d,f;let p=o.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,g=Qs(o).resolveInner(h,-1),b;if(p&&r==">"&&g.name=="EndTag"){let y=g.parent;if(((d=(u=y.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=qw(o.doc,y.parent,h))&&!B0e.has(b)){let x=h+(o.doc.sliceString(h,h+1)===">"?1:0),w=`</${b}>`;return{range:c,changes:{from:h,to:x,insert:w}}}}else if(p&&r=="/"&&g.name=="IncompleteCloseTag"){let y=g.parent;if(g.from==h-2&&((f=y.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=qw(o.doc,y,h))&&!B0e.has(b)){let x=h+(o.doc.sliceString(h,h+1)===">"?1:0),w=`${b}>`;return{range:Ze.cursor(h+w.length,-1),changes:{from:h,to:x,insert:w}}}}return{range:c}});return i.changes.empty?!1:(e.dispatch([a,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),G6t=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:d6e,html:u6e,htmlCompletionSource:a6e,htmlCompletionSourceWith:o6e,htmlLanguage:l_},Symbol.toStringTag,{value:"Module"})),f6e=j$({commentTokens:{block:{open:"<!--",close:"-->"}}}),p6e=new rr,h6e=O5t.configure({props:[rx.add(e=>!e.is("Block")||e.is("Document")||_W(e)!=null||W6t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),p6e.add(_W),nx.add({Document:()=>null}),Sg.add({Document:f6e})]});function _W(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function W6t(e){return e.name=="OrderedList"||e.name=="BulletList"}function Z6t(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=_W(r.type))!=null&&s<=t)break;n=r}return n.to}const Y6t=T5e.of((e,t,n)=>{for(let r=Qs(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(p6e);if(s==null)continue;let a=Z6t(r,s);if(a>n)return{from:n,to:a}}return null});function nte(e){return new Kc(f6e,e,[],"markdown")}const m6e=nte(h6e),X6t=h6e.configure([P5t,$5t,M5t,D5t,{props:[rx.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),gv=nte(X6t);function K6t(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=Ve.matchLanguageName(e,n,!0),r instanceof Ve)return r.support?r.support.language.parser:fv.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class OU{constructor(t,n,r,s,a,o,i){this.node=t,this.from=n,this.to=r,this.spaceBefore=s,this.spaceAfter=a,this.type=o,this.item=i}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 s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+b6e(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function g6e(e,t){let n=[],r=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&n.push(s)}for(let s=n.length-1;s>=0;s--){let a=n[s],o,i=t.lineAt(a.from),c=a.from-i.from;if(a.name=="Blockquote"&&(o=/^ *>( ?)/.exec(i.text.slice(c))))r.push(new OU(a,c,c+o[0].length,"",o[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(i.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),r.push(new OU(a.parent,c,c+d,o[1],u,o[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(i.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),r.push(new OU(a.parent,c,c+d,o[1],u,f,a))}}return r}function b6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kU(e,t,n,r=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let i=b6e(a,t),c=+i[2];if(s>=0){if(c!=s+1)return;n.push({from:a.from+i[1].length,to:a.from+i[0].length,insert:String(s+2+r)})}s=c}let o=a.nextSibling;if(!o)break;a=o}}function rte(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(r1)!=" ")return e;let r=of(e,4,n),s="";for(let a=r;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(n)}const y6e=(e={})=>({state:t,dispatch:n})=>{let r=Qs(t),{doc:s}=t,a=null,o=t.changeByRange(i=>{if(!i.empty||!gv.isActiveAt(t,i.from,-1)&&!gv.isActiveAt(t,i.from,1))return a={range:i};let c=i.from,u=s.lineAt(c),d=g6e(r.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:i};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:i};let p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){let x=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(x.to>=c||w&&w.to<c||u.from>0&&!/[^\s>]/.test(s.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(s,1)):k=u.from+(O?O.to:0);let C=[{from:k,to:c,insert:E}];return f.node.name=="OrderedList"&&kU(f.item,s,C,-2),O&&O.node.name=="OrderedList"&&kU(O.item,s,C),{range:Ze.cursor(k+E.length),changes:C}}else{let O=V0e(d,t,u);return{range:Ze.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&u.from){let x=s.lineAt(u.from-1),w=/>\s*$/.exec(x.text);if(w&&w.index==f.from){let O=t.changes([{from:x.from+w.index,to:x.to},{from:u.from+f.from,to:u.to}]);return{range:i.map(O),changes:O}}}let h=[];f.node.name=="OrderedList"&&kU(f.item,s,h);let g=f.item&&f.item.from<u.from,b="";if(!g||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let x=0,w=d.length-1;x<=w;x++)b+=x==w&&!g?d[x].marker(s,1):d[x].blank(x<w?of(u.text,4,d[x+1].from)-b.length:null);let y=c;for(;y>u.from&&/\s/.test(u.text.charAt(y-u.from-1));)y--;return b=rte(b,t),J6t(f.node,t.doc)&&(b=V0e(d,t,u)+t.lineBreak+b),h.push({from:y,to:c,insert:t.lineBreak+b}),{range:Ze.cursor(y+b.length+1),changes:h}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},v6e=y6e();function U0e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function J6t(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 s=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<a.number}function V0e(e,t,n){let r="";for(let s=0,a=e.length-2;s<=a;s++)r+=e[s].blank(s<a?of(n.text,4,e[s+1].from)-r.length:null,s<a);return rte(r,t)}function e9t(e,t){let n=e.resolveInner(t,-1),r=t;U0e(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(U0e(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const x6e=({state:e,dispatch:t})=>{let n=Qs(e),r=null,s=e.changeByRange(a=>{let o=a.from,{doc:i}=e;if(a.empty&&gv.isActiveAt(e,a.from)){let c=i.lineAt(o),u=g6e(e9t(n,o),i);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:Ze.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-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(of(c.text,4,d.to)-of(c.text,4,d.from));return p==c.from&&(h=rte(h,e)),{range:Ze.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<o)return{range:Ze.cursor(p),changes:{from:p,to:o}}}}}return r={range:a}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},w6e=[{key:"Enter",run:v6e},{key:"Backspace",run:x6e}],S6e=u6e({matchClosingTags:!1});function ste(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=m6e,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:i=S6e}=e;if(!(s instanceof M$))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[i.support,Y6t],d;o&&u.push(O6e),n instanceof pv?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?K6t(t,d):void 0;c.push(_5t({codeParser:f,htmlParser:i.language.parser})),r&&u.push(gf.high(n1.of(w6e)));let p=nte(s.configure(c));return a&&u.push(p.data.of({autocomplete:t9t})),new pv(p,u)}function t9t(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=Qs(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:n-r[0].length,to:n,options:n9t(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let _U=null;function n9t(){if(_U)return _U;let e=a6e(new Pee(wr.create({extensions:S6e}),0,!0));return _U=e?e.options:[]}const r9t=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,O6e=ct.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!gv.isActiveAt(t.state,r.from,1)))return!1;let a=Qs(t.state),o=!1;return a.iterate({from:r.from,to:r.to,enter:i=>{(i.from>r.from||r9t.test(i.name))&&(o=!0)},leave:i=>{i.to<r.to&&(o=!0)}}),o?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),s9t=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:m6e,deleteMarkupBackward:x6e,insertNewlineContinueMarkup:v6e,insertNewlineContinueMarkupCommand:y6e,markdown:ste,markdownKeymap:w6e,markdownLanguage:gv,pasteURLAsLink:O6e},Symbol.toStringTag,{value:"Module"}));function ot(e){return new pv(Aee.define(e))}function Ym(e){return He(()=>import("./index-BJLZpMwN.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const k6e=[Ve.of({name:"C",extensions:["c","h","ino"],load(){return He(()=>import("./index-BWN90KeJ.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ve.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return He(()=>import("./index-BWN90KeJ.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ve.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ym("Cassandra")}}),Ve.of({name:"CSS",extensions:["css"],load(){return He(()=>Promise.resolve().then(()=>t6t),void 0,import.meta.url).then(e=>e.css())}}),Ve.of({name:"Go",extensions:["go"],load(){return He(()=>import("./index-2WKb2JXV.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Ve.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return He(()=>Promise.resolve().then(()=>G6t),void 0,import.meta.url).then(e=>e.html())}}),Ve.of({name:"Java",extensions:["java"],load(){return He(()=>import("./index-BDu36wuR.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ve.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return He(()=>Promise.resolve().then(()=>Oj),void 0,import.meta.url).then(e=>e.javascript())}}),Ve.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return He(()=>import("./index-DQJr6Gv5.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Ve.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return He(()=>Promise.resolve().then(()=>m3t),void 0,import.meta.url).then(e=>e.json())}}),Ve.of({name:"JSX",extensions:["jsx"],load(){return He(()=>Promise.resolve().then(()=>Oj),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ve.of({name:"LESS",extensions:["less"],load(){return He(()=>import("./index-DFDYXtiQ.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ve.of({name:"Liquid",extensions:["liquid"],load(){return He(()=>import("./index-DN6hwH_A.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ve.of({name:"MariaDB SQL",load(){return Ym("MariaSQL")}}),Ve.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return He(()=>Promise.resolve().then(()=>s9t),void 0,import.meta.url).then(e=>e.markdown())}}),Ve.of({name:"MS SQL",load(){return Ym("MSSQL")}}),Ve.of({name:"MySQL",load(){return Ym("MySQL")}}),Ve.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return He(()=>import("./index-Bw4uFMdt.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ve.of({name:"PLSQL",extensions:["pls"],load(){return Ym("PLSQL")}}),Ve.of({name:"PostgreSQL",load(){return Ym("PostgreSQL")}}),Ve.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return He(()=>import("./index-DN58jL8t.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ve.of({name:"Rust",extensions:["rs"],load(){return He(()=>import("./index-CWCYUog7.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ve.of({name:"Sass",extensions:["sass"],load(){return He(()=>import("./index-DJriR7yS.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Ve.of({name:"SCSS",extensions:["scss"],load(){return He(()=>import("./index-DJriR7yS.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ve.of({name:"SQL",extensions:["sql"],load(){return Ym("StandardSQL")}}),Ve.of({name:"SQLite",load(){return Ym("SQLite")}}),Ve.of({name:"TSX",extensions:["tsx"],load(){return He(()=>Promise.resolve().then(()=>Oj),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ve.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return He(()=>Promise.resolve().then(()=>Oj),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ve.of({name:"WebAssembly",extensions:["wat","wast"],load(){return He(()=>import("./index-CvWCPr5d.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Ve.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return He(()=>import("./index-DW-r7c5D.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Ve.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return He(()=>import("./index-Dq7bjvJV.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Ve.of({name:"APL",extensions:["dyalog","apl"],load(){return He(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>ot(e.apl))}}),Ve.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return He(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>ot(e.asciiArmor))}}),Ve.of({name:"ASN.1",extensions:["asn","asn1"],load(){return He(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>ot(e.asn1({})))}}),Ve.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return He(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>ot(e.asterisk))}}),Ve.of({name:"Brainfuck",extensions:["b","bf"],load(){return He(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>ot(e.brainfuck))}}),Ve.of({name:"Cobol",extensions:["cob","cpy"],load(){return He(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>ot(e.cobol))}}),Ve.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.csharp))}}),Ve.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return He(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ot(e.clojure))}}),Ve.of({name:"ClojureScript",extensions:["cljs"],load(){return He(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ot(e.clojure))}}),Ve.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return He(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>ot(e.gss))}}),Ve.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return He(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>ot(e.cmake))}}),Ve.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return He(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>ot(e.coffeeScript))}}),Ve.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return He(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>ot(e.commonLisp))}}),Ve.of({name:"Cypher",extensions:["cyp","cypher"],load(){return He(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>ot(e.cypher))}}),Ve.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return He(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>ot(e.cython))}}),Ve.of({name:"Crystal",extensions:["cr"],load(){return He(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>ot(e.crystal))}}),Ve.of({name:"D",extensions:["d"],load(){return He(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>ot(e.d))}}),Ve.of({name:"Dart",extensions:["dart"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.dart))}}),Ve.of({name:"diff",extensions:["diff","patch"],load(){return He(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>ot(e.diff))}}),Ve.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return He(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>ot(e.dockerFile))}}),Ve.of({name:"DTD",extensions:["dtd"],load(){return He(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>ot(e.dtd))}}),Ve.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return He(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>ot(e.dylan))}}),Ve.of({name:"EBNF",load(){return He(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>ot(e.ebnf))}}),Ve.of({name:"ECL",extensions:["ecl"],load(){return He(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>ot(e.ecl))}}),Ve.of({name:"edn",extensions:["edn"],load(){return He(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ot(e.clojure))}}),Ve.of({name:"Eiffel",extensions:["e"],load(){return He(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>ot(e.eiffel))}}),Ve.of({name:"Elm",extensions:["elm"],load(){return He(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>ot(e.elm))}}),Ve.of({name:"Erlang",extensions:["erl"],load(){return He(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>ot(e.erlang))}}),Ve.of({name:"Esper",load(){return He(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>ot(e.esper))}}),Ve.of({name:"Factor",extensions:["factor"],load(){return He(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>ot(e.factor))}}),Ve.of({name:"FCL",load(){return He(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>ot(e.fcl))}}),Ve.of({name:"Forth",extensions:["forth","fth","4th"],load(){return He(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>ot(e.forth))}}),Ve.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return He(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>ot(e.fortran))}}),Ve.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return He(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ot(e.fSharp))}}),Ve.of({name:"Gas",extensions:["s"],load(){return He(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>ot(e.gas))}}),Ve.of({name:"Gherkin",extensions:["feature"],load(){return He(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>ot(e.gherkin))}}),Ve.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return He(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>ot(e.groovy))}}),Ve.of({name:"Haskell",extensions:["hs"],load(){return He(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>ot(e.haskell))}}),Ve.of({name:"Haxe",extensions:["hx"],load(){return He(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ot(e.haxe))}}),Ve.of({name:"HXML",extensions:["hxml"],load(){return He(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ot(e.hxml))}}),Ve.of({name:"HTTP",load(){return He(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>ot(e.http))}}),Ve.of({name:"IDL",extensions:["pro"],load(){return He(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>ot(e.idl))}}),Ve.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return He(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>ot(e.jsonld))}}),Ve.of({name:"Julia",extensions:["jl"],load(){return He(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>ot(e.julia))}}),Ve.of({name:"Kotlin",extensions:["kt","kts"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.kotlin))}}),Ve.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return He(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>ot(e.liveScript))}}),Ve.of({name:"Lua",extensions:["lua"],load(){return He(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>ot(e.lua))}}),Ve.of({name:"mIRC",extensions:["mrc"],load(){return He(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>ot(e.mirc))}}),Ve.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return He(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>ot(e.mathematica))}}),Ve.of({name:"Modelica",extensions:["mo"],load(){return He(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>ot(e.modelica))}}),Ve.of({name:"MUMPS",extensions:["mps"],load(){return He(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>ot(e.mumps))}}),Ve.of({name:"Mbox",extensions:["mbox"],load(){return He(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>ot(e.mbox))}}),Ve.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return He(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>ot(e.nginx))}}),Ve.of({name:"NSIS",extensions:["nsh","nsi"],load(){return He(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>ot(e.nsis))}}),Ve.of({name:"NTriples",extensions:["nt","nq"],load(){return He(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>ot(e.ntriples))}}),Ve.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.objectiveC))}}),Ve.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.objectiveCpp))}}),Ve.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return He(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ot(e.oCaml))}}),Ve.of({name:"Octave",extensions:["m"],load(){return He(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>ot(e.octave))}}),Ve.of({name:"Oz",extensions:["oz"],load(){return He(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>ot(e.oz))}}),Ve.of({name:"Pascal",extensions:["p","pas"],load(){return He(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>ot(e.pascal))}}),Ve.of({name:"Perl",extensions:["pl","pm"],load(){return He(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>ot(e.perl))}}),Ve.of({name:"Pig",extensions:["pig"],load(){return He(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>ot(e.pig))}}),Ve.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return He(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>ot(e.powerShell))}}),Ve.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return He(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>ot(e.properties))}}),Ve.of({name:"ProtoBuf",extensions:["proto"],load(){return He(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>ot(e.protobuf))}}),Ve.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return He(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>ot(e.pug))}}),Ve.of({name:"Puppet",extensions:["pp"],load(){return He(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>ot(e.puppet))}}),Ve.of({name:"Q",extensions:["q"],load(){return He(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>ot(e.q))}}),Ve.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return He(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>ot(e.r))}}),Ve.of({name:"RPM Changes",load(){return He(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ot(e.rpmChanges))}}),Ve.of({name:"RPM Spec",extensions:["spec"],load(){return He(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ot(e.rpmSpec))}}),Ve.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return He(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>ot(e.ruby))}}),Ve.of({name:"SAS",extensions:["sas"],load(){return He(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>ot(e.sas))}}),Ve.of({name:"Scala",extensions:["scala"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.scala))}}),Ve.of({name:"Scheme",extensions:["scm","ss"],load(){return He(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>ot(e.scheme))}}),Ve.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return He(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>ot(e.shell))}}),Ve.of({name:"Sieve",extensions:["siv","sieve"],load(){return He(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>ot(e.sieve))}}),Ve.of({name:"Smalltalk",extensions:["st"],load(){return He(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>ot(e.smalltalk))}}),Ve.of({name:"Solr",load(){return He(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>ot(e.solr))}}),Ve.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return He(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ot(e.sml))}}),Ve.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return He(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>ot(e.sparql))}}),Ve.of({name:"Spreadsheet",alias:["excel","formula"],load(){return He(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>ot(e.spreadsheet))}}),Ve.of({name:"Squirrel",extensions:["nut"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.squirrel))}}),Ve.of({name:"Stylus",extensions:["styl"],load(){return He(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>ot(e.stylus))}}),Ve.of({name:"Swift",extensions:["swift"],load(){return He(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>ot(e.swift))}}),Ve.of({name:"sTeX",load(){return He(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ot(e.stex))}}),Ve.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return He(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ot(e.stex))}}),Ve.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return He(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ot(e.verilog))}}),Ve.of({name:"Tcl",extensions:["tcl"],load(){return He(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>ot(e.tcl))}}),Ve.of({name:"Textile",extensions:["textile"],load(){return He(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>ot(e.textile))}}),Ve.of({name:"TiddlyWiki",load(){return He(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>ot(e.tiddlyWiki))}}),Ve.of({name:"Tiki wiki",load(){return He(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>ot(e.tiki))}}),Ve.of({name:"TOML",extensions:["toml"],load(){return He(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>ot(e.toml))}}),Ve.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return He(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>ot(e.troff))}}),Ve.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return He(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>ot(e.ttcn))}}),Ve.of({name:"TTCN_CFG",extensions:["cfg"],load(){return He(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>ot(e.ttcnCfg))}}),Ve.of({name:"Turtle",extensions:["ttl"],load(){return He(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>ot(e.turtle))}}),Ve.of({name:"Web IDL",extensions:["webidl"],load(){return He(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>ot(e.webIDL))}}),Ve.of({name:"VB.NET",extensions:["vb"],load(){return He(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>ot(e.vb))}}),Ve.of({name:"VBScript",extensions:["vbs"],load(){return He(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>ot(e.vbScript))}}),Ve.of({name:"Velocity",extensions:["vtl"],load(){return He(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>ot(e.velocity))}}),Ve.of({name:"Verilog",extensions:["v"],load(){return He(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ot(e.verilog))}}),Ve.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return He(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>ot(e.vhdl))}}),Ve.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return He(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>ot(e.xQuery))}}),Ve.of({name:"Yacas",extensions:["ys"],load(){return He(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>ot(e.yacas))}}),Ve.of({name:"Z80",extensions:["z80"],load(){return He(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>ot(e.z80))}}),Ve.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return He(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ot(e.mscgen))}}),Ve.of({name:"Xù",extensions:["xu"],load(){return He(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ot(e.xu))}}),Ve.of({name:"MsGenny",extensions:["msgenny"],load(){return He(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ot(e.msgenny))}}),Ve.of({name:"Vue",extensions:["vue"],load(){return He(()=>import("./index-CHvHWf0T.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ve.of({name:"Angular Template",load(){return He(()=>import("./index-DU38eqy6.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];var a9t=e=>{var{theme:t,settings:n={},styles:r=[]}=e,s={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(s["&"]=a),n.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(s[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(s[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(s[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(s[".cm-content"]={caretColor:n.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var o={};n.gutterActiveForeground&&(o.color=n.gutterActiveForeground),n.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:n.lineHighlight},o.backgroundColor=n.lineHighlight),s[".cm-activeLineGutter"]=o,n.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var i=ct.theme(s,{dark:t==="dark"}),c=s1.define(r),u=[i,Nee(c)];return u},o9t={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)"},i9t=[{tag:le.comment,color:"#6272a4"},{tag:le.string,color:"#f1fa8c"},{tag:le.atom,color:"#bd93f9"},{tag:le.meta,color:"#f8f8f2"},{tag:[le.keyword,le.operator,le.tagName],color:"#ff79c6"},{tag:[le.function(le.propertyName),le.propertyName],color:"#66d9ef"},{tag:[le.definition(le.variableName),le.function(le.variableName),le.className,le.attributeName],color:"#50fa7b"},{tag:le.atom,color:"#bd93f9"}],$$=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return a9t({theme:t,settings:Qg({},o9t,n),styles:[...i9t,...r]})};$$();const l9t=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=ote(e.state,n.from);return r.line?c9t(e):r.block?d9t(e):!1};function ate(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=e(t,n);return s?(r(n.update(s)),!0):!1}}const c9t=ate(h9t,0),u9t=ate(_6e,0),d9t=ate((e,t)=>_6e(e,t,p9t(t)),0);function ote(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const IO=50;function f9t(e,{open:t,close:n},r,s){let a=e.sliceDoc(r-IO,r),o=e.sliceDoc(s,s+IO),i=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,u=a.length-i;if(a.slice(u-t.length,u)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-i,margin:i&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-r<=2*IO?d=f=e.sliceDoc(r,s):(d=e.sliceDoc(r,r+IO),f=e.sliceDoc(s-IO,s));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,g=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:s-h-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function p9t(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),s=n.to<=r.to?r:e.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=s.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return t}function _6e(e,t,n=t.selection.ranges){let r=n.map(a=>ote(t,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,o)=>f9t(t,r[o],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(n.map((a,o)=>s[o]?[]:[{from:a.from,insert:r[o].open+" "},{from:a.to,insert:" "+r[o].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let o=0,i;o<s.length;o++)if(i=s[o]){let c=r[o],{open:u,close:d}=i;a.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:a}}return null}function h9t(e,t,n=t.selection.ranges){let r=[],s=-1;for(let{from:a,to:o}of n){let i=r.length,c=1e9,u=ote(t,a).line;if(u){for(let d=a;d<=o;){let f=t.doc.lineAt(d);if(f.from>s&&(a==o||o>f.from)){s=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,g=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:g,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=i;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==i+1&&(r[i].single=!0)}}if(e!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:i,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&a.push({from:i.from+u,insert:c+" "});let o=t.changes(a);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:o,comment:i,token:c}of r)if(i>=0){let u=o.from+i,d=u+c.length;o.text[d-o.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const EW=zp.define(),m9t=zp.define(),g9t=Vt.define(),E6e=Vt.define({combine(e){return Bp(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,s)=>t(r,s)||n(r,s)})}}),C6e=xo.define({create(){return fp.empty},update(e,t){let n=t.state.facet(E6e),r=t.annotation(EW);if(r){let c=sc.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=CP(d,d.length,n.minDepth,c):d=A6e(d,t.startState.selection),new fp(u==0?r.rest:d,u==0?d:r.rest)}let s=t.annotation(m9t);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(jo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=sc.fromTransaction(t),o=t.annotation(jo.time),i=t.annotation(jo.userEvent);return a?e=e.addChanges(a,o,i,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,i,n.newGroupDelay)),(s=="full"||s=="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 fp(e.done.map(sc.fromJSON),e.undone.map(sc.fromJSON))}});function b9t(e={}){return[C6e,E6e.of(e),ct.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?T6e:t.inputType=="historyRedo"?CW:null;return r?(t.preventDefault(),r(n)):!1}})]}function D$(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let s=n.field(C6e,!1);if(!s)return!1;let a=s.pop(e,n,t);return a?(r(a),!0):!1}}const T6e=D$(0,!1),CW=D$(1,!1),y9t=D$(0,!0),v9t=D$(1,!0);class sc{constructor(t,n,r,s,a){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new sc(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(s=>s.toJSON())}}static fromJSON(t){return new sc(t.changes&&Co.fromJSON(t.changes),[],t.mapped&&xp.fromJSON(t.mapped),t.startSelection&&Ze.fromJSON(t.startSelection),t.selectionsAfter.map(Ze.fromJSON))}static fromTransaction(t,n){let r=ed;for(let s of t.startState.facet(g9t)){let a=s(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new sc(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,ed)}static selection(t){return new sc(void 0,ed,void 0,void 0,t)}}function CP(e,t,n,r){let s=t+1>n+20?t-n-1:0,a=e.slice(s,t);return a.push(r),a}function x9t(e,t){let n=[],r=!1;return e.iterChangedRanges((s,a)=>n.push(s,a)),t.iterChangedRanges((s,a,o,i)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];i>=u&&o<=d&&(r=!0)}}),r}function w9t(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function N6e(e,t){return e.length?t.length?e.concat(t):e:t}const ed=[],S9t=200;function A6e(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-S9t));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),CP(e,e.length-1,1e9,n.setSelAfter(r)))}else return[sc.selection([t])]}function O9t(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 EU(e,t){if(!e.length)return e;let n=e.length,r=ed;for(;n;){let s=k9t(e[n-1],t,r);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,n);return a[n-1]=s,a}else t=s.mapped,n--,r=s.selectionsAfter}return r.length?[sc.selection(r)]:ed}function k9t(e,t,n){let r=N6e(e.selectionsAfter.length?e.selectionsAfter.map(i=>i.map(t)):ed,n);if(!e.changes)return sc.selection(r);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new sc(s,Hn.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}const _9t=/^(input\.type|delete)($|\.)/;class fp{constructor(t,n,r=0,s=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new fp(this.done,this.undone):this}addChanges(t,n,r,s,a){let o=this.done,i=o[o.length-1];return i&&i.changes&&!i.changes.empty&&t.changes&&(!r||_9t.test(r))&&(!i.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,x9t(i.changes,t.changes))||r=="input.type.compose")?o=CP(o,o.length-1,s.minDepth,new sc(t.changes.compose(i.changes),N6e(Hn.mapEffects(t.effects,i.changes),i.effects),i.mapped,i.startSelection,ed)):o=CP(o,o.length,s.minDepth,t),new fp(o,ed,n,r)}addSelection(t,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:ed;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&w9t(a[a.length-1],t)?this:new fp(A6e(this.done,t),this.undone,n,r)}addMapping(t){return new fp(EU(this.done,t),EU(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],o=a.selectionsAfter[0]||n.selection;if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:EW.of({side:t,rest:O9t(s),selection:o}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let i=s.length==1?ed:s.slice(0,s.length-1);return a.mapped&&(i=EU(i,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:EW.of({side:t,rest:i,selection:o}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}fp.empty=new fp(ed,ed);const E9t=[{key:"Mod-z",run:T6e,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:CW,preventDefault:!0},{linux:"Ctrl-Shift-z",run:CW,preventDefault:!0},{key:"Mod-u",run:y9t,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:v9t,preventDefault:!0}];function o1(e,t){return Ze.create(e.ranges.map(t),e.mainIndex)}function bf(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function yf({state:e,dispatch:t},n){let r=o1(e.selection,n);return r.eq(e.selection,!0)?!1:(t(bf(e,r)),!0)}function L$(e,t){return Ze.cursor(t?e.to:e.from)}function j6e(e,t){return yf(e,n=>n.empty?e.moveByChar(n,t):L$(n,t))}function ol(e){return e.textDirectionAt(e.state.selection.main.head)==Js.LTR}const R6e=e=>j6e(e,!ol(e)),I6e=e=>j6e(e,ol(e));function P6e(e,t){return yf(e,n=>n.empty?e.moveByGroup(n,t):L$(n,t))}const C9t=e=>P6e(e,!ol(e)),T9t=e=>P6e(e,ol(e));function N9t(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 F$(e,t,n){let r=Qs(e).resolveInner(t.head),s=n?rr.closedBy:rr.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;N9t(e,u,s)?r=u:c=n?u.to:u.from}let a=r.type.prop(s),o,i;return a&&(o=n?dp(e,r.from,1):dp(e,r.to,-1))&&o.matched?i=n?o.end.to:o.end.from:i=n?r.to:r.from,Ze.cursor(i,n?-1:1)}const A9t=e=>yf(e,t=>F$(e.state,t,!ol(e))),j9t=e=>yf(e,t=>F$(e.state,t,ol(e)));function M6e(e,t){return yf(e,n=>{if(!n.empty)return L$(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const $6e=e=>M6e(e,!1),D6e=e=>M6e(e,!0);function L6e(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,s;if(t){for(let a of e.state.facet(ct.scrollMargins)){let o=a(e);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(r=Math.max(o?.bottom,r))}s=e.scrollDOM.clientHeight-n-r}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function F6e(e,t){let n=L6e(e),{state:r}=e,s=o1(r.selection,o=>o.empty?e.moveVertically(o,t,n.height):L$(o,t));if(s.eq(r.selection))return!1;let a;if(n.selfScroll){let o=e.coordsAtPos(r.selection.main.head),i=e.scrollDOM.getBoundingClientRect(),c=i.top+n.marginTop,u=i.bottom-n.marginBottom;o&&o.top>c&&o.bottom<u&&(a=ct.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-c}))}return e.dispatch(bf(r,s),{effects:a}),!0}const q0e=e=>F6e(e,!1),TW=e=>F6e(e,!0);function wb(e,t,n){let r=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,n);if(s.head==t.head&&s.head!=(n?r.to:r.from)&&(s=e.moveToLineBoundary(t,n,!1)),!n&&s.head==r.from&&r.length){let a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(s=Ze.cursor(r.from+a))}return s}const R9t=e=>yf(e,t=>wb(e,t,!0)),I9t=e=>yf(e,t=>wb(e,t,!1)),P9t=e=>yf(e,t=>wb(e,t,!ol(e))),M9t=e=>yf(e,t=>wb(e,t,ol(e))),$9t=e=>yf(e,t=>Ze.cursor(e.lineBlockAt(t.head).from,1)),D9t=e=>yf(e,t=>Ze.cursor(e.lineBlockAt(t.head).to,-1));function L9t(e,t,n){let r=!1,s=o1(e.selection,a=>{let o=dp(e,a.head,-1)||dp(e,a.head,1)||a.head>0&&dp(e,a.head-1,1)||a.head<e.doc.length&&dp(e,a.head+1,-1);if(!o||!o.end)return a;r=!0;let i=o.start.from==a.head?o.end.to:o.end.from;return Ze.cursor(i)});return r?(t(bf(e,s)),!0):!1}const F9t=({state:e,dispatch:t})=>L9t(e,t);function vd(e,t){let n=o1(e.state.selection,r=>{let s=t(r);return Ze.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(bf(e.state,n)),!0)}function z6e(e,t){return vd(e,n=>e.moveByChar(n,t))}const B6e=e=>z6e(e,!ol(e)),U6e=e=>z6e(e,ol(e));function V6e(e,t){return vd(e,n=>e.moveByGroup(n,t))}const z9t=e=>V6e(e,!ol(e)),B9t=e=>V6e(e,ol(e)),U9t=e=>vd(e,t=>F$(e.state,t,!ol(e))),V9t=e=>vd(e,t=>F$(e.state,t,ol(e)));function q6e(e,t){return vd(e,n=>e.moveVertically(n,t))}const H6e=e=>q6e(e,!1),Q6e=e=>q6e(e,!0);function G6e(e,t){return vd(e,n=>e.moveVertically(n,t,L6e(e).height))}const H0e=e=>G6e(e,!1),Q0e=e=>G6e(e,!0),q9t=e=>vd(e,t=>wb(e,t,!0)),H9t=e=>vd(e,t=>wb(e,t,!1)),Q9t=e=>vd(e,t=>wb(e,t,!ol(e))),G9t=e=>vd(e,t=>wb(e,t,ol(e))),W9t=e=>vd(e,t=>Ze.cursor(e.lineBlockAt(t.head).from)),Z9t=e=>vd(e,t=>Ze.cursor(e.lineBlockAt(t.head).to)),G0e=({state:e,dispatch:t})=>(t(bf(e,{anchor:0})),!0),W0e=({state:e,dispatch:t})=>(t(bf(e,{anchor:e.doc.length})),!0),Z0e=({state:e,dispatch:t})=>(t(bf(e,{anchor:e.selection.main.anchor,head:0})),!0),Y0e=({state:e,dispatch:t})=>(t(bf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Y9t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),X9t=({state:e,dispatch:t})=>{let n=z$(e).map(({from:r,to:s})=>Ze.range(r,Math.min(s+1,e.doc.length)));return t(e.update({selection:Ze.create(n),userEvent:"select"})),!0},K9t=({state:e,dispatch:t})=>{let n=o1(e.selection,r=>{let s=Qs(e),a=s.resolveStack(r.from,1);if(r.empty){let o=s.resolveStack(r.from,-1);o.node.from>=a.node.from&&o.node.to<=a.node.to&&(a=o)}for(let o=a;o;o=o.next){let{node:i}=o;if((i.from<r.from&&i.to>=r.to||i.to>r.to&&i.from<=r.from)&&o.next)return Ze.range(i.to,i.from)}return r});return n.eq(e.selection)?!1:(t(bf(e,n)),!0)};function W6e(e,t){let{state:n}=e,r=n.selection,s=n.selection.ranges.slice();for(let a of n.selection.ranges){let o=n.doc.lineAt(a.head);if(t?o.to<e.state.doc.length:o.from>0)for(let i=a;;){let c=e.moveVertically(i,t);if(c.head<o.from||c.head>o.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==i.head)break;i=c}}}return s.length==r.ranges.length?!1:(e.dispatch(bf(n,Ze.create(s,s.length-1))),!0)}const J9t=e=>W6e(e,!1),eFt=e=>W6e(e,!0),tFt=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Ze.create([n.main]):n.main.empty||(r=Ze.create([Ze.cursor(n.main.head)])),r?(t(bf(e,r)),!0):!1};function fT(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,s=r.changeByRange(a=>{let{from:o,to:i}=a;if(o==i){let c=t(a);c<o?(n="delete.backward",c=kj(e,c,!1)):c>o&&(n="delete.forward",c=kj(e,c,!0)),o=Math.min(o,c),i=Math.max(i,c)}else o=kj(e,o,!1),i=kj(e,i,!0);return o==i?{range:a}:{changes:{from:o,to:i},range:Ze.cursor(o,o<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ct.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function kj(e,t,n){if(e instanceof ct)for(let r of e.state.facet(ct.atomicRanges).map(s=>s(e)))r.between(t,t,(s,a)=>{s<t&&a>t&&(t=n?a:s)});return t}const Z6e=(e,t,n)=>fT(e,r=>{let s=r.from,{state:a}=e,o=a.doc.lineAt(s),i,c;if(n&&!t&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(i=o.text.slice(0,s-o.from))){if(i[i.length-1]==" ")return s-1;let u=of(i,a.tabSize),d=u%hv(a)||hv(a);for(let f=0;f<d&&i[i.length-1-f]==" ";f++)s--;c=s}else c=si(o.text,s-o.from,t,t)+o.from,c==s&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,s-o.from))&&(c=si(o.text,c-o.from,!1,!1)+o.from);return c}),NW=e=>Z6e(e,!1,!0),Y6e=e=>Z6e(e,!0,!1),X6e=(e,t)=>fT(e,n=>{let r=n.head,{state:s}=e,a=s.doc.lineAt(r),o=s.charCategorizer(r);for(let i=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?s.doc.lines:1)&&(r+=t?1:-1);break}let c=si(a.text,r-a.from,t)+a.from,u=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),d=o(u);if(i!=null&&d!=i)break;(u!=" "||r!=n.head)&&(i=d),r=c}return r}),K6e=e=>X6e(e,!1),nFt=e=>X6e(e,!0),rFt=e=>fT(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),sFt=e=>fT(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),aFt=e=>fT(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),oFt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Zr.of(["",""])},range:Ze.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},iFt=({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 s=r.from,a=e.doc.lineAt(s),o=s==a.from?s-1:si(a.text,s-a.from,!1)+a.from,i=s==a.to?s+1:si(a.text,s-a.from,!0)+a.from;return{changes:{from:o,to:i,insert:e.doc.slice(s,i).append(e.doc.slice(o,s))},range:Ze.cursor(i)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function z$(e){let t=[],n=-1;for(let r of e.selection.ranges){let s=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=s.number){let o=t[t.length-1];o.to=a.to,o.ranges.push(r)}else t.push({from:s.from,to:a.to,ranges:[r]});n=a.number+1}return t}function J6e(e,t,n){if(e.readOnly)return!1;let r=[],s=[];for(let a of z$(e)){if(n?a.to==e.doc.length:a.from==0)continue;let o=e.doc.lineAt(n?a.to+1:a.from-1),i=o.length+1;if(n){r.push({from:a.to,to:o.to},{from:a.from,insert:o.text+e.lineBreak});for(let c of a.ranges)s.push(Ze.range(Math.min(e.doc.length,c.anchor+i),Math.min(e.doc.length,c.head+i)))}else{r.push({from:o.from,to:a.from},{from:a.to,insert:e.lineBreak+o.text});for(let c of a.ranges)s.push(Ze.range(c.anchor-i,c.head-i))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Ze.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const lFt=({state:e,dispatch:t})=>J6e(e,t,!1),cFt=({state:e,dispatch:t})=>J6e(e,t,!0);function e9e(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of z$(e))n?r.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):r.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(r);return t(e.update({changes:s,selection:e.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const uFt=({state:e,dispatch:t})=>e9e(e,t,!1),dFt=({state:e,dispatch:t})=>e9e(e,t,!0),fFt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(z$(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),r=o1(t.selection,s=>{let a;if(e.lineWrapping){let o=e.lineBlockAt(s.head),i=e.coordsAtPos(s.head,s.assoc||1);i&&(a=o.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function pFt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Qs(e).resolveInner(t),r=n.childBefore(t),s=n.childAfter(t),a;return r&&s&&r.to<=t&&s.from>=t&&(a=r.type.prop(rr.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const X0e=t9e(!1),hFt=t9e(!0);function t9e(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(s=>{let{from:a,to:o}=s,i=t.doc.lineAt(a),c=!e&&a==o&&pFt(t,a);e&&(a=o=(o<=i.to?i:t.doc.lineAt(o)).to);let u=new R$(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=Eee(u,a);for(d==null&&(d=of(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));o<i.to&&/\s/.test(i.text[o-i.from]);)o++;c?{from:a,to:o}=c:a>i.from&&a<i.from+100&&!/\S/.test(i.text.slice(0,a))&&(a=i.from);let f=["",oE(t,d)];return c&&f.push(oE(t,u.lineIndent(i.from,-1))),{changes:{from:a,to:o,insert:Zr.of(f)},range:Ze.cursor(a+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function ite(e,t){let n=-1;return e.changeByRange(r=>{let s=[];for(let o=r.from;o<=r.to;){let i=e.doc.lineAt(o);i.number>n&&(r.empty||r.to>i.from)&&(t(i,s,r),n=i.number),o=i.to+1}let a=e.changes(s);return{changes:s,range:Ze.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const mFt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new R$(e,{overrideIndentation:a=>{let o=n[a];return o??-1}}),s=ite(e,(a,o,i)=>{let c=Eee(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=oE(e,c);(u!=d||i.from<a.from+u.length)&&(n[a.from]=c,o.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},n9e=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ite(e,(n,r)=>{r.push({from:n.from,insert:e.facet(r1)})}),{userEvent:"input.indent"})),!0),r9e=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ite(e,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=of(s,e.tabSize),o=0,i=oE(e,Math.max(0,a-hv(e)));for(;o<s.length&&o<i.length&&s.charCodeAt(o)==i.charCodeAt(o);)o++;r.push({from:n.from+o,to:n.from+s.length,insert:i.slice(o)})}),{userEvent:"delete.dedent"})),!0),gFt=e=>(e.setTabFocusMode(),!0),bFt=[{key:"Ctrl-b",run:R6e,shift:B6e,preventDefault:!0},{key:"Ctrl-f",run:I6e,shift:U6e},{key:"Ctrl-p",run:$6e,shift:H6e},{key:"Ctrl-n",run:D6e,shift:Q6e},{key:"Ctrl-a",run:$9t,shift:W9t},{key:"Ctrl-e",run:D9t,shift:Z9t},{key:"Ctrl-d",run:Y6e},{key:"Ctrl-h",run:NW},{key:"Ctrl-k",run:rFt},{key:"Ctrl-Alt-h",run:K6e},{key:"Ctrl-o",run:oFt},{key:"Ctrl-t",run:iFt},{key:"Ctrl-v",run:TW}],yFt=[{key:"ArrowLeft",run:R6e,shift:B6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:C9t,shift:z9t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:P9t,shift:Q9t,preventDefault:!0},{key:"ArrowRight",run:I6e,shift:U6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:T9t,shift:B9t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:M9t,shift:G9t,preventDefault:!0},{key:"ArrowUp",run:$6e,shift:H6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:G0e,shift:Z0e},{mac:"Ctrl-ArrowUp",run:q0e,shift:H0e},{key:"ArrowDown",run:D6e,shift:Q6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:W0e,shift:Y0e},{mac:"Ctrl-ArrowDown",run:TW,shift:Q0e},{key:"PageUp",run:q0e,shift:H0e},{key:"PageDown",run:TW,shift:Q0e},{key:"Home",run:I9t,shift:H9t,preventDefault:!0},{key:"Mod-Home",run:G0e,shift:Z0e},{key:"End",run:R9t,shift:q9t,preventDefault:!0},{key:"Mod-End",run:W0e,shift:Y0e},{key:"Enter",run:X0e,shift:X0e},{key:"Mod-a",run:Y9t},{key:"Backspace",run:NW,shift:NW,preventDefault:!0},{key:"Delete",run:Y6e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:K6e,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:nFt,preventDefault:!0},{mac:"Mod-Backspace",run:sFt,preventDefault:!0},{mac:"Mod-Delete",run:aFt,preventDefault:!0}].concat(bFt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),vFt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:A9t,shift:U9t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:j9t,shift:V9t},{key:"Alt-ArrowUp",run:lFt},{key:"Shift-Alt-ArrowUp",run:uFt},{key:"Alt-ArrowDown",run:cFt},{key:"Shift-Alt-ArrowDown",run:dFt},{key:"Mod-Alt-ArrowUp",run:J9t},{key:"Mod-Alt-ArrowDown",run:eFt},{key:"Escape",run:tFt},{key:"Mod-Enter",run:hFt},{key:"Alt-l",mac:"Ctrl-l",run:X9t},{key:"Mod-i",run:K9t,preventDefault:!0},{key:"Mod-[",run:r9e},{key:"Mod-]",run:n9e},{key:"Mod-Alt-\\",run:mFt},{key:"Shift-Mod-k",run:fFt},{key:"Shift-Mod-\\",run:F9t},{key:"Mod-/",run:l9t},{key:"Alt-A",run:u9t},{key:"Ctrl-m",mac:"Shift-Alt-m",run:gFt}].concat(yFt),xFt={key:"Tab",run:n9e,shift:r9e},K0e=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Qw{constructor(t,n,r=0,s=t.length,a,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,s),this.bufferStart=r,this.normalize=a?i=>a(K0e(i)):K0e,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 Xl(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=lee(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=np(t);let s=this.normalize(n);if(s.length)for(let a=0,o=r;;a++){let i=s.charCodeAt(a),c=this.match(i,o,this.bufferPos+this.bufferStart);if(a==s.length-1){if(c)return this.value=c,this;break}o==r&&a<n.length&&n.charCodeAt(a)==i&&o++}}}match(t,n,r){let s=null;for(let a=0;a<this.matches.length;a+=2){let o=this.matches[a],i=!1;this.query.charCodeAt(o)==t&&(o==this.query.length-1?s={from:this.matches[a+1],to:r}:(this.matches[a]++,i=!0)),i||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:n,to:r}:this.matches.push(1,n)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(Qw.prototype[Symbol.iterator]=function(){return this});const s9e={from:-1,to:-1,match:/.*/.exec("")},lte="gm"+(/x/.unicode==null?"":"u");class a9e{constructor(t,n,r,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=s9e,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new o9e(t,n,r,s,a);this.re=new RegExp(n,lte+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let o=t.lineAt(s);this.curLineStart=o.from,this.matchPos=TP(t,s),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,s=r+n[0].length;if(this.matchPos=TP(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,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 CU=new WeakMap;class pw{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let s=CU.get(t);if(!s||s.from>=r||s.to<=n){let i=new pw(n,t.sliceString(n,r));return CU.set(t,i),i}if(s.from==n&&s.to==r)return s;let{text:a,from:o}=s;return o>n&&(a=t.sliceString(n,o)+a,o=n),s.to<r&&(a+=t.sliceString(s.to,r)),CU.set(t,new pw(o,a)),new pw(n,a.slice(n-o,r-o))}}class o9e{constructor(t,n,r,s,a){this.text=t,this.to=a,this.done=!1,this.value=s9e,this.matchPos=TP(t,s),this.re=new RegExp(n,lte+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=pw.get(t,s,this.chunkEnd(s+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,s=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,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=TP(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pw.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(a9e.prototype[Symbol.iterator]=o9e.prototype[Symbol.iterator]=function(){return this});function wFt(e){try{return new RegExp(e,lte),!0}catch{return!1}}function TP(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 AW(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=Xs("input",{class:"cm-textfield",name:"line",value:t}),r=Xs("form",{class:"cm-gotoLine",onkeydown:a=>{a.keyCode==27?(a.preventDefault(),e.dispatch({effects:c_.of(!1)}),e.focus()):a.keyCode==13&&(a.preventDefault(),s())},onsubmit:a=>{a.preventDefault(),s()}},Xs("label",e.state.phrase("Go to line"),": ",n)," ",Xs("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),Xs("button",{name:"close",onclick:()=>{e.dispatch({effects:c_.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function s(){let a=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!a)return;let{state:o}=e,i=o.doc.lineAt(o.selection.main.head),[,c,u,d,f]=a,p=d?+d.slice(1):0,h=u?+u:i.number;if(u&&f){let y=h/100;c&&(y=y*(c=="-"?-1:1)+i.number/o.doc.lines),h=Math.round(o.doc.lines*y)}else u&&c&&(h=h*(c=="-"?-1:1)+i.number);let g=o.doc.line(Math.max(1,Math.min(o.doc.lines,h))),b=Ze.cursor(g.from+Math.max(0,Math.min(p,g.length)));e.dispatch({effects:[c_.of(!1),ct.scrollIntoView(b.from,{y:"center"})],selection:b}),e.focus()}return{dom:r}}const c_=Hn.define(),J0e=xo.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(c_)&&(e=n.value);return e},provide:e=>aE.from(e,t=>t?AW:null)}),SFt=e=>{let t=sE(e,AW);if(!t){let n=[c_.of(!0)];e.state.field(J0e,!1)==null&&n.push(Hn.appendConfig.of([J0e,OFt])),e.dispatch({effects:n}),t=sE(e,AW)}return t&&t.dom.querySelector("input").select(),!0},OFt=ct.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"}}}),kFt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},_Ft=Vt.define({combine(e){return Bp(e,kFt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function EFt(e){return[jFt,AFt]}const CFt=Wt.mark({class:"cm-selectionMatch"}),TFt=Wt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function ewe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Pa.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Pa.Word)}function NFt(e,t,n,r){return e(t.sliceDoc(n,n+1))==Pa.Word&&e(t.sliceDoc(r-1,r))==Pa.Word}const AFt=Ua.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(_Ft),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Wt.none;let s=r.main,a,o=null;if(s.empty){if(!t.highlightWordAroundCursor)return Wt.none;let c=n.wordAt(s.head);if(!c)return Wt.none;o=n.charCategorizer(s.head),a=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return Wt.none;if(t.wholeWords){if(a=n.sliceDoc(s.from,s.to),o=n.charCategorizer(s.head),!(ewe(o,n,s.from,s.to)&&NFt(o,n,s.from,s.to)))return Wt.none}else if(a=n.sliceDoc(s.from,s.to),!a)return Wt.none}let i=[];for(let c of e.visibleRanges){let u=new Qw(n.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||ewe(o,n,d,f))&&(s.empty&&d<=s.from&&f>=s.to?i.push(TFt.range(d,f)):(d>=s.to||f<=s.from)&&i.push(CFt.range(d,f)),i.length>t.maxMatches))return Wt.none}}return Wt.set(i)}},{decorations:e=>e.decorations}),jFt=ct.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),RFt=({state:e,dispatch:t})=>{let{selection:n}=e,r=Ze.create(n.ranges.map(s=>e.wordAt(s.head)||Ze.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function IFt(e,t){let{main:n,ranges:r}=e.selection,s=e.wordAt(n.head),a=s&&s.from==n.from&&s.to==n.to;for(let o=!1,i=new Qw(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(o)return null;i=new Qw(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(c=>c.from==i.value.from))continue;if(a){let c=e.wordAt(i.value.from);if(!c||c.from!=i.value.from||c.to!=i.value.to)continue}return i.value}}const PFt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return RFt({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=r))return!1;let s=IFt(e,r);return s?(t(e.update({selection:e.selection.addRange(Ze.range(s.from,s.to),!1),effects:ct.scrollIntoView(s.to)})),!0):!1},i1=Vt.define({combine(e){return Bp(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new QFt(t),scrollToMatch:t=>ct.scrollIntoView(t)})}});class i9e{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||wFt(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"?`
|
|
131
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),Ql('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ql('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],HLe=Yee.concat([Ql("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ql("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ql("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),$0e=new Z4e,QLe=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function jO(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const I6t=["FunctionDeclaration"],P6t={FunctionDeclaration:jO("function"),ClassDeclaration:jO("class"),ClassExpression:()=>!0,EnumDeclaration:jO("constant"),TypeAliasDeclaration:jO("type"),NamespaceDeclaration:jO("namespace"),VariableDefinition(e,t){e.matchContext(I6t)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function GLe(e,t){let n=$0e.get(t);if(n)return n;let r=[],s=!0;function a(o,i){let c=e.sliceString(o.from,o.to);r.push({label:c,type:i})}return t.cursor(js.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let i=P6t[o.name];if(i&&i(o,a)||QLe.has(o.name))return!1}else if(o.to-o.from>8192){for(let i of GLe(e,o.node))r.push(i);return!1}}),$0e.set(t,r),r}const _P=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Xee=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function WLe(e){let t=Qs(e.state).resolveInner(e.pos,-1);if(Xee.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&_P.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let s=t;s;s=s.parent)QLe.has(s.name)&&(r=r.concat(GLe(e.state.doc,s)));return{options:r,from:n?t.from:e.pos,validFor:_P}}function vU(e,t,n){var r;let s=[];for(;;){let a=t.firstChild,o;if(a?.name=="VariableName")return s.push(e(a)),{path:s.reverse(),name:n};if(a?.name=="MemberExpression"&&((r=o=a.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")s.push(e(o)),t=a;else return null}}function ZLe(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=Qs(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?vU(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?vU(t,n.parent,""):Xee.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&_P.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?vU(t,n,""):e.explicit?{path:[],name:""}:null}function M6t(e,t){let n=e,r=[],s=new Set;for(let a=0;;a++){for(let i of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(i)||s.has(i))continue;s.add(i);let c;try{c=n[i]}catch{continue}r.push({label:i,type:typeof c=="function"?/^[A-Z]/.test(i)?"class":t?"function":"method":t?"variable":"property",boost:-a})}let o=Object.getPrototypeOf(e);if(!o)return r;e=o}}function $6t(e){let t=new Map;return n=>{let r=ZLe(n);if(!r)return null;let s=e;for(let o of r.path)if(s=s[o],!s)return null;let a=t.get(s);return a||t.set(s,a=M6t(s,!r.path.length)),{from:n.pos-r.name.length,options:a,validFor:_P}}}const ad=dv.define({name:"javascript",parser:R6t.configure({props:[nx.add({IfStatement:dw({except:/^\s*({|else\b)/}),TryStatement:dw({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:R4t,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:j4t({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":dw({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}}),rx.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Tee,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:"$"}}),YLe={test:e=>/^JSX/.test(e.name),facet:j$({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Kee=ad.configure({dialect:"ts"},"typescript"),Jee=ad.configure({dialect:"jsx",props:[_ee.add(e=>e.isTop?[YLe]:void 0)]}),ete=ad.configure({dialect:"jsx ts",props:[_ee.add(e=>e.isTop?[YLe]:void 0)]},"typescript");let XLe=e=>({label:e,type:"keyword"});const KLe="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(XLe),D6t=KLe.concat(["declare","implements","private","protected","public"].map(XLe));function EP(e={}){let t=e.jsx?e.typescript?ete:Jee:e.typescript?Kee:ad,n=e.typescript?HLe.concat(D6t):Yee.concat(KLe);return new pv(t,[ad.data.of({autocomplete:b3t(Xee,G5e(n))}),ad.data.of({autocomplete:WLe}),e.jsx?JLe:[]])}function L6t(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 D0e(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 F6t=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),JLe=ct.inputHandler.of((e,t,n,r,s)=>{if((F6t?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!ad.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:o}=a,i=o.changeByRange(c=>{var u;let{head:d}=c,f=Qs(o).resolveInner(d-1,-1),p;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.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,g=h.parent;if(g&&h.from==d-2&&((p=D0e(o.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${p}>`;return{range:Ze.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(r==">"){let h=L6t(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(p=D0e(o.doc,h,d)))return{range:c,changes:{from:d,insert:`</${p}>`}}}}return{range:c}});return i.changes.empty?!1:(e.dispatch([a,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function z6t(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 s;!((s=n.meta.docs)===null||s===void 0)&&s.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,s=[];for(let{from:a,to:o}of ad.findRegions(r)){let i=r.doc.lineAt(a),c={line:i.number-1,col:a-i.from,pos:a};for(let u of e.verify(r.sliceDoc(a,o),t))s.push(B6t(u,r.doc,c))}return s}}function L0e(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function B6t(e,t,n){let r=L0e(e.line,e.column,t,n),s={from:r,to:e.endLine!=null&&e.endColumn!=1?L0e(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:a,text:o}=e.fix,i=a[0]+n.pos-r,c=a[1]+n.pos-r;s.actions=[{name:"fix",apply(u,d){u.dispatch({changes:{from:d+i,to:d+c,insert:o},scrollIntoView:!0})}}]}return s}const Oj=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:JLe,completionPath:ZLe,esLint:z6t,javascript:EP,javascriptLanguage:ad,jsxLanguage:Jee,localCompletionSource:WLe,scopeCompletionSource:$6t,snippets:Yee,tsxLanguage:ete,typescriptLanguage:Kee,typescriptSnippets:HLe},Symbol.toStringTag,{value:"Module"})),RO=["_blank","_self","_top","_parent"],xU=["ascii","utf-8","utf-16","latin1","latin1"],wU=["get","post","put","delete"],SU=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],$c=["true","false"],xn={},U6t={a:{attrs:{href:null,ping:null,type:null,media:null,target:RO,hreflang:null}},abbr:xn,address:xn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:xn,aside:xn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:xn,base:{attrs:{href:null,target:RO}},bdi:xn,bdo:xn,blockquote:{attrs:{cite:null}},body:xn,br:xn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:SU,formmethod:wU,formnovalidate:["novalidate"],formtarget:RO,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:xn,center:xn,cite:xn,code:xn,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:xn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:xn,div:xn,dl:xn,dt:xn,em:xn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:xn,figure:xn,footer:xn,form:{attrs:{action:null,name:null,"accept-charset":xU,autocomplete:["on","off"],enctype:SU,method:wU,novalidate:["novalidate"],target:RO}},h1:xn,h2:xn,h3:xn,h4:xn,h5:xn,h6:xn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:xn,hgroup:xn,hr:xn,html:{attrs:{manifest:null}},i:xn,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:SU,formmethod:wU,formnovalidate:["novalidate"],formtarget:RO,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:xn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:xn,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:xn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:xU,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:xn,noscript:xn,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:xn,param:{attrs:{name:null,value:null}},pre:xn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:xn,rt:xn,ruby:xn,samp:xn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:xU}},section:xn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:xn,source:{attrs:{src:null,type:null,media:null}},span:xn,strong:xn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:xn,summary:xn,sup:xn,table:xn,tbody:xn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:xn,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:xn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:xn,time:{attrs:{datetime:null}},title:xn,tr:xn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:xn,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:xn},e6e={accesskey:null,class:null,contenteditable:$c,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:$c,autocorrect:$c,autocapitalize:$c,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":$c,"aria-autocomplete":["inline","list","both","none"],"aria-busy":$c,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":$c,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":$c,"aria-hidden":$c,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":$c,"aria-multiselectable":$c,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":$c,"aria-relevant":null,"aria-required":$c,"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},t6e="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 t6e)e6e[e]=null;let mE=class{constructor(t,n){this.tags={...U6t,...t},this.globalAttrs={...e6e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};mE.default=new mE;function qw(e,t,n=e.length){if(!t)return"";let r=t.firstChild,s=r&&r.getChild("TagName");return s?e.sliceString(s.from,Math.min(s.to,n)):""}function Hw(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function n6e(e,t,n){let r=n.tags[qw(e,Hw(t))];return r?.children||n.allTags}function tte(e,t){let n=[];for(let r=Hw(t);r&&!r.type.isTop;r=Hw(r.parent)){let s=qw(e,r);if(s&&r.lastChild.name=="CloseTag")break;s&&n.indexOf(s)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(s)}return n}const r6e=/^[:\-\.\w\u00b7-\uffff]*$/;function F0e(e,t,n,r,s){let a=/\s*>/.test(e.sliceDoc(s,s+5))?"":">",o=Hw(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:s,options:n6e(e.doc,o,t).map(i=>({label:i,type:"type"})).concat(tte(e.doc,n).map((i,c)=>({label:"/"+i,apply:"/"+i+a,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function z0e(e,t,n,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:tte(e.doc,t).map((a,o)=>({label:a,apply:a+s,type:"type",boost:99-o})),validFor:r6e}}function V6t(e,t,n,r){let s=[],a=0;for(let o of n6e(e.doc,n,t))s.push({label:"<"+o,type:"type"});for(let o of tte(e.doc,n))s.push({label:"</"+o+">",type:"type",boost:99-a++});return{from:r,to:r,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function q6t(e,t,n,r,s){let a=Hw(n),o=a?t.tags[qw(e.doc,a)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?i:i.length?i.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:r6e}}function H6t(e,t,n,r,s){var a;let o=(a=n.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),i=[],c;if(o){let u=e.sliceDoc(o.from,o.to),d=t.globalAttrs[u];if(!d){let f=Hw(n),p=f?t.tags[qw(e.doc,f)]:null;d=p?.attrs&&p.attrs[u]}if(d){let f=e.sliceDoc(r,s).toLowerCase(),p='"',h='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",h=e.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),r++):c=/^[^\s<>='"]*$/;for(let g of d)i.push({label:g,apply:p+g+h,type:"constant"})}}return{from:r,to:s,options:i,validFor:c}}function s6e(e,t){let{state:n,pos:r}=t,s=Qs(n).resolveInner(r,-1),a=s.resolve(r);for(let o=r,i;a==s&&(i=s.childBefore(o));){let c=i.lastChild;if(!c||!c.type.isError||c.from<c.to)break;a=s=i,o=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?z0e(n,s,s.from,r):F0e(n,e,s,s.from,r):s.name=="StartTag"||s.name=="IncompleteTag"?F0e(n,e,s,r,r):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?z0e(n,s,r,r):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?q6t(n,e,s,s.name=="AttributeName"?s.from:r,r):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?H6t(n,e,s,s.name=="Is"?r:s.from,r):t.explicit&&(a.name=="Element"||a.name=="Text"||a.name=="Document")?V6t(n,e,s,r):null}function a6e(e){return s6e(mE.default,e)}function o6e(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new mE(t,n):mE.default;return s=>s6e(r,s)}const Q6t=ad.parser.configure({top:"SingleExpression"}),i6e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Kee.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Jee.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ete.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Q6t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:ad.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:hE.parser}],l6e=[{name:"style",parser:hE.parser.configure({top:"Styles"})}].concat(t6e.map(e=>({name:e,parser:ad.parser}))),c6e=dv.define({name:"html",parser:wLt.configure({props:[nx.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 s=r.lastChild;if(!s||s.name!="Element"||s.to!=r.to)break;t=r=s}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),rx.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}}}),z5e.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),l_=c6e.configure({wrap:MLe(i6e,l6e)});function u6e(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=MLe((e.nestedLanguages||[]).concat(i6e),(e.nestedAttributes||[]).concat(l6e)));let r=n?c6e.configure({wrap:n,dialect:t}):t?l_.configure({dialect:t}):l_;return new pv(r,[l_.data.of({autocomplete:o6e(e)}),e.autoCloseTags!==!1?d6e:[],EP().support,VLe().support])}const B0e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),d6e=ct.inputHandler.of((e,t,n,r,s)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!l_.isActiveAt(e.state,t,-1))return!1;let a=s(),{state:o}=a,i=o.changeByRange(c=>{var u,d,f;let p=o.doc.sliceString(c.from-1,c.to)==r,{head:h}=c,g=Qs(o).resolveInner(h,-1),b;if(p&&r==">"&&g.name=="EndTag"){let y=g.parent;if(((d=(u=y.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=qw(o.doc,y.parent,h))&&!B0e.has(b)){let x=h+(o.doc.sliceString(h,h+1)===">"?1:0),w=`</${b}>`;return{range:c,changes:{from:h,to:x,insert:w}}}}else if(p&&r=="/"&&g.name=="IncompleteCloseTag"){let y=g.parent;if(g.from==h-2&&((f=y.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=qw(o.doc,y,h))&&!B0e.has(b)){let x=h+(o.doc.sliceString(h,h+1)===">"?1:0),w=`${b}>`;return{range:Ze.cursor(h+w.length,-1),changes:{from:h,to:x,insert:w}}}}return{range:c}});return i.changes.empty?!1:(e.dispatch([a,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),G6t=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:d6e,html:u6e,htmlCompletionSource:a6e,htmlCompletionSourceWith:o6e,htmlLanguage:l_},Symbol.toStringTag,{value:"Module"})),f6e=j$({commentTokens:{block:{open:"<!--",close:"-->"}}}),p6e=new rr,h6e=O5t.configure({props:[rx.add(e=>!e.is("Block")||e.is("Document")||_W(e)!=null||W6t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),p6e.add(_W),nx.add({Document:()=>null}),Sg.add({Document:f6e})]});function _W(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function W6t(e){return e.name=="OrderedList"||e.name=="BulletList"}function Z6t(e,t){let n=e;for(;;){let r=n.nextSibling,s;if(!r||(s=_W(r.type))!=null&&s<=t)break;n=r}return n.to}const Y6t=T5e.of((e,t,n)=>{for(let r=Qs(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let s=r.type.prop(p6e);if(s==null)continue;let a=Z6t(r,s);if(a>n)return{from:n,to:a}}return null});function nte(e){return new Kc(f6e,e,[],"markdown")}const m6e=nte(h6e),X6t=h6e.configure([P5t,$5t,M5t,D5t,{props:[rx.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),gv=nte(X6t);function K6t(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=Ve.matchLanguageName(e,n,!0),r instanceof Ve)return r.support?r.support.language.parser:fv.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}class OU{constructor(t,n,r,s,a,o,i){this.node=t,this.from=n,this.to=r,this.spaceBefore=s,this.spaceAfter=a,this.type=o,this.item=i}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 s=this.to-this.from-r.length-this.spaceAfter.length;s>0;s--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+b6e(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function g6e(e,t){let n=[],r=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return r;(s.name=="ListItem"||s.name=="Blockquote")&&n.push(s)}for(let s=n.length-1;s>=0;s--){let a=n[s],o,i=t.lineAt(a.from),c=a.from-i.from;if(a.name=="Blockquote"&&(o=/^ *>( ?)/.exec(i.text.slice(c))))r.push(new OU(a,c,c+o[0].length,"",o[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(i.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),r.push(new OU(a.parent,c,c+d,o[1],u,o[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(i.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),r.push(new OU(a.parent,c,c+d,o[1],u,f,a))}}return r}function b6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function kU(e,t,n,r=0){for(let s=-1,a=e;;){if(a.name=="ListItem"){let i=b6e(a,t),c=+i[2];if(s>=0){if(c!=s+1)return;n.push({from:a.from+i[1].length,to:a.from+i[0].length,insert:String(s+2+r)})}s=c}let o=a.nextSibling;if(!o)break;a=o}}function rte(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(r1)!=" ")return e;let r=of(e,4,n),s="";for(let a=r;a>0;)a>=4?(s+=" ",a-=4):(s+=" ",a--);return s+e.slice(n)}const y6e=(e={})=>({state:t,dispatch:n})=>{let r=Qs(t),{doc:s}=t,a=null,o=t.changeByRange(i=>{if(!i.empty||!gv.isActiveAt(t,i.from,-1)&&!gv.isActiveAt(t,i.from,1))return a={range:i};let c=i.from,u=s.lineAt(c),d=g6e(r.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return a={range:i};let f=d[d.length-1];if(f.to-f.spaceAfter.length>c-u.from)return a={range:i};let p=c>=f.to-f.spaceAfter.length&&!/\S/.test(u.text.slice(f.to));if(f.item&&p){let x=f.node.firstChild,w=f.node.getChild("ListItem","ListItem");if(x.to>=c||w&&w.to<c||u.from>0&&!/[^\s>]/.test(s.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(s,1)):k=u.from+(O?O.to:0);let C=[{from:k,to:c,insert:E}];return f.node.name=="OrderedList"&&kU(f.item,s,C,-2),O&&O.node.name=="OrderedList"&&kU(O.item,s,C),{range:Ze.cursor(k+E.length),changes:C}}else{let O=V0e(d,t,u);return{range:Ze.cursor(c+O.length+1),changes:{from:u.from,insert:O+t.lineBreak}}}}if(f.node.name=="Blockquote"&&p&&u.from){let x=s.lineAt(u.from-1),w=/>\s*$/.exec(x.text);if(w&&w.index==f.from){let O=t.changes([{from:x.from+w.index,to:x.to},{from:u.from+f.from,to:u.to}]);return{range:i.map(O),changes:O}}}let h=[];f.node.name=="OrderedList"&&kU(f.item,s,h);let g=f.item&&f.item.from<u.from,b="";if(!g||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=f.to)for(let x=0,w=d.length-1;x<=w;x++)b+=x==w&&!g?d[x].marker(s,1):d[x].blank(x<w?of(u.text,4,d[x+1].from)-b.length:null);let y=c;for(;y>u.from&&/\s/.test(u.text.charAt(y-u.from-1));)y--;return b=rte(b,t),J6t(f.node,t.doc)&&(b=V0e(d,t,u)+t.lineBreak+b),h.push({from:y,to:c,insert:t.lineBreak+b}),{range:Ze.cursor(y+b.length+1),changes:h}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},v6e=y6e();function U0e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function J6t(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 s=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<a.number}function V0e(e,t,n){let r="";for(let s=0,a=e.length-2;s<=a;s++)r+=e[s].blank(s<a?of(n.text,4,e[s+1].from)-r.length:null,s<a);return rte(r,t)}function e9t(e,t){let n=e.resolveInner(t,-1),r=t;U0e(n)&&(r=n.from,n=n.parent);for(let s;s=n.childBefore(r);)if(U0e(s))r=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")n=s.lastChild,r=n.to;else break;return n}const x6e=({state:e,dispatch:t})=>{let n=Qs(e),r=null,s=e.changeByRange(a=>{let o=a.from,{doc:i}=e;if(a.empty&&gv.isActiveAt(e,a.from)){let c=i.lineAt(o),u=g6e(e9t(n,o),i);if(u.length){let d=u[u.length-1],f=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>f&&!/\S/.test(c.text.slice(f,o-c.from)))return{range:Ze.cursor(c.from+f),changes:{from:c.from+f,to:o}};if(o-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(of(c.text,4,d.to)-of(c.text,4,d.from));return p==c.from&&(h=rte(h,e)),{range:Ze.cursor(p+h.length),changes:{from:p,to:c.from+d.to,insert:h}}}if(p<o)return{range:Ze.cursor(p),changes:{from:p,to:o}}}}}return r={range:a}});return r?!1:(t(e.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},w6e=[{key:"Enter",run:v6e},{key:"Backspace",run:x6e}],S6e=u6e({matchClosingTags:!1});function ste(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:s}=m6e,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:i=S6e}=e;if(!(s instanceof M$))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],u=[i.support,Y6t],d;o&&u.push(O6e),n instanceof pv?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?K6t(t,d):void 0;c.push(_5t({codeParser:f,htmlParser:i.language.parser})),r&&u.push(gf.high(n1.of(w6e)));let p=nte(s.configure(c));return a&&u.push(p.data.of({autocomplete:t9t})),new pv(p,u)}function t9t(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let s=Qs(t).resolveInner(n,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:n-r[0].length,to:n,options:n9t(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let _U=null;function n9t(){if(_U)return _U;let e=a6e(new Pee(wr.create({extensions:S6e}),0,!0));return _U=e?e.options:[]}const r9t=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,O6e=ct.domEventHandlers({paste:(e,t)=>{var n;let{main:r}=t.state.selection;if(r.empty)return!1;let s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!gv.isActiveAt(t.state,r.from,1)))return!1;let a=Qs(t.state),o=!1;return a.iterate({from:r.from,to:r.to,enter:i=>{(i.from>r.from||r9t.test(i.name))&&(o=!0)},leave:i=>{i.to<r.to&&(o=!0)}}),o?!1:(t.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),s9t=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:m6e,deleteMarkupBackward:x6e,insertNewlineContinueMarkup:v6e,insertNewlineContinueMarkupCommand:y6e,markdown:ste,markdownKeymap:w6e,markdownLanguage:gv,pasteURLAsLink:O6e},Symbol.toStringTag,{value:"Module"}));function ot(e){return new pv(Aee.define(e))}function Ym(e){return He(()=>import("./index-BmdI5Etm.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const k6e=[Ve.of({name:"C",extensions:["c","h","ino"],load(){return He(()=>import("./index-YV0XHlhV.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ve.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return He(()=>import("./index-YV0XHlhV.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.cpp())}}),Ve.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ym("Cassandra")}}),Ve.of({name:"CSS",extensions:["css"],load(){return He(()=>Promise.resolve().then(()=>t6t),void 0,import.meta.url).then(e=>e.css())}}),Ve.of({name:"Go",extensions:["go"],load(){return He(()=>import("./index-BvLhhfBj.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.go())}}),Ve.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return He(()=>Promise.resolve().then(()=>G6t),void 0,import.meta.url).then(e=>e.html())}}),Ve.of({name:"Java",extensions:["java"],load(){return He(()=>import("./index-vKFuEiUr.js"),__vite__mapDeps([4,1]),import.meta.url).then(e=>e.java())}}),Ve.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return He(()=>Promise.resolve().then(()=>Oj),void 0,import.meta.url).then(e=>e.javascript())}}),Ve.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return He(()=>import("./index-U38BugWW.js"),__vite__mapDeps([5,1]),import.meta.url).then(e=>e.jinja())}}),Ve.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return He(()=>Promise.resolve().then(()=>m3t),void 0,import.meta.url).then(e=>e.json())}}),Ve.of({name:"JSX",extensions:["jsx"],load(){return He(()=>Promise.resolve().then(()=>Oj),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),Ve.of({name:"LESS",extensions:["less"],load(){return He(()=>import("./index-DUBeZ9vI.js"),__vite__mapDeps([6,1]),import.meta.url).then(e=>e.less())}}),Ve.of({name:"Liquid",extensions:["liquid"],load(){return He(()=>import("./index-ZrOwCgQi.js"),__vite__mapDeps([7,1]),import.meta.url).then(e=>e.liquid())}}),Ve.of({name:"MariaDB SQL",load(){return Ym("MariaSQL")}}),Ve.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return He(()=>Promise.resolve().then(()=>s9t),void 0,import.meta.url).then(e=>e.markdown())}}),Ve.of({name:"MS SQL",load(){return Ym("MSSQL")}}),Ve.of({name:"MySQL",load(){return Ym("MySQL")}}),Ve.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return He(()=>import("./index-D6FzeZM6.js"),__vite__mapDeps([8,1]),import.meta.url).then(e=>e.php())}}),Ve.of({name:"PLSQL",extensions:["pls"],load(){return Ym("PLSQL")}}),Ve.of({name:"PostgreSQL",load(){return Ym("PostgreSQL")}}),Ve.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return He(()=>import("./index-B1rhwhE7.js"),__vite__mapDeps([9,1]),import.meta.url).then(e=>e.python())}}),Ve.of({name:"Rust",extensions:["rs"],load(){return He(()=>import("./index-mipr_ryQ.js"),__vite__mapDeps([10,1]),import.meta.url).then(e=>e.rust())}}),Ve.of({name:"Sass",extensions:["sass"],load(){return He(()=>import("./index-BJMc51Hz.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass({indented:!0}))}}),Ve.of({name:"SCSS",extensions:["scss"],load(){return He(()=>import("./index-BJMc51Hz.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>e.sass())}}),Ve.of({name:"SQL",extensions:["sql"],load(){return Ym("StandardSQL")}}),Ve.of({name:"SQLite",load(){return Ym("SQLite")}}),Ve.of({name:"TSX",extensions:["tsx"],load(){return He(()=>Promise.resolve().then(()=>Oj),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),Ve.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return He(()=>Promise.resolve().then(()=>Oj),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),Ve.of({name:"WebAssembly",extensions:["wat","wast"],load(){return He(()=>import("./index-ipntDTZg.js"),__vite__mapDeps([12,1]),import.meta.url).then(e=>e.wast())}}),Ve.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return He(()=>import("./index-D3kQdmAX.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>e.xml())}}),Ve.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return He(()=>import("./index-Bo-k2QR6.js"),__vite__mapDeps([14,1]),import.meta.url).then(e=>e.yaml())}}),Ve.of({name:"APL",extensions:["dyalog","apl"],load(){return He(()=>import("./apl-B4CMkyY2.js"),[],import.meta.url).then(e=>ot(e.apl))}}),Ve.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return He(()=>import("./asciiarmor-Df11BRmG.js"),[],import.meta.url).then(e=>ot(e.asciiArmor))}}),Ve.of({name:"ASN.1",extensions:["asn","asn1"],load(){return He(()=>import("./asn1-EdZsLKOL.js"),[],import.meta.url).then(e=>ot(e.asn1({})))}}),Ve.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return He(()=>import("./asterisk-B-8jnY81.js"),[],import.meta.url).then(e=>ot(e.asterisk))}}),Ve.of({name:"Brainfuck",extensions:["b","bf"],load(){return He(()=>import("./brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(e=>ot(e.brainfuck))}}),Ve.of({name:"Cobol",extensions:["cob","cpy"],load(){return He(()=>import("./cobol-CWcv1MsR.js"),[],import.meta.url).then(e=>ot(e.cobol))}}),Ve.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.csharp))}}),Ve.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return He(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ot(e.clojure))}}),Ve.of({name:"ClojureScript",extensions:["cljs"],load(){return He(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ot(e.clojure))}}),Ve.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return He(()=>import("./css-BnMrqG3P.js"),[],import.meta.url).then(e=>ot(e.gss))}}),Ve.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return He(()=>import("./cmake-BQqOBYOt.js"),[],import.meta.url).then(e=>ot(e.cmake))}}),Ve.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return He(()=>import("./coffeescript-S37ZYGWr.js"),[],import.meta.url).then(e=>ot(e.coffeeScript))}}),Ve.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return He(()=>import("./commonlisp-DBKNyK5s.js"),[],import.meta.url).then(e=>ot(e.commonLisp))}}),Ve.of({name:"Cypher",extensions:["cyp","cypher"],load(){return He(()=>import("./cypher-C_CwsFkJ.js"),[],import.meta.url).then(e=>ot(e.cypher))}}),Ve.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return He(()=>import("./python-BuPzkPfP.js"),[],import.meta.url).then(e=>ot(e.cython))}}),Ve.of({name:"Crystal",extensions:["cr"],load(){return He(()=>import("./crystal-SjHAIU92.js"),[],import.meta.url).then(e=>ot(e.crystal))}}),Ve.of({name:"D",extensions:["d"],load(){return He(()=>import("./d-pRatUO7H.js"),[],import.meta.url).then(e=>ot(e.d))}}),Ve.of({name:"Dart",extensions:["dart"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.dart))}}),Ve.of({name:"diff",extensions:["diff","patch"],load(){return He(()=>import("./diff-DbItnlRl.js"),[],import.meta.url).then(e=>ot(e.diff))}}),Ve.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return He(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([15,16]),import.meta.url).then(e=>ot(e.dockerFile))}}),Ve.of({name:"DTD",extensions:["dtd"],load(){return He(()=>import("./dtd-DF_7sFjM.js"),[],import.meta.url).then(e=>ot(e.dtd))}}),Ve.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return He(()=>import("./dylan-DwRh75JA.js"),[],import.meta.url).then(e=>ot(e.dylan))}}),Ve.of({name:"EBNF",load(){return He(()=>import("./ebnf-CDyGwa7X.js"),[],import.meta.url).then(e=>ot(e.ebnf))}}),Ve.of({name:"ECL",extensions:["ecl"],load(){return He(()=>import("./ecl-Cabwm37j.js"),[],import.meta.url).then(e=>ot(e.ecl))}}),Ve.of({name:"edn",extensions:["edn"],load(){return He(()=>import("./clojure-BMjYHr_A.js"),[],import.meta.url).then(e=>ot(e.clojure))}}),Ve.of({name:"Eiffel",extensions:["e"],load(){return He(()=>import("./eiffel-CnydiIhH.js"),[],import.meta.url).then(e=>ot(e.eiffel))}}),Ve.of({name:"Elm",extensions:["elm"],load(){return He(()=>import("./elm-vLlmbW-K.js"),[],import.meta.url).then(e=>ot(e.elm))}}),Ve.of({name:"Erlang",extensions:["erl"],load(){return He(()=>import("./erlang-BNw1qcRV.js"),[],import.meta.url).then(e=>ot(e.erlang))}}),Ve.of({name:"Esper",load(){return He(()=>import("./sql-D0XecflT.js"),[],import.meta.url).then(e=>ot(e.esper))}}),Ve.of({name:"Factor",extensions:["factor"],load(){return He(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([17,16]),import.meta.url).then(e=>ot(e.factor))}}),Ve.of({name:"FCL",load(){return He(()=>import("./fcl-Kvtd6kyn.js"),[],import.meta.url).then(e=>ot(e.fcl))}}),Ve.of({name:"Forth",extensions:["forth","fth","4th"],load(){return He(()=>import("./forth-Ffai-XNe.js"),[],import.meta.url).then(e=>ot(e.forth))}}),Ve.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return He(()=>import("./fortran-DYz_wnZ1.js"),[],import.meta.url).then(e=>ot(e.fortran))}}),Ve.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return He(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ot(e.fSharp))}}),Ve.of({name:"Gas",extensions:["s"],load(){return He(()=>import("./gas-Bneqetm1.js"),[],import.meta.url).then(e=>ot(e.gas))}}),Ve.of({name:"Gherkin",extensions:["feature"],load(){return He(()=>import("./gherkin-heZmZLOM.js"),[],import.meta.url).then(e=>ot(e.gherkin))}}),Ve.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return He(()=>import("./groovy-D9Dt4D0W.js"),[],import.meta.url).then(e=>ot(e.groovy))}}),Ve.of({name:"Haskell",extensions:["hs"],load(){return He(()=>import("./haskell-Cw1EW3IL.js"),[],import.meta.url).then(e=>ot(e.haskell))}}),Ve.of({name:"Haxe",extensions:["hx"],load(){return He(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ot(e.haxe))}}),Ve.of({name:"HXML",extensions:["hxml"],load(){return He(()=>import("./haxe-H-WmDvRZ.js"),[],import.meta.url).then(e=>ot(e.hxml))}}),Ve.of({name:"HTTP",load(){return He(()=>import("./http-DBlCnlav.js"),[],import.meta.url).then(e=>ot(e.http))}}),Ve.of({name:"IDL",extensions:["pro"],load(){return He(()=>import("./idl-BEugSyMb.js"),[],import.meta.url).then(e=>ot(e.idl))}}),Ve.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return He(()=>import("./javascript-iXu5QeM3.js"),[],import.meta.url).then(e=>ot(e.jsonld))}}),Ve.of({name:"Julia",extensions:["jl"],load(){return He(()=>import("./julia-DuME0IfC.js"),[],import.meta.url).then(e=>ot(e.julia))}}),Ve.of({name:"Kotlin",extensions:["kt","kts"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.kotlin))}}),Ve.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return He(()=>import("./livescript-BwQOo05w.js"),[],import.meta.url).then(e=>ot(e.liveScript))}}),Ve.of({name:"Lua",extensions:["lua"],load(){return He(()=>import("./lua-BgMRiT3U.js"),[],import.meta.url).then(e=>ot(e.lua))}}),Ve.of({name:"mIRC",extensions:["mrc"],load(){return He(()=>import("./mirc-CjQqDB4T.js"),[],import.meta.url).then(e=>ot(e.mirc))}}),Ve.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return He(()=>import("./mathematica-DTrFuWx2.js"),[],import.meta.url).then(e=>ot(e.mathematica))}}),Ve.of({name:"Modelica",extensions:["mo"],load(){return He(()=>import("./modelica-Dc1JOy9r.js"),[],import.meta.url).then(e=>ot(e.modelica))}}),Ve.of({name:"MUMPS",extensions:["mps"],load(){return He(()=>import("./mumps-BT43cFF4.js"),[],import.meta.url).then(e=>ot(e.mumps))}}),Ve.of({name:"Mbox",extensions:["mbox"],load(){return He(()=>import("./mbox-CNhZ1qSd.js"),[],import.meta.url).then(e=>ot(e.mbox))}}),Ve.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return He(()=>import("./nginx-DdIZxoE0.js"),[],import.meta.url).then(e=>ot(e.nginx))}}),Ve.of({name:"NSIS",extensions:["nsh","nsi"],load(){return He(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([18,16]),import.meta.url).then(e=>ot(e.nsis))}}),Ve.of({name:"NTriples",extensions:["nt","nq"],load(){return He(()=>import("./ntriples-BfvgReVJ.js"),[],import.meta.url).then(e=>ot(e.ntriples))}}),Ve.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.objectiveC))}}),Ve.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.objectiveCpp))}}),Ve.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return He(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ot(e.oCaml))}}),Ve.of({name:"Octave",extensions:["m"],load(){return He(()=>import("./octave-Ck1zUtKM.js"),[],import.meta.url).then(e=>ot(e.octave))}}),Ve.of({name:"Oz",extensions:["oz"],load(){return He(()=>import("./oz-BzwKVEFT.js"),[],import.meta.url).then(e=>ot(e.oz))}}),Ve.of({name:"Pascal",extensions:["p","pas"],load(){return He(()=>import("./pascal--L3eBynH.js"),[],import.meta.url).then(e=>ot(e.pascal))}}),Ve.of({name:"Perl",extensions:["pl","pm"],load(){return He(()=>import("./perl-CdXCOZ3F.js"),[],import.meta.url).then(e=>ot(e.perl))}}),Ve.of({name:"Pig",extensions:["pig"],load(){return He(()=>import("./pig-CevX1Tat.js"),[],import.meta.url).then(e=>ot(e.pig))}}),Ve.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return He(()=>import("./powershell-CaxLzxiJ.js"),[],import.meta.url).then(e=>ot(e.powerShell))}}),Ve.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return He(()=>import("./properties-C78fOPTZ.js"),[],import.meta.url).then(e=>ot(e.properties))}}),Ve.of({name:"ProtoBuf",extensions:["proto"],load(){return He(()=>import("./protobuf-ChK-085T.js"),[],import.meta.url).then(e=>ot(e.protobuf))}}),Ve.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return He(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([19,20]),import.meta.url).then(e=>ot(e.pug))}}),Ve.of({name:"Puppet",extensions:["pp"],load(){return He(()=>import("./puppet-DMA9R1ak.js"),[],import.meta.url).then(e=>ot(e.puppet))}}),Ve.of({name:"Q",extensions:["q"],load(){return He(()=>import("./q-pXgVlZs6.js"),[],import.meta.url).then(e=>ot(e.q))}}),Ve.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return He(()=>import("./r-B6wPVr8A.js"),[],import.meta.url).then(e=>ot(e.r))}}),Ve.of({name:"RPM Changes",load(){return He(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ot(e.rpmChanges))}}),Ve.of({name:"RPM Spec",extensions:["spec"],load(){return He(()=>import("./rpm-CTu-6PCP.js"),[],import.meta.url).then(e=>ot(e.rpmSpec))}}),Ve.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return He(()=>import("./ruby-B2Rjki9n.js"),[],import.meta.url).then(e=>ot(e.ruby))}}),Ve.of({name:"SAS",extensions:["sas"],load(){return He(()=>import("./sas-B4kiWyti.js"),[],import.meta.url).then(e=>ot(e.sas))}}),Ve.of({name:"Scala",extensions:["scala"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.scala))}}),Ve.of({name:"Scheme",extensions:["scm","ss"],load(){return He(()=>import("./scheme-C41bIUwD.js"),[],import.meta.url).then(e=>ot(e.scheme))}}),Ve.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return He(()=>import("./shell-CjFT_Tl9.js"),[],import.meta.url).then(e=>ot(e.shell))}}),Ve.of({name:"Sieve",extensions:["siv","sieve"],load(){return He(()=>import("./sieve-C3Gn_uJK.js"),[],import.meta.url).then(e=>ot(e.sieve))}}),Ve.of({name:"Smalltalk",extensions:["st"],load(){return He(()=>import("./smalltalk-CnHTOXQT.js"),[],import.meta.url).then(e=>ot(e.smalltalk))}}),Ve.of({name:"Solr",load(){return He(()=>import("./solr-DehyRSwq.js"),[],import.meta.url).then(e=>ot(e.solr))}}),Ve.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return He(()=>import("./mllike-BO34x3tv.js"),[],import.meta.url).then(e=>ot(e.sml))}}),Ve.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return He(()=>import("./sparql-DkYu6x3z.js"),[],import.meta.url).then(e=>ot(e.sparql))}}),Ve.of({name:"Spreadsheet",alias:["excel","formula"],load(){return He(()=>import("./spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(e=>ot(e.spreadsheet))}}),Ve.of({name:"Squirrel",extensions:["nut"],load(){return He(()=>import("./clike-B9uivgTg.js"),[],import.meta.url).then(e=>ot(e.squirrel))}}),Ve.of({name:"Stylus",extensions:["styl"],load(){return He(()=>import("./stylus-B533Al4x.js"),[],import.meta.url).then(e=>ot(e.stylus))}}),Ve.of({name:"Swift",extensions:["swift"],load(){return He(()=>import("./swift-BzpIVaGY.js"),[],import.meta.url).then(e=>ot(e.swift))}}),Ve.of({name:"sTeX",load(){return He(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ot(e.stex))}}),Ve.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return He(()=>import("./stex-C3f8Ysf7.js"),[],import.meta.url).then(e=>ot(e.stex))}}),Ve.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return He(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ot(e.verilog))}}),Ve.of({name:"Tcl",extensions:["tcl"],load(){return He(()=>import("./tcl-DVfN8rqt.js"),[],import.meta.url).then(e=>ot(e.tcl))}}),Ve.of({name:"Textile",extensions:["textile"],load(){return He(()=>import("./textile-CnDTJFAw.js"),[],import.meta.url).then(e=>ot(e.textile))}}),Ve.of({name:"TiddlyWiki",load(){return He(()=>import("./tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(e=>ot(e.tiddlyWiki))}}),Ve.of({name:"Tiki wiki",load(){return He(()=>import("./tiki-DGYXhP31.js"),[],import.meta.url).then(e=>ot(e.tiki))}}),Ve.of({name:"TOML",extensions:["toml"],load(){return He(()=>import("./toml-Bm5Em-hy.js"),[],import.meta.url).then(e=>ot(e.toml))}}),Ve.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return He(()=>import("./troff-wAsdV37c.js"),[],import.meta.url).then(e=>ot(e.troff))}}),Ve.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return He(()=>import("./ttcn-CfJYG6tj.js"),[],import.meta.url).then(e=>ot(e.ttcn))}}),Ve.of({name:"TTCN_CFG",extensions:["cfg"],load(){return He(()=>import("./ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(e=>ot(e.ttcnCfg))}}),Ve.of({name:"Turtle",extensions:["ttl"],load(){return He(()=>import("./turtle-B1tBg_DP.js"),[],import.meta.url).then(e=>ot(e.turtle))}}),Ve.of({name:"Web IDL",extensions:["webidl"],load(){return He(()=>import("./webidl-ZXfAyPTL.js"),[],import.meta.url).then(e=>ot(e.webIDL))}}),Ve.of({name:"VB.NET",extensions:["vb"],load(){return He(()=>import("./vb-CmGdzxic.js"),[],import.meta.url).then(e=>ot(e.vb))}}),Ve.of({name:"VBScript",extensions:["vbs"],load(){return He(()=>import("./vbscript-BuJXcnF6.js"),[],import.meta.url).then(e=>ot(e.vbScript))}}),Ve.of({name:"Velocity",extensions:["vtl"],load(){return He(()=>import("./velocity-D8B20fx6.js"),[],import.meta.url).then(e=>ot(e.velocity))}}),Ve.of({name:"Verilog",extensions:["v"],load(){return He(()=>import("./verilog-C6RDOZhf.js"),[],import.meta.url).then(e=>ot(e.verilog))}}),Ve.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return He(()=>import("./vhdl-lSbBsy5d.js"),[],import.meta.url).then(e=>ot(e.vhdl))}}),Ve.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return He(()=>import("./xquery-DzFWVndE.js"),[],import.meta.url).then(e=>ot(e.xQuery))}}),Ve.of({name:"Yacas",extensions:["ys"],load(){return He(()=>import("./yacas-BJ4BC0dw.js"),[],import.meta.url).then(e=>ot(e.yacas))}}),Ve.of({name:"Z80",extensions:["z80"],load(){return He(()=>import("./z80-Hz9HOZM7.js"),[],import.meta.url).then(e=>ot(e.z80))}}),Ve.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return He(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ot(e.mscgen))}}),Ve.of({name:"Xù",extensions:["xu"],load(){return He(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ot(e.xu))}}),Ve.of({name:"MsGenny",extensions:["msgenny"],load(){return He(()=>import("./mscgen-BA5vi2Kp.js"),[],import.meta.url).then(e=>ot(e.msgenny))}}),Ve.of({name:"Vue",extensions:["vue"],load(){return He(()=>import("./index-khWoa2hy.js"),__vite__mapDeps([21,1]),import.meta.url).then(e=>e.vue())}}),Ve.of({name:"Angular Template",load(){return He(()=>import("./index-BhR-xhPW.js"),__vite__mapDeps([22,1]),import.meta.url).then(e=>e.angular())}})];var a9t=e=>{var{theme:t,settings:n={},styles:r=[]}=e,s={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(s["&"]=a),n.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(s[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(s[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(s[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(s[".cm-content"]={caretColor:n.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var o={};n.gutterActiveForeground&&(o.color=n.gutterActiveForeground),n.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:n.lineHighlight},o.backgroundColor=n.lineHighlight),s[".cm-activeLineGutter"]=o,n.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var i=ct.theme(s,{dark:t==="dark"}),c=s1.define(r),u=[i,Nee(c)];return u},o9t={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)"},i9t=[{tag:le.comment,color:"#6272a4"},{tag:le.string,color:"#f1fa8c"},{tag:le.atom,color:"#bd93f9"},{tag:le.meta,color:"#f8f8f2"},{tag:[le.keyword,le.operator,le.tagName],color:"#ff79c6"},{tag:[le.function(le.propertyName),le.propertyName],color:"#66d9ef"},{tag:[le.definition(le.variableName),le.function(le.variableName),le.className,le.attributeName],color:"#50fa7b"},{tag:le.atom,color:"#bd93f9"}],$$=e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return a9t({theme:t,settings:Qg({},o9t,n),styles:[...i9t,...r]})};$$();const l9t=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=ote(e.state,n.from);return r.line?c9t(e):r.block?d9t(e):!1};function ate(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=e(t,n);return s?(r(n.update(s)),!0):!1}}const c9t=ate(h9t,0),u9t=ate(_6e,0),d9t=ate((e,t)=>_6e(e,t,p9t(t)),0);function ote(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const IO=50;function f9t(e,{open:t,close:n},r,s){let a=e.sliceDoc(r-IO,r),o=e.sliceDoc(s,s+IO),i=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,u=a.length-i;if(a.slice(u-t.length,u)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-i,margin:i&&1},close:{pos:s+c,margin:c&&1}};let d,f;s-r<=2*IO?d=f=e.sliceDoc(r,s):(d=e.sliceDoc(r,r+IO),f=e.sliceDoc(s-IO,s));let p=/^\s*/.exec(d)[0].length,h=/\s*$/.exec(f)[0].length,g=f.length-h-n.length;return d.slice(p,p+t.length)==t&&f.slice(g,g+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(d.charAt(p+t.length))?1:0},close:{pos:s-h-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function p9t(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),s=n.to<=r.to?r:e.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=s.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return t}function _6e(e,t,n=t.selection.ranges){let r=n.map(a=>ote(t,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,o)=>f9t(t,r[o],a.from,a.to));if(e!=2&&!s.every(a=>a))return{changes:t.changes(n.map((a,o)=>s[o]?[]:[{from:a.from,insert:r[o].open+" "},{from:a.to,insert:" "+r[o].close}]))};if(e!=1&&s.some(a=>a)){let a=[];for(let o=0,i;o<s.length;o++)if(i=s[o]){let c=r[o],{open:u,close:d}=i;a.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:a}}return null}function h9t(e,t,n=t.selection.ranges){let r=[],s=-1;for(let{from:a,to:o}of n){let i=r.length,c=1e9,u=ote(t,a).line;if(u){for(let d=a;d<=o;){let f=t.doc.lineAt(d);if(f.from>s&&(a==o||o>f.from)){s=f.from;let p=/^\s*/.exec(f.text)[0].length,h=p==f.length,g=f.text.slice(p,p+u.length)==u?p:-1;p<f.text.length&&p<c&&(c=p),r.push({line:f,comment:g,token:u,indent:p,empty:h,single:!1})}d=f.to+1}if(c<1e9)for(let d=i;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==i+1&&(r[i].single=!0)}}if(e!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:i,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&a.push({from:i.from+u,insert:c+" "});let o=t.changes(a);return{changes:o,selection:t.selection.map(o,1)}}else if(e!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:o,comment:i,token:c}of r)if(i>=0){let u=o.from+i,d=u+c.length;o.text[d-o.from]==" "&&d++,a.push({from:u,to:d})}return{changes:a}}return null}const EW=zp.define(),m9t=zp.define(),g9t=Vt.define(),E6e=Vt.define({combine(e){return Bp(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,s)=>t(r,s)||n(r,s)})}}),C6e=xo.define({create(){return fp.empty},update(e,t){let n=t.state.facet(E6e),r=t.annotation(EW);if(r){let c=sc.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=CP(d,d.length,n.minDepth,c):d=A6e(d,t.startState.selection),new fp(u==0?r.rest:d,u==0?d:r.rest)}let s=t.annotation(m9t);if((s=="full"||s=="before")&&(e=e.isolate()),t.annotation(jo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=sc.fromTransaction(t),o=t.annotation(jo.time),i=t.annotation(jo.userEvent);return a?e=e.addChanges(a,o,i,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,i,n.newGroupDelay)),(s=="full"||s=="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 fp(e.done.map(sc.fromJSON),e.undone.map(sc.fromJSON))}});function b9t(e={}){return[C6e,E6e.of(e),ct.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?T6e:t.inputType=="historyRedo"?CW:null;return r?(t.preventDefault(),r(n)):!1}})]}function D$(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let s=n.field(C6e,!1);if(!s)return!1;let a=s.pop(e,n,t);return a?(r(a),!0):!1}}const T6e=D$(0,!1),CW=D$(1,!1),y9t=D$(0,!0),v9t=D$(1,!0);class sc{constructor(t,n,r,s,a){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=a}setSelAfter(t){return new sc(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(s=>s.toJSON())}}static fromJSON(t){return new sc(t.changes&&Co.fromJSON(t.changes),[],t.mapped&&xp.fromJSON(t.mapped),t.startSelection&&Ze.fromJSON(t.startSelection),t.selectionsAfter.map(Ze.fromJSON))}static fromTransaction(t,n){let r=ed;for(let s of t.startState.facet(g9t)){let a=s(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new sc(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,ed)}static selection(t){return new sc(void 0,ed,void 0,void 0,t)}}function CP(e,t,n,r){let s=t+1>n+20?t-n-1:0,a=e.slice(s,t);return a.push(r),a}function x9t(e,t){let n=[],r=!1;return e.iterChangedRanges((s,a)=>n.push(s,a)),t.iterChangedRanges((s,a,o,i)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];i>=u&&o<=d&&(r=!0)}}),r}function w9t(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function N6e(e,t){return e.length?t.length?e.concat(t):e:t}const ed=[],S9t=200;function A6e(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-S9t));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),CP(e,e.length-1,1e9,n.setSelAfter(r)))}else return[sc.selection([t])]}function O9t(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 EU(e,t){if(!e.length)return e;let n=e.length,r=ed;for(;n;){let s=k9t(e[n-1],t,r);if(s.changes&&!s.changes.empty||s.effects.length){let a=e.slice(0,n);return a[n-1]=s,a}else t=s.mapped,n--,r=s.selectionsAfter}return r.length?[sc.selection(r)]:ed}function k9t(e,t,n){let r=N6e(e.selectionsAfter.length?e.selectionsAfter.map(i=>i.map(t)):ed,n);if(!e.changes)return sc.selection(r);let s=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new sc(s,Hn.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}const _9t=/^(input\.type|delete)($|\.)/;class fp{constructor(t,n,r=0,s=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new fp(this.done,this.undone):this}addChanges(t,n,r,s,a){let o=this.done,i=o[o.length-1];return i&&i.changes&&!i.changes.empty&&t.changes&&(!r||_9t.test(r))&&(!i.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,x9t(i.changes,t.changes))||r=="input.type.compose")?o=CP(o,o.length-1,s.minDepth,new sc(t.changes.compose(i.changes),N6e(Hn.mapEffects(t.effects,i.changes),i.effects),i.mapped,i.startSelection,ed)):o=CP(o,o.length,s.minDepth,t),new fp(o,ed,n,r)}addSelection(t,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:ed;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&w9t(a[a.length-1],t)?this:new fp(A6e(this.done,t),this.undone,n,r)}addMapping(t){return new fp(EU(this.done,t),EU(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let s=t==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],o=a.selectionsAfter[0]||n.selection;if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:EW.of({side:t,rest:O9t(s),selection:o}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let i=s.length==1?ed:s.slice(0,s.length-1);return a.mapped&&(i=EU(i,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:EW.of({side:t,rest:i,selection:o}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}fp.empty=new fp(ed,ed);const E9t=[{key:"Mod-z",run:T6e,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:CW,preventDefault:!0},{linux:"Ctrl-Shift-z",run:CW,preventDefault:!0},{key:"Mod-u",run:y9t,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:v9t,preventDefault:!0}];function o1(e,t){return Ze.create(e.ranges.map(t),e.mainIndex)}function bf(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function yf({state:e,dispatch:t},n){let r=o1(e.selection,n);return r.eq(e.selection,!0)?!1:(t(bf(e,r)),!0)}function L$(e,t){return Ze.cursor(t?e.to:e.from)}function j6e(e,t){return yf(e,n=>n.empty?e.moveByChar(n,t):L$(n,t))}function ol(e){return e.textDirectionAt(e.state.selection.main.head)==Js.LTR}const R6e=e=>j6e(e,!ol(e)),I6e=e=>j6e(e,ol(e));function P6e(e,t){return yf(e,n=>n.empty?e.moveByGroup(n,t):L$(n,t))}const C9t=e=>P6e(e,!ol(e)),T9t=e=>P6e(e,ol(e));function N9t(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 F$(e,t,n){let r=Qs(e).resolveInner(t.head),s=n?rr.closedBy:rr.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;N9t(e,u,s)?r=u:c=n?u.to:u.from}let a=r.type.prop(s),o,i;return a&&(o=n?dp(e,r.from,1):dp(e,r.to,-1))&&o.matched?i=n?o.end.to:o.end.from:i=n?r.to:r.from,Ze.cursor(i,n?-1:1)}const A9t=e=>yf(e,t=>F$(e.state,t,!ol(e))),j9t=e=>yf(e,t=>F$(e.state,t,ol(e)));function M6e(e,t){return yf(e,n=>{if(!n.empty)return L$(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const $6e=e=>M6e(e,!1),D6e=e=>M6e(e,!0);function L6e(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,s;if(t){for(let a of e.state.facet(ct.scrollMargins)){let o=a(e);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(r=Math.max(o?.bottom,r))}s=e.scrollDOM.clientHeight-n-r}else s=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,s-5)}}function F6e(e,t){let n=L6e(e),{state:r}=e,s=o1(r.selection,o=>o.empty?e.moveVertically(o,t,n.height):L$(o,t));if(s.eq(r.selection))return!1;let a;if(n.selfScroll){let o=e.coordsAtPos(r.selection.main.head),i=e.scrollDOM.getBoundingClientRect(),c=i.top+n.marginTop,u=i.bottom-n.marginBottom;o&&o.top>c&&o.bottom<u&&(a=ct.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-c}))}return e.dispatch(bf(r,s),{effects:a}),!0}const q0e=e=>F6e(e,!1),TW=e=>F6e(e,!0);function wb(e,t,n){let r=e.lineBlockAt(t.head),s=e.moveToLineBoundary(t,n);if(s.head==t.head&&s.head!=(n?r.to:r.from)&&(s=e.moveToLineBoundary(t,n,!1)),!n&&s.head==r.from&&r.length){let a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(s=Ze.cursor(r.from+a))}return s}const R9t=e=>yf(e,t=>wb(e,t,!0)),I9t=e=>yf(e,t=>wb(e,t,!1)),P9t=e=>yf(e,t=>wb(e,t,!ol(e))),M9t=e=>yf(e,t=>wb(e,t,ol(e))),$9t=e=>yf(e,t=>Ze.cursor(e.lineBlockAt(t.head).from,1)),D9t=e=>yf(e,t=>Ze.cursor(e.lineBlockAt(t.head).to,-1));function L9t(e,t,n){let r=!1,s=o1(e.selection,a=>{let o=dp(e,a.head,-1)||dp(e,a.head,1)||a.head>0&&dp(e,a.head-1,1)||a.head<e.doc.length&&dp(e,a.head+1,-1);if(!o||!o.end)return a;r=!0;let i=o.start.from==a.head?o.end.to:o.end.from;return Ze.cursor(i)});return r?(t(bf(e,s)),!0):!1}const F9t=({state:e,dispatch:t})=>L9t(e,t);function vd(e,t){let n=o1(e.state.selection,r=>{let s=t(r);return Ze.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(bf(e.state,n)),!0)}function z6e(e,t){return vd(e,n=>e.moveByChar(n,t))}const B6e=e=>z6e(e,!ol(e)),U6e=e=>z6e(e,ol(e));function V6e(e,t){return vd(e,n=>e.moveByGroup(n,t))}const z9t=e=>V6e(e,!ol(e)),B9t=e=>V6e(e,ol(e)),U9t=e=>vd(e,t=>F$(e.state,t,!ol(e))),V9t=e=>vd(e,t=>F$(e.state,t,ol(e)));function q6e(e,t){return vd(e,n=>e.moveVertically(n,t))}const H6e=e=>q6e(e,!1),Q6e=e=>q6e(e,!0);function G6e(e,t){return vd(e,n=>e.moveVertically(n,t,L6e(e).height))}const H0e=e=>G6e(e,!1),Q0e=e=>G6e(e,!0),q9t=e=>vd(e,t=>wb(e,t,!0)),H9t=e=>vd(e,t=>wb(e,t,!1)),Q9t=e=>vd(e,t=>wb(e,t,!ol(e))),G9t=e=>vd(e,t=>wb(e,t,ol(e))),W9t=e=>vd(e,t=>Ze.cursor(e.lineBlockAt(t.head).from)),Z9t=e=>vd(e,t=>Ze.cursor(e.lineBlockAt(t.head).to)),G0e=({state:e,dispatch:t})=>(t(bf(e,{anchor:0})),!0),W0e=({state:e,dispatch:t})=>(t(bf(e,{anchor:e.doc.length})),!0),Z0e=({state:e,dispatch:t})=>(t(bf(e,{anchor:e.selection.main.anchor,head:0})),!0),Y0e=({state:e,dispatch:t})=>(t(bf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Y9t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),X9t=({state:e,dispatch:t})=>{let n=z$(e).map(({from:r,to:s})=>Ze.range(r,Math.min(s+1,e.doc.length)));return t(e.update({selection:Ze.create(n),userEvent:"select"})),!0},K9t=({state:e,dispatch:t})=>{let n=o1(e.selection,r=>{let s=Qs(e),a=s.resolveStack(r.from,1);if(r.empty){let o=s.resolveStack(r.from,-1);o.node.from>=a.node.from&&o.node.to<=a.node.to&&(a=o)}for(let o=a;o;o=o.next){let{node:i}=o;if((i.from<r.from&&i.to>=r.to||i.to>r.to&&i.from<=r.from)&&o.next)return Ze.range(i.to,i.from)}return r});return n.eq(e.selection)?!1:(t(bf(e,n)),!0)};function W6e(e,t){let{state:n}=e,r=n.selection,s=n.selection.ranges.slice();for(let a of n.selection.ranges){let o=n.doc.lineAt(a.head);if(t?o.to<e.state.doc.length:o.from>0)for(let i=a;;){let c=e.moveVertically(i,t);if(c.head<o.from||c.head>o.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==i.head)break;i=c}}}return s.length==r.ranges.length?!1:(e.dispatch(bf(n,Ze.create(s,s.length-1))),!0)}const J9t=e=>W6e(e,!1),eFt=e=>W6e(e,!0),tFt=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Ze.create([n.main]):n.main.empty||(r=Ze.create([Ze.cursor(n.main.head)])),r?(t(bf(e,r)),!0):!1};function fT(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,s=r.changeByRange(a=>{let{from:o,to:i}=a;if(o==i){let c=t(a);c<o?(n="delete.backward",c=kj(e,c,!1)):c>o&&(n="delete.forward",c=kj(e,c,!0)),o=Math.min(o,c),i=Math.max(i,c)}else o=kj(e,o,!1),i=kj(e,i,!0);return o==i?{range:a}:{changes:{from:o,to:i},range:Ze.cursor(o,o<a.head?-1:1)}});return s.changes.empty?!1:(e.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ct.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function kj(e,t,n){if(e instanceof ct)for(let r of e.state.facet(ct.atomicRanges).map(s=>s(e)))r.between(t,t,(s,a)=>{s<t&&a>t&&(t=n?a:s)});return t}const Z6e=(e,t,n)=>fT(e,r=>{let s=r.from,{state:a}=e,o=a.doc.lineAt(s),i,c;if(n&&!t&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(i=o.text.slice(0,s-o.from))){if(i[i.length-1]==" ")return s-1;let u=of(i,a.tabSize),d=u%hv(a)||hv(a);for(let f=0;f<d&&i[i.length-1-f]==" ";f++)s--;c=s}else c=si(o.text,s-o.from,t,t)+o.from,c==s&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,s-o.from))&&(c=si(o.text,c-o.from,!1,!1)+o.from);return c}),NW=e=>Z6e(e,!1,!0),Y6e=e=>Z6e(e,!0,!1),X6e=(e,t)=>fT(e,n=>{let r=n.head,{state:s}=e,a=s.doc.lineAt(r),o=s.charCategorizer(r);for(let i=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?s.doc.lines:1)&&(r+=t?1:-1);break}let c=si(a.text,r-a.from,t)+a.from,u=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),d=o(u);if(i!=null&&d!=i)break;(u!=" "||r!=n.head)&&(i=d),r=c}return r}),K6e=e=>X6e(e,!1),nFt=e=>X6e(e,!0),rFt=e=>fT(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),sFt=e=>fT(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),aFt=e=>fT(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),oFt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Zr.of(["",""])},range:Ze.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},iFt=({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 s=r.from,a=e.doc.lineAt(s),o=s==a.from?s-1:si(a.text,s-a.from,!1)+a.from,i=s==a.to?s+1:si(a.text,s-a.from,!0)+a.from;return{changes:{from:o,to:i,insert:e.doc.slice(s,i).append(e.doc.slice(o,s))},range:Ze.cursor(i)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function z$(e){let t=[],n=-1;for(let r of e.selection.ranges){let s=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=s.number){let o=t[t.length-1];o.to=a.to,o.ranges.push(r)}else t.push({from:s.from,to:a.to,ranges:[r]});n=a.number+1}return t}function J6e(e,t,n){if(e.readOnly)return!1;let r=[],s=[];for(let a of z$(e)){if(n?a.to==e.doc.length:a.from==0)continue;let o=e.doc.lineAt(n?a.to+1:a.from-1),i=o.length+1;if(n){r.push({from:a.to,to:o.to},{from:a.from,insert:o.text+e.lineBreak});for(let c of a.ranges)s.push(Ze.range(Math.min(e.doc.length,c.anchor+i),Math.min(e.doc.length,c.head+i)))}else{r.push({from:o.from,to:a.from},{from:a.to,insert:e.lineBreak+o.text});for(let c of a.ranges)s.push(Ze.range(c.anchor-i,c.head-i))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Ze.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const lFt=({state:e,dispatch:t})=>J6e(e,t,!1),cFt=({state:e,dispatch:t})=>J6e(e,t,!0);function e9e(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of z$(e))n?r.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):r.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let s=e.changes(r);return t(e.update({changes:s,selection:e.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const uFt=({state:e,dispatch:t})=>e9e(e,t,!1),dFt=({state:e,dispatch:t})=>e9e(e,t,!0),fFt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(z$(t).map(({from:s,to:a})=>(s>0?s--:a<t.doc.length&&a++,{from:s,to:a}))),r=o1(t.selection,s=>{let a;if(e.lineWrapping){let o=e.lineBlockAt(s.head),i=e.coordsAtPos(s.head,s.assoc||1);i&&(a=o.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(s,!0,a)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function pFt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Qs(e).resolveInner(t),r=n.childBefore(t),s=n.childAfter(t),a;return r&&s&&r.to<=t&&s.from>=t&&(a=r.type.prop(rr.closedBy))&&a.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const X0e=t9e(!1),hFt=t9e(!0);function t9e(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(s=>{let{from:a,to:o}=s,i=t.doc.lineAt(a),c=!e&&a==o&&pFt(t,a);e&&(a=o=(o<=i.to?i:t.doc.lineAt(o)).to);let u=new R$(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=Eee(u,a);for(d==null&&(d=of(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));o<i.to&&/\s/.test(i.text[o-i.from]);)o++;c?{from:a,to:o}=c:a>i.from&&a<i.from+100&&!/\S/.test(i.text.slice(0,a))&&(a=i.from);let f=["",oE(t,d)];return c&&f.push(oE(t,u.lineIndent(i.from,-1))),{changes:{from:a,to:o,insert:Zr.of(f)},range:Ze.cursor(a+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function ite(e,t){let n=-1;return e.changeByRange(r=>{let s=[];for(let o=r.from;o<=r.to;){let i=e.doc.lineAt(o);i.number>n&&(r.empty||r.to>i.from)&&(t(i,s,r),n=i.number),o=i.to+1}let a=e.changes(s);return{changes:s,range:Ze.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const mFt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new R$(e,{overrideIndentation:a=>{let o=n[a];return o??-1}}),s=ite(e,(a,o,i)=>{let c=Eee(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let u=/^\s*/.exec(a.text)[0],d=oE(e,c);(u!=d||i.from<a.from+u.length)&&(n[a.from]=c,o.push({from:a.from,to:a.from+u.length,insert:d}))});return s.changes.empty||t(e.update(s,{userEvent:"indent"})),!0},n9e=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ite(e,(n,r)=>{r.push({from:n.from,insert:e.facet(r1)})}),{userEvent:"input.indent"})),!0),r9e=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(ite(e,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=of(s,e.tabSize),o=0,i=oE(e,Math.max(0,a-hv(e)));for(;o<s.length&&o<i.length&&s.charCodeAt(o)==i.charCodeAt(o);)o++;r.push({from:n.from+o,to:n.from+s.length,insert:i.slice(o)})}),{userEvent:"delete.dedent"})),!0),gFt=e=>(e.setTabFocusMode(),!0),bFt=[{key:"Ctrl-b",run:R6e,shift:B6e,preventDefault:!0},{key:"Ctrl-f",run:I6e,shift:U6e},{key:"Ctrl-p",run:$6e,shift:H6e},{key:"Ctrl-n",run:D6e,shift:Q6e},{key:"Ctrl-a",run:$9t,shift:W9t},{key:"Ctrl-e",run:D9t,shift:Z9t},{key:"Ctrl-d",run:Y6e},{key:"Ctrl-h",run:NW},{key:"Ctrl-k",run:rFt},{key:"Ctrl-Alt-h",run:K6e},{key:"Ctrl-o",run:oFt},{key:"Ctrl-t",run:iFt},{key:"Ctrl-v",run:TW}],yFt=[{key:"ArrowLeft",run:R6e,shift:B6e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:C9t,shift:z9t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:P9t,shift:Q9t,preventDefault:!0},{key:"ArrowRight",run:I6e,shift:U6e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:T9t,shift:B9t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:M9t,shift:G9t,preventDefault:!0},{key:"ArrowUp",run:$6e,shift:H6e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:G0e,shift:Z0e},{mac:"Ctrl-ArrowUp",run:q0e,shift:H0e},{key:"ArrowDown",run:D6e,shift:Q6e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:W0e,shift:Y0e},{mac:"Ctrl-ArrowDown",run:TW,shift:Q0e},{key:"PageUp",run:q0e,shift:H0e},{key:"PageDown",run:TW,shift:Q0e},{key:"Home",run:I9t,shift:H9t,preventDefault:!0},{key:"Mod-Home",run:G0e,shift:Z0e},{key:"End",run:R9t,shift:q9t,preventDefault:!0},{key:"Mod-End",run:W0e,shift:Y0e},{key:"Enter",run:X0e,shift:X0e},{key:"Mod-a",run:Y9t},{key:"Backspace",run:NW,shift:NW,preventDefault:!0},{key:"Delete",run:Y6e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:K6e,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:nFt,preventDefault:!0},{mac:"Mod-Backspace",run:sFt,preventDefault:!0},{mac:"Mod-Delete",run:aFt,preventDefault:!0}].concat(bFt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),vFt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:A9t,shift:U9t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:j9t,shift:V9t},{key:"Alt-ArrowUp",run:lFt},{key:"Shift-Alt-ArrowUp",run:uFt},{key:"Alt-ArrowDown",run:cFt},{key:"Shift-Alt-ArrowDown",run:dFt},{key:"Mod-Alt-ArrowUp",run:J9t},{key:"Mod-Alt-ArrowDown",run:eFt},{key:"Escape",run:tFt},{key:"Mod-Enter",run:hFt},{key:"Alt-l",mac:"Ctrl-l",run:X9t},{key:"Mod-i",run:K9t,preventDefault:!0},{key:"Mod-[",run:r9e},{key:"Mod-]",run:n9e},{key:"Mod-Alt-\\",run:mFt},{key:"Shift-Mod-k",run:fFt},{key:"Shift-Mod-\\",run:F9t},{key:"Mod-/",run:l9t},{key:"Alt-A",run:u9t},{key:"Ctrl-m",mac:"Shift-Alt-m",run:gFt}].concat(yFt),xFt={key:"Tab",run:n9e,shift:r9e},K0e=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Qw{constructor(t,n,r=0,s=t.length,a,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,s),this.bufferStart=r,this.normalize=a?i=>a(K0e(i)):K0e,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 Xl(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=lee(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=np(t);let s=this.normalize(n);if(s.length)for(let a=0,o=r;;a++){let i=s.charCodeAt(a),c=this.match(i,o,this.bufferPos+this.bufferStart);if(a==s.length-1){if(c)return this.value=c,this;break}o==r&&a<n.length&&n.charCodeAt(a)==i&&o++}}}match(t,n,r){let s=null;for(let a=0;a<this.matches.length;a+=2){let o=this.matches[a],i=!1;this.query.charCodeAt(o)==t&&(o==this.query.length-1?s={from:this.matches[a+1],to:r}:(this.matches[a]++,i=!0)),i||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:n,to:r}:this.matches.push(1,n)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(Qw.prototype[Symbol.iterator]=function(){return this});const s9e={from:-1,to:-1,match:/.*/.exec("")},lte="gm"+(/x/.unicode==null?"":"u");class a9e{constructor(t,n,r,s=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=s9e,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new o9e(t,n,r,s,a);this.re=new RegExp(n,lte+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let o=t.lineAt(s);this.curLineStart=o.from,this.matchPos=TP(t,s),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,s=r+n[0].length;if(this.matchPos=TP(this.text,s+(r==s?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<s||r>this.value.to)&&(!this.test||this.test(r,s,n)))return this.value={from:r,to:s,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 CU=new WeakMap;class pw{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let s=CU.get(t);if(!s||s.from>=r||s.to<=n){let i=new pw(n,t.sliceString(n,r));return CU.set(t,i),i}if(s.from==n&&s.to==r)return s;let{text:a,from:o}=s;return o>n&&(a=t.sliceString(n,o)+a,o=n),s.to<r&&(a+=t.sliceString(s.to,r)),CU.set(t,new pw(o,a)),new pw(n,a.slice(n-o,r-o))}}class o9e{constructor(t,n,r,s,a){this.text=t,this.to=a,this.done=!1,this.value=s9e,this.matchPos=TP(t,s),this.re=new RegExp(n,lte+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=pw.get(t,s,this.chunkEnd(s+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,s=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,s,n)))return this.value={from:r,to:s,match:n},this.matchPos=TP(this.text,s+(r==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pw.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(a9e.prototype[Symbol.iterator]=o9e.prototype[Symbol.iterator]=function(){return this});function wFt(e){try{return new RegExp(e,lte),!0}catch{return!1}}function TP(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 AW(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=Xs("input",{class:"cm-textfield",name:"line",value:t}),r=Xs("form",{class:"cm-gotoLine",onkeydown:a=>{a.keyCode==27?(a.preventDefault(),e.dispatch({effects:c_.of(!1)}),e.focus()):a.keyCode==13&&(a.preventDefault(),s())},onsubmit:a=>{a.preventDefault(),s()}},Xs("label",e.state.phrase("Go to line"),": ",n)," ",Xs("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),Xs("button",{name:"close",onclick:()=>{e.dispatch({effects:c_.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]));function s(){let a=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!a)return;let{state:o}=e,i=o.doc.lineAt(o.selection.main.head),[,c,u,d,f]=a,p=d?+d.slice(1):0,h=u?+u:i.number;if(u&&f){let y=h/100;c&&(y=y*(c=="-"?-1:1)+i.number/o.doc.lines),h=Math.round(o.doc.lines*y)}else u&&c&&(h=h*(c=="-"?-1:1)+i.number);let g=o.doc.line(Math.max(1,Math.min(o.doc.lines,h))),b=Ze.cursor(g.from+Math.max(0,Math.min(p,g.length)));e.dispatch({effects:[c_.of(!1),ct.scrollIntoView(b.from,{y:"center"})],selection:b}),e.focus()}return{dom:r}}const c_=Hn.define(),J0e=xo.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(c_)&&(e=n.value);return e},provide:e=>aE.from(e,t=>t?AW:null)}),SFt=e=>{let t=sE(e,AW);if(!t){let n=[c_.of(!0)];e.state.field(J0e,!1)==null&&n.push(Hn.appendConfig.of([J0e,OFt])),e.dispatch({effects:n}),t=sE(e,AW)}return t&&t.dom.querySelector("input").select(),!0},OFt=ct.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"}}}),kFt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},_Ft=Vt.define({combine(e){return Bp(e,kFt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function EFt(e){return[jFt,AFt]}const CFt=Wt.mark({class:"cm-selectionMatch"}),TFt=Wt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function ewe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Pa.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Pa.Word)}function NFt(e,t,n,r){return e(t.sliceDoc(n,n+1))==Pa.Word&&e(t.sliceDoc(r-1,r))==Pa.Word}const AFt=Ua.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(_Ft),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Wt.none;let s=r.main,a,o=null;if(s.empty){if(!t.highlightWordAroundCursor)return Wt.none;let c=n.wordAt(s.head);if(!c)return Wt.none;o=n.charCategorizer(s.head),a=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<t.minSelectionLength||c>200)return Wt.none;if(t.wholeWords){if(a=n.sliceDoc(s.from,s.to),o=n.charCategorizer(s.head),!(ewe(o,n,s.from,s.to)&&NFt(o,n,s.from,s.to)))return Wt.none}else if(a=n.sliceDoc(s.from,s.to),!a)return Wt.none}let i=[];for(let c of e.visibleRanges){let u=new Qw(n.doc,a,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!o||ewe(o,n,d,f))&&(s.empty&&d<=s.from&&f>=s.to?i.push(TFt.range(d,f)):(d>=s.to||f<=s.from)&&i.push(CFt.range(d,f)),i.length>t.maxMatches))return Wt.none}}return Wt.set(i)}},{decorations:e=>e.decorations}),jFt=ct.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),RFt=({state:e,dispatch:t})=>{let{selection:n}=e,r=Ze.create(n.ranges.map(s=>e.wordAt(s.head)||Ze.cursor(s.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function IFt(e,t){let{main:n,ranges:r}=e.selection,s=e.wordAt(n.head),a=s&&s.from==n.from&&s.to==n.to;for(let o=!1,i=new Qw(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(o)return null;i=new Qw(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(c=>c.from==i.value.from))continue;if(a){let c=e.wordAt(i.value.from);if(!c||c.from!=i.value.from||c.to!=i.value.to)continue}return i.value}}const PFt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return RFt({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=r))return!1;let s=IFt(e,r);return s?(t(e.update({selection:e.selection.addRange(Ze.range(s.from,s.to),!1),effects:ct.scrollIntoView(s.to)})),!0):!1},i1=Vt.define({combine(e){return Bp(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new QFt(t),scrollToMatch:t=>ct.scrollIntoView(t)})}});class i9e{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||wFt(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"?`
|
|
132
132
|
`: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 LFt(this):new $Ft(this)}getCursor(t,n=0,r){let s=t.doc?t:wr.create({doc:t});return r==null&&(r=s.doc.length),this.regexp?O0(this,s,n,r):S0(this,s,n,r)}}class l9e{constructor(t){this.spec=t}}function S0(e,t,n,r){return new Qw(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:s=>s.toLowerCase(),e.wholeWord?MFt(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function MFt(e,t){return(n,r,s,a)=>((a>n||a+s.length<r)&&(a=Math.max(0,n-2),s=e.sliceString(a,Math.min(e.length,r+2))),(t(NP(s,n-a))!=Pa.Word||t(AP(s,n-a))!=Pa.Word)&&(t(AP(s,r-a))!=Pa.Word||t(NP(s,r-a))!=Pa.Word))}class $Ft extends l9e{constructor(t){super(t)}nextMatch(t,n,r){let s=S0(this.spec,t,r,t.doc.length).nextOverlapping();if(s.done){let a=Math.min(t.doc.length,n+this.spec.unquoted.length);s=S0(this.spec,t,0,a).nextOverlapping()}return s.done||s.value.from==n&&s.value.to==r?null:s.value}prevMatchInRange(t,n,r){for(let s=r;;){let a=Math.max(n,s-1e4-this.spec.unquoted.length),o=S0(this.spec,t,a,s),i=null;for(;!o.nextOverlapping().done;)i=o.value;if(i)return i;if(a==n)return null;s-=1e4}}prevMatch(t,n,r){let s=this.prevMatchInRange(t,0,n);return s||(s=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=n||s.to!=r)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=S0(this.spec,t,0,t.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(t,n,r,s){let a=S0(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}function O0(e,t,n,r){return new a9e(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?DFt(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function NP(e,t){return e.slice(si(e,t,!1),t)}function AP(e,t){return e.slice(t,si(e,t))}function DFt(e){return(t,n,r)=>!r[0].length||(e(NP(r.input,r.index))!=Pa.Word||e(AP(r.input,r.index))!=Pa.Word)&&(e(AP(r.input,r.index+r[0].length))!=Pa.Word||e(NP(r.input,r.index+r[0].length))!=Pa.Word)}class LFt extends l9e{nextMatch(t,n,r){let s=O0(this.spec,t,r,t.doc.length).next();return s.done&&(s=O0(this.spec,t,0,n).next()),s.done?null:s.value}prevMatchInRange(t,n,r){for(let s=1;;s++){let a=Math.max(n,r-s*1e4),o=O0(this.spec,t,a,r),i=null;for(;!o.next().done;)i=o.value;if(i&&(a==n||i.from>a+10))return i;if(a==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 s=r.length;s>0;s--){let a=+r.slice(0,s);if(a>0&&a<t.match.length)return t.match[a]+r.slice(s)}return n})}matchAll(t,n){let r=O0(this.spec,t,0,t.doc.length),s=[];for(;!r.next().done;){if(s.length>=n)return null;s.push(r.value)}return s}highlight(t,n,r,s){let a=O0(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!a.next().done;)s(a.value.from,a.value.to)}}const gE=Hn.define(),cte=Hn.define(),Rg=xo.define({create(e){return new TU(jW(e).create(),null)},update(e,t){for(let n of t.effects)n.is(gE)?e=new TU(n.value.create(),e.panel):n.is(cte)&&(e=new TU(e.query,n.value?ute:null));return e},provide:e=>aE.from(e,t=>t.panel)});class TU{constructor(t,n){this.query=t,this.panel=n}}const FFt=Wt.mark({class:"cm-searchMatch"}),zFt=Wt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),BFt=Ua.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Rg))}update(e){let t=e.state.field(Rg);(t!=e.startState.field(Rg)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Wt.none;let{view:n}=this,r=new pc;for(let s=0,a=n.visibleRanges,o=a.length;s<o;s++){let{from:i,to:c}=a[s];for(;s<o-1&&c>a[s+1].from-500;)c=a[++s].to;e.highlight(n.state,i,c,(u,d)=>{let f=n.state.selection.ranges.some(p=>p.from==u&&p.to==d);r.add(u,d,f?zFt:FFt)})}return r.finish()}},{decorations:e=>e.decorations});function pT(e){return t=>{let n=t.state.field(Rg,!1);return n&&n.query.spec.valid?e(t,n):d9e(t)}}const jP=pT((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let s=Ze.single(r.from,r.to),a=e.state.facet(i1);return e.dispatch({selection:s,effects:[dte(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),u9e(e),!0}),RP=pT((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,s=t.prevMatch(n,r,r);if(!s)return!1;let a=Ze.single(s.from,s.to),o=e.state.facet(i1);return e.dispatch({selection:a,effects:[dte(e,s),o.scrollToMatch(a.main,e)],userEvent:"select.search"}),u9e(e),!0}),UFt=pT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Ze.create(n.map(r=>Ze.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),VFt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:s}=n.main,a=[],o=0;for(let i=new Qw(e.doc,e.sliceDoc(r,s));!i.next().done;){if(a.length>1e3)return!1;i.value.from==r&&(o=a.length),a.push(Ze.range(i.value.from,i.value.to))}return t(e.update({selection:Ze.create(a,o),userEvent:"select.search.matches"})),!0},twe=pT((e,{query:t})=>{let{state:n}=e,{from:r,to:s}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,i=[],c,u,d=[];o.from==r&&o.to==s&&(u=n.toText(t.getReplacement(o)),i.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(ct.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=e.state.changes(i);return o&&(c=Ze.single(o.from,o.to).map(f),d.push(dte(e,o)),d.push(n.facet(i1).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),qFt=pT((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(s=>{let{from:a,to:o}=s;return{from:a,to:o,insert:t.getReplacement(s)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:ct.announce.of(r),userEvent:"input.replace.all"}),!0});function ute(e){return e.state.facet(i1).createPanel(e)}function jW(e,t){var n,r,s,a,o;let i=e.selection.main,c=i.empty||i.to>i.from+100?"":e.sliceDoc(i.from,i.to);if(t&&!c)return t;let u=e.facet(i1);return new i9e({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:(s=t?.literal)!==null&&s!==void 0?s:u.literal,regexp:(a=t?.regexp)!==null&&a!==void 0?a:u.regexp,wholeWord:(o=t?.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function c9e(e){let t=sE(e,ute);return t&&t.dom.querySelector("[main-field]")}function u9e(e){let t=c9e(e);t&&t==e.root.activeElement&&t.select()}const d9e=e=>{let t=e.state.field(Rg,!1);if(t&&t.panel){let n=c9e(e);if(n&&n!=e.root.activeElement){let r=jW(e.state,t.query.spec);r.valid&&e.dispatch({effects:gE.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[cte.of(!0),t?gE.of(jW(e.state,t.query.spec)):Hn.appendConfig.of(WFt)]});return!0},f9e=e=>{let t=e.state.field(Rg,!1);if(!t||!t.panel)return!1;let n=sE(e,ute);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:cte.of(!1)}),!0},HFt=[{key:"Mod-f",run:d9e,scope:"editor search-panel"},{key:"F3",run:jP,shift:RP,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jP,shift:RP,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:f9e,scope:"editor search-panel"},{key:"Mod-Shift-l",run:VFt},{key:"Mod-Alt-g",run:SFt},{key:"Mod-d",run:PFt,preventDefault:!0}];class QFt{constructor(t){this.view=t;let n=this.query=t.state.field(Rg).query.spec;this.commit=this.commit.bind(this),this.searchField=Xs("input",{value:n.search,placeholder:Dc(t,"Find"),"aria-label":Dc(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Xs("input",{value:n.replace,placeholder:Dc(t,"Replace"),"aria-label":Dc(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Xs("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Xs("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Xs("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,a,o){return Xs("button",{class:"cm-button",name:s,onclick:a,type:"button"},o)}this.dom=Xs("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>jP(t),[Dc(t,"next")]),r("prev",()=>RP(t),[Dc(t,"previous")]),r("select",()=>UFt(t),[Dc(t,"all")]),Xs("label",null,[this.caseField,Dc(t,"match case")]),Xs("label",null,[this.reField,Dc(t,"regexp")]),Xs("label",null,[this.wordField,Dc(t,"by word")]),...t.state.readOnly?[]:[Xs("br"),this.replaceField,r("replace",()=>twe(t),[Dc(t,"replace")]),r("replaceAll",()=>qFt(t),[Dc(t,"replace all")])],Xs("button",{name:"close",onclick:()=>f9e(t),"aria-label":Dc(t,"close"),type:"button"},["×"])])}commit(){let t=new i9e({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:gE.of(t)}))}keydown(t){wDt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?RP:jP)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),twe(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(gE)&&!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(i1).top}}function Dc(e,t){return e.state.phrase(t)}const _j=30,Ej=/[\s\.,:;?!]/;function dte(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),s=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-_j),o=Math.min(s,n+_j),i=e.state.sliceDoc(a,o);if(a!=r.from){for(let c=0;c<_j;c++)if(!Ej.test(i[c+1])&&Ej.test(i[c])){i=i.slice(c);break}}if(o!=s){for(let c=i.length-1;c>i.length-_j;c--)if(!Ej.test(i[c-1])&&Ej.test(i[c])){i=i.slice(0,c);break}}return ct.announce.of(`${e.state.phrase("current match")}. ${i} ${e.state.phrase("on line")} ${r.number}.`)}const GFt=ct.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"}}),WFt=[Rg,gf.low(BFt),GFt];class nwe{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class Cy{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let s=r.facet(bE).markerFilter;s&&(t=s(t,r));let a=t.slice().sort((d,f)=>d.from-f.from||d.to-f.to),o=new pc,i=[],c=0;for(let d=0;;){let f=d==a.length?null:a[d];if(!f&&!i.length)break;let p,h;for(i.length?(p=c,h=i.reduce((b,y)=>Math.min(b,y.to),f&&f.from>p?f.from:1e8)):(p=f.from,h=f.to,i.push(f),d++);d<a.length;){let b=a[d];if(b.from==p&&(b.to>b.from||b.to==p))i.push(b),d++,h=Math.min(b.to,h);else{h=Math.min(b.from,h);break}}let g=i8t(i);if(i.some(b=>b.from==b.to||b.from==b.to-1&&r.doc.lineAt(b.from).to==b.from))o.add(p,p,Wt.widget({widget:new r8t(g),diagnostics:i.slice()}));else{let b=i.reduce((y,x)=>x.markClass?y+" "+x.markClass:y,"");o.add(p,h,Wt.mark({class:"cm-lintRange cm-lintRange-"+g+b,diagnostics:i.slice(),inclusiveEnd:i.some(y=>y.to>h)}))}c=h;for(let b=0;b<i.length;b++)i[b].to<=c&&i.splice(b--,1)}let u=o.finish();return new Cy(u,n,Gw(u))}}function Gw(e,t=null,n=0){let r=null;return e.between(n,1e9,(s,a,{spec:o})=>{if(!(t&&o.diagnostics.indexOf(t)<0))if(!r)r=new nwe(s,a,t||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new nwe(r.from,a,r.diagnostic)}}),r}function ZFt(e,t){let n=t.pos,r=t.end||n,s=e.state.facet(bE).hideOn(e,n,r);if(s!=null)return s;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(o=>o.is(p9e))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function YFt(e,t){return e.field(Jc,!1)?t:t.concat(Hn.appendConfig.of(l8t))}const p9e=Hn.define(),fte=Hn.define(),h9e=Hn.define(),Jc=xo.define({create(){return new Cy(Wt.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,s=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);r=Gw(n,e.selected.diagnostic,a)||Gw(n,null,a)}!n.size&&s&&t.state.facet(bE).autoPanel&&(s=null),e=new Cy(n,s,r)}for(let n of t.effects)if(n.is(p9e)){let r=t.state.facet(bE).autoPanel?n.value.length?yE.open:null:e.panel;e=Cy.init(n.value,r,t.state)}else n.is(fte)?e=new Cy(e.diagnostics,n.value?yE.open:null,e.selected):n.is(h9e)&&(e=new Cy(e.diagnostics,e.panel,n.value));return e},provide:e=>[aE.from(e,t=>t.panel),ct.decorations.from(e,t=>t.diagnostics)]}),XFt=Wt.mark({class:"cm-lintRange cm-lintRange-active"});function KFt(e,t,n){let{diagnostics:r}=e.state.field(Jc),s,a=-1,o=-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 s=d.diagnostics,a=c,o=u,!1});let i=e.state.facet(bE).tooltipFilter;return s&&i&&(s=i(s,e.state)),s?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:JFt(e,s)}}}:null}function JFt(e,t){return Xs("ul",{class:"cm-tooltip-lint"},t.map(n=>g9e(e,n,!1)))}const e8t=e=>{let t=e.state.field(Jc,!1);(!t||!t.panel)&&e.dispatch({effects:YFt(e.state,[fte.of(!0)])});let n=sE(e,yE.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},rwe=e=>{let t=e.state.field(Jc,!1);return!t||!t.panel?!1:(e.dispatch({effects:fte.of(!1)}),!0)},t8t=e=>{let t=e.state.field(Jc,!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)},n8t=[{key:"Mod-Shift-m",run:e8t,preventDefault:!0},{key:"F8",run:t8t}],bE=Vt.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Bp(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:swe,tooltipFilter:swe,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,s,a)=>t(r,s,a)||n(r,s,a):t:n,autoPanel:(t,n)=>t||n})}}});function swe(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function m9e(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let s=n[r];if(/[a-zA-Z]/.test(s)&&!t.some(a=>a.toLowerCase()==s.toLowerCase())){t.push(s);continue e}}t.push("")}return t}function g9e(e,t,n){var r;let s=n?m9e(t.actions):[];return Xs("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Xs("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((a,o)=>{let i=!1,c=h=>{if(h.preventDefault(),i)return;i=!0;let g=Gw(e.state.field(Jc).diagnostics,t);g&&a.apply(e,g.from,g.to)},{name:u}=a,d=s[o]?u.indexOf(s[o]):-1,f=d<0?u:[u.slice(0,d),Xs("u",u.slice(d,d+1)),u.slice(d+1)],p=a.markClass?" "+a.markClass:"";return Xs("button",{type:"button",class:"cm-diagnosticAction"+p,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[o]})"`}.`},f)}),t.source&&Xs("div",{class:"cm-diagnosticSource"},t.source))}class r8t extends wu{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Xs("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class awe{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=g9e(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class yE{constructor(t){this.view=t,this.items=[];let n=s=>{if(s.keyCode==27)rwe(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],o=m9e(a.actions);for(let i=0;i<o.length;i++)if(o[i].toUpperCase().charCodeAt(0)==s.keyCode){let c=Gw(this.view.state.field(Jc).diagnostics,a);c&&a.actions[i].apply(t,c.from,c.to)}}else return;s.preventDefault()},r=s=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(s.target)&&this.moveSelection(a)};this.list=Xs("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Xs("div",{class:"cm-panel-lint"},this.list,Xs("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>rwe(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Jc).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(Jc),r=0,s=!1,a=null,o=new Set;for(t.between(0,this.view.state.doc.length,(i,c,{spec:u})=>{for(let d of u.diagnostics){if(o.has(d))continue;o.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 awe(this.view,d),this.items.splice(r,0,p),s=!0):(p=this.items[f],f>r&&(this.items.splice(r,f-r),s=!0)),n&&p.diagnostic==n.diagnostic?p.dom.hasAttribute("aria-selected")||(p.dom.setAttribute("aria-selected","true"),a=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);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new awe(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:i,panel:c})=>{let u=c.height/this.list.offsetHeight;i.top<c.top?this.list.scrollTop-=(c.top-i.top)/u:i.bottom>c.bottom&&(this.list.scrollTop+=(i.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&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(Jc),r=Gw(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:h9e.of(r)})}static open(t){return new yE(t)}}function s8t(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 Cj(e){return s8t(`<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 a8t=ct.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:Cj("#d11")},".cm-lintRange-warning":{backgroundImage:Cj("orange")},".cm-lintRange-info":{backgroundImage:Cj("#999")},".cm-lintRange-hint":{backgroundImage:Cj("#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 o8t(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function i8t(e){let t="hint",n=1;for(let r of e){let s=o8t(r.severity);s>n&&(n=s,t=r.severity)}return t}const l8t=[Jc,ct.decorations.compute([Jc],e=>{let{selected:t,panel:n}=e.field(Jc);return!t||!n||t.from==t.to?Wt.none:Wt.set([XFt.range(t.from,t.to)])}),l4t(KFt,{hideOn:ZFt}),a8t];var owe=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(r5t)),t.defaultKeymap!==!1&&(r=r.concat(vFt)),t.searchKeymap!==!1&&(r=r.concat(HFt)),t.historyKeymap!==!1&&(r=r.concat(E9t)),t.foldKeymap!==!1&&(r=r.concat(U4t)),t.completionKeymap!==!1&&(r=r.concat(rLe)),t.lintKeymap!==!1&&(r=r.concat(n8t));var s=[];return t.lineNumbers!==!1&&s.push(y4t()),t.highlightActiveLineGutter!==!1&&s.push(w4t()),t.highlightSpecialChars!==!1&&s.push(DDt()),t.history!==!1&&s.push(b9t()),t.foldGutter!==!1&&s.push(Q4t()),t.drawSelection!==!1&&s.push(CDt()),t.dropCursor!==!1&&s.push(RDt()),t.allowMultipleSelections!==!1&&s.push(wr.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&s.push(P4t()),t.syntaxHighlighting!==!1&&s.push(Nee(Y4t,{fallback:!0})),t.bracketMatching!==!1&&s.push(r3t()),t.closeBrackets!==!1&&s.push(J3t()),t.autocompletion!==!1&&s.push(nLe()),t.rectangularSelection!==!1&&s.push(XDt()),n!==!1&&s.push(e4t()),t.highlightActiveLine!==!1&&s.push(VDt()),t.highlightSelectionMatches!==!1&&s.push(EFt()),t.tabSize&&typeof t.tabSize=="number"&&s.push(r1.of(" ".repeat(t.tabSize))),s.concat([n1.of(r.flat())]).filter(Boolean)};const c8t="#e5c07b",iwe="#e06c75",u8t="#56b6c2",d8t="#ffffff",oI="#abb2bf",RW="#7d8799",f8t="#61afef",p8t="#98c379",lwe="#d19a66",h8t="#c678dd",m8t="#21252b",cwe="#2c313a",uwe="#282c34",NU="#353a42",g8t="#3E4451",dwe="#528bff",b8t=ct.theme({"&":{color:oI,backgroundColor:uwe},".cm-content":{caretColor:dwe},".cm-cursor, .cm-dropCursor":{borderLeftColor:dwe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:g8t},".cm-panels":{backgroundColor:m8t,color:oI},".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:uwe,color:RW,border:"none"},".cm-activeLineGutter":{backgroundColor:cwe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:NU},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:NU,borderBottomColor:NU},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:cwe,color:oI}}},{dark:!0}),y8t=s1.define([{tag:le.keyword,color:h8t},{tag:[le.name,le.deleted,le.character,le.propertyName,le.macroName],color:iwe},{tag:[le.function(le.variableName),le.labelName],color:f8t},{tag:[le.color,le.constant(le.name),le.standard(le.name)],color:lwe},{tag:[le.definition(le.name),le.separator],color:oI},{tag:[le.typeName,le.className,le.number,le.changed,le.annotation,le.modifier,le.self,le.namespace],color:c8t},{tag:[le.operator,le.operatorKeyword,le.url,le.escape,le.regexp,le.link,le.special(le.string)],color:u8t},{tag:[le.meta,le.comment],color:RW},{tag:le.strong,fontWeight:"bold"},{tag:le.emphasis,fontStyle:"italic"},{tag:le.strikethrough,textDecoration:"line-through"},{tag:le.link,color:RW,textDecoration:"underline"},{tag:le.heading,fontWeight:"bold",color:iwe},{tag:[le.atom,le.bool,le.special(le.variableName)],color:lwe},{tag:[le.processingInstruction,le.string,le.inserted],color:p8t},{tag:le.invalid,color:d8t}]),v8t=[b8t,Nee(y8t)];var x8t=ct.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),w8t=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:a="light",placeholder:o="",basicSetup:i=!0}=t,c=[];switch(n&&c.unshift(n1.of([xFt])),i&&(typeof i=="boolean"?c.unshift(owe()):c.unshift(owe(i))),o&&c.unshift(GDt(o)),a){case"light":c.push(x8t);break;case"dark":c.push(v8t);break;case"none":break;default:c.push(a);break}return r===!1&&c.push(ct.editable.of(!1)),s&&c.push(wr.readOnly.of(!0)),[...c]},S8t=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 O8t{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 fwe=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 AU=null,k8t=()=>typeof window>"u"?new fwe:(AU||(AU=new fwe),AU),pwe=zp.define(),_8t=200,E8t=[];function C8t(e){var{value:t,selection:n,onChange:r,onStatistics:s,onCreateEditor:a,onUpdate:o,extensions:i=E8t,autoFocus:c,theme:u="light",height:d=null,minHeight:f=null,maxHeight:p=null,width:h=null,minWidth:g=null,maxWidth:b=null,placeholder:y="",editable:x=!0,readOnly:w=!1,indentWithTab:O=!0,basicSetup:k=!0,root:E,initialState:C}=e,[N,T]=S.useState(),[j,R]=S.useState(),[P,M]=S.useState(),U=S.useState(()=>({current:null}))[0],D=S.useState(()=>({current:null}))[0],q=ct.theme({"&":{height:d,minHeight:f,maxHeight:p,width:h,minWidth:g,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),V=ct.updateListener.of(G=>{if(G.docChanged&&typeof r=="function"&&!G.transactions.some(z=>z.annotation(pwe))){U.current?U.current.reset():(U.current=new O8t(()=>{if(D.current){var z=D.current;D.current=null,z()}U.current=null},_8t),k8t().add(U.current));var L=G.state.doc,Z=L.toString();r(Z,G)}s&&s(S8t(G))}),B=w8t({theme:u,editable:x,readOnly:w,placeholder:y,indentWithTab:O,basicSetup:k}),H=[V,q,...B];return o&&typeof o=="function"&&H.push(ct.updateListener.of(o)),H=H.concat(i),S.useLayoutEffect(()=>{if(N&&!P){var G={doc:t,selection:n,extensions:H},L=C?wr.fromJSON(C.json,G,C.fields):wr.create(G);if(M(L),!j){var Z=new ct({state:L,parent:N,root:E});R(Z),a&&a(Z,L)}}return()=>{j&&(M(void 0),R(void 0))}},[N,P]),S.useEffect(()=>{e.container&&T(e.container)},[e.container]),S.useEffect(()=>()=>{j&&(j.destroy(),R(void 0)),U.current&&(U.current.cancel(),U.current=null)},[j]),S.useEffect(()=>{c&&j&&j.focus()},[c,j]),S.useEffect(()=>{j&&j.dispatch({effects:Hn.reconfigure.of(H)})},[u,i,d,f,p,h,g,b,y,x,w,O,k,r,o]),S.useEffect(()=>{if(t!==void 0){var G=j?j.state.doc.toString():"";if(j&&t!==G){var L=U.current&&!U.current.isDone,Z=()=>{j&&t!==j.state.doc.toString()&&j.dispatch({changes:{from:0,to:j.state.doc.toString().length,insert:t||""},annotations:[pwe.of(!0)]})};L?D.current=Z:Z()}}},[t,j]),{state:P,setState:M,view:j,setView:R,container:N,setContainer:T}}var T8t=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],pu=S.forwardRef((e,t)=>{var{className:n,value:r="",selection:s,extensions:a=[],onChange:o,onStatistics:i,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:f="light",height:p,minHeight:h,maxHeight:g,width:b,minWidth:y,maxWidth:x,basicSetup:w,placeholder:O,indentWithTab:k,editable:E,readOnly:C,root:N,initialState:T}=e,j=oJ(e,T8t),R=S.useRef(null),{state:P,view:M,container:U,setContainer:D}=C8t({root:N,value:r,autoFocus:d,theme:f,height:p,minHeight:h,maxHeight:g,width:b,minWidth:y,maxWidth:x,basicSetup:w,placeholder:O,indentWithTab:k,editable:E,readOnly:C,selection:s,onChange:o,onStatistics:i,onCreateEditor:c,onUpdate:u,extensions:a,initialState:T});S.useImperativeHandle(t,()=>({editor:R.current,state:P,view:M}),[R,U,P,M]);var q=S.useCallback(B=>{R.current=B,D(B)},[D]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var V=typeof f=="string"?"cm-theme-"+f:"cm-theme";return l.jsx("div",Qg({ref:q,className:""+V+(n?" "+n:"")},j))});pu.displayName="CodeMirror";function N8t(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 A8t=e=>{switch(e){case"success":return I8t;case"info":return M8t;case"warning":return P8t;case"error":return $8t;default:return null}},j8t=Array(12).fill(0),R8t=({visible:e,className:t})=>be.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},be.createElement("div",{className:"sonner-spinner"},j8t.map((n,r)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),I8t=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),P8t=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.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"})),M8t=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),$8t=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),D8t=be.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"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),L8t=()=>{const[e,t]=be.useState(document.hidden);return be.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let IW=1;class F8t{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,...s}=t,a=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:IW++,o=this.toasts.find(c=>c.id===a),i=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:r}),{...c,...t,id:a,dismissible:i,title:r}):c):this.addToast({title:r,...s,dismissible:i,id:a}),a},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 s=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,o;const i=s.then(async u=>{if(o=["resolve",u],be.isValidElement(u))a=!1,this.create({id:r,type:"default",message:u});else if(B8t(u)&&!u.ok){a=!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,g=typeof f=="object"&&!be.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...g})}else if(u instanceof Error){a=!1;const f=typeof n.error=="function"?await n.error(u):n.error,p=typeof n.description=="function"?await n.description(u):n.description,g=typeof f=="object"&&!be.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...g})}else if(n.success!==void 0){a=!1;const f=typeof n.success=="function"?await n.success(u):n.success,p=typeof n.description=="function"?await n.description(u):n.description,g=typeof f=="object"&&!be.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:p,...g})}}).catch(async u=>{if(o=["reject",u],n.error!==void 0){a=!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"&&!be.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...h})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>i.then(()=>o[0]==="reject"?d(o[1]):u(o[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||IW++;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 Gl=new F8t,z8t=(e,t)=>{const n=t?.id||IW++;return Gl.addToast({title:e,...t,id:n}),n},B8t=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",U8t=z8t,V8t=()=>Gl.toasts,q8t=()=>Gl.getActiveToasts(),Yi=Object.assign(U8t,{success:Gl.success,info:Gl.info,warning:Gl.warning,error:Gl.error,custom:Gl.custom,message:Gl.message,promise:Gl.promise,dismiss:Gl.dismiss,loading:Gl.loading},{getHistory:V8t,getToasts:q8t});N8t("[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 Tj(e){return e.label!==void 0}const H8t=3,Q8t="24px",G8t="16px",hwe=4e3,W8t=356,Z8t=14,Y8t=45,X8t=200;function Lf(...e){return e.filter(Boolean).join(" ")}function K8t(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const J8t=e=>{var t,n,r,s,a,o,i,c,u;const{invert:d,toast:f,unstyled:p,interacting:h,setHeights:g,visibleToasts:b,heights:y,index:x,toasts:w,expanded:O,removeToast:k,defaultRichColors:E,closeButton:C,style:N,cancelButtonStyle:T,actionButtonStyle:j,className:R="",descriptionClassName:P="",duration:M,position:U,gap:D,expandByDefault:q,classNames:V,icons:B,closeButtonAriaLabel:H="Close toast"}=e,[G,L]=be.useState(null),[Z,z]=be.useState(null),[I,Q]=be.useState(!1),[W,J]=be.useState(!1),[ne,te]=be.useState(!1),[ae,ce]=be.useState(!1),[ve,ee]=be.useState(!1),[re,ie]=be.useState(0),[ge,me]=be.useState(0),we=be.useRef(f.duration||M||hwe),Te=be.useRef(null),Se=be.useRef(null),je=x===0,X=x+1<=b,se=f.type,fe=f.dismissible!==!1,Ce=f.className||"",Ne=f.descriptionClassName||"",ue=be.useMemo(()=>y.findIndex(yt=>yt.toastId===f.id)||0,[y,f.id]),ye=be.useMemo(()=>{var yt;return(yt=f.closeButton)!=null?yt:C},[f.closeButton,C]),Fe=be.useMemo(()=>f.duration||M||hwe,[f.duration,M]),De=be.useRef(0),Ke=be.useRef(0),Bt=be.useRef(0),cn=be.useRef(null),[Pn,Et]=U.split("-"),rt=be.useMemo(()=>y.reduce((yt,Ft,Tn)=>Tn>=ue?yt:yt+Ft.height,0),[y,ue]),Be=L8t(),et=f.invert||d,bt=se==="loading";Ke.current=be.useMemo(()=>ue*D+rt,[ue,rt]),be.useEffect(()=>{we.current=Fe},[Fe]),be.useEffect(()=>{Q(!0)},[]),be.useEffect(()=>{const yt=Se.current;if(yt){const Ft=yt.getBoundingClientRect().height;return me(Ft),g(Tn=>[{toastId:f.id,height:Ft,position:f.position},...Tn]),()=>g(Tn=>Tn.filter(hn=>hn.toastId!==f.id))}},[g,f.id]),be.useLayoutEffect(()=>{if(!I)return;const yt=Se.current,Ft=yt.style.height;yt.style.height="auto";const Tn=yt.getBoundingClientRect().height;yt.style.height=Ft,me(Tn),g(hn=>hn.find(Jt=>Jt.toastId===f.id)?hn.map(Jt=>Jt.toastId===f.id?{...Jt,height:Tn}:Jt):[{toastId:f.id,height:Tn,position:f.position},...hn])},[I,f.title,f.description,g,f.id,f.jsx,f.action,f.cancel]);const Pt=be.useCallback(()=>{J(!0),ie(Ke.current),g(yt=>yt.filter(Ft=>Ft.toastId!==f.id)),setTimeout(()=>{k(f)},X8t)},[f,k,g,Ke]);be.useEffect(()=>{if(f.promise&&se==="loading"||f.duration===1/0||f.type==="loading")return;let yt;return O||h||Be?(()=>{if(Bt.current<De.current){const hn=new Date().getTime()-De.current;we.current=we.current-hn}Bt.current=new Date().getTime()})():we.current!==1/0&&(De.current=new Date().getTime(),yt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Pt()},we.current)),()=>clearTimeout(yt)},[O,h,f,se,Be,Pt]),be.useEffect(()=>{f.delete&&(Pt(),f.onDismiss==null||f.onDismiss.call(f,f))},[Pt,f.delete]);function Yt(){var yt;if(B?.loading){var Ft;return be.createElement("div",{className:Lf(V?.loader,f==null||(Ft=f.classNames)==null?void 0:Ft.loader,"sonner-loader"),"data-visible":se==="loading"},B.loading)}return be.createElement(R8t,{className:Lf(V?.loader,f==null||(yt=f.classNames)==null?void 0:yt.loader),visible:se==="loading"})}const Ct=f.icon||B?.[se]||A8t(se);var pt,Zn;return be.createElement("li",{tabIndex:0,ref:Se,className:Lf(R,Ce,V?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,V?.default,V?.[se],f==null||(n=f.classNames)==null?void 0:n[se]),"data-sonner-toast":"","data-rich-colors":(pt=f.richColors)!=null?pt:E,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":I,"data-promise":!!f.promise,"data-swiped":ve,"data-removed":W,"data-visible":X,"data-y-position":Pn,"data-x-position":Et,"data-index":x,"data-front":je,"data-swiping":ne,"data-dismissible":fe,"data-type":se,"data-invert":et,"data-swipe-out":ae,"data-swipe-direction":Z,"data-expanded":!!(O||q&&I),"data-testid":f.testId,style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${W?re:Ke.current}px`,"--initial-height":q?"auto":`${ge}px`,...N,...f.style},onDragEnd:()=>{te(!1),L(null),cn.current=null},onPointerDown:yt=>{yt.button!==2&&(bt||!fe||(Te.current=new Date,ie(Ke.current),yt.target.setPointerCapture(yt.pointerId),yt.target.tagName!=="BUTTON"&&(te(!0),cn.current={x:yt.clientX,y:yt.clientY})))},onPointerUp:()=>{var yt,Ft,Tn;if(ae||!fe)return;cn.current=null;const hn=Number(((yt=Se.current)==null?void 0:yt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),en=Number(((Ft=Se.current)==null?void 0:Ft.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jt=new Date().getTime()-((Tn=Te.current)==null?void 0:Tn.getTime()),_t=G==="x"?hn:en,xa=Math.abs(_t)/Jt;if(Math.abs(_t)>=Y8t||xa>.11){ie(Ke.current),f.onDismiss==null||f.onDismiss.call(f,f),z(G==="x"?hn>0?"right":"left":en>0?"down":"up"),Pt(),ce(!0);return}else{var Lr,de;(Lr=Se.current)==null||Lr.style.setProperty("--swipe-amount-x","0px"),(de=Se.current)==null||de.style.setProperty("--swipe-amount-y","0px")}ee(!1),te(!1),L(null)},onPointerMove:yt=>{var Ft,Tn,hn;if(!cn.current||!fe||((Ft=window.getSelection())==null?void 0:Ft.toString().length)>0)return;const Jt=yt.clientY-cn.current.y,_t=yt.clientX-cn.current.x;var xa;const Lr=(xa=e.swipeDirections)!=null?xa:K8t(U);!G&&(Math.abs(_t)>1||Math.abs(Jt)>1)&&L(Math.abs(_t)>Math.abs(Jt)?"x":"y");let de={x:0,y:0};const _e=Me=>1/(1.5+Math.abs(Me)/20);if(G==="y"){if(Lr.includes("top")||Lr.includes("bottom"))if(Lr.includes("top")&&Jt<0||Lr.includes("bottom")&&Jt>0)de.y=Jt;else{const Me=Jt*_e(Jt);de.y=Math.abs(Me)<Math.abs(Jt)?Me:Jt}}else if(G==="x"&&(Lr.includes("left")||Lr.includes("right")))if(Lr.includes("left")&&_t<0||Lr.includes("right")&&_t>0)de.x=_t;else{const Me=_t*_e(_t);de.x=Math.abs(Me)<Math.abs(_t)?Me:_t}(Math.abs(de.x)>0||Math.abs(de.y)>0)&&ee(!0),(Tn=Se.current)==null||Tn.style.setProperty("--swipe-amount-x",`${de.x}px`),(hn=Se.current)==null||hn.style.setProperty("--swipe-amount-y",`${de.y}px`)}},ye&&!f.jsx&&se!=="loading"?be.createElement("button",{"aria-label":H,"data-disabled":bt,"data-close-button":!0,onClick:bt||!fe?()=>{}:()=>{Pt(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Lf(V?.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(Zn=B?.close)!=null?Zn:D8t):null,(se||f.icon||f.promise)&&f.icon!==null&&(B?.[se]!==null||f.icon)?be.createElement("div",{"data-icon":"",className:Lf(V?.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Yt():null,f.type!=="loading"?Ct:null):null,be.createElement("div",{"data-content":"",className:Lf(V?.content,f==null||(a=f.classNames)==null?void 0:a.content)},be.createElement("div",{"data-title":"",className:Lf(V?.title,f==null||(o=f.classNames)==null?void 0:o.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?be.createElement("div",{"data-description":"",className:Lf(P,Ne,V?.description,f==null||(i=f.classNames)==null?void 0:i.description)},typeof f.description=="function"?f.description():f.description):null),be.isValidElement(f.cancel)?f.cancel:f.cancel&&Tj(f.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||T,onClick:yt=>{Tj(f.cancel)&&fe&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,yt),Pt())},className:Lf(V?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,be.isValidElement(f.action)?f.action:f.action&&Tj(f.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||j,onClick:yt=>{Tj(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,yt),!yt.defaultPrevented&&Pt())},className:Lf(V?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function mwe(){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 ezt(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,o=a?"--mobile-offset":"--offset",i=a?G8t:Q8t;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${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[`${o}-${u}`]=i:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(i)}),n}const b9e=be.forwardRef(function(t,n){const{id:r,invert:s,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:c,className:u,offset:d,mobileOffset:f,theme:p="light",richColors:h,duration:g,style:b,visibleToasts:y=H8t,toastOptions:x,dir:w=mwe(),gap:O=Z8t,icons:k,containerAriaLabel:E="Notifications"}=t,[C,N]=be.useState([]),T=be.useMemo(()=>r?C.filter(I=>I.toasterId===r):C.filter(I=>!I.toasterId),[C,r]),j=be.useMemo(()=>Array.from(new Set([a].concat(T.filter(I=>I.position).map(I=>I.position)))),[T,a]),[R,P]=be.useState([]),[M,U]=be.useState(!1),[D,q]=be.useState(!1),[V,B]=be.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=be.useRef(null),G=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=be.useRef(null),Z=be.useRef(!1),z=be.useCallback(I=>{N(Q=>{var W;return(W=Q.find(J=>J.id===I.id))!=null&&W.delete||Gl.dismiss(I.id),Q.filter(({id:J})=>J!==I.id)})},[]);return be.useEffect(()=>Gl.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{N(Q=>Q.map(W=>W.id===I.id?{...W,delete:!0}:W))});return}setTimeout(()=>{bK.flushSync(()=>{N(Q=>{const W=Q.findIndex(J=>J.id===I.id);return W!==-1?[...Q.slice(0,W),{...Q[W],...I},...Q.slice(W+1)]:[I,...Q]})})})}),[C]),be.useEffect(()=>{if(p!=="system"){B(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:Q})=>{B(Q?"dark":"light")})}catch{I.addListener(({matches:W})=>{try{B(W?"dark":"light")}catch(J){console.error(J)}})}},[p]),be.useEffect(()=>{C.length<=1&&U(!1)},[C]),be.useEffect(()=>{const I=Q=>{var W;if(o.every(te=>Q[te]||Q.code===te)){var ne;U(!0),(ne=H.current)==null||ne.focus()}Q.code==="Escape"&&(document.activeElement===H.current||(W=H.current)!=null&&W.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[o]),be.useEffect(()=>{if(H.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Z.current=!1)}},[H.current]),be.createElement("section",{ref:n,"aria-label":`${E} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((I,Q)=>{var W;const[J,ne]=I.split("-");return T.length?be.createElement("ol",{key:I,dir:w==="auto"?mwe():w,tabIndex:-1,ref:H,className:u,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":J,"data-x-position":ne,style:{"--front-toast-height":`${((W=R[0])==null?void 0:W.height)||0}px`,"--width":`${W8t}px`,"--gap":`${O}px`,...b,...ezt(d,f)},onBlur:te=>{Z.current&&!te.currentTarget.contains(te.relatedTarget)&&(Z.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,L.current=te.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{D||U(!1)},onDragEnd:()=>U(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},T.filter(te=>!te.position&&Q===0||te.position===I).map((te,ae)=>{var ce,ve;return be.createElement(J8t,{key:te.id,icons:k,index:ae,toast:te,defaultRichColors:h,duration:(ce=x?.duration)!=null?ce:g,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:s,visibleToasts:y,closeButton:(ve=x?.closeButton)!=null?ve:c,interacting:D,position:I,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:z,toasts:T.filter(ee=>ee.position==te.position),heights:R.filter(ee=>ee.position==te.position),setHeights:P,expandByDefault:i,gap:O,expanded:M,swipeDirections:t.swipeDirections})})):null}))});var y9e="vercel.ai.error",tzt=Symbol.for(y9e),v9e,nzt=class x9e extends Error{constructor({name:t,message:n,cause:r}){super(n),this[v9e]=!0,this.name=t,this.cause=r}static isInstance(t){return x9e.hasMarker(t,y9e)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};v9e=tzt;var Ww=nzt;function w9e(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var S9e="AI_InvalidArgumentError",O9e=`vercel.ai.error.${S9e}`,rzt=Symbol.for(O9e),k9e,szt=class extends Ww{constructor({message:t,cause:n,argument:r}){super({name:S9e,message:t,cause:n}),this[k9e]=!0,this.argument=r}static isInstance(t){return Ww.hasMarker(t,O9e)}};k9e=rzt;var _9e="AI_JSONParseError",E9e=`vercel.ai.error.${_9e}`,azt=Symbol.for(E9e),C9e,gwe=class extends Ww{constructor({text:t,cause:n}){super({name:_9e,message:`JSON parsing failed: Text: ${t}.
|
|
133
133
|
Error message: ${w9e(n)}`,cause:n}),this[C9e]=!0,this.text=t}static isInstance(t){return Ww.hasMarker(t,E9e)}};C9e=azt;var T9e="AI_TypeValidationError",N9e=`vercel.ai.error.${T9e}`,ozt=Symbol.for(N9e),A9e,izt=class PW extends Ww{constructor({value:t,cause:n}){super({name:T9e,message:`Type validation failed: Value: ${JSON.stringify(t)}.
|
|
134
134
|
Error message: ${w9e(n)}`,cause:n}),this[A9e]=!0,this.value=t}static isInstance(t){return Ww.hasMarker(t,N9e)}static wrap({value:t,cause:n}){return PW.isInstance(n)&&n.value===t?n:new PW({value:t,cause:n})}};A9e=ozt;var bwe=izt;let lzt=(e,t=21)=>(n=t)=>{let r="",s=n|0;for(;s--;)r+=e[Math.random()*e.length|0];return r};var iy={exports:{}},ywe;function czt(){if(ywe)return iy.exports;ywe=1;const e=typeof Buffer<"u",t=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function r(i,c,u){u==null&&c!==null&&typeof c=="object"&&(u=c,c=void 0),e&&Buffer.isBuffer(i)&&(i=i.toString()),i&&i.charCodeAt(0)===65279&&(i=i.slice(1));const d=JSON.parse(i,c);if(d===null||typeof d!="object")return d;const f=u&&u.protoAction||"error",p=u&&u.constructorAction||"error";if(f==="ignore"&&p==="ignore")return d;if(f!=="ignore"&&p!=="ignore"){if(t.test(i)===!1&&n.test(i)===!1)return d}else if(f!=="ignore"&&p==="ignore"){if(t.test(i)===!1)return d}else if(n.test(i)===!1)return d;return s(d,{protoAction:f,constructorAction:p,safe:u&&u.safe})}function s(i,{protoAction:c="error",constructorAction:u="error",safe:d}={}){let f=[i];for(;f.length;){const p=f;f=[];for(const h of p){if(c!=="ignore"&&Object.prototype.hasOwnProperty.call(h,"__proto__")){if(d===!0)return null;if(c==="error")throw new SyntaxError("Object contains forbidden prototype property");delete h.__proto__}if(u!=="ignore"&&Object.prototype.hasOwnProperty.call(h,"constructor")&&Object.prototype.hasOwnProperty.call(h.constructor,"prototype")){if(d===!0)return null;if(u==="error")throw new SyntaxError("Object contains forbidden prototype property");delete h.constructor}for(const g in h){const b=h[g];b&&typeof b=="object"&&f.push(b)}}}return i}function a(i,c,u){const d=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return r(i,c,u)}finally{Error.stackTraceLimit=d}}function o(i,c){const u=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return r(i,c,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=u}}return iy.exports=a,iy.exports.default=a,iy.exports.parse=a,iy.exports.safeParse=o,iy.exports.scan=s,iy.exports}var uzt=czt();const dzt=vu(uzt);var fzt=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=lzt(n,t);if(e==null)return s;if(n.includes(r))throw new szt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return a=>`${e}${r}${s(a)}`};fzt();var MW=Symbol.for("vercel.ai.validator");function pzt(e){return{[MW]:!0,validate:e}}function hzt(e){return typeof e=="object"&&e!==null&&MW in e&&e[MW]===!0&&"validate"in e}function mzt(e){return hzt(e)?e:gzt(e)}function gzt(e){return pzt(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function bzt({value:e,schema:t}){const n=mzt(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:bwe.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:bwe.wrap({value:e,cause:r})}}}function vwe({text:e,schema:t}){try{const n=dzt.parse(e);if(t==null)return{success:!0,value:n,rawValue:n};const r=bzt({value:n,schema:t});return r.success?{...r,rawValue:n}:r}catch(n){return{success:!1,error:gwe.isInstance(n)?n:new gwe({text:e,cause:n})}}}const yzt=Symbol("Let zodToJsonSchema decide on which parser to use"),xwe={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},vzt=e=>typeof e=="string"?{...xwe,name:e}:{...xwe,...e},xzt=e=>{const t=vzt(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function j9e(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function Rs(e,t,n,r,s){e[t]=n,j9e(e,t,r,s)}const R9e=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};var ts;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),o={};for(const i of a)o[i]=s[i];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(const o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(ts||(ts={}));var $W;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($W||($W={}));const pn=ts.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ph=e=>{switch(typeof e){case"undefined":return pn.undefined;case"string":return pn.string;case"number":return Number.isNaN(e)?pn.nan:pn.number;case"boolean":return pn.boolean;case"function":return pn.function;case"bigint":return pn.bigint;case"symbol":return pn.symbol;case"object":return Array.isArray(e)?pn.array:e===null?pn.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?pn.promise:typeof Map<"u"&&e instanceof Map?pn.map:typeof Set<"u"&&e instanceof Set?pn.set:typeof Date<"u"&&e instanceof Date?pn.date:pn.object;default:return pn.unknown}},mt=ts.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Jg=class I9e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(a){return a.message},r={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let i=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(n(o))):i[u]=i[u]||{_errors:[]},i=i[u],c++}}};return s(this),r}static assert(t){if(!(t instanceof I9e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ts.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];n[a]=n[a]||[],n[a].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Jg.create=e=>new Jg(e);const IP=(e,t)=>{let n;switch(e.code){case mt.invalid_type:e.received===pn.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case mt.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ts.jsonStringifyReplacer)}`;break;case mt.unrecognized_keys:n=`Unrecognized key(s) in object: ${ts.joinValues(e.keys,", ")}`;break;case mt.invalid_union:n="Invalid input";break;case mt.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ts.joinValues(e.options)}`;break;case mt.invalid_enum_value:n=`Invalid enum value. Expected ${ts.joinValues(e.options)}, received '${e.received}'`;break;case mt.invalid_arguments:n="Invalid function arguments";break;case mt.invalid_return_type:n="Invalid function return type";break;case mt.invalid_date:n="Invalid date";break;case mt.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ts.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case mt.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case mt.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case mt.custom:n="Invalid input";break;case mt.invalid_intersection_types:n="Intersection results could not be merged";break;case mt.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case mt.not_finite:n="Number must be finite";break;default:n=t.defaultError,ts.assertNever(e)}return{message:n}};let wzt=IP;function P9e(){return wzt}const M9e=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let i="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)i=u(o,{data:t,defaultError:i}).message;return{...s,path:a,message:i}};function Ht(e,t){const n=P9e(),r=M9e({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===IP?void 0:IP].filter(s=>!!s)});e.common.issues.push(r)}class mc{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return sr;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const a=await s.key,o=await s.value;r.push({key:a,value:o})}return mc.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return sr;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const sr=Object.freeze({status:"aborted"}),$0=e=>({status:"dirty",value:e}),Su=e=>({status:"valid",value:e}),DW=e=>e.status==="aborted",LW=e=>e.status==="dirty",bv=e=>e.status==="valid",vE=e=>typeof Promise<"u"&&e instanceof Promise;var vn;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(vn||(vn={}));class eb{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const wwe=(e,t)=>{if(bv(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Jg(e.common.issues);return this._error=n,this._error}}};function Er(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,i)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??r??i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:c??n??i.defaultError}},description:s}}let Ur=class{get description(){return this._def.description}_getType(t){return Ph(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ph(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new mc,ctx:{common:t.parent.common,data:t.data,parsedType:Ph(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(vE(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ph(t)},s=this._parseSync({data:t,path:r.path,parent:r});return wwe(r,s)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ph(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return bv(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>bv(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ph(t)},s=this._parse({data:t,path:r.path,parent:r}),a=await(vE(s)?s:Promise.resolve(s));return wwe(r,a)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,a)=>{const o=t(s),i=()=>a.addIssue({code:mt.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new tb({schema:this,typeName:Pe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Qh.create(this,this._def)}nullable(){return vv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yv.create(this)}promise(){return SE.create(this,this._def)}or(t){return xE.create([this,t],this._def)}and(t){return wE.create(this,t,this._def)}transform(t){return new tb({...Er(this._def),schema:this,typeName:Pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new PP({...Er(this._def),innerType:this,defaultValue:n,typeName:Pe.ZodDefault})}brand(){return new U9e({typeName:Pe.ZodBranded,type:this,...Er(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new MP({...Er(this._def),innerType:this,catchValue:n,typeName:Pe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return U$.create(this,t)}readonly(){return $P.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const Szt=/^c[^\s-]{8,}$/i,Ozt=/^[0-9a-z]+$/,kzt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_zt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ezt=/^[a-z0-9_-]{21}$/i,Czt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tzt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nzt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Azt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let jU;const jzt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rzt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Izt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Pzt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mzt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$zt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$9e="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Dzt=new RegExp(`^${$9e}$`);function D9e(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Lzt(e){return new RegExp(`^${D9e(e)}$`)}function L9e(e){let t=`${$9e}T${D9e(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Fzt(e,t){return!!((t==="v4"||!t)&&jzt.test(e)||(t==="v6"||!t)&&Izt.test(e))}function zzt(e,t){if(!Czt.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function Bzt(e,t){return!!((t==="v4"||!t)&&Rzt.test(e)||(t==="v6"||!t)&&Pzt.test(e))}let FW=class Sk extends Ur{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==pn.string){const a=this._getOrReturnCtx(t);return Ht(a,{code:mt.invalid_type,expected:pn.string,received:a.parsedType}),sr}const r=new mc;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,i=t.data.length<a.value;(o||i)&&(s=this._getOrReturnCtx(t,s),o?Ht(s,{code:mt.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&Ht(s,{code:mt.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Nzt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"email",code:mt.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")jU||(jU=new RegExp(Azt,"u")),jU.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"emoji",code:mt.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")_zt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"uuid",code:mt.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")Ezt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"nanoid",code:mt.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Szt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"cuid",code:mt.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")Ozt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"cuid2",code:mt.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")kzt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"ulid",code:mt.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Ht(s,{validation:"url",code:mt.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"regex",code:mt.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?L9e(a).test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Dzt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?Lzt(a).test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?Tzt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"duration",code:mt.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?Fzt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"ip",code:mt.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?zzt(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"jwt",code:mt.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?Bzt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"cidr",code:mt.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Mzt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"base64",code:mt.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?$zt.test(t.data)||(s=this._getOrReturnCtx(t,s),Ht(s,{validation:"base64url",code:mt.invalid_string,message:a.message}),r.dirty()):ts.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:mt.invalid_string,...vn.errToObj(r)})}_addCheck(t){return new Sk({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...vn.errToObj(t)})}url(t){return this._addCheck({kind:"url",...vn.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...vn.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...vn.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...vn.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...vn.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...vn.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...vn.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...vn.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...vn.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...vn.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...vn.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...vn.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...vn.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...vn.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...vn.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...vn.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...vn.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...vn.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...vn.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...vn.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...vn.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...vn.errToObj(n)})}nonempty(t){return this.min(1,vn.errToObj(t))}trim(){return new Sk({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Sk({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Sk({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};FW.create=e=>new FW({checks:[],typeName:Pe.ZodString,coerce:e?.coerce??!1,...Er(e)});function Uzt(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}let zW=class BW extends Ur{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==pn.number){const a=this._getOrReturnCtx(t);return Ht(a,{code:mt.invalid_type,expected:pn.number,received:a.parsedType}),sr}let r;const s=new mc;for(const a of this._def.checks)a.kind==="int"?ts.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ht(r,{code:mt.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),Ht(r,{code:mt.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),Ht(r,{code:mt.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?Uzt(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),Ht(r,{code:mt.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ht(r,{code:mt.not_finite,message:a.message}),s.dirty()):ts.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,vn.toString(n))}gt(t,n){return this.setLimit("min",t,!1,vn.toString(n))}lte(t,n){return this.setLimit("max",t,!0,vn.toString(n))}lt(t,n){return this.setLimit("max",t,!1,vn.toString(n))}setLimit(t,n,r,s){return new BW({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:vn.toString(s)}]})}_addCheck(t){return new BW({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:vn.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:vn.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:vn.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:vn.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:vn.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:vn.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:vn.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:vn.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:vn.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ts.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};zW.create=e=>new zW({checks:[],typeName:Pe.ZodNumber,coerce:e?.coerce||!1,...Er(e)});let UW=class VW extends Ur{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==pn.bigint)return this._getInvalidInput(t);let r;const s=new mc;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),Ht(r,{code:mt.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),Ht(r,{code:mt.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ht(r,{code:mt.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):ts.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ht(n,{code:mt.invalid_type,expected:pn.bigint,received:n.parsedType}),sr}gte(t,n){return this.setLimit("min",t,!0,vn.toString(n))}gt(t,n){return this.setLimit("min",t,!1,vn.toString(n))}lte(t,n){return this.setLimit("max",t,!0,vn.toString(n))}lt(t,n){return this.setLimit("max",t,!1,vn.toString(n))}setLimit(t,n,r,s){return new VW({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:vn.toString(s)}]})}_addCheck(t){return new VW({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:vn.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:vn.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:vn.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:vn.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:vn.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};UW.create=e=>new UW({checks:[],typeName:Pe.ZodBigInt,coerce:e?.coerce??!1,...Er(e)});let qW=class extends Ur{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==pn.boolean){const r=this._getOrReturnCtx(t);return Ht(r,{code:mt.invalid_type,expected:pn.boolean,received:r.parsedType}),sr}return Su(t.data)}};qW.create=e=>new qW({typeName:Pe.ZodBoolean,coerce:e?.coerce||!1,...Er(e)});let HW=class F9e extends Ur{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==pn.date){const a=this._getOrReturnCtx(t);return Ht(a,{code:mt.invalid_type,expected:pn.date,received:a.parsedType}),sr}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return Ht(a,{code:mt.invalid_date}),sr}const r=new mc;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),Ht(s,{code:mt.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):ts.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new F9e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:vn.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:vn.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};HW.create=e=>new HW({checks:[],coerce:e?.coerce||!1,typeName:Pe.ZodDate,...Er(e)});let QW=class extends Ur{_parse(t){if(this._getType(t)!==pn.symbol){const r=this._getOrReturnCtx(t);return Ht(r,{code:mt.invalid_type,expected:pn.symbol,received:r.parsedType}),sr}return Su(t.data)}};QW.create=e=>new QW({typeName:Pe.ZodSymbol,...Er(e)});let GW=class extends Ur{_parse(t){if(this._getType(t)!==pn.undefined){const r=this._getOrReturnCtx(t);return Ht(r,{code:mt.invalid_type,expected:pn.undefined,received:r.parsedType}),sr}return Su(t.data)}};GW.create=e=>new GW({typeName:Pe.ZodUndefined,...Er(e)});let WW=class extends Ur{_parse(t){if(this._getType(t)!==pn.null){const r=this._getOrReturnCtx(t);return Ht(r,{code:mt.invalid_type,expected:pn.null,received:r.parsedType}),sr}return Su(t.data)}};WW.create=e=>new WW({typeName:Pe.ZodNull,...Er(e)});let ZW=class extends Ur{constructor(){super(...arguments),this._any=!0}_parse(t){return Su(t.data)}};ZW.create=e=>new ZW({typeName:Pe.ZodAny,...Er(e)});let YW=class extends Ur{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Su(t.data)}};YW.create=e=>new YW({typeName:Pe.ZodUnknown,...Er(e)});let am=class extends Ur{_parse(t){const n=this._getOrReturnCtx(t);return Ht(n,{code:mt.invalid_type,expected:pn.never,received:n.parsedType}),sr}};am.create=e=>new am({typeName:Pe.ZodNever,...Er(e)});let XW=class extends Ur{_parse(t){if(this._getType(t)!==pn.undefined){const r=this._getOrReturnCtx(t);return Ht(r,{code:mt.invalid_type,expected:pn.void,received:r.parsedType}),sr}return Su(t.data)}};XW.create=e=>new XW({typeName:Pe.ZodVoid,...Er(e)});let yv=class iI extends Ur{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==pn.array)return Ht(n,{code:mt.invalid_type,expected:pn.array,received:n.parsedType}),sr;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,i=n.data.length<s.exactLength.value;(o||i)&&(Ht(n,{code:o?mt.too_big:mt.too_small,minimum:i?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Ht(n,{code:mt.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Ht(n,{code:mt.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,i)=>s.type._parseAsync(new eb(n,o,n.path,i)))).then(o=>mc.mergeArray(r,o));const a=[...n.data].map((o,i)=>s.type._parseSync(new eb(n,o,n.path,i)));return mc.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new iI({...this._def,minLength:{value:t,message:vn.toString(n)}})}max(t,n){return new iI({...this._def,maxLength:{value:t,message:vn.toString(n)}})}length(t,n){return new iI({...this._def,exactLength:{value:t,message:vn.toString(n)}})}nonempty(t){return this.min(1,t)}};yv.create=(e,t)=>new yv({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Pe.ZodArray,...Er(t)});function k0(e){if(e instanceof om){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Qh.create(k0(r))}return new om({...e._def,shape:()=>t})}else return e instanceof yv?new yv({...e._def,type:k0(e.element)}):e instanceof Qh?Qh.create(k0(e.unwrap())):e instanceof vv?vv.create(k0(e.unwrap())):e instanceof Zw?Zw.create(e.items.map(t=>k0(t))):e}let om=class Md extends Ur{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ts.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==pn.object){const u=this._getOrReturnCtx(t);return Ht(u,{code:mt.invalid_type,expected:pn.object,received:u.parsedType}),sr}const{status:r,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof am&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||i.push(u);const c=[];for(const u of o){const d=a[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new eb(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof am){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of i)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")i.length>0&&(Ht(s,{code:mt.unrecognized_keys,keys:i}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of i){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new eb(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,p=await d.value;u.push({key:f,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>mc.mergeObjectSync(r,u)):mc.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return vn.errToObj,new Md({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:vn.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Md({...this._def,unknownKeys:"strip"})}passthrough(){return new Md({...this._def,unknownKeys:"passthrough"})}extend(t){return new Md({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Md({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Pe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Md({...this._def,catchall:t})}pick(t){const n={};for(const r of ts.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Md({...this._def,shape:()=>n})}omit(t){const n={};for(const r of ts.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Md({...this._def,shape:()=>n})}deepPartial(){return k0(this)}partial(t){const n={};for(const r of ts.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new Md({...this._def,shape:()=>n})}required(t){const n={};for(const r of ts.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Qh;)a=a._def.innerType;n[r]=a}return new Md({...this._def,shape:()=>n})}keyof(){return B9e(ts.objectKeys(this.shape))}};om.create=(e,t)=>new om({shape:()=>e,unknownKeys:"strip",catchall:am.create(),typeName:Pe.ZodObject,...Er(t)});om.strictCreate=(e,t)=>new om({shape:()=>e,unknownKeys:"strict",catchall:am.create(),typeName:Pe.ZodObject,...Er(t)});om.lazycreate=(e,t)=>new om({shape:e,unknownKeys:"strip",catchall:am.create(),typeName:Pe.ZodObject,...Er(t)});let xE=class extends Ur{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(a){for(const i of a)if(i.result.status==="valid")return i.result;for(const i of a)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;const o=a.map(i=>new Jg(i.ctx.common.issues));return Ht(n,{code:mt.invalid_union,unionErrors:o}),sr}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(c=>new Jg(c));return Ht(n,{code:mt.invalid_union,unionErrors:i}),sr}}get options(){return this._def.options}};xE.create=(e,t)=>new xE({options:e,typeName:Pe.ZodUnion,...Er(t)});function KW(e,t){const n=Ph(e),r=Ph(t);if(e===t)return{valid:!0,data:e};if(n===pn.object&&r===pn.object){const s=ts.objectKeys(t),a=ts.objectKeys(e).filter(i=>s.indexOf(i)!==-1),o={...e,...t};for(const i of a){const c=KW(e[i],t[i]);if(!c.valid)return{valid:!1};o[i]=c.data}return{valid:!0,data:o}}else if(n===pn.array&&r===pn.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const o=e[a],i=t[a],c=KW(o,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===pn.date&&r===pn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}let wE=class extends Ur{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(a,o)=>{if(DW(a)||DW(o))return sr;const i=KW(a.value,o.value);return i.valid?((LW(a)||LW(o))&&n.dirty(),{status:n.value,value:i.data}):(Ht(r,{code:mt.invalid_intersection_types}),sr)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};wE.create=(e,t,n)=>new wE({left:e,right:t,typeName:Pe.ZodIntersection,...Er(n)});let Zw=class z9e extends Ur{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==pn.array)return Ht(r,{code:mt.invalid_type,expected:pn.array,received:r.parsedType}),sr;if(r.data.length<this._def.items.length)return Ht(r,{code:mt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),sr;!this._def.rest&&r.data.length>this._def.items.length&&(Ht(r,{code:mt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,i)=>{const c=this._def.items[i]||this._def.rest;return c?c._parse(new eb(r,o,r.path,i)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>mc.mergeArray(n,o)):mc.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new z9e({...this._def,rest:t})}};Zw.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zw({items:e,typeName:Pe.ZodTuple,rest:null,...Er(t)})};let JW=class extends Ur{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==pn.map)return Ht(r,{code:mt.invalid_type,expected:pn.map,received:r.parsedType}),sr;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([i,c],u)=>({key:s._parse(new eb(r,i,r.path,[u,"key"])),value:a._parse(new eb(r,c,r.path,[u,"value"]))}));if(r.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return sr;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(u.value,d.value)}return{status:n.value,value:i}})}else{const i=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return sr;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(u.value,d.value)}return{status:n.value,value:i}}}};JW.create=(e,t,n)=>new JW({valueType:t,keyType:e,typeName:Pe.ZodMap,...Er(n)});let eZ=class tZ extends Ur{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==pn.set)return Ht(r,{code:mt.invalid_type,expected:pn.set,received:r.parsedType}),sr;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ht(r,{code:mt.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Ht(r,{code:mt.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return sr;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const i=[...r.data.values()].map((c,u)=>a._parse(new eb(r,c,r.path,u)));return r.common.async?Promise.all(i).then(c=>o(c)):o(i)}min(t,n){return new tZ({...this._def,minSize:{value:t,message:vn.toString(n)}})}max(t,n){return new tZ({...this._def,maxSize:{value:t,message:vn.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};eZ.create=(e,t)=>new eZ({valueType:e,minSize:null,maxSize:null,typeName:Pe.ZodSet,...Er(t)});let nZ=class extends Ur{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};nZ.create=(e,t)=>new nZ({getter:e,typeName:Pe.ZodLazy,...Er(t)});let rZ=class extends Ur{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ht(n,{received:n.data,code:mt.invalid_literal,expected:this._def.value}),sr}return{status:"valid",value:t.data}}get value(){return this._def.value}};rZ.create=(e,t)=>new rZ({value:e,typeName:Pe.ZodLiteral,...Er(t)});function B9e(e,t){return new B$({values:e,typeName:Pe.ZodEnum,...Er(t)})}let B$=class sZ extends Ur{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ht(n,{expected:ts.joinValues(r),received:n.parsedType,code:mt.invalid_type}),sr}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ht(n,{received:n.data,code:mt.invalid_enum_value,options:r}),sr}return Su(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return sZ.create(t,{...this._def,...n})}exclude(t,n=this._def){return sZ.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};B$.create=B9e;class aZ extends Ur{_parse(t){const n=ts.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==pn.string&&r.parsedType!==pn.number){const s=ts.objectValues(n);return Ht(r,{expected:ts.joinValues(s),received:r.parsedType,code:mt.invalid_type}),sr}if(this._cache||(this._cache=new Set(ts.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=ts.objectValues(n);return Ht(r,{received:r.data,code:mt.invalid_enum_value,options:s}),sr}return Su(t.data)}get enum(){return this._def.values}}aZ.create=(e,t)=>new aZ({values:e,typeName:Pe.ZodNativeEnum,...Er(t)});let SE=class extends Ur{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==pn.promise&&n.common.async===!1)return Ht(n,{code:mt.invalid_type,expected:pn.promise,received:n.parsedType}),sr;const r=n.parsedType===pn.promise?n.data:Promise.resolve(n.data);return Su(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}};SE.create=(e,t)=>new SE({type:e,typeName:Pe.ZodPromise,...Er(t)});class tb extends Ur{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{Ht(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async i=>{if(n.value==="aborted")return sr;const c=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});return c.status==="aborted"?sr:c.status==="dirty"||n.value==="dirty"?$0(c.value):c});{if(n.value==="aborted")return sr;const i=this._def.schema._parseSync({data:o,path:r.path,parent:r});return i.status==="aborted"?sr:i.status==="dirty"||n.value==="dirty"?$0(i.value):i}}if(s.type==="refinement"){const o=i=>{const c=s.refinement(i,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?sr:(i.status==="dirty"&&n.dirty(),o(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>i.status==="aborted"?sr:(i.status==="dirty"&&n.dirty(),o(i.value).then(()=>({status:n.value,value:i.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!bv(o))return sr;const i=s.transform(o.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>bv(o)?Promise.resolve(s.transform(o.value,a)).then(i=>({status:n.value,value:i})):sr);ts.assertNever(s)}}tb.create=(e,t,n)=>new tb({schema:e,typeName:Pe.ZodEffects,effect:t,...Er(n)});tb.createWithPreprocess=(e,t,n)=>new tb({schema:t,effect:{type:"preprocess",transform:e},typeName:Pe.ZodEffects,...Er(n)});let Qh=class extends Ur{_parse(t){return this._getType(t)===pn.undefined?Su(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Qh.create=(e,t)=>new Qh({innerType:e,typeName:Pe.ZodOptional,...Er(t)});let vv=class extends Ur{_parse(t){return this._getType(t)===pn.null?Su(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};vv.create=(e,t)=>new vv({innerType:e,typeName:Pe.ZodNullable,...Er(t)});let PP=class extends Ur{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===pn.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};PP.create=(e,t)=>new PP({innerType:e,typeName:Pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Er(t)});let MP=class extends Ur{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vE(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Jg(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Jg(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};MP.create=(e,t)=>new MP({innerType:e,typeName:Pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Er(t)});let oZ=class extends Ur{_parse(t){if(this._getType(t)!==pn.nan){const r=this._getOrReturnCtx(t);return Ht(r,{code:mt.invalid_type,expected:pn.nan,received:r.parsedType}),sr}return{status:"valid",value:t.data}}};oZ.create=e=>new oZ({typeName:Pe.ZodNaN,...Er(e)});class U9e extends Ur{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class U$ extends Ur{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?sr:a.status==="dirty"?(n.dirty(),$0(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?sr:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new U$({in:t,out:n,typeName:Pe.ZodPipeline})}}let $P=class extends Ur{_parse(t){const n=this._def.innerType._parse(t),r=s=>(bv(s)&&(s.value=Object.freeze(s.value)),s);return vE(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}};$P.create=(e,t)=>new $P({innerType:e,typeName:Pe.ZodReadonly,...Er(t)});var Pe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Pe||(Pe={}));am.create;yv.create;xE.create;wE.create;Zw.create;B$.create;SE.create;Qh.create;vv.create;const Vzt=Object.freeze(Object.defineProperty({__proto__:null,DIRTY:$0,INVALID:sr,OK:Su,ParseStatus:mc,Schema:Ur,ZodAny:ZW,ZodArray:yv,ZodBigInt:UW,ZodBoolean:qW,ZodBranded:U9e,ZodCatch:MP,ZodDate:HW,ZodDefault:PP,ZodEffects:tb,ZodEnum:B$,ZodError:Jg,get ZodFirstPartyTypeKind(){return Pe},ZodIntersection:wE,ZodIssueCode:mt,ZodLazy:nZ,ZodLiteral:rZ,ZodMap:JW,ZodNaN:oZ,ZodNativeEnum:aZ,ZodNever:am,ZodNull:WW,ZodNullable:vv,ZodNumber:zW,ZodObject:om,ZodOptional:Qh,ZodParsedType:pn,ZodPipeline:U$,ZodPromise:SE,ZodReadonly:$P,ZodSchema:Ur,ZodSet:eZ,ZodString:FW,ZodSymbol:QW,ZodTransformer:tb,ZodTuple:Zw,ZodType:Ur,ZodUndefined:GW,ZodUnion:xE,ZodUnknown:YW,ZodVoid:XW,addIssueToContext:Ht,datetimeRegex:L9e,defaultErrorMap:IP,getErrorMap:P9e,getParsedType:Ph,isAborted:DW,isAsync:vE,isDirty:LW,isValid:bv,makeIssue:M9e,get objectUtil(){return $W},get util(){return ts}},Symbol.toStringTag,{value:"Module"}));function gc(e){if(e.target!=="openAi")return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?R9e(t,e.currentPath):t.join("/")}}function qzt(e,t){const n={type:"array"};return e.type?._def&&e.type?._def?.typeName!==Pe.ZodAny&&(n.items=bs(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Rs(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Rs(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Rs(n,"minItems",e.exactLength.value,e.exactLength.message,t),Rs(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function Hzt(e,t){const n={type:"integer",format:"int64"};if(!e.checks)return n;for(const r of e.checks)switch(r.kind){case"min":t.target==="jsonSchema7"?r.inclusive?Rs(n,"minimum",r.value,r.message,t):Rs(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),Rs(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?Rs(n,"maximum",r.value,r.message,t):Rs(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),Rs(n,"maximum",r.value,r.message,t));break;case"multipleOf":Rs(n,"multipleOf",r.value,r.message,t);break}return n}function Qzt(){return{type:"boolean"}}function V9e(e,t){return bs(e.type._def,t)}const Gzt=(e,t)=>bs(e.innerType._def,t);function q9e(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,a)=>q9e(e,t,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Wzt(e,t)}}const Wzt=(e,t)=>{const n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(const r of e.checks)switch(r.kind){case"min":Rs(n,"minimum",r.value,r.message,t);break;case"max":Rs(n,"maximum",r.value,r.message,t);break}return n};function Zzt(e,t){return{...bs(e.innerType._def,t),default:e.defaultValue()}}function Yzt(e,t){return t.effectStrategy==="input"?bs(e.schema._def,t):gc(t)}function Xzt(e){return{type:"string",enum:Array.from(e.values)}}const Kzt=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Jzt(e,t){const n=[bs(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),bs(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(a=>!!a);let r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const s=[];return n.forEach(a=>{if(Kzt(a))s.push(...a.allOf),a.unevaluatedProperties===void 0&&(r=void 0);else{let o=a;if("additionalProperties"in a&&a.additionalProperties===!1){const{additionalProperties:i,...c}=a;o=c}else r=void 0;s.push(o)}}),s.length?{allOf:s,...r}:void 0}function e7t(e,t){const n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}let RU;const Ed={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(RU===void 0&&(RU=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),RU),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function H9e(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":Rs(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,t);break;case"max":Rs(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Cd(n,"email",r.message,t);break;case"format:idn-email":Cd(n,"idn-email",r.message,t);break;case"pattern:zod":ul(n,Ed.email,r.message,t);break}break;case"url":Cd(n,"uri",r.message,t);break;case"uuid":Cd(n,"uuid",r.message,t);break;case"regex":ul(n,r.regex,r.message,t);break;case"cuid":ul(n,Ed.cuid,r.message,t);break;case"cuid2":ul(n,Ed.cuid2,r.message,t);break;case"startsWith":ul(n,RegExp(`^${IU(r.value,t)}`),r.message,t);break;case"endsWith":ul(n,RegExp(`${IU(r.value,t)}$`),r.message,t);break;case"datetime":Cd(n,"date-time",r.message,t);break;case"date":Cd(n,"date",r.message,t);break;case"time":Cd(n,"time",r.message,t);break;case"duration":Cd(n,"duration",r.message,t);break;case"length":Rs(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,t),Rs(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"includes":{ul(n,RegExp(IU(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&Cd(n,"ipv4",r.message,t),r.version!=="v4"&&Cd(n,"ipv6",r.message,t);break}case"base64url":ul(n,Ed.base64url,r.message,t);break;case"jwt":ul(n,Ed.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&ul(n,Ed.ipv4Cidr,r.message,t),r.version!=="v4"&&ul(n,Ed.ipv6Cidr,r.message,t);break}case"emoji":ul(n,Ed.emoji(),r.message,t);break;case"ulid":{ul(n,Ed.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Cd(n,"binary",r.message,t);break}case"contentEncoding:base64":{Rs(n,"contentEncoding","base64",r.message,t);break}case"pattern:zod":{ul(n,Ed.base64,r.message,t);break}}break}case"nanoid":ul(n,Ed.nanoid,r.message,t)}return n}function IU(e,t){return t.patternStrategy==="escape"?n7t(e):e}const t7t=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function n7t(e){let t="";for(let n=0;n<e.length;n++)t7t.has(e[n])||(t+="\\"),t+=e[n];return t}function Cd(e,t,n,r){e.format||e.anyOf?.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):Rs(e,"format",t,n,r)}function ul(e,t,n,r){e.pattern||e.allOf?.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Swe(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):Rs(e,"pattern",Swe(t,r),n,r)}function Swe(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;const n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source;let s="",a=!1,o=!1,i=!1;for(let c=0;c<r.length;c++){if(a){s+=r[c],a=!1;continue}if(n.i){if(o){if(r[c].match(/[a-z]/)){i?(s+=r[c],s+=`${r[c-2]}-${r[c]}`.toUpperCase(),i=!1):r[c+1]==="-"&&r[c+2]?.match(/[a-z]/)?(s+=r[c],i=!0):s+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){s+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(n.m){if(r[c]==="^"){s+=`(^|(?<=[\r
|
|
@@ -327,7 +327,7 @@ Error message: ${Use(n)}`,cause:n}),this[c_e]=!0,this.value=t}static isInstance(
|
|
|
327
327
|
]))`;continue}else if(s[u]==="$"){a+=`($|(?=[\r
|
|
328
328
|
]))`;continue}}if(r.s&&s[u]==="."){a+=i?`${s[u]}\r
|
|
329
329
|
`:`[${s[u]}\r
|
|
330
|
-
]`;continue}a+=s[u],s[u]==="\\"?o=!0:i&&s[u]==="]"?i=!1:!i&&s[u]==="["&&(i=!0)}return a}function uZe(e,t){var n,r,s,a,o,i;const c={type:"object",additionalProperties:(n=Ps(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===Pe.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:u,...d}=cZe(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===Pe.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((o=e.keyType)==null?void 0:o._def.typeName)===Pe.ZodBranded&&e.keyType._def.type._def.typeName===Pe.ZodString&&((i=e.keyType._def.type._def.checks)!=null&&i.length)){const{type:u,...d}=iZe(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function Tmn(e,t){if(t.mapStrategy==="record")return uZe(e,t);const n=Ps(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||bu(),r=Ps(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||bu();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Nmn(e){const t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),s=Array.from(new Set(r.map(a=>typeof a)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Amn(){return{not:bu()}}function jmn(){return{type:"null"}}var _Y={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Rmn(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in _Y&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,a)=>{const o=_Y[a._def.typeName];return o&&!s.includes(o)?[...s,o]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,a)=>{const o=typeof a._def.value;switch(o){case"string":case"number":case"boolean":return[...s,o];case"bigint":return[...s,"integer"];case"object":if(a._def.value===null)return[...s,"null"];default:return s}},[]);if(r.length===n.length){const s=r.filter((a,o,i)=>i.indexOf(a)===o);return{type:s.length>1?s:s[0],enum:n.reduce((a,o)=>a.includes(o._def.value)?a:[...a,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(a=>!r.includes(a))],[])};return Imn(e,t)}var Imn=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>Ps(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Pmn(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[_Y[e.innerType._def.typeName],"null"]};const n=Ps(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Mmn(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 $mn(e,t){const n={type:"object",properties:{}},r=[],s=e.shape();for(const o in s){let i=s[o];if(i===void 0||i._def===void 0)continue;const c=Lmn(i),u=Ps(i._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});u!==void 0&&(n.properties[o]=u,c||r.push(o))}r.length&&(n.required=r);const a=Dmn(e,t);return a!==void 0&&(n.additionalProperties=a),n}function Dmn(e,t){if(e.catchall._def.typeName!=="ZodNever")return Ps(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 Lmn(e){try{return e.isOptional()}catch{return!0}}var Fmn=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Ps(e.innerType._def,t);const r=Ps(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:bu()},r]}:bu()},zmn=(e,t)=>{if(t.pipeStrategy==="input")return Ps(e.in._def,t);if(t.pipeStrategy==="output")return Ps(e.out._def,t);const n=Ps(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Ps(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function Bmn(e,t){return Ps(e.type._def,t)}function Umn(e,t){const r={type:"array",uniqueItems:!0,items:Ps(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 Vmn(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Ps(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ps(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Ps(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function qmn(){return{not:bu()}}function Hmn(){return bu()}var Qmn=(e,t)=>Ps(e.innerType._def,t),Gmn=(e,t,n)=>{switch(t){case Pe.ZodString:return cZe(e,n);case Pe.ZodNumber:return Mmn(e);case Pe.ZodObject:return $mn(e,n);case Pe.ZodBigInt:return gmn(e);case Pe.ZodBoolean:return bmn();case Pe.ZodDate:return lZe(e,n);case Pe.ZodUndefined:return qmn();case Pe.ZodNull:return jmn();case Pe.ZodArray:return mmn(e,n);case Pe.ZodUnion:case Pe.ZodDiscriminatedUnion:return Rmn(e,n);case Pe.ZodIntersection:return kmn(e,n);case Pe.ZodTuple:return Vmn(e,n);case Pe.ZodRecord:return uZe(e,n);case Pe.ZodLiteral:return _mn(e);case Pe.ZodEnum:return Smn(e);case Pe.ZodNativeEnum:return Nmn(e);case Pe.ZodNullable:return Pmn(e,n);case Pe.ZodOptional:return Fmn(e,n);case Pe.ZodMap:return Tmn(e,n);case Pe.ZodSet:return Umn(e,n);case Pe.ZodLazy:return()=>e.getter()._def;case Pe.ZodPromise:return Bmn(e,n);case Pe.ZodNaN:case Pe.ZodNever:return Amn();case Pe.ZodEffects:return wmn(e,n);case Pe.ZodAny:return bu();case Pe.ZodUnknown:return Hmn();case Pe.ZodDefault:return xmn(e,n);case Pe.ZodBranded:return iZe(e,n);case Pe.ZodReadonly:return Qmn(e,n);case Pe.ZodCatch:return ymn(e,n);case Pe.ZodPipeline:return zmn(e,n);case Pe.ZodFunction:case Pe.ZodVoid:case Pe.ZodSymbol:return;default:return(r=>{})()}};function Ps(e,t,n=!1){var r;const s=t.seen.get(e);if(t.override){const c=(r=t.override)==null?void 0:r.call(t,e,t,s,n);if(c!==pmn)return c}if(s&&!n){const c=Wmn(s,t);if(c!==void 0)return c}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const o=Gmn(e,e.typeName,t),i=typeof o=="function"?Ps(o(),t):o;if(i&&Zmn(e,t,i),t.postProcess){const c=t.postProcess(i,e,t);return a.jsonSchema=i,c}return a.jsonSchema=i,i}var Wmn=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:fmn(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`),bu()):t.$refStrategy==="seen"?bu():void 0}},Zmn=(e,t,n)=>(e.description&&(n.description=e.description),n),Ymn=e=>{const t=hmn(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,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},Xmn=(e,t)=>{var n;const r=Ymn(t);let s=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,f])=>{var p;return{...u,[d]:(p=Ps(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:bu()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=(n=Ps(e._def,a===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))!=null?n:bu(),i=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;i!==void 0&&(o.title=i);const c=a===void 0?s?{...o,[r.definitionPath]:s}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...s,[a]:o}};return c.$schema="http://json-schema.org/draft-07/schema#",c},Kmn=Xmn;function Jmn(e,t){var n;const r=(n=void 0)!=null?n:!1;return qse(()=>Kmn(e,{$refStrategy:r?"root":"none"}),{validate:async s=>{const a=await e.safeParseAsync(s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function egn(e,t){var n;const r=(n=void 0)!=null?n:!1;return qse(()=>SI(pD(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async s=>{const a=await Sne(e,s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function tgn(e){return"_zod"in e}function wf(e,t){return tgn(e)?egn(e):Jmn(e)}var EY=Symbol.for("vercel.ai.schema");function O4(e){let t;return()=>(t==null&&(t=e()),t)}function qse(e,{validate:t}={}){return{[EY]:!0,_type:void 0,[A2]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function ngn(e){return typeof e=="object"&&e!==null&&EY in e&&e[EY]===!0&&"jsonSchema"in e&&"validate"in e}function rgn(e){return e==null?qse({properties:{},additionalProperties:!1}):ngn(e)?e:typeof e=="function"?e():wf(e)}function sgn(e){return e?.replace(/\/$/,"")}var agn={},dZe=S4({"../../../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,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(p,h)=>{for(var g in h)n(p,g,{get:h[g],enumerable:!0})},i=(p,h,g,b)=>{if(h&&typeof h=="object"||typeof h=="function")for(let y of s(h))!a.call(p,y)&&y!==g&&n(p,y,{get:()=>h[y],enumerable:!(b=r(h,y))||b.enumerable});return p},c=p=>i(n({},"__esModule",{value:!0}),p),u={};o(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?.()??{}}}}),ogn=S4({"../../../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,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(g,b)=>{for(var y in b)n(g,y,{get:b[y],enumerable:!0})},i=(g,b,y,x)=>{if(b&&typeof b=="object"||typeof b=="function")for(let w of s(b))!a.call(g,w)&&w!==y&&n(g,w,{get:()=>b[w],enumerable:!(x=r(b,w))||x.enumerable});return g},c=g=>i(n({},"__esModule",{value:!0}),g),u={};o(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>h}),t.exports=c(u);var d=dZe(),f=$hn();async function p(){let g="",b;try{g=h()}catch(y){b=y}try{const[{getTokenPayload:y,isExpired:x},{refreshToken:w}]=await Promise.all([await He(()=>import("./token-util-RMHT2CPJ-VVUHOXBL-Dz7dvBZ8.js"),__vite__mapDeps([23,24,1]),import.meta.url),await He(()=>import("./token-APYSY3BW-RPVF55TR--RVNSBkE.js"),__vite__mapDeps([25,24,1]),import.meta.url)]);(!g||x(y(g)))&&(await w(),g=h())}catch(y){let x=b instanceof Error?b.message:"";throw y instanceof Error&&(x=`${x}
|
|
330
|
+
]`;continue}a+=s[u],s[u]==="\\"?o=!0:i&&s[u]==="]"?i=!1:!i&&s[u]==="["&&(i=!0)}return a}function uZe(e,t){var n,r,s,a,o,i;const c={type:"object",additionalProperties:(n=Ps(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===Pe.ZodString&&((s=e.keyType._def.checks)!=null&&s.length)){const{type:u,...d}=cZe(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((a=e.keyType)==null?void 0:a._def.typeName)===Pe.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((o=e.keyType)==null?void 0:o._def.typeName)===Pe.ZodBranded&&e.keyType._def.type._def.typeName===Pe.ZodString&&((i=e.keyType._def.type._def.checks)!=null&&i.length)){const{type:u,...d}=iZe(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function Tmn(e,t){if(t.mapStrategy==="record")return uZe(e,t);const n=Ps(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||bu(),r=Ps(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||bu();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Nmn(e){const t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),s=Array.from(new Set(r.map(a=>typeof a)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Amn(){return{not:bu()}}function jmn(){return{type:"null"}}var _Y={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Rmn(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in _Y&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,a)=>{const o=_Y[a._def.typeName];return o&&!s.includes(o)?[...s,o]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,a)=>{const o=typeof a._def.value;switch(o){case"string":case"number":case"boolean":return[...s,o];case"bigint":return[...s,"integer"];case"object":if(a._def.value===null)return[...s,"null"];default:return s}},[]);if(r.length===n.length){const s=r.filter((a,o,i)=>i.indexOf(a)===o);return{type:s.length>1?s:s[0],enum:n.reduce((a,o)=>a.includes(o._def.value)?a:[...a,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(a=>!r.includes(a))],[])};return Imn(e,t)}var Imn=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>Ps(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Pmn(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[_Y[e.innerType._def.typeName],"null"]};const n=Ps(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Mmn(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 $mn(e,t){const n={type:"object",properties:{}},r=[],s=e.shape();for(const o in s){let i=s[o];if(i===void 0||i._def===void 0)continue;const c=Lmn(i),u=Ps(i._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});u!==void 0&&(n.properties[o]=u,c||r.push(o))}r.length&&(n.required=r);const a=Dmn(e,t);return a!==void 0&&(n.additionalProperties=a),n}function Dmn(e,t){if(e.catchall._def.typeName!=="ZodNever")return Ps(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 Lmn(e){try{return e.isOptional()}catch{return!0}}var Fmn=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Ps(e.innerType._def,t);const r=Ps(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:bu()},r]}:bu()},zmn=(e,t)=>{if(t.pipeStrategy==="input")return Ps(e.in._def,t);if(t.pipeStrategy==="output")return Ps(e.out._def,t);const n=Ps(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Ps(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function Bmn(e,t){return Ps(e.type._def,t)}function Umn(e,t){const r={type:"array",uniqueItems:!0,items:Ps(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 Vmn(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Ps(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ps(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Ps(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function qmn(){return{not:bu()}}function Hmn(){return bu()}var Qmn=(e,t)=>Ps(e.innerType._def,t),Gmn=(e,t,n)=>{switch(t){case Pe.ZodString:return cZe(e,n);case Pe.ZodNumber:return Mmn(e);case Pe.ZodObject:return $mn(e,n);case Pe.ZodBigInt:return gmn(e);case Pe.ZodBoolean:return bmn();case Pe.ZodDate:return lZe(e,n);case Pe.ZodUndefined:return qmn();case Pe.ZodNull:return jmn();case Pe.ZodArray:return mmn(e,n);case Pe.ZodUnion:case Pe.ZodDiscriminatedUnion:return Rmn(e,n);case Pe.ZodIntersection:return kmn(e,n);case Pe.ZodTuple:return Vmn(e,n);case Pe.ZodRecord:return uZe(e,n);case Pe.ZodLiteral:return _mn(e);case Pe.ZodEnum:return Smn(e);case Pe.ZodNativeEnum:return Nmn(e);case Pe.ZodNullable:return Pmn(e,n);case Pe.ZodOptional:return Fmn(e,n);case Pe.ZodMap:return Tmn(e,n);case Pe.ZodSet:return Umn(e,n);case Pe.ZodLazy:return()=>e.getter()._def;case Pe.ZodPromise:return Bmn(e,n);case Pe.ZodNaN:case Pe.ZodNever:return Amn();case Pe.ZodEffects:return wmn(e,n);case Pe.ZodAny:return bu();case Pe.ZodUnknown:return Hmn();case Pe.ZodDefault:return xmn(e,n);case Pe.ZodBranded:return iZe(e,n);case Pe.ZodReadonly:return Qmn(e,n);case Pe.ZodCatch:return ymn(e,n);case Pe.ZodPipeline:return zmn(e,n);case Pe.ZodFunction:case Pe.ZodVoid:case Pe.ZodSymbol:return;default:return(r=>{})()}};function Ps(e,t,n=!1){var r;const s=t.seen.get(e);if(t.override){const c=(r=t.override)==null?void 0:r.call(t,e,t,s,n);if(c!==pmn)return c}if(s&&!n){const c=Wmn(s,t);if(c!==void 0)return c}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const o=Gmn(e,e.typeName,t),i=typeof o=="function"?Ps(o(),t):o;if(i&&Zmn(e,t,i),t.postProcess){const c=t.postProcess(i,e,t);return a.jsonSchema=i,c}return a.jsonSchema=i,i}var Wmn=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:fmn(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`),bu()):t.$refStrategy==="seen"?bu():void 0}},Zmn=(e,t,n)=>(e.description&&(n.description=e.description),n),Ymn=e=>{const t=hmn(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,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},Xmn=(e,t)=>{var n;const r=Ymn(t);let s=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[d,f])=>{var p;return{...u,[d]:(p=Ps(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:bu()}},{}):void 0;const a=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=(n=Ps(e._def,a===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))!=null?n:bu(),i=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;i!==void 0&&(o.title=i);const c=a===void 0?s?{...o,[r.definitionPath]:s}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...s,[a]:o}};return c.$schema="http://json-schema.org/draft-07/schema#",c},Kmn=Xmn;function Jmn(e,t){var n;const r=(n=void 0)!=null?n:!1;return qse(()=>Kmn(e,{$refStrategy:r?"root":"none"}),{validate:async s=>{const a=await e.safeParseAsync(s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function egn(e,t){var n;const r=(n=void 0)!=null?n:!1;return qse(()=>SI(pD(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async s=>{const a=await Sne(e,s);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function tgn(e){return"_zod"in e}function wf(e,t){return tgn(e)?egn(e):Jmn(e)}var EY=Symbol.for("vercel.ai.schema");function O4(e){let t;return()=>(t==null&&(t=e()),t)}function qse(e,{validate:t}={}){return{[EY]:!0,_type:void 0,[A2]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function ngn(e){return typeof e=="object"&&e!==null&&EY in e&&e[EY]===!0&&"jsonSchema"in e&&"validate"in e}function rgn(e){return e==null?qse({properties:{},additionalProperties:!1}):ngn(e)?e:typeof e=="function"?e():wf(e)}function sgn(e){return e?.replace(/\/$/,"")}var agn={},dZe=S4({"../../../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,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(p,h)=>{for(var g in h)n(p,g,{get:h[g],enumerable:!0})},i=(p,h,g,b)=>{if(h&&typeof h=="object"||typeof h=="function")for(let y of s(h))!a.call(p,y)&&y!==g&&n(p,y,{get:()=>h[y],enumerable:!(b=r(h,y))||b.enumerable});return p},c=p=>i(n({},"__esModule",{value:!0}),p),u={};o(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?.()??{}}}}),ogn=S4({"../../../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,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(g,b)=>{for(var y in b)n(g,y,{get:b[y],enumerable:!0})},i=(g,b,y,x)=>{if(b&&typeof b=="object"||typeof b=="function")for(let w of s(b))!a.call(g,w)&&w!==y&&n(g,w,{get:()=>b[w],enumerable:!(x=r(b,w))||x.enumerable});return g},c=g=>i(n({},"__esModule",{value:!0}),g),u={};o(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>h}),t.exports=c(u);var d=dZe(),f=$hn();async function p(){let g="",b;try{g=h()}catch(y){b=y}try{const[{getTokenPayload:y,isExpired:x},{refreshToken:w}]=await Promise.all([await He(()=>import("./token-util-RMHT2CPJ-VVUHOXBL-Ca9Odi-N.js"),__vite__mapDeps([23,24,1]),import.meta.url),await He(()=>import("./token-APYSY3BW-RPVF55TR-DPjuHLW9.js"),__vite__mapDeps([25,24,1]),import.meta.url)]);(!g||x(y(g)))&&(await w(),g=h())}catch(y){let x=b instanceof Error?b.message:"";throw y instanceof Error&&(x=`${x}
|
|
331
331
|
${y.message}`),x?new f.VercelOidcTokenError(x):y}return g}function h(){const g=(0,d.getContext)().headers?.["x-vercel-oidc-token"]??agn.VERCEL_OIDC_TOKEN;if(!g)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 g}}}),fZe=S4({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/index.js"(e,t){var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(p,h)=>{for(var g in h)n(p,g,{get:h[g],enumerable:!0})},i=(p,h,g,b)=>{if(h&&typeof h=="object"||typeof h=="function")for(let y of s(h))!a.call(p,y)&&y!==g&&n(p,y,{get:()=>h[y],enumerable:!(b=r(h,y))||b.enumerable});return p},c=p=>i(n({},"__esModule",{value:!0}),p),u={};o(u,{getContext:()=>f.getContext,getVercelOidcToken:()=>d.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync}),t.exports=c(u);var d=ogn(),f=dZe()}}),ign=VWe(fZe()),lgn=VWe(fZe()),cgn="vercel.ai.gateway.error",Rq=Symbol.for(cgn),g_e,b_e,Al=class pZe extends(b_e=Error,g_e=Rq,b_e){constructor({message:t,statusCode:n=500,cause:r}){super(t),this[g_e]=!0,this.statusCode=n,this.cause=r}static isInstance(t){return pZe.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&Rq in t&&t[Rq]===!0}},hZe="GatewayAuthenticationError",ugn=`vercel.ai.gateway.error.${hZe}`,y_e=Symbol.for(ugn),v_e,x_e,mZe=class gZe extends(x_e=Al,v_e=y_e,x_e){constructor({message:t="Authentication failed",statusCode:n=401,cause:r}={}){super({message:t,statusCode:n,cause:r}),this[v_e]=!0,this.name=hZe,this.type="authentication_error"}static isInstance(t){return Al.hasMarker(t)&&y_e in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:r="Authentication failed",statusCode:s=401,cause:a}){let o;return t?o=`AI Gateway authentication failed: Invalid API key.
|
|
332
332
|
|
|
333
333
|
Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
|
|
@@ -422,7 +422,7 @@ ${J.current.stack}
|
|
|
422
422
|
`&&(R=`
|
|
423
423
|
`);var G=0,L=!1;this.parse=function(Z,z,I){if(typeof Z!="string")throw new Error("Input must be a string");var Q=Z.length,W=j.length,J=R.length,ne=P.length,te=N(M),ae=[],ce=[],ve=[],ee=G=0;if(!Z)return Ce();if(D||D!==!1&&Z.indexOf(B)===-1){for(var re=Z.split(R),ie=0;ie<re.length;ie++){if(ve=re[ie],G+=ve.length,ie!==re.length-1)G+=R.length;else if(I)return Ce();if(!P||ve.substring(0,ne)!==P){if(te){if(ae=[],je(ve.split(j)),Ne(),L)return Ce()}else je(ve.split(j));if(U&&U<=ie)return ae=ae.slice(0,U),Ce(!0)}}return Ce()}for(var ge=Z.indexOf(j,G),me=Z.indexOf(R,G),we=new RegExp(y(H)+y(B),"g"),Te=Z.indexOf(B,G);;)if(Z[G]===B)for(Te=G,G++;;){if((Te=Z.indexOf(B,Te+1))===-1)return I||ce.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ae.length,index:G}),se();if(Te===Q-1)return se(Z.substring(G,Te).replace(we,B));if(B===H&&Z[Te+1]===H)Te++;else if(B===H||Te===0||Z[Te-1]!==H){ge!==-1&&ge<Te+1&&(ge=Z.indexOf(j,Te+1));var Se=X((me=me!==-1&&me<Te+1?Z.indexOf(R,Te+1):me)===-1?ge:Math.min(ge,me));if(Z.substr(Te+1+Se,W)===j){ve.push(Z.substring(G,Te).replace(we,B)),Z[G=Te+1+Se+W]!==B&&(Te=Z.indexOf(B,G)),ge=Z.indexOf(j,G),me=Z.indexOf(R,G);break}if(Se=X(me),Z.substring(Te+1+Se,Te+1+Se+J)===R){if(ve.push(Z.substring(G,Te).replace(we,B)),fe(Te+1+Se+J),ge=Z.indexOf(j,G),Te=Z.indexOf(B,G),te&&(Ne(),L))return Ce();if(U&&ae.length>=U)return Ce(!0);break}ce.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ae.length,index:G}),Te++}}else if(P&&ve.length===0&&Z.substring(G,G+ne)===P){if(me===-1)return Ce();G=me+J,me=Z.indexOf(R,G),ge=Z.indexOf(j,G)}else if(ge!==-1&&(ge<me||me===-1))ve.push(Z.substring(G,ge)),G=ge+W,ge=Z.indexOf(j,G);else{if(me===-1)break;if(ve.push(Z.substring(G,me)),fe(me+J),te&&(Ne(),L))return Ce();if(U&&ae.length>=U)return Ce(!0)}return se();function je(ue){ae.push(ue),ee=G}function X(ue){var ye=0;return ye=ue!==-1&&(ue=Z.substring(Te+1,ue))&&ue.trim()===""?ue.length:ye}function se(ue){return I||(ue===void 0&&(ue=Z.substring(G)),ve.push(ue),G=Q,je(ve),te&&Ne()),Ce()}function fe(ue){G=ue,je(ve),ve=[],me=Z.indexOf(R,G)}function Ce(ue){if(T.header&&!z&&ae.length&&!V){var ye=ae[0],Fe=Object.create(null),De=new Set(ye);let Ke=!1;for(let Bt=0;Bt<ye.length;Bt++){let cn=ye[Bt];if(Fe[cn=N(T.transformHeader)?T.transformHeader(cn,Bt):cn]){let Pn,Et=Fe[cn];for(;Pn=cn+"_"+Et,Et++,De.has(Pn););De.add(Pn),ye[Bt]=Pn,Fe[cn]++,Ke=!0,(q=q===null?{}:q)[Pn]=cn}else Fe[cn]=1,ye[Bt]=cn;De.add(cn)}Ke&&console.warn("Duplicate headers found and renamed."),V=!0}return{data:ae,errors:ce,meta:{delimiter:j,linebreak:R,aborted:L,truncated:!!ue,cursor:ee+(z||0),renamedHeaders:q}}}function Ne(){M(Ce()),ae=[],ce=[]}},this.abort=function(){L=!0},this.getCharIndex=function(){return G}}function w(T){var j=T.data,R=i[j.workerId],P=!1;if(j.error)R.userError(j.error,j.file);else if(j.results&&j.results.data){var M={abort:function(){P=!0,O(j.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(N(R.userStep)){for(var U=0;U<j.results.data.length&&(R.userStep({data:j.results.data[U],errors:j.results.errors,meta:j.results.meta},M),!P);U++);delete j.results}else N(R.userChunk)&&(R.userChunk(j.results,M,j.file),delete j.results)}j.finished&&!P&&O(j.workerId,j.results)}function O(T,j){var R=i[T];N(R.userComplete)&&R.userComplete(j),R.terminate(),delete i[T]}function k(){throw new Error("Not implemented.")}function E(T){if(typeof T!="object"||T===null)return T;var j,R=Array.isArray(T)?[]:{};for(j in T)R[j]=E(T[j]);return R}function C(T,j){return function(){T.apply(j,arguments)}}function N(T){return typeof T=="function"}return u.parse=function(T,j){var R=(j=j||{}).dynamicTyping||!1;if(N(R)&&(j.dynamicTypingFunction=R,R={}),j.dynamicTyping=R,j.transform=!!N(j.transform)&&j.transform,!j.worker||!u.WORKERS_SUPPORTED)return R=null,u.NODE_STREAM_INPUT,typeof T=="string"?(T=(P=>P.charCodeAt(0)!==65279?P:P.slice(1))(T),R=new(j.download?f:h)(j)):T.readable===!0&&N(T.read)&&N(T.on)?R=new g(j):(r.File&&T instanceof File||T instanceof Object)&&(R=new p(j)),R.stream(T);(R=(()=>{var P;return!!u.WORKERS_SUPPORTED&&(P=(()=>{var M=r.URL||r.webkitURL||null,U=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; ","(",U,")();"],{type:"text/javascript"})))})(),(P=new r.Worker(P)).onmessage=w,P.id=c++,i[P.id]=P)})()).userStep=j.step,R.userChunk=j.chunk,R.userComplete=j.complete,R.userError=j.error,j.step=N(j.step),j.chunk=N(j.chunk),j.complete=N(j.complete),j.error=N(j.error),delete j.worker,R.postMessage({input:T,config:j,workerId:R.id})},u.unparse=function(T,j){var R=!1,P=!0,M=",",U=`\r
|
|
424
424
|
`,D='"',q=D+D,V=!1,B=null,H=!1,G=((()=>{if(typeof j=="object"){if(typeof j.delimiter!="string"||u.BAD_DELIMITERS.filter(function(z){return j.delimiter.indexOf(z)!==-1}).length||(M=j.delimiter),typeof j.quotes!="boolean"&&typeof j.quotes!="function"&&!Array.isArray(j.quotes)||(R=j.quotes),typeof j.skipEmptyLines!="boolean"&&typeof j.skipEmptyLines!="string"||(V=j.skipEmptyLines),typeof j.newline=="string"&&(U=j.newline),typeof j.quoteChar=="string"&&(D=j.quoteChar),typeof j.header=="boolean"&&(P=j.header),Array.isArray(j.columns)){if(j.columns.length===0)throw new Error("Option columns is empty");B=j.columns}j.escapeChar!==void 0&&(q=j.escapeChar+D),j.escapeFormulae instanceof RegExp?H=j.escapeFormulae:typeof j.escapeFormulae=="boolean"&&j.escapeFormulae&&(H=/^[=+\-@\t\r].*$/)}})(),new RegExp(y(D),"g"));if(typeof T=="string"&&(T=JSON.parse(T)),Array.isArray(T)){if(!T.length||Array.isArray(T[0]))return L(null,T,V);if(typeof T[0]=="object")return L(B||Object.keys(T[0]),T,V)}else if(typeof T=="object")return typeof T.data=="string"&&(T.data=JSON.parse(T.data)),Array.isArray(T.data)&&(T.fields||(T.fields=T.meta&&T.meta.fields||B),T.fields||(T.fields=Array.isArray(T.data[0])?T.fields:typeof T.data[0]=="object"?Object.keys(T.data[0]):[]),Array.isArray(T.data[0])||typeof T.data[0]=="object"||(T.data=[T.data])),L(T.fields||[],T.data||[],V);throw new Error("Unable to serialize unrecognized input");function L(z,I,Q){var W="",J=(typeof z=="string"&&(z=JSON.parse(z)),typeof I=="string"&&(I=JSON.parse(I)),Array.isArray(z)&&0<z.length),ne=!Array.isArray(I[0]);if(J&&P){for(var te=0;te<z.length;te++)0<te&&(W+=M),W+=Z(z[te],te);0<I.length&&(W+=U)}for(var ae=0;ae<I.length;ae++){var ce=(J?z:I[ae]).length,ve=!1,ee=J?Object.keys(I[ae]).length===0:I[ae].length===0;if(Q&&!J&&(ve=Q==="greedy"?I[ae].join("").trim()==="":I[ae].length===1&&I[ae][0].length===0),Q==="greedy"&&J){for(var re=[],ie=0;ie<ce;ie++){var ge=ne?z[ie]:ie;re.push(I[ae][ge])}ve=re.join("").trim()===""}if(!ve){for(var me=0;me<ce;me++){0<me&&!ee&&(W+=M);var we=J&&ne?z[me]:me;W+=Z(I[ae][we],me)}ae<I.length-1&&(!Q||0<ce&&!ee)&&(W+=U)}}return W}function Z(z,I){var Q,W;return z==null?"":z.constructor===Date?JSON.stringify(z).slice(1,25):(W=!1,H&&typeof z=="string"&&H.test(z)&&(z="'"+z,W=!0),Q=z.toString().replace(G,q),(W=W||R===!0||typeof R=="function"&&R(z,I)||Array.isArray(R)&&R[I]||((J,ne)=>{for(var te=0;te<ne.length;te++)if(-1<J.indexOf(ne[te]))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",`
|
|
425
|
-
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!a&&!!r.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=x,u.ParserHandle=b,u.NetworkStreamer=f,u.FileStreamer=p,u.StringStreamer=h,u.ReadableStreamStreamer=g,r.jQuery&&((s=r.jQuery).fn.parse=function(T){var j=T.config||{},R=[];return this.each(function(U){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var D=0;D<this.files.length;D++)R.push({file:this.files[D],inputElem:this,instanceConfig:s.extend({},j)})}),P(),this;function P(){if(R.length===0)N(T.complete)&&T.complete();else{var U,D,q,V,B=R[0];if(N(T.before)){var H=T.before(B.file,B.inputElem);if(typeof H=="object"){if(H.action==="abort")return U="AbortError",D=B.file,q=B.inputElem,V=H.reason,void(N(T.error)&&T.error({name:U},D,q,V));if(H.action==="skip")return void M();typeof H.config=="object"&&(B.instanceConfig=s.extend(B.instanceConfig,H.config))}else if(H==="skip")return void M()}var G=B.instanceConfig.complete;B.instanceConfig.complete=function(L){N(G)&&G(L,B.file,B.inputElem),M()},u.parse(B.file,B.instanceConfig)}}function M(){R.splice(0,1),P()}}),o&&(r.onmessage=function(T){T=T.data,u.WORKER_ID===void 0&&T&&(u.WORKER_ID=T.workerId),typeof T.input=="string"?r.postMessage({workerId:u.WORKER_ID,results:u.parse(T.input,T.config),finished:!0}):(r.File&&T.input instanceof File||T.input instanceof Object)&&(T=u.parse(T.input,T.config))&&r.postMessage({workerId:u.WORKER_ID,results:T,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,(g.prototype=Object.create(d.prototype)).constructor=g,u})})(kI)),kI.exports}var aEn=sEn();const RKe=vu(aEn);var rTe=1,oEn=.9,iEn=.8,lEn=.17,ZH=.1,YH=.999,cEn=.9999,uEn=.99,dEn=/[\\\/_+.#"@\[\(\{&]/,fEn=/[\\\/_+.#"@\[\(\{&]/g,pEn=/[\s-]/,IKe=/[\s-]/g;function qY(e,t,n,r,s,a,o){if(a===t.length)return s===e.length?rTe:uEn;var i=`${s},${a}`;if(o[i]!==void 0)return o[i];for(var c=r.charAt(a),u=n.indexOf(c,s),d=0,f,p,h,g;u>=0;)f=qY(e,t,n,r,u+1,a+1,o),f>d&&(u===s?f*=rTe:dEn.test(e.charAt(u-1))?(f*=iEn,h=e.slice(s,u-1).match(fEn),h&&s>0&&(f*=Math.pow(YH,h.length))):pEn.test(e.charAt(u-1))?(f*=oEn,g=e.slice(s,u-1).match(IKe),g&&s>0&&(f*=Math.pow(YH,g.length))):(f*=lEn,s>0&&(f*=Math.pow(YH,u-s))),e.charAt(u)!==t.charAt(a)&&(f*=cEn)),(f<ZH&&n.charAt(u-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(u-1)!==r.charAt(a))&&(p=qY(e,t,n,r,u+1,a+2,o),p*ZH>f&&(f=p*ZH)),f>d&&(d=f),u=n.indexOf(c,u+1);return o[i]=d,d}function sTe(e){return e.toLowerCase().replace(IKe," ")}function hEn(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,qY(e,t,sTe(e),sTe(t),0,0,{})}var KO='[cmdk-group=""]',XH='[cmdk-group-items=""]',mEn='[cmdk-group-heading=""]',PKe='[cmdk-item=""]',aTe=`${PKe}:not([aria-disabled="true"])`,HY="cmdk-item-select",E0="data-value",gEn=(e,t,n)=>hEn(e,t,n),MKe=S.createContext(void 0),cN=()=>S.useContext(MKe),$Ke=S.createContext(void 0),Jae=()=>S.useContext($Ke),DKe=S.createContext(void 0),LKe=S.forwardRef((e,t)=>{let n=C0(()=>{var z,I;return{search:"",value:(I=(z=e.value)!=null?z:e.defaultValue)!=null?I:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=C0(()=>new Set),s=C0(()=>new Map),a=C0(()=>new Map),o=C0(()=>new Set),i=FKe(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:g,disablePointerSelection:b=!1,vimBindings:y=!0,...x}=e,w=vo(),O=vo(),k=vo(),E=S.useRef(null),C=CEn();Fv(()=>{if(d!==void 0){let z=d.trim();n.current.value=z,N.emit()}},[d]),Fv(()=>{C(6,U)},[]);let N=S.useMemo(()=>({subscribe:z=>(o.current.add(z),()=>o.current.delete(z)),snapshot:()=>n.current,setState:(z,I,Q)=>{var W,J,ne,te;if(!Object.is(n.current[z],I)){if(n.current[z]=I,z==="search")M(),R(),C(1,P);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(k);ae?ae.focus():(W=document.getElementById(w))==null||W.focus()}if(C(7,()=>{var ae;n.current.selectedItemId=(ae=D())==null?void 0:ae.id,N.emit()}),Q||C(5,U),((J=i.current)==null?void 0:J.value)!==void 0){let ae=I??"";(te=(ne=i.current).onValueChange)==null||te.call(ne,ae);return}}N.emit()}},emit:()=>{o.current.forEach(z=>z())}}),[]),T=S.useMemo(()=>({value:(z,I,Q)=>{var W;I!==((W=a.current.get(z))==null?void 0:W.value)&&(a.current.set(z,{value:I,keywords:Q}),n.current.filtered.items.set(z,j(I,Q)),C(2,()=>{R(),N.emit()}))},item:(z,I)=>(r.current.add(z),I&&(s.current.has(I)?s.current.get(I).add(z):s.current.set(I,new Set([z]))),C(3,()=>{M(),R(),n.current.value||P(),N.emit()}),()=>{a.current.delete(z),r.current.delete(z),n.current.filtered.items.delete(z);let Q=D();C(4,()=>{M(),Q?.getAttribute("id")===z&&P(),N.emit()})}),group:z=>(s.current.has(z)||s.current.set(z,new Set),()=>{a.current.delete(z),s.current.delete(z)}),filter:()=>i.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:w,inputId:k,labelId:O,listInnerRef:E}),[]);function j(z,I){var Q,W;let J=(W=(Q=i.current)==null?void 0:Q.filter)!=null?W:gEn;return z?J(z,n.current.search,I):0}function R(){if(!n.current.search||i.current.shouldFilter===!1)return;let z=n.current.filtered.items,I=[];n.current.filtered.groups.forEach(W=>{let J=s.current.get(W),ne=0;J.forEach(te=>{let ae=z.get(te);ne=Math.max(ae,ne)}),I.push([W,ne])});let Q=E.current;q().sort((W,J)=>{var ne,te;let ae=W.getAttribute("id"),ce=J.getAttribute("id");return((ne=z.get(ce))!=null?ne:0)-((te=z.get(ae))!=null?te:0)}).forEach(W=>{let J=W.closest(XH);J?J.appendChild(W.parentElement===J?W:W.closest(`${XH} > *`)):Q.appendChild(W.parentElement===Q?W:W.closest(`${XH} > *`))}),I.sort((W,J)=>J[1]-W[1]).forEach(W=>{var J;let ne=(J=E.current)==null?void 0:J.querySelector(`${KO}[${E0}="${encodeURIComponent(W[0])}"]`);ne?.parentElement.appendChild(ne)})}function P(){let z=q().find(Q=>Q.getAttribute("aria-disabled")!=="true"),I=z?.getAttribute(E0);N.setState("value",I||void 0)}function M(){var z,I,Q,W;if(!n.current.search||i.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let J=0;for(let ne of r.current){let te=(I=(z=a.current.get(ne))==null?void 0:z.value)!=null?I:"",ae=(W=(Q=a.current.get(ne))==null?void 0:Q.keywords)!=null?W:[],ce=j(te,ae);n.current.filtered.items.set(ne,ce),ce>0&&J++}for(let[ne,te]of s.current)for(let ae of te)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(ne);break}n.current.filtered.count=J}function U(){var z,I,Q;let W=D();W&&(((z=W.parentElement)==null?void 0:z.firstChild)===W&&((Q=(I=W.closest(KO))==null?void 0:I.querySelector(mEn))==null||Q.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function D(){var z;return(z=E.current)==null?void 0:z.querySelector(`${PKe}[aria-selected="true"]`)}function q(){var z;return Array.from(((z=E.current)==null?void 0:z.querySelectorAll(aTe))||[])}function V(z){let I=q()[z];I&&N.setState("value",I.getAttribute(E0))}function B(z){var I;let Q=D(),W=q(),J=W.findIndex(te=>te===Q),ne=W[J+z];(I=i.current)!=null&&I.loop&&(ne=J+z<0?W[W.length-1]:J+z===W.length?W[0]:W[J+z]),ne&&N.setState("value",ne.getAttribute(E0))}function H(z){let I=D(),Q=I?.closest(KO),W;for(;Q&&!W;)Q=z>0?_En(Q,KO):EEn(Q,KO),W=Q?.querySelector(aTe);W?N.setState("value",W.getAttribute(E0)):B(z)}let G=()=>V(q().length-1),L=z=>{z.preventDefault(),z.metaKey?G():z.altKey?H(1):B(1)},Z=z=>{z.preventDefault(),z.metaKey?V(0):z.altKey?H(-1):B(-1)};return S.createElement($o.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:z=>{var I;(I=x.onKeyDown)==null||I.call(x,z);let Q=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||Q))switch(z.key){case"n":case"j":{y&&z.ctrlKey&&L(z);break}case"ArrowDown":{L(z);break}case"p":case"k":{y&&z.ctrlKey&&Z(z);break}case"ArrowUp":{Z(z);break}case"Home":{z.preventDefault(),V(0);break}case"End":{z.preventDefault(),G();break}case"Enter":{z.preventDefault();let W=D();if(W){let J=new Event(HY);W.dispatchEvent(J)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:NEn},c),U4(e,z=>S.createElement($Ke.Provider,{value:N},S.createElement(MKe.Provider,{value:T},z))))}),bEn=S.forwardRef((e,t)=>{var n,r;let s=vo(),a=S.useRef(null),o=S.useContext(DKe),i=cN(),c=FKe(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Fv(()=>{if(!u)return i.item(s,o?.id)},[u]);let d=zKe(s,a,[e.value,e.children,a],e.keywords),f=Jae(),p=ub(C=>C.value&&C.value===d.current),h=ub(C=>u||i.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);S.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(HY,g),()=>C.removeEventListener(HY,g)},[h,e.onSelect,e.disabled]);function g(){var C,N;b(),(N=(C=c.current).onSelect)==null||N.call(C,d.current)}function b(){f.setState("value",d.current,!0)}if(!h)return null;let{disabled:y,value:x,onSelect:w,forceMount:O,keywords:k,...E}=e;return S.createElement($o.div,{ref:Ep(a,t),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!p,"data-disabled":!!y,"data-selected":!!p,onPointerMove:y||i.getDisablePointerSelection()?void 0:b,onClick:y?void 0:g},e.children)}),yEn=S.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...a}=e,o=vo(),i=S.useRef(null),c=S.useRef(null),u=vo(),d=cN(),f=ub(h=>s||d.filter()===!1?!0:h.search?h.filtered.groups.has(o):!0);Fv(()=>d.group(o),[]),zKe(o,i,[e.value,e.heading,c]);let p=S.useMemo(()=>({id:o,forceMount:s}),[s]);return S.createElement($o.div,{ref:Ep(i,t),...a,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&S.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),U4(e,h=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},S.createElement(DKe.Provider,{value:p},h))))}),vEn=S.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=S.useRef(null),a=ub(o=>!o.search);return!n&&!a?null:S.createElement($o.div,{ref:Ep(s,t),...r,"cmdk-separator":"",role:"separator"})}),xEn=S.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,a=Jae(),o=ub(u=>u.search),i=ub(u=>u.selectedItemId),c=cN();return S.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),S.createElement($o.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":i,id:c.inputId,type:"text",value:s?e.value:o,onChange:u=>{s||a.setState("search",u.target.value),n?.(u.target.value)}})}),wEn=S.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,a=S.useRef(null),o=S.useRef(null),i=ub(u=>u.selectedItemId),c=cN();return S.useEffect(()=>{if(o.current&&a.current){let u=o.current,d=a.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)}}},[]),S.createElement($o.div,{ref:Ep(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":r,id:c.listId},U4(e,u=>S.createElement("div",{ref:Ep(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),SEn=S.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:a,container:o,...i}=e;return S.createElement(RM,{open:n,onOpenChange:r},S.createElement(IM,{container:o},S.createElement(FC,{"cmdk-overlay":"",className:s}),S.createElement(zC,{"aria-label":e.label,"cmdk-dialog":"",className:a},S.createElement(LKe,{ref:t,...i}))))}),OEn=S.forwardRef((e,t)=>ub(n=>n.filtered.count===0)?S.createElement($o.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),kEn=S.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...a}=e;return S.createElement($o.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},U4(e,o=>S.createElement("div",{"aria-hidden":!0},o)))}),Ec=Object.assign(LKe,{List:wEn,Item:bEn,Input:xEn,Group:yEn,Separator:vEn,Dialog:SEn,Empty:OEn,Loading:kEn});function _En(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function EEn(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function FKe(e){let t=S.useRef(e);return Fv(()=>{t.current=e}),t}var Fv=typeof window>"u"?S.useEffect:S.useLayoutEffect;function C0(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function ub(e){let t=Jae(),n=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,n,n)}function zKe(e,t,n,r=[]){let s=S.useRef(),a=cN();return Fv(()=>{var o;let i=(()=>{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():s.current}})(),c=r.map(u=>u.trim());a.value(e,i,c),(o=t.current)==null||o.setAttribute(E0,i),s.current=i}),s}var CEn=()=>{let[e,t]=S.useState(),n=C0(()=>new Map);return Fv(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function TEn(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function U4({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(TEn(t),{ref:t.ref},n(t.props.children)):n(t)}var NEn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};class No{constructor(t,n,r,s){this.fromA=t,this.toA=n,this.fromB=r,this.toB=s}offset(t,n=t){return new No(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}}function zv(e,t,n,r,s,a){if(e==r)return[];let o=toe(e,t,n,r,s,a),i=noe(e,t+o,n,r,s+o,a);t+=o,n-=i,s+=o,a-=i;let c=n-t,u=a-s;if(!c||!u)return[new No(t,n,s,a)];if(c>u){let f=e.slice(t,n).indexOf(r.slice(s,a));if(f>-1)return[new No(t,t+f,s,s),new No(t+f+u,n,a,a)]}else if(u>c){let f=r.slice(s,a).indexOf(e.slice(t,n));if(f>-1)return[new No(t,t,s,s+f),new No(n,n,s+f+c,a)]}if(c==1||u==1)return[new No(t,n,s,a)];let d=VKe(e,t,n,r,s,a);if(d){let[f,p,h]=d;return zv(e,t,f,r,s,p).concat(zv(e,f+h,n,r,p+h,a))}return AEn(e,t,n,r,s,a)}let jk=1e9,Rk=0,eoe=!1;function AEn(e,t,n,r,s,a){let o=n-t,i=a-s;if(jk<1e9&&Math.min(o,i)>jk*16||Rk>0&&Date.now()>Rk)return Math.min(o,i)>jk*64?[new No(t,n,s,a)]:oTe(e,t,n,r,s,a);let c=Math.ceil((o+i)/2);KH.reset(c),JH.reset(c);let u=(h,g)=>e.charCodeAt(t+h)==r.charCodeAt(s+g),d=(h,g)=>e.charCodeAt(n-h-1)==r.charCodeAt(a-g-1),f=(o-i)%2!=0?JH:null,p=f?null:KH;for(let h=0;h<c;h++){if(h>jk||Rk>0&&!(h&63)&&Date.now()>Rk)return oTe(e,t,n,r,s,a);let g=KH.advance(h,o,i,c,f,!1,u)||JH.advance(h,o,i,c,p,!0,d);if(g)return jEn(e,t,n,t+g[0],r,s,a,s+g[1])}return[new No(t,n,s,a)]}class BKe{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,s,a,o,i){for(let c=-t+this.start;c<=t-this.end;c+=2){let u=s+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&&i(d,f);)d++,f++;if(this.vec[u]=d,d>n)this.end+=2;else if(f>r)this.start+=2;else if(a){let p=s+(n-r)-c;if(p>=0&&p<this.len&&a.vec[p]!=-1)if(o){let h=a.vec[p];if(h>=n-d)return[h,s+h-p]}else{let h=n-a.vec[p];if(d>=h)return[d,f]}}}return null}}const KH=new BKe,JH=new BKe;function jEn(e,t,n,r,s,a,o,i){let c=!1;return!ES(e,r)&&++r==n&&(c=!0),!ES(s,i)&&++i==o&&(c=!0),c?[new No(t,n,a,o)]:zv(e,t,r,s,a,i).concat(zv(e,r,n,s,i,o))}function UKe(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n=n<<1;return n}function toe(e,t,n,r,s,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(s))return 0;let o=UKe(n-t,a-s);for(let i=t,c=s;;){let u=i+o,d=c+o;if(u>n||d>a||e.slice(i,u)!=r.slice(c,d)){if(o==1)return i-t-(ES(e,i)?0:1);o=o>>1}else{if(u==n||d==a)return u-t;i=u,c=d}}}function noe(e,t,n,r,s,a){if(t==n||s==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=UKe(n-t,a-s);for(let i=n,c=a;;){let u=i-o,d=c-o;if(u<t||d<s||e.slice(u,i)!=r.slice(d,c)){if(o==1)return n-i-(ES(e,i)?0:1);o=o>>1}else{if(u==t||d==s)return n-u;i=u,c=d}}}function QY(e,t,n,r,s,a,o,i){let c=r.slice(s,a),u=null;for(;;){if(u||o<i)return u;for(let d=t+o;;){ES(e,d)||d++;let f=d+o;if(ES(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 g=toe(e,f,n,r,s+h+p.length,a),b=noe(e,t,d,r,s,s+h),y=p.length+g+b;(!u||u[2]<y)&&(u=[d-b,s+h-b,y])}d=f}if(i<0)return u;o=o>>1}}function VKe(e,t,n,r,s,a){let o=n-t,i=a-s;if(o<i){let c=VKe(r,s,a,e,t,n);return c&&[c[1],c[0],c[2]]}return o<4||i*2<o?null:QY(e,t,n,r,s,a,Math.floor(o/4),-1)}function oTe(e,t,n,r,s,a){eoe=!0;let o=n-t,i=a-s,c;if(o<i){let p=QY(r,s,a,e,t,n,Math.floor(o/6),50);c=p&&[p[1],p[0],p[2]]}else c=QY(e,t,n,r,s,a,Math.floor(i/6),50);if(!c)return[new No(t,n,s,a)];let[u,d,f]=c;return zv(e,t,u,r,s,d).concat(zv(e,u+f,n,r,d+f,a))}function qKe(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],s=e[n];r.toA>s.fromA-t&&r.toB>s.fromB-t&&(e[n-1]=new No(r.fromA,s.toA,r.fromB,s.toB),e.splice(n--,1))}}function REn(e,t,n){for(;;){qKe(n,1);let r=!1;for(let s=0;s<n.length;s++){let a=n[s],o,i;(o=toe(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[s]=new No(a.fromA+o,a.toA,a.fromB+o,a.toB)),(i=noe(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[s]=new No(a.fromA,a.toA-i,a.fromB,a.toB-i));let c=a.toA-a.fromA,u=a.toB-a.fromB;if(c&&u)continue;let d=a.fromA-(s?n[s-1].toA:0),f=(s<n.length-1?n[s+1].fromA:e.length)-a.toA;if(!d||!f)continue;let p=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);d<=p.length&&e.slice(a.fromA-d,a.fromA)==p.slice(p.length-d)?(n[s]=new No(a.fromA-d,a.toA-d,a.fromB-d,a.toB-d),r=!0):f<=p.length&&e.slice(a.toA,a.toA+f)==p.slice(0,f)&&(n[s]=new No(a.fromA+f,a.toA+f,a.fromB+f,a.toB+f),r=!0)}if(!r)break}return n}function IEn(e,t,n){for(let r=0,s=0;s<e.length;s++){let a=e[s],o=a.toA-a.fromA,i=a.toB-a.fromB;if(o&&i||o>3||i>3){let c=s==e.length-1?t.length:e[s+1].fromA,u=a.fromA-r,d=c-a.toA,f=lTe(t,a.fromA,u),p=iTe(t,a.toA,d),h=a.fromA-f,g=p-a.toA;if((!o||!i)&&h&&g){let b=Math.max(o,i),[y,x,w]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];b>h&&t.slice(f,a.fromA)==y.slice(w-h,w)?(a=e[s]=new No(f,f+o,a.fromB-h,a.toB-h),f=a.fromA,p=iTe(t,a.toA,c-a.toA)):b>g&&t.slice(a.toA,p)==y.slice(x,x+g)&&(a=e[s]=new No(p-o,p,a.fromB+g,a.toB+g),p=a.toA,f=lTe(t,a.fromA,a.fromA-r)),h=a.fromA-f,g=p-a.toA}if(h||g)a=e[s]=new No(a.fromA-h,a.toA+g,a.fromB-h,a.toB+g);else if(o){if(!i){let b=uTe(t,a.fromA,a.toA),y,x=b<0?-1:cTe(t,a.toA,a.fromA);b>-1&&(y=b-a.fromA)<=d&&t.slice(a.fromA,b)==t.slice(a.toA,a.toA+y)?a=e[s]=a.offset(y):x>-1&&(y=a.toA-x)<=u&&t.slice(a.fromA-y,a.fromA)==t.slice(x,a.toA)&&(a=e[s]=a.offset(-y))}}else{let b=uTe(n,a.fromB,a.toB),y,x=b<0?-1:cTe(n,a.toB,a.fromB);b>-1&&(y=b-a.fromB)<=d&&n.slice(a.fromB,b)==n.slice(a.toB,a.toB+y)?a=e[s]=a.offset(y):x>-1&&(y=a.toB-x)<=u&&n.slice(a.fromB-y,a.fromB)==n.slice(x,a.toB)&&(a=e[s]=a.offset(-y))}}r=a.toA}return qKe(e,3),e}let Wy;try{Wy=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function HKe(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function QKe(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?HKe(n)?1:0:Wy?!ZKe(n)||t==e.length-1?Wy.test(String.fromCharCode(n))?1:0:Wy.test(e.slice(t,t+2))?2:0:0}function GKe(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?HKe(n)?1:0:Wy?!YKe(n)||t==1?Wy.test(String.fromCharCode(n))?1:0:Wy.test(e.slice(t-2,t))?2:0:0}const WKe=8;function iTe(e,t,n){if(t==e.length||!GKe(e,t))return t;for(let r=t,s=t+n,a=0;a<WKe;a++){let o=QKe(e,r);if(!o||r+o>s)return r;r+=o}return t}function lTe(e,t,n){if(!t||!QKe(e,t))return t;for(let r=t,s=t-n,a=0;a<WKe;a++){let o=GKe(e,r);if(!o||r-o<s)return r;r-=o}return t}function cTe(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function uTe(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}const ZKe=e=>e>=55296&&e<=56319,YKe=e=>e>=56320&&e<=57343;function ES(e,t){return!t||t==e.length||!ZKe(e.charCodeAt(t-1))||!YKe(e.charCodeAt(t))}function PEn(e,t,n){var r;let s=n?.override;return s?s(e,t):(jk=((r=n?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,Rk=n?.timeout?Date.now()+n.timeout:0,eoe=!1,REn(e,t,zv(e,0,e.length,t,0,t.length)))}function XKe(){return!eoe}function KKe(e,t,n){return IEn(PEn(e,t,n),e,t)}const sp=Vt.define({combine:e=>e[0]}),GY=Hn.define(),MEn=Vt.define(),CS=xo.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(GY)&&(e=n.value);for(let n of t.state.facet(MEn))e=n(e,t);return e}});class Sw{constructor(t,n,r,s,a,o=!0){this.changes=t,this.fromA=n,this.toA=r,this.fromB=s,this.toB=a,this.precise=o}offset(t,n){return t||n?new Sw(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 s=KKe(t.toString(),n.toString(),r);return JKe(s,t,n,0,0,XKe())}static updateA(t,n,r,s,a){return mTe(hTe(t,s,!0,r.length),t,n,r,a)}static updateB(t,n,r,s,a){return mTe(hTe(t,s,!1,n.length),t,n,r,a)}}function dTe(e,t,n,r){let s=n.lineAt(e),a=r.lineAt(t);return s.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[s.from,a.from]}function fTe(e,t,n,r){let s=n.lineAt(e),a=r.lineAt(t);return s.from==e&&a.from==t?[e,t]:[s.to+1,a.to+1]}function JKe(e,t,n,r,s,a){let o=[];for(let i=0;i<e.length;i++){let c=e[i],[u,d]=dTe(c.fromA+r,c.fromB+s,t,n),[f,p]=fTe(c.toA+r,c.toB+s,t,n),h=[c.offset(-u+r,-d+s)];for(;i<e.length-1;){let g=e[i+1],[b,y]=dTe(g.fromA+r,g.fromB+s,t,n);if(b>f+1&&y>p+1)break;h.push(g.offset(-u+r,-d+s)),[f,p]=fTe(g.toA+r,g.toB+s,t,n),i++}o.push(new Sw(h,u,Math.max(u,f),d,Math.max(d,p),a))}return o}const pR=1e3;function pTe(e,t,n,r){let s=0,a=e.length;for(;;){if(s==a){let d=0,f=0;s&&({toA:d,toB:f}=e[s-1]);let p=t-(n?d:f);return[d+p,f+p]}let o=s+a>>1,i=e[o],[c,u]=n?[i.fromA,i.toA]:[i.fromB,i.toB];if(c>t)a=o;else if(u<=t)s=o+1;else return r?[i.fromA,i.fromB]:[i.toA,i.toB]}}function hTe(e,t,n,r){let s=[];return t.iterChangedRanges((a,o,i,c)=>{let u=0,d=n?t.length:r,f=0,p=n?r:t.length;a>pR&&([u,f]=pTe(e,a-pR,n,!0)),o<t.length-pR&&([d,p]=pTe(e,o+pR,n,!1));let h=c-i-(o-a),g,[b,y]=n?[h,0]:[0,h];s.length&&(g=s[s.length-1]).toA>=u?s[s.length-1]={fromA:g.fromA,fromB:g.fromB,toA:d,toB:p,diffA:g.diffA+b,diffB:g.diffB+y}:s.push({fromA:u,toA:d,fromB:f,toB:p,diffA:b,diffB:y})}),s}function mTe(e,t,n,r,s){if(!e.length)return t;let a=[];for(let o=0,i=0,c=0,u=0;;o++){let d=o==e.length?null:e[o],f=d?d.fromA+i:n.length,p=d?d.fromB+c:r.length;for(;u<t.length;){let y=t[u];if(d&&(y.toA+i>f||y.toB+c>p))break;a.push(y.offset(i,c)),u++}if(!d)break;let h=d.toA+i+d.diffA,g=d.toB+c+d.diffB,b=KKe(n.sliceString(f,h),r.sliceString(p,g),s);for(let y of JKe(b,n,r,f,p,XKe()))a.push(y);for(i+=d.diffA,c+=d.diffB;u<t.length;){let y=t[u];if(y.fromA+i>h&&y.fromB+c>g)break;u++}}return a}const $En={scanLimit:500},eJe=Ua.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=yTe(e))}update(e){(e.docChanged||e.viewportChanged||DEn(e.startState,e.state)||LEn(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=yTe(e.view))}},{decorations:e=>e.deco}),hR=gf.low(S5e({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(eJe))===null||t===void 0?void 0:t.gutter)||_r.empty}}));function DEn(e,t){return e.field(CS,!1)!=t.field(CS,!1)}function LEn(e,t){return e.facet(sp)!=t.facet(sp)}const gTe=Wt.line({class:"cm-changedLine"}),FEn=Wt.mark({class:"cm-changedText"}),zEn=Wt.mark({tagName:"ins",class:"cm-insertedLine"}),BEn=Wt.mark({tagName:"del",class:"cm-deletedLine"}),bTe=new class extends Tp{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function UEn(e,t,n,r,s,a){let o=n?e.fromA:e.fromB,i=n?e.toA:e.toB,c=0;if(o!=i){s.add(o,o,gTe),s.add(o,i,n?BEn:zEn),a&&a.add(o,o,bTe);for(let u=t.iterRange(o,i-1),d=o;!u.next().done;){if(u.lineBreak){d++,s.add(d,d,gTe),a&&a.add(d,d,bTe);continue}let f=d+u.value.length;if(r)for(;c<e.changes.length;){let p=e.changes[c],h=o+(n?p.fromA:p.fromB),g=o+(n?p.toA:p.toB),b=Math.max(d,h),y=Math.min(f,g);if(b<y&&s.add(b,y,FEn),g<f)c++;else break}d=f}}}function yTe(e){let t=e.state.field(CS),{side:n,highlightChanges:r,markGutter:s,overrideChunk:a}=e.state.facet(sp),o=n=="a",i=new pc,c=s?new pc:null,{from:u,to:d}=e.viewport;for(let f of t){if((o?f.fromA:f.fromB)>=d)break;(o?f.toA:f.toB)>u&&(!a||!a(e.state,f,i,c))&&UEn(f,e.state.doc,o,r,i,c)}return{deco:i.finish(),gutter:c&&c.finish()}}class mR extends wu{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 Q2=Hn.define({map:(e,t)=>e.map(t)}),Ik=xo.define({create:()=>Wt.none,update:(e,t)=>{for(let n of t.effects)if(n.is(Q2))return n.value;return e.map(t.changes)},provide:e=>ct.decorations.from(e)}),gR=.01;function vTe(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 VEn(e,t,n){let r=new pc,s=new pc,a=e.state.field(Ik).iter(),o=t.state.field(Ik).iter(),i=0,c=0,u=0,d=0,f=e.viewport,p=t.viewport;for(let y=0;;y++){let x=y<n.length?n[y]:null,w=x?x.fromA:e.state.doc.length,O=x?x.fromB:t.state.doc.length;if(i<w){let k=e.lineBlockAt(i).top+u,E=t.lineBlockAt(c).top+d,C=k-E;C<-gR?(u-=C,r.add(i,i,Wt.widget({widget:new mR(-C),block:!0,side:-1}))):C>gR&&(d+=C,s.add(c,c,Wt.widget({widget:new mR(C),block:!0,side:-1})))}if(w>i+1e3&&i<f.from&&w>f.from&&c<p.from&&O>p.from){let k=Math.min(f.from-i,p.from-c);i+=k,c+=k,y--}else if(x)i=x.toA,c=x.toB;else break;for(;a.value&&a.from<i;)u-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)d-=o.value.spec.widget.height,o.next()}for(;a.value;)u-=a.value.spec.widget.height,a.next();for(;o.value;)d-=o.value.spec.widget.height,o.next();let h=e.contentHeight+u-(t.contentHeight+d);h<gR?r.add(e.state.doc.length,e.state.doc.length,Wt.widget({widget:new mR(-h),block:!0,side:1})):h>gR&&s.add(t.state.doc.length,t.state.doc.length,Wt.widget({widget:new mR(h),block:!0,side:1}));let g=r.finish(),b=s.finish();vTe(g,e.state.field(Ik))||e.dispatch({effects:Q2.of(g)}),vTe(b,t.state.field(Ik))||t.dispatch({effects:Q2.of(b)})}const WY=Hn.define({map:(e,t)=>t.mapPos(e)});class qEn extends wu{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 s=t.posAtDOM(r.target);t.dispatch({effects:WY.of(s)});let{side:a,sibling:o}=t.state.facet(sp);o&&o().dispatch({effects:WY.of(HEn(s,t.state.field(CS),a=="a"))})}),n}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function HEn(e,t,n){let r=0,s=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return s+(e-r);[r,s]=n?[o.toA,o.toB]:[o.toB,o.toA]}}const QEn=xo.define({create(e){return Wt.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(WY)&&(e=e.update({filter:r=>r!=n.value}));return e},provide:e=>ct.decorations.from(e)});function xTe({margin:e=3,minSize:t=4}){return QEn.init(n=>GEn(n,e,t))}function GEn(e,t,n){let r=new pc,s=e.facet(sp).side=="a",a=e.field(CS),o=1;for(let i=0;;i++){let c=i<a.length?a[i]:null,u=i?o+t:1,d=c?e.doc.lineAt(s?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,Wt.replace({widget:new qEn(f),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,s?c.toA:c.toB)).number}return r.finish()}const WEn=ct.styleModule.of(new rm({".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"}})),ZEn=ct.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"}}),wTe=new t1,bR=new t1;class YEn{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||$En;let n=[gf.low(eJe),ZEn,WEn,Ik,ct.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(p=>p.effects.some(h=>h.is(Q2)))&&this.measure()})],r=[sp.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&r.push(hR);let s=wr.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],ct.editorAttributes.of({class:"cm-merge-a"}),bR.of(r),n]}),a=[sp.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&a.push(hR);let o=wr.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],ct.editorAttributes.of({class:"cm-merge-b"}),bR.of(a),n]});this.chunks=Sw.build(s.doc,o.doc,this.diffConf);let i=[CS.init(()=>this.chunks),wTe.of(t.collapseUnchanged?xTe(t.collapseUnchanged):[])];s=s.update({effects:Hn.appendConfig.of(i)}).state,o=o.update({effects:Hn.appendConfig.of(i)}).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 ct({state:s,parent:u,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new ct({state:o,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],s=t.reduce((o,i)=>o.compose(i.changes),Co.empty(t[0].startState.doc.length));this.chunks=n==this.a?Sw.updateA(this.chunks,r.newDoc,this.b.state.doc,s,this.diffConf):Sw.updateB(this.chunks,this.a.state.doc,r.newDoc,s,this.diffConf),n.update([...t,r.state.update({effects:GY.of(this.chunks)})]);let a=n==this.a?this.b:this.a;a.update([a.state.update({effects:GY.of(this.chunks)})]),this.scheduleMeasure()}else n.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let a=t.orientation!="b-a";if(a!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let o=this.a.dom.parentNode,i=this.b.dom.parentNode;o.remove(),i.remove(),this.editorDOM.insertBefore(a?o:i,this.editorDOM.firstChild),this.editorDOM.appendChild(a?i:o),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let a=!!this.revertDOM,o=this.revertToA,i=this.renderRevert;"revertControls"in t&&(a=!!t.revertControls,o=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(i=t.renderRevertControl),this.setupRevertControls(a,o,i)}let n="highlightChanges"in t,r="gutter"in t,s="collapseUnchanged"in t;if(n||r||s){let a=[],o=[];if(n||r){let i=this.a.state.facet(sp),c=r?t.gutter!==!1:i.markGutter,u=n?t.highlightChanges!==!1:i.highlightChanges;a.push(bR.reconfigure([sp.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:c}),c?hR:[]])),o.push(bR.reconfigure([sp.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:c}),c?hR:[]]))}if(s){let i=wTe.reconfigure(t.collapseUnchanged?xTe(t.collapseUnchanged):[]);a.push(i),o.push(i)}this.a.dispatch({effects:a}),this.b.dispatch({effects:o})}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",s=>this.revertClicked(s)),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(){VEn(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,n=t.firstChild,r=this.a.viewport,s=this.b.viewport;for(let a=0;a<this.chunks.length;a++){let o=this.chunks[a];if(o.fromA>r.to||o.fromB>s.to)break;if(o.fromA<r.from||o.fromB<s.from)continue;let i=this.a.lineBlockAt(o.fromA).top+"px";for(;n&&+n.dataset.chunk<a;)n=STe(n);n&&n.dataset.chunk==String(a)?(n.style.top!=i&&(n.style.top=i),n=n.nextSibling):t.insertBefore(this.renderRevertButton(i,a),n)}for(;n;)n=STe(n)}renderRevertButton(t,n){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let s=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",s),r.setAttribute("title",s),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[s,a,o,i,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=s.state.sliceDoc(o,Math.max(o,i-1));o!=i&&u<=a.state.doc.length&&(d+=s.state.lineBreak),a.dispatch({changes:{from:c,to:Math.min(a.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 STe(e){let t=e.nextSibling;return e.remove(),t}function tJe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=tJe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nJe(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=tJe(e))&&(r&&(r+=" "),r+=t);return r}const XEn=(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},KEn=(e,t)=>({classGroupId:e,validator:t}),rJe=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),G2="-",OTe=[],JEn="arbitrary..",eCn=e=>{const t=nCn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return tCn(o);const i=o.split(G2),c=i[0]===""&&i.length>1?1:0;return sJe(i,c,t)},getConflictingClassGroupIds:(o,i)=>{if(i){const c=r[o],u=n[o];return c?u?XEn(u,c):c:u||OTe}return n[o]||OTe}}},sJe=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=sJe(e,t+1,a);if(u)return u}const o=n.validators;if(o===null)return;const i=t===0?e.join(G2):e.slice(t).join(G2),c=o.length;for(let u=0;u<c;u++){const d=o[u];if(d.validator(i))return d.classGroupId}},tCn=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?JEn+r:void 0})(),nCn=e=>{const{theme:t,classGroups:n}=e;return rCn(n,t)},rCn=(e,t)=>{const n=rJe();for(const r in e){const s=e[r];roe(s,n,r,t)}return n},roe=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const o=e[a];sCn(o,t,n,r)}},sCn=(e,t,n,r)=>{if(typeof e=="string"){aCn(e,t,n);return}if(typeof e=="function"){oCn(e,t,n,r);return}iCn(e,t,n,r)},aCn=(e,t,n)=>{const r=e===""?t:aJe(t,e);r.classGroupId=n},oCn=(e,t,n,r)=>{if(lCn(e)){roe(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(KEn(n,e))},iCn=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let o=0;o<a;o++){const[i,c]=s[o];roe(c,aJe(t,i),n,r)}},aJe=(e,t)=>{let n=e;const r=t.split(G2),s=r.length;for(let a=0;a<s;a++){const o=r[a];let i=n.nextPart.get(o);i||(i=rJe(),n.nextPart.set(o,i)),n=i}return n},lCn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,cCn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return s(a,o),o},set(a,o){a in n?n[a]=o:s(a,o)}}},ZY="!",kTe=":",uCn=[],_Te=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),dCn=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let o=0,i=0,c=0,u;const d=s.length;for(let b=0;b<d;b++){const y=s[b];if(o===0&&i===0){if(y===kTe){a.push(s.slice(c,b)),c=b+1;continue}if(y==="/"){u=b;continue}}y==="["?o++:y==="]"?o--:y==="("?i++:y===")"&&i--}const f=a.length===0?s:s.slice(c);let p=f,h=!1;f.endsWith(ZY)?(p=f.slice(0,-1),h=!0):f.startsWith(ZY)&&(p=f.slice(1),h=!0);const g=u&&u>c?u-c:void 0;return _Te(a,h,p,g)};if(t){const s=t+kTe,a=r;r=o=>o.startsWith(s)?a(o.slice(s.length)):_Te(uCn,!1,o,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},fCn=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const o=n[a],i=o[0]==="[",c=t.has(o);i||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},pCn=e=>({cache:cCn(e.cacheSize),parseClassName:dCn(e),sortModifiers:fCn(e),...eCn(e)}),hCn=/\s+/,mCn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,o=[],i=e.trim().split(hCn);let c="";for(let u=i.length-1;u>=0;u-=1){const d=i[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:b}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let y=!!b,x=r(y?g.substring(0,b):g);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=r(g),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=p.length===0?"":p.length===1?p[0]:a(p).join(":"),O=h?w+ZY:w,k=O+x;if(o.indexOf(k)>-1)continue;o.push(k);const E=s(x,y);for(let C=0;C<E.length;++C){const N=E[C];o.push(O+N)}c=d+(c.length>0?" "+c:c)}return c},gCn=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=oJe(n))&&(s&&(s+=" "),s+=r);return s},oJe=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=oJe(e[r]))&&(n&&(n+=" "),n+=t);return n},ETe=(e,...t)=>{let n,r,s,a;const o=c=>{const u=t.reduce((d,f)=>f(d),e());return n=pCn(u),r=n.cache.get,s=n.cache.set,a=i,i(c)},i=c=>{const u=r(c);if(u)return u;const d=mCn(c,n);return s(c,d),d};return a=o,(...c)=>a(gCn(...c))},bCn=[],Bo=e=>{const t=n=>n[e]||bCn;return t.isThemeGetter=!0,t},iJe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lJe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yCn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,vCn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xCn=/\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$/,wCn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SCn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OCn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rg=e=>yCn.test(e),xr=e=>!!e&&!Number.isNaN(Number(e)),sg=e=>!!e&&Number.isInteger(Number(e)),eQ=e=>e.endsWith("%")&&xr(e.slice(0,-1)),Oh=e=>vCn.test(e),cJe=()=>!0,kCn=e=>xCn.test(e)&&!wCn.test(e),soe=()=>!1,_Cn=e=>SCn.test(e),ECn=e=>OCn.test(e),CCn=e=>!sn(e)&&!fn(e),TCn=e=>jb(e,fJe,soe),sn=e=>iJe.test(e),py=e=>jb(e,pJe,kCn),CTe=e=>jb(e,$Cn,xr),NCn=e=>jb(e,mJe,cJe),ACn=e=>jb(e,hJe,soe),TTe=e=>jb(e,uJe,soe),jCn=e=>jb(e,dJe,ECn),yR=e=>jb(e,gJe,_Cn),fn=e=>lJe.test(e),JO=e=>hx(e,pJe),RCn=e=>hx(e,hJe),NTe=e=>hx(e,uJe),ICn=e=>hx(e,fJe),PCn=e=>hx(e,dJe),vR=e=>hx(e,gJe,!0),MCn=e=>hx(e,mJe,!0),jb=(e,t,n)=>{const r=iJe.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},hx=(e,t,n=!1)=>{const r=lJe.exec(e);return r?r[1]?t(r[1]):n:!1},uJe=e=>e==="position"||e==="percentage",dJe=e=>e==="image"||e==="url",fJe=e=>e==="length"||e==="size"||e==="bg-size",pJe=e=>e==="length",$Cn=e=>e==="number",hJe=e=>e==="family-name",mJe=e=>e==="number"||e==="weight",gJe=e=>e==="shadow",ATe=()=>{const e=Bo("color"),t=Bo("font"),n=Bo("text"),r=Bo("font-weight"),s=Bo("tracking"),a=Bo("leading"),o=Bo("breakpoint"),i=Bo("container"),c=Bo("spacing"),u=Bo("radius"),d=Bo("shadow"),f=Bo("inset-shadow"),p=Bo("text-shadow"),h=Bo("drop-shadow"),g=Bo("blur"),b=Bo("perspective"),y=Bo("aspect"),x=Bo("ease"),w=Bo("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(),fn,sn],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[fn,sn,c],j=()=>[rg,"full","auto",...T()],R=()=>[sg,"none","subgrid",fn,sn],P=()=>["auto",{span:["full",sg,fn,sn]},sg,fn,sn],M=()=>[sg,"auto",fn,sn],U=()=>["auto","min","max","fr",fn,sn],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...T()],B=()=>[rg,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],H=()=>[rg,"screen","full","dvw","lvw","svw","min","max","fit",...T()],G=()=>[rg,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],L=()=>[e,fn,sn],Z=()=>[...k(),NTe,TTe,{position:[fn,sn]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",ICn,TCn,{size:[fn,sn]}],Q=()=>[eQ,JO,py],W=()=>["","none","full",u,fn,sn],J=()=>["",xr,JO,py],ne=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[xr,eQ,NTe,TTe],ce=()=>["","none",g,fn,sn],ve=()=>["none",xr,fn,sn],ee=()=>["none",xr,fn,sn],re=()=>[xr,fn,sn],ie=()=>[rg,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oh],breakpoint:[Oh],color:[cJe],container:[Oh],"drop-shadow":[Oh],ease:["in","out","in-out"],font:[CCn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oh],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oh],shadow:[Oh],spacing:["px",xr],text:[Oh],"text-shadow":[Oh],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",rg,sn,fn,y]}],container:["container"],columns:[{columns:[xr,sn,fn,i]}],"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:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:j()}],"inset-x":[{"inset-x":j()}],"inset-y":[{"inset-y":j()}],start:[{"inset-s":j(),start:j()}],end:[{"inset-e":j(),end:j()}],"inset-bs":[{"inset-bs":j()}],"inset-be":[{"inset-be":j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:["visible","invisible","collapse"],z:[{z:[sg,"auto",fn,sn]}],basis:[{basis:[rg,"full","auto",i,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xr,rg,"auto","initial","none",sn]}],grow:[{grow:["",xr,fn,sn]}],shrink:[{shrink:["",xr,fn,sn]}],order:[{order:[sg,"first","last","none",fn,sn]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":R()}],"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":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"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:[i,"screen",...B()]}],"min-w":[{"min-w":[i,"screen","none",...B()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[o]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,JO,py]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,MCn,NCn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eQ,sn]}],"font-family":[{font:[RCn,ACn,t]}],"font-features":[{"font-features":[sn]}],"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:[s,fn,sn]}],"line-clamp":[{"line-clamp":[xr,"none",fn,CTe]}],leading:[{leading:[a,...T()]}],"list-image":[{"list-image":["none",fn,sn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fn,sn]}],"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:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[xr,"from-font","auto",fn,py]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[xr,"auto",fn,sn]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fn,sn]}],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",fn,sn]}],"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:z()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sg,fn,sn],radial:["",fn,sn],conic:[sg,fn,sn]},PCn,jCn]}],"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:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"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:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xr,fn,sn]}],"outline-w":[{outline:["",xr,JO,py]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,vR,yR]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,vR,yR]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[xr,py]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,vR,yR]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[xr,fn,sn]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":[xr]}],"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":[fn,sn]}],"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":[xr]}],"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:z()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fn,sn]}],filter:[{filter:["","none",fn,sn]}],blur:[{blur:ce()}],brightness:[{brightness:[xr,fn,sn]}],contrast:[{contrast:[xr,fn,sn]}],"drop-shadow":[{"drop-shadow":["","none",h,vR,yR]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",xr,fn,sn]}],"hue-rotate":[{"hue-rotate":[xr,fn,sn]}],invert:[{invert:["",xr,fn,sn]}],saturate:[{saturate:[xr,fn,sn]}],sepia:[{sepia:["",xr,fn,sn]}],"backdrop-filter":[{"backdrop-filter":["","none",fn,sn]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[xr,fn,sn]}],"backdrop-contrast":[{"backdrop-contrast":[xr,fn,sn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xr,fn,sn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xr,fn,sn]}],"backdrop-invert":[{"backdrop-invert":["",xr,fn,sn]}],"backdrop-opacity":[{"backdrop-opacity":[xr,fn,sn]}],"backdrop-saturate":[{"backdrop-saturate":[xr,fn,sn]}],"backdrop-sepia":[{"backdrop-sepia":["",xr,fn,sn]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fn,sn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xr,"initial",fn,sn]}],ease:[{ease:["linear","initial",x,fn,sn]}],delay:[{delay:[xr,fn,sn]}],animate:[{animate:["none",w,fn,sn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,fn,sn]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ee()}],"scale-x":[{"scale-x":ee()}],"scale-y":[{"scale-y":ee()}],"scale-z":[{"scale-z":ee()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[fn,sn,"","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",fn,sn]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",fn,sn]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[xr,JO,py,CTe]}],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"]}},DCn=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(Pk(e,"cacheSize",t),Pk(e,"prefix",n),Pk(e,"experimentalParseClassName",r),xR(e.theme,a.theme),xR(e.classGroups,a.classGroups),xR(e.conflictingClassGroups,a.conflictingClassGroups),xR(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Pk(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),wR(e.theme,s.theme),wR(e.classGroups,s.classGroups),wR(e.conflictingClassGroups,s.conflictingClassGroups),wR(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),bJe(e,s,"orderSensitiveModifiers"),e),Pk=(e,t,n)=>{n!==void 0&&(e[t]=n)},xR=(e,t)=>{if(t)for(const n in t)Pk(e,n,t[n])},wR=(e,t)=>{if(t)for(const n in t)bJe(e,t,n)},bJe=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},LCn=(e,...t)=>typeof e=="function"?ETe(ATe,e,...t):ETe(()=>DCn(ATe(),e),...t),FCn=Object.keys({...dDe,...gwt}),zCn=Object.keys(Swt),BCn=Object.keys(bwt),UCn=Object.keys(ywt),VCn=Object.keys(mwt),hy=Object.keys(wwt),qCn=Object.keys(vwt).concat(Object.keys(xwt)),HCn=LCn({extend:{theme:{color:FCn,spacing:zCn,radius:VCn,leading:UCn,shadow:qCn},classGroups:{"font-size":[{text:BCn}],h:[{h:hy}],w:[{w:hy}],size:[{size:hy}],"min-h":[{"min-h":hy}],"min-w":[{"min-w":hy}],"max-h":[{"max-h":hy}],"max-w":[{"max-w":hy}]}}});function K(...e){return HCn(nJe(e))}const Wi={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},uN="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",QCn="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",GCn="rounded-md",aoe="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",ooe="outline-none focus-visible:outline-none focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",ioe="disabled:opacity-50 disabled:cursor-not-allowed",WCn={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"},Oe=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:K("block",WCn[n],t),...r,children:e}),ui=jbt,Qn=Rbt,Gn=Ibt,Bn=S.forwardRef(({className:e,sideOffset:t=4,children:n,...r},s)=>l.jsx(Pbt,{children:l.jsxs(v$e,{ref:s,sideOffset:t,className:K("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(Mbt,{className:"fill-surface6"})]})}));Bn.displayName=v$e.displayName;const ZCn={sm:`${Wi.sm} w-form-sm`,md:`${Wi.md} w-form-md`,lg:`${Wi.lg} w-form-lg`,default:`${Wi.default}`},YCn={sm:"sm",md:"default",lg:"lg",default:"default"},XCn={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"},KCn="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",Ms=be.forwardRef(({className:e,children:t,tooltip:n,size:r="md",variant:s="default",disabled:a,...o},i)=>l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx("button",{ref:i,disabled:a,"aria-label":typeof n=="string"?n:void 0,className:K(KCn,uN,XCn[s],ZCn[r],a&&"active:scale-100",e),...o,children:l.jsx(Oe,{size:YCn[r],children:t})})}),l.jsx(Bn,{children:n})]}));Ms.displayName="IconButton";const JCn={"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"},eTn={mono:"font-mono"},ke=({as:e="p",className:t,variant:n="ui-md",font:r,...s})=>l.jsx(e,{className:K(JCn[n],r&&eTn[r],t),...s}),$n={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"},Rb={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},tTn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},yJe=({src:e,name:t,size:n="sm",interactive:r=!1})=>l.jsx("div",{className:K(tTn[n],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",$n.all,r&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?l.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):l.jsx(ke,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),V4=({copiedDuration:e=1500}={})=>{const[t,n]=S.useState(!1);return{isCopied:t,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{n(!0),setTimeout(()=>n(!1),e)})}}},nTn=M2t({style:QJ.coldarkDark,customStyle:{margin:0,backgroundColor:"black"}}),rTn=()=>l.jsx(Jkt,{remarkPlugins:[O4e],className:"aui-md",components:oTn}),jTe=S.memo(rTn),sTn=({language:e,code:t})=>{const{isCopied:n,copyToClipboard:r}=V4(),s=()=>{!t||n||r(t)};return l.jsxs("div",{style:{background:"hsl(0 0% 100% / 0.06)",borderTopRightRadius:"0.5rem",borderTopLeftRadius:"0.5rem",marginTop:"0.5rem",border:"1px solid hsl(0 0% 20.4%)",borderBottom:"none"},className:"flex items-center justify-between gap-4 px-4 py-2 text-sm font-semibold text-white",children:[l.jsx("span",{className:"lowercase [&>span]:text-xs",children:e}),l.jsx(Ms,{variant:"light",size:"md",tooltip:"Copy",onClick:s,children:l.jsxs("span",{className:"grid",children:[l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",n?"scale-100":"scale-0"),children:l.jsx(Os,{size:14})},"checkmark"),l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",n?"scale-0":"scale-100"),children:l.jsx(Xi,{size:14})},"copy")]})})]})},aTn=({alt:e,src:t,...n})=>{const[r,s]=S.useState(!1);return S.useEffect(()=>{s(!1)},[t]),r||!t?l.jsxs("div",{children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",width:"150",height:"150",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})}),l.jsx("p",{className:"text-xs italic text-neutral3 -mt-2.5 mb-2.5",children:"Image link is broken"})]}):l.jsx("img",{src:t,alt:e,...n,onError:()=>{s(!0)}})},oTn=Dkt({h1:({className:e,...t})=>l.jsx("h1",{className:K("mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",e),...t,style:{marginBottom:"2rem"}}),h2:({className:e,...t})=>l.jsx("h2",{className:K("mb-4 mt-8 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"2rem"}}),h3:({className:e,...t})=>l.jsx("h3",{className:K("scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1.5rem"}}),h4:({className:e,...t})=>l.jsx("h4",{className:K("scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1.5rem"}}),h5:({className:e,...t})=>l.jsx("h5",{className:K("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),h6:({className:e,...t})=>l.jsx("h6",{className:K("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),p:({className:e,...t})=>l.jsx("p",{className:K("leading-7 first:mt-0 last:mb-0",e),...t}),a:({className:e,...t})=>l.jsx("a",{className:K("text-neutral6 font-medium underline underline-offset-4",e),...t}),blockquote:({className:e,...t})=>l.jsx("blockquote",{className:K("border-l-2 pl-6 italic",e),...t}),ul:({className:e,...t})=>l.jsx("ul",{className:K("my-5 ml-6 list-disc [&>li]:mt-2",e),...t}),ol:({className:e,...t})=>l.jsx("ol",{className:K("my-5 ml-6 list-decimal [&>li]:mt-2",e),...t}),hr:({className:e,...t})=>l.jsx("hr",{className:K("my-5 border-b",e),...t}),table:({className:e,...t})=>l.jsx("table",{className:K("my-5 w-full border-separate border-spacing-0 overflow-y-auto",e),...t}),th:({className:e,...t})=>l.jsx("th",{className:K("bg-surface4 px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),td:({className:e,...t})=>l.jsx("td",{className:K("border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),tr:({className:e,...t})=>l.jsx("tr",{className:K("m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",e),...t}),sup:({className:e,...t})=>l.jsx("sup",{className:K("[&>a]:text-xs [&>a]:no-underline",e),...t}),pre:({className:e,...t})=>l.jsx("pre",{...t,style:{borderBottomRightRadius:"0.5rem",borderBottomLeftRadius:"0.5rem",background:"transparent",fontSize:"0.875rem",marginBottom:"0.5rem",border:"1px solid hsl(0 0% 20.4%)"},className:K("overflow-x-auto p-4 text-white",e)}),code:function({className:t,...n}){const r=XDe();return l.jsxs("pre",{style:{fontSize:"0.875rem",display:"inline"},children:[l.jsx("code",{className:K(!r&&"bg-surface4 rounded border font-semibold",t),...n,style:{fontWeight:"400",paddingBlock:r?0:"0.1em",paddingInline:r?0:"0.3em"}})," "]})},CodeHeader:sTn,SyntaxHighlighter:nTn,img:aTn}),iTn=({reason:e,tripwire:t})=>{const[n,r]=S.useState(!1),s=t&&(t.retry!==void 0||t.tripwirePayload||t.processorId);return l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[l.jsxs("div",{className:"flex items-start gap-3 p-4",children:[l.jsx(nT,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),l.jsx("p",{className:"text-sm text-amber-300/90",children:e})]})]}),s&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>r(!n),className:"w-full flex items-center gap-2 px-4 py-2 text-xs text-amber-400/70 hover:text-amber-400 hover:bg-amber-900/20 transition-colors border-t border-amber-500/20",children:[n?l.jsx(xs,{className:"w-3.5 h-3.5"}):l.jsx(qs,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:"Details"})]}),n&&l.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-amber-500/20 bg-amber-950/10",children:[t.retry!==void 0&&l.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[l.jsx(tT,{className:"w-3.5 h-3.5 text-amber-400/60"}),l.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",t.retry?l.jsx("span",{className:"text-green-400",children:"Allowed"}):l.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),t.processorId&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(SJ,{className:"w-3.5 h-3.5 text-amber-400/60"}),l.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",l.jsx("code",{className:"px-1.5 py-0.5 rounded bg-amber-900/30 text-amber-200 font-mono",children:t.processorId})]})]}),t.tripwirePayload!==void 0&&t.tripwirePayload!==null&&l.jsxs("div",{className:"pt-1",children:[l.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),l.jsx("pre",{className:"text-xs text-amber-200/80 bg-amber-900/30 rounded p-2 overflow-x-auto font-mono",children:String(JSON.stringify(t.tripwirePayload,null,2))})]})]})]})]})},so=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"})]}),vJe=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)"})})})]}),lTn=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"})]}),loe=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"})]}),coe=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"})]}),_a=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"})}),uoe=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)"})})})]}),xJe=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)"})})})]}),cTn=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"})]}),wJe=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"})}),uTn=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"})}),doe=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"})}),dTn=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"})}),Ti=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"})}),w1=e=>l.jsx(cwt,{...e}),tl=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"})}),fTn=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"})]}),yu=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"})]}),pTn=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"})}),hTn=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"})]}),mTn=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 Zy(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 gTn={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},bTn={warning:Nl,destructive:Zd,info:Hi},Kd=({children:e,variant:t="destructive",className:n})=>{const r=bTn[t];return l.jsx("div",{className:K(gTn[t],"p-3 rounded-md border shadow-sm",$n.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",n),children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Oe,{className:"mt-0.5 flex-shrink-0",children:l.jsx(r,{})}),l.jsx("div",{className:"text-neutral4",children:e})]})})},Jd=({children:e,as:t="h5"})=>l.jsx(ke,{as:t,variant:"ui-md",className:"font-semibold",children:e}),db=({children:e,as:t="p"})=>l.jsx(ke,{as:t,variant:"ui-sm",children:e}),yTn={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"},vTn={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,...s})=>l.jsxs("div",{className:K("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",$n.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":yTn[t],n),...s,children:[e&&l.jsx("span",{className:vTn[t],children:l.jsx(Oe,{children:e})}),r]}),xTn=()=>{const e=zn(({part:o})=>o),[t,n]=S.useState(!1),r=e.text||"",s=e.metadata||{};if(s?.status==="tripwire")return l.jsx(iTn,{reason:r,tripwire:s.tripwire});if(s?.status==="warning")return l.jsxs(Kd,{variant:"warning",children:[l.jsx(Jd,{as:"h5",children:"Warning"}),l.jsx(db,{as:"p",children:r})]});if(s?.status==="error")return l.jsxs(Kd,{variant:"destructive",children:[l.jsx(Jd,{as:"h5",children:"Error"}),l.jsx(db,{as:"p",children:r})]});const a=s?.completionResult;if(a)return l.jsxs("div",{className:"mb-2 space-y-2",children:[l.jsxs("button",{onClick:()=>n(o=>!o),className:"flex items-center gap-2",children:[l.jsx(Oe,{children:l.jsx(Yv,{className:K("transition-all",t?"rotate-90":"rotate-180")})}),l.jsxs(ut,{variant:"info",icon:l.jsx(gJ,{}),children:[t?"Show":"Hide"," completion check"]})]}),!t&&l.jsxs(Kd,{variant:"info",children:[l.jsx(Jd,{as:"h5",children:a?.passed?"Complete":"Not Complete"}),l.jsx(jTe,{})]})]});try{const o=r.trim();if(o.startsWith("__ERROR__:")){const i=o.substring(10);return l.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[l.jsx(Zd,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),l.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i})]})]})}else if(o.startsWith("Error:")){const i=o.substring(6).trim();return l.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[l.jsx(Zd,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),l.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i})]})]})}return l.jsx(jTe,{})}catch{return l.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[l.jsx(Zd,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),l.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:String(r)})]})]})}},Bc="mastra_workspace",Jf={FILESYSTEM:{READ_FILE:`${Bc}_read_file`,WRITE_FILE:`${Bc}_write_file`,EDIT_FILE:`${Bc}_edit_file`,LIST_FILES:`${Bc}_list_files`,DELETE:`${Bc}_delete`,FILE_STAT:`${Bc}_file_stat`,MKDIR:`${Bc}_mkdir`},SANDBOX:{EXECUTE_COMMAND:`${Bc}_execute_command`,GET_PROCESS_OUTPUT:`${Bc}_get_process_output`,KILL_PROCESS:`${Bc}_kill_process`},SEARCH:{SEARCH:`${Bc}_search`,INDEX:`${Bc}_index`}},wTn={duration:5e3,cancel:{label:l.jsx(Oe,{children:l.jsx(Gr,{})}),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 cu(e){const{classNames:t,...n}=wTn,{classNames:r,...s}=e||{};return{...n,classNames:{...t,title:K(t?.title,r?.title),toast:K(t?.toast,r?.toast),cancelButton:K(t?.cancelButton,r?.cancelButton),actionButton:K(t?.actionButton,r?.actionButton),description:K(t?.description,r?.description)},...s}}const qe=(e,t={})=>{if(Array.isArray(e))return e.forEach(n=>Yi(n,cu(t)));if(be.isValidElement(e))return Yi(e,cu(t));if(typeof e=="string")return Yi(e,cu(t));throw new Error("Invalid message type")};qe.success=(e,t={})=>{const n={...t,icon:l.jsx(Oe,{className:"text-accent1 shrink-0",children:l.jsx(bJ,{})}),classNames:{...t.classNames,toast:K("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Yi.success(e,cu(n));case"object":return e.forEach(r=>Yi.success(r,cu(n)))}};qe.error=(e,t={})=>{const n={...t,icon:l.jsx(Oe,{className:"text-accent2 shrink-0",children:l.jsx(Pw,{})}),classNames:{...t.classNames,toast:K("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Yi.error(e,cu(n));case"object":return e.forEach(r=>Yi.error(r,cu(n)))}};qe.warning=(e,t={})=>{const n={...t,icon:l.jsx(Oe,{className:"text-accent6 shrink-0",children:l.jsx(Zd,{})}),classNames:{...t.classNames,toast:K("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Yi.warning(e,cu(n));case"object":return e.forEach(r=>Yi.warning(r,cu(n)))}};qe.info=(e,t={})=>{const n={...t,icon:l.jsx(Oe,{className:"text-accent3 shrink-0",children:l.jsx(Hi,{})}),classNames:{...t.classNames,toast:K("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Yi.info(e,cu(n));case"object":return e.forEach(r=>Yi.info(r,cu(n)))}};qe.custom=(e,t={})=>Yi(e,cu(t));qe.dismiss=e=>{e&&Yi.dismiss(e)};qe.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:s,onError:a,options:o={}})=>Yi.promise(e,{loading:t??"Loading...",success:i=>(s?.(i),n),error:i=>(a?.(i),r||i?.message||"Error..."),...cu(o)});function pd({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=S.useState(!1),s=S.useRef(null),a=S.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{qe.success(t),r(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{qe.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:a}}const STn={sm:`${Wi.sm} text-ui-sm px-[.75em]`,md:`${Wi.md} text-ui-md px-[.75em]`,default:`${Wi.default} text-ui-md px-[.85em] `,lg:`${Wi.lg} text-ui-lg px-[1em] `},OTn={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:aoe,light:"",outline:""},kTn=K("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",ioe,ooe),_Tn={light:"default",outline:"default"};function ETn(e){return _Tn[e]??e}function S1(e){const t=ETn(e?.variant||"default"),n=e?.size||"default";return K(kTn,OTn[t],STn[n],e?.iconOnly&&"[&>svg]:opacity-75")}function SJe(e){const t=[];return be.Children.forEach(e,n=>{be.isValidElement(n)&&n.type===be.Fragment?t.push(...SJe(n.props.children)):t.push(n)}),t}function CTn(e){const t=SJe(e);return t.length>0&&t.every(n=>be.isValidElement(n))}const he=be.forwardRef(({className:e,as:t,size:n="default",variant:r="default",disabled:s,children:a,...o},i)=>{const c=t||"button",u=CTn(a);return l.jsx(c,{ref:i,disabled:s,className:K(S1({variant:r,size:n,iconOnly:u}),e),...o,children:a})});he.displayName="Button";const Bv=be.forwardRef(({tooltipContent:e,...t},n)=>l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx(he,{ref:n,...t})}),e&&l.jsx(Bn,{children:e})]}));Bv.displayName="ButtonWithTooltip";function oi({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:s}){const[a,o]=S.useState(!1),{handleCopy:i}=pd({text:e,copyMessage:t}),c=()=>{i(),o(!0),setTimeout(()=>o(!1),2e3)};return l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx(he,{onClick:c,type:"button",size:r,className:s,"aria-label":a?"Copied!":n,children:a?l.jsx(Os,{}):l.jsx(Xi,{})})}),l.jsx(Bn,{children:a?"Copied!":n})]})}const TTn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,NTn=Wt.mark({class:"cm-variable-highlight"}),RTe=new y5e({regexp:TTn,decoration:()=>NTn}),ATn=Ua.fromClass(class{decorations;constructor(e){this.decorations=RTe.createDeco(e)}update(e){this.decorations=RTe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),jTn=ATn;function RTn(e,t=5){if(!e?.properties)return[];const n=[];function r(s,a,o){if(o>t)return;const i=Array.isArray(s.type)?s.type.join(" | "):s.type;if(n.push({path:a,label:a,description:s.description??s.title,type:i}),s.properties)for(const[c,u]of Object.entries(s.properties))r(u,`${a}.${c}`,o+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))r(u,`${a}[].${c}`,o+1)}for(const[s,a]of Object.entries(e.properties))r(a,s,1);return n}function ITn(e){const t=RTn(e);return nLe({override:[PTn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function PTn(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 s=r[1]??"",a=t.pos-s.length,o=s?e.filter(c=>c.path.toLowerCase().startsWith(s.toLowerCase())):e;if(o.length===0)return null;const i=o.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,p)=>{const b=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:b},selection:{anchor:f+b.length}})}}));return{from:a,options:i,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const ym=()=>S.useMemo(()=>{const e=$$({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)"},styles:[{tag:[le.className,le.propertyName],color:"var(--neutral6)"},{tag:le.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[le.heading1,le.heading2,le.heading3,le.heading4,le.heading5,le.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:le.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:le.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:le.link,color:"var(--accent3)",textDecoration:"underline"},{tag:le.url,color:"var(--accent3)"},{tag:le.monospace,color:"var(--neutral6)"},{tag:le.strikethrough,textDecoration:"line-through"},{tag:le.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=ct.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]},[]),ea=S.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:s,language:a="json",highlightVariables:o=!1,placeholder:i,wordWrap:c=!1,schema:u,autoFocus:d,...f},p)=>{const h=ym(),g=e?JSON.stringify(e,null,2):t??"",b=S.useMemo(()=>{const y=[];return a==="json"?y.push(au):a==="markdown"&&(y.push(ste({base:gv,codeLanguages:k6e})),y.push(ct.lineWrapping)),o&&a==="markdown"&&y.push(jTn),u&&a==="markdown"&&y.push(ITn(u)),y},[a,o,u]);return l.jsxs("div",{className:K("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...f,children:[r&&l.jsx(oi,{content:g,className:"absolute top-2 right-2 z-20"}),l.jsx(pu,{ref:p,value:g,theme:h,extensions:b,onChange:n,"aria-label":"Code editor",placeholder:i,height:"100%",style:{height:"100%"},autoFocus:d})]})});async function MTn(e,t){const{codeToTokens:n,bundledLanguages:r}=await He(async()=>{const{codeToTokens:a,bundledLanguages:o}=await import("./index-DHagWC3Q.js");return{codeToTokens:a,bundledLanguages:o}},__vite__mapDeps([26,1]),import.meta.url);if(!(t in r))return null;const{tokens:s}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}const q4=({children:e,initialCollapsed:t=!0,icon:n,title:r,collapsible:s=!0,extraInfo:a,"data-testid":o})=>{const[i,c]=S.useState(t);return S.useEffect(()=>{c(t)},[t]),l.jsxs("div",{className:"mb-4","data-testid":o,children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[l.jsxs("button",{onClick:s?()=>c(u=>!u):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!s,type:"button",children:[l.jsx(Oe,{children:l.jsx(Yv,{className:K("transition-all",i?"rotate-90":"rotate-180")})}),l.jsx(ut,{icon:n,children:r})]}),a]}),!i&&l.jsx("div",{className:"pt-2",children:l.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})},ds=RM,OJe=pIe,$Tn=IM,kJe=S.forwardRef(({className:e,...t},n)=>l.jsx(FC,{ref:n,className:K("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}));kJe.displayName=FC.displayName;const os=S.forwardRef(({className:e,children:t,...n},r)=>l.jsxs($Tn,{children:[l.jsx(kJe,{}),l.jsxs(zC,{ref:r,className:K("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($M,{className:K("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(Gr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));os.displayName=zC.displayName;const fs=({className:e,...t})=>l.jsx("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});fs.displayName="DialogHeader";const O1=({className:e,...t})=>l.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});O1.displayName="DialogFooter";const ps=({className:e,...t})=>l.jsx("div",{className:K("overflow-y-auto px-6 max-h-[50vh]",e),...t});ps.displayName="DialogBody";const is=S.forwardRef(({className:e,...t},n)=>l.jsx(PM,{ref:n,className:K("text-ui-md font-medium",e),...t}));is.displayName=PM.displayName;const da=S.forwardRef(({className:e,...t},n)=>l.jsx(MM,{ref:n,className:K("sr-only",e),...t}));da.displayName=MM.displayName;const DTn=({selectionReason:e,open:t,onOpenChange:n,input:r})=>{let s=null;if(r)try{s=typeof r=="object"?l.jsx(ea,{data:r}):l.jsx(ea,{data:JSON.parse(r)})}catch{s=l.jsx("pre",{className:"whitespace-pre-wrap",children:r})}return l.jsx(ds,{open:t,onOpenChange:n,children:l.jsxs(os,{children:[l.jsxs(fs,{children:[l.jsx(is,{children:"Agent Network Metadata"}),l.jsx(da,{children:"View the metadata of the agent's network choice."})]}),l.jsxs(ps,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ke,{className:"text-neutral3",children:"Selection Reason"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),s&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(ke,{className:"text-neutral3",children:"Input"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:s})]})]})]})})},foe=({selectionReason:e,input:t})=>{const[n,r]=S.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(Ms,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>r(s=>!s),children:l.jsx(F0t,{className:"text-neutral3 size-5"})}),l.jsx(DTn,{selectionReason:e||"",open:n,onOpenChange:r,input:t})]})},_Je=S.createContext(void 0);function LTn({children:e,approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:o,isRunning:i,toolCallApprovals:c,networkToolCallApprovals:u}){return l.jsx(_Je.Provider,{value:{approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:o,isRunning:i,toolCallApprovals:c,networkToolCallApprovals:u},children:e})}function FTn(){const e=S.useContext(_Je);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const dN=({toolCalled:e,toolCallId:t,toolApprovalMetadata:n,toolName:r,isNetwork:s,isGenerateMode:a})=>{const{approveToolcall:o,declineToolcall:i,approveToolcallGenerate:c,declineToolcallGenerate:u,isRunning:d,toolCallApprovals:f,approveNetworkToolcall:p,declineNetworkToolcall:h,networkToolCallApprovals:g}=FTn(),b=()=>{s?p(r,n?.runId):a?c(t):o(t)},y=()=>{s?h(r,n?.runId):a?u(t):i(t)},x=s?g?.[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:b,disabled:d||!!x,className:x==="approved"?"!text-accent1":"",children:[l.jsx(Oe,{children:l.jsx(Os,{})}),"Approve"]}),l.jsxs(he,{onClick:y,disabled:d||!!x,className:x==="declined"?"!text-accent2":"",children:[l.jsx(Oe,{children:l.jsx(Gr,{})}),"Decline"]})]})]}):null},zTn=({toolName:e,args:t,result:n,metadata:r,toolOutput:s,toolCallId:a,toolApprovalMetadata:o,suspendPayload:i,isNetwork:c,toolCalled:u})=>{let d=null;try{const{__mastraMetadata:y,...x}=typeof t=="object"?t:JSON.parse(t);d=l.jsx(ea,{data:x,"data-testid":"tool-args"})}catch{d=l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:t})}let f=typeof n=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:n}):l.jsx(ea,{data:n,"data-testid":"tool-result"}),p=typeof i=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:i}):l.jsx(ea,{data:i,"data-testid":"tool-suspend-payload"});const h=r?.mode==="network"?r.selectionReason:void 0,g=r?.mode==="network"?r.agentInput:void 0,b=u??(n||s.length>0);return l.jsx(q4,{"data-testid":"tool-badge",icon:l.jsx(Ti,{className:"text-accent6"}),title:e,extraInfo:r?.mode==="network"&&l.jsx(foe,{selectionReason:h||"",input:g}),initialCollapsed:!(o??i),children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),d]}),p!==void 0&&i&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool suspend payload"}),p]}),f!==void 0&&n&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool result"}),f]}),s.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool output"}),l.jsx("div",{className:"h-40 overflow-y-auto",children:l.jsx(ea,{data:s,"data-testid":"tool-output"})})]}),l.jsx(dN,{toolCalled:b,toolCallId:a,toolApprovalMetadata:o,toolName:e,isNetwork:c,isGenerateMode:r?.mode==="generate"})]})})},EJe=S.createContext({Link:S.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:()=>""}}),CJe=({children:e,Link:t,navigate:n,paths:r})=>l.jsx(EJe.Provider,{value:{Link:t,navigate:n,paths:r},children:e}),Lt=()=>{const e=S.useContext(EJe);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},BTn=e=>{switch(e){case"running":return"bg-green-500";case"starting":case"initializing":return"bg-yellow-500";case"stopped":case"paused":return"bg-gray-500";case"error":case"failed":return"bg-red-500";default:return"bg-accent6"}},UTn=(e,t)=>{const[n,r]=S.useState(0),s=S.useRef(null);return S.useEffect(()=>{if(e){r(0),s.current=t||Date.now();const a=setInterval(()=>{s.current&&r(Date.now()-s.current)},100);return()=>clearInterval(a)}else s.current=null},[e,t]),n},VTn=({command:e,content:t,maxHeight:n="20rem",onCopy:r,isCopied:s})=>{const a=S.useRef(null);return S.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[t]),l.jsxs("div",{className:"rounded-md border border-border1 overflow-hidden",children:[e&&l.jsxs("div",{className:"px-3 py-2 bg-surface3 border-b border-border1 flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("span",{className:"text-neutral6 text-xs shrink-0",children:"$"}),l.jsx("code",{className:"text-xs text-neutral-300 font-mono truncate",children:e})]}),r&&l.jsx(Ms,{variant:"light",size:"sm",tooltip:"Copy output",onClick:r,className:"shrink-0",children:l.jsxs("span",{className:"grid",children:[l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",s?"scale-100":"scale-0"),children:l.jsx(Os,{size:14})}),l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",s?"scale-0":"scale-100"),children:l.jsx(Xi,{size:14})})]})})]}),l.jsx("pre",{ref:a,style:{maxHeight:n},className:"overflow-x-auto overflow-y-auto p-3 text-sm text-neutral-300 font-mono whitespace-pre-wrap bg-black",children:t||l.jsx("span",{className:"text-neutral6 italic",children:"No output"})})]})},qTn=({toolName:e,args:t,result:n,metadata:r,toolCallId:s,toolApprovalMetadata:a,isNetwork:o,toolCalled:i})=>{const c=zn(G=>G.message),u=S.useMemo(()=>c.content.filter(L=>L.type==="data"),[c.content]),[d,f]=S.useState(!1),{isCopied:p,copyToClipboard:h}=V4(),{Link:g}=Lt(),b=u.find(G=>G.name==="sandbox-command"&&G.data?.toolCallId===s);let y="";try{const G=typeof t=="object"?t:JSON.parse(t);e===Jf.SANDBOX.EXECUTE_COMMAND?y=G.command||"":(e===Jf.SANDBOX.GET_PROCESS_OUTPUT||e===Jf.SANDBOX.KILL_PROCESS)&&(y=b?.data?.command||`PID ${G.pid}`)}catch{y=e}const x=u.filter(G=>(G.name==="sandbox-stdout"||G.name==="sandbox-stderr")&&G.data?.toolCallId===s),w=u.find(G=>G.name==="workspace-metadata"&&G.data?.toolCallId===s),O=w?.data,k=u.find(G=>G.name==="sandbox-exit"&&G.data?.toolCallId===s),E=!!k||typeof n=="string",C=!!w,N=C&&!E,T=i??(E||C),j=k?.data?.exitCode,R=k?.data?.success,P=k?.data?.executionTimeMs,M=k?.data?.killed,D=x.map(G=>G.data?.output||"").join("")||(typeof n=="string"?n:""),q=e===Jf.SANDBOX.EXECUTE_COMMAND?"Execute Command":e===Jf.SANDBOX.GET_PROCESS_OUTPUT?"Get Process Output":e===Jf.SANDBOX.KILL_PROCESS?"Kill Process":e,V=x[0]?.data?.timestamp,B=UTn(N,V),H=()=>{!D||p||h(D)};return l.jsxs("div",{className:"mb-4","data-testid":"sandbox-execution-badge",children:[l.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[l.jsxs("button",{onClick:()=>f(G=>!G),className:"flex items-center gap-2 min-w-0",type:"button",children:[l.jsx(Oe,{children:l.jsx(Yv,{className:K("transition-all",d?"rotate-90":"rotate-180")})}),l.jsx(ut,{icon:l.jsx(Q0t,{className:"text-accent6",size:16}),children:q}),O?.sandbox&&l.jsxs(g,{href:O.id?`/workspaces/${O.id}`:"/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",onClick:G=>G.stopPropagation(),children:[l.jsx("span",{className:K("w-1.5 h-1.5 rounded-full",BTn(O.sandbox.status))}),l.jsx("span",{children:O.sandbox.name||O.sandbox.provider})]})]}),l.jsx("div",{className:"flex items-center gap-2",children:N?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-accent6",children:[l.jsx("span",{className:"w-1.5 h-1.5 bg-accent6 rounded-full animate-pulse"}),l.jsx("span",{className:"animate-pulse",children:"running"})]}),l.jsxs("span",{className:"text-neutral6 text-xs tabular-nums",children:[B,"ms"]})]}):l.jsxs(l.Fragment,{children:[j!==void 0&&(R?l.jsx(Os,{className:"text-green-400",size:14}):M?l.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-orange-500/20 text-orange-400",children:"killed"}):l.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-500/20 text-red-400",children:["exit ",j]})),P!==void 0&&l.jsxs("span",{className:"text-neutral6 text-xs",children:[P,"ms"]})]})})]}),!d&&l.jsxs("div",{className:"pt-2",children:[(D||y)&&l.jsx(VTn,{command:y,content:D,onCopy:D?H:void 0,isCopied:p}),l.jsx(dN,{toolCalled:T,toolCallId:s,toolApprovalMetadata:a,toolName:e,isNetwork:o,isGenerateMode:r?.mode==="generate"})]})]})},HTn=({toolName:e,args:t,result:n,toolCallId:r,toolApprovalMetadata:s,isNetwork:a,toolCalled:o})=>{const[i,c]=S.useState(!s),{isCopied:u,copyToClipboard:d}=V4();S.useEffect(()=>{c(!s)},[s]);const{Link:f}=Lt();let p={path:"."};try{p=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h=".",maxDepth:g,showHidden:b,dirsOnly:y,exclude:x,extension:w}=p,O=[];g!==void 0&&g!==3&&O.push(`depth: ${g}`),b&&O.push("hidden"),y&&O.push("dirs only"),x&&O.push(`exclude: ${x}`),w&&O.push(`ext: ${w}`);let k="",E="";if(typeof n=="string"&&n){const M=n.lastIndexOf(`
|
|
425
|
+
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!a&&!!r.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=x,u.ParserHandle=b,u.NetworkStreamer=f,u.FileStreamer=p,u.StringStreamer=h,u.ReadableStreamStreamer=g,r.jQuery&&((s=r.jQuery).fn.parse=function(T){var j=T.config||{},R=[];return this.each(function(U){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var D=0;D<this.files.length;D++)R.push({file:this.files[D],inputElem:this,instanceConfig:s.extend({},j)})}),P(),this;function P(){if(R.length===0)N(T.complete)&&T.complete();else{var U,D,q,V,B=R[0];if(N(T.before)){var H=T.before(B.file,B.inputElem);if(typeof H=="object"){if(H.action==="abort")return U="AbortError",D=B.file,q=B.inputElem,V=H.reason,void(N(T.error)&&T.error({name:U},D,q,V));if(H.action==="skip")return void M();typeof H.config=="object"&&(B.instanceConfig=s.extend(B.instanceConfig,H.config))}else if(H==="skip")return void M()}var G=B.instanceConfig.complete;B.instanceConfig.complete=function(L){N(G)&&G(L,B.file,B.inputElem),M()},u.parse(B.file,B.instanceConfig)}}function M(){R.splice(0,1),P()}}),o&&(r.onmessage=function(T){T=T.data,u.WORKER_ID===void 0&&T&&(u.WORKER_ID=T.workerId),typeof T.input=="string"?r.postMessage({workerId:u.WORKER_ID,results:u.parse(T.input,T.config),finished:!0}):(r.File&&T.input instanceof File||T.input instanceof Object)&&(T=u.parse(T.input,T.config))&&r.postMessage({workerId:u.WORKER_ID,results:T,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,(g.prototype=Object.create(d.prototype)).constructor=g,u})})(kI)),kI.exports}var aEn=sEn();const RKe=vu(aEn);var rTe=1,oEn=.9,iEn=.8,lEn=.17,ZH=.1,YH=.999,cEn=.9999,uEn=.99,dEn=/[\\\/_+.#"@\[\(\{&]/,fEn=/[\\\/_+.#"@\[\(\{&]/g,pEn=/[\s-]/,IKe=/[\s-]/g;function qY(e,t,n,r,s,a,o){if(a===t.length)return s===e.length?rTe:uEn;var i=`${s},${a}`;if(o[i]!==void 0)return o[i];for(var c=r.charAt(a),u=n.indexOf(c,s),d=0,f,p,h,g;u>=0;)f=qY(e,t,n,r,u+1,a+1,o),f>d&&(u===s?f*=rTe:dEn.test(e.charAt(u-1))?(f*=iEn,h=e.slice(s,u-1).match(fEn),h&&s>0&&(f*=Math.pow(YH,h.length))):pEn.test(e.charAt(u-1))?(f*=oEn,g=e.slice(s,u-1).match(IKe),g&&s>0&&(f*=Math.pow(YH,g.length))):(f*=lEn,s>0&&(f*=Math.pow(YH,u-s))),e.charAt(u)!==t.charAt(a)&&(f*=cEn)),(f<ZH&&n.charAt(u-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(u-1)!==r.charAt(a))&&(p=qY(e,t,n,r,u+1,a+2,o),p*ZH>f&&(f=p*ZH)),f>d&&(d=f),u=n.indexOf(c,u+1);return o[i]=d,d}function sTe(e){return e.toLowerCase().replace(IKe," ")}function hEn(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,qY(e,t,sTe(e),sTe(t),0,0,{})}var KO='[cmdk-group=""]',XH='[cmdk-group-items=""]',mEn='[cmdk-group-heading=""]',PKe='[cmdk-item=""]',aTe=`${PKe}:not([aria-disabled="true"])`,HY="cmdk-item-select",E0="data-value",gEn=(e,t,n)=>hEn(e,t,n),MKe=S.createContext(void 0),cN=()=>S.useContext(MKe),$Ke=S.createContext(void 0),Jae=()=>S.useContext($Ke),DKe=S.createContext(void 0),LKe=S.forwardRef((e,t)=>{let n=C0(()=>{var z,I;return{search:"",value:(I=(z=e.value)!=null?z:e.defaultValue)!=null?I:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=C0(()=>new Set),s=C0(()=>new Map),a=C0(()=>new Map),o=C0(()=>new Set),i=FKe(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:g,disablePointerSelection:b=!1,vimBindings:y=!0,...x}=e,w=vo(),O=vo(),k=vo(),E=S.useRef(null),C=CEn();Fv(()=>{if(d!==void 0){let z=d.trim();n.current.value=z,N.emit()}},[d]),Fv(()=>{C(6,U)},[]);let N=S.useMemo(()=>({subscribe:z=>(o.current.add(z),()=>o.current.delete(z)),snapshot:()=>n.current,setState:(z,I,Q)=>{var W,J,ne,te;if(!Object.is(n.current[z],I)){if(n.current[z]=I,z==="search")M(),R(),C(1,P);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(k);ae?ae.focus():(W=document.getElementById(w))==null||W.focus()}if(C(7,()=>{var ae;n.current.selectedItemId=(ae=D())==null?void 0:ae.id,N.emit()}),Q||C(5,U),((J=i.current)==null?void 0:J.value)!==void 0){let ae=I??"";(te=(ne=i.current).onValueChange)==null||te.call(ne,ae);return}}N.emit()}},emit:()=>{o.current.forEach(z=>z())}}),[]),T=S.useMemo(()=>({value:(z,I,Q)=>{var W;I!==((W=a.current.get(z))==null?void 0:W.value)&&(a.current.set(z,{value:I,keywords:Q}),n.current.filtered.items.set(z,j(I,Q)),C(2,()=>{R(),N.emit()}))},item:(z,I)=>(r.current.add(z),I&&(s.current.has(I)?s.current.get(I).add(z):s.current.set(I,new Set([z]))),C(3,()=>{M(),R(),n.current.value||P(),N.emit()}),()=>{a.current.delete(z),r.current.delete(z),n.current.filtered.items.delete(z);let Q=D();C(4,()=>{M(),Q?.getAttribute("id")===z&&P(),N.emit()})}),group:z=>(s.current.has(z)||s.current.set(z,new Set),()=>{a.current.delete(z),s.current.delete(z)}),filter:()=>i.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:w,inputId:k,labelId:O,listInnerRef:E}),[]);function j(z,I){var Q,W;let J=(W=(Q=i.current)==null?void 0:Q.filter)!=null?W:gEn;return z?J(z,n.current.search,I):0}function R(){if(!n.current.search||i.current.shouldFilter===!1)return;let z=n.current.filtered.items,I=[];n.current.filtered.groups.forEach(W=>{let J=s.current.get(W),ne=0;J.forEach(te=>{let ae=z.get(te);ne=Math.max(ae,ne)}),I.push([W,ne])});let Q=E.current;q().sort((W,J)=>{var ne,te;let ae=W.getAttribute("id"),ce=J.getAttribute("id");return((ne=z.get(ce))!=null?ne:0)-((te=z.get(ae))!=null?te:0)}).forEach(W=>{let J=W.closest(XH);J?J.appendChild(W.parentElement===J?W:W.closest(`${XH} > *`)):Q.appendChild(W.parentElement===Q?W:W.closest(`${XH} > *`))}),I.sort((W,J)=>J[1]-W[1]).forEach(W=>{var J;let ne=(J=E.current)==null?void 0:J.querySelector(`${KO}[${E0}="${encodeURIComponent(W[0])}"]`);ne?.parentElement.appendChild(ne)})}function P(){let z=q().find(Q=>Q.getAttribute("aria-disabled")!=="true"),I=z?.getAttribute(E0);N.setState("value",I||void 0)}function M(){var z,I,Q,W;if(!n.current.search||i.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let J=0;for(let ne of r.current){let te=(I=(z=a.current.get(ne))==null?void 0:z.value)!=null?I:"",ae=(W=(Q=a.current.get(ne))==null?void 0:Q.keywords)!=null?W:[],ce=j(te,ae);n.current.filtered.items.set(ne,ce),ce>0&&J++}for(let[ne,te]of s.current)for(let ae of te)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(ne);break}n.current.filtered.count=J}function U(){var z,I,Q;let W=D();W&&(((z=W.parentElement)==null?void 0:z.firstChild)===W&&((Q=(I=W.closest(KO))==null?void 0:I.querySelector(mEn))==null||Q.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function D(){var z;return(z=E.current)==null?void 0:z.querySelector(`${PKe}[aria-selected="true"]`)}function q(){var z;return Array.from(((z=E.current)==null?void 0:z.querySelectorAll(aTe))||[])}function V(z){let I=q()[z];I&&N.setState("value",I.getAttribute(E0))}function B(z){var I;let Q=D(),W=q(),J=W.findIndex(te=>te===Q),ne=W[J+z];(I=i.current)!=null&&I.loop&&(ne=J+z<0?W[W.length-1]:J+z===W.length?W[0]:W[J+z]),ne&&N.setState("value",ne.getAttribute(E0))}function H(z){let I=D(),Q=I?.closest(KO),W;for(;Q&&!W;)Q=z>0?_En(Q,KO):EEn(Q,KO),W=Q?.querySelector(aTe);W?N.setState("value",W.getAttribute(E0)):B(z)}let G=()=>V(q().length-1),L=z=>{z.preventDefault(),z.metaKey?G():z.altKey?H(1):B(1)},Z=z=>{z.preventDefault(),z.metaKey?V(0):z.altKey?H(-1):B(-1)};return S.createElement($o.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:z=>{var I;(I=x.onKeyDown)==null||I.call(x,z);let Q=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||Q))switch(z.key){case"n":case"j":{y&&z.ctrlKey&&L(z);break}case"ArrowDown":{L(z);break}case"p":case"k":{y&&z.ctrlKey&&Z(z);break}case"ArrowUp":{Z(z);break}case"Home":{z.preventDefault(),V(0);break}case"End":{z.preventDefault(),G();break}case"Enter":{z.preventDefault();let W=D();if(W){let J=new Event(HY);W.dispatchEvent(J)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:NEn},c),U4(e,z=>S.createElement($Ke.Provider,{value:N},S.createElement(MKe.Provider,{value:T},z))))}),bEn=S.forwardRef((e,t)=>{var n,r;let s=vo(),a=S.useRef(null),o=S.useContext(DKe),i=cN(),c=FKe(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Fv(()=>{if(!u)return i.item(s,o?.id)},[u]);let d=zKe(s,a,[e.value,e.children,a],e.keywords),f=Jae(),p=ub(C=>C.value&&C.value===d.current),h=ub(C=>u||i.filter()===!1?!0:C.search?C.filtered.items.get(s)>0:!0);S.useEffect(()=>{let C=a.current;if(!(!C||e.disabled))return C.addEventListener(HY,g),()=>C.removeEventListener(HY,g)},[h,e.onSelect,e.disabled]);function g(){var C,N;b(),(N=(C=c.current).onSelect)==null||N.call(C,d.current)}function b(){f.setState("value",d.current,!0)}if(!h)return null;let{disabled:y,value:x,onSelect:w,forceMount:O,keywords:k,...E}=e;return S.createElement($o.div,{ref:Ep(a,t),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!p,"data-disabled":!!y,"data-selected":!!p,onPointerMove:y||i.getDisablePointerSelection()?void 0:b,onClick:y?void 0:g},e.children)}),yEn=S.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...a}=e,o=vo(),i=S.useRef(null),c=S.useRef(null),u=vo(),d=cN(),f=ub(h=>s||d.filter()===!1?!0:h.search?h.filtered.groups.has(o):!0);Fv(()=>d.group(o),[]),zKe(o,i,[e.value,e.heading,c]);let p=S.useMemo(()=>({id:o,forceMount:s}),[s]);return S.createElement($o.div,{ref:Ep(i,t),...a,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&S.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),U4(e,h=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},S.createElement(DKe.Provider,{value:p},h))))}),vEn=S.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=S.useRef(null),a=ub(o=>!o.search);return!n&&!a?null:S.createElement($o.div,{ref:Ep(s,t),...r,"cmdk-separator":"",role:"separator"})}),xEn=S.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,a=Jae(),o=ub(u=>u.search),i=ub(u=>u.selectedItemId),c=cN();return S.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),S.createElement($o.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":i,id:c.inputId,type:"text",value:s?e.value:o,onChange:u=>{s||a.setState("search",u.target.value),n?.(u.target.value)}})}),wEn=S.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,a=S.useRef(null),o=S.useRef(null),i=ub(u=>u.selectedItemId),c=cN();return S.useEffect(()=>{if(o.current&&a.current){let u=o.current,d=a.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)}}},[]),S.createElement($o.div,{ref:Ep(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":r,id:c.listId},U4(e,u=>S.createElement("div",{ref:Ep(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),SEn=S.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:a,container:o,...i}=e;return S.createElement(RM,{open:n,onOpenChange:r},S.createElement(IM,{container:o},S.createElement(FC,{"cmdk-overlay":"",className:s}),S.createElement(zC,{"aria-label":e.label,"cmdk-dialog":"",className:a},S.createElement(LKe,{ref:t,...i}))))}),OEn=S.forwardRef((e,t)=>ub(n=>n.filtered.count===0)?S.createElement($o.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),kEn=S.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...a}=e;return S.createElement($o.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},U4(e,o=>S.createElement("div",{"aria-hidden":!0},o)))}),Ec=Object.assign(LKe,{List:wEn,Item:bEn,Input:xEn,Group:yEn,Separator:vEn,Dialog:SEn,Empty:OEn,Loading:kEn});function _En(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function EEn(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function FKe(e){let t=S.useRef(e);return Fv(()=>{t.current=e}),t}var Fv=typeof window>"u"?S.useEffect:S.useLayoutEffect;function C0(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function ub(e){let t=Jae(),n=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,n,n)}function zKe(e,t,n,r=[]){let s=S.useRef(),a=cN();return Fv(()=>{var o;let i=(()=>{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():s.current}})(),c=r.map(u=>u.trim());a.value(e,i,c),(o=t.current)==null||o.setAttribute(E0,i),s.current=i}),s}var CEn=()=>{let[e,t]=S.useState(),n=C0(()=>new Map);return Fv(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function TEn(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function U4({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(TEn(t),{ref:t.ref},n(t.props.children)):n(t)}var NEn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};class No{constructor(t,n,r,s){this.fromA=t,this.toA=n,this.fromB=r,this.toB=s}offset(t,n=t){return new No(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}}function zv(e,t,n,r,s,a){if(e==r)return[];let o=toe(e,t,n,r,s,a),i=noe(e,t+o,n,r,s+o,a);t+=o,n-=i,s+=o,a-=i;let c=n-t,u=a-s;if(!c||!u)return[new No(t,n,s,a)];if(c>u){let f=e.slice(t,n).indexOf(r.slice(s,a));if(f>-1)return[new No(t,t+f,s,s),new No(t+f+u,n,a,a)]}else if(u>c){let f=r.slice(s,a).indexOf(e.slice(t,n));if(f>-1)return[new No(t,t,s,s+f),new No(n,n,s+f+c,a)]}if(c==1||u==1)return[new No(t,n,s,a)];let d=VKe(e,t,n,r,s,a);if(d){let[f,p,h]=d;return zv(e,t,f,r,s,p).concat(zv(e,f+h,n,r,p+h,a))}return AEn(e,t,n,r,s,a)}let jk=1e9,Rk=0,eoe=!1;function AEn(e,t,n,r,s,a){let o=n-t,i=a-s;if(jk<1e9&&Math.min(o,i)>jk*16||Rk>0&&Date.now()>Rk)return Math.min(o,i)>jk*64?[new No(t,n,s,a)]:oTe(e,t,n,r,s,a);let c=Math.ceil((o+i)/2);KH.reset(c),JH.reset(c);let u=(h,g)=>e.charCodeAt(t+h)==r.charCodeAt(s+g),d=(h,g)=>e.charCodeAt(n-h-1)==r.charCodeAt(a-g-1),f=(o-i)%2!=0?JH:null,p=f?null:KH;for(let h=0;h<c;h++){if(h>jk||Rk>0&&!(h&63)&&Date.now()>Rk)return oTe(e,t,n,r,s,a);let g=KH.advance(h,o,i,c,f,!1,u)||JH.advance(h,o,i,c,p,!0,d);if(g)return jEn(e,t,n,t+g[0],r,s,a,s+g[1])}return[new No(t,n,s,a)]}class BKe{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,s,a,o,i){for(let c=-t+this.start;c<=t-this.end;c+=2){let u=s+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&&i(d,f);)d++,f++;if(this.vec[u]=d,d>n)this.end+=2;else if(f>r)this.start+=2;else if(a){let p=s+(n-r)-c;if(p>=0&&p<this.len&&a.vec[p]!=-1)if(o){let h=a.vec[p];if(h>=n-d)return[h,s+h-p]}else{let h=n-a.vec[p];if(d>=h)return[d,f]}}}return null}}const KH=new BKe,JH=new BKe;function jEn(e,t,n,r,s,a,o,i){let c=!1;return!ES(e,r)&&++r==n&&(c=!0),!ES(s,i)&&++i==o&&(c=!0),c?[new No(t,n,a,o)]:zv(e,t,r,s,a,i).concat(zv(e,r,n,s,i,o))}function UKe(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n=n<<1;return n}function toe(e,t,n,r,s,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(s))return 0;let o=UKe(n-t,a-s);for(let i=t,c=s;;){let u=i+o,d=c+o;if(u>n||d>a||e.slice(i,u)!=r.slice(c,d)){if(o==1)return i-t-(ES(e,i)?0:1);o=o>>1}else{if(u==n||d==a)return u-t;i=u,c=d}}}function noe(e,t,n,r,s,a){if(t==n||s==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=UKe(n-t,a-s);for(let i=n,c=a;;){let u=i-o,d=c-o;if(u<t||d<s||e.slice(u,i)!=r.slice(d,c)){if(o==1)return n-i-(ES(e,i)?0:1);o=o>>1}else{if(u==t||d==s)return n-u;i=u,c=d}}}function QY(e,t,n,r,s,a,o,i){let c=r.slice(s,a),u=null;for(;;){if(u||o<i)return u;for(let d=t+o;;){ES(e,d)||d++;let f=d+o;if(ES(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 g=toe(e,f,n,r,s+h+p.length,a),b=noe(e,t,d,r,s,s+h),y=p.length+g+b;(!u||u[2]<y)&&(u=[d-b,s+h-b,y])}d=f}if(i<0)return u;o=o>>1}}function VKe(e,t,n,r,s,a){let o=n-t,i=a-s;if(o<i){let c=VKe(r,s,a,e,t,n);return c&&[c[1],c[0],c[2]]}return o<4||i*2<o?null:QY(e,t,n,r,s,a,Math.floor(o/4),-1)}function oTe(e,t,n,r,s,a){eoe=!0;let o=n-t,i=a-s,c;if(o<i){let p=QY(r,s,a,e,t,n,Math.floor(o/6),50);c=p&&[p[1],p[0],p[2]]}else c=QY(e,t,n,r,s,a,Math.floor(i/6),50);if(!c)return[new No(t,n,s,a)];let[u,d,f]=c;return zv(e,t,u,r,s,d).concat(zv(e,u+f,n,r,d+f,a))}function qKe(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],s=e[n];r.toA>s.fromA-t&&r.toB>s.fromB-t&&(e[n-1]=new No(r.fromA,s.toA,r.fromB,s.toB),e.splice(n--,1))}}function REn(e,t,n){for(;;){qKe(n,1);let r=!1;for(let s=0;s<n.length;s++){let a=n[s],o,i;(o=toe(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[s]=new No(a.fromA+o,a.toA,a.fromB+o,a.toB)),(i=noe(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[s]=new No(a.fromA,a.toA-i,a.fromB,a.toB-i));let c=a.toA-a.fromA,u=a.toB-a.fromB;if(c&&u)continue;let d=a.fromA-(s?n[s-1].toA:0),f=(s<n.length-1?n[s+1].fromA:e.length)-a.toA;if(!d||!f)continue;let p=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);d<=p.length&&e.slice(a.fromA-d,a.fromA)==p.slice(p.length-d)?(n[s]=new No(a.fromA-d,a.toA-d,a.fromB-d,a.toB-d),r=!0):f<=p.length&&e.slice(a.toA,a.toA+f)==p.slice(0,f)&&(n[s]=new No(a.fromA+f,a.toA+f,a.fromB+f,a.toB+f),r=!0)}if(!r)break}return n}function IEn(e,t,n){for(let r=0,s=0;s<e.length;s++){let a=e[s],o=a.toA-a.fromA,i=a.toB-a.fromB;if(o&&i||o>3||i>3){let c=s==e.length-1?t.length:e[s+1].fromA,u=a.fromA-r,d=c-a.toA,f=lTe(t,a.fromA,u),p=iTe(t,a.toA,d),h=a.fromA-f,g=p-a.toA;if((!o||!i)&&h&&g){let b=Math.max(o,i),[y,x,w]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];b>h&&t.slice(f,a.fromA)==y.slice(w-h,w)?(a=e[s]=new No(f,f+o,a.fromB-h,a.toB-h),f=a.fromA,p=iTe(t,a.toA,c-a.toA)):b>g&&t.slice(a.toA,p)==y.slice(x,x+g)&&(a=e[s]=new No(p-o,p,a.fromB+g,a.toB+g),p=a.toA,f=lTe(t,a.fromA,a.fromA-r)),h=a.fromA-f,g=p-a.toA}if(h||g)a=e[s]=new No(a.fromA-h,a.toA+g,a.fromB-h,a.toB+g);else if(o){if(!i){let b=uTe(t,a.fromA,a.toA),y,x=b<0?-1:cTe(t,a.toA,a.fromA);b>-1&&(y=b-a.fromA)<=d&&t.slice(a.fromA,b)==t.slice(a.toA,a.toA+y)?a=e[s]=a.offset(y):x>-1&&(y=a.toA-x)<=u&&t.slice(a.fromA-y,a.fromA)==t.slice(x,a.toA)&&(a=e[s]=a.offset(-y))}}else{let b=uTe(n,a.fromB,a.toB),y,x=b<0?-1:cTe(n,a.toB,a.fromB);b>-1&&(y=b-a.fromB)<=d&&n.slice(a.fromB,b)==n.slice(a.toB,a.toB+y)?a=e[s]=a.offset(y):x>-1&&(y=a.toB-x)<=u&&n.slice(a.fromB-y,a.fromB)==n.slice(x,a.toB)&&(a=e[s]=a.offset(-y))}}r=a.toA}return qKe(e,3),e}let Wy;try{Wy=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function HKe(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function QKe(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?HKe(n)?1:0:Wy?!ZKe(n)||t==e.length-1?Wy.test(String.fromCharCode(n))?1:0:Wy.test(e.slice(t,t+2))?2:0:0}function GKe(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?HKe(n)?1:0:Wy?!YKe(n)||t==1?Wy.test(String.fromCharCode(n))?1:0:Wy.test(e.slice(t-2,t))?2:0:0}const WKe=8;function iTe(e,t,n){if(t==e.length||!GKe(e,t))return t;for(let r=t,s=t+n,a=0;a<WKe;a++){let o=QKe(e,r);if(!o||r+o>s)return r;r+=o}return t}function lTe(e,t,n){if(!t||!QKe(e,t))return t;for(let r=t,s=t-n,a=0;a<WKe;a++){let o=GKe(e,r);if(!o||r-o<s)return r;r-=o}return t}function cTe(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function uTe(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}const ZKe=e=>e>=55296&&e<=56319,YKe=e=>e>=56320&&e<=57343;function ES(e,t){return!t||t==e.length||!ZKe(e.charCodeAt(t-1))||!YKe(e.charCodeAt(t))}function PEn(e,t,n){var r;let s=n?.override;return s?s(e,t):(jk=((r=n?.scanLimit)!==null&&r!==void 0?r:1e9)>>1,Rk=n?.timeout?Date.now()+n.timeout:0,eoe=!1,REn(e,t,zv(e,0,e.length,t,0,t.length)))}function XKe(){return!eoe}function KKe(e,t,n){return IEn(PEn(e,t,n),e,t)}const sp=Vt.define({combine:e=>e[0]}),GY=Hn.define(),MEn=Vt.define(),CS=xo.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(GY)&&(e=n.value);for(let n of t.state.facet(MEn))e=n(e,t);return e}});class Sw{constructor(t,n,r,s,a,o=!0){this.changes=t,this.fromA=n,this.toA=r,this.fromB=s,this.toB=a,this.precise=o}offset(t,n){return t||n?new Sw(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 s=KKe(t.toString(),n.toString(),r);return JKe(s,t,n,0,0,XKe())}static updateA(t,n,r,s,a){return mTe(hTe(t,s,!0,r.length),t,n,r,a)}static updateB(t,n,r,s,a){return mTe(hTe(t,s,!1,n.length),t,n,r,a)}}function dTe(e,t,n,r){let s=n.lineAt(e),a=r.lineAt(t);return s.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[s.from,a.from]}function fTe(e,t,n,r){let s=n.lineAt(e),a=r.lineAt(t);return s.from==e&&a.from==t?[e,t]:[s.to+1,a.to+1]}function JKe(e,t,n,r,s,a){let o=[];for(let i=0;i<e.length;i++){let c=e[i],[u,d]=dTe(c.fromA+r,c.fromB+s,t,n),[f,p]=fTe(c.toA+r,c.toB+s,t,n),h=[c.offset(-u+r,-d+s)];for(;i<e.length-1;){let g=e[i+1],[b,y]=dTe(g.fromA+r,g.fromB+s,t,n);if(b>f+1&&y>p+1)break;h.push(g.offset(-u+r,-d+s)),[f,p]=fTe(g.toA+r,g.toB+s,t,n),i++}o.push(new Sw(h,u,Math.max(u,f),d,Math.max(d,p),a))}return o}const pR=1e3;function pTe(e,t,n,r){let s=0,a=e.length;for(;;){if(s==a){let d=0,f=0;s&&({toA:d,toB:f}=e[s-1]);let p=t-(n?d:f);return[d+p,f+p]}let o=s+a>>1,i=e[o],[c,u]=n?[i.fromA,i.toA]:[i.fromB,i.toB];if(c>t)a=o;else if(u<=t)s=o+1;else return r?[i.fromA,i.fromB]:[i.toA,i.toB]}}function hTe(e,t,n,r){let s=[];return t.iterChangedRanges((a,o,i,c)=>{let u=0,d=n?t.length:r,f=0,p=n?r:t.length;a>pR&&([u,f]=pTe(e,a-pR,n,!0)),o<t.length-pR&&([d,p]=pTe(e,o+pR,n,!1));let h=c-i-(o-a),g,[b,y]=n?[h,0]:[0,h];s.length&&(g=s[s.length-1]).toA>=u?s[s.length-1]={fromA:g.fromA,fromB:g.fromB,toA:d,toB:p,diffA:g.diffA+b,diffB:g.diffB+y}:s.push({fromA:u,toA:d,fromB:f,toB:p,diffA:b,diffB:y})}),s}function mTe(e,t,n,r,s){if(!e.length)return t;let a=[];for(let o=0,i=0,c=0,u=0;;o++){let d=o==e.length?null:e[o],f=d?d.fromA+i:n.length,p=d?d.fromB+c:r.length;for(;u<t.length;){let y=t[u];if(d&&(y.toA+i>f||y.toB+c>p))break;a.push(y.offset(i,c)),u++}if(!d)break;let h=d.toA+i+d.diffA,g=d.toB+c+d.diffB,b=KKe(n.sliceString(f,h),r.sliceString(p,g),s);for(let y of JKe(b,n,r,f,p,XKe()))a.push(y);for(i+=d.diffA,c+=d.diffB;u<t.length;){let y=t[u];if(y.fromA+i>h&&y.fromB+c>g)break;u++}}return a}const $En={scanLimit:500},eJe=Ua.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=yTe(e))}update(e){(e.docChanged||e.viewportChanged||DEn(e.startState,e.state)||LEn(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=yTe(e.view))}},{decorations:e=>e.deco}),hR=gf.low(S5e({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(eJe))===null||t===void 0?void 0:t.gutter)||_r.empty}}));function DEn(e,t){return e.field(CS,!1)!=t.field(CS,!1)}function LEn(e,t){return e.facet(sp)!=t.facet(sp)}const gTe=Wt.line({class:"cm-changedLine"}),FEn=Wt.mark({class:"cm-changedText"}),zEn=Wt.mark({tagName:"ins",class:"cm-insertedLine"}),BEn=Wt.mark({tagName:"del",class:"cm-deletedLine"}),bTe=new class extends Tp{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function UEn(e,t,n,r,s,a){let o=n?e.fromA:e.fromB,i=n?e.toA:e.toB,c=0;if(o!=i){s.add(o,o,gTe),s.add(o,i,n?BEn:zEn),a&&a.add(o,o,bTe);for(let u=t.iterRange(o,i-1),d=o;!u.next().done;){if(u.lineBreak){d++,s.add(d,d,gTe),a&&a.add(d,d,bTe);continue}let f=d+u.value.length;if(r)for(;c<e.changes.length;){let p=e.changes[c],h=o+(n?p.fromA:p.fromB),g=o+(n?p.toA:p.toB),b=Math.max(d,h),y=Math.min(f,g);if(b<y&&s.add(b,y,FEn),g<f)c++;else break}d=f}}}function yTe(e){let t=e.state.field(CS),{side:n,highlightChanges:r,markGutter:s,overrideChunk:a}=e.state.facet(sp),o=n=="a",i=new pc,c=s?new pc:null,{from:u,to:d}=e.viewport;for(let f of t){if((o?f.fromA:f.fromB)>=d)break;(o?f.toA:f.toB)>u&&(!a||!a(e.state,f,i,c))&&UEn(f,e.state.doc,o,r,i,c)}return{deco:i.finish(),gutter:c&&c.finish()}}class mR extends wu{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 Q2=Hn.define({map:(e,t)=>e.map(t)}),Ik=xo.define({create:()=>Wt.none,update:(e,t)=>{for(let n of t.effects)if(n.is(Q2))return n.value;return e.map(t.changes)},provide:e=>ct.decorations.from(e)}),gR=.01;function vTe(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 VEn(e,t,n){let r=new pc,s=new pc,a=e.state.field(Ik).iter(),o=t.state.field(Ik).iter(),i=0,c=0,u=0,d=0,f=e.viewport,p=t.viewport;for(let y=0;;y++){let x=y<n.length?n[y]:null,w=x?x.fromA:e.state.doc.length,O=x?x.fromB:t.state.doc.length;if(i<w){let k=e.lineBlockAt(i).top+u,E=t.lineBlockAt(c).top+d,C=k-E;C<-gR?(u-=C,r.add(i,i,Wt.widget({widget:new mR(-C),block:!0,side:-1}))):C>gR&&(d+=C,s.add(c,c,Wt.widget({widget:new mR(C),block:!0,side:-1})))}if(w>i+1e3&&i<f.from&&w>f.from&&c<p.from&&O>p.from){let k=Math.min(f.from-i,p.from-c);i+=k,c+=k,y--}else if(x)i=x.toA,c=x.toB;else break;for(;a.value&&a.from<i;)u-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)d-=o.value.spec.widget.height,o.next()}for(;a.value;)u-=a.value.spec.widget.height,a.next();for(;o.value;)d-=o.value.spec.widget.height,o.next();let h=e.contentHeight+u-(t.contentHeight+d);h<gR?r.add(e.state.doc.length,e.state.doc.length,Wt.widget({widget:new mR(-h),block:!0,side:1})):h>gR&&s.add(t.state.doc.length,t.state.doc.length,Wt.widget({widget:new mR(h),block:!0,side:1}));let g=r.finish(),b=s.finish();vTe(g,e.state.field(Ik))||e.dispatch({effects:Q2.of(g)}),vTe(b,t.state.field(Ik))||t.dispatch({effects:Q2.of(b)})}const WY=Hn.define({map:(e,t)=>t.mapPos(e)});class qEn extends wu{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 s=t.posAtDOM(r.target);t.dispatch({effects:WY.of(s)});let{side:a,sibling:o}=t.state.facet(sp);o&&o().dispatch({effects:WY.of(HEn(s,t.state.field(CS),a=="a"))})}),n}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function HEn(e,t,n){let r=0,s=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return s+(e-r);[r,s]=n?[o.toA,o.toB]:[o.toB,o.toA]}}const QEn=xo.define({create(e){return Wt.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(WY)&&(e=e.update({filter:r=>r!=n.value}));return e},provide:e=>ct.decorations.from(e)});function xTe({margin:e=3,minSize:t=4}){return QEn.init(n=>GEn(n,e,t))}function GEn(e,t,n){let r=new pc,s=e.facet(sp).side=="a",a=e.field(CS),o=1;for(let i=0;;i++){let c=i<a.length?a[i]:null,u=i?o+t:1,d=c?e.doc.lineAt(s?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,Wt.replace({widget:new qEn(f),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,s?c.toA:c.toB)).number}return r.finish()}const WEn=ct.styleModule.of(new rm({".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"}})),ZEn=ct.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"}}),wTe=new t1,bR=new t1;class YEn{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig||$En;let n=[gf.low(eJe),ZEn,WEn,Ik,ct.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(p=>p.effects.some(h=>h.is(Q2)))&&this.measure()})],r=[sp.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&r.push(hR);let s=wr.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],ct.editorAttributes.of({class:"cm-merge-a"}),bR.of(r),n]}),a=[sp.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&a.push(hR);let o=wr.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],ct.editorAttributes.of({class:"cm-merge-b"}),bR.of(a),n]});this.chunks=Sw.build(s.doc,o.doc,this.diffConf);let i=[CS.init(()=>this.chunks),wTe.of(t.collapseUnchanged?xTe(t.collapseUnchanged):[])];s=s.update({effects:Hn.appendConfig.of(i)}).state,o=o.update({effects:Hn.appendConfig.of(i)}).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 ct({state:s,parent:u,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new ct({state:o,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],s=t.reduce((o,i)=>o.compose(i.changes),Co.empty(t[0].startState.doc.length));this.chunks=n==this.a?Sw.updateA(this.chunks,r.newDoc,this.b.state.doc,s,this.diffConf):Sw.updateB(this.chunks,this.a.state.doc,r.newDoc,s,this.diffConf),n.update([...t,r.state.update({effects:GY.of(this.chunks)})]);let a=n==this.a?this.b:this.a;a.update([a.state.update({effects:GY.of(this.chunks)})]),this.scheduleMeasure()}else n.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let a=t.orientation!="b-a";if(a!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let o=this.a.dom.parentNode,i=this.b.dom.parentNode;o.remove(),i.remove(),this.editorDOM.insertBefore(a?o:i,this.editorDOM.firstChild),this.editorDOM.appendChild(a?i:o),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let a=!!this.revertDOM,o=this.revertToA,i=this.renderRevert;"revertControls"in t&&(a=!!t.revertControls,o=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(i=t.renderRevertControl),this.setupRevertControls(a,o,i)}let n="highlightChanges"in t,r="gutter"in t,s="collapseUnchanged"in t;if(n||r||s){let a=[],o=[];if(n||r){let i=this.a.state.facet(sp),c=r?t.gutter!==!1:i.markGutter,u=n?t.highlightChanges!==!1:i.highlightChanges;a.push(bR.reconfigure([sp.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:c}),c?hR:[]])),o.push(bR.reconfigure([sp.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:c}),c?hR:[]]))}if(s){let i=wTe.reconfigure(t.collapseUnchanged?xTe(t.collapseUnchanged):[]);a.push(i),o.push(i)}this.a.dispatch({effects:a}),this.b.dispatch({effects:o})}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",s=>this.revertClicked(s)),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(){VEn(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,n=t.firstChild,r=this.a.viewport,s=this.b.viewport;for(let a=0;a<this.chunks.length;a++){let o=this.chunks[a];if(o.fromA>r.to||o.fromB>s.to)break;if(o.fromA<r.from||o.fromB<s.from)continue;let i=this.a.lineBlockAt(o.fromA).top+"px";for(;n&&+n.dataset.chunk<a;)n=STe(n);n&&n.dataset.chunk==String(a)?(n.style.top!=i&&(n.style.top=i),n=n.nextSibling):t.insertBefore(this.renderRevertButton(i,a),n)}for(;n;)n=STe(n)}renderRevertButton(t,n){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let s=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",s),r.setAttribute("title",s),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[s,a,o,i,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=s.state.sliceDoc(o,Math.max(o,i-1));o!=i&&u<=a.state.doc.length&&(d+=s.state.lineBreak),a.dispatch({changes:{from:c,to:Math.min(a.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 STe(e){let t=e.nextSibling;return e.remove(),t}function tJe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=tJe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nJe(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=tJe(e))&&(r&&(r+=" "),r+=t);return r}const XEn=(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},KEn=(e,t)=>({classGroupId:e,validator:t}),rJe=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),G2="-",OTe=[],JEn="arbitrary..",eCn=e=>{const t=nCn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return tCn(o);const i=o.split(G2),c=i[0]===""&&i.length>1?1:0;return sJe(i,c,t)},getConflictingClassGroupIds:(o,i)=>{if(i){const c=r[o],u=n[o];return c?u?XEn(u,c):c:u||OTe}return n[o]||OTe}}},sJe=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=sJe(e,t+1,a);if(u)return u}const o=n.validators;if(o===null)return;const i=t===0?e.join(G2):e.slice(t).join(G2),c=o.length;for(let u=0;u<c;u++){const d=o[u];if(d.validator(i))return d.classGroupId}},tCn=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?JEn+r:void 0})(),nCn=e=>{const{theme:t,classGroups:n}=e;return rCn(n,t)},rCn=(e,t)=>{const n=rJe();for(const r in e){const s=e[r];roe(s,n,r,t)}return n},roe=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const o=e[a];sCn(o,t,n,r)}},sCn=(e,t,n,r)=>{if(typeof e=="string"){aCn(e,t,n);return}if(typeof e=="function"){oCn(e,t,n,r);return}iCn(e,t,n,r)},aCn=(e,t,n)=>{const r=e===""?t:aJe(t,e);r.classGroupId=n},oCn=(e,t,n,r)=>{if(lCn(e)){roe(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(KEn(n,e))},iCn=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let o=0;o<a;o++){const[i,c]=s[o];roe(c,aJe(t,i),n,r)}},aJe=(e,t)=>{let n=e;const r=t.split(G2),s=r.length;for(let a=0;a<s;a++){const o=r[a];let i=n.nextPart.get(o);i||(i=rJe(),n.nextPart.set(o,i)),n=i}return n},lCn=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,cCn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return s(a,o),o},set(a,o){a in n?n[a]=o:s(a,o)}}},ZY="!",kTe=":",uCn=[],_Te=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),dCn=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let o=0,i=0,c=0,u;const d=s.length;for(let b=0;b<d;b++){const y=s[b];if(o===0&&i===0){if(y===kTe){a.push(s.slice(c,b)),c=b+1;continue}if(y==="/"){u=b;continue}}y==="["?o++:y==="]"?o--:y==="("?i++:y===")"&&i--}const f=a.length===0?s:s.slice(c);let p=f,h=!1;f.endsWith(ZY)?(p=f.slice(0,-1),h=!0):f.startsWith(ZY)&&(p=f.slice(1),h=!0);const g=u&&u>c?u-c:void 0;return _Te(a,h,p,g)};if(t){const s=t+kTe,a=r;r=o=>o.startsWith(s)?a(o.slice(s.length)):_Te(uCn,!1,o,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},fCn=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const o=n[a],i=o[0]==="[",c=t.has(o);i||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},pCn=e=>({cache:cCn(e.cacheSize),parseClassName:dCn(e),sortModifiers:fCn(e),...eCn(e)}),hCn=/\s+/,mCn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,o=[],i=e.trim().split(hCn);let c="";for(let u=i.length-1;u>=0;u-=1){const d=i[u],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:b}=n(d);if(f){c=d+(c.length>0?" "+c:c);continue}let y=!!b,x=r(y?g.substring(0,b):g);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=r(g),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const w=p.length===0?"":p.length===1?p[0]:a(p).join(":"),O=h?w+ZY:w,k=O+x;if(o.indexOf(k)>-1)continue;o.push(k);const E=s(x,y);for(let C=0;C<E.length;++C){const N=E[C];o.push(O+N)}c=d+(c.length>0?" "+c:c)}return c},gCn=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=oJe(n))&&(s&&(s+=" "),s+=r);return s},oJe=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=oJe(e[r]))&&(n&&(n+=" "),n+=t);return n},ETe=(e,...t)=>{let n,r,s,a;const o=c=>{const u=t.reduce((d,f)=>f(d),e());return n=pCn(u),r=n.cache.get,s=n.cache.set,a=i,i(c)},i=c=>{const u=r(c);if(u)return u;const d=mCn(c,n);return s(c,d),d};return a=o,(...c)=>a(gCn(...c))},bCn=[],Bo=e=>{const t=n=>n[e]||bCn;return t.isThemeGetter=!0,t},iJe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lJe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yCn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,vCn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xCn=/\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$/,wCn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SCn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OCn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rg=e=>yCn.test(e),xr=e=>!!e&&!Number.isNaN(Number(e)),sg=e=>!!e&&Number.isInteger(Number(e)),eQ=e=>e.endsWith("%")&&xr(e.slice(0,-1)),Oh=e=>vCn.test(e),cJe=()=>!0,kCn=e=>xCn.test(e)&&!wCn.test(e),soe=()=>!1,_Cn=e=>SCn.test(e),ECn=e=>OCn.test(e),CCn=e=>!sn(e)&&!fn(e),TCn=e=>jb(e,fJe,soe),sn=e=>iJe.test(e),py=e=>jb(e,pJe,kCn),CTe=e=>jb(e,$Cn,xr),NCn=e=>jb(e,mJe,cJe),ACn=e=>jb(e,hJe,soe),TTe=e=>jb(e,uJe,soe),jCn=e=>jb(e,dJe,ECn),yR=e=>jb(e,gJe,_Cn),fn=e=>lJe.test(e),JO=e=>hx(e,pJe),RCn=e=>hx(e,hJe),NTe=e=>hx(e,uJe),ICn=e=>hx(e,fJe),PCn=e=>hx(e,dJe),vR=e=>hx(e,gJe,!0),MCn=e=>hx(e,mJe,!0),jb=(e,t,n)=>{const r=iJe.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},hx=(e,t,n=!1)=>{const r=lJe.exec(e);return r?r[1]?t(r[1]):n:!1},uJe=e=>e==="position"||e==="percentage",dJe=e=>e==="image"||e==="url",fJe=e=>e==="length"||e==="size"||e==="bg-size",pJe=e=>e==="length",$Cn=e=>e==="number",hJe=e=>e==="family-name",mJe=e=>e==="number"||e==="weight",gJe=e=>e==="shadow",ATe=()=>{const e=Bo("color"),t=Bo("font"),n=Bo("text"),r=Bo("font-weight"),s=Bo("tracking"),a=Bo("leading"),o=Bo("breakpoint"),i=Bo("container"),c=Bo("spacing"),u=Bo("radius"),d=Bo("shadow"),f=Bo("inset-shadow"),p=Bo("text-shadow"),h=Bo("drop-shadow"),g=Bo("blur"),b=Bo("perspective"),y=Bo("aspect"),x=Bo("ease"),w=Bo("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(),fn,sn],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],T=()=>[fn,sn,c],j=()=>[rg,"full","auto",...T()],R=()=>[sg,"none","subgrid",fn,sn],P=()=>["auto",{span:["full",sg,fn,sn]},sg,fn,sn],M=()=>[sg,"auto",fn,sn],U=()=>["auto","min","max","fr",fn,sn],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...T()],B=()=>[rg,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],H=()=>[rg,"screen","full","dvw","lvw","svw","min","max","fit",...T()],G=()=>[rg,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],L=()=>[e,fn,sn],Z=()=>[...k(),NTe,TTe,{position:[fn,sn]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",ICn,TCn,{size:[fn,sn]}],Q=()=>[eQ,JO,py],W=()=>["","none","full",u,fn,sn],J=()=>["",xr,JO,py],ne=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[xr,eQ,NTe,TTe],ce=()=>["","none",g,fn,sn],ve=()=>["none",xr,fn,sn],ee=()=>["none",xr,fn,sn],re=()=>[xr,fn,sn],ie=()=>[rg,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oh],breakpoint:[Oh],color:[cJe],container:[Oh],"drop-shadow":[Oh],ease:["in","out","in-out"],font:[CCn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oh],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oh],shadow:[Oh],spacing:["px",xr],text:[Oh],"text-shadow":[Oh],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",rg,sn,fn,y]}],container:["container"],columns:[{columns:[xr,sn,fn,i]}],"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:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:j()}],"inset-x":[{"inset-x":j()}],"inset-y":[{"inset-y":j()}],start:[{"inset-s":j(),start:j()}],end:[{"inset-e":j(),end:j()}],"inset-bs":[{"inset-bs":j()}],"inset-be":[{"inset-be":j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:["visible","invisible","collapse"],z:[{z:[sg,"auto",fn,sn]}],basis:[{basis:[rg,"full","auto",i,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xr,rg,"auto","initial","none",sn]}],grow:[{grow:["",xr,fn,sn]}],shrink:[{shrink:["",xr,fn,sn]}],order:[{order:[sg,"first","last","none",fn,sn]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":R()}],"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":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"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:[i,"screen",...B()]}],"min-w":[{"min-w":[i,"screen","none",...B()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[o]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,JO,py]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,MCn,NCn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eQ,sn]}],"font-family":[{font:[RCn,ACn,t]}],"font-features":[{"font-features":[sn]}],"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:[s,fn,sn]}],"line-clamp":[{"line-clamp":[xr,"none",fn,CTe]}],leading:[{leading:[a,...T()]}],"list-image":[{"list-image":["none",fn,sn]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fn,sn]}],"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:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[xr,"from-font","auto",fn,py]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[xr,"auto",fn,sn]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fn,sn]}],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",fn,sn]}],"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:z()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sg,fn,sn],radial:["",fn,sn],conic:[sg,fn,sn]},PCn,jCn]}],"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:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"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:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xr,fn,sn]}],"outline-w":[{outline:["",xr,JO,py]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,vR,yR]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,vR,yR]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[xr,py]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,vR,yR]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[xr,fn,sn]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"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":[xr]}],"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":[fn,sn]}],"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":[xr]}],"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:z()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fn,sn]}],filter:[{filter:["","none",fn,sn]}],blur:[{blur:ce()}],brightness:[{brightness:[xr,fn,sn]}],contrast:[{contrast:[xr,fn,sn]}],"drop-shadow":[{"drop-shadow":["","none",h,vR,yR]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",xr,fn,sn]}],"hue-rotate":[{"hue-rotate":[xr,fn,sn]}],invert:[{invert:["",xr,fn,sn]}],saturate:[{saturate:[xr,fn,sn]}],sepia:[{sepia:["",xr,fn,sn]}],"backdrop-filter":[{"backdrop-filter":["","none",fn,sn]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[xr,fn,sn]}],"backdrop-contrast":[{"backdrop-contrast":[xr,fn,sn]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xr,fn,sn]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xr,fn,sn]}],"backdrop-invert":[{"backdrop-invert":["",xr,fn,sn]}],"backdrop-opacity":[{"backdrop-opacity":[xr,fn,sn]}],"backdrop-saturate":[{"backdrop-saturate":[xr,fn,sn]}],"backdrop-sepia":[{"backdrop-sepia":["",xr,fn,sn]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fn,sn]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xr,"initial",fn,sn]}],ease:[{ease:["linear","initial",x,fn,sn]}],delay:[{delay:[xr,fn,sn]}],animate:[{animate:["none",w,fn,sn]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,fn,sn]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ee()}],"scale-x":[{"scale-x":ee()}],"scale-y":[{"scale-y":ee()}],"scale-z":[{"scale-z":ee()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[fn,sn,"","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",fn,sn]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",fn,sn]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[xr,JO,py,CTe]}],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"]}},DCn=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(Pk(e,"cacheSize",t),Pk(e,"prefix",n),Pk(e,"experimentalParseClassName",r),xR(e.theme,a.theme),xR(e.classGroups,a.classGroups),xR(e.conflictingClassGroups,a.conflictingClassGroups),xR(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Pk(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),wR(e.theme,s.theme),wR(e.classGroups,s.classGroups),wR(e.conflictingClassGroups,s.conflictingClassGroups),wR(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),bJe(e,s,"orderSensitiveModifiers"),e),Pk=(e,t,n)=>{n!==void 0&&(e[t]=n)},xR=(e,t)=>{if(t)for(const n in t)Pk(e,n,t[n])},wR=(e,t)=>{if(t)for(const n in t)bJe(e,t,n)},bJe=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},LCn=(e,...t)=>typeof e=="function"?ETe(ATe,e,...t):ETe(()=>DCn(ATe(),e),...t),FCn=Object.keys({...dDe,...gwt}),zCn=Object.keys(Swt),BCn=Object.keys(bwt),UCn=Object.keys(ywt),VCn=Object.keys(mwt),hy=Object.keys(wwt),qCn=Object.keys(vwt).concat(Object.keys(xwt)),HCn=LCn({extend:{theme:{color:FCn,spacing:zCn,radius:VCn,leading:UCn,shadow:qCn},classGroups:{"font-size":[{text:BCn}],h:[{h:hy}],w:[{w:hy}],size:[{size:hy}],"min-h":[{"min-h":hy}],"min-w":[{"min-w":hy}],"max-h":[{"max-h":hy}],"max-w":[{"max-w":hy}]}}});function K(...e){return HCn(nJe(e))}const Wi={sm:"h-form-sm",md:"h-form-md",default:"h-form-default",lg:"h-form-lg"},uN="focus:outline-none focus:ring-1 focus:ring-accent1 focus:shadow-focus-ring transition-shadow duration-normal",QCn="focus-within:outline-none focus-within:ring-1 focus-within:ring-accent1 focus-within:shadow-focus-ring transition-shadow duration-normal",GCn="rounded-md",aoe="bg-surface2 border-2 border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 rounded-lg",ooe="outline-none focus-visible:outline-none focus-visible:border-accent1 focus-visible:ring-1 focus-visible:ring-accent1/40",ioe="disabled:opacity-50 disabled:cursor-not-allowed",WCn={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"},Oe=({children:e,className:t,size:n="default",...r})=>l.jsx("span",{className:K("block",WCn[n],t),...r,children:e}),ui=jbt,Qn=Rbt,Gn=Ibt,Bn=S.forwardRef(({className:e,sideOffset:t=4,children:n,...r},s)=>l.jsx(Pbt,{children:l.jsxs(v$e,{ref:s,sideOffset:t,className:K("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(Mbt,{className:"fill-surface6"})]})}));Bn.displayName=v$e.displayName;const ZCn={sm:`${Wi.sm} w-form-sm`,md:`${Wi.md} w-form-md`,lg:`${Wi.lg} w-form-lg`,default:`${Wi.default}`},YCn={sm:"sm",md:"default",lg:"lg",default:"default"},XCn={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"},KCn="border border-border1 inline-flex items-center justify-center rounded-md transition-all duration-normal ease-out-custom active:scale-[0.98]",Ms=be.forwardRef(({className:e,children:t,tooltip:n,size:r="md",variant:s="default",disabled:a,...o},i)=>l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx("button",{ref:i,disabled:a,"aria-label":typeof n=="string"?n:void 0,className:K(KCn,uN,XCn[s],ZCn[r],a&&"active:scale-100",e),...o,children:l.jsx(Oe,{size:YCn[r],children:t})})}),l.jsx(Bn,{children:n})]}));Ms.displayName="IconButton";const JCn={"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"},eTn={mono:"font-mono"},ke=({as:e="p",className:t,variant:n="ui-md",font:r,...s})=>l.jsx(e,{className:K(JCn[n],r&&eTn[r],t),...s}),$n={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"},Rb={visible:"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring"},tTn={sm:"h-avatar-sm w-avatar-sm",md:"h-avatar-md w-avatar-md",lg:"h-avatar-lg w-avatar-lg"},yJe=({src:e,name:t,size:n="sm",interactive:r=!1})=>l.jsx("div",{className:K(tTn[n],"border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",$n.all,r&&"cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"),children:e?l.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover"}):l.jsx(ke,{variant:"ui-md",className:"text-center text-neutral4",children:t[0].toUpperCase()})}),V4=({copiedDuration:e=1500}={})=>{const[t,n]=S.useState(!1);return{isCopied:t,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{n(!0),setTimeout(()=>n(!1),e)})}}},nTn=M2t({style:QJ.coldarkDark,customStyle:{margin:0,backgroundColor:"black"}}),rTn=()=>l.jsx(Jkt,{remarkPlugins:[O4e],className:"aui-md",components:oTn}),jTe=S.memo(rTn),sTn=({language:e,code:t})=>{const{isCopied:n,copyToClipboard:r}=V4(),s=()=>{!t||n||r(t)};return l.jsxs("div",{style:{background:"hsl(0 0% 100% / 0.06)",borderTopRightRadius:"0.5rem",borderTopLeftRadius:"0.5rem",marginTop:"0.5rem",border:"1px solid hsl(0 0% 20.4%)",borderBottom:"none"},className:"flex items-center justify-between gap-4 px-4 py-2 text-sm font-semibold text-white",children:[l.jsx("span",{className:"lowercase [&>span]:text-xs",children:e}),l.jsx(Ms,{variant:"light",size:"md",tooltip:"Copy",onClick:s,children:l.jsxs("span",{className:"grid",children:[l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",n?"scale-100":"scale-0"),children:l.jsx(Os,{size:14})},"checkmark"),l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",n?"scale-0":"scale-100"),children:l.jsx(Xi,{size:14})},"copy")]})})]})},aTn=({alt:e,src:t,...n})=>{const[r,s]=S.useState(!1);return S.useEffect(()=>{s(!1)},[t]),r||!t?l.jsxs("div",{children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",width:"150",height:"150",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})}),l.jsx("p",{className:"text-xs italic text-neutral3 -mt-2.5 mb-2.5",children:"Image link is broken"})]}):l.jsx("img",{src:t,alt:e,...n,onError:()=>{s(!0)}})},oTn=Dkt({h1:({className:e,...t})=>l.jsx("h1",{className:K("mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",e),...t,style:{marginBottom:"2rem"}}),h2:({className:e,...t})=>l.jsx("h2",{className:K("mb-4 mt-8 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"2rem"}}),h3:({className:e,...t})=>l.jsx("h3",{className:K("scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1.5rem"}}),h4:({className:e,...t})=>l.jsx("h4",{className:K("scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1.5rem"}}),h5:({className:e,...t})=>l.jsx("h5",{className:K("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),h6:({className:e,...t})=>l.jsx("h6",{className:K("font-semibold first:mt-0 last:mb-0",e),...t,style:{marginBottom:"1rem",marginTop:"1rem"}}),p:({className:e,...t})=>l.jsx("p",{className:K("leading-7 first:mt-0 last:mb-0",e),...t}),a:({className:e,...t})=>l.jsx("a",{className:K("text-neutral6 font-medium underline underline-offset-4",e),...t}),blockquote:({className:e,...t})=>l.jsx("blockquote",{className:K("border-l-2 pl-6 italic",e),...t}),ul:({className:e,...t})=>l.jsx("ul",{className:K("my-5 ml-6 list-disc [&>li]:mt-2",e),...t}),ol:({className:e,...t})=>l.jsx("ol",{className:K("my-5 ml-6 list-decimal [&>li]:mt-2",e),...t}),hr:({className:e,...t})=>l.jsx("hr",{className:K("my-5 border-b",e),...t}),table:({className:e,...t})=>l.jsx("table",{className:K("my-5 w-full border-separate border-spacing-0 overflow-y-auto",e),...t}),th:({className:e,...t})=>l.jsx("th",{className:K("bg-surface4 px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),td:({className:e,...t})=>l.jsx("td",{className:K("border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",e),...t}),tr:({className:e,...t})=>l.jsx("tr",{className:K("m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",e),...t}),sup:({className:e,...t})=>l.jsx("sup",{className:K("[&>a]:text-xs [&>a]:no-underline",e),...t}),pre:({className:e,...t})=>l.jsx("pre",{...t,style:{borderBottomRightRadius:"0.5rem",borderBottomLeftRadius:"0.5rem",background:"transparent",fontSize:"0.875rem",marginBottom:"0.5rem",border:"1px solid hsl(0 0% 20.4%)"},className:K("overflow-x-auto p-4 text-white",e)}),code:function({className:t,...n}){const r=XDe();return l.jsxs("pre",{style:{fontSize:"0.875rem",display:"inline"},children:[l.jsx("code",{className:K(!r&&"bg-surface4 rounded border font-semibold",t),...n,style:{fontWeight:"400",paddingBlock:r?0:"0.1em",paddingInline:r?0:"0.3em"}})," "]})},CodeHeader:sTn,SyntaxHighlighter:nTn,img:aTn}),iTn=({reason:e,tripwire:t})=>{const[n,r]=S.useState(!1),s=t&&(t.retry!==void 0||t.tripwirePayload||t.processorId);return l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[l.jsxs("div",{className:"flex items-start gap-3 p-4",children:[l.jsx(nT,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),l.jsx("p",{className:"text-sm text-amber-300/90",children:e})]})]}),s&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>r(!n),className:"w-full flex items-center gap-2 px-4 py-2 text-xs text-amber-400/70 hover:text-amber-400 hover:bg-amber-900/20 transition-colors border-t border-amber-500/20",children:[n?l.jsx(xs,{className:"w-3.5 h-3.5"}):l.jsx(qs,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:"Details"})]}),n&&l.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-amber-500/20 bg-amber-950/10",children:[t.retry!==void 0&&l.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[l.jsx(tT,{className:"w-3.5 h-3.5 text-amber-400/60"}),l.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",t.retry?l.jsx("span",{className:"text-green-400",children:"Allowed"}):l.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),t.processorId&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(SJ,{className:"w-3.5 h-3.5 text-amber-400/60"}),l.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",l.jsx("code",{className:"px-1.5 py-0.5 rounded bg-amber-900/30 text-amber-200 font-mono",children:t.processorId})]})]}),t.tripwirePayload!==void 0&&t.tripwirePayload!==null&&l.jsxs("div",{className:"pt-1",children:[l.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),l.jsx("pre",{className:"text-xs text-amber-200/80 bg-amber-900/30 rounded p-2 overflow-x-auto font-mono",children:String(JSON.stringify(t.tripwirePayload,null,2))})]})]})]})]})},so=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"})]}),vJe=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)"})})})]}),lTn=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"})]}),loe=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"})]}),coe=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"})]}),_a=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"})}),uoe=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)"})})})]}),xJe=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)"})})})]}),cTn=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"})]}),wJe=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"})}),uTn=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"})}),doe=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"})}),dTn=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"})}),Ti=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"})}),w1=e=>l.jsx(cwt,{...e}),tl=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"})}),fTn=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"})]}),yu=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"})]}),pTn=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"})}),hTn=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"})]}),mTn=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 Zy(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 gTn={warning:"bg-accent6Darker border-accent6/30 text-accent6",destructive:"bg-accent2Darker border-accent2/30 text-accent2",info:"bg-accent5Darker border-accent5/30 text-accent5"},bTn={warning:Nl,destructive:Zd,info:Hi},Kd=({children:e,variant:t="destructive",className:n})=>{const r=bTn[t];return l.jsx("div",{className:K(gTn[t],"p-3 rounded-md border shadow-sm",$n.all,"animate-in fade-in-0 slide-in-from-top-2 duration-200",n),children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Oe,{className:"mt-0.5 flex-shrink-0",children:l.jsx(r,{})}),l.jsx("div",{className:"text-neutral4",children:e})]})})},Jd=({children:e,as:t="h5"})=>l.jsx(ke,{as:t,variant:"ui-md",className:"font-semibold",children:e}),db=({children:e,as:t="p"})=>l.jsx(ke,{as:t,variant:"ui-sm",children:e}),yTn={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"},vTn={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,...s})=>l.jsxs("div",{className:K("font-mono text-ui-sm gap-1 h-badge-default inline-flex items-center rounded-full border border-border1 shrink-0",$n.colors,e?"pl-2 pr-2.5":"px-2.5",t==="default"&&e?"bg-surface4 text-neutral5":yTn[t],n),...s,children:[e&&l.jsx("span",{className:vTn[t],children:l.jsx(Oe,{children:e})}),r]}),xTn=()=>{const e=zn(({part:o})=>o),[t,n]=S.useState(!1),r=e.text||"",s=e.metadata||{};if(s?.status==="tripwire")return l.jsx(iTn,{reason:r,tripwire:s.tripwire});if(s?.status==="warning")return l.jsxs(Kd,{variant:"warning",children:[l.jsx(Jd,{as:"h5",children:"Warning"}),l.jsx(db,{as:"p",children:r})]});if(s?.status==="error")return l.jsxs(Kd,{variant:"destructive",children:[l.jsx(Jd,{as:"h5",children:"Error"}),l.jsx(db,{as:"p",children:r})]});const a=s?.completionResult;if(a)return l.jsxs("div",{className:"mb-2 space-y-2",children:[l.jsxs("button",{onClick:()=>n(o=>!o),className:"flex items-center gap-2",children:[l.jsx(Oe,{children:l.jsx(Yv,{className:K("transition-all",t?"rotate-90":"rotate-180")})}),l.jsxs(ut,{variant:"info",icon:l.jsx(gJ,{}),children:[t?"Show":"Hide"," completion check"]})]}),!t&&l.jsxs(Kd,{variant:"info",children:[l.jsx(Jd,{as:"h5",children:a?.passed?"Complete":"Not Complete"}),l.jsx(jTe,{})]})]});try{const o=r.trim();if(o.startsWith("__ERROR__:")){const i=o.substring(10);return l.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[l.jsx(Zd,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),l.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i})]})]})}else if(o.startsWith("Error:")){const i=o.substring(6).trim();return l.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[l.jsx(Zd,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),l.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i})]})]})}return l.jsx(jTe,{})}catch{return l.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900/50",children:[l.jsx(Zd,{className:"w-5 h-5 text-red-500 dark:text-red-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Error"}),l.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:String(r)})]})]})}},Bc="mastra_workspace",Jf={FILESYSTEM:{READ_FILE:`${Bc}_read_file`,WRITE_FILE:`${Bc}_write_file`,EDIT_FILE:`${Bc}_edit_file`,LIST_FILES:`${Bc}_list_files`,DELETE:`${Bc}_delete`,FILE_STAT:`${Bc}_file_stat`,MKDIR:`${Bc}_mkdir`},SANDBOX:{EXECUTE_COMMAND:`${Bc}_execute_command`,GET_PROCESS_OUTPUT:`${Bc}_get_process_output`,KILL_PROCESS:`${Bc}_kill_process`},SEARCH:{SEARCH:`${Bc}_search`,INDEX:`${Bc}_index`}},wTn={duration:5e3,cancel:{label:l.jsx(Oe,{children:l.jsx(Gr,{})}),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 cu(e){const{classNames:t,...n}=wTn,{classNames:r,...s}=e||{};return{...n,classNames:{...t,title:K(t?.title,r?.title),toast:K(t?.toast,r?.toast),cancelButton:K(t?.cancelButton,r?.cancelButton),actionButton:K(t?.actionButton,r?.actionButton),description:K(t?.description,r?.description)},...s}}const qe=(e,t={})=>{if(Array.isArray(e))return e.forEach(n=>Yi(n,cu(t)));if(be.isValidElement(e))return Yi(e,cu(t));if(typeof e=="string")return Yi(e,cu(t));throw new Error("Invalid message type")};qe.success=(e,t={})=>{const n={...t,icon:l.jsx(Oe,{className:"text-accent1 shrink-0",children:l.jsx(bJ,{})}),classNames:{...t.classNames,toast:K("bg-accent1Darker border-accent1/30 border-l-[3px] border-l-accent1",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Yi.success(e,cu(n));case"object":return e.forEach(r=>Yi.success(r,cu(n)))}};qe.error=(e,t={})=>{const n={...t,icon:l.jsx(Oe,{className:"text-accent2 shrink-0",children:l.jsx(Pw,{})}),classNames:{...t.classNames,toast:K("bg-accent2Darker border-accent2/30 border-l-[3px] border-l-accent2",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Yi.error(e,cu(n));case"object":return e.forEach(r=>Yi.error(r,cu(n)))}};qe.warning=(e,t={})=>{const n={...t,icon:l.jsx(Oe,{className:"text-accent6 shrink-0",children:l.jsx(Zd,{})}),classNames:{...t.classNames,toast:K("bg-accent6Darker border-accent6/30 border-l-[3px] border-l-accent6",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Yi.warning(e,cu(n));case"object":return e.forEach(r=>Yi.warning(r,cu(n)))}};qe.info=(e,t={})=>{const n={...t,icon:l.jsx(Oe,{className:"text-accent3 shrink-0",children:l.jsx(Hi,{})}),classNames:{...t.classNames,toast:K("bg-accent3Darker border-accent3/30 border-l-[3px] border-l-accent3",t.classNames?.toast),title:K("text-xs text-neutral5",t.classNames?.title),description:K("text-xs text-neutral4",t.classNames?.description)}};switch(typeof e){case"string":return Yi.info(e,cu(n));case"object":return e.forEach(r=>Yi.info(r,cu(n)))}};qe.custom=(e,t={})=>Yi(e,cu(t));qe.dismiss=e=>{e&&Yi.dismiss(e)};qe.promise=({myPromise:e,loadingMessage:t,successMessage:n,errorMessage:r,onSuccess:s,onError:a,options:o={}})=>Yi.promise(e,{loading:t??"Loading...",success:i=>(s?.(i),n),error:i=>(a?.(i),r||i?.message||"Error..."),...cu(o)});function pd({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=S.useState(!1),s=S.useRef(null),a=S.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{qe.success(t),r(!0),s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{qe.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:a}}const STn={sm:`${Wi.sm} text-ui-sm px-[.75em]`,md:`${Wi.md} text-ui-md px-[.75em]`,default:`${Wi.default} text-ui-md px-[.85em] `,lg:`${Wi.lg} text-ui-lg px-[1em] `},OTn={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:aoe,light:"",outline:""},kTn=K("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",ioe,ooe),_Tn={light:"default",outline:"default"};function ETn(e){return _Tn[e]??e}function S1(e){const t=ETn(e?.variant||"default"),n=e?.size||"default";return K(kTn,OTn[t],STn[n],e?.iconOnly&&"[&>svg]:opacity-75")}function SJe(e){const t=[];return be.Children.forEach(e,n=>{be.isValidElement(n)&&n.type===be.Fragment?t.push(...SJe(n.props.children)):t.push(n)}),t}function CTn(e){const t=SJe(e);return t.length>0&&t.every(n=>be.isValidElement(n))}const he=be.forwardRef(({className:e,as:t,size:n="default",variant:r="default",disabled:s,children:a,...o},i)=>{const c=t||"button",u=CTn(a);return l.jsx(c,{ref:i,disabled:s,className:K(S1({variant:r,size:n,iconOnly:u}),e),...o,children:a})});he.displayName="Button";const Bv=be.forwardRef(({tooltipContent:e,...t},n)=>l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx(he,{ref:n,...t})}),e&&l.jsx(Bn,{children:e})]}));Bv.displayName="ButtonWithTooltip";function oi({content:e,copyMessage:t,tooltip:n="Copy to clipboard",size:r="sm",className:s}){const[a,o]=S.useState(!1),{handleCopy:i}=pd({text:e,copyMessage:t}),c=()=>{i(),o(!0),setTimeout(()=>o(!1),2e3)};return l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx(he,{onClick:c,type:"button",size:r,className:s,"aria-label":a?"Copied!":n,children:a?l.jsx(Os,{}):l.jsx(Xi,{})})}),l.jsx(Bn,{children:a?"Copied!":n})]})}const TTn=/\{\{([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}\}/g,NTn=Wt.mark({class:"cm-variable-highlight"}),RTe=new y5e({regexp:TTn,decoration:()=>NTn}),ATn=Ua.fromClass(class{decorations;constructor(e){this.decorations=RTe.createDeco(e)}update(e){this.decorations=RTe.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}),jTn=ATn;function RTn(e,t=5){if(!e?.properties)return[];const n=[];function r(s,a,o){if(o>t)return;const i=Array.isArray(s.type)?s.type.join(" | "):s.type;if(n.push({path:a,label:a,description:s.description??s.title,type:i}),s.properties)for(const[c,u]of Object.entries(s.properties))r(u,`${a}.${c}`,o+1);if(s.items?.properties)for(const[c,u]of Object.entries(s.items.properties))r(u,`${a}[].${c}`,o+1)}for(const[s,a]of Object.entries(e.properties))r(a,s,1);return n}function ITn(e){const t=RTn(e);return nLe({override:[PTn(t)],defaultKeymap:!0,closeOnBlur:!0,icons:!1})}function PTn(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 s=r[1]??"",a=t.pos-s.length,o=s?e.filter(c=>c.path.toLowerCase().startsWith(s.toLowerCase())):e;if(o.length===0)return null;const i=o.map(c=>({label:c.path,displayLabel:c.path,detail:c.type,info:c.description,apply:(u,d,f,p)=>{const b=u.state.sliceDoc(p,p+2)==="}}"?d.label:`${d.label}}}`;u.dispatch({changes:{from:f,to:p,insert:b},selection:{anchor:f+b.length}})}}));return{from:a,options:i,validFor:/^[a-zA-Z0-9_.\[\]]*$/}}}const ym=()=>S.useMemo(()=>{const e=$$({settings:{fontFamily:"var(--geist-mono)",fontSize:"0.8rem",lineHighlight:"transparent",gutterBackground:"transparent",gutterForeground:"var(--neutral2)",background:"transparent",foreground:"var(--neutral6)"},styles:[{tag:[le.className,le.propertyName],color:"var(--neutral6)"},{tag:le.heading,color:"var(--accent3)",fontWeight:"bold"},{tag:[le.heading1,le.heading2,le.heading3,le.heading4,le.heading5,le.heading6],color:"var(--accent3)",fontWeight:"bold"},{tag:le.emphasis,fontStyle:"italic",color:"var(--neutral6)"},{tag:le.strong,fontWeight:"bold",color:"var(--neutral6)"},{tag:le.link,color:"var(--accent3)",textDecoration:"underline"},{tag:le.url,color:"var(--accent3)"},{tag:le.monospace,color:"var(--neutral6)"},{tag:le.strikethrough,textDecoration:"line-through"},{tag:le.quote,fontStyle:"italic",color:"var(--neutral2)"}]}),t=ct.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]},[]),ea=S.forwardRef(({data:e,value:t,onChange:n,showCopyButton:r=!0,className:s,language:a="json",highlightVariables:o=!1,placeholder:i,wordWrap:c=!1,schema:u,autoFocus:d,...f},p)=>{const h=ym(),g=e?JSON.stringify(e,null,2):t??"",b=S.useMemo(()=>{const y=[];return a==="json"?y.push(au):a==="markdown"&&(y.push(ste({base:gv,codeLanguages:k6e})),y.push(ct.lineWrapping)),o&&a==="markdown"&&y.push(jTn),u&&a==="markdown"&&y.push(ITn(u)),y},[a,o,u]);return l.jsxs("div",{className:K("rounded-md bg-surface3 p-1 font-mono relative border border-border1 overflow-hidden",s),...f,children:[r&&l.jsx(oi,{content:g,className:"absolute top-2 right-2 z-20"}),l.jsx(pu,{ref:p,value:g,theme:h,extensions:b,onChange:n,"aria-label":"Code editor",placeholder:i,height:"100%",style:{height:"100%"},autoFocus:d})]})});async function MTn(e,t){const{codeToTokens:n,bundledLanguages:r}=await He(async()=>{const{codeToTokens:a,bundledLanguages:o}=await import("./index-wIotD8Zx.js");return{codeToTokens:a,bundledLanguages:o}},__vite__mapDeps([26,1]),import.meta.url);if(!(t in r))return null;const{tokens:s}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return s}const q4=({children:e,initialCollapsed:t=!0,icon:n,title:r,collapsible:s=!0,extraInfo:a,"data-testid":o})=>{const[i,c]=S.useState(t);return S.useEffect(()=>{c(t)},[t]),l.jsxs("div",{className:"mb-4","data-testid":o,children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between",children:[l.jsxs("button",{onClick:s?()=>c(u=>!u):void 0,className:"flex items-center gap-2 disabled:cursor-not-allowed",disabled:!s,type:"button",children:[l.jsx(Oe,{children:l.jsx(Yv,{className:K("transition-all",i?"rotate-90":"rotate-180")})}),l.jsx(ut,{icon:n,children:r})]}),a]}),!i&&l.jsx("div",{className:"pt-2",children:l.jsx("div",{className:"p-4 rounded-lg bg-surface2 flex flex-col gap-4",children:e})})]})},ds=RM,OJe=pIe,$Tn=IM,kJe=S.forwardRef(({className:e,...t},n)=>l.jsx(FC,{ref:n,className:K("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}));kJe.displayName=FC.displayName;const os=S.forwardRef(({className:e,children:t,...n},r)=>l.jsxs($Tn,{children:[l.jsx(kJe,{}),l.jsxs(zC,{ref:r,className:K("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($M,{className:K("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(Gr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));os.displayName=zC.displayName;const fs=({className:e,...t})=>l.jsx("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left border-b border-border1 pb-4 px-6",e),...t});fs.displayName="DialogHeader";const O1=({className:e,...t})=>l.jsx("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});O1.displayName="DialogFooter";const ps=({className:e,...t})=>l.jsx("div",{className:K("overflow-y-auto px-6 max-h-[50vh]",e),...t});ps.displayName="DialogBody";const is=S.forwardRef(({className:e,...t},n)=>l.jsx(PM,{ref:n,className:K("text-ui-md font-medium",e),...t}));is.displayName=PM.displayName;const da=S.forwardRef(({className:e,...t},n)=>l.jsx(MM,{ref:n,className:K("sr-only",e),...t}));da.displayName=MM.displayName;const DTn=({selectionReason:e,open:t,onOpenChange:n,input:r})=>{let s=null;if(r)try{s=typeof r=="object"?l.jsx(ea,{data:r}):l.jsx(ea,{data:JSON.parse(r)})}catch{s=l.jsx("pre",{className:"whitespace-pre-wrap",children:r})}return l.jsx(ds,{open:t,onOpenChange:n,children:l.jsxs(os,{children:[l.jsxs(fs,{children:[l.jsx(is,{children:"Agent Network Metadata"}),l.jsx(da,{children:"View the metadata of the agent's network choice."})]}),l.jsxs(ps,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ke,{className:"text-neutral3",children:"Selection Reason"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:e})]}),s&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(ke,{className:"text-neutral3",children:"Input"}),l.jsx("div",{className:"text-neutral6 text-ui-md",children:s})]})]})]})})},foe=({selectionReason:e,input:t})=>{const[n,r]=S.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(Ms,{variant:"light",size:"md",tooltip:"Show selection reason",onClick:()=>r(s=>!s),children:l.jsx(F0t,{className:"text-neutral3 size-5"})}),l.jsx(DTn,{selectionReason:e||"",open:n,onOpenChange:r,input:t})]})},_Je=S.createContext(void 0);function LTn({children:e,approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:o,isRunning:i,toolCallApprovals:c,networkToolCallApprovals:u}){return l.jsx(_Je.Provider,{value:{approveToolcall:t,declineToolcall:n,approveToolcallGenerate:r,declineToolcallGenerate:s,approveNetworkToolcall:a,declineNetworkToolcall:o,isRunning:i,toolCallApprovals:c,networkToolCallApprovals:u},children:e})}function FTn(){const e=S.useContext(_Je);if(!e)throw new Error("useToolCall must be used within a ToolCallProvider");return e}const dN=({toolCalled:e,toolCallId:t,toolApprovalMetadata:n,toolName:r,isNetwork:s,isGenerateMode:a})=>{const{approveToolcall:o,declineToolcall:i,approveToolcallGenerate:c,declineToolcallGenerate:u,isRunning:d,toolCallApprovals:f,approveNetworkToolcall:p,declineNetworkToolcall:h,networkToolCallApprovals:g}=FTn(),b=()=>{s?p(r,n?.runId):a?c(t):o(t)},y=()=>{s?h(r,n?.runId):a?u(t):i(t)},x=s?g?.[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:b,disabled:d||!!x,className:x==="approved"?"!text-accent1":"",children:[l.jsx(Oe,{children:l.jsx(Os,{})}),"Approve"]}),l.jsxs(he,{onClick:y,disabled:d||!!x,className:x==="declined"?"!text-accent2":"",children:[l.jsx(Oe,{children:l.jsx(Gr,{})}),"Decline"]})]})]}):null},zTn=({toolName:e,args:t,result:n,metadata:r,toolOutput:s,toolCallId:a,toolApprovalMetadata:o,suspendPayload:i,isNetwork:c,toolCalled:u})=>{let d=null;try{const{__mastraMetadata:y,...x}=typeof t=="object"?t:JSON.parse(t);d=l.jsx(ea,{data:x,"data-testid":"tool-args"})}catch{d=l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:t})}let f=typeof n=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:n}):l.jsx(ea,{data:n,"data-testid":"tool-result"}),p=typeof i=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:i}):l.jsx(ea,{data:i,"data-testid":"tool-suspend-payload"});const h=r?.mode==="network"?r.selectionReason:void 0,g=r?.mode==="network"?r.agentInput:void 0,b=u??(n||s.length>0);return l.jsx(q4,{"data-testid":"tool-badge",icon:l.jsx(Ti,{className:"text-accent6"}),title:e,extraInfo:r?.mode==="network"&&l.jsx(foe,{selectionReason:h||"",input:g}),initialCollapsed:!(o??i),children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool arguments"}),d]}),p!==void 0&&i&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool suspend payload"}),p]}),f!==void 0&&n&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool result"}),f]}),s.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Tool output"}),l.jsx("div",{className:"h-40 overflow-y-auto",children:l.jsx(ea,{data:s,"data-testid":"tool-output"})})]}),l.jsx(dN,{toolCalled:b,toolCallId:a,toolApprovalMetadata:o,toolName:e,isNetwork:c,isGenerateMode:r?.mode==="generate"})]})})},EJe=S.createContext({Link:S.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:()=>""}}),CJe=({children:e,Link:t,navigate:n,paths:r})=>l.jsx(EJe.Provider,{value:{Link:t,navigate:n,paths:r},children:e}),Lt=()=>{const e=S.useContext(EJe);if(!e)throw new Error("useLinkComponent must be used within a LinkComponentProvider");return e},BTn=e=>{switch(e){case"running":return"bg-green-500";case"starting":case"initializing":return"bg-yellow-500";case"stopped":case"paused":return"bg-gray-500";case"error":case"failed":return"bg-red-500";default:return"bg-accent6"}},UTn=(e,t)=>{const[n,r]=S.useState(0),s=S.useRef(null);return S.useEffect(()=>{if(e){r(0),s.current=t||Date.now();const a=setInterval(()=>{s.current&&r(Date.now()-s.current)},100);return()=>clearInterval(a)}else s.current=null},[e,t]),n},VTn=({command:e,content:t,maxHeight:n="20rem",onCopy:r,isCopied:s})=>{const a=S.useRef(null);return S.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[t]),l.jsxs("div",{className:"rounded-md border border-border1 overflow-hidden",children:[e&&l.jsxs("div",{className:"px-3 py-2 bg-surface3 border-b border-border1 flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("span",{className:"text-neutral6 text-xs shrink-0",children:"$"}),l.jsx("code",{className:"text-xs text-neutral-300 font-mono truncate",children:e})]}),r&&l.jsx(Ms,{variant:"light",size:"sm",tooltip:"Copy output",onClick:r,className:"shrink-0",children:l.jsxs("span",{className:"grid",children:[l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",s?"scale-100":"scale-0"),children:l.jsx(Os,{size:14})}),l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",s?"scale-0":"scale-100"),children:l.jsx(Xi,{size:14})})]})})]}),l.jsx("pre",{ref:a,style:{maxHeight:n},className:"overflow-x-auto overflow-y-auto p-3 text-sm text-neutral-300 font-mono whitespace-pre-wrap bg-black",children:t||l.jsx("span",{className:"text-neutral6 italic",children:"No output"})})]})},qTn=({toolName:e,args:t,result:n,metadata:r,toolCallId:s,toolApprovalMetadata:a,isNetwork:o,toolCalled:i})=>{const c=zn(G=>G.message),u=S.useMemo(()=>c.content.filter(L=>L.type==="data"),[c.content]),[d,f]=S.useState(!1),{isCopied:p,copyToClipboard:h}=V4(),{Link:g}=Lt(),b=u.find(G=>G.name==="sandbox-command"&&G.data?.toolCallId===s);let y="";try{const G=typeof t=="object"?t:JSON.parse(t);e===Jf.SANDBOX.EXECUTE_COMMAND?y=G.command||"":(e===Jf.SANDBOX.GET_PROCESS_OUTPUT||e===Jf.SANDBOX.KILL_PROCESS)&&(y=b?.data?.command||`PID ${G.pid}`)}catch{y=e}const x=u.filter(G=>(G.name==="sandbox-stdout"||G.name==="sandbox-stderr")&&G.data?.toolCallId===s),w=u.find(G=>G.name==="workspace-metadata"&&G.data?.toolCallId===s),O=w?.data,k=u.find(G=>G.name==="sandbox-exit"&&G.data?.toolCallId===s),E=!!k||typeof n=="string",C=!!w,N=C&&!E,T=i??(E||C),j=k?.data?.exitCode,R=k?.data?.success,P=k?.data?.executionTimeMs,M=k?.data?.killed,D=x.map(G=>G.data?.output||"").join("")||(typeof n=="string"?n:""),q=e===Jf.SANDBOX.EXECUTE_COMMAND?"Execute Command":e===Jf.SANDBOX.GET_PROCESS_OUTPUT?"Get Process Output":e===Jf.SANDBOX.KILL_PROCESS?"Kill Process":e,V=x[0]?.data?.timestamp,B=UTn(N,V),H=()=>{!D||p||h(D)};return l.jsxs("div",{className:"mb-4","data-testid":"sandbox-execution-badge",children:[l.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[l.jsxs("button",{onClick:()=>f(G=>!G),className:"flex items-center gap-2 min-w-0",type:"button",children:[l.jsx(Oe,{children:l.jsx(Yv,{className:K("transition-all",d?"rotate-90":"rotate-180")})}),l.jsx(ut,{icon:l.jsx(Q0t,{className:"text-accent6",size:16}),children:q}),O?.sandbox&&l.jsxs(g,{href:O.id?`/workspaces/${O.id}`:"/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",onClick:G=>G.stopPropagation(),children:[l.jsx("span",{className:K("w-1.5 h-1.5 rounded-full",BTn(O.sandbox.status))}),l.jsx("span",{children:O.sandbox.name||O.sandbox.provider})]})]}),l.jsx("div",{className:"flex items-center gap-2",children:N?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-accent6",children:[l.jsx("span",{className:"w-1.5 h-1.5 bg-accent6 rounded-full animate-pulse"}),l.jsx("span",{className:"animate-pulse",children:"running"})]}),l.jsxs("span",{className:"text-neutral6 text-xs tabular-nums",children:[B,"ms"]})]}):l.jsxs(l.Fragment,{children:[j!==void 0&&(R?l.jsx(Os,{className:"text-green-400",size:14}):M?l.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-orange-500/20 text-orange-400",children:"killed"}):l.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-500/20 text-red-400",children:["exit ",j]})),P!==void 0&&l.jsxs("span",{className:"text-neutral6 text-xs",children:[P,"ms"]})]})})]}),!d&&l.jsxs("div",{className:"pt-2",children:[(D||y)&&l.jsx(VTn,{command:y,content:D,onCopy:D?H:void 0,isCopied:p}),l.jsx(dN,{toolCalled:T,toolCallId:s,toolApprovalMetadata:a,toolName:e,isNetwork:o,isGenerateMode:r?.mode==="generate"})]})]})},HTn=({toolName:e,args:t,result:n,toolCallId:r,toolApprovalMetadata:s,isNetwork:a,toolCalled:o})=>{const[i,c]=S.useState(!s),{isCopied:u,copyToClipboard:d}=V4();S.useEffect(()=>{c(!s)},[s]);const{Link:f}=Lt();let p={path:"."};try{p=typeof t=="object"?t:JSON.parse(t)}catch{}const{path:h=".",maxDepth:g,showHidden:b,dirsOnly:y,exclude:x,extension:w}=p,O=[];g!==void 0&&g!==3&&O.push(`depth: ${g}`),b&&O.push("hidden"),y&&O.push("dirs only"),x&&O.push(`exclude: ${x}`),w&&O.push(`ext: ${w}`);let k="",E="";if(typeof n=="string"&&n){const M=n.lastIndexOf(`
|
|
426
426
|
|
|
427
427
|
`);M!==-1?(k=n.slice(0,M),E=n.slice(M+2)):k=n}const C=!!k,N=o??C,T=zn(M=>M.message),R=S.useMemo(()=>T.content.find(U=>U.type==="data"&&U.name==="workspace-metadata"&&U.data?.toolCallId===r),[T.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(Oe,{children:l.jsx(Yv,{className:K("transition-all",i?"rotate-90":"rotate-180")})}),l.jsxs(ut,{icon:l.jsx(pxt,{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(", "),")"]})]})]}),R?.filesystem&&l.jsxs(f,{href:R.id?`/workspaces/${R.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(pG,{className:"size-3"}),l.jsx("span",{children:R.name||R.filesystem.name})]}),i&&C&&E&&l.jsx("span",{className:"text-neutral6 text-xs",children:E})]}),!i&&l.jsxs("div",{className:"pt-2",children:[s&&!N&&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(ea,{data:p,"data-testid":"tool-args"})]}),l.jsx(dN,{toolCalled:N,toolCallId:r,toolApprovalMetadata:s,toolName:e,isNetwork:a})]}),N&&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(Ms,{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:K("transition-transform",u?"scale-100":"scale-0"),children:l.jsx(Os,{size:14})}),l.jsx("span",{style:{gridArea:"1/1"},className:K("transition-transform",u?"scale-0":"scale-100"),children:l.jsx(Xi,{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})]}),N&&!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 YY(e){const t={},n=e.context||{};Object.entries(n).forEach(([o,i])=>{if(o!=="input"&&"status"in i){const c=i,u=c.status==="failed"&&c.tripwire!==void 0;t[o]={status:c.status,output:"output"in c?c.output:void 0,payload:"payload"in c?c.payload:void 0,suspendPayload:"suspendPayload"in c?c.suspendPayload:void 0,suspendOutput:"suspendOutput"in c?c.suspendOutput:void 0,resumePayload:"resumePayload"in c?c.resumePayload:void 0,error:u?void 0:"error"in c?c.error:void 0,tripwire:u?c.tripwire:void 0,startedAt:"startedAt"in c?c.startedAt:Date.now(),endedAt:"endedAt"in c?c.endedAt:void 0,suspendedAt:"suspendedAt"in c?c.suspendedAt:void 0,resumedAt:"resumedAt"in c?c.resumedAt:void 0}}});const r=Object.entries(t).flatMap(([o,i])=>{if(i?.status==="suspended"){const c=i?.suspendPayload?.__workflow_meta?.path;return c?[[o,...c]]:[[o]]}return[]}),s=r?.[0]?.[0],a=s?t[s]?.suspendPayload:void 0;return{input:n.input,steps:t,status:e.status,...e.status==="success"?{result:e.result}:{},...e.status==="failed"?{error:e.error}:{},...e.status==="suspended"?{suspended:r,suspendPayload:a}:{},...e.status==="tripwire"&&e.tripwire?{tripwire:{reason:e.tripwire.reason,retry:e.tripwire.retry,metadata:e.tripwire.metadata,processorId:e.tripwire.processorId}}:{}}}const fN=()=>{const[e,t]=S.useState(!1),n=S.useCallback(r=>{if(r){const s=new IntersectionObserver(([a])=>{t(a.isIntersecting)});return s.observe(r),()=>s.disconnect()}},[]);return{inView:e,setRef:n}},Or=lK()(PWt(e=>({requestContext:{},theme:"dark",setRequestContext:t=>e({requestContext:t}),setTheme:t=>e({theme:t})}),{name:"mastra-playground-store"})),pN=e=>{const t=Xe(),{requestContext:n}=Or();return Qt({queryKey:["workflow",e],queryFn:()=>e?t.getWorkflow(e).details(n):null,enabled:!!e,retry:!1,refetchOnWindowFocus:!1,throwOnError:!1})},XY=20;function QTn(e,t,n){if(!(e.runs.length<XY))return n+1}function GTn(e){const t=new Set;return e.pages.flatMap(n=>n.runs).filter(n=>t.has(n.runId)?!1:(t.add(n.runId),!0))}const TJe=(e,{enabled:t=!0}={})=>{const n=Xe(),{inView:r,setRef:s}=fN(),a=p1({queryKey:["workflow-runs",e],queryFn:({pageParam:u})=>n.getWorkflow(e).runs({limit:XY,offset:u*XY}),initialPageParam:0,getNextPageParam:QTn,select:GTn,retry:!1,enabled:t,refetchInterval:5e3}),{hasNextPage:o,isFetchingNextPage:i,fetchNextPage:c}=a;return S.useEffect(()=>{r&&o&&!i&&c()},[r,o,i,c]),{...a,setEndOfListElement:s}},NJe=(e,t,n)=>{const r=Xe();return Qt({queryKey:["workflow-run",e,t],queryFn:()=>r.getWorkflow(e).runById(t),enabled:!!(e&&t),gcTime:0,staleTime:0,refetchInterval:n})},WTn=e=>{const t=Xe(),n=Ds();return qn({mutationFn:({runId:r})=>t.getWorkflow(e).deleteRunById(r),onSuccess:()=>{n.invalidateQueries({queryKey:["workflow-runs",e]}),qe.success("Workflow run deleted successfully")},onError:()=>{qe.error("Failed to delete workflow run")}})},AJe=S.createContext(null);function H4(){const e=S.useContext(AJe);if(!e)throw new Error("useWorkflowStepDetail must be used within WorkflowStepDetailProvider");return e}function ZTn({children:e}){const[t,n]=S.useState(null),r=S.useCallback(({stepName:o,stepId:i,mapConfig:c})=>{n({type:"map-config",stepName:o,stepId:i,mapConfig:c})},[]),s=S.useCallback(({label:o,stepGraph:i,fullStep:c})=>{n({type:"nested-graph",stepName:o,nestedGraph:{label:o,stepGraph:i,fullStep:c}})},[]),a=S.useCallback(()=>{n(null)},[]);return l.jsx(AJe.Provider,{value:{stepDetail:t,showMapConfig:r,showNestedGraph:s,closeStepDetail:a},children:e})}function YTn({entityId:e,entityType:t}){const[n,r]=S.useState(void 0),s=`tracing-options-${t}:${e}`;return S.useEffect(()=>{try{const i=localStorage.getItem(s);if(i){const c=JSON.parse(i);r(c||void 0)}}catch(i){console.error(i)}},[s]),{settings:n,setSettings:i=>{r(c=>({...c,...i})),localStorage.setItem(s,JSON.stringify({...i,entityId:e,entityType:t}))},resetAll:()=>{r(void 0),localStorage.removeItem(s)},entityType:t}}const jJe=S.createContext({setSettings:()=>{},resetAll:()=>{},settings:void 0,entityType:void 0}),poe=({children:e,entityId:t,entityType:n})=>{const r=YTn({entityId:t,entityType:n});return l.jsx(jJe.Provider,{value:r,children:e})},hoe=()=>S.useContext(jJe),Zp=S.createContext({});function moe({children:e,snapshot:t,workflowId:n,initialRunId:r,withoutTimeTravel:s=!1}){const[a,o]=S.useState(()=>t?YY(t):null),[i,c]=S.useState(()=>t?.context?.input??null),[u,d]=S.useState(()=>r??""),[f,p]=S.useState(!1),[h,g]=S.useState(!1),b=f||["success","failed","canceled","bailed"].includes(a?.status??"")?void 0:5e3,{isLoading:y,data:x}=NJe(n,r??"",b),w=S.useMemo(()=>x&&r?{context:{input:x?.payload,...x?.steps},status:x?.status,result:x?.result,error:x?.error,runId:r,serializedStepGraph:x?.serializedStepGraph,value:x?.initialState}:void 0,[x,r]),{data:O,isLoading:k,error:E}=pN(n),{settings:C}=hoe(),N=AWt(),{streamWorkflow:T,streamResult:j,isStreaming:R,observeWorkflowStream:P,closeStreamsAndReset:M,resumeWorkflowStream:U,timeTravelWorkflowStream:D}=NWt({debugMode:h,tracingOptions:C?.tracingOptions,onError:B=>qe.error(B.message)}),q=jWt(),V=()=>{o(null),c(null)};return S.useEffect(()=>{p(!1)},[r]),S.useEffect(()=>{w?.runId&&(o(YY(w)),w.value&&Object.keys(w.value).length>0?c({initialState:w.value,inputData:w.context?.input}):c(w.context?.input),d(w.runId))},[w]),l.jsx(Zp.Provider,{value:{workflowId:n,result:a,setResult:o,payload:i,setPayload:c,clearData:V,snapshot:t,runId:u,setRunId:d,workflowError:E??null,workflow:O??void 0,isLoading:k,createWorkflowRun:N.mutateAsync,streamWorkflow:B=>(p(!0),T.mutateAsync(B)),resumeWorkflow:B=>(p(!0),U.mutateAsync(B)),streamResult:j,isStreamingWorkflow:R,isCancellingWorkflowRun:q.isPending,cancelWorkflowRun:q.mutateAsync,observeWorkflowStream:B=>(p(!0),P.mutate(B)),closeStreamsAndReset:M,timeTravelWorkflowStream:B=>(p(!0),D.mutateAsync(B)),runSnapshot:w,isLoadingRunExecutionResult:y,withoutTimeTravel:s,debugMode:h,setDebugMode:g},children:l.jsx(ZTn,{children:e})})}function On({className:e,...t}){return l.jsx("div",{className:K("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 XTn=e=>e.replace(/[-_\s]+(.)?/g,(n,r)=>r?r.toUpperCase():"").replace(/^(.)/,n=>n.toLowerCase()).replace(/([A-Z])/g," $1").replace(/^./,n=>n.toUpperCase()).trim(),KTn=(e,t,n)=>{if(!e.startsWith("mapping_"))return e;const r=c=>c.split(" ").map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join(" "),s=c=>{const u=c.replace(/Step$/,"").replace(/[-_]/g," ").trim();return r(u)},a=(c,u)=>c.length===0?u?"End":"Start":c.length===1?s(c[0]):`${c.length} Steps`,o=a(t,!1),i=a(n,!0);return`${o} → ${i} Map`},JTn=(e,t)=>{const n=new hOe.graphlib.Graph().setDefaultEdgeLabel(()=>({}));n.setGraph({rankdir:"TB"}),t.forEach(a=>n.setEdge(a.source,a.target)),e.forEach(a=>n.setNode(a.id,{...a,width:a.measured?.width??274,height:a.measured?.height??(a?.data?.isLarge?260:100)})),hOe.layout(n);const r=n.graph()?.width?n.graph().width/2:0,s=n.graph()?.height?n.graph().height/2:0;return{nodes:e.map(a=>{const o=n.node(a.id),i=o.x-(a.measured?.width??274)/2,c=o.y-(a.measured?.height??(a?.data?.isLarge?260:100))/2;return{...a,position:{x:i,y:c}}}),edges:t,fullWidth:r,fullHeight:s}},Id={animated:!0,markerEnd:{type:zE.ArrowClosed,width:20,height:20,color:"#8e8e8e"}},KY=({stepFlow:e,xIndex:t,yIndex:n,prevNodeIds:r,prevStepIds:s,nextStepFlow:a,condition:o,allPrevNodeIds:i})=>{let c=[],u=[];if((a?.type==="step"||a?.type==="foreach"||a?.type==="loop")&&(c=[i?.includes(a.step.id)?`${a.step.id}-${n+1}`:a.step.id],u=[a.step.id]),(a?.type==="sleep"||a?.type==="sleepUntil")&&(c=[i?.includes(a.id)?`${a.id}-${n+1}`:a.id],u=[a.id]),a?.type==="parallel"&&(c=a?.steps.map(d=>{const f=d.step.id;return i?.includes(f)?`${f}-${n+1}`:f})||[],u=a?.steps.map(d=>d.step.id)||[]),a?.type==="conditional"&&(c=a?.serializedConditions.map(d=>d.id)||[],u=a?.steps?.map(d=>d.step.id)||[]),e.type==="step"||e.type==="foreach"){const d=e.step.component==="WORKFLOW",f=i?.includes(e.step.id)?`${e.step.id}-${n}`:e.step.id,p=[...o?[{id:o.id,position:{x:t*300,y:n*100},type:"condition-node",data:{label:o.id,previousStepId:s[s.length-1],nextStepId:e.step.id,withoutTopHandle:!r.length,withoutBottomHandle:!c.length,isLarge:!0,conditions:[{type:"when",fnString:o.fn}]}}]:[],{id:f,position:{x:t*300,y:(n+(o?1:0))*100},type:d?"nested-node":"default-node",data:{label:KTn(e.step.id,s,u),stepId:e.step.id,description:e.step.description,withoutTopHandle:o?!1:!r.length,withoutBottomHandle:!c.length,stepGraph:d?e.step.serializedStepFlow:void 0,mapConfig:e.step.mapConfig,canSuspend:e.step.canSuspend,isForEach:e.type==="foreach",metadata:e.step.metadata}}],h=[...o?[...(r||[]).map((g,b)=>({id:`e${g}-${o.id}`,source:g,data:{previousStepId:s[b],nextStepId:e.step.id},target:o.id,...Id})),{id:`e${o.id}-${f}`,source:o.id,data:{previousStepId:s[s.length-1],nextStepId:e.step.id,conditionNode:!0},target:f,...Id}]:(r||[]).map((g,b)=>({id:`e${g}-${f}`,source:g,data:{previousStepId:s[b],nextStepId:e.step.id},target:f,...Id})),...(c||[]).map((g,b)=>({id:`e${f}-${g}`,source:f,data:{previousStepId:e.step.id,nextStepId:u[b]},target:g,...Id}))];return{nodes:p,edges:h,nextPrevNodeIds:[f],nextPrevStepIds:[e.step.id]}}if(e.type==="sleep"||e.type==="sleepUntil"){const d=i?.includes(e.id)?`${e.id}-${n}`:e.id,f=[...o?[{id:o.id,position:{x:t*300,y:n*100},type:"condition-node",data:{label:o.id,previousStepId:s[s.length-1],nextStepId:e.id,withoutTopHandle:!1,withoutBottomHandle:!c.length,isLarge:!0,conditions:[{type:"when",fnString:o.fn}]}}]:[],{id:d,position:{x:t*300,y:(n+(o?1:0))*100},type:"default-node",data:{label:e.id,withoutTopHandle:o?!1:!r.length,withoutBottomHandle:!c.length,...e.type==="sleepUntil"?{date:e.date}:{duration:e.duration}}}],p=[...r.length?o?[...r.map((h,g)=>({id:`e${h}-${o.id}`,source:h,data:{previousStepId:s[g],nextStepId:e.id},target:o.id,...Id})),{id:`e${o.id}-${d}`,source:o.id,data:{previousStepId:s[s.length-1],nextStepId:e.id},target:d,...Id}]:r.map((h,g)=>({id:`e${h}-${d}`,source:h,data:{previousStepId:s[g],nextStepId:e.id},target:d,...Id})):[],...c.length?c.map((h,g)=>({id:`e${d}-${h}`,source:d,data:{previousStepId:e.id,nextStepId:u[g]},target:h,...Id})):[]];return{nodes:f,edges:p,nextPrevNodeIds:[d],nextPrevStepIds:[e.id]}}if(e.type==="loop"){const{step:d,serializedCondition:f,loopType:p}=e,h=d.component==="WORKFLOW",g=[{id:d.id,position:{x:t*300,y:n*100},type:h?"nested-node":"default-node",data:{label:d.id,description:d.description,withoutTopHandle:!r.length,withoutBottomHandle:!1,stepGraph:h?d.serializedStepFlow:void 0,canSuspend:d.canSuspend,metadata:d.metadata}},{id:f.id,position:{x:t*300,y:(n+1)*100},type:"condition-node",data:{label:f.id,previousStepId:d.id,nextStepId:u[0],withoutTopHandle:!1,withoutBottomHandle:!c.length,isLarge:!0,conditions:[{type:p,fnString:f.fn}]}}],b=[...r.length?r.map((y,x)=>({id:`e${y}-${d.id}`,source:y,data:{previousStepId:s[x],nextStepId:d.id},target:d.id,...Id})):[],{id:`e${d.id}-${f.id}`,source:d.id,data:{previousStepId:d.id,nextStepId:u[0]},target:f.id,...Id},...c.length?c.map((y,x)=>({id:`e${f.id}-${y}`,source:f.id,data:{previousStepId:d.id,nextStepId:u[x]},target:y,...Id})):[]];return{nodes:g,edges:b,nextPrevNodeIds:[f.id],nextPrevStepIds:[d.id]}}if(e.type==="parallel"){let d=[],f=[],p=[];return e.steps.forEach((h,g)=>{const{nodes:b,edges:y,nextPrevStepIds:x}=KY({stepFlow:h,xIndex:g,yIndex:n,prevNodeIds:r,prevStepIds:s,nextStepFlow:a,allPrevNodeIds:i}),w=b.map(O=>({...O,data:{...O.data,isParallel:!0}}));d.push(...w),f.push(...y),p.push(...x)}),{nodes:d,edges:f,nextPrevNodeIds:d.map(h=>h.id),nextPrevStepIds:p}}if(e.type==="conditional"){let d=[],f=[],p=[];return e.steps.forEach((h,g)=>{const{nodes:b,edges:y,nextPrevStepIds:x}=KY({stepFlow:h,xIndex:g,yIndex:n,prevNodeIds:r,prevStepIds:s,nextStepFlow:a,condition:e.serializedConditions[g],allPrevNodeIds:i});d.push(...b),f.push(...y),p.push(...x)}),{nodes:d,edges:f,nextPrevNodeIds:d.filter(({type:h})=>h!=="condition-node").map(h=>h.id),nextPrevStepIds:p}}return{nodes:[],edges:[],nextPrevNodeIds:[],nextPrevStepIds:[]}},RJe=({stepGraph:e})=>{if(!e)return{nodes:[],edges:[]};if(e.length===0)return{nodes:[],edges:[]};let t=[],n=[],r=[],s=[],a=[];for(let c=0;c<e.length;c++){const{nodes:u,edges:d,nextPrevNodeIds:f,nextPrevStepIds:p}=KY({stepFlow:e[c],xIndex:c,yIndex:c,prevNodeIds:r,prevStepIds:s,nextStepFlow:c===e.length-1?void 0:e[c+1],allPrevNodeIds:a});t.push(...u),n.push(...d),r=f,s=p,a.push(...r)}const{nodes:o,edges:i}=JTn(t,n);return{nodes:o,edges:i}},pf=idt,hd=be.forwardRef(({className:e,children:t,...n},r)=>l.jsx(xK,{ref:r,className:K("-outline-offset-2",$n.colors,Rb.visible,"hover:text-neutral5","[&>svg]:transition-transform [&>svg]:duration-normal [&>svg]:ease-out-custom","[&[data-state=open]>svg]:rotate-90",e),...n,children:t}));hd.displayName=xK.displayName;const md=be.forwardRef(({className:e,children:t,...n},r)=>l.jsx(SK,{ref:r,className:K("overflow-hidden","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-1","duration-normal ease-out-custom",e),...n,children:t}));md.displayName=SK.displayName;const mo={sleep:"#A855F7",forEach:"#F97316",map:"#F97316",parallel:"#3B82F6",suspend:"#EC4899",after:"#14B8A6",workflow:"#8B5CF6",when:"#ECB047",dountil:"#8B5CF6",dowhile:"#06B6D4",until:"#F59E0B",while:"#10B981",if:"#3B82F6",else:"#6B7280"},Qo={sleep:KI,sleepUntil:zyt,forEach:Mw,map:Mw,parallel:uDe,suspend:W$e,after:Xv,workflow:nDe,when:sDe,dountil:C0t,dowhile:N0t,until:KI,while:tT,if:tDe,else:Dvt},ITe=e=>{switch(e){case"when":return{icon:Qo.when,color:mo.when};case"dountil":return{icon:Qo.dountil,color:mo.dountil};case"dowhile":return{icon:Qo.dowhile,color:mo.dowhile};case"until":return{icon:Qo.until,color:mo.until};case"while":return{icon:Qo.while,color:mo.while};case"if":return{icon:Qo.if,color:mo.if};case"else":return{icon:Qo.else,color:mo.else};default:return{icon:void 0,color:void 0}}},IJe=e=>{const t=!!(e.duration||e.date),n=!!e.isForEach,r=!!(e.mapConfig&&!e.isForEach),s=!!e.stepGraph,a=t||e.canSuspend||e.isParallel||n||r||s;return{isSleepNode:t,isForEachNode:n,isMapNode:r,isNestedWorkflow:s,hasSpecialBadge:a}},PJe=(e,{enabled:t=!0})=>{const n=S.useRef(t);be.useEffect(()=>{if(!t||!e?.current)return;const r=e.current,s=new MutationObserver(()=>{n.current&&r.scrollTo({top:r.scrollHeight,behavior:"smooth"})});s.observe(r,{childList:!0,subtree:!0,characterData:!0});const a=o=>{const i=o.target,c=i.scrollTop+i.clientHeight,u=i.scrollHeight;c>=u-1?n.current=!0:n.current=!1};return r.addEventListener("scroll",a),()=>{r.removeEventListener("scroll",a),s.disconnect()}},[t,e])},Gs=S.forwardRef(({className:e,children:t,viewPortClassName:n,maxHeight:r,autoScroll:s=!1,...a},o)=>{const i=S.useRef(null);return PJe(i,{enabled:s}),l.jsxs(oMe,{ref:o,className:K("relative overflow-hidden",e),...a,children:[l.jsx(igt,{ref:i,className:K("h-full w-full rounded-[inherit] [&>div]:!block",n),style:r?{maxHeight:r}:void 0,children:t}),l.jsx(MJe,{}),l.jsx(lgt,{})]})});Gs.displayName=oMe.displayName;const MJe=S.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(XK,{ref:r,orientation:t,className:K("flex touch-none select-none transition-all duration-normal ease-out-custom","opacity-0 hover:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...n,children:l.jsx(tMe,{className:"relative flex-1 rounded-full bg-neutral2 hover:bg-neutral3 transition-colors duration-normal"})}));MJe.displayName=XK.displayName;const hN=()=>{const e=S.useContext(Zp),t=e.result?.steps??{};return{steps:Object.entries(t).reduce((r,[s,a])=>{const o="tripwire"in a&&a.tripwire;return{...r,[s]:{error:o?void 0:"error"in a?a.error:void 0,tripwire:o?a.tripwire:void 0,startedAt:a.startedAt,endedAt:"endedAt"in a?a.endedAt:void 0,status:a.status,output:"output"in a?a.output:void 0,input:a.payload,resumeData:"resumePayload"in a?a.resumePayload:void 0,suspendOutput:"suspendOutput"in a?a.suspendOutput:void 0,suspendPayload:"suspendPayload"in a?a.suspendPayload:void 0,foreachProgress:"foreachProgress"in a?a.foreachProgress:void 0}}},{}),runId:e.runId}},T0=({data:e,language:t="auto"})=>{const n=ym(),r=o=>{if(t==="javascript")return[EP(),ct.lineWrapping];if(t==="json")return[au,ct.lineWrapping];try{return JSON.parse(o),[au,ct.lineWrapping]}catch{return o.includes("=>")||o.includes("function")||o.includes("const ")||o.includes("return ")?[EP(),ct.lineWrapping]:[ct.lineWrapping]}};if(typeof e!="string"){const o=JSON.stringify(e,null,2);return l.jsxs("div",{className:"max-h-[500px] overflow-auto relative",children:[l.jsx("div",{className:"absolute right-2 top-2 bg-surface4 rounded-full z-10",children:l.jsx(oi,{content:o})}),l.jsx("div",{className:"bg-surface4 rounded-lg p-4",children:l.jsx(pu,{value:o,theme:n,extensions:[au,ct.lineWrapping]})})]})}const s=r(e);let a=e;try{const o=JSON.parse(e);a=JSON.stringify(o,null,2)}catch{}return l.jsxs("div",{className:"max-h-[500px] overflow-auto relative",children:[l.jsx("div",{className:"absolute right-2 top-2 bg-surface4 rounded-full z-10",children:l.jsx(oi,{content:e})}),l.jsx("div",{className:"bg-surface4 rounded-lg p-4",children:l.jsx(pu,{value:a,theme:n,extensions:s})})]})},eNn=be.forwardRef(({children:e,...t},n)=>l.jsx("form",{ref:n,className:"space-y-4",...t,children:e})),tNn=["boolean","object","array"],nNn=({label:e,children:t,id:n,field:r,error:s})=>{const a=tNn.includes(r.type);return l.jsxs("div",{className:"pb-4 last:pb-0",children:[!a&&l.jsxs(ke,{as:"label",variant:"ui-sm",className:"text-neutral3 pb-1 block",htmlFor:n,children:[e,r.required&&l.jsx("span",{className:"text-accent2",children:" *"})]}),t,r.fieldConfig?.description&&l.jsx(ke,{as:"p",variant:"ui-sm",className:"text-neutral6",children:r.fieldConfig.description}),s&&l.jsx(ke,{as:"p",variant:"ui-sm",className:"text-accent2",children:s})]})},rNn=({error:e})=>l.jsx(Kd,{variant:"destructive",children:l.jsx(Jd,{children:e})}),sNn=({children:e})=>l.jsx(he,{type:"submit",children:e}),PTe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,MTe=nJe,goe=(e,t)=>n=>{var r;if(t?.variants==null)return MTe(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(u=>{const d=n?.[u],f=a?.[u];if(d===null)return null;const p=PTe(d)||PTe(f);return s[u][p]}),i=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(g=>{let[b,y]=g;return Array.isArray(y)?y.includes({...a,...i}[b]):{...a,...i}[b]===y})?[...u,f,p]:u},[]);return MTe(e,o,c,n?.class,n?.className)},aNn=goe(K("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:K(aoe,ooe,ioe),unstyled:"border-0 bg-transparent shadow-none focus:shadow-none focus:ring-0"},size:{sm:`${Wi.sm} text-ui-sm px-[.75em]`,md:`${Wi.md} text-ui-md px-[.75em]`,default:`${Wi.default} text-ui-md px-[.85em]`,lg:`${Wi.lg} text-ui-lg px-[.85em]`}},defaultVariants:{variant:"default",size:"default"}}),Sn=S.forwardRef(({className:e,size:t,testId:n,variant:r,type:s,error:a,...o},i)=>l.jsx("input",{type:s,className:K(aNn({variant:r,size:t}),a&&"border-error focus:ring-error focus:shadow-glow-accent2",e),"data-testid":n,ref:i,"aria-invalid":a,...o}));Sn.displayName="Input";const oNn=({inputProps:e,error:t,field:n,id:r})=>{const{key:s,...a}=e;return l.jsx(Sn,{id:r,className:t?"border-accent2":"",...a,defaultValue:n.default})},iNn=({inputProps:e,error:t,field:n,id:r})=>{const{key:s,...a}=e;return l.jsx(Sn,{id:r,type:"number",className:t?"border-accent2":"",...a,defaultValue:n.default!==void 0?Number(n.default):void 0,onChange:o=>{const i=o.target.value;i!==""&&!isNaN(Number(i))&&a.onChange({target:{value:i,name:e.name}})},onBlur:o=>{const i=o.target.value;i!==""&&!isNaN(Number(i))&&a.onChange({target:{value:Number(i),name:e.name}})}})},Sc=S.forwardRef(({className:e,...t},n)=>l.jsx(TK,{ref:n,className:K("peer h-4 w-4 shrink-0 rounded-sm border border-neutral3","shadow-sm",$n.all,"hover:border-neutral5 hover:shadow-md",uN,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:bg-accent1 data-[state=checked]:border-accent1 data-[state=checked]:text-surface1","data-[state=checked]:shadow-glow-accent1",e),...t,children:l.jsx(DIe,{className:K("flex items-center justify-center text-current","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:l.jsx(Os,{className:"h-3.5 w-3.5 stroke-[3]"})})}));Sc.displayName=TK.displayName;const lNn=({field:e,label:t,id:n,inputProps:r,value:s})=>l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Sc,{id:n,onCheckedChange:a=>{const o={target:{name:r.name,value:a}};r.onChange(o)},defaultChecked:e.default,disabled:r.disabled||r.readOnly}),l.jsxs(ke,{as:"label",variant:"ui-sm",className:"text-neutral3",htmlFor:n,children:[t,e.required&&l.jsx("span",{className:"text-accent2",children:" *"})]})]});function $Je({className:e,classNames:t,showOutsideDays:n=!0,...r}){return l.jsx(zon,{showOutsideDays:n,className:K("p-3",e),classNames:{months:"flex flex-col space-y-4 sm:space-y-0 ",month:"space-y-4 text-ui-sm ",caption:"flex justify-between pt-1 items-center pl-2",caption_label:"text-text font-medium ",nav:"flex items-center",nav_button_previous:K("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_next:K("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),dropdown_month:"w-full border-collapse space-y-1",weeknumber:"flex",day:K("relative p-0 text-center focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-surface5 [&:has([aria-selected].day-outside)]:bg-surface5/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md","h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"!bg-neutral6/50 !text-surface2 hover:bg-neutral6 rounded-md hover:text-surface2 focus:bg-neutral6 focus:text-surface2",day_today:"bg-neutral6/10 text-neutral5",day_outside:"day-outside text-neutral3 opacity-50 aria-selected:bg-surface5/50 aria-selected:text-neutral3 aria-selected:opacity-30",day_disabled:"text-neutral3 opacity-50",day_range_middle:"aria-selected:bg-surface5 aria-selected:text-neutral5",day_hidden:"invisible",head_cell:"text-ui-xs text-neutral3",...t},...r})}const mN=Dmt,k1=Lmt,mx=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>l.jsx(Fmt,{children:l.jsx(I2e,{ref:s,align:t,sideOffset:n,className:K("z-50 w-72 rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md focus-visible:outline-none 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-[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&&/\bp-\S+/.test(e)?!1:"p-4",e),...r})}));mx.displayName=I2e.displayName;function DJe({children:e,...t}){const[n,r]=S.useState(!1),s=S.useRef(void 0),a=S.useCallback(()=>{clearTimeout(s.current),r(!0)},[]),o=S.useCallback(()=>{s.current=setTimeout(()=>r(!1),150)},[]);return S.useEffect(()=>()=>clearTimeout(s.current),[]),l.jsx(mN,{open:n,onOpenChange:r,...t,children:l.jsx("span",{onMouseEnter:a,onMouseLeave:o,onFocusCapture:a,onBlurCapture:o,style:{display:"contents"},children:e})})}const Ca=Pgt,Ta=Mgt,pa=S.forwardRef(({className:e,children:t,variant:n="inputLike",size:r="default",...s},a)=>l.jsxs(jMe,{ref:a,className:K(S1({variant:n,size:r}),"justify-between [&>svg]:opacity-100",e),...s,children:[t,l.jsx($gt,{asChild:!0,children:l.jsx(xs,{className:K("h-4 w-4 text-neutral3",$n.colors)})})]}));pa.displayName=jMe.displayName;const ha=S.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(Dgt,{children:l.jsx(RMe,{ref:s,className:K("relative z-50 min-w-[8rem] max-h-dropdown-max-height overflow-y-auto overflow-x-hidden rounded-md border border-border1 bg-surface3 text-neutral5 shadow-md 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-[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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:l.jsx(Lgt,{className:K("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));ha.displayName=RMe.displayName;const Pr=S.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(IMe,{ref:r,className:K("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-neutral5 text-sm",$n.colors,"hover:bg-surface5 hover:text-neutral5","focus:bg-surface5 focus:text-neutral5","data-[state=checked]:bg-accent1Dark data-[state=checked]:text-accent1","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(zgt,{children:l.jsx(Os,{className:"h-4 w-4 text-accent1"})})}),l.jsx(Fgt,{children:t})]}));Pr.displayName=IMe.displayName;const tQ=["12","1","2","3","4","5","6","7","8","9","10","11"],SR=["00","15","30","45","59"],OR=["AM","PM"];function cNn({defaultValue:e,onValueChange:t,className:n}){const[r,s]=S.useState("12"),[a,o]=S.useState("00"),[i,c]=S.useState("AM");S.useEffect(()=>{if(e){const p=/^(\d{1,2}):(\d{2})(?::\d{2})?\s*(AM|PM|am|pm)?$/,h=e.match(p);if(h){let g=parseInt(h[1],10);const b=parseInt(h[2],10),y=h[3]?.toUpperCase();g>=1&&g<=12&&b>=0&&b<=59&&(s(g.toString()),o(b===0?"00":b.toString()),c(y||"AM"))}}},[e]);const u=p=>{s(p),t(`${tQ[+p]}:${a} ${i}`.trim())},d=p=>{o(SR[+p]),t(`${r}:${SR[+p]} ${i}`.trim())},f=p=>{c(OR[+p]),t(`${r}:${a} ${OR[+p]}`.trim())};return l.jsxs("div",{className:K("flex gap-2 items-center",n),children:[l.jsxs(Ca,{name:"hour",value:tQ.indexOf(r).toString(),onValueChange:u,children:[l.jsx(pa,{size:"sm",children:l.jsx(Ta,{placeholder:"Select..."})}),l.jsx(ha,{children:tQ.map((p,h)=>l.jsx(Pr,{value:`${h}`,children:p},p))})]}),":",l.jsxs(Ca,{name:"minute",value:SR.indexOf(a).toString(),onValueChange:d,children:[l.jsx(pa,{size:"sm",children:l.jsx(Ta,{placeholder:"Select..."})}),l.jsx(ha,{children:SR.map((p,h)=>l.jsx(Pr,{value:`${h}`,children:p},p))})]}),l.jsxs(Ca,{name:"period",value:OR.indexOf(i).toString(),onValueChange:f,children:[l.jsx(pa,{size:"sm",children:l.jsx(Ta,{placeholder:"Select..."})}),l.jsx(ha,{children:OR.map((p,h)=>l.jsx(Pr,{value:`${h}`,children:p},p))})]})]})}function uNn({children:e,className:t}){return l.jsx("div",{className:K("grid gap-2 text-neutral4",t),children:e})}function dNn({children:e}){return l.jsxs("p",{className:K("text-ui-sm text-neutral4 flex items-center gap-2","[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-70 [&>svg]:text-red-400"),children:[l.jsx(Nl,{})," ",e]})}function fNn({children:e}){return l.jsx("p",{className:"text-neutral3 text-ui-sm",children:e})}function pNn({children:e,name:t,required:n,size:r="default",className:s}){return l.jsxs("label",{htmlFor:`input-${t}`,className:K("text-ui-smd text-neutral3 flex justify-between items-center ","[.horizontal-field-block_&]:grid [.horizontal-field-block_&]:content-start",{"text-ui-md":r==="bigger"},s),children:[e,n&&l.jsx("i",{className:"text-neutral2 text-xs",children:"(required)"})]})}function hNn({children:e,className:t,layout:n="vertical",labelColumnWidth:r}){return l.jsx("div",{className:K("grid gap-2 text-neutral4",{"horizontal-field-block grid-cols-[auto_1fr] items-baseline":n==="horizontal"},t),style:n==="horizontal"&&r?{gridTemplateColumns:`${r} 1fr`}:void 0,children:e})}const go=Object.assign({},{Layout:hNn,Column:uNn,Label:pNn,HelpText:fNn,ErrorMsg:dNn});function fb({name:e,value:t,label:n,labelIsHidden:r=!1,labelColumnWidth:s,helpText:a,errorMsg:o,required:i=!1,disabled:c=!1,labelSize:u,layout:d="vertical",placeholder:f,size:p="default",testId:h,className:g,...b}){return l.jsxs(go.Layout,{layout:d,labelColumnWidth:s,className:g,children:[d==="horizontal"?l.jsx(go.Column,{children:l.jsx(go.Label,{name:e,required:i,size:u||"bigger",children:r?l.jsx(vc,{children:n}):n})}):null,l.jsxs(go.Column,{children:[!r&&d==="vertical"?l.jsx(go.Label,{name:e,required:i,size:u||"default",children:n}):null,l.jsx(Sn,{name:e,disabled:c,required:i,value:t,placeholder:f,"data-testid":h,size:p,...b}),a&&l.jsx(go.HelpText,{children:a}),o&&l.jsx(go.ErrorMsg,{children:o})]})]})}const W2=({value:e,minValue:t,maxValue:n,defaultTimeStrValue:r,onValueChange:s,children:a,className:o,placeholder:i,...c})=>{const[u,d]=S.useState(!1);return l.jsxs(mN,{open:u,onOpenChange:d,children:[l.jsx(k1,{asChild:!0,children:a||l.jsx(gNn,{value:e,placeholder:i,className:o,"data-testid":"datepicker-button"})}),l.jsx(mx,{className:"backdrop-blur-4xl w-auto !p-0 bg-surface4 max-w-[16.5rem]",align:"start","data-testid":"datepicker-calendar",children:l.jsx(mNn,{value:e,minValue:t,maxValue:n,onValueChange:s,setOpenPopover:d,defaultTimeStrValue:r,...c})})]})};function kR({date:e,timeStr:t=""}){if(!kg(e))return null;if(t){const n=nr(e,"yyyy-MM-dd"),r=new Date(`${n} ${t}`);if(kg(r))return r}return e}const mNn=({value:e,minValue:t,maxValue:n,onValueChange:r,setOpenPopover:s,placeholder:a,className:o,defaultTimeStrValue:i,...c})=>{const[u,d]=S.useState(null),[f,p]=S.useState(e?nr(kR({date:e,timeStr:i})||"","PP p"):""),[h,g]=S.useState(i||""),[b,y]=S.useState(e?new Date(e):void 0),x=WT(U=>{kg(U)&&(y(U),r?.(U),s?.(!1))},500),w=U=>{p(U.currentTarget.value);const D=new Date(U.currentTarget.value);x(D)},O=U=>{kg(U)?n&&U>n?(d(`The selected date should be before ${nr(n,"PP p")}`),p("")):t&&U<t?(d(`The selected date should be after ${nr(t,"PP p")}`),p("")):(p(nr(U,"PP p")),d("")):(p(""),d(""))},k=new Date(f),E=kg(k),C=E&&k.getTime()!==e?.getTime(),N=U=>{if(y(U),U){const D=kR({date:U,timeStr:h});O(D||"")}else O("")},T=U=>{if(y(U),U){const D=kR({date:U,timeStr:h});O(D||"")}else O("")},j=U=>{if(g(U),E){const D=kR({date:k,timeStr:U});O(D||"")}},R=()=>{s?.(!1)},P=()=>{kg(k)&&r(k),s?.(!1)},M=()=>{r(void 0),y(void 0),p(""),g(""),s?.(!1)};return l.jsxs("div",{"aria-label":"Choose date",className:K("relative flex flex-col",o),onKeyDown:U=>{U.stopPropagation(),U.key==="Escape"&&s?.(!1)},children:[l.jsx(fb,{name:"date-range",type:"text",value:f,onChange:w,placeholder:a,className:"m-4 mb-0 !w-auto"}),u&&l.jsxs("div",{className:K("text-ui-md m-4 mb-0 text-neutral3","[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:mt-0.5 [&>svg]:text-red-500 [&>svg]:float-left [&>svg]:mr-2"),children:[l.jsx(Zd,{})," ",u]}),l.jsx($Je,{mode:"single",month:b,selected:b,onMonthChange:T,onSelect:N,...c}),l.jsx(cNn,{onValueChange:j,className:"m-4 mt-0 w-auto",defaultValue:e?nr(new Date(e),"hh:mm a"):i}),l.jsxs("div",{className:"grid grid-cols-[1fr_2fr] gap-2 m-4 mt-0",children:[C&&l.jsx(he,{tabIndex:0,size:"md",onClick:M,type:"button",children:"Clear"}),l.jsx(he,{tabIndex:0,type:"button",size:"md",variant:C?"primary":"default",onClick:()=>{E?P():R()},children:C?"Apply":"Cancel"})]})]})},gNn=S.forwardRef(({value:e,placeholder:t,className:n,...r},s)=>l.jsxs(he,{ref:s,className:K("justify-start",n),variant:"inputLike",...r,children:[l.jsx(hJ,{className:"h-4 w-4"}),e?l.jsx("span",{className:"text-white",children:nr(e,"PP p")}):l.jsx("span",{className:"text-gray",children:t??"Pick a date"})]})),bNn=({inputProps:e,field:t,error:n,id:r})=>{const{key:s,...a}=e,[o,i]=S.useState(void 0),[c,u]=S.useState(!1);S.useEffect(()=>{if(t.default){const p=new Date(t.default);kg(p)&&i(p)}},[t]);const d=p=>{i(p),p&&a.onChange({target:{value:p.toISOString(),name:e.name}}),u(!1)},f=()=>{i(void 0),a.onChange({target:{value:"",name:e.name}}),u(!1)};return l.jsxs(mN,{open:c,onOpenChange:u,children:[l.jsx(k1,{asChild:!0,children:l.jsxs(he,{id:r,variant:"light",size:"lg",className:K("w-full",n?"border-accent2":""),children:[l.jsx(hJ,{className:"h-4 w-4"}),o?l.jsx("span",{className:"text-white",children:nr(o,"PPP")}):l.jsx("span",{className:"text-gray",children:"Pick a date"})]})}),l.jsxs(mx,{className:"w-auto p-0 bg-surface4",align:"start",children:[l.jsx($Je,{mode:"single",selected:o,onSelect:d,month:o,onMonthChange:i}),o&&l.jsx("div",{className:"p-3 pt-0",children:l.jsx(he,{variant:"light",size:"lg",className:"w-full",onClick:f,children:"Clear"})})]})]})},yNn=({field:e,inputProps:t,error:n,id:r,value:s})=>{const{key:a,...o}=t;return l.jsxs(Ca,{...o,value:s,onValueChange:i=>{const c={target:{value:i,name:t.name}};o.onChange(c)},children:[l.jsx(pa,{id:r,className:n?"border-accent2":"",children:l.jsx(Ta,{placeholder:"Select an option"})}),l.jsx(ha,{children:(e.options||[]).map(([i,c])=>l.jsx(Pr,{value:i,children:c},i))})]})},vNn=({label:e,children:t})=>{const n=e!==""&&e!=="",[r,s]=S.useState(!1);return l.jsxs("div",{className:"",children:[l.jsxs("div",{className:"flex items-center",children:[n&&l.jsxs(ke,{as:"h3",variant:"ui-sm",className:"text-neutral3 flex items-center gap-1 pb-2",children:[l.jsx(Oe,{size:"sm",children:l.jsx(fu,{})}),e]}),l.jsx(he,{onClick:()=>s(!r),type:"button",className:"ml-auto px-1",size:"sm",children:l.jsx(Oe,{size:"sm",children:l.jsx(xs,{className:K("transition-all",r?"rotate-180":"rotate-0")})})})]}),r&&l.jsx("div",{className:n?"flex flex-col gap-1 [&>*]:border-dashed [&>*]:border-l [&>*]:border-l-border1 [&>*]:pl-4":"",children:t})]})},xNn=({label:e,children:t,onAddItem:n})=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex gap-2 justify-between",children:[l.jsxs(ke,{as:"h3",variant:"ui-sm",className:"text-neutral3 pb-2 flex items-center gap-1",children:[l.jsx(Oe,{size:"sm",children:l.jsx(Myt,{})}),e]}),l.jsx(ui,{children:l.jsxs(Qn,{delayDuration:0,children:[l.jsx(Gn,{asChild:!0,children:l.jsx("button",{onClick:n,type:"button",className:"text-neutral3 bg-surface3 rounded-md p-1 hover:bg-surface4 hover:text-neutral6 h-icon-sm w-icon-sm",children:l.jsx(Oe,{size:"sm",children:l.jsx(cs,{})})})}),l.jsx(Bn,{children:"Add item"})]})})]}),l.jsx("div",{className:"flex flex-col gap-1",children:t})]}),wNn=({children:e,onRemove:t})=>l.jsxs("div",{className:"pl-4 border-l border-border1",children:[e,l.jsxs(he,{onClick:t,type:"button",children:[l.jsx(Oe,{size:"sm",children:l.jsx(kJ,{})}),"Delete"]})]}),SNn=({inputProps:e,field:t,error:n,id:r})=>{const{key:s,onChange:a,...o}=e,[i,c]=S.useState(()=>Object.entries(t.default||{}).map(([g,b])=>({id:g||yo(),key:g,value:b})));S.useEffect(()=>{i.length===0&&c([{id:yo(),key:"",value:""}])},[i]);const u=S.useCallback(g=>{const b=g.reduce((y,x)=>(x.key&&(y[x.key]=x.value),y),{});a?.({target:{value:b,name:e.name}})},[a,e.name]),d=(g,b,y)=>{c(x=>x.map(w=>w.id===g?{...w,[b]:y}:w))},f=()=>{u(i)},p=()=>{const g=[...i,{id:yo(),key:"",value:""}];c(g),u(g)},h=g=>{const b=i.filter(y=>y.id!==g);b.length===0&&b.push({id:yo(),key:"",value:""}),c(b),u(b)};return l.jsxs("div",{className:"space-y-3",children:[i.map(g=>l.jsxs("div",{className:"relative space-y-2 rounded-lg border p-4",children:[l.jsx(he,{type:"button",className:"absolute right-2 top-2",onClick:()=>h(g.id),children:l.jsx(kJ,{className:"h-4 w-4"})}),l.jsxs("div",{className:"space-y-2 pt-6",children:[l.jsx(Sn,{placeholder:"Key",value:g.key,onChange:b=>d(g.id,"key",b.target.value),onBlur:f}),l.jsx(Sn,{placeholder:"Value",value:g.value,onChange:b=>d(g.id,"value",b.target.value),onBlur:f})]})]},g.id)),l.jsxs(he,{type:"button",className:"w-full",onClick:p,children:[l.jsx(cs,{className:"mr-2 h-4 w-4"}),"Add Key-Value Pair"]})]})},ONn=({field:e,path:t})=>{const{uiComponents:n}=ose();return l.jsx(n.ObjectWrapper,{label:HE(e),field:e,children:Object.entries(e.schema).map(([r,s])=>l.jsx(Yy,{field:s,path:[...t,s.key]},`${t.join(".")}.${s.key}`))})},kNn=({field:e,path:t})=>{const{uiComponents:n}=ose(),{control:r}=tse(),{fields:s,append:a,remove:o}=uin({control:r,name:t.join(".")}),i=e.schema?.[0]?.type;let c;i==="object"?c={}:i==="array"?c=[]:c=null;const u=e.schema?.[0];return u?l.jsx(n.ArrayWrapper,{label:HE(e),field:e,onAddItem:()=>a(c),children:s.map((d,f)=>l.jsx(n.ArrayElementWrapper,{onRemove:()=>o(f),index:f,children:l.jsx(Yy,{field:u,path:[...t,f.toString()]})},d.id))}):l.jsx(n.ErrorMessage,{error:`[AutoForm] Unable to determine array element schema for "${HE(e)}"`})},Yy=({field:e,path:t})=>{const{formComponents:n,uiComponents:r}=ose(),{register:s,formState:{errors:a},getValues:o}=tse(),i=t.join("."),c=Vin(a,t)?.message,u=o(i),d=e.fieldConfig?.fieldWrapper||r.FieldWrapper;let f=()=>l.jsx(r.ErrorMessage,{error:`[AutoForm Configuration Error] No component found for type "${e.type}" nor a fallback`});return e.type==="array"?f=kNn:e.type==="object"?f=ONn:e.type in n?f=n[e.type]:"fallback"in n&&(f=n.fallback),l.jsx(d,{label:HE(e),error:c,id:i,field:e,children:l.jsx(f,{label:HE(e),field:e,value:u,error:c,id:i,path:t,inputProps:{required:e.required,error:c,key:`${i}-input`,...e.fieldConfig?.inputProps,...s(i)}},i)})},_Nn=({field:e,inputProps:t})=>{const n=t.name?.split(".")??[];return e.schema?.map((r,s)=>l.jsxs("div",{children:[l.jsx(Yy,{field:r,path:n},n.join(".")),s<(e.schema?.length??0)-1&&l.jsx(ke,{variant:"ui-xs",className:"text-center",children:"OR"})]},r.key))},ENn=({field:e,path:t})=>{const{watch:n}=tse(),r=t.join("."),s=n(r),o=(e.schema?.flatMap(p=>p.schema||[])||[])?.filter(p=>p.fieldConfig?.customData?.isLiteral)||[],i=o[0],c=o?.reduce((p,h)=>{const g=(h.fieldConfig?.customData?.literalValues??[]).map(b=>[b,b]);return p.options?.push(...g),p},{key:i.key,required:i.required,type:"select",default:i.default,description:i.description,options:[],fieldConfig:i.fieldConfig}),u=e.schema?.reduce((p,h)=>{const g=h.schema?.find(x=>x.fieldConfig?.customData?.isLiteral),b=g?.fieldConfig?.customData?.literalValues?.[0],y=h.schema?.filter(x=>x.key!==g?.key)??[];return b&&(p[b]=y),p},{}),d=e.schema?.filter(p=>!p.schema?.find(g=>g.fieldConfig?.customData?.isLiteral)),f=s?.[c.key];return l.jsxs("div",{children:[l.jsx(Yy,{field:c,path:[...t,c.key]},`${r}.${c.key}`),f&&u?.[f]&&u[f].map(p=>l.jsx(Yy,{field:p,path:[...t,p.key]},`${r}.${p.key}`)),d&&d.map(p=>l.jsx(Yy,{field:p,path:[...t,p.key]},`${r}.${p.key}`))]},e.key)};function Z2(e){const t={};for(const n in e){const r=e[n];if(![null,void 0,"",[],{}].includes(r))if(Array.isArray(r)){const a=r.map(o=>{if(typeof o=="object"){const i=Z2(o);return Object.keys(i).length>0?i:null}return o}).filter(o=>o!==null);a.length>0&&(t[n]=a)}else if(typeof r=="object"){const s=Z2(r);Object.keys(s).length>0&&(t[n]=s)}else t[n]=r}return t}function hf(e){return Function("z",`"use strict";return (${e});`)(zHt)}function CNn({schema:e,onSubmit:t=()=>{},defaultValues:n,values:r,children:s,uiComponents:a,formComponents:o,withSubmit:i=!1,onFormInit:c=()=>{},formProps:u={}}){const d=S.useMemo(()=>fin(e),[e]),f=JT({defaultValues:{...pin(e),...n},values:r});S.useEffect(()=>{c&&c(f)},[c,f]);const p=S.useCallback(async g=>{const b=Z2(g),y=e.validateSchema(b);if(y.success)await t(y.data,f);else{f.clearErrors();let x=!1;y.errors?.forEach(w=>{const O=w.path.join(".");f.setError(O,{type:"custom",message:w.message},{shouldFocus:!x}),x=!0;const k=w.path?.slice?.(0,-1);k?.length>0&&f.setError(k.join("."),{type:"custom",message:w.message})})}},[e,t,f]),h=S.useMemo(()=>({schema:d,uiComponents:a,formComponents:o}),[d,a,o]);return l.jsx(Won,{...f,children:l.jsx(Sin,{value:h,children:l.jsxs(a.Form,{onSubmit:f.handleSubmit(p),...u,children:[d.fields.map(g=>l.jsx(Yy,{field:g,path:[g.key]},g.key)),s,i&&l.jsx(a.SubmitButton,{children:"Submit"})]})})})}const TNn={Form:eNn,FieldWrapper:nNn,ErrorMessage:rNn,SubmitButton:sNn,ObjectWrapper:vNn,ArrayWrapper:xNn,ArrayElementWrapper:wNn};function NNn({uiComponents:e,formComponents:t,readOnly:n,...r}){const s=S.useMemo(()=>({...TNn,...e}),[e]),a=S.useMemo(()=>{const o=i=>n===void 0?i:{...i,readOnly:n};return{string:i=>l.jsx(oNn,{...i,inputProps:o(i.inputProps)}),number:i=>l.jsx(iNn,{...i,inputProps:o(i.inputProps)}),boolean:i=>l.jsx(lNn,{...i,inputProps:o(i.inputProps)}),date:i=>l.jsx(bNn,{...i,inputProps:o(i.inputProps)}),select:i=>l.jsx(yNn,{...i,inputProps:o(i.inputProps)}),record:i=>l.jsx(SNn,{...i,inputProps:o(i.inputProps)}),union:i=>l.jsx(_Nn,{...i,inputProps:o(i.inputProps)}),"discriminated-union":i=>l.jsx(ENn,{...i,inputProps:o(i.inputProps)}),...t}},[n,t]);return l.jsx(CNn,{...r,uiComponents:s,formComponents:a})}const ANn=goe("text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),kt=S.forwardRef(({className:e,...t},n)=>l.jsx(_Qe,{ref:n,className:K(ANn(),e),...t}));kt.displayName=_Qe.displayName;function LJe(e){return e!=null&&typeof e=="object"&&"_zod"in e}function nl(e){if(!(e==null||typeof e!="object"))return LJe(e)?e._zod.def:e._def}function jNn(e){return typeof e.isOptional=="function"?e.isOptional():typeof e.safeParse=="function"?e.safeParse(void 0).success:!1}function ef(e){if(e.shape&&typeof e.shape=="object")return e.shape;const t=nl(e);if(t?.shape)return typeof t.shape=="function"?t.shape():t.shape}function JY(e){const t=nl(e);return t?"innerType"in t?JY(t.innerType):"schema"in t?JY(t.schema):e:e}function RNn(e){const t=nl(e);if(t?.entries)return t.entries;if(t?.values)return t.values}function INn(e){const t=nl(e);return t?.element??t?.type}function FJe(e){const t=nl(e);if(t?.values!==void 0)return Array.isArray(t.values)?t.values[0]:t.values;if(t?.value!==void 0)return t.value}function PNn(e){const t=nl(e);if(t?.values!==void 0)return t.values;if(t?.value!==void 0)return[t.value]}function MNn(e){const t=nl(e);if(t?.defaultValue!==void 0)return typeof t.defaultValue=="function"?t.defaultValue():t.defaultValue}function zJe(e){return nl(e)?.options}function eX(e){const t=nl(e);if(t?.left&&t?.right)return{left:t.left,right:t.right};if(e.def?.left&&e.def?.right)return{left:e.def.left,right:e.def.right}}function $Nn(e){return nl(e)?.checks??[]}function DNn(e){return e.some(t=>{if(LJe(t)){const n=nl(t);return n?.check==="string_format"&&n?.format==="datetime"}return t.kind==="datetime"})}function LNn(e,t){if(t?.fieldType)return t.fieldType;const n=e?.constructor?.name?.slice(1),r=nl(e),s=typeof r?.type=="string"?`Zod${r.type.charAt(0).toUpperCase()}${r.type.slice(1)}`:void 0,a=r?.typeName??s??n;if(a==="ZodObject"||a==="ZodIntersection")return"object";if(a==="ZodNumber")return"number";if(a==="ZodBoolean")return"boolean";if(a==="ZodString"){const o=$Nn(e);return DNn(o)?"date":"string"}if(a==="ZodEnum"||a==="ZodNativeEnum")return"select";if(a==="ZodArray")return"array";if(a==="ZodRecord")return"record";if(a==="ZodUnion"){const o=zJe(e);return o&&o.every(c=>{const u=ef(c);return u?Object.values(u).some(d=>{const f=d?.constructor?.name?.slice(1),p=nl(d);return f==="ZodLiteral"||p?.typeName==="ZodLiteral"||p?.type==="literal"}):!1})?"discriminated-union":"union"}if(a==="ZodDiscriminatedUnion")return"discriminated-union";if(a==="ZodLiteral"){const o=FJe(e);return typeof o=="number"?"number":typeof o=="boolean"?"boolean":"string"}return"string"}function Q0(e){const t=nl(e);if(!t)return;const n=MNn(e);if(n!==void 0)return n;const r=FJe(e);if(r!==void 0&&(t.typeName==="ZodLiteral"||t.type==="literal"||e?.constructor?.name?.slice(1)==="ZodLiteral"))return r;if("innerType"in t)return Q0(t.innerType);if("schema"in t)return Q0(t.schema);if(ef(e)&&!("left"in t))return _I(e);if("left"in t&&"right"in t){const a=ef(t.left),o=ef(t.right),i=a?_I(t.left):Q0(t.left),c=o?_I(t.right):Q0(t.right);return{...i,...c}}}function _I(e){const t=ef(e);if(!t)return{};const n={};for(const[r,s]of Object.entries(t)){const a=Q0(s);a!==void 0&&(n[r]=a)}return n}function tX(e){const t=nl(e);if(t){if(t.typeName==="ZodEffects"&&t.effect?.type==="refinement"){const n=t.effect?.refinement;if(n){const r=Object.getOwnPropertySymbols(n);for(const s of r){const a=n[s];if(a&&typeof a=="object")return a}}}if("innerType"in t)return tX(t.innerType);if("schema"in t)return tX(t.schema)}}function lg(e,t){const n=JY(t),r=tX(t);let s=LNn(n,r);const a=Q0(t),o=RNn(n);let i=[];o&&(Array.isArray(o)?i=o.map(w=>[w,w]):i=Object.entries(o));let c=[];const u=ef(n);u&&!eX(n)&&(c=Object.entries(u).map(([w,O])=>lg(w,O)));const d=zJe(n),f=n?.constructor?.name?.slice(1),p=nl(n),h=typeof p?.type=="string"?`Zod${p.type.charAt(0).toUpperCase()}${p.type.slice(1)}`:void 0,g=p?.typeName??h??f;(g==="ZodUnion"||g==="ZodDiscriminatedUnion")&&d&&(c=Object.entries(d).map(([w,O])=>lg(w,O)));const b=eX(n);if(b){const{left:w,right:O}=b;let k=[],E=[];const C=ef(w);if(C)k=Object.entries(C).map(([T,j])=>lg(T,j));else{const T=lg(e,w);k=T.schema??[T],s=T.type}const N=ef(O);if(N)E=Object.entries(N).map(([T,j])=>lg(T,j));else{const T=lg(e,O);E=T.schema??[T],s=T.type}c=[...k,...E]}if(g==="ZodArray"){const w=INn(n);w&&(c=[lg("0",w)])}const y=g==="ZodLiteral",x=y?PNn(n):void 0;return{key:e,type:s,required:!jNn(t),default:a,description:n.description,fieldConfig:y||Object.keys(r??{})?.length>0?{...r,customData:{...r?.customData??{},...y?{isLiteral:y,literalValues:x}:{}}}:void 0,options:i,schema:c}}function FNn(e){const t=ef(e);return t?{fields:Object.entries(t).map(([r,s])=>lg(r,s))}:{fields:[]}}class zNn{_schema;constructor(t){if(!t)throw new Error("CustomZodProvider: schema is required");this._schema=t}getDefaultValues(){return _I(this._schema)}validateSchema(t){const n=Z2(t);try{const r=this._schema.safeParse(n);if(r.success)return{success:!0,data:r.data};{const s=r.error;return{success:!1,errors:(s.issues??s.errors??[]).map(o=>({path:o.path,message:o.message}))}}}catch(r){throw r}}parseSchema(){return FNn(this._schema)}}function nX(e){const t=ef(e);if(t)return Object.keys(t).length===0;const n=eX(e);return n?nX(n.left)&&nX(n.right):!1}function BNn(e){return ef(e)!==void 0}function Q4({schema:e,onSubmit:t,onValuesChange:n,defaultValues:r,isSubmitLoading:s,submitButtonLabel:a,className:o,readOnly:i,children:c}){const u=S.useRef(null),d=!BNn(e),f=S.useRef(n);S.useEffect(()=>{f.current=n},[n]),S.useEffect(()=>()=>{u.current?.unsubscribe()},[]);const p=S.useCallback(O=>{u.current?.unsubscribe(),f.current&&(u.current=O.watch(k=>{const E=d?k&&Object.prototype.hasOwnProperty.call(k,"")?k[""]:{}:k;f.current?.(E)}))},[d]),h=S.useMemo(()=>{if(!e)return null;const O=k=>nX(k)?Ae({}):d?Ae({"":k}):k;return new zNn(O(e))},[e,d]),g=S.useMemo(()=>({SubmitButton:({children:O})=>t?l.jsx(he,{className:"w-full",disabled:s,children:s?l.jsx(Ma,{className:"animate-spin"}):a||O}):null}),[t,s,a]),b=S.useMemo(()=>({Label:({value:O})=>l.jsx(kt,{className:"text-sm font-normal",children:O})}),[]),y=S.useMemo(()=>({className:o,noValidate:!0}),[o]),x=S.useMemo(()=>d?r===void 0?void 0:{"":r}:r,[d,r]),w=S.useCallback(async O=>{const k=d?O&&Object.prototype.hasOwnProperty.call(O,"")?O[""]:{}:O;await t?.(k)},[t,d]);return h?l.jsx(NNn,{schema:h,onSubmit:w,onFormInit:p,defaultValues:x,formProps:y,uiComponents:g,formComponents:b,withSubmit:!0,readOnly:i,children:c}):(console.error("no form schema found"),null)}const gN=S.forwardRef(({className:e,...t},n)=>l.jsx(Q2e,{className:K("grid gap-2",e),...t,ref:n}));gN.displayName=Q2e.displayName;const tu=S.forwardRef(({className:e,...t},n)=>l.jsx(G2e,{ref:n,className:K("aspect-square h-4 w-4 rounded-full border border-neutral3 text-neutral6","shadow-sm",$n.all,"hover:border-neutral5 hover:shadow-md",uN,"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-neutral3 disabled:hover:shadow-sm","data-[state=checked]:border-accent1 data-[state=checked]:shadow-glow-accent1",e),...t,children:l.jsx(Zmt,{className:K("flex items-center justify-center","data-[state=checked]:animate-in data-[state=checked]:zoom-in-50 data-[state=checked]:duration-150"),children:l.jsx(Y$e,{className:"h-2 w-2 fill-accent1 text-accent1"})})}));tu.displayName=G2e.displayName;const boe=({schema:e,defaultValues:t,withoutSubmit:n,isSubmitLoading:r,submitButtonLabel:s,onSubmit:a,children:o,isProcessorWorkflow:i})=>{const[c,u]=S.useState(i?"simple":"form"),[d,f]=S.useState(!1);return S.useEffect(()=>{f(!0)},[]),d?l.jsxs("div",{children:[l.jsx(gN,{disabled:r,value:c,onValueChange:p=>u(p),className:"pb-4",children:l.jsxs("div",{className:"flex flex-row gap-4",children:[i&&l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(tu,{value:"simple",id:"simple"}),l.jsx(kt,{htmlFor:"simple",className:"!text-neutral3 text-ui-sm",children:"Simple"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(tu,{value:"form",id:"form"}),l.jsx(kt,{htmlFor:"form",className:"!text-neutral3 text-ui-sm",children:"Form"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(tu,{value:"json",id:"json"}),l.jsx(kt,{htmlFor:"json",className:"!text-neutral3 text-ui-sm",children:"JSON"})]})]})}),l.jsx("div",{className:K({"opacity-50 pointer-events-none":r}),children:c==="simple"&&i?l.jsx(VNn,{schema:e,defaultValues:t,isSubmitLoading:r,submitButtonLabel:s,onSubmit:a,withoutSubmit:n,children:o}):c==="form"?l.jsx(Q4,{schema:e,defaultValues:t,isSubmitLoading:r,submitButtonLabel:s,onSubmit:n?void 0:a,children:o}):l.jsx(UNn,{schema:e,defaultValues:t,isSubmitLoading:r,submitButtonLabel:s,onSubmit:a,withoutSubmit:n,children:o})})]}):null},UNn=({schema:e,defaultValues:t,isSubmitLoading:n,submitButtonLabel:r,onSubmit:s,withoutSubmit:a,children:o})=>{const[i,c]=S.useState([]),[u,d]=S.useState(()=>JSON.stringify(t??{},null,2)),f=()=>{c([]);try{const h=e.safeParse(JSON.parse(u));h.success?s(h.data):c(h.error.issues.map(g=>`[${g.path.join(".")}] ${g.message}`))}catch{c(["Invalid JSON provided"])}};let p={};try{p=JSON.parse(u)}catch{p={}}return l.jsxs("div",{className:"flex flex-col gap-4",children:[i.length>0&&l.jsxs("div",{className:"border border-accent2 rounded-lg p-2",children:[l.jsxs(ke,{as:"p",variant:"ui-md",className:"text-accent2 font-semibold",children:[i.length," errors found"]}),l.jsx("ul",{className:"list-disc list-inside",children:i.map((h,g)=>l.jsx("li",{className:"text-ui-sm text-accent2",children:h},g))})]}),l.jsx(ea,{data:p,onChange:d}),o,a?null:l.jsx(he,{variant:"light",onClick:f,className:"w-full",size:"lg",children:n?l.jsx(Ma,{className:"animate-spin"}):r})]})},$Te=[{value:"input",label:"Input - Process input messages before LLM"},{value:"inputStep",label:"Input Step - Process at each agentic loop step"},{value:"outputStream",label:"Output Stream - Process streaming chunks"},{value:"outputResult",label:"Output Result - Process complete output"},{value:"outputStep",label:"Output Step - Process after each LLM response"}],VNn=({schema:e,defaultValues:t,isSubmitLoading:n,submitButtonLabel:r,onSubmit:s,withoutSubmit:a,children:o})=>{const[i,c]=S.useState("Hello, this is a test message."),[u,d]=S.useState("input"),[f,p]=S.useState([]),h=()=>{p([]);const b=u==="outputStep"||u==="outputResult"?"assistant":"user",y={messages:[{id:crypto.randomUUID(),role:b,createdAt:new Date().toISOString(),content:{format:2,parts:[{type:"text",text:i}]}}],phase:u};try{const x=e.safeParse(y);x.success?s(x.data):p(x.error.issues.map(w=>`[${w.path.join(".")}] ${w.message}`))}catch{p(["Error processing input"])}};return l.jsxs("div",{className:"flex flex-col gap-4",children:[f.length>0&&l.jsxs("div",{className:"border border-accent2 rounded-lg p-2",children:[l.jsxs(ke,{as:"p",variant:"ui-md",className:"text-accent2 font-semibold",children:[f.length," errors found"]}),l.jsx("ul",{className:"list-disc list-inside",children:f.map((g,b)=>l.jsx("li",{className:"text-ui-sm text-accent2",children:g},b))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ke,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Phase"}),l.jsxs(Ca,{value:u,onValueChange:d,children:[l.jsx(pa,{className:"w-full",children:l.jsx(Ta,{placeholder:"Select phase"})}),l.jsx(ha,{children:$Te.map(g=>l.jsx(Pr,{value:g.value,children:g.value},g.value))})]}),l.jsx(ke,{variant:"ui-xs",className:"text-neutral4",children:$Te.find(g=>g.value===u)?.label})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ke,{as:"label",variant:"ui-sm",className:"text-neutral3",children:"Test Message"}),l.jsx("textarea",{value:i,onChange:g=>c(g.target.value),placeholder:"Enter a test message...",rows:4,className:"w-full bg-transparent border border-border1 rounded-md p-3 text-ui-sm text-neutral6 placeholder:text-neutral3 focus:outline-none focus:ring-2 focus:ring-accent1"})]}),o,a?null:l.jsx(he,{variant:"light",onClick:h,className:"w-full",size:"lg",children:n?l.jsx(Ma,{className:"animate-spin"}):r})]})};let DTe;const qNn=()=>DTe??=Promise.all([He(()=>import("./standalone-DS4gw9AE.js"),[],import.meta.url),He(()=>import("./babel-CmeIX3PZ.js"),[],import.meta.url),He(()=>import("./estree-CwOGYdhi.js"),[],import.meta.url)]).catch(e=>{throw DTe=void 0,e}),Ow=async e=>{const[t,n,r]=await qNn();return await t.format(e,{semi:!1,parser:"json",printWidth:80,tabWidth:2,plugins:[n,r]})},wC=e=>{try{const t=JSON.parse(e);return!!t&&typeof t=="object"}catch{return!1}},yoe=S.createContext(null);function bN({children:e}){const{requestContext:t}=Or(),[n,r]=S.useState(t),s=o=>r(o),a=()=>{r({})};return l.jsx(yoe.Provider,{value:{schemaValues:n,setSchemaValues:s,clearSchemaValues:a},children:e})}function voe(){const e=S.useContext(yoe);if(!e)throw new Error("useSchemaRequestContext must be used within a SchemaRequestContextProvider");return e}function di(){const{requestContext:e}=Or(),n=S.useContext(yoe)?.schemaValues??{};return{...e??{},...n}}const ek="text-neutral3 hover:text-neutral6",LTe=e=>{try{return e==null?"{}":JSON.stringify(e,null,2)}catch{return"{}"}},nQ=({label:e,value:t,onChange:n,helperText:r,exampleCode:s})=>{const a=ym(),{handleCopy:o}=pd({text:t}),{handleCopy:i}=pd({text:s??"{}"}),[c,u]=S.useState(null),[d,f]=S.useState(!1),[p,h]=S.useState(!1),g=async()=>{if(u(null),!t.trim()){n("{}");return}if(!wC(t)){u("Invalid JSON");return}try{const b=await Ow(t);n(b)}catch{u("Unable to format JSON")}};return l.jsxs(l.Fragment,{children:[p&&l.jsxs("div",{className:"border border-border1 rounded-lg bg-surface3 p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ke,{as:"p",variant:"ui-sm",className:"text-neutral3",children:["Example ",e]}),l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx("button",{type:"button",onClick:i,className:ek,"aria-label":"Copy example JSON",children:l.jsx(Oe,{children:l.jsx(Xi,{})})})}),l.jsx(Bn,{children:"Copy example JSON"})]})]}),l.jsx(pu,{value:s,theme:a,extensions:[au],className:"h-[150px] w-full overflow-y-scroll bg-surface3 rounded-lg overflow-scroll p-3"})]}),l.jsxs(pf,{className:"border border-border1 rounded-lg bg-surface3",open:d,onOpenChange:f,children:[l.jsxs("div",{className:"flex items-center justify-between w-full px-3",children:[l.jsxs("div",{children:[l.jsx(ke,{as:"label",variant:"ui-md",className:"text-neutral3",children:e}),r&&l.jsx(ke,{variant:"ui-xs",className:"text-neutral3",children:r})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx("button",{type:"button",onClick:g,className:ek,"aria-label":"Format JSON",children:l.jsx(Oe,{children:l.jsx(fu,{})})})}),l.jsx(Bn,{children:"Format JSON"})]}),l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx("button",{type:"button",onClick:o,className:ek,"aria-label":"Copy JSON",children:l.jsx(Oe,{children:l.jsx(Xi,{})})})}),l.jsx(Bn,{children:"Copy JSON"})]}),s&&l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>h(!p),className:ek,"aria-label":p?"Hide example JSON":"View example JSON",children:l.jsx(Oe,{children:p?l.jsx(Xvt,{}):l.jsx(uc,{})})})}),l.jsx(Bn,{children:"View example JSON"})]}),l.jsx(hd,{asChild:!0,children:l.jsx("button",{type:"button",className:ek,"aria-label":d?`Collapse ${e}`:`Expand ${e}`,children:l.jsx(Oe,{className:K("transition-transform",d?"rotate-0":"-rotate-90"),children:l.jsx(xs,{})})})})]})]}),l.jsxs(md,{className:"space-y-2",children:[l.jsx(pu,{value:t,onChange:n,theme:a,extensions:[au],className:"h-[260px] overflow-y-scroll bg-surface3 rounded-lg overflow-hidden p-3"}),c&&l.jsx(ke,{variant:"ui-sm",className:"text-accent2",children:c})]})]})]})},rQ=({stepKey:e,closeModal:t,isPerStepRun:n,isContinueRun:r,buttonText:s="Start time travel",inputData:a})=>{const{result:o,workflow:i,timeTravelWorkflowStream:c,runId:u,workflowId:d,setDebugMode:f}=S.useContext(Zp),p=di(),h=a?{payload:a}:o?.steps?.[e],[g,b]=S.useState(()=>"{}"),[y,x]=S.useState(()=>"{}"),[w,O]=S.useState(()=>"{}"),[k,E]=S.useState(null),[C,N]=S.useState(!1),T=i?.allSteps?.[e],{schema:j}=S.useMemo(()=>{if(!T?.inputSchema)return{schema:qr(pe(),_l())};try{const P=ob(T.inputSchema),M=i?.stateSchema?hf(ff(ob(i.stateSchema))):null,U=hf(ff(P));return{schema:M?Ae({inputData:U,initialState:M.optional()}):U,schemaError:null}}catch(P){return console.error("Failed to parse step schema",P),{schema:qr(pe(),_l())}}},[T?.inputSchema,i?.stateSchema]),R=async P=>{E(null),N(!0);try{const M=g.trim()?JSON.parse(g):{},U=y.trim()?JSON.parse(y):{},D=w.trim()?JSON.parse(w):{},{initialState:q,inputData:V}=P??{},B=i?.stateSchema?V:P,H={runId:u,workflowId:d,step:e,inputData:B,initialState:q,resumeData:Object.keys(M)?.length>0?M:void 0,context:Object.keys(U)?.length>0?U:void 0,nestedStepsContext:Object.keys(D)?.length>0?D:void 0,requestContext:p,...r?{perStep:!1}:{}};r&&f(!1),c(H),t()}catch(M){console.error("Invalid JSON provided",M),E(M instanceof Error?M.message:"Error time traveling workflow")}finally{N(!1)}};return l.jsx(ui,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ke,{as:"p",variant:"ui-lg",className:"text-neutral3",children:"Input data"}),l.jsxs(ke,{variant:"ui-xs",className:"text-neutral3",children:["Step: ",e]})]}),l.jsx(boe,{schema:j,defaultValues:h?.payload,isSubmitLoading:C,submitButtonLabel:s,onSubmit:R,children:l.jsxs("div",{className:"space-y-4 pb-4",children:[n||r?null:l.jsxs(l.Fragment,{children:[l.jsx(nQ,{label:"Resume Data (JSON)",value:g,onChange:b,helperText:"Provide any resume payloads that should be passed to the step."}),l.jsx(nQ,{label:"Context (JSON)",value:y,onChange:x,helperText:"Only include top level steps (no nested workflow steps) that are required in the time travel execution.",exampleCode:LTe({stepId:{status:"success",payload:{value:"test value"},output:{value:"test output"}}})}),l.jsx(nQ,{label:"Nested Step Context (JSON)",value:w,onChange:O,helperText:"Includes nested workflow steps that are required in the time travel execution.",exampleCode:LTe({nestedWorkflowId:{stepId:{status:"success",payload:{value:"test value"},output:{value:"test output"}}}})})]}),k&&l.jsx(ke,{variant:"ui-sm",className:"text-accent2",children:k})]})})]})})},xoe=({input:e,output:t,resumeData:n,suspendOutput:r,error:s,tripwire:a,mapConfig:o,stepName:i,stepId:c,onShowNestedGraph:u,status:d,stepKey:f,stepsFlow:p})=>{const[h,g]=S.useState(!1),[b,y]=S.useState(!1),[x,w]=S.useState(!1),[O,k]=S.useState(!1),[E,C]=S.useState(!1),[N,T]=S.useState(!1),[j,R]=S.useState(!1),[P,M]=S.useState(!1),{withoutTimeTravel:U,debugMode:D,result:q,runSnapshot:V,timeTravelWorkflowStream:B,runId:H,workflowId:G,setDebugMode:L}=S.useContext(Zp),{showMapConfig:Z,stepDetail:z,closeStepDetail:I}=H4(),Q=di(),W=q?.status??V?.status,J="max-w-4xl w-full",ne=!U&&f&&!o&&W!=="running"&&W!=="paused",te=f&&D&&W==="paused",ae=S.useMemo(()=>{if(!f||!te)return;const we=p?.[f]??[];if(we.length===0)return;if(we.length>1)return{hasMultiSteps:!0,input:we.reduce((Se,je)=>(q?.steps?.[je]?.status==="success"&&(Se[je]=q?.steps?.[je].output),Se),{})};const Te=we[0];if(q?.steps?.[Te]?.status==="success")return{hasMultiSteps:!1,input:q?.steps?.[Te].output}},[f,p,te,q]),ce=te&&ae&&!q?.steps[f],ve=z?.type==="map-config"&&z?.stepName===i,ee=z?.type==="nested-graph"&&z?.stepName===i,re="ring-2 ring-accent1 ring-offset-1 ring-offset-transparent",ie=()=>{ve?I():Z({stepName:i,stepId:c,mapConfig:o})},ge=()=>{ee?I():u?.()},me=we=>{const Te={runId:H,workflowId:G,step:f,inputData:ae?.hasMultiSteps?void 0:ae?.input,requestContext:Q,...we?{perStep:!1}:{},...ae?.hasMultiSteps?{context:Object.keys(ae.input)?.reduce((Se,je)=>(Se[je]={output:ae.input[je]},Se),{})}:{}};we&&L(!1),B(Te)};return l.jsx(l.Fragment,{children:(e||t||s||a||o||n||u||ne||ce)&&l.jsxs("div",{className:K("flex flex-wrap items-center bg-surface4 border-t border-border1 px-2 py-1 gap-2 rounded-b-lg",d==="success"&&"bg-accent1Dark",d==="failed"&&"bg-accent2Dark",d==="tripwire"&&"bg-amber-900/40 border-amber-500/20",d==="suspended"&&"bg-accent3Dark",d==="waiting"&&"bg-accent5Dark",d==="running"&&"bg-accent6Dark"),children:[u&&l.jsx(he,{onClick:ge,className:K(ee&&re),size:"sm",children:"View nested graph"}),ne&&l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>T(!0),size:"sm",children:"Time travel"}),l.jsx(ds,{open:N,onOpenChange:T,children:l.jsxs(os,{className:J,children:[l.jsxs(fs,{children:[l.jsxs(is,{children:["Time travel to ",f]}),l.jsx(da,{children:"Time travel to a specific workflow step"})]}),l.jsx(ps,{className:"max-h-[600px]",children:l.jsx(rQ,{stepKey:f,closeModal:()=>T(!1)})})]})})]}),ce&&l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>{o?me():M(!0)},size:"sm",children:"Run step"}),l.jsx(ds,{open:P,onOpenChange:M,children:l.jsxs(os,{className:J,children:[l.jsxs(fs,{children:[l.jsxs(is,{children:["Run step ",f]}),l.jsx(da,{children:"Run a specific workflow step"})]}),l.jsx(ps,{className:"max-h-[600px]",children:l.jsx(rQ,{stepKey:f,closeModal:()=>M(!1),isPerStepRun:!0,buttonText:"Run step",inputData:ae?.input})})]})}),l.jsx(he,{onClick:()=>{o?me(!0):R(!0)},size:"sm",children:"Continue run"}),l.jsx(ds,{open:j,onOpenChange:R,children:l.jsxs(os,{className:J,children:[l.jsxs(fs,{children:[l.jsxs(is,{children:["Continue run ",f]}),l.jsx(da,{children:"Continue the workflow run from this step"})]}),l.jsx(ps,{className:"max-h-[600px]",children:l.jsx(rQ,{stepKey:f,closeModal:()=>R(!1),isContinueRun:!0,buttonText:"Continue run",inputData:ae?.input})})]})})]}),o&&l.jsx(he,{onClick:ie,className:K(ve&&re),size:"sm",children:"Map config"}),e&&l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>g(!0),size:"sm",children:"Input"}),l.jsx(ds,{open:h,onOpenChange:g,children:l.jsxs(os,{className:J,children:[l.jsxs(fs,{children:[l.jsxs(is,{children:[i," input"]}),l.jsx(da,{children:"View the input data for this step"})]}),l.jsx(ps,{children:l.jsx(T0,{data:e})})]})})]}),n&&l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>w(!0),size:"sm",children:"Resume data"}),l.jsx(ds,{open:x,onOpenChange:w,children:l.jsxs(os,{className:J,children:[l.jsxs(fs,{children:[l.jsxs(is,{children:[i," resume data"]}),l.jsx(da,{children:"View the resume data for this step"})]}),l.jsx(ps,{children:l.jsx(T0,{data:n})})]})})]}),(t??r)&&l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>y(!0),size:"sm",children:"Output"}),l.jsx(ds,{open:b,onOpenChange:y,children:l.jsxs(os,{className:J,children:[l.jsxs(fs,{children:[l.jsxs(is,{children:[i," output"]}),l.jsx(da,{children:"View the output data for this step"})]}),l.jsx(ps,{children:l.jsx(T0,{data:t??r})})]})})]}),s&&l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>k(!0),size:"sm",children:"Error"}),l.jsx(ds,{open:O,onOpenChange:k,children:l.jsxs(os,{className:J,children:[l.jsxs(fs,{children:[l.jsxs(is,{children:[i," error"]}),l.jsx(da,{children:"View the error details for this step"})]}),l.jsx(ps,{children:l.jsx(T0,{data:s})})]})})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx(he,{onClick:()=>C(!0),className:"text-amber-400 hover:text-amber-300",size:"sm",children:"Tripwire"}),l.jsx(ds,{open:E,onOpenChange:C,children:l.jsxs(os,{className:J,children:[l.jsxs(fs,{children:[l.jsxs(is,{children:[i," tripwire"]}),l.jsx(da,{children:"View the tripwire details for this step"})]}),l.jsx(ps,{children:l.jsx(T0,{data:{reason:a.reason,retry:a.retry,metadata:a.metadata,processorId:a.processorId}})})]})})]})]})})};function BJe({data:e}){const{conditions:t,previousStepId:n,nextStepId:r,withoutTopHandle:s}=e,[a,o]=S.useState(!0),[i,c]=S.useState(!1),u=t[0]?.type,d=(t.some(w=>w.fnString)||t?.length>1)&&u!=="else",{steps:f}=hN(),p=f[n],h=f[r],g=p?.status==="failed"&&p?.tripwire!==void 0,b=g?"tripwire":p?.status,{icon:y,color:x}=ITe(u);return l.jsxs(l.Fragment,{children:[!s&&l.jsx(yc,{type:"target",position:an.Top,style:{visibility:"hidden"}}),l.jsxs("div",{"data-workflow-node":!0,"data-workflow-step-status":b,"data-testid":"workflow-condition-node",className:K("bg-surface3 rounded-lg w-[300px] border border-border1",b==="success"&&h&&"bg-accent1Darker",b==="failed"&&h&&"bg-accent2Darker",b==="tripwire"&&h&&"bg-amber-950/40 border-amber-500/30",!p&&!!h?.status&&"bg-accent1Darker"),children:[l.jsxs(pf,{open:d?a:!0,onOpenChange:w=>{d&&o(w)},children:[l.jsxs(hd,{className:"flex items-center justify-between w-full px-3 py-2",children:[l.jsx(ut,{icon:y?l.jsx(y,{className:"text-current",...x?{style:{color:x}}:{}}):null,children:u?.toUpperCase()}),d&&l.jsx(Oe,{children:l.jsx(xs,{className:K("transition-transform text-neutral3",{"transform rotate-180":a})})})]}),u==="else"?null:l.jsx(md,{className:"flex flex-col gap-2 pb-2",children:t.map((w,O)=>{const k=w.conj||u,{icon:E,color:C}=ITe(k),N=O===0?null:l.jsx(ut,{icon:E?l.jsx(E,{className:"text-current",...C?{style:{color:C}}:{}}):null,children:w.conj?.toLocaleUpperCase()||"WHEN"});return w.fnString?l.jsxs("div",{className:"px-3",children:[l.jsx(vOe,{theme:UZ.oneDark,code:String(w.fnString).trim(),language:"javascript",children:({className:T,style:j,tokens:R,getLineProps:P,getTokenProps:M})=>l.jsx("pre",{className:K("relative font-mono p-3 w-full cursor-pointer rounded-lg text-xs !bg-surface4 whitespace-pre-wrap break-words",T,b==="success"&&h&&"!bg-accent1Dark",b==="failed"&&h&&"!bg-accent2Dark",b==="tripwire"&&h&&"!bg-amber-900/40"),onClick:()=>c(!0),style:j,children:R.map((U,D)=>l.jsxs("div",{...P({line:U}),children:[l.jsx("span",{className:"inline-block mr-2 text-neutral3",children:D+1}),U.map((q,V)=>l.jsx("span",{...M({token:q})},V))]},D))})}),l.jsx(ds,{open:i,onOpenChange:c,children:l.jsxs(os,{className:"max-w-[30rem]",children:[l.jsxs(fs,{children:[l.jsx(is,{className:"sr-only",children:"Condition Function"}),l.jsx(da,{children:"View the condition function code"})]}),l.jsx(ps,{children:l.jsx(Gs,{className:"w-full",maxHeight:"400px",children:l.jsx(vOe,{theme:UZ.oneDark,code:String(w.fnString).trim(),language:"javascript",children:({className:T,style:j,tokens:R,getLineProps:P,getTokenProps:M})=>l.jsx("pre",{className:`${T} relative font-mono text-sm overflow-x-auto p-3 w-full rounded-lg mt-2 dark:bg-zinc-800`,style:{...j,backgroundColor:"#121212",padding:"0 0.75rem 0 0"},children:R.map((U,D)=>l.jsxs("div",{...P({line:U}),children:[l.jsx("span",{className:"inline-block mr-2 text-neutral3",children:D+1}),U.map((q,V)=>l.jsx("span",{...M({token:q})},V))]},D))})})})})]})})]},`${w.fnString}-${O}`):l.jsx(S.Fragment,{children:w.ref?.step?l.jsxs("div",{className:"flex items-center gap-1",children:[N,l.jsxs(ke,{variant:"ui-xs",className:" text-neutral3 flex-1",children:[w.ref.step.id||w.ref.step,"'s ",w.ref.path," ",Object.entries(w.query).map(([T,j])=>`${T} ${String(j)}`)]})]}):null},`${w.ref?.path}-${O}`)})})]}),l.jsx(xoe,{stepName:r,input:p?.output,mapConfig:e.mapConfig,tripwire:g?p?.tripwire:void 0,status:h?b:void 0})]}),l.jsx(yc,{type:"source",position:an.Bottom,style:{visibility:"hidden"}})]})}const HNn=(e,t)=>Number(e.toPrecision(t)),UJe=({startedAt:e,endedAt:t})=>{const[n,r]=S.useState(e);S.useEffect(()=>{const a=setInterval(()=>{r(Date.now())},100);return()=>clearInterval(a)},[e]);const s=t?t-e:n-e;return l.jsxs("span",{className:"text-xs text-neutral3",children:[HNn(s,3),"ms"]})};function VJe({data:e,parentWorkflowName:t,stepsFlow:n}){const{steps:r}=hN(),{label:s,stepId:a,description:o,withoutTopHandle:i,withoutBottomHandle:c,mapConfig:u,duration:d,date:f,isParallel:p,canSuspend:h,isForEach:g}=e,b=t?`${t}.${a||s}`:a||s,y=r[b],x=y?.status==="failed"&&y?.tripwire!==void 0,w=x?"tripwire":y?.status,{isSleepNode:O,isForEachNode:k,isMapNode:E,hasSpecialBadge:C}=IJe({duration:d,date:f,isForEach:g,mapConfig:u,canSuspend:h,isParallel:p});return l.jsxs(l.Fragment,{children:[!i&&l.jsx(yc,{type:"target",position:an.Top,style:{visibility:"hidden"}}),l.jsxs("div",{"data-workflow-node":!0,"data-workflow-step-status":w??"idle","data-testid":"workflow-default-node",className:K("bg-surface3 rounded-lg w-[274px] border border-border1",C?"pt-0":"pt-2",w==="success"&&"bg-accent1Darker",w==="failed"&&"bg-accent2Darker",w==="tripwire"&&"bg-amber-950/40 border-amber-500/30",w==="suspended"&&"bg-accent3Darker",w==="waiting"&&"bg-accent5Darker",w==="running"&&"bg-accent6Darker"),children:[C&&l.jsxs("div",{className:"px-3 pt-2 pb-1 flex gap-1.5 flex-wrap",children:[O&&l.jsx(ut,{icon:f?l.jsx(Qo.sleepUntil,{className:"text-current",style:{color:mo.sleep}}):l.jsx(Qo.sleep,{className:"text-current",style:{color:mo.sleep}}),children:f?"SLEEP UNTIL":"SLEEP"}),h&&l.jsx(ut,{icon:l.jsx(Qo.suspend,{className:"text-current",style:{color:mo.suspend}}),children:"SUSPEND/RESUME"}),p&&l.jsx(ut,{icon:l.jsx(Qo.parallel,{className:"text-current",style:{color:mo.parallel}}),children:"PARALLEL"}),k&&l.jsx(ut,{icon:l.jsx(Qo.forEach,{className:"text-current",style:{color:mo.forEach}}),children:"FOREACH"}),E&&l.jsx(ut,{icon:l.jsx(Qo.map,{className:"text-current",style:{color:mo.map}}),children:"MAP"})]}),l.jsxs("div",{className:K("flex items-center gap-2 px-3",!o&&"pb-2"),children:[l.jsxs(Oe,{children:[w==="tripwire"&&l.jsx(nT,{className:"text-amber-400"}),w==="failed"&&l.jsx(coe,{className:"text-accent2"}),w==="success"&&l.jsx(loe,{className:"text-accent1"}),w==="suspended"&&l.jsx(lDe,{className:"text-accent3"}),w==="waiting"&&l.jsx(yJ,{className:"text-accent5"}),w==="running"&&l.jsx(Ma,{className:"text-accent6 animate-spin"}),!y&&l.jsx(i$,{className:"text-neutral2"})]}),l.jsxs(ke,{variant:"ui-lg",className:"text-neutral6 font-medium inline-flex items-center gap-1 justify-between w-full",children:[s," ",y?.startedAt&&l.jsx(UJe,{startedAt:y.startedAt,endedAt:y.endedAt})]})]}),o&&l.jsx(ke,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:o}),k&&y?.foreachProgress&&l.jsxs("div",{className:"px-3 pb-2 flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 h-1.5 bg-surface1 rounded-full overflow-hidden",children:l.jsx("div",{className:K("h-full rounded-full transition-all duration-300",y.foreachProgress.iterationStatus==="failed"?"bg-accent2":"bg-accent1"),style:{width:`${y.foreachProgress.totalCount>0?y.foreachProgress.completedCount/y.foreachProgress.totalCount*100:0}%`}})}),l.jsxs(ke,{variant:"ui-xs",className:"text-neutral3 whitespace-nowrap",children:[y.foreachProgress.completedCount," / ",y.foreachProgress.totalCount]})]}),d&&l.jsxs(ke,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:["sleeps for ",l.jsxs("strong",{children:[d,"ms"]})]}),f&&l.jsxs(ke,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:["sleeps until ",l.jsx("strong",{children:new Date(f).toLocaleString()})]}),l.jsx(xoe,{stepName:s,stepId:a,input:y?.input,resumeData:y?.resumeData,output:y?.output,suspendOutput:y?.suspendOutput,error:x?void 0:y?.error,tripwire:x?y?.tripwire:void 0,mapConfig:u,status:w,stepKey:b,stepsFlow:n})]}),!c&&l.jsx(yc,{type:"source",position:an.Bottom,style:{visibility:"hidden",color:"red"}})]})}function qJe({data:e}){const{steps:t}=e,[n,r]=S.useState(!0);return l.jsxs(pf,{open:n,onOpenChange:r,className:K("bg-surface4 rounded-md w-[274px] flex flex-col p-2 gap-2"),children:[l.jsx(yc,{type:"target",position:an.Top,style:{visibility:"hidden"}}),l.jsxs(hd,{className:"flex items-center justify-between w-full",children:[l.jsx(ut,{icon:l.jsx(Qo.after,{className:"text-current",style:{color:mo.after}}),children:"AFTER"}),l.jsx(Oe,{children:l.jsx(xs,{className:K("transition-transform text-neutral3",{"transform rotate-180":n})})})]}),l.jsx(md,{className:"flex flex-col gap-2",children:t.map(s=>l.jsxs("div",{className:"text-sm bg-surface5 flex items-center gap-1.5 rounded-sm p-2",children:[l.jsx(eDe,{className:"text-current w-4 h-4"}),l.jsx(ke,{variant:"ui-xs",className:"text-neutral6 capitalize",children:s})]},s))}),l.jsx(yc,{type:"source",position:an.Bottom,style:{visibility:"hidden"}})]})}function HJe({data:e}){const{result:t}=e;return l.jsxs("div",{"data-testid":"workflow-loop-result-node","data-workflow-step-status":t?"success":"failed",className:K("bg-surface4 rounded-md w-[274px]"),"data-workflow-node":!0,children:[l.jsx(yc,{type:"target",position:an.Top,style:{visibility:"hidden"}}),l.jsx("div",{className:"p-2",children:l.jsxs("div",{className:"text-sm bg-surface5 flex items-center gap-1.5 rounded-sm p-2",children:[t?l.jsx(bJ,{className:"text-current w-4 h-4"}):l.jsx(Pw,{className:"text-current w-4 h-4"}),l.jsx(ke,{variant:"ui-xs",className:"text-neutral6 capitalize",children:String(t)})]})}),l.jsx(yc,{type:"source",position:an.Bottom,style:{visibility:"hidden"}})]})}function QJe({data:e,parentWorkflowName:t,stepsFlow:n}){const{steps:r}=hN(),{showNestedGraph:s}=H4(),{label:a,stepId:o,description:i,withoutTopHandle:c,withoutBottomHandle:u,stepGraph:d,mapConfig:f,isParallel:p,canSuspend:h,isForEach:g}=e,b=t?`${t}.${a}`:a,y=t?`${t}.${o||a}`:o||a,x=r[y],w=x?.status==="failed"&&x?.tripwire!==void 0,O=w?"tripwire":x?.status,{isForEachNode:k,isMapNode:E,isNestedWorkflow:C,hasSpecialBadge:N}=IJe({isForEach:g,mapConfig:f,canSuspend:h,isParallel:p,stepGraph:d});return l.jsxs(l.Fragment,{children:[!c&&l.jsx(yc,{type:"target",position:an.Top,style:{visibility:"hidden"}}),l.jsxs("div",{"data-testid":"workflow-nested-node","data-workflow-node":!0,"data-workflow-step-status":O,className:K("bg-surface3 rounded-lg w-[274px] border border-border1",N?"pt-0":"pt-2",O==="success"&&"bg-accent1Darker",O==="failed"&&"bg-accent2Darker",O==="tripwire"&&"bg-amber-950/40 border-amber-500/30",O==="suspended"&&"bg-accent3Darker",O==="waiting"&&"bg-accent5Darker",O==="running"&&"bg-accent6Darker"),children:[N&&l.jsxs("div",{className:"px-3 pt-2 pb-1 flex gap-1.5 flex-wrap",children:[h&&l.jsx(ut,{icon:l.jsx(Qo.suspend,{className:"text-current",style:{color:mo.suspend}}),children:"SUSPEND/RESUME"}),p&&l.jsx(ut,{icon:l.jsx(Qo.parallel,{className:"text-current",style:{color:mo.parallel}}),children:"PARALLEL"}),C&&l.jsx(ut,{icon:l.jsx(Qo.workflow,{className:"text-current",style:{color:mo.workflow}}),children:"WORKFLOW"}),k&&l.jsx(ut,{icon:l.jsx(Qo.forEach,{className:"text-current",style:{color:mo.forEach}}),children:"FOREACH"}),E&&l.jsx(ut,{icon:l.jsx(Qo.map,{className:"text-current",style:{color:mo.map}}),children:"MAP"})]}),l.jsxs("div",{className:K("flex items-center gap-2 px-3",!i&&"pb-2"),children:[l.jsxs(Oe,{children:[O==="failed"&&l.jsx(coe,{className:"text-accent2"}),O==="success"&&l.jsx(loe,{className:"text-accent1"}),O==="tripwire"&&l.jsx(nT,{className:"text-amber-400"}),O==="suspended"&&l.jsx(lDe,{className:"text-accent3"}),O==="waiting"&&l.jsx(yJ,{className:"text-accent5"}),O==="running"&&l.jsx(Ma,{className:"text-accent6 animate-spin"}),!x&&l.jsx(i$,{className:"text-neutral2"})]}),l.jsxs(ke,{variant:"ui-lg",className:"text-neutral6 font-medium inline-flex items-center gap-1 justify-between w-full",children:[a," ",x?.startedAt&&l.jsx(UJe,{startedAt:x.startedAt,endedAt:x.endedAt})]})]}),i&&l.jsx(ke,{variant:"ui-sm",className:"text-neutral3 px-3 pb-2",children:i}),k&&x?.foreachProgress&&l.jsxs("div",{className:"px-3 pb-2 flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 h-1.5 bg-surface1 rounded-full overflow-hidden",children:l.jsx("div",{className:K("h-full rounded-full transition-all duration-300",x.foreachProgress.iterationStatus==="failed"?"bg-accent2":"bg-accent1"),style:{width:`${x.foreachProgress.totalCount>0?x.foreachProgress.completedCount/x.foreachProgress.totalCount*100:0}%`}})}),l.jsxs(ke,{variant:"ui-xs",className:"text-neutral3 whitespace-nowrap",children:[x.foreachProgress.completedCount," / ",x.foreachProgress.totalCount]})]}),l.jsx(xoe,{stepName:a,stepId:o,input:x?.input,resumeData:x?.resumeData,output:x?.output,suspendOutput:x?.suspendOutput,error:x?.error,tripwire:w?x?.tripwire:void 0,mapConfig:f,onShowNestedGraph:()=>s({label:a,fullStep:b,stepGraph:d}),status:O,stepKey:y,stepsFlow:n})]}),!u&&l.jsx(yc,{type:"source",position:an.Bottom,style:{visibility:"hidden"}})]})}const Y2=S.forwardRef(({className:e,...t},n)=>l.jsxs(WMe,{ref:n,className:K("relative flex w-full touch-none select-none items-center group",e),...t,children:[l.jsx(nbt,{className:K("relative h-1.5 w-full grow overflow-hidden rounded-full bg-neutral2",$n.colors),children:l.jsx(rbt,{className:K("absolute h-full bg-accent1",$n.all)})}),l.jsx(sbt,{className:K("block h-4 w-4 rounded-full border-2 border-accent1 bg-white shadow-md","transition-all duration-normal ease-out-custom",uN,"hover:scale-110 hover:shadow-lg","active:scale-95","disabled:pointer-events-none disabled:opacity-50")})]}));Y2.displayName=WMe.displayName;const woe=S.forwardRef(({className:e,...t})=>{const{zoom:n}=ztn(),{zoomTo:r,zoomIn:s,zoomOut:a,fitView:o}=KD();return l.jsxs(HT,{className:K("flex gap-1 rounded-md bg-surface2 p-1 text-neutral6",e),...t,children:[l.jsx(he,{onClick:()=>a({duration:300}),children:l.jsx(Xxt,{className:"h-4 w-4"})}),l.jsx(Y2,{className:"w-[140px]",value:[n],min:.01,max:1,step:.01,onValueChange:i=>{r(i[0])}}),l.jsx(he,{onClick:()=>s({duration:300}),children:l.jsx(cs,{className:"h-4 w-4"})}),l.jsxs(he,{className:"min-w-20 tabular-nums",onClick:()=>r(1,{duration:300}),children:[(100*n).toFixed(0),"%"]}),l.jsx(he,{onClick:()=>o({duration:300,maxZoom:1}),children:l.jsx(Qxt,{className:"h-4 w-4"})})]})});woe.displayName="ZoomSlider";function QNn({workflow:e}){const{nodes:t,edges:n}=RJe(e),[r,s,a]=fHe(t),[o]=pHe(n),{steps:i}=hN(),c=S.useMemo(()=>n.reduce((d,f)=>{if(f.data){const p=f.data.nextStepId,h=f.data.previousStepId;return{...d,[p]:[...new Set([...d[p]||[],h])]}}return d},{}),[n]),u={"default-node":d=>l.jsx(VJe,{...d,stepsFlow:c}),"condition-node":BJe,"after-node":qJe,"loop-result-node":HJe,"nested-node":d=>l.jsx(QJe,{...d,stepsFlow:c})};return l.jsx("div",{className:"w-full h-full bg-surface1",children:l.jsxs(dHe,{nodes:r,edges:o.map(d=>({...d,style:{...d.style,stroke:i[d.data?.previousStepId]?.status==="success"&&i[d.data?.nextStepId]||d.data?.conditionNode&&!i[d.data?.previousStepId]&&i[d.data?.nextStepId]?.status?"#22c55e":void 0}})),nodeTypes:u,onNodesChange:a,fitView:!0,fitViewOptions:{maxZoom:1},minZoom:.01,maxZoom:1,children:[l.jsx(woe,{position:"bottom-left"}),l.jsx(mHe,{variant:Sp.Dots,gap:12,size:.5})]})})}function GJe({workflowId:e,workflow:t,isLoading:n}){const{snapshot:r}=S.useContext(Zp);return n?l.jsx("div",{className:"p-4",children:l.jsx(On,{className:"h-full"})}):t?l.jsx(Mre,{children:l.jsx(QNn,{workflow:r?.serializedStepGraph?{stepGraph:r?.serializedStepGraph}:t})}):l.jsx("div",{className:"grid h-full place-items-center",children:l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[l.jsx(Zd,{}),l.jsxs("div",{children:["We couldn't find ",XTn(e)," workflow."]})]})})}const GNn=e=>e&&Object.keys(e).length===0&&e.constructor===Object;async function WNn(e){const{baseUrl:t="",headers:n={},apiPrefix:r}=e.options,s=(r||"/api").trim(),a=(s.startsWith("/")?s:`/${s}`).replace(/\/$/,""),o=await fetch(`${t}${a}/auth/capabilities`,{credentials:"include",headers:{"Content-Type":"application/json",...n}});if(!o.ok)throw new Error(`Failed to fetch auth capabilities: ${o.status}`);return o.json()}function _1(){const e=Xe();return Qt({queryKey:["auth","capabilities"],queryFn:()=>WNn(e),staleTime:60*1e3,retry:!1})}function yN(e){return"user"in e&&e.user!==void 0}function ZNn(e,t){if(e==="*")return!0;const n=e.split(":"),r=t.split(":");if(n.length<2||r.length<2)return e===t;const[s,a,o]=n,[i,c,u]=r;return s==="*"?a==="*"?!0:a!==c?!1:o===void 0?!0:o===u:s!==i?!1:a==="*"?o===void 0?!0:o===u:a!==c?!1:o===void 0?!0:o===u}function sQ(e,t){return e.some(n=>ZNn(n,t))}function kf(){const{data:e,isLoading:t}=_1(),n=e&&yN(e),r=n?e.access:null,s=n?e.capabilities.rbac:!1,a=r?.roles??[],o=r?.permissions??[],i=c=>s?sQ(o,c):!0;return{roles:a,permissions:o,isLoading:t,isAuthenticated:!!n,rbacEnabled:s,hasPermission:c=>i(c),hasAllPermissions:c=>s?c.every(u=>sQ(o,u)):!0,hasAnyPermission:c=>s?c.some(u=>sQ(o,u)):!0,hasRole:c=>s?a.includes(c):!0,canEdit:c=>i(`${c}:write`),canDelete:c=>i(`${c}:delete`),canExecute:c=>i(`${c}:execute`)}}function YNn(e,t){return S.useMemo(()=>Object.entries(e?.steps||{}).filter(([n,{status:r}])=>r==="suspended").map(([n,{suspendPayload:r}])=>({stepId:n,runId:t,suspendPayload:r,isLoading:!1})),[e?.steps,t])}function XNn(e){return S.useMemo(()=>{const t=e?.inputSchema,n=e?.stateSchema,r=t?hf(ff(ob(t))):null,s=n?hf(ff(ob(n))):null;return{zodSchemaToUse:s?Ae({inputData:r,initialState:s.optional()}):r,hasStateSchema:!!n}},[e?.inputSchema,e?.stateSchema])}function KNn({zodSchema:e,isStreaming:t,onExecute:n,defaultValues:r,isViewingRun:s,isProcessorWorkflow:a}){return e?l.jsx(boe,{schema:e,defaultValues:r,isSubmitLoading:t,submitButtonLabel:"Run",onSubmit:n,withoutSubmit:s,isProcessorWorkflow:a}):s?null:l.jsx(he,{className:"w-full",variant:"light",disabled:t,onClick:()=>n(null),children:t?l.jsx(Oe,{children:l.jsx(Ma,{className:"animate-spin"})}):"Trigger"})}function JNn({suspendedSteps:e,workflow:t,isStreaming:n,onResume:r}){return n||e.length===0?null:l.jsx(l.Fragment,{children:e.map(s=>{const a=t.allSteps[s.stepId];if(!a||a.isWorkflow)return null;const o=a?.resumeSchema?hf(ff(ob(a.resumeSchema))):qr(pe(),_l());return l.jsxs("div",{className:"flex flex-col px-4",children:[l.jsx(ke,{variant:"ui-xs",className:"text-neutral3",children:s.stepId}),s.suspendPayload&&l.jsx("div",{"data-testid":"suspended-payload",children:l.jsx(ea,{data:s.suspendPayload,className:"w-full overflow-x-auto p-2",showCopyButton:!1})}),l.jsx(boe,{schema:o,isSubmitLoading:n,submitButtonLabel:"Resume workflow",onSubmit:i=>{const c=s.stepId?.split(".");r({stepId:c,runId:s.runId,suspendPayload:s.suspendPayload,resumeData:i,isLoading:!1})}})]},s.stepId)})})}const eAn=["success","failed","canceled","tripwire"];function tAn({status:e,cancelMessage:t,isCancelling:n,onCancel:r}){return e!=="running"?null:l.jsxs(he,{variant:"light",className:"w-full",onClick:r,disabled:!!t||n||e&&eAn.includes(e),children:[n?l.jsx(Oe,{children:l.jsx(Ma,{className:"animate-spin"})}):l.jsx(Oe,{children:l.jsx(Z$e,{})}),t||"Cancel Workflow Run"]})}const nAn=({header:e,children:t,footer:n})=>{const[r,s]=S.useState(!1);return l.jsxs("div",{className:"rounded-lg border border-border1 bg-surface4",children:[l.jsxs("button",{className:"py-1 px-2 flex items-center gap-3 justify-between w-full",onClick:()=>s(a=>!a),children:[l.jsx("div",{className:"w-full",children:e}),l.jsx(Oe,{children:l.jsx(xs,{className:K("text-neutral3 transition-transform -rotate-90",r&&"rotate-0")})})]}),t&&r&&l.jsx("div",{className:"border-t border-border1 max-h-[400px] overflow-y-auto",children:t}),n&&l.jsx("div",{className:"py-1 px-2 border-t border-border1",children:n})]})},rAn=({stepId:e,status:t,result:n,tripwire:r})=>{const[s,a]=S.useState(!1),o=t==="tripwire",i=!!(r&&(r.retry!==void 0||r.metadata!==void 0||r.processorId!==void 0));return l.jsx(nAn,{header:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Oe,{children:[t==="success"&&l.jsx(loe,{className:"text-accent1"}),t==="failed"&&l.jsx(coe,{className:"text-accent2"}),t==="tripwire"&&l.jsx(nT,{className:"text-amber-400"}),t==="suspended"&&l.jsx(G$e,{className:"text-accent3"}),t==="waiting"&&l.jsx(yJ,{className:"text-accent5"}),t==="running"&&l.jsx(Ma,{className:"text-accent6 animate-spin"})]}),l.jsx(ke,{as:"span",variant:"ui-lg",className:"text-neutral6 font-medium",children:e.charAt(0).toUpperCase()+e.slice(1)})]}),children:o&&r?l.jsx(sAn,{tripwire:r,isExpanded:s,onToggleExpand:()=>a(!s),hasMetadata:i}):l.jsx(ea,{data:n})})},sAn=({tripwire:e,isExpanded:t,onToggleExpand:n,hasMetadata:r})=>l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-950/20 overflow-hidden",children:[l.jsxs("div",{className:"flex items-start gap-3 p-4",children:[l.jsx(nT,{className:"w-5 h-5 text-amber-400 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-200 mb-1",children:"Content Blocked"}),l.jsx("p",{className:"text-sm text-amber-300/90",children:e.reason||"Tripwire triggered"})]})]}),r&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:n,className:"w-full flex items-center gap-2 px-4 py-2 text-xs text-amber-400/70 hover:text-amber-400 hover:bg-amber-900/20 transition-colors border-t border-amber-500/20",children:[t?l.jsx(xs,{className:"w-3.5 h-3.5"}):l.jsx(qs,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:"Details"})]}),t&&l.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-amber-500/20 bg-amber-950/10",children:[e.retry!==void 0&&l.jsxs("div",{className:"flex items-center gap-2 pt-3",children:[l.jsx(tT,{className:"w-3.5 h-3.5 text-amber-400/60"}),l.jsxs("span",{className:"text-xs text-amber-300/70",children:["Retry:"," ",e.retry?l.jsx("span",{className:"text-green-400",children:"Allowed"}):l.jsx("span",{className:"text-red-400",children:"Not allowed"})]})]}),e.processorId&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(SJ,{className:"w-3.5 h-3.5 text-amber-400/60"}),l.jsxs("span",{className:"text-xs text-amber-300/70",children:["Processor:"," ",l.jsx("code",{className:"px-1.5 py-0.5 rounded bg-amber-900/30 text-amber-200 font-mono",children:e.processorId})]})]}),e.metadata!==void 0&&e.metadata!==null&&l.jsxs("div",{className:"pt-1",children:[l.jsx("p",{className:"text-xs text-amber-400/60 mb-1.5",children:"Metadata:"}),l.jsx("pre",{className:"text-xs text-amber-200/80 bg-amber-900/30 rounded p-2 overflow-x-auto font-mono",children:String(JSON.stringify(e.metadata,null,2))})]})]})]})]});function aAn({steps:e,workflowResult:t}){const n=Object.entries(e).filter(([r,s])=>r!=="input"&&!r.endsWith(".input"));return n.length===0?null:l.jsxs("div",{className:"flex flex-col gap-2 pt-5 border-t border-border1",children:[l.jsx(ke,{variant:"ui-xs",className:"text-neutral3",children:"Status"}),l.jsx("div",{className:"flex flex-col gap-4",children:n.map(([r,s])=>{const{status:a}=s;let o,i,c;s.status==="suspended"&&(i=s.suspendOutput),s.status==="success"&&(o=s.output),s.status==="failed"&&(c=s.error);const u=s.status==="failed"&&s.tripwire?s.tripwire:t?.status==="tripwire"?{reason:t?.tripwire?.reason,retry:t?.tripwire?.retry,metadata:t?.tripwire?.metadata,processorId:t?.tripwire?.processorId}:void 0,d=s.status==="failed"&&s.tripwire?"tripwire":a;return l.jsx(rAn,{stepId:r,status:d,result:o??i??c??{},tripwire:u},r)})})]})}function WJe({workflowId:e,paramsRunId:t,setRunId:n,workflow:r,isLoading:s,createWorkflowRun:a,resumeWorkflow:o,streamWorkflow:i,observeWorkflowStream:c,isStreamingWorkflow:u,streamResult:d,isCancellingWorkflowRun:f,cancelWorkflowRun:p}){const h=di(),{result:g,setResult:b,payload:y,setPayload:x,setRunId:w}=S.useContext(Zp),{canExecute:O}=kf(),k=O("workflows"),[E,C]=S.useState(""),[N,T]=S.useState(null),j=g??d,R=YNn(j,E),{zodSchemaToUse:P,hasStateSchema:M}=XNn(r),U=async G=>{try{if(!r)return;T(null),b(null);const L=await a({workflowId:e});n?.(L.runId),C(L.runId),w(L.runId);const{initialState:Z,inputData:z}=G??{},I=M?z:G;i({workflowId:e,runId:L.runId,inputData:I,initialState:Z,requestContext:h})}catch{qe.error("Error executing workflow")}},D=async G=>{if(!r)return;T(null);const{stepId:L,runId:Z,resumeData:z}=G,I=await a({workflowId:e,prevRunId:Z});await o({step:L,runId:I.runId,resumeData:z,workflowId:e,requestContext:h})},q=async()=>{const G=await p({workflowId:e,runId:E});T(G)};if(S.useEffect(()=>{t&&c&&(c({workflowId:e,runId:t}),C(t),w(t))},[t]),S.useEffect(()=>{d&&b(d)},[d]),s)return l.jsx(Gs,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(On,{className:"h-10"}),l.jsx(On,{className:"h-10"})]})});if(!r)return null;const V=R.length>0,B=j?.steps??{},H=Object.values(B).length>0;return l.jsxs("div",{className:"h-full pt-3 overflow-y-auto",children:[l.jsxs("div",{className:"space-y-4 px-5 pb-5 border-b border-border1",children:[V&&u&&l.jsxs("div",{className:"py-2 px-5 flex items-center gap-2 bg-surface5 -mx-5 -mt-5 border-b border-border1",children:[l.jsx(Oe,{children:l.jsx(Ma,{className:"animate-spin text-neutral6"})}),l.jsx(ke,{children:"Resuming workflow"})]}),!V&&k&&l.jsx(KNn,{zodSchema:P,defaultValues:y,isStreaming:u,onExecute:G=>{x(G),U(G)},isViewingRun:!!t,isProcessorWorkflow:r?.isProcessorWorkflow}),!V&&!k&&l.jsx(ke,{variant:"ui-sm",className:"text-neutral3 py-2",children:"You don't have permission to execute workflows."}),l.jsx(JNn,{suspendedSteps:R,workflow:r,isStreaming:u,onResume:D}),l.jsx(tAn,{status:g?.status,cancelMessage:N?.message??null,isCancelling:f,onCancel:q}),H&&l.jsx(aAn,{steps:B,workflowResult:j})]}),g&&!GNn(g)&&l.jsx("div",{className:"p-5 border-b border-border1",children:l.jsx(oAn,{result:g})})]})}const oAn=({result:e})=>{const[t,n]=S.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsxs(he,{variant:"light",onClick:()=>n(!0),className:"w-full truncate",children:[l.jsx(Oe,{children:l.jsx(fu,{className:"text-neutral3"})}),"Open Workflow Execution (JSON)"]}),l.jsx(ds,{open:t,onOpenChange:n,children:l.jsxs(os,{className:"max-w-6xl",children:[l.jsxs(fs,{children:[l.jsx(is,{children:"Workflow Execution (JSON)"}),l.jsx(da,{children:"JSON view of the workflow execution result"})]}),l.jsx(ps,{className:"max-h-[90vh]",children:l.jsx(ea,{data:e,className:"p-4"})})]})})]})},iAn=({workflowId:e,runId:t,observeWorkflowStream:n,...r})=>{const{runSnapshot:s,isLoadingRunExecutionResult:a}=S.useContext(Zp);if(a)return l.jsx("div",{className:"p-4",children:l.jsx(On,{className:"h-[600px]"})});if(!s||!t)return l.jsx("div",{className:"p-4",children:l.jsx(ke,{variant:"ui-md",className:"text-neutral6 text-center",children:"No previous run"})});const o=YY(s),i=o?.status;if(t)return l.jsx("div",{className:"h-full grid grid-rows-[1fr_auto]",children:l.jsx(WJe,{...r,paramsRunId:t,workflowId:e,observeWorkflowStream:()=>{i!=="success"&&i!=="failed"&&i!=="canceled"&&n?.({workflowId:e,runId:t,storeRunResult:o})}})})};function Il({iconSlot:e,titleSlot:t,descriptionSlot:n,actionSlot:r,className:s,as:a="h3"}){return l.jsxs("div",{className:K("flex flex-col items-center justify-center text-center py-10 px-6","transition-opacity duration-normal ease-out-custom",s),children:[e&&l.jsx("div",{className:"mb-4",children:e}),l.jsx(a,{className:"font-medium text-neutral5 text-ui-md",children:t}),n&&l.jsx("p",{className:"mt-1.5 text-neutral3 text-ui-sm max-w-md",children:n}),r&&l.jsx("div",{className:"mt-5",children:r})]})}function io({resource:e,title:t,description:n,actionSlot:r,className:s}){const a="Permission Denied",o=e?`You don't have permission to access ${e}. Contact your administrator for access.`:"You don't have permission to access this resource. Contact your administrator for access.";return l.jsx(Il,{className:s,iconSlot:l.jsx(Oe,{size:"lg",className:"text-neutral3",children:l.jsx(U0t,{})}),titleSlot:t??a,descriptionSlot:n??o,actionSlot:r})}const lAn={default:"[&>tbody>tr]:h-table-row",small:"[&>tbody>tr]:h-table-row-small"},Ni=({className:e,children:t,size:n="default",style:r})=>l.jsx("table",{className:K("w-full",lAn[n],e),style:r,children:t}),Ai=({className:e,children:t})=>l.jsx("thead",{children:l.jsx("tr",{className:K("h-table-header border-b border-border1 bg-surface2/80",e),children:t})}),ra=({className:e,children:t,...n})=>l.jsx("th",{className:K("text-neutral2 text-ui-xs h-full whitespace-nowrap text-left font-medium uppercase tracking-wide first:pl-3 last:pr-3",e),...n,children:t}),ji=({className:e,children:t,...n})=>l.jsx("tbody",{className:K("",e),...n,children:t}),Ri=S.forwardRef(({className:e,children:t,selected:n=!1,style:r,onClick:s,isActive:a=!1,...o},i)=>{const c=S.useRef(null);S.useEffect(()=>{i&&(typeof i=="function"?i(c.current):i.current=c.current)},[i]),S.useEffect(()=>{a&&c.current&&(c.current.focus(),c.current.scrollIntoView({block:"nearest"}))},[a]);const u=d=>{d.key==="Enter"&&s&&s()};return l.jsx("tr",{className:K("border-b border-border1","transition-colors duration-normal ease-out-custom","hover:bg-surface3","focus:bg-surface3 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent1/50",n&&"bg-surface4",s&&"cursor-pointer",e),style:r,onClick:s,ref:c,tabIndex:s?0:void 0,onKeyDown:u,"data-active":a||void 0,...o,children:t})}),Ss=({className:e,children:t,...n})=>l.jsx("td",{className:K("text-neutral5 first:pl-3 last:pr-3",e),...n,children:l.jsx("div",{className:K("flex h-full w-full shrink-0 items-center"),children:t})}),Ib=({name:e,description:t,icon:n,meta:r,...s})=>l.jsx(Ss,{...s,children:l.jsxs("div",{className:"flex items-center gap-3.5",children:[n&&l.jsx(Oe,{size:"lg",className:"text-neutral5",children:n}),l.jsxs("div",{className:"flex flex-col gap-0",children:[l.jsx(ke,{as:"span",variant:"ui-md",className:"text-neutral6 !leading-tight",children:e}),t&&l.jsx(ke,{as:"span",variant:"ui-xs",className:"text-neutral3 w-full max-w-[300px] truncate !leading-tight pt-1",children:t})]}),r]})});function gx({itemCount:e,initialIndex:t=-1,wrap:n=!1,onSelect:r,global:s=!1}){const[a,o]=S.useState(t),i=S.useCallback(u=>{if(e!==0)switch(u.key){case"ArrowDown":{u.preventDefault(),o(d=>d===-1?0:d>=e-1?n?0:e-1:d+1);break}case"ArrowUp":{u.preventDefault(),o(d=>d===-1?e-1:d<=0?n?e-1:0:d-1);break}case"Home":{u.preventDefault(),o(0);break}case"End":{u.preventDefault(),o(e-1);break}case"Enter":{a>=0&&r&&(u.preventDefault(),r(a));break}}},[e,n,a,r]);S.useEffect(()=>{if(s)return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[s,i]);const c=S.useCallback(()=>s?null:{onKeyDown:i,tabIndex:0},[s,i]);return{activeIndex:a,setActiveIndex:o,getKeyboardProps:c}}const FTe=40,_R=150,zTe=10,Pb=({className:e,children:t,scrollSpeed:n=100,scrollIntervalTime:r=20})=>{const s=S.useRef(null),a=S.useRef(null),[o,i]=S.useState(0),[c,u]=S.useState(0),[d,f]=S.useState(0),[p,h]=S.useState(0),[g,b]=S.useState(!1),[y,x]=S.useState(!1);S.useEffect(()=>{const E=()=>{if(!s.current)return;const j=s.current.scrollLeft<s.current.scrollWidth-s.current.clientWidth;b(j),i(s.current.clientHeight);const R=s.current.getBoundingClientRect();u(R.right),h(R.left),f(R.top)};E();const C=new ResizeObserver(E);s.current&&C.observe(s.current);const N=()=>{if(!s.current)return;const j=s.current.scrollLeft>0,R=s.current.scrollLeft<s.current.scrollWidth-s.current.clientWidth;x(j),b(R),E()};s?.current?.addEventListener("scroll",N);const T=s.current;return()=>{T&&(C.unobserve(T),T.removeEventListener("scroll",N))}},[]);const w=({isVisible:E,position:C,containerHeight:N,containerTop:T,containerRight:j,onStartScrolling:R,onStopScrolling:P})=>{if(!E)return null;const M={top:N<_R?T:T+(N-_R)/2,width:FTe,height:N<_R?`${N}px`:`${_R}px`};return l.jsxs("button",{onMouseDown:R,onTouchStart:R,onMouseUp:P,onTouchEnd:P,onTouchCancel:P,className:"bg-surface4 text-neutral3 border-surface5 hover:border-neutral3 fixed z-10 flex items-center justify-center rounded-lg border text-2xl hover:text-white",style:{...M,left:C==="left"?p+zTe:j-FTe-zTe},children:[" ",C==="left"?"«":"»"]})},O=S.useCallback((E,C)=>{C?.preventDefault(),C?.stopPropagation(),a.current&&(clearInterval(a.current),a.current=null),s.current&&s.current.scrollBy({left:E==="right"?n*2:-n*2,behavior:"smooth"}),a.current=setInterval(()=>{s.current&&s.current.scrollBy({left:E==="right"?n:-n,behavior:"smooth"})},r)},[n,r]),k=S.useCallback(()=>{a.current&&(clearInterval(a.current),a.current=null)},[]);return l.jsxs("div",{ref:s,className:K("relative max-h-full overflow-auto",e),children:[t,l.jsx(w,{isVisible:y,position:"left",containerHeight:o,containerTop:d,containerRight:c,onStartScrolling:E=>O("left",E),onStopScrolling:k}),l.jsx(w,{isVisible:g,position:"right",containerHeight:o,containerTop:d,containerRight:c,onStartScrolling:E=>O("right",E),onStopScrolling:k})]})},cAn=[{id:"name",header:"Name",cell:({row:e})=>{const{Link:t,paths:n}=Lt(),r=e.original;return l.jsx(Ib,{name:l.jsx(t,{href:n.workflowLink(e.original.id),children:e.original.name}),description:r.description,meta:void 0})},meta:{width:"auto"}},{id:"stepsCount",header:"Steps",size:300,cell:({row:e})=>{const t=e.original,n=Object.keys(t.steps??{}).length;return l.jsx(Ss,{children:l.jsx("div",{className:"flex justify-end items-center gap-2",children:l.jsxs(ut,{icon:l.jsx(eDe,{}),className:"!h-form-sm",children:[n," step",n>1?"s":""]})})})}}],BTe={sm:Wi.sm,md:Wi.md,lg:Wi.lg,default:Wi.default},_u=({onSearch:e,label:t,placeholder:n,debounceMs:r=300,size:s="md"})=>{const a=S.useId(),o=S.useRef(null),i=WT(u=>{e(u)},r);S.useEffect(()=>()=>{i.cancel()},[i]),S.useEffect(()=>{const u=o.current;if(!u)return;const d=f=>{f.key.toLowerCase()==="f"&&f.shiftKey&&(f.ctrlKey||f.metaKey)&&(f.preventDefault(),u.focus())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]);const c=u=>{i(u.target.value)};return l.jsxs("div",{className:K("border border-border1 flex w-full items-center gap-2 overflow-hidden pl-2 pr-1",GCn,QCn,$n.all,"hover:border-neutral2",BTe[s]),children:[l.jsx(Lp,{className:K("text-neutral3 h-4 w-4",$n.colors)}),l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{htmlFor:a,className:"sr-only",children:t}),l.jsx("input",{id:a,type:"text",placeholder:n,className:K("bg-transparent text-ui-md placeholder:text-neutral3 block w-full px-2 outline-none",BTe[s]),name:a,ref:o,onChange:c})]})]})},vm=({children:e})=>l.jsx("div",{className:"px-3 py-2.5 border-b border-border1",children:e});function uAn({workflows:e,isLoading:t,error:n}){const[r,s]=S.useState(""),{navigate:a,paths:o}=Lt(),i=S.useMemo(()=>Object.keys(e??{}).map(g=>{const b=e[g];return{id:g,...b}}),[e]),c=S.useMemo(()=>i.filter(h=>h.name.toLowerCase().includes(r.toLowerCase())),[i,r]),{activeIndex:u}=gx({itemCount:c.length,global:!0,onSelect:h=>{const g=c[h];g&&a(o.workflowLink(g.id))}}),d=Eb({data:c,columns:cAn,getCoreRowModel:_b()}),f=d.getHeaderGroups()[0],p=d.getRowModel().rows;return n&&ba(n)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"workflows"})}):i.length===0&&!t?l.jsx(fAn,{}):l.jsxs("div",{children:[l.jsx(vm,{children:l.jsx(_u,{onSearch:s,label:"Search workflows",placeholder:"Search workflows"})}),t?l.jsx(dAn,{}):l.jsx(Pb,{children:l.jsxs(Ni,{children:[l.jsx(Ai,{className:"sticky top-0",children:f.headers.map(h=>l.jsx(ra,{style:{width:h.index===0?"auto":h.column.getSize()},children:el(h.column.columnDef.header,h.getContext())},h.id))}),l.jsx(ji,{children:p.map((h,g)=>l.jsx(Ri,{isActive:g===u,onClick:()=>a(o.workflowLink(h.original.id)),children:h.getVisibleCells().map(b=>l.jsx(be.Fragment,{children:el(b.column.columnDef.cell,b.getContext())},b.id))},h.id))})]})})]})}const dAn=()=>l.jsxs(Ni,{children:[l.jsxs(Ai,{children:[l.jsx(ra,{children:"Name"}),l.jsx(ra,{width:300,children:"Steps"})]}),l.jsx(ji,{children:Array.from({length:3}).map((e,t)=>l.jsxs(Ri,{children:[l.jsx(Ss,{children:l.jsx(On,{className:"h-4 w-1/2"})}),l.jsx(Ss,{width:300,children:l.jsx(On,{className:"h-4 w-1/2"})})]},t))})]}),fAn=()=>l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(Il,{iconSlot:l.jsx(fTn,{}),titleSlot:"Configure Workflows",descriptionSlot:"Mastra workflows are not configured yet. You can find more information in the documentation.",actionSlot:l.jsxs(he,{size:"lg",className:"w-full",variant:"light",as:"a",href:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",children:[l.jsx(Oe,{children:l.jsx(tl,{})}),"Docs"]})})}),ZJe=({icon:e,title:t,isLoading:n,children:r})=>l.jsxs("div",{className:"p-5 w-full overflow-x-hidden",children:[l.jsxs("div",{className:"text-neutral6 flex items-center gap-2",children:[l.jsx(Oe,{size:"lg",className:"bg-surface4 rounded-md p-1",children:e}),n?l.jsx(On,{className:"h-3 w-1/3"}):l.jsx("div",{className:"flex min-w-0 items-center gap-4",children:l.jsx(ke,{variant:"header-md",as:"h2",className:"truncate font-medium",children:t})})]}),r&&l.jsx("div",{className:"pt-2",children:r})]}),E1=({children:e,defaultTab:t,value:n,onValueChange:r,className:s})=>{const[a,o]=S.useState(t),i=n!==void 0&&r!==void 0,c=i?n:a,u=d=>{const f=d;i?r(f):o(f)};return l.jsx(fbt,{value:c,onValueChange:u,className:K("overflow-y-auto",s),children:e})},C1=({children:e,variant:t="default",className:n})=>l.jsx("div",{className:K("w-full overflow-x-auto",n),children:l.jsx(pbt,{className:K("flex items-center relative",{"text-ui-lg":t==="default","[&>button]:py-2 [&>button]:px-6 [&>button]:font-normal [&>button]:text-neutral3 [&>button]:flex-1 [&>button]:border-b [&>button]:border-border1":t==="default",[`[&>button]:${$n.colors} [&>button]:hover:text-neutral4`]:t==="default","[&>button[data-state=active]]:text-neutral5 [&>button[data-state=active]]:border-white/50":t==="default","border border-border1 flex justify-stretch rounded-md overflow-hidden text-ui-md min-h-[2.5rem]":t==="buttons",[`[&>button]:flex-1 [&>button]:py-2 [&>button]:px-4 [&>button]:text-neutral3 [&>button]:${$n.all}`]:t==="buttons","[&>button]:hover:text-neutral4 [&>button]:hover:bg-surface3":t==="buttons","[&>button[data-state=active]]:text-neutral5 [&>button[data-state=active]]:bg-surface4 [&>button[data-state=active]]:shadow-inner":t==="buttons"},n),children:e})}),Si=({children:e,value:t,onClick:n,onClose:r,className:s})=>l.jsxs(hbt,{value:t,className:K("text-sm p-3 text-neutral3 whitespace-nowrap flex-shrink-0 flex items-center justify-center gap-1.5",$n.all,Rb.visible,"hover:text-neutral4","data-[state=active]:text-neutral5 data-[state=active]:border-b-2 data-[state=active]:border-white/50",s),onClick:n,children:[e,r&&l.jsx("button",{onClick:a=>{a.stopPropagation(),r()},className:K("p-0.5 hover:bg-surface4 rounded",$n.colors,"hover:text-neutral5"),"aria-label":"Close tab",children:l.jsx(Gr,{className:"w-3 h-3"})})]}),kl=({children:e,value:t,className:n})=>l.jsx(mbt,{value:t,className:K("grid py-3 overflow-y-auto ring-offset-background",Rb.visible,n),children:e}),pAn=()=>{const{debugMode:e,setDebugMode:t}=S.useContext(Zp);return l.jsxs(l.Fragment,{children:[l.jsx(ke,{as:"h3",variant:"ui-md",className:"text-neutral3",children:"Debug Mode"}),l.jsx(Sc,{checked:e,onCheckedChange:n=>t(n)})]})},YJe=()=>{const e=ym(),{settings:t,setSettings:n,entityType:r}=hoe(),s=o=>{if(!o)return n({...t,tracingOptions:void 0});try{const i=JSON.parse(o);typeof i=="object"&&i!==null&&n({...t,tracingOptions:i})}catch{}};let a="{}";try{a=JSON.stringify(t?.tracingOptions,null,2)}catch{}return l.jsxs("div",{className:"space-y-2 px-5 py-2",children:[l.jsx(ke,{as:"h3",variant:"ui-md",className:"text-neutral3",children:"Tracing Options"}),l.jsx(pu,{value:a,onChange:s,theme:e,extensions:[au],className:"h-[400px] overflow-y-scroll bg-surface3 rounded-lg overflow-hidden p-3"}),r==="workflow"&&l.jsx(pAn,{})]})},hAn={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};function jn({color:e,className:t,size:n="md"}){return l.jsx("svg",{className:K("animate-spin",hAn[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"})})}function mAn({stepGraph:e,open:t,workflowName:n}){const{nodes:r,edges:s}=RJe({stepGraph:e}),[a,o]=S.useState(!1),[i,c,u]=fHe(r),[d]=pHe(s),{steps:f}=hN(),p=S.useMemo(()=>s.reduce((g,b)=>{if(b.data){const y=b.data.nextStepId,x=b.data.previousStepId;return{...g,[y]:[...new Set([...g[y]||[],x])]}}return g},{}),[s]),h={"default-node":g=>l.jsx(VJe,{parentWorkflowName:n,...g,stepsFlow:p}),"condition-node":BJe,"after-node":qJe,"loop-result-node":HJe,"nested-node":g=>l.jsx(QJe,{parentWorkflowName:n,...g,stepsFlow:p})};return S.useEffect(()=>{t&&setTimeout(()=>{o(!0)},500)},[t]),l.jsx("div",{className:"w-full h-full relative bg-surface1",children:a?l.jsxs(dHe,{nodes:i,edges:d.map(g=>({...g,style:{...g.style,stroke:f[`${n}.${g.data?.previousStepId}`]?.status==="success"&&f[`${n}.${g.data?.nextStepId}`]||g.data?.conditionNode&&!f[`${n}.${g.data?.previousStepId}`]&&f[`${n}.${g.data?.nextStepId}`]?.status?"#22c55e":void 0}})),fitView:!0,fitViewOptions:{maxZoom:1},minZoom:.01,maxZoom:1,nodeTypes:h,onNodesChange:u,children:[l.jsx(woe,{position:"bottom-left"}),l.jsx(mHe,{variant:Sp.Lines,gap:12,size:.5})]}):l.jsx("div",{className:"w-full h-full flex items-center justify-center",children:l.jsx(jn,{})})})}function gAn(){const{stepDetail:e,closeStepDetail:t}=H4();return e?l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border1 bg-surface1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[e.type==="map-config"&&l.jsx(Mw,{className:"w-4 h-4",style:{color:mo.map}}),e.type==="nested-graph"&&l.jsx(tl,{className:"w-4 h-4",style:{color:mo.workflow}}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx(ke,{variant:"ui-md",className:"text-neutral6 font-medium",children:e.type==="map-config"?`${e.stepName} Config`:`${e.stepName} Workflow`}),e.type==="map-config"&&e.stepId&&e.stepId!==e.stepName&&l.jsx(ke,{variant:"ui-xs",className:"text-neutral3",children:e.stepId})]})]}),l.jsx("button",{onClick:t,className:"p-1 hover:bg-surface3 rounded transition-colors","aria-label":"Close",children:l.jsx(Gr,{className:"w-4 h-4 text-neutral3"})})]}),l.jsxs("div",{className:"flex-1 overflow-auto",children:[e.type==="map-config"&&e.mapConfig&&l.jsx(T0,{data:e.mapConfig}),e.type==="nested-graph"&&e.nestedGraph&&l.jsx("div",{className:"h-full min-h-[400px]",children:l.jsx(Mre,{children:l.jsx(mAn,{stepGraph:e.nestedGraph.stepGraph,open:!0,workflowName:e.nestedGraph.fullStep})},e.nestedGraph.fullStep)})]})]}):null}const G4=({requestContextSchema:e})=>{const{setSchemaValues:t,schemaValues:n}=voe(),r=JSON.stringify(n),s=S.useMemo(()=>{try{const a=ob(e);return hf(ff(a))}catch(a){return console.error("Failed to parse requestContextSchema:",a),null}},[e]);return s?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ke,{as:"span",variant:"ui-md",className:"text-neutral3",children:"Request Context"}),l.jsx(oi,{content:r})]}),l.jsx(Q4,{schema:s,onSubmit:t,submitButtonLabel:"Save",defaultValues:n})]}):l.jsx("div",{className:"text-neutral3",children:l.jsx(ke,{variant:"ui-sm",children:"Failed to parse request context schema"})})};function XJe(){return S.useMemo(()=>{const e=typeof window<"u"?window.MASTRA_REQUEST_CONTEXT_PRESETS:void 0;if(!e||e==="%%MASTRA_REQUEST_CONTEXT_PRESETS%%")return null;try{const t=JSON.parse(e);if(typeof t=="object"&&t!==null&&!Array.isArray(t))return t}catch{console.warn("Failed to parse request context presets")}return null},[])}function bAn({workflowId:e,initialRunId:t}){const{data:n,isLoading:r,error:s}=pN(e),{createWorkflowRun:a,streamWorkflow:o,streamResult:i,isStreamingWorkflow:c,observeWorkflowStream:u,closeStreamsAndReset:d,resumeWorkflow:f,cancelWorkflowRun:p,isCancellingWorkflowRun:h}=S.useContext(Zp),{stepDetail:g,closeStepDetail:b}=H4(),[y,x]=S.useState("current-run"),[w,O]=S.useState(""),{handleCopy:k}=pd({text:e}),E=Object.keys(n?.steps??{}).length,C=S.useMemo(()=>g?g.type==="map-config"?"Map Config":g.type==="nested-graph"?"Nested Workflow":"Node":null,[g]);S.useEffect(()=>{!w&&!t&&d()},[w,t]),S.useEffect(()=>{if(s){const T=s instanceof Error?s.message:"Failed to load workflow";qe.error(`Error loading workflow: ${T}`)}},[s]),S.useEffect(()=>{g?x("node-details"):y==="node-details"&&x("current-run")},[g]);const N=T=>{y==="node-details"&&T!=="node-details"&&b(),x(T)};return s?null:l.jsxs("div",{className:"grid grid-rows-[auto_1fr] h-full overflow-y-auto",children:[l.jsx(ZJe,{icon:l.jsx(tl,{}),title:n?.name||"",isLoading:r,children:l.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[l.jsxs(Qn,{children:[l.jsx(Gn,{asChild:!0,children:l.jsx("button",{onClick:k,className:"h-badge-default",children:l.jsx(ut,{icon:l.jsx(Xi,{}),variant:"default",children:e})})}),l.jsx(Bn,{children:"Copy Workflow ID for use in code"})]}),l.jsxs(ut,{children:[E," step",E>1?"s":""]}),n?.isProcessorWorkflow&&l.jsx(ut,{icon:l.jsx(rv,{className:"h-3 w-3"}),className:"bg-violet-500/20 text-violet-400",children:"Processor"})]})}),l.jsx("div",{className:"flex-1 overflow-auto border-t border-border1 flex flex-col",children:l.jsxs(E1,{defaultTab:"current-run",value:y,onValueChange:N,className:"h-full",children:[l.jsxs(C1,{children:[l.jsx(Si,{value:"current-run",children:"Current Run"}),n?.requestContextSchema&&l.jsx(Si,{value:"request-context",children:"Request Context"}),l.jsx(Si,{value:"run-options",children:"Run Options"}),g&&C&&l.jsxs(Si,{value:"node-details",onClose:()=>{b(),x("current-run")},children:[C," Details"]})]}),l.jsx(kl,{value:"current-run",children:e?t?l.jsx(iAn,{workflowId:e,runId:t,setRunId:O,workflow:n??void 0,isLoading:r,createWorkflowRun:a,streamWorkflow:o,resumeWorkflow:f,streamResult:i,isStreamingWorkflow:c,isCancellingWorkflowRun:h,cancelWorkflowRun:p,observeWorkflowStream:u}):l.jsx(WJe,{workflowId:e,setRunId:O,workflow:n??void 0,isLoading:r,createWorkflowRun:a,streamWorkflow:o,resumeWorkflow:f,streamResult:i,isStreamingWorkflow:c,isCancellingWorkflowRun:h,cancelWorkflowRun:p}):null}),n?.requestContextSchema&&l.jsx(kl,{value:"request-context",children:l.jsx("div",{className:"p-5",children:l.jsx(G4,{requestContextSchema:n.requestContextSchema})})}),l.jsx(kl,{value:"run-options",children:l.jsx(YJe,{})}),g&&l.jsx(kl,{value:"node-details",children:l.jsx(gAn,{})})]})})]})}const or={root:"flex flex-col gap-1.5",trigger:"w-full min-w-32 justify-between",triggerError:"border-accent2",chevron:"ml-2 h-4 w-4 shrink-0 opacity-50",placeholder:"text-neutral3",popup:K("min-w-[var(--anchor-width)] w-max max-w-[500px] rounded-md bg-surface3 text-neutral5","shadow-elevated","origin-[var(--transform-origin)]","transition-[transform,scale,opacity] duration-150 ease-out","data-[starting-style]:scale-95 data-[starting-style]:opacity-0","data-[ending-style]:scale-95 data-[ending-style]:opacity-0"),positioner:"z-[100]",searchContainer:K("flex items-center border-b border-border1 px-3 py-2",$n.colors),searchIcon:K("mr-2 h-4 w-4 shrink-0 text-neutral3",$n.colors),searchInput:K("flex h-8 w-full rounded-md bg-transparent py-1 text-sm","placeholder:text-neutral3 disabled:cursor-not-allowed disabled:opacity-50","outline-none",$n.colors),empty:"[&:not(:empty)]:block hidden py-6 text-center text-sm text-neutral3",list:"max-h-dropdown-max-height overflow-y-auto overflow-x-hidden p-1",item:K("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm",$n.colors,"data-[highlighted]:bg-surface5 data-[highlighted]:text-neutral5"),itemSelected:"data-[selected]:bg-accent1Dark data-[selected]:text-accent1",checkContainer:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center",checkIcon:K("h-4 w-4 text-accent1",$n.opacity),checkbox:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded border",checkboxSelected:"bg-accent1 border-accent1",checkboxUnselected:"border-border1",checkboxIcon:"h-3 w-3 text-white",optionContent:"flex items-center gap-2 w-full min-w-0",optionText:"flex flex-col gap-0.5 min-w-0",optionLabel:"truncate",optionDescription:"text-xs text-neutral3 truncate",optionEnd:"ml-auto",error:"text-xs text-accent2"};function jl({options:e,value:t,onValueChange:n,placeholder:r="Select option...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:o,disabled:i=!1,variant:c="inputLike",size:u="default",open:d,onOpenChange:f,container:p,error:h}){const g=e.find(y=>y.value===t)??null,b=y=>{y&&n?.(y.value)};return l.jsxs("div",{className:or.root,children:[l.jsxs(sWe,{items:e,value:g,onValueChange:b,disabled:i,open:d,onOpenChange:f,children:[l.jsxs(fWe,{className:K(S1({variant:c,size:u}),or.trigger,h&&or.triggerError,o),children:[l.jsxs("span",{className:"truncate flex items-center gap-2",children:[g?.start,l.jsx(ipn,{placeholder:r})]}),l.jsx(V$e,{className:or.chevron})]}),l.jsx(gWe,{container:p,children:l.jsx(vWe,{align:"start",sideOffset:4,className:or.positioner,children:l.jsxs(xWe,{className:or.popup,children:[l.jsxs("div",{className:or.searchContainer,children:[l.jsx(Lp,{className:or.searchIcon}),l.jsx(dWe,{className:or.searchInput,placeholder:s})]}),l.jsx(_We,{className:or.empty,children:a}),l.jsx(hWe,{className:or.list,children:y=>l.jsxs(kWe,{value:y,className:K(or.item,or.itemSelected),children:[l.jsx("span",{className:or.checkContainer,children:l.jsx(Wpn,{children:l.jsx(Os,{className:or.checkIcon})})}),l.jsxs("span",{className:or.optionContent,children:[y.start,l.jsxs("span",{className:or.optionText,children:[l.jsx("span",{className:or.optionLabel,children:y.label}),y.description&&l.jsx("span",{className:or.optionDescription,children:y.description})]}),y.end?l.jsx("div",{className:or.optionEnd,children:y.end}):null]})]},y.value)})]})})})]}),h&&l.jsx("span",{className:or.error,children:h})]})}function yAn({options:e,value:t=[],onValueChange:n,placeholder:r="Select options...",searchPlaceholder:s="Search...",emptyText:a="No option found.",className:o,disabled:i=!1,variant:c="default",size:u="md",open:d,onOpenChange:f,container:p,error:h}){const g=e.filter(x=>t.includes(x.value)),b=x=>{x&&n?.(x.map(w=>w.value))},y=g.length===0?r:`${g.length} selected`;return l.jsxs("div",{className:or.root,children:[l.jsxs(sWe,{multiple:!0,items:e,value:g,onValueChange:b,disabled:i,open:d,onOpenChange:f,children:[l.jsxs(fWe,{className:K(S1({variant:c,size:u}),or.trigger,h&&or.triggerError,o),children:[l.jsx("span",{className:K("truncate",g.length===0&&or.placeholder),children:y}),l.jsx(V$e,{className:or.chevron})]}),l.jsx(gWe,{container:p,children:l.jsx(vWe,{align:"start",sideOffset:4,className:or.positioner,children:l.jsxs(xWe,{className:or.popup,children:[l.jsxs("div",{className:or.searchContainer,children:[l.jsx(Lp,{className:or.searchIcon}),l.jsx(dWe,{className:or.searchInput,placeholder:s})]}),l.jsx(_We,{className:or.empty,children:a}),l.jsx(hWe,{className:or.list,children:x=>{const w=t.includes(x.value);return l.jsxs(kWe,{value:x,className:or.item,children:[l.jsx("span",{className:K(or.checkbox,w?or.checkboxSelected:or.checkboxUnselected),children:w&&l.jsx(Os,{className:or.checkboxIcon})}),l.jsxs("span",{className:or.optionContent,children:[x.start,l.jsxs("span",{className:or.optionText,children:[l.jsx("span",{className:or.optionLabel,children:x.label}),x.description&&l.jsx("span",{className:or.optionDescription,children:x.description})]}),x.end?l.jsx("div",{className:or.optionEnd,children:x.end}):null]})]},x.value)}})]})})})]}),h&&l.jsx("span",{className:or.error,children:h})]})}const xm=()=>{const e=Xe(),{requestContext:t}=Or();return Qt({queryKey:["workflows",t],queryFn:async()=>{const n=await e.listWorkflows(t);return Object.fromEntries(Object.entries(n).filter(([r,s])=>!s.isProcessorWorkflow))}})};function vAn({value:e,onValueChange:t,placeholder:n="Select a workflow...",searchPlaceholder:r="Search workflows...",emptyText:s="No workflows found.",className:a,disabled:o=!1,variant:i="inputLike"}){const{data:c={},isLoading:u,isError:d,error:f}=xm(),{navigate:p,paths:h}=Lt();S.useEffect(()=>{if(d){const y=f instanceof Error?f.message:"Failed to load workflows";qe.error(`Error loading workflows: ${y}`)}},[d,f]);const g=Object.keys(c).map(y=>({label:c[y]?.name||y,value:y})),b=y=>{t?t(y):y&&y!==e&&p(h.workflowLink(y))};return l.jsx(jl,{options:g,value:e,onValueChange:b,placeholder:u?"Loading workflows...":n,searchPlaceholder:r,emptyText:s,className:a,disabled:o||u||d,variant:i})}function on({children:e,className:t,style:n}){const r=KJe("MainContentLayout");return l.jsx("main",{className:K("grid grid-rows-[auto_1fr] h-full items-start content-start",t),style:{...n,...r?{border:"3px dotted red"}:{}},children:e})}function Va({children:e,className:t,isCentered:n=!1,isDivided:r=!1,hasLeftServiceColumn:s=!1,style:a}){const o=KJe("MainContentContent"),i=Soe({isCentered:n,isDivided:r,hasLeftServiceColumn:s,className:t});return l.jsx("div",{className:i,style:{...a,...o?{border:"3px dotted orange"}:{}},children:e})}const Soe=({isCentered:e,isDivided:t,hasLeftServiceColumn:n,className:r})=>K("grid overflow-y-auto h-full ","overflow-x-auto min-w-[min-content]",{"items-start content-start":!e&&!t&&!n,"grid place-items-center":e,"grid-cols-[1fr_1fr]":t&&!n,"grid-cols-[12rem_1fr_1fr]":t&&n,"grid-cols-[auto_1fr]":!t&&n},r);function KJe(e){try{const t=localStorage.getItem("add-dev-style-to-components");return t?t.split(",").map(r=>r.trim()).filter(Boolean).includes(e):!1}catch(t){return console.error("Error reading or parsing localStorage:",t),!1}}const SC=()=>l.jsx(zWe,{className:K("w-1.5 bg-surface3","[&[data-separator='hover']]:!bg-surface4","[&[data-separator='active']]:!bg-surface5","focus:outline-none")}),X2=({collapsedSize:e,children:t,direction:n,...r})=>{const[s,a]=S.useState(!1),o=Nhn(),i=()=>{o.current&&o.current.expand()};return l.jsx(yS,{panelRef:o,collapsedSize:e,...r,onResize:c=>{e&&typeof e=="number"&&(c.inPixels<=e?a(!0):s&&a(!1))},children:s?l.jsxs(Qn,{children:[l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Gn,{asChild:!0,children:l.jsx(he,{onClick:i,className:"!h-48 border-none",children:l.jsx(Oe,{children:n==="left"?l.jsx(vp,{}):l.jsx(ZS,{})})})})}),l.jsx(Bn,{children:"Expand"})]}):t})},xAn=({workflowId:e,children:t,leftSlot:n,rightSlot:r})=>{const{defaultLayout:s,onLayoutChange:a}=zse({id:`workflow-layout-${e}`,storage:localStorage}),o=Soe({isCentered:!1,isDivided:!0,hasLeftServiceColumn:!!n});return l.jsxs(w4,{className:o,defaultLayout:s,onLayoutChange:a,children:[n&&l.jsxs(l.Fragment,{children:[l.jsx(X2,{direction:"left",id:"left-slot",minSize:200,maxSize:"30%",defaultSize:200,collapsedSize:60,collapsible:!0,children:n}),l.jsx(SC,{})]}),l.jsx(yS,{id:"main-slot",children:t}),r&&l.jsxs(l.Fragment,{children:[l.jsx(SC,{}),l.jsx(X2,{direction:"right",id:"right-slot",minSize:300,maxSize:"50%",defaultSize:300,collapsedSize:60,collapsible:!0,children:r})]})]})},Ooe=()=>l.jsx(q4,{icon:l.jsx(jn,{color:dDe.neutral3}),title:l.jsx(On,{className:"ml-2 w-12 h-2"}),collapsible:!1}),wAn=({result:e,workflowId:t,isStreaming:n,metadata:r,toolCallId:s,toolApprovalMetadata:a,suspendPayload:o,toolName:i,isNetwork:c,toolCalled:u})=>{const{runId:d,status:f}=e||{},{data:p,isLoading:h}=pN(t),{data:g,isLoading:b}=TJe(t,{enabled:!!d&&!n}),y=g?.find(C=>C.runId===d),x=b||!y,w=typeof y?.snapshot=="object"?y?.snapshot:void 0,O=r?.mode==="network"?r.selectionReason:void 0,k=r?.mode==="network"?r.agentInput:void 0;let E=typeof o=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:o}):l.jsx(ea,{data:o,"data-testid":"tool-suspend-payload"});return h||!p?l.jsx(Ooe,{}):l.jsxs(q4,{"data-testid":"workflow-badge",icon:l.jsx(tl,{className:"text-accent3"}),title:p.name,initialCollapsed:!1,extraInfo:r?.mode==="network"&&l.jsx(foe,{selectionReason:O??"",input:k}),children:[!n&&!x&&l.jsx(moe,{snapshot:w,workflowId:t,initialRunId:d,withoutTimeTravel:!0,children:l.jsx(UTe,{workflowId:t,workflow:p,runId:d})}),n&&l.jsx(UTe,{workflowId:t,workflow:p,runId:d}),E!==void 0&&o&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Workflow suspend payload"}),E]}),l.jsx(dN,{toolCalled:u??!!f,toolCallId:s,toolApprovalMetadata:a,toolName:i,isNetwork:c,isGenerateMode:r?.mode==="generate"})]})},UTe=({workflowId:e,workflow:t,runId:n})=>{const{Link:r}=Lt();return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[l.jsx(he,{as:r,href:`/workflows/${e}/graph`,children:"Go to workflow"}),n&&l.jsx(he,{as:r,href:`/workflows/${e}/graph/${n}`,children:"See run"})]}),l.jsx("div",{className:"rounded-md overflow-hidden h-[60vh] w-full",children:l.jsx(GJe,{workflowId:e,workflow:t})})]})},SAn=e=>{const{setResult:t}=S.useContext(Zp);S.useEffect(()=>{e&&t(e)},[e])},OAn=({agentId:e,messages:t=[],metadata:n,toolCallId:r,toolApprovalMetadata:s,toolName:a,isNetwork:o,suspendPayload:i,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;o&&(p=c??t.every(g=>g.type==="text"?!0:!!g.toolOutput));let h=typeof i=="string"?l.jsx("pre",{className:"whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto",children:i}):l.jsx(ea,{data:i,"data-testid":"tool-suspend-payload"});return l.jsxs(q4,{"data-testid":"agent-badge",icon:l.jsx(so,{className:"text-accent1"}),title:e,initialCollapsed:u,extraInfo:n?.mode==="network"&&l.jsx(foe,{selectionReason:d??"",input:f}),children:[t.map((g,b)=>{if(g.type==="text")return l.jsx(UYe,{children:g.content},b);let y;try{y=typeof g.toolOutput=="string"?JSON.parse(g.toolOutput):g.toolOutput}catch{y=g.toolOutput}return l.jsx(be.Fragment,{children:l.jsx(aet,{toolName:g.toolName,argsText:typeof g.args=="string"?g.args:JSON.stringify(g.args),result:y,args:g.args,status:{type:"complete"},type:"tool-call",toolCallId:g.toolCallId,addResult:()=>{},resume:()=>{},metadata:{mode:"stream"}})},b)}),h!==void 0&&i&&l.jsxs("div",{children:[l.jsx("p",{className:"font-medium pb-2",children:"Agent suspend payload"}),h]}),l.jsx(dN,{toolCalled:p,toolCallId:r,toolApprovalMetadata:s,toolName:a,isNetwork:o,isGenerateMode:n?.mode==="generate"})]})},JJe=({threadId:e,agentId:t,memory:n})=>{const r=Xe(),{requestContext:s}=Or();return Qt({queryKey:["memory","messages",e,t,"requestContext"],queryFn:async()=>e?await r.listThreadMessages(e,{agentId:t,requestContext:s}):null,enabled:n&&!!e,staleTime:0,gcTime:0,retry:!1,refetchOnWindowFocus:!1})},kAn=({agentId:e,result:t,metadata:n,toolCallId:r,toolApprovalMetadata:s,toolName:a,isNetwork:o,suspendPayload:i,toolCalled:c,isComplete:u})=>{const{data:d,isLoading:f}=JJe({threadId:t?.subAgentThreadId,agentId:e,memory:!0});if(f)return l.jsx(Ooe,{});const p=d?.messages?BYe(d.messages):[],h=t?.childMessages??kWt(p);return l.jsx(OAn,{agentId:e,messages:h,metadata:n,toolCallId:r,toolApprovalMetadata:s,toolName:a,isNetwork:o,suspendPayload:i,toolCalled:c,isComplete:u})};function TS({children:e}){const t=e.replace(/\\n/g,`
|
|
428
428
|
`);return l.jsx(UYe,{remarkPlugins:[O4e],components:EAn,className:"space-y-3",children:t})}const eet=be.memo(({children:e,language:t,...n})=>{const[r,s]=S.useState([]);return S.useEffect(()=>{MTn(e,t).then(a=>{a&&s(a)})},[e,t]),r.length?l.jsx("pre",{...n,children:l.jsx("code",{children:r.map((a,o)=>l.jsxs(l.Fragment,{children:[l.jsx("span",{children:a.map((i,c)=>{const u=typeof i.htmlStyle=="string"?void 0:i.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:i.content},c)})},o),o!==r.length-1&&`
|
|
@@ -473,4 +473,4 @@ Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}
|
|
|
473
473
|
`),c=a;c<i.length;c++){var u=i[c];if(!(u.length>1024)){var d=xAe.test(u)?u.replace(xAe,"$1"):u;if(!d.match(/\S*Error: /)){for(var f of n){var p=f(d,e);if(p){o.push(p);break}}if(o.length>=wAe)break}}}return(function(h){if(!h.length)return[];var g=Array.from(h);return g.reverse(),g.slice(0,wAe).map((b=>{return Nt({},b,{filename:b.filename||(y=g,y[y.length-1]||{}).filename,function:b.function||PS});var y}))})(o)}})("web:javascript",yFn,wFn)}class OFn{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=Ao(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 aM(t,"DOMException")}isDOMError(t){return aM(t,"DOMError")}}class kFn{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 _Fn{constructor(){}match(t){return aM(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r,s=n.apply(t.error);return s||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var EFn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class CFn{match(t){return typeof t=="string"}coerce(t,n){var r,[s,a]=this.getInfos(t);return{type:s??"Error",value:a??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,s=t.match(EFn);return s&&(n=s[1],r=s[2]),[n,r]}}var TFn=["fatal","error","warning","log","info","debug"];function mst(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 s=n.slice(0,r).join(", ");if(!(s.length>t))return r===n.length||s.length<=t?s:s.slice(0,t)+"..."}return""}class NFn{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,s=this.getErrorPropertyFromObject(t);return s?n.apply(s):{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 tie(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: "+mst(t)}isSeverityLevel(t){return Ao(t)&&!AX(t)&&TFn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(fFn(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class AFn{match(t){return tie(t)}coerce(t,n){var r,s=t.constructor.name;return{type:s,value:s+" captured as exception with keys: "+mst(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class jFn{match(t){return Xrt(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 RFn{match(t){return aM(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!tie(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,s=this.getUnhandledRejectionReason(t);return Xrt(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}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 gst=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k:function(s){if(Qe&&(Vu.DEBUG||An.POSTHOG_DEBUG||n)&&!$t(Qe.console)&&Qe.console){for(var a=("__rrweb_original__"in Qe.console[s])?Qe.console[s].__rrweb_original__:Qe.console[s],o=arguments.length,i=new Array(o>1?o-1:0),c=1;c<o;c++)i[c-1]=arguments[c];a(e,...i)}},info:function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];r.k("log",...a)},warn:function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];r.k("warn",...a)},error:function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];r.k("error",...a)},critical:function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];console.error(e,...a)},uninitializedWarning:s=>{r.error("You must initialize PostHog before calling "+s)},createLogger:(s,a)=>gst(e+" "+s,a)};return r},zt=gst("[PostHog.js]"),Ha=zt.createLogger,IFn=Ha("[ExternalScriptsLoader]"),SAe=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return IFn.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=It?.querySelectorAll("script");if(r){for(var s,a=function(){if(r[o].src===t){var c=r[o];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})}},o=0;o<r.length;o++)if(s=a())return s.v}var i=()=>{if(!It)return n("document not found");var c=It.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")It.head.appendChild(c);else{var u,d=It.querySelectorAll("body > script");d.length>0?(u=d[0].parentNode)==null||u.insertBefore(c,d[0]):It.body.appendChild(c)}};It!=null&&It.body?i():It?.addEventListener("DOMContentLoaded",i)};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__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 s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var a=e.requestRouter.endpointFor("assets",r);SAe(e,a,n)},An.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);SAe(e,r,n)};var iM={};function Bg(e,t,n){if(hs(e)){if(uAe&&e.forEach===uAe)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(r in e&&t.call(n,e[r],r)===iM)return}}}function fa(e,t,n){if(!Br(e)){if(hs(e))return Bg(e,t,n);if(X9n(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===iM)return}else for(var s in e)if(Yrt.call(e,s)&&t.call(n,e[s],s)===iM)return}}var bo=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 Bg(n,(function(s){for(var a in s)s[a]!==void 0&&(e[a]=s[a])})),e},MS=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 Bg(n,(function(s){Bg(s,(function(a){e.push(a)}))})),e};function AI(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 OAe=function(e){try{return e()}catch{return}},PFn=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(s){zt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),zt.critical(s)}}},oie=function(e){var t={};return fa(e,(function(n,r){(Ao(n)&&n.length>0||Pp(n))&&(t[r]=n)})),t};function MFn(e,t){return n=e,r=a=>Ao(a)&&!Ef(t)?a.slice(0,t):a,s=new Set,(function a(o,i){return o!==Object(o)?r?r(o,i):o:s.has(o)?void 0:(s.add(o),hs(o)?(c=[],Bg(o,(u=>{c.push(a(u))}))):(c={},fa(o,((u,d)=>{s.has(u)||(c[d]=a(u,d))}))),c);var c})(n);var n,r,s}var $Fn=["herokuapp.com","vercel.app","netlify.app"];function DFn(e){var t=e?.hostname;if(!Ao(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of $Fn)if(n===r)return!1;return!0}function bst(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Eo(e,t,n,r){var{capture:s=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:s,passive:a})}function yst(e){return e.name==="ph_toolbar_internal"}var vst="$people_distinct_id",Fk="__alias",zk="__timers",kAe="$autocapture_disabled_server_side",MX="$heatmaps_enabled_server_side",_Ae="$exception_capture_enabled_server_side",$X="$error_tracking_suppression_rules",EAe="$error_tracking_capture_extension_exceptions",CAe="$web_vitals_enabled_server_side",xst="$dead_clicks_enabled_server_side",TAe="$product_tours_enabled_server_side",NAe="$web_vitals_allowed_metrics",MR="$session_recording_remote_config",lM="$sesid",wst="$session_is_sampled",Y0="$enabled_feature_flags",Bk="$early_access_features",DX="$feature_flag_details",Uk="$stored_person_properties",_y="$stored_group_properties",LX="$surveys",N_="$flag_call_reported",FX="$flag_call_reported_session_id",zX="$feature_flag_errors",cM="$feature_flag_evaluated_at",Wf="$user_state",BX="$client_session_props",UX="$capture_rate_limit",VX="$initial_campaign_params",qX="$initial_referrer_info",uM="$initial_person_info",dM="$epp",Sst="__POSTHOG_TOOLBAR__",ak="$posthog_cookieless",LFn=[vst,Fk,"__cmpns",zk,"$session_recording_enabled_server_side",MX,lM,Y0,$X,Wf,Bk,DX,_y,Uk,LX,N_,FX,zX,cM,BX,UX,VX,qX,dM,uM];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Pp(e)&&isFinite(e)&&Math.floor(e)===e});var AAe="0123456789abcdef";class fM{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,s){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||t<0||n<0||r<0||s<0||t>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var a=new Uint8Array(16);return a[0]=t/Math.pow(2,40),a[1]=t/Math.pow(2,32),a[2]=t/Math.pow(2,24),a[3]=t/Math.pow(2,16),a[4]=t/Math.pow(2,8),a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=s>>>24,a[13]=s>>>16,a[14]=s>>>8,a[15]=s,new fM(a)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+AAe.charAt(this.bytes[n]>>>4)+AAe.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 fM(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 FFn{constructor(){this.P=0,this.T=0,this.R=new zFn}generate(){var t=this.generateOrAbort();if($t(t)){this.P=0;var n=this.generateOrAbort();if($t(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 fM.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 jAe,Ost=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};Qe&&!$t(Qe.crypto)&&crypto.getRandomValues&&(Ost=e=>crypto.getRandomValues(e));class zFn{constructor(){this.C=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.C.length&&(Ost(this.C),this.O=0),this.C[this.O++]}}var Tg=()=>BFn().toString(),BFn=()=>(jAe||(jAe=new FFn)).generate(),ok="",UFn=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function VFn(e,t){if(t){var n=(function(s,a){if(a===void 0&&(a=It),ok)return ok;if(!a||["localhost","127.0.0.1"].includes(s))return"";for(var o=s.split("."),i=Math.min(o.length,8),c="dmn_chk_"+Tg();!ok&&i--;){var u=o.slice(i).join("."),d=c+"=1;domain=."+u+";path=/";a.cookie=d+";max-age=3",a.cookie.includes(c)&&(a.cookie=d+";max-age=0",ok=u)}return ok})(e);if(!n){var r=(s=>{var a=s.match(UFn);return a?a[0]:""})(e);r!==n&&zt.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var ap={F:()=>!!It,M:function(e){zt.error("cookieStore error: "+e)},A:function(e){if(It){try{for(var t=e+"=",n=It.cookie.split(";").filter((a=>a.length)),r=0;r<n.length;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}},D:function(e){var t;try{t=JSON.parse(ap.A(e))||{}}catch{}return t},L:function(e,t,n,r,s){if(It)try{var a="",o="",i=VFn(It.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),a="; expires="+c.toUTCString()}s&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; SameSite=Lax; path=/"+i+o;return u.length>3686.4&&zt.warn("cookieStore warning: large cookie, len="+u.length),It.cookie=u,u}catch{return}},j:function(e,t){if(It!=null&&It.cookie)try{ap.L(e,"",-1,t)}catch{return}}},TQ=null,Ba={F:function(){if(!Ef(TQ))return TQ;var e=!0;if($t(Qe))e=!1;else try{var t="__mplssupport__";Ba.L(t,"xyz"),Ba.A(t)!=='"xyz"'&&(e=!1),Ba.j(t)}catch{e=!1}return e||zt.error("localStorage unsupported; falling back to cookie store"),TQ=e,e},M:function(e){zt.error("localStorage error: "+e)},A:function(e){try{return Qe?.localStorage.getItem(e)}catch(t){Ba.M(t)}return null},D:function(e){try{return JSON.parse(Ba.A(e))||{}}catch{}return null},L:function(e,t){try{Qe?.localStorage.setItem(e,JSON.stringify(t))}catch(n){Ba.M(n)}},j:function(e){try{Qe?.localStorage.removeItem(e)}catch(t){Ba.M(t)}}},qFn=["$device_id","distinct_id",lM,wst,dM,uM,Wf],$R={},HFn={F:function(){return!0},M:function(e){zt.error("memoryStorage error: "+e)},A:function(e){return $R[e]||null},D:function(e){return $R[e]||null},L:function(e,t){$R[e]=t},j:function(e){delete $R[e]}},by=null,yi={F:function(){if(!Ef(by))return by;if(by=!0,$t(Qe))by=!1;else try{var e="__support__";yi.L(e,"xyz"),yi.A(e)!=='"xyz"'&&(by=!1),yi.j(e)}catch{by=!1}return by},M:function(e){zt.error("sessionStorage error: ",e)},A:function(e){try{return Qe?.sessionStorage.getItem(e)}catch(t){yi.M(t)}return null},D:function(e){try{return JSON.parse(yi.A(e))||null}catch{}return null},L:function(e,t){try{Qe?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){yi.M(n)}},j:function(e){try{Qe?.sessionStorage.removeItem(e)}catch(t){yi.M(t)}}},Rh=(function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e})({});class QFn{constructor(t){this._instance=t}get N(){return this._instance.config}get consent(){return this.U()?Rh.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===Rh.DENIED||this.consent===Rh.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Rh.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 _Q(t)?Rh.GRANTED:jr(eFn,t)?Rh.DENIED:Rh.PENDING}get B(){if(!this.V){var t=this.N.opt_out_capturing_persistence_type;this.V=t==="localStorage"?Ba:ap;var n=t==="localStorage"?ap:Ba;n.A(this.q)&&(this.V.A(this.q)||this.optInOut(_Q(n.A(this.q))),n.j(this.q,this.N.cross_subdomain_cookie))}return this.V}U(){return!!this.N.respect_dnt&&!!bst([nu?.doNotTrack,nu?.msDoNotTrack,An.doNotTrack],(t=>_Q(t)))}}var DR=Ha("[Dead Clicks]"),GFn=()=>!0,WFn=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(xst)),r=e.instance.config.capture_dead_clicks;return Zh(r)?r:!!Ho(r)||n};class RAe{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({[xst]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.G((()=>{this.Y()})):this.stop()}G(t){var n,r;(n=An.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=An.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?DR.error("failed to load script",s):t()}))}Y(){var t;if(It){if(!this.W&&(t=An.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Ho(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.W=An.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.W.start(It),DR.info("starting...")}}else DR.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,DR.info("stopping..."))}}var NQ=Ha("[SegmentIntegration]");function ZFn(e,t){var n=e.config.segment;if(!n)return t();(function(r,s){var a=r.config.segment;if(!a)return s();var o=c=>{var u=()=>c.anonymousId()||Tg();r.config.get_device_id=u,c.id()&&(r.register({distinct_id:c.id(),$device_id:u()}),r.persistence.set_property(Wf,"identified")),s()},i=a.user();"then"in i&&Bh(i.then)?i.then(o):o(i)})(e,(()=>{n.register((r=>{Promise&&Promise.resolve||NQ.warn("This browser does not have Promise support, and can not use the segment integration");var s=(a,o)=>{if(!o)return a;a.event.userId||a.event.anonymousId===r.get_distinct_id()||(NQ.info("No userId set, resetting PostHog"),r.reset()),a.event.userId&&a.event.userId!==r.get_distinct_id()&&(NQ.info("UserId set, identifying with PostHog"),r.identify(a.event.userId));var i=r.calculateEventProperties(o,a.event.properties);return a.event.properties=Object.assign({},i,a.event.properties),a};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:a=>s(a,a.event.event),page:a=>s(a,"$pageview"),identify:a=>s(a,"$identify"),screen:a=>s(a,"$screen")}})(e)).then((()=>{t()}))}))}var kst="posthog-js";function _st(e,t){var{organization:n,projectId:r,prefix:s,severityAllowList:a=["error"],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return i=>{var c,u,d,f,p;if(!(a==="*"||a.includes(i.level))||!e.__loaded)return i;i.tags||(i.tags={});var h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());i.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(i.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var g,b=((c=i.exception)==null?void 0:c.values)||[],y=b.map((w=>Nt({},w,{stacktrace:w.stacktrace?Nt({},w.stacktrace,{type:"raw",frames:(w.stacktrace.frames||[]).map((O=>Nt({},O,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((u=b[0])==null?void 0:u.value)||i.message,$exception_type:(d=b[0])==null?void 0:d.type,$exception_level:i.level,$exception_list:y,$sentry_event_id:i.event_id,$sentry_exception:i.exception,$sentry_exception_message:((f=b[0])==null?void 0:f.value)||i.message,$sentry_exception_type:(p=b[0])==null?void 0:p.type,$sentry_tags:i.tags};return n&&r&&(x.$sentry_url=(s||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+i.event_id),o&&((g=e.exceptions)==null||g.sendExceptionEvent(x)),i}}class YFn{constructor(t,n,r,s,a,o){this.name=kst,this.setupOnce=function(i){i(_st(t,{organization:n,projectId:r,prefix:s,severityAllowList:a,sendExceptionsToPostHog:o==null||o}))}}}class IAe{constructor(t){this.J=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength)&&(zt.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),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,s=this.tt(t,n);return this.K={pathname:(r=Qe?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),s}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 s={$pageview_id:n,$prev_pageview_id:r.pageViewId},a=this._instance.scrollManager.getContext();if(a&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:i,maxScrollY:c,maxContentHeight:u,lastContentY:d,maxContentY:f}=a;if(!($t(o)||$t(i)||$t(c)||$t(u)||$t(d)||$t(f))){o=Math.ceil(o),i=Math.ceil(i),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);var p=o<=1?1:bp(i/o,0,1,zt),h=o<=1?1:bp(c/o,0,1,zt),g=u<=1?1:bp(d/u,0,1,zt),b=u<=1?1:bp(f/u,0,1,zt);s=bo(s,{$prev_pageview_last_scroll:i,$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:g,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:b})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),s}}var pM=e=>{var t=It?.createElement("a");return $t(t)?null:(t.href=e,t)},XFn=function(e,t){var n,r;t===void 0&&(t="&");var s=[];return fa(e,(function(a,o){$t(a)||$t(o)||o==="undefined"||(n=encodeURIComponent((i=>i instanceof File)(a)?a.name:a.toString()),r=encodeURIComponent(o),s[s.length]=r+"="+n)})),s.join(t)},hM=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var a=r[s].split("=");if(a[0]===t){n=a;break}}if(!hs(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{zt.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},RC=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",a=r[1],o=s.split("?"),i=o[1],c=o[0],u=(i||"").split("&"),d=[],f=0;f<u.length;f++){var p=u[f].split("=");hs(p)&&(t.includes(p[0])?d.push(p[0]+"="+n):d.push(u[f]))}var h=c;return i!=null&&(h+="?"+d.join("&")),a!=null&&(h+="#"+a),h},mM=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},LR="https?://(.*)",$S=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],KFn=MS(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],$S),IC="<masked>",JFn=["li_fat_id"];function Est(e,t,n){if(!It)return{};var r,s=t?MS([],$S,n||[]):[],a=Cst(RC(It.URL,s,IC),e),o=(r={},fa(JFn,(function(i){var c=ap.A(i);r[i]=c||null})),r);return bo(o,a)}function Cst(e,t){var n=KFn.concat(t||[]),r={};return fa(n,(function(s){var a=hM(e,s);r[s]=a||null})),r}function Tst(e){var t=(function(a){return a?a.search(LR+"google.([^/?]*)")===0?"google":a.search(LR+"bing.com")===0?"bing":a.search(LR+"yahoo.com")===0?"yahoo":a.search(LR+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!Ef(t)){r.$search_engine=t;var s=It?hM(It.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function PAe(){return navigator.language||navigator.userLanguage}function Nst(){return It?.referrer||"$direct"}function Ast(e,t){var n=e?MS([],$S,t||[]):[],r=xi?.href.substring(0,1e3);return{r:Nst().substring(0,1e3),u:r?RC(r,n,IC):void 0}}function jst(e){var t,{r:n,u:r}=e,s={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=pM(n))==null?void 0:t.host};if(r){s.$current_url=r;var a=pM(r);s.$host=a?.host,s.$pathname=a?.pathname;var o=Cst(r);bo(s,o)}if(n){var i=Tst(n);bo(s,i)}return s}function Rst(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function e8n(){try{return new Date().getTimezoneOffset()}catch{return}}function t8n(e,t){var n,r,s,a;if(!Wl)return{};var o,i,c,u,d,f,p,h,g=e?MS([],$S,t||[]):[],[b,y]=(function(x){for(var w=0;w<yAe.length;w++){var[O,k]=yAe[w],E=O.exec(x),C=E&&(Bh(k)?k(E,x):k);if(C)return C}return["",""]})(Wl);return bo(oie({$os:b,$os_version:y,$browser:pst(Wl,navigator.vendor),$device:vAe(Wl),$device_type:(i=Wl,c={userAgentDataPlatform:(n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform,maxTouchPoints:(r=navigator)==null?void 0:r.maxTouchPoints,screenWidth:Qe==null||(s=Qe.screen)==null?void 0:s.width,screenHeight:Qe==null||(a=Qe.screen)==null?void 0:a.height,devicePixelRatio:Qe?.devicePixelRatio},h=vAe(i),h===Jrt||h===Krt||h==="Kobo"||h==="Kindle Fire"||h===fst?RS:h===AC||h===Cw||h===jC||h===RX?"Console":h===tst?"Wearable":h?uu: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?RS:uu:"Desktop"),$timezone:Rst(),$timezone_offset:e8n()}),{$current_url:RC(xi?.href,g,IC),$host:xi?.host,$pathname:xi?.pathname,$raw_user_agent:Wl.length>1e3?Wl.substring(0,997)+"...":Wl,$browser_version:dFn(Wl,navigator.vendor),$browser_language:PAe(),$browser_language_prefix:(o=PAe(),typeof o=="string"?o.split("-")[0]:void 0),$screen_height:Qe?.screen.height,$screen_width:Qe?.screen.width,$viewport_height:Qe?.innerHeight,$viewport_width:Qe?.innerWidth,$lib:Vu.LIB_NAME,$lib_version:Vu.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var n8n=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class AQ{constructor(t,n){this.N=t,this.props={},this.it=!1,this.et=(r=>{var s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(t),this.B=this.rt(t),this.load(),t.debug&&zt.info("Persistence loaded",t.persistence,Nt({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.st}rt(t){n8n.indexOf(t.persistence.toLowerCase())===-1&&(zt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(s){s===void 0&&(s=[]);var a=[...qFn,...s];return Nt({},Ba,{D:function(o){try{var i={};try{i=ap.D(o)||{}}catch{}var c=bo(i,JSON.parse(Ba.A(o)||"{}"));return Ba.L(o,c),c}catch{}return null},L:function(o,i,c,u,d,f){try{Ba.L(o,i,void 0,void 0,f);var p={};a.forEach((h=>{i[h]&&(p[h]=i[h])})),Object.keys(p).length&&ap.L(o,p,c,u,d,f)}catch(h){Ba.M(h)}},j:function(o,i){try{Qe?.localStorage.removeItem(o),ap.j(o,i)}catch(c){Ba.M(c)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&Ba.F()?Ba:r==="localstorage+cookie"&&n.F()?n:r==="sessionstorage"&&yi.F()?yi:r==="memory"?HFn:r==="cookie"?ap:n.F()?n:ap}nt(t){var n=t??this.N.feature_flag_cache_ttl_ms;if(!n||n<=0)return!1;var r=this.props[cM];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return fa(this.props,((n,r)=>{if(r===Y0&&Ho(n)){if(!this.nt())for(var s=Object.keys(n),a=0;a<s.length;a++)t["$feature/"+s[a]]=n[s[a]]}else i=r,c=!1,(Ef(o=LFn)?c:dAe&&o.indexOf===dAe?o.indexOf(i)!=-1:(fa(o,(function(u){if(c||(c=u===i))return iM})),c))||(t[r]=n);var o,i,c})),t}load(){if(!this.st){var t=this.B.D(this.et);t&&(this.props=bo({},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(Ho(t)){$t(n)&&(n="None"),this.ot=$t(r)?this.dt:r;var s=!1;if(fa(t,((a,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=a,s=!0)})),s)return this.save(),!0}return!1}register(t,n){if(Ho(t)){this.ot=$t(n)?this.dt:n;var r=!1;if(fa(t,((s,a)=>{t.hasOwnProperty(a)&&this.props[a]!==s&&(this.props[a]=s,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=Est(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);Z0(oie(t))||this.register(t),this.it=!0}}update_search_keyword(){var t;this.register((t=It?.referrer)?Tst(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Nst(),$referring_domain:It!=null&&It.referrer&&((t=pM(It.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[VX]||this.props[qX]||this.register_once({[uM]:Ast(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};fa([qX,VX],(o=>{var i=this.props[o];i&&fa(i,(function(c,u){t["$initial_"+NX(u)]=c}))}));var n,r,s=this.props[uM];if(s){var a=(n=jst(s),r={},fa(n,(function(o,i){r["$initial_"+NX(i)]=o})),r);bo(t,a)}return t}safe_merge(t){return fa(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||!((o,i)=>{if(o.length!==i.length)return!1;var c=[...o].sort(),u=[...i].sort();return c.every(((d,f)=>d===u[f]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var s=this.rt(t),a=this.props;this.clear(),this.B=s,this.props=a,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[zk]||{};r[t]=n,this.props[zk]=r,this.save()}remove_event_timer(t){var n=(this.props[zk]||{})[t];return $t(n)||(delete this.props[zk][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var ik={Activation:"events",Cancellation:"cancelEvents"},jQ={Popover:"popover",API:"api",Widget:"widget"},Vk={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},RQ={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},HX={Popover:"popover",Inline:"inline"},r8n=(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})({}),MAe=(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})({}),$Ae=Ha("[RateLimiter]");class s8n{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((s=>{$Ae.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void $Ae.warn('could not rate limit - continuing. Error: "'+s?.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,s;t===void 0&&(t=!1);var{captureEventsBurstLimit:a,captureEventsPerSecond:o}=this,i=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(UX))!==null&&n!==void 0?n:{tokens:a,last:i};c.tokens+=(i-c.last)/1e3*o,c.last=i,c.tokens>a&&(c.tokens=a);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 "+o+" events per second and "+a+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(s=this.instance.persistence)==null||s.set_property(UX,c),{isRateLimited:u,remainingTokens:c.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var lk=Ha("[RemoteConfig]");class Ist{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=An._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}vt(t){var n,r;(n=An.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=An.__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 lk.info("Using preloaded remote config",this.remoteConfig),this.ft(this.remoteConfig),void this._t();if(this._instance.bt())return void lk.warn("Remote config is disabled. Falling back to local config.");this.vt((t=>{if(!t)return lk.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){lk.error("Error loading remote config",t)}}stop(){this.yt&&(clearInterval(this.yt),this.yt=void 0)}refresh(){this._instance.bt()||It?.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||lk.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 Dh=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),cd=Uint8Array,cc=Uint16Array,DS=Uint32Array,iie=new cd([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]),lie=new cd([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]),DAe=new cd([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pst=function(e,t){for(var n=new cc(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var s=new DS(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)s[a]=a-n[r]<<5|r;return[n,s]},Mst=Pst(iie,2),a8n=Mst[0],QX=Mst[1];a8n[28]=258,QX[258]=28;for(var LAe=Pst(lie,0)[1],$st=new cc(32768),Ea=0;Ea<32768;++Ea){var yy=(43690&Ea)>>>1|(21845&Ea)<<1;yy=(61680&(yy=(52428&yy)>>>2|(13107&yy)<<2))>>>4|(3855&yy)<<4,$st[Ea]=((65280&yy)>>>8|(255&yy)<<8)>>>1}var A_=function(e,t,n){for(var r=e.length,s=0,a=new cc(t);s<r;++s)++a[e[s]-1];var o,i=new cc(t);for(s=0;s<t;++s)i[s]=i[s-1]+a[s-1]<<1;for(o=new cc(r),s=0;s<r;++s)o[s]=$st[i[e[s]-1]++]>>>15-e[s];return o},qv=new cd(288);for(Ea=0;Ea<144;++Ea)qv[Ea]=8;for(Ea=144;Ea<256;++Ea)qv[Ea]=9;for(Ea=256;Ea<280;++Ea)qv[Ea]=7;for(Ea=280;Ea<288;++Ea)qv[Ea]=8;var gM=new cd(32);for(Ea=0;Ea<32;++Ea)gM[Ea]=5;var o8n=A_(qv,9),i8n=A_(gM,5),Dst=function(e){return(e/8>>0)+(7&e&&1)},Lst=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof cc?cc:e instanceof DS?DS:cd)(n-t);return r.set(e.subarray(t,n)),r},kh=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},ck=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},IQ=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var s=n.length,a=n.slice();if(!s)return[new cd(0),0];if(s==1){var o=new cd(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(E,C){return E.f-C.f})),n.push({s:-1,f:25001});var i=n[0],c=n[1],u=0,d=1,f=2;for(n[0]={s:-1,f:i.f+c.f,l:i,r:c};d!=s-1;)i=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:i.f+c.f,l:i,r:c};var p=a[0].s;for(r=1;r<s;++r)a[r].s>p&&(p=a[r].s);var h=new cc(p+1),g=GX(n[d-1],h,0);if(g>t){r=0;var b=0,y=g-t,x=1<<y;for(a.sort((function(E,C){return h[C.s]-h[E.s]||E.f-C.f}));r<s;++r){var w=a[r].s;if(!(h[w]>t))break;b+=x-(1<<g-h[w]),h[w]=t}for(b>>>=y;b>0;){var O=a[r].s;h[O]<t?b-=1<<t-h[O]++-1:++r}for(;r>=0&&b;--r){var k=a[r].s;h[k]==t&&(--h[k],++b)}g=t}return[new cd(h),g]},GX=function(e,t,n){return e.s==-1?Math.max(GX(e.l,t,n+1),GX(e.r,t,n+1)):t[e.s]=n},FAe=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new cc(++t),r=0,s=e[0],a=1,o=function(c){n[r++]=c},i=1;i<=t;++i)if(e[i]==s&&i!=t)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=e[i]}return[n.subarray(0,r),t]},uk=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},WX=function(e,t,n){var r=n.length,s=Dst(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var a=0;a<r;++a)e[s+a+4]=n[a];return 8*(s+4+r)},zAe=function(e,t,n,r,s,a,o,i,c,u,d){kh(t,d++,n),++s[256];for(var f=IQ(s,15),p=f[0],h=f[1],g=IQ(a,15),b=g[0],y=g[1],x=FAe(p),w=x[0],O=x[1],k=FAe(b),E=k[0],C=k[1],N=new cc(19),T=0;T<w.length;++T)N[31&w[T]]++;for(T=0;T<E.length;++T)N[31&E[T]]++;for(var j=IQ(N,7),R=j[0],P=j[1],M=19;M>4&&!R[DAe[M-1]];--M);var U,D,q,V,B=u+5<<3,H=uk(s,qv)+uk(a,gM)+o,G=uk(s,p)+uk(a,b)+o+14+3*M+uk(N,R)+(2*N[16]+3*N[17]+7*N[18]);if(B<=H&&B<=G)return WX(t,d,e.subarray(c,c+u));if(kh(t,d,1+(G<H)),d+=2,G<H){U=A_(p,h),D=p,q=A_(b,y),V=b;var L=A_(R,P);for(kh(t,d,O-257),kh(t,d+5,C-1),kh(t,d+10,M-4),d+=14,T=0;T<M;++T)kh(t,d+3*T,R[DAe[T]]);d+=3*M;for(var Z=[w,E],z=0;z<2;++z){var I=Z[z];for(T=0;T<I.length;++T){var Q=31&I[T];kh(t,d,L[Q]),d+=R[Q],Q>15&&(kh(t,d,I[T]>>>5&127),d+=I[T]>>>12)}}}else U=o8n,D=qv,q=i8n,V=gM;for(T=0;T<i;++T)if(r[T]>255){Q=r[T]>>>18&31,ck(t,d,U[Q+257]),d+=D[Q+257],Q>7&&(kh(t,d,r[T]>>>23&31),d+=iie[Q]);var W=31&r[T];ck(t,d,q[W]),d+=V[W],W>3&&(ck(t,d,r[T]>>>5&8191),d+=lie[W])}else ck(t,d,U[r[T]]),d+=D[r[T]];return ck(t,d,U[256]),d+D[256]},l8n=new DS([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),c8n=(function(){for(var e=new DS(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),u8n=function(e,t,n,r,s){return(function(a,o,i,c,u,d){var f=a.length,p=new cd(c+f+5*(1+Math.floor(f/7e3))+u),h=p.subarray(c,p.length-u),g=0;if(!o||f<8)for(var b=0;b<=f;b+=65535){var y=b+65535;y<f?g=WX(h,g,a.subarray(b,y)):(h[b]=d,g=WX(h,g,a.subarray(b,f)))}else{for(var x=l8n[o-1],w=x>>>13,O=8191&x,k=(1<<i)-1,E=new cc(32768),C=new cc(k+1),N=Math.ceil(i/3),T=2*N,j=function(we){return(a[we]^a[we+1]<<N^a[we+2]<<T)&k},R=new DS(25e3),P=new cc(288),M=new cc(32),U=0,D=0,q=(b=0,0),V=0,B=0;b<f;++b){var H=j(b),G=32767&b,L=C[H];if(E[G]=L,C[H]=G,V<=b){var Z=f-b;if((U>7e3||q>24576)&&Z>423){g=zAe(a,h,0,R,P,M,D,q,B,b-B,g),q=U=D=0,B=b;for(var z=0;z<286;++z)P[z]=0;for(z=0;z<30;++z)M[z]=0}var I=2,Q=0,W=O,J=G-L&32767;if(Z>2&&H==j(b-J))for(var ne=Math.min(w,Z)-1,te=Math.min(32767,b),ae=Math.min(258,Z);J<=te&&--W&&G!=L;){if(a[b+I]==a[b+I-J]){for(var ce=0;ce<ae&&a[b+ce]==a[b+ce-J];++ce);if(ce>I){if(I=ce,Q=J,ce>ne)break;var ve=Math.min(J,ce-2),ee=0;for(z=0;z<ve;++z){var re=b-J+z+32768&32767,ie=re-E[re]+32768&32767;ie>ee&&(ee=ie,L=re)}}}J+=(G=L)-(L=E[G])+32768&32767}if(Q){R[q++]=268435456|QX[I]<<18|LAe[Q];var ge=31&QX[I],me=31&LAe[Q];D+=iie[ge]+lie[me],++P[257+ge],++M[me],V=b+I,++U}else R[q++]=a[b],++P[a[b]]}}g=zAe(a,h,d,R,P,M,D,q,B,b-B,g)}return Lst(p,0,c+Dst(g)+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)},PQ=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function d8n(e,t){t===void 0&&(t={});var n=(function(){var i=4294967295;return{p:function(c){for(var u=i,d=0;d<c.length;++d)u=c8n[255&u^c[d]]^u>>>8;i=u},d:function(){return 4294967295^i}}})(),r=e.length;n.p(e);var s,a=u8n(e,t,10+((s=t).filename&&s.filename.length+1||0),8),o=a.length;return(function(i,c){var u=c.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=c.level<2?4:c.level==9?2:0,i[9]=3,c.mtime!=0&&PQ(i,4,Math.floor(new Date(c.mtime||Date.now())/1e3)),u){i[3]=8;for(var d=0;d<=u.length;++d)i[d+10]=u.charCodeAt(d)}})(a,t),PQ(a,o-8,n.d()),PQ(a,o-4,r),a}var f8n=function(e){var t,n,r,s,a="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
|
|
474
474
|
`).replace(/\r/g,`
|
|
475
475
|
`)).length,s=0;s<r;s++){var o=e.charCodeAt(s),i=null;o<128?n++:i=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Ef(i)||(n>t&&(a+=e.substring(t,n)),a+=i,t=n=s+1)}return n>t&&(a+=e.substring(t,e.length)),a},p8n=!!TX||!!CX,bM=function(e,t,n){var r;n===void 0&&(n=!0);var[s,a]=e.split("?"),o=Nt({},t),i=(r=a?.split("&").map((u=>{var d,[f,p]=u.split("="),h=n&&(d=o[f])!==null&&d!==void 0?d:p;return delete o[f],f+"="+h})))!==null&&r!==void 0?r:[],c=XFn(o);return c&&i.push(c),s+"?"+i.join("&")},qk=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),MQ=e=>{var{data:t,compression:n}=e;if(t){if(n===Dh.GZipJS){var r=d8n((function(i,c){var u=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var d=new cd(i.length+(i.length>>>1)),f=0,p=function(y){d[f++]=y},h=0;h<u;++h){if(f+5>d.length){var g=new cd(f+8+(u-h<<1));g.set(d),d=g}var b=i.charCodeAt(h);b<128||c?p(b):b<2048?(p(192|b>>>6),p(128|63&b)):b>55295&&b<57344?(p(240|(b=65536+(1047552&b)|1023&i.charCodeAt(++h))>>>18),p(128|b>>>12&63),p(128|b>>>6&63),p(128|63&b)):(p(224|b>>>12),p(128|b>>>6&63),p(128|63&b))}return Lst(d,0,f)})(qk(t)),{mtime:0});return{contentType:"text/plain",body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Dh.Base64){var s=(function(i){var c,u,d,f,p,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,b=0,y="",x=[];if(!i)return i;i=f8n(i);do c=(p=i.charCodeAt(g++)<<16|i.charCodeAt(g++)<<8|i.charCodeAt(g++))>>18&63,u=p>>12&63,d=p>>6&63,f=63&p,x[b++]=h.charAt(c)+h.charAt(u)+h.charAt(d)+h.charAt(f);while(g<i.length);switch(y=x.join(""),i.length%3){case 1:y=y.slice(0,-2)+"==";break;case 2:y=y.slice(0,-1)+"="}return y})(qk(t)),a=(i=>"data="+encodeURIComponent(typeof i=="string"?i:qk(i)))(s);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=qk(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},jI=[];CX&&jI.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:s,estimatedSize:a}=(t=MQ(e))!==null&&t!==void 0?t:{},o=new Headers;fa(e.headers,(function(d,f){o.append(f,d)})),r&&o.append("Content-Type",r);var i=e.url,c=null;if(fAe){var u=new fAe;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}CX(i,Nt({method:e?.method||"GET",headers:o,keepalive:e.method==="POST"&&(a||0)<52428.8,body:s,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){zt.error(h)}e.callback==null||e.callback(p)})))).catch((d=>{zt.error(d),e.callback==null||e.callback({statusCode:0,error:d})})).finally((()=>c?clearTimeout(c.timeout):null))}}),TX&&jI.push({transport:"XHR",method:e=>{var t,n=new TX;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=(t=MQ(e))!==null&&t!==void 0?t:{};fa(e.headers,(function(a,o){n.setRequestHeader(o,a)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(a)}},n.send(s)}}),nu!=null&&nu.sendBeacon&&jI.push({transport:"sendBeacon",method:e=>{var t=bM(e.url,{beacon:"1"});try{var n,{contentType:r,body:s}=(n=MQ(e))!==null&&n!==void 0?n:{},a=typeof s=="string"?new Blob([s],{type:r}):s;nu.sendBeacon(t,a)}catch{}}});var ZX=3e3;class h8n{constructor(t,n){this.wt=!0,this.Et=[],this.St=bp(n?.flush_interval_ms||ZX,250,5e3,zt.createLogger("flush interval"),ZX),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(Nt({},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 a=n[s],o=new Date().getTime();a.data&&hs(a.data)&&fa(a.data,(i=>{i.offset=Math.abs(i.timestamp-o),delete i.timestamp})),t.xt(a)};for(var s in n)r()}}),this.St))}Pt(){clearTimeout(this.$t),this.$t=void 0}Tt(){var t={};return fa(this.Et,(n=>{var r,s=n,a=(s?s.batchKey:null)||s.url;$t(t[a])&&(t[a]=Nt({},s,{data:[]})),(r=t[a].data)==null||r.push(s.data)})),this.Et=[],t}}var m8n=["retriesPerformedSoFar"];class g8n{constructor(t){this.Rt=!1,this.It=3e3,this.Et=[],this._instance=t,this.Et=[],this.Ct=!0,!$t(Qe)&&"onLine"in Qe.navigator&&(this.Ct=Qe.navigator.onLine,this.Ot=()=>{this.Ct=!0,this.Ft()},this.Mt=()=>{this.Ct=!1},Eo(Qe,"online",this.Ot),Eo(Qe,"offline",this.Mt))}get length(){return this.Et.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=Wrt(t,m8n);A0(n)&&(r.url=bM(r.url,{retry_count:n})),this._instance._send_request(Nt({},r,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(n??0)<10?this.At(Nt({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(s)}}))}At(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(o){var i=3e3*Math.pow(2,o),c=i/2,u=Math.min(18e5,i),d=(Math.random()-.5)*(u-c);return Math.ceil(u+d)})(n),s=Date.now()+r;this.Et.push({retryAt:s,requestOptions:t});var a="Enqueued failed request for retry in "+r;navigator.onLine||(a+=" (Browser is offline)"),zt.warn(a),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((a=>a.retryAt<t||(n.push(a),!1)));if(this.Et=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:t}of(this.Lt&&(clearTimeout(this.Lt),this.Lt=void 0),this.Rt=!1,$t(Qe)||(this.Ot&&(Qe.removeEventListener("online",this.Ot),this.Ot=void 0),this.Mt&&(Qe.removeEventListener("offline",this.Mt),this.Mt=void 0)),this.Et))try{this._instance._send_request(Nt({},t,{transport:"sendBeacon"}))}catch(n){zt.error(n)}this.Et=[]}}class b8n{constructor(t){this.jt=()=>{var n,r,s,a;this.Nt||(this.Nt={});var o=this.scrollElement(),i=this.scrollY(),c=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=i+(o?.clientHeight||0),d=o?.scrollHeight||0;this.Nt.lastScrollY=Math.ceil(i),this.Nt.maxScrollY=Math.max(i,(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,(s=this.Nt.maxContentY)!==null&&s!==void 0?s:0),this.Nt.maxContentHeight=Math.max(d,(a=this.Nt.maxContentHeight)!==null&&a!==void 0?a:0)},this._instance=t}getContext(){return this.Nt}resetContext(){var t=this.Nt;return setTimeout(this.jt,0),t}startMeasuringScrollPosition(){Eo(Qe,"scroll",this.jt,{capture:!0}),Eo(Qe,"scrollend",this.jt,{capture:!0}),Eo(Qe,"resize",this.jt)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Qe?.document.documentElement;var t=hs(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=Qe?.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 Qe&&(Qe.scrollY||Qe.pageYOffset||Qe.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Qe&&(Qe.scrollX||Qe.pageXOffset||Qe.document.documentElement.scrollLeft)||0}}var y8n=e=>Ast(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class BAe{constructor(t,n,r,s){this.Ut=a=>{var o=this.zt();if(!o||o.sessionId!==a){var i={sessionId:a,props:this.Ht(this._instance)};this.Bt.register({[BX]:i})}},this._instance=t,this.qt=n,this.Bt=r,this.Ht=s||y8n,this.qt.onSessionId(this.Ut)}zt(){return this.Bt.props[BX]}getSetOnceProps(){var t,n=(t=this.zt())==null?void 0:t.props;return n?"r"in n?jst(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 fa(oie(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+NX(r)]=n})),t}}class cie{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 s of this.Vt["*"]||[])s(t,n)}}var $Q=Ha("[SessionId]");class UAe{on(t,n){return this.Wt.on(t,n)}constructor(t,n,r){var s;if(this.Gt=[],this.Yt=void 0,this.Wt=new cie,this.Jt=(d,f)=>!(!A0(d)||!A0(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||Tg,this.Zt=r||Tg;var a=this.N.persistence_name||this.N.token,o=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*bp(o,60,36e3,$Q.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ti(),this.ii="ph_"+a+"_window_id",this.ei="ph_"+a+"_primary_window_exists",this.ri()){var i=yi.D(this.ii),c=yi.D(this.ei);i&&!c?this.Kt=i:yi.j(this.ii),yi.L(this.ei,!0)}if((s=this.N.bootstrap)!=null&&s.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){$Q.error("Invalid sessionID in bootstrap",d)}this.ni()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return $t(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&&yi.F()}oi(t){t!==this.Kt&&(this.Kt=t,this.ri()&&yi.L(this.ii,t))}ai(){return this.Kt?this.Kt:this.ri()?yi.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({[lM]:[n,t,r]}))}li(){var t=this.Bt.props[lM];return hs(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&&Qe&&(Qe.removeEventListener("beforeunload",this.Yt,{capture:!1}),this.Yt=void 0),this.Gt=[]}ni(){this.Yt=()=>{this.ri()&&yi.j(this.ei)},Eo(Qe,"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(),[s,a,o]=this.li(),i=this.ai(),c=A0(o)&&Math.abs(r-o)>864e5,u=!1,d=!a,f=!d&&!t&&this.Jt(r,s);d||f||c?(a=this.Qt(),i=this.Zt(),$Q.info("new session ID generated",{sessionId:a,windowId:i,changeReason:{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}}),o=r,u=!0):i||(i=this.Zt(),u=!0);var p=A0(s)&&t&&!c?s:r,h=A0(o)?o:new Date().getTime();return this.oi(i),this.si(a,p,h),t||this.ti(),u&&this.Gt.forEach((g=>g(a,i,u?{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}:void 0))),{sessionId:a,windowId:i,sessionStartTimestamp:h,changeReason:u?{noSessionId:d,activityTimeout:f,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:s}}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 Fst=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&mAe(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>mAe(s?.brand,t))))return!0}catch{}return!!e.webdriver},yM=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 VAe(e,t,n){return qk({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var zst={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=>yM(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!yM(n,r))))),icontains:(e,t)=>t.map(FR).some((n=>e.map(FR).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(FR).every((n=>e.map(FR).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((s=>r>parseFloat(s)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((s=>r<parseFloat(s)))}))},FR=e=>e.toLowerCase();function Bst(e,t){return!e||Object.entries(e).every((n=>{var[r,s]=n,a=t?.[r];if($t(a)||Ef(a))return!1;var o=[String(a)],i=zst[s.operator];return!!i&&i(s.values,o)}))}var Hk=(function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e})({}),qAe="i.posthog.com";class v8n{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("."+qAe,".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]=Hk.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=Hk.EU:this.hi[this.apiHost]=Hk.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===Hk.CUSTOM)return this.apiHost+n;var r=qAe+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Zs=Ha("[Surveys]"),Ust="seenSurvey_",x8n=(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},HAe=e=>((t,n)=>{var r=""+t+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+t+n.id+"_"+n.current_iteration),r})(Ust,e),w8n=[jQ.Popover,jQ.Widget,jQ.API],S8n={ignoreConditions:!1,ignoreDelay:!1,displayType:HX.Popover},O8n=Ha("[PostHog ExternalIntegrations]"),k8n={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class _8n{constructor(t){this._instance=t}G(t,n){var r;(r=An.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(s=>{if(s)return O8n.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var t=this,n=function(o){var i,c,u;!s||(i=An.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[o]||t.G(k8n[o],(()=>{var d;(d=An.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[o])==null||d.start(t._instance)})),!s&&(c=An.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[o]&&((u=An.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.stop())};for(var[r,s]of Object.entries((a=this._instance.config.integrations)!==null&&a!==void 0?a:{})){var a;n(r)}}}var j_={},DQ=0,YX=()=>{},j0="posthog",Vst=!p8n&&Wl?.indexOf("MSIE")===-1&&Wl?.indexOf("Mozilla")===-1,QAe=e=>{var t;return Nt({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:DFn(It?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:YX,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:xi&&Ao(xi?.search)&&xi.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:(Qe==null||(t=Qe.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;zt.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:ZX},error_tracking:{},_onCapture:YX,__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))},GAe=e=>{var t={};$t(e.process_person)||(t.person_profiles=e.process_person),$t(e.xhr_headers)||(t.request_headers=e.xhr_headers),$t(e.cookie_name)||(t.persistence_name=e.cookie_name),$t(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),$t(e.store_google)||(t.save_campaign_params=e.store_google),$t(e.verbose)||(t.debug=e.verbose);var n=bo({},t,e);return hs(e.property_blacklist)&&($t(e.property_denylist)?n.property_denylist=e.property_blacklist:hs(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:zt.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class E8n{constructor(){this.__forceAllowLocalhost=!1}get di(){return this.__forceAllowLocalhost}set di(t){zt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class op{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 E8n,this.fi=!1,this.version=Vu.LIB_VERSION,this.pi=new cie,this.ci=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=QAe(),this.SentryIntegration=YFn,this.sentryIntegration=r=>(function(s,a){var o=_st(s,a);return{name:kst,processEvent:i=>o(i)}})(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 b8n(this),this.pageViewManager=new IAe(this),this.rateLimiter=new s8n(this),this.requestRouter=new v8n(this),this.consent=new QFn(this),this.externalIntegrations=new _8n(this);var n=(t=op.__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,s,a)=>{var o=Ao(r)?{[r]:s}:r;this.setPersonProperties(o),a?.({})},set_once:(r,s,a)=>{var o=Ao(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),a?.({})}},this.on("eventCaptured",(r=>zt.info('send "'+r?.event+'"',r)))}init(t,n,r){if(r&&r!==j0){var s,a=(s=j_[r])!==null&&s!==void 0?s:new op;return a._init(t,n,r),j_[r]=a,j_[j0][r]=a,a}return this._init(t,n,r)}_init(t,n,r){var s;if(n===void 0&&(n={}),$t(t)||AX(t))return zt.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(bo({},QAe(n.defaults),GAe(n),{name:r,token:t})),this.config.on_xhr_error&&zt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Dh.GZipJS;var a=this.xi();this.persistence=new AQ(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new AQ(Nt({},this.config,{persistence:"sessionStorage"}),a);var o=Nt({},this.persistence.props),i=Nt({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new h8n((g=>this.ki(g)),this.config.request_queue_config),this.Pi=new g8n(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 UAe(this),this.sessionPropsManager=new BAe(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(zt.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ti(c)}),0)):(zt.info("Initializing extensions synchronously"),this.Ti(c)),Vu.DEBUG=Vu.DEBUG||this.config.debug,Vu.DEBUG&&zt.info("Starting in debug mode",{this:this,config:n,thisC:Nt({},this.config),p:o,s:i}),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var u,d,f=this.config.get_device_id(Tg()),p=(u=n.bootstrap)!=null&&u.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(Wf,(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:ak,$device_id:null},"");else if(!this.get_distinct_id()){var h=this.config.get_device_id(Tg());this.register_once({distinct_id:h,$device_id:h},""),this.persistence.set_property(Wf,"anonymous")}return Eo(Qe,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?ZFn(this,(()=>this.Ri())):this.Ri(),Bh(this.config._onCapture)&&this.config._onCapture!==YX&&(zt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(g=>this.config._onCapture(g.event,g)))),this.config.ip&&zt.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,s,a,o,i,c,u=performance.now(),d=Nt({},op.__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=(s=this.surveys)!==null&&s!==void 0?s:new d.surveys(this)),d.logs&&this.ci.push(this.logs=(a=this.logs)!==null&&a!==void 0?a:new d.logs(this)),d.conversations&&this.ci.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o: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,WFn)),d.toolbar&&this.ci.push(this.toolbar=(i=this.toolbar)!==null&&i!==void 0?i: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(a){zt.error("Error initializing extension:",a)}}var s=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:s}),this.config.__preview_deferred_init_extensions&&zt.info("PostHog extensions initialized ("+s+"ms)")}ft(t){var n;if(!It||!It.body)return zt.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=jr(t.supportedCompression,Dh.GZipJS)?Dh.GZipJS:jr(t.supportedCompression,Dh.Base64)?Dh.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){zt.critical("`loaded` function failed",r)}if(this.Oi(),this.config.internal_or_test_user_hostname&&xi!=null&&xi.hostname){var t=xi.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 Ist(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()&&Bg(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&&(Vst?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=bM(t.url,{ip:this.config.ip?1:0}),t.headers=Nt({},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,s,a,o=Nt({},n);o.timeout=o.timeout||6e4,o.url=bM(o.url,{_:new Date().getTime().toString(),ver:Vu.JS_SDK_VERSION,compression:o.compression});var i=(r=o.transport)!==null&&r!==void 0?r:"fetch",c=jI.filter((d=>!o.disableTransport||!d.transport||!o.disableTransport.includes(d.transport))),u=(s=(a=bst(c,(d=>d.transport===i)))==null?void 0:a.method)!==null&&s!==void 0?s:c[0].method;if(!u)throw new Error("No available transport method");u(o)})(Nt({},t,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(s=this.config).on_request_error)==null||r.call(s,n)),t.callback==null||t.callback(n)}}))))}ki(t){this.Pi?this.Pi.retriableRequest(t):this._send_request(t)}_execute_array(t){DQ++;try{var n,r=[],s=[],a=[];Bg(t,(i=>{i&&(n=i[0],hs(n)?a.push(i):Bh(i)?i.call(this):hs(i)&&n==="alias"?r.push(i):hs(i)&&n.indexOf("capture")!==-1&&Bh(this[n])?a.push(i):s.push(i))}));var o=function(i,c){Bg(i,(function(u){if(hs(u[0])){var d=c;fa(u,(function(f){d=d[f[0]].apply(d,f.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),c)};o(r,this),o(s,this),o(a,this)}finally{DQ--}}push(t){if(DQ>0&&hs(t)&&Ao(t[0])){var n=op.prototype[t[0]];Bh(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!$t(t)&&Ao(t)){var a=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(a&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!Ao(n?.$current_url)&&(zt.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||zt.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 i=new Date,c=r?.timestamp||i,u=Tg(),d={uuid:u,event:t,properties:this.calculateEventProperties(t,n||{},c,u)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&a&&(d.event="$bot_pageview",d.properties.$browser_type="bot"),o&&(d.properties.$lib_rate_limit_remaining_tokens=o.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=MFn(d,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=c,$t(r?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=i),t===Vk.DISMISSED||t===Vk.SENT){var g=n?.[RQ.SURVEY_ID],b=n?.[RQ.SURVEY_ITERATION];f={id:g,current_iteration:b},localStorage.getItem(HAe(f))||localStorage.setItem(HAe(f),"true"),d.$set=Nt({},d.$set,{[x8n({id:g,current_iteration:b},t===Vk.SENT?"responded":"dismissed")]:!0})}else t===Vk.SHOWN&&(d.$set=Nt({},d.$set,{[RQ.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===r8n.SHOWN){var y=n?.[MAe.TOUR_TYPE];y&&(d.$set=Nt({},d.$set,{[MAe.TOUR_LAST_SEEN_DATE+"/"+y]:new Date().toISOString()}))}var x=Nt({},d.properties.$set,d.$set);if(Z0(x)||this.setPersonPropertiesForFlags(x),!Br(this.config.before_send)){var w=this.ji(d);if(!w)return;d=w}this.pi.emit("eventCaptured",d);var O={method:"POST",url:(s=r?._url)!==null&&s!==void 0?s: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}zt.critical("This capture call is ignored due to client rate limiting.")}}else zt.error("No event name provided to posthog.capture")}else zt.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,s,a){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=a?void 0:this.persistence.remove_event_timer(t),i=Nt({},n);if(i.token=this.config.token,i.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(i.$cookieless_mode=!0),t==="$snapshot"){var c=Nt({},this.persistence.properties(),this.sessionPersistence.properties());return i.distinct_id=c.distinct_id,(!Ao(i.distinct_id)&&!Pp(i.distinct_id)||AX(i.distinct_id))&&zt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),i}var u,d=t8n(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(a,r.getTime());i.$session_id=f,i.$window_id=p}this.sessionPropsManager&&bo(i,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&bo(i,this.sessionRecording.sdkDebugProperties),i.$sdk_debug_retry_queue_size=(h=this.Pi)==null?void 0:h.length}catch(x){i.$sdk_debug_error_capturing_properties=String(x)}if(this.requestRouter.region===Hk.CUSTOM&&(i.$lib_custom_api_host=this.config.api_host),u=t!=="$pageview"||a?t!=="$pageleave"||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),i=bo(i,u),t==="$pageview"&&It&&(i.title=It.title),!$t(o)){var g=r.getTime()-o;i.$duration=parseFloat((g/1e3).toFixed(3))}Wl&&this.config.opt_out_useragent_filter&&(i.$browser_type=this._is_bot()?"bot":"browser"),(i=bo({},d,this.persistence.properties(),this.sessionPersistence.properties(),i)).$is_identified=this._isIdentified(),hs(this.config.property_denylist)?fa(this.config.property_denylist,(function(x){delete i[x]})):zt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(zt.error("sanitize_properties is deprecated. Use before_send instead"),i=b(i,t));var y=this.Ni();return i.$process_person_profile=y,y&&!a&&this.Ui("_calculate_event_properties"),i}Li(t,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.Ni()||this.fi)return t;var s=this.persistence.get_initial_props(),a=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=bo({},s,a||{},t||{}),i=this.config.sanitize_properties;return i&&(zt.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),n&&(this.fi=!0),Z0(o)?void 0:o}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var s;(s=this.persistence)==null||s.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 s;(s=this.featureFlags)==null||s.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.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=S8n),(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,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.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 zt.uninitializedWarning("posthog.identify");if(Pp(t)&&(t=t.toString(),zt.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()))zt.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!==ak){if(this.Ui("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var a=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:a},"")}t!==s&&t!==this.get_property(Fk)&&(this.unregister(Fk),this.register({distinct_id:t}));var o,i=(this.persistence.get_property(Wf)||"anonymous")==="anonymous";t!==s&&i?(this.persistence.set_property(Wf,"identified"),this.setPersonPropertiesForFlags(Nt({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.yi=VAe(t,n,r),(o=this.featureFlags)==null||o.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),t!==s&&(this.reloadFeatureFlags(),this.unregister(N_))}}else zt.critical('The string "'+ak+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else zt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.Ui("posthog.setPersonProperties")){var r=VAe(this.get_distinct_id(),t,n);this.yi!==r?(this.setPersonPropertiesForFlags(Nt({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.yi=r):zt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var s=this.getGroups();s[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Nt({},s,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),s[t]===n||r||this.reloadFeatureFlags()}else zt.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,s,a,o,i,c;if(zt.info("reset"),!this.__loaded)return zt.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(),(s=this.surveys)==null||s.reset(),(a=this.Mi)==null||a.stop(),(o=this.featureFlags)==null||o.reset(),(i=this.persistence)==null||i.set_property(Wf,"anonymous"),(c=this.sessionManager)==null||c.resetSessionId(),this.yi=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:ak,$device_id:null},"");else{var d=this.config.get_device_id(Tg());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),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var a,o=(a=t.timestampLookBack)!==null&&a!==void 0?a:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return s}alias(t,n){return t===this.get_property(vst)?(zt.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ui("posthog.alias")?($t(n)&&(n=this.get_distinct_id()),t!==n?(this.zi(Fk,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(zt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=Nt({},this.config);if(Ho(t)){var r,s,a,o,i,c,u,d,f;bo(this.config,GAe(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 AQ(Nt({},this.config,{persistence:"sessionStorage"}),p);var h=this.wi(this.config.debug);Zh(h)&&(this.config.debug=h),Zh(this.config.debug)&&(this.config.debug?(Vu.DEBUG=!0,Ba.F()&&Ba.L("ph_debug",!0),zt.info("set_config",{config:t,oldConfig:n,newConfig:Nt({},this.config)})):(Vu.DEBUG=!1,Ba.F()&&Ba.j("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(i=this.heatmaps)==null||i.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){Vu.LIB_NAME=t,Vu.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 s,a,o,i,c;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),r.sampling&&((a=this.sessionRecording)==null||a.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((i=this.sessionRecording)==null||i.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"),s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Nt({},s,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:j0;return n!==j0&&(n=j0+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(Wf))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Wf))==="identified"}Ni(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Z0(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Fk])&&((n=this.persistence)==null||(n=n.props)==null||!n[dM]))}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"?(zt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zi(dM,!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,s,a=this.xi();return((t=this.persistence)==null?void 0:t.st)!==a&&((r=this.persistence)==null||r.set_disabled(a)),((n=this.sessionPersistence)==null?void 0:n.st)!==a&&((s=this.sessionPersistence)==null||s.set_disabled(a)),a}opt_in_capturing(t){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,s,a,o,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new UAe(this),this.pageViewManager=new IAe(this),this.persistence&&(this.sessionPropsManager=new BAe(this,this.sessionManager,this.persistence));var c=(a=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&a!==void 0?a:(i=op.__defaultExtensionClasses)==null?void 0:i.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()),($t(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 zt.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:ak,$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())):zt.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===Rh.GRANTED?"granted":t===Rh.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 nu?Fst(nu,this.config.custom_blocked_useragents):void 0}Fi(){It&&(It.visibilityState==="visible"?this.gi||(this.gi=!0,this.capture("$pageview",{title:It.title},{send_instantly:!0}),this.mi&&(It.removeEventListener("visibilitychange",this.mi),this.mi=null)):this.mi||(this.mi=this.Fi.bind(this),Eo(It,"visibilitychange",this.mi)))}debug(t){t===!1?(Qe?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Qe?.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,s,a,o,i,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?(zt.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",s=!1,a=zt,o=(n="advanced_disable_flags")in(t=c)&&!Br(t[n]),i=r in t&&!Br(t[r]),o?t[n]:i?(a&&a.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):s)}ji(t){if(Br(this.config.before_send))return t;var n=hs(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var s of n){if(r=s(r),Br(r)){var a="Event '"+t.event+"' was rejected in beforeSend function";return K9n(t.event)?zt.warn(a+". This can cause unexpected behavior."):zt.info(a),null}r.properties&&!Z0(r.properties)||zt.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=Zh(t)&&!t,r=Ba.F()&&Ba.A("ph_debug")==="true";return!n&&(!!r||t)}}op.__defaultExtensionClasses={},(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=PFn(e.prototype[t[n]])})(op,["identify"]);function WAe(e){return e instanceof Element&&(e.id===Sst||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function p3(e){return!!e&&e.nodeType===1}function Ug(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function qst(e){return!!e&&e.nodeType===3}function Hst(e){return!!e&&e.nodeType===11}function uie(e){return e?d3(e).split(/\s+/):[]}function ZAe(e){var t=Qe?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function vM(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 uie(t)}function Qst(e){return Br(e)?null:d3(e).split(/(\s+)/).filter((t=>PC(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function TN(e){var t="";return XX(e)&&!Yst(e)&&e.childNodes&&e.childNodes.length&&fa(e.childNodes,(function(n){var r;qst(n)&&n.textContent&&(t+=(r=Qst(n.textContent))!==null&&r!==void 0?r:"")})),d3(t)}function YAe(e){return $t(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var die=["a","button","form","input","select","textarea","label"];function Gst(e,t){if($t(t))return!0;var n,r=function(a){if(t.some((o=>a.matches(o))))return{v:!0}};for(var s of e)if(n=r(s))return n.v;return!1}function Wst(e){var t=e.parentNode;return!(!t||!p3(t))&&t}var C8n=["next","previous","prev",">","<"],XAe=10,KAe=[".ph-no-rageclick",".ph-no-capture"];function T8n(e,t){if(!Qe||fie(e))return!1;var n,r,s;if(Zh(t)?(n=!!t&&KAe,r=void 0):(n=(s=t?.css_selector_ignorelist)!==null&&s!==void 0?s:KAe,r=t?.content_ignorelist),n===!1)return!1;var{targetElementList:a}=Zst(e,!1);return!(function(o,i){if(o===!1||$t(o))return!1;var c;if(o===!0)c=C8n;else{if(!hs(o))return!1;if(o.length>XAe)return zt.error("[PostHog] content_ignorelist array cannot exceed "+XAe+" items. Use css_selector_ignorelist for more complex matching."),!1;c=o.map((u=>u.toLowerCase()))}return i.some((u=>{var{safeText:d,ariaLabel:f}=u;return c.some((p=>d.includes(p)||f.includes(p)))}))})(r,a.map((o=>{var i;return{safeText:TN(o).toLowerCase(),ariaLabel:((i=o.getAttribute("aria-label"))==null?void 0:i.toLowerCase().trim())||""}})))&&!Gst(a,n)}var fie=e=>!e||Ug(e,"html")||!p3(e),Zst=(e,t)=>{if(!Qe||fie(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],s=e;s.parentNode&&!Ug(s,"body");)if(Hst(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var a=Wst(s);if(!a)break;if(t||die.indexOf(a.tagName.toLowerCase())>-1)n=!0;else{var o=Qe.getComputedStyle(a);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(a),s=a}return{parentIsUsefulElement:n,targetElementList:r}};function N8n(e,t,n,r,s){var a,o,i,c;if(n===void 0&&(n=void 0),!Qe||fie(e)||(a=n)!=null&&a.url_allowlist&&!ZAe(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&ZAe(n.url_ignorelist))return!1;if((i=n)!=null&&i.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((g=>t.type===g)))return!1}var{parentIsUsefulElement:d,targetElementList:f}=Zst(e,r);if(!(function(g,b){var y=b?.element_allowlist;if($t(y))return!0;var x,w=function(k){if(y.some((E=>k.tagName.toLowerCase()===E)))return{v:!0}};for(var O of g)if(x=w(O))return x.v;return!1})(f,n)||!Gst(f,(c=n)==null?void 0:c.css_selector_allowlist))return!1;var p=Qe.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(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return d?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(die.indexOf(h)>-1||e.getAttribute("contenteditable")==="true")}}function XX(e){for(var t=e;t.parentNode&&!Ug(t,"body");t=t.parentNode){var n=vM(t);if(jr(n,"ph-sensitive")||jr(n,"ph-no-capture"))return!1}if(jr(vM(e),"ph-include"))return!0;var r=e.type||"";if(Ao(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(Ao(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Yst(e){return!!(Ug(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ug(e,"select")||Ug(e,"textarea")||e.getAttribute("contenteditable")==="true")}var Xst="(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})",A8n=new RegExp("^(?:"+Xst+")$"),j8n=new RegExp(Xst),Kst="\\d{3}-?\\d{2}-?\\d{4}",R8n=new RegExp("^("+Kst+")$"),I8n=new RegExp("("+Kst+")");function PC(e,t){return t===void 0&&(t=!0),!(Br(e)||Ao(e)&&(e=d3(e),(t?A8n:j8n).test((e||"").replace(/[- ]/g,""))||(t?R8n:I8n).test(e)))}function Jst(e){var t=TN(e);return PC(t=(t+" "+eat(e)).trim())?t:""}function eat(e){var t="";return e&&e.childNodes&&e.childNodes.length&&fa(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=TN(n);t=(t+" "+s).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+eat(n)).trim())}catch(a){zt.error("[AutoCapture]",a)}})),t}function P8n(e){return(function(t){var n=t.map((r=>{var s,a,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var i of(r.attr_class.sort(),r.attr_class))o+="."+i.replace(/"/g,"");var c=Nt({},r.text?{text:r.text}:{},{"nth-child":(s=r.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(a=r.nth_of_type)!==null&&a!==void 0?a:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return AI(c).sort(((d,f)=>{var[p]=d,[h]=f;return p.localeCompare(h)})).forEach((d=>{var[f,p]=d;return u[JAe(f.toString())]=JAe(p.toString())})),o+=":",o+=AI(u).map((d=>{var[f,p]=d;return f+'="'+p+'"'})).join("")}));return n.join(";")})((function(t){return t.map((n=>{var r,s,a={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(s=n.attr__href)==null?void 0:s.slice(0,2048),attr_class:M8n(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return AI(n).filter((o=>{var[i]=o;return i.indexOf("attr__")===0})).forEach((o=>{var[i,c]=o;return a.attributes[i]=c})),a}))})(e))}function JAe(e){return e.replace(/"|\\"/g,'\\"')}function M8n(e){var t=e.attr__class;return t?hs(t)?t:uie(t):void 0}class eje{constructor(t){this.disabled=t===!1;var n=Ho(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 s=this.clicks[this.clicks.length-1];if(s&&Math.abs(t-s.x)+Math.abs(n-s.y)<this.thresholdPx&&r-s.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 LQ="$copy_autocapture",tje=Ha("[AutoCapture]");function FQ(e,t){return t.length>e?t.slice(0,e)+"...":t}function $8n(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!p3(t));return t}function D8n(e,t,n,r){var s=e.tagName.toLowerCase(),a={tag_name:s};die.indexOf(s)>-1&&!n&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?a.$el_text=FQ(1024,Jst(e)):a.$el_text=FQ(1024,TN(e)));var o=vM(e);o.length>0&&(a.classes=o.filter((function(d){return d!==""}))),fa(e.attributes,(function(d){var f;if((!Yst(e)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(r==null||!r.includes(d.name))&&!t&&PC(d.value)&&(f=d.name,!Ao(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=uie(p).join(" ")),a["attr__"+d.name]=FQ(1024,p)}}));for(var i=1,c=1,u=e;u=$8n(u);)i++,u.tagName===e.tagName&&c++;return a.nth_child=i,a.nth_of_type=c,a}function L8n(e,t){for(var n,r,{e:s,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:i,elementsChainAsString:c}=t,u=[e],d=e;d.parentNode&&!Ug(d,"body");)Hst(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var f,p=[],h={},g=!1,b=!1;if(fa(u,(k=>{var E=XX(k);k.tagName.toLowerCase()==="a"&&(g=k.getAttribute("href"),g=E&&g&&PC(g)&&g),jr(vM(k),"ph-no-capture")&&(b=!0),p.push(D8n(k,a,o,i));var C=(function(N){if(!XX(N))return{};var T={};return fa(N.attributes,(function(j){if(j.name&&j.name.indexOf("data-ph-capture-attribute")===0){var R=j.name.replace("data-ph-capture-attribute-",""),P=j.value;R&&P&&PC(P)&&(T[R]=P)}})),T})(k);bo(h,C)})),b)return{props:{},explicitNoCapture:b};if(o||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?p[0].$el_text=Jst(e):p[0].$el_text=TN(e)),g){var y,x;p[0].attr__href=g;var w=(y=pM(g))==null?void 0:y.host,O=Qe==null||(x=Qe.location)==null?void 0:x.host;w&&O&&w!==O&&(f=g)}return{props:bo({$event_type:s.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:P8n(p)},(n=p[0])!=null&&n.$el_text?{$el_text:(r=p[0])==null?void 0:r.$el_text}:{},f&&s.type==="click"?{$external_click_url:f}:{},h)}}var dk=Ha("[ExceptionAutocapture]");function nje(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],s=n(r);return Bh(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}var F8n=Ha("[TracingHeaders]"),ag=Ha("[Web Vitals]"),rje=9e5,sje="disabled",aje="lazy_loading",fk="awaiting_config",zR="missing_config";Ha("[SessionRecording]");var KX="[SessionRecording]",vy=Ha(KX),z8n=Ha("[Heatmaps]");function oje(e){return Ho(e)&&"clientX"in e&&"clientY"in e&&Pp(e.clientX)&&Pp(e.clientY)}var ije=Ha("[Product Tours]"),zQ="ph_product_tours",B8n=["$set_once","$set"],og=Ha("[SiteApps]");function g0(e,t,n){if(Br(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 U8n{constructor(t){this.Bi=new cie,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(!$t((t=this._instance)==null?void 0:t._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}}register(t){var n,r;if(!$t((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((o=>{var i,c;(i=this.Ki)==null||i.add(o),(c=o.steps)==null||c.forEach((u=>{var d;(d=this.Ji)==null||d.add(u?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,a=new Set;t.forEach((o=>{var i;(i=o.steps)==null||i.forEach((c=>{c!=null&&c.selector&&a.add(c?.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(a)}}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((s=>{this.Xi(n,s)&&this.Bi.emit("actionCaptured",s.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,s=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!g0(s,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 s=this.ee(t);if(s.length>0)return s.some((i=>g0(i.href,n.href,n.href_matching||"exact")));var a,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&g0((a=o.match(/(?::|")href="(.*?)"/))?a[1]:"",n.href,n.href_matching||"exact")}te(t,n){var r;if(n==null||!n.text)return!0;var s=this.ee(t);if(s.length>0)return s.some((u=>g0(u.text,n.text,n.text_matching||"exact")||g0(u.$el_text,n.text,n.text_matching||"exact")));var a,o,i,c=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(a=(function(u){for(var d,f=[],p=/(?::|")text="(.*?)"/g;!Br(d=p.exec(u));)f.includes(d[1])||f.push(d[1]);return f})(c),o=n.text,i=n.text_matching||"exact",a.some((u=>g0(u,o,i))))}ie(t,n){var r,s;if(n==null||!n.selector)return!0;var a=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(a!=null&&a.includes(n.selector))return!0;var o=(t==null||(s=t.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}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||Bst(n.properties.reduce(((r,s)=>{var a=hs(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:a,operator:s.operator||"exact"},r}),{}),t?.properties)}}class V8n{constructor(t){this._instance=t,this.re=new Map,this.se=new Map,this.ne=new Map}oe(t,n){return!!t&&Bst(t.propertyFilters,n?.properties)}ae(t,n){var r=new Map;return t.forEach((s=>{var a;(a=s.conditions)==null||(a=a[n])==null||(a=a.values)==null||a.forEach((o=>{if(o!=null&&o.name){var i=r.get(o.name)||[];i.push(s.id),r.set(o.name,i)}}))})),r}le(t,n,r){var s=(r===ik.Activation?this.re:this.se).get(t),a=[];return this.ue((o=>{a=o.filter((i=>s?.includes(i.id)))})),a.filter((o=>{var i,c=(i=o.conditions)==null||(i=i[r])==null||(i=i.values)==null?void 0:i.find((u=>u.name===t));return this.oe(c,n)}))}register(t){var n;$t((n=this._instance)==null?void 0:n._addCaptureHook)||(this.he(t),this.de(t))}de(t){var n=t.filter((r=>{var s,a;return((s=r.conditions)==null?void 0:s.actions)&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0}));n.length!==0&&(this.ve==null&&(this.ve=new U8n(this._instance),this.ve.init(),this.ve.Qi((r=>{this.onAction(r)}))),n.forEach((r=>{var s,a,o,i,c;r.conditions&&(s=r.conditions)!=null&&s.actions&&(a=r.conditions)!=null&&(a=a.actions)!=null&&a.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((i=this.ve)==null||i.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((a=>{var o,i;return((o=a.conditions)==null?void 0:o.events)&&((i=a.conditions)==null||(i=i.events)==null||(i=i.values)==null?void 0:i.length)>0})),s=t.filter((a=>{var o,i;return((o=a.conditions)==null?void 0:o.cancelEvents)&&((i=a.conditions)==null||(i=i.cancelEvents)==null||(i=i.values)==null?void 0:i.length)>0}));(r.length!==0||s.length!==0)&&((n=this._instance)==null||n._addCaptureHook(((a,o)=>{this.onEvent(a,o)})),this.re=this.ae(t,ik.Activation),this.se=this.ae(t,ik.Cancellation))}onEvent(t,n){var r,s=this.ce(),a=this.fe(),o=this.pe(),i=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[a])||[];if(o===t&&n&&i.length>0){var c,u;s.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:i});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=i.indexOf(d);f>=0&&(i.splice(f,1),this._e(i))}}else{if(this.se.has(t)){var p=this.le(t,n,ik.Cancellation);p.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:p.map((g=>g.id))}),p.forEach((g=>{var b=i.indexOf(g.id);b>=0&&i.splice(b,1),this.ge(g.id)})),this._e(i))}if(this.re.has(t)){s.info("event name matched",{event:t,eventPayload:n,items:this.re.get(t)});var h=this.le(t,n,ik.Activation);this._e(i.concat(h.map((g=>g.id))||[]))}}}onAction(t){var n,r=this.fe(),s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ne.has(t)&&this._e(s.concat(this.ne.get(t)||[]))}_e(t){var n,r=this.ce(),s=this.fe(),a=[...new Set(t)].filter((o=>!this.me(o)));r.info("updating activated items",{activatedItems:a}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[s]:a})}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 q8n extends V8n{constructor(t){super(t)}fe(){return"$surveys_activated"}pe(){return Vk.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 Zs}me(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var H8n=Qe!=null&&Qe.location?mM(Qe.location.hash,"__posthog")||mM(location.hash,"state"):null,lje="_postHogToolbarParams",cje=Ha("[Toolbar]"),ug=(function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e})(ug||{}),Hl=Ha("[FeatureFlags]"),pk=Ha("[FeatureFlags]",{debugEnabled:!0}),Q8n="errors_while_computing_flags",G8n="flag_missing",W8n="quota_limited",Z8n="timeout",Y8n="connection_error",X8n="unknown_error",K8n=e=>"api_error_"+e,BQ="$active_feature_flags",b0="$override_feature_flags",uje="$feature_flag_payloads",hk="$override_feature_flag_payloads",dje="$feature_flag_request_id",fje=e=>{var t={};for(var[n,r]of AI(e||{}))r&&(t[n]=r);return t},J8n=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]})))):Hl.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},ezn=(function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e})({}),UQ=Ha("[Error tracking]"),tzn={icontains:(e,t)=>!!Qe&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Qe&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!Qe&&yM(t.href,e),not_regex:(e,t)=>!!Qe&&!yM(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Li{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Li.ye("retrieved web experiments from the server"),n.we=new Map,s.forEach((a=>{if(a.feature_flag_key){var o;n.we&&(Li.ye("setting flag key ",a.feature_flag_key," to web experiment ",a),(o=n.we)==null||o.set(a.feature_flag_key,a));var i=n._instance.getFeatureFlag(a.feature_flag_key);Ao(i)&&a.variants[i]&&n.Ee(a.name,i,a.variants[i].transforms)}else if(a.variants)for(var c in a.variants){var u=a.variants[c];Li.Se(u)&&n.Ee(a.name,c,u.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Li.ye("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Br(this.we))return this.we=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Li.ye("applying feature flags",t),t.forEach((n=>{var r;if(this.we&&(r=this.we)!=null&&r.has(n)){var s,a=this._instance.getFeatureFlag(n),o=(s=this.we)==null?void 0:s.get(n);a&&o!=null&&o.variants[a]&&this.Ee(o.name,a,o.variants[a].transforms)}}))}}previewWebExperiment(){var t=Li.getWindowLocation();if(t!=null&&t.search){var n=hM(t?.search,"__experiment_id"),r=hM(t?.search,"__experiment_variant");n&&r&&(Li.ye("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.xe(parseInt(n),r,s)}),!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 s=this._instance.get_property("$web_experiments");if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:a=>{if(a.statusCode!==200||!a.json)return t([]);var o=a.json.experiments||[];return t(o)}})}xe(t,n,r){var s=r.filter((a=>a.id===t));s&&s.length>0&&(Li.ye("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ee(s[0].name,n,s[0].variants[n].transforms))}static Se(t){return!Br(t.conditions)&&Li.$e(t)&&Li.ke(t)}static $e(t){var n;if(Br(t.conditions)||Br((n=t.conditions)==null?void 0:n.url))return!0;var r,s,a,o=Li.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||tzn[(s=(a=t.conditions)==null?void 0:a.urlMatchType)!==null&&s!==void 0?s:"icontains"](t.conditions.url,o))}static getWindowLocation(){return Qe?.location}static ke(t){var n;if(Br(t.conditions)||Br((n=t.conditions)==null?void 0:n.utm))return!0;var r=Est();if(r.utm_source){var s,a,o,i,c,u,d,f,p=(s=t.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_campaign)==r.utm_campaign,h=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((i=t.conditions)==null||(i=i.utm)==null?void 0:i.utm_source)==r.utm_source,g=(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,b=(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&&g&&b&&h}return!1}static ye(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];zt.info("[WebExperiments] "+t,r)}Ee(t,n,r){this._is_bot()?Li.ye("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((s=>{if(s.selector){var a;Li.ye("applying transform of variant "+n+" for experiment "+t+" ",s);var o=(a=document)==null?void 0:a.querySelectorAll(s.selector);o?.forEach((i=>{var c=i;s.html&&(c.innerHTML=s.html),s.css&&c.setAttribute("style",s.css)}))}})):Li.ye("Control variants leave the page unmodified.")}_is_bot(){return nu&&this._instance?Fst(nu,this._instance.config.custom_blocked_useragents):void 0}}var Uu=Ha("[Conversations]"),h3={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,Hl.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||(Hl.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||Hl.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 s,a,o=(s=(a=n.bootstrap)==null?void 0:a.featureFlagPayloads)!==null&&s!==void 0?s:{},i=Object.keys(r).filter((u=>!!r[u])).reduce(((u,d)=>(u[d]=r[d]||!1,u)),{}),c=Object.keys(o).filter((u=>i[u])).reduce(((u,d)=>(o[d]&&(u[d]=o[d]),u)),{});this.receivedFeatureFlags({featureFlags:i,featureFlagPayloads:c})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},s=n!=null&&n.merge?this.getFlagPayloads():{},a=Nt({},r,e),o=Nt({},s,t),i={};for(var[c,u]of Object.entries(a)){var d=typeof u=="string";i[c]={key:c,enabled:!!d||!!u,variant:d?u:void 0,reason:void 0,metadata:$t(o?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:o[c]}}}this.receivedFeatureFlags({flags:i})}get hasLoadedFlags(){return this.Te}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(DX),t=this._instance.get_property(b0),n=this._instance.get_property(hk);if(!n&&!t)return e||{};var r=bo({},e||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var a of s){var o,i,c=r[a],u=t?.[a],d=$t(u)?(o=c?.enabled)!==null&&o!==void 0&&o:!!u,f=$t(u)?c.variant:typeof u=="string"?u:void 0,p=n?.[a],h=Nt({},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=Nt({},c?.metadata,{payload:p,original_payload:c==null||(i=c.metadata)==null?void 0:i.payload})),r[a]=h}return this.Pe||(Hl.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Pe=!0),r}getFlagVariants(){var e=this._instance.get_property(Y0),t=this._instance.get_property(b0);if(!t)return e||{};for(var n=bo({},e),r=Object.keys(t),s=0;s<r.length;s++)n[r[s]]=t[r[s]];return this.Pe||(Hl.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Pe=!0),n}getFlagPayloads(){var e=this._instance.get_property(uje),t=this._instance.get_property(hk);if(!t)return e||{};for(var n=bo({},e||{}),r=Object.keys(t),s=0;s<r.length;s++)n[r[s]]=t[r[s]];return this.Pe||(Hl.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"),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Nt({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(Uk)||{}),group_properties:this._instance.get_property(_y),timezone:Rst()};Ef(r)||$t(r)||(s.$device_id=r),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.je()&&(s.evaluation_contexts=this.Le());var a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+a);this.Re=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this._instance.config.disable_compression?void 0:Dh.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var c,u,d,f=!0;if(i.statusCode===200&&(this.Ce||(this.$anon_distinct_id=void 0),f=!1),this.Re=!1,!s.disable_flags||this.Ce){this.Oe=!f;var p=[];i.error?i.error instanceof Error?p.push(i.error.name==="AbortError"?Z8n:Y8n):p.push(X8n):i.statusCode!==200&&p.push(K8n(i.statusCode)),(c=i.json)!=null&&c.errorsWhileComputingFlags&&p.push(Q8n);var h=!((u=i.json)==null||(u=u.quotaLimited)==null||!u.includes(ezn.FeatureFlags));if(h&&p.push(W8n),(d=this._instance.persistence)==null||d.register({[zX]:p}),h)Hl.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 g;s.disable_flags||this.receivedFeatureFlags((g=i.json)!==null&&g!==void 0?g:{},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 Hl.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,s=n[e],a=this.getFlagPayloads()[e],o=String(s),i=this._instance.get_property(dje)||void 0,c=this._instance.get_property(cM)||void 0,u=this._instance.get_property(N_)||{};if(this._instance.config.advanced_feature_flags_dedup_per_session){var d,f=this._instance.get_session_id(),p=this._instance.get_property(FX);f&&f!==p&&(u={},(d=this._instance.persistence)==null||d.register({[N_]:u,[FX]:f}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var h,g,b,y,x,w,O,k,E,C;hs(u[e])?u[e].push(o):u[e]=[o],(h=this._instance.persistence)==null||h.register({[N_]:u});var N=this.getFeatureFlagDetails(e),T=[...(g=this._instance.get_property(zX))!==null&&g!==void 0?g:[]];$t(s)&&T.push(G8n);var j={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:a||null,$feature_flag_request_id:i,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((b=this._instance.config.bootstrap)==null||(b=b.featureFlags)==null?void 0:b[e])||null,$feature_flag_bootstrapped_payload:((y=this._instance.config.bootstrap)==null||(y=y.featureFlagPayloads)==null?void 0:y[e])||null,$used_bootstrap_value:!this.Oe};$t(N==null||(x=N.metadata)==null?void 0:x.version)||(j.$feature_flag_version=N.metadata.version);var R,P=(w=N==null||(O=N.reason)==null?void 0:O.description)!==null&&w!==void 0?w:N==null||(k=N.reason)==null?void 0:k.code;P&&(j.$feature_flag_reason=P),N!=null&&(E=N.metadata)!=null&&E.id&&(j.$feature_flag_id=N.metadata.id),$t(N?.original_variant)&&$t(N?.original_enabled)||(j.$feature_flag_original_response=$t(N.original_variant)?N.original_enabled:N.original_variant),N!=null&&(C=N.metadata)!=null&&C.original_payload&&(j.$feature_flag_original_payload=N==null||(R=N.metadata)==null?void 0:R.original_payload),T.length&&(j.$feature_flag_error=T.join(",")),this._instance.capture("$feature_flag_called",j)}if(r){var M=a;if(!$t(a))try{M=JSON.parse(a)}catch{}return{key:e,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:M}}}}else Hl.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:Dh.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var a,o=(a=s.json)==null?void 0:a.featureFlagPayloads;t(o?.[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 $t(n)?void 0:!!n}Hl.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(),s=this.getFlagsWithDetails();(function(a,o,i,c,u){i===void 0&&(i={}),c===void 0&&(c={}),u===void 0&&(u={});var d=J8n(a),f=d.flags,p=d.featureFlags,h=d.featureFlagPayloads;if(p){var g=a.requestId,b=a.evaluatedAt;if(hs(p)){Hl.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var y={};if(p)for(var x=0;x<p.length;x++)y[p[x]]=!0;o&&o.register({[BQ]:p,[Y0]:y})}else{var w=p,O=h,k=f;if(a.errorsWhileComputingFlags)if(f){var E=new Set(Object.keys(f).filter((C=>{var N;return!((N=f[C])!=null&&N.failed)})));w=Nt({},i,Object.fromEntries(Object.entries(w).filter((C=>{var[N]=C;return E.has(N)})))),O=Nt({},c,Object.fromEntries(Object.entries(O||{}).filter((C=>{var[N]=C;return E.has(N)})))),k=Nt({},u,Object.fromEntries(Object.entries(k||{}).filter((C=>{var[N]=C;return E.has(N)}))))}else w=Nt({},i,w),O=Nt({},c,O),k=Nt({},u,k);o&&o.register(Nt({[BQ]:Object.keys(fje(w)),[Y0]:w||{},[uje]:O||{},[DX]:k||{}},g?{[dje]:g}:{},b?{[cM]:b}:{}))}}})(e,this._instance.persistence,n,r,s),t||(this.Me=!1),this.He(t)}}override(e,t){t===void 0&&(t=!1),Hl.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Hl.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(b0),this._instance.persistence.unregister(hk),this.He(),pk.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(b0),pk.info("Flag overrides cleared");else if(n.flags){if(hs(n.flags)){for(var r={},s=0;s<n.flags.length;s++)r[n.flags[s]]=!0;this._instance.persistence.register({[b0]:r})}else this._instance.persistence.register({[b0]:n.flags});pk.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(hk),pk.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[hk]:n.payloads}),pk.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,s=(this._instance.get_property(Bk)||[]).find((c=>c.flagKey===e)),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var i=Nt({},this.getFlagVariants(),{[e]:t});(r=this._instance.persistence)==null||r.register({[BQ]:Object.keys(fje(i)),[Y0]:i}),this.He()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(Bk),s=n?"&"+n.map((a=>"stage="+a)).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+s),method:"GET",callback:a=>{var o,i;if(a.json){var c=a.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(Bk),(i=this._instance.persistence)==null||i.register({[Bk]: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(Uk)||{};this._instance.register({[Uk]:Nt({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Uk)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(_y)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=Nt({},n[r],e[r]),delete e[r]})),this._instance.register({[_y]:Nt({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(_y)||{};this._instance.register({[_y]:Nt({},t,{[e]:{}})})}else this._instance.unregister(_y)}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}}},nzn={sessionRecording:class{get started(){var e;return!((e=this.qe)==null||!e.isStarted)}get status(){var e,t;return this.Ve===fk||this.Ve===zR?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=sje,this.We=void 0,this._instance=e,!this._instance.sessionManager)throw vy.error("started without valid sessionManager"),new Error(KX+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(KX+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ge(){var e,t=!((e=this._instance.get_property(MR))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Qe&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.Ge||(t=this.qe)==null||!t.isStarted){var n=!$t(Object.assign)&&!$t(Array.from);this.Ge&&n?(this.Ye(e),vy.info("starting")):(this.Ve=sje,this.stopRecording())}}Ye(e){var t,n,r;this.Ge&&(this.Ve!==fk&&this.Ve!==zR&&(this.Ve=aje),An!=null&&(t=An.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=An.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Je(e):(r=An.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ke,(s=>{if(s)return vy.error("could not load recorder",s);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(wst)}Ze(e,t){if(Br(e))return null;var n,r=Pp(e)?e:parseFloat(e);return typeof(n=r)=="number"&&Number.isFinite(n)&&n>=0&&n<=1?r:(vy.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,s=()=>{var a,o=e.sessionRecording===!1?void 0:e.sessionRecording,i=this.Ze((a=this._instance.config.session_recording)==null?void 0:a.sampleRate,"session_recording.sampleRate"),c=this.Ze(o?.sampleRate,"remote config sampleRate"),u=i??c;Br(u)&&this.Qe();var d=o?.minimumDurationMilliseconds;r.register({[MR]:Nt({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:Nt({capturePerformance:e.capturePerformance},o?.networkPayloadCapture),canvasRecording:{enabled:o?.recordCanvas,fps:o?.canvasFps,quality:o?.canvasQuality},sampleRate:u,minimumDurationMilliseconds:$t(d)?null:d,endpoint:o?.endpoint,triggerMatchType:o?.triggerMatchType,masking:o?.masking,urlTriggers:o?.urlTriggers})})};s(),(t=this.We)==null||t.call(this),this.We=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.tr(e),void this.Xe()):(this.tr(e),void this.startIfEnabledOrStop()):(this.Ve===fk&&(this.Ve=zR,vy.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):vy.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(MR);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}ir(){var e,t=this._instance.get_property(MR);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=An.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");if(this.qe||(this.qe=(n=An.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.qe._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ir())return this.Ve===zR||this.Ve===fk?void 0:(this.Ve=fk,vy.info("persisted remote config is stale, requesting fresh config before starting"),void new Ist(this._instance).load());this.Ve=aje,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))}}},rzn={autocapture:class{constructor(e){this.er=!1,this.rr=null,this.sr=!1,this.instance=e,this.rageclicks=new eje(e.config.rageclick),this.nr=null}initialize(){this.startIfEnabled()}get N(){var e,t,n=Ho(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(Qe&&It){var e=n=>{n=n||Qe?.event;try{this.lr(n)}catch(r){tje.error("Failed to capture event",r)}};if(Eo(It,"submit",e,{capture:!0}),Eo(It,"change",e,{capture:!0}),Eo(It,"click",e,{capture:!0}),this.N.capture_copied_text){var t=n=>{n=n||Qe?.event,this.lr(n,LQ)};Eo(It,"copy",t,{capture:!0}),Eo(It,"cut",t,{capture:!0})}}}else tje.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({[kAe]:!!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 s=It?.querySelectorAll(r);s?.forEach((a=>{e===a&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[kAe],r=this.rr;if(Ef(r)&&!Zh(n)&&!this.instance.bt())return!1;var s=(t=this.rr)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!s}lr(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=YAe(e);qst(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())&&T8n(r,this.instance.config.rageclick)&&this.lr(e,"$rageclick");var s=t===LQ;if(r&&N8n(r,e,this.N,s,s?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=L8n(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(o)return!1;var i=this.getElementSelectors(r);if(i&&i.length>0&&(a.$element_selectors=i),t===LQ){var c,u=Qst(Qe==null||(c=Qe.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return Bh(It?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ur=(Qe==null||(t=Qe.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(zt.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.hr&&this.hr(),this.hr=void 0,zt.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Qe&&Qe.history){var n=this;(e=Qe.history.pushState)!=null&&e.__posthog_wrapped__||nje(Qe.history,"pushState",(r=>function(s,a,o){r.call(this,s,a,o),n.dr("pushState")})),(t=Qe.history.replaceState)!=null&&t.__posthog_wrapped__||nje(Qe.history,"replaceState",(r=>function(s,a,o){r.call(this,s,a,o),n.dr("replaceState")})),this.vr()}}dr(e){try{var t,n=Qe==null||(t=Qe.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){zt.error("Error capturing "+e+" pageview",r)}}vr(){if(!this.hr){var e=()=>{this.dr("popstate")};Eo(Qe,"popstate",e),this.hr=()=>{Qe&&Qe.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[MX]),this.rageclicks=new eje(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Ho(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 Br(this.instance.config.capture_heatmaps)?Br(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;z8n.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({[MX]: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"})(It)?setInterval(this.Ft.bind(this),this.flushIntervalMilliseconds):null}_r(){Qe&&It&&(this.wr=this.Ft.bind(this),Eo(Qe,"beforeunload",this.wr),this.Er=e=>this.yr(e||Qe?.event),Eo(It,"click",this.Er,{capture:!0}),this.Sr=e=>this.$r(e||Qe?.event),Eo(It,"mousemove",this.Sr,{capture:!0}),this.kr=new RAe(this.instance,GFn,this.br.bind(this)),this.kr.startIfEnabledOrStop(),this.Pr=this.gr.bind(this),Eo(It,"visibilitychange",this.Pr),this.er=!0)}mr(){var e;Qe&&It&&(this.wr&&Qe.removeEventListener("beforeunload",this.wr),this.Er&&It.removeEventListener("click",this.Er,{capture:!0}),this.Sr&&It.removeEventListener("mousemove",this.Sr,{capture:!0}),this.Pr&&It.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(),s=this.instance.scrollManager.scrollElement(),a=(function(o,i,c){for(var u=o;u&&p3(u)&&!Ug(u,"body");){if(u===c)return!1;if(jr(i,Qe?.getComputedStyle(u).position))return!0;u=Wst(u)}return!1})(YAe(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:n),target_fixed:a,type:t}}yr(e,t){var n;if(t===void 0&&(t="click"),!WAe(e.target)&&oje(e)){var r=this.Rr(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Ir(Nt({},r,{type:"rageclick"})),this.Ir(r)}}$r(e){!WAe(e.target)&&oje(e)&&(clearTimeout(this.Tr),this.Tr=setTimeout((()=>{this.Ir(this.Rr(e,"mousemove"))}),500))}Ir(e){if(Qe){var t=Qe.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,s=n?MS([],$S,r||[]):[],a=RC(t,s,IC);this.C=this.C||{},this.C[a]||(this.C[a]=[]),this.C[a].push(e)}}Ft(){this.C&&!Z0(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:RAe,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)=>Nt({},n,{["$web_vitals_"+r.name+"_event"]:Nt({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Fr=n=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if($t(s))ag.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Mr();$t(a)||(Br(n?.name)||Br(n?.value)?ag.error("Invalid metric received",n):this.Ar&&n.value>=this.Ar?ag.error("Ignoring metric with value >= "+this.Ar,n):(this.C.url!==a&&(this.Cr(),this.Or=setTimeout(this.Cr,this.flushToCaptureTimeoutMs)),$t(this.C.url)&&(this.C.url=a),this.C.firstMetricTimestamp=$t(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.C.metrics.push(Nt({},n,{$current_url:a,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Cr()))}},this.Dr=()=>{if(!this.er){var n,r,s,a,o=An.__PosthogExtensions__;$t(o)||$t(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:s,onINP:a}=o.postHogWebVitalsCallbacks),n&&r&&s&&a?(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&&s(this.Fr.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Fr.bind(this)),this.er=!0):ag.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.cr=!((t=this._instance.persistence)==null||!t.props[CAe]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Ho(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return Br(n)?((t=this._instance.persistence)==null?void 0:t.props[NAe])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Ho(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Ho(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Ar(){var e=Ho(this._instance.config.capture_performance)&&Pp(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:rje;return 0<e&&e<=6e4?rje:e}get isEnabled(){var e=xi?.protocol;if(e!=="http:"&&e!=="https:")return ag.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Ho(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Zh(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Zh(t)?t:this.cr}startIfEnabled(){this.isEnabled&&!this.er&&(ag.info("enabled, starting..."),this.G(this.Dr))}onRemoteConfig(e){if("capturePerformance"in e){var t=Ho(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Ho(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[CAe]:t}),this._instance.persistence.register({[NAe]:n})),this.cr=t,this.startIfEnabled()}}G(e){var t,n;if((t=An.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=An.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,(s=>{s?ag.error("failed to load script",s):e()}))}}Mr(){var e=Qe?Qe.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?MS([],$S,n||[]):[];return RC(e,r,IC)}ag.error("Could not determine current URL")}}},szn={exceptionObserver:class{constructor(e){var t,n,r;this.Dr=()=>{var s;if(Qe&&this.isEnabled&&(s=An.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var a=An.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=An.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=An.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Lr&&this.N.capture_unhandled_errors&&(this.Lr=a(this.captureException.bind(this))),!this.jr&&this.N.capture_unhandled_rejections&&(this.jr=o(this.captureException.bind(this))),!this.Nr&&this.N.capture_console_errors&&(this.Nr=i(this.captureException.bind(this)))}catch(c){dk.error("failed to start",c),this.Ur()}}},this._instance=e,this.zr=!((t=this._instance.persistence)==null||!t.props[_Ae]),this.Hr=new tFn({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:dk}),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 Ho(e)?t=Nt({},t,e):($t(e)?this.zr:e)&&(t=Nt({},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?(dk.info("enabled"),this.Ur(),this.G(this.Dr)):this.Ur()}G(e){var t,n;(t=An.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=An.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return dk.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({[_Ae]:this.zr}),this.N=this.Br(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.Br()}captureException(e){var t,n,r,s=(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(s)?dk.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.qr=[],this.Vr=new hFn([new OFn,new RFn,new _Fn,new kFn,new AFn,new NFn,new CFn,new jFn],SFn()),this._instance=e,this.qr=(t=(n=this._instance.persistence)==null?void 0:n.get_property($X))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var s=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],a=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.qr=s,this._instance.persistence&&this._instance.persistence.register({[$X]:this.qr,[EAe]:a})}}get Wr(){var e,t=!!this._instance.get_property(EAe),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 UQ.info("Skipping exception capture because a suppression rule matched");if(!this.Wr&&this.Jr(t))return void UQ.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Kr(t))return void UQ.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:s,value:a}=r;return Ao(s)&&s.length>0&&n.$exception_types.push(s),Ao(a)&&a.length>0&&n.$exception_values.push(a),n}),{$exception_types:[],$exception_values:[]});return this.qr.some((n=>{var r=n.values.map((s=>{var a,o=zst[s.operator],i=hs(s.value)?s.value:[s.value],c=(a=t[s.key])!==null&&a!==void 0?a:[];return i.length>0&&o(i,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,s,a=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],o=a[a.length-1];return(r=o==null||(s=o.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Gr(e){return!Br(e)&&hs(e)}}},azn=Nt({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({[TAe]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Xr||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(TAe)||this.G((()=>this.Zr()))}G(e){var t,n;(t=An.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=An.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?ije.error("Could not load product tours script",r):e()}))}Zr(){var e;!this.Xr&&(e=An.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Xr=An.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!hs(this.Qr)||t){var n=this._instance.persistence;if(n){var r=n.props[zQ];if(hs(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:s=>{var a=s.statusCode;if(a!==200||!s.json){var o="Product Tours API could not be loaded, status: "+a;return ije.error(o),void e([],{isLoaded:!1,error:o})}var i=hs(s.json.product_tours)?s.json.product_tours:[];this.Qr=i,n&&n.register({[zQ]:i}),e(i,{isLoaded:!0})}})}else e(this.Qr,{isLoaded:!0})}getActiveProductTours(e){Br(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(zQ)}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)}}},h3),ozn={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=An._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,s,a,o,i;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:g}=e;return{event:Nt({},Wrt(e,B8n),{properties:Nt({},e.properties,g?{$set:Nt({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},g)}:{},h?{$set_once:Nt({},(r=(s=e.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},h)}:{}),elements_chain:(a=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(i=e.properties)==null?void 0:i.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.ts.length&&(og.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach((i=>t.processEvent==null?void 0:t.processEvent(i))),t.processedBuffer=!0),Object.values(this.apps).every((i=>i.processedBuffer||i.errored))&&((o=this.rs)==null||o.call(this))},r=!1,s=o=>{t.errored=!o,t.loaded=!0,og.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:o=>{s(o)}});a&&(t.processEvent=a),r=!0}catch(o){og.error("Error while initializing PostHog app with config id "+e.id,o),s(!1)}if(r&&t.loaded)try{n()}catch(o){og.error("Error while processing buffered events PostHog app with config id "+e.id,o),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){og.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,s=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",(c=>this.ns(c)))):void og.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 a=function(c){var u;An["__$$ph_site_app_"+c]=s._instance,(u=An.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,i,(d=>{if(d)return og.error("Error while initializing PostHog app with config id "+c,d)}))};for(var{id:o,url:i}of e.siteApps)a(o)}else og.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},izn={tracingHeaders:class{constructor(e){this.os=void 0,this.ls=void 0,this.Dr=()=>{var t,n;$t(this.os)&&((t=An.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),$t(this.ls)&&((n=An.__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=An.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=An.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return F8n.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)}}},lzn=Nt({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(Br(t))return Zs.warn("Flags not loaded yet. Not loading surveys.");var n=hs(t);this.us=n?t.length>0:t,Zs.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(Ust)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.hs)Zs.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Zs.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Zs.info("Not loading surveys in cookieless mode without consent.");else{var e=An?.__PosthogExtensions__;if(e){if(!$t(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",(s=>{s||!e.generateSurveys?this.fs("Could not load surveys script",s):this.cs(e.generateSurveys,t)}))}catch(s){throw this.fs("Error initializing surveys",s),s}finally{this.hs=!1}}}else Zs.error("PostHog Extensions not found.")}}cs(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new q8n(this._instance),Zs.info("Surveys loaded successfully"),this.ps({isLoaded:!0})}fs(e,t){Zs.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 Zs.info("Disabled. Not loading surveys."),e([]);var n,r=this._instance.get_property(LX);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.vs?this.vs.then((s=>{var{surveys:a,context:o}=s;return e(a,o)})):(typeof Promise<"u"&&(this.vs=new Promise((s=>{n=s}))),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:s=>{var a;this.vs=null;var o=s.statusCode;if(o!==200||!s.json){var i="Surveys API could not be loaded, status: "+o;Zs.error(i);var c={isLoaded:!1,error:i};return e([],c),void(n==null||n({surveys:[],context:c}))}var u,d=s.json.surveys||[],f=d.filter((h=>(function(g){return!(!g.start_date||g.end_date)})(h)&&((function(g){var b;return!((b=g.conditions)==null||(b=b.events)==null||(b=b.values)==null||!b.length)})(h)||(function(g){var b;return!((b=g.conditions)==null||(b=b.actions)==null||(b=b.values)==null||!b.length)})(h))));f.length>0&&((u=this._surveyEventReceiver)==null||u.register(f)),(a=this._instance.persistence)==null||a.register({[LX]: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){Zs.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!Br(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Zs.warn("init was not called")}_s(e){var t=null;return this.getSurveys((n=>{var r;t=(r=n.find((s=>s.id===e)))!==null&&r!==void 0?r:null})),t}gs(e){if(Br(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(Br(this._surveyManager))return Zs.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 Br(this._surveyManager)?(Zs.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 s,a=(s=r.find((i=>i.id===e)))!==null&&s!==void 0?s:null;if(a){var o=this.gs(a);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,n){var r;if(Br(this._surveyManager))Zs.warn("init was not called");else{var s=typeof e=="string"?this._s(e):e;if(s!=null&&s.id)if(w8n.includes(s.type)){var a=It?.querySelector(t);if(a)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(Zs.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var o,i;Zs.info("Rendering survey "+s.id+" with delay of "+((o=s.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(i=this._surveyManager)==null||i.renderSurvey(s,a,n),Zs.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,a,n);Zs.warn("Survey element not found")}else Zs.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Zs.warn("Survey not found")}}displaySurvey(e,t){var n;if(Br(this._surveyManager))Zs.warn("init was not called");else{var r=this._s(e);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=Nt({},r,{appearance:Nt({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==HX.Popover&&t.initialResponses&&Zs.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void Zs.warn("Survey is not eligible to be displayed: ",a.disabledReason)}t.displayType!==HX.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else Zs.warn("Survey not found")}}cancelPendingSurvey(e){Br(this._surveyManager)?Zs.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},h3),czn={toolbar:class{constructor(e){this.instance=e}bs(e){An.ph_toolbar_state=e}ys(){var e;return(e=An.ph_toolbar_state)!==null&&e!==void 0?e:ug.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),yst(this.instance.config)||!Qe||!It)return!1;e=e??Qe.location,n=n??Qe.history;try{if(!t){try{Qe.localStorage.setItem("test","test"),Qe.localStorage.removeItem("test")}catch{return!1}t=Qe?.localStorage}var r,s=H8n||mM(e.hash,"__posthog")||mM(e.hash,"state"),a=s?OAe((()=>JSON.parse(atob(decodeURIComponent(s)))))||OAe((()=>JSON.parse(decodeURIComponent(s)))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(lje)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}ws(e){var t=An.ph_load_toolbar||An.ph_load_editor;!Br(t)&&Bh(t)?t(e,this.instance):cje.warn("No toolbar load function found")}loadToolbar(e){var t=!(It==null||!It.getElementById(Sst));if(!Qe||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Nt({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Qe.localStorage.setItem(lje,JSON.stringify(Nt({},r,{source:void 0}))),this.ys()===ug.LOADED)this.ws(r);else if(this.ys()===ug.UNINITIALIZED){var s;this.bs(ug.LOADING),(s=An.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(a=>{if(a)return cje.error("[Toolbar] Failed to load",a),void this.bs(ug.UNINITIALIZED);this.bs(ug.LOADED),this.ws(r)})),Eo(Qe,"turbolinks:load",(()=>{this.bs(ug.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)}}},uzn=Nt({experiments:Li},h3),dzn={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;Br(t)||(Zh(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||yst(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=An?.__PosthogExtensions__;if(e&&!$t(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 Uu.error("Conversations enabled but missing token in remote config.")}}ks(e){if(this.$s)try{this._conversationsManager=e(this.$s,this._instance),Uu.info("Conversations loaded successfully")}catch(t){this.Ps("Error completing conversations initialization",t)}else Uu.error("Cannot complete initialization: remote config is null")}Ps(e,t){Uu.error(e,t),this._conversationsManager=null,this.xs=!1}show(){this._conversationsManager?this._conversationsManager.show():Uu.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ss===!0&&!Ef(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 jh((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(Uu.warn("Conversations not available yet."),null)}))()}getMessages(e,t){var n=this;return jh((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(Uu.warn("Conversations not available yet."),null)}))()}markAsRead(e){var t=this;return jh((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Uu.warn("Conversations not available yet."),null)}))()}getTickets(e){var t=this;return jh((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Uu.warn("Conversations not available yet."),null)}))()}requestRestoreLink(e){var t=this;return jh((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Uu.warn("Conversations not available yet."),null)}))()}restoreFromToken(e){var t=this;return jh((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Uu.warn("Conversations not available yet."),null)}))()}restoreFromUrlToken(){var e=this;return jh((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Uu.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}}},fzn={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;!Br(n)&&n&&(this.Ts=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ts&&!this.Rs){var e=Ha("[logs]"),t=An?.__PosthogExtensions__;if(t){var n=t.loadExternalDependency;n?n(this._instance,"logs",(r=>{var s;r||(s=t.logs)==null||!s.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.")}}}},pzn=Nt({},h3,nzn,rzn,szn,azn,ozn,lzn,izn,czn,uzn,dzn,fzn);op.__defaultExtensionClasses=Nt({},pzn);var pje,Lh=(pje=j_[j0]=new op,(function(){function e(){e.done||(e.done=!0,Vst=!1,fa(j_,(function(t){t._dom_loaded()})))}It!=null&&It.addEventListener?It.readyState==="complete"?e():Eo(It,"DOMContentLoaded",e,{capture:!1}):Qe&&zt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),pje),tat=S.createContext({client:Lh,bootstrap:void 0});function nat(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),s=Object.keys(t);if(r.length!==s.length)return!1;for(var a=0,o=r;a<o.length;a++){var i=o[a];if(!s.includes(i)||!nat(e[i],t[i],n))return!1}return!0}function hzn(e){var t,n,r=e.children,s=e.client,a=e.apiKey,o=e.options,i=S.useRef(null),c=S.useMemo(function(){return s?(a&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s):(a||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."),Lh)},[s,a,JSON.stringify(o)]);return S.useEffect(function(){if(!s){var u=i.current;u?(a!==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."),o&&!nat(o,u.options)&&Lh.set_config(o),i.current={apiKey:a,options:o??{}}):(Lh.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),Lh.init(a,o),i.current={apiKey:a,options:o??{}})}},[s,a,JSON.stringify(o)]),be.createElement(tat.Provider,{value:{client:c,bootstrap:(t=o?.bootstrap)!==null&&t!==void 0?t:(n=s?.config)===null||n===void 0?void 0:n.bootstrap}},r)}var VQ=function(e){return typeof e=="function"},JX=function(e,t){return JX=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},JX(e,t)};function mzn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");JX(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var gzn={componentStack:null,exceptionEvent:null,error:null},bzn={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){mzn(t,e);function t(n){var r=e.call(this,n)||this;return r.state=gzn,r}return t.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,a;VQ(s)?a=s(n):typeof s=="object"&&(a=s);var o=this.context.client,i=o.captureException(n,a),c=r.componentStack;this.setState({error:n,componentStack:c??null,exceptionEvent:i})},t.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,a=this.state;if(a.componentStack==null)return VQ(r)?r():r;var o=VQ(s)?be.createElement(s,{error:a.error,componentStack:a.componentStack,exceptionEvent:a.exceptionEvent}):s;return be.isValidElement(o)?o:(console.warn(bzn.INVALID_FALLBACK),be.createElement(be.Fragment,null))},t.contextType=tat,t})(be.Component);function yzn({children:e}){return S.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}Lh.init("phc_SBLpZVAB6jmHOct9CABq3PF0Yn5FU3G2FgT4xUr2XrT",{api_host:"https://us.posthog.com"}),Lh.register({mastraSource:"playground"})},[]),l.jsx(hzn,{client:Lh,children:e})}const vzn=["/swagger-ui","/openapi.json"],rat=S.forwardRef(({children:e,href:t,...n},r)=>t&&vzn.some(a=>t.startsWith(a))?l.jsx("a",{ref:r,href:t,...n,children:e}):l.jsx(At,{ref:r,to:t,viewTransition:!0,...n,children:e}));function xzn(){const{Link:e,navigate:t}=Lt(),{data:n={},isLoading:r,error:s}=_f(),{isCmsAvailable:a}=Db(),{canEdit:o}=kf(),i=a&&o("stored-agents"),c=()=>{t("/cms/agents/create")};return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(so,{})}),"Agents"]}),l.jsxs(gs,{children:[i&&l.jsxs(he,{as:e,to:"/cms/agents/create",children:[l.jsx(BD,{}),"Create an agent"]}),l.jsxs(he,{variant:"ghost",size:"md",as:e,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",children:[l.jsx(_a,{}),"Agents documentation"]})]})]}),l.jsx(Va,{isCentered:!r&&Object.keys(n||{}).length===0,children:l.jsx(WRn,{agents:n,isLoading:r,error:s,onCreateClick:i?c:void 0})})]})}function wzn({agentId:e,threadId:t,threads:n,isLoading:r}){const{mutateAsync:s}=Wjn(),{paths:a,navigate:o}=Lt(),i=async c=>{await s({threadId:c,agentId:e}),c===t&&o(a.agentNewThreadLink(e))};return l.jsx(cPn,{resourceId:e,resourceType:"agent",threads:n||[],isLoading:r,threadId:t,onDelete:i})}function hje(){const{agentId:e,threadId:t}=va(),[n]=Pi(),{data:r,isLoading:s,error:a}=Yp(e),{data:o}=T1(e),i=Ml(),c=t==="new",u=S.useMemo(()=>yo(),[t]),d=!!o?.result,{data:f,isLoading:p,refetch:h}=Aet({agentId:e,isMemoryEnabled:d,resourceId:e});S.useEffect(()=>{t||i(`/agents/${e}/chat/new`)},[t,e,i]);const g=n.get("messageId")??void 0,b=S.useMemo(()=>{if(!r)return{modelSettings:{}};const w=r.defaultOptions,{maxOutputTokens:O,...k}=w?.modelSettings??{};return{modelSettings:{...k,...O!==void 0&&{maxTokens:O},...w?.maxSteps!==void 0&&{maxSteps:w.maxSteps},...w?.providerOptions!==void 0&&{providerOptions:w.providerOptions}}}},[r]);if(a&&ba(a))return l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"agents"})});if(s)return null;if(!r)return l.jsx("div",{className:"text-center py-4",children:"Agent not found"});if(!t)return null;const y=c?u:t,x=async()=>{await h(),c&&i(`/agents/${e}/chat/${u}`)};return l.jsx(poe,{entityId:e,entityType:"agent",children:l.jsx(koe,{agentId:e,defaultSettings:b,children:l.jsx(bN,{children:l.jsx(wet,{agentId:e,threadId:y,resourceId:e,children:l.jsx(bet,{children:l.jsx(Eet,{children:l.jsx(ret,{children:l.jsx(IPn,{agentId:e,leftSlot:d&&l.jsx(wzn,{agentId:e,threadId:y,threads:f||[],isLoading:p}),rightSlot:l.jsx(APn,{agentId:e,threadId:y}),children:l.jsx(Eoe,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,threadId:y,memory:d,refreshThreadList:x,modelList:r?.modelList,messageId:g,isNewThread:c},y)})},`${e}-${y}`)})})})})})})}const BR="__custom__",Szn=()=>{const e=XJe(),{requestContext:t,setRequestContext:n}=Or(),r=S.useMemo(()=>{if(!e)return BR;const a=JSON.stringify(t??{});for(const[o,i]of Object.entries(e))if(JSON.stringify(i)===a)return o;return BR},[e,t]),s=a=>{if(a===BR){n({});return}if(!e)return;const o=e[a];o&&n(o)};return l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(zg,{className:"h-5 w-8 shrink-0"}),"Mastra Studio",l.jsx(lX,{})]}),e&&Object.keys(e).length>0&&l.jsx(gs,{children:l.jsxs(Ca,{value:r,onValueChange:s,children:[l.jsx(pa,{size:"sm",className:"w-[200px]",children:l.jsx(Ta,{placeholder:"Select a preset..."})}),l.jsxs(ha,{children:[l.jsx(Pr,{value:BR,children:"Custom"}),Object.keys(e).map(a=>l.jsx(Pr,{value:a,children:a},a))]})]})})]})};function mje(){const{agentId:e,threadId:t}=va(),[n]=Pi(),{data:r,isLoading:s}=Yp(e),{data:a}=T1(e),o=Ml(),i=t==="new",c=S.useMemo(()=>yo(),[t]),u=!!a?.result,{refetch:d}=Aet({resourceId:e,agentId:e,isMemoryEnabled:u});S.useEffect(()=>{u&&(t||o(`/agents/${e}/session/new`))},[u,t,e,o]);const f=n.get("messageId")??void 0,p=S.useMemo(()=>{if(!r)return{modelSettings:{}};const b=r.defaultOptions,{maxOutputTokens:y,...x}=b?.modelSettings??{};return{modelSettings:{...x,...y!==void 0&&{maxTokens:y},...b?.maxSteps!==void 0&&{maxSteps:b.maxSteps},...b?.providerOptions!==void 0&&{providerOptions:b.providerOptions}}}},[r]);if(s)return null;if(!r)return l.jsx("div",{className:"text-center py-4",children:"Agent not found"});const h=i?c:t??c,g=async()=>{await d(),i&&o(`/agents/${e}/session/${c}`)};return l.jsx(poe,{entityId:e,entityType:"agent",children:l.jsx(koe,{agentId:e,defaultSettings:p,children:l.jsx(bN,{children:l.jsx(wet,{agentId:e,threadId:h,resourceId:e,children:l.jsx(bet,{children:l.jsx(Eet,{children:l.jsx(ret,{children:l.jsxs(on,{children:[l.jsx(Szn,{}),l.jsx("div",{className:"grid overflow-y-auto relative bg-surface1 h-full pt-6",children:l.jsx(Eoe,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,threadId:h,memory:u,refreshThreadList:g,modelList:r?.modelList,messageId:f,isNewThread:i,hideModelSwitcher:!0},h)})]})})})})})})})})}function Ozn(){const{agentId:e}=va(),[t,n]=S.useState(null),{data:r,isLoading:s,error:a}=Yp(e),{data:o,isLoading:i}=ytt(e,{status:"draft"}),{data:c}=T1(e),u=r?.source==="code",d=s||i,f=!!c?.result,{data:p}=vtt({agentId:e??"",versionId:t??""}),{data:h}=J4({agentId:e??"",params:{sortDirection:"DESC"}}),g=o?.activeVersionId,b=h?.versions?.[0],y=!!(b&&b.id!==g),x=!!t&&!!p,w=x&&t!==b?.id,O=S.useMemo(()=>x&&p?p:o||(r?Tnt(r):{}),[x,p,o,r]),{form:k,handlePublish:E,handleSaveDraft:C,isSubmitting:N,isSavingDraft:T,isDirty:j}=$oe({mode:"edit",agentId:e??"",dataSource:O,isCodeAgentOverride:u,hasStoredOverride:u&&!!o,onSuccess:()=>{}}),R=S.useCallback(P=>{P===b?.id?n(null):n(P)},[b?.id]);return a&&ba(a)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"agents"})}):d?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(jn,{className:"h-6 w-6"})}):r?l.jsx(bN,{children:l.jsx(Net,{form:k,mode:"edit",agentId:e,isSubmitting:N,isSavingDraft:T,handlePublish:E,handleSaveDraft:C,isCodeAgentOverride:u,readOnly:w,children:l.jsx(E$n,{agentId:e,agentName:r?.name,modelVersion:r?.modelVersion,hasMemory:f,activeVersionId:g,selectedVersionId:t??void 0,latestVersionId:b?.id,requestContextSchema:r?.requestContextSchema,onVersionSelect:R,isDirty:j,isSavingDraft:T,isPublishing:N,hasDraft:y,readOnly:w,onSaveDraft:C,onPublish:E})})}):l.jsx("div",{className:"text-center py-4",children:"Agent not found"})}function kzn(){const{agentId:e}=va();return l.jsx(rDn,{agentId:e})}function _zn(){return l.jsx(rMn,{})}function Ezn(){const{navigate:e,paths:t}=Lt(),n=Pl(),{form:r,handlePublish:s,isSubmitting:a,canPublish:o}=$oe({mode:"create",onSuccess:i=>e(t.agentLink(i))});return l.jsxs(on,{children:[l.jsxs(_n,{className:"bg-surface1",children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(so,{})}),"Create an agent"]}),l.jsx(gs,{children:l.jsx(he,{variant:"primary",onClick:s,disabled:a||!o,className:"w-full",children:a?l.jsxs(l.Fragment,{children:[l.jsx(jn,{className:"h-4 w-4"}),"Creating..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Oe,{children:l.jsx(HUe,{})}),"Create agent"]})})})]}),l.jsx(Nnt,{form:r,mode:"create",isSubmitting:a,handlePublish:s,basePath:"/cms/agents/create",currentPath:n.pathname,children:l.jsx(jS,{})})]})}function gje({agentId:e,selectedVersionId:t,versionData:n,readOnly:r=!1,form:s,handlePublish:a,handleSaveDraft:o,isSubmitting:i,isSavingDraft:c,onVersionSelect:u,activeVersionId:d,latestVersionId:f,hideVersionPanel:p=!1,isCodeAgentOverride:h=!1}){const[,g]=Pi(),b=Pl(),w=!!t&&!!n&&t!==f?l.jsxs(Kd,{variant:"info",className:"mb-4",children:[l.jsx(Jd,{children:"This is a previous version"}),l.jsx(db,{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:()=>g({}),children:"View latest version"})})]}):void 0,O=p?void 0:l.jsx(n$n,{agentId:e,selectedVersionId:t??void 0,onVersionSelect:u,activeVersionId:d});return l.jsx(Nnt,{form:s,mode:"edit",agentId:e,isSubmitting:i,isSavingDraft:c,handlePublish:a,handleSaveDraft:o,readOnly:r,isCodeAgentOverride:h,basePath:`/cms/agents/${e}/edit`,currentPath:b.pathname,banner:w,versionId:t??void 0,rightPanel:O,children:l.jsx(jS,{})})}function Czn(){const{agentId:e}=va(),{navigate:t,paths:n}=Lt(),r=Ml(),s=Pl(),[a,o]=Pi(),i=a.get("versionId"),{data:c,isLoading:u}=Yp(e),{data:d,isLoading:f}=ytt(e,{status:"draft"}),p=c?.source==="code",h=d??null,g=u||f,b=`/cms/agents/${e}/edit`,y=s.pathname===b||s.pathname===`${b}/`;S.useEffect(()=>{p&&y&&r(`${b}/instruction-blocks${s.search}${s.hash}`,{replace:!0})},[p,y,r,b,s.search,s.hash]);const{data:x}=vtt({agentId:e??"",versionId:i??""}),{data:w}=J4({agentId:e??"",params:{sortDirection:"DESC"}}),O=h?.activeVersionId,k=w?.versions?.[0],E=!!(k&&k.id!==O),C=!!i&&!!x,N=S.useMemo(()=>C&&x?x:h||(c?Tnt(c):{}),[C,x,h,c]),T=h?.name??c?.name,{form:j,handlePublish:R,handleSaveDraft:P,isSubmitting:M,isSavingDraft:U,isDirty:D}=$oe({mode:"edit",agentId:e??"",dataSource:N,isCodeAgentOverride:p,hasStoredOverride:p&&!!d,onSuccess:H=>t(n.agentLink(H))}),q=S.useCallback(H=>{o(H?{versionId:H}:{})},[o]),V=!g&&!h&&!c,B=!g&&!!e&&(!!h||!!c);return l.jsxs(on,{children:[l.jsxs(_n,{className:"bg-surface1",children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(so,{})}),g&&l.jsx(On,{className:"h-6 w-[200px]"}),V&&"Agent not found",B&&`Edit agent: ${T}`,B&&E&&l.jsx(ut,{variant:"info",children:"Unpublished changes"})]}),B&&l.jsxs(gs,{children:[l.jsx(he,{onClick:P,disabled:!D||U||M,children:U?l.jsxs(l.Fragment,{children:[l.jsx(jn,{className:"h-4 w-4"}),"Saving..."]}):l.jsxs(l.Fragment,{children:[l.jsx(fGt,{}),"Save"]})}),l.jsx(he,{variant:"primary",onClick:R,disabled:!E&&!D||M||U,children:M?l.jsxs(l.Fragment,{children:[l.jsx(jn,{className:"h-4 w-4"}),"Publishing..."]}):l.jsxs(l.Fragment,{children:[l.jsx(HUe,{}),"Publish"]})})]})]}),V?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(gje,{agentId:e??"",selectedVersionId:i,versionData:x,readOnly:!0,form:j,handlePublish:R,handleSaveDraft:P,isSubmitting:M,isSavingDraft:U,onVersionSelect:q,activeVersionId:O,latestVersionId:k?.id})})]}):l.jsx(gje,{agentId:e??"",selectedVersionId:i,versionData:x,form:j,handlePublish:R,handleSaveDraft:P,isSubmitting:M,isSavingDraft:U,onVersionSelect:q,activeVersionId:O,latestVersionId:k?.id,hideVersionPanel:p&&!d,isCodeAgentOverride:p})]})}function Tzn(){return l.jsx(z2n,{})}function Nzn(){return l.jsx(ent,{})}function Azn(){return l.jsx(iMn,{})}function jzn(){return l.jsx(sMn,{})}function Rzn(){return l.jsx(HMn,{})}function Izn(){return l.jsx(rnt,{})}function Pzn(){return l.jsx(mMn,{})}function Mzn(){return l.jsx(oMn,{})}function $zn(){const{navigate:e,paths:t}=Lt();return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(d_,{})}),"Create a prompt block"]})}),l.jsx(e2n,{onSuccess:n=>e(t.cmsPromptBlockEditLink(n.id))})]})}function bje(e){return{name:e.name,description:e.description||void 0,content:e.content,rules:e.rules||void 0,requestContextSchema:e.variables||void 0}}function Dzn({block:e,blockId:t,selectedVersionId:n,hasDraft:r}){const s=Xe(),a=Ds(),{navigate:o,paths:i}=Lt(),{updateStoredPromptBlock:c}=Dtt(t),[u,d]=S.useState(!1),[f,p]=S.useState(!1),{data:h}=o2n({blockId:t,versionId:n??""}),g=!!n&&!!h,b=g?h:e,y=S.useMemo(()=>({name:b.name||"",description:b.description||"",content:b.content||"",rules:b.rules,variables:b.requestContextSchema}),[b]),{form:x}=Ptt({initialValues:y}),[w,O]=S.useState(0);S.useEffect(()=>{y&&!x.formState.isDirty&&(x.reset(y),O(C=>C+1))},[y,x]);const k=S.useCallback(async()=>{if(!await x.trigger()){qe.error("Please fill in all required fields");return}p(!0);try{const N=bje(x.getValues());await c.mutateAsync(N),x.reset(x.getValues()),qe.success("Draft saved")}catch(N){qe.error(`Failed to save draft: ${N instanceof Error?N.message:"Unknown error"}`)}finally{p(!1)}},[x,c]),E=S.useCallback(async()=>{if(!await x.trigger()){qe.error("Please fill in all required fields");return}d(!0);try{const N=bje(x.getValues());await c.mutateAsync(N);const j=(await s.getStoredPromptBlock(t).listVersions({sortDirection:"DESC",perPage:1})).versions[0];if(!j)throw new Error("No version found to publish");await s.getStoredPromptBlock(t).activateVersion(j.id),a.invalidateQueries({queryKey:["stored-prompt-blocks"]}),a.invalidateQueries({queryKey:["stored-prompt-block"]}),a.invalidateQueries({queryKey:["prompt-block-versions",t]}),qe.success("Prompt block published"),o(i.promptBlocksLink())}catch(N){qe.error(`Failed to publish: ${N instanceof Error?N.message:"Unknown error"}`)}finally{d(!1)}},[x,c,s,t,o,i,a]);return l.jsxs(hb,{leftSlot:l.jsx(Rtt,{form:x,onPublish:E,onSaveDraft:k,isSubmitting:u,isSavingDraft:f,isDirty:x.formState.isDirty,hasDraft:r,formResetKey:w,mode:"edit"}),children:[g&&l.jsxs(Kd,{variant:"info",className:"m-4 mb-0",children:[l.jsx(Jd,{children:"This is a previous version"}),l.jsx(db,{as:"p",children:"You are seeing a specific version of the prompt block."})]}),l.jsx("form",{className:"h-full",children:l.jsx(Itt,{form:x})})]})}function Lzn(){const{promptBlockId:e}=va(),[t,n]=Pi(),r=t.get("versionId"),{data:s,isLoading:a}=$tt(e,{status:"draft"}),{data:o}=Ltt({blockId:e??"",params:{sortDirection:"DESC"}}),i=s?.activeVersionId,c=o?.versions?.[0],u=!!(c&&(!i||c.id!==i)),d=S.useCallback(f=>{n(f?{versionId:f}:{})},[n]);return a?l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(d_,{})}),l.jsx(On,{className:"h-6 w-[200px]"})]})}),l.jsx(hb,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(jn,{className:"h-8 w-8"})}),children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(jn,{className:"h-8 w-8"})})})]}):!s||!e?l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(d_,{})}),"Prompt block not found"]})}),l.jsx(hb,{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(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(d_,{})}),"Edit prompt block: ",s.name,u&&l.jsx(ut,{variant:"info",children:"Unpublished changes"})]}),l.jsx(gs,{children:l.jsx(l2n,{blockId:e,value:r??"",onValueChange:d,activeVersionId:i})})]}),l.jsx(Dzn,{block:s,blockId:e,selectedVersionId:r,hasDraft:u})]})}function Fzn(){const{navigate:e,paths:t}=Lt();return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Gh,{})}),"Create a scorer"]})}),l.jsx(MIn,{onSuccess:n=>e(t.scorerLink(n.id))})]})}function yje(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 zzn({scorer:e,scorerId:t,selectedVersionId:n}){const r=Xe(),s=Ds(),{navigate:a,paths:o}=Lt(),{updateStoredScorer:i}=Jet(t),[c,u]=S.useState(!1),[d,f]=S.useState(!1),p=S.useRef(null),{data:h}=DIn({scorerId:t,versionId:n??""}),g=!!n&&!!h,b=g?h:e,y=S.useMemo(()=>({name:b.name||"",description:b.description||"",type:"llm-judge",model:{provider:b.model?.provider||"",name:b.model?.name||""},instructions:b.instructions||"",scoreRange:{min:b.scoreRange?.min??0,max:b.scoreRange?.max??1},defaultSampling:b.defaultSampling}),[b]),{form:x}=Ket({initialValues:y});S.useEffect(()=>{y&&x.reset(y)},[y,x]);const w=S.useCallback(async()=>{if(!await x.trigger()){qe.error("Please fill in all required fields");return}f(!0);try{const E=yje(x.getValues());await i.mutateAsync(E),qe.success("Draft saved")}catch(E){qe.error(`Failed to save draft: ${E instanceof Error?E.message:"Unknown error"}`)}finally{f(!1)}},[x,i]),O=S.useCallback(async()=>{if(!await x.trigger()){qe.error("Please fill in all required fields");return}u(!0);try{const E=yje(x.getValues());await i.mutateAsync(E);const N=(await r.getStoredScorer(t).listVersions({sortDirection:"DESC",perPage:1})).versions[0];N&&await r.getStoredScorer(t).activateVersion(N.id),s.invalidateQueries({queryKey:["scorers"]}),s.invalidateQueries({queryKey:["stored-scorers"]}),qe.success("Scorer published"),a(o.scorerLink(t))}catch(E){qe.error(`Failed to publish scorer: ${E instanceof Error?E.message:"Unknown error"}`)}finally{u(!1)}},[x,i,r,t,a,o,s]);return l.jsxs(hb,{leftSlot:l.jsx(Yet,{form:x,onPublish:O,onSaveDraft:w,isSubmitting:c,isSavingDraft:d,formRef:p,mode:"edit"}),children:[g&&l.jsxs(Kd,{variant:"info",className:"m-4 mb-0",children:[l.jsx(Jd,{children:"This is a previous version"}),l.jsx(db,{as:"p",children:"You are seeing a specific version of the scorer."})]}),l.jsx("form",{ref:p,className:"h-full",children:l.jsx(Xet,{form:x})})]})}function Bzn(){const{scorerId:e}=va(),[t,n]=Pi(),r=t.get("versionId"),{data:s,isLoading:a}=PIn(e,{status:"draft"}),{data:o}=ett({scorerId:e??"",params:{sortDirection:"DESC"}}),i=s?.activeVersionId,c=o?.versions?.[0],u=!!(c&&i&&c.id!==i),d=S.useCallback(f=>{n(f?{versionId:f}:{})},[n]);return a?l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Gh,{})}),l.jsx(On,{className:"h-6 w-[200px]"})]})}),l.jsx(hb,{leftSlot:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(jn,{className:"h-8 w-8"})}),children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(jn,{className:"h-8 w-8"})})})]}):!s||!e?l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Gh,{})}),"Scorer not found"]})}),l.jsx(hb,{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(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Gh,{})}),"Edit scorer: ",s.name,u&&l.jsx(ut,{variant:"info",children:"Unpublished changes"})]}),l.jsx(gs,{children:l.jsx(FIn,{scorerId:e,value:r??"",onValueChange:d,variant:"outline",activeVersionId:i})})]}),l.jsx(zzn,{scorer:s,scorerId:e,selectedVersionId:r})]})}function Uzn(){const{Link:e}=Lt(),[t,n]=S.useState(!1),{navigate:r,paths:s}=Lt(),{data:a,isLoading:o,error:i}=bx(),c=a?.datasets??[],u=d=>{n(!1),r(s.datasetLink(d))};return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsxs(gs,{children:[l.jsxs(he,{variant:"light",onClick:()=>n(!0),children:[l.jsx(Oe,{children:l.jsx(BD,{})}),"Create Dataset"]}),l.jsxs(he,{as:e,to:"https://mastra.ai/reference/datasets/dataset",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Datasets documentation"]})]})]}),l.jsx(Va,{isCentered:!o&&c.length===0,children:l.jsx(o4n,{datasets:c,isLoading:o,error:i,onCreateClick:()=>n(!0)})}),l.jsx(v4n,{open:t,onOpenChange:n,onSuccess:u})]})}function Vzn(){const{datasetId:e}=va(),t=Ml(),[n,r]=S.useState(!1),[s,a]=S.useState(!1),[o,i]=S.useState(!1),[c,u]=S.useState(!1),[d,f]=S.useState(null),{data:p,error:h}=wm(e??"");if(!e)return l.jsx(on,{children:l.jsx(Va,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Dataset not found"})})});if(h&&ba(h))return l.jsx(on,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"datasets"})})});const g=x=>{t(`/datasets/${e}/experiments/${x}`)},b=()=>{t("/datasets")},y=x=>{f(x?.version??null)};return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(jnt,{value:e,variant:"ghost"})})]})}),l.jsxs(Va,{className:"content-stretch",children:[l.jsx(M3n,{datasetId:e,onAddItemClick:()=>a(!0),onEditClick:()=>i(!0),onDeleteClick:()=>u(!0),activeDatasetVersion:d,onVersionSelect:y,experimentTriggerSlot:l.jsxs(he,{variant:"primary",onClick:()=>r(!0),children:[l.jsx(cGt,{}),d!=null?`Run on v${d}`:"Run Experiment"]})}),l.jsx(z3n,{datasetId:e,version:d??void 0,open:n,onOpenChange:r,onSuccess:g}),l.jsx(D3n,{datasetId:e,open:s,onOpenChange:a}),p&&l.jsx(O4n,{open:o,onOpenChange:i,dataset:{id:p.id,name:p.name,description:p?.description||"",inputSchema:p.inputSchema,groundTruthSchema:p.groundTruthSchema}}),p&&l.jsx(k4n,{open:c,onOpenChange:u,datasetId:p.id,datasetName:p.name,onSuccess:b})]})]})}function qzn(){const{datasetId:e,experimentId:t}=va(),{data:n}=wm(e??""),{data:r,isLoading:s,error:a}=gX(e,t),{data:o,isLoading:i,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d}=Int({datasetId:e,experimentId:t,experimentStatus:r?.status});return!e||!t?null:s?l.jsx(on,{children:l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(jn,{})})}):a&&ba(a)?l.jsx(on,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"datasets"})})}):a||!r?l.jsx(on,{children:l.jsxs("div",{className:"text-red-500 p-4",children:["Error loading experiment: ",a instanceof Error?a.message:"Unknown error"]})}):l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{as:At,to:`/datasets/${e}`,children:n?.name}),l.jsx(bn,{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(i5n,{experimentId:t,experiment:r}),l.jsx(s5n,{experimentId:t,experimentStatus:r?.status,results:o??[],isLoading:i,setEndOfListElement:c,isFetchingNextPage:u,hasNextPage:d})]})})]})}function Hzn(){const{datasetId:e}=va(),[t,n]=Pi(),{data:r,error:s}=wm(e??""),a=t.get("baseline")??"",o=t.get("contender")??"";return s&&ba(s)?l.jsx(on,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"datasets"})})}):!e||!a||!o?l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsxs(bn,{isCurrent:!0,as:"span",children:[l.jsx(Oe,{children:l.jsx(p_,{})}),"Compare Experiments"]})]})}),l.jsx(Va,{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(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{as:At,to:`/datasets/${e}`,children:r?.name??e?.slice(0,8)}),l.jsxs(bn,{isCurrent:!0,as:"span",children:[l.jsx(Oe,{children:l.jsx(p_,{})}),"Experiments Comparison"]})]})}),l.jsx(Va,{children:l.jsxs("div",{className:"max-w-[100rem] w-full px-12 mx-auto grid content-start ",children:[l.jsxs(kn,{children:[l.jsxs(kn.Column,{children:[l.jsxs(kn.Title,{children:[l.jsx(p_,{})," Dataset Experiments Comparison"]}),l.jsxs(kn.Description,{children:["Comparing"," ",l.jsx(At,{to:`/datasets/${e}/experiments/${a}`,children:a.slice(0,8)})," vs"," ",l.jsx(At,{to:`/datasets/${e}/experiments/${o}`,children:o.slice(0,8)})]})]}),l.jsx(kn.Column,{children:l.jsxs(he,{as:At,to:`/datasets/${e}`,children:[l.jsx(sS,{}),"Back to Dataset"]})})]}),l.jsx(d5n,{datasetId:e,experimentIdA:a,experimentIdB:o,onSwap:()=>{n({baseline:o,contender:a})}})]})})]})}function Qzn(){const{datasetId:e,itemId:t}=va(),{Link:n}=Lt(),r=Ml(),{data:s,isLoading:a,error:o}=Loe(e??"",t??""),{updateItem:i,deleteItem:c}=Ii(),{data:u}=wm(e??""),d=s?.[0]??null,f=d?.isDeleted??!1,[p,h]=S.useState(null),g=S.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]),b=d?.datasetVersion??0,[y,x]=S.useState(!1),[w,O]=S.useState(g.input),[k,E]=S.useState(g.groundTruth),[C,N]=S.useState(g.metadata),[T,j]=S.useState(b);b!==T&&(j(b),O(g.input),E(g.groundTruth),N(g.metadata));const[R,P]=S.useState(!1),M=z=>{h(f?z:z.isLatest?null:z)},U=()=>{h(null)},D=!f&&p!=null,q=()=>{D||x(!0)},V=()=>{D||P(!0)},B=async()=>{if(!e||!t)return;let z;try{z=JSON.parse(w)}catch{qe.error("Input must be valid JSON");return}let I;if(k.trim())try{I=JSON.parse(k)}catch{qe.error("Ground Truth must be valid JSON");return}let Q;if(C.trim())try{Q=JSON.parse(C)}catch{qe.error("Metadata must be valid JSON");return}try{await i.mutateAsync({datasetId:e,itemId:t,input:z,groundTruth:I,metadata:Q}),qe.success("Item updated successfully"),x(!1)}catch(W){qe.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):""),N(d.metadata?JSON.stringify(d.metadata,null,2):"")),x(!1)},G=async()=>{if(!(!e||!t))try{await c.mutateAsync({datasetId:e,itemId:t}),qe.success("Item deleted successfully"),P(!1),r(`/datasets/${e}`)}catch(z){qe.error(`Failed to delete item: ${z instanceof Error?z.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 o&&ba(o)?l.jsx(on,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"datasets"})})}):a?null:!e||!t||!s||s.length===0?l.jsx(on,{children:l.jsx(Va,{children:l.jsx("div",{className:"text-neutral3 p-4",children:"Item not found"})})}):l.jsxs(l.Fragment,{children:[l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{as:At,to:`/datasets/${e}`,children:u?.name}),l.jsx(bn,{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(kn,{children:[l.jsxs(kn.Column,{children:[l.jsxs(kn.Title,{children:[l.jsx(QQt,{}),t," ",l.jsx(oi,{content:t})]}),l.jsx(kn.Description,{children:l.jsxs(Kr,{children:["Item of ",l.jsx(bc,{})," ",u?.name]})}),l.jsxs(kn.Description,{children:[l.jsxs(Kr,{children:[l.jsx(AQt,{})," Created at"," ",d?.createdAt?nr(new Date(d.createdAt),"MMM d, yyyy"):""]}),l.jsxs(Kr,{children:[l.jsx(zD,{})," Latest version v",d?.datasetVersion??""]})]})]}),l.jsx(kn.Column,{children:!y&&!f&&l.jsxs(Go,{children:[l.jsxs(he,{onClick:q,disabled:D,title:D?"Return to latest version to edit":void 0,children:[l.jsx(aGt,{})," Edit"]}),l.jsxs(he,{onClick:V,disabled:D,title:D?"Return to latest version to delete":void 0,children:[l.jsx(xGt,{})," Delete"]})]})})]}),l.jsxs(Lb,{className:y?"grid-cols-1":"grid-cols-[1fr_auto]",children:[l.jsxs(yr,{withRightSeparator:!y,children:[f&&d&&l.jsxs(ni,{variant:"destructive",children:[l.jsx(gZ,{}),l.jsxs(ni.Message,{children:["This item was deleted at version v",d.datasetVersion]})]}),!f&&D&&p&&l.jsx(l.Fragment,{children:l.jsxs(ni,{variant:"warning",children:[l.jsx(gZ,{}),l.jsxs(ni.Message,{children:["Viewing version v",p.datasetVersion]}),l.jsxs(ni.Button,{onClick:U,children:[l.jsx(kQt,{})," Return to the latest version"]})]})}),y?l.jsx(Ynt,{inputValue:w,setInputValue:O,groundTruthValue:k,setGroundTruthValue:E,metadataValue:C,setMetadataValue:N,validationErrors:null,onSave:B,onCancel:H,isSaving:i.isPending}):Z?l.jsx(i3,{item:Z,Link:n}):l.jsx("div",{className:"text-neutral4 text-sm",children:"Item data not available"})]}),!y&&l.jsx(yr,{children:l.jsx(f5n,{datasetId:e,itemId:t,onClose:()=>{},onVersionSelect:M,onCompareVersionsClick:z=>{r(`/datasets/${e}/items/${t}/versions?ids=${z.join(",")}`)},activeVersion:p?.datasetVersion??null})})]})]})})]}),l.jsx(Dt,{open:R,onOpenChange:P,children:l.jsxs(Dt.Content,{children:[l.jsxs(Dt.Header,{children:[l.jsx(Dt.Title,{children:"Delete Item"}),l.jsx(Dt.Description,{children:"Are you sure you want to delete this item? This action cannot be undone."})]}),l.jsxs(Dt.Footer,{children:[l.jsx(Dt.Cancel,{children:"Cancel"}),l.jsx(Dt.Action,{onClick:G,children:c.isPending?"Deleting...":"Delete"})]})]})})]})}function vje(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function Gzn(){const{datasetId:e}=va(),[t,n]=Pi(),r=t.get("items")?.split(",").filter(Boolean)??[],{data:s,error:a}=wm(e??""),{Link:o}=Lt(),[i,c]=S.useState(!1),{data:u}=vX(e??"",r[0]??""),{data:d}=vX(e??"",r[1]??"");return a&&ba(a)?l.jsx(on,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"datasets"})})}):!e||r.length<2?l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{isCurrent:!0,as:"span",children:"Compare Items"})]})}),l.jsx(Va,{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(on,{children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{as:At,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),l.jsx(bn,{isCurrent:!0,as:"span",children:"Compare Items"})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:`/datasets/${e}`,variant:"outline",children:[l.jsx(Oe,{children:l.jsx(sS,{})}),"Back to Dataset"]})})]}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:K("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":i}),children:[l.jsxs(kn,{children:[l.jsxs(kn.Column,{children:[l.jsxs(kn.Title,{children:[l.jsx(p_,{}),"Compare Dataset Items"]}),l.jsx(kn.Description,{children:l.jsxs(Kr,{children:["Comparing ",r.length," items of"," ",l.jsx(At,{to:`/datasets/${e}`,className:"text-info1 hover:underline",children:s?.name||e?.slice(0,8)})]})})]}),l.jsx(kn.Column,{children:l.jsxs(Go,{children:[l.jsxs(he,{as:At,to:`/datasets/${e}`,children:[l.jsx(sS,{}),"Back to Dataset"]}),l.jsx(he,{variant:"primary",onClick:()=>c(f=>!f),children:i?l.jsxs(l.Fragment,{children:[l.jsx(QUe,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(BQt,{})," Diff View"]})})]})})]}),l.jsx(Lb,{className:"grid-cols-[1fr_3vw_1fr]",children:r.map((f,p)=>l.jsxs(S.Fragment,{children:[l.jsx(Wzn,{datasetId:e,itemId:f,Link:o,idx:p,itemIds:r,showContent:!i,onItemChange:h=>{const g=[...r];g[p]=h,n({items:g.join(",")})}}),p==0&&l.jsx("div",{className:K("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},f))}),i&&u&&d&&l.jsx(irt,{codeA:vje(u),codeB:vje(d)})]})})]})}function Wzn({datasetId:e,itemId:t,Link:n,idx:r,itemIds:s,onItemChange:a,showContent:o=!0}){const{data:i,isLoading:c}=vX(e,t),{data:u}=_C(e),d=new Set(s.filter((p,h)=>h!==r)),f=(u??[]).map(p=>({value:p.id,label:p.id,disabled:d.has(p.id)}));return l.jsxs(yr,{children:[l.jsxs(yr.Toolbar,{className:"flex gap-4",children:[l.jsx(xN,{label:"Item",name:`compare-item-${r}`,value:t,onValueChange:a,options:f,placeholder:"Select item",labelIsHidden:!0}),l.jsxs(he,{as:n,to:`/datasets/${e}/items/${t}`,children:[l.jsx(zD,{}),"Versions"]})]}),o&&l.jsx(yr.Content,{children:c?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):i?l.jsxs(l.Fragment,{children:[l.jsx(Znt,{item:i}),l.jsx(i3,{item:i,Link:n})]}):l.jsxs("div",{className:"text-neutral4 text-sm",children:["Item ",t.slice(0,8)," not found"]})})]})}function xje(e){return JSON.stringify({input:e.input??null,groundTruth:e.groundTruth??null,metadata:e.metadata??null},null,2)}function Zzn(){const{datasetId:e,itemId:t}=va(),[n,r]=Pi(),[s,a]=S.useState(!1),o=n.get("ids")?.split(",").map(Number).filter(h=>!isNaN(h)&&h>0)??[],{data:i,error:c}=wm(e??""),{Link:u}=Lt(),{data:d}=Loe(e??"",t??""),{data:f}=xX(e??"",t??"",o[0]??0,i?.version),{data:p}=xX(e??"",t??"",o[1]??0,i?.version);return c&&ba(c)?l.jsx(on,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"datasets"})})}):!e||!t||o.length<2?l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),l.jsx(Va,{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(on,{children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{as:At,to:`/datasets/${e}`,children:i?.name}),l.jsx(bn,{as:At,to:`/datasets/${e}/items/${t}`,children:"Item"}),l.jsx(bn,{isCurrent:!0,as:"span",children:"Compare Versions"})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:`/datasets/${e}/items/${t}`,variant:"outline",children:[l.jsx(Oe,{children:l.jsx(sS,{})}),"Back to Item"]})})]}),l.jsx("div",{className:"h-full overflow-hidden px-[3vw] pb-4",children:l.jsxs("div",{className:K("grid gap-6 max-w-[140rem] mx-auto grid-rows-[auto_1fr] h-full",{"grid-rows-[auto_auto_1fr]":s}),children:[l.jsxs(kn,{children:[l.jsxs(kn.Column,{children:[l.jsxs(kn.Title,{children:[l.jsx(p_,{}),"Compare Dataset Item Versions"]}),l.jsx(kn.Description,{children:l.jsxs(Kr,{children:["Comparing ",o.length," versions of"," ",l.jsx(At,{to:`/datasets/${e}/items/${t}`,className:"text-info1 hover:underline",children:t})]})})]}),l.jsx(kn.Column,{children:l.jsxs(Go,{children:[l.jsxs(he,{as:At,to:`/datasets/${e}/items/${t}`,children:[l.jsx(sS,{}),"Back to Item"]}),l.jsx(he,{variant:"primary",onClick:()=>a(h=>!h),children:s?l.jsxs(l.Fragment,{children:[l.jsx(QUe,{})," Default View"]}):l.jsxs(l.Fragment,{children:[l.jsx(XQt,{})," Diff View"]})})]})})]}),l.jsx(Lb,{className:"grid-cols-[1fr_3vw_1fr]",children:o.map((h,g)=>l.jsxs(S.Fragment,{children:[l.jsx(Yzn,{datasetId:e,itemId:t,datasetVersion:h,latestVersion:i?.version,allVersions:d??[],versionNumbers:o,Link:u,idx:g,showContent:!s,onVersionChange:b=>{const y=[...o];y[g]=b,r({ids:y.join(",")})}}),g===0&&l.jsx("div",{className:K("bg-surface5 w-[3px] shrink-0 mx-[1.5vw]")})]},h))}),s&&f&&p&&l.jsx(irt,{codeA:xje(f),codeB:xje(p)})]})})]})}function Yzn({datasetId:e,itemId:t,datasetVersion:n,latestVersion:r,allVersions:s,versionNumbers:a,Link:o,idx:i,showContent:c=!0,onVersionChange:u}){const{data:d,isLoading:f}=xX(e,t,n,r),p=new Set(a.filter((b,y)=>y!==i)),h=s.map(b=>{const y=typeof b.updatedAt=="string"?new Date(b.updatedAt):b.updatedAt;return{value:String(b.datasetVersion),label:l.jsxs(l.Fragment,{children:[l.jsxs("b",{children:["v. ",b.datasetVersion]})," - ",nr(y,"MMM d, yyyy h:mm a"),b.isLatest?l.jsx(Ro,{color:"blue",size:"small",children:"Latest"}):null]}),disabled:p.has(b.datasetVersion)}}),g=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(yr,{children:[l.jsxs(yr.Toolbar,{className:"grid gap-4 grid-cols-[auto_1fr]",children:[l.jsx(zD,{className:"w-6 h-6 opacity-50"}),l.jsx(xN,{label:"Version",name:`compare-version-${i}`,value:String(n),onValueChange:b=>u(Number(b)),options:h,placeholder:"Select version",labelIsHidden:!0,className:"w-full"})]}),c&&l.jsx(yr.Content,{children:f?l.jsx("div",{className:"text-neutral4 text-sm",children:"Loading..."}):!d||!g?l.jsxs("div",{className:"text-neutral4 text-sm",children:["Version ",n," not found"]}):l.jsx(i3,{item:g,Link:o})})]})}function Xzn(){const{datasetId:e}=va(),[t]=Pi(),n=t.get("ids")?.split(",").map(Number).filter(b=>!isNaN(b)&&b>0)??[],r=Ml(),{data:s,error:a}=wm(e??""),o=_C(e??"",void 0,n[0]??null),i=_C(e??"",void 0,n[1]??null),c=S.useMemo(()=>o.data??[],[o.data]),u=S.useMemo(()=>i.data??[],[i.data]),d=S.useMemo(()=>{const b=new Map;for(const y of[...c,...u])b.has(y.id)||b.set(y.id,{id:y.id,createdAt:new Date(y.createdAt)});return[...b.values()].sort((y,x)=>x.createdAt.getTime()-y.createdAt.getTime())},[c,u]),f=S.useMemo(()=>new Map(c.map(b=>[b.id,b])),[c]),p=S.useMemo(()=>new Map(u.map(b=>[b.id,b])),[u]);if(a&&ba(a))return l.jsx(on,{children:l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"datasets"})})});if(!e||n.length<2)return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{isCurrent:!0,as:"span",children:"Compare Versions"})]})}),l.jsx(Va,{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=(b,y,x)=>{r(`/datasets/${e}/items/${b}/versions?ids=${y?.datasetVersion??""},${x?.datasetVersion??""}`)},g=(b,y)=>{r(`/datasets/${e}/versions?ids=${b},${y}`,{replace:!0})};return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/datasets",children:[l.jsx(Oe,{children:l.jsx(bc,{})}),"Datasets"]}),l.jsx(bn,{as:At,to:`/datasets/${e}`,children:s?.name||e?.slice(0,8)}),l.jsxs(bn,{isCurrent:!0,as:"span",children:[l.jsx(Oe,{children:l.jsx(tSe,{})}),"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(kn,{children:[l.jsxs(kn.Column,{children:[l.jsxs(kn.Title,{children:[l.jsx(tSe,{})," Compare Dataset Versions"]}),l.jsx(kn.Description,{children:l.jsxs(Kr,{children:[l.jsx(zD,{})," Comparing ",n.length," versions of"," ",s?.name||e?.slice(0,8)]})})]}),l.jsx(kn.Column,{children:l.jsxs(he,{as:At,to:`/datasets/${e}`,children:[l.jsx(sS,{}),"Back to Dataset"]})})]}),l.jsx(Lb,{children:l.jsxs(yr,{children:[l.jsx(m5n,{datasetId:e,versionA:String(n[0]),versionB:String(n[1]),onVersionChange:g}),l.jsx(v5n,{datasetId:e,versionA:n[0],versionB:n[1],allItems:d,itemsAMap:f,itemsBMap:p,onItemClick:h})]})})]})})]})}function Kzn(){const[e]=Pi(),t=Ml(),n=e.get("redirect")||"/",s=e.get("mode")==="signup"?"signup":"signin",a=e.get("error_description")||e.get("error")||null,o=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(att,{redirectUri:n,onSuccess:o,initialMode:s,errorMessage:a})}const Jzn=()=>{const{data:e=[],isLoading:t,error:n}=wN(),r=!t&&e.length===0;return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(yu,{})}),"MCP Servers"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"MCP documentation"]})})]}),l.jsx(Va,{isCentered:r,children:l.jsx(B5n,{mcpServers:e,isLoading:t,error:n})})]})},e7n=()=>{const{serverId:e}=va(),{data:t=[],isLoading:n}=wN(),r=t.find(s=>s.id===e);return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/mcps",children:[l.jsx(Oe,{children:l.jsx(yu,{})}),"MCP Servers"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(nnt,{value:e,variant:"ghost"})})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"MCP documentation"]})})]}),l.jsx(Q5n,{isLoading:n,server:r})]})},t7n=()=>{const{data:e}=wN(),{serverId:t,toolId:n}=va(),{data:r,isLoading:s}=crt(t,n),a=e?.find(c=>c.id===t),o=r?.name,i=a?.name||"";return s||!r?null:l.jsxs("div",{className:"h-full w-full bg-surface2 overflow-y-hidden",children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/mcps",children:[l.jsx(Oe,{children:l.jsx(yu,{})}),"MCP Servers"]}),l.jsx(bn,{as:At,to:`/mcps/${t}`,children:i}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:o})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/tools-mcp/mcp-overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"MCP documentation"]})})]}),l.jsx(H5n,{toolId:n,serverId:t})]})},n7n=(e,t)=>{const n=Xe();return Qt({queryKey:["trace",e],queryFn:async()=>{if(!e)throw new Error("Trace ID is required");return await n.getTrace(e)},enabled:!!e,refetchInterval:3e3,...t})},r7n=async({client:e,page:t,perPage:n,filters:r})=>e.listTraces({pagination:{page:t,perPage:n},filters:r}),s7n=25;function a7n(e,t,n){if(e?.pagination?.hasMore)return n+1}function o7n(e){const t=new Set,n=e.pages.flatMap(s=>s.spans??[]).filter(s=>t.has(s.traceId)?!1:(t.add(s.traceId),!0)),r={};for(const s of e.pages)s.threadTitles&&Object.assign(r,s.threadTitles);return{spans:n,threadTitles:r}}const i7n=({filters:e})=>{const t=Xe(),{inView:n,setRef:r}=fN(),s=p1({queryKey:["traces",e],queryFn:({pageParam:c})=>r7n({client:t,page:c,perPage:s7n,filters:e}),initialPageParam:0,getNextPageParam:a7n,select:o7n,retry:!1,refetchInterval:c=>ba(c.state.error)?!1:3e3}),{hasNextPage:a,isFetchingNextPage:o,fetchNextPage:i}=s;return S.useEffect(()=>{n&&a&&!o&&i()},[n,a,o,i]),{...s,setEndOfListElement:r}};function l7n(){const e=Ml(),[t,n]=Pi(),[r,s]=S.useState(),[a,o]=S.useState({value:"all",label:"All",type:"all"}),[i,c]=S.useState(void 0),[u,d]=S.useState(void 0),[f,p]=S.useState(!1),[h,g]=S.useState(!1),{data:b={},isLoading:y}=_f(),{data:x,isLoading:w}=xm(),{data:O={},isLoading:k}=Xp(),{data:E,isLoading:C}=n7n(r,{enabled:!!r}),N=t.get("traceId"),T=t.get("spanId"),j=t.get("tab"),R=t.get("scoreId"),{data:P,isLoading:M,isFetchingNextPage:U,hasNextPage:D,setEndOfListElement:q,error:V,isError:B}=i7n({filters:{...a?.type!=="all"&&{entityId:a?.value,entityType:a?.type},...i&&{startedAt:{start:i}},...u&&{endedAt:{end:u}}}}),H=S.useMemo(()=>P?.spans??[],[P?.spans]),G=P?.threadTitles??{};N&&N!==r&&(s(N),g(!0));const L=S.useMemo(()=>(Object.entries(b)||[]).map(([ie,ge])=>({value:ge.id,label:ge.name,type:fm.AGENT})),[b]),Z=S.useMemo(()=>(Object.entries(x||{})||[]).map(([,ie])=>({value:ie.name,label:ie.name,type:fm.WORKFLOW_RUN})),[x]),z=S.useMemo(()=>[{value:"all",label:"All",type:"all"},...L,...Z],[L,Z]),I=t.get("entity"),Q=z.find(ie=>ie.value===I);Q&&Q.value!==a?.value&&o(Q);const W=()=>{s(void 0),n({entity:"all",traceId:""}),g(!1),c(void 0),d(void 0),p(!1)},J=(ie,ge)=>{if(ge==="from")return c(ie);d(ie)},ne=ie=>{ie?.value&&n({entity:ie.value})},te=ie=>{if(ie===r)return s(void 0);s(ie),g(!0)},ae=B?M5n(V):void 0,ce=S.useMemo(()=>{if(!f)return H.map(we=>({id:we.traceId}));const{groups:ie,ungrouped:ge}=Hnt(H),me=[];for(const we of ie)for(const Te of we.traces)me.push({id:Te.traceId});for(const we of ge)me.push({id:we.traceId});return me},[H,f]);if(V&&ba(V))return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(f_,{})}),"Observability"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Observability documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"traces"})})]});const ve=a?.value!=="all"||i||u,ee=X4({entries:ce,id:r,update:s}),re=K4({entries:ce,id:r,update:s});return l.jsxs(l.Fragment,{children:[l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(f_,{})}),"Observability"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/observability/tracing/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Observability documentation"]})})]}),l.jsx("div",{className:K("grid overflow-y-auto h-full"),children:l.jsxs("div",{className:K("max-w-[100rem] px-12 mx-auto grid content-start gap-8 h-full"),children:[l.jsx(C_,{title:"Observability",description:"Explore observability traces for your entities",icon:l.jsx(f_,{})}),l.jsx(LDn,{onEntityChange:ne,onReset:W,selectedEntity:a,entityOptions:z,onDateChange:J,selectedDateFrom:i,selectedDateTo:u,isLoading:M||y||w,groupByThread:f,onGroupByThreadChange:p}),M?l.jsx(Qet,{columns:o3}):l.jsx(BDn,{traces:H,selectedTraceId:r,onTraceClick:te,errorMsg:ae?.error,setEndOfListElement:q,filtersApplied:!!ve,isFetchingNextPage:U,hasNextPage:D,groupByThread:f,threadTitles:G})]})})]}),l.jsx(Unt,{traceSpans:E?.spans,traceId:r,initialSpanId:T||void 0,initialSpanTab:j==="scores"?"scores":"details",initialScoreId:R||void 0,traceDetails:H.find(ie=>ie.traceId===r),isOpen:h,onClose:()=>{e("/observability"),g(!1)},onNext:ee,onPrevious:re,isLoadingSpans:C,computeTraceLink:(ie,ge)=>`/observability?traceId=${ie}${ge?`&spanId=${ge}`:""}`,scorers:O,isLoadingScorers:k})]})}function c7n(){const{Link:e,paths:t}=Lt(),{data:n,isLoading:r}=Mtt(),{isCmsAvailable:s}=Db(),a=n?.promptBlocks??[];return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(FD,{})}),"Prompts"]}),l.jsxs(gs,{children:[s&&l.jsxs(he,{variant:"light",as:e,to:t.cmsPromptBlockCreateLink(),children:[l.jsx(Oe,{children:l.jsx(BD,{})}),"Create a prompt block"]}),l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/agent-instructions#prompt-blocks",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Documentation"]})]})]}),l.jsx(Va,{isCentered:!r&&a.length===0,children:l.jsx(r2n,{isLoading:r,promptBlocks:a})})]})}function u7n(){return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(GUe,{})}),"Request Context"]})}),l.jsx(Va,{children:l.jsx(XRn,{children:l.jsx(oX,{})})})]})}function d7n(){const{Link:e}=Lt(),{data:t={},isLoading:n,error:r}=Xp(),{isCmsAvailable:s}=Db();return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Gh,{})}),"Scorers"]}),l.jsxs(gs,{children:[s&&l.jsxs(he,{variant:"light",as:e,to:"/cms/scorers/create",children:[l.jsx(Oe,{children:l.jsx(BD,{})}),"Create Scorer"]}),l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Scorers documentation"]})]})]}),l.jsx(Va,{isCentered:!n&&Object.keys(t||{}).length===0,children:l.jsx(TIn,{isLoading:n,scorers:t,error:r})})]})}function f7n(){const{scorerId:e}=va(),[t,n]=Pi(),[r,s]=S.useState(),[a,o]=S.useState(0),[i,c]=S.useState(!1),[u,d]=S.useState({value:"all",label:"All Entities",type:"ALL"}),{scorer:f,isLoading:p,error:h}=kIn(e),{data:g={},isLoading:b,error:y}=_f(),{data:x,isLoading:w,error:O}=xm(),{data:k,isLoading:E,error:C}=OIn({scorerId:e,page:a,entityId:u?.value==="all"?void 0:u?.value,entityType:u?.type==="ALL"?void 0:u?.type}),N=S.useMemo(()=>f?.agentIds?.filter(z=>g[z]).map(z=>({value:z,label:g[z].name,type:"AGENT"}))||[],[f?.agentIds,g]),T=S.useMemo(()=>f?.workflowIds?.map(z=>({value:z,label:z,type:"WORKFLOW"}))||[],[f?.workflowIds]),j=S.useMemo(()=>[{value:"all",label:"All Entities",type:"ALL"},...N,...T],[N,T]),R=t.get("entity"),P=j.find(z=>z.value===R);if(P&&P.value!==u?.value&&d(P),S.useEffect(()=>{if(h){const z=h instanceof Error?h.message:"Failed to load scorer";qe.error(`Error loading scorer: ${z}`)}},[h]),S.useEffect(()=>{if(y){const z=y instanceof Error?y.message:"Failed to load agents";qe.error(`Error loading agents: ${z}`)}},[y]),S.useEffect(()=>{if(O){const z=O instanceof Error?O.message:"Failed to load workflows";qe.error(`Error loading workflows: ${z}`)}},[O]),h&&ba(h))return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/scorers",children:[l.jsx(Oe,{children:l.jsx(Gh,{})}),"Scorers"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"scorers"})})]});if(p||h||y||O)return null;const M=f?.agentIds?.map(z=>({name:z,id:Object.entries(g).find(([,I])=>I.name===z)?.[0]}))||[],U=f?.workflowIds?.map(z=>({name:z,id:Object.entries(x||{}).find(([,I])=>I.name===z)?.[0]}))||[],q=[{key:"entities",label:"Entities",value:([...M.map(z=>({id:z.id,name:z.name,type:"AGENT"})),...U.map(z=>({id:z.id,name:z.name,type:"WORKFLOW"}))]||[]).map(z=>({id:z.id,name:z.name||z.id,path:`${z.type==="AGENT"?"/agents":"/workflows"}/${z.name}`}))}],V=z=>{z?.value&&n({entity:z.value})},B=k?.scores||[],H=k?.pagination,G=z=>{s(z),c(!0)},L=X4({entries:B,id:r,update:s}),Z=K4({entries:B,id:r,update:s});return l.jsxs(l.Fragment,{children:[l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/scorers",children:[l.jsx(Oe,{children:l.jsx(Gh,{})}),"Scorers"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(_In,{value:e,variant:"ghost"})})]}),l.jsxs(gs,{children:[f?.scorer?.source==="stored"&&l.jsxs(he,{variant:"light",as:At,to:`/cms/scorers/${e}/edit`,children:[l.jsx(Oe,{children:l.jsx(iGt,{})}),"Edit"]}),l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/evals/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Scorers documentation"]})]})]}),l.jsx("div",{className:K("grid overflow-y-auto h-full"),children:l.jsxs("div",{className:K("max-w-[100rem] w-full px-12 mx-auto grid content-start gap-8 h-full"),children:[l.jsx(C_,{title:f?.scorer?.config?.name||"loading",description:f?.scorer?.config?.description||"loading",icon:l.jsx(Gh,{})}),l.jsx(wx,{data:q,LinkComponent:At,isLoading:b||w}),l.jsx(SIn,{selectedEntity:u,entityOptions:j,onEntityChange:V,onReset:()=>n({entity:"all"}),isLoading:E||b||w}),E?l.jsx("div",{className:"h-full w-full flex items-center justify-center",children:l.jsx(jn,{})}):l.jsx(oIn,{scores:B,selectedScoreId:r,pagination:{total:H?.total||0,hasMore:H?.hasMore||!1,perPage:H?.perPage||0,page:H?.page||0},onScoreClick:G,onPageChange:o,errorMsg:C?.message})]})})]}),l.jsx(Zet,{scorerName:f?.scorer?.config?.name,score:p7n(B.find(z=>z.id===r)),isOpen:i,onClose:()=>c(!1),onNext:L,onPrevious:Z,computeTraceLink:(z,I)=>`/observability?traceId=${z}${I?`&spanId=${I}`:""}`})]})}const p7n=e=>{if(e)return{...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}},h7n=[{value:"dark",label:"Dark"},{value:"light",label:"Light"},{value:"system",label:"System"}],m7n=()=>{const{baseUrl:e,headers:t,themeToggleEnabled:n}=Y4(),{theme:r,setTheme:s}=Or(),[a,o]=S.useState(r),i=S.useRef(r);return S.useEffect(()=>{o(r),i.current=r},[r]),l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(doe,{})}),"Settings"]})}),l.jsx(Va,{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(xN,{name:"theme",label:"Theme mode",value:a,onValueChange:c=>{const u=c;i.current=u,o(u)},options:h7n.map(c=>({...c}))})]})}):null,l.jsx(Fet,{initialConfig:{baseUrl:e,headers:t},onSave:()=>{n&&s(i.current)}})]})})]})};function g7n(){const[e]=Pi(),t=Ml(),n=e.get("redirect")||"/",r=()=>{n.startsWith("http")?window.location.href=n:t(n,{replace:!0})};return l.jsx(att,{redirectUri:n,onSuccess:r,initialMode:"signup"})}async function sat(){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(a=>a.tags))),s=Array.from(new Set(n.flatMap(a=>a.supportedProviders)));return{templates:n,tags:r,providers:s}}async function b7n({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 y7n({repoOrSlug:e,owner:t}){const{templates:n}=await sat(),r=n.find(s=>s.slug===e);if(!r){if(e.startsWith("template-")){const a=n.find(o=>`template-${o.slug}`===e);if(a)return a}const s=await b7n({repo:e,owner:t});if(s)return s;throw new Error(`Template ${e} not found`)}return r}async function v7n({repo:e,owner:t,branch:n}){const r=`https://raw.githubusercontent.com/${t}/${e}/${n}/.env.example`,s=await fetch(r);return s.ok?(await s.text()).split(`
|
|
476
|
-
`).reduce((i,c)=>{if(!c||c.startsWith("#"))return i;const[u,d]=c.split("=");return u&&(i[u]=d?.split("")?.every(f=>f==="*")?"":d?.replaceAll('"',"")),i},{}):{}}const x7n=()=>Qt({queryKey:["mastra-templates"],queryFn:sat}),w7n=({repoOrSlug:e,owner:t})=>Qt({queryKey:["template-repo",e,t],queryFn:()=>y7n({repoOrSlug:e,owner:t})}),S7n=({repo:e,owner:t,branch:n})=>Qt({queryKey:["template-repo-env-vars",e,t,n],queryFn:()=>v7n({repo:e,owner:t,branch:n})}),O7n=()=>{const e=Xe();return Qt({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},k7n=()=>{const e=Xe();return qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},_7n=()=>{const e=Xe();return qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},wje=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)},Sje=(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((a,o)=>(a[o]={id:o,description:n.allSteps[o].description,status:"pending"},a),{})}}),e.type==="start"||e.type==="workflow-start"){const a={};n?.allSteps&&Object.entries(n.allSteps).forEach(([i,c])=>{a[i]={id:c.id,description:c.description,status:"pending"}});const o=e.runId||e.payload?.runId;r={...r,runId:o,eventTimestamp:new Date().toISOString(),status:"running",phase:"initializing",payload:{workflowState:{status:"running",steps:a},currentStep:null}}}if(e.type==="step-start"||e.type==="workflow-step-start"){const a=e.payload.id;r={...r,phase:"processing",payload:{...r.payload,currentStep:{id:a,status:"running",startTime:new Date,...e.payload},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[a]:{...r.payload.workflowState.steps[a],status:"running",startTime:new Date,...e.payload}}}}}}if(e.type==="step-result"||e.type==="workflow-step-result"){const a=e.payload.id,o=e.payload.status,i=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,[a]:{...r.payload.workflowState.steps[a],status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date}}}}},o==="failed"&&i){const c=wje(i);r={...r,status:"failed",error:c,phase:"error",failedStep:{id:a,error:c,description:e.payload.description||a},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 a=wje(e.payload.error);r={...r,status:"failed",error:a,phase:"error",payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}return{newState:r}},E7n=(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)}},aat=(e,t)=>{const[n,r]=S.useState({}),[s,a]=S.useState(!1);return{streamResult:n,isStreaming:s,processStream:async(i,c)=>{if(a(!0),r({}),!i)throw new Error("No stream returned");const u=i.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}=Sje(p,d,e);if(d=h,r(h),p.runId||c||t){const g=p.runId||c||t;E7n(g,h)}}}catch(f){console.error("💥 [processStream] Error processing template installation stream:",f);const{newState:p}=Sje({type:"error",payload:{error:f instanceof Error?f.message:"Unknown error"}},d,e);r(p)}finally{a(!1),u.releaseLock()}}}},C7n=e=>{const t=Xe(),{streamResult:n,isStreaming:r,processStream:s}=aat(e);return{streamInstall:qn({mutationFn:async({inputData:o,selectedModel:i,runId:c})=>{for(let d=1;d<=3;d++)try{const f=t.getAgentBuilderAction("merge-template"),p=new hT;p.set("selectedModel",i);const h=await f.stream({inputData:o,requestContext:p},c);await s(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}},T7n=e=>{const t=Xe(),{streamResult:n,isStreaming:r,processStream:s}=aat(e);return{observeInstall:qn({mutationFn:async({runId:o})=>{for(let u=1;u<=3;u++)try{const f=await t.getAgentBuilderAction("merge-template").observeStream({runId:o});await s(f,o);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 N7n(){const{data:e,isLoading:t}=x7n(),{templates:n,tags:r,providers:s}=e??{templates:[],tags:[],providers:[]},[a,o]=S.useState("all"),[i,c]=S.useState("all"),[u,d]=S.useState(""),f=[{value:"all",label:"Any tag"}];(r||[]).forEach(w=>{f.push({value:w,label:w})});const p=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{p.push({value:w,label:w})});const h=(w,O)=>{O==="tag"?o(w):O==="provider"&&c(w)},g=w=>{d(w)},b=()=>{o("all"),c("all"),d("")},y=n.filter(w=>!(u&&!w.title.toLowerCase().includes(u)&&!w.description.toLowerCase().includes(u)||a!=="all"&&!w.tags.includes(a)||i!=="all"&&!w.supportedProviders.includes(i))),x=u||a!=="all"||i!=="all";return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(cre,{})}),"Templates"]})}),l.jsxs("div",{className:K("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(EDn,{selectedTag:a,onTagChange:w=>h(w,"tag"),tagOptions:f,selectedProvider:i,onProviderChange:w=>h(w,"provider"),providerOptions:p,searchTerm:u,onSearchChange:g,onReset:x?b:void 0,className:"max-w-[80rem]",isLoading:t}),l.jsx(TDn,{templates:y,linkComponent:At,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const A7n="1.15.0-alpha.2";function j7n(){const{templateSlug:e}=va(),[t,n]=Pi(),[r,s]=S.useState(""),[a,o]=S.useState(""),[i,c]=S.useState(""),[u,d]=S.useState({}),[f,p]=S.useState([]),[h,g]=S.useState(null),[b,y]=S.useState(!1),[x,w]=S.useState(""),[O,k]=S.useState(!1),[E,C]=S.useState(!1),[N,T]=S.useState([]),{data:j,isLoading:R}=w7n({repoOrSlug:e,owner:"mastra-ai"}),M=A7n?.includes("beta")??!1?"beta":"main",{data:U,isLoading:D}=S7n({repo:j?.githubUrl?new URL(j.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:M}),{data:q,isLoading:V}=O7n(),{mutateAsync:B,isPending:H}=k7n(),{mutateAsync:G}=_7n(),{streamInstall:L,streamResult:Z,isStreaming:z}=C7n(q),{observeInstall:I,streamResult:Q,isStreaming:W}=T7n(q);S.useEffect(()=>{const re=t.get("runId");re&&!b&&!h&&!z&&!W&&(console.info("🔄 Checking completed run after hot reload:",{runId:re}),w(re),G({runId:re}).then(ie=>{const ge=ie.snapshot;if(ge?.status==="success"&&ge?.result?.success)y(!0);else if(ge?.result?.success===!1)if(ge?.result?.validationResults&&!ge?.result?.validationResults?.valid&&ge?.result?.validationResults?.remainingErrors>0){const{remainingErrors:we,errors:Te}=ge.result.validationResults,Se=`Template installation completed but ${we} validation issue${we>1?"s":""} remain unresolved.`;g(Se),T(Te||[])}else{const we=ge?.result?.message||ge?.result?.error||"Template installation failed";g(typeof we=="string"?we:String(we))}}).catch(ie=>{console.error("❌ Failed to fetch run details:",ie),g("Failed to retrieve installation status after reload")}))},[t,b,h,z,W,G]),S.useEffect(()=>{const re=t.get("runId"),ie=t.get("resume"),ge=t.get("provider");if(re&&ie==="true"&&ge&&!z&&!W&&!O&&!E&&q){w(re),k(!0);try{G({runId:re}).then(me=>{if(me.snapshot?.status==="running")return I.mutateAsync({runId:re})}).then(()=>{n(me=>{const we=new URLSearchParams(me);return we.delete("resume"),we})}).catch(me=>{console.error("❌ Failed to resume template installation:",me),me.message?.includes("404")||me.message?.includes("not found")?g("Template installation run not found. It may have expired or been completed."):g("Failed to resume template installation. Please try again.")})}catch(me){console.error("❌ Auto-resume failed with error:",me),g("Failed to resume template installation. Please refresh and try again.")}}},[t,e,z,W,O,E,q,G,I,n]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ne=[{key:"tools",label:"Tools",value:j?.tools?.length?j.tools.map(re=>re).join(", "):"n/a",icon:l.jsx(Ti,{})},{key:"agents",label:"Agents",value:j?.agents?.length?j.agents.map(re=>re).join(", "):"n/a",icon:l.jsx(so,{})},{key:"workflows",label:"Workflows",value:j?.workflows?.length?j.workflows.map(re=>re).join(", "):"n/a",icon:l.jsx(kGt,{})},{key:"providers",label:"Providers",value:j?.supportedProviders?.length?j.supportedProviders.join(", "):"n/a",icon:l.jsx(TQt,{})},{key:"tags",label:"Tags",value:j?.tags?.length?j.tags.join(", "):"n/a",icon:l.jsx(yGt,{})}],te=[{...ne[0]},{...ne[1]},{...ne[2]}].filter(re=>re.value!=="n/a");S.useEffect(()=>{U&&d(U)},[U]),S.useEffect(()=>{const re=Z||Q;re?.phase==="error"&&re?.error&&g(typeof re.error=="string"?re.error:String(re.error))},[Z?.phase,Z?.error,Q?.phase,Q?.error]);const ae=re=>{s(re)},ce=async re=>(o(re.provider),c(re.modelId),{message:"Model updated successfully"}),ve=async()=>{const re=Object.entries(u).reduce((ie,[ge,me])=>(me===""&&ie.push(ge),ie),[]);if(re.length>0){p(re);return}if(j){g(null),y(!1),w(""),C(!0);try{const ge={repo:j.githubUrl||`https://github.com/mastra-ai/template-${j.slug}`,ref:M,slug:j.slug,variables:u},{runId:me}=await B({});w(me),n(we=>{const Te=new URLSearchParams(we);return Te.set("runId",me),Te.set("resume","true"),Te.set("provider",r||"openai"),Te}),await L.mutateAsync({inputData:ge,selectedModel:{provider:a,modelId:i},runId:me})}catch(ie){C(!1),g(ie?.message||"Template installation failed"),console.error("Template installation failed",ie)}}},ee=re=>{const{name:ie,value:ge}=re.target;ge.trim()===""?p(me=>[...me,ie]):p(me=>me.filter(we=>we!==ie)),d(me=>({...me,[ie]:ge}))};return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/templates",children:[l.jsx(Oe,{children:l.jsx(cre,{})}),"Templates"]}),l.jsx(bn,{as:At,to:`/templates/${j?.slug}`,isCurrent:!0,children:j?.title&&j.title})]})}),l.jsx("div",{className:K("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(NDn,{isLoading:R,title:j?.title,description:j?.longDescription,imageURL:j?.imageURL,githubUrl:j?.githubUrl,infoData:ne,templateSlug:e}),j&&l.jsxs(l.Fragment,{children:[(z||W)&&l.jsx(MDn,{name:j.title,streamResult:W?Q:Z,runId:x,workflowInfo:q}),b&&l.jsx($Dn,{name:j.title,installedEntities:te,linkComponent:At}),h&&l.jsx(DDn,{errorMsg:h,validationErrors:N.length>0?N:Z?.validationResults?.errors||Q?.validationResults?.errors}),!z&&!W&&!b&&!h&&l.jsx(ADn,{providerOptions:J,selectedProvider:r,onProviderChange:ae,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:ve,handleVariableChange:ee,isLoadingEnvVars:D||V,isInstalling:H,defaultModelProvider:a,defaultModelId:i,onModelUpdate:ce})]})]})})]})}const R7n=()=>{const{toolId:e,agentId:t}=va();return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/agents",children:[l.jsx(Oe,{children:l.jsx(so,{})}),"Agents"]}),l.jsx(bn,{as:At,to:`/agents/${t}/chat`,children:t}),l.jsx(bn,{as:At,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"Tools documentation"]})})]}),l.jsx(xPn,{toolId:e,agentId:t})]})},I7n=()=>{const{toolId:e}=va();return l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/tools",children:[l.jsx(Oe,{children:l.jsx(Ti,{})}),"Tools"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(_Dn,{value:e,variant:"ghost"})})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Tools documentation"]})})]}),l.jsx(kDn,{toolId:e})]})};function P7n(){const{data:e,isLoading:t,error:n}=xm(),r=!t&&Object.keys(e||{}).length===0;return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(tl,{})}),"Workflows"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Workflows documentation"]})})]}),l.jsx(Va,{isCentered:r,children:l.jsx(uAn,{workflows:e||{},isLoading:t,error:n})})]})}const Oje=()=>{const{workflowId:e}=va(),{data:t,isLoading:n,error:r}=pN(e);return r&&ba(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"workflows"})}):l.jsx(GJe,{workflowId:e,workflow:t??void 0,isLoading:n})};function kje(){const{workspaceId:e}=va(),[t,n]=Pi(),r=Ml(),[s,a]=S.useState(!1),[o,i]=S.useState(!1),[c,u]=S.useState(!1),[d,f]=S.useState(null),[p,h]=S.useState(null),[g,b]=S.useState(!1),y=t.get("file"),x=t.get("tab"),{data:w,error:O,isLoading:k}=ant(),E=w?.workspaces??[],C=e??E[0]?.id,{data:N,isLoading:T,error:j}=bMn(C),R=ba(O)||ba(j),P=t.get("path")||".",M=MY(O)||MY(j),U=C?E.find(Be=>Be.id===C):void 0,D=Be=>{const et=new URLSearchParams(t);for(const[bt,Pt]of Object.entries(Be))Pt===null?et.delete(bt):et.set(bt,Pt);n(et)},q=Be=>{b(!1),a(!1),r(`/workspaces/${Be}`)},V=Be=>{D({path:Be==="."||Be===""?null:Be,file:null})},B=Be=>{D({file:Be})},H=Be=>{D({tab:Be})},G=P,L=y,{data:Z,isLoading:z,error:I,refetch:Q}=yMn(G,{enabled:N?.isWorkspaceConfigured&&N?.capabilities?.hasFilesystem,workspaceId:C}),W=xMn(),J=wMn(),{data:ne,isLoading:te}=ont(L??"",{enabled:!!L,workspaceId:C}),{data:ae,isLoading:ce,refetch:ve}=OMn({workspaceId:C}),ee=AMn(),re=jMn(),ie=RMn(),ge=N?.isWorkspaceConfigured??!1,me=N?.capabilities?.hasFilesystem??!1,we=N?.capabilities?.hasSkills??!1,Te=N?.capabilities?.canBM25??!1,Se=N?.capabilities?.canVector??!1,je=U?.safety?.readOnly??!1,X=me&&!je,se=N?.mounts,fe=se?.filter(Be=>!Be.readOnly).map(Be=>({path:Be.path,displayName:Be.displayName,icon:Be.icon,provider:Be.provider,name:Be.name})),Ce=se&&se.length>1?se.map(Be=>Be.path):void 0,Ne=S.useCallback(Be=>{C&&ee.mutate({...Be,workspaceId:C},{onSuccess:async et=>{if(et.success){u(!1);const{data:bt,error:Pt}=await ve();if(Pt||!bt){qe.success(`Skill "${et.skillName}" installed successfully (${et.filesWritten} files)`);return}bt.skills.some(Ct=>Ct.name===et.skillName)?qe.success(`Skill "${et.skillName}" installed successfully (${et.filesWritten} files)`):(b(!0),qe.warning(`Skill "${et.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else qe.error("Failed to install skill")},onError:et=>{qe.error(`Failed to install skill: ${et instanceof Error?et.message:"Unknown error"}`)}})},[C,ee,ve]),ue=S.useCallback(Be=>{C&&(h(Be),re.mutate({workspaceId:C,skillName:Be},{onSuccess:et=>{if(h(null),et.updated.length>0){const bt=et.updated[0];bt.success?(qe.success(`Skill "${Be}" updated successfully (${bt.filesWritten} files)`),ve()):qe.error(`Failed to update skill: ${bt.error??"Unknown error"}`)}else qe.error("Failed to update skill: No update result returned")},onError:et=>{h(null),qe.error(`Failed to update skill: ${et instanceof Error?et.message:"Unknown error"}`)}}))},[C,re,ve]),ye=S.useCallback(Be=>{C&&(f(Be),ie.mutate({workspaceId:C,skillName:Be},{onSuccess:et=>{f(null),et.success?(qe.success(`Skill "${et.skillName}" removed successfully`),ve()):qe.error(`Failed to remove skill "${et.skillName}"`)},onError:et=>{f(null),qe.error(`Failed to remove skill: ${et instanceof Error?et.message:"Unknown error"}`)}}))},[C,ie,ve]),De=x==="files"&&me?"files":x==="skills"&&we?"skills":me?"files":we?"skills":"files",Ke=ae?.skills??[],Bt=ae?.isSkillsConfigured??!1,cn=Z?.entries??[],Pn=me&&(Te||Se),Et=we&&Bt&&Ke.length>0,rt=Pn||Et;return R?l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"workspaces"})})]}):M?l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"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(C_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Hf,{})}),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(gZ,{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:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"Learn More"]})]})]})})]}):k?l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(jn,{})})]}):!T&&!k&&!ge?l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"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(C_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Hf,{})}),l.jsx(nLn,{})]})})]}):l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(gs,{children:[rt&&l.jsxs(he,{variant:"light",onClick:()=>a(!s),children:[l.jsx(Oe,{children:l.jsx(mGt,{className:"h-4 w-4"})}),"Search"]}),l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"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(C_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Hf,{})}),E.length>1&&l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>i(!o),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:[U?.source==="agent"?l.jsx(cI,{className:"h-4 w-4 text-accent1"}):l.jsx(DU,{className:"h-4 w-4 text-neutral4"}),l.jsxs("span",{className:"flex-1 text-left truncate",children:[U?.name??"Select workspace",U?.source==="agent"&&U.agentName&&l.jsxs("span",{className:"text-neutral4 ml-1",children:["(",U.agentName,")"]})]}),l.jsx(IQt,{className:`h-4 w-4 text-neutral4 transition-transform ${o?"rotate-180":""}`})]}),o&&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(Be=>l.jsxs("button",{onClick:()=>{q(Be.id),i(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${U?.id===Be.id?"bg-surface3":""}`,children:[Be.source==="agent"?l.jsx(cI,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):l.jsx(DU,{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:Be.name}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:Be.source==="agent"?`Agent: ${Be.agentName}`:"Global workspace"})]}),l.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[Be.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"}),Be.capabilities.hasFilesystem&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Be.capabilities.hasSandbox&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Be.capabilities.hasSkills&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Be.id))})]}),E.length===1&&U&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[U.source==="agent"?l.jsx(cI,{className:"h-4 w-4 text-accent1"}):l.jsx(DU,{className:"h-4 w-4"}),l.jsx("span",{children:U.name}),U.source==="agent"&&U.agentName&&l.jsxs("span",{className:"text-neutral3",children:["(",U.agentName,")"]}),je&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&rt&&C&&l.jsx(M7n,{workspaceId:C,canSearchFiles:Pn,canSearchSkills:Et,canBM25:Te,canVector:Se,showInitWarning:!T&&N?.status!=="ready",onViewFileResult:Be=>{D({file:Be,tab:"files"})},onViewSkillResult:Be=>{C&&r(`/workspaces/${C}/skills/${encodeURIComponent(Be)}`)}},C),l.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[me&&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 ${De==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(FD,{className:"h-4 w-4"}),"Files"]}),we&&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 ${De==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(WP,{className:"h-4 w-4"}),"Skills",Bt&&Ke.length>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:Ke.length})]})]}),l.jsxs("div",{className:"pb-8",children:[De==="files"&&me&&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(K5n,{entries:cn,currentPath:G,isLoading:z,error:I,onNavigate:V,onFileSelect:B,onRefresh:()=>Q(),onCreateDirectory:je?void 0:Be=>J.mutate({path:Be,workspaceId:C}),onDelete:je?void 0:Be=>W.mutate({path:Be,recursive:!0,force:!0,workspaceId:C})}),L&&l.jsx(tLn,{path:L,content:ne?.content??"",isLoading:te,mimeType:ne?.mimeType,onClose:()=>B(null)})]})}),De==="skills"&&we&&l.jsx(dLn,{skills:Ke,isLoading:ce,isSkillsConfigured:Bt,hasUndiscoveredAgentSkills:g,basePath:C?`/workspaces/${C}/skills`:"/workspaces",onAddSkill:X?()=>u(!0):void 0,onUpdateSkill:X?ue:void 0,onRemoveSkill:X?ye:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:Ce}),!me&&!we&&l.jsx("div",{className:"py-12 text-center text-neutral4",children:l.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),C&&X&&l.jsx(bLn,{open:c,onOpenChange:u,workspaceId:C,onInstall:Ne,isInstalling:ee.isPending,installedSkillIds:Ke.filter(Be=>Be.skillsShSource).map(Be=>`${Be.skillsShSource.owner}/${Be.skillsShSource.repo}/${Be.name}`),installedSkillNames:Ke.filter(Be=>!Be.skillsShSource).map(Be=>Be.name),writableMounts:fe,installedSkillPaths:Object.fromEntries(Ke.filter(Be=>Be.path).map(Be=>[Be.name,Be.path]))})]})}function M7n({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:s,showInitWarning:a,onViewFileResult:o,onViewSkillResult:i}){const c=SMn(),u=EMn();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(FD,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&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(rLn,{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:s,onViewResult:o})]}),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(WP,{className:"h-4 w-4"}),"Search Skills"]}),l.jsx(aLn,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>i(d.skillName)})]})]})}function $7n(){const{skillName:e,workspaceId:t}=va(),[n]=Pi(),r=e?decodeURIComponent(e):"",s=n.get("agentId"),a=s?decodeURIComponent(s):null,o=a?`/agents/${a}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[i,c]=S.useState(null),{data:u,isLoading:d,error:f}=kMn(r,{workspaceId:t}),{data:p}=ont(u?.path?`${u.path}/SKILL.md`:"",{enabled:!!u?.path,workspaceId:t}),{data:h,isLoading:g}=_Mn(r,i??"",{enabled:!!i,workspaceId:t}),b=y=>a?l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:o,children:[l.jsx(Oe,{children:l.jsx(cI,{className:"h-4 w-4"})}),a]}),l.jsxs(bn,{as:"span",to:"",isCurrent:!0,children:[l.jsx(Oe,{children:l.jsx(WP,{className:"h-4 w-4"})}),y]})]}):l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:o,children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(bn,{as:At,to:o,children:[l.jsx(Oe,{children:l.jsx(WP,{className:"h-4 w-4"})}),"Skills"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:y})]});return d?l.jsxs(on,{children:[l.jsx(_n,{children:b("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"})})]}):f&&ba(f)?l.jsxs(on,{children:[l.jsx(_n,{children:b("Permission Denied")}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"workspaces"})})]}):f||!u?l.jsxs(on,{children:[l.jsx(_n,{children:b("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:f?.message??"Skill not found"})]})})]}):l.jsxs(on,{children:[l.jsxs(_n,{children:[b(r),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"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(mLn,{skill:u,rawSkillMd:p?.content,onReferenceClick:c})})}),l.jsx(gLn,{open:!!i,onOpenChange:y=>!y&&c(null),skillName:r,referencePath:i??"",content:h?.content,isLoading:g})]})}const D7n=[{key:"main",links:[{name:"Agents",url:"/agents",icon:l.jsx(so,{}),isOnMastraPlatform:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:l.jsx(FD,{}),isOnMastraPlatform:!0},{name:"Workflows",url:"/workflows",icon:l.jsx(tl,{}),isOnMastraPlatform:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:l.jsx(LQt,{}),isOnMastraPlatform:!1,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:l.jsx(yu,{}),isOnMastraPlatform:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:l.jsx(Ti,{}),isOnMastraPlatform:!0,requiredPermission:"tools:read"},{name:"Scorers",url:"/scorers",icon:l.jsx(Gh,{}),isOnMastraPlatform:!0,requiredPermission:"scorers:read"},{name:"Workspaces",url:"/workspaces",icon:l.jsx(Hf,{}),isOnMastraPlatform:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:l.jsx(GUe,{}),isOnMastraPlatform:!0}]},{key:"observability",separator:!0,links:[{name:"Observability",url:"/observability",icon:l.jsx(f_,{}),isOnMastraPlatform:!0,requiredPermission:"observability:read"},{name:"Datasets",url:"/datasets",icon:l.jsx(bc,{}),isOnMastraPlatform:!1,requiredPermission:"datasets:read"}]},{key:"Templates",separator:!0,links:[{name:"Templates",url:"/templates",icon:l.jsx(cre,{}),isOnMastraPlatform:!1}]},{key:"Settings",separator:!0,links:[{name:"Settings",url:"/settings",icon:l.jsx(doe,{}),isOnMastraPlatform:!1}]}],L7n={links:[{name:"Mastra APIs",url:"/swagger-ui",icon:l.jsx(VQt,{}),isOnMastraPlatform:!1},{name:"Documentation",url:"https://mastra.ai/en/docs",icon:l.jsx(d_,{}),isOnMastraPlatform:!0},{name:"Github",url:"https://github.com/mastra-ai/mastra",icon:l.jsx(uoe,{}),isOnMastraPlatform:!0},{name:"Community",url:"https://discord.gg/BTYqqHKUrf",icon:l.jsx(nGt,{}),isOnMastraPlatform:!0}]};function F7n(){const{state:e}=ort(),n=Pl().pathname,r=window?.MASTRA_HIDE_CLOUD_CTA==="true",s=window?.MASTRA_TEMPLATES==="true",{isMastraPlatform:a}=mrt(),{data:o}=_1(),{isCmsAvailable:i,isLoading:c}=Db(),{hasPermission:u,hasAnyPermission:d,rbacEnabled:f,isAuthenticated:p,isLoading:h}=kf(),g=o&&yN(o),b=new Set(["/prompts"]),y=x=>b.has(x.url)&&!i&&!c||a&&!x.isOnMastraPlatform?!1:f&&p&&h?!0:!(x.requiredPermission&&!u(x.requiredPermission)||x.requiredAnyPermission&&!d(x.requiredAnyPermission));return l.jsxs(hl,{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(zg,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),g&&l.jsx(lX,{})]}):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(zg,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),l.jsx(lX,{})]}):l.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[l.jsx(zg,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),l.jsx(hl.Nav,{children:D7n.filter(x=>x.key==="Templates"?s:!0).map(x=>{const w=x.links.filter(y),O=w.length>0&&x?.separator;return l.jsxs(hl.NavSection,{children:[x?.title?l.jsx(hl.NavHeader,{state:e,children:x.title}):l.jsx(l.Fragment,{children:O&&l.jsx(hl.NavSeparator,{})}),l.jsx(hl.NavList,{children:w.map(k=>{const E=n.startsWith(k.url);return l.jsx(hl.NavLink,{state:e,link:k,isActive:E},k.name)})})]},x.key)})}),l.jsxs(hl.Bottom,{children:[l.jsx(hl.Nav,{children:l.jsxs(hl.NavSection,{children:[l.jsx(hl.NavSeparator,{}),l.jsxs(hl.NavList,{children:[L7n.links.filter(y).map(x=>l.jsx(hl.NavLink,{link:x,state:e},x.name)),!r&&!a?l.jsx(hl.NavLink,{link:{name:"Share",url:"https://mastra.ai/cloud",icon:l.jsx(MQt,{}),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(hl.NavSeparator,{}),l.jsx(qRn,{collapsed:!1})]})]})]})}const z7n=S.createContext({theme:"dark",setTheme:()=>null}),B7n=e=>e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function oat({children:e,defaultTheme:t="dark"}){const{themeToggleEnabled:n}=Y4(),r=Or(i=>i.theme),s=Or(i=>i.setTheme),o=n?r==="light"||r==="system"?r:"dark":t;return S.useEffect(()=>{const i=window.document.documentElement,c=f=>{const p=B7n(f);i.classList.remove("light","dark"),i.classList.add(p)};if(c(o),o!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>c("system");return u.addEventListener("change",d),()=>{u.removeEventListener("change",d)}},[o]),l.jsx(z7n.Provider,{value:{theme:o,setTheme:s},children:e})}const U7n=({children:e})=>{const{data:t,isFetched:n}=_1(),r=n&&t?.enabled&&!yN(t),s=n&&!r;return l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(b9e,{position:"bottom-right"}),l.jsx(oat,{defaultTheme:"dark",attribute:"class",children:l.jsx(ui,{delayDuration:0,children:l.jsxs(k5n,{children:[l.jsx(vLn,{}),l.jsxs("div",{className:s?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[s&&l.jsx(F7n,{}),l.jsx("div",{className:`bg-surface2 my-3 rounded-lg border border-border1 overflow-y-auto ${r?"h-[calc(100%-1.5rem)] mx-3":"mr-3"}`,children:l.jsx(ott,{children:e})})]})]})})})]})},V7n=({children:e})=>l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(b9e,{position:"bottom-right"}),l.jsx(oat,{defaultTheme:"dark",attribute:"class",children:l.jsx(ui,{delayDuration:0,children:l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx(ott,{children:e})})})})]});function q7n({agentId:e}){const{isCmsAvailable:t}=Db();return l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/agents",children:[l.jsx(Oe,{children:l.jsx(so,{})}),"Agents"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(mPn,{value:e,variant:"ghost",showSourceIcon:t})})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Agents documentation"]})})]})}const H7n=({children:e})=>{const{agentId:t}=va(),n=Pl(),{isCmsAvailable:r}=Db(),s=eK.has("datasets"),a=r&&s,o=n.pathname.includes("/playground")?"playground":n.pathname.includes("/traces")?"traces":"chat";return l.jsxs(on,{className:"grid-rows-[auto_auto_1fr]",children:[l.jsx(q7n,{agentId:t}),l.jsx(C$n,{agentId:t,activeTab:o,showPlayground:a}),e]})};function Q7n(){const{data:e={},isLoading:t,error:n}=Doe(),r=!t&&Object.keys(e).length===0;return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Zy,{})}),"Processors"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Processors documentation"]})})]}),l.jsx(Va,{isCentered:r,children:l.jsx(lDn,{processors:e,isLoading:t,error:n})})]})}function G7n(){const{processorId:e}=va(),{data:t,isLoading:n,error:r}=qnt(e);return r&&ba(r)?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/processors",children:[l.jsx(Oe,{children:l.jsx(Zy,{})}),"Processors"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"processors"})})]}):!n&&t?.isWorkflow?l.jsx(l9n,{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(Na,{children:[l.jsxs(bn,{as:At,to:"/processors",children:[l.jsx(Oe,{children:l.jsx(Zy,{})}),"Processors"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(On,{className:"h-6 w-32"})})]})}),l.jsxs("div",{className:"p-6",children:[l.jsx(On,{className:"h-8 w-48 mb-4"}),l.jsx(On,{className:"h-32 w-full"})]})]}):l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/processors",children:[l.jsx(Oe,{children:l.jsx(Zy,{})}),"Processors"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(gDn,{value:e,variant:"ghost"})})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Processors documentation"]})})]}),l.jsx(pDn,{processorId:e})]})}function W7n(){const{data:e={},isLoading:t}=_f(),{data:n={},isLoading:r,error:s}=r3(),a=Object.keys(n).length>0,o=Object.values(e).some(c=>c.tools&&Object.keys(c.tools).length>0),i=!r&&!t&&!a&&!o;return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Ti,{})}),"Tools"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Tools documentation"]})})]}),l.jsx(Va,{isCentered:i,children:l.jsx(xDn,{tools:n,agents:e,isLoading:t||r,error:s})})]})}const iat={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${t}?agentId=${encodeURIComponent(e)}`:"/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/${yo()}`,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)=>t?`/workspaces/${t}/skills/${e}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t)=>t?`/workspaces/${t}/skills/${e}`:"/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}`},Z7n=()=>{const e=Ml(),t=n=>e(n,{viewTransition:!0});return l.jsx(CJe,{Link:rat,navigate:t,paths:iat,children:l.jsx(U7n,{children:l.jsx(jS,{})})})},Y7n=()=>{const e=Ml(),t=n=>e(n,{viewTransition:!0});return l.jsx(CJe,{Link:rat,navigate:t,paths:iat,children:l.jsx(V7n,{children:l.jsx(jS,{})})})},X7n=!!window.MASTRA_CLOUD_API_ENDPOINT,_je=eK.has("datasets"),Eje=[{index:!0,element:l.jsx(Tzn,{})},{path:"instruction-blocks",element:l.jsx(Nzn,{})},{path:"tools",element:l.jsx(Izn,{})},{path:"agents",element:l.jsx(_zn,{})},{path:"scorers",element:l.jsx(jzn,{})},{path:"workflows",element:l.jsx(Mzn,{})},{path:"skills",element:l.jsx(Rzn,{})},{path:"memory",element:l.jsx(Azn,{})},{path:"variables",element:l.jsx(Pzn,{})}],K7n=[{path:"/login",element:l.jsx(Kzn,{})},{path:"/signup",element:l.jsx(g7n,{})},{element:l.jsx(Y7n,{}),children:[{path:"/agents/:agentId/session",element:l.jsx(mje,{})},{path:"/agents/:agentId/session/:threadId",element:l.jsx(mje,{})}]},{element:l.jsx(Z7n,{}),children:[...X7n?[]:[{path:"/settings",element:l.jsx(m7n,{})},{path:"/templates",element:l.jsx(N7n,{})},{path:"/templates/:templateSlug",element:l.jsx(j7n,{})}],{path:"/scorers",element:l.jsx(d7n,{})},{path:"/scorers/:scorerId",element:l.jsx(f7n,{})},{path:"/observability",element:l.jsx(l7n,{})},{path:"/agents",element:l.jsx(xzn,{})},{path:"/cms/agents/create",element:l.jsx(Ezn,{}),children:Eje},{path:"/cms/agents/:agentId/edit",element:l.jsx(Czn,{}),children:Eje},{path:"/cms/scorers/create",element:l.jsx(Fzn,{})},{path:"/cms/scorers/:scorerId/edit",element:l.jsx(Bzn,{})},{path:"/prompts",element:l.jsx(c7n,{})},{path:"/cms/prompts/create",element:l.jsx($zn,{})},{path:"/cms/prompts/:promptBlockId/edit",element:l.jsx(Lzn,{})},{path:"/agents/:agentId/tools/:toolId",element:l.jsx(R7n,{})},{path:"/agents/:agentId",element:l.jsx(H7n,{children:l.jsx(jS,{})}),children:[{index:!0,loader:({params:e})=>xQ(`/agents/${e.agentId}/chat`)},{path:"chat",element:l.jsx(hje,{})},{path:"chat/:threadId",element:l.jsx(hje,{})},..._je?[{path:"playground",element:l.jsx(Ozn,{})}]:[],{path:"traces",element:l.jsx(kzn,{})}]},{path:"/tools",element:l.jsx(W7n,{})},{path:"/tools/:toolId",element:l.jsx(I7n,{})},{path:"/processors",element:l.jsx(Q7n,{})},{path:"/processors/:processorId",element:l.jsx(G7n,{})},{path:"/mcps",element:l.jsx(Jzn,{})},{path:"/mcps/:serverId",element:l.jsx(e7n,{})},{path:"/mcps/:serverId/tools/:toolId",element:l.jsx(t7n,{})},{path:"/workspaces",element:l.jsx(kje,{})},{path:"/workspaces/:workspaceId",element:l.jsx(kje,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:l.jsx($7n,{})},{path:"/workflows",element:l.jsx(P7n,{})},{path:"/workflows/:workflowId",element:l.jsx(G9n,{children:l.jsx(jS,{})}),children:[{index:!0,loader:({params:e})=>xQ(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:l.jsx(Oje,{})},{path:"graph/:runId",element:l.jsx(Oje,{})}]},..._je?[{path:"/datasets",element:l.jsx(Uzn,{})},{path:"/datasets/:datasetId",element:l.jsx(Vzn,{})},{path:"/datasets/:datasetId/items/:itemId",element:l.jsx(Qzn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:l.jsx(Zzn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:l.jsx(qzn,{})},{path:"/datasets/:datasetId/experiments",element:l.jsx(Hzn,{})},{path:"/datasets/:datasetId/items",element:l.jsx(Gzn,{})},{path:"/datasets/:datasetId/versions",element:l.jsx(Xzn,{})}]:[],{index:!0,loader:()=>xQ("/agents")},{path:"/request-context",element:l.jsx(u7n,{})}]}];function J7n(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:s}=Y4();if(s)return null;if(!t)return l.jsx(GRn,{});const a=P9n(K7n,{basename:e});return l.jsx(yWt,{baseUrl:t,headers:n,apiPrefix:r,children:l.jsx(yzn,{children:l.jsx(a9n,{router:a})})})}function eBn(){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",s=window.MASTRA_CLOUD_API_ENDPOINT||"",a=window.MASTRA_AUTO_DETECT_URL==="true",o=window.MASTRA_THEME_TOGGLE==="true",i=s||(a?window.location.origin:`${e}://${t}:${n}`);return l.jsx(P5n,{children:l.jsx(LRn,{endpoint:i,defaultApiPrefix:r,themeToggleEnabled:o,children:l.jsx(J7n,{})})})}yit.createRoot(document.getElementById("root")).render(l.jsx(S.StrictMode,{children:l.jsx(eBn,{})}));const tUn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Y4e as A,BLe as B,K4e as C,z5e as D,xu as E,ad as F,ZBn as G,$hn as H,js as I,tUn as J,dv as L,Z4e as N,S4 as _,Owt as a,Fwt as b,rBn as c,Vfe as d,pv as e,Mwt as f,dw as g,Lwt as h,nx as i,rx as j,tx as k,b3t as l,G5e as m,iv as n,Qs as o,R4t as p,j4t as q,Tee as r,CJ as s,le as t,oP as u,Ql as v,Twt as w,ct as x,Ze as y,u6e as z};
|
|
476
|
+
`).reduce((i,c)=>{if(!c||c.startsWith("#"))return i;const[u,d]=c.split("=");return u&&(i[u]=d?.split("")?.every(f=>f==="*")?"":d?.replaceAll('"',"")),i},{}):{}}const x7n=()=>Qt({queryKey:["mastra-templates"],queryFn:sat}),w7n=({repoOrSlug:e,owner:t})=>Qt({queryKey:["template-repo",e,t],queryFn:()=>y7n({repoOrSlug:e,owner:t})}),S7n=({repo:e,owner:t,branch:n})=>Qt({queryKey:["template-repo-env-vars",e,t,n],queryFn:()=>v7n({repo:e,owner:t,branch:n})}),O7n=()=>{const e=Xe();return Qt({queryKey:["agent-builder-workflow"],queryFn:async()=>await e.getAgentBuilderAction("merge-template").details()})},k7n=()=>{const e=Xe();return qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").createRun({runId:t})})},_7n=()=>{const e=Xe();return qn({mutationFn:async({runId:t})=>await e.getAgentBuilderAction("merge-template").runById(t)})},wje=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)},Sje=(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((a,o)=>(a[o]={id:o,description:n.allSteps[o].description,status:"pending"},a),{})}}),e.type==="start"||e.type==="workflow-start"){const a={};n?.allSteps&&Object.entries(n.allSteps).forEach(([i,c])=>{a[i]={id:c.id,description:c.description,status:"pending"}});const o=e.runId||e.payload?.runId;r={...r,runId:o,eventTimestamp:new Date().toISOString(),status:"running",phase:"initializing",payload:{workflowState:{status:"running",steps:a},currentStep:null}}}if(e.type==="step-start"||e.type==="workflow-step-start"){const a=e.payload.id;r={...r,phase:"processing",payload:{...r.payload,currentStep:{id:a,status:"running",startTime:new Date,...e.payload},workflowState:{...r.payload.workflowState,steps:{...r.payload.workflowState.steps,[a]:{...r.payload.workflowState.steps[a],status:"running",startTime:new Date,...e.payload}}}}}}if(e.type==="step-result"||e.type==="workflow-step-result"){const a=e.payload.id,o=e.payload.status,i=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,[a]:{...r.payload.workflowState.steps[a],status:e.payload.status,output:e.payload.output,error:e.payload.error,endTime:new Date}}}}},o==="failed"&&i){const c=wje(i);r={...r,status:"failed",error:c,phase:"error",failedStep:{id:a,error:c,description:e.payload.description||a},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 a=wje(e.payload.error);r={...r,status:"failed",error:a,phase:"error",payload:{...r.payload,workflowState:{...r.payload.workflowState,status:"failed"}},errorTimestamp:new Date}}return{newState:r}},E7n=(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)}},aat=(e,t)=>{const[n,r]=S.useState({}),[s,a]=S.useState(!1);return{streamResult:n,isStreaming:s,processStream:async(i,c)=>{if(a(!0),r({}),!i)throw new Error("No stream returned");const u=i.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}=Sje(p,d,e);if(d=h,r(h),p.runId||c||t){const g=p.runId||c||t;E7n(g,h)}}}catch(f){console.error("💥 [processStream] Error processing template installation stream:",f);const{newState:p}=Sje({type:"error",payload:{error:f instanceof Error?f.message:"Unknown error"}},d,e);r(p)}finally{a(!1),u.releaseLock()}}}},C7n=e=>{const t=Xe(),{streamResult:n,isStreaming:r,processStream:s}=aat(e);return{streamInstall:qn({mutationFn:async({inputData:o,selectedModel:i,runId:c})=>{for(let d=1;d<=3;d++)try{const f=t.getAgentBuilderAction("merge-template"),p=new hT;p.set("selectedModel",i);const h=await f.stream({inputData:o,requestContext:p},c);await s(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}},T7n=e=>{const t=Xe(),{streamResult:n,isStreaming:r,processStream:s}=aat(e);return{observeInstall:qn({mutationFn:async({runId:o})=>{for(let u=1;u<=3;u++)try{const f=await t.getAgentBuilderAction("merge-template").observeStream({runId:o});await s(f,o);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 N7n(){const{data:e,isLoading:t}=x7n(),{templates:n,tags:r,providers:s}=e??{templates:[],tags:[],providers:[]},[a,o]=S.useState("all"),[i,c]=S.useState("all"),[u,d]=S.useState(""),f=[{value:"all",label:"Any tag"}];(r||[]).forEach(w=>{f.push({value:w,label:w})});const p=[{value:"all",label:"Any provider"}];(s||[]).forEach(w=>{p.push({value:w,label:w})});const h=(w,O)=>{O==="tag"?o(w):O==="provider"&&c(w)},g=w=>{d(w)},b=()=>{o("all"),c("all"),d("")},y=n.filter(w=>!(u&&!w.title.toLowerCase().includes(u)&&!w.description.toLowerCase().includes(u)||a!=="all"&&!w.tags.includes(a)||i!=="all"&&!w.supportedProviders.includes(i))),x=u||a!=="all"||i!=="all";return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(cre,{})}),"Templates"]})}),l.jsxs("div",{className:K("overflow-y-auto w-full h-full px-8 pb-12 z-10"),children:[l.jsx(EDn,{selectedTag:a,onTagChange:w=>h(w,"tag"),tagOptions:f,selectedProvider:i,onProviderChange:w=>h(w,"provider"),providerOptions:p,searchTerm:u,onSearchChange:g,onReset:x?b:void 0,className:"max-w-[80rem]",isLoading:t}),l.jsx(TDn,{templates:y,linkComponent:At,className:"max-w-[80rem] mx-auto",isLoading:t})]})]})}const A7n="1.15.0-alpha.4";function j7n(){const{templateSlug:e}=va(),[t,n]=Pi(),[r,s]=S.useState(""),[a,o]=S.useState(""),[i,c]=S.useState(""),[u,d]=S.useState({}),[f,p]=S.useState([]),[h,g]=S.useState(null),[b,y]=S.useState(!1),[x,w]=S.useState(""),[O,k]=S.useState(!1),[E,C]=S.useState(!1),[N,T]=S.useState([]),{data:j,isLoading:R}=w7n({repoOrSlug:e,owner:"mastra-ai"}),M=A7n?.includes("beta")??!1?"beta":"main",{data:U,isLoading:D}=S7n({repo:j?.githubUrl?new URL(j.githubUrl).pathname.split("/")[2]:`template-${e}`,owner:"mastra-ai",branch:M}),{data:q,isLoading:V}=O7n(),{mutateAsync:B,isPending:H}=k7n(),{mutateAsync:G}=_7n(),{streamInstall:L,streamResult:Z,isStreaming:z}=C7n(q),{observeInstall:I,streamResult:Q,isStreaming:W}=T7n(q);S.useEffect(()=>{const re=t.get("runId");re&&!b&&!h&&!z&&!W&&(console.info("🔄 Checking completed run after hot reload:",{runId:re}),w(re),G({runId:re}).then(ie=>{const ge=ie.snapshot;if(ge?.status==="success"&&ge?.result?.success)y(!0);else if(ge?.result?.success===!1)if(ge?.result?.validationResults&&!ge?.result?.validationResults?.valid&&ge?.result?.validationResults?.remainingErrors>0){const{remainingErrors:we,errors:Te}=ge.result.validationResults,Se=`Template installation completed but ${we} validation issue${we>1?"s":""} remain unresolved.`;g(Se),T(Te||[])}else{const we=ge?.result?.message||ge?.result?.error||"Template installation failed";g(typeof we=="string"?we:String(we))}}).catch(ie=>{console.error("❌ Failed to fetch run details:",ie),g("Failed to retrieve installation status after reload")}))},[t,b,h,z,W,G]),S.useEffect(()=>{const re=t.get("runId"),ie=t.get("resume"),ge=t.get("provider");if(re&&ie==="true"&&ge&&!z&&!W&&!O&&!E&&q){w(re),k(!0);try{G({runId:re}).then(me=>{if(me.snapshot?.status==="running")return I.mutateAsync({runId:re})}).then(()=>{n(me=>{const we=new URLSearchParams(me);return we.delete("resume"),we})}).catch(me=>{console.error("❌ Failed to resume template installation:",me),me.message?.includes("404")||me.message?.includes("not found")?g("Template installation run not found. It may have expired or been completed."):g("Failed to resume template installation. Please try again.")})}catch(me){console.error("❌ Auto-resume failed with error:",me),g("Failed to resume template installation. Please refresh and try again.")}}},[t,e,z,W,O,E,q,G,I,n]);const J=[{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"google",label:"Google"}],ne=[{key:"tools",label:"Tools",value:j?.tools?.length?j.tools.map(re=>re).join(", "):"n/a",icon:l.jsx(Ti,{})},{key:"agents",label:"Agents",value:j?.agents?.length?j.agents.map(re=>re).join(", "):"n/a",icon:l.jsx(so,{})},{key:"workflows",label:"Workflows",value:j?.workflows?.length?j.workflows.map(re=>re).join(", "):"n/a",icon:l.jsx(kGt,{})},{key:"providers",label:"Providers",value:j?.supportedProviders?.length?j.supportedProviders.join(", "):"n/a",icon:l.jsx(TQt,{})},{key:"tags",label:"Tags",value:j?.tags?.length?j.tags.join(", "):"n/a",icon:l.jsx(yGt,{})}],te=[{...ne[0]},{...ne[1]},{...ne[2]}].filter(re=>re.value!=="n/a");S.useEffect(()=>{U&&d(U)},[U]),S.useEffect(()=>{const re=Z||Q;re?.phase==="error"&&re?.error&&g(typeof re.error=="string"?re.error:String(re.error))},[Z?.phase,Z?.error,Q?.phase,Q?.error]);const ae=re=>{s(re)},ce=async re=>(o(re.provider),c(re.modelId),{message:"Model updated successfully"}),ve=async()=>{const re=Object.entries(u).reduce((ie,[ge,me])=>(me===""&&ie.push(ge),ie),[]);if(re.length>0){p(re);return}if(j){g(null),y(!1),w(""),C(!0);try{const ge={repo:j.githubUrl||`https://github.com/mastra-ai/template-${j.slug}`,ref:M,slug:j.slug,variables:u},{runId:me}=await B({});w(me),n(we=>{const Te=new URLSearchParams(we);return Te.set("runId",me),Te.set("resume","true"),Te.set("provider",r||"openai"),Te}),await L.mutateAsync({inputData:ge,selectedModel:{provider:a,modelId:i},runId:me})}catch(ie){C(!1),g(ie?.message||"Template installation failed"),console.error("Template installation failed",ie)}}},ee=re=>{const{name:ie,value:ge}=re.target;ge.trim()===""?p(me=>[...me,ie]):p(me=>me.filter(we=>we!==ie)),d(me=>({...me,[ie]:ge}))};return l.jsxs(on,{children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/templates",children:[l.jsx(Oe,{children:l.jsx(cre,{})}),"Templates"]}),l.jsx(bn,{as:At,to:`/templates/${j?.slug}`,isCurrent:!0,children:j?.title&&j.title})]})}),l.jsx("div",{className:K("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(NDn,{isLoading:R,title:j?.title,description:j?.longDescription,imageURL:j?.imageURL,githubUrl:j?.githubUrl,infoData:ne,templateSlug:e}),j&&l.jsxs(l.Fragment,{children:[(z||W)&&l.jsx(MDn,{name:j.title,streamResult:W?Q:Z,runId:x,workflowInfo:q}),b&&l.jsx($Dn,{name:j.title,installedEntities:te,linkComponent:At}),h&&l.jsx(DDn,{errorMsg:h,validationErrors:N.length>0?N:Z?.validationResults?.errors||Q?.validationResults?.errors}),!z&&!W&&!b&&!h&&l.jsx(ADn,{providerOptions:J,selectedProvider:r,onProviderChange:ae,variables:u,setVariables:d,errors:f,setErrors:p,handleInstallTemplate:ve,handleVariableChange:ee,isLoadingEnvVars:D||V,isInstalling:H,defaultModelProvider:a,defaultModelId:i,onModelUpdate:ce})]})]})})]})}const R7n=()=>{const{toolId:e,agentId:t}=va();return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/agents",children:[l.jsx(Oe,{children:l.jsx(so,{})}),"Agents"]}),l.jsx(bn,{as:At,to:`/agents/${t}/chat`,children:t}),l.jsx(bn,{as:At,to:`/tools/${t}/${e}`,isCurrent:!0,children:e})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"Tools documentation"]})})]}),l.jsx(xPn,{toolId:e,agentId:t})]})},I7n=()=>{const{toolId:e}=va();return l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/tools",children:[l.jsx(Oe,{children:l.jsx(Ti,{})}),"Tools"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(_Dn,{value:e,variant:"ghost"})})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Tools documentation"]})})]}),l.jsx(kDn,{toolId:e})]})};function P7n(){const{data:e,isLoading:t,error:n}=xm(),r=!t&&Object.keys(e||{}).length===0;return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(tl,{})}),"Workflows"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workflows/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Workflows documentation"]})})]}),l.jsx(Va,{isCentered:r,children:l.jsx(uAn,{workflows:e||{},isLoading:t,error:n})})]})}const Oje=()=>{const{workflowId:e}=va(),{data:t,isLoading:n,error:r}=pN(e);return r&&ba(r)?l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"workflows"})}):l.jsx(GJe,{workflowId:e,workflow:t??void 0,isLoading:n})};function kje(){const{workspaceId:e}=va(),[t,n]=Pi(),r=Ml(),[s,a]=S.useState(!1),[o,i]=S.useState(!1),[c,u]=S.useState(!1),[d,f]=S.useState(null),[p,h]=S.useState(null),[g,b]=S.useState(!1),y=t.get("file"),x=t.get("tab"),{data:w,error:O,isLoading:k}=ant(),E=w?.workspaces??[],C=e??E[0]?.id,{data:N,isLoading:T,error:j}=bMn(C),R=ba(O)||ba(j),P=t.get("path")||".",M=MY(O)||MY(j),U=C?E.find(Be=>Be.id===C):void 0,D=Be=>{const et=new URLSearchParams(t);for(const[bt,Pt]of Object.entries(Be))Pt===null?et.delete(bt):et.set(bt,Pt);n(et)},q=Be=>{b(!1),a(!1),r(`/workspaces/${Be}`)},V=Be=>{D({path:Be==="."||Be===""?null:Be,file:null})},B=Be=>{D({file:Be})},H=Be=>{D({tab:Be})},G=P,L=y,{data:Z,isLoading:z,error:I,refetch:Q}=yMn(G,{enabled:N?.isWorkspaceConfigured&&N?.capabilities?.hasFilesystem,workspaceId:C}),W=xMn(),J=wMn(),{data:ne,isLoading:te}=ont(L??"",{enabled:!!L,workspaceId:C}),{data:ae,isLoading:ce,refetch:ve}=OMn({workspaceId:C}),ee=AMn(),re=jMn(),ie=RMn(),ge=N?.isWorkspaceConfigured??!1,me=N?.capabilities?.hasFilesystem??!1,we=N?.capabilities?.hasSkills??!1,Te=N?.capabilities?.canBM25??!1,Se=N?.capabilities?.canVector??!1,je=U?.safety?.readOnly??!1,X=me&&!je,se=N?.mounts,fe=se?.filter(Be=>!Be.readOnly).map(Be=>({path:Be.path,displayName:Be.displayName,icon:Be.icon,provider:Be.provider,name:Be.name})),Ce=se&&se.length>1?se.map(Be=>Be.path):void 0,Ne=S.useCallback(Be=>{C&&ee.mutate({...Be,workspaceId:C},{onSuccess:async et=>{if(et.success){u(!1);const{data:bt,error:Pt}=await ve();if(Pt||!bt){qe.success(`Skill "${et.skillName}" installed successfully (${et.filesWritten} files)`);return}bt.skills.some(Ct=>Ct.name===et.skillName)?qe.success(`Skill "${et.skillName}" installed successfully (${et.filesWritten} files)`):(b(!0),qe.warning(`Skill "${et.skillName}" installed to .agents/skills but not discovered. Add .agents/skills to your workspace skills paths.`))}else qe.error("Failed to install skill")},onError:et=>{qe.error(`Failed to install skill: ${et instanceof Error?et.message:"Unknown error"}`)}})},[C,ee,ve]),ue=S.useCallback(Be=>{C&&(h(Be),re.mutate({workspaceId:C,skillName:Be},{onSuccess:et=>{if(h(null),et.updated.length>0){const bt=et.updated[0];bt.success?(qe.success(`Skill "${Be}" updated successfully (${bt.filesWritten} files)`),ve()):qe.error(`Failed to update skill: ${bt.error??"Unknown error"}`)}else qe.error("Failed to update skill: No update result returned")},onError:et=>{h(null),qe.error(`Failed to update skill: ${et instanceof Error?et.message:"Unknown error"}`)}}))},[C,re,ve]),ye=S.useCallback(Be=>{C&&(f(Be),ie.mutate({workspaceId:C,skillName:Be},{onSuccess:et=>{f(null),et.success?(qe.success(`Skill "${et.skillName}" removed successfully`),ve()):qe.error(`Failed to remove skill "${et.skillName}"`)},onError:et=>{f(null),qe.error(`Failed to remove skill: ${et instanceof Error?et.message:"Unknown error"}`)}}))},[C,ie,ve]),De=x==="files"&&me?"files":x==="skills"&&we?"skills":me?"files":we?"skills":"files",Ke=ae?.skills??[],Bt=ae?.isSkillsConfigured??!1,cn=Z?.entries??[],Pn=me&&(Te||Se),Et=we&&Bt&&Ke.length>0,rt=Pn||Et;return R?l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"workspaces"})})]}):M?l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"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(C_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Hf,{})}),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(gZ,{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:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"Learn More"]})]})]})})]}):k?l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"Workspaces documentation"]})})]}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(jn,{})})]}):!T&&!k&&!ge?l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"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(C_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Hf,{})}),l.jsx(nLn,{})]})})]}):l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(gs,{children:[rt&&l.jsxs(he,{variant:"light",onClick:()=>a(!s),children:[l.jsx(Oe,{children:l.jsx(mGt,{className:"h-4 w-4"})}),"Search"]}),l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"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(C_,{title:"Workspace",description:"Manage files, skills, and search your workspace",icon:l.jsx(Hf,{})}),E.length>1&&l.jsxs("div",{className:"relative",children:[l.jsxs("button",{onClick:()=>i(!o),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:[U?.source==="agent"?l.jsx(cI,{className:"h-4 w-4 text-accent1"}):l.jsx(DU,{className:"h-4 w-4 text-neutral4"}),l.jsxs("span",{className:"flex-1 text-left truncate",children:[U?.name??"Select workspace",U?.source==="agent"&&U.agentName&&l.jsxs("span",{className:"text-neutral4 ml-1",children:["(",U.agentName,")"]})]}),l.jsx(IQt,{className:`h-4 w-4 text-neutral4 transition-transform ${o?"rotate-180":""}`})]}),o&&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(Be=>l.jsxs("button",{onClick:()=>{q(Be.id),i(!1)},className:`flex items-center gap-3 px-3 py-2 w-full text-left hover:bg-surface3 transition-colors ${U?.id===Be.id?"bg-surface3":""}`,children:[Be.source==="agent"?l.jsx(cI,{className:"h-4 w-4 text-accent1 flex-shrink-0"}):l.jsx(DU,{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:Be.name}),l.jsx("div",{className:"text-xs text-neutral4 truncate",children:Be.source==="agent"?`Agent: ${Be.agentName}`:"Global workspace"})]}),l.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[Be.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"}),Be.capabilities.hasFilesystem&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"FS"}),Be.capabilities.hasSandbox&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Sandbox"}),Be.capabilities.hasSkills&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:"Skills"})]})]},Be.id))})]}),E.length===1&&U&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-neutral4",children:[U.source==="agent"?l.jsx(cI,{className:"h-4 w-4 text-accent1"}):l.jsx(DU,{className:"h-4 w-4"}),l.jsx("span",{children:U.name}),U.source==="agent"&&U.agentName&&l.jsxs("span",{className:"text-neutral3",children:["(",U.agentName,")"]}),je&&l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-400",children:"Read-only"})]}),s&&rt&&C&&l.jsx(M7n,{workspaceId:C,canSearchFiles:Pn,canSearchSkills:Et,canBM25:Te,canVector:Se,showInitWarning:!T&&N?.status!=="ready",onViewFileResult:Be=>{D({file:Be,tab:"files"})},onViewSkillResult:Be=>{C&&r(`/workspaces/${C}/skills/${encodeURIComponent(Be)}`)}},C),l.jsxs("div",{className:"flex gap-2 border-b border-border1",children:[me&&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 ${De==="files"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(FD,{className:"h-4 w-4"}),"Files"]}),we&&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 ${De==="skills"?"border-accent1 text-neutral6":"border-transparent text-neutral4 hover:text-neutral5"}`,children:[l.jsx(WP,{className:"h-4 w-4"}),"Skills",Bt&&Ke.length>0&&l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-surface4 text-neutral4",children:Ke.length})]})]}),l.jsxs("div",{className:"pb-8",children:[De==="files"&&me&&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(K5n,{entries:cn,currentPath:G,isLoading:z,error:I,onNavigate:V,onFileSelect:B,onRefresh:()=>Q(),onCreateDirectory:je?void 0:Be=>J.mutate({path:Be,workspaceId:C}),onDelete:je?void 0:Be=>W.mutate({path:Be,recursive:!0,force:!0,workspaceId:C})}),L&&l.jsx(tLn,{path:L,content:ne?.content??"",isLoading:te,mimeType:ne?.mimeType,onClose:()=>B(null)})]})}),De==="skills"&&we&&l.jsx(dLn,{skills:Ke,isLoading:ce,isSkillsConfigured:Bt,hasUndiscoveredAgentSkills:g,basePath:C?`/workspaces/${C}/skills`:"/workspaces",onAddSkill:X?()=>u(!0):void 0,onUpdateSkill:X?ue:void 0,onRemoveSkill:X?ye:void 0,updatingSkillName:p??void 0,removingSkillName:d??void 0,mountPaths:Ce}),!me&&!we&&l.jsx("div",{className:"py-12 text-center text-neutral4",children:l.jsx("p",{children:"No workspace capabilities are configured."})})]})]})}),C&&X&&l.jsx(bLn,{open:c,onOpenChange:u,workspaceId:C,onInstall:Ne,isInstalling:ee.isPending,installedSkillIds:Ke.filter(Be=>Be.skillsShSource).map(Be=>`${Be.skillsShSource.owner}/${Be.skillsShSource.repo}/${Be.name}`),installedSkillNames:Ke.filter(Be=>!Be.skillsShSource).map(Be=>Be.name),writableMounts:fe,installedSkillPaths:Object.fromEntries(Ke.filter(Be=>Be.path).map(Be=>[Be.name,Be.path]))})]})}function M7n({workspaceId:e,canSearchFiles:t,canSearchSkills:n,canBM25:r,canVector:s,showInitWarning:a,onViewFileResult:o,onViewSkillResult:i}){const c=SMn(),u=EMn();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(FD,{className:"h-4 w-4"}),"Search Indexed Files"]}),a&&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(rLn,{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:s,onViewResult:o})]}),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(WP,{className:"h-4 w-4"}),"Search Skills"]}),l.jsx(aLn,{onSearch:d=>u.mutate({...d,workspaceId:e}),results:u.data?.results??[],isSearching:u.isPending,onResultClick:d=>i(d.skillName)})]})]})}function $7n(){const{skillName:e,workspaceId:t}=va(),[n]=Pi(),r=e?decodeURIComponent(e):"",s=n.get("agentId"),a=s?decodeURIComponent(s):null,o=a?`/agents/${a}`:t?`/workspaces/${t}?tab=skills`:"/workspaces",[i,c]=S.useState(null),{data:u,isLoading:d,error:f}=kMn(r,{workspaceId:t}),{data:p}=ont(u?.path?`${u.path}/SKILL.md`:"",{enabled:!!u?.path,workspaceId:t}),{data:h,isLoading:g}=_Mn(r,i??"",{enabled:!!i,workspaceId:t}),b=y=>a?l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:o,children:[l.jsx(Oe,{children:l.jsx(cI,{className:"h-4 w-4"})}),a]}),l.jsxs(bn,{as:"span",to:"",isCurrent:!0,children:[l.jsx(Oe,{children:l.jsx(WP,{className:"h-4 w-4"})}),y]})]}):l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:o,children:[l.jsx(Oe,{children:l.jsx(Hf,{className:"h-4 w-4"})}),"Workspace"]}),l.jsxs(bn,{as:At,to:o,children:[l.jsx(Oe,{children:l.jsx(WP,{className:"h-4 w-4"})}),"Skills"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:y})]});return d?l.jsxs(on,{children:[l.jsx(_n,{children:b("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"})})]}):f&&ba(f)?l.jsxs(on,{children:[l.jsx(_n,{children:b("Permission Denied")}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"workspaces"})})]}):f||!u?l.jsxs(on,{children:[l.jsx(_n,{children:b("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:f?.message??"Skill not found"})]})})]}):l.jsxs(on,{children:[l.jsxs(_n,{children:[b(r),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/workspace/skills",target:"_blank",children:[l.jsx(Oe,{children:l.jsx(_a,{})}),"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(mLn,{skill:u,rawSkillMd:p?.content,onReferenceClick:c})})}),l.jsx(gLn,{open:!!i,onOpenChange:y=>!y&&c(null),skillName:r,referencePath:i??"",content:h?.content,isLoading:g})]})}const D7n=[{key:"main",links:[{name:"Agents",url:"/agents",icon:l.jsx(so,{}),isOnMastraPlatform:!0,requiredPermission:"agents:read"},{name:"Prompts",url:"/prompts",icon:l.jsx(FD,{}),isOnMastraPlatform:!0},{name:"Workflows",url:"/workflows",icon:l.jsx(tl,{}),isOnMastraPlatform:!0,requiredPermission:"workflows:read"},{name:"Processors",url:"/processors",icon:l.jsx(LQt,{}),isOnMastraPlatform:!1,requiredPermission:"processors:read"},{name:"MCP Servers",url:"/mcps",icon:l.jsx(yu,{}),isOnMastraPlatform:!0,requiredPermission:"mcps:read"},{name:"Tools",url:"/tools",icon:l.jsx(Ti,{}),isOnMastraPlatform:!0,requiredPermission:"tools:read"},{name:"Scorers",url:"/scorers",icon:l.jsx(Gh,{}),isOnMastraPlatform:!0,requiredPermission:"scorers:read"},{name:"Workspaces",url:"/workspaces",icon:l.jsx(Hf,{}),isOnMastraPlatform:!0,requiredPermission:"workspaces:read"},{name:"Request Context",url:"/request-context",icon:l.jsx(GUe,{}),isOnMastraPlatform:!0}]},{key:"observability",separator:!0,links:[{name:"Observability",url:"/observability",icon:l.jsx(f_,{}),isOnMastraPlatform:!0,requiredPermission:"observability:read"},{name:"Datasets",url:"/datasets",icon:l.jsx(bc,{}),isOnMastraPlatform:!1,requiredPermission:"datasets:read"}]},{key:"Templates",separator:!0,links:[{name:"Templates",url:"/templates",icon:l.jsx(cre,{}),isOnMastraPlatform:!1}]},{key:"Settings",separator:!0,links:[{name:"Settings",url:"/settings",icon:l.jsx(doe,{}),isOnMastraPlatform:!1}]}],L7n={links:[{name:"Mastra APIs",url:"/swagger-ui",icon:l.jsx(VQt,{}),isOnMastraPlatform:!1},{name:"Documentation",url:"https://mastra.ai/en/docs",icon:l.jsx(d_,{}),isOnMastraPlatform:!0},{name:"Github",url:"https://github.com/mastra-ai/mastra",icon:l.jsx(uoe,{}),isOnMastraPlatform:!0},{name:"Community",url:"https://discord.gg/BTYqqHKUrf",icon:l.jsx(nGt,{}),isOnMastraPlatform:!0}]};function F7n(){const{state:e}=ort(),n=Pl().pathname,r=window?.MASTRA_HIDE_CLOUD_CTA==="true",s=window?.MASTRA_TEMPLATES==="true",{isMastraPlatform:a}=mrt(),{data:o}=_1(),{isCmsAvailable:i,isLoading:c}=Db(),{hasPermission:u,hasAnyPermission:d,rbacEnabled:f,isAuthenticated:p,isLoading:h}=kf(),g=o&&yN(o),b=new Set(["/prompts"]),y=x=>b.has(x.url)&&!i&&!c||a&&!x.isOnMastraPlatform?!1:f&&p&&h?!0:!(x.requiredPermission&&!u(x.requiredPermission)||x.requiredAnyPermission&&!d(x.requiredAnyPermission));return l.jsxs(hl,{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(zg,{className:"h-[1.5rem] w-[1.5rem] shrink-0 ml-3"}),g&&l.jsx(lX,{})]}):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(zg,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]}),l.jsx(lX,{})]}):l.jsxs("span",{className:"flex items-center gap-2 pl-3",children:[l.jsx(zg,{className:"h-[1.5rem] w-[1.5rem] shrink-0"}),l.jsx("span",{className:"font-serif text-sm",children:"Mastra Studio"})]})}),l.jsx(hl.Nav,{children:D7n.filter(x=>x.key==="Templates"?s:!0).map(x=>{const w=x.links.filter(y),O=w.length>0&&x?.separator;return l.jsxs(hl.NavSection,{children:[x?.title?l.jsx(hl.NavHeader,{state:e,children:x.title}):l.jsx(l.Fragment,{children:O&&l.jsx(hl.NavSeparator,{})}),l.jsx(hl.NavList,{children:w.map(k=>{const E=n.startsWith(k.url);return l.jsx(hl.NavLink,{state:e,link:k,isActive:E},k.name)})})]},x.key)})}),l.jsxs(hl.Bottom,{children:[l.jsx(hl.Nav,{children:l.jsxs(hl.NavSection,{children:[l.jsx(hl.NavSeparator,{}),l.jsxs(hl.NavList,{children:[L7n.links.filter(y).map(x=>l.jsx(hl.NavLink,{link:x,state:e},x.name)),!r&&!a?l.jsx(hl.NavLink,{link:{name:"Share",url:"https://mastra.ai/cloud",icon:l.jsx(MQt,{}),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(hl.NavSeparator,{}),l.jsx(qRn,{collapsed:!1})]})]})]})}const z7n=S.createContext({theme:"dark",setTheme:()=>null}),B7n=e=>e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function oat({children:e,defaultTheme:t="dark"}){const{themeToggleEnabled:n}=Y4(),r=Or(i=>i.theme),s=Or(i=>i.setTheme),o=n?r==="light"||r==="system"?r:"dark":t;return S.useEffect(()=>{const i=window.document.documentElement,c=f=>{const p=B7n(f);i.classList.remove("light","dark"),i.classList.add(p)};if(c(o),o!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>c("system");return u.addEventListener("change",d),()=>{u.removeEventListener("change",d)}},[o]),l.jsx(z7n.Provider,{value:{theme:o,setTheme:s},children:e})}const U7n=({children:e})=>{const{data:t,isFetched:n}=_1(),r=n&&t?.enabled&&!yN(t),s=n&&!r;return l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(b9e,{position:"bottom-right"}),l.jsx(oat,{defaultTheme:"dark",attribute:"class",children:l.jsx(ui,{delayDuration:0,children:l.jsxs(k5n,{children:[l.jsx(vLn,{}),l.jsxs("div",{className:s?"grid h-full grid-cols-[auto_1fr]":"h-full",children:[s&&l.jsx(F7n,{}),l.jsx("div",{className:`bg-surface2 my-3 rounded-lg border border-border1 overflow-y-auto ${r?"h-[calc(100%-1.5rem)] mx-3":"mr-3"}`,children:l.jsx(ott,{children:e})})]})]})})})]})},V7n=({children:e})=>l.jsxs("div",{className:"bg-surface1 font-sans h-screen",children:[l.jsx(b9e,{position:"bottom-right"}),l.jsx(oat,{defaultTheme:"dark",attribute:"class",children:l.jsx(ui,{delayDuration:0,children:l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx(ott,{children:e})})})})]});function q7n({agentId:e}){const{isCmsAvailable:t}=Db();return l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/agents",children:[l.jsx(Oe,{children:l.jsx(so,{})}),"Agents"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(mPn,{value:e,variant:"ghost",showSourceIcon:t})})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/overview",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Agents documentation"]})})]})}const H7n=({children:e})=>{const{agentId:t}=va(),n=Pl(),{isCmsAvailable:r}=Db(),s=eK.has("datasets"),a=r&&s,o=n.pathname.includes("/playground")?"playground":n.pathname.includes("/traces")?"traces":"chat";return l.jsxs(on,{className:"grid-rows-[auto_auto_1fr]",children:[l.jsx(q7n,{agentId:t}),l.jsx(C$n,{agentId:t,activeTab:o,showPlayground:a}),e]})};function Q7n(){const{data:e={},isLoading:t,error:n}=Doe(),r=!t&&Object.keys(e).length===0;return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Zy,{})}),"Processors"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Processors documentation"]})})]}),l.jsx(Va,{isCentered:r,children:l.jsx(lDn,{processors:e,isLoading:t,error:n})})]})}function G7n(){const{processorId:e}=va(),{data:t,isLoading:n,error:r}=qnt(e);return r&&ba(r)?l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsx(_n,{children:l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/processors",children:[l.jsx(Oe,{children:l.jsx(Zy,{})}),"Processors"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:e})]})}),l.jsx("div",{className:"flex h-full items-center justify-center",children:l.jsx(io,{resource:"processors"})})]}):!n&&t?.isWorkflow?l.jsx(l9n,{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(Na,{children:[l.jsxs(bn,{as:At,to:"/processors",children:[l.jsx(Oe,{children:l.jsx(Zy,{})}),"Processors"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(On,{className:"h-6 w-32"})})]})}),l.jsxs("div",{className:"p-6",children:[l.jsx(On,{className:"h-8 w-48 mb-4"}),l.jsx(On,{className:"h-32 w-full"})]})]}):l.jsxs("div",{className:"h-full w-full overflow-y-hidden",children:[l.jsxs(_n,{children:[l.jsxs(Na,{children:[l.jsxs(bn,{as:At,to:"/processors",children:[l.jsx(Oe,{children:l.jsx(Zy,{})}),"Processors"]}),l.jsx(bn,{as:"span",to:"",isCurrent:!0,children:l.jsx(gDn,{value:e,variant:"ghost"})})]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/docs/agents/processors",target:"_blank",rel:"noopener noreferrer",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Processors documentation"]})})]}),l.jsx(pDn,{processorId:e})]})}function W7n(){const{data:e={},isLoading:t}=_f(),{data:n={},isLoading:r,error:s}=r3(),a=Object.keys(n).length>0,o=Object.values(e).some(c=>c.tools&&Object.keys(c.tools).length>0),i=!r&&!t&&!a&&!o;return l.jsxs(on,{children:[l.jsxs(_n,{children:[l.jsxs(ms,{children:[l.jsx(Oe,{children:l.jsx(Ti,{})}),"Tools"]}),l.jsx(gs,{children:l.jsxs(he,{as:At,to:"https://mastra.ai/en/docs/agents/using-tools-and-mcp",target:"_blank",variant:"ghost",size:"md",children:[l.jsx(_a,{}),"Tools documentation"]})})]}),l.jsx(Va,{isCentered:i,children:l.jsx(xDn,{tools:n,agents:e,isLoading:t||r,error:s})})]})}const iat={agentLink:e=>`/agents/${e}/chat/new`,agentToolLink:(e,t)=>`/agents/${e}/tools/${t}`,agentSkillLink:(e,t,n)=>n?`/workspaces/${n}/skills/${t}?agentId=${encodeURIComponent(e)}`:"/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/${yo()}`,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)=>t?`/workspaces/${t}/skills/${e}`:"/workspaces",workspaceLink:e=>e?`/workspaces/${e}`:"/workspaces",workspaceSkillLink:(e,t)=>t?`/workspaces/${t}/skills/${e}`:"/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}`},Z7n=()=>{const e=Ml(),t=n=>e(n,{viewTransition:!0});return l.jsx(CJe,{Link:rat,navigate:t,paths:iat,children:l.jsx(U7n,{children:l.jsx(jS,{})})})},Y7n=()=>{const e=Ml(),t=n=>e(n,{viewTransition:!0});return l.jsx(CJe,{Link:rat,navigate:t,paths:iat,children:l.jsx(V7n,{children:l.jsx(jS,{})})})},X7n=!!window.MASTRA_CLOUD_API_ENDPOINT,_je=eK.has("datasets"),Eje=[{index:!0,element:l.jsx(Tzn,{})},{path:"instruction-blocks",element:l.jsx(Nzn,{})},{path:"tools",element:l.jsx(Izn,{})},{path:"agents",element:l.jsx(_zn,{})},{path:"scorers",element:l.jsx(jzn,{})},{path:"workflows",element:l.jsx(Mzn,{})},{path:"skills",element:l.jsx(Rzn,{})},{path:"memory",element:l.jsx(Azn,{})},{path:"variables",element:l.jsx(Pzn,{})}],K7n=[{path:"/login",element:l.jsx(Kzn,{})},{path:"/signup",element:l.jsx(g7n,{})},{element:l.jsx(Y7n,{}),children:[{path:"/agents/:agentId/session",element:l.jsx(mje,{})},{path:"/agents/:agentId/session/:threadId",element:l.jsx(mje,{})}]},{element:l.jsx(Z7n,{}),children:[...X7n?[]:[{path:"/settings",element:l.jsx(m7n,{})},{path:"/templates",element:l.jsx(N7n,{})},{path:"/templates/:templateSlug",element:l.jsx(j7n,{})}],{path:"/scorers",element:l.jsx(d7n,{})},{path:"/scorers/:scorerId",element:l.jsx(f7n,{})},{path:"/observability",element:l.jsx(l7n,{})},{path:"/agents",element:l.jsx(xzn,{})},{path:"/cms/agents/create",element:l.jsx(Ezn,{}),children:Eje},{path:"/cms/agents/:agentId/edit",element:l.jsx(Czn,{}),children:Eje},{path:"/cms/scorers/create",element:l.jsx(Fzn,{})},{path:"/cms/scorers/:scorerId/edit",element:l.jsx(Bzn,{})},{path:"/prompts",element:l.jsx(c7n,{})},{path:"/cms/prompts/create",element:l.jsx($zn,{})},{path:"/cms/prompts/:promptBlockId/edit",element:l.jsx(Lzn,{})},{path:"/agents/:agentId/tools/:toolId",element:l.jsx(R7n,{})},{path:"/agents/:agentId",element:l.jsx(H7n,{children:l.jsx(jS,{})}),children:[{index:!0,loader:({params:e})=>xQ(`/agents/${e.agentId}/chat`)},{path:"chat",element:l.jsx(hje,{})},{path:"chat/:threadId",element:l.jsx(hje,{})},..._je?[{path:"playground",element:l.jsx(Ozn,{})}]:[],{path:"traces",element:l.jsx(kzn,{})}]},{path:"/tools",element:l.jsx(W7n,{})},{path:"/tools/:toolId",element:l.jsx(I7n,{})},{path:"/processors",element:l.jsx(Q7n,{})},{path:"/processors/:processorId",element:l.jsx(G7n,{})},{path:"/mcps",element:l.jsx(Jzn,{})},{path:"/mcps/:serverId",element:l.jsx(e7n,{})},{path:"/mcps/:serverId/tools/:toolId",element:l.jsx(t7n,{})},{path:"/workspaces",element:l.jsx(kje,{})},{path:"/workspaces/:workspaceId",element:l.jsx(kje,{})},{path:"/workspaces/:workspaceId/skills/:skillName",element:l.jsx($7n,{})},{path:"/workflows",element:l.jsx(P7n,{})},{path:"/workflows/:workflowId",element:l.jsx(G9n,{children:l.jsx(jS,{})}),children:[{index:!0,loader:({params:e})=>xQ(`/workflows/${e.workflowId}/graph`)},{path:"graph",element:l.jsx(Oje,{})},{path:"graph/:runId",element:l.jsx(Oje,{})}]},..._je?[{path:"/datasets",element:l.jsx(Uzn,{})},{path:"/datasets/:datasetId",element:l.jsx(Vzn,{})},{path:"/datasets/:datasetId/items/:itemId",element:l.jsx(Qzn,{})},{path:"/datasets/:datasetId/items/:itemId/versions",element:l.jsx(Zzn,{})},{path:"/datasets/:datasetId/experiments/:experimentId",element:l.jsx(qzn,{})},{path:"/datasets/:datasetId/experiments",element:l.jsx(Hzn,{})},{path:"/datasets/:datasetId/items",element:l.jsx(Gzn,{})},{path:"/datasets/:datasetId/versions",element:l.jsx(Xzn,{})}]:[],{index:!0,loader:()=>xQ("/agents")},{path:"/request-context",element:l.jsx(u7n,{})}]}];function J7n(){const e=window.MASTRA_STUDIO_BASE_PATH||"",{baseUrl:t,headers:n,apiPrefix:r,isLoading:s}=Y4();if(s)return null;if(!t)return l.jsx(GRn,{});const a=P9n(K7n,{basename:e});return l.jsx(yWt,{baseUrl:t,headers:n,apiPrefix:r,children:l.jsx(yzn,{children:l.jsx(a9n,{router:a})})})}function eBn(){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",s=window.MASTRA_CLOUD_API_ENDPOINT||"",a=window.MASTRA_AUTO_DETECT_URL==="true",o=window.MASTRA_THEME_TOGGLE==="true",i=s||(a?window.location.origin:`${e}://${t}:${n}`);return l.jsx(P5n,{children:l.jsx(LRn,{endpoint:i,defaultApiPrefix:r,themeToggleEnabled:o,children:l.jsx(J7n,{})})})}yit.createRoot(document.getElementById("root")).render(l.jsx(S.StrictMode,{children:l.jsx(eBn,{})}));const tUn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{Y4e as A,BLe as B,K4e as C,z5e as D,xu as E,ad as F,ZBn as G,$hn as H,js as I,tUn as J,dv as L,Z4e as N,S4 as _,Owt as a,Fwt as b,rBn as c,Vfe as d,pv as e,Mwt as f,dw as g,Lwt as h,nx as i,rx as j,tx as k,b3t as l,G5e as m,iv as n,Qs as o,R4t as p,j4t as q,Tee as r,CJ as s,le as t,oP as u,Ql as v,Twt as w,ct as x,Ze as y,u6e as z};
|