moi-computer 0.9.1-next.0 → 0.9.1-next.1
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/client/api/app-config.ts +51 -0
- package/client/api/workspace-keys.ts +1 -0
- package/client/app/routes/WorkspaceRoute.tsx +4 -2
- package/client/features/applets/api.ts +38 -0
- package/client/features/applets/applet-thumbnail.ts +208 -0
- package/client/features/chat/ChatEmptyState.tsx +5 -3
- package/client/features/chat/ChatPanel.tsx +2 -8
- package/client/features/chat/ChatSelector.tsx +29 -10
- package/client/features/chat/MarkdownContent.tsx +2 -2
- package/client/features/home/HomePage.tsx +13 -0
- package/client/features/home/WorkspacePreview.tsx +10 -5
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +9 -0
- package/client/features/home/workspace-setup/InstallMoiDialog.tsx +245 -0
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +1 -1
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +1 -1
- package/client/features/views/ViewBuilder.tsx +18 -4
- package/client/features/views/ViewManager.tsx +18 -2
- package/client/features/widgets/WidgetFrame.tsx +1 -1
- package/client/features/widgets/WidgetGrid.tsx +1 -1
- package/client/features/widgets/Widgets.tsx +16 -15
- package/client/features/workspace/CustomizePanel.tsx +29 -8
- package/client/features/workspace/WorkspaceScreen.tsx +8 -14
- package/client/index.tsx +6 -1
- package/client/runtime/useWorkspaceEvents.ts +17 -0
- package/client/runtime/workspace-theme.ts +29 -6
- package/dist/chunk-5c19v3zr.js +10 -0
- package/dist/chunk-6wx91x8j.js +1 -0
- package/dist/chunk-8s41nd3g.js +1 -0
- package/dist/{chunk-6w6j9g4b.js → chunk-a7fzp0z0.js} +2 -2
- package/dist/{chunk-pp62fnxh.js → chunk-b959mdkj.js} +1 -1
- package/dist/chunk-cagtq45k.js +1 -0
- package/dist/chunk-cva7jpt4.js +82 -0
- package/dist/chunk-sapvd7he.css +1 -0
- package/dist/{chunk-sxc24vfp.js → chunk-zbeq02yc.js} +1 -1
- package/dist/chunk-zbt8emsw.js +2 -0
- package/dist/chunk-zfz3b4xg.js +2 -0
- package/dist/index.html +1 -1
- package/lib/types.ts +60 -41
- package/package.json +1 -1
- package/server/api.ts +69 -31
- package/server/app-config.ts +144 -0
- package/server/applets.ts +17 -0
- package/server/cli.ts +47 -11
- package/server/layout.ts +40 -45
- package/server/moi-scaffold.ts +37 -1
- package/server/thumbnails.ts +197 -0
- package/server/views.ts +10 -1
- package/server/widgets.ts +4 -18
- package/workspace/.claude/skills/moi-workspace/SKILL.md +13 -1
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +153 -253
- package/client/features/drawings/annotation-availability.ts +0 -10
- package/client/features/widgets/api.ts +0 -47
- package/client/features/widgets/useWidgetThumbnails.ts +0 -107
- package/client/features/widgets/widget-snapshot.ts +0 -71
- package/dist/chunk-3becmq75.js +0 -81
- package/dist/chunk-8ew39cvq.js +0 -10
- package/dist/chunk-c8gtrjwp.js +0 -1
- package/dist/chunk-v964b5g7.js +0 -1
- package/dist/chunk-zx33ts9d.css +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import{$ as yq,$a as Cf,$b as tf,A as VD,Aa as qf,Ab as kh,Ac as jO,B as LD,Ba as Uf,Bb as Lm,Bc as n5,C as C3,Ca as Ff,Cb as ff,Cc as op,D as MJ,Da as Nf,Db as mf,Dc as yO,E as MD,Ea as Vf,Eb as pf,Ec as bO,F as xq,Fa as K6,Fb as uf,Fc as s8,G as AD,Ga as Lf,Gb as LK,Gc as rg,H as _D,Ha as PK,Hc as u5,I as P4,Ia as o3,Ib as cf,Ic as JC,J as K4,Ja as _h,Jb as DK,K as bE,Ka as xD,Kb as df,L as nY,La as Vm,Lb as sx,M as TD,Ma as Mf,Mb as HL,N as c7,Na as Af,Nb as tx,O as jE,Oa as _f,Ob as oW,P as o2,Pa as mG,Pb as lf,Q as ZD,Qa as Df,Qb as W4,R as W0,Ra as Of,S as v_,Sa as Pf,Sb as rf,T as lY,Ta as wf,Tb as af,U as p1,Ua as jf,Ub as yQ,V as sz,Va as Jk,Vb as yX,W as YD,Wa as _T,Wb as nf,X as Sq,Xb as of,Y as kq,Ya as Tf,Yb as hQ,Z as Iq,Za as aS,Zb as Rw,_ as Rq,_a as e$,_b as sf,aa as bq,ab as Ef,b as c,bb as tm,bc as ef,c as H4,ca as QM,cb as Sf,d as GJ0,da as s,db as gP,dc as $m,e as S5,ea as Gp,eb as _K,ec as oS,f as S0,fa as ZQ,fb as kf,fc as Zm,g as Yz,ga as C0,gb as If,gc as pG,h as q0,ha as Uh,hc as Jm,i as B0,ia as Gf,ib as Rf,ic as Mv,j as m5,ja as bD,jb as yf,jc as Qm,k as TQ,ka as JG,l as k5,la as Hf,lb as bf,lc as sS,m as cz,ma as Zk,mb as hD,mc as Mm,n as E8,na as YC,nb as JB,nc as Xm,o as $D,oa as KC,ob as xQ,p as D5,pa as hP,pb as cp,pc as zm,q as M1,qa as UC,qb as xf,qc as Gm,r as Q_,ra as Nm,rb as dp,rc as C1,s as _G,sa as bQ,sc as sg,t as GD,ta as Yf,tb as E1,tc as uS,u as d7,ua as Kf,ub as gD,uc as dG,v as u7,va as RQ,vb as om,vc as lS,w as lz,wa as Wf,wb as hf,wc as MO,x as UJ,xa as Bf,xb as gf,xc as AO,y as dq,ya as AK,yb as vf,yc as RO,z as Xq,za as up,zb as nS}from"/chunk-5c19v3zr.js";import{Jc as O5,Kc as C4,Lc as a1,Nc as W$}from"/chunk-zbt8emsw.js";import{Oc as v,Pc as EO,Rc as J8}from"/chunk-zfz3b4xg.js";import{Sc as P,Tc as Y1,Uc as D4,Vc as PF}from"/chunk-zbeq02yc.js";var eX=Y1((Tu)=>{var H2=P(v());function Lu($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var Mu=typeof Object.is==="function"?Object.is:Lu,Au=H2.useState,_u=H2.useEffect,Du=H2.useLayoutEffect,Ou=H2.useDebugValue;function Pu($,Z){var J=Z(),Q=Au({inst:{value:J,getSnapshot:Z}}),X=Q[0].inst,z=Q[1];return Du(function(){X.value=J,X.getSnapshot=Z,fB(X)&&z({inst:X})},[$,J,Z]),_u(function(){return fB(X)&&z({inst:X}),$(function(){fB(X)&&z({inst:X})})},[$]),Ou(J),J}function fB($){var Z=$.getSnapshot;$=$.value;try{var J=Z();return!Mu($,J)}catch(Q){return!0}}function wu($,Z){return Z()}var ju=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?wu:Pu;Tu.useSyncExternalStore=H2.useSyncExternalStore!==void 0?H2.useSyncExternalStore:ju});var Mk=Y1((Gr0,Lk)=>{var Uk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,It=/\n/g,Rt=/^\s*/,yt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,bt=/^:\s*/,xt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ht=/^[;\s]*/,gt=/^\s+|\s+$/g,vt=`
|
|
2
|
+
`,Fk="/",Nk="*",z7="",ft="comment",mt="declaration";function pt($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var J=1,Q=1;function X(F){var N=F.match(It);if(N)J+=N.length;var L=F.lastIndexOf(vt);Q=~L?F.length-L:Q+F.length}function z(){var F={line:J,column:Q};return function(N){return N.position=new G(F),K(),N}}function G(F){this.start=F,this.end={line:J,column:Q},this.source=Z.source}G.prototype.content=$;function H(F){var N=Error(Z.source+":"+J+":"+Q+": "+F);if(N.reason=F,N.filename=Z.source,N.line=J,N.column=Q,N.source=$,Z.silent);else throw N}function Y(F){var N=F.exec($);if(!N)return;var L=N[0];return X(L),$=$.slice(L.length),N}function K(){Y(Rt)}function W(F){var N;F=F||[];while(N=B())if(N!==!1)F.push(N);return F}function B(){var F=z();if(Fk!=$.charAt(0)||Nk!=$.charAt(1))return;var N=2;while(z7!=$.charAt(N)&&(Nk!=$.charAt(N)||Fk!=$.charAt(N+1)))++N;if(N+=2,z7===$.charAt(N-1))return H("End of comment missing");var L=$.slice(2,N-2);return Q+=2,X(L),$=$.slice(N),Q+=2,F({type:ft,comment:L})}function q(){var F=z(),N=Y(yt);if(!N)return;if(B(),!Y(bt))return H("property missing ':'");var L=Y(xt),V=F({type:mt,property:Vk(N[0].replace(Uk,z7)),value:L?Vk(L[0].replace(Uk,z7)):z7});return Y(ht),V}function U(){var F=[];W(F);var N;while(N=q())if(N!==!1)F.push(N),W(F);return F}return K(),U()}function Vk($){return $?$.replace(gt,z7):z7}Lk.exports=pt});var Ak=Y1((mQ)=>{var ut=mQ&&mQ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(mQ,"__esModule",{value:!0});mQ.default=dt;var ct=ut(Mk());function dt($,Z){let J=null;if(!$||typeof $!=="string")return J;let Q=(0,ct.default)($),X=typeof Z==="function";return Q.forEach((z)=>{if(z.type!=="declaration")return;let{property:G,value:H}=z;if(X)Z(G,H,z);else if(H)J=J||{},J[G]=H}),J}});var Pk=Y1((Dk)=>{Object.defineProperty(Dk,"__esModule",{value:!0});Dk.camelCase=void 0;var lt=/^--[a-zA-Z0-9_-]+$/,it=/-([a-z])/g,rt=/^[^-]+$/,at=/^-(webkit|moz|ms|o|khtml)-/,nt=/^-(ms)-/,ot=function($){return!$||rt.test($)||lt.test($)},st=function($,Z){return Z.toUpperCase()},_k=function($,Z){return"".concat(Z,"-")},tt=function($,Z){if(Z===void 0)Z={};if(ot($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(nt,_k);else $=$.replace(at,_k);return $.replace(it,st)};Dk.camelCase=tt});var jk=Y1((VN,wk)=>{var et=VN&&VN.__importDefault||function($){return $&&$.__esModule?$:{default:$}},$e=et(Ak()),Ze=Pk();function NN($,Z){var J={};if(!$||typeof $!=="string")return J;return(0,$e.default)($,function(Q,X){if(Q&&X)J[(0,Ze.camelCase)(Q,Z)]=X}),J}NN.default=NN;wk.exports=NN});var iI=Y1((st0,lI)=>{var $W=Object.prototype.hasOwnProperty,dI=Object.prototype.toString,vI=Object.defineProperty,fI=Object.getOwnPropertyDescriptor,mI=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return dI.call(Z)==="[object Array]"},pI=function(Z){if(!Z||dI.call(Z)!=="[object Object]")return!1;var J=$W.call(Z,"constructor"),Q=Z.constructor&&Z.constructor.prototype&&$W.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!J&&!Q)return!1;var X;for(X in Z);return typeof X>"u"||$W.call(Z,X)},uI=function(Z,J){if(vI&&J.name==="__proto__")vI(Z,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else Z[J.name]=J.newValue},cI=function(Z,J){if(J==="__proto__"){if(!$W.call(Z,J))return;else if(fI)return fI(Z,J).value}return Z[J]};lI.exports=function $(){var Z,J,Q,X,z,G,H=arguments[0],Y=1,K=arguments.length,W=!1;if(typeof H==="boolean")W=H,H=arguments[1]||{},Y=2;if(H==null||typeof H!=="object"&&typeof H!=="function")H={};for(;Y<K;++Y)if(Z=arguments[Y],Z!=null){for(J in Z)if(Q=cI(H,J),X=cI(Z,J),H!==X){if(W&&X&&(pI(X)||(z=mI(X)))){if(z)z=!1,G=Q&&mI(Q)?Q:[];else G=Q&&pI(Q)?Q:{};uI(H,{name:J,newValue:$(W,G,X)})}else if(typeof X<"u")uI(H,{name:J,newValue:X})}}return H}});var vy=Y1((M55,gy)=>{function Oy($){if($ instanceof Map)$.clear=$.delete=$.set=function(){throw Error("map is read-only")};else if($ instanceof Set)$.add=$.clear=$.delete=function(){throw Error("set is read-only")};return Object.freeze($),Object.getOwnPropertyNames($).forEach((Z)=>{let J=$[Z],Q=typeof J;if((Q==="object"||Q==="function")&&!Object.isFrozen(J))Oy(J)}),$}class HV{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Py($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function u6($,...Z){let J=Object.create(null);for(let Q in $)J[Q]=$[Q];return Z.forEach(function(Q){for(let X in Q)J[X]=Q[X]}),J}var T10="</span>",Vy=($)=>{return!!$.scope},C10=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let J=$.split(".");return[`${Z}${J.shift()}`,...J.map((Q,X)=>`${Q}${"_".repeat(X+1)}`)].join(" ")}return`${Z}${$}`};class wy{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=Py($)}openNode($){if(!Vy($))return;let Z=C10($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!Vy($))return;this.buffer+=T10}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var Ly=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class YV{constructor(){this.rootNode=Ly(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){let Z=Ly({scope:$});this.add(Z),this.stack.push(Z)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,Z){if(typeof Z==="string")$.addText(Z);else if(Z.children)$.openNode(Z),Z.children.forEach((J)=>this._walk($,J)),$.closeNode(Z);return $}static _collapse($){if(typeof $==="string")return;if(!$.children)return;if($.children.every((Z)=>typeof Z==="string"))$.children=[$.children.join("")];else $.children.forEach((Z)=>{YV._collapse(Z)})}}class jy extends YV{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let J=$.root;if(Z)J.scope=`language:${Z}`;this.add(J)}toHTML(){return new wy(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function QX($){if(!$)return null;if(typeof $==="string")return $;return $.source}function Ty($){return N7("(?=",$,")")}function E10($){return N7("(?:",$,")*")}function S10($){return N7("(?:",$,")?")}function N7(...$){return $.map((J)=>QX(J)).join("")}function k10($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function KV(...$){return"("+(k10($).capture?"":"?:")+$.map((Q)=>QX(Q)).join("|")+")"}function Cy($){return new RegExp($.toString()+"|").exec("").length-1}function I10($,Z){let J=$&&$.exec(Z);return J&&J.index===0}var R10=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function WV($,{joinWith:Z}){let J=0;return $.map((Q)=>{J+=1;let X=J,z=QX(Q),G="";while(z.length>0){let H=R10.exec(z);if(!H){G+=z;break}if(G+=z.substring(0,H.index),z=z.substring(H.index+H[0].length),H[0][0]==="\\"&&H[1])G+="\\"+String(Number(H[1])+X);else if(G+=H[0],H[0]==="(")J++}return G}).map((Q)=>`(${Q})`).join(Z)}var y10=/\b\B/,Ey="[a-zA-Z]\\w*",BV="[a-zA-Z_]\\w*",Sy="\\b\\d+(\\.\\d+)?",ky="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Iy="\\b(0b[01]+)",b10="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",x10=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=N7(Z,/.*\b/,$.binary,/\b.*/);return u6({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(J,Q)=>{if(J.index!==0)Q.ignoreMatch()}},$)},XX={begin:"\\\\[\\s\\S]",relevance:0},h10={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[XX]},g10={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[XX]},v10={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},UW=function($,Z,J={}){let Q=u6({scope:"comment",begin:$,end:Z,contains:[]},J);Q.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let X=KV("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Q.contains.push({begin:N7(/[ ]+/,"(",X,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Q},f10=UW("//","$"),m10=UW("/\\*","\\*/"),p10=UW("#","$"),u10={scope:"number",begin:Sy,relevance:0},c10={scope:"number",begin:ky,relevance:0},d10={scope:"number",begin:Iy,relevance:0},l10={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[XX,{begin:/\[/,end:/\]/,relevance:0,contains:[XX]}]},i10={scope:"title",begin:Ey,relevance:0},r10={scope:"title",begin:BV,relevance:0},a10={begin:"\\.\\s*"+BV,relevance:0},n10=function($){return Object.assign($,{"on:begin":(Z,J)=>{J.data._beginMatch=Z[1]},"on:end":(Z,J)=>{if(J.data._beginMatch!==Z[1])J.ignoreMatch()}})},BW=Object.freeze({__proto__:null,APOS_STRING_MODE:h10,BACKSLASH_ESCAPE:XX,BINARY_NUMBER_MODE:d10,BINARY_NUMBER_RE:Iy,COMMENT:UW,C_BLOCK_COMMENT_MODE:m10,C_LINE_COMMENT_MODE:f10,C_NUMBER_MODE:c10,C_NUMBER_RE:ky,END_SAME_AS_BEGIN:n10,HASH_COMMENT_MODE:p10,IDENT_RE:Ey,MATCH_NOTHING_RE:y10,METHOD_GUARD:a10,NUMBER_MODE:u10,NUMBER_RE:Sy,PHRASAL_WORDS_MODE:v10,QUOTE_STRING_MODE:g10,REGEXP_MODE:l10,RE_STARTERS_RE:b10,SHEBANG:x10,TITLE_MODE:i10,UNDERSCORE_IDENT_RE:BV,UNDERSCORE_TITLE_MODE:r10});function o10($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function s10($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function t10($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=o10,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function e10($,Z){if(!Array.isArray($.illegal))return;$.illegal=KV(...$.illegal)}function $80($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function Z80($,Z){if($.relevance===void 0)$.relevance=1}var J80=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let J=Object.assign({},$);Object.keys($).forEach((Q)=>{delete $[Q]}),$.keywords=J.keywords,$.begin=N7(J.beforeMatch,Ty(J.begin)),$.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},$.relevance=0,delete J.beforeMatch},Q80=["of","and","for","in","not","or","if","then","parent","list","value"],X80="keyword";function Ry($,Z,J=X80){let Q=Object.create(null);if(typeof $==="string")X(J,$.split(" "));else if(Array.isArray($))X(J,$);else Object.keys($).forEach(function(z){Object.assign(Q,Ry($[z],Z,z))});return Q;function X(z,G){if(Z)G=G.map((H)=>H.toLowerCase());G.forEach(function(H){let Y=H.split("|");Q[Y[0]]=[z,z80(Y[0],Y[1])]})}}function z80($,Z){if(Z)return Number(Z);return G80($)?0:1}function G80($){return Q80.includes($.toLowerCase())}var My={},F7=($)=>{console.error($)},Ay=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},qZ=($,Z)=>{if(My[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),My[`${$}/${Z}`]=!0},qW=Error();function yy($,Z,{key:J}){let Q=0,X=$[J],z={},G={};for(let H=1;H<=Z.length;H++)G[H+Q]=X[H],z[H+Q]=!0,Q+=Cy(Z[H-1]);$[J]=G,$[J]._emit=z,$[J]._multi=!0}function H80($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw F7("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),qW;if(typeof $.beginScope!=="object"||$.beginScope===null)throw F7("beginScope must be object"),qW;yy($,$.begin,{key:"beginScope"}),$.begin=WV($.begin,{joinWith:""})}function Y80($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw F7("skip, excludeEnd, returnEnd not compatible with endScope: {}"),qW;if(typeof $.endScope!=="object"||$.endScope===null)throw F7("endScope must be object"),qW;yy($,$.end,{key:"endScope"}),$.end=WV($.end,{joinWith:""})}function K80($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function W80($){if(K80($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};H80($),Y80($)}function B80($){function Z(G,H){return new RegExp(QX(G),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(H?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(G,H){H.position=this.position++,this.matchIndexes[this.matchAt]=H,this.regexes.push([H,G]),this.matchAt+=Cy(G)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let G=this.regexes.map((H)=>H[1]);this.matcherRe=Z(WV(G,{joinWith:"|"}),!0),this.lastIndex=0}exec(G){this.matcherRe.lastIndex=this.lastIndex;let H=this.matcherRe.exec(G);if(!H)return null;let Y=H.findIndex((W,B)=>B>0&&W!==void 0),K=this.matchIndexes[Y];return H.splice(0,Y),Object.assign(H,K)}}class Q{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(G){if(this.multiRegexes[G])return this.multiRegexes[G];let H=new J;return this.rules.slice(G).forEach(([Y,K])=>H.addRule(Y,K)),H.compile(),this.multiRegexes[G]=H,H}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(G,H){if(this.rules.push([G,H]),H.type==="begin")this.count++}exec(G){let H=this.getMatcher(this.regexIndex);H.lastIndex=this.lastIndex;let Y=H.exec(G);if(this.resumingScanAtSamePosition())if(Y&&Y.index===this.lastIndex);else{let K=this.getMatcher(0);K.lastIndex=this.lastIndex+1,Y=K.exec(G)}if(Y){if(this.regexIndex+=Y.position+1,this.regexIndex===this.count)this.considerAll()}return Y}}function X(G){let H=new Q;if(G.contains.forEach((Y)=>H.addRule(Y.begin,{rule:Y,type:"begin"})),G.terminatorEnd)H.addRule(G.terminatorEnd,{type:"end"});if(G.illegal)H.addRule(G.illegal,{type:"illegal"});return H}function z(G,H){let Y=G;if(G.isCompiled)return Y;[s10,$80,W80,J80].forEach((W)=>W(G,H)),$.compilerExtensions.forEach((W)=>W(G,H)),G.__beforeBegin=null,[t10,e10,Z80].forEach((W)=>W(G,H)),G.isCompiled=!0;let K=null;if(typeof G.keywords==="object"&&G.keywords.$pattern)G.keywords=Object.assign({},G.keywords),K=G.keywords.$pattern,delete G.keywords.$pattern;if(K=K||/\w+/,G.keywords)G.keywords=Ry(G.keywords,$.case_insensitive);if(Y.keywordPatternRe=Z(K,!0),H){if(!G.begin)G.begin=/\B|\b/;if(Y.beginRe=Z(Y.begin),!G.end&&!G.endsWithParent)G.end=/\B|\b/;if(G.end)Y.endRe=Z(Y.end);if(Y.terminatorEnd=QX(Y.end)||"",G.endsWithParent&&H.terminatorEnd)Y.terminatorEnd+=(G.end?"|":"")+H.terminatorEnd}if(G.illegal)Y.illegalRe=Z(G.illegal);if(!G.contains)G.contains=[];if(G.contains=[].concat(...G.contains.map(function(W){return q80(W==="self"?G:W)})),G.contains.forEach(function(W){z(W,Y)}),G.starts)z(G.starts,H);return Y.matcher=X(Y),Y}if(!$.compilerExtensions)$.compilerExtensions=[];if($.contains&&$.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=u6($.classNameAliases||{}),z($)}function by($){if(!$)return!1;return $.endsWithParent||by($.starts)}function q80($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return u6($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(by($))return u6($,{starts:$.starts?u6($.starts):null});if(Object.isFrozen($))return u6($);return $}var U80="11.11.1";class xy extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var GV=Py,_y=u6,Dy=Symbol("nomatch"),F80=7,hy=function($){let Z=Object.create(null),J=Object.create(null),Q=[],X=!0,z="Could not find the language '{}', did you forget to load/include a language module?",G={disableAutodetect:!0,name:"Plain text",contains:[]},H={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:jy};function Y(R){return H.noHighlightRe.test(R)}function K(R){let b=R.className+" ";b+=R.parentNode?R.parentNode.className:"";let g=H.languageDetectRe.exec(b);if(g){let u=I(g[1]);if(!u)Ay(z.replace("{}",g[1])),Ay("Falling back to no-highlight mode for this block.",R);return u?g[1]:"no-highlight"}return b.split(/\s+/).find((u)=>Y(u)||I(u))}function W(R,b,g){let u="",j="";if(typeof b==="object")u=R,g=b.ignoreIllegals,j=b.language;else qZ("10.7.0","highlight(lang, code, ...args) has been deprecated."),qZ("10.7.0",`Please use highlight(code, options) instead.
|
|
3
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),j=R,u=b;if(g===void 0)g=!0;let e={code:u,language:j};w("before:highlight",e);let t=e.result?e.result:B(e.language,e.code,g);return t.code=e.code,w("after:highlight",t),t}function B(R,b,g,u){let j=Object.create(null);function e(p,r){return p.keywords[r]}function t(){if(!d.keywords){a.addText(o);return}let p=0;d.keywordPatternRe.lastIndex=0;let r=d.keywordPatternRe.exec(o),z0="";while(r){z0+=o.substring(p,r.index);let L0=Q0.case_insensitive?r[0].toLowerCase():r[0],P0=e(d,L0);if(P0){let[v0,$5]=P0;if(a.addText(z0),z0="",j[L0]=(j[L0]||0)+1,j[L0]<=F80)N0+=$5;if(v0.startsWith("_"))z0+=r[0];else{let F5=Q0.classNameAliases[v0]||v0;M0(r[0],F5)}}else z0+=r[0];p=d.keywordPatternRe.lastIndex,r=d.keywordPatternRe.exec(o)}z0+=o.substring(p),a.addText(z0)}function x(){if(o==="")return;let p=null;if(typeof d.subLanguage==="string"){if(!Z[d.subLanguage]){a.addText(o);return}p=B(d.subLanguage,o,!0,f[d.subLanguage]),f[d.subLanguage]=p._top}else p=U(o,d.subLanguage.length?d.subLanguage:null);if(d.relevance>0)N0+=p.relevance;a.__addSublanguage(p._emitter,p.language)}function $0(){if(d.subLanguage!=null)x();else t();o=""}function M0(p,r){if(p==="")return;a.startScope(r),a.addText(p),a.endScope()}function l(p,r){let z0=1,L0=r.length-1;while(z0<=L0){if(!p._emit[z0]){z0++;continue}let P0=Q0.classNameAliases[p[z0]]||p[z0],v0=r[z0];if(P0)M0(v0,P0);else o=v0,t(),o="";z0++}}function H0(p,r){if(p.scope&&typeof p.scope==="string")a.openNode(Q0.classNameAliases[p.scope]||p.scope);if(p.beginScope){if(p.beginScope._wrap)M0(o,Q0.classNameAliases[p.beginScope._wrap]||p.beginScope._wrap),o="";else if(p.beginScope._multi)l(p.beginScope,r),o=""}return d=Object.create(p,{parent:{value:d}}),d}function U0(p,r,z0){let L0=I10(p.endRe,z0);if(L0){if(p["on:end"]){let P0=new HV(p);if(p["on:end"](r,P0),P0.isMatchIgnored)L0=!1}if(L0){while(p.endsParent&&p.parent)p=p.parent;return p}}if(p.endsWithParent)return U0(p.parent,r,z0)}function X0(p){if(d.matcher.regexIndex===0)return o+=p[0],1;else return c0=!0,0}function Y0(p){let r=p[0],z0=p.rule,L0=new HV(z0),P0=[z0.__beforeBegin,z0["on:begin"]];for(let v0 of P0){if(!v0)continue;if(v0(p,L0),L0.isMatchIgnored)return X0(r)}if(z0.skip)o+=r;else{if(z0.excludeBegin)o+=r;if($0(),!z0.returnBegin&&!z0.excludeBegin)o=r}return H0(z0,p),z0.returnBegin?0:r.length}function V0(p){let r=p[0],z0=b.substring(p.index),L0=U0(d,p,z0);if(!L0)return Dy;let P0=d;if(d.endScope&&d.endScope._wrap)$0(),M0(r,d.endScope._wrap);else if(d.endScope&&d.endScope._multi)$0(),l(d.endScope,p);else if(P0.skip)o+=r;else{if(!(P0.returnEnd||P0.excludeEnd))o+=r;if($0(),P0.excludeEnd)o=r}do{if(d.scope)a.closeNode();if(!d.skip&&!d.subLanguage)N0+=d.relevance;d=d.parent}while(d!==L0.parent);if(L0.starts)H0(L0.starts,p);return P0.returnEnd?0:r.length}function i(){let p=[];for(let r=d;r!==Q0;r=r.parent)if(r.scope)p.unshift(r.scope);p.forEach((r)=>a.openNode(r))}let Z0={};function J0(p,r){let z0=r&&r[0];if(o+=p,z0==null)return $0(),0;if(Z0.type==="begin"&&r.type==="end"&&Z0.index===r.index&&z0===""){if(o+=b.slice(r.index,r.index+1),!X){let L0=Error(`0 width match regex (${R})`);throw L0.languageName=R,L0.badRule=Z0.rule,L0}return 1}if(Z0=r,r.type==="begin")return Y0(r);else if(r.type==="illegal"&&!g){let L0=Error('Illegal lexeme "'+z0+'" for mode "'+(d.scope||"<unnamed>")+'"');throw L0.mode=d,L0}else if(r.type==="end"){let L0=V0(r);if(L0!==Dy)return L0}if(r.type==="illegal"&&z0==="")return o+=`
|
|
4
|
+
`,1;if(h0>1e5&&h0>r.index*3)throw Error("potential infinite loop, way more iterations than matches");return o+=z0,z0.length}let Q0=I(R);if(!Q0)throw F7(z.replace("{}",R)),Error('Unknown language: "'+R+'"');let n=B80(Q0),m="",d=u||n,f={},a=new H.__emitter(H);i();let o="",N0=0,j0=0,h0=0,c0=!1;try{if(!Q0.__emitTokens){d.matcher.considerAll();for(;;){if(h0++,c0)c0=!1;else d.matcher.considerAll();d.matcher.lastIndex=j0;let p=d.matcher.exec(b);if(!p)break;let r=b.substring(j0,p.index),z0=J0(r,p);j0=p.index+z0}J0(b.substring(j0))}else Q0.__emitTokens(b,a);return a.finalize(),m=a.toHTML(),{language:R,value:m,relevance:N0,illegal:!1,_emitter:a,_top:d}}catch(p){if(p.message&&p.message.includes("Illegal"))return{language:R,value:GV(b),illegal:!0,relevance:0,_illegalBy:{message:p.message,index:j0,context:b.slice(j0-100,j0+100),mode:p.mode,resultSoFar:m},_emitter:a};else if(X)return{language:R,value:GV(b),illegal:!1,relevance:0,errorRaised:p,_emitter:a,_top:d};else throw p}}function q(R){let b={value:GV(R),illegal:!1,relevance:0,_top:G,_emitter:new H.__emitter(H)};return b._emitter.addText(R),b}function U(R,b){b=b||H.languages||Object.keys(Z);let g=q(R),u=b.filter(I).filter(E).map(($0)=>B($0,R,!1));u.unshift(g);let j=u.sort(($0,M0)=>{if($0.relevance!==M0.relevance)return M0.relevance-$0.relevance;if($0.language&&M0.language){if(I($0.language).supersetOf===M0.language)return 1;else if(I(M0.language).supersetOf===$0.language)return-1}return 0}),[e,t]=j,x=e;return x.secondBest=t,x}function F(R,b,g){let u=b&&J[b]||g;R.classList.add("hljs"),R.classList.add(`language-${u}`)}function N(R){let b=null,g=K(R);if(Y(g))return;if(w("before:highlightElement",{el:R,language:g}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0){if(!H.ignoreUnescapedHTML)console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(R);if(H.throwUnescapedHTML)throw new xy("One of your code blocks includes unescaped HTML.",R.innerHTML)}b=R;let u=b.textContent,j=g?W(u,{language:g,ignoreIllegals:!0}):U(u);if(R.innerHTML=j.value,R.dataset.highlighted="yes",F(R,g,j.language),R.result={language:j.language,re:j.relevance,relevance:j.relevance},j.secondBest)R.secondBest={language:j.secondBest.language,relevance:j.secondBest.relevance};w("after:highlightElement",{el:R,result:j,text:u})}function L(R){H=_y(H,R)}let V=()=>{O(),qZ("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function M(){O(),qZ("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _=!1;function O(){function R(){O()}if(document.readyState==="loading"){if(!_)window.addEventListener("DOMContentLoaded",R,!1);_=!0;return}document.querySelectorAll(H.cssSelector).forEach(N)}function D(R,b){let g=null;try{g=b($)}catch(u){if(F7("Language definition for '{}' could not be registered.".replace("{}",R)),!X)throw u;else F7(u);g=G}if(!g.name)g.name=R;if(Z[R]=g,g.rawDefinition=b.bind(null,$),g.aliases)y(g.aliases,{languageName:R})}function A(R){delete Z[R];for(let b of Object.keys(J))if(J[b]===R)delete J[b]}function C(){return Object.keys(Z)}function I(R){return R=(R||"").toLowerCase(),Z[R]||Z[J[R]]}function y(R,{languageName:b}){if(typeof R==="string")R=[R];R.forEach((g)=>{J[g.toLowerCase()]=b})}function E(R){let b=I(R);return b&&!b.disableAutodetect}function h(R){if(R["before:highlightBlock"]&&!R["before:highlightElement"])R["before:highlightElement"]=(b)=>{R["before:highlightBlock"](Object.assign({block:b.el},b))};if(R["after:highlightBlock"]&&!R["after:highlightElement"])R["after:highlightElement"]=(b)=>{R["after:highlightBlock"](Object.assign({block:b.el},b))}}function k(R){h(R),Q.push(R)}function S(R){let b=Q.indexOf(R);if(b!==-1)Q.splice(b,1)}function w(R,b){let g=R;Q.forEach(function(u){if(u[g])u[g](b)})}function T(R){return qZ("10.7.0","highlightBlock will be removed entirely in v12.0"),qZ("10.7.0","Please use highlightElement now."),N(R)}Object.assign($,{highlight:W,highlightAuto:U,highlightAll:O,highlightElement:N,highlightBlock:T,configure:L,initHighlighting:V,initHighlightingOnLoad:M,registerLanguage:D,unregisterLanguage:A,listLanguages:C,getLanguage:I,registerAliases:y,autoDetection:E,inherit:_y,addPlugin:k,removePlugin:S}),$.debugMode=function(){X=!1},$.safeMode=function(){X=!0},$.versionString=U80,$.regex={concat:N7,lookahead:Ty,either:KV,optional:S10,anyNumberOfTimes:E10};for(let R in BW)if(typeof BW[R]==="object")Oy(BW[R]);return Object.assign($,BW),$},UZ=hy({});UZ.newInstance=()=>hy({});gy.exports=UZ;UZ.HighlightJS=UZ;UZ.default=UZ});var ih=Y1((gW,lh)=>{(function($,Z){typeof gW==="object"&&typeof lh<"u"?Z(gW):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(gW,function($){function Z(l){return function(U0,X0,Y0,V0,i,Z0,J0){return l(U0,X0,J0)}}function J(l){return function(U0,X0,Y0,V0){if(!U0||!X0||typeof U0!=="object"||typeof X0!=="object")return l(U0,X0,Y0,V0);var i=V0.get(U0),Z0=V0.get(X0);if(i&&Z0)return i===X0&&Z0===U0;V0.set(U0,X0),V0.set(X0,U0);var J0=l(U0,X0,Y0,V0);return V0.delete(U0),V0.delete(X0),J0}}function Q(l,H0){var U0={};for(var X0 in l)U0[X0]=l[X0];for(var X0 in H0)U0[X0]=H0[X0];return U0}function X(l){return l.constructor===Object||l.constructor==null}function z(l){return typeof l.then==="function"}function G(l,H0){return l===H0||l!==l&&H0!==H0}var H="[object Arguments]",Y="[object Boolean]",K="[object Date]",W="[object RegExp]",B="[object Map]",q="[object Number]",U="[object Object]",F="[object Set]",N="[object String]",L=Object.prototype.toString;function V(l){var{areArraysEqual:H0,areDatesEqual:U0,areMapsEqual:X0,areObjectsEqual:Y0,areRegExpsEqual:V0,areSetsEqual:i,createIsNestedEqual:Z0}=l,J0=Z0(Q0);function Q0(n,m,d){if(n===m)return!0;if(!n||!m||typeof n!=="object"||typeof m!=="object")return n!==n&&m!==m;if(X(n)&&X(m))return Y0(n,m,J0,d);var f=Array.isArray(n),a=Array.isArray(m);if(f||a)return f===a&&H0(n,m,J0,d);var o=L.call(n);if(o!==L.call(m))return!1;if(o===K)return U0(n,m,J0,d);if(o===W)return V0(n,m,J0,d);if(o===B)return X0(n,m,J0,d);if(o===F)return i(n,m,J0,d);if(o===U||o===H)return z(n)||z(m)?!1:Y0(n,m,J0,d);if(o===Y||o===q||o===N)return G(n.valueOf(),m.valueOf());return!1}return Q0}function M(l,H0,U0,X0){var Y0=l.length;if(H0.length!==Y0)return!1;while(Y0-- >0)if(!U0(l[Y0],H0[Y0],Y0,Y0,l,H0,X0))return!1;return!0}var _=J(M);function O(l,H0){return G(l.valueOf(),H0.valueOf())}function D(l,H0,U0,X0){var Y0=l.size===H0.size;if(!Y0)return!1;if(!l.size)return!0;var V0={},i=0;return l.forEach(function(Z0,J0){if(!Y0)return;var Q0=!1,n=0;H0.forEach(function(m,d){if(!Q0&&!V0[n]&&(Q0=U0(J0,d,i,n,l,H0,X0)&&U0(Z0,m,J0,d,l,H0,X0)))V0[n]=!0;n++}),i++,Y0=Q0}),Y0}var A=J(D),C="_owner",I=Object.prototype.hasOwnProperty;function y(l,H0,U0,X0){var Y0=Object.keys(l),V0=Y0.length;if(Object.keys(H0).length!==V0)return!1;var i;while(V0-- >0){if(i=Y0[V0],i===C){var Z0=!!l.$$typeof,J0=!!H0.$$typeof;if((Z0||J0)&&Z0!==J0)return!1}if(!I.call(H0,i)||!U0(l[i],H0[i],i,i,l,H0,X0))return!1}return!0}var E=J(y);function h(l,H0){return l.source===H0.source&&l.flags===H0.flags}function k(l,H0,U0,X0){var Y0=l.size===H0.size;if(!Y0)return!1;if(!l.size)return!0;var V0={};return l.forEach(function(i,Z0){if(!Y0)return;var J0=!1,Q0=0;H0.forEach(function(n,m){if(!J0&&!V0[Q0]&&(J0=U0(i,n,Z0,m,l,H0,X0)))V0[Q0]=!0;Q0++}),Y0=J0}),Y0}var S=J(k),w=Object.freeze({areArraysEqual:M,areDatesEqual:O,areMapsEqual:D,areObjectsEqual:y,areRegExpsEqual:h,areSetsEqual:k,createIsNestedEqual:Z}),T=Object.freeze({areArraysEqual:_,areDatesEqual:O,areMapsEqual:A,areObjectsEqual:E,areRegExpsEqual:h,areSetsEqual:S,createIsNestedEqual:Z}),R=V(w);function b(l,H0){return R(l,H0,void 0)}var g=V(Q(w,{createIsNestedEqual:function(){return G}}));function u(l,H0){return g(l,H0,void 0)}var j=V(T);function e(l,H0){return j(l,H0,new WeakMap)}var t=V(Q(T,{createIsNestedEqual:function(){return G}}));function x(l,H0){return t(l,H0,new WeakMap)}function $0(l){return V(Q(w,l(w)))}function M0(l){var H0=V(Q(T,l(T)));return function(U0,X0,Y0){if(Y0===void 0)Y0=new WeakMap;return H0(U0,X0,Y0)}}$.circularDeepEqual=e,$.circularShallowEqual=x,$.createCustomCircularEqual=M0,$.createCustomEqual=$0,$.deepEqual=b,$.sameValueZeroEqual=G,$.shallowEqual=u,Object.defineProperty($,"__esModule",{value:!0})})});var ah=Y1((Z$5,rh)=>{var T60="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";rh.exports=T60});var th=Y1((J$5,sh)=>{var C60=ah();function nh(){}function oh(){}oh.resetWarningCache=nh;sh.exports=function(){function $(Q,X,z,G,H,Y){if(Y===C60)return;var K=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}$.isRequired=$;function Z(){return $}var J={array:$,bigint:$,bool:$,func:$,number:$,object:$,string:$,symbol:$,any:$,arrayOf:Z,element:$,elementType:$,instanceOf:Z,node:$,objectOf:Z,oneOf:Z,oneOfType:Z,shape:Z,exact:Z,checkPropTypes:oh,resetWarningCache:nh};return J.PropTypes=J,J}});var OX=Y1((Q$5,eh)=>{eh.exports=th()();var E60,S60});var Jg=Y1((X$5,gL)=>{function Zg($){var Z,J,Q="";if(typeof $=="string"||typeof $=="number")Q+=$;else if(typeof $=="object")if(Array.isArray($)){var X=$.length;for(Z=0;Z<X;Z++)$[Z]&&(J=Zg($[Z]))&&(Q&&(Q+=" "),Q+=J)}else for(J in $)$[J]&&(Q&&(Q+=" "),Q+=J);return Q}function $g(){for(var $,Z,J=0,Q="",X=arguments.length;J<X;J++)($=arguments[J])&&(Z=Zg($))&&(Q&&(Q+=" "),Q+=Z);return Q}gL.exports=$g,gL.exports.clsx=$g});var PX=Y1((Qg)=>{Object.defineProperty(Qg,"__esModule",{value:!0});Qg.dontSetMe=b60;Qg.findInArray=k60;Qg.int=y60;Qg.isFunction=I60;Qg.isNum=R60;function k60($,Z){for(let J=0,Q=$.length;J<Q;J++)if(Z.apply(Z,[$[J],J,$]))return $[J]}function I60($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function R60($){return typeof $==="number"&&!isNaN($)}function y60($){return parseInt($,10)}function b60($,Z,J){if($[Z])return Error(`Invalid prop ${Z} passed to ${J} - do not set this, set it on the child.`)}});var Yg=Y1((Gg)=>{Object.defineProperty(Gg,"__esModule",{value:!0});Gg.browserPrefixToKey=zg;Gg.browserPrefixToStyle=m60;Gg.default=void 0;Gg.getPrefix=Xg;var vL=["Moz","Webkit","O","ms"];function Xg(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let Z=window.document?.documentElement?.style;if(!Z)return"";if($ in Z)return"";for(let J=0;J<vL.length;J++)if(zg($,vL[J])in Z)return vL[J];return""}function zg($,Z){return Z?`${Z}${p60($)}`:$}function m60($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function p60($){let Z="",J=!0;for(let Q=0;Q<$.length;Q++)if(J)Z+=$[Q].toUpperCase(),J=!1;else if($[Q]==="-")J=!0;else Z+=$[Q];return Z}var G$5=Gg.default=Xg()});var fW=Y1((Ng)=>{Object.defineProperty(Ng,"__esModule",{value:!0});Ng.addClassName=Ug;Ng.addEvent=i60;Ng.addUserSelectStyles=Q30;Ng.createCSSTransform=e60;Ng.createSVGTransform=$30;Ng.getTouch=Z30;Ng.getTouchIdentifier=J30;Ng.getTranslation=fL;Ng.innerHeight=o60;Ng.innerWidth=s60;Ng.matchesSelector=qg;Ng.matchesSelectorAndParentsTo=l60;Ng.offsetXYFromParent=t60;Ng.outerHeight=a60;Ng.outerWidth=n60;Ng.removeClassName=Fg;Ng.removeEvent=r60;Ng.scheduleRemoveUserSelectStyles=X30;var b4=PX(),Kg=Bg(Yg());function Bg($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(Bg=function(X,z){if(!z&&X&&X.__esModule)return X;var G,H,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=z?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(H.get||H.set)?G(Y,K,H):Y[K]=X[K]);return Y})($,Z)}var vW="";function qg($,Z){if(!vW)vW=(0,b4.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(J){return(0,b4.isFunction)($[J])});if(!(0,b4.isFunction)($[vW]))return!1;return $[vW](Z)}function l60($,Z,J){let Q=$;do{if(qg(Q,Z))return!0;if(Q===J)return!1;Q=Q.parentNode}while(Q);return!1}function i60($,Z,J,Q){if(!$)return;let X={capture:!0,...Q};if($.addEventListener)$.addEventListener(Z,J,X);else if($.attachEvent)$.attachEvent("on"+Z,J);else $["on"+Z]=J}function r60($,Z,J,Q){if(!$)return;let X={capture:!0,...Q};if($.removeEventListener)$.removeEventListener(Z,J,X);else if($.detachEvent)$.detachEvent("on"+Z,J);else $["on"+Z]=null}function a60($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,b4.int)(J.borderTopWidth),Z+=(0,b4.int)(J.borderBottomWidth),Z}function n60($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,b4.int)(J.borderLeftWidth),Z+=(0,b4.int)(J.borderRightWidth),Z}function o60($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,b4.int)(J.paddingTop),Z-=(0,b4.int)(J.paddingBottom),Z}function s60($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,b4.int)(J.paddingLeft),Z-=(0,b4.int)(J.paddingRight),Z}function t60($,Z,J){let X=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),z=($.clientX+Z.scrollLeft-X.left)/J,G=($.clientY+Z.scrollTop-X.top)/J;return{x:z,y:G}}function e60($,Z){let J=fL($,Z,"px");return{[(0,Kg.browserPrefixToKey)("transform",Kg.default)]:J}}function $30($,Z){return fL($,Z,"")}function fL($,Z,J){let{x:Q,y:X}=$,z=`translate(${Q}${J},${X}${J})`;if(Z){let G=`${typeof Z.x==="string"?Z.x:Z.x+J}`,H=`${typeof Z.y==="string"?Z.y:Z.y+J}`;z=`translate(${G}, ${H})`+z}return z}function Z30($,Z){return $.targetTouches&&(0,b4.findInArray)($.targetTouches,(J)=>Z===J.identifier)||$.changedTouches&&(0,b4.findInArray)($.changedTouches,(J)=>Z===J.identifier)}function J30($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function Q30($){if(!$)return;let Z=$.getElementById("react-draggable-style-el");if(!Z)Z=$.createElement("style"),Z.type="text/css",Z.id="react-draggable-style-el",Z.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
5
|
+
`,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
6
|
+
`,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)Ug($.body,"react-draggable-transparent-selection")}function X30($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{Wg($)});else Wg($)}function Wg($){if(!$)return;try{if($.body)Fg($.body,"react-draggable-transparent-selection");if($.selection)$.selection.empty();else{let Z=($.defaultView||window).getSelection();if(Z&&Z.type!=="Caret")Z.removeAllRanges()}}catch(Z){}}function Ug($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function Fg($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var pL=Y1((Vg)=>{Object.defineProperty(Vg,"__esModule",{value:!0});Vg.canDragX=j30;Vg.canDragY=T30;Vg.createCoreData=E30;Vg.createDraggableData=S30;Vg.getBoundPosition=P30;Vg.getControlPosition=C30;Vg.snapToGrid=w30;var x4=PX(),SZ=fW();function P30($,Z,J){if(!$.props.bounds)return[Z,J];let{bounds:Q}=$.props;Q=typeof Q==="string"?Q:k30(Q);let X=mL($);if(typeof Q==="string"){let{ownerDocument:z}=X,G=z.defaultView,H;if(Q==="parent")H=X.parentNode;else H=X.getRootNode().querySelector(Q);if(!(H instanceof G.HTMLElement))throw Error('Bounds selector "'+Q+'" could not find an element.');let Y=H,K=G.getComputedStyle(X),W=G.getComputedStyle(Y);Q={left:-X.offsetLeft+(0,x4.int)(W.paddingLeft)+(0,x4.int)(K.marginLeft),top:-X.offsetTop+(0,x4.int)(W.paddingTop)+(0,x4.int)(K.marginTop),right:(0,SZ.innerWidth)(Y)-(0,SZ.outerWidth)(X)-X.offsetLeft+(0,x4.int)(W.paddingRight)-(0,x4.int)(K.marginRight),bottom:(0,SZ.innerHeight)(Y)-(0,SZ.outerHeight)(X)-X.offsetTop+(0,x4.int)(W.paddingBottom)-(0,x4.int)(K.marginBottom)}}if((0,x4.isNum)(Q.right))Z=Math.min(Z,Q.right);if((0,x4.isNum)(Q.bottom))J=Math.min(J,Q.bottom);if((0,x4.isNum)(Q.left))Z=Math.max(Z,Q.left);if((0,x4.isNum)(Q.top))J=Math.max(J,Q.top);return[Z,J]}function w30($,Z,J){let Q=Math.round(Z/$[0])*$[0],X=Math.round(J/$[1])*$[1];return[Q,X]}function j30($){return $.props.axis==="both"||$.props.axis==="x"}function T30($){return $.props.axis==="both"||$.props.axis==="y"}function C30($,Z,J){let Q=typeof Z==="number"?(0,SZ.getTouch)($,Z):null;if(typeof Z==="number"&&!Q)return null;let X=mL(J),z=J.props.offsetParent||X.offsetParent||X.ownerDocument.body;return(0,SZ.offsetXYFromParent)(Q||$,z,J.props.scale)}function E30($,Z,J){let Q=!(0,x4.isNum)($.lastX),X=mL($);if(Q)return{node:X,deltaX:0,deltaY:0,lastX:Z,lastY:J,x:Z,y:J};else return{node:X,deltaX:Z-$.lastX,deltaY:J-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:J}}function S30($,Z){let J=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/J,y:$.state.y+Z.deltaY/J,deltaX:Z.deltaX/J,deltaY:Z.deltaY/J,lastX:$.state.x,lastY:$.state.y}}function k30($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function mL($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var uL=Y1((Lg)=>{Object.defineProperty(Lg,"__esModule",{value:!0});Lg.default=v30;function v30(){}});var Dg=Y1((Ag)=>{var c30=P(v()),d30=P(H4());Object.defineProperty(Ag,"__esModule",{value:!0});Ag.default=void 0;var cL=Mg(c30),J4=lL(OX()),m30=lL(d30),p8=fW(),t6=pL(),dL=PX(),wX=lL(uL());function lL($){return $&&$.__esModule?$:{default:$}}function Mg($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(Mg=function(X,z){if(!z&&X&&X.__esModule)return X;var G,H,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=z?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(H.get||H.set)?G(Y,K,H):Y[K]=X[K]);return Y})($,Z)}function Q4($,Z,J){return(Z=p30(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function p30($){var Z=u30($,"string");return typeof Z=="symbol"?Z:Z+""}function u30($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var C2={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},e6=C2.mouse;class jX extends cL.Component{constructor(){super(...arguments);Q4(this,"dragging",!1),Q4(this,"lastX",NaN),Q4(this,"lastY",NaN),Q4(this,"touchIdentifier",null),Q4(this,"mounted",!1),Q4(this,"handleDragStart",($)=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button==="number"&&$.button!==0)return!1;let Z=this.findDOMNode();if(!Z||!Z.ownerDocument||!Z.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:J}=Z;if(this.props.disabled||!($.target instanceof J.defaultView.Node)||this.props.handle&&!(0,p8.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,p8.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let Q=(0,p8.getTouchIdentifier)($);this.touchIdentifier=Q;let X=(0,t6.getControlPosition)($,Q,this);if(X==null)return;let{x:z,y:G}=X,H=(0,t6.createCoreData)(this,z,G);if((0,wX.default)("DraggableCore: handleDragStart: %j",H),(0,wX.default)("calling",this.props.onStart),this.props.onStart($,H)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,p8.addUserSelectStyles)(J);this.dragging=!0,this.lastX=z,this.lastY=G,(0,p8.addEvent)(J,e6.move,this.handleDrag),(0,p8.addEvent)(J,e6.stop,this.handleDragStop)}),Q4(this,"handleDrag",($)=>{let Z=(0,t6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:Q}=Z;if(Array.isArray(this.props.grid)){let G=J-this.lastX,H=Q-this.lastY;if([G,H]=(0,t6.snapToGrid)(this.props.grid,G,H),!G&&!H)return;J=this.lastX+G,Q=this.lastY+H}let X=(0,t6.createCoreData)(this,J,Q);if((0,wX.default)("DraggableCore: handleDrag: %j",X),this.props.onDrag($,X)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(G){let H=document.createEvent("MouseEvents");H.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(H)}return}this.lastX=J,this.lastY=Q}),Q4(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,t6.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:Q}=Z;if(Array.isArray(this.props.grid)){let H=J-this.lastX||0,Y=Q-this.lastY||0;[H,Y]=(0,t6.snapToGrid)(this.props.grid,H,Y),J=this.lastX+H,Q=this.lastY+Y}let X=(0,t6.createCoreData)(this,J,Q);if(this.props.onStop($,X)===!1||this.mounted===!1)return!1;let G=this.findDOMNode();if(G){if(this.props.enableUserSelectHack)(0,p8.scheduleRemoveUserSelectStyles)(G.ownerDocument)}if((0,wX.default)("DraggableCore: handleDragStop: %j",X),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,G)(0,wX.default)("DraggableCore: Removing handlers"),(0,p8.removeEvent)(G.ownerDocument,e6.move,this.handleDrag),(0,p8.removeEvent)(G.ownerDocument,e6.stop,this.handleDragStop)}),Q4(this,"onMouseDown",($)=>{return e6=C2.mouse,this.handleDragStart($)}),Q4(this,"onMouseUp",($)=>{return e6=C2.mouse,this.handleDragStop($)}),Q4(this,"onTouchStart",($)=>{return e6=C2.touch,this.handleDragStart($)}),Q4(this,"onTouchEnd",($)=>{return e6=C2.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,p8.addEvent)($,C2.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,p8.removeEvent)(Z,C2.mouse.move,this.handleDrag),(0,p8.removeEvent)(Z,C2.touch.move,this.handleDrag),(0,p8.removeEvent)(Z,C2.mouse.stop,this.handleDragStop),(0,p8.removeEvent)(Z,C2.touch.stop,this.handleDragStop),(0,p8.removeEvent)($,C2.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,p8.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:m30.default.findDOMNode(this)}render(){return cL.cloneElement(cL.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}Ag.default=jX;Q4(jX,"displayName","DraggableCore");Q4(jX,"propTypes",{allowAnyClick:J4.default.bool,allowMobileScroll:J4.default.bool,children:J4.default.node.isRequired,disabled:J4.default.bool,enableUserSelectHack:J4.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:J4.default.arrayOf(J4.default.number),handle:J4.default.string,cancel:J4.default.string,nodeRef:J4.default.object,onStart:J4.default.func,onDrag:J4.default.func,onStop:J4.default.func,onMouseDown:J4.default.func,scale:J4.default.number,className:dL.dontSetMe,style:dL.dontSetMe,transform:dL.dontSetMe});Q4(jX,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var jg=Y1((aL)=>{var n30=P(v()),o30=P(H4());Object.defineProperty(aL,"__esModule",{value:!0});Object.defineProperty(aL,"DraggableCore",{enumerable:!0,get:function(){return uW.default}});aL.default=void 0;var mW=Pg(n30),q1=cW(OX()),l30=cW(o30),i30=Jg(),Og=fW(),kZ=pL(),iL=PX(),uW=cW(Dg()),pW=cW(uL());function cW($){return $&&$.__esModule?$:{default:$}}function Pg($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(Pg=function(X,z){if(!z&&X&&X.__esModule)return X;var G,H,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=z?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(H.get||H.set)?G(Y,K,H):Y[K]=X[K]);return Y})($,Z)}function rL(){return rL=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},rL.apply(null,arguments)}function IZ($,Z,J){return(Z=r30(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function r30($){var Z=a30($,"string");return typeof Z=="symbol"?Z:Z+""}function a30($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class TX extends mW.Component{static getDerivedStateFromProps($,Z){let{position:J}=$,{prevPropsPosition:Q}=Z;if(J&&(!Q||J.x!==Q.x||J.y!==Q.y))return(0,pW.default)("Draggable: getDerivedStateFromProps %j",{position:J,prevPropsPosition:Q}),{x:J.x,y:J.y,prevPropsPosition:{...J}};return null}constructor($){super($);if(IZ(this,"onDragStart",(Z,J)=>{if((0,pW.default)("Draggable: onDragStart: %j",J),this.props.onStart(Z,(0,kZ.createDraggableData)(this,J))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),IZ(this,"onDrag",(Z,J)=>{if(!this.state.dragging)return!1;(0,pW.default)("Draggable: onDrag: %j",J);let Q=(0,kZ.createDraggableData)(this,J),X={x:Q.x,y:Q.y,slackX:0,slackY:0};if(this.props.bounds){let{x:G,y:H}=X;X.x+=this.state.slackX,X.y+=this.state.slackY;let[Y,K]=(0,kZ.getBoundPosition)(this,X.x,X.y);X.x=Y,X.y=K,X.slackX=this.state.slackX+(G-X.x),X.slackY=this.state.slackY+(H-X.y),Q.x=X.x,Q.y=X.y,Q.deltaX=X.x-this.state.x,Q.deltaY=X.y-this.state.y}if(this.props.onDrag(Z,Q)===!1)return!1;this.setState(X)}),IZ(this,"onDragStop",(Z,J)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,kZ.createDraggableData)(this,J))===!1)return!1;(0,pW.default)("Draggable: onDragStop: %j",J);let X={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:G,y:H}=this.props.position;X.x=G,X.y=H}this.setState(X)}),this.state={dragging:!1,dragged:!1,x:$.position?$.position.x:$.defaultPosition.x,y:$.position?$.position.y:$.defaultPosition.y,prevPropsPosition:{...$.position},slackX:0,slackY:0,isElementSVG:!1},$.position&&!($.onDrag||$.onStop))console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){if(typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement)this.setState({isElementSVG:!0})}componentWillUnmount(){if(this.state.dragging)this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??l30.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:J,defaultPosition:Q,defaultClassName:X,defaultClassNameDragging:z,defaultClassNameDragged:G,position:H,positionOffset:Y,scale:K,...W}=this.props,B={},q=null,F=!Boolean(H)||this.state.dragging,N=H||Q,L={x:(0,kZ.canDragX)(this)&&F?this.state.x:N.x,y:(0,kZ.canDragY)(this)&&F?this.state.y:N.y};if(this.state.isElementSVG)q=(0,Og.createSVGTransform)(L,Y);else B=(0,Og.createCSSTransform)(L,Y);let V=(0,i30.clsx)(J.props.className||"",X,{[z]:this.state.dragging,[G]:this.state.dragged});return mW.createElement(uW.default,rL({},W,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),mW.cloneElement(mW.Children.only(J),{className:V,style:{...J.props.style,...B},transform:q}))}}aL.default=TX;IZ(TX,"displayName","Draggable");IZ(TX,"propTypes",{...uW.default.propTypes,axis:q1.default.oneOf(["both","x","y","none"]),bounds:q1.default.oneOfType([q1.default.shape({left:q1.default.number,right:q1.default.number,top:q1.default.number,bottom:q1.default.number}),q1.default.string,q1.default.oneOf([!1])]),defaultClassName:q1.default.string,defaultClassNameDragging:q1.default.string,defaultClassNameDragged:q1.default.string,defaultPosition:q1.default.shape({x:q1.default.number,y:q1.default.number}),positionOffset:q1.default.shape({x:q1.default.oneOfType([q1.default.number,q1.default.string]),y:q1.default.oneOfType([q1.default.number,q1.default.string])}),position:q1.default.shape({x:q1.default.number,y:q1.default.number}),className:iL.dontSetMe,style:iL.dontSetMe,transform:iL.dontSetMe});IZ(TX,"defaultProps",{...uW.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})});var lW=Y1((U$5,dW)=>{var{default:Tg,DraggableCore:s30}=jg();dW.exports=Tg;dW.exports.default=Tg;dW.exports.DraggableCore=s30});var Sg=Y1((X70)=>{var H70=P(v());X70.__esModule=!0;X70.cloneElement=Q70;var t30=e30(H70);function e30($){return $&&$.__esModule?$:{default:$}}function Cg($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function Eg($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Cg(Object(J),!0).forEach(function(Q){$70($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Cg(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function $70($,Z,J){return(Z=Z70(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function Z70($){var Z=J70($,"string");return typeof Z=="symbol"?Z:Z+""}function J70($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function Q70($,Z){if(Z.style&&$.props.style)Z.style=Eg(Eg({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=`${$.props.className} ${Z.className}`;return t30.default.cloneElement($,Z)}});var nL=Y1((K70)=>{K70.__esModule=!0;K70.resizableProps=void 0;var q5=Y70(OX()),N$5=lW();function Y70($){return $&&$.__esModule?$:{default:$}}var V$5=K70.resizableProps={axis:q5.default.oneOf(["both","x","y","none"]),className:q5.default.string,children:q5.default.element.isRequired,draggableOpts:q5.default.shape({allowAnyClick:q5.default.bool,cancel:q5.default.string,children:q5.default.node,disabled:q5.default.bool,enableUserSelectHack:q5.default.bool,offsetParent:typeof Element<"u"?q5.default.instanceOf(Element):q5.default.any,grid:q5.default.arrayOf(q5.default.number),handle:q5.default.string,nodeRef:q5.default.object,onStart:q5.default.func,onDrag:q5.default.func,onStop:q5.default.func,onMouseDown:q5.default.func,scale:q5.default.number}),height:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let[Q]=Z;if(Q.axis==="both"||Q.axis==="y")return q5.default.number.isRequired(...Z);return q5.default.number(...Z)},handle:q5.default.oneOfType([q5.default.node,q5.default.func]),handleSize:q5.default.arrayOf(q5.default.number),lockAspectRatio:q5.default.bool,maxConstraints:q5.default.arrayOf(q5.default.number),minConstraints:q5.default.arrayOf(q5.default.number),onResizeStop:q5.default.func,onResizeStart:q5.default.func,onResize:q5.default.func,resizeHandles:q5.default.arrayOf(q5.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:q5.default.number,width:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let[Q]=Z;if(Q.axis==="both"||Q.axis==="x")return q5.default.number.isRequired(...Z);return q5.default.number(...Z)}}});var tL=Y1((_70)=>{var O70=P(v());_70.__esModule=!0;_70.default=void 0;var RZ=Rg(O70),B70=lW(),q70=Sg(),U70=nL(),F70=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Rg($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(Rg=function(X,z){if(!z&&X&&X.__esModule)return X;var G,H,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=z?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(H.get||H.set)?G(Y,K,H):Y[K]=X[K]);return Y})($,Z)}function sL(){return sL=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},sL.apply(null,arguments)}function N70($,Z){if($==null)return{};var J,Q,X=V70($,Z);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols($);for(Q=0;Q<z.length;Q++)J=z[Q],Z.indexOf(J)===-1&&{}.propertyIsEnumerable.call($,J)&&(X[J]=$[J])}return X}function V70($,Z){if($==null)return{};var J={};for(var Q in $)if({}.hasOwnProperty.call($,Q)){if(Z.indexOf(Q)!==-1)continue;J[Q]=$[Q]}return J}function Ig($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function oL($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Ig(Object(J),!0).forEach(function(Q){L70($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Ig(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function L70($,Z,J){return(Z=M70(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function M70($){var Z=A70($,"string");return typeof Z=="symbol"?Z:Z+""}function A70($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class iW extends RZ.Component{constructor(){super(...arguments);this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints($,Z){let{minConstraints:J,maxConstraints:Q,lockAspectRatio:X}=this.props;if(!J&&!Q&&!X)return[$,Z];if(X){let K=this.props.width/this.props.height,W=$-this.props.width,B=Z-this.props.height;if(Math.abs(W)>Math.abs(B*K))Z=$/K;else $=Z*K}let[z,G]=[$,Z],[H,Y]=this.slack||[0,0];if($+=H,Z+=Y,J)$=Math.max(J[0],$),Z=Math.max(J[1],Z);if(Q)$=Math.min(Q[0],$),Z=Math.min(Q[1],Z);return this.slack=[H+(z-$),Y+(G-Z)],[$,Z]}resizeHandler($,Z){return(J,Q)=>{let{node:X,deltaX:z,deltaY:G}=Q;if($==="onResizeStart")this.resetData();let H=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",Y=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!H&&!Y)return;let K=Z[0],W=Z[Z.length-1],B=X.getBoundingClientRect();if(this.lastHandleRect!=null){if(W==="w"){let V=B.left-this.lastHandleRect.left;z+=V}if(K==="n"){let V=B.top-this.lastHandleRect.top;G+=V}}if(this.lastHandleRect=B,W==="w")z=-z;if(K==="n")G=-G;let q=this.props.width+(H?z/this.props.transformScale:0),U=this.props.height+(Y?G/this.props.transformScale:0);if([q,U]=this.runConstraints(q,U),$==="onResizeStop"&&this.lastSize)({width:q,height:U}=this.lastSize);let F=q!==this.props.width||U!==this.props.height;if($!=="onResizeStop")this.lastSize={width:q,height:U};let N=typeof this.props[$]==="function"?this.props[$]:null;if(N&&!($==="onResize"&&!F))J.persist?.(),N(J,{node:X,size:{width:q,height:U},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let{handle:J}=this.props;if(!J)return RZ.createElement("span",{className:`react-resizable-handle react-resizable-handle-${$}`,ref:Z});if(typeof J==="function")return J($,Z);let Q=typeof J.type==="string",X=oL({ref:Z},Q?{}:{handleAxis:$});return RZ.cloneElement(J,X)}render(){let $=this.props,{children:Z,className:J,draggableOpts:Q,width:X,height:z,handle:G,handleSize:H,lockAspectRatio:Y,axis:K,minConstraints:W,maxConstraints:B,onResize:q,onResizeStop:U,onResizeStart:F,resizeHandles:N,transformScale:L}=$,V=N70($,F70);return(0,q70.cloneElement)(Z,oL(oL({},V),{},{className:`${J?`${J} `:""}react-resizable`,children:[...RZ.Children.toArray(Z.props.children),...N.map((M)=>{let _=this.handleRefs[M]??(this.handleRefs[M]=RZ.createRef());return RZ.createElement(B70.DraggableCore,sL({},Q,{nodeRef:_,key:`resizableHandle-${M}`,onStop:this.resizeHandler("onResizeStop",M),onStart:this.resizeHandler("onResizeStart",M),onDrag:this.resizeHandler("onResize",M)}),this.renderResizeHandle(M,_))})]}))}}_70.default=iW;iW.propTypes=U70.resizableProps;iW.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var vg=Y1((R70)=>{var b70=P(v());R70.__esModule=!0;R70.default=void 0;var eL=hg(b70),P70=xg(OX()),w70=xg(tL()),j70=nL(),T70=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function xg($){return $&&$.__esModule?$:{default:$}}function hg($,Z){if(typeof WeakMap=="function")var J=new WeakMap,Q=new WeakMap;return(hg=function(X,z){if(!z&&X&&X.__esModule)return X;var G,H,Y={__proto__:null,default:X};if(X===null||typeof X!="object"&&typeof X!="function")return Y;if(G=z?Q:J){if(G.has(X))return G.get(X);G.set(X,Y)}for(let K in X)K!=="default"&&{}.hasOwnProperty.call(X,K)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(X,K))&&(H.get||H.set)?G(Y,K,H):Y[K]=X[K]);return Y})($,Z)}function $M(){return $M=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var Q in J)({}).hasOwnProperty.call(J,Q)&&($[Q]=J[Q])}return $},$M.apply(null,arguments)}function bg($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);Z&&(Q=Q.filter(function(X){return Object.getOwnPropertyDescriptor($,X).enumerable})),J.push.apply(J,Q)}return J}function rW($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?bg(Object(J),!0).forEach(function(Q){C70($,Q,J[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):bg(Object(J)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(J,Q))})}return $}function C70($,Z,J){return(Z=E70(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function E70($){var Z=S70($,"string");return typeof Z=="symbol"?Z:Z+""}function S70($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var Q=J.call($,Z||"default");if(typeof Q!="object")return Q;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function k70($,Z){if($==null)return{};var J,Q,X=I70($,Z);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols($);for(Q=0;Q<z.length;Q++)J=z[Q],Z.indexOf(J)===-1&&{}.propertyIsEnumerable.call($,J)&&(X[J]=$[J])}return X}function I70($,Z){if($==null)return{};var J={};for(var Q in $)if({}.hasOwnProperty.call($,Q)){if(Z.indexOf(Q)!==-1)continue;J[Q]=$[Q]}return J}class ZM extends eL.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=($,Z)=>{let{size:J}=Z;if(this.props.onResize)$.persist?.(),this.setState(J,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(J)}}static getDerivedStateFromProps($,Z){if(Z.propsWidth!==$.width||Z.propsHeight!==$.height)return{width:$.width,height:$.height,propsWidth:$.width,propsHeight:$.height};return null}render(){let $=this.props,{handle:Z,handleSize:J,onResize:Q,onResizeStart:X,onResizeStop:z,draggableOpts:G,minConstraints:H,maxConstraints:Y,lockAspectRatio:K,axis:W,width:B,height:q,resizeHandles:U,style:F,transformScale:N}=$,L=k70($,T70);return eL.createElement(w70.default,{axis:W,draggableOpts:G,handle:Z,handleSize:J,height:this.state.height,lockAspectRatio:K,maxConstraints:Y,minConstraints:H,onResizeStart:X,onResize:this.onResize,onResizeStop:z,resizeHandles:U,transformScale:N,width:this.state.width},eL.createElement("div",$M({},L,{style:rW(rW({},F),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}R70.default=ZM;ZM.propTypes=rW(rW({},j70.resizableProps),{},{children:P70.default.element})});var fg=Y1((_$5,aW)=>{aW.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};aW.exports.Resizable=tL().default;aW.exports.ResizableBox=vg().default});var v4=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe($){return this.listeners.add($),this.onSubscribe(),()=>{this.listeners.delete($),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var Xu=class extends v4{#$;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$((Z)=>{if(typeof Z==="boolean")this.setFocused(Z);else this.onFocus()})}setFocused($){if(this.#$!==$)this.#$=$,this.onFocus()}onFocus(){let $=this.isFocused();this.listeners.forEach((Z)=>{Z($)})}isFocused(){if(typeof this.#$==="boolean")return this.#$;return globalThis.document?.visibilityState!=="hidden"}},S7=new Xu;var zu={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},Gu=class{#$=zu;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},I2=new Gu;function mM($){setTimeout($,0)}var jB=typeof window>"u"||"Deno"in globalThis;function R1(){}function cM($,Z){return typeof $==="function"?$(Z):$}function rZ($){return typeof $==="number"&&$>=0&&$!==1/0}function dX($,Z){return Math.max($+(Z||0)-Date.now(),0)}function G2($,Z){return typeof $==="function"?$(Z):$}function l8($,Z){return typeof $==="function"?$(Z):$}function lX($,Z){let{type:J="all",exact:Q,fetchStatus:X,predicate:z,queryKey:G,stale:H}=$;if(G){if(Q){if(Z.queryHash!==aZ(G,Z.options))return!1}else if(!H3(Z.queryKey,G))return!1}if(J!=="all"){let Y=Z.isActive();if(J==="active"&&!Y)return!1;if(J==="inactive"&&Y)return!1}if(typeof H==="boolean"&&Z.isStale()!==H)return!1;if(X&&X!==Z.state.fetchStatus)return!1;if(z&&!z(Z))return!1;return!0}function iX($,Z){let{exact:J,status:Q,predicate:X,mutationKey:z}=$;if(z){if(!Z.options.mutationKey)return!1;if(J){if(R2(Z.options.mutationKey)!==R2(z))return!1}else if(!H3(Z.options.mutationKey,z))return!1}if(Q&&Z.state.status!==Q)return!1;if(X&&!X(Z))return!1;return!0}function aZ($,Z){return(Z?.queryKeyHashFn||R2)($)}function R2($){return JSON.stringify($,(Z,J)=>wB(J)?Object.keys(J).sort().reduce((Q,X)=>{return Q[X]=J[X],Q},{}):J)}function H3($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object")return Object.keys(Z).every((J)=>H3($[J],Z[J]));return!1}var Hu=Object.prototype.hasOwnProperty;function nZ($,Z,J=0){if($===Z)return $;if(J>500)return Z;let Q=pM($)&&pM(Z);if(!Q&&!(wB($)&&wB(Z)))return Z;let z=(Q?$:Object.keys($)).length,G=Q?Z:Object.keys(Z),H=G.length,Y=Q?Array(H):{},K=0;for(let W=0;W<H;W++){let B=Q?W:G[W],q=$[B],U=Z[B];if(q===U){if(Y[B]=q,Q?W<z:Hu.call($,B))K++;continue}if(q===null||U===null||typeof q!=="object"||typeof U!=="object"){Y[B]=U;continue}let F=nZ(q,U,J+1);if(Y[B]=F,F===q)K++}return z===H&&K===z?$:Y}function k7($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function pM($){return Array.isArray($)&&$.length===Object.keys($).length}function wB($){if(!uM($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let J=Z.prototype;if(!uM(J))return!1;if(!J.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function uM($){return Object.prototype.toString.call($)==="[object Object]"}function dM($){return new Promise((Z)=>{I2.setTimeout(Z,$)})}function oZ($,Z,J){if(typeof J.structuralSharing==="function")return J.structuralSharing($,Z);else if(J.structuralSharing!==!1)return nZ($,Z);return Z}function lM($,Z,J=0){let Q=[...$,Z];return J&&Q.length>J?Q.slice(1):Q}function iM($,Z,J=0){let Q=[Z,...$];return J&&Q.length>J?Q.slice(0,-1):Q}var I7=Symbol();function rX($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===I7)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function R7($,Z){if(typeof $==="function")return $(...Z);return!!$}function rM($,Z,J){let Q=!1,X;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(X??=Z(),Q)return X;if(Q=!0,X.aborted)J();else X.addEventListener("abort",J,{once:!0});return X}}),$}var y2=(()=>{let $=()=>jB;return{isServer(){return $()},setIsServer(Z){$=Z}}})();function sZ(){let $,Z,J=new Promise((X,z)=>{$=X,Z=z});J.status="pending",J.catch(()=>{});function Q(X){Object.assign(J,X),delete J.resolve,delete J.reject}return J.resolve=(X)=>{Q({status:"fulfilled",value:X}),$(X)},J.reject=(X)=>{Q({status:"rejected",reason:X}),Z(X)},J}var aM=mM;function Yu(){let $=[],Z=0,J=(H)=>{H()},Q=(H)=>{H()},X=aM,z=(H)=>{if(Z)$.push(H);else X(()=>{J(H)})},G=()=>{let H=$;if($=[],H.length)X(()=>{Q(()=>{H.forEach((Y)=>{J(Y)})})})};return{batch:(H)=>{let Y;Z++;try{Y=H()}finally{if(Z--,!Z)G()}return Y},batchCalls:(H)=>{return(...Y)=>{z(()=>{H(...Y)})}},schedule:z,setNotifyFunction:(H)=>{J=H},setBatchNotifyFunction:(H)=>{Q=H},setScheduler:(H)=>{X=H}}}var v5=Yu();var Ku=class extends v4{#$=!0;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),J=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",J,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",J)}}return}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((J)=>{J($)})}isOnline(){return this.#$}},y7=new Ku;function Wu($){return Math.min(1000*2**$,30000)}function TB($){return($??"online")==="online"?y7.isOnline():!0}var aX=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function nX($){let Z=!1,J=0,Q,X=sZ(),z=()=>X.status!=="pending",G=(N)=>{if(!z()){let L=new aX(N);q(L),$.onCancel?.(L)}},H=()=>{Z=!0},Y=()=>{Z=!1},K=()=>S7.isFocused()&&($.networkMode==="always"||y7.isOnline())&&$.canRun(),W=()=>TB($.networkMode)&&$.canRun(),B=(N)=>{if(!z())Q?.(),X.resolve(N)},q=(N)=>{if(!z())Q?.(),X.reject(N)},U=()=>{return new Promise((N)=>{Q=(L)=>{if(z()||K())N(L)},$.onPause?.()}).then(()=>{if(Q=void 0,!z())$.onContinue?.()})},F=()=>{if(z())return;let N,L=J===0?$.initialPromise:void 0;try{N=L??$.fn()}catch(V){N=Promise.reject(V)}Promise.resolve(N).then(B).catch((V)=>{if(z())return;let M=$.retry??(y2.isServer()?0:3),_=$.retryDelay??Wu,O=typeof _==="function"?_(J,V):_,D=M===!0||typeof M==="number"&&J<M||typeof M==="function"&&M(J,V);if(Z||!D){q(V);return}J++,$.onFail?.(J,V),dM(O).then(()=>{return K()?void 0:U()}).then(()=>{if(Z)q(V);else F()})})};return{promise:X,status:()=>X.status,cancel:G,continue:()=>{return Q?.(),X},cancelRetry:H,continueRetry:Y,canStart:W,start:()=>{if(W())F();else U().then(F);return X}}}var oX=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),rZ(this.gcTime))this.#$=I2.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(y2.isServer()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)I2.clearTimeout(this.#$),this.#$=void 0}};var sM=class extends oX{#$;#Z;#J;#X;#Q;#z;#G;constructor($){super();this.#G=!1,this.#z=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#X=$.client,this.#J=this.#X.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#$=oM(this.options),this.state=$.state??this.#$,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#Q?.promise}setOptions($){if(this.options={...this.#z,...$},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=oM(this.options);if(Z.data!==void 0)this.setState(nM(Z.data,Z.dataUpdatedAt)),this.#$=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#J.remove(this)}setData($,Z){let J=oZ(this.state.data,$,this.options);return this.#Y({data:J,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),J}setState($,Z){this.#Y({type:"setState",state:$,setStateOptions:Z})}cancel($){let Z=this.#Q?.promise;return this.#Q?.cancel($),Z?Z.then(R1).catch(R1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#$}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(($)=>l8($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===I7||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>G2($.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some(($)=>$.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime($=0){if(this.state.data===void 0)return!0;if($==="static")return!1;if(this.state.isInvalidated)return!0;return!dX(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find((Z)=>Z.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#Q?.continue()}onOnline(){this.observers.find((Z)=>Z.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#Q?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#J.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){if(this.observers.includes($)){if(this.observers=this.observers.filter((Z)=>Z!==$),!this.observers.length){if(this.#Q)if(this.#G||this.#H())this.#Q.cancel({revert:!0});else this.#Q.cancelRetry();this.scheduleGc()}this.#J.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}#H(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){if(!this.state.isInvalidated)this.#Y({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#Q?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#Q)return this.#Q.continueRetry(),this.#Q.promise}if($)this.setOptions($);if(!this.options.queryFn){let H=this.observers.find((Y)=>Y.options.queryFn);if(H)this.setOptions(H.options)}let J=new AbortController,Q=(H)=>{Object.defineProperty(H,"signal",{enumerable:!0,get:()=>{return this.#G=!0,J.signal}})},X=()=>{let H=rX(this.options,Z),K=(()=>{let W={client:this.#X,queryKey:this.queryKey,meta:this.meta};return Q(W),W})();if(this.#G=!1,this.options.persister)return this.options.persister(H,K,this);return H(K)},G=(()=>{let H={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#X,state:this.state,fetchFn:X};return Q(H),H})();if(this.options.behavior?.onFetch(G,this),this.#Z=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==G.fetchOptions?.meta)this.#Y({type:"fetch",meta:G.fetchOptions?.meta});this.#Q=nX({initialPromise:Z?.initialPromise,fn:G.fetchFn,onCancel:(H)=>{if(H instanceof aX&&H.revert)this.setState({...this.#Z,fetchStatus:"idle"});J.abort()},onFail:(H,Y)=>{this.#Y({type:"failed",failureCount:H,error:Y})},onPause:()=>{this.#Y({type:"pause"})},onContinue:()=>{this.#Y({type:"continue"})},retry:G.options.retry,retryDelay:G.options.retryDelay,networkMode:G.options.networkMode,canRun:()=>!0});try{let H=await this.#Q.start();if(H===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(H),this.#J.config.onSuccess?.(H,this),this.#J.config.onSettled?.(H,this.state.error,this),H}catch(H){if(H instanceof aX){if(H.silent)return this.#Q.promise;else if(H.revert){if(this.state.data===void 0)throw H;return this.state.data}}throw this.#Y({type:"error",error:H}),this.#J.config.onError?.(H,this),this.#J.config.onSettled?.(this.state.data,H,this),H}finally{this.scheduleGc()}}#Y($){let Z=(J)=>{switch($.type){case"failed":return{...J,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...J,fetchStatus:"paused"};case"continue":return{...J,fetchStatus:"fetching"};case"fetch":return{...J,...CB(J.data,this.options),fetchMeta:$.meta??null};case"success":let Q={...J,...nM($.data,$.dataUpdatedAt),dataUpdateCount:J.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#Z=$.manual?Q:void 0,Q;case"error":let X=$.error;return{...J,error:X,errorUpdateCount:J.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:J.fetchFailureCount+1,fetchFailureReason:X,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...J,isInvalidated:!0};case"setState":return{...J,...$.state}}};this.state=Z(this.state),v5.batch(()=>{this.observers.forEach((J)=>{J.onQueryUpdate()}),this.#J.notify({query:this,type:"updated",action:$})})}};function CB($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:TB(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function nM($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function oM($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,J=Z!==void 0,Q=J?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:J?Q??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:J?"success":"pending",fetchStatus:"idle"}}var SB=class extends v4{constructor($,Z){super();this.options=Z,this.#$=$,this.#H=null,this.#G=sZ(),this.bindMethods(),this.setOptions(Z)}#$;#Z=void 0;#J=void 0;#X=void 0;#Q;#z;#G;#H;#Y;#U;#F;#W;#B;#K;#N=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),tM(this.#Z,this.options))this.#q();else this.updateResult();this.#A()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return EB(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return EB(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#D(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,J=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof l8(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#O(),this.#Z.setOptions(this.options),Z._defaulted&&!k7(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let Q=this.hasListeners();if(Q&&eM(this.#Z,J,this.options,Z))this.#q();if(this.updateResult(),Q&&(this.#Z!==J||l8(this.options.enabled,this.#Z)!==l8(Z.enabled,this.#Z)||G2(this.options.staleTime,this.#Z)!==G2(Z.staleTime,this.#Z)))this.#V();let X=this.#L();if(Q&&(this.#Z!==J||l8(this.options.enabled,this.#Z)!==l8(Z.enabled,this.#Z)||X!==this.#K))this.#M(X)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),J=this.createResult(Z,$);if(qu(this,J))this.#X=J,this.#z=this.options,this.#Q=this.#Z.state;return J}getCurrentResult(){return this.#X}trackResult($,Z){return new Proxy($,{get:(J,Q)=>{if(this.trackProp(Q),Z?.(Q),Q==="promise"){if(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#G.status==="pending")this.#G.reject(Error("experimental_prefetchInRender feature flag is not enabled"))}return Reflect.get(J,Q)}})}trackProp($){this.#N.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),J=this.#$.getQueryCache().build(this.#$,Z);return J.fetch().then(()=>this.createResult(J,Z))}fetch($){return this.#q({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#X})}#q($){this.#O();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(R1);return Z}#V(){this.#_();let $=G2(this.options.staleTime,this.#Z);if(y2.isServer()||this.#X.isStale||!rZ($))return;let J=dX(this.#X.dataUpdatedAt,$)+1;this.#W=I2.setTimeout(()=>{if(!this.#X.isStale)this.updateResult()},J)}#L(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#M($){if(this.#D(),this.#K=$,y2.isServer()||l8(this.options.enabled,this.#Z)===!1||!rZ(this.#K)||this.#K===0)return;this.#B=I2.setInterval(()=>{if(this.options.refetchIntervalInBackground||S7.isFocused())this.#q()},this.#K)}#A(){this.#V(),this.#M(this.#L())}#_(){if(this.#W!==void 0)I2.clearTimeout(this.#W),this.#W=void 0}#D(){if(this.#B!==void 0)I2.clearInterval(this.#B),this.#B=void 0}createResult($,Z){let J=this.#Z,Q=this.options,X=this.#X,z=this.#Q,G=this.#z,Y=$!==J?$.state:this.#J,{state:K}=$,W={...K},B=!1,q;if(Z._optimisticResults){let I=this.hasListeners(),y=!I&&tM($,Z),E=I&&eM($,J,Z,Q);if(y||E)W={...W,...CB(K.data,$.options)};if(Z._optimisticResults==="isRestoring")W.fetchStatus="idle"}let{error:U,errorUpdatedAt:F,status:N}=W;q=W.data;let L=!1;if(Z.placeholderData!==void 0&&q===void 0&&N==="pending"){let I;if(X?.isPlaceholderData&&Z.placeholderData===G?.placeholderData)I=X.data,L=!0;else I=typeof Z.placeholderData==="function"?Z.placeholderData(this.#F?.state.data,this.#F):Z.placeholderData;if(I!==void 0)N="success",q=oZ(X?.data,I,Z),B=!0}if(Z.select&&q!==void 0&&!L)if(X&&q===z?.data&&Z.select===this.#Y)q=this.#U;else try{this.#Y=Z.select,q=Z.select(q),q=oZ(X?.data,q,Z),this.#U=q,this.#H=null}catch(I){this.#H=I}if(this.#H)U=this.#H,q=this.#U,F=Date.now(),N="error";let V=W.fetchStatus==="fetching",M=N==="pending",_=N==="error",O=M&&V,D=q!==void 0,C={status:N,fetchStatus:W.fetchStatus,isPending:M,isSuccess:N==="success",isError:_,isInitialLoading:O,isLoading:O,data:q,dataUpdatedAt:W.dataUpdatedAt,error:U,errorUpdatedAt:F,failureCount:W.fetchFailureCount,failureReason:W.fetchFailureReason,errorUpdateCount:W.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:W.dataUpdateCount>Y.dataUpdateCount||W.errorUpdateCount>Y.errorUpdateCount,isFetching:V,isRefetching:V&&!M,isLoadingError:_&&!D,isPaused:W.fetchStatus==="paused",isPlaceholderData:B,isRefetchError:_&&D,isStale:kB($,Z),refetch:this.refetch,promise:this.#G,isEnabled:l8(Z.enabled,$)!==!1};if(this.options.experimental_prefetchInRender){let I=C.data!==void 0,y=C.status==="error"&&!I,E=(S)=>{if(y)S.reject(C.error);else if(I)S.resolve(C.data)},h=()=>{let S=this.#G=C.promise=sZ();E(S)},k=this.#G;switch(k.status){case"pending":if($.queryHash===J.queryHash)E(k);break;case"fulfilled":if(y||C.data!==k.value)h();break;case"rejected":if(!y||C.error!==k.reason)h();break}}return C}updateResult(){let $=this.#X,Z=this.createResult(this.#Z,this.options);if(this.#Q=this.#Z.state,this.#z=this.options,this.#Q.data!==void 0)this.#F=this.#Z;if(k7(Z,$))return;this.#X=Z;let J=()=>{if(!$)return!0;let{notifyOnChangeProps:Q}=this.options,X=typeof Q==="function"?Q():Q;if(X==="all"||!X&&!this.#N.size)return!0;let z=new Set(X??this.#N);if(this.options.throwOnError)z.add("error");return Object.keys(this.#X).some((G)=>{let H=G;return this.#X[H]!==$[H]&&z.has(H)})};this.#P({listeners:J()})}#O(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#J=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#A()}#P($){v5.batch(()=>{if($.listeners)this.listeners.forEach((Z)=>{Z(this.#X)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}};function Bu($,Z){return l8(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&l8(Z.retryOnMount,$)===!1)}function tM($,Z){return Bu($,Z)||$.state.data!==void 0&&EB($,Z,Z.refetchOnMount)}function EB($,Z,J){if(l8(Z.enabled,$)!==!1&&G2(Z.staleTime,$)!=="static"){let Q=typeof J==="function"?J($):J;return Q==="always"||Q!==!1&&kB($,Z)}return!1}function eM($,Z,J,Q){return($!==Z||l8(Q.enabled,$)===!1)&&(!J.suspense||$.state.status!=="error")&&kB($,J)}function kB($,Z){return l8(Z.enabled,$)!==!1&&$.isStaleByTime(G2(Z.staleTime,$))}function qu($,Z){if(!k7($.getCurrentResult(),Z))return!0;return!1}function IB($){return{onFetch:(Z,J)=>{let Q=Z.options,X=Z.fetchOptions?.meta?.fetchMore?.direction,z=Z.state.data?.pages||[],G=Z.state.data?.pageParams||[],H={pages:[],pageParams:[]},Y=0,K=async()=>{let W=!1,B=(F)=>{rM(F,()=>Z.signal,()=>W=!0)},q=rX(Z.options,Z.fetchOptions),U=async(F,N,L)=>{if(W)return Promise.reject();if(N==null&&F.pages.length)return Promise.resolve(F);let M=(()=>{let A={client:Z.client,queryKey:Z.queryKey,pageParam:N,direction:L?"backward":"forward",meta:Z.options.meta};return B(A),A})(),_=await q(M),{maxPages:O}=Z.options,D=L?iM:lM;return{pages:D(F.pages,_,O),pageParams:D(F.pageParams,N,O)}};if(X&&z.length){let F=X==="backward",N=F?Uu:$A,L={pages:z,pageParams:G},V=N(Q,L);H=await U(L,V,F)}else{let F=$??z.length;do{let N=Y===0?G[0]??Q.initialPageParam:$A(Q,H);if(Y>0&&N==null)break;H=await U(H,N),Y++}while(Y<F)}return H};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(K,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},J)};else Z.fetchFn=K}}}function $A($,{pages:Z,pageParams:J}){let Q=Z.length-1;return Z.length>0?$.getNextPageParam(Z[Q],Z,J[Q],J):void 0}function Uu($,{pages:Z,pageParams:J}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,J[0],J):void 0}var ZA=class extends oX{#$;#Z;#J;#X;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#J=$.mutationCache,this.#Z=[],this.state=$.state||RB(),this.setOptions($.options),this.scheduleGc()}setOptions($){this.options=$,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver($){if(!this.#Z.includes($))this.#Z.push($),this.clearGcTimeout(),this.#J.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#J.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#J.remove(this)}continue(){return this.#X?.continue()??this.execute(this.state.variables)}async execute($){let Z=()=>{this.#Q({type:"continue"})},J={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#X=nX({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,J)},onFail:(z,G)=>{this.#Q({type:"failed",failureCount:z,error:G})},onPause:()=>{this.#Q({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#J.canRun(this)});let Q=this.state.status==="pending",X=!this.#X.canStart();try{if(Q)Z();else{if(this.#Q({type:"pending",variables:$,isPaused:X}),this.#J.config.onMutate)await this.#J.config.onMutate($,this,J);let G=await this.options.onMutate?.($,J);if(G!==this.state.context)this.#Q({type:"pending",context:G,variables:$,isPaused:X})}let z=await this.#X.start();return await this.#J.config.onSuccess?.(z,$,this.state.context,this,J),await this.options.onSuccess?.(z,$,this.state.context,J),await this.#J.config.onSettled?.(z,null,this.state.variables,this.state.context,this,J),await this.options.onSettled?.(z,null,$,this.state.context,J),this.#Q({type:"success",data:z}),z}catch(z){try{await this.#J.config.onError?.(z,$,this.state.context,this,J)}catch(G){Promise.reject(G)}try{await this.options.onError?.(z,$,this.state.context,J)}catch(G){Promise.reject(G)}try{await this.#J.config.onSettled?.(void 0,z,this.state.variables,this.state.context,this,J)}catch(G){Promise.reject(G)}try{await this.options.onSettled?.(void 0,z,$,this.state.context,J)}catch(G){Promise.reject(G)}throw this.#Q({type:"error",error:z}),z}finally{this.#J.runNext(this)}}#Q($){let Z=(J)=>{switch($.type){case"failed":return{...J,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...J,isPaused:!0};case"continue":return{...J,isPaused:!1};case"pending":return{...J,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...J,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...J,data:void 0,error:$.error,failureCount:J.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),v5.batch(()=>{this.#Z.forEach((J)=>{J.onMutationUpdate($)}),this.#J.notify({mutation:this,type:"updated",action:$})})}};function RB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var JA=class extends v4{constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#J=0}#$;#Z;#J;build($,Z,J){let Q=new ZA({client:$,mutationCache:this,mutationId:++this.#J,options:$.defaultMutationOptions(Z),state:J});return this.add(Q),Q}add($){this.#$.add($);let Z=sX($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J)J.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=sX($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J){if(J.length>1){let Q=J.indexOf($);if(Q!==-1)J.splice(Q,1)}else if(J[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=sX($);if(typeof Z==="string"){let Q=this.#Z.get(Z)?.find((X)=>X.state.status==="pending");return!Q||Q===$}else return!0}runNext($){let Z=sX($);if(typeof Z==="string")return this.#Z.get(Z)?.find((Q)=>Q!==$&&Q.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){v5.batch(()=>{this.#$.forEach(($)=>{this.notify({type:"removed",mutation:$})}),this.#$.clear(),this.#Z.clear()})}getAll(){return Array.from(this.#$)}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>iX(Z,J))}findAll($={}){return this.getAll().filter((Z)=>iX($,Z))}notify($){v5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return v5.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(R1))))}};function sX($){return $.options.scope?.id}var yB=class extends v4{#$;#Z=void 0;#J;#X;constructor($,Z){super();this.#$=$,this.setOptions(Z),this.bindMethods(),this.#Q()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let Z=this.options;if(this.options=this.#$.defaultMutationOptions($),!k7(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&R2(Z.mutationKey)!==R2(this.options.mutationKey))this.reset();else if(this.#J?.state.status==="pending")this.#J.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#J?.removeObserver(this)}onMutationUpdate($){this.#Q(),this.#z($)}getCurrentResult(){return this.#Z}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#Q(),this.#z()}mutate($,Z){return this.#X=Z,this.#J?.removeObserver(this),this.#J=this.#$.getMutationCache().build(this.#$,this.options),this.#J.addObserver(this),this.#J.execute($)}#Q(){let $=this.#J?.state??RB();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#z($){v5.batch(()=>{if(this.#X&&this.hasListeners()){let Z=this.#Z.variables,J=this.#Z.context,Q={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#X.onSuccess?.($.data,Z,J,Q)}catch(X){Promise.reject(X)}try{this.#X.onSettled?.($.data,null,Z,J,Q)}catch(X){Promise.reject(X)}}else if($?.type==="error"){try{this.#X.onError?.($.error,Z,J,Q)}catch(X){Promise.reject(X)}try{this.#X.onSettled?.(void 0,$.error,Z,J,Q)}catch(X){Promise.reject(X)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var QA=class extends v4{constructor($={}){super();this.config=$,this.#$=new Map}#$;build($,Z,J){let Q=Z.queryKey,X=Z.queryHash??aZ(Q,Z),z=this.get(X);if(!z)z=new sM({client:$,queryKey:Q,queryHash:X,options:$.defaultQueryOptions(Z),state:J,defaultOptions:$.getQueryDefaults(Q)}),this.add(z);return z}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let Z=this.#$.get($.queryHash);if(Z){if($.destroy(),Z===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){v5.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>lX(Z,J))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((J)=>lX($,J)):Z}notify($){v5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){v5.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){v5.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var bB=class{#$;#Z;#J;#X;#Q;#z;#G;#H;constructor($={}){this.#$=$.queryCache||new QA,this.#Z=$.mutationCache||new JA,this.#J=$.defaultOptions||{},this.#X=new Map,this.#Q=new Map,this.#z=0}mount(){if(this.#z++,this.#z!==1)return;this.#G=S7.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#H=y7.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#z--,this.#z!==0)return;this.#G?.(),this.#G=void 0,this.#H?.(),this.#H=void 0}isFetching($){return this.#$.findAll({...$,fetchStatus:"fetching"}).length}isMutating($){return this.#Z.findAll({...$,status:"pending"}).length}getQueryData($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state.data}ensureQueryData($){let Z=this.defaultQueryOptions($),J=this.#$.build(this,Z),Q=J.state.data;if(Q===void 0)return this.fetchQuery($);if($.revalidateIfStale&&J.isStaleByTime(G2(Z.staleTime,J)))this.prefetchQuery(Z);return Promise.resolve(Q)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:J})=>{let Q=J.data;return[Z,Q]})}setQueryData($,Z,J){let Q=this.defaultQueryOptions({queryKey:$}),z=this.#$.get(Q.queryHash)?.state.data,G=cM(Z,z);if(G===void 0)return;return this.#$.build(this,Q).setData(G,{...J,manual:!0})}setQueriesData($,Z,J){return v5.batch(()=>this.#$.findAll($).map(({queryKey:Q})=>[Q,this.setQueryData(Q,Z,J)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;v5.batch(()=>{Z.findAll($).forEach((J)=>{Z.remove(J)})})}resetQueries($,Z){let J=this.#$;return v5.batch(()=>{return J.findAll($).forEach((Q)=>{Q.reset()}),this.refetchQueries({type:"active",...$},Z)})}cancelQueries($,Z={}){let J={revert:!0,...Z},Q=v5.batch(()=>this.#$.findAll($).map((X)=>X.cancel(J)));return Promise.all(Q).then(R1).catch(R1)}invalidateQueries($,Z={}){return v5.batch(()=>{if(this.#$.findAll($).forEach((J)=>{J.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let J={...Z,cancelRefetch:Z.cancelRefetch??!0},Q=v5.batch(()=>this.#$.findAll($).filter((X)=>!X.isDisabled()&&!X.isStatic()).map((X)=>{let z=X.fetch(void 0,J);if(!J.throwOnError)z=z.catch(R1);return X.state.fetchStatus==="paused"?Promise.resolve():z}));return Promise.all(Q).then(R1)}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z);return J.isStaleByTime(G2(Z.staleTime,J))?J.fetch(Z):Promise.resolve(J.state.data)}prefetchQuery($){return this.fetchQuery($).then(R1).catch(R1)}fetchInfiniteQuery($){return $.behavior=IB($.pages),this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(R1).catch(R1)}ensureInfiniteQueryData($){return $.behavior=IB($.pages),this.ensureQueryData($)}resumePausedMutations(){if(y7.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#J}setDefaultOptions($){this.#J=$}setQueryDefaults($,Z){this.#X.set(R2($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#X.values()],J={};return Z.forEach((Q)=>{if(H3($,Q.queryKey))Object.assign(J,Q.defaultOptions)}),J}setMutationDefaults($,Z){this.#Q.set(R2($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#Q.values()],J={};return Z.forEach((Q)=>{if(H3($,Q.mutationKey))Object.assign(J,Q.defaultOptions)}),J}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#J.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=aZ(Z.queryKey,Z);if(Z.refetchOnReconnect===void 0)Z.refetchOnReconnect=Z.networkMode!=="always";if(Z.throwOnError===void 0)Z.throwOnError=!!Z.suspense;if(!Z.networkMode&&Z.persister)Z.networkMode="offlineFirst";if(Z.queryFn===I7)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#J.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var d9=P(v(),1);var b7=P(v(),1),XA=P(c(),1),xB=b7.createContext(void 0),s0=($)=>{let Z=b7.useContext(xB);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},hB=({client:$,children:Z})=>{return b7.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),XA.jsx(xB.Provider,{value:$,children:Z})};var tZ=P(v(),1),Fu=P(c(),1);function Nu(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var Vu=tZ.createContext(Nu()),zA=()=>tZ.useContext(Vu);var GA=P(v(),1);var HA=($,Z,J)=>{let Q=J?.state.error&&typeof $.throwOnError==="function"?R7($.throwOnError,[J.state.error,J]):$.throwOnError;if($.suspense||$.experimental_prefetchInRender||Q){if(!Z.isReset())$.retryOnMount=!1}},YA=($)=>{GA.useEffect(()=>{$.clearReset()},[$])},KA=({result:$,errorResetBoundary:Z,throwOnError:J,query:Q,suspense:X})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&Q&&(X&&$.data===void 0||R7(J,[$.error,Q]))};var tX=P(v(),1),WA=tX.createContext(!1),BA=()=>tX.useContext(WA),lQ0=WA.Provider;var qA=($)=>{if($.suspense){let J=(X)=>X==="static"?X:Math.max(X??1000,1000),Q=$.staleTime;if($.staleTime=typeof Q==="function"?(...X)=>J(Q(...X)):J(Q),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},UA=($,Z)=>$.isLoading&&$.isFetching&&!Z,FA=($,Z)=>$?.suspense&&Z.isPending,gB=($,Z,J)=>Z.fetchOptimistic($).catch(()=>{J.clearReset()});function NA($,Z,J){let Q=BA(),X=zA(),z=s0(J),G=z.defaultQueryOptions($);z.getDefaultOptions().queries?._experimental_beforeQuery?.(G);let H=z.getQueryCache().get(G.queryHash);G._optimisticResults=Q?"isRestoring":"optimistic",qA(G),HA(G,X,H),YA(X);let Y=!z.getQueryCache().get(G.queryHash),[K]=d9.useState(()=>new Z(z,G)),W=K.getOptimisticResult(G),B=!Q&&$.subscribed!==!1;if(d9.useSyncExternalStore(d9.useCallback((q)=>{let U=B?K.subscribe(v5.batchCalls(q)):R1;return K.updateResult(),U},[K,B]),()=>K.getCurrentResult(),()=>K.getCurrentResult()),d9.useEffect(()=>{K.setOptions(G)},[G,K]),FA(G,W))throw gB(G,K,X);if(KA({result:W,errorResetBoundary:X,throwOnError:G.throwOnError,query:H,suspense:G.suspense}))throw W.error;if(z.getDefaultOptions().queries?._experimental_afterQuery?.(G,W),G.experimental_prefetchInRender&&!y2.isServer()&&UA(W,Q))(Y?gB(G,K,X):H?.promise)?.catch(R1).finally(()=>{K.updateResult()});return!G.notifyOnChangeProps?K.trackResult(W):W}function $1($,Z){return NA($,SB,Z)}var P9=P(v(),1);function vB($,Z){let J=s0(Z);return LA({filters:{...$,status:"pending"}},J).length}function VA($,Z){return $.findAll(Z.filters).map((J)=>Z.select?Z.select(J):J.state)}function LA($={},Z){let J=s0(Z).getMutationCache(),Q=P9.useRef($),X=P9.useRef(null);if(X.current===null)X.current=VA(J,$);return P9.useEffect(()=>{Q.current=$}),P9.useSyncExternalStore(P9.useCallback((z)=>J.subscribe(()=>{let G=nZ(X.current,VA(J,Q.current));if(X.current!==G)X.current=G,v5.schedule(z)}),[J]),()=>X.current,()=>X.current)}var w9=P(v(),1);function Z1($,Z){let J=s0(Z),[Q]=w9.useState(()=>new yB(J,$));w9.useEffect(()=>{Q.setOptions($)},[Q,$]);let X=w9.useSyncExternalStore(w9.useCallback((G)=>Q.subscribe(v5.batchCalls(G)),[Q]),()=>Q.getCurrentResult(),()=>Q.getCurrentResult()),z=w9.useCallback((G,H)=>{Q.mutate(G,H).catch(R1)},[Q]);if(X.error&&R7(Q.options.throwOnError,[X.error]))throw X.error;return{...X,mutate:z,mutateAsync:X.mutate}}var $u=P(GJ0(),1);function MA($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var J,Q,X,z,G=[],H="",Y=$.split("/");Y[0]||Y.shift();while(X=Y.shift())if(J=X[0],J==="*")G.push(J),H+=X[1]==="?"?"(?:/(.*))?":"/(.*)";else if(J===":"){if(Q=X.indexOf("?",1),z=X.indexOf(".",1),G.push(X.substring(1,~Q?Q:~z?z:X.length)),H+=!!~Q&&!~z?"(?:/([^/]+?))?":"/([^/]+?)",~z)H+=(~Q?"?":"")+"\\"+X.substring(z)}else H+="/"+X;return{keys:G,pattern:new RegExp("^"+H+(Z?"(?=$|/)":"/?$"),"i")}}var Y3=P(v(),1),j5=P(v(),1);var $z=P(eX(),1);var Eu=Y3.useInsertionEffect,Su=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mB=Su?Y3.useLayoutEffect:Y3.useEffect,ku=Eu||mB,Zz=($)=>{let Z=Y3.useRef([$,(...J)=>Z[0](...J)]).current;return ku(()=>{Z[0]=$}),Z[1]};var Iu="popstate",pB="pushState",uB="replaceState",Ru="hashchange",AA=[Iu,pB,uB,Ru],yu=($)=>{for(let Z of AA)addEventListener(Z,$);return()=>{for(let Z of AA)removeEventListener(Z,$)}},cB=($,Z)=>$z.useSyncExternalStore(yu,$,Z),_A=()=>location.search,PA=({ssrSearch:$}={})=>cB(_A,$!=null?()=>$:_A),DA=()=>location.pathname,bu=({ssrPath:$}={})=>cB(DA,$!=null?()=>$:DA),xu=()=>history.state,wA=()=>cB(xu,()=>null),hu=($,{replace:Z=!1,state:J=null}={})=>history[Z?uB:pB](J,"",$),jA=($={})=>[bu($),hu],OA=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[OA]>"u"){for(let $ of[pB,uB]){let Z=history[$];history[$]=function(){let J=Z.apply(this,arguments),Q=new Event($);return Q.arguments=arguments,dispatchEvent(Q),J}}Object.defineProperty(window,OA,{value:!0})}var gu=($,Z)=>!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z,CA=($="")=>$==="/"?"":$,EA=($,Z)=>$[0]==="~"?$.slice(1):CA(Z)+$,SA=($="",Z)=>gu(TA(CA($)),TA(Z));var TA=($)=>{try{return decodeURI($)}catch(Z){return $}};var IA={hook:jA,searchHook:PA,parser:MA,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,J)=>$(Z,J)},RA=j5.createContext(IA),x7=()=>j5.useContext(RA),yA={},bA=j5.createContext(yA),dB=()=>j5.useContext(bA),eZ=($)=>{let[Z,J]=$.hook($);return[SA($.base,Z),Zz((Q,X)=>$.aroundNav(J,EA(Q,$.base),X))]},f4=()=>eZ(x7());var xA=($,Z,J,Q)=>{let{pattern:X,keys:z}=Z instanceof RegExp?{keys:!1,pattern:Z}:$(Z||"*",Q),G=X.exec(J)||[],[H,...Y]=G;return H!==void 0?[!0,(()=>{let K=z!==!1?Object.fromEntries(z.map((B,q)=>[B,Y[q]])):G.groups,W={...Y};return K&&Object.assign(W,K),W})(),...Q?[H]:[]]:[!1,null]};var lB=({children:$,...Z})=>{let J=x7(),Q=Z.hook?IA:J,X=Q,[z,G=Z.ssrSearch??""]=Z.ssrPath?.split("?")??[];if(z)Z.ssrSearch=G,Z.ssrPath=z;Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let H=j5.useRef({}),Y=H.current,K=Y;for(let W in Q){let B=W==="base"?Q[W]+(Z[W]??""):Z[W]??Q[W];if(Y===K&&B!==K[W])H.current=K={...K};if(K[W]=B,B!==Q[W]||B!==X[W])X=K}return j5.createElement(RA.Provider,{value:X,children:$})},kA=({children:$,component:Z},J)=>{if(Z)return j5.createElement(Z,{params:J});return typeof $==="function"?$(J):$},vu=($)=>{let Z=j5.useRef(yA),J=Z.current;return Z.current=Object.keys($).length!==Object.keys(J).length||Object.entries($).some(([Q,X])=>X!==J[Q])?$:J};var Jz=({path:$,nest:Z,match:J,...Q})=>{let X=x7(),[z]=eZ(X),[G,H,Y]=J??xA(X.parser,$,z,Z),K=vu({...dB(),...H});if(!G)return null;let W=Y?j5.createElement(lB,{base:Y},kA(Q,K)):kA(Q,K);return j5.createElement(bA.Provider,{value:K,children:W})},$J=j5.forwardRef(($,Z)=>{let J=x7(),[Q,X]=eZ(J),{to:z="",href:G=z,onClick:H,asChild:Y,children:K,className:W,replace:B,state:q,transition:U,...F}=$,N=Zz((V)=>{if(V.ctrlKey||V.metaKey||V.altKey||V.shiftKey||V.button!==0)return;if(H?.(V),!V.defaultPrevented)V.preventDefault(),X(G,$)}),L=J.hrefs(G[0]==="~"?G.slice(1):J.base+G,J);return Y&&j5.isValidElement(K)?j5.cloneElement(K,{onClick:N,href:L}):j5.createElement("a",{...F,onClick:N,href:L,className:W?.call?W(Q===G):W,children:K,ref:Z})}),hA=($)=>Array.isArray($)?$.flatMap((Z)=>hA(Z&&Z.type===j5.Fragment?Z.props.children:Z)):[$],gA=({children:$,location:Z})=>{let J=x7(),[Q]=eZ(J);for(let X of hA($)){let z=0;if(j5.isValidElement(X)&&(z=xA(J.parser,X.props.path,Z||Q,X.props.nest))[0])return j5.cloneElement(X,{match:z})}return null},vA=($)=>{let{to:Z,href:J=Z}=$,Q=x7(),[,X]=eZ(Q),z=Zz(()=>X(Z||J,$)),{ssrContext:G}=Q;if(mB(()=>{z()},[]),G)G.redirectTo=Z;return null};var R8={};D4(R8,{useToastManager:()=>RD,createToastManager:()=>yD,Viewport:()=>E_,Title:()=>u_,Root:()=>b_,Provider:()=>P_,Positioner:()=>SD,Portal:()=>ND,Description:()=>m_,Content:()=>x_,Close:()=>c_,Arrow:()=>ID,Action:()=>l_});var D_=P(v(),1);var fA=P(v(),1),fu=[];function C8($){fA.useEffect($,fu)}var Qz=P(v(),1),ZJ=Qz.createContext(void 0);function l9(){let $=Qz.useContext(ZJ);if(!$)throw Error(S0(73));return $}var zz=Symbol("NOT_FOUND");function mu($,Z=`expected a function, instead received ${typeof $}`){if(typeof $!=="function")throw TypeError(Z)}function pu($,Z=`expected an object, instead received ${typeof $}`){if(typeof $!=="object")throw TypeError(Z)}function uu($,Z="expected all items to be functions, instead received the following types: "){if(!$.every((J)=>typeof J==="function")){let J=$.map((Q)=>typeof Q==="function"?`function ${Q.name||"unnamed"}()`:typeof Q).join(", ");throw TypeError(`${Z}[${J}]`)}}var mA=($)=>{return Array.isArray($)?$:[$]};function cu($){let Z=Array.isArray($[0])?$[0]:$;return uu(Z,"createSelector expects all input-selectors to be functions, but received the following types: "),Z}function du($,Z){let J=[],{length:Q}=$;for(let X=0;X<Q;X++)J.push($[X].apply(null,Z));return J}var pA=0,lu=null,cA=class{revision=pA;_value;_lastValue;_isEqual=iB;constructor($,Z=iB){this._value=this._lastValue=$,this._isEqual=Z}get value(){return lu?.add(this),this._value}set value($){if(this.value===$)return;this._value=$,this.revision=++pA}};function iB($,Z){return $===Z}function rB($){if(!($ instanceof cA))console.warn("Not a valid cell! ",$);return $.value}function iu($,Z=iB){return new cA($,Z)}var ru=($,Z)=>!1;function Gz(){return iu(null,ru)}var dA=($)=>{let Z=$.collectionTag;if(Z===null)Z=$.collectionTag=Gz();rB(Z)};var Wz0=Symbol(),lA=0,au=Object.getPrototypeOf({}),nu=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy(this,JJ);tag=Gz();tags={};children={};collectionTag=null;id=lA++},JJ={get($,Z){function J(){let{value:X}=$,z=Reflect.get(X,Z);if(typeof Z==="symbol")return z;if(Z in au)return z;if(typeof z==="object"&&z!==null){let G=$.children[Z];if(G===void 0)G=$.children[Z]=tu(z);if(G.tag)rB(G.tag);return G.proxy}else{let G=$.tags[Z];if(G===void 0)G=$.tags[Z]=Gz(),G.value=z;return rB(G),z}}return J()},ownKeys($){return dA($),Reflect.ownKeys($.value)},getOwnPropertyDescriptor($,Z){return Reflect.getOwnPropertyDescriptor($.value,Z)},has($,Z){return Reflect.has($.value,Z)}},ou=class{constructor($){this.value=$,this.value=$,this.tag.value=$}proxy=new Proxy([this],su);tag=Gz();tags={};children={};collectionTag=null;id=lA++},su={get([$],Z){if(Z==="length")dA($);return JJ.get($,Z)},ownKeys([$]){return JJ.ownKeys($)},getOwnPropertyDescriptor([$],Z){return JJ.getOwnPropertyDescriptor($,Z)},has([$],Z){return JJ.has($,Z)}};function tu($){if(Array.isArray($))return new ou($);return new nu($)}function eu($){let Z;return{get(J){if(Z&&$(Z.key,J))return Z.value;return zz},put(J,Q){Z={key:J,value:Q}},getEntries(){return Z?[Z]:[]},clear(){Z=void 0}}}function $c($,Z){let J=[];function Q(H){let Y=J.findIndex((K)=>Z(H,K.key));if(Y>-1){let K=J[Y];if(Y>0)J.splice(Y,1),J.unshift(K);return K.value}return zz}function X(H,Y){if(Q(H)===zz){if(J.unshift({key:H,value:Y}),J.length>$)J.pop()}}function z(){return J}function G(){J=[]}return{get:Q,put:X,getEntries:z,clear:G}}var Zc=($,Z)=>$===Z;function Jc($){return function(J,Q){if(J===null||Q===null||J.length!==Q.length)return!1;let{length:X}=J;for(let z=0;z<X;z++)if(!$(J[z],Q[z]))return!1;return!0}}function iA($,Z){let J=typeof Z==="object"?Z:{equalityCheck:Z},{equalityCheck:Q=Zc,maxSize:X=1,resultEqualityCheck:z}=J,G=Jc(Q),H=0,Y=X<=1?eu(G):$c(X,G);function K(){let W=Y.get(arguments);if(W===zz){if(W=$.apply(null,arguments),H++,z){let q=Y.getEntries().find((U)=>z(U.value,W));if(q)W=q.value,H!==0&&H--}Y.put(arguments,W)}return W}return K.clearCache=()=>{Y.clear(),K.resetResultsCount()},K.resultsCount=()=>H,K.resetResultsCount=()=>{H=0},K}var Qc=class{constructor($){this.value=$}deref(){return this.value}},Xc=typeof WeakRef<"u"?WeakRef:Qc,zc=0,uA=1;function Xz(){return{s:zc,v:void 0,o:null,p:null}}function rA($,Z={}){let J=Xz(),{resultEqualityCheck:Q}=Z,X,z=0;function G(){let H=J,{length:Y}=arguments;for(let B=0,q=Y;B<q;B++){let U=arguments[B];if(typeof U==="function"||typeof U==="object"&&U!==null){let F=H.o;if(F===null)H.o=F=new WeakMap;let N=F.get(U);if(N===void 0)H=Xz(),F.set(U,H);else H=N}else{let F=H.p;if(F===null)H.p=F=new Map;let N=F.get(U);if(N===void 0)H=Xz(),F.set(U,H);else H=N}}let K=H,W;if(H.s===uA)W=H.v;else if(W=$.apply(null,arguments),z++,Q){let B=X?.deref?.()??X;if(B!=null&&Q(B,W))W=B,z!==0&&z--;X=typeof W==="object"&&W!==null||typeof W==="function"?new Xc(W):W}return K.s=uA,K.v=W,W}return G.clearCache=()=>{J=Xz(),G.resetResultsCount()},G.resultsCount=()=>z,G.resetResultsCount=()=>{z=0},G}function aB($,...Z){let J=typeof $==="function"?{memoize:$,memoizeOptions:Z}:$,Q=(...X)=>{let z=0,G=0,H,Y={},K=X.pop();if(typeof K==="object")Y=K,K=X.pop();mu(K,`createSelector expects an output function after the inputs, but received: [${typeof K}]`);let W={...J,...Y},{memoize:B,memoizeOptions:q=[],argsMemoize:U=rA,argsMemoizeOptions:F=[],devModeChecks:N={}}=W,L=mA(q),V=mA(F),M=cu(X),_=B(function(){return z++,K.apply(null,arguments)},...L),O=!0,D=U(function(){G++;let C=du(M,arguments);return H=_.apply(null,C),H},...V);return Object.assign(D,{resultFunc:K,memoizedResultFunc:_,dependencies:M,dependencyRecomputations:()=>G,resetDependencyRecomputations:()=>{G=0},lastResult:()=>H,recomputations:()=>z,resetRecomputations:()=>{z=0},memoize:B,argsMemoize:U})};return Object.assign(Q,{withTypes:()=>Q}),Q}var Gc=aB(rA),Hc=Object.assign(($,Z=Gc)=>{pu($,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof $}`);let J=Object.keys($),Q=J.map((z)=>$[z]);return Z(Q,(...z)=>{return z.reduce((G,H,Y)=>{return G[J[Y]]=H,G},{})})},{withTypes:()=>Hc});var Yc=aB({memoize:iA,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),k0=($,Z,J,Q,X,z,...G)=>{if(G.length>0)throw Error(S0(1));let H;if($&&Z&&J&&Q&&X&&z)H=(Y,K,W,B)=>{let q=$(Y,K,W,B),U=Z(Y,K,W,B),F=J(Y,K,W,B),N=Q(Y,K,W,B),L=X(Y,K,W,B);return z(q,U,F,N,L,K,W,B)};else if($&&Z&&J&&Q&&X)H=(Y,K,W,B)=>{let q=$(Y,K,W,B),U=Z(Y,K,W,B),F=J(Y,K,W,B),N=Q(Y,K,W,B);return X(q,U,F,N,K,W,B)};else if($&&Z&&J&&Q)H=(Y,K,W,B)=>{let q=$(Y,K,W,B),U=Z(Y,K,W,B),F=J(Y,K,W,B);return Q(q,U,F,K,W,B)};else if($&&Z&&J)H=(Y,K,W,B)=>{let q=$(Y,K,W,B),U=Z(Y,K,W,B);return J(q,U,K,W,B)};else if($&&Z)H=(Y,K,W,B)=>{let q=$(Y,K,W,B);return Z(q,K,W,B)};else if($)H=$;else throw Error("Missing arguments");return H},aA=(...$)=>{let Z=new WeakMap,J=1,Q=$[$.length-1],X=$.length-1||1,z=Q.length-X;if(z>3)throw Error(S0(2));return(H,Y,K,W)=>{let B=H.__cacheKey__;if(!B)B={id:J},H.__cacheKey__=B,J+=1;let q=Z.get(B);if(!q){let U=$,F=[void 0,void 0,void 0];switch(z){case 0:break;case 1:{U=[...$.slice(0,-1),()=>F[0],Q];break}case 2:{U=[...$.slice(0,-1),()=>F[0],()=>F[1],Q];break}case 3:{U=[...$.slice(0,-1),()=>F[0],()=>F[1],()=>F[2],Q];break}default:throw Error(S0(2))}q=Yc(...U),q.selectorArgs=F,Z.set(B,q)}switch(q.selectorArgs[0]=Y,q.selectorArgs[1]=K,q.selectorArgs[2]=W,z){case 0:return q(H);case 1:return q(H,Y);case 2:return q(H,Y,K);case 3:return q(H,Y,K,W);default:throw Error("unreachable")}}};var tA=P(v(),1),tB=P(eX(),1);var i9=P(v(),1),Kc=eX();function Wc($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var Bc=typeof Object.is==="function"?Object.is:Wc,qc=Kc.useSyncExternalStore,Uc=i9.useRef,Fc=i9.useEffect,Nc=i9.useMemo,Vc=i9.useDebugValue;var nB=function($,Z,J,Q,X){var z=Uc(null);if(z.current===null){var G={hasValue:!1,value:null};z.current=G}else G=z.current;z=Nc(function(){function Y(U){if(!K){if(K=!0,W=U,U=Q(U),X!==void 0&&G.hasValue){var F=G.value;if(X(F,U))return B=F}return B=U}if(F=B,Bc(W,U))return F;var N=Q(U);if(X!==void 0&&X(F,N))return W=U,F;return W=U,B=N}var K=!1,W,B,q=J===void 0?null:J;return[function(){return Y(Z())},q===null?void 0:function(){return Y(q())}]},[Z,J,Q,X]);var H=qc($,z[0],z[1]);return Fc(function(){G.hasValue=!0,G.value=H},[H]),Vc(H),H};var nA=P(v(),1);var oB=[],sB=void 0;function oA(){return sB}function sA($){oB.push($)}function QJ($){let Z=(J,Q)=>{let X=S5(Lc).current,z;try{sB=X;for(let G of oB)G.before(X);z=$(J,Q);for(let G of oB)G.after(X);X.didInitialize=!0}finally{sB=void 0}return z};return Z.displayName=$.displayName||$.name,Z}function Hz($){return nA.forwardRef(QJ($))}function Lc(){return{didInitialize:!1}}var Mc=Yz(19),Ac=Mc?Dc:Oc;function Kz($,Z,J,Q,X){return Ac($,Z,J,Q,X)}function _c($,Z,J,Q,X){let z=tA.useCallback(()=>Z($.getSnapshot(),J,Q,X),[$,Z,J,Q,X]);return tB.useSyncExternalStore($.subscribe,z,z)}sA({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let J=0;J<$.syncHooks.length;J+=1){let Q=$.syncHooks[J],X=Q.selector(Q.store.state,Q.a1,Q.a2,Q.a3);if(Q.didChange||!Object.is(Q.value,X))Z=!0,Q.value=X,Q.didChange=!1}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let J=new Set;for(let X of $.syncHooks)J.add(X.store);let Q=[];for(let X of J)Q.push(X.subscribe(Z));return()=>{for(let X of Q)X()}};tB.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function Dc($,Z,J,Q,X){let z=oA();if(!z)return _c($,Z,J,Q,X);let G=z.syncIndex;z.syncIndex+=1;let H;if(!z.didInitialize)H={store:$,selector:Z,a1:J,a2:Q,a3:X,value:Z($.getSnapshot(),J,Q,X),didChange:!1},z.syncHooks.push(H);else if(H=z.syncHooks[G],H.store!==$||H.selector!==Z||!Object.is(H.a1,J)||!Object.is(H.a2,Q)||!Object.is(H.a3,X)){if(H.store!==$)z.didChangeStore=!0;H.store=$,H.selector=Z,H.a1=J,H.a2=Q,H.a3=X,H.didChange=!0}return H.value}function Oc($,Z,J,Q,X){return nB($.subscribe,$.getSnapshot,$.getSnapshot,(z)=>Z(z,J,Q,X))}class eB{constructor($){this.state=$,this.listeners=new Set,this.updateTick=0}subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};getSnapshot=()=>{return this.state};setState($){if(this.state===$)return;this.state=$,this.updateTick+=1;let Z=this.updateTick;for(let J of this.listeners){if(Z!==this.updateTick)return;J($)}}update($){for(let Z in $)if(!Object.is(this.state[Z],$[Z])){this.setState({...this.state,...$});return}}set($,Z){if(!Object.is(this.state[$],Z))this.setState({...this.state,[$]:Z})}notifyAll(){let $={...this.state};this.setState($)}use($,Z,J,Q){return Kz(this,$,Z,J,Q)}}var K3=P(v(),1);class i8 extends eB{constructor($,Z={},J){super($);this.context=Z,this.selectors=J}useSyncedValue($,Z){K3.useDebugValue($),B0(()=>{if(this.state[$]!==Z)this.set($,Z)},[$,Z])}useSyncedValueWithCleanup($,Z){let J=this;B0(()=>{if(J.state[$]!==Z)J.set($,Z);return()=>{J.set($,void 0)}},[J,$,Z])}useSyncedValues($){let Z=this,J=Object.values($);B0(()=>{Z.update($)},[Z,...J])}useControlledProp($,Z){K3.useDebugValue($);let J=Z!==void 0;B0(()=>{if(J&&!Object.is(this.state[$],Z))super.setState({...this.state,[$]:Z})},[$,Z,J])}select($,Z,J,Q){let X=this.selectors[$];return X(this.state,Z,J,Q)}useState($,Z,J,Q){return K3.useDebugValue($),Kz(this,this.selectors[$],Z,J,Q)}useContextCallback($,Z){K3.useDebugValue($);let J=q0(Z??m5);this.context[$]=J}useStateSetter($){let Z=K3.useRef(void 0);if(Z.current===void 0)Z.current=(J)=>{this.set($,J)};return Z.current}observe($,Z){let J;if(typeof $==="function")J=$;else J=this.selectors[$];let Q=J(this.state);return Z(Q,Q,this),this.subscribe((X)=>{let z=J(X);if(!Object.is(Q,z)){let G=Q;Q=z,Z(z,G,this)}})}}var Wz=null,hz0=globalThis.requestAnimationFrame;class eA{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,J=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,J>0)for(let Q=0;Q<Z.length;Q+=1)Z[Q]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let J=!1;if(!this.isScheduled||J)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var Bz=new eA;class K1{static create(){return new K1}static request($){return Bz.request($)}static cancel($){return Bz.cancel($)}currentId=Wz;request($){this.cancel(),this.currentId=Bz.request(()=>{this.currentId=Wz,$()})}cancel=()=>{if(this.currentId!==Wz)Bz.cancel(this.currentId),this.currentId=Wz};disposeEffect=()=>{return this.cancel}}function G4(){let $=S5(K1.create).current;return C8($.disposeEffect),$}var XJ=0;class i1{static create(){return new i1}currentId=XJ;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=XJ,Z()},$)}isStarted(){return this.currentId!==XJ}clear=()=>{if(this.currentId!==XJ)clearTimeout(this.currentId),this.currentId=XJ};disposeEffect=()=>{return this.clear}}function L1(){let $=S5(i1.create).current;return C8($.disposeEffect),$}var $_=0;function qz($){return $_+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${$_}`}function u0($){return $?.ownerDocument||document}function Uz($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let J=$(Z);return typeof J==="string"?{description:J}:J}return $}var r9=typeof navigator<"u",$q=Pc(),Z_=jc(),Fz=wc(),Nz=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Vz=$q.platform==="MacIntel"&&$q.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test($q.platform),lz0=r9&&/firefox/i.test(Fz),Lz=r9&&/apple/i.test(navigator.vendor),iz0=r9&&/Edg/i.test(Fz),Mz=r9&&/android/i.test(Z_)||/android/i.test(Fz),J_=r9&&Z_.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Az=Fz.includes("jsdom/");function Pc(){if(!r9)return{platform:"",maxTouchPoints:-1};let $=navigator.userAgentData;if($?.platform)return{platform:$.platform,maxTouchPoints:navigator.maxTouchPoints};return{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function wc(){if(!r9)return"";let $=navigator.userAgentData;if($&&Array.isArray($.brands))return $.brands.map(({brand:Z,version:J})=>`${Z}/${J}`).join(" ");return navigator.userAgent}function jc(){if(!r9)return"";let $=navigator.userAgentData;if($?.platform)return $.platform;return navigator.platform??""}var zJ="data-base-ui-focusable",Zq="active",Jq="selected",h7="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",b2="ArrowLeft",x2="ArrowRight",GJ="ArrowUp",W3="ArrowDown";function a5($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function p0($,Z){if(!$||!Z)return!1;let J=Z.getRootNode?.();if($.contains(Z))return!0;if(J&&Q_(J)){let Q=Z;while(Q){if($===Q)return!0;Q=Q.parentNode||Q.host}}return!1}function B3($,Z){if(!D5($))return!1;let J=$;if(Z.hasElement(J))return!J.hasAttribute("data-trigger-disabled");for(let[,Q]of Z.entries())if(p0(Q,J))return!Q.hasAttribute("data-trigger-disabled");return!1}function y5($){if("composedPath"in $)return $.composedPath()[0];return $.target}function m4($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let J=$;return J.target!=null&&Z.contains(J.target)}function X_($){return $.matches("html,body")}function q3($){return M1($)&&$.matches(h7)}function HJ($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&q3($)}function a9($){if(!$||Az)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function U3($){if(!$)return null;return $.hasAttribute(zJ)?$:$.querySelector(`[${zJ}]`)||$}function h2($,Z,J=!0){return $.filter((X)=>X.parentId===Z&&(!J||X.context?.open)).flatMap((X)=>[X,...h2($,X.id,J)])}function Qq($,Z){let J=[],Q=$.find((X)=>X.id===Z)?.parentId;while(Q){let X=$.find((z)=>z.id===Q);if(Q=X?.parentId,X)J=J.concat(X)}return J}function r1($){$.preventDefault(),$.stopPropagation()}function z_($){return"nativeEvent"in $}function _z($){if($.pointerType===""&&$.isTrusted)return!0;if(Mz&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function Dz($){if(Az)return!1;return!Mz&&$.width===0&&$.height===0||Mz&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function p4($,Z){let J=["mouse","pen"];if(!Z)J.push("",void 0);return J.includes($)}function Oz($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}function Pz($,Z,J){return Math.floor($/Z)!==J}function g7($,Z){return Z<0||Z>=$.current.length}function wz($,Z){return _8($,{disabledIndices:Z})}function zq($,Z){return _8($,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function _8($,{startingIndex:Z=-1,decrement:J=!1,disabledIndices:Q,amount:X=1}={}){let z=Z;do z+=J?-X:X;while(z>=0&&z<=$.current.length-1&&v7($,z,Q));return z}function G_($,{event:Z,orientation:J,loopFocus:Q,rtl:X,cols:z,disabledIndices:G,minIndex:H,maxIndex:Y,prevIndex:K,stopEvent:W=!1}){let B=K,q=[],U={},F=!1;{let V=null,M=-1;$.current.forEach((_,O)=>{if(_==null)return;let D=_.closest('[role="row"]');if(D)F=!0;if(D!==V||M===-1)V=D,M+=1,q[M]=[];q[M].push(O),U[O]=M})}let N=F&&q.length>0&&q.some((V)=>V.length!==z);function L(V){if(!N||K===-1)return;let M=U[K];if(M==null)return;let _=q[M].indexOf(K),O=V==="up"?M-1:M+1;if(Q){if(O<0)O=q.length-1;else if(O>=q.length)O=0}let D=new Set;while(O>=0&&O<q.length&&!D.has(O)){D.add(O);let A=q[O];if(A.length===0){O=V==="up"?O-1:O+1;continue}let C=Math.min(_,A.length-1);for(let I=C;I>=0;I-=1){let y=A[I];if(!v7($,y,G))return y}if(O=V==="up"?O-1:O+1,Q){if(O<0)O=q.length-1;else if(O>=q.length)O=0}}return}if(Z.key===GJ){let V=L("up");if(V!==void 0){if(W)r1(Z);B=V}else{if(W)r1(Z);if(K===-1)B=Y;else if(B=_8($,{startingIndex:B,amount:z,decrement:!0,disabledIndices:G}),Q&&(K-z<H||B<0)){let M=K%z,_=Y%z,O=Y-(_-M);if(_===M)B=Y;else B=_>M?O:O-z}if(g7($,B))B=K}}if(Z.key===W3){let V=L("down");if(V!==void 0){if(W)r1(Z);B=V}else{if(W)r1(Z);if(K===-1)B=H;else if(B=_8($,{startingIndex:K,amount:z,disabledIndices:G}),Q&&K+z>Y)B=_8($,{startingIndex:K%z-z,amount:z,disabledIndices:G});if(g7($,B))B=K}}if(J==="both"){let V=Xq(K/z);if(Z.key===(X?b2:x2)){if(W)r1(Z);if(K%z!==z-1){if(B=_8($,{startingIndex:K,disabledIndices:G}),Q&&Pz(B,z,V))B=_8($,{startingIndex:K-K%z-1,disabledIndices:G})}else if(Q)B=_8($,{startingIndex:K-K%z-1,disabledIndices:G});if(Pz(B,z,V))B=K}if(Z.key===(X?x2:b2)){if(W)r1(Z);if(K%z!==0){if(B=_8($,{startingIndex:K,decrement:!0,disabledIndices:G}),Q&&Pz(B,z,V))B=_8($,{startingIndex:K+(z-K%z),decrement:!0,disabledIndices:G})}else if(Q)B=_8($,{startingIndex:K+(z-K%z),decrement:!0,disabledIndices:G});if(Pz(B,z,V))B=K}let M=Xq(Y/z)===V;if(g7($,B))if(Q&&M)B=Z.key===(X?x2:b2)?Y:_8($,{startingIndex:K-K%z-1,disabledIndices:G});else B=K}return B}function H_($,Z,J){let Q=[],X=0;return $.forEach(({width:z,height:G},H)=>{if(z>Z);let Y=!1;if(J)X=0;while(!Y){let K=[];for(let W=0;W<z;W+=1)for(let B=0;B<G;B+=1)K.push(X+W+B*Z);if(X%Z+z<=Z&&K.every((W)=>Q[W]==null))K.forEach((W)=>{Q[W]=H}),Y=!0;else X+=1}}),[...Q]}function Y_($,Z,J,Q,X){if($===-1)return-1;let z=J.indexOf($),G=Z[$];switch(X){case"tl":return z;case"tr":if(!G)return z;return z+G.width-1;case"bl":if(!G)return z;return z+(G.height-1)*Q;case"br":return J.lastIndexOf($);default:return-1}}function K_($,Z){return Z.flatMap((J,Q)=>$.includes(J)?[Q]:[])}function v7($,Z,J){if(typeof J==="function")return J(Z);if(J)return J.includes(Z);let Q=$.current[Z];if(!Q)return!1;return Q.hasAttribute("disabled")||Q.getAttribute("aria-disabled")==="true"}/*!
|
|
7
|
+
* tabbable 6.4.0
|
|
8
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
9
|
+
*/var Tc=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],jz=Tc.join(","),B_=typeof Element>"u",f7=B_?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Tz=!B_&&Element.prototype.getRootNode?function($){var Z;return $===null||$===void 0?void 0:(Z=$.getRootNode)===null||Z===void 0?void 0:Z.call($)}:function($){return $===null||$===void 0?void 0:$.ownerDocument},Cz=function(Z,J){var Q;if(J===void 0)J=!0;var X=Z===null||Z===void 0?void 0:(Q=Z.getAttribute)===null||Q===void 0?void 0:Q.call(Z,"inert"),z=X===""||X==="true",G=z||J&&Z&&(typeof Z.closest==="function"?Z.closest("[inert]"):Cz(Z.parentNode));return G},Cc=function(Z){var J,Q=Z===null||Z===void 0?void 0:(J=Z.getAttribute)===null||J===void 0?void 0:J.call(Z,"contenteditable");return Q===""||Q==="true"},q_=function(Z,J,Q){if(Cz(Z))return[];var X=Array.prototype.slice.apply(Z.querySelectorAll(jz));if(J&&f7.call(Z,jz))X.unshift(Z);return X=X.filter(Q),X},Ez=function(Z,J,Q){var X=[],z=Array.from(Z);while(z.length){var G=z.shift();if(Cz(G,!1))continue;if(G.tagName==="SLOT"){var H=G.assignedElements(),Y=H.length?H:G.children,K=Ez(Y,!0,Q);if(Q.flatten)X.push.apply(X,K);else X.push({scopeParent:G,candidates:K})}else{var W=f7.call(G,jz);if(W&&Q.filter(G)&&(J||!Z.includes(G)))X.push(G);var B=G.shadowRoot||typeof Q.getShadowRoot==="function"&&Q.getShadowRoot(G),q=!Cz(B,!1)&&(!Q.shadowRootFilter||Q.shadowRootFilter(G));if(B&&q){var U=Ez(B===!0?G.children:B.children,!0,Q);if(Q.flatten)X.push.apply(X,U);else X.push({scopeParent:G,candidates:U})}else z.unshift.apply(z,G.children)}}return X},U_=function(Z){return!isNaN(parseInt(Z.getAttribute("tabindex"),10))},F_=function(Z){if(!Z)throw Error("No node provided");if(Z.tabIndex<0){if((/^(AUDIO|VIDEO|DETAILS)$/.test(Z.tagName)||Cc(Z))&&!U_(Z))return 0}return Z.tabIndex},Ec=function(Z,J){var Q=F_(Z);if(Q<0&&J&&!U_(Z))return 0;return Q},Sc=function(Z,J){return Z.tabIndex===J.tabIndex?Z.documentOrder-J.documentOrder:Z.tabIndex-J.tabIndex},N_=function(Z){return Z.tagName==="INPUT"},kc=function(Z){return N_(Z)&&Z.type==="hidden"},Ic=function(Z){var J=Z.tagName==="DETAILS"&&Array.prototype.slice.apply(Z.children).some(function(Q){return Q.tagName==="SUMMARY"});return J},Rc=function(Z,J){for(var Q=0;Q<Z.length;Q++)if(Z[Q].checked&&Z[Q].form===J)return Z[Q]},yc=function(Z){if(!Z.name)return!0;var J=Z.form||Tz(Z),Q=function(H){return J.querySelectorAll('input[type="radio"][name="'+H+'"]')},X;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape==="function")X=Q(window.CSS.escape(Z.name));else try{X=Q(Z.name)}catch(G){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",G.message),!1}var z=Rc(X,Z.form);return!z||z===Z},bc=function(Z){return N_(Z)&&Z.type==="radio"},xc=function(Z){return bc(Z)&&!yc(Z)},hc=function(Z){var J,Q=Z&&Tz(Z),X=(J=Q)===null||J===void 0?void 0:J.host,z=!1;if(Q&&Q!==Z){var G,H,Y;z=!!((G=X)!==null&&G!==void 0&&(H=G.ownerDocument)!==null&&H!==void 0&&H.contains(X)||Z!==null&&Z!==void 0&&(Y=Z.ownerDocument)!==null&&Y!==void 0&&Y.contains(Z));while(!z&&X){var K,W,B;Q=Tz(X),X=(K=Q)===null||K===void 0?void 0:K.host,z=!!((W=X)!==null&&W!==void 0&&(B=W.ownerDocument)!==null&&B!==void 0&&B.contains(X))}}return z},W_=function(Z){var J=Z.getBoundingClientRect(),Q=J.width,X=J.height;return Q===0&&X===0},gc=function(Z,J){var{displayCheck:Q,getShadowRoot:X}=J;if(Q==="full-native"){if("checkVisibility"in Z){var z=Z.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!z}}if(getComputedStyle(Z).visibility==="hidden")return!0;var G=f7.call(Z,"details>summary:first-of-type"),H=G?Z.parentElement:Z;if(f7.call(H,"details:not([open]) *"))return!0;if(!Q||Q==="full"||Q==="full-native"||Q==="legacy-full"){if(typeof X==="function"){var Y=Z;while(Z){var K=Z.parentElement,W=Tz(Z);if(K&&!K.shadowRoot&&X(K)===!0)return W_(Z);else if(Z.assignedSlot)Z=Z.assignedSlot;else if(!K&&W!==Z.ownerDocument)Z=W.host;else Z=K}Z=Y}if(hc(Z))return!Z.getClientRects().length;if(Q!=="legacy-full")return!0}else if(Q==="non-zero-area")return W_(Z);return!1},vc=function(Z){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(Z.tagName)){var J=Z.parentElement;while(J){if(J.tagName==="FIELDSET"&&J.disabled){for(var Q=0;Q<J.children.length;Q++){var X=J.children.item(Q);if(X.tagName==="LEGEND")return f7.call(J,"fieldset[disabled] *")?!0:!X.contains(Z)}return!0}J=J.parentElement}}return!1},Gq=function(Z,J){if(J.disabled||kc(J)||gc(J,Z)||Ic(J)||vc(J))return!1;return!0},Hq=function(Z,J){if(xc(J)||F_(J)<0||!Gq(Z,J))return!1;return!0},fc=function(Z){var J=parseInt(Z.getAttribute("tabindex"),10);if(isNaN(J)||J>=0)return!0;return!1},V_=function(Z){var J=[],Q=[];return Z.forEach(function(X,z){var G=!!X.scopeParent,H=G?X.scopeParent:X,Y=Ec(H,G),K=G?V_(X.candidates):H;if(Y===0)G?J.push.apply(J,K):J.push(H);else Q.push({documentOrder:z,tabIndex:Y,item:X,isScope:G,content:K})}),Q.sort(Sc).reduce(function(X,z){return z.isScope?X.push.apply(X,z.content):X.push(z.content),X},[]).concat(J)},F3=function(Z,J){J=J||{};var Q;if(J.getShadowRoot)Q=Ez([Z],J.includeContainer,{filter:Hq.bind(null,J),flatten:!1,getShadowRoot:J.getShadowRoot,shadowRootFilter:fc});else Q=q_(Z,J.includeContainer,Hq.bind(null,J));return V_(Q)},L_=function(Z,J){J=J||{};var Q;if(J.getShadowRoot)Q=Ez([Z],J.includeContainer,{filter:Gq.bind(null,J),flatten:!0,getShadowRoot:J.getShadowRoot});else Q=q_(Z,J.includeContainer,Gq.bind(null,J));return Q},Yq=function(Z,J){if(J=J||{},!Z)throw Error("No node provided");if(f7.call(Z,jz)===!1)return!1;return Hq(J,Z)};var N3=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function M_($,Z){let J=F3($,N3()),Q=J.length;if(Q===0)return;let X=a5(u0($)),z=J.indexOf(X),G=z===-1?Z===1?0:Q-1:z+Z;return J[G]}function n9($){return M_(u0($).body,1)||$}function Sz($){return M_(u0($).body,-1)||$}function A_($,Z){if(!$)return null;let J=F3(u0($).body,N3()),Q=J.length;if(Q===0)return null;let X=J.indexOf($);if(X===-1)return null;let z=(X+Z+Q)%Q;return J[z]}function kz($){return A_($,1)}function Iz($){return A_($,-1)}function Y2($,Z){let J=Z||$.currentTarget,Q=$.relatedTarget;return!Q||!p0(J,Q)}function __($){F3($,N3()).forEach((J)=>{J.dataset.tabindex=J.getAttribute("tabindex")||"",J.setAttribute("tabindex","-1")})}function Kq($){$.querySelectorAll("[data-tabindex]").forEach((J)=>{let Q=J.dataset.tabindex;if(delete J.dataset.tabindex,Q)J.setAttribute("tabindex",Q);else J.removeAttribute("tabindex")})}var Rz=aA(($)=>$.toasts,($)=>{let Z=new Map,J=0,Q=0;return $.forEach((X,z)=>{let G=X.transitionStatus==="ending";if(Z.set(X.id,{value:X,domIndex:z,visibleIndex:G?-1:J,offsetY:Q}),Q+=X.height||0,!G)J+=1}),Z}),j9={toasts:k0(($)=>$.toasts),isEmpty:k0(($)=>$.toasts.length===0),toast:k0(Rz,($,Z)=>$.get(Z)?.value),toastIndex:k0(Rz,($,Z)=>$.get(Z)?.domIndex??-1),toastOffsetY:k0(Rz,($,Z)=>$.get(Z)?.offsetY??0),toastVisibleIndex:k0(Rz,($,Z)=>$.get(Z)?.visibleIndex??-1),hovering:k0(($)=>$.hovering),focused:k0(($)=>$.focused),expanded:k0(($)=>$.hovering||$.focused),expandedOrOutOfFocus:k0(($)=>$.hovering||$.focused||!$.isWindowFocused),prevFocusElement:k0(($)=>$.prevFocusElement)};class Wq extends i8{timers=new Map;areTimersPaused=!1;constructor($){super($,{},j9)}setFocused($){this.set("focused",$)}setHovering($){this.set("hovering",$)}setIsWindowFocused($){this.set("isWindowFocused",$)}setPrevFocusElement($){this.set("prevFocusElement",$)}setViewport=($)=>{this.set("viewport",$)};disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($){let Z=j9.toastIndex(this.state,$);if(Z===-1)return;this.state.toasts[Z]?.onRemove?.();let Q=[...this.state.toasts];Q.splice(Z,1),this.setToasts(Q)}addToast=($)=>{let{toasts:Z,timeout:J,limit:Q}=this.state,X=$.id||qz("toast"),z={...$,id:X,transitionStatus:"starting"},G=[z,...Z],H=G.filter((K)=>K.transitionStatus!=="ending");if(H.length>Q){let K=H.length-Q,W=H.slice(-K),B=new Set(W.map((q)=>q.id));this.setToasts(G.map((q)=>{let U=B.has(q.id);if(q.limited!==U)return{...q,limited:U};return q}))}else this.setToasts(G.map((K)=>K.limited?{...K,limited:!1}:K));let Y=z.timeout??J;if(z.type!=="loading"&&Y>0)this.scheduleTimer(X,Y,()=>this.closeToast(X));if(j9.expandedOrOutOfFocus(this.state))this.pauseTimers();return X};updateToast=($,Z)=>{this.updateToastInternal($,Z)};updateToastInternal=($,Z)=>{let{timeout:J,toasts:Q}=this.state,X=j9.toast(this.state,$)??null;if(!X)return;if(X.transitionStatus==="ending")return;let z={...X,...Z};this.setToasts(Q.map((U)=>U.id===$?{...U,...Z}:U));let G=z.timeout??J,H=X?.timeout??J,Y=Object.hasOwn(Z,"timeout"),K=z.transitionStatus!=="ending"&&z.type!=="loading"&&G>0,W=this.timers.has($),B=H!==G,q=X?.type==="loading";if(!K&&W){this.timers.get($)?.timeout?.clear(),this.timers.delete($);return}if(K&&(!W||B||Y||q)){let U=this.timers.get($);if(U)U.timeout?.clear(),this.timers.delete($);if(this.scheduleTimer($,G,()=>this.closeToast($)),j9.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{j9.toast(this.state,$)?.onClose?.();let{limit:J,toasts:Q}=this.state,X=0,z=Q.map((H)=>{if(H.id===$)return{...H,transitionStatus:"ending",height:0};if(H.transitionStatus==="ending")return H;let Y=X>=J;return X+=1,H.limited!==Y?{...H,limited:Y}:H}),G=this.timers.get($);if(G&&G.timeout)G.timeout.clear(),this.timers.delete($);this.handleFocusManagement($),this.setToasts(z)};promiseToast=($,Z)=>{let J=Uz(Z.loading),Q=this.addToast({...J,type:"loading"}),X=$.then((z)=>{let G=Uz(Z.success,z);return this.updateToast(Q,{...G,type:"success",timeout:G.timeout}),z}).catch((z)=>{let G=Uz(Z.error,z);return this.updateToast(Q,{...G,type:"error",timeout:G.timeout}),Promise.reject(z)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(X);return X};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout){$.timeout.clear();let Z=Date.now()-$.start,J=$.delay-Z;$.remaining=J>0?J:0}})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=i1.create(),$.timeout.start($.remaining,()=>{this.timers.delete(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=y5($);if(p0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,J){let Q=Date.now(),X=!j9.expandedOrOutOfFocus(this.state),z=X?i1.create():void 0;z?.start(Z,()=>{this.timers.delete($),J()}),this.timers.set($,{timeout:z,start:X?Q:0,delay:Z,remaining:Z,callback:J})}setToasts($){let Z={toasts:$};if($.length===0)Z.hovering=!1,Z.focused=!1;this.update(Z)}handleFocusManagement($){let Z=a5(u0(this.state.viewport));if(!this.state.viewport||!p0(this.state.viewport,Z)||!a9(Z))return;let J=j9.toasts(this.state),Q=j9.toastIndex(this.state,$),X=null,z=Q+1;while(z<J.length){if(J[z].transitionStatus!=="ending"){X=J[z];break}z+=1}if(!X){z=Q-1;while(z>=0){if(J[z].transitionStatus!=="ending"){X=J[z];break}z-=1}}if(X)X.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var O_=P(c(),1),P_=function(Z){let{children:J,timeout:Q=5000,limit:X=3,toastManager:z}=Z,G=S5(()=>new Wq({timeout:Q,limit:X,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return C8(G.disposeEffect),D_.useEffect(function(){if(!z)return;return z[" subscribe"](({action:K,options:W})=>{let B=W.id;if(K==="promise"&&W.promise)G.promiseToast(W.promise,W);else if(K==="update"&&B)G.updateToast(B,W);else if(K==="close"&&B)G.closeToast(B);else G.addToast(W)})},[G,Q,z]),G.useSyncedValues({timeout:Q,limit:X}),O_.jsx(ZJ.Provider,{value:G,children:J})};var k8=P(v(),1);var w_={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},K2={...w_,position:"fixed",top:0,left:0},j_={...w_,position:"absolute"};var yz=P(v(),1);var T_=P(c(),1),S8=yz.forwardRef(function(Z,J){let[Q,X]=yz.useState();return B0(()=>{if(Lz)X("button")},[]),T_.jsx("span",{...Z,ref:J,style:K2,"aria-hidden":Q?void 0:!0,...{tabIndex:0,role:Q},"data-base-ui-focus-guard":""})});var C_=function($){return $.frontmostHeight="--toast-frontmost-height",$}({});var W2=P(c(),1),E_=k8.forwardRef(function(Z,J){let{render:Q,className:X,children:z,...G}=Z,H=l9(),Y=L1(),K=k8.useRef(!1),W=k8.useRef(!1),B=H.useState("isEmpty"),q=H.useState("toasts"),U=H.useState("focused"),F=H.useState("expanded"),N=H.useState("prevFocusElement"),L=q[0]?.height??0,V=k8.useMemo(()=>q.some((k)=>k.transitionStatus==="ending"),[q]);k8.useEffect(()=>{let k=H.state.viewport;if(!k)return;function S(T){if(B)return;if(T.key==="F6"&&T.target!==k)T.preventDefault(),H.setPrevFocusElement(a5(u0(k))),k?.focus({preventScroll:!0}),H.pauseTimers(),H.setFocused(!0)}let w=E8(k);return w.addEventListener("keydown",S),()=>{w.removeEventListener("keydown",S)}},[H,B]),k8.useEffect(()=>{let k=H.state.viewport;if(!k||B)return;let S=E8(k);function w(R){if(R.target!==S)return;H.setIsWindowFocused(!1),H.pauseTimers()}function T(R){if(R.relatedTarget||R.target===S)return;let b=y5(R),g=a5(u0(k));if(!p0(k,b)||!a9(g))H.resumeTimers();Y.start(0,()=>H.setIsWindowFocused(!0))}return S.addEventListener("blur",w,!0),S.addEventListener("focus",T,!0),()=>{S.removeEventListener("blur",w,!0),S.removeEventListener("focus",T,!0)}},[H,Y,B]),k8.useEffect(()=>{let k=H.state.viewport;if(!k||B)return;let S=u0(k);return S.addEventListener("pointerdown",H.handleDocumentPointerDown,!0),()=>{S.removeEventListener("pointerdown",H.handleDocumentPointerDown,!0)}},[B,H]);function M(k){let S=H.state.viewport;if(!S)return;if(K.current=!0,k.relatedTarget===S)q[0]?.ref?.current?.focus();else H.restoreFocusToPrevElement()}function _(k){if(k.key==="Tab"&&k.shiftKey&&k.target===H.state.viewport)k.preventDefault(),H.restoreFocusToPrevElement(),H.resumeTimers()}k8.useEffect(()=>{if(!H.state.isWindowFocused||V||!W.current)return;H.resumeTimers(),H.setHovering(!1),W.current=!1},[V,H]);function O(){H.pauseTimers(),H.setHovering(!0),W.current=!1}function D(){if(V)W.current=!0;else H.resumeTimers(),H.setHovering(!1)}function A(){if(K.current){K.current=!1;return}if(U)return;if(a9(u0(H.state.viewport).activeElement))H.setFocused(!0),H.pauseTimers()}function C(k){if(!U||p0(H.state.viewport,k.relatedTarget))return;H.setFocused(!1),H.resumeTimers()}let I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:O,onMouseMove:O,onMouseLeave:D,onFocus:A,onBlur:C,onKeyDown:_,onClick:A},y={expanded:F},E=W0("div",Z,{ref:[J,H.setViewport],state:y,props:[I,{style:{[C_.frontmostHeight]:L?`${L}px`:void 0}},G,{children:W2.jsxs(k8.Fragment,{children:[!B&&N&&W2.jsx(S8,{onFocus:M}),z,!B&&N&&W2.jsx(S8,{onFocus:M})]})}]}),h=k8.useMemo(()=>q.filter((k)=>k.priority==="high"),[q]);return W2.jsxs(k8.Fragment,{children:[!B&&N&&W2.jsx(S8,{onFocus:M}),E,!U&&h.length>0&&W2.jsx("div",{style:K2,children:h.map((k)=>W2.jsxs("div",{role:"alert","aria-atomic":!0,children:[W2.jsx("div",{children:k.title}),W2.jsx("div",{children:k.description})]},k.id))})]})});var W1=P(v(),1),R_=P(H4(),1);function g2($){if(Yz(19))return $;return $?"true":void 0}var bz=P(v(),1),Bq=bz.createContext(void 0);function v2(){let $=bz.useContext(Bq);if(!$)throw Error(S0(66));return $}var f2=function($){return $.startingStyle="data-starting-style",$.endingStyle="data-ending-style",$}({}),mc={[f2.startingStyle]:""},pc={[f2.endingStyle]:""},p5={transitionStatus($){if($==="starting")return mc;if($==="ending")return pc;return null}};var k_=P(v(),1);var S_=P(H4(),1);function B2($){if($==null)return $;return"current"in $?$.current:$}function m2($,Z=!1,J=!0){let Q=G4();return q0((X,z=null)=>{Q.cancel();function G(){S_.flushSync(X)}let H=B2($);if(H==null)return;let Y=H;if(typeof Y.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)X();else{let K=function(){let B=f2.startingStyle;if(!Y.hasAttribute(B)){Q.request(W);return}let q=new MutationObserver(()=>{if(!Y.hasAttribute(B))q.disconnect(),W()});q.observe(Y,{attributes:!0,attributeFilter:[B]}),z?.addEventListener("abort",()=>q.disconnect(),{once:!0})},W=function(){Promise.all(Y.getAnimations().map((B)=>B.finished)).then(()=>{if(z?.aborted)return;G()}).catch(()=>{let B=Y.getAnimations();if(J){if(z?.aborted)return;G()}else if(B.length>0&&B.some((q)=>q.pending||q.playState!=="finished"))W()})};if(Z){K();return}Q.request(W)}})}function y1($){let{enabled:Z=!0,open:J,ref:Q,onComplete:X}=$,z=q0(X),G=m2(Q,J,!1);k_.useEffect(()=>{if(!Z)return;let H=new AbortController;return G(z,H.signal),()=>{H.abort()}},[Z,J,z,G])}var p2=function($){return $.index="--toast-index",$.offsetY="--toast-offset-y",$.height="--toast-height",$.swipeMovementX="--toast-swipe-movement-x",$.swipeMovementY="--toast-swipe-movement-y",$}({});var y_=P(c(),1),uc={...p5,swipeDirection($){return $?{"data-swipe-direction":$}:null}},YJ=40,cc=10,o9=0.5,dc=1;function I_($,Z,J){switch($){case"up":return-J;case"down":return J;case"left":return-Z;case"right":return Z;default:return 0}}function lc($){let J=window.getComputedStyle($).transform,Q=0,X=0,z=1;if(J&&J!=="none"){let G=J.match(/matrix(?:3d)?\(([^)]+)\)/);if(G){let H=G[1].split(", ").map(parseFloat);if(H.length===6)Q=H[4],X=H[5],z=Math.sqrt(H[0]*H[0]+H[1]*H[1]);else if(H.length===16)Q=H[12],X=H[13],z=H[0]}}return{x:Q,y:X,scale:z}}var b_=W1.forwardRef(function(Z,J){let{toast:Q,render:X,className:z,swipeDirection:G=["down","right"],...H}=Z,Y=Q.positionerProps?.anchor!==void 0,K=[];if(!Y)K=Array.isArray(G)?G:[G];let W=K.length>0,B=l9(),[q,U]=W1.useState(void 0),[F,N]=W1.useState(!1),[L,V]=W1.useState(!1),[M,_]=W1.useState(!1),[O,D]=W1.useState({x:0,y:0}),[A,C]=W1.useState({x:0,y:0,scale:1}),[I,y]=W1.useState(),[E,h]=W1.useState(),[k,S]=W1.useState(null),w=W1.useRef(null),T=W1.useRef({x:0,y:0}),R=W1.useRef({x:0,y:0,scale:1}),b=W1.useRef(void 0),g=W1.useRef(0),u=W1.useRef(!1),j=W1.useRef({x:0,y:0}),e=W1.useRef(!1),t=B.useState("toastIndex",Q.id),x=B.useState("toastVisibleIndex",Q.id),$0=B.useState("toastOffsetY",Q.id),M0=B.useState("focused"),l=B.useState("expanded");y1({open:Q.transitionStatus!=="ending",ref:w,onComplete(){if(Q.transitionStatus==="ending")B.removeToast(Q.id)}});let H0=q0((f=!1)=>{let a=w.current;if(!a)return;let o=a.style.height;a.style.height="auto";let N0=a.offsetHeight;a.style.height=o;function j0(){B.updateToastInternal(Q.id,{ref:w,height:N0,...Q.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}if(f)R_.flushSync(j0);else j0()});B0(H0,[H0]);function U0(f,a){let o=f,N0=a;if(!K.includes("left")&&!K.includes("right"))o=f>0?f**o9:-(Math.abs(f)**o9);else{if(!K.includes("right")&&f>0)o=f**o9;if(!K.includes("left")&&f<0)o=-(Math.abs(f)**o9)}if(!K.includes("up")&&!K.includes("down"))N0=a>0?a**o9:-(Math.abs(a)**o9);else{if(!K.includes("down")&&a>0)N0=a**o9;if(!K.includes("up")&&a<0)N0=-(Math.abs(a)**o9)}return{x:o,y:N0}}function X0(f){if(f.button!==0)return;if(f.pointerType==="touch")B.pauseTimers();let a=y5(f.nativeEvent);if(a?a.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'):!1)return;if(u.current=!1,b.current=void 0,g.current=0,T.current={x:f.clientX,y:f.clientY},j.current=T.current,w.current){let N0=lc(w.current);R.current=N0,C(N0),D({x:N0.x,y:N0.y})}B.setHovering(!0),N(!0),V(!1),S(null),e.current=!0,w.current?.setPointerCapture(f.pointerId)}function Y0(f){if(!F)return;if(f.preventDefault(),e.current)T.current={x:f.clientX,y:f.clientY},e.current=!1;let{clientY:a,clientX:o,movementX:N0,movementY:j0}=f;if(j0<0&&a>j.current.y||j0>0&&a<j.current.y)j.current={x:j.current.x,y:a};if(N0<0&&o>j.current.x||N0>0&&o<j.current.x)j.current={x:o,y:j.current.y};let h0=o-T.current.x,c0=a-T.current.y,p=a-j.current.y,r=o-j.current.x;if(!L){if(Math.sqrt(h0*h0+c0*c0)>=dc){if(V(!0),k===null){let F5=K.includes("left")||K.includes("right"),l0=K.includes("up")||K.includes("down");if(F5&&l0){let R0=Math.abs(h0),G0=Math.abs(c0);S(R0>G0?"horizontal":"vertical")}}}}let z0;if(!b.current){if(k==="vertical"){if(c0>0)z0="down";else if(c0<0)z0="up"}else if(k==="horizontal"){if(h0>0)z0="right";else if(h0<0)z0="left"}else if(Math.abs(h0)>=Math.abs(c0))z0=h0>0?"right":"left";else z0=c0>0?"down":"up";if(z0&&K.includes(z0))b.current=z0,g.current=I_(z0,h0,c0),U(z0)}else{let $5=b.current,F5=I_($5,r,p);if(F5>YJ)u.current=!1,U($5);else if(!(K.includes("left")&&K.includes("right"))&&!(K.includes("up")&&K.includes("down"))&&g.current-F5>=cc)u.current=!0}let L0=U0(h0,c0),P0=R.current.x,v0=R.current.y;if(k==="horizontal"){if(K.includes("left")||K.includes("right"))P0+=L0.x}else if(k==="vertical"){if(K.includes("up")||K.includes("down"))v0+=L0.y}else{if(K.includes("left")||K.includes("right"))P0+=L0.x;if(K.includes("up")||K.includes("down"))v0+=L0.y}D({x:P0,y:v0})}function V0(f){if(!F)return;if(N(!1),V(!1),S(null),w.current?.releasePointerCapture(f.pointerId),u.current){D({x:A.x,y:A.y}),U(void 0);return}let a=!1,o=O.x-A.x,N0=O.y-A.y,j0;for(let h0 of K){switch(h0){case"right":if(o>YJ)a=!0,j0="right";break;case"left":if(o<-YJ)a=!0,j0="left";break;case"down":if(N0>YJ)a=!0,j0="down";break;case"up":if(N0<-YJ)a=!0,j0="up";break;default:break}if(a)break}if(a)U(j0),_(!0),B.closeToast(Q.id);else D({x:A.x,y:A.y}),U(void 0)}function i(f){if(f.key==="Escape"){if(!w.current||!p0(w.current,a5(u0(w.current))))return;B.closeToast(Q.id)}}W1.useEffect(()=>{if(!W)return;let f=w.current;if(!f)return;function a(o){if(p0(f,o.target))o.preventDefault()}return f.addEventListener("touchmove",a,{passive:!1}),()=>{f.removeEventListener("touchmove",a)}},[W]);function Z0(){if(!F&&O.x===A.x&&O.y===A.y&&!M)return{[p2.swipeMovementX]:"0px",[p2.swipeMovementY]:"0px"};let f=O.x-A.x,a=O.y-A.y;return{transition:F?"none":void 0,transform:F?`translateX(${O.x}px) translateY(${O.y}px) scale(${A.scale})`:void 0,[p2.swipeMovementX]:`${f}px`,[p2.swipeMovementY]:`${a}px`}}let J0=Q.priority==="high",Q0={role:J0?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":I,"aria-describedby":E,"aria-hidden":J0&&!M0?!0:void 0,onPointerDown:W?X0:void 0,onPointerMove:W?Y0:void 0,onPointerUp:W?V0:void 0,onKeyDown:i,inert:g2(Q.limited),style:{...Z0(),[p2.index]:Q.transitionStatus==="ending"?t:x,[p2.offsetY]:`${$0}px`,[p2.height]:Q.height?`${Q.height}px`:void 0}},n=W1.useMemo(()=>({rootRef:w,toast:Q,titleId:I,setTitleId:y,descriptionId:E,setDescriptionId:h,swiping:F,swipeDirection:q,recalculateHeight:H0,index:t,visibleIndex:x,expanded:l}),[Q,I,E,F,q,H0,t,x,l]),m={transitionStatus:Q.transitionStatus,expanded:l,limited:Q.limited||!1,type:Q.type,swiping:n.swiping,swipeDirection:n.swipeDirection},d=W0("div",Z,{ref:[J,n.rootRef],state:m,stateAttributesMapping:uc,props:[Q0,H]});return y_.jsx(Bq.Provider,{value:n,children:d})});var xz=P(v(),1);var x_=xz.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,{visibleIndex:G,expanded:H,recalculateHeight:Y}=v2(),K=xz.useRef(null);B0(()=>{let U=K.current;if(!U)return;if(Y(),typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let F=new ResizeObserver(()=>Y(!0)),N=new MutationObserver(()=>Y(!0));return F.observe(U),N.observe(U,{childList:!0,subtree:!0,characterData:!0}),()=>{F.disconnect(),N.disconnect()}},[Y]);let W=G>0;return W0("div",Z,{ref:[J,K],state:{expanded:H,behind:W},props:z})});var f_=P(v(),1);var hz=P(v(),1);var h_=0;function ic($,Z="mui"){let[J,Q]=hz.useState($),X=$||J;return hz.useEffect(()=>{if(J==null)h_+=1,Q(`${Z}-${h_}`)},[J,Z]),X}var g_=v_.useId;function K8($,Z){if(g_!==void 0){let J=g_();return $??(Z?`${Z}-${J}`:J)}return ic($,Z)}var m_=f_.forwardRef(function(Z,J){let{render:Q,className:X,id:z,children:G,...H}=Z,{toast:Y,setDescriptionId:K}=v2(),W=G??Y.description,B=Boolean(W),q=K8(z);B0(()=>{if(!B)return;return K(q),()=>{K(void 0)}},[B,q,K]);let U={type:Y.type},F=W0("p",Z,{ref:J,state:U,props:{...H,id:q,children:W}});if(!B)return null;return F});var p_=P(v(),1);var u_=p_.forwardRef(function(Z,J){let{render:Q,className:X,id:z,children:G,...H}=Z,{toast:Y,setTitleId:K}=v2(),W=G??Y.title,B=Boolean(W),q=K8(z);B0(()=>{if(!B)return;return K(q),()=>{K(void 0)}},[B,q,K]);let U={type:Y.type},F=W0("h2",Z,{ref:J,state:U,props:{...H,id:q,children:W}});if(!B)return null;return F});var gz=P(v(),1);var c_=gz.forwardRef(function(Z,J){let{render:Q,className:X,disabled:z,nativeButton:G=!0,...H}=Z,Y=l9(),{toast:K}=v2(),W=Y.useState("expanded"),[B,q]=gz.useState(!1),{getButtonProps:U,buttonRef:F}=p1({disabled:z,native:G}),N={type:K.type};return W0("button",Z,{ref:[J,F],state:N,props:[{"aria-hidden":!W&&!B,onClick(){Y.closeToast(K.id)},onFocus(){q(!0)},onBlur(){q(!1)}},H,U]})});var d_=P(v(),1);var l_=d_.forwardRef(function(Z,J){let{render:Q,className:X,disabled:z,nativeButton:G=!0,...H}=Z,{toast:Y}=v2(),K=Y.actionProps?.children??H.children,W=Boolean(K),{getButtonProps:B,buttonRef:q}=p1({disabled:z,native:G}),U={type:Y.type},F=W0("button",Z,{ref:[J,q],state:U,props:[H,Y.actionProps,B,{children:K}]});if(!W)return null;return F});var tz=P(v(),1),UD=P(H4(),1);var Y4=P(v(),1);var mz=P(v(),1);function j1($){let Z=S5(rc,$).current;return Z.next=$,B0(Z.effect),Z}function rc($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var s9=P(v(),1);function vz(){let $=new Map;return{emit(Z,J){$.get(Z)?.forEach((Q)=>Q(J))},on(Z,J){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(J)},off(Z,J){$.get(Z)?.delete(J)}}}class V3{nodesRef={current:[]};events=vz();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((J)=>J===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var qq=P(c(),1),i_=s9.createContext(null),r_=s9.createContext(null),t1=()=>s9.useContext(i_)?.id||null,I8=($)=>{let Z=s9.useContext(r_);return $??Z};function L3($){let Z=K8(),J=I8($),Q=t1();return B0(()=>{if(!Z)return;let X={id:Z,parentId:Q};return J?.addNode(X),()=>{J?.removeNode(X)}},[J,Z,Q]),Z}function KJ($){let{children:Z,id:J}=$,Q=t1();return qq.jsx(i_.Provider,{value:s9.useMemo(()=>({id:J,parentId:Q}),[J,Q]),children:Z})}function WJ($){let{children:Z,externalTree:J}=$,Q=S5(()=>J??new V3).current;return qq.jsx(r_.Provider,{value:Q,children:Z})}var K0={};D4(K0,{windowResize:()=>Td,wheel:()=>Ad,triggerPress:()=>nc,triggerHover:()=>oc,triggerFocus:()=>sc,trackPress:()=>Xd,swipe:()=>jd,siblingOpen:()=>Od,scrub:()=>_d,pointer:()=>Ld,outsidePress:()=>tc,none:()=>ac,listNavigation:()=>Nd,linkPress:()=>Zd,keyboard:()=>Vd,itemPress:()=>ec,inputPress:()=>Bd,inputPaste:()=>Wd,inputClear:()=>Yd,inputChange:()=>Hd,inputBlur:()=>Kd,incrementPress:()=>zd,imperativeAction:()=>wd,focusOut:()=>qd,escapeKey:()=>Ud,drag:()=>Md,disabled:()=>Pd,decrementPress:()=>Gd,closeWatcher:()=>Fd,closePress:()=>$d,clearPress:()=>Jd,chipRemovePress:()=>Qd,cancelOpen:()=>Dd});var ac="none",nc="trigger-press",oc="trigger-hover",sc="trigger-focus",tc="outside-press",ec="item-press",$d="close-press",Zd="link-press",Jd="clear-press",Qd="chip-remove-press",Xd="track-press",zd="increment-press",Gd="decrement-press",Hd="input-change",Yd="input-clear",Kd="input-blur",Wd="input-paste",Bd="input-press",qd="focus-out",Ud="escape-key",Fd="close-watcher",Nd="list-navigation",Vd="keyboard",Ld="pointer",Md="drag",Ad="wheel",_d="scrub",Dd="cancel-open",Od="sibling-open",Pd="disabled",wd="imperative-action",jd="swipe",Td="window-resize";function D0($,Z,J,Q){let X=!1,z=!1,G=Q??k5;return{reason:$,event:Z??new Event("base-ui"),cancel(){X=!0},allowPropagation(){z=!0},get isCanceled(){return X},get isPropagationAllowed(){return z},trigger:J,...G}}function fz($,Z,J){let Q=J??k5;return{reason:$,event:Z??new Event("base-ui"),...Q}}function O4($){return`data-base-ui-${$}`}var XY0=O4("safe-polygon"),zY0=`button,[role="button"],select,[tabindex]:not([tabindex="-1"]),${h7}`;function m7($,Z,J){if(J&&!p4(J))return 0;if(typeof $==="number")return $;if(typeof $==="function"){let Q=$();if(typeof Q==="number")return Q;return Q?.[Z]}return $?.[Z]}var a_=P(c(),1),n_=Y4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new i1,currentIdRef:{current:null},currentContextRef:{current:null}});function Uq($){let{children:Z,delay:J,timeoutMs:Q=0}=$,X=Y4.useRef(J),z=Y4.useRef(J),G=Y4.useRef(null),H=Y4.useRef(null),Y=L1();return a_.jsx(n_.Provider,{value:Y4.useMemo(()=>({hasProvider:!0,delayRef:X,initialDelayRef:z,currentIdRef:G,timeoutMs:Q,currentContextRef:H,timeout:Y}),[Q,Y]),children:Z})}function Fq($,Z={open:!1}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("floatingId"),{open:X}=Z,z=Y4.useContext(n_),{currentIdRef:G,delayRef:H,timeoutMs:Y,initialDelayRef:K,currentContextRef:W,hasProvider:B,timeout:q}=z,[U,F]=Y4.useState(!1);return B0(()=>{function N(){F(!1),W.current?.setIsInstantPhase(!1),G.current=null,W.current=null,H.current=K.current}if(!G.current)return;if(!X&&G.current===Q){if(F(!1),Y){let L=Q;return q.start(Y,()=>{if(J.select("open")||G.current&&G.current!==L)return;N()}),()=>{q.clear()}}N()}return},[X,Q,G,H,Y,K,W,q,J]),B0(()=>{if(!X)return;let N=W.current,L=G.current;if(q.clear(),W.current={onOpenChange:J.setOpen,setIsInstantPhase:F},G.current=Q,H.current={open:0,close:m7(K.current,"close")},L!==null&&L!==Q)F(!0),N?.setIsInstantPhase(!0),N?.onOpenChange(!1,D0(K0.none));else F(!1),N?.setIsInstantPhase(!1)},[X,Q,J,G,H,Y,K,W,q]),B0(()=>{return()=>{W.current=null}},[W]),Y4.useMemo(()=>({hasProvider:B,delayRef:H,isInstantPhase:U}),[B,H,U])}var e1=P(v(),1);var o_=0;function M3($,Z={}){let{preventScroll:J=!1,cancelPrevious:Q=!0,sync:X=!1}=Z;if(Q)cancelAnimationFrame(o_);let z=()=>$?.focus({preventScroll:J});if(X)z();else o_=requestAnimationFrame(z)}var p7={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function s_($){if($==="inert")return p7.inert;if($==="aria-hidden")return p7["aria-hidden"];return p7.none}var pz=new WeakSet,uz={},Nq=0;var t_=($)=>$&&($.host||t_($.parentNode)),Cd=($,Z)=>Z.map((J)=>{if($.contains(J))return J;let Q=t_(J);if($.contains(Q))return Q;return null}).filter((J)=>J!=null);function Ed($,Z,J,Q){let z=Q?"inert":J?"aria-hidden":null,G=Cd(Z,$),H=new Set,Y=new Set(G),K=[];if(!uz["data-base-ui-inert"])uz["data-base-ui-inert"]=new WeakMap;let W=uz["data-base-ui-inert"];G.forEach(B),q(Z),H.clear();function B(U){if(!U||H.has(U))return;if(H.add(U),U.parentNode)B(U.parentNode)}function q(U){if(!U||Y.has(U))return;[].forEach.call(U.children,(F)=>{if(cz(F)==="script")return;if(H.has(F))q(F);else{let N=z?F.getAttribute(z):null,L=N!==null&&N!=="false",V=s_(z),M=(V.get(F)||0)+1,_=(W.get(F)||0)+1;if(V.set(F,M),W.set(F,_),K.push(F),M===1&&L)pz.add(F);if(_===1)F.setAttribute("data-base-ui-inert","");if(!L&&z)F.setAttribute(z,z==="inert"?"":"true")}})}return Nq+=1,()=>{if(K.forEach((U)=>{let F=s_(z),L=(F.get(U)||0)-1,V=(W.get(U)||0)-1;if(F.set(U,L),W.set(U,V),!L){if(!pz.has(U)&&z)U.removeAttribute(z);pz.delete(U)}if(!V)U.removeAttribute("data-base-ui-inert")}),Nq-=1,!Nq)p7.inert=new WeakMap,p7["aria-hidden"]=new WeakMap,p7.none=new WeakMap,pz=new WeakSet,uz={}}}function e_($,Z=!1,J=!1){let Q=u0($[0]).body;return Ed($.concat(Array.from(Q.querySelectorAll("[aria-live]"))),Q,Z,J)}var T1=P(v(),1),Vq=P(H4(),1);var A3=P(c(),1),JD=T1.createContext(null),Lq=()=>T1.useContext(JD),Sd=O4("portal");function dz($={}){let{ref:Z,container:J,componentProps:Q=k5,elementProps:X}=$,z=K8(),H=Lq()?.portalNode,[Y,K]=T1.useState(null),[W,B]=T1.useState(null),q=q0((L)=>{if(L!==null)B(L)}),U=T1.useRef(null);B0(()=>{if(J===null){if(U.current)U.current=null,B(null),K(null);return}if(z==null)return;let L=(J&&($D(J)?J:J.current))??H??document.body;if(L==null){if(U.current)U.current=null,B(null),K(null);return}if(U.current!==L)U.current=L,B(null),K(L)},[J,H,z]);let F=W0("div",Q,{ref:[Z,q],props:[{id:z,[Sd]:""},X]});return{portalNode:W,portalSubtree:Y&&F?Vq.createPortal(F,Y):null}}var _3=T1.forwardRef(function(Z,J){let{children:Q,container:X,className:z,render:G,renderGuards:H,...Y}=Z,{portalNode:K,portalSubtree:W}=dz({container:X,ref:J,componentProps:Z,elementProps:Y}),B=T1.useRef(null),q=T1.useRef(null),U=T1.useRef(null),F=T1.useRef(null),[N,L]=T1.useState(null),V=N?.modal,M=N?.open,_=typeof H==="boolean"?H:!!N&&!N.modal&&N.open&&!!K;T1.useEffect(()=>{if(!K||V)return;function D(A){if(K&&A.relatedTarget&&Y2(A))(A.type==="focusin"?Kq:__)(K)}return K.addEventListener("focusin",D,!0),K.addEventListener("focusout",D,!0),()=>{K.removeEventListener("focusin",D,!0),K.removeEventListener("focusout",D,!0)}},[K,V]),T1.useEffect(()=>{if(!K||M)return;Kq(K)},[M,K]);let O=T1.useMemo(()=>({beforeOutsideRef:B,afterOutsideRef:q,beforeInsideRef:U,afterInsideRef:F,portalNode:K,setFocusManagerState:L}),[K]);return A3.jsxs(T1.Fragment,{children:[W,A3.jsxs(JD.Provider,{value:O,children:[_&&K&&A3.jsx(S8,{"data-type":"outside",ref:B,onFocus:(D)=>{if(Y2(D,K))U.current?.focus();else{let A=N?N.domReference:null;Sz(A)?.focus()}}}),_&&K&&A3.jsx("span",{"aria-owns":K.id,style:ZD}),K&&Vq.createPortal(Q,K),_&&K&&A3.jsx(S8,{"data-type":"outside",ref:q,onFocus:(D)=>{if(Y2(D,K))F.current?.focus();else{let A=N?N.domReference:null;if(n9(A)?.focus(),N?.closeOnFocusOut)N?.onOpenChange(!1,D0(K0.focusOut,D.nativeEvent))}}})]})]})});var BJ=P(c(),1);function kd($,Z){let J=E8($.target);if($ instanceof J.KeyboardEvent)return"keyboard";if($ instanceof J.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof J.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var QD=20,t9=[];function Aq(){t9=t9.filter(($)=>{return $.deref()?.isConnected})}function Id($){if(Aq(),$&&cz($)!=="body"){if(t9.push(new WeakRef($)),t9.length>QD)t9=t9.slice(-QD)}}function Mq(){return Aq(),t9[t9.length-1]?.deref()}function Rd($){if(!$)return null;let Z=N3();if(Yq($,Z))return $;return F3($,Z)[0]||$}function yd($){if(!$||!$.isConnected)return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return u7($).display!=="none"}function XD($,Z){if(!Z.current.includes("floating")&&!$.getAttribute("role")?.includes("dialog"))return;let J=N3(),X=L_($,J).filter((G)=>{let H=G.getAttribute("data-tabindex")||"";return Yq(G,J)||G.hasAttribute("data-tabindex")&&!H.startsWith("-")}),z=$.getAttribute("tabindex");if(Z.current.includes("floating")||X.length===0){if(z!=="0")$.setAttribute("tabindex","0")}else if(z!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function D3($){let{context:Z,children:J,disabled:Q=!1,initialFocus:X=!0,returnFocus:z=!0,restoreFocus:G=!1,modal:H=!0,closeOnFocusOut:Y=!0,openInteractionType:K="",nextFocusableElement:W,previousFocusableElement:B,beforeContentFocusGuardRef:q,externalTree:U}=$,F="rootStore"in Z?Z.rootStore:Z,N=F.useState("open"),L=F.useState("domReferenceElement"),V=F.useState("floatingElement"),{events:M,dataRef:_}=F.context,O=q0(()=>_.current.floatingContext?.nodeId),D=X===!1,A=HJ(L)&&D,C=e1.useRef(["content"]),I=j1(X),y=j1(z),E=j1(K),h=I8(U),k=Lq(),S=e1.useRef(null),w=e1.useRef(null),T=e1.useRef(!1),R=e1.useRef(!1),b=e1.useRef(!1),g=e1.useRef(-1),u=e1.useRef(""),j=e1.useRef(""),e=e1.useRef(null),t=e1.useRef(null),x=P4(e,q,k?.beforeInsideRef),$0=P4(t,k?.afterInsideRef),M0=L1(),l=L1(),H0=G4(),U0=k!=null,X0=U3(V),Y0=q0((Z0=X0)=>{return Z0?F3(Z0,N3()):[]}),V0=q0((Z0)=>{let J0=Y0(Z0);return C.current.map(()=>J0).filter(Boolean).flat()});e1.useEffect(()=>{if(Q||!H)return;function Z0(Q0){if(Q0.key==="Tab"){if(p0(X0,a5(u0(X0)))&&Y0().length===0&&!A)r1(Q0)}}let J0=u0(X0);return J0.addEventListener("keydown",Z0),()=>{J0.removeEventListener("keydown",Z0)}},[Q,L,X0,H,C,A,Y0,V0]),e1.useEffect(()=>{if(Q||!N)return;let Z0=u0(X0);function J0(){b.current=!1}function Q0(m){let d=y5(m),f=p0(V,d)||p0(L,d)||p0(k?.portalNode,d);if(b.current=!f,j.current=m.pointerType||"keyboard",d?.closest(`[${c7}]`))R.current=!0}function n(){j.current="keyboard"}return Z0.addEventListener("pointerdown",Q0,!0),Z0.addEventListener("pointerup",J0,!0),Z0.addEventListener("pointercancel",J0,!0),Z0.addEventListener("keydown",n,!0),()=>{Z0.removeEventListener("pointerdown",Q0,!0),Z0.removeEventListener("pointerup",J0,!0),Z0.removeEventListener("pointercancel",J0,!0),Z0.removeEventListener("keydown",n,!0)}},[Q,V,L,X0,N,k]),e1.useEffect(()=>{if(Q||!Y)return;let Z0=u0(X0);function J0(){R.current=!0,l.start(0,()=>{R.current=!1})}function Q0(a){let o=y5(a),j0=Y0().indexOf(o);if(j0!==-1)g.current=j0}function n(a){let{relatedTarget:o,currentTarget:N0}=a,j0=y5(a);queueMicrotask(()=>{let h0=O(),c0=F.context.triggerElements,p=o?.hasAttribute(O4("focus-guard"))&&[e.current,t.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,B2(B),B2(W)].includes(o),r=!(p0(L,o)||p0(V,o)||p0(o,V)||p0(k?.portalNode,o)||o!=null&&c0.hasElement(o)||c0.hasMatchingElement((z0)=>p0(z0,o))||p||h&&(h2(h.nodesRef.current,h0).find((z0)=>p0(z0.context?.elements.floating,o)||p0(z0.context?.elements.domReference,o))||Qq(h.nodesRef.current,h0).find((z0)=>[z0.context?.elements.floating,U3(z0.context?.elements.floating)].includes(o)||z0.context?.elements.domReference===o)));if(N0===L&&X0)XD(X0,C);if(G&&N0!==L&&!yd(j0)&&a5(Z0)===Z0.body){if(M1(X0)){if(X0.focus(),G==="popup"){H0.request(()=>{X0.focus()});return}}let z0=g.current,L0=Y0(),P0=L0[z0]||L0[L0.length-1]||X0;if(M1(P0))P0.focus()}if(_.current.insideReactTree){_.current.insideReactTree=!1;return}if((A?!0:!H)&&o&&r&&!R.current&&(A||o!==Mq()))T.current=!0,F.setOpen(!1,D0(K0.focusOut,a))})}function m(){if(b.current)return;_.current.insideReactTree=!0,M0.start(0,()=>{_.current.insideReactTree=!1})}let d=M1(L)?L:null,f=[];if(!V&&!d)return;if(d)d.addEventListener("focusout",n),d.addEventListener("pointerdown",J0),f.push(()=>{d.removeEventListener("focusout",n),d.removeEventListener("pointerdown",J0)});if(V){if(V.addEventListener("focusin",Q0),V.addEventListener("focusout",n),k)V.addEventListener("focusout",m,!0),f.push(()=>{V.removeEventListener("focusout",m,!0)});f.push(()=>{V.removeEventListener("focusin",Q0),V.removeEventListener("focusout",n)})}return()=>{f.forEach((a)=>{a()})}},[Q,L,V,X0,H,h,k,F,Y,G,Y0,A,O,C,_,M0,l,H0,W,B]),e1.useEffect(()=>{if(Q||!V||!N)return;let Z0=Array.from(k?.portalNode?.querySelectorAll(`[${O4("portal")}]`)||[]),Q0=(h?Qq(h.nodesRef.current,O()):[]).find((m)=>HJ(m.context?.elements.domReference||null))?.context?.elements.domReference,n=[V,Q0,...Z0,S.current,w.current,e.current,t.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,B2(B),B2(W),A?L:null].filter((m)=>m!=null);return e_(n,H||A)},[N,Q,L,V,H,C,k,A,h,O,W,B]),B0(()=>{if(!N||Q||!M1(X0))return;let Z0=u0(X0),J0=a5(Z0);queueMicrotask(()=>{let Q0=V0(X0),n=I.current,m=typeof n==="function"?n(E.current||""):n;if(m===void 0||m===!1)return;let d;if(m===!0||m===null)d=Q0[0]||X0;else d=B2(m);if(d=d||Q0[0]||X0,p0(X0,J0))return;M3(d,{preventScroll:d===X0})})},[Q,N,X0,D,V0,I,E]),B0(()=>{if(Q||!X0)return;let Z0=u0(X0),J0=a5(Z0);Id(J0);function Q0(d){if(!d.open)u.current=kd(d.nativeEvent,j.current);if(d.reason===K0.triggerHover&&d.nativeEvent.type==="mouseleave")T.current=!0;if(d.reason!==K0.outsidePress)return;if(d.nested)T.current=!1;else if(_z(d.nativeEvent)||Dz(d.nativeEvent))T.current=!1;else{let f=!1;if(document.createElement("div").focus({get preventScroll(){return f=!0,!1}}),f)T.current=!1;else T.current=!0}}M.on("openchange",Q0);let n=Z0.createElement("span");if(n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Object.assign(n.style,K2),U0&&L)L.insertAdjacentElement("afterend",n);function m(){let d=y.current,f=typeof d==="function"?d(u.current):d;if(f===void 0||f===!1)return null;if(f===null)f=!0;if(typeof f==="boolean"){let o=L||Mq();return o&&o.isConnected?o:n}let a=L||Mq()||n;return B2(f)||a}return()=>{M.off("openchange",Q0);let d=a5(Z0),f=p0(V,d)||h&&h2(h.nodesRef.current,O(),!1).some((o)=>p0(o.context?.elements.floating,d)),a=m();queueMicrotask(()=>{let o=Rd(a),N0=typeof y.current!=="boolean";if(y.current&&!T.current&&M1(o)&&(!N0&&o!==d&&d!==Z0.body?f:!0))o.focus({preventScroll:!0});n.remove(),T.current=!1})}},[Q,V,X0,y,_,M,h,U0,L,O]),B0(()=>{if(!Nz||N||!V)return;let Z0=a5(u0(V));if(!M1(Z0)||!q3(Z0))return;if(p0(V,Z0))Z0.blur()},[N,V]),B0(()=>{if(Q||!k)return;return k.setFocusManagerState({modal:H,closeOnFocusOut:Y,open:N,onOpenChange:F.setOpen,domReference:L}),()=>{k.setFocusManagerState(null)}},[Q,k,H,N,F,Y,L]),B0(()=>{if(Q||!X0)return;return XD(X0,C),()=>{queueMicrotask(Aq)}},[Q,X0,C]);let i=!Q&&(H?!A:!0)&&(U0||H);return BJ.jsxs(e1.Fragment,{children:[i&&BJ.jsx(S8,{"data-type":"inside",ref:x,onFocus:(Z0)=>{if(H){let J0=V0();M3(J0[J0.length-1])}else if(k?.portalNode)if(T.current=!1,Y2(Z0,k.portalNode))n9(L)?.focus();else B2(B??k.beforeOutsideRef)?.focus()}}),J,i&&BJ.jsx(S8,{"data-type":"inside",ref:$0,onFocus:(Z0)=>{if(H)M3(V0()[0]);else if(k?.portalNode){if(Y)T.current=!0;if(Y2(Z0,k.portalNode))Sz(L)?.focus();else B2(W??k.afterOutsideRef)?.focus()}}})]})}var qJ=P(v(),1);function T9($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.context.dataRef,{enabled:X=!0,event:z="click",toggle:G=!0,ignoreMouse:H=!1,stickIfOpen:Y=!0,touchOpenDelay:K=0,reason:W=K0.triggerPress}=Z,B=qJ.useRef(void 0),q=G4(),U=L1(),F=qJ.useMemo(()=>({onPointerDown(N){B.current=N.pointerType},onMouseDown(N){let L=B.current,V=N.nativeEvent,M=J.select("open");if(N.button!==0||z==="click"||p4(L,!0)&&H)return;let _=Q.current.openEvent,O=_?.type,D=J.select("domReferenceElement")!==N.currentTarget,A=M&&D||!(M&&G&&(_&&Y?O==="click"||O==="mousedown":!0));if(q3(V.target)){let I=D0(W,V,V.target);if(A&&L==="touch"&&K>0)U.start(K,()=>{J.setOpen(!0,I)});else J.setOpen(A,I);return}let C=N.currentTarget;q.request(()=>{let I=D0(W,V,C);if(A&&L==="touch"&&K>0)U.start(K,()=>{J.setOpen(!0,I)});else J.setOpen(A,I)})},onClick(N){if(z==="mousedown-only")return;let L=B.current;if(z==="mousedown"&&L){B.current=void 0;return}if(p4(L,!0)&&H)return;let V=J.select("open"),M=Q.current.openEvent,_=J.select("domReferenceElement")!==N.currentTarget,O=V&&_||!(V&&G&&(M&&Y?Oz(M):!0)),D=D0(W,N.nativeEvent,N.currentTarget);if(O&&L==="touch"&&K>0)U.start(K,()=>{J.setOpen(!0,D)});else J.setOpen(O,D)},onKeyDown(){B.current=void 0}}),[Q,z,H,J,Y,G,q,U,K,W]);return qJ.useMemo(()=>X?{reference:F}:k5,[X,F])}var r8=P(v(),1);function bd($,Z){let J=null,Q=null,X=!1;return{contextElement:$||void 0,getBoundingClientRect(){let z=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},G=Z.axis==="x"||Z.axis==="both",H=Z.axis==="y"||Z.axis==="both",Y=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",K=z.width,W=z.height,B=z.x,q=z.y;if(J==null&&Z.x&&G)J=z.x-Z.x;if(Q==null&&Z.y&&H)Q=z.y-Z.y;if(B-=J||0,q-=Q||0,K=0,W=0,!X||Y)K=Z.axis==="y"?z.width:0,W=Z.axis==="x"?z.height:0,B=G&&Z.x!=null?Z.x:B,q=H&&Z.y!=null?Z.y:q;else if(X&&!Y)W=Z.axis==="x"?z.height:W,K=Z.axis==="y"?z.width:K;return X=!0,{width:K,height:W,x:B,y:q,top:q,right:B+K,bottom:q+W,left:B}}}}function zD($){return $!=null&&$.clientX!=null}function _q($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),z=J.useState("domReferenceElement"),G=J.context.dataRef,{enabled:H=!0,axis:Y="both"}=Z,K=r8.useRef(!1),W=r8.useRef(null),[B,q]=r8.useState(),[U,F]=r8.useState([]),N=q0((O,D,A)=>{if(K.current)return;if(G.current.openEvent&&!zD(G.current.openEvent))return;J.set("positionReference",bd(A??z,{x:O,y:D,axis:Y,dataRef:G,pointerType:B}))}),L=q0((O)=>{if(!Q)N(O.clientX,O.clientY,O.currentTarget);else if(!W.current)F([])}),V=p4(B)?X:Q,M=r8.useCallback(()=>{if(!V||!H)return;let O=E8(X);function D(A){let C=y5(A);if(!p0(X,C))N(A.clientX,A.clientY);else O.removeEventListener("mousemove",D),W.current=null}if(!G.current.openEvent||zD(G.current.openEvent)){O.addEventListener("mousemove",D);let A=()=>{O.removeEventListener("mousemove",D),W.current=null};return W.current=A,A}J.set("positionReference",z);return},[V,H,X,G,z,J,N]);r8.useEffect(()=>{return M()},[M,U]),r8.useEffect(()=>{if(H&&!X)K.current=!1},[H,X]),r8.useEffect(()=>{if(!H&&Q)K.current=!0},[H,Q]);let _=r8.useMemo(()=>{function O(D){q(D.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:L,onMouseEnter:L}},[L]);return r8.useMemo(()=>H?{reference:_,trigger:_}:{},[H,_])}var u4=P(v(),1);var xd={intentional:"onClick",sloppy:"onPointerDown"};function hd($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function q2($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),z=J.useState("referenceElement"),G=J.useState("domReferenceElement"),{onOpenChange:H,dataRef:Y}=J.context,{enabled:K=!0,escapeKey:W=!0,outsidePress:B=!0,outsidePressEvent:q="sloppy",referencePress:U=!1,referencePressEvent:F="sloppy",ancestorScroll:N=!1,bubbles:L,externalTree:V}=Z,M=I8(V),_=q0(typeof B==="function"?B:()=>!1),O=typeof B==="function"?_:B,D=u4.useRef(!1),{escapeKey:A,outsidePress:C}=hd(L),I=u4.useRef(null),y=L1(),E=L1(),h=q0(()=>{E.clear(),Y.current.insideReactTree=!1}),k=u4.useRef(!1),S=u4.useRef(""),w=q0((i)=>{S.current=i.pointerType}),T=q0(()=>{let i=S.current,Z0=i==="pen"||!i?"mouse":i,J0=typeof q==="function"?q():q;if(typeof J0==="string")return J0;return J0[Z0]}),R=q0((i)=>{if(!Q||!K||!W||i.key!=="Escape")return;if(k.current)return;let Z0=Y.current.floatingContext?.nodeId,J0=M?h2(M.nodesRef.current,Z0):[];if(!A){if(J0.length>0){let m=!0;if(J0.forEach((d)=>{if(d.context?.open&&!d.context.dataRef.current.__escapeKeyBubbles)m=!1}),!m)return}}let Q0=z_(i)?i.nativeEvent:i,n=D0(K0.escapeKey,Q0);if(J.setOpen(!1,n),!A&&!n.isPropagationAllowed)i.stopPropagation()}),b=q0((i)=>{let Z0=T();return Z0==="intentional"&&i.type!=="click"||Z0==="sloppy"&&i.type==="click"}),g=q0(()=>{Y.current.insideReactTree=!0,E.start(0,h)}),u=q0((i,Z0=!1)=>{if(b(i)){h();return}if(Y.current.insideReactTree){h();return}if(T()==="intentional"&&Z0)return;if(typeof O==="function"&&!O(i))return;let J0=y5(i),Q0=`[${O4("inert")}]`,n=u0(J.select("floatingElement")).querySelectorAll(Q0),m=J.context.triggerElements;if(J0&&(m.hasElement(J0)||m.hasMatchingElement((N0)=>p0(N0,J0))))return;let d=D5(J0)?J0:null;while(d&&!d7(d)){let N0=lz(d);if(d7(N0)||!D5(N0))break;d=N0}if(n.length&&D5(J0)&&!X_(J0)&&!p0(J0,J.select("floatingElement"))&&Array.from(n).every((N0)=>!p0(d,N0)))return;if(M1(J0)&&!("touches"in i)){let N0=d7(J0),j0=u7(J0),h0=/auto|scroll/,c0=N0||h0.test(j0.overflowX),p=N0||h0.test(j0.overflowY),r=c0&&J0.clientWidth>0&&J0.scrollWidth>J0.clientWidth,z0=p&&J0.clientHeight>0&&J0.scrollHeight>J0.clientHeight,L0=j0.direction==="rtl",P0=z0&&(L0?i.offsetX<=J0.offsetWidth-J0.clientWidth:i.offsetX>J0.clientWidth),v0=r&&i.offsetY>J0.clientHeight;if(P0||v0)return}let f=Y.current.floatingContext?.nodeId,a=M&&h2(M.nodesRef.current,f).some((N0)=>m4(i,N0.context?.elements.floating));if(m4(i,J.select("floatingElement"))||m4(i,J.select("domReferenceElement"))||a)return;let o=M?h2(M.nodesRef.current,f):[];if(o.length>0){let N0=!0;if(o.forEach((j0)=>{if(j0.context?.open&&!j0.context.dataRef.current.__outsidePressBubbles)N0=!1}),!N0)return}J.setOpen(!1,D0(K0.outsidePress,i)),h()}),j=q0((i)=>{if(T()!=="sloppy"||i.pointerType==="touch"||!J.select("open")||!K||m4(i,J.select("floatingElement"))||m4(i,J.select("domReferenceElement")))return;u(i)}),e=q0((i)=>{if(T()!=="sloppy"||!J.select("open")||!K||m4(i,J.select("floatingElement"))||m4(i,J.select("domReferenceElement")))return;let Z0=i.touches[0];if(Z0)I.current={startTime:Date.now(),startX:Z0.clientX,startY:Z0.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},y.start(1000,()=>{if(I.current)I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1})}),t=q0((i)=>{let Z0=y5(i);function J0(){e(i),Z0?.removeEventListener(i.type,J0)}Z0?.addEventListener(i.type,J0)}),x=q0((i)=>{let Z0=D.current;if(D.current=!1,y.clear(),i.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;let J0=y5(i);function Q0(){if(i.type==="pointerdown")j(i);else u(i,Z0);J0?.removeEventListener(i.type,Q0)}J0?.addEventListener(i.type,Q0)}),$0=q0((i)=>{if(T()!=="sloppy"||!I.current||m4(i,J.select("floatingElement"))||m4(i,J.select("domReferenceElement")))return;let Z0=i.touches[0];if(!Z0)return;let J0=Math.abs(Z0.clientX-I.current.startX),Q0=Math.abs(Z0.clientY-I.current.startY),n=Math.sqrt(J0*J0+Q0*Q0);if(n>5)I.current.dismissOnTouchEnd=!0;if(n>10)u(i),y.clear(),I.current=null}),M0=q0((i)=>{let Z0=y5(i);function J0(){$0(i),Z0?.removeEventListener(i.type,J0)}Z0?.addEventListener(i.type,J0)}),l=q0((i)=>{if(T()!=="sloppy"||!I.current||m4(i,J.select("floatingElement"))||m4(i,J.select("domReferenceElement")))return;if(I.current.dismissOnTouchEnd)u(i);y.clear(),I.current=null}),H0=q0((i)=>{let Z0=y5(i);function J0(){l(i),Z0?.removeEventListener(i.type,J0)}Z0?.addEventListener(i.type,J0)});u4.useEffect(()=>{if(!Q||!K)return;Y.current.__escapeKeyBubbles=A,Y.current.__outsidePressBubbles=C;let i=new i1;function Z0(d){J.setOpen(!1,D0(K0.none,d))}function J0(){i.clear(),k.current=!0}function Q0(){i.start(GD()?5:0,()=>{k.current=!1})}let n=u0(X);if(n.addEventListener("pointerdown",w,!0),W)n.addEventListener("keydown",R),n.addEventListener("compositionstart",J0),n.addEventListener("compositionend",Q0);if(O)n.addEventListener("click",x,!0),n.addEventListener("pointerdown",x,!0),n.addEventListener("touchstart",t,!0),n.addEventListener("touchmove",M0,!0),n.addEventListener("touchend",H0,!0),n.addEventListener("mousedown",x,!0);let m=[];if(N){if(D5(G))m=UJ(G);if(D5(X))m=m.concat(UJ(X));if(!D5(z)&&z&&z.contextElement)m=m.concat(UJ(z.contextElement))}return m=m.filter((d)=>d!==n.defaultView?.visualViewport),m.forEach((d)=>{d.addEventListener("scroll",Z0,{passive:!0})}),()=>{if(n.removeEventListener("pointerdown",w,!0),W)n.removeEventListener("keydown",R),n.removeEventListener("compositionstart",J0),n.removeEventListener("compositionend",Q0);if(O)n.removeEventListener("click",x,!0),n.removeEventListener("pointerdown",x,!0),n.removeEventListener("touchstart",t,!0),n.removeEventListener("touchmove",M0,!0),n.removeEventListener("touchend",H0,!0),n.removeEventListener("mousedown",x,!0);m.forEach((d)=>{d.removeEventListener("scroll",Z0)}),i.clear(),D.current=!1}},[Y,X,z,G,W,O,Q,H,N,K,A,C,R,u,x,j,t,M0,H0,w,J]),u4.useEffect(h,[O,h]);let U0=u4.useMemo(()=>({onKeyDown:R,...U&&{[xd[F]]:(i)=>{J.setOpen(!1,D0(K0.triggerPress,i.nativeEvent))},...F!=="intentional"&&{onClick(i){J.setOpen(!1,D0(K0.triggerPress,i.nativeEvent))}}}}),[R,J,U,F]),X0=q0((i)=>{let Z0=y5(i.nativeEvent);if(!p0(J.select("floatingElement"),Z0)||i.button!==0)return;D.current=!0}),Y0=q0((i)=>{if(!Q||!K||i.button!==0)return;D.current=!0}),V0=u4.useMemo(()=>({onKeyDown:R,onPointerDown:X0,onMouseDown:X0,onMouseUp:X0,onClickCapture:g,onMouseDownCapture(i){g(),Y0(i)},onPointerDownCapture(i){g(),Y0(i)},onMouseUpCapture:g,onTouchEndCapture:g,onTouchMoveCapture:g}),[R,X0,g,Y0]);return u4.useMemo(()=>K?{reference:U0,floating:V0,trigger:U0}:{},[K,U0,V0])}var n8=P(v(),1);var gd={open:k0(($)=>$.open),domReferenceElement:k0(($)=>$.domReferenceElement),referenceElement:k0(($)=>$.positionReference??$.referenceElement),floatingElement:k0(($)=>$.floatingElement),floatingId:k0(($)=>$.floatingId)};class O3 extends i8{constructor($){let{nested:Z,noEmit:J,onOpenChange:Q,triggerElements:X,...z}=$;super({...z,positionReference:z.referenceElement,domReferenceElement:z.referenceElement},{onOpenChange:Q,dataRef:{current:{}},events:vz(),nested:Z,noEmit:J,triggerElements:X},gd)}setOpen=($,Z)=>{if(!$||!this.state.open||Oz(Z.event))this.context.dataRef.current.openEvent=$?Z.event:void 0;if(!this.context.noEmit){let J={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",J)}this.context.onOpenChange?.($,Z)}}var NJ=P(v(),1);var FJ=P(v(),1);function c4($,Z=!1,J=!1){let[Q,X]=FJ.useState($&&Z?"idle":void 0),[z,G]=FJ.useState($);if($&&!z)G(!0),X("starting");if(!$&&z&&Q!=="ending"&&!J)X("ending");if(!$&&!z&&Q==="ending")X(void 0);return B0(()=>{if(!$&&z&&Q!=="ending"&&J){let H=K1.request(()=>{X("ending")});return()=>{K1.cancel(H)}}return},[$,z,Q,J]),B0(()=>{if(!$||Z)return;let H=K1.request(()=>{X(void 0)});return()=>{K1.cancel(H)}},[Z,$]),B0(()=>{if(!$||!Z)return;if($&&z&&Q!=="idle")X("starting");let H=K1.request(()=>{X("idle")});return()=>{K1.cancel(H)}},[Z,$,z,X,Q]),FJ.useMemo(()=>({mounted:z,setMounted:G,transitionStatus:Q}),[z,Q])}function Dq($,Z){let J=NJ.useRef(null),Q=NJ.useRef(null);return NJ.useCallback((X)=>{if($===void 0)return;if(J.current!==null){let z=J.current,G=Q.current,H=Z.context.triggerElements.getById(z);if(G&&H===G)Z.context.triggerElements.delete(z);J.current=null,Q.current=null}if(X!==null)J.current=$,Q.current=X,Z.context.triggerElements.add($,X)},[Z,$])}function u2($,Z,J,Q){let X=J.useState("isMountedByTrigger",$),z=Dq($,J),G=q0((H)=>{if(z(H),!H||!J.select("open"))return;let Y=J.select("activeTriggerId");if(Y===$){J.update({activeTriggerElement:H,...Q});return}if(Y==null)J.update({activeTriggerId:$,activeTriggerElement:H,...Q})});return B0(()=>{if(X)J.update({activeTriggerElement:Z.current,...Q})},[X,J,Z,...Object.values(Q)]),{registerTrigger:G,isMountedByThisTrigger:X}}function c2($){let Z=$.useState("open");B0(()=>{if(Z&&!$.select("activeTriggerId")&&$.context.triggerElements.size===1){let J=$.context.triggerElements.entries().next();if(!J.done){let[Q,X]=J.value;$.update({activeTriggerId:Q,activeTriggerElement:X})}}},[Z,$])}function d2($,Z,J){let{mounted:Q,setMounted:X,transitionStatus:z}=c4($);Z.useSyncedValues({mounted:Q,transitionStatus:z});let G=q0(()=>{X(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),J?.(),Z.context.onOpenChangeComplete?.(!1)}),H=Z.useState("preventUnmountingOnClose");return y1({enabled:!H,open:$,ref:Z.context.popupRef,onComplete(){if(!$)G()}}),{forceUnmount:G,transitionStatus:z}}class a8{constructor(){this.elementsSet=new Set,this.idMap=new Map}add($,Z){let J=this.idMap.get($);if(J===Z)return;if(J!==void 0)this.elementsSet.delete(J);this.elementsSet.add(Z),this.idMap.set($,Z)}delete($){let Z=this.idMap.get($);if(Z)this.elementsSet.delete(Z),this.idMap.delete($)}hasElement($){return this.elementsSet.has($)}hasMatchingElement($){for(let Z of this.elementsSet)if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function HD(){return new O3({open:!1,floatingElement:null,referenceElement:null,triggerElements:new a8,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function l2(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:HD(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:k5,inactiveTriggerProps:k5,popupProps:k5}}var iz=k0(($)=>$.triggerIdProp??$.activeTriggerId),i2={open:k0(($)=>$.openProp??$.open),mounted:k0(($)=>$.mounted),transitionStatus:k0(($)=>$.transitionStatus),floatingRootContext:k0(($)=>$.floatingRootContext),preventUnmountingOnClose:k0(($)=>$.preventUnmountingOnClose),payload:k0(($)=>$.payload),activeTriggerId:iz,activeTriggerElement:k0(($)=>$.mounted?$.activeTriggerElement:null),isTriggerActive:k0(($,Z)=>Z!==void 0&&iz($)===Z),isOpenedByTrigger:k0(($,Z)=>Z!==void 0&&iz($)===Z&&$.open),isMountedByTrigger:k0(($,Z)=>Z!==void 0&&iz($)===Z&&$.mounted),triggerProps:k0(($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps),popupProps:k0(($)=>$.popupProps),popupElement:k0(($)=>$.popupElement),positionerElement:k0(($)=>$.positionerElement)};function VJ($){let{open:Z=!1,onOpenChange:J,elements:Q={}}=$,X=K8(),z=t1()!=null,G=S5(()=>new O3({open:Z,onOpenChange:J,referenceElement:Q.reference??null,floatingElement:Q.floating??null,triggerElements:new a8,floatingId:X,nested:z,noEmit:!1})).current;return B0(()=>{let H={open:Z,floatingId:X};if(Q.reference!==void 0)H.referenceElement=Q.reference,H.domReferenceElement=D5(Q.reference)?Q.reference:null;if(Q.floating!==void 0)H.floatingElement=Q.floating;G.update(H)},[Z,X,Q.reference,Q.floating,G]),G.context.onOpenChange=J,G.context.nested=z,G.context.noEmit=!1,G}function Oq($={}){let{nodeId:Z,externalTree:J}=$,Q=VJ($),X=$.rootContext||Q,z={reference:X.useState("referenceElement"),floating:X.useState("floatingElement"),domReference:X.useState("domReferenceElement")},[G,H]=n8.useState(null),Y=n8.useRef(null),K=I8(J);B0(()=>{if(z.domReference)Y.current=z.domReference},[z.domReference]);let W=YD({...$,elements:{...z,...G&&{reference:G}}}),B=n8.useCallback((C)=>{let I=D5(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;H(I),W.refs.setReference(I)},[W.refs]),[q,U]=n8.useState(null),[F,N]=n8.useState(null);X.useSyncedValue("referenceElement",q),X.useSyncedValue("domReferenceElement",D5(q)?q:null),X.useSyncedValue("floatingElement",F);let L=n8.useCallback((C)=>{if(D5(C)||C===null)Y.current=C,U(C);if(D5(W.refs.reference.current)||W.refs.reference.current===null||C!==null&&!D5(C))W.refs.setReference(C)},[W.refs,U]),V=n8.useCallback((C)=>{N(C),W.refs.setFloating(C)},[W.refs]),M=n8.useMemo(()=>({...W.refs,setReference:L,setFloating:V,setPositionReference:B,domReference:Y}),[W.refs,L,V,B]),_=n8.useMemo(()=>({...W.elements,domReference:z.domReference}),[W.elements,z.domReference]),O=X.useState("open"),D=X.useState("floatingId"),A=n8.useMemo(()=>({...W,dataRef:X.context.dataRef,open:O,onOpenChange:X.setOpen,events:X.context.events,floatingId:D,refs:M,elements:_,nodeId:Z,rootStore:X}),[W,M,_,Z,X,O,D]);return B0(()=>{X.context.dataRef.current.floatingContext=A;let C=K?.nodesRef.current.find((I)=>I.id===Z);if(C)C.context=A}),n8.useMemo(()=>({...W,context:A,refs:M,elements:_,rootStore:X}),[W,M,_,A,X])}function U2($){let{popupStore:Z,noEmit:J=!1,treatPopupAsFloatingElement:Q=!1,onOpenChange:X}=$,z=K8(),G=t1()!=null,H=Z.useState("open"),Y=Z.useState("activeTriggerElement"),K=Z.useState(Q?"popupElement":"positionerElement"),W=Z.context.triggerElements,B=S5(()=>new O3({open:H,referenceElement:Y,floatingElement:K,triggerElements:W,onOpenChange:X,floatingId:z,nested:G,noEmit:J})).current;return B0(()=>{let q={open:H,floatingId:z,referenceElement:Y,floatingElement:K};if(D5(Y))q.domReferenceElement=Y;if(B.state.positionReference===B.state.referenceElement)q.positionReference=Y;B.update(q)},[H,z,Y,K,B]),B.context.onOpenChange=X,B.context.nested=G,B.context.noEmit=J,B}var r2=P(v(),1);var Pq=J_&&Lz;function P3($,Z={}){let J="rootStore"in $?$.rootStore:$,{events:Q,dataRef:X}=J.context,{enabled:z=!0,delay:G}=Z,H=r2.useRef(!1),Y=r2.useRef(null),K=L1(),W=r2.useRef(!0);r2.useEffect(()=>{let q=J.select("domReferenceElement");if(!z)return;let U=E8(q);function F(){let V=J.select("domReferenceElement");if(!J.select("open")&&M1(V)&&V===a5(u0(V)))H.current=!0}function N(){W.current=!0}function L(){W.current=!1}if(U.addEventListener("blur",F),Pq)U.addEventListener("keydown",N,!0),U.addEventListener("pointerdown",L,!0);return()=>{if(U.removeEventListener("blur",F),Pq)U.removeEventListener("keydown",N,!0),U.removeEventListener("pointerdown",L,!0)}},[J,z]),r2.useEffect(()=>{if(!z)return;function q(U){if(U.reason===K0.triggerPress||U.reason===K0.escapeKey){let F=J.select("domReferenceElement");if(D5(F))Y.current=F,H.current=!0}}return Q.on("openchange",q),()=>{Q.off("openchange",q)}},[Q,z,J]);let B=r2.useMemo(()=>({onMouseLeave(){H.current=!1,Y.current=null},onFocus(q){let U=q.currentTarget;if(H.current){if(Y.current===U)return;H.current=!1,Y.current=null}let F=y5(q.nativeEvent);if(D5(F)){if(Pq&&!q.relatedTarget){if(!W.current&&!q3(F))return}else if(!a9(F))return}let N=B3(q.relatedTarget,J.context.triggerElements),{nativeEvent:L,currentTarget:V}=q,M=typeof G==="function"?G():G;if(J.select("open")&&N||M===0||M===void 0){J.setOpen(!0,D0(K0.triggerFocus,L,V));return}K.start(M,()=>{if(H.current)return;J.setOpen(!0,D0(K0.triggerFocus,L,V))})},onBlur(q){H.current=!1,Y.current=null;let{relatedTarget:U,nativeEvent:F}=q,N=D5(U)&&U.hasAttribute(O4("focus-guard"))&&U.getAttribute("data-type")==="outside";K.start(0,()=>{let L=J.select("domReferenceElement"),V=a5(L?L.ownerDocument:document);if(!U&&V===L)return;if(p0(X.current.floatingContext?.refs.floating.current,V)||p0(L,V)||N)return;if(B3(U??V,J.context.triggerElements))return;J.setOpen(!1,D0(K0.triggerFocus,F))})}}),[X,J,K,G]);return r2.useMemo(()=>z?{reference:B,trigger:B}:{},[z,B])}var l7=P(v(),1);var LJ=O4("safe-polygon"),vd=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${h7}`;function KD($){return $?Boolean($.closest(vd)):!1}class wq{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new i1,this.restTimeout=new i1,this.handleCloseOptions=void 0}static create(){return new wq}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}function rz($){let Z=S5(wq.create).current,J=$.context.dataRef.current;if(!J.hoverInteractionState)J.hoverInteractionState=Z;return C8(J.hoverInteractionState.disposeEffect),J.hoverInteractionState}var fd=new Set(["click","mousedown"]);function C9($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),z=J.useState("domReferenceElement"),{dataRef:G}=J.context,{enabled:H=!0,closeDelay:Y=0}=Z,K=rz(J),W=I8(),B=t1(),q=q0(()=>{if(K.interactedInside)return!0;return G.current.openEvent?fd.has(G.current.openEvent.type):!1}),U=q0(()=>{let _=G.current.openEvent?.type;return _?.includes("mouse")&&_!=="mousedown"}),F=q0((_)=>{return B3(_,J.context.triggerElements)}),N=l7.useCallback((_,O=!0)=>{let D=md(Y,K.pointerType);if(D&&!K.handler)K.openChangeTimeout.start(D,()=>J.setOpen(!1,D0(K0.triggerHover,_)));else if(O)K.openChangeTimeout.clear(),J.setOpen(!1,D0(K0.triggerHover,_))},[Y,J,K]),L=q0(()=>{K.unbindMouseMove(),K.handler=void 0}),V=q0(()=>{if(K.performedPointerEventsMutation){let _=u0(X).body;_.style.pointerEvents="",_.removeAttribute(LJ),K.performedPointerEventsMutation=!1}}),M=q0((_)=>{let O=y5(_);if(!KD(O)){K.interactedInside=!1;return}K.interactedInside=!0});B0(()=>{if(!Q)K.pointerType=void 0,K.restTimeoutPending=!1,K.interactedInside=!1,L(),V()},[Q,K,L,V]),l7.useEffect(()=>{return()=>{L()}},[L]),l7.useEffect(()=>{return V},[V]),B0(()=>{if(!H)return;if(Q&&K.handleCloseOptions?.blockPointerEvents&&U()&&D5(z)&&X){K.performedPointerEventsMutation=!0;let _=u0(X).body;_.setAttribute(LJ,"");let O=z,D=X,A=W?.nodesRef.current.find((C)=>C.id===B)?.context?.elements.floating;if(A)A.style.pointerEvents="";return _.style.pointerEvents="none",O.style.pointerEvents="auto",D.style.pointerEvents="auto",()=>{_.style.pointerEvents="",O.style.pointerEvents="",D.style.pointerEvents=""}}return},[H,Q,z,X,K,U,W,B]),l7.useEffect(()=>{if(!H)return;function _(C){if(q()||!G.current.floatingContext||!J.select("open"))return;if(F(C.relatedTarget))return;if(V(),L(),!q())N(C)}function O(C){K.openChangeTimeout.clear(),V(),K.handler?.(C),L()}function D(C){if(!q())N(C,!1)}let A=X;if(A)A.addEventListener("mouseleave",_),A.addEventListener("mouseenter",O),A.addEventListener("mouseleave",D),A.addEventListener("pointerdown",M,!0);return()=>{if(A)A.removeEventListener("mouseleave",_),A.removeEventListener("mouseenter",O),A.removeEventListener("mouseleave",D),A.removeEventListener("pointerdown",M,!0)}},[H,X,J,G,q,F,N,V,L,M,K])}function md($,Z){if(Z&&!p4(Z))return 0;if(typeof $==="function")return $();return $}var w3=P(v(),1),WD=P(H4(),1);function jq($){if(typeof $==="function")return $();return $}var pd={current:null};function F2($,Z={}){let J="rootStore"in $?$.rootStore:$,{dataRef:Q,events:X}=J.context,{enabled:z=!0,delay:G=0,handleClose:H=null,mouseOnly:Y=!1,restMs:K=0,move:W=!0,triggerElementRef:B=pd,externalTree:q,isActiveTrigger:U=!0}=Z,F=I8(q),N=rz(J),L=j1(H),V=j1(G),M=j1(K),_=j1(z);if(U)N.handleCloseOptions=L.current?.__options;let O=q0(()=>{if(N.interactedInside)return!0;return Q.current.openEvent?["click","mousedown"].includes(Q.current.openEvent.type):!1}),D=q0((E)=>{return B3(E,J.context.triggerElements)}),A=w3.useCallback((E,h=!0)=>{let k=m7(V.current,"close",N.pointerType);if(k&&!N.handler)N.openChangeTimeout.start(k,()=>J.setOpen(!1,D0(K0.triggerHover,E)));else if(h)N.openChangeTimeout.clear(),J.setOpen(!1,D0(K0.triggerHover,E))},[V,J,N]),C=q0(()=>{N.unbindMouseMove(),N.handler=void 0}),I=q0(()=>{if(N.performedPointerEventsMutation){let E=u0(J.select("domReferenceElement")).body;E.style.pointerEvents="",E.removeAttribute(LJ),N.performedPointerEventsMutation=!1}});w3.useEffect(()=>{if(!z)return;function E(h){if(!h.open)N.openChangeTimeout.clear(),N.restTimeout.clear(),N.blockMouseMove=!0,N.restTimeoutPending=!1}return X.on("openchange",E),()=>{X.off("openchange",E)}},[z,X,N]);let y=q0((E)=>{if(O())return;if(!Q.current.floatingContext)return;if(D(E.relatedTarget))return;let h=B.current;L.current?.({...Q.current.floatingContext,tree:F,x:E.clientX,y:E.clientY,onClose(){if(I(),C(),!O()&&h===J.select("domReferenceElement"))A(E)}})(E)});return w3.useEffect(()=>{if(!z)return;let E=B.current??(U?J.select("domReferenceElement"):null);if(!D5(E))return;function h(w){if(N.openChangeTimeout.clear(),N.blockMouseMove=!1,Y&&!p4(N.pointerType))return;if(jq(M.current)>0&&!m7(V.current,"open"))return;let T=m7(V.current,"open",N.pointerType),R=J.select("domReferenceElement"),b=J.context.triggerElements,g=(b.hasElement(w.target)||b.hasMatchingElement((t)=>p0(t,w.target)))&&(!R||!p0(R,w.target)),u=w.currentTarget??null,j=J.select("open"),e=!j||g;if(g&&j)J.setOpen(!0,D0(K0.triggerHover,w,u));else if(T)N.openChangeTimeout.start(T,()=>{if(e)J.setOpen(!0,D0(K0.triggerHover,w,u))});else if(e)J.setOpen(!0,D0(K0.triggerHover,w,u))}function k(w){if(O()){I();return}N.unbindMouseMove();let T=J.select("domReferenceElement"),R=u0(T);if(N.restTimeout.clear(),N.restTimeoutPending=!1,D(w.relatedTarget))return;if(L.current&&Q.current.floatingContext){if(!J.select("open"))N.openChangeTimeout.clear();let g=B.current;N.handler=L.current({...Q.current.floatingContext,tree:F,x:w.clientX,y:w.clientY,onClose(){if(I(),C(),_.current&&!O()&&g===J.select("domReferenceElement"))A(w,!0)}});let u=N.handler;u(w),R.addEventListener("mousemove",u),N.unbindMouseMove=()=>{R.removeEventListener("mousemove",u)};return}if(N.pointerType==="touch"?!p0(J.select("floatingElement"),w.relatedTarget):!0)A(w)}function S(w){y(w)}if(J.select("open"))E.addEventListener("mouseleave",S);if(W)E.addEventListener("mousemove",h,{once:!0});return E.addEventListener("mouseenter",h),E.addEventListener("mouseleave",k),()=>{if(E.removeEventListener("mouseleave",S),W)E.removeEventListener("mousemove",h);E.removeEventListener("mouseenter",h),E.removeEventListener("mouseleave",k)}},[C,I,Q,V,A,J,z,L,y,N,U,O,D,Y,W,M,B,F,_]),w3.useMemo(()=>{if(!z)return;function E(h){N.pointerType=h.pointerType}return{onPointerDown:E,onPointerEnter:E,onMouseMove(h){let{nativeEvent:k}=h,S=h.currentTarget,w=J.select("domReferenceElement"),T=J.context.triggerElements,R=J.select("open"),b=(T.hasElement(h.target)||T.hasMatchingElement((u)=>p0(u,h.target)))&&(!w||!p0(w,h.target));if(Y&&!p4(N.pointerType))return;if(R&&!b||jq(M.current)===0)return;if(!b&&N.restTimeoutPending&&h.movementX**2+h.movementY**2<2)return;N.restTimeout.clear();function g(){if(N.restTimeoutPending=!1,O())return;let u=J.select("open");if(!N.blockMouseMove&&(!u||b))J.setOpen(!0,D0(K0.triggerHover,k,S))}if(N.pointerType==="touch")WD.flushSync(()=>{g()});else if(b&&R)g();else N.restTimeoutPending=!0,N.restTimeout.start(jq(M.current),g)}}},[z,N,O,Y,J,M])}var j3=P(v(),1);function $8($=[]){let Z=$.map((K)=>K?.reference),J=$.map((K)=>K?.floating),Q=$.map((K)=>K?.item),X=$.map((K)=>K?.trigger),z=j3.useCallback((K)=>az(K,$,"reference"),Z),G=j3.useCallback((K)=>az(K,$,"floating"),J),H=j3.useCallback((K)=>az(K,$,"item"),Q),Y=j3.useCallback((K)=>az(K,$,"trigger"),X);return j3.useMemo(()=>({getReferenceProps:z,getFloatingProps:G,getItemProps:H,getTriggerProps:Y}),[z,G,H,Y])}function az($,Z,J){let Q=new Map,X=J==="item",z={};if(J==="floating")z.tabIndex=-1,z[zJ]="";for(let G in $){if(X&&$){if(G===Zq||G===Jq)continue}z[G]=$[G]}for(let G=0;G<Z.length;G+=1){let H,Y=Z[G]?.[J];if(typeof Y==="function")H=$?Y($):null;else H=Y;if(!H)continue;BD(z,H,X,Q)}return BD(z,$,X,Q),z}function BD($,Z,J,Q){for(let X in Z){let z=Z[X];if(J&&(X===Zq||X===Jq))continue;if(!X.startsWith("on"))$[X]=z;else{if(!Q.has(X))Q.set(X,[]);if(typeof z==="function")Q.get(X)?.push(z),$[X]=(...G)=>{return Q.get(X)?.map((H)=>H(...G)).find((H)=>H!==void 0)}}}}var Z8=P(v(),1);var ud="Escape";function oz($,Z,J){switch($){case"vertical":return Z;case"horizontal":return J;default:return Z||J}}function nz($,Z){return oz(Z,$===GJ||$===W3,$===b2||$===x2)}function Tq($,Z,J){return oz(Z,$===W3,J?$===b2:$===x2)||$==="Enter"||$===" "||$===""}function cd($,Z,J){return oz(Z,J?$===b2:$===x2,$===W3)}function dd($,Z,J,Q){let X=J?$===x2:$===b2,z=$===GJ;if(Z==="both"||Z==="horizontal"&&Q&&Q>1)return $===ud;return oz(Z,X,z)}function Cq($,Z){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingElement"),z=J.useState("domReferenceElement"),G=J.context.dataRef,{listRef:H,activeIndex:Y,onNavigate:K=()=>{},enabled:W=!0,selectedIndex:B=null,allowEscape:q=!1,loopFocus:U=!1,nested:F=!1,rtl:N=!1,virtual:L=!1,focusItemOnOpen:V="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:_=!0,disabledIndices:O=void 0,orientation:D="vertical",parentOrientation:A,cols:C=1,id:I,resetOnPointerLeave:y=!0,externalTree:E}=Z,h=U3(X),k=j1(h),S=t1(),w=I8(E);B0(()=>{G.current.orientation=D},[G,D]);let T=HJ(z),R=Z8.useRef(V),b=Z8.useRef(B??-1),g=Z8.useRef(null),u=Z8.useRef(!0),j=q0((f)=>{K(b.current===-1?null:b.current,f)}),e=Z8.useRef(j),t=Z8.useRef(!!X),x=Z8.useRef(Q),$0=Z8.useRef(!1),M0=Z8.useRef(!1),l=j1(O),H0=j1(Q),U0=j1(B),X0=j1(y),Y0=q0(()=>{function f(j0){if(L)w?.events.emit("virtualfocus",j0);else M3(j0,{sync:$0.current,preventScroll:!0})}let a=H.current[b.current],o=M0.current;if(a)f(a);($0.current?(j0)=>j0():requestAnimationFrame)(()=>{let j0=H.current[b.current]||a;if(!j0)return;if(!a)f(j0);if(i&&(o||!u.current))j0.scrollIntoView?.({block:"nearest",inline:"nearest"})})});B0(()=>{if(!W)return;if(Q&&X){if(b.current=B??-1,R.current&&B!=null)M0.current=!0,j()}else if(t.current)b.current=-1,e.current()},[W,Q,X,B,j]),B0(()=>{if(!W)return;if(!Q){$0.current=!1;return}if(!X)return;if(Y==null){if($0.current=!1,U0.current!=null)return;if(t.current)b.current=-1,Y0();if((!x.current||!t.current)&&R.current&&(g.current!=null||R.current===!0&&g.current==null)){let f=0,a=()=>{if(H.current[0]==null){if(f<2)(f?requestAnimationFrame:queueMicrotask)(a);f+=1}else b.current=g.current==null||Tq(g.current,D,N)||F?wz(H):zq(H),g.current=null,j()};a()}}else if(!g7(H,Y))b.current=Y,Y0(),M0.current=!1},[W,Q,X,Y,U0,F,H,D,N,j,Y0,l]),B0(()=>{if(!W||X||!w||L||!t.current)return;let f=w.nodesRef.current,a=f.find((j0)=>j0.id===S)?.context?.elements.floating,o=a5(u0(X)),N0=f.some((j0)=>j0.context&&p0(j0.context.elements.floating,o));if(a&&!N0&&u.current)a.focus({preventScroll:!0})},[W,X,w,S,L]),B0(()=>{e.current=j,x.current=Q,t.current=!!X}),B0(()=>{if(!Q)g.current=null,R.current=V},[Q,V]);let V0=Y!=null,i=Z8.useMemo(()=>{function f(o){if(!H0.current)return;let N0=H.current.indexOf(o.currentTarget);if(N0!==-1&&b.current!==N0)b.current=N0,j(o)}return{onFocus(o){$0.current=!0,f(o)},onClick:({currentTarget:o})=>o.focus({preventScroll:!0}),onMouseMove(o){if($0.current=!0,M0.current=!1,M)f(o)},onPointerLeave(o){if(!H0.current||!u.current||o.pointerType==="touch")return;$0.current=!0;let N0=o.relatedTarget;if(!M||H.current.includes(N0))return;if(!X0.current)return;if(M3(null,{sync:!0}),b.current=-1,j(o),!L)k.current?.focus({preventScroll:!0})}}},[H0,k,M,H,j,X0,L]),Z0=Z8.useCallback(()=>{return A??w?.nodesRef.current.find((f)=>f.id===S)?.context?.dataRef?.current.orientation},[S,w,A]),J0=q0((f)=>{if(u.current=!1,$0.current=!0,f.which===229)return;if(!H0.current&&f.currentTarget===k.current)return;if(F&&dd(f.key,D,N,C)){if(!nz(f.key,Z0()))r1(f);if(J.setOpen(!1,D0(K0.listNavigation,f.nativeEvent)),M1(z))if(L)w?.events.emit("virtualfocus",z);else z.focus();return}let a=b.current,o=wz(H,O),N0=zq(H,O);if(!T){if(f.key==="Home")r1(f),b.current=o,j(f);if(f.key==="End")r1(f),b.current=N0,j(f)}if(C>1){let j0=Array.from({length:H.current.length},()=>({width:1,height:1})),h0=H_(j0,C,!1),c0=h0.findIndex((z0)=>z0!=null&&!v7(H,z0,O)),p=h0.reduce((z0,L0,P0)=>L0!=null&&!v7(H,L0,O)?P0:z0,-1),r=h0[G_({current:h0.map((z0)=>z0!=null?H.current[z0]:null)},{event:f,orientation:D,loopFocus:U,rtl:N,cols:C,disabledIndices:K_([...(typeof O!=="function"?O:null)||H.current.map((z0,L0)=>v7(H,L0,O)?L0:void 0),void 0],h0),minIndex:c0,maxIndex:p,prevIndex:Y_(b.current>N0?o:b.current,j0,h0,C,f.key===W3?"bl":f.key===(N?b2:x2)?"tr":"tl"),stopEvent:!0})];if(r!=null)b.current=r,j(f);if(D==="both")return}if(nz(f.key,D)){if(r1(f),Q&&!L&&a5(f.currentTarget.ownerDocument)===f.currentTarget){b.current=Tq(f.key,D,N)?o:N0,j(f);return}if(Tq(f.key,D,N))if(U)if(a>=N0)if(q&&a!==H.current.length)b.current=-1;else $0.current=!1,b.current=o;else b.current=_8(H,{startingIndex:a,disabledIndices:O});else b.current=Math.min(N0,_8(H,{startingIndex:a,disabledIndices:O}));else if(U)if(a<=o)if(q&&a!==-1)b.current=H.current.length;else $0.current=!1,b.current=N0;else b.current=_8(H,{startingIndex:a,decrement:!0,disabledIndices:O});else b.current=Math.max(o,_8(H,{startingIndex:a,decrement:!0,disabledIndices:O}));if(g7(H,b.current))b.current=-1;j(f)}}),Q0=Z8.useMemo(()=>{return L&&Q&&V0&&{"aria-activedescendant":`${I}-${Y}`}},[L,Q,V0,I,Y]),n=Z8.useMemo(()=>{return{"aria-orientation":D==="both"?void 0:D,...!T?Q0:{},onKeyDown(f){if(f.key==="Tab"&&f.shiftKey&&Q&&!L){let a=y5(f.nativeEvent);if(a&&!p0(k.current,a))return;if(r1(f),J.setOpen(!1,D0(K0.focusOut,f.nativeEvent)),M1(z))z.focus();return}J0(f)},onPointerMove(){u.current=!0}}},[Q0,J0,k,D,T,J,Q,L,z]),m=Z8.useMemo(()=>{function f(o){if(V==="auto"&&_z(o.nativeEvent))R.current=!L}function a(o){if(R.current=V,V==="auto"&&Dz(o.nativeEvent))R.current=!0}return{onKeyDown(o){let N0=J.select("open");u.current=!1;let j0=o.key.startsWith("Arrow"),h0=cd(o.key,Z0(),N),c0=nz(o.key,D),p=(F?h0:c0)||o.key==="Enter"||o.key.trim()==="";if(L&&N0)return J0(o);if(!N0&&!_&&j0)return;if(p){let r=nz(o.key,Z0());g.current=F&&r?null:o.key}if(F){if(h0)if(r1(o),N0)b.current=wz(H,l.current),j(o);else J.setOpen(!0,D0(K0.listNavigation,o.nativeEvent,o.currentTarget));return}if(c0){if(U0.current!=null)b.current=U0.current;if(r1(o),!N0&&_)J.setOpen(!0,D0(K0.listNavigation,o.nativeEvent,o.currentTarget));else J0(o);if(N0)j(o)}return},onFocus(o){if(J.select("open")&&!L)b.current=-1,j(o)},onPointerDown:a,onPointerEnter:a,onMouseDown:f,onClick:f}},[J0,l,V,H,F,j,J,_,D,Z0,N,U0,L]),d=Z8.useMemo(()=>{return{...Q0,...m}},[Q0,m]);return Z8.useMemo(()=>W?{reference:d,floating:n,item:i,trigger:m}:{},[W,d,n,m,i])}var e9=P(v(),1);var ld=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function T3($,Z={}){let J="rootStore"in $?$.rootStore:$,Q=J.useState("open"),X=J.useState("floatingId"),z=J.useState("domReferenceElement"),G=J.useState("floatingElement"),{role:H="dialog"}=Z,Y=K8(),K=z?.id||Y,W=e9.useMemo(()=>U3(G)?.id||X,[G,X]),B=ld.get(H)??H,U=t1()!=null,F=e9.useMemo(()=>{if(B==="tooltip"||H==="label")return k5;return{"aria-haspopup":B==="alertdialog"?"dialog":B,"aria-expanded":"false",...B==="listbox"&&{role:"combobox"},...B==="menu"&&U&&{role:"menuitem"},...H==="select"&&{"aria-autocomplete":"none"},...H==="combobox"&&{"aria-autocomplete":"list"}}},[B,U,H]),N=e9.useMemo(()=>{if(B==="tooltip"||H==="label")return{[`aria-${H==="label"?"labelledby":"describedby"}`]:Q?W:void 0};return{...F,"aria-expanded":Q?"true":"false","aria-controls":Q?W:void 0,...B==="menu"&&{id:K}}},[B,W,Q,K,H,F]),L=e9.useMemo(()=>{let M={id:W,...B&&{role:B}};if(B==="tooltip"||H==="label")return M;return{...M,...B==="menu"&&{"aria-labelledby":K}}},[B,W,K,H]),V=e9.useCallback(({active:M,selected:_})=>{let O={role:"option",...M&&{id:`${W}-fui-option`}};switch(H){case"select":case"combobox":return{...O,"aria-selected":_};default:}return{}},[W,H]);return e9.useMemo(()=>({reference:N,floating:L,item:V,trigger:F}),[N,L,F,V])}var $6=P(v(),1);function Eq($,Z){let J="rootStore"in $?$.rootStore:$,Q=J.context.dataRef,X=J.useState("open"),{listRef:z,activeIndex:G,onMatch:H,onTypingChange:Y,enabled:K=!0,resetMs:W=750,selectedIndex:B=null}=Z,q=L1(),U=$6.useRef(""),F=$6.useRef(B??G??-1),N=$6.useRef(null);B0(()=>{if(!X&&B!==null)return;if(q.clear(),N.current=null,U.current!=="")U.current=""},[X,B,q]),B0(()=>{if(X&&U.current==="")F.current=B??G??-1},[X,B,G]);let L=q0((D)=>{if(D){if(!Q.current.typing)Q.current.typing=D,Y?.(D)}else if(Q.current.typing)Q.current.typing=D,Y?.(D)}),V=q0((D)=>{function A(k,S,w){let T=S.find((R)=>R?.toLocaleLowerCase().indexOf(w.toLocaleLowerCase())===0);return T?k.indexOf(T):-1}let C=z.current;if(U.current.length>0&&U.current[0]!==" "){if(A(C,C,U.current)===-1)L(!1);else if(D.key===" ")r1(D)}if(C==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;if(X&&D.key!==" ")r1(D),L(!0);let I=U.current==="";if(I)F.current=B??G??-1;if(C.every((k)=>k?k[0]?.toLocaleLowerCase()!==k[1]?.toLocaleLowerCase():!0)&&U.current===D.key)U.current="",F.current=N.current;U.current+=D.key,q.start(W,()=>{U.current="",F.current=N.current,L(!1)});let E=I?B??G??-1:F.current,h=A(C,[...C.slice((E||0)+1),...C.slice(0,(E||0)+1)],U.current);if(h!==-1)H?.(h),N.current=h;else if(D.key!==" ")U.current="",L(!1)}),M=q0((D)=>{let A=D.relatedTarget,C=J.select("domReferenceElement"),I=J.select("floatingElement"),y=p0(C,A),E=p0(I,A);if(y||E)return;q.clear(),U.current="",F.current=N.current,L(!1)}),_=$6.useMemo(()=>({onKeyDown:V,onBlur:M}),[V,M]),O=$6.useMemo(()=>{return{onKeyDown:V,onKeyUp(D){if(D.key===" ")L(!1)},onBlur:M}},[V,M,L]);return $6.useMemo(()=>K?{reference:_,floating:O}:{},[K,_,O])}function qD($,Z){let[J,Q]=$,X=!1,z=Z.length;for(let G=0,H=z-1;G<z;H=G++){let[Y,K]=Z[G]||[0,0],[W,B]=Z[H]||[0,0];if(K>=Q!==B>=Q&&J<=(W-Y)*(Q-K)/(B-K)+Y)X=!X}return X}function id($,Z){return $[0]>=Z.x&&$[0]<=Z.x+Z.width&&$[1]>=Z.y&&$[1]<=Z.y+Z.height}function N2($={}){let{buffer:Z=0.5,blockPointerEvents:J=!1,requireIntent:Q=!0}=$,X=new i1,z=!1,G=null,H=null,Y=typeof performance<"u"?performance.now():0;function K(B,q){let U=performance.now(),F=U-Y;if(G===null||H===null||F===0)return G=B,H=q,Y=U,null;let N=B-G,L=q-H,M=Math.sqrt(N*N+L*L)/F;return G=B,H=q,Y=U,M}let W=({x:B,y:q,placement:U,elements:F,onClose:N,nodeId:L,tree:V})=>{return function(_){function O(){X.clear(),N()}if(X.clear(),!F.domReference||!F.floating||U==null||B==null||q==null)return;let{clientX:D,clientY:A}=_,C=[D,A],I=y5(_),y=_.type==="mouseleave",E=p0(F.floating,I),h=p0(F.domReference,I),k=F.domReference.getBoundingClientRect(),S=F.floating.getBoundingClientRect(),w=U.split("-")[0],T=B>S.right-S.width/2,R=q>S.bottom-S.height/2,b=id(C,k),g=S.width>k.width,u=S.height>k.height,j=(g?k:S).left,e=(g?k:S).right,t=(u?k:S).top,x=(u?k:S).bottom;if(E){if(z=!0,!y)return}if(h)z=!1;if(h&&!y){z=!0;return}if(y&&D5(_.relatedTarget)&&p0(F.floating,_.relatedTarget))return;if(V&&h2(V.nodesRef.current,L).some(({context:l})=>l?.open))return;if(w==="top"&&q>=k.bottom-1||w==="bottom"&&q<=k.top+1||w==="left"&&B>=k.right-1||w==="right"&&B<=k.left+1)return O();let $0=[];switch(w){case"top":$0=[[j,k.top+1],[j,S.bottom-1],[e,S.bottom-1],[e,k.top+1]];break;case"bottom":$0=[[j,S.top+1],[j,k.bottom-1],[e,k.bottom-1],[e,S.top+1]];break;case"left":$0=[[S.right-1,x],[S.right-1,t],[k.left+1,t],[k.left+1,x]];break;case"right":$0=[[k.right-1,x],[k.right-1,t],[S.left+1,t],[S.left+1,x]];break;default:}function M0([l,H0]){switch(w){case"top":{let U0=[g?l+Z/2:T?l+Z*4:l-Z*4,H0+Z+1],X0=[g?l-Z/2:T?l+Z*4:l-Z*4,H0+Z+1],Y0=[[S.left,T?S.bottom-Z:g?S.bottom-Z:S.top],[S.right,T?g?S.bottom-Z:S.top:S.bottom-Z]];return[U0,X0,...Y0]}case"bottom":{let U0=[g?l+Z/2:T?l+Z*4:l-Z*4,H0-Z],X0=[g?l-Z/2:T?l+Z*4:l-Z*4,H0-Z],Y0=[[S.left,T?S.top+Z:g?S.top+Z:S.bottom],[S.right,T?g?S.top+Z:S.bottom:S.top+Z]];return[U0,X0,...Y0]}case"left":{let U0=[l+Z+1,u?H0+Z/2:R?H0+Z*4:H0-Z*4],X0=[l+Z+1,u?H0-Z/2:R?H0+Z*4:H0-Z*4];return[...[[R?S.right-Z:u?S.right-Z:S.left,S.top],[R?u?S.right-Z:S.left:S.right-Z,S.bottom]],U0,X0]}case"right":{let U0=[l-Z,u?H0+Z/2:R?H0+Z*4:H0-Z*4],X0=[l-Z,u?H0-Z/2:R?H0+Z*4:H0-Z*4],Y0=[[R?S.left+Z:u?S.left+Z:S.right,S.top],[R?u?S.left+Z:S.right:S.left+Z,S.bottom]];return[U0,X0,...Y0]}default:return[]}}if(qD([D,A],$0))return;if(z&&!b)return O();if(!y&&Q){let l=K(_.clientX,_.clientY),H0=0.1;if(l!==null&&l<0.1)return O()}if(!qD([D,A],M0([B,q])))O();else if(!z&&Q)X.start(40,O);return}};return W.__options={blockPointerEvents:J},W}var FD=P(c(),1),i7=tz.forwardRef(function(Z,J){let{children:Q,container:X,className:z,render:G,...H}=Z,{portalNode:Y,portalSubtree:K}=dz({container:X,ref:J,componentProps:Z,elementProps:H});if(!K&&!Y)return null;return FD.jsxs(tz.Fragment,{children:[K,Y&&UD.createPortal(Q,Y)]})});var ND=i7;var Z6=P(v(),1);var w4=P(v(),1);var ez=P(v(),1),rd=ez.createContext(void 0);function d4(){return ez.useContext(rd)?.direction??"ltr"}var ad=($)=>({name:"arrow",options:$,async fn(Z){let{x:J,y:Q,placement:X,rects:z,platform:G,elements:H,middlewareData:Y}=Z,{element:K,padding:W=0,offsetParent:B="real"}=LD($,Z)||{};if(K==null)return{};let q=_D(W),U={x:J,y:Q},F=AD(X),N=MD(F),L=await G.getDimensions(K),V=F==="y",M=V?"top":"left",_=V?"bottom":"right",O=V?"clientHeight":"clientWidth",D=z.reference[N]+z.reference[F]-U[F]-z.floating[N],A=U[F]-z.reference[F],C=B==="real"?await G.getOffsetParent?.(K):H.floating,I=H.floating[O]||z.floating[N];if(!I||!await G.isElement?.(C))I=H.floating[O]||z.floating[N];let y=D/2-A/2,E=I/2-L[N]/2-1,h=Math.min(q[M],E),k=Math.min(q[_],E),S=h,w=I-L[N]-k,T=I/2-L[N]/2+y,R=VD(S,T,w),b=!Y.arrow&&MJ(X)!=null&&T!==R&&z.reference[N]/2-(T<S?h:k)-L[N]/2<0,g=b?T<S?T-S:T-w:0;return{[F]:U[F]+g,data:{[F]:R,centerOffset:T-R-g,...b&&{alignmentOffset:g}},reset:b}}}),DD=($,Z)=>({...ad($),options:[$,Z]});var OD={name:"hide",async fn($){let{width:Z,height:J,x:Q,y:X}=$.rects.reference,z=Z===0&&J===0&&Q===0&&X===0;return{data:{referenceHidden:(await bq().fn($)).data?.referenceHidden||z}}}};var AJ={sideX:"left",sideY:"top"},r7={name:"adaptiveOrigin",async fn($){let{x:Z,y:J,rects:{floating:Q},elements:{floating:X},platform:z,strategy:G,placement:H}=$,Y=E8(X),K=Y.getComputedStyle(X);if(!(K.transitionDuration!=="0s"&&K.transitionDuration!==""))return{x:Z,y:J,data:AJ};let B=await z.getOffsetParent?.(X),q={width:0,height:0};if(G==="fixed"&&Y?.visualViewport)q={width:Y.visualViewport.width,height:Y.visualViewport.height};else if(B===Y){let M=u0(X);q={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else if(await z.isElement?.(B))q=await z.getDimensions(B);let U=C3(H),F=Z,N=J;if(U==="left")F=q.width-(Z+Q.width);if(U==="top")N=q.height-(J+Q.height);let L=U==="left"?"right":AJ.sideX,V=U==="top"?"bottom":AJ.sideY;return{x:F,y:N,data:{sideX:L,sideY:V}}}};function jD($,Z,J){let Q=$==="inline-start"||$==="inline-end";return{top:"top",right:Q?J?"inline-start":"inline-end":"right",bottom:"bottom",left:Q?J?"inline-end":"inline-start":"left"}[Z]}function PD($,Z,J){let{rects:Q,placement:X}=$;return{side:jD(Z,C3(X),J),align:MJ(X)||"center",anchor:{width:Q.reference.width,height:Q.reference.height},positioner:{width:Q.floating.width,height:Q.floating.height}}}function a2($){let{anchor:Z,positionMethod:J="absolute",side:Q="bottom",sideOffset:X=0,align:z="center",alignOffset:G=0,collisionBoundary:H,collisionPadding:Y=5,sticky:K=!1,arrowPadding:W=5,disableAnchorTracking:B=!1,keepMounted:q=!1,floatingRootContext:U,mounted:F,collisionAvoidance:N,shiftCrossAxis:L=!1,nodeId:V,adaptiveOrigin:M,lazyFlip:_=!1,externalTree:O}=$,[D,A]=w4.useState(null);if(!F&&D!==null)A(null);let C=N.side||"flip",I=N.align||"flip",y=N.fallbackAxisSide||"end",E=typeof Z==="function"?Z:void 0,h=q0(E),k=E?h:Z,S=j1(Z),T=d4()==="rtl",R=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":T?"left":"right","inline-start":T?"right":"left"}[Q],b=z==="center"?R:`${R}-${z}`,g=Y,u=1,j=Q==="bottom"?u:0,e=Q==="top"?u:0,t=Q==="right"?u:0,x=Q==="left"?u:0;if(typeof g==="number")g={top:g+j,right:g+x,bottom:g+e,left:g+t};else if(g)g={top:(g.top||0)+j,right:(g.right||0)+x,bottom:(g.bottom||0)+e,left:(g.left||0)+t};let $0={boundary:H==="clipping-ancestors"?"clippingAncestors":H,padding:g},M0=w4.useRef(null),l=j1(X),H0=j1(G),Y0=[Sq((A0)=>{let f0=PD(A0,Q,T),w5=typeof l.current==="function"?l.current(f0):l.current,W5=typeof H0.current==="function"?H0.current(f0):H0.current;return{mainAxis:w5,crossAxis:W5,alignmentAxis:W5}},[typeof X!=="function"?X:0,typeof G!=="function"?G:0,T,Q])],V0=I==="none"&&C!=="shift",i=!V0&&(K||L||C==="shift"),Z0=C==="none"?null:Rq({...$0,padding:{top:g.top+u,right:g.right+u,bottom:g.bottom+u,left:g.left+u},mainAxis:!L&&C==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:y}),J0=V0?null:kq((A0)=>{let f0=u0(A0.elements.floating).documentElement;return{...$0,rootBoundary:L?{x:0,y:0,width:f0.clientWidth,height:f0.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:i,limiter:K||L?void 0:Iq((w5)=>{if(!M0.current)return{};let{width:W5,height:l5}=M0.current.getBoundingClientRect(),I0=xq(C3(w5.placement)),T0=I0==="y"?W5:l5,m0=I0==="y"?g.left+g.right:g.top+g.bottom;return{offset:T0/2+m0/2}})}},[$0,K,L,g,I]);if(C==="shift"||I==="shift"||z==="center")Y0.push(J0,Z0);else Y0.push(Z0,J0);Y0.push(yq({...$0,apply({elements:{floating:A0},rects:{reference:f0},availableWidth:w5,availableHeight:W5}){let l5=A0.style;l5.setProperty("--available-width",`${w5}px`),l5.setProperty("--available-height",`${W5}px`),l5.setProperty("--anchor-width",`${f0.width}px`),l5.setProperty("--anchor-height",`${f0.height}px`)}}),DD(()=>({element:M0.current||document.createElement("div"),padding:W,offsetParent:"floating"}),[W]),{name:"transformOrigin",fn(A0){let{elements:f0,middlewareData:w5,placement:W5,rects:l5,y:I0}=A0,T0=C3(W5),m0=xq(T0),Z5=M0.current,Y5=w5.arrow?.x||0,I5=w5.arrow?.y||0,i5=Z5?.clientWidth||0,r5=Z5?.clientHeight||0,N5=Y5+i5/2,F1=I5+r5/2,m1=Math.abs(w5.shift?.y||0),l1=l5.reference.height/2,x0=typeof X==="function"?X(PD(A0,Q,T)):X,Q5=m1>x0,d0={top:`${N5}px calc(100% + ${x0}px)`,bottom:`${N5}px ${-x0}px`,left:`calc(100% + ${x0}px) ${F1}px`,right:`${-x0}px ${F1}px`}[T0],B5=`${N5}px ${l5.reference.y+l1-I0}px`;return f0.floating.style.setProperty("--transform-origin",i&&m0==="y"&&Q5?B5:d0),{}}},OD,M),B0(()=>{if(!F&&U)U.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[F,U]);let Q0=w4.useMemo(()=>({elementResize:!B&&typeof ResizeObserver<"u",layoutShift:!B&&typeof IntersectionObserver<"u"}),[B]),{refs:n,elements:m,x:d,y:f,middlewareData:a,update:o,placement:N0,context:j0,isPositioned:h0,floatingStyles:c0}=Oq({rootContext:U,placement:b,middleware:Y0,strategy:J,whileElementsMounted:q?void 0:(...A0)=>sz(...A0,Q0),nodeId:V,externalTree:O}),{sideX:p,sideY:r}=a.adaptiveOrigin||AJ,z0=h0?J:"fixed",L0=w4.useMemo(()=>{let A0=M?{position:z0,[p]:d,[r]:f}:{position:z0,...c0};if(!h0)A0.opacity=0;return A0},[M,z0,p,d,r,f,c0,h0]),P0=w4.useRef(null);B0(()=>{if(!F)return;let A0=S.current,f0=typeof A0==="function"?A0():A0,W5=(wD(f0)?f0.current:f0)||null||null;if(W5!==P0.current)n.setPositionReference(W5),P0.current=W5},[F,n,k,S]),w4.useEffect(()=>{if(!F)return;let A0=S.current;if(typeof A0==="function")return;if(wD(A0)&&A0.current!==P0.current)n.setPositionReference(A0.current),P0.current=A0.current},[F,n,k,S]),w4.useEffect(()=>{if(q&&F&&m.domReference&&m.floating)return sz(m.domReference,m.floating,o,Q0);return},[q,F,m,o,Q0]);let v0=C3(N0),$5=jD(Q,v0,T),F5=MJ(N0)||"center",l0=Boolean(a.hide?.referenceHidden);B0(()=>{if(_&&F&&h0)A(v0)},[_,F,h0,v0]);let R0=w4.useMemo(()=>({position:"absolute",top:a.arrow?.y,left:a.arrow?.x}),[a.arrow]),G0=a.arrow?.centerOffset!==0;return w4.useMemo(()=>({positionerStyles:L0,arrowStyles:R0,arrowRef:M0,arrowUncentered:G0,side:$5,align:F5,physicalSide:v0,anchorHidden:l0,refs:n,context:j0,isPositioned:h0,update:o}),[L0,R0,M0,G0,$5,F5,v0,l0,n,j0,h0,o])}function wD($){return $!=null&&"current"in $}var j4=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=f2.startingStyle]="startingStyle",$[$.endingStyle=f2.endingStyle]="endingStyle",$.anchorHidden="data-anchor-hidden",$.side="data-side",$.align="data-align",$}({}),_J=function($){return $.popupOpen="data-popup-open",$.pressed="data-pressed",$}({}),nd={[_J.popupOpen]:""},od={[_J.popupOpen]:"",[_J.pressed]:""},sd={[j4.open]:""},td={[j4.closed]:""},ed={[j4.anchorHidden]:""},n2={open($){if($)return nd;return null}},DJ={open($){if($)return od;return null}},V5={open($){if($)return sd;return td},anchorHidden($){if($)return ed;return null}};function W8($){return $==="starting"?TD:k5}var $G=P(v(),1),hq=$G.createContext(void 0);function CD(){let $=$G.useContext(hq);if($===void 0)throw Error(S0(84));return $}var ED=P(c(),1),SD=Z6.forwardRef(function(Z,J){let{toast:Q,...X}=Z,z=l9(),G=Q.positionerProps??k5,{render:H,className:Y,anchor:K=G.anchor,positionMethod:W=G.positionMethod??"absolute",side:B=G.side??"top",align:q=G.align??"center",sideOffset:U=G.sideOffset??0,alignOffset:F=G.alignOffset??0,collisionBoundary:N=G.collisionBoundary??"clipping-ancestors",collisionPadding:L=G.collisionPadding??5,arrowPadding:V=G.arrowPadding??5,sticky:M=G.sticky??!1,disableAnchorTracking:_=G.disableAnchorTracking??!1,collisionAvoidance:O=G.collisionAvoidance??o2,...D}=X,[A,C]=Z6.useState(null),I=z.useState("toastIndex",Q.id),y=z.useState("toastVisibleIndex",Q.id),E=D5(K)?K:null,h=VJ({open:!0,onOpenChange:m5,elements:{floating:A,reference:E}}),k=a2({anchor:E,positionMethod:W,floatingRootContext:h,mounted:!0,side:B,sideOffset:U,align:q,alignOffset:F,collisionBoundary:N,collisionPadding:L,sticky:M,arrowPadding:V,disableAnchorTracking:_,keepMounted:!0,collisionAvoidance:O}),S=Z6.useMemo(()=>{let b={};return{role:"presentation",style:{...k.positionerStyles,...b,[p2.index]:Q.transitionStatus==="ending"?I:y}}},[k.positionerStyles,Q.transitionStatus,I,y]),w=Z6.useMemo(()=>({side:k.side,align:k.align,anchorHidden:k.anchorHidden}),[k.side,k.align,k.anchorHidden]),T=Z6.useMemo(()=>({...w,arrowRef:k.arrowRef,arrowStyles:k.arrowStyles,arrowUncentered:k.arrowUncentered}),[w,k.arrowRef,k.arrowStyles,k.arrowUncentered]),R=W0("div",Z,{state:w,props:[S,W8(Q.transitionStatus),D],ref:[J,C],stateAttributesMapping:V5});return ED.jsx(hq.Provider,{value:T,children:R})});var kD=P(v(),1);var ID=kD.forwardRef(function(Z,J){let{className:Q,render:X,...z}=Z,{arrowRef:G,side:H,align:Y,arrowUncentered:K,arrowStyles:W}=CD();return W0("div",Z,{state:{side:H,align:Y,uncentered:K},ref:[J,G],props:[{style:W,"aria-hidden":!0},z]})});var ZG=P(v(),1);function RD(){let $=ZG.useContext(ZJ);if(!$)throw Error(S0(73));let Z=$.useState("toasts");return ZG.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function yD(){let $=new Set;function Z(J){$.forEach((Q)=>Q(J))}return{" subscribe":function(Q){return $.add(Q),()=>{$.delete(Q)}},add(J){let Q=J.id||qz("toast"),X={...J,id:Q,transitionStatus:"starting"};return Z({action:"add",options:X}),Q},close(J){Z({action:"close",options:{id:J}})},update(J,Q){Z({action:"update",options:{...Q,id:J}})},promise(J,Q){let X=J;return Z({action:"promise",options:{...Q,promise:J,setPromise(z){X=z}}}),X}}}var b5=P(c(),1),l4=R8.createToastManager();function $l({...$}){return b5.jsx(R8.Provider,{...$})}function Zl({...$}){return b5.jsx(R8.Portal,{"data-slot":"toast-portal",...$})}function Jl({className:$,...Z}){return b5.jsx(R8.Viewport,{"data-slot":"toast-viewport",className:s("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",$),...Z})}function Ql({className:$,...Z}){return b5.jsx(R8.Root,{"data-slot":"toast",className:s("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",$),...Z})}function Xl({className:$,...Z}){return b5.jsx(R8.Content,{"data-slot":"toast-content",className:s("flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",$),...Z})}function zl({className:$,...Z}){return b5.jsx(R8.Title,{"data-slot":"toast-title",className:s("text-sm font-medium",$),...Z})}function Gl({className:$,...Z}){return b5.jsx(R8.Description,{"data-slot":"toast-description",className:s("text-sm text-muted-foreground",$),...Z})}function Hl({className:$,render:Z=b5.jsx(C0,{variant:"outline",size:"sm"}),...J}){return b5.jsx(R8.Action,{"data-slot":"toast-action",render:Z,className:s("shrink-0",$),...J})}function Yl({className:$,children:Z,render:J=b5.jsx(C0,{variant:"ghost",size:"icon-sm"}),...Q}){return b5.jsx(R8.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:J,className:s("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...Q,children:Z??b5.jsx(C1,{"aria-hidden":"true",stroke:1.75})})}function Kl({type:$}){let Z=null;if($==="success")Z=b5.jsx(xD,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=b5.jsx(hD,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=b5.jsx(JG,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=b5.jsx(bD,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=b5.jsx(gD,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return b5.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function Wl(){let{toasts:$}=R8.useToastManager();return $.map((Z)=>b5.jsx(Ql,{toast:Z,children:b5.jsxs(Xl,{children:[b5.jsx(Kl,{type:Z.type}),b5.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[b5.jsx(zl,{}),b5.jsx(Gl,{})]}),b5.jsx(Hl,{}),b5.jsx(Yl,{})]})},Z.id))}function vD({children:$,toastManager:Z=l4,...J}){return b5.jsxs($l,{toastManager:Z,...J,children:[$,b5.jsx(Zl,{children:b5.jsx(Jl,{children:b5.jsx(Wl,{})})})]})}var KU0=R8.createToastManager,WU0=R8.useToastManager;var E9={};D4(E9,{createHandle:()=>UO,Viewport:()=>qO,Trigger:()=>aD,Root:()=>cD,Provider:()=>XO,Positioner:()=>eD,Portal:()=>sD,Popup:()=>ZO,Handle:()=>KG,Arrow:()=>QO});var t2=P(v(),1);var fD=P(v(),1);function s2($){let Z=fD.useRef(!0);if(Z.current)Z.current=!1,$()}var QG=P(v(),1),gq=QG.createContext(void 0);function i4($){let Z=QG.useContext(gq);if(Z===void 0&&!$)throw Error(S0(72));return Z}var mD=P(v(),1),pD=P(H4(),1);var Bl={...i2,disabled:k0(($)=>$.disabled),instantType:k0(($)=>$.instantType),isInstantPhase:k0(($)=>$.isInstantPhase),trackCursorAxis:k0(($)=>$.trackCursorAxis),disableHoverablePopup:k0(($)=>$.disableHoverablePopup),lastOpenChangeReason:k0(($)=>$.openChangeReason),closeDelay:k0(($)=>$.closeDelay),hasViewport:k0(($)=>$.hasViewport)};class a7 extends i8{constructor($){super({...ql(),...$},{popupRef:mD.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new a8},Bl)}setOpen=($,Z)=>{let J=Z.reason,Q=J===K0.triggerHover,X=$&&J===K0.triggerFocus,z=!$&&(J===K0.triggerPress||J===K0.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let G=()=>{let H={open:$,openChangeReason:J};if(X)H.instantType="focus";else if(z)H.instantType="dismiss";else if(J===K0.triggerHover)H.instantType=void 0;let Y=Z.trigger?.id??null;if(Y||$)H.activeTriggerId=Y,H.activeTriggerElement=Z.trigger??null;this.update(H)};if(Q)pD.flushSync(G);else G()};static useStore($,Z){let J=S5(()=>{return new a7(Z)}).current,Q=$??J,X=U2({popupStore:Q,onOpenChange:Q.setOpen});return Q.state.floatingRootContext=X,Q}}function ql(){return{...l2(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}var uD=P(c(),1),cD=QJ(function(Z){let{disabled:J=!1,defaultOpen:Q=!1,open:X,disableHoverablePopup:z=!1,trackCursorAxis:G="none",actionsRef:H,onOpenChange:Y,onOpenChangeComplete:K,handle:W,triggerId:B,defaultTriggerId:q=null,children:U}=Z,F=a7.useStore(W?.store,{open:Q,openProp:X,activeTriggerId:q,triggerIdProp:B});s2(()=>{if(X===void 0&&F.state.open===!1&&Q===!0)F.update({open:!0,activeTriggerId:q})}),F.useControlledProp("openProp",X),F.useControlledProp("triggerIdProp",B),F.useContextCallback("onOpenChange",Y),F.useContextCallback("onOpenChangeComplete",K);let N=F.useState("open"),L=!J&&N,V=F.useState("activeTriggerId"),M=F.useState("payload");F.useSyncedValues({trackCursorAxis:G,disableHoverablePopup:z}),B0(()=>{if(N&&J)F.setOpen(!1,D0(K0.disabled))},[N,J,F]),F.useSyncedValue("disabled",J),c2(F);let{forceUnmount:_,transitionStatus:O}=d2(L,F),D=F.useState("isInstantPhase"),A=F.useState("instantType"),C=F.useState("lastOpenChangeReason"),I=t2.useRef(null);B0(()=>{if(O==="ending"&&C===K0.none||O!=="ending"&&D){if(A!=="delay")I.current=A;F.set("instantType","delay")}else if(I.current!==null)F.set("instantType",I.current),I.current=null},[O,D,C,A,F]),B0(()=>{if(L){if(V==null)F.set("payload",void 0)}},[F,V,L]);let y=t2.useCallback(()=>{F.setOpen(!1,Ul(F,K0.imperativeAction))},[F]);t2.useImperativeHandle(H,()=>({unmount:_,close:y}),[_,y]);let E=F.useState("floatingRootContext"),h=q2(E,{enabled:!J,referencePress:!0}),k=_q(E,{enabled:!J&&G!=="none",axis:G==="none"?void 0:G}),{getReferenceProps:S,getFloatingProps:w,getTriggerProps:T}=$8([h,k]),R=t2.useMemo(()=>S(),[S]),b=t2.useMemo(()=>T(),[T]),g=t2.useMemo(()=>w(),[w]);return F.useSyncedValues({activeTriggerProps:R,inactiveTriggerProps:b,popupProps:g}),uD.jsx(gq.Provider,{value:F,children:typeof U==="function"?U({payload:M}):U})});function Ul($,Z){let J=D0(Z);return J.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},J}var rD=P(v(),1);function t0($){return K8($,"base-ui")}var XG=P(v(),1),vq=XG.createContext(void 0);function dD(){return XG.useContext(vq)}var lD=function($){return $[$.popupOpen=_J.popupOpen]="popupOpen",$.triggerDisabled="data-trigger-disabled",$}({});var iD=600;var aD=Hz(function(Z,J){let{className:Q,render:X,handle:z,payload:G,disabled:H,delay:Y,closeDelay:K,id:W,...B}=Z,q=i4(!0),U=z?.store??q;if(!U)throw Error(S0(82));let F=t0(W),N=U.useState("isTriggerActive",F),L=U.useState("isOpenedByTrigger",F),V=U.useState("floatingRootContext"),M=rD.useRef(null),_=Y??iD,O=K??0,{registerTrigger:D,isMountedByThisTrigger:A}=u2(F,M,U,{payload:G,closeDelay:O}),C=dD(),{delayRef:I,isInstantPhase:y,hasProvider:E}=Fq(V,{open:L});U.useSyncedValue("isInstantPhase",y);let h=U.useState("disabled"),k=H??h,S=U.useState("trackCursorAxis"),w=U.useState("disableHoverablePopup"),T=F2(V,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!w&&S!=="both"?N2():null,restMs(){let j=C?.delay,e=typeof I.current==="object"?I.current.open:void 0,t=_;if(E)if(e!==0)t=Y??j??_;else t=0;return t},delay(){let j=typeof I.current==="object"?I.current.close:void 0,e=O;if(K==null&&E)e=j;return{close:e}},triggerElementRef:M,isActiveTrigger:N}),R=P3(V,{enabled:!k}).reference,b={open:L},g=U.useState("triggerProps",A);return W0("button",Z,{state:b,ref:[J,D,M],props:[T,R,g,{id:F,[lD.triggerDisabled]:k?"":void 0},B],stateAttributesMapping:n2})});var oD=P(v(),1);var zG=P(v(),1),fq=zG.createContext(void 0);function nD(){let $=zG.useContext(fq);if($===void 0)throw Error(S0(70));return $}var mq=P(c(),1),sD=oD.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z;if(!(i4().useState("mounted")||Q))return null;return mq.jsx(fq.Provider,{value:Q,children:mq.jsx(i7,{ref:J,...X})})});var o7=P(v(),1);var GG=P(v(),1),pq=GG.createContext(void 0);function n7(){let $=GG.useContext(pq);if($===void 0)throw Error(S0(71));return $}var tD=P(c(),1),eD=o7.forwardRef(function(Z,J){let{render:Q,className:X,anchor:z,positionMethod:G="absolute",side:H="top",align:Y="center",sideOffset:K=0,alignOffset:W=0,collisionBoundary:B="clipping-ancestors",collisionPadding:q=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=o2,...V}=Z,M=i4(),_=nD(),O=M.useState("open"),D=M.useState("mounted"),A=M.useState("trackCursorAxis"),C=M.useState("disableHoverablePopup"),I=M.useState("floatingRootContext"),y=M.useState("instantType"),E=M.useState("transitionStatus"),h=M.useState("hasViewport"),k=a2({anchor:z,positionMethod:G,floatingRootContext:I,mounted:D,side:H,sideOffset:K,align:Y,alignOffset:W,collisionBoundary:B,collisionPadding:q,sticky:F,arrowPadding:U,disableAnchorTracking:N,keepMounted:_,collisionAvoidance:L,adaptiveOrigin:h?r7:void 0}),S=o7.useMemo(()=>{let b={};if(!O||A==="both"||C)b.pointerEvents="none";return{role:"presentation",hidden:!D,style:{...k.positionerStyles,...b}}},[O,A,C,D,k.positionerStyles]),w=o7.useMemo(()=>({open:O,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:A!=="none"?"tracking-cursor":y}),[O,k.side,k.align,k.anchorHidden,A,y]),T=o7.useMemo(()=>({...w,arrowRef:k.arrowRef,arrowStyles:k.arrowStyles,arrowUncentered:k.arrowUncentered}),[w,k.arrowRef,k.arrowStyles,k.arrowUncentered]),R=W0("div",Z,{state:w,props:[S,W8(E),V],ref:[J,M.useStateSetter("positionerElement")],stateAttributesMapping:V5});return tD.jsx(pq.Provider,{value:T,children:R})});var $O=P(v(),1);var Fl={...V5,...p5},ZO=$O.forwardRef(function(Z,J){let{className:Q,render:X,...z}=Z,G=i4(),{side:H,align:Y}=n7(),K=G.useState("open"),W=G.useState("instantType"),B=G.useState("transitionStatus"),q=G.useState("popupProps"),U=G.useState("floatingRootContext");y1({open:K,ref:G.context.popupRef,onComplete(){if(K)G.context.onOpenChangeComplete?.(!0)}});let F=G.useState("disabled"),N=G.useState("closeDelay");return C9(U,{enabled:!F,closeDelay:N}),W0("div",Z,{state:{open:K,side:H,align:Y,instant:W,transitionStatus:B},ref:[J,G.context.popupRef,G.useStateSetter("popupElement")],props:[q,W8(B),z],stateAttributesMapping:Fl})});var JO=P(v(),1);var QO=JO.forwardRef(function(Z,J){let{className:Q,render:X,...z}=Z,H=i4().useState("instantType"),{open:Y,arrowRef:K,side:W,align:B,arrowUncentered:q,arrowStyles:U}=n7();return W0("div",Z,{state:{open:Y,side:W,align:B,uncentered:q,instant:H},ref:[J,K],props:[{style:U,"aria-hidden":!0},z],stateAttributesMapping:V5})});var uq=P(v(),1);var cq=P(c(),1),XO=function(Z){let{delay:J,closeDelay:Q,timeout:X=400}=Z,z=uq.useMemo(()=>({delay:J,closeDelay:Q}),[J,Q]),G=uq.useMemo(()=>({open:J,close:Q}),[J,Q]);return cq.jsx(vq.Provider,{value:z,children:cq.jsx(Uq,{delay:G,timeoutMs:X,children:Z.children})})};var BO=P(v(),1);var zO=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var y8=P(v(),1);var GO=P(v(),1);function HO($){let[Z,J]=GO.useState({current:$,previous:null});if($!==Z.current)J({current:$,previous:Z.current});return Z.previous}var E3=P(v(),1);function lq($){let Z=u7($),J=parseFloat(Z.width)||0,Q=parseFloat(Z.height)||0,X=M1($),z=X?$.offsetWidth:J,G=X?$.offsetHeight:Q;if(dq(J)!==z||dq(Q)!==G)J=z,Q=G;return{width:J,height:Q}}var Nl=typeof ResizeObserver<"u",Vl=()=>!0;function KO($){let{popupElement:Z,positionerElement:J,content:Q,mounted:X,enabled:z=Vl,onMeasureLayout:G,onMeasureLayoutComplete:H,side:Y,direction:K}=$,W=m2(Z,!0,!1),B=G4(),q=E3.useRef(null),U=E3.useRef(null),F=E3.useRef(!0),N=E3.useRef(m5),L=q0(G),V=q0(H),M=E3.useMemo(()=>{let _=Y==="top",O=Y==="left";if(K==="rtl")_=_||Y==="inline-end",O=O||Y==="inline-end";else _=_||Y==="inline-start",O=O||Y==="inline-start";return _?{position:"absolute",[Y==="top"?"bottom":"top"]:"0",[O?"right":"left"]:"0"}:k5},[Y,K]);B0(()=>{if(!X||!z()||!Nl){N.current=m5,F.current=!0,q.current=null,U.current=null;return}if(!Z||!J)return;N.current=YO(Z,M);let _=new ResizeObserver((S)=>{let w=S[0];if(w)U.current={width:Math.ceil(w.borderBoxSize[0].inlineSize),height:Math.ceil(w.borderBoxSize[0].blockSize)}});_.observe(Z),HG(Z,"auto");let O=YG(Z,"position","static"),D=YG(Z,"transform","none"),A=YG(Z,"scale","1"),C=YO(J,{"--available-width":"max-content","--available-height":"max-content"});function I(){O(),D(),C()}function y(){I(),A()}if(L?.(),F.current||q.current===null){OJ(J,"max-content");let S=lq(Z);return q.current=S,OJ(J,S),y(),V?.(null,S),F.current=!1,()=>{_.disconnect(),N.current(),N.current=m5}}HG(Z,"auto"),OJ(J,"max-content");let E=q.current??U.current,h=lq(Z);if(q.current=h,!E)return OJ(J,h),y(),V?.(null,h),()=>{_.disconnect(),B.cancel(),N.current(),N.current=m5};HG(Z,E),y(),V?.(E,h),OJ(J,h);let k=new AbortController;return B.request(()=>{HG(Z,h),W(()=>{Z.style.setProperty("--popup-width","auto"),Z.style.setProperty("--popup-height","auto")},k.signal)}),()=>{_.disconnect(),k.abort(),B.cancel(),N.current(),N.current=m5}},[Q,Z,J,W,B,z,X,L,V,M])}function YG($,Z,J){let Q=$.style.getPropertyValue(Z);return $.style.setProperty(Z,J),()=>{$.style.setProperty(Z,Q)}}function YO($,Z){let J=[];for(let[Q,X]of Object.entries(Z))J.push(YG($,Q,X));return J.length?()=>{J.forEach((Q)=>Q())}:m5}function HG($,Z){let J=Z==="auto"?"auto":`${Z.width}px`,Q=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty("--popup-width",J),$.style.setProperty("--popup-height",Q)}function OJ($,Z){let J=Z==="max-content"?"max-content":`${Z.width}px`,Q=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty("--positioner-width",J),$.style.setProperty("--positioner-height",Q)}var s7=P(c(),1);function t7($){let{store:Z,side:J,cssVars:Q,children:X}=$,z=d4(),G=Z.useState("activeTriggerElement"),H=Z.useState("activeTriggerId"),Y=Z.useState("open"),K=Z.useState("payload"),W=Z.useState("mounted"),B=Z.useState("popupElement"),q=Z.useState("positionerElement"),U=HO(Y?G:null),F=Al(H,K),N=y8.useRef(null),[L,V]=y8.useState(null),[M,_]=y8.useState(null),O=y8.useRef(null),D=y8.useRef(null),A=m2(O,!0,!1),C=G4(),[I,y]=y8.useState(null),[E,h]=y8.useState(!1);B0(()=>{return Z.set("hasViewport",!0),()=>{Z.set("hasViewport",!1)}},[Z]);let k=q0(()=>{O.current?.style.setProperty("animation","none"),O.current?.style.setProperty("transition","none"),D.current?.style.setProperty("display","none")}),S=q0((g)=>{if(O.current?.style.removeProperty("animation"),O.current?.style.removeProperty("transition"),D.current?.style.removeProperty("display"),g)y(g)}),w=y8.useRef(null);B0(()=>{if(G&&U&&G!==U&&w.current!==G&&N.current){V(N.current),h(!0);let g=Ml(U,G);_(g),C.request(()=>{C.request(()=>{h(!1),A(()=>{V(null),y(null),N.current=null})})}),w.current=G}},[G,U,L,A,C]),B0(()=>{let g=O.current;if(!g)return;let u=document.createElement("div");for(let j of Array.from(g.childNodes))u.appendChild(j.cloneNode(!0));N.current=u});let T=L!=null,R;if(!T)R=s7.jsx("div",{"data-current":!0,ref:O,children:X},F);else R=s7.jsxs(y8.Fragment,{children:[s7.jsx("div",{"data-previous":!0,inert:g2(!0),ref:D,style:{[Q.popupWidth]:`${I?.width}px`,[Q.popupHeight]:`${I?.height}px`,position:"absolute"},"data-ending-style":E?void 0:""},"previous"),s7.jsx("div",{"data-current":!0,ref:O,"data-starting-style":E?"":void 0,children:X},F)]});B0(()=>{let g=D.current;if(!g||!L)return;g.replaceChildren(...Array.from(L.childNodes))},[L]),KO({popupElement:B,positionerElement:q,mounted:W,content:K,onMeasureLayout:k,onMeasureLayoutComplete:S,side:J,direction:z});let b={activationDirection:Ll(M),transitioning:T};return{children:R,state:b}}function Ll($){if(!$)return;return`${WO($.horizontal,5,"right","left")} ${WO($.vertical,5,"down","up")}`}function WO($,Z,J,Q){if($>Z)return J;if($<-Z)return Q;return""}function Ml($,Z){let J=$.getBoundingClientRect(),Q=Z.getBoundingClientRect(),X={x:J.left+J.width/2,y:J.top+J.height/2},z={x:Q.left+Q.width/2,y:Q.top+Q.height/2};return{horizontal:z.x-X.x,vertical:z.y-X.y}}function Al($,Z){let[J,Q]=y8.useState(0),X=y8.useRef($),z=y8.useRef(Z),G=y8.useRef(!1);return B0(()=>{let H=X.current,Y=z.current,K=$!==H,W=Z!==Y;if(K)Q((B)=>B+1),G.current=!W;else if(G.current&&W)Q((B)=>B+1),G.current=!1;X.current=$,z.current=Z},[$,Z]),`${$??"current"}-${J}`}var _l={activationDirection:($)=>$?{"data-activation-direction":$}:null},qO=BO.forwardRef(function(Z,J){let{render:Q,className:X,children:z,...G}=Z,H=i4(),Y=n7(),K=H.useState("instantType"),{children:W,state:B}=t7({store:H,side:Y.side,cssVars:zO,children:z}),q={activationDirection:B.activationDirection,transitioning:B.transitioning,instant:K};return W0("div",Z,{state:q,ref:J,props:[G,{children:W}],stateAttributesMapping:_l})});class KG{constructor(){this.store=new a7}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(S0(81,$));this.store.setOpen(!0,D0(K0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,D0(K0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function UO(){return new KG}var S3=P(c(),1);function FO({delay:$=100,...Z}){return S3.jsx(E9.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function A1({...$}){return S3.jsx(E9.Root,{"data-slot":"tooltip",...$})}function _1({...$}){return S3.jsx(E9.Trigger,{"data-slot":"tooltip-trigger",...$})}function D1({className:$,side:Z="top",sideOffset:J=6,align:Q="center",alignOffset:X=0,children:z,...G}){return S3.jsx(E9.Portal,{children:S3.jsx(E9.Positioner,{align:Q,alignOffset:X,side:Z,sideOffset:J,className:"isolate z-50",children:S3.jsx(E9.Popup,{"data-slot":"tooltip-content",className:s("z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...G,children:z})})})}function WG({cooldownMs:$,windowMs:Z,maxPerWindow:J,maxKeys:Q=256,now:X=Date.now}){let z=new Map,G=0,H=0;return{admit(Y){let K=X(),W=z.get(Y);if(W!==void 0&&K-W<$)return"cooldown";if(K-G>=Z)G=K,H=0;if(H>=J)return"window";if(H++,z.set(Y,K),z.size>Q)for(let B of[...z.keys()].slice(0,Math.ceil(Q/2)))z.delete(B);return"ok"}}}var Dl=WG({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function V2($,Z){let J=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(Dl.admit(J)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var Ol=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function NO($){if(!$)return null;let Z=Ol.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var VO=!1;function LO(){if(VO)return;VO=!0;let $=(Z,J,Q)=>{let X=J instanceof Error?J:null,z=X?.stack??"",G=Z??NO(z);if(!G)return;V2(G.workspaceId,{source:"window",kind:G.kind,name:G.name,message:X?.message||Q||String(J),...z?{stack:z}:{}})};window.addEventListener("error",(Z)=>$(NO(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function J6($,Z){return`${$}:${Z}`}function PJ($){return $==="running"}function wJ($,Z,J){return PJ($[J6(Z,J)])}function _O($,Z){let J=`${Z}:`;return Object.entries($).some(([Q,X])=>Q.startsWith(J)&&PJ(X))}function DO($,Z,J){if(!J)return!1;let Q=`${Z}:`,X=J6(Z,J);return Object.entries($).some(([z,G])=>z.startsWith(Q)&&z!==X&&PJ(G))}function o8($,Z){return J6($,Z??"new")}var T5=MO()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,J,Q)=>$((X)=>({activity:{...X.activity,[J6(Z,J)]:Q}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((J)=>[J6(J.workspaceId,J.sessionId),J.activity]))})),setError:(Z,J,Q)=>$((X)=>({errors:{...X.errors,[J6(Z,J)]:Q}})),setPreview:(Z)=>$((J)=>({previews:{...J.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((J)=>{if(!(Z in J.previews))return J;let{[Z]:Q,...X}=J.previews;return{previews:X}}),clearPreviewsForSession:(Z,J)=>$((Q)=>{let X={},z=!1;for(let[G,H]of Object.entries(Q.previews))if(H.workspaceId===Z&&H.sessionId===J)z=!0;else X[G]=H;return z?{previews:X}:Q}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,J)=>$((Q)=>{let X={},z=!1;for(let[G,H]of Object.entries(Q.previews))if(J-H.updatedAt>Z)z=!0;else X[G]=H;return z?{previews:X}:Q}),addAttachments:(Z,J,Q)=>$((X)=>{let z=o8(Z,J);return{attachments:{...X.attachments,[z]:[...X.attachments[z]??[],...Q]}}}),updateAttachment:(Z,J,Q,X)=>$((z)=>{let G=o8(Z,J),H=z.attachments[G];if(!H)return{};let Y=H.find((K)=>K.localId===Q);if(Y?.previewUrl&&"previewUrl"in X&&X.previewUrl!==Y.previewUrl)URL.revokeObjectURL(Y.previewUrl);return{attachments:{...z.attachments,[G]:H.map((K)=>K.localId===Q?{...K,...X}:K)}}}),removeAttachment:(Z,J,Q)=>$((X)=>{let z=o8(Z,J),G=X.attachments[z];if(!G)return{};let H=G.find((Y)=>Y.localId===Q);if(H?.previewUrl)URL.revokeObjectURL(H.previewUrl);return{attachments:{...X.attachments,[z]:G.filter((Y)=>Y.localId!==Q)}}}),clearAttachments:(Z,J)=>$((Q)=>{let X=o8(Z,J);for(let G of Q.attachments[X]??[])if(G.previewUrl)URL.revokeObjectURL(G.previewUrl);let z={...Q.attachments};return delete z[X],{attachments:z}}),renameSession:(Z,J,Q)=>$((X)=>{let z=J6(Z,J),G=J6(Z,Q),H={...X.activity},Y={...X.errors};if(z in H)H[G]=H[z],delete H[z];if(z in Y)Y[G]=Y[z],delete Y[z];let K=X.previews,W=!1;for(let[B,q]of Object.entries(X.previews))if(q.workspaceId===Z&&q.sessionId===J){if(!W)K={...X.previews},W=!0;K[B]={...q,sessionId:Q}}return{activity:H,errors:Y,previews:K}})}));function OO($,Z,J){if(!J)return{root:null,byParent:{}};let Q=null,X={};for(let z of Object.values($)){if(z.workspaceId!==Z||z.sessionId!==J)continue;if(z.parentToolUseId===null){if(!Q||z.updatedAt>Q.updatedAt)Q=z}else{let G=X[z.parentToolUseId];if(!G||z.updatedAt>G.updatedAt)X[z.parentToolUseId]=z}}return{root:Q,byParent:X}}function T4($){return AO(T5,$)}var E0={all:["workspaces"],discover:["workspaces","discover"],setupInfo:["workspaces","setup-info"],preview:($)=>["workspaces","preview",$],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],appletThumbnails:($)=>["workspaces","applet-thumbnails",$],views:($)=>["workspaces","views",$],viewBuilders:($)=>["workspaces","view-builders",$],sessions:($)=>["workspaces","sessions",$],events:($,Z)=>["workspaces","events",$,Z],sessionConfig:($,Z)=>["workspaces","sessionConfig",$,Z],mcp:($)=>["workspaces","mcp",$],agent:($)=>["workspaces","agent",$],skills:($)=>["workspaces","skills",$],env:($)=>["workspaces","env",$]};var jJ=P(v(),1);var k3={all:["app-ui"],selectedSession:($)=>["app-ui","selected-session",$]};function Pl($){return[...k3.selectedSession($),"save"]}function wl($,Z,J){let Q=k3.selectedSession(Z),X=$.getQueryData(Q),z=X?.sessionId??null;if(X&&z===J)return null;return $.setQueryData(Q,{sessionId:J}),{sessionId:J,previousSessionId:z}}function jl($,Z,J,Q){let X=k3.selectedSession(Z),z=$.getQueryData(X);if(J.sessionId!==Q.sessionId&&z?.sessionId!==J.sessionId)return"conflict";if(z?.sessionId!==Q.sessionId&&z?.sessionId!==Q.previousSessionId)return"ignored";return $.setQueryData(X,J),"applied"}function Tl($,Z,J,Q){if(Q)return;$.setQueryData(k3.selectedSession(Z),{sessionId:J})}function PO($,Z,J,Q){$.setQueryData(k3.selectedSession(Z),(X)=>X?.sessionId===J?{sessionId:Q}:X)}function Q6(){let $=n5(),Z=s0(),J=jJ.useMemo(()=>k3.selectedSession($),[$]),Q=jJ.useMemo(()=>Pl($),[$]),X=vB({mutationKey:Q,exact:!0}),z=$1({queryKey:J,queryFn:()=>O5(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),{mutate:G}=Z1({mutationKey:Q,scope:{id:`selected-session:${$}`},mutationFn:(K)=>O5(`/api/workspaces/${$}/selected-session`,a1("PUT",K),"Couldn’t save selected chat"),onSuccess:(K,W)=>{if(jl(Z,$,K,W)!=="conflict")return;l4.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:J})},onError:(K,W)=>{if(Z.getQueryData(J)?.sessionId!==W.sessionId)return;l4.add({title:"Couldn’t save selected chat",type:"error"}),Z.invalidateQueries({queryKey:J})}}),H=jJ.useCallback((K)=>{let W=wl(Z,$,K);if(W)G(W)},[Z,G,$]);return J8((K)=>{if(K.type!=="selected-session:updated"||K.workspaceId!==$)return;Tl(Z,$,K.sessionId,X>0)}),[z.isLoading?void 0:z.data?.sessionId??null,H]}function TJ(){return{turns:[],notices:[]}}function CJ($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let J=$.turns.findIndex((X)=>X.id===Z.turn.id);if(J>=0)return{...$,turns:$.turns.map((X,z)=>z===J?Z.turn:X)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let Q=$.turns.findIndex((X)=>X.seq!==void 0&&X.seq>Z.turn.seq);if(Q<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,Q),Z.turn,...$.turns.slice(Q)]}}case"notice":{if($.notices.some((J)=>J.id===Z.notice.id))return{...$,notices:$.notices.map((J)=>J.id===Z.notice.id?Z.notice:J)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function wO($){return $.reduce(CJ,TJ())}function TO($,Z){let{queryClient:J,sendMessage:Q,onWorkspaceSwitch:X}=Z,z=T5.getState();if($.type==="status_snapshot"){z.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:K,sessionId:W,activity:B}=$;if(z.setActivity(K,W,B),B!=="running")z.clearPreviewsForSession(K,W);return}if($.type==="preview"){let K=$,W=E0.events(K.workspaceId,K.sessionId);if(J?.getQueryData(W)===void 0)return;z.setPreview({workspaceId:K.workspaceId,sessionId:K.sessionId,messageId:K.messageId,parentToolUseId:K.parentToolUseId,blocks:K.blocks});return}if($.type==="session_renamed"){let{workspaceId:K,from:W,to:B}=$,q=E0.sessions(K),F=J?.getQueryData(q)?.find((V)=>V.sessionId===W||V.sessionId===B);if(F)J?.cancelQueries({queryKey:q});if(z.renameSession(K,W,B),J)PO(J,K,W,B);if(F)J?.setQueryData(q,(V)=>[{...F,sessionId:B},...(V??[]).filter((M)=>M.sessionId!==W&&M.sessionId!==B)]);let N=J?.getQueryData(E0.events(K,W));if(N!==void 0)J?.setQueryData(E0.events(K,B),N),J?.removeQueries({queryKey:E0.events(K,W)});let L=J?.getQueryData(E0.sessionConfig(K,W));if(L!==void 0)J?.setQueryData(E0.sessionConfig(K,B),L),J?.removeQueries({queryKey:E0.sessionConfig(K,W)});if(!F)J?.invalidateQueries({queryKey:q});J?.invalidateQueries({queryKey:E0.preview(K)});return}if($.type==="sessions_changed"){let K=$.workspaceId,W=E0.sessions(K);J?.invalidateQueries({queryKey:W}),J?.invalidateQueries({queryKey:E0.preview(K)});return}if($.type==="workspace:switch"){X?.($.workspaceId);return}if($.type==="scratchpad:op"){let K=jO($.workspaceId);if(!K)return;let W=$.opId;K($.op).then((B)=>Q({type:"scratchpad:op-result",opId:W,result:B}),(B)=>Q({type:"scratchpad:op-result",opId:W,error:B instanceof Error?B.message:String(B)}));return}let{workspaceId:G,sessionId:H}=$;if(!G||!H)return;let Y=$.kind;if(Y==="snapshot"||Y==="turn"||Y==="notice"||Y==="result"){if(Cl(J,G,H,$),Y==="turn"){let K=$.turn?.meta?.apiMessageId;if(K)z.clearPreview(K)}if(Y==="result")z.clearPreviewsForSession(G,H)}if(Y==="error"&&typeof $.content==="string")z.setError(G,H,$.content),z.setActivity(G,H,"idle"),z.clearPreviewsForSession(G,H);if(Y==="stopped")z.setActivity(G,H,"idle"),z.clearPreviewsForSession(G,H)}function Cl($,Z,J,Q){let X=E0.events(Z,J),z=$?.getQueryData(X);if(z===void 0)return;$?.setQueryData(X,CJ(z,Q))}var rq=null,e7=null,BG=0,qG=null,iq=[],SO=null,CO=null,El=15000;function kO($){if(rq=$,!CO)CO=setInterval(()=>T5.getState().sweepPreviews(El,Date.now()),5000);if(e7)return;IO()}function IO(){let $=++BG;if(qG)clearTimeout(qG),qG=null;let Z=new WebSocket(EO("/ws"));e7=Z,Z.onopen=()=>{if(BG!==$){Z.close();return}for(let J of iq)Z.send(JSON.stringify(J));iq.length=0,rq?.invalidateQueries({queryKey:["workspaces","events"]}),T5.getState().clearAllPreviews()},Z.onmessage=(J)=>{if(BG!==$)return;let Q;try{Q=JSON.parse(J.data)}catch{return}Sl(Q)},Z.onclose=()=>{if(BG!==$)return;e7=null,qG=setTimeout(IO,1000)},Z.onerror=()=>Z.close()}function Sl($){TO($,{queryClient:rq,sendMessage:UG,onWorkspaceSwitch:SO})}function UG($){if(e7&&e7.readyState===WebSocket.OPEN)e7.send(JSON.stringify($));else iq.push($)}function aq($){SO=$}var DB=P(v(),1);var kl=($)=>RO()(bO((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},viewBuilderDrafts:{},dockedChatWidth:360,setDiscoveredWorkspacesOpen:(J)=>Z({discoveredWorkspacesOpen:J}),markWorkspacePendingAnalysis:(J)=>Z((Q)=>{let X=Q.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:X.includes(J)?X:[...X,J]}}),markMessageSentFromMoi:(J)=>Z((Q)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(Q.workspaceIdsPendingAnalysis??[]).filter((X)=>X!==J)})),setComposerDraft:(J,Q)=>Z((X)=>{let z={...X.composerDrafts??{}};if(Q)z[J]=Q;else delete z[J];return{composerDrafts:z}}),setViewBuilderDraft:(J,Q)=>Z((X)=>{let z=X.viewBuilderDrafts??{};if(Q===null){if(!(J in z))return X;let G={...z};return delete G[J],{viewBuilderDrafts:G}}if(z[J]===Q)return X;return{viewBuilderDrafts:{...z,[J]:Q}}}),setDockedChatWidth:(J)=>Z({dockedChatWidth:J})}),$?{name:"moi:ui",storage:yO(()=>$)}:{name:"moi:ui"})),O1=kl();function xO($,Z){let J=$??[],Q=J.findIndex((X)=>X.id===Z.id||X.path===Z.path);if(Q===-1)return[Z,...J];return J.map((X,z)=>z===Q?{...X,...Z}:X)}function FG(){return $1({queryKey:E0.all,queryFn:()=>O5("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function NG($){return $1({queryKey:E0.preview($),queryFn:()=>O5(`/api/workspaces/${$}/preview`),staleTime:60000})}function hO(){return $1({queryKey:E0.discover,queryFn:()=>O5("/api/workspaces/discover")})}function gO(){let $=s0();return Z1({mutationFn:(Z)=>O5("/api/workspaces",a1("POST",Z),"Failed to add workspace"),onSuccess:(Z,J)=>{O1.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(E0.all,(Q)=>xO(Q,Z)),$.setQueryData(E0.discover,(Q)=>(Q??[]).filter((X)=>X.path!==J.path))}})}function VG(){return $1({queryKey:E0.setupInfo,queryFn:()=>O5("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function vO(){let $=s0();return Z1({mutationFn:(Z)=>O5("/api/workspaces/create",a1("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(E0.all,(J)=>xO(J,Z))}})}function fO(){let $=s0();return Z1({mutationFn:(Z)=>O5("/api/workspaces/order",a1("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:E0.all,exact:!0});let J=$.getQueryData(E0.all);if(J){let Q=new Map(J.map((z)=>[z.id,z])),X=Z.map((z)=>Q.get(z)).filter((z)=>Boolean(z));if(X.length===J.length)$.setQueryData(E0.all,X)}return{previous:J}},onError:(Z,J,Q)=>{if(Q?.previous)$.setQueryData(E0.all,Q.previous);$.invalidateQueries({queryKey:E0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(E0.all,Z)}})}function mO(){let $=s0();return Z1({mutationFn:(Z)=>C4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,J)=>{$.setQueryData(E0.all,(Q)=>(Q??[]).filter((X)=>X.id!==J)),$.invalidateQueries({queryKey:E0.discover})}})}var mJ=P(v(),1);var L2={};D4(L2,{createHandle:()=>VP,Viewport:()=>qP,Trigger:()=>NP,Title:()=>FP,Root:()=>WP,Portal:()=>ZP,Popup:()=>sO,Handle:()=>PG,Description:()=>iO,Close:()=>dO,Backdrop:()=>uO});var pO=P(v(),1);var LG=P(v(),1),nq=LG.createContext(void 0);function B8($){let Z=LG.useContext(nq);if($===!1&&Z===void 0)throw Error(S0(27));return Z}var Il={...V5,...p5},uO=pO.forwardRef(function(Z,J){let{render:Q,className:X,forceRender:z=!1,...G}=Z,{store:H}=B8(),Y=H.useState("open"),K=H.useState("nested"),W=H.useState("mounted"),B=H.useState("transitionStatus");return W0("div",Z,{state:{open:Y,transitionStatus:B},ref:[H.context.backdropRef,J],stateAttributesMapping:Il,props:[{role:"presentation",hidden:!W,style:{userSelect:"none",WebkitUserSelect:"none"}},G],enabled:z||!K})});var cO=P(v(),1);var dO=cO.forwardRef(function(Z,J){let{render:Q,className:X,disabled:z=!1,nativeButton:G=!0,...H}=Z,{store:Y}=B8(),K=Y.useState("open");function W(F){if(K)Y.setOpen(!1,D0(K0.closePress,F.nativeEvent))}let{getButtonProps:B,buttonRef:q}=p1({disabled:z,native:G});return W0("button",Z,{state:{disabled:z},ref:[J,q],props:[{onClick:W},H,B]})});var lO=P(v(),1);var iO=lO.forwardRef(function(Z,J){let{render:Q,className:X,id:z,...G}=Z,{store:H}=B8(),Y=t0(z);return H.useSyncedValueWithCleanup("descriptionElementId",Y),W0("p",Z,{ref:J,props:[{id:Y},G]})});var nO=P(v(),1);var rO=function($){return $.nestedDialogs="--nested-dialogs",$}({});var aO=function($){return $[$.open=j4.open]="open",$[$.closed=j4.closed]="closed",$[$.startingStyle=j4.startingStyle]="startingStyle",$[$.endingStyle=j4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var MG=P(v(),1),oq=MG.createContext(void 0);function AG(){let $=MG.useContext(oq);if($===void 0)throw Error(S0(26));return $}var EJ="ArrowUp",SJ="ArrowDown",kJ="ArrowLeft",IJ="ArrowRight",RJ="Home",yJ="End",Rl=new Set([kJ,IJ]);var yl=new Set([EJ,SJ]);var bl=new Set([...Rl,...yl]),IV0=new Set([...bl,RJ,yJ]),X6=new Set([EJ,SJ,kJ,IJ,RJ,yJ]);var oO=P(c(),1),xl={...V5,...p5,nestedDialogOpen($){return $?{[aO.nestedDialogOpen]:""}:null}},sO=nO.forwardRef(function(Z,J){let{className:Q,finalFocus:X,initialFocus:z,render:G,...H}=Z,{store:Y}=B8(),K=Y.useState("descriptionElementId"),W=Y.useState("disablePointerDismissal"),B=Y.useState("floatingRootContext"),q=Y.useState("popupProps"),U=Y.useState("modal"),F=Y.useState("mounted"),N=Y.useState("nested"),L=Y.useState("nestedOpenDialogCount"),V=Y.useState("open"),M=Y.useState("openMethod"),_=Y.useState("titleElementId"),O=Y.useState("transitionStatus"),D=Y.useState("role");AG(),y1({open:V,ref:Y.context.popupRef,onComplete(){if(V)Y.context.onOpenChangeComplete?.(!0)}});function A(h){if(h==="touch")return Y.context.popupRef.current;return!0}let C=z===void 0?A:z,I=L>0,E=W0("div",Z,{state:{open:V,nested:N,transitionStatus:O,nestedDialogOpen:I},props:[q,{"aria-labelledby":_??void 0,"aria-describedby":K??void 0,role:D,tabIndex:-1,hidden:!F,onKeyDown(h){if(X6.has(h.key))h.stopPropagation()},style:{[rO.nestedDialogs]:L}},H],ref:[J,Y.context.popupRef,Y.useStateSetter("popupElement")],stateAttributesMapping:xl});return oO.jsx(D3,{context:B,openInteractionType:M,disabled:!F,closeOnFocusOut:!W,initialFocus:C,returnFocus:X,modal:U!==!1,restoreFocus:"popup",children:E})});var $P=P(v(),1);var tO=P(v(),1),eO=P(c(),1),$$=tO.forwardRef(function(Z,J){let{cutout:Q,...X}=Z,z;if(Q){let G=Q?.getBoundingClientRect();z=`polygon(
|
|
10
|
+
0% 0%,
|
|
11
|
+
100% 0%,
|
|
12
|
+
100% 100%,
|
|
13
|
+
0% 100%,
|
|
14
|
+
0% 0%,
|
|
15
|
+
${G.left}px ${G.top}px,
|
|
16
|
+
${G.left}px ${G.bottom}px,
|
|
17
|
+
${G.right}px ${G.bottom}px,
|
|
18
|
+
${G.right}px ${G.top}px,
|
|
19
|
+
${G.left}px ${G.top}px
|
|
20
|
+
)`}return eO.jsx("div",{ref:J,role:"presentation","data-base-ui-inert":"",...X,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:z}})});var bJ=P(c(),1),ZP=$P.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:z}=B8(),G=z.useState("mounted"),H=z.useState("modal"),Y=z.useState("open");if(!(G||Q))return null;return bJ.jsx(oq.Provider,{value:Q,children:bJ.jsxs(_3,{ref:J,...X,children:[G&&H===!0&&bJ.jsx($$,{ref:z.context.internalBackdropRef,inert:g2(!Y)}),Z.children]})})});var YP=P(v(),1);var r4=P(v(),1);var JP={},QP={},XP="";function hl($){if(typeof document>"u")return!1;let Z=u0($);return E8(Z).innerWidth-Z.documentElement.clientWidth>0}function gl($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let J=u0($),Q=J.documentElement,X=J.body,z=_G(Q)?Q:X,G=z.style.overflowY,H=Q.style.scrollbarGutter;Q.style.scrollbarGutter="stable",z.style.overflowY="scroll";let Y=z.offsetWidth;z.style.overflowY="hidden";let K=z.offsetWidth;return z.style.overflowY=G,Q.style.scrollbarGutter=H,Y===K}function vl($){let Z=u0($),J=Z.documentElement,Q=Z.body,X=_G(J)?J:Q,z={overflowY:X.style.overflowY,overflowX:X.style.overflowX};return Object.assign(X.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(X.style,z)}}function fl($){let Z=u0($),J=Z.documentElement,Q=Z.body,X=E8(J),z=0,G=0,H=!1,Y=K1.create();if(Nz&&(X.visualViewport?.scale??1)!==1)return()=>{};function K(){let q=X.getComputedStyle(J),U=X.getComputedStyle(Q),L=(q.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";z=J.scrollTop,G=J.scrollLeft,JP={scrollbarGutter:J.style.scrollbarGutter,overflowY:J.style.overflowY,overflowX:J.style.overflowX},XP=J.style.scrollBehavior,QP={position:Q.style.position,height:Q.style.height,width:Q.style.width,boxSizing:Q.style.boxSizing,overflowY:Q.style.overflowY,overflowX:Q.style.overflowX,scrollBehavior:Q.style.scrollBehavior};let V=J.scrollHeight>J.clientHeight,M=J.scrollWidth>J.clientWidth,_=q.overflowY==="scroll"||U.overflowY==="scroll",O=q.overflowX==="scroll"||U.overflowX==="scroll",D=Math.max(0,X.innerWidth-Q.clientWidth),A=Math.max(0,X.innerHeight-Q.clientHeight),C=parseFloat(U.marginTop)+parseFloat(U.marginBottom),I=parseFloat(U.marginLeft)+parseFloat(U.marginRight),y=_G(J)?J:Q;if(H=gl($),H){J.style.scrollbarGutter=L,y.style.overflowY="hidden",y.style.overflowX="hidden";return}if(Object.assign(J.style,{scrollbarGutter:L,overflowY:"hidden",overflowX:"hidden"}),V||_)J.style.overflowY="scroll";if(M||O)J.style.overflowX="scroll";Object.assign(Q.style,{position:"relative",height:C||A?`calc(100dvh - ${C+A}px)`:"100dvh",width:I||D?`calc(100vw - ${I+D}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),Q.scrollTop=z,Q.scrollLeft=G,J.setAttribute("data-base-ui-scroll-locked",""),J.style.scrollBehavior="unset"}function W(){if(Object.assign(J.style,JP),Object.assign(Q.style,QP),!H)J.scrollTop=z,J.scrollLeft=G,J.removeAttribute("data-base-ui-scroll-locked"),J.style.scrollBehavior=XP}function B(){W(),Y.request(K)}return K(),X.addEventListener("resize",B),()=>{if(Y.cancel(),W(),typeof X.removeEventListener==="function")X.removeEventListener("resize",B)}}class zP{lockCount=0;restore=null;timeoutLock=i1.create();timeoutUnlock=i1.create();acquire($){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock($));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock($){if(this.lockCount===0||this.restore!==null)return;let J=u0($).documentElement,Q=E8(J).getComputedStyle(J).overflowY;if(Q==="hidden"||Q==="clip"){this.restore=m5;return}let X=Vz||!hl($);this.restore=X?vl($):fl($)}}var ml=new zP;function Z$($=!0,Z=null){B0(()=>{if(!$)return;return ml.acquire(Z)},[$,Z])}var J$=P(v(),1);var xJ=P(v(),1);function GP($){let Z=xJ.useRef(""),J=xJ.useCallback((X)=>{if(X.defaultPrevented)return;Z.current=X.pointerType,$(X,X.pointerType)},[$]);return{onClick:xJ.useCallback((X)=>{if(X.detail===0){$(X,"keyboard");return}if("pointerType"in X)$(X,X.pointerType);else $(X,Z.current);Z.current=""},[$]),onPointerDown:J}}function Q$($){let[Z,J]=J$.useState(null),Q=q0((H,Y)=>{if(!$)J(Y||(Vz?"touch":""))}),X=J$.useCallback(()=>{J(null)},[]),{onClick:z,onPointerDown:G}=GP(Q);return J$.useMemo(()=>({openMethod:Z,reset:X,triggerProps:{onClick:z,onPointerDown:G}}),[Z,X,z,G])}function HP($){let{store:Z,parentContext:J,actionsRef:Q}=$,X=Z.useState("open"),z=Z.useState("disablePointerDismissal"),G=Z.useState("modal"),H=Z.useState("popupElement"),{openMethod:Y,triggerProps:K,reset:W}=Q$(X);c2(Z);let{forceUnmount:B}=d2(X,Z,()=>{W()}),q=q0((E)=>{let h=D0(E);return h.preventUnmountOnClose=()=>{Z.set("preventUnmountingOnClose",!0)},h}),U=r4.useCallback(()=>{Z.setOpen(!1,q(K0.imperativeAction))},[Z,q]);r4.useImperativeHandle(Q,()=>({unmount:B,close:U}),[B,U]);let F=U2({popupStore:Z,onOpenChange:Z.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[N,L]=r4.useState(0),V=N===0,M=T3(F),_=q2(F,{outsidePressEvent(){if(Z.context.internalBackdropRef.current||Z.context.backdropRef.current)return"intentional";return{mouse:G==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(E){if(!Z.context.outsidePressEnabledRef.current)return!1;if("button"in E&&E.button!==0)return!1;if("touches"in E&&E.touches.length!==1)return!1;let h=y5(E);if(V&&!z){let k=h;if(G)return Z.context.internalBackdropRef.current||Z.context.backdropRef.current?Z.context.internalBackdropRef.current===k||Z.context.backdropRef.current===k||p0(k,H)&&!k?.hasAttribute("data-base-ui-portal"):!0;return!0}return!1},escapeKey:V});Z$(X&&G===!0,H);let{getReferenceProps:O,getFloatingProps:D,getTriggerProps:A}=$8([M,_]);Z.useContextCallback("onNestedDialogOpen",(E)=>{L(E+1)}),Z.useContextCallback("onNestedDialogClose",()=>{L(0)}),r4.useEffect(()=>{if(J?.onNestedDialogOpen&&X)J.onNestedDialogOpen(N);if(J?.onNestedDialogClose&&!X)J.onNestedDialogClose();return()=>{if(J?.onNestedDialogClose&&X)J.onNestedDialogClose()}},[X,J,N]);let C=r4.useMemo(()=>O(K),[O,K]),I=r4.useMemo(()=>A(K),[A,K]),y=r4.useMemo(()=>D(),[D]);Z.useSyncedValues({openMethod:Y,activeTriggerProps:C,inactiveTriggerProps:I,popupProps:y,floatingRootContext:F,nestedOpenDialogCount:N})}var DG=P(v(),1);var pl={...i2,modal:k0(($)=>$.modal),nested:k0(($)=>$.nested),nestedOpenDialogCount:k0(($)=>$.nestedOpenDialogCount),disablePointerDismissal:k0(($)=>$.disablePointerDismissal),openMethod:k0(($)=>$.openMethod),descriptionElementId:k0(($)=>$.descriptionElementId),titleElementId:k0(($)=>$.titleElementId),viewportElement:k0(($)=>$.viewportElement),role:k0(($)=>$.role)};class hJ extends i8{constructor($){super(ul($),{popupRef:DG.createRef(),backdropRef:DG.createRef(),internalBackdropRef:DG.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new a8,onOpenChange:void 0,onOpenChangeComplete:void 0},pl)}setOpen=($,Z)=>{if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!$&&Z.trigger==null&&this.state.activeTriggerId!=null)Z.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;let J={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",J);let Q={open:$},X=Z.trigger?.id??null;if(X||$)Q.activeTriggerId=X,Q.activeTriggerElement=Z.trigger??null;this.update(Q)}}function ul($={}){return{...l2(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...$}}var KP=P(c(),1);function WP($){let{children:Z,open:J,defaultOpen:Q=!1,onOpenChange:X,onOpenChangeComplete:z,disablePointerDismissal:G=!1,modal:H=!0,actionsRef:Y,handle:K,triggerId:W,defaultTriggerId:B=null}=$,q=B8(!0),U=Boolean(q),F=S5(()=>{return K?.store??new hJ({open:Q,openProp:J,activeTriggerId:B,triggerIdProp:W,modal:H,disablePointerDismissal:G,nested:U})}).current;s2(()=>{if(J===void 0&&F.state.open===!1&&Q===!0)F.update({open:!0,activeTriggerId:B})}),F.useControlledProp("openProp",J),F.useControlledProp("triggerIdProp",W),F.useSyncedValues({disablePointerDismissal:G,nested:U,modal:H}),F.useContextCallback("onOpenChange",X),F.useContextCallback("onOpenChangeComplete",z);let N=F.useState("payload");HP({store:F,actionsRef:Y,parentContext:q?.store.context,onOpenChange:X,triggerIdProp:W});let L=YP.useMemo(()=>({store:F}),[F]);return KP.jsx(nq.Provider,{value:L,children:typeof Z==="function"?Z({payload:N}):Z})}var BP=P(v(),1);var sq=function($){return $[$.open=j4.open]="open",$[$.closed=j4.closed]="closed",$[$.startingStyle=j4.startingStyle]="startingStyle",$[$.endingStyle=j4.endingStyle]="endingStyle",$.nested="data-nested",$.nestedDialogOpen="data-nested-dialog-open",$}({});var cl={...V5,...p5,nested($){return $?{[sq.nested]:""}:null},nestedDialogOpen($){return $?{[sq.nestedDialogOpen]:""}:null}},qP=BP.forwardRef(function(Z,J){let{className:Q,render:X,children:z,...G}=Z,H=AG(),{store:Y}=B8(),K=Y.useState("open"),W=Y.useState("nested"),B=Y.useState("transitionStatus"),q=Y.useState("nestedOpenDialogCount"),U=Y.useState("mounted"),F=q>0;return W0("div",Z,{enabled:H||U,state:{open:K,nested:W,transitionStatus:B,nestedDialogOpen:F},ref:[J,Y.useStateSetter("viewportElement")],stateAttributesMapping:cl,props:[{role:"presentation",hidden:!U,style:{pointerEvents:!K?"none":void 0},children:z},G]})});var UP=P(v(),1);var FP=UP.forwardRef(function(Z,J){let{render:Q,className:X,id:z,...G}=Z,{store:H}=B8(),Y=t0(z);return H.useSyncedValueWithCleanup("titleElementId",Y),W0("h2",Z,{ref:J,props:[{id:Y},G]})});var OG=P(v(),1);var NP=OG.forwardRef(function(Z,J){let{render:Q,className:X,disabled:z=!1,nativeButton:G=!0,id:H,payload:Y,handle:K,...W}=Z,B=B8(!0),q=K?.store??B?.store;if(!q)throw Error(S0(79));let U=t0(H),F=q.useState("floatingRootContext"),N=q.useState("isOpenedByTrigger",U),L=OG.useRef(null),{registerTrigger:V,isMountedByThisTrigger:M}=u2(U,L,q,{payload:Y}),{getButtonProps:_,buttonRef:O}=p1({disabled:z,native:G}),D=T9(F,{enabled:F!=null}),A=$8([D]),C={disabled:z,open:N},I=q.useState("triggerProps",M);return W0("button",Z,{state:C,ref:[O,J,V,L],props:[A.getReferenceProps(),I,{[c7]:"",id:U},W,_],stateAttributesMapping:n2})});class PG{constructor($){this.store=$??new hJ}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;this.store.setOpen(!0,D0(K0.imperativeAction,void 0,Z))}openWithPayload($){this.store.set("payload",$),this.store.setOpen(!0,D0(K0.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,D0(K0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function VP(){return new PG}var e2=P(c(),1);function z6({...$}){return e2.jsx(L2.Root,{"data-slot":"dialog",...$})}function wG({...$}){return e2.jsx(L2.Trigger,{"data-slot":"dialog-trigger",...$})}function X$({...$}){return e2.jsx(L2.Close,{"data-slot":"dialog-close",...$})}function z$({className:$,children:Z,...J}){return e2.jsxs(L2.Portal,{children:[e2.jsx(L2.Backdrop,{"data-slot":"dialog-backdrop",className:"fixed inset-0 z-50 bg-foreground/40 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),e2.jsx(L2.Popup,{"data-slot":"dialog-content",className:s("fixed top-1/2 left-1/2 z-50 origin-center -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-xl bg-card text-card-foreground shadow-xl outline-hidden duration-150 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...J,children:Z})]})}function G6({className:$,...Z}){return e2.jsx(L2.Title,{"data-slot":"dialog-title",className:s("text-lg font-semibold",$),...Z})}function G$({className:$,...Z}){return e2.jsx(L2.Description,{"data-slot":"dialog-description",className:s("text-sm text-muted-foreground",$),...Z})}var RP=P(v(),1);var xG={};D4(xG,{Validity:()=>EP,Root:()=>_P,Label:()=>DP,Item:()=>IP,Error:()=>OP,Description:()=>wP,Control:()=>TP});var U8=P(v(),1);var jG=P(v(),1);var tq=function($){return $.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var I3={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},b8={valid($){if($===null)return null;if($)return{[tq.valid]:""};return{[tq.invalid]:""}}};var eq=jG.createContext({invalid:void 0,name:void 0,validityData:{state:I3,errors:[],error:"",value:"",initialValue:null},setValidityData:m5,disabled:void 0,touched:!1,setTouched:m5,dirty:!1,setDirty:m5,filled:!1,setFilled:m5,focused:!1,setFocused:m5,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:($=k5)=>$,getInputValidationProps:($=k5)=>$,inputRef:{current:null},commit:async()=>{}}});function b1($=!0){let Z=jG.useContext(eq);if(Z.setValidityData===m5&&!$)throw Error(S0(28));return Z}var TG=P(v(),1),dl=TG.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function LP($=!1){let Z=TG.useContext(dl);if(!Z&&!$)throw Error(S0(86));return Z}var CG=P(v(),1);var ll=CG.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:m5,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function a4(){return CG.useContext(ll)}var H6=P(v(),1);var EG=P(v(),1);var $U=EG.createContext({controlId:void 0,registerControlId:m5,labelId:void 0,setLabelId:m5,messageIds:[],setMessageIds:m5,getDescriptionProps:($)=>$});function q8(){return EG.useContext($U)}var MP=P(c(),1),SG=function(Z){let J=t0(),[Q,X]=H6.useState(Z.initialControlId===void 0?J:Z.initialControlId),[z,G]=H6.useState(void 0),[H,Y]=H6.useState([]),K=S5(()=>new Map),{messageIds:W}=q8(),B=q0((F,N)=>{let L=K.current;if(N===void 0){L.delete(F);return}L.set(F,N),X((V)=>{if(L.size===0)return;let M;for(let _ of L.values()){if(V!==void 0&&_===V)return V;if(M===void 0)M=_}return M})}),q=H6.useCallback((F)=>{return K4({"aria-describedby":W.concat(H).join(" ")||void 0},F)},[W,H]),U=H6.useMemo(()=>({controlId:Q,registerControlId:B,labelId:z,setLabelId:G,messageIds:H,setMessageIds:Y,getDescriptionProps:q}),[Q,B,z,G,H,Y,q]);return MP.jsx($U.Provider,{value:U,children:Z.children})};var y3=P(v(),1);function R3($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var kG=Object.keys(I3);function il($){if(!$||$.valid||!$.valueMissing)return!1;let Z=!1;for(let J of kG){if(J==="valid")continue;if(J==="valueMissing")Z=$[J];if($[J])Z=!1}return Z}function AP($){let{formRef:Z,clearErrors:J}=a4(),{setValidityData:Q,validate:X,validityData:z,validationDebounceTime:G,invalid:H,markedDirtyRef:Y,state:K,name:W,shouldValidateOnChange:B}=$,{controlId:q,getDescriptionProps:U}=q8(),F=L1(),N=y3.useRef(null),L=q0(async(_,O=!1)=>{let D=N.current;if(!D)return;if(O){if(K.valid!==!1)return;let S=D.validity;if(!S.valueMissing){let T={value:_,state:{...I3,valid:!0},error:"",errors:[],initialValue:z.initialValue};if(D.setCustomValidity(""),q){let R=Z.current.fields.get(q);if(R)Z.current.fields.set(q,{...R,...R3(T,!1)})}Q(T);return}let w=kG.reduce((T,R)=>{return T[R]=S[R],T},{});if(!w.valid&&!il(w))return}function A(S){let w=kG.reduce((R,b)=>{return R[b]=S.validity[b],R},{}),T=!1;for(let R of kG){if(R==="valid")continue;if(R==="valueMissing"&&w[R])T=!0;else if(w[R])return w}if(T&&!Y.current)w.valid=!0,w.valueMissing=!1;return w}F.clear();let C=null,I=[],y=A(D),E,h=B();if(D.validationMessage&&!h)E=D.validationMessage,I=[D.validationMessage];else{let S=Array.from(Z.current.fields.values()).reduce((T,R)=>{if(R.name)T[R.name]=R.getValue();return T},{}),w=X(_,S);if(typeof w==="object"&&w!==null&&"then"in w)C=await w;else C=w;if(C!==null){if(y.valid=!1,y.customError=!0,Array.isArray(C))I=C,D.setCustomValidity(C.join(`
|
|
21
|
+
`));else if(C)I=[C],D.setCustomValidity(C)}else if(h){if(D.setCustomValidity(""),y.customError=!1,D.validationMessage)E=D.validationMessage,I=[D.validationMessage];else if(D.validity.valid&&!y.valid)y.valid=!0}}let k={value:_,state:y,error:E??(Array.isArray(C)?C[0]:C??""),errors:I,initialValue:z.initialValue};if(q){let S=Z.current.fields.get(q);if(S)Z.current.fields.set(q,{...S,...R3(k,H)})}Q(k)}),V=y3.useCallback((_={})=>K4(U,K.valid===!1?{"aria-invalid":!0}:k5,_),[U,K.valid]),M=y3.useCallback((_={})=>K4({onChange(O){if(O.nativeEvent.defaultPrevented)return;if(J(W),!B()){L(O.currentTarget.value,!0);return}if(H)return;let D=O.currentTarget;if(D.value===""){L(D.value);return}if(F.clear(),G)F.start(G,()=>{L(D.value)});else L(D.value)}},V(_)),[V,J,W,F,L,H,G,B]);return y3.useMemo(()=>({getValidationProps:V,getInputValidationProps:M,inputRef:N,commit:L}),[V,M,L])}var IG=P(c(),1),rl=U8.forwardRef(function(Z,J){let{errors:Q,validationMode:X,submitAttemptedRef:z}=a4(),{render:G,className:H,validate:Y,validationDebounceTime:K=0,validationMode:W=X,name:B,disabled:q=!1,invalid:U,dirty:F,touched:N,actionsRef:L,...V}=Z,{disabled:M}=LP(),_=q0(Y||(()=>null)),O=M||q,[D,A]=U8.useState(!1),[C,I]=U8.useState(!1),[y,E]=U8.useState(!1),[h,k]=U8.useState(!1),S=F??C,w=N??D,T=U8.useRef(!1),R=q0((U0)=>{if(F!==void 0)return;if(U0)T.current=!0;I(U0)}),b=q0((U0)=>{if(N!==void 0)return;A(U0)}),g=q0(()=>W==="onChange"||W==="onSubmit"&&z.current),u=Boolean(U||B&&{}.hasOwnProperty.call(Q,B)&&Q[B]!==void 0),[j,e]=U8.useState({state:I3,error:"",errors:[],value:null,initialValue:null}),t=!u&&j.state.valid,x=U8.useMemo(()=>({disabled:O,touched:w,dirty:S,valid:t,filled:y,focused:h}),[O,w,S,t,y,h]),$0=AP({setValidityData:e,validate:_,validityData:j,validationDebounceTime:K,invalid:u,markedDirtyRef:T,state:x,name:B,shouldValidateOnChange:g}),M0=U8.useCallback(()=>{T.current=!0,$0.commit(j.value)},[$0,j]);U8.useImperativeHandle(L,()=>({validate:M0}),[M0]);let l=U8.useMemo(()=>({invalid:u,name:B,validityData:j,setValidityData:e,disabled:O,touched:w,setTouched:b,dirty:S,setDirty:R,filled:y,setFilled:E,focused:h,setFocused:k,validate:_,validationMode:W,validationDebounceTime:K,shouldValidateOnChange:g,state:x,markedDirtyRef:T,validation:$0}),[u,B,j,O,w,b,S,R,y,E,h,k,_,W,K,g,x,$0]),H0=W0("div",Z,{ref:J,state:x,props:V,stateAttributesMapping:b8});return IG.jsx(eq.Provider,{value:l,children:H0})}),_P=U8.forwardRef(function(Z,J){return IG.jsx(SG,{children:IG.jsx(rl,{...Z,ref:J})})});var gJ=P(v(),1);var DP=gJ.forwardRef(function(Z,J){let{render:Q,className:X,id:z,nativeLabel:G=!0,...H}=Z,Y=b1(!1),{controlId:K,setLabelId:W,labelId:B}=q8(),q=t0(z),U=gJ.useRef(null),F=q0((L)=>{if(y5(L.nativeEvent)?.closest("button,input,select,textarea"))return;if(!L.defaultPrevented&&L.detail>1)L.preventDefault();if(G||!K)return;let M=u0(L.currentTarget).getElementById(K);if(M1(M))M.focus({focusVisible:!0})});return B0(()=>{if(q)W(q);return()=>{W(void 0)}},[q,W]),W0("label",Z,{ref:[J,U],state:Y.state,props:[{id:B},G?{htmlFor:K??void 0,onMouseDown:F}:{onClick:F,onPointerDown(L){L.preventDefault()}},H],stateAttributesMapping:b8})});var b3=P(v(),1);var ZU=P(c(),1),al={...b8,...p5},OP=b3.forwardRef(function(Z,J){let{render:Q,id:X,className:z,match:G,...H}=Z,Y=t0(X),{validityData:K,state:W,name:B}=b1(!1),{setMessageIds:q}=q8(),{errors:U}=a4(),F=B?U[B]:null,N=!1;if(F||G===!0)N=!0;else if(G)N=Boolean(K.state[G]);else N=K.state.valid===!1;let{mounted:L,transitionStatus:V,setMounted:M}=c4(N);B0(()=>{if(!N||!Y)return;return q((k)=>k.concat(Y)),()=>{q((k)=>k.filter((S)=>S!==Y))}},[N,Y,q]);let _=b3.useRef(null),[O,D]=b3.useState(null),[A,C]=b3.useState(null),I=F||(K.errors.length>1?ZU.jsx("ul",{children:K.errors.map((k)=>ZU.jsx("li",{children:k},k))}):K.error),y=K.error;if(F!=null)y=Array.isArray(F)?JSON.stringify(F):F;else if(K.errors.length>1)y=JSON.stringify(K.errors);if(N&&y!==A)C(y),D(I);y1({open:N,ref:_,onComplete(){if(!N)M(!1)}});let E={...W,transitionStatus:V},h=W0("div",Z,{ref:[J,_],state:E,props:[{id:Y,children:N?I:O},H],stateAttributesMapping:al,enabled:L});if(!L)return null;return h});var PP=P(v(),1);var wP=PP.forwardRef(function(Z,J){let{render:Q,id:X,className:z,...G}=Z,H=t0(X),Y=b1(!1),{setMessageIds:K}=q8();return B0(()=>{if(!H)return;return K((B)=>B.concat(H)),()=>{K((B)=>B.filter((q)=>q!==H))}},[H,K]),W0("p",Z,{ref:J,state:Y.state,props:[{id:H},G],stateAttributesMapping:b8})});var RG=P(v(),1);var x3=P(v(),1);function n4({controlled:$,default:Z,name:J,state:Q="value"}){let{current:X}=x3.useRef($!==void 0),[z,G]=x3.useState(Z),H=X?$:z,Y=x3.useCallback((K)=>{if(!X)G(K)},[]);return[H,Y]}var vJ=P(v(),1);function H$($={}){let{id:Z,implicit:J=!1,controlRef:Q}=$,{controlId:X,registerControlId:z}=q8(),G=t0(Z),H=J?X:void 0,Y=S5(()=>Symbol("labelable-control")),K=vJ.useRef(!1),W=vJ.useRef(Z!=null),B=q0(()=>{if(!K.current||z===m5)return;K.current=!1,z(Y.current,void 0)});return B0(()=>{if(z===m5)return;let q;if(J){let U=Q?.current;if(D5(U)&&U.closest("label")!=null)q=Z??null;else q=H??G}else if(Z!=null)W.current=!0,q=Z;else if(W.current)q=G;else{B();return}if(q===void 0){B();return}K.current=!0,z(Y.current,q);return},[Z,Q,H,z,J,G,Y,B]),vJ.useEffect(()=>{return B},[B]),X??G}var jP=P(H4(),1);function Y$($){let{enabled:Z=!0,value:J,id:Q,name:X,controlRef:z,commit:G}=$,{formRef:H}=a4(),{invalid:Y,markedDirtyRef:K,validityData:W,setValidityData:B}=b1(),q=q0($.getValue);B0(()=>{if(!Z)return;let U=J;if(U===void 0)U=q();if(W.initialValue===null&&U!==null)B((F)=>({...F,initialValue:U}))},[Z,B,J,W.initialValue,q]),B0(()=>{if(!Z||!Q)return;H.current.fields.set(Q,{getValue:q,name:X,controlRef:z,validityData:R3(W,Y),validate(U=!0){let F=J;if(F===void 0)F=q();if(K.current=!0,!U)G(F);else jP.flushSync(()=>G(F))}})},[G,z,Z,H,q,Q,Y,K,X,W,J]),B0(()=>{let U=H.current.fields;return()=>{if(Q)U.delete(Q)}},[H,Q])}var TP=RG.forwardRef(function(Z,J){let{render:Q,className:X,id:z,name:G,value:H,disabled:Y=!1,onValueChange:K,defaultValue:W,autoFocus:B=!1,...q}=Z,{state:U,name:F,disabled:N,setTouched:L,setDirty:V,validityData:M,setFocused:_,setFilled:O,validationMode:D,validation:A}=b1(),C=N||Y,I=F??G,y={...U,disabled:C},{labelId:E}=q8(),h=H$({id:z});B0(()=>{let b=H!=null;if(A.inputRef.current?.value||b&&H!=="")O(!0);else if(b&&H==="")O(!1)},[A.inputRef,O,H]);let k=RG.useRef(null);B0(()=>{if(B&&k.current===a5(u0(k.current)))_(!0)},[B,_]);let[S]=n4({controlled:H,default:W,name:"FieldControl",state:"value"}),w=H!==void 0,T=w?S:void 0;return Y$({id:h,name:I,commit:A.commit,value:T,getValue:()=>A.inputRef.current?.value,controlRef:A.inputRef}),W0("input",Z,{ref:[J,k],state:y,props:[{id:h,disabled:C,name:I,ref:A.inputRef,"aria-labelledby":E,autoFocus:B,...w?{value:T}:{defaultValue:W},onChange(b){let g=b.currentTarget.value;K?.(g,D0(K0.none,b.nativeEvent)),V(g!==M.initialValue),O(g!=="")},onFocus(){_(!0)},onBlur(b){if(L(!0),_(!1),D==="onBlur")A.commit(b.currentTarget.value)},onKeyDown(b){if(b.currentTarget.tagName==="INPUT"&&b.key==="Enter")L(!0),A.commit(b.currentTarget.value)}},A.getInputValidationProps(),q],stateAttributesMapping:b8})});var fJ=P(v(),1);var CP=P(c(),1),EP=function(Z){let{children:J}=Z,{validityData:Q,invalid:X}=b1(!1),z=fJ.useMemo(()=>R3(Q,X),[Q,X]),G=z.state.valid===!1,{transitionStatus:H}=c4(G),Y=fJ.useMemo(()=>{return{...z,validity:z.state,transitionStatus:H}},[z,H]);return CP.jsx(fJ.Fragment,{children:J(Y)})};var bG=P(v(),1);var JU=P(v(),1),SP=JU.createContext({disabled:!1});var yG=P(v(),1),nl=yG.createContext(void 0);function kP($=!0){let Z=yG.useContext(nl);if(Z===void 0&&!$)throw Error(S0(3));return Z}var QU=P(c(),1),IP=bG.forwardRef(function(Z,J){let{render:Q,className:X,disabled:z=!1,...G}=Z,{state:H,disabled:Y}=b1(!1),K=Y||z,W=kP(),B=W?.parent.id,U=W?.allValues!==void 0?B:void 0,F=bG.useMemo(()=>({disabled:K}),[K]),N=W0("div",Z,{ref:J,state:H,props:G,stateAttributesMapping:b8});return QU.jsx(SG,{initialControlId:U,children:QU.jsx(SP.Provider,{value:F,children:N})})});var yP=P(c(),1),XU=RP.forwardRef(function(Z,J){return yP.jsx(xG.Control,{ref:J,...Z})});var bP=P(c(),1);function Y6({className:$,type:Z,...J}){return bP.jsx(XU,{type:Z,"data-slot":"input",className:s("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",$),...J})}function xP($){if(!$)return"Folder name is required";if($.length>64)return"Folder name is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9._ -]*$/.test($))return"Use letters, numbers, dots, dashes, underscores and spaces, starting with a letter or number";if($.endsWith(".")||$.endsWith(" "))return"Folder name cannot end with a dot or space";return null}var K$=["claude-code","codex","openclaw","hermes"];var uG=P(v(),1);var hG="/claude-z2xnay0d.svg";var gG="/hermes-pznd63x9.png";var vG="/openai-ep9ht2pq.svg";var fG="/openclaw-a2pyfhpn.svg";var g0=P(c(),1),vP="Set up the moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function cG({trigger:$,open:Z,onOpenChange:J}){return g0.jsxs(z6,{open:Z,onOpenChange:J,children:[$&&g0.jsx(wG,{render:$}),g0.jsx(Qi,{})]})}function $i(){return g0.jsxs("div",{className:"relative h-44 overflow-hidden rounded-lg bg-[#e6dcc4] bg-[image:radial-gradient(75%_110%_at_0%_0%,#e0742f_0%,rgba(224,116,47,0)_48%),radial-gradient(110%_160%_at_100%_0%,#16352a_0%,rgba(22,53,42,0)_60%),radial-gradient(70%_90%_at_90%_100%,#8fb492_0%,rgba(143,180,146,0)_55%),radial-gradient(60%_80%_at_8%_100%,#dcc294_0%,rgba(220,194,148,0)_52%)]",children:[g0.jsx(Zi,{className:"absolute top-9 left-1/2 w-52 -translate-x-1/2 -rotate-6 drop-shadow-xl"}),g0.jsxs("svg",{className:"absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[g0.jsx("filter",{id:"floppy-grain",children:g0.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),g0.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]})]})}function Zi({className:$}){return g0.jsxs("svg",{viewBox:"0 0 200 200","aria-hidden":"true",className:$,children:[g0.jsx("defs",{children:g0.jsxs("linearGradient",{id:"floppy-shutter",x1:"0",y1:"0",x2:"0",y2:"1",children:[g0.jsx("stop",{offset:"0",stopColor:"#e3e3e1"}),g0.jsx("stop",{offset:"0.5",stopColor:"#c8c8c6"}),g0.jsx("stop",{offset:"1",stopColor:"#aeaeac"})]})}),g0.jsx("path",{d:"M14 2h146l26 26v160a10 10 0 0 1-10 10H14A10 10 0 0 1 4 188V12A10 10 0 0 1 14 2Z",fill:"#1a1b1d"}),g0.jsx("path",{d:"M14 2h146l26 26v160a10 10 0 0 1-10 10H14A10 10 0 0 1 4 188V12A10 10 0 0 1 14 2Z",fill:"none",stroke:"#ffffff",strokeOpacity:"0.08",strokeWidth:"1.5"}),g0.jsx("path",{d:"M64 2h96v66a6 6 0 0 1-6 6H70a6 6 0 0 1-6-6V2Z",fill:"url(#floppy-shutter)"}),g0.jsx("rect",{x:"116",y:"12",width:"28",height:"52",rx:"3",fill:"#191a1c"}),g0.jsx("path",{d:"M26 30 34 16l8 14h-5v14h-6V30Z",fill:"#0e0f10"}),g0.jsx("rect",{x:"22",y:"92",width:"156",height:"106",rx:"8",fill:"#202124",stroke:"#ffffff",strokeOpacity:"0.05"}),g0.jsx("rect",{x:"14",y:"168",width:"13",height:"13",rx:"2",fill:"#0c0d0e"}),g0.jsx("rect",{x:"172",y:"168",width:"13",height:"13",rx:"2",fill:"#0c0d0e"}),g0.jsx("rect",{x:"175",y:"171",width:"7",height:"7",rx:"1",fill:"#e6e6e4"})]})}function Ji(){let[$,Z]=uG.useState(!1);return uG.useEffect(()=>{if(!$)return;let Q=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(Q)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText(vP).then(()=>Z(!0)).catch(()=>{})}}}function Qi(){let{demoInstallUrl:$}=W$(),{copied:Z,copy:J}=Ji();return g0.jsxs(z$,{className:"w-[calc(100%-2rem)] max-w-md",children:[g0.jsx("div",{className:"p-2",children:g0.jsx($i,{})}),g0.jsx(X$,{render:g0.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"absolute top-4 right-4 text-white hover:bg-white/20 hover:text-white",children:g0.jsx(C1,{stroke:1.75})})}),g0.jsxs("div",{className:"flex flex-col gap-5 p-6 pt-3",children:[g0.jsxs("div",{className:"flex flex-col gap-0.5",children:[g0.jsx(G6,{children:"Use moi with your projects"}),g0.jsx(G$,{children:"This demo comes with sample workspaces. Connect moi to your agent to unlock all features."})]}),g0.jsxs("ul",{className:"flex flex-col gap-3",children:[g0.jsxs("li",{className:"flex items-center gap-3",children:[g0.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:g0.jsx(gP,{size:20,stroke:1.5})}),g0.jsx("span",{className:"text-sm text-foreground",children:"Connect your own data and import existing projects"})]}),g0.jsxs("li",{className:"flex items-center gap-3",children:[g0.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:g0.jsx(pG,{size:20,stroke:1.5})}),g0.jsxs("span",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-sm text-foreground",children:[g0.jsx("span",{children:"Works with"}),g0.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[g0.jsx("img",{src:hG,alt:"",className:"size-4 object-contain"}),"Claude Code,"]}),g0.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[g0.jsx("img",{src:vG,alt:"",className:"size-4 object-contain"}),"Codex,"]}),g0.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[g0.jsx("img",{src:gG,alt:"",className:"size-4 object-contain"}),"Hermes,"]}),g0.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[g0.jsx("img",{src:fG,alt:"",className:"size-4 object-contain"}),"OpenClaw,"]}),g0.jsx("span",{children:"and more."})]})]})]}),g0.jsxs("div",{className:"flex flex-col gap-2",children:[g0.jsx("p",{className:"text-sm text-muted-foreground",children:"Paste this prompt into your agent:"}),g0.jsxs("div",{className:"rounded-lg bg-muted p-3",children:[g0.jsx("code",{className:"block font-mono text-sm leading-relaxed text-foreground",children:vP}),g0.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-2",children:[g0.jsxs(C0,{type:"button",onClick:J,children:[Z?g0.jsx(K6,{"data-icon":"inline-start",stroke:1.5}):g0.jsx(mG,{"data-icon":"inline-start",stroke:1.5}),Z?"Copied":"Copy installation prompt"]}),g0.jsxs(C0,{variant:"secondary",nativeButton:!1,render:g0.jsx("a",{href:$,target:"_blank",rel:"noreferrer"}),children:["Learn more",g0.jsx(hP,{"data-icon":"inline-end",stroke:1.5})]})]})]})]})]})]})}var mP=P(v(),1);var zU=P(c(),1),M2={"claude-code":hG,openclaw:fG,codex:vG,hermes:gG},GU={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex",hermes:"Hermes"};function fP({types:$}){let Z=$.map((J)=>GU[J]).join(", ");return zU.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((J)=>zU.jsx("img",{src:M2[J],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},J))})}function h3($){if("types"in $)return $.path.split("/").pop()||$.path;if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";if($.type==="hermes")return $.agentId??"Hermes agent";return $.path.split("/").pop()||$.path}var B1=P(c(),1),Xi="Choose which agent moi will use to build your workspace",zi={openclaw:`Initialize OpenClaw in the folder
|
|
22
|
+
manually, then import it to moi`,hermes:`Create a Hermes profile with
|
|
23
|
+
hermes profile create, then import it`},Gi={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function Hi({availability:$,detectedTypes:Z=[]}){return K$.map((J)=>{let Q=$?.[J],X=Q?.available===!1?Q.reason:void 0,z=!Z.includes(J)?zi[J]:void 0,G=X??z;return{type:J,description:Gi[J],disabled:Boolean(G),...G?{disabledReason:G}:{}}})}function Yi($,Z){let J=$.find((Q)=>Q.type===Z);if(J&&!J.disabled)return J.type;return $.find((Q)=>!Q.disabled)?.type}function lG({title:$,selectedType:Z,detectedTypes:J,availability:Q,isPending:X,errorMessage:z,secondaryAction:G,primaryLabel:H,pendingLabel:Y,onTypeChange:K,onSubmit:W}){let B=O1((L)=>L.hasSentMessageFromMoi),q=Hi({availability:Q,detectedTypes:J}),U=Yi(q,Z),F=U!==Z,N=U==="claude-code"?"Tip: you can use your existing Claude subscription in moi":U==="codex"?"Tip: you can use your existing ChatGPT subscription in moi":void 0;return mP.useEffect(()=>{if(U&&F)K(U)},[K,U,F]),B1.jsxs("div",{className:"flex flex-col gap-5",children:[B1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[B1.jsx(G6,{children:$}),B1.jsx(G$,{children:Xi})]}),B1.jsxs("div",{className:"flex flex-col gap-4",children:[B1.jsx(Ki,{options:q,selectedType:F?void 0:Z,onTypeChange:K}),!B&&N&&B1.jsx("p",{className:"text-sm text-muted-foreground",children:N})]}),z&&B1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:z}),B1.jsxs("div",{className:"flex items-center justify-end gap-2",children:[G,B1.jsx(C0,{onClick:W,disabled:X||F,children:X&&Y?Y:H})]})]})}function Ki({options:$,selectedType:Z,onTypeChange:J}){return B1.jsx("div",{role:"group","aria-label":"Agent",className:s("grid gap-2",$.length>2?"grid-cols-4":"grid-cols-2"),children:$.map((Q)=>B1.jsx(Wi,{option:Q,selected:Z===Q.type,onSelect:J},Q.type))})}function Wi({option:$,selected:Z,onSelect:J}){let Q=Boolean($.disabledReason),X=B1.jsxs("button",{type:"button",disabled:$.disabled&&!Q,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(z)=>{if($.disabled){z.preventDefault();return}J($.type)},className:s("relative flex w-full flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!Z&&"opacity-70",!Z&&!$.disabled&&"cursor-pointer hover:opacity-100",$.disabled&&"cursor-not-allowed"),children:[B1.jsxs("span",{className:"relative inline-flex",children:[B1.jsx(Bi,{type:$.type}),Z&&B1.jsx(dG,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),B1.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[B1.jsx("span",{className:"text-sm font-medium text-foreground",children:GU[$.type]}),B1.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!Q)return X;return B1.jsxs(A1,{children:[B1.jsx(_1,{render:X}),B1.jsx(D1,{className:"max-w-64 text-center whitespace-pre-line",children:$.disabledReason})]})}function Bi({type:$}){return B1.jsx("img",{src:M2[$],alt:"",className:"size-8 shrink-0"})}var B$=P(c(),1);function iG({children:$,closeDisabled:Z=!1}){return B$.jsxs(z$,{className:"w-[calc(100%-2rem)] max-w-xl p-6",children:[B$.jsx(X$,{render:B$.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"absolute top-4 right-4",disabled:Z,children:B$.jsx(C1,{stroke:1.75})})}),$]})}var Q1=P(c(),1),pP=K$[0];function pJ({trigger:$}){let[,Z]=f4(),J=W$(),Q=VG(),X=vO(),[z,G]=mJ.useState(!1),[H,Y]=mJ.useState("agent"),[K,W]=mJ.useState(pP),[B,q]=mJ.useState(""),U=B.trim(),F=U?xP(U):null,N=X.isPending;if(J.cloudDemo)return Q1.jsx(cG,{trigger:$});function L(O){G(!1),Z(`/workspace/${O}`)}function V(){Y("agent"),W(pP),q(""),X.reset()}function M(){X.reset(),Y("name")}function _(){if(!U||F||N)return;X.reset(),X.mutate({name:U,type:K},{onSuccess:(O)=>L(O.id)})}return Q1.jsxs(z6,{open:z,onOpenChange:G,onOpenChangeComplete:(O)=>{if(!O)V()},children:[Q1.jsx(wG,{render:$}),Q1.jsx(iG,{children:H==="agent"?Q1.jsx(lG,{title:"Create new workspace",selectedType:K,availability:Q.data?.availability,isPending:!1,secondaryAction:Q1.jsx(Ui,{}),primaryLabel:"Next",onTypeChange:W,onSubmit:M}):Q1.jsx(qi,{name:B,validationError:F,requestError:X.error?.message,isPending:N,onNameChange:q,onSubmit:_})})]})}function qi({name:$,validationError:Z,requestError:J,isPending:Q,onNameChange:X,onSubmit:z}){function G(H){H.preventDefault(),z()}return Q1.jsxs("form",{className:"flex flex-col gap-5",onSubmit:G,children:[Q1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[Q1.jsx(G6,{children:"Create new workspace"}),Q1.jsx(G$,{children:"Give it a short and recognizable name"})]}),Q1.jsxs("div",{className:"flex flex-col gap-2",children:[Q1.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),Q1.jsx(Y6,{id:"workspace-name",value:$,onChange:(H)=>X(H.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&Q1.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),J&&Q1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:J}),Q1.jsx("div",{className:"flex items-center justify-end gap-2",children:Q1.jsx(C0,{type:"submit",disabled:!$.trim()||Boolean(Z)||Q,children:Q?"Creating…":"Create workspace"})})]})}function Ui(){return Q1.jsxs(A1,{children:[Q1.jsx(_1,{render:Q1.jsx(C0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),Q1.jsx(D1,{className:"max-w-64",children:Q1.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",Q1.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:"moi init"})," ","in the folder from your console to add it"]})})]})}var B6=P(v(),1);var F0=P(v(),1),p3=P(H4(),1);var n1=P(v(),1);var uJ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function g3($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function rG($){return"nodeType"in $}function x8($){var Z,J;if(!$)return window;if(g3($))return $;if(!rG($))return window;return(Z=(J=$.ownerDocument)==null?void 0:J.defaultView)!=null?Z:window}function aG($){let{Document:Z}=x8($);return $ instanceof Z}function U$($){if(g3($))return!1;return $ instanceof x8($).HTMLElement}function YU($){return $ instanceof x8($).SVGElement}function v3($){if(!$)return document;if(g3($))return $.document;if(!rG($))return document;if(aG($))return $;if(U$($)||YU($))return $.ownerDocument;return document}var $9=uJ?n1.useLayoutEffect:n1.useEffect;function cJ($){let Z=n1.useRef($);return $9(()=>{Z.current=$}),n1.useCallback(function(){for(var J=arguments.length,Q=Array(J),X=0;X<J;X++)Q[X]=arguments[X];return Z.current==null?void 0:Z.current(...Q)},[])}function cP(){let $=n1.useRef(null),Z=n1.useCallback((Q,X)=>{$.current=setInterval(Q,X)},[]),J=n1.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,J]}function F$($,Z){if(Z===void 0)Z=[$];let J=n1.useRef($);return $9(()=>{if(J.current!==$)J.current=$},Z),J}function N$($,Z){let J=n1.useRef();return n1.useMemo(()=>{let Q=$(J.current);return J.current=Q,Q},[...Z])}function dJ($){let Z=cJ($),J=n1.useRef(null),Q=n1.useCallback((X)=>{if(X!==J.current)Z==null||Z(X,J.current);J.current=X},[]);return[J,Q]}function lJ($){let Z=n1.useRef();return n1.useEffect(()=>{Z.current=$},[$]),Z.current}var HU={};function iJ($,Z){return n1.useMemo(()=>{if(Z)return Z;let J=HU[$]==null?0:HU[$]+1;return HU[$]=J,$+"-"+J},[$,Z])}function dP($){return function(Z){for(var J=arguments.length,Q=Array(J>1?J-1:0),X=1;X<J;X++)Q[X-1]=arguments[X];return Q.reduce((z,G)=>{let H=Object.entries(G);for(let[Y,K]of H){let W=z[Y];if(W!=null)z[Y]=W+$*K}return z},{...Z})}}var f3=dP(1),rJ=dP(-1);function Fi($){return"clientX"in $&&"clientY"in $}function nG($){if(!$)return!1;let{KeyboardEvent:Z}=x8($.target);return Z&&$ instanceof Z}function Ni($){if(!$)return!1;let{TouchEvent:Z}=x8($.target);return Z&&$ instanceof Z}function aJ($){if(Ni($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:J}=$.touches[0];return{x:Z,y:J}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:J}=$.changedTouches[0];return{x:Z,y:J}}}if(Fi($))return{x:$.clientX,y:$.clientY};return null}var q$=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:J}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(J?Math.round(J):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:J}=$;return"scaleX("+Z+") scaleY("+J+")"}},Transform:{toString($){if(!$)return;return[q$.Translate.toString($),q$.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:J,easing:Q}=$;return Z+" "+J+"ms "+Q}}}),uP="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function lP($){if($.matches(uP))return $;return $.querySelector(uP)}var m3=P(v(),1),Vi={display:"none"};function iP($){let{id:Z,value:J}=$;return m3.default.createElement("div",{id:Z,style:Vi},J)}function rP($){let{id:Z,announcement:J,ariaLiveType:Q="assertive"}=$,X={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return m3.default.createElement("div",{id:Z,style:X,role:"status","aria-live":Q,"aria-atomic":!0},J)}function aP(){let[$,Z]=m3.useState("");return{announce:m3.useCallback((Q)=>{if(Q!=null)Z(Q)},[]),announcement:$}}var Hw=F0.createContext(null);function Li($){let Z=F0.useContext(Hw);F0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function Mi(){let[$]=F0.useState(()=>new Set),Z=F0.useCallback((Q)=>{return $.add(Q),()=>$.delete(Q)},[$]);return[F0.useCallback((Q)=>{let{type:X,event:z}=Q;$.forEach((G)=>{var H;return(H=G[X])==null?void 0:H.call(G,z)})},[$]),Z]}var Ai={draggable:`
|
|
24
|
+
To pick up a draggable item, press the space bar.
|
|
25
|
+
While dragging, use the arrow keys to move the item.
|
|
26
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
27
|
+
`},_i={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was moved over droppable area "+J.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was dropped over droppable area "+J.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function Di($){let{announcements:Z=_i,container:J,hiddenTextDescribedById:Q,screenReaderInstructions:X=Ai}=$,{announce:z,announcement:G}=aP(),H=iJ("DndLiveRegion"),[Y,K]=F0.useState(!1);if(F0.useEffect(()=>{K(!0)},[]),Li(F0.useMemo(()=>({onDragStart(B){let{active:q}=B;z(Z.onDragStart({active:q}))},onDragMove(B){let{active:q,over:U}=B;if(Z.onDragMove)z(Z.onDragMove({active:q,over:U}))},onDragOver(B){let{active:q,over:U}=B;z(Z.onDragOver({active:q,over:U}))},onDragEnd(B){let{active:q,over:U}=B;z(Z.onDragEnd({active:q,over:U}))},onDragCancel(B){let{active:q,over:U}=B;z(Z.onDragCancel({active:q,over:U}))}}),[z,Z])),!Y)return null;let W=F0.default.createElement(F0.default.Fragment,null,F0.default.createElement(iP,{id:Q,value:X.draggable}),F0.default.createElement(rP,{id:H,announcement:G}));return J?p3.createPortal(W,J):W}var Q8;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(Q8||(Q8={}));function sG(){}function NU($,Z){return F0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function Yw(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];return F0.useMemo(()=>[...Z].filter((Q)=>Q!=null),[...Z])}var A2=Object.freeze({x:0,y:0});function Oi($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function Pi($,Z){let J=aJ($);if(!J)return"0 0";let Q={x:(J.x-Z.left)/Z.width*100,y:(J.y-Z.top)/Z.height*100};return Q.x+"% "+Q.y+"%"}function wi($,Z){let{data:{value:J}}=$,{data:{value:Q}}=Z;return J-Q}function ji($,Z){let{data:{value:J}}=$,{data:{value:Q}}=Z;return Q-J}function Ti($,Z){if(!$||$.length===0)return null;let[J]=$;return Z?J[Z]:J}function nP($,Z,J){if(Z===void 0)Z=$.left;if(J===void 0)J=$.top;return{x:Z+$.width*0.5,y:J+$.height*0.5}}var Kw=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:Q}=$,X=nP(Z,Z.left,Z.top),z=[];for(let G of Q){let{id:H}=G,Y=J.get(H);if(Y){let K=Oi(nP(Y),X);z.push({id:H,data:{droppableContainer:G,value:K}})}}return z.sort(wi)};function Ci($,Z){let J=Math.max(Z.top,$.top),Q=Math.max(Z.left,$.left),X=Math.min(Z.left+Z.width,$.left+$.width),z=Math.min(Z.top+Z.height,$.top+$.height),G=X-Q,H=z-J;if(Q<X&&J<z){let Y=Z.width*Z.height,K=$.width*$.height,W=G*H,B=W/(Y+K-W);return Number(B.toFixed(4))}return 0}var Ei=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:Q}=$,X=[];for(let z of Q){let{id:G}=z,H=J.get(G);if(H){let Y=Ci(H,Z);if(Y>0)X.push({id:G,data:{droppableContainer:z,value:Y}})}}return X.sort(ji)};function Si($,Z,J){return{...$,scaleX:Z&&J?Z.width/J.width:1,scaleY:Z&&J?Z.height/J.height:1}}function Ww($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:A2}function ki($){return function(J){for(var Q=arguments.length,X=Array(Q>1?Q-1:0),z=1;z<Q;z++)X[z-1]=arguments[z];return X.reduce((G,H)=>({...G,top:G.top+$*H.y,bottom:G.bottom+$*H.y,left:G.left+$*H.x,right:G.right+$*H.x}),{...J})}}var Ii=ki(1);function Bw($){if($.startsWith("matrix3d(")){let Z=$.slice(9,-1).split(/, /);return{x:+Z[12],y:+Z[13],scaleX:+Z[0],scaleY:+Z[5]}}else if($.startsWith("matrix(")){let Z=$.slice(7,-1).split(/, /);return{x:+Z[4],y:+Z[5],scaleX:+Z[0],scaleY:+Z[3]}}return null}function Ri($,Z,J){let Q=Bw(Z);if(!Q)return $;let{scaleX:X,scaleY:z,x:G,y:H}=Q,Y=$.left-G-(1-X)*parseFloat(J),K=$.top-H-(1-z)*parseFloat(J.slice(J.indexOf(" ")+1)),W=X?$.width/X:$.width,B=z?$.height/z:$.height;return{width:W,height:B,top:K,right:Y+W,bottom:K+B,left:Y}}var yi={ignoreTransform:!1};function sJ($,Z){if(Z===void 0)Z=yi;let J=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:K,transformOrigin:W}=x8($).getComputedStyle($);if(K)J=Ri(J,K,W)}let{top:Q,left:X,width:z,height:G,bottom:H,right:Y}=J;return{top:Q,left:X,width:z,height:G,bottom:H,right:Y}}function oP($){return sJ($,{ignoreTransform:!0})}function bi($){let{innerWidth:Z,innerHeight:J}=$;return{top:0,left:0,right:Z,bottom:J,width:Z,height:J}}function xi($,Z){if(Z===void 0)Z=x8($).getComputedStyle($);return Z.position==="fixed"}function hi($,Z){if(Z===void 0)Z=x8($).getComputedStyle($);let J=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((X)=>{let z=Z[X];return typeof z==="string"?J.test(z):!1})}function VU($,Z){let J=[];function Q(X){if(Z!=null&&J.length>=Z)return J;if(!X)return J;if(aG(X)&&X.scrollingElement!=null&&!J.includes(X.scrollingElement))return J.push(X.scrollingElement),J;if(!U$(X)||YU(X))return J;if(J.includes(X))return J;let z=x8($).getComputedStyle(X);if(X!==$){if(hi(X,z))J.push(X)}if(xi(X,z))return J;return Q(X.parentNode)}if(!$)return J;return Q($)}function qw($){let[Z]=VU($,1);return Z!=null?Z:null}function KU($){if(!uJ||!$)return null;if(g3($))return $;if(!rG($))return null;if(aG($)||$===v3($).scrollingElement)return window;if(U$($))return $;return null}function Uw($){if(g3($))return $.scrollX;return $.scrollLeft}function Fw($){if(g3($))return $.scrollY;return $.scrollTop}function qU($){return{x:Uw($),y:Fw($)}}var F8;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(F8||(F8={}));function Nw($){if(!uJ||!$)return!1;return $===document.scrollingElement}function Vw($){let Z={x:0,y:0},J=Nw($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},Q={x:$.scrollWidth-J.width,y:$.scrollHeight-J.height},X=$.scrollTop<=Z.y,z=$.scrollLeft<=Z.x,G=$.scrollTop>=Q.y,H=$.scrollLeft>=Q.x;return{isTop:X,isLeft:z,isBottom:G,isRight:H,maxScroll:Q,minScroll:Z}}var gi={x:0.2,y:0.2};function vi($,Z,J,Q,X){let{top:z,left:G,right:H,bottom:Y}=J;if(Q===void 0)Q=10;if(X===void 0)X=gi;let{isTop:K,isBottom:W,isLeft:B,isRight:q}=Vw($),U={x:0,y:0},F={x:0,y:0},N={height:Z.height*X.y,width:Z.width*X.x};if(!K&&z<=Z.top+N.height)U.y=F8.Backward,F.y=Q*Math.abs((Z.top+N.height-z)/N.height);else if(!W&&Y>=Z.bottom-N.height)U.y=F8.Forward,F.y=Q*Math.abs((Z.bottom-N.height-Y)/N.height);if(!q&&H>=Z.right-N.width)U.x=F8.Forward,F.x=Q*Math.abs((Z.right-N.width-H)/N.width);else if(!B&&G<=Z.left+N.width)U.x=F8.Backward,F.x=Q*Math.abs((Z.left+N.width-G)/N.width);return{direction:U,speed:F}}function fi($){if($===document.scrollingElement){let{innerWidth:z,innerHeight:G}=window;return{top:0,left:0,right:z,bottom:G,width:z,height:G}}let{top:Z,left:J,right:Q,bottom:X}=$.getBoundingClientRect();return{top:Z,left:J,right:Q,bottom:X,width:$.clientWidth,height:$.clientHeight}}function Lw($){return $.reduce((Z,J)=>{return f3(Z,qU(J))},A2)}function mi($){return $.reduce((Z,J)=>{return Z+Uw(J)},0)}function pi($){return $.reduce((Z,J)=>{return Z+Fw(J)},0)}function Mw($,Z){if(Z===void 0)Z=sJ;if(!$)return;let{top:J,left:Q,bottom:X,right:z}=Z($);if(!qw($))return;if(X<=0||z<=0||J>=window.innerHeight||Q>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var ui=[["x",["left","right"],mi],["y",["top","bottom"],pi]];class eG{constructor($,Z){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let J=VU(Z),Q=Lw(J);this.rect={...$},this.width=$.width,this.height=$.height;for(let[X,z,G]of ui)for(let H of z)Object.defineProperty(this,H,{get:()=>{let Y=G(J),K=Q[X]-Y;return this.rect[H]+K},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class V${constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var J;return(J=this.target)==null?void 0:J.removeEventListener(...Z)})},this.target=$}add($,Z,J){var Q;(Q=this.target)==null||Q.addEventListener($,Z,J),this.listeners.push([$,Z,J])}}function ci($){let{EventTarget:Z}=x8($);return $ instanceof Z?$:v3($)}function WU($,Z){let J=Math.abs($.x),Q=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(J**2+Q**2)>Z;if("x"in Z&&"y"in Z)return J>Z.x&&Q>Z.y;if("x"in Z)return J>Z.x;if("y"in Z)return Q>Z.y;return!1}var o4;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(o4||(o4={}));function sP($){$.preventDefault()}function di($){$.stopPropagation()}var x5;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(x5||(x5={}));var Aw={start:[x5.Space,x5.Enter],cancel:[x5.Esc],end:[x5.Space,x5.Enter,x5.Tab]},li=($,Z)=>{let{currentCoordinates:J}=Z;switch($.code){case x5.Right:return{...J,x:J.x+25};case x5.Left:return{...J,x:J.x-25};case x5.Down:return{...J,y:J.y+25};case x5.Up:return{...J,y:J.y-25}}return};class tJ{constructor($){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=$;let{event:{target:Z}}=$;this.props=$,this.listeners=new V$(v3(Z)),this.windowListeners=new V$(x8(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(o4.Resize,this.handleCancel),this.windowListeners.add(o4.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(o4.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,J=$.node.current;if(J)Mw(J);Z(A2)}handleKeyDown($){if(nG($)){let{active:Z,context:J,options:Q}=this.props,{keyboardCodes:X=Aw,coordinateGetter:z=li,scrollBehavior:G="smooth"}=Q,{code:H}=$;if(X.end.includes(H)){this.handleEnd($);return}if(X.cancel.includes(H)){this.handleCancel($);return}let{collisionRect:Y}=J.current,K=Y?{x:Y.left,y:Y.top}:A2;if(!this.referenceCoordinates)this.referenceCoordinates=K;let W=z($,{active:Z,context:J.current,currentCoordinates:K});if(W){let B=rJ(W,K),q={x:0,y:0},{scrollableAncestors:U}=J.current;for(let F of U){let N=$.code,{isTop:L,isRight:V,isLeft:M,isBottom:_,maxScroll:O,minScroll:D}=Vw(F),A=fi(F),C={x:Math.min(N===x5.Right?A.right-A.width/2:A.right,Math.max(N===x5.Right?A.left:A.left+A.width/2,W.x)),y:Math.min(N===x5.Down?A.bottom-A.height/2:A.bottom,Math.max(N===x5.Down?A.top:A.top+A.height/2,W.y))},I=N===x5.Right&&!V||N===x5.Left&&!M,y=N===x5.Down&&!_||N===x5.Up&&!L;if(I&&C.x!==W.x){let E=F.scrollLeft+B.x,h=N===x5.Right&&E<=O.x||N===x5.Left&&E>=D.x;if(h&&!B.y){F.scrollTo({left:E,behavior:G});return}if(h)q.x=F.scrollLeft-E;else q.x=N===x5.Right?F.scrollLeft-O.x:F.scrollLeft-D.x;if(q.x)F.scrollBy({left:-q.x,behavior:G});break}else if(y&&C.y!==W.y){let E=F.scrollTop+B.y,h=N===x5.Down&&E<=O.y||N===x5.Up&&E>=D.y;if(h&&!B.x){F.scrollTo({top:E,behavior:G});return}if(h)q.y=F.scrollTop-E;else q.y=N===x5.Down?F.scrollTop-O.y:F.scrollTop-D.y;if(q.y)F.scrollBy({top:-q.y,behavior:G});break}}this.handleMove($,f3(rJ(W,this.referenceCoordinates),q))}}}handleMove($,Z){let{onMove:J}=this.props;$.preventDefault(),J(Z)}handleEnd($){let{onEnd:Z}=this.props;$.preventDefault(),this.detach(),Z()}handleCancel($){let{onCancel:Z}=this.props;$.preventDefault(),this.detach(),Z()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}tJ.activators=[{eventName:"onKeyDown",handler:($,Z,J)=>{let{keyboardCodes:Q=Aw,onActivation:X}=Z,{active:z}=J,{code:G}=$.nativeEvent;if(Q.start.includes(G)){let H=z.activatorNode.current;if(H&&$.target!==H)return!1;return $.preventDefault(),X==null||X({event:$.nativeEvent}),!0}return!1}}];function tP($){return Boolean($&&"distance"in $)}function eP($){return Boolean($&&"delay"in $)}class $H{constructor($,Z,J){var Q;if(J===void 0)J=ci($.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=$,this.events=Z;let{event:X}=$,{target:z}=X;this.props=$,this.events=Z,this.document=v3(z),this.documentListeners=new V$(this.document),this.listeners=new V$(J),this.windowListeners=new V$(x8(z)),this.initialCoordinates=(Q=aJ(X))!=null?Q:A2,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:$,props:{options:{activationConstraint:Z,bypassActivationConstraint:J}}}=this;if(this.listeners.add($.move.name,this.handleMove,{passive:!1}),this.listeners.add($.end.name,this.handleEnd),$.cancel)this.listeners.add($.cancel.name,this.handleCancel);if(this.windowListeners.add(o4.Resize,this.handleCancel),this.windowListeners.add(o4.DragStart,sP),this.windowListeners.add(o4.VisibilityChange,this.handleCancel),this.windowListeners.add(o4.ContextMenu,sP),this.documentListeners.add(o4.Keydown,this.handleKeydown),Z){if(J!=null&&J({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(eP(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(tP(Z)){this.handlePending(Z);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending($,Z){let{active:J,onPending:Q}=this.props;Q(J,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(o4.Click,di,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(o4.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:J,initialCoordinates:Q,props:X}=this,{onMove:z,options:{activationConstraint:G}}=X;if(!Q)return;let H=(Z=aJ($))!=null?Z:A2,Y=rJ(Q,H);if(!J&&G){if(tP(G)){if(G.tolerance!=null&&WU(Y,G.tolerance))return this.handleCancel();if(WU(Y,G.distance))return this.handleStart()}if(eP(G)){if(WU(Y,G.tolerance))return this.handleCancel()}this.handlePending(G,Y);return}if($.cancelable)$.preventDefault();z(H)}handleEnd(){let{onAbort:$,onEnd:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleCancel(){let{onAbort:$,onCancel:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleKeydown($){if($.code===x5.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var ii={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eJ extends $H{constructor($){let{event:Z}=$,J=v3(Z.target);super($,ii,J)}}eJ.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z;if(!J.isPrimary||J.button!==0)return!1;return Q==null||Q({event:J}),!0}}];var ri={move:{name:"mousemove"},end:{name:"mouseup"}},UU;(function($){$[$.RightClick=2]="RightClick"})(UU||(UU={}));class _w extends $H{constructor($){super($,ri,v3($.event.target))}}_w.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z;if(J.button===UU.RightClick)return!1;return Q==null||Q({event:J}),!0}}];var BU={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Dw extends $H{constructor($){super($,BU)}static setup(){return window.addEventListener(BU.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(BU.move.name,$)};function $(){}}}Dw.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:Q}=Z,{touches:X}=J;if(X.length>1)return!1;return Q==null||Q({event:J}),!0}}];var nJ;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(nJ||(nJ={}));var tG;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(tG||(tG={}));function ai($){let{acceleration:Z,activator:J=nJ.Pointer,canScroll:Q,draggingRect:X,enabled:z,interval:G=5,order:H=tG.TreeOrder,pointerCoordinates:Y,scrollableAncestors:K,scrollableAncestorRects:W,delta:B,threshold:q}=$,U=oi({delta:B,disabled:!z}),[F,N]=cP(),L=F0.useRef({x:0,y:0}),V=F0.useRef({x:0,y:0}),M=F0.useMemo(()=>{switch(J){case nJ.Pointer:return Y?{top:Y.y,bottom:Y.y,left:Y.x,right:Y.x}:null;case nJ.DraggableRect:return X}},[J,X,Y]),_=F0.useRef(null),O=F0.useCallback(()=>{let A=_.current;if(!A)return;let C=L.current.x*V.current.x,I=L.current.y*V.current.y;A.scrollBy(C,I)},[]),D=F0.useMemo(()=>H===tG.TreeOrder?[...K].reverse():K,[H,K]);F0.useEffect(()=>{if(!z||!K.length||!M){N();return}for(let A of D){if((Q==null?void 0:Q(A))===!1)continue;let C=K.indexOf(A),I=W[C];if(!I)continue;let{direction:y,speed:E}=vi(A,I,M,Z,q);for(let h of["x","y"])if(!U[h][y[h]])E[h]=0,y[h]=0;if(E.x>0||E.y>0){N(),_.current=A,F(O,G),L.current=E,V.current=y;return}}L.current={x:0,y:0},V.current={x:0,y:0},N()},[Z,O,Q,N,z,G,JSON.stringify(M),JSON.stringify(U),F,K,D,W,JSON.stringify(q)])}var ni={x:{[F8.Backward]:!1,[F8.Forward]:!1},y:{[F8.Backward]:!1,[F8.Forward]:!1}};function oi($){let{delta:Z,disabled:J}=$,Q=lJ(Z);return N$((X)=>{if(J||!Q||!X)return ni;let z={x:Math.sign(Z.x-Q.x),y:Math.sign(Z.y-Q.y)};return{x:{[F8.Backward]:X.x[F8.Backward]||z.x===-1,[F8.Forward]:X.x[F8.Forward]||z.x===1},y:{[F8.Backward]:X.y[F8.Backward]||z.y===-1,[F8.Forward]:X.y[F8.Forward]||z.y===1}}},[J,Z,Q])}function si($,Z){let J=Z!=null?$.get(Z):void 0,Q=J?J.node.current:null;return N$((X)=>{var z;if(Z==null)return null;return(z=Q!=null?Q:X)!=null?z:null},[Q,Z])}function ti($,Z){return F0.useMemo(()=>$.reduce((J,Q)=>{let{sensor:X}=Q,z=X.activators.map((G)=>({eventName:G.eventName,handler:Z(G.handler,Q)}));return[...J,...z]},[]),[$,Z])}var oJ;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(oJ||(oJ={}));var FU;(function($){$.Optimized="optimized"})(FU||(FU={}));var $w=new Map;function ei($,Z){let{dragging:J,dependencies:Q,config:X}=Z,[z,G]=F0.useState(null),{frequency:H,measure:Y,strategy:K}=X,W=F0.useRef($),B=L(),q=F$(B),U=F0.useCallback(function(V){if(V===void 0)V=[];if(q.current)return;G((M)=>{if(M===null)return V;return M.concat(V.filter((_)=>!M.includes(_)))})},[q]),F=F0.useRef(null),N=N$((V)=>{if(B&&!J)return $w;if(!V||V===$w||W.current!==$||z!=null){let M=new Map;for(let _ of $){if(!_)continue;if(z&&z.length>0&&!z.includes(_.id)&&_.rect.current){M.set(_.id,_.rect.current);continue}let O=_.node.current,D=O?new eG(Y(O),O):null;if(_.rect.current=D,D)M.set(_.id,D)}return M}return V},[$,z,J,B,Y]);return F0.useEffect(()=>{W.current=$},[$]),F0.useEffect(()=>{if(B)return;U()},[J,B]),F0.useEffect(()=>{if(z&&z.length>0)G(null)},[JSON.stringify(z)]),F0.useEffect(()=>{if(B||typeof H!=="number"||F.current!==null)return;F.current=setTimeout(()=>{U(),F.current=null},H)},[H,B,U,...Q]),{droppableRects:N,measureDroppableContainers:U,measuringScheduled:z!=null};function L(){switch(K){case oJ.Always:return!1;case oJ.BeforeDragging:return J;default:return!J}}}function LU($,Z){return N$((J)=>{if(!$)return null;if(J)return J;return typeof Z==="function"?Z($):$},[Z,$])}function $r($,Z){return LU($,Z)}function Zr($){let{callback:Z,disabled:J}=$,Q=cJ(Z),X=F0.useMemo(()=>{if(J||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:z}=window;return new z(Q)},[Q,J]);return F0.useEffect(()=>{return()=>X==null?void 0:X.disconnect()},[X]),X}function ZH($){let{callback:Z,disabled:J}=$,Q=cJ(Z),X=F0.useMemo(()=>{if(J||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:z}=window;return new z(Q)},[J]);return F0.useEffect(()=>{return()=>X==null?void 0:X.disconnect()},[X]),X}function Jr($){return new eG(sJ($),$)}function Zw($,Z,J){if(Z===void 0)Z=Jr;let[Q,X]=F0.useState(null);function z(){X((Y)=>{if(!$)return null;if($.isConnected===!1){var K;return(K=Y!=null?Y:J)!=null?K:null}let W=Z($);if(JSON.stringify(Y)===JSON.stringify(W))return Y;return W})}let G=Zr({callback(Y){if(!$)return;for(let K of Y){let{type:W,target:B}=K;if(W==="childList"&&B instanceof HTMLElement&&B.contains($)){z();break}}}}),H=ZH({callback:z});return $9(()=>{if(z(),$)H==null||H.observe($),G==null||G.observe(document.body,{childList:!0,subtree:!0});else H==null||H.disconnect(),G==null||G.disconnect()},[$]),Q}function Qr($){let Z=LU($);return Ww($,Z)}var Jw=[];function Xr($){let Z=F0.useRef($),J=N$((Q)=>{if(!$)return Jw;if(Q&&Q!==Jw&&$&&Z.current&&$.parentNode===Z.current.parentNode)return Q;return VU($)},[$]);return F0.useEffect(()=>{Z.current=$},[$]),J}function zr($){let[Z,J]=F0.useState(null),Q=F0.useRef($),X=F0.useCallback((z)=>{let G=KU(z.target);if(!G)return;J((H)=>{if(!H)return null;return H.set(G,qU(G)),new Map(H)})},[]);return F0.useEffect(()=>{let z=Q.current;if($!==z){G(z);let H=$.map((Y)=>{let K=KU(Y);if(K)return K.addEventListener("scroll",X,{passive:!0}),[K,qU(K)];return null}).filter((Y)=>Y!=null);J(H.length?new Map(H):null),Q.current=$}return()=>{G($),G(z)};function G(H){H.forEach((Y)=>{let K=KU(Y);K==null||K.removeEventListener("scroll",X)})}},[X,$]),F0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((z,G)=>f3(z,G),A2):Lw($);return A2},[$,Z])}function Qw($,Z){if(Z===void 0)Z=[];let J=F0.useRef(null);return F0.useEffect(()=>{J.current=null},Z),F0.useEffect(()=>{let Q=$!==A2;if(Q&&!J.current)J.current=$;if(!Q&&J.current)J.current=null},[$]),J.current?rJ($,J.current):A2}function Gr($){F0.useEffect(()=>{if(!uJ)return;let Z=$.map((J)=>{let{sensor:Q}=J;return Q.setup==null?void 0:Q.setup()});return()=>{for(let J of Z)J==null||J()}},$.map((Z)=>{let{sensor:J}=Z;return J}))}function Hr($,Z){return F0.useMemo(()=>{return $.reduce((J,Q)=>{let{eventName:X,handler:z}=Q;return J[X]=(G)=>{z(G,Z)},J},{})},[$,Z])}function Ow($){return F0.useMemo(()=>$?bi($):null,[$])}var Xw=[];function Yr($,Z){if(Z===void 0)Z=sJ;let[J]=$,Q=Ow(J?x8(J):null),[X,z]=F0.useState(Xw);function G(){z(()=>{if(!$.length)return Xw;return $.map((Y)=>Nw(Y)?Q:new eG(Z(Y),Y))})}let H=ZH({callback:G});return $9(()=>{H==null||H.disconnect(),G(),$.forEach((Y)=>H==null?void 0:H.observe(Y))},[$]),X}function Pw($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return U$(Z)?Z:$}function Kr($){let{measure:Z}=$,[J,Q]=F0.useState(null),X=F0.useCallback((K)=>{for(let{target:W}of K)if(U$(W)){Q((B)=>{let q=Z(W);return B?{...B,width:q.width,height:q.height}:q});break}},[Z]),z=ZH({callback:X}),G=F0.useCallback((K)=>{let W=Pw(K);if(z==null||z.disconnect(),W)z==null||z.observe(W);Q(W?Z(W):null)},[Z,z]),[H,Y]=dJ(G);return F0.useMemo(()=>({nodeRef:H,rect:J,setRef:Y}),[J,H,Y])}var Wr=[{sensor:eJ,options:{}},{sensor:tJ,options:{}}],Br={current:{}},oG={draggable:{measure:oP},droppable:{measure:oP,strategy:oJ.WhileDragging,frequency:FU.Optimized},dragOverlay:{measure:sJ}};class L$ extends Map{get($){var Z;return $!=null?(Z=super.get($))!=null?Z:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(($)=>{let{disabled:Z}=$;return!Z})}getNodeFor($){var Z,J;return(Z=(J=this.get($))==null?void 0:J.node.current)!=null?Z:void 0}}var qr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new L$,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:sG},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:oG,measureDroppableContainers:sG,windowRect:null,measuringScheduled:!1},ww={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:sG,draggableNodes:new Map,over:null,measureDroppableContainers:sG},$Q=F0.createContext(ww),jw=F0.createContext(qr);function Ur(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new L$}}}function Fr($,Z){switch(Z.type){case Q8.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case Q8.DragMove:if($.draggable.active==null)return $;return{...$,draggable:{...$.draggable,translate:{x:Z.coordinates.x-$.draggable.initialCoordinates.x,y:Z.coordinates.y-$.draggable.initialCoordinates.y}}};case Q8.DragEnd:case Q8.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Q8.RegisterDroppable:{let{element:J}=Z,{id:Q}=J,X=new L$($.droppable.containers);return X.set(Q,J),{...$,droppable:{...$.droppable,containers:X}}}case Q8.SetDroppableDisabled:{let{id:J,key:Q,disabled:X}=Z,z=$.droppable.containers.get(J);if(!z||Q!==z.key)return $;let G=new L$($.droppable.containers);return G.set(J,{...z,disabled:X}),{...$,droppable:{...$.droppable,containers:G}}}case Q8.UnregisterDroppable:{let{id:J,key:Q}=Z,X=$.droppable.containers.get(J);if(!X||Q!==X.key)return $;let z=new L$($.droppable.containers);return z.delete(J),{...$,droppable:{...$.droppable,containers:z}}}default:return $}}function Nr($){let{disabled:Z}=$,{active:J,activatorEvent:Q,draggableNodes:X}=F0.useContext($Q),z=lJ(Q),G=lJ(J==null?void 0:J.id);return F0.useEffect(()=>{if(Z)return;if(!Q&&z&&G!=null){if(!nG(z))return;if(document.activeElement===z.target)return;let H=X.get(G);if(!H)return;let{activatorNode:Y,node:K}=H;if(!Y.current&&!K.current)return;requestAnimationFrame(()=>{for(let W of[Y.current,K.current]){if(!W)continue;let B=lP(W);if(B){B.focus();break}}})}},[Q,Z,X,G,z]),null}function Tw($,Z){let{transform:J,...Q}=Z;return $!=null&&$.length?$.reduce((X,z)=>{return z({transform:X,...Q})},J):J}function Vr($){return F0.useMemo(()=>({draggable:{...oG.draggable,...$==null?void 0:$.draggable},droppable:{...oG.droppable,...$==null?void 0:$.droppable},dragOverlay:{...oG.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function Lr($){let{activeNode:Z,measure:J,initialRect:Q,config:X=!0}=$,z=F0.useRef(!1),{x:G,y:H}=typeof X==="boolean"?{x:X,y:X}:X;$9(()=>{if(!G&&!H||!Z){z.current=!1;return}if(z.current||!Q)return;let K=Z==null?void 0:Z.node.current;if(!K||K.isConnected===!1)return;let W=J(K),B=Ww(W,Q);if(!G)B.x=0;if(!H)B.y=0;if(z.current=!0,Math.abs(B.x)>0||Math.abs(B.y)>0){let q=qw(K);if(q)q.scrollBy({top:B.y,left:B.x})}},[Z,G,H,Q,J])}var JH=F0.createContext({...A2,scaleX:1,scaleY:1}),W6;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(W6||(W6={}));var Cw=F0.memo(function(Z){var J,Q,X,z;let{id:G,accessibility:H,autoScroll:Y=!0,children:K,sensors:W=Wr,collisionDetection:B=Ei,measuring:q,modifiers:U,...F}=Z,N=F0.useReducer(Fr,void 0,Ur),[L,V]=N,[M,_]=Mi(),[O,D]=F0.useState(W6.Uninitialized),A=O===W6.Initialized,{draggable:{active:C,nodes:I,translate:y},droppable:{containers:E}}=L,h=C!=null?I.get(C):null,k=F0.useRef({initial:null,translated:null}),S=F0.useMemo(()=>{var I0;return C!=null?{id:C,data:(I0=h==null?void 0:h.data)!=null?I0:Br,rect:k}:null},[C,h]),w=F0.useRef(null),[T,R]=F0.useState(null),[b,g]=F0.useState(null),u=F$(F,Object.values(F)),j=iJ("DndDescribedBy",G),e=F0.useMemo(()=>E.getEnabled(),[E]),t=Vr(q),{droppableRects:x,measureDroppableContainers:$0,measuringScheduled:M0}=ei(e,{dragging:A,dependencies:[y.x,y.y],config:t.droppable}),l=si(I,C),H0=F0.useMemo(()=>b?aJ(b):null,[b]),U0=l5(),X0=$r(l,t.draggable.measure);Lr({activeNode:C!=null?I.get(C):null,config:U0.layoutShiftCompensation,initialRect:X0,measure:t.draggable.measure});let Y0=Zw(l,t.draggable.measure,X0),V0=Zw(l?l.parentElement:null),i=F0.useRef({activatorEvent:null,active:null,activeNode:l,collisionRect:null,collisions:null,droppableRects:x,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Z0=E.getNodeFor((J=i.current.over)==null?void 0:J.id),J0=Kr({measure:t.dragOverlay.measure}),Q0=(Q=J0.nodeRef.current)!=null?Q:l,n=A?(X=J0.rect)!=null?X:Y0:null,m=Boolean(J0.nodeRef.current&&J0.rect),d=Qr(m?null:Y0),f=Ow(Q0?x8(Q0):null),a=Xr(A?Z0!=null?Z0:l:null),o=Yr(a),N0=Tw(U,{transform:{x:y.x-d.x,y:y.y-d.y,scaleX:1,scaleY:1},activatorEvent:b,active:S,activeNodeRect:Y0,containerNodeRect:V0,draggingNodeRect:n,over:i.current.over,overlayNodeRect:J0.rect,scrollableAncestors:a,scrollableAncestorRects:o,windowRect:f}),j0=H0?f3(H0,y):null,h0=zr(a),c0=Qw(h0),p=Qw(h0,[Y0]),r=f3(N0,c0),z0=n?Ii(n,N0):null,L0=S&&z0?B({active:S,collisionRect:z0,droppableRects:x,droppableContainers:e,pointerCoordinates:j0}):null,P0=Ti(L0,"id"),[v0,$5]=F0.useState(null),F5=m?N0:f3(N0,p),l0=Si(F5,(z=v0==null?void 0:v0.rect)!=null?z:null,Y0),R0=F0.useRef(null),G0=F0.useCallback((I0,T0)=>{let{sensor:m0,options:Z5}=T0;if(w.current==null)return;let Y5=I.get(w.current);if(!Y5)return;let I5=I0.nativeEvent,i5=new m0({active:w.current,activeNode:Y5,event:I5,options:Z5,context:i,onAbort(N5){if(!I.get(N5))return;let{onDragAbort:m1}=u.current,l1={id:N5};m1==null||m1(l1),M({type:"onDragAbort",event:l1})},onPending(N5,F1,m1,l1){if(!I.get(N5))return;let{onDragPending:Q5}=u.current,d0={id:N5,constraint:F1,initialCoordinates:m1,offset:l1};Q5==null||Q5(d0),M({type:"onDragPending",event:d0})},onStart(N5){let F1=w.current;if(F1==null)return;let m1=I.get(F1);if(!m1)return;let{onDragStart:l1}=u.current,x0={activatorEvent:I5,active:{id:F1,data:m1.data,rect:k}};p3.unstable_batchedUpdates(()=>{l1==null||l1(x0),D(W6.Initializing),V({type:Q8.DragStart,initialCoordinates:N5,active:F1}),M({type:"onDragStart",event:x0}),R(R0.current),g(I5)})},onMove(N5){V({type:Q8.DragMove,coordinates:N5})},onEnd:r5(Q8.DragEnd),onCancel:r5(Q8.DragCancel)});R0.current=i5;function r5(N5){return async function(){let{active:m1,collisions:l1,over:x0,scrollAdjustedTranslate:Q5}=i.current,d0=null;if(m1&&Q5){let{cancelDrop:B5}=u.current;if(d0={activatorEvent:I5,active:m1,collisions:l1,delta:Q5,over:x0},N5===Q8.DragEnd&&typeof B5==="function"){if(await Promise.resolve(B5(d0)))N5=Q8.DragCancel}}w.current=null,p3.unstable_batchedUpdates(()=>{V({type:N5}),D(W6.Uninitialized),$5(null),R(null),g(null),R0.current=null;let B5=N5===Q8.DragEnd?"onDragEnd":"onDragCancel";if(d0){let R5=u.current[B5];R5==null||R5(d0),M({type:B5,event:d0})}})}}},[I]),A0=F0.useCallback((I0,T0)=>{return(m0,Z5)=>{let Y5=m0.nativeEvent,I5=I.get(Z5);if(w.current!==null||!I5||Y5.dndKit||Y5.defaultPrevented)return;let i5={active:I5};if(I0(m0,T0.options,i5)===!0)Y5.dndKit={capturedBy:T0.sensor},w.current=Z5,G0(m0,T0)}},[I,G0]),f0=ti(W,A0);Gr(W),$9(()=>{if(Y0&&O===W6.Initializing)D(W6.Initialized)},[Y0,O]),F0.useEffect(()=>{let{onDragMove:I0}=u.current,{active:T0,activatorEvent:m0,collisions:Z5,over:Y5}=i.current;if(!T0||!m0)return;let I5={active:T0,activatorEvent:m0,collisions:Z5,delta:{x:r.x,y:r.y},over:Y5};p3.unstable_batchedUpdates(()=>{I0==null||I0(I5),M({type:"onDragMove",event:I5})})},[r.x,r.y]),F0.useEffect(()=>{let{active:I0,activatorEvent:T0,collisions:m0,droppableContainers:Z5,scrollAdjustedTranslate:Y5}=i.current;if(!I0||w.current==null||!T0||!Y5)return;let{onDragOver:I5}=u.current,i5=Z5.get(P0),r5=i5&&i5.rect.current?{id:i5.id,rect:i5.rect.current,data:i5.data,disabled:i5.disabled}:null,N5={active:I0,activatorEvent:T0,collisions:m0,delta:{x:Y5.x,y:Y5.y},over:r5};p3.unstable_batchedUpdates(()=>{$5(r5),I5==null||I5(N5),M({type:"onDragOver",event:N5})})},[P0]),$9(()=>{i.current={activatorEvent:b,active:S,activeNode:l,collisionRect:z0,collisions:L0,droppableRects:x,draggableNodes:I,draggingNode:Q0,draggingNodeRect:n,droppableContainers:E,over:v0,scrollableAncestors:a,scrollAdjustedTranslate:r},k.current={initial:n,translated:z0}},[S,l,L0,z0,I,Q0,n,x,E,v0,a,r]),ai({...U0,delta:y,draggingRect:z0,pointerCoordinates:j0,scrollableAncestors:a,scrollableAncestorRects:o});let w5=F0.useMemo(()=>{return{active:S,activeNode:l,activeNodeRect:Y0,activatorEvent:b,collisions:L0,containerNodeRect:V0,dragOverlay:J0,draggableNodes:I,droppableContainers:E,droppableRects:x,over:v0,measureDroppableContainers:$0,scrollableAncestors:a,scrollableAncestorRects:o,measuringConfiguration:t,measuringScheduled:M0,windowRect:f}},[S,l,Y0,b,L0,V0,J0,I,E,x,v0,$0,a,o,t,M0,f]),W5=F0.useMemo(()=>{return{activatorEvent:b,activators:f0,active:S,activeNodeRect:Y0,ariaDescribedById:{draggable:j},dispatch:V,draggableNodes:I,over:v0,measureDroppableContainers:$0}},[b,f0,S,Y0,V,j,I,v0,$0]);return F0.default.createElement(Hw.Provider,{value:_},F0.default.createElement($Q.Provider,{value:W5},F0.default.createElement(jw.Provider,{value:w5},F0.default.createElement(JH.Provider,{value:l0},K)),F0.default.createElement(Nr,{disabled:(H==null?void 0:H.restoreFocus)===!1})),F0.default.createElement(Di,{...H,hiddenTextDescribedById:j}));function l5(){let I0=(T==null?void 0:T.autoScrollEnabled)===!1,T0=typeof Y==="object"?Y.enabled===!1:Y===!1,m0=A&&!I0&&!T0;if(typeof Y==="object")return{...Y,enabled:m0};return{enabled:m0}}}),Mr=F0.createContext(null),zw="button",Ar="Draggable";function Ew($){let{id:Z,data:J,disabled:Q=!1,attributes:X}=$,z=iJ(Ar),{activators:G,activatorEvent:H,active:Y,activeNodeRect:K,ariaDescribedById:W,draggableNodes:B,over:q}=F0.useContext($Q),{role:U=zw,roleDescription:F="draggable",tabIndex:N=0}=X!=null?X:{},L=(Y==null?void 0:Y.id)===Z,V=F0.useContext(L?JH:Mr),[M,_]=dJ(),[O,D]=dJ(),A=Hr(G,Z),C=F$(J);$9(()=>{return B.set(Z,{id:Z,key:z,node:M,activatorNode:O,data:C}),()=>{let y=B.get(Z);if(y&&y.key===z)B.delete(Z)}},[B,Z]);let I=F0.useMemo(()=>({role:U,tabIndex:N,"aria-disabled":Q,"aria-pressed":L&&U===zw?!0:void 0,"aria-roledescription":F,"aria-describedby":W.draggable}),[Q,U,N,L,F,W.draggable]);return{active:Y,activatorEvent:H,activeNodeRect:K,attributes:I,isDragging:L,listeners:Q?void 0:A,node:M,over:q,setNodeRef:_,setActivatorNodeRef:D,transform:V}}function _r(){return F0.useContext(jw)}var Dr="Droppable",Or={timeout:25};function Sw($){let{data:Z,disabled:J=!1,id:Q,resizeObserverConfig:X}=$,z=iJ(Dr),{active:G,dispatch:H,over:Y,measureDroppableContainers:K}=F0.useContext($Q),W=F0.useRef({disabled:J}),B=F0.useRef(!1),q=F0.useRef(null),U=F0.useRef(null),{disabled:F,updateMeasurementsFor:N,timeout:L}={...Or,...X},V=F$(N!=null?N:Q),M=F0.useCallback(()=>{if(!B.current){B.current=!0;return}if(U.current!=null)clearTimeout(U.current);U.current=setTimeout(()=>{K(Array.isArray(V.current)?V.current:[V.current]),U.current=null},L)},[L]),_=ZH({callback:M,disabled:F||!G}),O=F0.useCallback((I,y)=>{if(!_)return;if(y)_.unobserve(y),B.current=!1;if(I)_.observe(I)},[_]),[D,A]=dJ(O),C=F$(Z);return F0.useEffect(()=>{if(!_||!D.current)return;_.disconnect(),B.current=!1,_.observe(D.current)},[D,_]),F0.useEffect(()=>{return H({type:Q8.RegisterDroppable,element:{id:Q,key:z,disabled:J,node:D,rect:q,data:C}}),()=>H({type:Q8.UnregisterDroppable,key:z,id:Q})},[Q]),F0.useEffect(()=>{if(J!==W.current.disabled)H({type:Q8.SetDroppableDisabled,id:Q,key:z,disabled:J}),W.current.disabled=J},[Q,z,J,H]),{active:G,rect:q,isOver:(Y==null?void 0:Y.id)===Q,node:D,over:Y,setNodeRef:A}}function Pr($){let{animation:Z,children:J}=$,[Q,X]=F0.useState(null),[z,G]=F0.useState(null),H=lJ(J);if(!J&&!Q&&H)X(H);return $9(()=>{if(!z)return;let Y=Q==null?void 0:Q.key,K=Q==null?void 0:Q.props.id;if(Y==null||K==null){X(null);return}Promise.resolve(Z(K,z)).then(()=>{X(null)})},[Z,Q,z]),F0.default.createElement(F0.default.Fragment,null,J,Q?F0.cloneElement(Q,{ref:G}):null)}var wr={x:0,y:0,scaleX:1,scaleY:1};function jr($){let{children:Z}=$;return F0.default.createElement($Q.Provider,{value:ww},F0.default.createElement(JH.Provider,{value:wr},Z))}var Tr={position:"fixed",touchAction:"none"},Cr=($)=>{return nG($)?"transform 250ms ease":void 0},Er=F0.forwardRef(($,Z)=>{let{as:J,activatorEvent:Q,adjustScale:X,children:z,className:G,rect:H,style:Y,transform:K,transition:W=Cr}=$;if(!H)return null;let B=X?K:{...K,scaleX:1,scaleY:1},q={...Tr,width:H.width,height:H.height,top:H.top,left:H.left,transform:q$.Transform.toString(B),transformOrigin:X&&Q?Pi(Q,H):void 0,transition:typeof W==="function"?W(Q):W,...Y};return F0.default.createElement(J,{className:G,style:q,ref:Z},z)}),Sr=($)=>(Z)=>{let{active:J,dragOverlay:Q}=Z,X={},{styles:z,className:G}=$;if(z!=null&&z.active)for(let[H,Y]of Object.entries(z.active)){if(Y===void 0)continue;X[H]=J.node.style.getPropertyValue(H),J.node.style.setProperty(H,Y)}if(z!=null&&z.dragOverlay)for(let[H,Y]of Object.entries(z.dragOverlay)){if(Y===void 0)continue;Q.node.style.setProperty(H,Y)}if(G!=null&&G.active)J.node.classList.add(G.active);if(G!=null&&G.dragOverlay)Q.node.classList.add(G.dragOverlay);return function(){for(let[Y,K]of Object.entries(X))J.node.style.setProperty(Y,K);if(G!=null&&G.active)J.node.classList.remove(G.active)}},kr=($)=>{let{transform:{initial:Z,final:J}}=$;return[{transform:q$.Transform.toString(Z)},{transform:q$.Transform.toString(J)}]},Ir={duration:250,easing:"ease",keyframes:kr,sideEffects:Sr({styles:{active:{opacity:"0"}}})};function Rr($){let{config:Z,draggableNodes:J,droppableContainers:Q,measuringConfiguration:X}=$;return cJ((z,G)=>{if(Z===null)return;let H=J.get(z);if(!H)return;let Y=H.node.current;if(!Y)return;let K=Pw(G);if(!K)return;let{transform:W}=x8(G).getComputedStyle(G),B=Bw(W);if(!B)return;let q=typeof Z==="function"?Z:yr(Z);return Mw(Y,X.draggable.measure),q({active:{id:z,data:H.data,node:Y,rect:X.draggable.measure(Y)},draggableNodes:J,dragOverlay:{node:G,rect:X.dragOverlay.measure(K)},droppableContainers:Q,measuringConfiguration:X,transform:B})})}function yr($){let{duration:Z,easing:J,sideEffects:Q,keyframes:X}={...Ir,...$};return(z)=>{let{active:G,dragOverlay:H,transform:Y,...K}=z;if(!Z)return;let W={x:H.rect.left-G.rect.left,y:H.rect.top-G.rect.top},B={scaleX:Y.scaleX!==1?G.rect.width*Y.scaleX/H.rect.width:1,scaleY:Y.scaleY!==1?G.rect.height*Y.scaleY/H.rect.height:1},q={x:Y.x-W.x,y:Y.y-W.y,...B},U=X({...K,active:G,dragOverlay:H,transform:{initial:Y,final:q}}),[F]=U,N=U[U.length-1];if(JSON.stringify(F)===JSON.stringify(N))return;let L=Q==null?void 0:Q({active:G,dragOverlay:H,...K}),V=H.node.animate(U,{duration:Z,easing:J,fill:"forwards"});return new Promise((M)=>{V.onfinish=()=>{L==null||L(),M()}})}}var Gw=0;function br($){return F0.useMemo(()=>{if($==null)return;return Gw++,Gw},[$])}var kw=F0.default.memo(($)=>{let{adjustScale:Z=!1,children:J,dropAnimation:Q,style:X,transition:z,modifiers:G,wrapperElement:H="div",className:Y,zIndex:K=999}=$,{activatorEvent:W,active:B,activeNodeRect:q,containerNodeRect:U,draggableNodes:F,droppableContainers:N,dragOverlay:L,over:V,measuringConfiguration:M,scrollableAncestors:_,scrollableAncestorRects:O,windowRect:D}=_r(),A=F0.useContext(JH),C=br(B==null?void 0:B.id),I=Tw(G,{activatorEvent:W,active:B,activeNodeRect:q,containerNodeRect:U,draggingNodeRect:L.rect,over:V,overlayNodeRect:L.rect,scrollableAncestors:_,scrollableAncestorRects:O,transform:A,windowRect:D}),y=LU(q),E=Rr({config:Q,draggableNodes:F,droppableContainers:N,measuringConfiguration:M}),h=y?L.setRef:void 0;return F0.default.createElement(jr,null,F0.default.createElement(Pr,{animation:E},B&&C?F0.default.createElement(Er,{key:C,id:B.id,ref:h,as:H,activatorEvent:W,adjustScale:Z,className:Y,transition:z,rect:y,style:{zIndex:K,...X},transform:I},J):null))});var u3=P(c(),1),xr={start:[x5.Space],cancel:[x5.Esc],end:[x5.Space,x5.Tab]};function hr($,Z,J){let Q=$.indexOf(Z),X=$.indexOf(J);if(Q<0||X<0||Q===X)return $;let z=[...$],[G]=z.splice(Q,1);return z.splice(X,0,G),z}function QH({items:$,getId:Z,className:J,itemClassName:Q,dragDisabled:X=!1,onReorder:z,renderItem:G,renderPlaceholder:H,renderOverlay:Y}){let K=Yw(NU(eJ,{activationConstraint:{distance:4}}),NU(tJ,{keyboardCodes:xr})),[W,B]=B6.useState(null),[q,U]=B6.useState(null),F=B6.useRef(null),N=B6.useMemo(()=>$.map(Z),[$,Z]),L=B6.useMemo(()=>new Map($.map((C)=>[Z(C),C])),[$,Z]),M=(W&&q?q:N).map((C)=>L.get(C)).filter((C)=>Boolean(C)),_=W?L.get(W):void 0,O=X||$.length<2;return u3.jsxs(Cw,{sensors:K,collisionDetection:Kw,onDragStart:(C)=>{let I=$.map(Z);B(String(C.active.id)),F.current=I,U(I)},onDragOver:(C)=>{let I=String(C.active.id),y=C.over?String(C.over.id):void 0,E=F.current;if(!y||y===I||!E)return;let h=hr(E,I,y);if(h===E)return;F.current=h,U(h)},onDragCancel:()=>{F.current=null,B(null),U(null)},onDragEnd:(C)=>{let I=String(C.active.id),y=F.current;if(F.current=null,B(null),U(null),!y||y.join("|")===N.join("|"))return;if(!y.includes(I))return;z(y)},children:[u3.jsx("div",{className:J,children:M.map((C)=>u3.jsx(gr,{id:Z(C),item:C,disabled:O,itemClassName:Q,renderItem:G,renderPlaceholder:H},Z(C)))}),u3.jsx(kw,{dropAnimation:null,children:_&&Y?Y(_):null})]})}function gr({id:$,item:Z,disabled:J,itemClassName:Q,renderItem:X,renderPlaceholder:z}){let{setNodeRef:G,isOver:H}=Sw({id:$,disabled:J}),{attributes:Y,listeners:K,setNodeRef:W,isDragging:B}=Ew({id:$,disabled:J,attributes:{roleDescription:"sortable item"}}),q=(F)=>{G(F),W(F)},U={isDragging:B,isOver:H,dragDisabled:J,dragHandleProps:J?{}:{...Y,...K}};return u3.jsxs(u5.div,{layout:!0,ref:q,className:s("relative",Q?.(Z,U)),transition:{type:"spring",duration:0.25,bounce:0},children:[B&&z?.(Z),X(Z,U)]})}var c5=P(c(),1);function vr($){return s(ZQ({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function XH({children:$,showWorkspaces:Z=!0}){let{data:J}=FG(),Q=s0();return J8((X)=>{if(X.type==="workspace:updated"||X.type==="workspaces-list:updated")Q.invalidateQueries({queryKey:E0.all,exact:!0})}),c5.jsxs("div",{className:s("flex h-dvh bg-muted"),children:[c5.jsx(fr,{workspaces:Z?J??[]:[]}),c5.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function fr({workspaces:$}){let Z=fO();return c5.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[c5.jsx($J,{href:"/","aria-label":"Home",title:"Home",className:vr,children:c5.jsx(Rw,{stroke:1.5})}),c5.jsx("nav",{className:"flex max-h-full min-h-0 w-14 flex-1 flex-col items-center justify-center gap-4",children:$.length>0&&c5.jsxs(c5.Fragment,{children:[c5.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:c5.jsx(QH,{items:$,getId:(J)=>J.id,className:"flex flex-col gap-4",onReorder:(J)=>Z.mutate(J),renderPlaceholder:()=>c5.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-10 rounded-xl bg-accent"}),renderOverlay:(J)=>c5.jsx(Iw,{workspace:J,dragOverlay:!0}),renderItem:(J,Q)=>c5.jsx(Iw,{workspace:J,dragState:Q})})}),c5.jsx("div",{className:"shrink-0",children:c5.jsx(pJ,{trigger:c5.jsx(C0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",title:"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:c5.jsx(W4,{"data-icon":"inline-start",stroke:1.5})})})})]})}),c5.jsx("div",{"aria-hidden":"true",className:"size-8 shrink-0"})]})}function Iw({workspace:$,dragOverlay:Z=!1,dragState:J}){let[Q]=f4(),X=`/workspace/${$.id}`,z=h3($),G=Q===X||Q.startsWith(`${X}/`),H=c5.jsxs(c5.Fragment,{children:[c5.jsx("div",{className:s(ZQ({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12",Z?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",G&&!Z&&"bg-accent text-accent-foreground"),children:c5.jsx("img",{src:$.icon??M2[$.type??"claude-code"],alt:"",className:"size-7 shrink-0 rounded-xs"})}),c5.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:z})]});if(Z)return c5.jsx("span",{className:"flex w-14 flex-col items-center",children:H});return c5.jsx($J,{href:X,"aria-label":z,title:z,onClick:(Y)=>{if(J?.isDragging)Y.preventDefault()},className:s("group flex w-14 flex-col items-center rounded-lg outline-none",J?.isDragging&&"invisible"),...J?.dragHandleProps,children:H})}var DT=P(v(),1);var yw=P(v(),1);var M$=P(c(),1);function mr({choice:$,availability:Z,isPending:J,errorMessage:Q,onTypeChange:X,onCancel:z,onSubmit:G}){return M$.jsx(lG,{title:`Import ${h3($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:Z,isPending:J,errorMessage:Q,secondaryAction:M$.jsx(C0,{variant:"secondary",onClick:z,disabled:J,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:X,onSubmit:G})}function bw({choice:$,availability:Z,isPending:J,errorMessage:Q,onTypeChange:X,onSubmit:z,onReset:G}){let[H,Y]=yw.useState(!0);function K(B){if(!B&&J)return;Y(B)}function W(B){if(!B)G()}return M$.jsx(z6,{open:H,onOpenChange:K,onOpenChangeComplete:W,children:M$.jsx(iG,{closeDisabled:J,children:M$.jsx(mr,{choice:$,availability:Z,isPending:J,errorMessage:Q,onTypeChange:X,onCancel:()=>Y(!1),onSubmit:z})})})}var xw=P(v(),1);function pr($){return $.types[0]??K$[0]}function hw({onSuccess:$}){let Z=gO(),[J,Q]=xw.useState(null);function X(Y){Z.reset(),Q({workspace:Y,selectedType:pr(Y)})}function z(Y){Q((K)=>K?{...K,selectedType:Y}:K)}function G(){if(!J||Z.isPending)return;Z.mutate({path:J.workspace.path,type:J.selectedType},{onSuccess:$})}function H(){Q(null),Z.reset()}return{choice:J,isPending:Z.isPending,error:Z.error,startImport:X,selectType:z,submit:G,reset:H}}var QQ=P(v(),1);var XQ=P(c(),1),ur=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],q6=10,zH=3,cr=2.5,dr={O:1,o:0.5,".":0},lr=3000,ir=2,gw=3,U6=3,vw=0.001,c3={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function rr($){let Z=Math.max(...$.map((z)=>z.length)),J=Z*q6+(Z-1)*zH,Q=$.length*q6+($.length-1)*zH,X=[];return $.forEach((z,G)=>{Array.from(z).forEach((H,Y)=>{let K=dr[H];if(K===void 0)return;let W=Y*(q6+zH),B=G*(q6+zH);X.push({x:W,y:B,centerX:W+q6/2,centerY:B+q6/2,targetOpacity:K})})}),{width:J,height:Q,fieldColumns:Math.round(J/U6)+1,fieldRows:Math.round(Q/U6)+1,pixels:X}}var ar=ur.map(rr);function JQ($,Z,J){return $<Z?Z:$>J?J:$}function nr($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class fw{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,J){this.rects=$,this.svg=Z,this.geometry=J;let Q=J.fieldColumns*J.fieldRows;this.field=new Float32Array(Q),this.previousField=new Float32Array(Q),this.nextField=new Float32Array(Q)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=($)=>{let Z=this.svg.getBoundingClientRect();if(!Z.width||!Z.height)return;if(this.pointerActive=$.clientX>=Z.left&&$.clientX<=Z.right&&$.clientY>=Z.top&&$.clientY<=Z.bottom,this.pointerActive)this.pointerX=($.clientX-Z.left)/Z.width*this.geometry.width,this.pointerY=($.clientY-Z.top)/Z.height*this.geometry.height,this.resume()};seedImpulse(){let $=Math.round(this.geometry.width/2/U6),Z=Math.round(this.geometry.height/2/U6),J=2*gw*gw;for(let Q=0;Q<this.geometry.fieldRows;Q++)for(let X=0;X<this.geometry.fieldColumns;X++){let z=(X-$)**2+(Q-Z)**2,G=ir*Math.exp(-z/J),H=Q*this.geometry.fieldColumns+X;this.field[H]=G,this.previousField[H]=G}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=($)=>{if(this.stepWave(),this.pointerActive)this.driveWave($);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=$;let J=($-this.introStartedAt)/lr;if(this.activation=1-nr(Math.min(1,J)),J>=1)this.intro=!1}else{this.intro=!1;let J=this.pointerActive?1:0,Q=this.pointerActive?c3.fadeIn:c3.fadeOut;this.activation+=(J-this.activation)*Q}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>vw||Z>vw){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let Q=1;Q<Z-1;Q++)for(let X=1;X<$-1;X++){let z=Q*$+X,G=this.field[z-1]+this.field[z+1]+this.field[z-$]+this.field[z+$]-4*this.field[z];this.nextField[z]=(2*this.field[z]-this.previousField[z]+c3.courantSquared*G)*c3.damping}let J=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=J}driveWave($){let Z=JQ(Math.round(this.pointerX/U6),1,this.geometry.fieldColumns-2),J=JQ(Math.round(this.pointerY/U6),1,this.geometry.fieldRows-2);this.field[J*this.geometry.fieldColumns+Z]=c3.driveAmplitude*Math.sin($*c3.driveFrequency)}sampleField($,Z){let J=JQ($/U6,0,this.geometry.fieldColumns-1),Q=JQ(Z/U6,0,this.geometry.fieldRows-1),X=Math.floor(J),z=Math.floor(Q),G=Math.min(X+1,this.geometry.fieldColumns-1),H=Math.min(z+1,this.geometry.fieldRows-1),Y=J-X,K=Q-z,{fieldColumns:W}=this.geometry,B=this.field[z*W+X],q=this.field[z*W+G],U=this.field[H*W+X],F=this.field[H*W+G];return(B*(1-Y)+q*Y)*(1-K)+(U*(1-Y)+F*Y)*K}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,J)=>{let Q=this.rects[J];if(!Q)return;let X=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(X));let z=JQ(0.5+X*c3.gain,0,1),G=Z.targetOpacity*(1-this.activation)+z*this.activation;Q.setAttribute("opacity",G.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function or({geometry:$}){let Z=QQ.useRef([]),J=QQ.useRef(null);return QQ.useEffect(()=>{let Q=J.current;if(!Q||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let X=new fw(Z.current,Q,$);return X.start(),window.addEventListener("pointermove",X.handlePointerMove),()=>{X.stop(),window.removeEventListener("pointermove",X.handlePointerMove)}},[$]),XQ.jsx("svg",{ref:J,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((Q,X)=>XQ.jsx("rect",{ref:(z)=>{Z.current[X]=z},x:Q.x,y:Q.y,width:q6,height:q6,rx:cr,opacity:Q.targetOpacity},`${Q.x}-${Q.y}`))})}function mw({className:$}){return XQ.jsx("div",{role:"img","aria-label":"moi",className:s("flex items-center gap-2 text-accent",$),children:ar.map((Z,J)=>XQ.jsx(or,{geometry:Z},J))})}var A$={};D4(A$,{Trigger:()=>rw,Root:()=>iw,Panel:()=>ow});var zQ=P(v(),1);var E4=P(v(),1);function pw($){let{open:Z,defaultOpen:J,onOpenChange:Q,disabled:X}=$,z=Z!==void 0,[G,H]=n4({controlled:Z,default:J,name:"Collapsible",state:"open"}),{mounted:Y,setMounted:K,transitionStatus:W}=c4(G,!0,!0),[B,q]=E4.useState(G),[{height:U,width:F},N]=E4.useState({height:void 0,width:void 0}),L=t0(),[V,M]=E4.useState(),_=V??L,[O,D]=E4.useState(!1),[A,C]=E4.useState(!1),I=E4.useRef(null),y=E4.useRef(null),E=E4.useRef(null),h=E4.useRef(null),k=m2(h,!1),S=q0((w)=>{let T=!G,R=D0(K0.triggerPress,w.nativeEvent);if(Q(T,R),R.isCanceled)return;let b=h.current;if(y.current==="css-animation"&&b!=null)b.style.removeProperty("animation-name");if(!O&&!A){if(y.current!=null&&y.current!=="css-animation"){if(!Y&&T)K(!0)}if(y.current==="css-animation"){if(!B&&T)q(!0);if(!Y&&T)K(!0)}}if(H(T),y.current==="none"&&Y&&!T)K(!1)});return B0(()=>{if(z&&y.current==="none"&&!A&&!G)K(!1)},[z,A,G,Z,K]),E4.useMemo(()=>({abortControllerRef:I,animationTypeRef:y,disabled:X,handleTrigger:S,height:U,mounted:Y,open:G,panelId:_,panelRef:h,runOnceAnimationsFinish:k,setDimensions:N,setHiddenUntilFound:D,setKeepMounted:C,setMounted:K,setOpen:H,setPanelIdState:M,setVisible:q,transitionDimensionRef:E,transitionStatus:W,visible:B,width:F}),[I,y,X,S,U,Y,G,_,h,k,N,D,C,K,H,q,E,W,B,F])}var GH=P(v(),1),MU=GH.createContext(void 0);function HH(){let $=GH.useContext(MU);if($===void 0)throw Error(S0(15));return $}var d3=function($){return $.open="data-open",$.closed="data-closed",$[$.startingStyle=f2.startingStyle]="startingStyle",$[$.endingStyle=f2.endingStyle]="endingStyle",$}({});var uw=function($){return $.panelOpen="data-panel-open",$}({});var sr={[d3.open]:""},tr={[d3.closed]:""},cw={open($){if($)return{[uw.panelOpen]:""};return null}},dw={open($){if($)return sr;return tr}};var YH={...dw,...p5};var lw=P(c(),1),iw=zQ.forwardRef(function(Z,J){let{render:Q,className:X,defaultOpen:z=!1,disabled:G=!1,onOpenChange:H,open:Y,...K}=Z,W=q0(H),B=pw({open:Y,defaultOpen:z,onOpenChange:W,disabled:G}),q=zQ.useMemo(()=>({open:B.open,disabled:B.disabled,transitionStatus:B.transitionStatus}),[B.open,B.disabled,B.transitionStatus]),U=zQ.useMemo(()=>({...B,onOpenChange:W,state:q}),[B,W,q]),F=W0("div",Z,{state:q,ref:J,props:K,stateAttributesMapping:YH});return lw.jsx(MU.Provider,{value:U,children:F})});var KH=P(v(),1);var er={...cw,...p5},rw=KH.forwardRef(function(Z,J){let{panelId:Q,open:X,handleTrigger:z,state:G,disabled:H}=HH(),{className:Y,disabled:K=H,id:W,render:B,nativeButton:q=!0,...U}=Z,{getButtonProps:F,buttonRef:N}=p1({disabled:K,focusableWhenDisabled:!0,native:q}),L=KH.useMemo(()=>({"aria-controls":X?Q:void 0,"aria-expanded":X,onClick:z}),[Q,X,z]);return W0("button",Z,{state:G,ref:[J,N],props:[L,U,F],stateAttributesMapping:er})});var WH=P(v(),1);var Z9=P(v(),1);var aw=function($){return $.disabled="data-disabled",$.orientation="data-orientation",$}({});function nw($){let{abortControllerRef:Z,animationTypeRef:J,externalRef:Q,height:X,hiddenUntilFound:z,keepMounted:G,id:H,mounted:Y,onOpenChange:K,open:W,panelRef:B,runOnceAnimationsFinish:q,setDimensions:U,setMounted:F,setOpen:N,setVisible:L,transitionDimensionRef:V,visible:M,width:_}=$,O=Z9.useRef(!1),D=Z9.useRef(null),A=Z9.useRef(W),C=Z9.useRef(W),I=G4(),y=Z9.useMemo(()=>{if(J.current==="css-animation")return!M;return!W&&!Y},[W,Y,M,J]),E=q0((k)=>{if(!k)return;if(J.current==null||V.current==null){let T=getComputedStyle(k),R=T.animationName!=="none"&&T.animationName!=="",b=T.transitionDuration!=="0s"&&T.transitionDuration!=="";if(R&&b);else if(T.animationName==="none"&&T.transitionDuration!=="0s")J.current="css-transition";else if(T.animationName!=="none"&&T.transitionDuration==="0s")J.current="css-animation";else J.current="none";if(k.getAttribute(aw.orientation)==="horizontal"||T.transitionProperty.indexOf("width")>-1)V.current="width";else V.current="height"}if(J.current!=="css-transition")return;if(X===void 0||_===void 0){if(U({height:k.scrollHeight,width:k.scrollWidth}),C.current)k.style.setProperty("transition-duration","0s")}let S=-1,w=-1;return S=K1.request(()=>{C.current=!1,w=K1.request(()=>{setTimeout(()=>{k.style.removeProperty("transition-duration")})})}),()=>{K1.cancel(S),K1.cancel(w)}}),h=P4(Q,B,E);return B0(()=>{if(J.current!=="css-transition")return;let k=B.current;if(!k)return;let S=-1;if(Z.current!=null)Z.current.abort(),Z.current=null;if(W){let w={"justify-content":k.style.justifyContent,"align-items":k.style.alignItems,"align-content":k.style.alignContent,"justify-items":k.style.justifyItems};if(Object.keys(w).forEach((T)=>{k.style.setProperty(T,"initial","important")}),!C.current&&!G)k.setAttribute(d3.startingStyle,"");U({height:k.scrollHeight,width:k.scrollWidth}),S=K1.request(()=>{Object.entries(w).forEach(([T,R])=>{if(R==="")k.style.removeProperty(T);else k.style.setProperty(T,R)})})}else{if(k.scrollHeight===0&&k.scrollWidth===0)return;U({height:k.scrollHeight,width:k.scrollWidth});let w=new AbortController;Z.current=w;let T=w.signal,R=null,b=d3.endingStyle;return R=new MutationObserver((g)=>{if(g.some((j)=>j.type==="attributes"&&j.attributeName===b))R?.disconnect(),R=null,q(()=>{if(U({height:0,width:0}),k.style.removeProperty("content-visibility"),F(!1),Z.current===w)Z.current=null},T)}),R.observe(k,{attributes:!0,attributeFilter:[b]}),()=>{if(R?.disconnect(),I.cancel(),Z.current===w)w.abort(),Z.current=null}}return()=>{K1.cancel(S)}},[Z,J,I,z,G,Y,W,B,q,U,F]),B0(()=>{if(J.current!=="css-animation")return;let k=B.current;if(!k)return;if(D.current=k.style.animationName||D.current,k.style.setProperty("animation-name","none"),U({height:k.scrollHeight,width:k.scrollWidth}),!A.current&&!O.current)k.style.removeProperty("animation-name");if(W){if(Z.current!=null)Z.current.abort(),Z.current=null;F(!0),L(!0)}else Z.current=new AbortController,q(()=>{F(!1),L(!1),Z.current=null},Z.current.signal)},[Z,J,W,B,q,U,F,L,M]),C8(()=>{let k=K1.request(()=>{A.current=!1});return()=>K1.cancel(k)}),B0(()=>{if(!z)return;let k=B.current;if(!k)return;let S=-1,w=-1;if(W&&O.current)k.style.transitionDuration="0s",U({height:k.scrollHeight,width:k.scrollWidth}),S=K1.request(()=>{O.current=!1,w=K1.request(()=>{setTimeout(()=>{k.style.removeProperty("transition-duration")})})});return()=>{K1.cancel(S),K1.cancel(w)}},[z,W,B,U]),B0(()=>{let k=B.current;if(k&&z&&y){if(k.setAttribute("hidden","until-found"),J.current==="css-transition")k.setAttribute(d3.startingStyle,"")}},[z,y,J,B]),Z9.useEffect(function(){let S=B.current;if(!S)return;function w(T){O.current=!0,N(!0),K(!0,D0(K0.none,T))}return S.addEventListener("beforematch",w),()=>{S.removeEventListener("beforematch",w)}},[K,B,N]),Z9.useMemo(()=>({props:{hidden:y,id:H,ref:h}}),[y,H,h])}var AU=function($){return $.collapsiblePanelHeight="--collapsible-panel-height",$.collapsiblePanelWidth="--collapsible-panel-width",$}({});var ow=WH.forwardRef(function(Z,J){let{className:Q,hiddenUntilFound:X,keepMounted:z,render:G,id:H,...Y}=Z,{abortControllerRef:K,animationTypeRef:W,height:B,mounted:q,onOpenChange:U,open:F,panelId:N,panelRef:L,runOnceAnimationsFinish:V,setDimensions:M,setHiddenUntilFound:_,setKeepMounted:O,setMounted:D,setPanelIdState:A,setOpen:C,setVisible:I,state:y,transitionDimensionRef:E,visible:h,width:k,transitionStatus:S}=HH(),w=X??!1,T=z??!1;B0(()=>{if(H)return A(H),()=>{A(void 0)};return},[H,A]),B0(()=>{_(w)},[_,w]),B0(()=>{O(T)},[O,T]);let{props:R}=nw({abortControllerRef:K,animationTypeRef:W,externalRef:J,height:B,hiddenUntilFound:w,id:N,keepMounted:T,mounted:q,onOpenChange:U,open:F,panelRef:L,runOnceAnimationsFinish:V,setDimensions:M,setMounted:D,setOpen:C,setVisible:I,transitionDimensionRef:E,visible:h,width:k});y1({open:F&&S==="idle",ref:L,onComplete(){if(!F)return;M({height:void 0,width:void 0})}});let b=WH.useMemo(()=>({...y,transitionStatus:S}),[y,S]),g=W0("div",Z,{state:b,ref:[J,L],props:[R,{style:{[AU.collapsiblePanelHeight]:B===void 0?"auto":`${B}px`,[AU.collapsiblePanelWidth]:k===void 0?"auto":`${k}px`}},Y],stateAttributesMapping:YH});if(!(T||w||!T&&q))return null;return g});var FH=P(c(),1);function BH({...$}){return FH.jsx(A$.Root,{"data-slot":"collapsible",...$})}function qH({...$}){return FH.jsx(A$.Trigger,{"data-slot":"collapsible-trigger",...$})}function UH({...$}){return FH.jsx(A$.Panel,{"data-slot":"collapsible-content",...$})}var nH=P(v(),1);var $a=($,Z)=>{if(typeof $!=="number")return;if(Z===3)return{mode:"rgb",r:($>>8&15|$>>4&240)/255,g:($>>4&15|$&240)/255,b:($&15|$<<4&240)/255};if(Z===4)return{mode:"rgb",r:($>>12&15|$>>8&240)/255,g:($>>8&15|$>>4&240)/255,b:($>>4&15|$&240)/255,alpha:($&15|$<<4&240)/255};if(Z===6)return{mode:"rgb",r:($>>16&255)/255,g:($>>8&255)/255,b:($&255)/255};if(Z===8)return{mode:"rgb",r:($>>24&255)/255,g:($>>16&255)/255,b:($>>8&255)/255,alpha:($&255)/255}},NH=$a;var Za={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},sw=Za;var Ja=($)=>{return NH(sw[$.toLowerCase()],6)},tw=Ja;var Qa=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Xa=($)=>{let Z;return(Z=$.match(Qa))?NH(parseInt(Z[1],16),Z[1].length):void 0},ew=Xa;var VH="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var l3="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var GQ="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var $j="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var F6="\\s*,\\s*";var UP0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var za=new RegExp(`^rgba?\\(\\s*${VH}${F6}${VH}${F6}${VH}\\s*(?:,\\s*${GQ}\\s*)?\\)$`),Ga=new RegExp(`^rgba?\\(\\s*${l3}${F6}${l3}${F6}${l3}\\s*(?:,\\s*${GQ}\\s*)?\\)$`),Ha=($)=>{let Z={mode:"rgb"},J;if(J=$.match(za)){if(J[1]!==void 0)Z.r=J[1]/255;if(J[2]!==void 0)Z.g=J[2]/255;if(J[3]!==void 0)Z.b=J[3]/255}else if(J=$.match(Ga)){if(J[1]!==void 0)Z.r=J[1]/100;if(J[2]!==void 0)Z.g=J[2]/100;if(J[3]!==void 0)Z.b=J[3]/100}else return;if(J[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,J[4]/100));else if(J[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+J[5]));return Z},Zj=Ha;var Ya=($,Z)=>$===void 0?void 0:typeof $!=="object"?Qj($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,Jj=Ya;var Ka=($="rgb")=>(Z)=>(Z=Jj(Z,$))!==void 0?Z.mode===$?Z:_2[Z.mode][$]?_2[Z.mode][$](Z):$==="rgb"?_2[Z.mode].rgb(Z):_2.rgb[$](_2[Z.mode].rgb(Z)):void 0,LH=Ka;var _2={},Xj={},HQ=[],_U={},Wa=($)=>$,f5=($)=>{if(_2[$.mode]={..._2[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!_2[Z])_2[Z]={};_2[Z][$.mode]=$.fromMode[Z]}),!$.ranges)$.ranges={};if(!$.difference)$.difference={};return $.channels.forEach((Z)=>{if($.ranges[Z]===void 0)$.ranges[Z]=[0,1];if(!$.interpolate[Z])throw Error(`Missing interpolator for: ${Z}`);if(typeof $.interpolate[Z]==="function")$.interpolate[Z]={use:$.interpolate[Z]};if(!$.interpolate[Z].fixup)$.interpolate[Z].fixup=Wa}),Xj[$.mode]=$,($.parse||[]).forEach((Z)=>{Ba(Z,$.mode)}),LH($.mode)},zj=($)=>Xj[$],Ba=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");_U[$]=Z}else if(typeof $==="function"){if(HQ.indexOf($)<0)HQ.push($)}};var DU=/[^\x00-\x7F]|[a-zA-Z_]/,qa=/[^\x00-\x7F]|[-\w]/,_0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},e0=0;function MH($){let Z=$[e0],J=$[e0+1];if(Z==="-"||Z==="+")return/\d/.test(J)||J==="."&&/\d/.test($[e0+2]);if(Z===".")return/\d/.test(J);return/\d/.test(Z)}function OU($){if(e0>=$.length)return!1;let Z=$[e0];if(DU.test(Z))return!0;if(Z==="-"){if($.length-e0<2)return!1;let J=$[e0+1];if(J==="-"||DU.test(J))return!0;return!1}return!1}var Ua={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function YQ($){let Z="";if($[e0]==="-"||$[e0]==="+")Z+=$[e0++];if(Z+=AH($),$[e0]==="."&&/\d/.test($[e0+1]))Z+=$[e0++]+AH($);if($[e0]==="e"||$[e0]==="E"){if(($[e0+1]==="-"||$[e0+1]==="+")&&/\d/.test($[e0+2]))Z+=$[e0++]+$[e0++]+AH($);else if(/\d/.test($[e0+1]))Z+=$[e0++]+AH($)}if(OU($)){let J=_H($);if(J==="deg"||J==="rad"||J==="turn"||J==="grad")return{type:_0.Hue,value:Z*Ua[J]};return}if($[e0]==="%")return e0++,{type:_0.Percentage,value:+Z};return{type:_0.Number,value:+Z}}function AH($){let Z="";while(/\d/.test($[e0]))Z+=$[e0++];return Z}function _H($){let Z="";while(e0<$.length&&qa.test($[e0]))Z+=$[e0++];return Z}function Fa($){let Z=_H($);if($[e0]==="(")return e0++,{type:_0.Function,value:Z};if(Z==="none")return{type:_0.None,value:void 0};return{type:_0.Ident,value:Z}}function Na($=""){let Z=$.trim(),J=[],Q;e0=0;while(e0<Z.length){if(Q=Z[e0++],Q===`
|
|
28
|
+
`||Q==="\t"||Q===" "){while(e0<Z.length&&(Z[e0]===`
|
|
29
|
+
`||Z[e0]==="\t"||Z[e0]===" "))e0++;continue}if(Q===",")return;if(Q===")"){J.push({type:_0.ParenClose});continue}if(Q==="+"){if(e0--,MH(Z)){J.push(YQ(Z));continue}return}if(Q==="-"){if(e0--,MH(Z)){J.push(YQ(Z));continue}if(OU(Z)){J.push({type:_0.Ident,value:_H(Z)});continue}return}if(Q==="."){if(e0--,MH(Z)){J.push(YQ(Z));continue}return}if(Q==="/"){while(e0<Z.length&&(Z[e0]===`
|
|
30
|
+
`||Z[e0]==="\t"||Z[e0]===" "))e0++;let X;if(MH(Z)){if(X=YQ(Z),X.type!==_0.Hue){J.push({type:_0.Alpha,value:X});continue}}if(OU(Z)){if(_H(Z)==="none"){J.push({type:_0.Alpha,value:{type:_0.None,value:void 0}});continue}}return}if(/\d/.test(Q)){e0--,J.push(YQ(Z));continue}if(DU.test(Q)){e0--,J.push(Fa(Z));continue}return}return J}function Va($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==_0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==_0.Ident)return;let J=_U[Z.value];if(!J)return;let Q={mode:J},X=Gj($,!1);if(!X)return;let z=zj(J).channels;for(let G=0,H,Y;G<z.length;G++)if(H=X[G],Y=z[G],H.type!==_0.None){if(Q[Y]=H.type===_0.Number?H.value:H.value/100,Y==="alpha")Q[Y]=Math.max(0,Math.min(1,Q[Y]))}return Q}function Gj($,Z){let J=[],Q;while($._i<$.length){if(Q=$[$._i++],Q.type===_0.None||Q.type===_0.Number||Q.type===_0.Alpha||Q.type===_0.Percentage||Z&&Q.type===_0.Hue){J.push(Q);continue}if(Q.type===_0.ParenClose){if($._i<$.length)return;continue}return}if(J.length<3||J.length>4)return;if(J.length===4){if(J[3].type!==_0.Alpha)return;J[3]=J[3].value}if(J.length===3)J.push({type:_0.None,value:void 0});return J.every((X)=>X.type!==_0.Alpha)?J:void 0}function La($,Z){$._i=0;let J=$[$._i++];if(!J||J.type!==_0.Function)return;let Q=Gj($,Z);if(!Q)return;return Q.unshift(J.value),Q}var Ma=($)=>{if(typeof $!=="string")return;let Z=Na($),J=Z?La(Z,!0):void 0,Q=void 0,X=0,z=HQ.length;while(X<z)if((Q=HQ[X++]($,J))!==void 0)return Q;return Z?Va(Z):void 0},Qj=Ma;function Aa($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let J={mode:"rgb"},[,Q,X,z,G]=Z;if(Q.type===_0.Hue||X.type===_0.Hue||z.type===_0.Hue)return;if(Q.type!==_0.None)J.r=Q.type===_0.Number?Q.value/255:Q.value/100;if(X.type!==_0.None)J.g=X.type===_0.Number?X.value/255:X.value/100;if(z.type!==_0.None)J.b=z.type===_0.Number?z.value/255:z.value/100;if(G.type!==_0.None)J.alpha=Math.min(1,Math.max(0,G.type===_0.Number?G.value:G.value/100));return J}var Hj=Aa;var _a=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,Yj=_a;var Kj=($,Z,J)=>$+J*(Z-$);var Da=($)=>{let Z=[];for(let J=0;J<$.length-1;J++){let Q=$[J],X=$[J+1];if(Q===void 0&&X===void 0)Z.push(void 0);else if(Q!==void 0&&X!==void 0)Z.push([Q,X]);else Z.push(Q!==void 0?[Q,Q]:[X,X])}return Z},Wj=($)=>(Z)=>{let J=Da(Z);return(Q)=>{let X=Q*J.length,z=Q>=1?J.length-1:Math.max(Math.floor(X),0),G=J[z];return G===void 0?void 0:$(G[0],G[1],X-z)}};var O0=Wj(Kj);var L5=($)=>{let Z=!1,J=$.map((Q)=>{if(Q!==void 0)return Z=!0,Q;return 1});return Z?J:$};var Oa={mode:"rgb",channels:["r","g","b","alpha"],parse:[Hj,ew,Zj,tw,Yj,"srgb"],serialize:"srgb",interpolate:{r:O0,g:O0,b:O0,alpha:{use:O0,fixup:L5}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},s4=Oa;var PU=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),Pa=($)=>{let Z=PU($.r),J=PU($.g),Q=PU($.b),X={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*J+0.1882286462349947*Q,y:0.297344975250536*Z+0.6273635662554661*J+0.0752914584939979*Q,z:0.0270313613864123*Z+0.0706888525358272*J+0.9913375368376386*Q};if($.alpha!==void 0)X.alpha=$.alpha;return X},wU=Pa;var jU=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),wa=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"a98",r:jU($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*J),g:jU($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*J),b:jU($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*J)};if(Q!==void 0)X.alpha=Q;return X},TU=wa;var CU=($=0)=>{let Z=Math.abs($);if(Z<=0.04045)return $/12.92;return(Math.sign($)||1)*Math.pow((Z+0.055)/1.055,2.4)},ja=({r:$,g:Z,b:J,alpha:Q})=>{let X={mode:"lrgb",r:CU($),g:CU(Z),b:CU(J)};if(Q!==void 0)X.alpha=Q;return X},t4=ja;var Ta=($)=>{let{r:Z,g:J,b:Q,alpha:X}=t4($),z={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*J+0.1804807884018343*Q,y:0.2126390058715102*Z+0.715168678767756*J+0.0721923153607337*Q,z:0.0193308187155918*Z+0.119194779794626*J+0.9505321522496607*Q};if(X!==void 0)z.alpha=X;return z},B4=Ta;var EU=($=0)=>{let Z=Math.abs($);if(Z>0.0031308)return(Math.sign($)||1)*(1.055*Math.pow(Z,0.4166666666666667)-0.055);return $*12.92},Ca=({r:$,g:Z,b:J,alpha:Q},X="rgb")=>{let z={mode:X,r:EU($),g:EU(Z),b:EU(J)};if(Q!==void 0)z.alpha=Q;return z},e4=Ca;var Ea=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=e4({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*J,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*J,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*J});if(Q!==void 0)X.alpha=Q;return X},q4=Ea;var Sa={...s4,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>TU(B4($)),xyz65:TU},toMode:{rgb:($)=>q4(wU($)),xyz65:wU}},Bj=Sa;var ka=($)=>($=$%360)<0?$+360:$,o5=ka;var Ia=($,Z)=>{return $.map((J,Q,X)=>{if(J===void 0)return J;let z=o5(J);if(Q===0||$[Q-1]===void 0)return z;return Z(z-o5(X[Q-1]))}).reduce((J,Q)=>{if(!J.length||Q===void 0||J[J.length-1]===void 0)return J.push(Q),J;return J.push(Q+J[J.length-1]),J},[])},N8=($)=>Ia($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var o1=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],qj=Math.PI/180,Uj=180/Math.PI;var Fj=o1[3]*o1[4],Nj=o1[1]*o1[4],Vj=o1[1]*o1[2]-o1[0]*o1[3],Ra=({r:$,g:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=(Vj*J+$*Fj-Z*Nj)/(Vj+Fj-Nj),z=J-X,G=(o1[4]*(Z-X)-o1[2]*z)/o1[3],H={mode:"cubehelix",l:X,s:X===0||X===1?void 0:Math.sqrt(z*z+G*G)/(o1[4]*X*(1-X))};if(H.s)H.h=Math.atan2(G,z)*Uj-120;if(Q!==void 0)H.alpha=Q;return H},Lj=Ra;var ya=({h:$,s:Z,l:J,alpha:Q})=>{let X={mode:"rgb"};if($=($===void 0?0:$+120)*qj,J===void 0)J=0;let z=Z===void 0?0:Z*J*(1-J),G=Math.cos($),H=Math.sin($);if(X.r=J+z*(o1[0]*G+o1[1]*H),X.g=J+z*(o1[2]*G+o1[3]*H),X.b=J+z*(o1[4]*G+o1[5]*H),Q!==void 0)X.alpha=Q;return X},Mj=ya;var N6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let J=o5($.h),Q=o5(Z.h),X=Math.sin((Q-J+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*X},Aj=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let J=o5($.h),Q=o5(Z.h);if(Math.abs(Q-J)>180)return J-(Q-360*Math.sign(Q-J));return Q-J},V6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let J=o5($.h),Q=o5(Z.h),X=Math.sin((Q-J+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*X};var V8=($)=>{let Z=$.reduce((Q,X)=>{if(X!==void 0){let z=X*Math.PI/180;Q.sin+=Math.sin(z),Q.cos+=Math.cos(z)}return Q},{sin:0,cos:0}),J=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return J<0?360+J:J};var ba={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:Lj},toMode:{rgb:Mj},interpolate:{h:{use:O0,fixup:N8},s:O0,l:O0,alpha:{use:O0,fixup:L5}},difference:{h:N6},average:{h:V8}},_j=ba;var xa=({l:$,a:Z,b:J,alpha:Q},X="lch")=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let z=Math.sqrt(Z*Z+J*J),G={mode:X,l:$,c:z};if(z)G.h=o5(Math.atan2(J,Z)*180/Math.PI);if(Q!==void 0)G.alpha=Q;return G},S4=xa;var ha=({l:$,c:Z,h:J,alpha:Q},X="lab")=>{if(J===void 0)J=0;let z={mode:X,l:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(Q!==void 0)z.alpha=Q;return z},k4=ha;var DH=Math.pow(29,3)/Math.pow(3,3),OH=Math.pow(6,3)/Math.pow(29,3);var P1={X:0.9642956764295677,Y:1,Z:0.8251046025104602},L6={X:0.9504559270516716,Y:1,Z:1.0890577507598784},Tw0=Math.pow(29,3)/Math.pow(3,3),Cw0=Math.pow(6,3)/Math.pow(29,3);var SU=($)=>Math.pow($,3)>OH?Math.pow($,3):(116*$-16)/DH,ga=({l:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=($+16)/116,z=Z/500+X,G=X-J/200,H={mode:"xyz65",x:SU(z)*L6.X,y:SU(X)*L6.Y,z:SU(G)*L6.Z};if(Q!==void 0)H.alpha=Q;return H},PH=ga;var va=($)=>q4(PH($)),M6=va;var kU=($)=>$>OH?Math.cbrt($):(DH*$+16)/116,fa=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=kU($/L6.X),z=kU(Z/L6.Y),G=kU(J/L6.Z),H={mode:"lab65",l:116*z-16,a:500*(X-z),b:200*(z-G)};if(Q!==void 0)H.alpha=Q;return H},wH=fa;var ma=($)=>{let Z=wH(B4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},A6=ma;var _$=1,jH=1,i3=0.14444444444444443*Math.PI,D$=Math.cos(i3),O$=Math.sin(i3),TH=100/Math.log(1.39);var pa=({l:$,c:Z,h:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"lab65",l:(Math.exp($*_$/TH)-1)/0.0039},z=(Math.exp(0.0435*Z*jH*_$)-1)/0.075,G=z*Math.cos(J/180*Math.PI-i3),H=z*Math.sin(J/180*Math.PI-i3);if(X.a=G*D$-H/0.83*O$,X.b=G*O$+H/0.83*D$,Q!==void 0)X.alpha=Q;return X},KQ=pa;var ua=({l:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Z*D$+J*O$,z=0.83*(J*D$-Z*O$),G=Math.sqrt(X*X+z*z),H={mode:"dlch",l:TH/_$*Math.log(1+0.0039*$),c:Math.log(1+0.075*G)/(0.0435*jH*_$)};if(H.c)H.h=o5((Math.atan2(z,X)+i3)/Math.PI*180);if(Q!==void 0)H.alpha=Q;return H},WQ=ua;var Dj=($)=>KQ(S4($,"dlch")),Oj=($)=>k4(WQ($),"dlab"),ca={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Dj,rgb:($)=>M6(Dj($))},fromMode:{lab65:Oj,rgb:($)=>Oj(A6($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:O0,a:O0,b:O0,alpha:{use:O0,fixup:L5}}},Pj=ca;var da={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:KQ,dlab:($)=>k4($,"dlab"),rgb:($)=>M6(KQ($))},fromMode:{lab65:WQ,dlab:($)=>S4($,"dlch"),rgb:($)=>WQ(A6($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:O0,c:O0,h:{use:O0,fixup:N8},alpha:{use:O0,fixup:L5}},difference:{h:V6},average:{h:V8}},wj=da;function IU({h:$,s:Z,i:J,alpha:Q}){if($=o5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.abs($/60%2-1),z;switch(Math.floor($/60)){case 0:z={r:J*(1+Z*(3/(2-X)-1)),g:J*(1+Z*(3*(1-X)/(2-X)-1)),b:J*(1-Z)};break;case 1:z={r:J*(1+Z*(3*(1-X)/(2-X)-1)),g:J*(1+Z*(3/(2-X)-1)),b:J*(1-Z)};break;case 2:z={r:J*(1-Z),g:J*(1+Z*(3/(2-X)-1)),b:J*(1+Z*(3*(1-X)/(2-X)-1))};break;case 3:z={r:J*(1-Z),g:J*(1+Z*(3*(1-X)/(2-X)-1)),b:J*(1+Z*(3/(2-X)-1))};break;case 4:z={r:J*(1+Z*(3*(1-X)/(2-X)-1)),g:J*(1-Z),b:J*(1+Z*(3/(2-X)-1))};break;case 5:z={r:J*(1+Z*(3/(2-X)-1)),g:J*(1-Z),b:J*(1+Z*(3*(1-X)/(2-X)-1))};break;default:z={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(z.mode="rgb",Q!==void 0)z.alpha=Q;return z}function RU({r:$,g:Z,b:J,alpha:Q}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.max($,Z,J),z=Math.min($,Z,J),G={mode:"hsi",s:$+Z+J===0?0:1-3*z/($+Z+J),i:($+Z+J)/3};if(X-z!==0)G.h=(X===$?(Z-J)/(X-z)+(Z<J)*6:X===Z?(J-$)/(X-z)+2:($-Z)/(X-z)+4)*60;if(Q!==void 0)G.alpha=Q;return G}var la={mode:"hsi",toMode:{rgb:IU},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:RU},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:O0,fixup:N8},s:O0,i:O0,alpha:{use:O0,fixup:L5}},difference:{h:N6},average:{h:V8}},jj=la;function yU({h:$,s:Z,l:J,alpha:Q}){if($=o5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let X=J+Z*(J<0.5?J:1-J),z=X-(X-J)*2*Math.abs($/60%2-1),G;switch(Math.floor($/60)){case 0:G={r:X,g:z,b:2*J-X};break;case 1:G={r:z,g:X,b:2*J-X};break;case 2:G={r:2*J-X,g:X,b:z};break;case 3:G={r:2*J-X,g:z,b:X};break;case 4:G={r:z,g:2*J-X,b:X};break;case 5:G={r:X,g:2*J-X,b:z};break;default:G={r:2*J-X,g:2*J-X,b:2*J-X}}if(G.mode="rgb",Q!==void 0)G.alpha=Q;return G}function bU({r:$,g:Z,b:J,alpha:Q}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.max($,Z,J),z=Math.min($,Z,J),G={mode:"hsl",s:X===z?0:(X-z)/(1-Math.abs(X+z-1)),l:0.5*(X+z)};if(X-z!==0)G.h=(X===$?(Z-J)/(X-z)+(Z<J)*6:X===Z?(J-$)/(X-z)+2:($-Z)/(X-z)+4)*60;if(Q!==void 0)G.alpha=Q;return G}var ia=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},Tj=ia;var ra=new RegExp(`^hsla?\\(\\s*${$j}${F6}${l3}${F6}${l3}\\s*(?:,\\s*${GQ}\\s*)?\\)$`),aa=($)=>{let Z=$.match(ra);if(!Z)return;let J={mode:"hsl"};if(Z[3]!==void 0)J.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)J.h=Tj(Z[1],Z[2]);if(Z[4]!==void 0)J.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)J.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)J.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)J.alpha=Math.max(0,Math.min(1,+Z[7]));return J},Cj=aa;function na($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let J={mode:"hsl"},[,Q,X,z,G]=Z;if(Q.type!==_0.None){if(Q.type===_0.Percentage)return;J.h=Q.value}if(X.type!==_0.None){if(X.type===_0.Hue)return;J.s=X.value/100}if(z.type!==_0.None){if(z.type===_0.Hue)return;J.l=z.value/100}if(G.type!==_0.None)J.alpha=Math.min(1,Math.max(0,G.type===_0.Number?G.value:G.value/100));return J}var Ej=na;var oa={mode:"hsl",toMode:{rgb:yU},fromMode:{rgb:bU},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Ej,Cj],serialize:($)=>`hsl(${$.h!==void 0?$.h:"none"} ${$.s!==void 0?$.s*100+"%":"none"} ${$.l!==void 0?$.l*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:O0,fixup:N8},s:O0,l:O0,alpha:{use:O0,fixup:L5}},difference:{h:N6},average:{h:V8}},CH=oa;function BQ({h:$,s:Z,v:J,alpha:Q}){if($=o5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.abs($/60%2-1),z;switch(Math.floor($/60)){case 0:z={r:J,g:J*(1-Z*X),b:J*(1-Z)};break;case 1:z={r:J*(1-Z*X),g:J,b:J*(1-Z)};break;case 2:z={r:J*(1-Z),g:J,b:J*(1-Z*X)};break;case 3:z={r:J*(1-Z),g:J*(1-Z*X),b:J};break;case 4:z={r:J*(1-Z*X),g:J*(1-Z),b:J};break;case 5:z={r:J,g:J*(1-Z),b:J*(1-Z*X)};break;default:z={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(z.mode="rgb",Q!==void 0)z.alpha=Q;return z}function qQ({r:$,g:Z,b:J,alpha:Q}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.max($,Z,J),z=Math.min($,Z,J),G={mode:"hsv",s:X===0?0:1-z/X,v:X};if(X-z!==0)G.h=(X===$?(Z-J)/(X-z)+(Z<J)*6:X===Z?(J-$)/(X-z)+2:($-Z)/(X-z)+4)*60;if(Q!==void 0)G.alpha=Q;return G}var sa={mode:"hsv",toMode:{rgb:BQ},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:qQ},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:O0,fixup:N8},s:O0,v:O0,alpha:{use:O0,fixup:L5}},difference:{h:N6},average:{h:V8}},EH=sa;function xU({h:$,w:Z,b:J,alpha:Q}){if(Z===void 0)Z=0;if(J===void 0)J=0;if(Z+J>1){let X=Z+J;Z/=X,J/=X}return BQ({h:$,s:J===1?1:1-Z/(1-J),v:1-J,alpha:Q})}function hU($){let Z=qQ($);if(Z===void 0)return;let J=Z.s!==void 0?Z.s:0,Q=Z.v!==void 0?Z.v:0,X={mode:"hwb",w:(1-J)*Q,b:1-Q};if(Z.h!==void 0)X.h=Z.h;if(Z.alpha!==void 0)X.alpha=Z.alpha;return X}function ta($,Z){if(!Z||Z[0]!=="hwb")return;let J={mode:"hwb"},[,Q,X,z,G]=Z;if(Q.type!==_0.None){if(Q.type===_0.Percentage)return;J.h=Q.value}if(X.type!==_0.None){if(X.type===_0.Hue)return;J.w=X.value/100}if(z.type!==_0.None){if(z.type===_0.Hue)return;J.b=z.value/100}if(G.type!==_0.None)J.alpha=Math.min(1,Math.max(0,G.type===_0.Number?G.value:G.value/100));return J}var Sj=ta;var ea={mode:"hwb",toMode:{rgb:xU},fromMode:{rgb:hU},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Sj],serialize:($)=>`hwb(${$.h!==void 0?$.h:"none"} ${$.w!==void 0?$.w*100+"%":"none"} ${$.b!==void 0?$.b*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:O0,fixup:N8},w:O0,b:O0,alpha:{use:O0,fixup:L5}},difference:{h:Aj},average:{h:V8}},kj=ea;var SH=203;var kH=0.1593017578125;var IH=0.8359375,RH=18.8515625,yH=18.6875;function bH($){if($<0)return 0;let Z=Math.pow($,0.012683313515655966);return 1e4*Math.pow(Math.max(0,Z-0.8359375)/(18.8515625-18.6875*Z),6.277394636015326)}function xH($){if($<0)return 0;let Z=Math.pow($/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*Z)/(1+18.6875*Z),78.84375)}var gU=($)=>Math.max($/SH,0),$n=({i:$,t:Z,p:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=bH($+0.008609037037932761*Z+0.11102962500302593*J),z=bH($-0.00860903703793275*Z-0.11102962500302599*J),G=bH($+0.5600313357106791*Z-0.32062717498731885*J),H={mode:"xyz65",x:gU(2.070152218389422*X-1.3263473389671556*z+0.2066510476294051*G),y:gU(0.3647385209748074*X+0.680566024947227*z-0.0453045459220346*G),z:gU(-0.049747207535812*X-0.0492609666966138*z+1.1880659249923042*G)};if(Q!==void 0)H.alpha=Q;return H},vU=$n;var fU=($=0)=>Math.max($*SH,0),Zn=({x:$,y:Z,z:J,alpha:Q})=>{let X=fU($),z=fU(Z),G=fU(J),H=xH(0.3592832590121217*X+0.6976051147779502*z-0.0358915932320289*G),Y=xH(-0.1920808463704995*X+1.1004767970374323*z+0.0753748658519118*G),K=xH(0.0070797844607477*X+0.0748396662186366*z+0.8433265453898765*G),W=0.5*H+0.5*Y,B=1.61376953125*H-3.323486328125*Y+1.709716796875*K,q=4.378173828125*H-4.24560546875*Y-0.132568359375*K,U={mode:"itp",i:W,t:B,p:q};if(Q!==void 0)U.alpha=Q;return U},mU=Zn;var Jn={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:vU,rgb:($)=>q4(vU($))},fromMode:{xyz65:mU,rgb:($)=>mU(B4($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:O0,t:O0,p:O0,alpha:{use:O0,fixup:L5}}},Ij=Jn;var Qn=134.03437499999998,Xn=0.000000000016295499532821565,pU=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,kH);return Math.pow((IH+RH*Z)/(1+yH*Z),Qn)},uU=($=0)=>Math.max($*203,0),zn=({x:$,y:Z,z:J,alpha:Q})=>{$=uU($),Z=uU(Z),J=uU(J);let X=1.15*$-0.15*J,z=0.66*Z+0.34*$,G=pU(0.41478972*X+0.579999*z+0.014648*J),H=pU(-0.20151*X+1.120649*z+0.0531008*J),Y=pU(-0.0166008*X+0.2648*z+0.6684799*J),K=(G+H)/2,W={mode:"jab",j:0.44*K/(1-0.56*K)-Xn,a:3.524*G-4.066708*H+0.542708*Y,b:0.199076*G+1.096799*H-1.295875*Y};if(Q!==void 0)W.alpha=Q;return W},hH=zn;var Gn=134.03437499999998,Rj=0.000000000016295499532821565,cU=($)=>{if($<0)return 0;let Z=Math.pow($,1/Gn);return 1e4*Math.pow((IH-Z)/(yH*Z-RH),1/kH)},dU=($)=>$/203,Hn=({j:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=($+Rj)/(0.44+0.56*($+Rj)),z=cU(X+0.13860504*Z+0.058047316*J),G=cU(X-0.13860504*Z-0.058047316*J),H=cU(X-0.096019242*Z-0.8118919*J),Y={mode:"xyz65",x:dU(1.661373024652174*z-0.914523081304348*G+0.23136208173913045*H),y:dU(-0.3250758611844533*z+1.571847026732543*G-0.21825383453227928*H),z:dU(-0.090982811*z-0.31272829*G+1.5227666*H)};if(Q!==void 0)Y.alpha=Q;return Y},gH=Hn;var Yn=($)=>{let Z=hH(B4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},vH=Yn;var Kn=($)=>q4(gH($)),fH=Kn;var Wn={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:vH,xyz65:hH},toMode:{rgb:fH,xyz65:gH},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:O0,a:O0,b:O0,alpha:{use:O0,fixup:L5}}},yj=Wn;var Bn=({j:$,a:Z,b:J,alpha:Q})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.sqrt(Z*Z+J*J),z={mode:"jch",j:$,c:X};if(X)z.h=o5(Math.atan2(J,Z)*180/Math.PI);if(Q!==void 0)z.alpha=Q;return z},lU=Bn;var qn=({j:$,c:Z,h:J,alpha:Q})=>{if(J===void 0)J=0;let X={mode:"jab",j:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(Q!==void 0)X.alpha=Q;return X},iU=qn;var Un={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:iU,rgb:($)=>fH(iU($))},fromMode:{rgb:($)=>lU(vH($)),jab:lU},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:O0,fixup:N8},c:O0,j:O0,alpha:{use:O0,fixup:L5}},difference:{h:V6},average:{h:V8}},bj=Un;var _6=Math.pow(29,3)/Math.pow(3,3),P$=Math.pow(6,3)/Math.pow(29,3);var rU=($)=>Math.pow($,3)>P$?Math.pow($,3):(116*$-16)/_6,Fn=({l:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=($+16)/116,z=Z/500+X,G=X-J/200,H={mode:"xyz50",x:rU(z)*P1.X,y:rU(X)*P1.Y,z:rU(G)*P1.Z};if(Q!==void 0)H.alpha=Q;return H},w$=Fn;var Nn=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=e4({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*J,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*J,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*J});if(Q!==void 0)X.alpha=Q;return X},J9=Nn;var Vn=($)=>J9(w$($)),mH=Vn;var Ln=($)=>{let{r:Z,g:J,b:Q,alpha:X}=t4($),z={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*J+0.14307845442264197*Q,y:0.22249319175623702*Z+0.7168870538238823*J+0.06061979053616537*Q,z:0.013923904500943465*Z+0.09708128566574634*J+0.7140993584005155*Q};if(X!==void 0)z.alpha=X;return z},Q9=Ln;var aU=($)=>$>P$?Math.cbrt($):(_6*$+16)/116,Mn=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=aU($/P1.X),z=aU(Z/P1.Y),G=aU(J/P1.Z),H={mode:"lab",l:116*z-16,a:500*(X-z),b:200*(z-G)};if(Q!==void 0)H.alpha=Q;return H},j$=Mn;var An=($)=>{let Z=j$(Q9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},pH=An;function _n($,Z){if(!Z||Z[0]!=="lab")return;let J={mode:"lab"},[,Q,X,z,G]=Z;if(Q.type===_0.Hue||X.type===_0.Hue||z.type===_0.Hue)return;if(Q.type!==_0.None)J.l=Math.min(Math.max(0,Q.value),100);if(X.type!==_0.None)J.a=X.type===_0.Number?X.value:X.value*125/100;if(z.type!==_0.None)J.b=z.type===_0.Number?z.value:z.value*125/100;if(G.type!==_0.None)J.alpha=Math.min(1,Math.max(0,G.type===_0.Number?G.value:G.value/100));return J}var xj=_n;var Dn={mode:"lab",toMode:{xyz50:w$,rgb:mH},fromMode:{xyz50:j$,rgb:pH},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[xj],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:O0,a:O0,b:O0,alpha:{use:O0,fixup:L5}}},T$=Dn;var On={...T$,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:PH,rgb:M6},fromMode:{xyz65:wH,rgb:A6},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},hj=On;function Pn($,Z){if(!Z||Z[0]!=="lch")return;let J={mode:"lch"},[,Q,X,z,G]=Z;if(Q.type!==_0.None){if(Q.type===_0.Hue)return;J.l=Math.min(Math.max(0,Q.value),100)}if(X.type!==_0.None)J.c=Math.max(0,X.type===_0.Number?X.value:X.value*150/100);if(z.type!==_0.None){if(z.type===_0.Percentage)return;J.h=z.value}if(G.type!==_0.None)J.alpha=Math.min(1,Math.max(0,G.type===_0.Number?G.value:G.value/100));return J}var gj=Pn;var wn={mode:"lch",toMode:{lab:k4,rgb:($)=>mH(k4($))},fromMode:{rgb:($)=>S4(pH($)),lab:S4},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[gj],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:O0,fixup:N8},c:O0,l:O0,alpha:{use:O0,fixup:L5}},difference:{h:V6},average:{h:V8}},C$=wn;var jn={...C$,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>k4($,"lab65"),rgb:($)=>M6(k4($,"lab65"))},fromMode:{rgb:($)=>S4(A6($),"lch65"),lab65:($)=>S4($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},vj=jn;var Tn=({l:$,u:Z,v:J,alpha:Q})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.sqrt(Z*Z+J*J),z={mode:"lchuv",l:$,c:X};if(X)z.h=o5(Math.atan2(J,Z)*180/Math.PI);if(Q!==void 0)z.alpha=Q;return z},nU=Tn;var Cn=({l:$,c:Z,h:J,alpha:Q})=>{if(J===void 0)J=0;let X={mode:"luv",l:$,u:Z?Z*Math.cos(J/180*Math.PI):0,v:Z?Z*Math.sin(J/180*Math.PI):0};if(Q!==void 0)X.alpha=Q;return X},oU=Cn;var fj=($,Z,J)=>4*$/($+15*Z+3*J),mj=($,Z,J)=>9*Z/($+15*Z+3*J),En=fj(P1.X,P1.Y,P1.Z),Sn=mj(P1.X,P1.Y,P1.Z),kn=($)=>$<=P$?_6*$:116*Math.cbrt($)-16,In=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=kn(Z/P1.Y),z=fj($,Z,J),G=mj($,Z,J);if(!isFinite(z)||!isFinite(G))X=z=G=0;else z=13*X*(z-En),G=13*X*(G-Sn);let H={mode:"luv",l:X,u:z,v:G};if(Q!==void 0)H.alpha=Q;return H},UQ=In;var Rn=($,Z,J)=>4*$/($+15*Z+3*J),yn=($,Z,J)=>9*Z/($+15*Z+3*J),bn=Rn(P1.X,P1.Y,P1.Z),xn=yn(P1.X,P1.Y,P1.Z),hn=({l:$,u:Z,v:J,alpha:Q})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Z/(13*$)+bn,z=J/(13*$)+xn,G=P1.Y*($<=8?$/_6:Math.pow(($+16)/116,3)),H=G*(9*X)/(4*z),Y=G*(12-3*X-20*z)/(4*z),K={mode:"xyz50",x:H,y:G,z:Y};if(Q!==void 0)K.alpha=Q;return K},FQ=hn;var gn=($)=>nU(UQ(Q9($))),vn=($)=>J9(FQ(oU($))),fn={mode:"lchuv",toMode:{luv:oU,rgb:vn},fromMode:{rgb:gn,luv:nU},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:O0,fixup:N8},c:O0,l:O0,alpha:{use:O0,fixup:L5}},difference:{h:V6},average:{h:V8}},pj=fn;var mn={...s4,mode:"lrgb",toMode:{rgb:e4},fromMode:{rgb:t4},parse:["srgb-linear"],serialize:"srgb-linear"},uj=mn;var pn={mode:"luv",toMode:{xyz50:FQ,rgb:($)=>J9(FQ($))},fromMode:{xyz50:UQ,rgb:($)=>UQ(Q9($))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:O0,u:O0,v:O0,alpha:{use:O0,fixup:L5}}},cj=pn;var un=({r:$,g:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*J),z=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*J),G=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*J),H={mode:"oklab",l:0.210454268309314*X+0.7936177747023054*z-0.0040720430116193*G,a:1.9779985324311684*X-2.42859224204858*z+0.450593709617411*G,b:0.0259040424655478*X+0.7827717124575296*z-0.8086757549230774*G};if(Q!==void 0)H.alpha=Q;return H},uH=un;var cn=($)=>{let Z=uH(t4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},D6=cn;var dn=({l:$,a:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=Math.pow($+0.3963377773761749*Z+0.2158037573099136*J,3),z=Math.pow($-0.1055613458156586*Z-0.0638541728258133*J,3),G=Math.pow($-0.0894841775298119*Z-1.2914855480194092*J,3),H={mode:"lrgb",r:4.076741636075957*X-3.3077115392580616*z+0.2309699031821044*G,g:-1.2684379732850317*X+2.6097573492876887*z-0.3413193760026573*G,b:-0.0041960761386756*X-0.7034186179359362*z+1.7076146940746117*G};if(Q!==void 0)H.alpha=Q;return H},X9=dn;var ln=($)=>e4(X9($)),O6=ln;function NQ($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function r3($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function rn($,Z){let J,Q,X,z,G,H,Y,K;if(-1.88170328*$-0.80936493*Z>1)J=1.19086277,Q=1.76576728,X=0.59662641,z=0.75515197,G=0.56771245,H=4.0767416621,Y=-3.3077115913,K=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)J=0.73956515,Q=-0.45954404,X=0.08285427,z=0.1254107,G=0.14503204,H=-1.2684380046,Y=2.6097574011,K=-0.3413193965;else J=1.35733652,Q=-0.00915799,X=-1.1513021,z=-0.50559606,G=0.00692167,H=-0.0041960863,Y=-0.7034186147,K=1.707614701;let W=J+Q*$+X*Z+z*$*$+G*$*Z,B=0.3963377774*$+0.2158037573*Z,q=-0.1055613458*$-0.0638541728*Z,U=-0.0894841775*$-1.291485548*Z;{let F=1+W*B,N=1+W*q,L=1+W*U,V=F*F*F,M=N*N*N,_=L*L*L,O=3*B*F*F,D=3*q*N*N,A=3*U*L*L,C=6*B*B*F,I=6*q*q*N,y=6*U*U*L,E=H*V+Y*M+K*_,h=H*O+Y*D+K*A,k=H*C+Y*I+K*y;W=W-E*h/(h*h-0.5*E*k)}return W}function sU($,Z){let J=rn($,Z),Q=X9({l:1,a:J*$,b:J*Z}),X=Math.cbrt(1/Math.max(Q.r,Q.g,Q.b)),z=X*J;return[X,z]}function an($,Z,J,Q,X,z=null){if(!z)z=sU($,Z);let G;if((J-X)*z[1]-(z[0]-X)*Q<=0)G=z[1]*X/(Q*z[0]+z[1]*(X-J));else{G=z[1]*(X-1)/(Q*(z[0]-1)+z[1]*(X-J));{let H=J-X,Y=Q,K=0.3963377774*$+0.2158037573*Z,W=-0.1055613458*$-0.0638541728*Z,B=-0.0894841775*$-1.291485548*Z,q=H+Y*K,U=H+Y*W,F=H+Y*B;{let N=X*(1-G)+G*J,L=G*Q,V=N+L*K,M=N+L*W,_=N+L*B,O=V*V*V,D=M*M*M,A=_*_*_,C=3*q*V*V,I=3*U*M*M,y=3*F*_*_,E=6*q*q*V,h=6*U*U*M,k=6*F*F*_,S=4.0767416621*O-3.3077115913*D+0.2309699292*A-1,w=4.0767416621*C-3.3077115913*I+0.2309699292*y,T=4.0767416621*E-3.3077115913*h+0.2309699292*k,R=w/(w*w-0.5*S*T),b=-S*R,g=-1.2684380046*O+2.6097574011*D-0.3413193965*A-1,u=-1.2684380046*C+2.6097574011*I-0.3413193965*y,j=-1.2684380046*E+2.6097574011*h-0.3413193965*k,e=u/(u*u-0.5*g*j),t=-g*e,x=-0.0041960863*O-0.7034186147*D+1.707614701*A-1,$0=-0.0041960863*C-0.7034186147*I+1.707614701*y,M0=-0.0041960863*E-0.7034186147*h+1.707614701*k,l=$0/($0*$0-0.5*x*M0),H0=-x*l;b=R>=0?b:1e6,t=e>=0?t:1e6,H0=l>=0?H0:1e6,G+=Math.min(b,Math.min(t,H0))}}}return G}function VQ($,Z,J=null){if(!J)J=sU($,Z);let Q=J[0],X=J[1];return[X/Q,X/(1-Q)]}function cH($,Z,J){let Q=sU(Z,J),X=an(Z,J,$,1,$,Q),z=VQ(Z,J,Q),G=0.11516993+1/(7.4477897+4.1590124*J+Z*(-2.19557347+1.75198401*J+Z*(-2.13704948-10.02301043*J+Z*(-4.24894561+5.38770819*J+4.69891013*Z)))),H=0.11239642+1/(1.6132032-0.68124379*J+Z*(0.40370612+0.90148123*J+Z*(-0.27087943+0.6122399*J+Z*(0.00299215-0.45399568*J-0.14661872*Z)))),Y=X/Math.min($*z[0],(1-$)*z[1]),K=$*G,W=(1-$)*H,B=0.9*Y*Math.sqrt(Math.sqrt(1/(1/(K*K*K*K)+1/(W*W*W*W))));return K=$*0.4,W=(1-$)*0.8,[Math.sqrt(1/(1/(K*K)+1/(W*W))),B,X]}function dH($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,Q=$.b!==void 0?$.b:0,X={mode:"okhsl",l:NQ(Z)};if($.alpha!==void 0)X.alpha=$.alpha;let z=Math.sqrt(J*J+Q*Q);if(!z)return X.s=0,X;let[G,H,Y]=cH(Z,J/z,Q/z),K;if(z<H){let W=0,B=0.8*G,q=1-B/H;K=(z-W)/(B+q*(z-W))*0.8}else{let W=H,B=0.2*H*H*1.25*1.25/G,q=1-B/(Y-H);K=0.8+0.2*((z-W)/(B+q*(z-W)))}if(K)X.s=K,X.h=o5(Math.atan2(Q,J)*180/Math.PI);return X}function lH($){let Z=$.h!==void 0?$.h:0,J=$.s!==void 0?$.s:0,Q=$.l!==void 0?$.l:0,X={mode:"oklab",l:r3(Q)};if($.alpha!==void 0)X.alpha=$.alpha;if(!J||Q===1)return X.a=X.b=0,X;let z=Math.cos(Z/180*Math.PI),G=Math.sin(Z/180*Math.PI),[H,Y,K]=cH(X.l,z,G),W,B,q,U;if(J<0.8)W=1.25*J,B=0,q=0.8*H,U=1-q/Y;else W=5*(J-0.8),B=Y,q=0.2*Y*Y*1.25*1.25/H,U=1-q/(K-Y);let F=B+W*q/(1-U*W);return X.a=F*z,X.b=F*G,X}var nn={...CH,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:dH,rgb:($)=>dH(D6($))},toMode:{oklab:lH,rgb:($)=>O6(lH($))}},dj=nn;function iH($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,Q=$.b!==void 0?$.b:0,X=Math.sqrt(J*J+Q*Q),z=X?J/X:1,G=X?Q/X:1,[H,Y]=VQ(z,G),K=0.5,W=1-K/H,B=Y/(X+Z*Y),q=B*Z,U=B*X,F=r3(q),N=U*F/q,L=X9({l:F,a:z*N,b:G*N}),V=Math.cbrt(1/Math.max(L.r,L.g,L.b,0));Z=Z/V,X=X/V*NQ(Z)/Z,Z=NQ(Z);let M={mode:"okhsv",s:X?(K+Y)*U/(Y*K+Y*W*U):0,v:Z?Z/q:0};if(M.s)M.h=o5(Math.atan2(Q,J)*180/Math.PI);if($.alpha!==void 0)M.alpha=$.alpha;return M}function rH($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let J=$.h!==void 0?$.h:0,Q=$.s!==void 0?$.s:0,X=$.v!==void 0?$.v:0,z=Math.cos(J/180*Math.PI),G=Math.sin(J/180*Math.PI),[H,Y]=VQ(z,G),K=0.5,W=1-K/H,B=1-Q*K/(K+Y-Y*W*Q),q=Q*Y*K/(K+Y-Y*W*Q),U=r3(B),F=q*U/B,N=X9({l:U,a:z*F,b:G*F}),L=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),V=r3(X*B),M=q*V/B;return Z.l=V*L,Z.a=M*z*L,Z.b=M*G*L,Z}var on={...EH,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:iH,rgb:($)=>iH(D6($))},toMode:{oklab:rH,rgb:($)=>O6(rH($))}},lj=on;function sn($,Z){if(!Z||Z[0]!=="oklab")return;let J={mode:"oklab"},[,Q,X,z,G]=Z;if(Q.type===_0.Hue||X.type===_0.Hue||z.type===_0.Hue)return;if(Q.type!==_0.None)J.l=Math.min(Math.max(0,Q.type===_0.Number?Q.value:Q.value/100),1);if(X.type!==_0.None)J.a=X.type===_0.Number?X.value:X.value*0.4/100;if(z.type!==_0.None)J.b=z.type===_0.Number?z.value:z.value*0.4/100;if(G.type!==_0.None)J.alpha=Math.min(1,Math.max(0,G.type===_0.Number?G.value:G.value/100));return J}var ij=sn;var tn={...T$,mode:"oklab",toMode:{lrgb:X9,rgb:O6},fromMode:{lrgb:uH,rgb:D6},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[ij],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},rj=tn;function en($,Z){if(!Z||Z[0]!=="oklch")return;let J={mode:"oklch"},[,Q,X,z,G]=Z;if(Q.type!==_0.None){if(Q.type===_0.Hue)return;J.l=Math.min(Math.max(0,Q.type===_0.Number?Q.value:Q.value/100),1)}if(X.type!==_0.None)J.c=Math.max(0,X.type===_0.Number?X.value:X.value*0.4/100);if(z.type!==_0.None){if(z.type===_0.Percentage)return;J.h=z.value}if(G.type!==_0.None)J.alpha=Math.min(1,Math.max(0,G.type===_0.Number?G.value:G.value/100));return J}var aj=en;var $o={...C$,mode:"oklch",toMode:{oklab:($)=>k4($,"oklab"),rgb:($)=>O6(k4($,"oklab"))},fromMode:{rgb:($)=>S4(D6($),"oklch"),oklab:($)=>S4($,"oklch")},parse:[aj],serialize:($)=>`oklch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,ranges:{l:[0,1],c:[0,0.4],h:[0,360]}},nj=$o;var Zo=($)=>{let{r:Z,g:J,b:Q,alpha:X}=t4($),z={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*J+0.1982172852343625*Q,y:0.2289745640697487*Z+0.6917385218365062*J+0.079286914093745*Q,z:0*Z+0.0451133818589026*J+1.043944368900976*Q};if(X!==void 0)z.alpha=X;return z},tU=Zo;var Jo=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=e4({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*J,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*J,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*J},"p3");if(Q!==void 0)X.alpha=Q;return X},eU=Jo;var Qo={...s4,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>eU(B4($)),xyz65:eU},toMode:{rgb:($)=>q4(tU($)),xyz65:tU}},oj=Qo;var $F=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},Xo=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"prophoto",r:$F($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*J),g:$F($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*J),b:$F($*0+Z*0+1.2119675456389452*J)};if(Q!==void 0)X.alpha=Q;return X},ZF=Xo;var JF=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},zo=($)=>{let Z=JF($.r),J=JF($.g),Q=JF($.b),X={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*J+0.0313477341283922*Q,y:0.2880748288194013*Z+0.7118352342418731*J+0.0000899369387256*Q,z:0*Z+0*J+0.8251046025104602*Q};if($.alpha!==void 0)X.alpha=$.alpha;return X},QF=zo;var Go={...s4,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:ZF,rgb:($)=>ZF(Q9($))},toMode:{xyz50:QF,rgb:($)=>J9(QF($))}},sj=Go;var XF=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},Ho=({x:$,y:Z,z:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"rec2020",r:XF($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*J),g:XF($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*J),b:XF($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*J)};if(Q!==void 0)X.alpha=Q;return X},zF=Ho;var GF=($=0)=>{let Z=Math.abs($);if(Z<0.08124285829863151)return $/4.5;return(Math.sign($)||1)*Math.pow((Z+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},Yo=($)=>{let Z=GF($.r),J=GF($.g),Q=GF($.b),X={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*J+0.1688809751641721*Q,y:0.262700212011267*Z+0.6779980715188708*J+0.059301716469862*Q,z:0*Z+0.0280726930490874*J+1.0609850577107909*Q};if($.alpha!==void 0)X.alpha=$.alpha;return X},HF=Yo;var Ko={...s4,mode:"rec2020",fromMode:{xyz65:zF,rgb:($)=>zF(B4($))},toMode:{xyz65:HF,rgb:($)=>q4(HF($))},parse:["rec2020"],serialize:"rec2020"},tj=Ko;var P6=0.0037930732552754493,aH=Math.cbrt(0.0037930732552754493);var YF=($)=>Math.cbrt($)-aH,Wo=($)=>{let{r:Z,g:J,b:Q,alpha:X}=t4($),z=YF(0.3*Z+0.622*J+0.078*Q+P6),G=YF(0.23*Z+0.692*J+0.078*Q+P6),H=YF(0.2434226892454782*Z+0.2047674442449682*J+0.5518098665095535*Q+P6),Y={mode:"xyb",x:(z-G)/2,y:(z+G)/2,b:H-(z+G)/2};if(X!==void 0)Y.alpha=X;return Y},ej=Wo;var KF=($)=>Math.pow($+aH,3),Bo=({x:$,y:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X=KF($+Z)-P6,z=KF(Z-$)-P6,G=KF(J+Z)-P6,H=e4({r:11.031566904639861*X-9.866943908131562*z-0.16462299650829934*G,g:-3.2541473810744237*X+4.418770377582723*z-0.16462299650829934*G,b:-3.6588512867136815*X+2.7129230459360922*z+1.9459282407775895*G});if(Q!==void 0)H.alpha=Q;return H},$T=Bo;var qo={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:$T},fromMode:{rgb:ej},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:O0,y:O0,b:O0,alpha:{use:O0,fixup:L5}}},ZT=qo;var Uo={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:J9,lab:j$},fromMode:{rgb:Q9,lab:w$},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:O0,y:O0,z:O0,alpha:{use:O0,fixup:L5}}},JT=Uo;var Fo=($)=>{let{x:Z,y:J,z:Q,alpha:X}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(Q===void 0)Q=0;let z={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*J-0.0501922295431356*Q,y:0.0296278156881593*Z+0.990434484573249*J-0.0170738250293851*Q,z:-0.0092430581525912*Z+0.0150551448965779*J+0.7518742899580008*Q};if(X!==void 0)z.alpha=X;return z},QT=Fo;var No=($)=>{let{x:Z,y:J,z:Q,alpha:X}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(Q===void 0)Q=0;let z={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*J+0.0632593086610217*Q,y:-0.0283697069632081*Z+1.0099954580058226*J+0.021041398966943*Q,z:0.0123140016883199*Z-0.0205076964334779*J+1.3303659366080753*Q};if(X!==void 0)z.alpha=X;return z},XT=No;var Vo={mode:"xyz65",toMode:{rgb:q4,xyz50:QT},fromMode:{rgb:B4,xyz50:XT},ranges:{x:[0,0.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:O0,y:O0,z:O0,alpha:{use:O0,fixup:L5}}},zT=Vo;var Lo=({r:$,g:Z,b:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*J,i:0.59597799*$-0.2741761*Z-0.32180189*J,q:0.21147017*$-0.52261711*Z+0.31114694*J};if(Q!==void 0)X.alpha=Q;return X},GT=Lo;var Mo=({y:$,i:Z,q:J,alpha:Q})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let X={mode:"rgb",r:$+0.95608445*Z+0.6208885*J,g:$-0.27137664*Z-0.6486059*J,b:$-1.10561724*Z+1.70250126*J};if(Q!==void 0)X.alpha=Q;return X},HT=Mo;var Ao={mode:"yiq",toMode:{rgb:HT},fromMode:{rgb:GT},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:O0,i:O0,q:O0,alpha:{use:O0,fixup:L5}}},YT=Ao;function WF($){let Z=LH("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var OI0=f5(Bj),PI0=f5(_j),wI0=f5(Pj),jI0=f5(wj),TI0=f5(jj),CI0=f5(CH),EI0=f5(EH),SI0=f5(kj),kI0=f5(Ij),II0=f5(yj),RI0=f5(bj),yI0=f5(T$),bI0=f5(hj),xI0=f5(C$),hI0=f5(vj),gI0=f5(pj),vI0=f5(uj),fI0=f5(cj),mI0=f5(dj),pI0=f5(lj),uI0=f5(rj),cI0=f5(nj),dI0=f5(oj),lI0=f5(sj),iI0=f5(tj),rI0=f5(s4),aI0=f5(ZT),nI0=f5(JT),oI0=f5(zT),sI0=f5(YT);var w6={sans:{label:"Sans",sans:"system-ui",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"},serif:{label:"Serif",sans:"Literata",mono:"Geist Mono",googleFontsQuery:"Literata:wght@400;600;700&family=Geist+Mono:wght@400;500"},mono:{label:"Mono",sans:"Geist Mono",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500;600"},geometric:{label:"Geometric",sans:"Manrope",mono:"Geist Mono",googleFontsQuery:"Manrope:wght@400;500;600&family=Geist+Mono:wght@400;500"},rounded:{label:"Rounded",sans:"SN Pro",mono:"Geist Mono",googleFontsQuery:"SN+Pro:wght@400;500;600&family=Geist+Mono:wght@400;500"},blobby:{label:"Blobby",sans:"Sour Gummy",mono:"Azeret Mono",googleFontsQuery:"Sour+Gummy:wght@400;500;600&family=Azeret+Mono:wght@400;500"},awkward:{label:"Awkward",sans:"Averia Sans Libre",mono:"Azeret Mono",googleFontsQuery:"Averia+Sans+Libre:wght@400;500;600&family=Azeret+Mono:wght@400;500"},comic:{label:"Comic",sans:"Comic Sans MS, Comic Sans, cursive",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"}},LQ={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},WT="oklch(0.205 0 0)";function KT($){return WF($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var BT={workspace:{primary:($)=>$,primaryForeground:($)=>KT($),background:()=>"color-mix(in oklch, var(--primary) 3%, oklch(1 0 0) 97%)",foreground:()=>"color-mix(var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in oklch, var(--background) 97%, var(--foreground) 3%)",mutedForeground:()=>"color-mix(var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in oklch, var(--primary) 4%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in oklch, var(--foreground) 7%, transparent)"},widget:{background:($)=>$,foreground:($)=>KT($),primary:()=>"color-mix(in oklch, var(--background) 3%, oklch(1 0 0) 97%)",primaryForeground:()=>"color-mix(var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in oklch, var(--background) 97%, var(--foreground) 3%)",mutedForeground:()=>"color-mix(var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in oklch, var(--primary) 4%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in oklch, var(--foreground) 15%, transparent)"}},BF=Object.keys(BT.workspace);function qT($,Z="workspace"){let J={},Q=BT[Z];for(let X of BF)J[X]=Q[X]($);return J}var MQ={default:{label:"Default"},paper:{label:"Paper",primary:"oklch(0.4328 0.0351 66.67)"},rose:{label:"Rose",primary:"oklch(0.6322 0.2171 26.02)"},tangerine:{label:"Tangerine",primary:"oklch(0.6886 0.22 37.15)"},sand:{label:"Sand",primary:"oklch(0.8334 0.1271 67.80)"},mint:{label:"Tropics",primary:"oklch(0.5774 0.1399 156.06)"},sky:{label:"Sky",primary:"oklch(0.5824 0.1830 253.59)"},lavender:{label:"Lavender",primary:"oklch(0.6025 0.2426 294.58)"}},a3={font:"sans",color:"default",radius:"soft"};function n3($){return{...a3,...$}}var qF="moi-fonts",UT="moi-font-previews",_o=Object.values(w6).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),NT=[["sans","--sans"],["mono","--mono"]],VT=BF.map(($)=>[$,Do($)]),LT="--radius",FT=[...NT.map(([,$])=>$),...VT.map(([,$])=>$),LT];function Do($){return`--${$.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}`}function Oo($){let Z={},J=n3($),Q=w6[J.font]??w6[a3.font];for(let[X,z]of NT)Z[z]=Q[X];return Z}function UF($,Z="workspace"){let J={},Q=n3($),z=(MQ[Q.color]??MQ[a3.color]).primary??(Z==="widget"?WT:void 0),G=z?qT(z,Z):void 0;for(let[H,Y]of VT)J[Y]=G?.[H];return J}function Po($){let Z={},J=n3($),Q=LQ[J.radius]??LQ[a3.radius];return Z[LT]=Q.radius,Z}function z9($,Z="workspace"){return{...Oo($),...UF($,Z),...Po($)}}function oH(){nH.useEffect(()=>{if(document.getElementById(UT))return;let $=document.createElement("link");return $.id=UT,$.rel="stylesheet",$.href=`https://fonts.googleapis.com/css2?family=${_o}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function wo($){nH.useEffect(()=>{let Z=document.documentElement,J=z9($);for(let Q of FT){let X=J[Q];if(X)Z.style.setProperty(Q,X);else Z.style.removeProperty(Q)}return()=>{for(let Q of FT)Z.style.removeProperty(Q)}},[$])}function MT($){let{font:Z}=n3($);wo($),nH.useEffect(()=>{let J=w6[Z]??w6[a3.font],Q=document.getElementById(qF);if(!J.googleFontsQuery)Q?.remove();else{let X=`https://fonts.googleapis.com/css2?family=${J.googleFontsQuery}&display=swap`;if(Q)Q.href=X;else{let z=document.createElement("link");z.id=qF,z.rel="stylesheet",z.href=X,document.head.appendChild(z)}}return()=>{document.getElementById(qF)?.remove()}},[Z])}var E$=P(v(),1);var L8=P(c(),1),AQ={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function jo($){let{width:Z,height:J,radius:Q,topLeftRadius:X,bodyTop:z,tabEnd:G,shoulder:H}=AQ,Y=Math.min(Z/2,Q*$),K=Math.min(Z/2,X*$),W=Math.max(0,H.width),B=G+W,q=Math.max(0,Math.min(H.roundness,W/2));return[`M ${K} 0`,`H ${G}`,`C ${G+q} 0 ${B-q} ${z} ${B} ${z}`,`H ${Z-Y}`,`Q ${Z} ${z} ${Z} ${z+Q}`,`V ${J-Q}`,`Q ${Z} ${J} ${Z-Y} ${J}`,`H ${Y}`,`Q 0 ${J} 0 ${J-Q}`,`V ${X}`,`Q 0 0 ${K} 0`,"Z"].join(" ")}function To(){let $=E$.useRef(null),[Z,J]=E$.useState(1);return E$.useLayoutEffect(()=>{let Q=$.current;if(!Q)return;let X=(H,Y)=>{if(H<=0||Y<=0)return;let K=H/AQ.width,B=Y/AQ.height/K;J((q)=>Math.abs(q-B)<0.001?q:B)},z=Q.getBoundingClientRect();X(z.width,z.height);let G=new ResizeObserver(([H])=>{if(H)X(H.contentRect.width,H.contentRect.height)});return G.observe(Q),()=>G.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var sH=[s("opacity-40","-translate-x-3 translate-y-3 -rotate-6","group-hover:translate-y-2 group-focus-visible:translate-y-2"),s("opacity-50","translate-x-3 translate-y-2 rotate-5","group-hover:translate-y-1 group-focus-visible:translate-y-1"),s("opacity-100","-translate-x-1 translate-y-1 -rotate-2","group-hover:-translate-y-2 group-focus-visible:-translate-y-2")];function AT({workspaceId:$}){let Z=NG($),J=Z.data?[...Z.data.thumbnails].reverse():[],Q=sH.slice(sH.length-J.length),X=Z.data?.firstUserMessage,z=Z.data?.theme,{ref:G,horizontalRadiusScale:H}=To(),Y=jo(H),K=`folder-noise-${$}`,W=z9(z),B=UF(z);return L8.jsxs("div",{ref:G,style:B,className:"relative h-45 w-full",children:[L8.jsxs("svg",{viewBox:`0 0 ${AQ.width} ${AQ.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[L8.jsx("defs",{children:L8.jsxs("filter",{id:K,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[L8.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),L8.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),L8.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:L8.jsx("feFuncA",{type:"linear",slope:"0.24"})}),L8.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),L8.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),L8.jsx("path",{d:Y,filter:`url(#${K})`,className:"fill-accent"})]}),J.map((q,U)=>L8.jsx("img",{src:q,alt:"",loading:"lazy",className:s("absolute top-[12%] left-[14%] h-auto max-h-[72%] w-auto max-w-[72%] rounded-[calc(var(--radius-2xl)*0.4)] bg-background object-contain shadow-xs [corner-shape:superellipse(1.2)]","animate-in transition-transform duration-300 ease-out fade-in",Q[U])},U)),J.length===0&&X&&L8.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:L8.jsx("div",{"aria-hidden":"true",style:W,className:s("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs","animate-in transition-transform duration-300 ease-out fade-in",sH[sH.length-1],"group-hover:translate-y-0.5 group-focus-visible:translate-y-0.5"),children:L8.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:X})})}),L8.jsx("div",{className:s("absolute inset-x-2 top-[40%] bottom-2 rounded-2xl bg-[color-mix(in_oklch,var(--accent),var(--foreground)_5%)]","mask-[linear-gradient(to_bottom,rgba(0,0,0,0.9)_0%,black_50%)] backdrop-blur-lg","inset-shadow-[0_0_12px_color-mix(in_oklab,var(--background)_20%,transparent)]")})]})}var X5=P(c(),1);function OT(){oH();let[,$]=f4(),Z=FG(),J=hO(),Q=VG(),X=hw({onSuccess:(F)=>$(`/workspace/${F.id}`)}),z=W$(),[G,H]=DT.useState(!1),Y=O1((F)=>F.discoveredWorkspacesOpen),K=O1((F)=>F.setDiscoveredWorkspacesOpen);if(Z.isPending||J.isPending)return X5.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:X5.jsx(E1,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||J.isError)return X5.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:X5.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let W=Z.data,B=J.data,q=W.length;function U(F){if(z.cloudDemo){H(!0);return}X.startImport(F)}return X5.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[X5.jsx(mw,{className:"mb-10"}),q>0?X5.jsxs("section",{className:"mb-12",children:[X5.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[X5.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),X5.jsx(pJ,{trigger:X5.jsxs(C0,{variant:"outline",size:"sm",children:[X5.jsx(W4,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),X5.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:W.map((F)=>X5.jsx(Co,{workspace:F},F.id))})]}):X5.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[X5.jsx(_T,{size:32,stroke:1.5,className:"text-muted-foreground"}),X5.jsxs("div",{className:"flex flex-col gap-1.5",children:[X5.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),X5.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Workspace is a place for all the chats, widgets, and views that share the same context. Create a new one or import an existing folder you’ve worked in before."})]}),X5.jsx(pJ,{trigger:X5.jsx(C0,{children:"Create workspace"})})]}),B.length>0&&X5.jsx("section",{children:X5.jsxs(BH,{open:Y,onOpenChange:K,className:"group",children:[X5.jsxs(qH,{className:s("group/trigger","flex w-full items-center gap-1 pb-4 text-left outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","text-muted-foreground group-data-open:text-foreground hover:text-foreground"),children:[X5.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),X5.jsx(o3,{size:16,stroke:2,className:s("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),X5.jsx(UH,{children:X5.jsx("ul",{className:"border-t border-border",children:B.map((F)=>X5.jsx(Eo,{suggestion:F,onAdd:U},F.path))})})]})}),X.choice&&X5.jsx(bw,{choice:X.choice,availability:Q.data?.availability,isPending:X.isPending,errorMessage:X.error?.message,onTypeChange:X.selectType,onSubmit:X.submit,onReset:X.reset}),X5.jsx(cG,{open:G,onOpenChange:H})]})}function Co({workspace:$}){let Z=h3($),J=NG($.id),Q=J.data?.theme,X=J.data?.updatedAt??new Date($.addedAt).getTime();return X5.jsxs($J,{href:`/workspace/${$.id}`,className:"group flex min-w-0 flex-col gap-3",children:[X5.jsx(AT,{workspaceId:$.id}),X5.jsxs("div",{className:"flex min-w-0 flex-col gap-2 px-2",children:[X5.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:z9(Q),children:[X5.jsx("img",{src:$.icon??M2[$.type??"claude-code"],alt:"",className:"size-4 shrink-0 rounded-xs"}),X5.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),X5.jsx("span",{className:"text-xs text-muted-foreground",children:So(X)})]})]})}function Eo({suggestion:$,onAdd:Z}){let{path:J,types:Q}=$,X=h3($);return X5.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[X5.jsx(fP,{types:Q}),X5.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:X}),X5.jsx("span",{title:J,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??J}),X5.jsxs(C0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[X5.jsx(W4,{stroke:1.75}),"Add"]})]})}function So($){let Z=Date.now()-$,J=Math.floor(Z/60000);if(J<1)return"Updated just now";if(J<60)return`Updated ${J} min${J===1?"":"s"} ago`;let Q=Math.floor(J/60);if(Q<24)return`Updated ${Q} hour${Q===1?"":"s"} ago`;let X=Math.floor(Q/24);if(X<30)return`Updated ${X} day${X===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var tH=P(c(),1);function PT(){return tH.jsx(XH,{showWorkspaces:!1,children:tH.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:tH.jsx(OT,{})})})}var eH=P(v(),1);var FF=P(c(),1),TT=($)=>$.map((Z)=>[...Z].map((J)=>J==="#"?1:0)),ko=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],Io=["###.#","#.#.#","#.#.#","#.#.#","###.#"],Ro=TT([".....","####.","#.#.#","#.#.#","#.#.#"]),yo=TT(ko.map(($,Z)=>`${$}.${Io[Z]}`)),bo={moi:Ro,"moi-full":yo};function CT($,Z,J){let Q=[];for(let X=0;X<Z;X++){let z=[];for(let G=0;G<$;G++)z.push(J(G,X));Q.push(z)}return Q}function wT($,Z,J){let Q=Math.sin($*12.9898+Z*78.233+J*37.719)*43758.5453;return Q-Math.floor(Q)}function xo($,Z,J){return CT(Z,J,(Q,X)=>{let z=wT(Q,X,0)*Math.PI*2,G=5+wT(Q,X,1)*6,H=0.5+0.5*Math.sin($*G+z);return H*H})}function ho($,Z,J){return CT(Z,J,(X,z)=>0.5+0.5*Math.sin(X*0.5+z*0.32-$*6.5))}var ET=0.55;function go($,Z){let J=$.length,Q=$.reduce((Y,K)=>Math.max(Y,K.length),0),X=Math.min(Z/ET,1),z=1-Math.pow(1-X,3),G=Math.round((1-z)*J),H=[];for(let Y=0;Y<J;Y++){let K=[];for(let W=0;W<Q;W++)K.push($[Y-G]?.[W]??0);H.push(K)}return H}function jT($,Z,J){let Q=bo[$];if(Z===void 0)return go(Q,J);let X=Q.length,z=Q[0]?.length??0;return Z==="wave"?ho(J,z,X):xo(J,z,X)}var vo=24;function fo($,Z,J){let[Q,X]=eH.useState(()=>jT($,Z,0));return eH.useEffect(()=>{let z=0,G=null,H=0,Y=1000/J,K=(W)=>{if(G===null)G=W;let B=(W-G)/1000;if(W-H>=Y){if(H=W,X(jT($,Z,B)),Z===void 0&&B>=ET)return}z=requestAnimationFrame(K)};return z=requestAnimationFrame(K),()=>cancelAnimationFrame(z)},[$,Z,J]),Q}function mo($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function ST({sprite:$="moi",effect:Z,fps:J=vo,pixelSize:Q=3,gap:X=1,className:z}){let G=fo($,Z,J),H=G[0]?.length??0,Y=Z!==void 0;return FF.jsx("div",{className:s("grid",z),style:{gridTemplateColumns:`repeat(${H}, ${Q}px)`,gap:`${X}px`},children:G.flatMap((K,W)=>K.map((B,q)=>FF.jsx("div",{className:"rounded-[2px]",style:{width:Q,height:Q,background:mo(B),boxShadow:Y?`0 0 ${(Q*(0.4+B)).toFixed(1)}px rgba(23, 23, 23, ${(B*0.35).toFixed(3)})`:void 0}},`${W}-${q}`)))})}var I$=P(v(),1);var ZY=P(v(),1);var kT=()=>({emit($,...Z){for(let J=this.events[$]||[],Q=0,X=J.length;Q<X;Q++)J[Q](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((J)=>Z!==J)}}});function NF($){return $==="agent"||$==="widgets"||$==="scratchpad"||typeof $==="string"&&(/^view:[^/]+$/.test($)||/^view-builder:[^/]+$/.test($))}function _Q($){return NF($)?$:null}function IT($,Z){return`/workspace/${$}/${Z}`}var VF=($)=>`view:${$}`,j6=($)=>$.startsWith("view:")?$.slice(5):null,s3=($)=>`view-builder:${$}`,t3=($)=>$.startsWith("view-builder:")?$.slice(13):null;function S$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function RT($){if(!S$($))return{};let Z=$.appletParams;return S$(Z)?Z:{}}var LF=2000;var po=({kind:$,name:Z})=>`${$}:${Z}`,yT=1000,MF={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function uo($){let Z=kT(),J=WG(MF),Q=(z,G)=>{V2($,{source:"runtime",kind:z.kind,name:z.name,message:G})},X=(z,G,H)=>{let Y=J.admit(`${G}\x00${H}`);if(Y==="cooldown")return Q(z,`sendChatMessage("${H}") was dropped: the same message was already sent less than ${MF.cooldownMs/1000}s ago. Call it from an event handler, not during render.`),!1;if(Y==="window")return Q(z,`sendChatMessage("${H}") was dropped: more than ${MF.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`),!1;return!0};return{on(z,G){return Z.on(z,G)},connect(z){let G=!0,H=po(z);return{bridge:{focusTab(K,W){if(!G)return;if(!NF(K))return;Z.emit("focusTab",K,S$(W)?W:void 0)},sendChatMessage(K,W){if(!G)return;if(typeof K!=="string")return;let B=K.trim();if(!B)return;if(B.length>yT){Q(z,`sendChatMessage() was dropped: the message is ${B.length} characters (max ${yT}). Put long content in the context argument, not the message.`);return}if(!X(z,H,B))return;Z.emit("sendChatMessage",{message:B,source:H,...W!==void 0?{context:co(z,W,Q)}:{}})}},dispose:()=>{G=!1}}}}}function co($,Z,J){if(!S$(Z)){J($,"sendChatMessage() ignored its context argument: it must be a plain object.");return}let Q;try{Q=JSON.stringify(Z)}catch{J($,"sendChatMessage() ignored its context argument: it is not JSON-serializable (cycles, functions, or BigInt).");return}if(Q.length>LF){J($,`sendChatMessage() ignored its context argument: ${Q.length} characters serialized (max ${LF}). Send an id the agent can look up instead of the whole payload.`);return}return Z}var bT=new Map;function xT($){let Z=bT.get($);if(!Z)Z=uo($),bT.set($,Z);return Z}function JY($,Z,J){let Q=ZY.useRef(J);Q.current=J,ZY.useEffect(()=>{let X=(...z)=>Q.current(...z);return xT($).on(Z,X)},[$,Z])}var $Y=new Map;function hT($,Z,J,Q){let X=$.__attachBridge;if(typeof X!=="function")return;$Y.get(J)?.();let{bridge:z,dispose:G}=xT(Z).connect(Q);$Y.set(J,G),X(z)}function AF($){let Z=$Y.get($);if(!Z)return;$Y.delete($),Z()}function QY($,Z,J){return`${$}/${Z}/${J}`}var k$=new Map,DQ=new Map;function lo($,Z,J){return k$.get(QY($,Z,J))??0}var io="module";function gT($,Z,J){return`/api/workspaces/${Z}/${$}/${J}/${io}?v=${lo($,Z,J)}`}function XY($,Z,J){return`/api/workspaces/${Z}/${$}/${J}`}function zY($,Z){return`${$==="widgets"?"widget":"view"}:${Z}`}function vT($){return DQ.get($)}function fT($,Z){DQ.set($,Z)}function GY($,Z,J){let Q=QY($,Z,J);DQ.delete(Q),k$.set(Q,(k$.get(Q)??0)+1),AF(Q)}function _F($){let Z=`${$}/`;for(let J of new Set([...DQ.keys(),...k$.keys()]))if(J.startsWith(Z))DQ.delete(J),k$.set(J,(k$.get(J)??0)+1),AF(J)}var ro={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},ao={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function no($,Z,J){let{segment:Q}=$,X=QY(Q,Z,J),z=vT(X);if(z)return z;let G=import(gT(Q,Z,J)).then((H)=>{if(!H.default)throw Error(`"${J}" has no default export`);return hT(H,Z,X,{kind:$.kind,name:J}),H.default});return fT(X,G),G}function mT($,Z){let J=n5(),[Q,X]=I$.useState({status:"loading",version:0}),z=I$.useCallback(()=>{X((G)=>({status:"loading",version:G.version})),no($,J,Z).then((G)=>X((H)=>({status:"ready",Component:G,version:H.version+1}))).catch((G)=>{V2(J,{source:"load",kind:$.kind,name:Z,message:String(G),...G instanceof Error&&G.stack?{stack:G.stack}:{}}),X((H)=>({status:"error",error:String(G),version:H.version+1}))})},[$,J,Z]);return I$.useEffect(()=>{z()},[z]),J8((G)=>{if($.shouldReload(G,Z))GY($.segment,J,Z),z()}),Q}function pT($){return mT(ro,$)}function uT($){return mT(ao,$)}function cT(){let $=n5();J8((Z)=>{if(Z.type==="view:updated")GY("views",$,Z.name);else if(Z.type==="widget:updated")GY("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")_F("widgets");if(Z.only!=="widgets")_F("views")}})}var $2=P(v(),1);var I4={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function dT($){return $1({queryKey:E0.layout($),queryFn:()=>O5(`/api/workspaces/${$}`),...I4})}function G9($){let Z=s0();return J8((J)=>{if(J.type==="agent:updated"&&J.workspaceId===$)Z.setQueryData(E0.agent($),(Q)=>Q?{...Q,availability:J.availability,login:J.login}:Q);if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:E0.agent($)})}),$1({queryKey:E0.agent($),queryFn:()=>O5(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function lT($){return O5(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function iT($){return $1({queryKey:E0.skills($),queryFn:()=>O5(`/api/workspaces/${$}/skills`),...I4})}async function oo($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),J=await Z.text(),Q=null;try{Q=JSON.parse(J)}catch{}if(!Z.ok){let X=Q&&"error"in Q?Q.error:J,z=Error(X||"Failed to update workspace skill");if(Q?.skills)z.status={skills:Q.skills,updateAvailable:Q.updateAvailable};throw z}if(!Q)throw Error("Invalid workspace skill update response");return Q}function rT($){let Z=s0();return Z1({mutationFn:()=>oo($),onSuccess:(J)=>{Z.setQueryData(E0.skills($),J)},onError:(J)=>{if(J.status)Z.setQueryData(E0.skills($),J.status)}})}function aT($){return $1({queryKey:E0.widgets($),queryFn:async()=>{return(await O5(`/api/workspaces/${$}/widgets`)).widgets},...I4})}function HY($){return $1({queryKey:E0.views($),queryFn:async()=>{return(await O5(`/api/workspaces/${$}/views`)).views},...I4})}function nT($){let Z=s0();return Z1({mutationFn:(J)=>C4(`/api/workspaces/${$}`,a1("PUT",J),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:E0.preview($)})}})}function DF(){return{open:["agent","widgets","scratchpad"],active:"agent"}}function oT(){return{version:1,widgetGrid:[],layoutMode:"split",tabs:DF()}}var $C=P(c(),1),OF=$2.createContext(null);function X1(){let $=$2.useContext(OF);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function tT(){return $2.useContext(OF)?.layout.theme}function sT($){let{cwd:Z,name:J,provider:Q,agentId:X,...z}=$;return z}function eT({id:$,children:Z}){let J=s0(),Q=dT($),X=nT($),z=$2.useRef(X.mutate);z.current=X.mutate;let G=$2.useRef(null),H=$2.useCallback((K)=>{let W=E0.layout($),B=J.getQueryData(W);if(!B)return;let q={...B,...K};if(J.setQueryData(W,q),G.current)clearTimeout(G.current);G.current=setTimeout(()=>{G.current=null,z.current(sT(q))},600)},[$,J]),Y=$2.useMemo(()=>({layout:Q.data?sT(Q.data):oT(),setLayout:H,name:Q.data?.name??null,icon:Q.data?.icon??null,cwd:Q.data?.cwd??null,provider:Q.data?.provider??null,workspaceId:$,isLoading:Q.isLoading}),[Q.data,Q.isLoading,H,$]);return $C.jsx(OF,{value:Y,children:Z})}var z4=P(v(),1);var S9=P(c(),1),so="M5 11a7 7 0 0 1 14 0v7a1.78 1.78 0 0 1 -3.1 1.4a1.65 1.65 0 0 0 -2.6 0a1.65 1.65 0 0 1 -2.6 0a1.65 1.65 0 0 0 -2.6 0a1.78 1.78 0 0 1 -3.1 -1.4v-7",to=18.85;function T6($){return $.toFixed(3)}function eo($){let Z="";for(let J=0;J<$.length-1;J+=1){let Q=$[J-1]??$[J],X=$[J],z=$[J+1],G=$[J+2]??z,H=J===0?{x:X.x,y:X.y+0.4}:{x:X.x+(z.x-Q.x)/6,y:X.y+(z.y-Q.y)/6},Y=J===$.length-2?{x:z.x,y:z.y+0.4}:{x:z.x-(G.x-X.x)/6,y:z.y-(G.y-X.y)/6};Z+=`C${T6(H.x)} ${T6(H.y)} ${T6(Y.x)} ${T6(Y.y)} ${T6(z.x)} ${T6(z.y)}`}return Z}function $s($){let Z=$*Math.PI*2,Q=(1-Math.abs($*2-1))*1.55,X=to+Q,z=Array.from({length:13},(H,Y)=>{let K=Y/12,W=Math.sin(Math.PI*K)**0.35,B=X+0.3*W,q=0.55*W*Math.sin(5*Math.PI*K-Z);return{x:5+14*K,y:B+q}}),G=X-11;return`M5 11a7 7 0 0 1 14 0v${T6(G)}${eo(z.reverse())}v-${T6(G)}`}var ZC=Array.from({length:17},($,Z)=>$s(Z/16));function C6({animated:$=!1,color:Z="currentColor",size:J=24,stroke:Q=2,title:X,className:z,children:G,ref:H,...Y}){let K=JC(),W=$&&!K;return S9.jsxs("svg",{ref:H,xmlns:"http://www.w3.org/2000/svg",width:J,height:J,viewBox:"0 0 24 24",fill:"none",stroke:Z,strokeWidth:Q,strokeLinecap:"round",strokeLinejoin:"round",className:s("tabler-icon tabler-icon-ghost",z),...Y,children:[X&&S9.jsx("title",{children:X}),W?S9.jsx(u5.path,{d:ZC[0],animate:{d:ZC},transition:{duration:2,ease:"linear",repeat:1/0}}):S9.jsx("path",{d:so}),S9.jsx("path",{d:"M10 10l.01 0"}),S9.jsx("path",{d:"M14 10l.01 0"}),S9.jsx("path",{d:"M10 14a3.5 3.5 0 0 0 4 0"}),G]})}var KY=P(c(),1);function YY({visible:$,editing:Z,canvasRef:J,width:Q,height:X,pointerProps:z,onKeyDown:G,children:H}){if(!$)return null;return KY.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:G,children:[KY.jsx("canvas",{ref:J,...z,width:Q,height:X,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),Z&&H]})}var i0=P(v(),1);function wF($,Z,J){let Q=Math.max($,Z);if(Q<=0)return 1;return Math.min(Math.max(J,1),1568/Q)}function Zs($){return new Promise((Z,J)=>{setTimeout(()=>J(Error("Annotation capture timed out")),$)})}async function QC($){let Z=$.getBoundingClientRect();if(Z.width<=0||Z.height<=0)throw Error("Annotation target is not visible");let{createContext:J,destroyContext:Q,domToCanvas:X}=await import("/chunk-b959mdkj.js"),z=async()=>{let G=await J($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:wF(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"}});try{return await X(G)}finally{Q(G)}};return Promise.race([z(),Zs(1e4)])}var jF={past:[],present:[],future:[]};function Js($,Z){if(Z.type==="commit")return{past:[...$.past,$.present],present:[...$.present,Z.stroke],future:[]};if(Z.type==="undo"){let J=$.past.at(-1);if(!J)return $;return{past:$.past.slice(0,-1),present:J,future:[$.present,...$.future]}}if(Z.type==="redo"){let J=$.future[0];if(!J)return $;return{past:[...$.past,$.present],present:J,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function GC($,Z,J){let Q=$.getBoundingClientRect();return{x:(Z-Q.left)/Q.width*$.width,y:(J-Q.top)/Q.height*$.height}}function XC($,Z){let J=Z.getCoalescedEvents?.()??[];return(J.length>0?J:[Z]).map((X)=>GC($,X.clientX,X.clientY))}var Qs={canUndo:!1,canRedo:!1,hasStrokes:!1};function OQ($){return i0.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function zC($,Z,J,Q){let X=Z.points[0];if(!X)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=Q,$.strokeStyle=J,$.moveTo(X.x,X.y);for(let z=1;z<Z.points.length;z++){let G=Z.points[z];$.lineTo(G.x,G.y)}if(Z.points.length===1)$.lineTo(X.x+0.01,X.y+0.01);$.stroke()}function HC($,Z,J,Q,X,z=null){let G=Math.max(3,Math.min(Z,J)*0.005),H=G+Math.max(2,G*0.75),Y=z?[...X,z]:X;for(let K of Y)zC($,K,Q.haloColor,H);for(let K of Y)zC($,K,Q.strokeColor,G)}function Xs($,Z,J,Q=null){let X=$.getContext("2d");if(!X)return;X.clearRect(0,0,$.width,$.height),HC(X,$.width,$.height,Z,J,Q)}function zs($,Z,J){let Q=$.getContext("2d");if(!Q)return;Q.clearRect(0,0,$.width,$.height),Q.drawImage(Z.snapshot,0,0,$.width,$.height),HC(Q,$.width,$.height,Z,J)}function Gs($){return new Promise((Z,J)=>{$.toBlob((Q)=>{if(Q)Z(Q);else J(Error("Could not export drawing"))},"image/png")})}function Hs($,Z,J){let Q=$.getBoundingClientRect();if(Q.width<=0||Q.height<=0)return null;let X=getComputedStyle($),z=wF(Q.width,Q.height,window.devicePixelRatio),G=Math.max(1,Math.round(Q.width*z)),H=Math.max(1,Math.round(Q.height*z)),Y=document.createElement("canvas");Y.width=G,Y.height=H;let K=X.getPropertyValue("--background").trim()||"#ffffff",W=Y.getContext("2d");if(W)W.fillStyle=K,W.fillRect(0,0,G,H);return Z.width=G,Z.height=H,{id:J,snapshot:Y,strokeColor:X.getPropertyValue("--primary").trim()||"#2563eb",haloColor:K,targetWidth:Q.width,targetHeight:Q.height}}function Ys($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function WY({mode:$="annotation",onChange:Z,onEditingStart:J,onFinish:Q}={}){let X=i0.useRef(null),z=i0.useRef(null),[G,H]=i0.useState(null),Y=i0.useRef(G),[K,W]=i0.useState(!1),B=i0.useRef(!1),q=i0.useRef(jF),U=i0.useRef(Qs),F=i0.useRef(new Set),N=i0.useRef(0),L=i0.useRef(null),V=i0.useRef(null),M=i0.useRef(0),_=i0.useRef(0),O=i0.useRef(null),D=i0.useRef(null),[A,C]=i0.useState(!1),I=i0.useRef(!1),[y,E]=i0.useState(!1),h=i0.useRef(!1),k=i0.useRef(Z),S=i0.useRef(J),w=i0.useRef(Q);k.current=Z,S.current=J,w.current=Q;let T=i0.useCallback(()=>{let m=q.current,d=U.current,f={canUndo:m.past.length>0,canRedo:m.future.length>0,hasStrokes:m.present.length>0};if(f.canUndo===d.canUndo&&f.canRedo===d.canRedo&&f.hasStrokes===d.hasStrokes)return;U.current=f;for(let a of F.current)a()},[]),R=i0.useCallback((m)=>{return F.current.add(m),()=>{F.current.delete(m)}},[]),b=i0.useCallback(()=>U.current,[]),g=i0.useCallback((m,d=null)=>{if(M.current)cancelAnimationFrame(M.current),M.current=0;let f=z.current,a=Y.current;if(f&&a)Xs(f,a,m,d)},[]),u=i0.useCallback(()=>{if(M.current)return;M.current=requestAnimationFrame(()=>{M.current=0,g(q.current.present,L.current)})},[g]),j=i0.useCallback((m,d,f)=>{let a=O.current;if(a?.sessionId===m.id&&a.historyVersion===f)return Promise.resolve(a.blob);let o=D.current;if(o?.sessionId===m.id&&o.historyVersion===f)return o.promise;if(d.length===0)return O.current={sessionId:m.id,historyVersion:f,blob:null},k.current?.(null),Promise.resolve(null);let N0=document.createElement("canvas");N0.width=m.snapshot.width,N0.height=m.snapshot.height,zs(N0,m,d);let j0=Gs(N0).then((h0)=>{if(Y.current?.id!==m.id||N.current!==f)return h0;return O.current={sessionId:m.id,historyVersion:f,blob:h0},k.current?.(h0),h0}).catch(()=>{if(Y.current?.id===m.id&&N.current===f)l4.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(D.current?.promise===j0)D.current=null});return D.current={sessionId:m.id,historyVersion:f,promise:j0},j0},[]),e=i0.useCallback(()=>{if(!L.current)return;let m=z.current,d=V.current;if(m&&d!==null&&m.hasPointerCapture(d))m.releasePointerCapture(d);L.current=null,V.current=null,g(q.current.present)},[g]),t=i0.useCallback((m)=>{let d=Y.current;if(!d||h.current)return;let f=Js(q.current,m);if(f===q.current)return;q.current=f,T(),L.current=null;let a=++N.current;g(f.present),j(d,f.present,a)},[j,T,g]),x=i0.useCallback((m)=>{q.current=jF,N.current=0,O.current=null,D.current=null,L.current=null,V.current=null,T(),Y.current=m,H(m)},[T]),$0=i0.useCallback(()=>{if(B.current)return;B.current=!0,W(!0),S.current?.()},[]),M0=i0.useCallback(async()=>{let m=X.current;if(!m||Y.current||I.current)return!1;let d=++_.current;I.current=!0,C(!0);try{let f=await QC(m);if(d!==_.current||X.current!==m)return!1;let a=m.getBoundingClientRect(),o=getComputedStyle(m),N0={id:d,snapshot:f,strokeColor:o.getPropertyValue("--primary").trim()||"#2563eb",haloColor:o.getPropertyValue("--background").trim()||"#ffffff",targetWidth:a.width,targetHeight:a.height};return x(N0),$0(),!0}finally{if(d===_.current)I.current=!1,C(!1)}},[$0,x]),l=i0.useCallback(()=>{let m=Y.current;_.current+=1,I.current=!1,h.current=!1,C(!1),E(!1),B.current=!1,W(!1),e(),H(null),q.current=jF,T();let d=D.current;if(!m||d?.sessionId!==m.id)return Y.current=null,Promise.resolve();return d.promise.then(()=>{if(Y.current?.id===m.id)Y.current=null})},[e,T]),H0=i0.useCallback(async()=>{let m=Y.current;if(!m)return null;return e(),j(m,q.current.present,N.current)},[e,j]),U0=i0.useCallback(async()=>{return B.current=!1,W(!1),H0()},[H0]),X0=i0.useCallback(async()=>{let m=Y.current;if(!m||h.current)return null;h.current=!0,E(!0),e();let d=N.current,f=q.current.present,a=null;if(f.length>0||d>0)a=await j(m,f,d);if(Y.current?.id!==m.id)return a;try{await w.current?.(a)}finally{if(Y.current?.id===m.id)_.current+=1,B.current=!1,W(!1),Y.current=null,H(null),h.current=!1,E(!1)}return a},[e,j]),Y0=i0.useCallback(()=>t({type:"undo"}),[t]),V0=i0.useCallback(()=>t({type:"redo"}),[t]),i=i0.useCallback(()=>t({type:"clear"}),[t]),Z0=i0.useMemo(()=>({onPointerDown:(m)=>{if(h.current||!m.isPrimary||m.pointerType==="mouse"&&m.button!==0)return;if(!Y.current&&$==="sketch"){let d=X.current;if(!d)return;let f=Hs(d,m.currentTarget,++_.current);if(!f)return;x(f)}if(!Y.current)return;$0(),V.current=m.pointerId,m.currentTarget.setPointerCapture(m.pointerId),L.current={points:[GC(m.currentTarget,m.clientX,m.clientY)]},g(q.current.present,L.current)},onPointerMove:(m)=>{if(m.pointerId!==V.current||!L.current)return;L.current.points.push(...XC(m.currentTarget,m.nativeEvent)),u()},onPointerUp:(m)=>{if(m.pointerId!==V.current||!L.current)return;let d=L.current;if(d.points.push(...XC(m.currentTarget,m.nativeEvent)),L.current=null,V.current=null,m.currentTarget.hasPointerCapture(m.pointerId))m.currentTarget.releasePointerCapture(m.pointerId);t({type:"commit",stroke:d})},onPointerCancel:(m)=>{if(m.pointerId===V.current)e()}}),[t,$0,e,x,$,g,u]),J0=i0.useCallback((m)=>{if(Ys(m.target))return;if(m.key==="Escape"&&$==="annotation"){m.preventDefault(),X0();return}if(!(m.metaKey||m.ctrlKey)||m.key.toLowerCase()!=="z")return;if(m.preventDefault(),m.shiftKey)V0();else Y0()},[X0,$,V0,Y0]);i0.useLayoutEffect(()=>{if(!G)return;if(g(q.current.present,L.current),K)z.current?.focus()},[K,g,G]),i0.useEffect(()=>{if(!G||$==="sketch")return;let m=X.current;if(!m){l();return}let d=new ResizeObserver((f)=>{let a=f[0]?.contentRect;if(!a)return;if(Math.abs(a.width-G.targetWidth)>1||Math.abs(a.height-G.targetHeight)>1)l()});return d.observe(m),()=>d.disconnect()},[l,$,G]),i0.useEffect(()=>()=>{if(_.current+=1,B.current=!1,Y.current=null,M.current)cancelAnimationFrame(M.current)},[]);let Q0=i0.useMemo(()=>({active:K,visible:$==="sketch"||G!==null,starting:A,finishing:y,open:M0,undo:Y0,redo:V0,clear:i,flush:H0,deactivate:U0,finish:X0,cancel:l,subscribeHistory:R,getHistoryState:b}),[K,$,G,A,y,M0,Y0,V0,i,H0,U0,X0,l,R,b]),n=i0.useMemo(()=>({visible:Q0.visible,editing:Q0.active,canvasRef:z,width:G?.snapshot.width??1,height:G?.snapshot.height??1,pointerProps:Z0,onKeyDown:J0}),[Q0.active,Q0.visible,G,Z0,J0]);return i0.useMemo(()=>({targetRef:X,controls:Q0,layerProps:n}),[Q0,n])}var u1=P(c(),1);function BY({controls:$,title:Z,busy:J,onComplete:Q}){let{canUndo:X,canRedo:z,hasStrokes:G}=OQ($);return u1.jsxs("div",{className:"absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-lg bg-popover p-1.5 shadow-md",children:[u1.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),u1.jsxs("div",{className:"flex gap-1",children:[u1.jsxs(A1,{children:[u1.jsx(_1,{render:u1.jsx(C0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:J||!X,"aria-label":"Undo",children:u1.jsx(YC,{stroke:1.75})})}),u1.jsx(D1,{children:"Undo"})]}),u1.jsxs(A1,{children:[u1.jsx(_1,{render:u1.jsx(C0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:J||!z,"aria-label":"Redo",children:u1.jsx(KC,{stroke:1.75})})}),u1.jsx(D1,{children:"Redo"})]}),u1.jsx(C0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:J||!G,children:"Clear"})]}),u1.jsx(s8,{mode:"popLayout",initial:!1,children:u1.jsx(u5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.1,bounce:0},children:u1.jsx(C0,{type:"button",variant:G?"default":"ghost",size:"icon-sm",onClick:Q,disabled:J,"aria-label":"Complete",className:s(!G&&"text-muted-foreground"),children:G?u1.jsx(K6,{stroke:1.75}):u1.jsx(C1,{stroke:1.75})})},G?"complete":"cancel")})]})}var x1=P(v(),1);async function TF($,Z){let J=new FormData;for(let X of Z)J.append("files",X);let Q=await fetch(`/api/workspaces/${$}/uploads`,{method:"POST",body:J});if(!Q.ok){let X=await Q.text().catch(()=>"");throw Error(X||`Upload failed (${Q.status})`)}return Q.json()}function WC({workspaceId:$,sessionId:Z},J){if(J.length===0)return;let Q=J.map((X)=>({kind:"file",localId:crypto.randomUUID(),name:X.name||"file",mediaType:X.type||"application/octet-stream",previewUrl:X.type.startsWith("image/")?URL.createObjectURL(X):void 0,status:"uploading"}));T5.getState().addAttachments($,Z,Q),Q.forEach((X,z)=>{TF($,[J[z]]).then(([G])=>{T5.getState().updateAttachment($,Z,X.localId,{status:"ready",upload:G,mediaType:G.mediaType})}).catch((G)=>{T5.getState().updateAttachment($,Z,X.localId,{status:"error",error:G instanceof Error?G.message:"Upload failed"})})})}function qY({workspaceId:$,sessionId:Z,localId:J,purpose:Q,sourceTab:X,blob:z}){let G=Q==="sketch"?"Sketch":"Annotation",H=URL.createObjectURL(z),Y=T5.getState();if(Y.attachments[o8($,Z)]?.some((W)=>W.localId===J))Y.updateAttachment($,Z,J,{previewUrl:H,status:"draft",upload:void 0,error:void 0});else Y.addAttachments($,Z,[{kind:"drawing",purpose:Q,localId:J,sourceTab:X,name:`${G}.png`,mediaType:"image/png",previewUrl:H,status:"draft"}])}async function UY({workspaceId:$,sessionId:Z,localId:J,purpose:Q,sourceTab:X,blob:z,isCurrent:G}){let H=Q==="sketch"?"Sketch":"Annotation",Y=URL.createObjectURL(z),K=T5.getState();if(K.attachments[o8($,Z)]?.some((B)=>B.localId===J))K.updateAttachment($,Z,J,{previewUrl:Y,status:"uploading",upload:void 0,error:void 0});else K.addAttachments($,Z,[{kind:"drawing",purpose:Q,localId:J,sourceTab:X,name:`${H}.png`,mediaType:"image/png",previewUrl:Y,status:"uploading"}]);try{let[B]=await TF($,[new File([z],`${H}.png`,{type:"image/png"})]);if(!G())return;T5.getState().updateAttachment($,Z,J,{status:"ready",upload:B,mediaType:B.mediaType,error:void 0})}catch{if(!G())return;T5.getState().removeAttachment($,Z,J)}}function BC({workspaceId:$,sessionId:Z,activeTab:J,mode:Q,available:X,closePopup:z,openPopup:G}){let H=x1.useRef(null),Y=x1.useRef(null),K=x1.useRef(new Map),W=x1.useRef(z),B=x1.useRef(G);W.current=z,B.current=G;let q=x1.useCallback((w)=>{let T=H.current;if(!T)return;if(Y.current=w,!w){T5.getState().removeAttachment(T.workspaceId,T.sourceSessionId,T.attachmentId);return}qY({workspaceId:T.workspaceId,sessionId:T.sourceSessionId,localId:T.attachmentId,purpose:"annotation",sourceTab:T.sourceTab,blob:w})},[]),U=x1.useCallback((w,T)=>{let R=(K.current.get(w.attachmentId)??0)+1;return K.current.set(w.attachmentId,R),UY({workspaceId:w.workspaceId,sessionId:w.sourceSessionId,localId:w.attachmentId,purpose:"annotation",sourceTab:w.sourceTab,blob:T,isCurrent:()=>K.current.get(w.attachmentId)===R})},[]),F=x1.useCallback(async(w)=>{let T=H.current;if(H.current=null,Y.current=null,T&&w)await U(T,w);if(T?.origin==="popup")B.current()},[U]),N=WY({onChange:q,onFinish:F}),{controls:L}=N,{active:V,starting:M,open:_,finish:O,cancel:D}=L,A=x1.useCallback(async(w)=>{if(!X||V||M)return;let T={workspaceId:$,sourceSessionId:Z,sourceTab:J,origin:w,attachmentId:crypto.randomUUID()};H.current=T;try{if(!await _()){if(H.current===T)H.current=null;return}if(w==="popup")W.current()}catch{if(H.current!==T)return;H.current=null,l4.add({title:"Couldn’t capture this page",type:"error"})}},[V,J,X,_,Z,M,$]),C=x1.useCallback(async()=>{let w=H.current;if(await D(),H.current!==w)return;H.current=null;let T=Y.current;if(Y.current=null,w&&T)U(w,T)},[D,U]),I=x1.useCallback((w)=>{let T=(K.current.get(w)??0)+1;if(K.current.set(w,T),T5.getState().removeAttachment($,Z,w),H.current?.attachmentId===w)H.current=null,Y.current=null,D()},[D,Z,$]),y=x1.useCallback(async()=>{if(M){await C();return}await O()},[C,O,M]),E=x1.useCallback(()=>{if(V||M)y();else A("docked")},[V,y,A,M]),h=x1.useCallback(()=>{if(V||M)y();else A("popup")},[V,y,A,M]);x1.useEffect(()=>{let w=H.current;if(!w)return;let T=w.origin==="docked"?"split":"fullscreen";if(w.workspaceId!==$||w.sourceSessionId!==Z||w.sourceTab!==J||Q!==T||!X)C()},[J,X,C,Q,Z,$]);let k=x1.useMemo(()=>X?{active:V||M,finish:y,onRemove:I,onToggle:E}:void 0,[X,V,M,y,I,E]),S=x1.useMemo(()=>X?{active:V||M,finish:y,onRemove:I,onToggle:h}:void 0,[X,V,M,y,I,h]);return x1.useMemo(()=>({...N,docked:k,popup:S}),[N,k,S])}var y4=P(v(),1);var qC=P(c(),1);function D2({className:$,...Z}){return qC.jsx(E1,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:s("size-4 animate-spin",$),stroke:1.75,...Z})}var Z2=P(c(),1);function CF($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function FC({composerRef:$,className:Z,onMouseDown:J,children:Q,...X}){return Z2.jsx("form",{...X,onMouseDown:(z)=>{if(J?.(z),z.defaultPrevented)return;if(z.target instanceof Element&&z.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;CF($.current)},className:s("group/composer flex w-full cursor-text flex-col gap-1 rounded-xl bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",Z),children:Q})}function NC({textareaRef:$,className:Z,...J}){return Z2.jsx("textarea",{...J,ref:$,className:s("field-sizing-content max-h-40 w-full resize-none bg-transparent px-2 py-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground disabled:opacity-50",Z)})}function VC({className:$,children:Z,...J}){return Z2.jsx("div",{...J,className:s("flex items-center justify-end gap-3",$),children:Z})}function Ks($){if($.status==="checking")return"Checking agent status…";return}function PQ($,Z,J){return $&&!Z&&J.status==="available"}function LC({label:$,hasContent:Z,busy:J=!1,loading:Q=!1,availability:X}){let z=PQ(Z,J||Q,X),G=Ks(X),H=Z2.jsx(C0,{type:"submit",size:"icon",disabled:!z,"aria-label":$,children:Q?Z2.jsx(D2,{}):Z2.jsx(UC,{stroke:1.5})});if(Q||!G)return H;return Z2.jsxs(A1,{children:[Z2.jsx(_1,{render:Z2.jsx("span",{className:"inline-flex",children:H})}),Z2.jsx(D1,{className:"max-w-64 text-center",children:G})]})}var R4=P(v(),1),Ws=48;function MC($,Z){let J=R4.useRef(!0),[Q,X]=R4.useState(!0),z=R4.useCallback((Y)=>{J.current=Y,X((K)=>K===Y?K:Y)},[]),G=R4.useCallback((Y="auto")=>{let K=$.current;if(!K)return;z(!0),K.scrollTo({top:K.scrollHeight,behavior:Y})},[$,z]),H=R4.useCallback(()=>{let Y=$.current;if(!Y)return;z(!1),Y.scrollTo({top:0,behavior:"auto"})},[$,z]);return R4.useEffect(()=>{let Y=$.current;if(!Y)return;let K=()=>{let W=Y.scrollHeight-Y.scrollTop-Y.clientHeight;z(W<=Ws)};return Y.addEventListener("scroll",K,{passive:!0}),()=>Y.removeEventListener("scroll",K)},[$,z]),R4.useEffect(()=>{let Y=$.current;if(!Y)return;let K=Y.firstElementChild??Y,W=new ResizeObserver(()=>{if(J.current)Y.scrollTop=Y.scrollHeight});return W.observe(K),()=>W.disconnect()},[$]),R4.useLayoutEffect(()=>{G("auto")},[Z,G]),{atBottom:Q,scrollToBottom:G,scrollToTop:H}}function Bs($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function qs($,Z){let J=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:J}}function AC($){let Z=[];for(let J of $){if(!Bs(J))continue;if(J.role!=="assistant"){Z.push(J);continue}let Q=Z.length>0?Z[Z.length-1]:null;if(Q?.role==="assistant")Z[Z.length-1]=qs(Q,J);else Z.push(J)}return Z.map((J,Q)=>{let X=Z[Q-1];if(J.role!=="assistant"||X?.role!=="user"||X.origin.kind!=="user-input"||!X.timestamp||!J.timestamp)return J;let z=Date.parse(X.timestamp),G=Date.parse(J.timestamp);if(!Number.isFinite(z)||!Number.isFinite(G)||G<z)return J;return{...J,meta:{...J.meta,durationMs:G-z}}})}function EF($){switch($.kind){case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"rate-limit":case"api-retry":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function _C($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function DC($,Z){let J=Z.filter((Y)=>EF(Y)!==null);if(J.length===0)return $.map((Y)=>({kind:"turn",turn:Y}));let Q=[],X=[];for(let Y of J){let K=_C(Y.at);if(K===void 0)X.push(Y);else Q.push({notice:Y,time:K})}Q.sort((Y,K)=>Y.time-K.time);let z=[],G=0,H=Number.NEGATIVE_INFINITY;for(let Y of $){H=Math.max(H,_C(Y.timestamp)??H);while(G<Q.length&&Q[G].time<=H)z.push({kind:"notice",notice:Q[G].notice}),G+=1;z.push({kind:"turn",turn:Y})}for(;G<Q.length;G+=1)z.push({kind:"notice",notice:Q[G].notice});for(let Y of X)z.push({kind:"notice",notice:Y});return z}var t$=P(v(),1);var S6={};D4(S6,{createHandle:()=>uC,Viewport:()=>pC,Trigger:()=>kC,Root:()=>TC,Positioner:()=>RC,Portal:()=>SC,Popup:()=>bC,Handle:()=>AY,Backdrop:()=>vC,Arrow:()=>hC});var E6=P(v(),1);var FY=P(v(),1),SF=FY.createContext(void 0);function U4($){let Z=FY.useContext(SF);if(Z===void 0&&!$)throw Error(S0(50));return Z}var PC=P(v(),1),wC=P(H4(),1);var OC=600,NY=300;var Us={...i2,instantType:k0(($)=>$.instantType),hasViewport:k0(($)=>$.hasViewport)};class R$ extends i8{constructor($){super({...Fs(),...$},{popupRef:PC.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new a8,closeDelayRef:{current:NY}},Us)}setOpen=($,Z)=>{let J=Z.reason,Q=J===K0.triggerHover,X=$&&J===K0.triggerFocus,z=!$&&(J===K0.triggerPress||J===K0.escapeKey);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let G=()=>{let H={open:$};if(X)H.instantType="focus";else if(z)H.instantType="dismiss";else if(J===K0.triggerHover)H.instantType=void 0;let Y=Z.trigger?.id??null;if(Y||$)H.activeTriggerId=Y,H.activeTriggerElement=Z.trigger??null;this.update(H)};if(Q)wC.flushSync(G);else G()};static useStore($,Z){let J=S5(()=>{return new R$(Z)}).current,Q=$??J,X=U2({popupStore:Q,onOpenChange:Q.setOpen});return Q.state.floatingRootContext=X,Q}}function Fs(){return{...l2(),instantType:void 0,hasViewport:!1}}var jC=P(c(),1);function TC($){let{open:Z,defaultOpen:J=!1,onOpenChange:Q,onOpenChangeComplete:X,actionsRef:z,handle:G,triggerId:H,defaultTriggerId:Y=null,children:K}=$,W=R$.useStore(G?.store,{open:J,openProp:Z,activeTriggerId:Y,triggerIdProp:H});s2(()=>{if(Z===void 0&&W.state.open===!1&&J===!0)W.update({open:!0,activeTriggerId:Y})}),W.useControlledProp("openProp",Z),W.useControlledProp("triggerIdProp",H),W.useContextCallback("onOpenChange",Q),W.useContextCallback("onOpenChangeComplete",X);let B=W.useState("open"),q=W.useState("activeTriggerId"),U=W.useState("payload");c2(W);let{forceUnmount:F}=d2(B,W);B0(()=>{if(B){if(q==null)W.set("payload",void 0)}},[W,q,B]);let N=E6.useCallback(()=>{W.setOpen(!1,Ns(W,K0.imperativeAction))},[W]);E6.useImperativeHandle(z,()=>({unmount:F,close:N}),[F,N]);let L=W.useState("floatingRootContext"),V=q2(L),{getReferenceProps:M,getTriggerProps:_,getFloatingProps:O}=$8([V]),D=E6.useMemo(()=>M(),[M]),A=E6.useMemo(()=>_(),[_]),C=E6.useMemo(()=>O(),[O]);return W.useSyncedValues({activeTriggerProps:D,inactiveTriggerProps:A,popupProps:C}),jC.jsx(SF.Provider,{value:W,children:typeof K==="function"?K({payload:U}):K})}function Ns($,Z){let J=D0(Z);return J.preventUnmountOnClose=()=>{$.set("preventUnmountingOnClose",!0)},J}var EC=P(v(),1);var VY=P(v(),1),kF=VY.createContext(void 0);function CC(){let $=VY.useContext(kF);if($===void 0)throw Error(S0(48));return $}var IF=P(c(),1),SC=EC.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z;if(!(U4().useState("mounted")||Q))return null;return IF.jsx(kF.Provider,{value:Q,children:IF.jsx(i7,{ref:J,...X})})});var LY=P(v(),1);var kC=LY.forwardRef(function(Z,J){let{render:Q,className:X,delay:z,closeDelay:G,id:H,payload:Y,handle:K,...W}=Z,B=U4(!0),q=K?.store??B;if(!q)throw Error(S0(89));let U=t0(H),F=q.useState("isTriggerActive",U),N=q.useState("isOpenedByTrigger",U),L=q.useState("floatingRootContext"),V=LY.useRef(null),M=z??OC,_=G??NY,{registerTrigger:O,isMountedByThisTrigger:D}=u2(U,V,q,{payload:Y});B0(()=>{if(D)q.context.closeDelayRef.current=_},[q,D,_]);let A=F2(L,{mouseOnly:!0,move:!1,handleClose:N2(),delay:()=>({open:M,close:_}),triggerElementRef:V,isActiveTrigger:F}),C=P3(L,{delay:M}),I={open:N},y=q.useState("triggerProps",D);return W0("a",Z,{state:I,ref:[J,O,V],props:[A,C.reference,y,{id:U},W],stateAttributesMapping:n2})});var wQ=P(v(),1);var MY=P(v(),1),RF=MY.createContext(void 0);function y$(){let $=MY.useContext(RF);if($===void 0)throw Error(S0(49));return $}var IC=P(c(),1),RC=wQ.forwardRef(function(Z,J){let{render:Q,className:X,anchor:z,positionMethod:G="absolute",side:H="bottom",align:Y="center",sideOffset:K=0,alignOffset:W=0,collisionBoundary:B="clipping-ancestors",collisionPadding:q=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=o2,...V}=Z,M=U4(),_=CC(),O=M.useState("open"),D=M.useState("mounted"),A=M.useState("floatingRootContext"),C=M.useState("instantType"),I=M.useState("transitionStatus"),y=M.useState("hasViewport"),E=a2({anchor:z,floatingRootContext:A,positionMethod:G,mounted:D,side:H,sideOffset:K,align:Y,alignOffset:W,arrowPadding:U,collisionBoundary:B,collisionPadding:q,sticky:F,disableAnchorTracking:N,keepMounted:_,collisionAvoidance:L,adaptiveOrigin:y?r7:void 0}),h=wQ.useMemo(()=>{let T={};if(!O)T.pointerEvents="none";return{role:"presentation",hidden:!D,style:{...E.positionerStyles,...T}}},[O,D,E.positionerStyles]),k={open:O,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:C},S=wQ.useMemo(()=>({side:E.side,align:E.align,arrowRef:E.arrowRef,arrowUncentered:E.arrowUncentered,arrowStyles:E.arrowStyles}),[E.side,E.align,E.arrowRef,E.arrowUncentered,E.arrowStyles]),w=W0("div",Z,{state:k,props:[h,W8(I),V],ref:[J,M.useStateSetter("positionerElement")],stateAttributesMapping:V5});return IC.jsx(RF.Provider,{value:S,children:w})});var yC=P(v(),1);var Vs={...V5,...p5},bC=yC.forwardRef(function(Z,J){let{className:Q,render:X,...z}=Z,G=U4(),{side:H,align:Y}=y$(),K=G.useState("open"),W=G.useState("instantType"),B=G.useState("transitionStatus"),q=G.useState("popupProps"),U=G.useState("floatingRootContext");y1({open:K,ref:G.context.popupRef,onComplete(){if(K)G.context.onOpenChangeComplete?.(!0)}});let F=q0(()=>G.context.closeDelayRef.current);return C9(U,{closeDelay:F}),W0("div",Z,{state:{open:K,side:H,align:Y,instant:W,transitionStatus:B},ref:[J,G.context.popupRef,G.useStateSetter("popupElement")],props:[q,W8(B),z],stateAttributesMapping:Vs})});var xC=P(v(),1);var hC=xC.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,G=U4(),{arrowRef:H,side:Y,align:K,arrowUncentered:W,arrowStyles:B}=y$(),U={open:G.useState("open"),side:Y,align:K,uncentered:W};return W0("div",Z,{state:U,ref:[H,J],props:[{style:B,"aria-hidden":!0},z],stateAttributesMapping:V5})});var gC=P(v(),1);var Ls={...V5,...p5},vC=gC.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,G=U4(),H=G.useState("open"),Y=G.useState("mounted"),K=G.useState("transitionStatus");return W0("div",Z,{state:{open:H,transitionStatus:K},ref:[J],props:[{role:"presentation",hidden:!Y,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},z],stateAttributesMapping:Ls})});var mC=P(v(),1);var fC=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var Ms={activationDirection:($)=>$?{"data-activation-direction":$}:null},pC=mC.forwardRef(function(Z,J){let{render:Q,className:X,children:z,...G}=Z,H=U4(),Y=y$(),K=H.useState("instantType"),{children:W,state:B}=t7({store:H,side:Y.side,cssVars:fC,children:z}),q={activationDirection:B.activationDirection,transitioning:B.transitioning,instant:K};return W0("div",Z,{state:q,ref:J,props:[G,{children:W}],stateAttributesMapping:Ms})});class AY{constructor(){this.store=new R$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(S0(88,$));this.store.setOpen(!0,D0(K0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,D0(K0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function uC(){return new AY}var b$=P(c(),1);function cC({...$}){return b$.jsx(S6.Root,{"data-slot":"hover-card",...$})}function dC({...$}){return b$.jsx(S6.Trigger,{"data-slot":"hover-card-trigger",...$})}function lC({className:$,side:Z="bottom",sideOffset:J=4,align:Q="center",alignOffset:X=0,...z}){return b$.jsx(S6.Portal,{"data-slot":"hover-card-portal",children:b$.jsx(S6.Positioner,{align:Q,alignOffset:X,side:Z,sideOffset:J,className:"isolate z-50",children:b$.jsx(S6.Popup,{"data-slot":"hover-card-content",className:s("z-50 w-64 origin-(--transform-origin) rounded-xl bg-popover p-2.5 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...z})})})}var s$=P(v(),1);function _Y($){return $1({queryKey:E0.sessions($),queryFn:()=>O5(`/api/workspaces/${$}/sessions`),...I4})}function As($,Z){return $?.filter((J)=>J.sessionId!==Z)}function iC($){let Z=s0();return Z1({mutationFn:(J)=>C4(`/api/workspaces/${$}/sessions/${J}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(J,Q)=>{Z.setQueryData(E0.sessions($),(X)=>As(X,Q)),Z.removeQueries({queryKey:E0.events($,Q)}),Z.removeQueries({queryKey:E0.sessionConfig($,Q)}),Z.invalidateQueries({queryKey:E0.preview($)})}})}function rC($,Z){return $1({queryKey:E0.events($,Z??""),queryFn:async()=>{let J=await fetch(`/api/workspaces/${$}/sessions/${Z}/events`),Q=J.ok?await J.json():[];return wO(Q)},enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function DY($,Z){return $1({queryKey:E0.sessionConfig($,Z??""),queryFn:()=>O5(`/api/workspaces/${$}/sessions/${Z}/config`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function aC($){let Z=s0();return Z1({mutationFn:({patch:J,sessionId:Q})=>O5(`/api/workspaces/${$}/sessions/${Q}/config`,a1("PUT",J),"Failed to save chat settings"),onSuccess:(J,{sessionId:Q})=>{Z.setQueryData(E0.sessionConfig($,Q),J)}})}var _s=["fable","opus","sonnet","haiku"];function nC($){let Z=$.resolvedModel??$.value,J=_s.findIndex((Q)=>Z===Q||Z.startsWith(`${Q}[`)||Z.includes(`-${Q}-`));return J===-1?void 0:J}function Ds($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function Os($,Z){return Ds(nC($),nC(Z))}var Ps={"claude-code":Os};function ws($,Z){return $.map((J,Q)=>({model:J,index:Q})).sort((J,Q)=>Z(J.model,Q.model)||J.index-Q.index).map(({model:J})=>J)}function yF($,Z,J){if(Z&&$.includes(Z))return Z;if(J&&$.includes(J))return J;if($.includes("high"))return"high";return $[$.length-1]}function oC($,Z,J){let Q=yF($,Z,J);return Q?$.indexOf(Q):-1}function sC($){return $.length>1}function tC($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function eC($,Z){let J=Ps[Z];return J?ws($,J):$}function $E($,Z){let J=[];for(let Q of $){let X=Q.group??Z,z=J.find((G)=>G.label===X);if(z)z.models.push(Q);else J.push({label:X,models:[Q]})}return J}var t8={};D4(t8,{createHandle:()=>lE,Trigger:()=>pE,SubmenuTrigger:()=>dE,SubmenuRoot:()=>hE,Separator:()=>cE,Root:()=>dY,RadioItemIndicator:()=>yE,RadioItem:()=>RE,RadioGroup:()=>SE,Positioner:()=>TE,Portal:()=>PE,Popup:()=>_E,LinkItem:()=>ME,Item:()=>LE,Handle:()=>oY,GroupLabel:()=>NE,Group:()=>UE,CheckboxItemIndicator:()=>WE,CheckboxItem:()=>KE,Backdrop:()=>XE,Arrow:()=>JE});var ZE=P(v(),1);var OY=P(v(),1),bF=OY.createContext(void 0);function F4($){let Z=OY.useContext(bF);if(Z===void 0&&!$)throw Error(S0(33));return Z}var PY=P(v(),1),xF=PY.createContext(void 0);function J1($){let Z=PY.useContext(xF);if(Z===void 0&&!$)throw Error(S0(36));return Z}var JE=ZE.forwardRef(function(Z,J){let{className:Q,render:X,...z}=Z,{store:G}=J1(),{arrowRef:H,side:Y,align:K,arrowUncentered:W,arrowStyles:B}=F4(),U={open:G.useState("open"),side:Y,align:K,uncentered:W};return W0("div",Z,{ref:[H,J],stateAttributesMapping:V5,state:U,props:{style:B,"aria-hidden":!0,...z}})});var QE=P(v(),1);var wY=P(v(),1),js=wY.createContext(void 0);function H9($=!0){let Z=wY.useContext(js);if(Z===void 0&&!$)throw Error(S0(25));return Z}var Ts={...V5,...p5},XE=QE.forwardRef(function(Z,J){let{className:Q,render:X,...z}=Z,{store:G}=J1(),H=G.useState("open"),Y=G.useState("mounted"),K=G.useState("transitionStatus"),W=G.useState("lastOpenChangeReason"),B=H9(),q={open:H,transitionStatus:K};return W0("div",Z,{ref:B?.backdropRef?[J,B.backdropRef]:J,state:q,stateAttributesMapping:Ts,props:[{role:"presentation",hidden:!Y,style:{pointerEvents:W===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},z]})});var EY=P(v(),1);var jY=P(v(),1),hF=jY.createContext(void 0);function zE(){let $=jY.useContext(hF);if($===void 0)throw Error(S0(30));return $}var x$=P(v(),1);var GE=P(v(),1);function TY($){let{closeOnClick:Z,highlighted:J,id:Q,nodeId:X,store:z,itemRef:G,itemMetadata:H}=$,{events:Y}=z.useState("floatingTreeRoot"),K=H9(!0),W=K!==void 0;return GE.useMemo(()=>({id:Q,role:"menuitem",tabIndex:J?0:-1,onMouseMove(B){if(!X)return;Y.emit("itemhover",{nodeId:X,target:B.currentTarget})},onClick(B){if(Z)Y.emit("close",{domEvent:B,reason:K0.itemPress})},onMouseUp(B){if(K){let q=K.initialCursorPointRef.current;if(K.initialCursorPointRef.current=null,W&&q&&Math.abs(B.clientX-q.x)<=1&&Math.abs(B.clientY-q.y)<=1)return}if(G.current&&z.context.allowMouseUpTriggerRef.current&&(!W||B.button===2)){if(!H||H.type==="regular-item")G.current.click()}}}),[Z,J,Q,Y,X,z,G,K,W,H])}var h$={type:"regular-item"};function k6($){let{closeOnClick:Z,disabled:J=!1,highlighted:Q,id:X,store:z,nativeButton:G,itemMetadata:H,nodeId:Y}=$,K=x$.useRef(null),{getButtonProps:W,buttonRef:B}=p1({disabled:J,focusableWhenDisabled:!0,native:G}),q=TY({closeOnClick:Z,highlighted:Q,id:X,nodeId:Y,store:z,itemRef:K,itemMetadata:H}),U=x$.useCallback((N)=>{return K4(q,{onMouseEnter(){if(H.type!=="submenu-trigger")return;H.setActive()},onKeyUp(L){if(L.key===" "&&z.context.typingRef.current)L.preventBaseUIHandler()}},N,W)},[q,W,z,H]),F=P4(K,B);return x$.useMemo(()=>({getItemProps:U,itemRef:F}),[U,F])}var k9=P(v(),1);var CY=P(v(),1),gF=CY.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>{return()=>{}},elementsRef:{current:[]},nextIndexRef:{current:0}});function HE(){return CY.useContext(gF)}var Cs=function($){return $[$.None=0]="None",$[$.GuessFromOrder=1]="GuessFromOrder",$}({});function N4($={}){let{label:Z,metadata:J,textRef:Q,indexGuessBehavior:X,index:z}=$,{register:G,unregister:H,subscribeMapChange:Y,elementsRef:K,labelsRef:W,nextIndexRef:B}=HE(),q=k9.useRef(-1),[U,F]=k9.useState(z??(X===Cs.GuessFromOrder?()=>{if(q.current===-1){let V=B.current;B.current+=1,q.current=V}return q.current}:-1)),N=k9.useRef(null),L=k9.useCallback((V)=>{if(N.current=V,U!==-1&&V!==null){if(K.current[U]=V,W){let M=Z!==void 0;W.current[U]=M?Z:Q?.current?.textContent??V.textContent}}},[U,K,W,Z,Q]);return B0(()=>{if(z!=null)return;let V=N.current;if(V)return G(V,J),()=>{H(V)};return},[z,G,H,J]),B0(()=>{if(z!=null)return;return Y((V)=>{let M=N.current?V.get(N.current)?.index:null;if(M!=null)F(M)})},[z,Y,F]),k9.useMemo(()=>({ref:L,index:U}),[U,L])}var vF=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.highlighted="data-highlighted",$}({});var I6={checked($){if($)return{[vF.checked]:""};return{[vF.unchecked]:""}},...p5};var YE=P(c(),1),KE=EY.forwardRef(function(Z,J){let{render:Q,className:X,id:z,label:G,nativeButton:H=!1,disabled:Y=!1,closeOnClick:K=!1,checked:W,defaultChecked:B,onCheckedChange:q,...U}=Z,F=N4({label:G}),N=F4(!0),L=t0(z),{store:V}=J1(),M=V.useState("isActive",F.index),_=V.useState("itemProps"),[O,D]=n4({controlled:W,default:B??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:A,itemRef:C}=k6({closeOnClick:K,disabled:Y,highlighted:M,id:L,store:V,nativeButton:H,nodeId:N?.nodeId,itemMetadata:h$}),I=EY.useMemo(()=>({disabled:Y,highlighted:M,checked:O}),[Y,M,O]),y=q0((h)=>{let k={...D0(K0.itemPress,h.nativeEvent),preventUnmountOnClose:()=>{}};if(q?.(!O,k),k.isCanceled)return;D((S)=>!S)}),E=W0("div",Z,{state:I,stateAttributesMapping:I6,props:[_,{role:"menuitemcheckbox","aria-checked":O,onClick:y},U,A],ref:[C,J,F.ref]});return YE.jsx(hF.Provider,{value:I,children:E})});var SY=P(v(),1);var WE=SY.forwardRef(function(Z,J){let{render:Q,className:X,keepMounted:z=!1,...G}=Z,H=zE(),Y=SY.useRef(null),{transitionStatus:K,setMounted:W}=c4(H.checked);y1({open:H.checked,ref:Y,onComplete(){if(!H.checked)W(!1)}});let B={checked:H.checked,disabled:H.disabled,highlighted:H.highlighted,transitionStatus:K};return W0("span",Z,{state:B,ref:[J,Y],stateAttributesMapping:I6,props:{"aria-hidden":!0,...G},enabled:z||H.checked})});var g$=P(v(),1);var kY=P(v(),1),fF=kY.createContext(void 0);function BE(){let $=kY.useContext(fF);if($===void 0)throw Error(S0(31));return $}var qE=P(c(),1),UE=g$.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,[G,H]=g$.useState(void 0),Y=g$.useMemo(()=>({setLabelId:H}),[H]),K=W0("div",Z,{ref:J,props:{role:"group","aria-labelledby":G,...z}});return qE.jsx(fF.Provider,{value:Y,children:K})});var FE=P(v(),1);var NE=FE.forwardRef(function(Z,J){let{className:Q,render:X,id:z,...G}=Z,H=t0(z),{setLabelId:Y}=BE();return B0(()=>{return Y(H),()=>{Y(void 0)}},[Y,H]),W0("div",Z,{ref:J,props:{id:H,role:"presentation",...G}})});var VE=P(v(),1);var LE=VE.forwardRef(function(Z,J){let{render:Q,className:X,id:z,label:G,nativeButton:H=!1,disabled:Y=!1,closeOnClick:K=!0,...W}=Z,B=N4({label:G}),q=F4(!0),U=t0(z),{store:F}=J1(),N=F.useState("isActive",B.index),L=F.useState("itemProps"),{getItemProps:V,itemRef:M}=k6({closeOnClick:K,disabled:Y,highlighted:N,id:U,store:F,nativeButton:H,nodeId:q?.nodeId,itemMetadata:h$});return W0("div",Z,{state:{disabled:Y,highlighted:N},props:[L,W,V],ref:[M,J,B.ref]})});var v$=P(v(),1);var ME=v$.forwardRef(function(Z,J){let{render:Q,className:X,id:z,label:G,closeOnClick:H=!1,...Y}=Z,K=v$.useRef(null),W=N4({label:G}),q=F4(!0)?.nodeId,U=t0(z),{store:F}=J1(),N=F.useState("isActive",W.index),L=F.useState("itemProps"),V=TY({closeOnClick:H,highlighted:N,id:U,nodeId:q,store:F,itemRef:K}),M=v$.useMemo(()=>({highlighted:N}),[N]);return W0("a",Z,{state:M,props:[L,Y,V],ref:[K,J,W.ref]})});var yY=P(v(),1);var IY=P(v(),1),Es=IY.createContext(void 0);function RY($){let Z=IY.useContext(Es);if(Z===void 0&&!$)throw Error(S0(69));return Z}var AE=P(c(),1),Ss={...V5,...p5},_E=yY.forwardRef(function(Z,J){let{render:Q,className:X,finalFocus:z,...G}=Z,{store:H}=J1(),{side:Y,align:K}=F4(),W=RY(!0)!=null,B=H.useState("open"),q=H.useState("transitionStatus"),U=H.useState("popupProps"),F=H.useState("mounted"),N=H.useState("instantType"),L=H.useState("activeTriggerElement"),V=H.useState("parent"),M=H.useState("lastOpenChangeReason"),_=H.useState("rootId"),O=H.useState("floatingRootContext"),D=H.useState("floatingTreeRoot"),A=H.useState("closeDelay"),C=H.useState("activeTriggerElement"),I=V.type==="context-menu";y1({open:B,ref:H.context.popupRef,onComplete(){if(B)H.context.onOpenChangeComplete?.(!0)}}),yY.useEffect(()=>{function w(T){H.setOpen(!1,D0(T.reason,T.domEvent))}return D.events.on("close",w),()=>{D.events.off("close",w)}},[D.events,H]);let y=H.useState("hoverEnabled"),E=H.useState("disabled");C9(O,{enabled:y&&!E&&!I&&V.type!=="menubar",closeDelay:A});let h={transitionStatus:q,side:Y,align:K,open:B,nested:V.type==="menu",instant:N},k=W0("div",Z,{state:h,ref:[J,H.context.popupRef],stateAttributesMapping:Ss,props:[U,{onKeyDown(w){if(W&&X6.has(w.key))w.stopPropagation()}},W8(q),G,{"data-rootownerid":_}]}),S=V.type===void 0||I;if(L||V.type==="menubar"&&M!==K0.outsidePress)S=!0;return AE.jsx(D3,{context:O,modal:I,disabled:!F,returnFocus:z===void 0?S:z,initialFocus:V.type!=="menu",restoreFocus:!0,externalTree:V.type!=="menubar"?D:void 0,previousFocusableElement:C,nextFocusableElement:V.type===void 0?H.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:V.type===void 0?H.context.beforeContentFocusGuardRef:void 0,children:k})});var OE=P(v(),1);var bY=P(v(),1),mF=bY.createContext(void 0);function DE(){let $=bY.useContext(mF);if($===void 0)throw Error(S0(32));return $}var pF=P(c(),1),PE=OE.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:z}=J1();if(!(z.useState("mounted")||Q))return null;return pF.jsx(mF.Provider,{value:Q,children:pF.jsx(_3,{ref:J,...X})})});var Y9=P(v(),1);var R6=P(v(),1);var wE=P(c(),1);function xY($){let{children:Z,elementsRef:J,labelsRef:Q,onMapChange:X}=$,z=q0(X),G=R6.useRef(0),H=S5(Is).current,Y=S5(ks).current,[K,W]=R6.useState(0),B=R6.useRef(K),q=q0((V,M)=>{Y.set(V,M??null),B.current+=1,W(B.current)}),U=q0((V)=>{Y.delete(V),B.current+=1,W(B.current)}),F=R6.useMemo(()=>{ys(K);let V=new Map;return Array.from(Y.keys()).filter((_)=>_.isConnected).sort(Rs).forEach((_,O)=>{let D=Y.get(_)??{};V.set(_,{...D,index:O})}),V},[Y,K]);B0(()=>{if(typeof MutationObserver!=="function"||F.size===0)return;let V=new MutationObserver((M)=>{let _=new Set,O=(D)=>_.has(D)?_.delete(D):_.add(D);if(M.forEach((D)=>{D.removedNodes.forEach(O),D.addedNodes.forEach(O)}),_.size===0)B.current+=1,W(B.current)});return F.forEach((M,_)=>{if(_.parentElement)V.observe(_.parentElement,{childList:!0})}),()=>{V.disconnect()}},[F]),B0(()=>{if(B.current===K){if(J.current.length!==F.size)J.current.length=F.size;if(Q&&Q.current.length!==F.size)Q.current.length=F.size;G.current=F.size}z(F)},[z,F,J,Q,K]),B0(()=>{return()=>{J.current=[]}},[J]),B0(()=>{return()=>{if(Q)Q.current=[]}},[Q]);let N=q0((V)=>{return H.add(V),()=>{H.delete(V)}});B0(()=>{H.forEach((V)=>V(F))},[H,F]);let L=R6.useMemo(()=>({register:q,unregister:U,subscribeMapChange:N,elementsRef:J,labelsRef:Q,nextIndexRef:G}),[q,U,N,J,Q,G]);return wE.jsx(gF.Provider,{value:L,children:Z})}function ks(){return new Map}function Is(){return new Set}function Rs($,Z){let J=$.compareDocumentPosition(Z);if(J&Node.DOCUMENT_POSITION_FOLLOWING||J&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(J&Node.DOCUMENT_POSITION_PRECEDING||J&Node.DOCUMENT_POSITION_CONTAINS)return 1;return 0}function ys($){}var f$=P(c(),1),TE=Y9.forwardRef(function(Z,J){let{anchor:Q,positionMethod:X="absolute",className:z,render:G,side:H,align:Y,sideOffset:K=0,alignOffset:W=0,collisionBoundary:B="clipping-ancestors",collisionPadding:q=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=jE,...V}=Z,{store:M}=J1(),_=DE(),O=H9(!0),D=M.useState("parent"),A=M.useState("floatingRootContext"),C=M.useState("floatingTreeRoot"),I=M.useState("mounted"),y=M.useState("open"),E=M.useState("modal"),h=M.useState("activeTriggerElement"),k=M.useState("transitionStatus"),S=M.useState("lastOpenChangeReason"),w=M.useState("floatingNodeId"),T=M.useState("floatingParentNodeId"),R=Q,b=K,g=W,u=Y,j=L;if(D.type==="context-menu"){if(R=Q??D.context?.anchor,u=u??"start",!H&&u!=="center")g=Z.alignOffset??2,b=Z.sideOffset??-5}let e=H,t=u;if(D.type==="menu")e=e??"inline-end",t=t??"start",j=Z.collisionAvoidance??o2;else if(D.type==="menubar")e=e??"bottom",t=t??"start";let x=D.type==="context-menu",$0=a2({anchor:R,floatingRootContext:A,positionMethod:O?"fixed":X,mounted:I,side:e,sideOffset:b,align:t,alignOffset:g,arrowPadding:x?0:U,collisionBoundary:B,collisionPadding:q,sticky:F,nodeId:w,keepMounted:_,disableAnchorTracking:N,collisionAvoidance:j,shiftCrossAxis:x&&!(("side"in j)&&j.side==="flip"),externalTree:C}),M0=Y9.useMemo(()=>{let V0={};if(!y)V0.pointerEvents="none";return{role:"presentation",hidden:!I,style:{...$0.positionerStyles,...V0}}},[y,I,$0.positionerStyles]);Y9.useEffect(()=>{function V0(i){if(i.open){if(i.parentNodeId===w)M.set("hoverEnabled",!1);if(i.nodeId!==w&&i.parentNodeId===M.select("floatingParentNodeId"))M.setOpen(!1,D0(K0.siblingOpen))}}return C.events.on("menuopenchange",V0),()=>{C.events.off("menuopenchange",V0)}},[M,C.events,w]),Y9.useEffect(()=>{if(M.select("floatingParentNodeId")==null)return;function V0(i){if(i.open||i.nodeId!==M.select("floatingParentNodeId"))return;let Z0=i.reason??K0.siblingOpen;M.setOpen(!1,D0(Z0))}return C.events.on("menuopenchange",V0),()=>{C.events.off("menuopenchange",V0)}},[C.events,M]),Y9.useEffect(()=>{function V0(i){if(!y||i.nodeId!==M.select("floatingParentNodeId"))return;if(i.target&&h&&h!==i.target)M.setOpen(!1,D0(K0.siblingOpen))}return C.events.on("itemhover",V0),()=>{C.events.off("itemhover",V0)}},[C.events,y,h,M]),Y9.useEffect(()=>{let V0={open:y,nodeId:w,parentNodeId:T,reason:M.select("lastOpenChangeReason")};C.events.emit("menuopenchange",V0)},[C.events,y,M,w,T]);let l={open:y,side:$0.side,align:$0.align,anchorHidden:$0.anchorHidden,nested:D.type==="menu"},H0=Y9.useMemo(()=>({side:$0.side,align:$0.align,arrowRef:$0.arrowRef,arrowUncentered:$0.arrowUncentered,arrowStyles:$0.arrowStyles,nodeId:$0.context.nodeId}),[$0.side,$0.align,$0.arrowRef,$0.arrowUncentered,$0.arrowStyles,$0.context.nodeId]),U0=W0("div",Z,{state:l,stateAttributesMapping:V5,ref:[J,M.useStateSetter("positionerElement")],props:[M0,W8(k),V]}),X0=I&&D.type!=="menu"&&(D.type!=="menubar"&&E&&S!==K0.triggerHover||D.type==="menubar"&&D.context.modal),Y0=null;if(D.type==="menubar")Y0=D.context.contentElement;else if(D.type===void 0)Y0=h;return f$.jsxs(bF.Provider,{value:H0,children:[X0&&f$.jsx($$,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:g2(!y),cutout:Y0}),f$.jsx(KJ,{id:w,children:f$.jsx(xY,{elementsRef:M.context.itemDomElements,labelsRef:M.context.itemLabels,children:U0})})]})});var m$=P(v(),1);var hY=P(v(),1),uF=hY.createContext(void 0);function CE(){let $=hY.useContext(uF);if($===void 0)throw Error(S0(34));return $}var EE=P(c(),1),SE=m$.memo(m$.forwardRef(function(Z,J){let{render:Q,className:X,value:z,defaultValue:G,onValueChange:H,disabled:Y=!1,...K}=Z,[W,B]=n4({controlled:z,default:G,name:"MenuRadioGroup"}),q=q0(H),U=q0((V,M)=>{if(q?.(V,M),M.isCanceled)return;B(V)}),N=W0("div",Z,{state:{disabled:Y},ref:J,props:{role:"group","aria-disabled":Y||void 0,...K}}),L=m$.useMemo(()=>({value:W,setValue:U,disabled:Y}),[W,U,Y]);return EE.jsx(uF.Provider,{value:L,children:N})}));var vY=P(v(),1);var gY=P(v(),1),cF=gY.createContext(void 0);function kE(){let $=gY.useContext(cF);if($===void 0)throw Error(S0(35));return $}var IE=P(c(),1),RE=vY.forwardRef(function(Z,J){let{render:Q,className:X,id:z,label:G,nativeButton:H=!1,disabled:Y=!1,closeOnClick:K=!1,value:W,...B}=Z,q=N4({label:G}),U=F4(!0),F=t0(z),{store:N}=J1(),L=N.useState("isActive",q.index),V=N.useState("itemProps"),{value:M,setValue:_,disabled:O}=CE(),D=O||Y,A=M===W,{getItemProps:C,itemRef:I}=k6({closeOnClick:K,disabled:D,highlighted:L,id:F,store:N,nativeButton:H,nodeId:U?.nodeId,itemMetadata:h$}),y=vY.useMemo(()=>({disabled:D,highlighted:L,checked:A}),[D,L,A]),E=q0((k)=>{let S={...D0(K0.itemPress,k.nativeEvent),preventUnmountOnClose:()=>{}};_(W,S)}),h=W0("div",Z,{state:y,stateAttributesMapping:I6,props:[V,{role:"menuitemradio","aria-checked":A,onClick:E},B,C],ref:[I,J,q.ref]});return IE.jsx(cF.Provider,{value:y,children:h})});var fY=P(v(),1);var yE=fY.forwardRef(function(Z,J){let{render:Q,className:X,keepMounted:z=!1,...G}=Z,H=kE(),Y=fY.useRef(null),{transitionStatus:K,setMounted:W}=c4(H.checked);y1({open:H.checked,ref:Y,onComplete(){if(!H.checked)W(!1)}});let B={checked:H.checked,disabled:H.disabled,highlighted:H.highlighted,transitionStatus:K};return W0("span",Z,{state:B,stateAttributesMapping:I6,ref:[J,Y],props:{"aria-hidden":!0,...G},enabled:z||H.checked})});var S1=P(v(),1);var mY=P(v(),1),bs=mY.createContext(null);function pY($){let Z=mY.useContext(bs);if(Z===null&&!$)throw Error(S0(5));return Z}var jQ=P(v(),1);var xs={...i2,disabled:k0(($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled),modal:k0(($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0)),allowMouseEnter:k0(($)=>$.allowMouseEnter),stickIfOpen:k0(($)=>$.stickIfOpen),parent:k0(($)=>$.parent),rootId:k0(($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId}),activeIndex:k0(($)=>$.activeIndex),isActive:k0(($,Z)=>$.activeIndex===Z),hoverEnabled:k0(($)=>$.hoverEnabled),instantType:k0(($)=>$.instantType),lastOpenChangeReason:k0(($)=>$.openChangeReason),floatingTreeRoot:k0(($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot}),floatingNodeId:k0(($)=>$.floatingNodeId),floatingParentNodeId:k0(($)=>$.floatingParentNodeId),itemProps:k0(($)=>$.itemProps),closeDelay:k0(($)=>$.closeDelay),keyboardEventRelay:k0(($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return})};class p$ extends i8{constructor($){super({...hs(),...$},{positionerRef:jQ.createRef(),popupRef:jQ.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:jQ.createRef(),beforeContentFocusGuardRef:jQ.createRef(),onOpenChangeComplete:void 0,triggerElements:new a8},xs);this.unsubscribeParentListener=this.observe("parent",(Z)=>{if(this.unsubscribeParentListener?.(),Z.type==="menu"){this.unsubscribeParentListener=Z.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=Z.store.context.allowMouseUpTriggerRef;return}if(Z.type!==void 0)this.context.allowMouseUpTriggerRef=Z.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}static useStore($,Z){let J=S5(()=>{return new p$(Z)}).current;return $??J}unsubscribeParentListener=null}function hs(){return{...l2(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new V3,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:k5,keyboardEventRelay:void 0,closeDelay:0}}var uY=P(v(),1),dF=uY.createContext(void 0);function cY(){return uY.useContext(dF)}var lF=P(c(),1),dY=QJ(function(Z){let{children:J,open:Q,onOpenChange:X,onOpenChangeComplete:z,defaultOpen:G=!1,disabled:H=!1,modal:Y,loopFocus:K=!0,orientation:W="vertical",actionsRef:B,closeParentOnEsc:q=!1,handle:U,triggerId:F,defaultTriggerId:N=null,highlightItemOnHover:L=!0}=Z,V=H9(!0),M=J1(!0),_=pY(!0),O=cY(),D=S1.useMemo(()=>{if(O&&M)return{type:"menu",store:M.store};if(_)return{type:"menubar",context:_};if(V&&!M)return{type:"context-menu",context:V};return{type:void 0}},[V,M,_,O]),A=p$.useStore(U?.store,{open:G,openProp:Q,activeTriggerId:N,triggerIdProp:F,parent:D});s2(()=>{if(Q===void 0&&A.state.open===!1&&G===!0)A.update({open:!0,activeTriggerId:N})}),A.useControlledProp("openProp",Q),A.useControlledProp("triggerIdProp",F),A.useContextCallback("onOpenChangeComplete",z);let C=A.useState("floatingTreeRoot"),I=L3(C),y=t1();B0(()=>{if(V&&!M)A.update({parent:{type:"context-menu",context:V},floatingNodeId:I,floatingParentNodeId:y});else if(M)A.update({floatingNodeId:I,floatingParentNodeId:y})},[V,M,I,y,A]);let E=A.useState("open"),h=A.useState("activeTriggerElement"),k=A.useState("positionerElement"),S=A.useState("hoverEnabled"),w=A.useState("modal"),T=A.useState("disabled"),R=A.useState("lastOpenChangeReason"),b=A.useState("parent"),g=A.useState("activeIndex"),u=A.useState("payload"),j=A.useState("floatingParentNodeId"),e=S1.useRef(null),t=j!=null,x;A.useSyncedValues({disabled:H,modal:b.type===void 0?Y:void 0,rootId:K8()});let{openMethod:$0,triggerProps:M0,reset:l}=Q$(E);c2(A);let{forceUnmount:H0}=d2(E,A,()=>{A.update({allowMouseEnter:!1,stickIfOpen:!0}),l()}),U0=S1.useRef(b.type!=="context-menu"),X0=L1();S1.useEffect(()=>{if(!E)e.current=null;if(b.type!=="context-menu")return;if(!E){X0.clear(),U0.current=!1;return}X0.start(500,()=>{U0.current=!0})},[X0,E,b.type]),Z$(E&&w&&R!==K0.triggerHover&&$0!=="touch",k),B0(()=>{if(!E&&!S)A.set("hoverEnabled",!0)},[E,S,A]);let Y0=S1.useRef(!0),V0=L1(),i=q0((l0,R0)=>{let G0=R0.reason;if(E===l0&&R0.trigger===h&&R===G0)return;if(R0.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},!l0&&R0.trigger==null)R0.trigger=h??void 0;if(X?.(l0,R0),R0.isCanceled)return;let A0={open:l0,nativeEvent:R0.event,reason:R0.reason,nested:t};x?.emit("openchange",A0);let f0=R0.event;if(l0===!1&&f0?.type==="click"&&f0.pointerType==="touch"&&!Y0.current)return;if(!l0&&g!==null){let T0=A.context.itemDomElements.current[g];queueMicrotask(()=>{T0?.setAttribute("tabindex","-1")})}if(l0&&G0===K0.triggerFocus)Y0.current=!1,V0.start(300,()=>{Y0.current=!0});else Y0.current=!0,V0.clear();let w5=(G0===K0.triggerPress||G0===K0.itemPress)&&f0.detail===0&&f0?.isTrusted,W5=!l0&&(G0===K0.escapeKey||G0==null),l5={open:l0,openChangeReason:G0};e.current=R0.event??null;let I0=R0.trigger?.id??null;if(I0||l0)l5.activeTriggerId=I0,l5.activeTriggerElement=R0.trigger??null;if(A.update(l5),b.type==="menubar"&&(G0===K0.triggerFocus||G0===K0.focusOut||G0===K0.triggerHover||G0===K0.listNavigation||G0===K0.siblingOpen))A.set("instantType","group");else if(w5||W5)A.set("instantType",w5?"click":"dismiss");else A.set("instantType",void 0)}),Z0=S1.useCallback((l0)=>{let R0=D0(l0);return R0.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},R0},[A]),J0=S1.useCallback(()=>{A.setOpen(!1,Z0(K0.imperativeAction))},[A,Z0]);S1.useImperativeHandle(B,()=>({unmount:H0,close:J0}),[H0,J0]);let Q0;if(b.type==="context-menu")Q0=b.context;S1.useImperativeHandle(Q0?.positionerRef,()=>k,[k]),S1.useImperativeHandle(Q0?.actionsRef,()=>({setOpen:i}),[i]);let n=U2({popupStore:A,onOpenChange:i});x=n.context.events,S1.useEffect(()=>{let l0=({open:R0,eventDetails:G0})=>i(R0,G0);return x.on("setOpen",l0),()=>{x?.off("setOpen",l0)}},[x,i]);let m=q2(n,{enabled:!T,bubbles:{escapeKey:q&&b.type==="menu"},outsidePress(){if(b.type!=="context-menu"||e.current?.type==="contextmenu")return!0;return U0.current},externalTree:t?C:void 0}),d=T3(n,{role:"menu"}),f=d4(),a=S1.useCallback((l0)=>{if(A.select("activeIndex")===l0)return;A.set("activeIndex",l0)},[A]),o=Cq(n,{enabled:!T,listRef:A.context.itemDomElements,activeIndex:g,nested:b.type!==void 0,loopFocus:K,orientation:W,parentOrientation:b.type==="menubar"?b.context.orientation:void 0,rtl:f==="rtl",disabledIndices:TQ,onNavigate:a,openOnArrowKeyDown:b.type!=="context-menu",externalTree:t?C:void 0,focusItemOnHover:L}),N0=S1.useCallback((l0)=>{A.context.typingRef.current=l0},[A]),j0=Eq(n,{listRef:A.context.itemLabels,activeIndex:g,resetMs:bE,onMatch:(l0)=>{if(E&&l0!==g)A.set("activeIndex",l0)},onTypingChange:N0}),{getReferenceProps:h0,getFloatingProps:c0,getItemProps:p,getTriggerProps:r}=$8([m,d,o,j0]),z0=S1.useMemo(()=>{let l0=K4(h0(),{onMouseMove(){A.set("allowMouseEnter",!0)}},M0);return delete l0.role,l0},[h0,A,M0]),L0=S1.useMemo(()=>{let l0=r();if(!l0)return l0;let R0=K4(l0,M0);return delete R0.role,delete R0["aria-controls"],R0},[r,M0]),P0=S1.useMemo(()=>c0({onMouseMove(){if(A.set("allowMouseEnter",!0),b.type==="menu")A.set("hoverEnabled",!1)},onClick(){if(A.select("hoverEnabled"))A.set("hoverEnabled",!1)},onKeyDown(l0){let R0=A.select("keyboardEventRelay");if(R0&&!l0.isPropagationStopped())R0(l0)}}),[c0,b.type,A]),v0=S1.useMemo(()=>p(),[p]);A.useSyncedValues({floatingRootContext:n,activeTriggerProps:z0,inactiveTriggerProps:L0,popupProps:P0,itemProps:v0});let $5=S1.useMemo(()=>({store:A,parent:D}),[A,D]),F5=lF.jsx(xF.Provider,{value:$5,children:typeof J==="function"?J({payload:u}):J});if(b.type===void 0||b.type==="context-menu")return lF.jsx(WJ,{externalTree:C,children:F5});return F5});var xE=P(v(),1);var iF=P(c(),1);function hE($){let Z=J1().store,J=xE.useMemo(()=>({parentMenu:Z}),[Z]);return iF.jsx(dF.Provider,{value:J,children:iF.jsx(dY,{...$})})}var h8=P(v(),1),aF=P(H4(),1);function gE($){let Z=$.getBoundingClientRect(),J=window.getComputedStyle($,"::before"),Q=window.getComputedStyle($,"::after");if(!(J.content!=="none"||Q.content!=="none"))return Z;let z=parseFloat(J.width)||0,G=parseFloat(J.height)||0,H=parseFloat(Q.width)||0,Y=parseFloat(Q.height)||0,K=Math.max(Z.width,z,H),W=Math.max(Z.height,G,Y),B=K-Z.width,q=W-Z.height;return{left:Z.left-B/2,right:Z.right+B/2,top:Z.top-q/2,bottom:Z.bottom+q/2}}var iY=P(v(),1);function vE($={}){let{highlightItemOnHover:Z,highlightedIndex:J,onHighlightedIndexChange:Q}=lY(),{ref:X,index:z}=N4($),G=J===z,H=iY.useRef(null),Y=P4(X,H);return{compositeProps:iY.useMemo(()=>({tabIndex:G?0:-1,onFocus(){Q(z)},onMouseMove(){let W=H.current;if(!Z||!W)return;let B=W.hasAttribute("disabled")||W.ariaDisabled==="true";if(!G&&!B)W.focus()}}),[G,Q,z,Z]),compositeRef:Y,index:z}}function fE($){let{render:Z,className:J,state:Q=k5,props:X=TQ,refs:z=TQ,metadata:G,stateAttributesMapping:H,tag:Y="div",...K}=$,{compositeProps:W,compositeRef:B}=vE({metadata:G});return W0(Y,$,{state:Q,ref:[...z,B],props:[W,...X,K],stateAttributesMapping:H})}function rF($){if(M1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid")??void 0;if(d7($))return;return rF(lz($))}var rY=P(v(),1);function mE($){let{enabled:Z=!0,mouseDownAction:J,open:Q}=$,X=rY.useRef(!1);return rY.useMemo(()=>{if(!Z)return k5;return{onMouseDown:(z)=>{if(J==="open"&&!Q||J==="close"&&Q)X.current=!0,u0(z.currentTarget).addEventListener("click",()=>{X.current=!1},{once:!0})},onClick:(z)=>{if(X.current)X.current=!1,z.preventBaseUIHandler()}}},[Z,J,Q])}var y6=P(c(),1),aY=2,pE=Hz(function(Z,J){let{render:Q,className:X,disabled:z=!1,nativeButton:G=!0,id:H,openOnHover:Y,delay:K=100,closeDelay:W=0,handle:B,payload:q,...U}=Z,F=J1(!0),N=B?.store??F?.store;if(!N)throw Error(S0(85));let L=t0(H),V=N.useState("isTriggerActive",L),M=N.useState("floatingRootContext"),_=N.useState("isOpenedByTrigger",L),O=h8.useRef(null),D=vs(),A=lY(!0),C=I8(),I=h8.useMemo(()=>{return C??new V3},[C]),y=L3(I),E=t1(),{registerTrigger:h,isMountedByThisTrigger:k}=u2(L,O,N,{payload:q,closeDelay:W,parent:D,floatingTreeRoot:I,floatingNodeId:y,floatingParentNodeId:E,keyboardEventRelay:A?.relayKeyboardEvent}),S=D.type==="menubar",w=N.useState("disabled"),T=z||w||S&&D.context.disabled,{getButtonProps:R,buttonRef:b}=p1({disabled:T,native:G});h8.useEffect(()=>{if(!_&&D.type===void 0)N.context.allowMouseUpTriggerRef.current=!1},[N,_,D.type]);let g=h8.useRef(null),u=L1(),j=q0((m)=>{if(!g.current)return;u.clear(),N.context.allowMouseUpTriggerRef.current=!1;let d=m.target;if(p0(g.current,d)||p0(N.select("positionerElement"),d)||d===g.current)return;if(d!=null&&rF(d)===N.select("rootId"))return;let f=gE(g.current);if(m.clientX>=f.left-aY&&m.clientX<=f.right+aY&&m.clientY>=f.top-aY&&m.clientY<=f.bottom+aY)return;I.events.emit("close",{domEvent:m,reason:K0.cancelOpen})});h8.useEffect(()=>{if(_&&N.select("lastOpenChangeReason")===K0.triggerHover)u0(g.current).addEventListener("mouseup",j,{once:!0})},[_,j,N]);let e=S&&D.context.hasSubmenuOpen,x=F2(M,{enabled:(Y??e)&&!T&&D.type!=="context-menu"&&(!S||e&&!k),handleClose:N2({blockPointerEvents:!S}),mouseOnly:!0,move:!1,restMs:D.type===void 0?K:void 0,delay:{close:W},triggerElementRef:O,externalTree:I,isActiveTrigger:V}),$0=gs(_,N.select("lastOpenChangeReason")),M0=T9(M,{enabled:!T&&D.type!=="context-menu",event:_&&S?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?$0:!1}),l=P3(M,{enabled:!T&&e}),H0=mE({open:_,enabled:S,mouseDownAction:"open"}),U0=$8([M0,l]),X0={disabled:T,open:_},Y0=N.useState("triggerProps",k),V0=[g,J,b,h,O],i=[U0.getReferenceProps(),x??k5,Y0,{"aria-haspopup":"menu",id:L,onMouseDown:(m)=>{if(N.select("open"))return;u.start(200,()=>{N.context.allowMouseUpTriggerRef.current=!0}),u0(m.currentTarget).addEventListener("mouseup",j,{once:!0})}},S?{role:"menuitem"}:{},H0,U,R],Z0=h8.useRef(null),J0=q0((m)=>{aF.flushSync(()=>{N.setOpen(!1,D0(K0.focusOut,m.nativeEvent,m.currentTarget))}),Iz(Z0.current)?.focus()}),Q0=q0((m)=>{let d=N.select("positionerElement");if(d&&Y2(m,d))N.context.beforeContentFocusGuardRef.current?.focus();else{aF.flushSync(()=>{N.setOpen(!1,D0(K0.focusOut,m.nativeEvent,m.currentTarget))});let f=kz(N.context.triggerFocusTargetRef.current||O.current);while(f!==null&&p0(d,f)){let a=f;if(f=n9(f),f===a)break}f?.focus()}}),n=W0("button",Z,{enabled:!S,stateAttributesMapping:DJ,state:X0,ref:V0,props:i});if(S)return y6.jsx(fE,{tag:"button",render:Q,className:X,state:X0,refs:V0,props:i,stateAttributesMapping:DJ});if(_)return y6.jsxs(h8.Fragment,{children:[y6.jsx(S8,{ref:Z0,onFocus:J0},`${L}-pre-focus-guard`),y6.jsx(h8.Fragment,{children:n},L),y6.jsx(S8,{ref:N.context.triggerFocusTargetRef,onFocus:Q0},`${L}-post-focus-guard`)]});return y6.jsx(h8.Fragment,{children:n},L)});function gs($,Z){let J=L1(),[Q,X]=h8.useState(!1);return B0(()=>{if($&&Z==="trigger-hover")X(!0),J.start(nY,()=>{X(!1)});else if(!$)J.clear(),X(!1)},[$,Z,J]),Q}function vs(){let $=H9(!0),Z=J1(!0),J=pY(!0);return h8.useMemo(()=>{if(J)return{type:"menubar",context:J};if($&&!Z)return{type:"context-menu",context:$};return{type:void 0}},[$,Z,J])}var uE=P(v(),1);var cE=uE.forwardRef(function(Z,J){let{className:Q,render:X,orientation:z="horizontal",...G}=Z;return W0("div",Z,{state:{orientation:z},ref:J,props:[{role:"separator","aria-orientation":z},G]})});var I9=P(v(),1);var dE=I9.forwardRef(function(Z,J){let{render:Q,className:X,label:z,id:G,nativeButton:H=!1,openOnHover:Y=!0,delay:K=100,closeDelay:W=0,disabled:B=!1,...q}=Z,U=N4(),F=F4(),{store:N}=J1(),L=t0(G),V=N.useState("open"),M=N.useState("floatingRootContext"),_=N.useState("floatingTreeRoot"),O=Dq(L,N),D=I9.useCallback((M0)=>{let l=O(M0);if(M0!==null&&N.select("open")&&N.select("activeTriggerId")==null)N.update({activeTriggerId:L,activeTriggerElement:M0,closeDelay:W});return l},[O,W,N,L]),A=I9.useRef(null),C=I9.useCallback((M0)=>{A.current=M0,N.set("activeTriggerElement",M0)},[N]),I=cY();if(!I?.parentMenu)throw Error(S0(37));N.useSyncedValue("closeDelay",W);let y=I.parentMenu,E=y.useState("itemProps"),h=y.useState("isActive",U.index),k=I9.useMemo(()=>({type:"submenu-trigger",setActive(){y.set("activeIndex",U.index)}}),[y,U.index]),S=N.useState("disabled"),w=B||S,{getItemProps:T,itemRef:R}=k6({closeOnClick:!1,disabled:w,highlighted:h,id:L,store:N,nativeButton:H,itemMetadata:k,nodeId:F?.nodeId}),b=N.useState("hoverEnabled"),g=y.useState("allowMouseEnter"),u=F2(M,{enabled:b&&Y&&!w,handleClose:N2({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:K,delay:g?{open:K,close:W}:0,triggerElementRef:A,externalTree:_}),j=T9(M,{enabled:!w,event:"mousedown",toggle:!Y,ignoreMouse:Y,stickIfOpen:!1}),e=$8([j]),t=N.useState("triggerProps",!0);return delete t.id,W0("div",Z,{state:{disabled:w,highlighted:h,open:V},stateAttributesMapping:n2,props:[e.getReferenceProps(),u,t,E,{tabIndex:V||h?0:-1,onBlur(){if(h)y.set("activeIndex",null)}},q,T],ref:[J,U.ref,R,D,C]})});class oY{constructor(){this.store=new p$}open($){let Z=$?this.store.context.triggerElements.getById($):void 0;if($&&!Z)throw Error(S0(83,$));this.store.setOpen(!0,D0("imperative-action",void 0,Z))}close(){this.store.setOpen(!1,D0("imperative-action",void 0,void 0))}get isOpen(){return this.store.state.open}}function lE(){return new oY}var g8=P(c(),1);function u$({...$}){return g8.jsx(t8.Root,{"data-slot":"dropdown-menu",...$})}function c$({...$}){return g8.jsx(t8.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function d$({align:$="start",alignOffset:Z=0,side:J="bottom",sideOffset:Q=4,className:X,...z}){return g8.jsx(t8.Portal,{children:g8.jsx(t8.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:J,sideOffset:Q,children:g8.jsx(t8.Popup,{"data-slot":"dropdown-menu-content",className:s("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",X),...z})})})}function l$({...$}){return g8.jsx(t8.Group,{"data-slot":"dropdown-menu-group",...$})}function sY({className:$,inset:Z,...J}){return g8.jsx(t8.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:s("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:pl-7",$),...J})}function CQ({className:$,inset:Z,variant:J="default",...Q}){return g8.jsx(t8.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":J,className:s("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",$),...Q})}function iE({...$}){return g8.jsx(t8.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function rE({className:$,children:Z,inset:J,...Q}){return g8.jsxs(t8.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":J,className:s("relative flex cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...Q,children:[g8.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:g8.jsx(t8.RadioItemIndicator,{children:g8.jsx(K6,{stroke:1.75})})}),Z]})}function aE({className:$,...Z}){return g8.jsx(t8.Separator,{"data-slot":"dropdown-menu-separator",className:s("mx-2 my-1 h-px bg-border",$),...Z})}var b6={};D4(b6,{createHandle:()=>AS,Viewport:()=>MS,Trigger:()=>eE,Title:()=>BS,Root:()=>sE,Positioner:()=>QS,Portal:()=>JS,Popup:()=>zS,Handle:()=>JK,Description:()=>US,Close:()=>NS,Backdrop:()=>KS,Arrow:()=>HS});var J2=P(v(),1);var tY=P(v(),1),nF=tY.createContext(void 0);function h1($){let Z=tY.useContext(nF);if(Z===void 0&&!$)throw Error(S0(47));return Z}var i$=P(v(),1),nE=P(H4(),1);function fs(){return{...l2(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var ms={...i2,disabled:k0(($)=>$.disabled),instantType:k0(($)=>$.instantType),openMethod:k0(($)=>$.openMethod),openChangeReason:k0(($)=>$.openChangeReason),modal:k0(($)=>$.modal),stickIfOpen:k0(($)=>$.stickIfOpen),titleElementId:k0(($)=>$.titleElementId),descriptionElementId:k0(($)=>$.descriptionElementId),openOnHover:k0(($)=>$.openOnHover),closeDelay:k0(($)=>$.closeDelay),hasViewport:k0(($)=>$.hasViewport)};class r$ extends i8{constructor($){let Z={...fs(),...$};if(Z.open&&$?.mounted===void 0)Z.mounted=!0;super(Z,{popupRef:i$.createRef(),backdropRef:i$.createRef(),internalBackdropRef:i$.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:i$.createRef(),beforeContentFocusGuardRef:i$.createRef(),stickIfOpenTimeout:new i1,triggerElements:new a8},ms)}setOpen=($,Z)=>{let J=Z.reason===K0.triggerHover,Q=Z.reason===K0.triggerPress&&Z.event.detail===0,X=!$&&(Z.reason===K0.escapeKey||Z.reason==null);if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.($,Z),Z.isCanceled)return;let z={open:$,nativeEvent:Z.event,reason:Z.reason,nested:this.state.nested,triggerElement:Z.trigger};this.state.floatingRootContext.context.events?.emit("openchange",z);let H=()=>{let Y={open:$,openChangeReason:Z.reason},K=Z.trigger?.id??null;if(K||$)Y.activeTriggerId=K,Y.activeTriggerElement=Z.trigger??null;this.update(Y)};if(J)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(nY,()=>{this.set("stickIfOpen",!1)}),nE.flushSync(H);else H();if(Q||X)this.set("instantType",Q?"click":"dismiss");else if(Z.reason===K0.focusOut)this.set("instantType","focus");else this.set("instantType",void 0)};static useStore($,Z){let J=S5(()=>{return new r$(Z)}).current,Q=$??J;return C8(J.disposeEffect),Q}disposeEffect=()=>{return this.context.stickIfOpenTimeout.disposeEffect()}}var EQ=P(c(),1);function oE({props:$}){let{children:Z,open:J,defaultOpen:Q=!1,onOpenChange:X,onOpenChangeComplete:z,modal:G=!1,handle:H,triggerId:Y,defaultTriggerId:K=null}=$,W=r$.useStore(H?.store,{modal:G,open:Q,openProp:J,activeTriggerId:K,triggerIdProp:Y});s2(()=>{if(J===void 0&&W.state.open===!1&&Q===!0)W.update({open:!0,activeTriggerId:K})}),W.useControlledProp("openProp",J),W.useControlledProp("triggerIdProp",Y);let B=W.useState("open"),q=W.useState("positionerElement"),U=W.useState("payload"),F=W.useState("openChangeReason");W.useContextCallback("onOpenChange",X),W.useContextCallback("onOpenChangeComplete",z);let{openMethod:N,triggerProps:L,reset:V}=Q$(B);c2(W);let{forceUnmount:M}=d2(B,W,()=>{W.update({stickIfOpen:!0,openChangeReason:null}),V()});Z$(B&&G===!0&&F!==K0.triggerHover&&N!=="touch",q),J2.useEffect(()=>{if(!B)W.context.stickIfOpenTimeout.clear()},[W,B]);let _=J2.useCallback((T)=>{let R=D0(T);return R.preventUnmountOnClose=()=>{W.set("preventUnmountingOnClose",!0)},R},[W]),O=J2.useCallback(()=>{W.setOpen(!1,_(K0.imperativeAction))},[W,_]);J2.useImperativeHandle($.actionsRef,()=>({unmount:M,close:O}),[M,O]);let D=U2({popupStore:W,onOpenChange:W.setOpen}),A=q2(D,{outsidePressEvent:{mouse:G==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),C=T3(D),{getReferenceProps:I,getFloatingProps:y,getTriggerProps:E}=$8([A,C]),h=J2.useMemo(()=>{return I(L)},[I,L]),k=J2.useMemo(()=>{return E(L)},[E,L]),S=J2.useMemo(()=>{return y()},[y]);W.useSyncedValues({modal:G,openMethod:N,activeTriggerProps:h,inactiveTriggerProps:k,popupProps:S,floatingRootContext:D,nested:t1()!=null});let w=J2.useMemo(()=>({store:W}),[W]);return EQ.jsx(nF.Provider,{value:w,children:typeof Z==="function"?Z({payload:U}):Z})}function sE($){if(h1(!0))return EQ.jsx(oE,{props:$});return EQ.jsx(WJ,{children:EQ.jsx(oE,{props:$})})}var O2=P(v(),1),oF=P(H4(),1);var tE=300;var e3=P(c(),1),eE=O2.forwardRef(function(Z,J){let{render:Q,className:X,disabled:z=!1,nativeButton:G=!0,handle:H,payload:Y,openOnHover:K=!1,delay:W=tE,closeDelay:B=0,id:q,...U}=Z,F=h1(!0),N=H?.store??F?.store;if(!N)throw Error(S0(74));let L=t0(q),V=N.useState("isTriggerActive",L),M=N.useState("floatingRootContext"),_=N.useState("isOpenedByTrigger",L),O=O2.useRef(null),{registerTrigger:D,isMountedByThisTrigger:A}=u2(L,O,N,{payload:Y,disabled:z,openOnHover:K,closeDelay:B}),C=N.useState("openChangeReason"),I=N.useState("stickIfOpen"),y=N.useState("openMethod"),E=F2(M,{enabled:M!=null&&K&&(y!=="touch"||C!==K0.triggerPress),mouseOnly:!0,move:!1,handleClose:N2(),restMs:W,delay:{close:B},triggerElementRef:O,isActiveTrigger:V}),h=T9(M,{enabled:M!=null,stickIfOpen:I}),k=$8([h]),S=N.useState("triggerProps",A),w={disabled:z,open:_},{getButtonProps:T,buttonRef:R}=p1({disabled:z,native:G}),b=O2.useMemo(()=>({open(t){if(t&&C===K0.triggerPress)return DJ.open(t);return n2.open(t)}}),[C]),g=W0("button",Z,{state:w,ref:[R,J,D,O],props:[k.getReferenceProps(),E,S,{[c7]:"",id:L},U,T],stateAttributesMapping:b}),u=O2.useRef(null),j=q0((t)=>{oF.flushSync(()=>{N.setOpen(!1,D0(K0.focusOut,t.nativeEvent,t.currentTarget))}),Iz(u.current)?.focus()}),e=q0((t)=>{let x=N.select("positionerElement");if(x&&Y2(t,x))N.context.beforeContentFocusGuardRef.current?.focus();else{oF.flushSync(()=>{N.setOpen(!1,D0(K0.focusOut,t.nativeEvent,t.currentTarget))});let $0=kz(N.context.triggerFocusTargetRef.current||O.current);while($0!==null&&p0(x,$0)){let M0=$0;if($0=n9($0),$0===M0)break}$0?.focus()}});if(V)return e3.jsxs(O2.Fragment,{children:[e3.jsx(S8,{ref:u,onFocus:j}),e3.jsx(O2.Fragment,{children:g},L),e3.jsx(S8,{ref:N.context.triggerFocusTargetRef,onFocus:e})]});return e3.jsx(O2.Fragment,{children:g},L)});var ZS=P(v(),1);var eY=P(v(),1),sF=eY.createContext(void 0);function $S(){let $=eY.useContext(sF);if($===void 0)throw Error(S0(45));return $}var tF=P(c(),1),JS=ZS.forwardRef(function(Z,J){let{keepMounted:Q=!1,...X}=Z,{store:z}=h1();if(!(z.useState("mounted")||Q))return null;return tF.jsx(sF.Provider,{value:Q,children:tF.jsx(_3,{ref:J,...X})})});var R9=P(v(),1);var $K=P(v(),1),eF=$K.createContext(void 0);function a$(){let $=$K.useContext(eF);if(!$)throw Error(S0(46));return $}var SQ=P(c(),1),QS=R9.forwardRef(function(Z,J){let{render:Q,className:X,anchor:z,positionMethod:G="absolute",side:H="bottom",align:Y="center",sideOffset:K=0,alignOffset:W=0,collisionBoundary:B="clipping-ancestors",collisionPadding:q=5,arrowPadding:U=5,sticky:F=!1,disableAnchorTracking:N=!1,collisionAvoidance:L=o2,...V}=Z,{store:M}=h1(),_=$S(),O=L3(),D=M.useState("floatingRootContext"),A=M.useState("mounted"),C=M.useState("open"),I=M.useState("openChangeReason"),y=M.useState("activeTriggerElement"),E=M.useState("modal"),h=M.useState("positionerElement"),k=M.useState("instantType"),S=M.useState("transitionStatus"),w=M.useState("hasViewport"),T=R9.useRef(null),R=m2(h,!1,!1),b=a2({anchor:z,floatingRootContext:D,positionMethod:G,mounted:A,side:H,sideOffset:K,align:Y,alignOffset:W,arrowPadding:U,collisionBoundary:B,collisionPadding:q,sticky:F,disableAnchorTracking:N,keepMounted:_,nodeId:O,collisionAvoidance:L,adaptiveOrigin:w?r7:void 0}),g=R9.useMemo(()=>{let $0={};if(!C)$0.pointerEvents="none";return{role:"presentation",hidden:!A,style:{...b.positionerStyles,...$0}}},[C,A,b.positionerStyles]),u=R9.useMemo(()=>({props:g,...b}),[g,b]),j=D.useState("domReferenceElement");B0(()=>{let $0=j,M0=T.current;if($0)T.current=$0;if(M0&&$0&&$0!==M0){M.set("instantType",void 0);let l=new AbortController;return R(()=>{M.set("instantType","trigger-change")},l.signal),()=>{l.abort()}}return},[j,R,M]);let e={open:C,side:u.side,align:u.align,anchorHidden:u.anchorHidden,instant:k},t=R9.useCallback(($0)=>{M.set("positionerElement",$0)},[M]),x=W0("div",Z,{state:e,props:[u.props,W8(S),V],ref:[J,t],stateAttributesMapping:V5});return SQ.jsxs(eF.Provider,{value:u,children:[A&&E===!0&&I!==K0.triggerHover&&SQ.jsx($$,{ref:M.context.internalBackdropRef,inert:g2(!C),cutout:y}),SQ.jsx(KJ,{id:O,children:x})]})});var ZK=P(v(),1);var XS=P(c(),1),ps={...V5,...p5},zS=ZK.forwardRef(function(Z,J){let{className:Q,render:X,initialFocus:z,finalFocus:G,...H}=Z,{store:Y}=h1(),K=a$(),W=RY(!0)!=null,B=Y.useState("open"),q=Y.useState("openMethod"),U=Y.useState("instantType"),F=Y.useState("transitionStatus"),N=Y.useState("popupProps"),L=Y.useState("titleElementId"),V=Y.useState("descriptionElementId"),M=Y.useState("modal"),_=Y.useState("mounted"),O=Y.useState("openChangeReason"),D=Y.useState("activeTriggerElement"),A=Y.useState("floatingRootContext");y1({open:B,ref:Y.context.popupRef,onComplete(){if(B)Y.context.onOpenChangeComplete?.(!0)}});let C=Y.useState("disabled"),I=Y.useState("openOnHover"),y=Y.useState("closeDelay");C9(A,{enabled:I&&!C,closeDelay:y});function E(T){if(T==="touch")return Y.context.popupRef.current;return!0}let h=z===void 0?E:z,k={open:B,side:K.side,align:K.align,instant:U,transitionStatus:F},S=ZK.useCallback((T)=>{Y.set("popupElement",T)},[Y]),w=W0("div",Z,{state:k,ref:[J,Y.context.popupRef,S],props:[N,{"aria-labelledby":L,"aria-describedby":V,onKeyDown(T){if(W&&X6.has(T.key))T.stopPropagation()}},W8(F),H],stateAttributesMapping:ps});return XS.jsx(D3,{context:A,openInteractionType:q,modal:M==="trap-focus",disabled:!_||O===K0.triggerHover,initialFocus:h,returnFocus:G,restoreFocus:"popup",previousFocusableElement:M1(D)?D:void 0,nextFocusableElement:Y.context.triggerFocusTargetRef,beforeContentFocusGuardRef:Y.context.beforeContentFocusGuardRef,children:w})});var GS=P(v(),1);var HS=GS.forwardRef(function(Z,J){let{className:Q,render:X,...z}=Z,{store:G}=h1(),H=G.useState("open"),{arrowRef:Y,side:K,align:W,arrowUncentered:B,arrowStyles:q}=a$();return W0("div",Z,{state:{open:H,side:K,align:W,uncentered:B},ref:[J,Y],props:[{style:q,"aria-hidden":!0},z],stateAttributesMapping:V5})});var YS=P(v(),1);var us={...V5,...p5},KS=YS.forwardRef(function(Z,J){let{className:Q,render:X,...z}=Z,{store:G}=h1(),H=G.useState("open"),Y=G.useState("mounted"),K=G.useState("transitionStatus"),W=G.useState("openChangeReason");return W0("div",Z,{state:{open:H,transitionStatus:K},ref:[G.context.backdropRef,J],props:[{role:"presentation",hidden:!Y,style:{pointerEvents:W===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},z],stateAttributesMapping:us})});var WS=P(v(),1);var BS=WS.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,{store:G}=h1(),H=t0(z.id);return B0(()=>{return G.set("titleElementId",H),()=>{G.set("titleElementId",void 0)}},[G,H]),W0("h2",Z,{ref:J,props:[{id:H},z]})});var qS=P(v(),1);var US=qS.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,{store:G}=h1(),H=t0(z.id);return B0(()=>{return G.set("descriptionElementId",H),()=>{G.set("descriptionElementId",void 0)}},[G,H]),W0("p",Z,{ref:J,props:[{id:H},z]})});var FS=P(v(),1);var NS=FS.forwardRef(function(Z,J){let{render:Q,className:X,disabled:z=!1,nativeButton:G=!0,...H}=Z,{buttonRef:Y,getButtonProps:K}=p1({disabled:z,focusableWhenDisabled:!1,native:G}),{store:W}=h1();return W0("button",Z,{ref:[J,Y],props:[{onClick(q){W.setOpen(!1,D0(K0.closePress,q.nativeEvent,q.currentTarget))}},H,K]})});var LS=P(v(),1);var VS=function($){return $.popupWidth="--popup-width",$.popupHeight="--popup-height",$}({});var cs={activationDirection:($)=>$?{"data-activation-direction":$}:null},MS=LS.forwardRef(function(Z,J){let{render:Q,className:X,children:z,...G}=Z,{store:H}=h1(),{side:Y}=a$(),K=H.useState("instantType"),{children:W,state:B}=t7({store:H,side:Y,cssVars:VS,children:z}),q={activationDirection:B.activationDirection,transitioning:B.transitioning,instant:K};return W0("div",Z,{state:q,ref:J,props:[G,{children:W}],stateAttributesMapping:cs})});class JK{constructor(){this.store=new r$}open($){let Z=$?this.store.context.triggerElements.getById($)??void 0:void 0;if($&&!Z)throw Error(S0(80,$));this.store.setOpen(!0,D0(K0.imperativeAction,void 0,Z))}close(){this.store.setOpen(!1,D0(K0.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function AS(){return new JK}var $7=P(c(),1);function QK({...$}){return $7.jsx(b6.Root,{"data-slot":"popover",...$})}function XK({...$}){return $7.jsx(b6.Trigger,{"data-slot":"popover-trigger",...$})}function zK({className:$,align:Z="center",alignOffset:J=0,disableAnchorTracking:Q=!1,positionMethod:X="absolute",side:z="bottom",sideOffset:G=4,keepMounted:H=!1,container:Y,...K}){return $7.jsx(b6.Portal,{keepMounted:H,container:Y,children:$7.jsx(b6.Positioner,{align:Z,alignOffset:J,disableAnchorTracking:Q,positionMethod:X,side:z,sideOffset:G,className:"isolate z-50",children:$7.jsx(b6.Popup,{"data-slot":"popover-content",className:s("z-50 flex w-72 origin-(--transform-origin) flex-col gap-3 rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",$),...K})})})}function _S({className:$,...Z}){return $7.jsx("div",{"data-slot":"popover-header",className:s("flex flex-col gap-0.5 text-sm",$),...Z})}var VK=P(v(),1);var x6={};D4(x6,{Value:()=>jS,Track:()=>SS,Thumb:()=>xS,Root:()=>PS,Indicator:()=>hS,Control:()=>CS});var g1=P(v(),1);var DS=P(v(),1);function GK($,Z){let J=DS.useRef($),Q=q0(Z);B0(()=>{if(J.current===$)return;Q(J.current)},[$,Q]),B0(()=>{J.current=$},[$])}function v8($,Z=Number.MIN_SAFE_INTEGER,J=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,J))}function $N($,Z,J=(Q,X)=>Q===X){return $.length===Z.length&&$.every((Q,X)=>J(Q,Z[X]))}function HK($,Z){return $-Z}function OS($,Z,J){let Q=$.slice();return Q[Z]=J,Q.sort(HK)}function YK($,Z,J,Q,X,z){let G=$;if(G=v8(G,J,Q),X)G=OS(z,Z,v8(G,z[Z-1]||-1/0,z[Z+1]||1/0));return G}function KK($,Z,J){if(!Array.isArray($))return!0;let Q=$.reduce((X,z,G,H)=>{if(G===H.length-1)return X;return X.push(Math.abs(z-H[G+1])),X},[]);return Math.min(...Q)>=Z*J}var Q2={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...b8};var WK=P(v(),1),ZN=WK.createContext(void 0);function K9(){let $=WK.useContext(ZN);if($===void 0)throw Error(S0(62));return $}var JN=P(c(),1);function ds($){return"key"in $?K0.keyboard:K0.inputChange}function ls($,Z){if(typeof $==="number"&&typeof Z==="number")return $===Z;if(Array.isArray($)&&Array.isArray(Z))return $N($,Z);return!1}var PS=g1.forwardRef(function(Z,J){let{"aria-labelledby":Q,className:X,defaultValue:z,disabled:G=!1,id:H,format:Y,largeStep:K=10,locale:W,render:B,max:q=100,min:U=0,minStepsBetweenValues:F=0,name:N,onValueChange:L,onValueCommitted:V,orientation:M="horizontal",step:_=1,thumbCollisionBehavior:O="push",thumbAlignment:D="center",value:A,...C}=Z,I=t0(H),y=q0(L),E=q0(V),{clearErrors:h}=a4(),{state:k,disabled:S,name:w,setTouched:T,setDirty:R,validityData:b,shouldValidateOnChange:g,validation:u}=b1(),{labelId:j}=q8(),e=Q??j,t=S||G,x=w??N,[$0,M0]=n4({controlled:A,default:z??U,name:"Slider"}),l=g1.useRef(null),H0=g1.useRef(null),U0=g1.useRef([]),X0=g1.useRef(null),Y0=g1.useRef(null),V0=g1.useRef(-1),i=g1.useRef(null),Z0=g1.useRef(null),J0=g1.useRef("none"),Q0=j1(Y),[n,m]=g1.useState(-1),[d,f]=g1.useState(-1),[a,o]=g1.useState(!1),[N0,j0]=g1.useState(()=>new Map),[h0,c0]=g1.useState([void 0,void 0]),p=q0((R0)=>{if(m(R0),R0!==-1)f(R0)});Y$({id:I,commit:u.commit,value:$0,controlRef:H0,name:x,getValue:()=>$0}),GK($0,()=>{if(h(x),g())u.commit($0);else u.commit($0,!0);let R0=b.initialValue,G0;if(Array.isArray($0)&&Array.isArray(R0))G0=!$N($0,R0);else G0=$0!==R0;R(G0)});let r=q0((R0)=>{if(R0)H0.current=R0}),z0=Array.isArray($0),L0=g1.useMemo(()=>{if(!z0)return[v8($0,U,q)];return $0.slice().sort(HK)},[q,U,z0,$0]),P0=q0((R0,G0)=>{if(Number.isNaN(R0)||ls(R0,$0))return;let A0=G0??D0(K0.none,void 0,void 0,{activeThumbIndex:-1});J0.current=A0.reason;let f0=A0.event,W5=new(f0.constructor??Event)(f0.type,f0);if(Object.defineProperty(W5,"target",{writable:!0,value:{value:R0,name:x}}),A0.event=W5,Z0.current=R0,y(R0,A0),A0.isCanceled)return;M0(R0)}),v0=q0((R0,G0,A0)=>{let f0=YK(R0,G0,U,q,z0,L0);if(KK(f0,_,F)){let w5=ds(A0);P0(f0,D0(w5,A0.nativeEvent,void 0,{activeThumbIndex:G0})),T(!0);let W5=Z0.current??f0;E(W5,fz(w5,A0.nativeEvent))}});if(B0(()=>{let R0=a5(u0(l.current));if(t&&R0&&l.current?.contains(R0))R0.blur()},[t]),t&&n!==-1)p(-1);let $5=g1.useMemo(()=>({...k,activeThumbIndex:n,disabled:t,dragging:a,orientation:M,max:q,min:U,minStepsBetweenValues:F,step:_,values:L0}),[k,n,t,a,q,U,F,M,_,L0]),F5=g1.useMemo(()=>({active:n,controlRef:H0,disabled:t,dragging:a,validation:u,formatOptionsRef:Q0,handleInputChange:v0,indicatorPosition:h0,inset:D!=="center",labelId:e,largeStep:K,lastUsedThumbIndex:d,lastChangedValueRef:Z0,lastChangeReasonRef:J0,locale:W,max:q,min:U,minStepsBetweenValues:F,name:x,onValueCommitted:E,orientation:M,pressedInputRef:X0,pressedThumbCenterOffsetRef:Y0,pressedThumbIndexRef:V0,pressedValuesRef:i,registerFieldControlRef:r,renderBeforeHydration:D==="edge",setActive:p,setDragging:o,setIndicatorPosition:c0,setValue:P0,state:$5,step:_,thumbCollisionBehavior:O,thumbMap:N0,thumbRefs:U0,values:L0}),[n,H0,e,t,a,u,Q0,v0,h0,K,d,Z0,J0,W,q,U,F,x,E,M,X0,Y0,V0,i,r,p,o,c0,P0,$5,_,O,D,N0,U0,L0]),l0=W0("div",Z,{state:$5,ref:[J,l],props:[{"aria-labelledby":e,id:I,role:"group"},u.getValidationProps,C],stateAttributesMapping:Q2});return JN.jsx(ZN.Provider,{value:F5,children:JN.jsx(xY,{elementsRef:U0,onMapChange:j0,children:l0})})});var n$=P(v(),1);var wS=new Map;function is($,Z){let J=JSON.stringify({locale:$,options:Z}),Q=wS.get(J);if(Q)return Q;let X=new Intl.NumberFormat($,Z);return wS.set(J,X),X}function Z7($,Z,J){if($==null)return"";return is(Z,J).format($)}var jS=n$.forwardRef(function(Z,J){let{"aria-live":Q="off",render:X,className:z,children:G,...H}=Z,{thumbMap:Y,state:K,values:W,formatOptionsRef:B,locale:q}=K9(),U=n$.useMemo(()=>{let V="";for(let M of Y.values())if(M?.inputId)V+=`${M.inputId} `;return V.trim()===""?void 0:V.trim()},[Y]),F=n$.useMemo(()=>{let V=[];for(let M=0;M<W.length;M+=1)V.push(Z7(W[M],q,B.current??void 0));return V},[B,q,W]),N=n$.useMemo(()=>{let V=[];for(let M=0;M<W.length;M+=1)V.push(F[M]||W[M]);return V.join(" – ")},[W,F]);return W0("output",Z,{state:K,ref:J,props:[{"aria-live":Q,children:typeof G==="function"?G(F,W):N,htmlFor:U},H],stateAttributesMapping:Q2})});var P2=P(v(),1);function BK($){let Z=$.getBoundingClientRect();return{x:(Z.left+Z.right)/2,y:(Z.top+Z.bottom)/2}}function rs($){if(Math.abs($)<1){let J=$.toExponential().split("e-"),Q=J[0].split(".")[1];return(Q?Q.length:0)+parseInt(J[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function qK($,Z,J){let Q=Math.round(($-J)/Z)*Z+J;return Number(Q.toFixed(rs(Z)))}function QN({values:$,index:Z,nextValue:J,min:Q,max:X,step:z,minStepsBetweenValues:G,initialValues:H}){if($.length===0)return[];let Y=$.slice(),K=z*G,W=Y.length-1,B=H??$,q=Q+Z*K,U=X-(W-Z)*K;Y[Z]=v8(J,q,U);for(let F=Z+1;F<=W;F+=1){let N=Y[F-1]+K,L=X-(W-F)*K,V=B[F]??Y[F],M=Math.max(Y[F],N);if(V<M)M=Math.max(V,N);Y[F]=v8(M,N,L)}for(let F=Z-1;F>=0;F-=1){let N=Y[F+1]-K,L=Q+F*K,V=B[F]??Y[F],M=Math.min(Y[F],N);if(V>M)M=Math.min(V,N);Y[F]=v8(M,L,N)}for(let F=0;F<=W;F+=1)Y[F]=Number(Y[F].toFixed(12));return Y}function TS({behavior:$,values:Z,currentValues:J,initialValues:Q,pressedIndex:X,nextValue:z,min:G,max:H,step:Y,minStepsBetweenValues:K}){let W=J??Z,B=Q??Z;if(!(W.length>1))return{value:z,thumbIndex:0,didSwap:!1};let U=Y*K;switch($){case"swap":{let F=W[X],N=0.0000001,L=W.slice(),V=L[X-1],M=L[X+1],_=V!=null?V+U:G,O=M!=null?M-U:H,D=v8(z,_,O),A=Number(D.toFixed(12));L[X]=A;let C=z>F,I=z<F,y=C&&M!=null&&z>=M-0.0000001,E=I&&V!=null&&z<=V+0.0000001;if(!y&&!E)return{value:L,thumbIndex:X,didSwap:!1};let h=y?X+1:X-1,k=L.map((R,b)=>{if(b===X)return A;let g=B[b];if(g!=null)return g;return W[b]}),S=z;if(y)S=Math.max(z,L[h]);else S=Math.min(z,L[h]);let w=QN({values:L,index:h,nextValue:S,min:G,max:H,step:Y,minStepsBetweenValues:K,initialValues:k}),T=y?h-1:h+1;if(T>=0&&T<w.length){let R=w[T-1],b=w[T+1],g=R!=null?R+U:G;g=Math.max(g,G+T*U);let u=b!=null?b-U:H;u=Math.min(u,H-(w.length-1-T)*U);let j=v8(A,g,u);w[T]=Number(j.toFixed(12))}return{value:w,thumbIndex:h,didSwap:!0}}case"push":return{value:QN({values:W,index:X,nextValue:z,min:G,max:H,step:Y,minStepsBetweenValues:K}),thumbIndex:X,didSwap:!1};case"none":default:{let F=W.slice(),N=F[X-1],L=F[X+1],V=N!=null?N+U:G,M=L!=null?L-U:H,_=v8(z,V,M);return F[X]=Number(_.toFixed(12)),{value:F,thumbIndex:X,didSwap:!1}}}}var as=2;function ns($,Z){if(!$)return{start:0,end:0};function J(z){let G=z!=null?parseFloat(z):0;return Number.isNaN(G)?0:G}let Q=!Z?"InlineStart":"Top",X=!Z?"InlineEnd":"Bottom";return{start:J($[`border${Q}Width`])+J($[`padding${Q}`]),end:J($[`border${X}Width`])+J($[`padding${X}`])}}function UK($,Z){if(Z.current!=null&&$.changedTouches){let J=$;for(let Q=0;Q<J.changedTouches.length;Q+=1){let X=J.changedTouches[Q];if(X.identifier===Z.current)return{x:X.clientX,y:X.clientY}}return null}return{x:$.clientX,y:$.clientY}}var CS=P2.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,{disabled:G,dragging:H,validation:Y,inset:K,lastChangedValueRef:W,lastChangeReasonRef:B,max:q,min:U,minStepsBetweenValues:F,onValueCommitted:N,orientation:L,pressedInputRef:V,pressedThumbCenterOffsetRef:M,pressedThumbIndexRef:_,pressedValuesRef:O,registerFieldControlRef:D,renderBeforeHydration:A,setActive:C,setDragging:I,setValue:y,state:E,step:h,thumbCollisionBehavior:k,thumbRefs:S,values:w}=K9(),T=d4(),R=w.length>1,b=L==="vertical",g=P2.useRef(null),u=P2.useRef(null),j=q0((Q0)=>{if(Q0&&u.current==null){if(u.current==null)u.current=getComputedStyle(Q0)}}),e=P2.useRef(null),t=P2.useRef(0),x=P2.useRef(0),$0=j1(w),M0=q0((Q0)=>{if(_.current!==Q0)_.current=Q0;let n=S.current[Q0];if(!n){M.current=null,V.current=null;return}V.current=n.querySelector('input[type="range"]')}),l=q0((Q0)=>{let n=g.current;if(!n)return null;let{width:m,height:d,bottom:f,left:a,right:o}=n.getBoundingClientRect(),N0=ns(u.current,b),j0=x.current,h0=(b?d:m)-N0.start-N0.end-j0*2,c0=M.current??0,p=Q0.x-c0,r=Q0.y-c0,z0=b?f-r-N0.end:(T==="rtl"?o-p:p-a)-N0.start,L0=v8((z0-j0)/h0,0,1),P0=(q-U)*L0+U;if(P0=qK(P0,h,U),P0=v8(P0,U,q),!R)return{value:P0,thumbIndex:0,didSwap:!1};let v0=_.current;if(v0<0)return null;let $5=TS({behavior:k,values:w,currentValues:$0.current??w,initialValues:O.current,pressedIndex:v0,nextValue:P0,min:U,max:q,step:h,minStepsBetweenValues:F});if(k==="swap"&&$5.didSwap)M0($5.thumbIndex);else _.current=$5.thumbIndex;return $5}),H0=q0((Q0)=>{O.current=R?w.slice():null,$0.current=w;let n=_.current,m=n;if(n>-1&&n<w.length){if(w[n]===q){let d=n;while(d>0&&w[d-1]===q)d-=1;m=d}}else{let d=!b?"x":"y",f;m=-1;for(let a=0;a<S.current.length;a+=1){let o=S.current[a];if(D5(o)){let N0=BK(o),j0=Math.abs(Q0[d]-N0[d]);if(f===void 0||j0<=f)m=a,f=j0}}}if(m>-1&&m!==n)M0(m);if(K){let d=S.current[m];if(D5(d)){let f=d.getBoundingClientRect(),a=!b?"width":"height";x.current=f[a]/2}}}),U0=q0((Q0)=>{S.current?.[Q0]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),X0=q0((Q0)=>{let n=UK(Q0,e);if(n==null)return;if(t.current+=1,Q0.type==="pointermove"&&Q0.buttons===0){Y0(Q0);return}let m=l(n);if(m==null)return;if(KK(m.value,h,F)){if(!H&&t.current>as)I(!0);if(y(m.value,D0(K0.drag,Q0,void 0,{activeThumbIndex:m.thumbIndex})),$0.current=Array.isArray(m.value)?m.value:[m.value],m.didSwap)U0(m.thumbIndex)}});function Y0(Q0){C(-1),I(!1),V.current=null,M.current=null;let n=UK(Q0,e),m=n!=null?l(n):null;if(m!=null){let d=B.current;Y.commit(W.current??m.value),N(W.current??m.value,fz(d,Q0))}if("pointerType"in Q0&&g.current?.hasPointerCapture(Q0.pointerId))g.current?.releasePointerCapture(Q0.pointerId);_.current=-1,e.current=null,O.current=null,i()}let V0=q0((Q0)=>{if(G)return;let n=Q0.changedTouches[0];if(n!=null)e.current=n.identifier;let m=UK(Q0,e);if(m!=null){H0(m);let f=l(m);if(f==null)return;if(U0(f.thumbIndex),y(f.value,D0(K0.trackPress,Q0,void 0,{activeThumbIndex:f.thumbIndex})),$0.current=Array.isArray(f.value)?f.value:[f.value],f.didSwap)U0(f.thumbIndex)}t.current=0;let d=u0(g.current);d.addEventListener("touchmove",X0,{passive:!0}),d.addEventListener("touchend",Y0,{passive:!0})}),i=q0(()=>{let Q0=u0(g.current);Q0.removeEventListener("pointermove",X0),Q0.removeEventListener("pointerup",Y0),Q0.removeEventListener("touchmove",X0),Q0.removeEventListener("touchend",Y0),O.current=null}),Z0=G4();return P2.useEffect(()=>{let Q0=g.current;if(!Q0)return()=>i();return Q0.addEventListener("touchstart",V0,{passive:!0}),()=>{Q0.removeEventListener("touchstart",V0),Z0.cancel(),i()}},[i,V0,g,Z0]),P2.useEffect(()=>{if(G)i()},[G,i]),W0("div",Z,{state:E,ref:[J,D,g,j],props:[{["data-base-ui-slider-control"]:A?"":void 0,onPointerDown(Q0){let n=g.current;if(!n||G||Q0.defaultPrevented||!D5(Q0.target)||Q0.button!==0)return;let m=UK(Q0,e);if(m!=null){H0(m);let f=l(m);if(f==null)return;if(p0(S.current[f.thumbIndex],a5(u0(n))))Q0.preventDefault();else Z0.request(()=>{U0(f.thumbIndex)});if(I(!0),M.current==null){if(y(f.value,D0(K0.trackPress,Q0.nativeEvent,void 0,{activeThumbIndex:f.thumbIndex})),$0.current=Array.isArray(f.value)?f.value:[f.value],f.didSwap)U0(f.thumbIndex)}}if(Q0.nativeEvent.pointerId)n.setPointerCapture(Q0.nativeEvent.pointerId);t.current=0;let d=u0(g.current);d.addEventListener("pointermove",X0,{passive:!0}),d.addEventListener("pointerup",Y0,{once:!0})},tabIndex:-1},z],stateAttributesMapping:Q2})});var ES=P(v(),1);var SS=ES.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,{state:G}=K9();return W0("div",Z,{state:G,ref:J,props:[{style:{position:"relative"}},z],stateAttributesMapping:Q2})});var V4=P(v(),1);function kQ($,Z,J){return($-Z)*100/(J-Z)}var FK=P(v(),1),os=FK.createContext(void 0),ss={disableStyleElements:!1};function kS(){return FK.useContext(os)??ss}var IS=function($){return $.index="data-index",$.dragging="data-dragging",$.orientation="data-orientation",$.disabled="data-disabled",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.focused="data-focused",$}({});var RS='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();';var IQ=P(c(),1),yS="PageUp",bS="PageDown",ts=new Set([EJ,SJ,kJ,IJ,RJ,yJ,yS,bS]);function es($,Z,J,Q){if(Z<0)return;if($.length===2){if(Z===0)return`${Z7($[Z],Q,J)} start range`;return`${Z7($[Z],Q,J)} end range`}return J?Z7($[Z],Q,J):void 0}function o$($,Z,J,Q,X){return J===1?Math.min($+Z,X):Math.max($-Z,Q)}var xS=V4.forwardRef(function(Z,J){let{render:Q,children:X,className:z,"aria-describedby":G,"aria-label":H,"aria-labelledby":Y,disabled:K=!1,getAriaLabel:W,getAriaValueText:B,id:q,index:U,inputRef:F,onBlur:N,onFocus:L,onKeyDown:V,tabIndex:M,..._}=Z,{nonce:O}=kS(),D=t0(q),{active:A,lastUsedThumbIndex:C,controlRef:I,disabled:y,validation:E,formatOptionsRef:h,handleInputChange:k,inset:S,labelId:w,largeStep:T,locale:R,max:b,min:g,minStepsBetweenValues:u,name:j,orientation:e,pressedInputRef:t,pressedThumbCenterOffsetRef:x,pressedThumbIndexRef:$0,renderBeforeHydration:M0,setActive:l,setIndicatorPosition:H0,state:U0,step:X0,values:Y0}=K9(),V0=d4(),i=K||y,Z0=Y0.length>1,J0=e==="vertical",Q0=V0==="rtl",{setTouched:n,setFocused:m,validationMode:d}=b1(),f=V4.useRef(null),a=V4.useRef(null),o=t0(),N0=H$(),j0=Z0?o:N0,h0=V4.useMemo(()=>({inputId:j0}),[j0]),{ref:c0,index:p}=N4({metadata:h0}),r=!Z0?0:U??p,z0=r===Y0.length-1,L0=Y0[r],P0=kQ(L0,g,b),[v0,$5]=V4.useState(!1),[F5,l0]=V4.useState();C8(()=>$5(!0));let R0=C>=0&&C<Y0.length?C:-1,G0=q0(()=>{let I0=I.current,T0=f.current;if(!I0||!T0)return;let m0=T0.getBoundingClientRect(),Z5=I0.getBoundingClientRect(),Y5=J0?"height":"width",I5=Z5[Y5]-m0[Y5],r5=(m0[Y5]/2+I5*P0/100)/Z5[Y5]*100;if(l0(r5),r===0)H0((N5)=>[r5,N5[1]]);else if(z0)H0((N5)=>[N5[0],r5])});B0(()=>{if(S)queueMicrotask(G0)},[G0,S]),B0(()=>{if(S)G0()},[G0,S,P0]);let A0=V4.useCallback(()=>{let I0=J0?"bottom":"insetInlineStart",T0=J0?"left":"top",m0;if(Z0){if(A===r)m0=2;else if(R0===r)m0=1}else if(A===r)m0=1;if(!S){if(!Number.isFinite(P0))return K2;return{position:"absolute",[I0]:`${P0}%`,[T0]:"50%",translate:`${(J0||!Q0?-1:1)*50}% ${(J0?1:-1)*50}%`,zIndex:m0}}return{["--position"]:`${F5}%`,visibility:M0&&!v0||F5===void 0?"hidden":void 0,position:"absolute",[I0]:"var(--position)",[T0]:"50%",translate:`${(J0||!Q0?-1:1)*50}% ${(J0?1:-1)*50}%`,zIndex:m0}},[A,r,S,v0,F5,Z0,M0,Q0,R0,P0,J0]),f0;if(e==="vertical")f0=Q0?"vertical-rl":"vertical-lr";let w5=K4({"aria-label":typeof W==="function"?W(r):H,"aria-labelledby":Y??w,"aria-describedby":G,"aria-orientation":e,"aria-valuenow":L0,"aria-valuetext":typeof B==="function"?B(Z7(L0,R,h.current??void 0),L0,r):es(Y0,r,h.current??void 0,R),disabled:i,id:j0,max:b,min:g,name:j,onChange(I0){k(I0.target.valueAsNumber,r,I0)},onFocus(){l(r),m(!0)},onBlur(){if(!f.current)return;if(l(-1),n(!0),m(!1),d==="onBlur")E.commit(YK(L0,r,g,b,Z0,Y0))},onKeyDown(I0){if(!ts.has(I0.key))return;if(X6.has(I0.key))I0.stopPropagation();let T0=null,m0=qK(L0,X0,g);switch(I0.key){case EJ:T0=o$(m0,I0.shiftKey?T:X0,1,g,b);break;case IJ:T0=o$(m0,I0.shiftKey?T:X0,Q0?-1:1,g,b);break;case SJ:T0=o$(m0,I0.shiftKey?T:X0,-1,g,b);break;case kJ:T0=o$(m0,I0.shiftKey?T:X0,Q0?1:-1,g,b);break;case yS:T0=o$(m0,T,1,g,b);break;case bS:T0=o$(m0,T,-1,g,b);break;case yJ:if(T0=b,Z0)T0=Number.isFinite(Y0[r+1])?Y0[r+1]-X0*u:b;break;case RJ:if(T0=g,Z0)T0=Number.isFinite(Y0[r-1])?Y0[r-1]+X0*u:g;break;default:break}if(T0!==null)k(T0,r,I0),I0.preventDefault()},step:X0,style:{...K2,width:"100%",height:"100%",writingMode:f0},tabIndex:M??void 0,type:"range",value:L0??""},E.getInputValidationProps),W5=P4(a,E.inputRef,F);return W0("div",Z,{state:U0,ref:[J,c0,f],props:[{[IS.index]:r,children:IQ.jsxs(V4.Fragment,{children:[X,IQ.jsx("input",{ref:W5,...w5}),S&&!v0&&M0&&z0&&IQ.jsx("script",{nonce:O,dangerouslySetInnerHTML:{__html:RS},suppressHydrationWarning:!0})]}),id:D,onBlur:N,onFocus:L,onPointerDown(I0){if($0.current=r,f.current!=null){let T0=e==="horizontal"?"x":"y",m0=BK(f.current),Z5=(e==="horizontal"?I0.clientX:I0.clientY)-m0[T0];x.current=Z5}if(a.current!=null&&t.current!==a.current)t.current=a.current},style:A0(),suppressHydrationWarning:M0||void 0,tabIndex:-1},_],stateAttributesMapping:Q2})});var NK=P(v(),1);function $t($,Z,J,Q,X,z){let G=J===void 0||Z&&Q===void 0?"hidden":void 0,H=$?"bottom":"insetInlineStart",Y=$?"height":"width",W={visibility:X&&!z?"hidden":G,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(W["--start-position"]=`${J??0}%`,!Z)return W[H]=0,W[Y]="var(--start-position)",W;return W["--relative-size"]=`${(Q??0)-(J??0)}%`,W[H]="var(--start-position)",W[Y]="var(--relative-size)",W}function Zt($,Z,J,Q){let X=$?"bottom":"insetInlineStart",z=$?"height":"width",H={position:$?"absolute":"relative",[$?"width":"height"]:"inherit"};if(!Z)return H[X]=0,H[z]=`${J}%`,H;let Y=Q-J;return H[X]=`${J}%`,H[z]=`${Y}%`,H}var hS=NK.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,{indicatorPosition:G,inset:H,max:Y,min:K,orientation:W,renderBeforeHydration:B,state:q,values:U}=K9(),[F,N]=NK.useState(!1);C8(()=>N(!0));let L=W==="vertical",V=U.length>1,M=H?$t(L,V,G[0],G[1],B,F):Zt(L,V,kQ(U[0],K,Y),kQ(U[U.length-1],K,Y));return W0("div",Z,{state:q,ref:J,props:[{["data-base-ui-slider-indicator"]:B?"":void 0,style:M,suppressHydrationWarning:B||void 0},z],stateAttributesMapping:Q2})});var J7=P(c(),1);function gS({children:$,className:Z,defaultValue:J,value:Q,min:X=0,max:z=100,...G}){let[H,Y]=VK.useState(!1),K=Array.isArray(Q)?Q:Array.isArray(J)?J:[X,z];return VK.useEffect(()=>{let W=requestAnimationFrame(()=>Y(!0));return()=>cancelAnimationFrame(W)},[]),J7.jsx(x6.Root,{className:s("data-horizontal:w-full data-vertical:h-full",Z),"data-slot":"slider",defaultValue:J,value:Q,min:X,max:z,thumbAlignment:"edge",...G,children:J7.jsxs(x6.Control,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[J7.jsx(x6.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:J7.jsx(x6.Indicator,{"data-slot":"slider-range",className:s("bg-primary select-none data-horizontal:h-full data-vertical:w-full",H&&"transition-[width] duration-150 ease-in-out")})}),$,Array.from({length:K.length},(W,B)=>J7.jsx(x6.Thumb,{"data-slot":"slider-thumb",className:s("relative block size-3 shrink-0 cursor-ew-resize rounded-full border border-ring bg-white ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50",H&&"transition-[inset-inline-start,color,box-shadow] duration-150 ease-in-out")},B))]})})}var H5=P(c(),1);function Jt($){return $?.split(/\s*·\s*/)[0]??""}function vS($){return Jt($.description)||$.displayName}function Qt($){return $.charAt(0).toUpperCase()+$.slice(1)}function Xt($){return $==="xhigh"?"Extra":Qt($)}function fS($){return typeof $==="number"?$:$[0]??0}var mS={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},pS={type:"spring",duration:0.3,delay:0.1,bounce:0};function cS({label:$,leadingIcon:Z,className:J,...Q}){return H5.jsxs(C0,{...Q,variant:"ghost",className:s("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",J),children:[Z,H5.jsx("span",{className:"truncate font-normal",children:$})]})}function zt({current:$,model:Z,models:J,onValueChange:Q}){let X=vS(Z),z=$E(J,"Models");return H5.jsxs(u$,{children:[H5.jsx(c$,{render:H5.jsx(cS,{label:X,className:"shrink","aria-label":`Model: ${X}`})}),H5.jsx(d$,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:H5.jsx(iE,{value:$,onValueChange:Q,children:z.map((G)=>H5.jsxs(l$,{children:[H5.jsx(sY,{children:G.label}),G.models.map((H)=>H5.jsx(rE,{value:H.value,closeOnClick:!0,children:vS(H)},H.value))]},G.label))})})]})}function Gt({currentEffort:$,effortLevels:Z,fastMode:J,showFastMode:Q,onFastModeChange:X,onValueChange:z}){let G=oC(Z,$),[H,Y]=s$.useState(!1),[K,W]=s$.useState(G),[B,q]=s$.useState(!1),F=Z[H?K:G]??$,N=Xt(F),L=(M)=>{if(M)W(G);else q(!1);Y(M)},V=(M)=>{let _=Z[M];if(_&&_!==$)z(_)};return H5.jsxs(QK,{open:H,onOpenChange:L,children:[H5.jsx(XK,{render:H5.jsx(cS,{label:N,leadingIcon:J?H5.jsx(RQ,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),H5.jsxs(zK,{align:"end",side:"top",className:"w-64",disableAnchorTracking:!0,children:[H5.jsx(_S,{className:"relative h-5 flex-row items-center",children:H5.jsx(s8,{mode:"popLayout",initial:!1,children:B?H5.jsxs(u5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:mS,initial:"from",animate:"to",exit:"from",transition:pS,children:[H5.jsx("span",{children:"Faster"}),H5.jsx("span",{children:"Smarter"})]},"range"):H5.jsxs(u5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:mS,initial:"from",animate:"to",exit:"from",transition:pS,children:[H5.jsxs("div",{className:"flex items-center gap-1",children:[H5.jsx("span",{className:"text-muted-foreground",children:"Effort"}),H5.jsx("output",{"aria-live":"polite",children:N})]}),Q&&H5.jsxs(A1,{children:[H5.jsx(_1,{render:H5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":J?"Turn off Fast mode":"Turn on Fast mode","aria-pressed":J,onClick:()=>X(!J),className:"-my-1 -mr-1",children:J?H5.jsx(uS,{className:"text-primary"}):H5.jsx(RQ,{className:"text-muted-foreground",stroke:1.5})})}),H5.jsxs(D1,{align:"center",className:"flex-col gap-0",children:[H5.jsx("span",{children:"Fast mode"}),H5.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})]},"effort")})}),H5.jsxs("label",{className:"block",children:[H5.jsx("span",{className:"sr-only",children:"Reasoning effort"}),H5.jsx(gS,{value:K,min:0,max:Z.length-1,step:1,onPointerDown:(M)=>{if(M.button===0)q(!0)},onPointerCancel:()=>q(!1),onValueChange:(M)=>W(fS(M)),onValueCommitted:(M)=>{q(!1),V(fS(M))},className:s("**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm","**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:border-0 **:data-[slot=slider-thumb]:bg-card **:data-[slot=slider-thumb]:shadow-xs **:data-[slot=slider-thumb]:ring-0"),children:H5.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:Z.length},(M,_)=>H5.jsx("span",{className:s("size-1 rounded-full",_<=K?"bg-primary-foreground/30":"bg-foreground/30")},_))})})]})]})]})}var dS=s$.memo(function({sessionId:Z}){let{workspaceId:J,layout:Q,setLayout:X}=X1(),{data:z}=G9(J),G=z?.models??[],H=G.find((y)=>y.value==="default"),Y=z?eC(G.filter((y)=>y.value!=="default"),z.provider):[],K=DY(J,Z).data,W=aC(J),B=(Z?K?.model:void 0)??Q.selectedModel,q=(Z?K?.effort:void 0)??Q.selectedEffort,U=(Z?K?.fastMode:void 0)??Q.selectedFastMode,F=(y)=>{if(Z)W.mutate({sessionId:Z,patch:{model:y}});else X({selectedModel:y})},N=(y)=>{if(Z)W.mutate({sessionId:Z,patch:{effort:y}});else X({selectedEffort:y})},L=(y)=>{if(Z)W.mutate({sessionId:Z,patch:{fastMode:y}});else X({selectedFastMode:y})};if(Y.length===0)return null;let V=Y.some((y)=>y.value===B)?B:void 0,M=Y.find((y)=>H?.resolvedModel&&y.resolvedModel===H.resolvedModel)??Y[0],_=V??M.value,O=Y.find((y)=>y.value===_)??Y[0],D=O.supportsEffort?O.supportedEffortLevels??[]:[],A=yF(D,q,O.defaultEffort),C=sC(D)&&A!==void 0,I=tC(O,U);return H5.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[H5.jsx(zt,{current:_,model:O,models:Y,onValueChange:F}),C&&H5.jsx(Gt,{currentEffort:A,effortLevels:D,fastMode:I,showFastMode:O.supportsFastMode===!0,onFastModeChange:L,onValueChange:N},O.value)]})});var J5=P(c(),1);function iS({composerRef:$,onSend:Z,onStop:J,processing:Q,sessionId:X,modelSessionId:z,availability:G,annotation:H,onRemoveDrawing:Y,allowFiles:K=!0,placeholder:W,draft:B}){let q=t$.useRef(null),U=n5(),F=O1((w)=>w.composerDrafts[U]??""),N=O1((w)=>B?(w.viewBuilderDrafts??{})[B.id]:void 0),L=B?N??B.initialValue:F,V=t$.useRef(L);V.current=L;let M=T4((w)=>w.attachments[o8(U,X)]??Ht),[_,O]=t$.useState(!1),D=M.some((w)=>w.status==="uploading"),A=M.some((w)=>w.status==="ready"||w.status==="draft"),C=L.trim().length>0||A,I=PQ(C,D,G),y=(w)=>{if(V.current=w,B)B.onChange(w);else O1.getState().setComposerDraft(U,w)},E=(w)=>{if(K)WC({workspaceId:U,sessionId:X},w)},h=t$.useRef(!1),k=(w)=>{if(w.kind==="drawing"&&Y){Y(w.localId);return}T5.getState().removeAttachment(U,X,w.localId)},S=async()=>{if(!I||h.current)return;h.current=!0;try{if(await H?.finish(),await Z(V.current),!B)V.current="",O1.getState().setComposerDraft(U,"")}finally{h.current=!1}};return J5.jsxs(FC,{composerRef:$,onSubmit:(w)=>{w.preventDefault(),S()},onDragOver:(w)=>{if(!w.dataTransfer.types.includes("Files"))return;if(w.preventDefault(),K)O(!0)},onDragLeave:(w)=>{if(!K)return;if(w.currentTarget.contains(w.relatedTarget))return;O(!1)},onDrop:(w)=>{if(!w.dataTransfer.types.includes("Files"))return;w.preventDefault(),O(!1),E(Array.from(w.dataTransfer.files))},className:s(_&&"ring-2 ring-ring/60"),children:[M.length>0&&J5.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:M.map((w)=>J5.jsx(Yt,{attachment:w,onRemove:()=>k(w)},w.localId))}),J5.jsx(NC,{textareaRef:$,id:"chat-input",name:"message",value:L,onChange:(w)=>y(w.target.value),onKeyDown:(w)=>{if(w.key==="Enter"&&!w.shiftKey)w.preventDefault(),S()},onPaste:(w)=>{let T=Array.from(w.clipboardData?.files??[]);if(T.length===0)return;w.preventDefault(),E(T)},placeholder:Q?"Queue a follow-up":W??"Do anything",rows:1}),J5.jsxs(VC,{children:[K&&J5.jsx("input",{ref:q,type:"file",multiple:!0,hidden:!0,onChange:(w)=>{E(Array.from(w.target.files??[])),w.target.value=""}}),J5.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[K&&J5.jsxs(A1,{children:[J5.jsx(_1,{render:J5.jsx(C0,{type:"button",variant:"ghost",size:"icon",onClick:()=>q.current?.click(),"aria-label":"Attach files",children:J5.jsx(LK,{stroke:1.6,className:"size-4.5!"})})}),J5.jsx(D1,{children:"Attach files"})]}),H&&J5.jsxs(A1,{children:[J5.jsx(_1,{render:J5.jsx(C0,{type:"button",variant:"ghost",size:"icon",onClick:H.onToggle,className:s(H.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":H.active,children:J5.jsx(yQ,{stroke:1.5})})}),J5.jsx(D1,{children:"Draw annotation"})]})]}),J5.jsx(dS,{sessionId:z}),Q?J5.jsxs(A1,{children:[J5.jsx(_1,{render:J5.jsx(C0,{type:"button",size:"icon",onClick:J,"aria-label":"Stop agent",children:J5.jsx(lS,{})})}),J5.jsx(D1,{children:"Stop answering"})]}):J5.jsx(LC,{label:"Send message",hasContent:C,busy:D,availability:G})]})]})}var Ht=[];function Yt({attachment:$,onRemove:Z}){if($.kind==="drawing")return J5.jsx(Kt,{attachment:$,onRemove:Z});let{name:J,previewUrl:Q,status:X,error:z}=$,G=!!Q;return J5.jsxs("div",{className:s("group relative flex items-center gap-2 overflow-hidden rounded-lg bg-accent text-accent-foreground ring-1 ring-border",G?"size-14":"h-10 max-w-52 pr-2 pl-2",X==="error"&&"border-destructive/50"),title:z??J,children:[G?J5.jsx("img",{src:Q,alt:J,className:"size-full object-cover"}):J5.jsxs(J5.Fragment,{children:[J5.jsx(e$,{size:16,stroke:1.75,className:"shrink-0 text-muted-foreground"}),J5.jsx("span",{className:"truncate text-xs",children:J})]}),X==="uploading"&&J5.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:J5.jsx(E1,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),X==="error"&&J5.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-destructive/10 text-[10px] text-destructive",children:"Failed"}),J5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${J}`,className:"absolute top-0.5 right-0.5 size-4 rounded-full bg-primary/70 text-primary-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-primary/80 [&_svg]:size-3",children:J5.jsx(C1,{stroke:1.75})})]})}function Kt({attachment:$,onRemove:Z}){let{previewUrl:J,purpose:Q}=$,X=Q==="sketch"?"Sketch":"Annotation";return J5.jsxs(cC,{children:[J5.jsxs(dC,{render:J5.jsx("div",{tabIndex:0,className:"group flex h-7 cursor-default items-center rounded-md bg-background pr-2 pl-0.5 text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),children:[J5.jsxs(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,"aria-label":`Remove ${X.toLowerCase()}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[J5.jsx(yQ,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),J5.jsx(C1,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}),J5.jsx("span",{children:X})]}),J&&J5.jsx(lC,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)]",children:J5.jsx("img",{src:J,alt:`${X} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var Q7=P(c(),1);function XN({className:$,prompt:Z,disabled:J=!1,onSelect:Q}){let X=Z.icon;return Q7.jsxs(C0,{type:"button",size:"sm",disabled:J,onClick:()=>Q(Z),className:s("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[Q7.jsx(X,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),Q7.jsx("span",{children:Z.label})]})}function rS({prompts:$,disabled:Z=!1,onSelect:J}){return Q7.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 py-2 @md:grid-cols-3",children:$.map((Q,X)=>{return Q7.jsx(XN,{prompt:Q,disabled:Z,onSelect:J,className:s("h-full w-fit @md:w-full",X===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",X===1&&"@md:-rotate-1",X===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},Q.prompt)})})}var s5=P(c(),1),zN="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",Wt=[{label:"What's the weather?",prompt:"Build me a set of weather widgets that surface current conditions, today's hourly forecast, and a simple weekly outlook at a glance",context:["Build this onboarding example immediately without asking follow-up questions.","Create three separate widgets: current conditions, today's hourly forecast, and a seven-day outlook.","Use one shared Open-Meteo server function with no API key and use Berlin as the default location.","Give each widget an appropriate grid size and a compact, visually distinct layout with loading, error, and last-updated states.","Bundle all three widgets, smoke-test the shared weather function, and check runtime logs before finishing.",zN],icon:sS},{label:"Build a fun synthesizer",prompt:"Build me a view with a simple, playful synthesizer featuring a keyboard, five sound controls, and the ability to record, save, and load music files from the workspace",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services.","Create a responsive View that uses the browser's audio capabilities, with an onscreen piano and computer-keyboard controls.","Include five clearly labeled sound controls for waveform, attack, release, filter cutoff, and volume.","Let the user record timed note events, play and stop recordings, give them names, and save and load them as JSON music files in a workspace music folder.","Include clear empty and error states, then bundle the View and check runtime logs before finishing.",zN],icon:DK},{label:"Make a job tracker",prompt:"Build me a view with a visual job search board where I can add opportunities by pasting a job link, automatically extract the details, move opportunities through stages, and keep notes and related files in the workspace",context:["Build this onboarding example immediately without asking follow-up questions.","Create a visual View with Saved, Applied, Interviewing, Offer, and Closed stages.","Let the user add a job by pasting its URL, and use a server function to parse public metadata for the title, company, and location.","When a page blocks parsing or lacks metadata, keep the URL and provide editable manual fields.","Support moving opportunities between stages, editing their details and notes, and referencing related workspace files.","Persist the board in a workspace-local JSON file and include loading, empty, and error states.","Bundle the View and smoke-test its persistence and parsing functions before finishing.",zN],icon:AK}],Bt={label:"Explore the workspace",prompt:"Explore this workspace and suggest what moi can build based on its content",context:["Explore the existing workspace files before making suggestions.","Briefly explain what the workspace appears to be for and which content informed your ideas.","Propose a focused set of useful widgets or views that fit the work already here.","Wait for me to choose before building anything."],icon:aS};function tS({isViewBuilderDraft:$,hasSentMessageFromMoi:Z,isWorkspacePendingAnalysis:J}){if($)return"view-builder";if(!Z)return"chat-welcome";if(J)return"workspace-welcome";return"empty"}var OK=s("flex flex-1 flex-col items-center justify-center self-center");function eS({kind:$,disabled:Z=!1,onSelectPrompt:J}){switch($){case"view-builder":return s5.jsx(qt,{});case"chat-welcome":return s5.jsx(Ut,{disabled:Z,onSelectPrompt:J});case"workspace-welcome":return s5.jsx(Ft,{disabled:Z,onSelectPrompt:J});case"empty":return s5.jsx(Nt,{})}}function qt(){return s5.jsxs("div",{className:s(OK,"gap-2 text-center text-muted-foreground"),children:[s5.jsx(oS,{size:56,stroke:0.5}),s5.jsx("p",{className:"mx-auto max-w-xs px-8 text-sm",children:"Describe the content, data, and key actions you need in the view"})]})}function Ut({disabled:$=!1,onSelectPrompt:Z}){return s5.jsxs("div",{className:s(OK,"@container w-full max-w-md min-w-0"),children:[s5.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[s5.jsx("p",{children:"moi is the visual workspace for you and your agent. It grows and adapts to the work you're doing."}),s5.jsxs("p",{children:["Ask ",s5.jsx(MK,{Icon:_K,children:"Agent"})," to build"," ",s5.jsx(MK,{Icon:xQ,children:"Widgets"})," that surface information and quick actions, or entire ",s5.jsx(MK,{Icon:bQ,children:"Views"})," for more complex tools. Use ",s5.jsx(MK,{Icon:hQ,children:"Scratchpad"})," for exploring and shaping ideas with your agent."]}),s5.jsx("p",{children:"Give it a try:"})]}),s5.jsx(rS,{prompts:Wt,disabled:$,onSelect:Z})]})}function Ft({disabled:$=!1,onSelectPrompt:Z}){return s5.jsxs("div",{className:s(OK,"gap-2"),children:[s5.jsx("div",{className:"prose prose-sm max-w-60 min-w-0 text-center wrap-anywhere text-muted-foreground prose-inherit",children:s5.jsx("p",{children:"See what moi can build for you"})}),s5.jsx(XN,{prompt:Bt,disabled:$,onSelect:Z})]})}function Nt(){return s5.jsxs("div",{className:s(OK,"gap-2 text-center text-muted-foreground"),children:[s5.jsx(nS,{size:56,stroke:0.5,"aria-hidden":!0}),s5.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})]})}function MK({Icon:$,children:Z}){return s5.jsxs("strong",{className:"inline-flex items-center gap-0.5 align-bottom font-medium",children:[s5.jsx($,{size:16,stroke:2,"aria-hidden":!0}),Z]})}var gQ=P(v(),1);var P5=P(c(),1);function Qk({label:$}){return P5.jsx("div",{className:"flex h-7 items-center px-2.5 text-sm font-medium",children:$})}function Vt($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function Lt({active:$,canArchive:Z,confirmingArchive:J,onArchive:Q,onRequestArchive:X,onSelect:z,session:G,workspaceId:H}){let Y=gQ.useRef(!1),[K,W]=gQ.useState(!1),B=T4((N)=>wJ(N.activity,H,G.sessionId)),q=Vt(G);function U(){X(G.sessionId)}async function F(){if(Y.current)return;Y.current=!0,W(!0);try{await Q(G.sessionId)}catch{l4.add({title:"Couldn’t archive chat",type:"error"})}finally{Y.current=!1,W(!1)}}return P5.jsxs("div",{className:"group/chat relative",children:[P5.jsx(CQ,{className:s("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>z(G.sessionId),children:P5.jsx("div",{className:s("flex min-w-0 flex-1 overflow-hidden",(B||K)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!J&&"group-focus-within/chat:mr-4 group-focus-within/chat:mask-r-from-[calc(100%-16px)] group-hover/chat:mr-4 group-hover/chat:mask-r-from-[calc(100%-16px)] [@media(hover:none)]:mr-4 [@media(hover:none)]:mask-r-from-[calc(100%-16px)]",J&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:P5.jsxs("span",{className:s("flex min-w-0 items-baseline gap-1.5",(B||K)&&"-mr-4",J?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[P5.jsx("span",{className:"min-w-0 truncate",children:G.summary}),q&&P5.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:q})]})})}),B&&P5.jsx(D2,{className:s("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",Z&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(J||K)&&"hidden")}),Z&&P5.jsx("div",{className:s("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!J&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",K&&"opacity-100!"),children:J?P5.jsx(C0,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${G.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:K,onClick:F,onPointerDown:(N)=>N.stopPropagation(),children:"Confirm"}):P5.jsxs(A1,{children:[P5.jsx(_1,{render:P5.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${G.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:K,onClick:U,onPointerDown:(N)=>N.stopPropagation(),children:P5.jsx(Zk,{stroke:1.75})})}),P5.jsx(D1,{side:"right",children:"Archive chat"})]})})]})}function Mt($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function $k($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function At($,Z){let J=$k(Z)-$k($);if(J===0)return"Today";if(J===1)return"Yesterday";if(J>=2&&J<=5)return`${J} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function _t($,Z=new Date){let J=new Map;for(let Q of $.slice().sort((X,z)=>z.lastModified-X.lastModified)){let X=new Date(Q.lastModified),z=Mt(X),G=J.get(z);if(G){G.sessions.push(Q);continue}J.set(z,{key:z,label:At(X,Z),sessions:[Q]})}return[...J.values()]}function Xk({isViewBuilder:$=!1}){if($)return P5.jsx(Qk,{label:"Build a new view"});return P5.jsx(Dt,{})}function Dt(){let $=n5(),[Z,J]=Q6(),Q=Z??null,[X,z]=gQ.useState(null),{data:G=[]}=_Y($),H=G9($).data?.supportsArchiving===!0,Y=iC($),K=T4((N)=>DO(N.activity,$,Q));if(G.length===0)return P5.jsx(Qk,{label:"New chat"});let B=G.find((N)=>N.sessionId===Q)?.summary??"New chat",q=_t(G);function U(N){if(!N)z(null)}async function F(N){z(null),await Y.mutateAsync(N);let L=T5.getState();if(L.clearAttachments($,N),L.clearPreviewsForSession($,N),Q===N)J(null)}return P5.jsxs(u$,{onOpenChange:U,children:[P5.jsx(c$,{render:P5.jsxs(C0,{className:"group",variant:"ghost",size:"sm",children:[P5.jsx("span",{className:"max-w-64 truncate",children:B}),K?P5.jsx(D2,{className:"size-4!",stroke:2}):P5.jsx(PK,{className:"text-muted-foreground group-hover:text-foreground",stroke:1.75})]})}),P5.jsxs(d$,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:[P5.jsxs(CQ,{className:"shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!",onClick:()=>J(null),children:[P5.jsx(Jk,{size:16,stroke:1.75}),"New chat"]}),q.length>0&&P5.jsxs(P5.Fragment,{children:[P5.jsx(aE,{className:"shrink-0"}),P5.jsx("div",{className:"no-scrollbar flex min-h-0 flex-1 scroll-fade flex-col gap-1 overflow-y-auto overscroll-contain [--scroll-fade-reveal:8px]",children:q.map((N)=>P5.jsxs(l$,{children:[P5.jsx(sY,{children:N.label}),N.sessions.map((L)=>P5.jsx(Lt,{session:L,active:Q===L.sessionId,canArchive:H,confirmingArchive:X===L.sessionId,onSelect:J,onArchive:F,onRequestArchive:z,workspaceId:$},L.sessionId))]},N.key))})]})]})]})}var Nh=P(v(),1);function h5(){}function wK(){}function zk($,Z){let J=Z||{};return($[$.length-1]===""?[...$,""]:$).join((J.padRight?" ":"")+","+(J.padLeft===!1?"":" ")).trim()}var Ot=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wt={};function jK($,Z){return((Z||wt).jsx?Pt:Ot).test($)}var jt=/[ \t\n\f\r]/g;function GN($){return typeof $==="object"?$.type==="text"?Gk($.value):!1:Gk($)}function Gk($){return $.replace(jt,"")===""}class h6{constructor($,Z,J){if(this.normal=Z,this.property=$,J)this.space=J}}h6.prototype.normal={};h6.prototype.property={};h6.prototype.space=void 0;function HN($,Z){let J={},Q={};for(let X of $)Object.assign(J,X.property),Object.assign(Q,X.normal);return new h6(J,Q,Z)}function vQ($){return $.toLowerCase()}class D8{constructor($,Z){this.attribute=Z,this.property=$}}D8.prototype.attribute="";D8.prototype.booleanish=!1;D8.prototype.boolean=!1;D8.prototype.commaOrSpaceSeparated=!1;D8.prototype.commaSeparated=!1;D8.prototype.defined=!1;D8.prototype.mustUseProperty=!1;D8.prototype.number=!1;D8.prototype.overloadedBoolean=!1;D8.prototype.property="";D8.prototype.spaceSeparated=!1;D8.prototype.space=void 0;var fQ={};D4(fQ,{spaceSeparated:()=>d5,overloadedBoolean:()=>TK,number:()=>w0,commaSeparated:()=>g6,commaOrSpaceSeparated:()=>L4,booleanish:()=>v1,boolean:()=>G5});var Tt=0,G5=X7(),v1=X7(),TK=X7(),w0=X7(),d5=X7(),g6=X7(),L4=X7();function X7(){return 2**++Tt}var YN=Object.keys(fQ);class $Z extends D8{constructor($,Z,J,Q){let X=-1;super($,Z);if(Hk(this,"space",Q),typeof J==="number")while(++X<YN.length){let z=YN[X];Hk(this,YN[X],(J&fQ[z])===fQ[z])}}}$Z.prototype.defined=!0;function Hk($,Z,J){if(J)$[Z]=J}function X2($){let Z={},J={};for(let[Q,X]of Object.entries($.properties)){let z=new $Z(Q,$.transform($.attributes||{},Q),X,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(Q))z.mustUseProperty=!0;Z[Q]=z,J[vQ(Q)]=Q,J[vQ(z.attribute)]=Q}return new h6(Z,J,$.space)}var KN=X2({properties:{ariaActiveDescendant:null,ariaAtomic:v1,ariaAutoComplete:null,ariaBusy:v1,ariaChecked:v1,ariaColCount:w0,ariaColIndex:w0,ariaColSpan:w0,ariaControls:d5,ariaCurrent:null,ariaDescribedBy:d5,ariaDetails:null,ariaDisabled:v1,ariaDropEffect:d5,ariaErrorMessage:null,ariaExpanded:v1,ariaFlowTo:d5,ariaGrabbed:v1,ariaHasPopup:null,ariaHidden:v1,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:d5,ariaLevel:w0,ariaLive:null,ariaModal:v1,ariaMultiLine:v1,ariaMultiSelectable:v1,ariaOrientation:null,ariaOwns:d5,ariaPlaceholder:null,ariaPosInSet:w0,ariaPressed:v1,ariaReadOnly:v1,ariaRelevant:null,ariaRequired:v1,ariaRoleDescription:d5,ariaRowCount:w0,ariaRowIndex:w0,ariaRowSpan:w0,ariaSelected:v1,ariaSetSize:w0,ariaSort:null,ariaValueMax:w0,ariaValueMin:w0,ariaValueNow:w0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function CK($,Z){return Z in $?$[Z]:Z}function EK($,Z){return CK($,Z.toLowerCase())}var Yk=X2({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:g6,acceptCharset:d5,accessKey:d5,action:null,allow:null,allowFullScreen:G5,allowPaymentRequest:G5,allowUserMedia:G5,alt:null,as:null,async:G5,autoCapitalize:null,autoComplete:d5,autoFocus:G5,autoPlay:G5,blocking:d5,capture:null,charSet:null,checked:G5,cite:null,className:d5,cols:w0,colSpan:null,content:null,contentEditable:v1,controls:G5,controlsList:d5,coords:w0|g6,crossOrigin:null,data:null,dateTime:null,decoding:null,default:G5,defer:G5,dir:null,dirName:null,disabled:G5,download:TK,draggable:v1,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:G5,formTarget:null,headers:d5,height:w0,hidden:TK,high:w0,href:null,hrefLang:null,htmlFor:d5,httpEquiv:d5,id:null,imageSizes:null,imageSrcSet:null,inert:G5,inputMode:null,integrity:null,is:null,isMap:G5,itemId:null,itemProp:d5,itemRef:d5,itemScope:G5,itemType:d5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:G5,low:w0,manifest:null,max:null,maxLength:w0,media:null,method:null,min:null,minLength:w0,multiple:G5,muted:G5,name:null,nonce:null,noModule:G5,noValidate:G5,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:G5,optimum:w0,pattern:null,ping:d5,placeholder:null,playsInline:G5,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:G5,referrerPolicy:null,rel:d5,required:G5,reversed:G5,rows:w0,rowSpan:w0,sandbox:d5,scope:null,scoped:G5,seamless:G5,selected:G5,shadowRootClonable:G5,shadowRootDelegatesFocus:G5,shadowRootMode:null,shape:null,size:w0,sizes:null,slot:null,span:w0,spellCheck:v1,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w0,step:null,style:null,tabIndex:w0,target:null,title:null,translate:null,type:null,typeMustMatch:G5,useMap:null,value:v1,width:w0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:d5,axis:null,background:null,bgColor:null,border:w0,borderColor:null,bottomMargin:w0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:G5,declare:G5,event:null,face:null,frame:null,frameBorder:null,hSpace:w0,leftMargin:w0,link:null,longDesc:null,lowSrc:null,marginHeight:w0,marginWidth:w0,noResize:G5,noHref:G5,noShade:G5,noWrap:G5,object:null,profile:null,prompt:null,rev:null,rightMargin:w0,rules:null,scheme:null,scrolling:v1,standby:null,summary:null,text:null,topMargin:w0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:G5,disableRemotePlayback:G5,prefix:null,property:null,results:w0,security:null,unselectable:null},space:"html",transform:EK});var Kk=X2({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:L4,accentHeight:w0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w0,amplitude:w0,arabicForm:null,ascent:w0,attributeName:null,attributeType:null,azimuth:w0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w0,by:null,calcMode:null,capHeight:w0,className:d5,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w0,diffuseConstant:w0,direction:null,display:null,dur:null,divisor:w0,dominantBaseline:null,download:G5,dx:null,dy:null,edgeMode:null,editable:null,elevation:w0,enableBackground:null,end:null,event:null,exponent:w0,externalResourcesRequired:null,fill:null,fillOpacity:w0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:g6,g2:g6,glyphName:g6,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w0,horizOriginX:w0,horizOriginY:w0,id:null,ideographic:w0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w0,k:w0,k1:w0,k2:w0,k3:w0,k4:w0,kernelMatrix:L4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w0,overlineThickness:w0,paintOrder:null,panose1:null,path:null,pathLength:w0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:d5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w0,pointsAtY:w0,pointsAtZ:w0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:L4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:L4,rev:L4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:L4,requiredFeatures:L4,requiredFonts:L4,requiredFormats:L4,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w0,specularExponent:w0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w0,strikethroughThickness:w0,string:null,stroke:null,strokeDashArray:L4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w0,strokeOpacity:w0,strokeWidth:null,style:null,surfaceScale:w0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:L4,tabIndex:w0,tableValues:null,target:null,targetX:w0,targetY:w0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:L4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w0,underlineThickness:w0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w0,values:null,vAlphabetic:w0,vMathematical:w0,vectorEffect:null,vHanging:w0,vIdeographic:w0,version:null,vertAdvY:w0,vertOriginX:w0,vertOriginY:w0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:CK});var WN=X2({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform($,Z){return"xlink:"+Z.slice(5).toLowerCase()}});var BN=X2({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:EK});var qN=X2({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var UN={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var Ct=/[A-Z]/g,Wk=/-[a-z]/g,Et=/^data[-\w.:]+$/i;function FN($,Z){let J=vQ(Z),Q=Z,X=D8;if(J in $.normal)return $.property[$.normal[J]];if(J.length>4&&J.slice(0,4)==="data"&&Et.test(Z)){if(Z.charAt(4)==="-"){let z=Z.slice(5).replace(Wk,kt);Q="data"+z.charAt(0).toUpperCase()+z.slice(1)}else{let z=Z.slice(4);if(!Wk.test(z)){let G=z.replace(Ct,St);if(G.charAt(0)!=="-")G="-"+G;Z="data"+G}}X=$Z}return new X(Q,Z)}function St($){return"-"+$.toLowerCase()}function kt($){return $.charAt(1).toUpperCase()}var Bk=HN([KN,Yk,WN,BN,qN],"html"),SK=HN([KN,Kk,WN,BN,qN],"svg");function qk($){return $.join(" ").trim()}var Sk=P(jk(),1);var kK=Tk("end"),ZZ=Tk("start");function Tk($){return Z;function Z(J){let Q=J&&J.position&&J.position[$]||{};if(typeof Q.line==="number"&&Q.line>0&&typeof Q.column==="number"&&Q.column>0)return{line:Q.line,column:Q.column,offset:typeof Q.offset==="number"&&Q.offset>-1?Q.offset:void 0}}}function LN($){let Z=ZZ($),J=kK($);if(Z&&J)return{start:Z,end:J}}function v6($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return Ck($.position);if("start"in $||"end"in $)return Ck($);if("line"in $||"column"in $)return MN($);return""}function MN($){return Ek($&&$.line)+":"+Ek($&&$.column)}function Ck($){return MN($&&$.start)+"-"+MN($&&$.end)}function Ek($){return $&&typeof $==="number"?$:1}class s1 extends Error{constructor($,Z,J){super();if(typeof Z==="string")J=Z,Z=void 0;let Q="",X={},z=!1;if(Z)if("line"in Z&&"column"in Z)X={place:Z};else if("start"in Z&&"end"in Z)X={place:Z};else if("type"in Z)X={ancestors:[Z],place:Z.position};else X={...Z};if(typeof $==="string")Q=$;else if(!X.cause&&$)z=!0,Q=$.message,X.cause=$;if(!X.ruleId&&!X.source&&typeof J==="string"){let H=J.indexOf(":");if(H===-1)X.ruleId=J;else X.source=J.slice(0,H),X.ruleId=J.slice(H+1)}if(!X.place&&X.ancestors&&X.ancestors){let H=X.ancestors[X.ancestors.length-1];if(H)X.place=H.position}let G=X.place&&"start"in X.place?X.place.start:X.place;this.ancestors=X.ancestors||void 0,this.cause=X.cause||void 0,this.column=G?G.column:void 0,this.fatal=void 0,this.file="",this.message=Q,this.line=G?G.line:void 0,this.name=v6(X.place)||"1:1",this.place=X.place||void 0,this.reason=this.message,this.ruleId=X.ruleId||void 0,this.source=X.source||void 0,this.stack=z&&X.cause&&typeof X.cause.stack==="string"?X.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}s1.prototype.file="";s1.prototype.name="";s1.prototype.reason="";s1.prototype.message="";s1.prototype.stack="";s1.prototype.column=void 0;s1.prototype.line=void 0;s1.prototype.ancestors=void 0;s1.prototype.cause=void 0;s1.prototype.fatal=void 0;s1.prototype.place=void 0;s1.prototype.ruleId=void 0;s1.prototype.source=void 0;var AN={}.hasOwnProperty,Je=new Map,Qe=/[A-Z]/g,Xe=new Set(["table","tbody","thead","tfoot","tr"]),ze=new Set(["td","th"]),kk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _N($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let J=Z.filePath||void 0,Q;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");Q=Ue(J,Z.jsxDEV)}else{if(typeof Z.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof Z.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");Q=qe(J,Z.jsx,Z.jsxs)}let X={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:Q,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:J,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?SK:Bk,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},z=Ik(X,$,void 0);if(z&&typeof z!=="string")return z;return X.create($,X.Fragment,{children:z||void 0},void 0)}function Ik($,Z,J){if(Z.type==="element")return Ge($,Z,J);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return He($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return Ke($,Z,J);if(Z.type==="mdxjsEsm")return Ye($,Z);if(Z.type==="root")return We($,Z,J);if(Z.type==="text")return Be($,Z)}function Ge($,Z,J){let Q=$.schema,X=Q;if(Z.tagName.toLowerCase()==="svg"&&Q.space==="html")X=SK,$.schema=X;$.ancestors.push(Z);let z=yk($,Z.tagName,!1),G=Fe($,Z),H=ON($,Z);if(Xe.has(Z.tagName))H=H.filter(function(Y){return typeof Y==="string"?!GN(Y):!0});return Rk($,G,z,Z),DN(G,H),$.ancestors.pop(),$.schema=Q,$.create(Z,z,G,J)}function He($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let Q=Z.data.estree.body[0];return h5(Q.type==="ExpressionStatement"),$.evaluater.evaluateExpression(Q.expression)}pQ($,Z.position)}function Ye($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);pQ($,Z.position)}function Ke($,Z,J){let Q=$.schema,X=Q;if(Z.name==="svg"&&Q.space==="html")X=SK,$.schema=X;$.ancestors.push(Z);let z=Z.name===null?$.Fragment:yk($,Z.name,!0),G=Ne($,Z),H=ON($,Z);return Rk($,G,z,Z),DN(G,H),$.ancestors.pop(),$.schema=Q,$.create(Z,z,G,J)}function We($,Z,J){let Q={};return DN(Q,ON($,Z)),$.create(Z,$.Fragment,Q,J)}function Be($,Z){return Z.value}function Rk($,Z,J,Q){if(typeof J!=="string"&&J!==$.Fragment&&$.passNode)Z.node=Q}function DN($,Z){if(Z.length>0){let J=Z.length>1?Z:Z[0];if(J)$.children=J}}function qe($,Z,J){return Q;function Q(X,z,G,H){let K=Array.isArray(G.children)?J:Z;return H?K(z,G,H):K(z,G)}}function Ue($,Z){return J;function J(Q,X,z,G){let H=Array.isArray(z.children),Y=ZZ(Q);return Z(X,z,G,H,{columnNumber:Y?Y.column-1:void 0,fileName:$,lineNumber:Y?Y.line:void 0},void 0)}}function Fe($,Z){let J={},Q,X;for(X in Z.properties)if(X!=="children"&&AN.call(Z.properties,X)){let z=Ve($,X,Z.properties[X]);if(z){let[G,H]=z;if($.tableCellAlignToStyle&&G==="align"&&typeof H==="string"&&ze.has(Z.tagName))Q=H;else J[G]=H}}if(Q){let z=J.style||(J.style={});z[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=Q}return J}function Ne($,Z){let J={};for(let Q of Z.attributes)if(Q.type==="mdxJsxExpressionAttribute")if(Q.data&&Q.data.estree&&$.evaluater){let z=Q.data.estree.body[0];h5(z.type==="ExpressionStatement");let G=z.expression;h5(G.type==="ObjectExpression");let H=G.properties[0];h5(H.type==="SpreadElement"),Object.assign(J,$.evaluater.evaluateExpression(H.argument))}else pQ($,Z.position);else{let X=Q.name,z;if(Q.value&&typeof Q.value==="object")if(Q.value.data&&Q.value.data.estree&&$.evaluater){let H=Q.value.data.estree.body[0];h5(H.type==="ExpressionStatement"),z=$.evaluater.evaluateExpression(H.expression)}else pQ($,Z.position);else z=Q.value===null?!0:Q.value;J[X]=z}return J}function ON($,Z){let J=[],Q=-1,X=$.passKeys?new Map:Je;while(++Q<Z.children.length){let z=Z.children[Q],G;if($.passKeys){let Y=z.type==="element"?z.tagName:z.type==="mdxJsxFlowElement"||z.type==="mdxJsxTextElement"?z.name:void 0;if(Y){let K=X.get(Y)||0;G=Y+"-"+K,X.set(Y,K+1)}}let H=Ik($,z,G);if(H!==void 0)J.push(H)}return J}function Ve($,Z,J){let Q=FN($.schema,Z);if(J===null||J===void 0||typeof J==="number"&&Number.isNaN(J))return;if(Array.isArray(J))J=Q.commaSeparated?zk(J):qk(J);if(Q.property==="style"){let X=typeof J==="object"?J:Le($,String(J));if($.stylePropertyNameCase==="css")X=Me(X);return["style",X]}return[$.elementAttributeNameCase==="react"&&Q.space?UN[Q.property]||Q.property:Q.attribute,J]}function Le($,Z){try{return Sk.default(Z,{reactCompat:!0})}catch(J){if($.ignoreInvalidStyle)return{};let Q=J,X=new s1("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:Q,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw X.file=$.filePath||void 0,X.url=kk+"#cannot-parse-style-attribute",X}}function yk($,Z,J){let Q;if(!J)Q={type:"Literal",value:Z};else if(Z.includes(".")){let X=Z.split("."),z=-1,G;while(++z<X.length){let H=jK(X[z])?{type:"Identifier",name:X[z]}:{type:"Literal",value:X[z]};G=G?{type:"MemberExpression",object:G,property:H,computed:Boolean(z&&H.type==="Literal"),optional:!1}:H}h5(G,"always a result"),Q=G}else Q=jK(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(Q.type==="Literal"){let X=Q.value;return AN.call($.components,X)?$.components[X]:X}if($.evaluater)return $.evaluater.evaluateExpression(Q);pQ($)}function pQ($,Z){let J=new s1("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw J.file=$.filePath||void 0,J.url=kk+"#cannot-handle-mdx-estrees-without-createevaluater",J}function Me($){let Z={},J;for(J in $)if(AN.call($,J))Z[Ae(J)]=$[J];return Z}function Ae($){let Z=$.replace(Qe,_e);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function _e($){return"-"+$.toLowerCase()}var uQ={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var KZ=P(c(),1),JR=P(v(),1);var De={};function G7($,Z){let J=Z||De,Q=typeof J.includeImageAlt==="boolean"?J.includeImageAlt:!0,X=typeof J.includeHtml==="boolean"?J.includeHtml:!0;return xk($,Q,X)}function xk($,Z,J){if(Oe($)){if("value"in $)return $.type==="html"&&!J?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return bk($.children,Z,J)}if(Array.isArray($))return bk($,Z,J);return""}function bk($,Z,J){let Q=[],X=-1;while(++X<$.length)Q[X]=xk($[X],Z,J);return Q.join("")}function Oe($){return Boolean($&&typeof $==="object")}var hk=document.createElement("i");function JZ($){let Z="&"+$+";";hk.innerHTML=Z;let J=hk.textContent;if(J.charCodeAt(J.length-1)===59&&$!=="semi")return!1;return J===Z?!1:J}function c1($,Z,J,Q){let X=$.length,z=0,G;if(Z<0)Z=-Z>X?0:X+Z;else Z=Z>X?X:Z;if(J=J>0?J:0,Q.length<1e4)G=Array.from(Q),G.unshift(Z,J),$.splice(...G);else{if(J)$.splice(Z,J);while(z<Q.length)G=Q.slice(z,z+1e4),G.unshift(Z,0),$.splice(...G),z+=1e4,Z+=1e4}}function e8($,Z){if($.length>0)return c1($,$.length,0,Z),$;return Z}var gk={}.hasOwnProperty;function IK($){let Z={},J=-1;while(++J<$.length)Pe(Z,$[J]);return Z}function Pe($,Z){let J;for(J in Z){let X=(gk.call($,J)?$[J]:void 0)||($[J]={}),z=Z[J],G;if(z)for(G in z){if(!gk.call(X,G))X[G]=[];let H=z[G];we(X[G],Array.isArray(H)?H:H?[H]:[])}}}function we($,Z){let J=-1,Q=[];while(++J<Z.length)(Z[J].add==="after"?$:Q).push(Z[J]);c1($,0,0,Q)}function RK($,Z){let J=Number.parseInt($,Z);if(J<9||J===11||J>13&&J<32||J>126&&J<160||J>55295&&J<57344||J>64975&&J<65008||(J&65535)===65535||(J&65535)===65534||J>1114111)return"�";return String.fromCodePoint(J)}function f8($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var X8=f6(/[A-Za-z]/),f1=f6(/[\dA-Za-z]/),vk=f6(/[#-'*+\--9=?A-Z^-~]/);function H7($){return $!==null&&($<32||$===127)}var cQ=f6(/\d/),fk=f6(/[\dA-Fa-f]/),mk=f6(/[!-/:-@[-`{-~]/);function b0($){return $!==null&&$<-2}function M5($){return $!==null&&($<0||$===32)}function n0($){return $===-2||$===-1||$===32}var Y7=f6(/\p{P}|\p{S}/u),W9=f6(/\s/);function f6($){return Z;function Z(J){return J!==null&&J>-1&&$.test(String.fromCharCode(J))}}function z2($){let Z=[],J=-1,Q=0,X=0;while(++J<$.length){let z=$.charCodeAt(J),G="";if(z===37&&f1($.charCodeAt(J+1))&&f1($.charCodeAt(J+2)))X=2;else if(z<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(z)))G=String.fromCharCode(z)}else if(z>55295&&z<57344){let H=$.charCodeAt(J+1);if(z<56320&&H>56319&&H<57344)G=String.fromCharCode(z,H),X=1;else G="�"}else G=String.fromCharCode(z);if(G)Z.push($.slice(Q,J),encodeURIComponent(G)),Q=J+X+1,G="";if(X)J+=X,X=0}return Z.join("")+$.slice(Q)}function r0($,Z,J,Q){let X=Q?Q-1:Number.POSITIVE_INFINITY,z=0;return G;function G(Y){if(n0(Y))return $.enter(J),H(Y);return Z(Y)}function H(Y){if(n0(Y)&&z++<X)return $.consume(Y),H;return $.exit(J),Z(Y)}}var pk={tokenize:je};function je($){let Z=$.attempt(this.parser.constructs.contentInitial,Q,X),J;return Z;function Q(H){if(H===null){$.consume(H);return}return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),r0($,Z,"linePrefix")}function X(H){return $.enter("paragraph"),z(H)}function z(H){let Y=$.enter("chunkText",{contentType:"text",previous:J});if(J)J.next=Y;return J=Y,G(H)}function G(H){if(H===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(H);return}if(b0(H))return $.consume(H),$.exit("chunkText"),z;return $.consume(H),G}}var ck={tokenize:Te},uk={tokenize:Ce};function Te($){let Z=this,J=[],Q=0,X,z,G;return H;function H(_){if(Q<J.length){let O=J[Q];return Z.containerState=O[1],$.attempt(O[0].continuation,Y,K)(_)}return K(_)}function Y(_){if(Q++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,X)M();let O=Z.events.length,D=O,A;while(D--)if(Z.events[D][0]==="exit"&&Z.events[D][1].type==="chunkFlow"){A=Z.events[D][1].end;break}V(Q);let C=O;while(C<Z.events.length)Z.events[C][1].end={...A},C++;return c1(Z.events,D+1,0,Z.events.slice(O)),Z.events.length=C,K(_)}return H(_)}function K(_){if(Q===J.length){if(!X)return q(_);if(X.currentConstruct&&X.currentConstruct.concrete)return F(_);Z.interrupt=Boolean(X.currentConstruct&&!X._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(uk,W,B)(_)}function W(_){if(X)M();return V(Q),q(_)}function B(_){return Z.parser.lazy[Z.now().line]=Q!==J.length,G=Z.now().offset,F(_)}function q(_){return Z.containerState={},$.attempt(uk,U,F)(_)}function U(_){return Q++,J.push([Z.currentConstruct,Z.containerState]),q(_)}function F(_){if(_===null){if(X)M();V(0),$.consume(_);return}return X=X||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:X,contentType:"flow",previous:z}),N(_)}function N(_){if(_===null){L($.exit("chunkFlow"),!0),V(0),$.consume(_);return}if(b0(_))return $.consume(_),L($.exit("chunkFlow")),Q=0,Z.interrupt=void 0,H;return $.consume(_),N}function L(_,O){let D=Z.sliceStream(_);if(O)D.push(null);if(_.previous=z,z)z.next=_;if(z=_,X.defineSkip(_.start),X.write(D),Z.parser.lazy[_.start.line]){let A=X.events.length;while(A--)if(X.events[A][1].start.offset<G&&(!X.events[A][1].end||X.events[A][1].end.offset>G))return;let C=Z.events.length,I=C,y,E;while(I--)if(Z.events[I][0]==="exit"&&Z.events[I][1].type==="chunkFlow"){if(y){E=Z.events[I][1].end;break}y=!0}V(Q),A=C;while(A<Z.events.length)Z.events[A][1].end={...E},A++;c1(Z.events,I+1,0,Z.events.slice(C)),Z.events.length=A}}function V(_){let O=J.length;while(O-- >_){let D=J[O];Z.containerState=D[1],D[0].exit.call(Z,$)}J.length=_}function M(){X.write([null]),z=void 0,X=void 0,Z.containerState._closeFlow=void 0}}function Ce($,Z,J){return r0($,$.attempt(this.parser.constructs.document,Z,J),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function y9($){if($===null||M5($)||W9($))return 1;if(Y7($))return 2}function m6($,Z,J){let Q=[],X=-1;while(++X<$.length){let z=$[X].resolveAll;if(z&&!Q.includes(z))Z=z(Z,J),Q.push(z)}return Z}var dQ={name:"attention",resolveAll:Ee,tokenize:Se};function Ee($,Z){let J=-1,Q,X,z,G,H,Y,K,W;while(++J<$.length)if($[J][0]==="enter"&&$[J][1].type==="attentionSequence"&&$[J][1]._close){Q=J;while(Q--)if($[Q][0]==="exit"&&$[Q][1].type==="attentionSequence"&&$[Q][1]._open&&Z.sliceSerialize($[Q][1]).charCodeAt(0)===Z.sliceSerialize($[J][1]).charCodeAt(0)){if(($[Q][1]._close||$[J][1]._open)&&($[J][1].end.offset-$[J][1].start.offset)%3&&!(($[Q][1].end.offset-$[Q][1].start.offset+$[J][1].end.offset-$[J][1].start.offset)%3))continue;Y=$[Q][1].end.offset-$[Q][1].start.offset>1&&$[J][1].end.offset-$[J][1].start.offset>1?2:1;let B={...$[Q][1].end},q={...$[J][1].start};if(dk(B,-Y),dk(q,Y),G={type:Y>1?"strongSequence":"emphasisSequence",start:B,end:{...$[Q][1].end}},H={type:Y>1?"strongSequence":"emphasisSequence",start:{...$[J][1].start},end:q},z={type:Y>1?"strongText":"emphasisText",start:{...$[Q][1].end},end:{...$[J][1].start}},X={type:Y>1?"strong":"emphasis",start:{...G.start},end:{...H.end}},$[Q][1].end={...G.start},$[J][1].start={...H.end},K=[],$[Q][1].end.offset-$[Q][1].start.offset)K=e8(K,[["enter",$[Q][1],Z],["exit",$[Q][1],Z]]);if(K=e8(K,[["enter",X,Z],["enter",G,Z],["exit",G,Z],["enter",z,Z]]),K=e8(K,m6(Z.parser.constructs.insideSpan.null,$.slice(Q+1,J),Z)),K=e8(K,[["exit",z,Z],["enter",H,Z],["exit",H,Z],["exit",X,Z]]),$[J][1].end.offset-$[J][1].start.offset)W=2,K=e8(K,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);else W=0;c1($,Q-1,J-Q+3,K),J=Q+K.length-W-2;break}}J=-1;while(++J<$.length)if($[J][1].type==="attentionSequence")$[J][1].type="data";return $}function Se($,Z){let J=this.parser.constructs.attentionMarkers.null,Q=this.previous,X=y9(Q),z;return G;function G(Y){return z=Y,$.enter("attentionSequence"),H(Y)}function H(Y){if(Y===z)return $.consume(Y),H;let K=$.exit("attentionSequence"),W=y9(Y),B=!W||W===2&&X||J.includes(Y),q=!X||X===2&&W||J.includes(Q);return K._open=Boolean(z===42?B:B&&(X||!q)),K._close=Boolean(z===42?q:q&&(W||!B)),Z(Y)}}function dk($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var PN={name:"autolink",tokenize:ke};function ke($,Z,J){let Q=0;return X;function X(U){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),z}function z(U){if(X8(U))return $.consume(U),G;if(U===64)return J(U);return K(U)}function G(U){if(U===43||U===45||U===46||f1(U))return Q=1,H(U);return K(U)}function H(U){if(U===58)return $.consume(U),Q=0,Y;if((U===43||U===45||U===46||f1(U))&&Q++<32)return $.consume(U),H;return Q=0,K(U)}function Y(U){if(U===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(U===null||U===32||U===60||H7(U))return J(U);return $.consume(U),Y}function K(U){if(U===64)return $.consume(U),W;if(vk(U))return $.consume(U),K;return J(U)}function W(U){return f1(U)?B(U):J(U)}function B(U){if(U===46)return $.consume(U),Q=0,W;if(U===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(U),$.exit("autolinkMarker"),$.exit("autolink"),Z;return q(U)}function q(U){if((U===45||f1(U))&&Q++<63){let F=U===45?q:B;return $.consume(U),F}return J(U)}}var B9={partial:!0,tokenize:Ie};function Ie($,Z,J){return Q;function Q(z){return n0(z)?r0($,X,"linePrefix")(z):X(z)}function X(z){return z===null||b0(z)?Z(z):J(z)}}var yK={continuation:{tokenize:ye},exit:be,name:"blockQuote",tokenize:Re};function Re($,Z,J){let Q=this;return X;function X(G){if(G===62){let H=Q.containerState;if(!H.open)$.enter("blockQuote",{_container:!0}),H.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(G),$.exit("blockQuoteMarker"),z}return J(G)}function z(G){if(n0(G))return $.enter("blockQuotePrefixWhitespace"),$.consume(G),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(G)}}function ye($,Z,J){let Q=this;return X;function X(G){if(n0(G))return r0($,z,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G);return z(G)}function z(G){return $.attempt(yK,Z,J)(G)}}function be($){$.exit("blockQuote")}var bK={name:"characterEscape",tokenize:xe};function xe($,Z,J){return Q;function Q(z){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(z),$.exit("escapeMarker"),X}function X(z){if(mk(z))return $.enter("characterEscapeValue"),$.consume(z),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return J(z)}}var xK={name:"characterReference",tokenize:he};function he($,Z,J){let Q=this,X=0,z,G;return H;function H(B){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(B),$.exit("characterReferenceMarker"),Y}function Y(B){if(B===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(B),$.exit("characterReferenceMarkerNumeric"),K;return $.enter("characterReferenceValue"),z=31,G=f1,W(B)}function K(B){if(B===88||B===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(B),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),z=6,G=fk,W;return $.enter("characterReferenceValue"),z=7,G=cQ,W(B)}function W(B){if(B===59&&X){let q=$.exit("characterReferenceValue");if(G===f1&&!JZ(Q.sliceSerialize(q)))return J(B);return $.enter("characterReferenceMarker"),$.consume(B),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(G(B)&&X++<z)return $.consume(B),W;return J(B)}}var lk={partial:!0,tokenize:ve},hK={concrete:!0,name:"codeFenced",tokenize:ge};function ge($,Z,J){let Q=this,X={partial:!0,tokenize:D},z=0,G=0,H;return Y;function Y(A){return K(A)}function K(A){let C=Q.events[Q.events.length-1];return z=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,H=A,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),W(A)}function W(A){if(A===H)return G++,$.consume(A),W;if(G<3)return J(A);return $.exit("codeFencedFenceSequence"),n0(A)?r0($,B,"whitespace")(A):B(A)}function B(A){if(A===null||b0(A))return $.exit("codeFencedFence"),Q.interrupt?Z(A):$.check(lk,N,O)(A);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),q(A)}function q(A){if(A===null||b0(A))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),B(A);if(n0(A))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),r0($,U,"whitespace")(A);if(A===96&&A===H)return J(A);return $.consume(A),q}function U(A){if(A===null||b0(A))return B(A);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),F(A)}function F(A){if(A===null||b0(A))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),B(A);if(A===96&&A===H)return J(A);return $.consume(A),F}function N(A){return $.attempt(X,O,L)(A)}function L(A){return $.enter("lineEnding"),$.consume(A),$.exit("lineEnding"),V}function V(A){return z>0&&n0(A)?r0($,M,"linePrefix",z+1)(A):M(A)}function M(A){if(A===null||b0(A))return $.check(lk,N,O)(A);return $.enter("codeFlowValue"),_(A)}function _(A){if(A===null||b0(A))return $.exit("codeFlowValue"),M(A);return $.consume(A),_}function O(A){return $.exit("codeFenced"),Z(A)}function D(A,C,I){let y=0;return E;function E(T){return A.enter("lineEnding"),A.consume(T),A.exit("lineEnding"),h}function h(T){return A.enter("codeFencedFence"),n0(T)?r0(A,k,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):k(T)}function k(T){if(T===H)return A.enter("codeFencedFenceSequence"),S(T);return I(T)}function S(T){if(T===H)return y++,A.consume(T),S;if(y>=G)return A.exit("codeFencedFenceSequence"),n0(T)?r0(A,w,"whitespace")(T):w(T);return I(T)}function w(T){if(T===null||b0(T))return A.exit("codeFencedFence"),C(T);return I(T)}}}function ve($,Z,J){let Q=this;return X;function X(G){if(G===null)return J(G);return $.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),z}function z(G){return Q.parser.lazy[Q.now().line]?J(G):Z(G)}}var lQ={name:"codeIndented",tokenize:me},fe={partial:!0,tokenize:pe};function me($,Z,J){let Q=this;return X;function X(K){return $.enter("codeIndented"),r0($,z,"linePrefix",5)(K)}function z(K){let W=Q.events[Q.events.length-1];return W&&W[1].type==="linePrefix"&&W[2].sliceSerialize(W[1],!0).length>=4?G(K):J(K)}function G(K){if(K===null)return Y(K);if(b0(K))return $.attempt(fe,G,Y)(K);return $.enter("codeFlowValue"),H(K)}function H(K){if(K===null||b0(K))return $.exit("codeFlowValue"),G(K);return $.consume(K),H}function Y(K){return $.exit("codeIndented"),Z(K)}}function pe($,Z,J){let Q=this;return X;function X(G){if(Q.parser.lazy[Q.now().line])return J(G);if(b0(G))return $.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),X;return r0($,z,"linePrefix",5)(G)}function z(G){let H=Q.events[Q.events.length-1];return H&&H[1].type==="linePrefix"&&H[2].sliceSerialize(H[1],!0).length>=4?Z(G):b0(G)?X(G):J(G)}}var wN={name:"codeText",previous:ce,resolve:ue,tokenize:de};function ue($){let Z=$.length-4,J=3,Q,X;if(($[J][1].type==="lineEnding"||$[J][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){Q=J;while(++Q<Z)if($[Q][1].type==="codeTextData"){$[J][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",J+=2,Z-=2;break}}Q=J-1,Z++;while(++Q<=Z)if(X===void 0){if(Q!==Z&&$[Q][1].type!=="lineEnding")X=Q}else if(Q===Z||$[Q][1].type==="lineEnding"){if($[X][1].type="codeTextData",Q!==X+2)$[X][1].end=$[Q-1][1].end,$.splice(X+2,Q-X-2),Z-=Q-X-2,Q=X+2;X=void 0}return $}function ce($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function de($,Z,J){let Q=this,X=0,z,G;return H;function H(q){return $.enter("codeText"),$.enter("codeTextSequence"),Y(q)}function Y(q){if(q===96)return $.consume(q),X++,Y;return $.exit("codeTextSequence"),K(q)}function K(q){if(q===null)return J(q);if(q===32)return $.enter("space"),$.consume(q),$.exit("space"),K;if(q===96)return G=$.enter("codeTextSequence"),z=0,B(q);if(b0(q))return $.enter("lineEnding"),$.consume(q),$.exit("lineEnding"),K;return $.enter("codeTextData"),W(q)}function W(q){if(q===null||q===32||q===96||b0(q))return $.exit("codeTextData"),K(q);return $.consume(q),W}function B(q){if(q===96)return $.consume(q),z++,B;if(z===X)return $.exit("codeTextSequence"),$.exit("codeText"),Z(q);return G.type="codeTextData",W(q)}}class jN{constructor($){this.left=$?[...$]:[],this.right=[]}get($){if($<0||$>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+$+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if($<this.left.length)return this.left[$];return this.right[this.right.length-$+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice($,Z){let J=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(J<this.left.length)return this.left.slice($,J);if($>this.left.length)return this.right.slice(this.right.length-J+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-J+this.left.length).reverse())}splice($,Z,J){let Q=Z||0;this.setCursor(Math.trunc($));let X=this.right.splice(this.right.length-Q,Number.POSITIVE_INFINITY);if(J)iQ(this.left,J);return X.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push($){this.setCursor(Number.POSITIVE_INFINITY),this.left.push($)}pushMany($){this.setCursor(Number.POSITIVE_INFINITY),iQ(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),iQ(this.right,$.reverse())}setCursor($){if($===this.left.length||$>this.left.length&&this.right.length===0||$<0&&this.left.length===0)return;if($<this.left.length){let Z=this.left.splice($,Number.POSITIVE_INFINITY);iQ(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);iQ(this.left,Z.reverse())}}}function iQ($,Z){let J=0;if(Z.length<1e4)$.push(...Z);else while(J<Z.length)$.push(...Z.slice(J,J+1e4)),J+=1e4}function gK($){let Z={},J=-1,Q,X,z,G,H,Y,K,W=new jN($);while(++J<W.length){while(J in Z)J=Z[J];if(Q=W.get(J),J&&Q[1].type==="chunkFlow"&&W.get(J-1)[1].type==="listItemPrefix"){if(Y=Q[1]._tokenizer.events,z=0,z<Y.length&&Y[z][1].type==="lineEndingBlank")z+=2;if(z<Y.length&&Y[z][1].type==="content")while(++z<Y.length){if(Y[z][1].type==="content")break;if(Y[z][1].type==="chunkText")Y[z][1]._isInFirstContentOfListItem=!0,z++}}if(Q[0]==="enter"){if(Q[1].contentType)Object.assign(Z,le(W,J)),J=Z[J],K=!0}else if(Q[1]._container){z=J,X=void 0;while(z--)if(G=W.get(z),G[1].type==="lineEnding"||G[1].type==="lineEndingBlank"){if(G[0]==="enter"){if(X)W.get(X)[1].type="lineEndingBlank";G[1].type="lineEnding",X=z}}else if(G[1].type==="linePrefix"||G[1].type==="listItemIndent");else break;if(X)Q[1].end={...W.get(X)[1].start},H=W.slice(X,J),H.unshift(Q),W.splice(X,J-X+1,H)}}return c1($,0,Number.POSITIVE_INFINITY,W.slice(0)),!K}function le($,Z){let J=$.get(Z)[1],Q=$.get(Z)[2],X=Z-1,z=[],G=J._tokenizer;if(!G){if(G=Q.parser[J.contentType](J.start),J._contentTypeTextTrailing)G._contentTypeTextTrailing=!0}let H=G.events,Y=[],K={},W,B,q=-1,U=J,F=0,N=0,L=[N];while(U){while($.get(++X)[1]!==U);if(z.push(X),!U._tokenizer){if(W=Q.sliceStream(U),!U.next)W.push(null);if(B)G.defineSkip(U.start);if(U._isInFirstContentOfListItem)G._gfmTasklistFirstContentOfListItem=!0;if(G.write(W),U._isInFirstContentOfListItem)G._gfmTasklistFirstContentOfListItem=void 0}B=U,U=U.next}U=J;while(++q<H.length)if(H[q][0]==="exit"&&H[q-1][0]==="enter"&&H[q][1].type===H[q-1][1].type&&H[q][1].start.line!==H[q][1].end.line)N=q+1,L.push(N),U._tokenizer=void 0,U.previous=void 0,U=U.next;if(G.events=[],U)U._tokenizer=void 0,U.previous=void 0;else L.pop();q=L.length;while(q--){let V=H.slice(L[q],L[q+1]),M=z.pop();Y.push([M,M+V.length-1]),$.splice(M,2,V)}Y.reverse(),q=-1;while(++q<Y.length)K[F+Y[q][0]]=F+Y[q][1],F+=Y[q][1]-Y[q][0]-1;return K}var TN={resolve:re,tokenize:ae},ie={partial:!0,tokenize:ne};function re($){return gK($),$}function ae($,Z){let J;return Q;function Q(H){return $.enter("content"),J=$.enter("chunkContent",{contentType:"content"}),X(H)}function X(H){if(H===null)return z(H);if(b0(H))return $.check(ie,G,z)(H);return $.consume(H),X}function z(H){return $.exit("chunkContent"),$.exit("content"),Z(H)}function G(H){return $.consume(H),$.exit("chunkContent"),J.next=$.enter("chunkContent",{contentType:"content",previous:J}),J=J.next,X}}function ne($,Z,J){let Q=this;return X;function X(G){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),r0($,z,"linePrefix")}function z(G){if(G===null||b0(G))return J(G);let H=Q.events[Q.events.length-1];if(!Q.parser.constructs.disable.null.includes("codeIndented")&&H&&H[1].type==="linePrefix"&&H[2].sliceSerialize(H[1],!0).length>=4)return Z(G);return $.interrupt(Q.parser.constructs.flow,J,Z)(G)}}function vK($,Z,J,Q,X,z,G,H,Y){let K=Y||Number.POSITIVE_INFINITY,W=0;return B;function B(V){if(V===60)return $.enter(Q),$.enter(X),$.enter(z),$.consume(V),$.exit(z),q;if(V===null||V===32||V===41||H7(V))return J(V);return $.enter(Q),$.enter(G),$.enter(H),$.enter("chunkString",{contentType:"string"}),N(V)}function q(V){if(V===62)return $.enter(z),$.consume(V),$.exit(z),$.exit(X),$.exit(Q),Z;return $.enter(H),$.enter("chunkString",{contentType:"string"}),U(V)}function U(V){if(V===62)return $.exit("chunkString"),$.exit(H),q(V);if(V===null||V===60||b0(V))return J(V);return $.consume(V),V===92?F:U}function F(V){if(V===60||V===62||V===92)return $.consume(V),U;return U(V)}function N(V){if(!W&&(V===null||V===41||M5(V)))return $.exit("chunkString"),$.exit(H),$.exit(G),$.exit(Q),Z(V);if(W<K&&V===40)return $.consume(V),W++,N;if(V===41)return $.consume(V),W--,N;if(V===null||V===32||V===40||H7(V))return J(V);return $.consume(V),V===92?L:N}function L(V){if(V===40||V===41||V===92)return $.consume(V),N;return N(V)}}function fK($,Z,J,Q,X,z){let G=this,H=0,Y;return K;function K(U){return $.enter(Q),$.enter(X),$.consume(U),$.exit(X),$.enter(z),W}function W(U){if(H>999||U===null||U===91||U===93&&!Y||U===94&&!H&&"_hiddenFootnoteSupport"in G.parser.constructs)return J(U);if(U===93)return $.exit(z),$.enter(X),$.consume(U),$.exit(X),$.exit(Q),Z;if(b0(U))return $.enter("lineEnding"),$.consume(U),$.exit("lineEnding"),W;return $.enter("chunkString",{contentType:"string"}),B(U)}function B(U){if(U===null||U===91||U===93||b0(U)||H++>999)return $.exit("chunkString"),W(U);if($.consume(U),!Y)Y=!n0(U);return U===92?q:B}function q(U){if(U===91||U===92||U===93)return $.consume(U),H++,B;return B(U)}}function mK($,Z,J,Q,X,z){let G;return H;function H(q){if(q===34||q===39||q===40)return $.enter(Q),$.enter(X),$.consume(q),$.exit(X),G=q===40?41:q,Y;return J(q)}function Y(q){if(q===G)return $.enter(X),$.consume(q),$.exit(X),$.exit(Q),Z;return $.enter(z),K(q)}function K(q){if(q===G)return $.exit(z),Y(G);if(q===null)return J(q);if(b0(q))return $.enter("lineEnding"),$.consume(q),$.exit("lineEnding"),r0($,K,"linePrefix");return $.enter("chunkString",{contentType:"string"}),W(q)}function W(q){if(q===G||q===null||b0(q))return $.exit("chunkString"),K(q);return $.consume(q),q===92?B:W}function B(q){if(q===G||q===92)return $.consume(q),W;return W(q)}}function K7($,Z){let J;return Q;function Q(X){if(b0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),J=!0,Q;if(n0(X))return r0($,Q,J?"linePrefix":"lineSuffix")(X);return Z(X)}}var CN={name:"definition",tokenize:se},oe={partial:!0,tokenize:te};function se($,Z,J){let Q=this,X;return z;function z(U){return $.enter("definition"),G(U)}function G(U){return fK.call(Q,$,H,J,"definitionLabel","definitionLabelMarker","definitionLabelString")(U)}function H(U){if(X=f8(Q.sliceSerialize(Q.events[Q.events.length-1][1]).slice(1,-1)),U===58)return $.enter("definitionMarker"),$.consume(U),$.exit("definitionMarker"),Y;return J(U)}function Y(U){return M5(U)?K7($,K)(U):K(U)}function K(U){return vK($,W,J,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(U)}function W(U){return $.attempt(oe,B,B)(U)}function B(U){return n0(U)?r0($,q,"whitespace")(U):q(U)}function q(U){if(U===null||b0(U))return $.exit("definition"),Q.parser.defined.push(X),Z(U);return J(U)}}function te($,Z,J){return Q;function Q(H){return M5(H)?K7($,X)(H):J(H)}function X(H){return mK($,z,J,"definitionTitle","definitionTitleMarker","definitionTitleString")(H)}function z(H){return n0(H)?r0($,G,"whitespace")(H):G(H)}function G(H){return H===null||b0(H)?Z(H):J(H)}}var EN={name:"hardBreakEscape",tokenize:ee};function ee($,Z,J){return Q;function Q(z){return $.enter("hardBreakEscape"),$.consume(z),X}function X(z){if(b0(z))return $.exit("hardBreakEscape"),Z(z);return J(z)}}var SN={name:"headingAtx",resolve:$00,tokenize:Z00};function $00($,Z){let J=$.length-2,Q=3,X,z;if($[Q][1].type==="whitespace")Q+=2;if(J-2>Q&&$[J][1].type==="whitespace")J-=2;if($[J][1].type==="atxHeadingSequence"&&(Q===J-1||J-4>Q&&$[J-2][1].type==="whitespace"))J-=Q+1===J?2:4;if(J>Q)X={type:"atxHeadingText",start:$[Q][1].start,end:$[J][1].end},z={type:"chunkText",start:$[Q][1].start,end:$[J][1].end,contentType:"text"},c1($,Q,J-Q+1,[["enter",X,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z]]);return $}function Z00($,Z,J){let Q=0;return X;function X(W){return $.enter("atxHeading"),z(W)}function z(W){return $.enter("atxHeadingSequence"),G(W)}function G(W){if(W===35&&Q++<6)return $.consume(W),G;if(W===null||M5(W))return $.exit("atxHeadingSequence"),H(W);return J(W)}function H(W){if(W===35)return $.enter("atxHeadingSequence"),Y(W);if(W===null||b0(W))return $.exit("atxHeading"),Z(W);if(n0(W))return r0($,H,"whitespace")(W);return $.enter("atxHeadingText"),K(W)}function Y(W){if(W===35)return $.consume(W),Y;return $.exit("atxHeadingSequence"),H(W)}function K(W){if(W===null||W===35||M5(W))return $.exit("atxHeadingText"),H(W);return $.consume(W),K}}var ik=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],kN=["pre","script","style","textarea"];var IN={concrete:!0,name:"htmlFlow",resolveTo:X00,tokenize:z00},J00={partial:!0,tokenize:H00},Q00={partial:!0,tokenize:G00};function X00($){let Z=$.length;while(Z--)if($[Z][0]==="enter"&&$[Z][1].type==="htmlFlow")break;if(Z>1&&$[Z-2][1].type==="linePrefix")$[Z][1].start=$[Z-2][1].start,$[Z+1][1].start=$[Z-2][1].start,$.splice(Z-2,2);return $}function z00($,Z,J){let Q=this,X,z,G,H,Y;return K;function K(x){return W(x)}function W(x){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(x),B}function B(x){if(x===33)return $.consume(x),q;if(x===47)return $.consume(x),z=!0,N;if(x===63)return $.consume(x),X=3,Q.interrupt?Z:j;if(X8(x))return $.consume(x),G=String.fromCharCode(x),L;return J(x)}function q(x){if(x===45)return $.consume(x),X=2,U;if(x===91)return $.consume(x),X=5,H=0,F;if(X8(x))return $.consume(x),X=4,Q.interrupt?Z:j;return J(x)}function U(x){if(x===45)return $.consume(x),Q.interrupt?Z:j;return J(x)}function F(x){if(x==="CDATA[".charCodeAt(H++)){if($.consume(x),H===6)return Q.interrupt?Z:k;return F}return J(x)}function N(x){if(X8(x))return $.consume(x),G=String.fromCharCode(x),L;return J(x)}function L(x){if(x===null||x===47||x===62||M5(x)){let $0=x===47,M0=G.toLowerCase();if(!$0&&!z&&kN.includes(M0))return X=1,Q.interrupt?Z(x):k(x);if(ik.includes(G.toLowerCase())){if(X=6,$0)return $.consume(x),V;return Q.interrupt?Z(x):k(x)}return X=7,Q.interrupt&&!Q.parser.lazy[Q.now().line]?J(x):z?M(x):_(x)}if(x===45||f1(x))return $.consume(x),G+=String.fromCharCode(x),L;return J(x)}function V(x){if(x===62)return $.consume(x),Q.interrupt?Z:k;return J(x)}function M(x){if(n0(x))return $.consume(x),M;return E(x)}function _(x){if(x===47)return $.consume(x),E;if(x===58||x===95||X8(x))return $.consume(x),O;if(n0(x))return $.consume(x),_;return E(x)}function O(x){if(x===45||x===46||x===58||x===95||f1(x))return $.consume(x),O;return D(x)}function D(x){if(x===61)return $.consume(x),A;if(n0(x))return $.consume(x),D;return _(x)}function A(x){if(x===null||x===60||x===61||x===62||x===96)return J(x);if(x===34||x===39)return $.consume(x),Y=x,C;if(n0(x))return $.consume(x),A;return I(x)}function C(x){if(x===Y)return $.consume(x),Y=null,y;if(x===null||b0(x))return J(x);return $.consume(x),C}function I(x){if(x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||M5(x))return D(x);return $.consume(x),I}function y(x){if(x===47||x===62||n0(x))return _(x);return J(x)}function E(x){if(x===62)return $.consume(x),h;return J(x)}function h(x){if(x===null||b0(x))return k(x);if(n0(x))return $.consume(x),h;return J(x)}function k(x){if(x===45&&X===2)return $.consume(x),R;if(x===60&&X===1)return $.consume(x),b;if(x===62&&X===4)return $.consume(x),e;if(x===63&&X===3)return $.consume(x),j;if(x===93&&X===5)return $.consume(x),u;if(b0(x)&&(X===6||X===7))return $.exit("htmlFlowData"),$.check(J00,t,S)(x);if(x===null||b0(x))return $.exit("htmlFlowData"),S(x);return $.consume(x),k}function S(x){return $.check(Q00,w,t)(x)}function w(x){return $.enter("lineEnding"),$.consume(x),$.exit("lineEnding"),T}function T(x){if(x===null||b0(x))return S(x);return $.enter("htmlFlowData"),k(x)}function R(x){if(x===45)return $.consume(x),j;return k(x)}function b(x){if(x===47)return $.consume(x),G="",g;return k(x)}function g(x){if(x===62){let $0=G.toLowerCase();if(kN.includes($0))return $.consume(x),e;return k(x)}if(X8(x)&&G.length<8)return $.consume(x),G+=String.fromCharCode(x),g;return k(x)}function u(x){if(x===93)return $.consume(x),j;return k(x)}function j(x){if(x===62)return $.consume(x),e;if(x===45&&X===2)return $.consume(x),j;return k(x)}function e(x){if(x===null||b0(x))return $.exit("htmlFlowData"),t(x);return $.consume(x),e}function t(x){return $.exit("htmlFlow"),Z(x)}}function G00($,Z,J){let Q=this;return X;function X(G){if(b0(G))return $.enter("lineEnding"),$.consume(G),$.exit("lineEnding"),z;return J(G)}function z(G){return Q.parser.lazy[Q.now().line]?J(G):Z(G)}}function H00($,Z,J){return Q;function Q(X){return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),$.attempt(B9,Z,J)}}var RN={name:"htmlText",tokenize:Y00};function Y00($,Z,J){let Q=this,X,z,G;return H;function H(j){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(j),Y}function Y(j){if(j===33)return $.consume(j),K;if(j===47)return $.consume(j),D;if(j===63)return $.consume(j),_;if(X8(j))return $.consume(j),I;return J(j)}function K(j){if(j===45)return $.consume(j),W;if(j===91)return $.consume(j),z=0,F;if(X8(j))return $.consume(j),M;return J(j)}function W(j){if(j===45)return $.consume(j),U;return J(j)}function B(j){if(j===null)return J(j);if(j===45)return $.consume(j),q;if(b0(j))return G=B,b(j);return $.consume(j),B}function q(j){if(j===45)return $.consume(j),U;return B(j)}function U(j){return j===62?R(j):j===45?q(j):B(j)}function F(j){if(j==="CDATA[".charCodeAt(z++))return $.consume(j),z===6?N:F;return J(j)}function N(j){if(j===null)return J(j);if(j===93)return $.consume(j),L;if(b0(j))return G=N,b(j);return $.consume(j),N}function L(j){if(j===93)return $.consume(j),V;return N(j)}function V(j){if(j===62)return R(j);if(j===93)return $.consume(j),V;return N(j)}function M(j){if(j===null||j===62)return R(j);if(b0(j))return G=M,b(j);return $.consume(j),M}function _(j){if(j===null)return J(j);if(j===63)return $.consume(j),O;if(b0(j))return G=_,b(j);return $.consume(j),_}function O(j){return j===62?R(j):_(j)}function D(j){if(X8(j))return $.consume(j),A;return J(j)}function A(j){if(j===45||f1(j))return $.consume(j),A;return C(j)}function C(j){if(b0(j))return G=C,b(j);if(n0(j))return $.consume(j),C;return R(j)}function I(j){if(j===45||f1(j))return $.consume(j),I;if(j===47||j===62||M5(j))return y(j);return J(j)}function y(j){if(j===47)return $.consume(j),R;if(j===58||j===95||X8(j))return $.consume(j),E;if(b0(j))return G=y,b(j);if(n0(j))return $.consume(j),y;return R(j)}function E(j){if(j===45||j===46||j===58||j===95||f1(j))return $.consume(j),E;return h(j)}function h(j){if(j===61)return $.consume(j),k;if(b0(j))return G=h,b(j);if(n0(j))return $.consume(j),h;return y(j)}function k(j){if(j===null||j===60||j===61||j===62||j===96)return J(j);if(j===34||j===39)return $.consume(j),X=j,S;if(b0(j))return G=k,b(j);if(n0(j))return $.consume(j),k;return $.consume(j),w}function S(j){if(j===X)return $.consume(j),X=void 0,T;if(j===null)return J(j);if(b0(j))return G=S,b(j);return $.consume(j),S}function w(j){if(j===null||j===34||j===39||j===60||j===61||j===96)return J(j);if(j===47||j===62||M5(j))return y(j);return $.consume(j),w}function T(j){if(j===47||j===62||M5(j))return y(j);return J(j)}function R(j){if(j===62)return $.consume(j),$.exit("htmlTextData"),$.exit("htmlText"),Z;return J(j)}function b(j){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(j),$.exit("lineEnding"),g}function g(j){return n0(j)?r0($,u,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):u(j)}function u(j){return $.enter("htmlTextData"),G(j)}}var W7={name:"labelEnd",resolveAll:q00,resolveTo:U00,tokenize:F00},K00={tokenize:N00},W00={tokenize:V00},B00={tokenize:L00};function q00($){let Z=-1,J=[];while(++Z<$.length){let Q=$[Z][1];if(J.push($[Z]),Q.type==="labelImage"||Q.type==="labelLink"||Q.type==="labelEnd"){let X=Q.type==="labelImage"?4:2;Q.type="data",Z+=X}}if($.length!==J.length)c1($,0,$.length,J);return $}function U00($,Z){let J=$.length,Q=0,X,z,G,H;while(J--)if(X=$[J][1],z){if(X.type==="link"||X.type==="labelLink"&&X._inactive)break;if($[J][0]==="enter"&&X.type==="labelLink")X._inactive=!0}else if(G){if($[J][0]==="enter"&&(X.type==="labelImage"||X.type==="labelLink")&&!X._balanced){if(z=J,X.type!=="labelLink"){Q=2;break}}}else if(X.type==="labelEnd")G=J;let Y={type:$[z][1].type==="labelLink"?"link":"image",start:{...$[z][1].start},end:{...$[$.length-1][1].end}},K={type:"label",start:{...$[z][1].start},end:{...$[G][1].end}},W={type:"labelText",start:{...$[z+Q+2][1].end},end:{...$[G-2][1].start}};return H=[["enter",Y,Z],["enter",K,Z]],H=e8(H,$.slice(z+1,z+Q+3)),H=e8(H,[["enter",W,Z]]),H=e8(H,m6(Z.parser.constructs.insideSpan.null,$.slice(z+Q+4,G-3),Z)),H=e8(H,[["exit",W,Z],$[G-2],$[G-1],["exit",K,Z]]),H=e8(H,$.slice(G+1)),H=e8(H,[["exit",Y,Z]]),c1($,z,$.length,H),$}function F00($,Z,J){let Q=this,X=Q.events.length,z,G;while(X--)if((Q.events[X][1].type==="labelImage"||Q.events[X][1].type==="labelLink")&&!Q.events[X][1]._balanced){z=Q.events[X][1];break}return H;function H(q){if(!z)return J(q);if(z._inactive)return B(q);return G=Q.parser.defined.includes(f8(Q.sliceSerialize({start:z.end,end:Q.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(q),$.exit("labelMarker"),$.exit("labelEnd"),Y}function Y(q){if(q===40)return $.attempt(K00,W,G?W:B)(q);if(q===91)return $.attempt(W00,W,G?K:B)(q);return G?W(q):B(q)}function K(q){return $.attempt(B00,W,B)(q)}function W(q){return Z(q)}function B(q){return z._balanced=!0,J(q)}}function N00($,Z,J){return Q;function Q(B){return $.enter("resource"),$.enter("resourceMarker"),$.consume(B),$.exit("resourceMarker"),X}function X(B){return M5(B)?K7($,z)(B):z(B)}function z(B){if(B===41)return W(B);return vK($,G,H,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(B)}function G(B){return M5(B)?K7($,Y)(B):W(B)}function H(B){return J(B)}function Y(B){if(B===34||B===39||B===40)return mK($,K,J,"resourceTitle","resourceTitleMarker","resourceTitleString")(B);return W(B)}function K(B){return M5(B)?K7($,W)(B):W(B)}function W(B){if(B===41)return $.enter("resourceMarker"),$.consume(B),$.exit("resourceMarker"),$.exit("resource"),Z;return J(B)}}function V00($,Z,J){let Q=this;return X;function X(H){return fK.call(Q,$,z,G,"reference","referenceMarker","referenceString")(H)}function z(H){return Q.parser.defined.includes(f8(Q.sliceSerialize(Q.events[Q.events.length-1][1]).slice(1,-1)))?Z(H):J(H)}function G(H){return J(H)}}function L00($,Z,J){return Q;function Q(z){return $.enter("reference"),$.enter("referenceMarker"),$.consume(z),$.exit("referenceMarker"),X}function X(z){if(z===93)return $.enter("referenceMarker"),$.consume(z),$.exit("referenceMarker"),$.exit("reference"),Z;return J(z)}}var yN={name:"labelStartImage",resolveAll:W7.resolveAll,tokenize:M00};function M00($,Z,J){let Q=this;return X;function X(H){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(H),$.exit("labelImageMarker"),z}function z(H){if(H===91)return $.enter("labelMarker"),$.consume(H),$.exit("labelMarker"),$.exit("labelImage"),G;return J(H)}function G(H){return H===94&&"_hiddenFootnoteSupport"in Q.parser.constructs?J(H):Z(H)}}var bN={name:"labelStartLink",resolveAll:W7.resolveAll,tokenize:A00};function A00($,Z,J){let Q=this;return X;function X(G){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(G),$.exit("labelMarker"),$.exit("labelLink"),z}function z(G){return G===94&&"_hiddenFootnoteSupport"in Q.parser.constructs?J(G):Z(G)}}var rQ={name:"lineEnding",tokenize:_00};function _00($,Z){return J;function J(Q){return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),r0($,Z,"linePrefix")}}var B7={name:"thematicBreak",tokenize:D00};function D00($,Z,J){let Q=0,X;return z;function z(K){return $.enter("thematicBreak"),G(K)}function G(K){return X=K,H(K)}function H(K){if(K===X)return $.enter("thematicBreakSequence"),Y(K);if(Q>=3&&(K===null||b0(K)))return $.exit("thematicBreak"),Z(K);return J(K)}function Y(K){if(K===X)return $.consume(K),Q++,Y;return $.exit("thematicBreakSequence"),n0(K)?r0($,H,"whitespace")(K):H(K)}}var m8={continuation:{tokenize:j00},exit:C00,name:"list",tokenize:w00},O00={partial:!0,tokenize:E00},P00={partial:!0,tokenize:T00};function w00($,Z,J){let Q=this,X=Q.events[Q.events.length-1],z=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,G=0;return H;function H(U){let F=Q.containerState.type||(U===42||U===43||U===45?"listUnordered":"listOrdered");if(F==="listUnordered"?!Q.containerState.marker||U===Q.containerState.marker:cQ(U)){if(!Q.containerState.type)Q.containerState.type=F,$.enter(F,{_container:!0});if(F==="listUnordered")return $.enter("listItemPrefix"),U===42||U===45?$.check(B7,J,K)(U):K(U);if(!Q.interrupt||U===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),Y(U)}return J(U)}function Y(U){if(cQ(U)&&++G<10)return $.consume(U),Y;if((!Q.interrupt||G<2)&&(Q.containerState.marker?U===Q.containerState.marker:U===41||U===46))return $.exit("listItemValue"),K(U);return J(U)}function K(U){return $.enter("listItemMarker"),$.consume(U),$.exit("listItemMarker"),Q.containerState.marker=Q.containerState.marker||U,$.check(B9,Q.interrupt?J:W,$.attempt(O00,q,B))}function W(U){return Q.containerState.initialBlankLine=!0,z++,q(U)}function B(U){if(n0(U))return $.enter("listItemPrefixWhitespace"),$.consume(U),$.exit("listItemPrefixWhitespace"),q;return J(U)}function q(U){return Q.containerState.size=z+Q.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(U)}}function j00($,Z,J){let Q=this;return Q.containerState._closeFlow=void 0,$.check(B9,X,z);function X(H){return Q.containerState.furtherBlankLines=Q.containerState.furtherBlankLines||Q.containerState.initialBlankLine,r0($,Z,"listItemIndent",Q.containerState.size+1)(H)}function z(H){if(Q.containerState.furtherBlankLines||!n0(H))return Q.containerState.furtherBlankLines=void 0,Q.containerState.initialBlankLine=void 0,G(H);return Q.containerState.furtherBlankLines=void 0,Q.containerState.initialBlankLine=void 0,$.attempt(P00,Z,G)(H)}function G(H){return Q.containerState._closeFlow=!0,Q.interrupt=void 0,r0($,$.attempt(m8,Z,J),"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H)}}function T00($,Z,J){let Q=this;return r0($,X,"listItemIndent",Q.containerState.size+1);function X(z){let G=Q.events[Q.events.length-1];return G&&G[1].type==="listItemIndent"&&G[2].sliceSerialize(G[1],!0).length===Q.containerState.size?Z(z):J(z)}}function C00($){$.exit(this.containerState.type)}function E00($,Z,J){let Q=this;return r0($,X,"listItemPrefixWhitespace",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function X(z){let G=Q.events[Q.events.length-1];return!n0(z)&&G&&G[1].type==="listItemPrefixWhitespace"?Z(z):J(z)}}var pK={name:"setextUnderline",resolveTo:S00,tokenize:k00};function S00($,Z){let J=$.length,Q,X,z;while(J--)if($[J][0]==="enter"){if($[J][1].type==="content"){Q=J;break}if($[J][1].type==="paragraph")X=J}else{if($[J][1].type==="content")$.splice(J,1);if(!z&&$[J][1].type==="definition")z=J}let G={type:"setextHeading",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}};if($[X][1].type="setextHeadingText",z)$.splice(X,0,["enter",G,Z]),$.splice(z+1,0,["exit",$[Q][1],Z]),$[Q][1].end={...$[z][1].end};else $[Q][1]=G;return $.push(["exit",G,Z]),$}function k00($,Z,J){let Q=this,X;return z;function z(K){let W=Q.events.length,B;while(W--)if(Q.events[W][1].type!=="lineEnding"&&Q.events[W][1].type!=="linePrefix"&&Q.events[W][1].type!=="content"){B=Q.events[W][1].type==="paragraph";break}if(!Q.parser.lazy[Q.now().line]&&(Q.interrupt||B))return $.enter("setextHeadingLine"),X=K,G(K);return J(K)}function G(K){return $.enter("setextHeadingLineSequence"),H(K)}function H(K){if(K===X)return $.consume(K),H;return $.exit("setextHeadingLineSequence"),n0(K)?r0($,Y,"lineSuffix")(K):Y(K)}function Y(K){if(K===null||b0(K))return $.exit("setextHeadingLine"),Z(K);return J(K)}}var rk={tokenize:I00};function I00($){let Z=this,J=$.attempt(B9,Q,$.attempt(this.parser.constructs.flowInitial,X,r0($,$.attempt(this.parser.constructs.flow,X,$.attempt(TN,X)),"linePrefix")));return J;function Q(z){if(z===null){$.consume(z);return}return $.enter("lineEndingBlank"),$.consume(z),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,J}function X(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),Z.currentConstruct=void 0,J}}var ak={resolveAll:tk()},nk=sk("string"),ok=sk("text");function sk($){return{resolveAll:tk($==="text"?R00:void 0),tokenize:Z};function Z(J){let Q=this,X=this.parser.constructs[$],z=J.attempt(X,G,H);return G;function G(W){return K(W)?z(W):H(W)}function H(W){if(W===null){J.consume(W);return}return J.enter("data"),J.consume(W),Y}function Y(W){if(K(W))return J.exit("data"),z(W);return J.consume(W),Y}function K(W){if(W===null)return!0;let B=X[W],q=-1;if(B)while(++q<B.length){let U=B[q];if(!U.previous||U.previous.call(Q,Q.previous))return!0}return!1}}}function tk($){return Z;function Z(J,Q){let X=-1,z;while(++X<=J.length)if(z===void 0){if(J[X]&&J[X][1].type==="data")z=X,X++}else if(!J[X]||J[X][1].type!=="data"){if(X!==z+2)J[z][1].end=J[X-1][1].end,J.splice(z+2,X-z-2),X=z+2;z=void 0}return $?$(J,Q):J}}function R00($,Z){let J=0;while(++J<=$.length)if((J===$.length||$[J][1].type==="lineEnding")&&$[J-1][1].type==="data"){let Q=$[J-1][1],X=Z.sliceStream(Q),z=X.length,G=-1,H=0,Y;while(z--){let K=X[z];if(typeof K==="string"){G=K.length;while(K.charCodeAt(G-1)===32)H++,G--;if(G)break;G=-1}else if(K===-2)Y=!0,H++;else if(K===-1);else{z++;break}}if(Z._contentTypeTextTrailing&&J===$.length)H=0;if(H){let K={type:J===$.length||Y||H<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:z?G:Q.start._bufferIndex+G,_index:Q.start._index+z,line:Q.end.line,column:Q.end.column-H,offset:Q.end.offset-H},end:{...Q.end}};if(Q.end={...K.start},Q.start.offset===Q.end.offset)Object.assign(Q,K);else $.splice(J,0,["enter",K,Z],["exit",K,Z]),J+=2}J++}return $}var xN={};D4(xN,{text:()=>v00,string:()=>g00,insideSpan:()=>f00,flowInitial:()=>x00,flow:()=>h00,document:()=>y00,disable:()=>p00,contentInitial:()=>b00,attentionMarkers:()=>m00});var y00={[42]:m8,[43]:m8,[45]:m8,[48]:m8,[49]:m8,[50]:m8,[51]:m8,[52]:m8,[53]:m8,[54]:m8,[55]:m8,[56]:m8,[57]:m8,[62]:yK},b00={[91]:CN},x00={[-2]:lQ,[-1]:lQ,[32]:lQ},h00={[35]:SN,[42]:B7,[45]:[pK,B7],[60]:IN,[61]:pK,[95]:B7,[96]:hK,[126]:hK},g00={[38]:xK,[92]:bK},v00={[-5]:rQ,[-4]:rQ,[-3]:rQ,[33]:yN,[38]:xK,[42]:dQ,[60]:[PN,RN],[91]:bN,[92]:[EN,bK],[93]:W7,[95]:dQ,[96]:wN},f00={null:[dQ,ak]},m00={null:[42,95]},p00={null:[]};function ek($,Z,J){let Q={_bufferIndex:-1,_index:0,line:J&&J.line||1,column:J&&J.column||1,offset:J&&J.offset||0},X={},z=[],G=[],H=[],Y=!0,K={attempt:y(C),check:y(I),consume:O,enter:D,exit:A,interrupt:y(I,{interrupt:!0})},W={code:null,containerState:{},defineSkip:V,events:[],now:L,parser:$,previous:null,sliceSerialize:F,sliceStream:N,write:U},B=Z.tokenize.call(W,K),q;if(Z.resolveAll)z.push(Z);return W;function U(S){if(G=e8(G,S),M(),G[G.length-1]!==null)return[];return E(Z,0),W.events=m6(z,W.events,W),W.events}function F(S,w){return c00(N(S),w)}function N(S){return u00(G,S)}function L(){let{_bufferIndex:S,_index:w,line:T,column:R,offset:b}=Q;return{_bufferIndex:S,_index:w,line:T,column:R,offset:b}}function V(S){X[S.line]=S.column,k()}function M(){let S;while(Q._index<G.length){let w=G[Q._index];if(typeof w==="string"){if(S=Q._index,Q._bufferIndex<0)Q._bufferIndex=0;while(Q._index===S&&Q._bufferIndex<w.length)_(w.charCodeAt(Q._bufferIndex))}else _(w)}}function _(S){Y=void 0,q=S,B=B(S)}function O(S){if(b0(S))Q.line++,Q.column=1,Q.offset+=S===-3?2:1,k();else if(S!==-1)Q.column++,Q.offset++;if(Q._bufferIndex<0)Q._index++;else if(Q._bufferIndex++,Q._bufferIndex===G[Q._index].length)Q._bufferIndex=-1,Q._index++;W.previous=S,Y=!0}function D(S,w){let T=w||{};return T.type=S,T.start=L(),W.events.push(["enter",T,W]),H.push(T),T}function A(S){let w=H.pop();return w.end=L(),W.events.push(["exit",w,W]),w}function C(S,w){E(S,w.from)}function I(S,w){w.restore()}function y(S,w){return T;function T(R,b,g){let u,j,e,t;return Array.isArray(R)?$0(R):("tokenize"in R)?$0([R]):x(R);function x(U0){return X0;function X0(Y0){let V0=Y0!==null&&U0[Y0],i=Y0!==null&&U0.null,Z0=[...Array.isArray(V0)?V0:V0?[V0]:[],...Array.isArray(i)?i:i?[i]:[]];return $0(Z0)(Y0)}}function $0(U0){if(u=U0,j=0,U0.length===0)return g;return M0(U0[j])}function M0(U0){return X0;function X0(Y0){if(t=h(),e=U0,!U0.partial)W.currentConstruct=U0;if(U0.name&&W.parser.constructs.disable.null.includes(U0.name))return H0(Y0);return U0.tokenize.call(w?Object.assign(Object.create(W),w):W,K,l,H0)(Y0)}}function l(U0){return Y=!0,S(e,t),b}function H0(U0){if(Y=!0,t.restore(),++j<u.length)return M0(u[j]);return g}}}function E(S,w){if(S.resolveAll&&!z.includes(S))z.push(S);if(S.resolve)c1(W.events,w,W.events.length-w,S.resolve(W.events.slice(w),W));if(S.resolveTo)W.events=S.resolveTo(W.events,W)}function h(){let S=L(),w=W.previous,T=W.currentConstruct,R=W.events.length,b=Array.from(H);return{from:R,restore:g};function g(){Q=S,W.previous=w,W.currentConstruct=T,W.events.length=R,H=b,k()}}function k(){if(Q.line in X&&Q.column<2)Q.column=X[Q.line],Q.offset+=X[Q.line]-1}}function u00($,Z){let J=Z.start._index,Q=Z.start._bufferIndex,X=Z.end._index,z=Z.end._bufferIndex,G;if(J===X)G=[$[J].slice(Q,z)];else{if(G=$.slice(J,X),Q>-1){let H=G[0];if(typeof H==="string")G[0]=H.slice(Q);else G.shift()}if(z>0)G.push($[X].slice(0,z))}return G}function c00($,Z){let J=-1,Q=[],X;while(++J<$.length){let z=$[J],G;if(typeof z==="string")G=z;else switch(z){case-5:{G="\r";break}case-4:{G=`
|
|
31
|
+
`;break}case-3:{G=`\r
|
|
32
|
+
`;break}case-2:{G=Z?" ":"\t";break}case-1:{if(!Z&&X)continue;G=" ";break}default:G=String.fromCharCode(z)}X=z===-2,Q.push(G)}return Q.join("")}function hN($){let Q={constructs:IK([xN,...($||{}).extensions||[]]),content:X(pk),defined:[],document:X(ck),flow:X(rk),lazy:{},string:X(nk),text:X(ok)};return Q;function X(z){return G;function G(H){return ek(Q,z,H)}}}function gN($){while(!gK($));return $}var $I=/[\0\t\n\r]/g;function vN(){let $=1,Z="",J=!0,Q;return X;function X(z,G,H){let Y=[],K,W,B,q,U;if(z=Z+(typeof z==="string"?z.toString():new TextDecoder(G||void 0).decode(z)),B=0,Z="",J){if(z.charCodeAt(0)===65279)B++;J=void 0}while(B<z.length){if($I.lastIndex=B,K=$I.exec(z),q=K&&K.index!==void 0?K.index:z.length,U=z.charCodeAt(q),!K){Z=z.slice(B);break}if(U===10&&B===q&&Q)Y.push(-3),Q=void 0;else{if(Q)Y.push(-5),Q=void 0;if(B<q)Y.push(z.slice(B,q)),$+=q-B;switch(U){case 0:{Y.push(65533),$++;break}case 9:{W=Math.ceil($/4)*4,Y.push(-2);while($++<W)Y.push(-1);break}case 10:{Y.push(-4),$=1;break}default:Q=!0,$=1}}B=q+1}if(H){if(Q)Y.push(-5);if(Z)Y.push(Z);Y.push(null)}return Y}}var d00=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZI($){return $.replace(d00,l00)}function l00($,Z,J){if(Z)return Z;if(J.charCodeAt(0)===35){let X=J.charCodeAt(1),z=X===120||X===88;return RK(J.slice(z?2:1),z?16:10)}return JZ(J)||$}var QI={}.hasOwnProperty;function fN($,Z,J){if(Z&&typeof Z==="object")J=Z,Z=void 0;return i00(J)(gN(hN(J).document().write(vN()($,Z,!0))))}function i00($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:z(f),autolinkProtocol:y,autolinkEmail:y,atxHeading:z(Q0),blockQuote:z(Y0),characterEscape:y,characterReference:y,codeFenced:z(V0),codeFencedFenceInfo:G,codeFencedFenceMeta:G,codeIndented:z(V0,G),codeText:z(i,G),codeTextData:y,data:y,codeFlowValue:y,definition:z(Z0),definitionDestinationString:G,definitionLabelString:G,definitionTitleString:G,emphasis:z(J0),hardBreakEscape:z(n),hardBreakTrailing:z(n),htmlFlow:z(m,G),htmlFlowData:y,htmlText:z(m,G),htmlTextData:y,image:z(d),label:G,link:z(f),listItem:z(o),listItemValue:q,listOrdered:z(a,B),listUnordered:z(a),paragraph:z(N0),reference:x,referenceString:G,resourceDestinationString:G,resourceTitleString:G,setextHeading:z(Q0),strong:z(j0),thematicBreak:z(c0)},exit:{atxHeading:Y(),atxHeadingSequence:D,autolink:Y(),autolinkEmail:X0,autolinkProtocol:U0,blockQuote:Y(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:M0,characterReferenceMarkerNumeric:M0,characterReferenceValue:l,characterReference:H0,codeFenced:Y(L),codeFencedFence:N,codeFencedFenceInfo:U,codeFencedFenceMeta:F,codeFlowValue:E,codeIndented:Y(V),codeText:Y(T),codeTextData:E,data:E,definition:Y(),definitionDestinationString:O,definitionLabelString:M,definitionTitleString:_,emphasis:Y(),hardBreakEscape:Y(k),hardBreakTrailing:Y(k),htmlFlow:Y(S),htmlFlowData:E,htmlText:Y(w),htmlTextData:E,image:Y(b),label:u,labelText:g,lineEnding:h,link:Y(R),listItem:Y(),listOrdered:Y(),listUnordered:Y(),paragraph:Y(),referenceString:$0,resourceDestinationString:j,resourceTitleString:e,resource:t,setextHeading:Y(I),setextHeadingLineSequence:C,setextHeadingText:A,strong:Y(),thematicBreak:Y()}};XI(Z,($||{}).mdastExtensions||[]);let J={};return Q;function Q(p){let r={type:"root",children:[]},z0={stack:[r],tokenStack:[],config:Z,enter:H,exit:K,buffer:G,resume:W,data:J},L0=[],P0=-1;while(++P0<p.length)if(p[P0][1].type==="listOrdered"||p[P0][1].type==="listUnordered")if(p[P0][0]==="enter")L0.push(P0);else{let v0=L0.pop();P0=X(p,v0,P0)}P0=-1;while(++P0<p.length){let v0=Z[p[P0][0]];if(QI.call(v0,p[P0][1].type))v0[p[P0][1].type].call(Object.assign({sliceSerialize:p[P0][2].sliceSerialize},z0),p[P0][1])}if(z0.tokenStack.length>0){let v0=z0.tokenStack[z0.tokenStack.length-1];(v0[1]||JI).call(z0,void 0,v0[0])}r.position={start:p6(p.length>0?p[0][1].start:{line:1,column:1,offset:0}),end:p6(p.length>0?p[p.length-2][1].end:{line:1,column:1,offset:0})},P0=-1;while(++P0<Z.transforms.length)r=Z.transforms[P0](r)||r;return r}function X(p,r,z0){let L0=r-1,P0=-1,v0=!1,$5,F5,l0,R0;while(++L0<=z0){let G0=p[L0];switch(G0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(G0[0]==="enter")P0++;else P0--;R0=void 0;break}case"lineEndingBlank":{if(G0[0]==="enter"){if($5&&!R0&&!P0&&!l0)l0=L0;R0=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:R0=void 0}if(!P0&&G0[0]==="enter"&&G0[1].type==="listItemPrefix"||P0===-1&&G0[0]==="exit"&&(G0[1].type==="listUnordered"||G0[1].type==="listOrdered")){if($5){let A0=L0;F5=void 0;while(A0--){let f0=p[A0];if(f0[1].type==="lineEnding"||f0[1].type==="lineEndingBlank"){if(f0[0]==="exit")continue;if(F5)p[F5][1].type="lineEndingBlank",v0=!0;f0[1].type="lineEnding",F5=A0}else if(f0[1].type==="linePrefix"||f0[1].type==="blockQuotePrefix"||f0[1].type==="blockQuotePrefixWhitespace"||f0[1].type==="blockQuoteMarker"||f0[1].type==="listItemIndent");else break}if(l0&&(!F5||l0<F5))$5._spread=!0;$5.end=Object.assign({},F5?p[F5][1].start:G0[1].end),p.splice(F5||L0,0,["exit",$5,G0[2]]),L0++,z0++}if(G0[1].type==="listItemPrefix"){let A0={type:"listItem",_spread:!1,start:Object.assign({},G0[1].start),end:void 0};$5=A0,p.splice(L0,0,["enter",A0,G0[2]]),L0++,z0++,l0=void 0,R0=!0}}}return p[r][1]._spread=v0,z0}function z(p,r){return z0;function z0(L0){if(H.call(this,p(L0),L0),r)r.call(this,L0)}}function G(){this.stack.push({type:"fragment",children:[]})}function H(p,r,z0){this.stack[this.stack.length-1].children.push(p),this.stack.push(p),this.tokenStack.push([r,z0||void 0]),p.position={start:p6(r.start),end:void 0}}function Y(p){return r;function r(z0){if(p)p.call(this,z0);K.call(this,z0)}}function K(p,r){let z0=this.stack.pop(),L0=this.tokenStack.pop();if(!L0)throw Error("Cannot close `"+p.type+"` ("+v6({start:p.start,end:p.end})+"): it’s not open");else if(L0[0].type!==p.type)if(r)r.call(this,p,L0[0]);else(L0[1]||JI).call(this,p,L0[0]);z0.position.end=p6(p.end)}function W(){return G7(this.stack.pop())}function B(){this.data.expectingFirstListItemValue=!0}function q(p){if(this.data.expectingFirstListItemValue){let r=this.stack[this.stack.length-2];r.start=Number.parseInt(this.sliceSerialize(p),10),this.data.expectingFirstListItemValue=void 0}}function U(){let p=this.resume(),r=this.stack[this.stack.length-1];r.lang=p}function F(){let p=this.resume(),r=this.stack[this.stack.length-1];r.meta=p}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function L(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function V(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p.replace(/(\r?\n|\r)$/g,"")}function M(p){let r=this.resume(),z0=this.stack[this.stack.length-1];z0.label=r,z0.identifier=f8(this.sliceSerialize(p)).toLowerCase()}function _(){let p=this.resume(),r=this.stack[this.stack.length-1];r.title=p}function O(){let p=this.resume(),r=this.stack[this.stack.length-1];r.url=p}function D(p){let r=this.stack[this.stack.length-1];if(!r.depth){let z0=this.sliceSerialize(p).length;r.depth=z0}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function C(p){let r=this.stack[this.stack.length-1];r.depth=this.sliceSerialize(p).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function y(p){let z0=this.stack[this.stack.length-1].children,L0=z0[z0.length-1];if(!L0||L0.type!=="text")L0=h0(),L0.position={start:p6(p.start),end:void 0},z0.push(L0);this.stack.push(L0)}function E(p){let r=this.stack.pop();r.value+=this.sliceSerialize(p),r.position.end=p6(p.end)}function h(p){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){let z0=r.children[r.children.length-1];z0.position.end=p6(p.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(r.type))y.call(this,p),E.call(this,p)}function k(){this.data.atHardBreak=!0}function S(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p}function w(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p}function T(){let p=this.resume(),r=this.stack[this.stack.length-1];r.value=p}function R(){let p=this.stack[this.stack.length-1];if(this.data.inReference){let r=this.data.referenceType||"shortcut";p.type+="Reference",p.referenceType=r,delete p.url,delete p.title}else delete p.identifier,delete p.label;this.data.referenceType=void 0}function b(){let p=this.stack[this.stack.length-1];if(this.data.inReference){let r=this.data.referenceType||"shortcut";p.type+="Reference",p.referenceType=r,delete p.url,delete p.title}else delete p.identifier,delete p.label;this.data.referenceType=void 0}function g(p){let r=this.sliceSerialize(p),z0=this.stack[this.stack.length-2];z0.label=ZI(r),z0.identifier=f8(r).toLowerCase()}function u(){let p=this.stack[this.stack.length-1],r=this.resume(),z0=this.stack[this.stack.length-1];if(this.data.inReference=!0,z0.type==="link"){let L0=p.children;z0.children=L0}else z0.alt=r}function j(){let p=this.resume(),r=this.stack[this.stack.length-1];r.url=p}function e(){let p=this.resume(),r=this.stack[this.stack.length-1];r.title=p}function t(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function $0(p){let r=this.resume(),z0=this.stack[this.stack.length-1];z0.label=r,z0.identifier=f8(this.sliceSerialize(p)).toLowerCase(),this.data.referenceType="full"}function M0(p){this.data.characterReferenceType=p.type}function l(p){let r=this.sliceSerialize(p),z0=this.data.characterReferenceType,L0;if(z0)L0=RK(r,z0==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else L0=JZ(r);let P0=this.stack[this.stack.length-1];P0.value+=L0}function H0(p){let r=this.stack.pop();r.position.end=p6(p.end)}function U0(p){E.call(this,p);let r=this.stack[this.stack.length-1];r.url=this.sliceSerialize(p)}function X0(p){E.call(this,p);let r=this.stack[this.stack.length-1];r.url="mailto:"+this.sliceSerialize(p)}function Y0(){return{type:"blockquote",children:[]}}function V0(){return{type:"code",lang:null,meta:null,value:""}}function i(){return{type:"inlineCode",value:""}}function Z0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J0(){return{type:"emphasis",children:[]}}function Q0(){return{type:"heading",depth:0,children:[]}}function n(){return{type:"break"}}function m(){return{type:"html",value:""}}function d(){return{type:"image",title:null,url:"",alt:null}}function f(){return{type:"link",title:null,url:"",children:[]}}function a(p){return{type:"list",ordered:p.type==="listOrdered",start:null,spread:p._spread,children:[]}}function o(p){return{type:"listItem",spread:p._spread,checked:null,children:[]}}function N0(){return{type:"paragraph",children:[]}}function j0(){return{type:"strong",children:[]}}function h0(){return{type:"text",value:""}}function c0(){return{type:"thematicBreak"}}}function p6($){return{line:$.line,column:$.column,offset:$.offset}}function XI($,Z){let J=-1;while(++J<Z.length){let Q=Z[J];if(Array.isArray(Q))XI($,Q);else r00($,Q)}}function r00($,Z){let J;for(J in Z)if(QI.call(Z,J))switch(J){case"canContainEols":{let Q=Z[J];if(Q)$[J].push(...Q);break}case"transforms":{let Q=Z[J];if(Q)$[J].push(...Q);break}case"enter":case"exit":{let Q=Z[J];if(Q)Object.assign($[J],Q);break}}}function JI($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+v6({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+v6({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+v6({start:Z.start,end:Z.end})+") is still open")}function uK($){let Z=this;Z.parser=J;function J(Q){return fN(Q,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var cK=-1,QZ=0,q7=1,XZ=2,aQ=3,nQ=4,oQ=5,sQ=6,dK=7,lK=8;var zI=typeof self==="object"?self:globalThis,a00=($,Z)=>{let J=(X,z)=>{return $.set(z,X),X},Q=(X)=>{if($.has(X))return $.get(X);let[z,G]=Z[X];switch(z){case QZ:case cK:return J(G,X);case q7:{let H=J([],X);for(let Y of G)H.push(Q(Y));return H}case XZ:{let H=J({},X);for(let[Y,K]of G)H[Q(Y)]=Q(K);return H}case aQ:return J(new Date(G),X);case nQ:{let{source:H,flags:Y}=G;return J(new RegExp(H,Y),X)}case oQ:{let H=J(new Map,X);for(let[Y,K]of G)H.set(Q(Y),Q(K));return H}case sQ:{let H=J(new Set,X);for(let Y of G)H.add(Q(Y));return H}case dK:{let{name:H,message:Y}=G;return J(new zI[H](Y),X)}case lK:return J(BigInt(G),X);case"BigInt":return J(Object(BigInt(G)),X);case"ArrayBuffer":return J(new Uint8Array(G).buffer,G);case"DataView":{let{buffer:H}=new Uint8Array(G);return J(new DataView(H),G)}}return J(new zI[z](G),X)};return Q},mN=($)=>a00(new Map,$)(0);var zZ="",{toString:n00}={},{keys:o00}=Object,tQ=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[QZ,Z];let J=n00.call($).slice(8,-1);switch(J){case"Array":return[q7,zZ];case"Object":return[XZ,zZ];case"Date":return[aQ,zZ];case"RegExp":return[nQ,zZ];case"Map":return[oQ,zZ];case"Set":return[sQ,zZ];case"DataView":return[q7,J]}if(J.includes("Array"))return[q7,J];if(J.includes("Error"))return[dK,J];return[XZ,J]},iK=([$,Z])=>$===QZ&&(Z==="function"||Z==="symbol"),s00=($,Z,J,Q)=>{let X=(G,H)=>{let Y=Q.push(G)-1;return J.set(H,Y),Y},z=(G)=>{if(J.has(G))return J.get(G);let[H,Y]=tQ(G);switch(H){case QZ:{let W=G;switch(Y){case"bigint":H=lK,W=G.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+Y);W=null;break;case"undefined":return X([cK],G)}return X([H,W],G)}case q7:{if(Y){let q=G;if(Y==="DataView")q=new Uint8Array(G.buffer);else if(Y==="ArrayBuffer")q=new Uint8Array(G);return X([Y,[...q]],G)}let W=[],B=X([H,W],G);for(let q of G)W.push(z(q));return B}case XZ:{if(Y)switch(Y){case"BigInt":return X([Y,G.toString()],G);case"Boolean":case"Number":case"String":return X([Y,G.valueOf()],G)}if(Z&&"toJSON"in G)return z(G.toJSON());let W=[],B=X([H,W],G);for(let q of o00(G))if($||!iK(tQ(G[q])))W.push([z(q),z(G[q])]);return B}case aQ:return X([H,G.toISOString()],G);case nQ:{let{source:W,flags:B}=G;return X([H,{source:W,flags:B}],G)}case oQ:{let W=[],B=X([H,W],G);for(let[q,U]of G)if($||!(iK(tQ(q))||iK(tQ(U))))W.push([z(q),z(U)]);return B}case sQ:{let W=[],B=X([H,W],G);for(let q of G)if($||!iK(tQ(q)))W.push(z(q));return B}}let{message:K}=G;return X([H,{name:Y,message:K}],G)};return z},pN=($,{json:Z,lossy:J}={})=>{let Q=[];return s00(!(Z||J),!!Z,new Map,Q)($),Q};var GZ=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?mN(pN($,Z)):structuredClone($):($,Z)=>mN(pN($,Z));function t00($,Z){let J=[{type:"text",value:"↩"}];if(Z>1)J.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return J}function e00($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function GI($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=$.options.footnoteBackContent||t00,Q=$.options.footnoteBackLabel||e00,X=$.options.footnoteLabel||"Footnotes",z=$.options.footnoteLabelTagName||"h2",G=$.options.footnoteLabelProperties||{className:["sr-only"]},H=[],Y=-1;while(++Y<$.footnoteOrder.length){let K=$.footnoteById.get($.footnoteOrder[Y]);if(!K)continue;let W=$.all(K),B=String(K.identifier).toUpperCase(),q=z2(B.toLowerCase()),U=0,F=[],N=$.footnoteCounts.get(B);while(N!==void 0&&++U<=N){if(F.length>0)F.push({type:"text",value:" "});let M=typeof J==="string"?J:J(Y,U);if(typeof M==="string")M={type:"text",value:M};F.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+q+(U>1?"-"+U:""),dataFootnoteBackref:"",ariaLabel:typeof Q==="string"?Q:Q(Y,U),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}let L=W[W.length-1];if(L&&L.type==="element"&&L.tagName==="p"){let M=L.children[L.children.length-1];if(M&&M.type==="text")M.value+=" ";else L.children.push({type:"text",value:" "});L.children.push(...F)}else W.push(...F);let V={type:"element",tagName:"li",properties:{id:Z+"fn-"+q},children:$.wrap(W,!0)};$.patch(K,V),H.push(V)}if(H.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:z,properties:{...GZ(G),id:"footnote-label"},children:[{type:"text",value:X}]},{type:"text",value:`
|
|
33
|
+
`},{type:"element",tagName:"ol",properties:{},children:$.wrap(H,!0)},{type:"text",value:`
|
|
34
|
+
`}]}}var q9=function($){if($===null||$===void 0)return Q50;if(typeof $==="function")return rK($);if(typeof $==="object")return Array.isArray($)?$50($):Z50($);if(typeof $==="string")return J50($);throw Error("Expected function, string, or object as test")};function $50($){let Z=[],J=-1;while(++J<$.length)Z[J]=q9($[J]);return rK(Q);function Q(...X){let z=-1;while(++z<Z.length)if(Z[z].apply(this,X))return!0;return!1}}function Z50($){let Z=$;return rK(J);function J(Q){let X=Q,z;for(z in $)if(X[z]!==Z[z])return!1;return!0}}function J50($){return rK(Z);function Z(J){return J&&J.type===$}}function rK($){return Z;function Z(J,Q,X){return Boolean(X50(J)&&$.call(this,J,typeof Q==="number"?Q:void 0,X||void 0))}}function Q50(){return!0}function X50($){return $!==null&&typeof $==="object"&&"type"in $}function HI($){return $}var YI=[],aK=!0,U7=!1,nK="skip";function eQ($,Z,J,Q){let X;if(typeof Z==="function"&&typeof J!=="function")Q=J,J=Z;else X=Z;let z=q9(X),G=Q?-1:1;H($,void 0,[])();function H(Y,K,W){let B=Y&&typeof Y==="object"?Y:{};if(typeof B.type==="string"){let U=typeof B.tagName==="string"?B.tagName:typeof B.name==="string"?B.name:void 0;Object.defineProperty(q,"name",{value:"node ("+HI(Y.type+(U?"<"+U+">":""))+")"})}return q;function q(){let U=YI,F,N,L;if(!Z||z(Y,K,W[W.length-1]||void 0)){if(U=z50(J(Y,W)),U[0]===U7)return U}if("children"in Y&&Y.children){let V=Y;if(V.children&&U[0]!==nK){N=(Q?V.children.length:-1)+G,L=W.concat(V);while(N>-1&&N<V.children.length){let M=V.children[N];if(F=H(M,N,L)(),F[0]===U7)return F;N=typeof F[1]==="number"?F[1]:N+G}}}return U}}}function z50($){if(Array.isArray($))return $;if(typeof $==="number")return[aK,$];return $===null||$===void 0?YI:[$]}function b9($,Z,J,Q){let X,z,G;if(typeof Z==="function"&&typeof J!=="function")z=void 0,G=Z,X=J;else z=Z,G=J,X=Q;eQ($,z,H,X);function H(Y,K){let W=K[K.length-1],B=W?W.children.indexOf(Y):void 0;return G(Y,B,W)}}function KI($,Z){let J={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,J),$.applyData(Z,J)}function WI($,Z){let J={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,J),[$.applyData(Z,J),{type:"text",value:`
|
|
35
|
+
`}]}function BI($,Z){let J=Z.value?Z.value+`
|
|
36
|
+
`:"",Q={},X=Z.lang?Z.lang.split(/\s+/):[];if(X.length>0)Q.className=["language-"+X[0]];let z={type:"element",tagName:"code",properties:Q,children:[{type:"text",value:J}]};if(Z.meta)z.data={meta:Z.meta};return $.patch(Z,z),z=$.applyData(Z,z),z={type:"element",tagName:"pre",properties:{},children:[z]},$.patch(Z,z),z}function qI($,Z){let J={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function UI($,Z){let J={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function FI($,Z){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",Q=String(Z.identifier).toUpperCase(),X=z2(Q.toLowerCase()),z=$.footnoteOrder.indexOf(Q),G,H=$.footnoteCounts.get(Q);if(H===void 0)H=0,$.footnoteOrder.push(Q),G=$.footnoteOrder.length;else G=z+1;H+=1,$.footnoteCounts.set(Q,H);let Y={type:"element",tagName:"a",properties:{href:"#"+J+"fn-"+X,id:J+"fnref-"+X+(H>1?"-"+H:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(G)}]};$.patch(Z,Y);let K={type:"element",tagName:"sup",properties:{},children:[Y]};return $.patch(Z,K),$.applyData(Z,K)}function NI($,Z){let J={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function VI($,Z){if($.options.allowDangerousHtml){let J={type:"raw",value:Z.value};return $.patch(Z,J),$.applyData(Z,J)}return}function oK($,Z){let J=Z.referenceType,Q="]";if(J==="collapsed")Q+="[]";else if(J==="full")Q+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+Q}];let X=$.all(Z),z=X[0];if(z&&z.type==="text")z.value="["+z.value;else X.unshift({type:"text",value:"["});let G=X[X.length-1];if(G&&G.type==="text")G.value+=Q;else X.push({type:"text",value:Q});return X}function LI($,Z){let J=String(Z.identifier).toUpperCase(),Q=$.definitionById.get(J);if(!Q)return oK($,Z);let X={src:z2(Q.url||""),alt:Z.alt};if(Q.title!==null&&Q.title!==void 0)X.title=Q.title;let z={type:"element",tagName:"img",properties:X,children:[]};return $.patch(Z,z),$.applyData(Z,z)}function MI($,Z){let J={src:z2(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)J.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let Q={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function AI($,Z){let J={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,J);let Q={type:"element",tagName:"code",properties:{},children:[J]};return $.patch(Z,Q),$.applyData(Z,Q)}function _I($,Z){let J=String(Z.identifier).toUpperCase(),Q=$.definitionById.get(J);if(!Q)return oK($,Z);let X={href:z2(Q.url||"")};if(Q.title!==null&&Q.title!==void 0)X.title=Q.title;let z={type:"element",tagName:"a",properties:X,children:$.all(Z)};return $.patch(Z,z),$.applyData(Z,z)}function DI($,Z){let J={href:z2(Z.url)};if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let Q={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function OI($,Z,J){let Q=$.all(Z),X=J?G50(J):PI(Z),z={},G=[];if(typeof Z.checked==="boolean"){let W=Q[0],B;if(W&&W.type==="element"&&W.tagName==="p")B=W;else B={type:"element",tagName:"p",properties:{},children:[]},Q.unshift(B);if(B.children.length>0)B.children.unshift({type:"text",value:" "});B.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),z.className=["task-list-item"]}let H=-1;while(++H<Q.length){let W=Q[H];if(X||H!==0||W.type!=="element"||W.tagName!=="p")G.push({type:"text",value:`
|
|
37
|
+
`});if(W.type==="element"&&W.tagName==="p"&&!X)G.push(...W.children);else G.push(W)}let Y=Q[Q.length-1];if(Y&&(X||Y.type!=="element"||Y.tagName!=="p"))G.push({type:"text",value:`
|
|
38
|
+
`});let K={type:"element",tagName:"li",properties:z,children:G};return $.patch(Z,K),$.applyData(Z,K)}function G50($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let J=$.children,Q=-1;while(!Z&&++Q<J.length)Z=PI(J[Q])}return Z}function PI($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function wI($,Z){let J={},Q=$.all(Z),X=-1;if(typeof Z.start==="number"&&Z.start!==1)J.start=Z.start;while(++X<Q.length){let G=Q[X];if(G.type==="element"&&G.tagName==="li"&&G.properties&&Array.isArray(G.properties.className)&&G.properties.className.includes("task-list-item")){J.className=["contains-task-list"];break}}let z={type:"element",tagName:Z.ordered?"ol":"ul",properties:J,children:$.wrap(Q,!0)};return $.patch(Z,z),$.applyData(Z,z)}function jI($,Z){let J={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function TI($,Z){let J={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,J),$.applyData(Z,J)}function CI($,Z){let J={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function EI($,Z){let J=$.all(Z),Q=J.shift(),X=[];if(Q){let G={type:"element",tagName:"thead",properties:{},children:$.wrap([Q],!0)};$.patch(Z.children[0],G),X.push(G)}if(J.length>0){let G={type:"element",tagName:"tbody",properties:{},children:$.wrap(J,!0)},H=ZZ(Z.children[1]),Y=kK(Z.children[Z.children.length-1]);if(H&&Y)G.position={start:H,end:Y};X.push(G)}let z={type:"element",tagName:"table",properties:{},children:$.wrap(X,!0)};return $.patch(Z,z),$.applyData(Z,z)}function SI($,Z,J){let Q=J?J.children:void 0,z=(Q?Q.indexOf(Z):1)===0?"th":"td",G=J&&J.type==="table"?J.align:void 0,H=G?G.length:Z.children.length,Y=-1,K=[];while(++Y<H){let B=Z.children[Y],q={},U=G?G[Y]:void 0;if(U)q.align=U;let F={type:"element",tagName:z,properties:q,children:[]};if(B)F.children=$.all(B),$.patch(B,F),F=$.applyData(B,F);K.push(F)}let W={type:"element",tagName:"tr",properties:{},children:$.wrap(K,!0)};return $.patch(Z,W),$.applyData(Z,W)}function kI($,Z){let J={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function RI($){let Z=String($),J=/\r?\n|\r/g,Q=J.exec(Z),X=0,z=[];while(Q)z.push(II(Z.slice(X,Q.index),X>0,!0),Q[0]),X=Q.index+Q[0].length,Q=J.exec(Z);return z.push(II(Z.slice(X),X>0,!1)),z.join("")}function II($,Z,J){let Q=0,X=$.length;if(Z){let z=$.codePointAt(Q);while(z===9||z===32)Q++,z=$.codePointAt(Q)}if(J){let z=$.codePointAt(X-1);while(z===9||z===32)X--,z=$.codePointAt(X-1)}return X>Q?$.slice(Q,X):""}function yI($,Z){let J={type:"text",value:RI(String(Z.value))};return $.patch(Z,J),$.applyData(Z,J)}function bI($,Z){let J={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,J),$.applyData(Z,J)}var xI={blockquote:KI,break:WI,code:BI,delete:qI,emphasis:UI,footnoteReference:FI,heading:NI,html:VI,imageReference:LI,image:MI,inlineCode:AI,linkReference:_I,link:DI,listItem:OI,list:wI,paragraph:jI,root:TI,strong:CI,table:EI,tableCell:kI,tableRow:SI,text:yI,thematicBreak:bI,toml:sK,yaml:sK,definition:sK,footnoteDefinition:sK};function sK(){return}var uN={}.hasOwnProperty,H50={};function gI($,Z){let J=Z||H50,Q=new Map,X=new Map,z=new Map,G={...xI,...J.handlers},H={all:K,applyData:K50,definitionById:Q,footnoteById:X,footnoteCounts:z,footnoteOrder:[],handlers:G,one:Y,options:J,patch:Y50,wrap:B50};return b9($,function(W){if(W.type==="definition"||W.type==="footnoteDefinition"){let B=W.type==="definition"?Q:X,q=String(W.identifier).toUpperCase();if(!B.has(q))B.set(q,W)}}),H;function Y(W,B){let q=W.type,U=H.handlers[q];if(uN.call(H.handlers,q)&&U)return U(H,W,B);if(H.options.passThrough&&H.options.passThrough.includes(q)){if("children"in W){let{children:N,...L}=W,V=GZ(L);return V.children=H.all(W),V}return GZ(W)}return(H.options.unknownHandler||W50)(H,W,B)}function K(W){let B=[];if("children"in W){let q=W.children,U=-1;while(++U<q.length){let F=H.one(q[U],W);if(F){if(U&&q[U-1].type==="break"){if(!Array.isArray(F)&&F.type==="text")F.value=hI(F.value);if(!Array.isArray(F)&&F.type==="element"){let N=F.children[0];if(N&&N.type==="text")N.value=hI(N.value)}}if(Array.isArray(F))B.push(...F);else B.push(F)}}}return B}}function Y50($,Z){if($.position)Z.position=LN($)}function K50($,Z){let J=Z;if($&&$.data){let Q=$.data.hName,X=$.data.hChildren,z=$.data.hProperties;if(typeof Q==="string")if(J.type==="element")J.tagName=Q;else{let G="children"in J?J.children:[J];J={type:"element",tagName:Q,properties:{},children:G}}if(J.type==="element"&&z)Object.assign(J.properties,GZ(z));if("children"in J&&J.children&&X!==null&&X!==void 0)J.children=X}return J}function W50($,Z){let J=Z.data||{},Q="value"in Z&&!(uN.call(J,"hProperties")||uN.call(J,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function B50($,Z){let J=[],Q=-1;if(Z)J.push({type:"text",value:`
|
|
39
|
+
`});while(++Q<$.length){if(Q)J.push({type:"text",value:`
|
|
40
|
+
`});J.push($[Q])}if(Z&&$.length>0)J.push({type:"text",value:`
|
|
41
|
+
`});return J}function hI($){let Z=0,J=$.charCodeAt(Z);while(J===9||J===32)Z++,J=$.charCodeAt(Z);return $.slice(Z)}function tK($,Z){let J=gI($,Z),Q=J.one($,void 0),X=GI(J),z=Array.isArray(Q)?{type:"root",children:Q}:Q||{type:"root",children:[]};if(X)h5("children"in z),z.children.push({type:"text",value:`
|
|
42
|
+
`},X);return z}function eK($,Z){if($&&"run"in $)return async function(J,Q){let X=tK(J,{file:Q,...Z});await $.run(X,Q)};return function(J,Q){return tK(J,{file:Q,...$||Z})}}function cN($){if($)throw $}var JW=P(iI(),1);function $X($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function dN(){let $=[],Z={run:J,use:Q};return Z;function J(...X){let z=-1,G=X.pop();if(typeof G!=="function")throw TypeError("Expected function as last argument, not "+G);H(null,...X);function H(Y,...K){let W=$[++z],B=-1;if(Y){G(Y);return}while(++B<X.length)if(K[B]===null||K[B]===void 0)K[B]=X[B];if(X=K,W)rI(W,H)(...K);else G(null,...K)}}function Q(X){if(typeof X!=="function")throw TypeError("Expected `middelware` to be a function, not "+X);return $.push(X),Z}}function rI($,Z){let J;return Q;function Q(...G){let H=$.length>G.length,Y;if(H)G.push(X);try{Y=$.apply(this,G)}catch(K){let W=K;if(H&&J)throw W;return X(W)}if(!H)if(Y&&Y.then&&typeof Y.then==="function")Y.then(z,X);else if(Y instanceof Error)X(Y);else z(Y)}function X(G,...H){if(!J)J=!0,Z(G,...H)}function z(G){X(null,G)}}var w2={basename:q50,dirname:U50,extname:F50,join:N50,sep:"/"};function q50($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');ZX($);let J=0,Q=-1,X=$.length,z;if(Z===void 0||Z.length===0||Z.length>$.length){while(X--)if($.codePointAt(X)===47){if(z){J=X+1;break}}else if(Q<0)z=!0,Q=X+1;return Q<0?"":$.slice(J,Q)}if(Z===$)return"";let G=-1,H=Z.length-1;while(X--)if($.codePointAt(X)===47){if(z){J=X+1;break}}else{if(G<0)z=!0,G=X+1;if(H>-1)if($.codePointAt(X)===Z.codePointAt(H--)){if(H<0)Q=X}else H=-1,Q=G}if(J===Q)Q=G;else if(Q<0)Q=$.length;return $.slice(J,Q)}function U50($){if(ZX($),$.length===0)return".";let Z=-1,J=$.length,Q;while(--J)if($.codePointAt(J)===47){if(Q){Z=J;break}}else if(!Q)Q=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function F50($){ZX($);let Z=$.length,J=-1,Q=0,X=-1,z=0,G;while(Z--){let H=$.codePointAt(Z);if(H===47){if(G){Q=Z+1;break}continue}if(J<0)G=!0,J=Z+1;if(H===46){if(X<0)X=Z;else if(z!==1)z=1}else if(X>-1)z=-1}if(X<0||J<0||z===0||z===1&&X===J-1&&X===Q+1)return"";return $.slice(X,J)}function N50(...$){let Z=-1,J;while(++Z<$.length)if(ZX($[Z]),$[Z])J=J===void 0?$[Z]:J+"/"+$[Z];return J===void 0?".":V50(J)}function V50($){ZX($);let Z=$.codePointAt(0)===47,J=L50($,!Z);if(J.length===0&&!Z)J=".";if(J.length>0&&$.codePointAt($.length-1)===47)J+="/";return Z?"/"+J:J}function L50($,Z){let J="",Q=0,X=-1,z=0,G=-1,H,Y;while(++G<=$.length){if(G<$.length)H=$.codePointAt(G);else if(H===47)break;else H=47;if(H===47){if(X===G-1||z===1);else if(X!==G-1&&z===2){if(J.length<2||Q!==2||J.codePointAt(J.length-1)!==46||J.codePointAt(J.length-2)!==46){if(J.length>2){if(Y=J.lastIndexOf("/"),Y!==J.length-1){if(Y<0)J="",Q=0;else J=J.slice(0,Y),Q=J.length-1-J.lastIndexOf("/");X=G,z=0;continue}}else if(J.length>0){J="",Q=0,X=G,z=0;continue}}if(Z)J=J.length>0?J+"/..":"..",Q=2}else{if(J.length>0)J+="/"+$.slice(X+1,G);else J=$.slice(X+1,G);Q=G-X-1}X=G,z=0}else if(H===46&&z>-1)z++;else z=-1}return J}function ZX($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var aI={cwd:M50};function M50(){return"/"}function HZ($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function nI($){if(typeof $==="string")$=new URL($);else if(!HZ($)){let Z=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+$+"`");throw Z.code="ERR_INVALID_ARG_TYPE",Z}if($.protocol!=="file:"){let Z=TypeError("The URL must be of scheme file");throw Z.code="ERR_INVALID_URL_SCHEME",Z}return A50($)}function A50($){if($.hostname!==""){let Q=TypeError('File URL host must be "localhost" or empty on darwin');throw Q.code="ERR_INVALID_FILE_URL_HOST",Q}let Z=$.pathname,J=-1;while(++J<Z.length)if(Z.codePointAt(J)===37&&Z.codePointAt(J+1)===50){let Q=Z.codePointAt(J+2);if(Q===70||Q===102){let X=TypeError("File URL path must not include encoded / characters");throw X.code="ERR_INVALID_FILE_URL_PATH",X}}return decodeURIComponent(Z)}var lN=["history","path","basename","stem","extname","dirname"];class YZ{constructor($){let Z;if(!$)Z={};else if(HZ($))Z={path:$};else if(typeof $==="string"||_50($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":aI.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<lN.length){let X=lN[J];if(X in Z&&Z[X]!==void 0&&Z[X]!==null)this[X]=X==="history"?[...Z[X]]:Z[X]}let Q;for(Q in Z)if(!lN.includes(Q))this[Q]=Z[Q]}get basename(){return typeof this.path==="string"?w2.basename(this.path):void 0}set basename($){rN($,"basename"),iN($,"basename"),this.path=w2.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?w2.dirname(this.path):void 0}set dirname($){oI(this.basename,"dirname"),this.path=w2.join($||"",this.basename)}get extname(){return typeof this.path==="string"?w2.extname(this.path):void 0}set extname($){if(iN($,"extname"),oI(this.dirname,"extname"),$){if($.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if($.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=w2.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(HZ($))$=nI($);if(rN($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?w2.basename(this.path,this.extname):void 0}set stem($){rN($,"stem"),iN($,"stem"),this.path=w2.join(this.dirname||"",$+(this.extname||""))}fail($,Z,J){let Q=this.message($,Z,J);throw Q.fatal=!0,Q}info($,Z,J){let Q=this.message($,Z,J);return Q.fatal=void 0,Q}message($,Z,J){let Q=new s1($,Z,J);if(this.path)Q.name=this.path+":"+Q.name,Q.file=this.path;return Q.fatal=!1,this.messages.push(Q),Q}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function iN($,Z){if($&&$.includes(w2.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+w2.sep+"`")}function rN($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function oI($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function _50($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var sI=function($){let Q=this.constructor.prototype,X=Q[$],z=function(){return X.apply(z,arguments)};return Object.setPrototypeOf(z,Q),z};var D50={}.hasOwnProperty;class sN extends sI{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=dN()}copy(){let $=new sN,Z=-1;while(++Z<this.attachers.length){let J=this.attachers[Z];$.use(...J)}return $.data(JW.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return oN("data",this.frozen),this.namespace[$]=Z,this;return D50.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return oN("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[Z,...J]=this.attachers[this.freezeIndex];if(J[0]===!1)continue;if(J[0]===!0)J[0]=void 0;let Q=Z.call($,...J);if(typeof Q==="function")this.transformers.use(Q)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=ZW($),J=this.parser||this.Parser;return aN("parse",J),J(String(Z),Z)}process($,Z){let J=this;return this.freeze(),aN("process",this.parser||this.Parser),nN("process",this.compiler||this.Compiler),Z?Q(void 0,Z):new Promise(Q);function Q(X,z){let G=ZW($),H=J.parse(G);J.run(H,G,function(K,W,B){if(K||!W||!B)return Y(K);let q=W,U=J.stringify(q,B);if(P50(U))B.value=U;else B.result=U;Y(K,B)});function Y(K,W){if(K||!W)z(K);else if(X)X(W);else h5(Z,"`done` is defined if `resolve` is not"),Z(void 0,W)}}}processSync($){let Z=!1,J;return this.freeze(),aN("processSync",this.parser||this.Parser),nN("processSync",this.compiler||this.Compiler),this.process($,Q),eI("processSync","process",Z),h5(J,"we either bailed on an error or have a tree"),J;function Q(X,z){Z=!0,cN(X),J=z}}run($,Z,J){tI($),this.freeze();let Q=this.transformers;if(!J&&typeof Z==="function")J=Z,Z=void 0;return J?X(void 0,J):new Promise(X);function X(z,G){h5(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let H=ZW(Z);Q.run($,H,Y);function Y(K,W,B){let q=W||$;if(K)G(K);else if(z)z(q);else h5(J,"`done` is defined if `resolve` is not"),J(void 0,q,B)}}}runSync($,Z){let J=!1,Q;return this.run($,Z,X),eI("runSync","run",J),h5(Q,"we either bailed on an error or have a tree"),Q;function X(z,G){cN(z),Q=G,J=!0}}stringify($,Z){this.freeze();let J=ZW(Z),Q=this.compiler||this.Compiler;return nN("stringify",Q),tI($),Q($,J)}use($,...Z){let J=this.attachers,Q=this.namespace;if(oN("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")H($,Z);else if(typeof $==="object")if(Array.isArray($))G($);else z($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function X(Y){if(typeof Y==="function")H(Y,[]);else if(typeof Y==="object")if(Array.isArray(Y)){let[K,...W]=Y;H(K,W)}else z(Y);else throw TypeError("Expected usable value, not `"+Y+"`")}function z(Y){if(!("plugins"in Y)&&!("settings"in Y))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(G(Y.plugins),Y.settings)Q.settings=JW.default(!0,Q.settings,Y.settings)}function G(Y){let K=-1;if(Y===null||Y===void 0);else if(Array.isArray(Y))while(++K<Y.length){let W=Y[K];X(W)}else throw TypeError("Expected a list of plugins, not `"+Y+"`")}function H(Y,K){let W=-1,B=-1;while(++W<J.length)if(J[W][0]===Y){B=W;break}if(B===-1)J.push([Y,...K]);else if(K.length>0){let[q,...U]=K,F=J[B][1];if($X(F)&&$X(q))q=JW.default(!0,F,q);J[B]=[Y,q,...U]}}}}var tN=new sN().freeze();function aN($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function nN($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function oN($,Z){if(Z)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tI($){if(!$X($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function eI($,Z,J){if(!J)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function ZW($){return O50($)?$:new YZ($)}function O50($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function P50($){return typeof $==="string"||w50($)}function w50($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var j50="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$R=[],ZR={allowDangerousHtml:!0},T50=/^(https?|ircs?|mailto|xmpp)$/i,C50=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function QW($){let Z=E50($),J=S50($);return k50(Z.runSync(Z.parse(J),J),$)}function E50($){let Z=$.rehypePlugins||$R,J=$.remarkPlugins||$R,Q=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...ZR}:ZR;return tN().use(uK).use(J).use(eK,Q).use(Z)}function S50($){let Z=$.children||"",J=new YZ;if(typeof Z==="string")J.value=Z;else wK("Unexpected value `"+Z+"` for `children` prop, expected `string`");return J}function k50($,Z){let{allowedElements:J,allowElement:Q,components:X,disallowedElements:z,skipHtml:G,unwrapDisallowed:H}=Z,Y=Z.urlTransform||QR;for(let W of C50)if(Object.hasOwn(Z,W.from))wK("Unexpected `"+W.from+"` prop, "+(W.to?"use `"+W.to+"` instead":"remove it")+" (see <"+j50+"#"+W.id+"> for more info)");if(J&&z)wK("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return b9($,K),_N($,{Fragment:KZ.Fragment,components:X,ignoreInvalidStyle:!0,jsx:KZ.jsx,jsxs:KZ.jsxs,passKeys:!0,passNode:!0});function K(W,B,q){if(W.type==="raw"&&q&&typeof B==="number"){if(G)q.children.splice(B,1);else q.children[B]={type:"text",value:W.value};return B}if(W.type==="element"){let U;for(U in uQ)if(Object.hasOwn(uQ,U)&&Object.hasOwn(W.properties,U)){let F=W.properties[U],N=uQ[U];if(N===null||N.includes(W.tagName))W.properties[U]=Y(String(F||""),U,W)}}if(W.type==="element"){let U=J?!J.includes(W.tagName):z?z.includes(W.tagName):!1;if(!U&&Q&&typeof B==="number")U=!Q(W,B,q);if(U&&q&&typeof B==="number"){if(H&&W.children)q.children.splice(B,1,...W.children);else q.children.splice(B,1);return B}}}}function QR($){let Z=$.indexOf(":"),J=$.indexOf("?"),Q=$.indexOf("#"),X=$.indexOf("/");if(Z===-1||X!==-1&&Z>X||J!==-1&&Z>J||Q!==-1&&Z>Q||T50.test($.slice(0,Z)))return $;return""}var XW=function($,Z,J){let Q=q9(J);if(!$||!$.type||!$.children)throw Error("Expected parent node");if(typeof Z==="number"){if(Z<0||Z===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(Z=$.children.indexOf(Z),Z<0)throw Error("Expected child node or index");while(++Z<$.children.length)if(Q($.children[Z],Z,$))return $.children[Z];return};var x9=function($){if($===null||$===void 0)return y50;if(typeof $==="string")return R50($);if(typeof $==="object")return I50($);if(typeof $==="function")return eN($);throw Error("Expected function, string, or array as `test`")};function I50($){let Z=[],J=-1;while(++J<$.length)Z[J]=x9($[J]);return eN(Q);function Q(...X){let z=-1;while(++z<Z.length)if(Z[z].apply(this,X))return!0;return!1}}function R50($){return eN(Z);function Z(J){return J.tagName===$}}function eN($){return Z;function Z(J,Q,X){return Boolean(b50(J)&&$.call(this,J,typeof Q==="number"?Q:void 0,X||void 0))}}function y50($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function b50($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var XR=/\n/g,zR=/[\t ]+/g,$V=x9("br"),GR=x9(p50),x50=x9("p"),HR=x9("tr"),h50=x9(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",m50,u50]),YR=x9(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function ZV($,Z){let J=Z||{},Q="children"in $?$.children:[],X=YR($),z=BR($,{whitespace:J.whitespace||"normal",breakBefore:!1,breakAfter:!1}),G=[];if($.type==="text"||$.type==="comment")G.push(...WR($,{whitespace:z,breakBefore:!0,breakAfter:!0}));let H=-1;while(++H<Q.length)G.push(...KR(Q[H],$,{whitespace:z,breakBefore:H?void 0:X,breakAfter:H<Q.length-1?$V(Q[H+1]):X}));let Y=[],K;H=-1;while(++H<G.length){let W=G[H];if(typeof W==="number"){if(K!==void 0&&W>K)K=W}else if(W){if(K!==void 0&&K>-1)Y.push(`
|
|
43
|
+
`.repeat(K)||" ");K=-1,Y.push(W)}}return Y.join("")}function KR($,Z,J){if($.type==="element")return g50($,Z,J);if($.type==="text")return J.whitespace==="normal"?WR($,J):v50($);return[]}function g50($,Z,J){let Q=BR($,J),X=$.children||[],z=-1,G=[];if(h50($))return G;let H,Y;if($V($))Y=`
|
|
44
|
+
`;else if(HR($)&&XW(Z,$,HR))Y=`
|
|
45
|
+
`;else if(x50($))H=2,Y=2;else if(YR($))H=1,Y=1;while(++z<X.length)G=G.concat(KR(X[z],$,{whitespace:Q,breakBefore:z?void 0:H,breakAfter:z<X.length-1?$V(X[z+1]):Y}));if(GR($)&&XW(Z,$,GR))G.push("\t");if(H)G.unshift(H);if(Y)G.push(Y);return G}function WR($,Z){let J=String($.value),Q=[],X=[],z=0;while(z<=J.length){XR.lastIndex=z;let Y=XR.exec(J),K=Y&&"index"in Y?Y.index:J.length;Q.push(f50(J.slice(z,K).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),z===0?Z.breakBefore:!0,K===J.length?Z.breakAfter:!0)),z=K+1}let G=-1,H;while(++G<Q.length)if(Q[G].charCodeAt(Q[G].length-1)===8203||G<Q.length-1&&Q[G+1].charCodeAt(0)===8203)X.push(Q[G]),H=void 0;else if(Q[G]){if(typeof H==="number")X.push(H);X.push(Q[G]),H=0}else if(G===0||G===Q.length-1)X.push(0);return X}function v50($){return[String($.value)]}function f50($,Z,J){let Q=[],X=0,z;while(X<$.length){zR.lastIndex=X;let G=zR.exec($);if(z=G?G.index:$.length,!X&&!z&&G&&!Z)Q.push("");if(X!==z)Q.push($.slice(X,z));X=G?z+G[0].length:z}if(X!==z&&!J)Q.push("");return Q.join(" ")}function BR($,Z){if($.type==="element"){let J=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return J.wrap?"pre-wrap":"pre";case"td":case"th":return J.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function m50($){return Boolean(($.properties||{}).hidden)}function p50($){return $.tagName==="td"||$.tagName==="th"}function u50($){return $.tagName==="dialog"&&!($.properties||{}).open}function c50($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",z="<[^<>]+>",G="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",H={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},Y="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},W={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},B={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},q={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",F=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],L=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],V=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:N,keyword:F,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:L},D={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},A=[D,B,H,J,$.C_BLOCK_COMMENT_MODE,W,K],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:A.concat([{begin:/\(/,end:/\)/,keywords:O,contains:A.concat(["self"]),relevance:0}]),relevance:0},I={className:"function",begin:"("+G+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,relevance:0},{begin:U,returnBegin:!0,contains:[q],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[K,W]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,W,H,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,W,H]}]},H,J,$.C_BLOCK_COMMENT_MODE,B]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(C,I,D,A,[B,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:O,contains:["self",H]},{begin:$.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function qR($){let Z={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},J=c50($),Q=J.keywords;return Q.type=[...Q.type,...Z.type],Q.literal=[...Q.literal,...Z.literal],Q.built_in=[...Q.built_in,...Z.built_in],Q._hints=Z._hints,J.name="Arduino",J.aliases=["ino"],J.supersetOf="cpp",J}function UR($){let Z=$.regex,J={},Q={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[J]}]};Object.assign(J,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},Q]});let X={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},z=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),G={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},H={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,J,X]};X.contains.push(H);let Y={match:/\\"/},K={className:"string",begin:/'/,end:/'/},W={match:/\\'/},B={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,J]},q=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],U=$.SHEBANG({binary:`(${q.join("|")})`,relevance:10}),F={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],L=["true","false"],V={match:/(\/[a-z._-]+)+/},M=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],_=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],D=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:L,built_in:[...M,..._,"set","shopt",...O,...D]},contains:[U,$.SHEBANG(),F,B,z,G,V,H,Y,K,W,J]}}function FR($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",z="<[^<>]+>",G="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",H={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},Y="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},W={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},B={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},q={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",L={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},V=[B,H,J,$.C_BLOCK_COMMENT_MODE,W,K],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:L,contains:V.concat([{begin:/\(/,end:/\)/,keywords:L,contains:V.concat(["self"]),relevance:0}]),relevance:0},_={begin:"("+G+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:L,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:L,relevance:0},{begin:U,returnBegin:!0,contains:[$.inherit(q,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,W,H,{begin:/\(/,end:/\)/,keywords:L,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,W,H]}]},H,J,$.C_BLOCK_COMMENT_MODE,B]};return{name:"C",aliases:["h"],keywords:L,disableAutodetect:!0,illegal:"</",contains:[].concat(M,_,V,[B,{begin:$.IDENT_RE+"::",keywords:L},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:B,strings:K,keywords:L}}}function NR($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),Q="decltype\\(auto\\)",X="[a-zA-Z_]\\w*::",z="<[^<>]+>",G="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",H={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},Y="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",K={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},W={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},B={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(K,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},q={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},U=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",F=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],L=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],V=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:N,keyword:F,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:L},D={className:"function.dispatch",relevance:0,keywords:{_hint:V},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},A=[D,B,H,J,$.C_BLOCK_COMMENT_MODE,W,K],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:A.concat([{begin:/\(/,end:/\)/,keywords:O,contains:A.concat(["self"]),relevance:0}]),relevance:0},I={className:"function",begin:"("+G+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,relevance:0},{begin:U,returnBegin:!0,contains:[q],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[K,W]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,K,W,H,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,K,W,H]}]},H,J,$.C_BLOCK_COMMENT_MODE,B]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(C,I,D,A,[B,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:O,contains:["self",H]},{begin:$.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function VR($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],J=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],Q=["default","false","null","true"],X=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],z=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],G={keyword:X.concat(z),built_in:Z,literal:Q},H=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),Y={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},K={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},W={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},B=$.inherit(W,{illegal:/\n/}),q={className:"subst",begin:/\{/,end:/\}/,keywords:G},U=$.inherit(q,{illegal:/\n/}),F={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,U]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},q]},L=$.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},U]});q.contains=[N,F,W,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,Y,$.C_BLOCK_COMMENT_MODE],U.contains=[L,F,B,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,Y,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let V={variants:[K,N,F,W,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},M={begin:"<",end:">",contains:[{beginKeywords:"in out"},H]},_=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:G,illegal:/::/,contains:[$.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},V,Y,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},H,M,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[H,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[H,M,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+_+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:G,contains:[{beginKeywords:J.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,M],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:G,relevance:0,contains:[V,Y,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},O]}}var d50=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},l50=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],i50=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r50=[...l50,...i50],a50=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),n50=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),o50=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),s50=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function LR($){let Z=$.regex,J=d50($),Q={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},X="and or not only",z=/@-?\w[\w]*(-\w+)*/,G="[a-zA-Z-][a-zA-Z0-9_-]*",H=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[J.BLOCK_COMMENT,Q,J.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+n50.join("|")+")"},{begin:":(:)?("+o50.join("|")+")"}]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+s50.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[J.BLOCK_COMMENT,J.HEXCOLOR,J.IMPORTANT,J.CSS_NUMBER_MODE,...H,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...H,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},J.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:z},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:a50.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...H,J.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+r50.join("|")+")\\b"}]}}function MR($){let Z=$.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:Z.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:Z.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function AR($){let z={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:z,illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"string",variants:[$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[$.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:z,illegal:/["']/}]}]}}function _R($){let Z=$.regex,J=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[$.HASH_COMMENT_MODE,$.QUOTE_STRING_MODE,$.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:Z.concat(J,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function DR($){let Z=$.regex,J={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},Q=$.COMMENT();Q.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let X={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},z={className:"literal",begin:/\bon|off|true|false|yes|no\b/},G={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},H={begin:/\[/,end:/\]/,contains:[Q,z,X,G,J,"self"],relevance:0},Y=/[A-Za-z0-9_-]+/,K=/"(\\"|[^"])*"/,W=/'[^']*'/,B=Z.either(Y,K,W),q=Z.concat(B,"(\\s*\\.\\s*",B,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[Q,{className:"section",begin:/\[+/,end:/\]+/},{begin:q,className:"attr",starts:{end:/$/,contains:[Q,H,z,X,G,J]}}]}}var WZ="[0-9](_*[0-9])*",zW=`\\.(${WZ})`,GW="[0-9a-fA-F](_*[0-9a-fA-F])*",OR={className:"number",variants:[{begin:`(\\b(${WZ})((${zW})|\\.)?|(${zW}))[eE][+-]?(${WZ})[fFdD]?\\b`},{begin:`\\b(${WZ})((${zW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${zW})[fFdD]?\\b`},{begin:`\\b(${WZ})[fFdD]\\b`},{begin:`\\b0[xX]((${GW})\\.?|(${GW})?\\.(${GW}))[pP][+-]?(${WZ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${GW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function PR($,Z,J){if(J===-1)return"";return $.replace(Z,(Q)=>{return PR($,Z,J-1)})}function wR($){let Z=$.regex,J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",Q="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+PR("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),Y={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},K={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},W={className:"params",begin:/\(/,end:/\)/,keywords:Y,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:Y,illegal:/<\/|#/,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[$.BACKSLASH_ESCAPE]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[Z.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[W,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+Q+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:Y,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:Y,relevance:0,contains:[K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,OR,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},OR,K]}}var t50=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],e50=["true","false","null","undefined","NaN","Infinity"],jR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],TR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],CR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$10=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Z10=[].concat(CR,jR,TR);function ER($){let Z=$.regex,J=(g,{after:u})=>{let j="</"+g[0].slice(1);return g.input.indexOf(j,u)!==-1},Q="[A-Za-z$_][0-9A-Za-z$_]*",X={begin:"<>",end:"</>"},z=/<[A-Za-z0-9\\._:-]+\s*\/>/,G={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(g,u)=>{let j=g[0].length+g.index,e=g.input[j];if(e==="<"||e===","){u.ignoreMatch();return}if(e===">"){if(!J(g,{after:j}))u.ignoreMatch()}let t,x=g.input.substring(j);if(t=x.match(/^\s*=/)){u.ignoreMatch();return}if(t=x.match(/^\s+extends\s+/)){if(t.index===0){u.ignoreMatch();return}}}},H={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:t50,literal:e50,built_in:Z10,"variable.language":$10},Y="[0-9](_?[0-9])*",K="\\.([0-9](_?[0-9])*)",W="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",B={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},q={className:"subst",begin:"\\$\\{",end:"\\}",keywords:H,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"xml"}},F={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"graphql"}},L={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,q]},M={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},_=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,N,L,{match:/\$\d+/},B];q.contains=_.concat({begin:/\{/,end:/\}/,keywords:H,contains:["self"].concat(_)});let O=[].concat(M,q.contains),D=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:H,contains:["self"].concat(O)}]),A={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:H,contains:D},C={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},I={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...jR,...TR]}},y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},h={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function k(g){return Z.concat("(?!",g.join("|"),")")}let S={match:Z.concat(/\b/,k([...CR,"super","import"].map((g)=>`${g}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",b={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:H,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:I},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,N,L,M,{match:/\$\d+/},B,I,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},b,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,$.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:H,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:X.begin,end:X.end},{match:z},{begin:G.begin,"on:begin":G.isTrulyOpeningTag,end:G.end}],subLanguage:"xml",contains:[{begin:G.begin,end:G.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},S,h,C,T,{match:/\$[(.]/}]}}function SR($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},J={match:/[{}[\],:]/,className:"punctuation",relevance:0},Q=["true","false","null"],X={scope:"literal",beginKeywords:Q.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:Q},contains:[Z,J,$.QUOTE_STRING_MODE,X,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var BZ="[0-9](_*[0-9])*",HW=`\\.(${BZ})`,YW="[0-9a-fA-F](_*[0-9a-fA-F])*",J10={className:"number",variants:[{begin:`(\\b(${BZ})((${HW})|\\.)?|(${HW}))[eE][+-]?(${BZ})[fFdD]?\\b`},{begin:`\\b(${BZ})((${HW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${HW})[fFdD]?\\b`},{begin:`\\b(${BZ})[fFdD]\\b`},{begin:`\\b0[xX]((${YW})\\.?|(${YW})?\\.(${YW}))[pP][+-]?(${BZ})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${YW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function kR($){let Z={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},J={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},Q={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},X={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},z={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},G={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[z,X]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,z,X]}]};X.contains.push(G);let H={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},Y={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(G,{className:"string"}),"self"]}]},K=J10,W=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),B={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},q=B;return q.variants[1].contains=[B],B.variants[1].contains=[q],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,W,J,Q,H,Y,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:Z,relevance:5,contains:[{begin:$.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[$.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Z,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[B,$.C_LINE_COMMENT_MODE,W],relevance:0},$.C_LINE_COMMENT_MODE,W,H,Y,G,$.C_NUMBER_MODE]},W]},{begin:[/class|interface|trait/,/\s+/,$.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},$.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},H,Y]},G,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
46
|
+
`},K]}}var Q10=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},X10=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],z10=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],G10=[...X10,...z10],H10=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),IR=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),RR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Y10=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),K10=IR.concat(RR).sort().reverse();function yR($){let Z=Q10($),J=K10,Q="and or not only",X="[\\w-]+",z="([\\w-]+|@\\{[\\w-]+\\})",G=[],H=[],Y=function(_){return{className:"string",begin:"~?"+_+".*?"+_}},K=function(_,O,D){return{className:_,begin:O,relevance:D}},W={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:H10.join(" ")},B={begin:"\\(",end:"\\)",contains:H,keywords:W,relevance:0};H.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Y("'"),Y('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,B,K("variable","@@?[\\w-]+",10),K("variable","@\\{[\\w-]+\\}"),K("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let q=H.concat({begin:/\{/,end:/\}/,contains:G}),U={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(H)},F={begin:z+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Y10.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:H}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:W,returnEnd:!0,contains:H,relevance:0}},L={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:q}},V={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:z,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,U,K("keyword","all\\b"),K("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+G10.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,K("selector-tag",z,0),K("selector-id","#"+z),K("selector-class","\\."+z,0),K("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+IR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+RR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:q},{begin:"!important"},Z.FUNCTION_DISPATCH]},M={begin:`[\\w-]+:(:)?(${J.join("|")})`,returnBegin:!0,contains:[V]};return G.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,N,L,M,F,V,U,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:G}}function bR($){let Q={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},X=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[Q],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:$.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:X.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[$.inherit($.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:X}].concat(X)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[Q],relevance:5}])}}function xR($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},J={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},Q={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[Z,J]},X={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},z={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},G={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[Z]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[$.HASH_COMMENT_MODE,Z,J,Q,X,z,G]}}function hR($){let Z=$.regex,J={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},Q={begin:"^[-\\*]{3,}",end:"$"},X={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},z={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},G={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},H=/[A-Za-z][A-Za-z0-9+.-]*/,Y={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Z.concat(/\[.+?\]\(/,H,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},K={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},W={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},B=$.inherit(K,{contains:[]}),q=$.inherit(W,{contains:[]});K.contains.push(q),W.contains.push(B);let U=[J,Y];return[K,W,B,q].forEach((V)=>{V.contains=V.contains.concat(U)}),U=U.concat(K,W),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:U},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:U}]}]},J,z,K,W,{className:"quote",begin:"^>\\s+",contains:U,end:"$"},X,Q,Y,G,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function gR($){let Z={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},J=/[a-zA-Z@][a-zA-Z0-9_]*/,H={"variable.language":["this","super"],$pattern:J,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},Y={$pattern:J,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:H,illegal:"</",contains:[Z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,$.C_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit($.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+Y.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:Y,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function vR($){let Z=$.regex,J=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],Q=/[dualxmsipngr]{0,12}/,X={$pattern:/[\w.]+/,keyword:J.join(" ")},z={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:X},G={begin:/->\{/,end:/\}/},H={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},Y={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[H]},K={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},W=[$.BACKSLASH_ESCAPE,z,Y],B=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],q=(N,L,V="\\1")=>{let M=V==="\\1"?V:Z.concat(V,L);return Z.concat(Z.concat("(?:",N,")"),L,/(?:\\.|[^\\\/])*?/,M,/(?:\\.|[^\\\/])*?/,V,Q)},U=(N,L,V)=>{return Z.concat(Z.concat("(?:",N,")"),L,/(?:\\.|[^\\\/])*?/,V,Q)},F=[Y,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),G,{className:"string",contains:W,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},K,{begin:"(\\/\\/|"+$.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[$.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:q("s|tr|y",Z.either(...B,{capture:!0}))},{begin:q("s|tr|y","\\(","\\)")},{begin:q("s|tr|y","\\[","\\]")},{begin:q("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:U("(?:m|qr)?",/\//,/\//)},{begin:U("m|qr",Z.either(...B,{capture:!0}),/\1/)},{begin:U("m|qr",/\(/,/\)/)},{begin:U("m|qr",/\[/,/\]/)},{begin:U("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,H]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,H,K]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return z.contains=F,G.contains=F,{name:"Perl",aliases:["pl","pm"],keywords:X,contains:F}}function fR($){let Z=$.regex,J=/(?![A-Za-z0-9])(?![$])/,Q=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,J),X=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,J),z=Z.concat(/[A-Z]+/,J),G={scope:"variable",match:"\\$+"+Q},H={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},Y={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},K=$.inherit($.APOS_STRING_MODE,{illegal:null}),W=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(Y)}),B={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(Y),"on:begin":(w,T)=>{T.data._beginMatch=w[1]||w[2]},"on:end":(w,T)=>{if(T.data._beginMatch!==w[1])T.ignoreMatch()}},q=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),U=`[
|
|
47
|
+
]`,F={scope:"string",variants:[W,K,B,q]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},L=["false","null","true"],V=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],M=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:V,literal:((w)=>{let T=[];return w.forEach((R)=>{if(T.push(R),R.toLowerCase()===R)T.push(R.toUpperCase());else T.push(R.toLowerCase())}),T})(L),built_in:M},D=(w)=>{return w.map((T)=>{return T.replace(/\|\d+$/,"")})},A={variants:[{match:[/new/,Z.concat(`[
|
|
48
|
+
]`,"+"),Z.concat("(?!",D(M).join("\\b|"),"\\b)"),X],scope:{1:"keyword",4:"title.class"}}]},C=Z.concat(Q,"\\b(?!\\()"),I={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[X,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),C],scope:{1:"title.class",3:"variable.constant"}},{match:[X,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[X,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},y={scope:"attr",match:Z.concat(Q,Z.lookahead(":"),Z.lookahead(/(?!::)/))},E={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[y,G,I,$.C_BLOCK_COMMENT_MODE,F,N,A]},h={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",D(V).join("\\b|"),"|",D(M).join("\\b|"),"\\b)"),Q,Z.concat(`[
|
|
49
|
+
]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[E]};E.contains.push(h);let k=[y,I,$.C_BLOCK_COMMENT_MODE,F,N,A],S={begin:Z.concat(/#\[\s*\\?/,Z.either(X,z)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:L,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:L,keyword:["new","array"]},contains:["self",...k]},...k,{scope:"meta",variants:[{match:X},{match:z}]}]};return{case_insensitive:!1,keywords:O,contains:[S,$.HASH_COMMENT_MODE,$.COMMENT("//","$"),$.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:$.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},H,{scope:"variable.language",match:/\$this\b/},G,h,I,{match:[/const/,/\s/,Q],scope:{1:"keyword",3:"variable.constant"}},A,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},$.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",S,G,I,$.C_BLOCK_COMMENT_MODE,F,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},$.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[$.inherit($.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},$.UNDERSCORE_TITLE_MODE]},F,N]}}function mR($){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},$.inherit($.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),$.inherit($.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function pR($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function uR($){let Z=$.regex,J=/[\p{XID_Start}_]\p{XID_Continue}*/u,Q=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],H={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:Q,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},Y={className:"meta",begin:/^(>>>|\.\.\.) /},K={className:"subst",begin:/\{/,end:/\}/,keywords:H,illegal:/#/},W={begin:/\{\{/,relevance:0},B={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,Y],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,Y],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,Y,W,K]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,Y,W,K]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[$.BACKSLASH_ESCAPE,W,K]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,W,K]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},q="[0-9](_?[0-9])*",U="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",F=`\\b|${Q.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${F})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${F})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${F})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${F})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${F})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${F})`}]},L={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:H,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},V={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:H,contains:["self",Y,N,B,$.HASH_COMMENT_MODE]}]};return K.contains=[B,N,Y],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:H,illegal:/(<\/|\?)|=>/,contains:[Y,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},B,L,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,J],scope:{1:"keyword",3:"title.function"},contains:[V]},{variants:[{match:[/\bclass/,/\s+/,J,/\s*/,/\(\s*/,J,/\s*\)/]},{match:[/\bclass/,/\s+/,J]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,V,B]}]}}function cR($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function dR($){let Z=$.regex,J=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,Q=Z.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),X=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,z=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:J,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[$.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:Z.lookahead(Z.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:J},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),$.HASH_COMMENT_MODE,{scope:"string",contains:[$.BACKSLASH_ESCAPE],variants:[$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[X,Q]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,Q]},{scope:{1:"punctuation",2:"number"},match:[z,Q]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,Q]}]},{scope:{3:"operator"},match:[J,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:X},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:z},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function lR($){let Z=$.regex,J="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",Q=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),X=Z.concat(Q,/(::\w+)*/),G={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},H={className:"doctag",begin:"@[A-Za-z]+"},Y={begin:"#<",end:">"},K=[$.COMMENT("#","$",{contains:[H]}),$.COMMENT("^=begin","^=end",{contains:[H],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],W={className:"subst",begin:/#\{/,end:/\}/,keywords:G},B={className:"string",contains:[$.BACKSLASH_ESCAPE,W],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:Z.concat(/<<[-~]?'?/,Z.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[$.BACKSLASH_ESCAPE,W]})]}]},q="[1-9](_?[0-9])*|0",U="[0-9](_?[0-9])*",F={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:G}]},A=[B,{variants:[{match:[/class\s+/,X,/\s+<\s+/,X]},{match:[/\b(class|module)\s+/,X]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:G},{match:[/(include|extend)\s+/,X],scope:{2:"title.class"},keywords:G},{relevance:0,match:[X,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:Q,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[B,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},F,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:G},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,W],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(Y,K),relevance:0}].concat(Y,K);W.contains=A,N.contains=A;let C="[>?]>",I="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",y="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",E=[{begin:/^\s*=>/,starts:{end:"$",contains:A}},{className:"meta.prompt",begin:"^("+C+"|"+I+"|"+y+")(?=[ ])",starts:{end:"$",keywords:G,contains:A}}];return K.unshift(Y),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:G,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(E).concat(K).concat(A)}}function iR($){let Z=$.regex,J=/(r#)?/,Q=Z.concat(J,$.UNDERSCORE_IDENT_RE),X=Z.concat(J,$.IDENT_RE),z={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,X,Z.lookahead(/\s*\(/))},G="([ui](8|16|32|64|128|size)|f(32|64))?",H=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],Y=["true","false","Some","None","Ok","Err"],K=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],W=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:$.IDENT_RE+"!?",type:W,keyword:H,literal:Y,built_in:K},illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.COMMENT("/\\*","\\*/",{contains:["self"]}),$.inherit($.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,Q],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,Q],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,Q,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,Q],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,Q],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:K,type:W}},{className:"punctuation",begin:"->"},z]}}var W10=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},B10=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],q10=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],U10=[...B10,...q10],F10=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),N10=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),V10=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),L10=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function rR($){let Z=W10($),J=V10,Q=N10,X="@[a-z-]+",z="and or not only",G="[a-zA-Z-][a-zA-Z0-9_-]*",H={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Z.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+U10.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+Q.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+J.join("|")+")"},H,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+L10.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[Z.BLOCK_COMMENT,H,Z.HEXCOLOR,Z.CSS_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.IMPORTANT,Z.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:F10.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},H,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.HEXCOLOR,Z.CSS_NUMBER_MODE]},Z.FUNCTION_DISPATCH]}}function aR($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function nR($){let Z=$.regex,J=$.COMMENT("--","$"),Q={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},X={begin:/"/,end:/"/,contains:[{match:/""/}]},z=["true","false","unknown"],G=["double precision","large object","with timezone","without timezone"],H=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],Y=["add","asc","collation","desc","final","first","last","view"],K=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],W=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],B=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],q=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],U=W,F=[...K,...Y].filter((D)=>{return!W.includes(D)}),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},L={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},V={match:Z.concat(/\b/,Z.either(...U),/\s*\(/),relevance:0,keywords:{built_in:U}};function M(D){return Z.concat(/\b/,Z.either(...D.map((A)=>{return A.replace(/\s+/,"\\s+")})),/\b/)}let _={scope:"keyword",match:M(q),relevance:0};function O(D,{exceptions:A,when:C}={}){let I=C;return A=A||[],D.map((y)=>{if(y.match(/\|\d+$/)||A.includes(y))return y;else if(I(y))return`${y}|0`;else return y})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(F,{when:(D)=>D.length<3}),literal:z,type:H,built_in:B},contains:[{scope:"type",match:M(G)},_,V,N,Q,X,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,J,L]}}function eR($){if(!$)return null;if(typeof $==="string")return $;return $.source}function JX($){return t5("(?=",$,")")}function t5(...$){return $.map((J)=>eR(J)).join("")}function M10($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function $4(...$){return"("+(M10($).capture?"":"?:")+$.map((Q)=>eR(Q)).join("|")+")"}var XV=($)=>t5(/\b/,$,/\w$/.test($)?/\b/:/\B/),A10=["Protocol","Type"].map(XV),oR=["init","self"].map(XV),_10=["Any","Self"],JV=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],sR=["false","nil","true"],D10=["assignment","associativity","higherThan","left","lowerThan","none","right"],O10=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],tR=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],$y=$4(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Zy=$4($y,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),QV=t5($y,Zy,"*"),Jy=$4(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),WW=$4(Jy,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),U9=t5(Jy,WW,"*"),KW=t5(/[A-Z]/,WW,"*"),P10=["attached","autoclosure",t5(/convention\(/,$4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",t5(/objc\(/,U9,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],w10=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Qy($){let Z={match:/\s+/,relevance:0},J=$.COMMENT("/\\*","\\*/",{contains:["self"]}),Q=[$.C_LINE_COMMENT_MODE,J],X={match:[/\./,$4(...A10,...oR)],className:{2:"keyword"}},z={match:t5(/\./,$4(...JV)),relevance:0},G=JV.filter((n)=>typeof n==="string").concat(["_|0"]),H=JV.filter((n)=>typeof n!=="string").concat(_10).map(XV),Y={variants:[{className:"keyword",match:$4(...H,...oR)}]},K={$pattern:$4(/\b\w+/,/#\w+/),keyword:G.concat(O10),literal:sR},W=[X,z,Y],B={match:t5(/\./,$4(...tR)),relevance:0},q={className:"built_in",match:t5(/\b/,$4(...tR),/(?=\()/)},U=[B,q],F={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:QV},{match:`\\.(\\.|${Zy})+`}]},L=[F,N],V="([0-9]_*)+",M="([0-9a-fA-F]_*)+",_={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:"\\b0x(([0-9a-fA-F]_*)+)(\\.(([0-9a-fA-F]_*)+))?([pP][+-]?(([0-9]_*)+))?\\b"},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(n="")=>({className:"subst",variants:[{match:t5(/\\/,n,/[0\\tnr"']/)},{match:t5(/\\/,n,/u\{[0-9a-fA-F]{1,8}\}/)}]}),D=(n="")=>({className:"subst",match:t5(/\\/,n,/[\t ]*(?:[\r\n]|\r\n)/)}),A=(n="")=>({className:"subst",label:"interpol",begin:t5(/\\/,n,/\(/),end:/\)/}),C=(n="")=>({begin:t5(n,/"""/),end:t5(/"""/,n),contains:[O(n),D(n),A(n)]}),I=(n="")=>({begin:t5(n,/"/),end:t5(/"/,n),contains:[O(n),A(n)]}),y={className:"string",variants:[C(),C("#"),C("##"),C("###"),I(),I("#"),I("##"),I("###")]},E=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],h={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},k=(n)=>{let m=t5(n,/\//),d=t5(/\//,n);return{begin:m,end:d,contains:[...E,{scope:"comment",begin:`#(?!.*${d})`,end:/$/}]}},S={scope:"regexp",variants:[k("###"),k("##"),k("#"),h]},w={match:t5(/`/,U9,/`/)},T={className:"variable",match:/\$\d+/},R={className:"variable",match:`\\$${WW}+`},b=[w,T,R],g={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:w10,contains:[...L,_,y]}]}},u={scope:"keyword",match:t5(/@/,$4(...P10),JX($4(/\(/,/\s+/)))},j={scope:"meta",match:t5(/@/,U9)},e=[g,u,j],t={match:JX(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:t5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,WW,"+")},{className:"type",match:KW,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:t5(/\s+&\s+/,JX(KW)),relevance:0}]},x={begin:/</,end:/>/,keywords:K,contains:[...Q,...W,...e,F,t]};t.contains.push(x);let $0={match:t5(U9,/\s*:/),keywords:"_|0",relevance:0},M0={begin:/\(/,end:/\)/,relevance:0,keywords:K,contains:["self",$0,...Q,S,...W,...U,...L,_,y,...b,...e,t]},l={begin:/</,end:/>/,keywords:"repeat each",contains:[...Q,t]},H0={begin:$4(JX(t5(U9,/\s*:/)),JX(t5(U9,/\s+/,U9,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:U9}]},U0={begin:/\(/,end:/\)/,keywords:K,contains:[H0,...Q,...W,...L,_,y,...e,t,M0],endsParent:!0,illegal:/["']/},X0={match:[/(func|macro)/,/\s+/,$4(w.match,U9,QV)],className:{1:"keyword",3:"title.function"},contains:[l,U0,Z],illegal:[/\[/,/%/]},Y0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[l,U0,Z],illegal:/\[|%/},V0={match:[/operator/,/\s+/,QV],className:{1:"keyword",3:"title"}},i={begin:[/precedencegroup/,/\s+/,KW],className:{1:"keyword",3:"title"},contains:[t],keywords:[...D10,...sR],end:/}/},Z0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},J0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Q0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,U9,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:K,contains:[l,...W,{begin:/:/,end:/\{/,keywords:K,contains:[{scope:"title.class.inherited",match:KW},...W],relevance:0}]};for(let n of y.variants){let m=n.contains.find((f)=>f.label==="interpol");m.keywords=K;let d=[...W,...U,...L,_,y,...b];m.contains=[...d,{begin:/\(/,end:/\)/,contains:["self",...d]}]}return{name:"Swift",keywords:K,contains:[...Q,X0,Y0,Z0,J0,Q0,V0,i,{beginKeywords:"import",end:/$/,contains:[...Q],relevance:0},S,...W,...U,...L,_,y,...b,...e,t,M0]}}var Xy=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zy=["true","false","null","undefined","NaN","Infinity"],Gy=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Hy=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yy=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ky=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wy=[].concat(Yy,Gy,Hy);function j10($){let Z=$.regex,J=(g,{after:u})=>{let j="</"+g[0].slice(1);return g.input.indexOf(j,u)!==-1},Q="[A-Za-z$_][0-9A-Za-z$_]*",X={begin:"<>",end:"</>"},z=/<[A-Za-z0-9\\._:-]+\s*\/>/,G={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(g,u)=>{let j=g[0].length+g.index,e=g.input[j];if(e==="<"||e===","){u.ignoreMatch();return}if(e===">"){if(!J(g,{after:j}))u.ignoreMatch()}let t,x=g.input.substring(j);if(t=x.match(/^\s*=/)){u.ignoreMatch();return}if(t=x.match(/^\s+extends\s+/)){if(t.index===0){u.ignoreMatch();return}}}},H={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Xy,literal:zy,built_in:Wy,"variable.language":Ky},Y="[0-9](_?[0-9])*",K="\\.([0-9](_?[0-9])*)",W="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",B={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},q={className:"subst",begin:"\\$\\{",end:"\\}",keywords:H,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"xml"}},F={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,q],subLanguage:"graphql"}},L={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,q]},M={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},_=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,N,L,{match:/\$\d+/},B];q.contains=_.concat({begin:/\{/,end:/\}/,keywords:H,contains:["self"].concat(_)});let O=[].concat(M,q.contains),D=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:H,contains:["self"].concat(O)}]),A={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:H,contains:D},C={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},I={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Gy,...Hy]}},y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},E={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},h={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function k(g){return Z.concat("(?!",g.join("|"),")")}let S={match:Z.concat(/\b/,k([...Yy,"super","import"].map((g)=>`${g}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},T={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",b={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:H,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:I},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,U,F,N,L,M,{match:/\$\d+/},B,I,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},b,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,$.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:H,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:X.begin,end:X.end},{match:z},{begin:G.begin,"on:begin":G.isTrulyOpeningTag,end:G.end}],subLanguage:"xml",contains:[{begin:G.begin,end:G.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},S,h,C,T,{match:/\$[(.]/}]}}function By($){let Z=$.regex,J=j10($),Q="[A-Za-z$_][0-9A-Za-z$_]*",X=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],z={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},G={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:X},contains:[J.exports.CLASS_REFERENCE]},H={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},Y=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],K={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Xy.concat(Y),literal:zy,built_in:Wy.concat(X),"variable.language":Ky},W={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},B=(N,L,V)=>{let M=N.contains.findIndex((_)=>_.label===L);if(M===-1)throw Error("can not find mode to replace");N.contains.splice(M,1,V)};Object.assign(J.keywords,K),J.exports.PARAMS_CONTAINS.push(W);let q=J.contains.find((N)=>N.scope==="attr"),U=Object.assign({},q,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});J.exports.PARAMS_CONTAINS.push([J.exports.CLASS_REFERENCE,q,U]),J.contains=J.contains.concat([W,z,G,U]),B(J,"shebang",$.SHEBANG()),B(J,"use_strict",H);let F=J.contains.find((N)=>N.label==="func.def");return F.relevance=0,Object.assign(J,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),J}function qy($){let Z=$.regex,J={className:"string",begin:/"(""|[^/n])"C\b/},Q={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},X=/\d{1,2}\/\d{1,2}\/\d{4}/,z=/\d{4}-\d{1,2}-\d{1,2}/,G=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,H=/\d{1,2}(:\d{1,2}){1,2}/,Y={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(z,X),/ *#/)},{begin:Z.concat(/# */,H,/ *#/)},{begin:Z.concat(/# */,G,/ *#/)},{begin:Z.concat(/# */,Z.either(z,X),/ +/,Z.either(G,H),/ *#/)}]},K={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},W={className:"label",begin:/^\w+:/},B=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),q=$.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[J,Q,Y,K,W,B,q,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[q]}]}}function Uy($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let J=$.COMMENT(/;;/,/$/),Q=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],X={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},z={className:"variable",begin:/\$[\w_]+/},G={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},H={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},Y={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},K={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:Q},contains:[J,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},z,G,X,$.QUOTE_STRING_MODE,Y,K,H]}}function Fy($){let Z=$.regex,J=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),Q=/[\p{L}0-9._:-]+/u,X={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},z={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},G=$.inherit(z,{begin:/\(/,end:/\)/}),H=$.inherit($.APOS_STRING_MODE,{className:"string"}),Y=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),K={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:Q,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[X]},{begin:/'/,end:/'/,contains:[X]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[z,Y,H,G,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[z,G,Y,H]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},X,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[Y]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[K],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[K],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Z.concat(/</,Z.lookahead(Z.concat(J,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:J,relevance:0,starts:K}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(J,/>/))),contains:[{className:"name",begin:J,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Ny($){let Q={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},X={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},z={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},G={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,X]},H=$.inherit(G,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),Y="[0-9]{4}(-[0-9][0-9]){0,2}",K="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",W="(\\.[0-9]*)?",B="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",q={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},U={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},F={begin:/\{/,end:/\}/,contains:[U],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[U],illegal:"\\n",relevance:0},L=[Q,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+$.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+$.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},$.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},q,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},F,N,z,G],V=[...L];return V.pop(),V.push(H),U.contains=V,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:L}}var zV={arduino:qR,bash:UR,c:FR,cpp:NR,csharp:VR,css:LR,diff:MR,go:AR,graphql:_R,ini:DR,java:wR,javascript:ER,json:SR,kotlin:kR,less:yR,lua:bR,makefile:xR,markdown:hR,objectivec:gR,perl:vR,php:fR,"php-template":mR,plaintext:pR,python:uR,"python-repl":cR,r:dR,ruby:lR,rust:iR,scss:rR,shell:aR,sql:nR,swift:Qy,typescript:By,vbnet:qy,wasm:Uy,xml:Fy,yaml:Ny};var fy=P(vy(),1);var my=fy.default;var py={},N80="hljs-";function qV($){let Z=my.newInstance();if($)z($);return{highlight:J,highlightAuto:Q,listLanguages:X,register:z,registerAlias:G,registered:H};function J(Y,K,W){h5(typeof Y==="string","expected `string` as `name`"),h5(typeof K==="string","expected `string` as `value`");let B=W||py,q=typeof B.prefix==="string"?B.prefix:N80;if(!Z.getLanguage(Y))throw Error("Unknown language: `"+Y+"` is not registered");Z.configure({__emitter:uy,classPrefix:q});let U=Z.highlight(K,{ignoreIllegals:!0,language:Y});if(U.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:U.errorRaised});let F=U._emitter.root,N=F.data;return N.language=U.language,N.relevance=U.relevance,F}function Q(Y,K){h5(typeof Y==="string","expected `string` as `value`");let B=(K||py).subset||X(),q=-1,U=0,F;while(++q<B.length){let N=B[q];if(!Z.getLanguage(N))continue;let L=J(N,Y,K);if(L.data&&L.data.relevance!==void 0&&L.data.relevance>U)U=L.data.relevance,F=L}return F||{type:"root",children:[],data:{language:void 0,relevance:U}}}function X(){return Z.listLanguages()}function z(Y,K){if(typeof Y==="string")h5(K!==void 0,"expected `grammar`"),Z.registerLanguage(Y,K);else{let W;for(W in Y)if(Object.hasOwn(Y,W))Z.registerLanguage(W,Y[W])}}function G(Y,K){if(typeof Y==="string")h5(K!==void 0),Z.registerAliases(typeof K==="string"?K:[...K],{languageName:Y});else{let W;for(W in Y)if(Object.hasOwn(Y,W)){let B=Y[W];Z.registerAliases(typeof B==="string"?B:[...B],{languageName:W})}}}function H(Y){return Boolean(Z.getLanguage(Y))}}class uy{constructor($){this.options=$,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText($){if($==="")return;let Z=this.stack[this.stack.length-1],J=Z.children[Z.children.length-1];if(J&&J.type==="text")J.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let J=this.stack[this.stack.length-1],Q=$.root.children;if(Z)J.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:Q});else J.children.push(...Q)}openNode($){let Z=this,J=$.split(".").map(function(z,G){return G?z+"_".repeat(G):Z.options.classPrefix+z}),Q=this.stack[this.stack.length-1],X={type:"element",tagName:"span",properties:{className:J},children:[]};Q.children.push(X),this.stack.push(X)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var V80={};function FW($){let Z=$||V80,J=Z.aliases,Q=Z.detect||!1,X=Z.languages||zV,z=Z.plainText,G=Z.prefix,H=Z.subset,Y="hljs",K=qV(X);if(J)K.registerAlias(J);if(G){let W=G.indexOf("-");Y=W===-1?G:G.slice(0,W)}return function(W,B){b9(W,"element",function(q,U,F){if(q.tagName!=="code"||!F||F.type!=="element"||F.tagName!=="pre")return;let N=L80(q);if(N===!1||!N&&!Q||N&&z&&z.includes(N))return;if(!Array.isArray(q.properties.className))q.properties.className=[];if(!q.properties.className.includes(Y))q.properties.className.unshift(Y);let L=ZV(q,{whitespace:"pre"}),V;try{V=N?K.highlight(N,L,{prefix:G}):K.highlightAuto(L,{prefix:G,subset:H})}catch(M){let _=M;if(N&&/Unknown language/.test(_.message)){B.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[F,q],cause:_,place:q.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw _}if(!N&&V.data&&V.data.language)q.properties.className.push("language-"+V.data.language);if(V.children.length>0)q.children=V.children})}}function L80($){let Z=$.properties.className,J=-1;if(!Array.isArray(Z))return;let Q;while(++J<Z.length){let X=String(Z[J]);if(X==="no-highlight"||X==="nohighlight")return!1;if(!Q&&X.slice(0,5)==="lang-")Q=X.slice(5);if(!Q&&X.slice(0,9)==="language-")Q=X.slice(9)}return Q}function UV($,Z){let J=String($);if(typeof Z!=="string")throw TypeError("Expected character");let Q=0,X=J.indexOf(Z);while(X!==-1)Q++,X=J.indexOf(Z,X+Z.length);return Q}function FV($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function NV($,Z,J){let X=q9((J||{}).ignore||[]),z=M80(Z),G=-1;while(++G<z.length)eQ($,"text",H);function H(K,W){let B=-1,q;while(++B<W.length){let U=W[B],F=q?q.children:void 0;if(X(U,F?F.indexOf(U):void 0,q))return;q=U}if(q)return Y(K,W)}function Y(K,W){let B=W[W.length-1],q=z[G][0],U=z[G][1],F=0,L=B.children.indexOf(K),V=!1,M=[];q.lastIndex=0;let _=q.exec(K.value);while(_){let O=_.index,D={index:_.index,input:_.input,stack:[...W,K]},A=U(..._,D);if(typeof A==="string")A=A.length>0?{type:"text",value:A}:void 0;if(A===!1)q.lastIndex=O+1;else{if(F!==O)M.push({type:"text",value:K.value.slice(F,O)});if(Array.isArray(A))M.push(...A);else if(A)M.push(A);F=O+_[0].length,V=!0}if(!q.global)break;_=q.exec(K.value)}if(V){if(F<K.value.length)M.push({type:"text",value:K.value.slice(F)});B.children.splice(L,1,...M)}else M=[K];return L+M.length}}function M80($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let J=!$[0]||Array.isArray($[0])?$:[$],Q=-1;while(++Q<J.length){let X=J[Q];Z.push([A80(X[0]),_80(X[1])])}return Z}function A80($){return typeof $==="string"?new RegExp(FV($),"g"):$}function _80($){return typeof $==="function"?$:function(){return $}}var VV="phrasing",LV=["autolink","link","image","label"];function AV(){return{transforms:[T80],enter:{literalAutolink:D80,literalAutolinkEmail:MV,literalAutolinkHttp:MV,literalAutolinkWww:MV},exit:{literalAutolink:j80,literalAutolinkEmail:w80,literalAutolinkHttp:O80,literalAutolinkWww:P80}}}function _V(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:VV,notInConstruct:LV},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:VV,notInConstruct:LV},{character:":",before:"[ps]",after:"\\/",inConstruct:VV,notInConstruct:LV}]}}function D80($){this.enter({type:"link",title:null,url:"",children:[]},$)}function MV($){this.config.enter.autolinkProtocol.call(this,$)}function O80($){this.config.exit.autolinkProtocol.call(this,$)}function P80($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];h5(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function w80($){this.config.exit.autolinkEmail.call(this,$)}function j80($){this.exit($)}function T80($){NV($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,C80],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,E80]],{ignore:["link","linkReference"]})}function C80($,Z,J,Q,X){let z="";if(!cy(X))return!1;if(/^w/i.test(Z))J=Z+J,Z="",z="http://";if(!S80(J))return!1;let G=k80(J+Q);if(!G[0])return!1;let H={type:"link",title:null,url:z+Z+G[0],children:[{type:"text",value:Z+G[0]}]};if(G[1])return[H,{type:"text",value:G[1]}];return H}function E80($,Z,J,Q){if(!cy(Q,!0)||/[-\d_]$/.test(J))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+J,children:[{type:"text",value:Z+"@"+J}]}}function S80($){let Z=$.split(".");if(Z.length<2||Z[Z.length-1]&&(/_/.test(Z[Z.length-1])||!/[a-zA-Z\d]/.test(Z[Z.length-1]))||Z[Z.length-2]&&(/_/.test(Z[Z.length-2])||!/[a-zA-Z\d]/.test(Z[Z.length-2])))return!1;return!0}function k80($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let J=Z[0],Q=J.indexOf(")"),X=UV($,"("),z=UV($,")");while(Q!==-1&&X>z)$+=J.slice(0,Q+1),J=J.slice(Q+1),Q=J.indexOf(")"),z++;return[$,J]}function cy($,Z){let J=$.input.charCodeAt($.index-1);return($.index===0||W9(J)||Y7(J))&&(!Z||J!==47)}dy.peek=f80;function I80(){this.buffer()}function R80($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function y80(){this.buffer()}function b80($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function x80($){let Z=this.resume(),J=this.stack[this.stack.length-1];h5(J.type==="footnoteReference"),J.identifier=f8(this.sliceSerialize($)).toLowerCase(),J.label=Z}function h80($){this.exit($)}function g80($){let Z=this.resume(),J=this.stack[this.stack.length-1];h5(J.type==="footnoteDefinition"),J.identifier=f8(this.sliceSerialize($)).toLowerCase(),J.label=Z}function v80($){this.exit($)}function f80(){return"["}function dy($,Z,J,Q){let X=J.createTracker(Q),z=X.move("[^"),G=J.enter("footnoteReference"),H=J.enter("reference");return z+=X.move(J.safe(J.associationId($),{after:"]",before:z})),H(),G(),z+=X.move("]"),z}function DV(){return{enter:{gfmFootnoteCallString:I80,gfmFootnoteCall:R80,gfmFootnoteDefinitionLabelString:y80,gfmFootnoteDefinition:b80},exit:{gfmFootnoteCallString:x80,gfmFootnoteCall:h80,gfmFootnoteDefinitionLabelString:g80,gfmFootnoteDefinition:v80}}}function OV($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:J,footnoteReference:dy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function J(Q,X,z,G){let H=z.createTracker(G),Y=H.move("[^"),K=z.enter("footnoteDefinition"),W=z.enter("label");if(Y+=H.move(z.safe(z.associationId(Q),{before:Y,after:"]"})),W(),Y+=H.move("]:"),Q.children&&Q.children.length>0)H.shift(4),Y+=H.move((Z?`
|
|
50
|
+
`:" ")+z.indentLines(z.containerFlow(Q,H.current()),Z?ly:m80));return K(),Y}}function m80($,Z,J){return Z===0?$:ly($,Z,J)}function ly($,Z,J){return(J?"":" ")+$}var p80=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];iy.peek=d80;function PV(){return{canContainEols:["delete"],enter:{strikethrough:u80},exit:{strikethrough:c80}}}function wV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:p80}],handlers:{delete:iy}}}function u80($){this.enter({type:"delete",children:[]},$)}function c80($){this.exit($)}function iy($,Z,J,Q){let X=J.createTracker(Q),z=J.enter("strikethrough"),G=X.move("~~");return G+=J.containerPhrasing($,{...X.current(),before:G,after:"~"}),G+=X.move("~~"),z(),G}function d80(){return"~"}function l80($){return $.length}function ay($,Z){let J=Z||{},Q=(J.align||[]).concat(),X=J.stringLength||l80,z=[],G=[],H=[],Y=[],K=0,W=-1;while(++W<$.length){let N=[],L=[],V=-1;if($[W].length>K)K=$[W].length;while(++V<$[W].length){let M=i80($[W][V]);if(J.alignDelimiters!==!1){let _=X(M);if(L[V]=_,Y[V]===void 0||_>Y[V])Y[V]=_}N.push(M)}G[W]=N,H[W]=L}let B=-1;if(typeof Q==="object"&&"length"in Q)while(++B<K)z[B]=ry(Q[B]);else{let N=ry(Q);while(++B<K)z[B]=N}B=-1;let q=[],U=[];while(++B<K){let N=z[B],L="",V="";if(N===99)L=":",V=":";else if(N===108)L=":";else if(N===114)V=":";let M=J.alignDelimiters===!1?1:Math.max(1,Y[B]-L.length-V.length),_=L+"-".repeat(M)+V;if(J.alignDelimiters!==!1){if(M=L.length+M+V.length,M>Y[B])Y[B]=M;U[B]=M}q[B]=_}G.splice(1,0,q),H.splice(1,0,U),W=-1;let F=[];while(++W<G.length){let N=G[W],L=H[W];B=-1;let V=[];while(++B<K){let M=N[B]||"",_="",O="";if(J.alignDelimiters!==!1){let D=Y[B]-(L[B]||0),A=z[B];if(A===114)_=" ".repeat(D);else if(A===99)if(D%2)_=" ".repeat(D/2+0.5),O=" ".repeat(D/2-0.5);else _=" ".repeat(D/2),O=_;else O=" ".repeat(D)}if(J.delimiterStart!==!1&&!B)V.push("|");if(J.padding!==!1&&!(J.alignDelimiters===!1&&M==="")&&(J.delimiterStart!==!1||B))V.push(" ");if(J.alignDelimiters!==!1)V.push(_);if(V.push(M),J.alignDelimiters!==!1)V.push(O);if(J.padding!==!1)V.push(" ");if(J.delimiterEnd!==!1||B!==K-1)V.push("|")}F.push(J.delimiterEnd===!1?V.join("").replace(/ +$/,""):V.join(""))}return F.join(`
|
|
51
|
+
`)}function i80($){return $===null||$===void 0?"":String($)}function ry($){let Z=typeof $==="string"?$.codePointAt(0):0;return Z===67||Z===99?99:Z===76||Z===108?108:Z===82||Z===114?114:0}function ny($,Z,J,Q){let X=J.enter("blockquote"),z=J.createTracker(Q);z.move("> "),z.shift(2);let G=J.indentLines(J.containerFlow($,z.current()),r80);return X(),G}function r80($,Z,J){return">"+(J?"":" ")+$}function sy($,Z){return oy($,Z.inConstruct,!0)&&!oy($,Z.notInConstruct,!1)}function oy($,Z,J){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return J;let Q=-1;while(++Q<Z.length)if($.includes(Z[Q]))return!0;return!1}function jV($,Z,J,Q){let X=-1;while(++X<J.unsafe.length)if(J.unsafe[X].character===`
|
|
52
|
+
`&&sy(J.stack,J.unsafe[X]))return/[ \t]/.test(Q.before)?"":" ";return"\\\n"}function ty($,Z){let J=String($),Q=J.indexOf(Z),X=Q,z=0,G=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(Q!==-1){if(Q===X){if(++z>G)G=z}else z=1;X=Q+Z.length,Q=J.indexOf(Z,X)}return G}function ey($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function $b($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function Zb($,Z,J,Q){let X=$b(J),z=$.value||"",G=X==="`"?"GraveAccent":"Tilde";if(ey($,J)){let B=J.enter("codeIndented"),q=J.indentLines(z,a80);return B(),q}let H=J.createTracker(Q),Y=X.repeat(Math.max(ty(z,X)+1,3)),K=J.enter("codeFenced"),W=H.move(Y);if($.lang){let B=J.enter(`codeFencedLang${G}`);W+=H.move(J.safe($.lang,{before:W,after:" ",encode:["`"],...H.current()})),B()}if($.lang&&$.meta){let B=J.enter(`codeFencedMeta${G}`);W+=H.move(" "),W+=H.move(J.safe($.meta,{before:W,after:`
|
|
53
|
+
`,encode:["`"],...H.current()})),B()}if(W+=H.move(`
|
|
54
|
+
`),z)W+=H.move(z+`
|
|
55
|
+
`);return W+=H.move(Y),K(),W}function a80($,Z,J){return(J?"":" ")+$}function FZ($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function Jb($,Z,J,Q){let X=FZ(J),z=X==='"'?"Quote":"Apostrophe",G=J.enter("definition"),H=J.enter("label"),Y=J.createTracker(Q),K=Y.move("[");if(K+=Y.move(J.safe(J.associationId($),{before:K,after:"]",...Y.current()})),K+=Y.move("]: "),H(),!$.url||/[\0- \u007F]/.test($.url))H=J.enter("destinationLiteral"),K+=Y.move("<"),K+=Y.move(J.safe($.url,{before:K,after:">",...Y.current()})),K+=Y.move(">");else H=J.enter("destinationRaw"),K+=Y.move(J.safe($.url,{before:K,after:$.title?" ":`
|
|
56
|
+
`,...Y.current()}));if(H(),$.title)H=J.enter(`title${z}`),K+=Y.move(" "+X),K+=Y.move(J.safe($.title,{before:K,after:X,...Y.current()})),K+=Y.move(X),H();return G(),K}function Qb($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function c6($){return"&#x"+$.toString(16).toUpperCase()+";"}function NZ($,Z,J){let Q=y9($),X=y9(Z);if(Q===void 0)return X===void 0?J==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:X===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(Q===1)return X===void 0?{inside:!1,outside:!1}:X===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return X===void 0?{inside:!1,outside:!1}:X===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}TV.peek=n80;function TV($,Z,J,Q){let X=Qb(J),z=J.enter("emphasis"),G=J.createTracker(Q),H=G.move(X),Y=G.move(J.containerPhrasing($,{after:X,before:H,...G.current()})),K=Y.charCodeAt(0),W=NZ(Q.before.charCodeAt(Q.before.length-1),K,X);if(W.inside)Y=c6(K)+Y.slice(1);let B=Y.charCodeAt(Y.length-1),q=NZ(Q.after.charCodeAt(0),B,X);if(q.inside)Y=Y.slice(0,-1)+c6(B);let U=G.move(X);return z(),J.attentionEncodeSurroundingInfo={after:q.outside,before:W.outside},H+Y+U}function n80($,Z,J){return J.options.emphasis||"*"}function Xb($,Z){let J=!1;return b9($,function(Q){if("value"in Q&&/\r?\n|\r/.test(Q.value)||Q.type==="break")return J=!0,U7}),Boolean((!$.depth||$.depth<3)&&G7($)&&(Z.options.setext||J))}function zb($,Z,J,Q){let X=Math.max(Math.min(6,$.depth||1),1),z=J.createTracker(Q);if(Xb($,J)){let W=J.enter("headingSetext"),B=J.enter("phrasing"),q=J.containerPhrasing($,{...z.current(),before:`
|
|
57
|
+
`,after:`
|
|
58
|
+
`});return B(),W(),q+`
|
|
59
|
+
`+(X===1?"=":"-").repeat(q.length-(Math.max(q.lastIndexOf("\r"),q.lastIndexOf(`
|
|
60
|
+
`))+1))}let G="#".repeat(X),H=J.enter("headingAtx"),Y=J.enter("phrasing");z.move(G+" ");let K=J.containerPhrasing($,{before:"# ",after:`
|
|
61
|
+
`,...z.current()});if(/^[\t ]/.test(K))K=c6(K.charCodeAt(0))+K.slice(1);if(K=K?G+" "+K:G,J.options.closeAtx)K+=" "+G;return Y(),H(),K}CV.peek=o80;function CV($){return $.value||""}function o80(){return"<"}EV.peek=s80;function EV($,Z,J,Q){let X=FZ(J),z=X==='"'?"Quote":"Apostrophe",G=J.enter("image"),H=J.enter("label"),Y=J.createTracker(Q),K=Y.move("![");if(K+=Y.move(J.safe($.alt,{before:K,after:"]",...Y.current()})),K+=Y.move("]("),H(),!$.url&&$.title||/[\0- \u007F]/.test($.url))H=J.enter("destinationLiteral"),K+=Y.move("<"),K+=Y.move(J.safe($.url,{before:K,after:">",...Y.current()})),K+=Y.move(">");else H=J.enter("destinationRaw"),K+=Y.move(J.safe($.url,{before:K,after:$.title?" ":")",...Y.current()}));if(H(),$.title)H=J.enter(`title${z}`),K+=Y.move(" "+X),K+=Y.move(J.safe($.title,{before:K,after:X,...Y.current()})),K+=Y.move(X),H();return K+=Y.move(")"),G(),K}function s80(){return"!"}SV.peek=t80;function SV($,Z,J,Q){let X=$.referenceType,z=J.enter("imageReference"),G=J.enter("label"),H=J.createTracker(Q),Y=H.move("!["),K=J.safe($.alt,{before:Y,after:"]",...H.current()});Y+=H.move(K+"]["),G();let W=J.stack;J.stack=[],G=J.enter("reference");let B=J.safe(J.associationId($),{before:Y,after:"]",...H.current()});if(G(),J.stack=W,z(),X==="full"||!K||K!==B)Y+=H.move(B+"]");else if(X==="shortcut")Y=Y.slice(0,-1);else Y+=H.move("]");return Y}function t80(){return"!"}kV.peek=e80;function kV($,Z,J){let Q=$.value||"",X="`",z=-1;while(new RegExp("(^|[^`])"+X+"([^`]|$)").test(Q))X+="`";if(/[^ \r\n]/.test(Q)&&(/^[ \r\n]/.test(Q)&&/[ \r\n]$/.test(Q)||/^`|`$/.test(Q)))Q=" "+Q+" ";while(++z<J.unsafe.length){let G=J.unsafe[z],H=J.compilePattern(G),Y;if(!G.atBreak)continue;while(Y=H.exec(Q)){let K=Y.index;if(Q.charCodeAt(K)===10&&Q.charCodeAt(K-1)===13)K--;Q=Q.slice(0,K)+" "+Q.slice(Y.index+1)}}return X+Q+X}function e80(){return"`"}function IV($,Z){let J=G7($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(J===$.url||"mailto:"+J===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}RV.peek=$40;function RV($,Z,J,Q){let X=FZ(J),z=X==='"'?"Quote":"Apostrophe",G=J.createTracker(Q),H,Y;if(IV($,J)){let W=J.stack;J.stack=[],H=J.enter("autolink");let B=G.move("<");return B+=G.move(J.containerPhrasing($,{before:B,after:">",...G.current()})),B+=G.move(">"),H(),J.stack=W,B}H=J.enter("link"),Y=J.enter("label");let K=G.move("[");if(K+=G.move(J.containerPhrasing($,{before:K,after:"](",...G.current()})),K+=G.move("]("),Y(),!$.url&&$.title||/[\0- \u007F]/.test($.url))Y=J.enter("destinationLiteral"),K+=G.move("<"),K+=G.move(J.safe($.url,{before:K,after:">",...G.current()})),K+=G.move(">");else Y=J.enter("destinationRaw"),K+=G.move(J.safe($.url,{before:K,after:$.title?" ":")",...G.current()}));if(Y(),$.title)Y=J.enter(`title${z}`),K+=G.move(" "+X),K+=G.move(J.safe($.title,{before:K,after:X,...G.current()})),K+=G.move(X),Y();return K+=G.move(")"),H(),K}function $40($,Z,J){return IV($,J)?"<":"["}yV.peek=Z40;function yV($,Z,J,Q){let X=$.referenceType,z=J.enter("linkReference"),G=J.enter("label"),H=J.createTracker(Q),Y=H.move("["),K=J.containerPhrasing($,{before:Y,after:"]",...H.current()});Y+=H.move(K+"]["),G();let W=J.stack;J.stack=[],G=J.enter("reference");let B=J.safe(J.associationId($),{before:Y,after:"]",...H.current()});if(G(),J.stack=W,z(),X==="full"||!K||K!==B)Y+=H.move(B+"]");else if(X==="shortcut")Y=Y.slice(0,-1);else Y+=H.move("]");return Y}function Z40(){return"["}function VZ($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function Gb($){let Z=VZ($),J=$.options.bulletOther;if(!J)return Z==="*"?"-":"*";if(J!=="*"&&J!=="+"&&J!=="-")throw Error("Cannot serialize items with `"+J+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(J===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+J+"`) to be different");return J}function Hb($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function NW($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function Yb($,Z,J,Q){let X=J.enter("list"),z=J.bulletCurrent,G=$.ordered?Hb(J):VZ(J),H=$.ordered?G==="."?")":".":Gb(J),Y=Z&&J.bulletLastUsed?G===J.bulletLastUsed:!1;if(!$.ordered){let W=$.children?$.children[0]:void 0;if((G==="*"||G==="-")&&W&&(!W.children||!W.children[0])&&J.stack[J.stack.length-1]==="list"&&J.stack[J.stack.length-2]==="listItem"&&J.stack[J.stack.length-3]==="list"&&J.stack[J.stack.length-4]==="listItem"&&J.indexStack[J.indexStack.length-1]===0&&J.indexStack[J.indexStack.length-2]===0&&J.indexStack[J.indexStack.length-3]===0)Y=!0;if(NW(J)===G&&W){let B=-1;while(++B<$.children.length){let q=$.children[B];if(q&&q.type==="listItem"&&q.children&&q.children[0]&&q.children[0].type==="thematicBreak"){Y=!0;break}}}}if(Y)G=H;J.bulletCurrent=G;let K=J.containerFlow($,Q);return J.bulletLastUsed=G,J.bulletCurrent=z,X(),K}function Kb($){let Z=$.options.listItemIndent||"one";if(Z!=="tab"&&Z!=="one"&&Z!=="mixed")throw Error("Cannot serialize items with `"+Z+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return Z}function Wb($,Z,J,Q){let X=Kb(J),z=J.bulletCurrent||VZ(J);if(Z&&Z.type==="list"&&Z.ordered)z=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(J.options.incrementListMarker===!1?0:Z.children.indexOf($))+z;let G=z.length+1;if(X==="tab"||X==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))G=Math.ceil(G/4)*4;let H=J.createTracker(Q);H.move(z+" ".repeat(G-z.length)),H.shift(G);let Y=J.enter("listItem"),K=J.indentLines(J.containerFlow($,H.current()),W);return Y(),K;function W(B,q,U){if(q)return(U?"":" ".repeat(G))+B;return(U?z:z+" ".repeat(G-z.length))+B}}function Bb($,Z,J,Q){let X=J.enter("paragraph"),z=J.enter("phrasing"),G=J.containerPhrasing($,Q);return z(),X(),G}var bV=q9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function qb($,Z,J,Q){return($.children.some(function(G){return bV(G)})?J.containerPhrasing:J.containerFlow).call(J,$,Q)}function Ub($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}xV.peek=J40;function xV($,Z,J,Q){let X=Ub(J),z=J.enter("strong"),G=J.createTracker(Q),H=G.move(X+X),Y=G.move(J.containerPhrasing($,{after:X,before:H,...G.current()})),K=Y.charCodeAt(0),W=NZ(Q.before.charCodeAt(Q.before.length-1),K,X);if(W.inside)Y=c6(K)+Y.slice(1);let B=Y.charCodeAt(Y.length-1),q=NZ(Q.after.charCodeAt(0),B,X);if(q.inside)Y=Y.slice(0,-1)+c6(B);let U=G.move(X+X);return z(),J.attentionEncodeSurroundingInfo={after:q.outside,before:W.outside},H+Y+U}function J40($,Z,J){return J.options.strong||"*"}function Fb($,Z,J,Q){return J.safe($.value,Q)}function Nb($){let Z=$.options.ruleRepetition||3;if(Z<3)throw Error("Cannot serialize rules with repetition `"+Z+"` for `options.ruleRepetition`, expected `3` or more");return Z}function Vb($,Z,J){let Q=(NW(J)+(J.options.ruleSpaces?" ":"")).repeat(Nb(J));return J.options.ruleSpaces?Q.slice(0,-1):Q}var zX={blockquote:ny,break:jV,code:Zb,definition:Jb,emphasis:TV,hardBreak:jV,heading:zb,html:CV,image:EV,imageReference:SV,inlineCode:kV,link:RV,linkReference:yV,list:Yb,listItem:Wb,paragraph:Bb,root:qb,strong:xV,text:Fb,thematicBreak:Vb};function gV(){return{enter:{table:Q40,tableData:Lb,tableHeader:Lb,tableRow:z40},exit:{codeText:G40,table:X40,tableData:hV,tableHeader:hV,tableRow:hV}}}function Q40($){let Z=$._align;h5(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(J){return J==="none"?null:J}),children:[]},$),this.data.inTable=!0}function X40($){this.exit($),this.data.inTable=void 0}function z40($){this.enter({type:"tableRow",children:[]},$)}function hV($){this.exit($)}function Lb($){this.enter({type:"tableCell",children:[]},$)}function G40($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,H40);let J=this.stack[this.stack.length-1];h5(J.type==="inlineCode"),J.value=Z,this.exit($)}function H40($,Z){return Z==="|"?Z:$}function vV($){let Z=$||{},J=Z.tableCellPadding,Q=Z.tablePipeAlign,X=Z.stringLength,z=J?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
62
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:q,table:G,tableCell:Y,tableRow:H}};function G(U,F,N,L){return K(W(U,N,L),U.align)}function H(U,F,N,L){let V=B(U,N,L),M=K([V]);return M.slice(0,M.indexOf(`
|
|
63
|
+
`))}function Y(U,F,N,L){let V=N.enter("tableCell"),M=N.enter("phrasing"),_=N.containerPhrasing(U,{...L,before:z,after:z});return M(),V(),_}function K(U,F){return ay(U,{align:F,alignDelimiters:Q,padding:J,stringLength:X})}function W(U,F,N){let L=U.children,V=-1,M=[],_=F.enter("table");while(++V<L.length)M[V]=B(L[V],F,N);return _(),M}function B(U,F,N){let L=U.children,V=-1,M=[],_=F.enter("tableRow");while(++V<L.length)M[V]=Y(L[V],U,F,N);return _(),M}function q(U,F,N){let L=zX.inlineCode(U,F,N);if(N.stack.includes("tableCell"))L=L.replace(/\|/g,"\\$&");return L}}function fV(){return{exit:{taskListCheckValueChecked:Mb,taskListCheckValueUnchecked:Mb,paragraph:Y40}}}function mV(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:K40}}}function Mb($){let Z=this.stack[this.stack.length-2];h5(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function Y40($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let J=this.stack[this.stack.length-1];h5(J.type==="paragraph");let Q=J.children[0];if(Q&&Q.type==="text"){let X=Z.children,z=-1,G;while(++z<X.length){let H=X[z];if(H.type==="paragraph"){G=H;break}}if(G===J){if(Q.value=Q.value.slice(1),Q.value.length===0)J.children.shift();else if(J.position&&Q.position&&typeof Q.position.start.offset==="number")Q.position.start.column++,Q.position.start.offset++,J.position.start=Object.assign({},Q.position.start)}}}this.exit($)}function K40($,Z,J,Q){let X=$.children[0],z=typeof $.checked==="boolean"&&X&&X.type==="paragraph",G="["+($.checked?"x":" ")+"] ",H=J.createTracker(Q);if(z)H.move(G);let Y=zX.listItem($,Z,J,{...Q,...H.current()});if(z)Y=Y.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,K);return Y;function K(W){return W+G}}function pV(){return[AV(),DV(),PV(),gV(),fV()]}function uV($){return{extensions:[_V(),OV($),wV(),vV($),mV()]}}var W40={tokenize:N40,partial:!0},Ab={tokenize:V40,partial:!0},_b={tokenize:L40,partial:!0},Db={tokenize:M40,partial:!0},B40={tokenize:A40,partial:!0},Ob={name:"wwwAutolink",tokenize:U40,previous:wb},Pb={name:"protocolAutolink",tokenize:F40,previous:jb},h9={name:"emailAutolink",tokenize:q40,previous:Tb},F9={};function dV(){return{text:F9}}var V7=48;while(V7<123)if(F9[V7]=h9,V7++,V7===58)V7=65;else if(V7===91)V7=97;F9[43]=h9;F9[45]=h9;F9[46]=h9;F9[95]=h9;F9[72]=[h9,Pb];F9[104]=[h9,Pb];F9[87]=[h9,Ob];F9[119]=[h9,Ob];function q40($,Z,J){let Q=this,X,z;return G;function G(B){if(!cV(B)||!Tb.call(Q,Q.previous)||lV(Q.events))return J(B);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),H(B)}function H(B){if(cV(B))return $.consume(B),H;if(B===64)return $.consume(B),Y;return J(B)}function Y(B){if(B===46)return $.check(B40,W,K)(B);if(B===45||B===95||f1(B))return z=!0,$.consume(B),Y;return W(B)}function K(B){return $.consume(B),X=!0,Y}function W(B){if(z&&X&&X8(Q.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(B);return J(B)}}function U40($,Z,J){let Q=this;return X;function X(G){if(G!==87&&G!==119||!wb.call(Q,Q.previous)||lV(Q.events))return J(G);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(W40,$.attempt(Ab,$.attempt(_b,z),J),J)(G)}function z(G){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(G)}}function F40($,Z,J){let Q=this,X="",z=!1;return G;function G(B){if((B===72||B===104)&&jb.call(Q,Q.previous)&&!lV(Q.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),X+=String.fromCodePoint(B),$.consume(B),H;return J(B)}function H(B){if(X8(B)&&X.length<5)return X+=String.fromCodePoint(B),$.consume(B),H;if(B===58){let q=X.toLowerCase();if(q==="http"||q==="https")return $.consume(B),Y}return J(B)}function Y(B){if(B===47){if($.consume(B),z)return K;return z=!0,Y}return J(B)}function K(B){return B===null||H7(B)||M5(B)||W9(B)||Y7(B)?J(B):$.attempt(Ab,$.attempt(_b,W),J)(B)}function W(B){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(B)}}function N40($,Z,J){let Q=0;return X;function X(G){if((G===87||G===119)&&Q<3)return Q++,$.consume(G),X;if(G===46&&Q===3)return $.consume(G),z;return J(G)}function z(G){return G===null?J(G):Z(G)}}function V40($,Z,J){let Q,X,z;return G;function G(K){if(K===46||K===95)return $.check(Db,Y,H)(K);if(K===null||M5(K)||W9(K)||K!==45&&Y7(K))return Y(K);return z=!0,$.consume(K),G}function H(K){if(K===95)Q=!0;else X=Q,Q=void 0;return $.consume(K),G}function Y(K){if(X||Q||!z)return J(K);return Z(K)}}function L40($,Z){let J=0,Q=0;return X;function X(G){if(G===40)return J++,$.consume(G),X;if(G===41&&Q<J)return z(G);if(G===33||G===34||G===38||G===39||G===41||G===42||G===44||G===46||G===58||G===59||G===60||G===63||G===93||G===95||G===126)return $.check(Db,Z,z)(G);if(G===null||M5(G)||W9(G))return Z(G);return $.consume(G),X}function z(G){if(G===41)Q++;return $.consume(G),X}}function M40($,Z,J){return Q;function Q(H){if(H===33||H===34||H===39||H===41||H===42||H===44||H===46||H===58||H===59||H===63||H===95||H===126)return $.consume(H),Q;if(H===38)return $.consume(H),z;if(H===93)return $.consume(H),X;if(H===60||H===null||M5(H)||W9(H))return Z(H);return J(H)}function X(H){if(H===null||H===40||H===91||M5(H)||W9(H))return Z(H);return Q(H)}function z(H){return X8(H)?G(H):J(H)}function G(H){if(H===59)return $.consume(H),Q;if(X8(H))return $.consume(H),G;return J(H)}}function A40($,Z,J){return Q;function Q(z){return $.consume(z),X}function X(z){return f1(z)?J(z):Z(z)}}function wb($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||M5($)}function jb($){return!X8($)}function Tb($){return!($===47||cV($))}function cV($){return $===43||$===45||$===46||$===95||f1($)}function lV($){let Z=$.length,J=!1;while(Z--){let Q=$[Z][1];if((Q.type==="labelLink"||Q.type==="labelImage")&&!Q._balanced){J=!0;break}if(Q._gfmAutolinkLiteralWalkedInto){J=!1;break}}if($.length>0&&!J)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return J}var _40={tokenize:C40,partial:!0};function iV(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:w40,continuation:{tokenize:j40},exit:T40}},text:{[91]:{name:"gfmFootnoteCall",tokenize:P40},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:D40,resolveTo:O40}}}}function D40($,Z,J){let Q=this,X=Q.events.length,z=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),G;while(X--){let Y=Q.events[X][1];if(Y.type==="labelImage"){G=Y;break}if(Y.type==="gfmFootnoteCall"||Y.type==="labelLink"||Y.type==="label"||Y.type==="image"||Y.type==="link")break}return H;function H(Y){if(!G||!G._balanced)return J(Y);let K=f8(Q.sliceSerialize({start:G.end,end:Q.now()}));if(K.codePointAt(0)!==94||!z.includes(K.slice(1)))return J(Y);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(Y),$.exit("gfmFootnoteCallLabelMarker"),Z(Y)}}function O40($,Z){let J=$.length,Q;while(J--)if($[J][1].type==="labelImage"&&$[J][0]==="enter"){Q=$[J][1];break}$[J+1][1].type="data",$[J+3][1].type="gfmFootnoteCallLabelMarker";let X={type:"gfmFootnoteCall",start:Object.assign({},$[J+3][1].start),end:Object.assign({},$[$.length-1][1].end)},z={type:"gfmFootnoteCallMarker",start:Object.assign({},$[J+3][1].end),end:Object.assign({},$[J+3][1].end)};z.end.column++,z.end.offset++,z.end._bufferIndex++;let G={type:"gfmFootnoteCallString",start:Object.assign({},z.end),end:Object.assign({},$[$.length-1][1].start)},H={type:"chunkString",contentType:"string",start:Object.assign({},G.start),end:Object.assign({},G.end)},Y=[$[J+1],$[J+2],["enter",X,Z],$[J+3],$[J+4],["enter",z,Z],["exit",z,Z],["enter",G,Z],["enter",H,Z],["exit",H,Z],["exit",G,Z],$[$.length-2],$[$.length-1],["exit",X,Z]];return $.splice(J,$.length-J+1,...Y),$}function P40($,Z,J){let Q=this,X=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),z=0,G;return H;function H(B){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(B),$.exit("gfmFootnoteCallLabelMarker"),Y}function Y(B){if(B!==94)return J(B);return $.enter("gfmFootnoteCallMarker"),$.consume(B),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",K}function K(B){if(z>999||B===93&&!G||B===null||B===91||M5(B))return J(B);if(B===93){$.exit("chunkString");let q=$.exit("gfmFootnoteCallString");if(!X.includes(f8(Q.sliceSerialize(q))))return J(B);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(B),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!M5(B))G=!0;return z++,$.consume(B),B===92?W:K}function W(B){if(B===91||B===92||B===93)return $.consume(B),z++,K;return K(B)}}function w40($,Z,J){let Q=this,X=Q.parser.gfmFootnotes||(Q.parser.gfmFootnotes=[]),z,G=0,H;return Y;function Y(F){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionLabelMarker"),K}function K(F){if(F===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",W;return J(F)}function W(F){if(G>999||F===93&&!H||F===null||F===91||M5(F))return J(F);if(F===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return z=f8(Q.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(F),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),q}if(!M5(F))H=!0;return G++,$.consume(F),F===92?B:W}function B(F){if(F===91||F===92||F===93)return $.consume(F),G++,W;return W(F)}function q(F){if(F===58){if($.enter("definitionMarker"),$.consume(F),$.exit("definitionMarker"),!X.includes(z))X.push(z);return r0($,U,"gfmFootnoteDefinitionWhitespace")}return J(F)}function U(F){return Z(F)}}function j40($,Z,J){return $.check(B9,Z,$.attempt(_40,Z,J))}function T40($){$.exit("gfmFootnoteDefinition")}function C40($,Z,J){let Q=this;return r0($,X,"gfmFootnoteDefinitionIndent",5);function X(z){let G=Q.events[Q.events.length-1];return G&&G[1].type==="gfmFootnoteDefinitionIndent"&&G[2].sliceSerialize(G[1],!0).length===4?Z(z):J(z)}}function rV($){let J=($||{}).singleTilde,Q={name:"strikethrough",tokenize:z,resolveAll:X};if(J===null||J===void 0)J=!0;return{text:{[126]:Q},insideSpan:{null:[Q]},attentionMarkers:{null:[126]}};function X(G,H){let Y=-1;while(++Y<G.length)if(G[Y][0]==="enter"&&G[Y][1].type==="strikethroughSequenceTemporary"&&G[Y][1]._close){let K=Y;while(K--)if(G[K][0]==="exit"&&G[K][1].type==="strikethroughSequenceTemporary"&&G[K][1]._open&&G[Y][1].end.offset-G[Y][1].start.offset===G[K][1].end.offset-G[K][1].start.offset){G[Y][1].type="strikethroughSequence",G[K][1].type="strikethroughSequence";let W={type:"strikethrough",start:Object.assign({},G[K][1].start),end:Object.assign({},G[Y][1].end)},B={type:"strikethroughText",start:Object.assign({},G[K][1].end),end:Object.assign({},G[Y][1].start)},q=[["enter",W,H],["enter",G[K][1],H],["exit",G[K][1],H],["enter",B,H]],U=H.parser.constructs.insideSpan.null;if(U)c1(q,q.length,0,m6(U,G.slice(K+1,Y),H));c1(q,q.length,0,[["exit",B,H],["enter",G[Y][1],H],["exit",G[Y][1],H],["exit",W,H]]),c1(G,K-1,Y-K+3,q),Y=K+q.length-2;break}}Y=-1;while(++Y<G.length)if(G[Y][1].type==="strikethroughSequenceTemporary")G[Y][1].type="data";return G}function z(G,H,Y){let K=this.previous,W=this.events,B=0;return q;function q(F){if(K===126&&W[W.length-1][1].type!=="characterEscape")return Y(F);return G.enter("strikethroughSequenceTemporary"),U(F)}function U(F){let N=y9(K);if(F===126){if(B>1)return Y(F);return G.consume(F),B++,U}if(B<2&&!J)return Y(F);let L=G.exit("strikethroughSequenceTemporary"),V=y9(F);return L._open=!V||V===2&&Boolean(N),L._close=!N||N===2&&Boolean(V),H(F)}}}class aV{constructor(){this.map=[]}add($,Z,J){E40(this,$,Z,J)}consume($){if(this.map.sort(function(X,z){return X[0]-z[0]}),this.map.length===0)return;let Z=this.map.length,J=[];while(Z>0)Z-=1,J.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];J.push($.slice()),$.length=0;let Q=J.pop();while(Q){for(let X of Q)$.push(X);Q=J.pop()}this.map.length=0}}function E40($,Z,J,Q){let X=0;if(J===0&&Q.length===0)return;while(X<$.map.length){if($.map[X][0]===Z){$.map[X][1]+=J,$.map[X][2].push(...Q);return}X+=1}$.map.push([Z,J,Q])}function Cb($,Z){let J=!1,Q=[];while(Z<$.length){let X=$[Z];if(J){if(X[0]==="enter"){if(X[1].type==="tableContent")Q.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(X[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let z=Q.length-1;Q[z]=Q[z]==="left"?"center":"right"}}else if(X[1].type==="tableDelimiterRow")break}else if(X[0]==="enter"&&X[1].type==="tableDelimiterRow")J=!0;Z+=1}return Q}function nV(){return{flow:{null:{name:"table",tokenize:S40,resolveAll:k40}}}}function S40($,Z,J){let Q=this,X=0,z=0,G;return H;function H(E){let h=Q.events.length-1;while(h>-1){let w=Q.events[h][1].type;if(w==="lineEnding"||w==="linePrefix")h--;else break}let k=h>-1?Q.events[h][1].type:null,S=k==="tableHead"||k==="tableRow"?A:Y;if(S===A&&Q.parser.lazy[Q.now().line])return J(E);return S(E)}function Y(E){return $.enter("tableHead"),$.enter("tableRow"),K(E)}function K(E){if(E===124)return W(E);return G=!0,z+=1,W(E)}function W(E){if(E===null)return J(E);if(b0(E)){if(z>1)return z=0,Q.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(E),$.exit("lineEnding"),U;return J(E)}if(n0(E))return r0($,W,"whitespace")(E);if(z+=1,G)G=!1,X+=1;if(E===124)return $.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),G=!0,W;return $.enter("data"),B(E)}function B(E){if(E===null||E===124||M5(E))return $.exit("data"),W(E);return $.consume(E),E===92?q:B}function q(E){if(E===92||E===124)return $.consume(E),B;return B(E)}function U(E){if(Q.interrupt=!1,Q.parser.lazy[Q.now().line])return J(E);if($.enter("tableDelimiterRow"),G=!1,n0(E))return r0($,F,"linePrefix",Q.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E);return F(E)}function F(E){if(E===45||E===58)return L(E);if(E===124)return G=!0,$.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),N;return D(E)}function N(E){if(n0(E))return r0($,L,"whitespace")(E);return L(E)}function L(E){if(E===58)return z+=1,G=!0,$.enter("tableDelimiterMarker"),$.consume(E),$.exit("tableDelimiterMarker"),V;if(E===45)return z+=1,V(E);if(E===null||b0(E))return O(E);return D(E)}function V(E){if(E===45)return $.enter("tableDelimiterFiller"),M(E);return D(E)}function M(E){if(E===45)return $.consume(E),M;if(E===58)return G=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(E),$.exit("tableDelimiterMarker"),_;return $.exit("tableDelimiterFiller"),_(E)}function _(E){if(n0(E))return r0($,O,"whitespace")(E);return O(E)}function O(E){if(E===124)return F(E);if(E===null||b0(E)){if(!G||X!==z)return D(E);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(E)}return D(E)}function D(E){return J(E)}function A(E){return $.enter("tableRow"),C(E)}function C(E){if(E===124)return $.enter("tableCellDivider"),$.consume(E),$.exit("tableCellDivider"),C;if(E===null||b0(E))return $.exit("tableRow"),Z(E);if(n0(E))return r0($,C,"whitespace")(E);return $.enter("data"),I(E)}function I(E){if(E===null||E===124||M5(E))return $.exit("data"),C(E);return $.consume(E),E===92?y:I}function y(E){if(E===92||E===124)return $.consume(E),I;return I(E)}}function k40($,Z){let J=-1,Q=!0,X=0,z=[0,0,0,0],G=[0,0,0,0],H=!1,Y=0,K,W,B,q=new aV;while(++J<$.length){let U=$[J],F=U[1];if(U[0]==="enter"){if(F.type==="tableHead"){if(H=!1,Y!==0)Eb(q,Z,Y,K,W),W=void 0,Y=0;K={type:"table",start:Object.assign({},F.start),end:Object.assign({},F.end)},q.add(J,0,[["enter",K,Z]])}else if(F.type==="tableRow"||F.type==="tableDelimiterRow"){if(Q=!0,B=void 0,z=[0,0,0,0],G=[0,J+1,0,0],H)H=!1,W={type:"tableBody",start:Object.assign({},F.start),end:Object.assign({},F.end)},q.add(J,0,[["enter",W,Z]]);X=F.type==="tableDelimiterRow"?2:W?3:1}else if(X&&(F.type==="data"||F.type==="tableDelimiterMarker"||F.type==="tableDelimiterFiller")){if(Q=!1,G[2]===0){if(z[1]!==0)G[0]=G[1],B=VW(q,Z,z,X,void 0,B),z=[0,0,0,0];G[2]=J}}else if(F.type==="tableCellDivider")if(Q)Q=!1;else{if(z[1]!==0)G[0]=G[1],B=VW(q,Z,z,X,void 0,B);z=G,G=[z[1],J,0,0]}}else if(F.type==="tableHead")H=!0,Y=J;else if(F.type==="tableRow"||F.type==="tableDelimiterRow"){if(Y=J,z[1]!==0)G[0]=G[1],B=VW(q,Z,z,X,J,B);else if(G[1]!==0)B=VW(q,Z,G,X,J,B);X=0}else if(X&&(F.type==="data"||F.type==="tableDelimiterMarker"||F.type==="tableDelimiterFiller"))G[3]=J}if(Y!==0)Eb(q,Z,Y,K,W);q.consume(Z.events),J=-1;while(++J<Z.events.length){let U=Z.events[J];if(U[0]==="enter"&&U[1].type==="table")U[1]._align=Cb(Z.events,J)}return $}function VW($,Z,J,Q,X,z){let G=Q===1?"tableHeader":Q===2?"tableDelimiter":"tableData",H="tableContent";if(J[0]!==0)z.end=Object.assign({},LZ(Z.events,J[0])),$.add(J[0],0,[["exit",z,Z]]);let Y=LZ(Z.events,J[1]);if(z={type:G,start:Object.assign({},Y),end:Object.assign({},Y)},$.add(J[1],0,[["enter",z,Z]]),J[2]!==0){let K=LZ(Z.events,J[2]),W=LZ(Z.events,J[3]),B={type:"tableContent",start:Object.assign({},K),end:Object.assign({},W)};if($.add(J[2],0,[["enter",B,Z]]),Q!==2){let q=Z.events[J[2]],U=Z.events[J[3]];if(q[1].end=Object.assign({},U[1].end),q[1].type="chunkText",q[1].contentType="text",J[3]>J[2]+1){let F=J[2]+1,N=J[3]-J[2]-1;$.add(F,N,[])}}$.add(J[3]+1,0,[["exit",B,Z]])}if(X!==void 0)z.end=Object.assign({},LZ(Z.events,X)),$.add(X,0,[["exit",z,Z]]),z=void 0;return z}function Eb($,Z,J,Q,X){let z=[],G=LZ(Z.events,J);if(X)X.end=Object.assign({},G),z.push(["exit",X,Z]);Q.end=Object.assign({},G),z.push(["exit",Q,Z]),$.add(J+1,0,z)}function LZ($,Z){let J=$[Z],Q=J[0]==="enter"?"start":"end";return J[1][Q]}var I40={name:"tasklistCheck",tokenize:R40};function oV(){return{text:{[91]:I40}}}function R40($,Z,J){let Q=this;return X;function X(Y){if(Q.previous!==null||!Q._gfmTasklistFirstContentOfListItem)return J(Y);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(Y),$.exit("taskListCheckMarker"),z}function z(Y){if(M5(Y))return $.enter("taskListCheckValueUnchecked"),$.consume(Y),$.exit("taskListCheckValueUnchecked"),G;if(Y===88||Y===120)return $.enter("taskListCheckValueChecked"),$.consume(Y),$.exit("taskListCheckValueChecked"),G;return J(Y)}function G(Y){if(Y===93)return $.enter("taskListCheckMarker"),$.consume(Y),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),H;return J(Y)}function H(Y){if(b0(Y))return Z(Y);if(n0(Y))return $.check({tokenize:y40},Z,J)(Y);return J(Y)}}function y40($,Z,J){return r0($,Q,"whitespace");function Q(X){return X===null?J(X):Z(X)}}function Sb($){return IK([dV(),iV(),rV($),nV(),oV()])}var b40={};function LW($){let Z=this,J=$||b40,Q=Z.data(),X=Q.micromarkExtensions||(Q.micromarkExtensions=[]),z=Q.fromMarkdownExtensions||(Q.fromMarkdownExtensions=[]),G=Q.toMarkdownExtensions||(Q.toMarkdownExtensions=[]);X.push(Sb(J)),z.push(pV()),G.push(uV(J))}var L7=P(c(),1),x40=[LW],h40=[FW],g40={code({node:$,className:Z,children:J,...Q}){return L7.jsx("code",{className:s("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",Z),...Q,children:J})},pre({children:$}){return L7.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:L7.jsx("pre",{className:"overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0",children:$})})}};function kb({size:$="sm",content:Z}){return L7.jsx("div",{className:s("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:L7.jsx(QW,{remarkPlugins:x40,rehypePlugins:h40,components:g40,children:Z})})}function Ib({content:$}){return L7.jsx(QW,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var ML=P(v(),1);var Rb="/agentation-4s0nn45p.png";var yb="/airtable-hsa66v6q.png";var bb="/apollo-2ed5dy2d.png";var xb="/asana-tvgtwbx2.png";var hb="/atlassian-b3tq39hs.png";var gb="/box-w3n36t5g.png";var sV="/chrome-tspm94rw.svg";var vb="/clickup-qqrqqvqb.png";var fb="/cloudflare-j9p931v6.png";var mb="/context7-8ht0xjfy.png";var pb="/datadog-70ne3yzt.png";var ub="/discord-vejhptwx.png";var cb="/dropbox-4m5s9mgr.png";var db="/elevenlabs-2nzzej1t.png";var lb="/exa-qqj3vr0x.png";var ib="/figma-y9898rry.png";var rb="/firecrawl-w2t8nehx.png";var ab="/github-av5r5y3e.png";var nb="/gitlab-4pv5vm6b.png";var ob="/gmail-sg6a5v3x.png";var sb="/googlecalendar-nqhh2v7r.png";var tb="/googledrive-6s8xyab7.png";var eb="/grafana-1yfsnwr6.png";var $x="/granola-7j3b0nk2.png";var Zx="/hubspot-hghcmc2t.png";var Jx="/huggingface-kxzaxj83.png";var Qx="/intercom-td763jt8.png";var Xx="/linear-v9s3az2d.png";var zx="/monday-jdbs4wwf.png";var Gx="/mongodb-emzxvhd5.png";var Hx="/neon-zj4qar44.png";var Yx="/notion-w034c0b8.png";var Kx="/paper-zbt34fab.png";var Wx="/paypal-kwwf7xsc.png";var Bx="/perplexity-4y63rxvj.png";var qx="/postgresql-qsspbsr1.png";var Ux="/posthog-sphppc4w.png";var Fx="/puppeteer-2xjt1a9b.png";var Nx="/railway-834de8d2.png";var Vx="/redis-spm6w2m1.png";var Lx="/salesforce-1mk56v4z.png";var Mx="/sentry-hdwpmvek.png";var Ax="/shopify-90dadaav.png";var _x="/slack-1c1wj62s.png";var Dx="/snowflake-hfpykpgy.png";var Ox="/stripe-zrfaqbj3.png";var Px="/supabase-4vg33zf2.png";var wx="/telegram-v6tjyrs7.png";var jx="/twilio-dpyjdwpj.png";var Tx="/vercel-7d0ssw28.png";var Cx="/zapier-p67qfch0.png";var x20={agentation:Rb,airtable:yb,apollo:bb,asana:xb,atlassian:hb,box:gb,chrome:sV,"chrome-devtools":sV,clickup:vb,cloudflare:fb,context7:mb,datadog:pb,discord:ub,dropbox:cb,elevenlabs:db,exa:lb,figma:ib,firecrawl:rb,github:ab,gitlab:nb,gmail:ob,googlecalendar:sb,googledrive:tb,grafana:eb,granola:$x,hubspot:Zx,huggingface:Jx,intercom:Qx,linear:Xx,monday:zx,mongodb:Gx,neon:Hx,notion:Yx,paper:Kx,paypal:Wx,perplexity:Bx,postgresql:qx,posthog:Ux,puppeteer:Fx,railway:Nx,redis:Vx,salesforce:Lx,sentry:Mx,shopify:Ax,slack:_x,snowflake:Dx,stripe:Ox,supabase:Px,telegram:wx,twilio:jx,vercel:Tx,zapier:Cx},h20={"google drive":"googledrive","google calendar":"googlecalendar",gcal:"googlecalendar",gdrive:"googledrive","apollo.io":"apollo","paper-desktop":"paper","granola-mcp":"granola","claude-in-chrome":"chrome",postgres:"postgresql","hugging face":"huggingface",jira:"atlassian",confluence:"atlassian"};function Ex($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function MW($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var g20=new Map(Object.entries(x20).map(([$,Z])=>[MW($),Z])),v20=new Map(Object.entries(h20).map(([$,Z])=>[MW($),MW(Z)]));function AW($){let Z=MW(Ex($));return g20.get(v20.get(Z)??Z)}function _W($){return Ex($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var tV=P(c(),1);function GX({open:$,children:Z}){return tV.jsx(s8,{initial:!1,children:$&&tV.jsx(u5.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",duration:0.25,bounce:0.1},className:"overflow-hidden",children:Z},"content")})}var Sx=P(v(),1);var Rx=P(c(),1),f20=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function kx($,Z){if($.name!=="Read"||!Z)return null;let J=$.input,Q=typeof J.file_path==="string"?J.file_path:null;if(!Q||!f20.test(Q))return null;let X=Z.endsWith("/")?Z:`${Z}/`;if(!Q.startsWith(X))return null;return Q.slice(X.length)}function Ix({relPath:$}){let Z=n5(),[J,Q]=Sx.useState(!1);if(J)return null;let X=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return Rx.jsx("img",{src:X,alt:$,loading:"lazy",onError:()=>Q(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var WX=P(v(),1);var bx=P(c(),1),m20=s("animate-[text-shimmer_2s_ease-in-out_infinite]","bg-clip-text text-transparent","bg-[length:200%_auto]","bg-[linear-gradient(90deg,var(--muted-foreground)_0%,var(--muted-foreground)_40%,var(--foreground)_50%,var(--muted-foreground)_60%,var(--muted-foreground)_100%)]");function yx({children:$,active:Z=!0,className:J}){return bx.jsx("span",{className:s(J,Z&&m20),children:$})}var HX=P(c(),1);function DW({className:$}){return HX.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:$,"aria-hidden":"true",children:[HX.jsx("path",{d:"M3.49994 11.7501L11.6717 3.57855C12.7762 2.47398 14.5672 2.47398 15.6717 3.57855C16.7762 4.68312 16.7762 6.47398 15.6717 7.57855M15.6717 7.57855L9.49994 13.7501M15.6717 7.57855C16.7762 6.47398 18.5672 6.47398 19.6717 7.57855C20.7762 8.68312 20.7762 10.474 19.6717 11.5785L12.7072 18.543C12.3167 18.9335 12.3167 19.5667 12.7072 19.9572L13.9999 21.2499"}),HX.jsx("path",{d:"M17.4999 9.74921L11.3282 15.921C10.2238 17.0255 8.43275 17.0255 7.32825 15.921C6.22376 14.8164 6.22376 13.0255 7.32825 11.921L13.4999 5.74939"})]})}var z8=P(c(),1),OW="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function AZ({isFirst:$,isLast:Z,marker:J,loading:Q=!1,isError:X=!1,children:z}){let G=J!=null||Q;return z8.jsxs("div",{className:"relative flex gap-2.5",children:[z8.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&z8.jsx("span",{className:s("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",G?"h-1":"h-2.5")}),!Z&&z8.jsx("span",{className:s("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",G?"top-[26px]":"top-5")}),J?z8.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:J}):Q?z8.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:z8.jsx(E1,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):z8.jsx("span",{className:s("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",X?"bg-destructive":"bg-border")})]}),z]})}function YX({open:$}){return z8.jsx(u5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:s("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:z8.jsx(o3,{size:12,stroke:1.75})})}function MZ({children:$,className:Z}){return z8.jsx("span",{className:s("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function xx({icon:$,size:Z=12,stroke:J=1.75}){return z8.jsx(MZ,{children:z8.jsx($,{size:Z,stroke:J,className:"text-muted-foreground"})})}function hx({src:$}){if(!$)return z8.jsx(MZ,{children:z8.jsx(DW,{className:"size-3 text-muted-foreground"})});return z8.jsx(MZ,{children:z8.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var p20=/^[A-Za-z]:\//;function u20($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(p20,(Z)=>Z.toUpperCase())}var c20=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var gx=/^\/([A-Za-z]:)?$/;function d20(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var eV=function(...$){$=$.map((Q)=>u20(Q));let Z="",J=!1;for(let Q=$.length-1;Q>=-1&&!J;Q--){let X=Q>=0?$[Q]:d20();if(!X||X.length===0)continue;Z=`${X}/${Z}`,J=$L(X)}if(Z=vx(Z,!J),J&&!$L(Z))return`/${Z}`;return Z.length>0?Z:"."};function vx($,Z){let J="",Q=0,X=-1,z=0,G=null;for(let H=0;H<=$.length;++H){if(H<$.length)G=$[H];else if(G==="/")break;else G="/";if(G==="/"){if(X===H-1||z===1);else if(z===2){if(J.length<2||Q!==2||J[J.length-1]!=="."||J[J.length-2]!=="."){if(J.length>2){let Y=J.lastIndexOf("/");if(Y===-1)J="",Q=0;else J=J.slice(0,Y),Q=J.length-1-J.lastIndexOf("/");X=H,z=0;continue}else if(J.length>0){J="",Q=0,X=H,z=0;continue}}if(Z)J+=J.length>0?"/..":"..",Q=2}else{if(J.length>0)J+=`/${$.slice(X+1,H)}`;else J=$.slice(X+1,H);Q=H-X-1}X=H,z=0}else if(G==="."&&z!==-1)++z;else z=-1}return J}var $L=function($){return c20.test($)};var ZL=function($,Z){let J=eV($).replace(gx,"$1").split("/"),Q=eV(Z).replace(gx,"$1").split("/");if(Q[0][1]===":"&&J[0][1]===":"&&J[0]!==Q[0])return Q.join("/");let X=[...J];for(let z of X){if(Q[0]!==z)break;J.shift(),Q.shift()}return[...J.map(()=>".."),...Q].join("/")};function _Z($){return $.input??{}}function z5($,Z){let J=$[Z];return typeof J==="string"?J:""}function fx($){return(Z)=>Z.replace(/\/[^\s"']+/g,(J)=>{if(!$)return J;let Q=ZL($,J);return Q.startsWith("..")?J:Q})}function M7($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let J=Math.floor(Z/60),Q=Z%60;return Q?`${J}m ${Q}s`:`${J}m`}var l20={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function i20($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function r20($,Z){let J=$.name,Q=_Z($);if(J==="Bash")return Z(`$ ${z5(Q,"command")}`);if(J==="Read"||J==="Write"||J==="Edit")return Z(z5(Q,"file_path"));if(J==="Glob")return Z(z5(Q,"pattern"));if(J==="Grep")return`/${z5(Q,"pattern")}/ ${Z(z5(Q,"path"))}`;if(J==="WebSearch")return z5(Q,"query");if(J==="WebFetch")return z5(Q,"url");if(J==="ToolSearch"){let X=z5(Q,"query");if(X.startsWith("select:"))return X.slice(7).split(",").map(i20).join(", ");return X}return""}var KX={displayName:($)=>l20[$.name]??$.name,brief:r20};var JL={exec:"Bash",apply_patch:"Edit",web_search:"Web search",update_plan:"Update plan",subagent:"Run sub-agent",subagent_activity:"Sub-agent",review:"Review",view_image:"View image",generate_image:"Generate image",list_mcp_resources:"List MCP resources",list_mcp_resource_templates:"List MCP templates",read_mcp_resource:"Read MCP resource"},px={read:"Read",listFiles:"List files",search:"Search"};function ux($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let J=Z[0],Q=J?.type;if(!Q||!(Q in px))return null;if(Z.some((X)=>X?.type!==Q))return null;return J}var mx={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function a20($){if($.name==="exec"){let Z=ux($.input);if(Z?.type)return px[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in mx)return mx[Z]}return JL[$.name]??$.name}function n20($,Z){let J=$.name,Q=_Z($);if(J==="exec"){let X=ux(Q);if(X?.type==="read")return Z(X.path||X.name||"");if(X?.type==="search")return[X.query&&`/${X.query}/`,X.path&&Z(X.path)].filter(Boolean).join(" ");if(X?.type==="listFiles")return X.path?Z(X.path):"";return Z(`$ ${z5(Q,"command")}`)}if(J==="apply_patch"){let X=Q.changes;if(Array.isArray(X))return X.map((G)=>G&&typeof G==="object"?G.path:void 0).filter((G)=>typeof G==="string").map(Z).join(", ");return""}if(J==="web_search"){let X=Q.queries;if(Array.isArray(X)&&X.length>0)return X.filter((z)=>typeof z==="string").join(" · ");return z5(Q,"query")}if(J==="update_plan"){let X=Q.plan;return typeof X==="string"?X.split(`
|
|
64
|
+
`)[0]:""}if(J==="subagent"){if(z5(Q,"action")==="close_agent")return"";return z5(Q,"prompt")}if(J==="subagent_activity")return z5(Q,"kind");if(J==="generate_image")return z5(Q,"prompt").split(`
|
|
65
|
+
`)[0];if(J==="read_mcp_resource")return z5(Q,"uri");if(J==="list_mcp_resources"||J==="list_mcp_resource_templates")return z5(Q,"server");return""}var cx={displayName:a20,brief:n20};function dx($){let Z=$.indexOf(":"),J=(Z>0?$.slice(0,Z):$).trim(),Q=Z>0?$.slice(Z+1).trim():"",X=J.match(/^(.*?)\s*\(([^)]*)\)$/);if(!X)return{action:J,qualifier:"",detail:Q};return{action:X[1].trim(),qualifier:X[2].trim(),detail:Q}}var o20={terminal:"Run command",read:"Read",write:"Write",edit:"Edit",patch:"Edit",search:"Search",extract:"Fetch webpage","web extract":"Fetch webpage","web search":"Web search",delegate:"Delegate task","delegate batch":"Delegate tasks",todo:"Update TODO",python:"Run Python","process wait":"Wait for process","session search":"Search sessions","skills list":"List skills","skill view":"View skill"};function s20($){let{action:Z}=dx($.name),J=o20[Z];if(J)return J;let Q=Z.replace(/_/g," ");return Q.charAt(0).toUpperCase()+Q.slice(1)}function t20($,Z){let{action:J,qualifier:Q,detail:X}=dx($.name),z=X||Q;if(!z)return"";return J==="terminal"?`$ ${z}`:Z(z)}var lx={displayName:s20,brief:t20};var e20={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",bash:"Bash",ls:"List files",find:"Find files",grep:"Search",process:"Manage process",web_search:"Web search",web_fetch:"Fetch",sessions_list:"List sessions",sessions_history:"Recall session",sessions_yield:"Yield to session",sessions_send:"Send to session",sessions_spawn:"Spawn session",subagents:"Run sub-agent",agents_list:"List agents",session_status:"Session status",image:"Analyze image",image_generate:"Generate image",memory_get:"Read memory",memory_search:"Search memory",update_plan:"Update plan",message:"Send message",browser:"Browser",canvas:"Canvas",cron:"Cron",gateway:"Gateway",code_execution:"Run Python",tts:"Text-to-speech",music_generate:"Generate music",video_generate:"Generate video",x_search:"Search X"};function $90($,Z){let J=$.name,Q=_Z($);if(J==="read"||J==="write"||J==="edit")return Z(z5(Q,"path"));if(J==="apply_patch"){let X=Q.changes;if(Array.isArray(X)&&X.length>0){let H=X.map((Y)=>Y&&typeof Y==="object"?z5(Y,"path"):"").filter(Boolean);if(H.length===1)return Z(H[0]);if(H.length>1)return`${H.length} files`}let z=z5(Q,"patch")||z5(Q,"input"),G=z.split(`
|
|
66
|
+
`).find((H)=>H.startsWith("*** "))??z.split(`
|
|
67
|
+
`)[0];return Z(G??"")}if(J==="exec"||J==="bash"){let X=z5(Q,"command")||z5(Q,"code");return X?Z(`$ ${X}`):""}if(J==="ls"||J==="find"||J==="grep")return Z(z5(Q,"path")||z5(Q,"pattern"));if(J==="process"){let X=z5(Q,"action"),z=z5(Q,"name");return[X,z].filter(Boolean).join(" ")||Z(z5(Q,"command"))}if(J==="web_search"||J==="x_search")return z5(Q,"query");if(J==="web_fetch")return z5(Q,"url");if(J==="memory_search")return z5(Q,"query");if(J==="memory_get")return z5(Q,"key")||z5(Q,"name");if(J==="sessions_history"||J==="sessions_send"||J==="sessions_yield")return z5(Q,"sessionKey")||z5(Q,"agentId");if(J==="sessions_list"||J==="agents_list")return z5(Q,"agentId");if(J==="subagents"||J==="sessions_spawn")return z5(Q,"task")||z5(Q,"agentId");if(J==="image"||J==="image_generate")return z5(Q,"prompt")||Z(z5(Q,"path"));if(J==="message")return z5(Q,"recipient")||z5(Q,"to");if(J==="update_plan"){let X=Q.plan;if(Array.isArray(X)){let G=X.find((H)=>!!H&&typeof H==="object"&&H.status==="in_progress")?.step??X[0]?.step;if(typeof G==="string")return G}return""}return""}var ix={displayName:($)=>e20[$.name]??KX.displayName($),brief:($,Z)=>$90($,Z)||KX.brief($,Z)};function QL($){if(!($.name==="Bash"||$.name==="exec"))return null;let J=$.input??{},Q=typeof J.command==="string"?J.command:"";if(!Q)return null;let X=Q.match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!X)return null;return{server:X[1],tool:X[2],rest:(X[3]??"").trim()}}function XL($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let J=Z.slice(5),Q=J.indexOf("__");if(Q<=0)return null;return{server:J.slice(0,Q),tool:J.slice(Q+2),rest:""}}function zL($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in JL)return null;if($.mcpServer==="codex")return null;let Z=$.name.indexOf(".");if(Z>0)return{server:$.name.slice(0,Z),tool:$.name.slice(Z+1),rest:""};return{server:$.mcpServer,tool:$.name,rest:""}}function GL($,Z){let J=Z.toLowerCase();return["-","_","."].find((X)=>J.startsWith($.toLowerCase()+X))?Z.slice($.length+1):Z}var Z90={"claude-code":KX,openclaw:ix,codex:cx,hermes:lx};function rx($){return Z90[$.provider??"claude-code"]}function ax($){return rx($).displayName($)}function nx($,Z){return rx($).brief($,fx(Z))}var d1=P(c(),1),ox=[sx,tx,HL];function J90(){let[$,Z]=WX.useState(0);WX.useEffect(()=>{let Q=setInterval(()=>Z((X)=>(X+1)%ox.length),600);return()=>clearInterval(Q)},[]);let J=ox[$];return d1.jsx(MZ,{className:"size-5",children:d1.jsx(J,{size:16,stroke:1.75,className:"text-foreground"})})}function ex({call:$,cwd:Z,isFirst:J,isLast:Q,renderNestedParts:X}){let[z,G]=WX.useState(!1),H=$.subagent,Y=$.input??{},K=H?.description??Y.description??"Subtask",W=H?.status,B=$.state==="error"||W==="failed",q=$.state==="running"||W==="running",U=H?.usage?.toolUses,F=H?.usage?.durationMs,L=(q&&H?.progress?.length?H.progress[H.progress.length-1]:null)??(U!=null?`Took ${U} step${U===1?"":"s"}`:null),V=(H?.transcript??[]).flatMap((O)=>O.parts),M=typeof $.output==="string"?$.output:"",_=V.length>0||!!M;return d1.jsx(AZ,{isFirst:J,isLast:Q,marker:q?d1.jsx(J90,{}):d1.jsx(MZ,{className:"size-5",children:d1.jsx(HL,{size:16,stroke:1.75,className:"text-foreground"})}),isError:B,children:d1.jsxs("div",{className:"min-w-0 flex-1",children:[d1.jsxs("button",{type:"button",title:`Agent: ${K}`,onClick:()=>_&&G((O)=>!O),className:s("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",_?"cursor-pointer":"cursor-default"),children:[d1.jsxs("span",{className:"flex w-full items-center gap-2",children:[d1.jsxs(yx,{active:q,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",K]}),!q&&F!=null&&d1.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:M7(F)}),W==="failed"&&d1.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),W==="stopped"&&d1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),_&&d1.jsx(YX,{open:z})]}),L&&d1.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:L})]}),_&&d1.jsx(GX,{open:z,children:d1.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[V.length>0&&d1.jsx("div",{className:"py-1.5 pr-2 pl-3",children:X(V,Z)}),M&&d1.jsx("div",{className:s("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",V.length>0&&"border-t border-border"),children:M})]})})]})})}var A7=P(v(),1);var Kh=P(v(),1);var WL=new Set(["<",">","{","}","[","]"]),FL=new Set(["for","do","while","if","else","return","function","var","let","const","true","false","undefined","this","new","delete","typeof","in","instanceof","void","break","continue","switch","case","default","throw","try","catch","finally","debugger","with","yield","async","await","class","extends","super","import","export","from","static"]),Q90=new Set([...FL,"type","interface","enum","implements","readonly","abstract","declare","namespace","module","private","protected","public","override","keyof","infer","is","asserts","satisfies","as","unknown","never","any","number","string","boolean","bigint","symbol","object"]),Qh=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...WL]),X90={keywords:FL,onCommentStart:Hh,onCommentEnd:U90};function z90($){let Z=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test($))Z+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test($))Z+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test($))Z+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test($))Z+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test($))Z+=1;return Z>=2}function G90($,Z){if($[Z]!=="<")return!1;let J=0,Q=!1;for(let X=Z;X<$.length;X++){let z=$[X];if(z==="<"){J++;continue}if(z===">"){if(J--,J===0){let G=X+1;while(G<$.length&&/\s/.test($[G]))G++;if(!(Q&&$[G]==="("))return!1;let H=$.slice(G,G+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(H)}continue}if(J===0)continue;if(/[$A-Za-z_]/.test(z)){Q=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(z))continue;return!1}return!1}var PW=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[DZ,H90,d6,YL,KL,Y90,K90,N9,$h,BL,Zh]=PW.map(($,Z)=>Z);function BX($){return/^[^\S\r\n]+$/g.test($)}function W90($){return Qh.has($)}function B90($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function wW($){return/^[\w_]+$/.test($)||Xh($)}function Jh($){let Z=$[0];return wW(Z)&&Z===Z.toUpperCase()||$==="null"}function Xh($){return/[^\u0000-\u007f]/.test($)}function zh($){return/^[a-zA-Z]$/.test($)}function Gh($){return zh($)||Xh($)}function OZ($){return Gh($[0])&&($.length===1||wW($.slice(1)))}function qL($){return $==="`"}function UL($){return $==='"'||$==="'"}function q90($){return UL($)||qL($)}function Hh($,Z){let J=$+Z;if(J==="/*")return 2;return J==="//"?1:0}function U90($,Z){return $+Z==="*/"?2:Z===`
|
|
68
|
+
`?1:0}function F90($){return $[0]==="/"&&!Hh($[0],$[1])}function N90($,Z){let J={...X90,...Z},Q=!!(Z&&Z.keywords instanceof Set),X=z90($),z=Q?J.keywords:X?Q90:FL,{onCommentStart:G,onCommentEnd:H}=J,Y=J.typeKeywords instanceof Set?J.typeKeywords:null,K="",W=-1,B=[-1,""],q=[-2,""],U=[],F=!1,N=0,L=!1,V=0,M=()=>F&&!L&&!N,_=()=>N&&!M(),O=()=>!N&&M()&&!L&&V>0,D=null,A=!1,C=0,I=0,y=()=>D!==null,E=()=>A,h=()=>I>C,k=()=>I>0&&I===C,S=()=>y()||h();function w(R){let b=R===`
|
|
69
|
+
`;if(_()){if(y())return d6;let[,u]=B;if(OZ(R)){if(u==="<"||u==="</")return Y90}}if(O())return K90;if(y()||h())return d6;else if(Y&&Y.has(R))return B[1]==="."?DZ:YL;else if(z.has(R))return B[1]==="."?DZ:H90;else if(b)return BL;else if(BX(R))return Zh;else if(R.split("").every(W90))return N9;else if(Jh(R))return _()?DZ:YL;else{if(OZ(R)){let u=B[1]==="."&&OZ(q[1]);if(!S()&&!u)return DZ;if(u)return KL}return d6}}let T=(R,b)=>{if(b)K=b;if(K){W=typeof R==="number"?R:w(K);let g=[W,K];if(W!==Zh&&W!==BL)q=B,B=g;U.push(g)}K=""};for(let R=0;R<$.length;R++){let b=$[R],g=$[R-1],u=$[R+1],j=g+b,e=b+u;if(typeof J.onQuote==="function"&&b==="'"&&!y()&&!O()&&!h()){let l=J.onQuote(b,R,$);if(typeof l==="number"&&l>=1&&!Number.isNaN(l)){let H0=Math.min(l,$.length-R),U0=R+H0;T(),K=$.slice(R,U0),T(DZ),R=U0-1;continue}}if(UL(b)&&!O()&&!h()){if(T(),g!=="\\"){if(D&&b===D)D=null;else if(!D)D=b}T(d6,b);continue}if(!h()){if(g!=="\\n"&&qL(b)){T(),T(d6,b),I++;continue}}if(h()){if(g!=="\\n"&&qL(b)){if(I>0){T(),I--,T(d6,b);continue}}if(e==="${"){C++,T(d6),T(N9,e),R++;continue}}if(k()&&b==="}"){T(),C--,T(N9,b);continue}if(M()){if(b==="{"){T(),T(N9,b),L=!0;continue}}if(F){if(!N&&b==="<"){if(T(),u==="/")N=2,K=e,R++;else N=1,K=b;T(N9);continue}if(N){if(b===">"&&!"/=".includes(g)){if(T(),N===1)N=0,V++;else N=0,F=!1;T(N9,b);continue}if(e==="/>"||e==="</"){if(K!=="<"&&K!=="/")T();if(e==="/>")N=0;else V--;if(!V)F=!1;K=e,R++,T(N9);continue}if(b==="<"){T(),K=b,T(N9);continue}if(u==="-"&&!S()&&!O()){if(K){T(KL,K+b+u),R++;continue}}if(u==="="&&!S()){if(!BX(b)){if(BX(K))T();let l=K+b;if(OZ(l)){T(KL,l);continue}}}}}if(!N&&(b==="<"&&Gh(u)||e==="</")){let l=R-1;while(l>=0&&/\s/.test($[l]))l--;let H0=l>=0?$[l]:"",[U0,X0]=B,Y0=!1,V0=!1;if(K&&!BX(K)){let J0=K;if(Jh(J0)||J0==="true"||J0==="false")Y0=!0;else if(z.has(J0)&&OZ(J0))V0=!0;else if(OZ(J0))Y0=!0}let i=b==="<"&&/[$\w\]\)]/.test(H0)&&(Y0||!V0&&(U0===DZ||U0===YL||U0===N9&&(X0===")"||X0==="]"))),Z0=b==="<"&&G90($,R);if(!i&&!Z0)N=u==="/"?2:1;if(b==="<"&&(u==="/"||zh(u))){if(!i&&!Z0&&!S()&&!O()&&!E())F=!0}}let t=q90(b),x=h(),$0=!F&&F90(e),M0=O();if(t||x||UL(D))K+=b;else if($0){T();let[l,H0]=B;if($0&&l!==-1&&!(l===N9&&H0!==")"||l===$h)){K=b,T();continue}A=!0;let U0=R++,X0=()=>R>=$.length,Y0=()=>X0()||$[R]===`
|
|
70
|
+
`,V0=!1,i=!1;for(;!Y0();R++){let Z0=$[R],J0=$[R-1]==="\\";if(!J0&&Z0==="[")i=!0;if(!J0&&Z0==="]")i=!1;if(Z0==="/"&&!i&&!J0){V0=!0;while(U0!==R&&/^[a-z]$/.test($[R+1])&&!Y0())R++;break}}if(A=!1,U0!==R&&V0)K=$.slice(U0,R+1),T(d6);else K=b,T(),R=U0}else if(G(b,u)){T();let l=R,H0=G(b,u);if(H0){for(;R<$.length;R++)if(H($[R-1],$[R])==H0)break}K=$.slice(l,R+1),T($h)}else if(b===" "||b===`
|
|
71
|
+
`)if(b===" "&&(BX(K)||!K||M0)){if(K+=b,u==="<")T()}else T(),K=b,T();else if(L&&b==="}")T(),K=b,T(),L=!1;else if(M0&&!WL.has(b)||h()||(wW(b)===wW(K[K.length-1])||M())&&!Qh.has(b))K+=b;else{if(j==="</")K=j;if(T(),j!=="</")K=b;if(e==="</"||e==="/>")K=e,T(),R++;else if(WL.has(b))T()}}return T(),U}function V90($,Z){let J=[],Q=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,X=0,z=(K,W)=>{let B=Q?Q(W,X):"";return X++,{type:"element",tagName:"span",children:K,properties:{className:B?`sh__line ${B}`:"sh__line"}}};function G(K){let W=K.map(([,q])=>q).join(""),B=K.map(([q,U])=>{let F=PW[q];return{type:"element",tagName:"span",children:[{type:"text",value:U}],properties:{className:`sh__token--${F}`,style:{color:`var(--sh-${F})`}}}});J.push(z(B,W))}let H=[],Y=!1;for(let K=0;K<$.length;K++){let W=$[K],[B,q]=W,U=K===$.length-1;if(B!==BL){if(q.includes(`
|
|
72
|
+
`)){let F=q.split(`
|
|
73
|
+
`);for(let N=0;N<F.length;N++)if(H.push([B,F[N]]),N<F.length-1)G(H),H.length=0}else H.push(W);Y=!1}else{if(Y)G([]);else G(H),H.length=0;if(U)G([]);Y=!0}}if(H.length)G(H);return J}var L90=($)=>{let Z=`class="${$.className}"`;if($.style){let J=Object.entries($.style).map(([Q,X])=>`${Q}:${X}`).join(";");Z+=` style="${J}"`}return Z};function M90($){return $.map((Z)=>{let{tagName:J}=Z,Q=Z.children.map((X)=>{let{tagName:z,children:G,properties:H}=X;return`<${z} ${L90(H)}>${B90(G[0].value)}</${z}>`}).join("");return`<${J} class="${Z.properties.className}">${Q}</${J}>`}).join(`
|
|
74
|
+
`)}function Yh($,Z){let J=N90($,Z),Q=V90(J,Z);return M90(Q)}var Q35={TokenTypes:PW,TokenMap:new Map(PW.map(($,Z)=>[$,Z]))};var NL=P(c(),1),A90=s("[--sh-identifier:#1f2937]","[--sh-keyword:#cf222e]","[--sh-string:#16a34a]","[--sh-class:#2d6e7e]","[--sh-property:#0550ae]","[--sh-entity:#6f42c1]","[--sh-jsxliterals:#6f42c1]","[--sh-sign:#8b949e]","[--sh-comment:#9ca3af]");function Wh({code:$,className:Z}){let J=Kh.useMemo(()=>Yh($),[$]);return NL.jsx("pre",{className:s("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",A90,Z),children:NL.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:J}})})}var _90={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",md:"md",mdx:"mdx",css:"css",scss:"scss",html:"html",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",c:"c",h:"c",cpp:"cpp",sh:"sh",bash:"sh",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",php:"php",swift:"swift",kt:"kt"};function D90($){let Z=$.split(/[\\/]/).pop()??"",J=Z.lastIndexOf("."),Q=J>0?Z.slice(J+1).toLowerCase():"";return _90[Q]??null}function O90($){let Z=$.trim();if(Z.length<2||!(Z.startsWith("{")||Z.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(Z),null,2)}catch{return null}}function P90($){let Z=$.split(`
|
|
75
|
+
`);if(!Z.some((J)=>/^\s*\d+\t/.test(J)))return $;return Z.map((J)=>J.replace(/^\s*\d+\t/,"")).join(`
|
|
76
|
+
`)}function Bh($,Z){let J=$.input??{},Q=typeof J.file_path==="string"?J.file_path:typeof J.path==="string"?J.path:"",X=Q?D90(Q):null,z=$.name==="Read"||$.name==="read",G=$.name==="Write"||$.name==="write";if(X&&z&&Z)return{kind:"highlight",code:P90(Z),label:X};if(X&&G&&typeof J.content==="string"&&J.content)return{kind:"highlight",code:J.content,label:X};let H=O90(Z);if(H)return{kind:"highlight",code:H,label:"json"};return{kind:"plain"}}var Z4=P(c(),1),VL="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function qh({call:$,output:Z,isError:J}){let[Q,X]=A7.useState(!1),z=A7.useMemo(()=>J?{kind:"plain"}:Bh($,Z),[$,Z,J]);if(z.kind==="plain")return Z4.jsx("div",{className:s("rounded-lg border",J?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:Z4.jsx("pre",{className:s(VL,"break-all whitespace-pre-wrap",J?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return Z4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[Z4.jsx(w90,{raw:Q,onRaw:X,label:z.label,copyText:Q?Z:z.code}),Q?Z4.jsx("pre",{className:s(VL,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):Z4.jsx(Wh,{code:z.code,className:s(VL,"text-muted-foreground")})]})}function w90({raw:$,onRaw:Z,label:J,copyText:Q}){return Z4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,J],[!0,"raw"]].map(([z,G])=>Z4.jsx(C0,{type:"button",variant:$===z?"outline":"ghost",size:"sm",onClick:()=>Z(z),className:"rounded-full text-xs uppercase",children:G},G)),Z4.jsx("div",{className:"flex-1"}),Z4.jsx(j90,{text:Q})]})}function j90({text:$}){let[Z,J]=A7.useState(!1);return A7.useEffect(()=>{if(!Z)return;let X=setTimeout(()=>J(!1),1500);return()=>clearTimeout(X)},[Z]),Z4.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>J(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?Z4.jsx(K6,{stroke:1.75}):Z4.jsx(mG,{stroke:1.75})})}var C5=P(c(),1);function jW({parts:$,cwd:Z=null,processing:J=!1}){let Q=$.filter((X)=>X.type==="reasoning"||X.type==="tool-call");return C5.jsx("div",{className:"flex flex-col",children:Q.map((X,z)=>{let G=z===Q.length-1,H={isFirst:z===0,isLast:G};if(X.type==="reasoning")return C5.jsx(T90,{text:X.text,durationMs:X.durationMs,inProgress:J&&G,...H},z);return C5.jsx(C90,{call:X.call,cwd:Z,...H},X.call.toolCallId||z)})})}function LL({isFirst:$,isLast:Z,call:J,leading:Q,marker:X,name:z,brief:G,preview:H}){let[Y,K]=ML.useState(!1),W=J.state==="error",B=J.state==="running"||J.state==="pending",q=W?J.errorText??"":typeof J.output==="string"?J.output:"",U=!!(q||W||H),F=G?`${z}: ${G}`:z;return C5.jsx(AZ,{isFirst:$,isLast:Z,marker:X,loading:B,isError:W,children:C5.jsxs("div",{className:"min-w-0 flex-1",children:[C5.jsxs("button",{type:"button",title:F,onClick:()=>U&&K((N)=>!N),className:s(OW,U?"cursor-pointer":"cursor-default"),children:[Q,C5.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:z}),G&&C5.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:G}),B&&X&&C5.jsx(E1,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),U&&C5.jsx(YX,{open:Y})]}),U&&C5.jsx(GX,{open:Y,children:C5.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[H,(q||W)&&C5.jsx(qh,{call:J,output:q,isError:W})]})})]})})}function T90({isFirst:$,isLast:Z,text:J,inProgress:Q=!1,durationMs:X}){let[z,G]=ML.useState(!1);if(!J){let K=X===void 0?"Thought":`Thought for ${M7(X)}`;return C5.jsx(AZ,{isFirst:$,isLast:Z,loading:Q,children:C5.jsx("div",{className:s(OW,"min-w-0 flex-1 cursor-default"),children:C5.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Q?"Thinking":K})})})}let H=Q?"Thinking":"Thought",Y=Q||z;return C5.jsx(AZ,{isFirst:$,isLast:Z,loading:Q,children:C5.jsxs("div",{className:"min-w-0 flex-1",children:[C5.jsxs("button",{type:"button","aria-expanded":Y,onClick:()=>G((K)=>!K),className:s(OW,"cursor-pointer"),children:[C5.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:H}),C5.jsx(YX,{open:Y})]}),C5.jsx(GX,{open:Y,children:C5.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:C5.jsx(Ib,{content:J})})})]})})}function C90({call:$,cwd:Z,isFirst:J,isLast:Q}){if($.caller==="subagent")return C5.jsx(ex,{call:$,cwd:Z,isFirst:J,isLast:Q,renderNestedParts:(G,H)=>C5.jsx(jW,{parts:G,cwd:H})});if($.name==="Skill"&&$.skill){let G=$.state==="success";return C5.jsx(LL,{isFirst:J,isLast:Q,call:$,marker:G?C5.jsx(xx,{icon:Uh,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let X=QL($)??XL($)??zL($);if(X){let G=GL(X.server,X.tool);return C5.jsx(LL,{isFirst:J,isLast:Q,call:$,marker:C5.jsx(hx,{src:AW(X.server)}),name:_W(X.server),brief:X.rest?`${G} ${X.rest}`:G})}let z=$.state==="error"?null:kx($,Z);return C5.jsx(LL,{isFirst:J,isLast:Q,call:$,leading:C5.jsx(E90,{call:$}),name:ax($),brief:nx($,Z),preview:z?C5.jsx(Ix,{relPath:z}):void 0})}function E90({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return C5.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var A5=P(c(),1);function Vh(){return A5.jsx("div",{className:"flex items-center gap-1 px-1 py-3",children:[0,1,2].map(($)=>A5.jsx("span",{className:"block h-1 w-1 rounded-full bg-ring",style:{animation:"pulse-dot 1.4s ease-in-out infinite",animationDelay:`${$*0.2}s`}},$))})}function Lh($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function S90($){let Z=[];for(let J of $)if(Lh(J)){let Q=Z[Z.length-1];if(Q&&Q.kind==="run")Q.parts.push(J);else Z.push({kind:"run",parts:[J]})}else Z.push({kind:"single",part:J});return Z}function TW({parts:$,cwd:Z,processing:J=!1}){let Q=S90($);return A5.jsx("div",{className:"flex flex-col",children:Q.map((X,z)=>{let G=z===0?"":"mt-3",H=z===Q.length-1;return A5.jsx("div",{className:G,children:X.kind==="run"?A5.jsx(jW,{parts:X.parts,cwd:Z,processing:J&&H}):A5.jsx(b90,{part:X.part})},z)})})}function k90($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function I90($){let Z=-1;for(let Q=$.length-1;Q>=0;Q--)if(Lh($[Q])){Z=Q;break}if(Z<0)return null;let J=$.slice(Z+1);if(!k90(J))return null;return{work:$.slice(0,Z+1),response:J}}function R90({parts:$,cwd:Z,durationMs:J,defaultOpen:Q}){let X=J===void 0?"Worked":`Worked for ${M7(J)}`;return A5.jsxs(BH,{defaultOpen:Q,className:"group/collapsible",children:[A5.jsxs(qH,{className:"flex w-fit items-center gap-1 rounded-sm py-1 text-left text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[A5.jsx("span",{children:X}),A5.jsx(o3,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),A5.jsx(UH,{className:"overflow-hidden pt-2",children:A5.jsx(TW,{parts:$,cwd:Z})})]})}function y90({parts:$,cwd:Z,processing:J=!1,durationMs:Q}){let X=J?null:I90($);return A5.jsx("div",{className:"w-full min-w-0",children:J?A5.jsx(TW,{parts:$,cwd:Z,processing:!0}):X?A5.jsxs("div",{className:"flex flex-col gap-3",children:[A5.jsx(R90,{parts:X.work,cwd:Z,durationMs:Q}),A5.jsx(TW,{parts:X.response,cwd:Z})]}):A5.jsx(TW,{parts:$,cwd:Z})})}var Mh=Nh.memo(function({turn:Z,processing:J=!1}){let Q=X1().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let X=Z.parts.filter((G)=>G.type==="file"),z=Z.parts.filter((G)=>G.type==="text").map((G)=>G.type==="text"?G.text:"").join(`
|
|
77
|
+
`);if(!z&&X.length===0)return null;return A5.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[X.map((G,H)=>A5.jsx(Ah,{mediaType:G.mediaType,url:G.url,filename:G.filename},H)),z&&A5.jsx("p",{className:s("max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere whitespace-pre-wrap text-primary-foreground","inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]"),children:z})]})}return A5.jsx(y90,{parts:Z.parts,cwd:Q,processing:J,durationMs:Z.meta?.durationMs})});function b90({part:$}){switch($.type){case"text":return A5.jsx(kb,{content:$.text});case"tool-call":return A5.jsx(jW,{parts:[$],cwd:null});case"file":return A5.jsx(Ah,{mediaType:$.mediaType,url:$.url,filename:$.filename});case"source-url":return A5.jsx(Fh,{url:$.url,title:$.title});case"source-document":return A5.jsx(Fh,{url:"#",title:$.title});case"data":return A5.jsx(x90,{name:$.name,data:$.data});case"reasoning":return null}}function Ah({mediaType:$,url:Z,filename:J}){if($.startsWith("image/")&&Z)return A5.jsx("img",{src:Z,alt:J??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return A5.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[A5.jsx(e$,{size:16,stroke:1.75}),A5.jsx("span",{className:"truncate",children:J??$})]})}function Fh({url:$,title:Z}){return A5.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function x90({name:$,data:Z}){return A5.jsxs("details",{children:[A5.jsxs("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:["data:",$]}),A5.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(Z,null,2)})]})}var z1=P(c(),1),h90=[],g90=[];function CW({active:$=!0,focusRequest:Z=0,docked:J=!1,chatLoaded:Q,view:X,previewTurn:z,sessionId:G,processing:H,composerBanner:Y,composerAvailability:K,annotation:W,send:B,stop:q,onClose:U,builderDraft:F}){let N=n5(),L=y4.useRef(null),V=y4.useRef(null),M=F?.sessionId??G??null,_=F?null:G??null,O=F?h90:X.turns,D=O1((t)=>t.hasSentMessageFromMoi),A=O1((t)=>(t.workspaceIdsPendingAnalysis??[]).includes(N)),C=T4((t)=>(t.attachments[o8(N,M)]??[]).some((x)=>x.status==="uploading")),I=!PQ(!0,C,K),y=F?null:z,E=F?g90:X.notices,h=y4.useMemo(()=>AC(y?[...O,y]:O),[O,y]),k=y4.useMemo(()=>DC(h,E),[h,E]),S=h.length>0?h[h.length-1].id:null,w=F?!1:H,T=!!F||Q&&k.length===0&&!w,R=tS({isViewBuilderDraft:!!F,hasSentMessageFromMoi:D,isWorkspacePendingAnalysis:A}),{atBottom:b,scrollToBottom:g,scrollToTop:u}=MC(V,M);y4.useLayoutEffect(()=>{if(T&&R!=="empty")u()},[T,R,u]),y4.useEffect(()=>{if($)CF(L.current)},[$,Z]);let j=y4.useCallback(async(t,x)=>{if(F)await F.onSubmit(t);else B(t,x);g()},[F,B,g]),e=y4.useCallback((t)=>{if(I)return;j(t.prompt,{directives:t.context})},[j,I]);return z1.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[z1.jsxs("header",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+40px)] items-center justify-between pr-2 pb-2 pl-2",children:[z1.jsx(Xk,{isViewBuilder:!!F}),U&&J&&z1.jsxs(A1,{children:[z1.jsx(_1,{render:z1.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:U,"aria-label":"Undock agent",children:z1.jsx(_h,{className:"size-5! text-muted-foreground",stroke:1.5})})}),z1.jsx(D1,{children:"Undock agent"})]}),!F&&U&&!J&&z1.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:U,"aria-label":"Close chat",children:z1.jsx(C1,{stroke:2})})]}),z1.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[z1.jsx("div",{ref:V,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-8 [--scroll-fade-reveal:8px]",children:z1.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[T&&z1.jsx(eS,{kind:R,disabled:I,onSelectPrompt:e}),k.map((t)=>t.kind==="notice"?z1.jsx(v90,{notice:t.notice},`notice:${t.notice.id}`):z1.jsx(Mh,{turn:t.turn,processing:w&&t.turn.id===S},t.turn.id)),w&&!y&&z1.jsx(Vh,{})]})}),!b&&O.length>0&&z1.jsx(C0,{type:"button",variant:"outline",size:"icon",onClick:()=>g("smooth"),"aria-label":"Jump to latest",className:"absolute bottom-3 left-1/2 -translate-x-1/2 animate-in rounded-full fade-in slide-in-from-bottom-1",children:z1.jsx(PK,{stroke:1.5})})]}),z1.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:z1.jsxs("div",{className:s("@container flex w-full flex-col transition-[padding]",Y&&"gap-2 rounded-t-lg rounded-b-2xl p-2",Y?.tone==="default"&&"bg-accent",Y?.tone==="error"&&"bg-destructive/10"),children:[Y?.content,z1.jsx(iS,{composerRef:L,onSend:j,onStop:q,processing:w,sessionId:M,modelSessionId:_,availability:K,annotation:F?void 0:W,onRemoveDrawing:F?.onRemoveDrawing??W?.onRemove,allowFiles:!F,placeholder:F?"Drop in the details":void 0,draft:F?{id:F.builderId,initialValue:F.initialValue,onChange:F.onChange}:void 0})]})})]})}function v90({notice:$}){let Z=EF($);if(!Z)return null;return z1.jsx("div",{className:"flex justify-center",children:z1.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var g9=P(c(),1);function Dh({loading:$,open:Z,onOpenChange:J,onOpenChangeComplete:Q,children:X}){let z=()=>J(!1);return g9.jsxs(QK,{open:Z,onOpenChange:(H,Y)=>{if(!H&&Y.reason==="outside-press"){Y.cancel();return}J(H)},onOpenChangeComplete:Q,children:[g9.jsx(XK,{render:g9.jsx("div",{className:"fixed right-4 bottom-4 sm:right-6 sm:bottom-6",children:g9.jsx(u5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"},invisible:{opacity:0,scale:1,filter:"blur(4px)"}},initial:"from",animate:Z?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:g9.jsx(C0,{variant:"outline",size:"icon-lg",className:"bg-card shadow-md hover:shadow-lg","aria-label":"Agent",children:g9.jsx(C6,{animated:$,stroke:1.75})})})})}),g9.jsx(zK,{positionMethod:"fixed",side:"top",sideOffset:-48,align:"end",alignOffset:-8,className:"flex h-[calc(100vh-2rem)] w-[min(440px,calc(100vw-1rem))] flex-col gap-0 rounded-3xl p-0 sm:h-[calc(100vh-8rem)] sm:w-[min(440px,calc(100vw-2rem))] sm:p-1",keepMounted:!0,children:X(z)})]})}var l6=P(c(),1);function EW({className:$,title:Z,children:J,onClose:Q,ref:X}){return l6.jsxs(u5.div,{ref:X,className:s("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-card text-card-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad) pb-0",$),variants:{hidden:{opacity:0,y:40,filter:"blur(4px)"},visible:{opacity:1,y:0,filter:"blur(0px)"}},initial:"hidden",animate:"visible",exit:"hidden",transition:{type:"spring",duration:0.25,bounce:0},children:[l6.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[l6.jsx("p",{className:"text-sm font-medium",children:Z}),l6.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Q,"aria-label":"Close panel",children:l6.jsx(C1,{stroke:1.75})})]}),l6.jsx("div",{className:"flex-1 pb-(--page-pad)",children:J})]})}var k1=P(c(),1),f90=Object.entries(w6),m90=Object.entries(MQ),p90=Object.entries(LQ);function AL({children:$,className:Z,gridClassName:J,label:Q}){return k1.jsxs("div",{className:s("flex flex-col gap-2",Z),children:[k1.jsx("p",{className:"text-xs font-medium",children:Q}),k1.jsx("div",{role:"group","aria-label":Q,className:s("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",J),children:$})]})}function _L({active:$,children:Z,className:J,onSelect:Q,style:X}){return k1.jsxs("button",{type:"button","aria-pressed":$,onClick:Q,className:s("relative w-full rounded-lg bg-card text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50","flex items-center gap-2 p-3",J,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:X,children:[k1.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&k1.jsx(dG,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function Oh({onClose:$,ref:Z}){oH();let{layout:J,setLayout:Q}=X1(),X=n3(J.theme);function z(G){Q({theme:{...X,...G}})}return k1.jsx(EW,{ref:Z,title:"Customize",onClose:$,className:"@4xl/workspace:max-w-4xl",children:k1.jsxs("div",{className:"grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2",children:[k1.jsx(AL,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:f90.map(([G,H])=>k1.jsx(_L,{active:G===X.font,onSelect:()=>z({font:G}),style:{fontFamily:H.sans},children:k1.jsx("span",{className:"text-sm font-medium",children:H.label})},G))}),k1.jsx(AL,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:m90.map(([G,H])=>k1.jsx(_L,{active:G===X.color,className:H.primary&&"bg-background text-foreground",onSelect:()=>z({color:G}),style:z9({...X,color:G}),children:k1.jsxs("div",{className:"flex gap-2",children:[k1.jsx("span",{className:s("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",H.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),k1.jsx("span",{className:"text-sm font-medium",children:H.label})]})},G))}),k1.jsx(AL,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:p90.map(([G,H])=>k1.jsx(_L,{active:G===X.radius,onSelect:()=>z({radius:G}),style:z9({...X,radius:G}),children:k1.jsxs("div",{className:"flex items-center gap-2",children:[k1.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),k1.jsx("span",{className:"text-sm font-medium",children:H.label})]})},G))})]})})}var nW=P(v(),1);var PZ=P(v(),1);function Ph($){return $1({queryKey:E0.appletThumbnails($),queryFn:async()=>(await O5(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...I4})}function wh($){let Z=s0();return Z1({mutationFn:(J)=>C4(`/api/workspaces/${$}/applet-thumbnails`,a1("PUT",J),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:E0.appletThumbnails($)}),Z.invalidateQueries({queryKey:E0.preview($)})}})}var u90=1000,c90=3,d90=10800000,l90=1000,i90="1000px-3x-webp-q80-v1",r90=5000,a90=1000,n90=1e4;function o90($){return Math.min(c90,u90/Math.max($.offsetWidth,$.offsetHeight))}function s90($){return`${i90}:${$??""}`}function t90($,Z,J=Date.now()){if(!$||$.revision!==Z)return!0;let Q=Date.parse($.capturedAt);return!Number.isFinite(Q)||J-Q>=d90}function e90($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=l90}var $60=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});async function Z60($,Z){let{createContext:J,destroyContext:Q,domToDataUrl:X}=await import("/chunk-b959mdkj.js"),z=async()=>{let G=await J($,{scale:o90($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:a90,...Z&&{onCreateForeignObjectSvg:(H)=>{let Y=document.createElement("style");Y.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",H.append(Y)}}});try{return await X(G)}finally{Q(G)}};return Promise.race([z(),$60(n90)])}async function J60($,Z,J,Q,X=Z60,z=Date.now()){let G=[];for(let H of J){if(Q())return null;let Y=s90(H.revision),K=Z.find((U)=>U.kind===$&&U.id===H.id);if(!t90(K,Y,z)){G.push({id:H.id,revision:Y});continue}if(e90(K,Y)){G.push({id:H.id,revision:Y});continue}if(!H.element){G.push({id:H.id,revision:Y,image:null});continue}let W=performance.now(),B=await X(H.element,$==="widget").catch(()=>null),q=Math.round(performance.now()-W);if(Q())return null;G.push({id:H.id,revision:Y,image:B,captureMs:q})}return G}function SW({kind:$,enabled:Z,targets:J}){let Q=n5(),X=Ph(Q).data,z=wh(Q),G=PZ.useRef(J);G.current=J;let H=PZ.useRef(X??[]);H.current=X??[];let Y=PZ.useRef(z.mutate);Y.current=z.mutate;let K=J.map((B)=>`${B.id}@${B.revision??""}`).join(`
|
|
78
|
+
`),W=X!==void 0;PZ.useEffect(()=>{if(!Z||!W||K==="")return;let B=!1,q=0,U,F=()=>{q+=1;let N=q;if(U!==void 0)clearTimeout(U);if(document.visibilityState!=="visible")return;U=setTimeout(async()=>{U=void 0;let L=await J60($,H.current,G.current.map((V)=>({...V,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(`${$}:${V.id}`)}"]`)})),()=>B||q!==N||document.visibilityState!=="visible");if(!L||B||document.visibilityState!=="visible")return;Y.current({kind:$,thumbnails:L})},r90)};return document.addEventListener("visibilitychange",F),F(),()=>{if(B=!0,U!==void 0)clearTimeout(U);document.removeEventListener("visibilitychange",F)}},[Z,$,W,K])}function qX($,Z,J,Q){let X=$.reduce((z,G)=>Math.max(z,G.y+G.h),0);for(let z=0;z<=X+J;z++)for(let G=0;G<=Q-Z;G++)if(!$.some((Y)=>!(G+Z<=Y.x||Y.x+Y.w<=G||z+J<=Y.y||Y.y+Y.h<=z)))return{x:G,y:z};return{x:0,y:X}}function UX($,Z=[],J=4){let Q=[];for(let X of $){let{x:z,y:G}=X.x!==void 0&&X.y!==void 0?{x:X.x,y:X.y}:qX([...Z,...Q],X.w,X.h,J);Q.push({i:X.id,x:z,y:G,w:X.w,h:X.h})}return Q}var DL=P(v(),1),kW=new Map;function Q60($){let Z=window.__moiAppletCss?.get($)??"",J=kW.get($);if(!J){let z=document.createElement("style");z.dataset.appletStyle=$,document.head.appendChild(z),J={el:z,refs:0},kW.set($,J)}if(J.el.textContent!==Z)J.el.textContent=Z;J.refs++;let Q=J,X=!1;return()=>{if(X)return;if(X=!0,Q.refs--,Q.refs<=0)Q.el.remove(),kW.delete($)}}function X60($){let Z=kW.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function IW($,Z,J=!1){DL.useInsertionEffect(()=>Q60($),[$,Z]),DL.useInsertionEffect(()=>{if(J)X60($)},[$,J,Z])}var Th=P(c(),1);function jh({segment:$,name:Z,version:J,children:Q}){let X=n5();return IW(XY($,X,Z),J),Th.jsx("div",{"data-applet":zY($,Z),className:"size-full",children:Q})}var Ch=P(v(),1);var wZ=P(c(),1);class FX extends Ch.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),V2(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
|
|
79
|
+
`)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return wZ.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[wZ.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[wZ.jsx(JG,{size:16,stroke:1.75}),"Widget crashed"]}),wZ.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var i6=P(c(),1);function Eh({name:$}){let Z=n5(),J=pT($);return i6.jsxs(s8,{mode:"wait",initial:!1,children:[J.status==="ready"&&i6.jsx(u5.div,{className:"absolute inset-0",initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:{duration:0.45,ease:"easeInOut"},children:i6.jsx(FX,{name:$,kind:"widget",workspaceId:Z,resetKey:J.version,children:i6.jsx(jh,{segment:"widgets",name:$,version:J.version,children:i6.jsx(J.Component,{})})})},J.version),J.status==="error"&&i6.jsx(u5.p,{className:"absolute inset-0 p-4 text-xs text-destructive",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:0.45,ease:"easeInOut"},children:J.error},`err-${J.version}`)]})}var Sh=P(c(),1);function jZ({className:$,...Z}){return Sh.jsx("div",{"data-slot":"skeleton",className:s("animate-pulse rounded-lg bg-muted",$),...Z})}var Ih=P(v(),1);var r6=P(c(),1);function RW({editing:$,hidden:Z,onRemove:J,children:Q}){let X=tT();return r6.jsxs(u5.div,{variants:{idle:{rotate:0},wiggle:{rotate:[0.5,-0.5],transition:{rotate:{repeat:1/0,repeatType:"reverse",duration:0.15,ease:"easeInOut"}}}},animate:$?"wiggle":"idle",transition:{type:"spring",duration:0.35,bounce:0},className:"group/widget relative size-full",children:[r6.jsx("div",{"data-widget-chrome":!0,style:z9(X,"widget"),className:s("absolute inset-0 overflow-hidden rounded-2xl text-foreground [corner-shape:superellipse(1.2)]","shadow-[0_1px_2px_-1px_rgba(0,0,0,0.08),0_2px_4px_0_rgba(0,0,0,0.03)]","after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit]","after:content-[''] after:[corner-shape:inherit]","after:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.05)]",$&&"pointer-events-none"),children:Q}),$&&J&&r6.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:r6.jsx(C0,{size:"icon-sm",variant:"outline",className:"rounded-full",onClick:J,children:Z?r6.jsx(W4,{stroke:1.75}):r6.jsx(kh,{stroke:1.75})})})]})}var TZ=P(c(),1),z60={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},G60={0:"row-start-1",1:"row-start-2",2:"row-start-3",3:"row-start-4",4:"row-start-5",5:"row-start-6",6:"row-start-7",7:"row-start-8"},H60={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},Y60={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function Rh({items:$,renderItem:Z,onClose:J,onRestore:Q,ref:X}){let z=Ih.useMemo(()=>UX($),[$]);return TZ.jsx(EW,{ref:X,title:"Hidden widgets",onClose:J,className:"max-h-[60vh]",children:TZ.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:TZ.jsx(s8,{children:z.map((G)=>TZ.jsx(u5.div,{layoutId:G.i,className:s(z60[G.x],G60[G.y],H60[G.w],Y60[G.h]),transition:{type:"spring",duration:0.35,bounce:0},children:TZ.jsx(RW,{editing:!0,onRemove:()=>Q(G.i),hidden:!0,children:Z(G.i)})},G.i))})})})}var EX=P(v(),1);function n6($){let{margin:Z,containerPadding:J,containerWidth:Q,cols:X}=$;return(Q-Z[0]*(X-1)-J[0]*2)/X}function j2($,Z,J){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*J)}function VX($,Z,J,Q,X,z,G){let{margin:H,containerPadding:Y,rowHeight:K}=$,W=n6($),B,q,U,F;if(G)B=Math.round(G.width),q=Math.round(G.height);else B=j2(Q,W,H[0]),q=j2(X,K,H[1]);if(z)U=Math.round(z.top),F=Math.round(z.left);else if(G)U=Math.round(G.top),F=Math.round(G.left);else U=Math.round((K+H[1])*J+Y[1]),F=Math.round((W+H[0])*Z+Y[0]);if(!z&&!G){if(Number.isFinite(Q)){let L=Math.round((W+H[0])*(Z+Q)+Y[0])-F-B;if(L!==H[0])B+=L-H[0]}if(Number.isFinite(X)){let L=Math.round((K+H[1])*(J+X)+Y[1])-U-q;if(L!==H[1])q+=L-H[1]}}return{top:U,left:F,width:B,height:q}}function bh($,Z,J,Q,X){let{margin:z,containerPadding:G,cols:H,rowHeight:Y,maxRows:K}=$,W=n6($),B=Math.round((J-G[0])/(W+z[0])),q=Math.round((Z-G[1])/(Y+z[1]));return B=NX(B,0,H-Q),q=NX(q,0,K-X),{x:B,y:q}}function LX($,Z,J){let{margin:Q,containerPadding:X,rowHeight:z}=$,G=n6($),H=Math.round((J-X[0])/(G+Q[0])),Y=Math.round((Z-X[1])/(z+Q[1]));return{x:H,y:Y}}function xh($,Z,J){let{margin:Q,rowHeight:X}=$,z=n6($),G=Math.max(1,Math.round((Z+Q[0])/(z+Q[0]))),H=Math.max(1,Math.round((J+Q[1])/(X+Q[1])));return{w:G,h:H}}function NX($,Z,J){return Math.max(Math.min($,J),Z)}function bW($,Z){if($.i===Z.i)return!1;if($.x+$.w<=Z.x)return!1;if($.x>=Z.x+Z.w)return!1;if($.y+$.h<=Z.y)return!1;if($.y>=Z.y+Z.h)return!1;return!0}function o6($,Z){for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0&&bW(Q,Z))return Q}return}function OL($,Z){return $.filter((J)=>bW(J,Z))}function K60($,Z){if(Z==="horizontal")return PL($);if(Z==="vertical")return yW($);if(Z==="wrap")return yW($);return[...$]}function yW($){return[...$].sort((Z,J)=>{if(Z.y!==J.y)return Z.y-J.y;return Z.x-J.x})}function PL($){return[...$].sort((Z,J)=>{if(Z.x!==J.x)return Z.x-J.x;return Z.y-J.y})}function MX($){let Z=0;for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0){let X=Q.y+Q.h;if(X>Z)Z=X}}return Z}function s6($,Z){for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0&&Q.i===Z)return Q}return}function AX($){return $.filter((Z)=>Z.static===!0)}function v9($){return{i:$.i,x:$.x,y:$.y,w:$.w,h:$.h,minW:$.minW,maxW:$.maxW,minH:$.minH,maxH:$.maxH,moved:Boolean($.moved),static:Boolean($.static),isDraggable:$.isDraggable,isResizable:$.isResizable,resizeHandles:$.resizeHandles,constraints:$.constraints,isBounded:$.isBounded}}function CZ($){let Z=Array($.length);for(let J=0;J<$.length;J++){let Q=$[J];if(Q!==void 0)Z[J]=v9(Q)}return Z}function W60($,Z){let J=Array($.length);for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X!==void 0)if(Z.i===X.i)J[Q]=Z;else J[Q]=X}return J}function hh($,Z,J){let Q=s6($,Z);if(!Q)return[[...$],null];return Q=J(v9(Q)),[W60($,Q),Q]}function wL($,Z){let J=AX($);for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X.x+X.w>Z.cols)X.x=Z.cols-X.w;if(X.x<0)X.x=0,X.w=Z.cols;if(!X.static)J.push(X);else while(o6(J,X))X.y++}return $}function a6($,Z,J,Q,X,z,G,H,Y){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===Q&&Z.x===J)return[...$];let{x:K,y:W}=Z;if(typeof J==="number")Z.x=J;if(typeof Q==="number")Z.y=Q;Z.moved=!0;let B=K60($,G);if(G==="vertical"&&typeof Q==="number"?W>=Q:G==="horizontal"&&typeof J==="number"?K>=J:!1)B=B.reverse();let U=OL(B,Z),F=U.length>0;if(F&&Y)return CZ($);if(F&&z)return Z.x=K,Z.y=W,Z.moved=!1,$;let N=[...$];for(let L=0;L<U.length;L++){let V=U[L];if(V===void 0)continue;if(V.moved)continue;if(V.static)N=yh(N,V,Z,X,G);else N=yh(N,Z,V,X,G)}return N}function yh($,Z,J,Q,X,z){let G=X==="horizontal",H=X==="vertical",Y=Z.static;if(Q){Q=!1;let B={x:G?Math.max(Z.x-J.w,0):J.x,y:H?Math.max(Z.y-J.h,0):J.y,w:J.w,h:J.h,i:"-1"},q=o6($,B),U=q!==void 0&&q.y+q.h>Z.y,F=q!==void 0&&Z.x+Z.w>q.x;if(!q)return a6($,J,G?B.x:void 0,H?B.y:void 0,Q,Y,X);if(U&&H)return a6($,J,void 0,J.y+1,Q,Y,X);if(U&&X===null)return Z.y=J.y,J.y=J.y+J.h,[...$];if(F&&G)return a6($,Z,J.x,void 0,Q,Y,X)}let K=G?J.x+1:void 0,W=H?J.y+1:void 0;if(K===void 0&&W===void 0)return[...$];return a6($,J,K,W,Q,Y,X)}function EZ($,Z,J){return Math.max(Z,Math.min(J,$))}var B60={name:"gridBounds",constrainPosition($,Z,J,{cols:Q,maxRows:X}){return{x:EZ(Z,0,Math.max(0,Q-$.w)),y:EZ(J,0,Math.max(0,X-$.h))}},constrainSize($,Z,J,Q,{cols:X,maxRows:z}){let G=Q==="w"||Q==="nw"||Q==="sw"?$.x+$.w:X-$.x,H=Q==="n"||Q==="nw"||Q==="ne"?$.y+$.h:z-$.y;return{w:EZ(Z,1,Math.max(1,G)),h:EZ(J,1,Math.max(1,H))}}},q60={name:"minMaxSize",constrainSize($,Z,J){return{w:EZ(Z,$.minW??1,$.maxW??1/0),h:EZ(J,$.minH??1,$.maxH??1/0)}}};var jL=[B60,q60];function _X($,Z,J,Q,X){let z={x:J,y:Q};for(let G of $)if(G.constrainPosition)z=G.constrainPosition(Z,z.x,z.y,X);if(Z.constraints){for(let G of Z.constraints)if(G.constrainPosition)z=G.constrainPosition(Z,z.x,z.y,X)}return z}function gh($,Z,J,Q,X,z){let G={w:J,h:Q};for(let H of $)if(H.constrainSize)G=H.constrainSize(Z,G.w,G.h,X,z);if(Z.constraints){for(let H of Z.constraints)if(H.constrainSize)G=H.constrainSize(Z,G.w,G.h,X,z)}return G}function hW({top:$,left:Z,width:J,height:Q}){let X=`translate(${Z}px,${$}px)`;return{transform:X,WebkitTransform:X,MozTransform:X,msTransform:X,OTransform:X,width:`${J}px`,height:`${Q}px`,position:"absolute"}}function TL({top:$,left:Z,width:J,height:Q}){return{top:`${$}px`,left:`${Z}px`,width:`${J}px`,height:`${Q}px`,position:"absolute"}}function CL($){return $*100+"%"}function U60($,Z,J,Q){return $+J>Q?Z:J}function vh($,Z,J){return $<0?Z:J}function F60($){return Math.max(0,$)}function xW($){return Math.max(0,$)}var EL=($,Z,J)=>{let{left:Q,height:X,width:z}=Z,G=$.top-(X-$.height);return{left:Q,width:z,height:vh(G,$.height,X),top:xW(G)}},SL=($,Z,J)=>{let{top:Q,left:X,height:z,width:G}=Z;return{top:Q,height:z,width:U60($.left,$.width,G,J),left:F60(X)}},kL=($,Z,J)=>{let{top:Q,height:X,width:z}=Z,G=$.left+$.width-z;if(G<0)return{height:X,width:$.left+$.width,top:xW(Q),left:0};return{height:X,width:z,top:xW(Q),left:G}},IL=($,Z,J)=>{let{top:Q,left:X,height:z,width:G}=Z;return{width:G,left:X,height:vh(Q,$.height,z),top:xW(Q)}},N60=($,Z,J)=>EL($,SL($,Z,J)),V60=($,Z,J)=>EL($,kL($,Z)),L60=($,Z,J)=>IL($,SL($,Z,J)),M60=($,Z,J)=>IL($,kL($,Z)),A60={n:EL,ne:N60,e:SL,se:L60,s:IL,sw:M60,w:kL,nw:V60};function fh($,Z,J,Q){let X=A60[$];if(!X)return J;return X(Z,{...Z,...J},Q)}var _60={type:"transform",scale:1,calcStyle($){return hW($)}};var mh=_60,ph={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},uh={enabled:!0,bounded:!1,threshold:3},ch={enabled:!0,handles:["se"]},dh={enabled:!1,defaultItem:{w:1,h:1}};function RL($,Z,J,Q,X){let z=Q==="x"?"w":"h";Z[Q]+=1;let G=$.findIndex((Y)=>Y.i===Z.i),H=X??AX($).length>0;for(let Y=G+1;Y<$.length;Y++){let K=$[Y];if(K===void 0)continue;if(K.static)continue;if(!H&&K.y>Z.y+Z.h)break;if(bW(Z,K))RL($,K,J+Z[z],Q,H)}Z[Q]=J}function D60($,Z,J,Q){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(Q,Z.y);while(Z.y>0&&!o6($,Z))Z.y--;let X;while((X=o6($,Z))!==void 0)RL(J,Z,X.y+X.h,"y");return Z.y=Math.max(Z.y,0),Z}function O60($,Z,J,Q){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!o6($,Z))Z.x--;let X;while((X=o6($,Z))!==void 0)if(RL(Q,Z,X.x+X.w,"x"),Z.x+Z.w>J){Z.x=J-Z.w,Z.y++;while(Z.x>0&&!o6($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var DX={type:"vertical",allowOverlap:!1,compact($,Z){let J=AX($),Q=MX(J),X=yW($),z=Array($.length);for(let G=0;G<X.length;G++){let H=X[G];if(H===void 0)continue;let Y=v9(H);if(!Y.static)Y=D60(J,Y,X,Q),Q=Math.max(Q,Y.y+Y.h),J.push(Y);let K=$.indexOf(H);z[K]=Y,Y.moved=!1}return z}},yL={type:"horizontal",allowOverlap:!1,compact($,Z){let J=AX($),Q=PL($),X=Array($.length);for(let z=0;z<Q.length;z++){let G=Q[z];if(G===void 0)continue;let H=v9(G);if(!H.static)H=O60(J,H,Z,Q),J.push(H);let Y=$.indexOf(G);X[Y]=H,H.moved=!1}return X}},bL={type:null,allowOverlap:!1,compact($,Z){return CZ($)}},P60={...DX,allowOverlap:!0,compact($,Z){return CZ($)}},w60={...yL,allowOverlap:!0,compact($,Z){return CZ($)}},j60={...bL,allowOverlap:!0};function xL($,Z=!1,J=!1){let Q;if(Z)if($==="vertical")Q=P60;else if($==="horizontal")Q=w60;else Q=j60;else if($==="vertical")Q=DX;else if($==="horizontal")Q=yL;else Q=bL;if(J)return{...Q,preventCollision:J};return Q}var T2=P(v(),1);function hL($={}){let{measureBeforeMount:Z=!1,initialWidth:J=1280}=$,[Q,X]=T2.useState(J),[z,G]=T2.useState(!Z),H=T2.useRef(null),Y=T2.useRef(null),K=T2.useCallback(()=>{let W=H.current;if(W){let B=W.offsetWidth;if(X(B),!z)G(!0)}},[z]);return T2.useEffect(()=>{let W=H.current;if(!W)return;if(K(),typeof ResizeObserver<"u"){let B=null;return Y.current=new ResizeObserver((q)=>{let U=q[0];if(U){let F=U.contentRect.width;if(B!==null)cancelAnimationFrame(B);B=requestAnimationFrame(()=>{X(F),B=null})}}),Y.current.observe(W),()=>{if(B!==null)cancelAnimationFrame(B);if(Y.current)Y.current.disconnect(),Y.current=null}}return()=>{if(Y.current)Y.current.disconnect(),Y.current=null}},[K]),{width:Q,mounted:z,containerRef:H,measureWidth:K}}var y0=P(v(),1),ug=P(lW(),1),cg=P(fg(),1);var m9=P(c(),1),_7=P(ih(),1);function JM($){let{children:Z,cols:J,containerWidth:Q,margin:X,containerPadding:z,rowHeight:G,maxRows:H,isDraggable:Y,isResizable:K,isBounded:W,static:B,useCSSTransforms:q=!0,usePercentages:U=!1,transformScale:F=1,positionStrategy:N,dragThreshold:L=0,droppingPosition:V,className:M="",style:_,handle:O="",cancel:D="",x:A,y:C,w:I,h:y,minW:E=1,maxW:h=1/0,minH:k=1,maxH:S=1/0,i:w,resizeHandles:T,resizeHandle:R,constraints:b=jL,layoutItem:g,layout:u=[],onDragStart:j,onDrag:e,onDragStop:t,onResizeStart:x,onResize:$0,onResizeStop:M0}=$,[l,H0]=y0.useState(!1),[U0,X0]=y0.useState(!1),Y0=y0.useRef(null),V0=y0.useRef({left:0,top:0}),i=y0.useRef({top:0,left:0,width:0,height:0}),Z0=y0.useRef(void 0),J0=y0.useRef(u);J0.current=u;let Q0=y0.useRef(null),n=y0.useRef(null),m=y0.useRef(!1),d=y0.useRef({x:0,y:0}),f=y0.useRef(!1),a=y0.useMemo(()=>({cols:J,containerPadding:z,containerWidth:Q,margin:X,maxRows:H,rowHeight:G}),[J,z,Q,X,H,G]),o=y0.useMemo(()=>({cols:J,maxRows:H,containerWidth:Q,containerHeight:0,rowHeight:G,margin:X,layout:[]}),[J,H,Q,G,X]),N0=y0.useCallback(()=>({...o,layout:J0.current}),[o]),j0=y0.useMemo(()=>g??{i:w,x:A,y:C,w:I,h:y,minW:E,maxW:h,minH:k,maxH:S},[g,w,A,C,I,y,E,h,k,S]),h0=y0.useCallback((I0)=>{if(N?.calcStyle)return N.calcStyle(I0);if(q)return hW(I0);let T0=TL(I0);if(U)return{...T0,left:CL(I0.left/Q),width:CL(I0.width/Q)};return T0},[N,q,U,Q]),c0=y0.useCallback((I0,{node:T0})=>{if(!j)return;let{offsetParent:m0}=T0;if(!m0)return;let Z5=m0.getBoundingClientRect(),Y5=T0.getBoundingClientRect(),I5=Y5.left/F,i5=Z5.left/F,r5=Y5.top/F,N5=Z5.top/F,F1;if(N?.calcDragPosition){let Q5=I0;F1=N.calcDragPosition(Q5.clientX,Q5.clientY,Q5.clientX-Y5.left,Q5.clientY-Y5.top)}else F1={left:I5-i5+m0.scrollLeft,top:r5-N5+m0.scrollTop};if(V0.current=F1,L>0){let Q5=I0;d.current={x:Q5.clientX,y:Q5.clientY},m.current=!0,f.current=!1,H0(!0);return}H0(!0);let m1=LX(a,F1.top,F1.left),{x:l1,y:x0}=_X(b,j0,m1.x,m1.y,N0());j(w,l1,x0,{e:I0,node:T0,newPosition:F1})},[j,F,a,N,L,b,j0,N0,w]),p=y0.useCallback((I0,{node:T0,deltaX:m0,deltaY:Z5})=>{if(!e||!l)return;let Y5=I0;if(m.current&&!f.current){let l1=Y5.clientX-d.current.x,x0=Y5.clientY-d.current.y;if(Math.hypot(l1,x0)<L)return;if(f.current=!0,m.current=!1,j){let d0=LX(a,V0.current.top,V0.current.left),{x:B5,y:R5}=_X(b,j0,d0.x,d0.y,N0());j(w,B5,R5,{e:I0,node:T0,newPosition:V0.current})}}let I5=V0.current.top+Z5,i5=V0.current.left+m0;if(W){let{offsetParent:l1}=T0;if(l1){let x0=l1.clientHeight-j2(y,G,X[1]);I5=NX(I5,0,x0);let Q5=n6(a),d0=Q-j2(I,Q5,X[0]);i5=NX(i5,0,d0)}}let r5={top:I5,left:i5};V0.current=r5;let N5=LX(a,I5,i5),{x:F1,y:m1}=_X(b,j0,N5.x,N5.y,N0());e(w,F1,m1,{e:I0,node:T0,newPosition:r5})},[e,j,l,L,W,y,G,X,a,Q,I,w,b,j0,N0]),r=y0.useCallback((I0,{node:T0})=>{if(!t||!l)return;let m0=m.current;if(m.current=!1,f.current=!1,d.current={x:0,y:0},m0){H0(!1),V0.current={left:0,top:0};return}let{left:Z5,top:Y5}=V0.current,I5={top:Y5,left:Z5};H0(!1),V0.current={left:0,top:0};let i5=LX(a,Y5,Z5),{x:r5,y:N5}=_X(b,j0,i5.x,i5.y,N0());t(w,r5,N5,{e:I0,node:T0,newPosition:I5})},[t,l,a,b,j0,N0,w]);Q0.current=c0,n.current=p;let z0=y0.useCallback((I0,{node:T0,size:m0,handle:Z5},Y5,I5)=>{let i5=I5==="onResizeStart"?x:I5==="onResize"?$0:M0;if(!i5)return;let r5;if(T0)r5=fh(Z5,Y5,m0,Q);else r5={...m0,top:Y5.top,left:Y5.left};i.current=r5;let N5=xh(a,r5.width,r5.height),{w:F1,h:m1}=gh(b,j0,N5.w,N5.h,Z5,N0());i5(w,F1,m1,{e:I0.nativeEvent,node:T0,size:r5,handle:Z5})},[x,$0,M0,Q,a,w,b,j0,N0]),L0=y0.useCallback((I0,T0)=>{X0(!0);let m0=VX(a,A,C,I,y),Z5={...T0,handle:T0.handle};z0(I0,Z5,m0,"onResizeStart")},[z0,a,A,C,I,y]),P0=y0.useCallback((I0,T0)=>{let m0=VX(a,A,C,I,y),Z5={...T0,handle:T0.handle};z0(I0,Z5,m0,"onResize")},[z0,a,A,C,I,y]),v0=y0.useCallback((I0,T0)=>{X0(!1),i.current={top:0,left:0,width:0,height:0};let m0=VX(a,A,C,I,y),Z5={...T0,handle:T0.handle};z0(I0,Z5,m0,"onResizeStop")},[z0,a,A,C,I,y]);y0.useEffect(()=>{if(!V)return;let I0=Y0.current;if(!I0)return;let T0=Z0.current||{left:0,top:0},m0=l&&(V.left!==T0.left||V.top!==T0.top);if(!l){let Z5={node:I0,deltaX:V.left,deltaY:V.top,lastX:0,lastY:0,x:V.left,y:V.top};Q0.current?.(V.e,Z5)}else if(m0){let Z5=V.left-V0.current.left,Y5=V.top-V0.current.top,I5={node:I0,deltaX:Z5,deltaY:Y5,lastX:V0.current.left,lastY:V0.current.top,x:V.left,y:V.top};n.current?.(V.e,I5)}Z0.current=V},[V,l,w]);let $5=VX(a,A,C,I,y,l?V0.current:null,U0?i.current:null),F5=y0.default.Children.only(Z),l0=n6(a),R0=[j2(E,l0,X[0]),j2(k,G,X[1])],G0=[j2(h,l0,X[0]),j2(S,G,X[1])],A0=F5.props,f0=A0.className,w5=A0.style,W5=y0.default.cloneElement(F5,{ref:Y0,className:QM("react-grid-item",f0,M,{static:B,resizing:U0,"react-draggable":Y,"react-draggable-dragging":l,dropping:Boolean(V),cssTransforms:q}),style:{..._,...w5,...h0($5)}}),l5=R;return W5=m9.jsx(cg.Resizable,{draggableOpts:{disabled:!K},className:K?void 0:"react-resizable-hide",width:$5.width,height:$5.height,minConstraints:R0,maxConstraints:G0,onResizeStart:L0,onResize:P0,onResizeStop:v0,transformScale:F,resizeHandles:T,handle:l5,children:W5}),W5=m9.jsx(ug.DraggableCore,{disabled:!Y,onStart:c0,onDrag:p,onStop:r,handle:O,cancel:".react-resizable-handle"+(D?","+D:""),scale:F,nodeRef:Y0,children:W5}),W5}var f9=()=>{},mg="react-grid-layout",dg=!1;try{dg=/firefox/i.test(navigator.userAgent)}catch{}function v70($,Z){let J=y0.default.Children.toArray($),Q=y0.default.Children.toArray(Z);if(J.length!==Q.length)return!1;for(let X=0;X<J.length;X++){let z=J[X],G=Q[X];if(z?.key!==G?.key)return!1}return!0}function pg($,Z,J,Q){let X=[],z=new Set;y0.default.Children.forEach(Z,(H)=>{if(!y0.default.isValidElement(H)||H.key===null)return;let Y=String(H.key);z.add(Y);let K=$.find((W)=>W.i===Y);if(K)X.push(v9(K));else{let B=H.props["data-grid"];if(B)X.push({i:Y,x:B.x??0,y:B.y??0,w:B.w??1,h:B.h??1,minW:B.minW,maxW:B.maxW,minH:B.minH,maxH:B.maxH,static:B.static,isDraggable:B.isDraggable,isResizable:B.isResizable,resizeHandles:B.resizeHandles,isBounded:B.isBounded});else X.push({i:Y,x:0,y:MX(X),w:1,h:1})}});let G=wL(X,{cols:J});return Q.compact(G,J)}function CX($){let{children:Z,width:J,gridConfig:Q,dragConfig:X,resizeConfig:z,dropConfig:G,positionStrategy:H=mh,compactor:Y,constraints:K=jL,layout:W=[],droppingItem:B,autoSize:q=!0,className:U="",style:F={},innerRef:N,onLayoutChange:L=f9,onDragStart:V=f9,onDrag:M=f9,onDragStop:_=f9,onResizeStart:O=f9,onResize:D=f9,onResizeStop:A=f9,onDrop:C=f9,onDropDragOver:I=f9}=$,y=y0.useMemo(()=>({...ph,...Q}),[Q]),E=y0.useMemo(()=>({...uh,...X}),[X]),h=y0.useMemo(()=>({...ch,...z}),[z]),k=y0.useMemo(()=>({...dh,...G}),[G]),{cols:S,rowHeight:w,maxRows:T,margin:R,containerPadding:b}=y,{enabled:g,bounded:u,handle:j,cancel:e,threshold:t}=E,{enabled:x,handles:$0,handleComponent:M0}=h,{enabled:l,defaultItem:H0,onDragOver:U0}=k,X0=Y??xL("vertical"),Y0=X0.type,V0=X0.allowOverlap,i=X0.preventCollision??!1,Z0=y0.useMemo(()=>B??{i:"__dropping-elem__",...H0},[B,H0]),J0=H.type==="transform",Q0=H.scale,n=b??R,[m,d]=y0.useState(!1),[f,a]=y0.useState(()=>pg(W,Z,S,X0)),[o,N0]=y0.useState(null),[j0,h0]=y0.useState(!1),[c0,p]=y0.useState(null),[r,z0]=y0.useState(),L0=y0.useRef(null),P0=y0.useRef(null),v0=y0.useRef(null),$5=y0.useRef(0),F5=y0.useRef(f),l0=y0.useRef(W),R0=y0.useRef(Z),G0=y0.useRef(Y0),A0=y0.useRef(f);A0.current=f,y0.useEffect(()=>{if(d(!0),!_7.deepEqual(f,W))L(f)},[]),y0.useEffect(()=>{if(o)return;if(c0)return;let x0=!_7.deepEqual(W,l0.current),Q5=!v70(Z,R0.current),d0=Y0!==G0.current;if(x0||Q5||d0){let R5=pg(x0?W:f,Z,S,X0);if(!_7.deepEqual(R5,f))a(R5)}l0.current=W,R0.current=Z,G0.current=Y0},[W,Z,S,Y0,X0,o,c0,f]),y0.useEffect(()=>{if(!o&&!_7.deepEqual(f,F5.current)){F5.current=f;let x0=f.filter((Q5)=>Q5.i!==Z0.i);L(x0)}},[f,o,L,Z0.i]);let f0=y0.useMemo(()=>{if(!q)return;let x0=MX(f),Q5=n[1];return x0*w+(x0-1)*R[1]+Q5*2+"px"},[q,f,w,R,n]),w5=y0.useCallback((x0,Q5,d0,B5)=>{let R5=A0.current,g5=s6(R5,x0);if(!g5)return;let N1={w:g5.w,h:g5.h,x:g5.x,y:g5.y,i:x0};L0.current=v9(g5),v0.current=R5,N0(N1),V(R5,g5,g5,null,B5.e,B5.node)},[V]),W5=y0.useCallback((x0,Q5,d0,B5)=>{let R5=A0.current,g5=L0.current,N1=s6(R5,x0);if(!N1)return;let Y8={w:N1.w,h:N1.h,x:N1.x,y:N1.y,i:x0},V1=a6(R5,N1,Q5,d0,!0,i,Y0,S,V0);M(V1,g5,N1,Y8,B5.e,B5.node),a(X0.compact(V1,S)),N0(Y8)},[i,Y0,S,V0,X0,M]),l5=y0.useCallback((x0,Q5,d0,B5)=>{if(!o)return;let R5=A0.current,g5=L0.current,N1=s6(R5,x0);if(!N1)return;let Y8=a6(R5,N1,Q5,d0,!0,i,Y0,S,V0),V1=X0.compact(Y8,S);_(V1,g5,N1,null,B5.e,B5.node);let T8=v0.current;if(L0.current=null,v0.current=null,N0(null),a(V1),T8&&!_7.deepEqual(T8,V1))L(V1)},[o,i,Y0,S,V0,X0,_,L]),I0=y0.useCallback((x0,Q5,d0,B5)=>{let R5=A0.current,g5=s6(R5,x0);if(!g5)return;P0.current=v9(g5),v0.current=R5,h0(!0),O(R5,g5,g5,null,B5.e,B5.node)},[O]),T0=y0.useCallback((x0,Q5,d0,B5)=>{let R5=A0.current,g5=P0.current,{handle:N1}=B5,Y8=!1,V1,T8,[mX,O9]=hh(R5,x0,(w1)=>{if(V1=w1.x,T8=w1.y,["sw","w","nw","n","ne"].includes(N1)){if(["sw","nw","w"].includes(N1))V1=w1.x+(w1.w-Q5),Q5=w1.x!==V1&&V1<0?w1.w:Q5,V1=V1<0?0:V1;if(["ne","n","nw"].includes(N1))T8=w1.y+(w1.h-d0),d0=w1.y!==T8&&T8<0?w1.h:d0,T8=T8<0?0:T8;Y8=!0}if(i&&!V0){if(OL(R5,{...w1,w:Q5,h:d0,x:V1??w1.x,y:T8??w1.y}).filter((uX)=>uX.i!==w1.i).length>0)T8=w1.y,d0=w1.h,V1=w1.x,Q5=w1.w,Y8=!1}return w1.w=Q5,w1.h=d0,w1});if(!O9)return;let iZ=mX;if(Y8&&V1!==void 0&&T8!==void 0)iZ=a6(mX,O9,V1,T8,!0,i,Y0,S,V0);let pX={w:O9.w,h:O9.h,x:O9.x,y:O9.y,i:x0,static:!0};D(iZ,g5,O9,pX,B5.e,B5.node),a(X0.compact(iZ,S)),N0(pX)},[i,Y0,S,V0,X0,D]),m0=y0.useCallback((x0,Q5,d0,B5)=>{let R5=A0.current,g5=P0.current,N1=s6(R5,x0),Y8=X0.compact(R5,S);A(Y8,g5,N1??null,null,B5.e,B5.node);let V1=v0.current;if(P0.current=null,v0.current=null,N0(null),h0(!1),a(Y8),V1&&!_7.deepEqual(V1,Y8))L(Y8)},[S,X0,A,L]),Z5=y0.useCallback(()=>{let x0=A0.current;if(!x0.some((B5)=>B5.i===Z0.i)){p(null),N0(null),z0(void 0);return}let d0=X0.compact(x0.filter((B5)=>B5.i!==Z0.i),S);a(d0),p(null),N0(null),z0(void 0)},[Z0.i,S,X0]),Y5=y0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),dg&&!x0.nativeEvent.target?.classList.contains(mg))return!1;let Q5=U0?U0(x0.nativeEvent):I(x0);if(Q5===!1){if(c0)Z5();return!1}let{dragOffsetX:d0=0,dragOffsetY:B5=0,...R5}=Q5??{},g5={...Z0,...R5},N1=x0.currentTarget.getBoundingClientRect(),Y8={cols:S,margin:R,maxRows:T,rowHeight:w,containerWidth:J,containerPadding:n},V1=n6(Y8),T8=j2(g5.w,V1,R[0]),mX=j2(g5.h,w,R[1]),O9=T8/2,iZ=mX/2,pX=x0.clientX-N1.left+d0-O9,w1=x0.clientY-N1.top+B5-iZ,OB=Math.max(0,pX),uX=Math.max(0,w1),cX={left:OB/Q0,top:uX/Q0,e:x0.nativeEvent};if(!c0){let PB=bh(Y8,uX,OB,g5.w,g5.h);p(m9.jsx("div",{},g5.i)),z0(cX);let Ju=A0.current.filter((Qu)=>Qu.i!==g5.i);a([...Ju,{...g5,x:PB.x,y:PB.y,static:!1,isDraggable:!0}])}else if(r){if(r.left!==cX.left||r.top!==cX.top)z0(cX)}},[c0,r,Z0,U0,I,Z5,Q0,S,R,T,w,J,n]),I5=y0.useCallback((x0)=>{if(x0.preventDefault(),x0.stopPropagation(),$5.current--,$5.current<0)$5.current=0;if($5.current===0)Z5()},[Z5]),i5=y0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation(),$5.current++},[]),r5=y0.useCallback((x0)=>{x0.preventDefault(),x0.stopPropagation();let Q5=A0.current,d0=Q5.find((B5)=>B5.i===Z0.i);$5.current=0,Z5(),C(Q5,d0,x0.nativeEvent)},[Z0.i,Z5,C]),N5=y0.useCallback((x0,Q5)=>{if(!x0||!x0.key)return null;let d0=s6(f,String(x0.key));if(!d0)return null;let B5=typeof d0.isDraggable==="boolean"?d0.isDraggable:!d0.static&&g,R5=typeof d0.isResizable==="boolean"?d0.isResizable:!d0.static&&x,g5=d0.resizeHandles||[...$0],N1=B5&&u&&d0.isBounded!==!1,Y8=M0;return m9.jsx(JM,{containerWidth:J,cols:S,margin:R,containerPadding:n,maxRows:T,rowHeight:w,cancel:e,handle:j,onDragStart:w5,onDrag:W5,onDragStop:l5,onResizeStart:I0,onResize:T0,onResizeStop:m0,isDraggable:B5,isResizable:R5,isBounded:N1,useCSSTransforms:J0&&m,usePercentages:!m,transformScale:Q0,positionStrategy:H,dragThreshold:t,w:d0.w,h:d0.h,x:d0.x,y:d0.y,i:d0.i,minH:d0.minH,minW:d0.minW,maxH:d0.maxH,maxW:d0.maxW,static:d0.static,droppingPosition:Q5?r:void 0,resizeHandles:g5,resizeHandle:Y8,constraints:K,layoutItem:d0,layout:f,children:x0},d0.i)},[f,J,S,R,n,T,w,e,j,w5,W5,l5,I0,T0,m0,g,x,u,J0,m,Q0,H,t,r,$0,M0,K]),F1=()=>{if(!o)return null;return m9.jsx(JM,{w:o.w,h:o.h,x:o.x,y:o.y,i:o.i,className:`react-grid-placeholder ${j0?"placeholder-resizing":""}`,containerWidth:J,cols:S,margin:R,containerPadding:n,maxRows:T,rowHeight:w,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:J0,transformScale:Q0,constraints:K,layout:f,children:m9.jsx("div",{})})},m1=QM(mg,U),l1={height:f0,...F};return m9.jsxs("div",{ref:N,className:m1,style:l1,onDrop:l?r5:void 0,onDragLeave:l?I5:void 0,onDragEnter:l?i5:void 0,onDragOver:l?Y5:void 0,children:[y0.default.Children.map(Z,(x0)=>{if(!y0.default.isValidElement(x0))return null;return N5(x0)}),l&&c0&&N5(c0,!0),F1()]})}var D7=P(c(),1);function XM({items:$,editing:Z,renderItem:J,onLayoutChange:Q}){let[X,z]=EX.useState(()=>UX($,[])),[G,H]=EX.useState($),{width:Y,containerRef:K,mounted:W}=hL({measureBeforeMount:!0});if(G!==$)H($),z((q)=>{let U=new Map(q.map((V)=>[V.i,V])),F=$.filter((V)=>U.has(V.id)).map((V)=>({...U.get(V.id),w:V.w,h:V.h})),N=new Set(F.map((V)=>V.i)),L=UX($.filter((V)=>!N.has(V.id)),F);return[...F,...L]});let B=EX.useCallback((q)=>{z(q),Q?.(q.map((U)=>({id:U.i,w:U.w,h:U.h,x:U.x,y:U.y})))},[Q]);return D7.jsx("div",{ref:K,className:"mx-auto w-full max-w-[var(--column-w)]",children:W&&D7.jsx(CX,{width:Y,layout:X,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:DX,onLayoutChange:B,children:X.map((q)=>D7.jsx("div",{children:D7.jsx(u5.div,{layoutId:q.i,"data-applet-thumbnail":`widget:${q.i}`,className:"size-full",transition:{type:"spring",duration:0.35,bounce:0},children:J(q.i)})},q.i))})})}function lg({items:$,editing:Z,renderItem:J,onLayoutChange:Q,onRemove:X}){return D7.jsx(XM,{items:$,editing:Z,onLayoutChange:Q,renderItem:(z)=>D7.jsx(RW,{editing:Z,onRemove:X?()=>X(z):void 0,children:J(z)})})}var E5=P(c(),1);function ig($){return E5.jsx(Eh,{name:$})}var m70=Array.from({length:10},($,Z)=>({id:`empty-widget-${Z}`,w:2,h:1}));function p70(){return E5.jsx(jZ,{className:"size-full animate-none rounded-2xl texture-checker [corner-shape:superellipse(1.2)]"})}function u70({onCreateWidget:$}){return E5.jsxs("div",{className:"relative min-h-0 flex-1 pt-7",children:[E5.jsx("div",{"aria-hidden":"true",children:E5.jsx(XM,{items:m70,renderItem:p70})}),E5.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-6",children:E5.jsxs("div",{className:"flex h-full w-full max-w-(--column-w) flex-col items-center justify-center gap-4 bg-radial from-background from-30% to-transparent to-80% text-center",children:[E5.jsxs("div",{className:"flex flex-col gap-1.5",children:[E5.jsx("h2",{className:"font-medium",children:"A little empty here"}),E5.jsx("p",{className:"mx-auto max-w-xs text-sm text-muted-foreground",children:"Widgets are small apps that can read data, perform tasks, and surface important information"})]}),E5.jsxs(C0,{type:"button",variant:"secondary",onClick:$,children:[E5.jsx(W4,{"data-icon":"inline-start",stroke:1.5}),"Create widget"]})]})})]})}function c70({editing:$,onCreateWidget:Z,onEditingChange:J}){return E5.jsxs("div",{className:"mx-auto mb-4 flex w-full max-w-(--column-w) shrink-0 items-center justify-end gap-2",children:[$&&E5.jsxs(C0,{type:"button",variant:"ghost",size:"sm",className:"mr-auto",onClick:Z,children:[E5.jsx(W4,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),E5.jsx(s8,{mode:"popLayout",initial:!1,children:E5.jsx(u5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.3,bounce:0},children:E5.jsx(C0,{type:"button",variant:$?"default":"ghost",size:"sm",className:s(!$&&"text-muted-foreground group-hover/widgets:opacity-100 [@media(hover:hover)]:opacity-0"),onClick:()=>J(!$),children:$?"Done":"Edit widgets"})},$?"done":"edit")})]})}function d70(){return E5.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:E5.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets added yet"})})}function l70(){let[$,Z]=nW.useState(0);return[nW.useCallback((Q)=>{if(!Q)return;let X=new ResizeObserver(([z])=>{let G=z.borderBoxSize?.[0];Z(G?G.blockSize:z.contentRect.height)});return X.observe(Q),()=>X.disconnect()},[]),$]}function ag({onCreateWidget:$,editing:Z,onEditingChange:J,widgets:Q}){let{layout:X,setLayout:z}=X1(),G=Q.length>0,H=new Set(X.widgetGrid.map((N)=>N.i)),Y=X.widgetGrid.filter((N)=>Q.some((L)=>L.id===N.i)).map((N)=>{let L=Q.find((V)=>V.id===N.i);return{id:N.i,w:L.config.colSpan,h:L.config.rowSpan,x:N.x,y:N.y}}),K=Q.filter((N)=>!H.has(N.id)).map((N)=>({id:N.id,w:N.config.colSpan,h:N.config.rowSpan})),[W,B]=l70(),q=Z&&K.length>0;SW({kind:"widget",enabled:!Z,targets:Y.map((N)=>({id:N.id,revision:Q.find((L)=>L.id===N.id)?.revision}))});function U(N){z({widgetGrid:X.widgetGrid.filter((L)=>L.i!==N)})}function F(N){let L=Q.find((_)=>_.id===N);if(!L)return;let V=X.widgetGrid.map((_)=>{let O=Q.find((D)=>D.id===_.i);return{..._,w:O?.config.colSpan??1,h:O?.config.rowSpan??1}}),M=qX(V,L.config.colSpan,L.config.rowSpan,4);z({widgetGrid:[...X.widgetGrid,{i:N,x:M.x,y:M.y}]})}return E5.jsx("div",{className:"group/widgets relative min-h-0 flex-1",children:E5.jsxs(rg,{children:[E5.jsx("div",{className:s("relative flex h-full flex-col p-4",G?"overflow-y-auto":"overflow-hidden"),children:G?E5.jsxs(E5.Fragment,{children:[E5.jsx(c70,{editing:Z,onCreateWidget:$,onEditingChange:J}),Y.length===0?E5.jsx(u5.div,{className:"mx-auto flex min-h-0 w-full max-w-[var(--column-w)] flex-1 flex-col",animate:{paddingBottom:q?B:0},transition:{type:"spring",duration:0.3,bounce:0},children:E5.jsx(d70,{})}):E5.jsx(u5.div,{animate:{marginBottom:q?B:0},transition:{type:"spring",duration:0.3,bounce:0},children:E5.jsx(lg,{items:Y,editing:Z,renderItem:ig,onRemove:U,onLayoutChange:(N)=>z({widgetGrid:N.map((L)=>({i:L.id,x:L.x??0,y:L.y??0}))})})})]}):E5.jsx(u70,{onCreateWidget:$})}),E5.jsx(s8,{children:G&&Z&&K.length>0&&E5.jsx(Rh,{ref:W,items:K,renderItem:ig,onClose:()=>J(!1),onRestore:F})})]})})}var og=P(c(),1);function ng({children:$}){return og.jsx("header",{className:s("@container relative flex shrink-0 items-center gap-2.5 py-2 pr-3 pl-4","after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border"),children:$})}var AM=P(v(),1);var M8=P(c(),1);function i70($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function r70({name:$,status:Z}){let J=AW($),Q="size-full rounded-lg ring-2 ring-background";return M8.jsxs("span",{className:"relative size-10 shrink-0",children:[J?M8.jsx("img",{src:J,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):M8.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:M8.jsx(DW,{className:"size-5"})}),Z!=="connected"&&M8.jsx(sg,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function tg($){return[...$].sort((Z,J)=>Number(J.status==="connected")-Number(Z.status==="connected"))}function eg({icon:$,children:Z}){return M8.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,M8.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function $v({server:$}){return M8.jsxs(eg,{icon:M8.jsx(r70,{name:$.name,status:$.status}),children:[M8.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:_W($.name)}),M8.jsx("span",{className:"text-sm text-muted-foreground",children:i70($.status)})]})}function Zv(){return M8.jsxs(eg,{icon:M8.jsx(jZ,{className:"size-10 shrink-0 rounded-lg"}),children:[M8.jsx(jZ,{className:"h-4 w-36 max-w-full"}),M8.jsx(jZ,{className:"h-4 w-20"})]})}function zM({children:$}){return M8.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function Jv($,Z){return $1({queryKey:E0.mcp($),queryFn:()=>O5(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var M4=P(c(),1);function yZ({title:$,description:Z,children:J}){return M4.jsxs("div",{className:"flex flex-col gap-6",children:[M4.jsxs("header",{className:"flex flex-col gap-0.5",children:[M4.jsx("h2",{className:"text-lg font-medium tracking-tight",children:$}),Z&&M4.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),J]})}function bZ({label:$,children:Z}){return M4.jsxs("section",{className:"flex flex-col gap-2",children:[$&&M4.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),M4.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border border-border bg-card text-card-foreground",children:Z})]})}function xZ({title:$,description:Z,control:J}){return M4.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[M4.jsxs("div",{className:"flex min-w-0 flex-col",children:[M4.jsx("span",{className:"text-sm font-medium",children:$}),Z&&M4.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),J&&M4.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:J})]})}var u8=P(c(),1),a70=Array.from({length:4},($,Z)=>Z);function n70({connectors:$}){if($.isPending)return u8.jsx("div",{role:"status","aria-label":"Loading connectors",children:u8.jsx(zM,{children:a70.map((Z)=>u8.jsx(Zv,{},Z))})});if($.isError)return u8.jsxs(Qv,{children:[u8.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),u8.jsx(C0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return u8.jsxs(Qv,{children:[u8.jsx(oW,{size:24,stroke:1.5,className:"text-muted-foreground"}),u8.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return u8.jsx(zM,{children:tg($.data).map((Z)=>u8.jsx($v,{server:Z},Z.name))})}function Qv({children:$}){return u8.jsx("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border px-8 py-12 text-center",children:$})}function Xv(){let{workspaceId:$}=X1(),Z=Jv($,!0);return u8.jsx(yZ,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:u8.jsx(n70,{connectors:Z})})}var WM=P(v(),1);var kX={};D4(kX,{Thumb:()=>Yv,Root:()=>Gv});var $3=P(v(),1);var sW=P(v(),1),GM=sW.createContext(void 0);function zv(){let $=sW.useContext(GM);if($===void 0)throw Error(S0(63));return $}var HM=function($){return $.checked="data-checked",$.unchecked="data-unchecked",$.disabled="data-disabled",$.readonly="data-readonly",$.required="data-required",$.valid="data-valid",$.invalid="data-invalid",$.touched="data-touched",$.dirty="data-dirty",$.filled="data-filled",$.focused="data-focused",$}({});var tW={...b8,checked($){if($)return{[HM.checked]:""};return{[HM.unchecked]:""}}};var SX=P(c(),1),Gv=$3.forwardRef(function(Z,J){let{checked:Q,className:X,defaultChecked:z,id:G,inputRef:H,name:Y,nativeButton:K=!1,onCheckedChange:W,readOnly:B=!1,required:q=!1,disabled:U=!1,render:F,uncheckedValue:N,value:L,...V}=Z,{clearErrors:M}=a4(),{state:_,setTouched:O,setDirty:D,validityData:A,setFilled:C,setFocused:I,shouldValidateOnChange:y,validationMode:E,disabled:h,name:k,validation:S}=b1(),{labelId:w}=q8(),T=h||U,R=k??Y,b=q0(W),g=$3.useRef(null),u=P4(g,H,S.inputRef),j=$3.useRef(null),e=t0(),t=H$({id:G,implicit:!1,controlRef:j}),x=K?void 0:t,[$0,M0]=n4({controlled:Q,default:Boolean(z),name:"Switch",state:"checked"});Y$({id:e,commit:S.commit,value:$0,controlRef:j,name:R,getValue:()=>$0}),B0(()=>{if(g.current)C(g.current.checked)},[g,C]),GK($0,()=>{if(M(R),D($0!==A.initialValue),C($0),y())S.commit($0);else S.commit($0,!0)});let{getButtonProps:l,buttonRef:H0}=p1({disabled:T,native:K}),U0={id:K?t:e,role:"switch","aria-checked":$0,"aria-readonly":B||void 0,"aria-required":q||void 0,"aria-labelledby":w,onFocus(){if(!T)I(!0)},onBlur(){let i=g.current;if(!i||T)return;if(O(!0),I(!1),E==="onBlur")S.commit(i.checked)},onClick(i){if(B||T)return;i.preventDefault(),g.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:i.shiftKey,ctrlKey:i.ctrlKey,altKey:i.altKey,metaKey:i.metaKey}))}},X0=$3.useMemo(()=>K4({checked:$0,disabled:T,id:x,name:R,required:q,style:R?j_:K2,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:u,onChange(i){if(i.nativeEvent.defaultPrevented)return;let Z0=i.target.checked,J0=D0(K0.none,i.nativeEvent);if(b?.(Z0,J0),J0.isCanceled)return;M0(Z0)},onFocus(){j.current?.focus()}},S.getInputValidationProps,L!==void 0?{value:L}:k5),[$0,T,u,x,R,b,q,M0,S,L]),Y0=$3.useMemo(()=>({..._,checked:$0,disabled:T,readOnly:B,required:q}),[_,$0,T,B,q]),V0=W0("span",Z,{state:Y0,ref:[J,j,H0],props:[U0,S.getValidationProps,V,l],stateAttributesMapping:tW});return SX.jsxs(GM.Provider,{value:Y0,children:[V0,!$0&&R&&N!==void 0&&SX.jsx("input",{type:"hidden",name:R,value:N}),SX.jsx("input",{...X0})]})});var Hv=P(v(),1);var Yv=Hv.forwardRef(function(Z,J){let{render:Q,className:X,...z}=Z,{state:G}=b1(),H=zv(),Y={...G,...H};return W0("span",Z,{state:Y,ref:J,stateAttributesMapping:tW,props:z})});var YM=P(c(),1);function Kv({className:$,...Z}){return YM.jsx(kX.Root,{"data-slot":"switch",className:s("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-primary data-unchecked:bg-input",$),...Z,children:YM.jsx(kX.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0.5"})})}var KM=["app-settings"];function Wv(){let $=s0();return J8((Z)=>{if(Z.type==="settings:updated")$.setQueryData(KM,Z.settings)}),$1({queryKey:KM,queryFn:()=>O5("/api/settings"),staleTime:30000})}function Bv(){let $=s0();return Z1({mutationFn:(Z)=>O5("/api/settings",a1("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(KM,Z)}})}function qv($){return $1({queryKey:E0.env($),queryFn:()=>O5(`/api/workspaces/${$}/env`),...I4})}function Uv($){let Z=s0();return Z1({mutationFn:(J)=>O5(`/api/workspaces/${$}/env`,a1("PUT",J)),onSuccess:(J)=>{Z.setQueryData(E0.env($),J)}})}function Fv($){let Z=s0();return Z1({mutationFn:(J)=>C4(`/api/workspaces/${$}/config`,a1("PUT",{name:J}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:E0.layout($)}),Z.invalidateQueries({queryKey:E0.all})}})}function Nv($){let Z=s0();return Z1({scope:{id:`workspace-icon:${$}`},mutationFn:(J)=>O5(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":J.type||"application/octet-stream"},body:J}),onSuccess:()=>{Z.invalidateQueries({queryKey:E0.layout($)}),Z.invalidateQueries({queryKey:E0.all})}})}function Vv($){let Z=s0();return Z1({scope:{id:`workspace-icon:${$}`},mutationFn:()=>C4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon"),onSuccess:()=>{Z.invalidateQueries({queryKey:E0.layout($)}),Z.invalidateQueries({queryKey:E0.all})}})}function Lv($){let Z=s0();return J8((J)=>{if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:E0.env($)})}),{env:qv($),update:Uv($)}}var I1=P(c(),1),o70={dotenv:".env",custom:"secret",both:"override"},s70=/^[A-Za-z_][A-Za-z0-9_]*$/;function Av(){let{workspaceId:$}=X1(),{env:Z,update:J}=Lv($),[Q,X]=WM.useState(""),[z,G]=WM.useState(""),H=s70.test(Q),Y=H&&z.length>0&&!J.isPending,K=()=>{if(!Y)return;J.mutate({set:{[Q]:z}},{onSuccess:()=>{X(""),G("")}})},W=Z.data?.vars??[],B=Z.data?.files.reduce((U,F)=>U+F.count,0)??0,q=Z.data?.files.length??0;return I1.jsxs(yZ,{title:"Environment",description:"Secrets injected into widgets and the agent at run time. Values are write-only — they're never shown again once saved.",children:[I1.jsxs(bZ,{label:"Variables",children:[Z.isLoading?I1.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:I1.jsx(E1,{className:"size-4 animate-spin",stroke:1.75})}):W.length===0?I1.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):W.map((U)=>{let F=U.source!=="dotenv";return I1.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[I1.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:U.key}),I1.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),I1.jsx("span",{className:s("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",U.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:o70[U.source]}),!F&&I1.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),I1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>J.mutate({remove:[U.key]}),disabled:!F,"aria-label":`Delete ${U.key}`,className:"disabled:invisible",children:I1.jsx(Mv,{stroke:1.75})})]},U.key)}),I1.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[I1.jsx(Y6,{value:Q,onChange:(U)=>X(U.target.value),placeholder:"NEW_KEY","aria-invalid":Q.length>0&&!H,className:"h-7 w-40 font-mono text-xs"}),I1.jsx(Y6,{value:z,onChange:(U)=>G(U.target.value),onKeyDown:(U)=>{if(U.key==="Enter")K()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),I1.jsxs(C0,{variant:"outline",size:"sm",onClick:K,disabled:!Y,children:[J.isPending?I1.jsx(E1,{stroke:1.75,className:"animate-spin"}):I1.jsx(W4,{stroke:1.75}),"Add"]})]})]}),I1.jsx(bZ,{label:"From .env files",children:I1.jsx(xZ,{title:"Inherit .env files",description:q>0?`Discovered ${B} ${B===1?"key":"keys"} across ${q} ${q===1?"file":"files"} in this space.`:"No .env files found in this space.",control:I1.jsx(Kv,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(U)=>J.mutate({inheritDotenv:U})})})})]})}var _m=P(v(),1);var P8=P(v(),1);var a0=P(v(),1),hZ=P(v(),1),g4=P(v(),1),pv=P(c(),1),$B=P(v(),1),ZB=P(v(),1),_5=P(c(),1),t70=Object.defineProperty,e70=($,Z)=>{for(var J in Z)t70($,J,{get:Z[J],enumerable:!0})},p9={};e70(p9,{ActiveEmoji:()=>Qf,Empty:()=>Jf,List:()=>ev,Loading:()=>Zf,Root:()=>iv,Search:()=>rv,SkinTone:()=>Xf,SkinToneSelector:()=>$f,Viewport:()=>av});var xv="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",UM=["none","light","medium-light","medium","medium-dark","dark"];function BM($){return $.charAt(0).toUpperCase()+$.slice(1)}var E2=2,c8=null;function _v($){try{c8??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!c8||(queueMicrotask(()=>{c8&&(c8=null)}),c8.canvas.width=E2,c8.canvas.height=E2,c8.font=`2px ${xv}`,c8.textBaseline="middle",c8.measureText($).width>=E2*2))return!1;c8.fillStyle="#00f",c8.fillText($,0,0);let Z=c8.getImageData(0,0,E2,E2).data;c8.clearRect(0,0,E2,E2),c8.fillStyle="#f00",c8.fillText($,0,0);let J=c8.getImageData(0,0,E2,E2).data;for(let Q=0;Q<E2*E2*4;Q+=4)if(Z[Q]!==J[Q]||Z[Q+1]!==J[Q+1]||Z[Q+2]!==J[Q+2])return!1;return!0}function Dv($,Z,J){try{let Q=$.getItem(Z);if(!Q)throw Error(`No value found for "${Z}".`);let X=JSON.parse(Q);return J(X)}catch{return null}}function hv($,Z,J){$.setItem(Z,JSON.stringify(J))}function Ov($){return(Z)=>Z===void 0?void 0:$(Z)}function Pv($){return(Z)=>Z===null?null:$(Z)}function O8($){if(typeof $!="string")throw Error();return $}function eW($){if(typeof $!="number")throw Error();return $}function gv($){if(typeof $!="boolean")throw Error();return $}function Z3($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let J={};for(let Q in $){let X=Z[Q];X===void 0&&$[Q](void 0),J[Q]=$[Q](X)}return J}}function qM($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var vv=($,Z)=>`${$}/${Z}/data.json`,fv=($,Z)=>`${$}/${Z}/messages.json`,$$0=["bn","da","de","en-gb","en","es-mx","es","et","fi","fr","hi","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","vi","zh-hant","zh"],wv="en",mv=($)=>`frimousse/data/${$}`,jv="frimousse/metadata";async function Tv($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function Z$0($,Z,J){let[{emojis:Q,emojisEtag:X},{messages:z,messagesEtag:G}]=await Promise.all([fetch(vv($,Z),{signal:J}).then(async(H)=>({emojis:await H.json(),emojisEtag:H.headers.get("etag")})),fetch(fv($,Z),{signal:J}).then(async(H)=>({messages:await H.json(),messagesEtag:H.headers.get("etag")}))]);return{emojis:Q,messages:z,emojisEtag:X,messagesEtag:G}}async function J$0($,Z,J){let[Q,X]=await Promise.all([Tv(vv($,Z),J),Tv(fv($,Z),J)]);return{emojisEtag:Q,messagesEtag:X}}function Q$0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,J)=>{let Q=UM[J.tone];return Z[Q]=J.emoji,Z},{}):void 0}async function Cv($,Z,J){let{emojis:Q,emojisEtag:X,messages:z,messagesEtag:G}=await Z$0($,Z,J),H=z.subgroups.find((F)=>F.key==="country-flag"||F.key==="subdivision-flag"),Y=z.groups.filter((F)=>F.key!=="component"),K=Q.filter((F)=>("group"in F)),W=Y.map((F)=>({index:F.order,label:BM(F.message)})),B=z.skinTones.reduce((F,N)=>(F[N.key]=BM(N.message),F),{}),q=K.map((F)=>({emoji:F.emoji,category:F.group,version:F.version,label:BM(F.label),tags:F.tags??[],countryFlag:H&&F.subgroup===H.order||void 0,skins:Q$0(F)})),U={locale:Z,emojis:q,categories:W,skinTones:B};return hv(localStorage,mv(Z),{data:U,metadata:{emojisEtag:X,messagesEtag:G}}),U}function X$0($,Z){let J=new Map;for(let G of $)J.has(G.version)||J.set(G.version,G.emoji);let Q=[...J.keys()].sort((G,H)=>H-G),X=Q[0]??0,z=_v("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:z};for(let G of Q){let H=J.get(G);if(_v(H))return{emojiVersion:G,countryFlags:z}}return{emojiVersion:X,countryFlags:z}}var z$0=Z3({emojiVersion:eW,countryFlags:gv}),G$0=Z3({data:Z3({locale:O8,emojis:qM(Z3({emoji:O8,category:eW,label:O8,version:eW,tags:qM(O8),countryFlag:Ov(gv),skins:Ov(Z3({light:O8,"medium-light":O8,medium:O8,"medium-dark":O8,dark:O8}))})),categories:qM(Z3({index:eW,label:O8})),skinTones:Z3({light:O8,"medium-light":O8,medium:O8,"medium-dark":O8,dark:O8})}),metadata:Z3({emojisEtag:Pv(O8),messagesEtag:Pv(O8)})});async function H$0({locale:$,emojiVersion:Z,emojibaseUrl:J,signal:Q}){let X=typeof J=="string"?J:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,z=Dv(sessionStorage,jv,z$0),G=Dv(localStorage,mv($),G$0),H;if(!G)H=await Cv(X,$,Q);else if(z)H=G.data;else try{let{emojisEtag:K,messagesEtag:W}=await J$0(X,$,Q);H=!K||!W||K!==G.metadata.emojisEtag||W!==G.metadata.messagesEtag?await Cv(X,$,Q):G.data}catch{H=G.data}z??=X$0(H.emojis,Z),hv(sessionStorage,jv,z);let Y=H.emojis.filter((K)=>{let W=K.version<=z.emojiVersion;return K.countryFlag?W&&z.countryFlags:W});return{locale:$,emojis:Y,categories:H.categories,skinTones:H.skinTones}}function Ev($){return $$0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${wv}" instead.`),wv)}function Sv($){return UM.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function Y$0($,Z){let J=[];if(Z<=0)return J;for(let Q=0,X=$.length;Q<X;Q+=Z)J.push($.slice(Q,Q+Z));return J}function K$0($,Z){if(!Z)return $;let J=Z.toLowerCase().trim(),Q=new WeakMap;return $.filter((X)=>{let z=0;X.label.toLowerCase().includes(J)&&(z+=10);for(let G of X.tags)G.toLowerCase().includes(J)&&(z+=1);return z>0?(Q.set(X,z),!0):!1}).sort((X,z)=>(Q.get(z)??0)-(Q.get(X)??0))}function W$0($,Z,J,Q){let X=K$0($.emojis,Q),z=[],G=[],H=[],Y={},K=0,W=0;for(let B of X)Y[B.category]||(Y[B.category]=[]),Y[B.category].push({emoji:J&&J!=="none"&&B.skins?B.skins[J]:B.emoji,label:B.label});for(let B of $.categories){let q=Y[B.index];if(!q||q.length===0)continue;let U=Y$0(Array.from(q),Z).map((F)=>({categoryIndex:K,emojis:F}));z.push(...U),G.push({label:B.label,rowsCount:U.length,startRowIndex:W}),H.push(W),K++,W+=U.length}return{count:X.length,categories:G,categoriesStartRowIndices:H,rows:z,skinTones:$.skinTones}}function B$0($){let Z={},J=null,Q=null,X=new Set,z=()=>{if(J){Z=J,J=null;for(let K of X)K(Z)}Q=null},G=()=>J??Z,H=(K)=>{J??=Z,Object.assign(J,typeof K=="function"?K(G()):K),Q||(Q=requestAnimationFrame(z))},Y=(K)=>(X.add(K),()=>X.delete(K));return Z=$(H,G),{get:G,set:H,subscribe:Y}}function q$0($){let[Z]=g4.useState($);return Z}function U$0($){let Z=g4.createContext(null);return{useStore:()=>{let J=g4.useContext(Z);if(!J)throw Error($);return J},Provider:({store:J,children:Q})=>pv.jsx(Z.Provider,{value:J,children:Q})}}function h4($,Z,J=Object.is){let[Q,X]=g4.useState(()=>Z($.get()));return g4.useEffect(()=>$.subscribe(()=>{let z=Z($.get());X((G)=>J(G,z)?G:z)}),[$,Z,J]),g4.useDebugValue(Q),Q}function V9($,Z,J){let Q=g4.useCallback((X)=>X[Z],[Z]);return h4($,Q,J)}var kv=2;function F$0($,Z,J,Q,X){let z=0;return B$0((G,H)=>({locale:Z,columns:J,sticky:Q,skinTone:X,onEmojiSelect:$,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:(Y)=>{let K=H(),W=Y?.data??K.data,B=Y?.categoryHeaderHeight??K.categoryHeaderHeight,q=Y?.rowHeight??K.rowHeight,U=Y?.viewportHeight??K.viewportHeight;if(!W||W.rows.length===0||!B||!q||!U)return G({...Y,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let F=0,N=0;for(let I of W.categories)if(N++*B+I.startRowIndex*q<z)F+=B;else break;let L=W.categories.length*B+W.rows.length*q,V=Math.floor(kv*q/2),M=Math.ceil(kv*q/2),_=Math.min(z-F-V,L-U),O=_+U+M,D=Math.max(0,Math.floor(_/q)),A=Math.min(W.rows.length-1,Math.ceil(O/q)),C=W.rows[D]?.categoryIndex;return G(C===void 0&&Y?Y:{...Y,viewportStartCategoryIndex:C,viewportStartRowIndex:D,viewportEndRowIndex:A})},onDataChange:(Y)=>{H().updateViewportState({data:Y,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(Y)=>{G({search:Y,interaction:Y?"keyboard":"none"})},onActiveEmojiChange:(Y,K,W)=>{if(G({interaction:Y,activeColumnIndex:K,activeRowIndex:W}),Y!=="keyboard")return;let{listRef:B,viewportRef:q,sticky:U,rowHeight:F,viewportHeight:N,categoryHeaderHeight:L}=H(),V=B?.current,M=q?.current;if(!V||!M||!F||!L||!N)return;let _=W;_===0&&M.scrollTo({top:0,behavior:"instant"});let O=V.querySelector(`[aria-rowindex="${_}"]`);if(!(O instanceof HTMLElement))return;let D=O.offsetTop,A=getComputedStyle(O),C=Number.parseFloat(A.scrollMarginTop),I=Number.parseFloat(A.scrollMarginBottom),y=z+C;U&&D<z+N/2&&(y+=L);let E=y+N-I;(D<y||D+F>E)&&M.scrollTo({top:Math.max(D<y+L?D-Math.max(U?L:0,C):D-N+F+I,0),behavior:"instant"})},onActiveEmojiReset:()=>{G({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(Y)=>{H().updateViewportState({rowHeight:Y})},onCategoryHeaderHeightChange:(Y)=>{H().updateViewportState({categoryHeaderHeight:Y})},onViewportSizeChange:(Y,K)=>{H().updateViewportState({viewportWidth:Y,viewportHeight:K})},onViewportScroll:(Y)=>{z=Y,H().updateViewportState()}}))}var{useStore:A4,Provider:N$0}=U$0("EmojiPicker.Root is missing.");function V$0($){return $.search}function FM($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function L$0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function M$0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function uv($){return $.data?.rows.length}function A$0($){return $.data?.categories.length}function _$0($){return $.data?.categoriesStartRowIndices}function D$0($){return $.data?.skinTones}function cv($,Z){return $?.emoji===Z?.emoji}function O$0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((J,Q)=>cv(J,Z?.emojis[Q]))}var IX="",Iv=/\p{Emoji_Modifier_Base}/u,P$0=/\uFE0F$/,w$0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,j$0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function T$0($,Z){if(!$.split(IX).some((Q)=>Iv.test(Q)))return $;let J=$.split(IX).map((Q)=>Q.replace(w$0,"")).join(IX);return Z==="none"?J:J.split(IX).map((Q,X,z)=>{let G=z.length>1;return!Iv.test(Q)||G&&Q==="\uD83E\uDD1D"?Q:Q.replace(P$0,"")+j$0[Z]}).join(IX)}function C$0($){return UM.map((Z)=>({skinTone:Z,emoji:T$0($,Z)}))}function dv(){let $=A4(),Z=h4($,FM,cv);return hZ.useDeferredValue(Z)}function lv($="✋"){let Z=A4(),J=V9(Z,"skinTone"),Q=hZ.useMemo(()=>C$0($),[$]),X=hZ.useCallback((z)=>{Z.set({skinTone:z})},[]);return[J,X,Q]}function NM($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let J=Object.keys($),Q=Object.keys(Z);return J.length!==Q.length?!1:J.every((X)=>(X in Z)&&$[X]===Z[X])}function E$0(...$){}function S$0($,Z){let J=null;if(typeof window.requestIdleCallback=="function")J=window.requestIdleCallback($,Z);else{let Q=Date.now();J=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-Q))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(J):window.clearTimeout(J)}}var S2=typeof window<"u"?$B.useLayoutEffect:$B.useEffect;function k$0($){let Z=ZB.useRef($);return S2(()=>{Z.current=$}),ZB.useCallback((...J)=>Z.current(...J),[])}function I$0({emojiVersion:$,emojibaseUrl:Z}){let[J,Q]=a0.useState(void 0),X=A4(),z=V9(X,"locale"),G=V9(X,"columns"),H=V9(X,"skinTone"),Y=V9(X,"search");return a0.useEffect(()=>{let K=new AbortController,W=K.signal;return H$0({locale:z,emojiVersion:$,emojibaseUrl:Z,signal:W}).then((B)=>{Q(B)}).catch((B)=>{W.aborted||console.error(B)}),()=>{K.abort()}},[$,Z,z]),a0.useEffect(()=>{if(J)return S$0(()=>{X.get().onDataChange(W$0(J,G,H,Y))},{timeout:100})},[J,G,H,Y]),null}var iv=a0.forwardRef(({locale:$="en",columns:Z=9,skinTone:J="none",onEmojiSelect:Q=E$0,emojiVersion:X,emojibaseUrl:z,onFocusCapture:G,onBlurCapture:H,children:Y,style:K,sticky:W=!0,...B},q)=>{let U=k$0(Q),F=q$0(()=>F$0(U,Ev($),Z,W,Sv(J))),[N,L]=a0.useState(!1),V=a0.useRef(null),M=a0.useCallback((D)=>{D&&(V.current=D,F.set({rootRef:V}))},[]);S2(()=>{F.set({locale:Ev($)})},[$]),S2(()=>{F.set({columns:Z})},[Z]),S2(()=>{F.set({sticky:W})},[W]),S2(()=>{F.set({skinTone:Sv(J)})},[J]);let _=a0.useCallback((D)=>{G?.(D);let{searchRef:A,viewportRef:C}=F.get(),I=D.target===A?.current||D.target.hasAttribute("frimousse-search"),y=D.target===C?.current||D.target.hasAttribute("frimousse-viewport");D.isDefaultPrevented()||(L(I||y),D.isDefaultPrevented()||(L(I||y),y?F.get().onActiveEmojiChange("keyboard",0,0):I&&F.get().search===""&&F.set({interaction:"none"})))},[G]),O=a0.useCallback((D)=>{H?.(D),!D.isDefaultPrevented()&&!D.currentTarget.contains(D.relatedTarget)&&L(!1)},[H]);return S2(()=>{N||F.get().onActiveEmojiReset()},[N]),a0.useImperativeHandle(q,()=>V.current),a0.useEffect(()=>{if(!N)return;function D(A){if(A.defaultPrevented||!A.key.startsWith("Arrow")&&A.key!=="Enter")return;let{data:C,onEmojiSelect:I,onActiveEmojiChange:y,interaction:E,activeColumnIndex:h,activeRowIndex:k}=F.get();if(A.key==="Enter"){let S=FM(F.get());S&&(A.preventDefault(),I(S))}if(A.key.startsWith("Arrow")){let S=h,w=k;if(A.preventDefault(),E!=="none"){if(C?.rows&&C.rows.length>0)switch(A.key){case"ArrowLeft":{if(S===0){let T=w-1,R=C.rows[T];R&&(w=T,S=R.emojis.length-1)}else S-=1;break}case"ArrowRight":{if(S===C.rows[w].emojis.length-1){let T=w+1;C.rows[T]&&(w=T,S=0)}else S+=1;break}case"ArrowUp":{let T=C.rows[w-1];T&&(w-=1,T.emojis[S]||(S=T.emojis.length-1));break}case"ArrowDown":{let T=C.rows[w+1];T&&(w+=1,T.emojis[S]||(S=T.emojis.length-1));break}}y("keyboard",S,w)}else y("keyboard",0,0)}}return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[N]),S2(()=>{let D=null,A=null,C=null,I=null,y=F.subscribe((w)=>{V.current&&(D!==w.viewportWidth&&(D=w.viewportWidth,V.current.style.setProperty("--frimousse-viewport-width",`${w.viewportWidth}px`)),A!==w.viewportHeight&&(A=w.viewportHeight,V.current.style.setProperty("--frimousse-viewport-height",`${w.viewportHeight}px`)),C!==w.rowHeight&&(C=w.rowHeight,V.current.style.setProperty("--frimousse-row-height",`${w.rowHeight}px`)),I!==w.categoryHeaderHeight&&(I=w.categoryHeaderHeight,V.current.style.setProperty("--frimousse-category-header-height",`${w.categoryHeaderHeight}px`)))}),{viewportWidth:E,viewportHeight:h,rowHeight:k,categoryHeaderHeight:S}=F.get();return E&&V.current.style.setProperty("--frimousse-viewport-width",`${E}px`),h&&V.current.style.setProperty("--frimousse-viewport-height",`${h}px`),k&&V.current.style.setProperty("--frimousse-row-height",`${k}px`),S&&V.current.style.setProperty("--frimousse-category-header-height",`${S}px`),y},[]),_5.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:O,onFocusCapture:_,...B,ref:M,style:{"--frimousse-emoji-font":xv,...K},children:_5.jsxs(N$0,{store:F,children:[_5.jsx(I$0,{emojiVersion:X,emojibaseUrl:z}),Y]})})}),rv=a0.forwardRef(({value:$,defaultValue:Z,onChange:J,...Q},X)=>{let z=A4(),G=a0.useRef(null),H=a0.useCallback((B)=>{B&&(G.current=B,z.set({searchRef:G}))},[]),Y=typeof $=="string",K=a0.useRef(Y);a0.useEffect(()=>{K.current=Y},[Y]),S2(()=>{z.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),S2(()=>{typeof $=="string"&&z.get().onSearchChange($)},[$]);let W=a0.useCallback((B)=>{J?.(B),B.isDefaultPrevented()||z.get().onSearchChange(B.target.value)},[J]);return a0.useImperativeHandle(X,()=>G.current),_5.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...Q,defaultValue:Z,onChange:W,ref:H,value:$})}),R$0=a0.memo(()=>{let $=dv();return $?_5.jsx("div",{"aria-live":"polite",style:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1,wordWrap:"normal"},children:$.label}):null}),av=a0.forwardRef(({children:$,onScroll:Z,onKeyDown:J,style:Q,...X},z)=>{let G=A4(),H=a0.useRef(null),Y=a0.useCallback((q)=>{q&&(H.current=q,G.set({viewportRef:H}))},[]),K=h4(G,uv),W=h4(G,A$0),B=a0.useCallback((q)=>{Z?.(q),G.get().onViewportScroll(q.currentTarget.scrollTop)},[Z]);return S2(()=>{if(!H.current)return;let q=new ResizeObserver(([U])=>{let F=U?.borderBoxSize[0]?.inlineSize??0,N=U?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:L,viewportHeight:V,viewportWidth:M}=G.get();(V!==N||M!==F)&&L(F,N)});return q.observe(H.current),G.get().onViewportSizeChange(H.current.offsetWidth,H.current.clientHeight),()=>{q.disconnect()}},[]),a0.useImperativeHandle(z,()=>H.current),_5.jsxs("div",{"frimousse-viewport":"",...X,onScroll:B,ref:Y,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof K=="number"&&typeof W=="number"?`var(--frimousse-viewport-width, auto) calc(${K} * var(--frimousse-row-height) + ${W} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...Q},children:[_5.jsx(R$0,{}),$]})});function nv($,Z,J){return{emoji:{...$,isActive:J},role:"gridcell","aria-colindex":Z,"aria-selected":J||void 0,"aria-label":$.label,"data-active":J?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function ov($,Z=!1){return{role:Z?void 0:"row","aria-rowindex":Z?void 0:$,"frimousse-row":"",style:{contain:Z?void 0:"content",height:Z?void 0:"var(--frimousse-row-height)",display:"flex"}}}function sv($,Z){return{"frimousse-category":"",style:{contain:"content",top:Z?`calc(${$} * var(--frimousse-category-header-height) + ${Z.startRowIndex} * var(--frimousse-row-height))`:void 0,height:Z?`calc(var(--frimousse-category-header-height) + ${Z.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function tv($,Z=!1,J=!0){return{category:$,"frimousse-category-header":"",style:{contain:Z?void 0:"layout paint",height:Z?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:J?"sticky":void 0,top:0}}}function Rv($,Z,J,Q){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${J} * var(--frimousse-row-height) + ${Q} * var(--frimousse-category-header-height))`}}}function yv($,Z,J){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...J},role:"grid"}}function y$0($){$.preventDefault()}var b$0=a0.memo(({Emoji:$,emoji:Z,columnIndex:J,rowIndex:Q})=>{let X=A4(),z=h4(X,(K)=>FM(K)?.emoji===Z.emoji),G=a0.useCallback(()=>{X.get().onEmojiSelect(Z)},[Z]),H=a0.useCallback(()=>{X.get().onActiveEmojiChange("pointer",J,Q)},[J,Q]),Y=a0.useCallback(()=>{X.get().onActiveEmojiReset()},[]);return _5.jsx($,{...nv(Z,J,z),onClick:G,onPointerDown:y$0,onPointerEnter:H,onPointerLeave:Y})}),x$0=a0.memo(({Row:$,Emoji:Z,rowIndex:J})=>{let Q=A4(),X=h4(Q,(z)=>z.data?.rows[J],O$0);return X?_5.jsx($,{...ov(J),children:X.emojis.map((z,G)=>_5.jsx(b$0,{Emoji:Z,columnIndex:G,emoji:z,rowIndex:J},z.label))}):null}),h$0=a0.memo(({CategoryHeader:$,categoryIndex:Z})=>{let J=A4(),Q=h4(J,(z)=>z.data?.categories[Z],NM),X=V9(J,"sticky");return Q?_5.jsx("div",{...sv(Z,Q),children:_5.jsx($,{...tv({label:Q.label},!1,X)})}):null}),bv=a0.memo(({CategoryHeader:$,Row:Z,Emoji:J})=>{let Q=a0.useRef(null),X=A4(),z=V9(X,"columns"),G=a0.useMemo(()=>Array(z).fill({emoji:"\uD83D\uDE42",label:""}),[z]),H=a0.useMemo(()=>({label:"Category"}),[]),Y=a0.useRef(null),K=a0.useRef(null);return S2(()=>{let W=Q.current?.parentElement?.parentElement;if(!W||!Y.current||!K.current)return;let B=new ResizeObserver((F)=>{for(let N of F){let L=N.contentRect.height,{onRowHeightChange:V,onCategoryHeaderHeightChange:M,rowHeight:_,categoryHeaderHeight:O}=X.get();N.target===Y.current&&_!==L&&V(L),N.target===K.current&&O!==L&&M(L)}});B.observe(W),B.observe(Y.current),B.observe(K.current);let{onRowHeightChange:q,onCategoryHeaderHeightChange:U}=X.get();return q(Y.current.clientHeight),U(K.current.clientHeight),()=>{B.disconnect()}},[]),_5.jsxs("div",{"aria-hidden":!0,ref:Q,style:{height:0,visibility:"hidden"},children:[_5.jsx("div",{"frimousse-row-sizer":"",ref:Y,children:_5.jsx(Z,{...ov(-1,!0),children:G.map((W,B)=>_5.jsx(J,{...nv(W,B,!1)},B))})}),_5.jsx("div",{...sv(-1),children:_5.jsx("div",{"frimousse-category-header-sizer":"",ref:K,children:_5.jsx($,{...tv(H,!0)})})})]})});function g$0({category:$,...Z}){return _5.jsx("div",{...Z,children:$.label})}function v$0({emoji:$,...Z}){return _5.jsx("button",{type:"button",...Z,children:$.emoji})}function f$0({...$}){return _5.jsx("div",{...$})}var ev=a0.forwardRef(({style:$,components:Z,...J},Q)=>{let X=A4(),z=a0.useRef(null),G=a0.useCallback((V)=>{V&&(z.current=V,X.set({listRef:z}))},[]),H=Z?.CategoryHeader??g$0,Y=Z?.Emoji??v$0,K=Z?.Row??f$0,W=V9(X,"columns"),B=V9(X,"viewportStartRowIndex"),q=V9(X,"viewportEndRowIndex"),U=h4(X,uv),F=h4(X,_$0,NM),N=a0.useMemo(()=>F?.filter((V)=>V<B).length??0,[F,B]),L=F?.length??0;return a0.useImperativeHandle(Q,()=>z.current),!U||!F||L===0?_5.jsx("div",{...yv(W,0,$),...J,children:_5.jsx("div",{...Rv(0,0,0,0),children:_5.jsx(bv,{CategoryHeader:H,Emoji:Y,Row:K})})}):_5.jsx("div",{...yv(W,U,$),...J,ref:G,children:_5.jsxs("div",{...Rv(U,L,B,N),children:[_5.jsx(bv,{CategoryHeader:H,Emoji:Y,Row:K}),Array.from({length:q-B+1},(V,M)=>{let _=B+M,O=F.indexOf(_);return _5.jsxs(a0.Fragment,{children:[O>=0&&_5.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),_5.jsx(x$0,{Emoji:Y,Row:K,rowIndex:_})]},_)}),Array.from({length:L},(V,M)=>_5.jsx(h$0,{CategoryHeader:H,categoryIndex:M},M))]})})}),$f=a0.forwardRef(({emoji:$,onClick:Z,"aria-label":J="Change skin tone",...Q},X)=>{let z=A4(),G=h4(z,D$0,NM),[H,Y,K]=lv($),W=a0.useMemo(()=>Math.max(0,K.findIndex((L)=>L.skinTone===H)),[H,K]),B=K[W],q=K[(W+1)%K.length].skinTone,U=H==="none"?void 0:G?.[H],F=q==="none"?void 0:G?.[q],N=a0.useCallback((L)=>{Z?.(L),L.isDefaultPrevented()||Y(q)},[Z,Y,q]);return _5.jsx("button",{type:"button",...Q,"aria-label":J+(F?` (${F})`:""),"aria-live":"polite","aria-valuetext":U,"frimousse-skin-tone-selector":"",onClick:N,ref:X,children:B.emoji})});function Zf({children:$,...Z}){let J=A4();return h4(J,M$0)?_5.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function m$0({children:$}){let Z=A4(),J=h4(Z,V$0);return $({search:J})}function Jf({children:$,...Z}){let J=A4();return h4(J,L$0)?_5.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?_5.jsx(m$0,{children:$}):$}):null}function Qf({children:$}){let Z=dv();return $({emoji:Z})}function Xf({children:$,emoji:Z}){let[J,Q,X]=lv(Z);return $({skinTone:J,setSkinTone:Q,skinToneVariations:X})}iv.displayName="EmojiPicker.Root";rv.displayName="EmojiPicker.Search";av.displayName="EmojiPicker.Viewport";ev.displayName="EmojiPicker.List";Zf.displayName="EmojiPicker.Loading";Jf.displayName="EmojiPicker.Empty";$f.displayName="EmojiPicker.SkinToneSelector";Qf.displayName="EmojiPicker.ActiveEmoji";Xf.displayName="EmojiPicker.SkinTone";var RX=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","settings","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],p$0=new Set(RX);function zf($){return p$0.has($)}var Hm={rocket:af,sparkles:tf,bolt:RQ,flame:Cf,star:ef,heart:Rf,diamond:jf,trophy:Qm,target:Zm,bulb:Uf,brain:Bf,robot:rf,wand:zm,atom:Yf,flask:Ef,cpu:Df,code:Af,terminal:pG,api:Hf,database:Pf,cube:Of,hexagon:yf,plug:lf,tool:Jm,settings:yX,bug:qf,activity:Gf,chart:Vf,briefcase:AK,folder:Sf,file:e$,book:Wf,message:vf,mail:hf,bell:Kf,paperclip:LK,key:JB,shield:nf,user:Xm,home:bf,globe:If,world:Gm,planet:df,compass:_f,map:gf,calendar:Ff,cloud:Mf,sun:$m,moon:ff,snowflake:sf,leaf:xf,mountain:mf,feather:Tf,ghost:_K,music:pf,piano:DK,camera:Nf,photo:cf,palette:uf,gamepad:wf,gift:kf,cart:of,chef:Lf},VM=RX.map(($)=>({id:$,Icon:Hm[$]}));function QB($){return $&&zf($)?Hm[$]:null}var MM=[{id:"sunrise",gradient:{angle:140,stops:["#FFE29F","#FFA99F","#FF719A"]}},{id:"ocean",gradient:{angle:135,stops:["#67E8F9","#3B82F6","#4F46E5"]}},{id:"meadow",gradient:{angle:135,stops:["#A7F3D0","#34D399","#059669"]}},{id:"dusk",gradient:{angle:120,stops:["#C471F5","#FA71CD"]}},{id:"midnight",gradient:{angle:135,stops:["#30CFD0","#330867"]}}];function LM($,Z,J){let Q=J*Math.PI/180,X=Z*Math.cos(Q),z=Z*Math.sin(Q),G=($+0.3963377774*X+0.2158037573*z)**3,H=($-0.1055613458*X-0.0638541728*z)**3,Y=($-0.0894841775*X-1.291485548*z)**3;return`#${[4.0767416621*G-3.3077115913*H+0.2309699292*Y,-1.2684380046*G+2.6097574011*H-0.3413193965*Y,-0.0041960863*G-0.7034186147*H+1.707614701*Y].map((W)=>{let B=Math.min(1,Math.max(0,W)),q=B<=0.0031308?12.92*B:1.055*B**0.4166666666666667-0.055;return Math.round(q*255).toString(16).padStart(2,"0")}).join("")}`}function Ym(){let $=Math.random()*360,Z=(35+Math.random()*55)*(Math.random()<0.5?-1:1),J=Math.round(115+Math.random()*55),Q=LM(0.83+Math.random()*0.06,0.09+Math.random()*0.06,$),X=LM(0.5+Math.random()*0.14,0.17+Math.random()*0.07,$+Z);if(Math.random()<0.4){let z=LM(0.7+Math.random()*0.05,0.15,$+Z/2);return{angle:J,stops:[Q,z,X]}}return{angle:J,stops:[Q,X]}}var u$0="radial-gradient(120% 100% at 28% 12%, rgba(255,255,255,0.32), rgba(255,255,255,0) 58%)";function XB($){return`${u$0}, linear-gradient(${$.angle}deg, ${$.stops.join(", ")})`}var G8=256;function Km($,Z){let J=Z.angle*Math.PI/180,Q=Math.sin(J),X=-Math.cos(J),z=G8*(Math.abs(Q)+Math.abs(X))/2,G=G8/2,H=$.createLinearGradient(G-Q*z,G-X*z,G+Q*z,G+X*z),Y=Z.stops.length-1;Z.stops.forEach((W,B)=>H.addColorStop(Y===0?0:B/Y,W)),$.fillStyle=H,$.fillRect(0,0,G8,G8);let K=$.createRadialGradient(G8*0.28,G8*0.12,0,G8*0.28,G8*0.12,G8*1.1);K.addColorStop(0,"rgba(255,255,255,0.32)"),K.addColorStop(0.58,"rgba(255,255,255,0)"),$.fillStyle=K,$.fillRect(0,0,G8,G8)}function Wm($){return new Promise((Z,J)=>{$.toBlob((Q)=>Q?Z(Q):J(Error("Canvas is empty")),"image/png")})}function Bm(){let $=document.createElement("canvas");$.width=G8,$.height=G8;let Z=$.getContext("2d");if(!Z)throw Error("2D canvas unavailable");return[$,Z]}var c$0=0.92,d$0=0.68;async function qm($,Z){let[J,Q]=Bm();if(Z)Km(Q,Z);Q.textAlign="center",Q.textBaseline="middle";let X=Z?d$0:c$0;return Q.font=`${Math.round(G8*X)}px "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,Q.fillText($,G8/2,G8/2+G8*0.04),Wm(J)}function l$0($){return new Promise((Z,J)=>{let Q=new Image;Q.onload=()=>Z(Q),Q.onerror=()=>J(Error("Failed to load SVG")),Q.src=$})}var i$0=0.78,r$0=0.6;async function Um($,Z){let[J,Q]=Bm();if(Z)Km(Q,Z);let X=Z?"#ffffff":"#18181b",z=$.replace(/currentColor/g,X),G=await l$0(`data:image/svg+xml;utf8,${encodeURIComponent(z)}`),H=G8*(Z?r$0:i$0),Y=(G8-H)/2;return Q.drawImage(G,Y,Y,H,H),Wm(J)}var Fm=["\uD83D\uDE80","✨","\uD83D\uDD25","⚡","\uD83D\uDCA1","\uD83E\uDDE0","\uD83E\uDD16","\uD83E\uDE84","\uD83E\uDDEA","⚙️","\uD83D\uDEE0️","\uD83D\uDCBB","\uD83D\uDCE6","\uD83D\uDCCA","\uD83D\uDCC8","\uD83D\uDCDD","\uD83D\uDCDA","\uD83C\uDFAF","\uD83C\uDFC6","\uD83D\uDC8E","\uD83E\uDE90","\uD83C\uDF0D","\uD83E\uDDED","\uD83C\uDFA8","\uD83C\uDFAE","☕"],zB="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var o0=P(c(),1);function a$0({category:$,...Z}){return o0.jsx("div",{className:"bg-background px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",...Z,children:$.label})}function n$0({children:$,...Z}){return o0.jsx("div",{className:"scroll-my-1 px-1.5",...Z,children:$})}function o$0({emoji:$,...Z}){return o0.jsx("button",{className:s("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75 data-active:bg-muted",zB),...Z,children:$.emoji})}function Am({icon:$}){let{workspaceId:Z,provider:J}=X1(),{isPending:Q,mutateAsync:X}=Nv(Z),{isPending:z,mutate:G}=Vv(Z),[H,Y]=P8.useState("emoji"),[K,W]=P8.useState({id:"sunrise",gradient:MM[0].gradient}),[B,q]=P8.useState(null),[U,F]=P8.useState(null),[N,L]=P8.useState(""),[V,M]=P8.useState(null),[_,O]=P8.useState(null),[D,A]=P8.useState(!1),[C,I]=P8.useState(null),y=P8.useRef(null),E=P8.useRef(null),h=P8.useRef(null),k=VM.find((j)=>j.id===V),S=K.gradient!==null,w=Q||z,T=()=>{let j=Ym();q(j),W({id:"shuffle",gradient:j})},R=(j)=>{I(null),h.current=j,Y("upload"),O(URL.createObjectURL(j))};P8.useEffect(()=>{let j=!1,e=async()=>{let x;if(H==="upload"){if(!h.current)return;x=h.current}else if(H==="emoji"){if(!U)return;x=await qm(U,K.gradient)}else{let $0=E.current?.querySelector("svg");if(!$0)return;x=await Um(new XMLSerializer().serializeToString($0),K.gradient)}if(!j)await X(x)};I(null);let t=window.setTimeout(()=>{e().catch((x)=>{if(!j)I(x instanceof Error?x.message:"Failed to save icon")})},150);return()=>{j=!0,window.clearTimeout(t)}},[K.gradient,U,H,X,k,_]),P8.useEffect(()=>{return()=>{if(_)URL.revokeObjectURL(_)}},[_]);let b=()=>{h.current=null,F(null),M(null),O(null),I(null),G()},g=H==="emoji"&&U?"emoji":H==="icon"&&k?"glyph":"image",u=H==="upload"&&_?_:$??M2[J??"claude-code"];return o0.jsxs("div",{className:"flex gap-6",children:[o0.jsxs("div",{className:"flex w-24 shrink-0 flex-col items-center gap-2.5",children:[o0.jsx("div",{className:s("flex size-24 items-center justify-center overflow-hidden rounded-xl",g!=="image"&&!S&&"bg-[repeating-conic-gradient(#0000000d_0%_25%,transparent_0%_50%)] bg-size-[16px_16px]"),style:g!=="image"&&K.gradient?{background:XB(K.gradient)}:void 0,children:g==="emoji"?o0.jsx("span",{className:s("leading-none",zB,S?"text-[64px]":"text-[86px]"),children:U}):g==="glyph"&&k?o0.jsx(k.Icon,{stroke:1.5,className:s(S?"size-14 text-white":"size-18 text-foreground")}):o0.jsx("img",{src:u,alt:"",className:"size-full object-cover"})}),o0.jsx("button",{type:"button",onClick:b,disabled:w,className:"text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:"Reset to default"})]}),o0.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[o0.jsx("div",{className:"flex gap-1 self-start rounded-xl bg-muted p-0.5",children:["emoji","icon","upload"].map((j)=>o0.jsx("button",{type:"button",onClick:()=>Y(j),className:s("rounded-lg px-3.5 py-1 text-xs font-medium capitalize transition-colors",H===j?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j},j))}),o0.jsxs("div",{className:s("flex items-center gap-2",H==="upload"&&"pointer-events-none opacity-35"),children:[o0.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Background"}),o0.jsxs("div",{className:"flex items-center gap-2",children:[o0.jsx("button",{type:"button","aria-label":"No background",onClick:()=>W({id:"none",gradient:null}),className:s("flex size-7 items-center justify-center rounded-full bg-muted ring-offset-2 ring-offset-card transition-shadow",K.id==="none"?"ring-2 ring-primary":"ring-1 ring-border hover:ring-muted-foreground/30"),children:o0.jsx(Vm,{size:16,stroke:1.75,className:"text-muted-foreground"})}),MM.map((j)=>o0.jsx("button",{type:"button","aria-label":`${j.id} background`,onClick:()=>W({id:j.id,gradient:j.gradient}),style:{background:XB(j.gradient)},className:s("size-7 rounded-full ring-offset-2 ring-offset-card transition-shadow",K.id===j.id?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30")},j.id)),o0.jsx("button",{type:"button","aria-label":"Random background",title:"Surprise me",onClick:T,style:B?{background:XB(B)}:void 0,className:s("flex size-7 items-center justify-center rounded-full ring-offset-2 ring-offset-card transition-shadow",B?"text-white":"bg-muted text-muted-foreground ring-1 ring-border",K.id==="shuffle"?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30"),children:o0.jsx(Nm,{size:16,stroke:1.75})})]})]}),H==="emoji"?o0.jsxs(p9.Root,{onEmojiSelect:(j)=>F(j.emoji),emojibaseUrl:"/vendor/emojibase",columns:13,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[o0.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[o0.jsx(p9.Search,{placeholder:"Search emoji…",onChange:(j)=>L(j.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-lg bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),o0.jsx(p9.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),o0.jsxs(p9.Viewport,{className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[o0.jsxs(p9.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[o0.jsx(E1,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),N.trim()===""&&o0.jsxs("div",{className:"border-b border-dashed border-border pb-1.5",children:[o0.jsx("p",{className:"px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:"Favorites"}),o0.jsx("div",{className:"grid grid-cols-13 justify-items-start px-1.5",children:Fm.map((j)=>o0.jsx("button",{type:"button",onClick:()=>F(j),className:s("flex size-9 items-center justify-center rounded-xl text-[22px] transition-colors duration-75",zB,U===j?"bg-primary/10":"hover:bg-accent"),children:j},j))})]}),o0.jsxs(p9.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[o0.jsx(Lm,{size:20,stroke:1.5}),"No emoji found"]}),o0.jsx(p9.List,{className:"pb-1.5 select-none",components:{CategoryHeader:a$0,Row:n$0,Emoji:o$0}})]})]}):H==="icon"?o0.jsx("div",{className:"grid scrollbar-thin h-72 grid-cols-[repeat(auto-fill,minmax(2.25rem,1fr))] content-start gap-1 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:VM.map(({id:j,Icon:e})=>o0.jsx("button",{type:"button","aria-label":j,onClick:()=>M(j),className:s("flex aspect-square items-center justify-center rounded-xl text-muted-foreground transition-colors [&_svg]:size-5",V===j?"bg-primary/10 text-primary":"hover:bg-accent hover:text-accent-foreground"),children:o0.jsx(e,{stroke:1.5})},j))}):o0.jsxs("button",{type:"button",onClick:()=>y.current?.click(),onDragOver:(j)=>{j.preventDefault(),A(!0)},onDragLeave:()=>A(!1),onDrop:(j)=>{j.preventDefault(),A(!1);let e=j.dataTransfer.files?.[0];if(e)R(e)},className:s("flex h-72 flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",D?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[o0.jsx(Mm,{size:24,stroke:1.5}),o0.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),o0.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]}),o0.jsx("div",{className:"min-h-4","aria-live":"polite",children:C?o0.jsx("p",{className:"text-xs text-destructive",children:C}):w?o0.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving…"}):null})]}),o0.jsx("input",{ref:y,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(j)=>{let e=j.target.files?.[0];if(e)R(e);j.target.value=""}}),o0.jsx("span",{ref:E,"aria-hidden":!0,className:"hidden",children:k&&o0.jsx(k.Icon,{stroke:1.5})})]})}var A8=P(c(),1);function Dm(){let{name:$,icon:Z,cwd:J,workspaceId:Q}=X1(),[,X]=f4(),z=Fv(Q),G=mO(),[H,Y]=_m.useState($??"");return A8.jsxs(yZ,{title:"General",description:"Basic details for this space.",children:[A8.jsxs(bZ,{children:[A8.jsx(xZ,{title:"Name",description:"Shown in the sidebar and the workspace header.",control:A8.jsx(Y6,{value:H,onChange:(B)=>Y(B.target.value),onBlur:()=>{let B=H.trim();if(B===($??""))return;z.mutate(B===""?null:B)},onKeyDown:(B)=>{if(B.key==="Enter")B.currentTarget.blur()},placeholder:"Space name",className:"w-56"})}),A8.jsx(xZ,{title:"Path",control:A8.jsx(Y6,{value:J??"",readOnly:!0,"aria-label":"Workspace path",title:J??void 0,className:"w-56"})}),A8.jsxs("div",{className:"flex flex-col gap-4 px-3.5 py-3.5",children:[A8.jsxs("div",{className:"flex flex-col",children:[A8.jsx("span",{className:"text-sm font-medium",children:"Icon"}),A8.jsx("span",{className:"text-xs text-muted-foreground",children:"Pick an emoji or a glyph on a generated background, or upload an image."})]}),A8.jsx(Am,{icon:Z})]})]}),A8.jsxs(bZ,{label:"Danger zone",children:[A8.jsx(xZ,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:A8.jsxs(C0,{type:"button",variant:"destructive",size:"sm",onClick:()=>{let q=`Remove "${$??J??"this space"}" from your workspaces?
|
|
80
|
+
|
|
81
|
+
This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time.`;if(!window.confirm(q))return;G.mutate(Q,{onSuccess:()=>X("/")})},disabled:G.isPending,children:[G.isPending&&A8.jsx(E1,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})}),G.isError&&A8.jsx("p",{className:"px-3.5 py-3 text-xs text-destructive",children:G.error.message})]})]})}var U1=P(c(),1),s$0=[{id:"general",label:"General",icon:yX},{id:"connectors",label:"Connectors",icon:oW},{id:"environment",label:"Environment",icon:JB}];function Om(){let[$,Z]=AM.useState(!1),[J,Q]=AM.useState("general");return U1.jsxs(U1.Fragment,{children:[U1.jsxs(A1,{children:[U1.jsx(_1,{render:U1.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Settings",onClick:()=>Z(!0),children:U1.jsx(yX,{stroke:1.75})})}),U1.jsx(D1,{children:"Settings"})]}),U1.jsx(z6,{open:$,onOpenChange:Z,children:U1.jsxs(z$,{className:"flex h-[min(680px,90vh)] w-[880px] max-w-[94vw]",children:[U1.jsx(G6,{className:"sr-only",children:"Space settings"}),U1.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r border-border bg-muted/30 p-3",children:[U1.jsx("p",{className:"px-2.5 pt-4 pb-2 text-[11px] font-semibold tracking-wider text-muted-foreground/80 uppercase",children:"Settings"}),s$0.map((X)=>U1.jsxs(C0,{type:"button",variant:J===X.id?"secondary":"ghost",size:"sm",onClick:()=>Q(X.id),className:"justify-start",children:[U1.jsx(X.icon,{stroke:1.75}),X.label]},X.id))]}),U1.jsxs("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:[U1.jsxs("div",{className:"px-8 py-7",children:[J==="general"&&U1.jsx(Dm,{}),J==="connectors"&&U1.jsx(Xv,{}),J==="environment"&&U1.jsx(Av,{})]}),U1.jsx(X$,{render:U1.jsx(C0,{variant:"ghost",size:"icon","aria-label":"Close",className:"absolute top-3 right-3",children:U1.jsx(C1,{stroke:1.5})})})]})]})})]})}function t$0($){if($.status==="available")return null;if($.status==="checking")return"this workspace's agent availability has not resolved yet";return"this workspace's agent is unavailable"}function Pm({send:$,revealChat:Z,composerAvailability:J}){let Q=n5();JY(Q,"sendChatMessage",(X)=>{let z=t$0(J);if(z){V2(Q,{source:"runtime",message:`sendChatMessage("${X.message}") was dropped: ${z}.`});return}let{message:G,...H}=X;Z(),$(G,{applet:H})})}var gZ=P(v(),1);var Sm=P(v(),1);function GB($,Z){let J=$??[];if(J.findIndex((X)=>X.id===Z.id)===-1)return[...J,Z];return J.map((X)=>X.id===Z.id&&X.updatedAt<=Z.updatedAt?Z:X)}function HB($){let Z=s0();return J8((J)=>{if(J.type==="view-builder:updated"&&J.workspaceId===$)Z.setQueryData(E0.viewBuilders($),(Q)=>GB(Q,J.builder));else if(J.type==="view-builder:deleted"&&J.workspaceId===$)Z.setQueryData(E0.viewBuilders($),(Q)=>(Q??[]).filter((X)=>X.id!==J.builderId))}),$1({queryKey:E0.viewBuilders($),queryFn:async()=>{return(await O5(`/api/workspaces/${$}/view-builders`)).builders},...I4})}function wm($){let Z=s0();return Z1({mutationFn:()=>O5(`/api/workspaces/${$}/view-builders`,a1("POST"),"Failed to create view builder"),onSuccess:(J)=>{Z.setQueryData(E0.viewBuilders($),(Q)=>GB(Q,J))}})}function jm($){let Z=s0();return Z1({mutationFn:({builderId:J,requirements:Q})=>O5(`/api/workspaces/${$}/view-builders/${J}`,a1("PATCH",{input:{requirements:Q}}),"Failed to save view requirements"),onSuccess:(J)=>{Z.setQueryData(E0.viewBuilders($),(Q)=>GB(Q,J))}})}function Tm($){let Z=s0();return Z1({mutationFn:({builderId:J,requirements:Q,...X})=>O5(`/api/workspaces/${$}/view-builders/${J}/submit`,a1("POST",{input:{requirements:Q},availableIcons:RX,...X}),"Failed to start view builder"),onSuccess:(J)=>{Z.setQueryData(E0.viewBuilders($),(Q)=>GB(Q,J))}})}function Cm($){let Z=s0();return Z1({mutationFn:(J)=>C4(`/api/workspaces/${$}/view-builders/${J}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:(J,Q)=>{Z.setQueryData(E0.viewBuilders($),(X)=>(X??[]).filter((z)=>z.id!==Q))}})}var Em=new Map;function e$0($){let Z=Em.get($)??[];return Em.delete($),Z}function $Z0($,Z=[]){return[...e$0($),...Z]}function ZZ0($,Z){if(!$.startsWith("view:"))return;return Object.keys(Z).length>0?Z:void 0}function JZ0($,Z,J){if($.startsWith("view:"))return Z?.find((Q)=>Q.id===$.slice(5))?.config.title||void 0;if($.startsWith("view-builder:"))return J?.find((Q)=>Q.id===$.slice(13))?.title||void 0;return}function km({activeTab:$,appletParams:Z}){let J=n5(),Q=HY(J).data,X=HB(J).data;return Sm.useCallback((z={})=>{let G=$Z0(J,z.directives??[]),H=ZZ0($,Z);return{activeTab:$,tabTitle:JZ0($,Q,X),...H?{tabParams:H}:{},...z.applet?{applet:z.applet}:{},...G.length>0?{directives:G}:{}}},[J,$,Z,Q,X])}var Im=!0;function Rm($,Z=[]){return($.trim()||Z.filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,64).trimEnd()}function YB($){return!$?.applet}function KB($,Z,J){if(!YB(J))return[];return(T5.getState().attachments[o8($,Z)]??[]).filter((X)=>X.status==="ready"&&X.upload)}function WB($){return $.map((Z)=>{if(Z.upload?.kind==="image"&&Z.previewUrl)return{type:"file",mediaType:Z.mediaType,url:Z.previewUrl,filename:Z.name};return{type:"file",mediaType:Z.mediaType,url:"",filename:Z.name}})}function ym($,Z){if(!YB($))return $;let J=[],Q=[],X=0;for(let G of Z){if(G.upload?.kind!=="image")continue;if(X+=1,G.kind==="drawing"&&G.purpose==="annotation")J.push(`${X}. ${JSON.stringify(G.sourceTab)}`);if(G.kind==="drawing"&&G.purpose==="sketch")Q.push(`${X}. ${JSON.stringify(G.sourceTab)}`)}if(J.length===0&&Q.length===0)return $;let z=[...$?.directives??[]];if(J.length>0)z.push(`Annotation attachment sources in attachment order: ${J.join("; ")}.`);if(Q.length>0)z.push(`Sketch attachment sources in attachment order: ${Q.join("; ")}. Each sketch shows the intended layout of a new view.`);return{...$,directives:z}}function BB({queryClient:$,workspaceId:Z,sessionId:J,parts:Q}){let X=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(E0.events(Z,J),(z)=>CJ(z??TJ(),{kind:"turn",turn:{id:X,role:"user",origin:{kind:"user-input"},parts:Q,timestamp:new Date().toISOString()}})),T5.getState().setActivity(Z,J,"running"),T5.getState().setError(Z,J,null),X}function qB({queryClient:$,workspaceId:Z,sessionId:J,text:Q,filenames:X=[]}){let z=Rm(Q,X);if(!z)return;$.setQueryData(E0.sessions(Z),(G)=>[{sessionId:J,summary:z,lastModified:Date.now()},...(G??[]).filter((H)=>H.sessionId!==J)])}function UB($,Z,J,Q){let X=$?.models,z=!Z||!X||X.some((W)=>W.value===Z)?Z:void 0,G=X?.find((W)=>W.value===z),H=J&&(!G||(G.supportedEffortLevels??[]).includes(J))?J:void 0,Y=Q===void 0||!G||G.supportsFastMode?Q:!1,K=Im&&$?.supportsStreaming?!0:void 0;return{model:z,effort:H,...Y!==void 0?{fastMode:Y}:{},stream:K}}function QZ0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function bm($){let Z=QZ0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var XZ0=TJ();function xm($){let Z=n5(),J=s0(),{layout:Q}=X1(),[X,z]=Q6(),G=X??null,H=G9(Z).data,Y=_Y(Z).data,K=km($),W=T4((A)=>G?A.activity[`${Z}:${G}`]??"idle":"idle"),B=PJ(W),q=T4((A)=>G?A.errors[`${Z}:${G}`]??null:null),U=rC(Z,G),F=U.data??XZ0,N=Y!==void 0&&(G===null||U.data!==void 0),L=T4((A)=>A.previews),V=gZ.useMemo(()=>bm(OO(L,Z,G).root),[L,Z,G]),M=DY(Z,G).data,_=gZ.useCallback((A,C)=>{let I=A.trim(),y=KB(Z,G,C);if(!I&&y.length===0)return;let E=G,h=!1;if(!E)E=crypto.randomUUID(),h=!0,z(E),qB({queryClient:J,workspaceId:Z,sessionId:E,text:I,filenames:y.map((e)=>e.name)});let k=WB(y);if(I)k.push({type:"text",text:I});let S=BB({queryClient:J,workspaceId:Z,sessionId:E,parts:k}),w=M?.model??Q.selectedModel,T=M?.effort??Q.selectedEffort,R=M?.fastMode??Q.selectedFastMode,{model:b,effort:g,fastMode:u,stream:j}=UB(H,w,T,R);if(UG({type:"chat",workspaceId:Z,content:I,sessionId:E,isNew:h,optimisticId:S,model:b,effort:g,fastMode:u,stream:j,context:K(ym(C,y)),...y.length>0?{attachments:y.map((e)=>e.upload.id)}:{}}),O1.getState().markMessageSentFromMoi(Z),h)J.invalidateQueries({queryKey:E0.preview(Z)});if(YB(C))T5.getState().clearAttachments(Z,G)},[G,Z,J,Q.selectedModel,Q.selectedEffort,Q.selectedFastMode,K,M?.model,M?.effort,M?.fastMode,z,H]),O=gZ.useCallback(()=>{if(!G)return;T5.getState().setError(Z,G,null)},[G,Z]),D=gZ.useCallback(()=>{if(!B||!G)return;UG({type:"stop",workspaceId:Z,sessionId:G})},[B,G,Z]);return{view:F,chatLoaded:N,previewTurn:V,sessionId:G,processing:B,error:q,send:_,stop:D,selectSession:z,dismissError:O}}var gm=P(v(),1);var H8=P(v(),1);function hm({active:$,builderId:Z,sessionId:J,sourceTab:Q,workspaceId:X,onEditingStart:z,onContinueInChat:G}){let H=H8.useRef(`sketch:${Z}`),Y=H8.useRef(0),K=H8.useRef(null),W=H8.useRef(null),B=H8.useRef(!0),[q,U]=H8.useState(!1),F=H8.useRef(z),N=H8.useRef(G);F.current=z,N.current=G;let L=H8.useCallback((I)=>{if(!B.current)return;if(!I){Y.current+=1,K.current=null,W.current=null,T5.getState().removeAttachment(X,J,H.current);return}qY({workspaceId:X,sessionId:J,localId:H.current,purpose:"sketch",sourceTab:Q,blob:I})},[J,Q,X]),V=H8.useCallback((I)=>{if(!I)return W.current??Promise.resolve();if(I===K.current){if(T5.getState().attachments[o8(X,J)]?.some((k)=>k.localId===H.current&&(k.status==="ready"||k.status==="uploading")))return W.current??Promise.resolve()}K.current=I;let y=++Y.current,E=UY({workspaceId:X,sessionId:J,localId:H.current,purpose:"sketch",sourceTab:Q,blob:I,isCurrent:()=>Y.current===y});return W.current=E,E},[J,Q,X]),M=WY({mode:"sketch",onChange:L,onEditingStart:()=>F.current()}),{controls:_}=M,O=H8.useCallback(async()=>{await V(await _.flush())},[_,V]),D=H8.useCallback(async()=>{await V(await _.deactivate())},[_,V]),A=H8.useCallback(async()=>{if(q)return;U(!0);try{await D(),N.current()}finally{U(!1)}},[q,D]),C=H8.useCallback(async()=>{B.current=!1,Y.current+=1,K.current=null,W.current=null,T5.getState().removeAttachment(X,J,H.current);try{await _.cancel()}finally{B.current=!0}},[_,J,X]);return H8.useEffect(()=>{if(!$&&_.active)D()},[$,_.active,D]),{...M,continuing:q,continueInChat:A,prepareForSend:O,resetDocument:C}}var G1=P(c(),1);function vm({ref:$,active:Z,builder:J,chatDocked:Q,workspaceId:X,onEditingStart:z,onContinueInChat:G,onOpenChat:H,onDiscard:Y}){let K=hm({active:Z&&J.status==="draft",builderId:J.id,sessionId:J.sessionId,sourceTab:s3(J.id),workspaceId:X,onEditingStart:z,onContinueInChat:G});switch(gm.useImperativeHandle($,()=>({prepareSketchForSend:K.prepareForSend,resetSketch:K.resetDocument}),[K.prepareForSend,K.resetDocument]),J.status){case"ready":return null;case"draft":case"waiting":case"building":return G1.jsx(zZ0,{active:Z,chatDocked:Q,error:J.error,sketch:K,status:J.status,onDiscard:Y,onOpenChat:H})}}function zZ0({active:$,chatDocked:Z,error:J,sketch:Q,status:X,onDiscard:z,onOpenChat:G}){let H=X==="draft";return G1.jsxs("div",{className:s("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[H&&G1.jsx(GZ0,{chatDocked:Z,sketch:Q}),G1.jsx("div",{inert:H?void 0:!0,className:s("absolute inset-0",X==="building"&&"pointer-events-none opacity-50",X==="waiting"&&"invisible"),children:G1.jsx(YY,{...Q.layerProps,children:H&&G1.jsx(BY,{controls:Q.controls,title:"Sketch the view",busy:Q.continuing,onComplete:()=>void Q.continueInChat()})})}),G1.jsx("div",{"aria-hidden":!0,className:s("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",X==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),X==="building"&&G1.jsx(YZ0,{controls:Q.controls}),X==="waiting"&&G1.jsx(HZ0,{error:J,onDiscard:z,onOpenChat:G})]})}function GZ0({chatDocked:$,sketch:Z}){let{hasStrokes:J}=OQ(Z.controls);return G1.jsx("div",{ref:Z.targetRef,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:!Z.controls.active&&!J&&G1.jsxs("div",{className:s("mb-4 flex h-full flex-col items-center justify-center gap-2 p-12 text-center text-sm text-muted-foreground","bg-radial from-background from-10% to-transparent",$?"w-full":"mr-auto w-[calc(100%-var(--chat-max))]"),children:[G1.jsx(yQ,{size:56,stroke:0.5}),G1.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function HZ0({error:$,onDiscard:Z,onOpenChat:J}){return G1.jsx(fm,{children:G1.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-12 text-center",children:[G1.jsxs("div",{className:"flex flex-col gap-1",children:[G1.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),G1.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),G1.jsxs("div",{className:"flex gap-2",children:[G1.jsx(C0,{onClick:J,children:"Open chat"}),G1.jsx(C0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function YZ0({controls:$}){let{hasStrokes:Z}=OQ($);return G1.jsx(fm,{children:!Z&&G1.jsx(D2,{className:"size-6 text-muted-foreground"})})}function fm({children:$,className:Z}){return G1.jsx("div",{className:s("relative flex min-h-0 flex-1 items-center justify-center texture-checker-20",Z),children:$})}var _4=P(v(),1);function mm($,{activeId:Z,available:J,now:Q}){let X=[];if(Z!==null&&J.has(Z))X.push({id:Z,releasedAt:null});for(let z of $){if(z.id===Z||!J.has(z.id))continue;let G=z.releasedAt??Q;if(Q-G>=60000)continue;if(X.length>=4)break;X.push({id:z.id,releasedAt:G})}return X}function pm($,Z){let J=null;for(let{releasedAt:Q}of $){if(Q===null)continue;let X=Q+60000;if(J===null||X<J)J=X}return J===null?null:Math.max(0,J-Z)}function um($,Z){return $.length===Z.length&&$.every((J,Q)=>{let X=Z[Q];return J.id===X.id&&J.releasedAt===X.releasedAt})}var w8=P(c(),1);function dm({views:$,activeViewId:Z,params:J}){let Q=KZ0(Z,$),X=new Set(Q.map((z)=>z.id));return w8.jsx("div",{className:s("relative min-h-0 flex-1 overflow-hidden",!Z&&"hidden"),children:$.filter((z)=>X.has(z.id)).map((z)=>w8.jsx(WZ0,{view:z,active:z.id===Z,params:J},z.id))})}function KZ0($,Z){let[J,Q]=_4.useState([]),X=_4.useRef(Z);X.current=Z;let z=Z.map((H)=>H.id).join(`
|
|
82
|
+
`),G=_4.useCallback(()=>{Q((H)=>{let Y=mm(H,{activeId:$,available:new Set(X.current.map((K)=>K.id)),now:Date.now()});return um(H,Y)?H:Y})},[$]);return _4.useEffect(()=>{G()},[z,G]),_4.useEffect(()=>{let H=pm(J,Date.now());if(H===null)return;let Y=setTimeout(G,H);return()=>clearTimeout(Y)},[G,J]),J}function WZ0({view:$,active:Z,params:J}){let Q=n5(),X=uT($.id),{current:z,outgoing:G}=qZ0(X,Z),[H,Y]=_4.useState(J);if(Z&&H!==J)Y(J);IW(XY("views",Q,$.id),z?.version??X.version,Z);let K=X.status==="error";return SW({kind:"view",enabled:Z&&Boolean(z)&&!K,targets:[{id:$.id,revision:$.revision}]}),w8.jsxs(w8.Fragment,{children:[Z&&K&&w8.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:X.error}),Z&&!K&&!z&&w8.jsx(UZ0,{}),z&&!K&&w8.jsxs(_4.Activity,{mode:Z?"visible":"hidden",children:[G&&w8.jsx(cm,{view:$,build:G,params:H},G.version),w8.jsx(cm,{view:$,build:z,params:H,entering:G!==null,thumbnailTarget:!0},z.version)]})]})}function cm({view:$,build:Z,params:J,entering:Q,thumbnailTarget:X}){let z=n5();return w8.jsx("div",{"data-applet-thumbnail":X?`view:${$.id}`:void 0,"data-applet":zY("views",$.id),className:s("absolute inset-0 isolate overflow-auto",Q&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:w8.jsx(FX,{name:$.id,kind:"view",workspaceId:z,resetKey:Z.version,children:w8.jsx(Z.Component,{params:J})})})}var BZ0=200;function qZ0($,Z){let[J,Q]=_4.useState({current:null,outgoing:null});if($.status==="ready"&&J.current?.version!==$.version){let X={Component:$.Component,version:$.version};Q((z)=>({current:X,outgoing:Z?z.current:null}))}return _4.useEffect(()=>{if(!J.outgoing)return;let X=setTimeout(()=>Q((z)=>({...z,outgoing:null})),BZ0);return()=>clearTimeout(X)},[J.outgoing]),J}function UZ0(){return w8.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:w8.jsx(D2,{className:"text-muted-foreground"})})}function lm(){let $=s0(),{workspaceId:Z,layout:J}=X1(),[,Q]=Q6(),X=G9(Z).data,z=wm(Z),G=jm(Z),H=Tm(Z),Y=Cm(Z);return{create:()=>z.mutateAsync(),save:(U,F)=>G.mutateAsync({builderId:U,requirements:F}),submit:async(U,F)=>{let N=F.trim(),L=KB(Z,U.sessionId);if(!N&&L.length===0)return;qB({queryClient:$,workspaceId:Z,sessionId:U.sessionId,text:N,filenames:L.map((C)=>C.name)});let V=WB(L);if(N)V.push({type:"text",text:N});let M=BB({queryClient:$,workspaceId:Z,sessionId:U.sessionId,parts:V});Q(U.sessionId);let{model:_,effort:O,fastMode:D,stream:A}=UB(X,J.selectedModel,J.selectedEffort,J.selectedFastMode);try{await H.mutateAsync({builderId:U.id,requirements:N,optimisticId:M,...L.length>0?{attachments:L.map((C)=>C.upload.id)}:{},model:_,effort:O,fastMode:D,stream:A}),T5.getState().clearAttachments(Z,U.sessionId)}catch(C){throw T5.getState().setActivity(Z,U.sessionId,"idle"),T5.getState().setError(Z,U.sessionId,C instanceof Error?C.message:"Could not start view builder"),C}},discard:(U)=>Y.mutateAsync(U)}}var L9=P(v(),1);function im({builders:$,onSave:Z}){let J=L9.useRef(new Map),Q=L9.useRef($),X=L9.useRef(Z);Q.current=$,X.current=Z;let z=L9.useCallback((H)=>{let Y=J.current.get(H);if(Y)clearTimeout(Y);J.current.delete(H),O1.getState().setViewBuilderDraft(H,null)},[]),G=L9.useCallback((H,Y)=>{O1.getState().setViewBuilderDraft(H,Y);let K=J.current.get(H);if(K)clearTimeout(K);J.current.set(H,setTimeout(()=>{J.current.delete(H);let W=Q.current.find((B)=>B.id===H);if(!W||W.status!=="draft")return;X.current(H,Y).catch(()=>{l4.add({title:"Couldn’t save view description",type:"error"})})},500))},[]);return L9.useEffect(()=>{for(let H of $)if(H.status!=="draft")z(H.id)},[$,z]),L9.useEffect(()=>()=>{for(let H of J.current.values())clearTimeout(H)},[]),{change:G,clear:z}}var vZ=P(v(),1);function _M($){let Z=document.documentElement,J=getComputedStyle(Z).getPropertyValue($).trim(),Q=Number.parseFloat(J);if(!Number.isFinite(Q))return 0;return J.endsWith("rem")?Q*Number.parseFloat(getComputedStyle(Z).fontSize):Q}function rm(){let $=vZ.useRef(null),[Z,J]=vZ.useState(null);return vZ.useLayoutEffect(()=>{let Q=$.current;if(!Q)return;let X=(G)=>{let H=_M("--column-w"),Y=_M("--chat-min"),K=_M("--chat-max"),W={fits:G-Y>=H,workspaceMinWidth:H,chatMinWidth:Y,chatMaxWidth:K};J((B)=>B?.fits===W.fits&&B.workspaceMinWidth===W.workspaceMinWidth&&B.chatMinWidth===W.chatMinWidth&&B.chatMaxWidth===W.chatMaxWidth?B:W)};X(Q.getBoundingClientRect().width);let z=()=>X(Q.getBoundingClientRect().width);return window.addEventListener("resize",z),()=>window.removeEventListener("resize",z)},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}var am=P(c(),1);function DM({agentUnavailable:$,chatError:Z,skillUpdate:J}){return $??Z??J}function O7({className:$,...Z}){return am.jsx("div",{...Z,className:s("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var fZ=P(c(),1);function nm({error:$,onDismiss:Z}){return fZ.jsxs(O7,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[fZ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),fZ.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:fZ.jsx(C1,{stroke:1.75})})]})}var bX=P(v(),1);var u9=P(c(),1);function sm({availability:$,login:Z,onStartLogin:J}){let[Q,X]=bX.useState("idle"),[z,G]=bX.useState(null);bX.useEffect(()=>{if(Z?.state!=="pending")X("idle")},[Z?.state]);let H=Z?.state==="pending"||Q==="waiting",Y=Z?.state==="failed"?Z.reason:null,K=H||Q==="starting",W=async()=>{let B=window.open("about:blank","moi-agent-login");if(B)B.opener=null;X("starting"),G(null);try{let q=await J();if(q.url){if(!B)throw Error("Allow pop-ups, then try again");B.location.href=q.url}else B?.close();X("waiting")}catch(q){B?.close(),X("idle"),G(q instanceof Error?q.message:"Could not start sign-in")}};return u9.jsxs(O7,{role:"alert",className:"flex items-center gap-2",children:[u9.jsx(om,{size:20,stroke:1.5}),u9.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[u9.jsx("div",{className:"wrap-break-word",children:"Log in to your agent to send messages"}),(z??Y)&&u9.jsx("div",{className:"wrap-break-word text-destructive",children:z??Y})]}),$.loginCommand&&u9.jsxs(C0,{type:"button",size:"sm",onClick:()=>void W(),disabled:K,children:[K&&u9.jsx(E1,{stroke:1.75,className:"animate-spin"}),Q==="starting"?"Opening browser to sign in…":H?"Waiting for log in…":"Log in"]})]})}var j8=P(c(),1);function em({error:$,pendingAction:Z,onUpdate:J,onDismiss:Q}){if(!$&&Z==="auto")return j8.jsxs(O7,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[j8.jsx(E1,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),j8.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let X=Z!==null;return j8.jsxs(O7,{role:$?"alert":"status",className:s("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[j8.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[j8.jsx(tm,{size:20,stroke:1.5,className:"shrink-0"}),$?j8.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):j8.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),j8.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Q,className:"col-start-2 row-start-1 -mt-1 -mr-1 text-muted-foreground hover:text-foreground @xl:order-4 @xl:m-0","aria-label":"Dismiss skill update",children:j8.jsx(C1,{stroke:1.75})}),j8.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[j8.jsxs(C0,{type:"button",variant:"default",size:"sm",onClick:()=>J("auto"),disabled:X,className:"@xl:order-2",children:[Z==="auto"&&j8.jsx(E1,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),j8.jsxs(C0,{type:"button",variant:"secondary",size:"sm",onClick:()=>J("once"),disabled:X,className:"@xl:order-3",children:[Z==="once"&&j8.jsx(E1,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var J3=P(v(),1);function OM($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function FZ0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function NZ0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function $p($){let Z=iT($),{isPending:J,mutate:Q,reset:X}=rT($),z=Wv(),{mutate:G}=Bv(),H=z.data!==void 0,Y=z.data?.autoUpdateSkills??!1,K=J3.useCallback(()=>G({autoUpdateSkills:!0}),[G]),[W,B]=J3.useState(()=>OM($)),q=W.workspaceId===$?W:OM($);J3.useEffect(()=>{B(OM($)),X()},[$,X]);let U=J3.useCallback((L)=>{if(J)return;if(L==="auto")K();B({workspaceId:$,phase:"active",pendingAction:L,error:null}),Q(void 0,{onSuccess:()=>{B((V)=>V.workspaceId===$?{...V,phase:"dismissed",pendingAction:null,error:null}:V)},onError:(V)=>{B((M)=>M.workspaceId===$&&M.phase!=="dismissed"?{...M,phase:"active",pendingAction:null,error:V.message}:M)}})},[K,J,Q,$]),F=Z.data?.updateAvailable??!1;return J3.useEffect(()=>{if(H&&NZ0({updateAvailable:F,autoUpdateEnabled:Y,updatePending:J,phase:q.phase}))U("auto")},[Y,q.phase,U,H,F,J]),{bannerProps:H&&FZ0({updateAvailable:F,autoUpdateEnabled:Y,phase:q.phase})?{error:q.error,pendingAction:q.pendingAction,onUpdate:U,onDismiss:()=>{B((L)=>L.workspaceId===$?{...L,phase:"dismissed",pendingAction:null,error:null}:L)}}:null}}var FB=P(c(),1);function Zp($,{chatError:Z,onDismissChatError:J}){let{data:Q,error:X}=G9($),z=Q?.availability,{bannerProps:G}=$p($),H=z?.available===!1?z:void 0;if(X)H={available:!1,reason:`Could not check agent status: ${X.message}`};let Y={status:"checking"};if(H)Y={status:"unavailable"};else if(z)Y={status:"available"};let K=H?{tone:"default",content:FB.jsx(sm,{availability:H,login:Q?.login,onStartLogin:()=>lT($)})}:void 0,W=Z?{tone:"error",content:FB.jsx(nm,{error:Z,onDismiss:J})}:void 0,B=G?{tone:"default",content:FB.jsx(em,{...G})}:void 0,q=DM({agentUnavailable:K,chatError:W,skillUpdate:B}),U=DM({agentUnavailable:K,skillUpdate:B});return{composerAvailability:Y,composerBanner:q,builderComposerBanner:U}}var PM=DF();function NB($){if(!$||!Array.isArray($.open))return PM;let Z=$.open.filter((J,Q,X)=>X.indexOf(J)===Q);if(Z.length===0)return PM;return{open:Z,active:Z.includes($.active)?$.active:Z[0]}}function xX($,Z,J){if($==="agent"||$==="widgets"||$==="scratchpad")return!0;let Q=t3($);if(Q)return J.some((z)=>z.id===Q);let X=j6($);return X?Z.some((z)=>z.id===X):!1}function VB($,Z,J){let Q=$.open.filter((X)=>xX(X,Z,J));return Q.length>0?Q:PM.open}function Jp($){if(!$)return!1;let Z=_Q($);return Z===null||j6(Z)!==null}function Qp($,Z,J,Q,X){if($!==null&&xX($,J,Q)&&!(X&&$==="agent"))return $;let z=VB(Z,J,Q),G=X?z.filter((H)=>H!=="agent"):z;return G.includes(Z.active)?Z.active:G[0]??"agent"}var M9=P(v(),1);function Xp({views:$,builders:Z,split:J}){let{layout:Q,setLayout:X,workspaceId:z}=X1(),[,G]=f4(),H=dB()["*"]??null,Y=wA(),K=M9.useMemo(()=>RT(Y),[Y]),W=NB(Q.tabs),B=M9.useRef(W);B.current=W;let q=_Q(H),U=Qp(q,W,$,Z,J),F=q!==null&&q===U,N=M9.useCallback((V,M)=>{G(IT(z,V),{replace:!0,...M?{state:{appletParams:M}}:{}})},[G,z]),L=M9.useCallback((V)=>{B.current=V,X({tabs:V})},[X]);return M9.useEffect(()=>{if(H===U)return;if(Jp(H))VZ0(z,H,U);N(U)},[U,N,H,z]),M9.useEffect(()=>{if(!F)return;let V=B.current,M=V.open.includes(U)?V.open:[...V.open,U];if(M===V.open&&V.active===U)return;L({open:M,active:U})},[U,L,F]),{tabsState:W,activeTab:U,appletParams:K,navigateToTab:N,setTabs:L}}function VZ0($,Z,J){let Q=_Q(Z),X=Q?j6(Q):null;V2($,{source:"runtime",...X?{kind:"view",name:X}:{},message:`Tab "${Z}" does not exist in this workspace — the URL redirected to "${J}". A link, bookmark, or focusTab call is pointing at a tab that was deleted or renamed.`})}var H1=P(c(),1),LZ0=Gp([ZQ({variant:"ghost",size:"sm"}),"group/tab min-w-0"],{variants:{active:{true:"bg-accent text-accent-foreground"},dragging:{true:"invisible"},preview:{true:"cursor-grabbing ring-1 ring-border"}},compoundVariants:[{preview:!0}]});function MZ0({items:$}){return H1.jsxs(u$,{children:[H1.jsx(c$,{render:H1.jsx(C0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:H1.jsx(W4,{stroke:1.75})})}),H1.jsx(d$,{align:"start",className:"min-w-48",children:H1.jsx(l$,{children:$.map(({key:Z,Icon:J,label:Q,onClick:X})=>H1.jsxs(CQ,{onClick:X,className:"font-medium",children:[H1.jsx(J,{stroke:2}),Q]},Z))})})]})}function zp($){let{tab:Z,active:J}=$,Q=$.preview===!0;return H1.jsxs("button",{type:"button","aria-hidden":Q||void 0,"aria-label":Z.label,disabled:Q,tabIndex:Q?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:LZ0({active:J,dragging:$.preview?!1:$.state.isDragging,preview:Q}),...$.preview?{}:$.state.dragHandleProps,children:[H1.jsxs("div",{className:s("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.Icon===C6?H1.jsx(C6,{"data-icon":"inline-start",stroke:2,animated:Z.loading}):Z.loading?H1.jsx(D2,{"data-icon":"inline-start"}):H1.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2}),H1.jsx("span",{className:s("truncate",Z.closable&&"group-hover/tab:-mr-3 group-hover/tab:mask-r-from-[calc(100%-24px)] group-hover/tab:mask-r-to-[calc(100%-12px)]"),children:Z.label})]}),Z.closable&&H1.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:Q?-1:void 0,className:s("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",Q&&"pointer-events-none"),onClick:$.preview?void 0:(X)=>{X.stopPropagation(),$.onClose(Z.key)},children:H1.jsx(C1,{stroke:1.75})})]})}function Hp({tabs:$,active:Z,createItems:J,onSelect:Q,onClose:X,onReorder:z}){return H1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[H1.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:H1.jsx(QH,{items:$,getId:(G)=>G.key,className:"flex w-max items-center gap-1",onReorder:(G)=>z(G),renderPlaceholder:()=>H1.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(G)=>H1.jsx(zp,{tab:G,active:Z===G.key,preview:!0}),renderItem:(G,H)=>H1.jsx(zp,{tab:G,active:Z===G.key,state:H,onSelect:Q,onClose:X})})}),H1.jsx("div",{className:"shrink-0",children:H1.jsx(MZ0,{items:J})})]})}var z3=P(v(),1);var dZ=P(c(),1),U5=P(v(),1);function AZ0($,Z){let J=getComputedStyle($),Q=parseFloat(J.fontSize);return Z*Q}function _Z0($,Z){let J=getComputedStyle($.ownerDocument.documentElement),Q=parseFloat(J.fontSize);return Z*Q}function DZ0($){return $/100*window.innerHeight}function OZ0($){return $/100*window.innerWidth}function PZ0($){switch(typeof $){case"number":return[$,"px"];case"string":{let Z=parseFloat($);return $.endsWith("%")?[Z,"%"]:$.endsWith("px")?[Z,"px"]:$.endsWith("rem")?[Z,"rem"]:$.endsWith("em")?[Z,"em"]:$.endsWith("vh")?[Z,"vh"]:$.endsWith("vw")?[Z,"vw"]:[Z,"%"]}}}function hX({groupSize:$,panelElement:Z,styleProp:J}){let Q,[X,z]=PZ0(J);switch(z){case"%":{Q=X/100*$;break}case"px":{Q=X;break}case"rem":{Q=_Z0(Z,X);break}case"em":{Q=AZ0(Z,X);break}case"vh":{Q=DZ0(X);break}case"vw":{Q=OZ0(X);break}}return Q}function X4($){return parseFloat($.toFixed(3))}function lZ({group:$}){let{orientation:Z,panels:J}=$;return J.reduce((Q,X)=>(Q+=Z==="horizontal"?X.element.offsetWidth:X.element.offsetHeight,Q),0)}function jM($){let{panels:Z}=$,J=lZ({group:$});return J===0?Z.map((Q)=>({groupResizeBehavior:Q.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:Q.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:Q.panelConstraints.disabled,minSize:0,maxSize:100,panelId:Q.id})):Z.map((Q)=>{let{element:X,panelConstraints:z}=Q,G=0;if(z.collapsedSize!==void 0){let W=hX({groupSize:J,panelElement:X,styleProp:z.collapsedSize});G=X4(W/J*100)}let H;if(z.defaultSize!==void 0){let W=hX({groupSize:J,panelElement:X,styleProp:z.defaultSize});H=X4(W/J*100)}let Y=0;if(z.minSize!==void 0){let W=hX({groupSize:J,panelElement:X,styleProp:z.minSize});Y=X4(W/J*100)}let K=100;if(z.maxSize!==void 0){let W=hX({groupSize:J,panelElement:X,styleProp:z.maxSize});K=X4(W/J*100)}return{groupResizeBehavior:z.groupResizeBehavior,collapsedSize:G,collapsible:z.collapsible===!0,defaultSize:H,disabled:z.disabled,minSize:Y,maxSize:K,panelId:Q.id}})}function e5($,Z="Assertion error"){if(!$)throw Error(Z)}function TM($,Z){return Array.from(Z).sort($==="horizontal"?wZ0:jZ0)}function wZ0($,Z){let J=$.element.offsetLeft-Z.element.offsetLeft;return J!==0?J:$.element.offsetWidth-Z.element.offsetWidth}function jZ0($,Z){let J=$.element.offsetTop-Z.element.offsetTop;return J!==0?J:$.element.offsetHeight-Z.element.offsetHeight}function jp($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function Tp($,Z){return{x:$.x>=Z.left&&$.x<=Z.right?0:Math.min(Math.abs($.x-Z.left),Math.abs($.x-Z.right)),y:$.y>=Z.top&&$.y<=Z.bottom?0:Math.min(Math.abs($.y-Z.top),Math.abs($.y-Z.bottom))}}function TZ0({orientation:$,rects:Z,targetRect:J}){let Q={x:J.x+J.width/2,y:J.y+J.height/2},X,z=Number.MAX_VALUE;for(let G of Z){let{x:H,y:Y}=Tp(Q,G),K=$==="horizontal"?H:Y;K<z&&(z=K,X=G)}return e5(X,"No rect found"),X}var LB;function CZ0(){return LB===void 0&&(typeof matchMedia=="function"?LB=!!matchMedia("(pointer:coarse)").matches:LB=!1),LB}function Cp($){let{element:Z,orientation:J,panels:Q,separators:X}=$,z=TM(J,Array.from(Z.children).filter(jp).map((F)=>({element:F}))).map(({element:F})=>F),G=[],H=!1,Y=!1,K=-1,W=-1,B=0,q,U=[];{let F=-1;for(let N of z)N.hasAttribute("data-panel")&&(F++,N.hasAttribute("data-disabled")||(B++,K===-1&&(K=F),W=F))}if(B>1){let F=-1;for(let N of z)if(N.hasAttribute("data-panel")){F++;let L=Q.find((V)=>V.element===N);if(L){if(q){let V=q.element.getBoundingClientRect(),M=N.getBoundingClientRect(),_;if(Y){let O=J==="horizontal"?new DOMRect(V.right,V.top,0,V.height):new DOMRect(V.left,V.bottom,V.width,0),D=J==="horizontal"?new DOMRect(M.left,M.top,0,M.height):new DOMRect(M.left,M.top,M.width,0);switch(U.length){case 0:{_=[O,D];break}case 1:{let A=U[0],C=TZ0({orientation:J,rects:[V,M],targetRect:A.element.getBoundingClientRect()});_=[A,C===V?D:O];break}default:{_=U;break}}}else U.length?_=U:_=[J==="horizontal"?new DOMRect(V.right,M.top,M.left-V.right,M.height):new DOMRect(M.left,V.bottom,M.width,M.top-V.bottom)];for(let O of _){let D="width"in O?O:O.element.getBoundingClientRect(),A=CZ0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(D.width<A){let I=A-D.width;D=new DOMRect(D.x-I/2,D.y,D.width+I,D.height)}if(D.height<A){let I=A-D.height;D=new DOMRect(D.x,D.y-I/2,D.width,D.height+I)}let C=F<=K||F>W;!H&&!C&&G.push({group:$,groupSize:lZ({group:$}),panels:[q,L],separator:"width"in O?void 0:O,rect:D}),H=!1}}Y=!1,q=L,U=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(H=!0);let L=X.find((V)=>V.element===N);L?U.push(L):(q=void 0,U=[])}else Y=!0}return G}class CM{#$={};addListener($,Z){let J=this.#$[$];return J===void 0?this.#$[$]=[Z]:J.includes(Z)||J.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let J=this.#$[$];if(J!==void 0)if(J.length===1)J[0].call(null,Z);else{let Q=!1,X=null,z=Array.from(J);for(let G=0;G<z.length;G++){let H=z[G];try{H.call(null,Z)}catch(Y){X===null&&(Q=!0,X=Y)}}if(Q)throw X}}removeAllListeners(){this.#$={}}removeListener($,Z){let J=this.#$[$];if(J!==void 0){let Q=J.indexOf(Z);Q>=0&&J.splice(Q,1)}}}var uZ={cursorFlags:0,state:"inactive"},EM=new CM;function w7(){return uZ}function EZ0($){return EM.addListener("change",$)}function SZ0($){let Z=uZ,J={...uZ};J.cursorFlags=$,uZ=J,EM.emit("change",{prev:Z,next:J})}function cZ($){let Z=uZ;uZ=$,EM.emit("change",{prev:Z,next:$})}var kZ0=($)=>$,wM=()=>{},Ep=1,Sp=2,kp=4,Ip=8,Yp=3,Kp=12,MB;function Wp(){return MB===void 0&&(MB=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(MB=!0)),MB}function IZ0({cursorFlags:$,groups:Z,state:J}){let Q=0,X=0;switch(J){case"active":case"hover":Z.forEach((z)=>{if(!z.mutableState.disableCursor)switch(z.orientation){case"horizontal":{Q++;break}case"vertical":{X++;break}}})}if(!(Q===0&&X===0)){switch(J){case"active":{if($&&Wp()){let z=($&Ep)!==0,G=($&Sp)!==0,H=($&kp)!==0,Y=($&Ip)!==0;if(z)return H?"se-resize":Y?"ne-resize":"e-resize";if(G)return H?"sw-resize":Y?"nw-resize":"w-resize";if(H)return"s-resize";if(Y)return"n-resize"}break}}return Wp()?Q>0&&X>0?"move":Q>0?"ew-resize":"ns-resize":Q>0&&X>0?"grab":Q>0?"col-resize":"row-resize"}}var Bp=new WeakMap;function SM($){if($.defaultView===null||$.defaultView===void 0)return;let{prevStyle:Z,styleSheet:J}=Bp.get($)??{};J===void 0&&(J=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(J):$.adoptedStyleSheets=[...$.adoptedStyleSheets,J]));let Q=w7();switch(Q.state){case"active":case"hover":{let X=IZ0({cursorFlags:Q.cursorFlags,groups:Q.hitRegions.map((G)=>G.group),state:Q.state}),z=`*, *:hover {cursor: ${X} !important; }`;if(Z===z)return;Z=z,X?J.cssRules.length===0?J.insertRule(z):J.replaceSync(z):J.cssRules.length===1&&J.deleteRule(0);break}case"inactive":{Z=void 0,J.cssRules.length===1&&J.deleteRule(0);break}}Bp.set($,{prevStyle:Z,styleSheet:J})}var _9=new Map,Rp=new CM;function RZ0($){_9=new Map(_9),_9.delete($)}function qp($,Z){for(let[J]of _9)if(J.id===$)return J}function Q3($,Z){for(let[J,Q]of _9)if(J.id===$)return Q;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function C7(){return _9}function kM($,Z){return Rp.addListener("groupChange",(J)=>{J.group.id===$&&Z(J)})}function c9($,Z,J){let Q=_9.get($);_9=new Map(_9),_9.set($,Z),Rp.emit("groupChange",{group:$,isUserInteraction:J?.isUserInteraction===!0,prev:Q,next:Z})}function yp($){let Z=w7(),J=!1;switch(Z.state){case"active":cZ({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(SM($),J=!0,Z.hitRegions.forEach((Q)=>{let X=Q3(Q.group.id,!0);c9(Q.group,X,{isUserInteraction:!0})}))}return J}function Up($){$.defaultPrevented||yp($.currentTarget)}function yZ0($,Z,J){let Q,X={x:1/0,y:1/0};for(let z of Z){let G=Tp(J,z.rect);switch($){case"horizontal":{G.x<=X.x&&(Q=z,X=G);break}case"vertical":{G.y<=X.y&&(Q=z,X=G);break}}}return Q?{distance:X,hitRegion:Q}:void 0}function bZ0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function xZ0($,Z){if($===Z)throw Error("Cannot compare node with itself");let J={a:Vp($),b:Vp(Z)},Q;for(;J.a.at(-1)===J.b.at(-1);)Q=J.a.pop(),J.b.pop();e5(Q,"Stacking order can only be calculated for elements with a common ancestor");let X={a:Np(Fp(J.a)),b:Np(Fp(J.b))};if(X.a===X.b){let z=Q.childNodes,G={a:J.a.at(-1),b:J.b.at(-1)},H=z.length;for(;H--;){let Y=z[H];if(Y===G.a)return 1;if(Y===G.b)return-1}}return Math.sign(X.a-X.b)}var hZ0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function gZ0($){let Z=getComputedStyle(bp($)??$).display;return Z==="flex"||Z==="inline-flex"}function vZ0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||gZ0($))||+Z.opacity<1||("transform"in Z)&&Z.transform!=="none"||("webkitTransform"in Z)&&Z.webkitTransform!=="none"||("mixBlendMode"in Z)&&Z.mixBlendMode!=="normal"||("filter"in Z)&&Z.filter!=="none"||("webkitFilter"in Z)&&Z.webkitFilter!=="none"||("isolation"in Z)&&Z.isolation==="isolate"||hZ0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function Fp($){let Z=$.length;for(;Z--;){let J=$[Z];if(e5(J,"Missing node"),vZ0(J))return J}return null}function Np($){return $&&Number(getComputedStyle($).zIndex)||0}function Vp($){let Z=[];for(;$;)Z.push($),$=bp($);return Z}function bp($){let{parentNode:Z}=$;return bZ0(Z)?Z.host:Z}function fZ0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function mZ0({groupElement:$,hitRegion:Z,pointerEventTarget:J}){if(!jp(J)||J.contains($)||$.contains(J))return!0;if(xZ0(J,$)>0){let Q=J;for(;Q;){if(Q.contains($))return!0;if(fZ0(Q.getBoundingClientRect(),Z))return!1;Q=Q.parentElement}}return!0}function IM($,Z){let J=[];return Z.forEach((Q,X)=>{if(X.disabled)return;let z=Cp(X),G=yZ0(X.orientation,z,{x:$.clientX,y:$.clientY});G&&G.distance.x<=0&&G.distance.y<=0&&mZ0({groupElement:X.element,hitRegion:G.hitRegion.rect,pointerEventTarget:$.target})&&J.push(G.hitRegion)}),J}function pZ0($,Z){if($.length!==Z.length)return!1;for(let J=0;J<$.length;J++)if($[J]!=Z[J])return!1;return!0}function d8($,Z,J=0){return Math.abs(X4($)-X4(Z))<=J}function A9($,Z){return d8($,Z)?0:$>Z?1:-1}function pZ({overrideDisabledPanels:$,panelConstraints:Z,prevSize:J,size:Q}){let{collapsedSize:X=0,collapsible:z,disabled:G,maxSize:H=100,minSize:Y=0}=Z;if(G&&!$)return J;if(A9(Q,Y)<0)if(z){let K=(X+Y)/2;A9(Q,K)<0?Q=X:Q=Y}else Q=Y;return Q=Math.min(H,Q),Q=X4(Q),Q}function vX({delta:$,initialLayout:Z,panelConstraints:J,pivotIndices:Q,prevLayout:X,trigger:z}){if(d8($,0))return Z;let G=z==="imperative-api",H=Object.values(Z),Y=Object.values(X),K=[...H],[W,B]=Q;e5(W!=null,"Invalid first pivot index"),e5(B!=null,"Invalid second pivot index");let q=0;switch(z){case"keyboard":{{let N=$<0?B:W,L=J[N];e5(L,`Panel constraints not found for index ${N}`);let{collapsedSize:V=0,collapsible:M,minSize:_=0}=L;if(M){let O=H[N];if(e5(O!=null,`Previous layout not found for panel index ${N}`),d8(O,V)){let D=_-O;A9(D,Math.abs($))>0&&($=$<0?0-D:D)}}}{let N=$<0?W:B,L=J[N];e5(L,`No panel constraints found for index ${N}`);let{collapsedSize:V=0,collapsible:M,minSize:_=0}=L;if(M){let O=H[N];if(e5(O!=null,`Previous layout not found for panel index ${N}`),d8(O,_)){let D=O-V;A9(D,Math.abs($))>0&&($=$<0?0-D:D)}}}break}default:{let N=$<0?B:W,L=J[N];e5(L,`Panel constraints not found for index ${N}`);let V=H[N],{collapsible:M,collapsedSize:_,minSize:O}=L;if(M&&A9(V,O)<0)if($>0){let D=O-_,A=D/2,C=V+$;A9(C,O)<0&&($=A9($,A)<=0?0:D)}else{let D=O-_,A=100-D/2,C=V-$;A9(C,O)<0&&($=A9(100+$,A)>0?0:-D)}break}}{let N=$<0?1:-1,L=$<0?B:W,V=0;for(;;){let _=H[L];e5(_!=null,`Previous layout not found for panel index ${L}`);let O=pZ({overrideDisabledPanels:G,panelConstraints:J[L],prevSize:_,size:100})-_;if(V+=O,L+=N,L<0||L>=J.length)break}let M=Math.min(Math.abs($),Math.abs(V));$=$<0?0-M:M}{let N=$<0?W:B;for(;N>=0&&N<J.length;){let L=Math.abs($)-Math.abs(q),V=H[N];e5(V!=null,`Previous layout not found for panel index ${N}`);let M=V-L,_=pZ({overrideDisabledPanels:G,panelConstraints:J[N],prevSize:V,size:M});if(!d8(V,_)&&(q+=V-_,K[N]=_,q.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?N--:N++}}if(pZ0(Y,K))return X;{let N=$<0?B:W,L=H[N];e5(L!=null,`Previous layout not found for panel index ${N}`);let V=L+q,M=pZ({overrideDisabledPanels:G,panelConstraints:J[N],prevSize:L,size:V});if(K[N]=M,!d8(M,V)){let _=V-M,O=$<0?B:W;for(;O>=0&&O<J.length;){let D=K[O];e5(D!=null,`Previous layout not found for panel index ${O}`);let A=D+_,C=pZ({overrideDisabledPanels:G,panelConstraints:J[O],prevSize:D,size:A});if(d8(D,C)||(_-=C-D,K[O]=C),d8(_,0))break;$>0?O--:O++}}}let U=Object.values(K).reduce((N,L)=>L+N,0);if(!d8(U,100,0.1))return X;let F=Object.keys(X);return K.reduce((N,L,V)=>(N[F[V]]=L,N),{})}function j7($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if(Z[J]===void 0||A9($[J],Z[J])!==0)return!1;return!0}function T7({layout:$,panelConstraints:Z}){let J=Object.values($),Q=[...J],X=Q.reduce((H,Y)=>H+Y,0);if(Q.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${Q.map((H)=>`${H}%`).join(", ")}`);if(!d8(X,100)&&Q.length>0)for(let H=0;H<Z.length;H++){let Y=Q[H];e5(Y!=null,`No layout data found for index ${H}`);let K=100/X*Y;Q[H]=K}let z=0;for(let H=0;H<Z.length;H++){let Y=J[H];e5(Y!=null,`No layout data found for index ${H}`);let K=Q[H];e5(K!=null,`No layout data found for index ${H}`);let W=pZ({overrideDisabledPanels:!0,panelConstraints:Z[H],prevSize:Y,size:K});K!=W&&(z+=K-W,Q[H]=W)}if(!d8(z,0))for(let H=0;H<Z.length;H++){let Y=Q[H];e5(Y!=null,`No layout data found for index ${H}`);let K=Y+z,W=pZ({overrideDisabledPanels:!0,panelConstraints:Z[H],prevSize:Y,size:K});if(Y!==W&&(z-=W-Y,Q[H]=W,d8(z,0)))break}let G=Object.keys($);return Q.reduce((H,Y,K)=>(H[G[K]]=Y,H),{})}function xp({groupId:$,panelId:Z}){let J=()=>{let Y=C7();for(let[K,{defaultLayoutDeferred:W,derivedPanelConstraints:B,layout:q,groupSize:U,separatorToPanels:F}]of Y)if(K.id===$)return{defaultLayoutDeferred:W,derivedPanelConstraints:B,group:K,groupSize:U,layout:q,separatorToPanels:F};throw Error(`Group ${$} not found`)},Q=()=>{let Y=J().derivedPanelConstraints.find((K)=>K.panelId===Z);if(Y!==void 0)return Y;throw Error(`Panel constraints not found for Panel ${Z}`)},X=()=>{let Y=J().group.panels.find((K)=>K.id===Z);if(Y!==void 0)return Y;throw Error(`Layout not found for Panel ${Z}`)},z=()=>{let Y=J().layout[Z];if(Y!==void 0)return Y;throw Error(`Layout not found for Panel ${Z}`)},G=({nextSize:Y,panels:K,prevLayout:W,derivedPanelConstraints:B})=>{let q=z(),U=K.findIndex((L)=>L.id===Z),F=U===0,N=U===K.length-1;if(N&&Y<q&&(F||K.slice(0,U).every((L,V)=>{let M=B[V];return M?.collapsible&&d8(M.collapsedSize,W[M.panelId])}))){let L=K.slice(0,U).reduce((V,M)=>V+W[M.id],0);return{...W,[Z]:X4(100-L)}}return vX({delta:N?q-Y:Y-q,initialLayout:W,panelConstraints:B,pivotIndices:N?[U-1,U]:[U,U+1],prevLayout:W,trigger:"imperative-api"})},H=(Y)=>{let K=z();if(Y===K)return;let{defaultLayoutDeferred:W,derivedPanelConstraints:B,group:q,groupSize:U,layout:F,separatorToPanels:N}=J(),L=G({nextSize:Y,panels:q.panels,prevLayout:F,derivedPanelConstraints:B}),V=T7({layout:L,panelConstraints:B});j7(F,V)||c9(q,{defaultLayoutDeferred:W,derivedPanelConstraints:B,groupSize:U,layout:V,separatorToPanels:N})};return{collapse:()=>{let{collapsible:Y,collapsedSize:K}=Q(),{mutableValues:W}=X(),B=z();Y&&B!==K&&(W.expandToSize=B,H(K))},expand:()=>{let{collapsible:Y,collapsedSize:K,minSize:W}=Q(),{mutableValues:B}=X(),q=z();if(Y&&q===K){let U=B.expandToSize??W;U===0&&(U=1),H(U)}},getSize:()=>{let{group:Y}=J(),K=z(),{element:W}=X(),B=Y.orientation==="horizontal"?W.offsetWidth:W.offsetHeight;return{asPercentage:K,inPixels:B}},isCollapsed:()=>{let{collapsible:Y,collapsedSize:K}=Q(),W=z();return Y&&d8(K,W)},resize:(Y)=>{let{group:K}=J(),{element:W}=X(),B=lZ({group:K}),q=hX({groupSize:B,panelElement:W,styleProp:Y}),U=X4(q/B*100);H(U)}}}function Lp($){if($.defaultPrevented)return;let Z=C7();IM($,Z).forEach((J)=>{if(J.separator&&!J.separator.disableDoubleClick){let Q=J.panels.find((X)=>X.panelConstraints.defaultSize!==void 0);if(Q){let X=Q.panelConstraints.defaultSize,z=xp({groupId:J.group.id,panelId:Q.id});z&&X!==void 0&&(z.resize(X),$.preventDefault())}}})}function AB($){let Z=C7();for(let[J]of Z)if(J.separators.some((Q)=>Q.element===$))return J;throw Error("Could not find parent Group for separator element")}function hp({groupId:$}){let Z=()=>{let J=C7();for(let[Q,X]of J)if(Q.id===$)return{group:Q,...X};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:J,layout:Q}=Z();return J?{}:Q},setLayout(J){let{defaultLayoutDeferred:Q,derivedPanelConstraints:X,group:z,groupSize:G,layout:H,separatorToPanels:Y}=Z(),K=T7({layout:J,panelConstraints:X});return Q?H:(j7(H,K)||c9(z,{defaultLayoutDeferred:Q,derivedPanelConstraints:X,groupSize:G,layout:K,separatorToPanels:Y}),K)}}}function P7($,Z){let J=AB($),Q=Q3(J.id,!0),X=J.separators.find((W)=>W.element===$);e5(X,"Matching separator not found");let z=Q.separatorToPanels.get(X);e5(z,"Matching panels not found");let G=z.map((W)=>J.panels.indexOf(W)),H=hp({groupId:J.id}).getLayout(),Y=vX({delta:Z,initialLayout:H,panelConstraints:Q.derivedPanelConstraints,pivotIndices:G,prevLayout:H,trigger:"keyboard"}),K=T7({layout:Y,panelConstraints:Q.derivedPanelConstraints});j7(H,K)||c9(J,{defaultLayoutDeferred:Q.defaultLayoutDeferred,derivedPanelConstraints:Q.derivedPanelConstraints,groupSize:Q.groupSize,layout:K,separatorToPanels:Q.separatorToPanels},{isUserInteraction:!0})}function Mp($){if($.defaultPrevented)return;let Z=$.currentTarget,J=AB(Z);if(!J.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),J.orientation==="vertical"&&P7(Z,5);break}case"ArrowLeft":{$.preventDefault(),J.orientation==="horizontal"&&P7(Z,-5);break}case"ArrowRight":{$.preventDefault(),J.orientation==="horizontal"&&P7(Z,5);break}case"ArrowUp":{$.preventDefault(),J.orientation==="vertical"&&P7(Z,-5);break}case"End":{$.preventDefault(),P7(Z,100);break}case"Enter":{$.preventDefault();let Q=AB(Z),X=Q3(Q.id,!0),{derivedPanelConstraints:z,layout:G,separatorToPanels:H}=X,Y=Q.separators.find((q)=>q.element===Z);e5(Y,"Matching separator not found");let K=H.get(Y);e5(K,"Matching panels not found");let W=K[0],B=z.find((q)=>q.panelId===W.id);if(e5(B,"Panel metadata not found"),B.collapsible){let q=G[W.id],U=B.collapsedSize===q?Q.mutableState.expandedPanelSizes[W.id]??B.minSize:B.collapsedSize;P7(Z,U-q)}break}case"F6":{$.preventDefault();let Q=AB(Z).separators.map((G)=>G.element),X=Array.from(Q).findIndex((G)=>G===$.currentTarget);e5(X!==null,"Index not found");let z=$.shiftKey?X>0?X-1:Q.length-1:X+1<Q.length?X+1:0;Q[z].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),P7(Z,-100);break}}}function Ap($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=C7(),J=IM($,Z),Q=new Map,X=!1;J.forEach((z)=>{z.separator&&(X||(X=!0,z.separator.element.focus({focusVisible:!1,preventScroll:!0})));let G=Z.get(z.group);G&&Q.set(z.group,G.layout)}),cZ({cursorFlags:0,hitRegions:J,initialLayoutMap:Q,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),J.length&&$.preventDefault()}function gp({document:$,event:Z,hitRegions:J,initialLayoutMap:Q,mountedGroups:X,pointerDownAtPoint:z,prevCursorFlags:G}){let H=0;J.forEach((K)=>{let{group:W,groupSize:B}=K,{orientation:q,panels:U}=W,{disableCursor:F}=W.mutableState,N=0;z?q==="horizontal"?N=(Z.clientX-z.x)/B*100:N=(Z.clientY-z.y)/B*100:q==="horizontal"?N=Z.clientX<0?-100:100:N=Z.clientY<0?-100:100;let L=Q.get(W),V=X.get(W);if(!L||!V)return;let{defaultLayoutDeferred:M,derivedPanelConstraints:_,groupSize:O,layout:D,separatorToPanels:A}=V;if(_&&D&&A){let C=vX({delta:N,initialLayout:L,panelConstraints:_,pivotIndices:K.panels.map((I)=>U.indexOf(I)),prevLayout:D,trigger:"mouse-or-touch"});if(j7(C,D)){if(N!==0&&!F)switch(q){case"horizontal":{H|=N<0?Ep:Sp;break}case"vertical":{H|=N<0?kp:Ip;break}}}else c9(K.group,{defaultLayoutDeferred:M,derivedPanelConstraints:_,groupSize:O,layout:C,separatorToPanels:A})}});let Y=0;Z.movementX===0?Y|=G&Yp:Y|=H&Yp,Z.movementY===0?Y|=G&Kp:Y|=H&Kp,SZ0(Y),SM($)}function _p($){let Z=C7(),J=w7();switch(J.state){case"active":gp({document:$.currentTarget,event:$,hitRegions:J.hitRegions,initialLayoutMap:J.initialLayoutMap,mountedGroups:Z,prevCursorFlags:J.cursorFlags})}}function Dp($){if($.defaultPrevented)return;let Z=w7(),J=C7();switch(Z.state){case"active":{if($.buttons===0){cZ({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((Q)=>{let X=Q3(Q.group.id,!0);c9(Q.group,X,{isUserInteraction:!0})});return}for(let Q of Z.hitRegions)if(Q.separator){let{element:X}=Q.separator;X.hasPointerCapture?.($.pointerId)||X.setPointerCapture?.($.pointerId)}gp({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:J,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let Q=IM($,J);Q.length===0?Z.state!=="inactive"&&cZ({cursorFlags:0,state:"inactive"}):cZ({cursorFlags:0,hitRegions:Q,state:"hover"}),SM($.currentTarget);break}}}function Op($){if($.relatedTarget instanceof HTMLIFrameElement)switch(w7().state){case"hover":cZ({cursorFlags:0,state:"inactive"})}}function Pp($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;yp($.currentTarget)&&$.preventDefault()}function wp($){let Z=0,J=0,Q={};for(let z of $)if(z.defaultSize!==void 0){Z++;let G=X4(z.defaultSize);J+=G,Q[z.panelId]=G}else Q[z.panelId]=void 0;let X=$.length-Z;if(X!==0){let z=X4((100-J)/X);for(let G of $)G.defaultSize===void 0&&(Q[G.panelId]=z)}return Q}function uZ0($,Z,J){if(!J[0])return;let Q=$.panels.find((Y)=>Y.element===Z);if(!Q||!Q.onResize)return;let X=lZ({group:$}),z=$.orientation==="horizontal"?Q.element.offsetWidth:Q.element.offsetHeight,G=Q.mutableValues.prevSize,H={asPercentage:X4(z/X*100),inPixels:z};Q.mutableValues.prevSize=H,Q.onResize(H,Q.id,G)}function cZ0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function dZ0({group:$,nextGroupSize:Z,prevGroupSize:J,prevLayout:Q}){if(J<=0||Z<=0||J===Z)return Q;let X=0,z=0,G=!1,H=new Map,Y=[];for(let B of $.panels){let q=Q[B.id]??0;switch(B.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{G=!0;let U=q/100*J,F=X4(U/Z*100);H.set(B.id,F),X+=F;break}case"preserve-relative-size":default:{Y.push(B.id),z+=q;break}}}if(!G||Y.length===0)return Q;let K=100-X,W={...Q};if(H.forEach((B,q)=>{W[q]=B}),z>0)for(let B of Y){let q=Q[B]??0;W[B]=X4(q/z*K)}else{let B=X4(K/Y.length);for(let q of Y)W[q]=B}return W}function lZ0($,Z){let J=$.map((X)=>X.id),Q=Object.keys(Z);if(J.length!==Q.length)return!1;for(let X of J)if(!Q.includes(X))return!1;return!0}var mZ=new Map;function iZ0($){let Z=!0;e5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let J=$.element.ownerDocument.defaultView.ResizeObserver,Q=new Set,X=new Set,z=new J((F)=>{for(let N of F){let{borderBoxSize:L,target:V}=N;if(V===$.element){if(Z){let M=lZ({group:$});if(M===0)return;let _=Q3($.id);if(!_)return;let O=jM($),D=_.defaultLayoutDeferred?wp(O):_.layout,A=dZ0({group:$,nextGroupSize:M,prevGroupSize:_.groupSize,prevLayout:D}),C=T7({layout:A,panelConstraints:O});if(!_.defaultLayoutDeferred&&j7(_.layout,C)&&cZ0(_.derivedPanelConstraints,O)&&_.groupSize===M)return;c9($,{defaultLayoutDeferred:!1,derivedPanelConstraints:O,groupSize:M,layout:C,separatorToPanels:_.separatorToPanels})}}else uZ0($,V,L)}});z.observe($.element),$.panels.forEach((F)=>{e5(!Q.has(F.id),`Panel ids must be unique; id "${F.id}" was used more than once`),Q.add(F.id),F.onResize&&z.observe(F.element)});let G=lZ({group:$}),H=jM($),Y=$.panels.map(({id:F})=>F).join(","),K=$.mutableState.defaultLayout;K&&(lZ0($.panels,K)||(K=void 0));let W=$.mutableState.layouts[Y]??K??wp(H),B=T7({layout:W,panelConstraints:H}),q=$.element.ownerDocument;mZ.set(q,(mZ.get(q)??0)+1);let U=new Map;return Cp($).forEach((F)=>{F.separator&&U.set(F.separator,F.panels)}),c9($,{defaultLayoutDeferred:G===0,derivedPanelConstraints:H,groupSize:G,layout:B,separatorToPanels:U}),$.separators.forEach((F)=>{e5(!X.has(F.id),`Separator ids must be unique; id "${F.id}" was used more than once`),X.add(F.id),F.element.addEventListener("keydown",Mp)}),mZ.get(q)===1&&(q.addEventListener("contextmenu",Up,!0),q.addEventListener("dblclick",Lp,!0),q.addEventListener("pointerdown",Ap,!0),q.addEventListener("pointerleave",_p),q.addEventListener("pointermove",Dp),q.addEventListener("pointerout",Op),q.addEventListener("pointerup",Pp,!0)),function(){Z=!1,mZ.set(q,Math.max(0,(mZ.get(q)??0)-1)),RZ0($),$.separators.forEach((F)=>{F.element.removeEventListener("keydown",Mp)}),mZ.get(q)||(q.removeEventListener("contextmenu",Up,!0),q.removeEventListener("dblclick",Lp,!0),q.removeEventListener("pointerdown",Ap,!0),q.removeEventListener("pointerleave",_p),q.removeEventListener("pointermove",Dp),q.removeEventListener("pointerout",Op),q.removeEventListener("pointerup",Pp,!0)),z.disconnect()}}function rZ0(){let[$,Z]=U5.useState({}),J=U5.useCallback(()=>Z({}),[]);return[$,J]}function RM($){let Z=U5.useId();return`${$??Z}`}var E7=typeof window<"u"?U5.useLayoutEffect:U5.useEffect;function gX($){let Z=U5.useRef($);return E7(()=>{Z.current=$},[$]),U5.useCallback((...J)=>Z.current?.(...J),[Z])}function yM(...$){return gX((Z)=>{$.forEach((J)=>{if(J)switch(typeof J){case"function":{J(Z);break}case"object":{J.current=Z;break}}})})}function bM($){let Z=U5.useRef({...$});return E7(()=>{for(let J in $)Z.current[J]=$[J]},[$]),Z.current}var vp=U5.createContext(null);function aZ0($,Z){let J=U5.useRef({getLayout:()=>({}),setLayout:kZ0});U5.useImperativeHandle(Z,()=>J.current,[]),E7(()=>{Object.assign(J.current,hp({groupId:$}))})}function xM({children:$,className:Z,defaultLayout:J,disableCursor:Q,disabled:X,elementRef:z,groupRef:G,id:H,onLayoutChange:Y,onLayoutChanged:K,orientation:W="horizontal",resizeTargetMinimumSize:B={coarse:20,fine:10},style:q,...U}){let F=U5.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=gX((h)=>{j7(F.current.onLayoutChange,h)||(F.current.onLayoutChange=h,Y?.(h))}),L=gX((h,k)=>{j7(F.current.onLayoutChanged,h)||(F.current.onLayoutChanged=h,K?.(h,{isUserInteraction:k}))}),V=RM(H),M=U5.useRef(null),[_,O]=rZ0(),D=U5.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:B,separators:[]}),A=yM(M,z);aZ0(V,G);let C=gX((h,k)=>{let S=w7(),w=qp(h),T=Q3(h);if(T){let R=!1;switch(S.state){case"active":{R=S.hitRegions.some((b)=>b.group===w);break}}return{flexGrow:T.layout[k]??1,pointerEvents:R?"none":void 0}}if(J?.[k])return{flexGrow:J?.[k]}}),I=bM({defaultLayout:J,disableCursor:Q}),y=U5.useMemo(()=>({get disableCursor(){return!!I.disableCursor},getPanelStyles:C,id:V,orientation:W,registerPanel:(h)=>{let k=D.current;return k.panels=TM(W,[...k.panels,h]),O(),()=>{k.panels=k.panels.filter((S)=>S!==h),O()}},registerSeparator:(h)=>{let k=D.current;return k.separators=TM(W,[...k.separators,h]),O(),()=>{k.separators=k.separators.filter((S)=>S!==h),O()}},updatePanelProps:(h,{disabled:k})=>{let S=D.current.panels.find((R)=>R.id===h);S&&(S.panelConstraints.disabled=k);let w=qp(V),T=Q3(V);w&&T&&c9(w,{...T,derivedPanelConstraints:jM(w)})},updateSeparatorProps:(h,{disabled:k,disableDoubleClick:S})=>{let w=D.current.separators.find((T)=>T.id===h);w&&(w.disabled=k,w.disableDoubleClick=S)}}),[C,V,O,W,I]),E=U5.useRef(null);return E7(()=>{let h=M.current;if(h===null)return;let k=D.current,S;if(I.defaultLayout!==void 0&&Object.keys(I.defaultLayout).length===k.panels.length){S={};for(let j of k.panels){let e=I.defaultLayout[j.id];e!==void 0&&(S[j.id]=e)}}let w={disabled:!!X,element:h,id:V,mutableState:{defaultLayout:S,disableCursor:!!I.disableCursor,expandedPanelSizes:D.current.lastExpandedPanelSizes,layouts:D.current.layouts},orientation:W,panels:k.panels,resizeTargetMinimumSize:k.resizeTargetMinimumSize,separators:k.separators};E.current=w;let T=iZ0(w),{defaultLayoutDeferred:R,derivedPanelConstraints:b,layout:g}=Q3(w.id,!0);!R&&b.length>0&&(N(g),L(g,!1));let u=kM(V,(j)=>{let{defaultLayoutDeferred:e,derivedPanelConstraints:t,layout:x}=j.next;if(e||t.length===0)return;let $0=w.panels.map(({id:l})=>l).join(",");w.mutableState.layouts[$0]=x,t.forEach((l)=>{if(l.collapsible){let{layout:H0}=j.prev??{};if(H0){let U0=d8(l.collapsedSize,x[l.panelId]),X0=d8(l.collapsedSize,H0[l.panelId]);U0&&!X0&&(w.mutableState.expandedPanelSizes[l.panelId]=H0[l.panelId])}}});let M0=w7().state!=="active";N(x),M0&&L(x,j.isUserInteraction)});return()=>{E.current=null,T(),u()}},[X,V,L,N,W,_,I]),U5.useEffect(()=>{let h=E.current;h&&(h.mutableState.defaultLayout=J,h.mutableState.disableCursor=!!Q)}),dZ.jsx(vp.Provider,{value:y,children:dZ.jsx("div",{...U,className:Z,"data-group":!0,"data-testid":V,id:V,ref:A,style:{height:"100%",width:"100%",overflow:"hidden",...q,display:"flex",flexDirection:W==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:W==="horizontal"?"pan-y":"pan-x"},children:$})})}xM.displayName="Group";function hM(){let $=U5.useContext(vp);return e5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function nZ0($,Z){let{id:J}=hM(),Q=U5.useRef({collapse:wM,expand:wM,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:wM});U5.useImperativeHandle(Z,()=>Q.current,[]),E7(()=>{Object.assign(Q.current,xp({groupId:J,panelId:$}))})}function gM({children:$,className:Z,collapsedSize:J="0%",collapsible:Q=!1,defaultSize:X,disabled:z,elementRef:G,groupResizeBehavior:H="preserve-relative-size",id:Y,maxSize:K="100%",minSize:W="0%",onResize:B,panelRef:q,style:U,...F}){let N=!!Y,L=RM(Y),V=bM({disabled:z}),M=U5.useRef(null),_=yM(M,G),{getPanelStyles:O,id:D,orientation:A,registerPanel:C,updatePanelProps:I}=hM(),y=B!==null,E=gX((w,T,R)=>{B?.(w,Y,R)});E7(()=>{let w=M.current;if(w!==null){let T={element:w,id:L,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:y?E:void 0,panelConstraints:{groupResizeBehavior:H,collapsedSize:J,collapsible:Q,defaultSize:X,disabled:V.disabled,maxSize:K,minSize:W}};return C(T)}},[H,J,Q,X,y,L,N,K,W,E,C,V]),U5.useEffect(()=>{I(L,{disabled:z})},[z,L,I]),nZ0(L,q);let h=()=>{let w=O(D,L);if(w)return JSON.stringify(w)},k=U5.useSyncExternalStore((w)=>kM(D,w),h,h),S;return k?S=JSON.parse(k):X!==void 0?S={flexGrow:void 0,flexShrink:void 0,flexBasis:X}:S={flexGrow:1},dZ.jsx("div",{...F,"data-disabled":z||void 0,"data-panel":!0,"data-testid":L,id:L,ref:_,style:{...oZ0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...S},children:dZ.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...U,touchAction:A==="horizontal"?"pan-y":"pan-x"},children:$})})}gM.displayName="Panel";var oZ0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function sZ0({layout:$,panelConstraints:Z,panelId:J,panelIndex:Q}){let X,z,G=$[J],H=Z.find((Y)=>Y.panelId===J);if(H){let Y=H.maxSize,K=H.collapsible?H.collapsedSize:H.minSize,W=[Q,Q+1];z=T7({layout:vX({delta:K-G,initialLayout:$,panelConstraints:Z,pivotIndices:W,prevLayout:$}),panelConstraints:Z})[J],X=T7({layout:vX({delta:Y-G,initialLayout:$,panelConstraints:Z,pivotIndices:W,prevLayout:$}),panelConstraints:Z})[J]}return{valueControls:J,valueMax:X,valueMin:z,valueNow:G}}function vM({children:$,className:Z,disabled:J,disableDoubleClick:Q,elementRef:X,id:z,style:G,...H}){let Y=RM(z),K=bM({disabled:J,disableDoubleClick:Q}),[W,B]=U5.useState({}),[q,U]=U5.useState("inactive"),[F,N]=U5.useState(!1),L=U5.useRef(null),V=yM(L,X),{disableCursor:M,id:_,orientation:O,registerSeparator:D,updateSeparatorProps:A}=hM(),C=O==="horizontal"?"vertical":"horizontal";E7(()=>{let E=L.current;if(E!==null){let h={disabled:K.disabled,disableDoubleClick:K.disableDoubleClick,element:E,id:Y},k=D(h),S=EZ0((T)=>{U(T.next.state!=="inactive"&&T.next.hitRegions.some((R)=>R.separator===h)?T.next.state:"inactive")}),w=kM(_,(T)=>{let{derivedPanelConstraints:R,layout:b,separatorToPanels:g}=T.next,u=g.get(h);if(u){let j=u[0],e=u.indexOf(j);B(sZ0({layout:b,panelConstraints:R,panelId:j.id,panelIndex:e}))}});return()=>{S(),w(),k()}}},[_,Y,D,K]),U5.useEffect(()=>{A(Y,{disabled:J,disableDoubleClick:Q})},[J,Q,Y,A]);let I;J&&!M&&(I="not-allowed");let y;if(J)y="disabled";else switch(q){case"active":{y="active";break}default:F?y="focus":y=q}return dZ.jsx("div",{...H,"aria-controls":W.valueControls,"aria-disabled":J||void 0,"aria-orientation":C,"aria-valuemax":W.valueMax,"aria-valuemin":W.valueMin,"aria-valuenow":W.valueNow,children:$,className:Z,"data-separator":y,"data-testid":Y,id:Y,onBlur:()=>N(!1),onFocus:()=>N(!0),ref:V,role:"separator",style:{flexBasis:"auto",cursor:I,...G,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:J?void 0:0})}vM.displayName="Separator";var fX=P(c(),1);function fp({className:$,...Z}){return fX.jsx(xM,{"data-slot":"resizable-panel-group",className:s("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function fM({...$}){return fX.jsx(gM,{"data-slot":"resizable-panel",...$})}function mp({withHandle:$,className:Z,...J}){return fX.jsx(vM,{"data-slot":"resizable-handle",className:s("relative flex w-0 items-center justify-center ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-0 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",Z),...J,children:$&&fX.jsx("div",{className:"flex h-6 w-1 shrink-0 rounded-lg bg-border"})})}var X3=P(c(),1);function pp({workspace:$,chat:Z,open:J,workspaceMinWidth:Q,chatMinWidth:X,chatMaxWidth:z,chatWidth:G,onCollapse:H,onChatWidthChange:Y}){let K=z3.useRef(null),W=z3.useRef(null),[B,q]=z3.useState(!1),U=Math.min(Math.max(G,X),z),F=z3.useRef(J?U:0).current;return z3.useLayoutEffect(()=>{let N=K.current;if(!N)return;if(J)N.resize(U);else N.collapse()},[U,J]),X3.jsxs(fp,{orientation:"horizontal",className:s("overflow-visible!",B&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",B&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(N,L)=>{if(!B&&W.current===null)W.current=requestAnimationFrame(()=>{q(!0)});if(L.isUserInteraction)requestAnimationFrame(()=>{let V=K.current;if(!V)return;let M=V.getSize();if(M.inPixels>0)Y(Math.round(M.inPixels))})},children:[X3.jsx(fM,{id:"workspace",className:"overflow-visible!",minSize:Q,children:X3.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),X3.jsx(mp,{"aria-label":"Resize chat",hidden:!J,disabled:!J}),X3.jsx(fM,{id:"chat","aria-hidden":!J,inert:!J,collapsible:!0,collapsedSize:0,defaultSize:F,minSize:X,maxSize:z,groupResizeBehavior:"preserve-pixel-size",panelRef:K,onResize:(N,L,V)=>{if(J&&N.inPixels===0&&V&&V.inPixels>0)H()},className:s("overflow-hidden!",B&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",J?"opacity-100":"opacity-0"),children:X3.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var K5=P(c(),1),eZ0=z4.lazy(()=>import("/chunk-a7fzp0z0.js").then(($)=>({default:$.Scratchpad}))),lp=($)=>$.config.title||$.id,ip=($)=>QB($.icon)??bQ;function rp($,Z){let J=Z.find((Q)=>Q.viewId===$.id);return QB($.config.icon)??QB(J?.icon)??bQ}function $J0({onToggleMode:$}){return K5.jsxs(A1,{children:[K5.jsx(_1,{render:K5.jsx(C0,{variant:"ghost",size:"icon-sm",onClick:$,"aria-label":"Dock agent",children:K5.jsx(cp,{stroke:1.75})})}),K5.jsx(D1,{children:"Dock agent"})]})}function ZJ0({active:$,onToggle:Z}){return K5.jsxs(A1,{children:[K5.jsx(_1,{render:K5.jsx(C0,{variant:"ghost",size:"icon-sm","aria-label":"Customize","aria-pressed":$,onClick:Z,className:s($&&"bg-accent"),children:K5.jsx(dp,{stroke:1.75})})}),K5.jsx(D1,{children:"Customize"})]})}function JJ0($,Z,J,Q,X,z){if($==="agent")return{key:$,Icon:C6,label:"Agent",closable:Q,loading:X};if($==="widgets")return{key:$,Icon:xQ,label:"Widgets",closable:Q};if($==="scratchpad")return{key:$,Icon:hQ,label:"Scratchpad",closable:Q};let G=t3($),H=G?J.find((W)=>W.id===G):null;if(H)return{key:$,Icon:ip(H),label:H.title||H.viewId||"New view",closable:Q,loading:z(H.sessionId)};let Y=j6($),K=Y?Z.find((W)=>W.id===Y):null;return K?{key:$,Icon:rp(K,J),label:lp(K),closable:Q}:null}function QJ0($,Z,J){let Q=new Set(Z),X=0;return $.map((z)=>Q.has(z)?J[X++]:z)}function ap({widgets:$,views:Z,builders:J}){let{layout:Q,setLayout:X,name:z,icon:G,provider:H,workspaceId:Y}=X1(),K=lm(),{ref:W,fits:B,constraints:q}=rm(),[U,F]=z4.useState("idle"),[N,L]=z4.useState(!1),[V,M]=z4.useState(0),_=z4.useRef(new Map),O=O1((G0)=>G0.dockedChatWidth),D=O1((G0)=>G0.setDockedChatWidth),A=T4((G0)=>G0.activity),C=_O(A,Y),I=im({builders:J,onSave:(G0,A0)=>K.save(G0,A0)});MT(Q.theme);let y=VB(NB(Q.tabs),Z,J),E=y.filter((G0)=>G0!=="agent"),h=E.length>0,S=Q.layoutMode==="split"&&h&&B?"split":"fullscreen",w=S==="split",{tabsState:T,activeTab:R,appletParams:b,navigateToTab:g,setTabs:u}=Xp({views:Z,builders:J,split:w}),{view:j,chatLoaded:e,previewTurn:t,sessionId:x,processing:$0,error:M0,send:l,stop:H0,selectSession:U0,dismissError:X0}=xm({activeTab:R,appletParams:b}),{composerBanner:Y0,builderComposerBanner:V0,composerAvailability:i}=Zp(Y,{chatError:M0,onDismissChatError:X0}),Z0=new Set(T.open),J0=(G0)=>{X({layoutMode:G0})},Q0=w?E:y,n=y.length>1,m=Q0.map((G0)=>JJ0(G0,Z,J,n||t3(G0)!==null,C,(A0)=>wJ(A,Y,A0))).filter((G0)=>Boolean(G0)),d=j6(R),f=d?Z.find((G0)=>G0.id===d):void 0,a=t3(R),o=a?J.find((G0)=>G0.id===a):void 0,N0=o?.status==="draft"&&!wJ(A,Y,o.sessionId)?o:void 0,j0=N0?.id,h0=U==="idle"&&(R==="widgets"&&$.length>0||f!==void 0),c0=BC({workspaceId:Y,sessionId:x,activeTab:R,mode:S,available:h0,closePopup:()=>L(!1),openPopup:()=>L(!0)});z4.useEffect(()=>{if(T.open.filter((f0)=>xX(f0,Z,J)).length===T.open.length)return;let A0=VB(T,Z,J);X({tabs:{open:A0,active:A0.includes(T.active)?T.active:A0[0]}})},[J,X,T,Z]),z4.useEffect(()=>{let G0=new Map;for(let T0 of J){if(T0.status!=="ready"||!T0.viewId)continue;if(!Z.some((m0)=>m0.id===T0.viewId))continue;G0.set(s3(T0.id),VF(T0.viewId))}if(G0.size===0)return;let A0=G0.get(R);if(A0)g(A0);let f0=new Set(G0.values()),w5=new Map([...G0].map(([T0,m0])=>[m0,T0])),W5=[],l5=!1;for(let T0 of T.open){let m0=w5.get(T0);if(f0.has(T0)&&m0&&T.open.includes(m0)){l5=!0;continue}let Z5=G0.get(T0),Y5=Z5??T0;if(Z5)l5=!0;if(!W5.includes(Y5))W5.push(Y5)}if(!l5)return;let I0=G0.get(T.active)??T.active;X({tabs:{open:W5.length>0?W5:["agent"],active:I0}})},[R,J,g,X,T,Z]),z4.useEffect(()=>{if(S!=="fullscreen"||R==="agent")L(!1)},[R,S]),z4.useEffect(()=>{if(!j0)return;if(S==="fullscreen")L(!0);M((G0)=>G0+1)},[j0,S]);let p=(G0,A0)=>{if(g(G0,A0),G0==="agent")L(!1),M((f0)=>f0+1)};JY(Y,"focusTab",p),J8((G0)=>{if(G0.type==="tab:focus"&&G0.workspaceId===Y)p(G0.tab,G0.params)});let r=(G0)=>{let A0=t3(G0),f0=A0?J.find((T0)=>T0.id===A0):void 0;if(!n&&!f0||!Z0.has(G0))return;let w5=T.open.filter((T0)=>T0!==G0);if(w5.length===0)w5=["agent"];let W5=Q0.indexOf(G0),l5=Q0[W5+1]??Q0[W5-1]??w5.find((T0)=>xX(T0,Z,J))??"agent",I0=T.active===G0||!w5.includes(T.active)?l5:T.active;if(u({open:w5,active:I0}),R===G0)g(l5);if(f0?.status==="draft")_.current.get(f0.id)?.resetSketch(),I.clear(f0.id),K.discard(f0.id)},z0=(G0)=>{let A0=s3(G0.id);if(Z0.has(A0)){let f0=T.open.filter((w5)=>w5!==A0);if(f0.length===0)f0=["agent"];if(u({open:f0,active:T.active===A0?f0[0]:T.active}),R===A0)g(f0[0])}_.current.get(G0.id)?.resetSketch(),I.clear(G0.id),K.discard(G0.id)},L0=(G0)=>{let A0=QJ0(T.open,Q0,G0);if(A0===T.open)return;u({open:A0,active:T.active})},P0=(G0)=>{if(G0!==void 0)O1.getState().setComposerDraft(Y,G0);if(S==="fullscreen"&&R!=="agent"){if(L(!0),N)M((A0)=>A0+1);return}M((A0)=>A0+1)};Pm({send:l,revealChat:P0,composerAvailability:i});let v0=[...!w&&!Z0.has("agent")?[{key:"agent",Icon:C6,label:"Agent",onClick:()=>p("agent")}]:[],...!Z0.has("widgets")?[{key:"widgets",Icon:xQ,label:"Widgets",onClick:()=>p("widgets")}]:[],...!Z0.has("scratchpad")?[{key:"scratchpad",Icon:hQ,label:"Scratchpad",onClick:()=>p("scratchpad")}]:[],...Z.map((G0)=>({view:G0,tab:VF(G0.id)})).filter(({tab:G0})=>!Z0.has(G0)).map(({view:G0,tab:A0})=>({key:A0,Icon:rp(G0,J),label:lp(G0),onClick:()=>p(A0)})),...J.filter((G0)=>G0.status!=="ready").map((G0)=>({builder:G0,tab:s3(G0.id)})).filter(({tab:G0})=>!Z0.has(G0)).map(({builder:G0,tab:A0})=>({key:A0,Icon:ip(G0),label:G0.title||G0.viewId||"New view",onClick:()=>p(A0)})),{key:"create-view",Icon:up,label:"New view",onClick:()=>{K.create().then((G0)=>p(s3(G0.id)))}}],$5=N0?{sessionId:N0.sessionId,builderId:N0.id,initialValue:N0.input.requirements,onChange:(G0)=>I.change(N0.id,G0),onRemoveDrawing:()=>{_.current.get(N0.id)?.resetSketch()},onSubmit:async(G0)=>{await _.current.get(N0.id)?.prepareSketchForSend(),await K.submit(N0,G0),I.clear(N0.id)}}:void 0,F5=K5.jsx(CW,{active:S==="split",focusRequest:V,chatLoaded:e,view:j,previewTurn:t,sessionId:x,processing:$0,composerBanner:$5?V0:Y0,composerAvailability:i,send:l,stop:H0,onClose:()=>J0("fullscreen"),annotation:c0.docked,builderDraft:$5,docked:!0}),l0=K5.jsx(CW,{active:S==="fullscreen"&&R==="agent",focusRequest:V,chatLoaded:e,view:j,previewTurn:t,sessionId:x,processing:$0,composerBanner:Y0,composerAvailability:i,send:l,stop:H0}),R0=K5.jsxs("div",{className:s("@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius]",S==="split"&&"rounded-xl"),children:[K5.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[K5.jsxs("div",{ref:c0.targetRef,inert:c0.controls.active||void 0,"aria-hidden":c0.controls.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:[R==="agent"?l0:R==="widgets"?K5.jsx(ag,{editing:U==="editing",onEditingChange:(G0)=>F(G0?"editing":"idle"),widgets:$,onCreateWidget:()=>{U0(null),P0("Create widget")}}):R==="scratchpad"?K5.jsx(z4.Suspense,{fallback:null,children:K5.jsx(eZ0,{})}):null,J.filter((G0)=>G0.status!=="ready").map((G0)=>K5.jsx(vm,{ref:(A0)=>{if(A0)_.current.set(G0.id,A0);else _.current.delete(G0.id)},active:o?.id===G0.id,builder:G0,chatDocked:S==="split",workspaceId:Y,onEditingStart:()=>{if(S==="fullscreen")L(!1)},onContinueInChat:P0,onOpenChat:()=>{U0(G0.sessionId),P0()},onDiscard:()=>z0(G0)},G0.id)),K5.jsx(dm,{views:Z,activeViewId:f?.id??null,params:b})]}),K5.jsx(YY,{...c0.layerProps,children:K5.jsx(BY,{controls:c0.controls,title:"Draw annotation",busy:c0.controls.finishing,onComplete:()=>void c0.controls.finish()})})]}),K5.jsx(s8,{children:U==="customizing"&&K5.jsx(Oh,{onClose:()=>F("idle")})}),K5.jsxs(ng,{children:[K5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[K5.jsxs("div",{className:"flex items-center gap-2",children:[K5.jsx("img",{src:G??M2[H??"claude-code"],alt:"",className:"size-5 shrink-0 rounded-xs"}),z&&K5.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:z})]}),K5.jsx(Hp,{tabs:m,active:R,createItems:v0,onSelect:p,onClose:r,onReorder:L0})]}),K5.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K5.jsx(ZJ0,{active:U==="customizing",onToggle:()=>F(U==="customizing"?"idle":"customizing")}),K5.jsx(Om,{}),h&&B&&S==="fullscreen"&&K5.jsx($J0,{onToggleMode:()=>J0("split")})]})]})]});return K5.jsxs("div",{className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[K5.jsx("div",{ref:W,className:"flex min-h-0 flex-1",children:h&&B&&q?K5.jsx(pp,{...q,workspace:R0,chat:F5,open:S==="split",chatWidth:O,onCollapse:()=>J0("fullscreen"),onChatWidthChange:D}):R0}),S==="fullscreen"&&R!=="agent"&&h&&K5.jsx(Dh,{loading:C,open:N,onOpenChange:L,onOpenChangeComplete:(G0)=>{if(G0)M((A0)=>A0+1)},children:(G0)=>K5.jsx(CW,{active:N,focusRequest:V,chatLoaded:e,view:j,previewTurn:t,sessionId:x,processing:$0,composerBanner:$5?V0:Y0,composerAvailability:i,send:l,stop:H0,onClose:G0,annotation:c0.popup,builderDraft:$5})})]})}var _B=P(v(),1);function np($,Z,J,Q){let X=_B.useRef(null);_B.useEffect(()=>{if(!Z)return;let z=new Map(Z.map((U)=>[U.id,{w:U.config.colSpan,h:U.config.rowSpan}]));if(X.current?.workspaceId!==$){X.current={workspaceId:$,sizes:z};return}let G=X.current.sizes,H=new Set(J.widgetGrid.map((U)=>U.i)),Y=Z.filter((U)=>{if(!G.has(U.id))return!H.has(U.id);if(!H.has(U.id))return!1;let N=G.get(U.id);return N.w!==U.config.colSpan||N.h!==U.config.rowSpan});if(X.current={workspaceId:$,sizes:z},Y.length===0)return;let K=new Map(Z.map((U)=>[U.id,U.config])),W=J.widgetGrid.filter((U)=>!Y.some((F)=>F.id===U.i)&&K.has(U.i)).map((U)=>{let F=K.get(U.i);return{i:U.i,x:U.x,y:U.y,w:F.colSpan,h:F.rowSpan}}),B=W.map(({i:U,x:F,y:N})=>({i:U,x:F,y:N})),q=[...W];for(let U of Y){let F=qX(q,U.config.colSpan,U.config.rowSpan,4);B.push({i:U.id,x:F.x,y:F.y}),q.push({i:U.id,x:F.x,y:F.y,w:U.config.colSpan,h:U.config.rowSpan})}Q({widgetGrid:B})},[$,Z,J.widgetGrid,Q])}var k2=P(c(),1);function sp({id:$}){return k2.jsx(op,{id:$,children:k2.jsx(eT,{id:$,children:k2.jsx(XJ0,{id:$})})})}function XJ0({id:$}){let Z=s0(),[J]=Q6(),{layout:Q,setLayout:X,isLoading:z}=X1(),G=aT($),H=HY($),Y=HB($);np($,G.data,Q,X),cT(),J8((W)=>{if(W.type==="theme:updated"||W.type==="workspace:updated")Z.invalidateQueries({queryKey:E0.layout($)});else if(W.type==="widget-layout:updated"||W.type==="widget:updated")Z.invalidateQueries({queryKey:E0.widgets($)});else if(W.type==="view-layout:updated"||W.type==="view:updated")Z.invalidateQueries({queryKey:E0.views($)})});let K=z||J===void 0||G.isLoading||H.isLoading||Y.isLoading;return k2.jsx(k2.Fragment,{children:k2.jsx(XH,{children:K?k2.jsx("div",{className:"flex h-full items-center justify-center",children:k2.jsx(ST,{sprite:"moi",effect:"chaos"})}):k2.jsx(ap,{widgets:G.data??[],views:H.data??[],builders:Y.data??[]})})})}var D9=P(c(),1),tp=null;function zJ0(){if(!tp)return D9.jsx(vA,{to:"/"});return D9.jsx(DB.Suspense,{fallback:null,children:D9.jsx(tp,{})})}function ep(){let[,$]=f4();return DB.useEffect(()=>{return aq((Z)=>$(`/workspace/${Z}`)),()=>aq(null)},[$]),D9.jsxs(gA,{children:[D9.jsx(Jz,{path:"/",component:PT}),D9.jsx(Jz,{path:"/dev/*?",component:zJ0}),D9.jsx(Jz,{path:"/workspace/:id/*?",children:(Z)=>D9.jsx(sp,{id:Z.id},Z.id)})]})}var G3=P(c(),1),Zu=new bB;kO(Zu);LO();function oG5($){function Z(){return G3.jsx(hB,{client:Zu,children:G3.jsxs(FO,{children:[G3.jsx(lB,{children:G3.jsx(ep,{})}),G3.jsx(vD,{}),!1]})})}$u.createRoot($).render(G3.jsx(Z,{}))}export{oG5 as mount};
|