moi-computer 0.3.1-next.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -12
- package/client/api/workspace-keys.ts +2 -2
- package/client/app/AppRouter.tsx +0 -2
- package/client/app/shell/SidebarLayout.tsx +3 -16
- package/client/assets/openai.svg +1 -3
- package/client/components/shared/Composer.tsx +53 -2
- package/client/components/ui/button.tsx +1 -1
- package/client/components/ui/tooltip.tsx +12 -15
- package/client/features/chat/ChatComposer.tsx +25 -15
- package/client/features/chat/ChatPanel.tsx +5 -2
- package/client/features/chat/MarkdownContent.tsx +20 -2
- package/client/features/chat/ModelPicker.tsx +5 -3
- package/client/features/chat/TurnView.tsx +2 -2
- package/client/features/chat/chat-frames.ts +13 -6
- package/client/features/chat/chat-send.ts +1 -1
- package/client/features/chat/chat-store.ts +22 -17
- package/client/features/chat/tool-group/ToolOutput.tsx +4 -12
- package/client/features/chat/tool-group/format.ts +22 -7
- package/client/features/chat/useChat.ts +11 -2
- package/client/features/connectors/McpServerCards.tsx +95 -0
- package/client/features/connectors/api.ts +0 -11
- package/client/features/dev/HarnessDebugPage.tsx +210 -74
- package/client/features/home/HomePage.tsx +33 -28
- package/client/features/home/api.ts +24 -12
- package/client/features/home/workspace-presentation.tsx +17 -15
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +243 -0
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +95 -0
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +230 -0
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +35 -0
- package/client/features/home/workspace-setup/useWorkspaceImport.ts +61 -0
- package/client/features/settings/ConnectorsSettings.tsx +89 -0
- package/client/features/settings/SettingsLayout.tsx +2 -2
- package/client/features/settings/WorkspaceSettings.tsx +8 -4
- package/client/features/views/ViewBuilderTab.tsx +19 -15
- package/client/features/views/useViewBuilderActions.ts +1 -1
- package/client/features/workspace/WorkspaceLayoutContext.tsx +3 -4
- package/client/features/workspace/WorkspaceScreen.tsx +11 -3
- package/client/features/workspace/api.ts +19 -1
- package/client/features/workspace/moi-context.ts +85 -0
- package/client/main.tsx +16 -5
- package/dist/chunk-19g80zc9.css +1 -0
- package/dist/{chunk-jen6xcm1.js → chunk-2vaafjp4.js} +1 -1
- package/dist/{chunk-vkvb3hjm.js → chunk-35fq49qa.js} +1 -1
- package/dist/chunk-69nhbjhy.js +50 -0
- package/dist/{chunk-axszxe4c.js → chunk-72atbmh3.js} +1 -1
- package/dist/{chunk-zpxrb1ce.js → chunk-7mkv2gr0.js} +2 -2
- package/dist/{chunk-cs8vbert.js → chunk-fh2mf6v9.js} +3 -3
- package/dist/chunk-gt7n06ef.js +1 -0
- package/dist/chunk-jwmc32rp.js +63 -0
- package/dist/chunk-kh24bstm.js +10 -0
- package/dist/chunk-sfa4mbmx.js +15 -0
- package/dist/index.html +1 -1
- package/dist/openai-ep9ht2pq.svg +1 -0
- package/lib/ids.ts +15 -0
- package/lib/moi-context.ts +170 -0
- package/lib/types.ts +29 -11
- package/lib/view-builder-directives.ts +16 -0
- package/lib/workspace-types.ts +12 -0
- package/package.json +2 -1
- package/server/api.ts +92 -30
- package/server/harness/README.md +25 -9
- package/server/harness/claude-code/NOTES.md +20 -6
- package/server/harness/claude-code/adapter.ts +2 -2
- package/server/harness/claude-code/git-worktree.ts +32 -0
- package/server/harness/claude-code/index.ts +33 -12
- package/server/harness/claude-code/mcp.ts +16 -65
- package/server/harness/claude-code/models.ts +3 -0
- package/server/harness/claude-code/session.ts +196 -61
- package/server/harness/codex/NOTES.md +41 -11
- package/server/harness/codex/adapter.ts +121 -16
- package/server/harness/codex/client.ts +67 -18
- package/server/harness/codex/discovery.ts +114 -0
- package/server/harness/codex/index.ts +10 -5
- package/server/harness/codex/probe.ts +4 -2
- package/server/harness/codex/session.ts +89 -13
- package/server/harness/executable.ts +82 -0
- package/server/harness/openclaw/adapter.ts +8 -1
- package/server/harness/openclaw/index.ts +8 -14
- package/server/harness/openclaw/session.ts +50 -10
- package/server/harness/openclaw/strip.ts +2 -2
- package/server/harness/shell-path.ts +79 -0
- package/server/harness/types.ts +22 -5
- package/server/registry.ts +57 -12
- package/server/view-builders.ts +3 -2
- package/server/web.ts +24 -8
- package/server/workspace-import.ts +45 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +3 -3
- package/client/features/connectors/ConnectorsPage.tsx +0 -92
- package/client/features/connectors/McpMenu.tsx +0 -145
- package/client/features/home/CreateWorkspaceDialog.tsx +0 -130
- package/client/features/home/CreateWorkspaceDialogSteps.tsx +0 -234
- package/dist/chunk-4vf1t6v1.js +0 -10
- package/dist/chunk-6c8cwpzc.js +0 -1
- package/dist/chunk-b3ynfk4g.js +0 -62
- package/dist/chunk-b4b276wx.js +0 -15
- package/dist/chunk-kxmvv1ax.js +0 -48
- package/dist/chunk-npwq6jmr.css +0 -1
- package/dist/openai-h13pza4b.svg +0 -3
- package/lib/view-builder-meta.ts +0 -35
package/dist/chunk-b3ynfk4g.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import{b as w7,c as Xl,e as oq,f as GH,g as _G,h as kU,i as RU,j as S4,k as I3,l as yU,m as YH,n as bU,o as xU,p as K$,q as FU,r as sG,s as nG,t as oG,u as tG,v as eG,w as ZH,y as W9}from"/chunk-zpxrb1ce.js";import{$ as WS,A as p9,B as jS,C as GJ,D as Z8,E as wS,F as _B,G as K1,H as Y0,I as RV,J as $0,K as p7,L as w0,M as oX,N as v5,O as Z9,P as X$,Q as P1,R as WZ,S as N1,T as M_,U as JQ,V as pU,W as C6,X as q_,Y as k2,Z as iV,_ as K0,aa as $Z,ba as I0,ca as AB,da as WH,ea as MS,fa as GK,z as GU}from"/chunk-b4b276wx.js";import{$b as kC,Aa as fT,Ab as h6,Ac as AS,Ba as pT,Bb as LC,Bc as o9,Ca as uT,Cb as s5,Cc as yj,Da as R_,Dc as n1,Ea as cT,Eb as NC,Fa as L8,Fb as _C,Ga as AX,Gb as XJ,Ha as pC,Hb as AC,Ia as dT,Ib as MC,Ja as lT,Jb as Kq,Ka as iT,Kb as tL,Lb as DC,Ma as rT,Mb as OC,Na as aT,Oa as sT,Ob as wC,Pa as nT,Qa as oT,Qb as PC,Ra as DN,Rb as jC,Sb as TC,Ta as tT,Tb as CC,Ua as N8,Ub as cj,Va as eT,Vb as SC,Wa as ZC,Xa as JC,Xb as cC,Ya as G6,Yb as IC,Za as $C,_a as XC,_b as EC,ab as QC,ac as H9,bb as YC,bc as NB,cc as XL,db as GC,dc as nJ,eb as bY,ec as D7,fb as Wq,ga as m,gb as US,gc as lV,ha as a,hb as HC,hc as L1,ia as ZV,ic as u1,jb as G7,jc as qV,ka as ET,kb as zC,kc as S$,la as WP,lb as WC,ma as kT,mb as KC,nb as VP,oa as zQ,ob as uC,pa as fC,pb as qC,pc as oV,qa as zq,qb as VC,qc as S6,ra as RT,rb as UC,rc as T6,sa as yT,sb as xY,ta as bT,tb as WQ,tc as tJ,ua as xT,ub as BC,uc as D3,va as hT,vb as FC,wa as vT,xa as VS,xc as aK,ya as gT,yc as B0,za as mT,zb as i_,zc as h5}from"/chunk-4vf1t6v1.js";import{Ec as j,Fc as d1,Gc as t7,Hc as nK}from"/chunk-vkvb3hjm.js";var zA=d1((DW0,HA)=>{var XA=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,jb=/\n/g,Tb=/^\s*/,Cb=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Sb=/^:\s*/,Ib=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Eb=/^[;\s]*/,kb=/^\s+|\s+$/g,Rb=`
|
|
2
|
-
`,QA="/",YA="*",r4="",yb="comment",bb="declaration";function xb(Z,J){if(typeof Z!=="string")throw TypeError("First argument must be a string");if(!Z)return[];J=J||{};var $=1,X=1;function Q(B){var F=B.match(jb);if(F)$+=F.length;var N=B.lastIndexOf(Rb);X=~N?B.length-N:X+B.length}function Y(){var B={line:$,column:X};return function(F){return F.position=new G(B),W(),F}}function G(B){this.start=B,this.end={line:$,column:X},this.source=J.source}G.prototype.content=Z;function H(B){var F=Error(J.source+":"+$+":"+X+": "+B);if(F.reason=B,F.filename=J.source,F.line=$,F.column=X,F.source=Z,J.silent);else throw F}function z(B){var F=B.exec(Z);if(!F)return;var N=F[0];return Q(N),Z=Z.slice(N.length),F}function W(){z(Tb)}function K(B){var F;B=B||[];while(F=q())if(F!==!1)B.push(F);return B}function q(){var B=Y();if(QA!=Z.charAt(0)||YA!=Z.charAt(1))return;var F=2;while(r4!=Z.charAt(F)&&(YA!=Z.charAt(F)||QA!=Z.charAt(F+1)))++F;if(F+=2,r4===Z.charAt(F-1))return H("End of comment missing");var N=Z.slice(2,F-2);return X+=2,Q(N),Z=Z.slice(F),X+=2,B({type:yb,comment:N})}function V(){var B=Y(),F=z(Cb);if(!F)return;if(q(),!z(Sb))return H("property missing ':'");var N=z(Ib),L=B({type:bb,property:GA(F[0].replace(XA,r4)),value:N?GA(N[0].replace(XA,r4)):r4});return z(Eb),L}function U(){var B=[];K(B);var F;while(F=V())if(F!==!1)B.push(F),K(B);return B}return W(),U()}function GA(Z){return Z?Z.replace(kb,r4):r4}HA.exports=xb});var WA=d1((FZ)=>{var hb=FZ&&FZ.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(FZ,"__esModule",{value:!0});FZ.default=gb;var vb=hb(zA());function gb(Z,J){let $=null;if(!Z||typeof Z!=="string")return $;let X=(0,vb.default)(Z),Q=typeof J==="function";return X.forEach((Y)=>{if(Y.type!=="declaration")return;let{property:G,value:H}=Y;if(Q)J(G,H,Y);else if(H)$=$||{},$[G]=H}),$}});var UA=d1((qA)=>{Object.defineProperty(qA,"__esModule",{value:!0});qA.camelCase=void 0;var mb=/^--[a-zA-Z0-9_-]+$/,fb=/-([a-z])/g,pb=/^[^-]+$/,ub=/^-(webkit|moz|ms|o|khtml)-/,cb=/^-(ms)-/,db=function(Z){return!Z||pb.test(Z)||mb.test(Z)},lb=function(Z,J){return J.toUpperCase()},KA=function(Z,J){return"".concat(J,"-")},ib=function(Z,J){if(J===void 0)J={};if(db(Z))return Z;if(Z=Z.toLowerCase(),J.reactCompat)Z=Z.replace(cb,KA);else Z=Z.replace(ub,KA);return Z.replace(fb,lb)};qA.camelCase=ib});var FA=d1((Pz,BA)=>{var rb=Pz&&Pz.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}},ab=rb(WA()),sb=UA();function wz(Z,J){var $={};if(!Z||typeof Z!=="string")return $;return(0,ab.default)(Z,function(X,Q){if(X&&Q)$[(0,sb.camelCase)(X,J)]=Q}),$}wz.default=wz;BA.exports=wz});var hM=d1((VF0,xM)=>{var pQ=Object.prototype.hasOwnProperty,bM=Object.prototype.toString,SM=Object.defineProperty,IM=Object.getOwnPropertyDescriptor,EM=function(J){if(typeof Array.isArray==="function")return Array.isArray(J);return bM.call(J)==="[object Array]"},kM=function(J){if(!J||bM.call(J)!=="[object Object]")return!1;var $=pQ.call(J,"constructor"),X=J.constructor&&J.constructor.prototype&&pQ.call(J.constructor.prototype,"isPrototypeOf");if(J.constructor&&!$&&!X)return!1;var Q;for(Q in J);return typeof Q>"u"||pQ.call(J,Q)},RM=function(J,$){if(SM&&$.name==="__proto__")SM(J,$.name,{enumerable:!0,configurable:!0,value:$.newValue,writable:!0});else J[$.name]=$.newValue},yM=function(J,$){if($==="__proto__"){if(!pQ.call(J,$))return;else if(IM)return IM(J,$).value}return J[$]};xM.exports=function Z(){var J,$,X,Q,Y,G,H=arguments[0],z=1,W=arguments.length,K=!1;if(typeof H==="boolean")K=H,H=arguments[1]||{},z=2;if(H==null||typeof H!=="object"&&typeof H!=="function")H={};for(;z<W;++z)if(J=arguments[z],J!=null){for($ in J)if(X=yM(H,$),Q=yM(J,$),H!==Q){if(K&&Q&&(kM(Q)||(Y=EM(Q)))){if(Y)Y=!1,G=X&&EM(X)?X:[];else G=X&&kM(X)?X:{};RM(H,{name:$,newValue:Z(K,G,Q)})}else if(typeof Q<"u")RM(H,{name:$,newValue:Q})}}return H}});var SO=d1((yN0,CO)=>{function VO(Z){if(Z instanceof Map)Z.clear=Z.delete=Z.set=function(){throw Error("map is read-only")};else if(Z instanceof Set)Z.add=Z.clear=Z.delete=function(){throw Error("set is read-only")};return Object.freeze(Z),Object.getOwnPropertyNames(Z).forEach((J)=>{let $=Z[J],X=typeof $;if((X==="object"||X==="function")&&!Object.isFrozen($))VO($)}),Z}class LW{constructor(Z){if(Z.data===void 0)Z.data={};this.data=Z.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function UO(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function o2(Z,...J){let $=Object.create(null);for(let X in Z)$[X]=Z[X];return J.forEach(function(X){for(let Q in X)$[Q]=X[Q]}),$}var Mg="</span>",GO=(Z)=>{return!!Z.scope},Dg=(Z,{prefix:J})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){let $=Z.split(".");return[`${J}${$.shift()}`,...$.map((X,Q)=>`${X}${"_".repeat(Q+1)}`)].join(" ")}return`${J}${Z}`};class BO{constructor(Z,J){this.buffer="",this.classPrefix=J.classPrefix,Z.walk(this)}addText(Z){this.buffer+=UO(Z)}openNode(Z){if(!GO(Z))return;let J=Dg(Z.scope,{prefix:this.classPrefix});this.span(J)}closeNode(Z){if(!GO(Z))return;this.buffer+=Mg}value(){return this.buffer}span(Z){this.buffer+=`<span class="${Z}">`}}var HO=(Z={})=>{let J={children:[]};return Object.assign(J,Z),J};class NW{constructor(){this.rootNode=HO(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Z){this.top.children.push(Z)}openNode(Z){let J=HO({scope:Z});this.add(J),this.stack.push(J)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Z){return this.constructor._walk(Z,this.rootNode)}static _walk(Z,J){if(typeof J==="string")Z.addText(J);else if(J.children)Z.openNode(J),J.children.forEach(($)=>this._walk(Z,$)),Z.closeNode(J);return Z}static _collapse(Z){if(typeof Z==="string")return;if(!Z.children)return;if(Z.children.every((J)=>typeof J==="string"))Z.children=[Z.children.join("")];else Z.children.forEach((J)=>{NW._collapse(J)})}}class FO extends NW{constructor(Z){super();this.options=Z}addText(Z){if(Z==="")return;this.add(Z)}startScope(Z){this.openNode(Z)}endScope(){this.closeNode()}__addSublanguage(Z,J){let $=Z.root;if(J)$.scope=`language:${J}`;this.add($)}toHTML(){return new BO(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function RZ(Z){if(!Z)return null;if(typeof Z==="string")return Z;return Z.source}function LO(Z){return X6("(?=",Z,")")}function Og(Z){return X6("(?:",Z,")*")}function wg(Z){return X6("(?:",Z,")?")}function X6(...Z){return Z.map(($)=>RZ($)).join("")}function Pg(Z){let J=Z[Z.length-1];if(typeof J==="object"&&J.constructor===Object)return Z.splice(Z.length-1,1),J;else return{}}function _W(...Z){return"("+(Pg(Z).capture?"":"?:")+Z.map((X)=>RZ(X)).join("|")+")"}function NO(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function jg(Z,J){let $=Z&&Z.exec(J);return $&&$.index===0}var Tg=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function AW(Z,{joinWith:J}){let $=0;return Z.map((X)=>{$+=1;let Q=$,Y=RZ(X),G="";while(Y.length>0){let H=Tg.exec(Y);if(!H){G+=Y;break}if(G+=Y.substring(0,H.index),Y=Y.substring(H.index+H[0].length),H[0][0]==="\\"&&H[1])G+="\\"+String(Number(H[1])+Q);else if(G+=H[0],H[0]==="(")$++}return G}).map((X)=>`(${X})`).join(J)}var Cg=/\b\B/,_O="[a-zA-Z]\\w*",MW="[a-zA-Z_]\\w*",AO="\\b\\d+(\\.\\d+)?",MO="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",DO="\\b(0b[01]+)",Sg="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ig=(Z={})=>{let J=/^#![ ]*\//;if(Z.binary)Z.begin=X6(J,/.*\b/,Z.binary,/\b.*/);return o2({scope:"meta",begin:J,end:/$/,relevance:0,"on:begin":($,X)=>{if($.index!==0)X.ignoreMatch()}},Z)},yZ={begin:"\\\\[\\s\\S]",relevance:0},Eg={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[yZ]},kg={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[yZ]},Rg={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/},eQ=function(Z,J,$={}){let X=o2({scope:"comment",begin:Z,end:J,contains:[]},$);X.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 Q=_W("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 X.contains.push({begin:X6(/[ ]+/,"(",Q,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),X},yg=eQ("//","$"),bg=eQ("/\\*","\\*/"),xg=eQ("#","$"),hg={scope:"number",begin:AO,relevance:0},vg={scope:"number",begin:MO,relevance:0},gg={scope:"number",begin:DO,relevance:0},mg={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[yZ,{begin:/\[/,end:/\]/,relevance:0,contains:[yZ]}]},fg={scope:"title",begin:_O,relevance:0},pg={scope:"title",begin:MW,relevance:0},ug={begin:"\\.\\s*"+MW,relevance:0},cg=function(Z){return Object.assign(Z,{"on:begin":(J,$)=>{$.data._beginMatch=J[1]},"on:end":(J,$)=>{if($.data._beginMatch!==J[1])$.ignoreMatch()}})},oQ=Object.freeze({__proto__:null,APOS_STRING_MODE:Eg,BACKSLASH_ESCAPE:yZ,BINARY_NUMBER_MODE:gg,BINARY_NUMBER_RE:DO,COMMENT:eQ,C_BLOCK_COMMENT_MODE:bg,C_LINE_COMMENT_MODE:yg,C_NUMBER_MODE:vg,C_NUMBER_RE:MO,END_SAME_AS_BEGIN:cg,HASH_COMMENT_MODE:xg,IDENT_RE:_O,MATCH_NOTHING_RE:Cg,METHOD_GUARD:ug,NUMBER_MODE:hg,NUMBER_RE:AO,PHRASAL_WORDS_MODE:Rg,QUOTE_STRING_MODE:kg,REGEXP_MODE:mg,RE_STARTERS_RE:Sg,SHEBANG:Ig,TITLE_MODE:fg,UNDERSCORE_IDENT_RE:MW,UNDERSCORE_TITLE_MODE:pg});function dg(Z,J){if(Z.input[Z.index-1]===".")J.ignoreMatch()}function lg(Z,J){if(Z.className!==void 0)Z.scope=Z.className,delete Z.className}function ig(Z,J){if(!J)return;if(!Z.beginKeywords)return;if(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=dg,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0)Z.relevance=0}function rg(Z,J){if(!Array.isArray(Z.illegal))return;Z.illegal=_W(...Z.illegal)}function ag(Z,J){if(!Z.match)return;if(Z.begin||Z.end)throw Error("begin & end are not supported with match");Z.begin=Z.match,delete Z.match}function sg(Z,J){if(Z.relevance===void 0)Z.relevance=1}var ng=(Z,J)=>{if(!Z.beforeMatch)return;if(Z.starts)throw Error("beforeMatch cannot be used with starts");let $=Object.assign({},Z);Object.keys(Z).forEach((X)=>{delete Z[X]}),Z.keywords=$.keywords,Z.begin=X6($.beforeMatch,LO($.begin)),Z.starts={relevance:0,contains:[Object.assign($,{endsParent:!0})]},Z.relevance=0,delete $.beforeMatch},og=["of","and","for","in","not","or","if","then","parent","list","value"],tg="keyword";function OO(Z,J,$=tg){let X=Object.create(null);if(typeof Z==="string")Q($,Z.split(" "));else if(Array.isArray(Z))Q($,Z);else Object.keys(Z).forEach(function(Y){Object.assign(X,OO(Z[Y],J,Y))});return X;function Q(Y,G){if(J)G=G.map((H)=>H.toLowerCase());G.forEach(function(H){let z=H.split("|");X[z[0]]=[Y,eg(z[0],z[1])]})}}function eg(Z,J){if(J)return Number(J);return Zm(Z)?0:1}function Zm(Z){return og.includes(Z.toLowerCase())}var zO={},$6=(Z)=>{console.error(Z)},WO=(Z,...J)=>{console.log(`WARN: ${Z}`,...J)},E8=(Z,J)=>{if(zO[`${Z}/${J}`])return;console.log(`Deprecated as of ${Z}. ${J}`),zO[`${Z}/${J}`]=!0},tQ=Error();function wO(Z,J,{key:$}){let X=0,Q=Z[$],Y={},G={};for(let H=1;H<=J.length;H++)G[H+X]=Q[H],Y[H+X]=!0,X+=NO(J[H-1]);Z[$]=G,Z[$]._emit=Y,Z[$]._multi=!0}function Jm(Z){if(!Array.isArray(Z.begin))return;if(Z.skip||Z.excludeBegin||Z.returnBegin)throw $6("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),tQ;if(typeof Z.beginScope!=="object"||Z.beginScope===null)throw $6("beginScope must be object"),tQ;wO(Z,Z.begin,{key:"beginScope"}),Z.begin=AW(Z.begin,{joinWith:""})}function $m(Z){if(!Array.isArray(Z.end))return;if(Z.skip||Z.excludeEnd||Z.returnEnd)throw $6("skip, excludeEnd, returnEnd not compatible with endScope: {}"),tQ;if(typeof Z.endScope!=="object"||Z.endScope===null)throw $6("endScope must be object"),tQ;wO(Z,Z.end,{key:"endScope"}),Z.end=AW(Z.end,{joinWith:""})}function Xm(Z){if(Z.scope&&typeof Z.scope==="object"&&Z.scope!==null)Z.beginScope=Z.scope,delete Z.scope}function Qm(Z){if(Xm(Z),typeof Z.beginScope==="string")Z.beginScope={_wrap:Z.beginScope};if(typeof Z.endScope==="string")Z.endScope={_wrap:Z.endScope};Jm(Z),$m(Z)}function Ym(Z){function J(G,H){return new RegExp(RZ(G),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(H?"g":""))}class ${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+=NO(G)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let G=this.regexes.map((H)=>H[1]);this.matcherRe=J(AW(G,{joinWith:"|"}),!0),this.lastIndex=0}exec(G){this.matcherRe.lastIndex=this.lastIndex;let H=this.matcherRe.exec(G);if(!H)return null;let z=H.findIndex((K,q)=>q>0&&K!==void 0),W=this.matchIndexes[z];return H.splice(0,z),Object.assign(H,W)}}class X{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 $;return this.rules.slice(G).forEach(([z,W])=>H.addRule(z,W)),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 z=H.exec(G);if(this.resumingScanAtSamePosition())if(z&&z.index===this.lastIndex);else{let W=this.getMatcher(0);W.lastIndex=this.lastIndex+1,z=W.exec(G)}if(z){if(this.regexIndex+=z.position+1,this.regexIndex===this.count)this.considerAll()}return z}}function Q(G){let H=new X;if(G.contains.forEach((z)=>H.addRule(z.begin,{rule:z,type:"begin"})),G.terminatorEnd)H.addRule(G.terminatorEnd,{type:"end"});if(G.illegal)H.addRule(G.illegal,{type:"illegal"});return H}function Y(G,H){let z=G;if(G.isCompiled)return z;[lg,ag,Qm,ng].forEach((K)=>K(G,H)),Z.compilerExtensions.forEach((K)=>K(G,H)),G.__beforeBegin=null,[ig,rg,sg].forEach((K)=>K(G,H)),G.isCompiled=!0;let W=null;if(typeof G.keywords==="object"&&G.keywords.$pattern)G.keywords=Object.assign({},G.keywords),W=G.keywords.$pattern,delete G.keywords.$pattern;if(W=W||/\w+/,G.keywords)G.keywords=OO(G.keywords,Z.case_insensitive);if(z.keywordPatternRe=J(W,!0),H){if(!G.begin)G.begin=/\B|\b/;if(z.beginRe=J(z.begin),!G.end&&!G.endsWithParent)G.end=/\B|\b/;if(G.end)z.endRe=J(z.end);if(z.terminatorEnd=RZ(z.end)||"",G.endsWithParent&&H.terminatorEnd)z.terminatorEnd+=(G.end?"|":"")+H.terminatorEnd}if(G.illegal)z.illegalRe=J(G.illegal);if(!G.contains)G.contains=[];if(G.contains=[].concat(...G.contains.map(function(K){return Gm(K==="self"?G:K)})),G.contains.forEach(function(K){Y(K,z)}),G.starts)Y(G.starts,H);return z.matcher=Q(z),z}if(!Z.compilerExtensions)Z.compilerExtensions=[];if(Z.contains&&Z.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Z.classNameAliases=o2(Z.classNameAliases||{}),Y(Z)}function PO(Z){if(!Z)return!1;return Z.endsWithParent||PO(Z.starts)}function Gm(Z){if(Z.variants&&!Z.cachedVariants)Z.cachedVariants=Z.variants.map(function(J){return o2(Z,{variants:null},J)});if(Z.cachedVariants)return Z.cachedVariants;if(PO(Z))return o2(Z,{starts:Z.starts?o2(Z.starts):null});if(Object.isFrozen(Z))return o2(Z);return Z}var Hm="11.11.1";class jO extends Error{constructor(Z,J){super(Z);this.name="HTMLInjectionError",this.html=J}}var FW=UO,KO=o2,qO=Symbol("nomatch"),zm=7,TO=function(Z){let J=Object.create(null),$=Object.create(null),X=[],Q=!0,Y="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:FO};function z(R){return H.noHighlightRe.test(R)}function W(R){let x=R.className+" ";x+=R.parentNode?R.parentNode.className:"";let v=H.languageDetectRe.exec(x);if(v){let d=S(v[1]);if(!d)WO(Y.replace("{}",v[1])),WO("Falling back to no-highlight mode for this block.",R);return d?v[1]:"no-highlight"}return x.split(/\s+/).find((d)=>z(d)||S(d))}function K(R,x,v){let d="",w="";if(typeof x==="object")d=R,v=x.ignoreIllegals,w=x.language;else E8("10.7.0","highlight(lang, code, ...args) has been deprecated."),E8("10.7.0",`Please use highlight(code, options) instead.
|
|
3
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),w=R,d=x;if(v===void 0)v=!0;let z0={code:d,language:w};y("before:highlight",z0);let G0=z0.result?z0.result:q(z0.language,z0.code,v);return G0.code=z0.code,y("after:highlight",G0),G0}function q(R,x,v,d){let w=Object.create(null);function z0(h,c){return h.keywords[c]}function G0(){if(!r.keywords){f.addText(u);return}let h=0;r.keywordPatternRe.lastIndex=0;let c=r.keywordPatternRe.exec(u),t="";while(c){t+=u.substring(h,c.index);let U0=_0.case_insensitive?c[0].toLowerCase():c[0],C0=z0(r,U0);if(C0){let[m0,w1]=C0;if(f.addText(t),t="",w[U0]=(w[U0]||0)+1,w[U0]<=zm)L0+=w1;if(m0.startsWith("_"))t+=c[0];else{let b1=_0.classNameAliases[m0]||m0;A0(c[0],b1)}}else t+=c[0];h=r.keywordPatternRe.lastIndex,c=r.keywordPatternRe.exec(u)}t+=u.substring(h),f.addText(t)}function E(){if(u==="")return;let h=null;if(typeof r.subLanguage==="string"){if(!J[r.subLanguage]){f.addText(u);return}h=q(r.subLanguage,u,!0,o[r.subLanguage]),o[r.subLanguage]=h._top}else h=U(u,r.subLanguage.length?r.subLanguage:null);if(r.relevance>0)L0+=h.relevance;f.__addSublanguage(h._emitter,h.language)}function s(){if(r.subLanguage!=null)E();else G0();u=""}function A0(h,c){if(h==="")return;f.startScope(c),f.addText(h),f.endScope()}function l(h,c){let t=1,U0=c.length-1;while(t<=U0){if(!h._emit[t]){t++;continue}let C0=_0.classNameAliases[h[t]]||h[t],m0=c[t];if(C0)A0(m0,C0);else u=m0,G0(),u="";t++}}function H0(h,c){if(h.scope&&typeof h.scope==="string")f.openNode(_0.classNameAliases[h.scope]||h.scope);if(h.beginScope){if(h.beginScope._wrap)A0(u,_0.classNameAliases[h.beginScope._wrap]||h.beginScope._wrap),u="";else if(h.beginScope._multi)l(h.beginScope,c),u=""}return r=Object.create(h,{parent:{value:r}}),r}function q0(h,c,t){let U0=jg(h.endRe,t);if(U0){if(h["on:end"]){let C0=new LW(h);if(h["on:end"](c,C0),C0.isMatchIgnored)U0=!1}if(U0){while(h.endsParent&&h.parent)h=h.parent;return h}}if(h.endsWithParent)return q0(h.parent,c,t)}function X0(h){if(r.matcher.regexIndex===0)return u+=h[0],1;else return l0=!0,0}function Q0(h){let c=h[0],t=h.rule,U0=new LW(t),C0=[t.__beforeBegin,t["on:begin"]];for(let m0 of C0){if(!m0)continue;if(m0(h,U0),U0.isMatchIgnored)return X0(c)}if(t.skip)u+=c;else{if(t.excludeBegin)u+=c;if(s(),!t.returnBegin&&!t.excludeBegin)u=c}return H0(t,h),t.returnBegin?0:c.length}function V0(h){let c=h[0],t=x.substring(h.index),U0=q0(r,h,t);if(!U0)return qO;let C0=r;if(r.endScope&&r.endScope._wrap)s(),A0(c,r.endScope._wrap);else if(r.endScope&&r.endScope._multi)s(),l(r.endScope,h);else if(C0.skip)u+=c;else{if(!(C0.returnEnd||C0.excludeEnd))u+=c;if(s(),C0.excludeEnd)u=c}do{if(r.scope)f.closeNode();if(!r.skip&&!r.subLanguage)L0+=r.relevance;r=r.parent}while(r!==U0.parent);if(U0.starts)H0(U0.starts,h);return C0.returnEnd?0:c.length}function p(){let h=[];for(let c=r;c!==_0;c=c.parent)if(c.scope)h.unshift(c.scope);h.forEach((c)=>f.openNode(c))}let Z0={};function e(h,c){let t=c&&c[0];if(u+=h,t==null)return s(),0;if(Z0.type==="begin"&&c.type==="end"&&Z0.index===c.index&&t===""){if(u+=x.slice(c.index,c.index+1),!Q){let U0=Error(`0 width match regex (${R})`);throw U0.languageName=R,U0.badRule=Z0.rule,U0}return 1}if(Z0=c,c.type==="begin")return Q0(c);else if(c.type==="illegal"&&!v){let U0=Error('Illegal lexeme "'+t+'" for mode "'+(r.scope||"<unnamed>")+'"');throw U0.mode=r,U0}else if(c.type==="end"){let U0=V0(c);if(U0!==qO)return U0}if(c.type==="illegal"&&t==="")return u+=`
|
|
4
|
-
`,1;if(h0>1e5&&h0>c.index*3)throw Error("potential infinite loop, way more iterations than matches");return u+=t,t.length}let _0=S(R);if(!_0)throw $6(Y.replace("{}",R)),Error('Unknown language: "'+R+'"');let i=Ym(_0),W0="",r=d||i,o={},f=new H.__emitter(H);p();let u="",L0=0,M0=0,h0=0,l0=!1;try{if(!_0.__emitTokens){r.matcher.considerAll();for(;;){if(h0++,l0)l0=!1;else r.matcher.considerAll();r.matcher.lastIndex=M0;let h=r.matcher.exec(x);if(!h)break;let c=x.substring(M0,h.index),t=e(c,h);M0=h.index+t}e(x.substring(M0))}else _0.__emitTokens(x,f);return f.finalize(),W0=f.toHTML(),{language:R,value:W0,relevance:L0,illegal:!1,_emitter:f,_top:r}}catch(h){if(h.message&&h.message.includes("Illegal"))return{language:R,value:FW(x),illegal:!0,relevance:0,_illegalBy:{message:h.message,index:M0,context:x.slice(M0-100,M0+100),mode:h.mode,resultSoFar:W0},_emitter:f};else if(Q)return{language:R,value:FW(x),illegal:!1,relevance:0,errorRaised:h,_emitter:f,_top:r};else throw h}}function V(R){let x={value:FW(R),illegal:!1,relevance:0,_top:G,_emitter:new H.__emitter(H)};return x._emitter.addText(R),x}function U(R,x){x=x||H.languages||Object.keys(J);let v=V(R),d=x.filter(S).filter(P).map((s)=>q(s,R,!1));d.unshift(v);let w=d.sort((s,A0)=>{if(s.relevance!==A0.relevance)return A0.relevance-s.relevance;if(s.language&&A0.language){if(S(s.language).supersetOf===A0.language)return 1;else if(S(A0.language).supersetOf===s.language)return-1}return 0}),[z0,G0]=w,E=z0;return E.secondBest=G0,E}function B(R,x,v){let d=x&&$[x]||v;R.classList.add("hljs"),R.classList.add(`language-${d}`)}function F(R){let x=null,v=W(R);if(z(v))return;if(y("before:highlightElement",{el:R,language:v}),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 jO("One of your code blocks includes unescaped HTML.",R.innerHTML)}x=R;let d=x.textContent,w=v?K(d,{language:v,ignoreIllegals:!0}):U(d);if(R.innerHTML=w.value,R.dataset.highlighted="yes",B(R,v,w.language),R.result={language:w.language,re:w.relevance,relevance:w.relevance},w.secondBest)R.secondBest={language:w.secondBest.language,relevance:w.secondBest.relevance};y("after:highlightElement",{el:R,result:w,text:d})}function N(R){H=KO(H,R)}let L=()=>{O(),E8("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function _(){O(),E8("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let M=!1;function O(){function R(){O()}if(document.readyState==="loading"){if(!M)window.addEventListener("DOMContentLoaded",R,!1);M=!0;return}document.querySelectorAll(H.cssSelector).forEach(F)}function D(R,x){let v=null;try{v=x(Z)}catch(d){if($6("Language definition for '{}' could not be registered.".replace("{}",R)),!Q)throw d;else $6(d);v=G}if(!v.name)v.name=R;if(J[R]=v,v.rawDefinition=x.bind(null,Z),v.aliases)k(v.aliases,{languageName:R})}function A(R){delete J[R];for(let x of Object.keys($))if($[x]===R)delete $[x]}function T(){return Object.keys(J)}function S(R){return R=(R||"").toLowerCase(),J[R]||J[$[R]]}function k(R,{languageName:x}){if(typeof R==="string")R=[R];R.forEach((v)=>{$[v.toLowerCase()]=x})}function P(R){let x=S(R);return x&&!x.disableAutodetect}function g(R){if(R["before:highlightBlock"]&&!R["before:highlightElement"])R["before:highlightElement"]=(x)=>{R["before:highlightBlock"](Object.assign({block:x.el},x))};if(R["after:highlightBlock"]&&!R["after:highlightElement"])R["after:highlightElement"]=(x)=>{R["after:highlightBlock"](Object.assign({block:x.el},x))}}function C(R){g(R),X.push(R)}function I(R){let x=X.indexOf(R);if(x!==-1)X.splice(x,1)}function y(R,x){let v=R;X.forEach(function(d){if(d[v])d[v](x)})}function b(R){return E8("10.7.0","highlightBlock will be removed entirely in v12.0"),E8("10.7.0","Please use highlightElement now."),F(R)}Object.assign(Z,{highlight:K,highlightAuto:U,highlightAll:O,highlightElement:F,highlightBlock:b,configure:N,initHighlighting:L,initHighlightingOnLoad:_,registerLanguage:D,unregisterLanguage:A,listLanguages:T,getLanguage:S,registerAliases:k,autoDetection:P,inherit:KO,addPlugin:C,removePlugin:I}),Z.debugMode=function(){Q=!1},Z.safeMode=function(){Q=!0},Z.versionString=Hm,Z.regex={concat:X6,lookahead:LO,either:_W,optional:wg,anyNumberOfTimes:Og};for(let R in oQ)if(typeof oQ[R]==="object")VO(oQ[R]);return Object.assign(Z,oQ),Z},k8=TO({});k8.newInstance=()=>TO({});CO.exports=k8;k8.HighlightJS=k8;k8.default=k8});var SP=d1((_Y,CP)=>{(function(Z,J){typeof _Y==="object"&&typeof CP<"u"?J(_Y):typeof define==="function"&&define.amd?define(["exports"],J):(Z=typeof globalThis<"u"?globalThis:Z||self,J(Z["fast-equals"]={}))})(_Y,function(Z){function J(l){return function(q0,X0,Q0,V0,p,Z0,e){return l(q0,X0,e)}}function $(l){return function(q0,X0,Q0,V0){if(!q0||!X0||typeof q0!=="object"||typeof X0!=="object")return l(q0,X0,Q0,V0);var p=V0.get(q0),Z0=V0.get(X0);if(p&&Z0)return p===X0&&Z0===q0;V0.set(q0,X0),V0.set(X0,q0);var e=l(q0,X0,Q0,V0);return V0.delete(q0),V0.delete(X0),e}}function X(l,H0){var q0={};for(var X0 in l)q0[X0]=l[X0];for(var X0 in H0)q0[X0]=H0[X0];return q0}function Q(l){return l.constructor===Object||l.constructor==null}function Y(l){return typeof l.then==="function"}function G(l,H0){return l===H0||l!==l&&H0!==H0}var H="[object Arguments]",z="[object Boolean]",W="[object Date]",K="[object RegExp]",q="[object Map]",V="[object Number]",U="[object Object]",B="[object Set]",F="[object String]",N=Object.prototype.toString;function L(l){var{areArraysEqual:H0,areDatesEqual:q0,areMapsEqual:X0,areObjectsEqual:Q0,areRegExpsEqual:V0,areSetsEqual:p,createIsNestedEqual:Z0}=l,e=Z0(_0);function _0(i,W0,r){if(i===W0)return!0;if(!i||!W0||typeof i!=="object"||typeof W0!=="object")return i!==i&&W0!==W0;if(Q(i)&&Q(W0))return Q0(i,W0,e,r);var o=Array.isArray(i),f=Array.isArray(W0);if(o||f)return o===f&&H0(i,W0,e,r);var u=N.call(i);if(u!==N.call(W0))return!1;if(u===W)return q0(i,W0,e,r);if(u===K)return V0(i,W0,e,r);if(u===q)return X0(i,W0,e,r);if(u===B)return p(i,W0,e,r);if(u===U||u===H)return Y(i)||Y(W0)?!1:Q0(i,W0,e,r);if(u===z||u===V||u===F)return G(i.valueOf(),W0.valueOf());return!1}return _0}function _(l,H0,q0,X0){var Q0=l.length;if(H0.length!==Q0)return!1;while(Q0-- >0)if(!q0(l[Q0],H0[Q0],Q0,Q0,l,H0,X0))return!1;return!0}var M=$(_);function O(l,H0){return G(l.valueOf(),H0.valueOf())}function D(l,H0,q0,X0){var Q0=l.size===H0.size;if(!Q0)return!1;if(!l.size)return!0;var V0={},p=0;return l.forEach(function(Z0,e){if(!Q0)return;var _0=!1,i=0;H0.forEach(function(W0,r){if(!_0&&!V0[i]&&(_0=q0(e,r,p,i,l,H0,X0)&&q0(Z0,W0,e,r,l,H0,X0)))V0[i]=!0;i++}),p++,Q0=_0}),Q0}var A=$(D),T="_owner",S=Object.prototype.hasOwnProperty;function k(l,H0,q0,X0){var Q0=Object.keys(l),V0=Q0.length;if(Object.keys(H0).length!==V0)return!1;var p;while(V0-- >0){if(p=Q0[V0],p===T){var Z0=!!l.$$typeof,e=!!H0.$$typeof;if((Z0||e)&&Z0!==e)return!1}if(!S.call(H0,p)||!q0(l[p],H0[p],p,p,l,H0,X0))return!1}return!0}var P=$(k);function g(l,H0){return l.source===H0.source&&l.flags===H0.flags}function C(l,H0,q0,X0){var Q0=l.size===H0.size;if(!Q0)return!1;if(!l.size)return!0;var V0={};return l.forEach(function(p,Z0){if(!Q0)return;var e=!1,_0=0;H0.forEach(function(i,W0){if(!e&&!V0[_0]&&(e=q0(p,i,Z0,W0,l,H0,X0)))V0[_0]=!0;_0++}),Q0=e}),Q0}var I=$(C),y=Object.freeze({areArraysEqual:_,areDatesEqual:O,areMapsEqual:D,areObjectsEqual:k,areRegExpsEqual:g,areSetsEqual:C,createIsNestedEqual:J}),b=Object.freeze({areArraysEqual:M,areDatesEqual:O,areMapsEqual:A,areObjectsEqual:P,areRegExpsEqual:g,areSetsEqual:I,createIsNestedEqual:J}),R=L(y);function x(l,H0){return R(l,H0,void 0)}var v=L(X(y,{createIsNestedEqual:function(){return G}}));function d(l,H0){return v(l,H0,void 0)}var w=L(b);function z0(l,H0){return w(l,H0,new WeakMap)}var G0=L(X(b,{createIsNestedEqual:function(){return G}}));function E(l,H0){return G0(l,H0,new WeakMap)}function s(l){return L(X(y,l(y)))}function A0(l){var H0=L(X(b,l(b)));return function(q0,X0,Q0){if(Q0===void 0)Q0=new WeakMap;return H0(q0,X0,Q0)}}Z.circularDeepEqual=z0,Z.circularShallowEqual=E,Z.createCustomCircularEqual=A0,Z.createCustomEqual=s,Z.deepEqual=x,Z.sameValueZeroEqual=G,Z.shallowEqual=d,Object.defineProperty(Z,"__esModule",{value:!0})})});var EP=d1((rP0,IP)=>{var Lp="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";IP.exports=Lp});var bP=d1((aP0,yP)=>{var Np=EP();function kP(){}function RP(){}RP.resetWarningCache=kP;yP.exports=function(){function Z(X,Q,Y,G,H,z){if(z===Np)return;var W=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 W.name="Invariant Violation",W}Z.isRequired=Z;function J(){return Z}var $={array:Z,bigint:Z,bool:Z,func:Z,number:Z,object:Z,string:Z,symbol:Z,any:Z,arrayOf:J,element:Z,elementType:Z,instanceOf:J,node:Z,objectOf:J,oneOf:J,oneOfType:J,shape:J,exact:J,checkPropTypes:RP,resetWarningCache:kP};return $.PropTypes=$,$}});var sZ=d1((sP0,xP)=>{xP.exports=bP()();var _p,Ap});var gP=d1((nP0,SK)=>{function vP(Z){var J,$,X="";if(typeof Z=="string"||typeof Z=="number")X+=Z;else if(typeof Z=="object")if(Array.isArray(Z)){var Q=Z.length;for(J=0;J<Q;J++)Z[J]&&($=vP(Z[J]))&&(X&&(X+=" "),X+=$)}else for($ in Z)Z[$]&&(X&&(X+=" "),X+=$);return X}function hP(){for(var Z,J,$=0,X="",Q=arguments.length;$<Q;$++)(Z=arguments[$])&&(J=vP(Z))&&(X&&(X+=" "),X+=J);return X}SK.exports=hP,SK.exports.clsx=hP});var nZ=d1((mP)=>{Object.defineProperty(mP,"__esModule",{value:!0});mP.dontSetMe=Pp;mP.findInArray=Mp;mP.int=wp;mP.isFunction=Dp;mP.isNum=Op;function Mp(Z,J){for(let $=0,X=Z.length;$<X;$++)if(J.apply(J,[Z[$],$,Z]))return Z[$]}function Dp(Z){return typeof Z==="function"||Object.prototype.toString.call(Z)==="[object Function]"}function Op(Z){return typeof Z==="number"&&!isNaN(Z)}function wp(Z){return parseInt(Z,10)}function Pp(Z,J,$){if(Z[J])return Error(`Invalid prop ${J} passed to ${$} - do not set this, set it on the child.`)}});var dP=d1((uP)=>{Object.defineProperty(uP,"__esModule",{value:!0});uP.browserPrefixToKey=pP;uP.browserPrefixToStyle=Ep;uP.default=void 0;uP.getPrefix=fP;var IK=["Moz","Webkit","O","ms"];function fP(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let J=window.document?.documentElement?.style;if(!J)return"";if(Z in J)return"";for(let $=0;$<IK.length;$++)if(pP(Z,IK[$])in J)return IK[$];return""}function pP(Z,J){return J?`${J}${kp(Z)}`:Z}function Ep(Z,J){return J?`-${J.toLowerCase()}-${Z}`:Z}function kp(Z){let J="",$=!0;for(let X=0;X<Z.length;X++)if($)J+=Z[X].toUpperCase(),$=!1;else if(Z[X]==="-")$=!0;else J+=Z[X];return J}var tP0=uP.default=fP()});var MY=d1((oP)=>{Object.defineProperty(oP,"__esModule",{value:!0});oP.addClassName=sP;oP.addEvent=hp;oP.addUserSelectStyles=rp;oP.createCSSTransform=cp;oP.createSVGTransform=dp;oP.getTouch=lp;oP.getTouchIdentifier=ip;oP.getTranslation=EK;oP.innerHeight=fp;oP.innerWidth=pp;oP.matchesSelector=aP;oP.matchesSelectorAndParentsTo=xp;oP.offsetXYFromParent=up;oP.outerHeight=gp;oP.outerWidth=mp;oP.removeClassName=nP;oP.removeEvent=vp;oP.scheduleRemoveUserSelectStyles=ap;var S7=nZ(),lP=rP(dP());function rP(Z,J){if(typeof WeakMap=="function")var $=new WeakMap,X=new WeakMap;return(rP=function(Q,Y){if(!Y&&Q&&Q.__esModule)return Q;var G,H,z={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return z;if(G=Y?X:$){if(G.has(Q))return G.get(Q);G.set(Q,z)}for(let W in Q)W!=="default"&&{}.hasOwnProperty.call(Q,W)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,W))&&(H.get||H.set)?G(z,W,H):z[W]=Q[W]);return z})(Z,J)}var AY="";function aP(Z,J){if(!AY)AY=(0,S7.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function($){return(0,S7.isFunction)(Z[$])});if(!(0,S7.isFunction)(Z[AY]))return!1;return Z[AY](J)}function xp(Z,J,$){let X=Z;do{if(aP(X,J))return!0;if(X===$)return!1;X=X.parentNode}while(X);return!1}function hp(Z,J,$,X){if(!Z)return;let Q={capture:!0,...X};if(Z.addEventListener)Z.addEventListener(J,$,Q);else if(Z.attachEvent)Z.attachEvent("on"+J,$);else Z["on"+J]=$}function vp(Z,J,$,X){if(!Z)return;let Q={capture:!0,...X};if(Z.removeEventListener)Z.removeEventListener(J,$,Q);else if(Z.detachEvent)Z.detachEvent("on"+J,$);else Z["on"+J]=null}function gp(Z){let J=Z.clientHeight,$=Z.ownerDocument.defaultView.getComputedStyle(Z);return J+=(0,S7.int)($.borderTopWidth),J+=(0,S7.int)($.borderBottomWidth),J}function mp(Z){let J=Z.clientWidth,$=Z.ownerDocument.defaultView.getComputedStyle(Z);return J+=(0,S7.int)($.borderLeftWidth),J+=(0,S7.int)($.borderRightWidth),J}function fp(Z){let J=Z.clientHeight,$=Z.ownerDocument.defaultView.getComputedStyle(Z);return J-=(0,S7.int)($.paddingTop),J-=(0,S7.int)($.paddingBottom),J}function pp(Z){let J=Z.clientWidth,$=Z.ownerDocument.defaultView.getComputedStyle(Z);return J-=(0,S7.int)($.paddingLeft),J-=(0,S7.int)($.paddingRight),J}function up(Z,J,$){let Q=J===J.ownerDocument.body?{left:0,top:0}:J.getBoundingClientRect(),Y=(Z.clientX+J.scrollLeft-Q.left)/$,G=(Z.clientY+J.scrollTop-Q.top)/$;return{x:Y,y:G}}function cp(Z,J){let $=EK(Z,J,"px");return{[(0,lP.browserPrefixToKey)("transform",lP.default)]:$}}function dp(Z,J){return EK(Z,J,"")}function EK(Z,J,$){let{x:X,y:Q}=Z,Y=`translate(${X}${$},${Q}${$})`;if(J){let G=`${typeof J.x==="string"?J.x:J.x+$}`,H=`${typeof J.y==="string"?J.y:J.y+$}`;Y=`translate(${G}, ${H})`+Y}return Y}function lp(Z,J){return Z.targetTouches&&(0,S7.findInArray)(Z.targetTouches,($)=>J===$.identifier)||Z.changedTouches&&(0,S7.findInArray)(Z.changedTouches,($)=>J===$.identifier)}function ip(Z){if(Z.targetTouches&&Z.targetTouches[0])return Z.targetTouches[0].identifier;if(Z.changedTouches&&Z.changedTouches[0])return Z.changedTouches[0].identifier}function rp(Z){if(!Z)return;let J=Z.getElementById("react-draggable-style-el");if(!J)J=Z.createElement("style"),J.type="text/css",J.id="react-draggable-style-el",J.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
5
|
-
`,J.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
6
|
-
`,Z.getElementsByTagName("head")[0].appendChild(J);if(Z.body)sP(Z.body,"react-draggable-transparent-selection")}function ap(Z){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{iP(Z)});else iP(Z)}function iP(Z){if(!Z)return;try{if(Z.body)nP(Z.body,"react-draggable-transparent-selection");if(Z.selection)Z.selection.empty();else{let J=(Z.defaultView||window).getSelection();if(J&&J.type!=="Caret")J.removeAllRanges()}}catch(J){}}function sP(Z,J){if(Z.classList)Z.classList.add(J);else if(!Z.className.match(new RegExp(`(?:^|\\s)${J}(?!\\S)`)))Z.className+=` ${J}`}function nP(Z,J){if(Z.classList)Z.classList.remove(J);else Z.className=Z.className.replace(new RegExp(`(?:^|\\s)${J}(?!\\S)`,"g"),"")}});var RK=d1((tP)=>{Object.defineProperty(tP,"__esModule",{value:!0});tP.canDragX=Fu;tP.canDragY=Lu;tP.createCoreData=_u;tP.createDraggableData=Au;tP.getBoundPosition=Uu;tP.getControlPosition=Nu;tP.snapToGrid=Bu;var I7=nZ(),l8=MY();function Uu(Z,J,$){if(!Z.props.bounds)return[J,$];let{bounds:X}=Z.props;X=typeof X==="string"?X:Mu(X);let Q=kK(Z);if(typeof X==="string"){let{ownerDocument:Y}=Q,G=Y.defaultView,H;if(X==="parent")H=Q.parentNode;else H=Q.getRootNode().querySelector(X);if(!(H instanceof G.HTMLElement))throw Error('Bounds selector "'+X+'" could not find an element.');let z=H,W=G.getComputedStyle(Q),K=G.getComputedStyle(z);X={left:-Q.offsetLeft+(0,I7.int)(K.paddingLeft)+(0,I7.int)(W.marginLeft),top:-Q.offsetTop+(0,I7.int)(K.paddingTop)+(0,I7.int)(W.marginTop),right:(0,l8.innerWidth)(z)-(0,l8.outerWidth)(Q)-Q.offsetLeft+(0,I7.int)(K.paddingRight)-(0,I7.int)(W.marginRight),bottom:(0,l8.innerHeight)(z)-(0,l8.outerHeight)(Q)-Q.offsetTop+(0,I7.int)(K.paddingBottom)-(0,I7.int)(W.marginBottom)}}if((0,I7.isNum)(X.right))J=Math.min(J,X.right);if((0,I7.isNum)(X.bottom))$=Math.min($,X.bottom);if((0,I7.isNum)(X.left))J=Math.max(J,X.left);if((0,I7.isNum)(X.top))$=Math.max($,X.top);return[J,$]}function Bu(Z,J,$){let X=Math.round(J/Z[0])*Z[0],Q=Math.round($/Z[1])*Z[1];return[X,Q]}function Fu(Z){return Z.props.axis==="both"||Z.props.axis==="x"}function Lu(Z){return Z.props.axis==="both"||Z.props.axis==="y"}function Nu(Z,J,$){let X=typeof J==="number"?(0,l8.getTouch)(Z,J):null;if(typeof J==="number"&&!X)return null;let Q=kK($),Y=$.props.offsetParent||Q.offsetParent||Q.ownerDocument.body;return(0,l8.offsetXYFromParent)(X||Z,Y,$.props.scale)}function _u(Z,J,$){let X=!(0,I7.isNum)(Z.lastX),Q=kK(Z);if(X)return{node:Q,deltaX:0,deltaY:0,lastX:J,lastY:$,x:J,y:$};else return{node:Q,deltaX:J-Z.lastX,deltaY:$-Z.lastY,lastX:Z.lastX,lastY:Z.lastY,x:J,y:$}}function Au(Z,J){let $=Z.props.scale;return{node:J.node,x:Z.state.x+J.deltaX/$,y:Z.state.y+J.deltaY/$,deltaX:J.deltaX/$,deltaY:J.deltaY/$,lastX:Z.state.x,lastY:Z.state.y}}function Mu(Z){return{left:Z.left,top:Z.top,right:Z.right,bottom:Z.bottom}}function kK(Z){let J=Z.findDOMNode();if(!J)throw Error("<DraggableCore>: Unmounted during event!");return J}});var yK=d1((eP)=>{Object.defineProperty(eP,"__esModule",{value:!0});eP.default=Su;function Su(){}});var Xj=d1((Jj)=>{var yu=j(m()),bu=j(w7());Object.defineProperty(Jj,"__esModule",{value:!0});Jj.default=void 0;var bK=Zj(yu),W7=hK(sZ()),Eu=hK(bu),e5=MY(),G4=RK(),xK=nZ(),oZ=hK(yK());function hK(Z){return Z&&Z.__esModule?Z:{default:Z}}function Zj(Z,J){if(typeof WeakMap=="function")var $=new WeakMap,X=new WeakMap;return(Zj=function(Q,Y){if(!Y&&Q&&Q.__esModule)return Q;var G,H,z={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return z;if(G=Y?X:$){if(G.has(Q))return G.get(Q);G.set(Q,z)}for(let W in Q)W!=="default"&&{}.hasOwnProperty.call(Q,W)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,W))&&(H.get||H.set)?G(z,W,H):z[W]=Q[W]);return z})(Z,J)}function K7(Z,J,$){return(J=ku(J))in Z?Object.defineProperty(Z,J,{value:$,enumerable:!0,configurable:!0,writable:!0}):Z[J]=$,Z}function ku(Z){var J=Ru(Z,"string");return typeof J=="symbol"?J:J+""}function Ru(Z,J){if(typeof Z!="object"||!Z)return Z;var $=Z[Symbol.toPrimitive];if($!==void 0){var X=$.call(Z,J||"default");if(typeof X!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(Z)}var B9={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},H4=B9.mouse;class tZ extends bK.Component{constructor(){super(...arguments);K7(this,"dragging",!1),K7(this,"lastX",NaN),K7(this,"lastY",NaN),K7(this,"touchIdentifier",null),K7(this,"mounted",!1),K7(this,"handleDragStart",(Z)=>{if(this.props.onMouseDown(Z),!this.props.allowAnyClick&&typeof Z.button==="number"&&Z.button!==0)return!1;let J=this.findDOMNode();if(!J||!J.ownerDocument||!J.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:$}=J;if(this.props.disabled||!(Z.target instanceof $.defaultView.Node)||this.props.handle&&!(0,e5.matchesSelectorAndParentsTo)(Z.target,this.props.handle,J)||this.props.cancel&&(0,e5.matchesSelectorAndParentsTo)(Z.target,this.props.cancel,J))return;if(Z.type==="touchstart"&&!this.props.allowMobileScroll)Z.preventDefault();let X=(0,e5.getTouchIdentifier)(Z);this.touchIdentifier=X;let Q=(0,G4.getControlPosition)(Z,X,this);if(Q==null)return;let{x:Y,y:G}=Q,H=(0,G4.createCoreData)(this,Y,G);if((0,oZ.default)("DraggableCore: handleDragStart: %j",H),(0,oZ.default)("calling",this.props.onStart),this.props.onStart(Z,H)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,e5.addUserSelectStyles)($);this.dragging=!0,this.lastX=Y,this.lastY=G,(0,e5.addEvent)($,H4.move,this.handleDrag),(0,e5.addEvent)($,H4.stop,this.handleDragStop)}),K7(this,"handleDrag",(Z)=>{let J=(0,G4.getControlPosition)(Z,this.touchIdentifier,this);if(J==null)return;let{x:$,y:X}=J;if(Array.isArray(this.props.grid)){let G=$-this.lastX,H=X-this.lastY;if([G,H]=(0,G4.snapToGrid)(this.props.grid,G,H),!G&&!H)return;$=this.lastX+G,X=this.lastY+H}let Q=(0,G4.createCoreData)(this,$,X);if((0,oZ.default)("DraggableCore: handleDrag: %j",Q),this.props.onDrag(Z,Q)===!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=$,this.lastY=X}),K7(this,"handleDragStop",(Z)=>{if(!this.dragging)return;let J=(0,G4.getControlPosition)(Z,this.touchIdentifier,this);if(J==null)return;let{x:$,y:X}=J;if(Array.isArray(this.props.grid)){let H=$-this.lastX||0,z=X-this.lastY||0;[H,z]=(0,G4.snapToGrid)(this.props.grid,H,z),$=this.lastX+H,X=this.lastY+z}let Q=(0,G4.createCoreData)(this,$,X);if(this.props.onStop(Z,Q)===!1||this.mounted===!1)return!1;let G=this.findDOMNode();if(G){if(this.props.enableUserSelectHack)(0,e5.scheduleRemoveUserSelectStyles)(G.ownerDocument)}if((0,oZ.default)("DraggableCore: handleDragStop: %j",Q),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,G)(0,oZ.default)("DraggableCore: Removing handlers"),(0,e5.removeEvent)(G.ownerDocument,H4.move,this.handleDrag),(0,e5.removeEvent)(G.ownerDocument,H4.stop,this.handleDragStop)}),K7(this,"onMouseDown",(Z)=>{return H4=B9.mouse,this.handleDragStart(Z)}),K7(this,"onMouseUp",(Z)=>{return H4=B9.mouse,this.handleDragStop(Z)}),K7(this,"onTouchStart",(Z)=>{return H4=B9.touch,this.handleDragStart(Z)}),K7(this,"onTouchEnd",(Z)=>{return H4=B9.touch,this.handleDragStop(Z)})}componentDidMount(){this.mounted=!0;let Z=this.findDOMNode();if(Z)(0,e5.addEvent)(Z,B9.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let Z=this.findDOMNode();if(Z){let{ownerDocument:J}=Z;if((0,e5.removeEvent)(J,B9.mouse.move,this.handleDrag),(0,e5.removeEvent)(J,B9.touch.move,this.handleDrag),(0,e5.removeEvent)(J,B9.mouse.stop,this.handleDragStop),(0,e5.removeEvent)(J,B9.touch.stop,this.handleDragStop),(0,e5.removeEvent)(Z,B9.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,e5.scheduleRemoveUserSelectStyles)(J)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:Eu.default.findDOMNode(this)}render(){return bK.cloneElement(bK.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}Jj.default=tZ;K7(tZ,"displayName","DraggableCore");K7(tZ,"propTypes",{allowAnyClick:W7.default.bool,allowMobileScroll:W7.default.bool,children:W7.default.node.isRequired,disabled:W7.default.bool,enableUserSelectHack:W7.default.bool,offsetParent:function(Z,J){if(Z[J]&&Z[J].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:W7.default.arrayOf(W7.default.number),handle:W7.default.string,cancel:W7.default.string,nodeRef:W7.default.object,onStart:W7.default.func,onDrag:W7.default.func,onStop:W7.default.func,onMouseDown:W7.default.func,scale:W7.default.number,className:xK.dontSetMe,style:xK.dontSetMe,transform:xK.dontSetMe});K7(tZ,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var Hj=d1((mK)=>{var mu=j(m()),fu=j(w7());Object.defineProperty(mK,"__esModule",{value:!0});Object.defineProperty(mK,"DraggableCore",{enumerable:!0,get:function(){return wY.default}});mK.default=void 0;var DY=Yj(mu),v1=PY(sZ()),xu=PY(fu),hu=gP(),Qj=MY(),i8=RK(),vK=nZ(),wY=PY(Xj()),OY=PY(yK());function PY(Z){return Z&&Z.__esModule?Z:{default:Z}}function Yj(Z,J){if(typeof WeakMap=="function")var $=new WeakMap,X=new WeakMap;return(Yj=function(Q,Y){if(!Y&&Q&&Q.__esModule)return Q;var G,H,z={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return z;if(G=Y?X:$){if(G.has(Q))return G.get(Q);G.set(Q,z)}for(let W in Q)W!=="default"&&{}.hasOwnProperty.call(Q,W)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,W))&&(H.get||H.set)?G(z,W,H):z[W]=Q[W]);return z})(Z,J)}function gK(){return gK=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var $=arguments[J];for(var X in $)({}).hasOwnProperty.call($,X)&&(Z[X]=$[X])}return Z},gK.apply(null,arguments)}function r8(Z,J,$){return(J=vu(J))in Z?Object.defineProperty(Z,J,{value:$,enumerable:!0,configurable:!0,writable:!0}):Z[J]=$,Z}function vu(Z){var J=gu(Z,"string");return typeof J=="symbol"?J:J+""}function gu(Z,J){if(typeof Z!="object"||!Z)return Z;var $=Z[Symbol.toPrimitive];if($!==void 0){var X=$.call(Z,J||"default");if(typeof X!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(Z)}class eZ extends DY.Component{static getDerivedStateFromProps(Z,J){let{position:$}=Z,{prevPropsPosition:X}=J;if($&&(!X||$.x!==X.x||$.y!==X.y))return(0,OY.default)("Draggable: getDerivedStateFromProps %j",{position:$,prevPropsPosition:X}),{x:$.x,y:$.y,prevPropsPosition:{...$}};return null}constructor(Z){super(Z);if(r8(this,"onDragStart",(J,$)=>{if((0,OY.default)("Draggable: onDragStart: %j",$),this.props.onStart(J,(0,i8.createDraggableData)(this,$))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),r8(this,"onDrag",(J,$)=>{if(!this.state.dragging)return!1;(0,OY.default)("Draggable: onDrag: %j",$);let X=(0,i8.createDraggableData)(this,$),Q={x:X.x,y:X.y,slackX:0,slackY:0};if(this.props.bounds){let{x:G,y:H}=Q;Q.x+=this.state.slackX,Q.y+=this.state.slackY;let[z,W]=(0,i8.getBoundPosition)(this,Q.x,Q.y);Q.x=z,Q.y=W,Q.slackX=this.state.slackX+(G-Q.x),Q.slackY=this.state.slackY+(H-Q.y),X.x=Q.x,X.y=Q.y,X.deltaX=Q.x-this.state.x,X.deltaY=Q.y-this.state.y}if(this.props.onDrag(J,X)===!1)return!1;this.setState(Q)}),r8(this,"onDragStop",(J,$)=>{if(!this.state.dragging)return!1;if(this.props.onStop(J,(0,i8.createDraggableData)(this,$))===!1)return!1;(0,OY.default)("Draggable: onDragStop: %j",$);let Q={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:G,y:H}=this.props.position;Q.x=G,Q.y=H}this.setState(Q)}),this.state={dragging:!1,dragged:!1,x:Z.position?Z.position.x:Z.defaultPosition.x,y:Z.position?Z.position.y:Z.defaultPosition.y,prevPropsPosition:{...Z.position},slackX:0,slackY:0,isElementSVG:!1},Z.position&&!(Z.onDrag||Z.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??xu.default.findDOMNode(this)}render(){let{axis:Z,bounds:J,children:$,defaultPosition:X,defaultClassName:Q,defaultClassNameDragging:Y,defaultClassNameDragged:G,position:H,positionOffset:z,scale:W,...K}=this.props,q={},V=null,B=!Boolean(H)||this.state.dragging,F=H||X,N={x:(0,i8.canDragX)(this)&&B?this.state.x:F.x,y:(0,i8.canDragY)(this)&&B?this.state.y:F.y};if(this.state.isElementSVG)V=(0,Qj.createSVGTransform)(N,z);else q=(0,Qj.createCSSTransform)(N,z);let L=(0,hu.clsx)($.props.className||"",Q,{[Y]:this.state.dragging,[G]:this.state.dragged});return DY.createElement(wY.default,gK({},K,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),DY.cloneElement(DY.Children.only($),{className:L,style:{...$.props.style,...q},transform:V}))}}mK.default=eZ;r8(eZ,"displayName","Draggable");r8(eZ,"propTypes",{...wY.default.propTypes,axis:v1.default.oneOf(["both","x","y","none"]),bounds:v1.default.oneOfType([v1.default.shape({left:v1.default.number,right:v1.default.number,top:v1.default.number,bottom:v1.default.number}),v1.default.string,v1.default.oneOf([!1])]),defaultClassName:v1.default.string,defaultClassNameDragging:v1.default.string,defaultClassNameDragged:v1.default.string,defaultPosition:v1.default.shape({x:v1.default.number,y:v1.default.number}),positionOffset:v1.default.shape({x:v1.default.oneOfType([v1.default.number,v1.default.string]),y:v1.default.oneOfType([v1.default.number,v1.default.string])}),position:v1.default.shape({x:v1.default.number,y:v1.default.number}),className:vK.dontSetMe,style:vK.dontSetMe,transform:vK.dontSetMe});r8(eZ,"defaultProps",{...wY.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 TY=d1((Yj0,jY)=>{var{default:zj,DraggableCore:pu}=Hj();jY.exports=zj;jY.exports.default=zj;jY.exports.DraggableCore=pu});var qj=d1((au)=>{var ou=j(m());au.__esModule=!0;au.cloneElement=ru;var uu=cu(ou);function cu(Z){return Z&&Z.__esModule?Z:{default:Z}}function Wj(Z,J){var $=Object.keys(Z);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(Z);J&&(X=X.filter(function(Q){return Object.getOwnPropertyDescriptor(Z,Q).enumerable})),$.push.apply($,X)}return $}function Kj(Z){for(var J=1;J<arguments.length;J++){var $=arguments[J]!=null?arguments[J]:{};J%2?Wj(Object($),!0).forEach(function(X){du(Z,X,$[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors($)):Wj(Object($)).forEach(function(X){Object.defineProperty(Z,X,Object.getOwnPropertyDescriptor($,X))})}return Z}function du(Z,J,$){return(J=lu(J))in Z?Object.defineProperty(Z,J,{value:$,enumerable:!0,configurable:!0,writable:!0}):Z[J]=$,Z}function lu(Z){var J=iu(Z,"string");return typeof J=="symbol"?J:J+""}function iu(Z,J){if(typeof Z!="object"||!Z)return Z;var $=Z[Symbol.toPrimitive];if($!==void 0){var X=$.call(Z,J||"default");if(typeof X!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(Z)}function ru(Z,J){if(J.style&&Z.props.style)J.style=Kj(Kj({},Z.props.style),J.style);if(J.className&&Z.props.className)J.className=`${Z.props.className} ${J.className}`;return uu.default.cloneElement(Z,J)}});var fK=d1((eu)=>{eu.__esModule=!0;eu.resizableProps=void 0;var t0=tu(sZ()),Hj0=TY();function tu(Z){return Z&&Z.__esModule?Z:{default:Z}}var zj0=eu.resizableProps={axis:t0.default.oneOf(["both","x","y","none"]),className:t0.default.string,children:t0.default.element.isRequired,draggableOpts:t0.default.shape({allowAnyClick:t0.default.bool,cancel:t0.default.string,children:t0.default.node,disabled:t0.default.bool,enableUserSelectHack:t0.default.bool,offsetParent:typeof Element<"u"?t0.default.instanceOf(Element):t0.default.any,grid:t0.default.arrayOf(t0.default.number),handle:t0.default.string,nodeRef:t0.default.object,onStart:t0.default.func,onDrag:t0.default.func,onStop:t0.default.func,onMouseDown:t0.default.func,scale:t0.default.number}),height:function(){for(var Z=arguments.length,J=Array(Z),$=0;$<Z;$++)J[$]=arguments[$];let[X]=J;if(X.axis==="both"||X.axis==="y")return t0.default.number.isRequired(...J);return t0.default.number(...J)},handle:t0.default.oneOfType([t0.default.node,t0.default.func]),handleSize:t0.default.arrayOf(t0.default.number),lockAspectRatio:t0.default.bool,maxConstraints:t0.default.arrayOf(t0.default.number),minConstraints:t0.default.arrayOf(t0.default.number),onResizeStop:t0.default.func,onResizeStart:t0.default.func,onResize:t0.default.func,resizeHandles:t0.default.arrayOf(t0.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t0.default.number,width:function(){for(var Z=arguments.length,J=Array(Z),$=0;$<Z;$++)J[$]=arguments[$];let[X]=J;if(X.axis==="both"||X.axis==="x")return t0.default.number.isRequired(...J);return t0.default.number(...J)}}});var cK=d1((Kc)=>{var Vc=j(m());Kc.__esModule=!0;Kc.default=void 0;var a8=Bj(Vc),Jc=TY(),$c=qj(),Xc=fK(),Qc=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Bj(Z,J){if(typeof WeakMap=="function")var $=new WeakMap,X=new WeakMap;return(Bj=function(Q,Y){if(!Y&&Q&&Q.__esModule)return Q;var G,H,z={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return z;if(G=Y?X:$){if(G.has(Q))return G.get(Q);G.set(Q,z)}for(let W in Q)W!=="default"&&{}.hasOwnProperty.call(Q,W)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,W))&&(H.get||H.set)?G(z,W,H):z[W]=Q[W]);return z})(Z,J)}function uK(){return uK=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var $=arguments[J];for(var X in $)({}).hasOwnProperty.call($,X)&&(Z[X]=$[X])}return Z},uK.apply(null,arguments)}function Yc(Z,J){if(Z==null)return{};var $,X,Q=Gc(Z,J);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(Z);for(X=0;X<Y.length;X++)$=Y[X],J.indexOf($)===-1&&{}.propertyIsEnumerable.call(Z,$)&&(Q[$]=Z[$])}return Q}function Gc(Z,J){if(Z==null)return{};var $={};for(var X in Z)if({}.hasOwnProperty.call(Z,X)){if(J.indexOf(X)!==-1)continue;$[X]=Z[X]}return $}function Uj(Z,J){var $=Object.keys(Z);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(Z);J&&(X=X.filter(function(Q){return Object.getOwnPropertyDescriptor(Z,Q).enumerable})),$.push.apply($,X)}return $}function pK(Z){for(var J=1;J<arguments.length;J++){var $=arguments[J]!=null?arguments[J]:{};J%2?Uj(Object($),!0).forEach(function(X){Hc(Z,X,$[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors($)):Uj(Object($)).forEach(function(X){Object.defineProperty(Z,X,Object.getOwnPropertyDescriptor($,X))})}return Z}function Hc(Z,J,$){return(J=zc(J))in Z?Object.defineProperty(Z,J,{value:$,enumerable:!0,configurable:!0,writable:!0}):Z[J]=$,Z}function zc(Z){var J=Wc(Z,"string");return typeof J=="symbol"?J:J+""}function Wc(Z,J){if(typeof Z!="object"||!Z)return Z;var $=Z[Symbol.toPrimitive];if($!==void 0){var X=$.call(Z,J||"default");if(typeof X!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(Z)}class CY extends a8.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,J){let{minConstraints:$,maxConstraints:X,lockAspectRatio:Q}=this.props;if(!$&&!X&&!Q)return[Z,J];if(Q){let W=this.props.width/this.props.height,K=Z-this.props.width,q=J-this.props.height;if(Math.abs(K)>Math.abs(q*W))J=Z/W;else Z=J*W}let[Y,G]=[Z,J],[H,z]=this.slack||[0,0];if(Z+=H,J+=z,$)Z=Math.max($[0],Z),J=Math.max($[1],J);if(X)Z=Math.min(X[0],Z),J=Math.min(X[1],J);return this.slack=[H+(Y-Z),z+(G-J)],[Z,J]}resizeHandler(Z,J){return($,X)=>{let{node:Q,deltaX:Y,deltaY:G}=X;if(Z==="onResizeStart")this.resetData();let H=(this.props.axis==="both"||this.props.axis==="x")&&J!=="n"&&J!=="s",z=(this.props.axis==="both"||this.props.axis==="y")&&J!=="e"&&J!=="w";if(!H&&!z)return;let W=J[0],K=J[J.length-1],q=Q.getBoundingClientRect();if(this.lastHandleRect!=null){if(K==="w"){let L=q.left-this.lastHandleRect.left;Y+=L}if(W==="n"){let L=q.top-this.lastHandleRect.top;G+=L}}if(this.lastHandleRect=q,K==="w")Y=-Y;if(W==="n")G=-G;let V=this.props.width+(H?Y/this.props.transformScale:0),U=this.props.height+(z?G/this.props.transformScale:0);if([V,U]=this.runConstraints(V,U),Z==="onResizeStop"&&this.lastSize)({width:V,height:U}=this.lastSize);let B=V!==this.props.width||U!==this.props.height;if(Z!=="onResizeStop")this.lastSize={width:V,height:U};let F=typeof this.props[Z]==="function"?this.props[Z]:null;if(F&&!(Z==="onResize"&&!B))$.persist?.(),F($,{node:Q,size:{width:V,height:U},handle:J});if(Z==="onResizeStop")this.resetData()}}renderResizeHandle(Z,J){let{handle:$}=this.props;if(!$)return a8.createElement("span",{className:`react-resizable-handle react-resizable-handle-${Z}`,ref:J});if(typeof $==="function")return $(Z,J);let X=typeof $.type==="string",Q=pK({ref:J},X?{}:{handleAxis:Z});return a8.cloneElement($,Q)}render(){let Z=this.props,{children:J,className:$,draggableOpts:X,width:Q,height:Y,handle:G,handleSize:H,lockAspectRatio:z,axis:W,minConstraints:K,maxConstraints:q,onResize:V,onResizeStop:U,onResizeStart:B,resizeHandles:F,transformScale:N}=Z,L=Yc(Z,Qc);return(0,$c.cloneElement)(J,pK(pK({},L),{},{className:`${$?`${$} `:""}react-resizable`,children:[...a8.Children.toArray(J.props.children),...F.map((_)=>{let M=this.handleRefs[_]??(this.handleRefs[_]=a8.createRef());return a8.createElement(Jc.DraggableCore,uK({},X,{nodeRef:M,key:`resizableHandle-${_}`,onStop:this.resizeHandler("onResizeStop",_),onStart:this.resizeHandler("onResizeStart",_),onDrag:this.resizeHandler("onResize",_)}),this.renderResizeHandle(_,M))})]}))}}Kc.default=CY;CY.propTypes=Xc.resizableProps;CY.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var Mj=d1((Oc)=>{var Pc=j(m());Oc.__esModule=!0;Oc.default=void 0;var dK=_j(Pc),Uc=Nj(sZ()),Bc=Nj(cK()),Fc=fK(),Lc=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Nj(Z){return Z&&Z.__esModule?Z:{default:Z}}function _j(Z,J){if(typeof WeakMap=="function")var $=new WeakMap,X=new WeakMap;return(_j=function(Q,Y){if(!Y&&Q&&Q.__esModule)return Q;var G,H,z={__proto__:null,default:Q};if(Q===null||typeof Q!="object"&&typeof Q!="function")return z;if(G=Y?X:$){if(G.has(Q))return G.get(Q);G.set(Q,z)}for(let W in Q)W!=="default"&&{}.hasOwnProperty.call(Q,W)&&((H=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Q,W))&&(H.get||H.set)?G(z,W,H):z[W]=Q[W]);return z})(Z,J)}function lK(){return lK=Object.assign?Object.assign.bind():function(Z){for(var J=1;J<arguments.length;J++){var $=arguments[J];for(var X in $)({}).hasOwnProperty.call($,X)&&(Z[X]=$[X])}return Z},lK.apply(null,arguments)}function Lj(Z,J){var $=Object.keys(Z);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(Z);J&&(X=X.filter(function(Q){return Object.getOwnPropertyDescriptor(Z,Q).enumerable})),$.push.apply($,X)}return $}function SY(Z){for(var J=1;J<arguments.length;J++){var $=arguments[J]!=null?arguments[J]:{};J%2?Lj(Object($),!0).forEach(function(X){Nc(Z,X,$[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors($)):Lj(Object($)).forEach(function(X){Object.defineProperty(Z,X,Object.getOwnPropertyDescriptor($,X))})}return Z}function Nc(Z,J,$){return(J=_c(J))in Z?Object.defineProperty(Z,J,{value:$,enumerable:!0,configurable:!0,writable:!0}):Z[J]=$,Z}function _c(Z){var J=Ac(Z,"string");return typeof J=="symbol"?J:J+""}function Ac(Z,J){if(typeof Z!="object"||!Z)return Z;var $=Z[Symbol.toPrimitive];if($!==void 0){var X=$.call(Z,J||"default");if(typeof X!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)(Z)}function Mc(Z,J){if(Z==null)return{};var $,X,Q=Dc(Z,J);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(Z);for(X=0;X<Y.length;X++)$=Y[X],J.indexOf($)===-1&&{}.propertyIsEnumerable.call(Z,$)&&(Q[$]=Z[$])}return Q}function Dc(Z,J){if(Z==null)return{};var $={};for(var X in Z)if({}.hasOwnProperty.call(Z,X)){if(J.indexOf(X)!==-1)continue;$[X]=Z[X]}return $}class iK extends dK.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,J)=>{let{size:$}=J;if(this.props.onResize)Z.persist?.(),this.setState($,()=>this.props.onResize&&this.props.onResize(Z,J));else this.setState($)}}static getDerivedStateFromProps(Z,J){if(J.propsWidth!==Z.width||J.propsHeight!==Z.height)return{width:Z.width,height:Z.height,propsWidth:Z.width,propsHeight:Z.height};return null}render(){let Z=this.props,{handle:J,handleSize:$,onResize:X,onResizeStart:Q,onResizeStop:Y,draggableOpts:G,minConstraints:H,maxConstraints:z,lockAspectRatio:W,axis:K,width:q,height:V,resizeHandles:U,style:B,transformScale:F}=Z,N=Mc(Z,Lc);return dK.createElement(Bc.default,{axis:K,draggableOpts:G,handle:J,handleSize:$,height:this.state.height,lockAspectRatio:W,maxConstraints:z,minConstraints:H,onResizeStart:Q,onResize:this.onResize,onResizeStop:Y,resizeHandles:U,transformScale:F,width:this.state.width},dK.createElement("div",lK({},N,{style:SY(SY({},B),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}Oc.default=iK;iK.propTypes=SY(SY({},Fc.resizableProps),{},{children:Uc.default.element})});var Dj=d1((Vj0,IY)=>{IY.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};IY.exports.Resizable=cK().default;IY.exports.ResizableBox=Mj().default});var y7=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(Z){return this.listeners.add(Z),this.onSubscribe(),()=>{this.listeners.delete(Z),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var ES=class extends y7{#Z;#J;#$;constructor(){super();this.#$=(Z)=>{if(typeof window<"u"&&window.addEventListener){let J=()=>Z();return window.addEventListener("visibilitychange",J,!1),()=>{window.removeEventListener("visibilitychange",J)}}return}}onSubscribe(){if(!this.#J)this.setEventListener(this.#$)}onUnsubscribe(){if(!this.hasListeners())this.#J?.(),this.#J=void 0}setEventListener(Z){this.#$=Z,this.#J?.(),this.#J=Z((J)=>{if(typeof J==="boolean")this.setFocused(J);else this.onFocus()})}setFocused(Z){if(this.#Z!==Z)this.#Z=Z,this.onFocus()}onFocus(){let Z=this.isFocused();this.listeners.forEach((J)=>{J(Z)})}isFocused(){if(typeof this.#Z==="boolean")return this.#Z;return globalThis.document?.visibilityState!=="hidden"}},q6=new ES;var kS={setTimeout:(Z,J)=>setTimeout(Z,J),clearTimeout:(Z)=>clearTimeout(Z),setInterval:(Z,J)=>setInterval(Z,J),clearInterval:(Z)=>clearInterval(Z)},RS=class{#Z=kS;#J=!1;setTimeoutProvider(Z){this.#Z=Z}setTimeout(Z,J){return this.#Z.setTimeout(Z,J)}clearTimeout(Z){this.#Z.clearTimeout(Z)}setInterval(Z,J){return this.#Z.setInterval(Z,J)}clearInterval(Z){this.#Z.clearInterval(Z)}},N9=new RS;function Vq(Z){setTimeout(Z,0)}var sY=typeof window>"u"||"Deno"in globalThis;function J5(){}function Fq(Z,J){return typeof Z==="function"?Z(J):Z}function X3(Z){return typeof Z==="number"&&Z>=0&&Z!==1/0}function qJ(Z,J){return Math.max(Z+(J||0)-Date.now(),0)}function s7(Z,J){return typeof Z==="function"?Z(J):Z}function $7(Z,J){return typeof Z==="function"?Z(J):Z}function VJ(Z,J){let{type:$="all",exact:X,fetchStatus:Q,predicate:Y,queryKey:G,stale:H}=Z;if(G){if(X){if(J.queryHash!==Q3(G,J.options))return!1}else if(!W4(J.queryKey,G))return!1}if($!=="all"){let z=J.isActive();if($==="active"&&!z)return!1;if($==="inactive"&&z)return!1}if(typeof H==="boolean"&&J.isStale()!==H)return!1;if(Q&&Q!==J.state.fetchStatus)return!1;if(Y&&!Y(J))return!1;return!0}function UJ(Z,J){let{exact:$,status:X,predicate:Q,mutationKey:Y}=Z;if(Y){if(!J.options.mutationKey)return!1;if($){if(_9(J.options.mutationKey)!==_9(Y))return!1}else if(!W4(J.options.mutationKey,Y))return!1}if(X&&J.state.status!==X)return!1;if(Q&&!Q(J))return!1;return!0}function Q3(Z,J){return(J?.queryKeyHashFn||_9)(Z)}function _9(Z){return JSON.stringify(Z,(J,$)=>aY($)?Object.keys($).sort().reduce((X,Q)=>{return X[Q]=$[Q],X},{}):$)}function W4(Z,J){if(Z===J)return!0;if(typeof Z!==typeof J)return!1;if(Z&&J&&typeof Z==="object"&&typeof J==="object")return Object.keys(J).every(($)=>W4(Z[$],J[$]));return!1}var yS=Object.prototype.hasOwnProperty;function nY(Z,J,$=0){if(Z===J)return Z;if($>500)return J;let X=Uq(Z)&&Uq(J);if(!X&&!(aY(Z)&&aY(J)))return J;let Y=(X?Z:Object.keys(Z)).length,G=X?J:Object.keys(J),H=G.length,z=X?Array(H):{},W=0;for(let K=0;K<H;K++){let q=X?K:G[K],V=Z[q],U=J[q];if(V===U){if(z[q]=V,X?K<Y:yS.call(Z,q))W++;continue}if(V===null||U===null||typeof V!=="object"||typeof U!=="object"){z[q]=U;continue}let B=nY(V,U,$+1);if(z[q]=B,B===V)W++}return Y===H&&W===Y?Z:z}function V6(Z,J){if(!J||Object.keys(Z).length!==Object.keys(J).length)return!1;for(let $ in Z)if(Z[$]!==J[$])return!1;return!0}function Uq(Z){return Array.isArray(Z)&&Z.length===Object.keys(Z).length}function aY(Z){if(!Bq(Z))return!1;let J=Z.constructor;if(J===void 0)return!0;let $=J.prototype;if(!Bq($))return!1;if(!$.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf(Z)!==Object.prototype)return!1;return!0}function Bq(Z){return Object.prototype.toString.call(Z)==="[object Object]"}function Lq(Z){return new Promise((J)=>{N9.setTimeout(J,Z)})}function Y3(Z,J,$){if(typeof $.structuralSharing==="function")return $.structuralSharing(Z,J);else if($.structuralSharing!==!1)return nY(Z,J);return J}function Nq(Z,J,$=0){let X=[...Z,J];return $&&X.length>$?X.slice(1):X}function _q(Z,J,$=0){let X=[J,...Z];return $&&X.length>$?X.slice(0,-1):X}var U6=Symbol();function BJ(Z,J){if(!Z.queryFn&&J?.initialPromise)return()=>J.initialPromise;if(!Z.queryFn||Z.queryFn===U6)return()=>Promise.reject(Error(`Missing queryFn: '${Z.queryHash}'`));return Z.queryFn}function B6(Z,J){if(typeof Z==="function")return Z(...J);return!!Z}function Aq(Z,J,$){let X=!1,Q;return Object.defineProperty(Z,"signal",{enumerable:!0,get:()=>{if(Q??=J(),X)return Q;if(X=!0,Q.aborted)$();else Q.addEventListener("abort",$,{once:!0});return Q}}),Z}var A9=(()=>{let Z=()=>sY;return{isServer(){return Z()},setIsServer(J){Z=J}}})();function G3(){let Z,J,$=new Promise((Q,Y)=>{Z=Q,J=Y});$.status="pending",$.catch(()=>{});function X(Q){Object.assign($,Q),delete $.resolve,delete $.reject}return $.resolve=(Q)=>{X({status:"fulfilled",value:Q}),Z(Q)},$.reject=(Q)=>{X({status:"rejected",reason:Q}),J(Q)},$}var Mq=Vq;function bS(){let Z=[],J=0,$=(H)=>{H()},X=(H)=>{H()},Q=Mq,Y=(H)=>{if(J)Z.push(H);else Q(()=>{$(H)})},G=()=>{let H=Z;if(Z=[],H.length)Q(()=>{X(()=>{H.forEach((z)=>{$(z)})})})};return{batch:(H)=>{let z;J++;try{z=H()}finally{if(J--,!J)G()}return z},batchCalls:(H)=>{return(...z)=>{Y(()=>{H(...z)})}},schedule:Y,setNotifyFunction:(H)=>{$=H},setBatchNotifyFunction:(H)=>{X=H},setScheduler:(H)=>{Q=H}}}var M1=bS();var xS=class extends y7{#Z=!0;#J;#$;constructor(){super();this.#$=(Z)=>{if(typeof window<"u"&&window.addEventListener){let J=()=>Z(!0),$=()=>Z(!1);return window.addEventListener("online",J,!1),window.addEventListener("offline",$,!1),()=>{window.removeEventListener("online",J),window.removeEventListener("offline",$)}}return}}onSubscribe(){if(!this.#J)this.setEventListener(this.#$)}onUnsubscribe(){if(!this.hasListeners())this.#J?.(),this.#J=void 0}setEventListener(Z){this.#$=Z,this.#J?.(),this.#J=Z(this.setOnline.bind(this))}setOnline(Z){if(this.#Z!==Z)this.#Z=Z,this.listeners.forEach(($)=>{$(Z)})}isOnline(){return this.#Z}},F6=new xS;function hS(Z){return Math.min(1000*2**Z,30000)}function oY(Z){return(Z??"online")==="online"?F6.isOnline():!0}var FJ=class extends Error{constructor(Z){super("CancelledError");this.revert=Z?.revert,this.silent=Z?.silent}};function LJ(Z){let J=!1,$=0,X,Q=G3(),Y=()=>Q.status!=="pending",G=(F)=>{if(!Y()){let N=new FJ(F);V(N),Z.onCancel?.(N)}},H=()=>{J=!0},z=()=>{J=!1},W=()=>q6.isFocused()&&(Z.networkMode==="always"||F6.isOnline())&&Z.canRun(),K=()=>oY(Z.networkMode)&&Z.canRun(),q=(F)=>{if(!Y())X?.(),Q.resolve(F)},V=(F)=>{if(!Y())X?.(),Q.reject(F)},U=()=>{return new Promise((F)=>{X=(N)=>{if(Y()||W())F(N)},Z.onPause?.()}).then(()=>{if(X=void 0,!Y())Z.onContinue?.()})},B=()=>{if(Y())return;let F,N=$===0?Z.initialPromise:void 0;try{F=N??Z.fn()}catch(L){F=Promise.reject(L)}Promise.resolve(F).then(q).catch((L)=>{if(Y())return;let _=Z.retry??(A9.isServer()?0:3),M=Z.retryDelay??hS,O=typeof M==="function"?M($,L):M,D=_===!0||typeof _==="number"&&$<_||typeof _==="function"&&_($,L);if(J||!D){V(L);return}$++,Z.onFail?.($,L),Lq(O).then(()=>{return W()?void 0:U()}).then(()=>{if(J)V(L);else B()})})};return{promise:Q,status:()=>Q.status,cancel:G,continue:()=>{return X?.(),Q},cancelRetry:H,continueRetry:z,canStart:K,start:()=>{if(K())B();else U().then(B);return Q}}}var NJ=class{#Z;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),X3(this.gcTime))this.#Z=N9.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime(Z){this.gcTime=Math.max(this.gcTime||0,Z??(A9.isServer()?1/0:300000))}clearGcTimeout(){if(this.#Z!==void 0)N9.clearTimeout(this.#Z),this.#Z=void 0}};var wq=class extends NJ{#Z;#J;#$;#Q;#X;#Y;#G;constructor(Z){super();this.#G=!1,this.#Y=Z.defaultOptions,this.setOptions(Z.options),this.observers=[],this.#Q=Z.client,this.#$=this.#Q.getQueryCache(),this.queryKey=Z.queryKey,this.queryHash=Z.queryHash,this.#Z=Oq(this.options),this.state=Z.state??this.#Z,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#X?.promise}setOptions(Z){if(this.options={...this.#Y,...Z},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let J=Oq(this.options);if(J.data!==void 0)this.setState(Dq(J.data,J.dataUpdatedAt)),this.#Z=J}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#$.remove(this)}setData(Z,J){let $=Y3(this.state.data,Z,this.options);return this.#z({data:$,type:"success",dataUpdatedAt:J?.updatedAt,manual:J?.manual}),$}setState(Z,J){this.#z({type:"setState",state:Z,setStateOptions:J})}cancel(Z){let J=this.#X?.promise;return this.#X?.cancel(Z),J?J.then(J5).catch(J5):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#Z}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some((Z)=>$7(Z.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===U6||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some((Z)=>s7(Z.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some((Z)=>Z.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime(Z=0){if(this.state.data===void 0)return!0;if(Z==="static")return!1;if(this.state.isInvalidated)return!0;return!qJ(this.state.dataUpdatedAt,Z)}onFocus(){this.observers.find((J)=>J.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#X?.continue()}onOnline(){this.observers.find((J)=>J.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#X?.continue()}addObserver(Z){if(!this.observers.includes(Z))this.observers.push(Z),this.clearGcTimeout(),this.#$.notify({type:"observerAdded",query:this,observer:Z})}removeObserver(Z){if(this.observers.includes(Z)){if(this.observers=this.observers.filter((J)=>J!==Z),!this.observers.length){if(this.#X)if(this.#G||this.#H())this.#X.cancel({revert:!0});else this.#X.cancelRetry();this.scheduleGc()}this.#$.notify({type:"observerRemoved",query:this,observer:Z})}}getObserversCount(){return this.observers.length}#H(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){if(!this.state.isInvalidated)this.#z({type:"invalidate"})}async fetch(Z,J){if(this.state.fetchStatus!=="idle"&&this.#X?.status()!=="rejected"){if(this.state.data!==void 0&&J?.cancelRefetch)this.cancel({silent:!0});else if(this.#X)return this.#X.continueRetry(),this.#X.promise}if(Z)this.setOptions(Z);if(!this.options.queryFn){let H=this.observers.find((z)=>z.options.queryFn);if(H)this.setOptions(H.options)}let $=new AbortController,X=(H)=>{Object.defineProperty(H,"signal",{enumerable:!0,get:()=>{return this.#G=!0,$.signal}})},Q=()=>{let H=BJ(this.options,J),W=(()=>{let K={client:this.#Q,queryKey:this.queryKey,meta:this.meta};return X(K),K})();if(this.#G=!1,this.options.persister)return this.options.persister(H,W,this);return H(W)},G=(()=>{let H={fetchOptions:J,options:this.options,queryKey:this.queryKey,client:this.#Q,state:this.state,fetchFn:Q};return X(H),H})();if(this.options.behavior?.onFetch(G,this),this.#J=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==G.fetchOptions?.meta)this.#z({type:"fetch",meta:G.fetchOptions?.meta});this.#X=LJ({initialPromise:J?.initialPromise,fn:G.fetchFn,onCancel:(H)=>{if(H instanceof FJ&&H.revert)this.setState({...this.#J,fetchStatus:"idle"});$.abort()},onFail:(H,z)=>{this.#z({type:"failed",failureCount:H,error:z})},onPause:()=>{this.#z({type:"pause"})},onContinue:()=>{this.#z({type:"continue"})},retry:G.options.retry,retryDelay:G.options.retryDelay,networkMode:G.options.networkMode,canRun:()=>!0});try{let H=await this.#X.start();if(H===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(H),this.#$.config.onSuccess?.(H,this),this.#$.config.onSettled?.(H,this.state.error,this),H}catch(H){if(H instanceof FJ){if(H.silent)return this.#X.promise;else if(H.revert){if(this.state.data===void 0)throw H;return this.state.data}}throw this.#z({type:"error",error:H}),this.#$.config.onError?.(H,this),this.#$.config.onSettled?.(this.state.data,H,this),H}finally{this.scheduleGc()}}#z(Z){let J=($)=>{switch(Z.type){case"failed":return{...$,fetchFailureCount:Z.failureCount,fetchFailureReason:Z.error};case"pause":return{...$,fetchStatus:"paused"};case"continue":return{...$,fetchStatus:"fetching"};case"fetch":return{...$,...tY($.data,this.options),fetchMeta:Z.meta??null};case"success":let X={...$,...Dq(Z.data,Z.dataUpdatedAt),dataUpdateCount:$.dataUpdateCount+1,...!Z.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#J=Z.manual?X:void 0,X;case"error":let Q=Z.error;return{...$,error:Q,errorUpdateCount:$.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:$.fetchFailureCount+1,fetchFailureReason:Q,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...$,isInvalidated:!0};case"setState":return{...$,...Z.state}}};this.state=J(this.state),M1.batch(()=>{this.observers.forEach(($)=>{$.onQueryUpdate()}),this.#$.notify({query:this,type:"updated",action:Z})})}};function tY(Z,J){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oY(J.networkMode)?"fetching":"paused",...Z===void 0&&{error:null,status:"pending"}}}function Dq(Z,J){return{data:Z,dataUpdatedAt:J??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Oq(Z){let J=typeof Z.initialData==="function"?Z.initialData():Z.initialData,$=J!==void 0,X=$?typeof Z.initialDataUpdatedAt==="function"?Z.initialDataUpdatedAt():Z.initialDataUpdatedAt:0;return{data:J,dataUpdateCount:0,dataUpdatedAt:$?X??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:$?"success":"pending",fetchStatus:"idle"}}var ZG=class extends y7{constructor(Z,J){super();this.options=J,this.#Z=Z,this.#H=null,this.#G=G3(),this.bindMethods(),this.setOptions(J)}#Z;#J=void 0;#$=void 0;#Q=void 0;#X;#Y;#G;#H;#z;#U;#B;#K;#q;#W;#F=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#J.addObserver(this),Pq(this.#J,this.options))this.#V();else this.updateResult();this.#A()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return eY(this.#J,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return eY(this.#J,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#D(),this.#J.removeObserver(this)}setOptions(Z){let J=this.options,$=this.#J;if(this.options=this.#Z.defaultQueryOptions(Z),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof $7(this.options.enabled,this.#J)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#O(),this.#J.setOptions(this.options),J._defaulted&&!V6(this.options,J))this.#Z.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#J,observer:this});let X=this.hasListeners();if(X&&jq(this.#J,$,this.options,J))this.#V();if(this.updateResult(),X&&(this.#J!==$||$7(this.options.enabled,this.#J)!==$7(J.enabled,this.#J)||s7(this.options.staleTime,this.#J)!==s7(J.staleTime,this.#J)))this.#L();let Q=this.#N();if(X&&(this.#J!==$||$7(this.options.enabled,this.#J)!==$7(J.enabled,this.#J)||Q!==this.#W))this.#_(Q)}getOptimisticResult(Z){let J=this.#Z.getQueryCache().build(this.#Z,Z),$=this.createResult(J,Z);if(gS(this,$))this.#Q=$,this.#Y=this.options,this.#X=this.#J.state;return $}getCurrentResult(){return this.#Q}trackResult(Z,J){return new Proxy(Z,{get:($,X)=>{if(this.trackProp(X),J?.(X),X==="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($,X)}})}trackProp(Z){this.#F.add(Z)}getCurrentQuery(){return this.#J}refetch({...Z}={}){return this.fetch({...Z})}fetchOptimistic(Z){let J=this.#Z.defaultQueryOptions(Z),$=this.#Z.getQueryCache().build(this.#Z,J);return $.fetch().then(()=>this.createResult($,J))}fetch(Z){return this.#V({...Z,cancelRefetch:Z.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#Q})}#V(Z){this.#O();let J=this.#J.fetch(this.options,Z);if(!Z?.throwOnError)J=J.catch(J5);return J}#L(){this.#M();let Z=s7(this.options.staleTime,this.#J);if(A9.isServer()||this.#Q.isStale||!X3(Z))return;let $=qJ(this.#Q.dataUpdatedAt,Z)+1;this.#K=N9.setTimeout(()=>{if(!this.#Q.isStale)this.updateResult()},$)}#N(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#J):this.options.refetchInterval)??!1}#_(Z){if(this.#D(),this.#W=Z,A9.isServer()||$7(this.options.enabled,this.#J)===!1||!X3(this.#W)||this.#W===0)return;this.#q=N9.setInterval(()=>{if(this.options.refetchIntervalInBackground||q6.isFocused())this.#V()},this.#W)}#A(){this.#L(),this.#_(this.#N())}#M(){if(this.#K!==void 0)N9.clearTimeout(this.#K),this.#K=void 0}#D(){if(this.#q!==void 0)N9.clearInterval(this.#q),this.#q=void 0}createResult(Z,J){let $=this.#J,X=this.options,Q=this.#Q,Y=this.#X,G=this.#Y,z=Z!==$?Z.state:this.#$,{state:W}=Z,K={...W},q=!1,V;if(J._optimisticResults){let S=this.hasListeners(),k=!S&&Pq(Z,J),P=S&&jq(Z,$,J,X);if(k||P)K={...K,...tY(W.data,Z.options)};if(J._optimisticResults==="isRestoring")K.fetchStatus="idle"}let{error:U,errorUpdatedAt:B,status:F}=K;V=K.data;let N=!1;if(J.placeholderData!==void 0&&V===void 0&&F==="pending"){let S;if(Q?.isPlaceholderData&&J.placeholderData===G?.placeholderData)S=Q.data,N=!0;else S=typeof J.placeholderData==="function"?J.placeholderData(this.#B?.state.data,this.#B):J.placeholderData;if(S!==void 0)F="success",V=Y3(Q?.data,S,J),q=!0}if(J.select&&V!==void 0&&!N)if(Q&&V===Y?.data&&J.select===this.#z)V=this.#U;else try{this.#z=J.select,V=J.select(V),V=Y3(Q?.data,V,J),this.#U=V,this.#H=null}catch(S){this.#H=S}if(this.#H)U=this.#H,V=this.#U,B=Date.now(),F="error";let L=K.fetchStatus==="fetching",_=F==="pending",M=F==="error",O=_&&L,D=V!==void 0,T={status:F,fetchStatus:K.fetchStatus,isPending:_,isSuccess:F==="success",isError:M,isInitialLoading:O,isLoading:O,data:V,dataUpdatedAt:K.dataUpdatedAt,error:U,errorUpdatedAt:B,failureCount:K.fetchFailureCount,failureReason:K.fetchFailureReason,errorUpdateCount:K.errorUpdateCount,isFetched:Z.isFetched(),isFetchedAfterMount:K.dataUpdateCount>z.dataUpdateCount||K.errorUpdateCount>z.errorUpdateCount,isFetching:L,isRefetching:L&&!_,isLoadingError:M&&!D,isPaused:K.fetchStatus==="paused",isPlaceholderData:q,isRefetchError:M&&D,isStale:JG(Z,J),refetch:this.refetch,promise:this.#G,isEnabled:$7(J.enabled,Z)!==!1};if(this.options.experimental_prefetchInRender){let S=T.data!==void 0,k=T.status==="error"&&!S,P=(I)=>{if(k)I.reject(T.error);else if(S)I.resolve(T.data)},g=()=>{let I=this.#G=T.promise=G3();P(I)},C=this.#G;switch(C.status){case"pending":if(Z.queryHash===$.queryHash)P(C);break;case"fulfilled":if(k||T.data!==C.value)g();break;case"rejected":if(!k||T.error!==C.reason)g();break}}return T}updateResult(){let Z=this.#Q,J=this.createResult(this.#J,this.options);if(this.#X=this.#J.state,this.#Y=this.options,this.#X.data!==void 0)this.#B=this.#J;if(V6(J,Z))return;this.#Q=J;let $=()=>{if(!Z)return!0;let{notifyOnChangeProps:X}=this.options,Q=typeof X==="function"?X():X;if(Q==="all"||!Q&&!this.#F.size)return!0;let Y=new Set(Q??this.#F);if(this.options.throwOnError)Y.add("error");return Object.keys(this.#Q).some((G)=>{let H=G;return this.#Q[H]!==Z[H]&&Y.has(H)})};this.#w({listeners:$()})}#O(){let Z=this.#Z.getQueryCache().build(this.#Z,this.options);if(Z===this.#J)return;let J=this.#J;if(this.#J=Z,this.#$=Z.state,this.hasListeners())J?.removeObserver(this),Z.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#A()}#w(Z){M1.batch(()=>{if(Z.listeners)this.listeners.forEach((J)=>{J(this.#Q)});this.#Z.getQueryCache().notify({query:this.#J,type:"observerResultsUpdated"})})}};function vS(Z,J){return $7(J.enabled,Z)!==!1&&Z.state.data===void 0&&!(Z.state.status==="error"&&$7(J.retryOnMount,Z)===!1)}function Pq(Z,J){return vS(Z,J)||Z.state.data!==void 0&&eY(Z,J,J.refetchOnMount)}function eY(Z,J,$){if($7(J.enabled,Z)!==!1&&s7(J.staleTime,Z)!=="static"){let X=typeof $==="function"?$(Z):$;return X==="always"||X!==!1&&JG(Z,J)}return!1}function jq(Z,J,$,X){return(Z!==J||$7(X.enabled,Z)===!1)&&(!$.suspense||Z.state.status!=="error")&&JG(Z,$)}function JG(Z,J){return $7(J.enabled,Z)!==!1&&Z.isStaleByTime(s7(J.staleTime,Z))}function gS(Z,J){if(!V6(Z.getCurrentResult(),J))return!0;return!1}function $G(Z){return{onFetch:(J,$)=>{let X=J.options,Q=J.fetchOptions?.meta?.fetchMore?.direction,Y=J.state.data?.pages||[],G=J.state.data?.pageParams||[],H={pages:[],pageParams:[]},z=0,W=async()=>{let K=!1,q=(B)=>{Aq(B,()=>J.signal,()=>K=!0)},V=BJ(J.options,J.fetchOptions),U=async(B,F,N)=>{if(K)return Promise.reject();if(F==null&&B.pages.length)return Promise.resolve(B);let _=(()=>{let A={client:J.client,queryKey:J.queryKey,pageParam:F,direction:N?"backward":"forward",meta:J.options.meta};return q(A),A})(),M=await V(_),{maxPages:O}=J.options,D=N?_q:Nq;return{pages:D(B.pages,M,O),pageParams:D(B.pageParams,F,O)}};if(Q&&Y.length){let B=Q==="backward",F=B?mS:Tq,N={pages:Y,pageParams:G},L=F(X,N);H=await U(N,L,B)}else{let B=Z??Y.length;do{let F=z===0?G[0]??X.initialPageParam:Tq(X,H);if(z>0&&F==null)break;H=await U(H,F),z++}while(z<B)}return H};if(J.options.persister)J.fetchFn=()=>{return J.options.persister?.(W,{client:J.client,queryKey:J.queryKey,meta:J.options.meta,signal:J.signal},$)};else J.fetchFn=W}}}function Tq(Z,{pages:J,pageParams:$}){let X=J.length-1;return J.length>0?Z.getNextPageParam(J[X],J,$[X],$):void 0}function mS(Z,{pages:J,pageParams:$}){return J.length>0?Z.getPreviousPageParam?.(J[0],J,$[0],$):void 0}var Cq=class extends NJ{#Z;#J;#$;#Q;constructor(Z){super();this.#Z=Z.client,this.mutationId=Z.mutationId,this.#$=Z.mutationCache,this.#J=[],this.state=Z.state||XG(),this.setOptions(Z.options),this.scheduleGc()}setOptions(Z){this.options=Z,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(Z){if(!this.#J.includes(Z))this.#J.push(Z),this.clearGcTimeout(),this.#$.notify({type:"observerAdded",mutation:this,observer:Z})}removeObserver(Z){this.#J=this.#J.filter((J)=>J!==Z),this.scheduleGc(),this.#$.notify({type:"observerRemoved",mutation:this,observer:Z})}optionalRemove(){if(!this.#J.length)if(this.state.status==="pending")this.scheduleGc();else this.#$.remove(this)}continue(){return this.#Q?.continue()??this.execute(this.state.variables)}async execute(Z){let J=()=>{this.#X({type:"continue"})},$={client:this.#Z,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#Q=LJ({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn(Z,$)},onFail:(Y,G)=>{this.#X({type:"failed",failureCount:Y,error:G})},onPause:()=>{this.#X({type:"pause"})},onContinue:J,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#$.canRun(this)});let X=this.state.status==="pending",Q=!this.#Q.canStart();try{if(X)J();else{if(this.#X({type:"pending",variables:Z,isPaused:Q}),this.#$.config.onMutate)await this.#$.config.onMutate(Z,this,$);let G=await this.options.onMutate?.(Z,$);if(G!==this.state.context)this.#X({type:"pending",context:G,variables:Z,isPaused:Q})}let Y=await this.#Q.start();return await this.#$.config.onSuccess?.(Y,Z,this.state.context,this,$),await this.options.onSuccess?.(Y,Z,this.state.context,$),await this.#$.config.onSettled?.(Y,null,this.state.variables,this.state.context,this,$),await this.options.onSettled?.(Y,null,Z,this.state.context,$),this.#X({type:"success",data:Y}),Y}catch(Y){try{await this.#$.config.onError?.(Y,Z,this.state.context,this,$)}catch(G){Promise.reject(G)}try{await this.options.onError?.(Y,Z,this.state.context,$)}catch(G){Promise.reject(G)}try{await this.#$.config.onSettled?.(void 0,Y,this.state.variables,this.state.context,this,$)}catch(G){Promise.reject(G)}try{await this.options.onSettled?.(void 0,Y,Z,this.state.context,$)}catch(G){Promise.reject(G)}throw this.#X({type:"error",error:Y}),Y}finally{this.#$.runNext(this)}}#X(Z){let J=($)=>{switch(Z.type){case"failed":return{...$,failureCount:Z.failureCount,failureReason:Z.error};case"pause":return{...$,isPaused:!0};case"continue":return{...$,isPaused:!1};case"pending":return{...$,context:Z.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:Z.isPaused,status:"pending",variables:Z.variables,submittedAt:Date.now()};case"success":return{...$,data:Z.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...$,data:void 0,error:Z.error,failureCount:$.failureCount+1,failureReason:Z.error,isPaused:!1,status:"error"}}};this.state=J(this.state),M1.batch(()=>{this.#J.forEach(($)=>{$.onMutationUpdate(Z)}),this.#$.notify({mutation:this,type:"updated",action:Z})})}};function XG(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sq=class extends y7{constructor(Z={}){super();this.config=Z,this.#Z=new Set,this.#J=new Map,this.#$=0}#Z;#J;#$;build(Z,J,$){let X=new Cq({client:Z,mutationCache:this,mutationId:++this.#$,options:Z.defaultMutationOptions(J),state:$});return this.add(X),X}add(Z){this.#Z.add(Z);let J=_J(Z);if(typeof J==="string"){let $=this.#J.get(J);if($)$.push(Z);else this.#J.set(J,[Z])}this.notify({type:"added",mutation:Z})}remove(Z){if(this.#Z.delete(Z)){let J=_J(Z);if(typeof J==="string"){let $=this.#J.get(J);if($){if($.length>1){let X=$.indexOf(Z);if(X!==-1)$.splice(X,1)}else if($[0]===Z)this.#J.delete(J)}}}this.notify({type:"removed",mutation:Z})}canRun(Z){let J=_J(Z);if(typeof J==="string"){let X=this.#J.get(J)?.find((Q)=>Q.state.status==="pending");return!X||X===Z}else return!0}runNext(Z){let J=_J(Z);if(typeof J==="string")return this.#J.get(J)?.find((X)=>X!==Z&&X.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){M1.batch(()=>{this.#Z.forEach((Z)=>{this.notify({type:"removed",mutation:Z})}),this.#Z.clear(),this.#J.clear()})}getAll(){return Array.from(this.#Z)}find(Z){let J={exact:!0,...Z};return this.getAll().find(($)=>UJ(J,$))}findAll(Z={}){return this.getAll().filter((J)=>UJ(Z,J))}notify(Z){M1.batch(()=>{this.listeners.forEach((J)=>{J(Z)})})}resumePausedMutations(){let Z=this.getAll().filter((J)=>J.state.isPaused);return M1.batch(()=>Promise.all(Z.map((J)=>J.continue().catch(J5))))}};function _J(Z){return Z.options.scope?.id}var QG=class extends y7{#Z;#J=void 0;#$;#Q;constructor(Z,J){super();this.#Z=Z,this.setOptions(J),this.bindMethods(),this.#X()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(Z){let J=this.options;if(this.options=this.#Z.defaultMutationOptions(Z),!V6(this.options,J))this.#Z.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#$,observer:this});if(J?.mutationKey&&this.options.mutationKey&&_9(J.mutationKey)!==_9(this.options.mutationKey))this.reset();else if(this.#$?.state.status==="pending")this.#$.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners())this.#$?.removeObserver(this)}onMutationUpdate(Z){this.#X(),this.#Y(Z)}getCurrentResult(){return this.#J}reset(){this.#$?.removeObserver(this),this.#$=void 0,this.#X(),this.#Y()}mutate(Z,J){return this.#Q=J,this.#$?.removeObserver(this),this.#$=this.#Z.getMutationCache().build(this.#Z,this.options),this.#$.addObserver(this),this.#$.execute(Z)}#X(){let Z=this.#$?.state??XG();this.#J={...Z,isPending:Z.status==="pending",isSuccess:Z.status==="success",isError:Z.status==="error",isIdle:Z.status==="idle",mutate:this.mutate,reset:this.reset}}#Y(Z){M1.batch(()=>{if(this.#Q&&this.hasListeners()){let J=this.#J.variables,$=this.#J.context,X={client:this.#Z,meta:this.options.meta,mutationKey:this.options.mutationKey};if(Z?.type==="success"){try{this.#Q.onSuccess?.(Z.data,J,$,X)}catch(Q){Promise.reject(Q)}try{this.#Q.onSettled?.(Z.data,null,J,$,X)}catch(Q){Promise.reject(Q)}}else if(Z?.type==="error"){try{this.#Q.onError?.(Z.error,J,$,X)}catch(Q){Promise.reject(Q)}try{this.#Q.onSettled?.(void 0,Z.error,J,$,X)}catch(Q){Promise.reject(Q)}}}this.listeners.forEach((J)=>{J(this.#J)})})}};var Iq=class extends y7{constructor(Z={}){super();this.config=Z,this.#Z=new Map}#Z;build(Z,J,$){let X=J.queryKey,Q=J.queryHash??Q3(X,J),Y=this.get(Q);if(!Y)Y=new wq({client:Z,queryKey:X,queryHash:Q,options:Z.defaultQueryOptions(J),state:$,defaultOptions:Z.getQueryDefaults(X)}),this.add(Y);return Y}add(Z){if(!this.#Z.has(Z.queryHash))this.#Z.set(Z.queryHash,Z),this.notify({type:"added",query:Z})}remove(Z){let J=this.#Z.get(Z.queryHash);if(J){if(Z.destroy(),J===Z)this.#Z.delete(Z.queryHash);this.notify({type:"removed",query:Z})}}clear(){M1.batch(()=>{this.getAll().forEach((Z)=>{this.remove(Z)})})}get(Z){return this.#Z.get(Z)}getAll(){return[...this.#Z.values()]}find(Z){let J={exact:!0,...Z};return this.getAll().find(($)=>VJ(J,$))}findAll(Z={}){let J=this.getAll();return Object.keys(Z).length>0?J.filter(($)=>VJ(Z,$)):J}notify(Z){M1.batch(()=>{this.listeners.forEach((J)=>{J(Z)})})}onFocus(){M1.batch(()=>{this.getAll().forEach((Z)=>{Z.onFocus()})})}onOnline(){M1.batch(()=>{this.getAll().forEach((Z)=>{Z.onOnline()})})}};var YG=class{#Z;#J;#$;#Q;#X;#Y;#G;#H;constructor(Z={}){this.#Z=Z.queryCache||new Iq,this.#J=Z.mutationCache||new Sq,this.#$=Z.defaultOptions||{},this.#Q=new Map,this.#X=new Map,this.#Y=0}mount(){if(this.#Y++,this.#Y!==1)return;this.#G=q6.subscribe(async(Z)=>{if(Z)await this.resumePausedMutations(),this.#Z.onFocus()}),this.#H=F6.subscribe(async(Z)=>{if(Z)await this.resumePausedMutations(),this.#Z.onOnline()})}unmount(){if(this.#Y--,this.#Y!==0)return;this.#G?.(),this.#G=void 0,this.#H?.(),this.#H=void 0}isFetching(Z){return this.#Z.findAll({...Z,fetchStatus:"fetching"}).length}isMutating(Z){return this.#J.findAll({...Z,status:"pending"}).length}getQueryData(Z){let J=this.defaultQueryOptions({queryKey:Z});return this.#Z.get(J.queryHash)?.state.data}ensureQueryData(Z){let J=this.defaultQueryOptions(Z),$=this.#Z.build(this,J),X=$.state.data;if(X===void 0)return this.fetchQuery(Z);if(Z.revalidateIfStale&&$.isStaleByTime(s7(J.staleTime,$)))this.prefetchQuery(J);return Promise.resolve(X)}getQueriesData(Z){return this.#Z.findAll(Z).map(({queryKey:J,state:$})=>{let X=$.data;return[J,X]})}setQueryData(Z,J,$){let X=this.defaultQueryOptions({queryKey:Z}),Y=this.#Z.get(X.queryHash)?.state.data,G=Fq(J,Y);if(G===void 0)return;return this.#Z.build(this,X).setData(G,{...$,manual:!0})}setQueriesData(Z,J,$){return M1.batch(()=>this.#Z.findAll(Z).map(({queryKey:X})=>[X,this.setQueryData(X,J,$)]))}getQueryState(Z){let J=this.defaultQueryOptions({queryKey:Z});return this.#Z.get(J.queryHash)?.state}removeQueries(Z){let J=this.#Z;M1.batch(()=>{J.findAll(Z).forEach(($)=>{J.remove($)})})}resetQueries(Z,J){let $=this.#Z;return M1.batch(()=>{return $.findAll(Z).forEach((X)=>{X.reset()}),this.refetchQueries({type:"active",...Z},J)})}cancelQueries(Z,J={}){let $={revert:!0,...J},X=M1.batch(()=>this.#Z.findAll(Z).map((Q)=>Q.cancel($)));return Promise.all(X).then(J5).catch(J5)}invalidateQueries(Z,J={}){return M1.batch(()=>{if(this.#Z.findAll(Z).forEach(($)=>{$.invalidate()}),Z?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...Z,type:Z?.refetchType??Z?.type??"active"},J)})}refetchQueries(Z,J={}){let $={...J,cancelRefetch:J.cancelRefetch??!0},X=M1.batch(()=>this.#Z.findAll(Z).filter((Q)=>!Q.isDisabled()&&!Q.isStatic()).map((Q)=>{let Y=Q.fetch(void 0,$);if(!$.throwOnError)Y=Y.catch(J5);return Q.state.fetchStatus==="paused"?Promise.resolve():Y}));return Promise.all(X).then(J5)}fetchQuery(Z){let J=this.defaultQueryOptions(Z);if(J.retry===void 0)J.retry=!1;let $=this.#Z.build(this,J);return $.isStaleByTime(s7(J.staleTime,$))?$.fetch(J):Promise.resolve($.state.data)}prefetchQuery(Z){return this.fetchQuery(Z).then(J5).catch(J5)}fetchInfiniteQuery(Z){return Z.behavior=$G(Z.pages),this.fetchQuery(Z)}prefetchInfiniteQuery(Z){return this.fetchInfiniteQuery(Z).then(J5).catch(J5)}ensureInfiniteQueryData(Z){return Z.behavior=$G(Z.pages),this.ensureQueryData(Z)}resumePausedMutations(){if(F6.isOnline())return this.#J.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#Z}getMutationCache(){return this.#J}getDefaultOptions(){return this.#$}setDefaultOptions(Z){this.#$=Z}setQueryDefaults(Z,J){this.#Q.set(_9(Z),{queryKey:Z,defaultOptions:J})}getQueryDefaults(Z){let J=[...this.#Q.values()],$={};return J.forEach((X)=>{if(W4(Z,X.queryKey))Object.assign($,X.defaultOptions)}),$}setMutationDefaults(Z,J){this.#X.set(_9(Z),{mutationKey:Z,defaultOptions:J})}getMutationDefaults(Z){let J=[...this.#X.values()],$={};return J.forEach((X)=>{if(W4(Z,X.mutationKey))Object.assign($,X.defaultOptions)}),$}defaultQueryOptions(Z){if(Z._defaulted)return Z;let J={...this.#$.queries,...this.getQueryDefaults(Z.queryKey),...Z,_defaulted:!0};if(!J.queryHash)J.queryHash=Q3(J.queryKey,J);if(J.refetchOnReconnect===void 0)J.refetchOnReconnect=J.networkMode!=="always";if(J.throwOnError===void 0)J.throwOnError=!!J.suspense;if(!J.networkMode&&J.persister)J.networkMode="offlineFirst";if(J.queryFn===U6)J.enabled=!1;return J}defaultMutationOptions(Z){if(Z?._defaulted)return Z;return{...this.#$.mutations,...Z?.mutationKey&&this.getMutationDefaults(Z.mutationKey),...Z,_defaulted:!0}}clear(){this.#Z.clear(),this.#J.clear()}};var M2=j(m(),1);var L6=j(m(),1),Eq=j(a(),1),GG=L6.createContext(void 0),Z1=(Z)=>{let J=L6.useContext(GG);if(Z)return Z;if(!J)throw Error("No QueryClient set, use QueryClientProvider to set one");return J},HG=({client:Z,children:J})=>{return L6.useEffect(()=>{return Z.mount(),()=>{Z.unmount()}},[Z]),Eq.jsx(GG.Provider,{value:Z,children:J})};var H3=j(m(),1),fS=j(a(),1);function pS(){let Z=!1;return{clearReset:()=>{Z=!1},reset:()=>{Z=!0},isReset:()=>{return Z}}}var uS=H3.createContext(pS()),kq=()=>H3.useContext(uS);var Rq=j(m(),1);var yq=(Z,J,$)=>{let X=$?.state.error&&typeof Z.throwOnError==="function"?B6(Z.throwOnError,[$.state.error,$]):Z.throwOnError;if(Z.suspense||Z.experimental_prefetchInRender||X){if(!J.isReset())Z.retryOnMount=!1}},bq=(Z)=>{Rq.useEffect(()=>{Z.clearReset()},[Z])},xq=({result:Z,errorResetBoundary:J,throwOnError:$,query:X,suspense:Q})=>{return Z.isError&&!J.isReset()&&!Z.isFetching&&X&&(Q&&Z.data===void 0||B6($,[Z.error,X]))};var AJ=j(m(),1),hq=AJ.createContext(!1),vq=()=>AJ.useContext(hq),ui=hq.Provider;var gq=(Z)=>{if(Z.suspense){let $=(Q)=>Q==="static"?Q:Math.max(Q??1000,1000),X=Z.staleTime;if(Z.staleTime=typeof X==="function"?(...Q)=>$(X(...Q)):$(X),typeof Z.gcTime==="number")Z.gcTime=Math.max(Z.gcTime,1000)}},mq=(Z,J)=>Z.isLoading&&Z.isFetching&&!J,fq=(Z,J)=>Z?.suspense&&J.isPending,zG=(Z,J,$)=>J.fetchOptimistic(Z).catch(()=>{$.clearReset()});function pq(Z,J,$){let X=vq(),Q=kq(),Y=Z1($),G=Y.defaultQueryOptions(Z);Y.getDefaultOptions().queries?._experimental_beforeQuery?.(G);let H=Y.getQueryCache().get(G.queryHash);G._optimisticResults=X?"isRestoring":"optimistic",gq(G),yq(G,Q,H),bq(Q);let z=!Y.getQueryCache().get(G.queryHash),[W]=M2.useState(()=>new J(Y,G)),K=W.getOptimisticResult(G),q=!X&&Z.subscribed!==!1;if(M2.useSyncExternalStore(M2.useCallback((V)=>{let U=q?W.subscribe(M1.batchCalls(V)):J5;return W.updateResult(),U},[W,q]),()=>W.getCurrentResult(),()=>W.getCurrentResult()),M2.useEffect(()=>{W.setOptions(G)},[G,W]),fq(G,K))throw zG(G,W,Q);if(xq({result:K,errorResetBoundary:Q,throwOnError:G.throwOnError,query:H,suspense:G.suspense}))throw K.error;if(Y.getDefaultOptions().queries?._experimental_afterQuery?.(G,K),G.experimental_prefetchInRender&&!A9.isServer()&&mq(K,X))(z?zG(G,W,Q):H?.promise)?.catch(J5).finally(()=>{W.updateResult()});return!G.notifyOnChangeProps?W.trackResult(K):K}function $5(Z,J){return pq(Z,ZG,J)}var J2=j(m(),1);function a1(Z,J){let $=Z1(J),[X]=J2.useState(()=>new QG($,Z));J2.useEffect(()=>{X.setOptions(Z)},[X,Z]);let Q=J2.useSyncExternalStore(J2.useCallback((G)=>X.subscribe(M1.batchCalls(G)),[X]),()=>X.getCurrentResult(),()=>X.getCurrentResult()),Y=J2.useCallback((G,H)=>{X.mutate(G,H).catch(J5)},[X]);if(Q.error&&B6(X.options.throwOnError,[Q.error]))throw Q.error;return{...Q,mutate:Y,mutateAsync:Q.mutate}}var TS=j(Xl(),1);var z3=new Map;var uq=0,WG=0;function W3(Z,J){let $=Date.now(),X=[Z,J.source,J.kind,J.name,J.message].join("\x00"),Q=z3.get(X);if(Q!==void 0&&$-Q<5000)return;if($-uq>=60000)uq=$,WG=0;if(WG>=30)return;if(WG++,z3.set(X,$),z3.size>256)for(let Y of[...z3.keys()].slice(0,128))z3.delete(Y);fetch(`/api/workspaces/${Z}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[J]})}).catch(()=>{})}var cS=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function cq(Z){if(!Z)return null;let J=cS.exec(Z);if(!J)return null;return{workspaceId:J[1],kind:J[2]==="widgets"?"widget":"view",name:J[3]}}var dq=!1;function lq(){if(dq)return;dq=!0;let Z=(J,$,X)=>{let Q=$ instanceof Error?$:null,Y=Q?.stack??"",G=J??cq(Y);if(!G)return;W3(G.workspaceId,{source:"window",kind:G.kind,name:G.name,message:Q?.message||X||String($),...Y?{stack:Y}:{}})};window.addEventListener("error",(J)=>Z(cq(J.filename),J.error,J.message)),window.addEventListener("unhandledrejection",(J)=>Z(null,J.reason))}var iq=(Z)=>{let J,$=new Set,X=(W,K)=>{let q=typeof W==="function"?W(J):W;if(!Object.is(q,J)){let V=J;J=(K!=null?K:typeof q!=="object"||q===null)?q:Object.assign({},J,q),$.forEach((U)=>U(J,V))}},Q=()=>J,H={setState:X,getState:Q,getInitialState:()=>z,subscribe:(W)=>{return $.add(W),()=>$.delete(W)}},z=J=Z(X,Q,H);return H},MJ=(Z)=>Z?iq(Z):iq;var K3=j(m(),1);var dS=(Z)=>Z;function KG(Z,J=dS){let $=K3.default.useSyncExternalStore(Z.subscribe,K3.default.useCallback(()=>J(Z.getState()),[Z,J]),K3.default.useCallback(()=>J(Z.getInitialState()),[Z,J]));return K3.default.useDebugValue($),$}var rq=(Z)=>{let J=MJ(Z),$=(X)=>KG(J,X);return Object.assign($,J),$},aq=(Z)=>Z?rq(Z):rq;function N6(Z,J){return`${Z}:${J}`}function M9(Z,J){return N6(Z,J??"new")}var W1=MJ()((Z)=>({activeByWorkspace:{},processing:{},errors:{},drafts:{},previews:{},attachments:{},setActive:(J,$)=>Z((X)=>({activeByWorkspace:{...X.activeByWorkspace,[J]:$}})),setProcessing:(J,$,X)=>Z((Q)=>({processing:{...Q.processing,[N6(J,$)]:X}})),reconcileProcessing:(J)=>Z(()=>({processing:Object.fromEntries(J.map(($)=>[N6($.workspaceId,$.sessionId),!0]))})),setError:(J,$,X)=>Z((Q)=>({errors:{...Q.errors,[N6(J,$)]:X}})),setDraft:(J,$,X)=>Z((Q)=>({drafts:{...Q.drafts,[M9(J,$)]:X}})),setPreview:(J)=>Z(($)=>({previews:{...$.previews,[J.messageId]:{workspaceId:J.workspaceId,sessionId:J.sessionId,parentToolUseId:J.parentToolUseId,blocks:J.blocks,updatedAt:Date.now()}}})),clearPreview:(J)=>Z(($)=>{if(!(J in $.previews))return $;let{[J]:X,...Q}=$.previews;return{previews:Q}}),clearPreviewsForSession:(J,$)=>Z((X)=>{let Q={},Y=!1;for(let[G,H]of Object.entries(X.previews))if(H.workspaceId===J&&H.sessionId===$)Y=!0;else Q[G]=H;return Y?{previews:Q}:X}),clearAllPreviews:()=>Z((J)=>Object.keys(J.previews).length?{previews:{}}:J),sweepPreviews:(J,$)=>Z((X)=>{let Q={},Y=!1;for(let[G,H]of Object.entries(X.previews))if($-H.updatedAt>J)Y=!0;else Q[G]=H;return Y?{previews:Q}:X}),addAttachments:(J,$,X)=>Z((Q)=>{let Y=M9(J,$);return{attachments:{...Q.attachments,[Y]:[...Q.attachments[Y]??[],...X]}}}),updateAttachment:(J,$,X,Q)=>Z((Y)=>{let G=M9(J,$),H=Y.attachments[G];if(!H)return{};return{attachments:{...Y.attachments,[G]:H.map((z)=>z.localId===X?{...z,...Q}:z)}}}),removeAttachment:(J,$,X)=>Z((Q)=>{let Y=M9(J,$),G=Q.attachments[Y];if(!G)return{};let H=G.find((z)=>z.localId===X);if(H?.previewUrl)URL.revokeObjectURL(H.previewUrl);return{attachments:{...Q.attachments,[Y]:G.filter((z)=>z.localId!==X)}}}),clearAttachments:(J,$)=>Z((X)=>{let Q=M9(J,$);for(let G of X.attachments[Q]??[])if(G.previewUrl)URL.revokeObjectURL(G.previewUrl);let Y={...X.attachments};return delete Y[Q],{attachments:Y}}),renameSession:(J,$,X)=>Z((Q)=>{let Y=N6(J,$),G=N6(J,X),H={...Q.processing},z={...Q.errors};if(Y in H)H[G]=H[Y],delete H[Y];if(Y in z)z[G]=z[Y],delete z[Y];let W=Q.activeByWorkspace[J]===$?{...Q.activeByWorkspace,[J]:X}:Q.activeByWorkspace,K=Q.previews,q=!1;for(let[V,U]of Object.entries(Q.previews))if(U.workspaceId===J&&U.sessionId===$){if(!q)K={...Q.previews},q=!0;K[V]={...U,sessionId:X}}return{processing:H,errors:z,activeByWorkspace:W,previews:K}})}));function sq(Z,J,$){if(!$)return{root:null,byParent:{}};let X=null,Q={};for(let Y of Object.values(Z)){if(Y.workspaceId!==J||Y.sessionId!==$)continue;if(Y.parentToolUseId===null){if(!X||Y.updatedAt>X.updatedAt)X=Y}else{let G=Q[Y.parentToolUseId];if(!G||Y.updatedAt>G.updatedAt)Q[Y.parentToolUseId]=Y}}return{root:X,byParent:Q}}function M7(Z){return KG(W1,Z)}var D0={all:["workspaces"],discover:["workspaces","discover"],createInfo:["workspaces","create-info"],preview:(Z)=>["workspaces","preview",Z],layout:(Z)=>["workspaces","layout",Z],widgets:(Z)=>["workspaces","widgets",Z],views:(Z)=>["workspaces","views",Z],viewBuilders:(Z)=>["workspaces","view-builders",Z],sessions:(Z)=>["workspaces","sessions",Z],events:(Z,J)=>["workspaces","events",Z,J],threadConfig:(Z,J)=>["workspaces","threadConfig",Z,J],userMcp:["mcp","user"],mcp:(Z)=>["workspaces","mcp",Z],models:(Z)=>["workspaces","models",Z],env:(Z)=>["workspaces","env",Z]};function q3(){return{turns:[],notices:[]}}function V3(Z,J){switch(J.kind){case"snapshot":return{...Z,snapshot:J.snapshot};case"turn":{let $=Z.turns.findIndex((Q)=>Q.id===J.turn.id),X=$>=0?Z.turns.map((Q,Y)=>Y===$?J.turn:Q):[...Z.turns,J.turn];return{...Z,turns:X}}case"notice":{if(Z.notices.some(($)=>$.id===J.notice.id))return{...Z,notices:Z.notices.map(($)=>$.id===J.notice.id?J.notice:$)};return{...Z,notices:[...Z.notices,J.notice]}}case"result":return{...Z,result:J.result}}}function nq(Z){return Z.reduce(V3,q3())}function tq(Z,J){let{queryClient:$,sendMessage:X,onWorkspaceSwitch:Q}=J,Y=W1.getState();if(Z.type==="status_snapshot"){Y.reconcileProcessing(Z.running??[]);return}if(Z.type==="status"){let{workspaceId:W,sessionId:K,processing:q}=Z;if(Y.setProcessing(W,K,q),!q)Y.clearPreviewsForSession(W,K);return}if(Z.type==="preview"){let W=Z,K=D0.events(W.workspaceId,W.sessionId);if($?.getQueryData(K)===void 0)return;Y.setPreview({workspaceId:W.workspaceId,sessionId:W.sessionId,messageId:W.messageId,parentToolUseId:W.parentToolUseId,blocks:W.blocks});return}if(Z.type==="session_renamed"){let{workspaceId:W,from:K,to:q}=Z;Y.renameSession(W,K,q);let V=$?.getQueryData(D0.events(W,K));if(V!==void 0)$?.setQueryData(D0.events(W,q),V),$?.removeQueries({queryKey:D0.events(W,K)});let U=$?.getQueryData(D0.threadConfig(W,K));if(U!==void 0)$?.setQueryData(D0.threadConfig(W,q),U),$?.removeQueries({queryKey:D0.threadConfig(W,K)});$?.invalidateQueries({queryKey:D0.sessions(W)}),$?.invalidateQueries({queryKey:D0.preview(W)});return}if(Z.type==="workspace:switch"){Q?.(Z.workspaceId);return}if(Z.type==="scratchpad:op"){let W=oq(Z.workspaceId);if(!W)return;let K=Z.opId;W(Z.op).then((q)=>X({type:"scratchpad:op-result",opId:K,result:q}),(q)=>X({type:"scratchpad:op-result",opId:K,error:q instanceof Error?q.message:String(q)}));return}let{workspaceId:G,sessionId:H}=Z;if(!G||!H)return;let z=Z.kind;if(z==="snapshot"||z==="turn"||z==="notice"||z==="result"){if(lS($,G,H,Z),z==="turn"){let W=Z.turn?.meta?.apiMessageId;if(W)Y.clearPreview(W)}if(z==="result")Y.clearPreviewsForSession(G,H)}if(z==="error"&&typeof Z.content==="string")Y.setError(G,H,Z.content),Y.clearPreviewsForSession(G,H);if(z==="stopped")Y.setProcessing(G,H,!1),Y.clearPreviewsForSession(G,H)}function lS(Z,J,$,X){let Q=D0.events(J,$),Y=Z?.getQueryData(Q);if(Y===void 0)return;Z?.setQueryData(Q,V3(Y,X))}var VG=null,_6=null,DJ=0,OJ=null,qG=[],JV=null,eq=null,iS=15000;function $V(Z){if(VG=Z,!eq)eq=setInterval(()=>W1.getState().sweepPreviews(iS,Date.now()),5000);if(_6)return;XV()}function XV(){let Z=++DJ;if(OJ)clearTimeout(OJ),OJ=null;let J=new WebSocket(ZV("/ws"));_6=J,J.onopen=()=>{if(DJ!==Z){J.close();return}for(let $ of qG)J.send(JSON.stringify($));qG.length=0,VG?.invalidateQueries({queryKey:["workspaces","events"]}),W1.getState().clearAllPreviews()},J.onmessage=($)=>{if(DJ!==Z)return;let X;try{X=JSON.parse($.data)}catch{return}rS(X)},J.onclose=()=>{if(DJ!==Z)return;_6=null,OJ=setTimeout(XV,1000)},J.onerror=()=>J.close()}function rS(Z){tq(Z,{queryClient:VG,sendMessage:wJ,onWorkspaceSwitch:JV})}function wJ(Z){if(_6&&_6.readyState===WebSocket.OPEN)_6.send(JSON.stringify(Z));else qG.push(Z)}function UG(Z){JV=Z}var Z3=j(m(),1);async function QV(Z,J){let $=await Z.text();return Error($||J)}async function A1(Z,J,$="Request failed"){let X=await fetch(Z,J);if(!X.ok)throw await QV(X,$);return X.json()}async function n7(Z,J,$="Request failed"){let X=await fetch(Z,J);if(!X.ok)throw await QV(X,$)}function R5(Z,J){return{method:Z,headers:{"Content-Type":"application/json"},body:J===void 0?void 0:JSON.stringify(J)}}function YV(Z,J){return $5({queryKey:D0.mcp(Z),queryFn:()=>A1(`/api/workspaces/${Z}/mcp`),enabled:J,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}function GV(){return $5({queryKey:D0.userMcp,queryFn:()=>A1("/api/mcp"),staleTime:30000,gcTime:1/0,refetchOnMount:!0,refetchOnWindowFocus:!0})}var y2={};t7(y2,{createHandle:()=>QB,Viewport:()=>XB,Trigger:()=>EU,Root:()=>PU,Positioner:()=>cU,Portal:()=>IU,Popup:()=>lU,Handle:()=>D$,Backdrop:()=>sU,Arrow:()=>rU});var S2=j(m(),1);var HV=j(m(),1);function D9(Z){let J=HV.useRef(!0);if(J.current)J.current=!1,Z()}var V7=j(m(),1);var zV=j(m(),1),aS=[];function O9(Z){zV.useEffect(Z,aS)}var U3=0;class y5{static create(){return new y5}currentId=U3;start(Z,J){this.clear(),this.currentId=setTimeout(()=>{this.currentId=U3,J()},Z)}isStarted(){return this.currentId!==U3}clear=()=>{if(this.currentId!==U3)clearTimeout(this.currentId),this.currentId=U3};disposeEffect=()=>{return this.clear}}function X5(){let Z=K1(y5.create).current;return O9(Z.disposeEffect),Z}var dJ=j(m(),1);function N5(Z){let J=K1(sS,Z).current;return J.next=Z,$0(J.effect),J}function sS(Z){let J={current:Z,next:Z,effect:()=>{J.current=J.next}};return J}function u0(Z){return Z?.ownerDocument||document}var D2=typeof navigator<"u",BG=nS(),WV=tS(),PJ=oS(),jJ=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),TJ=BG.platform==="MacIntel"&&BG.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(BG.platform),Oa=D2&&/firefox/i.test(PJ),CJ=D2&&/apple/i.test(navigator.vendor),wa=D2&&/Edg/i.test(PJ),SJ=D2&&/android/i.test(WV)||/android/i.test(PJ),KV=D2&&WV.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,IJ=PJ.includes("jsdom/");function nS(){if(!D2)return{platform:"",maxTouchPoints:-1};let Z=navigator.userAgentData;if(Z?.platform)return{platform:Z.platform,maxTouchPoints:navigator.maxTouchPoints};return{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function oS(){if(!D2)return"";let Z=navigator.userAgentData;if(Z&&Array.isArray(Z.brands))return Z.brands.map(({brand:J,version:$})=>`${J}/${$}`).join(" ");return navigator.userAgent}function tS(){if(!D2)return"";let Z=navigator.userAgentData;if(Z?.platform)return Z.platform;return navigator.platform??""}var B3="data-base-ui-focusable",FG="active",LG="selected",A6="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",w9="ArrowLeft",P9="ArrowRight",F3="ArrowUp",K4="ArrowDown";function b5(Z){let J=Z.activeElement;while(J?.shadowRoot?.activeElement!=null)J=J.shadowRoot.activeElement;return J}function k0(Z,J){if(!Z||!J)return!1;let $=J.getRootNode?.();if(Z.contains(J))return!0;if($&&qV($)){let X=J;while(X){if(Z===X)return!0;X=X.parentNode||X.host}}return!1}function q4(Z,J){if(!L1(Z))return!1;let $=Z;if(J.hasElement($))return!$.hasAttribute("data-trigger-disabled");for(let[,X]of J.entries())if(k0(X,$))return!X.hasAttribute("data-trigger-disabled");return!1}function k1(Z){if("composedPath"in Z)return Z.composedPath()[0];return Z.target}function b7(Z,J){if(J==null)return!1;if("composedPath"in Z)return Z.composedPath().includes(J);let $=Z;return $.target!=null&&J.contains($.target)}function VV(Z){return Z.matches("html,body")}function V4(Z){return u1(Z)&&Z.matches(A6)}function L3(Z){if(!Z)return!1;return Z.getAttribute("role")==="combobox"&&V4(Z)}function UV(Z){if(!Z||IJ)return!0;try{return Z.matches(":focus-visible")}catch(J){return!0}}function U4(Z){if(!Z)return null;return Z.hasAttribute(B3)?Z:Z.querySelector(`[${B3}]`)||Z}function j9(Z,J,$=!0){return Z.filter((Q)=>Q.parentId===J&&(!$||Q.context?.open)).flatMap((Q)=>[Q,...j9(Z,Q.id,$)])}function NG(Z,J){let $=[],X=Z.find((Q)=>Q.id===J)?.parentId;while(X){let Q=Z.find((Y)=>Y.id===X);if(X=Q?.parentId,Q)$=$.concat(Q)}return $}function U5(Z){Z.preventDefault(),Z.stopPropagation()}function BV(Z){return"nativeEvent"in Z}function EJ(Z){if(Z.pointerType===""&&Z.isTrusted)return!0;if(SJ&&Z.pointerType)return Z.type==="click"&&Z.buttons===1;return Z.detail===0&&!Z.pointerType}function kJ(Z){if(IJ)return!1;return!SJ&&Z.width===0&&Z.height===0||SJ&&Z.width===1&&Z.height===1&&Z.pressure===0&&Z.detail===0&&Z.pointerType==="mouse"||Z.width<1&&Z.height<1&&Z.pressure===0&&Z.detail===0&&Z.pointerType==="touch"}function x7(Z,J){let $=["mouse","pen"];if(!J)$.push("",void 0);return $.includes(Z)}function RJ(Z){let J=Z.type;return J==="click"||J==="mousedown"||J==="keydown"||J==="keyup"}function yJ(Z,J,$){return Math.floor(Z/J)!==$}function M6(Z,J){return J<0||J>=Z.current.length}function bJ(Z,J){return x5(Z,{disabledIndices:J})}function AG(Z,J){return x5(Z,{decrement:!0,startingIndex:Z.current.length,disabledIndices:J})}function x5(Z,{startingIndex:J=-1,decrement:$=!1,disabledIndices:X,amount:Q=1}={}){let Y=J;do Y+=$?-Q:Q;while(Y>=0&&Y<=Z.current.length-1&&D6(Z,Y,X));return Y}function FV(Z,{event:J,orientation:$,loopFocus:X,rtl:Q,cols:Y,disabledIndices:G,minIndex:H,maxIndex:z,prevIndex:W,stopEvent:K=!1}){let q=W,V=[],U={},B=!1;{let L=null,_=-1;Z.current.forEach((M,O)=>{if(M==null)return;let D=M.closest('[role="row"]');if(D)B=!0;if(D!==L||_===-1)L=D,_+=1,V[_]=[];V[_].push(O),U[O]=_})}let F=B&&V.length>0&&V.some((L)=>L.length!==Y);function N(L){if(!F||W===-1)return;let _=U[W];if(_==null)return;let M=V[_].indexOf(W),O=L==="up"?_-1:_+1;if(X){if(O<0)O=V.length-1;else if(O>=V.length)O=0}let D=new Set;while(O>=0&&O<V.length&&!D.has(O)){D.add(O);let A=V[O];if(A.length===0){O=L==="up"?O-1:O+1;continue}let T=Math.min(M,A.length-1);for(let S=T;S>=0;S-=1){let k=A[S];if(!D6(Z,k,G))return k}if(O=L==="up"?O-1:O+1,X){if(O<0)O=V.length-1;else if(O>=V.length)O=0}}return}if(J.key===F3){let L=N("up");if(L!==void 0){if(K)U5(J);q=L}else{if(K)U5(J);if(W===-1)q=z;else if(q=x5(Z,{startingIndex:q,amount:Y,decrement:!0,disabledIndices:G}),X&&(W-Y<H||q<0)){let _=W%Y,M=z%Y,O=z-(M-_);if(M===_)q=z;else q=M>_?O:O-Y}if(M6(Z,q))q=W}}if(J.key===K4){let L=N("down");if(L!==void 0){if(K)U5(J);q=L}else{if(K)U5(J);if(W===-1)q=H;else if(q=x5(Z,{startingIndex:W,amount:Y,disabledIndices:G}),X&&W+Y>z)q=x5(Z,{startingIndex:W%Y-Y,amount:Y,disabledIndices:G});if(M6(Z,q))q=W}}if($==="both"){let L=_G(W/Y);if(J.key===(Q?w9:P9)){if(K)U5(J);if(W%Y!==Y-1){if(q=x5(Z,{startingIndex:W,disabledIndices:G}),X&&yJ(q,Y,L))q=x5(Z,{startingIndex:W-W%Y-1,disabledIndices:G})}else if(X)q=x5(Z,{startingIndex:W-W%Y-1,disabledIndices:G});if(yJ(q,Y,L))q=W}if(J.key===(Q?P9:w9)){if(K)U5(J);if(W%Y!==0){if(q=x5(Z,{startingIndex:W,decrement:!0,disabledIndices:G}),X&&yJ(q,Y,L))q=x5(Z,{startingIndex:W+(Y-W%Y),decrement:!0,disabledIndices:G})}else if(X)q=x5(Z,{startingIndex:W+(Y-W%Y),decrement:!0,disabledIndices:G});if(yJ(q,Y,L))q=W}let _=_G(z/Y)===L;if(M6(Z,q))if(X&&_)q=J.key===(Q?P9:w9)?z:x5(Z,{startingIndex:W-W%Y-1,disabledIndices:G});else q=W}return q}function LV(Z,J,$){let X=[],Q=0;return Z.forEach(({width:Y,height:G},H)=>{if(Y>J);let z=!1;if($)Q=0;while(!z){let W=[];for(let K=0;K<Y;K+=1)for(let q=0;q<G;q+=1)W.push(Q+K+q*J);if(Q%J+Y<=J&&W.every((K)=>X[K]==null))W.forEach((K)=>{X[K]=H}),z=!0;else Q+=1}}),[...X]}function NV(Z,J,$,X,Q){if(Z===-1)return-1;let Y=$.indexOf(Z),G=J[Z];switch(Q){case"tl":return Y;case"tr":if(!G)return Y;return Y+G.width-1;case"bl":if(!G)return Y;return Y+(G.height-1)*X;case"br":return $.lastIndexOf(Z);default:return-1}}function _V(Z,J){return J.flatMap(($,X)=>Z.includes($)?[X]:[])}function D6(Z,J,$){if(typeof $==="function")return $(J);if($)return $.includes(J);let X=Z.current[J];if(!X)return!1;return X.hasAttribute("disabled")||X.getAttribute("aria-disabled")==="true"}/*!
|
|
7
|
-
* tabbable 6.4.0
|
|
8
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
9
|
-
*/var eS=["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] *)"],xJ=eS.join(","),MV=typeof Element>"u",O6=MV?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,hJ=!MV&&Element.prototype.getRootNode?function(Z){var J;return Z===null||Z===void 0?void 0:(J=Z.getRootNode)===null||J===void 0?void 0:J.call(Z)}:function(Z){return Z===null||Z===void 0?void 0:Z.ownerDocument},vJ=function(J,$){var X;if($===void 0)$=!0;var Q=J===null||J===void 0?void 0:(X=J.getAttribute)===null||X===void 0?void 0:X.call(J,"inert"),Y=Q===""||Q==="true",G=Y||$&&J&&(typeof J.closest==="function"?J.closest("[inert]"):vJ(J.parentNode));return G},ZI=function(J){var $,X=J===null||J===void 0?void 0:($=J.getAttribute)===null||$===void 0?void 0:$.call(J,"contenteditable");return X===""||X==="true"},DV=function(J,$,X){if(vJ(J))return[];var Q=Array.prototype.slice.apply(J.querySelectorAll(xJ));if($&&O6.call(J,xJ))Q.unshift(J);return Q=Q.filter(X),Q},gJ=function(J,$,X){var Q=[],Y=Array.from(J);while(Y.length){var G=Y.shift();if(vJ(G,!1))continue;if(G.tagName==="SLOT"){var H=G.assignedElements(),z=H.length?H:G.children,W=gJ(z,!0,X);if(X.flatten)Q.push.apply(Q,W);else Q.push({scopeParent:G,candidates:W})}else{var K=O6.call(G,xJ);if(K&&X.filter(G)&&($||!J.includes(G)))Q.push(G);var q=G.shadowRoot||typeof X.getShadowRoot==="function"&&X.getShadowRoot(G),V=!vJ(q,!1)&&(!X.shadowRootFilter||X.shadowRootFilter(G));if(q&&V){var U=gJ(q===!0?G.children:q.children,!0,X);if(X.flatten)Q.push.apply(Q,U);else Q.push({scopeParent:G,candidates:U})}else Y.unshift.apply(Y,G.children)}}return Q},OV=function(J){return!isNaN(parseInt(J.getAttribute("tabindex"),10))},wV=function(J){if(!J)throw Error("No node provided");if(J.tabIndex<0){if((/^(AUDIO|VIDEO|DETAILS)$/.test(J.tagName)||ZI(J))&&!OV(J))return 0}return J.tabIndex},JI=function(J,$){var X=wV(J);if(X<0&&$&&!OV(J))return 0;return X},$I=function(J,$){return J.tabIndex===$.tabIndex?J.documentOrder-$.documentOrder:J.tabIndex-$.tabIndex},PV=function(J){return J.tagName==="INPUT"},XI=function(J){return PV(J)&&J.type==="hidden"},QI=function(J){var $=J.tagName==="DETAILS"&&Array.prototype.slice.apply(J.children).some(function(X){return X.tagName==="SUMMARY"});return $},YI=function(J,$){for(var X=0;X<J.length;X++)if(J[X].checked&&J[X].form===$)return J[X]},GI=function(J){if(!J.name)return!0;var $=J.form||hJ(J),X=function(H){return $.querySelectorAll('input[type="radio"][name="'+H+'"]')},Q;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape==="function")Q=X(window.CSS.escape(J.name));else try{Q=X(J.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 Y=YI(Q,J.form);return!Y||Y===J},HI=function(J){return PV(J)&&J.type==="radio"},zI=function(J){return HI(J)&&!GI(J)},WI=function(J){var $,X=J&&hJ(J),Q=($=X)===null||$===void 0?void 0:$.host,Y=!1;if(X&&X!==J){var G,H,z;Y=!!((G=Q)!==null&&G!==void 0&&(H=G.ownerDocument)!==null&&H!==void 0&&H.contains(Q)||J!==null&&J!==void 0&&(z=J.ownerDocument)!==null&&z!==void 0&&z.contains(J));while(!Y&&Q){var W,K,q;X=hJ(Q),Q=(W=X)===null||W===void 0?void 0:W.host,Y=!!((K=Q)!==null&&K!==void 0&&(q=K.ownerDocument)!==null&&q!==void 0&&q.contains(Q))}}return Y},AV=function(J){var $=J.getBoundingClientRect(),X=$.width,Q=$.height;return X===0&&Q===0},KI=function(J,$){var{displayCheck:X,getShadowRoot:Q}=$;if(X==="full-native"){if("checkVisibility"in J){var Y=J.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!Y}}if(getComputedStyle(J).visibility==="hidden")return!0;var G=O6.call(J,"details>summary:first-of-type"),H=G?J.parentElement:J;if(O6.call(H,"details:not([open]) *"))return!0;if(!X||X==="full"||X==="full-native"||X==="legacy-full"){if(typeof Q==="function"){var z=J;while(J){var W=J.parentElement,K=hJ(J);if(W&&!W.shadowRoot&&Q(W)===!0)return AV(J);else if(J.assignedSlot)J=J.assignedSlot;else if(!W&&K!==J.ownerDocument)J=K.host;else J=W}J=z}if(WI(J))return!J.getClientRects().length;if(X!=="legacy-full")return!0}else if(X==="non-zero-area")return AV(J);return!1},qI=function(J){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(J.tagName)){var $=J.parentElement;while($){if($.tagName==="FIELDSET"&&$.disabled){for(var X=0;X<$.children.length;X++){var Q=$.children.item(X);if(Q.tagName==="LEGEND")return O6.call($,"fieldset[disabled] *")?!0:!Q.contains(J)}return!0}$=$.parentElement}}return!1},MG=function(J,$){if($.disabled||XI($)||KI($,J)||QI($)||qI($))return!1;return!0},DG=function(J,$){if(zI($)||wV($)<0||!MG(J,$))return!1;return!0},VI=function(J){var $=parseInt(J.getAttribute("tabindex"),10);if(isNaN($)||$>=0)return!0;return!1},jV=function(J){var $=[],X=[];return J.forEach(function(Q,Y){var G=!!Q.scopeParent,H=G?Q.scopeParent:Q,z=JI(H,G),W=G?jV(Q.candidates):H;if(z===0)G?$.push.apply($,W):$.push(H);else X.push({documentOrder:Y,tabIndex:z,item:Q,isScope:G,content:W})}),X.sort($I).reduce(function(Q,Y){return Y.isScope?Q.push.apply(Q,Y.content):Q.push(Y.content),Q},[]).concat($)},B4=function(J,$){$=$||{};var X;if($.getShadowRoot)X=gJ([J],$.includeContainer,{filter:DG.bind(null,$),flatten:!1,getShadowRoot:$.getShadowRoot,shadowRootFilter:VI});else X=DV(J,$.includeContainer,DG.bind(null,$));return jV(X)},TV=function(J,$){$=$||{};var X;if($.getShadowRoot)X=gJ([J],$.includeContainer,{filter:MG.bind(null,$),flatten:!0,getShadowRoot:$.getShadowRoot});else X=DV(J,$.includeContainer,MG.bind(null,$));return X},OG=function(J,$){if($=$||{},!J)throw Error("No node provided");if(O6.call(J,xJ)===!1)return!1;return DG($,J)};var F4=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function CV(Z,J){let $=B4(Z,F4()),X=$.length;if(X===0)return;let Q=b5(u0(Z)),Y=$.indexOf(Q),G=Y===-1?J===1?0:X-1:Y+J;return $[G]}function O2(Z){return CV(u0(Z).body,1)||Z}function mJ(Z){return CV(u0(Z).body,-1)||Z}function SV(Z,J){if(!Z)return null;let $=B4(u0(Z).body,F4()),X=$.length;if(X===0)return null;let Q=$.indexOf(Z);if(Q===-1)return null;let Y=(Q+J+X)%X;return $[Y]}function fJ(Z){return SV(Z,1)}function pJ(Z){return SV(Z,-1)}function o7(Z,J){let $=J||Z.currentTarget,X=Z.relatedTarget;return!X||!k0($,X)}function IV(Z){B4(Z,F4()).forEach(($)=>{$.dataset.tabindex=$.getAttribute("tabindex")||"",$.setAttribute("tabindex","-1")})}function wG(Z){Z.querySelectorAll("[data-tabindex]").forEach(($)=>{let X=$.dataset.tabindex;if(delete $.dataset.tabindex,X)$.setAttribute("tabindex",X);else $.removeAttribute("tabindex")})}var w2=j(m(),1);var uJ=j(m(),1);var EV=0;function UI(Z,J="mui"){let[$,X]=uJ.useState(Z),Q=Z||$;return uJ.useEffect(()=>{if($==null)EV+=1,X(`${J}-${EV}`)},[$,J]),Q}var kV=RV.useId;function q7(Z,J){if(kV!==void 0){let $=kV();return Z??(J?`${J}-${$}`:$)}return UI(Z,J)}function cJ(){let Z=new Map;return{emit(J,$){Z.get(J)?.forEach((X)=>X($))},on(J,$){if(!Z.has(J))Z.set(J,new Set);Z.get(J).add($)},off(J,$){Z.get(J)?.delete($)}}}class L4{nodesRef={current:[]};events=cJ();addNode(Z){this.nodesRef.current.push(Z)}removeNode(Z){let J=this.nodesRef.current.findIndex(($)=>$===Z);if(J!==-1)this.nodesRef.current.splice(J,1)}}var PG=j(a(),1),yV=w2.createContext(null),bV=w2.createContext(null),_5=()=>w2.useContext(yV)?.id||null,d5=(Z)=>{let J=w2.useContext(bV);return Z??J};function N4(Z){let J=q7(),$=d5(Z),X=_5();return $0(()=>{if(!J)return;let Q={id:J,parentId:X};return $?.addNode(Q),()=>{$?.removeNode(Q)}},[$,J,X]),J}function N3(Z){let{children:J,id:$}=Z,X=_5();return PG.jsx(yV.Provider,{value:w2.useMemo(()=>({id:$,parentId:X}),[$,X]),children:J})}function _3(Z){let{children:J,externalTree:$}=Z,X=K1(()=>$??new L4).current;return PG.jsx(bV.Provider,{value:X,children:J})}var n={};t7(n,{windowResize:()=>iI,wheel:()=>mI,triggerPress:()=>FI,triggerHover:()=>LI,triggerFocus:()=>NI,trackPress:()=>PI,swipe:()=>lI,siblingOpen:()=>uI,scrub:()=>fI,pointer:()=>vI,outsidePress:()=>_I,none:()=>BI,listNavigation:()=>xI,linkPress:()=>DI,keyboard:()=>hI,itemPress:()=>AI,inputPress:()=>kI,inputPaste:()=>EI,inputClear:()=>SI,inputChange:()=>CI,inputBlur:()=>II,incrementPress:()=>jI,imperativeAction:()=>dI,focusOut:()=>RI,escapeKey:()=>yI,drag:()=>gI,disabled:()=>cI,decrementPress:()=>TI,closeWatcher:()=>bI,closePress:()=>MI,clearPress:()=>OI,chipRemovePress:()=>wI,cancelOpen:()=>pI});var BI="none",FI="trigger-press",LI="trigger-hover",NI="trigger-focus",_I="outside-press",AI="item-press",MI="close-press",DI="link-press",OI="clear-press",wI="chip-remove-press",PI="track-press",jI="increment-press",TI="decrement-press",CI="input-change",SI="input-clear",II="input-blur",EI="input-paste",kI="input-press",RI="focus-out",yI="escape-key",bI="close-watcher",xI="list-navigation",hI="keyboard",vI="pointer",gI="drag",mI="wheel",fI="scrub",pI="cancel-open",uI="sibling-open",cI="disabled",dI="imperative-action",lI="swipe",iI="window-resize";function N0(Z,J,$,X){let Q=!1,Y=!1,G=X??N1;return{reason:Z,event:J??new Event("base-ui"),cancel(){Q=!0},allowPropagation(){Y=!0},get isCanceled(){return Q},get isPropagationAllowed(){return Y},trigger:$,...G}}function O7(Z){return`data-base-ui-${Z}`}var Ys=O7("safe-polygon"),Gs=`button,[role="button"],select,[tabindex]:not([tabindex="-1"]),${A6}`;function w6(Z,J,$){if($&&!x7($))return 0;if(typeof Z==="number")return Z;if(typeof Z==="function"){let X=Z();if(typeof X==="number")return X;return X?.[J]}return Z?.[J]}var xV=j(a(),1),hV=V7.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new y5,currentIdRef:{current:null},currentContextRef:{current:null}});function jG(Z){let{children:J,delay:$,timeoutMs:X=0}=Z,Q=V7.useRef($),Y=V7.useRef($),G=V7.useRef(null),H=V7.useRef(null),z=X5();return xV.jsx(hV.Provider,{value:V7.useMemo(()=>({hasProvider:!0,delayRef:Q,initialDelayRef:Y,currentIdRef:G,timeoutMs:X,currentContextRef:H,timeout:z}),[X,z]),children:J})}function TG(Z,J={open:!1}){let $="rootStore"in Z?Z.rootStore:Z,X=$.useState("floatingId"),{open:Q}=J,Y=V7.useContext(hV),{currentIdRef:G,delayRef:H,timeoutMs:z,initialDelayRef:W,currentContextRef:K,hasProvider:q,timeout:V}=Y,[U,B]=V7.useState(!1);return $0(()=>{function F(){B(!1),K.current?.setIsInstantPhase(!1),G.current=null,K.current=null,H.current=W.current}if(!G.current)return;if(!Q&&G.current===X){if(B(!1),z){let N=X;return V.start(z,()=>{if($.select("open")||G.current&&G.current!==N)return;F()}),()=>{V.clear()}}F()}return},[Q,X,G,H,z,W,K,V,$]),$0(()=>{if(!Q)return;let F=K.current,N=G.current;if(V.clear(),K.current={onOpenChange:$.setOpen,setIsInstantPhase:B},G.current=X,H.current={open:0,close:w6(W.current,"close")},N!==null&&N!==X)B(!0),F?.setIsInstantPhase(!0),F?.onOpenChange(!1,N0(n.none));else B(!1),F?.setIsInstantPhase(!1)},[Q,X,$,G,H,z,W,K,V]),$0(()=>{return()=>{K.current=null}},[K]),V7.useMemo(()=>({hasProvider:q,delayRef:H,isInstantPhase:U}),[q,H,U])}var A5=j(m(),1);var vV={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},P6={...vV,position:"fixed",top:0,left:0},gV={...vV,position:"absolute"};var lJ=null,Ns=globalThis.requestAnimationFrame;class mV{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=(Z)=>{this.isScheduled=!1;let J=this.callbacks,$=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,$>0)for(let X=0;X<J.length;X+=1)J[X]?.(Z)};request(Z){let J=this.nextId;this.nextId+=1,this.callbacks.push(Z),this.callbacksCount+=1;let $=!1;if(!this.isScheduled||$)requestAnimationFrame(this.tick),this.isScheduled=!0;return J}cancel(Z){let J=Z-this.startId;if(J<0||J>=this.callbacks.length)return;this.callbacks[J]=null,this.callbacksCount-=1}}var iJ=new mV;class h1{static create(){return new h1}static request(Z){return iJ.request(Z)}static cancel(Z){return iJ.cancel(Z)}currentId=lJ;request(Z){this.cancel(),this.currentId=iJ.request(()=>{this.currentId=lJ,Z()})}cancel=()=>{if(this.currentId!==lJ)iJ.cancel(this.currentId),this.currentId=lJ};disposeEffect=()=>{return this.cancel}}function h7(){let Z=K1(h1.create).current;return O9(Z.disposeEffect),Z}var rJ=j(m(),1);var fV=j(a(),1),v7=rJ.forwardRef(function(J,$){let[X,Q]=rJ.useState();return $0(()=>{if(CJ)Q("button")},[]),fV.jsx("span",{...J,ref:$,style:P6,"aria-hidden":X?void 0:!0,...{tabIndex:0,role:X},"data-base-ui-focus-guard":""})});var pV=0;function _4(Z,J={}){let{preventScroll:$=!1,cancelPrevious:X=!0,sync:Q=!1}=J;if(X)cancelAnimationFrame(pV);let Y=()=>Z?.focus({preventScroll:$});if(Q)Y();else pV=requestAnimationFrame(Y)}var j6={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function uV(Z){if(Z==="inert")return j6.inert;if(Z==="aria-hidden")return j6["aria-hidden"];return j6.none}var aJ=new WeakSet,sJ={},CG=0;var cV=(Z)=>Z&&(Z.host||cV(Z.parentNode)),rI=(Z,J)=>J.map(($)=>{if(Z.contains($))return $;let X=cV($);if(Z.contains(X))return X;return null}).filter(($)=>$!=null);function aI(Z,J,$,X){let Y=X?"inert":$?"aria-hidden":null,G=rI(J,Z),H=new Set,z=new Set(G),W=[];if(!sJ["data-base-ui-inert"])sJ["data-base-ui-inert"]=new WeakMap;let K=sJ["data-base-ui-inert"];G.forEach(q),V(J),H.clear();function q(U){if(!U||H.has(U))return;if(H.add(U),U.parentNode)q(U.parentNode)}function V(U){if(!U||z.has(U))return;[].forEach.call(U.children,(B)=>{if(nJ(B)==="script")return;if(H.has(B))V(B);else{let F=Y?B.getAttribute(Y):null,N=F!==null&&F!=="false",L=uV(Y),_=(L.get(B)||0)+1,M=(K.get(B)||0)+1;if(L.set(B,_),K.set(B,M),W.push(B),_===1&&N)aJ.add(B);if(M===1)B.setAttribute("data-base-ui-inert","");if(!N&&Y)B.setAttribute(Y,Y==="inert"?"":"true")}})}return CG+=1,()=>{if(W.forEach((U)=>{let B=uV(Y),N=(B.get(U)||0)-1,L=(K.get(U)||0)-1;if(B.set(U,N),K.set(U,L),!N){if(!aJ.has(U)&&Y)U.removeAttribute(Y);aJ.delete(U)}if(!L)U.removeAttribute("data-base-ui-inert")}),CG-=1,!CG)j6.inert=new WeakMap,j6["aria-hidden"]=new WeakMap,j6.none=new WeakMap,aJ=new WeakSet,sJ={}}}function dV(Z,J=!1,$=!1){let X=u0(Z[0]).body;return aI(Z.concat(Array.from(X.querySelectorAll("[aria-live]"))),X,J,$)}var s1=j(m(),1),SG=j(w7(),1);var A4=j(a(),1),rV=s1.createContext(null),IG=()=>s1.useContext(rV),sI=O7("portal");function oJ(Z={}){let{ref:J,container:$,componentProps:X=N1,elementProps:Q}=Z,Y=q7(),H=IG()?.portalNode,[z,W]=s1.useState(null),[K,q]=s1.useState(null),V=Y0((N)=>{if(N!==null)q(N)}),U=s1.useRef(null);$0(()=>{if($===null){if(U.current)U.current=null,q(null),W(null);return}if(Y==null)return;let N=($&&(lV($)?$:$.current))??H??document.body;if(N==null){if(U.current)U.current=null,q(null),W(null);return}if(U.current!==N)U.current=N,q(null),W(N)},[$,H,Y]);let B=K0("div",X,{ref:[J,V],props:[{id:Y,[sI]:""},Q]});return{portalNode:K,portalSubtree:z&&B?SG.createPortal(B,z):null}}var M4=s1.forwardRef(function(J,$){let{children:X,container:Q,className:Y,render:G,renderGuards:H,...z}=J,{portalNode:W,portalSubtree:K}=oJ({container:Q,ref:$,componentProps:J,elementProps:z}),q=s1.useRef(null),V=s1.useRef(null),U=s1.useRef(null),B=s1.useRef(null),[F,N]=s1.useState(null),L=F?.modal,_=F?.open,M=typeof H==="boolean"?H:!!F&&!F.modal&&F.open&&!!W;s1.useEffect(()=>{if(!W||L)return;function D(A){if(W&&A.relatedTarget&&o7(A))(A.type==="focusin"?wG:IV)(W)}return W.addEventListener("focusin",D,!0),W.addEventListener("focusout",D,!0),()=>{W.removeEventListener("focusin",D,!0),W.removeEventListener("focusout",D,!0)}},[W,L]),s1.useEffect(()=>{if(!W||_)return;wG(W)},[_,W]);let O=s1.useMemo(()=>({beforeOutsideRef:q,afterOutsideRef:V,beforeInsideRef:U,afterInsideRef:B,portalNode:W,setFocusManagerState:N}),[W]);return A4.jsxs(s1.Fragment,{children:[K,A4.jsxs(rV.Provider,{value:O,children:[M&&W&&A4.jsx(v7,{"data-type":"outside",ref:q,onFocus:(D)=>{if(o7(D,W))U.current?.focus();else{let A=F?F.domReference:null;mJ(A)?.focus()}}}),M&&W&&A4.jsx("span",{"aria-owns":W.id,style:iV}),W&&SG.createPortal(X,W),M&&W&&A4.jsx(v7,{"data-type":"outside",ref:V,onFocus:(D)=>{if(o7(D,W))B.current?.focus();else{let A=F?F.domReference:null;if(O2(A)?.focus(),F?.closeOnFocusOut)F?.onOpenChange(!1,N0(n.focusOut,D.nativeEvent))}}})]})]})});function e7(Z){if(Z==null)return Z;return"current"in Z?Z.current:Z}var A3=j(a(),1);function nI(Z,J){let $=D7(Z.target);if(Z instanceof $.KeyboardEvent)return"keyboard";if(Z instanceof $.FocusEvent)return J||"keyboard";if("pointerType"in Z)return Z.pointerType||"keyboard";if("touches"in Z)return"touch";if(Z instanceof $.MouseEvent)return J||(Z.detail===0?"keyboard":"mouse");return""}var aV=20,P2=[];function kG(){P2=P2.filter((Z)=>{return Z.deref()?.isConnected})}function oI(Z){if(kG(),Z&&nJ(Z)!=="body"){if(P2.push(new WeakRef(Z)),P2.length>aV)P2=P2.slice(-aV)}}function EG(){return kG(),P2[P2.length-1]?.deref()}function tI(Z){if(!Z)return null;let J=F4();if(OG(Z,J))return Z;return B4(Z,J)[0]||Z}function eI(Z){if(!Z||!Z.isConnected)return!1;if(typeof Z.checkVisibility==="function")return Z.checkVisibility();return T6(Z).display!=="none"}function sV(Z,J){if(!J.current.includes("floating")&&!Z.getAttribute("role")?.includes("dialog"))return;let $=F4(),Q=TV(Z,$).filter((G)=>{let H=G.getAttribute("data-tabindex")||"";return OG(G,$)||G.hasAttribute("data-tabindex")&&!H.startsWith("-")}),Y=Z.getAttribute("tabindex");if(J.current.includes("floating")||Q.length===0){if(Y!=="0")Z.setAttribute("tabindex","0")}else if(Y!=="-1"||Z.hasAttribute("data-tabindex")&&Z.getAttribute("data-tabindex")!=="-1")Z.setAttribute("tabindex","-1"),Z.setAttribute("data-tabindex","-1")}function D4(Z){let{context:J,children:$,disabled:X=!1,initialFocus:Q=!0,returnFocus:Y=!0,restoreFocus:G=!1,modal:H=!0,closeOnFocusOut:z=!0,openInteractionType:W="",nextFocusableElement:K,previousFocusableElement:q,beforeContentFocusGuardRef:V,externalTree:U}=Z,B="rootStore"in J?J.rootStore:J,F=B.useState("open"),N=B.useState("domReferenceElement"),L=B.useState("floatingElement"),{events:_,dataRef:M}=B.context,O=Y0(()=>M.current.floatingContext?.nodeId),D=Q===!1,A=L3(N)&&D,T=A5.useRef(["content"]),S=N5(Q),k=N5(Y),P=N5(W),g=d5(U),C=IG(),I=A5.useRef(null),y=A5.useRef(null),b=A5.useRef(!1),R=A5.useRef(!1),x=A5.useRef(!1),v=A5.useRef(-1),d=A5.useRef(""),w=A5.useRef(""),z0=A5.useRef(null),G0=A5.useRef(null),E=Z9(z0,V,C?.beforeInsideRef),s=Z9(G0,C?.afterInsideRef),A0=X5(),l=X5(),H0=h7(),q0=C!=null,X0=U4(L),Q0=Y0((Z0=X0)=>{return Z0?B4(Z0,F4()):[]}),V0=Y0((Z0)=>{let e=Q0(Z0);return T.current.map(()=>e).filter(Boolean).flat()});A5.useEffect(()=>{if(X||!H)return;function Z0(_0){if(_0.key==="Tab"){if(k0(X0,b5(u0(X0)))&&Q0().length===0&&!A)U5(_0)}}let e=u0(X0);return e.addEventListener("keydown",Z0),()=>{e.removeEventListener("keydown",Z0)}},[X,N,X0,H,T,A,Q0,V0]),A5.useEffect(()=>{if(X||!F)return;let Z0=u0(X0);function e(){x.current=!1}function _0(W0){let r=k1(W0),o=k0(L,r)||k0(N,r)||k0(C?.portalNode,r);if(x.current=!o,w.current=W0.pointerType||"keyboard",r?.closest(`[${C6}]`))R.current=!0}function i(){w.current="keyboard"}return Z0.addEventListener("pointerdown",_0,!0),Z0.addEventListener("pointerup",e,!0),Z0.addEventListener("pointercancel",e,!0),Z0.addEventListener("keydown",i,!0),()=>{Z0.removeEventListener("pointerdown",_0,!0),Z0.removeEventListener("pointerup",e,!0),Z0.removeEventListener("pointercancel",e,!0),Z0.removeEventListener("keydown",i,!0)}},[X,L,N,X0,F,C]),A5.useEffect(()=>{if(X||!z)return;let Z0=u0(X0);function e(){R.current=!0,l.start(0,()=>{R.current=!1})}function _0(f){let u=k1(f),M0=Q0().indexOf(u);if(M0!==-1)v.current=M0}function i(f){let{relatedTarget:u,currentTarget:L0}=f,M0=k1(f);queueMicrotask(()=>{let h0=O(),l0=B.context.triggerElements,h=u?.hasAttribute(O7("focus-guard"))&&[z0.current,G0.current,C?.beforeInsideRef.current,C?.afterInsideRef.current,C?.beforeOutsideRef.current,C?.afterOutsideRef.current,e7(q),e7(K)].includes(u),c=!(k0(N,u)||k0(L,u)||k0(u,L)||k0(C?.portalNode,u)||u!=null&&l0.hasElement(u)||l0.hasMatchingElement((t)=>k0(t,u))||h||g&&(j9(g.nodesRef.current,h0).find((t)=>k0(t.context?.elements.floating,u)||k0(t.context?.elements.domReference,u))||NG(g.nodesRef.current,h0).find((t)=>[t.context?.elements.floating,U4(t.context?.elements.floating)].includes(u)||t.context?.elements.domReference===u)));if(L0===N&&X0)sV(X0,T);if(G&&L0!==N&&!eI(M0)&&b5(Z0)===Z0.body){if(u1(X0)){if(X0.focus(),G==="popup"){H0.request(()=>{X0.focus()});return}}let t=v.current,U0=Q0(),C0=U0[t]||U0[U0.length-1]||X0;if(u1(C0))C0.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}if((A?!0:!H)&&u&&c&&!R.current&&(A||u!==EG()))b.current=!0,B.setOpen(!1,N0(n.focusOut,f))})}function W0(){if(x.current)return;M.current.insideReactTree=!0,A0.start(0,()=>{M.current.insideReactTree=!1})}let r=u1(N)?N:null,o=[];if(!L&&!r)return;if(r)r.addEventListener("focusout",i),r.addEventListener("pointerdown",e),o.push(()=>{r.removeEventListener("focusout",i),r.removeEventListener("pointerdown",e)});if(L){if(L.addEventListener("focusin",_0),L.addEventListener("focusout",i),C)L.addEventListener("focusout",W0,!0),o.push(()=>{L.removeEventListener("focusout",W0,!0)});o.push(()=>{L.removeEventListener("focusin",_0),L.removeEventListener("focusout",i)})}return()=>{o.forEach((f)=>{f()})}},[X,N,L,X0,H,g,C,B,z,G,Q0,A,O,T,M,A0,l,H0,K,q]),A5.useEffect(()=>{if(X||!L||!F)return;let Z0=Array.from(C?.portalNode?.querySelectorAll(`[${O7("portal")}]`)||[]),_0=(g?NG(g.nodesRef.current,O()):[]).find((W0)=>L3(W0.context?.elements.domReference||null))?.context?.elements.domReference,i=[L,_0,...Z0,I.current,y.current,z0.current,G0.current,C?.beforeOutsideRef.current,C?.afterOutsideRef.current,e7(q),e7(K),A?N:null].filter((W0)=>W0!=null);return dV(i,H||A)},[F,X,N,L,H,T,C,A,g,O,K,q]),$0(()=>{if(!F||X||!u1(X0))return;let Z0=u0(X0),e=b5(Z0);queueMicrotask(()=>{let _0=V0(X0),i=S.current,W0=typeof i==="function"?i(P.current||""):i;if(W0===void 0||W0===!1)return;let r;if(W0===!0||W0===null)r=_0[0]||X0;else r=e7(W0);if(r=r||_0[0]||X0,k0(X0,e))return;_4(r,{preventScroll:r===X0})})},[X,F,X0,D,V0,S,P]),$0(()=>{if(X||!X0)return;let Z0=u0(X0),e=b5(Z0);oI(e);function _0(r){if(!r.open)d.current=nI(r.nativeEvent,w.current);if(r.reason===n.triggerHover&&r.nativeEvent.type==="mouseleave")b.current=!0;if(r.reason!==n.outsidePress)return;if(r.nested)b.current=!1;else if(EJ(r.nativeEvent)||kJ(r.nativeEvent))b.current=!1;else{let o=!1;if(document.createElement("div").focus({get preventScroll(){return o=!0,!1}}),o)b.current=!1;else b.current=!0}}_.on("openchange",_0);let i=Z0.createElement("span");if(i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,P6),q0&&N)N.insertAdjacentElement("afterend",i);function W0(){let r=k.current,o=typeof r==="function"?r(d.current):r;if(o===void 0||o===!1)return null;if(o===null)o=!0;if(typeof o==="boolean"){let u=N||EG();return u&&u.isConnected?u:i}let f=N||EG()||i;return e7(o)||f}return()=>{_.off("openchange",_0);let r=b5(Z0),o=k0(L,r)||g&&j9(g.nodesRef.current,O(),!1).some((u)=>k0(u.context?.elements.floating,r)),f=W0();queueMicrotask(()=>{let u=tI(f),L0=typeof k.current!=="boolean";if(k.current&&!b.current&&u1(u)&&(!L0&&u!==r&&r!==Z0.body?o:!0))u.focus({preventScroll:!0});i.remove(),b.current=!1})}},[X,L,X0,k,M,_,g,q0,N,O]),$0(()=>{if(!jJ||F||!L)return;let Z0=b5(u0(L));if(!u1(Z0)||!V4(Z0))return;if(k0(L,Z0))Z0.blur()},[F,L]),$0(()=>{if(X||!C)return;return C.setFocusManagerState({modal:H,closeOnFocusOut:z,open:F,onOpenChange:B.setOpen,domReference:N}),()=>{C.setFocusManagerState(null)}},[X,C,H,F,B,z,N]),$0(()=>{if(X||!X0)return;return sV(X0,T),()=>{queueMicrotask(kG)}},[X,X0,T]);let p=!X&&(H?!A:!0)&&(q0||H);return A3.jsxs(A5.Fragment,{children:[p&&A3.jsx(v7,{"data-type":"inside",ref:E,onFocus:(Z0)=>{if(H){let e=V0();_4(e[e.length-1])}else if(C?.portalNode)if(b.current=!1,o7(Z0,C.portalNode))O2(N)?.focus();else e7(q??C.beforeOutsideRef)?.focus()}}),$,p&&A3.jsx(v7,{"data-type":"inside",ref:s,onFocus:(Z0)=>{if(H)_4(V0()[0]);else if(C?.portalNode){if(z)b.current=!0;if(o7(Z0,C.portalNode))mJ(N)?.focus();else e7(K??C.afterOutsideRef)?.focus()}}})]})}var M3=j(m(),1);function $2(Z,J={}){let $="rootStore"in Z?Z.rootStore:Z,X=$.context.dataRef,{enabled:Q=!0,event:Y="click",toggle:G=!0,ignoreMouse:H=!1,stickIfOpen:z=!0,touchOpenDelay:W=0,reason:K=n.triggerPress}=J,q=M3.useRef(void 0),V=h7(),U=X5(),B=M3.useMemo(()=>({onPointerDown(F){q.current=F.pointerType},onMouseDown(F){let N=q.current,L=F.nativeEvent,_=$.select("open");if(F.button!==0||Y==="click"||x7(N,!0)&&H)return;let M=X.current.openEvent,O=M?.type,D=$.select("domReferenceElement")!==F.currentTarget,A=_&&D||!(_&&G&&(M&&z?O==="click"||O==="mousedown":!0));if(V4(L.target)){let S=N0(K,L,L.target);if(A&&N==="touch"&&W>0)U.start(W,()=>{$.setOpen(!0,S)});else $.setOpen(A,S);return}let T=F.currentTarget;V.request(()=>{let S=N0(K,L,T);if(A&&N==="touch"&&W>0)U.start(W,()=>{$.setOpen(!0,S)});else $.setOpen(A,S)})},onClick(F){if(Y==="mousedown-only")return;let N=q.current;if(Y==="mousedown"&&N){q.current=void 0;return}if(x7(N,!0)&&H)return;let L=$.select("open"),_=X.current.openEvent,M=$.select("domReferenceElement")!==F.currentTarget,O=L&&M||!(L&&G&&(_&&z?RJ(_):!0)),D=N0(K,F.nativeEvent,F.currentTarget);if(O&&N==="touch"&&W>0)U.start(W,()=>{$.setOpen(!0,D)});else $.setOpen(O,D)},onKeyDown(){q.current=void 0}}),[X,Y,H,$,z,G,V,U,W,K]);return M3.useMemo(()=>Q?{reference:B}:N1,[Q,B])}var X7=j(m(),1);function ZE(Z,J){let $=null,X=null,Q=!1;return{contextElement:Z||void 0,getBoundingClientRect(){let Y=Z?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},G=J.axis==="x"||J.axis==="both",H=J.axis==="y"||J.axis==="both",z=["mouseenter","mousemove"].includes(J.dataRef.current.openEvent?.type||"")&&J.pointerType!=="touch",W=Y.width,K=Y.height,q=Y.x,V=Y.y;if($==null&&J.x&&G)$=Y.x-J.x;if(X==null&&J.y&&H)X=Y.y-J.y;if(q-=$||0,V-=X||0,W=0,K=0,!Q||z)W=J.axis==="y"?Y.width:0,K=J.axis==="x"?Y.height:0,q=G&&J.x!=null?J.x:q,V=H&&J.y!=null?J.y:V;else if(Q&&!z)K=J.axis==="x"?Y.height:K,W=J.axis==="y"?Y.width:W;return Q=!0,{width:W,height:K,x:q,y:V,top:V,right:q+W,bottom:V+K,left:q}}}}function nV(Z){return Z!=null&&Z.clientX!=null}function RG(Z,J={}){let $="rootStore"in Z?Z.rootStore:Z,X=$.useState("open"),Q=$.useState("floatingElement"),Y=$.useState("domReferenceElement"),G=$.context.dataRef,{enabled:H=!0,axis:z="both"}=J,W=X7.useRef(!1),K=X7.useRef(null),[q,V]=X7.useState(),[U,B]=X7.useState([]),F=Y0((O,D,A)=>{if(W.current)return;if(G.current.openEvent&&!nV(G.current.openEvent))return;$.set("positionReference",ZE(A??Y,{x:O,y:D,axis:z,dataRef:G,pointerType:q}))}),N=Y0((O)=>{if(!X)F(O.clientX,O.clientY,O.currentTarget);else if(!K.current)B([])}),L=x7(q)?Q:X,_=X7.useCallback(()=>{if(!L||!H)return;let O=D7(Q);function D(A){let T=k1(A);if(!k0(Q,T))F(A.clientX,A.clientY);else O.removeEventListener("mousemove",D),K.current=null}if(!G.current.openEvent||nV(G.current.openEvent)){O.addEventListener("mousemove",D);let A=()=>{O.removeEventListener("mousemove",D),K.current=null};return K.current=A,A}$.set("positionReference",Y);return},[L,H,Q,G,Y,$,F]);X7.useEffect(()=>{return _()},[_,U]),X7.useEffect(()=>{if(H&&!Q)W.current=!1},[H,Q]),X7.useEffect(()=>{if(!H&&X)W.current=!0},[H,X]);let M=X7.useMemo(()=>{function O(D){V(D.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:N,onMouseEnter:N}},[N]);return X7.useMemo(()=>H?{reference:M,trigger:M}:{},[H,M])}var g7=j(m(),1);var JE={intentional:"onClick",sloppy:"onPointerDown"};function $E(Z){return{escapeKey:typeof Z==="boolean"?Z:Z?.escapeKey??!1,outsidePress:typeof Z==="boolean"?Z:Z?.outsidePress??!0}}function J9(Z,J={}){let $="rootStore"in Z?Z.rootStore:Z,X=$.useState("open"),Q=$.useState("floatingElement"),Y=$.useState("referenceElement"),G=$.useState("domReferenceElement"),{onOpenChange:H,dataRef:z}=$.context,{enabled:W=!0,escapeKey:K=!0,outsidePress:q=!0,outsidePressEvent:V="sloppy",referencePress:U=!1,referencePressEvent:B="sloppy",ancestorScroll:F=!1,bubbles:N,externalTree:L}=J,_=d5(L),M=Y0(typeof q==="function"?q:()=>!1),O=typeof q==="function"?M:q,D=g7.useRef(!1),{escapeKey:A,outsidePress:T}=$E(N),S=g7.useRef(null),k=X5(),P=X5(),g=Y0(()=>{P.clear(),z.current.insideReactTree=!1}),C=g7.useRef(!1),I=g7.useRef(""),y=Y0((p)=>{I.current=p.pointerType}),b=Y0(()=>{let p=I.current,Z0=p==="pen"||!p?"mouse":p,e=typeof V==="function"?V():V;if(typeof e==="string")return e;return e[Z0]}),R=Y0((p)=>{if(!X||!W||!K||p.key!=="Escape")return;if(C.current)return;let Z0=z.current.floatingContext?.nodeId,e=_?j9(_.nodesRef.current,Z0):[];if(!A){if(e.length>0){let W0=!0;if(e.forEach((r)=>{if(r.context?.open&&!r.context.dataRef.current.__escapeKeyBubbles)W0=!1}),!W0)return}}let _0=BV(p)?p.nativeEvent:p,i=N0(n.escapeKey,_0);if($.setOpen(!1,i),!A&&!i.isPropagationAllowed)p.stopPropagation()}),x=Y0((p)=>{let Z0=b();return Z0==="intentional"&&p.type!=="click"||Z0==="sloppy"&&p.type==="click"}),v=Y0(()=>{z.current.insideReactTree=!0,P.start(0,g)}),d=Y0((p,Z0=!1)=>{if(x(p)){g();return}if(z.current.insideReactTree){g();return}if(b()==="intentional"&&Z0)return;if(typeof O==="function"&&!O(p))return;let e=k1(p),_0=`[${O7("inert")}]`,i=u0($.select("floatingElement")).querySelectorAll(_0),W0=$.context.triggerElements;if(e&&(W0.hasElement(e)||W0.hasMatchingElement((L0)=>k0(L0,e))))return;let r=L1(e)?e:null;while(r&&!S6(r)){let L0=tJ(r);if(S6(L0)||!L1(L0))break;r=L0}if(i.length&&L1(e)&&!VV(e)&&!k0(e,$.select("floatingElement"))&&Array.from(i).every((L0)=>!k0(r,L0)))return;if(u1(e)&&!("touches"in p)){let L0=S6(e),M0=T6(e),h0=/auto|scroll/,l0=L0||h0.test(M0.overflowX),h=L0||h0.test(M0.overflowY),c=l0&&e.clientWidth>0&&e.scrollWidth>e.clientWidth,t=h&&e.clientHeight>0&&e.scrollHeight>e.clientHeight,U0=M0.direction==="rtl",C0=t&&(U0?p.offsetX<=e.offsetWidth-e.clientWidth:p.offsetX>e.clientWidth),m0=c&&p.offsetY>e.clientHeight;if(C0||m0)return}let o=z.current.floatingContext?.nodeId,f=_&&j9(_.nodesRef.current,o).some((L0)=>b7(p,L0.context?.elements.floating));if(b7(p,$.select("floatingElement"))||b7(p,$.select("domReferenceElement"))||f)return;let u=_?j9(_.nodesRef.current,o):[];if(u.length>0){let L0=!0;if(u.forEach((M0)=>{if(M0.context?.open&&!M0.context.dataRef.current.__outsidePressBubbles)L0=!1}),!L0)return}$.setOpen(!1,N0(n.outsidePress,p)),g()}),w=Y0((p)=>{if(b()!=="sloppy"||p.pointerType==="touch"||!$.select("open")||!W||b7(p,$.select("floatingElement"))||b7(p,$.select("domReferenceElement")))return;d(p)}),z0=Y0((p)=>{if(b()!=="sloppy"||!$.select("open")||!W||b7(p,$.select("floatingElement"))||b7(p,$.select("domReferenceElement")))return;let Z0=p.touches[0];if(Z0)S.current={startTime:Date.now(),startX:Z0.clientX,startY:Z0.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1000,()=>{if(S.current)S.current.dismissOnTouchEnd=!1,S.current.dismissOnMouseDown=!1})}),G0=Y0((p)=>{let Z0=k1(p);function e(){z0(p),Z0?.removeEventListener(p.type,e)}Z0?.addEventListener(p.type,e)}),E=Y0((p)=>{let Z0=D.current;if(D.current=!1,k.clear(),p.type==="mousedown"&&S.current&&!S.current.dismissOnMouseDown)return;let e=k1(p);function _0(){if(p.type==="pointerdown")w(p);else d(p,Z0);e?.removeEventListener(p.type,_0)}e?.addEventListener(p.type,_0)}),s=Y0((p)=>{if(b()!=="sloppy"||!S.current||b7(p,$.select("floatingElement"))||b7(p,$.select("domReferenceElement")))return;let Z0=p.touches[0];if(!Z0)return;let e=Math.abs(Z0.clientX-S.current.startX),_0=Math.abs(Z0.clientY-S.current.startY),i=Math.sqrt(e*e+_0*_0);if(i>5)S.current.dismissOnTouchEnd=!0;if(i>10)d(p),k.clear(),S.current=null}),A0=Y0((p)=>{let Z0=k1(p);function e(){s(p),Z0?.removeEventListener(p.type,e)}Z0?.addEventListener(p.type,e)}),l=Y0((p)=>{if(b()!=="sloppy"||!S.current||b7(p,$.select("floatingElement"))||b7(p,$.select("domReferenceElement")))return;if(S.current.dismissOnTouchEnd)d(p);k.clear(),S.current=null}),H0=Y0((p)=>{let Z0=k1(p);function e(){l(p),Z0?.removeEventListener(p.type,e)}Z0?.addEventListener(p.type,e)});g7.useEffect(()=>{if(!X||!W)return;z.current.__escapeKeyBubbles=A,z.current.__outsidePressBubbles=T;let p=new y5;function Z0(r){$.setOpen(!1,N0(n.none,r))}function e(){p.clear(),C.current=!0}function _0(){p.start(oV()?5:0,()=>{C.current=!1})}let i=u0(Q);if(i.addEventListener("pointerdown",y,!0),K)i.addEventListener("keydown",R),i.addEventListener("compositionstart",e),i.addEventListener("compositionend",_0);if(O)i.addEventListener("click",E,!0),i.addEventListener("pointerdown",E,!0),i.addEventListener("touchstart",G0,!0),i.addEventListener("touchmove",A0,!0),i.addEventListener("touchend",H0,!0),i.addEventListener("mousedown",E,!0);let W0=[];if(F){if(L1(G))W0=D3(G);if(L1(Q))W0=W0.concat(D3(Q));if(!L1(Y)&&Y&&Y.contextElement)W0=W0.concat(D3(Y.contextElement))}return W0=W0.filter((r)=>r!==i.defaultView?.visualViewport),W0.forEach((r)=>{r.addEventListener("scroll",Z0,{passive:!0})}),()=>{if(i.removeEventListener("pointerdown",y,!0),K)i.removeEventListener("keydown",R),i.removeEventListener("compositionstart",e),i.removeEventListener("compositionend",_0);if(O)i.removeEventListener("click",E,!0),i.removeEventListener("pointerdown",E,!0),i.removeEventListener("touchstart",G0,!0),i.removeEventListener("touchmove",A0,!0),i.removeEventListener("touchend",H0,!0),i.removeEventListener("mousedown",E,!0);W0.forEach((r)=>{r.removeEventListener("scroll",Z0)}),p.clear(),D.current=!1}},[z,Q,Y,G,K,O,X,H,F,W,A,T,R,d,E,w,G0,A0,H0,y,$]),g7.useEffect(g,[O,g]);let q0=g7.useMemo(()=>({onKeyDown:R,...U&&{[JE[B]]:(p)=>{$.setOpen(!1,N0(n.triggerPress,p.nativeEvent))},...B!=="intentional"&&{onClick(p){$.setOpen(!1,N0(n.triggerPress,p.nativeEvent))}}}}),[R,$,U,B]),X0=Y0((p)=>{let Z0=k1(p.nativeEvent);if(!k0($.select("floatingElement"),Z0)||p.button!==0)return;D.current=!0}),Q0=Y0((p)=>{if(!X||!W||p.button!==0)return;D.current=!0}),V0=g7.useMemo(()=>({onKeyDown:R,onPointerDown:X0,onMouseDown:X0,onMouseUp:X0,onClickCapture:v,onMouseDownCapture(p){v(),Q0(p)},onPointerDownCapture(p){v(),Q0(p)},onMouseUpCapture:v,onTouchEndCapture:v,onTouchMoveCapture:v}),[R,X0,v,Q0]);return g7.useMemo(()=>W?{reference:q0,floating:V0,trigger:q0}:{},[W,q0,V0])}var Y7=j(m(),1);var Z$=Symbol("NOT_FOUND");function XE(Z,J=`expected a function, instead received ${typeof Z}`){if(typeof Z!=="function")throw TypeError(J)}function QE(Z,J=`expected an object, instead received ${typeof Z}`){if(typeof Z!=="object")throw TypeError(J)}function YE(Z,J="expected all items to be functions, instead received the following types: "){if(!Z.every(($)=>typeof $==="function")){let $=Z.map((X)=>typeof X==="function"?`function ${X.name||"unnamed"}()`:typeof X).join(", ");throw TypeError(`${J}[${$}]`)}}var tV=(Z)=>{return Array.isArray(Z)?Z:[Z]};function GE(Z){let J=Array.isArray(Z[0])?Z[0]:Z;return YE(J,"createSelector expects all input-selectors to be functions, but received the following types: "),J}function HE(Z,J){let $=[],{length:X}=Z;for(let Q=0;Q<X;Q++)$.push(Z[Q].apply(null,J));return $}var eV=0,zE=null,JU=class{revision=eV;_value;_lastValue;_isEqual=yG;constructor(Z,J=yG){this._value=this._lastValue=Z,this._isEqual=J}get value(){return zE?.add(this),this._value}set value(Z){if(this.value===Z)return;this._value=Z,this.revision=++eV}};function yG(Z,J){return Z===J}function bG(Z){if(!(Z instanceof JU))console.warn("Not a valid cell! ",Z);return Z.value}function WE(Z,J=yG){return new JU(Z,J)}var KE=(Z,J)=>!1;function J$(){return WE(null,KE)}var $U=(Z)=>{let J=Z.collectionTag;if(J===null)J=Z.collectionTag=J$();bG(J)};var kn=Symbol(),XU=0,qE=Object.getPrototypeOf({}),VE=class{constructor(Z){this.value=Z,this.value=Z,this.tag.value=Z}proxy=new Proxy(this,O3);tag=J$();tags={};children={};collectionTag=null;id=XU++},O3={get(Z,J){function $(){let{value:Q}=Z,Y=Reflect.get(Q,J);if(typeof J==="symbol")return Y;if(J in qE)return Y;if(typeof Y==="object"&&Y!==null){let G=Z.children[J];if(G===void 0)G=Z.children[J]=FE(Y);if(G.tag)bG(G.tag);return G.proxy}else{let G=Z.tags[J];if(G===void 0)G=Z.tags[J]=J$(),G.value=Y;return bG(G),Y}}return $()},ownKeys(Z){return $U(Z),Reflect.ownKeys(Z.value)},getOwnPropertyDescriptor(Z,J){return Reflect.getOwnPropertyDescriptor(Z.value,J)},has(Z,J){return Reflect.has(Z.value,J)}},UE=class{constructor(Z){this.value=Z,this.value=Z,this.tag.value=Z}proxy=new Proxy([this],BE);tag=J$();tags={};children={};collectionTag=null;id=XU++},BE={get([Z],J){if(J==="length")$U(Z);return O3.get(Z,J)},ownKeys([Z]){return O3.ownKeys(Z)},getOwnPropertyDescriptor([Z],J){return O3.getOwnPropertyDescriptor(Z,J)},has([Z],J){return O3.has(Z,J)}};function FE(Z){if(Array.isArray(Z))return new UE(Z);return new VE(Z)}function LE(Z){let J;return{get($){if(J&&Z(J.key,$))return J.value;return Z$},put($,X){J={key:$,value:X}},getEntries(){return J?[J]:[]},clear(){J=void 0}}}function NE(Z,J){let $=[];function X(H){let z=$.findIndex((W)=>J(H,W.key));if(z>-1){let W=$[z];if(z>0)$.splice(z,1),$.unshift(W);return W.value}return Z$}function Q(H,z){if(X(H)===Z$){if($.unshift({key:H,value:z}),$.length>Z)$.pop()}}function Y(){return $}function G(){$=[]}return{get:X,put:Q,getEntries:Y,clear:G}}var _E=(Z,J)=>Z===J;function AE(Z){return function($,X){if($===null||X===null||$.length!==X.length)return!1;let{length:Q}=$;for(let Y=0;Y<Q;Y++)if(!Z($[Y],X[Y]))return!1;return!0}}function QU(Z,J){let $=typeof J==="object"?J:{equalityCheck:J},{equalityCheck:X=_E,maxSize:Q=1,resultEqualityCheck:Y}=$,G=AE(X),H=0,z=Q<=1?LE(G):NE(Q,G);function W(){let K=z.get(arguments);if(K===Z$){if(K=Z.apply(null,arguments),H++,Y){let V=z.getEntries().find((U)=>Y(U.value,K));if(V)K=V.value,H!==0&&H--}z.put(arguments,K)}return K}return W.clearCache=()=>{z.clear(),W.resetResultsCount()},W.resultsCount=()=>H,W.resetResultsCount=()=>{H=0},W}var ME=class{constructor(Z){this.value=Z}deref(){return this.value}},DE=typeof WeakRef<"u"?WeakRef:ME,OE=0,ZU=1;function eJ(){return{s:OE,v:void 0,o:null,p:null}}function YU(Z,J={}){let $=eJ(),{resultEqualityCheck:X}=J,Q,Y=0;function G(){let H=$,{length:z}=arguments;for(let q=0,V=z;q<V;q++){let U=arguments[q];if(typeof U==="function"||typeof U==="object"&&U!==null){let B=H.o;if(B===null)H.o=B=new WeakMap;let F=B.get(U);if(F===void 0)H=eJ(),B.set(U,H);else H=F}else{let B=H.p;if(B===null)H.p=B=new Map;let F=B.get(U);if(F===void 0)H=eJ(),B.set(U,H);else H=F}}let W=H,K;if(H.s===ZU)K=H.v;else if(K=Z.apply(null,arguments),Y++,X){let q=Q?.deref?.()??Q;if(q!=null&&X(q,K))K=q,Y!==0&&Y--;Q=typeof K==="object"&&K!==null||typeof K==="function"?new DE(K):K}return W.s=ZU,W.v=K,K}return G.clearCache=()=>{$=eJ(),G.resetResultsCount()},G.resultsCount=()=>Y,G.resetResultsCount=()=>{Y=0},G}function xG(Z,...J){let $=typeof Z==="function"?{memoize:Z,memoizeOptions:J}:Z,X=(...Q)=>{let Y=0,G=0,H,z={},W=Q.pop();if(typeof W==="object")z=W,W=Q.pop();XE(W,`createSelector expects an output function after the inputs, but received: [${typeof W}]`);let K={...$,...z},{memoize:q,memoizeOptions:V=[],argsMemoize:U=YU,argsMemoizeOptions:B=[],devModeChecks:F={}}=K,N=tV(V),L=tV(B),_=GE(Q),M=q(function(){return Y++,W.apply(null,arguments)},...N),O=!0,D=U(function(){G++;let T=HE(_,arguments);return H=M.apply(null,T),H},...L);return Object.assign(D,{resultFunc:W,memoizedResultFunc:M,dependencies:_,dependencyRecomputations:()=>G,resetDependencyRecomputations:()=>{G=0},lastResult:()=>H,recomputations:()=>Y,resetRecomputations:()=>{Y=0},memoize:q,argsMemoize:U})};return Object.assign(X,{withTypes:()=>X}),X}var wE=xG(YU),PE=Object.assign((Z,J=wE)=>{QE(Z,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof Z}`);let $=Object.keys(Z),X=$.map((Y)=>Z[Y]);return J(X,(...Y)=>{return Y.reduce((G,H,z)=>{return G[$[z]]=H,G},{})})},{withTypes:()=>PE});var mn=xG({memoize:QU,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),P0=(Z,J,$,X,Q,Y,...G)=>{if(G.length>0)throw Error(w0(1));let H;if(Z&&J&&$&&X&&Q&&Y)H=(z,W,K,q)=>{let V=Z(z,W,K,q),U=J(z,W,K,q),B=$(z,W,K,q),F=X(z,W,K,q),N=Q(z,W,K,q);return Y(V,U,B,F,N,W,K,q)};else if(Z&&J&&$&&X&&Q)H=(z,W,K,q)=>{let V=Z(z,W,K,q),U=J(z,W,K,q),B=$(z,W,K,q),F=X(z,W,K,q);return Q(V,U,B,F,W,K,q)};else if(Z&&J&&$&&X)H=(z,W,K,q)=>{let V=Z(z,W,K,q),U=J(z,W,K,q),B=$(z,W,K,q);return X(V,U,B,W,K,q)};else if(Z&&J&&$)H=(z,W,K,q)=>{let V=Z(z,W,K,q),U=J(z,W,K,q);return $(V,U,W,K,q)};else if(Z&&J)H=(z,W,K,q)=>{let V=Z(z,W,K,q);return J(V,W,K,q)};else if(Z)H=Z;else throw Error("Missing arguments");return H};var KU=j(m(),1),mG=j(GU(),1);var j2=j(m(),1),jE=GU();function TE(Z,J){return Z===J&&(Z!==0||1/Z===1/J)||Z!==Z&&J!==J}var CE=typeof Object.is==="function"?Object.is:TE,SE=jE.useSyncExternalStore,IE=j2.useRef,EE=j2.useEffect,kE=j2.useMemo,RE=j2.useDebugValue;var hG=function(Z,J,$,X,Q){var Y=IE(null);if(Y.current===null){var G={hasValue:!1,value:null};Y.current=G}else G=Y.current;Y=kE(function(){function z(U){if(!W){if(W=!0,K=U,U=X(U),Q!==void 0&&G.hasValue){var B=G.value;if(Q(B,U))return q=B}return q=U}if(B=q,CE(K,U))return B;var F=X(U);if(Q!==void 0&&Q(B,F))return K=U,B;return K=U,q=F}var W=!1,K,q,V=$===void 0?null:$;return[function(){return z(J())},V===null?void 0:function(){return z(V())}]},[J,$,X,Q]);var H=SE(Z,Y[0],Y[1]);return EE(function(){G.hasValue=!0,G.value=H},[H]),RE(H),H};var HU=j(m(),1);var vG=[],gG=void 0;function zU(){return gG}function WU(Z){vG.push(Z)}function w3(Z){let J=($,X)=>{let Q=K1(yE).current,Y;try{gG=Q;for(let G of vG)G.before(Q);Y=Z($,X);for(let G of vG)G.after(Q);Q.didInitialize=!0}finally{gG=void 0}return Y};return J.displayName=Z.displayName||Z.name,J}function $$(Z){return HU.forwardRef(w3(Z))}function yE(){return{didInitialize:!1}}var bE=X$(19),xE=bE?vE:gE;function Q$(Z,J,$,X,Q){return xE(Z,J,$,X,Q)}function hE(Z,J,$,X,Q){let Y=KU.useCallback(()=>J(Z.getSnapshot(),$,X,Q),[Z,J,$,X,Q]);return mG.useSyncExternalStore(Z.subscribe,Y,Y)}WU({before(Z){if(Z.syncIndex=0,!Z.didInitialize)Z.syncTick=1,Z.syncHooks=[],Z.didChangeStore=!0,Z.getSnapshot=()=>{let J=!1;for(let $=0;$<Z.syncHooks.length;$+=1){let X=Z.syncHooks[$],Q=X.selector(X.store.state,X.a1,X.a2,X.a3);if(X.didChange||!Object.is(X.value,Q))J=!0,X.value=Q,X.didChange=!1}if(J)Z.syncTick+=1;return Z.syncTick}},after(Z){if(Z.syncHooks.length>0){if(Z.didChangeStore)Z.didChangeStore=!1,Z.subscribe=(J)=>{let $=new Set;for(let Q of Z.syncHooks)$.add(Q.store);let X=[];for(let Q of $)X.push(Q.subscribe(J));return()=>{for(let Q of X)Q()}};mG.useSyncExternalStore(Z.subscribe,Z.getSnapshot,Z.getSnapshot)}}});function vE(Z,J,$,X,Q){let Y=zU();if(!Y)return hE(Z,J,$,X,Q);let G=Y.syncIndex;Y.syncIndex+=1;let H;if(!Y.didInitialize)H={store:Z,selector:J,a1:$,a2:X,a3:Q,value:J(Z.getSnapshot(),$,X,Q),didChange:!1},Y.syncHooks.push(H);else if(H=Y.syncHooks[G],H.store!==Z||H.selector!==J||!Object.is(H.a1,$)||!Object.is(H.a2,X)||!Object.is(H.a3,Q)){if(H.store!==Z)Y.didChangeStore=!0;H.store=Z,H.selector=J,H.a1=$,H.a2=X,H.a3=Q,H.didChange=!0}return H.value}function gE(Z,J,$,X,Q){return hG(Z.subscribe,Z.getSnapshot,Z.getSnapshot,(Y)=>J(Y,$,X,Q))}class fG{constructor(Z){this.state=Z,this.listeners=new Set,this.updateTick=0}subscribe=(Z)=>{return this.listeners.add(Z),()=>{this.listeners.delete(Z)}};getSnapshot=()=>{return this.state};setState(Z){if(this.state===Z)return;this.state=Z,this.updateTick+=1;let J=this.updateTick;for(let $ of this.listeners){if(J!==this.updateTick)return;$(Z)}}update(Z){for(let J in Z)if(!Object.is(this.state[J],Z[J])){this.setState({...this.state,...Z});return}}set(Z,J){if(!Object.is(this.state[Z],J))this.setState({...this.state,[Z]:J})}notifyAll(){let Z={...this.state};this.setState(Z)}use(Z,J,$,X){return Q$(this,Z,J,$,X)}}var O4=j(m(),1);class P7 extends fG{constructor(Z,J={},$){super(Z);this.context=J,this.selectors=$}useSyncedValue(Z,J){O4.useDebugValue(Z),$0(()=>{if(this.state[Z]!==J)this.set(Z,J)},[Z,J])}useSyncedValueWithCleanup(Z,J){let $=this;$0(()=>{if($.state[Z]!==J)$.set(Z,J);return()=>{$.set(Z,void 0)}},[$,Z,J])}useSyncedValues(Z){let J=this,$=Object.values(Z);$0(()=>{J.update(Z)},[J,...$])}useControlledProp(Z,J){O4.useDebugValue(Z);let $=J!==void 0;$0(()=>{if($&&!Object.is(this.state[Z],J))super.setState({...this.state,[Z]:J})},[Z,J,$])}select(Z,J,$,X){let Q=this.selectors[Z];return Q(this.state,J,$,X)}useState(Z,J,$,X){return O4.useDebugValue(Z),Q$(this,this.selectors[Z],J,$,X)}useContextCallback(Z,J){O4.useDebugValue(Z);let $=Y0(J??P1);this.context[Z]=$}useStateSetter(Z){let J=O4.useRef(void 0);if(J.current===void 0)J.current=($)=>{this.set(Z,$)};return J.current}observe(Z,J){let $;if(typeof Z==="function")$=Z;else $=this.selectors[Z];let X=$(this.state);return J(X,X,this),this.subscribe((Q)=>{let Y=$(Q);if(!Object.is(X,Y)){let G=X;X=Y,J(Y,G,this)}})}}var mE={open:P0((Z)=>Z.open),domReferenceElement:P0((Z)=>Z.domReferenceElement),referenceElement:P0((Z)=>Z.positionReference??Z.referenceElement),floatingElement:P0((Z)=>Z.floatingElement),floatingId:P0((Z)=>Z.floatingId)};class w4 extends P7{constructor(Z){let{nested:J,noEmit:$,onOpenChange:X,triggerElements:Q,...Y}=Z;super({...Y,positionReference:Y.referenceElement,domReferenceElement:Y.referenceElement},{onOpenChange:X,dataRef:{current:{}},events:cJ(),nested:J,noEmit:$,triggerElements:Q},mE)}setOpen=(Z,J)=>{if(!Z||!this.state.open||RJ(J.event))this.context.dataRef.current.openEvent=Z?J.event:void 0;if(!this.context.noEmit){let $={open:Z,reason:J.reason,nativeEvent:J.event,nested:this.context.nested,triggerElement:J.trigger};this.context.events.emit("openchange",$)}this.context.onOpenChange?.(Z,J)}}var j3=j(m(),1);var P3=j(m(),1);function m7(Z,J=!1,$=!1){let[X,Q]=P3.useState(Z&&J?"idle":void 0),[Y,G]=P3.useState(Z);if(Z&&!Y)G(!0),Q("starting");if(!Z&&Y&&X!=="ending"&&!$)Q("ending");if(!Z&&!Y&&X==="ending")Q(void 0);return $0(()=>{if(!Z&&Y&&X!=="ending"&&$){let H=h1.request(()=>{Q("ending")});return()=>{h1.cancel(H)}}return},[Z,Y,X,$]),$0(()=>{if(!Z||J)return;let H=h1.request(()=>{Q(void 0)});return()=>{h1.cancel(H)}},[J,Z]),$0(()=>{if(!Z||!J)return;if(Z&&Y&&X!=="idle")Q("starting");let H=h1.request(()=>{Q("idle")});return()=>{h1.cancel(H)}},[J,Z,Y,Q,X]),P3.useMemo(()=>({mounted:Y,setMounted:G,transitionStatus:X}),[Y,X])}var VU=j(m(),1);var qU=j(w7(),1);var T9=function(Z){return Z.startingStyle="data-starting-style",Z.endingStyle="data-ending-style",Z}({}),fE={[T9.startingStyle]:""},pE={[T9.endingStyle]:""},j1={transitionStatus(Z){if(Z==="starting")return fE;if(Z==="ending")return pE;return null}};function C9(Z,J=!1,$=!0){let X=h7();return Y0((Q,Y=null)=>{X.cancel();function G(){qU.flushSync(Q)}let H=e7(Z);if(H==null)return;let z=H;if(typeof z.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)Q();else{let W=function(){let q=T9.startingStyle;if(!z.hasAttribute(q)){X.request(K);return}let V=new MutationObserver(()=>{if(!z.hasAttribute(q))V.disconnect(),K()});V.observe(z,{attributes:!0,attributeFilter:[q]}),Y?.addEventListener("abort",()=>V.disconnect(),{once:!0})},K=function(){Promise.all(z.getAnimations().map((q)=>q.finished)).then(()=>{if(Y?.aborted)return;G()}).catch(()=>{let q=z.getAnimations();if($){if(Y?.aborted)return;G()}else if(q.length>0&&q.some((V)=>V.pending||V.playState!=="finished"))K()})};if(J){W();return}X.request(K)}})}function B5(Z){let{enabled:J=!0,open:$,ref:X,onComplete:Q}=Z,Y=Y0(Q),G=C9(X,$,!1);VU.useEffect(()=>{if(!J)return;let H=new AbortController;return G(Y,H.signal),()=>{H.abort()}},[J,$,Y,G])}function pG(Z,J){let $=j3.useRef(null),X=j3.useRef(null);return j3.useCallback((Q)=>{if(Z===void 0)return;if($.current!==null){let Y=$.current,G=X.current,H=J.context.triggerElements.getById(Y);if(G&&H===G)J.context.triggerElements.delete(Y);$.current=null,X.current=null}if(Q!==null)$.current=Z,X.current=Q,J.context.triggerElements.add(Z,Q)},[J,Z])}function S9(Z,J,$,X){let Q=$.useState("isMountedByTrigger",Z),Y=pG(Z,$),G=Y0((H)=>{if(Y(H),!H||!$.select("open"))return;let z=$.select("activeTriggerId");if(z===Z){$.update({activeTriggerElement:H,...X});return}if(z==null)$.update({activeTriggerId:Z,activeTriggerElement:H,...X})});return $0(()=>{if(Q)$.update({activeTriggerElement:J.current,...X})},[Q,$,J,...Object.values(X)]),{registerTrigger:G,isMountedByThisTrigger:Q}}function I9(Z){let J=Z.useState("open");$0(()=>{if(J&&!Z.select("activeTriggerId")&&Z.context.triggerElements.size===1){let $=Z.context.triggerElements.entries().next();if(!$.done){let[X,Q]=$.value;Z.update({activeTriggerId:X,activeTriggerElement:Q})}}},[J,Z])}function E9(Z,J,$){let{mounted:X,setMounted:Q,transitionStatus:Y}=m7(Z);J.useSyncedValues({mounted:X,transitionStatus:Y});let G=Y0(()=>{Q(!1),J.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),$?.(),J.context.onOpenChangeComplete?.(!1)}),H=J.useState("preventUnmountingOnClose");return B5({enabled:!H,open:Z,ref:J.context.popupRef,onComplete(){if(!Z)G()}}),{forceUnmount:G,transitionStatus:Y}}class Q7{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(Z,J){let $=this.idMap.get(Z);if($===J)return;if($!==void 0)this.elementsSet.delete($);this.elementsSet.add(J),this.idMap.set(Z,J)}delete(Z){let J=this.idMap.get(Z);if(J)this.elementsSet.delete(J),this.idMap.delete(Z)}hasElement(Z){return this.elementsSet.has(Z)}hasMatchingElement(Z){for(let J of this.elementsSet)if(Z(J))return!0;return!1}getById(Z){return this.idMap.get(Z)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function UU(){return new w4({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Q7,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function k9(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:UU(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:N1,inactiveTriggerProps:N1,popupProps:N1}}var Y$=P0((Z)=>Z.triggerIdProp??Z.activeTriggerId),R9={open:P0((Z)=>Z.openProp??Z.open),mounted:P0((Z)=>Z.mounted),transitionStatus:P0((Z)=>Z.transitionStatus),floatingRootContext:P0((Z)=>Z.floatingRootContext),preventUnmountingOnClose:P0((Z)=>Z.preventUnmountingOnClose),payload:P0((Z)=>Z.payload),activeTriggerId:Y$,activeTriggerElement:P0((Z)=>Z.mounted?Z.activeTriggerElement:null),isTriggerActive:P0((Z,J)=>J!==void 0&&Y$(Z)===J),isOpenedByTrigger:P0((Z,J)=>J!==void 0&&Y$(Z)===J&&Z.open),isMountedByTrigger:P0((Z,J)=>J!==void 0&&Y$(Z)===J&&Z.mounted),triggerProps:P0((Z,J)=>J?Z.activeTriggerProps:Z.inactiveTriggerProps),popupProps:P0((Z)=>Z.popupProps),popupElement:P0((Z)=>Z.popupElement),positionerElement:P0((Z)=>Z.positionerElement)};function BU(Z){let{open:J=!1,onOpenChange:$,elements:X={}}=Z,Q=q7(),Y=_5()!=null,G=K1(()=>new w4({open:J,onOpenChange:$,referenceElement:X.reference??null,floatingElement:X.floating??null,triggerElements:new Q7,floatingId:Q,nested:Y,noEmit:!1})).current;return $0(()=>{let H={open:J,floatingId:Q};if(X.reference!==void 0)H.referenceElement=X.reference,H.domReferenceElement=L1(X.reference)?X.reference:null;if(X.floating!==void 0)H.floatingElement=X.floating;G.update(H)},[J,Q,X.reference,X.floating,G]),G.context.onOpenChange=$,G.context.nested=Y,G.context.noEmit=!1,G}function uG(Z={}){let{nodeId:J,externalTree:$}=Z,X=BU(Z),Q=Z.rootContext||X,Y={reference:Q.useState("referenceElement"),floating:Q.useState("floatingElement"),domReference:Q.useState("domReferenceElement")},[G,H]=Y7.useState(null),z=Y7.useRef(null),W=d5($);$0(()=>{if(Y.domReference)z.current=Y.domReference},[Y.domReference]);let K=FU({...Z,elements:{...Y,...G&&{reference:G}}}),q=Y7.useCallback((T)=>{let S=L1(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;H(S),K.refs.setReference(S)},[K.refs]),[V,U]=Y7.useState(null),[B,F]=Y7.useState(null);Q.useSyncedValue("referenceElement",V),Q.useSyncedValue("domReferenceElement",L1(V)?V:null),Q.useSyncedValue("floatingElement",B);let N=Y7.useCallback((T)=>{if(L1(T)||T===null)z.current=T,U(T);if(L1(K.refs.reference.current)||K.refs.reference.current===null||T!==null&&!L1(T))K.refs.setReference(T)},[K.refs,U]),L=Y7.useCallback((T)=>{F(T),K.refs.setFloating(T)},[K.refs]),_=Y7.useMemo(()=>({...K.refs,setReference:N,setFloating:L,setPositionReference:q,domReference:z}),[K.refs,N,L,q]),M=Y7.useMemo(()=>({...K.elements,domReference:Y.domReference}),[K.elements,Y.domReference]),O=Q.useState("open"),D=Q.useState("floatingId"),A=Y7.useMemo(()=>({...K,dataRef:Q.context.dataRef,open:O,onOpenChange:Q.setOpen,events:Q.context.events,floatingId:D,refs:_,elements:M,nodeId:J,rootStore:Q}),[K,_,M,J,Q,O,D]);return $0(()=>{Q.context.dataRef.current.floatingContext=A;let T=W?.nodesRef.current.find((S)=>S.id===J);if(T)T.context=A}),Y7.useMemo(()=>({...K,context:A,refs:_,elements:M,rootStore:Q}),[K,_,M,A,Q])}function $9(Z){let{popupStore:J,noEmit:$=!1,treatPopupAsFloatingElement:X=!1,onOpenChange:Q}=Z,Y=q7(),G=_5()!=null,H=J.useState("open"),z=J.useState("activeTriggerElement"),W=J.useState(X?"popupElement":"positionerElement"),K=J.context.triggerElements,q=K1(()=>new w4({open:H,referenceElement:z,floatingElement:W,triggerElements:K,onOpenChange:Q,floatingId:Y,nested:G,noEmit:$})).current;return $0(()=>{let V={open:H,floatingId:Y,referenceElement:z,floatingElement:W};if(L1(z))V.domReferenceElement=z;if(q.state.positionReference===q.state.referenceElement)V.positionReference=z;q.update(V)},[H,Y,z,W,q]),q.context.onOpenChange=Q,q.context.nested=G,q.context.noEmit=$,q}var y9=j(m(),1);var cG=KV&&CJ;function P4(Z,J={}){let $="rootStore"in Z?Z.rootStore:Z,{events:X,dataRef:Q}=$.context,{enabled:Y=!0,delay:G}=J,H=y9.useRef(!1),z=y9.useRef(null),W=X5(),K=y9.useRef(!0);y9.useEffect(()=>{let V=$.select("domReferenceElement");if(!Y)return;let U=D7(V);function B(){let L=$.select("domReferenceElement");if(!$.select("open")&&u1(L)&&L===b5(u0(L)))H.current=!0}function F(){K.current=!0}function N(){K.current=!1}if(U.addEventListener("blur",B),cG)U.addEventListener("keydown",F,!0),U.addEventListener("pointerdown",N,!0);return()=>{if(U.removeEventListener("blur",B),cG)U.removeEventListener("keydown",F,!0),U.removeEventListener("pointerdown",N,!0)}},[$,Y]),y9.useEffect(()=>{if(!Y)return;function V(U){if(U.reason===n.triggerPress||U.reason===n.escapeKey){let B=$.select("domReferenceElement");if(L1(B))z.current=B,H.current=!0}}return X.on("openchange",V),()=>{X.off("openchange",V)}},[X,Y,$]);let q=y9.useMemo(()=>({onMouseLeave(){H.current=!1,z.current=null},onFocus(V){let U=V.currentTarget;if(H.current){if(z.current===U)return;H.current=!1,z.current=null}let B=k1(V.nativeEvent);if(L1(B)){if(cG&&!V.relatedTarget){if(!K.current&&!V4(B))return}else if(!UV(B))return}let F=q4(V.relatedTarget,$.context.triggerElements),{nativeEvent:N,currentTarget:L}=V,_=typeof G==="function"?G():G;if($.select("open")&&F||_===0||_===void 0){$.setOpen(!0,N0(n.triggerFocus,N,L));return}W.start(_,()=>{if(H.current)return;$.setOpen(!0,N0(n.triggerFocus,N,L))})},onBlur(V){H.current=!1,z.current=null;let{relatedTarget:U,nativeEvent:B}=V,F=L1(U)&&U.hasAttribute(O7("focus-guard"))&&U.getAttribute("data-type")==="outside";W.start(0,()=>{let N=$.select("domReferenceElement"),L=b5(N?N.ownerDocument:document);if(!U&&L===N)return;if(k0(Q.current.floatingContext?.refs.floating.current,L)||k0(N,L)||F)return;if(q4(U??L,$.context.triggerElements))return;$.setOpen(!1,N0(n.triggerFocus,B))})}}),[Q,$,W,G]);return y9.useMemo(()=>Y?{reference:q,trigger:q}:{},[Y,q])}var I6=j(m(),1);var T3=O7("safe-polygon"),uE=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${A6}`;function LU(Z){return Z?Boolean(Z.closest(uE)):!1}class dG{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 y5,this.restTimeout=new y5,this.handleCloseOptions=void 0}static create(){return new dG}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}function G$(Z){let J=K1(dG.create).current,$=Z.context.dataRef.current;if(!$.hoverInteractionState)$.hoverInteractionState=J;return O9($.hoverInteractionState.disposeEffect),$.hoverInteractionState}var cE=new Set(["click","mousedown"]);function X2(Z,J={}){let $="rootStore"in Z?Z.rootStore:Z,X=$.useState("open"),Q=$.useState("floatingElement"),Y=$.useState("domReferenceElement"),{dataRef:G}=$.context,{enabled:H=!0,closeDelay:z=0}=J,W=G$($),K=d5(),q=_5(),V=Y0(()=>{if(W.interactedInside)return!0;return G.current.openEvent?cE.has(G.current.openEvent.type):!1}),U=Y0(()=>{let M=G.current.openEvent?.type;return M?.includes("mouse")&&M!=="mousedown"}),B=Y0((M)=>{return q4(M,$.context.triggerElements)}),F=I6.useCallback((M,O=!0)=>{let D=dE(z,W.pointerType);if(D&&!W.handler)W.openChangeTimeout.start(D,()=>$.setOpen(!1,N0(n.triggerHover,M)));else if(O)W.openChangeTimeout.clear(),$.setOpen(!1,N0(n.triggerHover,M))},[z,$,W]),N=Y0(()=>{W.unbindMouseMove(),W.handler=void 0}),L=Y0(()=>{if(W.performedPointerEventsMutation){let M=u0(Q).body;M.style.pointerEvents="",M.removeAttribute(T3),W.performedPointerEventsMutation=!1}}),_=Y0((M)=>{let O=k1(M);if(!LU(O)){W.interactedInside=!1;return}W.interactedInside=!0});$0(()=>{if(!X)W.pointerType=void 0,W.restTimeoutPending=!1,W.interactedInside=!1,N(),L()},[X,W,N,L]),I6.useEffect(()=>{return()=>{N()}},[N]),I6.useEffect(()=>{return L},[L]),$0(()=>{if(!H)return;if(X&&W.handleCloseOptions?.blockPointerEvents&&U()&&L1(Y)&&Q){W.performedPointerEventsMutation=!0;let M=u0(Q).body;M.setAttribute(T3,"");let O=Y,D=Q,A=K?.nodesRef.current.find((T)=>T.id===q)?.context?.elements.floating;if(A)A.style.pointerEvents="";return M.style.pointerEvents="none",O.style.pointerEvents="auto",D.style.pointerEvents="auto",()=>{M.style.pointerEvents="",O.style.pointerEvents="",D.style.pointerEvents=""}}return},[H,X,Y,Q,W,U,K,q]),I6.useEffect(()=>{if(!H)return;function M(T){if(V()||!G.current.floatingContext||!$.select("open"))return;if(B(T.relatedTarget))return;if(L(),N(),!V())F(T)}function O(T){W.openChangeTimeout.clear(),L(),W.handler?.(T),N()}function D(T){if(!V())F(T,!1)}let A=Q;if(A)A.addEventListener("mouseleave",M),A.addEventListener("mouseenter",O),A.addEventListener("mouseleave",D),A.addEventListener("pointerdown",_,!0);return()=>{if(A)A.removeEventListener("mouseleave",M),A.removeEventListener("mouseenter",O),A.removeEventListener("mouseleave",D),A.removeEventListener("pointerdown",_,!0)}},[H,Q,$,G,V,B,F,L,N,_,W])}function dE(Z,J){if(J&&!x7(J))return 0;if(typeof Z==="function")return Z();return Z}var j4=j(m(),1),NU=j(w7(),1);function lG(Z){if(typeof Z==="function")return Z();return Z}var lE={current:null};function X9(Z,J={}){let $="rootStore"in Z?Z.rootStore:Z,{dataRef:X,events:Q}=$.context,{enabled:Y=!0,delay:G=0,handleClose:H=null,mouseOnly:z=!1,restMs:W=0,move:K=!0,triggerElementRef:q=lE,externalTree:V,isActiveTrigger:U=!0}=J,B=d5(V),F=G$($),N=N5(H),L=N5(G),_=N5(W),M=N5(Y);if(U)F.handleCloseOptions=N.current?.__options;let O=Y0(()=>{if(F.interactedInside)return!0;return X.current.openEvent?["click","mousedown"].includes(X.current.openEvent.type):!1}),D=Y0((P)=>{return q4(P,$.context.triggerElements)}),A=j4.useCallback((P,g=!0)=>{let C=w6(L.current,"close",F.pointerType);if(C&&!F.handler)F.openChangeTimeout.start(C,()=>$.setOpen(!1,N0(n.triggerHover,P)));else if(g)F.openChangeTimeout.clear(),$.setOpen(!1,N0(n.triggerHover,P))},[L,$,F]),T=Y0(()=>{F.unbindMouseMove(),F.handler=void 0}),S=Y0(()=>{if(F.performedPointerEventsMutation){let P=u0($.select("domReferenceElement")).body;P.style.pointerEvents="",P.removeAttribute(T3),F.performedPointerEventsMutation=!1}});j4.useEffect(()=>{if(!Y)return;function P(g){if(!g.open)F.openChangeTimeout.clear(),F.restTimeout.clear(),F.blockMouseMove=!0,F.restTimeoutPending=!1}return Q.on("openchange",P),()=>{Q.off("openchange",P)}},[Y,Q,F]);let k=Y0((P)=>{if(O())return;if(!X.current.floatingContext)return;if(D(P.relatedTarget))return;let g=q.current;N.current?.({...X.current.floatingContext,tree:B,x:P.clientX,y:P.clientY,onClose(){if(S(),T(),!O()&&g===$.select("domReferenceElement"))A(P)}})(P)});return j4.useEffect(()=>{if(!Y)return;let P=q.current??(U?$.select("domReferenceElement"):null);if(!L1(P))return;function g(y){if(F.openChangeTimeout.clear(),F.blockMouseMove=!1,z&&!x7(F.pointerType))return;if(lG(_.current)>0&&!w6(L.current,"open"))return;let b=w6(L.current,"open",F.pointerType),R=$.select("domReferenceElement"),x=$.context.triggerElements,v=(x.hasElement(y.target)||x.hasMatchingElement((G0)=>k0(G0,y.target)))&&(!R||!k0(R,y.target)),d=y.currentTarget??null,w=$.select("open"),z0=!w||v;if(v&&w)$.setOpen(!0,N0(n.triggerHover,y,d));else if(b)F.openChangeTimeout.start(b,()=>{if(z0)$.setOpen(!0,N0(n.triggerHover,y,d))});else if(z0)$.setOpen(!0,N0(n.triggerHover,y,d))}function C(y){if(O()){S();return}F.unbindMouseMove();let b=$.select("domReferenceElement"),R=u0(b);if(F.restTimeout.clear(),F.restTimeoutPending=!1,D(y.relatedTarget))return;if(N.current&&X.current.floatingContext){if(!$.select("open"))F.openChangeTimeout.clear();let v=q.current;F.handler=N.current({...X.current.floatingContext,tree:B,x:y.clientX,y:y.clientY,onClose(){if(S(),T(),M.current&&!O()&&v===$.select("domReferenceElement"))A(y,!0)}});let d=F.handler;d(y),R.addEventListener("mousemove",d),F.unbindMouseMove=()=>{R.removeEventListener("mousemove",d)};return}if(F.pointerType==="touch"?!k0($.select("floatingElement"),y.relatedTarget):!0)A(y)}function I(y){k(y)}if($.select("open"))P.addEventListener("mouseleave",I);if(K)P.addEventListener("mousemove",g,{once:!0});return P.addEventListener("mouseenter",g),P.addEventListener("mouseleave",C),()=>{if(P.removeEventListener("mouseleave",I),K)P.removeEventListener("mousemove",g);P.removeEventListener("mouseenter",g),P.removeEventListener("mouseleave",C)}},[T,S,X,L,A,$,Y,N,k,F,U,O,D,z,K,_,q,B,M]),j4.useMemo(()=>{if(!Y)return;function P(g){F.pointerType=g.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(g){let{nativeEvent:C}=g,I=g.currentTarget,y=$.select("domReferenceElement"),b=$.context.triggerElements,R=$.select("open"),x=(b.hasElement(g.target)||b.hasMatchingElement((d)=>k0(d,g.target)))&&(!y||!k0(y,g.target));if(z&&!x7(F.pointerType))return;if(R&&!x||lG(_.current)===0)return;if(!x&&F.restTimeoutPending&&g.movementX**2+g.movementY**2<2)return;F.restTimeout.clear();function v(){if(F.restTimeoutPending=!1,O())return;let d=$.select("open");if(!F.blockMouseMove&&(!d||x))$.setOpen(!0,N0(n.triggerHover,C,I))}if(F.pointerType==="touch")NU.flushSync(()=>{v()});else if(x&&R)v();else F.restTimeoutPending=!0,F.restTimeout.start(lG(_.current),v)}}},[Y,F,O,z,$,_])}var T4=j(m(),1);function M5(Z=[]){let J=Z.map((W)=>W?.reference),$=Z.map((W)=>W?.floating),X=Z.map((W)=>W?.item),Q=Z.map((W)=>W?.trigger),Y=T4.useCallback((W)=>H$(W,Z,"reference"),J),G=T4.useCallback((W)=>H$(W,Z,"floating"),$),H=T4.useCallback((W)=>H$(W,Z,"item"),X),z=T4.useCallback((W)=>H$(W,Z,"trigger"),Q);return T4.useMemo(()=>({getReferenceProps:Y,getFloatingProps:G,getItemProps:H,getTriggerProps:z}),[Y,G,H,z])}function H$(Z,J,$){let X=new Map,Q=$==="item",Y={};if($==="floating")Y.tabIndex=-1,Y[B3]="";for(let G in Z){if(Q&&Z){if(G===FG||G===LG)continue}Y[G]=Z[G]}for(let G=0;G<J.length;G+=1){let H,z=J[G]?.[$];if(typeof z==="function")H=Z?z(Z):null;else H=z;if(!H)continue;_U(Y,H,Q,X)}return _U(Y,Z,Q,X),Y}function _U(Z,J,$,X){for(let Q in J){let Y=J[Q];if($&&(Q===FG||Q===LG))continue;if(!Q.startsWith("on"))Z[Q]=Y;else{if(!X.has(Q))X.set(Q,[]);if(typeof Y==="function")X.get(Q)?.push(Y),Z[Q]=(...G)=>{return X.get(Q)?.map((H)=>H(...G)).find((H)=>H!==void 0)}}}}var D5=j(m(),1);var iE="Escape";function W$(Z,J,$){switch(Z){case"vertical":return J;case"horizontal":return $;default:return J||$}}function z$(Z,J){return W$(J,Z===F3||Z===K4,Z===w9||Z===P9)}function iG(Z,J,$){return W$(J,Z===K4,$?Z===w9:Z===P9)||Z==="Enter"||Z===" "||Z===""}function rE(Z,J,$){return W$(J,$?Z===w9:Z===P9,Z===K4)}function aE(Z,J,$,X){let Q=$?Z===P9:Z===w9,Y=Z===F3;if(J==="both"||J==="horizontal"&&X&&X>1)return Z===iE;return W$(J,Q,Y)}function rG(Z,J){let $="rootStore"in Z?Z.rootStore:Z,X=$.useState("open"),Q=$.useState("floatingElement"),Y=$.useState("domReferenceElement"),G=$.context.dataRef,{listRef:H,activeIndex:z,onNavigate:W=()=>{},enabled:K=!0,selectedIndex:q=null,allowEscape:V=!1,loopFocus:U=!1,nested:B=!1,rtl:F=!1,virtual:N=!1,focusItemOnOpen:L="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:M=!0,disabledIndices:O=void 0,orientation:D="vertical",parentOrientation:A,cols:T=1,id:S,resetOnPointerLeave:k=!0,externalTree:P}=J,g=U4(Q),C=N5(g),I=_5(),y=d5(P);$0(()=>{G.current.orientation=D},[G,D]);let b=L3(Y),R=D5.useRef(L),x=D5.useRef(q??-1),v=D5.useRef(null),d=D5.useRef(!0),w=Y0((o)=>{W(x.current===-1?null:x.current,o)}),z0=D5.useRef(w),G0=D5.useRef(!!Q),E=D5.useRef(X),s=D5.useRef(!1),A0=D5.useRef(!1),l=N5(O),H0=N5(X),q0=N5(q),X0=N5(k),Q0=Y0(()=>{function o(M0){if(N)y?.events.emit("virtualfocus",M0);else _4(M0,{sync:s.current,preventScroll:!0})}let f=H.current[x.current],u=A0.current;if(f)o(f);(s.current?(M0)=>M0():requestAnimationFrame)(()=>{let M0=H.current[x.current]||f;if(!M0)return;if(!f)o(M0);if(p&&(u||!d.current))M0.scrollIntoView?.({block:"nearest",inline:"nearest"})})});$0(()=>{if(!K)return;if(X&&Q){if(x.current=q??-1,R.current&&q!=null)A0.current=!0,w()}else if(G0.current)x.current=-1,z0.current()},[K,X,Q,q,w]),$0(()=>{if(!K)return;if(!X){s.current=!1;return}if(!Q)return;if(z==null){if(s.current=!1,q0.current!=null)return;if(G0.current)x.current=-1,Q0();if((!E.current||!G0.current)&&R.current&&(v.current!=null||R.current===!0&&v.current==null)){let o=0,f=()=>{if(H.current[0]==null){if(o<2)(o?requestAnimationFrame:queueMicrotask)(f);o+=1}else x.current=v.current==null||iG(v.current,D,F)||B?bJ(H):AG(H),v.current=null,w()};f()}}else if(!M6(H,z))x.current=z,Q0(),A0.current=!1},[K,X,Q,z,q0,B,H,D,F,w,Q0,l]),$0(()=>{if(!K||Q||!y||N||!G0.current)return;let o=y.nodesRef.current,f=o.find((M0)=>M0.id===I)?.context?.elements.floating,u=b5(u0(Q)),L0=o.some((M0)=>M0.context&&k0(M0.context.elements.floating,u));if(f&&!L0&&d.current)f.focus({preventScroll:!0})},[K,Q,y,I,N]),$0(()=>{z0.current=w,E.current=X,G0.current=!!Q}),$0(()=>{if(!X)v.current=null,R.current=L},[X,L]);let V0=z!=null,p=D5.useMemo(()=>{function o(u){if(!H0.current)return;let L0=H.current.indexOf(u.currentTarget);if(L0!==-1&&x.current!==L0)x.current=L0,w(u)}return{onFocus(u){s.current=!0,o(u)},onClick:({currentTarget:u})=>u.focus({preventScroll:!0}),onMouseMove(u){if(s.current=!0,A0.current=!1,_)o(u)},onPointerLeave(u){if(!H0.current||!d.current||u.pointerType==="touch")return;s.current=!0;let L0=u.relatedTarget;if(!_||H.current.includes(L0))return;if(!X0.current)return;if(_4(null,{sync:!0}),x.current=-1,w(u),!N)C.current?.focus({preventScroll:!0})}}},[H0,C,_,H,w,X0,N]),Z0=D5.useCallback(()=>{return A??y?.nodesRef.current.find((o)=>o.id===I)?.context?.dataRef?.current.orientation},[I,y,A]),e=Y0((o)=>{if(d.current=!1,s.current=!0,o.which===229)return;if(!H0.current&&o.currentTarget===C.current)return;if(B&&aE(o.key,D,F,T)){if(!z$(o.key,Z0()))U5(o);if($.setOpen(!1,N0(n.listNavigation,o.nativeEvent)),u1(Y))if(N)y?.events.emit("virtualfocus",Y);else Y.focus();return}let f=x.current,u=bJ(H,O),L0=AG(H,O);if(!b){if(o.key==="Home")U5(o),x.current=u,w(o);if(o.key==="End")U5(o),x.current=L0,w(o)}if(T>1){let M0=Array.from({length:H.current.length},()=>({width:1,height:1})),h0=LV(M0,T,!1),l0=h0.findIndex((t)=>t!=null&&!D6(H,t,O)),h=h0.reduce((t,U0,C0)=>U0!=null&&!D6(H,U0,O)?C0:t,-1),c=h0[FV({current:h0.map((t)=>t!=null?H.current[t]:null)},{event:o,orientation:D,loopFocus:U,rtl:F,cols:T,disabledIndices:_V([...(typeof O!=="function"?O:null)||H.current.map((t,U0)=>D6(H,U0,O)?U0:void 0),void 0],h0),minIndex:l0,maxIndex:h,prevIndex:NV(x.current>L0?u:x.current,M0,h0,T,o.key===K4?"bl":o.key===(F?w9:P9)?"tr":"tl"),stopEvent:!0})];if(c!=null)x.current=c,w(o);if(D==="both")return}if(z$(o.key,D)){if(U5(o),X&&!N&&b5(o.currentTarget.ownerDocument)===o.currentTarget){x.current=iG(o.key,D,F)?u:L0,w(o);return}if(iG(o.key,D,F))if(U)if(f>=L0)if(V&&f!==H.current.length)x.current=-1;else s.current=!1,x.current=u;else x.current=x5(H,{startingIndex:f,disabledIndices:O});else x.current=Math.min(L0,x5(H,{startingIndex:f,disabledIndices:O}));else if(U)if(f<=u)if(V&&f!==-1)x.current=H.current.length;else s.current=!1,x.current=L0;else x.current=x5(H,{startingIndex:f,decrement:!0,disabledIndices:O});else x.current=Math.max(u,x5(H,{startingIndex:f,decrement:!0,disabledIndices:O}));if(M6(H,x.current))x.current=-1;w(o)}}),_0=D5.useMemo(()=>{return N&&X&&V0&&{"aria-activedescendant":`${S}-${z}`}},[N,X,V0,S,z]),i=D5.useMemo(()=>{return{"aria-orientation":D==="both"?void 0:D,...!b?_0:{},onKeyDown(o){if(o.key==="Tab"&&o.shiftKey&&X&&!N){let f=k1(o.nativeEvent);if(f&&!k0(C.current,f))return;if(U5(o),$.setOpen(!1,N0(n.focusOut,o.nativeEvent)),u1(Y))Y.focus();return}e(o)},onPointerMove(){d.current=!0}}},[_0,e,C,D,b,$,X,N,Y]),W0=D5.useMemo(()=>{function o(u){if(L==="auto"&&EJ(u.nativeEvent))R.current=!N}function f(u){if(R.current=L,L==="auto"&&kJ(u.nativeEvent))R.current=!0}return{onKeyDown(u){let L0=$.select("open");d.current=!1;let M0=u.key.startsWith("Arrow"),h0=rE(u.key,Z0(),F),l0=z$(u.key,D),h=(B?h0:l0)||u.key==="Enter"||u.key.trim()==="";if(N&&L0)return e(u);if(!L0&&!M&&M0)return;if(h){let c=z$(u.key,Z0());v.current=B&&c?null:u.key}if(B){if(h0)if(U5(u),L0)x.current=bJ(H,l.current),w(u);else $.setOpen(!0,N0(n.listNavigation,u.nativeEvent,u.currentTarget));return}if(l0){if(q0.current!=null)x.current=q0.current;if(U5(u),!L0&&M)$.setOpen(!0,N0(n.listNavigation,u.nativeEvent,u.currentTarget));else e(u);if(L0)w(u)}return},onFocus(u){if($.select("open")&&!N)x.current=-1,w(u)},onPointerDown:f,onPointerEnter:f,onMouseDown:o,onClick:o}},[e,l,L,H,B,w,$,M,D,Z0,F,q0,N]),r=D5.useMemo(()=>{return{..._0,...W0}},[_0,W0]);return D5.useMemo(()=>K?{reference:r,floating:i,item:p,trigger:W0}:{},[K,r,i,W0,p])}var T2=j(m(),1);var sE=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function C4(Z,J={}){let $="rootStore"in Z?Z.rootStore:Z,X=$.useState("open"),Q=$.useState("floatingId"),Y=$.useState("domReferenceElement"),G=$.useState("floatingElement"),{role:H="dialog"}=J,z=q7(),W=Y?.id||z,K=T2.useMemo(()=>U4(G)?.id||Q,[G,Q]),q=sE.get(H)??H,U=_5()!=null,B=T2.useMemo(()=>{if(q==="tooltip"||H==="label")return N1;return{"aria-haspopup":q==="alertdialog"?"dialog":q,"aria-expanded":"false",...q==="listbox"&&{role:"combobox"},...q==="menu"&&U&&{role:"menuitem"},...H==="select"&&{"aria-autocomplete":"none"},...H==="combobox"&&{"aria-autocomplete":"list"}}},[q,U,H]),F=T2.useMemo(()=>{if(q==="tooltip"||H==="label")return{[`aria-${H==="label"?"labelledby":"describedby"}`]:X?K:void 0};return{...B,"aria-expanded":X?"true":"false","aria-controls":X?K:void 0,...q==="menu"&&{id:W}}},[q,K,X,W,H,B]),N=T2.useMemo(()=>{let _={id:K,...q&&{role:q}};if(q==="tooltip"||H==="label")return _;return{..._,...q==="menu"&&{"aria-labelledby":W}}},[q,K,W,H]),L=T2.useCallback(({active:_,selected:M})=>{let O={role:"option",..._&&{id:`${K}-fui-option`}};switch(H){case"select":case"combobox":return{...O,"aria-selected":M};default:}return{}},[K,H]);return T2.useMemo(()=>({reference:F,floating:N,item:L,trigger:B}),[F,N,B,L])}var C2=j(m(),1);function aG(Z,J){let $="rootStore"in Z?Z.rootStore:Z,X=$.context.dataRef,Q=$.useState("open"),{listRef:Y,activeIndex:G,onMatch:H,onTypingChange:z,enabled:W=!0,resetMs:K=750,selectedIndex:q=null}=J,V=X5(),U=C2.useRef(""),B=C2.useRef(q??G??-1),F=C2.useRef(null);$0(()=>{if(!Q&&q!==null)return;if(V.clear(),F.current=null,U.current!=="")U.current=""},[Q,q,V]),$0(()=>{if(Q&&U.current==="")B.current=q??G??-1},[Q,q,G]);let N=Y0((D)=>{if(D){if(!X.current.typing)X.current.typing=D,z?.(D)}else if(X.current.typing)X.current.typing=D,z?.(D)}),L=Y0((D)=>{function A(C,I,y){let b=I.find((R)=>R?.toLocaleLowerCase().indexOf(y.toLocaleLowerCase())===0);return b?C.indexOf(b):-1}let T=Y.current;if(U.current.length>0&&U.current[0]!==" "){if(A(T,T,U.current)===-1)N(!1);else if(D.key===" ")U5(D)}if(T==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;if(Q&&D.key!==" ")U5(D),N(!0);let S=U.current==="";if(S)B.current=q??G??-1;if(T.every((C)=>C?C[0]?.toLocaleLowerCase()!==C[1]?.toLocaleLowerCase():!0)&&U.current===D.key)U.current="",B.current=F.current;U.current+=D.key,V.start(K,()=>{U.current="",B.current=F.current,N(!1)});let P=S?q??G??-1:B.current,g=A(T,[...T.slice((P||0)+1),...T.slice(0,(P||0)+1)],U.current);if(g!==-1)H?.(g),F.current=g;else if(D.key!==" ")U.current="",N(!1)}),_=Y0((D)=>{let A=D.relatedTarget,T=$.select("domReferenceElement"),S=$.select("floatingElement"),k=k0(T,A),P=k0(S,A);if(k||P)return;V.clear(),U.current="",B.current=F.current,N(!1)}),M=C2.useMemo(()=>({onKeyDown:L,onBlur:_}),[L,_]),O=C2.useMemo(()=>{return{onKeyDown:L,onKeyUp(D){if(D.key===" ")N(!1)},onBlur:_}},[L,_,N]);return C2.useMemo(()=>W?{reference:M,floating:O}:{},[W,M,O])}function AU(Z,J){let[$,X]=Z,Q=!1,Y=J.length;for(let G=0,H=Y-1;G<Y;H=G++){let[z,W]=J[G]||[0,0],[K,q]=J[H]||[0,0];if(W>=X!==q>=X&&$<=(K-z)*(X-W)/(q-W)+z)Q=!Q}return Q}function nE(Z,J){return Z[0]>=J.x&&Z[0]<=J.x+J.width&&Z[1]>=J.y&&Z[1]<=J.y+J.height}function Q9(Z={}){let{buffer:J=0.5,blockPointerEvents:$=!1,requireIntent:X=!0}=Z,Q=new y5,Y=!1,G=null,H=null,z=typeof performance<"u"?performance.now():0;function W(q,V){let U=performance.now(),B=U-z;if(G===null||H===null||B===0)return G=q,H=V,z=U,null;let F=q-G,N=V-H,_=Math.sqrt(F*F+N*N)/B;return G=q,H=V,z=U,_}let K=({x:q,y:V,placement:U,elements:B,onClose:F,nodeId:N,tree:L})=>{return function(M){function O(){Q.clear(),F()}if(Q.clear(),!B.domReference||!B.floating||U==null||q==null||V==null)return;let{clientX:D,clientY:A}=M,T=[D,A],S=k1(M),k=M.type==="mouseleave",P=k0(B.floating,S),g=k0(B.domReference,S),C=B.domReference.getBoundingClientRect(),I=B.floating.getBoundingClientRect(),y=U.split("-")[0],b=q>I.right-I.width/2,R=V>I.bottom-I.height/2,x=nE(T,C),v=I.width>C.width,d=I.height>C.height,w=(v?C:I).left,z0=(v?C:I).right,G0=(d?C:I).top,E=(d?C:I).bottom;if(P){if(Y=!0,!k)return}if(g)Y=!1;if(g&&!k){Y=!0;return}if(k&&L1(M.relatedTarget)&&k0(B.floating,M.relatedTarget))return;if(L&&j9(L.nodesRef.current,N).some(({context:l})=>l?.open))return;if(y==="top"&&V>=C.bottom-1||y==="bottom"&&V<=C.top+1||y==="left"&&q>=C.right-1||y==="right"&&q<=C.left+1)return O();let s=[];switch(y){case"top":s=[[w,C.top+1],[w,I.bottom-1],[z0,I.bottom-1],[z0,C.top+1]];break;case"bottom":s=[[w,I.top+1],[w,C.bottom-1],[z0,C.bottom-1],[z0,I.top+1]];break;case"left":s=[[I.right-1,E],[I.right-1,G0],[C.left+1,G0],[C.left+1,E]];break;case"right":s=[[C.right-1,E],[C.right-1,G0],[I.left+1,G0],[I.left+1,E]];break;default:}function A0([l,H0]){switch(y){case"top":{let q0=[v?l+J/2:b?l+J*4:l-J*4,H0+J+1],X0=[v?l-J/2:b?l+J*4:l-J*4,H0+J+1],Q0=[[I.left,b?I.bottom-J:v?I.bottom-J:I.top],[I.right,b?v?I.bottom-J:I.top:I.bottom-J]];return[q0,X0,...Q0]}case"bottom":{let q0=[v?l+J/2:b?l+J*4:l-J*4,H0-J],X0=[v?l-J/2:b?l+J*4:l-J*4,H0-J],Q0=[[I.left,b?I.top+J:v?I.top+J:I.bottom],[I.right,b?v?I.top+J:I.bottom:I.top+J]];return[q0,X0,...Q0]}case"left":{let q0=[l+J+1,d?H0+J/2:R?H0+J*4:H0-J*4],X0=[l+J+1,d?H0-J/2:R?H0+J*4:H0-J*4];return[...[[R?I.right-J:d?I.right-J:I.left,I.top],[R?d?I.right-J:I.left:I.right-J,I.bottom]],q0,X0]}case"right":{let q0=[l-J,d?H0+J/2:R?H0+J*4:H0-J*4],X0=[l-J,d?H0-J/2:R?H0+J*4:H0-J*4],Q0=[[R?I.left+J:d?I.left+J:I.right,I.top],[R?d?I.left+J:I.right:I.left+J,I.bottom]];return[q0,X0,...Q0]}default:return[]}}if(AU([D,A],s))return;if(Y&&!x)return O();if(!k&&X){let l=W(M.clientX,M.clientY),H0=0.1;if(l!==null&&l<0.1)return O()}if(!AU([D,A],A0([q,V])))O();else if(!Y&&X)Q.start(40,O);return}};return K.__options={blockPointerEvents:$},K}var q$=j(m(),1),JH=q$.createContext(void 0);function U7(Z){let J=q$.useContext(JH);if(J===void 0&&!Z)throw Error(w0(50));return J}var DU=j(m(),1),OU=j(w7(),1);var MU=600,V$=300;var oE={...R9,instantType:P0((Z)=>Z.instantType),hasViewport:P0((Z)=>Z.hasViewport)};class E6 extends P7{constructor(Z){super({...tE(),...Z},{popupRef:DU.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Q7,closeDelayRef:{current:V$}},oE)}setOpen=(Z,J)=>{let $=J.reason,X=$===n.triggerHover,Q=Z&&$===n.triggerFocus,Y=!Z&&($===n.triggerPress||$===n.escapeKey);if(J.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(Z,J),J.isCanceled)return;let G=()=>{let H={open:Z};if(Q)H.instantType="focus";else if(Y)H.instantType="dismiss";else if($===n.triggerHover)H.instantType=void 0;let z=J.trigger?.id??null;if(z||Z)H.activeTriggerId=z,H.activeTriggerElement=J.trigger??null;this.update(H)};if(X)OU.flushSync(G);else G()};static useStore(Z,J){let $=K1(()=>{return new E6(J)}).current,X=Z??$,Q=$9({popupStore:X,onOpenChange:X.setOpen});return X.state.floatingRootContext=Q,X}}function tE(){return{...k9(),instantType:void 0,hasViewport:!1}}var wU=j(a(),1);function PU(Z){let{open:J,defaultOpen:$=!1,onOpenChange:X,onOpenChangeComplete:Q,actionsRef:Y,handle:G,triggerId:H,defaultTriggerId:z=null,children:W}=Z,K=E6.useStore(G?.store,{open:$,openProp:J,activeTriggerId:z,triggerIdProp:H});D9(()=>{if(J===void 0&&K.state.open===!1&&$===!0)K.update({open:!0,activeTriggerId:z})}),K.useControlledProp("openProp",J),K.useControlledProp("triggerIdProp",H),K.useContextCallback("onOpenChange",X),K.useContextCallback("onOpenChangeComplete",Q);let q=K.useState("open"),V=K.useState("activeTriggerId"),U=K.useState("payload");I9(K);let{forceUnmount:B}=E9(q,K);$0(()=>{if(q){if(V==null)K.set("payload",void 0)}},[K,V,q]);let F=S2.useCallback(()=>{K.setOpen(!1,eE(K,n.imperativeAction))},[K]);S2.useImperativeHandle(Y,()=>({unmount:B,close:F}),[B,F]);let N=K.useState("floatingRootContext"),L=J9(N),{getReferenceProps:_,getTriggerProps:M,getFloatingProps:O}=M5([L]),D=S2.useMemo(()=>_(),[_]),A=S2.useMemo(()=>M(),[M]),T=S2.useMemo(()=>O(),[O]);return K.useSyncedValues({activeTriggerProps:D,inactiveTriggerProps:A,popupProps:T}),wU.jsx(JH.Provider,{value:K,children:typeof W==="function"?W({payload:U}):W})}function eE(Z,J){let $=N0(J);return $.preventUnmountOnClose=()=>{Z.set("preventUnmountingOnClose",!0)},$}var SU=j(m(),1);var U$=j(m(),1),$H=U$.createContext(void 0);function jU(){let Z=U$.useContext($H);if(Z===void 0)throw Error(w0(48));return Z}var B$=j(m(),1),TU=j(w7(),1);var CU=j(a(),1),F$=B$.forwardRef(function(J,$){let{children:X,container:Q,className:Y,render:G,...H}=J,{portalNode:z,portalSubtree:W}=oJ({container:Q,ref:$,componentProps:J,elementProps:H});if(!W&&!z)return null;return CU.jsxs(B$.Fragment,{children:[W,z&&TU.createPortal(X,z)]})});var XH=j(a(),1),IU=SU.forwardRef(function(J,$){let{keepMounted:X=!1,...Q}=J;if(!(U7().useState("mounted")||X))return null;return XH.jsx($H.Provider,{value:X,children:XH.jsx(F$,{ref:$,...Q})})});var L$=j(m(),1);var j7=function(Z){return Z.open="data-open",Z.closed="data-closed",Z[Z.startingStyle=T9.startingStyle]="startingStyle",Z[Z.endingStyle=T9.endingStyle]="endingStyle",Z.anchorHidden="data-anchor-hidden",Z.side="data-side",Z.align="data-align",Z}({}),C3=function(Z){return Z.popupOpen="data-popup-open",Z.pressed="data-pressed",Z}({}),Zk={[C3.popupOpen]:""},Jk={[C3.popupOpen]:"",[C3.pressed]:""},$k={[j7.open]:""},Xk={[j7.closed]:""},Qk={[j7.anchorHidden]:""},b9={open(Z){if(Z)return Zk;return null}},S3={open(Z){if(Z)return Jk;return null}},Y1={open(Z){if(Z)return $k;return Xk},anchorHidden(Z){if(Z)return Qk;return null}};function d0(Z){return q7(Z,"base-ui")}var EU=L$.forwardRef(function(J,$){let{render:X,className:Q,delay:Y,closeDelay:G,id:H,payload:z,handle:W,...K}=J,q=U7(!0),V=W?.store??q;if(!V)throw Error(w0(89));let U=d0(H),B=V.useState("isTriggerActive",U),F=V.useState("isOpenedByTrigger",U),N=V.useState("floatingRootContext"),L=L$.useRef(null),_=Y??MU,M=G??V$,{registerTrigger:O,isMountedByThisTrigger:D}=S9(U,L,V,{payload:z});$0(()=>{if(D)V.context.closeDelayRef.current=M},[V,D,M]);let A=X9(N,{mouseOnly:!0,move:!1,handleClose:Q9(),delay:()=>({open:_,close:M}),triggerElementRef:L,isActiveTrigger:B}),T=P4(N,{delay:_}),S={open:F},k=V.useState("triggerProps",D);return K0("a",J,{state:S,ref:[$,O,L],props:[A,T.reference,k,{id:U},K],stateAttributesMapping:b9})});var k3=j(m(),1);var N$=j(m(),1),QH=N$.createContext(void 0);function k6(){let Z=N$.useContext(QH);if(Z===void 0)throw Error(w0(49));return Z}var T7=j(m(),1);var _$=j(m(),1),Yk=_$.createContext(void 0);function I2(){return _$.useContext(Yk)?.direction??"ltr"}var Gk=(Z)=>({name:"arrow",options:Z,async fn(J){let{x:$,y:X,placement:Q,rects:Y,platform:G,elements:H,middlewareData:z}=J,{element:W,padding:K=0,offsetParent:q="real"}=RU(Z,J)||{};if(W==null)return{};let V=xU(K),U={x:$,y:X},B=bU(Q),F=yU(B),N=await G.getDimensions(W),L=B==="y",_=L?"top":"left",M=L?"bottom":"right",O=L?"clientHeight":"clientWidth",D=Y.reference[F]+Y.reference[B]-U[B]-Y.floating[F],A=U[B]-Y.reference[B],T=q==="real"?await G.getOffsetParent?.(W):H.floating,S=H.floating[O]||Y.floating[F];if(!S||!await G.isElement?.(T))S=H.floating[O]||Y.floating[F];let k=D/2-A/2,P=S/2-N[F]/2-1,g=Math.min(V[_],P),C=Math.min(V[M],P),I=g,y=S-N[F]-C,b=S/2-N[F]/2+k,R=kU(I,b,y),x=!z.arrow&&I3(Q)!=null&&b!==R&&Y.reference[F]/2-(b<I?g:C)-N[F]/2<0,v=x?b<I?b-I:b-y:0;return{[B]:U[B]+v,data:{[B]:R,centerOffset:b-R-v,...x&&{alignmentOffset:v}},reset:x}}}),hU=(Z,J)=>({...Gk(Z),options:[Z,J]});var vU={name:"hide",async fn(Z){let{width:J,height:$,x:X,y:Q}=Z.rects.reference,Y=J===0&&$===0&&X===0&&Q===0;return{data:{referenceHidden:(await ZH().fn(Z)).data?.referenceHidden||Y}}}};var E3={sideX:"left",sideY:"top"},R6={name:"adaptiveOrigin",async fn(Z){let{x:J,y:$,rects:{floating:X},elements:{floating:Q},platform:Y,strategy:G,placement:H}=Z,z=D7(Q),W=z.getComputedStyle(Q);if(!(W.transitionDuration!=="0s"&&W.transitionDuration!==""))return{x:J,y:$,data:E3};let q=await Y.getOffsetParent?.(Q),V={width:0,height:0};if(G==="fixed"&&z?.visualViewport)V={width:z.visualViewport.width,height:z.visualViewport.height};else if(q===z){let _=u0(Q);V={width:_.documentElement.clientWidth,height:_.documentElement.clientHeight}}else if(await Y.isElement?.(q))V=await Y.getDimensions(q);let U=S4(H),B=J,F=$;if(U==="left")B=V.width-(J+X.width);if(U==="top")F=V.height-($+X.height);let N=U==="left"?"right":E3.sideX,L=U==="top"?"bottom":E3.sideY;return{x:B,y:F,data:{sideX:N,sideY:L}}}};function fU(Z,J,$){let X=Z==="inline-start"||Z==="inline-end";return{top:"top",right:X?$?"inline-start":"inline-end":"right",bottom:"bottom",left:X?$?"inline-end":"inline-start":"left"}[J]}function gU(Z,J,$){let{rects:X,placement:Q}=Z;return{side:fU(J,S4(Q),$),align:I3(Q)||"center",anchor:{width:X.reference.width,height:X.reference.height},positioner:{width:X.floating.width,height:X.floating.height}}}function E2(Z){let{anchor:J,positionMethod:$="absolute",side:X="bottom",sideOffset:Q=0,align:Y="center",alignOffset:G=0,collisionBoundary:H,collisionPadding:z=5,sticky:W=!1,arrowPadding:K=5,disableAnchorTracking:q=!1,keepMounted:V=!1,floatingRootContext:U,mounted:B,collisionAvoidance:F,shiftCrossAxis:N=!1,nodeId:L,adaptiveOrigin:_,lazyFlip:M=!1,externalTree:O}=Z,[D,A]=T7.useState(null);if(!B&&D!==null)A(null);let T=F.side||"flip",S=F.align||"flip",k=F.fallbackAxisSide||"end",P=typeof J==="function"?J:void 0,g=Y0(P),C=P?g:J,I=N5(J),b=I2()==="rtl",R=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":b?"left":"right","inline-start":b?"right":"left"}[X],x=Y==="center"?R:`${R}-${Y}`,v=z,d=1,w=X==="bottom"?d:0,z0=X==="top"?d:0,G0=X==="right"?d:0,E=X==="left"?d:0;if(typeof v==="number")v={top:v+w,right:v+E,bottom:v+z0,left:v+G0};else if(v)v={top:(v.top||0)+w,right:(v.right||0)+E,bottom:(v.bottom||0)+z0,left:(v.left||0)+G0};let s={boundary:H==="clipping-ancestors"?"clippingAncestors":H,padding:v},A0=T7.useRef(null),l=N5(Q),H0=N5(G),Q0=[sG((f0)=>{let Q1=gU(f0,X,b),K5=typeof l.current==="function"?l.current(Q1):l.current,x1=typeof H0.current==="function"?H0.current(Q1):H0.current;return{mainAxis:K5,crossAxis:x1,alignmentAxis:x1}},[typeof Q!=="function"?Q:0,typeof G!=="function"?G:0,b,X])],V0=S==="none"&&T!=="shift",p=!V0&&(W||N||T==="shift"),Z0=T==="none"?null:tG({...s,padding:{top:v.top+d,right:v.right+d,bottom:v.bottom+d,left:v.left+d},mainAxis:!N&&T==="flip",crossAxis:S==="flip"?"alignment":!1,fallbackAxisSideDirection:k}),e=V0?null:nG((f0)=>{let Q1=u0(f0.elements.floating).documentElement;return{...s,rootBoundary:N?{x:0,y:0,width:Q1.clientWidth,height:Q1.clientHeight}:void 0,mainAxis:S!=="none",crossAxis:p,limiter:W||N?void 0:oG((K5)=>{if(!A0.current)return{};let{width:x1,height:q5}=A0.current.getBoundingClientRect(),E0=YH(S4(K5.placement)),x0=E0==="y"?x1:q5,s0=E0==="y"?v.left+v.right:v.top+v.bottom;return{offset:x0/2+s0/2}})}},[s,W,N,v,S]);if(T==="shift"||S==="shift"||Y==="center")Q0.push(e,Z0);else Q0.push(Z0,e);Q0.push(eG({...s,apply({elements:{floating:f0},rects:{reference:Q1},availableWidth:K5,availableHeight:x1}){let q5=f0.style;q5.setProperty("--available-width",`${K5}px`),q5.setProperty("--available-height",`${x1}px`),q5.setProperty("--anchor-width",`${Q1.width}px`),q5.setProperty("--anchor-height",`${Q1.height}px`)}}),hU(()=>({element:A0.current||document.createElement("div"),padding:K,offsetParent:"floating"}),[K]),{name:"transformOrigin",fn(f0){let{elements:Q1,middlewareData:K5,placement:x1,rects:q5,y:E0}=f0,x0=S4(x1),s0=YH(x0),n0=A0.current,z1=K5.arrow?.x||0,B1=K5.arrow?.y||0,C1=n0?.clientWidth||0,g1=n0?.clientHeight||0,H1=z1+C1/2,m1=B1+g1/2,H5=Math.abs(K5.shift?.y||0),V5=q5.reference.height/2,T0=typeof Q==="function"?Q(gU(f0,X,b)):Q,p0=H5>T0,S0={top:`${H1}px calc(100% + ${T0}px)`,bottom:`${H1}px ${-T0}px`,left:`calc(100% + ${T0}px) ${m1}px`,right:`${-T0}px ${m1}px`}[x0],o0=`${H1}px ${q5.reference.y+V5-E0}px`;return Q1.floating.style.setProperty("--transform-origin",p&&s0==="y"&&p0?o0:S0),{}}},vU,_),$0(()=>{if(!B&&U)U.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[B,U]);let _0=T7.useMemo(()=>({elementResize:!q&&typeof ResizeObserver<"u",layoutShift:!q&&typeof IntersectionObserver<"u"}),[q]),{refs:i,elements:W0,x:r,y:o,middlewareData:f,update:u,placement:L0,context:M0,isPositioned:h0,floatingStyles:l0}=uG({rootContext:U,placement:x,middleware:Q0,strategy:$,whileElementsMounted:V?void 0:(...f0)=>K$(...f0,_0),nodeId:L,externalTree:O}),{sideX:h,sideY:c}=f.adaptiveOrigin||E3,t=h0?$:"fixed",U0=T7.useMemo(()=>{let f0=_?{position:t,[h]:r,[c]:o}:{position:t,...l0};if(!h0)f0.opacity=0;return f0},[_,t,h,r,c,o,l0,h0]),C0=T7.useRef(null);$0(()=>{if(!B)return;let f0=I.current,Q1=typeof f0==="function"?f0():f0,x1=(mU(Q1)?Q1.current:Q1)||null||null;if(x1!==C0.current)i.setPositionReference(x1),C0.current=x1},[B,i,C,I]),T7.useEffect(()=>{if(!B)return;let f0=I.current;if(typeof f0==="function")return;if(mU(f0)&&f0.current!==C0.current)i.setPositionReference(f0.current),C0.current=f0.current},[B,i,C,I]),T7.useEffect(()=>{if(V&&B&&W0.domReference&&W0.floating)return K$(W0.domReference,W0.floating,u,_0);return},[V,B,W0,u,_0]);let m0=S4(L0),w1=fU(X,m0,b),b1=I3(L0)||"center",v0=Boolean(f.hide?.referenceHidden);$0(()=>{if(M&&B&&h0)A(m0)},[M,B,h0,m0]);let i0=T7.useMemo(()=>({position:"absolute",top:f.arrow?.y,left:f.arrow?.x}),[f.arrow]),e0=f.arrow?.centerOffset!==0;return T7.useMemo(()=>({positionerStyles:U0,arrowStyles:i0,arrowRef:A0,arrowUncentered:e0,side:w1,align:b1,physicalSide:m0,anchorHidden:v0,refs:i,context:M0,isPositioned:h0,update:u}),[U0,i0,A0,e0,w1,b1,m0,v0,i,M0,h0,u])}function mU(Z){return Z!=null&&"current"in Z}function l5(Z){return Z==="starting"?pU:N1}var uU=j(a(),1),cU=k3.forwardRef(function(J,$){let{render:X,className:Q,anchor:Y,positionMethod:G="absolute",side:H="bottom",align:z="center",sideOffset:W=0,alignOffset:K=0,collisionBoundary:q="clipping-ancestors",collisionPadding:V=5,arrowPadding:U=5,sticky:B=!1,disableAnchorTracking:F=!1,collisionAvoidance:N=k2,...L}=J,_=U7(),M=jU(),O=_.useState("open"),D=_.useState("mounted"),A=_.useState("floatingRootContext"),T=_.useState("instantType"),S=_.useState("transitionStatus"),k=_.useState("hasViewport"),P=E2({anchor:Y,floatingRootContext:A,positionMethod:G,mounted:D,side:H,sideOffset:W,align:z,alignOffset:K,arrowPadding:U,collisionBoundary:q,collisionPadding:V,sticky:B,disableAnchorTracking:F,keepMounted:M,collisionAvoidance:N,adaptiveOrigin:k?R6:void 0}),g=k3.useMemo(()=>{let b={};if(!O)b.pointerEvents="none";return{role:"presentation",hidden:!D,style:{...P.positionerStyles,...b}}},[O,D,P.positionerStyles]),C={open:O,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:T},I=k3.useMemo(()=>({side:P.side,align:P.align,arrowRef:P.arrowRef,arrowUncentered:P.arrowUncentered,arrowStyles:P.arrowStyles}),[P.side,P.align,P.arrowRef,P.arrowUncentered,P.arrowStyles]),y=K0("div",J,{state:C,props:[g,l5(S),L],ref:[$,_.useStateSetter("positionerElement")],stateAttributesMapping:Y1});return uU.jsx(QH.Provider,{value:I,children:y})});var dU=j(m(),1);var Hk={...Y1,...j1},lU=dU.forwardRef(function(J,$){let{className:X,render:Q,...Y}=J,G=U7(),{side:H,align:z}=k6(),W=G.useState("open"),K=G.useState("instantType"),q=G.useState("transitionStatus"),V=G.useState("popupProps"),U=G.useState("floatingRootContext");B5({open:W,ref:G.context.popupRef,onComplete(){if(W)G.context.onOpenChangeComplete?.(!0)}});let B=Y0(()=>G.context.closeDelayRef.current);return X2(U,{closeDelay:B}),K0("div",J,{state:{open:W,side:H,align:z,instant:K,transitionStatus:q},ref:[$,G.context.popupRef,G.useStateSetter("popupElement")],props:[V,l5(q),Y],stateAttributesMapping:Hk})});var iU=j(m(),1);var rU=iU.forwardRef(function(J,$){let{render:X,className:Q,...Y}=J,G=U7(),{arrowRef:H,side:z,align:W,arrowUncentered:K,arrowStyles:q}=k6(),U={open:G.useState("open"),side:z,align:W,uncentered:K};return K0("div",J,{state:U,ref:[H,$],props:[{style:q,"aria-hidden":!0},Y],stateAttributesMapping:Y1})});var aU=j(m(),1);var zk={...Y1,...j1},sU=aU.forwardRef(function(J,$){let{render:X,className:Q,...Y}=J,G=U7(),H=G.useState("open"),z=G.useState("mounted"),W=G.useState("transitionStatus");return K0("div",J,{state:{open:H,transitionStatus:W},ref:[$],props:[{role:"presentation",hidden:!z,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},Y],stateAttributesMapping:zk})});var $B=j(m(),1);var nU=function(Z){return Z.popupWidth="--popup-width",Z.popupHeight="--popup-height",Z}({});var i5=j(m(),1);function R2(Z){if(X$(19))return Z;return Z?"true":void 0}var oU=j(m(),1);function tU(Z){let[J,$]=oU.useState({current:Z,previous:null});if(Z!==J.current)$({current:Z,previous:J.current});return J.previous}var I4=j(m(),1);function HH(Z){let J=T6(Z),$=parseFloat(J.width)||0,X=parseFloat(J.height)||0,Q=u1(Z),Y=Q?Z.offsetWidth:$,G=Q?Z.offsetHeight:X;if(GH($)!==Y||GH(X)!==G)$=Y,X=G;return{width:$,height:X}}var Wk=typeof ResizeObserver<"u",Kk=()=>!0;function ZB(Z){let{popupElement:J,positionerElement:$,content:X,mounted:Q,enabled:Y=Kk,onMeasureLayout:G,onMeasureLayoutComplete:H,side:z,direction:W}=Z,K=C9(J,!0,!1),q=h7(),V=I4.useRef(null),U=I4.useRef(null),B=I4.useRef(!0),F=I4.useRef(P1),N=Y0(G),L=Y0(H),_=I4.useMemo(()=>{let M=z==="top",O=z==="left";if(W==="rtl")M=M||z==="inline-end",O=O||z==="inline-end";else M=M||z==="inline-start",O=O||z==="inline-start";return M?{position:"absolute",[z==="top"?"bottom":"top"]:"0",[O?"right":"left"]:"0"}:N1},[z,W]);$0(()=>{if(!Q||!Y()||!Wk){F.current=P1,B.current=!0,V.current=null,U.current=null;return}if(!J||!$)return;F.current=eU(J,_);let M=new ResizeObserver((I)=>{let y=I[0];if(y)U.current={width:Math.ceil(y.borderBoxSize[0].inlineSize),height:Math.ceil(y.borderBoxSize[0].blockSize)}});M.observe(J),A$(J,"auto");let O=M$(J,"position","static"),D=M$(J,"transform","none"),A=M$(J,"scale","1"),T=eU($,{"--available-width":"max-content","--available-height":"max-content"});function S(){O(),D(),T()}function k(){S(),A()}if(N?.(),B.current||V.current===null){R3($,"max-content");let I=HH(J);return V.current=I,R3($,I),k(),L?.(null,I),B.current=!1,()=>{M.disconnect(),F.current(),F.current=P1}}A$(J,"auto"),R3($,"max-content");let P=V.current??U.current,g=HH(J);if(V.current=g,!P)return R3($,g),k(),L?.(null,g),()=>{M.disconnect(),q.cancel(),F.current(),F.current=P1};A$(J,P),k(),L?.(P,g),R3($,g);let C=new AbortController;return q.request(()=>{A$(J,g),K(()=>{J.style.setProperty("--popup-width","auto"),J.style.setProperty("--popup-height","auto")},C.signal)}),()=>{M.disconnect(),C.abort(),q.cancel(),F.current(),F.current=P1}},[X,J,$,K,q,Y,Q,N,L,_])}function M$(Z,J,$){let X=Z.style.getPropertyValue(J);return Z.style.setProperty(J,$),()=>{Z.style.setProperty(J,X)}}function eU(Z,J){let $=[];for(let[X,Q]of Object.entries(J))$.push(M$(Z,X,Q));return $.length?()=>{$.forEach((X)=>X())}:P1}function A$(Z,J){let $=J==="auto"?"auto":`${J.width}px`,X=J==="auto"?"auto":`${J.height}px`;Z.style.setProperty("--popup-width",$),Z.style.setProperty("--popup-height",X)}function R3(Z,J){let $=J==="max-content"?"max-content":`${J.width}px`,X=J==="max-content"?"max-content":`${J.height}px`;Z.style.setProperty("--positioner-width",$),Z.style.setProperty("--positioner-height",X)}var y6=j(a(),1);function b6(Z){let{store:J,side:$,cssVars:X,children:Q}=Z,Y=I2(),G=J.useState("activeTriggerElement"),H=J.useState("activeTriggerId"),z=J.useState("open"),W=J.useState("payload"),K=J.useState("mounted"),q=J.useState("popupElement"),V=J.useState("positionerElement"),U=tU(z?G:null),B=Uk(H,W),F=i5.useRef(null),[N,L]=i5.useState(null),[_,M]=i5.useState(null),O=i5.useRef(null),D=i5.useRef(null),A=C9(O,!0,!1),T=h7(),[S,k]=i5.useState(null),[P,g]=i5.useState(!1);$0(()=>{return J.set("hasViewport",!0),()=>{J.set("hasViewport",!1)}},[J]);let C=Y0(()=>{O.current?.style.setProperty("animation","none"),O.current?.style.setProperty("transition","none"),D.current?.style.setProperty("display","none")}),I=Y0((v)=>{if(O.current?.style.removeProperty("animation"),O.current?.style.removeProperty("transition"),D.current?.style.removeProperty("display"),v)k(v)}),y=i5.useRef(null);$0(()=>{if(G&&U&&G!==U&&y.current!==G&&F.current){L(F.current),g(!0);let v=Vk(U,G);M(v),T.request(()=>{T.request(()=>{g(!1),A(()=>{L(null),k(null),F.current=null})})}),y.current=G}},[G,U,N,A,T]),$0(()=>{let v=O.current;if(!v)return;let d=document.createElement("div");for(let w of Array.from(v.childNodes))d.appendChild(w.cloneNode(!0));F.current=d});let b=N!=null,R;if(!b)R=y6.jsx("div",{"data-current":!0,ref:O,children:Q},B);else R=y6.jsxs(i5.Fragment,{children:[y6.jsx("div",{"data-previous":!0,inert:R2(!0),ref:D,style:{[X.popupWidth]:`${S?.width}px`,[X.popupHeight]:`${S?.height}px`,position:"absolute"},"data-ending-style":P?void 0:""},"previous"),y6.jsx("div",{"data-current":!0,ref:O,"data-starting-style":P?"":void 0,children:Q},B)]});$0(()=>{let v=D.current;if(!v||!N)return;v.replaceChildren(...Array.from(N.childNodes))},[N]),ZB({popupElement:q,positionerElement:V,mounted:K,content:W,onMeasureLayout:C,onMeasureLayoutComplete:I,side:$,direction:Y});let x={activationDirection:qk(_),transitioning:b};return{children:R,state:x}}function qk(Z){if(!Z)return;return`${JB(Z.horizontal,5,"right","left")} ${JB(Z.vertical,5,"down","up")}`}function JB(Z,J,$,X){if(Z>J)return $;if(Z<-J)return X;return""}function Vk(Z,J){let $=Z.getBoundingClientRect(),X=J.getBoundingClientRect(),Q={x:$.left+$.width/2,y:$.top+$.height/2},Y={x:X.left+X.width/2,y:X.top+X.height/2};return{horizontal:Y.x-Q.x,vertical:Y.y-Q.y}}function Uk(Z,J){let[$,X]=i5.useState(0),Q=i5.useRef(Z),Y=i5.useRef(J),G=i5.useRef(!1);return $0(()=>{let H=Q.current,z=Y.current,W=Z!==H,K=J!==z;if(W)X((q)=>q+1),G.current=!K;else if(G.current&&K)X((q)=>q+1),G.current=!1;Q.current=Z,Y.current=J},[Z,J]),`${Z??"current"}-${$}`}var Bk={activationDirection:(Z)=>Z?{"data-activation-direction":Z}:null},XB=$B.forwardRef(function(J,$){let{render:X,className:Q,children:Y,...G}=J,H=U7(),z=k6(),W=H.useState("instantType"),{children:K,state:q}=b6({store:H,side:z.side,cssVars:nU,children:Y}),V={activationDirection:q.activationDirection,transitioning:q.transitioning,instant:W};return K0("div",J,{state:V,ref:$,props:[G,{children:K}],stateAttributesMapping:Bk})});class D${constructor(){this.store=new E6}open(Z){let J=Z?this.store.context.triggerElements.getById(Z):void 0;if(Z&&!J)throw Error(w0(88,Z));this.store.setOpen(!0,N0(n.imperativeAction,void 0,J))}close(){this.store.setOpen(!1,N0(n.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function QB(){return new D$}var x6=j(a(),1);function YB({...Z}){return x6.jsx(y2.Root,{"data-slot":"hover-card",...Z})}function GB({...Z}){return x6.jsx(y2.Trigger,{"data-slot":"hover-card-trigger",...Z})}function HB({className:Z,side:J="bottom",sideOffset:$=4,align:X="center",alignOffset:Q=4,...Y}){return x6.jsx(y2.Portal,{"data-slot":"hover-card-portal",children:x6.jsx(y2.Positioner,{align:X,alignOffset:Q,side:J,sideOffset:$,className:"isolate z-50",children:x6.jsx(y2.Popup,{"data-slot":"hover-card-content",className:B0("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-border 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),...Y})})})}var Y9=j(m(),1);var x9={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function zB(Z){return $5({queryKey:D0.layout(Z),queryFn:()=>A1(`/api/workspaces/${Z}`),...x9})}function WB(Z){return $5({queryKey:D0.widgets(Z),queryFn:async()=>{return(await A1(`/api/workspaces/${Z}/widgets`)).widgets},...x9})}function KB(Z){return $5({queryKey:D0.views(Z),queryFn:async()=>{return(await A1(`/api/workspaces/${Z}/views`)).views},...x9})}function qB(Z){let J=Z1();return a1({mutationFn:($)=>n7(`/api/workspaces/${Z}`,R5("PUT",$),"Failed to save layout"),onSuccess:()=>{J.invalidateQueries({queryKey:D0.preview(Z)})}})}function zH(){return{open:["agent","widgets"],active:"agent"}}function VB(){return{version:1,widgetGrid:[],layoutMode:"fullscreen",tabs:zH()}}var LB=j(a(),1),BB=Y9.createContext(null);function R1(){let Z=Y9.useContext(BB);if(!Z)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return Z}function UB(Z){let{cwd:J,name:$,provider:X,agentId:Q,...Y}=Z;return Y}function FB({id:Z,children:J}){let $=Z1(),X=zB(Z),Q=qB(Z),Y=Y9.useRef(Q.mutate);Y.current=Q.mutate;let G=Y9.useRef(null),H=Y9.useCallback((W)=>{let K=D0.layout(Z),q=$.getQueryData(K);if(!q)return;let V={...q,...W};if($.setQueryData(K,V),G.current)clearTimeout(G.current);G.current=setTimeout(()=>{G.current=null,Y.current(UB(V))},600)},[Z,$]),z=Y9.useMemo(()=>({layout:X.data?UB(X.data):VB(),setLayout:H,name:X.data?.name??null,icon:X.data?.icon??null,cwd:X.data?.cwd??null,provider:X.data?.provider??null,workspaceId:Z,isLoading:X.isLoading}),[X.data,X.isLoading,H,Z]);return LB.jsx(BB,{value:z,children:J})}var y1=j(a(),1);function Fk(Z){if(Z==="needs-auth")return"Needs auth";return Z[0].toUpperCase()+Z.slice(1)}function Lk({status:Z}){return y1.jsx("span",{className:B0("size-[5px] shrink-0 rounded-full",Z==="connected"?"bg-emerald-500":"bg-yellow-500")})}function MB({name:Z,status:J,size:$="sm"}){let X=AB(Z),Q=$==="lg",Y="size-full rounded-sm ring-2 ring-background";return y1.jsxs("span",{className:B0("relative shrink-0",Q?"size-10":"size-5"),children:[X?y1.jsx("img",{src:X,alt:"",className:"size-full rounded-sm ring-2 ring-background"}):y1.jsx("span",{className:B0("flex size-full items-center justify-center bg-muted text-muted-foreground ring-2 ring-background",Q?"rounded-sm":"rounded"),children:y1.jsx(_B,{className:Q?"size-5":"size-4"})}),Q&&J!=="connected"&&y1.jsx(NB,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function KH(Z){return[...Z].sort((J,$)=>Number($.status==="connected")-Number(J.status==="connected"))}function Nk({server:Z}){return y1.jsxs("div",{className:"flex items-center gap-2.5 rounded-xs px-2 py-1 text-foreground hover:bg-accent hover:text-accent-foreground",children:[y1.jsx(MB,{name:Z.name,status:Z.status}),y1.jsx("span",{className:"flex-1 truncate text-sm",children:WH(Z.name)}),y1.jsx(Lk,{status:Z.status})]})}function DB({server:Z}){return y1.jsxs("div",{className:"flex min-h-20 items-center gap-3 rounded-xl border border-border bg-card px-4 py-3 text-card-foreground",children:[y1.jsx(MB,{name:Z.name,status:Z.status,size:"lg"}),y1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:[y1.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:WH(Z.name)}),y1.jsx("span",{className:"text-sm text-muted-foreground",children:Fk(Z.status)})]})]})}function _k({servers:Z}){return y1.jsx("div",{className:"no-scrollbar flex max-h-72 scroll-fade flex-col overflow-y-auto overscroll-contain [--scroll-fade-reveal:16px]",children:Z.map((J)=>y1.jsx(Nk,{server:J},J.name))})}function OB(){let Z=h5(),{provider:J,isLoading:$}=R1(),X=!$&&J!=="openclaw",{data:Q}=YV(Z,X);if(!X)return null;if(!Q||Q.length===0)return null;let Y=y1.jsx(I0,{variant:"ghost",size:"icon-sm","aria-label":"Connectors",title:"Connectors",children:y1.jsx(h6,{stroke:1.75})}),G=KH(Q);return y1.jsxs(YB,{children:[y1.jsx(GB,{render:Y,delay:0,closeDelay:100}),y1.jsxs(HB,{align:"end",sideOffset:6,className:"w-56 p-1",children:[y1.jsx("div",{className:"px-2 pt-1 pb-1.5 text-xs font-medium text-muted-foreground",children:"Project connectors"}),y1.jsx(_k,{servers:G})]})]})}function Ak(Z,J){let $=Z??[],X=$.findIndex((Q)=>Q.id===J.id||Q.path===J.path);if(X===-1)return[...$,J];return $.map((Q,Y)=>Y===X?{...Q,...J}:Q)}function O$(){return $5({queryKey:D0.all,queryFn:()=>A1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function w$(Z){return $5({queryKey:D0.preview(Z),queryFn:()=>A1(`/api/workspaces/${Z}/preview`),staleTime:60000})}function wB(){return $5({queryKey:D0.discover,queryFn:()=>A1("/api/workspaces/discover")})}function P$(){let Z=Z1();return a1({mutationFn:(J)=>A1("/api/workspaces",R5("POST",J),"Failed to add workspace"),onSuccess:(J,$)=>{Z.setQueryData(D0.all,(X)=>Ak(X,J)),Z.setQueryData(D0.discover,(X)=>(X??[]).filter((Q)=>Q.path!==$.path))}})}function PB(){return $5({queryKey:D0.createInfo,queryFn:()=>A1("/api/workspaces/create"),staleTime:1/0})}function jB(){return a1({mutationFn:()=>A1("/api/workspaces/choose-folder",{method:"POST"},"Failed to choose folder")})}function TB(){let Z=Z1();return a1({mutationFn:(J)=>A1("/api/workspaces/create",R5("POST",J),"Failed to create workspace"),onSuccess:(J)=>{Z.setQueryData(D0.all,($)=>[...$??[],J])}})}function CB(){let Z=Z1();return a1({mutationFn:(J)=>A1("/api/workspaces/order",R5("PUT",{ids:J}),"Failed to reorder spaces"),onMutate:async(J)=>{await Z.cancelQueries({queryKey:D0.all,exact:!0});let $=Z.getQueryData(D0.all);if($){let X=new Map($.map((Y)=>[Y.id,Y])),Q=J.map((Y)=>X.get(Y)).filter((Y)=>Boolean(Y));if(Q.length===$.length)Z.setQueryData(D0.all,Q)}return{previous:$}},onError:(J,$,X)=>{if(X?.previous)Z.setQueryData(D0.all,X.previous);Z.invalidateQueries({queryKey:D0.all,exact:!0})},onSuccess:(J)=>{Z.setQueryData(D0.all,J)}})}function SB(){let Z=Z1();return a1({mutationFn:(J)=>n7(`/api/workspaces/${J}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(J,$)=>{Z.setQueryData(D0.all,(X)=>(X??[]).filter((Q)=>Q.id!==$)),Z.invalidateQueries({queryKey:D0.discover})}})}var p3=j(m(),1);var G9={};t7(G9,{createHandle:()=>KF,Viewport:()=>GF,Trigger:()=>WF,Title:()=>zF,Root:()=>QF,Portal:()=>sB,Popup:()=>lB,Handle:()=>k$,Description:()=>bB,Close:()=>RB,Backdrop:()=>EB});var IB=j(m(),1);var j$=j(m(),1),qH=j$.createContext(void 0);function T5(Z){let J=j$.useContext(qH);if(Z===!1&&J===void 0)throw Error(w0(27));return J}var Mk={...Y1,...j1},EB=IB.forwardRef(function(J,$){let{render:X,className:Q,forceRender:Y=!1,...G}=J,{store:H}=T5(),z=H.useState("open"),W=H.useState("nested"),K=H.useState("mounted"),q=H.useState("transitionStatus");return K0("div",J,{state:{open:z,transitionStatus:q},ref:[H.context.backdropRef,$],stateAttributesMapping:Mk,props:[{role:"presentation",hidden:!K,style:{userSelect:"none",WebkitUserSelect:"none"}},G],enabled:Y||!W})});var kB=j(m(),1);var RB=kB.forwardRef(function(J,$){let{render:X,className:Q,disabled:Y=!1,nativeButton:G=!0,...H}=J,{store:z}=T5(),W=z.useState("open");function K(B){if(W)z.setOpen(!1,N0(n.closePress,B.nativeEvent))}let{getButtonProps:q,buttonRef:V}=v5({disabled:Y,native:G});return K0("button",J,{state:{disabled:Y},ref:[$,V],props:[{onClick:K},H,q]})});var yB=j(m(),1);var bB=yB.forwardRef(function(J,$){let{render:X,className:Q,id:Y,...G}=J,{store:H}=T5(),z=d0(Y);return H.useSyncedValueWithCleanup("descriptionElementId",z),K0("p",J,{ref:$,props:[{id:z},G]})});var cB=j(m(),1);var xB=function(Z){return Z.nestedDialogs="--nested-dialogs",Z}({});var hB=function(Z){return Z[Z.open=j7.open]="open",Z[Z.closed=j7.closed]="closed",Z[Z.startingStyle=j7.startingStyle]="startingStyle",Z[Z.endingStyle=j7.endingStyle]="endingStyle",Z.nested="data-nested",Z.nestedDialogOpen="data-nested-dialog-open",Z}({});var T$=j(m(),1),VH=T$.createContext(void 0);function C$(){let Z=T$.useContext(VH);if(Z===void 0)throw Error(w0(26));return Z}var vB="ArrowUp",gB="ArrowDown",mB="ArrowLeft",fB="ArrowRight",pB="Home",uB="End",Dk=new Set([mB,fB]);var Ok=new Set([vB,gB]);var wk=new Set([...Dk,...Ok]),w70=new Set([...wk,pB,uB]),v6=new Set([vB,gB,mB,fB,pB,uB]);var dB=j(a(),1),Pk={...Y1,...j1,nestedDialogOpen(Z){return Z?{[hB.nestedDialogOpen]:""}:null}},lB=cB.forwardRef(function(J,$){let{className:X,finalFocus:Q,initialFocus:Y,render:G,...H}=J,{store:z}=T5(),W=z.useState("descriptionElementId"),K=z.useState("disablePointerDismissal"),q=z.useState("floatingRootContext"),V=z.useState("popupProps"),U=z.useState("modal"),B=z.useState("mounted"),F=z.useState("nested"),N=z.useState("nestedOpenDialogCount"),L=z.useState("open"),_=z.useState("openMethod"),M=z.useState("titleElementId"),O=z.useState("transitionStatus"),D=z.useState("role");C$(),B5({open:L,ref:z.context.popupRef,onComplete(){if(L)z.context.onOpenChangeComplete?.(!0)}});function A(g){if(g==="touch")return z.context.popupRef.current;return!0}let T=Y===void 0?A:Y,S=N>0,P=K0("div",J,{state:{open:L,nested:F,transitionStatus:O,nestedDialogOpen:S},props:[V,{"aria-labelledby":M??void 0,"aria-describedby":W??void 0,role:D,tabIndex:-1,hidden:!B,onKeyDown(g){if(v6.has(g.key))g.stopPropagation()},style:{[xB.nestedDialogs]:N}},H],ref:[$,z.context.popupRef,z.useStateSetter("popupElement")],stateAttributesMapping:Pk});return dB.jsx(D4,{context:q,openInteractionType:_,disabled:!B,closeOnFocusOut:!K,initialFocus:T,returnFocus:Q,modal:U!==!1,restoreFocus:"popup",children:P})});var aB=j(m(),1);var iB=j(m(),1),rB=j(a(),1),g6=iB.forwardRef(function(J,$){let{cutout:X,...Q}=J,Y;if(X){let G=X?.getBoundingClientRect();Y=`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 rB.jsx("div",{ref:$,role:"presentation","data-base-ui-inert":"",...Q,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Y}})});var y3=j(a(),1),sB=aB.forwardRef(function(J,$){let{keepMounted:X=!1,...Q}=J,{store:Y}=T5(),G=Y.useState("mounted"),H=Y.useState("modal"),z=Y.useState("open");if(!(G||X))return null;return y3.jsx(VH.Provider,{value:X,children:y3.jsxs(M4,{ref:$,...Q,children:[G&&H===!0&&y3.jsx(g6,{ref:Y.context.internalBackdropRef,inert:R2(!z)}),J.children]})})});var $F=j(m(),1);var f7=j(m(),1);var nB={},oB={},tB="";function jk(Z){if(typeof document>"u")return!1;let J=u0(Z);return D7(J).innerWidth-J.documentElement.clientWidth>0}function Tk(Z){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let $=u0(Z),X=$.documentElement,Q=$.body,Y=S$(X)?X:Q,G=Y.style.overflowY,H=X.style.scrollbarGutter;X.style.scrollbarGutter="stable",Y.style.overflowY="scroll";let z=Y.offsetWidth;Y.style.overflowY="hidden";let W=Y.offsetWidth;return Y.style.overflowY=G,X.style.scrollbarGutter=H,z===W}function Ck(Z){let J=u0(Z),$=J.documentElement,X=J.body,Q=S$($)?$:X,Y={overflowY:Q.style.overflowY,overflowX:Q.style.overflowX};return Object.assign(Q.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(Q.style,Y)}}function Sk(Z){let J=u0(Z),$=J.documentElement,X=J.body,Q=D7($),Y=0,G=0,H=!1,z=h1.create();if(jJ&&(Q.visualViewport?.scale??1)!==1)return()=>{};function W(){let V=Q.getComputedStyle($),U=Q.getComputedStyle(X),N=(V.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";Y=$.scrollTop,G=$.scrollLeft,nB={scrollbarGutter:$.style.scrollbarGutter,overflowY:$.style.overflowY,overflowX:$.style.overflowX},tB=$.style.scrollBehavior,oB={position:X.style.position,height:X.style.height,width:X.style.width,boxSizing:X.style.boxSizing,overflowY:X.style.overflowY,overflowX:X.style.overflowX,scrollBehavior:X.style.scrollBehavior};let L=$.scrollHeight>$.clientHeight,_=$.scrollWidth>$.clientWidth,M=V.overflowY==="scroll"||U.overflowY==="scroll",O=V.overflowX==="scroll"||U.overflowX==="scroll",D=Math.max(0,Q.innerWidth-X.clientWidth),A=Math.max(0,Q.innerHeight-X.clientHeight),T=parseFloat(U.marginTop)+parseFloat(U.marginBottom),S=parseFloat(U.marginLeft)+parseFloat(U.marginRight),k=S$($)?$:X;if(H=Tk(Z),H){$.style.scrollbarGutter=N,k.style.overflowY="hidden",k.style.overflowX="hidden";return}if(Object.assign($.style,{scrollbarGutter:N,overflowY:"hidden",overflowX:"hidden"}),L||M)$.style.overflowY="scroll";if(_||O)$.style.overflowX="scroll";Object.assign(X.style,{position:"relative",height:T||A?`calc(100dvh - ${T+A}px)`:"100dvh",width:S||D?`calc(100vw - ${S+D}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),X.scrollTop=Y,X.scrollLeft=G,$.setAttribute("data-base-ui-scroll-locked",""),$.style.scrollBehavior="unset"}function K(){if(Object.assign($.style,nB),Object.assign(X.style,oB),!H)$.scrollTop=Y,$.scrollLeft=G,$.removeAttribute("data-base-ui-scroll-locked"),$.style.scrollBehavior=tB}function q(){K(),z.request(W)}return W(),Q.addEventListener("resize",q),()=>{if(z.cancel(),K(),typeof Q.removeEventListener==="function")Q.removeEventListener("resize",q)}}class eB{lockCount=0;restore=null;timeoutLock=y5.create();timeoutUnlock=y5.create();acquire(Z){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock(Z));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(Z){if(this.lockCount===0||this.restore!==null)return;let $=u0(Z).documentElement,X=D7($).getComputedStyle($).overflowY;if(X==="hidden"||X==="clip"){this.restore=P1;return}let Q=TJ||!jk(Z);this.restore=Q?Ck(Z):Sk(Z)}}var Ik=new eB;function m6(Z=!0,J=null){$0(()=>{if(!Z)return;return Ik.acquire(J)},[Z,J])}var f6=j(m(),1);var b3=j(m(),1);function ZF(Z){let J=b3.useRef(""),$=b3.useCallback((Q)=>{if(Q.defaultPrevented)return;J.current=Q.pointerType,Z(Q,Q.pointerType)},[Z]);return{onClick:b3.useCallback((Q)=>{if(Q.detail===0){Z(Q,"keyboard");return}if("pointerType"in Q)Z(Q,Q.pointerType);else Z(Q,J.current);J.current=""},[Z]),onPointerDown:$}}function p6(Z){let[J,$]=f6.useState(null),X=Y0((H,z)=>{if(!Z)$(z||(TJ?"touch":""))}),Q=f6.useCallback(()=>{$(null)},[]),{onClick:Y,onPointerDown:G}=ZF(X);return f6.useMemo(()=>({openMethod:J,reset:Q,triggerProps:{onClick:Y,onPointerDown:G}}),[J,Q,Y,G])}function JF(Z){let{store:J,parentContext:$,actionsRef:X}=Z,Q=J.useState("open"),Y=J.useState("disablePointerDismissal"),G=J.useState("modal"),H=J.useState("popupElement"),{openMethod:z,triggerProps:W,reset:K}=p6(Q);I9(J);let{forceUnmount:q}=E9(Q,J,()=>{K()}),V=Y0((P)=>{let g=N0(P);return g.preventUnmountOnClose=()=>{J.set("preventUnmountingOnClose",!0)},g}),U=f7.useCallback(()=>{J.setOpen(!1,V(n.imperativeAction))},[J,V]);f7.useImperativeHandle(X,()=>({unmount:q,close:U}),[q,U]);let B=$9({popupStore:J,onOpenChange:J.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[F,N]=f7.useState(0),L=F===0,_=C4(B),M=J9(B,{outsidePressEvent(){if(J.context.internalBackdropRef.current||J.context.backdropRef.current)return"intentional";return{mouse:G==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(P){if(!J.context.outsidePressEnabledRef.current)return!1;if("button"in P&&P.button!==0)return!1;if("touches"in P&&P.touches.length!==1)return!1;let g=k1(P);if(L&&!Y){let C=g;if(G)return J.context.internalBackdropRef.current||J.context.backdropRef.current?J.context.internalBackdropRef.current===C||J.context.backdropRef.current===C||k0(C,H)&&!C?.hasAttribute("data-base-ui-portal"):!0;return!0}return!1},escapeKey:L});m6(Q&&G===!0,H);let{getReferenceProps:O,getFloatingProps:D,getTriggerProps:A}=M5([_,M]);J.useContextCallback("onNestedDialogOpen",(P)=>{N(P+1)}),J.useContextCallback("onNestedDialogClose",()=>{N(0)}),f7.useEffect(()=>{if($?.onNestedDialogOpen&&Q)$.onNestedDialogOpen(F);if($?.onNestedDialogClose&&!Q)$.onNestedDialogClose();return()=>{if($?.onNestedDialogClose&&Q)$.onNestedDialogClose()}},[Q,$,F]);let T=f7.useMemo(()=>O(W),[O,W]),S=f7.useMemo(()=>A(W),[A,W]),k=f7.useMemo(()=>D(),[D]);J.useSyncedValues({openMethod:z,activeTriggerProps:T,inactiveTriggerProps:S,popupProps:k,floatingRootContext:B,nestedOpenDialogCount:F})}var I$=j(m(),1);var Ek={...R9,modal:P0((Z)=>Z.modal),nested:P0((Z)=>Z.nested),nestedOpenDialogCount:P0((Z)=>Z.nestedOpenDialogCount),disablePointerDismissal:P0((Z)=>Z.disablePointerDismissal),openMethod:P0((Z)=>Z.openMethod),descriptionElementId:P0((Z)=>Z.descriptionElementId),titleElementId:P0((Z)=>Z.titleElementId),viewportElement:P0((Z)=>Z.viewportElement),role:P0((Z)=>Z.role)};class x3 extends P7{constructor(Z){super(kk(Z),{popupRef:I$.createRef(),backdropRef:I$.createRef(),internalBackdropRef:I$.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Q7,onOpenChange:void 0,onOpenChangeComplete:void 0},Ek)}setOpen=(Z,J)=>{if(J.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!Z&&J.trigger==null&&this.state.activeTriggerId!=null)J.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.(Z,J),J.isCanceled)return;let $={open:Z,nativeEvent:J.event,reason:J.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",$);let X={open:Z},Q=J.trigger?.id??null;if(Q||Z)X.activeTriggerId=Q,X.activeTriggerElement=J.trigger??null;this.update(X)}}function kk(Z={}){return{...k9(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...Z}}var XF=j(a(),1);function QF(Z){let{children:J,open:$,defaultOpen:X=!1,onOpenChange:Q,onOpenChangeComplete:Y,disablePointerDismissal:G=!1,modal:H=!0,actionsRef:z,handle:W,triggerId:K,defaultTriggerId:q=null}=Z,V=T5(!0),U=Boolean(V),B=K1(()=>{return W?.store??new x3({open:X,openProp:$,activeTriggerId:q,triggerIdProp:K,modal:H,disablePointerDismissal:G,nested:U})}).current;D9(()=>{if($===void 0&&B.state.open===!1&&X===!0)B.update({open:!0,activeTriggerId:q})}),B.useControlledProp("openProp",$),B.useControlledProp("triggerIdProp",K),B.useSyncedValues({disablePointerDismissal:G,nested:U,modal:H}),B.useContextCallback("onOpenChange",Q),B.useContextCallback("onOpenChangeComplete",Y);let F=B.useState("payload");JF({store:B,actionsRef:z,parentContext:V?.store.context,onOpenChange:Q,triggerIdProp:K});let N=$F.useMemo(()=>({store:B}),[B]);return XF.jsx(qH.Provider,{value:N,children:typeof J==="function"?J({payload:F}):J})}var YF=j(m(),1);var UH=function(Z){return Z[Z.open=j7.open]="open",Z[Z.closed=j7.closed]="closed",Z[Z.startingStyle=j7.startingStyle]="startingStyle",Z[Z.endingStyle=j7.endingStyle]="endingStyle",Z.nested="data-nested",Z.nestedDialogOpen="data-nested-dialog-open",Z}({});var Rk={...Y1,...j1,nested(Z){return Z?{[UH.nested]:""}:null},nestedDialogOpen(Z){return Z?{[UH.nestedDialogOpen]:""}:null}},GF=YF.forwardRef(function(J,$){let{className:X,render:Q,children:Y,...G}=J,H=C$(),{store:z}=T5(),W=z.useState("open"),K=z.useState("nested"),q=z.useState("transitionStatus"),V=z.useState("nestedOpenDialogCount"),U=z.useState("mounted"),B=V>0;return K0("div",J,{enabled:H||U,state:{open:W,nested:K,transitionStatus:q,nestedDialogOpen:B},ref:[$,z.useStateSetter("viewportElement")],stateAttributesMapping:Rk,props:[{role:"presentation",hidden:!U,style:{pointerEvents:!W?"none":void 0},children:Y},G]})});var HF=j(m(),1);var zF=HF.forwardRef(function(J,$){let{render:X,className:Q,id:Y,...G}=J,{store:H}=T5(),z=d0(Y);return H.useSyncedValueWithCleanup("titleElementId",z),K0("h2",J,{ref:$,props:[{id:z},G]})});var E$=j(m(),1);var WF=E$.forwardRef(function(J,$){let{render:X,className:Q,disabled:Y=!1,nativeButton:G=!0,id:H,payload:z,handle:W,...K}=J,q=T5(!0),V=W?.store??q?.store;if(!V)throw Error(w0(79));let U=d0(H),B=V.useState("floatingRootContext"),F=V.useState("isOpenedByTrigger",U),N=E$.useRef(null),{registerTrigger:L,isMountedByThisTrigger:_}=S9(U,N,V,{payload:z}),{getButtonProps:M,buttonRef:O}=v5({disabled:Y,native:G}),D=$2(B,{enabled:B!=null}),A=M5([D]),T={disabled:Y,open:F},S=V.useState("triggerProps",_);return K0("button",J,{state:T,ref:[O,$,L,N],props:[A.getReferenceProps(),S,{[C6]:"",id:U},K,M],stateAttributesMapping:b9})});class k${constructor(Z){this.store=Z??new x3}open(Z){let J=Z?this.store.context.triggerElements.getById(Z):void 0;this.store.setOpen(!0,N0(n.imperativeAction,void 0,J))}openWithPayload(Z){this.store.set("payload",Z),this.store.setOpen(!0,N0(n.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,N0(n.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function KF(){return new k$}var h9=j(a(),1);function R$({...Z}){return h9.jsx(G9.Root,{"data-slot":"dialog",...Z})}function qF({...Z}){return h9.jsx(G9.Trigger,{"data-slot":"dialog-trigger",...Z})}function y$({...Z}){return h9.jsx(G9.Close,{"data-slot":"dialog-close",...Z})}function b$({className:Z,children:J,...$}){return h9.jsxs(G9.Portal,{children:[h9.jsx(G9.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"}),h9.jsx(G9.Popup,{"data-slot":"dialog-content",className:B0("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 ring-1 ring-border 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",Z),...$,children:J})]})}function h3({className:Z,...J}){return h9.jsx(G9.Title,{"data-slot":"dialog-title",className:B0("text-lg font-semibold",Z),...J})}function BH({className:Z,...J}){return h9.jsx(G9.Description,{"data-slot":"dialog-description",className:B0("text-sm text-muted-foreground",Z),...J})}var CF=j(m(),1);var r$={};t7(r$,{Validity:()=>wF,Root:()=>FF,Label:()=>LF,Item:()=>TF,Error:()=>NF,Description:()=>AF,Control:()=>DF});var S5=j(m(),1);var x$=j(m(),1);var FH=function(Z){return Z.disabled="data-disabled",Z.valid="data-valid",Z.invalid="data-invalid",Z.touched="data-touched",Z.dirty="data-dirty",Z.filled="data-filled",Z.focused="data-focused",Z}({});var E4={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},B7={valid(Z){if(Z===null)return null;if(Z)return{[FH.valid]:""};return{[FH.invalid]:""}}};var LH=x$.createContext({invalid:void 0,name:void 0,validityData:{state:E4,errors:[],error:"",value:"",initialValue:null},setValidityData:P1,disabled:void 0,touched:!1,setTouched:P1,dirty:!1,setDirty:P1,filled:!1,setFilled:P1,focused:!1,setFocused:P1,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:(Z=N1)=>Z,getInputValidationProps:(Z=N1)=>Z,inputRef:{current:null},commit:async()=>{}}});function C5(Z=!0){let J=x$.useContext(LH);if(J.setValidityData===P1&&!Z)throw Error(w0(28));return J}var h$=j(m(),1),yk=h$.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function VF(Z=!1){let J=h$.useContext(yk);if(!J&&!Z)throw Error(w0(86));return J}var v$=j(m(),1);var bk=v$.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:P1,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function v9(){return v$.useContext(bk)}var b2=j(m(),1);var g$=j(m(),1);var NH=g$.createContext({controlId:void 0,registerControlId:P1,labelId:void 0,setLabelId:P1,messageIds:[],setMessageIds:P1,getDescriptionProps:(Z)=>Z});function r5(){return g$.useContext(NH)}var UF=j(a(),1),m$=function(J){let $=d0(),[X,Q]=b2.useState(J.initialControlId===void 0?$:J.initialControlId),[Y,G]=b2.useState(void 0),[H,z]=b2.useState([]),W=K1(()=>new Map),{messageIds:K}=r5(),q=Y0((B,F)=>{let N=W.current;if(F===void 0){N.delete(B);return}N.set(B,F),Q((L)=>{if(N.size===0)return;let _;for(let M of N.values()){if(L!==void 0&&M===L)return L;if(_===void 0)_=M}return _})}),V=b2.useCallback((B)=>{return p7({"aria-describedby":K.concat(H).join(" ")||void 0},B)},[K,H]),U=b2.useMemo(()=>({controlId:X,registerControlId:q,labelId:Y,setLabelId:G,messageIds:H,setMessageIds:z,getDescriptionProps:V}),[X,q,Y,G,H,z,V]);return UF.jsx(NH.Provider,{value:U,children:J.children})};var R4=j(m(),1);function k4(Z,J){return{...Z,state:{...Z.state,valid:!J&&Z.state.valid}}}var f$=Object.keys(E4);function xk(Z){if(!Z||Z.valid||!Z.valueMissing)return!1;let J=!1;for(let $ of f$){if($==="valid")continue;if($==="valueMissing")J=Z[$];if(Z[$])J=!1}return J}function BF(Z){let{formRef:J,clearErrors:$}=v9(),{setValidityData:X,validate:Q,validityData:Y,validationDebounceTime:G,invalid:H,markedDirtyRef:z,state:W,name:K,shouldValidateOnChange:q}=Z,{controlId:V,getDescriptionProps:U}=r5(),B=X5(),F=R4.useRef(null),N=Y0(async(M,O=!1)=>{let D=F.current;if(!D)return;if(O){if(W.valid!==!1)return;let I=D.validity;if(!I.valueMissing){let b={value:M,state:{...E4,valid:!0},error:"",errors:[],initialValue:Y.initialValue};if(D.setCustomValidity(""),V){let R=J.current.fields.get(V);if(R)J.current.fields.set(V,{...R,...k4(b,!1)})}X(b);return}let y=f$.reduce((b,R)=>{return b[R]=I[R],b},{});if(!y.valid&&!xk(y))return}function A(I){let y=f$.reduce((R,x)=>{return R[x]=I.validity[x],R},{}),b=!1;for(let R of f$){if(R==="valid")continue;if(R==="valueMissing"&&y[R])b=!0;else if(y[R])return y}if(b&&!z.current)y.valid=!0,y.valueMissing=!1;return y}B.clear();let T=null,S=[],k=A(D),P,g=q();if(D.validationMessage&&!g)P=D.validationMessage,S=[D.validationMessage];else{let I=Array.from(J.current.fields.values()).reduce((b,R)=>{if(R.name)b[R.name]=R.getValue();return b},{}),y=Q(M,I);if(typeof y==="object"&&y!==null&&"then"in y)T=await y;else T=y;if(T!==null){if(k.valid=!1,k.customError=!0,Array.isArray(T))S=T,D.setCustomValidity(T.join(`
|
|
21
|
-
`));else if(T)S=[T],D.setCustomValidity(T)}else if(g){if(D.setCustomValidity(""),k.customError=!1,D.validationMessage)P=D.validationMessage,S=[D.validationMessage];else if(D.validity.valid&&!k.valid)k.valid=!0}}let C={value:M,state:k,error:P??(Array.isArray(T)?T[0]:T??""),errors:S,initialValue:Y.initialValue};if(V){let I=J.current.fields.get(V);if(I)J.current.fields.set(V,{...I,...k4(C,H)})}X(C)}),L=R4.useCallback((M={})=>p7(U,W.valid===!1?{"aria-invalid":!0}:N1,M),[U,W.valid]),_=R4.useCallback((M={})=>p7({onChange(O){if(O.nativeEvent.defaultPrevented)return;if($(K),!q()){N(O.currentTarget.value,!0);return}if(H)return;let D=O.currentTarget;if(D.value===""){N(D.value);return}if(B.clear(),G)B.start(G,()=>{N(D.value)});else N(D.value)}},L(M)),[L,$,K,B,N,H,G,q]);return R4.useMemo(()=>({getValidationProps:L,getInputValidationProps:_,inputRef:F,commit:N}),[L,_,N])}var p$=j(a(),1),hk=S5.forwardRef(function(J,$){let{errors:X,validationMode:Q,submitAttemptedRef:Y}=v9(),{render:G,className:H,validate:z,validationDebounceTime:W=0,validationMode:K=Q,name:q,disabled:V=!1,invalid:U,dirty:B,touched:F,actionsRef:N,...L}=J,{disabled:_}=VF(),M=Y0(z||(()=>null)),O=_||V,[D,A]=S5.useState(!1),[T,S]=S5.useState(!1),[k,P]=S5.useState(!1),[g,C]=S5.useState(!1),I=B??T,y=F??D,b=S5.useRef(!1),R=Y0((q0)=>{if(B!==void 0)return;if(q0)b.current=!0;S(q0)}),x=Y0((q0)=>{if(F!==void 0)return;A(q0)}),v=Y0(()=>K==="onChange"||K==="onSubmit"&&Y.current),d=Boolean(U||q&&{}.hasOwnProperty.call(X,q)&&X[q]!==void 0),[w,z0]=S5.useState({state:E4,error:"",errors:[],value:null,initialValue:null}),G0=!d&&w.state.valid,E=S5.useMemo(()=>({disabled:O,touched:y,dirty:I,valid:G0,filled:k,focused:g}),[O,y,I,G0,k,g]),s=BF({setValidityData:z0,validate:M,validityData:w,validationDebounceTime:W,invalid:d,markedDirtyRef:b,state:E,name:q,shouldValidateOnChange:v}),A0=S5.useCallback(()=>{b.current=!0,s.commit(w.value)},[s,w]);S5.useImperativeHandle(N,()=>({validate:A0}),[A0]);let l=S5.useMemo(()=>({invalid:d,name:q,validityData:w,setValidityData:z0,disabled:O,touched:y,setTouched:x,dirty:I,setDirty:R,filled:k,setFilled:P,focused:g,setFocused:C,validate:M,validationMode:K,validationDebounceTime:W,shouldValidateOnChange:v,state:E,markedDirtyRef:b,validation:s}),[d,q,w,O,y,x,I,R,k,P,g,C,M,K,W,v,E,s]),H0=K0("div",J,{ref:$,state:E,props:L,stateAttributesMapping:B7});return p$.jsx(LH.Provider,{value:l,children:H0})}),FF=S5.forwardRef(function(J,$){return p$.jsx(m$,{children:p$.jsx(hk,{...J,ref:$})})});var v3=j(m(),1);var LF=v3.forwardRef(function(J,$){let{render:X,className:Q,id:Y,nativeLabel:G=!0,...H}=J,z=C5(!1),{controlId:W,setLabelId:K,labelId:q}=r5(),V=d0(Y),U=v3.useRef(null),B=Y0((N)=>{if(k1(N.nativeEvent)?.closest("button,input,select,textarea"))return;if(!N.defaultPrevented&&N.detail>1)N.preventDefault();if(G||!W)return;let _=u0(N.currentTarget).getElementById(W);if(u1(_))_.focus({focusVisible:!0})});return $0(()=>{if(V)K(V);return()=>{K(void 0)}},[V,K]),K0("label",J,{ref:[$,U],state:z.state,props:[{id:q},G?{htmlFor:W??void 0,onMouseDown:B}:{onClick:B,onPointerDown(N){N.preventDefault()}},H],stateAttributesMapping:B7})});var y4=j(m(),1);var _H=j(a(),1),vk={...B7,...j1},NF=y4.forwardRef(function(J,$){let{render:X,id:Q,className:Y,match:G,...H}=J,z=d0(Q),{validityData:W,state:K,name:q}=C5(!1),{setMessageIds:V}=r5(),{errors:U}=v9(),B=q?U[q]:null,F=!1;if(B||G===!0)F=!0;else if(G)F=Boolean(W.state[G]);else F=W.state.valid===!1;let{mounted:N,transitionStatus:L,setMounted:_}=m7(F);$0(()=>{if(!F||!z)return;return V((C)=>C.concat(z)),()=>{V((C)=>C.filter((I)=>I!==z))}},[F,z,V]);let M=y4.useRef(null),[O,D]=y4.useState(null),[A,T]=y4.useState(null),S=B||(W.errors.length>1?_H.jsx("ul",{children:W.errors.map((C)=>_H.jsx("li",{children:C},C))}):W.error),k=W.error;if(B!=null)k=Array.isArray(B)?JSON.stringify(B):B;else if(W.errors.length>1)k=JSON.stringify(W.errors);if(F&&k!==A)T(k),D(S);B5({open:F,ref:M,onComplete(){if(!F)_(!1)}});let P={...K,transitionStatus:L},g=K0("div",J,{ref:[$,M],state:P,props:[{id:z,children:F?S:O},H],stateAttributesMapping:vk,enabled:N});if(!N)return null;return g});var _F=j(m(),1);var AF=_F.forwardRef(function(J,$){let{render:X,id:Q,className:Y,...G}=J,H=d0(Q),z=C5(!1),{setMessageIds:W}=r5();return $0(()=>{if(!H)return;return W((q)=>q.concat(H)),()=>{W((q)=>q.filter((V)=>V!==H))}},[H,W]),K0("p",J,{ref:$,state:z.state,props:[{id:H},G],stateAttributesMapping:B7})});var d$=j(m(),1);var b4=j(m(),1);function g9({controlled:Z,default:J,name:$,state:X="value"}){let{current:Q}=b4.useRef(Z!==void 0),[Y,G]=b4.useState(J),H=Q?Z:Y,z=b4.useCallback((W)=>{if(!Q)G(W)},[]);return[H,z]}var g3=j(m(),1);function u$(Z={}){let{id:J,implicit:$=!1,controlRef:X}=Z,{controlId:Q,registerControlId:Y}=r5(),G=d0(J),H=$?Q:void 0,z=K1(()=>Symbol("labelable-control")),W=g3.useRef(!1),K=g3.useRef(J!=null),q=Y0(()=>{if(!W.current||Y===P1)return;W.current=!1,Y(z.current,void 0)});return $0(()=>{if(Y===P1)return;let V;if($){let U=X?.current;if(L1(U)&&U.closest("label")!=null)V=J??null;else V=H??G}else if(J!=null)K.current=!0,V=J;else if(K.current)V=G;else{q();return}if(V===void 0){q();return}W.current=!0,Y(z.current,V);return},[J,X,H,Y,$,G,z,q]),g3.useEffect(()=>{return q},[q]),Q??G}var MF=j(w7(),1);function c$(Z){let{enabled:J=!0,value:$,id:X,name:Q,controlRef:Y,commit:G}=Z,{formRef:H}=v9(),{invalid:z,markedDirtyRef:W,validityData:K,setValidityData:q}=C5(),V=Y0(Z.getValue);$0(()=>{if(!J)return;let U=$;if(U===void 0)U=V();if(K.initialValue===null&&U!==null)q((B)=>({...B,initialValue:U}))},[J,q,$,K.initialValue,V]),$0(()=>{if(!J||!X)return;H.current.fields.set(X,{getValue:V,name:Q,controlRef:Y,validityData:k4(K,z),validate(U=!0){let B=$;if(B===void 0)B=V();if(W.current=!0,!U)G(B);else MF.flushSync(()=>G(B))}})},[G,Y,J,H,V,X,z,W,Q,K,$]),$0(()=>{let U=H.current.fields;return()=>{if(X)U.delete(X)}},[H,X])}var DF=d$.forwardRef(function(J,$){let{render:X,className:Q,id:Y,name:G,value:H,disabled:z=!1,onValueChange:W,defaultValue:K,autoFocus:q=!1,...V}=J,{state:U,name:B,disabled:F,setTouched:N,setDirty:L,validityData:_,setFocused:M,setFilled:O,validationMode:D,validation:A}=C5(),T=F||z,S=B??G,k={...U,disabled:T},{labelId:P}=r5(),g=u$({id:Y});$0(()=>{let x=H!=null;if(A.inputRef.current?.value||x&&H!=="")O(!0);else if(x&&H==="")O(!1)},[A.inputRef,O,H]);let C=d$.useRef(null);$0(()=>{if(q&&C.current===b5(u0(C.current)))M(!0)},[q,M]);let[I]=g9({controlled:H,default:K,name:"FieldControl",state:"value"}),y=H!==void 0,b=y?I:void 0;return c$({id:g,name:S,commit:A.commit,value:b,getValue:()=>A.inputRef.current?.value,controlRef:A.inputRef}),K0("input",J,{ref:[$,C],state:k,props:[{id:g,disabled:T,name:S,ref:A.inputRef,"aria-labelledby":P,autoFocus:q,...y?{value:b}:{defaultValue:K},onChange(x){let v=x.currentTarget.value;W?.(v,N0(n.none,x.nativeEvent)),L(v!==_.initialValue),O(v!=="")},onFocus(){M(!0)},onBlur(x){if(N(!0),M(!1),D==="onBlur")A.commit(x.currentTarget.value)},onKeyDown(x){if(x.currentTarget.tagName==="INPUT"&&x.key==="Enter")N(!0),A.commit(x.currentTarget.value)}},A.getInputValidationProps(),V],stateAttributesMapping:B7})});var m3=j(m(),1);var OF=j(a(),1),wF=function(J){let{children:$}=J,{validityData:X,invalid:Q}=C5(!1),Y=m3.useMemo(()=>k4(X,Q),[X,Q]),G=Y.state.valid===!1,{transitionStatus:H}=m7(G),z=m3.useMemo(()=>{return{...Y,validity:Y.state,transitionStatus:H}},[Y,H]);return OF.jsx(m3.Fragment,{children:$(z)})};var i$=j(m(),1);var AH=j(m(),1),PF=AH.createContext({disabled:!1});var l$=j(m(),1),gk=l$.createContext(void 0);function jF(Z=!0){let J=l$.useContext(gk);if(J===void 0&&!Z)throw Error(w0(3));return J}var MH=j(a(),1),TF=i$.forwardRef(function(J,$){let{render:X,className:Q,disabled:Y=!1,...G}=J,{state:H,disabled:z}=C5(!1),W=z||Y,K=jF(),q=K?.parent.id,U=K?.allValues!==void 0?q:void 0,B=i$.useMemo(()=>({disabled:W}),[W]),F=K0("div",J,{ref:$,state:H,props:G,stateAttributesMapping:B7});return MH.jsx(m$,{initialControlId:U,children:MH.jsx(PF.Provider,{value:B,children:F})})});var SF=j(a(),1),DH=CF.forwardRef(function(J,$){return SF.jsx(r$.Control,{ref:$,...J})});var IF=j(a(),1);function x2({className:Z,type:J,...$}){return IF.jsx(DH,{type:J,"data-slot":"input",className:B0("h-8 w-full min-w-0 rounded-sm 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",Z),...$})}var Q2={};t7(Q2,{createHandle:()=>tF,Viewport:()=>oF,Trigger:()=>gF,Root:()=>yF,Provider:()=>aF,Positioner:()=>cF,Portal:()=>pF,Popup:()=>lF,Handle:()=>t$,Arrow:()=>rF});var m9=j(m(),1);var a$=j(m(),1),OH=a$.createContext(void 0);function u7(Z){let J=a$.useContext(OH);if(J===void 0&&!Z)throw Error(w0(72));return J}var EF=j(m(),1),kF=j(w7(),1);var mk={...R9,disabled:P0((Z)=>Z.disabled),instantType:P0((Z)=>Z.instantType),isInstantPhase:P0((Z)=>Z.isInstantPhase),trackCursorAxis:P0((Z)=>Z.trackCursorAxis),disableHoverablePopup:P0((Z)=>Z.disableHoverablePopup),lastOpenChangeReason:P0((Z)=>Z.openChangeReason),closeDelay:P0((Z)=>Z.closeDelay),hasViewport:P0((Z)=>Z.hasViewport)};class u6 extends P7{constructor(Z){super({...fk(),...Z},{popupRef:EF.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Q7},mk)}setOpen=(Z,J)=>{let $=J.reason,X=$===n.triggerHover,Q=Z&&$===n.triggerFocus,Y=!Z&&($===n.triggerPress||$===n.escapeKey);if(J.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(Z,J),J.isCanceled)return;let G=()=>{let H={open:Z,openChangeReason:$};if(Q)H.instantType="focus";else if(Y)H.instantType="dismiss";else if($===n.triggerHover)H.instantType=void 0;let z=J.trigger?.id??null;if(z||Z)H.activeTriggerId=z,H.activeTriggerElement=J.trigger??null;this.update(H)};if(X)kF.flushSync(G);else G()};static useStore(Z,J){let $=K1(()=>{return new u6(J)}).current,X=Z??$,Q=$9({popupStore:X,onOpenChange:X.setOpen});return X.state.floatingRootContext=Q,X}}function fk(){return{...k9(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}var RF=j(a(),1),yF=w3(function(J){let{disabled:$=!1,defaultOpen:X=!1,open:Q,disableHoverablePopup:Y=!1,trackCursorAxis:G="none",actionsRef:H,onOpenChange:z,onOpenChangeComplete:W,handle:K,triggerId:q,defaultTriggerId:V=null,children:U}=J,B=u6.useStore(K?.store,{open:X,openProp:Q,activeTriggerId:V,triggerIdProp:q});D9(()=>{if(Q===void 0&&B.state.open===!1&&X===!0)B.update({open:!0,activeTriggerId:V})}),B.useControlledProp("openProp",Q),B.useControlledProp("triggerIdProp",q),B.useContextCallback("onOpenChange",z),B.useContextCallback("onOpenChangeComplete",W);let F=B.useState("open"),N=!$&&F,L=B.useState("activeTriggerId"),_=B.useState("payload");B.useSyncedValues({trackCursorAxis:G,disableHoverablePopup:Y}),$0(()=>{if(F&&$)B.setOpen(!1,N0(n.disabled))},[F,$,B]),B.useSyncedValue("disabled",$),I9(B);let{forceUnmount:M,transitionStatus:O}=E9(N,B),D=B.useState("isInstantPhase"),A=B.useState("instantType"),T=B.useState("lastOpenChangeReason"),S=m9.useRef(null);$0(()=>{if(O==="ending"&&T===n.none||O!=="ending"&&D){if(A!=="delay")S.current=A;B.set("instantType","delay")}else if(S.current!==null)B.set("instantType",S.current),S.current=null},[O,D,T,A,B]),$0(()=>{if(N){if(L==null)B.set("payload",void 0)}},[B,L,N]);let k=m9.useCallback(()=>{B.setOpen(!1,pk(B,n.imperativeAction))},[B]);m9.useImperativeHandle(H,()=>({unmount:M,close:k}),[M,k]);let P=B.useState("floatingRootContext"),g=J9(P,{enabled:!$,referencePress:!0}),C=RG(P,{enabled:!$&&G!=="none",axis:G==="none"?void 0:G}),{getReferenceProps:I,getFloatingProps:y,getTriggerProps:b}=M5([g,C]),R=m9.useMemo(()=>I(),[I]),x=m9.useMemo(()=>b(),[b]),v=m9.useMemo(()=>y(),[y]);return B.useSyncedValues({activeTriggerProps:R,inactiveTriggerProps:x,popupProps:v}),RF.jsx(OH.Provider,{value:B,children:typeof U==="function"?U({payload:_}):U})});function pk(Z,J){let $=N0(J);return $.preventUnmountOnClose=()=>{Z.set("preventUnmountingOnClose",!0)},$}var vF=j(m(),1);var s$=j(m(),1),wH=s$.createContext(void 0);function bF(){return s$.useContext(wH)}var xF=function(Z){return Z[Z.popupOpen=C3.popupOpen]="popupOpen",Z.triggerDisabled="data-trigger-disabled",Z}({});var hF=600;var gF=$$(function(J,$){let{className:X,render:Q,handle:Y,payload:G,disabled:H,delay:z,closeDelay:W,id:K,...q}=J,V=u7(!0),U=Y?.store??V;if(!U)throw Error(w0(82));let B=d0(K),F=U.useState("isTriggerActive",B),N=U.useState("isOpenedByTrigger",B),L=U.useState("floatingRootContext"),_=vF.useRef(null),M=z??hF,O=W??0,{registerTrigger:D,isMountedByThisTrigger:A}=S9(B,_,U,{payload:G,closeDelay:O}),T=bF(),{delayRef:S,isInstantPhase:k,hasProvider:P}=TG(L,{open:N});U.useSyncedValue("isInstantPhase",k);let g=U.useState("disabled"),C=H??g,I=U.useState("trackCursorAxis"),y=U.useState("disableHoverablePopup"),b=X9(L,{enabled:!C,mouseOnly:!0,move:!1,handleClose:!y&&I!=="both"?Q9():null,restMs(){let w=T?.delay,z0=typeof S.current==="object"?S.current.open:void 0,G0=M;if(P)if(z0!==0)G0=z??w??M;else G0=0;return G0},delay(){let w=typeof S.current==="object"?S.current.close:void 0,z0=O;if(W==null&&P)z0=w;return{close:z0}},triggerElementRef:_,isActiveTrigger:F}),R=P4(L,{enabled:!C}).reference,x={open:N},v=U.useState("triggerProps",A);return K0("button",J,{state:x,ref:[$,D,_],props:[b,R,v,{id:B,[xF.triggerDisabled]:C?"":void 0},q],stateAttributesMapping:b9})});var fF=j(m(),1);var n$=j(m(),1),PH=n$.createContext(void 0);function mF(){let Z=n$.useContext(PH);if(Z===void 0)throw Error(w0(70));return Z}var jH=j(a(),1),pF=fF.forwardRef(function(J,$){let{keepMounted:X=!1,...Q}=J;if(!(u7().useState("mounted")||X))return null;return jH.jsx(PH.Provider,{value:X,children:jH.jsx(F$,{ref:$,...Q})})});var d6=j(m(),1);var o$=j(m(),1),TH=o$.createContext(void 0);function c6(){let Z=o$.useContext(TH);if(Z===void 0)throw Error(w0(71));return Z}var uF=j(a(),1),cF=d6.forwardRef(function(J,$){let{render:X,className:Q,anchor:Y,positionMethod:G="absolute",side:H="top",align:z="center",sideOffset:W=0,alignOffset:K=0,collisionBoundary:q="clipping-ancestors",collisionPadding:V=5,arrowPadding:U=5,sticky:B=!1,disableAnchorTracking:F=!1,collisionAvoidance:N=k2,...L}=J,_=u7(),M=mF(),O=_.useState("open"),D=_.useState("mounted"),A=_.useState("trackCursorAxis"),T=_.useState("disableHoverablePopup"),S=_.useState("floatingRootContext"),k=_.useState("instantType"),P=_.useState("transitionStatus"),g=_.useState("hasViewport"),C=E2({anchor:Y,positionMethod:G,floatingRootContext:S,mounted:D,side:H,sideOffset:W,align:z,alignOffset:K,collisionBoundary:q,collisionPadding:V,sticky:B,arrowPadding:U,disableAnchorTracking:F,keepMounted:M,collisionAvoidance:N,adaptiveOrigin:g?R6:void 0}),I=d6.useMemo(()=>{let x={};if(!O||A==="both"||T)x.pointerEvents="none";return{role:"presentation",hidden:!D,style:{...C.positionerStyles,...x}}},[O,A,T,D,C.positionerStyles]),y=d6.useMemo(()=>({open:O,side:C.side,align:C.align,anchorHidden:C.anchorHidden,instant:A!=="none"?"tracking-cursor":k}),[O,C.side,C.align,C.anchorHidden,A,k]),b=d6.useMemo(()=>({...y,arrowRef:C.arrowRef,arrowStyles:C.arrowStyles,arrowUncentered:C.arrowUncentered}),[y,C.arrowRef,C.arrowStyles,C.arrowUncentered]),R=K0("div",J,{state:y,props:[I,l5(P),L],ref:[$,_.useStateSetter("positionerElement")],stateAttributesMapping:Y1});return uF.jsx(TH.Provider,{value:b,children:R})});var dF=j(m(),1);var uk={...Y1,...j1},lF=dF.forwardRef(function(J,$){let{className:X,render:Q,...Y}=J,G=u7(),{side:H,align:z}=c6(),W=G.useState("open"),K=G.useState("instantType"),q=G.useState("transitionStatus"),V=G.useState("popupProps"),U=G.useState("floatingRootContext");B5({open:W,ref:G.context.popupRef,onComplete(){if(W)G.context.onOpenChangeComplete?.(!0)}});let B=G.useState("disabled"),F=G.useState("closeDelay");return X2(U,{enabled:!B,closeDelay:F}),K0("div",J,{state:{open:W,side:H,align:z,instant:K,transitionStatus:q},ref:[$,G.context.popupRef,G.useStateSetter("popupElement")],props:[V,l5(q),Y],stateAttributesMapping:uk})});var iF=j(m(),1);var rF=iF.forwardRef(function(J,$){let{className:X,render:Q,...Y}=J,H=u7().useState("instantType"),{open:z,arrowRef:W,side:K,align:q,arrowUncentered:V,arrowStyles:U}=c6();return K0("div",J,{state:{open:z,side:K,align:q,uncentered:V,instant:H},ref:[$,W],props:[{style:U,"aria-hidden":!0},Y],stateAttributesMapping:Y1})});var CH=j(m(),1);var SH=j(a(),1),aF=function(J){let{delay:$,closeDelay:X,timeout:Q=400}=J,Y=CH.useMemo(()=>({delay:$,closeDelay:X}),[$,X]),G=CH.useMemo(()=>({open:$,close:X}),[$,X]);return SH.jsx(wH.Provider,{value:Y,children:SH.jsx(jG,{delay:G,timeoutMs:Q,children:J.children})})};var nF=j(m(),1);var sF=function(Z){return Z.popupWidth="--popup-width",Z.popupHeight="--popup-height",Z}({});var ck={activationDirection:(Z)=>Z?{"data-activation-direction":Z}:null},oF=nF.forwardRef(function(J,$){let{render:X,className:Q,children:Y,...G}=J,H=u7(),z=c6(),W=H.useState("instantType"),{children:K,state:q}=b6({store:H,side:z.side,cssVars:sF,children:Y}),V={activationDirection:q.activationDirection,transitioning:q.transitioning,instant:W};return K0("div",J,{state:V,ref:$,props:[G,{children:K}],stateAttributesMapping:ck})});class t${constructor(){this.store=new u6}open(Z){let J=Z?this.store.context.triggerElements.getById(Z):void 0;if(Z&&!J)throw Error(w0(81,Z));this.store.setOpen(!0,N0(n.imperativeAction,void 0,J))}close(){this.store.setOpen(!1,N0(n.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function tF(){return new t$}var x4=j(a(),1);function l6({delay:Z,closeDelay:J,...$}){return x4.jsx(Q2.Provider,{delay:Z,closeDelay:J,children:x4.jsx(Q2.Root,{"data-slot":"tooltip",...$})})}function i6({...Z}){return x4.jsx(Q2.Trigger,{"data-slot":"tooltip-trigger",...Z})}function r6({className:Z,side:J="top",sideOffset:$=6,align:X="center",alignOffset:Q=0,...Y}){return x4.jsx(Q2.Portal,{children:x4.jsx(Q2.Positioner,{align:X,alignOffset:Q,side:J,sideOffset:$,className:"isolate z-50",children:x4.jsx(Q2.Popup,{"data-slot":"tooltip-content",className:B0("z-50 origin-(--transform-origin) rounded-sm bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md ring-1 ring-border outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 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),...Y})})})}var eF="/claude-z2xnay0d.svg";var ZL="/openai-h13pza4b.svg";var JL="/openclaw-a2pyfhpn.svg";var $L=j(a(),1),Y2={"claude-code":eF,openclaw:JL,codex:ZL},IH={"claude-code":"Claude",openclaw:"OpenClaw",codex:"Codex"};function e$({type:Z,className:J}){return $L.jsx("img",{src:Y2[Z],alt:"","aria-label":IH[Z],className:B0("size-4 shrink-0",J)})}function f3(Z){if(Z.name)return Z.name;if(Z.type==="openclaw")return Z.agentId??"OpenClaw agent";return Z.path.split("/").pop()||Z.path}var G1=j(a(),1),rk=[{type:"claude-code",hint:"Great all-rounder for complex tasks built by Anthropic"},{type:"openclaw",hint:"Initialize OpenClaw in the folder manually, then import it to moi",disabled:!0}];function QL({type:Z,canChooseFolder:J,isPending:$,errorMessage:X,onTypeChange:Q,onUseExisting:Y,onContinue:G}){return G1.jsxs("div",{className:"flex flex-col gap-5",children:[G1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[G1.jsx(h3,{children:"Choose agent"}),G1.jsx(BH,{children:"It will be used to build your workspace"})]}),G1.jsx("div",{role:"group","aria-label":"Agent",className:"grid grid-cols-2 gap-2",children:rk.map((H)=>G1.jsx(ak,{option:H,selected:Z===H.type,onSelect:Q},H.type))}),X&&G1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:X}),G1.jsxs("div",{className:"flex items-center justify-end gap-2",children:[G1.jsx(sk,{available:J,disabled:$,onClick:Y}),G1.jsx(I0,{onClick:G,disabled:$,children:"Next"})]})]})}function YL({name:Z,validationError:J,requestError:$,isPending:X,onNameChange:Q,onSubmit:Y}){function G(H){H.preventDefault(),Y()}return G1.jsxs("form",{className:"flex flex-col gap-5",onSubmit:G,children:[G1.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[G1.jsx(h3,{children:"Name workspace"}),G1.jsx(BH,{children:"Keep it short and recognizable"})]}),G1.jsxs("div",{className:"flex flex-col gap-2",children:[G1.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),G1.jsx(x2,{id:"workspace-name",value:Z,onChange:(H)=>Q(H.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(J),"aria-describedby":J?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),J&&G1.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:J})]}),$&&G1.jsx("p",{role:"alert",className:"text-xs text-destructive",children:$}),G1.jsx("div",{className:"flex items-center justify-end gap-2",children:G1.jsx(I0,{type:"submit",disabled:!Z.trim()||Boolean(J)||X,children:X?"Creating…":"Create workspace"})})]})}function ak({option:Z,selected:J,onSelect:$}){return G1.jsxs("button",{type:"button",disabled:Z.disabled,onClick:()=>$(Z.type),"aria-pressed":J,className:B0("relative flex w-full flex-col items-start justify-between gap-6 rounded-lg bg-card p-4 text-left ring-1 ring-border transition-shadow outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!J&&!Z.disabled&&"cursor-pointer",Z.disabled&&"cursor-not-allowed opacity-50"),children:[G1.jsxs("span",{className:"relative inline-flex",children:[G1.jsx(e$,{type:Z.type,className:"size-10"}),J&&G1.jsx(XL,{size:20,stroke:1.5,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),G1.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[G1.jsx("span",{className:"text-sm font-medium text-foreground",children:IH[Z.type]}),G1.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:Z.hint})]})]})}function sk({available:Z,disabled:J,onClick:$}){if(Z)return G1.jsx(I0,{variant:"secondary",onClick:$,disabled:J,children:"Use existing folder"});return G1.jsxs(l6,{delay:50,children:[G1.jsx(i6,{render:G1.jsx(I0,{variant:"secondary","aria-disabled":!0,onClick:(X)=>X.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),G1.jsxs(r6,{className:"max-w-64 text-center",children:["Run ",G1.jsx("code",{className:"font-mono",children:"moi init"})," in the folder to add it manually."]})]})}function GL(Z){if(!Z)return"Folder name is required";if(Z.length>64)return"Folder name is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9._ -]*$/.test(Z))return"Use letters, numbers, dots, dashes, underscores and spaces, starting with a letter or number";if(Z.endsWith(".")||Z.endsWith(" "))return"Folder name cannot end with a dot or space";return null}var f9=j(a(),1),HL="claude-code";function u3({trigger:Z}){let[,J]=p9(),$=PB(),X=TB(),Q=P$(),Y=jB(),[G,H]=p3.useState(!1),[z,W]=p3.useState("agent"),[K,q]=p3.useState(HL),[V,U]=p3.useState(""),B=V.trim(),F=B?GL(B):null,N=$.data?.canChooseFolder??!0,L=Y.isPending||Q.isPending,_=X.isPending;function M(){H(!1),W("agent"),q(HL),U(""),Y.reset(),Q.reset(),X.reset()}function O(k){if(k){H(!0);return}M()}function D(k){M(),J(`/workspace/${k}`)}async function A(){if(L)return;Y.reset(),Q.reset();try{let k=await Y.mutateAsync();if("canceled"in k)return;let P=await Q.mutateAsync({path:k.path,type:K});D(P.id)}catch{}}function T(){X.reset(),W("name")}function S(){if(!B||F||_)return;X.reset(),X.mutate({name:B,type:K},{onSuccess:(k)=>D(k.id)})}return f9.jsxs(R$,{open:G,onOpenChange:O,children:[f9.jsx(qF,{render:Z}),f9.jsxs(b$,{className:"w-[calc(100%-2rem)] max-w-lg p-6",children:[f9.jsx(y$,{render:f9.jsx(I0,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"absolute top-4 right-4",children:f9.jsx(H9,{stroke:1.75})})}),z==="agent"?f9.jsx(QL,{type:K,canChooseFolder:N,isPending:L,errorMessage:(Y.error??Q.error)?.message,onTypeChange:q,onUseExisting:A,onContinue:T}):f9.jsx(YL,{name:V,validationError:F,requestError:X.error?.message,isPending:_,onNameChange:U,onSubmit:S})]})]})}var v2=j(m(),1);var J0=j(m(),1),f4=j(w7(),1);var F5=j(m(),1);var c3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function h4(Z){let J=Object.prototype.toString.call(Z);return J==="[object Window]"||J==="[object global]"}function ZX(Z){return"nodeType"in Z}function a5(Z){var J,$;if(!Z)return window;if(h4(Z))return Z;if(!ZX(Z))return window;return(J=($=Z.ownerDocument)==null?void 0:$.defaultView)!=null?J:window}function JX(Z){let{Document:J}=a5(Z);return Z instanceof J}function s6(Z){if(h4(Z))return!1;return Z instanceof a5(Z).HTMLElement}function kH(Z){return Z instanceof a5(Z).SVGElement}function v4(Z){if(!Z)return document;if(h4(Z))return Z.document;if(!ZX(Z))return document;if(JX(Z))return Z;if(s6(Z)||kH(Z))return Z.ownerDocument;return document}var u9=c3?F5.useLayoutEffect:F5.useEffect;function d3(Z){let J=F5.useRef(Z);return u9(()=>{J.current=Z}),F5.useCallback(function(){for(var $=arguments.length,X=Array($),Q=0;Q<$;Q++)X[Q]=arguments[Q];return J.current==null?void 0:J.current(...X)},[])}function WL(){let Z=F5.useRef(null),J=F5.useCallback((X,Q)=>{Z.current=setInterval(X,Q)},[]),$=F5.useCallback(()=>{if(Z.current!==null)clearInterval(Z.current),Z.current=null},[]);return[J,$]}function n6(Z,J){if(J===void 0)J=[Z];let $=F5.useRef(Z);return u9(()=>{if($.current!==Z)$.current=Z},J),$}function o6(Z,J){let $=F5.useRef();return F5.useMemo(()=>{let X=Z($.current);return $.current=X,X},[...J])}function l3(Z){let J=d3(Z),$=F5.useRef(null),X=F5.useCallback((Q)=>{if(Q!==$.current)J==null||J(Q,$.current);$.current=Q},[]);return[$,X]}function i3(Z){let J=F5.useRef();return F5.useEffect(()=>{J.current=Z},[Z]),J.current}var EH={};function r3(Z,J){return F5.useMemo(()=>{if(J)return J;let $=EH[Z]==null?0:EH[Z]+1;return EH[Z]=$,Z+"-"+$},[Z,J])}function KL(Z){return function(J){for(var $=arguments.length,X=Array($>1?$-1:0),Q=1;Q<$;Q++)X[Q-1]=arguments[Q];return X.reduce((Y,G)=>{let H=Object.entries(G);for(let[z,W]of H){let K=Y[z];if(K!=null)Y[z]=K+Z*W}return Y},{...J})}}var g4=KL(1),a3=KL(-1);function nk(Z){return"clientX"in Z&&"clientY"in Z}function $X(Z){if(!Z)return!1;let{KeyboardEvent:J}=a5(Z.target);return J&&Z instanceof J}function ok(Z){if(!Z)return!1;let{TouchEvent:J}=a5(Z.target);return J&&Z instanceof J}function s3(Z){if(ok(Z)){if(Z.touches&&Z.touches.length){let{clientX:J,clientY:$}=Z.touches[0];return{x:J,y:$}}else if(Z.changedTouches&&Z.changedTouches.length){let{clientX:J,clientY:$}=Z.changedTouches[0];return{x:J,y:$}}}if(nk(Z))return{x:Z.clientX,y:Z.clientY};return null}var a6=Object.freeze({Translate:{toString(Z){if(!Z)return;let{x:J,y:$}=Z;return"translate3d("+(J?Math.round(J):0)+"px, "+($?Math.round($):0)+"px, 0)"}},Scale:{toString(Z){if(!Z)return;let{scaleX:J,scaleY:$}=Z;return"scaleX("+J+") scaleY("+$+")"}},Transform:{toString(Z){if(!Z)return;return[a6.Translate.toString(Z),a6.Scale.toString(Z)].join(" ")}},Transition:{toString(Z){let{property:J,duration:$,easing:X}=Z;return J+" "+$+"ms "+X}}}),zL="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qL(Z){if(Z.matches(zL))return Z;return Z.querySelector(zL)}var m4=j(m(),1),tk={display:"none"};function VL(Z){let{id:J,value:$}=Z;return m4.default.createElement("div",{id:J,style:tk},$)}function UL(Z){let{id:J,announcement:$,ariaLiveType:X="assertive"}=Z,Q={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 m4.default.createElement("div",{id:J,style:Q,role:"status","aria-live":X,"aria-atomic":!0},$)}function BL(){let[Z,J]=m4.useState("");return{announce:m4.useCallback((X)=>{if(X!=null)J(X)},[]),announcement:Z}}var CL=J0.createContext(null);function ek(Z){let J=J0.useContext(CL);J0.useEffect(()=>{if(!J)throw Error("useDndMonitor must be used within a children of <DndContext>");return J(Z)},[Z,J])}function ZR(){let[Z]=J0.useState(()=>new Set),J=J0.useCallback((X)=>{return Z.add(X),()=>Z.delete(X)},[Z]);return[J0.useCallback((X)=>{let{type:Q,event:Y}=X;Z.forEach((G)=>{var H;return(H=G[Q])==null?void 0:H.call(G,Y)})},[Z]),J]}var JR={draggable:`
|
|
22
|
-
To pick up a draggable item, press the space bar.
|
|
23
|
-
While dragging, use the arrow keys to move the item.
|
|
24
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
25
|
-
`},$R={onDragStart(Z){let{active:J}=Z;return"Picked up draggable item "+J.id+"."},onDragOver(Z){let{active:J,over:$}=Z;if($)return"Draggable item "+J.id+" was moved over droppable area "+$.id+".";return"Draggable item "+J.id+" is no longer over a droppable area."},onDragEnd(Z){let{active:J,over:$}=Z;if($)return"Draggable item "+J.id+" was dropped over droppable area "+$.id;return"Draggable item "+J.id+" was dropped."},onDragCancel(Z){let{active:J}=Z;return"Dragging was cancelled. Draggable item "+J.id+" was dropped."}};function XR(Z){let{announcements:J=$R,container:$,hiddenTextDescribedById:X,screenReaderInstructions:Q=JR}=Z,{announce:Y,announcement:G}=BL(),H=r3("DndLiveRegion"),[z,W]=J0.useState(!1);if(J0.useEffect(()=>{W(!0)},[]),ek(J0.useMemo(()=>({onDragStart(q){let{active:V}=q;Y(J.onDragStart({active:V}))},onDragMove(q){let{active:V,over:U}=q;if(J.onDragMove)Y(J.onDragMove({active:V,over:U}))},onDragOver(q){let{active:V,over:U}=q;Y(J.onDragOver({active:V,over:U}))},onDragEnd(q){let{active:V,over:U}=q;Y(J.onDragEnd({active:V,over:U}))},onDragCancel(q){let{active:V,over:U}=q;Y(J.onDragCancel({active:V,over:U}))}}),[Y,J])),!z)return null;let K=J0.default.createElement(J0.default.Fragment,null,J0.default.createElement(VL,{id:X,value:Q.draggable}),J0.default.createElement(UL,{id:H,announcement:G}));return $?f4.createPortal(K,$):K}var O5;(function(Z){Z.DragStart="dragStart",Z.DragMove="dragMove",Z.DragEnd="dragEnd",Z.DragCancel="dragCancel",Z.DragOver="dragOver",Z.RegisterDroppable="registerDroppable",Z.SetDroppableDisabled="setDroppableDisabled",Z.UnregisterDroppable="unregisterDroppable"})(O5||(O5={}));function QX(){}function gH(Z,J){return J0.useMemo(()=>({sensor:Z,options:J!=null?J:{}}),[Z,J])}function SL(){for(var Z=arguments.length,J=Array(Z),$=0;$<Z;$++)J[$]=arguments[$];return J0.useMemo(()=>[...J].filter((X)=>X!=null),[...J])}var z9=Object.freeze({x:0,y:0});function QR(Z,J){return Math.sqrt(Math.pow(Z.x-J.x,2)+Math.pow(Z.y-J.y,2))}function YR(Z,J){let $=s3(Z);if(!$)return"0 0";let X={x:($.x-J.left)/J.width*100,y:($.y-J.top)/J.height*100};return X.x+"% "+X.y+"%"}function GR(Z,J){let{data:{value:$}}=Z,{data:{value:X}}=J;return $-X}function HR(Z,J){let{data:{value:$}}=Z,{data:{value:X}}=J;return X-$}function zR(Z,J){if(!Z||Z.length===0)return null;let[$]=Z;return J?$[J]:$}function FL(Z,J,$){if(J===void 0)J=Z.left;if($===void 0)$=Z.top;return{x:J+Z.width*0.5,y:$+Z.height*0.5}}var IL=(Z)=>{let{collisionRect:J,droppableRects:$,droppableContainers:X}=Z,Q=FL(J,J.left,J.top),Y=[];for(let G of X){let{id:H}=G,z=$.get(H);if(z){let W=QR(FL(z),Q);Y.push({id:H,data:{droppableContainer:G,value:W}})}}return Y.sort(GR)};function WR(Z,J){let $=Math.max(J.top,Z.top),X=Math.max(J.left,Z.left),Q=Math.min(J.left+J.width,Z.left+Z.width),Y=Math.min(J.top+J.height,Z.top+Z.height),G=Q-X,H=Y-$;if(X<Q&&$<Y){let z=J.width*J.height,W=Z.width*Z.height,K=G*H,q=K/(z+W-K);return Number(q.toFixed(4))}return 0}var KR=(Z)=>{let{collisionRect:J,droppableRects:$,droppableContainers:X}=Z,Q=[];for(let Y of X){let{id:G}=Y,H=$.get(G);if(H){let z=WR(H,J);if(z>0)Q.push({id:G,data:{droppableContainer:Y,value:z}})}}return Q.sort(HR)};function qR(Z,J,$){return{...Z,scaleX:J&&$?J.width/$.width:1,scaleY:J&&$?J.height/$.height:1}}function EL(Z,J){return Z&&J?{x:Z.left-J.left,y:Z.top-J.top}:z9}function VR(Z){return function($){for(var X=arguments.length,Q=Array(X>1?X-1:0),Y=1;Y<X;Y++)Q[Y-1]=arguments[Y];return Q.reduce((G,H)=>({...G,top:G.top+Z*H.y,bottom:G.bottom+Z*H.y,left:G.left+Z*H.x,right:G.right+Z*H.x}),{...$})}}var UR=VR(1);function kL(Z){if(Z.startsWith("matrix3d(")){let J=Z.slice(9,-1).split(/, /);return{x:+J[12],y:+J[13],scaleX:+J[0],scaleY:+J[5]}}else if(Z.startsWith("matrix(")){let J=Z.slice(7,-1).split(/, /);return{x:+J[4],y:+J[5],scaleX:+J[0],scaleY:+J[3]}}return null}function BR(Z,J,$){let X=kL(J);if(!X)return Z;let{scaleX:Q,scaleY:Y,x:G,y:H}=X,z=Z.left-G-(1-Q)*parseFloat($),W=Z.top-H-(1-Y)*parseFloat($.slice($.indexOf(" ")+1)),K=Q?Z.width/Q:Z.width,q=Y?Z.height/Y:Z.height;return{width:K,height:q,top:W,right:z+K,bottom:W+q,left:z}}var FR={ignoreTransform:!1};function t3(Z,J){if(J===void 0)J=FR;let $=Z.getBoundingClientRect();if(J.ignoreTransform){let{transform:W,transformOrigin:K}=a5(Z).getComputedStyle(Z);if(W)$=BR($,W,K)}let{top:X,left:Q,width:Y,height:G,bottom:H,right:z}=$;return{top:X,left:Q,width:Y,height:G,bottom:H,right:z}}function LL(Z){return t3(Z,{ignoreTransform:!0})}function LR(Z){let{innerWidth:J,innerHeight:$}=Z;return{top:0,left:0,right:J,bottom:$,width:J,height:$}}function NR(Z,J){if(J===void 0)J=a5(Z).getComputedStyle(Z);return J.position==="fixed"}function _R(Z,J){if(J===void 0)J=a5(Z).getComputedStyle(Z);let $=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((Q)=>{let Y=J[Q];return typeof Y==="string"?$.test(Y):!1})}function mH(Z,J){let $=[];function X(Q){if(J!=null&&$.length>=J)return $;if(!Q)return $;if(JX(Q)&&Q.scrollingElement!=null&&!$.includes(Q.scrollingElement))return $.push(Q.scrollingElement),$;if(!s6(Q)||kH(Q))return $;if($.includes(Q))return $;let Y=a5(Z).getComputedStyle(Q);if(Q!==Z){if(_R(Q,Y))$.push(Q)}if(NR(Q,Y))return $;return X(Q.parentNode)}if(!Z)return $;return X(Z)}function RL(Z){let[J]=mH(Z,1);return J!=null?J:null}function RH(Z){if(!c3||!Z)return null;if(h4(Z))return Z;if(!ZX(Z))return null;if(JX(Z)||Z===v4(Z).scrollingElement)return window;if(s6(Z))return Z;return null}function yL(Z){if(h4(Z))return Z.scrollX;return Z.scrollLeft}function bL(Z){if(h4(Z))return Z.scrollY;return Z.scrollTop}function xH(Z){return{x:yL(Z),y:bL(Z)}}var I5;(function(Z){Z[Z.Forward=1]="Forward",Z[Z.Backward=-1]="Backward"})(I5||(I5={}));function xL(Z){if(!c3||!Z)return!1;return Z===document.scrollingElement}function hL(Z){let J={x:0,y:0},$=xL(Z)?{height:window.innerHeight,width:window.innerWidth}:{height:Z.clientHeight,width:Z.clientWidth},X={x:Z.scrollWidth-$.width,y:Z.scrollHeight-$.height},Q=Z.scrollTop<=J.y,Y=Z.scrollLeft<=J.x,G=Z.scrollTop>=X.y,H=Z.scrollLeft>=X.x;return{isTop:Q,isLeft:Y,isBottom:G,isRight:H,maxScroll:X,minScroll:J}}var AR={x:0.2,y:0.2};function MR(Z,J,$,X,Q){let{top:Y,left:G,right:H,bottom:z}=$;if(X===void 0)X=10;if(Q===void 0)Q=AR;let{isTop:W,isBottom:K,isLeft:q,isRight:V}=hL(Z),U={x:0,y:0},B={x:0,y:0},F={height:J.height*Q.y,width:J.width*Q.x};if(!W&&Y<=J.top+F.height)U.y=I5.Backward,B.y=X*Math.abs((J.top+F.height-Y)/F.height);else if(!K&&z>=J.bottom-F.height)U.y=I5.Forward,B.y=X*Math.abs((J.bottom-F.height-z)/F.height);if(!V&&H>=J.right-F.width)U.x=I5.Forward,B.x=X*Math.abs((J.right-F.width-H)/F.width);else if(!q&&G<=J.left+F.width)U.x=I5.Backward,B.x=X*Math.abs((J.left+F.width-G)/F.width);return{direction:U,speed:B}}function DR(Z){if(Z===document.scrollingElement){let{innerWidth:Y,innerHeight:G}=window;return{top:0,left:0,right:Y,bottom:G,width:Y,height:G}}let{top:J,left:$,right:X,bottom:Q}=Z.getBoundingClientRect();return{top:J,left:$,right:X,bottom:Q,width:Z.clientWidth,height:Z.clientHeight}}function vL(Z){return Z.reduce((J,$)=>{return g4(J,xH($))},z9)}function OR(Z){return Z.reduce((J,$)=>{return J+yL($)},0)}function wR(Z){return Z.reduce((J,$)=>{return J+bL($)},0)}function gL(Z,J){if(J===void 0)J=t3;if(!Z)return;let{top:$,left:X,bottom:Q,right:Y}=J(Z);if(!RL(Z))return;if(Q<=0||Y<=0||$>=window.innerHeight||X>=window.innerWidth)Z.scrollIntoView({block:"center",inline:"center"})}var PR=[["x",["left","right"],OR],["y",["top","bottom"],wR]];class GX{constructor(Z,J){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 $=mH(J),X=vL($);this.rect={...Z},this.width=Z.width,this.height=Z.height;for(let[Q,Y,G]of PR)for(let H of Y)Object.defineProperty(this,H,{get:()=>{let z=G($),W=X[Q]-z;return this.rect[H]+W},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class t6{constructor(Z){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((J)=>{var $;return($=this.target)==null?void 0:$.removeEventListener(...J)})},this.target=Z}add(Z,J,$){var X;(X=this.target)==null||X.addEventListener(Z,J,$),this.listeners.push([Z,J,$])}}function jR(Z){let{EventTarget:J}=a5(Z);return Z instanceof J?Z:v4(Z)}function yH(Z,J){let $=Math.abs(Z.x),X=Math.abs(Z.y);if(typeof J==="number")return Math.sqrt($**2+X**2)>J;if("x"in J&&"y"in J)return $>J.x&&X>J.y;if("x"in J)return $>J.x;if("y"in J)return X>J.y;return!1}var c7;(function(Z){Z.Click="click",Z.DragStart="dragstart",Z.Keydown="keydown",Z.ContextMenu="contextmenu",Z.Resize="resize",Z.SelectionChange="selectionchange",Z.VisibilityChange="visibilitychange"})(c7||(c7={}));function NL(Z){Z.preventDefault()}function TR(Z){Z.stopPropagation()}var V1;(function(Z){Z.Space="Space",Z.Down="ArrowDown",Z.Right="ArrowRight",Z.Left="ArrowLeft",Z.Up="ArrowUp",Z.Esc="Escape",Z.Enter="Enter",Z.Tab="Tab"})(V1||(V1={}));var mL={start:[V1.Space,V1.Enter],cancel:[V1.Esc],end:[V1.Space,V1.Enter,V1.Tab]},CR=(Z,J)=>{let{currentCoordinates:$}=J;switch(Z.code){case V1.Right:return{...$,x:$.x+25};case V1.Left:return{...$,x:$.x-25};case V1.Down:return{...$,y:$.y+25};case V1.Up:return{...$,y:$.y-25}}return};class e3{constructor(Z){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=Z;let{event:{target:J}}=Z;this.props=Z,this.listeners=new t6(v4(J)),this.windowListeners=new t6(a5(J)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(c7.Resize,this.handleCancel),this.windowListeners.add(c7.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(c7.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:Z,onStart:J}=this.props,$=Z.node.current;if($)gL($);J(z9)}handleKeyDown(Z){if($X(Z)){let{active:J,context:$,options:X}=this.props,{keyboardCodes:Q=mL,coordinateGetter:Y=CR,scrollBehavior:G="smooth"}=X,{code:H}=Z;if(Q.end.includes(H)){this.handleEnd(Z);return}if(Q.cancel.includes(H)){this.handleCancel(Z);return}let{collisionRect:z}=$.current,W=z?{x:z.left,y:z.top}:z9;if(!this.referenceCoordinates)this.referenceCoordinates=W;let K=Y(Z,{active:J,context:$.current,currentCoordinates:W});if(K){let q=a3(K,W),V={x:0,y:0},{scrollableAncestors:U}=$.current;for(let B of U){let F=Z.code,{isTop:N,isRight:L,isLeft:_,isBottom:M,maxScroll:O,minScroll:D}=hL(B),A=DR(B),T={x:Math.min(F===V1.Right?A.right-A.width/2:A.right,Math.max(F===V1.Right?A.left:A.left+A.width/2,K.x)),y:Math.min(F===V1.Down?A.bottom-A.height/2:A.bottom,Math.max(F===V1.Down?A.top:A.top+A.height/2,K.y))},S=F===V1.Right&&!L||F===V1.Left&&!_,k=F===V1.Down&&!M||F===V1.Up&&!N;if(S&&T.x!==K.x){let P=B.scrollLeft+q.x,g=F===V1.Right&&P<=O.x||F===V1.Left&&P>=D.x;if(g&&!q.y){B.scrollTo({left:P,behavior:G});return}if(g)V.x=B.scrollLeft-P;else V.x=F===V1.Right?B.scrollLeft-O.x:B.scrollLeft-D.x;if(V.x)B.scrollBy({left:-V.x,behavior:G});break}else if(k&&T.y!==K.y){let P=B.scrollTop+q.y,g=F===V1.Down&&P<=O.y||F===V1.Up&&P>=D.y;if(g&&!q.x){B.scrollTo({top:P,behavior:G});return}if(g)V.y=B.scrollTop-P;else V.y=F===V1.Down?B.scrollTop-O.y:B.scrollTop-D.y;if(V.y)B.scrollBy({top:-V.y,behavior:G});break}}this.handleMove(Z,g4(a3(K,this.referenceCoordinates),V))}}}handleMove(Z,J){let{onMove:$}=this.props;Z.preventDefault(),$(J)}handleEnd(Z){let{onEnd:J}=this.props;Z.preventDefault(),this.detach(),J()}handleCancel(Z){let{onCancel:J}=this.props;Z.preventDefault(),this.detach(),J()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}e3.activators=[{eventName:"onKeyDown",handler:(Z,J,$)=>{let{keyboardCodes:X=mL,onActivation:Q}=J,{active:Y}=$,{code:G}=Z.nativeEvent;if(X.start.includes(G)){let H=Y.activatorNode.current;if(H&&Z.target!==H)return!1;return Z.preventDefault(),Q==null||Q({event:Z.nativeEvent}),!0}return!1}}];function _L(Z){return Boolean(Z&&"distance"in Z)}function AL(Z){return Boolean(Z&&"delay"in Z)}class HX{constructor(Z,J,$){var X;if($===void 0)$=jR(Z.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=Z,this.events=J;let{event:Q}=Z,{target:Y}=Q;this.props=Z,this.events=J,this.document=v4(Y),this.documentListeners=new t6(this.document),this.listeners=new t6($),this.windowListeners=new t6(a5(Y)),this.initialCoordinates=(X=s3(Q))!=null?X:z9,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:Z,props:{options:{activationConstraint:J,bypassActivationConstraint:$}}}=this;if(this.listeners.add(Z.move.name,this.handleMove,{passive:!1}),this.listeners.add(Z.end.name,this.handleEnd),Z.cancel)this.listeners.add(Z.cancel.name,this.handleCancel);if(this.windowListeners.add(c7.Resize,this.handleCancel),this.windowListeners.add(c7.DragStart,NL),this.windowListeners.add(c7.VisibilityChange,this.handleCancel),this.windowListeners.add(c7.ContextMenu,NL),this.documentListeners.add(c7.Keydown,this.handleKeydown),J){if($!=null&&$({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(AL(J)){this.timeoutId=setTimeout(this.handleStart,J.delay),this.handlePending(J);return}if(_L(J)){this.handlePending(J);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,J){let{active:$,onPending:X}=this.props;X($,Z,this.initialCoordinates,J)}handleStart(){let{initialCoordinates:Z}=this,{onStart:J}=this.props;if(Z)this.activated=!0,this.documentListeners.add(c7.Click,TR,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(c7.SelectionChange,this.removeTextSelection),J(Z)}handleMove(Z){var J;let{activated:$,initialCoordinates:X,props:Q}=this,{onMove:Y,options:{activationConstraint:G}}=Q;if(!X)return;let H=(J=s3(Z))!=null?J:z9,z=a3(X,H);if(!$&&G){if(_L(G)){if(G.tolerance!=null&&yH(z,G.tolerance))return this.handleCancel();if(yH(z,G.distance))return this.handleStart()}if(AL(G)){if(yH(z,G.tolerance))return this.handleCancel()}this.handlePending(G,z);return}if(Z.cancelable)Z.preventDefault();Y(H)}handleEnd(){let{onAbort:Z,onEnd:J}=this.props;if(this.detach(),!this.activated)Z(this.props.active);J()}handleCancel(){let{onAbort:Z,onCancel:J}=this.props;if(this.detach(),!this.activated)Z(this.props.active);J()}handleKeydown(Z){if(Z.code===V1.Esc)this.handleCancel()}removeTextSelection(){var Z;(Z=this.document.getSelection())==null||Z.removeAllRanges()}}var SR={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ZZ extends HX{constructor(Z){let{event:J}=Z,$=v4(J.target);super(Z,SR,$)}}ZZ.activators=[{eventName:"onPointerDown",handler:(Z,J)=>{let{nativeEvent:$}=Z,{onActivation:X}=J;if(!$.isPrimary||$.button!==0)return!1;return X==null||X({event:$}),!0}}];var IR={move:{name:"mousemove"},end:{name:"mouseup"}},hH;(function(Z){Z[Z.RightClick=2]="RightClick"})(hH||(hH={}));class fL extends HX{constructor(Z){super(Z,IR,v4(Z.event.target))}}fL.activators=[{eventName:"onMouseDown",handler:(Z,J)=>{let{nativeEvent:$}=Z,{onActivation:X}=J;if($.button===hH.RightClick)return!1;return X==null||X({event:$}),!0}}];var bH={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pL extends HX{constructor(Z){super(Z,bH)}static setup(){return window.addEventListener(bH.move.name,Z,{capture:!1,passive:!1}),function(){window.removeEventListener(bH.move.name,Z)};function Z(){}}}pL.activators=[{eventName:"onTouchStart",handler:(Z,J)=>{let{nativeEvent:$}=Z,{onActivation:X}=J,{touches:Q}=$;if(Q.length>1)return!1;return X==null||X({event:$}),!0}}];var n3;(function(Z){Z[Z.Pointer=0]="Pointer",Z[Z.DraggableRect=1]="DraggableRect"})(n3||(n3={}));var YX;(function(Z){Z[Z.TreeOrder=0]="TreeOrder",Z[Z.ReversedTreeOrder=1]="ReversedTreeOrder"})(YX||(YX={}));function ER(Z){let{acceleration:J,activator:$=n3.Pointer,canScroll:X,draggingRect:Q,enabled:Y,interval:G=5,order:H=YX.TreeOrder,pointerCoordinates:z,scrollableAncestors:W,scrollableAncestorRects:K,delta:q,threshold:V}=Z,U=RR({delta:q,disabled:!Y}),[B,F]=WL(),N=J0.useRef({x:0,y:0}),L=J0.useRef({x:0,y:0}),_=J0.useMemo(()=>{switch($){case n3.Pointer:return z?{top:z.y,bottom:z.y,left:z.x,right:z.x}:null;case n3.DraggableRect:return Q}},[$,Q,z]),M=J0.useRef(null),O=J0.useCallback(()=>{let A=M.current;if(!A)return;let T=N.current.x*L.current.x,S=N.current.y*L.current.y;A.scrollBy(T,S)},[]),D=J0.useMemo(()=>H===YX.TreeOrder?[...W].reverse():W,[H,W]);J0.useEffect(()=>{if(!Y||!W.length||!_){F();return}for(let A of D){if((X==null?void 0:X(A))===!1)continue;let T=W.indexOf(A),S=K[T];if(!S)continue;let{direction:k,speed:P}=MR(A,S,_,J,V);for(let g of["x","y"])if(!U[g][k[g]])P[g]=0,k[g]=0;if(P.x>0||P.y>0){F(),M.current=A,B(O,G),N.current=P,L.current=k;return}}N.current={x:0,y:0},L.current={x:0,y:0},F()},[J,O,X,F,Y,G,JSON.stringify(_),JSON.stringify(U),B,W,D,K,JSON.stringify(V)])}var kR={x:{[I5.Backward]:!1,[I5.Forward]:!1},y:{[I5.Backward]:!1,[I5.Forward]:!1}};function RR(Z){let{delta:J,disabled:$}=Z,X=i3(J);return o6((Q)=>{if($||!X||!Q)return kR;let Y={x:Math.sign(J.x-X.x),y:Math.sign(J.y-X.y)};return{x:{[I5.Backward]:Q.x[I5.Backward]||Y.x===-1,[I5.Forward]:Q.x[I5.Forward]||Y.x===1},y:{[I5.Backward]:Q.y[I5.Backward]||Y.y===-1,[I5.Forward]:Q.y[I5.Forward]||Y.y===1}}},[$,J,X])}function yR(Z,J){let $=J!=null?Z.get(J):void 0,X=$?$.node.current:null;return o6((Q)=>{var Y;if(J==null)return null;return(Y=X!=null?X:Q)!=null?Y:null},[X,J])}function bR(Z,J){return J0.useMemo(()=>Z.reduce(($,X)=>{let{sensor:Q}=X,Y=Q.activators.map((G)=>({eventName:G.eventName,handler:J(G.handler,X)}));return[...$,...Y]},[]),[Z,J])}var o3;(function(Z){Z[Z.Always=0]="Always",Z[Z.BeforeDragging=1]="BeforeDragging",Z[Z.WhileDragging=2]="WhileDragging"})(o3||(o3={}));var vH;(function(Z){Z.Optimized="optimized"})(vH||(vH={}));var ML=new Map;function xR(Z,J){let{dragging:$,dependencies:X,config:Q}=J,[Y,G]=J0.useState(null),{frequency:H,measure:z,strategy:W}=Q,K=J0.useRef(Z),q=N(),V=n6(q),U=J0.useCallback(function(L){if(L===void 0)L=[];if(V.current)return;G((_)=>{if(_===null)return L;return _.concat(L.filter((M)=>!_.includes(M)))})},[V]),B=J0.useRef(null),F=o6((L)=>{if(q&&!$)return ML;if(!L||L===ML||K.current!==Z||Y!=null){let _=new Map;for(let M of Z){if(!M)continue;if(Y&&Y.length>0&&!Y.includes(M.id)&&M.rect.current){_.set(M.id,M.rect.current);continue}let O=M.node.current,D=O?new GX(z(O),O):null;if(M.rect.current=D,D)_.set(M.id,D)}return _}return L},[Z,Y,$,q,z]);return J0.useEffect(()=>{K.current=Z},[Z]),J0.useEffect(()=>{if(q)return;U()},[$,q]),J0.useEffect(()=>{if(Y&&Y.length>0)G(null)},[JSON.stringify(Y)]),J0.useEffect(()=>{if(q||typeof H!=="number"||B.current!==null)return;B.current=setTimeout(()=>{U(),B.current=null},H)},[H,q,U,...X]),{droppableRects:F,measureDroppableContainers:U,measuringScheduled:Y!=null};function N(){switch(W){case o3.Always:return!1;case o3.BeforeDragging:return $;default:return!$}}}function fH(Z,J){return o6(($)=>{if(!Z)return null;if($)return $;return typeof J==="function"?J(Z):Z},[J,Z])}function hR(Z,J){return fH(Z,J)}function vR(Z){let{callback:J,disabled:$}=Z,X=d3(J),Q=J0.useMemo(()=>{if($||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:Y}=window;return new Y(X)},[X,$]);return J0.useEffect(()=>{return()=>Q==null?void 0:Q.disconnect()},[Q]),Q}function zX(Z){let{callback:J,disabled:$}=Z,X=d3(J),Q=J0.useMemo(()=>{if($||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:Y}=window;return new Y(X)},[$]);return J0.useEffect(()=>{return()=>Q==null?void 0:Q.disconnect()},[Q]),Q}function gR(Z){return new GX(t3(Z),Z)}function DL(Z,J,$){if(J===void 0)J=gR;let[X,Q]=J0.useState(null);function Y(){Q((z)=>{if(!Z)return null;if(Z.isConnected===!1){var W;return(W=z!=null?z:$)!=null?W:null}let K=J(Z);if(JSON.stringify(z)===JSON.stringify(K))return z;return K})}let G=vR({callback(z){if(!Z)return;for(let W of z){let{type:K,target:q}=W;if(K==="childList"&&q instanceof HTMLElement&&q.contains(Z)){Y();break}}}}),H=zX({callback:Y});return u9(()=>{if(Y(),Z)H==null||H.observe(Z),G==null||G.observe(document.body,{childList:!0,subtree:!0});else H==null||H.disconnect(),G==null||G.disconnect()},[Z]),X}function mR(Z){let J=fH(Z);return EL(Z,J)}var OL=[];function fR(Z){let J=J0.useRef(Z),$=o6((X)=>{if(!Z)return OL;if(X&&X!==OL&&Z&&J.current&&Z.parentNode===J.current.parentNode)return X;return mH(Z)},[Z]);return J0.useEffect(()=>{J.current=Z},[Z]),$}function pR(Z){let[J,$]=J0.useState(null),X=J0.useRef(Z),Q=J0.useCallback((Y)=>{let G=RH(Y.target);if(!G)return;$((H)=>{if(!H)return null;return H.set(G,xH(G)),new Map(H)})},[]);return J0.useEffect(()=>{let Y=X.current;if(Z!==Y){G(Y);let H=Z.map((z)=>{let W=RH(z);if(W)return W.addEventListener("scroll",Q,{passive:!0}),[W,xH(W)];return null}).filter((z)=>z!=null);$(H.length?new Map(H):null),X.current=Z}return()=>{G(Z),G(Y)};function G(H){H.forEach((z)=>{let W=RH(z);W==null||W.removeEventListener("scroll",Q)})}},[Q,Z]),J0.useMemo(()=>{if(Z.length)return J?Array.from(J.values()).reduce((Y,G)=>g4(Y,G),z9):vL(Z);return z9},[Z,J])}function wL(Z,J){if(J===void 0)J=[];let $=J0.useRef(null);return J0.useEffect(()=>{$.current=null},J),J0.useEffect(()=>{let X=Z!==z9;if(X&&!$.current)$.current=Z;if(!X&&$.current)$.current=null},[Z]),$.current?a3(Z,$.current):z9}function uR(Z){J0.useEffect(()=>{if(!c3)return;let J=Z.map(($)=>{let{sensor:X}=$;return X.setup==null?void 0:X.setup()});return()=>{for(let $ of J)$==null||$()}},Z.map((J)=>{let{sensor:$}=J;return $}))}function cR(Z,J){return J0.useMemo(()=>{return Z.reduce(($,X)=>{let{eventName:Q,handler:Y}=X;return $[Q]=(G)=>{Y(G,J)},$},{})},[Z,J])}function uL(Z){return J0.useMemo(()=>Z?LR(Z):null,[Z])}var PL=[];function dR(Z,J){if(J===void 0)J=t3;let[$]=Z,X=uL($?a5($):null),[Q,Y]=J0.useState(PL);function G(){Y(()=>{if(!Z.length)return PL;return Z.map((z)=>xL(z)?X:new GX(J(z),z))})}let H=zX({callback:G});return u9(()=>{H==null||H.disconnect(),G(),Z.forEach((z)=>H==null?void 0:H.observe(z))},[Z]),Q}function cL(Z){if(!Z)return null;if(Z.children.length>1)return Z;let J=Z.children[0];return s6(J)?J:Z}function lR(Z){let{measure:J}=Z,[$,X]=J0.useState(null),Q=J0.useCallback((W)=>{for(let{target:K}of W)if(s6(K)){X((q)=>{let V=J(K);return q?{...q,width:V.width,height:V.height}:V});break}},[J]),Y=zX({callback:Q}),G=J0.useCallback((W)=>{let K=cL(W);if(Y==null||Y.disconnect(),K)Y==null||Y.observe(K);X(K?J(K):null)},[J,Y]),[H,z]=l3(G);return J0.useMemo(()=>({nodeRef:H,rect:$,setRef:z}),[$,H,z])}var iR=[{sensor:ZZ,options:{}},{sensor:e3,options:{}}],rR={current:{}},XX={draggable:{measure:LL},droppable:{measure:LL,strategy:o3.WhileDragging,frequency:vH.Optimized},dragOverlay:{measure:t3}};class e6 extends Map{get(Z){var J;return Z!=null?(J=super.get(Z))!=null?J:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((Z)=>{let{disabled:J}=Z;return!J})}getNodeFor(Z){var J,$;return(J=($=this.get(Z))==null?void 0:$.node.current)!=null?J:void 0}}var aR={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new e6,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:QX},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:XX,measureDroppableContainers:QX,windowRect:null,measuringScheduled:!1},dL={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:QX,draggableNodes:new Map,over:null,measureDroppableContainers:QX},JZ=J0.createContext(dL),lL=J0.createContext(aR);function sR(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new e6}}}function nR(Z,J){switch(J.type){case O5.DragStart:return{...Z,draggable:{...Z.draggable,initialCoordinates:J.initialCoordinates,active:J.active}};case O5.DragMove:if(Z.draggable.active==null)return Z;return{...Z,draggable:{...Z.draggable,translate:{x:J.coordinates.x-Z.draggable.initialCoordinates.x,y:J.coordinates.y-Z.draggable.initialCoordinates.y}}};case O5.DragEnd:case O5.DragCancel:return{...Z,draggable:{...Z.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case O5.RegisterDroppable:{let{element:$}=J,{id:X}=$,Q=new e6(Z.droppable.containers);return Q.set(X,$),{...Z,droppable:{...Z.droppable,containers:Q}}}case O5.SetDroppableDisabled:{let{id:$,key:X,disabled:Q}=J,Y=Z.droppable.containers.get($);if(!Y||X!==Y.key)return Z;let G=new e6(Z.droppable.containers);return G.set($,{...Y,disabled:Q}),{...Z,droppable:{...Z.droppable,containers:G}}}case O5.UnregisterDroppable:{let{id:$,key:X}=J,Q=Z.droppable.containers.get($);if(!Q||X!==Q.key)return Z;let Y=new e6(Z.droppable.containers);return Y.delete($),{...Z,droppable:{...Z.droppable,containers:Y}}}default:return Z}}function oR(Z){let{disabled:J}=Z,{active:$,activatorEvent:X,draggableNodes:Q}=J0.useContext(JZ),Y=i3(X),G=i3($==null?void 0:$.id);return J0.useEffect(()=>{if(J)return;if(!X&&Y&&G!=null){if(!$X(Y))return;if(document.activeElement===Y.target)return;let H=Q.get(G);if(!H)return;let{activatorNode:z,node:W}=H;if(!z.current&&!W.current)return;requestAnimationFrame(()=>{for(let K of[z.current,W.current]){if(!K)continue;let q=qL(K);if(q){q.focus();break}}})}},[X,J,Q,G,Y]),null}function iL(Z,J){let{transform:$,...X}=J;return Z!=null&&Z.length?Z.reduce((Q,Y)=>{return Y({transform:Q,...X})},$):$}function tR(Z){return J0.useMemo(()=>({draggable:{...XX.draggable,...Z==null?void 0:Z.draggable},droppable:{...XX.droppable,...Z==null?void 0:Z.droppable},dragOverlay:{...XX.dragOverlay,...Z==null?void 0:Z.dragOverlay}}),[Z==null?void 0:Z.draggable,Z==null?void 0:Z.droppable,Z==null?void 0:Z.dragOverlay])}function eR(Z){let{activeNode:J,measure:$,initialRect:X,config:Q=!0}=Z,Y=J0.useRef(!1),{x:G,y:H}=typeof Q==="boolean"?{x:Q,y:Q}:Q;u9(()=>{if(!G&&!H||!J){Y.current=!1;return}if(Y.current||!X)return;let W=J==null?void 0:J.node.current;if(!W||W.isConnected===!1)return;let K=$(W),q=EL(K,X);if(!G)q.x=0;if(!H)q.y=0;if(Y.current=!0,Math.abs(q.x)>0||Math.abs(q.y)>0){let V=RL(W);if(V)V.scrollBy({top:q.y,left:q.x})}},[J,G,H,X,$])}var WX=J0.createContext({...z9,scaleX:1,scaleY:1}),h2;(function(Z){Z[Z.Uninitialized=0]="Uninitialized",Z[Z.Initializing=1]="Initializing",Z[Z.Initialized=2]="Initialized"})(h2||(h2={}));var rL=J0.memo(function(J){var $,X,Q,Y;let{id:G,accessibility:H,autoScroll:z=!0,children:W,sensors:K=iR,collisionDetection:q=KR,measuring:V,modifiers:U,...B}=J,F=J0.useReducer(nR,void 0,sR),[N,L]=F,[_,M]=ZR(),[O,D]=J0.useState(h2.Uninitialized),A=O===h2.Initialized,{draggable:{active:T,nodes:S,translate:k},droppable:{containers:P}}=N,g=T!=null?S.get(T):null,C=J0.useRef({initial:null,translated:null}),I=J0.useMemo(()=>{var E0;return T!=null?{id:T,data:(E0=g==null?void 0:g.data)!=null?E0:rR,rect:C}:null},[T,g]),y=J0.useRef(null),[b,R]=J0.useState(null),[x,v]=J0.useState(null),d=n6(B,Object.values(B)),w=r3("DndDescribedBy",G),z0=J0.useMemo(()=>P.getEnabled(),[P]),G0=tR(V),{droppableRects:E,measureDroppableContainers:s,measuringScheduled:A0}=xR(z0,{dragging:A,dependencies:[k.x,k.y],config:G0.droppable}),l=yR(S,T),H0=J0.useMemo(()=>x?s3(x):null,[x]),q0=q5(),X0=hR(l,G0.draggable.measure);eR({activeNode:T!=null?S.get(T):null,config:q0.layoutShiftCompensation,initialRect:X0,measure:G0.draggable.measure});let Q0=DL(l,G0.draggable.measure,X0),V0=DL(l?l.parentElement:null),p=J0.useRef({activatorEvent:null,active:null,activeNode:l,collisionRect:null,collisions:null,droppableRects:E,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Z0=P.getNodeFor(($=p.current.over)==null?void 0:$.id),e=lR({measure:G0.dragOverlay.measure}),_0=(X=e.nodeRef.current)!=null?X:l,i=A?(Q=e.rect)!=null?Q:Q0:null,W0=Boolean(e.nodeRef.current&&e.rect),r=mR(W0?null:Q0),o=uL(_0?a5(_0):null),f=fR(A?Z0!=null?Z0:l:null),u=dR(f),L0=iL(U,{transform:{x:k.x-r.x,y:k.y-r.y,scaleX:1,scaleY:1},activatorEvent:x,active:I,activeNodeRect:Q0,containerNodeRect:V0,draggingNodeRect:i,over:p.current.over,overlayNodeRect:e.rect,scrollableAncestors:f,scrollableAncestorRects:u,windowRect:o}),M0=H0?g4(H0,k):null,h0=pR(f),l0=wL(h0),h=wL(h0,[Q0]),c=g4(L0,l0),t=i?UR(i,L0):null,U0=I&&t?q({active:I,collisionRect:t,droppableRects:E,droppableContainers:z0,pointerCoordinates:M0}):null,C0=zR(U0,"id"),[m0,w1]=J0.useState(null),b1=W0?L0:g4(L0,h),v0=qR(b1,(Y=m0==null?void 0:m0.rect)!=null?Y:null,Q0),i0=J0.useRef(null),e0=J0.useCallback((E0,x0)=>{let{sensor:s0,options:n0}=x0;if(y.current==null)return;let z1=S.get(y.current);if(!z1)return;let B1=E0.nativeEvent,C1=new s0({active:y.current,activeNode:z1,event:B1,options:n0,context:p,onAbort(H1){if(!S.get(H1))return;let{onDragAbort:H5}=d.current,V5={id:H1};H5==null||H5(V5),_({type:"onDragAbort",event:V5})},onPending(H1,m1,H5,V5){if(!S.get(H1))return;let{onDragPending:p0}=d.current,S0={id:H1,constraint:m1,initialCoordinates:H5,offset:V5};p0==null||p0(S0),_({type:"onDragPending",event:S0})},onStart(H1){let m1=y.current;if(m1==null)return;let H5=S.get(m1);if(!H5)return;let{onDragStart:V5}=d.current,T0={activatorEvent:B1,active:{id:m1,data:H5.data,rect:C}};f4.unstable_batchedUpdates(()=>{V5==null||V5(T0),D(h2.Initializing),L({type:O5.DragStart,initialCoordinates:H1,active:m1}),_({type:"onDragStart",event:T0}),R(i0.current),v(B1)})},onMove(H1){L({type:O5.DragMove,coordinates:H1})},onEnd:g1(O5.DragEnd),onCancel:g1(O5.DragCancel)});i0.current=C1;function g1(H1){return async function(){let{active:H5,collisions:V5,over:T0,scrollAdjustedTranslate:p0}=p.current,S0=null;if(H5&&p0){let{cancelDrop:o0}=d.current;if(S0={activatorEvent:B1,active:H5,collisions:V5,delta:p0,over:T0},H1===O5.DragEnd&&typeof o0==="function"){if(await Promise.resolve(o0(S0)))H1=O5.DragCancel}}y.current=null,f4.unstable_batchedUpdates(()=>{L({type:H1}),D(h2.Uninitialized),w1(null),R(null),v(null),i0.current=null;let o0=H1===O5.DragEnd?"onDragEnd":"onDragCancel";if(S0){let q1=d.current[o0];q1==null||q1(S0),_({type:o0,event:S0})}})}}},[S]),f0=J0.useCallback((E0,x0)=>{return(s0,n0)=>{let z1=s0.nativeEvent,B1=S.get(n0);if(y.current!==null||!B1||z1.dndKit||z1.defaultPrevented)return;let C1={active:B1};if(E0(s0,x0.options,C1)===!0)z1.dndKit={capturedBy:x0.sensor},y.current=n0,e0(s0,x0)}},[S,e0]),Q1=bR(K,f0);uR(K),u9(()=>{if(Q0&&O===h2.Initializing)D(h2.Initialized)},[Q0,O]),J0.useEffect(()=>{let{onDragMove:E0}=d.current,{active:x0,activatorEvent:s0,collisions:n0,over:z1}=p.current;if(!x0||!s0)return;let B1={active:x0,activatorEvent:s0,collisions:n0,delta:{x:c.x,y:c.y},over:z1};f4.unstable_batchedUpdates(()=>{E0==null||E0(B1),_({type:"onDragMove",event:B1})})},[c.x,c.y]),J0.useEffect(()=>{let{active:E0,activatorEvent:x0,collisions:s0,droppableContainers:n0,scrollAdjustedTranslate:z1}=p.current;if(!E0||y.current==null||!x0||!z1)return;let{onDragOver:B1}=d.current,C1=n0.get(C0),g1=C1&&C1.rect.current?{id:C1.id,rect:C1.rect.current,data:C1.data,disabled:C1.disabled}:null,H1={active:E0,activatorEvent:x0,collisions:s0,delta:{x:z1.x,y:z1.y},over:g1};f4.unstable_batchedUpdates(()=>{w1(g1),B1==null||B1(H1),_({type:"onDragOver",event:H1})})},[C0]),u9(()=>{p.current={activatorEvent:x,active:I,activeNode:l,collisionRect:t,collisions:U0,droppableRects:E,draggableNodes:S,draggingNode:_0,draggingNodeRect:i,droppableContainers:P,over:m0,scrollableAncestors:f,scrollAdjustedTranslate:c},C.current={initial:i,translated:t}},[I,l,U0,t,S,_0,i,E,P,m0,f,c]),ER({...q0,delta:k,draggingRect:t,pointerCoordinates:M0,scrollableAncestors:f,scrollableAncestorRects:u});let K5=J0.useMemo(()=>{return{active:I,activeNode:l,activeNodeRect:Q0,activatorEvent:x,collisions:U0,containerNodeRect:V0,dragOverlay:e,draggableNodes:S,droppableContainers:P,droppableRects:E,over:m0,measureDroppableContainers:s,scrollableAncestors:f,scrollableAncestorRects:u,measuringConfiguration:G0,measuringScheduled:A0,windowRect:o}},[I,l,Q0,x,U0,V0,e,S,P,E,m0,s,f,u,G0,A0,o]),x1=J0.useMemo(()=>{return{activatorEvent:x,activators:Q1,active:I,activeNodeRect:Q0,ariaDescribedById:{draggable:w},dispatch:L,draggableNodes:S,over:m0,measureDroppableContainers:s}},[x,Q1,I,Q0,L,w,S,m0,s]);return J0.default.createElement(CL.Provider,{value:M},J0.default.createElement(JZ.Provider,{value:x1},J0.default.createElement(lL.Provider,{value:K5},J0.default.createElement(WX.Provider,{value:v0},W)),J0.default.createElement(oR,{disabled:(H==null?void 0:H.restoreFocus)===!1})),J0.default.createElement(XR,{...H,hiddenTextDescribedById:w}));function q5(){let E0=(b==null?void 0:b.autoScrollEnabled)===!1,x0=typeof z==="object"?z.enabled===!1:z===!1,s0=A&&!E0&&!x0;if(typeof z==="object")return{...z,enabled:s0};return{enabled:s0}}}),Zy=J0.createContext(null),jL="button",Jy="Draggable";function aL(Z){let{id:J,data:$,disabled:X=!1,attributes:Q}=Z,Y=r3(Jy),{activators:G,activatorEvent:H,active:z,activeNodeRect:W,ariaDescribedById:K,draggableNodes:q,over:V}=J0.useContext(JZ),{role:U=jL,roleDescription:B="draggable",tabIndex:F=0}=Q!=null?Q:{},N=(z==null?void 0:z.id)===J,L=J0.useContext(N?WX:Zy),[_,M]=l3(),[O,D]=l3(),A=cR(G,J),T=n6($);u9(()=>{return q.set(J,{id:J,key:Y,node:_,activatorNode:O,data:T}),()=>{let k=q.get(J);if(k&&k.key===Y)q.delete(J)}},[q,J]);let S=J0.useMemo(()=>({role:U,tabIndex:F,"aria-disabled":X,"aria-pressed":N&&U===jL?!0:void 0,"aria-roledescription":B,"aria-describedby":K.draggable}),[X,U,F,N,B,K.draggable]);return{active:z,activatorEvent:H,activeNodeRect:W,attributes:S,isDragging:N,listeners:X?void 0:A,node:_,over:V,setNodeRef:M,setActivatorNodeRef:D,transform:L}}function $y(){return J0.useContext(lL)}var Xy="Droppable",Qy={timeout:25};function sL(Z){let{data:J,disabled:$=!1,id:X,resizeObserverConfig:Q}=Z,Y=r3(Xy),{active:G,dispatch:H,over:z,measureDroppableContainers:W}=J0.useContext(JZ),K=J0.useRef({disabled:$}),q=J0.useRef(!1),V=J0.useRef(null),U=J0.useRef(null),{disabled:B,updateMeasurementsFor:F,timeout:N}={...Qy,...Q},L=n6(F!=null?F:X),_=J0.useCallback(()=>{if(!q.current){q.current=!0;return}if(U.current!=null)clearTimeout(U.current);U.current=setTimeout(()=>{W(Array.isArray(L.current)?L.current:[L.current]),U.current=null},N)},[N]),M=zX({callback:_,disabled:B||!G}),O=J0.useCallback((S,k)=>{if(!M)return;if(k)M.unobserve(k),q.current=!1;if(S)M.observe(S)},[M]),[D,A]=l3(O),T=n6(J);return J0.useEffect(()=>{if(!M||!D.current)return;M.disconnect(),q.current=!1,M.observe(D.current)},[D,M]),J0.useEffect(()=>{return H({type:O5.RegisterDroppable,element:{id:X,key:Y,disabled:$,node:D,rect:V,data:T}}),()=>H({type:O5.UnregisterDroppable,key:Y,id:X})},[X]),J0.useEffect(()=>{if($!==K.current.disabled)H({type:O5.SetDroppableDisabled,id:X,key:Y,disabled:$}),K.current.disabled=$},[X,Y,$,H]),{active:G,rect:V,isOver:(z==null?void 0:z.id)===X,node:D,over:z,setNodeRef:A}}function Yy(Z){let{animation:J,children:$}=Z,[X,Q]=J0.useState(null),[Y,G]=J0.useState(null),H=i3($);if(!$&&!X&&H)Q(H);return u9(()=>{if(!Y)return;let z=X==null?void 0:X.key,W=X==null?void 0:X.props.id;if(z==null||W==null){Q(null);return}Promise.resolve(J(W,Y)).then(()=>{Q(null)})},[J,X,Y]),J0.default.createElement(J0.default.Fragment,null,$,X?J0.cloneElement(X,{ref:G}):null)}var Gy={x:0,y:0,scaleX:1,scaleY:1};function Hy(Z){let{children:J}=Z;return J0.default.createElement(JZ.Provider,{value:dL},J0.default.createElement(WX.Provider,{value:Gy},J))}var zy={position:"fixed",touchAction:"none"},Wy=(Z)=>{return $X(Z)?"transform 250ms ease":void 0},Ky=J0.forwardRef((Z,J)=>{let{as:$,activatorEvent:X,adjustScale:Q,children:Y,className:G,rect:H,style:z,transform:W,transition:K=Wy}=Z;if(!H)return null;let q=Q?W:{...W,scaleX:1,scaleY:1},V={...zy,width:H.width,height:H.height,top:H.top,left:H.left,transform:a6.Transform.toString(q),transformOrigin:Q&&X?YR(X,H):void 0,transition:typeof K==="function"?K(X):K,...z};return J0.default.createElement($,{className:G,style:V,ref:J},Y)}),qy=(Z)=>(J)=>{let{active:$,dragOverlay:X}=J,Q={},{styles:Y,className:G}=Z;if(Y!=null&&Y.active)for(let[H,z]of Object.entries(Y.active)){if(z===void 0)continue;Q[H]=$.node.style.getPropertyValue(H),$.node.style.setProperty(H,z)}if(Y!=null&&Y.dragOverlay)for(let[H,z]of Object.entries(Y.dragOverlay)){if(z===void 0)continue;X.node.style.setProperty(H,z)}if(G!=null&&G.active)$.node.classList.add(G.active);if(G!=null&&G.dragOverlay)X.node.classList.add(G.dragOverlay);return function(){for(let[z,W]of Object.entries(Q))$.node.style.setProperty(z,W);if(G!=null&&G.active)$.node.classList.remove(G.active)}},Vy=(Z)=>{let{transform:{initial:J,final:$}}=Z;return[{transform:a6.Transform.toString(J)},{transform:a6.Transform.toString($)}]},Uy={duration:250,easing:"ease",keyframes:Vy,sideEffects:qy({styles:{active:{opacity:"0"}}})};function By(Z){let{config:J,draggableNodes:$,droppableContainers:X,measuringConfiguration:Q}=Z;return d3((Y,G)=>{if(J===null)return;let H=$.get(Y);if(!H)return;let z=H.node.current;if(!z)return;let W=cL(G);if(!W)return;let{transform:K}=a5(G).getComputedStyle(G),q=kL(K);if(!q)return;let V=typeof J==="function"?J:Fy(J);return gL(z,Q.draggable.measure),V({active:{id:Y,data:H.data,node:z,rect:Q.draggable.measure(z)},draggableNodes:$,dragOverlay:{node:G,rect:Q.dragOverlay.measure(W)},droppableContainers:X,measuringConfiguration:Q,transform:q})})}function Fy(Z){let{duration:J,easing:$,sideEffects:X,keyframes:Q}={...Uy,...Z};return(Y)=>{let{active:G,dragOverlay:H,transform:z,...W}=Y;if(!J)return;let K={x:H.rect.left-G.rect.left,y:H.rect.top-G.rect.top},q={scaleX:z.scaleX!==1?G.rect.width*z.scaleX/H.rect.width:1,scaleY:z.scaleY!==1?G.rect.height*z.scaleY/H.rect.height:1},V={x:z.x-K.x,y:z.y-K.y,...q},U=Q({...W,active:G,dragOverlay:H,transform:{initial:z,final:V}}),[B]=U,F=U[U.length-1];if(JSON.stringify(B)===JSON.stringify(F))return;let N=X==null?void 0:X({active:G,dragOverlay:H,...W}),L=H.node.animate(U,{duration:J,easing:$,fill:"forwards"});return new Promise((_)=>{L.onfinish=()=>{N==null||N(),_()}})}}var TL=0;function Ly(Z){return J0.useMemo(()=>{if(Z==null)return;return TL++,TL},[Z])}var nL=J0.default.memo((Z)=>{let{adjustScale:J=!1,children:$,dropAnimation:X,style:Q,transition:Y,modifiers:G,wrapperElement:H="div",className:z,zIndex:W=999}=Z,{activatorEvent:K,active:q,activeNodeRect:V,containerNodeRect:U,draggableNodes:B,droppableContainers:F,dragOverlay:N,over:L,measuringConfiguration:_,scrollableAncestors:M,scrollableAncestorRects:O,windowRect:D}=$y(),A=J0.useContext(WX),T=Ly(q==null?void 0:q.id),S=iL(G,{activatorEvent:K,active:q,activeNodeRect:V,containerNodeRect:U,draggingNodeRect:N.rect,over:L,overlayNodeRect:N.rect,scrollableAncestors:M,scrollableAncestorRects:O,transform:A,windowRect:D}),k=fH(V),P=By({config:X,draggableNodes:B,droppableContainers:F,measuringConfiguration:_}),g=k?N.setRef:void 0;return J0.default.createElement(Hy,null,J0.default.createElement(Yy,{animation:P},q&&T?J0.default.createElement(Ky,{key:T,id:q.id,ref:g,as:H,activatorEvent:K,adjustScale:J,className:z,transition:Y,rect:k,style:{zIndex:W,...Q},transform:S},$):null))});var p4=j(a(),1),Ny={start:[V1.Space],cancel:[V1.Esc],end:[V1.Space,V1.Tab]};function _y(Z,J,$){let X=Z.indexOf(J),Q=Z.indexOf($);if(X<0||Q<0||X===Q)return Z;let Y=[...Z],[G]=Y.splice(X,1);return Y.splice(Q,0,G),Y}function KX({items:Z,getId:J,className:$,itemClassName:X,dragDisabled:Q=!1,onReorder:Y,renderItem:G,renderPlaceholder:H,renderOverlay:z}){let W=SL(gH(ZZ,{activationConstraint:{distance:4}}),gH(e3,{keyboardCodes:Ny})),[K,q]=v2.useState(null),[V,U]=v2.useState(null),B=v2.useRef(null),F=v2.useMemo(()=>Z.map(J),[Z,J]),N=v2.useMemo(()=>new Map(Z.map((T)=>[J(T),T])),[Z,J]),_=(K&&V?V:F).map((T)=>N.get(T)).filter((T)=>Boolean(T)),M=K?N.get(K):void 0,O=Q||Z.length<2;return p4.jsxs(rL,{sensors:W,collisionDetection:IL,onDragStart:(T)=>{let S=Z.map(J);q(String(T.active.id)),B.current=S,U(S)},onDragOver:(T)=>{let S=String(T.active.id),k=T.over?String(T.over.id):void 0,P=B.current;if(!k||k===S||!P)return;let g=_y(P,S,k);if(g===P)return;B.current=g,U(g)},onDragCancel:()=>{B.current=null,q(null),U(null)},onDragEnd:(T)=>{let S=String(T.active.id),k=B.current;if(B.current=null,q(null),U(null),!k||k.join("|")===F.join("|"))return;if(!k.includes(S))return;Y(k)},children:[p4.jsx("div",{className:$,children:_.map((T)=>p4.jsx(Ay,{id:J(T),item:T,disabled:O,itemClassName:X,renderItem:G,renderPlaceholder:H},J(T)))}),p4.jsx(nL,{dropAnimation:null,children:M&&z?z(M):null})]})}function Ay({id:Z,item:J,disabled:$,itemClassName:X,renderItem:Q,renderPlaceholder:Y}){let{setNodeRef:G,isOver:H}=sL({id:Z,disabled:$}),{attributes:z,listeners:W,setNodeRef:K,isDragging:q}=aL({id:Z,disabled:$,attributes:{roleDescription:"sortable item"}}),V=(B)=>{G(B),K(B)},U={isDragging:q,isOver:H,dragDisabled:$,dragHandleProps:$?{}:{...z,...W}};return p4.jsxs(n1.div,{layout:!0,ref:V,className:B0("relative",X?.(J,U)),transition:{type:"spring",duration:0.25,bounce:0},children:[q&&Y?.(J),Q(J,U)]})}var _1=j(a(),1);function eL(Z){return B0($Z({variant:"ghost",size:"icon"}),Z&&"bg-accent text-accent-foreground")}function J8({children:Z,panel:J="default",showWorkspaces:$=!0}){let{data:X}=O$(),Q=Z1();return W9((Y)=>{if(Y.type==="workspace:updated"||Y.type==="workspaces-list:updated")Q.invalidateQueries({queryKey:D0.all,exact:!0})}),_1.jsxs("div",{className:"flex h-dvh bg-muted",children:[_1.jsx(My,{workspaces:$?X??[]:[]}),_1.jsx("main",{className:B0("flex min-w-0 flex-1 flex-col overflow-hidden",J==="default"&&"rounded-l-md border-l border-border bg-background shadow-[1px_0_3px_0_var(--border)]"),children:Z})]})}function My({workspaces:Z}){let J=CB();return _1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5",children:[_1.jsx(Z8,{href:"/","aria-label":"Home",title:"Home",className:eL,children:_1.jsx(tL,{stroke:1.5})}),_1.jsx("nav",{className:"flex max-h-full min-h-0 w-14 flex-1 flex-col items-center justify-center gap-4",children:Z.length>0&&_1.jsxs(_1.Fragment,{children:[_1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:_1.jsx(KX,{items:Z,getId:($)=>$.id,className:"flex flex-col gap-4",onReorder:($)=>J.mutate($),renderPlaceholder:()=>_1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-10 rounded-lg bg-accent"}),renderOverlay:($)=>_1.jsx(oL,{workspace:$,dragOverlay:!0}),renderItem:($,X)=>_1.jsx(oL,{workspace:$,dragState:X})})}),_1.jsx("div",{className:"shrink-0",children:_1.jsx(u3,{trigger:_1.jsx(I0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",title:"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:_1.jsx(s5,{"data-icon":"inline-start",stroke:1.5})})})})]})}),_1.jsx(Dy,{})]})}function Dy(){return _1.jsx(Z8,{href:"/connectors","aria-label":"Connectors",title:"Connectors",className:eL,children:_1.jsx(h6,{stroke:1.5})})}function oL({workspace:Z,dragOverlay:J=!1,dragState:$}){let[X]=p9(),Q=`/workspace/${Z.id}`,Y=f3(Z),G=X===Q,H=_1.jsxs(_1.Fragment,{children:[_1.jsx("div",{className:B0($Z({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12",J?"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&&!J&&"bg-accent text-accent-foreground"),children:_1.jsx("img",{src:Z.icon??Y2[Z.type??"claude-code"],alt:"",className:"size-7 shrink-0 rounded-[4px]"})}),_1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:Y})]});if(J)return _1.jsx("span",{className:"flex w-14 flex-col items-center",children:H});return _1.jsx(Z8,{href:Q,"aria-label":Y,title:Y,onClick:(z)=>{if($?.isDragging)z.preventDefault()},className:B0("group flex w-14 flex-col items-center rounded-sm outline-none",$?.isDragging&&"invisible"),...$?.dragHandleProps,children:H})}var ZN=j(a(),1);function $8({className:Z,...J}){return ZN.jsx("div",{"data-slot":"skeleton",className:B0("animate-pulse rounded-md bg-muted",Z),...J})}var o1=j(a(),1),Oy=Array.from({length:6},(Z,J)=>J);function JN(){return o1.jsx(J8,{panel:"flat",children:o1.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o1.jsx(wy,{})})})}function wy(){let Z=GV();return o1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[o1.jsx("div",{className:"mb-4 flex items-center justify-between gap-2",children:o1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Connectors"})}),o1.jsx(Py,{connectorsQuery:Z})]})}function Py({connectorsQuery:Z}){if(Z.isPending)return o1.jsx("div",{role:"status","aria-label":"Loading connectors",className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:Oy.map(($)=>o1.jsxs("div",{className:"flex min-h-20 items-center gap-3 rounded-xl border border-border bg-card px-4 py-3",children:[o1.jsx($8,{className:"size-10 shrink-0 rounded-sm"}),o1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[o1.jsx($8,{className:"h-4 w-36"}),o1.jsx($8,{className:"h-3 w-20"})]})]},$))});if(Z.isError)return o1.jsxs("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:[o1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),o1.jsx(I0,{variant:"outline",size:"sm",onClick:()=>Z.refetch(),children:"Retry"})]});let J=KH(Z.data);if(J.length===0)return o1.jsxs("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:[o1.jsx(h6,{size:24,stroke:1.5,className:"text-muted-foreground"}),o1.jsx("p",{className:"mx-auto max-w-md text-sm text-foreground",children:"No user connectors configured."})]});return o1.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:J.map(($)=>o1.jsx(DB,{server:$},$.name))})}var QZ=j(m(),1);var YZ=j(a(),1),jy=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],g2=10,qX=3,Ty=2.5,Cy={O:1,o:0.5,".":0},Sy=3000,Iy=2,$N=3,m2=3,XN=0.001,u4={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function Ey(Z){let J=Math.max(...Z.map((Y)=>Y.length)),$=J*g2+(J-1)*qX,X=Z.length*g2+(Z.length-1)*qX,Q=[];return Z.forEach((Y,G)=>{Array.from(Y).forEach((H,z)=>{let W=Cy[H];if(W===void 0)return;let K=z*(g2+qX),q=G*(g2+qX);Q.push({x:K,y:q,centerX:K+g2/2,centerY:q+g2/2,targetOpacity:W})})}),{width:$,height:X,fieldColumns:Math.round($/m2)+1,fieldRows:Math.round(X/m2)+1,pixels:Q}}var ky=jy.map(Ey);function XZ(Z,J,$){return Z<J?J:Z>$?$:Z}function Ry(Z){return Z<0.5?2*Z*Z:1-(-2*Z+2)**2/2}class QN{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=Z,this.svg=J,this.geometry=$;let X=$.fieldColumns*$.fieldRows;this.field=new Float32Array(X),this.previousField=new Float32Array(X),this.nextField=new Float32Array(X)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=(Z)=>{let J=this.svg.getBoundingClientRect();if(!J.width||!J.height)return;if(this.pointerActive=Z.clientX>=J.left&&Z.clientX<=J.right&&Z.clientY>=J.top&&Z.clientY<=J.bottom,this.pointerActive)this.pointerX=(Z.clientX-J.left)/J.width*this.geometry.width,this.pointerY=(Z.clientY-J.top)/J.height*this.geometry.height,this.resume()};seedImpulse(){let Z=Math.round(this.geometry.width/2/m2),J=Math.round(this.geometry.height/2/m2),$=2*$N*$N;for(let X=0;X<this.geometry.fieldRows;X++)for(let Q=0;Q<this.geometry.fieldColumns;Q++){let Y=(Q-Z)**2+(X-J)**2,G=Iy*Math.exp(-Y/$),H=X*this.geometry.fieldColumns+Q;this.field[H]=G,this.previousField[H]=G}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=(Z)=>{if(this.stepWave(),this.pointerActive)this.driveWave(Z);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=Z;let $=(Z-this.introStartedAt)/Sy;if(this.activation=1-Ry(Math.min(1,$)),$>=1)this.intro=!1}else{this.intro=!1;let $=this.pointerActive?1:0,X=this.pointerActive?u4.fadeIn:u4.fadeOut;this.activation+=($-this.activation)*X}let J=this.renderWave();if(this.intro||this.pointerActive||this.activation>XN||J>XN){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:Z,fieldRows:J}=this.geometry;for(let X=1;X<J-1;X++)for(let Q=1;Q<Z-1;Q++){let Y=X*Z+Q,G=this.field[Y-1]+this.field[Y+1]+this.field[Y-Z]+this.field[Y+Z]-4*this.field[Y];this.nextField[Y]=(2*this.field[Y]-this.previousField[Y]+u4.courantSquared*G)*u4.damping}let $=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=$}driveWave(Z){let J=XZ(Math.round(this.pointerX/m2),1,this.geometry.fieldColumns-2),$=XZ(Math.round(this.pointerY/m2),1,this.geometry.fieldRows-2);this.field[$*this.geometry.fieldColumns+J]=u4.driveAmplitude*Math.sin(Z*u4.driveFrequency)}sampleField(Z,J){let $=XZ(Z/m2,0,this.geometry.fieldColumns-1),X=XZ(J/m2,0,this.geometry.fieldRows-1),Q=Math.floor($),Y=Math.floor(X),G=Math.min(Q+1,this.geometry.fieldColumns-1),H=Math.min(Y+1,this.geometry.fieldRows-1),z=$-Q,W=X-Y,{fieldColumns:K}=this.geometry,q=this.field[Y*K+Q],V=this.field[Y*K+G],U=this.field[H*K+Q],B=this.field[H*K+G];return(q*(1-z)+V*z)*(1-W)+(U*(1-z)+B*z)*W}renderWave(){let Z=0;return this.geometry.pixels.forEach((J,$)=>{let X=this.rects[$];if(!X)return;let Q=this.sampleField(J.centerX,J.centerY);Z=Math.max(Z,Math.abs(Q));let Y=XZ(0.5+Q*u4.gain,0,1),G=J.targetOpacity*(1-this.activation)+Y*this.activation;X.setAttribute("opacity",G.toFixed(3))}),Z}renderTargets(){this.geometry.pixels.forEach((Z,J)=>{this.rects[J]?.setAttribute("opacity",String(Z.targetOpacity))})}}function yy({geometry:Z}){let J=QZ.useRef([]),$=QZ.useRef(null);return QZ.useEffect(()=>{let X=$.current;if(!X||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let Q=new QN(J.current,X,Z);return Q.start(),window.addEventListener("pointermove",Q.handlePointerMove),()=>{Q.stop(),window.removeEventListener("pointermove",Q.handlePointerMove)}},[Z]),YZ.jsx("svg",{ref:$,className:"h-8 w-auto",viewBox:`0 0 ${Z.width} ${Z.height}`,fill:"currentColor","aria-hidden":"true",children:Z.pixels.map((X,Q)=>YZ.jsx("rect",{ref:(Y)=>{J.current[Q]=Y},x:X.x,y:X.y,width:g2,height:g2,rx:Ty,opacity:X.targetOpacity},`${X.x}-${X.y}`))})}function YN({className:Z}){return YZ.jsx("div",{role:"img","aria-label":"moi",className:B0("flex items-center gap-2 text-accent",Z),children:ky.map((J,$)=>YZ.jsx(yy,{geometry:J},$))})}var X8={};t7(X8,{Trigger:()=>VN,Root:()=>qN,Panel:()=>FN});var GZ=j(m(),1);var C7=j(m(),1);function GN(Z){let{open:J,defaultOpen:$,onOpenChange:X,disabled:Q}=Z,Y=J!==void 0,[G,H]=g9({controlled:J,default:$,name:"Collapsible",state:"open"}),{mounted:z,setMounted:W,transitionStatus:K}=m7(G,!0,!0),[q,V]=C7.useState(G),[{height:U,width:B},F]=C7.useState({height:void 0,width:void 0}),N=d0(),[L,_]=C7.useState(),M=L??N,[O,D]=C7.useState(!1),[A,T]=C7.useState(!1),S=C7.useRef(null),k=C7.useRef(null),P=C7.useRef(null),g=C7.useRef(null),C=C9(g,!1),I=Y0((y)=>{let b=!G,R=N0(n.triggerPress,y.nativeEvent);if(X(b,R),R.isCanceled)return;let x=g.current;if(k.current==="css-animation"&&x!=null)x.style.removeProperty("animation-name");if(!O&&!A){if(k.current!=null&&k.current!=="css-animation"){if(!z&&b)W(!0)}if(k.current==="css-animation"){if(!q&&b)V(!0);if(!z&&b)W(!0)}}if(H(b),k.current==="none"&&z&&!b)W(!1)});return $0(()=>{if(Y&&k.current==="none"&&!A&&!G)W(!1)},[Y,A,G,J,W]),C7.useMemo(()=>({abortControllerRef:S,animationTypeRef:k,disabled:Q,handleTrigger:I,height:U,mounted:z,open:G,panelId:M,panelRef:g,runOnceAnimationsFinish:C,setDimensions:F,setHiddenUntilFound:D,setKeepMounted:T,setMounted:W,setOpen:H,setPanelIdState:_,setVisible:V,transitionDimensionRef:P,transitionStatus:K,visible:q,width:B}),[S,k,Q,I,U,z,G,M,g,C,F,D,T,W,H,V,P,K,q,B])}var VX=j(m(),1),pH=VX.createContext(void 0);function UX(){let Z=VX.useContext(pH);if(Z===void 0)throw Error(w0(15));return Z}var c4=function(Z){return Z.open="data-open",Z.closed="data-closed",Z[Z.startingStyle=T9.startingStyle]="startingStyle",Z[Z.endingStyle=T9.endingStyle]="endingStyle",Z}({});var HN=function(Z){return Z.panelOpen="data-panel-open",Z}({});var by={[c4.open]:""},xy={[c4.closed]:""},zN={open(Z){if(Z)return{[HN.panelOpen]:""};return null}},WN={open(Z){if(Z)return by;return xy}};var BX={...WN,...j1};var KN=j(a(),1),qN=GZ.forwardRef(function(J,$){let{render:X,className:Q,defaultOpen:Y=!1,disabled:G=!1,onOpenChange:H,open:z,...W}=J,K=Y0(H),q=GN({open:z,defaultOpen:Y,onOpenChange:K,disabled:G}),V=GZ.useMemo(()=>({open:q.open,disabled:q.disabled,transitionStatus:q.transitionStatus}),[q.open,q.disabled,q.transitionStatus]),U=GZ.useMemo(()=>({...q,onOpenChange:K,state:V}),[q,K,V]),B=K0("div",J,{state:V,ref:$,props:W,stateAttributesMapping:BX});return KN.jsx(pH.Provider,{value:U,children:B})});var FX=j(m(),1);var hy={...zN,...j1},VN=FX.forwardRef(function(J,$){let{panelId:X,open:Q,handleTrigger:Y,state:G,disabled:H}=UX(),{className:z,disabled:W=H,id:K,render:q,nativeButton:V=!0,...U}=J,{getButtonProps:B,buttonRef:F}=v5({disabled:W,focusableWhenDisabled:!0,native:V}),N=FX.useMemo(()=>({"aria-controls":Q?X:void 0,"aria-expanded":Q,onClick:Y}),[X,Q,Y]);return K0("button",J,{state:G,ref:[$,F],props:[N,U,B],stateAttributesMapping:hy})});var LX=j(m(),1);var c9=j(m(),1);var UN=function(Z){return Z.disabled="data-disabled",Z.orientation="data-orientation",Z}({});function BN(Z){let{abortControllerRef:J,animationTypeRef:$,externalRef:X,height:Q,hiddenUntilFound:Y,keepMounted:G,id:H,mounted:z,onOpenChange:W,open:K,panelRef:q,runOnceAnimationsFinish:V,setDimensions:U,setMounted:B,setOpen:F,setVisible:N,transitionDimensionRef:L,visible:_,width:M}=Z,O=c9.useRef(!1),D=c9.useRef(null),A=c9.useRef(K),T=c9.useRef(K),S=h7(),k=c9.useMemo(()=>{if($.current==="css-animation")return!_;return!K&&!z},[K,z,_,$]),P=Y0((C)=>{if(!C)return;if($.current==null||L.current==null){let b=getComputedStyle(C),R=b.animationName!=="none"&&b.animationName!=="",x=b.transitionDuration!=="0s"&&b.transitionDuration!=="";if(R&&x);else if(b.animationName==="none"&&b.transitionDuration!=="0s")$.current="css-transition";else if(b.animationName!=="none"&&b.transitionDuration==="0s")$.current="css-animation";else $.current="none";if(C.getAttribute(UN.orientation)==="horizontal"||b.transitionProperty.indexOf("width")>-1)L.current="width";else L.current="height"}if($.current!=="css-transition")return;if(Q===void 0||M===void 0){if(U({height:C.scrollHeight,width:C.scrollWidth}),T.current)C.style.setProperty("transition-duration","0s")}let I=-1,y=-1;return I=h1.request(()=>{T.current=!1,y=h1.request(()=>{setTimeout(()=>{C.style.removeProperty("transition-duration")})})}),()=>{h1.cancel(I),h1.cancel(y)}}),g=Z9(X,q,P);return $0(()=>{if($.current!=="css-transition")return;let C=q.current;if(!C)return;let I=-1;if(J.current!=null)J.current.abort(),J.current=null;if(K){let y={"justify-content":C.style.justifyContent,"align-items":C.style.alignItems,"align-content":C.style.alignContent,"justify-items":C.style.justifyItems};if(Object.keys(y).forEach((b)=>{C.style.setProperty(b,"initial","important")}),!T.current&&!G)C.setAttribute(c4.startingStyle,"");U({height:C.scrollHeight,width:C.scrollWidth}),I=h1.request(()=>{Object.entries(y).forEach(([b,R])=>{if(R==="")C.style.removeProperty(b);else C.style.setProperty(b,R)})})}else{if(C.scrollHeight===0&&C.scrollWidth===0)return;U({height:C.scrollHeight,width:C.scrollWidth});let y=new AbortController;J.current=y;let b=y.signal,R=null,x=c4.endingStyle;return R=new MutationObserver((v)=>{if(v.some((w)=>w.type==="attributes"&&w.attributeName===x))R?.disconnect(),R=null,V(()=>{if(U({height:0,width:0}),C.style.removeProperty("content-visibility"),B(!1),J.current===y)J.current=null},b)}),R.observe(C,{attributes:!0,attributeFilter:[x]}),()=>{if(R?.disconnect(),S.cancel(),J.current===y)y.abort(),J.current=null}}return()=>{h1.cancel(I)}},[J,$,S,Y,G,z,K,q,V,U,B]),$0(()=>{if($.current!=="css-animation")return;let C=q.current;if(!C)return;if(D.current=C.style.animationName||D.current,C.style.setProperty("animation-name","none"),U({height:C.scrollHeight,width:C.scrollWidth}),!A.current&&!O.current)C.style.removeProperty("animation-name");if(K){if(J.current!=null)J.current.abort(),J.current=null;B(!0),N(!0)}else J.current=new AbortController,V(()=>{B(!1),N(!1),J.current=null},J.current.signal)},[J,$,K,q,V,U,B,N,_]),O9(()=>{let C=h1.request(()=>{A.current=!1});return()=>h1.cancel(C)}),$0(()=>{if(!Y)return;let C=q.current;if(!C)return;let I=-1,y=-1;if(K&&O.current)C.style.transitionDuration="0s",U({height:C.scrollHeight,width:C.scrollWidth}),I=h1.request(()=>{O.current=!1,y=h1.request(()=>{setTimeout(()=>{C.style.removeProperty("transition-duration")})})});return()=>{h1.cancel(I),h1.cancel(y)}},[Y,K,q,U]),$0(()=>{let C=q.current;if(C&&Y&&k){if(C.setAttribute("hidden","until-found"),$.current==="css-transition")C.setAttribute(c4.startingStyle,"")}},[Y,k,$,q]),c9.useEffect(function(){let I=q.current;if(!I)return;function y(b){O.current=!0,F(!0),W(!0,N0(n.none,b))}return I.addEventListener("beforematch",y),()=>{I.removeEventListener("beforematch",y)}},[W,q,F]),c9.useMemo(()=>({props:{hidden:k,id:H,ref:g}}),[k,H,g])}var uH=function(Z){return Z.collapsiblePanelHeight="--collapsible-panel-height",Z.collapsiblePanelWidth="--collapsible-panel-width",Z}({});var FN=LX.forwardRef(function(J,$){let{className:X,hiddenUntilFound:Q,keepMounted:Y,render:G,id:H,...z}=J,{abortControllerRef:W,animationTypeRef:K,height:q,mounted:V,onOpenChange:U,open:B,panelId:F,panelRef:N,runOnceAnimationsFinish:L,setDimensions:_,setHiddenUntilFound:M,setKeepMounted:O,setMounted:D,setPanelIdState:A,setOpen:T,setVisible:S,state:k,transitionDimensionRef:P,visible:g,width:C,transitionStatus:I}=UX(),y=Q??!1,b=Y??!1;$0(()=>{if(H)return A(H),()=>{A(void 0)};return},[H,A]),$0(()=>{M(y)},[M,y]),$0(()=>{O(b)},[O,b]);let{props:R}=BN({abortControllerRef:W,animationTypeRef:K,externalRef:$,height:q,hiddenUntilFound:y,id:F,keepMounted:b,mounted:V,onOpenChange:U,open:B,panelRef:N,runOnceAnimationsFinish:L,setDimensions:_,setMounted:D,setOpen:T,setVisible:S,transitionDimensionRef:P,visible:g,width:C});B5({open:B&&I==="idle",ref:N,onComplete(){if(!B)return;_({height:void 0,width:void 0})}});let x=LX.useMemo(()=>({...k,transitionStatus:I}),[k,I]),v=K0("div",J,{state:x,ref:[$,N],props:[R,{style:{[uH.collapsiblePanelHeight]:q===void 0?"auto":`${q}px`,[uH.collapsiblePanelWidth]:C===void 0?"auto":`${C}px`}},z],stateAttributesMapping:BX});if(!(b||y||!b&&V))return null;return v});var NX=j(a(),1);function LN({...Z}){return NX.jsx(X8.Root,{"data-slot":"collapsible",...Z})}function NN({...Z}){return NX.jsx(X8.Trigger,{"data-slot":"collapsible-trigger",...Z})}function _N({...Z}){return NX.jsx(X8.Panel,{"data-slot":"collapsible-content",...Z})}function vy(Z,J){let $;try{$=Z()}catch(Q){return}return{getItem:(Q)=>{var Y;let G=(z)=>{if(z===null)return null;return JSON.parse(z,J==null?void 0:J.reviver)},H=(Y=$.getItem(Q))!=null?Y:null;if(H instanceof Promise)return H.then(G);return G(H)},setItem:(Q,Y)=>$.setItem(Q,JSON.stringify(Y,J==null?void 0:J.replacer)),removeItem:(Q)=>$.removeItem(Q)}}var cH=(Z)=>(J)=>{try{let $=Z(J);if($ instanceof Promise)return $;return{then(X){return cH(X)($)},catch(X){return this}}}catch($){return{then(X){return this},catch(X){return cH(X)($)}}}},gy=(Z,J)=>($,X,Q)=>{let Y={storage:vy(()=>window.localStorage),partialize:(N)=>N,version:0,merge:(N,L)=>({...L,...N}),...J},G=!1,H=0,z=new Set,W=new Set,K=Y.storage;if(!K)return Z((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${Y.name}', the given storage is currently unavailable.`),$(...N)},X,Q);let q=()=>{let N=Y.partialize({...X()});return K.setItem(Y.name,{state:N,version:Y.version})},V=Q.setState;Q.setState=(N,L)=>{return V(N,L),q()};let U=Z((...N)=>{return $(...N),q()},X,Q);Q.getInitialState=()=>U;let B,F=()=>{var N,L;if(!K)return;let _=++H;G=!1,z.forEach((O)=>{var D;return O((D=X())!=null?D:U)});let M=((L=Y.onRehydrateStorage)==null?void 0:L.call(Y,(N=X())!=null?N:U))||void 0;return cH(K.getItem.bind(K))(Y.name).then((O)=>{if(O)if(typeof O.version==="number"&&O.version!==Y.version){if(Y.migrate){let D=Y.migrate(O.state,O.version);if(D instanceof Promise)return D.then((A)=>[!0,A]);return[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then((O)=>{var D;if(_!==H)return;let[A,T]=O;if(B=Y.merge(T,(D=X())!=null?D:U),$(B,!0),A)return q()}).then(()=>{if(_!==H)return;M==null||M(X(),void 0),B=X(),G=!0,W.forEach((O)=>O(B))}).catch((O)=>{if(_!==H)return;M==null||M(void 0,O)})};if(Q.persist={setOptions:(N)=>{if(Y={...Y,...N},N.storage)K=N.storage},clearStorage:()=>{K==null||K.removeItem(Y.name)},getOptions:()=>Y,rehydrate:()=>F(),hasHydrated:()=>G,onHydrate:(N)=>{return z.add(N),()=>{z.delete(N)}},onFinishHydration:(N)=>{return W.add(N),()=>{W.delete(N)}}},!Y.skipHydration)F();return B||U},AN=gy;var dH=aq()(AN((Z)=>({sidebarCollapsed:!1,discoveredWorkspacesOpen:!0,toggleSidebar:()=>Z((J)=>({sidebarCollapsed:!J.sidebarCollapsed})),setSidebarCollapsed:(J)=>Z({sidebarCollapsed:J}),setDiscoveredWorkspacesOpen:(J)=>Z({discoveredWorkspacesOpen:J})}),{name:"moi:ui"}));var Q8=j(m(),1);var E5=j(a(),1),HZ={width:320,height:160,radius:24,topLeftRadius:12,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function my(Z){let{width:J,height:$,radius:X,topLeftRadius:Q,bodyTop:Y,tabEnd:G,shoulder:H}=HZ,z=Math.min(J/2,X*Z),W=Math.min(J/2,Q*Z),K=Math.max(0,H.width),q=G+K,V=Math.max(0,Math.min(H.roundness,K/2));return[`M ${W} 0`,`H ${G}`,`C ${G+V} 0 ${q-V} ${Y} ${q} ${Y}`,`H ${J-z}`,`Q ${J} ${Y} ${J} ${Y+X}`,`V ${$-X}`,`Q ${J} ${$} ${J-z} ${$}`,`H ${z}`,`Q 0 ${$} 0 ${$-X}`,`V ${Q}`,`Q 0 0 ${W} 0`,"Z"].join(" ")}function fy(){let Z=Q8.useRef(null),[J,$]=Q8.useState(1);return Q8.useLayoutEffect(()=>{let X=Z.current;if(!X)return;let Q=(H,z)=>{if(H<=0||z<=0)return;let W=H/HZ.width,q=z/HZ.height/W;$((V)=>Math.abs(V-q)<0.001?V:q)},Y=X.getBoundingClientRect();Q(Y.width,Y.height);let G=new ResizeObserver(([H])=>{if(H)Q(H.contentRect.width,H.contentRect.height)});return G.observe(X),()=>G.disconnect()},[]),{ref:Z,horizontalRadiusScale:J}}var _X=[B0("opacity-40","-translate-x-3 translate-y-3 -rotate-6","group-hover:translate-y-2 group-focus-visible:translate-y-2"),B0("opacity-50","translate-x-3 translate-y-2 rotate-5","group-hover:translate-y-1 group-focus-visible:translate-y-1"),B0("opacity-100","-translate-x-1 translate-y-1 -rotate-2","group-hover:-translate-y-2 group-focus-visible:-translate-y-2")];function MN({workspaceId:Z}){let J=w$(Z),$=J.data?[...J.data.thumbnails].reverse():[],X=_X.slice(_X.length-$.length),Q=J.data?.firstUserMessage,{ref:Y,horizontalRadiusScale:G}=fy(),H=my(G),z=`folder-noise-${Z}`;return E5.jsxs("div",{ref:Y,className:"relative h-40 w-full",children:[E5.jsxs("svg",{viewBox:`0 0 ${HZ.width} ${HZ.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[E5.jsx("defs",{children:E5.jsxs("filter",{id:z,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[E5.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),E5.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),E5.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:E5.jsx("feFuncA",{type:"linear",slope:"0.24"})}),E5.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),E5.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),E5.jsx("path",{d:H,filter:`url(#${z})`,className:"mask-[linear-gradient(to_bottom,rgba(0,0,0,0.5),black_40%)] fill-accent"})]}),$.map((W,K)=>E5.jsx("img",{src:W,alt:"",loading:"lazy",className:B0("absolute top-[12%] left-[14%] aspect-4/3 w-[72%] rounded-sm object-cover object-top shadow-xs","animate-in transition-transform duration-300 ease-out fade-in",X[K])},K)),$.length===0&&Q&&E5.jsx("div",{className:"absolute inset-x-[12%] top-[20%] flex justify-end",children:E5.jsx("div",{"aria-hidden":"true",className:B0("w-max max-w-40 origin-center rounded-sm bg-card px-3 py-2 shadow-xs","animate-in transition-transform duration-300 ease-out fade-in",_X[_X.length-1],"group-hover:translate-y-0.5 group-focus-visible:translate-y-0.5"),children:E5.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:Q})})}),E5.jsx("div",{className:B0("absolute inset-x-2 top-[40%] bottom-2 rounded-lg bg-accent","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 c0=j(a(),1);function ON(){let[,Z]=p9(),J=O$(),$=wB(),X=P$(),Q=dH((q)=>q.discoveredWorkspacesOpen),Y=dH((q)=>q.setDiscoveredWorkspacesOpen);if(J.isPending||$.isPending)return c0.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:c0.jsx(G7,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(J.isError||$.isError)return c0.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:c0.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let G=J.data,H=$.data,z=G.length,W=X.isPending&&X.variables?X.variables.path:null;function K(q){X.mutate(q,{onSuccess:(V)=>Z(`/workspace/${V.id}`)})}return c0.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[c0.jsx(YN,{className:"mb-8"}),z>0?c0.jsxs("section",{className:"mb-10",children:[c0.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[c0.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),c0.jsx(u3,{trigger:c0.jsxs(I0,{variant:"outline",size:"sm",children:[c0.jsx(s5,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),c0.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3",children:G.map((q)=>c0.jsx(py,{workspace:q},q.id))})]}):c0.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-6 pb-12 text-center",children:[c0.jsx(DN,{size:32,stroke:1.5,className:"text-muted-foreground"}),c0.jsxs("div",{className:"flex flex-col gap-1.5",children:[c0.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),c0.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."})]}),c0.jsx(u3,{trigger:c0.jsx(I0,{children:"Create workspace"})})]}),H.length>0&&c0.jsx("section",{children:c0.jsxs(LN,{open:Q,onOpenChange:Y,className:"group",children:[c0.jsxs(NN,{className:B0("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:[c0.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),c0.jsx(AX,{size:16,stroke:2,className:B0("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),c0.jsxs(_N,{children:[c0.jsx("ul",{className:"border-t border-border",children:H.map((q)=>c0.jsx(uy,{suggestion:q,onAdd:K,loading:W===q.path},q.path))}),X.isError&&c0.jsx("p",{className:"mt-3 text-xs text-destructive",children:X.error.message})]})]})})]})}function py({workspace:Z}){let J=f3(Z),X=w$(Z.id).data?.updatedAt??new Date(Z.addedAt).getTime();return c0.jsxs(Z8,{href:`/workspace/${Z.id}`,className:"group flex min-w-0 flex-col gap-4 rounded-xl bg-card p-2 shadow-xs transition-shadow hover:shadow-sm",children:[c0.jsx(MN,{workspaceId:Z.id}),c0.jsxs("div",{className:"flex min-w-0 flex-col gap-2 px-2 pb-2",children:[c0.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[c0.jsx("img",{src:Z.icon??Y2[Z.type??"claude-code"],alt:"",className:"size-4 shrink-0 rounded-[4px]"}),c0.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:J})]}),c0.jsx("span",{className:"text-xs text-muted-foreground",children:cy(X)})]})]})}function uy({suggestion:Z,onAdd:J,loading:$}){let{path:X,type:Q}=Z,Y=f3(Z);return c0.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[c0.jsx(e$,{type:Q}),c0.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:Y}),c0.jsx("span",{title:X,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:Z.displayPath??X}),c0.jsxs(I0,{variant:"outline",size:"sm",onClick:()=>J(Z),disabled:$,children:[$?c0.jsx(G7,{stroke:1.75,className:"animate-spin"}):c0.jsx(s5,{stroke:1.75}),"Add"]})]})}function cy(Z){let J=Date.now()-Z,$=Math.floor(J/60000);if($<1)return"Updated just now";if($<60)return`Updated ${$} min${$===1?"":"s"} ago`;let X=Math.floor($/60);if(X<24)return`Updated ${X} hour${X===1?"":"s"} ago`;let Q=Math.floor(X/24);if(Q<30)return`Updated ${Q} day${Q===1?"":"s"} ago`;return`Updated ${new Date(Z).toLocaleDateString()}`}var MX=j(a(),1);function wN(){return MX.jsx(J8,{panel:"flat",showWorkspaces:!1,children:MX.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:MX.jsx(ON,{})})})}var DS=j(m(),1);function DX(Z){return $5({queryKey:D0.sessions(Z),queryFn:()=>A1(`/api/workspaces/${Z}/sessions`),...x9})}function PN(Z,J){return $5({queryKey:D0.events(Z,J??""),queryFn:async()=>{let $=await fetch(`/api/workspaces/${Z}/sessions/${J}/events`),X=$.ok?await $.json():[];return nq(X)},enabled:Boolean(J),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function Y8(Z){return $5({queryKey:D0.models(Z),queryFn:()=>A1(`/api/workspaces/${Z}/models`),staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}function OX(Z,J){return $5({queryKey:D0.threadConfig(Z,J??""),queryFn:()=>A1(`/api/workspaces/${Z}/sessions/${J}/config`),enabled:Boolean(J),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function jN(Z){let J=Z1();return a1({mutationFn:({patch:$,sessionId:X})=>A1(`/api/workspaces/${Z}/sessions/${X}/config`,R5("PUT",$),"Failed to save chat settings"),onSuccess:($,{sessionId:X})=>{J.setQueryData(D0.threadConfig(Z,X),$)}})}var G8=j(m(),1);function wX(Z,J,$){return`${Z}/${J}/${$}`}var lH=new Map,iH=new Map;function dy(Z,J,$){return lH.get(wX(Z,J,$))??0}function TN(Z,J,$){return`/api/workspaces/${J}/${Z}/${$}/index.js?v=${dy(Z,J,$)}`}function CN(Z,J,$){return`/api/workspaces/${J}/${Z}/${$}`}function SN(Z){return iH.get(Z)}function IN(Z,J){iH.set(Z,J)}function PX(Z,J,$){let X=wX(Z,J,$);iH.delete(X),lH.set(X,(lH.get(X)??0)+1)}var ly={kind:"widget",segment:"widgets",shouldReload:(Z,J)=>Z.type==="widget:updated"&&Z.name===J||Z.type==="widgets:refresh"},iy={kind:"view",segment:"views",shouldReload:(Z,J)=>Z.type==="view:updated"&&Z.name===J};function ry(Z,J,$){let X=wX(Z,J,$),Q=SN(X);if(Q)return Q;let Y=import(TN(Z,J,$)).then((G)=>{if(!G.default)throw Error(`"${$}" has no default export`);return G.default});return IN(X,Y),Y}function EN(Z,J){let $=h5(),[X,Q]=G8.useState({status:"loading",version:0}),Y=G8.useCallback(()=>{Q((G)=>({status:"loading",version:G.version})),ry(Z.segment,$,J).then((G)=>Q((H)=>({status:"ready",Component:G,version:H.version+1}))).catch((G)=>{W3($,{source:"load",kind:Z.kind,name:J,message:String(G),...G instanceof Error&&G.stack?{stack:G.stack}:{}}),Q((H)=>({status:"error",error:String(G),version:H.version+1}))})},[Z,$,J]);return G8.useEffect(()=>{Y()},[Y]),W9((G)=>{if(Z.shouldReload(G,J))PX(Z.segment,$,J),Y()}),X}function kN(Z){return EN(ly,Z)}function RN(Z){return EN(iy,Z)}function yN(){let Z=h5();W9((J)=>{if(J.type==="view:updated")PX("views",Z,J.name);else if(J.type==="widget:updated")PX("widgets",Z,J.name)})}var J7=j(m(),1);var V2=j(m(),1);var d7=j(m(),1),ay=48;function bN(Z,J){let $=d7.useRef(!0),[X,Q]=d7.useState(!0),Y=d7.useCallback((H)=>{$.current=H,Q((z)=>z===H?z:H)},[]),G=d7.useCallback((H="auto")=>{let z=Z.current;if(!z)return;Y(!0),z.scrollTo({top:z.scrollHeight,behavior:H})},[Z,Y]);return d7.useEffect(()=>{let H=Z.current;if(!H)return;let z=()=>{let W=H.scrollHeight-H.scrollTop-H.clientHeight;Y(W<=ay)};return H.addEventListener("scroll",z,{passive:!0}),()=>H.removeEventListener("scroll",z)},[Z,Y]),d7.useEffect(()=>{let H=Z.current;if(!H)return;let z=H.firstElementChild??H,W=new ResizeObserver(()=>{if($.current)H.scrollTop=H.scrollHeight});return W.observe(z),()=>W.disconnect()},[Z]),d7.useLayoutEffect(()=>{G("auto")},[J,G]),{atBottom:X,scrollToBottom:G}}function sy(Z){return Z.some((J)=>J.type==="text")}function xN(Z){let J=[];for(let $ of Z){if($.role!=="assistant"){J.push($);continue}let X=J.length>0?J[J.length-1]:null;if(!sy($.parts)&&X!==null&&X.role==="assistant")J[J.length-1]={...X,parts:[...X.parts,...$.parts]};else J.push($)}return J}var KQ=j(m(),1);var SX=j(a(),1);function jX({composerRef:Z,className:J,onMouseDown:$,children:X,...Q}){return SX.jsx("form",{...Q,onMouseDown:(Y)=>{if($?.(Y),Y.defaultPrevented)return;if(Y.target instanceof HTMLElement&&Y.target.closest("button"))return;Y.preventDefault(),Z.current?.focus()},className:B0("flex w-full max-w-(--chat-max-container) cursor-text flex-col gap-1 rounded-lg bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",J),children:X})}function TX({textareaRef:Z,className:J,...$}){return SX.jsx("textarea",{...$,ref:Z,className:B0("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",J)})}function CX({className:Z,children:J,...$}){return SX.jsx("div",{...$,className:B0("flex items-center justify-end gap-1.5",Z),children:J})}async function hN(Z,J){let $=new FormData;for(let Q of J)$.append("files",Q);let X=await fetch(`/api/workspaces/${Z}/uploads`,{method:"POST",body:$});if(!X.ok){let Q=await X.text().catch(()=>"");throw Error(Q||`Upload failed (${X.status})`)}return X.json()}var GQ=j(m(),1);var ny={"claude-code":["claude-fable-5","claude-opus-4-8","claude-opus-4-8[1m]","claude-sonnet-5","claude-haiku-4-5-20251001"],codex:[],openclaw:[]};function oy(Z){return Z.resolvedModel??Z.value}function vN(Z){return[...Z].reverse()}function gN(Z,J){if(J&&Z.includes(J))return J;if(Z.includes("high"))return"high";return Z[0]}function mN(Z,J){let $=ny[J],X=new Map($.map((Q,Y)=>[Q,Y]));return Z.map((Q,Y)=>({model:Q,index:Y,rank:X.get(oy(Q))})).sort((Q,Y)=>{if(Q.rank===void 0&&Y.rank===void 0)return Q.index-Y.index;if(Q.rank===void 0)return-1;if(Y.rank===void 0)return 1;return Q.rank-Y.rank||Q.index-Y.index}).map(({model:Q})=>Q)}var g5={};t7(g5,{createHandle:()=>k_,Trigger:()=>C_,SubmenuTrigger:()=>E_,SubmenuRoot:()=>O_,Separator:()=>I_,Root:()=>nX,RadioItemIndicator:()=>A_,RadioItem:()=>__,RadioGroup:()=>F_,Positioner:()=>V_,Portal:()=>z_,Popup:()=>Y_,LinkItem:()=>X_,Item:()=>$_,Handle:()=>$Q,GroupLabel:()=>Z_,Group:()=>tN,CheckboxItemIndicator:()=>sN,CheckboxItem:()=>aN,Backdrop:()=>cN,Arrow:()=>pN});var fN=j(m(),1);var IX=j(m(),1),rH=IX.createContext(void 0);function F7(Z){let J=IX.useContext(rH);if(J===void 0&&!Z)throw Error(w0(33));return J}var EX=j(m(),1),aH=EX.createContext(void 0);function S1(Z){let J=EX.useContext(aH);if(J===void 0&&!Z)throw Error(w0(36));return J}var pN=fN.forwardRef(function(J,$){let{className:X,render:Q,...Y}=J,{store:G}=S1(),{arrowRef:H,side:z,align:W,arrowUncentered:K,arrowStyles:q}=F7(),U={open:G.useState("open"),side:z,align:W,uncentered:K};return K0("div",J,{ref:[H,$],stateAttributesMapping:Y1,state:U,props:{style:q,"aria-hidden":!0,...Y}})});var uN=j(m(),1);var kX=j(m(),1),ty=kX.createContext(void 0);function d9(Z=!0){let J=kX.useContext(ty);if(J===void 0&&!Z)throw Error(w0(25));return J}var ey={...Y1,...j1},cN=uN.forwardRef(function(J,$){let{className:X,render:Q,...Y}=J,{store:G}=S1(),H=G.useState("open"),z=G.useState("mounted"),W=G.useState("transitionStatus"),K=G.useState("lastOpenChangeReason"),q=d9(),V={open:H,transitionStatus:W};return K0("div",J,{ref:q?.backdropRef?[$,q.backdropRef]:$,state:V,stateAttributesMapping:ey,props:[{role:"presentation",hidden:!z,style:{pointerEvents:K===n.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},Y]})});var xX=j(m(),1);var RX=j(m(),1),sH=RX.createContext(void 0);function dN(){let Z=RX.useContext(sH);if(Z===void 0)throw Error(w0(30));return Z}var H8=j(m(),1);var lN=j(m(),1);function yX(Z){let{closeOnClick:J,highlighted:$,id:X,nodeId:Q,store:Y,itemRef:G,itemMetadata:H}=Z,{events:z}=Y.useState("floatingTreeRoot"),W=d9(!0),K=W!==void 0;return lN.useMemo(()=>({id:X,role:"menuitem",tabIndex:$?0:-1,onMouseMove(q){if(!Q)return;z.emit("itemhover",{nodeId:Q,target:q.currentTarget})},onClick(q){if(J)z.emit("close",{domEvent:q,reason:n.itemPress})},onMouseUp(q){if(W){let V=W.initialCursorPointRef.current;if(W.initialCursorPointRef.current=null,K&&V&&Math.abs(q.clientX-V.x)<=1&&Math.abs(q.clientY-V.y)<=1)return}if(G.current&&Y.context.allowMouseUpTriggerRef.current&&(!K||q.button===2)){if(!H||H.type==="regular-item")G.current.click()}}}),[J,$,X,z,Q,Y,G,W,K,H])}var z8={type:"regular-item"};function f2(Z){let{closeOnClick:J,disabled:$=!1,highlighted:X,id:Q,store:Y,nativeButton:G,itemMetadata:H,nodeId:z}=Z,W=H8.useRef(null),{getButtonProps:K,buttonRef:q}=v5({disabled:$,focusableWhenDisabled:!0,native:G}),V=yX({closeOnClick:J,highlighted:X,id:Q,nodeId:z,store:Y,itemRef:W,itemMetadata:H}),U=H8.useCallback((F)=>{return p7(V,{onMouseEnter(){if(H.type!=="submenu-trigger")return;H.setActive()},onKeyUp(N){if(N.key===" "&&Y.context.typingRef.current)N.preventBaseUIHandler()}},F,K)},[V,K,Y,H]),B=Z9(W,q);return H8.useMemo(()=>({getItemProps:U,itemRef:B}),[U,B])}var G2=j(m(),1);var bX=j(m(),1),nH=bX.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>{return()=>{}},elementsRef:{current:[]},nextIndexRef:{current:0}});function iN(){return bX.useContext(nH)}var Zb=function(Z){return Z[Z.None=0]="None",Z[Z.GuessFromOrder=1]="GuessFromOrder",Z}({});function l7(Z={}){let{label:J,metadata:$,textRef:X,indexGuessBehavior:Q,index:Y}=Z,{register:G,unregister:H,subscribeMapChange:z,elementsRef:W,labelsRef:K,nextIndexRef:q}=iN(),V=G2.useRef(-1),[U,B]=G2.useState(Y??(Q===Zb.GuessFromOrder?()=>{if(V.current===-1){let L=q.current;q.current+=1,V.current=L}return V.current}:-1)),F=G2.useRef(null),N=G2.useCallback((L)=>{if(F.current=L,U!==-1&&L!==null){if(W.current[U]=L,K){let _=J!==void 0;K.current[U]=_?J:X?.current?.textContent??L.textContent}}},[U,W,K,J,X]);return $0(()=>{if(Y!=null)return;let L=F.current;if(L)return G(L,$),()=>{H(L)};return},[Y,G,H,$]),$0(()=>{if(Y!=null)return;return z((L)=>{let _=F.current?L.get(F.current)?.index:null;if(_!=null)B(_)})},[Y,z,B]),G2.useMemo(()=>({ref:N,index:U}),[U,N])}var oH=function(Z){return Z.checked="data-checked",Z.unchecked="data-unchecked",Z.disabled="data-disabled",Z.highlighted="data-highlighted",Z}({});var p2={checked(Z){if(Z)return{[oH.checked]:""};return{[oH.unchecked]:""}},...j1};var rN=j(a(),1),aN=xX.forwardRef(function(J,$){let{render:X,className:Q,id:Y,label:G,nativeButton:H=!1,disabled:z=!1,closeOnClick:W=!1,checked:K,defaultChecked:q,onCheckedChange:V,...U}=J,B=l7({label:G}),F=F7(!0),N=d0(Y),{store:L}=S1(),_=L.useState("isActive",B.index),M=L.useState("itemProps"),[O,D]=g9({controlled:K,default:q??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:A,itemRef:T}=f2({closeOnClick:W,disabled:z,highlighted:_,id:N,store:L,nativeButton:H,nodeId:F?.nodeId,itemMetadata:z8}),S=xX.useMemo(()=>({disabled:z,highlighted:_,checked:O}),[z,_,O]),k=Y0((g)=>{let C={...N0(n.itemPress,g.nativeEvent),preventUnmountOnClose:()=>{}};if(V?.(!O,C),C.isCanceled)return;D((I)=>!I)}),P=K0("div",J,{state:S,stateAttributesMapping:p2,props:[M,{role:"menuitemcheckbox","aria-checked":O,onClick:k},U,A],ref:[T,$,B.ref]});return rN.jsx(sH.Provider,{value:S,children:P})});var hX=j(m(),1);var sN=hX.forwardRef(function(J,$){let{render:X,className:Q,keepMounted:Y=!1,...G}=J,H=dN(),z=hX.useRef(null),{transitionStatus:W,setMounted:K}=m7(H.checked);B5({open:H.checked,ref:z,onComplete(){if(!H.checked)K(!1)}});let q={checked:H.checked,disabled:H.disabled,highlighted:H.highlighted,transitionStatus:W};return K0("span",J,{state:q,ref:[$,z],stateAttributesMapping:p2,props:{"aria-hidden":!0,...G},enabled:Y||H.checked})});var W8=j(m(),1);var vX=j(m(),1),tH=vX.createContext(void 0);function nN(){let Z=vX.useContext(tH);if(Z===void 0)throw Error(w0(31));return Z}var oN=j(a(),1),tN=W8.forwardRef(function(J,$){let{render:X,className:Q,...Y}=J,[G,H]=W8.useState(void 0),z=W8.useMemo(()=>({setLabelId:H}),[H]),W=K0("div",J,{ref:$,props:{role:"group","aria-labelledby":G,...Y}});return oN.jsx(tH.Provider,{value:z,children:W})});var eN=j(m(),1);var Z_=eN.forwardRef(function(J,$){let{className:X,render:Q,id:Y,...G}=J,H=d0(Y),{setLabelId:z}=nN();return $0(()=>{return z(H),()=>{z(void 0)}},[z,H]),K0("div",J,{ref:$,props:{id:H,role:"presentation",...G}})});var J_=j(m(),1);var $_=J_.forwardRef(function(J,$){let{render:X,className:Q,id:Y,label:G,nativeButton:H=!1,disabled:z=!1,closeOnClick:W=!0,...K}=J,q=l7({label:G}),V=F7(!0),U=d0(Y),{store:B}=S1(),F=B.useState("isActive",q.index),N=B.useState("itemProps"),{getItemProps:L,itemRef:_}=f2({closeOnClick:W,disabled:z,highlighted:F,id:U,store:B,nativeButton:H,nodeId:V?.nodeId,itemMetadata:z8});return K0("div",J,{state:{disabled:z,highlighted:F},props:[N,K,L],ref:[_,$,q.ref]})});var K8=j(m(),1);var X_=K8.forwardRef(function(J,$){let{render:X,className:Q,id:Y,label:G,closeOnClick:H=!1,...z}=J,W=K8.useRef(null),K=l7({label:G}),V=F7(!0)?.nodeId,U=d0(Y),{store:B}=S1(),F=B.useState("isActive",K.index),N=B.useState("itemProps"),L=yX({closeOnClick:H,highlighted:F,id:U,nodeId:V,store:B,itemRef:W}),_=K8.useMemo(()=>({highlighted:F}),[F]);return K0("a",J,{state:_,props:[N,z,L],ref:[W,$,K.ref]})});var fX=j(m(),1);var gX=j(m(),1),Jb=gX.createContext(void 0);function mX(Z){let J=gX.useContext(Jb);if(J===void 0&&!Z)throw Error(w0(69));return J}var Q_=j(a(),1),$b={...Y1,...j1},Y_=fX.forwardRef(function(J,$){let{render:X,className:Q,finalFocus:Y,...G}=J,{store:H}=S1(),{side:z,align:W}=F7(),K=mX(!0)!=null,q=H.useState("open"),V=H.useState("transitionStatus"),U=H.useState("popupProps"),B=H.useState("mounted"),F=H.useState("instantType"),N=H.useState("activeTriggerElement"),L=H.useState("parent"),_=H.useState("lastOpenChangeReason"),M=H.useState("rootId"),O=H.useState("floatingRootContext"),D=H.useState("floatingTreeRoot"),A=H.useState("closeDelay"),T=H.useState("activeTriggerElement"),S=L.type==="context-menu";B5({open:q,ref:H.context.popupRef,onComplete(){if(q)H.context.onOpenChangeComplete?.(!0)}}),fX.useEffect(()=>{function y(b){H.setOpen(!1,N0(b.reason,b.domEvent))}return D.events.on("close",y),()=>{D.events.off("close",y)}},[D.events,H]);let k=H.useState("hoverEnabled"),P=H.useState("disabled");X2(O,{enabled:k&&!P&&!S&&L.type!=="menubar",closeDelay:A});let g={transitionStatus:V,side:z,align:W,open:q,nested:L.type==="menu",instant:F},C=K0("div",J,{state:g,ref:[$,H.context.popupRef],stateAttributesMapping:$b,props:[U,{onKeyDown(y){if(K&&v6.has(y.key))y.stopPropagation()}},l5(V),G,{"data-rootownerid":M}]}),I=L.type===void 0||S;if(N||L.type==="menubar"&&_!==n.outsidePress)I=!0;return Q_.jsx(D4,{context:O,modal:S,disabled:!B,returnFocus:Y===void 0?I:Y,initialFocus:L.type!=="menu",restoreFocus:!0,externalTree:L.type!=="menubar"?D:void 0,previousFocusableElement:T,nextFocusableElement:L.type===void 0?H.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:L.type===void 0?H.context.beforeContentFocusGuardRef:void 0,children:C})});var H_=j(m(),1);var pX=j(m(),1),eH=pX.createContext(void 0);function G_(){let Z=pX.useContext(eH);if(Z===void 0)throw Error(w0(32));return Z}var Zz=j(a(),1),z_=H_.forwardRef(function(J,$){let{keepMounted:X=!1,...Q}=J,{store:Y}=S1();if(!(Y.useState("mounted")||X))return null;return Zz.jsx(eH.Provider,{value:X,children:Zz.jsx(M4,{ref:$,...Q})})});var l9=j(m(),1);var u2=j(m(),1);var W_=j(a(),1);function K_(Z){let{children:J,elementsRef:$,labelsRef:X,onMapChange:Q}=Z,Y=Y0(Q),G=u2.useRef(0),H=K1(Qb).current,z=K1(Xb).current,[W,K]=u2.useState(0),q=u2.useRef(W),V=Y0((L,_)=>{z.set(L,_??null),q.current+=1,K(q.current)}),U=Y0((L)=>{z.delete(L),q.current+=1,K(q.current)}),B=u2.useMemo(()=>{Gb(W);let L=new Map;return Array.from(z.keys()).filter((M)=>M.isConnected).sort(Yb).forEach((M,O)=>{let D=z.get(M)??{};L.set(M,{...D,index:O})}),L},[z,W]);$0(()=>{if(typeof MutationObserver!=="function"||B.size===0)return;let L=new MutationObserver((_)=>{let M=new Set,O=(D)=>M.has(D)?M.delete(D):M.add(D);if(_.forEach((D)=>{D.removedNodes.forEach(O),D.addedNodes.forEach(O)}),M.size===0)q.current+=1,K(q.current)});return B.forEach((_,M)=>{if(M.parentElement)L.observe(M.parentElement,{childList:!0})}),()=>{L.disconnect()}},[B]),$0(()=>{if(q.current===W){if($.current.length!==B.size)$.current.length=B.size;if(X&&X.current.length!==B.size)X.current.length=B.size;G.current=B.size}Y(B)},[Y,B,$,X,W]),$0(()=>{return()=>{$.current=[]}},[$]),$0(()=>{return()=>{if(X)X.current=[]}},[X]);let F=Y0((L)=>{return H.add(L),()=>{H.delete(L)}});$0(()=>{H.forEach((L)=>L(B))},[H,B]);let N=u2.useMemo(()=>({register:V,unregister:U,subscribeMapChange:F,elementsRef:$,labelsRef:X,nextIndexRef:G}),[V,U,F,$,X,G]);return W_.jsx(nH.Provider,{value:N,children:J})}function Xb(){return new Map}function Qb(){return new Set}function Yb(Z,J){let $=Z.compareDocumentPosition(J);if($&Node.DOCUMENT_POSITION_FOLLOWING||$&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if($&Node.DOCUMENT_POSITION_PRECEDING||$&Node.DOCUMENT_POSITION_CONTAINS)return 1;return 0}function Gb(Z){}var q8=j(a(),1),V_=l9.forwardRef(function(J,$){let{anchor:X,positionMethod:Q="absolute",className:Y,render:G,side:H,align:z,sideOffset:W=0,alignOffset:K=0,collisionBoundary:q="clipping-ancestors",collisionPadding:V=5,arrowPadding:U=5,sticky:B=!1,disableAnchorTracking:F=!1,collisionAvoidance:N=q_,...L}=J,{store:_}=S1(),M=G_(),O=d9(!0),D=_.useState("parent"),A=_.useState("floatingRootContext"),T=_.useState("floatingTreeRoot"),S=_.useState("mounted"),k=_.useState("open"),P=_.useState("modal"),g=_.useState("activeTriggerElement"),C=_.useState("transitionStatus"),I=_.useState("lastOpenChangeReason"),y=_.useState("floatingNodeId"),b=_.useState("floatingParentNodeId"),R=X,x=W,v=K,d=z,w=N;if(D.type==="context-menu"){if(R=X??D.context?.anchor,d=d??"start",!H&&d!=="center")v=J.alignOffset??2,x=J.sideOffset??-5}let z0=H,G0=d;if(D.type==="menu")z0=z0??"inline-end",G0=G0??"start",w=J.collisionAvoidance??k2;else if(D.type==="menubar")z0=z0??"bottom",G0=G0??"start";let E=D.type==="context-menu",s=E2({anchor:R,floatingRootContext:A,positionMethod:O?"fixed":Q,mounted:S,side:z0,sideOffset:x,align:G0,alignOffset:v,arrowPadding:E?0:U,collisionBoundary:q,collisionPadding:V,sticky:B,nodeId:y,keepMounted:M,disableAnchorTracking:F,collisionAvoidance:w,shiftCrossAxis:E&&!(("side"in w)&&w.side==="flip"),externalTree:T}),A0=l9.useMemo(()=>{let V0={};if(!k)V0.pointerEvents="none";return{role:"presentation",hidden:!S,style:{...s.positionerStyles,...V0}}},[k,S,s.positionerStyles]);l9.useEffect(()=>{function V0(p){if(p.open){if(p.parentNodeId===y)_.set("hoverEnabled",!1);if(p.nodeId!==y&&p.parentNodeId===_.select("floatingParentNodeId"))_.setOpen(!1,N0(n.siblingOpen))}}return T.events.on("menuopenchange",V0),()=>{T.events.off("menuopenchange",V0)}},[_,T.events,y]),l9.useEffect(()=>{if(_.select("floatingParentNodeId")==null)return;function V0(p){if(p.open||p.nodeId!==_.select("floatingParentNodeId"))return;let Z0=p.reason??n.siblingOpen;_.setOpen(!1,N0(Z0))}return T.events.on("menuopenchange",V0),()=>{T.events.off("menuopenchange",V0)}},[T.events,_]),l9.useEffect(()=>{function V0(p){if(!k||p.nodeId!==_.select("floatingParentNodeId"))return;if(p.target&&g&&g!==p.target)_.setOpen(!1,N0(n.siblingOpen))}return T.events.on("itemhover",V0),()=>{T.events.off("itemhover",V0)}},[T.events,k,g,_]),l9.useEffect(()=>{let V0={open:k,nodeId:y,parentNodeId:b,reason:_.select("lastOpenChangeReason")};T.events.emit("menuopenchange",V0)},[T.events,k,_,y,b]);let l={open:k,side:s.side,align:s.align,anchorHidden:s.anchorHidden,nested:D.type==="menu"},H0=l9.useMemo(()=>({side:s.side,align:s.align,arrowRef:s.arrowRef,arrowUncentered:s.arrowUncentered,arrowStyles:s.arrowStyles,nodeId:s.context.nodeId}),[s.side,s.align,s.arrowRef,s.arrowUncentered,s.arrowStyles,s.context.nodeId]),q0=K0("div",J,{state:l,stateAttributesMapping:Y1,ref:[$,_.useStateSetter("positionerElement")],props:[A0,l5(C),L]}),X0=S&&D.type!=="menu"&&(D.type!=="menubar"&&P&&I!==n.triggerHover||D.type==="menubar"&&D.context.modal),Q0=null;if(D.type==="menubar")Q0=D.context.contentElement;else if(D.type===void 0)Q0=g;return q8.jsxs(rH.Provider,{value:H0,children:[X0&&q8.jsx(g6,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:R2(!k),cutout:Q0}),q8.jsx(N3,{id:y,children:q8.jsx(K_,{elementsRef:_.context.itemDomElements,labelsRef:_.context.itemLabels,children:q0})})]})});var V8=j(m(),1);var uX=j(m(),1),Jz=uX.createContext(void 0);function U_(){let Z=uX.useContext(Jz);if(Z===void 0)throw Error(w0(34));return Z}var B_=j(a(),1),F_=V8.memo(V8.forwardRef(function(J,$){let{render:X,className:Q,value:Y,defaultValue:G,onValueChange:H,disabled:z=!1,...W}=J,[K,q]=g9({controlled:Y,default:G,name:"MenuRadioGroup"}),V=Y0(H),U=Y0((L,_)=>{if(V?.(L,_),_.isCanceled)return;q(L)}),F=K0("div",J,{state:{disabled:z},ref:$,props:{role:"group","aria-disabled":z||void 0,...W}}),N=V8.useMemo(()=>({value:K,setValue:U,disabled:z}),[K,U,z]);return B_.jsx(Jz.Provider,{value:N,children:F})}));var dX=j(m(),1);var cX=j(m(),1),$z=cX.createContext(void 0);function L_(){let Z=cX.useContext($z);if(Z===void 0)throw Error(w0(35));return Z}var N_=j(a(),1),__=dX.forwardRef(function(J,$){let{render:X,className:Q,id:Y,label:G,nativeButton:H=!1,disabled:z=!1,closeOnClick:W=!1,value:K,...q}=J,V=l7({label:G}),U=F7(!0),B=d0(Y),{store:F}=S1(),N=F.useState("isActive",V.index),L=F.useState("itemProps"),{value:_,setValue:M,disabled:O}=U_(),D=O||z,A=_===K,{getItemProps:T,itemRef:S}=f2({closeOnClick:W,disabled:D,highlighted:N,id:B,store:F,nativeButton:H,nodeId:U?.nodeId,itemMetadata:z8}),k=dX.useMemo(()=>({disabled:D,highlighted:N,checked:A}),[D,N,A]),P=Y0((C)=>{let I={...N0(n.itemPress,C.nativeEvent),preventUnmountOnClose:()=>{}};M(K,I)}),g=K0("div",J,{state:k,stateAttributesMapping:p2,props:[L,{role:"menuitemradio","aria-checked":A,onClick:P},q,T],ref:[S,$,V.ref]});return N_.jsx($z.Provider,{value:k,children:g})});var lX=j(m(),1);var A_=lX.forwardRef(function(J,$){let{render:X,className:Q,keepMounted:Y=!1,...G}=J,H=L_(),z=lX.useRef(null),{transitionStatus:W,setMounted:K}=m7(H.checked);B5({open:H.checked,ref:z,onComplete(){if(!H.checked)K(!1)}});let q={checked:H.checked,disabled:H.disabled,highlighted:H.highlighted,transitionStatus:W};return K0("span",J,{state:q,stateAttributesMapping:p2,ref:[$,z],props:{"aria-hidden":!0,...G},enabled:Y||H.checked})});var t1=j(m(),1);var iX=j(m(),1),Hb=iX.createContext(null);function rX(Z){let J=iX.useContext(Hb);if(J===null&&!Z)throw Error(w0(5));return J}var zZ=j(m(),1);var zb={...R9,disabled:P0((Z)=>Z.parent.type==="menubar"?Z.parent.context.disabled||Z.disabled:Z.disabled),modal:P0((Z)=>(Z.parent.type===void 0||Z.parent.type==="context-menu")&&(Z.modal??!0)),allowMouseEnter:P0((Z)=>Z.allowMouseEnter),stickIfOpen:P0((Z)=>Z.stickIfOpen),parent:P0((Z)=>Z.parent),rootId:P0((Z)=>{if(Z.parent.type==="menu")return Z.parent.store.select("rootId");return Z.parent.type!==void 0?Z.parent.context.rootId:Z.rootId}),activeIndex:P0((Z)=>Z.activeIndex),isActive:P0((Z,J)=>Z.activeIndex===J),hoverEnabled:P0((Z)=>Z.hoverEnabled),instantType:P0((Z)=>Z.instantType),lastOpenChangeReason:P0((Z)=>Z.openChangeReason),floatingTreeRoot:P0((Z)=>{if(Z.parent.type==="menu")return Z.parent.store.select("floatingTreeRoot");return Z.floatingTreeRoot}),floatingNodeId:P0((Z)=>Z.floatingNodeId),floatingParentNodeId:P0((Z)=>Z.floatingParentNodeId),itemProps:P0((Z)=>Z.itemProps),closeDelay:P0((Z)=>Z.closeDelay),keyboardEventRelay:P0((Z)=>{if(Z.keyboardEventRelay)return Z.keyboardEventRelay;if(Z.parent.type==="menu")return Z.parent.store.select("keyboardEventRelay");return})};class U8 extends P7{constructor(Z){super({...Wb(),...Z},{positionerRef:zZ.createRef(),popupRef:zZ.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:zZ.createRef(),beforeContentFocusGuardRef:zZ.createRef(),onOpenChangeComplete:void 0,triggerElements:new Q7},zb);this.unsubscribeParentListener=this.observe("parent",(J)=>{if(this.unsubscribeParentListener?.(),J.type==="menu"){this.unsubscribeParentListener=J.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=J.store.context.allowMouseUpTriggerRef;return}if(J.type!==void 0)this.context.allowMouseUpTriggerRef=J.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen(Z,J){this.state.floatingRootContext.context.events.emit("setOpen",{open:Z,eventDetails:J})}static useStore(Z,J){let $=K1(()=>{return new U8(J)}).current;return Z??$}unsubscribeParentListener=null}function Wb(){return{...k9(),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 L4,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:N1,keyboardEventRelay:void 0,closeDelay:0}}var aX=j(m(),1),Xz=aX.createContext(void 0);function sX(){return aX.useContext(Xz)}var Qz=j(a(),1),nX=w3(function(J){let{children:$,open:X,onOpenChange:Q,onOpenChangeComplete:Y,defaultOpen:G=!1,disabled:H=!1,modal:z,loopFocus:W=!0,orientation:K="vertical",actionsRef:q,closeParentOnEsc:V=!1,handle:U,triggerId:B,defaultTriggerId:F=null,highlightItemOnHover:N=!0}=J,L=d9(!0),_=S1(!0),M=rX(!0),O=sX(),D=t1.useMemo(()=>{if(O&&_)return{type:"menu",store:_.store};if(M)return{type:"menubar",context:M};if(L&&!_)return{type:"context-menu",context:L};return{type:void 0}},[L,_,M,O]),A=U8.useStore(U?.store,{open:G,openProp:X,activeTriggerId:F,triggerIdProp:B,parent:D});D9(()=>{if(X===void 0&&A.state.open===!1&&G===!0)A.update({open:!0,activeTriggerId:F})}),A.useControlledProp("openProp",X),A.useControlledProp("triggerIdProp",B),A.useContextCallback("onOpenChangeComplete",Y);let T=A.useState("floatingTreeRoot"),S=N4(T),k=_5();$0(()=>{if(L&&!_)A.update({parent:{type:"context-menu",context:L},floatingNodeId:S,floatingParentNodeId:k});else if(_)A.update({floatingNodeId:S,floatingParentNodeId:k})},[L,_,S,k,A]);let P=A.useState("open"),g=A.useState("activeTriggerElement"),C=A.useState("positionerElement"),I=A.useState("hoverEnabled"),y=A.useState("modal"),b=A.useState("disabled"),R=A.useState("lastOpenChangeReason"),x=A.useState("parent"),v=A.useState("activeIndex"),d=A.useState("payload"),w=A.useState("floatingParentNodeId"),z0=t1.useRef(null),G0=w!=null,E;A.useSyncedValues({disabled:H,modal:x.type===void 0?z:void 0,rootId:q7()});let{openMethod:s,triggerProps:A0,reset:l}=p6(P);I9(A);let{forceUnmount:H0}=E9(P,A,()=>{A.update({allowMouseEnter:!1,stickIfOpen:!0}),l()}),q0=t1.useRef(x.type!=="context-menu"),X0=X5();t1.useEffect(()=>{if(!P)z0.current=null;if(x.type!=="context-menu")return;if(!P){X0.clear(),q0.current=!1;return}X0.start(500,()=>{q0.current=!0})},[X0,P,x.type]),m6(P&&y&&R!==n.triggerHover&&s!=="touch",C),$0(()=>{if(!P&&!I)A.set("hoverEnabled",!0)},[P,I,A]);let Q0=t1.useRef(!0),V0=X5(),p=Y0((v0,i0)=>{let e0=i0.reason;if(P===v0&&i0.trigger===g&&R===e0)return;if(i0.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},!v0&&i0.trigger==null)i0.trigger=g??void 0;if(Q?.(v0,i0),i0.isCanceled)return;let f0={open:v0,nativeEvent:i0.event,reason:i0.reason,nested:G0};E?.emit("openchange",f0);let Q1=i0.event;if(v0===!1&&Q1?.type==="click"&&Q1.pointerType==="touch"&&!Q0.current)return;if(!v0&&v!==null){let x0=A.context.itemDomElements.current[v];queueMicrotask(()=>{x0?.setAttribute("tabindex","-1")})}if(v0&&e0===n.triggerFocus)Q0.current=!1,V0.start(300,()=>{Q0.current=!0});else Q0.current=!0,V0.clear();let K5=(e0===n.triggerPress||e0===n.itemPress)&&Q1.detail===0&&Q1?.isTrusted,x1=!v0&&(e0===n.escapeKey||e0==null),q5={open:v0,openChangeReason:e0};z0.current=i0.event??null;let E0=i0.trigger?.id??null;if(E0||v0)q5.activeTriggerId=E0,q5.activeTriggerElement=i0.trigger??null;if(A.update(q5),x.type==="menubar"&&(e0===n.triggerFocus||e0===n.focusOut||e0===n.triggerHover||e0===n.listNavigation||e0===n.siblingOpen))A.set("instantType","group");else if(K5||x1)A.set("instantType",K5?"click":"dismiss");else A.set("instantType",void 0)}),Z0=t1.useCallback((v0)=>{let i0=N0(v0);return i0.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},i0},[A]),e=t1.useCallback(()=>{A.setOpen(!1,Z0(n.imperativeAction))},[A,Z0]);t1.useImperativeHandle(q,()=>({unmount:H0,close:e}),[H0,e]);let _0;if(x.type==="context-menu")_0=x.context;t1.useImperativeHandle(_0?.positionerRef,()=>C,[C]),t1.useImperativeHandle(_0?.actionsRef,()=>({setOpen:p}),[p]);let i=$9({popupStore:A,onOpenChange:p});E=i.context.events,t1.useEffect(()=>{let v0=({open:i0,eventDetails:e0})=>p(i0,e0);return E.on("setOpen",v0),()=>{E?.off("setOpen",v0)}},[E,p]);let W0=J9(i,{enabled:!b,bubbles:{escapeKey:V&&x.type==="menu"},outsidePress(){if(x.type!=="context-menu"||z0.current?.type==="contextmenu")return!0;return q0.current},externalTree:G0?T:void 0}),r=C4(i,{role:"menu"}),o=I2(),f=t1.useCallback((v0)=>{if(A.select("activeIndex")===v0)return;A.set("activeIndex",v0)},[A]),u=rG(i,{enabled:!b,listRef:A.context.itemDomElements,activeIndex:v,nested:x.type!==void 0,loopFocus:W,orientation:K,parentOrientation:x.type==="menubar"?x.context.orientation:void 0,rtl:o==="rtl",disabledIndices:WZ,onNavigate:f,openOnArrowKeyDown:x.type!=="context-menu",externalTree:G0?T:void 0,focusItemOnHover:N}),L0=t1.useCallback((v0)=>{A.context.typingRef.current=v0},[A]),M0=aG(i,{listRef:A.context.itemLabels,activeIndex:v,resetMs:M_,onMatch:(v0)=>{if(P&&v0!==v)A.set("activeIndex",v0)},onTypingChange:L0}),{getReferenceProps:h0,getFloatingProps:l0,getItemProps:h,getTriggerProps:c}=M5([W0,r,u,M0]),t=t1.useMemo(()=>{let v0=p7(h0(),{onMouseMove(){A.set("allowMouseEnter",!0)}},A0);return delete v0.role,v0},[h0,A,A0]),U0=t1.useMemo(()=>{let v0=c();if(!v0)return v0;let i0=p7(v0,A0);return delete i0.role,delete i0["aria-controls"],i0},[c,A0]),C0=t1.useMemo(()=>l0({onMouseMove(){if(A.set("allowMouseEnter",!0),x.type==="menu")A.set("hoverEnabled",!1)},onClick(){if(A.select("hoverEnabled"))A.set("hoverEnabled",!1)},onKeyDown(v0){let i0=A.select("keyboardEventRelay");if(i0&&!v0.isPropagationStopped())i0(v0)}}),[l0,x.type,A]),m0=t1.useMemo(()=>h(),[h]);A.useSyncedValues({floatingRootContext:i,activeTriggerProps:t,inactiveTriggerProps:U0,popupProps:C0,itemProps:m0});let w1=t1.useMemo(()=>({store:A,parent:D}),[A,D]),b1=Qz.jsx(aH.Provider,{value:w1,children:typeof $==="function"?$({payload:d}):$});if(x.type===void 0||x.type==="context-menu")return Qz.jsx(_3,{externalTree:T,children:b1});return b1});var D_=j(m(),1);var Yz=j(a(),1);function O_(Z){let J=S1().store,$=D_.useMemo(()=>({parentMenu:J}),[J]);return Yz.jsx(Xz.Provider,{value:$,children:Yz.jsx(nX,{...Z})})}var n5=j(m(),1),Hz=j(w7(),1);function w_(Z){let J=Z.getBoundingClientRect(),$=window.getComputedStyle(Z,"::before"),X=window.getComputedStyle(Z,"::after");if(!($.content!=="none"||X.content!=="none"))return J;let Y=parseFloat($.width)||0,G=parseFloat($.height)||0,H=parseFloat(X.width)||0,z=parseFloat(X.height)||0,W=Math.max(J.width,Y,H),K=Math.max(J.height,G,z),q=W-J.width,V=K-J.height;return{left:J.left-q/2,right:J.right+q/2,top:J.top-V/2,bottom:J.bottom+V/2}}var tX=j(m(),1);function P_(Z={}){let{highlightItemOnHover:J,highlightedIndex:$,onHighlightedIndexChange:X}=oX(),{ref:Q,index:Y}=l7(Z),G=$===Y,H=tX.useRef(null),z=Z9(Q,H);return{compositeProps:tX.useMemo(()=>({tabIndex:G?0:-1,onFocus(){X(Y)},onMouseMove(){let K=H.current;if(!J||!K)return;let q=K.hasAttribute("disabled")||K.ariaDisabled==="true";if(!G&&!q)K.focus()}}),[G,X,Y,J]),compositeRef:z,index:Y}}function j_(Z){let{render:J,className:$,state:X=N1,props:Q=WZ,refs:Y=WZ,metadata:G,stateAttributesMapping:H,tag:z="div",...W}=Z,{compositeProps:K,compositeRef:q}=P_({metadata:G});return K0(z,Z,{state:X,ref:[...Y,q],props:[K,...Q,W],stateAttributesMapping:H})}function Gz(Z){if(u1(Z)&&Z.hasAttribute("data-rootownerid"))return Z.getAttribute("data-rootownerid")??void 0;if(S6(Z))return;return Gz(tJ(Z))}var eX=j(m(),1);function T_(Z){let{enabled:J=!0,mouseDownAction:$,open:X}=Z,Q=eX.useRef(!1);return eX.useMemo(()=>{if(!J)return N1;return{onMouseDown:(Y)=>{if($==="open"&&!X||$==="close"&&X)Q.current=!0,u0(Y.currentTarget).addEventListener("click",()=>{Q.current=!1},{once:!0})},onClick:(Y)=>{if(Q.current)Q.current=!1,Y.preventBaseUIHandler()}}},[J,$,X])}var c2=j(a(),1),ZQ=2,C_=$$(function(J,$){let{render:X,className:Q,disabled:Y=!1,nativeButton:G=!0,id:H,openOnHover:z,delay:W=100,closeDelay:K=0,handle:q,payload:V,...U}=J,B=S1(!0),F=q?.store??B?.store;if(!F)throw Error(w0(85));let N=d0(H),L=F.useState("isTriggerActive",N),_=F.useState("floatingRootContext"),M=F.useState("isOpenedByTrigger",N),O=n5.useRef(null),D=qb(),A=oX(!0),T=d5(),S=n5.useMemo(()=>{return T??new L4},[T]),k=N4(S),P=_5(),{registerTrigger:g,isMountedByThisTrigger:C}=S9(N,O,F,{payload:V,closeDelay:K,parent:D,floatingTreeRoot:S,floatingNodeId:k,floatingParentNodeId:P,keyboardEventRelay:A?.relayKeyboardEvent}),I=D.type==="menubar",y=F.useState("disabled"),b=Y||y||I&&D.context.disabled,{getButtonProps:R,buttonRef:x}=v5({disabled:b,native:G});n5.useEffect(()=>{if(!M&&D.type===void 0)F.context.allowMouseUpTriggerRef.current=!1},[F,M,D.type]);let v=n5.useRef(null),d=X5(),w=Y0((W0)=>{if(!v.current)return;d.clear(),F.context.allowMouseUpTriggerRef.current=!1;let r=W0.target;if(k0(v.current,r)||k0(F.select("positionerElement"),r)||r===v.current)return;if(r!=null&&Gz(r)===F.select("rootId"))return;let o=w_(v.current);if(W0.clientX>=o.left-ZQ&&W0.clientX<=o.right+ZQ&&W0.clientY>=o.top-ZQ&&W0.clientY<=o.bottom+ZQ)return;S.events.emit("close",{domEvent:W0,reason:n.cancelOpen})});n5.useEffect(()=>{if(M&&F.select("lastOpenChangeReason")===n.triggerHover)u0(v.current).addEventListener("mouseup",w,{once:!0})},[M,w,F]);let z0=I&&D.context.hasSubmenuOpen,E=X9(_,{enabled:(z??z0)&&!b&&D.type!=="context-menu"&&(!I||z0&&!C),handleClose:Q9({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:D.type===void 0?W:void 0,delay:{close:K},triggerElementRef:O,externalTree:S,isActiveTrigger:L}),s=Kb(M,F.select("lastOpenChangeReason")),A0=$2(_,{enabled:!b&&D.type!=="context-menu",event:M&&I?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?s:!1}),l=P4(_,{enabled:!b&&z0}),H0=T_({open:M,enabled:I,mouseDownAction:"open"}),q0=M5([A0,l]),X0={disabled:b,open:M},Q0=F.useState("triggerProps",C),V0=[v,$,x,g,O],p=[q0.getReferenceProps(),E??N1,Q0,{"aria-haspopup":"menu",id:N,onMouseDown:(W0)=>{if(F.select("open"))return;d.start(200,()=>{F.context.allowMouseUpTriggerRef.current=!0}),u0(W0.currentTarget).addEventListener("mouseup",w,{once:!0})}},I?{role:"menuitem"}:{},H0,U,R],Z0=n5.useRef(null),e=Y0((W0)=>{Hz.flushSync(()=>{F.setOpen(!1,N0(n.focusOut,W0.nativeEvent,W0.currentTarget))}),pJ(Z0.current)?.focus()}),_0=Y0((W0)=>{let r=F.select("positionerElement");if(r&&o7(W0,r))F.context.beforeContentFocusGuardRef.current?.focus();else{Hz.flushSync(()=>{F.setOpen(!1,N0(n.focusOut,W0.nativeEvent,W0.currentTarget))});let o=fJ(F.context.triggerFocusTargetRef.current||O.current);while(o!==null&&k0(r,o)){let f=o;if(o=O2(o),o===f)break}o?.focus()}}),i=K0("button",J,{enabled:!I,stateAttributesMapping:S3,state:X0,ref:V0,props:p});if(I)return c2.jsx(j_,{tag:"button",render:X,className:Q,state:X0,refs:V0,props:p,stateAttributesMapping:S3});if(M)return c2.jsxs(n5.Fragment,{children:[c2.jsx(v7,{ref:Z0,onFocus:e},`${N}-pre-focus-guard`),c2.jsx(n5.Fragment,{children:i},N),c2.jsx(v7,{ref:F.context.triggerFocusTargetRef,onFocus:_0},`${N}-post-focus-guard`)]});return c2.jsx(n5.Fragment,{children:i},N)});function Kb(Z,J){let $=X5(),[X,Q]=n5.useState(!1);return $0(()=>{if(Z&&J==="trigger-hover")Q(!0),$.start(JQ,()=>{Q(!1)});else if(!Z)$.clear(),Q(!1)},[Z,J,$]),X}function qb(){let Z=d9(!0),J=S1(!0),$=rX(!0);return n5.useMemo(()=>{if($)return{type:"menubar",context:$};if(Z&&!J)return{type:"context-menu",context:Z};return{type:void 0}},[Z,J,$])}var S_=j(m(),1);var I_=S_.forwardRef(function(J,$){let{className:X,render:Q,orientation:Y="horizontal",...G}=J;return K0("div",J,{state:{orientation:Y},ref:$,props:[{role:"separator","aria-orientation":Y},G]})});var H2=j(m(),1);var E_=H2.forwardRef(function(J,$){let{render:X,className:Q,label:Y,id:G,nativeButton:H=!1,openOnHover:z=!0,delay:W=100,closeDelay:K=0,disabled:q=!1,...V}=J,U=l7(),B=F7(),{store:F}=S1(),N=d0(G),L=F.useState("open"),_=F.useState("floatingRootContext"),M=F.useState("floatingTreeRoot"),O=pG(N,F),D=H2.useCallback((A0)=>{let l=O(A0);if(A0!==null&&F.select("open")&&F.select("activeTriggerId")==null)F.update({activeTriggerId:N,activeTriggerElement:A0,closeDelay:K});return l},[O,K,F,N]),A=H2.useRef(null),T=H2.useCallback((A0)=>{A.current=A0,F.set("activeTriggerElement",A0)},[F]),S=sX();if(!S?.parentMenu)throw Error(w0(37));F.useSyncedValue("closeDelay",K);let k=S.parentMenu,P=k.useState("itemProps"),g=k.useState("isActive",U.index),C=H2.useMemo(()=>({type:"submenu-trigger",setActive(){k.set("activeIndex",U.index)}}),[k,U.index]),I=F.useState("disabled"),y=q||I,{getItemProps:b,itemRef:R}=f2({closeOnClick:!1,disabled:y,highlighted:g,id:N,store:F,nativeButton:H,itemMetadata:C,nodeId:B?.nodeId}),x=F.useState("hoverEnabled"),v=k.useState("allowMouseEnter"),d=X9(_,{enabled:x&&z&&!y,handleClose:Q9({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:W,delay:v?{open:W,close:K}:0,triggerElementRef:A,externalTree:M}),w=$2(_,{enabled:!y,event:"mousedown",toggle:!z,ignoreMouse:z,stickIfOpen:!1}),z0=M5([w]),G0=F.useState("triggerProps",!0);return delete G0.id,K0("div",J,{state:{disabled:y,highlighted:g,open:L},stateAttributesMapping:b9,props:[z0.getReferenceProps(),d,G0,P,{tabIndex:L||g?0:-1,onBlur(){if(g)k.set("activeIndex",null)}},V,b],ref:[$,U.ref,R,D,T]})});class $Q{constructor(){this.store=new U8}open(Z){let J=Z?this.store.context.triggerElements.getById(Z):void 0;if(Z&&!J)throw Error(w0(83,Z));this.store.setOpen(!0,N0("imperative-action",void 0,J))}close(){this.store.setOpen(!1,N0("imperative-action",void 0,void 0))}get isOpen(){return this.store.state.open}}function k_(){return new $Q}var z5=j(a(),1);function B8({...Z}){return z5.jsx(g5.Root,{"data-slot":"dropdown-menu",...Z})}function F8({...Z}){return z5.jsx(g5.Trigger,{"data-slot":"dropdown-menu-trigger",...Z})}function d4({align:Z="start",alignOffset:J=0,side:$="bottom",sideOffset:X=4,className:Q,...Y}){return z5.jsx(g5.Portal,{children:z5.jsx(g5.Positioner,{className:"isolate z-50 outline-none",align:Z,alignOffset:J,side:$,sideOffset:X,children:z5.jsx(g5.Popup,{"data-slot":"dropdown-menu-content",className:B0("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-border 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",Q),...Y})})})}function l4({...Z}){return z5.jsx(g5.Group,{"data-slot":"dropdown-menu-group",...Z})}function y_({className:Z,inset:J,...$}){return z5.jsx(g5.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":J,className:B0("px-2 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",Z),...$})}function KZ({className:Z,inset:J,variant:$="default",...X}){return z5.jsx(g5.Item,{"data-slot":"dropdown-menu-item","data-inset":J,"data-variant":$,className:B0("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-xs 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",Z),...X})}function b_({...Z}){return z5.jsx(g5.SubmenuRoot,{"data-slot":"dropdown-menu-sub",...Z})}function x_({className:Z,inset:J,children:$,...X}){return z5.jsxs(g5.SubmenuTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":J,className:B0("flex cursor-default items-center gap-2 rounded-xs 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-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",Z),...X,children:[$,z5.jsx(AX,{className:"cn-rtl-flip ml-auto",stroke:1.75})]})}function h_({align:Z="start",alignOffset:J=-3,side:$="right",sideOffset:X=0,className:Q,...Y}){return z5.jsx(d4,{"data-slot":"dropdown-menu-sub-content",className:B0("w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-border duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 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",Q),align:Z,alignOffset:J,side:$,sideOffset:X,...Y})}function zz({...Z}){return z5.jsx(g5.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...Z})}function Wz({className:Z,children:J,inset:$,...X}){return z5.jsxs(g5.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":$,className:B0("relative flex cursor-default items-center gap-2 rounded-xs 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",Z),...X,children:[z5.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:z5.jsx(g5.RadioItemIndicator,{children:z5.jsx(R_,{stroke:1.75})})}),J]})}function v_({className:Z,...J}){return z5.jsx(g5.Separator,{"data-slot":"dropdown-menu-separator",className:B0("-mx-1 my-1 h-px bg-border",Z),...J})}function g_({className:Z,...J}){return z5.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:B0("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",Z),...J})}var VZ={};t7(VZ,{Thumb:()=>d_,Root:()=>u_});var d2=j(m(),1);var XQ=j(m(),1),Kz=XQ.createContext(void 0);function m_(){let Z=XQ.useContext(Kz);if(Z===void 0)throw Error(w0(63));return Z}var qz=function(Z){return Z.checked="data-checked",Z.unchecked="data-unchecked",Z.disabled="data-disabled",Z.readonly="data-readonly",Z.required="data-required",Z.valid="data-valid",Z.invalid="data-invalid",Z.touched="data-touched",Z.dirty="data-dirty",Z.filled="data-filled",Z.focused="data-focused",Z}({});var QQ={...B7,checked(Z){if(Z)return{[qz.checked]:""};return{[qz.unchecked]:""}}};var f_=j(m(),1);function p_(Z,J){let $=f_.useRef(Z),X=Y0(J);$0(()=>{if($.current===Z)return;X($.current)},[Z,X]),$0(()=>{$.current=Z},[Z])}var qZ=j(a(),1),u_=d2.forwardRef(function(J,$){let{checked:X,className:Q,defaultChecked:Y,id:G,inputRef:H,name:z,nativeButton:W=!1,onCheckedChange:K,readOnly:q=!1,required:V=!1,disabled:U=!1,render:B,uncheckedValue:F,value:N,...L}=J,{clearErrors:_}=v9(),{state:M,setTouched:O,setDirty:D,validityData:A,setFilled:T,setFocused:S,shouldValidateOnChange:k,validationMode:P,disabled:g,name:C,validation:I}=C5(),{labelId:y}=r5(),b=g||U,R=C??z,x=Y0(K),v=d2.useRef(null),d=Z9(v,H,I.inputRef),w=d2.useRef(null),z0=d0(),G0=u$({id:G,implicit:!1,controlRef:w}),E=W?void 0:G0,[s,A0]=g9({controlled:X,default:Boolean(Y),name:"Switch",state:"checked"});c$({id:z0,commit:I.commit,value:s,controlRef:w,name:R,getValue:()=>s}),$0(()=>{if(v.current)T(v.current.checked)},[v,T]),p_(s,()=>{if(_(R),D(s!==A.initialValue),T(s),k())I.commit(s);else I.commit(s,!0)});let{getButtonProps:l,buttonRef:H0}=v5({disabled:b,native:W}),q0={id:W?G0:z0,role:"switch","aria-checked":s,"aria-readonly":q||void 0,"aria-required":V||void 0,"aria-labelledby":y,onFocus(){if(!b)S(!0)},onBlur(){let p=v.current;if(!p||b)return;if(O(!0),S(!1),P==="onBlur")I.commit(p.checked)},onClick(p){if(q||b)return;p.preventDefault(),v.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:p.shiftKey,ctrlKey:p.ctrlKey,altKey:p.altKey,metaKey:p.metaKey}))}},X0=d2.useMemo(()=>p7({checked:s,disabled:b,id:E,name:R,required:V,style:R?gV:P6,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:d,onChange(p){if(p.nativeEvent.defaultPrevented)return;let Z0=p.target.checked,e=N0(n.none,p.nativeEvent);if(x?.(Z0,e),e.isCanceled)return;A0(Z0)},onFocus(){w.current?.focus()}},I.getInputValidationProps,N!==void 0?{value:N}:N1),[s,b,d,E,R,x,V,A0,I,N]),Q0=d2.useMemo(()=>({...M,checked:s,disabled:b,readOnly:q,required:V}),[M,s,b,q,V]),V0=K0("span",J,{state:Q0,ref:[$,w,H0],props:[q0,I.getValidationProps,L,l],stateAttributesMapping:QQ});return qZ.jsxs(Kz.Provider,{value:Q0,children:[V0,!s&&R&&F!==void 0&&qZ.jsx("input",{type:"hidden",name:R,value:F}),qZ.jsx("input",{...X0})]})});var c_=j(m(),1);var d_=c_.forwardRef(function(J,$){let{render:X,className:Q,...Y}=J,{state:G}=C5(),H=m_(),z={...G,...H};return K0("span",J,{state:z,ref:$,stateAttributesMapping:QQ,props:Y})});var Vz=j(a(),1);function YQ({className:Z,...J}){return Vz.jsx(VZ.Root,{"data-slot":"switch",className:B0("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),...J,children:Vz.jsx(VZ.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 c1=j(a(),1);function l_(Z){return Z?.split(/\s*·\s*/)[0]??""}function Vb(Z){return Z.charAt(0).toUpperCase()+Z.slice(1)}function Uz(Z){return Z==="xhigh"?"Extra":Vb(Z)}var HQ=GQ.memo(function({scope:J="active-chat"}){let{workspaceId:$,layout:X,setLayout:Q}=R1(),{data:Y}=Y8($),G=Y?.models??[],H=G.find((P)=>P.value==="default"),z=Y?mN(G.filter((P)=>P.value!=="default"),Y.provider):[],W=M7((P)=>J==="active-chat"?P.activeByWorkspace[$]??null:null),K=OX($,W).data,q=jN($),[V,U]=GQ.useState(!1),B=(W?K?.model:void 0)??X.selectedModel,F=(W?K?.effort:void 0)??X.selectedEffort,N=(P)=>{if(W)q.mutate({sessionId:W,patch:{model:P}});else Q({selectedModel:P})},L=(P)=>{if(W)q.mutate({sessionId:W,patch:{effort:P}});else Q({selectedEffort:P})};if(z.length===0)return null;let _=z.some((P)=>P.value===B)?B:void 0,M=z.find((P)=>H?.resolvedModel&&P.resolvedModel===H.resolvedModel)??z[0],O=_??M.value,D=z.find((P)=>P.value===O)??z[0],A=vN(D.supportsEffort?D.supportedEffortLevels??[]:[]),T=gN(A,F),S=A.length>0,k=!!D.supportsFastMode;return c1.jsxs(B8,{children:[c1.jsx(F8,{render:c1.jsxs(I0,{variant:"ghost",children:[c1.jsx("span",{className:"text-foreground",children:l_(D.description)||D.displayName}),T&&c1.jsx("span",{className:"text-muted-foreground",children:Uz(T)}),c1.jsx(L8,{stroke:1.5})]})}),c1.jsxs(d4,{align:"start",side:"top",className:"min-w-56",children:[c1.jsxs(l4,{children:[c1.jsx(y_,{children:"Models"}),c1.jsx(zz,{value:O,onValueChange:N,children:z.map((P)=>c1.jsx(Wz,{value:P.value,closeOnClick:!0,children:l_(P.description)||P.displayName},P.value))})]}),(S||k)&&c1.jsx(v_,{}),S&&c1.jsxs(b_,{children:[c1.jsx(x_,{children:c1.jsxs("div",{className:"flex flex-1 items-center justify-between",children:["Reasoning",T&&c1.jsx("span",{className:"ml-auto text-muted-foreground",children:Uz(T)})]})}),c1.jsx(h_,{children:c1.jsx(zz,{value:T,onValueChange:L,children:A.map((P)=>c1.jsx(Wz,{value:P,closeOnClick:!0,children:Uz(P)},P))})})]}),k&&c1.jsx(l4,{className:"mt-0.5",children:c1.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-4 rounded-xs px-2 py-1 text-sm",children:["Fast mode",c1.jsx(YQ,{checked:V,onCheckedChange:U})]})})]})]})});var I1=j(a(),1);function r_({composerRef:Z,onSend:J,onStop:$,processing:X}){let Q=KQ.useRef(null),Y=h5(),G=M7((L)=>L.activeByWorkspace[Y]??null),H=M7((L)=>L.drafts[M9(Y,G)]??""),z=M7((L)=>L.attachments[M9(Y,G)]??Ub),[W,K]=KQ.useState(!1),q=z.some((L)=>L.status==="uploading"),V=z.some((L)=>L.status==="ready"),U=(H.trim().length>0||V)&&!q,B=(L)=>W1.getState().setDraft(Y,G,L),F=(L)=>{if(L.length===0)return;let _=W1.getState(),M=L.map((O)=>({localId:crypto.randomUUID(),name:O.name||"file",mediaType:O.type||"application/octet-stream",previewUrl:O.type.startsWith("image/")?URL.createObjectURL(O):void 0,status:"uploading"}));_.addAttachments(Y,G,M),M.forEach((O,D)=>{hN(Y,[L[D]]).then(([A])=>W1.getState().updateAttachment(Y,G,O.localId,{status:"ready",upload:A,mediaType:A.mediaType})).catch((A)=>W1.getState().updateAttachment(Y,G,O.localId,{status:"error",error:A instanceof Error?A.message:"Upload failed"}))})},N=()=>{if(!U)return;J(H),W1.getState().setDraft(Y,G,"")};return I1.jsxs(jX,{composerRef:Z,onSubmit:(L)=>{L.preventDefault(),N()},onDragOver:(L)=>{if(!L.dataTransfer.types.includes("Files"))return;L.preventDefault(),K(!0)},onDragLeave:(L)=>{if(L.currentTarget.contains(L.relatedTarget))return;K(!1)},onDrop:(L)=>{if(!L.dataTransfer.types.includes("Files"))return;L.preventDefault(),K(!1),F(Array.from(L.dataTransfer.files))},className:B0(W&&"ring-2 ring-ring/60"),children:[z.length>0&&I1.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-0.5",children:z.map((L)=>I1.jsx(Bb,{attachment:L,onRemove:()=>W1.getState().removeAttachment(Y,G,L.localId)},L.localId))}),I1.jsx(TX,{textareaRef:Z,id:"chat-input",name:"message",value:H,onChange:(L)=>B(L.target.value),onKeyDown:(L)=>{if(L.key==="Enter"&&!L.shiftKey)L.preventDefault(),N()},onPaste:(L)=>{let _=Array.from(L.clipboardData?.files??[]);if(_.length===0)return;L.preventDefault(),F(_)},placeholder:X?"Queue a follow-up":"Do anything",rows:1}),I1.jsxs(CX,{children:[I1.jsx("input",{ref:Q,type:"file",multiple:!0,hidden:!0,onChange:(L)=>{F(Array.from(L.target.files??[])),L.target.value=""}}),I1.jsx(I0,{type:"button",variant:"ghost",size:"icon",className:"mr-auto",onClick:()=>Q.current?.click(),"aria-label":"Attach files",children:I1.jsx(WQ,{stroke:1.5})}),I1.jsx(HQ,{}),X?I1.jsx(I0,{type:"button",size:"icon",onClick:$,"aria-label":"Stop agent",children:I1.jsx(i_,{stroke:1.5})}):I1.jsx(I0,{type:"submit",size:"icon",disabled:!U,"aria-label":"Send message",children:I1.jsx(zQ,{stroke:1.5})})]})]})}var Ub=[];function Bb({attachment:Z,onRemove:J}){let{name:$,previewUrl:X,status:Q,error:Y}=Z,G=!!X;return I1.jsxs("div",{className:B0("group relative flex items-center gap-2 overflow-hidden rounded-md border border-border bg-accent text-accent-foreground",G?"size-14":"h-10 max-w-52 pr-2 pl-2",Q==="error"&&"border-destructive/50"),title:Y??$,children:[G?I1.jsx("img",{src:X,alt:$,className:"size-full object-cover"}):I1.jsxs(I1.Fragment,{children:[I1.jsx(N8,{size:16,stroke:1.75,className:"shrink-0 text-muted-foreground"}),I1.jsx("span",{className:"truncate text-xs",children:$})]}),Q==="uploading"&&I1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:I1.jsx(G7,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),Q==="error"&&I1.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-destructive/10 text-[10px] text-destructive",children:"Failed"}),I1.jsx(I0,{type:"button",variant:"ghost",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,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:I1.jsx(H9,{stroke:1.75})})]})}var L7=j(a(),1);function Fb(Z){let J=new Date(Z),$=new Date,X=J.toDateString()===$.toDateString(),Q=new Date($);Q.setDate(Q.getDate()-1);let Y=J.toDateString()===Q.toDateString();if(X)return J.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});if(Y)return"Yesterday";return J.toLocaleDateString([],{month:"short",day:"numeric"})}function a_({onSwitch:Z}){let J=h5(),{data:$=[],refetch:X}=DX(J),Q=M7((z)=>z.activeByWorkspace[J]??null),G=$.find((z)=>z.sessionId===Q)?.summary??"New chat";function H(z){Z(z)}return L7.jsxs(B8,{onOpenChange:(z)=>{if(z)X()},children:[L7.jsx(F8,{render:L7.jsxs(I0,{variant:"ghost",children:[L7.jsx("span",{className:"max-w-64 truncate",children:G}),L7.jsx(L8,{stroke:1.5})]})}),L7.jsxs(d4,{align:"start",className:"max-h-80 w-80 overflow-y-auto",children:[L7.jsxs(KZ,{className:"text-muted-foreground! **:text-muted-foreground!",onClick:()=>H(null),children:[L7.jsx(s5,{size:16,stroke:1.75}),"New chat"]}),$.length>0&&L7.jsx(l4,{children:$.map((z)=>L7.jsxs(KZ,{className:B0(Q===z.sessionId&&"bg-accent text-accent-foreground"),onClick:()=>H(z.sessionId),children:[L7.jsx("span",{className:"truncate",children:z.summary}),L7.jsx(g_,{className:"shrink-0 tracking-normal",children:Fb(z.lastModified)})]},z.sessionId))})]})]})}var Ow=j(m(),1);function U1(){}function qQ(){}function s_(Z,J){let $=J||{};return(Z[Z.length-1]===""?[...Z,""]:Z).join(($.padRight?" ":"")+","+($.padLeft===!1?"":" ")).trim()}var Lb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_b={};function VQ(Z,J){return((J||_b).jsx?Nb:Lb).test(Z)}var Ab=/[ \t\n\f\r]/g;function Bz(Z){return typeof Z==="object"?Z.type==="text"?n_(Z.value):!1:n_(Z)}function n_(Z){return Z.replace(Ab,"")===""}class l2{constructor(Z,J,$){if(this.normal=J,this.property=Z,$)this.space=$}}l2.prototype.normal={};l2.prototype.property={};l2.prototype.space=void 0;function Fz(Z,J){let $={},X={};for(let Q of Z)Object.assign($,Q.property),Object.assign(X,Q.normal);return new l2($,X,J)}function UZ(Z){return Z.toLowerCase()}class m5{constructor(Z,J){this.attribute=J,this.property=Z}}m5.prototype.attribute="";m5.prototype.booleanish=!1;m5.prototype.boolean=!1;m5.prototype.commaOrSpaceSeparated=!1;m5.prototype.commaSeparated=!1;m5.prototype.defined=!1;m5.prototype.mustUseProperty=!1;m5.prototype.number=!1;m5.prototype.overloadedBoolean=!1;m5.prototype.property="";m5.prototype.spaceSeparated=!1;m5.prototype.space=void 0;var BZ={};t7(BZ,{spaceSeparated:()=>D1,overloadedBoolean:()=>UQ,number:()=>F0,commaSeparated:()=>i2,commaOrSpaceSeparated:()=>N7,booleanish:()=>Q5,boolean:()=>r0});var Mb=0,r0=i4(),Q5=i4(),UQ=i4(),F0=i4(),D1=i4(),i2=i4(),N7=i4();function i4(){return 2**++Mb}var Lz=Object.keys(BZ);class _8 extends m5{constructor(Z,J,$,X){let Q=-1;super(Z,J);if(o_(this,"space",X),typeof $==="number")while(++Q<Lz.length){let Y=Lz[Q];o_(this,Lz[Q],($&BZ[Y])===BZ[Y])}}}_8.prototype.defined=!0;function o_(Z,J,$){if($)Z[J]=$}function i7(Z){let J={},$={};for(let[X,Q]of Object.entries(Z.properties)){let Y=new _8(X,Z.transform(Z.attributes||{},X),Q,Z.space);if(Z.mustUseProperty&&Z.mustUseProperty.includes(X))Y.mustUseProperty=!0;J[X]=Y,$[UZ(X)]=X,$[UZ(Y.attribute)]=X}return new l2(J,$,Z.space)}var Nz=i7({properties:{ariaActiveDescendant:null,ariaAtomic:Q5,ariaAutoComplete:null,ariaBusy:Q5,ariaChecked:Q5,ariaColCount:F0,ariaColIndex:F0,ariaColSpan:F0,ariaControls:D1,ariaCurrent:null,ariaDescribedBy:D1,ariaDetails:null,ariaDisabled:Q5,ariaDropEffect:D1,ariaErrorMessage:null,ariaExpanded:Q5,ariaFlowTo:D1,ariaGrabbed:Q5,ariaHasPopup:null,ariaHidden:Q5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:D1,ariaLevel:F0,ariaLive:null,ariaModal:Q5,ariaMultiLine:Q5,ariaMultiSelectable:Q5,ariaOrientation:null,ariaOwns:D1,ariaPlaceholder:null,ariaPosInSet:F0,ariaPressed:Q5,ariaReadOnly:Q5,ariaRelevant:null,ariaRequired:Q5,ariaRoleDescription:D1,ariaRowCount:F0,ariaRowIndex:F0,ariaRowSpan:F0,ariaSelected:Q5,ariaSetSize:F0,ariaSort:null,ariaValueMax:F0,ariaValueMin:F0,ariaValueNow:F0,ariaValueText:null,role:null},transform(Z,J){return J==="role"?J:"aria-"+J.slice(4).toLowerCase()}});function BQ(Z,J){return J in Z?Z[J]:J}function FQ(Z,J){return BQ(Z,J.toLowerCase())}var t_=i7({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:i2,acceptCharset:D1,accessKey:D1,action:null,allow:null,allowFullScreen:r0,allowPaymentRequest:r0,allowUserMedia:r0,alt:null,as:null,async:r0,autoCapitalize:null,autoComplete:D1,autoFocus:r0,autoPlay:r0,blocking:D1,capture:null,charSet:null,checked:r0,cite:null,className:D1,cols:F0,colSpan:null,content:null,contentEditable:Q5,controls:r0,controlsList:D1,coords:F0|i2,crossOrigin:null,data:null,dateTime:null,decoding:null,default:r0,defer:r0,dir:null,dirName:null,disabled:r0,download:UQ,draggable:Q5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:r0,formTarget:null,headers:D1,height:F0,hidden:UQ,high:F0,href:null,hrefLang:null,htmlFor:D1,httpEquiv:D1,id:null,imageSizes:null,imageSrcSet:null,inert:r0,inputMode:null,integrity:null,is:null,isMap:r0,itemId:null,itemProp:D1,itemRef:D1,itemScope:r0,itemType:D1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:r0,low:F0,manifest:null,max:null,maxLength:F0,media:null,method:null,min:null,minLength:F0,multiple:r0,muted:r0,name:null,nonce:null,noModule:r0,noValidate:r0,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:r0,optimum:F0,pattern:null,ping:D1,placeholder:null,playsInline:r0,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:r0,referrerPolicy:null,rel:D1,required:r0,reversed:r0,rows:F0,rowSpan:F0,sandbox:D1,scope:null,scoped:r0,seamless:r0,selected:r0,shadowRootClonable:r0,shadowRootDelegatesFocus:r0,shadowRootMode:null,shape:null,size:F0,sizes:null,slot:null,span:F0,spellCheck:Q5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F0,step:null,style:null,tabIndex:F0,target:null,title:null,translate:null,type:null,typeMustMatch:r0,useMap:null,value:Q5,width:F0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:D1,axis:null,background:null,bgColor:null,border:F0,borderColor:null,bottomMargin:F0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:r0,declare:r0,event:null,face:null,frame:null,frameBorder:null,hSpace:F0,leftMargin:F0,link:null,longDesc:null,lowSrc:null,marginHeight:F0,marginWidth:F0,noResize:r0,noHref:r0,noShade:r0,noWrap:r0,object:null,profile:null,prompt:null,rev:null,rightMargin:F0,rules:null,scheme:null,scrolling:Q5,standby:null,summary:null,text:null,topMargin:F0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:r0,disableRemotePlayback:r0,prefix:null,property:null,results:F0,security:null,unselectable:null},space:"html",transform:FQ});var e_=i7({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:N7,accentHeight:F0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F0,amplitude:F0,arabicForm:null,ascent:F0,attributeName:null,attributeType:null,azimuth:F0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F0,by:null,calcMode:null,capHeight:F0,className:D1,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:F0,diffuseConstant:F0,direction:null,display:null,dur:null,divisor:F0,dominantBaseline:null,download:r0,dx:null,dy:null,edgeMode:null,editable:null,elevation:F0,enableBackground:null,end:null,event:null,exponent:F0,externalResourcesRequired:null,fill:null,fillOpacity:F0,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:i2,g2:i2,glyphName:i2,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F0,horizOriginX:F0,horizOriginY:F0,id:null,ideographic:F0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F0,k:F0,k1:F0,k2:F0,k3:F0,k4:F0,kernelMatrix:N7,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F0,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:F0,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:F0,overlineThickness:F0,paintOrder:null,panose1:null,path:null,pathLength:F0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:D1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F0,pointsAtY:F0,pointsAtZ:F0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:N7,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:N7,rev:N7,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:N7,requiredFeatures:N7,requiredFonts:N7,requiredFormats:N7,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:F0,specularExponent:F0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F0,strikethroughThickness:F0,string:null,stroke:null,strokeDashArray:N7,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F0,strokeOpacity:F0,strokeWidth:null,style:null,surfaceScale:F0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:N7,tabIndex:F0,tableValues:null,target:null,targetX:F0,targetY:F0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:N7,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F0,underlineThickness:F0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F0,values:null,vAlphabetic:F0,vMathematical:F0,vectorEffect:null,vHanging:F0,vIdeographic:F0,version:null,vertAdvY:F0,vertOriginX:F0,vertOriginY:F0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:BQ});var _z=i7({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(Z,J){return"xlink:"+J.slice(5).toLowerCase()}});var Az=i7({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:FQ});var Mz=i7({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(Z,J){return"xml:"+J.slice(3).toLowerCase()}});var Dz={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 Db=/[A-Z]/g,ZA=/-[a-z]/g,Ob=/^data[-\w.:]+$/i;function Oz(Z,J){let $=UZ(J),X=J,Q=m5;if($ in Z.normal)return Z.property[Z.normal[$]];if($.length>4&&$.slice(0,4)==="data"&&Ob.test(J)){if(J.charAt(4)==="-"){let Y=J.slice(5).replace(ZA,Pb);X="data"+Y.charAt(0).toUpperCase()+Y.slice(1)}else{let Y=J.slice(4);if(!ZA.test(Y)){let G=Y.replace(Db,wb);if(G.charAt(0)!=="-")G="-"+G;J="data"+G}}Q=_8}return new Q(X,J)}function wb(Z){return"-"+Z.toLowerCase()}function Pb(Z){return Z.charAt(1).toUpperCase()}var JA=Fz([Nz,t_,_z,Az,Mz],"html"),LQ=Fz([Nz,e_,_z,Az,Mz],"svg");function $A(Z){return Z.join(" ").trim()}var AA=j(FA(),1);var NQ=LA("end"),A8=LA("start");function LA(Z){return J;function J($){let X=$&&$.position&&$.position[Z]||{};if(typeof X.line==="number"&&X.line>0&&typeof X.column==="number"&&X.column>0)return{line:X.line,column:X.column,offset:typeof X.offset==="number"&&X.offset>-1?X.offset:void 0}}}function jz(Z){let J=A8(Z),$=NQ(Z);if(J&&$)return{start:J,end:$}}function r2(Z){if(!Z||typeof Z!=="object")return"";if("position"in Z||"type"in Z)return NA(Z.position);if("start"in Z||"end"in Z)return NA(Z);if("line"in Z||"column"in Z)return Tz(Z);return""}function Tz(Z){return _A(Z&&Z.line)+":"+_A(Z&&Z.column)}function NA(Z){return Tz(Z&&Z.start)+"-"+Tz(Z&&Z.end)}function _A(Z){return Z&&typeof Z==="number"?Z:1}class L5 extends Error{constructor(Z,J,$){super();if(typeof J==="string")$=J,J=void 0;let X="",Q={},Y=!1;if(J)if("line"in J&&"column"in J)Q={place:J};else if("start"in J&&"end"in J)Q={place:J};else if("type"in J)Q={ancestors:[J],place:J.position};else Q={...J};if(typeof Z==="string")X=Z;else if(!Q.cause&&Z)Y=!0,X=Z.message,Q.cause=Z;if(!Q.ruleId&&!Q.source&&typeof $==="string"){let H=$.indexOf(":");if(H===-1)Q.ruleId=$;else Q.source=$.slice(0,H),Q.ruleId=$.slice(H+1)}if(!Q.place&&Q.ancestors&&Q.ancestors){let H=Q.ancestors[Q.ancestors.length-1];if(H)Q.place=H.position}let G=Q.place&&"start"in Q.place?Q.place.start:Q.place;this.ancestors=Q.ancestors||void 0,this.cause=Q.cause||void 0,this.column=G?G.column:void 0,this.fatal=void 0,this.file="",this.message=X,this.line=G?G.line:void 0,this.name=r2(Q.place)||"1:1",this.place=Q.place||void 0,this.reason=this.message,this.ruleId=Q.ruleId||void 0,this.source=Q.source||void 0,this.stack=Y&&Q.cause&&typeof Q.cause.stack==="string"?Q.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}L5.prototype.file="";L5.prototype.name="";L5.prototype.reason="";L5.prototype.message="";L5.prototype.stack="";L5.prototype.column=void 0;L5.prototype.line=void 0;L5.prototype.ancestors=void 0;L5.prototype.cause=void 0;L5.prototype.fatal=void 0;L5.prototype.place=void 0;L5.prototype.ruleId=void 0;L5.prototype.source=void 0;var Cz={}.hasOwnProperty,nb=new Map,ob=/[A-Z]/g,tb=new Set(["table","tbody","thead","tfoot","tr"]),eb=new Set(["td","th"]),MA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Sz(Z,J){if(!J||J.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let $=J.filePath||void 0,X;if(J.development){if(typeof J.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");X=Hx($,J.jsxDEV)}else{if(typeof J.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof J.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");X=Gx($,J.jsx,J.jsxs)}let Q={Fragment:J.Fragment,ancestors:[],components:J.components||{},create:X,elementAttributeNameCase:J.elementAttributeNameCase||"react",evaluater:J.createEvaluater?J.createEvaluater():void 0,filePath:$,ignoreInvalidStyle:J.ignoreInvalidStyle||!1,passKeys:J.passKeys!==!1,passNode:J.passNode||!1,schema:J.space==="svg"?LQ:JA,stylePropertyNameCase:J.stylePropertyNameCase||"dom",tableCellAlignToStyle:J.tableCellAlignToStyle!==!1},Y=DA(Q,Z,void 0);if(Y&&typeof Y!=="string")return Y;return Q.create(Z,Q.Fragment,{children:Y||void 0},void 0)}function DA(Z,J,$){if(J.type==="element")return Zx(Z,J,$);if(J.type==="mdxFlowExpression"||J.type==="mdxTextExpression")return Jx(Z,J);if(J.type==="mdxJsxFlowElement"||J.type==="mdxJsxTextElement")return Xx(Z,J,$);if(J.type==="mdxjsEsm")return $x(Z,J);if(J.type==="root")return Qx(Z,J,$);if(J.type==="text")return Yx(Z,J)}function Zx(Z,J,$){let X=Z.schema,Q=X;if(J.tagName.toLowerCase()==="svg"&&X.space==="html")Q=LQ,Z.schema=Q;Z.ancestors.push(J);let Y=wA(Z,J.tagName,!1),G=zx(Z,J),H=Ez(Z,J);if(tb.has(J.tagName))H=H.filter(function(z){return typeof z==="string"?!Bz(z):!0});return OA(Z,G,Y,J),Iz(G,H),Z.ancestors.pop(),Z.schema=X,Z.create(J,Y,G,$)}function Jx(Z,J){if(J.data&&J.data.estree&&Z.evaluater){let X=J.data.estree.body[0];return U1(X.type==="ExpressionStatement"),Z.evaluater.evaluateExpression(X.expression)}LZ(Z,J.position)}function $x(Z,J){if(J.data&&J.data.estree&&Z.evaluater)return Z.evaluater.evaluateProgram(J.data.estree);LZ(Z,J.position)}function Xx(Z,J,$){let X=Z.schema,Q=X;if(J.name==="svg"&&X.space==="html")Q=LQ,Z.schema=Q;Z.ancestors.push(J);let Y=J.name===null?Z.Fragment:wA(Z,J.name,!0),G=Wx(Z,J),H=Ez(Z,J);return OA(Z,G,Y,J),Iz(G,H),Z.ancestors.pop(),Z.schema=X,Z.create(J,Y,G,$)}function Qx(Z,J,$){let X={};return Iz(X,Ez(Z,J)),Z.create(J,Z.Fragment,X,$)}function Yx(Z,J){return J.value}function OA(Z,J,$,X){if(typeof $!=="string"&&$!==Z.Fragment&&Z.passNode)J.node=X}function Iz(Z,J){if(J.length>0){let $=J.length>1?J:J[0];if($)Z.children=$}}function Gx(Z,J,$){return X;function X(Q,Y,G,H){let W=Array.isArray(G.children)?$:J;return H?W(Y,G,H):W(Y,G)}}function Hx(Z,J){return $;function $(X,Q,Y,G){let H=Array.isArray(Y.children),z=A8(X);return J(Q,Y,G,H,{columnNumber:z?z.column-1:void 0,fileName:Z,lineNumber:z?z.line:void 0},void 0)}}function zx(Z,J){let $={},X,Q;for(Q in J.properties)if(Q!=="children"&&Cz.call(J.properties,Q)){let Y=Kx(Z,Q,J.properties[Q]);if(Y){let[G,H]=Y;if(Z.tableCellAlignToStyle&&G==="align"&&typeof H==="string"&&eb.has(J.tagName))X=H;else $[G]=H}}if(X){let Y=$.style||($.style={});Y[Z.stylePropertyNameCase==="css"?"text-align":"textAlign"]=X}return $}function Wx(Z,J){let $={};for(let X of J.attributes)if(X.type==="mdxJsxExpressionAttribute")if(X.data&&X.data.estree&&Z.evaluater){let Y=X.data.estree.body[0];U1(Y.type==="ExpressionStatement");let G=Y.expression;U1(G.type==="ObjectExpression");let H=G.properties[0];U1(H.type==="SpreadElement"),Object.assign($,Z.evaluater.evaluateExpression(H.argument))}else LZ(Z,J.position);else{let Q=X.name,Y;if(X.value&&typeof X.value==="object")if(X.value.data&&X.value.data.estree&&Z.evaluater){let H=X.value.data.estree.body[0];U1(H.type==="ExpressionStatement"),Y=Z.evaluater.evaluateExpression(H.expression)}else LZ(Z,J.position);else Y=X.value===null?!0:X.value;$[Q]=Y}return $}function Ez(Z,J){let $=[],X=-1,Q=Z.passKeys?new Map:nb;while(++X<J.children.length){let Y=J.children[X],G;if(Z.passKeys){let z=Y.type==="element"?Y.tagName:Y.type==="mdxJsxFlowElement"||Y.type==="mdxJsxTextElement"?Y.name:void 0;if(z){let W=Q.get(z)||0;G=z+"-"+W,Q.set(z,W+1)}}let H=DA(Z,Y,G);if(H!==void 0)$.push(H)}return $}function Kx(Z,J,$){let X=Oz(Z.schema,J);if($===null||$===void 0||typeof $==="number"&&Number.isNaN($))return;if(Array.isArray($))$=X.commaSeparated?s_($):$A($);if(X.property==="style"){let Q=typeof $==="object"?$:qx(Z,String($));if(Z.stylePropertyNameCase==="css")Q=Vx(Q);return["style",Q]}return[Z.elementAttributeNameCase==="react"&&X.space?Dz[X.property]||X.property:X.attribute,$]}function qx(Z,J){try{return AA.default(J,{reactCompat:!0})}catch($){if(Z.ignoreInvalidStyle)return{};let X=$,Q=new L5("Cannot parse `style` attribute",{ancestors:Z.ancestors,cause:X,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw Q.file=Z.filePath||void 0,Q.url=MA+"#cannot-parse-style-attribute",Q}}function wA(Z,J,$){let X;if(!$)X={type:"Literal",value:J};else if(J.includes(".")){let Q=J.split("."),Y=-1,G;while(++Y<Q.length){let H=VQ(Q[Y])?{type:"Identifier",name:Q[Y]}:{type:"Literal",value:Q[Y]};G=G?{type:"MemberExpression",object:G,property:H,computed:Boolean(Y&&H.type==="Literal"),optional:!1}:H}U1(G,"always a result"),X=G}else X=VQ(J)&&!/^[a-z]/.test(J)?{type:"Identifier",name:J}:{type:"Literal",value:J};if(X.type==="Literal"){let Q=X.value;return Cz.call(Z.components,Q)?Z.components[Q]:Q}if(Z.evaluater)return Z.evaluater.evaluateExpression(X);LZ(Z)}function LZ(Z,J){let $=new L5("Cannot handle MDX estrees without `createEvaluater`",{ancestors:Z.ancestors,place:J,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw $.file=Z.filePath||void 0,$.url=MA+"#cannot-handle-mdx-estrees-without-createevaluater",$}function Vx(Z){let J={},$;for($ in Z)if(Cz.call(Z,$))J[Ux($)]=Z[$];return J}function Ux(Z){let J=Z.replace(ob,Bx);if(J.slice(0,3)==="ms-")J="-"+J;return J}function Bx(Z){return"-"+Z.toLowerCase()}var NZ={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 C8=j(a(),1),iM=j(m(),1);var Fx={};function a4(Z,J){let $=J||Fx,X=typeof $.includeImageAlt==="boolean"?$.includeImageAlt:!0,Q=typeof $.includeHtml==="boolean"?$.includeHtml:!0;return jA(Z,X,Q)}function jA(Z,J,$){if(Lx(Z)){if("value"in Z)return Z.type==="html"&&!$?"":Z.value;if(J&&"alt"in Z&&Z.alt)return Z.alt;if("children"in Z)return PA(Z.children,J,$)}if(Array.isArray(Z))return PA(Z,J,$);return""}function PA(Z,J,$){let X=[],Q=-1;while(++Q<Z.length)X[Q]=jA(Z[Q],J,$);return X.join("")}function Lx(Z){return Boolean(Z&&typeof Z==="object")}var TA=document.createElement("i");function M8(Z){let J="&"+Z+";";TA.innerHTML=J;let $=TA.textContent;if($.charCodeAt($.length-1)===59&&Z!=="semi")return!1;return $===J?!1:$}function W5(Z,J,$,X){let Q=Z.length,Y=0,G;if(J<0)J=-J>Q?0:Q+J;else J=J>Q?Q:J;if($=$>0?$:0,X.length<1e4)G=Array.from(X),G.unshift(J,$),Z.splice(...G);else{if($)Z.splice(J,$);while(Y<X.length)G=X.slice(Y,Y+1e4),G.unshift(J,0),Z.splice(...G),Y+=1e4,J+=1e4}}function H7(Z,J){if(Z.length>0)return W5(Z,Z.length,0,J),Z;return J}var CA={}.hasOwnProperty;function _Q(Z){let J={},$=-1;while(++$<Z.length)Nx(J,Z[$]);return J}function Nx(Z,J){let $;for($ in J){let Q=(CA.call(Z,$)?Z[$]:void 0)||(Z[$]={}),Y=J[$],G;if(Y)for(G in Y){if(!CA.call(Q,G))Q[G]=[];let H=Y[G];_x(Q[G],Array.isArray(H)?H:H?[H]:[])}}}function _x(Z,J){let $=-1,X=[];while(++$<J.length)(J[$].add==="after"?Z:X).push(J[$]);W5(Z,0,0,X)}function AQ(Z,J){let $=Number.parseInt(Z,J);if($<9||$===11||$>13&&$<32||$>126&&$<160||$>55295&&$<57344||$>64975&&$<65008||($&65535)===65535||($&65535)===65534||$>1114111)return"�";return String.fromCodePoint($)}function o5(Z){return Z.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var w5=a2(/[A-Za-z]/),Y5=a2(/[\dA-Za-z]/),SA=a2(/[#-'*+\--9=?A-Z^-~]/);function s4(Z){return Z!==null&&(Z<32||Z===127)}var _Z=a2(/\d/),IA=a2(/[\dA-Fa-f]/),EA=a2(/[!-/:-@[-`{-~]/);function j0(Z){return Z!==null&&Z<-2}function J1(Z){return Z!==null&&(Z<0||Z===32)}function b0(Z){return Z===-2||Z===-1||Z===32}var n4=a2(/\p{P}|\p{S}/u),i9=a2(/\s/);function a2(Z){return J;function J($){return $!==null&&$>-1&&Z.test(String.fromCharCode($))}}function r7(Z){let J=[],$=-1,X=0,Q=0;while(++$<Z.length){let Y=Z.charCodeAt($),G="";if(Y===37&&Y5(Z.charCodeAt($+1))&&Y5(Z.charCodeAt($+2)))Q=2;else if(Y<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(Y)))G=String.fromCharCode(Y)}else if(Y>55295&&Y<57344){let H=Z.charCodeAt($+1);if(Y<56320&&H>56319&&H<57344)G=String.fromCharCode(Y,H),Q=1;else G="�"}else G=String.fromCharCode(Y);if(G)J.push(Z.slice(X,$),encodeURIComponent(G)),X=$+Q+1,G="";if(Q)$+=Q,Q=0}return J.join("")+Z.slice(X)}function R0(Z,J,$,X){let Q=X?X-1:Number.POSITIVE_INFINITY,Y=0;return G;function G(z){if(b0(z))return Z.enter($),H(z);return J(z)}function H(z){if(b0(z)&&Y++<Q)return Z.consume(z),H;return Z.exit($),J(z)}}var kA={tokenize:Ax};function Ax(Z){let J=Z.attempt(this.parser.constructs.contentInitial,X,Q),$;return J;function X(H){if(H===null){Z.consume(H);return}return Z.enter("lineEnding"),Z.consume(H),Z.exit("lineEnding"),R0(Z,J,"linePrefix")}function Q(H){return Z.enter("paragraph"),Y(H)}function Y(H){let z=Z.enter("chunkText",{contentType:"text",previous:$});if($)$.next=z;return $=z,G(H)}function G(H){if(H===null){Z.exit("chunkText"),Z.exit("paragraph"),Z.consume(H);return}if(j0(H))return Z.consume(H),Z.exit("chunkText"),Y;return Z.consume(H),G}}var yA={tokenize:Mx},RA={tokenize:Dx};function Mx(Z){let J=this,$=[],X=0,Q,Y,G;return H;function H(M){if(X<$.length){let O=$[X];return J.containerState=O[1],Z.attempt(O[0].continuation,z,W)(M)}return W(M)}function z(M){if(X++,J.containerState._closeFlow){if(J.containerState._closeFlow=void 0,Q)_();let O=J.events.length,D=O,A;while(D--)if(J.events[D][0]==="exit"&&J.events[D][1].type==="chunkFlow"){A=J.events[D][1].end;break}L(X);let T=O;while(T<J.events.length)J.events[T][1].end={...A},T++;return W5(J.events,D+1,0,J.events.slice(O)),J.events.length=T,W(M)}return H(M)}function W(M){if(X===$.length){if(!Q)return V(M);if(Q.currentConstruct&&Q.currentConstruct.concrete)return B(M);J.interrupt=Boolean(Q.currentConstruct&&!Q._gfmTableDynamicInterruptHack)}return J.containerState={},Z.check(RA,K,q)(M)}function K(M){if(Q)_();return L(X),V(M)}function q(M){return J.parser.lazy[J.now().line]=X!==$.length,G=J.now().offset,B(M)}function V(M){return J.containerState={},Z.attempt(RA,U,B)(M)}function U(M){return X++,$.push([J.currentConstruct,J.containerState]),V(M)}function B(M){if(M===null){if(Q)_();L(0),Z.consume(M);return}return Q=Q||J.parser.flow(J.now()),Z.enter("chunkFlow",{_tokenizer:Q,contentType:"flow",previous:Y}),F(M)}function F(M){if(M===null){N(Z.exit("chunkFlow"),!0),L(0),Z.consume(M);return}if(j0(M))return Z.consume(M),N(Z.exit("chunkFlow")),X=0,J.interrupt=void 0,H;return Z.consume(M),F}function N(M,O){let D=J.sliceStream(M);if(O)D.push(null);if(M.previous=Y,Y)Y.next=M;if(Y=M,Q.defineSkip(M.start),Q.write(D),J.parser.lazy[M.start.line]){let A=Q.events.length;while(A--)if(Q.events[A][1].start.offset<G&&(!Q.events[A][1].end||Q.events[A][1].end.offset>G))return;let T=J.events.length,S=T,k,P;while(S--)if(J.events[S][0]==="exit"&&J.events[S][1].type==="chunkFlow"){if(k){P=J.events[S][1].end;break}k=!0}L(X),A=T;while(A<J.events.length)J.events[A][1].end={...P},A++;W5(J.events,S+1,0,J.events.slice(T)),J.events.length=A}}function L(M){let O=$.length;while(O-- >M){let D=$[O];J.containerState=D[1],D[0].exit.call(J,Z)}$.length=M}function _(){Q.write([null]),Y=void 0,Q=void 0,J.containerState._closeFlow=void 0}}function Dx(Z,J,$){return R0(Z,Z.attempt(this.parser.constructs.document,J,$),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function z2(Z){if(Z===null||J1(Z)||i9(Z))return 1;if(n4(Z))return 2}function s2(Z,J,$){let X=[],Q=-1;while(++Q<Z.length){let Y=Z[Q].resolveAll;if(Y&&!X.includes(Y))J=Y(J,$),X.push(Y)}return J}var AZ={name:"attention",resolveAll:Ox,tokenize:wx};function Ox(Z,J){let $=-1,X,Q,Y,G,H,z,W,K;while(++$<Z.length)if(Z[$][0]==="enter"&&Z[$][1].type==="attentionSequence"&&Z[$][1]._close){X=$;while(X--)if(Z[X][0]==="exit"&&Z[X][1].type==="attentionSequence"&&Z[X][1]._open&&J.sliceSerialize(Z[X][1]).charCodeAt(0)===J.sliceSerialize(Z[$][1]).charCodeAt(0)){if((Z[X][1]._close||Z[$][1]._open)&&(Z[$][1].end.offset-Z[$][1].start.offset)%3&&!((Z[X][1].end.offset-Z[X][1].start.offset+Z[$][1].end.offset-Z[$][1].start.offset)%3))continue;z=Z[X][1].end.offset-Z[X][1].start.offset>1&&Z[$][1].end.offset-Z[$][1].start.offset>1?2:1;let q={...Z[X][1].end},V={...Z[$][1].start};if(bA(q,-z),bA(V,z),G={type:z>1?"strongSequence":"emphasisSequence",start:q,end:{...Z[X][1].end}},H={type:z>1?"strongSequence":"emphasisSequence",start:{...Z[$][1].start},end:V},Y={type:z>1?"strongText":"emphasisText",start:{...Z[X][1].end},end:{...Z[$][1].start}},Q={type:z>1?"strong":"emphasis",start:{...G.start},end:{...H.end}},Z[X][1].end={...G.start},Z[$][1].start={...H.end},W=[],Z[X][1].end.offset-Z[X][1].start.offset)W=H7(W,[["enter",Z[X][1],J],["exit",Z[X][1],J]]);if(W=H7(W,[["enter",Q,J],["enter",G,J],["exit",G,J],["enter",Y,J]]),W=H7(W,s2(J.parser.constructs.insideSpan.null,Z.slice(X+1,$),J)),W=H7(W,[["exit",Y,J],["enter",H,J],["exit",H,J],["exit",Q,J]]),Z[$][1].end.offset-Z[$][1].start.offset)K=2,W=H7(W,[["enter",Z[$][1],J],["exit",Z[$][1],J]]);else K=0;W5(Z,X-1,$-X+3,W),$=X+W.length-K-2;break}}$=-1;while(++$<Z.length)if(Z[$][1].type==="attentionSequence")Z[$][1].type="data";return Z}function wx(Z,J){let $=this.parser.constructs.attentionMarkers.null,X=this.previous,Q=z2(X),Y;return G;function G(z){return Y=z,Z.enter("attentionSequence"),H(z)}function H(z){if(z===Y)return Z.consume(z),H;let W=Z.exit("attentionSequence"),K=z2(z),q=!K||K===2&&Q||$.includes(z),V=!Q||Q===2&&K||$.includes(X);return W._open=Boolean(Y===42?q:q&&(Q||!V)),W._close=Boolean(Y===42?V:V&&(K||!q)),J(z)}}function bA(Z,J){Z.column+=J,Z.offset+=J,Z._bufferIndex+=J}var kz={name:"autolink",tokenize:Px};function Px(Z,J,$){let X=0;return Q;function Q(U){return Z.enter("autolink"),Z.enter("autolinkMarker"),Z.consume(U),Z.exit("autolinkMarker"),Z.enter("autolinkProtocol"),Y}function Y(U){if(w5(U))return Z.consume(U),G;if(U===64)return $(U);return W(U)}function G(U){if(U===43||U===45||U===46||Y5(U))return X=1,H(U);return W(U)}function H(U){if(U===58)return Z.consume(U),X=0,z;if((U===43||U===45||U===46||Y5(U))&&X++<32)return Z.consume(U),H;return X=0,W(U)}function z(U){if(U===62)return Z.exit("autolinkProtocol"),Z.enter("autolinkMarker"),Z.consume(U),Z.exit("autolinkMarker"),Z.exit("autolink"),J;if(U===null||U===32||U===60||s4(U))return $(U);return Z.consume(U),z}function W(U){if(U===64)return Z.consume(U),K;if(SA(U))return Z.consume(U),W;return $(U)}function K(U){return Y5(U)?q(U):$(U)}function q(U){if(U===46)return Z.consume(U),X=0,K;if(U===62)return Z.exit("autolinkProtocol").type="autolinkEmail",Z.enter("autolinkMarker"),Z.consume(U),Z.exit("autolinkMarker"),Z.exit("autolink"),J;return V(U)}function V(U){if((U===45||Y5(U))&&X++<63){let B=U===45?V:q;return Z.consume(U),B}return $(U)}}var r9={partial:!0,tokenize:jx};function jx(Z,J,$){return X;function X(Y){return b0(Y)?R0(Z,Q,"linePrefix")(Y):Q(Y)}function Q(Y){return Y===null||j0(Y)?J(Y):$(Y)}}var MQ={continuation:{tokenize:Cx},exit:Sx,name:"blockQuote",tokenize:Tx};function Tx(Z,J,$){let X=this;return Q;function Q(G){if(G===62){let H=X.containerState;if(!H.open)Z.enter("blockQuote",{_container:!0}),H.open=!0;return Z.enter("blockQuotePrefix"),Z.enter("blockQuoteMarker"),Z.consume(G),Z.exit("blockQuoteMarker"),Y}return $(G)}function Y(G){if(b0(G))return Z.enter("blockQuotePrefixWhitespace"),Z.consume(G),Z.exit("blockQuotePrefixWhitespace"),Z.exit("blockQuotePrefix"),J;return Z.exit("blockQuotePrefix"),J(G)}}function Cx(Z,J,$){let X=this;return Q;function Q(G){if(b0(G))return R0(Z,Y,"linePrefix",X.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G);return Y(G)}function Y(G){return Z.attempt(MQ,J,$)(G)}}function Sx(Z){Z.exit("blockQuote")}var DQ={name:"characterEscape",tokenize:Ix};function Ix(Z,J,$){return X;function X(Y){return Z.enter("characterEscape"),Z.enter("escapeMarker"),Z.consume(Y),Z.exit("escapeMarker"),Q}function Q(Y){if(EA(Y))return Z.enter("characterEscapeValue"),Z.consume(Y),Z.exit("characterEscapeValue"),Z.exit("characterEscape"),J;return $(Y)}}var OQ={name:"characterReference",tokenize:Ex};function Ex(Z,J,$){let X=this,Q=0,Y,G;return H;function H(q){return Z.enter("characterReference"),Z.enter("characterReferenceMarker"),Z.consume(q),Z.exit("characterReferenceMarker"),z}function z(q){if(q===35)return Z.enter("characterReferenceMarkerNumeric"),Z.consume(q),Z.exit("characterReferenceMarkerNumeric"),W;return Z.enter("characterReferenceValue"),Y=31,G=Y5,K(q)}function W(q){if(q===88||q===120)return Z.enter("characterReferenceMarkerHexadecimal"),Z.consume(q),Z.exit("characterReferenceMarkerHexadecimal"),Z.enter("characterReferenceValue"),Y=6,G=IA,K;return Z.enter("characterReferenceValue"),Y=7,G=_Z,K(q)}function K(q){if(q===59&&Q){let V=Z.exit("characterReferenceValue");if(G===Y5&&!M8(X.sliceSerialize(V)))return $(q);return Z.enter("characterReferenceMarker"),Z.consume(q),Z.exit("characterReferenceMarker"),Z.exit("characterReference"),J}if(G(q)&&Q++<Y)return Z.consume(q),K;return $(q)}}var xA={partial:!0,tokenize:Rx},wQ={concrete:!0,name:"codeFenced",tokenize:kx};function kx(Z,J,$){let X=this,Q={partial:!0,tokenize:D},Y=0,G=0,H;return z;function z(A){return W(A)}function W(A){let T=X.events[X.events.length-1];return Y=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,H=A,Z.enter("codeFenced"),Z.enter("codeFencedFence"),Z.enter("codeFencedFenceSequence"),K(A)}function K(A){if(A===H)return G++,Z.consume(A),K;if(G<3)return $(A);return Z.exit("codeFencedFenceSequence"),b0(A)?R0(Z,q,"whitespace")(A):q(A)}function q(A){if(A===null||j0(A))return Z.exit("codeFencedFence"),X.interrupt?J(A):Z.check(xA,F,O)(A);return Z.enter("codeFencedFenceInfo"),Z.enter("chunkString",{contentType:"string"}),V(A)}function V(A){if(A===null||j0(A))return Z.exit("chunkString"),Z.exit("codeFencedFenceInfo"),q(A);if(b0(A))return Z.exit("chunkString"),Z.exit("codeFencedFenceInfo"),R0(Z,U,"whitespace")(A);if(A===96&&A===H)return $(A);return Z.consume(A),V}function U(A){if(A===null||j0(A))return q(A);return Z.enter("codeFencedFenceMeta"),Z.enter("chunkString",{contentType:"string"}),B(A)}function B(A){if(A===null||j0(A))return Z.exit("chunkString"),Z.exit("codeFencedFenceMeta"),q(A);if(A===96&&A===H)return $(A);return Z.consume(A),B}function F(A){return Z.attempt(Q,O,N)(A)}function N(A){return Z.enter("lineEnding"),Z.consume(A),Z.exit("lineEnding"),L}function L(A){return Y>0&&b0(A)?R0(Z,_,"linePrefix",Y+1)(A):_(A)}function _(A){if(A===null||j0(A))return Z.check(xA,F,O)(A);return Z.enter("codeFlowValue"),M(A)}function M(A){if(A===null||j0(A))return Z.exit("codeFlowValue"),_(A);return Z.consume(A),M}function O(A){return Z.exit("codeFenced"),J(A)}function D(A,T,S){let k=0;return P;function P(b){return A.enter("lineEnding"),A.consume(b),A.exit("lineEnding"),g}function g(b){return A.enter("codeFencedFence"),b0(b)?R0(A,C,"linePrefix",X.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):C(b)}function C(b){if(b===H)return A.enter("codeFencedFenceSequence"),I(b);return S(b)}function I(b){if(b===H)return k++,A.consume(b),I;if(k>=G)return A.exit("codeFencedFenceSequence"),b0(b)?R0(A,y,"whitespace")(b):y(b);return S(b)}function y(b){if(b===null||j0(b))return A.exit("codeFencedFence"),T(b);return S(b)}}}function Rx(Z,J,$){let X=this;return Q;function Q(G){if(G===null)return $(G);return Z.enter("lineEnding"),Z.consume(G),Z.exit("lineEnding"),Y}function Y(G){return X.parser.lazy[X.now().line]?$(G):J(G)}}var MZ={name:"codeIndented",tokenize:bx},yx={partial:!0,tokenize:xx};function bx(Z,J,$){let X=this;return Q;function Q(W){return Z.enter("codeIndented"),R0(Z,Y,"linePrefix",5)(W)}function Y(W){let K=X.events[X.events.length-1];return K&&K[1].type==="linePrefix"&&K[2].sliceSerialize(K[1],!0).length>=4?G(W):$(W)}function G(W){if(W===null)return z(W);if(j0(W))return Z.attempt(yx,G,z)(W);return Z.enter("codeFlowValue"),H(W)}function H(W){if(W===null||j0(W))return Z.exit("codeFlowValue"),G(W);return Z.consume(W),H}function z(W){return Z.exit("codeIndented"),J(W)}}function xx(Z,J,$){let X=this;return Q;function Q(G){if(X.parser.lazy[X.now().line])return $(G);if(j0(G))return Z.enter("lineEnding"),Z.consume(G),Z.exit("lineEnding"),Q;return R0(Z,Y,"linePrefix",5)(G)}function Y(G){let H=X.events[X.events.length-1];return H&&H[1].type==="linePrefix"&&H[2].sliceSerialize(H[1],!0).length>=4?J(G):j0(G)?Q(G):$(G)}}var Rz={name:"codeText",previous:vx,resolve:hx,tokenize:gx};function hx(Z){let J=Z.length-4,$=3,X,Q;if((Z[$][1].type==="lineEnding"||Z[$][1].type==="space")&&(Z[J][1].type==="lineEnding"||Z[J][1].type==="space")){X=$;while(++X<J)if(Z[X][1].type==="codeTextData"){Z[$][1].type="codeTextPadding",Z[J][1].type="codeTextPadding",$+=2,J-=2;break}}X=$-1,J++;while(++X<=J)if(Q===void 0){if(X!==J&&Z[X][1].type!=="lineEnding")Q=X}else if(X===J||Z[X][1].type==="lineEnding"){if(Z[Q][1].type="codeTextData",X!==Q+2)Z[Q][1].end=Z[X-1][1].end,Z.splice(Q+2,X-Q-2),J-=X-Q-2,X=Q+2;Q=void 0}return Z}function vx(Z){return Z!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gx(Z,J,$){let X=this,Q=0,Y,G;return H;function H(V){return Z.enter("codeText"),Z.enter("codeTextSequence"),z(V)}function z(V){if(V===96)return Z.consume(V),Q++,z;return Z.exit("codeTextSequence"),W(V)}function W(V){if(V===null)return $(V);if(V===32)return Z.enter("space"),Z.consume(V),Z.exit("space"),W;if(V===96)return G=Z.enter("codeTextSequence"),Y=0,q(V);if(j0(V))return Z.enter("lineEnding"),Z.consume(V),Z.exit("lineEnding"),W;return Z.enter("codeTextData"),K(V)}function K(V){if(V===null||V===32||V===96||j0(V))return Z.exit("codeTextData"),W(V);return Z.consume(V),K}function q(V){if(V===96)return Z.consume(V),Y++,q;if(Y===Q)return Z.exit("codeTextSequence"),Z.exit("codeText"),J(V);return G.type="codeTextData",K(V)}}class yz{constructor(Z){this.left=Z?[...Z]:[],this.right=[]}get(Z){if(Z<0||Z>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+Z+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(Z<this.left.length)return this.left[Z];return this.right[this.right.length-Z+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(Z,J){let $=J===null||J===void 0?Number.POSITIVE_INFINITY:J;if($<this.left.length)return this.left.slice(Z,$);if(Z>this.left.length)return this.right.slice(this.right.length-$+this.left.length,this.right.length-Z+this.left.length).reverse();return this.left.slice(Z).concat(this.right.slice(this.right.length-$+this.left.length).reverse())}splice(Z,J,$){let X=J||0;this.setCursor(Math.trunc(Z));let Q=this.right.splice(this.right.length-X,Number.POSITIVE_INFINITY);if($)DZ(this.left,$);return Q.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(Z){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(Z)}pushMany(Z){this.setCursor(Number.POSITIVE_INFINITY),DZ(this.left,Z)}unshift(Z){this.setCursor(0),this.right.push(Z)}unshiftMany(Z){this.setCursor(0),DZ(this.right,Z.reverse())}setCursor(Z){if(Z===this.left.length||Z>this.left.length&&this.right.length===0||Z<0&&this.left.length===0)return;if(Z<this.left.length){let J=this.left.splice(Z,Number.POSITIVE_INFINITY);DZ(this.right,J.reverse())}else{let J=this.right.splice(this.left.length+this.right.length-Z,Number.POSITIVE_INFINITY);DZ(this.left,J.reverse())}}}function DZ(Z,J){let $=0;if(J.length<1e4)Z.push(...J);else while($<J.length)Z.push(...J.slice($,$+1e4)),$+=1e4}function PQ(Z){let J={},$=-1,X,Q,Y,G,H,z,W,K=new yz(Z);while(++$<K.length){while($ in J)$=J[$];if(X=K.get($),$&&X[1].type==="chunkFlow"&&K.get($-1)[1].type==="listItemPrefix"){if(z=X[1]._tokenizer.events,Y=0,Y<z.length&&z[Y][1].type==="lineEndingBlank")Y+=2;if(Y<z.length&&z[Y][1].type==="content")while(++Y<z.length){if(z[Y][1].type==="content")break;if(z[Y][1].type==="chunkText")z[Y][1]._isInFirstContentOfListItem=!0,Y++}}if(X[0]==="enter"){if(X[1].contentType)Object.assign(J,mx(K,$)),$=J[$],W=!0}else if(X[1]._container){Y=$,Q=void 0;while(Y--)if(G=K.get(Y),G[1].type==="lineEnding"||G[1].type==="lineEndingBlank"){if(G[0]==="enter"){if(Q)K.get(Q)[1].type="lineEndingBlank";G[1].type="lineEnding",Q=Y}}else if(G[1].type==="linePrefix"||G[1].type==="listItemIndent");else break;if(Q)X[1].end={...K.get(Q)[1].start},H=K.slice(Q,$),H.unshift(X),K.splice(Q,$-Q+1,H)}}return W5(Z,0,Number.POSITIVE_INFINITY,K.slice(0)),!W}function mx(Z,J){let $=Z.get(J)[1],X=Z.get(J)[2],Q=J-1,Y=[],G=$._tokenizer;if(!G){if(G=X.parser[$.contentType]($.start),$._contentTypeTextTrailing)G._contentTypeTextTrailing=!0}let H=G.events,z=[],W={},K,q,V=-1,U=$,B=0,F=0,N=[F];while(U){while(Z.get(++Q)[1]!==U);if(Y.push(Q),!U._tokenizer){if(K=X.sliceStream(U),!U.next)K.push(null);if(q)G.defineSkip(U.start);if(U._isInFirstContentOfListItem)G._gfmTasklistFirstContentOfListItem=!0;if(G.write(K),U._isInFirstContentOfListItem)G._gfmTasklistFirstContentOfListItem=void 0}q=U,U=U.next}U=$;while(++V<H.length)if(H[V][0]==="exit"&&H[V-1][0]==="enter"&&H[V][1].type===H[V-1][1].type&&H[V][1].start.line!==H[V][1].end.line)F=V+1,N.push(F),U._tokenizer=void 0,U.previous=void 0,U=U.next;if(G.events=[],U)U._tokenizer=void 0,U.previous=void 0;else N.pop();V=N.length;while(V--){let L=H.slice(N[V],N[V+1]),_=Y.pop();z.push([_,_+L.length-1]),Z.splice(_,2,L)}z.reverse(),V=-1;while(++V<z.length)W[B+z[V][0]]=B+z[V][1],B+=z[V][1]-z[V][0]-1;return W}var bz={resolve:px,tokenize:ux},fx={partial:!0,tokenize:cx};function px(Z){return PQ(Z),Z}function ux(Z,J){let $;return X;function X(H){return Z.enter("content"),$=Z.enter("chunkContent",{contentType:"content"}),Q(H)}function Q(H){if(H===null)return Y(H);if(j0(H))return Z.check(fx,G,Y)(H);return Z.consume(H),Q}function Y(H){return Z.exit("chunkContent"),Z.exit("content"),J(H)}function G(H){return Z.consume(H),Z.exit("chunkContent"),$.next=Z.enter("chunkContent",{contentType:"content",previous:$}),$=$.next,Q}}function cx(Z,J,$){let X=this;return Q;function Q(G){return Z.exit("chunkContent"),Z.enter("lineEnding"),Z.consume(G),Z.exit("lineEnding"),R0(Z,Y,"linePrefix")}function Y(G){if(G===null||j0(G))return $(G);let H=X.events[X.events.length-1];if(!X.parser.constructs.disable.null.includes("codeIndented")&&H&&H[1].type==="linePrefix"&&H[2].sliceSerialize(H[1],!0).length>=4)return J(G);return Z.interrupt(X.parser.constructs.flow,$,J)(G)}}function jQ(Z,J,$,X,Q,Y,G,H,z){let W=z||Number.POSITIVE_INFINITY,K=0;return q;function q(L){if(L===60)return Z.enter(X),Z.enter(Q),Z.enter(Y),Z.consume(L),Z.exit(Y),V;if(L===null||L===32||L===41||s4(L))return $(L);return Z.enter(X),Z.enter(G),Z.enter(H),Z.enter("chunkString",{contentType:"string"}),F(L)}function V(L){if(L===62)return Z.enter(Y),Z.consume(L),Z.exit(Y),Z.exit(Q),Z.exit(X),J;return Z.enter(H),Z.enter("chunkString",{contentType:"string"}),U(L)}function U(L){if(L===62)return Z.exit("chunkString"),Z.exit(H),V(L);if(L===null||L===60||j0(L))return $(L);return Z.consume(L),L===92?B:U}function B(L){if(L===60||L===62||L===92)return Z.consume(L),U;return U(L)}function F(L){if(!K&&(L===null||L===41||J1(L)))return Z.exit("chunkString"),Z.exit(H),Z.exit(G),Z.exit(X),J(L);if(K<W&&L===40)return Z.consume(L),K++,F;if(L===41)return Z.consume(L),K--,F;if(L===null||L===32||L===40||s4(L))return $(L);return Z.consume(L),L===92?N:F}function N(L){if(L===40||L===41||L===92)return Z.consume(L),F;return F(L)}}function TQ(Z,J,$,X,Q,Y){let G=this,H=0,z;return W;function W(U){return Z.enter(X),Z.enter(Q),Z.consume(U),Z.exit(Q),Z.enter(Y),K}function K(U){if(H>999||U===null||U===91||U===93&&!z||U===94&&!H&&"_hiddenFootnoteSupport"in G.parser.constructs)return $(U);if(U===93)return Z.exit(Y),Z.enter(Q),Z.consume(U),Z.exit(Q),Z.exit(X),J;if(j0(U))return Z.enter("lineEnding"),Z.consume(U),Z.exit("lineEnding"),K;return Z.enter("chunkString",{contentType:"string"}),q(U)}function q(U){if(U===null||U===91||U===93||j0(U)||H++>999)return Z.exit("chunkString"),K(U);if(Z.consume(U),!z)z=!b0(U);return U===92?V:q}function V(U){if(U===91||U===92||U===93)return Z.consume(U),H++,q;return q(U)}}function CQ(Z,J,$,X,Q,Y){let G;return H;function H(V){if(V===34||V===39||V===40)return Z.enter(X),Z.enter(Q),Z.consume(V),Z.exit(Q),G=V===40?41:V,z;return $(V)}function z(V){if(V===G)return Z.enter(Q),Z.consume(V),Z.exit(Q),Z.exit(X),J;return Z.enter(Y),W(V)}function W(V){if(V===G)return Z.exit(Y),z(G);if(V===null)return $(V);if(j0(V))return Z.enter("lineEnding"),Z.consume(V),Z.exit("lineEnding"),R0(Z,W,"linePrefix");return Z.enter("chunkString",{contentType:"string"}),K(V)}function K(V){if(V===G||V===null||j0(V))return Z.exit("chunkString"),W(V);return Z.consume(V),V===92?q:K}function q(V){if(V===G||V===92)return Z.consume(V),K;return K(V)}}function o4(Z,J){let $;return X;function X(Q){if(j0(Q))return Z.enter("lineEnding"),Z.consume(Q),Z.exit("lineEnding"),$=!0,X;if(b0(Q))return R0(Z,X,$?"linePrefix":"lineSuffix")(Q);return J(Q)}}var xz={name:"definition",tokenize:lx},dx={partial:!0,tokenize:ix};function lx(Z,J,$){let X=this,Q;return Y;function Y(U){return Z.enter("definition"),G(U)}function G(U){return TQ.call(X,Z,H,$,"definitionLabel","definitionLabelMarker","definitionLabelString")(U)}function H(U){if(Q=o5(X.sliceSerialize(X.events[X.events.length-1][1]).slice(1,-1)),U===58)return Z.enter("definitionMarker"),Z.consume(U),Z.exit("definitionMarker"),z;return $(U)}function z(U){return J1(U)?o4(Z,W)(U):W(U)}function W(U){return jQ(Z,K,$,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(U)}function K(U){return Z.attempt(dx,q,q)(U)}function q(U){return b0(U)?R0(Z,V,"whitespace")(U):V(U)}function V(U){if(U===null||j0(U))return Z.exit("definition"),X.parser.defined.push(Q),J(U);return $(U)}}function ix(Z,J,$){return X;function X(H){return J1(H)?o4(Z,Q)(H):$(H)}function Q(H){return CQ(Z,Y,$,"definitionTitle","definitionTitleMarker","definitionTitleString")(H)}function Y(H){return b0(H)?R0(Z,G,"whitespace")(H):G(H)}function G(H){return H===null||j0(H)?J(H):$(H)}}var hz={name:"hardBreakEscape",tokenize:rx};function rx(Z,J,$){return X;function X(Y){return Z.enter("hardBreakEscape"),Z.consume(Y),Q}function Q(Y){if(j0(Y))return Z.exit("hardBreakEscape"),J(Y);return $(Y)}}var vz={name:"headingAtx",resolve:ax,tokenize:sx};function ax(Z,J){let $=Z.length-2,X=3,Q,Y;if(Z[X][1].type==="whitespace")X+=2;if($-2>X&&Z[$][1].type==="whitespace")$-=2;if(Z[$][1].type==="atxHeadingSequence"&&(X===$-1||$-4>X&&Z[$-2][1].type==="whitespace"))$-=X+1===$?2:4;if($>X)Q={type:"atxHeadingText",start:Z[X][1].start,end:Z[$][1].end},Y={type:"chunkText",start:Z[X][1].start,end:Z[$][1].end,contentType:"text"},W5(Z,X,$-X+1,[["enter",Q,J],["enter",Y,J],["exit",Y,J],["exit",Q,J]]);return Z}function sx(Z,J,$){let X=0;return Q;function Q(K){return Z.enter("atxHeading"),Y(K)}function Y(K){return Z.enter("atxHeadingSequence"),G(K)}function G(K){if(K===35&&X++<6)return Z.consume(K),G;if(K===null||J1(K))return Z.exit("atxHeadingSequence"),H(K);return $(K)}function H(K){if(K===35)return Z.enter("atxHeadingSequence"),z(K);if(K===null||j0(K))return Z.exit("atxHeading"),J(K);if(b0(K))return R0(Z,H,"whitespace")(K);return Z.enter("atxHeadingText"),W(K)}function z(K){if(K===35)return Z.consume(K),z;return Z.exit("atxHeadingSequence"),H(K)}function W(K){if(K===null||K===35||J1(K))return Z.exit("atxHeadingText"),H(K);return Z.consume(K),W}}var hA=["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"],gz=["pre","script","style","textarea"];var mz={concrete:!0,name:"htmlFlow",resolveTo:tx,tokenize:ex},nx={partial:!0,tokenize:Jh},ox={partial:!0,tokenize:Zh};function tx(Z){let J=Z.length;while(J--)if(Z[J][0]==="enter"&&Z[J][1].type==="htmlFlow")break;if(J>1&&Z[J-2][1].type==="linePrefix")Z[J][1].start=Z[J-2][1].start,Z[J+1][1].start=Z[J-2][1].start,Z.splice(J-2,2);return Z}function ex(Z,J,$){let X=this,Q,Y,G,H,z;return W;function W(E){return K(E)}function K(E){return Z.enter("htmlFlow"),Z.enter("htmlFlowData"),Z.consume(E),q}function q(E){if(E===33)return Z.consume(E),V;if(E===47)return Z.consume(E),Y=!0,F;if(E===63)return Z.consume(E),Q=3,X.interrupt?J:w;if(w5(E))return Z.consume(E),G=String.fromCharCode(E),N;return $(E)}function V(E){if(E===45)return Z.consume(E),Q=2,U;if(E===91)return Z.consume(E),Q=5,H=0,B;if(w5(E))return Z.consume(E),Q=4,X.interrupt?J:w;return $(E)}function U(E){if(E===45)return Z.consume(E),X.interrupt?J:w;return $(E)}function B(E){if(E==="CDATA[".charCodeAt(H++)){if(Z.consume(E),H===6)return X.interrupt?J:C;return B}return $(E)}function F(E){if(w5(E))return Z.consume(E),G=String.fromCharCode(E),N;return $(E)}function N(E){if(E===null||E===47||E===62||J1(E)){let s=E===47,A0=G.toLowerCase();if(!s&&!Y&&gz.includes(A0))return Q=1,X.interrupt?J(E):C(E);if(hA.includes(G.toLowerCase())){if(Q=6,s)return Z.consume(E),L;return X.interrupt?J(E):C(E)}return Q=7,X.interrupt&&!X.parser.lazy[X.now().line]?$(E):Y?_(E):M(E)}if(E===45||Y5(E))return Z.consume(E),G+=String.fromCharCode(E),N;return $(E)}function L(E){if(E===62)return Z.consume(E),X.interrupt?J:C;return $(E)}function _(E){if(b0(E))return Z.consume(E),_;return P(E)}function M(E){if(E===47)return Z.consume(E),P;if(E===58||E===95||w5(E))return Z.consume(E),O;if(b0(E))return Z.consume(E),M;return P(E)}function O(E){if(E===45||E===46||E===58||E===95||Y5(E))return Z.consume(E),O;return D(E)}function D(E){if(E===61)return Z.consume(E),A;if(b0(E))return Z.consume(E),D;return M(E)}function A(E){if(E===null||E===60||E===61||E===62||E===96)return $(E);if(E===34||E===39)return Z.consume(E),z=E,T;if(b0(E))return Z.consume(E),A;return S(E)}function T(E){if(E===z)return Z.consume(E),z=null,k;if(E===null||j0(E))return $(E);return Z.consume(E),T}function S(E){if(E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||J1(E))return D(E);return Z.consume(E),S}function k(E){if(E===47||E===62||b0(E))return M(E);return $(E)}function P(E){if(E===62)return Z.consume(E),g;return $(E)}function g(E){if(E===null||j0(E))return C(E);if(b0(E))return Z.consume(E),g;return $(E)}function C(E){if(E===45&&Q===2)return Z.consume(E),R;if(E===60&&Q===1)return Z.consume(E),x;if(E===62&&Q===4)return Z.consume(E),z0;if(E===63&&Q===3)return Z.consume(E),w;if(E===93&&Q===5)return Z.consume(E),d;if(j0(E)&&(Q===6||Q===7))return Z.exit("htmlFlowData"),Z.check(nx,G0,I)(E);if(E===null||j0(E))return Z.exit("htmlFlowData"),I(E);return Z.consume(E),C}function I(E){return Z.check(ox,y,G0)(E)}function y(E){return Z.enter("lineEnding"),Z.consume(E),Z.exit("lineEnding"),b}function b(E){if(E===null||j0(E))return I(E);return Z.enter("htmlFlowData"),C(E)}function R(E){if(E===45)return Z.consume(E),w;return C(E)}function x(E){if(E===47)return Z.consume(E),G="",v;return C(E)}function v(E){if(E===62){let s=G.toLowerCase();if(gz.includes(s))return Z.consume(E),z0;return C(E)}if(w5(E)&&G.length<8)return Z.consume(E),G+=String.fromCharCode(E),v;return C(E)}function d(E){if(E===93)return Z.consume(E),w;return C(E)}function w(E){if(E===62)return Z.consume(E),z0;if(E===45&&Q===2)return Z.consume(E),w;return C(E)}function z0(E){if(E===null||j0(E))return Z.exit("htmlFlowData"),G0(E);return Z.consume(E),z0}function G0(E){return Z.exit("htmlFlow"),J(E)}}function Zh(Z,J,$){let X=this;return Q;function Q(G){if(j0(G))return Z.enter("lineEnding"),Z.consume(G),Z.exit("lineEnding"),Y;return $(G)}function Y(G){return X.parser.lazy[X.now().line]?$(G):J(G)}}function Jh(Z,J,$){return X;function X(Q){return Z.enter("lineEnding"),Z.consume(Q),Z.exit("lineEnding"),Z.attempt(r9,J,$)}}var fz={name:"htmlText",tokenize:$h};function $h(Z,J,$){let X=this,Q,Y,G;return H;function H(w){return Z.enter("htmlText"),Z.enter("htmlTextData"),Z.consume(w),z}function z(w){if(w===33)return Z.consume(w),W;if(w===47)return Z.consume(w),D;if(w===63)return Z.consume(w),M;if(w5(w))return Z.consume(w),S;return $(w)}function W(w){if(w===45)return Z.consume(w),K;if(w===91)return Z.consume(w),Y=0,B;if(w5(w))return Z.consume(w),_;return $(w)}function K(w){if(w===45)return Z.consume(w),U;return $(w)}function q(w){if(w===null)return $(w);if(w===45)return Z.consume(w),V;if(j0(w))return G=q,x(w);return Z.consume(w),q}function V(w){if(w===45)return Z.consume(w),U;return q(w)}function U(w){return w===62?R(w):w===45?V(w):q(w)}function B(w){if(w==="CDATA[".charCodeAt(Y++))return Z.consume(w),Y===6?F:B;return $(w)}function F(w){if(w===null)return $(w);if(w===93)return Z.consume(w),N;if(j0(w))return G=F,x(w);return Z.consume(w),F}function N(w){if(w===93)return Z.consume(w),L;return F(w)}function L(w){if(w===62)return R(w);if(w===93)return Z.consume(w),L;return F(w)}function _(w){if(w===null||w===62)return R(w);if(j0(w))return G=_,x(w);return Z.consume(w),_}function M(w){if(w===null)return $(w);if(w===63)return Z.consume(w),O;if(j0(w))return G=M,x(w);return Z.consume(w),M}function O(w){return w===62?R(w):M(w)}function D(w){if(w5(w))return Z.consume(w),A;return $(w)}function A(w){if(w===45||Y5(w))return Z.consume(w),A;return T(w)}function T(w){if(j0(w))return G=T,x(w);if(b0(w))return Z.consume(w),T;return R(w)}function S(w){if(w===45||Y5(w))return Z.consume(w),S;if(w===47||w===62||J1(w))return k(w);return $(w)}function k(w){if(w===47)return Z.consume(w),R;if(w===58||w===95||w5(w))return Z.consume(w),P;if(j0(w))return G=k,x(w);if(b0(w))return Z.consume(w),k;return R(w)}function P(w){if(w===45||w===46||w===58||w===95||Y5(w))return Z.consume(w),P;return g(w)}function g(w){if(w===61)return Z.consume(w),C;if(j0(w))return G=g,x(w);if(b0(w))return Z.consume(w),g;return k(w)}function C(w){if(w===null||w===60||w===61||w===62||w===96)return $(w);if(w===34||w===39)return Z.consume(w),Q=w,I;if(j0(w))return G=C,x(w);if(b0(w))return Z.consume(w),C;return Z.consume(w),y}function I(w){if(w===Q)return Z.consume(w),Q=void 0,b;if(w===null)return $(w);if(j0(w))return G=I,x(w);return Z.consume(w),I}function y(w){if(w===null||w===34||w===39||w===60||w===61||w===96)return $(w);if(w===47||w===62||J1(w))return k(w);return Z.consume(w),y}function b(w){if(w===47||w===62||J1(w))return k(w);return $(w)}function R(w){if(w===62)return Z.consume(w),Z.exit("htmlTextData"),Z.exit("htmlText"),J;return $(w)}function x(w){return Z.exit("htmlTextData"),Z.enter("lineEnding"),Z.consume(w),Z.exit("lineEnding"),v}function v(w){return b0(w)?R0(Z,d,"linePrefix",X.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):d(w)}function d(w){return Z.enter("htmlTextData"),G(w)}}var t4={name:"labelEnd",resolveAll:Gh,resolveTo:Hh,tokenize:zh},Xh={tokenize:Wh},Qh={tokenize:Kh},Yh={tokenize:qh};function Gh(Z){let J=-1,$=[];while(++J<Z.length){let X=Z[J][1];if($.push(Z[J]),X.type==="labelImage"||X.type==="labelLink"||X.type==="labelEnd"){let Q=X.type==="labelImage"?4:2;X.type="data",J+=Q}}if(Z.length!==$.length)W5(Z,0,Z.length,$);return Z}function Hh(Z,J){let $=Z.length,X=0,Q,Y,G,H;while($--)if(Q=Z[$][1],Y){if(Q.type==="link"||Q.type==="labelLink"&&Q._inactive)break;if(Z[$][0]==="enter"&&Q.type==="labelLink")Q._inactive=!0}else if(G){if(Z[$][0]==="enter"&&(Q.type==="labelImage"||Q.type==="labelLink")&&!Q._balanced){if(Y=$,Q.type!=="labelLink"){X=2;break}}}else if(Q.type==="labelEnd")G=$;let z={type:Z[Y][1].type==="labelLink"?"link":"image",start:{...Z[Y][1].start},end:{...Z[Z.length-1][1].end}},W={type:"label",start:{...Z[Y][1].start},end:{...Z[G][1].end}},K={type:"labelText",start:{...Z[Y+X+2][1].end},end:{...Z[G-2][1].start}};return H=[["enter",z,J],["enter",W,J]],H=H7(H,Z.slice(Y+1,Y+X+3)),H=H7(H,[["enter",K,J]]),H=H7(H,s2(J.parser.constructs.insideSpan.null,Z.slice(Y+X+4,G-3),J)),H=H7(H,[["exit",K,J],Z[G-2],Z[G-1],["exit",W,J]]),H=H7(H,Z.slice(G+1)),H=H7(H,[["exit",z,J]]),W5(Z,Y,Z.length,H),Z}function zh(Z,J,$){let X=this,Q=X.events.length,Y,G;while(Q--)if((X.events[Q][1].type==="labelImage"||X.events[Q][1].type==="labelLink")&&!X.events[Q][1]._balanced){Y=X.events[Q][1];break}return H;function H(V){if(!Y)return $(V);if(Y._inactive)return q(V);return G=X.parser.defined.includes(o5(X.sliceSerialize({start:Y.end,end:X.now()}))),Z.enter("labelEnd"),Z.enter("labelMarker"),Z.consume(V),Z.exit("labelMarker"),Z.exit("labelEnd"),z}function z(V){if(V===40)return Z.attempt(Xh,K,G?K:q)(V);if(V===91)return Z.attempt(Qh,K,G?W:q)(V);return G?K(V):q(V)}function W(V){return Z.attempt(Yh,K,q)(V)}function K(V){return J(V)}function q(V){return Y._balanced=!0,$(V)}}function Wh(Z,J,$){return X;function X(q){return Z.enter("resource"),Z.enter("resourceMarker"),Z.consume(q),Z.exit("resourceMarker"),Q}function Q(q){return J1(q)?o4(Z,Y)(q):Y(q)}function Y(q){if(q===41)return K(q);return jQ(Z,G,H,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(q)}function G(q){return J1(q)?o4(Z,z)(q):K(q)}function H(q){return $(q)}function z(q){if(q===34||q===39||q===40)return CQ(Z,W,$,"resourceTitle","resourceTitleMarker","resourceTitleString")(q);return K(q)}function W(q){return J1(q)?o4(Z,K)(q):K(q)}function K(q){if(q===41)return Z.enter("resourceMarker"),Z.consume(q),Z.exit("resourceMarker"),Z.exit("resource"),J;return $(q)}}function Kh(Z,J,$){let X=this;return Q;function Q(H){return TQ.call(X,Z,Y,G,"reference","referenceMarker","referenceString")(H)}function Y(H){return X.parser.defined.includes(o5(X.sliceSerialize(X.events[X.events.length-1][1]).slice(1,-1)))?J(H):$(H)}function G(H){return $(H)}}function qh(Z,J,$){return X;function X(Y){return Z.enter("reference"),Z.enter("referenceMarker"),Z.consume(Y),Z.exit("referenceMarker"),Q}function Q(Y){if(Y===93)return Z.enter("referenceMarker"),Z.consume(Y),Z.exit("referenceMarker"),Z.exit("reference"),J;return $(Y)}}var pz={name:"labelStartImage",resolveAll:t4.resolveAll,tokenize:Vh};function Vh(Z,J,$){let X=this;return Q;function Q(H){return Z.enter("labelImage"),Z.enter("labelImageMarker"),Z.consume(H),Z.exit("labelImageMarker"),Y}function Y(H){if(H===91)return Z.enter("labelMarker"),Z.consume(H),Z.exit("labelMarker"),Z.exit("labelImage"),G;return $(H)}function G(H){return H===94&&"_hiddenFootnoteSupport"in X.parser.constructs?$(H):J(H)}}var uz={name:"labelStartLink",resolveAll:t4.resolveAll,tokenize:Uh};function Uh(Z,J,$){let X=this;return Q;function Q(G){return Z.enter("labelLink"),Z.enter("labelMarker"),Z.consume(G),Z.exit("labelMarker"),Z.exit("labelLink"),Y}function Y(G){return G===94&&"_hiddenFootnoteSupport"in X.parser.constructs?$(G):J(G)}}var OZ={name:"lineEnding",tokenize:Bh};function Bh(Z,J){return $;function $(X){return Z.enter("lineEnding"),Z.consume(X),Z.exit("lineEnding"),R0(Z,J,"linePrefix")}}var e4={name:"thematicBreak",tokenize:Fh};function Fh(Z,J,$){let X=0,Q;return Y;function Y(W){return Z.enter("thematicBreak"),G(W)}function G(W){return Q=W,H(W)}function H(W){if(W===Q)return Z.enter("thematicBreakSequence"),z(W);if(X>=3&&(W===null||j0(W)))return Z.exit("thematicBreak"),J(W);return $(W)}function z(W){if(W===Q)return Z.consume(W),X++,z;return Z.exit("thematicBreakSequence"),b0(W)?R0(Z,H,"whitespace")(W):H(W)}}var t5={continuation:{tokenize:Ah},exit:Dh,name:"list",tokenize:_h},Lh={partial:!0,tokenize:Oh},Nh={partial:!0,tokenize:Mh};function _h(Z,J,$){let X=this,Q=X.events[X.events.length-1],Y=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[1],!0).length:0,G=0;return H;function H(U){let B=X.containerState.type||(U===42||U===43||U===45?"listUnordered":"listOrdered");if(B==="listUnordered"?!X.containerState.marker||U===X.containerState.marker:_Z(U)){if(!X.containerState.type)X.containerState.type=B,Z.enter(B,{_container:!0});if(B==="listUnordered")return Z.enter("listItemPrefix"),U===42||U===45?Z.check(e4,$,W)(U):W(U);if(!X.interrupt||U===49)return Z.enter("listItemPrefix"),Z.enter("listItemValue"),z(U)}return $(U)}function z(U){if(_Z(U)&&++G<10)return Z.consume(U),z;if((!X.interrupt||G<2)&&(X.containerState.marker?U===X.containerState.marker:U===41||U===46))return Z.exit("listItemValue"),W(U);return $(U)}function W(U){return Z.enter("listItemMarker"),Z.consume(U),Z.exit("listItemMarker"),X.containerState.marker=X.containerState.marker||U,Z.check(r9,X.interrupt?$:K,Z.attempt(Lh,V,q))}function K(U){return X.containerState.initialBlankLine=!0,Y++,V(U)}function q(U){if(b0(U))return Z.enter("listItemPrefixWhitespace"),Z.consume(U),Z.exit("listItemPrefixWhitespace"),V;return $(U)}function V(U){return X.containerState.size=Y+X.sliceSerialize(Z.exit("listItemPrefix"),!0).length,J(U)}}function Ah(Z,J,$){let X=this;return X.containerState._closeFlow=void 0,Z.check(r9,Q,Y);function Q(H){return X.containerState.furtherBlankLines=X.containerState.furtherBlankLines||X.containerState.initialBlankLine,R0(Z,J,"listItemIndent",X.containerState.size+1)(H)}function Y(H){if(X.containerState.furtherBlankLines||!b0(H))return X.containerState.furtherBlankLines=void 0,X.containerState.initialBlankLine=void 0,G(H);return X.containerState.furtherBlankLines=void 0,X.containerState.initialBlankLine=void 0,Z.attempt(Nh,J,G)(H)}function G(H){return X.containerState._closeFlow=!0,X.interrupt=void 0,R0(Z,Z.attempt(t5,J,$),"linePrefix",X.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H)}}function Mh(Z,J,$){let X=this;return R0(Z,Q,"listItemIndent",X.containerState.size+1);function Q(Y){let G=X.events[X.events.length-1];return G&&G[1].type==="listItemIndent"&&G[2].sliceSerialize(G[1],!0).length===X.containerState.size?J(Y):$(Y)}}function Dh(Z){Z.exit(this.containerState.type)}function Oh(Z,J,$){let X=this;return R0(Z,Q,"listItemPrefixWhitespace",X.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function Q(Y){let G=X.events[X.events.length-1];return!b0(Y)&&G&&G[1].type==="listItemPrefixWhitespace"?J(Y):$(Y)}}var SQ={name:"setextUnderline",resolveTo:wh,tokenize:Ph};function wh(Z,J){let $=Z.length,X,Q,Y;while($--)if(Z[$][0]==="enter"){if(Z[$][1].type==="content"){X=$;break}if(Z[$][1].type==="paragraph")Q=$}else{if(Z[$][1].type==="content")Z.splice($,1);if(!Y&&Z[$][1].type==="definition")Y=$}let G={type:"setextHeading",start:{...Z[X][1].start},end:{...Z[Z.length-1][1].end}};if(Z[Q][1].type="setextHeadingText",Y)Z.splice(Q,0,["enter",G,J]),Z.splice(Y+1,0,["exit",Z[X][1],J]),Z[X][1].end={...Z[Y][1].end};else Z[X][1]=G;return Z.push(["exit",G,J]),Z}function Ph(Z,J,$){let X=this,Q;return Y;function Y(W){let K=X.events.length,q;while(K--)if(X.events[K][1].type!=="lineEnding"&&X.events[K][1].type!=="linePrefix"&&X.events[K][1].type!=="content"){q=X.events[K][1].type==="paragraph";break}if(!X.parser.lazy[X.now().line]&&(X.interrupt||q))return Z.enter("setextHeadingLine"),Q=W,G(W);return $(W)}function G(W){return Z.enter("setextHeadingLineSequence"),H(W)}function H(W){if(W===Q)return Z.consume(W),H;return Z.exit("setextHeadingLineSequence"),b0(W)?R0(Z,z,"lineSuffix")(W):z(W)}function z(W){if(W===null||j0(W))return Z.exit("setextHeadingLine"),J(W);return $(W)}}var vA={tokenize:jh};function jh(Z){let J=this,$=Z.attempt(r9,X,Z.attempt(this.parser.constructs.flowInitial,Q,R0(Z,Z.attempt(this.parser.constructs.flow,Q,Z.attempt(bz,Q)),"linePrefix")));return $;function X(Y){if(Y===null){Z.consume(Y);return}return Z.enter("lineEndingBlank"),Z.consume(Y),Z.exit("lineEndingBlank"),J.currentConstruct=void 0,$}function Q(Y){if(Y===null){Z.consume(Y);return}return Z.enter("lineEnding"),Z.consume(Y),Z.exit("lineEnding"),J.currentConstruct=void 0,$}}var gA={resolveAll:uA()},mA=pA("string"),fA=pA("text");function pA(Z){return{resolveAll:uA(Z==="text"?Th:void 0),tokenize:J};function J($){let X=this,Q=this.parser.constructs[Z],Y=$.attempt(Q,G,H);return G;function G(K){return W(K)?Y(K):H(K)}function H(K){if(K===null){$.consume(K);return}return $.enter("data"),$.consume(K),z}function z(K){if(W(K))return $.exit("data"),Y(K);return $.consume(K),z}function W(K){if(K===null)return!0;let q=Q[K],V=-1;if(q)while(++V<q.length){let U=q[V];if(!U.previous||U.previous.call(X,X.previous))return!0}return!1}}}function uA(Z){return J;function J($,X){let Q=-1,Y;while(++Q<=$.length)if(Y===void 0){if($[Q]&&$[Q][1].type==="data")Y=Q,Q++}else if(!$[Q]||$[Q][1].type!=="data"){if(Q!==Y+2)$[Y][1].end=$[Q-1][1].end,$.splice(Y+2,Q-Y-2),Q=Y+2;Y=void 0}return Z?Z($,X):$}}function Th(Z,J){let $=0;while(++$<=Z.length)if(($===Z.length||Z[$][1].type==="lineEnding")&&Z[$-1][1].type==="data"){let X=Z[$-1][1],Q=J.sliceStream(X),Y=Q.length,G=-1,H=0,z;while(Y--){let W=Q[Y];if(typeof W==="string"){G=W.length;while(W.charCodeAt(G-1)===32)H++,G--;if(G)break;G=-1}else if(W===-2)z=!0,H++;else if(W===-1);else{Y++;break}}if(J._contentTypeTextTrailing&&$===Z.length)H=0;if(H){let W={type:$===Z.length||z||H<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:Y?G:X.start._bufferIndex+G,_index:X.start._index+Y,line:X.end.line,column:X.end.column-H,offset:X.end.offset-H},end:{...X.end}};if(X.end={...W.start},X.start.offset===X.end.offset)Object.assign(X,W);else Z.splice($,0,["enter",W,J],["exit",W,J]),$+=2}$++}return Z}var cz={};t7(cz,{text:()=>Rh,string:()=>kh,insideSpan:()=>yh,flowInitial:()=>Ih,flow:()=>Eh,document:()=>Ch,disable:()=>xh,contentInitial:()=>Sh,attentionMarkers:()=>bh});var Ch={[42]:t5,[43]:t5,[45]:t5,[48]:t5,[49]:t5,[50]:t5,[51]:t5,[52]:t5,[53]:t5,[54]:t5,[55]:t5,[56]:t5,[57]:t5,[62]:MQ},Sh={[91]:xz},Ih={[-2]:MZ,[-1]:MZ,[32]:MZ},Eh={[35]:vz,[42]:e4,[45]:[SQ,e4],[60]:mz,[61]:SQ,[95]:e4,[96]:wQ,[126]:wQ},kh={[38]:OQ,[92]:DQ},Rh={[-5]:OZ,[-4]:OZ,[-3]:OZ,[33]:pz,[38]:OQ,[42]:AZ,[60]:[kz,fz],[91]:uz,[92]:[hz,DQ],[93]:t4,[95]:AZ,[96]:Rz},yh={null:[AZ,gA]},bh={null:[42,95]},xh={null:[]};function cA(Z,J,$){let X={_bufferIndex:-1,_index:0,line:$&&$.line||1,column:$&&$.column||1,offset:$&&$.offset||0},Q={},Y=[],G=[],H=[],z=!0,W={attempt:k(T),check:k(S),consume:O,enter:D,exit:A,interrupt:k(S,{interrupt:!0})},K={code:null,containerState:{},defineSkip:L,events:[],now:N,parser:Z,previous:null,sliceSerialize:B,sliceStream:F,write:U},q=J.tokenize.call(K,W),V;if(J.resolveAll)Y.push(J);return K;function U(I){if(G=H7(G,I),_(),G[G.length-1]!==null)return[];return P(J,0),K.events=s2(Y,K.events,K),K.events}function B(I,y){return vh(F(I),y)}function F(I){return hh(G,I)}function N(){let{_bufferIndex:I,_index:y,line:b,column:R,offset:x}=X;return{_bufferIndex:I,_index:y,line:b,column:R,offset:x}}function L(I){Q[I.line]=I.column,C()}function _(){let I;while(X._index<G.length){let y=G[X._index];if(typeof y==="string"){if(I=X._index,X._bufferIndex<0)X._bufferIndex=0;while(X._index===I&&X._bufferIndex<y.length)M(y.charCodeAt(X._bufferIndex))}else M(y)}}function M(I){z=void 0,V=I,q=q(I)}function O(I){if(j0(I))X.line++,X.column=1,X.offset+=I===-3?2:1,C();else if(I!==-1)X.column++,X.offset++;if(X._bufferIndex<0)X._index++;else if(X._bufferIndex++,X._bufferIndex===G[X._index].length)X._bufferIndex=-1,X._index++;K.previous=I,z=!0}function D(I,y){let b=y||{};return b.type=I,b.start=N(),K.events.push(["enter",b,K]),H.push(b),b}function A(I){let y=H.pop();return y.end=N(),K.events.push(["exit",y,K]),y}function T(I,y){P(I,y.from)}function S(I,y){y.restore()}function k(I,y){return b;function b(R,x,v){let d,w,z0,G0;return Array.isArray(R)?s(R):("tokenize"in R)?s([R]):E(R);function E(q0){return X0;function X0(Q0){let V0=Q0!==null&&q0[Q0],p=Q0!==null&&q0.null,Z0=[...Array.isArray(V0)?V0:V0?[V0]:[],...Array.isArray(p)?p:p?[p]:[]];return s(Z0)(Q0)}}function s(q0){if(d=q0,w=0,q0.length===0)return v;return A0(q0[w])}function A0(q0){return X0;function X0(Q0){if(G0=g(),z0=q0,!q0.partial)K.currentConstruct=q0;if(q0.name&&K.parser.constructs.disable.null.includes(q0.name))return H0(Q0);return q0.tokenize.call(y?Object.assign(Object.create(K),y):K,W,l,H0)(Q0)}}function l(q0){return z=!0,I(z0,G0),x}function H0(q0){if(z=!0,G0.restore(),++w<d.length)return A0(d[w]);return v}}}function P(I,y){if(I.resolveAll&&!Y.includes(I))Y.push(I);if(I.resolve)W5(K.events,y,K.events.length-y,I.resolve(K.events.slice(y),K));if(I.resolveTo)K.events=I.resolveTo(K.events,K)}function g(){let I=N(),y=K.previous,b=K.currentConstruct,R=K.events.length,x=Array.from(H);return{from:R,restore:v};function v(){X=I,K.previous=y,K.currentConstruct=b,K.events.length=R,H=x,C()}}function C(){if(X.line in Q&&X.column<2)X.column=Q[X.line],X.offset+=Q[X.line]-1}}function hh(Z,J){let $=J.start._index,X=J.start._bufferIndex,Q=J.end._index,Y=J.end._bufferIndex,G;if($===Q)G=[Z[$].slice(X,Y)];else{if(G=Z.slice($,Q),X>-1){let H=G[0];if(typeof H==="string")G[0]=H.slice(X);else G.shift()}if(Y>0)G.push(Z[Q].slice(0,Y))}return G}function vh(Z,J){let $=-1,X=[],Q;while(++$<Z.length){let Y=Z[$],G;if(typeof Y==="string")G=Y;else switch(Y){case-5:{G="\r";break}case-4:{G=`
|
|
26
|
-
`;break}case-3:{G=`\r
|
|
27
|
-
`;break}case-2:{G=J?" ":"\t";break}case-1:{if(!J&&Q)continue;G=" ";break}default:G=String.fromCharCode(Y)}Q=Y===-2,X.push(G)}return X.join("")}function dz(Z){let X={constructs:_Q([cz,...(Z||{}).extensions||[]]),content:Q(kA),defined:[],document:Q(yA),flow:Q(vA),lazy:{},string:Q(mA),text:Q(fA)};return X;function Q(Y){return G;function G(H){return cA(X,Y,H)}}}function lz(Z){while(!PQ(Z));return Z}var dA=/[\0\t\n\r]/g;function iz(){let Z=1,J="",$=!0,X;return Q;function Q(Y,G,H){let z=[],W,K,q,V,U;if(Y=J+(typeof Y==="string"?Y.toString():new TextDecoder(G||void 0).decode(Y)),q=0,J="",$){if(Y.charCodeAt(0)===65279)q++;$=void 0}while(q<Y.length){if(dA.lastIndex=q,W=dA.exec(Y),V=W&&W.index!==void 0?W.index:Y.length,U=Y.charCodeAt(V),!W){J=Y.slice(q);break}if(U===10&&q===V&&X)z.push(-3),X=void 0;else{if(X)z.push(-5),X=void 0;if(q<V)z.push(Y.slice(q,V)),Z+=V-q;switch(U){case 0:{z.push(65533),Z++;break}case 9:{K=Math.ceil(Z/4)*4,z.push(-2);while(Z++<K)z.push(-1);break}case 10:{z.push(-4),Z=1;break}default:X=!0,Z=1}}q=V+1}if(H){if(X)z.push(-5);if(J)z.push(J);z.push(null)}return z}}var gh=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lA(Z){return Z.replace(gh,mh)}function mh(Z,J,$){if(J)return J;if($.charCodeAt(0)===35){let Q=$.charCodeAt(1),Y=Q===120||Q===88;return AQ($.slice(Y?2:1),Y?16:10)}return M8($)||Z}var rA={}.hasOwnProperty;function rz(Z,J,$){if(J&&typeof J==="object")$=J,J=void 0;return fh($)(lz(dz($).document().write(iz()(Z,J,!0))))}function fh(Z){let J={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Y(o),autolinkProtocol:k,autolinkEmail:k,atxHeading:Y(_0),blockQuote:Y(Q0),characterEscape:k,characterReference:k,codeFenced:Y(V0),codeFencedFenceInfo:G,codeFencedFenceMeta:G,codeIndented:Y(V0,G),codeText:Y(p,G),codeTextData:k,data:k,codeFlowValue:k,definition:Y(Z0),definitionDestinationString:G,definitionLabelString:G,definitionTitleString:G,emphasis:Y(e),hardBreakEscape:Y(i),hardBreakTrailing:Y(i),htmlFlow:Y(W0,G),htmlFlowData:k,htmlText:Y(W0,G),htmlTextData:k,image:Y(r),label:G,link:Y(o),listItem:Y(u),listItemValue:V,listOrdered:Y(f,q),listUnordered:Y(f),paragraph:Y(L0),reference:E,referenceString:G,resourceDestinationString:G,resourceTitleString:G,setextHeading:Y(_0),strong:Y(M0),thematicBreak:Y(l0)},exit:{atxHeading:z(),atxHeadingSequence:D,autolink:z(),autolinkEmail:X0,autolinkProtocol:q0,blockQuote:z(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:A0,characterReferenceMarkerNumeric:A0,characterReferenceValue:l,characterReference:H0,codeFenced:z(N),codeFencedFence:F,codeFencedFenceInfo:U,codeFencedFenceMeta:B,codeFlowValue:P,codeIndented:z(L),codeText:z(b),codeTextData:P,data:P,definition:z(),definitionDestinationString:O,definitionLabelString:_,definitionTitleString:M,emphasis:z(),hardBreakEscape:z(C),hardBreakTrailing:z(C),htmlFlow:z(I),htmlFlowData:P,htmlText:z(y),htmlTextData:P,image:z(x),label:d,labelText:v,lineEnding:g,link:z(R),listItem:z(),listOrdered:z(),listUnordered:z(),paragraph:z(),referenceString:s,resourceDestinationString:w,resourceTitleString:z0,resource:G0,setextHeading:z(S),setextHeadingLineSequence:T,setextHeadingText:A,strong:z(),thematicBreak:z()}};aA(J,(Z||{}).mdastExtensions||[]);let $={};return X;function X(h){let c={type:"root",children:[]},t={stack:[c],tokenStack:[],config:J,enter:H,exit:W,buffer:G,resume:K,data:$},U0=[],C0=-1;while(++C0<h.length)if(h[C0][1].type==="listOrdered"||h[C0][1].type==="listUnordered")if(h[C0][0]==="enter")U0.push(C0);else{let m0=U0.pop();C0=Q(h,m0,C0)}C0=-1;while(++C0<h.length){let m0=J[h[C0][0]];if(rA.call(m0,h[C0][1].type))m0[h[C0][1].type].call(Object.assign({sliceSerialize:h[C0][2].sliceSerialize},t),h[C0][1])}if(t.tokenStack.length>0){let m0=t.tokenStack[t.tokenStack.length-1];(m0[1]||iA).call(t,void 0,m0[0])}c.position={start:n2(h.length>0?h[0][1].start:{line:1,column:1,offset:0}),end:n2(h.length>0?h[h.length-2][1].end:{line:1,column:1,offset:0})},C0=-1;while(++C0<J.transforms.length)c=J.transforms[C0](c)||c;return c}function Q(h,c,t){let U0=c-1,C0=-1,m0=!1,w1,b1,v0,i0;while(++U0<=t){let e0=h[U0];switch(e0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(e0[0]==="enter")C0++;else C0--;i0=void 0;break}case"lineEndingBlank":{if(e0[0]==="enter"){if(w1&&!i0&&!C0&&!v0)v0=U0;i0=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i0=void 0}if(!C0&&e0[0]==="enter"&&e0[1].type==="listItemPrefix"||C0===-1&&e0[0]==="exit"&&(e0[1].type==="listUnordered"||e0[1].type==="listOrdered")){if(w1){let f0=U0;b1=void 0;while(f0--){let Q1=h[f0];if(Q1[1].type==="lineEnding"||Q1[1].type==="lineEndingBlank"){if(Q1[0]==="exit")continue;if(b1)h[b1][1].type="lineEndingBlank",m0=!0;Q1[1].type="lineEnding",b1=f0}else if(Q1[1].type==="linePrefix"||Q1[1].type==="blockQuotePrefix"||Q1[1].type==="blockQuotePrefixWhitespace"||Q1[1].type==="blockQuoteMarker"||Q1[1].type==="listItemIndent");else break}if(v0&&(!b1||v0<b1))w1._spread=!0;w1.end=Object.assign({},b1?h[b1][1].start:e0[1].end),h.splice(b1||U0,0,["exit",w1,e0[2]]),U0++,t++}if(e0[1].type==="listItemPrefix"){let f0={type:"listItem",_spread:!1,start:Object.assign({},e0[1].start),end:void 0};w1=f0,h.splice(U0,0,["enter",f0,e0[2]]),U0++,t++,v0=void 0,i0=!0}}}return h[c][1]._spread=m0,t}function Y(h,c){return t;function t(U0){if(H.call(this,h(U0),U0),c)c.call(this,U0)}}function G(){this.stack.push({type:"fragment",children:[]})}function H(h,c,t){this.stack[this.stack.length-1].children.push(h),this.stack.push(h),this.tokenStack.push([c,t||void 0]),h.position={start:n2(c.start),end:void 0}}function z(h){return c;function c(t){if(h)h.call(this,t);W.call(this,t)}}function W(h,c){let t=this.stack.pop(),U0=this.tokenStack.pop();if(!U0)throw Error("Cannot close `"+h.type+"` ("+r2({start:h.start,end:h.end})+"): it’s not open");else if(U0[0].type!==h.type)if(c)c.call(this,h,U0[0]);else(U0[1]||iA).call(this,h,U0[0]);t.position.end=n2(h.end)}function K(){return a4(this.stack.pop())}function q(){this.data.expectingFirstListItemValue=!0}function V(h){if(this.data.expectingFirstListItemValue){let c=this.stack[this.stack.length-2];c.start=Number.parseInt(this.sliceSerialize(h),10),this.data.expectingFirstListItemValue=void 0}}function U(){let h=this.resume(),c=this.stack[this.stack.length-1];c.lang=h}function B(){let h=this.resume(),c=this.stack[this.stack.length-1];c.meta=h}function F(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function N(){let h=this.resume(),c=this.stack[this.stack.length-1];c.value=h.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){let h=this.resume(),c=this.stack[this.stack.length-1];c.value=h.replace(/(\r?\n|\r)$/g,"")}function _(h){let c=this.resume(),t=this.stack[this.stack.length-1];t.label=c,t.identifier=o5(this.sliceSerialize(h)).toLowerCase()}function M(){let h=this.resume(),c=this.stack[this.stack.length-1];c.title=h}function O(){let h=this.resume(),c=this.stack[this.stack.length-1];c.url=h}function D(h){let c=this.stack[this.stack.length-1];if(!c.depth){let t=this.sliceSerialize(h).length;c.depth=t}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function T(h){let c=this.stack[this.stack.length-1];c.depth=this.sliceSerialize(h).codePointAt(0)===61?1:2}function S(){this.data.setextHeadingSlurpLineEnding=void 0}function k(h){let t=this.stack[this.stack.length-1].children,U0=t[t.length-1];if(!U0||U0.type!=="text")U0=h0(),U0.position={start:n2(h.start),end:void 0},t.push(U0);this.stack.push(U0)}function P(h){let c=this.stack.pop();c.value+=this.sliceSerialize(h),c.position.end=n2(h.end)}function g(h){let c=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=c.children[c.children.length-1];t.position.end=n2(h.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&J.canContainEols.includes(c.type))k.call(this,h),P.call(this,h)}function C(){this.data.atHardBreak=!0}function I(){let h=this.resume(),c=this.stack[this.stack.length-1];c.value=h}function y(){let h=this.resume(),c=this.stack[this.stack.length-1];c.value=h}function b(){let h=this.resume(),c=this.stack[this.stack.length-1];c.value=h}function R(){let h=this.stack[this.stack.length-1];if(this.data.inReference){let c=this.data.referenceType||"shortcut";h.type+="Reference",h.referenceType=c,delete h.url,delete h.title}else delete h.identifier,delete h.label;this.data.referenceType=void 0}function x(){let h=this.stack[this.stack.length-1];if(this.data.inReference){let c=this.data.referenceType||"shortcut";h.type+="Reference",h.referenceType=c,delete h.url,delete h.title}else delete h.identifier,delete h.label;this.data.referenceType=void 0}function v(h){let c=this.sliceSerialize(h),t=this.stack[this.stack.length-2];t.label=lA(c),t.identifier=o5(c).toLowerCase()}function d(){let h=this.stack[this.stack.length-1],c=this.resume(),t=this.stack[this.stack.length-1];if(this.data.inReference=!0,t.type==="link"){let U0=h.children;t.children=U0}else t.alt=c}function w(){let h=this.resume(),c=this.stack[this.stack.length-1];c.url=h}function z0(){let h=this.resume(),c=this.stack[this.stack.length-1];c.title=h}function G0(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function s(h){let c=this.resume(),t=this.stack[this.stack.length-1];t.label=c,t.identifier=o5(this.sliceSerialize(h)).toLowerCase(),this.data.referenceType="full"}function A0(h){this.data.characterReferenceType=h.type}function l(h){let c=this.sliceSerialize(h),t=this.data.characterReferenceType,U0;if(t)U0=AQ(c,t==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else U0=M8(c);let C0=this.stack[this.stack.length-1];C0.value+=U0}function H0(h){let c=this.stack.pop();c.position.end=n2(h.end)}function q0(h){P.call(this,h);let c=this.stack[this.stack.length-1];c.url=this.sliceSerialize(h)}function X0(h){P.call(this,h);let c=this.stack[this.stack.length-1];c.url="mailto:"+this.sliceSerialize(h)}function Q0(){return{type:"blockquote",children:[]}}function V0(){return{type:"code",lang:null,meta:null,value:""}}function p(){return{type:"inlineCode",value:""}}function Z0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function e(){return{type:"emphasis",children:[]}}function _0(){return{type:"heading",depth:0,children:[]}}function i(){return{type:"break"}}function W0(){return{type:"html",value:""}}function r(){return{type:"image",title:null,url:"",alt:null}}function o(){return{type:"link",title:null,url:"",children:[]}}function f(h){return{type:"list",ordered:h.type==="listOrdered",start:null,spread:h._spread,children:[]}}function u(h){return{type:"listItem",spread:h._spread,checked:null,children:[]}}function L0(){return{type:"paragraph",children:[]}}function M0(){return{type:"strong",children:[]}}function h0(){return{type:"text",value:""}}function l0(){return{type:"thematicBreak"}}}function n2(Z){return{line:Z.line,column:Z.column,offset:Z.offset}}function aA(Z,J){let $=-1;while(++$<J.length){let X=J[$];if(Array.isArray(X))aA(Z,X);else ph(Z,X)}}function ph(Z,J){let $;for($ in J)if(rA.call(J,$))switch($){case"canContainEols":{let X=J[$];if(X)Z[$].push(...X);break}case"transforms":{let X=J[$];if(X)Z[$].push(...X);break}case"enter":case"exit":{let X=J[$];if(X)Object.assign(Z[$],X);break}}}function iA(Z,J){if(Z)throw Error("Cannot close `"+Z.type+"` ("+r2({start:Z.start,end:Z.end})+"): a different token (`"+J.type+"`, "+r2({start:J.start,end:J.end})+") is open");else throw Error("Cannot close document, a token (`"+J.type+"`, "+r2({start:J.start,end:J.end})+") is still open")}function IQ(Z){let J=this;J.parser=$;function $(X){return rz(X,{...J.data("settings"),...Z,extensions:J.data("micromarkExtensions")||[],mdastExtensions:J.data("fromMarkdownExtensions")||[]})}}var EQ=-1,D8=0,Z6=1,O8=2,wZ=3,PZ=4,jZ=5,TZ=6,kQ=7,RQ=8;var sA=typeof self==="object"?self:globalThis,uh=(Z,J)=>{let $=(Q,Y)=>{return Z.set(Y,Q),Q},X=(Q)=>{if(Z.has(Q))return Z.get(Q);let[Y,G]=J[Q];switch(Y){case D8:case EQ:return $(G,Q);case Z6:{let H=$([],Q);for(let z of G)H.push(X(z));return H}case O8:{let H=$({},Q);for(let[z,W]of G)H[X(z)]=X(W);return H}case wZ:return $(new Date(G),Q);case PZ:{let{source:H,flags:z}=G;return $(new RegExp(H,z),Q)}case jZ:{let H=$(new Map,Q);for(let[z,W]of G)H.set(X(z),X(W));return H}case TZ:{let H=$(new Set,Q);for(let z of G)H.add(X(z));return H}case kQ:{let{name:H,message:z}=G;return $(new sA[H](z),Q)}case RQ:return $(BigInt(G),Q);case"BigInt":return $(Object(BigInt(G)),Q);case"ArrayBuffer":return $(new Uint8Array(G).buffer,G);case"DataView":{let{buffer:H}=new Uint8Array(G);return $(new DataView(H),G)}}return $(new sA[Y](G),Q)};return X},az=(Z)=>uh(new Map,Z)(0);var w8="",{toString:ch}={},{keys:dh}=Object,CZ=(Z)=>{let J=typeof Z;if(J!=="object"||!Z)return[D8,J];let $=ch.call(Z).slice(8,-1);switch($){case"Array":return[Z6,w8];case"Object":return[O8,w8];case"Date":return[wZ,w8];case"RegExp":return[PZ,w8];case"Map":return[jZ,w8];case"Set":return[TZ,w8];case"DataView":return[Z6,$]}if($.includes("Array"))return[Z6,$];if($.includes("Error"))return[kQ,$];return[O8,$]},yQ=([Z,J])=>Z===D8&&(J==="function"||J==="symbol"),lh=(Z,J,$,X)=>{let Q=(G,H)=>{let z=X.push(G)-1;return $.set(H,z),z},Y=(G)=>{if($.has(G))return $.get(G);let[H,z]=CZ(G);switch(H){case D8:{let K=G;switch(z){case"bigint":H=RQ,K=G.toString();break;case"function":case"symbol":if(Z)throw TypeError("unable to serialize "+z);K=null;break;case"undefined":return Q([EQ],G)}return Q([H,K],G)}case Z6:{if(z){let V=G;if(z==="DataView")V=new Uint8Array(G.buffer);else if(z==="ArrayBuffer")V=new Uint8Array(G);return Q([z,[...V]],G)}let K=[],q=Q([H,K],G);for(let V of G)K.push(Y(V));return q}case O8:{if(z)switch(z){case"BigInt":return Q([z,G.toString()],G);case"Boolean":case"Number":case"String":return Q([z,G.valueOf()],G)}if(J&&"toJSON"in G)return Y(G.toJSON());let K=[],q=Q([H,K],G);for(let V of dh(G))if(Z||!yQ(CZ(G[V])))K.push([Y(V),Y(G[V])]);return q}case wZ:return Q([H,G.toISOString()],G);case PZ:{let{source:K,flags:q}=G;return Q([H,{source:K,flags:q}],G)}case jZ:{let K=[],q=Q([H,K],G);for(let[V,U]of G)if(Z||!(yQ(CZ(V))||yQ(CZ(U))))K.push([Y(V),Y(U)]);return q}case TZ:{let K=[],q=Q([H,K],G);for(let V of G)if(Z||!yQ(CZ(V)))K.push(Y(V));return q}}let{message:W}=G;return Q([H,{name:z,message:W}],G)};return Y},sz=(Z,{json:J,lossy:$}={})=>{let X=[];return lh(!(J||$),!!J,new Map,X)(Z),X};var P8=typeof structuredClone==="function"?(Z,J)=>J&&(("json"in J)||("lossy"in J))?az(sz(Z,J)):structuredClone(Z):(Z,J)=>az(sz(Z,J));function ih(Z,J){let $=[{type:"text",value:"↩"}];if(J>1)$.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(J)}]});return $}function rh(Z,J){return"Back to reference "+(Z+1)+(J>1?"-"+J:"")}function nA(Z){let J=typeof Z.options.clobberPrefix==="string"?Z.options.clobberPrefix:"user-content-",$=Z.options.footnoteBackContent||ih,X=Z.options.footnoteBackLabel||rh,Q=Z.options.footnoteLabel||"Footnotes",Y=Z.options.footnoteLabelTagName||"h2",G=Z.options.footnoteLabelProperties||{className:["sr-only"]},H=[],z=-1;while(++z<Z.footnoteOrder.length){let W=Z.footnoteById.get(Z.footnoteOrder[z]);if(!W)continue;let K=Z.all(W),q=String(W.identifier).toUpperCase(),V=r7(q.toLowerCase()),U=0,B=[],F=Z.footnoteCounts.get(q);while(F!==void 0&&++U<=F){if(B.length>0)B.push({type:"text",value:" "});let _=typeof $==="string"?$:$(z,U);if(typeof _==="string")_={type:"text",value:_};B.push({type:"element",tagName:"a",properties:{href:"#"+J+"fnref-"+V+(U>1?"-"+U:""),dataFootnoteBackref:"",ariaLabel:typeof X==="string"?X:X(z,U),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}let N=K[K.length-1];if(N&&N.type==="element"&&N.tagName==="p"){let _=N.children[N.children.length-1];if(_&&_.type==="text")_.value+=" ";else N.children.push({type:"text",value:" "});N.children.push(...B)}else K.push(...B);let L={type:"element",tagName:"li",properties:{id:J+"fn-"+V},children:Z.wrap(K,!0)};Z.patch(W,L),H.push(L)}if(H.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Y,properties:{...P8(G),id:"footnote-label"},children:[{type:"text",value:Q}]},{type:"text",value:`
|
|
28
|
-
`},{type:"element",tagName:"ol",properties:{},children:Z.wrap(H,!0)},{type:"text",value:`
|
|
29
|
-
`}]}}var a9=function(Z){if(Z===null||Z===void 0)return oh;if(typeof Z==="function")return bQ(Z);if(typeof Z==="object")return Array.isArray(Z)?ah(Z):sh(Z);if(typeof Z==="string")return nh(Z);throw Error("Expected function, string, or object as test")};function ah(Z){let J=[],$=-1;while(++$<Z.length)J[$]=a9(Z[$]);return bQ(X);function X(...Q){let Y=-1;while(++Y<J.length)if(J[Y].apply(this,Q))return!0;return!1}}function sh(Z){let J=Z;return bQ($);function $(X){let Q=X,Y;for(Y in Z)if(Q[Y]!==J[Y])return!1;return!0}}function nh(Z){return bQ(J);function J($){return $&&$.type===Z}}function bQ(Z){return J;function J($,X,Q){return Boolean(th($)&&Z.call(this,$,typeof X==="number"?X:void 0,Q||void 0))}}function oh(){return!0}function th(Z){return Z!==null&&typeof Z==="object"&&"type"in Z}function oA(Z){return Z}var tA=[],xQ=!0,J6=!1,hQ="skip";function SZ(Z,J,$,X){let Q;if(typeof J==="function"&&typeof $!=="function")X=$,$=J;else Q=J;let Y=a9(Q),G=X?-1:1;H(Z,void 0,[])();function H(z,W,K){let q=z&&typeof z==="object"?z:{};if(typeof q.type==="string"){let U=typeof q.tagName==="string"?q.tagName:typeof q.name==="string"?q.name:void 0;Object.defineProperty(V,"name",{value:"node ("+oA(z.type+(U?"<"+U+">":""))+")"})}return V;function V(){let U=tA,B,F,N;if(!J||Y(z,W,K[K.length-1]||void 0)){if(U=eh($(z,K)),U[0]===J6)return U}if("children"in z&&z.children){let L=z;if(L.children&&U[0]!==hQ){F=(X?L.children.length:-1)+G,N=K.concat(L);while(F>-1&&F<L.children.length){let _=L.children[F];if(B=H(_,F,N)(),B[0]===J6)return B;F=typeof B[1]==="number"?B[1]:F+G}}}return U}}}function eh(Z){if(Array.isArray(Z))return Z;if(typeof Z==="number")return[xQ,Z];return Z===null||Z===void 0?tA:[Z]}function W2(Z,J,$,X){let Q,Y,G;if(typeof J==="function"&&typeof $!=="function")Y=void 0,G=J,Q=$;else Y=J,G=$,Q=X;SZ(Z,Y,H,Q);function H(z,W){let K=W[W.length-1],q=K?K.children.indexOf(z):void 0;return G(z,q,K)}}function eA(Z,J){let $={type:"element",tagName:"blockquote",properties:{},children:Z.wrap(Z.all(J),!0)};return Z.patch(J,$),Z.applyData(J,$)}function ZM(Z,J){let $={type:"element",tagName:"br",properties:{},children:[]};return Z.patch(J,$),[Z.applyData(J,$),{type:"text",value:`
|
|
30
|
-
`}]}function JM(Z,J){let $=J.value?J.value+`
|
|
31
|
-
`:"",X={},Q=J.lang?J.lang.split(/\s+/):[];if(Q.length>0)X.className=["language-"+Q[0]];let Y={type:"element",tagName:"code",properties:X,children:[{type:"text",value:$}]};if(J.meta)Y.data={meta:J.meta};return Z.patch(J,Y),Y=Z.applyData(J,Y),Y={type:"element",tagName:"pre",properties:{},children:[Y]},Z.patch(J,Y),Y}function $M(Z,J){let $={type:"element",tagName:"del",properties:{},children:Z.all(J)};return Z.patch(J,$),Z.applyData(J,$)}function XM(Z,J){let $={type:"element",tagName:"em",properties:{},children:Z.all(J)};return Z.patch(J,$),Z.applyData(J,$)}function QM(Z,J){let $=typeof Z.options.clobberPrefix==="string"?Z.options.clobberPrefix:"user-content-",X=String(J.identifier).toUpperCase(),Q=r7(X.toLowerCase()),Y=Z.footnoteOrder.indexOf(X),G,H=Z.footnoteCounts.get(X);if(H===void 0)H=0,Z.footnoteOrder.push(X),G=Z.footnoteOrder.length;else G=Y+1;H+=1,Z.footnoteCounts.set(X,H);let z={type:"element",tagName:"a",properties:{href:"#"+$+"fn-"+Q,id:$+"fnref-"+Q+(H>1?"-"+H:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(G)}]};Z.patch(J,z);let W={type:"element",tagName:"sup",properties:{},children:[z]};return Z.patch(J,W),Z.applyData(J,W)}function YM(Z,J){let $={type:"element",tagName:"h"+J.depth,properties:{},children:Z.all(J)};return Z.patch(J,$),Z.applyData(J,$)}function GM(Z,J){if(Z.options.allowDangerousHtml){let $={type:"raw",value:J.value};return Z.patch(J,$),Z.applyData(J,$)}return}function vQ(Z,J){let $=J.referenceType,X="]";if($==="collapsed")X+="[]";else if($==="full")X+="["+(J.label||J.identifier)+"]";if(J.type==="imageReference")return[{type:"text",value:"!["+J.alt+X}];let Q=Z.all(J),Y=Q[0];if(Y&&Y.type==="text")Y.value="["+Y.value;else Q.unshift({type:"text",value:"["});let G=Q[Q.length-1];if(G&&G.type==="text")G.value+=X;else Q.push({type:"text",value:X});return Q}function HM(Z,J){let $=String(J.identifier).toUpperCase(),X=Z.definitionById.get($);if(!X)return vQ(Z,J);let Q={src:r7(X.url||""),alt:J.alt};if(X.title!==null&&X.title!==void 0)Q.title=X.title;let Y={type:"element",tagName:"img",properties:Q,children:[]};return Z.patch(J,Y),Z.applyData(J,Y)}function zM(Z,J){let $={src:r7(J.url)};if(J.alt!==null&&J.alt!==void 0)$.alt=J.alt;if(J.title!==null&&J.title!==void 0)$.title=J.title;let X={type:"element",tagName:"img",properties:$,children:[]};return Z.patch(J,X),Z.applyData(J,X)}function WM(Z,J){let $={type:"text",value:J.value.replace(/\r?\n|\r/g," ")};Z.patch(J,$);let X={type:"element",tagName:"code",properties:{},children:[$]};return Z.patch(J,X),Z.applyData(J,X)}function KM(Z,J){let $=String(J.identifier).toUpperCase(),X=Z.definitionById.get($);if(!X)return vQ(Z,J);let Q={href:r7(X.url||"")};if(X.title!==null&&X.title!==void 0)Q.title=X.title;let Y={type:"element",tagName:"a",properties:Q,children:Z.all(J)};return Z.patch(J,Y),Z.applyData(J,Y)}function qM(Z,J){let $={href:r7(J.url)};if(J.title!==null&&J.title!==void 0)$.title=J.title;let X={type:"element",tagName:"a",properties:$,children:Z.all(J)};return Z.patch(J,X),Z.applyData(J,X)}function VM(Z,J,$){let X=Z.all(J),Q=$?Zv($):UM(J),Y={},G=[];if(typeof J.checked==="boolean"){let K=X[0],q;if(K&&K.type==="element"&&K.tagName==="p")q=K;else q={type:"element",tagName:"p",properties:{},children:[]},X.unshift(q);if(q.children.length>0)q.children.unshift({type:"text",value:" "});q.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:J.checked,disabled:!0},children:[]}),Y.className=["task-list-item"]}let H=-1;while(++H<X.length){let K=X[H];if(Q||H!==0||K.type!=="element"||K.tagName!=="p")G.push({type:"text",value:`
|
|
32
|
-
`});if(K.type==="element"&&K.tagName==="p"&&!Q)G.push(...K.children);else G.push(K)}let z=X[X.length-1];if(z&&(Q||z.type!=="element"||z.tagName!=="p"))G.push({type:"text",value:`
|
|
33
|
-
`});let W={type:"element",tagName:"li",properties:Y,children:G};return Z.patch(J,W),Z.applyData(J,W)}function Zv(Z){let J=!1;if(Z.type==="list"){J=Z.spread||!1;let $=Z.children,X=-1;while(!J&&++X<$.length)J=UM($[X])}return J}function UM(Z){let J=Z.spread;return J===null||J===void 0?Z.children.length>1:J}function BM(Z,J){let $={},X=Z.all(J),Q=-1;if(typeof J.start==="number"&&J.start!==1)$.start=J.start;while(++Q<X.length){let G=X[Q];if(G.type==="element"&&G.tagName==="li"&&G.properties&&Array.isArray(G.properties.className)&&G.properties.className.includes("task-list-item")){$.className=["contains-task-list"];break}}let Y={type:"element",tagName:J.ordered?"ol":"ul",properties:$,children:Z.wrap(X,!0)};return Z.patch(J,Y),Z.applyData(J,Y)}function FM(Z,J){let $={type:"element",tagName:"p",properties:{},children:Z.all(J)};return Z.patch(J,$),Z.applyData(J,$)}function LM(Z,J){let $={type:"root",children:Z.wrap(Z.all(J))};return Z.patch(J,$),Z.applyData(J,$)}function NM(Z,J){let $={type:"element",tagName:"strong",properties:{},children:Z.all(J)};return Z.patch(J,$),Z.applyData(J,$)}function _M(Z,J){let $=Z.all(J),X=$.shift(),Q=[];if(X){let G={type:"element",tagName:"thead",properties:{},children:Z.wrap([X],!0)};Z.patch(J.children[0],G),Q.push(G)}if($.length>0){let G={type:"element",tagName:"tbody",properties:{},children:Z.wrap($,!0)},H=A8(J.children[1]),z=NQ(J.children[J.children.length-1]);if(H&&z)G.position={start:H,end:z};Q.push(G)}let Y={type:"element",tagName:"table",properties:{},children:Z.wrap(Q,!0)};return Z.patch(J,Y),Z.applyData(J,Y)}function AM(Z,J,$){let X=$?$.children:void 0,Y=(X?X.indexOf(J):1)===0?"th":"td",G=$&&$.type==="table"?$.align:void 0,H=G?G.length:J.children.length,z=-1,W=[];while(++z<H){let q=J.children[z],V={},U=G?G[z]:void 0;if(U)V.align=U;let B={type:"element",tagName:Y,properties:V,children:[]};if(q)B.children=Z.all(q),Z.patch(q,B),B=Z.applyData(q,B);W.push(B)}let K={type:"element",tagName:"tr",properties:{},children:Z.wrap(W,!0)};return Z.patch(J,K),Z.applyData(J,K)}function MM(Z,J){let $={type:"element",tagName:"td",properties:{},children:Z.all(J)};return Z.patch(J,$),Z.applyData(J,$)}function OM(Z){let J=String(Z),$=/\r?\n|\r/g,X=$.exec(J),Q=0,Y=[];while(X)Y.push(DM(J.slice(Q,X.index),Q>0,!0),X[0]),Q=X.index+X[0].length,X=$.exec(J);return Y.push(DM(J.slice(Q),Q>0,!1)),Y.join("")}function DM(Z,J,$){let X=0,Q=Z.length;if(J){let Y=Z.codePointAt(X);while(Y===9||Y===32)X++,Y=Z.codePointAt(X)}if($){let Y=Z.codePointAt(Q-1);while(Y===9||Y===32)Q--,Y=Z.codePointAt(Q-1)}return Q>X?Z.slice(X,Q):""}function wM(Z,J){let $={type:"text",value:OM(String(J.value))};return Z.patch(J,$),Z.applyData(J,$)}function PM(Z,J){let $={type:"element",tagName:"hr",properties:{},children:[]};return Z.patch(J,$),Z.applyData(J,$)}var jM={blockquote:eA,break:ZM,code:JM,delete:$M,emphasis:XM,footnoteReference:QM,heading:YM,html:GM,imageReference:HM,image:zM,inlineCode:WM,linkReference:KM,link:qM,listItem:VM,list:BM,paragraph:FM,root:LM,strong:NM,table:_M,tableCell:MM,tableRow:AM,text:wM,thematicBreak:PM,toml:gQ,yaml:gQ,definition:gQ,footnoteDefinition:gQ};function gQ(){return}var nz={}.hasOwnProperty,Jv={};function CM(Z,J){let $=J||Jv,X=new Map,Q=new Map,Y=new Map,G={...jM,...$.handlers},H={all:W,applyData:Xv,definitionById:X,footnoteById:Q,footnoteCounts:Y,footnoteOrder:[],handlers:G,one:z,options:$,patch:$v,wrap:Yv};return W2(Z,function(K){if(K.type==="definition"||K.type==="footnoteDefinition"){let q=K.type==="definition"?X:Q,V=String(K.identifier).toUpperCase();if(!q.has(V))q.set(V,K)}}),H;function z(K,q){let V=K.type,U=H.handlers[V];if(nz.call(H.handlers,V)&&U)return U(H,K,q);if(H.options.passThrough&&H.options.passThrough.includes(V)){if("children"in K){let{children:F,...N}=K,L=P8(N);return L.children=H.all(K),L}return P8(K)}return(H.options.unknownHandler||Qv)(H,K,q)}function W(K){let q=[];if("children"in K){let V=K.children,U=-1;while(++U<V.length){let B=H.one(V[U],K);if(B){if(U&&V[U-1].type==="break"){if(!Array.isArray(B)&&B.type==="text")B.value=TM(B.value);if(!Array.isArray(B)&&B.type==="element"){let F=B.children[0];if(F&&F.type==="text")F.value=TM(F.value)}}if(Array.isArray(B))q.push(...B);else q.push(B)}}}return q}}function $v(Z,J){if(Z.position)J.position=jz(Z)}function Xv(Z,J){let $=J;if(Z&&Z.data){let X=Z.data.hName,Q=Z.data.hChildren,Y=Z.data.hProperties;if(typeof X==="string")if($.type==="element")$.tagName=X;else{let G="children"in $?$.children:[$];$={type:"element",tagName:X,properties:{},children:G}}if($.type==="element"&&Y)Object.assign($.properties,P8(Y));if("children"in $&&$.children&&Q!==null&&Q!==void 0)$.children=Q}return $}function Qv(Z,J){let $=J.data||{},X="value"in J&&!(nz.call($,"hProperties")||nz.call($,"hChildren"))?{type:"text",value:J.value}:{type:"element",tagName:"div",properties:{},children:Z.all(J)};return Z.patch(J,X),Z.applyData(J,X)}function Yv(Z,J){let $=[],X=-1;if(J)$.push({type:"text",value:`
|
|
34
|
-
`});while(++X<Z.length){if(X)$.push({type:"text",value:`
|
|
35
|
-
`});$.push(Z[X])}if(J&&Z.length>0)$.push({type:"text",value:`
|
|
36
|
-
`});return $}function TM(Z){let J=0,$=Z.charCodeAt(J);while($===9||$===32)J++,$=Z.charCodeAt(J);return Z.slice(J)}function mQ(Z,J){let $=CM(Z,J),X=$.one(Z,void 0),Q=nA($),Y=Array.isArray(X)?{type:"root",children:X}:X||{type:"root",children:[]};if(Q)U1("children"in Y),Y.children.push({type:"text",value:`
|
|
37
|
-
`},Q);return Y}function fQ(Z,J){if(Z&&"run"in Z)return async function($,X){let Q=mQ($,{file:X,...J});await Z.run(Q,X)};return function($,X){return mQ($,{file:X,...Z||J})}}function oz(Z){if(Z)throw Z}var cQ=j(hM(),1);function IZ(Z){if(typeof Z!=="object"||Z===null)return!1;let J=Object.getPrototypeOf(Z);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in Z)&&!(Symbol.iterator in Z)}function tz(){let Z=[],J={run:$,use:X};return J;function $(...Q){let Y=-1,G=Q.pop();if(typeof G!=="function")throw TypeError("Expected function as last argument, not "+G);H(null,...Q);function H(z,...W){let K=Z[++Y],q=-1;if(z){G(z);return}while(++q<Q.length)if(W[q]===null||W[q]===void 0)W[q]=Q[q];if(Q=W,K)vM(K,H)(...W);else G(null,...W)}}function X(Q){if(typeof Q!=="function")throw TypeError("Expected `middelware` to be a function, not "+Q);return Z.push(Q),J}}function vM(Z,J){let $;return X;function X(...G){let H=Z.length>G.length,z;if(H)G.push(Q);try{z=Z.apply(this,G)}catch(W){let K=W;if(H&&$)throw K;return Q(K)}if(!H)if(z&&z.then&&typeof z.then==="function")z.then(Y,Q);else if(z instanceof Error)Q(z);else Y(z)}function Q(G,...H){if(!$)$=!0,J(G,...H)}function Y(G){Q(null,G)}}var K9={basename:Gv,dirname:Hv,extname:zv,join:Wv,sep:"/"};function Gv(Z,J){if(J!==void 0&&typeof J!=="string")throw TypeError('"ext" argument must be a string');EZ(Z);let $=0,X=-1,Q=Z.length,Y;if(J===void 0||J.length===0||J.length>Z.length){while(Q--)if(Z.codePointAt(Q)===47){if(Y){$=Q+1;break}}else if(X<0)Y=!0,X=Q+1;return X<0?"":Z.slice($,X)}if(J===Z)return"";let G=-1,H=J.length-1;while(Q--)if(Z.codePointAt(Q)===47){if(Y){$=Q+1;break}}else{if(G<0)Y=!0,G=Q+1;if(H>-1)if(Z.codePointAt(Q)===J.codePointAt(H--)){if(H<0)X=Q}else H=-1,X=G}if($===X)X=G;else if(X<0)X=Z.length;return Z.slice($,X)}function Hv(Z){if(EZ(Z),Z.length===0)return".";let J=-1,$=Z.length,X;while(--$)if(Z.codePointAt($)===47){if(X){J=$;break}}else if(!X)X=!0;return J<0?Z.codePointAt(0)===47?"/":".":J===1&&Z.codePointAt(0)===47?"//":Z.slice(0,J)}function zv(Z){EZ(Z);let J=Z.length,$=-1,X=0,Q=-1,Y=0,G;while(J--){let H=Z.codePointAt(J);if(H===47){if(G){X=J+1;break}continue}if($<0)G=!0,$=J+1;if(H===46){if(Q<0)Q=J;else if(Y!==1)Y=1}else if(Q>-1)Y=-1}if(Q<0||$<0||Y===0||Y===1&&Q===$-1&&Q===X+1)return"";return Z.slice(Q,$)}function Wv(...Z){let J=-1,$;while(++J<Z.length)if(EZ(Z[J]),Z[J])$=$===void 0?Z[J]:$+"/"+Z[J];return $===void 0?".":Kv($)}function Kv(Z){EZ(Z);let J=Z.codePointAt(0)===47,$=qv(Z,!J);if($.length===0&&!J)$=".";if($.length>0&&Z.codePointAt(Z.length-1)===47)$+="/";return J?"/"+$:$}function qv(Z,J){let $="",X=0,Q=-1,Y=0,G=-1,H,z;while(++G<=Z.length){if(G<Z.length)H=Z.codePointAt(G);else if(H===47)break;else H=47;if(H===47){if(Q===G-1||Y===1);else if(Q!==G-1&&Y===2){if($.length<2||X!==2||$.codePointAt($.length-1)!==46||$.codePointAt($.length-2)!==46){if($.length>2){if(z=$.lastIndexOf("/"),z!==$.length-1){if(z<0)$="",X=0;else $=$.slice(0,z),X=$.length-1-$.lastIndexOf("/");Q=G,Y=0;continue}}else if($.length>0){$="",X=0,Q=G,Y=0;continue}}if(J)$=$.length>0?$+"/..":"..",X=2}else{if($.length>0)$+="/"+Z.slice(Q+1,G);else $=Z.slice(Q+1,G);X=G-Q-1}Q=G,Y=0}else if(H===46&&Y>-1)Y++;else Y=-1}return $}function EZ(Z){if(typeof Z!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(Z))}var gM={cwd:Vv};function Vv(){return"/"}function j8(Z){return Boolean(Z!==null&&typeof Z==="object"&&"href"in Z&&Z.href&&"protocol"in Z&&Z.protocol&&Z.auth===void 0)}function mM(Z){if(typeof Z==="string")Z=new URL(Z);else if(!j8(Z)){let J=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+Z+"`");throw J.code="ERR_INVALID_ARG_TYPE",J}if(Z.protocol!=="file:"){let J=TypeError("The URL must be of scheme file");throw J.code="ERR_INVALID_URL_SCHEME",J}return Uv(Z)}function Uv(Z){if(Z.hostname!==""){let X=TypeError('File URL host must be "localhost" or empty on darwin');throw X.code="ERR_INVALID_FILE_URL_HOST",X}let J=Z.pathname,$=-1;while(++$<J.length)if(J.codePointAt($)===37&&J.codePointAt($+1)===50){let X=J.codePointAt($+2);if(X===70||X===102){let Q=TypeError("File URL path must not include encoded / characters");throw Q.code="ERR_INVALID_FILE_URL_PATH",Q}}return decodeURIComponent(J)}var ez=["history","path","basename","stem","extname","dirname"];class T8{constructor(Z){let J;if(!Z)J={};else if(j8(Z))J={path:Z};else if(typeof Z==="string"||Bv(Z))J={value:Z};else J=Z;this.cwd="cwd"in J?"":gM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let $=-1;while(++$<ez.length){let Q=ez[$];if(Q in J&&J[Q]!==void 0&&J[Q]!==null)this[Q]=Q==="history"?[...J[Q]]:J[Q]}let X;for(X in J)if(!ez.includes(X))this[X]=J[X]}get basename(){return typeof this.path==="string"?K9.basename(this.path):void 0}set basename(Z){JW(Z,"basename"),ZW(Z,"basename"),this.path=K9.join(this.dirname||"",Z)}get dirname(){return typeof this.path==="string"?K9.dirname(this.path):void 0}set dirname(Z){fM(this.basename,"dirname"),this.path=K9.join(Z||"",this.basename)}get extname(){return typeof this.path==="string"?K9.extname(this.path):void 0}set extname(Z){if(ZW(Z,"extname"),fM(this.dirname,"extname"),Z){if(Z.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(Z.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=K9.join(this.dirname,this.stem+(Z||""))}get path(){return this.history[this.history.length-1]}set path(Z){if(j8(Z))Z=mM(Z);if(JW(Z,"path"),this.path!==Z)this.history.push(Z)}get stem(){return typeof this.path==="string"?K9.basename(this.path,this.extname):void 0}set stem(Z){JW(Z,"stem"),ZW(Z,"stem"),this.path=K9.join(this.dirname||"",Z+(this.extname||""))}fail(Z,J,$){let X=this.message(Z,J,$);throw X.fatal=!0,X}info(Z,J,$){let X=this.message(Z,J,$);return X.fatal=void 0,X}message(Z,J,$){let X=new L5(Z,J,$);if(this.path)X.name=this.path+":"+X.name,X.file=this.path;return X.fatal=!1,this.messages.push(X),X}toString(Z){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(Z||void 0).decode(this.value)}}function ZW(Z,J){if(Z&&Z.includes(K9.sep))throw Error("`"+J+"` cannot be a path: did not expect `"+K9.sep+"`")}function JW(Z,J){if(!Z)throw Error("`"+J+"` cannot be empty")}function fM(Z,J){if(!Z)throw Error("Setting `"+J+"` requires `path` to be set too")}function Bv(Z){return Boolean(Z&&typeof Z==="object"&&"byteLength"in Z&&"byteOffset"in Z)}var pM=function(Z){let X=this.constructor.prototype,Q=X[Z],Y=function(){return Q.apply(Y,arguments)};return Object.setPrototypeOf(Y,X),Y};var Fv={}.hasOwnProperty;class YW extends pM{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=tz()}copy(){let Z=new YW,J=-1;while(++J<this.attachers.length){let $=this.attachers[J];Z.use(...$)}return Z.data(cQ.default(!0,{},this.namespace)),Z}data(Z,J){if(typeof Z==="string"){if(arguments.length===2)return QW("data",this.frozen),this.namespace[Z]=J,this;return Fv.call(this.namespace,Z)&&this.namespace[Z]||void 0}if(Z)return QW("data",this.frozen),this.namespace=Z,this;return this.namespace}freeze(){if(this.frozen)return this;let Z=this;while(++this.freezeIndex<this.attachers.length){let[J,...$]=this.attachers[this.freezeIndex];if($[0]===!1)continue;if($[0]===!0)$[0]=void 0;let X=J.call(Z,...$);if(typeof X==="function")this.transformers.use(X)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(Z){this.freeze();let J=uQ(Z),$=this.parser||this.Parser;return $W("parse",$),$(String(J),J)}process(Z,J){let $=this;return this.freeze(),$W("process",this.parser||this.Parser),XW("process",this.compiler||this.Compiler),J?X(void 0,J):new Promise(X);function X(Q,Y){let G=uQ(Z),H=$.parse(G);$.run(H,G,function(W,K,q){if(W||!K||!q)return z(W);let V=K,U=$.stringify(V,q);if(Nv(U))q.value=U;else q.result=U;z(W,q)});function z(W,K){if(W||!K)Y(W);else if(Q)Q(K);else U1(J,"`done` is defined if `resolve` is not"),J(void 0,K)}}}processSync(Z){let J=!1,$;return this.freeze(),$W("processSync",this.parser||this.Parser),XW("processSync",this.compiler||this.Compiler),this.process(Z,X),cM("processSync","process",J),U1($,"we either bailed on an error or have a tree"),$;function X(Q,Y){J=!0,oz(Q),$=Y}}run(Z,J,$){uM(Z),this.freeze();let X=this.transformers;if(!$&&typeof J==="function")$=J,J=void 0;return $?Q(void 0,$):new Promise(Q);function Q(Y,G){U1(typeof J!=="function","`file` can’t be a `done` anymore, we checked");let H=uQ(J);X.run(Z,H,z);function z(W,K,q){let V=K||Z;if(W)G(W);else if(Y)Y(V);else U1($,"`done` is defined if `resolve` is not"),$(void 0,V,q)}}}runSync(Z,J){let $=!1,X;return this.run(Z,J,Q),cM("runSync","run",$),U1(X,"we either bailed on an error or have a tree"),X;function Q(Y,G){oz(Y),X=G,$=!0}}stringify(Z,J){this.freeze();let $=uQ(J),X=this.compiler||this.Compiler;return XW("stringify",X),uM(Z),X(Z,$)}use(Z,...J){let $=this.attachers,X=this.namespace;if(QW("use",this.frozen),Z===null||Z===void 0);else if(typeof Z==="function")H(Z,J);else if(typeof Z==="object")if(Array.isArray(Z))G(Z);else Y(Z);else throw TypeError("Expected usable value, not `"+Z+"`");return this;function Q(z){if(typeof z==="function")H(z,[]);else if(typeof z==="object")if(Array.isArray(z)){let[W,...K]=z;H(W,K)}else Y(z);else throw TypeError("Expected usable value, not `"+z+"`")}function Y(z){if(!("plugins"in z)&&!("settings"in z))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(z.plugins),z.settings)X.settings=cQ.default(!0,X.settings,z.settings)}function G(z){let W=-1;if(z===null||z===void 0);else if(Array.isArray(z))while(++W<z.length){let K=z[W];Q(K)}else throw TypeError("Expected a list of plugins, not `"+z+"`")}function H(z,W){let K=-1,q=-1;while(++K<$.length)if($[K][0]===z){q=K;break}if(q===-1)$.push([z,...W]);else if(W.length>0){let[V,...U]=W,B=$[q][1];if(IZ(B)&&IZ(V))V=cQ.default(!0,B,V);$[q]=[z,V,...U]}}}}var GW=new YW().freeze();function $W(Z,J){if(typeof J!=="function")throw TypeError("Cannot `"+Z+"` without `parser`")}function XW(Z,J){if(typeof J!=="function")throw TypeError("Cannot `"+Z+"` without `compiler`")}function QW(Z,J){if(J)throw Error("Cannot call `"+Z+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function uM(Z){if(!IZ(Z)||typeof Z.type!=="string")throw TypeError("Expected node, got `"+Z+"`")}function cM(Z,J,$){if(!$)throw Error("`"+Z+"` finished async. Use `"+J+"` instead")}function uQ(Z){return Lv(Z)?Z:new T8(Z)}function Lv(Z){return Boolean(Z&&typeof Z==="object"&&"message"in Z&&"messages"in Z)}function Nv(Z){return typeof Z==="string"||_v(Z)}function _v(Z){return Boolean(Z&&typeof Z==="object"&&"byteLength"in Z&&"byteOffset"in Z)}var Av="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dM=[],lM={allowDangerousHtml:!0},Mv=/^(https?|ircs?|mailto|xmpp)$/i,Dv=[{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 HW(Z){let J=Ov(Z),$=wv(Z);return Pv(J.runSync(J.parse($),$),Z)}function Ov(Z){let J=Z.rehypePlugins||dM,$=Z.remarkPlugins||dM,X=Z.remarkRehypeOptions?{...Z.remarkRehypeOptions,...lM}:lM;return GW().use(IQ).use($).use(fQ,X).use(J)}function wv(Z){let J=Z.children||"",$=new T8;if(typeof J==="string")$.value=J;else qQ("Unexpected value `"+J+"` for `children` prop, expected `string`");return $}function Pv(Z,J){let{allowedElements:$,allowElement:X,components:Q,disallowedElements:Y,skipHtml:G,unwrapDisallowed:H}=J,z=J.urlTransform||rM;for(let K of Dv)if(Object.hasOwn(J,K.from))qQ("Unexpected `"+K.from+"` prop, "+(K.to?"use `"+K.to+"` instead":"remove it")+" (see <"+Av+"#"+K.id+"> for more info)");if($&&Y)qQ("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return W2(Z,W),Sz(Z,{Fragment:C8.Fragment,components:Q,ignoreInvalidStyle:!0,jsx:C8.jsx,jsxs:C8.jsxs,passKeys:!0,passNode:!0});function W(K,q,V){if(K.type==="raw"&&V&&typeof q==="number"){if(G)V.children.splice(q,1);else V.children[q]={type:"text",value:K.value};return q}if(K.type==="element"){let U;for(U in NZ)if(Object.hasOwn(NZ,U)&&Object.hasOwn(K.properties,U)){let B=K.properties[U],F=NZ[U];if(F===null||F.includes(K.tagName))K.properties[U]=z(String(B||""),U,K)}}if(K.type==="element"){let U=$?!$.includes(K.tagName):Y?Y.includes(K.tagName):!1;if(!U&&X&&typeof q==="number")U=!X(K,q,V);if(U&&V&&typeof q==="number"){if(H&&K.children)V.children.splice(q,1,...K.children);else V.children.splice(q,1);return q}}}}function rM(Z){let J=Z.indexOf(":"),$=Z.indexOf("?"),X=Z.indexOf("#"),Q=Z.indexOf("/");if(J===-1||Q!==-1&&J>Q||$!==-1&&J>$||X!==-1&&J>X||Mv.test(Z.slice(0,J)))return Z;return""}var dQ=function(Z,J,$){let X=a9($);if(!Z||!Z.type||!Z.children)throw Error("Expected parent node");if(typeof J==="number"){if(J<0||J===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(J=Z.children.indexOf(J),J<0)throw Error("Expected child node or index");while(++J<Z.children.length)if(X(Z.children[J],J,Z))return Z.children[J];return};var K2=function(Z){if(Z===null||Z===void 0)return Cv;if(typeof Z==="string")return Tv(Z);if(typeof Z==="object")return jv(Z);if(typeof Z==="function")return zW(Z);throw Error("Expected function, string, or array as `test`")};function jv(Z){let J=[],$=-1;while(++$<Z.length)J[$]=K2(Z[$]);return zW(X);function X(...Q){let Y=-1;while(++Y<J.length)if(J[Y].apply(this,Q))return!0;return!1}}function Tv(Z){return zW(J);function J($){return $.tagName===Z}}function zW(Z){return J;function J($,X,Q){return Boolean(Sv($)&&Z.call(this,$,typeof X==="number"?X:void 0,Q||void 0))}}function Cv(Z){return Boolean(Z&&typeof Z==="object"&&"type"in Z&&Z.type==="element"&&"tagName"in Z&&typeof Z.tagName==="string")}function Sv(Z){return Z!==null&&typeof Z==="object"&&"type"in Z&&"tagName"in Z}var aM=/\n/g,sM=/[\t ]+/g,WW=K2("br"),nM=K2(xv),Iv=K2("p"),oM=K2("tr"),Ev=K2(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",bv,hv]),tM=K2(["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 KW(Z,J){let $=J||{},X="children"in Z?Z.children:[],Q=tM(Z),Y=JD(Z,{whitespace:$.whitespace||"normal",breakBefore:!1,breakAfter:!1}),G=[];if(Z.type==="text"||Z.type==="comment")G.push(...ZD(Z,{whitespace:Y,breakBefore:!0,breakAfter:!0}));let H=-1;while(++H<X.length)G.push(...eM(X[H],Z,{whitespace:Y,breakBefore:H?void 0:Q,breakAfter:H<X.length-1?WW(X[H+1]):Q}));let z=[],W;H=-1;while(++H<G.length){let K=G[H];if(typeof K==="number"){if(W!==void 0&&K>W)W=K}else if(K){if(W!==void 0&&W>-1)z.push(`
|
|
38
|
-
`.repeat(W)||" ");W=-1,z.push(K)}}return z.join("")}function eM(Z,J,$){if(Z.type==="element")return kv(Z,J,$);if(Z.type==="text")return $.whitespace==="normal"?ZD(Z,$):Rv(Z);return[]}function kv(Z,J,$){let X=JD(Z,$),Q=Z.children||[],Y=-1,G=[];if(Ev(Z))return G;let H,z;if(WW(Z))z=`
|
|
39
|
-
`;else if(oM(Z)&&dQ(J,Z,oM))z=`
|
|
40
|
-
`;else if(Iv(Z))H=2,z=2;else if(tM(Z))H=1,z=1;while(++Y<Q.length)G=G.concat(eM(Q[Y],Z,{whitespace:X,breakBefore:Y?void 0:H,breakAfter:Y<Q.length-1?WW(Q[Y+1]):z}));if(nM(Z)&&dQ(J,Z,nM))G.push("\t");if(H)G.unshift(H);if(z)G.push(z);return G}function ZD(Z,J){let $=String(Z.value),X=[],Q=[],Y=0;while(Y<=$.length){aM.lastIndex=Y;let z=aM.exec($),W=z&&"index"in z?z.index:$.length;X.push(yv($.slice(Y,W).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),Y===0?J.breakBefore:!0,W===$.length?J.breakAfter:!0)),Y=W+1}let G=-1,H;while(++G<X.length)if(X[G].charCodeAt(X[G].length-1)===8203||G<X.length-1&&X[G+1].charCodeAt(0)===8203)Q.push(X[G]),H=void 0;else if(X[G]){if(typeof H==="number")Q.push(H);Q.push(X[G]),H=0}else if(G===0||G===X.length-1)Q.push(0);return Q}function Rv(Z){return[String(Z.value)]}function yv(Z,J,$){let X=[],Q=0,Y;while(Q<Z.length){sM.lastIndex=Q;let G=sM.exec(Z);if(Y=G?G.index:Z.length,!Q&&!Y&&G&&!J)X.push("");if(Q!==Y)X.push(Z.slice(Q,Y));Q=G?Y+G[0].length:Y}if(Q!==Y&&!$)X.push("");return X.join(" ")}function JD(Z,J){if(Z.type==="element"){let $=Z.properties||{};switch(Z.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return $.wrap?"pre-wrap":"pre";case"td":case"th":return $.noWrap?"nowrap":J.whitespace;case"textarea":return"pre-wrap";default:}}return J.whitespace}function bv(Z){return Boolean((Z.properties||{}).hidden)}function xv(Z){return Z.tagName==="td"||Z.tagName==="th"}function hv(Z){return Z.tagName==="dialog"&&!(Z.properties||{}).open}function vv(Z){let J=Z.regex,$=Z.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),X="decltype\\(auto\\)",Q="[a-zA-Z_]\\w*::",Y="<[^<>]+>",G="(?!struct)(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.optional("<[^<>]+>")+")",H={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},z="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",W={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[Z.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:"."},Z.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},K={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},q={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},Z.inherit(W,{className:"string"}),{className:"string",begin:/<.*?>/},$,Z.C_BLOCK_COMMENT_MODE]},V={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE,relevance:0},U=J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE+"\\s*\\(",B=["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"],F=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],L=["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:F,keyword:B,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},D={className:"function.dispatch",relevance:0,keywords:{_hint:L},begin:J.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,Z.IDENT_RE,J.lookahead(/(<[^<>]+>|)\s*\(/))},A=[D,q,H,$,Z.C_BLOCK_COMMENT_MODE,K,W],T={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},S={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:[V],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[W,K]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[$,Z.C_BLOCK_COMMENT_MODE,W,K,H,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",$,Z.C_BLOCK_COMMENT_MODE,W,K,H]}]},H,$,Z.C_BLOCK_COMMENT_MODE,q]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,S,D,A,[q,{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:Z.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function $D(Z){let J={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"]},$=vv(Z),X=$.keywords;return X.type=[...X.type,...J.type],X.literal=[...X.literal,...J.literal],X.built_in=[...X.built_in,...J.built_in],X._hints=J._hints,$.name="Arduino",$.aliases=["ino"],$.supersetOf="cpp",$}function XD(Z){let J=Z.regex,$={},X={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[$]}]};Object.assign($,{className:"variable",variants:[{begin:J.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},X]});let Q={className:"subst",begin:/\$\(/,end:/\)/,contains:[Z.BACKSLASH_ESCAPE]},Y=Z.inherit(Z.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),G={begin:/<<-?\s*(?=\w+)/,starts:{contains:[Z.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},H={className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,$,Q]};Q.contains.push(H);let z={match:/\\"/},W={className:"string",begin:/'/,end:/'/},K={match:/\\'/},q={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},Z.NUMBER_MODE,$]},V=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],U=Z.SHEBANG({binary:`(${V.join("|")})`,relevance:10}),B={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[Z.inherit(Z.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],L={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["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:F,literal:N,built_in:[..._,...M,"set","shopt",...O,...D]},contains:[U,Z.SHEBANG(),B,q,Y,G,L,H,z,W,K,$]}}function QD(Z){let J=Z.regex,$=Z.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),X="decltype\\(auto\\)",Q="[a-zA-Z_]\\w*::",Y="<[^<>]+>",G="(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.optional("<[^<>]+>")+")",H={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},z="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",W={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[Z.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:"."},Z.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},K={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},q={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},Z.inherit(W,{className:"string"}),{className:"string",begin:/<.*?>/},$,Z.C_BLOCK_COMMENT_MODE]},V={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE,relevance:0},U=J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE+"\\s*\\(",N={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"},L=[q,H,$,Z.C_BLOCK_COMMENT_MODE,K,W],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:L.concat([{begin:/\(/,end:/\)/,keywords:N,contains:L.concat(["self"]),relevance:0}]),relevance:0},M={begin:"("+G+"[\\*&\\s]+)+"+U,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:N,relevance:0},{begin:U,returnBegin:!0,contains:[Z.inherit(V,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[$,Z.C_BLOCK_COMMENT_MODE,W,K,H,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",$,Z.C_BLOCK_COMMENT_MODE,W,K,H]}]},H,$,Z.C_BLOCK_COMMENT_MODE,q]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(_,M,L,[q,{begin:Z.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},Z.TITLE_MODE]}]),exports:{preprocessor:q,strings:W,keywords:N}}}function YD(Z){let J=Z.regex,$=Z.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),X="decltype\\(auto\\)",Q="[a-zA-Z_]\\w*::",Y="<[^<>]+>",G="(?!struct)(decltype\\(auto\\)|"+J.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+J.optional("<[^<>]+>")+")",H={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},z="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",W={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[Z.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:"."},Z.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},K={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},q={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},Z.inherit(W,{className:"string"}),{className:"string",begin:/<.*?>/},$,Z.C_BLOCK_COMMENT_MODE]},V={className:"title",begin:J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE,relevance:0},U=J.optional("[a-zA-Z_]\\w*::")+Z.IDENT_RE+"\\s*\\(",B=["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"],F=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],L=["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:F,keyword:B,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},D={className:"function.dispatch",relevance:0,keywords:{_hint:L},begin:J.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,Z.IDENT_RE,J.lookahead(/(<[^<>]+>|)\s*\(/))},A=[D,q,H,$,Z.C_BLOCK_COMMENT_MODE,K,W],T={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},S={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:[V],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[W,K]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[$,Z.C_BLOCK_COMMENT_MODE,W,K,H,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",$,Z.C_BLOCK_COMMENT_MODE,W,K,H]}]},H,$,Z.C_BLOCK_COMMENT_MODE,q]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,S,D,A,[q,{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:Z.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function GD(Z){let J=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],$=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],X=["default","false","null","true"],Q=["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"],Y=["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:Q.concat(Y),built_in:J,literal:X},H=Z.inherit(Z.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),z={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},W={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},K={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},q=Z.inherit(K,{illegal:/\n/}),V={className:"subst",begin:/\{/,end:/\}/,keywords:G},U=Z.inherit(V,{illegal:/\n/}),B={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},Z.BACKSLASH_ESCAPE,U]},F={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},V]},N=Z.inherit(F,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},U]});V.contains=[F,B,K,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,z,Z.C_BLOCK_COMMENT_MODE],U.contains=[N,B,q,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,z,Z.inherit(Z.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let L={variants:[W,F,B,K,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},_={begin:"<",end:">",contains:[{beginKeywords:"in out"},H]},M=Z.IDENT_RE+"(<"+Z.IDENT_RE+"(\\s*,\\s*"+Z.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+Z.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:G,illegal:/::/,contains:[Z.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},L,z,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},H,_,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[H,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[H,_,Z.C_LINE_COMMENT_MODE,Z.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:"("+M+"\\s+)+"+Z.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:G,contains:[{beginKeywords:$.join(" "),relevance:0},{begin:Z.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[Z.TITLE_MODE,_],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:G,relevance:0,contains:[L,z,Z.C_BLOCK_COMMENT_MODE]},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},O]}}var gv=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},mv=["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"],fv=["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"],pv=[...mv,...fv],uv=["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(),cv=["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(),dv=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),lv=["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 HD(Z){let J=Z.regex,$=gv(Z),X={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},Q="and or not only",Y=/@-?\w[\w]*(-\w+)*/,G="[a-zA-Z-][a-zA-Z0-9_-]*",H=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[$.BLOCK_COMMENT,X,$.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},$.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+cv.join("|")+")"},{begin:":(:)?("+dv.join("|")+")"}]},$.CSS_VARIABLE,{className:"attribute",begin:"\\b("+lv.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[$.BLOCK_COMMENT,$.HEXCOLOR,$.IMPORTANT,$.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}]},$.FUNCTION_DISPATCH]},{begin:J.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:Y},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:uv.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...H,$.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+pv.join("|")+")\\b"}]}}function zD(Z){let J=Z.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:J.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:J.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 WD(Z){let Y={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:Y,illegal:"</",contains:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{className:"string",variants:[Z.QUOTE_STRING_MODE,Z.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:[Z.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Y,illegal:/["']/}]}]}}function KD(Z){let J=Z.regex,$=/[_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:[Z.HASH_COMMENT_MODE,Z.QUOTE_STRING_MODE,Z.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:J.concat($,J.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function qD(Z){let J=Z.regex,$={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:Z.NUMBER_RE}]},X=Z.COMMENT();X.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let Q={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},Y={className:"literal",begin:/\bon|off|true|false|yes|no\b/},G={className:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},H={begin:/\[/,end:/\]/,contains:[X,Y,Q,G,$,"self"],relevance:0},z=/[A-Za-z0-9_-]+/,W=/"(\\"|[^"])*"/,K=/'[^']*'/,q=J.either(z,W,K),V=J.concat(q,"(\\s*\\.\\s*",q,")*",J.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[X,{className:"section",begin:/\[+/,end:/\]+/},{begin:V,className:"attr",starts:{end:/$/,contains:[X,H,Y,Q,G,$]}}]}}var S8="[0-9](_*[0-9])*",lQ=`\\.(${S8})`,iQ="[0-9a-fA-F](_*[0-9a-fA-F])*",VD={className:"number",variants:[{begin:`(\\b(${S8})((${lQ})|\\.)?|(${lQ}))[eE][+-]?(${S8})[fFdD]?\\b`},{begin:`\\b(${S8})((${lQ})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${lQ})[fFdD]?\\b`},{begin:`\\b(${S8})[fFdD]\\b`},{begin:`\\b0[xX]((${iQ})\\.?|(${iQ})?\\.(${iQ}))[pP][+-]?(${S8})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${iQ})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function UD(Z,J,$){if($===-1)return"";return Z.replace(J,(X)=>{return UD(Z,J,$-1)})}function BD(Z){let J=Z.regex,$="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",X="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+UD("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),z={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"]},W={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},K={className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[Z.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:z,illegal:/<\/|#/,contains:[Z.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[Z.BACKSLASH_ESCAPE]},Z.APOS_STRING_MODE,Z.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:[J.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:[K,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+X+"\\s+)",Z.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:z,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[W,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,VD,Z.C_BLOCK_COMMENT_MODE]},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},VD,W]}}var iv=["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"],rv=["true","false","null","undefined","NaN","Infinity"],FD=["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"],LD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ND=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],av=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],sv=[].concat(ND,FD,LD);function _D(Z){let J=Z.regex,$=(v,{after:d})=>{let w="</"+v[0].slice(1);return v.input.indexOf(w,d)!==-1},X="[A-Za-z$_][0-9A-Za-z$_]*",Q={begin:"<>",end:"</>"},Y=/<[A-Za-z0-9\\._:-]+\s*\/>/,G={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,d)=>{let w=v[0].length+v.index,z0=v.input[w];if(z0==="<"||z0===","){d.ignoreMatch();return}if(z0===">"){if(!$(v,{after:w}))d.ignoreMatch()}let G0,E=v.input.substring(w);if(G0=E.match(/^\s*=/)){d.ignoreMatch();return}if(G0=E.match(/^\s+extends\s+/)){if(G0.index===0){d.ignoreMatch();return}}}},H={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:iv,literal:rv,built_in:sv,"variable.language":av},z="[0-9](_?[0-9])*",W="\\.([0-9](_?[0-9])*)",K="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",q={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},V={className:"subst",begin:"\\$\\{",end:"\\}",keywords:H,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,V],subLanguage:"xml"}},B={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,V],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,V],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE,V]},_={className:"comment",variants:[Z.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}]}]}),Z.C_BLOCK_COMMENT_MODE,Z.C_LINE_COMMENT_MODE]},M=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,U,B,F,N,{match:/\$\d+/},q];V.contains=M.concat({begin:/\{/,end:/\}/,keywords:H,contains:["self"].concat(M)});let O=[].concat(_,V.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},T={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,J.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",J.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"}}]},S={relevance:0,match:J.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:{_:[...FD,...LD]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={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:/%/},g={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(v){return J.concat("(?!",v.join("|"),")")}let I={match:J.concat(/\b/,C([...ND,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\(/)),className:"title.function",relevance:0},y={begin:J.concat(/\./,J.lookahead(J.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},b={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+Z.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,J.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:S},illegal:/#(?![$_A-z])/,contains:[Z.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,U,B,F,N,_,{match:/\$\d+/},q,S,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+J.lookahead(":"),relevance:0},x,{begin:"("+Z.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,Z.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:Z.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:Q.begin,end:Q.end},{match:Y},{begin:G.begin,"on:begin":G.isTrulyOpeningTag,end:G.end}],subLanguage:"xml",contains:[{begin:G.begin,end:G.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+Z.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,Z.inherit(Z.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},y,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},I,g,T,b,{match:/\$[(.]/}]}}function AD(Z){let J={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},$={match:/[{}[\],:]/,className:"punctuation",relevance:0},X=["true","false","null"],Q={scope:"literal",beginKeywords:X.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:X},contains:[J,$,Z.QUOTE_STRING_MODE,Q,Z.C_NUMBER_MODE,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var I8="[0-9](_*[0-9])*",rQ=`\\.(${I8})`,aQ="[0-9a-fA-F](_*[0-9a-fA-F])*",nv={className:"number",variants:[{begin:`(\\b(${I8})((${rQ})|\\.)?|(${rQ}))[eE][+-]?(${I8})[fFdD]?\\b`},{begin:`\\b(${I8})((${rQ})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${rQ})[fFdD]?\\b`},{begin:`\\b(${I8})[fFdD]\\b`},{begin:`\\b0[xX]((${aQ})\\.?|(${aQ})?\\.(${aQ}))[pP][+-]?(${I8})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${aQ})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function MD(Z){let J={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"},$={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},X={className:"symbol",begin:Z.UNDERSCORE_IDENT_RE+"@"},Q={className:"subst",begin:/\$\{/,end:/\}/,contains:[Z.C_NUMBER_MODE]},Y={className:"variable",begin:"\\$"+Z.UNDERSCORE_IDENT_RE},G={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[Y,Q]},{begin:"'",end:"'",illegal:/\n/,contains:[Z.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[Z.BACKSLASH_ESCAPE,Y,Q]}]};Q.contains.push(G);let H={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+Z.UNDERSCORE_IDENT_RE+")?"},z={className:"meta",begin:"@"+Z.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[Z.inherit(G,{className:"string"}),"self"]}]},W=nv,K=Z.COMMENT("/\\*","\\*/",{contains:[Z.C_BLOCK_COMMENT_MODE]}),q={variants:[{className:"type",begin:Z.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},V=q;return V.variants[1].contains=[q],q.variants[1].contains=[V],{name:"Kotlin",aliases:["kt","kts"],keywords:J,contains:[Z.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),Z.C_LINE_COMMENT_MODE,K,$,X,H,z,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:J,relevance:5,contains:[{begin:Z.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[Z.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:J,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[q,Z.C_LINE_COMMENT_MODE,K],relevance:0},Z.C_LINE_COMMENT_MODE,K,H,z,G,Z.C_NUMBER_MODE]},K]},{begin:[/class|interface|trait/,/\s+/,Z.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},Z.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},H,z]},G,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
41
|
-
`},W]}}var ov=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},tv=["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"],ev=["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"],Zg=[...tv,...ev],Jg=["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(),DD=["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(),OD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$g=["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(),Xg=DD.concat(OD).sort().reverse();function wD(Z){let J=ov(Z),$=Xg,X="and or not only",Q="[\\w-]+",Y="([\\w-]+|@\\{[\\w-]+\\})",G=[],H=[],z=function(M){return{className:"string",begin:"~?"+M+".*?"+M}},W=function(M,O,D){return{className:M,begin:O,relevance:D}},K={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Jg.join(" ")},q={begin:"\\(",end:"\\)",contains:H,keywords:K,relevance:0};H.push(Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,z("'"),z('"'),J.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},J.HEXCOLOR,q,W("variable","@@?[\\w-]+",10),W("variable","@\\{[\\w-]+\\}"),W("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},J.IMPORTANT,{beginKeywords:"and not"},J.FUNCTION_DISPATCH);let V=H.concat({begin:/\{/,end:/\}/,contains:G}),U={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(H)},B={begin:Y+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$g.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:H}}]},F={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:K,returnEnd:!0,contains:H,relevance:0}},N={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:V}},L={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:Y,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,U,W("keyword","all\\b"),W("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+Zg.join("|")+")\\b",className:"selector-tag"},J.CSS_NUMBER_MODE,W("selector-tag",Y,0),W("selector-id","#"+Y),W("selector-class","\\."+Y,0),W("selector-tag","&",0),J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+DD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+OD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:V},{begin:"!important"},J.FUNCTION_DISPATCH]},_={begin:`[\\w-]+:(:)?(${$.join("|")})`,returnBegin:!0,contains:[L]};return G.push(Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,F,N,_,B,L,U,J.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:G}}function PD(Z){let X={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},Q=[Z.COMMENT("--(?!\\[=*\\[)","$"),Z.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[X],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:Z.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:Q.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[Z.inherit(Z.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:Q}].concat(Q)},Z.C_NUMBER_MODE,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[X],relevance:5}])}}function jD(Z){let J={className:"variable",variants:[{begin:"\\$\\("+Z.UNDERSCORE_IDENT_RE+"\\)",contains:[Z.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},$={className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,J]},X={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:[J,$]},Q={begin:"^"+Z.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},Y={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},G={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[J]};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:[Z.HASH_COMMENT_MODE,J,$,X,Q,Y,G]}}function TD(Z){let J=Z.regex,$={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},X={begin:"^[-\\*]{3,}",end:"$"},Q={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}]},Y={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+.-]*/,z={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:J.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}]},W={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},K={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},q=Z.inherit(W,{contains:[]}),V=Z.inherit(K,{contains:[]});W.contains.push(V),K.contains.push(q);let U=[$,z];return[W,K,q,V].forEach((L)=>{L.contains=L.contains.concat(U)}),U=U.concat(W,K),{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}]}]},$,Y,W,K,{className:"quote",begin:"^>\\s+",contains:U,end:"$"},Q,X,z,G,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function CD(Z){let J={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+"},$=/[a-zA-Z@][a-zA-Z0-9_]*/,H={"variable.language":["this","super"],$pattern:$,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"]},z={$pattern:$,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:H,illegal:"</",contains:[J,Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,Z.C_NUMBER_MODE,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[Z.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},Z.inherit(Z.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+z.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:z,contains:[Z.UNDERSCORE_TITLE_MODE]},{begin:"\\."+Z.UNDERSCORE_IDENT_RE,relevance:0}]}}function SD(Z){let J=Z.regex,$=["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"],X=/[dualxmsipngr]{0,12}/,Q={$pattern:/[\w.]+/,keyword:$.join(" ")},Y={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:Q},G={begin:/->\{/,end:/\}/},H={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},z={scope:"variable",variants:[{begin:/\$\d/},{begin:J.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[H]},W={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},K=[Z.BACKSLASH_ESCAPE,Y,z],q=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],V=(F,N,L="\\1")=>{let _=L==="\\1"?L:J.concat(L,N);return J.concat(J.concat("(?:",F,")"),N,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,L,X)},U=(F,N,L)=>{return J.concat(J.concat("(?:",F,")"),N,/(?:\\.|[^\\\/])*?/,L,X)},B=[z,Z.HASH_COMMENT_MODE,Z.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),G,{className:"string",contains:K,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:[Z.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},W,{begin:"(\\/\\/|"+Z.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[Z.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:V("s|tr|y",J.either(...q,{capture:!0}))},{begin:V("s|tr|y","\\(","\\)")},{begin:V("s|tr|y","\\[","\\]")},{begin:V("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:U("(?:m|qr)?",/\//,/\//)},{begin:U("m|qr",J.either(...q,{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:[Z.TITLE_MODE,H]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[Z.TITLE_MODE,H,W]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return Y.contains=B,G.contains=B,{name:"Perl",aliases:["pl","pm"],keywords:Q,contains:B}}function ID(Z){let J=Z.regex,$=/(?![A-Za-z0-9])(?![$])/,X=J.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,$),Q=J.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,$),Y=J.concat(/[A-Z]+/,$),G={scope:"variable",match:"\\$+"+X},H={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},z={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},W=Z.inherit(Z.APOS_STRING_MODE,{illegal:null}),K=Z.inherit(Z.QUOTE_STRING_MODE,{illegal:null,contains:Z.QUOTE_STRING_MODE.contains.concat(z)}),q={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:Z.QUOTE_STRING_MODE.contains.concat(z),"on:begin":(y,b)=>{b.data._beginMatch=y[1]||y[2]},"on:end":(y,b)=>{if(b.data._beginMatch!==y[1])b.ignoreMatch()}},V=Z.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),U=`[
|
|
42
|
-
]`,B={scope:"string",variants:[K,W,q,V]},F={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},N=["false","null","true"],L=["__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"],_=["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:L,literal:((y)=>{let b=[];return y.forEach((R)=>{if(b.push(R),R.toLowerCase()===R)b.push(R.toUpperCase());else b.push(R.toLowerCase())}),b})(N),built_in:_},D=(y)=>{return y.map((b)=>{return b.replace(/\|\d+$/,"")})},A={variants:[{match:[/new/,J.concat(`[
|
|
43
|
-
]`,"+"),J.concat("(?!",D(_).join("\\b|"),"\\b)"),Q],scope:{1:"keyword",4:"title.class"}}]},T=J.concat(X,"\\b(?!\\()"),S={variants:[{match:[J.concat(/::/,J.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[Q,J.concat(/::/,J.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[Q,J.concat("::",J.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[Q,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},k={scope:"attr",match:J.concat(X,J.lookahead(":"),J.lookahead(/(?!::)/))},P={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[k,G,S,Z.C_BLOCK_COMMENT_MODE,B,F,A]},g={relevance:0,match:[/\b/,J.concat("(?!fn\\b|function\\b|",D(L).join("\\b|"),"|",D(_).join("\\b|"),"\\b)"),X,J.concat(`[
|
|
44
|
-
]`,"*"),J.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[P]};P.contains.push(g);let C=[k,S,Z.C_BLOCK_COMMENT_MODE,B,F,A],I={begin:J.concat(/#\[\s*\\?/,J.either(Q,Y)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...C]},...C,{scope:"meta",variants:[{match:Q},{match:Y}]}]};return{case_insensitive:!1,keywords:O,contains:[I,Z.HASH_COMMENT_MODE,Z.COMMENT("//","$"),Z.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:Z.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},H,{scope:"variable.language",match:/\$this\b/},G,g,S,{match:[/const/,/\s/,X],scope:{1:"keyword",3:"variable.constant"}},A,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},Z.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",I,G,S,Z.C_BLOCK_COMMENT_MODE,B,F]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},Z.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[Z.inherit(Z.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},Z.UNDERSCORE_TITLE_MODE]},B,F]}}function ED(Z){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},Z.inherit(Z.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),Z.inherit(Z.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function kD(Z){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function RD(Z){let J=Z.regex,$=/[\p{XID_Start}_]\p{XID_Continue}*/u,X=["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:X,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"]},z={className:"meta",begin:/^(>>>|\.\.\.) /},W={className:"subst",begin:/\{/,end:/\}/,keywords:H,illegal:/#/},K={begin:/\{\{/,relevance:0},q={className:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[Z.BACKSLASH_ESCAPE,z],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[Z.BACKSLASH_ESCAPE,z],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[Z.BACKSLASH_ESCAPE,z,K,W]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[Z.BACKSLASH_ESCAPE,z,K,W]},{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:[Z.BACKSLASH_ESCAPE,K,W]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE,K,W]},Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},V="[0-9](_?[0-9])*",U="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",B=`\\b|${X.join("|")}`,F={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]?(?=${B})`},{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]?(?=${B})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${B})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${B})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${B})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${B})`}]},N={className:"comment",begin:J.lookahead(/# type:/),end:/$/,keywords:H,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},L={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:H,contains:["self",z,F,q,Z.HASH_COMMENT_MODE]}]};return W.contains=[q,F,z],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:H,illegal:/(<\/|\?)|=>/,contains:[z,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},q,N,Z.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,$],scope:{1:"keyword",3:"title.function"},contains:[L]},{variants:[{match:[/\bclass/,/\s+/,$,/\s*/,/\(\s*/,$,/\s*\)/]},{match:[/\bclass/,/\s+/,$]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[F,L,q]}]}}function yD(Z){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function bD(Z){let J=Z.regex,$=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,X=J.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]?/),Q=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,Y=J.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:$,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:[Z.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:J.lookahead(J.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:$},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),Z.HASH_COMMENT_MODE,{scope:"string",contains:[Z.BACKSLASH_ESCAPE],variants:[Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),Z.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[Q,X]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,X]},{scope:{1:"punctuation",2:"number"},match:[Y,X]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,X]}]},{scope:{3:"operator"},match:[$,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:Q},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:Y},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function xD(Z){let J=Z.regex,$="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",X=J.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),Q=J.concat(X,/(::\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]+"},z={begin:"#<",end:">"},W=[Z.COMMENT("#","$",{contains:[H]}),Z.COMMENT("^=begin","^=end",{contains:[H],relevance:10}),Z.COMMENT("^__END__",Z.MATCH_NOTHING_RE)],K={className:"subst",begin:/#\{/,end:/\}/,keywords:G},q={className:"string",contains:[Z.BACKSLASH_ESCAPE,K],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:J.concat(/<<[-~]?'?/,J.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[Z.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[Z.BACKSLASH_ESCAPE,K]})]}]},V="[1-9](_?[0-9])*|0",U="[0-9](_?[0-9])*",B={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"}]},F={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:G}]},A=[q,{variants:[{match:[/class\s+/,Q,/\s+<\s+/,Q]},{match:[/\b(class|module)\s+/,Q]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:G},{match:[/(include|extend)\s+/,Q],scope:{2:"title.class"},keywords:G},{relevance:0,match:[Q,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:X,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[F]},{begin:Z.IDENT_RE+"::"},{className:"symbol",begin:Z.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[q,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},B,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:G},{begin:"("+Z.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[Z.BACKSLASH_ESCAPE,K],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(z,W),relevance:0}].concat(z,W);K.contains=A,F.contains=A;let T="[>?]>",S="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",k="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",P=[{begin:/^\s*=>/,starts:{end:"$",contains:A}},{className:"meta.prompt",begin:"^("+T+"|"+S+"|"+k+")(?=[ ])",starts:{end:"$",keywords:G,contains:A}}];return W.unshift(z),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:G,illegal:/\/\*/,contains:[Z.SHEBANG({binary:"ruby"})].concat(P).concat(W).concat(A)}}function hD(Z){let J=Z.regex,$=/(r#)?/,X=J.concat($,Z.UNDERSCORE_IDENT_RE),Q=J.concat($,Z.IDENT_RE),Y={className:"title.function.invoke",relevance:0,begin:J.concat(/\b/,/(?!let|for|while|if|else|match\b)/,Q,J.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"],z=["true","false","Some","None","Ok","Err"],W=["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!"],K=["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:Z.IDENT_RE+"!?",type:K,keyword:H,literal:z,built_in:W},illegal:"</",contains:[Z.C_LINE_COMMENT_MODE,Z.COMMENT("/\\*","\\*/",{contains:["self"]}),Z.inherit(Z.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+/,X],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[Z.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,X],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,X,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,X],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,X],className:{1:"keyword",3:"title.class"}},{begin:Z.IDENT_RE+"::",keywords:{keyword:"Self",built_in:W,type:K}},{className:"punctuation",begin:"->"},Y]}}var Qg=(Z)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:Z.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:[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:Z.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_-]*/}}},Yg=["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"],Gg=["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"],Hg=[...Yg,...Gg],zg=["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(),Wg=["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(),Kg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),qg=["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 vD(Z){let J=Qg(Z),$=Kg,X=Wg,Q="@[a-z-]+",Y="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:[Z.C_LINE_COMMENT_MODE,Z.C_BLOCK_COMMENT_MODE,J.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Hg.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+X.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+$.join("|")+")"},H,{begin:/\(/,end:/\)/,contains:[J.CSS_NUMBER_MODE]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+qg.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:[J.BLOCK_COMMENT,H,J.HEXCOLOR,J.CSS_NUMBER_MODE,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,J.IMPORTANT,J.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:zg.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},H,Z.QUOTE_STRING_MODE,Z.APOS_STRING_MODE,J.HEXCOLOR,J.CSS_NUMBER_MODE]},J.FUNCTION_DISPATCH]}}function gD(Z){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function mD(Z){let J=Z.regex,$=Z.COMMENT("--","$"),X={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},Q={begin:/"/,end:/"/,contains:[{match:/""/}]},Y=["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"],z=["add","asc","collation","desc","final","first","last","view"],W=["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"],K=["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"],q=["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"],V=["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=K,B=[...W,...z].filter((D)=>{return!K.includes(D)}),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},L={match:J.concat(/\b/,J.either(...U),/\s*\(/),relevance:0,keywords:{built_in:U}};function _(D){return J.concat(/\b/,J.either(...D.map((A)=>{return A.replace(/\s+/,"\\s+")})),/\b/)}let M={scope:"keyword",match:_(V),relevance:0};function O(D,{exceptions:A,when:T}={}){let S=T;return A=A||[],D.map((k)=>{if(k.match(/\|\d+$/)||A.includes(k))return k;else if(S(k))return`${k}|0`;else return k})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(B,{when:(D)=>D.length<3}),literal:Y,type:H,built_in:q},contains:[{scope:"type",match:_(G)},M,L,F,X,Q,Z.C_NUMBER_MODE,Z.C_BLOCK_COMMENT_MODE,$,N]}}function cD(Z){if(!Z)return null;if(typeof Z==="string")return Z;return Z.source}function kZ(Z){return T1("(?=",Z,")")}function T1(...Z){return Z.map(($)=>cD($)).join("")}function Vg(Z){let J=Z[Z.length-1];if(typeof J==="object"&&J.constructor===Object)return Z.splice(Z.length-1,1),J;else return{}}function z7(...Z){return"("+(Vg(Z).capture?"":"?:")+Z.map((X)=>cD(X)).join("|")+")"}var UW=(Z)=>T1(/\b/,Z,/\w$/.test(Z)?/\b/:/\B/),Ug=["Protocol","Type"].map(UW),fD=["init","self"].map(UW),Bg=["Any","Self"],qW=["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"],pD=["false","nil","true"],Fg=["assignment","associativity","higherThan","left","lowerThan","none","right"],Lg=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],uD=["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"],dD=z7(/[/=\-+!*%<>&|^~?]/,/[\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]/),lD=z7(dD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),VW=T1(dD,lD,"*"),iD=z7(/[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]/),nQ=z7(iD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),s9=T1(iD,nQ,"*"),sQ=T1(/[A-Z]/,nQ,"*"),Ng=["attached","autoclosure",T1(/convention\(/,z7("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",T1(/objc\(/,s9,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],_g=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function rD(Z){let J={match:/\s+/,relevance:0},$=Z.COMMENT("/\\*","\\*/",{contains:["self"]}),X=[Z.C_LINE_COMMENT_MODE,$],Q={match:[/\./,z7(...Ug,...fD)],className:{2:"keyword"}},Y={match:T1(/\./,z7(...qW)),relevance:0},G=qW.filter((i)=>typeof i==="string").concat(["_|0"]),H=qW.filter((i)=>typeof i!=="string").concat(Bg).map(UW),z={variants:[{className:"keyword",match:z7(...H,...fD)}]},W={$pattern:z7(/\b\w+/,/#\w+/),keyword:G.concat(Lg),literal:pD},K=[Q,Y,z],q={match:T1(/\./,z7(...uD)),relevance:0},V={className:"built_in",match:T1(/\b/,z7(...uD),/(?=\()/)},U=[q,V],B={match:/->/,relevance:0},F={className:"operator",relevance:0,variants:[{match:VW},{match:`\\.(\\.|${lD})+`}]},N=[B,F],L="([0-9]_*)+",_="([0-9a-fA-F]_*)+",M={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=(i="")=>({className:"subst",variants:[{match:T1(/\\/,i,/[0\\tnr"']/)},{match:T1(/\\/,i,/u\{[0-9a-fA-F]{1,8}\}/)}]}),D=(i="")=>({className:"subst",match:T1(/\\/,i,/[\t ]*(?:[\r\n]|\r\n)/)}),A=(i="")=>({className:"subst",label:"interpol",begin:T1(/\\/,i,/\(/),end:/\)/}),T=(i="")=>({begin:T1(i,/"""/),end:T1(/"""/,i),contains:[O(i),D(i),A(i)]}),S=(i="")=>({begin:T1(i,/"/),end:T1(/"/,i),contains:[O(i),A(i)]}),k={className:"string",variants:[T(),T("#"),T("##"),T("###"),S(),S("#"),S("##"),S("###")]},P=[Z.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[Z.BACKSLASH_ESCAPE]}],g={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:P},C=(i)=>{let W0=T1(i,/\//),r=T1(/\//,i);return{begin:W0,end:r,contains:[...P,{scope:"comment",begin:`#(?!.*${r})`,end:/$/}]}},I={scope:"regexp",variants:[C("###"),C("##"),C("#"),g]},y={match:T1(/`/,s9,/`/)},b={className:"variable",match:/\$\d+/},R={className:"variable",match:`\\$${nQ}+`},x=[y,b,R],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:_g,contains:[...N,M,k]}]}},d={scope:"keyword",match:T1(/@/,z7(...Ng),kZ(z7(/\(/,/\s+/)))},w={scope:"meta",match:T1(/@/,s9)},z0=[v,d,w],G0={match:kZ(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:T1(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,nQ,"+")},{className:"type",match:sQ,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:T1(/\s+&\s+/,kZ(sQ)),relevance:0}]},E={begin:/</,end:/>/,keywords:W,contains:[...X,...K,...z0,B,G0]};G0.contains.push(E);let s={match:T1(s9,/\s*:/),keywords:"_|0",relevance:0},A0={begin:/\(/,end:/\)/,relevance:0,keywords:W,contains:["self",s,...X,I,...K,...U,...N,M,k,...x,...z0,G0]},l={begin:/</,end:/>/,keywords:"repeat each",contains:[...X,G0]},H0={begin:z7(kZ(T1(s9,/\s*:/)),kZ(T1(s9,/\s+/,s9,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:s9}]},q0={begin:/\(/,end:/\)/,keywords:W,contains:[H0,...X,...K,...N,M,k,...z0,G0,A0],endsParent:!0,illegal:/["']/},X0={match:[/(func|macro)/,/\s+/,z7(y.match,s9,VW)],className:{1:"keyword",3:"title.function"},contains:[l,q0,J],illegal:[/\[/,/%/]},Q0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[l,q0,J],illegal:/\[|%/},V0={match:[/operator/,/\s+/,VW],className:{1:"keyword",3:"title"}},p={begin:[/precedencegroup/,/\s+/,sQ],className:{1:"keyword",3:"title"},contains:[G0],keywords:[...Fg,...pD],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"}},e={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},_0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,s9,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:W,contains:[l,...K,{begin:/:/,end:/\{/,keywords:W,contains:[{scope:"title.class.inherited",match:sQ},...K],relevance:0}]};for(let i of k.variants){let W0=i.contains.find((o)=>o.label==="interpol");W0.keywords=W;let r=[...K,...U,...N,M,k,...x];W0.contains=[...r,{begin:/\(/,end:/\)/,contains:["self",...r]}]}return{name:"Swift",keywords:W,contains:[...X,X0,Q0,Z0,e,_0,V0,p,{beginKeywords:"import",end:/$/,contains:[...X],relevance:0},I,...K,...U,...N,M,k,...x,...z0,G0,A0]}}var aD=["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"],sD=["true","false","null","undefined","NaN","Infinity"],nD=["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"],oD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],eD=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ZO=[].concat(tD,nD,oD);function Ag(Z){let J=Z.regex,$=(v,{after:d})=>{let w="</"+v[0].slice(1);return v.input.indexOf(w,d)!==-1},X="[A-Za-z$_][0-9A-Za-z$_]*",Q={begin:"<>",end:"</>"},Y=/<[A-Za-z0-9\\._:-]+\s*\/>/,G={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,d)=>{let w=v[0].length+v.index,z0=v.input[w];if(z0==="<"||z0===","){d.ignoreMatch();return}if(z0===">"){if(!$(v,{after:w}))d.ignoreMatch()}let G0,E=v.input.substring(w);if(G0=E.match(/^\s*=/)){d.ignoreMatch();return}if(G0=E.match(/^\s+extends\s+/)){if(G0.index===0){d.ignoreMatch();return}}}},H={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:aD,literal:sD,built_in:ZO,"variable.language":eD},z="[0-9](_?[0-9])*",W="\\.([0-9](_?[0-9])*)",K="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",q={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},V={className:"subst",begin:"\\$\\{",end:"\\}",keywords:H,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,V],subLanguage:"xml"}},B={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,V],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[Z.BACKSLASH_ESCAPE,V],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[Z.BACKSLASH_ESCAPE,V]},_={className:"comment",variants:[Z.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}]}]}),Z.C_BLOCK_COMMENT_MODE,Z.C_LINE_COMMENT_MODE]},M=[Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,U,B,F,N,{match:/\$\d+/},q];V.contains=M.concat({begin:/\{/,end:/\}/,keywords:H,contains:["self"].concat(M)});let O=[].concat(_,V.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},T={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,J.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",J.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"}}]},S={relevance:0,match:J.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:{_:[...nD,...oD]}},k={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={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:/%/},g={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(v){return J.concat("(?!",v.join("|"),")")}let I={match:J.concat(/\b/,C([...tD,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\(/)),className:"title.function",relevance:0},y={begin:J.concat(/\./,J.lookahead(J.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},b={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+Z.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,J.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:S},illegal:/#(?![$_A-z])/,contains:[Z.SHEBANG({label:"shebang",binary:"node",relevance:5}),k,Z.APOS_STRING_MODE,Z.QUOTE_STRING_MODE,U,B,F,N,_,{match:/\$\d+/},q,S,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+J.lookahead(":"),relevance:0},x,{begin:"("+Z.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[_,Z.REGEXP_MODE,{className:"function",begin:R,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:Z.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:Q.begin,end:Q.end},{match:Y},{begin:G.begin,"on:begin":G.isTrulyOpeningTag,end:G.end}],subLanguage:"xml",contains:[{begin:G.begin,end:G.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+Z.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,Z.inherit(Z.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},y,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},I,g,T,b,{match:/\$[(.]/}]}}function JO(Z){let J=Z.regex,$=Ag(Z),X="[A-Za-z$_][0-9A-Za-z$_]*",Q=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],Y={begin:[/namespace/,/\s+/,Z.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},G={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:Q},contains:[$.exports.CLASS_REFERENCE]},H={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},z=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],W={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:aD.concat(z),literal:sD,built_in:ZO.concat(Q),"variable.language":eD},K={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},q=(F,N,L)=>{let _=F.contains.findIndex((M)=>M.label===N);if(_===-1)throw Error("can not find mode to replace");F.contains.splice(_,1,L)};Object.assign($.keywords,W),$.exports.PARAMS_CONTAINS.push(K);let V=$.contains.find((F)=>F.scope==="attr"),U=Object.assign({},V,{match:J.concat("[A-Za-z$_][0-9A-Za-z$_]*",J.lookahead(/\s*\?:/))});$.exports.PARAMS_CONTAINS.push([$.exports.CLASS_REFERENCE,V,U]),$.contains=$.contains.concat([K,Y,G,U]),q($,"shebang",Z.SHEBANG()),q($,"use_strict",H);let B=$.contains.find((F)=>F.label==="func.def");return B.relevance=0,Object.assign($,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),$}function $O(Z){let J=Z.regex,$={className:"string",begin:/"(""|[^/n])"C\b/},X={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},Q=/\d{1,2}\/\d{1,2}\/\d{4}/,Y=/\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}/,z={className:"literal",variants:[{begin:J.concat(/# */,J.either(Y,Q),/ *#/)},{begin:J.concat(/# */,H,/ *#/)},{begin:J.concat(/# */,G,/ *#/)},{begin:J.concat(/# */,J.either(Y,Q),/ +/,J.either(G,H),/ *#/)}]},W={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])|[%&])?/}]},K={className:"label",begin:/^\w+:/},q=Z.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),V=Z.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:[$,X,z,W,K,q,V,{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:[V]}]}}function XO(Z){Z.regex;let J=Z.COMMENT(/\(;/,/;\)/);J.contains.push("self");let $=Z.COMMENT(/;;/,/$/),X=["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"],Q={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},Y={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/},z={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},W={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:X},contains:[$,J,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},Y,G,Q,Z.QUOTE_STRING_MODE,z,W,H]}}function QO(Z){let J=Z.regex,$=J.concat(/[\p{L}_]/u,J.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),X=/[\p{L}0-9._:-]+/u,Q={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},Y={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},G=Z.inherit(Y,{begin:/\(/,end:/\)/}),H=Z.inherit(Z.APOS_STRING_MODE,{className:"string"}),z=Z.inherit(Z.QUOTE_STRING_MODE,{className:"string"}),W={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:X,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[Q]},{begin:/'/,end:/'/,contains:[Q]},{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:[Y,z,H,G,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[Y,G,z,H]}]}]},Z.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},Q,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[z]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[W],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[W],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:J.concat(/</,J.lookahead(J.concat($,J.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:$,relevance:0,starts:W}]},{className:"tag",begin:J.concat(/<\//,J.lookahead(J.concat($,/>/))),contains:[{className:"name",begin:$,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function YO(Z){let X={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},Q={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},Y={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},G={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[Z.BACKSLASH_ESCAPE,Q]},H=Z.inherit(G,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),z="[0-9]{4}(-[0-9][0-9]){0,2}",W="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",K="(\\.[0-9]*)?",q="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",V={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},B={begin:/\{/,end:/\}/,contains:[U],illegal:"\\n",relevance:0},F={begin:"\\[",end:"\\]",contains:[U],illegal:"\\n",relevance:0},N=[X,{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:"&"+Z.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+Z.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},Z.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},V,{className:"number",begin:Z.C_NUMBER_RE+"\\b",relevance:0},B,F,Y,G],L=[...N];return L.pop(),L.push(H),U.contains=L,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}var BW={arduino:$D,bash:XD,c:QD,cpp:YD,csharp:GD,css:HD,diff:zD,go:WD,graphql:KD,ini:qD,java:BD,javascript:_D,json:AD,kotlin:MD,less:wD,lua:PD,makefile:jD,markdown:TD,objectivec:CD,perl:SD,php:ID,"php-template":ED,plaintext:kD,python:RD,"python-repl":yD,r:bD,ruby:xD,rust:hD,scss:vD,shell:gD,sql:mD,swift:rD,typescript:JO,vbnet:$O,wasm:XO,xml:QO,yaml:YO};var IO=j(SO(),1);var EO=IO.default;var kO={},Wm="hljs-";function DW(Z){let J=EO.newInstance();if(Z)Y(Z);return{highlight:$,highlightAuto:X,listLanguages:Q,register:Y,registerAlias:G,registered:H};function $(z,W,K){U1(typeof z==="string","expected `string` as `name`"),U1(typeof W==="string","expected `string` as `value`");let q=K||kO,V=typeof q.prefix==="string"?q.prefix:Wm;if(!J.getLanguage(z))throw Error("Unknown language: `"+z+"` is not registered");J.configure({__emitter:RO,classPrefix:V});let U=J.highlight(W,{ignoreIllegals:!0,language:z});if(U.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:U.errorRaised});let B=U._emitter.root,F=B.data;return F.language=U.language,F.relevance=U.relevance,B}function X(z,W){U1(typeof z==="string","expected `string` as `value`");let q=(W||kO).subset||Q(),V=-1,U=0,B;while(++V<q.length){let F=q[V];if(!J.getLanguage(F))continue;let N=$(F,z,W);if(N.data&&N.data.relevance!==void 0&&N.data.relevance>U)U=N.data.relevance,B=N}return B||{type:"root",children:[],data:{language:void 0,relevance:U}}}function Q(){return J.listLanguages()}function Y(z,W){if(typeof z==="string")U1(W!==void 0,"expected `grammar`"),J.registerLanguage(z,W);else{let K;for(K in z)if(Object.hasOwn(z,K))J.registerLanguage(K,z[K])}}function G(z,W){if(typeof z==="string")U1(W!==void 0),J.registerAliases(typeof W==="string"?W:[...W],{languageName:z});else{let K;for(K in z)if(Object.hasOwn(z,K)){let q=z[K];J.registerAliases(typeof q==="string"?q:[...q],{languageName:K})}}}function H(z){return Boolean(J.getLanguage(z))}}class RO{constructor(Z){this.options=Z,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(Z){if(Z==="")return;let J=this.stack[this.stack.length-1],$=J.children[J.children.length-1];if($&&$.type==="text")$.value+=Z;else J.children.push({type:"text",value:Z})}startScope(Z){this.openNode(String(Z))}endScope(){this.closeNode()}__addSublanguage(Z,J){let $=this.stack[this.stack.length-1],X=Z.root.children;if(J)$.children.push({type:"element",tagName:"span",properties:{className:[J]},children:X});else $.children.push(...X)}openNode(Z){let J=this,$=Z.split(".").map(function(Y,G){return G?Y+"_".repeat(G):J.options.classPrefix+Y}),X=this.stack[this.stack.length-1],Q={type:"element",tagName:"span",properties:{className:$},children:[]};X.children.push(Q),this.stack.push(Q)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var Km={};function ZY(Z){let J=Z||Km,$=J.aliases,X=J.detect||!1,Q=J.languages||BW,Y=J.plainText,G=J.prefix,H=J.subset,z="hljs",W=DW(Q);if($)W.registerAlias($);if(G){let K=G.indexOf("-");z=K===-1?G:G.slice(0,K)}return function(K,q){W2(K,"element",function(V,U,B){if(V.tagName!=="code"||!B||B.type!=="element"||B.tagName!=="pre")return;let F=qm(V);if(F===!1||!F&&!X||F&&Y&&Y.includes(F))return;if(!Array.isArray(V.properties.className))V.properties.className=[];if(!V.properties.className.includes(z))V.properties.className.unshift(z);let N=KW(V,{whitespace:"pre"}),L;try{L=F?W.highlight(F,N,{prefix:G}):W.highlightAuto(N,{prefix:G,subset:H})}catch(_){let M=_;if(F&&/Unknown language/.test(M.message)){q.message("Cannot highlight as `"+F+"`, it’s not registered",{ancestors:[B,V],cause:M,place:V.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw M}if(!F&&L.data&&L.data.language)V.properties.className.push("language-"+L.data.language);if(L.children.length>0)V.children=L.children})}}function qm(Z){let J=Z.properties.className,$=-1;if(!Array.isArray(J))return;let X;while(++$<J.length){let Q=String(J[$]);if(Q==="no-highlight"||Q==="nohighlight")return!1;if(!X&&Q.slice(0,5)==="lang-")X=Q.slice(5);if(!X&&Q.slice(0,9)==="language-")X=Q.slice(9)}return X}function OW(Z,J){let $=String(Z);if(typeof J!=="string")throw TypeError("Expected character");let X=0,Q=$.indexOf(J);while(Q!==-1)X++,Q=$.indexOf(J,Q+J.length);return X}function wW(Z){if(typeof Z!=="string")throw TypeError("Expected a string");return Z.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function PW(Z,J,$){let Q=a9(($||{}).ignore||[]),Y=Vm(J),G=-1;while(++G<Y.length)SZ(Z,"text",H);function H(W,K){let q=-1,V;while(++q<K.length){let U=K[q],B=V?V.children:void 0;if(Q(U,B?B.indexOf(U):void 0,V))return;V=U}if(V)return z(W,K)}function z(W,K){let q=K[K.length-1],V=Y[G][0],U=Y[G][1],B=0,N=q.children.indexOf(W),L=!1,_=[];V.lastIndex=0;let M=V.exec(W.value);while(M){let O=M.index,D={index:M.index,input:M.input,stack:[...K,W]},A=U(...M,D);if(typeof A==="string")A=A.length>0?{type:"text",value:A}:void 0;if(A===!1)V.lastIndex=O+1;else{if(B!==O)_.push({type:"text",value:W.value.slice(B,O)});if(Array.isArray(A))_.push(...A);else if(A)_.push(A);B=O+M[0].length,L=!0}if(!V.global)break;M=V.exec(W.value)}if(L){if(B<W.value.length)_.push({type:"text",value:W.value.slice(B)});q.children.splice(N,1,..._)}else _=[W];return N+_.length}}function Vm(Z){let J=[];if(!Array.isArray(Z))throw TypeError("Expected find and replace tuple or list of tuples");let $=!Z[0]||Array.isArray(Z[0])?Z:[Z],X=-1;while(++X<$.length){let Q=$[X];J.push([Um(Q[0]),Bm(Q[1])])}return J}function Um(Z){return typeof Z==="string"?new RegExp(wW(Z),"g"):Z}function Bm(Z){return typeof Z==="function"?Z:function(){return Z}}var jW="phrasing",TW=["autolink","link","image","label"];function SW(){return{transforms:[Mm],enter:{literalAutolink:Fm,literalAutolinkEmail:CW,literalAutolinkHttp:CW,literalAutolinkWww:CW},exit:{literalAutolink:Am,literalAutolinkEmail:_m,literalAutolinkHttp:Lm,literalAutolinkWww:Nm}}}function IW(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:jW,notInConstruct:TW},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:jW,notInConstruct:TW},{character:":",before:"[ps]",after:"\\/",inConstruct:jW,notInConstruct:TW}]}}function Fm(Z){this.enter({type:"link",title:null,url:"",children:[]},Z)}function CW(Z){this.config.enter.autolinkProtocol.call(this,Z)}function Lm(Z){this.config.exit.autolinkProtocol.call(this,Z)}function Nm(Z){this.config.exit.data.call(this,Z);let J=this.stack[this.stack.length-1];U1(J.type==="link"),J.url="http://"+this.sliceSerialize(Z)}function _m(Z){this.config.exit.autolinkEmail.call(this,Z)}function Am(Z){this.exit(Z)}function Mm(Z){PW(Z,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Dm],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Om]],{ignore:["link","linkReference"]})}function Dm(Z,J,$,X,Q){let Y="";if(!yO(Q))return!1;if(/^w/i.test(J))$=J+$,J="",Y="http://";if(!wm($))return!1;let G=Pm($+X);if(!G[0])return!1;let H={type:"link",title:null,url:Y+J+G[0],children:[{type:"text",value:J+G[0]}]};if(G[1])return[H,{type:"text",value:G[1]}];return H}function Om(Z,J,$,X){if(!yO(X,!0)||/[-\d_]$/.test($))return!1;return{type:"link",title:null,url:"mailto:"+J+"@"+$,children:[{type:"text",value:J+"@"+$}]}}function wm(Z){let J=Z.split(".");if(J.length<2||J[J.length-1]&&(/_/.test(J[J.length-1])||!/[a-zA-Z\d]/.test(J[J.length-1]))||J[J.length-2]&&(/_/.test(J[J.length-2])||!/[a-zA-Z\d]/.test(J[J.length-2])))return!1;return!0}function Pm(Z){let J=/[!"&'),.:;<>?\]}]+$/.exec(Z);if(!J)return[Z,void 0];Z=Z.slice(0,J.index);let $=J[0],X=$.indexOf(")"),Q=OW(Z,"("),Y=OW(Z,")");while(X!==-1&&Q>Y)Z+=$.slice(0,X+1),$=$.slice(X+1),X=$.indexOf(")"),Y++;return[Z,$]}function yO(Z,J){let $=Z.input.charCodeAt(Z.index-1);return(Z.index===0||i9($)||n4($))&&(!J||$!==47)}bO.peek=ym;function jm(){this.buffer()}function Tm(Z){this.enter({type:"footnoteReference",identifier:"",label:""},Z)}function Cm(){this.buffer()}function Sm(Z){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},Z)}function Im(Z){let J=this.resume(),$=this.stack[this.stack.length-1];U1($.type==="footnoteReference"),$.identifier=o5(this.sliceSerialize(Z)).toLowerCase(),$.label=J}function Em(Z){this.exit(Z)}function km(Z){let J=this.resume(),$=this.stack[this.stack.length-1];U1($.type==="footnoteDefinition"),$.identifier=o5(this.sliceSerialize(Z)).toLowerCase(),$.label=J}function Rm(Z){this.exit(Z)}function ym(){return"["}function bO(Z,J,$,X){let Q=$.createTracker(X),Y=Q.move("[^"),G=$.enter("footnoteReference"),H=$.enter("reference");return Y+=Q.move($.safe($.associationId(Z),{after:"]",before:Y})),H(),G(),Y+=Q.move("]"),Y}function EW(){return{enter:{gfmFootnoteCallString:jm,gfmFootnoteCall:Tm,gfmFootnoteDefinitionLabelString:Cm,gfmFootnoteDefinition:Sm},exit:{gfmFootnoteCallString:Im,gfmFootnoteCall:Em,gfmFootnoteDefinitionLabelString:km,gfmFootnoteDefinition:Rm}}}function kW(Z){let J=!1;if(Z&&Z.firstLineBlank)J=!0;return{handlers:{footnoteDefinition:$,footnoteReference:bO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function $(X,Q,Y,G){let H=Y.createTracker(G),z=H.move("[^"),W=Y.enter("footnoteDefinition"),K=Y.enter("label");if(z+=H.move(Y.safe(Y.associationId(X),{before:z,after:"]"})),K(),z+=H.move("]:"),X.children&&X.children.length>0)H.shift(4),z+=H.move((J?`
|
|
45
|
-
`:" ")+Y.indentLines(Y.containerFlow(X,H.current()),J?xO:bm));return W(),z}}function bm(Z,J,$){return J===0?Z:xO(Z,J,$)}function xO(Z,J,$){return($?"":" ")+Z}var xm=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];hO.peek=gm;function RW(){return{canContainEols:["delete"],enter:{strikethrough:hm},exit:{strikethrough:vm}}}function yW(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xm}],handlers:{delete:hO}}}function hm(Z){this.enter({type:"delete",children:[]},Z)}function vm(Z){this.exit(Z)}function hO(Z,J,$,X){let Q=$.createTracker(X),Y=$.enter("strikethrough"),G=Q.move("~~");return G+=$.containerPhrasing(Z,{...Q.current(),before:G,after:"~"}),G+=Q.move("~~"),Y(),G}function gm(){return"~"}function mm(Z){return Z.length}function gO(Z,J){let $=J||{},X=($.align||[]).concat(),Q=$.stringLength||mm,Y=[],G=[],H=[],z=[],W=0,K=-1;while(++K<Z.length){let F=[],N=[],L=-1;if(Z[K].length>W)W=Z[K].length;while(++L<Z[K].length){let _=fm(Z[K][L]);if($.alignDelimiters!==!1){let M=Q(_);if(N[L]=M,z[L]===void 0||M>z[L])z[L]=M}F.push(_)}G[K]=F,H[K]=N}let q=-1;if(typeof X==="object"&&"length"in X)while(++q<W)Y[q]=vO(X[q]);else{let F=vO(X);while(++q<W)Y[q]=F}q=-1;let V=[],U=[];while(++q<W){let F=Y[q],N="",L="";if(F===99)N=":",L=":";else if(F===108)N=":";else if(F===114)L=":";let _=$.alignDelimiters===!1?1:Math.max(1,z[q]-N.length-L.length),M=N+"-".repeat(_)+L;if($.alignDelimiters!==!1){if(_=N.length+_+L.length,_>z[q])z[q]=_;U[q]=_}V[q]=M}G.splice(1,0,V),H.splice(1,0,U),K=-1;let B=[];while(++K<G.length){let F=G[K],N=H[K];q=-1;let L=[];while(++q<W){let _=F[q]||"",M="",O="";if($.alignDelimiters!==!1){let D=z[q]-(N[q]||0),A=Y[q];if(A===114)M=" ".repeat(D);else if(A===99)if(D%2)M=" ".repeat(D/2+0.5),O=" ".repeat(D/2-0.5);else M=" ".repeat(D/2),O=M;else O=" ".repeat(D)}if($.delimiterStart!==!1&&!q)L.push("|");if($.padding!==!1&&!($.alignDelimiters===!1&&_==="")&&($.delimiterStart!==!1||q))L.push(" ");if($.alignDelimiters!==!1)L.push(M);if(L.push(_),$.alignDelimiters!==!1)L.push(O);if($.padding!==!1)L.push(" ");if($.delimiterEnd!==!1||q!==W-1)L.push("|")}B.push($.delimiterEnd===!1?L.join("").replace(/ +$/,""):L.join(""))}return B.join(`
|
|
46
|
-
`)}function fm(Z){return Z===null||Z===void 0?"":String(Z)}function vO(Z){let J=typeof Z==="string"?Z.codePointAt(0):0;return J===67||J===99?99:J===76||J===108?108:J===82||J===114?114:0}function mO(Z,J,$,X){let Q=$.enter("blockquote"),Y=$.createTracker(X);Y.move("> "),Y.shift(2);let G=$.indentLines($.containerFlow(Z,Y.current()),pm);return Q(),G}function pm(Z,J,$){return">"+($?"":" ")+Z}function pO(Z,J){return fO(Z,J.inConstruct,!0)&&!fO(Z,J.notInConstruct,!1)}function fO(Z,J,$){if(typeof J==="string")J=[J];if(!J||J.length===0)return $;let X=-1;while(++X<J.length)if(Z.includes(J[X]))return!0;return!1}function bW(Z,J,$,X){let Q=-1;while(++Q<$.unsafe.length)if($.unsafe[Q].character===`
|
|
47
|
-
`&&pO($.stack,$.unsafe[Q]))return/[ \t]/.test(X.before)?"":" ";return"\\\n"}function uO(Z,J){let $=String(Z),X=$.indexOf(J),Q=X,Y=0,G=0;if(typeof J!=="string")throw TypeError("Expected substring");while(X!==-1){if(X===Q){if(++Y>G)G=Y}else Y=1;Q=X+J.length,X=$.indexOf(J,Q)}return G}function cO(Z,J){return Boolean(J.options.fences===!1&&Z.value&&!Z.lang&&/[^ \r\n]/.test(Z.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(Z.value))}function dO(Z){let J=Z.options.fence||"`";if(J!=="`"&&J!=="~")throw Error("Cannot serialize code with `"+J+"` for `options.fence`, expected `` ` `` or `~`");return J}function lO(Z,J,$,X){let Q=dO($),Y=Z.value||"",G=Q==="`"?"GraveAccent":"Tilde";if(cO(Z,$)){let q=$.enter("codeIndented"),V=$.indentLines(Y,um);return q(),V}let H=$.createTracker(X),z=Q.repeat(Math.max(uO(Y,Q)+1,3)),W=$.enter("codeFenced"),K=H.move(z);if(Z.lang){let q=$.enter(`codeFencedLang${G}`);K+=H.move($.safe(Z.lang,{before:K,after:" ",encode:["`"],...H.current()})),q()}if(Z.lang&&Z.meta){let q=$.enter(`codeFencedMeta${G}`);K+=H.move(" "),K+=H.move($.safe(Z.meta,{before:K,after:`
|
|
48
|
-
`,encode:["`"],...H.current()})),q()}if(K+=H.move(`
|
|
49
|
-
`),Y)K+=H.move(Y+`
|
|
50
|
-
`);return K+=H.move(z),W(),K}function um(Z,J,$){return($?"":" ")+Z}function R8(Z){let J=Z.options.quote||'"';if(J!=='"'&&J!=="'")throw Error("Cannot serialize title with `"+J+"` for `options.quote`, expected `\"`, or `'`");return J}function iO(Z,J,$,X){let Q=R8($),Y=Q==='"'?"Quote":"Apostrophe",G=$.enter("definition"),H=$.enter("label"),z=$.createTracker(X),W=z.move("[");if(W+=z.move($.safe($.associationId(Z),{before:W,after:"]",...z.current()})),W+=z.move("]: "),H(),!Z.url||/[\0- \u007F]/.test(Z.url))H=$.enter("destinationLiteral"),W+=z.move("<"),W+=z.move($.safe(Z.url,{before:W,after:">",...z.current()})),W+=z.move(">");else H=$.enter("destinationRaw"),W+=z.move($.safe(Z.url,{before:W,after:Z.title?" ":`
|
|
51
|
-
`,...z.current()}));if(H(),Z.title)H=$.enter(`title${Y}`),W+=z.move(" "+Q),W+=z.move($.safe(Z.title,{before:W,after:Q,...z.current()})),W+=z.move(Q),H();return G(),W}function rO(Z){let J=Z.options.emphasis||"*";if(J!=="*"&&J!=="_")throw Error("Cannot serialize emphasis with `"+J+"` for `options.emphasis`, expected `*`, or `_`");return J}function t2(Z){return"&#x"+Z.toString(16).toUpperCase()+";"}function y8(Z,J,$){let X=z2(Z),Q=z2(J);if(X===void 0)return Q===void 0?$==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:Q===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(X===1)return Q===void 0?{inside:!1,outside:!1}:Q===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return Q===void 0?{inside:!1,outside:!1}:Q===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}xW.peek=cm;function xW(Z,J,$,X){let Q=rO($),Y=$.enter("emphasis"),G=$.createTracker(X),H=G.move(Q),z=G.move($.containerPhrasing(Z,{after:Q,before:H,...G.current()})),W=z.charCodeAt(0),K=y8(X.before.charCodeAt(X.before.length-1),W,Q);if(K.inside)z=t2(W)+z.slice(1);let q=z.charCodeAt(z.length-1),V=y8(X.after.charCodeAt(0),q,Q);if(V.inside)z=z.slice(0,-1)+t2(q);let U=G.move(Q);return Y(),$.attentionEncodeSurroundingInfo={after:V.outside,before:K.outside},H+z+U}function cm(Z,J,$){return $.options.emphasis||"*"}function aO(Z,J){let $=!1;return W2(Z,function(X){if("value"in X&&/\r?\n|\r/.test(X.value)||X.type==="break")return $=!0,J6}),Boolean((!Z.depth||Z.depth<3)&&a4(Z)&&(J.options.setext||$))}function sO(Z,J,$,X){let Q=Math.max(Math.min(6,Z.depth||1),1),Y=$.createTracker(X);if(aO(Z,$)){let K=$.enter("headingSetext"),q=$.enter("phrasing"),V=$.containerPhrasing(Z,{...Y.current(),before:`
|
|
52
|
-
`,after:`
|
|
53
|
-
`});return q(),K(),V+`
|
|
54
|
-
`+(Q===1?"=":"-").repeat(V.length-(Math.max(V.lastIndexOf("\r"),V.lastIndexOf(`
|
|
55
|
-
`))+1))}let G="#".repeat(Q),H=$.enter("headingAtx"),z=$.enter("phrasing");Y.move(G+" ");let W=$.containerPhrasing(Z,{before:"# ",after:`
|
|
56
|
-
`,...Y.current()});if(/^[\t ]/.test(W))W=t2(W.charCodeAt(0))+W.slice(1);if(W=W?G+" "+W:G,$.options.closeAtx)W+=" "+G;return z(),H(),W}hW.peek=dm;function hW(Z){return Z.value||""}function dm(){return"<"}vW.peek=lm;function vW(Z,J,$,X){let Q=R8($),Y=Q==='"'?"Quote":"Apostrophe",G=$.enter("image"),H=$.enter("label"),z=$.createTracker(X),W=z.move("![");if(W+=z.move($.safe(Z.alt,{before:W,after:"]",...z.current()})),W+=z.move("]("),H(),!Z.url&&Z.title||/[\0- \u007F]/.test(Z.url))H=$.enter("destinationLiteral"),W+=z.move("<"),W+=z.move($.safe(Z.url,{before:W,after:">",...z.current()})),W+=z.move(">");else H=$.enter("destinationRaw"),W+=z.move($.safe(Z.url,{before:W,after:Z.title?" ":")",...z.current()}));if(H(),Z.title)H=$.enter(`title${Y}`),W+=z.move(" "+Q),W+=z.move($.safe(Z.title,{before:W,after:Q,...z.current()})),W+=z.move(Q),H();return W+=z.move(")"),G(),W}function lm(){return"!"}gW.peek=im;function gW(Z,J,$,X){let Q=Z.referenceType,Y=$.enter("imageReference"),G=$.enter("label"),H=$.createTracker(X),z=H.move("!["),W=$.safe(Z.alt,{before:z,after:"]",...H.current()});z+=H.move(W+"]["),G();let K=$.stack;$.stack=[],G=$.enter("reference");let q=$.safe($.associationId(Z),{before:z,after:"]",...H.current()});if(G(),$.stack=K,Y(),Q==="full"||!W||W!==q)z+=H.move(q+"]");else if(Q==="shortcut")z=z.slice(0,-1);else z+=H.move("]");return z}function im(){return"!"}mW.peek=rm;function mW(Z,J,$){let X=Z.value||"",Q="`",Y=-1;while(new RegExp("(^|[^`])"+Q+"([^`]|$)").test(X))Q+="`";if(/[^ \r\n]/.test(X)&&(/^[ \r\n]/.test(X)&&/[ \r\n]$/.test(X)||/^`|`$/.test(X)))X=" "+X+" ";while(++Y<$.unsafe.length){let G=$.unsafe[Y],H=$.compilePattern(G),z;if(!G.atBreak)continue;while(z=H.exec(X)){let W=z.index;if(X.charCodeAt(W)===10&&X.charCodeAt(W-1)===13)W--;X=X.slice(0,W)+" "+X.slice(z.index+1)}}return Q+X+Q}function rm(){return"`"}function fW(Z,J){let $=a4(Z);return Boolean(!J.options.resourceLink&&Z.url&&!Z.title&&Z.children&&Z.children.length===1&&Z.children[0].type==="text"&&($===Z.url||"mailto:"+$===Z.url)&&/^[a-z][a-z+.-]+:/i.test(Z.url)&&!/[\0- <>\u007F]/.test(Z.url))}pW.peek=am;function pW(Z,J,$,X){let Q=R8($),Y=Q==='"'?"Quote":"Apostrophe",G=$.createTracker(X),H,z;if(fW(Z,$)){let K=$.stack;$.stack=[],H=$.enter("autolink");let q=G.move("<");return q+=G.move($.containerPhrasing(Z,{before:q,after:">",...G.current()})),q+=G.move(">"),H(),$.stack=K,q}H=$.enter("link"),z=$.enter("label");let W=G.move("[");if(W+=G.move($.containerPhrasing(Z,{before:W,after:"](",...G.current()})),W+=G.move("]("),z(),!Z.url&&Z.title||/[\0- \u007F]/.test(Z.url))z=$.enter("destinationLiteral"),W+=G.move("<"),W+=G.move($.safe(Z.url,{before:W,after:">",...G.current()})),W+=G.move(">");else z=$.enter("destinationRaw"),W+=G.move($.safe(Z.url,{before:W,after:Z.title?" ":")",...G.current()}));if(z(),Z.title)z=$.enter(`title${Y}`),W+=G.move(" "+Q),W+=G.move($.safe(Z.title,{before:W,after:Q,...G.current()})),W+=G.move(Q),z();return W+=G.move(")"),H(),W}function am(Z,J,$){return fW(Z,$)?"<":"["}uW.peek=sm;function uW(Z,J,$,X){let Q=Z.referenceType,Y=$.enter("linkReference"),G=$.enter("label"),H=$.createTracker(X),z=H.move("["),W=$.containerPhrasing(Z,{before:z,after:"]",...H.current()});z+=H.move(W+"]["),G();let K=$.stack;$.stack=[],G=$.enter("reference");let q=$.safe($.associationId(Z),{before:z,after:"]",...H.current()});if(G(),$.stack=K,Y(),Q==="full"||!W||W!==q)z+=H.move(q+"]");else if(Q==="shortcut")z=z.slice(0,-1);else z+=H.move("]");return z}function sm(){return"["}function b8(Z){let J=Z.options.bullet||"*";if(J!=="*"&&J!=="+"&&J!=="-")throw Error("Cannot serialize items with `"+J+"` for `options.bullet`, expected `*`, `+`, or `-`");return J}function nO(Z){let J=b8(Z),$=Z.options.bulletOther;if(!$)return J==="*"?"-":"*";if($!=="*"&&$!=="+"&&$!=="-")throw Error("Cannot serialize items with `"+$+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if($===J)throw Error("Expected `bullet` (`"+J+"`) and `bulletOther` (`"+$+"`) to be different");return $}function oO(Z){let J=Z.options.bulletOrdered||".";if(J!=="."&&J!==")")throw Error("Cannot serialize items with `"+J+"` for `options.bulletOrdered`, expected `.` or `)`");return J}function JY(Z){let J=Z.options.rule||"*";if(J!=="*"&&J!=="-"&&J!=="_")throw Error("Cannot serialize rules with `"+J+"` for `options.rule`, expected `*`, `-`, or `_`");return J}function tO(Z,J,$,X){let Q=$.enter("list"),Y=$.bulletCurrent,G=Z.ordered?oO($):b8($),H=Z.ordered?G==="."?")":".":nO($),z=J&&$.bulletLastUsed?G===$.bulletLastUsed:!1;if(!Z.ordered){let K=Z.children?Z.children[0]:void 0;if((G==="*"||G==="-")&&K&&(!K.children||!K.children[0])&&$.stack[$.stack.length-1]==="list"&&$.stack[$.stack.length-2]==="listItem"&&$.stack[$.stack.length-3]==="list"&&$.stack[$.stack.length-4]==="listItem"&&$.indexStack[$.indexStack.length-1]===0&&$.indexStack[$.indexStack.length-2]===0&&$.indexStack[$.indexStack.length-3]===0)z=!0;if(JY($)===G&&K){let q=-1;while(++q<Z.children.length){let V=Z.children[q];if(V&&V.type==="listItem"&&V.children&&V.children[0]&&V.children[0].type==="thematicBreak"){z=!0;break}}}}if(z)G=H;$.bulletCurrent=G;let W=$.containerFlow(Z,X);return $.bulletLastUsed=G,$.bulletCurrent=Y,Q(),W}function eO(Z){let J=Z.options.listItemIndent||"one";if(J!=="tab"&&J!=="one"&&J!=="mixed")throw Error("Cannot serialize items with `"+J+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return J}function Zw(Z,J,$,X){let Q=eO($),Y=$.bulletCurrent||b8($);if(J&&J.type==="list"&&J.ordered)Y=(typeof J.start==="number"&&J.start>-1?J.start:1)+($.options.incrementListMarker===!1?0:J.children.indexOf(Z))+Y;let G=Y.length+1;if(Q==="tab"||Q==="mixed"&&(J&&J.type==="list"&&J.spread||Z.spread))G=Math.ceil(G/4)*4;let H=$.createTracker(X);H.move(Y+" ".repeat(G-Y.length)),H.shift(G);let z=$.enter("listItem"),W=$.indentLines($.containerFlow(Z,H.current()),K);return z(),W;function K(q,V,U){if(V)return(U?"":" ".repeat(G))+q;return(U?Y:Y+" ".repeat(G-Y.length))+q}}function Jw(Z,J,$,X){let Q=$.enter("paragraph"),Y=$.enter("phrasing"),G=$.containerPhrasing(Z,X);return Y(),Q(),G}var cW=a9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $w(Z,J,$,X){return(Z.children.some(function(G){return cW(G)})?$.containerPhrasing:$.containerFlow).call($,Z,X)}function Xw(Z){let J=Z.options.strong||"*";if(J!=="*"&&J!=="_")throw Error("Cannot serialize strong with `"+J+"` for `options.strong`, expected `*`, or `_`");return J}dW.peek=nm;function dW(Z,J,$,X){let Q=Xw($),Y=$.enter("strong"),G=$.createTracker(X),H=G.move(Q+Q),z=G.move($.containerPhrasing(Z,{after:Q,before:H,...G.current()})),W=z.charCodeAt(0),K=y8(X.before.charCodeAt(X.before.length-1),W,Q);if(K.inside)z=t2(W)+z.slice(1);let q=z.charCodeAt(z.length-1),V=y8(X.after.charCodeAt(0),q,Q);if(V.inside)z=z.slice(0,-1)+t2(q);let U=G.move(Q+Q);return Y(),$.attentionEncodeSurroundingInfo={after:V.outside,before:K.outside},H+z+U}function nm(Z,J,$){return $.options.strong||"*"}function Qw(Z,J,$,X){return $.safe(Z.value,X)}function Yw(Z){let J=Z.options.ruleRepetition||3;if(J<3)throw Error("Cannot serialize rules with repetition `"+J+"` for `options.ruleRepetition`, expected `3` or more");return J}function Gw(Z,J,$){let X=(JY($)+($.options.ruleSpaces?" ":"")).repeat(Yw($));return $.options.ruleSpaces?X.slice(0,-1):X}var bZ={blockquote:mO,break:bW,code:lO,definition:iO,emphasis:xW,hardBreak:bW,heading:sO,html:hW,image:vW,imageReference:gW,inlineCode:mW,link:pW,linkReference:uW,list:tO,listItem:Zw,paragraph:Jw,root:$w,strong:dW,text:Qw,thematicBreak:Gw};function iW(){return{enter:{table:om,tableData:Hw,tableHeader:Hw,tableRow:em},exit:{codeText:Zf,table:tm,tableData:lW,tableHeader:lW,tableRow:lW}}}function om(Z){let J=Z._align;U1(J,"expected `_align` on table"),this.enter({type:"table",align:J.map(function($){return $==="none"?null:$}),children:[]},Z),this.data.inTable=!0}function tm(Z){this.exit(Z),this.data.inTable=void 0}function em(Z){this.enter({type:"tableRow",children:[]},Z)}function lW(Z){this.exit(Z)}function Hw(Z){this.enter({type:"tableCell",children:[]},Z)}function Zf(Z){let J=this.resume();if(this.data.inTable)J=J.replace(/\\([\\|])/g,Jf);let $=this.stack[this.stack.length-1];U1($.type==="inlineCode"),$.value=J,this.exit(Z)}function Jf(Z,J){return J==="|"?J:Z}function rW(Z){let J=Z||{},$=J.tableCellPadding,X=J.tablePipeAlign,Q=J.stringLength,Y=$?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
57
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:V,table:G,tableCell:z,tableRow:H}};function G(U,B,F,N){return W(K(U,F,N),U.align)}function H(U,B,F,N){let L=q(U,F,N),_=W([L]);return _.slice(0,_.indexOf(`
|
|
58
|
-
`))}function z(U,B,F,N){let L=F.enter("tableCell"),_=F.enter("phrasing"),M=F.containerPhrasing(U,{...N,before:Y,after:Y});return _(),L(),M}function W(U,B){return gO(U,{align:B,alignDelimiters:X,padding:$,stringLength:Q})}function K(U,B,F){let N=U.children,L=-1,_=[],M=B.enter("table");while(++L<N.length)_[L]=q(N[L],B,F);return M(),_}function q(U,B,F){let N=U.children,L=-1,_=[],M=B.enter("tableRow");while(++L<N.length)_[L]=z(N[L],U,B,F);return M(),_}function V(U,B,F){let N=bZ.inlineCode(U,B,F);if(F.stack.includes("tableCell"))N=N.replace(/\|/g,"\\$&");return N}}function aW(){return{exit:{taskListCheckValueChecked:zw,taskListCheckValueUnchecked:zw,paragraph:$f}}}function sW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Xf}}}function zw(Z){let J=this.stack[this.stack.length-2];U1(J.type==="listItem"),J.checked=Z.type==="taskListCheckValueChecked"}function $f(Z){let J=this.stack[this.stack.length-2];if(J&&J.type==="listItem"&&typeof J.checked==="boolean"){let $=this.stack[this.stack.length-1];U1($.type==="paragraph");let X=$.children[0];if(X&&X.type==="text"){let Q=J.children,Y=-1,G;while(++Y<Q.length){let H=Q[Y];if(H.type==="paragraph"){G=H;break}}if(G===$){if(X.value=X.value.slice(1),X.value.length===0)$.children.shift();else if($.position&&X.position&&typeof X.position.start.offset==="number")X.position.start.column++,X.position.start.offset++,$.position.start=Object.assign({},X.position.start)}}}this.exit(Z)}function Xf(Z,J,$,X){let Q=Z.children[0],Y=typeof Z.checked==="boolean"&&Q&&Q.type==="paragraph",G="["+(Z.checked?"x":" ")+"] ",H=$.createTracker(X);if(Y)H.move(G);let z=bZ.listItem(Z,J,$,{...X,...H.current()});if(Y)z=z.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,W);return z;function W(K){return K+G}}function nW(){return[SW(),EW(),RW(),iW(),aW()]}function oW(Z){return{extensions:[IW(),kW(Z),yW(),rW(Z),sW()]}}var Qf={tokenize:Wf,partial:!0},Ww={tokenize:Kf,partial:!0},Kw={tokenize:qf,partial:!0},qw={tokenize:Vf,partial:!0},Yf={tokenize:Uf,partial:!0},Vw={name:"wwwAutolink",tokenize:Hf,previous:Bw},Uw={name:"protocolAutolink",tokenize:zf,previous:Fw},q2={name:"emailAutolink",tokenize:Gf,previous:Lw},n9={};function eW(){return{text:n9}}var Q6=48;while(Q6<123)if(n9[Q6]=q2,Q6++,Q6===58)Q6=65;else if(Q6===91)Q6=97;n9[43]=q2;n9[45]=q2;n9[46]=q2;n9[95]=q2;n9[72]=[q2,Uw];n9[104]=[q2,Uw];n9[87]=[q2,Vw];n9[119]=[q2,Vw];function Gf(Z,J,$){let X=this,Q,Y;return G;function G(q){if(!tW(q)||!Lw.call(X,X.previous)||ZK(X.events))return $(q);return Z.enter("literalAutolink"),Z.enter("literalAutolinkEmail"),H(q)}function H(q){if(tW(q))return Z.consume(q),H;if(q===64)return Z.consume(q),z;return $(q)}function z(q){if(q===46)return Z.check(Yf,K,W)(q);if(q===45||q===95||Y5(q))return Y=!0,Z.consume(q),z;return K(q)}function W(q){return Z.consume(q),Q=!0,z}function K(q){if(Y&&Q&&w5(X.previous))return Z.exit("literalAutolinkEmail"),Z.exit("literalAutolink"),J(q);return $(q)}}function Hf(Z,J,$){let X=this;return Q;function Q(G){if(G!==87&&G!==119||!Bw.call(X,X.previous)||ZK(X.events))return $(G);return Z.enter("literalAutolink"),Z.enter("literalAutolinkWww"),Z.check(Qf,Z.attempt(Ww,Z.attempt(Kw,Y),$),$)(G)}function Y(G){return Z.exit("literalAutolinkWww"),Z.exit("literalAutolink"),J(G)}}function zf(Z,J,$){let X=this,Q="",Y=!1;return G;function G(q){if((q===72||q===104)&&Fw.call(X,X.previous)&&!ZK(X.events))return Z.enter("literalAutolink"),Z.enter("literalAutolinkHttp"),Q+=String.fromCodePoint(q),Z.consume(q),H;return $(q)}function H(q){if(w5(q)&&Q.length<5)return Q+=String.fromCodePoint(q),Z.consume(q),H;if(q===58){let V=Q.toLowerCase();if(V==="http"||V==="https")return Z.consume(q),z}return $(q)}function z(q){if(q===47){if(Z.consume(q),Y)return W;return Y=!0,z}return $(q)}function W(q){return q===null||s4(q)||J1(q)||i9(q)||n4(q)?$(q):Z.attempt(Ww,Z.attempt(Kw,K),$)(q)}function K(q){return Z.exit("literalAutolinkHttp"),Z.exit("literalAutolink"),J(q)}}function Wf(Z,J,$){let X=0;return Q;function Q(G){if((G===87||G===119)&&X<3)return X++,Z.consume(G),Q;if(G===46&&X===3)return Z.consume(G),Y;return $(G)}function Y(G){return G===null?$(G):J(G)}}function Kf(Z,J,$){let X,Q,Y;return G;function G(W){if(W===46||W===95)return Z.check(qw,z,H)(W);if(W===null||J1(W)||i9(W)||W!==45&&n4(W))return z(W);return Y=!0,Z.consume(W),G}function H(W){if(W===95)X=!0;else Q=X,X=void 0;return Z.consume(W),G}function z(W){if(Q||X||!Y)return $(W);return J(W)}}function qf(Z,J){let $=0,X=0;return Q;function Q(G){if(G===40)return $++,Z.consume(G),Q;if(G===41&&X<$)return Y(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 Z.check(qw,J,Y)(G);if(G===null||J1(G)||i9(G))return J(G);return Z.consume(G),Q}function Y(G){if(G===41)X++;return Z.consume(G),Q}}function Vf(Z,J,$){return X;function X(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 Z.consume(H),X;if(H===38)return Z.consume(H),Y;if(H===93)return Z.consume(H),Q;if(H===60||H===null||J1(H)||i9(H))return J(H);return $(H)}function Q(H){if(H===null||H===40||H===91||J1(H)||i9(H))return J(H);return X(H)}function Y(H){return w5(H)?G(H):$(H)}function G(H){if(H===59)return Z.consume(H),X;if(w5(H))return Z.consume(H),G;return $(H)}}function Uf(Z,J,$){return X;function X(Y){return Z.consume(Y),Q}function Q(Y){return Y5(Y)?$(Y):J(Y)}}function Bw(Z){return Z===null||Z===40||Z===42||Z===95||Z===91||Z===93||Z===126||J1(Z)}function Fw(Z){return!w5(Z)}function Lw(Z){return!(Z===47||tW(Z))}function tW(Z){return Z===43||Z===45||Z===46||Z===95||Y5(Z)}function ZK(Z){let J=Z.length,$=!1;while(J--){let X=Z[J][1];if((X.type==="labelLink"||X.type==="labelImage")&&!X._balanced){$=!0;break}if(X._gfmAutolinkLiteralWalkedInto){$=!1;break}}if(Z.length>0&&!$)Z[Z.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return $}var Bf={tokenize:Df,partial:!0};function JK(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:_f,continuation:{tokenize:Af},exit:Mf}},text:{[91]:{name:"gfmFootnoteCall",tokenize:Nf},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ff,resolveTo:Lf}}}}function Ff(Z,J,$){let X=this,Q=X.events.length,Y=X.parser.gfmFootnotes||(X.parser.gfmFootnotes=[]),G;while(Q--){let z=X.events[Q][1];if(z.type==="labelImage"){G=z;break}if(z.type==="gfmFootnoteCall"||z.type==="labelLink"||z.type==="label"||z.type==="image"||z.type==="link")break}return H;function H(z){if(!G||!G._balanced)return $(z);let W=o5(X.sliceSerialize({start:G.end,end:X.now()}));if(W.codePointAt(0)!==94||!Y.includes(W.slice(1)))return $(z);return Z.enter("gfmFootnoteCallLabelMarker"),Z.consume(z),Z.exit("gfmFootnoteCallLabelMarker"),J(z)}}function Lf(Z,J){let $=Z.length,X;while($--)if(Z[$][1].type==="labelImage"&&Z[$][0]==="enter"){X=Z[$][1];break}Z[$+1][1].type="data",Z[$+3][1].type="gfmFootnoteCallLabelMarker";let Q={type:"gfmFootnoteCall",start:Object.assign({},Z[$+3][1].start),end:Object.assign({},Z[Z.length-1][1].end)},Y={type:"gfmFootnoteCallMarker",start:Object.assign({},Z[$+3][1].end),end:Object.assign({},Z[$+3][1].end)};Y.end.column++,Y.end.offset++,Y.end._bufferIndex++;let G={type:"gfmFootnoteCallString",start:Object.assign({},Y.end),end:Object.assign({},Z[Z.length-1][1].start)},H={type:"chunkString",contentType:"string",start:Object.assign({},G.start),end:Object.assign({},G.end)},z=[Z[$+1],Z[$+2],["enter",Q,J],Z[$+3],Z[$+4],["enter",Y,J],["exit",Y,J],["enter",G,J],["enter",H,J],["exit",H,J],["exit",G,J],Z[Z.length-2],Z[Z.length-1],["exit",Q,J]];return Z.splice($,Z.length-$+1,...z),Z}function Nf(Z,J,$){let X=this,Q=X.parser.gfmFootnotes||(X.parser.gfmFootnotes=[]),Y=0,G;return H;function H(q){return Z.enter("gfmFootnoteCall"),Z.enter("gfmFootnoteCallLabelMarker"),Z.consume(q),Z.exit("gfmFootnoteCallLabelMarker"),z}function z(q){if(q!==94)return $(q);return Z.enter("gfmFootnoteCallMarker"),Z.consume(q),Z.exit("gfmFootnoteCallMarker"),Z.enter("gfmFootnoteCallString"),Z.enter("chunkString").contentType="string",W}function W(q){if(Y>999||q===93&&!G||q===null||q===91||J1(q))return $(q);if(q===93){Z.exit("chunkString");let V=Z.exit("gfmFootnoteCallString");if(!Q.includes(o5(X.sliceSerialize(V))))return $(q);return Z.enter("gfmFootnoteCallLabelMarker"),Z.consume(q),Z.exit("gfmFootnoteCallLabelMarker"),Z.exit("gfmFootnoteCall"),J}if(!J1(q))G=!0;return Y++,Z.consume(q),q===92?K:W}function K(q){if(q===91||q===92||q===93)return Z.consume(q),Y++,W;return W(q)}}function _f(Z,J,$){let X=this,Q=X.parser.gfmFootnotes||(X.parser.gfmFootnotes=[]),Y,G=0,H;return z;function z(B){return Z.enter("gfmFootnoteDefinition")._container=!0,Z.enter("gfmFootnoteDefinitionLabel"),Z.enter("gfmFootnoteDefinitionLabelMarker"),Z.consume(B),Z.exit("gfmFootnoteDefinitionLabelMarker"),W}function W(B){if(B===94)return Z.enter("gfmFootnoteDefinitionMarker"),Z.consume(B),Z.exit("gfmFootnoteDefinitionMarker"),Z.enter("gfmFootnoteDefinitionLabelString"),Z.enter("chunkString").contentType="string",K;return $(B)}function K(B){if(G>999||B===93&&!H||B===null||B===91||J1(B))return $(B);if(B===93){Z.exit("chunkString");let F=Z.exit("gfmFootnoteDefinitionLabelString");return Y=o5(X.sliceSerialize(F)),Z.enter("gfmFootnoteDefinitionLabelMarker"),Z.consume(B),Z.exit("gfmFootnoteDefinitionLabelMarker"),Z.exit("gfmFootnoteDefinitionLabel"),V}if(!J1(B))H=!0;return G++,Z.consume(B),B===92?q:K}function q(B){if(B===91||B===92||B===93)return Z.consume(B),G++,K;return K(B)}function V(B){if(B===58){if(Z.enter("definitionMarker"),Z.consume(B),Z.exit("definitionMarker"),!Q.includes(Y))Q.push(Y);return R0(Z,U,"gfmFootnoteDefinitionWhitespace")}return $(B)}function U(B){return J(B)}}function Af(Z,J,$){return Z.check(r9,J,Z.attempt(Bf,J,$))}function Mf(Z){Z.exit("gfmFootnoteDefinition")}function Df(Z,J,$){let X=this;return R0(Z,Q,"gfmFootnoteDefinitionIndent",5);function Q(Y){let G=X.events[X.events.length-1];return G&&G[1].type==="gfmFootnoteDefinitionIndent"&&G[2].sliceSerialize(G[1],!0).length===4?J(Y):$(Y)}}function $K(Z){let $=(Z||{}).singleTilde,X={name:"strikethrough",tokenize:Y,resolveAll:Q};if($===null||$===void 0)$=!0;return{text:{[126]:X},insideSpan:{null:[X]},attentionMarkers:{null:[126]}};function Q(G,H){let z=-1;while(++z<G.length)if(G[z][0]==="enter"&&G[z][1].type==="strikethroughSequenceTemporary"&&G[z][1]._close){let W=z;while(W--)if(G[W][0]==="exit"&&G[W][1].type==="strikethroughSequenceTemporary"&&G[W][1]._open&&G[z][1].end.offset-G[z][1].start.offset===G[W][1].end.offset-G[W][1].start.offset){G[z][1].type="strikethroughSequence",G[W][1].type="strikethroughSequence";let K={type:"strikethrough",start:Object.assign({},G[W][1].start),end:Object.assign({},G[z][1].end)},q={type:"strikethroughText",start:Object.assign({},G[W][1].end),end:Object.assign({},G[z][1].start)},V=[["enter",K,H],["enter",G[W][1],H],["exit",G[W][1],H],["enter",q,H]],U=H.parser.constructs.insideSpan.null;if(U)W5(V,V.length,0,s2(U,G.slice(W+1,z),H));W5(V,V.length,0,[["exit",q,H],["enter",G[z][1],H],["exit",G[z][1],H],["exit",K,H]]),W5(G,W-1,z-W+3,V),z=W+V.length-2;break}}z=-1;while(++z<G.length)if(G[z][1].type==="strikethroughSequenceTemporary")G[z][1].type="data";return G}function Y(G,H,z){let W=this.previous,K=this.events,q=0;return V;function V(B){if(W===126&&K[K.length-1][1].type!=="characterEscape")return z(B);return G.enter("strikethroughSequenceTemporary"),U(B)}function U(B){let F=z2(W);if(B===126){if(q>1)return z(B);return G.consume(B),q++,U}if(q<2&&!$)return z(B);let N=G.exit("strikethroughSequenceTemporary"),L=z2(B);return N._open=!L||L===2&&Boolean(F),N._close=!F||F===2&&Boolean(L),H(B)}}}class XK{constructor(){this.map=[]}add(Z,J,$){Of(this,Z,J,$)}consume(Z){if(this.map.sort(function(Q,Y){return Q[0]-Y[0]}),this.map.length===0)return;let J=this.map.length,$=[];while(J>0)J-=1,$.push(Z.slice(this.map[J][0]+this.map[J][1]),this.map[J][2]),Z.length=this.map[J][0];$.push(Z.slice()),Z.length=0;let X=$.pop();while(X){for(let Q of X)Z.push(Q);X=$.pop()}this.map.length=0}}function Of(Z,J,$,X){let Q=0;if($===0&&X.length===0)return;while(Q<Z.map.length){if(Z.map[Q][0]===J){Z.map[Q][1]+=$,Z.map[Q][2].push(...X);return}Q+=1}Z.map.push([J,$,X])}function Nw(Z,J){let $=!1,X=[];while(J<Z.length){let Q=Z[J];if($){if(Q[0]==="enter"){if(Q[1].type==="tableContent")X.push(Z[J+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(Q[1].type==="tableContent"){if(Z[J-1][1].type==="tableDelimiterMarker"){let Y=X.length-1;X[Y]=X[Y]==="left"?"center":"right"}}else if(Q[1].type==="tableDelimiterRow")break}else if(Q[0]==="enter"&&Q[1].type==="tableDelimiterRow")$=!0;J+=1}return X}function QK(){return{flow:{null:{name:"table",tokenize:wf,resolveAll:Pf}}}}function wf(Z,J,$){let X=this,Q=0,Y=0,G;return H;function H(P){let g=X.events.length-1;while(g>-1){let y=X.events[g][1].type;if(y==="lineEnding"||y==="linePrefix")g--;else break}let C=g>-1?X.events[g][1].type:null,I=C==="tableHead"||C==="tableRow"?A:z;if(I===A&&X.parser.lazy[X.now().line])return $(P);return I(P)}function z(P){return Z.enter("tableHead"),Z.enter("tableRow"),W(P)}function W(P){if(P===124)return K(P);return G=!0,Y+=1,K(P)}function K(P){if(P===null)return $(P);if(j0(P)){if(Y>1)return Y=0,X.interrupt=!0,Z.exit("tableRow"),Z.enter("lineEnding"),Z.consume(P),Z.exit("lineEnding"),U;return $(P)}if(b0(P))return R0(Z,K,"whitespace")(P);if(Y+=1,G)G=!1,Q+=1;if(P===124)return Z.enter("tableCellDivider"),Z.consume(P),Z.exit("tableCellDivider"),G=!0,K;return Z.enter("data"),q(P)}function q(P){if(P===null||P===124||J1(P))return Z.exit("data"),K(P);return Z.consume(P),P===92?V:q}function V(P){if(P===92||P===124)return Z.consume(P),q;return q(P)}function U(P){if(X.interrupt=!1,X.parser.lazy[X.now().line])return $(P);if(Z.enter("tableDelimiterRow"),G=!1,b0(P))return R0(Z,B,"linePrefix",X.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P);return B(P)}function B(P){if(P===45||P===58)return N(P);if(P===124)return G=!0,Z.enter("tableCellDivider"),Z.consume(P),Z.exit("tableCellDivider"),F;return D(P)}function F(P){if(b0(P))return R0(Z,N,"whitespace")(P);return N(P)}function N(P){if(P===58)return Y+=1,G=!0,Z.enter("tableDelimiterMarker"),Z.consume(P),Z.exit("tableDelimiterMarker"),L;if(P===45)return Y+=1,L(P);if(P===null||j0(P))return O(P);return D(P)}function L(P){if(P===45)return Z.enter("tableDelimiterFiller"),_(P);return D(P)}function _(P){if(P===45)return Z.consume(P),_;if(P===58)return G=!0,Z.exit("tableDelimiterFiller"),Z.enter("tableDelimiterMarker"),Z.consume(P),Z.exit("tableDelimiterMarker"),M;return Z.exit("tableDelimiterFiller"),M(P)}function M(P){if(b0(P))return R0(Z,O,"whitespace")(P);return O(P)}function O(P){if(P===124)return B(P);if(P===null||j0(P)){if(!G||Q!==Y)return D(P);return Z.exit("tableDelimiterRow"),Z.exit("tableHead"),J(P)}return D(P)}function D(P){return $(P)}function A(P){return Z.enter("tableRow"),T(P)}function T(P){if(P===124)return Z.enter("tableCellDivider"),Z.consume(P),Z.exit("tableCellDivider"),T;if(P===null||j0(P))return Z.exit("tableRow"),J(P);if(b0(P))return R0(Z,T,"whitespace")(P);return Z.enter("data"),S(P)}function S(P){if(P===null||P===124||J1(P))return Z.exit("data"),T(P);return Z.consume(P),P===92?k:S}function k(P){if(P===92||P===124)return Z.consume(P),S;return S(P)}}function Pf(Z,J){let $=-1,X=!0,Q=0,Y=[0,0,0,0],G=[0,0,0,0],H=!1,z=0,W,K,q,V=new XK;while(++$<Z.length){let U=Z[$],B=U[1];if(U[0]==="enter"){if(B.type==="tableHead"){if(H=!1,z!==0)_w(V,J,z,W,K),K=void 0,z=0;W={type:"table",start:Object.assign({},B.start),end:Object.assign({},B.end)},V.add($,0,[["enter",W,J]])}else if(B.type==="tableRow"||B.type==="tableDelimiterRow"){if(X=!0,q=void 0,Y=[0,0,0,0],G=[0,$+1,0,0],H)H=!1,K={type:"tableBody",start:Object.assign({},B.start),end:Object.assign({},B.end)},V.add($,0,[["enter",K,J]]);Q=B.type==="tableDelimiterRow"?2:K?3:1}else if(Q&&(B.type==="data"||B.type==="tableDelimiterMarker"||B.type==="tableDelimiterFiller")){if(X=!1,G[2]===0){if(Y[1]!==0)G[0]=G[1],q=$Y(V,J,Y,Q,void 0,q),Y=[0,0,0,0];G[2]=$}}else if(B.type==="tableCellDivider")if(X)X=!1;else{if(Y[1]!==0)G[0]=G[1],q=$Y(V,J,Y,Q,void 0,q);Y=G,G=[Y[1],$,0,0]}}else if(B.type==="tableHead")H=!0,z=$;else if(B.type==="tableRow"||B.type==="tableDelimiterRow"){if(z=$,Y[1]!==0)G[0]=G[1],q=$Y(V,J,Y,Q,$,q);else if(G[1]!==0)q=$Y(V,J,G,Q,$,q);Q=0}else if(Q&&(B.type==="data"||B.type==="tableDelimiterMarker"||B.type==="tableDelimiterFiller"))G[3]=$}if(z!==0)_w(V,J,z,W,K);V.consume(J.events),$=-1;while(++$<J.events.length){let U=J.events[$];if(U[0]==="enter"&&U[1].type==="table")U[1]._align=Nw(J.events,$)}return Z}function $Y(Z,J,$,X,Q,Y){let G=X===1?"tableHeader":X===2?"tableDelimiter":"tableData",H="tableContent";if($[0]!==0)Y.end=Object.assign({},x8(J.events,$[0])),Z.add($[0],0,[["exit",Y,J]]);let z=x8(J.events,$[1]);if(Y={type:G,start:Object.assign({},z),end:Object.assign({},z)},Z.add($[1],0,[["enter",Y,J]]),$[2]!==0){let W=x8(J.events,$[2]),K=x8(J.events,$[3]),q={type:"tableContent",start:Object.assign({},W),end:Object.assign({},K)};if(Z.add($[2],0,[["enter",q,J]]),X!==2){let V=J.events[$[2]],U=J.events[$[3]];if(V[1].end=Object.assign({},U[1].end),V[1].type="chunkText",V[1].contentType="text",$[3]>$[2]+1){let B=$[2]+1,F=$[3]-$[2]-1;Z.add(B,F,[])}}Z.add($[3]+1,0,[["exit",q,J]])}if(Q!==void 0)Y.end=Object.assign({},x8(J.events,Q)),Z.add(Q,0,[["exit",Y,J]]),Y=void 0;return Y}function _w(Z,J,$,X,Q){let Y=[],G=x8(J.events,$);if(Q)Q.end=Object.assign({},G),Y.push(["exit",Q,J]);X.end=Object.assign({},G),Y.push(["exit",X,J]),Z.add($+1,0,Y)}function x8(Z,J){let $=Z[J],X=$[0]==="enter"?"start":"end";return $[1][X]}var jf={name:"tasklistCheck",tokenize:Tf};function YK(){return{text:{[91]:jf}}}function Tf(Z,J,$){let X=this;return Q;function Q(z){if(X.previous!==null||!X._gfmTasklistFirstContentOfListItem)return $(z);return Z.enter("taskListCheck"),Z.enter("taskListCheckMarker"),Z.consume(z),Z.exit("taskListCheckMarker"),Y}function Y(z){if(J1(z))return Z.enter("taskListCheckValueUnchecked"),Z.consume(z),Z.exit("taskListCheckValueUnchecked"),G;if(z===88||z===120)return Z.enter("taskListCheckValueChecked"),Z.consume(z),Z.exit("taskListCheckValueChecked"),G;return $(z)}function G(z){if(z===93)return Z.enter("taskListCheckMarker"),Z.consume(z),Z.exit("taskListCheckMarker"),Z.exit("taskListCheck"),H;return $(z)}function H(z){if(j0(z))return J(z);if(b0(z))return Z.check({tokenize:Cf},J,$)(z);return $(z)}}function Cf(Z,J,$){return R0(Z,X,"whitespace");function X(Q){return Q===null?$(Q):J(Q)}}function Aw(Z){return _Q([eW(),JK(),$K(Z),QK(),YK()])}var Sf={};function XY(Z){let J=this,$=Z||Sf,X=J.data(),Q=X.micromarkExtensions||(X.micromarkExtensions=[]),Y=X.fromMarkdownExtensions||(X.fromMarkdownExtensions=[]),G=X.toMarkdownExtensions||(X.toMarkdownExtensions=[]);Q.push(Aw($)),Y.push(nW()),G.push(oW($))}var xZ=j(a(),1),If=[XY],Ef=[ZY],kf={pre({children:Z}){return xZ.jsx("div",{className:"not-prose my-2 rounded-md border border-border bg-muted px-3 py-2.5",children:xZ.jsx("pre",{className:"max-h-[300px] overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground",children:Z})})}};function Mw({size:Z="sm",content:J}){return xZ.jsx("div",{className:B0("prose prose-inherit",Z==="sm"&&"prose-sm"),children:xZ.jsx(HW,{remarkPlugins:If,rehypePlugins:Ef,components:kf,children:J})})}var O1=j(a(),1);function ww(){return O1.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-1.5 text-center",children:[O1.jsx("h2",{className:"font-medium",children:"Every journey starts somewhere"}),O1.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Chat with your agent, create widgets and views, and manage your workspace context from here."})]})}function Pw(){return O1.jsx("div",{className:"flex items-center gap-1.5 px-1 py-3",children:[0,1,2].map((Z)=>O1.jsx("span",{className:"block h-1.5 w-1.5 rounded-full bg-ring",style:{animation:"pulse-dot 1.4s ease-in-out infinite",animationDelay:`${Z*0.2}s`}},Z))})}function Rf(Z){if(Z.type==="reasoning")return!0;if(Z.type==="tool-call")return!0;return!1}function yf(Z){let J=[];for(let $ of Z)if(Rf($)){let X=J[J.length-1];if(X&&X.kind==="run")X.parts.push($);else J.push({kind:"run",parts:[$]})}else J.push({kind:"single",part:$});return J}function bf({parts:Z,cwd:J,processing:$=!1}){let X=yf(Z);return O1.jsx("div",{className:"flex flex-col",children:X.map((Q,Y)=>{let G=Y===0?"":"mt-3",H=Y===X.length-1;return O1.jsx("div",{className:G,children:Q.kind==="run"?O1.jsx(GK,{parts:Q.parts,cwd:J,processing:$&&H}):O1.jsx(xf,{part:Q.part})},Y)})})}var jw=Ow.memo(function({turn:J,processing:$=!1}){let X=R1().cwd;if(J.origin.kind==="replay")return null;if(J.origin.kind==="synthetic")return null;if(J.origin.kind==="subagent-prompt")return null;if(J.role==="user"&&J.origin.kind==="user-input"){let Q=J.parts.filter((G)=>G.type==="file"),Y=J.parts.filter((G)=>G.type==="text").map((G)=>G.type==="text"?G.text:"").join(`
|
|
59
|
-
`);if(!Y&&Q.length===0)return null;return O1.jsxs("div",{className:"ml-8 flex flex-col items-end gap-1.5",children:[Q.map((G,H)=>O1.jsx(Tw,{mediaType:G.mediaType,url:G.url,filename:G.filename},H)),Y&&O1.jsx("p",{className:"rounded-md bg-accent px-4 py-2 text-sm leading-normal whitespace-pre-wrap text-accent-foreground",children:Y})]})}return O1.jsx(bf,{parts:J.parts,cwd:X,processing:$})});function xf({part:Z}){switch(Z.type){case"text":return O1.jsx(Mw,{content:Z.text});case"tool-call":return O1.jsx(GK,{parts:[Z],cwd:null});case"file":return O1.jsx(Tw,{mediaType:Z.mediaType,url:Z.url,filename:Z.filename});case"source-url":return O1.jsx(Dw,{url:Z.url,title:Z.title});case"source-document":return O1.jsx(Dw,{url:"#",title:Z.title});case"data":return O1.jsx(hf,{name:Z.name,data:Z.data});case"reasoning":return null}}function Tw({mediaType:Z,url:J,filename:$}){if(Z.startsWith("image/")&&J)return O1.jsx("img",{src:J,alt:$??"attachment",className:"max-h-64 max-w-full rounded-md border border-border object-contain"});return O1.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[O1.jsx(N8,{size:16,stroke:1.75}),O1.jsx("span",{className:"truncate",children:$??Z})]})}function Dw({url:Z,title:J}){return O1.jsx("a",{href:Z,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:J??Z})}function hf({name:Z,data:J}){return O1.jsxs("details",{children:[O1.jsxs("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:["data:",Z]}),O1.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 text-xs text-muted-foreground",children:JSON.stringify(J,null,2)})]})}var e1=j(a(),1);function QY({active:Z=!0,focusRequest:J=0,view:$,previewTurn:X,sessionId:Q,processing:Y,error:G,onDismissError:H,send:z,stop:W,onSwitchThread:K,headerLeft:q,headerRight:V,onClose:U}){let B=V2.useRef(null),F=V2.useRef(null),N=$.turns,L=V2.useMemo(()=>xN(X?[...N,X]:N),[N,X]),{atBottom:_,scrollToBottom:M}=bN(F,Q);V2.useEffect(()=>{if(Z)B.current?.focus()},[Z,J]);let O=V2.useCallback((D)=>{z(D),M()},[z,M]);return e1.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[e1.jsxs("header",{className:"flex items-center justify-between pr-2 pb-2 pl-2",children:[e1.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[q,e1.jsx(a_,{onSwitch:K})]}),e1.jsxs("div",{className:"flex items-center gap-0.5",children:[V,U&&e1.jsx(I0,{variant:"ghost",size:"icon",onClick:U,"aria-label":"Close chat",children:e1.jsx(H9,{stroke:1.5})})]})]}),e1.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[e1.jsx("div",{ref:F,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-12 [--scroll-fade-reveal:8px]",children:e1.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[N.length===0&&!Y&&e1.jsx(ww,{}),L.map((D,A)=>e1.jsx(jw,{turn:D,processing:Y&&A===L.length-1},D.id)),Y&&!X&&e1.jsx(Pw,{})]})}),!_&&N.length>0&&e1.jsx(I0,{type:"button",variant:"outline",size:"icon",onClick:()=>M("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:e1.jsx(L8,{stroke:1.5})})]}),e1.jsxs("div",{className:"mx-auto flex w-full justify-center px-3",children:[G&&e1.jsxs("div",{className:"mb-2 flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:[e1.jsx("span",{className:"flex-1 wrap-break-word",children:G}),H&&e1.jsx(I0,{type:"button",variant:"ghost",size:"icon-sm",onClick:H,className:"-m-1","aria-label":"Dismiss error",children:e1.jsx(H9,{stroke:1.75})})]}),e1.jsx(r_,{composerRef:B,onSend:O,onStop:W,processing:Y})]})]})}var e2={};t7(e2,{createHandle:()=>ow,Viewport:()=>nw,Trigger:()=>kw,Title:()=>cw,Root:()=>Iw,Positioner:()=>xw,Portal:()=>bw,Popup:()=>vw,Handle:()=>WY,Description:()=>lw,Close:()=>rw,Backdrop:()=>pw,Arrow:()=>mw});var a7=j(m(),1);var YY=j(m(),1),HK=YY.createContext(void 0);function G5(Z){let J=YY.useContext(HK);if(J===void 0&&!Z)throw Error(w0(47));return J}var h8=j(m(),1),Cw=j(w7(),1);function vf(){return{...k9(),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 gf={...R9,disabled:P0((Z)=>Z.disabled),instantType:P0((Z)=>Z.instantType),openMethod:P0((Z)=>Z.openMethod),openChangeReason:P0((Z)=>Z.openChangeReason),modal:P0((Z)=>Z.modal),stickIfOpen:P0((Z)=>Z.stickIfOpen),titleElementId:P0((Z)=>Z.titleElementId),descriptionElementId:P0((Z)=>Z.descriptionElementId),openOnHover:P0((Z)=>Z.openOnHover),closeDelay:P0((Z)=>Z.closeDelay),hasViewport:P0((Z)=>Z.hasViewport)};class v8 extends P7{constructor(Z){let J={...vf(),...Z};if(J.open&&Z?.mounted===void 0)J.mounted=!0;super(J,{popupRef:h8.createRef(),backdropRef:h8.createRef(),internalBackdropRef:h8.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:h8.createRef(),beforeContentFocusGuardRef:h8.createRef(),stickIfOpenTimeout:new y5,triggerElements:new Q7},gf)}setOpen=(Z,J)=>{let $=J.reason===n.triggerHover,X=J.reason===n.triggerPress&&J.event.detail===0,Q=!Z&&(J.reason===n.escapeKey||J.reason==null);if(J.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(Z,J),J.isCanceled)return;let Y={open:Z,nativeEvent:J.event,reason:J.reason,nested:this.state.nested,triggerElement:J.trigger};this.state.floatingRootContext.context.events?.emit("openchange",Y);let H=()=>{let z={open:Z,openChangeReason:J.reason},W=J.trigger?.id??null;if(W||Z)z.activeTriggerId=W,z.activeTriggerElement=J.trigger??null;this.update(z)};if($)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(JQ,()=>{this.set("stickIfOpen",!1)}),Cw.flushSync(H);else H();if(X||Q)this.set("instantType",X?"click":"dismiss");else if(J.reason===n.focusOut)this.set("instantType","focus");else this.set("instantType",void 0)};static useStore(Z,J){let $=K1(()=>{return new v8(J)}).current,X=Z??$;return O9($.disposeEffect),X}disposeEffect=()=>{return this.context.stickIfOpenTimeout.disposeEffect()}}var hZ=j(a(),1);function Sw({props:Z}){let{children:J,open:$,defaultOpen:X=!1,onOpenChange:Q,onOpenChangeComplete:Y,modal:G=!1,handle:H,triggerId:z,defaultTriggerId:W=null}=Z,K=v8.useStore(H?.store,{modal:G,open:X,openProp:$,activeTriggerId:W,triggerIdProp:z});D9(()=>{if($===void 0&&K.state.open===!1&&X===!0)K.update({open:!0,activeTriggerId:W})}),K.useControlledProp("openProp",$),K.useControlledProp("triggerIdProp",z);let q=K.useState("open"),V=K.useState("positionerElement"),U=K.useState("payload"),B=K.useState("openChangeReason");K.useContextCallback("onOpenChange",Q),K.useContextCallback("onOpenChangeComplete",Y);let{openMethod:F,triggerProps:N,reset:L}=p6(q);I9(K);let{forceUnmount:_}=E9(q,K,()=>{K.update({stickIfOpen:!0,openChangeReason:null}),L()});m6(q&&G===!0&&B!==n.triggerHover&&F!=="touch",V),a7.useEffect(()=>{if(!q)K.context.stickIfOpenTimeout.clear()},[K,q]);let M=a7.useCallback((b)=>{let R=N0(b);return R.preventUnmountOnClose=()=>{K.set("preventUnmountingOnClose",!0)},R},[K]),O=a7.useCallback(()=>{K.setOpen(!1,M(n.imperativeAction))},[K,M]);a7.useImperativeHandle(Z.actionsRef,()=>({unmount:_,close:O}),[_,O]);let D=$9({popupStore:K,onOpenChange:K.setOpen}),A=J9(D,{outsidePressEvent:{mouse:G==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),T=C4(D),{getReferenceProps:S,getFloatingProps:k,getTriggerProps:P}=M5([A,T]),g=a7.useMemo(()=>{return S(N)},[S,N]),C=a7.useMemo(()=>{return P(N)},[P,N]),I=a7.useMemo(()=>{return k()},[k]);K.useSyncedValues({modal:G,openMethod:F,activeTriggerProps:g,inactiveTriggerProps:C,popupProps:I,floatingRootContext:D,nested:_5()!=null});let y=a7.useMemo(()=>({store:K}),[K]);return hZ.jsx(HK.Provider,{value:y,children:typeof J==="function"?J({payload:U}):J})}function Iw(Z){if(G5(!0))return hZ.jsx(Sw,{props:Z});return hZ.jsx(_3,{children:hZ.jsx(Sw,{props:Z})})}var q9=j(m(),1),zK=j(w7(),1);var Ew=300;var Y6=j(a(),1),kw=q9.forwardRef(function(J,$){let{render:X,className:Q,disabled:Y=!1,nativeButton:G=!0,handle:H,payload:z,openOnHover:W=!1,delay:K=Ew,closeDelay:q=0,id:V,...U}=J,B=G5(!0),F=H?.store??B?.store;if(!F)throw Error(w0(74));let N=d0(V),L=F.useState("isTriggerActive",N),_=F.useState("floatingRootContext"),M=F.useState("isOpenedByTrigger",N),O=q9.useRef(null),{registerTrigger:D,isMountedByThisTrigger:A}=S9(N,O,F,{payload:z,disabled:Y,openOnHover:W,closeDelay:q}),T=F.useState("openChangeReason"),S=F.useState("stickIfOpen"),k=F.useState("openMethod"),P=X9(_,{enabled:_!=null&&W&&(k!=="touch"||T!==n.triggerPress),mouseOnly:!0,move:!1,handleClose:Q9(),restMs:K,delay:{close:q},triggerElementRef:O,isActiveTrigger:L}),g=$2(_,{enabled:_!=null,stickIfOpen:S}),C=M5([g]),I=F.useState("triggerProps",A),y={disabled:Y,open:M},{getButtonProps:b,buttonRef:R}=v5({disabled:Y,native:G}),x=q9.useMemo(()=>({open(G0){if(G0&&T===n.triggerPress)return S3.open(G0);return b9.open(G0)}}),[T]),v=K0("button",J,{state:y,ref:[R,$,D,O],props:[C.getReferenceProps(),P,I,{[C6]:"",id:N},U,b],stateAttributesMapping:x}),d=q9.useRef(null),w=Y0((G0)=>{zK.flushSync(()=>{F.setOpen(!1,N0(n.focusOut,G0.nativeEvent,G0.currentTarget))}),pJ(d.current)?.focus()}),z0=Y0((G0)=>{let E=F.select("positionerElement");if(E&&o7(G0,E))F.context.beforeContentFocusGuardRef.current?.focus();else{zK.flushSync(()=>{F.setOpen(!1,N0(n.focusOut,G0.nativeEvent,G0.currentTarget))});let s=fJ(F.context.triggerFocusTargetRef.current||O.current);while(s!==null&&k0(E,s)){let A0=s;if(s=O2(s),s===A0)break}s?.focus()}});if(L)return Y6.jsxs(q9.Fragment,{children:[Y6.jsx(v7,{ref:d,onFocus:w}),Y6.jsx(q9.Fragment,{children:v},N),Y6.jsx(v7,{ref:F.context.triggerFocusTargetRef,onFocus:z0})]});return Y6.jsx(q9.Fragment,{children:v},N)});var yw=j(m(),1);var GY=j(m(),1),WK=GY.createContext(void 0);function Rw(){let Z=GY.useContext(WK);if(Z===void 0)throw Error(w0(45));return Z}var KK=j(a(),1),bw=yw.forwardRef(function(J,$){let{keepMounted:X=!1,...Q}=J,{store:Y}=G5();if(!(Y.useState("mounted")||X))return null;return KK.jsx(WK.Provider,{value:X,children:KK.jsx(M4,{ref:$,...Q})})});var U2=j(m(),1);var HY=j(m(),1),qK=HY.createContext(void 0);function g8(){let Z=HY.useContext(qK);if(!Z)throw Error(w0(46));return Z}var vZ=j(a(),1),xw=U2.forwardRef(function(J,$){let{render:X,className:Q,anchor:Y,positionMethod:G="absolute",side:H="bottom",align:z="center",sideOffset:W=0,alignOffset:K=0,collisionBoundary:q="clipping-ancestors",collisionPadding:V=5,arrowPadding:U=5,sticky:B=!1,disableAnchorTracking:F=!1,collisionAvoidance:N=k2,...L}=J,{store:_}=G5(),M=Rw(),O=N4(),D=_.useState("floatingRootContext"),A=_.useState("mounted"),T=_.useState("open"),S=_.useState("openChangeReason"),k=_.useState("activeTriggerElement"),P=_.useState("modal"),g=_.useState("positionerElement"),C=_.useState("instantType"),I=_.useState("transitionStatus"),y=_.useState("hasViewport"),b=U2.useRef(null),R=C9(g,!1,!1),x=E2({anchor:Y,floatingRootContext:D,positionMethod:G,mounted:A,side:H,sideOffset:W,align:z,alignOffset:K,arrowPadding:U,collisionBoundary:q,collisionPadding:V,sticky:B,disableAnchorTracking:F,keepMounted:M,nodeId:O,collisionAvoidance:N,adaptiveOrigin:y?R6:void 0}),v=U2.useMemo(()=>{let s={};if(!T)s.pointerEvents="none";return{role:"presentation",hidden:!A,style:{...x.positionerStyles,...s}}},[T,A,x.positionerStyles]),d=U2.useMemo(()=>({props:v,...x}),[v,x]),w=D.useState("domReferenceElement");$0(()=>{let s=w,A0=b.current;if(s)b.current=s;if(A0&&s&&s!==A0){_.set("instantType",void 0);let l=new AbortController;return R(()=>{_.set("instantType","trigger-change")},l.signal),()=>{l.abort()}}return},[w,R,_]);let z0={open:T,side:d.side,align:d.align,anchorHidden:d.anchorHidden,instant:C},G0=U2.useCallback((s)=>{_.set("positionerElement",s)},[_]),E=K0("div",J,{state:z0,props:[d.props,l5(I),L],ref:[$,G0],stateAttributesMapping:Y1});return vZ.jsxs(qK.Provider,{value:d,children:[A&&P===!0&&S!==n.triggerHover&&vZ.jsx(g6,{ref:_.context.internalBackdropRef,inert:R2(!T),cutout:k}),vZ.jsx(N3,{id:O,children:E})]})});var zY=j(m(),1);var hw=j(a(),1),mf={...Y1,...j1},vw=zY.forwardRef(function(J,$){let{className:X,render:Q,initialFocus:Y,finalFocus:G,...H}=J,{store:z}=G5(),W=g8(),K=mX(!0)!=null,q=z.useState("open"),V=z.useState("openMethod"),U=z.useState("instantType"),B=z.useState("transitionStatus"),F=z.useState("popupProps"),N=z.useState("titleElementId"),L=z.useState("descriptionElementId"),_=z.useState("modal"),M=z.useState("mounted"),O=z.useState("openChangeReason"),D=z.useState("activeTriggerElement"),A=z.useState("floatingRootContext");B5({open:q,ref:z.context.popupRef,onComplete(){if(q)z.context.onOpenChangeComplete?.(!0)}});let T=z.useState("disabled"),S=z.useState("openOnHover"),k=z.useState("closeDelay");X2(A,{enabled:S&&!T,closeDelay:k});function P(b){if(b==="touch")return z.context.popupRef.current;return!0}let g=Y===void 0?P:Y,C={open:q,side:W.side,align:W.align,instant:U,transitionStatus:B},I=zY.useCallback((b)=>{z.set("popupElement",b)},[z]),y=K0("div",J,{state:C,ref:[$,z.context.popupRef,I],props:[F,{"aria-labelledby":N,"aria-describedby":L,onKeyDown(b){if(K&&v6.has(b.key))b.stopPropagation()}},l5(B),H],stateAttributesMapping:mf});return hw.jsx(D4,{context:A,openInteractionType:V,modal:_==="trap-focus",disabled:!M||O===n.triggerHover,initialFocus:g,returnFocus:G,restoreFocus:"popup",previousFocusableElement:u1(D)?D:void 0,nextFocusableElement:z.context.triggerFocusTargetRef,beforeContentFocusGuardRef:z.context.beforeContentFocusGuardRef,children:y})});var gw=j(m(),1);var mw=gw.forwardRef(function(J,$){let{className:X,render:Q,...Y}=J,{store:G}=G5(),H=G.useState("open"),{arrowRef:z,side:W,align:K,arrowUncentered:q,arrowStyles:V}=g8();return K0("div",J,{state:{open:H,side:W,align:K,uncentered:q},ref:[$,z],props:[{style:V,"aria-hidden":!0},Y],stateAttributesMapping:Y1})});var fw=j(m(),1);var ff={...Y1,...j1},pw=fw.forwardRef(function(J,$){let{className:X,render:Q,...Y}=J,{store:G}=G5(),H=G.useState("open"),z=G.useState("mounted"),W=G.useState("transitionStatus"),K=G.useState("openChangeReason");return K0("div",J,{state:{open:H,transitionStatus:W},ref:[G.context.backdropRef,$],props:[{role:"presentation",hidden:!z,style:{pointerEvents:K===n.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},Y],stateAttributesMapping:ff})});var uw=j(m(),1);var cw=uw.forwardRef(function(J,$){let{render:X,className:Q,...Y}=J,{store:G}=G5(),H=d0(Y.id);return $0(()=>{return G.set("titleElementId",H),()=>{G.set("titleElementId",void 0)}},[G,H]),K0("h2",J,{ref:$,props:[{id:H},Y]})});var dw=j(m(),1);var lw=dw.forwardRef(function(J,$){let{render:X,className:Q,...Y}=J,{store:G}=G5(),H=d0(Y.id);return $0(()=>{return G.set("descriptionElementId",H),()=>{G.set("descriptionElementId",void 0)}},[G,H]),K0("p",J,{ref:$,props:[{id:H},Y]})});var iw=j(m(),1);var rw=iw.forwardRef(function(J,$){let{render:X,className:Q,disabled:Y=!1,nativeButton:G=!0,...H}=J,{buttonRef:z,getButtonProps:W}=v5({disabled:Y,focusableWhenDisabled:!1,native:G}),{store:K}=G5();return K0("button",J,{ref:[$,z],props:[{onClick(V){K.setOpen(!1,N0(n.closePress,V.nativeEvent,V.currentTarget))}},H,W]})});var sw=j(m(),1);var aw=function(Z){return Z.popupWidth="--popup-width",Z.popupHeight="--popup-height",Z}({});var pf={activationDirection:(Z)=>Z?{"data-activation-direction":Z}:null},nw=sw.forwardRef(function(J,$){let{render:X,className:Q,children:Y,...G}=J,{store:H}=G5(),{side:z}=g8(),W=H.useState("instantType"),{children:K,state:q}=b6({store:H,side:z,cssVars:aw,children:Y}),V={activationDirection:q.activationDirection,transitioning:q.transitioning,instant:W};return K0("div",J,{state:V,ref:$,props:[G,{children:K}],stateAttributesMapping:pf})});class WY{constructor(){this.store=new v8}open(Z){let J=Z?this.store.context.triggerElements.getById(Z)??void 0:void 0;if(Z&&!J)throw Error(w0(80,Z));this.store.setOpen(!0,N0(n.imperativeAction,void 0,J))}close(){this.store.setOpen(!1,N0(n.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}function ow(){return new WY}var m8=j(a(),1);function tw({...Z}){return m8.jsx(e2.Root,{"data-slot":"popover",...Z})}function ew({...Z}){return m8.jsx(e2.Trigger,{"data-slot":"popover-trigger",...Z})}function ZP({className:Z,align:J="center",alignOffset:$=0,side:X="bottom",sideOffset:Q=4,keepMounted:Y=!1,container:G,...H}){return m8.jsx(e2.Portal,{keepMounted:Y,container:G,children:m8.jsx(e2.Positioner,{align:J,alignOffset:$,side:X,sideOffset:Q,className:"isolate z-50",children:m8.jsx(e2.Popup,{"data-slot":"popover-content",className:B0("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-md bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-border 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),...H})})})}var B2=j(a(),1);function JP({open:Z,onOpenChange:J,onOpenChangeComplete:$,container:X,children:Q}){let Y=()=>J(!1);return B2.jsxs(tw,{open:Z,onOpenChange:J,onOpenChangeComplete:$,children:[B2.jsx(ew,{render:B2.jsx("div",{className:"fixed right-4 bottom-4 sm:right-6 sm:bottom-6",children:B2.jsx(n1.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:B2.jsx(I0,{variant:"outline",size:"icon-lg",className:"shadow-md hover:shadow-lg","aria-label":"Agent",children:B2.jsx(G6,{stroke:1.75})})})})}),B2.jsx(ZP,{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,container:X,children:Q(Y)})]})}var QP=j(m(),1);var gZ=j(a(),1);function KY({title:Z,children:J,ref:$}){return gZ.jsxs(n1.div,{ref:$,className:"absolute inset-x-6 bottom-0 z-20 flex max-h-[60vh] flex-col rounded-t-2xl bg-card p-(--page-pad) text-card-foreground shadow-md",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:[gZ.jsx("p",{className:"mb-4 shrink-0 text-sm font-medium text-muted-foreground",children:Z}),gZ.jsx("div",{className:"-my-1 mr-[calc(var(--page-pad)*-1)] ml-[calc(var(--page-pad)*-1)] flex-1 overflow-y-auto px-(--page-pad) py-1",children:J})]})}var f8={default:{label:"Default",sans:"system-ui",mono:"JetBrains Mono",feel:"Native OS, zero load",googleFontsQuery:"JetBrains+Mono:wght@400;500"},serif:{label:"Serif",sans:"Libre Baskerville",mono:"JetBrains Mono",feel:"Classic serif, literary",googleFontsQuery:"Libre+Baskerville:wght@400;700&family=JetBrains+Mono:wght@400;500"},mono:{label:"Mono",sans:"JetBrains Mono",mono:"JetBrains Mono",feel:"Full terminal, hacker",googleFontsQuery:"JetBrains+Mono:wght@400;500;600"},bubbly:{label:"Bubbly",sans:"Fredoka",mono:"Azeret Mono",feel:"Very round, toy-like",googleFontsQuery:"Fredoka:wght@400;500;600&family=Azeret+Mono:wght@400;500"},geometric:{label:"Geometric",sans:"Outfit",mono:"DM Mono",feel:"Swiss design, neutral",googleFontsQuery:"Outfit:wght@400;500;600&family=DM+Mono:wght@400;500"},retro:{label:"Retro",sans:"Courier Prime",mono:"Courier Prime",feel:"Typewriter nostalgia",googleFontsQuery:"Courier+Prime:wght@400;700"}},$P={default:{label:"Default",feel:"System neutral"},paper:{label:"Paper",background:"#faf8f5",foreground:"#2c2825",feel:"Warm off-white"},sand:{label:"Sand",background:"#f5f0e8",foreground:"#3d3529",feel:"Beige earth tones"},rose:{label:"Rose",background:"#fdf2f4",foreground:"#3b1c26",feel:"Soft blush"},lavender:{label:"Lavender",background:"#f4f2fb",foreground:"#2b2640",feel:"Cool violet"},mint:{label:"Mint",background:"#f0faf6",foreground:"#1a3028",feel:"Cool green"},sky:{label:"Sky",background:"#f0f6fc",foreground:"#1a2a3b",feel:"Cool blue"}};var f5=j(a(),1),XP="mei-font-previews",uf=Object.values(f8).map((Z)=>Z.googleFontsQuery).filter(Boolean).join("&family=");function cf(){QP.useEffect(()=>{if(document.getElementById(XP))return;let Z=document.createElement("link");Z.id=XP,Z.rel="stylesheet",Z.href=`https://fonts.googleapis.com/css2?family=${uf}&display=swap`,document.head.appendChild(Z)},[])}var df=Object.entries(f8),lf=Object.entries($P);function rf(Z,J,$){return(Z.background??void 0)===J&&(Z.foreground??void 0)===$}function YP({ref:Z}){cf();let{layout:J,setLayout:$}=R1(),X=J.theme?.font??"default",Q=J.theme?.background,Y=J.theme?.foreground;function G(H){$({theme:{...J.theme,font:X,...H}})}return f5.jsx(KY,{ref:Z,title:"Customize",children:f5.jsxs("div",{className:"flex flex-col gap-6",children:[f5.jsxs("div",{className:"flex flex-col gap-2",children:[f5.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Font"}),f5.jsx("div",{className:"grid grid-cols-3 gap-2",children:df.map(([H,z])=>f5.jsxs("button",{type:"button",onClick:()=>G({font:H}),className:B0("flex flex-col items-start rounded-md px-3 py-2 text-left transition-colors",H===X?"bg-primary/5 ring-2 ring-primary":"border-transparent hover:bg-accent"),style:{fontFamily:z.sans},children:[f5.jsx("span",{className:"text-sm font-medium",children:z.label}),f5.jsx("span",{className:"text-xs text-muted-foreground",children:z.feel})]},H))})]}),f5.jsxs("div",{className:"flex flex-col gap-2",children:[f5.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Colors"}),f5.jsx("div",{className:"grid grid-cols-3 gap-2",children:lf.map(([H,z])=>{let W=rf(z,Q,Y);return f5.jsxs("button",{type:"button",onClick:()=>G({background:z.background,foreground:z.foreground}),className:B0("flex items-center gap-2 rounded-md border px-3 py-2 transition-colors",W?"bg-primary/5 ring-2 ring-primary":"border-transparent hover:bg-accent"),children:[f5.jsx("span",{className:"size-5 shrink-0 rounded-full border border-border",style:{backgroundColor:z.background??"oklch(1 0 0)"},children:f5.jsx("span",{className:"flex size-full items-center justify-center text-[9px] leading-none font-bold",style:{color:z.foreground??"oklch(0.145 0 0)"},children:"A"})}),f5.jsx("span",{className:"text-sm",children:z.label})]},H)})})]})]})})}var qY=j(m(),1);var GP=j(m(),1),VK=new Map;function af(Z){let J=window.__moiAppletCss?.get(Z)??"",$=VK.get(Z);if(!$){let Y=document.createElement("style");Y.dataset.appletStyle=Z,document.head.appendChild(Y),$={el:Y,refs:0},VK.set(Z,$)}if($.el.textContent!==J)$.el.textContent=J;$.refs++;let X=$,Q=!1;return()=>{if(Q)return;if(Q=!0,X.refs--,X.refs<=0)X.el.remove(),VK.delete(Z)}}function HP(Z,J){GP.useInsertionEffect(()=>af(Z),[Z,J])}var zP=j(a(),1);function VY({segment:Z,name:J,version:$,asChild:X,children:Q}){let Y=h5();HP(CN(Z,Y,J),$);let H=`${Z==="widgets"?"widget":"view"}:${J}`;if(X&&qY.isValidElement(Q))return qY.cloneElement(Q,{"data-applet":H});return zP.jsx("div",{"data-applet":H,className:"size-full",children:Q})}var KP=j(m(),1);var p8=j(a(),1);class mZ extends KP.Component{state={error:null};static getDerivedStateFromError(Z){return{error:Z}}componentDidCatch(Z,J){console.error(`[widget:${this.props.name}]`,Z,J.componentStack),W3(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:Z.message||String(Z),stack:[Z.stack,J.componentStack].filter(Boolean).join(`
|
|
60
|
-
`)})}componentDidUpdate(Z){if(Z.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return p8.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[p8.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[p8.jsx(WP,{size:16,stroke:1.75}),"Widget crashed"]}),p8.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var s8=j(m(),1);function fZ(Z,J,$,X){let Q=Z.reduce((Y,G)=>Math.max(Y,G.y+G.h),0);for(let Y=0;Y<=Q+$;Y++)for(let G=0;G<=X-J;G++)if(!Z.some((z)=>!(G+J<=z.x||z.x+z.w<=G||Y+$<=z.y||z.y+z.h<=Y)))return{x:G,y:Y};return{x:0,y:Q}}function pZ(Z,J=[],$=4){let X=[];for(let Q of Z){let{x:Y,y:G}=Q.x!==void 0&&Q.y!==void 0?{x:Q.x,y:Q.y}:fZ([...J,...X],Q.w,Q.h,$);X.push({i:Q.id,x:Y,y:G,w:Q.w,h:Q.h})}return X}var Z4=j(a(),1);function qP({name:Z}){let J=h5(),$=kN(Z);return Z4.jsxs(o9,{mode:"wait",initial:!1,children:[$.status==="ready"&&Z4.jsx(n1.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:Z4.jsx(mZ,{name:Z,kind:"widget",workspaceId:J,resetKey:$.version,children:Z4.jsx(VY,{segment:"widgets",name:Z,version:$.version,children:Z4.jsx($.Component,{})})})},$.version),$.status==="error"&&Z4.jsx(n1.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:$.error},`err-${$.version}`)]})}var UP=j(m(),1);var J4=j(a(),1);function UY({editing:Z,hidden:J,onRemove:$,children:X}){return J4.jsxs(n1.div,{variants:{idle:{rotate:0},wiggle:{rotate:[0.5,-0.5],transition:{rotate:{repeat:1/0,repeatType:"reverse",duration:0.15,ease:"easeInOut"}}}},animate:Z?"wiggle":"idle",transition:{type:"spring",duration:0.35,bounce:0},className:"group/widget relative size-full",children:[J4.jsx("div",{"data-widget-chrome":!0,className:B0("dark absolute inset-0 overflow-hidden rounded-2xl [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)]","text-foreground",Z&&"pointer-events-none"),children:X}),Z&&$&&J4.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:J4.jsx(I0,{size:"icon-sm",variant:"outline",className:"rounded-full",onClick:$,children:J?J4.jsx(s5,{stroke:1.75}):J4.jsx(VP,{stroke:1.75})})})]})}var u8=j(a(),1),sf={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},nf={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"},of={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},tf={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function BP({items:Z,renderItem:J,onRestore:$,ref:X}){let Q=UP.useMemo(()=>pZ(Z),[Z]);return u8.jsx(KY,{ref:X,title:"Hidden",children:u8.jsx("div",{className:"grid [grid-auto-rows:160px] grid-cols-4 gap-2",children:u8.jsx(o9,{children:Q.map((Y)=>u8.jsx(n1.div,{layoutId:Y.i,className:B0(sf[Y.x],nf[Y.y],of[Y.w],tf[Y.h]),transition:{type:"spring",duration:0.35,bounce:0},children:u8.jsx(UY,{editing:!0,onRemove:()=>$(Y.i),hidden:!0,children:J(Y.i)})},Y.i))})})})}var JJ=j(m(),1);function X4(Z){let{margin:J,containerPadding:$,containerWidth:X,cols:Q}=Z;return(X-J[0]*(Q-1)-$[0]*2)/Q}function V9(Z,J,$){if(!Number.isFinite(Z))return Z;return Math.round(J*Z+Math.max(0,Z-1)*$)}function cZ(Z,J,$,X,Q,Y,G){let{margin:H,containerPadding:z,rowHeight:W}=Z,K=X4(Z),q,V,U,B;if(G)q=Math.round(G.width),V=Math.round(G.height);else q=V9(X,K,H[0]),V=V9(Q,W,H[1]);if(Y)U=Math.round(Y.top),B=Math.round(Y.left);else if(G)U=Math.round(G.top),B=Math.round(G.left);else U=Math.round((W+H[1])*$+z[1]),B=Math.round((K+H[0])*J+z[0]);if(!Y&&!G){if(Number.isFinite(X)){let N=Math.round((K+H[0])*(J+X)+z[0])-B-q;if(N!==H[0])q+=N-H[0]}if(Number.isFinite(Q)){let N=Math.round((W+H[1])*($+Q)+z[1])-U-V;if(N!==H[1])V+=N-H[1]}}return{top:U,left:B,width:q,height:V}}function LP(Z,J,$,X,Q){let{margin:Y,containerPadding:G,cols:H,rowHeight:z,maxRows:W}=Z,K=X4(Z),q=Math.round(($-G[0])/(K+Y[0])),V=Math.round((J-G[1])/(z+Y[1]));return q=uZ(q,0,H-X),V=uZ(V,0,W-Q),{x:q,y:V}}function dZ(Z,J,$){let{margin:X,containerPadding:Q,rowHeight:Y}=Z,G=X4(Z),H=Math.round(($-Q[0])/(G+X[0])),z=Math.round((J-Q[1])/(Y+X[1]));return{x:H,y:z}}function NP(Z,J,$){let{margin:X,rowHeight:Q}=Z,Y=X4(Z),G=Math.max(1,Math.round((J+X[0])/(Y+X[0]))),H=Math.max(1,Math.round(($+X[1])/(Q+X[1])));return{w:G,h:H}}function uZ(Z,J,$){return Math.max(Math.min(Z,$),J)}function FY(Z,J){if(Z.i===J.i)return!1;if(Z.x+Z.w<=J.x)return!1;if(Z.x>=J.x+J.w)return!1;if(Z.y+Z.h<=J.y)return!1;if(Z.y>=J.y+J.h)return!1;return!0}function Q4(Z,J){for(let $=0;$<Z.length;$++){let X=Z[$];if(X!==void 0&&FY(X,J))return X}return}function UK(Z,J){return Z.filter(($)=>FY($,J))}function ef(Z,J){if(J==="horizontal")return BK(Z);if(J==="vertical")return BY(Z);if(J==="wrap")return BY(Z);return[...Z]}function BY(Z){return[...Z].sort((J,$)=>{if(J.y!==$.y)return J.y-$.y;return J.x-$.x})}function BK(Z){return[...Z].sort((J,$)=>{if(J.x!==$.x)return J.x-$.x;return J.y-$.y})}function lZ(Z){let J=0;for(let $=0;$<Z.length;$++){let X=Z[$];if(X!==void 0){let Q=X.y+X.h;if(Q>J)J=Q}}return J}function Y4(Z,J){for(let $=0;$<Z.length;$++){let X=Z[$];if(X!==void 0&&X.i===J)return X}return}function iZ(Z){return Z.filter((J)=>J.static===!0)}function F2(Z){return{i:Z.i,x:Z.x,y:Z.y,w:Z.w,h:Z.h,minW:Z.minW,maxW:Z.maxW,minH:Z.minH,maxH:Z.maxH,moved:Boolean(Z.moved),static:Boolean(Z.static),isDraggable:Z.isDraggable,isResizable:Z.isResizable,resizeHandles:Z.resizeHandles,constraints:Z.constraints,isBounded:Z.isBounded}}function c8(Z){let J=Array(Z.length);for(let $=0;$<Z.length;$++){let X=Z[$];if(X!==void 0)J[$]=F2(X)}return J}function Zp(Z,J){let $=Array(Z.length);for(let X=0;X<Z.length;X++){let Q=Z[X];if(Q!==void 0)if(J.i===Q.i)$[X]=J;else $[X]=Q}return $}function _P(Z,J,$){let X=Y4(Z,J);if(!X)return[[...Z],null];return X=$(F2(X)),[Zp(Z,X),X]}function FK(Z,J){let $=iZ(Z);for(let X=0;X<Z.length;X++){let Q=Z[X];if(Q===void 0)continue;if(Q.x+Q.w>J.cols)Q.x=J.cols-Q.w;if(Q.x<0)Q.x=0,Q.w=J.cols;if(!Q.static)$.push(Q);else while(Q4($,Q))Q.y++}return Z}function $4(Z,J,$,X,Q,Y,G,H,z){if(J.static&&J.isDraggable!==!0)return[...Z];if(J.y===X&&J.x===$)return[...Z];let{x:W,y:K}=J;if(typeof $==="number")J.x=$;if(typeof X==="number")J.y=X;J.moved=!0;let q=ef(Z,G);if(G==="vertical"&&typeof X==="number"?K>=X:G==="horizontal"&&typeof $==="number"?W>=$:!1)q=q.reverse();let U=UK(q,J),B=U.length>0;if(B&&z)return c8(Z);if(B&&Y)return J.x=W,J.y=K,J.moved=!1,Z;let F=[...Z];for(let N=0;N<U.length;N++){let L=U[N];if(L===void 0)continue;if(L.moved)continue;if(L.static)F=FP(F,L,J,Q,G);else F=FP(F,J,L,Q,G)}return F}function FP(Z,J,$,X,Q,Y){let G=Q==="horizontal",H=Q==="vertical",z=J.static;if(X){X=!1;let q={x:G?Math.max(J.x-$.w,0):$.x,y:H?Math.max(J.y-$.h,0):$.y,w:$.w,h:$.h,i:"-1"},V=Q4(Z,q),U=V!==void 0&&V.y+V.h>J.y,B=V!==void 0&&J.x+J.w>V.x;if(!V)return $4(Z,$,G?q.x:void 0,H?q.y:void 0,X,z,Q);if(U&&H)return $4(Z,$,void 0,$.y+1,X,z,Q);if(U&&Q===null)return J.y=$.y,$.y=$.y+$.h,[...Z];if(B&&G)return $4(Z,J,$.x,void 0,X,z,Q)}let W=G?$.x+1:void 0,K=H?$.y+1:void 0;if(W===void 0&&K===void 0)return[...Z];return $4(Z,$,W,K,X,z,Q)}function d8(Z,J,$){return Math.max(J,Math.min($,Z))}var Jp={name:"gridBounds",constrainPosition(Z,J,$,{cols:X,maxRows:Q}){return{x:d8(J,0,Math.max(0,X-Z.w)),y:d8($,0,Math.max(0,Q-Z.h))}},constrainSize(Z,J,$,X,{cols:Q,maxRows:Y}){let G=X==="w"||X==="nw"||X==="sw"?Z.x+Z.w:Q-Z.x,H=X==="n"||X==="nw"||X==="ne"?Z.y+Z.h:Y-Z.y;return{w:d8(J,1,Math.max(1,G)),h:d8($,1,Math.max(1,H))}}},$p={name:"minMaxSize",constrainSize(Z,J,$){return{w:d8(J,Z.minW??1,Z.maxW??1/0),h:d8($,Z.minH??1,Z.maxH??1/0)}}};var LK=[Jp,$p];function rZ(Z,J,$,X,Q){let Y={x:$,y:X};for(let G of Z)if(G.constrainPosition)Y=G.constrainPosition(J,Y.x,Y.y,Q);if(J.constraints){for(let G of J.constraints)if(G.constrainPosition)Y=G.constrainPosition(J,Y.x,Y.y,Q)}return Y}function AP(Z,J,$,X,Q,Y){let G={w:$,h:X};for(let H of Z)if(H.constrainSize)G=H.constrainSize(J,G.w,G.h,Q,Y);if(J.constraints){for(let H of J.constraints)if(H.constrainSize)G=H.constrainSize(J,G.w,G.h,Q,Y)}return G}function NY({top:Z,left:J,width:$,height:X}){let Q=`translate(${J}px,${Z}px)`;return{transform:Q,WebkitTransform:Q,MozTransform:Q,msTransform:Q,OTransform:Q,width:`${$}px`,height:`${X}px`,position:"absolute"}}function NK({top:Z,left:J,width:$,height:X}){return{top:`${Z}px`,left:`${J}px`,width:`${$}px`,height:`${X}px`,position:"absolute"}}function _K(Z){return Z*100+"%"}function Xp(Z,J,$,X){return Z+$>X?J:$}function MP(Z,J,$){return Z<0?J:$}function Qp(Z){return Math.max(0,Z)}function LY(Z){return Math.max(0,Z)}var AK=(Z,J,$)=>{let{left:X,height:Q,width:Y}=J,G=Z.top-(Q-Z.height);return{left:X,width:Y,height:MP(G,Z.height,Q),top:LY(G)}},MK=(Z,J,$)=>{let{top:X,left:Q,height:Y,width:G}=J;return{top:X,height:Y,width:Xp(Z.left,Z.width,G,$),left:Qp(Q)}},DK=(Z,J,$)=>{let{top:X,height:Q,width:Y}=J,G=Z.left+Z.width-Y;if(G<0)return{height:Q,width:Z.left+Z.width,top:LY(X),left:0};return{height:Q,width:Y,top:LY(X),left:G}},OK=(Z,J,$)=>{let{top:X,left:Q,height:Y,width:G}=J;return{width:G,left:Q,height:MP(X,Z.height,Y),top:LY(X)}},Yp=(Z,J,$)=>AK(Z,MK(Z,J,$)),Gp=(Z,J,$)=>AK(Z,DK(Z,J)),Hp=(Z,J,$)=>OK(Z,MK(Z,J,$)),zp=(Z,J,$)=>OK(Z,DK(Z,J)),Wp={n:AK,ne:Yp,e:MK,se:Hp,s:OK,sw:zp,w:DK,nw:Gp};function DP(Z,J,$,X){let Q=Wp[Z];if(!Q)return $;return Q(J,{...J,...$},X)}var Kp={type:"transform",scale:1,calcStyle(Z){return NY(Z)}};var OP=Kp,wP={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},PP={enabled:!0,bounded:!1,threshold:3},jP={enabled:!0,handles:["se"]},TP={enabled:!1,defaultItem:{w:1,h:1}};function wK(Z,J,$,X,Q){let Y=X==="x"?"w":"h";J[X]+=1;let G=Z.findIndex((z)=>z.i===J.i),H=Q??iZ(Z).length>0;for(let z=G+1;z<Z.length;z++){let W=Z[z];if(W===void 0)continue;if(W.static)continue;if(!H&&W.y>J.y+J.h)break;if(FY(J,W))wK(Z,W,$+J[Y],X,H)}J[X]=$}function qp(Z,J,$,X){J.x=Math.max(J.x,0),J.y=Math.max(J.y,0),J.y=Math.min(X,J.y);while(J.y>0&&!Q4(Z,J))J.y--;let Q;while((Q=Q4(Z,J))!==void 0)wK($,J,Q.y+Q.h,"y");return J.y=Math.max(J.y,0),J}function Vp(Z,J,$,X){J.x=Math.max(J.x,0),J.y=Math.max(J.y,0);while(J.x>0&&!Q4(Z,J))J.x--;let Q;while((Q=Q4(Z,J))!==void 0)if(wK(X,J,Q.x+Q.w,"x"),J.x+J.w>$){J.x=$-J.w,J.y++;while(J.x>0&&!Q4(Z,J))J.x--}return J.x=Math.max(J.x,0),J}var aZ={type:"vertical",allowOverlap:!1,compact(Z,J){let $=iZ(Z),X=lZ($),Q=BY(Z),Y=Array(Z.length);for(let G=0;G<Q.length;G++){let H=Q[G];if(H===void 0)continue;let z=F2(H);if(!z.static)z=qp($,z,Q,X),X=Math.max(X,z.y+z.h),$.push(z);let W=Z.indexOf(H);Y[W]=z,z.moved=!1}return Y}},PK={type:"horizontal",allowOverlap:!1,compact(Z,J){let $=iZ(Z),X=BK(Z),Q=Array(Z.length);for(let Y=0;Y<X.length;Y++){let G=X[Y];if(G===void 0)continue;let H=F2(G);if(!H.static)H=Vp($,H,J,X),$.push(H);let z=Z.indexOf(G);Q[z]=H,H.moved=!1}return Q}},jK={type:null,allowOverlap:!1,compact(Z,J){return c8(Z)}},Up={...aZ,allowOverlap:!0,compact(Z,J){return c8(Z)}},Bp={...PK,allowOverlap:!0,compact(Z,J){return c8(Z)}},Fp={...jK,allowOverlap:!0};function TK(Z,J=!1,$=!1){let X;if(J)if(Z==="vertical")X=Up;else if(Z==="horizontal")X=Bp;else X=Fp;else if(Z==="vertical")X=aZ;else if(Z==="horizontal")X=PK;else X=jK;if($)return{...X,preventCollision:$};return X}var U9=j(m(),1);function CK(Z={}){let{measureBeforeMount:J=!1,initialWidth:$=1280}=Z,[X,Q]=U9.useState($),[Y,G]=U9.useState(!J),H=U9.useRef(null),z=U9.useRef(null),W=U9.useCallback(()=>{let K=H.current;if(K){let q=K.offsetWidth;if(Q(q),!Y)G(!0)}},[Y]);return U9.useEffect(()=>{let K=H.current;if(!K)return;if(W(),typeof ResizeObserver<"u"){let q=null;return z.current=new ResizeObserver((V)=>{let U=V[0];if(U){let B=U.contentRect.width;if(q!==null)cancelAnimationFrame(q);q=requestAnimationFrame(()=>{Q(B),q=null})}}),z.current.observe(K),()=>{if(q!==null)cancelAnimationFrame(q);if(z.current)z.current.disconnect(),z.current=null}}return()=>{if(z.current)z.current.disconnect(),z.current=null}},[W]),{width:X,mounted:Y,containerRef:H,measureWidth:W}}var O0=j(m(),1),Pj=j(TY(),1),jj=j(Dj(),1);var N2=j(a(),1),H6=j(SP(),1);function rK(Z){let{children:J,cols:$,containerWidth:X,margin:Q,containerPadding:Y,rowHeight:G,maxRows:H,isDraggable:z,isResizable:W,isBounded:K,static:q,useCSSTransforms:V=!0,usePercentages:U=!1,transformScale:B=1,positionStrategy:F,dragThreshold:N=0,droppingPosition:L,className:_="",style:M,handle:O="",cancel:D="",x:A,y:T,w:S,h:k,minW:P=1,maxW:g=1/0,minH:C=1,maxH:I=1/0,i:y,resizeHandles:b,resizeHandle:R,constraints:x=LK,layoutItem:v,layout:d=[],onDragStart:w,onDrag:z0,onDragStop:G0,onResizeStart:E,onResize:s,onResizeStop:A0}=Z,[l,H0]=O0.useState(!1),[q0,X0]=O0.useState(!1),Q0=O0.useRef(null),V0=O0.useRef({left:0,top:0}),p=O0.useRef({top:0,left:0,width:0,height:0}),Z0=O0.useRef(void 0),e=O0.useRef(d);e.current=d;let _0=O0.useRef(null),i=O0.useRef(null),W0=O0.useRef(!1),r=O0.useRef({x:0,y:0}),o=O0.useRef(!1),f=O0.useMemo(()=>({cols:$,containerPadding:Y,containerWidth:X,margin:Q,maxRows:H,rowHeight:G}),[$,Y,X,Q,H,G]),u=O0.useMemo(()=>({cols:$,maxRows:H,containerWidth:X,containerHeight:0,rowHeight:G,margin:Q,layout:[]}),[$,H,X,G,Q]),L0=O0.useCallback(()=>({...u,layout:e.current}),[u]),M0=O0.useMemo(()=>v??{i:y,x:A,y:T,w:S,h:k,minW:P,maxW:g,minH:C,maxH:I},[v,y,A,T,S,k,P,g,C,I]),h0=O0.useCallback((E0)=>{if(F?.calcStyle)return F.calcStyle(E0);if(V)return NY(E0);let x0=NK(E0);if(U)return{...x0,left:_K(E0.left/X),width:_K(E0.width/X)};return x0},[F,V,U,X]),l0=O0.useCallback((E0,{node:x0})=>{if(!w)return;let{offsetParent:s0}=x0;if(!s0)return;let n0=s0.getBoundingClientRect(),z1=x0.getBoundingClientRect(),B1=z1.left/B,C1=n0.left/B,g1=z1.top/B,H1=n0.top/B,m1;if(F?.calcDragPosition){let p0=E0;m1=F.calcDragPosition(p0.clientX,p0.clientY,p0.clientX-z1.left,p0.clientY-z1.top)}else m1={left:B1-C1+s0.scrollLeft,top:g1-H1+s0.scrollTop};if(V0.current=m1,N>0){let p0=E0;r.current={x:p0.clientX,y:p0.clientY},W0.current=!0,o.current=!1,H0(!0);return}H0(!0);let H5=dZ(f,m1.top,m1.left),{x:V5,y:T0}=rZ(x,M0,H5.x,H5.y,L0());w(y,V5,T0,{e:E0,node:x0,newPosition:m1})},[w,B,f,F,N,x,M0,L0,y]),h=O0.useCallback((E0,{node:x0,deltaX:s0,deltaY:n0})=>{if(!z0||!l)return;let z1=E0;if(W0.current&&!o.current){let V5=z1.clientX-r.current.x,T0=z1.clientY-r.current.y;if(Math.hypot(V5,T0)<N)return;if(o.current=!0,W0.current=!1,w){let S0=dZ(f,V0.current.top,V0.current.left),{x:o0,y:q1}=rZ(x,M0,S0.x,S0.y,L0());w(y,o0,q1,{e:E0,node:x0,newPosition:V0.current})}}let B1=V0.current.top+n0,C1=V0.current.left+s0;if(K){let{offsetParent:V5}=x0;if(V5){let T0=V5.clientHeight-V9(k,G,Q[1]);B1=uZ(B1,0,T0);let p0=X4(f),S0=X-V9(S,p0,Q[0]);C1=uZ(C1,0,S0)}}let g1={top:B1,left:C1};V0.current=g1;let H1=dZ(f,B1,C1),{x:m1,y:H5}=rZ(x,M0,H1.x,H1.y,L0());z0(y,m1,H5,{e:E0,node:x0,newPosition:g1})},[z0,w,l,N,K,k,G,Q,f,X,S,y,x,M0,L0]),c=O0.useCallback((E0,{node:x0})=>{if(!G0||!l)return;let s0=W0.current;if(W0.current=!1,o.current=!1,r.current={x:0,y:0},s0){H0(!1),V0.current={left:0,top:0};return}let{left:n0,top:z1}=V0.current,B1={top:z1,left:n0};H0(!1),V0.current={left:0,top:0};let C1=dZ(f,z1,n0),{x:g1,y:H1}=rZ(x,M0,C1.x,C1.y,L0());G0(y,g1,H1,{e:E0,node:x0,newPosition:B1})},[G0,l,f,x,M0,L0,y]);_0.current=l0,i.current=h;let t=O0.useCallback((E0,{node:x0,size:s0,handle:n0},z1,B1)=>{let C1=B1==="onResizeStart"?E:B1==="onResize"?s:A0;if(!C1)return;let g1;if(x0)g1=DP(n0,z1,s0,X);else g1={...s0,top:z1.top,left:z1.left};p.current=g1;let H1=NP(f,g1.width,g1.height),{w:m1,h:H5}=AP(x,M0,H1.w,H1.h,n0,L0());C1(y,m1,H5,{e:E0.nativeEvent,node:x0,size:g1,handle:n0})},[E,s,A0,X,f,y,x,M0,L0]),U0=O0.useCallback((E0,x0)=>{X0(!0);let s0=cZ(f,A,T,S,k),n0={...x0,handle:x0.handle};t(E0,n0,s0,"onResizeStart")},[t,f,A,T,S,k]),C0=O0.useCallback((E0,x0)=>{let s0=cZ(f,A,T,S,k),n0={...x0,handle:x0.handle};t(E0,n0,s0,"onResize")},[t,f,A,T,S,k]),m0=O0.useCallback((E0,x0)=>{X0(!1),p.current={top:0,left:0,width:0,height:0};let s0=cZ(f,A,T,S,k),n0={...x0,handle:x0.handle};t(E0,n0,s0,"onResizeStop")},[t,f,A,T,S,k]);O0.useEffect(()=>{if(!L)return;let E0=Q0.current;if(!E0)return;let x0=Z0.current||{left:0,top:0},s0=l&&(L.left!==x0.left||L.top!==x0.top);if(!l){let n0={node:E0,deltaX:L.left,deltaY:L.top,lastX:0,lastY:0,x:L.left,y:L.top};_0.current?.(L.e,n0)}else if(s0){let n0=L.left-V0.current.left,z1=L.top-V0.current.top,B1={node:E0,deltaX:n0,deltaY:z1,lastX:V0.current.left,lastY:V0.current.top,x:L.left,y:L.top};i.current?.(L.e,B1)}Z0.current=L},[L,l,y]);let w1=cZ(f,A,T,S,k,l?V0.current:null,q0?p.current:null),b1=O0.default.Children.only(J),v0=X4(f),i0=[V9(P,v0,Q[0]),V9(C,G,Q[1])],e0=[V9(g,v0,Q[0]),V9(I,G,Q[1])],f0=b1.props,Q1=f0.className,K5=f0.style,x1=O0.default.cloneElement(b1,{ref:Q0,className:aK("react-grid-item",Q1,_,{static:q,resizing:q0,"react-draggable":z,"react-draggable-dragging":l,dropping:Boolean(L),cssTransforms:V}),style:{...M,...K5,...h0(w1)}}),q5=R;return x1=N2.jsx(jj.Resizable,{draggableOpts:{disabled:!W},className:W?void 0:"react-resizable-hide",width:w1.width,height:w1.height,minConstraints:i0,maxConstraints:e0,onResizeStart:U0,onResize:C0,onResizeStop:m0,transformScale:B,resizeHandles:b,handle:q5,children:x1}),x1=N2.jsx(Pj.DraggableCore,{disabled:!z,onStart:l0,onDrag:h,onStop:c,handle:O,cancel:".react-resizable-handle"+(D?","+D:""),scale:B,nodeRef:Q0,children:x1}),x1}var L2=()=>{},Oj="react-grid-layout",Tj=!1;try{Tj=/firefox/i.test(navigator.userAgent)}catch{}function Sc(Z,J){let $=O0.default.Children.toArray(Z),X=O0.default.Children.toArray(J);if($.length!==X.length)return!1;for(let Q=0;Q<$.length;Q++){let Y=$[Q],G=X[Q];if(Y?.key!==G?.key)return!1}return!0}function wj(Z,J,$,X){let Q=[],Y=new Set;O0.default.Children.forEach(J,(H)=>{if(!O0.default.isValidElement(H)||H.key===null)return;let z=String(H.key);Y.add(z);let W=Z.find((K)=>K.i===z);if(W)Q.push(F2(W));else{let q=H.props["data-grid"];if(q)Q.push({i:z,x:q.x??0,y:q.y??0,w:q.w??1,h:q.h??1,minW:q.minW,maxW:q.maxW,minH:q.minH,maxH:q.maxH,static:q.static,isDraggable:q.isDraggable,isResizable:q.isResizable,resizeHandles:q.resizeHandles,isBounded:q.isBounded});else Q.push({i:z,x:0,y:lZ(Q),w:1,h:1})}});let G=FK(Q,{cols:$});return X.compact(G,$)}function ZJ(Z){let{children:J,width:$,gridConfig:X,dragConfig:Q,resizeConfig:Y,dropConfig:G,positionStrategy:H=OP,compactor:z,constraints:W=LK,layout:K=[],droppingItem:q,autoSize:V=!0,className:U="",style:B={},innerRef:F,onLayoutChange:N=L2,onDragStart:L=L2,onDrag:_=L2,onDragStop:M=L2,onResizeStart:O=L2,onResize:D=L2,onResizeStop:A=L2,onDrop:T=L2,onDropDragOver:S=L2}=Z,k=O0.useMemo(()=>({...wP,...X}),[X]),P=O0.useMemo(()=>({...PP,...Q}),[Q]),g=O0.useMemo(()=>({...jP,...Y}),[Y]),C=O0.useMemo(()=>({...TP,...G}),[G]),{cols:I,rowHeight:y,maxRows:b,margin:R,containerPadding:x}=k,{enabled:v,bounded:d,handle:w,cancel:z0,threshold:G0}=P,{enabled:E,handles:s,handleComponent:A0}=g,{enabled:l,defaultItem:H0,onDragOver:q0}=C,X0=z??TK("vertical"),Q0=X0.type,V0=X0.allowOverlap,p=X0.preventCollision??!1,Z0=O0.useMemo(()=>q??{i:"__dropping-elem__",...H0},[q,H0]),e=H.type==="transform",_0=H.scale,i=x??R,[W0,r]=O0.useState(!1),[o,f]=O0.useState(()=>wj(K,J,I,X0)),[u,L0]=O0.useState(null),[M0,h0]=O0.useState(!1),[l0,h]=O0.useState(null),[c,t]=O0.useState(),U0=O0.useRef(null),C0=O0.useRef(null),m0=O0.useRef(null),w1=O0.useRef(0),b1=O0.useRef(o),v0=O0.useRef(K),i0=O0.useRef(J),e0=O0.useRef(Q0),f0=O0.useRef(o);f0.current=o,O0.useEffect(()=>{if(r(!0),!H6.deepEqual(o,K))N(o)},[]),O0.useEffect(()=>{if(u)return;if(l0)return;let T0=!H6.deepEqual(K,v0.current),p0=!Sc(J,i0.current),S0=Q0!==e0.current;if(T0||p0||S0){let q1=wj(T0?K:o,J,I,X0);if(!H6.deepEqual(q1,o))f(q1)}v0.current=K,i0.current=J,e0.current=Q0},[K,J,I,Q0,X0,u,l0,o]),O0.useEffect(()=>{if(!u&&!H6.deepEqual(o,b1.current)){b1.current=o;let T0=o.filter((p0)=>p0.i!==Z0.i);N(T0)}},[o,u,N,Z0.i]);let Q1=O0.useMemo(()=>{if(!V)return;let T0=lZ(o),p0=i[1];return T0*y+(T0-1)*R[1]+p0*2+"px"},[V,o,y,R,i]),K5=O0.useCallback((T0,p0,S0,o0)=>{let q1=f0.current,F1=Y4(q1,T0);if(!F1)return;let f1={w:F1.w,h:F1.h,x:F1.x,y:F1.y,i:T0};U0.current=F2(F1),m0.current=q1,L0(f1),L(q1,F1,F1,null,o0.e,o0.node)},[L]),x1=O0.useCallback((T0,p0,S0,o0)=>{let q1=f0.current,F1=U0.current,f1=Y4(q1,T0);if(!f1)return;let j5={w:f1.w,h:f1.h,x:f1.x,y:f1.y,i:T0},p1=$4(q1,f1,p0,S0,!0,p,Q0,I,V0);_(p1,F1,f1,j5,o0.e,o0.node),f(X0.compact(p1,I)),L0(j5)},[p,Q0,I,V0,X0,_]),q5=O0.useCallback((T0,p0,S0,o0)=>{if(!u)return;let q1=f0.current,F1=U0.current,f1=Y4(q1,T0);if(!f1)return;let j5=$4(q1,f1,p0,S0,!0,p,Q0,I,V0),p1=X0.compact(j5,I);M(p1,F1,f1,null,o0.e,o0.node);let c5=m0.current;if(U0.current=null,m0.current=null,L0(null),f(p1),c5&&!H6.deepEqual(c5,p1))N(p1)},[u,p,Q0,I,V0,X0,M,N]),E0=O0.useCallback((T0,p0,S0,o0)=>{let q1=f0.current,F1=Y4(q1,T0);if(!F1)return;C0.current=F2(F1),m0.current=q1,h0(!0),O(q1,F1,F1,null,o0.e,o0.node)},[O]),x0=O0.useCallback((T0,p0,S0,o0)=>{let q1=f0.current,F1=C0.current,{handle:f1}=o0,j5=!1,p1,c5,[HJ,Z2]=_P(q1,T0,(r1)=>{if(p1=r1.x,c5=r1.y,["sw","w","nw","n","ne"].includes(f1)){if(["sw","nw","w"].includes(f1))p1=r1.x+(r1.w-p0),p0=r1.x!==p1&&p1<0?r1.w:p0,p1=p1<0?0:p1;if(["ne","n","nw"].includes(f1))c5=r1.y+(r1.h-S0),S0=r1.y!==c5&&c5<0?r1.h:S0,c5=c5<0?0:c5;j5=!0}if(p&&!V0){if(UK(q1,{...r1,w:p0,h:S0,x:p1??r1.x,y:c5??r1.y}).filter((WJ)=>WJ.i!==r1.i).length>0)c5=r1.y,S0=r1.h,p1=r1.x,p0=r1.w,j5=!1}return r1.w=p0,r1.h=S0,r1});if(!Z2)return;let $3=HJ;if(j5&&p1!==void 0&&c5!==void 0)$3=$4(HJ,Z2,p1,c5,!0,p,Q0,I,V0);let zJ={w:Z2.w,h:Z2.h,x:Z2.x,y:Z2.y,i:T0,static:!0};D($3,F1,Z2,zJ,o0.e,o0.node),f(X0.compact($3,I)),L0(zJ)},[p,Q0,I,V0,X0,D]),s0=O0.useCallback((T0,p0,S0,o0)=>{let q1=f0.current,F1=C0.current,f1=Y4(q1,T0),j5=X0.compact(q1,I);A(j5,F1,f1??null,null,o0.e,o0.node);let p1=m0.current;if(C0.current=null,m0.current=null,L0(null),h0(!1),f(j5),p1&&!H6.deepEqual(p1,j5))N(j5)},[I,X0,A,N]),n0=O0.useCallback(()=>{let T0=f0.current;if(!T0.some((o0)=>o0.i===Z0.i)){h(null),L0(null),t(void 0);return}let S0=X0.compact(T0.filter((o0)=>o0.i!==Z0.i),I);f(S0),h(null),L0(null),t(void 0)},[Z0.i,I,X0]),z1=O0.useCallback((T0)=>{if(T0.preventDefault(),T0.stopPropagation(),Tj&&!T0.nativeEvent.target?.classList.contains(Oj))return!1;let p0=q0?q0(T0.nativeEvent):S(T0);if(p0===!1){if(l0)n0();return!1}let{dragOffsetX:S0=0,dragOffsetY:o0=0,...q1}=p0??{},F1={...Z0,...q1},f1=T0.currentTarget.getBoundingClientRect(),j5={cols:I,margin:R,maxRows:b,rowHeight:y,containerWidth:$,containerPadding:i},p1=X4(j5),c5=V9(F1.w,p1,R[0]),HJ=V9(F1.h,y,R[1]),Z2=c5/2,$3=HJ/2,zJ=T0.clientX-f1.left+S0-Z2,r1=T0.clientY-f1.top+o0-$3,iY=Math.max(0,zJ),WJ=Math.max(0,r1),KJ={left:iY/_0,top:WJ/_0,e:T0.nativeEvent};if(!l0){let rY=LP(j5,WJ,iY,F1.w,F1.h);h(N2.jsx("div",{},F1.i)),t(KJ);let SS=f0.current.filter((IS)=>IS.i!==F1.i);f([...SS,{...F1,x:rY.x,y:rY.y,static:!1,isDraggable:!0}])}else if(c){if(c.left!==KJ.left||c.top!==KJ.top)t(KJ)}},[l0,c,Z0,q0,S,n0,_0,I,R,b,y,$,i]),B1=O0.useCallback((T0)=>{if(T0.preventDefault(),T0.stopPropagation(),w1.current--,w1.current<0)w1.current=0;if(w1.current===0)n0()},[n0]),C1=O0.useCallback((T0)=>{T0.preventDefault(),T0.stopPropagation(),w1.current++},[]),g1=O0.useCallback((T0)=>{T0.preventDefault(),T0.stopPropagation();let p0=f0.current,S0=p0.find((o0)=>o0.i===Z0.i);w1.current=0,n0(),T(p0,S0,T0.nativeEvent)},[Z0.i,n0,T]),H1=O0.useCallback((T0,p0)=>{if(!T0||!T0.key)return null;let S0=Y4(o,String(T0.key));if(!S0)return null;let o0=typeof S0.isDraggable==="boolean"?S0.isDraggable:!S0.static&&v,q1=typeof S0.isResizable==="boolean"?S0.isResizable:!S0.static&&E,F1=S0.resizeHandles||[...s],f1=o0&&d&&S0.isBounded!==!1,j5=A0;return N2.jsx(rK,{containerWidth:$,cols:I,margin:R,containerPadding:i,maxRows:b,rowHeight:y,cancel:z0,handle:w,onDragStart:K5,onDrag:x1,onDragStop:q5,onResizeStart:E0,onResize:x0,onResizeStop:s0,isDraggable:o0,isResizable:q1,isBounded:f1,useCSSTransforms:e&&W0,usePercentages:!W0,transformScale:_0,positionStrategy:H,dragThreshold:G0,w:S0.w,h:S0.h,x:S0.x,y:S0.y,i:S0.i,minH:S0.minH,minW:S0.minW,maxH:S0.maxH,maxW:S0.maxW,static:S0.static,droppingPosition:p0?c:void 0,resizeHandles:F1,resizeHandle:j5,constraints:W,layoutItem:S0,layout:o,children:T0},S0.i)},[o,$,I,R,i,b,y,z0,w,K5,x1,q5,E0,x0,s0,v,E,d,e,W0,_0,H,G0,c,s,A0,W]),m1=()=>{if(!u)return null;return N2.jsx(rK,{w:u.w,h:u.h,x:u.x,y:u.y,i:u.i,className:`react-grid-placeholder ${M0?"placeholder-resizing":""}`,containerWidth:$,cols:I,margin:R,containerPadding:i,maxRows:b,rowHeight:y,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:e,transformScale:_0,constraints:W,layout:o,children:N2.jsx("div",{})})},H5=aK(Oj,U),V5={height:Q1,...B};return N2.jsxs("div",{ref:F,className:H5,style:V5,onDrop:l?g1:void 0,onDragLeave:l?B1:void 0,onDragEnter:l?C1:void 0,onDragOver:l?z1:void 0,children:[O0.default.Children.map(J,(T0)=>{if(!O0.default.isValidElement(T0))return null;return H1(T0)}),l&&l0&&H1(l0,!0),m1()]})}var z6=j(a(),1);function sK({items:Z,editing:J,renderItem:$,onLayoutChange:X}){let[Q,Y]=JJ.useState(()=>pZ(Z,[])),[G,H]=JJ.useState(Z),{width:z,containerRef:W,mounted:K}=CK({measureBeforeMount:!0});if(G!==Z)H(Z),Y((V)=>{let U=new Map(V.map((L)=>[L.i,L])),B=Z.filter((L)=>U.has(L.id)).map((L)=>({...U.get(L.id),w:L.w,h:L.h})),F=new Set(B.map((L)=>L.i)),N=pZ(Z.filter((L)=>!F.has(L.id)),B);return[...B,...N]});let q=JJ.useCallback((V)=>{Y(V),X?.(V.map((U)=>({id:U.i,w:U.w,h:U.h,x:U.x,y:U.y})))},[X]);return z6.jsx("div",{ref:W,className:"mx-auto w-full max-w-[var(--column-w)]",children:K&&z6.jsx(ZJ,{width:z,layout:Q,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!J},resizeConfig:{enabled:!1},compactor:aZ,onLayoutChange:q,children:Q.map((V)=>z6.jsx("div",{children:z6.jsx(n1.div,{layoutId:V.i,"data-snapshot-widget":V.i,className:"size-full",transition:{type:"spring",duration:0.35,bounce:0},children:$(V.i)})},V.i))})})}function Cj({items:Z,editing:J,renderItem:$,onLayoutChange:X,onRemove:Q}){return z6.jsx(sK,{items:Z,editing:J,onLayoutChange:X,renderItem:(Y)=>z6.jsx(UY,{editing:J,onRemove:Q?()=>Q(Y):void 0,children:$(Y)})})}var W6=j(m(),1);function Sj(Z){let J=Z1();return a1({mutationFn:({key:$,thumbnails:X})=>n7(`/api/workspaces/${Z}/thumbnails`,R5("PUT",{key:$,thumbnails:X}),"Failed to save thumbnails"),onMutate:({key:$})=>{J.setQueryData(D0.layout(Z),(X)=>X?{...X,widgetThumbnails:{key:$,at:new Date().toISOString()}}:X)},onSuccess:()=>{J.invalidateQueries({queryKey:D0.preview(Z)})}})}var Ec=(Z)=>Math.min(1,400/Math.max(Z.offsetWidth,Z.offsetHeight)),Ij=(Z,J)=>{let $=new Map(J.map((X)=>[X.id,X.tag]));return[...Z].sort().map((X)=>`${X}@${$.get(X)??""}`).join(" ")},kc=(Z)=>new Promise((J)=>{setTimeout(()=>J(null),Z)});async function Ej(Z){let{createContext:J,destroyContext:$,domToDataUrl:X}=await import("/chunk-jen6xcm1.js"),Q=async()=>{let Y=await J(Z,{scale:Ec(Z),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:1000,onCreateForeignObjectSvg:(G)=>{let H=document.createElement("style");H.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",G.append(H)}});try{return await X(Y)}finally{$(Y)}};return Promise.race([Q(),kc(1e4)])}var Rc=5000,yc=10800000;function kj({containerRef:Z,widgets:J,visibleIds:$,editing:X}){let{layout:Q,workspaceId:Y}=R1(),G=Sj(Y),H=W6.useRef(G.mutate);H.current=G.mutate;let z=W6.useRef(!1),[W,K]=W6.useState(0),q=Ij($,J),V=Date.parse(Q.widgetThumbnails?.at??""),U=!Number.isFinite(V)||Date.now()-V>yc,B=q!==""&&(q!==Q.widgetThumbnails?.key||U);W6.useEffect(()=>{if(!B||X)return;if(document.visibilityState!=="visible"){let L=()=>K((_)=>_+1);return document.addEventListener("visibilitychange",L,{once:!0}),()=>document.removeEventListener("visibilitychange",L)}let F=!1,N=setTimeout(async()=>{if(z.current)return;z.current=!0;try{let L={};for(let _ of $){if(F)return;let M=Z.current?.querySelector(`[data-snapshot-widget="${CSS.escape(_)}"]`),O=M?await Ej(M):null;if(O)L[_]=O}if(F)return;H.current({key:q,thumbnails:L})}finally{z.current=!1,K((L)=>L+1)}},Rc);return()=>{F=!0,clearTimeout(N)}},[q,B,X,W])}var $1=j(a(),1);function Rj(Z){return $1.jsx(qP,{name:Z})}var bc=Array.from({length:10},(Z,J)=>({id:`empty-widget-${J}`,w:2,h:1}));function xc(){return $1.jsx($8,{className:"size-full animate-none rounded-2xl [corner-shape:superellipse(1.2)]"})}function hc({onCreateWidget:Z}){return $1.jsxs("div",{className:"relative min-h-0 flex-1 pt-7",children:[$1.jsx("div",{"aria-hidden":"true",children:$1.jsx(sK,{items:bc,renderItem:xc})}),$1.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-6",children:$1.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-50% to-transparent to-75% text-center",children:[$1.jsxs("div",{className:"flex flex-col gap-1.5",children:[$1.jsx("h2",{className:"font-medium",children:"A little empty here"}),$1.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Widgets are small apps that can read data, perform tasks, and show a compact view of the information that matters."})]}),$1.jsxs(I0,{type:"button",variant:"secondary",size:"sm",onClick:Z,children:[$1.jsx(s5,{"data-icon":"inline-start",stroke:1.5}),"Create widget"]})]})})]})}function vc({editing:Z,onCreateWidget:J,onEditingChange:$}){return $1.jsxs("div",{className:"mx-auto mb-4 flex w-full max-w-(--column-w) shrink-0 items-center justify-end gap-2",children:[Z&&$1.jsxs(I0,{type:"button",variant:"ghost",size:"sm",className:"mr-auto",onClick:J,children:[$1.jsx(s5,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),$1.jsx(o9,{mode:"popLayout",initial:!1,children:Z?$1.jsx(n1.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:$1.jsx(I0,{type:"button",size:"sm",onClick:()=>$(!1),children:"Done"})},"done"):$1.jsx(n1.div,{className:"flex items-center gap-1",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:$1.jsx(I0,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground group-hover/widgets:opacity-100 [@media(hover:hover)]:opacity-0",onClick:()=>$(!0),children:"Edit widgets"})},"actions")})]})}function gc(){return $1.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-3",children:$1.jsx("p",{className:"text-sm text-muted-foreground",children:"No widgets added yet"})})}function mc(){let[Z,J]=s8.useState(0);return[s8.useCallback((X)=>{if(!X)return;let Q=new ResizeObserver(([Y])=>{let G=Y.borderBoxSize?.[0];J(G?G.blockSize:Y.contentRect.height)});return Q.observe(X),()=>Q.disconnect()},[]),Z]}function bj({onCreateWidget:Z,editing:J,onEditingChange:$,widgets:X}){let{layout:Q,setLayout:Y}=R1(),G=X.length>0,H=new Set(Q.widgetGrid.map((N)=>N.i)),z=Q.widgetGrid.filter((N)=>X.some((L)=>L.id===N.i)).map((N)=>{let L=X.find((_)=>_.id===N.i);return{id:N.i,w:L.config.colSpan,h:L.config.rowSpan,x:N.x,y:N.y}}),W=X.filter((N)=>!H.has(N.id)).map((N)=>({id:N.id,w:N.config.colSpan,h:N.config.rowSpan})),[K,q]=mc(),V=J&&W.length>0,U=s8.useRef(null);kj({containerRef:U,widgets:X,visibleIds:z.map((N)=>N.id),editing:J});function B(N){Y({widgetGrid:Q.widgetGrid.filter((L)=>L.i!==N)})}function F(N){let L=X.find((O)=>O.id===N);if(!L)return;let _=Q.widgetGrid.map((O)=>{let D=X.find((A)=>A.id===O.i);return{...O,w:D?.config.colSpan??1,h:D?.config.rowSpan??1}}),M=fZ(_,L.config.colSpan,L.config.rowSpan,4);Y({widgetGrid:[...Q.widgetGrid,{i:N,x:M.x,y:M.y}]})}return $1.jsx("div",{ref:U,className:"group/widgets relative min-h-0 flex-1",children:$1.jsxs(yj,{children:[$1.jsx("div",{className:B0("relative flex h-full flex-col p-4",G?"overflow-y-auto":"overflow-hidden"),children:G?$1.jsxs($1.Fragment,{children:[$1.jsx(vc,{editing:J,onCreateWidget:Z,onEditingChange:$}),z.length===0?$1.jsx(n1.div,{className:"mx-auto flex min-h-0 w-full max-w-[var(--column-w)] flex-1 flex-col",animate:{paddingBottom:V?q:0},transition:{type:"spring",duration:0.3,bounce:0},children:$1.jsx(gc,{})}):$1.jsx(n1.div,{animate:{marginBottom:V?q:0},transition:{type:"spring",duration:0.3,bounce:0},children:$1.jsx(Cj,{items:z,editing:J,renderItem:Rj,onRemove:B,onLayoutChange:(N)=>Y({widgetGrid:N.map((L)=>({i:L.id,x:L.x??0,y:L.y??0}))})})})]}):$1.jsx(hc,{onCreateWidget:Z})}),$1.jsx(o9,{children:G&&J&&W.length>0&&$1.jsx(BP,{ref:K,items:W,renderItem:Rj,onRestore:F})})]})})}var hj=j(a(),1);function xj({children:Z}){return hj.jsx("header",{className:"@container flex h-11 shrink-0 items-center gap-2.5 border-b border-border/75 px-3",children:Z})}var Yq=j(m(),1);var oK=j(m(),1);var _7=j(a(),1);function EY({title:Z,description:J,children:$}){return _7.jsxs("div",{className:"flex flex-col gap-6",children:[_7.jsxs("header",{className:"flex flex-col gap-1",children:[_7.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:Z}),J&&_7.jsx("p",{className:"text-sm text-muted-foreground",children:J})]}),$]})}function n8({label:Z,children:J}){return _7.jsxs("section",{className:"flex flex-col gap-2",children:[Z&&_7.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:Z}),_7.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-lg border border-border bg-card text-card-foreground",children:J})]})}function o8({title:Z,description:J,control:$}){return _7.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[_7.jsxs("div",{className:"flex min-w-0 flex-col",children:[_7.jsx("span",{className:"text-sm font-medium",children:Z}),J&&_7.jsx("span",{className:"text-xs text-muted-foreground",children:J})]}),$&&_7.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:$})]})}function vj(Z){return $5({queryKey:D0.env(Z),queryFn:()=>A1(`/api/workspaces/${Z}/env`),...x9})}function gj(Z){let J=Z1();return a1({mutationFn:($)=>A1(`/api/workspaces/${Z}/env`,R5("PUT",$)),onSuccess:($)=>{J.setQueryData(D0.env(Z),$)}})}function mj(Z){let J=Z1();return a1({mutationFn:($)=>n7(`/api/workspaces/${Z}/config`,R5("PUT",{name:$}),"Failed to save name"),onSuccess:()=>{J.invalidateQueries({queryKey:D0.layout(Z)}),J.invalidateQueries({queryKey:D0.all})}})}function fj(Z){let J=Z1();return a1({scope:{id:`workspace-icon:${Z}`},mutationFn:($)=>A1(`/api/workspaces/${Z}/icon`,{method:"PUT",headers:{"Content-Type":$.type||"application/octet-stream"},body:$}),onSuccess:()=>{J.invalidateQueries({queryKey:D0.layout(Z)}),J.invalidateQueries({queryKey:D0.all})}})}function pj(Z){let J=Z1();return a1({scope:{id:`workspace-icon:${Z}`},mutationFn:()=>n7(`/api/workspaces/${Z}/icon`,{method:"DELETE"},"Failed to reset icon"),onSuccess:()=>{J.invalidateQueries({queryKey:D0.layout(Z)}),J.invalidateQueries({queryKey:D0.all})}})}function uj(Z){let J=Z1();return W9(($)=>{if($.type==="env:updated"&&$.workspaceId===Z)J.invalidateQueries({queryKey:D0.env(Z)})}),{env:vj(Z),update:gj(Z)}}var Z5=j(a(),1),fc={dotenv:".env",custom:"secret",both:"override"},pc=/^[A-Za-z_][A-Za-z0-9_]*$/;function dj(){let{workspaceId:Z}=R1(),{env:J,update:$}=uj(Z),[X,Q]=oK.useState(""),[Y,G]=oK.useState(""),H=pc.test(X),z=H&&Y.length>0&&!$.isPending,W=()=>{if(!z)return;$.mutate({set:{[X]:Y}},{onSuccess:()=>{Q(""),G("")}})},K=J.data?.vars??[],q=J.data?.files.reduce((U,B)=>U+B.count,0)??0,V=J.data?.files.length??0;return Z5.jsxs(EY,{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:[Z5.jsxs(n8,{label:"Variables",children:[J.isLoading?Z5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:Z5.jsx(G7,{className:"size-4 animate-spin",stroke:1.75})}):K.length===0?Z5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):K.map((U)=>{let B=U.source!=="dotenv";return Z5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[Z5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:U.key}),Z5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),Z5.jsx("span",{className:B0("rounded-sm px-1.5 py-0.5 text-[11px] font-medium",U.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:fc[U.source]}),!B&&Z5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),Z5.jsx(I0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>$.mutate({remove:[U.key]}),disabled:!B,"aria-label":`Delete ${U.key}`,className:"disabled:invisible",children:Z5.jsx(cj,{stroke:1.75})})]},U.key)}),Z5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[Z5.jsx(x2,{value:X,onChange:(U)=>Q(U.target.value),placeholder:"NEW_KEY","aria-invalid":X.length>0&&!H,className:"h-7 w-40 font-mono text-xs"}),Z5.jsx(x2,{value:Y,onChange:(U)=>G(U.target.value),onKeyDown:(U)=>{if(U.key==="Enter")W()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),Z5.jsxs(I0,{variant:"outline",size:"sm",onClick:W,disabled:!z,children:[$.isPending?Z5.jsx(G7,{stroke:1.75,className:"animate-spin"}):Z5.jsx(s5,{stroke:1.75}),"Add"]})]})]}),Z5.jsx(n8,{label:"From .env files",children:Z5.jsx(o8,{title:"Inherit .env files",description:V>0?`Discovered ${q} ${q===1?"key":"keys"} across ${V} ${V===1?"file":"files"} in this space.`:"No .env files found in this space.",control:Z5.jsx(YQ,{checked:J.data?.inheritDotenv??!0,disabled:J.isLoading,onCheckedChange:(U)=>$.mutate({inheritDotenv:U})})})})]})}var lC=j(m(),1);var u5=j(m(),1);var y0=j(m(),1),t8=j(m(),1),k7=j(m(),1),VT=j(a(),1),RY=j(m(),1),yY=j(m(),1),X1=j(a(),1),uc=Object.defineProperty,cc=(Z,J)=>{for(var $ in J)uc(Z,$,{get:J[$],enumerable:!0})},_2={};cc(_2,{ActiveEmoji:()=>ST,Empty:()=>CT,List:()=>PT,Loading:()=>TT,Root:()=>NT,Search:()=>_T,SkinTone:()=>IT,SkinToneSelector:()=>jT,Viewport:()=>AT});var GT="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",Zq=["none","light","medium-light","medium","medium-dark","dark"];function tK(Z){return Z.charAt(0).toUpperCase()+Z.slice(1)}var F9=2,Z7=null;function lj(Z){try{Z7??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!Z7||(queueMicrotask(()=>{Z7&&(Z7=null)}),Z7.canvas.width=F9,Z7.canvas.height=F9,Z7.font=`2px ${GT}`,Z7.textBaseline="middle",Z7.measureText(Z).width>=F9*2))return!1;Z7.fillStyle="#00f",Z7.fillText(Z,0,0);let J=Z7.getImageData(0,0,F9,F9).data;Z7.clearRect(0,0,F9,F9),Z7.fillStyle="#f00",Z7.fillText(Z,0,0);let $=Z7.getImageData(0,0,F9,F9).data;for(let X=0;X<F9*F9*4;X+=4)if(J[X]!==$[X]||J[X+1]!==$[X+1]||J[X+2]!==$[X+2])return!1;return!0}function ij(Z,J,$){try{let X=Z.getItem(J);if(!X)throw Error(`No value found for "${J}".`);let Q=JSON.parse(X);return $(Q)}catch{return null}}function HT(Z,J,$){Z.setItem(J,JSON.stringify($))}function rj(Z){return(J)=>J===void 0?void 0:Z(J)}function aj(Z){return(J)=>J===null?null:Z(J)}function p5(Z){if(typeof Z!="string")throw Error();return Z}function kY(Z){if(typeof Z!="number")throw Error();return Z}function zT(Z){if(typeof Z!="boolean")throw Error();return Z}function z4(Z){return(J)=>{if(typeof J!="object"||J===null)throw Error();let $={};for(let X in Z){let Q=J[X];Q===void 0&&Z[X](void 0),$[X]=Z[X](Q)}return $}}function eK(Z){return(J)=>{if(!Array.isArray(J))throw Error();return J.length>0&&Z(J[0]),J}}var WT=(Z,J)=>`${Z}/${J}/data.json`,KT=(Z,J)=>`${Z}/${J}/messages.json`,dc=["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"],sj="en",qT=(Z)=>`frimousse/data/${Z}`,nj="frimousse/metadata";async function oj(Z,J){try{return(await fetch(Z,{method:"HEAD",signal:J})).headers.get("etag")}catch{return null}}async function lc(Z,J,$){let[{emojis:X,emojisEtag:Q},{messages:Y,messagesEtag:G}]=await Promise.all([fetch(WT(Z,J),{signal:$}).then(async(H)=>({emojis:await H.json(),emojisEtag:H.headers.get("etag")})),fetch(KT(Z,J),{signal:$}).then(async(H)=>({messages:await H.json(),messagesEtag:H.headers.get("etag")}))]);return{emojis:X,messages:Y,emojisEtag:Q,messagesEtag:G}}async function ic(Z,J,$){let[X,Q]=await Promise.all([oj(WT(Z,J),$),oj(KT(Z,J),$)]);return{emojisEtag:X,messagesEtag:Q}}function rc(Z){return Z.skins?Z.skins.filter((J)=>typeof J.tone=="number").reduce((J,$)=>{let X=Zq[$.tone];return J[X]=$.emoji,J},{}):void 0}async function tj(Z,J,$){let{emojis:X,emojisEtag:Q,messages:Y,messagesEtag:G}=await lc(Z,J,$),H=Y.subgroups.find((B)=>B.key==="country-flag"||B.key==="subdivision-flag"),z=Y.groups.filter((B)=>B.key!=="component"),W=X.filter((B)=>("group"in B)),K=z.map((B)=>({index:B.order,label:tK(B.message)})),q=Y.skinTones.reduce((B,F)=>(B[F.key]=tK(F.message),B),{}),V=W.map((B)=>({emoji:B.emoji,category:B.group,version:B.version,label:tK(B.label),tags:B.tags??[],countryFlag:H&&B.subgroup===H.order||void 0,skins:rc(B)})),U={locale:J,emojis:V,categories:K,skinTones:q};return HT(localStorage,qT(J),{data:U,metadata:{emojisEtag:Q,messagesEtag:G}}),U}function ac(Z,J){let $=new Map;for(let G of Z)$.has(G.version)||$.set(G.version,G.emoji);let X=[...$.keys()].sort((G,H)=>H-G),Q=X[0]??0,Y=lj("\uD83C\uDDEA\uD83C\uDDFA");if(typeof J=="number")return{emojiVersion:J,countryFlags:Y};for(let G of X){let H=$.get(G);if(lj(H))return{emojiVersion:G,countryFlags:Y}}return{emojiVersion:Q,countryFlags:Y}}var sc=z4({emojiVersion:kY,countryFlags:zT}),nc=z4({data:z4({locale:p5,emojis:eK(z4({emoji:p5,category:kY,label:p5,version:kY,tags:eK(p5),countryFlag:rj(zT),skins:rj(z4({light:p5,"medium-light":p5,medium:p5,"medium-dark":p5,dark:p5}))})),categories:eK(z4({index:kY,label:p5})),skinTones:z4({light:p5,"medium-light":p5,medium:p5,"medium-dark":p5,dark:p5})}),metadata:z4({emojisEtag:aj(p5),messagesEtag:aj(p5)})});async function oc({locale:Z,emojiVersion:J,emojibaseUrl:$,signal:X}){let Q=typeof $=="string"?$:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof J=="number"?Math.floor(J):"latest"}`,Y=ij(sessionStorage,nj,sc),G=ij(localStorage,qT(Z),nc),H;if(!G)H=await tj(Q,Z,X);else if(Y)H=G.data;else try{let{emojisEtag:W,messagesEtag:K}=await ic(Q,Z,X);H=!W||!K||W!==G.metadata.emojisEtag||K!==G.metadata.messagesEtag?await tj(Q,Z,X):G.data}catch{H=G.data}Y??=ac(H.emojis,J),HT(sessionStorage,nj,Y);let z=H.emojis.filter((W)=>{let K=W.version<=Y.emojiVersion;return W.countryFlag?K&&Y.countryFlags:K});return{locale:Z,emojis:z,categories:H.categories,skinTones:H.skinTones}}function ej(Z){return dc.includes(Z)?Z:(console.warn(`Locale "${Z}" is not supported, using "${sj}" instead.`),sj)}function ZT(Z){return Zq.includes(Z)?Z:(console.warn(`Skin tone "${Z}" is not valid, using "none" instead.`),"none")}function tc(Z,J){let $=[];if(J<=0)return $;for(let X=0,Q=Z.length;X<Q;X+=J)$.push(Z.slice(X,X+J));return $}function ec(Z,J){if(!J)return Z;let $=J.toLowerCase().trim(),X=new WeakMap;return Z.filter((Q)=>{let Y=0;Q.label.toLowerCase().includes($)&&(Y+=10);for(let G of Q.tags)G.toLowerCase().includes($)&&(Y+=1);return Y>0?(X.set(Q,Y),!0):!1}).sort((Q,Y)=>(X.get(Y)??0)-(X.get(Q)??0))}function Zd(Z,J,$,X){let Q=ec(Z.emojis,X),Y=[],G=[],H=[],z={},W=0,K=0;for(let q of Q)z[q.category]||(z[q.category]=[]),z[q.category].push({emoji:$&&$!=="none"&&q.skins?q.skins[$]:q.emoji,label:q.label});for(let q of Z.categories){let V=z[q.index];if(!V||V.length===0)continue;let U=tc(Array.from(V),J).map((B)=>({categoryIndex:W,emojis:B}));Y.push(...U),G.push({label:q.label,rowsCount:U.length,startRowIndex:K}),H.push(K),W++,K+=U.length}return{count:Q.length,categories:G,categoriesStartRowIndices:H,rows:Y,skinTones:Z.skinTones}}function Jd(Z){let J={},$=null,X=null,Q=new Set,Y=()=>{if($){J=$,$=null;for(let W of Q)W(J)}X=null},G=()=>$??J,H=(W)=>{$??=J,Object.assign($,typeof W=="function"?W(G()):W),X||(X=requestAnimationFrame(Y))},z=(W)=>(Q.add(W),()=>Q.delete(W));return J=Z(H,G),{get:G,set:H,subscribe:z}}function $d(Z){let[J]=k7.useState(Z);return J}function Xd(Z){let J=k7.createContext(null);return{useStore:()=>{let $=k7.useContext(J);if(!$)throw Error(Z);return $},Provider:({store:$,children:X})=>VT.jsx(J.Provider,{value:$,children:X})}}function E7(Z,J,$=Object.is){let[X,Q]=k7.useState(()=>J(Z.get()));return k7.useEffect(()=>Z.subscribe(()=>{let Y=J(Z.get());Q((G)=>$(G,Y)?G:Y)}),[Z,J,$]),k7.useDebugValue(X),X}function t9(Z,J,$){let X=k7.useCallback((Q)=>Q[J],[J]);return E7(Z,X,$)}var JT=2;function Qd(Z,J,$,X,Q){let Y=0;return Jd((G,H)=>({locale:J,columns:$,sticky:X,skinTone:Q,onEmojiSelect:Z,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:(z)=>{let W=H(),K=z?.data??W.data,q=z?.categoryHeaderHeight??W.categoryHeaderHeight,V=z?.rowHeight??W.rowHeight,U=z?.viewportHeight??W.viewportHeight;if(!K||K.rows.length===0||!q||!V||!U)return G({...z,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let B=0,F=0;for(let S of K.categories)if(F++*q+S.startRowIndex*V<Y)B+=q;else break;let N=K.categories.length*q+K.rows.length*V,L=Math.floor(JT*V/2),_=Math.ceil(JT*V/2),M=Math.min(Y-B-L,N-U),O=M+U+_,D=Math.max(0,Math.floor(M/V)),A=Math.min(K.rows.length-1,Math.ceil(O/V)),T=K.rows[D]?.categoryIndex;return G(T===void 0&&z?z:{...z,viewportStartCategoryIndex:T,viewportStartRowIndex:D,viewportEndRowIndex:A})},onDataChange:(z)=>{H().updateViewportState({data:z,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(z)=>{G({search:z,interaction:z?"keyboard":"none"})},onActiveEmojiChange:(z,W,K)=>{if(G({interaction:z,activeColumnIndex:W,activeRowIndex:K}),z!=="keyboard")return;let{listRef:q,viewportRef:V,sticky:U,rowHeight:B,viewportHeight:F,categoryHeaderHeight:N}=H(),L=q?.current,_=V?.current;if(!L||!_||!B||!N||!F)return;let M=K;M===0&&_.scrollTo({top:0,behavior:"instant"});let O=L.querySelector(`[aria-rowindex="${M}"]`);if(!(O instanceof HTMLElement))return;let D=O.offsetTop,A=getComputedStyle(O),T=Number.parseFloat(A.scrollMarginTop),S=Number.parseFloat(A.scrollMarginBottom),k=Y+T;U&&D<Y+F/2&&(k+=N);let P=k+F-S;(D<k||D+B>P)&&_.scrollTo({top:Math.max(D<k+N?D-Math.max(U?N:0,T):D-F+B+S,0),behavior:"instant"})},onActiveEmojiReset:()=>{G({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(z)=>{H().updateViewportState({rowHeight:z})},onCategoryHeaderHeightChange:(z)=>{H().updateViewportState({categoryHeaderHeight:z})},onViewportSizeChange:(z,W)=>{H().updateViewportState({viewportWidth:z,viewportHeight:W})},onViewportScroll:(z)=>{Y=z,H().updateViewportState()}}))}var{useStore:A7,Provider:Yd}=Xd("EmojiPicker.Root is missing.");function Gd(Z){return Z.search}function Jq(Z){return Z.interaction==="none"?void 0:Z.data?.rows[Z.activeRowIndex]?.emojis[Z.activeColumnIndex]}function Hd(Z){return Z.data===void 0||typeof Z.data?.count=="number"&&Z.data.count===0}function zd(Z){return Z.data===null||Z.viewportHeight===null||Z.rowHeight===null||Z.categoryHeaderHeight===null}function UT(Z){return Z.data?.rows.length}function Wd(Z){return Z.data?.categories.length}function Kd(Z){return Z.data?.categoriesStartRowIndices}function qd(Z){return Z.data?.skinTones}function BT(Z,J){return Z?.emoji===J?.emoji}function Vd(Z,J){return Z?.categoryIndex!==J?.categoryIndex||Z?.emojis.length!==J?.emojis.length?!1:!!Z?.emojis.every(($,X)=>BT($,J?.emojis[X]))}var $J="",$T=/\p{Emoji_Modifier_Base}/u,Ud=/\uFE0F$/,Bd=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,Fd={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function Ld(Z,J){if(!Z.split($J).some((X)=>$T.test(X)))return Z;let $=Z.split($J).map((X)=>X.replace(Bd,"")).join($J);return J==="none"?$:$.split($J).map((X,Q,Y)=>{let G=Y.length>1;return!$T.test(X)||G&&X==="\uD83E\uDD1D"?X:X.replace(Ud,"")+Fd[J]}).join($J)}function Nd(Z){return Zq.map((J)=>({skinTone:J,emoji:Ld(Z,J)}))}function FT(){let Z=A7(),J=E7(Z,Jq,BT);return t8.useDeferredValue(J)}function LT(Z="✋"){let J=A7(),$=t9(J,"skinTone"),X=t8.useMemo(()=>Nd(Z),[Z]),Q=t8.useCallback((Y)=>{J.set({skinTone:Y})},[]);return[$,Q,X]}function $q(Z,J){if(Object.is(Z,J))return!0;if(typeof Z!="object"||typeof J!="object"||Z===null||J===null||Array.isArray(Z)!==Array.isArray(J))return!1;let $=Object.keys(Z),X=Object.keys(J);return $.length!==X.length?!1:$.every((Q)=>(Q in J)&&Z[Q]===J[Q])}function _d(...Z){}function Ad(Z,J){let $=null;if(typeof window.requestIdleCallback=="function")$=window.requestIdleCallback(Z,J);else{let X=Date.now();$=window.setTimeout(()=>{Z({didTimeout:!1,timeRemaining:()=>Math.max(0,(J?.timeout??50)-(Date.now()-X))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback($):window.clearTimeout($)}}var L9=typeof window<"u"?RY.useLayoutEffect:RY.useEffect;function Md(Z){let J=yY.useRef(Z);return L9(()=>{J.current=Z}),yY.useCallback((...$)=>J.current(...$),[])}function Dd({emojiVersion:Z,emojibaseUrl:J}){let[$,X]=y0.useState(void 0),Q=A7(),Y=t9(Q,"locale"),G=t9(Q,"columns"),H=t9(Q,"skinTone"),z=t9(Q,"search");return y0.useEffect(()=>{let W=new AbortController,K=W.signal;return oc({locale:Y,emojiVersion:Z,emojibaseUrl:J,signal:K}).then((q)=>{X(q)}).catch((q)=>{K.aborted||console.error(q)}),()=>{W.abort()}},[Z,J,Y]),y0.useEffect(()=>{if($)return Ad(()=>{Q.get().onDataChange(Zd($,G,H,z))},{timeout:100})},[$,G,H,z]),null}var NT=y0.forwardRef(({locale:Z="en",columns:J=9,skinTone:$="none",onEmojiSelect:X=_d,emojiVersion:Q,emojibaseUrl:Y,onFocusCapture:G,onBlurCapture:H,children:z,style:W,sticky:K=!0,...q},V)=>{let U=Md(X),B=$d(()=>Qd(U,ej(Z),J,K,ZT($))),[F,N]=y0.useState(!1),L=y0.useRef(null),_=y0.useCallback((D)=>{D&&(L.current=D,B.set({rootRef:L}))},[]);L9(()=>{B.set({locale:ej(Z)})},[Z]),L9(()=>{B.set({columns:J})},[J]),L9(()=>{B.set({sticky:K})},[K]),L9(()=>{B.set({skinTone:ZT($)})},[$]);let M=y0.useCallback((D)=>{G?.(D);let{searchRef:A,viewportRef:T}=B.get(),S=D.target===A?.current||D.target.hasAttribute("frimousse-search"),k=D.target===T?.current||D.target.hasAttribute("frimousse-viewport");D.isDefaultPrevented()||(N(S||k),D.isDefaultPrevented()||(N(S||k),k?B.get().onActiveEmojiChange("keyboard",0,0):S&&B.get().search===""&&B.set({interaction:"none"})))},[G]),O=y0.useCallback((D)=>{H?.(D),!D.isDefaultPrevented()&&!D.currentTarget.contains(D.relatedTarget)&&N(!1)},[H]);return L9(()=>{F||B.get().onActiveEmojiReset()},[F]),y0.useImperativeHandle(V,()=>L.current),y0.useEffect(()=>{if(!F)return;function D(A){if(A.defaultPrevented||!A.key.startsWith("Arrow")&&A.key!=="Enter")return;let{data:T,onEmojiSelect:S,onActiveEmojiChange:k,interaction:P,activeColumnIndex:g,activeRowIndex:C}=B.get();if(A.key==="Enter"){let I=Jq(B.get());I&&(A.preventDefault(),S(I))}if(A.key.startsWith("Arrow")){let I=g,y=C;if(A.preventDefault(),P!=="none"){if(T?.rows&&T.rows.length>0)switch(A.key){case"ArrowLeft":{if(I===0){let b=y-1,R=T.rows[b];R&&(y=b,I=R.emojis.length-1)}else I-=1;break}case"ArrowRight":{if(I===T.rows[y].emojis.length-1){let b=y+1;T.rows[b]&&(y=b,I=0)}else I+=1;break}case"ArrowUp":{let b=T.rows[y-1];b&&(y-=1,b.emojis[I]||(I=b.emojis.length-1));break}case"ArrowDown":{let b=T.rows[y+1];b&&(y+=1,b.emojis[I]||(I=b.emojis.length-1));break}}k("keyboard",I,y)}else k("keyboard",0,0)}}return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[F]),L9(()=>{let D=null,A=null,T=null,S=null,k=B.subscribe((y)=>{L.current&&(D!==y.viewportWidth&&(D=y.viewportWidth,L.current.style.setProperty("--frimousse-viewport-width",`${y.viewportWidth}px`)),A!==y.viewportHeight&&(A=y.viewportHeight,L.current.style.setProperty("--frimousse-viewport-height",`${y.viewportHeight}px`)),T!==y.rowHeight&&(T=y.rowHeight,L.current.style.setProperty("--frimousse-row-height",`${y.rowHeight}px`)),S!==y.categoryHeaderHeight&&(S=y.categoryHeaderHeight,L.current.style.setProperty("--frimousse-category-header-height",`${y.categoryHeaderHeight}px`)))}),{viewportWidth:P,viewportHeight:g,rowHeight:C,categoryHeaderHeight:I}=B.get();return P&&L.current.style.setProperty("--frimousse-viewport-width",`${P}px`),g&&L.current.style.setProperty("--frimousse-viewport-height",`${g}px`),C&&L.current.style.setProperty("--frimousse-row-height",`${C}px`),I&&L.current.style.setProperty("--frimousse-category-header-height",`${I}px`),k},[]),X1.jsx("div",{"data-focused":F?"":void 0,"frimousse-root":"",onBlurCapture:O,onFocusCapture:M,...q,ref:_,style:{"--frimousse-emoji-font":GT,...W},children:X1.jsxs(Yd,{store:B,children:[X1.jsx(Dd,{emojiVersion:Q,emojibaseUrl:Y}),z]})})}),_T=y0.forwardRef(({value:Z,defaultValue:J,onChange:$,...X},Q)=>{let Y=A7(),G=y0.useRef(null),H=y0.useCallback((q)=>{q&&(G.current=q,Y.set({searchRef:G}))},[]),z=typeof Z=="string",W=y0.useRef(z);y0.useEffect(()=>{W.current=z},[z]),L9(()=>{Y.set({search:typeof Z=="string"?Z:typeof J=="string"?J:""})},[]),L9(()=>{typeof Z=="string"&&Y.get().onSearchChange(Z)},[Z]);let K=y0.useCallback((q)=>{$?.(q),q.isDefaultPrevented()||Y.get().onSearchChange(q.target.value)},[$]);return y0.useImperativeHandle(Q,()=>G.current),X1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...X,defaultValue:J,onChange:K,ref:H,value:Z})}),Od=y0.memo(()=>{let Z=FT();return Z?X1.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:Z.label}):null}),AT=y0.forwardRef(({children:Z,onScroll:J,onKeyDown:$,style:X,...Q},Y)=>{let G=A7(),H=y0.useRef(null),z=y0.useCallback((V)=>{V&&(H.current=V,G.set({viewportRef:H}))},[]),W=E7(G,UT),K=E7(G,Wd),q=y0.useCallback((V)=>{J?.(V),G.get().onViewportScroll(V.currentTarget.scrollTop)},[J]);return L9(()=>{if(!H.current)return;let V=new ResizeObserver(([U])=>{let B=U?.borderBoxSize[0]?.inlineSize??0,F=U?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:N,viewportHeight:L,viewportWidth:_}=G.get();(L!==F||_!==B)&&N(B,F)});return V.observe(H.current),G.get().onViewportSizeChange(H.current.offsetWidth,H.current.clientHeight),()=>{V.disconnect()}},[]),y0.useImperativeHandle(Y,()=>H.current),X1.jsxs("div",{"frimousse-viewport":"",...Q,onScroll:q,ref:z,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof W=="number"&&typeof K=="number"?`var(--frimousse-viewport-width, auto) calc(${W} * var(--frimousse-row-height) + ${K} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...X},children:[X1.jsx(Od,{}),Z]})});function MT(Z,J,$){return{emoji:{...Z,isActive:$},role:"gridcell","aria-colindex":J,"aria-selected":$||void 0,"aria-label":Z.label,"data-active":$?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function DT(Z,J=!1){return{role:J?void 0:"row","aria-rowindex":J?void 0:Z,"frimousse-row":"",style:{contain:J?void 0:"content",height:J?void 0:"var(--frimousse-row-height)",display:"flex"}}}function OT(Z,J){return{"frimousse-category":"",style:{contain:"content",top:J?`calc(${Z} * var(--frimousse-category-header-height) + ${J.startRowIndex} * var(--frimousse-row-height))`:void 0,height:J?`calc(var(--frimousse-category-header-height) + ${J.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function wT(Z,J=!1,$=!0){return{category:Z,"frimousse-category-header":"",style:{contain:J?void 0:"layout paint",height:J?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:$?"sticky":void 0,top:0}}}function XT(Z,J,$,X){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${Z} * var(--frimousse-row-height) + ${J} * var(--frimousse-category-header-height))`,paddingTop:`calc(${$} * var(--frimousse-row-height) + ${X} * var(--frimousse-category-header-height))`}}}function QT(Z,J,$){return{"aria-colcount":Z,"aria-rowcount":J,"frimousse-list":"",style:{"--frimousse-list-columns":Z,...$},role:"grid"}}function wd(Z){Z.preventDefault()}var Pd=y0.memo(({Emoji:Z,emoji:J,columnIndex:$,rowIndex:X})=>{let Q=A7(),Y=E7(Q,(W)=>Jq(W)?.emoji===J.emoji),G=y0.useCallback(()=>{Q.get().onEmojiSelect(J)},[J]),H=y0.useCallback(()=>{Q.get().onActiveEmojiChange("pointer",$,X)},[$,X]),z=y0.useCallback(()=>{Q.get().onActiveEmojiReset()},[]);return X1.jsx(Z,{...MT(J,$,Y),onClick:G,onPointerDown:wd,onPointerEnter:H,onPointerLeave:z})}),jd=y0.memo(({Row:Z,Emoji:J,rowIndex:$})=>{let X=A7(),Q=E7(X,(Y)=>Y.data?.rows[$],Vd);return Q?X1.jsx(Z,{...DT($),children:Q.emojis.map((Y,G)=>X1.jsx(Pd,{Emoji:J,columnIndex:G,emoji:Y,rowIndex:$},Y.label))}):null}),Td=y0.memo(({CategoryHeader:Z,categoryIndex:J})=>{let $=A7(),X=E7($,(Y)=>Y.data?.categories[J],$q),Q=t9($,"sticky");return X?X1.jsx("div",{...OT(J,X),children:X1.jsx(Z,{...wT({label:X.label},!1,Q)})}):null}),YT=y0.memo(({CategoryHeader:Z,Row:J,Emoji:$})=>{let X=y0.useRef(null),Q=A7(),Y=t9(Q,"columns"),G=y0.useMemo(()=>Array(Y).fill({emoji:"\uD83D\uDE42",label:""}),[Y]),H=y0.useMemo(()=>({label:"Category"}),[]),z=y0.useRef(null),W=y0.useRef(null);return L9(()=>{let K=X.current?.parentElement?.parentElement;if(!K||!z.current||!W.current)return;let q=new ResizeObserver((B)=>{for(let F of B){let N=F.contentRect.height,{onRowHeightChange:L,onCategoryHeaderHeightChange:_,rowHeight:M,categoryHeaderHeight:O}=Q.get();F.target===z.current&&M!==N&&L(N),F.target===W.current&&O!==N&&_(N)}});q.observe(K),q.observe(z.current),q.observe(W.current);let{onRowHeightChange:V,onCategoryHeaderHeightChange:U}=Q.get();return V(z.current.clientHeight),U(W.current.clientHeight),()=>{q.disconnect()}},[]),X1.jsxs("div",{"aria-hidden":!0,ref:X,style:{height:0,visibility:"hidden"},children:[X1.jsx("div",{"frimousse-row-sizer":"",ref:z,children:X1.jsx(J,{...DT(-1,!0),children:G.map((K,q)=>X1.jsx($,{...MT(K,q,!1)},q))})}),X1.jsx("div",{...OT(-1),children:X1.jsx("div",{"frimousse-category-header-sizer":"",ref:W,children:X1.jsx(Z,{...wT(H,!0)})})})]})});function Cd({category:Z,...J}){return X1.jsx("div",{...J,children:Z.label})}function Sd({emoji:Z,...J}){return X1.jsx("button",{type:"button",...J,children:Z.emoji})}function Id({...Z}){return X1.jsx("div",{...Z})}var PT=y0.forwardRef(({style:Z,components:J,...$},X)=>{let Q=A7(),Y=y0.useRef(null),G=y0.useCallback((L)=>{L&&(Y.current=L,Q.set({listRef:Y}))},[]),H=J?.CategoryHeader??Cd,z=J?.Emoji??Sd,W=J?.Row??Id,K=t9(Q,"columns"),q=t9(Q,"viewportStartRowIndex"),V=t9(Q,"viewportEndRowIndex"),U=E7(Q,UT),B=E7(Q,Kd,$q),F=y0.useMemo(()=>B?.filter((L)=>L<q).length??0,[B,q]),N=B?.length??0;return y0.useImperativeHandle(X,()=>Y.current),!U||!B||N===0?X1.jsx("div",{...QT(K,0,Z),...$,children:X1.jsx("div",{...XT(0,0,0,0),children:X1.jsx(YT,{CategoryHeader:H,Emoji:z,Row:W})})}):X1.jsx("div",{...QT(K,U,Z),...$,ref:G,children:X1.jsxs("div",{...XT(U,N,q,F),children:[X1.jsx(YT,{CategoryHeader:H,Emoji:z,Row:W}),Array.from({length:V-q+1},(L,_)=>{let M=q+_,O=B.indexOf(M);return X1.jsxs(y0.Fragment,{children:[O>=0&&X1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),X1.jsx(jd,{Emoji:z,Row:W,rowIndex:M})]},M)}),Array.from({length:N},(L,_)=>X1.jsx(Td,{CategoryHeader:H,categoryIndex:_},_))]})})}),jT=y0.forwardRef(({emoji:Z,onClick:J,"aria-label":$="Change skin tone",...X},Q)=>{let Y=A7(),G=E7(Y,qd,$q),[H,z,W]=LT(Z),K=y0.useMemo(()=>Math.max(0,W.findIndex((N)=>N.skinTone===H)),[H,W]),q=W[K],V=W[(K+1)%W.length].skinTone,U=H==="none"?void 0:G?.[H],B=V==="none"?void 0:G?.[V],F=y0.useCallback((N)=>{J?.(N),N.isDefaultPrevented()||z(V)},[J,z,V]);return X1.jsx("button",{type:"button",...X,"aria-label":$+(B?` (${B})`:""),"aria-live":"polite","aria-valuetext":U,"frimousse-skin-tone-selector":"",onClick:F,ref:Q,children:q.emoji})});function TT({children:Z,...J}){let $=A7();return E7($,zd)?X1.jsx("span",{"frimousse-loading":"",...J,children:Z}):null}function Ed({children:Z}){let J=A7(),$=E7(J,Gd);return Z({search:$})}function CT({children:Z,...J}){let $=A7();return E7($,Hd)?X1.jsx("span",{"frimousse-empty":"",...J,children:typeof Z=="function"?X1.jsx(Ed,{children:Z}):Z}):null}function ST({children:Z}){let J=FT();return Z({emoji:J})}function IT({children:Z,emoji:J}){let[$,X,Q]=LT(J);return Z({skinTone:$,setSkinTone:X,skinToneVariations:Q})}NT.displayName="EmojiPicker.Root";_T.displayName="EmojiPicker.Search";AT.displayName="EmojiPicker.Viewport";PT.displayName="EmojiPicker.List";TT.displayName="EmojiPicker.Loading";CT.displayName="EmojiPicker.Empty";jT.displayName="EmojiPicker.SkinToneSelector";ST.displayName="EmojiPicker.ActiveEmoji";IT.displayName="EmojiPicker.SkinTone";var QJ=[{id:"rocket",Icon:_C},{id:"sparkles",Icon:OC},{id:"bolt",Icon:bT},{id:"flame",Icon:eT},{id:"star",Icon:wC},{id:"heart",Icon:QC},{id:"diamond",Icon:oT},{id:"trophy",Icon:SC},{id:"target",Icon:jC},{id:"bulb",Icon:mT},{id:"brain",Icon:hT},{id:"robot",Icon:NC},{id:"wand",Icon:EC},{id:"atom",Icon:RT},{id:"flask",Icon:ZC},{id:"cpu",Icon:rT},{id:"code",Icon:lT},{id:"terminal",Icon:TC},{id:"api",Icon:kT},{id:"database",Icon:sT},{id:"cube",Icon:aT},{id:"hexagon",Icon:YC},{id:"plug",Icon:LC},{id:"tool",Icon:CC},{id:"settings",Icon:XJ},{id:"bug",Icon:gT},{id:"activity",Icon:ET},{id:"chart",Icon:uT},{id:"briefcase",Icon:vT},{id:"folder",Icon:JC},{id:"file",Icon:N8},{id:"book",Icon:xT},{id:"message",Icon:KC},{id:"mail",Icon:zC},{id:"bell",Icon:yT},{id:"paperclip",Icon:WQ},{id:"key",Icon:bY},{id:"shield",Icon:AC},{id:"user",Icon:IC},{id:"home",Icon:GC},{id:"globe",Icon:XC},{id:"world",Icon:kC},{id:"planet",Icon:FC},{id:"compass",Icon:iT},{id:"map",Icon:WC},{id:"calendar",Icon:fT},{id:"cloud",Icon:dT},{id:"sun",Icon:PC},{id:"moon",Icon:qC},{id:"snowflake",Icon:DC},{id:"leaf",Icon:HC},{id:"mountain",Icon:VC},{id:"feather",Icon:tT},{id:"ghost",Icon:G6},{id:"music",Icon:UC},{id:"camera",Icon:pT},{id:"photo",Icon:BC},{id:"palette",Icon:xY},{id:"gamepad",Icon:nT},{id:"gift",Icon:$C},{id:"cart",Icon:MC},{id:"chef",Icon:cT}],RC=QJ.map((Z)=>Z.id),kd=new Map(QJ.map((Z)=>[Z.id,Z.Icon]));function hY(Z){return Z?kd.get(Z)??null:null}var Qq=[{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 Xq(Z,J,$){let X=$*Math.PI/180,Q=J*Math.cos(X),Y=J*Math.sin(X),G=(Z+0.3963377774*Q+0.2158037573*Y)**3,H=(Z-0.1055613458*Q-0.0638541728*Y)**3,z=(Z-0.0894841775*Q-1.291485548*Y)**3;return`#${[4.0767416621*G-3.3077115913*H+0.2309699292*z,-1.2684380046*G+2.6097574011*H-0.3413193965*z,-0.0041960863*G-0.7034186147*H+1.707614701*z].map((K)=>{let q=Math.min(1,Math.max(0,K)),V=q<=0.0031308?12.92*q:1.055*q**0.4166666666666667-0.055;return Math.round(V*255).toString(16).padStart(2,"0")}).join("")}`}function yC(){let Z=Math.random()*360,J=(35+Math.random()*55)*(Math.random()<0.5?-1:1),$=Math.round(115+Math.random()*55),X=Xq(0.83+Math.random()*0.06,0.09+Math.random()*0.06,Z),Q=Xq(0.5+Math.random()*0.14,0.17+Math.random()*0.07,Z+J);if(Math.random()<0.4){let Y=Xq(0.7+Math.random()*0.05,0.15,Z+J/2);return{angle:$,stops:[X,Y,Q]}}return{angle:$,stops:[X,Q]}}var Rd="radial-gradient(120% 100% at 28% 12%, rgba(255,255,255,0.32), rgba(255,255,255,0) 58%)";function vY(Z){return`${Rd}, linear-gradient(${Z.angle}deg, ${Z.stops.join(", ")})`}var P5=256;function bC(Z,J){let $=J.angle*Math.PI/180,X=Math.sin($),Q=-Math.cos($),Y=P5*(Math.abs(X)+Math.abs(Q))/2,G=P5/2,H=Z.createLinearGradient(G-X*Y,G-Q*Y,G+X*Y,G+Q*Y),z=J.stops.length-1;J.stops.forEach((K,q)=>H.addColorStop(z===0?0:q/z,K)),Z.fillStyle=H,Z.fillRect(0,0,P5,P5);let W=Z.createRadialGradient(P5*0.28,P5*0.12,0,P5*0.28,P5*0.12,P5*1.1);W.addColorStop(0,"rgba(255,255,255,0.32)"),W.addColorStop(0.58,"rgba(255,255,255,0)"),Z.fillStyle=W,Z.fillRect(0,0,P5,P5)}function xC(Z){return new Promise((J,$)=>{Z.toBlob((X)=>X?J(X):$(Error("Canvas is empty")),"image/png")})}function hC(){let Z=document.createElement("canvas");Z.width=P5,Z.height=P5;let J=Z.getContext("2d");if(!J)throw Error("2D canvas unavailable");return[Z,J]}var yd=0.92,bd=0.68;async function vC(Z,J){let[$,X]=hC();if(J)bC(X,J);X.textAlign="center",X.textBaseline="middle";let Q=J?bd:yd;return X.font=`${Math.round(P5*Q)}px "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif`,X.fillText(Z,P5/2,P5/2+P5*0.04),xC($)}function xd(Z){return new Promise((J,$)=>{let X=new Image;X.onload=()=>J(X),X.onerror=()=>$(Error("Failed to load SVG")),X.src=Z})}var hd=0.78,vd=0.6;async function gC(Z,J){let[$,X]=hC();if(J)bC(X,J);let Q=J?"#ffffff":"#18181b",Y=Z.replace(/currentColor/g,Q),G=await xd(`data:image/svg+xml;utf8,${encodeURIComponent(Y)}`),H=P5*(J?vd:hd),z=(P5-H)/2;return X.drawImage(G,z,z,H,H),xC($)}var mC=["\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","☕"],gY="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var g0=j(a(),1);function gd({category:Z,...J}){return g0.jsx("div",{className:"bg-background px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",...J,children:Z.label})}function md({children:Z,...J}){return g0.jsx("div",{className:"scroll-my-1 px-1.5",...J,children:Z})}function fd({emoji:Z,...J}){return g0.jsx("button",{className:B0("flex size-9 items-center justify-center rounded-lg text-[22px] transition-colors duration-75 data-[active]:bg-muted",gY),...J,children:Z.emoji})}function dC({icon:Z}){let{workspaceId:J,provider:$}=R1(),{isPending:X,mutateAsync:Q}=fj(J),{isPending:Y,mutate:G}=pj(J),[H,z]=u5.useState("emoji"),[W,K]=u5.useState({id:"sunrise",gradient:Qq[0].gradient}),[q,V]=u5.useState(null),[U,B]=u5.useState(null),[F,N]=u5.useState(""),[L,_]=u5.useState(null),[M,O]=u5.useState(null),[D,A]=u5.useState(!1),[T,S]=u5.useState(null),k=u5.useRef(null),P=u5.useRef(null),g=u5.useRef(null),C=QJ.find((w)=>w.id===L),I=W.gradient!==null,y=X||Y,b=()=>{let w=yC();V(w),K({id:"shuffle",gradient:w})},R=(w)=>{S(null),g.current=w,z("upload"),O(URL.createObjectURL(w))};u5.useEffect(()=>{let w=!1,z0=async()=>{let E;if(H==="upload"){if(!g.current)return;E=g.current}else if(H==="emoji"){if(!U)return;E=await vC(U,W.gradient)}else{let s=P.current?.querySelector("svg");if(!s)return;E=await gC(new XMLSerializer().serializeToString(s),W.gradient)}if(!w)await Q(E)};S(null);let G0=window.setTimeout(()=>{z0().catch((E)=>{if(!w)S(E instanceof Error?E.message:"Failed to save icon")})},150);return()=>{w=!0,window.clearTimeout(G0)}},[W.gradient,U,H,Q,C,M]),u5.useEffect(()=>{return()=>{if(M)URL.revokeObjectURL(M)}},[M]);let x=()=>{g.current=null,B(null),_(null),O(null),S(null),G()},v=H==="emoji"&&U?"emoji":H==="icon"&&C?"glyph":"image",d=H==="upload"&&M?M:Z??Y2[$??"claude-code"];return g0.jsxs("div",{className:"flex gap-6",children:[g0.jsxs("div",{className:"flex w-24 shrink-0 flex-col items-center gap-2.5",children:[g0.jsx("div",{className:B0("flex size-24 items-center justify-center overflow-hidden rounded-[24px] shadow-sm ring-1 ring-border",v!=="image"&&!I&&"bg-[repeating-conic-gradient(#0000000d_0%_25%,transparent_0%_50%)] bg-[length:16px_16px]"),style:v!=="image"&&W.gradient?{background:vY(W.gradient)}:void 0,children:v==="emoji"?g0.jsx("span",{className:B0("leading-none",gY,I?"text-[64px]":"text-[86px]"),children:U}):v==="glyph"&&C?g0.jsx(C.Icon,{stroke:1.5,className:B0(I?"size-14 text-white":"size-18 text-foreground")}):g0.jsx("img",{src:d,alt:"",className:"size-full object-cover"})}),g0.jsx("button",{type:"button",onClick:x,disabled:y,className:"text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",children:"Reset to default"})]}),g0.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[g0.jsx("div",{className:"flex gap-1 self-start rounded-lg bg-muted p-0.5",children:["emoji","icon","upload"].map((w)=>g0.jsx("button",{type:"button",onClick:()=>z(w),className:B0("rounded-md px-3.5 py-1 text-xs font-medium capitalize transition-colors",H===w?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:w},w))}),g0.jsxs("div",{className:B0("flex items-center gap-2",H==="upload"&&"pointer-events-none opacity-35"),children:[g0.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Background"}),g0.jsxs("div",{className:"flex items-center gap-2",children:[g0.jsx("button",{type:"button","aria-label":"No background",onClick:()=>K({id:"none",gradient:null}),className:B0("flex size-7 items-center justify-center rounded-full bg-muted ring-offset-2 ring-offset-card transition-shadow",W.id==="none"?"ring-2 ring-primary":"ring-1 ring-border hover:ring-muted-foreground/30"),children:g0.jsx(pC,{size:16,stroke:1.75,className:"text-muted-foreground"})}),Qq.map((w)=>g0.jsx("button",{type:"button","aria-label":`${w.id} background`,onClick:()=>K({id:w.id,gradient:w.gradient}),style:{background:vY(w.gradient)},className:B0("size-7 rounded-full ring-offset-2 ring-offset-card transition-shadow",W.id===w.id?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30")},w.id)),g0.jsx("button",{type:"button","aria-label":"Random background",title:"Surprise me",onClick:b,style:q?{background:vY(q)}:void 0,className:B0("flex size-7 items-center justify-center rounded-full ring-offset-2 ring-offset-card transition-shadow",q?"text-white":"bg-muted text-muted-foreground ring-1 ring-border",W.id==="shuffle"?"ring-2 ring-primary":"hover:ring-2 hover:ring-muted-foreground/30"),children:g0.jsx(fC,{size:16,stroke:1.75})})]})]}),H==="emoji"?g0.jsxs(_2.Root,{onEmojiSelect:(w)=>B(w.emoji),emojibaseUrl:"/vendor/emojibase",columns:13,className:"isolate flex h-72 flex-col overflow-hidden rounded-lg border border-border bg-background",children:[g0.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[g0.jsx(_2.Search,{placeholder:"Search emoji…",onChange:(w)=>N(w.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-md bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),g0.jsx(_2.SkinToneSelector,{className:"size-8 shrink-0 rounded-md text-lg hover:bg-accent"})]}),g0.jsxs(_2.Viewport,{className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[g0.jsxs(_2.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[g0.jsx(G7,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),F.trim()===""&&g0.jsxs("div",{className:"border-b border-dashed border-border pb-1.5",children:[g0.jsx("p",{className:"px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground",children:"Favorites"}),g0.jsx("div",{className:"grid grid-cols-13 justify-items-start px-1.5",children:mC.map((w)=>g0.jsx("button",{type:"button",onClick:()=>B(w),className:B0("flex size-9 items-center justify-center rounded-lg text-[22px] transition-colors duration-75",gY,U===w?"bg-primary/10":"hover:bg-accent"),children:w},w))})]}),g0.jsxs(_2.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[g0.jsx(uC,{size:20,stroke:1.5}),"No emoji found"]}),g0.jsx(_2.List,{className:"pb-1.5 select-none",components:{CategoryHeader:gd,Row:md,Emoji:fd}})]})]}):H==="icon"?g0.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-lg border border-border bg-background p-1.5",children:QJ.map(({id:w,Icon:z0})=>g0.jsx("button",{type:"button","aria-label":w,onClick:()=>_(w),className:B0("flex aspect-square items-center justify-center rounded-lg text-muted-foreground transition-colors [&_svg]:size-5",L===w?"bg-primary/10 text-primary":"hover:bg-accent hover:text-accent-foreground"),children:g0.jsx(z0,{stroke:1.5})},w))}):g0.jsxs("button",{type:"button",onClick:()=>k.current?.click(),onDragOver:(w)=>{w.preventDefault(),A(!0)},onDragLeave:()=>A(!1),onDrop:(w)=>{w.preventDefault(),A(!1);let z0=w.dataTransfer.files?.[0];if(z0)R(z0)},className:B0("flex h-72 flex-col items-center justify-center gap-2 rounded-lg 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:[g0.jsx(cC,{size:24,stroke:1.5}),g0.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),g0.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]}),g0.jsx("div",{className:"min-h-4","aria-live":"polite",children:T?g0.jsx("p",{className:"text-xs text-destructive",children:T}):y?g0.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving…"}):null})]}),g0.jsx("input",{ref:k,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(w)=>{let z0=w.target.files?.[0];if(z0)R(z0);w.target.value=""}}),g0.jsx("span",{ref:P,"aria-hidden":!0,className:"hidden",children:C&&g0.jsx(C.Icon,{stroke:1.5})})]})}var k5=j(a(),1);function iC(){let{name:Z,icon:J,cwd:$,workspaceId:X}=R1(),[,Q]=p9(),Y=mj(X),G=SB(),[H,z]=lC.useState(Z??"");return k5.jsxs(EY,{title:"General",description:"Basic details for this space.",children:[k5.jsxs(n8,{children:[k5.jsx(o8,{title:"Name",description:"Shown in the sidebar and the workspace header.",control:k5.jsx(x2,{value:H,onChange:(q)=>z(q.target.value),onBlur:()=>{let q=H.trim();if(q===(Z??""))return;Y.mutate(q===""?null:q)},onKeyDown:(q)=>{if(q.key==="Enter")q.currentTarget.blur()},placeholder:"Space name",className:"w-56"})}),k5.jsx(o8,{title:"Path",control:k5.jsx(x2,{value:$??"",readOnly:!0,"aria-label":"Workspace path",title:$??void 0,className:"w-56"})}),k5.jsxs("div",{className:"flex flex-col gap-4 px-3.5 py-3.5",children:[k5.jsxs("div",{className:"flex flex-col",children:[k5.jsx("span",{className:"text-sm font-medium",children:"Icon"}),k5.jsx("span",{className:"text-xs text-muted-foreground",children:"Pick an emoji or a glyph on a generated background, or upload an image."})]}),k5.jsx(dC,{icon:J})]})]}),k5.jsxs(n8,{label:"Danger zone",children:[k5.jsx(o8,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:k5.jsxs(I0,{type:"button",variant:"destructive",size:"sm",onClick:()=>{let V=`Remove "${Z??$??"this space"}" from your workspaces?
|
|
61
|
-
|
|
62
|
-
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(V))return;G.mutate(X,{onSuccess:()=>Q("/")})},disabled:G.isPending,children:[G.isPending&&k5.jsx(G7,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})}),G.isError&&k5.jsx("p",{className:"px-3.5 py-3 text-xs text-destructive",children:G.error.message})]})]})}var l1=j(a(),1),pd=[{id:"general",label:"General",icon:XJ},{id:"environment",label:"Environment",icon:bY}];function rC(){let[Z,J]=Yq.useState(!1),[$,X]=Yq.useState("general");return l1.jsxs(l1.Fragment,{children:[l1.jsxs(l6,{delay:50,children:[l1.jsx(i6,{render:l1.jsx(I0,{variant:"ghost",size:"icon-sm","aria-label":"Space settings",onClick:()=>J(!0),children:l1.jsx(XJ,{stroke:1.75})})}),l1.jsx(r6,{children:"Space settings"})]}),l1.jsx(R$,{open:Z,onOpenChange:J,children:l1.jsxs(b$,{className:"flex h-[min(680px,90vh)] w-[880px] max-w-[94vw]",children:[l1.jsx(h3,{className:"sr-only",children:"Space settings"}),l1.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r border-border bg-muted/30 p-3",children:[l1.jsx("p",{className:"px-2.5 pt-4 pb-2 text-[11px] font-semibold tracking-wider text-muted-foreground/80 uppercase",children:"Settings"}),pd.map((Q)=>l1.jsxs(I0,{type:"button",variant:$===Q.id?"secondary":"ghost",size:"sm",onClick:()=>X(Q.id),className:"justify-start",children:[l1.jsx(Q.icon,{stroke:1.75}),Q.label]},Q.id))]}),l1.jsxs("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:[l1.jsx(y$,{render:l1.jsx(I0,{variant:"ghost",size:"icon","aria-label":"Close",className:"absolute top-3 right-3 z-10",children:l1.jsx(H9,{stroke:1.5})})}),l1.jsx("div",{className:"px-8 py-7",children:$==="general"?l1.jsx(iC,{}):l1.jsx(dj,{})})]})]})})]})}var K6=j(m(),1);var aC=!0;function mY({queryClient:Z,workspaceId:J,sessionId:$,parts:X}){let Q=`optimistic:${crypto.randomUUID()}`;return Z.setQueryData(D0.events(J,$),(Y)=>V3(Y??q3(),{kind:"turn",turn:{id:Q,role:"user",origin:{kind:"user-input"},parts:X,timestamp:new Date().toISOString()}})),W1.getState().setProcessing(J,$,!0),W1.getState().setError(J,$,null),Q}function fY(Z,J,$){let X=Z?.models,Q=!J||!X||X.some((z)=>z.value===J)?J:void 0,Y=X?.find((z)=>z.value===Q),G=$&&(!Y||(Y.supportedEffortLevels??[]).includes($))?$:void 0,H=aC&&Z?.supportsStreaming?!0:void 0;return{model:Q,effort:G,stream:H}}function ud(Z){return Z.filter((J)=>J.text.length>0).map((J)=>J.kind==="reasoning"?{type:"reasoning",text:J.text}:{type:"text",text:J.text})}function sC(Z){let J=ud(Z?.blocks??[]);if(J.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:J}}var cd=q3();function nC(){let Z=h5(),J=Z1(),{layout:$}=R1(),X=Y8(Z).data,Q=M7((F)=>F.activeByWorkspace[Z]??null),Y=M7((F)=>Q?F.processing[`${Z}:${Q}`]??!1:!1),G=M7((F)=>Q?F.errors[`${Z}:${Q}`]??null:null),H=PN(Z,Q).data??cd,z=M7((F)=>F.previews),W=K6.useMemo(()=>sC(sq(z,Z,Q).root),[z,Z,Q]),K=OX(Z,Q).data,q=K6.useCallback((F)=>{let N=F.trim(),_=(W1.getState().attachments[M9(Z,Q)]??[]).filter((C)=>C.status==="ready"&&C.upload);if(!N&&_.length===0)return;let M=Q,O=!1;if(!M)M=crypto.randomUUID(),O=!0,W1.getState().setActive(Z,M);let D=[];for(let C of _)if(C.upload?.kind==="image"&&C.previewUrl)D.push({type:"file",mediaType:C.mediaType,url:C.previewUrl,filename:C.name});else D.push({type:"file",mediaType:C.mediaType,url:"",filename:C.name});if(N)D.push({type:"text",text:N});let A=mY({queryClient:J,workspaceId:Z,sessionId:M,parts:D}),T=K?.model??$.selectedModel,S=K?.effort??$.selectedEffort,{model:k,effort:P,stream:g}=fY(X,T,S);if(wJ({type:"chat",workspaceId:Z,content:N,sessionId:M,isNew:O,optimisticId:A,model:k,effort:P,stream:g,..._.length>0?{attachments:_.map((C)=>C.upload.id)}:{}}),O)J.invalidateQueries({queryKey:D0.preview(Z)});W1.getState().clearAttachments(Z,Q)},[Q,Z,J,$.selectedModel,$.selectedEffort,K?.model,K?.effort,X]),V=K6.useCallback(()=>{if(!Q)return;W1.getState().setError(Z,Q,null)},[Q,Z]),U=K6.useCallback(()=>{if(!Y||!Q)return;wJ({type:"stop",workspaceId:Z,sessionId:Q})},[Y,Q,Z]),B=K6.useCallback((F)=>{W1.getState().setActive(Z,F)},[Z]);return{view:H,previewTurn:W,sessionId:Q,processing:Y,error:G,send:q,stop:U,switchThread:B,dismissError:V}}var A2=j(m(),1);var E1=j(a(),1);function oC({builder:Z,onSave:J,onSubmit:$,onOpenChat:X,onDiscard:Q}){let[Y,G]=A2.useState(Z.input.requirements),[H,z]=A2.useState(!1),[W,K]=A2.useState(null),q=A2.useRef(null),V=A2.useRef(J);V.current=J,A2.useEffect(()=>{if(Z.status!=="draft"||Y===Z.input.requirements)return;let B=setTimeout(()=>{V.current(Y).then(()=>K(null)).catch((F)=>K(F instanceof Error?F.message:"Could not save requirements"))},500);return()=>clearTimeout(B)},[Z.input.requirements,Z.status,Y]);let U=async(B)=>{if(B.preventDefault(),!Y.trim()||H)return;z(!0);try{await $(Y)}catch(F){K(F instanceof Error?F.message:"Could not start view builder"),z(!1)}};if(Z.status==="draft")return E1.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-3 py-6",children:E1.jsxs("div",{className:"flex w-full max-w-(--chat-max-container) flex-col gap-6",children:[E1.jsxs("div",{className:"flex flex-col gap-1 text-center",children:[E1.jsx("h1",{className:"font-medium",children:"What should this view do?"}),E1.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Describe the content, data, and actions you need."})]}),E1.jsxs(jX,{composerRef:q,onSubmit:U,children:[E1.jsx("label",{className:"sr-only",htmlFor:`view-builder-${Z.id}`,children:"View requirements"}),E1.jsx(TX,{textareaRef:q,id:`view-builder-${Z.id}`,value:Y,onChange:(B)=>G(B.target.value),onKeyDown:(B)=>{if(B.key==="Enter"&&(B.metaKey||B.ctrlKey))B.preventDefault(),B.currentTarget.form?.requestSubmit()},placeholder:"Build a customer dashboard with…",rows:1,className:"min-h-16","aria-describedby":W?`view-builder-error-${Z.id}`:void 0,"aria-invalid":Boolean(W),autoFocus:!0}),E1.jsxs(CX,{children:[E1.jsx(HQ,{scope:"workspace"}),E1.jsx(I0,{type:"submit",size:"icon",disabled:!Y.trim()||H,"aria-label":"Build view",children:H?E1.jsx(G7,{stroke:1.5,className:"animate-spin"}):E1.jsx(zQ,{stroke:1.5})})]})]}),W&&E1.jsx("p",{id:`view-builder-error-${Z.id}`,role:"alert",className:"text-sm text-destructive",children:W})]})});if(Z.status==="waiting")return E1.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:E1.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[E1.jsxs("div",{className:"flex flex-col gap-1",children:[E1.jsx("h1",{className:"text-lg font-semibold",children:"The view needs your attention"}),E1.jsx("p",{className:"text-sm text-muted-foreground",children:Z.error??"Open its chat to answer or ask the agent to continue."})]}),E1.jsxs("div",{className:"flex gap-2",children:[E1.jsx(I0,{onClick:X,children:"Open chat"}),E1.jsx(I0,{variant:"secondary",onClick:Q,children:"Discard"})]})]})});return E1.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:E1.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[E1.jsx(G7,{stroke:1.75,className:"animate-spin"}),Z.status==="ready"?"Opening view…":"Building your view…"]})})}function pY(Z,J){let $=Z??[];if($.findIndex((Q)=>Q.id===J.id)===-1)return[...$,J];return $.map((Q)=>Q.id===J.id&&Q.updatedAt<=J.updatedAt?J:Q)}function tC(Z){let J=Z1();return W9(($)=>{if($.type==="view-builder:updated"&&$.workspaceId===Z)J.setQueryData(D0.viewBuilders(Z),(X)=>pY(X,$.builder));else if($.type==="view-builder:deleted"&&$.workspaceId===Z)J.setQueryData(D0.viewBuilders(Z),(X)=>(X??[]).filter((Q)=>Q.id!==$.builderId))}),$5({queryKey:D0.viewBuilders(Z),queryFn:async()=>{return(await A1(`/api/workspaces/${Z}/view-builders`)).builders},...x9})}function eC(Z){let J=Z1();return a1({mutationFn:()=>A1(`/api/workspaces/${Z}/view-builders`,R5("POST"),"Failed to create view builder"),onSuccess:($)=>{J.setQueryData(D0.viewBuilders(Z),(X)=>pY(X,$))}})}function ZS(Z){let J=Z1();return a1({mutationFn:({builderId:$,requirements:X})=>A1(`/api/workspaces/${Z}/view-builders/${$}`,R5("PATCH",{input:{requirements:X}}),"Failed to save view requirements"),onSuccess:($)=>{J.setQueryData(D0.viewBuilders(Z),(X)=>pY(X,$))}})}function JS(Z){let J=Z1();return a1({mutationFn:({builderId:$,requirements:X,...Q})=>A1(`/api/workspaces/${Z}/view-builders/${$}/submit`,R5("POST",{input:{requirements:X},availableIcons:RC,...Q}),"Failed to start view builder"),onSuccess:($)=>{J.setQueryData(D0.viewBuilders(Z),(X)=>pY(X,$))}})}function $S(Z){let J=Z1();return a1({mutationFn:($)=>n7(`/api/workspaces/${Z}/view-builders/${$}`,{method:"DELETE"},"Failed to discard view builder"),onSuccess:($,X)=>{J.setQueryData(D0.viewBuilders(Z),(Q)=>(Q??[]).filter((Y)=>Y.id!==X))}})}function XS(){let Z=Z1(),{workspaceId:J,layout:$}=R1(),X=Y8(J).data,Q=eC(J),Y=ZS(J),G=JS(J),H=$S(J);return{create:()=>Q.mutateAsync(),save:(V,U)=>Y.mutateAsync({builderId:V,requirements:U}),submit:async(V,U)=>{let B=U.trim();if(!B)return;let F=mY({queryClient:Z,workspaceId:J,sessionId:V.sessionId,parts:[{type:"text",text:B}]});W1.getState().setActive(J,V.sessionId);let{model:N,effort:L,stream:_}=fY(X,$.selectedModel,$.selectedEffort);try{await G.mutateAsync({builderId:V.id,requirements:B,optimisticId:F,model:N,effort:L,stream:_})}catch(M){throw W1.getState().setProcessing(J,V.sessionId,!1),W1.getState().setError(J,V.sessionId,M instanceof Error?M.message:"Could not start view builder"),M}},discard:(V)=>H.mutateAsync(V)}}var e8=j(m(),1);function QS(Z){let J=document.documentElement,$=getComputedStyle(J).getPropertyValue(Z).trim(),X=Number.parseFloat($);if(!Number.isFinite(X))return 0;return $.endsWith("rem")?X*Number.parseFloat(getComputedStyle(J).fontSize):X}function YS(){let Z=e8.useRef(null),[J,$]=e8.useState(!1);return e8.useLayoutEffect(()=>{let X=Z.current;if(!X)return;let Q=(G)=>{let H=QS("--column-w"),z=QS("--chat-min");$(G-z>=H)};Q(X.getBoundingClientRect().width);let Y=new ResizeObserver(([G])=>{if(G)Q(G.contentRect.width)});return Y.observe(X),()=>Y.disconnect()},[]),{ref:Z,fits:J}}var uY=j(m(),1);var GS=["background","foreground"],Gq="mei-fonts";function HS(Z,J){let $=Z?.font??"default",X=Z?.background,Q=Z?.foreground;uY.useEffect(()=>{let Y=J.current;if(!Y)return;let G=f8[$]??f8.default;Y.style.setProperty("--font-sans",G.sans),Y.style.setProperty("--font-mono",G.mono);let H=document.getElementById(Gq);if(!G.googleFontsQuery)H?.remove();else{let z=`https://fonts.googleapis.com/css2?family=${G.googleFontsQuery}&display=swap`;if(H)H.href=z;else{let W=document.createElement("link");W.id=Gq,W.rel="stylesheet",W.href=z,document.head.appendChild(W)}}return()=>{Y.style.removeProperty("--font-sans"),Y.style.removeProperty("--font-mono")}},[$,J]),uY.useEffect(()=>{let Y=J.current;if(!Y)return;let G={background:X,foreground:Q};for(let H of GS){let z=G[H];if(z)Y.style.setProperty(`--${H}`,z);else Y.style.removeProperty(`--${H}`)}return()=>{for(let H of GS)Y.style.removeProperty(`--${H}`)}},[X,Q,J]),uY.useEffect(()=>()=>document.getElementById(Gq)?.remove(),[])}var i1=j(a(),1),dd=WS([$Z({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 ld({items:Z}){return i1.jsxs(B8,{children:[i1.jsx(F8,{render:i1.jsx(I0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:i1.jsx(s5,{stroke:1.75})})}),i1.jsx(d4,{align:"start",className:"min-w-48",children:i1.jsx(l4,{children:Z.map(({key:J,Icon:$,label:X,onClick:Q})=>i1.jsxs(KZ,{onClick:Q,className:"font-medium",children:[i1.jsx($,{stroke:2}),X]},J))})})]})}function zS(Z){let{tab:J,active:$}=Z,X=Z.preview===!0;return i1.jsxs("button",{type:"button","aria-hidden":X||void 0,"aria-label":J.label,disabled:X,tabIndex:X?-1:void 0,onClick:Z.preview?void 0:()=>Z.onSelect(J.key),className:dd({active:$,dragging:Z.preview?!1:Z.state.isDragging,preview:X}),...Z.preview?{}:Z.state.dragHandleProps,children:[i1.jsxs("div",{className:B0("flex items-center gap-1 overflow-hidden",J.closable&&"group-hover/tab:mr-3"),children:[i1.jsx(J.Icon,{"data-icon":"inline-start",stroke:2}),i1.jsx("span",{className:B0("truncate",J.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:J.label})]}),J.closable&&i1.jsx("div",{"aria-label":`Close ${J.label}`,tabIndex:X?-1:void 0,className:B0("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",X&&"pointer-events-none"),onClick:Z.preview?void 0:(Q)=>{Q.stopPropagation(),Z.onClose(J.key)},children:i1.jsx(H9,{stroke:1.75})})]})}function KS({tabs:Z,active:J,createItems:$,onSelect:X,onClose:Q,onReorder:Y}){return i1.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[i1.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:i1.jsx(KX,{items:Z,getId:(G)=>G.key,className:"flex w-max items-center gap-1",onReorder:(G)=>Y(G),renderPlaceholder:()=>i1.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-xs bg-muted"}),renderOverlay:(G)=>i1.jsx(zS,{tab:G,active:J===G.key,preview:!0}),renderItem:(G,H)=>i1.jsx(zS,{tab:G,active:J===G.key,state:H,onSelect:X,onClose:Q})})}),i1.jsx("div",{className:"shrink-0",children:i1.jsx(ld,{items:$})})]})}var a0=j(a(),1),id=J7.lazy(()=>import("/chunk-cs8vbert.js").then((Z)=>({default:Z.Scratchpad}))),BS=(Z)=>Z.config.title||Z.id,FS=(Z)=>hY(Z.icon)??zq;function LS(Z,J){let $=J.find((X)=>X.viewId===Z.id);return hY(Z.config.icon)??hY($?.icon)??zq}var dY=zH(),qS=(Z)=>`view:${Z}`,qq=(Z)=>Z.startsWith("view:")?Z.slice(5):null,cY=(Z)=>`view-builder:${Z}`,YJ=(Z)=>Z.startsWith("view-builder:")?Z.slice(13):null;function rd({mode:Z,onToggleMode:J}){return a0.jsx(I0,{variant:"ghost",size:"icon-sm",onClick:J,"aria-label":Z==="fullscreen"?"Switch to split view":"Switch to full-screen view",children:a0.jsx(US,{stroke:1.75})})}function ad({view:Z}){let J=h5(),$=RN(Z.id);return a0.jsx("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:a0.jsxs(o9,{mode:"wait",initial:!1,children:[$.status==="ready"&&a0.jsx(VY,{asChild:!0,segment:"views",name:Z.id,version:$.version,children:a0.jsx(n1.div,{className:"absolute inset-0 overflow-auto",initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:{duration:0.3,ease:"easeInOut"},children:a0.jsx(mZ,{name:Z.id,kind:"view",workspaceId:J,resetKey:$.version,children:a0.jsx($.Component,{})})})},$.version),$.status==="error"&&a0.jsx(n1.p,{className:"absolute inset-0 p-4 text-xs text-destructive",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:0.3,ease:"easeInOut"},children:$.error},`err-${$.version}`)]})})}function sd({active:Z,onToggle:J}){return a0.jsxs(l6,{delay:50,children:[a0.jsx(i6,{render:a0.jsx(I0,{variant:Z?"secondary":"ghost",size:"icon-sm","aria-label":"Customize","aria-pressed":Z,onClick:J,children:a0.jsx(xY,{stroke:1.75})})}),a0.jsx(r6,{children:"Customize"})]})}function nd(Z){if(!Z||!Array.isArray(Z.open))return dY;let J=Z.open.filter(($,X,Q)=>Q.indexOf($)===X);if(J.length===0)return dY;return{open:J,active:J.includes(Z.active)?Z.active:J[0]}}function Hq(Z,J,$){if(Z==="agent"||Z==="widgets"||Z==="scratchpad")return!0;let X=YJ(Z);if(X)return $.some((Y)=>Y.id===X);let Q=qq(Z);return Q?J.some((Y)=>Y.id===Q):!1}function od(Z,J,$,X){if(Z==="agent")return{key:Z,Icon:G6,label:"Agent",closable:X};if(Z==="widgets")return{key:Z,Icon:Wq,label:"Widgets",closable:X};if(Z==="scratchpad")return{key:Z,Icon:Kq,label:"Scratchpad",closable:X};let Q=YJ(Z),Y=Q?$.find((z)=>z.id===Q):null;if(Y)return{key:Z,Icon:FS(Y),label:Y.title||Y.viewId||"New view",closable:X};let G=qq(Z),H=G?J.find((z)=>z.id===G):null;return H?{key:Z,Icon:LS(H,$),label:BS(H),closable:X}:null}function td(Z,J,$){let X=new Set(J),Q=0;return Z.map((Y)=>X.has(Y)?$[Q++]:Y)}function NS({widgets:Z,views:J,builders:$}){let{view:X,previewTurn:Q,sessionId:Y,processing:G,error:H,send:z,stop:W,switchThread:K,dismissError:q}=nC(),{layout:V,setLayout:U,name:B,icon:F,provider:N,workspaceId:L}=R1(),_=XS(),{ref:M,fits:O}=YS(),[D,A]=J7.useState("idle"),[T,S]=J7.useState(!1),[k,P]=J7.useState(0),g=J7.useRef(null);HS(V.theme,g);let C=nd(V.tabs),I=J7.useRef(C);I.current=C;let y=C.open.filter((f)=>Hq(f,J,$)),b=y.length>0?y:dY.open,R=new Set(C.open),x=b.filter((f)=>f!=="agent"),v=x.length>0,w=V.layoutMode==="split"&&v&&O?"split":"fullscreen",z0=w==="split",G0=(f)=>{if(f==="split"&&C.active==="agent"){U({layoutMode:f,tabs:{open:C.open,active:x[0]??C.active}});return}U({layoutMode:f})},E=z0?x:b,s=E.includes(C.active)?C.active:E[0]??"agent",A0=b.length>1,l=E.map((f)=>od(f,J,$,A0||YJ(f)!==null)).filter((f)=>Boolean(f)),H0=qq(s),q0=H0?J.find((f)=>f.id===H0):void 0,X0=YJ(s),Q0=X0?$.find((f)=>f.id===X0):void 0;J7.useEffect(()=>{let f=C.open.filter((L0)=>Hq(L0,J,$));if(f.length===C.open.length)return;let u=f.length>0?f:dY.open;U({tabs:{open:u,active:u.includes(C.active)?C.active:u[0]}})},[$,U,C.active,C.open,J]),J7.useEffect(()=>{let f=new Map;for(let h of $){if(h.status!=="ready"||!h.viewId)continue;if(!J.some((c)=>c.id===h.viewId))continue;f.set(cY(h.id),qS(h.viewId))}if(f.size===0)return;let u=new Set(f.values()),L0=new Map([...f].map(([h,c])=>[c,h])),M0=[],h0=!1;for(let h of C.open){let c=L0.get(h);if(u.has(h)&&c&&C.open.includes(c)){h0=!0;continue}let t=f.get(h),U0=t??h;if(t)h0=!0;if(!M0.includes(U0))M0.push(U0)}if(!h0)return;let l0=f.get(C.active)??C.active;U({tabs:{open:M0.length>0?M0:["agent"],active:l0}})},[$,U,C.active,C.open,J]),J7.useEffect(()=>{let f=Q0??$.find((u)=>u.viewId===H0);if(f)W1.getState().setActive(L,f.sessionId)},[Q0,H0,$,L]),J7.useEffect(()=>{if(w!=="fullscreen"||s==="agent")S(!1)},[s,w]);let V0=(f)=>{I.current=f,U({tabs:f})},p=(f)=>{let u=I.current,L0=u.open.includes(f)?u.open:[...u.open,f];if(V0({open:L0,active:f}),f==="agent")S(!1),P((M0)=>M0+1)},Z0=(f)=>{let u=YJ(f),L0=u?$.find((l0)=>l0.id===u):void 0;if(!A0&&!L0||!R.has(f))return;let M0=C.open.filter((l0)=>l0!==f);if(M0.length===0)M0=["agent"];let h0=C.active;if(h0===f||!M0.includes(h0)){let l0=E.indexOf(f);h0=E[l0+1]??E[l0-1]??M0.find((h)=>Hq(h,J,$))??"agent"}if(V0({open:M0,active:h0}),L0?.status==="draft")_.discard(L0.id)},e=(f)=>{let u=cY(f.id);if(R.has(u)){let L0=C.open.filter((M0)=>M0!==u);if(L0.length===0)L0=["agent"];V0({open:L0,active:C.active===u?L0[0]:C.active})}_.discard(f.id)},_0=(f)=>{let u=td(C.open,E,f);if(u===C.open)return;V0({open:u,active:C.active})},i=(f)=>{if(f!==void 0)W1.getState().setDraft(L,Y,f);if(w==="fullscreen"&&s!=="agent"){if(S(!0),T)P((u)=>u+1);return}P((u)=>u+1)},W0=[...!z0&&!R.has("agent")?[{key:"agent",Icon:G6,label:"Agent",onClick:()=>p("agent")}]:[],...!R.has("widgets")?[{key:"widgets",Icon:Wq,label:"Widgets",onClick:()=>p("widgets")}]:[],...!R.has("scratchpad")?[{key:"scratchpad",Icon:Kq,label:"Scratchpad",onClick:()=>p("scratchpad")}]:[],...J.map((f)=>({view:f,tab:qS(f.id)})).filter(({tab:f})=>!R.has(f)).map(({view:f,tab:u})=>({key:u,Icon:LS(f,$),label:BS(f),onClick:()=>p(u)})),...$.filter((f)=>f.status!=="ready").map((f)=>({builder:f,tab:cY(f.id)})).filter(({tab:f})=>!R.has(f)).map(({builder:f,tab:u})=>({key:u,Icon:FS(f),label:f.title||f.viewId||"New view",onClick:()=>p(u)})),{key:"create-view",Icon:VS,label:"New view",onClick:()=>{_.create().then((f)=>p(cY(f.id)))}}],r=a0.jsx(QY,{active:w==="split",focusRequest:k,view:X,previewTurn:Q,sessionId:Y,processing:G,error:H,onDismissError:q,send:z,stop:W,onSwitchThread:K}),o=a0.jsx(QY,{active:w==="fullscreen"&&s==="agent",focusRequest:k,view:X,previewTurn:Q,sessionId:Y,processing:G,error:H,onDismissError:q,send:z,stop:W,onSwitchThread:K});return a0.jsxs("div",{ref:g,className:"relative flex h-full min-h-0 flex-col bg-background font-sans text-foreground",children:[a0.jsxs("div",{ref:M,className:"flex min-h-0 flex-1",children:[(w==="fullscreen"||v)&&a0.jsxs("div",{className:B0("flex min-h-0 flex-1 flex-col",w==="split"&&"min-w-(--column-w)"),children:[a0.jsxs(xj,{children:[a0.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[a0.jsxs("div",{className:"flex items-center gap-2",children:[a0.jsx("img",{src:F??Y2[N??"claude-code"],alt:"",className:"size-5 shrink-0 rounded-[4px]"}),B&&a0.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:B})]}),a0.jsx(KS,{tabs:l,active:s,createItems:W0,onSelect:p,onClose:Z0,onReorder:_0})]}),a0.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[a0.jsx(sd,{active:D==="customizing",onToggle:()=>A(D==="customizing"?"idle":"customizing")}),a0.jsx(OB,{}),a0.jsx(rC,{}),v&&O&&a0.jsx(rd,{mode:w,onToggleMode:()=>G0(w==="fullscreen"?"split":"fullscreen")})]})]}),s==="agent"?o:s==="widgets"?a0.jsx(bj,{editing:D==="editing",onEditingChange:(f)=>A(f?"editing":"idle"),widgets:Z,onCreateWidget:()=>i("Create widget")}):s==="scratchpad"?a0.jsx(J7.Suspense,{fallback:null,children:a0.jsx(id,{})}):Q0?a0.jsx(oC,{builder:Q0,onSave:(f)=>_.save(Q0.id,f),onSubmit:(f)=>{if(w==="fullscreen")S(!0);return _.submit(Q0,f)},onOpenChat:()=>{W1.getState().setActive(L,Q0.sessionId),i()},onDiscard:()=>e(Q0)},Q0.id):q0?a0.jsx(ad,{view:q0}):null]}),w==="split"&&a0.jsx("div",{className:B0("flex min-h-0 min-w-(--chat-min) flex-[0_1_var(--chat-max)] flex-col overflow-hidden border-l border-border"),children:r})]}),a0.jsx(o9,{children:D==="customizing"&&a0.jsx(YP,{})}),w==="fullscreen"&&s!=="agent"&&v&&a0.jsx(JP,{open:T,onOpenChange:S,onOpenChangeComplete:(f)=>{if(f)P((u)=>u+1)},container:g,children:(f)=>a0.jsx(QY,{active:T,focusRequest:k,view:X,previewTurn:Q,sessionId:Y,processing:G,error:H,onDismissError:q,send:z,stop:W,onSwitchThread:K,onClose:f})})]})}var lY=j(m(),1);function _S(Z,J,$,X){let Q=lY.useRef(null);lY.useEffect(()=>{if(!J)return;let Y=new Map(J.map((U)=>[U.id,{w:U.config.colSpan,h:U.config.rowSpan}]));if(Q.current?.workspaceId!==Z){Q.current={workspaceId:Z,sizes:Y};return}let G=Q.current.sizes,H=new Set($.widgetGrid.map((U)=>U.i)),z=J.filter((U)=>{if(!G.has(U.id))return!H.has(U.id);if(!H.has(U.id))return!1;let F=G.get(U.id);return F.w!==U.config.colSpan||F.h!==U.config.rowSpan});if(Q.current={workspaceId:Z,sizes:Y},z.length===0)return;let W=new Map(J.map((U)=>[U.id,U.config])),K=$.widgetGrid.filter((U)=>!z.some((B)=>B.id===U.i)&&W.has(U.i)).map((U)=>{let B=W.get(U.i);return{i:U.i,x:U.x,y:U.y,w:B.colSpan,h:B.rowSpan}}),q=K.map(({i:U,x:B,y:F})=>({i:U,x:B,y:F})),V=[...K];for(let U of z){let B=fZ(V,U.config.colSpan,U.config.rowSpan,4);q.push({i:U.id,x:B.x,y:B.y}),V.push({i:U.id,x:B.x,y:B.y,w:U.config.colSpan,h:U.config.rowSpan})}X({widgetGrid:q})},[Z,J,$.widgetGrid,X])}var R7=j(a(),1);function OS({id:Z}){return R7.jsx(AS,{id:Z,children:R7.jsx(FB,{id:Z,children:R7.jsx(ed,{id:Z})})})}function ed({id:Z}){let J=Z1(),{layout:$,setLayout:X,isLoading:Q}=R1(),Y=WB(Z),G=KB(Z),H=tC(Z),z=DX(Z);_S(Z,Y.data,$,X),yN(),W9((K)=>{if(K.type==="theme:updated"||K.type==="workspace:updated")J.invalidateQueries({queryKey:D0.layout(Z)});else if(K.type==="widget-layout:updated"||K.type==="widget:updated")J.invalidateQueries({queryKey:D0.widgets(Z)});else if(K.type==="view-layout:updated")J.invalidateQueries({queryKey:D0.views(Z)})});let W=Q||Y.isLoading||G.isLoading||H.isLoading;return R7.jsxs(R7.Fragment,{children:[R7.jsx(Zl,{workspaceId:Z,sessions:z.data}),R7.jsx(J8,{children:W?R7.jsx("div",{className:"flex h-full items-center justify-center",children:R7.jsx(MS,{sprite:"moi",effect:"chaos"})}):R7.jsx(NS,{widgets:Y.data??[],views:G.data??[],builders:H.data??[]})})]})}function Zl({workspaceId:Z,sessions:J}){return DS.useEffect(()=>{if(!J)return;let $=W1.getState().activeByWorkspace[Z]??null;if(!($&&J.some((Q)=>Q.sessionId===$)))W1.getState().setActive(Z,J[0]?.sessionId??null)},[Z,J]),null}var e9=j(a(),1),Jl=Z3.lazy(()=>import("/chunk-kxmvv1ax.js"));function $l(){return e9.jsx(Z3.Suspense,{fallback:null,children:e9.jsx(Jl,{})})}function PS(){let[,Z]=p9();return Z3.useEffect(()=>{return UG((J)=>Z(`/workspace/${J}`)),()=>UG(null)},[Z]),e9.jsxs(wS,{children:[e9.jsx(GJ,{path:"/",component:wN}),e9.jsx(GJ,{path:"/connectors",component:JN}),e9.jsx(GJ,{path:"/dev/*?",component:$l}),e9.jsx(GJ,{path:"/workspace/:id",children:(J)=>e9.jsx(OS,{id:J.id},J.id)})]})}var J3=j(a(),1),CS=new YG;$V(CS);lq();function qI0(Z){function J(){return J3.jsxs(HG,{client:CS,children:[J3.jsx(jS,{children:J3.jsx(PS,{})}),!1]})}TS.createRoot(Z).render(J3.jsx(J,{}))}export{qI0 as mount};
|