moi-computer 0.13.0 → 0.13.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/client/api/query-client.ts +5 -0
  2. package/client/app/app-router.tsx +1 -1
  3. package/client/app/routes/workspace-route.tsx +2 -0
  4. package/client/features/account/account-provider.tsx +28 -77
  5. package/client/features/account/account-test-utils.tsx +95 -93
  6. package/client/features/account/api.ts +32 -109
  7. package/client/features/account/profile-actions.ts +31 -0
  8. package/client/features/app-settings/settings-page.tsx +0 -4
  9. package/client/features/collab/client.ts +38 -13
  10. package/client/features/collab/hooks.tsx +9 -8
  11. package/client/features/collab/host-state.ts +45 -85
  12. package/client/features/collab/testing/fake-engine.ts +13 -1
  13. package/client/features/collab/users.ts +0 -12
  14. package/client/features/dev/cloud-avatar-upload.tsx +58 -0
  15. package/client/features/dev/cloud-page.tsx +363 -0
  16. package/client/features/dev/dev-index-page.tsx +6 -0
  17. package/client/features/dev/dev-routes.tsx +2 -0
  18. package/client/features/identity/host-api.ts +34 -0
  19. package/client/features/identity/store.ts +32 -0
  20. package/client/features/identity/types.ts +41 -0
  21. package/client/features/identity/use-identity.ts +6 -0
  22. package/client/features/workspace-members/api.ts +20 -0
  23. package/client/features/workspace-members/hooks.ts +127 -0
  24. package/client/features/workspace-members/keys.ts +6 -0
  25. package/client/features/workspace-members/store.ts +123 -0
  26. package/client/features/workspace-members/types.ts +53 -0
  27. package/client/index.html +1 -1
  28. package/client/index.tsx +5 -9
  29. package/client/main.tsx +2 -2
  30. package/dist/{chunk-cqt3s31j.js → chunk-00s35r33.js} +68 -68
  31. package/dist/{chunk-bncc7heg.js → chunk-7rz6g7g7.js} +1 -1
  32. package/dist/chunk-af2jyddf.js +2 -0
  33. package/dist/chunk-cekekc3f.css +1 -0
  34. package/dist/chunk-ep5vh16c.js +75 -0
  35. package/dist/{chunk-2y59vrxg.js → chunk-kdgk4dac.js} +1 -1
  36. package/dist/chunk-s5s1vzdw.js +2 -0
  37. package/dist/{chunk-58dyt9bk.js → chunk-svxhxfeq.js} +2 -2
  38. package/dist/chunk-t0r0bds1.js +1 -0
  39. package/dist/chunk-vp2qzc0d.js +1 -0
  40. package/dist/{chunk-q37knr3m.js → chunk-wz5qv1bn.js} +2 -2
  41. package/dist/index.html +2 -2
  42. package/package.json +5 -4
  43. package/server/app-config.ts +3 -1
  44. package/client/features/account/identity.ts +0 -23
  45. package/client/features/app-settings/users-settings.tsx +0 -195
  46. package/dist/chunk-dcmks9sm.js +0 -75
  47. package/dist/chunk-md45evr2.css +0 -1
  48. package/dist/chunk-n0nab26d.js +0 -1
  49. package/dist/chunk-nmzhgyp9.js +0 -2
  50. package/dist/chunk-s90m4qkz.js +0 -1
  51. package/dist/chunk-wjvd4byz.js +0 -2
@@ -0,0 +1,75 @@
1
+ import{r,$e,w,z,g,I,i,c,Te,De,s,_,D,m,ee,Ve,f,y,te,ge,dt,Oe,je,pt,Ge,K,F,Ne,q,de,Ke,d,L,qe,O,l,et,pe,re,P,tt,n,oe,u,X,a,o,Pe,Ee,ae,Xe,rt,Le,ft,se,fe,me,he,h,xe,ye,le,Ye,nt,S,b,mt,k,it,E,ht,at,Fe,V}from"/chunk-af2jyddf.js";import{e,x,be,Y,Z,A,Be,ze,T,ve,J,Re,we,Ae,Se,Ie,G,Ce,C,Ze,Je,M,N,lt,ne,ie,W,U,_e,Q,Ue,ce,B,ue,j,He,Me,ke,We,ut,Qe}from"/chunk-s5s1vzdw.js";import{t,R}from"/chunk-wz5qv1bn.js";import{p,H,v}from"/chunk-svxhxfeq.js";var Jd=x(function(AY){var ya=e(t());function CY(ot,st){return ot===st&&(ot!==0||1/ot===1/st)||ot!==ot&&st!==st}var SY=typeof Object.is==="function"?Object.is:CY,EY=ya.useState,kY=ya.useEffect,RY=ya.useLayoutEffect,TY=ya.useDebugValue;function PY(ot,st){var ct=st(),gt=EY({inst:{value:ct,getSnapshot:st}}),bt=gt[0].inst,yt=gt[1];return RY(function(){bt.value=ct,bt.getSnapshot=st,EE(bt)&&yt({inst:bt})},[ot,ct,st]),kY(function(){return EE(bt)&&yt({inst:bt}),ot(function(){EE(bt)&&yt({inst:bt})})},[ot]),TY(ct),ct}function EE(ot){var st=ot.getSnapshot;ot=ot.value;try{var ct=st();return!SY(ot,ct)}catch(gt){return!0}}function IY(ot,st){return st()}var MY=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?IY:PY;AY.useSyncExternalStore=ya.useSyncExternalStore!==void 0?ya.useSyncExternalStore:MY});var j7=x(function(lht,U7){var H7=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ude=/\n/g,pde=/^\s*/,dde=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fde=/^:\s*/,mde=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,gde=/^[;\s]*/,hde=/^\s+|\s+$/g,bde=`
2
+ `,z7="/",$7="*",yd="",yde="comment",vde="declaration";function xde(ot,st){if(typeof ot!=="string")throw TypeError("First argument must be a string");if(!ot)return[];st=st||{};var ct=1,gt=1;function bt(Tt){var Pt=Tt.match(ude);if(Pt)ct+=Pt.length;var Mt=Tt.lastIndexOf(bde);gt=~Mt?Tt.length-Mt:gt+Tt.length}function yt(){var Tt={line:ct,column:gt};return function(Pt){return Pt.position=new vt(Tt),Ct(),Pt}}function vt(Tt){this.start=Tt,this.end={line:ct,column:gt},this.source=st.source}vt.prototype.content=ot;function xt(Tt){var Pt=Error(st.source+":"+ct+":"+gt+": "+Tt);if(Pt.reason=Tt,Pt.filename=st.source,Pt.line=ct,Pt.column=gt,Pt.source=ot,st.silent);else throw Pt}function wt(Tt){var Pt=Tt.exec(ot);if(!Pt)return;var Mt=Pt[0];return bt(Mt),ot=ot.slice(Mt.length),Pt}function Ct(){wt(pde)}function St(Tt){var Pt;Tt=Tt||[];while(Pt=Et())if(Pt!==!1)Tt.push(Pt);return Tt}function Et(){var Tt=yt();if(z7!=ot.charAt(0)||$7!=ot.charAt(1))return;var Pt=2;while(yd!=ot.charAt(Pt)&&($7!=ot.charAt(Pt)||z7!=ot.charAt(Pt+1)))++Pt;if(Pt+=2,yd===ot.charAt(Pt-1))return xt("End of comment missing");var Mt=ot.slice(2,Pt-2);return gt+=2,bt(Mt),ot=ot.slice(Pt),gt+=2,Tt({type:yde,comment:Mt})}function kt(){var Tt=yt(),Pt=wt(dde);if(!Pt)return;if(Et(),!wt(fde))return xt("property missing ':'");var Mt=wt(mde),It=Tt({type:vde,property:W7(Pt[0].replace(H7,yd)),value:Mt?W7(Mt[0].replace(H7,yd)):yd});return wt(gde),It}function Rt(){var Tt=[];St(Tt);var Pt;while(Pt=kt())if(Pt!==!1)Tt.push(Pt),St(Tt);return Tt}return Ct(),Rt()}function W7(ot){return ot?ot.replace(hde,yd):yd}U7.exports=xde});var V7=x(function(Pb){var wde=Pb&&Pb.__importDefault||function(ot){return ot&&ot.__esModule?ot:{default:ot}};Object.defineProperty(Pb,"__esModule",{value:!0});Pb.default=Sde;var Cde=wde(j7());function Sde(ot,st){let ct=null;if(!ot||typeof ot!=="string")return ct;let gt=(0,Cde.default)(ot),bt=typeof st==="function";return gt.forEach((yt)=>{if(yt.type!=="declaration")return;let{property:vt,value:xt}=yt;if(bt)st(vt,xt,yt);else if(xt)ct=ct||{},ct[vt]=xt}),ct}});var Q7=x(function(K7){Object.defineProperty(K7,"__esModule",{value:!0});K7.camelCase=void 0;var Ede=/^--[a-zA-Z0-9_-]+$/,kde=/-([a-z])/g,Rde=/^[^-]+$/,Tde=/^-(webkit|moz|ms|o|khtml)-/,Pde=/^-(ms)-/,Ide=function(ot){return!ot||Rde.test(ot)||Ede.test(ot)},Mde=function(ot,st){return st.toUpperCase()},G7=function(ot,st){return"".concat(st,"-")},Ade=function(ot,st){if(st===void 0)st={};if(Ide(ot))return ot;if(ot=ot.toLowerCase(),st.reactCompat)ot=ot.replace(Pde,G7);else ot=ot.replace(Tde,G7);return ot.replace(kde,Mde)};K7.camelCase=Ade});var X7=x(function(cI,J7){var Nde=cI&&cI.__importDefault||function(ot){return ot&&ot.__esModule?ot:{default:ot}},Dde=Nde(V7()),_de=Q7();function lI(ot,st){var ct={};if(!ot||typeof ot!=="string")return ct;return(0,Dde.default)(ot,function(gt,bt){if(gt&&bt)ct[(0,_de.camelCase)(gt,st)]=bt}),ct}lI.default=lI;J7.exports=lI});var yW=x(function(Zxt,bW){var CC=Object.prototype.hasOwnProperty,hW=Object.prototype.toString,{defineProperty:uW,getOwnPropertyDescriptor:pW}=Object,dW=function(st){if(typeof Array.isArray==="function")return Array.isArray(st);return hW.call(st)==="[object Array]"},fW=function(st){if(!st||hW.call(st)!=="[object Object]")return!1;var ct=CC.call(st,"constructor"),gt=st.constructor&&st.constructor.prototype&&CC.call(st.constructor.prototype,"isPrototypeOf");if(st.constructor&&!ct&&!gt)return!1;var bt;for(bt in st);return typeof bt>"u"||CC.call(st,bt)},mW=function(st,ct){if(uW&&ct.name==="__proto__")uW(st,ct.name,{enumerable:!0,configurable:!0,value:ct.newValue,writable:!0});else st[ct.name]=ct.newValue},gW=function(st,ct){if(ct==="__proto__"){if(!CC.call(st,ct))return;else if(pW)return pW(st,ct).value}return st[ct]};bW.exports=function ot(){var st,ct,gt,bt,yt,vt,xt=arguments[0],wt=1,Ct=arguments.length,St=!1;if(typeof xt==="boolean")St=xt,xt=arguments[1]||{},wt=2;if(xt==null||typeof xt!=="object"&&typeof xt!=="function")xt={};for(;wt<Ct;++wt)if(st=arguments[wt],st!=null){for(ct in st)if(gt=gW(xt,ct),bt=gW(st,ct),xt!==bt){if(St&&bt&&(fW(bt)||(yt=dW(bt)))){if(yt)yt=!1,vt=gt&&dW(gt)?gt:[];else vt=gt&&fW(gt)?gt:{};mW(xt,{name:ct,newValue:ot(St,vt,bt)})}else if(typeof bt<"u")mW(xt,{name:ct,newValue:bt})}}return xt}});var cj=x(function(xCt,lj){function KU(ot){if(ot instanceof Map)ot.clear=ot.delete=ot.set=function(){throw Error("map is read-only")};else if(ot instanceof Set)ot.add=ot.clear=ot.delete=function(){throw Error("set is read-only")};return Object.freeze(ot),Object.getOwnPropertyNames(ot).forEach((st)=>{let ct=ot[st],gt=typeof ct;if((gt==="object"||gt==="function")&&!Object.isFrozen(ct))KU(ct)}),ot}class eM{constructor(ot){if(ot.data===void 0)ot.data={};this.data=ot.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function qU(ot){return ot.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Yu(ot,...st){let ct=Object.create(null);for(let gt in ot)ct[gt]=ot[gt];return st.forEach(function(gt){for(let bt in gt)ct[bt]=gt[bt]}),ct}var ihe="</span>",$U=(ot)=>!!ot.scope,she=(ot,{prefix:st})=>{if(ot.startsWith("language:"))return ot.replace("language:","language-");if(ot.includes(".")){let ct=ot.split(".");return[`${st}${ct.shift()}`,...ct.map((gt,bt)=>`${gt}${"_".repeat(bt+1)}`)].join(" ")}return`${st}${ot}`};class QU{constructor(ot,st){this.buffer="",this.classPrefix=st.classPrefix,ot.walk(this)}addText(ot){this.buffer+=qU(ot)}openNode(ot){if(!$U(ot))return;let st=she(ot.scope,{prefix:this.classPrefix});this.span(st)}closeNode(ot){if(!$U(ot))return;this.buffer+=ihe}value(){return this.buffer}span(ot){this.buffer+=`<span class="${ot}">`}}var WU=(ot={})=>{let st={children:[]};return Object.assign(st,ot),st};class tM{constructor(){this.rootNode=WU(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ot){this.top.children.push(ot)}openNode(ot){let st=WU({scope:ot});this.add(st),this.stack.push(st)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ot){return this.constructor._walk(ot,this.rootNode)}static _walk(ot,st){if(typeof st==="string")ot.addText(st);else if(st.children)ot.openNode(st),st.children.forEach((ct)=>this._walk(ot,ct)),ot.closeNode(st);return ot}static _collapse(ot){if(typeof ot==="string")return;if(!ot.children)return;if(ot.children.every((st)=>typeof st==="string"))ot.children=[ot.children.join("")];else ot.children.forEach((st)=>{tM._collapse(st)})}}class JU extends tM{constructor(ot){super();this.options=ot}addText(ot){if(ot==="")return;this.add(ot)}startScope(ot){this.openNode(ot)}endScope(){this.closeNode()}__addSublanguage(ot,st){let ct=ot.root;if(st)ct.scope=`language:${st}`;this.add(ct)}toHTML(){return new QU(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Vb(ot){if(!ot)return null;if(typeof ot==="string")return ot;return ot.source}function XU(ot){return Pd("(?=",ot,")")}function ahe(ot){return Pd("(?:",ot,")*")}function lhe(ot){return Pd("(?:",ot,")?")}function Pd(...ot){return ot.map((ct)=>Vb(ct)).join("")}function che(ot){let st=ot[ot.length-1];if(typeof st==="object"&&st.constructor===Object)return ot.splice(ot.length-1,1),st;else return{}}function nM(...ot){return"("+(che(ot).capture?"":"?:")+ot.map((gt)=>Vb(gt)).join("|")+")"}function YU(ot){return new RegExp(ot.toString()+"|").exec("").length-1}function uhe(ot,st){let ct=ot&&ot.exec(st);return ct&&ct.index===0}var phe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function rM(ot,{joinWith:st}){let ct=0;return ot.map((gt)=>{ct+=1;let bt=ct,yt=Vb(gt),vt="";while(yt.length>0){let xt=phe.exec(yt);if(!xt){vt+=yt;break}if(vt+=yt.substring(0,xt.index),yt=yt.substring(xt.index+xt[0].length),xt[0][0]==="\\"&&xt[1])vt+="\\"+String(Number(xt[1])+bt);else if(vt+=xt[0],xt[0]==="(")ct++}return vt}).map((gt)=>`(${gt})`).join(st)}var dhe=/\b\B/,ZU="[a-zA-Z]\\w*",oM="[a-zA-Z_]\\w*",ej="\\b\\d+(\\.\\d+)?",tj="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",nj="\\b(0b[01]+)",fhe="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",mhe=(ot={})=>{let st=/^#![ ]*\//;if(ot.binary)ot.begin=Pd(st,/.*\b/,ot.binary,/\b.*/);return Yu({scope:"meta",begin:st,end:/$/,relevance:0,"on:begin":(ct,gt)=>{if(ct.index!==0)gt.ignoreMatch()}},ot)},Gb={begin:"\\\\[\\s\\S]",relevance:0},ghe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Gb]},hhe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Gb]},bhe={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/},LC=function(ot,st,ct={}){let gt=Yu({scope:"comment",begin:ot,end:st,contains:[]},ct);gt.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 bt=nM("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 gt.contains.push({begin:Pd(/[ ]+/,"(",bt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),gt},yhe=LC("//","$"),vhe=LC("/\\*","\\*/"),xhe=LC("#","$"),whe={scope:"number",begin:ej,relevance:0},Che={scope:"number",begin:tj,relevance:0},She={scope:"number",begin:nj,relevance:0},Ehe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Gb,{begin:/\[/,end:/\]/,relevance:0,contains:[Gb]}]},khe={scope:"title",begin:ZU,relevance:0},Rhe={scope:"title",begin:oM,relevance:0},The={begin:"\\.\\s*"+oM,relevance:0},Phe=function(ot){return Object.assign(ot,{"on:begin":(st,ct)=>{ct.data._beginMatch=st[1]},"on:end":(st,ct)=>{if(ct.data._beginMatch!==st[1])ct.ignoreMatch()}})},_C=Object.freeze({__proto__:null,APOS_STRING_MODE:ghe,BACKSLASH_ESCAPE:Gb,BINARY_NUMBER_MODE:She,BINARY_NUMBER_RE:nj,COMMENT:LC,C_BLOCK_COMMENT_MODE:vhe,C_LINE_COMMENT_MODE:yhe,C_NUMBER_MODE:Che,C_NUMBER_RE:tj,END_SAME_AS_BEGIN:Phe,HASH_COMMENT_MODE:xhe,IDENT_RE:ZU,MATCH_NOTHING_RE:dhe,METHOD_GUARD:The,NUMBER_MODE:whe,NUMBER_RE:ej,PHRASAL_WORDS_MODE:bhe,QUOTE_STRING_MODE:hhe,REGEXP_MODE:Ehe,RE_STARTERS_RE:fhe,SHEBANG:mhe,TITLE_MODE:khe,UNDERSCORE_IDENT_RE:oM,UNDERSCORE_TITLE_MODE:Rhe});function Ihe(ot,st){if(ot.input[ot.index-1]===".")st.ignoreMatch()}function Mhe(ot,st){if(ot.className!==void 0)ot.scope=ot.className,delete ot.className}function Ahe(ot,st){if(!st)return;if(!ot.beginKeywords)return;if(ot.begin="\\b("+ot.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ot.__beforeBegin=Ihe,ot.keywords=ot.keywords||ot.beginKeywords,delete ot.beginKeywords,ot.relevance===void 0)ot.relevance=0}function Nhe(ot,st){if(!Array.isArray(ot.illegal))return;ot.illegal=nM(...ot.illegal)}function Dhe(ot,st){if(!ot.match)return;if(ot.begin||ot.end)throw Error("begin & end are not supported with match");ot.begin=ot.match,delete ot.match}function _he(ot,st){if(ot.relevance===void 0)ot.relevance=1}var Ohe=(ot,st)=>{if(!ot.beforeMatch)return;if(ot.starts)throw Error("beforeMatch cannot be used with starts");let ct=Object.assign({},ot);Object.keys(ot).forEach((gt)=>{delete ot[gt]}),ot.keywords=ct.keywords,ot.begin=Pd(ct.beforeMatch,XU(ct.begin)),ot.starts={relevance:0,contains:[Object.assign(ct,{endsParent:!0})]},ot.relevance=0,delete ct.beforeMatch},Lhe=["of","and","for","in","not","or","if","then","parent","list","value"],Bhe="keyword";function rj(ot,st,ct=Bhe){let gt=Object.create(null);if(typeof ot==="string")bt(ct,ot.split(" "));else if(Array.isArray(ot))bt(ct,ot);else Object.keys(ot).forEach(function(yt){Object.assign(gt,rj(ot[yt],st,yt))});return gt;function bt(yt,vt){if(st)vt=vt.map((xt)=>xt.toLowerCase());vt.forEach(function(xt){let wt=xt.split("|");gt[wt[0]]=[yt,Fhe(wt[0],wt[1])]})}}function Fhe(ot,st){if(st)return Number(st);return Hhe(ot)?0:1}function Hhe(ot){return Lhe.includes(ot.toLowerCase())}var UU={},Td=(ot)=>{console.error(ot)},jU=(ot,...st)=>{console.log(`WARN: ${ot}`,...st)},Vm=(ot,st)=>{if(UU[`${ot}/${st}`])return;console.log(`Deprecated as of ${ot}. ${st}`),UU[`${ot}/${st}`]=!0},OC=Error();function oj(ot,st,{key:ct}){let gt=0,bt=ot[ct],yt={},vt={};for(let xt=1;xt<=st.length;xt++)vt[xt+gt]=bt[xt],yt[xt+gt]=!0,gt+=YU(st[xt-1]);ot[ct]=vt,ot[ct]._emit=yt,ot[ct]._multi=!0}function zhe(ot){if(!Array.isArray(ot.begin))return;if(ot.skip||ot.excludeBegin||ot.returnBegin)throw Td("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),OC;if(typeof ot.beginScope!=="object"||ot.beginScope===null)throw Td("beginScope must be object"),OC;oj(ot,ot.begin,{key:"beginScope"}),ot.begin=rM(ot.begin,{joinWith:""})}function $he(ot){if(!Array.isArray(ot.end))return;if(ot.skip||ot.excludeEnd||ot.returnEnd)throw Td("skip, excludeEnd, returnEnd not compatible with endScope: {}"),OC;if(typeof ot.endScope!=="object"||ot.endScope===null)throw Td("endScope must be object"),OC;oj(ot,ot.end,{key:"endScope"}),ot.end=rM(ot.end,{joinWith:""})}function Whe(ot){if(ot.scope&&typeof ot.scope==="object"&&ot.scope!==null)ot.beginScope=ot.scope,delete ot.scope}function Uhe(ot){if(Whe(ot),typeof ot.beginScope==="string")ot.beginScope={_wrap:ot.beginScope};if(typeof ot.endScope==="string")ot.endScope={_wrap:ot.endScope};zhe(ot),$he(ot)}function jhe(ot){function st(vt,xt){return new RegExp(Vb(vt),"m"+(ot.case_insensitive?"i":"")+(ot.unicodeRegex?"u":"")+(xt?"g":""))}class ct{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(vt,xt){xt.position=this.position++,this.matchIndexes[this.matchAt]=xt,this.regexes.push([xt,vt]),this.matchAt+=YU(vt)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let vt=this.regexes.map((xt)=>xt[1]);this.matcherRe=st(rM(vt,{joinWith:"|"}),!0),this.lastIndex=0}exec(vt){this.matcherRe.lastIndex=this.lastIndex;let xt=this.matcherRe.exec(vt);if(!xt)return null;let wt=xt.findIndex((St,Et)=>Et>0&&St!==void 0),Ct=this.matchIndexes[wt];return xt.splice(0,wt),Object.assign(xt,Ct)}}class gt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(vt){if(this.multiRegexes[vt])return this.multiRegexes[vt];let xt=new ct;return this.rules.slice(vt).forEach(([wt,Ct])=>xt.addRule(wt,Ct)),xt.compile(),this.multiRegexes[vt]=xt,xt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(vt,xt){if(this.rules.push([vt,xt]),xt.type==="begin")this.count++}exec(vt){let xt=this.getMatcher(this.regexIndex);xt.lastIndex=this.lastIndex;let wt=xt.exec(vt);if(this.resumingScanAtSamePosition())if(wt&&wt.index===this.lastIndex);else{let Ct=this.getMatcher(0);Ct.lastIndex=this.lastIndex+1,wt=Ct.exec(vt)}if(wt){if(this.regexIndex+=wt.position+1,this.regexIndex===this.count)this.considerAll()}return wt}}function bt(vt){let xt=new gt;if(vt.contains.forEach((wt)=>xt.addRule(wt.begin,{rule:wt,type:"begin"})),vt.terminatorEnd)xt.addRule(vt.terminatorEnd,{type:"end"});if(vt.illegal)xt.addRule(vt.illegal,{type:"illegal"});return xt}function yt(vt,xt){let wt=vt;if(vt.isCompiled)return wt;[Mhe,Dhe,Uhe,Ohe].forEach((St)=>St(vt,xt)),ot.compilerExtensions.forEach((St)=>St(vt,xt)),vt.__beforeBegin=null,[Ahe,Nhe,_he].forEach((St)=>St(vt,xt)),vt.isCompiled=!0;let Ct=null;if(typeof vt.keywords==="object"&&vt.keywords.$pattern)vt.keywords=Object.assign({},vt.keywords),Ct=vt.keywords.$pattern,delete vt.keywords.$pattern;if(Ct=Ct||/\w+/,vt.keywords)vt.keywords=rj(vt.keywords,ot.case_insensitive);if(wt.keywordPatternRe=st(Ct,!0),xt){if(!vt.begin)vt.begin=/\B|\b/;if(wt.beginRe=st(wt.begin),!vt.end&&!vt.endsWithParent)vt.end=/\B|\b/;if(vt.end)wt.endRe=st(wt.end);if(wt.terminatorEnd=Vb(wt.end)||"",vt.endsWithParent&&xt.terminatorEnd)wt.terminatorEnd+=(vt.end?"|":"")+xt.terminatorEnd}if(vt.illegal)wt.illegalRe=st(vt.illegal);if(!vt.contains)vt.contains=[];if(vt.contains=[].concat(...vt.contains.map(function(St){return Vhe(St==="self"?vt:St)})),vt.contains.forEach(function(St){yt(St,wt)}),vt.starts)yt(vt.starts,xt);return wt.matcher=bt(wt),wt}if(!ot.compilerExtensions)ot.compilerExtensions=[];if(ot.contains&&ot.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ot.classNameAliases=Yu(ot.classNameAliases||{}),yt(ot)}function ij(ot){if(!ot)return!1;return ot.endsWithParent||ij(ot.starts)}function Vhe(ot){if(ot.variants&&!ot.cachedVariants)ot.cachedVariants=ot.variants.map(function(st){return Yu(ot,{variants:null},st)});if(ot.cachedVariants)return ot.cachedVariants;if(ij(ot))return Yu(ot,{starts:ot.starts?Yu(ot.starts):null});if(Object.isFrozen(ot))return Yu(ot);return ot}var Ghe="11.11.1";class sj extends Error{constructor(ot,st){super(ot);this.name="HTMLInjectionError",this.html=st}}var ZI=qU,VU=Yu,GU=Symbol("nomatch"),Khe=7,aj=function(ot){let st=Object.create(null),ct=Object.create(null),gt=[],bt=!0,yt="Could not find the language '{}', did you forget to load/include a language module?",vt={disableAutodetect:!0,name:"Plain text",contains:[]},xt={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:JU};function wt(jt){return xt.noHighlightRe.test(jt)}function Ct(jt){let qt=jt.className+" ";qt+=jt.parentNode?jt.parentNode.className:"";let Qt=xt.languageDetectRe.exec(qt);if(Qt){let Xt=Ft(Qt[1]);if(!Xt)jU(yt.replace("{}",Qt[1])),jU("Falling back to no-highlight mode for this block.",jt);return Xt?Qt[1]:"no-highlight"}return qt.split(/\s+/).find((Xt)=>wt(Xt)||Ft(Xt))}function St(jt,qt,Qt){let Xt="",zt="";if(typeof qt==="object")Xt=jt,Qt=qt.ignoreIllegals,zt=qt.language;else Vm("10.7.0","highlight(lang, code, ...args) has been deprecated."),Vm("10.7.0",`Please use highlight(code, options) instead.
3
+ https://github.com/highlightjs/highlight.js/issues/2277`),zt=jt,Xt=qt;if(Qt===void 0)Qt=!0;let tn={code:Xt,language:zt};Ht("before:highlight",tn);let rn=tn.result?tn.result:Et(tn.language,tn.code,Qt);return rn.code=tn.code,Ht("after:highlight",rn),rn}function Et(jt,qt,Qt,Xt){let zt=Object.create(null);function tn(Jt,Yt){return Jt.keywords[Yt]}function rn(){if(!en.keywords){cn.addText(mn);return}let Jt=0;en.keywordPatternRe.lastIndex=0;let Yt=en.keywordPatternRe.exec(mn),un="";while(Yt){un+=mn.substring(Jt,Yt.index);let vn=wn.case_insensitive?Yt[0].toLowerCase():Yt[0],_n=tn(en,vn);if(_n){let[zn,$n]=_n;if(cn.addText(un),un="",zt[vn]=(zt[vn]||0)+1,zt[vn]<=Khe)Pn+=$n;if(zn.startsWith("_"))un+=Yt[0];else{let Mn=wn.classNameAliases[zn]||zn;ln(Yt[0],Mn)}}else un+=Yt[0];Jt=en.keywordPatternRe.lastIndex,Yt=en.keywordPatternRe.exec(mn)}un+=mn.substring(Jt),cn.addText(un)}function Kt(){if(mn==="")return;let Jt=null;if(typeof en.subLanguage==="string"){if(!st[en.subLanguage]){cn.addText(mn);return}Jt=Et(en.subLanguage,mn,!0,pn[en.subLanguage]),pn[en.subLanguage]=Jt._top}else Jt=Rt(mn,en.subLanguage.length?en.subLanguage:null);if(en.relevance>0)Pn+=Jt.relevance;cn.__addSublanguage(Jt._emitter,Jt.language)}function an(){if(en.subLanguage!=null)Kt();else rn();mn=""}function ln(Jt,Yt){if(Jt==="")return;cn.startScope(Yt),cn.addText(Jt),cn.endScope()}function Zt(Jt,Yt){let un=1,vn=Yt.length-1;while(un<=vn){if(!Jt._emit[un]){un++;continue}let _n=wn.classNameAliases[Jt[un]]||Jt[un],zn=Yt[un];if(_n)ln(zn,_n);else mn=zn,rn(),mn="";un++}}function on(Jt,Yt){if(Jt.scope&&typeof Jt.scope==="string")cn.openNode(wn.classNameAliases[Jt.scope]||Jt.scope);if(Jt.beginScope){if(Jt.beginScope._wrap)ln(mn,wn.classNameAliases[Jt.beginScope._wrap]||Jt.beginScope._wrap),mn="";else if(Jt.beginScope._multi)Zt(Jt.beginScope,Yt),mn=""}return en=Object.create(Jt,{parent:{value:en}}),en}function sn(Jt,Yt,un){let vn=uhe(Jt.endRe,un);if(vn){if(Jt["on:end"]){let _n=new eM(Jt);if(Jt["on:end"](Yt,_n),_n.isMatchIgnored)vn=!1}if(vn){while(Jt.endsParent&&Jt.parent)Jt=Jt.parent;return Jt}}if(Jt.endsWithParent)return sn(Jt.parent,Yt,un)}function dn(Jt){if(en.matcher.regexIndex===0)return mn+=Jt[0],1;else return kn=!0,0}function fn(Jt){let Yt=Jt[0],un=Jt.rule,vn=new eM(un),_n=[un.__beforeBegin,un["on:begin"]];for(let zn of _n){if(!zn)continue;if(zn(Jt,vn),vn.isMatchIgnored)return dn(Yt)}if(un.skip)mn+=Yt;else{if(un.excludeBegin)mn+=Yt;if(an(),!un.returnBegin&&!un.excludeBegin)mn=Yt}return on(un,Jt),un.returnBegin?0:Yt.length}function bn(Jt){let Yt=Jt[0],un=qt.substring(Jt.index),vn=sn(en,Jt,un);if(!vn)return GU;let _n=en;if(en.endScope&&en.endScope._wrap)an(),ln(Yt,en.endScope._wrap);else if(en.endScope&&en.endScope._multi)an(),Zt(en.endScope,Jt);else if(_n.skip)mn+=Yt;else{if(!(_n.returnEnd||_n.excludeEnd))mn+=Yt;if(an(),_n.excludeEnd)mn=Yt}do{if(en.scope)cn.closeNode();if(!en.skip&&!en.subLanguage)Pn+=en.relevance;en=en.parent}while(en!==vn.parent);if(vn.starts)on(vn.starts,Jt);return _n.returnEnd?0:Yt.length}function hn(){let Jt=[];for(let Yt=en;Yt!==wn;Yt=Yt.parent)if(Yt.scope)Jt.unshift(Yt.scope);Jt.forEach((Yt)=>cn.openNode(Yt))}let gn={};function xn(Jt,Yt){let un=Yt&&Yt[0];if(mn+=Jt,un==null)return an(),0;if(gn.type==="begin"&&Yt.type==="end"&&gn.index===Yt.index&&un===""){if(mn+=qt.slice(Yt.index,Yt.index+1),!bt){let vn=Error(`0 width match regex (${jt})`);throw vn.languageName=jt,vn.badRule=gn.rule,vn}return 1}if(gn=Yt,Yt.type==="begin")return fn(Yt);else if(Yt.type==="illegal"&&!Qt){let vn=Error('Illegal lexeme "'+un+'" for mode "'+(en.scope||"<unnamed>")+'"');throw vn.mode=en,vn}else if(Yt.type==="end"){let vn=bn(Yt);if(vn!==GU)return vn}if(Yt.type==="illegal"&&un==="")return mn+=`
4
+ `,1;if(Cn>1e5&&Cn>Yt.index*3)throw Error("potential infinite loop, way more iterations than matches");return mn+=un,un.length}let wn=Ft(jt);if(!wn)throw Td(yt.replace("{}",jt)),Error('Unknown language: "'+jt+'"');let yn=jhe(wn),nn="",en=Xt||yn,pn={},cn=new xt.__emitter(xt);hn();let mn="",Pn=0,Rn=0,Cn=0,kn=!1;try{if(!wn.__emitTokens){en.matcher.considerAll();for(;;){if(Cn++,kn)kn=!1;else en.matcher.considerAll();en.matcher.lastIndex=Rn;let Jt=en.matcher.exec(qt);if(!Jt)break;let Yt=qt.substring(Rn,Jt.index),un=xn(Yt,Jt);Rn=Jt.index+un}xn(qt.substring(Rn))}else wn.__emitTokens(qt,cn);return cn.finalize(),nn=cn.toHTML(),{language:jt,value:nn,relevance:Pn,illegal:!1,_emitter:cn,_top:en}}catch(Jt){if(Jt.message&&Jt.message.includes("Illegal"))return{language:jt,value:ZI(qt),illegal:!0,relevance:0,_illegalBy:{message:Jt.message,index:Rn,context:qt.slice(Rn-100,Rn+100),mode:Jt.mode,resultSoFar:nn},_emitter:cn};else if(bt)return{language:jt,value:ZI(qt),illegal:!1,relevance:0,errorRaised:Jt,_emitter:cn,_top:en};else throw Jt}}function kt(jt){let qt={value:ZI(jt),illegal:!1,relevance:0,_top:vt,_emitter:new xt.__emitter(xt)};return qt._emitter.addText(jt),qt}function Rt(jt,qt){qt=qt||xt.languages||Object.keys(st);let Qt=kt(jt),Xt=qt.filter(Ft).filter(Lt).map((an)=>Et(an,jt,!1));Xt.unshift(Qt);let zt=Xt.sort((an,ln)=>{if(an.relevance!==ln.relevance)return ln.relevance-an.relevance;if(an.language&&ln.language){if(Ft(an.language).supersetOf===ln.language)return 1;else if(Ft(ln.language).supersetOf===an.language)return-1}return 0}),[tn,rn]=zt,Kt=tn;return Kt.secondBest=rn,Kt}function Tt(jt,qt,Qt){let Xt=qt&&ct[qt]||Qt;jt.classList.add("hljs"),jt.classList.add(`language-${Xt}`)}function Pt(jt){let qt=null,Qt=Ct(jt);if(wt(Qt))return;if(Ht("before:highlightElement",{el:jt,language:Qt}),jt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",jt);return}if(jt.children.length>0){if(!xt.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(jt);if(xt.throwUnescapedHTML)throw new sj("One of your code blocks includes unescaped HTML.",jt.innerHTML)}qt=jt;let Xt=qt.textContent,zt=Qt?St(Xt,{language:Qt,ignoreIllegals:!0}):Rt(Xt);if(jt.innerHTML=zt.value,jt.dataset.highlighted="yes",Tt(jt,Qt,zt.language),jt.result={language:zt.language,re:zt.relevance,relevance:zt.relevance},zt.secondBest)jt.secondBest={language:zt.secondBest.language,relevance:zt.secondBest.relevance};Ht("after:highlightElement",{el:jt,result:zt,text:Xt})}function Mt(jt){xt=VU(xt,jt)}let It=()=>{Ot(),Vm("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function At(){Ot(),Vm("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Nt=!1;function Ot(){function jt(){Ot()}if(document.readyState==="loading"){if(!Nt)window.addEventListener("DOMContentLoaded",jt,!1);Nt=!0;return}document.querySelectorAll(xt.cssSelector).forEach(Pt)}function Dt(jt,qt){let Qt=null;try{Qt=qt(ot)}catch(Xt){if(Td("Language definition for '{}' could not be registered.".replace("{}",jt)),!bt)throw Xt;else Td(Xt);Qt=vt}if(!Qt.name)Qt.name=jt;if(st[jt]=Qt,Qt.rawDefinition=qt.bind(null,ot),Qt.aliases)Bt(Qt.aliases,{languageName:jt})}function _t(jt){delete st[jt];for(let qt of Object.keys(ct))if(ct[qt]===jt)delete ct[qt]}function $t(){return Object.keys(st)}function Ft(jt){return jt=(jt||"").toLowerCase(),st[jt]||st[ct[jt]]}function Bt(jt,{languageName:qt}){if(typeof jt==="string")jt=[jt];jt.forEach((Qt)=>{ct[Qt.toLowerCase()]=qt})}function Lt(jt){let qt=Ft(jt);return qt&&!qt.disableAutodetect}function Vt(jt){if(jt["before:highlightBlock"]&&!jt["before:highlightElement"])jt["before:highlightElement"]=(qt)=>{jt["before:highlightBlock"](Object.assign({block:qt.el},qt))};if(jt["after:highlightBlock"]&&!jt["after:highlightElement"])jt["after:highlightElement"]=(qt)=>{jt["after:highlightBlock"](Object.assign({block:qt.el},qt))}}function Wt(jt){Vt(jt),gt.push(jt)}function Ut(jt){let qt=gt.indexOf(jt);if(qt!==-1)gt.splice(qt,1)}function Ht(jt,qt){let Qt=jt;gt.forEach(function(Xt){if(Xt[Qt])Xt[Qt](qt)})}function Gt(jt){return Vm("10.7.0","highlightBlock will be removed entirely in v12.0"),Vm("10.7.0","Please use highlightElement now."),Pt(jt)}Object.assign(ot,{highlight:St,highlightAuto:Rt,highlightAll:Ot,highlightElement:Pt,highlightBlock:Gt,configure:Mt,initHighlighting:It,initHighlightingOnLoad:At,registerLanguage:Dt,unregisterLanguage:_t,listLanguages:$t,getLanguage:Ft,registerAliases:Bt,autoDetection:Lt,inherit:VU,addPlugin:Wt,removePlugin:Ut}),ot.debugMode=function(){bt=!1},ot.safeMode=function(){bt=!0},ot.versionString=Ghe,ot.regex={concat:Pd,lookahead:XU,either:nM,optional:lhe,anyNumberOfTimes:ahe};for(let jt in _C)if(typeof _C[jt]==="object")KU(_C[jt]);return Object.assign(ot,_C),ot},Gm=aj({});Gm.newInstance=()=>aj({});lj.exports=Gm;Gm.HighlightJS=Gm;Gm.default=Gm});var cG=x(function(EPt,lG){var v0e=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],aG=/[\n\r\u2028\u2029]/,x0e=/[\s#!"$&'():;<=>@\\^`|]/g;lG.exports=function(st){return st.map(function(ct){if(ct==="")return"''";if(ct&&typeof ct==="object"){if("op"in ct&&ct.op==="glob"){if(typeof ct.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(aG.test(ct.pattern))throw TypeError("glob `pattern` must not contain line terminators");return ct.pattern.replace(x0e,"\\$&")}if("op"in ct&&typeof ct.op==="string"){if(v0e.indexOf(ct.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(ct.op));return ct.op.replace(/[\s\S]/g,"\\$&")}if("comment"in ct&&typeof ct.comment==="string"){if(aG.test(ct.comment))throw TypeError("`comment` must not contain line terminators");return"#"+ct.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(ct)&&!/'/.test(ct))return"'"+ct.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(ct))return'"'+ct.replace(/(["\\$`!])/g,"\\$1")+'"';return String(ct).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var hG=x(function(kPt,gG){var mG="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",uG=new RegExp("^"+mG+"$"),pG="|&;()<> \\t",w0e="'([^']*?)'",C0e='"((\\\\"|[^"])*?)"',S0e=/^#$/,dG="'",fG='"',KC="$",Ad="",E0e=4294967296;for(qC=0;qC<4;qC++)Ad+=(E0e*Math.random()).toString(16);var qC,k0e=new RegExp("^"+Ad);function R0e(ot,st){var ct=st.lastIndex,gt=[],bt;while(bt=st.exec(ot))if(gt[gt.length]=bt,st.lastIndex===bt.index)st.lastIndex+=1;return st.lastIndex=ct,gt}function T0e(ot,st,ct){var gt=typeof ot==="function"?ot(ct):ot[ct];if(typeof gt>"u"&&ct!="")gt="";else if(typeof gt>"u")gt="$";if(typeof gt==="object")return st+Ad+JSON.stringify(gt)+Ad;return st+gt}function P0e(ot,st,ct){if(!ct)ct={};var gt=ct.escape||"\\",bt=ct.splitUnquoted===!0?`
5
+ `:typeof ct.splitUnquoted==="string"?ct.splitUnquoted:"",yt="(\\"+gt+`['"`+pG+`]|[^\\s'"`+pG+"])+",vt=new RegExp(["("+mG+")","("+yt+"|"+C0e+"|"+w0e+")+"].join("|"),"g"),xt=R0e(ot,vt);if(xt.length===0)return[];if(!st)st={};var wt=!1;return xt.map(function(Ct){var St=Ct[0];if(!St||wt)return;if(uG.test(St))return{op:St};var Et=!1,kt=!1,Rt="",Tt=[],Pt=!1,Mt=null,It=!1,At;function Nt(){At+=1;var Vt,Wt,Ut=St.charAt(At);if(Ut==="{"){if(At+=1,St.charAt(At)==="}")throw Error("Bad substitution: "+St.slice(At-2,At+1));var Ht=1;Vt=At;while(Ht>0&&Vt<St.length){if(St.charAt(Vt)==="{"&&St.charAt(Vt-1)==="$")Ht+=1;else if(St.charAt(Vt)==="}")Ht-=1;Vt+=1}if(Ht!==0)throw Error("Bad substitution: "+St.slice(At));Vt-=1,Wt=St.slice(At,Vt),At=Vt}else if(/[*@#?$!_-]/.test(Ut))Wt=Ut,At+=1;else{var Gt=St.slice(At);if(Vt=Gt.match(/[^\w\d_]/),!Vt)Wt=Gt,At=St.length;else Wt=Gt.slice(0,Vt.index),At+=Vt.index-1}return T0e(st,"",Wt)}function Ot(){if(Mt===null)return;if(Mt===0){if(Rt!=="")Tt[Tt.length]=Rt,Rt=""}else{Tt[Tt.length]=Rt,Rt="";for(var Vt=1;Vt<Mt;Vt+=1)Tt[Tt.length]=""}Mt=null}for(At=0;At<St.length;At++){var Dt=St.charAt(At);if(bt&&Dt!==KC)Ot();if(It=It||!Et&&(Dt==="*"||Dt==="?"),kt)Rt+=Dt,kt=!1;else if(Et)if(Dt===Et)Et=!1;else if(Et==dG)Rt+=Dt;else if(Dt===gt)if(At+=1,Dt=St.charAt(At),Dt===fG||Dt===gt||Dt===KC)Rt+=Dt;else Rt+=gt+Dt;else if(Dt===KC)Rt+=Nt();else Rt+=Dt;else if(Dt===fG||Dt===dG)Et=Dt,Pt=!0;else if(uG.test(Dt))return{op:St};else if(S0e.test(Dt)){wt=!0;var _t={comment:ot.slice(Ct.index+At+1)};if(Rt.length)return[Rt,_t];return[_t]}else if(Dt===gt)kt=!0;else if(Dt===KC){var $t=Nt();if(!bt)Rt+=$t;else for(var Ft=0;Ft<$t.length;Ft+=1){var Bt=$t.charAt(Ft);if(bt.indexOf(Bt)<0)Ot(),Rt+=Bt;else if(Mt===null)Mt=Bt===" "||Bt==="\t"||Bt===`
6
+ `?0:1;else if(Bt!==" "&&Bt!=="\t"&&Bt!==`
7
+ `)Mt+=1}}else Rt+=Dt}if(It)return{op:"glob",pattern:Rt};if(bt){if(Mt!==null&&Mt>0){Tt[Tt.length]=Rt,Rt="";for(var Lt=1;Lt<Mt;Lt+=1)Tt[Tt.length]=""}if(Rt!==""||Pt&&Tt.length===0)Tt[Tt.length]=Rt;return Tt}return Rt}).reduce(function(Ct,St){if(typeof St>"u")return Ct;return[].concat(St).forEach(function(Et){Ct[Ct.length]=Et}),Ct},[])}gG.exports=function(st,ct,gt){var bt=P0e(st,ct,gt);if(typeof ct!=="function")return bt;return bt.reduce(function(yt,vt){if(typeof vt==="object")return yt[yt.length]=vt,yt;var xt=vt.split(RegExp("("+Ad+".*?"+Ad+")","g"));if(xt.length===1)return yt[yt.length]=xt[0],yt;return xt.filter(Boolean).forEach(function(wt){yt[yt.length]=k0e.test(wt)?JSON.parse(wt.split(Ad)[1]):wt}),yt},[])}});var YG=x(function(xMt,XG){var Hve="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";XG.exports=Hve});var nK=x(function(wMt,tK){var zve=YG();function ZG(){}function eK(){}eK.resetWarningCache=ZG;tK.exports=function(){function ot(gt,bt,yt,vt,xt,wt){if(wt===zve)return;var Ct=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 Ct.name="Invariant Violation",Ct}ot.isRequired=ot;function st(){return ot}var ct={array:ot,bigint:ot,bool:ot,func:ot,number:ot,object:ot,string:ot,symbol:ot,any:ot,arrayOf:st,element:ot,elementType:ot,instanceOf:st,node:ot,objectOf:st,oneOf:st,oneOfType:st,shape:st,exact:st,checkPropTypes:eK,resetWarningCache:ZG};return ct.PropTypes=ct,ct}});var ey=x(function(CMt,rK){rK.exports=nK()();var $ve,Wve});var sK=x(function(SMt,dA){function iK(ot){var st,ct,gt="";if(typeof ot=="string"||typeof ot=="number")gt+=ot;else if(typeof ot=="object")if(Array.isArray(ot)){var bt=ot.length;for(st=0;st<bt;st++)ot[st]&&(ct=iK(ot[st]))&&(gt&&(gt+=" "),gt+=ct)}else for(ct in ot)ot[ct]&&(gt&&(gt+=" "),gt+=ct);return gt}function oK(){for(var ot,st,ct=0,gt="",bt=arguments.length;ct<bt;ct++)(ot=arguments[ct])&&(st=iK(ot))&&(gt&&(gt+=" "),gt+=st);return gt}dA.exports=oK,dA.exports.clsx=oK});var ty=x(function(aK){Object.defineProperty(aK,"__esModule",{value:!0});aK.dontSetMe=Kve;aK.findInArray=Uve;aK.int=Gve;aK.isFunction=jve;aK.isNum=Vve;function Uve(ot,st){for(let ct=0,gt=ot.length;ct<gt;ct++)if(st.apply(st,[ot[ct],ct,ot]))return ot[ct]}function jve(ot){return typeof ot==="function"||Object.prototype.toString.call(ot)==="[object Function]"}function Vve(ot){return typeof ot==="number"&&!isNaN(ot)}function Gve(ot){return parseInt(ot,10)}function Kve(ot,st,ct){if(ot[st])return Error(`Invalid prop ${st} passed to ${ct} - do not set this, set it on the child.`)}});var dK=x(function(uK){Object.defineProperty(uK,"__esModule",{value:!0});uK.browserPrefixToKey=cK;uK.browserPrefixToStyle=Zve;uK.default=void 0;uK.getPrefix=lK;var fA=["Moz","Webkit","O","ms"];function lK(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let st=window.document?.documentElement?.style;if(!st)return"";if(ot in st)return"";for(let ct=0;ct<fA.length;ct++)if(cK(ot,fA[ct])in st)return fA[ct];return""}function cK(ot,st){return st?`${st}${exe(ot)}`:ot}function Zve(ot,st){return st?`-${st.toLowerCase()}-${ot}`:ot}function exe(ot){let st="",ct=!0;for(let gt=0;gt<ot.length;gt++)if(ct)st+=ot[gt].toUpperCase(),ct=!1;else if(ot[gt]==="-")ct=!0;else st+=ot[gt];return st}var kMt=uK.default=lK()});var tS=x(function(vK){Object.defineProperty(vK,"__esModule",{value:!0});vK.addClassName=bK;vK.addEvent=ixe;vK.addUserSelectStyles=hxe;vK.createCSSTransform=dxe;vK.createSVGTransform=fxe;vK.getTouch=mxe;vK.getTouchIdentifier=gxe;vK.getTranslation=mA;vK.innerHeight=cxe;vK.innerWidth=uxe;vK.matchesSelector=hK;vK.matchesSelectorAndParentsTo=oxe;vK.offsetXYFromParent=pxe;vK.outerHeight=axe;vK.outerWidth=lxe;vK.removeClassName=yK;vK.removeEvent=sxe;vK.scheduleRemoveUserSelectStyles=bxe;var $s=ty(),fK=gK(dK());function gK(ot,st){if(typeof WeakMap=="function")var ct=new WeakMap,gt=new WeakMap;return(gK=function(bt,yt){if(!yt&&bt&&bt.__esModule)return bt;var vt,xt,wt={__proto__:null,default:bt};if(bt===null||typeof bt!="object"&&typeof bt!="function")return wt;if(vt=yt?gt:ct){if(vt.has(bt))return vt.get(bt);vt.set(bt,wt)}for(let Ct in bt)Ct!=="default"&&{}.hasOwnProperty.call(bt,Ct)&&((xt=(vt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(bt,Ct))&&(xt.get||xt.set)?vt(wt,Ct,xt):wt[Ct]=bt[Ct]);return wt})(ot,st)}var eS="";function hK(ot,st){if(!eS)eS=(0,$s.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(ct){return(0,$s.isFunction)(ot[ct])});if(!(0,$s.isFunction)(ot[eS]))return!1;return ot[eS](st)}function oxe(ot,st,ct){let gt=ot;do{if(hK(gt,st))return!0;if(gt===ct)return!1;gt=gt.parentNode}while(gt);return!1}function ixe(ot,st,ct,gt){if(!ot)return;let bt={capture:!0,...gt};if(ot.addEventListener)ot.addEventListener(st,ct,bt);else if(ot.attachEvent)ot.attachEvent("on"+st,ct);else ot["on"+st]=ct}function sxe(ot,st,ct,gt){if(!ot)return;let bt={capture:!0,...gt};if(ot.removeEventListener)ot.removeEventListener(st,ct,bt);else if(ot.detachEvent)ot.detachEvent("on"+st,ct);else ot["on"+st]=null}function axe(ot){let st=ot.clientHeight,ct=ot.ownerDocument.defaultView.getComputedStyle(ot);return st+=(0,$s.int)(ct.borderTopWidth),st+=(0,$s.int)(ct.borderBottomWidth),st}function lxe(ot){let st=ot.clientWidth,ct=ot.ownerDocument.defaultView.getComputedStyle(ot);return st+=(0,$s.int)(ct.borderLeftWidth),st+=(0,$s.int)(ct.borderRightWidth),st}function cxe(ot){let st=ot.clientHeight,ct=ot.ownerDocument.defaultView.getComputedStyle(ot);return st-=(0,$s.int)(ct.paddingTop),st-=(0,$s.int)(ct.paddingBottom),st}function uxe(ot){let st=ot.clientWidth,ct=ot.ownerDocument.defaultView.getComputedStyle(ot);return st-=(0,$s.int)(ct.paddingLeft),st-=(0,$s.int)(ct.paddingRight),st}function pxe(ot,st,ct){let bt=st===st.ownerDocument.body?{left:0,top:0}:st.getBoundingClientRect(),yt=(ot.clientX+st.scrollLeft-bt.left)/ct,vt=(ot.clientY+st.scrollTop-bt.top)/ct;return{x:yt,y:vt}}function dxe(ot,st){let ct=mA(ot,st,"px");return{[(0,fK.browserPrefixToKey)("transform",fK.default)]:ct}}function fxe(ot,st){return mA(ot,st,"")}function mA(ot,st,ct){let{x:gt,y:bt}=ot,yt=`translate(${gt}${ct},${bt}${ct})`;if(st){let vt=`${typeof st.x==="string"?st.x:st.x+ct}`,xt=`${typeof st.y==="string"?st.y:st.y+ct}`;yt=`translate(${vt}, ${xt})`+yt}return yt}function mxe(ot,st){return ot.targetTouches&&(0,$s.findInArray)(ot.targetTouches,(ct)=>st===ct.identifier)||ot.changedTouches&&(0,$s.findInArray)(ot.changedTouches,(ct)=>st===ct.identifier)}function gxe(ot){if(ot.targetTouches&&ot.targetTouches[0])return ot.targetTouches[0].identifier;if(ot.changedTouches&&ot.changedTouches[0])return ot.changedTouches[0].identifier}function hxe(ot){if(!ot)return;let st=ot.getElementById("react-draggable-style-el");if(!st)st=ot.createElement("style"),st.type="text/css",st.id="react-draggable-style-el",st.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
8
+ `,st.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
+ `,ot.getElementsByTagName("head")[0].appendChild(st);if(ot.body)bK(ot.body,"react-draggable-transparent-selection")}function bxe(ot){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{mK(ot)});else mK(ot)}function mK(ot){if(!ot)return;try{if(ot.body)yK(ot.body,"react-draggable-transparent-selection");if(ot.selection)ot.selection.empty();else{let st=(ot.defaultView||window).getSelection();if(st&&st.type!=="Caret")st.removeAllRanges()}}catch(st){}}function bK(ot,st){if(ot.classList)ot.classList.add(st);else if(!ot.className.match(new RegExp(`(?:^|\\s)${st}(?!\\S)`)))ot.className+=` ${st}`}function yK(ot,st){if(ot.classList)ot.classList.remove(st);else ot.className=ot.className.replace(new RegExp(`(?:^|\\s)${st}(?!\\S)`,"g"),"")}});var hA=x(function(xK){Object.defineProperty(xK,"__esModule",{value:!0});xK.canDragX=Fxe;xK.canDragY=Hxe;xK.createCoreData=$xe;xK.createDraggableData=Wxe;xK.getBoundPosition=Lxe;xK.getControlPosition=zxe;xK.snapToGrid=Bxe;var Ws=ty(),rg=tS();function Lxe(ot,st,ct){if(!ot.props.bounds)return[st,ct];let{bounds:gt}=ot.props;gt=typeof gt==="string"?gt:Uxe(gt);let bt=gA(ot);if(typeof gt==="string"){let{ownerDocument:yt}=bt,vt=yt.defaultView,xt;if(gt==="parent")xt=bt.parentNode;else xt=bt.getRootNode().querySelector(gt);if(!(xt instanceof vt.HTMLElement))throw Error('Bounds selector "'+gt+'" could not find an element.');let wt=xt,Ct=vt.getComputedStyle(bt),St=vt.getComputedStyle(wt);gt={left:-bt.offsetLeft+(0,Ws.int)(St.paddingLeft)+(0,Ws.int)(Ct.marginLeft),top:-bt.offsetTop+(0,Ws.int)(St.paddingTop)+(0,Ws.int)(Ct.marginTop),right:(0,rg.innerWidth)(wt)-(0,rg.outerWidth)(bt)-bt.offsetLeft+(0,Ws.int)(St.paddingRight)-(0,Ws.int)(Ct.marginRight),bottom:(0,rg.innerHeight)(wt)-(0,rg.outerHeight)(bt)-bt.offsetTop+(0,Ws.int)(St.paddingBottom)-(0,Ws.int)(Ct.marginBottom)}}if((0,Ws.isNum)(gt.right))st=Math.min(st,gt.right);if((0,Ws.isNum)(gt.bottom))ct=Math.min(ct,gt.bottom);if((0,Ws.isNum)(gt.left))st=Math.max(st,gt.left);if((0,Ws.isNum)(gt.top))ct=Math.max(ct,gt.top);return[st,ct]}function Bxe(ot,st,ct){let gt=Math.round(st/ot[0])*ot[0],bt=Math.round(ct/ot[1])*ot[1];return[gt,bt]}function Fxe(ot){return ot.props.axis==="both"||ot.props.axis==="x"}function Hxe(ot){return ot.props.axis==="both"||ot.props.axis==="y"}function zxe(ot,st,ct){let gt=typeof st==="number"?(0,rg.getTouch)(ot,st):null;if(typeof st==="number"&&!gt)return null;let bt=gA(ct),yt=ct.props.offsetParent||bt.offsetParent||bt.ownerDocument.body;return(0,rg.offsetXYFromParent)(gt||ot,yt,ct.props.scale)}function $xe(ot,st,ct){let gt=!(0,Ws.isNum)(ot.lastX),bt=gA(ot);if(gt)return{node:bt,deltaX:0,deltaY:0,lastX:st,lastY:ct,x:st,y:ct};else return{node:bt,deltaX:st-ot.lastX,deltaY:ct-ot.lastY,lastX:ot.lastX,lastY:ot.lastY,x:st,y:ct}}function Wxe(ot,st){let ct=ot.props.scale;return{node:st.node,x:ot.state.x+st.deltaX/ct,y:ot.state.y+st.deltaY/ct,deltaX:st.deltaX/ct,deltaY:st.deltaY/ct,lastX:ot.state.x,lastY:ot.state.y}}function Uxe(ot){return{left:ot.left,top:ot.top,right:ot.right,bottom:ot.bottom}}function gA(ot){let st=ot.findDOMNode();if(!st)throw Error("<DraggableCore>: Unmounted during event!");return st}});var bA=x(function(wK){Object.defineProperty(wK,"__esModule",{value:!0});wK.default=Xxe;function Xxe(){}});var kK=x(function(SK){var nwe=e(t()),rwe=e(_());Object.defineProperty(SK,"__esModule",{value:!0});SK.default=void 0;var yA=CK(nwe),ts=xA(ey()),Zxe=xA(rwe),Wi=tS(),tp=hA(),vA=ty(),ny=xA(bA());function xA(ot){return ot&&ot.__esModule?ot:{default:ot}}function CK(ot,st){if(typeof WeakMap=="function")var ct=new WeakMap,gt=new WeakMap;return(CK=function(bt,yt){if(!yt&&bt&&bt.__esModule)return bt;var vt,xt,wt={__proto__:null,default:bt};if(bt===null||typeof bt!="object"&&typeof bt!="function")return wt;if(vt=yt?gt:ct){if(vt.has(bt))return vt.get(bt);vt.set(bt,wt)}for(let Ct in bt)Ct!=="default"&&{}.hasOwnProperty.call(bt,Ct)&&((xt=(vt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(bt,Ct))&&(xt.get||xt.set)?vt(wt,Ct,xt):wt[Ct]=bt[Ct]);return wt})(ot,st)}function ns(ot,st,ct){return(st=ewe(st))in ot?Object.defineProperty(ot,st,{value:ct,enumerable:!0,configurable:!0,writable:!0}):ot[st]=ct,ot}function ewe(ot){var st=twe(ot,"string");return typeof st=="symbol"?st:st+""}function twe(ot,st){if(typeof ot!="object"||!ot)return ot;var ct=ot[Symbol.toPrimitive];if(ct!==void 0){var gt=ct.call(ot,st||"default");if(typeof gt!="object")return gt;throw TypeError("@@toPrimitive must return a primitive value.")}return(st==="string"?String:Number)(ot)}var La={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},np=La.mouse;class ry extends yA.Component{constructor(){super(...arguments);ns(this,"dragging",!1),ns(this,"lastX",NaN),ns(this,"lastY",NaN),ns(this,"touchIdentifier",null),ns(this,"mounted",!1),ns(this,"handleDragStart",(ot)=>{if(this.props.onMouseDown(ot),!this.props.allowAnyClick&&typeof ot.button==="number"&&ot.button!==0)return!1;let st=this.findDOMNode();if(!st||!st.ownerDocument||!st.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:ct}=st;if(this.props.disabled||!(ot.target instanceof ct.defaultView.Node)||this.props.handle&&!(0,Wi.matchesSelectorAndParentsTo)(ot.target,this.props.handle,st)||this.props.cancel&&(0,Wi.matchesSelectorAndParentsTo)(ot.target,this.props.cancel,st))return;if(ot.type==="touchstart"&&!this.props.allowMobileScroll)ot.preventDefault();let gt=(0,Wi.getTouchIdentifier)(ot);this.touchIdentifier=gt;let bt=(0,tp.getControlPosition)(ot,gt,this);if(bt==null)return;let{x:yt,y:vt}=bt,xt=(0,tp.createCoreData)(this,yt,vt);if((0,ny.default)("DraggableCore: handleDragStart: %j",xt),(0,ny.default)("calling",this.props.onStart),this.props.onStart(ot,xt)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,Wi.addUserSelectStyles)(ct);this.dragging=!0,this.lastX=yt,this.lastY=vt,(0,Wi.addEvent)(ct,np.move,this.handleDrag),(0,Wi.addEvent)(ct,np.stop,this.handleDragStop)}),ns(this,"handleDrag",(ot)=>{let st=(0,tp.getControlPosition)(ot,this.touchIdentifier,this);if(st==null)return;let{x:ct,y:gt}=st;if(Array.isArray(this.props.grid)){let vt=ct-this.lastX,xt=gt-this.lastY;if([vt,xt]=(0,tp.snapToGrid)(this.props.grid,vt,xt),!vt&&!xt)return;ct=this.lastX+vt,gt=this.lastY+xt}let bt=(0,tp.createCoreData)(this,ct,gt);if((0,ny.default)("DraggableCore: handleDrag: %j",bt),this.props.onDrag(ot,bt)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(vt){let xt=document.createEvent("MouseEvents");xt.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(xt)}return}this.lastX=ct,this.lastY=gt}),ns(this,"handleDragStop",(ot)=>{if(!this.dragging)return;let st=(0,tp.getControlPosition)(ot,this.touchIdentifier,this);if(st==null)return;let{x:ct,y:gt}=st;if(Array.isArray(this.props.grid)){let xt=ct-this.lastX||0,wt=gt-this.lastY||0;[xt,wt]=(0,tp.snapToGrid)(this.props.grid,xt,wt),ct=this.lastX+xt,gt=this.lastY+wt}let bt=(0,tp.createCoreData)(this,ct,gt);if(this.props.onStop(ot,bt)===!1||this.mounted===!1)return!1;let vt=this.findDOMNode();if(vt){if(this.props.enableUserSelectHack)(0,Wi.scheduleRemoveUserSelectStyles)(vt.ownerDocument)}if((0,ny.default)("DraggableCore: handleDragStop: %j",bt),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,vt)(0,ny.default)("DraggableCore: Removing handlers"),(0,Wi.removeEvent)(vt.ownerDocument,np.move,this.handleDrag),(0,Wi.removeEvent)(vt.ownerDocument,np.stop,this.handleDragStop)}),ns(this,"onMouseDown",(ot)=>(np=La.mouse,this.handleDragStart(ot))),ns(this,"onMouseUp",(ot)=>(np=La.mouse,this.handleDragStop(ot))),ns(this,"onTouchStart",(ot)=>(np=La.touch,this.handleDragStart(ot))),ns(this,"onTouchEnd",(ot)=>(np=La.touch,this.handleDragStop(ot)))}componentDidMount(){this.mounted=!0;let ot=this.findDOMNode();if(ot)(0,Wi.addEvent)(ot,La.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let ot=this.findDOMNode();if(ot){let{ownerDocument:st}=ot;if((0,Wi.removeEvent)(st,La.mouse.move,this.handleDrag),(0,Wi.removeEvent)(st,La.touch.move,this.handleDrag),(0,Wi.removeEvent)(st,La.mouse.stop,this.handleDragStop),(0,Wi.removeEvent)(st,La.touch.stop,this.handleDragStop),(0,Wi.removeEvent)(ot,La.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,Wi.scheduleRemoveUserSelectStyles)(st)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:Zxe.default.findDOMNode(this)}render(){return yA.cloneElement(yA.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}SK.default=ry;ns(ry,"displayName","DraggableCore");ns(ry,"propTypes",{allowAnyClick:ts.default.bool,allowMobileScroll:ts.default.bool,children:ts.default.node.isRequired,disabled:ts.default.bool,enableUserSelectHack:ts.default.bool,offsetParent:function(ot,st){if(ot[st]&&ot[st].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:ts.default.arrayOf(ts.default.number),handle:ts.default.string,cancel:ts.default.string,nodeRef:ts.default.object,onStart:ts.default.func,onDrag:ts.default.func,onStop:ts.default.func,onMouseDown:ts.default.func,scale:ts.default.number,className:vA.dontSetMe,style:vA.dontSetMe,transform:vA.dontSetMe});ns(ry,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var IK=x(function(SA){var lwe=e(t()),cwe=e(_());Object.defineProperty(SA,"__esModule",{value:!0});Object.defineProperty(SA,"DraggableCore",{enumerable:!0,get:function(){return oS.default}});SA.default=void 0;var nS=TK(lwe),So=iS(ey()),owe=iS(cwe),iwe=sK(),RK=tS(),og=hA(),wA=ty(),oS=iS(kK()),rS=iS(bA());function iS(ot){return ot&&ot.__esModule?ot:{default:ot}}function TK(ot,st){if(typeof WeakMap=="function")var ct=new WeakMap,gt=new WeakMap;return(TK=function(bt,yt){if(!yt&&bt&&bt.__esModule)return bt;var vt,xt,wt={__proto__:null,default:bt};if(bt===null||typeof bt!="object"&&typeof bt!="function")return wt;if(vt=yt?gt:ct){if(vt.has(bt))return vt.get(bt);vt.set(bt,wt)}for(let Ct in bt)Ct!=="default"&&{}.hasOwnProperty.call(bt,Ct)&&((xt=(vt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(bt,Ct))&&(xt.get||xt.set)?vt(wt,Ct,xt):wt[Ct]=bt[Ct]);return wt})(ot,st)}function CA(){return CA=Object.assign?Object.assign.bind():function(ot){for(var st=1;st<arguments.length;st++){var ct=arguments[st];for(var gt in ct)({}).hasOwnProperty.call(ct,gt)&&(ot[gt]=ct[gt])}return ot},CA.apply(null,arguments)}function ig(ot,st,ct){return(st=swe(st))in ot?Object.defineProperty(ot,st,{value:ct,enumerable:!0,configurable:!0,writable:!0}):ot[st]=ct,ot}function swe(ot){var st=awe(ot,"string");return typeof st=="symbol"?st:st+""}function awe(ot,st){if(typeof ot!="object"||!ot)return ot;var ct=ot[Symbol.toPrimitive];if(ct!==void 0){var gt=ct.call(ot,st||"default");if(typeof gt!="object")return gt;throw TypeError("@@toPrimitive must return a primitive value.")}return(st==="string"?String:Number)(ot)}class oy extends nS.Component{static getDerivedStateFromProps(ot,st){let{position:ct}=ot,{prevPropsPosition:gt}=st;if(ct&&(!gt||ct.x!==gt.x||ct.y!==gt.y))return(0,rS.default)("Draggable: getDerivedStateFromProps %j",{position:ct,prevPropsPosition:gt}),{x:ct.x,y:ct.y,prevPropsPosition:{...ct}};return null}constructor(ot){super(ot);if(ig(this,"onDragStart",(st,ct)=>{if((0,rS.default)("Draggable: onDragStart: %j",ct),this.props.onStart(st,(0,og.createDraggableData)(this,ct))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),ig(this,"onDrag",(st,ct)=>{if(!this.state.dragging)return!1;(0,rS.default)("Draggable: onDrag: %j",ct);let gt=(0,og.createDraggableData)(this,ct),bt={x:gt.x,y:gt.y,slackX:0,slackY:0};if(this.props.bounds){let{x:vt,y:xt}=bt;bt.x+=this.state.slackX,bt.y+=this.state.slackY;let[wt,Ct]=(0,og.getBoundPosition)(this,bt.x,bt.y);bt.x=wt,bt.y=Ct,bt.slackX=this.state.slackX+(vt-bt.x),bt.slackY=this.state.slackY+(xt-bt.y),gt.x=bt.x,gt.y=bt.y,gt.deltaX=bt.x-this.state.x,gt.deltaY=bt.y-this.state.y}if(this.props.onDrag(st,gt)===!1)return!1;this.setState(bt)}),ig(this,"onDragStop",(st,ct)=>{if(!this.state.dragging)return!1;if(this.props.onStop(st,(0,og.createDraggableData)(this,ct))===!1)return!1;(0,rS.default)("Draggable: onDragStop: %j",ct);let bt={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:vt,y:xt}=this.props.position;bt.x=vt,bt.y=xt}this.setState(bt)}),this.state={dragging:!1,dragged:!1,x:ot.position?ot.position.x:ot.defaultPosition.x,y:ot.position?ot.position.y:ot.defaultPosition.y,prevPropsPosition:{...ot.position},slackX:0,slackY:0,isElementSVG:!1},ot.position&&!(ot.onDrag||ot.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??owe.default.findDOMNode(this)}render(){let{axis:ot,bounds:st,children:ct,defaultPosition:gt,defaultClassName:bt,defaultClassNameDragging:yt,defaultClassNameDragged:vt,position:xt,positionOffset:wt,scale:Ct,...St}=this.props,Et={},kt=null,Tt=!Boolean(xt)||this.state.dragging,Pt=xt||gt,Mt={x:(0,og.canDragX)(this)&&Tt?this.state.x:Pt.x,y:(0,og.canDragY)(this)&&Tt?this.state.y:Pt.y};if(this.state.isElementSVG)kt=(0,RK.createSVGTransform)(Mt,wt);else Et=(0,RK.createCSSTransform)(Mt,wt);let It=(0,iwe.clsx)(ct.props.className||"",bt,{[yt]:this.state.dragging,[vt]:this.state.dragged});return nS.createElement(oS.default,CA({},St,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),nS.cloneElement(nS.Children.only(ct),{className:It,style:{...ct.props.style,...Et},transform:kt}))}}SA.default=oy;ig(oy,"displayName","Draggable");ig(oy,"propTypes",{...oS.default.propTypes,axis:So.default.oneOf(["both","x","y","none"]),bounds:So.default.oneOfType([So.default.shape({left:So.default.number,right:So.default.number,top:So.default.number,bottom:So.default.number}),So.default.string,So.default.oneOf([!1])]),defaultClassName:So.default.string,defaultClassNameDragging:So.default.string,defaultClassNameDragged:So.default.string,defaultPosition:So.default.shape({x:So.default.number,y:So.default.number}),positionOffset:So.default.shape({x:So.default.oneOfType([So.default.number,So.default.string]),y:So.default.oneOfType([So.default.number,So.default.string])}),position:So.default.shape({x:So.default.number,y:So.default.number}),className:wA.dontSetMe,style:wA.dontSetMe,transform:wA.dontSetMe});ig(oy,"defaultProps",{...oS.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 aS=x(function(NMt,sS){var{default:MK,DraggableCore:uwe}=IK();sS.exports=MK;sS.exports.default=MK;sS.exports.DraggableCore=uwe});var DK=x(function(bwe){var xwe=e(t());bwe.__esModule=!0;bwe.cloneElement=hwe;var pwe=dwe(xwe);function dwe(ot){return ot&&ot.__esModule?ot:{default:ot}}function AK(ot,st){var ct=Object.keys(ot);if(Object.getOwnPropertySymbols){var gt=Object.getOwnPropertySymbols(ot);st&&(gt=gt.filter(function(bt){return Object.getOwnPropertyDescriptor(ot,bt).enumerable})),ct.push.apply(ct,gt)}return ct}function NK(ot){for(var st=1;st<arguments.length;st++){var ct=arguments[st]!=null?arguments[st]:{};st%2?AK(Object(ct),!0).forEach(function(gt){fwe(ot,gt,ct[gt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ot,Object.getOwnPropertyDescriptors(ct)):AK(Object(ct)).forEach(function(gt){Object.defineProperty(ot,gt,Object.getOwnPropertyDescriptor(ct,gt))})}return ot}function fwe(ot,st,ct){return(st=mwe(st))in ot?Object.defineProperty(ot,st,{value:ct,enumerable:!0,configurable:!0,writable:!0}):ot[st]=ct,ot}function mwe(ot){var st=gwe(ot,"string");return typeof st=="symbol"?st:st+""}function gwe(ot,st){if(typeof ot!="object"||!ot)return ot;var ct=ot[Symbol.toPrimitive];if(ct!==void 0){var gt=ct.call(ot,st||"default");if(typeof gt!="object")return gt;throw TypeError("@@toPrimitive must return a primitive value.")}return(st==="string"?String:Number)(ot)}function hwe(ot,st){if(st.style&&ot.props.style)st.style=NK(NK({},ot.props.style),st.style);if(st.className&&ot.props.className)st.className=ot.props.className+" "+st.className;return pwe.default.cloneElement(ot,st)}});var EA=x(function(Cwe){Cwe.__esModule=!0;Cwe.resizableProps=void 0;var Rr=wwe(ey()),_Mt=aS();function wwe(ot){return ot&&ot.__esModule?ot:{default:ot}}var OMt=Cwe.resizableProps={axis:Rr.default.oneOf(["both","x","y","none"]),className:Rr.default.string,children:Rr.default.element.isRequired,draggableOpts:Rr.default.shape({allowAnyClick:Rr.default.bool,cancel:Rr.default.string,children:Rr.default.node,disabled:Rr.default.bool,enableUserSelectHack:Rr.default.bool,offsetParent:typeof Element<"u"?Rr.default.instanceOf(Element):Rr.default.any,grid:Rr.default.arrayOf(Rr.default.number),handle:Rr.default.string,nodeRef:Rr.default.object,onStart:Rr.default.func,onDrag:Rr.default.func,onStop:Rr.default.func,onMouseDown:Rr.default.func,scale:Rr.default.number}),height:function(){for(var ot=arguments.length,st=Array(ot),ct=0;ct<ot;ct++)st[ct]=arguments[ct];let gt=st[0];if(gt.axis==="both"||gt.axis==="y")return Rr.default.number.isRequired(...st);return Rr.default.number(...st)},handle:Rr.default.oneOfType([Rr.default.node,Rr.default.func]),handleSize:Rr.default.arrayOf(Rr.default.number),lockAspectRatio:Rr.default.bool,maxConstraints:Rr.default.arrayOf(Rr.default.number),minConstraints:Rr.default.arrayOf(Rr.default.number),onResizeStop:Rr.default.func,onResizeStart:Rr.default.func,onResize:Rr.default.func,resizeHandles:Rr.default.arrayOf(Rr.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Rr.default.number,width:function(){for(var ot=arguments.length,st=Array(ot),ct=0;ct<ot;ct++)st[ct]=arguments[ct];let gt=st[0];if(gt.axis==="both"||gt.axis==="x")return Rr.default.number.isRequired(...st);return Rr.default.number(...st)}}});var TA=x(function(Nwe){var _we=e(t());Nwe.__esModule=!0;Nwe.default=void 0;var sg=LK(_we),Ewe=aS(),kwe=DK(),Rwe=EA(),Twe=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function LK(ot,st){if(typeof WeakMap=="function")var ct=new WeakMap,gt=new WeakMap;return(LK=function(bt,yt){if(!yt&&bt&&bt.__esModule)return bt;var vt,xt,wt={__proto__:null,default:bt};if(bt===null||typeof bt!="object"&&typeof bt!="function")return wt;if(vt=yt?gt:ct){if(vt.has(bt))return vt.get(bt);vt.set(bt,wt)}for(let Ct in bt)Ct!=="default"&&{}.hasOwnProperty.call(bt,Ct)&&((xt=(vt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(bt,Ct))&&(xt.get||xt.set)?vt(wt,Ct,xt):wt[Ct]=bt[Ct]);return wt})(ot,st)}function RA(){return RA=Object.assign?Object.assign.bind():function(ot){for(var st=1;st<arguments.length;st++){var ct=arguments[st];for(var gt in ct)({}).hasOwnProperty.call(ct,gt)&&(ot[gt]=ct[gt])}return ot},RA.apply(null,arguments)}function Pwe(ot,st){if(ot==null)return{};var ct={};for(var gt in ot)if({}.hasOwnProperty.call(ot,gt)){if(st.indexOf(gt)!==-1)continue;ct[gt]=ot[gt]}return ct}function OK(ot,st){var ct=Object.keys(ot);if(Object.getOwnPropertySymbols){var gt=Object.getOwnPropertySymbols(ot);st&&(gt=gt.filter(function(bt){return Object.getOwnPropertyDescriptor(ot,bt).enumerable})),ct.push.apply(ct,gt)}return ct}function kA(ot){for(var st=1;st<arguments.length;st++){var ct=arguments[st]!=null?arguments[st]:{};st%2?OK(Object(ct),!0).forEach(function(gt){Iwe(ot,gt,ct[gt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ot,Object.getOwnPropertyDescriptors(ct)):OK(Object(ct)).forEach(function(gt){Object.defineProperty(ot,gt,Object.getOwnPropertyDescriptor(ct,gt))})}return ot}function Iwe(ot,st,ct){return(st=Mwe(st))in ot?Object.defineProperty(ot,st,{value:ct,enumerable:!0,configurable:!0,writable:!0}):ot[st]=ct,ot}function Mwe(ot){var st=Awe(ot,"string");return typeof st=="symbol"?st:st+""}function Awe(ot,st){if(typeof ot!="object"||!ot)return ot;var ct=ot[Symbol.toPrimitive];if(ct!==void 0){var gt=ct.call(ot,st||"default");if(typeof gt!="object")return gt;throw TypeError("@@toPrimitive must return a primitive value.")}return(st==="string"?String:Number)(ot)}class lS extends sg.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(ot,st){let ct=this.props,{minConstraints:gt,maxConstraints:bt,lockAspectRatio:yt}=ct;if(!gt&&!bt&&!yt)return[ot,st];if(yt){let Et=this.props.width/this.props.height,kt=ot-this.props.width,Rt=st-this.props.height;if(Math.abs(kt)>Math.abs(Rt*Et))st=ot/Et;else ot=st*Et}let vt=ot,xt=st,wt=this.slack||[0,0],Ct=wt[0],St=wt[1];if(ot+=Ct,st+=St,gt)ot=Math.max(gt[0],ot),st=Math.max(gt[1],st);if(bt)ot=Math.min(bt[0],ot),st=Math.min(bt[1],st);return this.slack=[Ct+(vt-ot),St+(xt-st)],[ot,st]}resizeHandler(ot,st){return(ct,gt)=>{var bt,yt,vt,xt;let{node:wt,deltaX:Ct,deltaY:St}=gt;if(ot==="onResizeStart")this.resetData();let Et=(this.props.axis==="both"||this.props.axis==="x")&&st!=="n"&&st!=="s",kt=(this.props.axis==="both"||this.props.axis==="y")&&st!=="e"&&st!=="w";if(!Et&&!kt)return;let Rt=st[0],Tt=st[st.length-1],Pt=wt.getBoundingClientRect();if(this.lastHandleRect!=null){if(Tt==="w"){let Bt=Pt.left-this.lastHandleRect.left;Ct+=Bt}if(Rt==="n"){let Bt=Pt.top-this.lastHandleRect.top;St+=Bt}}if(this.lastHandleRect=Pt,Tt==="w")Ct=-Ct;if(Rt==="n")St=-St;let Mt=(bt=(yt=this.lastSize)==null?void 0:yt.width)!=null?bt:this.props.width,It=(vt=(xt=this.lastSize)==null?void 0:xt.height)!=null?vt:this.props.height,At=Mt+(Et?Ct/this.props.transformScale:0),Nt=It+(kt?St/this.props.transformScale:0);var Ot=this.runConstraints(At,Nt);if(At=Ot[0],Nt=Ot[1],ot==="onResizeStop"&&this.lastSize){var Dt=this.lastSize;At=Dt.width,Nt=Dt.height}let _t=At!==Mt||Nt!==It;if(ot!=="onResizeStop")this.lastSize={width:At,height:Nt};let $t=typeof this.props[ot]==="function"?this.props[ot]:null;if($t&&!(ot==="onResize"&&!_t))ct.persist==null||ct.persist(),$t(ct,{node:wt,size:{width:At,height:Nt},handle:st});if(ot==="onResizeStop")this.resetData()}}renderResizeHandle(ot,st){let ct=this.props.handle;if(!ct)return sg.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+ot,ref:st});if(typeof ct==="function")return ct(ot,st);let gt=typeof ct.type==="string",bt=kA({ref:st},gt?{}:{handleAxis:ot});return sg.cloneElement(ct,bt)}render(){let ot=this.props,{children:st,className:ct,draggableOpts:gt,width:bt,height:yt,handle:vt,handleSize:xt,lockAspectRatio:wt,axis:Ct,minConstraints:St,maxConstraints:Et,onResize:kt,onResizeStop:Rt,onResizeStart:Tt,resizeHandles:Pt,transformScale:Mt}=ot,It=Pwe(ot,Twe);return(0,kwe.cloneElement)(st,kA(kA({},It),{},{className:(ct?ct+" ":"")+"react-resizable",children:[...sg.Children.toArray(st.props.children),...Pt.map((At)=>{var Nt;let Ot=(Nt=this.handleRefs[At])!=null?Nt:this.handleRefs[At]=sg.createRef();return sg.createElement(Ewe.DraggableCore,RA({},gt,{nodeRef:Ot,key:"resizableHandle-"+At,onStop:this.resizeHandler("onResizeStop",At),onStart:this.resizeHandler("onResizeStart",At),onDrag:this.resizeHandler("onResize",At)}),this.renderResizeHandle(At,Ot))})]}))}}Nwe.default=lS;lS.propTypes=Rwe.resizableProps;lS.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var WK=x(function(Uwe){var Vwe=e(t());Uwe.__esModule=!0;Uwe.default=void 0;var PA=zK(Vwe),Owe=HK(ey()),Lwe=HK(TA()),Bwe=EA(),Fwe=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function HK(ot){return ot&&ot.__esModule?ot:{default:ot}}function zK(ot,st){if(typeof WeakMap=="function")var ct=new WeakMap,gt=new WeakMap;return(zK=function(bt,yt){if(!yt&&bt&&bt.__esModule)return bt;var vt,xt,wt={__proto__:null,default:bt};if(bt===null||typeof bt!="object"&&typeof bt!="function")return wt;if(vt=yt?gt:ct){if(vt.has(bt))return vt.get(bt);vt.set(bt,wt)}for(let Ct in bt)Ct!=="default"&&{}.hasOwnProperty.call(bt,Ct)&&((xt=(vt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(bt,Ct))&&(xt.get||xt.set)?vt(wt,Ct,xt):wt[Ct]=bt[Ct]);return wt})(ot,st)}function IA(){return IA=Object.assign?Object.assign.bind():function(ot){for(var st=1;st<arguments.length;st++){var ct=arguments[st];for(var gt in ct)({}).hasOwnProperty.call(ct,gt)&&(ot[gt]=ct[gt])}return ot},IA.apply(null,arguments)}function FK(ot,st){var ct=Object.keys(ot);if(Object.getOwnPropertySymbols){var gt=Object.getOwnPropertySymbols(ot);st&&(gt=gt.filter(function(bt){return Object.getOwnPropertyDescriptor(ot,bt).enumerable})),ct.push.apply(ct,gt)}return ct}function cS(ot){for(var st=1;st<arguments.length;st++){var ct=arguments[st]!=null?arguments[st]:{};st%2?FK(Object(ct),!0).forEach(function(gt){Hwe(ot,gt,ct[gt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ot,Object.getOwnPropertyDescriptors(ct)):FK(Object(ct)).forEach(function(gt){Object.defineProperty(ot,gt,Object.getOwnPropertyDescriptor(ct,gt))})}return ot}function Hwe(ot,st,ct){return(st=zwe(st))in ot?Object.defineProperty(ot,st,{value:ct,enumerable:!0,configurable:!0,writable:!0}):ot[st]=ct,ot}function zwe(ot){var st=$we(ot,"string");return typeof st=="symbol"?st:st+""}function $we(ot,st){if(typeof ot!="object"||!ot)return ot;var ct=ot[Symbol.toPrimitive];if(ct!==void 0){var gt=ct.call(ot,st||"default");if(typeof gt!="object")return gt;throw TypeError("@@toPrimitive must return a primitive value.")}return(st==="string"?String:Number)(ot)}function Wwe(ot,st){if(ot==null)return{};var ct={};for(var gt in ot)if({}.hasOwnProperty.call(ot,gt)){if(st.indexOf(gt)!==-1)continue;ct[gt]=ot[gt]}return ct}class MA extends PA.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(ot,st)=>{let ct=st.size;if(this.props.onResize)ot.persist==null||ot.persist(),this.setState(ct,()=>this.props.onResize&&this.props.onResize(ot,st));else this.setState(ct)}}static getDerivedStateFromProps(ot,st){if(st.propsWidth!==ot.width||st.propsHeight!==ot.height)return{width:ot.width,height:ot.height,propsWidth:ot.width,propsHeight:ot.height};return null}render(){let ot=this.props,{handle:st,handleSize:ct,onResize:gt,onResizeStart:bt,onResizeStop:yt,draggableOpts:vt,minConstraints:xt,maxConstraints:wt,lockAspectRatio:Ct,axis:St,width:Et,height:kt,resizeHandles:Rt,style:Tt,transformScale:Pt}=ot,Mt=Wwe(ot,Fwe);return PA.createElement(Lwe.default,{axis:St,draggableOpts:vt,handle:st,handleSize:ct,height:this.state.height,lockAspectRatio:Ct,maxConstraints:wt,minConstraints:xt,onResizeStart:bt,onResize:this.onResize,onResizeStop:yt,resizeHandles:Rt,transformScale:Pt,width:this.state.width},PA.createElement("div",IA({},Mt,{style:cS(cS({},Tt),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}Uwe.default=MA;MA.propTypes=cS(cS({},Bwe.resizableProps),{},{children:Owe.default.element})});var AA=x(function(HMt,uS){uS.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};uS.exports.Resizable=TA().default;uS.exports.ResizableBox=WK().default});var hJ=x(function(XS,gJ){(function(ot,st){typeof XS==="object"&&typeof gJ<"u"?st(XS):typeof define==="function"&&define.amd?define(["exports"],st):(ot=typeof globalThis<"u"?globalThis:ot||self,st(ot["fast-equals"]={}))})(XS,function(ot){function st(Zt){return function(sn,dn,fn,bn,hn,gn,xn){return Zt(sn,dn,xn)}}function ct(Zt){return function(sn,dn,fn,bn){if(!sn||!dn||typeof sn!=="object"||typeof dn!=="object")return Zt(sn,dn,fn,bn);var hn=bn.get(sn),gn=bn.get(dn);if(hn&&gn)return hn===dn&&gn===sn;bn.set(sn,dn),bn.set(dn,sn);var xn=Zt(sn,dn,fn,bn);return bn.delete(sn),bn.delete(dn),xn}}function gt(Zt,on){var sn={};for(var dn in Zt)sn[dn]=Zt[dn];for(var dn in on)sn[dn]=on[dn];return sn}function bt(Zt){return Zt.constructor===Object||Zt.constructor==null}function yt(Zt){return typeof Zt.then==="function"}function vt(Zt,on){return Zt===on||Zt!==Zt&&on!==on}var xt="[object Arguments]",wt="[object Boolean]",Ct="[object Date]",St="[object RegExp]",Et="[object Map]",kt="[object Number]",Rt="[object Object]",Tt="[object Set]",Pt="[object String]",Mt=Object.prototype.toString;function It(Zt){var{areArraysEqual:on,areDatesEqual:sn,areMapsEqual:dn,areObjectsEqual:fn,areRegExpsEqual:bn,areSetsEqual:hn,createIsNestedEqual:gn}=Zt,xn=gn(wn);function wn(yn,nn,en){if(yn===nn)return!0;if(!yn||!nn||typeof yn!=="object"||typeof nn!=="object")return yn!==yn&&nn!==nn;if(bt(yn)&&bt(nn))return fn(yn,nn,xn,en);var pn=Array.isArray(yn),cn=Array.isArray(nn);if(pn||cn)return pn===cn&&on(yn,nn,xn,en);var mn=Mt.call(yn);if(mn!==Mt.call(nn))return!1;if(mn===Ct)return sn(yn,nn,xn,en);if(mn===St)return bn(yn,nn,xn,en);if(mn===Et)return dn(yn,nn,xn,en);if(mn===Tt)return hn(yn,nn,xn,en);if(mn===Rt||mn===xt)return yt(yn)||yt(nn)?!1:fn(yn,nn,xn,en);if(mn===wt||mn===kt||mn===Pt)return vt(yn.valueOf(),nn.valueOf());return!1}return wn}function At(Zt,on,sn,dn){var fn=Zt.length;if(on.length!==fn)return!1;while(fn-- >0)if(!sn(Zt[fn],on[fn],fn,fn,Zt,on,dn))return!1;return!0}var Nt=ct(At);function Ot(Zt,on){return vt(Zt.valueOf(),on.valueOf())}function Dt(Zt,on,sn,dn){var fn=Zt.size===on.size;if(!fn)return!1;if(!Zt.size)return!0;var bn={},hn=0;return Zt.forEach(function(gn,xn){if(!fn)return;var wn=!1,yn=0;on.forEach(function(nn,en){if(!wn&&!bn[yn]&&(wn=sn(xn,en,hn,yn,Zt,on,dn)&&sn(gn,nn,xn,en,Zt,on,dn)))bn[yn]=!0;yn++}),hn++,fn=wn}),fn}var _t=ct(Dt),$t="_owner",Ft=Object.prototype.hasOwnProperty;function Bt(Zt,on,sn,dn){var fn=Object.keys(Zt),bn=fn.length;if(Object.keys(on).length!==bn)return!1;var hn;while(bn-- >0){if(hn=fn[bn],hn===$t){var gn=!!Zt.$$typeof,xn=!!on.$$typeof;if((gn||xn)&&gn!==xn)return!1}if(!Ft.call(on,hn)||!sn(Zt[hn],on[hn],hn,hn,Zt,on,dn))return!1}return!0}var Lt=ct(Bt);function Vt(Zt,on){return Zt.source===on.source&&Zt.flags===on.flags}function Wt(Zt,on,sn,dn){var fn=Zt.size===on.size;if(!fn)return!1;if(!Zt.size)return!0;var bn={};return Zt.forEach(function(hn,gn){if(!fn)return;var xn=!1,wn=0;on.forEach(function(yn,nn){if(!xn&&!bn[wn]&&(xn=sn(hn,yn,gn,nn,Zt,on,dn)))bn[wn]=!0;wn++}),fn=xn}),fn}var Ut=ct(Wt),Ht=Object.freeze({areArraysEqual:At,areDatesEqual:Ot,areMapsEqual:Dt,areObjectsEqual:Bt,areRegExpsEqual:Vt,areSetsEqual:Wt,createIsNestedEqual:st}),Gt=Object.freeze({areArraysEqual:Nt,areDatesEqual:Ot,areMapsEqual:_t,areObjectsEqual:Lt,areRegExpsEqual:Vt,areSetsEqual:Ut,createIsNestedEqual:st}),jt=It(Ht);function qt(Zt,on){return jt(Zt,on,void 0)}var Qt=It(gt(Ht,{createIsNestedEqual:function(){return vt}}));function Xt(Zt,on){return Qt(Zt,on,void 0)}var zt=It(Gt);function tn(Zt,on){return zt(Zt,on,new WeakMap)}var rn=It(gt(Gt,{createIsNestedEqual:function(){return vt}}));function Kt(Zt,on){return rn(Zt,on,new WeakMap)}function an(Zt){return It(gt(Ht,Zt(Ht)))}function ln(Zt){var on=It(gt(Gt,Zt(Gt)));return function(sn,dn,fn){if(fn===void 0)fn=new WeakMap;return on(sn,dn,fn)}}ot.circularDeepEqual=tn,ot.circularShallowEqual=Kt,ot.createCustomCircularEqual=ln,ot.createCustomEqual=an,ot.deepEqual=qt,ot.sameValueZeroEqual=vt,ot.shallowEqual=Xt,Object.defineProperty(ot,"__esModule",{value:!0})})});var Ql={};be(Ql,{android:()=>DD,apple:()=>BE,ios:()=>LE,linux:()=>oZ,mac:()=>_D,windows:()=>rZ});var Oc={};be(Oc,{blink:()=>sZ,gecko:()=>iZ,webkit:()=>FE});var HE={};be(HE,{voiceOver:()=>aZ});var Ig={};be(Ig,{jsdom:()=>lZ});var Tb={};be(Tb,{boolean:()=>yr,booleanish:()=>Bo,commaOrSpaceSeparated:()=>xs,commaSeparated:()=>Ku,number:()=>Dn,overloadedBoolean:()=>q1,spaceSeparated:()=>so});var PI={};be(PI,{attentionMarkers:()=>vme,contentInitial:()=>fme,disable:()=>xme,document:()=>dme,flow:()=>gme,flowInitial:()=>mme,insideSpan:()=>yme,string:()=>hme,text:()=>bme});var Qd=e(t(),1),WN=e(r(),1),vE=Qd.createContext(void 0),Kn=(ot)=>{let st=Qd.useContext(vE);if(ot)return ot;if(!st)throw Error("No QueryClient set, use QueryClientProvider to set one");return st},xE=({client:ot,children:st})=>(Qd.useEffect(()=>(ot.mount(),()=>{ot.unmount()}),[ot]),WN.jsx(vE.Provider,{value:ot,children:st}));var Dy=e(t(),1),UN=Dy.createContext(!1),jN=()=>Dy.useContext(UN),MEe=UN.Provider;var Rg=e(t(),1),yY=e(r(),1);function vY(){let ot=!1;return{clearReset:()=>{ot=!1},reset:()=>{ot=!0},isReset:()=>ot}}var xY=Rg.createContext(vY()),VN=()=>Rg.useContext(xY);var JN=e(t(),1);var qN=class extends G{#t;#e=void 0;#r=void 0;#n=void 0;#o;#i;#s;#m;#p;#d;#l;#c;#a;#f=new Set;constructor(ot,st){super();this.options=st,this.#t=ot,this.#s=null,this.bindMethods(),this.setOptions(st)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#e.addObserver(this),GN(this.#e,this.options))this.#u();else this.updateResult();this.#v()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return wE(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wE(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#e.removeObserver(this)}setOptions(ot){let st=this.options,ct=this.#e;if(this.options=this.#t.defaultQueryOptions(ot),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof T(this.options.enabled,this.#e)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#C(),this.#e.setOptions(this.options),st._defaulted&&!we(this.options,st))this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});let gt=this.hasListeners();if(gt&&KN(this.#e,ct,this.options,st))this.#u();if(this.updateResult(),gt&&(this.#e!==ct||T(this.options.enabled,this.#e)!==T(st.enabled,this.#e)||T(this.options.staleTime,this.#e)!==T(st.staleTime,this.#e)))this.#h();let bt=this.#b();if(gt&&(this.#e!==ct||T(this.options.enabled,this.#e)!==T(st.enabled,this.#e)||bt!==this.#a))this.#y(bt)}getOptimisticResult(ot){let st=this.#t.getQueryCache().build(this.#t,ot),ct=this.createResult(st,ot);if(!we(this.getCurrentResult(),ct))this.#n=ct,this.#i=this.options,this.#o=this.#e.state;return ct}getCurrentResult(){return this.#n}trackResult(ot,st){return new Proxy(ot,{get:(ct,gt)=>(this.trackProp(gt),st?.(gt),Reflect.get(ct,gt))})}trackProp(ot){this.#f.add(ot)}getCurrentQuery(){return this.#e}refetch({...ot}={}){return this.fetch({...ot})}fetchOptimistic(ot){let st=this.#t.defaultQueryOptions(ot),ct=this.#t.getQueryCache().build(this.#t,st),gt=()=>{},bt,yt=new Promise((vt)=>{bt=vt,gt=this.#t.getQueryCache().subscribe((xt)=>{if(xt.type==="updated"&&xt.query.queryHash===ct.queryHash&&ct.state.data!==void 0)gt(),vt(this.createResult(ct,st))})});return Promise.race([ct.fetch().then(()=>{let vt=this.createResult(ct,st);return bt?.(vt),vt}).finally(()=>{gt()}),yt])}fetch(ot){return this.#u({...ot,cancelRefetch:ot.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#u(ot){this.#C();let st=this.#e.fetch(this.options,ot);if(!ot?.throwOnError)st=st.catch(A);return st}#g(ot){return!Ie()&&T(this.options.enabled,this.#e)!==!1&&Be(ot)}#h(){this.#x();let ot=T(this.options.staleTime,this.#e);if(this.#n.isStale||!this.#g(ot))return;let st=ze(this.#n.dataUpdatedAt,ot)+1;this.#l=Z.setTimeout(()=>{if(!this.#n.isStale)this.updateResult()},st)}#b(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(ot){if(this.#w(),this.#a=ot,this.#a===0||!this.#g(this.#a))return;this.#c=Z.setInterval(()=>{if(this.options.refetchIntervalInBackground||Ce.isFocused())this.#u()},this.#a)}#v(){this.#h(),this.#y(this.#b())}#x(){if(this.#l!==void 0)Z.clearTimeout(this.#l),this.#l=void 0}#w(){if(this.#c!==void 0)Z.clearInterval(this.#c),this.#c=void 0}createResult(ot,st){let ct=this.#e,gt=this.options,bt=this.#n,yt=this.#o,vt=this.#i,xt=ot!==ct?ot.state:this.#r,{state:wt}=ot,Ct={...wt},St=!1,Et;if(st._optimisticResults){let Dt=this.hasListeners(),_t=!Dt&&GN(ot,st),$t=Dt&&KN(ot,ct,st,gt);if(_t||$t)Ct={...Ct,...Ze(wt.data,ot.options)};if(st._optimisticResults==="isRestoring")Ct.fetchStatus="idle"}let{error:kt,errorUpdatedAt:Rt,status:Tt}=Ct;Et=Ct.data;let Pt=!1;if(st.placeholderData!==void 0&&Et===void 0&&Tt==="pending"){let Dt;if(bt?.isPlaceholderData&&st.placeholderData===vt?.placeholderData)Dt=bt.data,Pt=!0;else Dt=typeof st.placeholderData==="function"?st.placeholderData(this.#d?.state.data,this.#d):st.placeholderData;if(Dt!==void 0)Tt="success",Et=Ae(bt?.data,Dt,st),St=!0}if(st.select&&Et!==void 0&&!Pt)if(bt&&Et===yt?.data&&st.select===this.#m)Et=this.#p;else try{this.#m=st.select,Et=st.select(Et),Et=Ae(bt?.data,Et,st),this.#p=Et,this.#s=null}catch(Dt){this.#s=Dt}else if(Et===void 0)this.#s=null;if(this.#s)kt=this.#s,Et=this.#p,Rt=Date.now(),Tt="error",St=!1;let Mt=Ct.fetchStatus==="fetching",It=Tt==="pending",At=Tt==="error",Nt=It&&Mt,Ot=Et!==void 0;return{status:Tt,fetchStatus:Ct.fetchStatus,isPending:It,isSuccess:Tt==="success",isError:At,isInitialLoading:Nt,isLoading:Nt,data:Et,dataUpdatedAt:Ct.dataUpdatedAt,error:kt,errorUpdatedAt:Rt,failureCount:Ct.fetchFailureCount,failureReason:Ct.fetchFailureReason,errorUpdateCount:Ct.errorUpdateCount,isFetched:ot.isFetched(),isFetchedAfterMount:Ct.dataUpdateCount>xt.dataUpdateCount||Ct.errorUpdateCount>xt.errorUpdateCount,isFetching:Mt,isRefetching:Mt&&!It,isLoadingError:At&&!Ot,isPaused:Ct.fetchStatus==="paused",isPlaceholderData:St,isRefetchError:At&&Ot,isStale:CE(ot,st),refetch:this.refetch,isEnabled:T(st.enabled,ot)!==!1}}updateResult(){let ot=this.#n,st=this.createResult(this.#e,this.options);if(this.#o=this.#e.state,this.#i=this.options,this.#o.data!==void 0)this.#d=this.#e;if(we(st,ot))return;this.#n=st;let gt=(()=>{if(!ot)return!0;let{notifyOnChangeProps:bt}=this.options,yt=typeof bt==="function"?bt():bt;if(yt==="all"||!yt&&!this.#f.size)return!0;let vt=new Set(yt??this.#f);if(this.options.throwOnError)vt.add("error");return Object.keys(this.#n).some((xt)=>{let wt=xt;return this.#n[wt]!==ot[wt]&&vt.has(wt)})})();C.batch(()=>{if(gt)this.listeners.forEach((bt)=>{bt(this.#n)});this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}#C(){let ot=this.#t.getQueryCache().build(this.#t,this.options);if(ot===this.#e)return;let st=this.#e;if(this.#e=ot,this.#r=ot.state,this.hasListeners())st?.removeObserver(this),ot.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#v()}};function wY(ot,st){return T(st.enabled,ot)!==!1&&ot.state.data===void 0&&!(ot.state.status==="error"&&T(st.retryOnMount,ot)===!1)}function GN(ot,st){return wY(ot,st)||ot.state.data!==void 0&&wE(ot,st,st.refetchOnMount)}function wE(ot,st,ct){if(T(st.enabled,ot)!==!1&&T(st.staleTime,ot)!=="static"){let gt=typeof ct==="function"?ct(ot):ct;return gt==="always"||gt!==!1&&CE(ot,st)}return!1}function KN(ot,st,ct,gt){return(ot!==st||T(gt.enabled,ot)===!1)&&(!ct.suspense||ot.state.status!=="error")&&CE(ot,ct)}function CE(ot,st){return T(st.enabled,ot)!==!1&&ot.isStaleByTime(T(st.staleTime,ot))}var QN=class extends G{#t;#e=void 0;#r;#n;constructor(ot,st){super();this.#t=ot,this.setOptions(st),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(ot){let st=this.options;if(this.options=this.#t.defaultMutationOptions(ot),!we(this.options,st))this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this});if(st?.mutationKey&&this.options.mutationKey&&J(st.mutationKey)!==J(this.options.mutationKey))this.reset();else if(this.#r?.state.status==="pending")this.#r.setOptions(this.options)}onSubscribe(){if(this.listeners.size===1&&this.#r)this.#r.addObserver(this),this.#o()}onUnsubscribe(){if(!this.hasListeners())this.#r?.removeObserver(this)}onMutationUpdate(ot){this.#o(),this.#i(ot)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#i()}mutate(ot,st){return this.#n=st,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(ot)}#o(){let ot=this.#r?.state??Je();this.#e={...ot,isPending:ot.status==="pending",isSuccess:ot.status==="success",isError:ot.status==="error",isIdle:ot.status==="idle",mutate:this.mutate,reset:this.reset}}#i(ot){C.batch(()=>{if(this.#n&&this.hasListeners()){let st=this.#e.variables,ct=this.#e.context,gt={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(ot?.type==="success"){try{this.#n.onSuccess?.(ot.data,st,ct,gt)}catch(bt){Promise.reject(bt)}try{this.#n.onSettled?.(ot.data,null,st,ct,gt)}catch(bt){Promise.reject(bt)}}else if(ot?.type==="error"){try{this.#n.onError?.(ot.error,st,ct,gt)}catch(bt){Promise.reject(bt)}try{this.#n.onSettled?.(void 0,ot.error,st,ct,gt)}catch(bt){Promise.reject(bt)}}}this.listeners.forEach((st)=>{st(this.#e)})})}};var XN=(ot,st,ct)=>{let gt=ct?.state.error&&typeof ot.throwOnError==="function"?Se(ot.throwOnError,[ct.state.error,ct]):ot.throwOnError;if(ot.suspense||gt){if(!st.isReset())ot.retryOnMount=!1}},YN=(ot)=>{JN.useEffect(()=>{ot.clearReset()},[ot])},ZN=({result:ot,errorResetBoundary:st,throwOnError:ct,query:gt,suspense:bt})=>ot.isError&&!st.isReset()&&!ot.isFetching&&gt&&(bt&&ot.data===void 0||Se(ct,[ot.error,gt]));var eD=(ot)=>{if(ot.suspense){let ct=(bt)=>bt==="static"?bt:Math.max(bt??1000,1000),gt=ot.staleTime;if(ot.staleTime=typeof gt==="function"?(...bt)=>ct(gt(...bt)):ct(gt),typeof ot.gcTime==="number")ot.gcTime=Math.max(ot.gcTime,1000)}},tD=(ot,st)=>ot?.suspense&&st.isPending,nD=(ot,st,ct)=>st.fetchOptimistic(ot).catch(()=>{ct.clearReset()});var Mc=e(t(),1);function rD(ot,st,ct){let gt=jN(),bt=VN(),yt=Kn(ct),vt=yt.defaultQueryOptions(ot),xt=yt.getQueryCache().get(vt.queryHash),wt=ot.subscribed!==!1;vt._optimisticResults=gt?"isRestoring":wt?"optimistic":void 0,eD(vt),XN(vt,bt,xt),YN(bt);let[Ct]=Mc.useState(()=>new st(yt,vt)),St=Ct.getOptimisticResult(vt),Et=!gt&&wt;if(Mc.useSyncExternalStore(Mc.useCallback((kt)=>{let Rt=Et?Ct.subscribe(C.batchCalls(kt)):A;return Ct.updateResult(),Rt},[Ct,Et]),()=>Ct.getCurrentResult(),()=>Ct.getCurrentResult()),Mc.useEffect(()=>{Ct.setOptions(vt)},[vt,Ct]),tD(vt,St))throw nD(vt,Ct,bt);if(ZN({result:St,errorResetBoundary:bt,throwOnError:vt.throwOnError,query:xt,suspense:vt.suspense}))throw St.error;return!vt.notifyOnChangeProps?Ct.trackResult(St):St}function kr(ot,st){return rD(ot,qN,st)}function Vl(ot){return ot}var Gl=e(t(),1);function oD(ot,st){return ot.findAll(st.filters).map((ct)=>st.select?st.select(ct):ct.state)}function SE(ot={},st){let ct=Kn(st).getMutationCache(),gt=Gl.useRef(ot),bt=Gl.useRef(null);if(bt.current===null)bt.current=oD(ct,ot);return Gl.useEffect(()=>{gt.current=ot}),Gl.useSyncExternalStore(Gl.useCallback((yt)=>ct.subscribe(()=>{let vt=Re(bt.current,oD(ct,gt.current));if(bt.current!==vt)bt.current=vt,C.schedule(yt)}),[ct]),()=>bt.current,()=>bt.current)}var Kl=e(t(),1);function zr(ot,st){let ct=Kn(st),[gt]=Kl.useState(()=>new QN(ct,ot));Kl.useEffect(()=>{gt.setOptions(ot)},[gt,ot]);let bt=Kl.useSyncExternalStore(Kl.useCallback((vt)=>gt.subscribe(C.batchCalls(vt)),[gt]),()=>gt.getCurrentResult(),()=>gt.getCurrentResult()),yt=Kl.useCallback((...vt)=>{gt.mutate(vt[0],vt[1]).catch(A)},[gt]);if(bt.error&&Se(gt.options.throwOnError,[bt.error]))throw bt.error;return{...bt,mutate:yt,mutateAsync:bt.mutate}}var gY=e($e(),1);function iD(ot,st){if(ot instanceof RegExp)return{keys:!1,pattern:ot};var ct,gt,bt,yt,vt=[],xt="",wt=ot.split("/");wt[0]||wt.shift();while(bt=wt.shift())if(ct=bt[0],ct==="*")vt.push(ct),xt+=bt[1]==="?"?"(?:/(.*))?":"/(.*)";else if(ct===":"){if(gt=bt.indexOf("?",1),yt=bt.indexOf(".",1),vt.push(bt.substring(1,~gt?gt:~yt?yt:bt.length)),xt+=!!~gt&&!~yt?"(?:/([^/]+?))?":"/([^/]+?)",~yt)xt+=(~gt?"?":"")+"\\"+bt.substring(yt)}else xt+="/"+bt;return{keys:vt,pattern:new RegExp("^"+xt+(st?"(?=$|/)":"/?$"),"i")}}var vp=e(t(),1),$r=e(t(),1);var _y=e(Jd(),1);var DY=vp.useInsertionEffect,_Y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kE=_Y?vp.useLayoutEffect:vp.useEffect,OY=DY||kE,Oy=(ot)=>{let st=vp.useRef([ot,(...ct)=>st[0](...ct)]).current;return OY(()=>{st[0]=ot}),st[1]};var sD=["popstate","pushState","replaceState","hashchange"],Tg=[],aD=()=>Tg.forEach((ot)=>ot()),LY=(ot)=>{if(Tg.push(ot)===1)sD.forEach((st)=>addEventListener(st,aD));return()=>{if(Tg=Tg.filter((st)=>st!==ot),!Tg.length)sD.forEach((st)=>removeEventListener(st,aD))}},pD=(ot,st)=>_y.useSyncExternalStore(LY,ot,st),lD=()=>location.search,Ly=({ssrSearch:ot}={})=>pD(lD,ot!=null?()=>ot:lD),cD=()=>location.pathname,xp=({ssrPath:ot}={})=>pD(cD,ot!=null?()=>ot:cD);var BY=(ot,{replace:st=!1,state:ct=null}={})=>history[st?"replaceState":"pushState"](ct,"",ot),dD=(ot)=>[xp(ot),BY],uD=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[uD]>"u"){for(let ot of["pushState","replaceState"]){let st=history[ot];history[ot]=function(){let ct=st.apply(this,arguments),gt=new Event(ot);return gt.arguments=arguments,dispatchEvent(gt),ct}}Object.defineProperty(window,uD,{value:!0})}var mD=(ot="")=>ot==="/"?"":ot,gD=(ot,st)=>ot[0]==="~"?ot.slice(1):mD(st)+ot,RE=(ot,st)=>(ot=fD(mD(ot)),st=fD(st),!ot||!st.toLowerCase().indexOf(ot.toLowerCase())?st.slice(ot.length)||"/":"~"+st),fD=(ot)=>{try{return ot.includes("%")?decodeURI(ot):ot}catch(st){return ot}};var hD={hook:dD,searchHook:Ly,parser:iD,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:(ot)=>ot,aroundNav:(ot,st,ct)=>ot(st,ct)},bD=$r.createContext(hD),pi=()=>$r.useContext(bD),yD={},vD=$r.createContext(yD),TE=()=>$r.useContext(vD),xD=(ot,st=ot.base)=>RE(st,ot.hook(ot)[0]),PE=(ot)=>{let[st,ct]=ot.hook(ot);return[RE(ot.base,st),Oy((gt,bt)=>ot.aroundNav(ct,gD(gt,ot.base),bt))]},Ai=()=>PE(pi());var wD=(ot,st,ct,gt)=>{let{pattern:bt,keys:yt}=st instanceof RegExp?{pattern:st}:ot(st||"*",gt),vt=bt.exec(ct);if(!vt)return[!1,null];let xt={};for(let wt=1;wt<vt.length;wt++)xt[wt-1]=vt[wt];if(yt)for(let wt=0;wt<yt.length;wt++)xt[yt[wt]]=vt[wt+1];else Object.assign(xt,vt.groups);return gt?[!0,xt,vt[0]]:[!0,xt]};var IE=({children:ot,...st})=>{let ct=pi(),gt=st.hook?hD:ct,bt=gt;if(st.ssrPath){let[wt,Ct=st.ssrSearch??""]=st.ssrPath.split("?");if(wt)st.ssrSearch=Ct,st.ssrPath=wt}st.hrefs=st.hrefs??st.hook?.hrefs,st.searchHook=st.searchHook??st.hook?.searchHook;let yt=$r.useRef(gt),vt=yt.current,xt=vt;for(let wt in gt){let Ct=wt==="base"?gt[wt]+(st[wt]??""):st[wt]??gt[wt];if(Ct!==xt[wt]){if(vt===xt)yt.current=xt={...xt};xt[wt]=Ct}if(Ct!==gt[wt]||Ct!==bt[wt])bt=xt}return $r.createElement(bD.Provider,{value:bt},ot)},FY=({children:ot,component:st},ct)=>{if(st)return $r.createElement(st,{params:ct});return typeof ot==="function"?ot(ct):ot},HY=(ot)=>{let st=$r.useRef(yD),ct=st.current,gt=Object.keys(ot);return st.current=gt.length!==Object.keys(ct).length||gt.some((bt)=>ot[bt]!==ct[bt])?ot:ct};var Xd=({path:ot,nest:st,match:ct,...gt})=>{let bt=pi(),yt=xD(bt),[vt,xt,wt]=ct??wD(bt.parser,ot,yt,st),Ct=HY({...TE(),...xt});if(!vt)return null;let St=FY(gt,Ct);return $r.createElement(vD.Provider,{value:Ct},wt?$r.createElement(IE,{base:wt},St):St)},ql=$r.forwardRef((ot,st)=>{let ct=pi(),[gt,bt]=PE(ct),{to:yt="",href:vt=yt,onClick:xt,asChild:wt,children:Ct,className:St,replace:Et,state:kt,transition:Rt,...Tt}=ot;if(Tt.onClick=Oy((Pt)=>{if(Pt.ctrlKey||Pt.metaKey||Pt.altKey||Pt.shiftKey||Pt.button!==0)return;if(xt?.(Pt),!Pt.defaultPrevented)Pt.preventDefault(),bt(vt,ot)}),Tt.href=ct.hrefs(vt[0]==="~"?vt.slice(1):ct.base+vt,ct),St!==void 0)Tt.className=St?.call?St(gt===vt):St;if(st)Tt.ref=st;return wt&&$r.isValidElement(Ct)?$r.cloneElement(Ct,Tt):$r.createElement("a",Tt,Ct)}),CD=(ot,st=[])=>{if(Array.isArray(ot))for(let ct of ot)CD(ct&&ct.type===$r.Fragment?ct.props.children:ct,st);else st.push(ot);return st},SD=({children:ot,location:st})=>{let ct=pi(),gt=xD(ct);for(let bt of CD(ot)){let yt=0;if($r.isValidElement(bt)&&(yt=wD(ct.parser,bt.props.path,st||gt,bt.props.nest))[0])return $r.cloneElement(bt,{match:yt})}return null},Ac=(ot)=>{let{to:st,href:ct=st}=ot,gt=pi(),[,bt]=PE(gt),yt=Oy(()=>bt(st||ct,ot)),{ssrContext:vt}=gt;if(kE(()=>{yt()},[]),vt)vt.redirectTo=st;return null};var i_=e(t(),1);var ED=e(t(),1);function Nc(ot){ED.useEffect(ot,z)}var By=e(t(),1),ME=By.createContext(void 0);function Dc(){let ot=By.useContext(ME);if(!ot)throw Error(c(73));return ot}var PD=e(t(),1),_E=e(Jd(),1);var _c=e(t()),zY=Jd();function $Y(ot,st){return ot===st&&(ot!==0||1/ot===1/st)||ot!==ot&&st!==st}var WY=typeof Object.is==="function"?Object.is:$Y,UY=zY.useSyncExternalStore,jY=_c.useRef,VY=_c.useEffect,GY=_c.useMemo,KY=_c.useDebugValue;var AE=function(ot,st,ct,gt,bt){var yt=jY(null);if(yt.current===null){var vt={hasValue:!1,value:null};yt.current=vt}else vt=yt.current;yt=GY(function(){function wt(Rt){if(!Ct){if(Ct=!0,St=Rt,Rt=gt(Rt),bt!==void 0&&vt.hasValue){var Tt=vt.value;if(bt(Tt,Rt))return Et=Tt}return Et=Rt}if(Tt=Et,WY(St,Rt))return Tt;var Pt=gt(Rt);if(bt!==void 0&&bt(Tt,Pt))return St=Rt,Tt;return St=Rt,Et=Pt}var Ct=!1,St,Et,kt=ct===void 0?null:ct;return[function(){return wt(st())},kt===null?void 0:function(){return wt(kt())}]},[st,ct,gt,bt]);var xt=UY(ot,yt[0],yt[1]);return VY(function(){vt.hasValue=!0,vt.value=xt},[xt]),KY(xt),xt};var kD=e(t(),1);var NE=[],DE=void 0;function RD(){return DE}function TD(ot){NE.push(ot)}function va(ot){let st=(ct,gt)=>{let bt=I(qY).current,yt;try{DE=bt;for(let vt of NE)vt.before(bt);yt=ot(ct,gt);for(let vt of NE)vt.after(bt);bt.didInitialize=!0}finally{DE=void 0}return yt};return st.displayName=ot.displayName||ot.name,st}function ja(ot){return kD.forwardRef(va(ot))}function qY(){return{didInitialize:!1}}var QY=Te(19),JY=QY?YY:ZY;function Fy(ot,st,ct,gt,bt){return JY(ot,st,ct,gt,bt)}function XY(ot,st,ct,gt,bt){let yt=PD.useCallback(()=>st(ot.getSnapshot(),ct,gt,bt),[ot,st,ct,gt,bt]);return _E.useSyncExternalStore(ot.subscribe,yt,yt)}TD({before(ot){if(ot.syncIndex=0,!ot.didInitialize)ot.syncTick=1,ot.syncHooks=[],ot.didChangeStore=!0,ot.getSnapshot=()=>{let st=!1;for(let ct=0;ct<ot.syncHooks.length;ct+=1){let gt=ot.syncHooks[ct],bt=gt.selector(gt.store.state,gt.a1,gt.a2,gt.a3);if(!Object.is(gt.value,bt))st=!0,gt.value=bt}if(st)ot.syncTick+=1;return ot.syncTick}},after(ot){if(ot.syncHooks.length>0){if(ot.didChangeStore)ot.didChangeStore=!1,ot.subscribe=(st)=>{let ct=new Set;for(let bt of ot.syncHooks)ct.add(bt.store);let gt=[];for(let bt of ct)gt.push(bt.subscribe(st));return()=>{for(let bt of gt)bt()}};_E.useSyncExternalStore(ot.subscribe,ot.getSnapshot,ot.getSnapshot)}}});function YY(ot,st,ct,gt,bt){let yt=RD();if(!yt)return XY(ot,st,ct,gt,bt);let vt=yt.syncIndex;yt.syncIndex+=1;let xt;if(!yt.didInitialize)xt={store:ot,selector:st,a1:ct,a2:gt,a3:bt,value:st(ot.getSnapshot(),ct,gt,bt)},yt.syncHooks.push(xt);else if(xt=yt.syncHooks[vt],xt.store!==ot||xt.selector!==st||!Object.is(xt.a1,ct)||!Object.is(xt.a2,gt)||!Object.is(xt.a3,bt)){if(xt.store!==ot)yt.didChangeStore=!0;xt.store=ot,xt.selector=st,xt.a1=ct,xt.a2=gt,xt.a3=bt,xt.value=st(ot.getSnapshot(),ct,gt,bt)}return xt.value}function ZY(ot,st,ct,gt,bt){return AE(ot.subscribe,ot.getSnapshot,ot.getSnapshot,(yt)=>st(yt,ct,gt,bt))}class OE{static create(ot){return new this(ot)}constructor(ot){this.state=ot,this.listeners=new Set,this.updateTick=0}subscribe=(ot)=>(this.listeners.add(ot),()=>{this.listeners.delete(ot)});getSnapshot=()=>this.state;setState(ot){if(this.state===ot)return;this.state=ot,this.updateTick+=1;let st=this.updateTick;for(let ct of this.listeners){if(st!==this.updateTick)return;ct(ot)}}update(ot){for(let st in ot)if(!Object.is(this.state[st],ot[st])){this.setState({...this.state,...ot});return}}set(ot,st){if(!Object.is(this.state[ot],st))this.setState({...this.state,[ot]:st})}notifyAll(){let ot={...this.state};this.setState(ot)}use(ot,st,ct,gt){return Fy(this,ot,st,ct,gt)}}var wp=e(t(),1);class Gi extends OE{constructor(ot,st={},ct){super(ot);this.context=st,this.selectors=ct}useSyncedValue(ot,st){wp.useDebugValue(ot);let ct=this;i(()=>{if(ct.state[ot]!==st)ct.set(ot,st)},[ct,ot,st])}useSyncedValueWithCleanup(ot,st){let ct=this;i(()=>{if(ct.state[ot]!==st)ct.set(ot,st);return()=>{ct.set(ot,void 0)}},[ct,ot,st])}useSyncedValues(ot){let st=this,ct=Object.values(ot);i(()=>{st.update(ot)},[st,...ct])}useControlledProp(ot,st){wp.useDebugValue(ot);let ct=this,gt=st!==void 0;i(()=>{if(gt&&!Object.is(ct.state[ot],st))ct.setState({...ct.state,[ot]:st})},[ct,ot,st,gt])}select(ot,st,ct,gt){let bt=this.selectors[ot];return bt(this.state,st,ct,gt)}useState(ot,st,ct,gt){return wp.useDebugValue(ot),Fy(this,this.selectors[ot],st,ct,gt)}useContextCallback(ot,st){wp.useDebugValue(ot);let ct=s(st??w);this.context[ot]=ct}useStateSetter(ot){let st=wp.useRef(void 0);if(st.current===void 0)st.current=(ct)=>{this.set(ot,ct)};return st.current}observe(ot,st){let ct;if(typeof ot==="function")ct=ot;else ct=this.selectors[ot];let gt=ct(this.state);return st(gt,gt,this),this.subscribe((bt)=>{let yt=ct(bt);if(!Object.is(gt,yt)){let vt=gt;gt=yt,st(yt,vt,this)}})}}function di(...ot){return()=>{for(let st=0;st<ot.length;st+=1){let ct=ot[st];if(ct)ct()}}}function Xn(ot,st,ct,gt){return ot.addEventListener(st,ct,gt),()=>{ot.removeEventListener(st,ct,gt)}}var Hy=null,DRe=globalThis.requestAnimationFrame;class ID{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=(ot)=>{this.isScheduled=!1;let st=this.callbacks,ct=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,ct>0)for(let gt=0;gt<st.length;gt+=1)st[gt]?.(ot)};request(ot){let st=this.nextId;this.nextId+=1,this.callbacks.push(ot),this.callbacksCount+=1;let ct=!1;if(!this.isScheduled||ct)requestAnimationFrame(this.tick),this.isScheduled=!0;return st}cancel(ot){let st=ot-this.startId;if(st<0||st>=this.callbacks.length)return;if(this.callbacks[st]===null)return;this.callbacks[st]=null,this.callbacksCount-=1}}var zy=new ID;class xi{static create(){return new xi}static request(ot){return zy.request(ot)}static cancel(ot){return zy.cancel(ot)}currentId=Hy;request(ot){this.cancel(),this.currentId=zy.request(()=>{this.currentId=Hy,ot()})}cancel=()=>{if(this.currentId!==Hy)zy.cancel(this.currentId),this.currentId=Hy};disposeEffect=()=>this.cancel}function xa(){let ot=I(xi.create).current;return Nc(ot.disposeEffect),ot}var Pg=0;class Ho{static create(){return new Ho}currentId=Pg;start(ot,st){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Pg,st()},ot)}isStarted(){return this.currentId!==Pg}clear=()=>{if(this.currentId!==Pg)clearTimeout(this.currentId),this.currentId=Pg};disposeEffect=()=>this.clear}function Xr(){let ot=I(Ho.create).current;return Nc(ot.disposeEffect),ot}var MD=0;function $y(ot){return MD+=1,`${ot}-${Math.random().toString(36).slice(2,6)}-${MD}`}function Wy(ot,st){if(typeof ot==="string")return{description:ot};if(typeof ot==="function"){let ct=ot(st);return typeof ct==="string"?{description:ct}:ct}return ot}function eZ(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:tZ,platform:nZ,maxTouchPoints:AD}=eZ(),Cp=tZ.toLowerCase(),Sp=nZ.toLowerCase();var LE=/^i(os$|p)/.test(Sp)||Sp==="macintel"&&AD>1,ND="android",DD=Sp===ND||Cp.includes(ND),_D=!LE&&Sp.startsWith("mac"),rZ=Sp.startsWith("win"),oZ=!DD&&/^(linux|chrome os)/.test(Sp),BE=_D||LE;var FE=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),iZ=!FE&&Cp.includes("firefox"),sZ=!FE&&Cp.includes("chrom");var aZ=BE;var lZ=/jsdom|happydom/.test(Cp);function Kr(ot){let st=ot.activeElement;while(st?.shadowRoot?.activeElement!=null)st=st.shadowRoot.activeElement;return st}function On(ot,st){if(!ot||!st)return!1;let ct=st.getRootNode?.();if(ot.contains(st))return!0;if(ct&&te(ct)){let gt=st;while(gt){if(ot===gt)return!0;gt=gt.parentNode||gt.host}}return!1}function xr(ot){if("composedPath"in ot)return ot.composedPath()[0]??ot.target;return ot.target}var Mg="data-base-ui-focusable";var zE="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ag="ArrowLeft",Ng="ArrowRight",$E="ArrowUp",Uy="ArrowDown";var Jl="data-starting-style",Ep="data-ending-style";var cZ={[Jl]:""},uZ={[Ep]:""},fi={transitionStatus(ot){if(ot==="starting")return cZ;if(ot==="ending")return uZ;return null}};var WE="data-open",UE="data-closed",pZ=Jl,dZ=Ep,OD="data-anchor-hidden";var jy="data-popup-open",BD="data-pressed";var fZ={[jy]:""},mZ={[jy]:"",[BD]:""},gZ={[WE]:""},hZ={[UE]:""},bZ={[OD]:""},Lc={open(ot){if(ot)return fZ;return null}},Dg={open(ot){if(ot)return mZ;return null}},_g={open(ot){if(ot)return gZ;return hZ},anchorHidden(ot){if(ot)return bZ;return null}},Va={..._g,...fi};var eTe=jy,Og="data-trigger-disabled";function Bc(ot,st){if(!f(ot))return!1;let ct=ot;if(st.hasElement(ct))return!ct.hasAttribute(Og);for(let[,gt]of st.entries())if(On(gt,ct))return!gt.hasAttribute(Og);return!1}function Vy(ot,st){if(st==null)return!1;if("composedPath"in ot)return ot.composedPath().includes(st);let ct=ot;return ct.target!=null&&st.contains(ct.target)}function zD(ot){return ot.matches("html,body")}function kp(ot){return y(ot)&&ot.matches(zE)}function jE(ot){return ot?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${zE}`)!=null}function Lg(ot){if(!ot)return!1;return ot.getAttribute("role")==="combobox"&&kp(ot)}function Ga(ot){if(!ot||Ig.jsdom)return!0;try{return ot.matches(":focus-visible")}catch(st){return!0}}function Bg(ot){if(!ot)return null;return ot.hasAttribute(Mg)?ot:ot.querySelector(`[${Mg}]`)||ot}function Ks(ot,st,ct=!0){return ot.filter((bt)=>bt.parentId===st).flatMap((bt)=>[...!ct||bt.context?.open?[bt]:[],...Ks(ot,bt.id,ct)])}function VE(ot,st){let ct=[],gt=ot.find((bt)=>bt.id===st)?.parentId;while(gt){let bt=ot.find((yt)=>yt.id===gt);if(gt=bt?.parentId,bt)ct=ct.concat(bt)}return ct}function ss(ot){ot.preventDefault(),ot.stopPropagation()}function $D(ot){return"nativeEvent"in ot}function Zd(ot){if(ot.pointerType===""&&ot.isTrusted)return!0;if(Ql.android&&ot.pointerType)return ot.type==="click"&&ot.buttons===1;return ot.detail===0&&!ot.pointerType}function ef(ot){if(Ig.jsdom)return!1;return!Ql.android&&ot.width===0&&ot.height===0||Ql.android&&ot.width===1&&ot.height===1&&ot.pressure===0&&ot.detail===0&&ot.pointerType==="mouse"||ot.width<1&&ot.height<1&&ot.pressure===0&&ot.detail===0&&ot.pointerType==="touch"}function Rs(ot,st){let ct=["mouse","pen"];if(!st)ct.push("",void 0);return ct.includes(ot)}function WD(ot){let st=ot.type;return st==="click"||st==="mousedown"||st==="keydown"||st==="keyup"}var{min:Fc,max:wa,round:Hg,floor:zg}=Math,Ka=(ot)=>({x:ot,y:ot}),yZ={left:"right",right:"left",bottom:"top",top:"bottom"};function Ky(ot,st,ct){return wa(ot,Fc(st,ct))}function qa(ot,st){return typeof ot==="function"?ot(st):ot}function as(ot){return ot.split("-")[0]}function qs(ot){return ot.split("-")[1]}function qy(ot){return ot==="x"?"y":"x"}function $g(ot){return ot==="y"?"height":"width"}function ls(ot){let st=ot[0];return st==="t"||st==="b"?"y":"x"}function Wg(ot){return qy(ls(ot))}function VD(ot,st,ct){if(ct===void 0)ct=!1;let gt=qs(ot),bt=Wg(ot),yt=$g(bt),vt=bt==="x"?gt===(ct?"end":"start")?"right":"left":gt==="start"?"bottom":"top";if(st.reference[yt]>st.floating[yt])vt=Fg(vt);return[vt,Fg(vt)]}function GD(ot){let st=Fg(ot);return[Gy(ot),st,Gy(st)]}function Gy(ot){return ot.includes("start")?ot.replace("start","end"):ot.replace("end","start")}var UD=["left","right"],jD=["right","left"],vZ=["top","bottom"],xZ=["bottom","top"];function wZ(ot,st,ct){switch(ot){case"top":case"bottom":if(ct)return st?jD:UD;return st?UD:jD;case"left":case"right":return st?vZ:xZ;default:return[]}}function KD(ot,st,ct,gt){let bt=qs(ot),yt=wZ(as(ot),ct==="start",gt);if(bt){if(yt=yt.map((vt)=>vt+"-"+bt),st)yt=yt.concat(yt.map(Gy))}return yt}function Fg(ot){let st=as(ot);return yZ[st]+ot.slice(st.length)}function CZ(ot){var st,ct,gt,bt;return{top:(st=ot.top)!=null?st:0,right:(ct=ot.right)!=null?ct:0,bottom:(gt=ot.bottom)!=null?gt:0,left:(bt=ot.left)!=null?bt:0}}function Qy(ot){return typeof ot!=="number"?CZ(ot):{top:ot,right:ot,bottom:ot,left:ot}}function Rp(ot){let{x:st,y:ct,width:gt,height:bt}=ot;return{width:gt,height:bt,top:ct,left:st,right:st+gt,bottom:ct+bt,x:st,y:ct}}function Hc(ot,st){return st<0||st>=ot.length}function Tp(ot,st){return Qs(ot.current,{disabledIndices:st})}function tf(ot,st){return Qs(ot.current,{decrement:!0,startingIndex:ot.current.length,disabledIndices:st})}function Qs(ot,{startingIndex:st=-1,decrement:ct=!1,disabledIndices:gt,amount:bt=1}={}){let yt=st;do yt+=ct?-bt:bt;while(yt>=0&&yt<=ot.length-1&&Xl(ot,yt,gt));return yt}function Xl(ot,st,ct){if(typeof ct==="function"?ct(st):ct?.includes(st)??!1)return!0;let bt=ot[st];if(!bt)return!1;if(!Pp(bt))return!0;if(bt.matches(":disabled"))return!0;return!ct&&(bt.hasAttribute("disabled")||bt.getAttribute("aria-disabled")==="true")}function SZ(ot){return ot.visibility==="hidden"||ot.visibility==="collapse"}function Pp(ot,st=ot?F(ot):null){if(!ot||!ot.isConnected||!st||SZ(st))return!1;if(typeof ot.checkVisibility==="function")return ot.checkVisibility();return st.display!=="none"&&st.display!=="contents"}var EZ='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function kZ(ot){let st=ot.assignedSlot;if(st)return st;if(ot.parentElement)return ot.parentElement;let ct=ot.getRootNode();return te(ct)?ct.host:null}function KE(ot){for(let st of Array.from(ot.children))if(D(st)==="summary")return st;return null}function RZ(ot,st){let ct=KE(st);return!!ct&&(ot===ct||On(ct,ot))}function qD(ot){let st=ot?D(ot):"";return ot!=null&&ot.matches(EZ)&&(st!=="summary"||ot.parentElement!=null&&D(ot.parentElement)==="details"&&KE(ot.parentElement)===ot)&&(st!=="details"||KE(ot)==null)&&(st!=="input"||ot.type!=="hidden")}function QD(ot){if(!qD(ot)||!ot.isConnected||ot.matches(":disabled"))return!1;for(let st=ot;st;st=kZ(st)){let ct=st!==ot,gt=D(st)==="slot";if(st.hasAttribute("inert"))return!1;if(ct&&D(st)==="details"&&!st.open&&!RZ(ot,st)||st.hasAttribute("hidden")||!gt&&!TZ(st,ct))return!1}return!0}function TZ(ot,st){let ct=F(ot);if(!st)return Pp(ot,ct);return ct.display!=="none"}function JD(ot){let st=ot.tabIndex;if(st<0){let ct=D(ot);if(ct==="details"||ct==="audio"||ct==="video"||y(ot)&&ot.isContentEditable)return 0}return st}function GE(ot){if(D(ot)!=="input")return null;let st=ot;return st.type==="radio"&&st.name!==""?st:null}function PZ(ot,st){let ct=GE(ot);if(!ct)return!0;let gt=st.find((bt)=>{let yt=GE(bt);return yt?.name===ct.name&&yt.form===ct.form&&yt.checked});if(gt)return gt===ct;return st.find((bt)=>{let yt=GE(bt);return yt?.name===ct.name&&yt.form===ct.form})===ct}function XD(ot){if(y(ot)&&D(ot)==="slot"){let st=ot.assignedElements({flatten:!0});if(st.length>0)return st}if(y(ot)&&ot.shadowRoot)return Array.from(ot.shadowRoot.children);return Array.from(ot.children)}function YD(ot,st){XD(ot).forEach((ct)=>{if(qD(ct))st.push(ct);YD(ct,st)})}function ZD(ot,st,ct){XD(ot).forEach((gt)=>{if(y(gt)&&gt.matches(st))ct.push(gt);ZD(gt,st,ct)})}function Jy(ot){return QD(ot)&&JD(ot)>=0}function qE(ot){let st=[];return YD(ot,st),st.filter(QD)}function nf(ot){let st=qE(ot);return st.filter((ct)=>JD(ct)>=0&&PZ(ct,st))}function e_(ot,st){let ct=nf(ot),gt=ct.length;if(gt===0)return;let bt=Kr(d(ot)),yt=ct.indexOf(bt),vt=yt===-1?st===1?0:gt-1:yt+st;return ct[vt]}function rf(ot){return e_(d(ot).body,1)||ot}function Xy(ot){return e_(d(ot).body,-1)||ot}function t_(ot,st){if(!ot)return null;let ct=nf(d(ot).body),gt=ct.length;if(gt===0)return null;let bt=ct.indexOf(ot);if(bt===-1)return null;let yt=(bt+st+gt)%gt;return ct[yt]}function n_(ot){return t_(ot,1)}function r_(ot){return t_(ot,-1)}function Yl(ot,st){let ct=st||ot.currentTarget,gt=ot.relatedTarget;return!gt||!On(ct,gt)}function o_(ot){nf(ot).forEach((ct)=>{ct.dataset.tabindex=ct.getAttribute("tabindex")||"",ct.setAttribute("tabindex","-1")})}function QE(ot){let st=[];ZD(ot,"[data-tabindex]",st),st.forEach((ct)=>{let gt=ct.dataset.tabindex;if(delete ct.dataset.tabindex,gt)ct.setAttribute("tabindex",gt);else ct.removeAttribute("tabindex")})}function JE(ot){let st=new Map,ct=0,gt=0;return ot.forEach((bt,yt)=>{let vt=bt.transitionStatus==="ending";if(st.set(bt.id,{value:bt,domIndex:yt,visibleIndex:vt?-1:ct,offsetY:gt}),gt+=bt.height||0,!vt)ct+=1}),st}function XE(ot,st){let ct=0;return ot.map((gt)=>{if(gt.transitionStatus==="ending")return gt;let bt=ct>=st;return ct+=1,gt.limited===bt?gt:{...gt,limited:bt}})}var Ca={toasts:(ot)=>ot.toasts,isEmpty:(ot)=>ot.toasts.length===0,toast:(ot,st)=>ot.toastMetadata.get(st)?.value,toastIndex:(ot,st)=>ot.toastMetadata.get(st)?.domIndex??-1,toastOffsetY:(ot,st)=>ot.toastMetadata.get(st)?.offsetY??0,toastVisibleIndex:(ot,st)=>ot.toastMetadata.get(st)?.visibleIndex??-1,focused:(ot)=>ot.focused,expanded:(ot)=>ot.hovering||ot.focused,expandedOrOutOfFocus:(ot)=>ot.hovering||ot.focused||!ot.isWindowFocused,prevFocusElement:(ot)=>ot.prevFocusElement};class YE extends Gi{timers=new Map;areTimersPaused=!1;constructor(ot){super({...ot,toastMetadata:JE(ot.toasts)},{},Ca)}setViewport=(ot)=>{this.set("viewport",ot)};syncProviderProps(ot,st){let ct=this.state.limit!==st;if(this.state.timeout===ot&&!ct)return;let gt={timeout:ot,limit:st};if(ct){let bt=XE(this.state.toasts,st);gt.toasts=bt,gt.toastMetadata=JE(bt)}this.update(gt)}disposeEffect=()=>()=>{this.timers.forEach((ot)=>{ot.timeout?.clear()}),this.timers.clear()};removeToast(ot,st=!1){let ct=Ca.toastIndex(this.state,ot);if(ct===-1)return;let gt=this.state.toasts[ct];if(!st)gt?.onRemove?.();let bt=[...this.state.toasts];bt.splice(ct,1),this.setToasts(bt)}addToast=(ot)=>{let{timeout:st,limit:ct}=this.state,gt=ot.id||$y("toast");if(ot.id){let xt=Ca.toast(this.state,ot.id);if(xt)if(xt.transitionStatus==="ending")this.removeToast(ot.id,!0);else{let{id:wt,transitionStatus:Ct,...St}=ot;return this.updateToastInternal(ot.id,St,!0,!0),ot.id}}let bt={...ot,id:gt,updateKey:0,transitionStatus:"starting"},yt=[bt,...this.state.toasts];this.setToasts(XE(yt,ct));let vt=bt.timeout??st;if(bt.type!=="loading"&&vt>0)this.scheduleTimer(gt,vt,()=>this.closeToast(gt));if(Ca.expandedOrOutOfFocus(this.state))this.pauseTimers();return gt};updateToast=(ot,st)=>{let ct=Ca.toast(this.state,ot);if(!ct||ct.transitionStatus==="ending")return;this.updateToastInternal(ot,typeof st==="function"?st(ct):st,!1,!0)};updateToastInternal=(ot,st,ct=!1,gt=!1)=>{let{timeout:bt,toasts:yt}=this.state,vt=Ca.toast(this.state,ot);if(!vt)return;if(vt.transitionStatus==="ending")return;let xt={...vt,...st,...gt&&{updateKey:vt.updateKey+1}};this.setToasts(yt.map((Pt)=>Pt.id===ot?xt:Pt));let wt=xt.timeout??bt,Ct=vt.timeout??bt,St=Object.hasOwn(st,"timeout"),Et=xt.transitionStatus!=="ending"&&xt.type!=="loading"&&wt>0,kt=this.timers.has(ot),Rt=Ct!==wt,Tt=vt.type==="loading";if(!Et&&kt){this.clearTimer(ot);return}if(Et&&(!kt||Rt||St||Tt||ct)){if(this.clearTimer(ot),this.scheduleTimer(ot,wt,()=>this.closeToast(ot)),Ca.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=(ot)=>{let st=ot===void 0,{limit:ct,toasts:gt}=this.state,bt;if(st)bt=gt,this.clearTimers();else{let xt=Ca.toast(this.state,ot);if(!xt)return;bt=[xt],this.clearTimer(ot)}let yt=gt.map((xt)=>st||xt.id===ot?{...xt,transitionStatus:"ending",height:0}:xt),vt=XE(yt,ct);this.setToasts(vt,!vt.some((xt)=>xt.transitionStatus!=="ending")),bt.forEach((xt)=>{if(xt.transitionStatus!=="ending")xt.onClose?.()}),this.handleFocusManagement(ot)};promiseToast=(ot,st)=>{let ct=Wy(st.loading),gt=this.addToast({...ct,type:"loading"}),bt=ot.then((yt)=>{let vt=Wy(st.success,yt);return this.updateToast(gt,{...vt,type:"success",timeout:vt.timeout}),yt}).catch((yt)=>{let vt=Wy(st.error,yt);return this.updateToast(gt,{...vt,type:"error",timeout:vt.timeout}),Promise.reject(yt)});if({}.hasOwnProperty.call(st,"setPromise"))st.setPromise(bt);return bt};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach((ot)=>{if(ot.timeout)ot.timeout.clear(),ot.remaining=Math.max(ot.remaining-(Date.now()-ot.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach((ot,st)=>{ot.remaining=ot.remaining>0?ot.remaining:ot.delay,ot.timeout??=Ho.create(),ot.timeout.start(ot.remaining,()=>{this.handleTimerFired(st),ot.callback()}),ot.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=(ot)=>{if(ot.pointerType!=="touch")return;let st=xr(ot);if(On(this.state.viewport,st))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer(ot,st,ct){let gt=Date.now(),yt=!Ca.expandedOrOutOfFocus(this.state)?Ho.create():void 0;yt?.start(st,()=>{this.handleTimerFired(ot),ct()}),this.timers.set(ot,{timeout:yt,start:gt,delay:st,remaining:st,callback:ct})}clearTimers(){this.timers.forEach((ot)=>{ot.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(ot){this.timers.get(ot)?.timeout?.clear(),this.timers.delete(ot),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(ot){this.timers.delete(ot),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts(ot,st=ot.length===0){let ct={toasts:ot,toastMetadata:JE(ot)};if(st)ct.hovering=!1,ct.focused=!1;this.update(ct)}handleFocusManagement(ot){let st=Kr(d(this.state.viewport));if(!this.state.viewport||!On(this.state.viewport,st)||!Ga(st))return;if(ot===void 0){this.restoreFocusToPrevElement();return}let ct=Ca.toasts(this.state),gt=Ca.toastIndex(this.state,ot),bt=(vt,xt)=>{for(let wt=vt;wt>=0&&wt<ct.length;wt+=xt)if(ct[wt].transitionStatus!=="ending")return ct[wt];return null},yt=bt(gt+1,1)??bt(gt-1,-1);if(yt)yt.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var Yy=e(r(),1),s_=function(st){let{children:ct,timeout:gt=5000,limit:bt=3,toastManager:yt}=st,vt=I(()=>new YE({timeout:gt,limit:bt,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Nc(vt.disposeEffect),i_.useEffect(function(){if(!yt)return;return yt[" subscribe"](({action:Ct,options:St})=>{let Et=St.id;if(Ct==="promise"&&St.promise)vt.promiseToast(St.promise,St);else if(Ct==="update"&&Et)vt.updateToast(Et,St.updates);else if(Ct==="close")vt.closeToast(Et);else vt.addToast(St)})},[vt,yt]),Yy.jsxs(ME.Provider,{value:vt,children:[Yy.jsx(IZ,{store:vt,timeout:gt,limit:bt}),ct]})};function IZ(ot){let{store:st,timeout:ct,limit:gt}=ot;return i(()=>{st.syncProviderProps(ct,gt)},[st,ct,gt]),null}var Js=e(t(),1);var a_={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Sa={...a_,position:"fixed",top:0,left:0},Zy={...a_,position:"absolute"};var e0=e(t(),1);var l_=e(r(),1),cs=e0.forwardRef(function(st,ct){let[gt,bt]=e0.useState();return i(()=>{if(HE.voiceOver&&Oc.webkit)bt("button")},[]),l_.jsx("span",{...st,ref:ct,style:Sa,"aria-hidden":gt?void 0:!0,...{tabIndex:0,role:gt},"data-base-ui-focus-guard":""})});var c_="--toast-frontmost-height";var Zl=e(r(),1),u_=Js.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,children:vt,...xt}=st,wt=Dc(),Ct=Xr(),St=Js.useRef(!1),Et=Js.useRef(!1),kt=Js.useRef(!1),Rt=wt.useState("isEmpty"),Tt=wt.useState("toasts"),Pt=wt.useState("focused"),Mt=wt.useState("expanded"),It=wt.useState("prevFocusElement"),At=Tt[0]?.height,Nt=Tt.some((Xt)=>Xt.transitionStatus==="ending"),Ot=Tt.filter((Xt)=>Xt.priority==="high");Js.useEffect(()=>{let Xt=wt.state.viewport;if(!Xt||Rt)return;let zt=m(Xt),tn=d(Xt);function rn(ln){if(ln.key==="F6"&&xr(ln)!==Xt)ln.preventDefault(),wt.set("prevFocusElement",Kr(tn)),Xt?.focus({preventScroll:!0}),wt.pauseTimers(),wt.set("focused",!0)}function Kt(ln){if(xr(ln)!==zt)return;wt.set("isWindowFocused",!1),wt.pauseTimers()}function an(ln){if(ln.relatedTarget)return;let Zt=xr(ln),on=Kr(d(Xt));if(Zt===zt||!On(Xt,Zt)||!Ga(on))wt.resumeTimers();Ct.start(0,()=>wt.set("isWindowFocused",!0))}return di(Xn(zt,"keydown",rn),Xn(zt,"blur",Kt,!0),Xn(zt,"focus",an,!0),Xn(tn,"pointerdown",wt.handleDocumentPointerDown,!0))},[wt,Ct,Rt]);function Dt(Xt){St.current=!0;let zt=Xt.relatedTarget===wt.state.viewport?Tt.find((tn)=>tn.transitionStatus!=="ending"&&!tn.limited):void 0;if(zt)zt.ref?.current?.focus();else wt.restoreFocusToPrevElement()}function _t(Xt){if(Xt.key==="Tab"&&Xt.shiftKey&&xr(Xt.nativeEvent)===wt.state.viewport)Xt.preventDefault(),wt.restoreFocusToPrevElement()}function $t(){if(wt.state.toasts.some((zt)=>zt.transitionStatus==="ending")||kt.current||!Et.current)return;if(wt.state.isWindowFocused)wt.resumeTimers();wt.set("hovering",!1),Et.current=!1}Js.useEffect($t,[Nt,wt]);function Ft(){wt.pauseTimers(),wt.set("hovering",!0),Et.current=!1}function Bt(){if(wt.state.isWindowFocused)wt.resumeTimers()}function Lt(){Et.current=!0,$t()}function Vt(Xt){if(Xt.pointerType==="touch")kt.current=!0}function Wt(Xt){if(Xt.pointerType!=="touch")return;kt.current=!1,$t()}function Ut(){if(St.current){St.current=!1;return}if(Pt)return;if(Ga(Kr(d(wt.state.viewport))))wt.set("focused",!0),wt.pauseTimers()}function Ht(Xt){if(!Pt||On(wt.state.viewport,Xt.relatedTarget))return;wt.set("focused",!1),Bt()}let Gt={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:Ft,onMouseMove:Ft,onMouseLeave:Lt,onFocus:Ut,onBlur:Ht,onKeyDown:_t,onClick:Ut,onPointerDown:Vt,onPointerUp:Wt,onPointerCancel:Wt,style:{[c_]:At?`${At}px`:void 0}},jt={expanded:Mt},qt=!Rt&&It&&Zl.jsx(cs,{onFocus:Dt}),Qt=l("div",st,{ref:[ct,wt.setViewport],state:jt,props:[Gt,xt,{children:Zl.jsxs(Js.Fragment,{children:[qt,vt,qt]})}]});return Zl.jsxs(Js.Fragment,{children:[qt,Qt,!Pt&&Ot.length>0&&Zl.jsx("div",{style:Sa,children:Ot.map((Xt)=>Zl.jsxs("div",{role:"alert","aria-atomic":!0,children:[Zl.jsx("div",{children:Xt.title}),Zl.jsx("div",{children:Xt.description})]},Xt.id))})]})});var co=e(t(),1),T_=e(_(),1);function Qa(ot){if(Te(19))return ot;return ot?"true":void 0}var t0=e(t(),1),ZE=t0.createContext(void 0);function zc(){let ot=t0.useContext(ZE);if(!ot)throw Error(c(66));return ot}var p_=e(t(),1);var ek=e(_(),1);function Ea(ot){if(ot==null)return ot;return"current"in ot?ot.current:ot}var n0=null;function AZ(ot){if(!n0){let st=[];n0=st,queueMicrotask(()=>{n0=null,ek.flushSync(()=>{for(let ct of st)ct()})})}n0.push(ot)}function Ja(ot,st=!1,ct=!1){let gt=xa();return s((bt,yt=null)=>{gt.cancel();let vt=Ea(ot);if(vt==null)return;let xt=vt,wt=()=>{if(!ct){ek.flushSync(bt);return}AZ(()=>{if(!yt?.aborted)bt()})};if(typeof xt.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){bt();return}function Ct(){Promise.all(xt.getAnimations().map((St)=>St.finished)).then(()=>{if(!yt?.aborted)wt()},()=>{if(yt?.aborted)return;if(xt.getAnimations().some((Et)=>Et.pending||Et.playState!=="finished")){Ct();return}wt()})}if(st){let St=Jl;if(!xt.hasAttribute(St)){gt.request(Ct);return}let Et=new MutationObserver(()=>{if(!xt.hasAttribute(St))Et.disconnect(),Ct()});Et.observe(xt,{attributes:!0,attributeFilter:[St]}),yt?.addEventListener("abort",()=>Et.disconnect(),{once:!0});return}gt.request(Ct)})}function Ro(ot){let{enabled:st=!0,open:ct,ref:gt,batch:bt=!1,onComplete:yt}=ot,vt=s(yt),xt=Ja(gt,ct,bt);p_.useEffect(()=>{if(!st)return;let wt=new AbortController;return xt(vt,wt.signal),()=>{wt.abort()}},[st,ct,vt,xt])}var d_=500,r0=500,f_={style:{transition:"none"}},of="data-base-ui-click-trigger";var m_="[data-base-ui-swipe-ignore]",g_="[data-swipe-ignore]",h_={fallbackAxisSide:"none"},$c={fallbackAxisSide:"end"},b_={clipPath:"inset(50%)",position:"fixed",top:0,left:0};var o0=e(t(),1);function mi(ot,st=Number.MIN_SAFE_INTEGER,ct=Number.MAX_SAFE_INTEGER){return Math.max(st,Math.min(ot,ct))}function y_(ot,st){let ct=(st??m(ot).getComputedStyle(ot)).transform,gt=0,bt=0,yt=1;if(ct&&ct!=="none"){let vt=ct.match(/matrix(?:3d)?\(([^)]+)\)/);if(vt){let xt=vt[1].split(", ").map(parseFloat);if(xt.length===6)gt=xt[4],bt=xt[5],yt=Math.sqrt(xt[0]*xt[0]+xt[1]*xt[1]);else if(xt.length===16)gt=xt[12],bt=xt[13],yt=xt[0]}}return{x:gt,y:bt,scale:yt}}function i0(ot,st,ct){switch(ot){case"up":return-ct;case"down":return ct;case"left":return-st;case"right":return st;default:return 0}}var v_="--toast-index",x_="--toast-offset-y",w_="--toast-height",C_="--toast-swipe-movement-x",S_="--toast-swipe-movement-y";var E_="data-swipe-direction",fPe=Jl,mPe=Ep;var P_=e(r(),1),_Z={...fi,swipeDirection(ot){return ot?{[E_]:ot}:null}},k_=40,OZ=10,R_=0.5,LZ=1,BZ=`${m_},${g_}`,I_=co.forwardRef(function(st,ct){let{toast:gt,render:bt,className:yt,swipeDirection:vt=["down","right"],style:xt,...wt}=st,Ct=gt.positionerProps?.anchor!==void 0,St=[];if(!Ct)St=Array.isArray(vt)?vt:[vt];let Et=St.length>0,kt=Dc(),[Rt,Tt]=co.useState(void 0),[Pt,Mt]=co.useState(!1),[It,At]=co.useState(!1),[Nt,Ot]=co.useState({x:0,y:0}),[Dt,_t]=co.useState({x:0,y:0,scale:1}),[$t,Ft]=co.useState(),[Bt,Lt]=co.useState(),[Vt,Wt]=co.useState(null),Ut=co.useRef(null),Ht=co.useRef(void 0),Gt=co.useRef({x:0,y:0}),jt=co.useRef({x:0,y:0,scale:1}),qt=co.useRef(void 0),Qt=co.useRef(0),Xt=co.useRef(!1),zt=co.useRef({x:0,y:0}),tn=co.useRef(!1),rn=co.useRef({x:0,y:0}),Kt=co.useRef(null),an=co.useRef(null),ln=kt.useState("toastIndex",gt.id),Zt=kt.useState("toastVisibleIndex",gt.id),on=kt.useState("toastOffsetY",gt.id),sn=kt.useState("focused"),dn=kt.useState("expanded");Ro({open:gt.transitionStatus!=="ending",ref:Ut,onComplete(){if(gt.transitionStatus==="ending")kt.removeToast(gt.id)}});let fn=s((Rn=!1)=>{let Cn=Ut.current;if(!Cn)return;let kn=Cn.style.height;Cn.style.height="auto";let Jt=Cn.offsetHeight;Cn.style.height=kn;function Yt(){kt.updateToastInternal(gt.id,{ref:Ut,height:Jt,transitionStatus:void 0})}if(Rn)T_.flushSync(Yt);else Yt()});i(()=>{let Rn=Ht.current;if(gt.transitionStatus!=="starting"&&Rn===gt.id)return;if(Rn!==void 0)Tt(void 0),_t({x:0,y:0,scale:1}),bn({x:0,y:0});Ht.current=gt.id,fn()},[fn,gt.id,gt.transitionStatus]);function bn(Rn){rn.current=Rn,Ot(Rn)}i(()=>()=>{an.current?.abort()},[]);function hn(Rn,Cn){let kn=(un)=>un>0?un**R_:-(Math.abs(un)**R_),Jt=Rn>0&&!St.includes("right")||Rn<0&&!St.includes("left"),Yt=Cn>0&&!St.includes("down")||Cn<0&&!St.includes("up");return{x:Jt?kn(Rn):Rn,y:Yt?kn(Cn):Cn}}let gn=s((Rn)=>{if(Rn.pointerId!==Kt.current)return;Kt.current=null,an.current?.abort(),an.current=null,Mt(!1),At(!1),Wt(null);let Cn=jt.current;if(Rn.type==="pointercancel"||Xt.current){bn({x:Cn.x,y:Cn.y}),Tt(void 0);return}let kn=rn.current,Jt=kn.x-Cn.x,Yt=kn.y-Cn.y,un;for(let vn of St)if(i0(vn,Jt,Yt)>k_){un=vn;break}if(un)Tt(un),kt.closeToast(gt.id);else bn({x:Cn.x,y:Cn.y}),Tt(void 0)});function xn(Rn){if(Rn.button!==0)return;if(Rn.pointerType==="touch")kt.pauseTimers();if(xr(Rn.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${BZ}`))return;Xt.current=!1,qt.current=void 0,Qt.current=0,Kt.current=Rn.pointerId,Gt.current={x:Rn.clientX,y:Rn.clientY},zt.current=Gt.current;let Jt=Rn.currentTarget,Yt=y_(Jt);jt.current=Yt,_t(Yt),bn({x:Yt.x,y:Yt.y}),kt.set("hovering",!0),Mt(!0),At(!1),Wt(null),tn.current=!0,an.current?.abort();let un=new AbortController;an.current=un;let vn=d(Jt);vn.addEventListener("pointerup",gn,{signal:un.signal}),vn.addEventListener("pointercancel",gn,{signal:un.signal}),Jt.setPointerCapture?.(Rn.pointerId)}function wn(Rn){if(Rn.pointerId!==Kt.current)return;if(Rn.preventDefault(),tn.current)Gt.current={x:Rn.clientX,y:Rn.clientY},tn.current=!1;let{clientY:Cn,clientX:kn,movementX:Jt,movementY:Yt}=Rn;if(Yt<0&&Cn>zt.current.y||Yt>0&&Cn<zt.current.y)zt.current={x:zt.current.x,y:Cn};if(Jt<0&&kn>zt.current.x||Jt>0&&kn<zt.current.x)zt.current={x:kn,y:zt.current.y};let un=kn-Gt.current.x,vn=Cn-Gt.current.y,_n=Cn-zt.current.y,zn=kn-zt.current.x,$n=Vt;if(!It){if(Math.sqrt(un*un+vn*vn)>=LZ){At(!0);let lr=St.includes("left")||St.includes("right"),no=St.includes("up")||St.includes("down");if(lr&&no){let An=Math.abs(un),Vn=Math.abs(vn);$n=An>Vn?"horizontal":"vertical",Wt($n)}}}let Mn;if(!qt.current){if($n==="vertical"){if(vn>0)Mn="down";else if(vn<0)Mn="up"}else if($n==="horizontal"){if(un>0)Mn="right";else if(un<0)Mn="left"}else if(Math.abs(un)>=Math.abs(vn))Mn=un>0?"right":"left";else Mn=vn>0?"down":"up";if(Mn&&St.includes(Mn))qt.current=Mn,Qt.current=i0(Mn,un,vn),Tt(Mn)}else{let Tr=qt.current,lr=i0(Tr,zn,_n);if(lr>k_)Xt.current=!1,Tt(Tr);else if(!(St.includes("left")&&St.includes("right"))&&!(St.includes("up")&&St.includes("down"))&&Qt.current-lr>=OZ)Xt.current=!0}let Gn=hn(un,vn),sr=jt.current.x,gr=jt.current.y,qn=St.includes("left")||St.includes("right"),Bn=St.includes("up")||St.includes("down");if($n!=="vertical"&&qn)sr+=Gn.x;if($n!=="horizontal"&&Bn)gr+=Gn.y;bn({x:sr,y:gr})}function yn(Rn){if(Rn.key==="Escape"){if(!Ut.current||!On(Ut.current,Kr(d(Ut.current))))return;kt.closeToast(gt.id)}}co.useEffect(()=>{let Rn=Ut.current;if(!Et||!Rn)return;function Cn(kn){if(Kt.current===null||!On(Rn,xr(kn)))return;kn.preventDefault()}return Xn(Rn,"touchmove",Cn,{passive:!1})},[Et]);function nn(){let Rn=Nt.x-Dt.x,Cn=Nt.y-Dt.y;return{transition:Pt?"none":void 0,transform:Pt?`translateX(${Nt.x}px) translateY(${Nt.y}px) scale(${Dt.scale})`:void 0,[C_]:`${Rn}px`,[S_]:`${Cn}px`}}let en=gt.priority==="high",pn={role:en?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":$t,"aria-describedby":Bt,"aria-hidden":en&&!sn?!0:void 0,onPointerDown:Et?xn:void 0,onPointerMove:Et?wn:void 0,onPointerUp:Et?gn:void 0,onPointerCancel:Et?gn:void 0,onKeyDown:yn,inert:Qa(gt.limited),style:{...nn(),[v_]:gt.transitionStatus==="ending"?ln:Zt,[x_]:`${on}px`,[w_]:gt.height?`${gt.height}px`:void 0}},cn=co.useMemo(()=>({toast:gt,setTitleId:Ft,setDescriptionId:Lt,recalculateHeight:fn,visibleIndex:Zt,expanded:dn}),[gt,Ft,Lt,fn,Zt,dn]),mn={transitionStatus:gt.transitionStatus,expanded:dn,limited:gt.limited||!1,type:gt.type,swiping:Pt,swipeDirection:Rt},Pn=l("div",st,{ref:[ct,Ut],state:mn,stateAttributesMapping:_Z,props:[pn,wt]});return P_.jsx(ZE.Provider,{value:cn,children:Pn})});var s0=e(t(),1);var M_=s0.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,...vt}=st,{visibleIndex:xt,expanded:wt,recalculateHeight:Ct}=zc(),St=s0.useRef(null);i(()=>{Ct();let Rt=St.current;if(!Rt||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let Tt=new ResizeObserver(()=>Ct(!0)),Pt=new MutationObserver(()=>Ct(!0));return Tt.observe(Rt),Pt.observe(Rt,{childList:!0,subtree:!0,characterData:!0}),()=>{Tt.disconnect(),Pt.disconnect()}},[Ct]);let Et=xt>0;return l("div",st,{ref:[ct,St],state:{expanded:wt,behind:Et},props:vt})});var O_=e(t(),1);var a0=e(t(),1);var A_=0;function FZ(ot,st="mui"){let[ct,gt]=a0.useState(ot),bt=ot||ct;return a0.useEffect(()=>{if(ct==null)A_+=1,gt(`${st}-${A_}`)},[ct,st]),bt}var N_=De.useId;function Ts(ot,st){if(N_!==void 0){let ct=N_();return ot??(st?`${st}-${ct}`:ct)}return FZ(ot,st)}var D_=e(t(),1);function __(ot){if(ot==null||typeof ot==="boolean"||ot==="")return!1;if(Array.isArray(ot))return ot.some(__);return!0}function l0(ot){return D_.isValidElement(ot)&&__(ot.props.children)}function c0(ot,st,ct){let{toast:gt,setTitleId:bt,setDescriptionId:yt}=zc(),vt=ct==="title"?bt:yt,xt=st??(ct==="title"?gt.title:gt.description);return{id:Ts(ot),children:xt,type:gt.type,setId:vt}}function u0(ot,st,ct){let gt=l0(ot);return i(()=>{if(!gt)return;return ct(st),()=>{ct((bt)=>bt===st?void 0:bt)}},[gt,st,ct]),gt?ot:null}var L_=O_.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,id:vt,children:xt,...wt}=st,{id:Ct,children:St,type:Et,setId:kt}=c0(vt,xt,"description"),Tt=l("p",st,{ref:ct,state:{type:Et},props:{...wt,id:Ct,children:St}});return u0(Tt,Ct,kt)});var B_=e(t(),1);var F_=B_.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,id:vt,children:xt,...wt}=st,{id:Ct,children:St,type:Et,setId:kt}=c0(vt,xt,"title"),Tt=l("h2",st,{ref:ct,state:{type:Et},props:{...wt,id:Ct,children:St}});return u0(Tt,Ct,kt)});var p0=e(t(),1);var H_=p0.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,disabled:vt,nativeButton:xt=!0,...wt}=st,Ct=Dc(),{toast:St,expanded:Et}=zc(),[kt,Rt]=p0.useState(!1),{getButtonProps:Tt,buttonRef:Pt}=P({disabled:vt,native:xt}),Mt={type:St.type};return l("button",st,{ref:[ct,Pt],state:Mt,props:[{"aria-hidden":!Et&&!kt,onClick(){Ct.closeToast(St.id)},onFocus(){Rt(!0)},onBlur(){Rt(!1)}},wt,Tt]})});var z_=e(t(),1);var $_=z_.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,disabled:vt,nativeButton:xt=!0,...wt}=st,{toast:Ct}=zc(),St=Ct.actionProps?.children??wt.children,{getButtonProps:Et,buttonRef:kt}=P({disabled:vt,native:xt}),Rt={type:Ct.type},Tt=l("button",st,{ref:[ct,kt],state:Rt,props:[wt,Ct.actionProps,Et,{children:St}]});return l0(Tt)?Tt:null});var J_=e(t(),1);var m0=e(t(),1),q_=e(_(),1);var wo=e(t(),1),ok=e(_(),1);var ec="none",Xa="trigger-press",Ao="trigger-hover",sf="trigger-focus",tk="outside-press",nk="item-press",W_="close-press";var U_="track-press";var HZ="input-change";var Ip="focus-out",Ug="escape-key";var rk="list-navigation",zZ="keyboard";var $Z="drag";var WZ="cancel-open",jg="sibling-open",j_="disabled",V_="missing",G_="initial",Vg="imperative-action";function Ln(ot,st,ct,gt){let bt=!1,yt=!1,vt=gt??g;return{reason:ot,event:st??new Event("base-ui"),cancel(){bt=!0},allowPropagation(){yt=!0},get isCanceled(){return bt},get isPropagationAllowed(){return yt},trigger:ct,...vt}}function d0(ot,st,ct){let gt=ct??g;return{reason:ot,event:st??new Event("base-ui"),...gt}}function tc(ot){return`data-base-ui-${ot}`}var Mp=e(r(),1),K_=wo.createContext(null),ik=()=>wo.useContext(K_),UZ=tc("portal");function f0(ot={}){let{ref:st,container:ct,componentProps:gt=g,elementProps:bt}=ot,yt=Ts(),xt=ik()?.portalNode,[wt,Ct]=wo.useState(null),[St,Et]=wo.useState(null),kt=s((Mt)=>{if(Mt!==null)Et(Mt)}),Rt=wo.useRef(null);i(()=>{if(ct===null){if(Rt.current)Rt.current=null,Et(null),Ct(null);return}let Mt=(ct&&(Ve(ct)?ct:ct.current))??xt??document.body;if(Mt==null){if(Rt.current)Rt.current=null,Et(null),Ct(null);return}if(Rt.current!==Mt)Rt.current=Mt,Et(null),Ct(Mt)},[ct,xt]);let Tt=l("div",gt,{ref:[st,kt],props:[{id:yt,[UZ]:""},bt]}),Pt=wt&&Tt?ok.createPortal(Tt,wt):null;return{node:St,nodeId:wo.isValidElement(Tt)?Tt.props.id:void 0,subtree:Pt}}var Ap=wo.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,children:vt,container:xt,portalOwnerRole:wt,...Ct}=st,{node:St,nodeId:Et,subtree:kt}=f0({container:xt,ref:ct,componentProps:st,elementProps:Ct}),Rt=wo.useRef(null),Tt=wo.useRef(null),Pt=wo.useRef(null),Mt=wo.useRef(null),[It,At]=wo.useState(null),Nt=wo.useRef(!1),Ot=It?.modal,Dt=It?.open,_t=!!It&&!It.modal&&It.open&&!!St;wo.useEffect(()=>{if(!St||Ot)return;function Ft(Bt){if(St&&Bt.relatedTarget&&Yl(Bt))if(Bt.type==="focusin"){if(Nt.current)QE(St),Nt.current=!1}else o_(St),Nt.current=!0}return di(Xn(St,"focusin",Ft,!0),Xn(St,"focusout",Ft,!0))},[St,Ot]),i(()=>{if(!St||Dt!==!0||!Nt.current)return;QE(St),Nt.current=!1},[Dt,St]);let $t=wo.useMemo(()=>({beforeOutsideRef:Rt,afterOutsideRef:Tt,beforeInsideRef:Pt,afterInsideRef:Mt,portalNode:St,setFocusManagerState:At}),[St]);return Mp.jsxs(wo.Fragment,{children:[kt,Mp.jsxs(K_.Provider,{value:$t,children:[_t&&St&&Mp.jsx(cs,{"data-type":"outside",ref:Rt,onFocus:(Ft)=>{if(Yl(Ft,St))Pt.current?.focus();else{let Bt=It?It.domReference:null;Xy(Bt)?.focus()}}}),_t&&St&&Mp.jsx("span",{role:wt,"aria-owns":Et,style:b_}),St&&ok.createPortal(vt,St),_t&&St&&Mp.jsx(cs,{"data-type":"outside",ref:Tt,onFocus:(Ft)=>{if(Yl(Ft,St))Mt.current?.focus();else{let Bt=It?It.domReference:null;if(rf(Bt)?.focus(),It?.closeOnFocusOut)It?.onOpenChange(!1,Ln(Ip,Ft.nativeEvent))}}})]})]})});var Q_=e(r(),1),af=m0.forwardRef(function(st,ct){let{children:gt,container:bt,className:yt,render:vt,style:xt,...wt}=st,{node:Ct,subtree:St}=f0({container:bt,ref:ct,componentProps:st,elementProps:wt});if(!St&&!Ct)return null;return Q_.jsxs(m0.Fragment,{children:[St,Ct&&q_.createPortal(gt,Ct)]})});var X_=e(r(),1),Y_=J_.forwardRef(function(st,ct){return X_.jsx(af,{ref:ct,...st})});var Is=e(t(),1);function io(ot){let st=I(jZ,ot).current;return st.next=ot,i(st.effect),st}function jZ(ot){let st={current:ot,next:ot,effect:()=>{st.current=st.next}};return st}var Ki=e(t(),1);function VZ(ot,st){if(st!=null&&!Rs(st))return 0;if(typeof ot==="function")return ot();return ot}function ka(ot,st,ct){let gt=VZ(ot,ct);if(typeof gt==="number")return gt;return gt?.[st]}function sk(ot){if(typeof ot==="function")return ot();return ot}function g0(ot,st){return st||ot==="click"||ot==="mousedown"}function Z_(ot){return ot?.includes("mouse")&&ot!=="mousedown"}var e2=e(r(),1),t2=Ki.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ho,currentIdRef:{current:null},currentContextRef:{current:null}});function GZ(ot,st){ot.current=st.current}function ak(ot){let{children:st,delay:ct,timeoutMs:gt=0}=ot,bt=Ki.useRef(ct),yt=Ki.useRef(ct),vt=Ki.useRef(null),xt=Ki.useRef(null),wt=Xr();return i(()=>{if(yt.current=ct,!vt.current){bt.current=ct;return}bt.current={open:ka(bt.current,"open"),close:ka(ct,"close")}},[ct,vt,bt,yt]),e2.jsx(t2.Provider,{value:Ki.useMemo(()=>({hasProvider:!0,delayRef:bt,initialDelayRef:yt,currentIdRef:vt,timeoutMs:gt,currentContextRef:xt,timeout:wt}),[gt,wt]),children:st})}function lk(ot,st={open:!1}){let{open:ct}=st,gt="rootStore"in ot?ot.rootStore:ot,bt=gt.useState("floatingId"),yt=Ki.useContext(t2),{currentIdRef:vt,delayRef:xt,timeoutMs:wt,initialDelayRef:Ct,currentContextRef:St,hasProvider:Et,timeout:kt}=yt,[Rt,Tt]=Ki.useState(!1),Pt=Ki.useRef(ct);return i(()=>{Pt.current=ct},[ct]),i(()=>{function Mt(){St.current?.setIsInstantPhase(!1),vt.current=null,St.current=null,xt.current=Ct.current,kt.clear()}if(!vt.current)return;if(!ct&&vt.current===bt){if(Tt(!1),wt){let It=bt;return kt.start(wt,()=>{if(gt.select("open")||vt.current&&vt.current!==It)return;Mt()}),()=>{if(Pt.current||vt.current!==It)kt.clear()}}Mt()}return},[ct,bt,vt,xt,wt,Ct,St,kt,gt]),i(()=>{if(!ct)return;let Mt=St.current,It=vt.current;if(kt.clear(),St.current={onOpenChange:gt.setOpen,setIsInstantPhase:Tt},vt.current=bt,xt.current={open:0,close:ka(Ct.current,"close")},It!==null&&It!==bt)Tt(!0),Mt?.setIsInstantPhase(!0),Mt?.onOpenChange(!1,Ln(ec));else Tt(!1),Mt?.setIsInstantPhase(!1)},[ct,bt,gt,vt,xt,Ct,St,kt]),i(()=>()=>{if(vt.current===bt){if(St.current=null,!Pt.current)return;vt.current=null,GZ(xt,Ct),kt.clear()}},[St,vt,xt,bt,Ct,kt]),Ki.useMemo(()=>({activeIdRef:vt,hasProvider:Et,delayRef:xt,isInstantPhase:Rt}),[vt,Et,xt,Rt])}var Di=e(t(),1);var h0=0;function lf(ot,st={}){let{preventScroll:ct=!1,sync:gt=!1,shouldFocus:bt}=st;cancelAnimationFrame(h0);function yt(){if(bt&&!bt())return;ot?.focus({preventScroll:ct})}if(gt)return yt(),w;let vt=requestAnimationFrame(yt);return h0=vt,()=>{if(h0===vt)cancelAnimationFrame(vt),h0=0}}var ck={inert:new WeakMap,"aria-hidden":new WeakMap},n2="data-base-ui-inert",pk={inert:new WeakSet,"aria-hidden":new WeakSet},Gg=new WeakMap,uk=0;function KZ(ot){return pk[ot]}function s2(ot){if(!ot)return null;return te(ot)?ot.host:s2(ot.parentNode)}var r2=(ot,st)=>st.map((ct)=>{if(ot.contains(ct))return ct;let gt=s2(ct);if(ot.contains(gt))return gt;return null}).filter((ct)=>ct!=null),o2=(ot)=>{let st=new Set;return ot.forEach((ct)=>{let gt=ct;while(gt&&!st.has(gt))st.add(gt),gt=gt.parentNode}),st},i2=(ot,st,ct)=>{let gt=[],bt=(yt)=>{if(!yt||ct.has(yt))return;Array.from(yt.children).forEach((vt)=>{if(D(vt)==="script")return;if(st.has(vt))bt(vt);else gt.push(vt)})};return bt(ot),gt};function qZ(ot,st,ct,gt,{mark:bt=!0}){let yt=null;if(gt)yt="inert";else if(ct)yt="aria-hidden";let vt=null,xt=null,wt=r2(st,ot),Ct=bt?i2(st,o2(wt),new Set(wt)):[],St=[],Et=[];if(yt){let kt=ck[yt],Rt=KZ(yt);xt=Rt,vt=kt;let Tt=r2(st,Array.from(st.querySelectorAll("[aria-live]"))),Pt=wt.concat(Tt);i2(st,o2(Pt),new Set(Pt)).forEach((It)=>{let At=It.getAttribute(yt),Nt=At!==null&&At!=="false",Ot=(kt.get(It)||0)+1;if(kt.set(It,Ot),St.push(It),Ot===1&&Nt)Rt.add(It);if(!Nt)It.setAttribute(yt,yt==="inert"?"":"true")})}if(bt)Ct.forEach((kt)=>{let Rt=(Gg.get(kt)||0)+1;if(Gg.set(kt,Rt),Et.push(kt),Rt===1)kt.setAttribute(n2,"")});return uk+=1,()=>{if(vt)St.forEach((kt)=>{let Tt=(vt.get(kt)||0)-1;if(vt.set(kt,Tt),!Tt){if(!xt?.has(kt)&&yt)kt.removeAttribute(yt);xt?.delete(kt)}});if(bt)Et.forEach((kt)=>{let Rt=(Gg.get(kt)||0)-1;if(Gg.set(kt,Rt),!Rt)kt.removeAttribute(n2)});if(uk-=1,!uk)ck.inert=new WeakMap,ck["aria-hidden"]=new WeakMap,pk.inert=new WeakSet,pk["aria-hidden"]=new WeakSet,Gg=new WeakMap}}function dk(ot,st={}){let{ariaHidden:ct=!1,inert:gt=!1,mark:bt=!0}=st,yt=d(ot[0]).body;return qZ(ot,yt,ct,gt,{mark:bt})}var Wc=e(t(),1);function b0(){let ot=new Map;return{emit(st,ct){ot.get(st)?.forEach((gt)=>gt(ct))},on(st,ct){if(!ot.has(st))ot.set(st,new Set);ot.get(st).add(ct)},off(st,ct){ot.get(st)?.delete(ct)}}}class Np{nodesRef={current:[]};events=b0();addNode(ot){this.nodesRef.current.push(ot)}removeNode(ot){let st=this.nodesRef.current.findIndex((ct)=>ct===ot);if(st!==-1)this.nodesRef.current.splice(st,1)}}var fk=e(r(),1),a2=Wc.createContext(null),l2=Wc.createContext(null),Ps=()=>Wc.useContext(a2)?.id||null,Ni=(ot)=>{let st=Wc.useContext(l2);return ot??st};function nc(ot){let st=Ts(),ct=Ni(ot),gt=Ps();return i(()=>{if(!st)return;let bt={id:st,parentId:gt};return ct?.addNode(bt),()=>{ct?.removeNode(bt)}},[ct,st,gt]),st}function Dp(ot){let{children:st,id:ct}=ot,gt=Ps();return fk.jsx(a2.Provider,{value:Wc.useMemo(()=>({id:ct,parentId:gt}),[ct,gt]),children:st})}function _p(ot){let{children:st,externalTree:ct}=ot,gt=I(()=>ct??new Np).current;return fk.jsx(l2.Provider,{value:gt,children:st})}var Kg=e(r(),1);function QZ(ot,st){let ct=m(xr(ot));if(ot instanceof ct.KeyboardEvent)return"keyboard";if(ot instanceof ct.FocusEvent)return st||"keyboard";if("pointerType"in ot)return ot.pointerType||"keyboard";if("touches"in ot)return"touch";if(ot instanceof ct.MouseEvent)return st||(ot.detail===0?"keyboard":"mouse");return""}var c2=20,Uc=[];function mk(){Uc=Uc.filter((ot)=>ot.deref()?.isConnected)}function u2(ot){if(mk(),ot&&D(ot)!=="body"){if(Uc.push(new WeakRef(ot)),Uc.length>c2)Uc=Uc.slice(-c2)}}function p2(){return mk(),Uc[Uc.length-1]?.deref()}function JZ(ot){if(!ot)return null;if(Jy(ot))return ot;return nf(ot)[0]||ot}function d2(ot){if(ot.hasAttribute("tabindex")&&!ot.hasAttribute("data-tabindex"))return;if(!ot.getAttribute("role")?.includes("dialog"))return;let ct=qE(ot).filter((bt)=>{let yt=bt.getAttribute("data-tabindex")||"";return Jy(bt)||bt.hasAttribute("data-tabindex")&&!yt.startsWith("-")}),gt=ot.getAttribute("tabindex");if(ct.length===0){if(gt!=="0")ot.setAttribute("tabindex","0"),ot.setAttribute("data-tabindex","0")}else if(gt!=="-1"||ot.hasAttribute("data-tabindex")&&ot.getAttribute("data-tabindex")!=="-1")ot.setAttribute("tabindex","-1"),ot.setAttribute("data-tabindex","-1")}function Op(ot){let{context:st,children:ct,disabled:gt=!1,initialFocus:bt=!0,returnFocus:yt=!0,restoreFocus:vt=!1,modal:xt=!0,closeOnFocusOut:wt=!0,openInteractionType:Ct="",nextFocusableElement:St,previousFocusableElement:Et,beforeContentFocusGuardRef:kt,externalTree:Rt,getInsideElements:Tt}=ot,Pt="rootStore"in st?st.rootStore:st,Mt=Pt.useState("open"),It=Pt.useState("domReferenceElement"),At=Pt.useState("floatingElement"),{events:Nt,dataRef:Ot}=Pt.context,Dt=s(()=>Ot.current.floatingContext?.nodeId),_t=bt===!1,$t=Lg(It)&&_t,Ft=io(bt),Bt=io(yt),Lt=io(Ct),Vt=io(Mt),Wt=Ni(Rt),Ut=ik(),Ht=Di.useRef(!1),Gt=Di.useRef(!1),jt=Di.useRef(!1),qt=Di.useRef(null),Qt=Di.useRef(""),Xt=Di.useRef(""),zt=Di.useRef(null),tn=Di.useRef(null),rn=L(zt,kt,Ut?.beforeInsideRef),Kt=L(tn,Ut?.afterInsideRef),an=Xr(),ln=Xr(),Zt=xa(),on=Ut!=null,sn=Bg(At),dn=s((hn=sn)=>hn?nf(hn):[]),fn=s(()=>Tt?.().filter((hn)=>hn!=null)??[]);Di.useEffect(()=>{if(gt||!xt)return;function hn(xn){if(xn.key==="Tab"){if(On(sn,Kr(d(sn)))&&dn().length===0&&!$t)ss(xn)}}let gn=d(sn);return Xn(gn,"keydown",hn)},[gt,sn,xt,$t,dn]),Di.useEffect(()=>{if(gt||!Mt)return;let hn=d(sn);function gn(){jt.current=!1}function xn(yn){let nn=xr(yn),en=fn(),pn=On(At,nn)||On(It,nn)||On(Ut?.portalNode,nn)||en.some((cn)=>cn===nn||On(cn,nn));if(jt.current=!pn,Xt.current=yn.pointerType||"keyboard",nn?.closest(`[${of}]`))Gt.current=!0,ln.start(0,()=>{Gt.current=!1})}function wn(){Xt.current="keyboard"}return di(Xn(hn,"pointerdown",xn,!0),Xn(hn,"pointerup",gn,!0),Xn(hn,"pointercancel",gn,!0),Xn(hn,"keydown",wn,!0),gn)},[gt,At,It,sn,Mt,Ut,ln,fn]),Di.useEffect(()=>{if(gt||!wt)return;let hn=d(sn);function gn(){Gt.current=!0,ln.start(0,()=>{Gt.current=!1})}function xn(en){let pn=xr(en);if(Jy(pn))qt.current=pn}function wn(en){let{relatedTarget:pn,currentTarget:cn}=en,mn=xr(en);if(xt&&pn==null&&mn!=null&&On(At,mn))u2(mn);queueMicrotask(()=>{let Pn=Dt(),Rn=Pt.context.triggerElements,Cn=fn(),kn=pn?.hasAttribute(tc("focus-guard"))&&[zt.current,tn.current,Ut?.beforeInsideRef.current,Ut?.afterInsideRef.current,Ut?.beforeOutsideRef.current,Ut?.afterOutsideRef.current,Ea(Et),Ea(St)].includes(pn),Jt=!(On(It,pn)||On(At,pn)||On(pn,At)||On(Ut?.portalNode,pn)||Cn.some((Yt)=>Yt===pn||On(Yt,pn))||Rn.hasMatchingElement((Yt)=>On(Yt,pn))||kn||Wt&&(Ks(Wt.nodesRef.current,Pn).find((Yt)=>On(Yt.context?.elements.floating,pn)||On(Yt.context?.elements.domReference,pn))||VE(Wt.nodesRef.current,Pn).find((Yt)=>[Yt.context?.elements.floating,Bg(Yt.context?.elements.floating)].includes(pn)||Yt.context?.elements.domReference===pn)));if(cn===It&&sn)d2(sn);if(vt&&cn!==It&&!Pp(mn)&&Kr(hn)===hn.body){if(y(sn)){if(sn.focus(),vt==="popup"){Zt.request(()=>{sn.focus()});return}}let Yt=dn(),un=qt.current,vn=(un&&Yt.includes(un)?un:null)||Yt[Yt.length-1]||sn;if(y(vn))vn.focus()}if(Ot.current.insideReactTree){Ot.current.insideReactTree=!1;return}if(($t?!0:!xt)&&pn&&Jt&&!Gt.current&&($t||pn!==p2()))Ht.current=!0,Pt.setOpen(!1,Ln(Ip,en))})}function yn(){if(jt.current)return;Ot.current.insideReactTree=!0,an.start(0,()=>{Ot.current.insideReactTree=!1})}let nn=y(It)?It:null;if(!At&&!nn)return;return di(nn&&Xn(nn,"focusout",wn),nn&&Xn(nn,"pointerdown",gn),At&&Xn(At,"focusin",xn),At&&Xn(At,"focusout",wn),At&&Ut&&Xn(At,"focusout",yn,!0))},[gt,It,At,sn,xt,Wt,Ut,Pt,wt,vt,dn,$t,Dt,Ot,an,ln,Zt,St,Et,fn]),Di.useEffect(()=>{if(gt||!At||!Mt)return;let hn=Array.from(Ut?.portalNode?.querySelectorAll(`[${tc("portal")}]`)||[]),xn=(Wt?VE(Wt.nodesRef.current,Dt()):[]).find((cn)=>Lg(cn.context?.elements.domReference||null))?.context?.elements.domReference,yn=[...[At,...hn,zt.current,tn.current,Ut?.beforeOutsideRef.current,Ut?.afterOutsideRef.current,...fn()],xn,Ea(Et),Ea(St),$t?It:null].filter((cn)=>cn!=null),nn=dk(yn,{ariaHidden:xt||$t,mark:!1}),en=[At,...hn].filter((cn)=>cn!=null),pn=dk(en);return()=>{pn(),nn()}},[Mt,gt,It,At,xt,Ut,$t,Wt,Dt,St,Et,fn]),i(()=>{if(!Mt||gt||!y(sn))return;Qt.current="",Xt.current="";let hn=d(sn),gn=Kr(hn);queueMicrotask(()=>{let xn=Ft.current,wn=typeof xn==="function"?xn(Lt.current||""):xn;if(wn===void 0||wn===!1)return;if(On(sn,gn))return;let nn=null,en=()=>{if(nn==null)nn=dn(sn);return nn[0]||sn},pn;if(wn===!0||wn===null)pn=en();else pn=Ea(wn);pn=pn||en();let cn=On(sn,Kr(hn));lf(pn,{preventScroll:pn===sn,shouldFocus(){if(!Vt.current)return!1;if(cn)return!0;let mn=Kr(hn);return!(mn!==pn&&On(sn,mn))}})})},[gt,Mt,sn,dn,Ft,Lt,Vt]),i(()=>{if(gt||!sn)return;let hn=d(sn),gn=Kr(hn),xn=Lt.current==null;u2(gn);function wn(nn){if(!nn.open)Qt.current=QZ(nn.nativeEvent,Xt.current);if(nn.reason===Ao&&nn.nativeEvent.type==="mouseleave")Ht.current=!0;if(nn.reason!==tk)return;if(nn.nested)Ht.current=!1;else if(Zd(nn.nativeEvent)||ef(nn.nativeEvent))Ht.current=!1;else{let en=!1;if(d(sn).createElement("div").focus({get preventScroll(){return en=!0,!1}}),en)Ht.current=!1;else Ht.current=!0}}Nt.on("openchange",wn);function yn(nn){let en=Bt.current,pn=typeof en==="function"?en(nn):en;if(pn===void 0||pn===!1)return null;if(pn===null)pn=!0;let cn=It?.isConnected?It:null,mn=gn?.isConnected&&D(gn)!=="body"?gn:null,Pn=xn?mn||cn:cn||mn;if(!Pn)Pn=p2()||null;if(typeof pn==="boolean")return Pn;return Ea(pn)||Pn||null}return()=>{Nt.off("openchange",wn);let nn=Kr(hn),en=fn(),pn=On(At,nn)||en.some((Rn)=>Rn===nn||On(Rn,nn))||Wt&&Ks(Wt.nodesRef.current,Dt(),!1).some((Rn)=>On(Rn.context?.elements.floating,nn)),cn=Bt.current,mn=Qt.current,Pn=yn(mn);queueMicrotask(()=>{let Rn=JZ(Pn),Cn=typeof cn!=="boolean";if(cn&&!Ht.current&&y(Rn)&&(!Cn&&Rn!==nn&&nn!==hn.body?pn:!0)){let kn={preventScroll:!0};if(mn==="keyboard")kn.focusVisible=!0;Rn.focus(kn)}Ht.current=!1})}},[gt,At,sn,Bt,Lt,Nt,Wt,It,Dt,fn]),i(()=>{if(!Oc.webkit||Mt||!At)return;let hn=Kr(d(At));if(!y(hn)||!kp(hn))return;if(On(At,hn))hn.blur()},[Mt,At]),i(()=>{if(gt||!Ut)return;return Ut.setFocusManagerState({modal:xt,closeOnFocusOut:wt,open:Mt,onOpenChange:Pt.setOpen,domReference:It}),()=>{Ut.setFocusManagerState(null)}},[gt,Ut,xt,Mt,Pt,wt,It]),i(()=>{if(gt||!sn)return;return d2(sn),()=>{queueMicrotask(mk)}},[gt,sn]);let bn=!gt&&(xt?!$t:!0)&&(on||xt);return Kg.jsxs(Di.Fragment,{children:[bn&&Kg.jsx(cs,{"data-type":"inside",ref:rn,onFocus:(hn)=>{if(xt){let gn=dn();lf(gn[gn.length-1])}else if(Ut?.portalNode)if(Ht.current=!1,Yl(hn,Ut.portalNode))rf(It)?.focus();else Ea(Et??Ut.beforeOutsideRef)?.focus()}}),ct,bn&&Kg.jsx(cs,{"data-type":"inside",ref:Kt,onFocus:(hn)=>{if(xt)lf(dn()[0]);else if(Ut?.portalNode){if(wt)Ht.current=!0;if(Yl(hn,Ut.portalNode))Xy(It)?.focus();else Ea(St??Ut.afterOutsideRef)?.focus()}}})]})}var qg=e(t(),1);function Lp(ot,st={}){let{enabled:ct=!0,event:gt="click",toggle:bt=!0,ignoreMouse:yt=!1,stickIfOpen:vt=!0,touchOpenDelay:xt=0,reason:wt=Xa}=st,Ct="rootStore"in ot?ot.rootStore:ot,St=Ct.context.dataRef,Et=qg.useRef(void 0),kt=xa(),Rt=Xr(),Tt=qg.useMemo(()=>{function Pt(It,At,Nt,Ot){let Dt=Ln(wt,At,Nt);if(It&&Ot==="touch"&&xt>0)Rt.start(xt,()=>{Ct.setOpen(!0,Dt)});else Ct.setOpen(It,Dt)}function Mt(It,At,Nt){let Ot=St.current.openEvent,Dt=Ct.select("domReferenceElement")!==At;if(It&&Dt)return!0;if(!It)return!0;if(!bt)return!0;if(Ot&&vt)return!Nt(Ot.type);return!1}return{onPointerDown(It){Et.current=Rs(It.pointerType,!0)&&ef(It.nativeEvent)?"virtual":It.pointerType},onMouseDown(It){let At=Et.current,Nt=It.nativeEvent,Ot=Ct.select("open");if(It.button!==0||gt==="click"||Rs(At,!0)&&yt)return;let Dt=Mt(Ot,It.currentTarget,(Ft)=>Ft==="click"||Ft==="mousedown"),_t=xr(Nt);if(kp(_t)){Pt(Dt,Nt,_t,At);return}let $t=It.currentTarget;kt.request(()=>{Pt(Dt,Nt,$t,At)})},onClick(It){if(gt==="mousedown-only")return;let At=Et.current;if(gt==="mousedown"&&At){Et.current=void 0;return}if(Rs(At,!0)&&yt)return;let Nt=Ct.select("open"),Ot=Mt(Nt,It.currentTarget,(Dt)=>Dt==="click"||Dt==="mousedown"||Dt==="keydown"||Dt==="keyup");Pt(Ot,It.nativeEvent,It.currentTarget,At)},onKeyDown(){Et.current=void 0}}},[St,gt,yt,wt,Ct,vt,bt,kt,Rt,xt]);return qg.useMemo(()=>ct?{reference:Tt}:g,[ct,Tt])}var us=e(t(),1);function XZ(ot,st){let ct=null,gt=null,bt=!1;return{contextElement:ot||void 0,getBoundingClientRect(){let yt=ot?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},vt=st.axis==="x"||st.axis==="both",xt=st.axis==="y"||st.axis==="both",wt=["mouseenter","mousemove"].includes(st.dataRef.current.openEvent?.type||"")&&st.pointerType!=="touch",{width:Ct,height:St,x:Et,y:kt}=yt;if(ct==null&&st.x&&vt)ct=yt.x-st.x;if(gt==null&&st.y&&xt)gt=yt.y-st.y;if(Et-=ct||0,kt-=gt||0,Ct=0,St=0,!bt||wt)Ct=st.axis==="y"?yt.width:0,St=st.axis==="x"?yt.height:0,Et=vt&&st.x!=null?st.x:Et,kt=xt&&st.y!=null?st.y:kt;else if(bt&&!wt)St=st.axis==="x"?yt.height:St,Ct=st.axis==="y"?yt.width:Ct;return bt=!0,{width:Ct,height:St,x:Et,y:kt,top:kt,right:Et+Ct,bottom:kt+St,left:Et}}}}function f2(ot){return ot!=null&&ot.clientX!=null}function gk(ot,st={}){let{enabled:ct=!0,axis:gt="both"}=st,bt="rootStore"in ot?ot.rootStore:ot,yt=bt.useState("open"),vt=bt.useState("floatingElement"),xt=bt.useState("domReferenceElement"),wt=bt.context.dataRef,Ct=us.useRef(!1),St=us.useRef(null),[Et,kt]=us.useState(),[Rt,Tt]=us.useState([]),Pt=s((Ot)=>{bt.set("positionReference",Ot)}),Mt=s((Ot,Dt,_t)=>{if(Ct.current)return;if(wt.current.openEvent&&!f2(wt.current.openEvent))return;bt.set("positionReference",XZ(_t??xt,{x:Ot,y:Dt,axis:gt,dataRef:wt,pointerType:Et}))}),It=s((Ot)=>{if(!yt)Mt(Ot.clientX,Ot.clientY,Ot.currentTarget);else if(!St.current)Mt(Ot.clientX,Ot.clientY,Ot.currentTarget),Tt([])}),At=Rs(Et)?vt:yt;us.useEffect(()=>{if(!ct){Pt(xt);return}if(!At)return;function Ot(){St.current?.(),St.current=null}let Dt=m(vt);function _t($t){let Ft=xr($t);if(!On(vt,Ft))Mt($t.clientX,$t.clientY);else Ot()}if(!wt.current.openEvent||f2(wt.current.openEvent))St.current=Xn(Dt,"mousemove",_t);else Pt(xt);return Ot},[At,ct,vt,wt,xt,bt,Mt,Pt,Rt]),us.useEffect(()=>()=>{bt.set("positionReference",null)},[bt]),us.useEffect(()=>{if(ct&&!vt)Ct.current=!1},[ct,vt]),us.useEffect(()=>{if(!ct&&yt)Ct.current=!0},[ct,yt]);let Nt=us.useMemo(()=>{function Ot(Dt){kt(Dt.pointerType)}return{onPointerDown:Ot,onPointerEnter:Ot,onMouseMove:It,onMouseEnter:It}},[It]);return us.useMemo(()=>ct?{reference:Nt,trigger:Nt}:{},[ct,Nt])}var qi=e(t(),1);function YZ(){return!1}function ZZ(ot){return{escapeKey:typeof ot==="boolean"?ot:ot?.escapeKey??!1,outsidePress:typeof ot==="boolean"?ot:ot?.outsidePress??!0}}function Ra(ot,st={}){let{enabled:ct=!0,escapeKey:gt=!0,outsidePress:bt=!0,outsidePressEvent:yt="sloppy",referencePress:vt=YZ,bubbles:xt,externalTree:wt}=st,Ct="rootStore"in ot?ot.rootStore:ot,St=Ct.useState("open"),Et=Ct.useState("floatingElement"),{dataRef:kt,events:Rt}=Ct.context,Tt=Ni(wt),Pt=s(typeof bt==="function"?bt:()=>!1),Mt=typeof bt==="function"?Pt:bt,It=Mt!==!1,At=s(()=>yt),{escapeKey:Nt,outsidePress:Ot}=ZZ(xt),Dt=qi.useRef(!1),_t=qi.useRef(!1),$t=qi.useRef(!1),Ft=qi.useRef(!1),Bt=qi.useRef(!1),Lt=qi.useRef(""),Vt=qi.useRef(null),Wt=Xr(),Ut=Xr(),Ht=s(()=>{Ut.clear(),kt.current.insideReactTree=!1}),Gt=s((an)=>{let ln=kt.current.floatingContext?.nodeId;return(Tt?Ks(Tt.nodesRef.current,ln):[]).some((on)=>on.context?.open&&!on.context.dataRef.current[an])}),jt=s((an)=>Vy(an,Ct.select("floatingElement"))||Vy(an,Ct.select("domReferenceElement"))),qt=s((an)=>{if(!vt())return;Ct.setOpen(!1,Ln(Xa,an.nativeEvent))}),Qt=s((an)=>{if(!St||!ct||!gt||an.key!=="Escape")return;if(Bt.current)return;if(!Nt&&Gt("__escapeKeyBubbles"))return;let ln=$D(an)?an.nativeEvent:an,Zt=Ln(Ug,ln);if(Ct.setOpen(!1,Zt),!Zt.isCanceled)an.preventDefault();if(!Nt&&!Zt.isPropagationAllowed)an.stopPropagation()}),Xt=s(()=>{kt.current.insideReactTree=!0,Ut.start(0,Ht)}),zt=s((an)=>{if(!St||!ct||an.button!==0)return;let ln=xr(an.nativeEvent);if(!On(Ct.select("floatingElement"),ln))return;if(!Dt.current)Dt.current=!0,_t.current=!1}),tn=s((an)=>{if(!St||!ct)return;if(!(an.defaultPrevented||an.nativeEvent.defaultPrevented))return;if(Dt.current)_t.current=!0});qi.useEffect(()=>{function an(ln){if(!ln.open)Ft.current=!1}return Rt.on("openchange",an),()=>{Rt.off("openchange",an)}},[Rt]),qi.useEffect(()=>{if(!St||!ct){if(!St)Ft.current=!1;return Ht}kt.current.__escapeKeyBubbles=Nt,kt.current.__outsidePressBubbles=Ot;let an=new Ho,ln=new Ho,Zt=d(Et);function on(){an.clear(),Bt.current=!0}function sn(){an.start(Oc.webkit?5:0,()=>{Bt.current=!1})}function dn(){$t.current=!0,ln.start(0,()=>{$t.current=!1})}function fn(){Dt.current=!1,_t.current=!1}function bn(){let Jt=Lt.current,Yt=Jt==="pen"||!Jt?"mouse":Jt,un=At(),vn=typeof un==="function"?un():un;if(typeof vn==="string")return vn;return vn[Yt]}function hn(Jt){let Yt=bn();return Yt==="intentional"&&Jt.type!=="click"||Yt==="sloppy"&&Jt.type==="click"}function gn(Jt){let Yt=kt.current.floatingContext?.nodeId,un=Tt&&Ks(Tt.nodesRef.current,Yt).some((vn)=>Vy(Jt,vn.context?.elements.floating));return jt(Jt)||un}function xn(Jt){if(hn(Jt)){if(Jt.type!=="click"&&!jt(Jt))ln.clear(),$t.current=!1;Ht();return}if(kt.current.insideReactTree){Ht();return}let Yt=xr(Jt),un=`[${tc("inert")}]`,vn=f(Yt)?Yt.getRootNode():null,_n=Array.from((te(vn)?vn:d(Ct.select("floatingElement"))).querySelectorAll(un)),zn=Ct.context.triggerElements;if(Yt&&(zn.hasElement(Yt)||zn.hasMatchingElement((Mn)=>On(Mn,Yt))))return;let $n=f(Yt)?Yt:null;while($n&&!K($n)){let Mn=q($n);if(K(Mn)||!f(Mn))break;$n=Mn}if(_n.length&&f(Yt)&&!zD(Yt)&&!On(Yt,Ct.select("floatingElement"))&&_n.every((Mn)=>!On($n,Mn)))return;if(y(Yt)&&!("touches"in Jt)){let Mn=K(Yt),Gn=F(Yt),sr=/auto|scroll/,gr=Mn||sr.test(Gn.overflowX),qn=Mn||sr.test(Gn.overflowY),Bn=gr&&Yt.clientWidth>0&&Yt.scrollWidth>Yt.clientWidth,Tr=qn&&Yt.clientHeight>0&&Yt.scrollHeight>Yt.clientHeight,lr=Gn.direction==="rtl",no=Tr&&(lr?Jt.offsetX<=Yt.offsetWidth-Yt.clientWidth:Jt.offsetX>Yt.clientWidth),An=Bn&&Jt.offsetY>Yt.clientHeight;if(no||An)return}if(gn(Jt))return;if(bn()==="intentional"){if(Jt.detail!==0&&!Zd(Jt)&&!Ft.current)return;if($t.current){ln.clear(),$t.current=!1;return}}if(typeof Mt==="function"&&!Mt(Jt))return;if(Gt("__outsidePressBubbles"))return;Ct.setOpen(!1,Ln(tk,Jt)),Ht()}function wn(Jt){if(bn()!=="sloppy"||Jt.pointerType==="touch"||!Ct.select("open")||!ct||jt(Jt))return;xn(Jt)}function yn(Jt){if(bn()!=="sloppy"||!Ct.select("open")||!ct||jt(Jt))return;let Yt=Jt.touches[0];if(Yt)Vt.current={startTime:Date.now(),startX:Yt.clientX,startY:Yt.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},Wt.start(1000,()=>{if(Vt.current)Vt.current.dismissOnTouchEnd=!1,Vt.current.dismissOnMouseDown=!1})}function nn(Jt,Yt){let un=xr(Jt);if(!un)return;let vn=Xn(un,Jt.type,()=>{Yt(Jt),vn()})}function en(Jt){Lt.current="touch",nn(Jt,yn)}function pn(Jt){if(Wt.clear(),Jt.type==="pointerdown"){if(Jt.button===0)Ft.current=!0;Lt.current=Jt.pointerType}if(Jt.type==="mousedown"&&Vt.current&&!Vt.current.dismissOnMouseDown)return;nn(Jt,(Yt)=>{if(Yt.type==="pointerdown")wn(Yt);else xn(Yt)})}function cn(Jt){if(Jt.type==="pointercancel")Ft.current=!1;if(!Dt.current)return;let Yt=_t.current;if(fn(),bn()!=="intentional")return;if(Jt.type==="pointercancel"){if(Yt)dn();return}if(gn(Jt))return;if(Yt){dn();return}if(typeof Mt==="function"&&!Mt(Jt))return;ln.clear(),$t.current=!0,Ht()}function mn(Jt){if(bn()!=="sloppy"||!Vt.current||jt(Jt))return;let Yt=Jt.touches[0];if(!Yt)return;let un=Math.abs(Yt.clientX-Vt.current.startX),vn=Math.abs(Yt.clientY-Vt.current.startY),_n=Math.sqrt(un*un+vn*vn);if(_n>5)Vt.current.dismissOnTouchEnd=!0;if(_n>10)xn(Jt),Wt.clear(),Vt.current=null}function Pn(Jt){nn(Jt,mn)}function Rn(Jt){if(bn()!=="sloppy"||!Vt.current||jt(Jt))return;if(Vt.current.dismissOnTouchEnd)xn(Jt);Wt.clear(),Vt.current=null}function Cn(Jt){nn(Jt,Rn)}let kn=di(gt&&di(Xn(Zt,"keydown",Qt),Xn(Zt,"compositionstart",on),Xn(Zt,"compositionend",sn)),It&&di(Xn(Zt,"click",pn,!0),Xn(Zt,"pointerdown",pn,!0),Xn(Zt,"pointerup",cn,!0),Xn(Zt,"pointercancel",cn,!0),Xn(Zt,"mousedown",pn,!0),Xn(Zt,"mouseup",cn,!0),Xn(Zt,"touchstart",en,{capture:!0,passive:!0}),Xn(Zt,"touchmove",Pn,{capture:!0,passive:!0}),Xn(Zt,"touchend",Cn,{capture:!0,passive:!0})));return()=>{kn(),an.clear(),ln.clear(),fn(),$t.current=!1,Ht()}},[kt,Et,gt,It,Mt,St,ct,Nt,Ot,Qt,Ht,At,Gt,jt,Tt,Ct,Wt]);let rn=qi.useMemo(()=>({onKeyDown:Qt,onPointerDown:qt,onClick:qt}),[Qt,qt]),Kt=qi.useMemo(()=>({onKeyDown:Qt,onPointerDown:tn,onMouseDown:tn,onClickCapture:Xt,onMouseDownCapture(an){Xt(),zt(an)},onPointerDownCapture(an){Xt(),zt(an)},onMouseUpCapture:Xt,onTouchEndCapture:Xt,onTouchMoveCapture:Xt}),[Qt,Xt,zt,tn]);return qi.useMemo(()=>ct?{reference:rn,floating:Kt,trigger:rn}:{},[ct,rn,Kt])}function y0(ot,st,ct,gt){return{left:ot,top:st,right:ct,bottom:gt,x:ot,y:st,width:ct-ot,height:gt-st}}function eee(ot){return{left:ot.left,top:ot.top,right:ot.right,bottom:ot.bottom,width:ot.width,height:ot.height}}function g2(ot){let st=[],ct,{POSITIVE_INFINITY:gt,POSITIVE_INFINITY:bt,NEGATIVE_INFINITY:yt,NEGATIVE_INFINITY:vt}=Number;for(let xt of Array.from(ot).sort((wt,Ct)=>wt.top-Ct.top)){if(gt=Math.min(gt,xt.left),bt=Math.min(bt,xt.top),yt=Math.max(yt,xt.right),vt=Math.max(vt,xt.bottom),!ct||xt.top-ct.top>ct.height/2)st.push(eee(xt));else{let wt=st[st.length-1];wt.left=Math.min(wt.left,xt.left),wt.right=Math.max(wt.right,xt.right),wt.bottom=Math.max(wt.bottom,xt.bottom),wt.width=wt.right-wt.left,wt.height=wt.bottom-wt.top}ct=xt}return{lines:st,fallback:y0(gt,bt,yt,vt)}}function h2(ot,st,ct){return ot.findIndex((gt)=>st>gt.left-2&&st<gt.right+2&&ct>gt.top-2&&ct<gt.bottom+2)}function m2(ot){return y0(ot.left,ot.top,ot.right,ot.bottom)}function tee(ot,st,ct){let{lines:gt}=g2(ot.getClientRects());if(gt.length<2)return;let bt=h2(gt,st,ct);return{x:st,y:ct,lineIndex:bt===-1?void 0:bt,element:ot}}function nee(ot,st,ct){let{lines:gt,fallback:bt}=g2(ot.getClientRects());if(gt.length<2)return null;let yt=ct?.x,vt=ct?.y,xt=st[0];if(ct?.lineIndex!=null&&gt[ct.lineIndex])return m2(gt[ct.lineIndex]);if(yt!=null&&vt!=null){let Tt=h2(gt,yt,vt);if(Tt!==-1)return m2(gt[Tt])}if(gt.length===2&&gt[0].left>gt[1].right&&yt!=null&&vt!=null)return bt;if(xt==="t"||xt==="b"){let Tt=gt[0],Pt=gt[gt.length-1],Mt=xt==="t"?Tt:Pt;return y0(Mt.left,Tt.top,Mt.right,Pt.bottom)}let wt=xt==="l",Ct=gt[0].left,St=gt[0].right,Et=wt?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,kt=gt[0],Rt=gt[0];for(let Tt of gt){Ct=Math.min(Ct,Tt.left),St=Math.max(St,Tt.right);let Pt=wt?Tt.left:Tt.right;if(wt&&Pt<Et||!wt&&Pt>Et)Et=Pt,kt=Tt,Rt=Tt;else if(Pt===Et)Rt=Tt}return y0(Ct,kt.top,St,Rt.bottom)}function ree(ot){if("contextElement"in ot&&ot.contextElement)return ot.contextElement;return f(ot)?ot:void 0}function b2(ot,st){function ct(bt){hk(ot,bt.currentTarget,bt.clientX,bt.clientY)}function gt(bt){if(!st)ct(bt)}return{onFocus(){ot.current=void 0},onMouseEnter:gt,onMouseMove:gt}}function hk(ot,st,ct,gt){let bt=tee(st,ct,gt);return ot.current=bt,bt}function y2(ot){return{name:"inline",async fn(st){let ct=st.elements.reference;if(typeof ct?.getClientRects!=="function")return{};let gt=ree(ct),bt=ot.current,yt=bt?.element===ct||bt?.element===gt?bt:void 0,vt=nee(ct,st.placement,yt);if(!vt||typeof st.platform.getElementRects!=="function")return{};let xt=await st.platform.getElementRects({reference:{contextElement:gt,getBoundingClientRect(){return vt}},floating:st.elements.floating,strategy:st.strategy});if(st.rects.reference.x===xt.reference.x&&st.rects.reference.y===xt.reference.y&&st.rects.reference.width===xt.reference.width&&st.rects.reference.height===xt.reference.height)return{};return{reset:{rects:xt}}}}}var yk=e(t(),1),w2=e(_(),1);var v2=e(t(),1);var oee={open:(ot)=>ot.open,transitionStatus:(ot)=>ot.transitionStatus,domReferenceElement:(ot)=>ot.domReferenceElement,referenceElement:(ot)=>ot.positionReference??ot.referenceElement,floatingElement:(ot)=>ot.floatingElement,floatingId:(ot)=>ot.floatingId};class Qg extends Gi{constructor(ot){let{syncOnly:st,nested:ct,onOpenChange:gt,triggerElements:bt,...yt}=ot;super({...yt,positionReference:yt.referenceElement,domReferenceElement:yt.referenceElement},{onOpenChange:gt,dataRef:{current:{}},events:b0(),nested:ct,triggerElements:bt},oee);this.syncOnly=st}syncOpenEvent=(ot,st)=>{if(!ot||!this.state.open||st!=null&&WD(st))this.context.dataRef.current.openEvent=ot?st:void 0};dispatchOpenChange=(ot,st)=>{this.syncOpenEvent(ot,st.event);let ct={open:ot,reason:st.reason,nativeEvent:st.event,nested:this.context.nested,triggerElement:st.trigger};this.context.events.emit("openchange",ct)};setOpen=(ot,st)=>{if(this.syncOnly){this.context.onOpenChange?.(ot,st);return}this.dispatchOpenChange(ot,st),this.context.onOpenChange?.(ot,st)}}function Jg(ot){let{popupStore:st,treatPopupAsFloatingElement:ct=!1,floatingRootContext:gt,floatingId:bt,nested:yt,onOpenChange:vt}=ot,xt=st.useState("open"),wt=st.useState("activeTriggerElement"),Ct=st.useState(ct?"popupElement":"positionerElement"),St=st.context.triggerElements,Et=vt,kt=v2.useRef(null);if(gt===void 0&&kt.current===null)kt.current=new Qg({open:xt,transitionStatus:void 0,referenceElement:wt,floatingElement:Ct,triggerElements:St,onOpenChange:Et,floatingId:bt,syncOnly:!0,nested:yt});let Rt=gt??kt.current;return st.useSyncedValue("floatingId",bt),i(()=>{let Tt={open:xt,floatingId:bt,referenceElement:wt,floatingElement:Ct};if(f(wt))Tt.domReferenceElement=wt;if(Rt.state.positionReference===Rt.state.referenceElement)Tt.positionReference=wt;Rt.update(Tt)},[xt,bt,wt,Ct,Rt]),Rt.context.onOpenChange=Et,Rt.context.nested=yt,Rt}var bk=e(t(),1);function Xs(ot,st=!1,ct=!1,gt=!1){let[bt,yt]=bk.useState(ot&&st?"idle":void 0),[vt,xt]=bk.useState(ot&&!gt);if(ot&&!vt)xt(!0),yt("starting");if(!ot&&vt&&bt!=="ending"&&!ct)yt("ending");if(!ot&&!vt&&bt==="ending")yt(void 0);return i(()=>{if(!ot&&vt&&bt!=="ending"&&ct){let wt=xi.request(()=>{yt("ending")});return()=>{xi.cancel(wt)}}return},[ot,vt,bt,ct]),i(()=>{if(!ot||st)return;let wt=xi.request(()=>{yt(void 0)});return()=>{xi.cancel(wt)}},[st,ot]),i(()=>{if(!ot||!st)return;if(ot&&vt&&bt!=="idle")yt("starting");let wt=xi.request(()=>{yt("idle")});return()=>{xi.cancel(wt)}},[st,ot,vt,bt]),{mounted:vt,setMounted:xt,transitionStatus:bt}}var Ya={tabIndex:-1,[Mg]:""};function v0(ot){return(st)=>st==="touch"?ot.current:!0}function jc(ot,st=!1){let ct=Ts(),gt=Ps()!=null,bt=I(()=>ot(ct,gt)).current;return Jg({popupStore:bt,treatPopupAsFloatingElement:st,floatingRootContext:bt.state.floatingRootContext,floatingId:ct,nested:gt,onOpenChange:bt.setOpen}),bt}function Za({handle:ot,store:st}){return i(()=>ot.attachStore(st),[ot,st]),null}function x2(ot){let st=ot.context.triggerElements.size;if(ot.select("open")&&ot.state.triggerCount!==st)ot.set("triggerCount",st)}function iee(ot,st){let ct=yk.useRef(null);return s((gt)=>{let bt=ct.current;if(bt!==null){if(bt.element===gt&&bt.store===st&&bt.id===ot)return;ct.current=null;let yt=bt.store;if(yt.context.triggerElements.getById(bt.id)===bt.element)yt.context.triggerElements.delete(bt.id),x2(yt)}if(gt!==null&&ot!==void 0)ct.current={store:st,id:ot,element:gt},st.context.triggerElements.add(ot,gt),x2(st)})}function Bp(ot,st,ct,gt=!1){let bt=ot.preventUnmountingOnClose;if(st)bt=!1;else if(gt)bt=!0;let yt=ct?.id??null,{activeTriggerId:vt,activeTriggerElement:xt}=ot;if(yt||st)vt=yt,xt=ct??null;return{open:st,preventUnmountingOnClose:bt,activeTriggerId:vt,activeTriggerElement:xt}}function Xg(ot){let st=!1;return ot.preventUnmountOnClose=()=>{st=!0},()=>st}function x0(ot,st,ct,gt={}){let bt=ct.reason,yt=bt===Ao,vt=st&&bt===sf,xt=!st&&(bt===Xa||bt===Ug),wt=Xg(ct);if(ot.context.onOpenChange?.(st,ct),ct.isCanceled)return;gt.onBeforeDispatch?.(),ot.state.floatingRootContext.dispatchOpenChange(st,ct);let Ct=()=>{let St=Bp(ot.state,st,ct.trigger,wt()),Et={...gt.extraState,...St};if(vt)Et.instantType="focus";else if(xt)Et.instantType="dismiss";else if(yt)Et.instantType=void 0;ot.update(Et)};if(yt)w2.flushSync(Ct);else Ct()}function el(ot,st,ct,gt){let bt=ct.useState("isMountedByTrigger",ot),yt=iee(ot,ct),vt=s((wt)=>{let Ct=ct.select("open"),St=ct.select("activeTriggerId");if(St===ot){let Et={activeTriggerElement:wt,...Ct?gt:null};ct.update(Et);return}if(St==null&&Ct){let Et={activeTriggerId:ot??null,activeTriggerElement:wt,...gt};ct.update(Et)}}),xt=s((wt)=>{if(yt(wt),wt)vt(wt)});return i(()=>(xt(st.current),()=>xt(null)),[xt,st,ct,ot]),i(()=>{if(bt){let wt={activeTriggerElement:st.current,...gt};ct.update(wt)}},[bt,ct,st,...Object.values(gt)]),{registerTrigger:xt,isMountedByThisTrigger:bt}}function tl(ot,st={}){let{closeOnActiveTriggerUnmount:ct=!1}=st,gt=yk.useRef(null),bt=ot.useState("open"),yt=ot.useState("triggerCount"),vt=ot.useState("activeTriggerId"),xt=ot.useState("activeTriggerElement");i(()=>{if(!bt){if(gt.current=null,ot.state.triggerCount!==0)ot.set("triggerCount",0);return}let wt=ot.context.triggerElements.size,Ct={};if(ot.state.triggerCount!==wt)Ct.triggerCount=wt;let St=ot.select("activeTriggerId"),Et=null;if(St){let kt=ot.context.triggerElements.getById(St);if(!kt){for(let[Rt,Tt]of ot.context.triggerElements.entries())if(Tt===ot.state.activeTriggerElement){Ct.activeTriggerId=Rt,Ct.activeTriggerElement=Tt,gt.current=Rt;break}if(Ct.activeTriggerId===void 0)if(gt.current===St)Et=St;else gt.current=null}else if(gt.current=St,kt!==ot.state.activeTriggerElement)Ct.activeTriggerElement=kt}else gt.current=null;if(!Et&&!St&&wt===1){let kt=ot.context.triggerElements.entries().next();if(!kt.done){let[Rt,Tt]=kt.value;Ct.activeTriggerId=Rt,Ct.activeTriggerElement=Tt,gt.current=Rt}}if(Ct.triggerCount!==void 0||Ct.activeTriggerId!==void 0||Ct.activeTriggerElement!==void 0)ot.update(Ct);if(Et){if(ct)queueMicrotask(()=>{if(ot.select("open")&&ot.select("activeTriggerId")===Et&&!ot.context.triggerElements.getById(Et)){let kt=Ln(ec);if(ot.setOpen(!1,kt),!kt.isCanceled)ot.update({activeTriggerId:null,activeTriggerElement:null})}})}},[bt,ot,yt,vt,xt,ct])}function nl(ot,st,ct,gt){let{mounted:bt,setMounted:yt,transitionStatus:vt}=Xs(ot,!1,!1,gt),xt=st.useState("preventUnmountingOnClose"),wt=ot?!1:xt;st.useSyncedValues({mounted:bt,transitionStatus:vt,preventUnmountingOnClose:wt});let Ct=s(()=>{yt(!1),st.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),ct?.(),st.context.onOpenChangeComplete?.(!1)});return Ro({enabled:bt&&!ot&&!wt,open:ot,ref:st.context.popupRef,onComplete(){if(!ot)Ct()}}),{forceUnmount:Ct,transitionStatus:vt}}function rl(ot,st){ot.useSyncedValues(st),i(()=>()=>{ot.update({activeTriggerProps:g,inactiveTriggerProps:g,popupProps:g})},[ot])}function w0(ot,st){i(()=>{if(!st&&ot.state.openMethod!==null)ot.set("openMethod",null)},[st,ot]),i(()=>()=>{if(ot.state.openMethod!==null)ot.set("openMethod",null)},[ot])}class Ta{constructor(){this.idMap=new Map}add(ot,st){this.idMap.set(ot,st)}delete(ot){this.idMap.delete(ot)}hasElement(ot){for(let st of this.idMap.values())if(st===ot)return!0;return!1}hasMatchingElement(ot){for(let st of this.idMap.values())if(ot(st))return!0;return!1}getById(ot){return this.idMap.get(ot)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function ol(ot,st,ct=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Qg({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:ot,floatingId:st,syncOnly:!0,nested:ct,onOpenChange:void 0}),floatingId:st,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:g,inactiveTriggerProps:g,popupProps:g}}var Yg=(ot)=>ot.triggerIdProp??ot.activeTriggerId,vk=(ot)=>ot.openProp??ot.open,C2=(ot)=>(ot.popupElement?.id??ot.floatingId)||void 0;function S2(ot,st){return st!==void 0&&vk(ot)&&Yg(ot)===st}function see(ot,st){if(S2(ot,st))return!0;return st!==void 0&&vk(ot)&&Yg(ot)==null&&ot.triggerCount===1}var il={open:vk,mounted:(ot)=>ot.mounted,transitionStatus:(ot)=>ot.transitionStatus,floatingRootContext:(ot)=>ot.floatingRootContext,triggerCount:(ot)=>ot.triggerCount,preventUnmountingOnClose:(ot)=>ot.preventUnmountingOnClose,payload:(ot)=>ot.payload,activeTriggerId:Yg,activeTriggerElement:(ot)=>ot.mounted?ot.activeTriggerElement:null,popupId:C2,isTriggerActive:(ot,st)=>st!==void 0&&Yg(ot)===st,isOpenedByTrigger:(ot,st)=>S2(ot,st),isMountedByTrigger:(ot,st)=>st!==void 0&&Yg(ot)===st&&ot.mounted,triggerProps:(ot,st)=>st?ot.activeTriggerProps:ot.inactiveTriggerProps,triggerPopupId:(ot,st)=>see(ot,st)?C2(ot):void 0,popupProps:(ot)=>ot.popupProps,popupElement:(ot)=>ot.popupElement,positionerElement:(ot)=>ot.positionerElement};var xk=e(t(),1),E2=e(Jd(),1);function sl(ot){let st=xk.useCallback((gt)=>{if(ot===void 0)return w;return ot.subscribeStore(gt)},[ot]),ct=xk.useCallback(()=>ot===void 0?void 0:ot.store,[ot]);return E2.useSyncExternalStore(st,ct,()=>ot?.serverStore)}var al=e(t(),1);var wk=Ql.mac&&Oc.webkit;function Fp(ot,st={}){let{enabled:ct=!0,delay:gt}=st,bt="rootStore"in ot?ot.rootStore:ot,{events:yt,dataRef:vt}=bt.context,xt=al.useRef(!1),wt=al.useRef(null),Ct=al.useRef(!0),St=Xr();al.useEffect(()=>{let kt=bt.select("domReferenceElement");if(!ct)return;let Rt=m(kt);function Tt(){let It=bt.select("domReferenceElement");if(!bt.select("open")&&y(It)&&It===Kr(d(It)))xt.current=!0,wt.current=It}function Pt(){Ct.current=!0}function Mt(){Ct.current=!1}return di(Xn(Rt,"blur",Tt),wk&&Xn(Rt,"keydown",Pt,!0),wk&&Xn(Rt,"pointerdown",Mt,!0))},[bt,ct]),al.useEffect(()=>{if(!ct)return;function kt(Rt){if(Rt.reason===Xa||Rt.reason===Ug){let Tt=bt.select("domReferenceElement");if(f(Tt))wt.current=Tt,xt.current=!0}}return yt.on("openchange",kt),()=>{yt.off("openchange",kt)}},[yt,ct,bt]);let Et=al.useMemo(()=>{function kt(){xt.current=!1,wt.current=null}return{onMouseLeave(){kt()},onFocus(Rt){let Tt=Rt.currentTarget;if(xt.current){if(wt.current===Tt)return;kt()}let Pt=xr(Rt.nativeEvent);if(f(Pt)){if(wk&&!Rt.relatedTarget){if(!Ct.current&&!kp(Pt))return}else if(!Ga(Pt))return}let Mt=Bc(Rt.relatedTarget,bt.context.triggerElements),{nativeEvent:It,currentTarget:At}=Rt,Nt=typeof gt==="function"?gt():gt;if(bt.select("open")&&Mt||Nt===0||Nt===void 0){bt.setOpen(!0,Ln(sf,It,At));return}St.start(Nt,()=>{if(xt.current)return;bt.setOpen(!0,Ln(sf,It,At))})},onBlur(Rt){kt();let{relatedTarget:Tt,nativeEvent:Pt}=Rt,Mt=f(Tt)&&Tt.hasAttribute(tc("focus-guard"))&&Tt.getAttribute("data-type")==="outside";St.start(0,()=>{let It=bt.select("domReferenceElement"),At=Kr(d(It));if(!Tt&&At===It)return;if(On(vt.current.floatingContext?.refs.floating.current,At)||On(It,At)||Mt)return;if(Bc(Tt??At,bt.context.triggerElements))return;bt.setOpen(!1,Ln(sf,Pt))})}}},[vt,gt,bt,St]);return al.useMemo(()=>ct?{reference:Et,trigger:Et}:{},[ct,Et])}var Sk=e(t(),1);class Ck{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Ho,this.restTimeout=new Ho,this.handleCloseOptions=void 0}static create(){return new Ck}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}var C0=new WeakMap;function cf(ot){if(!ot.performedPointerEventsMutation)return;let st=ot.pointerEventsScopeElement;if(st&&C0.get(st)===ot)ot.pointerEventsScopeElement?.style.removeProperty("pointer-events"),ot.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),ot.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),C0.delete(st);ot.performedPointerEventsMutation=!1,ot.pointerEventsScopeElement=null,ot.pointerEventsReferenceElement=null,ot.pointerEventsFloatingElement=null}function S0(ot,st){let{scopeElement:ct,referenceElement:gt,floatingElement:bt}=st,yt=C0.get(ct);if(yt&&yt!==ot)cf(yt);cf(ot),ot.performedPointerEventsMutation=!0,ot.pointerEventsScopeElement=ct,ot.pointerEventsReferenceElement=gt,ot.pointerEventsFloatingElement=bt,C0.set(ct,ot),ct.style.pointerEvents="none",gt.style.pointerEvents="auto",bt.style.pointerEvents="auto"}function uf(ot){let st=ot.context.dataRef.current,ct=I(()=>st.hoverInteractionState??Ck.create()).current;if(!st.hoverInteractionState)st.hoverInteractionState=ct;return Nc(st.hoverInteractionState.disposeEffect),st.hoverInteractionState}function rc(ot,st={}){let{enabled:ct=!0,closeDelay:gt=0,nodeId:bt}=st,yt="rootStore"in ot?ot.rootStore:ot,vt=yt.useState("open"),xt=yt.useState("floatingElement"),wt=yt.useState("domReferenceElement"),{dataRef:Ct}=yt.context,St=Ni(),Et=Ps(),kt=uf(yt),Rt=Xr(),Tt=s(()=>g0(Ct.current.openEvent?.type,kt.interactedInside)),Pt=s(()=>Z_(Ct.current.openEvent?.type)),Mt=s(()=>{cf(kt)});i(()=>{if(!vt)kt.pointerType=void 0,kt.restTimeoutPending=!1,kt.interactedInside=!1,Mt()},[vt,kt,Mt]),Sk.useEffect(()=>Mt,[Mt]),i(()=>{if(!ct)return;if(vt&&kt.handleCloseOptions?.blockPointerEvents&&Pt()&&f(wt)&&xt){let It=wt,At=xt,Nt=d(xt),Ot=St?.nodesRef.current.find((Ft)=>Ft.id===Et)?.context?.elements.floating;if(Ot)Ot.style.pointerEvents="";let Dt=kt.pointerEventsScopeElement!==At?kt.pointerEventsScopeElement:null,_t=Ot!==At?Ot:null,$t=kt.handleCloseOptions?.getScope?.()??Dt??_t??It.closest("[data-rootownerid]")??Nt.body;return S0(kt,{scopeElement:$t,referenceElement:It,floatingElement:At}),()=>{Mt()}}return},[ct,vt,wt,xt,kt,Pt,St,Et,Mt]),Sk.useEffect(()=>{if(!ct)return;function It(){return!!(St&&Et&&Ks(St.nodesRef.current,Et).length>0)}function At(Ft){let Bt=ka(gt,"close",kt.pointerType),Lt=()=>{yt.setOpen(!1,Ln(Ao,Ft)),St?.events.emit("floating.closed",Ft)};if(Bt)kt.openChangeTimeout.start(Bt,Lt);else kt.openChangeTimeout.clear(),Lt()}function Nt(Ft){let Bt=xr(Ft);if(!jE(Bt)){kt.interactedInside=!1;return}kt.interactedInside=Bt?.closest("[aria-haspopup]")!=null}function Ot(){kt.openChangeTimeout.clear(),Rt.clear(),St?.events.off("floating.closed",_t),Mt()}function Dt(Ft){if(It()&&St){St.events.on("floating.closed",_t);return}if(Bc(Ft.relatedTarget,yt.context.triggerElements))return;let Bt=Ct.current.floatingContext?.nodeId??bt,Lt=Ft.relatedTarget;if(St&&Bt&&f(Lt)&&Ks(St.nodesRef.current,Bt,!1).some((Wt)=>On(Wt.context?.elements.floating,Lt)))return;if(kt.handler){kt.handler(Ft);return}if(Mt(),Pt()&&!Tt())At(Ft)}function _t(Ft){if(!St||!Et||It())return;Rt.start(0,()=>{St.events.off("floating.closed",_t),yt.setOpen(!1,Ln(Ao,Ft)),St.events.emit("floating.closed",Ft)})}let $t=xt;return di($t&&Xn($t,"mouseenter",Ot),$t&&Xn($t,"mouseleave",Dt),$t&&Xn($t,"pointerdown",Nt,!0),()=>{St?.events.off("floating.closed",_t)})},[ct,xt,yt,Ct,gt,bt,Pt,Tt,Mt,kt,St,Et,Rt])}var Vc=e(t(),1),k2=e(_(),1);var aee={current:null};function oc(ot,st={}){let{enabled:ct=!0,delay:gt=0,handleClose:bt=null,mouseOnly:yt=!1,restMs:vt=0,move:xt=!0,triggerElementRef:wt=aee,externalTree:Ct,isActiveTrigger:St=!0,getHandleCloseContext:Et,isClosing:kt,shouldOpen:Rt,guardStaleOpen:Tt=!1}=st,Pt="rootStore"in ot?ot.rootStore:ot,{dataRef:Mt,events:It}=Pt.context,At=Ni(Ct),Nt=uf(Pt),Ot=Vc.useRef(!1),Dt=io(bt),_t=io(gt),$t=io(vt),Ft=io(ct),Bt=io(Rt),Lt=io(kt),Vt=s(()=>g0(Mt.current.openEvent?.type,Nt.interactedInside)),Wt=s(()=>Bt.current?.()!==!1),Ut=s((jt,qt,Qt)=>{let Xt=Pt.context.triggerElements;if(Xt.hasElement(qt))return!jt||!On(jt,qt);if(!f(Qt))return!1;let zt=Qt;return Xt.hasMatchingElement((tn)=>On(tn,zt))&&(!jt||!On(jt,zt))}),Ht=s(()=>{if(!Nt.handler)return;d(Pt.select("domReferenceElement")).removeEventListener("mousemove",Nt.handler),Nt.handler=void 0}),Gt=s(()=>{cf(Nt)});if(St)Nt.handleCloseOptions=bt?.__options;return Vc.useEffect(()=>Ht,[Ht]),Vc.useEffect(()=>{if(!ct)return;function jt(qt){if(!qt.open)Ot.current=qt.reason===Ao,Ht(),Nt.openChangeTimeout.clear(),Nt.restTimeout.clear(),Nt.blockMouseMove=!0,Nt.restTimeoutPending=!1;else Ot.current=!1}return It.on("openchange",jt),()=>{It.off("openchange",jt)}},[ct,It,Nt,Ht]),Vc.useEffect(()=>{if(!ct)return;function jt(rn,Kt=!0){let an=ka(_t.current,"close",Nt.pointerType);if(an)Nt.openChangeTimeout.start(an,()=>{Pt.setOpen(!1,Ln(Ao,rn)),At?.events.emit("floating.closed",rn)});else if(Kt)Nt.openChangeTimeout.clear(),Pt.setOpen(!1,Ln(Ao,rn)),At?.events.emit("floating.closed",rn)}let qt=wt.current??(St?Pt.select("domReferenceElement"):null);if(!f(qt))return;function Qt(rn){if(Nt.openChangeTimeout.clear(),Nt.blockMouseMove=!1,yt&&!Rs(Nt.pointerType))return;let Kt=sk($t.current),an=ka(_t.current,"open",Nt.pointerType),ln=xr(rn),Zt=rn.currentTarget??null,on=Pt.select("domReferenceElement"),sn=Zt;if(f(ln)&&!Pt.context.triggerElements.hasElement(ln)){for(let nn of Pt.context.triggerElements.elements())if(On(nn,ln)){sn=nn;break}}if(f(Zt)&&f(on)&&!Pt.context.triggerElements.hasElement(Zt)&&On(Zt,on))sn=on;let dn=sn==null?!1:Ut(on,sn,ln),fn=Pt.select("open"),bn=Lt.current?.()??Pt.select("transitionStatus")==="ending",hn=!fn&&bn&&Ot.current,gn=!dn&&f(sn)&&f(on)&&On(on,sn)&&hn,xn=Kt>0&&!an,wn=dn&&(fn||hn)||gn,yn=!fn||dn;if(wn){if(Wt())Pt.setOpen(!0,Ln(Ao,rn,sn));return}if(xn)return;if(an)Nt.openChangeTimeout.start(an,()=>{if(yn&&Wt())Pt.setOpen(!0,Ln(Ao,rn,sn))});else if(yn){if(Wt())Pt.setOpen(!0,Ln(Ao,rn,sn))}}function Xt(rn){if(Vt()){Gt();return}Ht();let Kt=Pt.select("domReferenceElement"),an=d(Kt);Nt.restTimeout.clear(),Nt.restTimeoutPending=!1;let ln=Mt.current.floatingContext??Et?.();if(Bc(rn.relatedTarget,Pt.context.triggerElements))return;if(Dt.current&&ln){if(!Pt.select("open"))Nt.openChangeTimeout.clear();let on=wt.current;Nt.handler=Dt.current({...ln,tree:At,x:rn.clientX,y:rn.clientY,onClose(){if(Gt(),Ht(),Ft.current&&!Vt()&&on===Pt.select("domReferenceElement"))jt(rn,!0)}}),an.addEventListener("mousemove",Nt.handler),Nt.handler(rn);return}if(Nt.pointerType==="touch"?!On(Pt.select("floatingElement"),rn.relatedTarget):!0)jt(rn)}function zt(rn){if(On(qt,rn.relatedTarget))return;Nt.openChangeTimeout.clear(),Nt.restTimeout.clear(),Nt.restTimeoutPending=!1}let tn=Tt?Xn(qt,"mouseout",zt):void 0;if(xt)return di(Xn(qt,"mousemove",Qt,{once:!0}),Xn(qt,"mouseenter",Qt),Xn(qt,"mouseleave",Xt),tn);return di(Xn(qt,"mouseenter",Qt),Xn(qt,"mouseleave",Xt),tn)},[Ht,Gt,Mt,_t,Pt,ct,Dt,Nt,St,Ut,Vt,yt,xt,$t,wt,At,Ft,Et,Lt,Wt,Tt]),Vc.useMemo(()=>{if(!ct)return;function jt(qt){Nt.pointerType=qt.pointerType}return{onPointerDown:jt,onPointerEnter:jt,onMouseMove(qt){let{nativeEvent:Qt}=qt,Xt=qt.currentTarget,zt=Pt.select("domReferenceElement"),tn=Pt.select("open"),rn=Ut(zt,Xt,qt.target);if(yt&&!Rs(Nt.pointerType))return;if(tn&&rn&&Nt.handleCloseOptions?.blockPointerEvents){let ln=Pt.select("floatingElement");if(ln){let Zt=Nt.handleCloseOptions?.getScope?.()??Xt.ownerDocument.body;S0(Nt,{scopeElement:Zt,referenceElement:Xt,floatingElement:ln})}}let Kt=sk($t.current);if(tn&&!rn||Kt===0)return;if(!rn&&Nt.restTimeoutPending&&qt.movementX**2+qt.movementY**2<2)return;Nt.restTimeout.clear();function an(){if(Nt.restTimeoutPending=!1,Vt())return;let ln=Pt.select("open");if(!Nt.blockMouseMove&&(!ln||rn)&&Wt())Pt.setOpen(!0,Ln(Ao,Qt,Xt))}if(Nt.pointerType==="touch")k2.flushSync(()=>{an()});else if(rn&&tn)an();else Nt.restTimeoutPending=!0,Nt.restTimeout.start(Kt,an)}}},[ct,Nt,Vt,Ut,yt,Pt,$t,Wt])}var wi=e(t(),1);var lee="Escape";function R2(ot){return Oc.webkit&&ot.movementX===0&&ot.movementY===0}function k0(ot,st,ct){switch(ot){case"vertical":return st;case"horizontal":return ct;default:return st||ct}}function E0(ot,st){return k0(st,ot===$E||ot===Uy,ot===Ag||ot===Ng)}function Ek(ot,st,ct){return k0(st,ot===Uy,ct?ot===Ag:ot===Ng)||ot==="Enter"||ot===" "||ot===""}function cee(ot,st,ct){return k0(st,ct?ot===Ag:ot===Ng,ot===Uy)}function uee(ot,st,ct,gt){let bt=ct?ot===Ng:ot===Ag,yt=ot===$E;if(st==="both"||st==="horizontal"&&gt)return ot===lee;return k0(st,bt,yt)}function kk(ot,st){let{listRef:ct,activeIndex:gt,onNavigate:bt=()=>{},enabled:yt=!0,selectedIndex:vt=null,allowEscape:xt=!1,loopFocus:wt=!1,nested:Ct=!1,rtl:St=!1,virtual:Et=!1,focusItemOnOpen:kt="auto",focusItemOnHover:Rt=!0,openOnArrowKeyDown:Tt=!0,disabledIndices:Pt=void 0,orientation:Mt="vertical",parentOrientation:It,id:At,resetOnPointerLeave:Nt=!0,externalTree:Ot,grid:Dt}=st,_t=Dt!=null,$t="rootStore"in ot?ot.rootStore:ot,Ft=$t.useState("open"),Bt=$t.useState("floatingElement"),Lt=$t.useState("domReferenceElement"),Vt=$t.context.dataRef,Wt=Bg(Bt),Ut=Lg(Lt),Ht=io(Wt),Gt=Ps(),jt=Ni(Ot),qt=wi.useRef(kt),Qt=wi.useRef(vt??-1),Xt=wi.useRef(null),zt=wi.useRef(!0),tn=s((Cn)=>{bt(Qt.current===-1?null:Qt.current,Cn)}),rn=wi.useRef(!!Bt),Kt=wi.useRef(Ft),an=wi.useRef(!1),ln=wi.useRef(!1),Zt=wi.useRef(null),on=io(Pt),sn=io(Ft),dn=io(vt),fn=io(Nt),bn=xa(),hn=xa(),gn=s(()=>{function Cn(un){if(Et)jt?.events.emit("virtualfocus",un);else Zt.current=lf(un,{sync:an.current,preventScroll:!0})}let kn=ct.current[Qt.current],Jt=ln.current;if(kn)Cn(kn);(an.current?(un)=>un():(un)=>bn.request(un))(()=>{let un=ct.current[Qt.current]||kn;if(!un)return;if(!kn)Cn(un);if(pn&&(Jt||!zt.current))un.scrollIntoView?.({block:"nearest",inline:"nearest"})})});i(()=>{Vt.current.orientation=Mt},[Vt,Mt]),i(()=>{if(!yt)return;if(Ft&&Bt){if(Qt.current=vt??-1,qt.current&&vt!=null)ln.current=!0,tn()}else if(rn.current)Qt.current=-1,tn()},[yt,Ft,Bt,vt,tn]),i(()=>{if(!yt)return;if(!Ft){an.current=!1;return}if(!Bt)return;if(gt==null){if(an.current=!1,dn.current!=null)return;if(rn.current)Qt.current=-1,gn();if((!Kt.current||!rn.current)&&qt.current&&(Xt.current!=null||qt.current===!0&&Xt.current==null)){let Cn=0,kn=()=>{if(ct.current[0]==null){if(Cn<2)(Cn?(Yt)=>hn.request(Yt):queueMicrotask)(kn);Cn+=1}else Qt.current=Xt.current==null||Ek(Xt.current,Mt,St)||Ct?Tp(ct):tf(ct),Xt.current=null,tn()};kn()}}else if(!Hc(ct.current,gt))Qt.current=gt,gn(),ln.current=!1},[yt,Ft,Bt,gt,dn,Ct,ct,Mt,St,tn,gn,hn]),i(()=>{if(!yt||Bt||!jt||Et||!rn.current)return;let Cn=jt.nodesRef.current,kn=Cn.find((un)=>un.id===Gt)?.context?.elements.floating,Jt=Kr(d(Lt??kn??null)),Yt=Cn.some((un)=>un.context&&On(un.context.elements.floating,Jt));if(kn&&!Yt&&zt.current)kn.focus({preventScroll:!0})},[yt,Bt,Lt,jt,Gt,Et]),i(()=>{Kt.current=Ft,rn.current=!!Bt}),i(()=>{if(!Ft)Xt.current=null,qt.current=kt},[Ft,kt]);let xn=gt!=null,wn=s((Cn)=>{if(!sn.current)return;let kn=ct.current.indexOf(Cn.currentTarget);if(kn!==-1&&(Qt.current!==kn||gt!==kn))Qt.current=kn,tn(Cn)}),yn=s(()=>It??jt?.nodesRef.current.find((Cn)=>Cn.id===Gt)?.context?.dataRef?.current.orientation),nn=s(()=>Tp(ct,on.current)),en=s((Cn)=>{if(zt.current=!1,an.current=!0,Cn.which===229)return;if(!sn.current&&Cn.currentTarget===Ht.current)return;if(Ct&&uee(Cn.key,Mt,St,_t)){if(!E0(Cn.key,yn()))ss(Cn);if($t.setOpen(!1,Ln(rk,Cn.nativeEvent)),y(Lt))if(Et)jt?.events.emit("virtualfocus",Lt);else Lt.focus();return}let kn=Qt.current,Jt=Tp(ct,Pt),Yt=tf(ct,Pt);if(!Ut){if(Cn.key==="Home")ss(Cn),Qt.current=Jt,tn(Cn);if(Cn.key==="End")ss(Cn),Qt.current=Yt,tn(Cn)}if(Dt!=null){let un=Dt(Cn,Qt.current,ct,Mt,wt,St,Pt,Jt,Yt);if(un!=null)Qt.current=un,tn(Cn);if(Mt==="both")return}if(E0(Cn.key,Mt)){if(ss(Cn),Ft&&!Et&&Kr(Cn.currentTarget.ownerDocument)===Cn.currentTarget){Qt.current=Ek(Cn.key,Mt,St)?Jt:Yt,tn(Cn);return}if(Ek(Cn.key,Mt,St))if(wt)if(kn>=Yt)if(xt&&kn!==ct.current.length)Qt.current=-1;else an.current=!1,Qt.current=Jt;else Qt.current=Qs(ct.current,{startingIndex:kn,disabledIndices:Pt});else Qt.current=Math.min(Yt,Qs(ct.current,{startingIndex:kn,disabledIndices:Pt}));else if(wt)if(kn<=Jt)if(xt&&kn!==-1)Qt.current=ct.current.length;else an.current=!1,Qt.current=Yt;else Qt.current=Qs(ct.current,{startingIndex:kn,decrement:!0,disabledIndices:Pt});else Qt.current=Math.max(Jt,Qs(ct.current,{startingIndex:kn,decrement:!0,disabledIndices:Pt}));if(Hc(ct.current,Qt.current))Qt.current=-1;tn(Cn)}}),pn=wi.useMemo(()=>({onFocus(kn){an.current=!0,wn(kn)},onClick:({currentTarget:kn})=>kn.focus({preventScroll:!0}),onMouseMove(kn){if(R2(kn))return;if(an.current=!0,ln.current=!1,Rt)wn(kn)},onPointerLeave(kn){if(!sn.current||!zt.current||kn.pointerType==="touch")return;an.current=!0;let Jt=kn.relatedTarget;if(!Rt||ct.current.includes(Jt))return;if(!fn.current)return;if(Zt.current?.(),Zt.current=null,Qt.current=-1,tn(kn),!Et){let Yt=Ht.current,un=Kr(d(Yt));if(Yt&&On(Yt,un))Yt.focus({preventScroll:!0})}}}),[wn,sn,Ht,Rt,ct,tn,fn,Et]),cn=wi.useMemo(()=>Et&&Ft&&xn&&{"aria-activedescendant":`${At}-${gt}`},[Et,Ft,xn,At,gt]),mn=wi.useMemo(()=>({...!Ut?cn:{},onKeyDown(Cn){if(Cn.key==="Tab"&&Cn.shiftKey&&Ft&&!Et){let kn=xr(Cn.nativeEvent);if(kn&&!On(Ht.current,kn))return;if(ss(Cn),$t.setOpen(!1,Ln(Ip,Cn.nativeEvent)),y(Lt))Lt.focus();return}en(Cn)},onPointerMove(Cn){if(R2(Cn))return;zt.current=!0}}),[cn,en,Ht,Ut,$t,Ft,Et,Lt]),Pn=wi.useMemo(()=>{function Cn(Yt){$t.setOpen(!0,Ln(rk,Yt.nativeEvent,Yt.currentTarget))}function kn(Yt){if(kt==="auto"&&Zd(Yt.nativeEvent))qt.current=!Et}function Jt(Yt){if(qt.current=kt,kt==="auto"&&ef(Yt.nativeEvent))qt.current=!0}return{onKeyDown(Yt){let un=$t.select("open");zt.current=!1;let vn=Yt.key.startsWith("Arrow"),_n=cee(Yt.key,yn(),St),zn=E0(Yt.key,Mt),$n=(Ct?_n:zn)||Yt.key==="Enter"||Yt.key.trim()==="";if(Et&&un)return en(Yt);if(!un&&!Tt&&vn)return;if($n){let Mn=E0(Yt.key,yn());Xt.current=Ct&&Mn?null:Yt.key}if(Ct){if(_n)if(ss(Yt),un)Qt.current=nn(),tn(Yt);else Cn(Yt);return}if(zn){if(dn.current!=null)Qt.current=dn.current;if(ss(Yt),!un&&Tt)Cn(Yt);else en(Yt);if(un)tn(Yt)}return},onFocus(Yt){if($t.select("open")&&!Et)Qt.current=-1,tn(Yt)},onPointerDown:Jt,onPointerEnter:Jt,onMouseDown:kn,onClick:kn}},[en,kt,nn,Ct,tn,$t,Tt,Mt,yn,St,dn,Et]),Rn=wi.useMemo(()=>({...cn,...Pn}),[cn,Pn]);return wi.useMemo(()=>yt?{reference:Rn,floating:mn,item:pn,trigger:Pn}:{},[yt,Rn,mn,Pn,pn])}var Hp=e(t(),1);function Rk(ot,st){let{listRef:ct,elementsRef:gt,activeIndex:bt,onMatch:yt,disabledIndices:vt,onTyping:xt,enabled:wt=!0,resetMs:Ct=750,selectedIndex:St=null}=st,Et="rootStore"in ot?ot.rootStore:ot,kt=Et.useState("open"),Rt=Xr(),Tt=Hp.useRef(""),Pt=Hp.useRef(St??bt??-1),Mt=Hp.useRef(null),It=s((Ot)=>{function Dt(Ht){return gt?.current[Ht]}function _t(Ht){let Gt=Dt(Ht);if(Gt&&!Pp(Gt)||Gt?.matches(":disabled"))return!1;return vt==null||!Xl(z,Ht,vt)}function $t(Ht,Gt,jt=0){if(Ht.length===0)return-1;let qt=(jt%Ht.length+Ht.length)%Ht.length,Qt=Gt.toLowerCase();for(let Xt=0;Xt<Ht.length;Xt+=1){let zt=(qt+Xt)%Ht.length;if(!Ht[zt]?.toLowerCase().startsWith(Qt)||!_t(zt))continue;return zt}return-1}let Ft=ct.current;if(Tt.current.length>0&&Ot.key===" ")ss(Ot),xt?.(!0);if(Tt.current.length>0&&Tt.current[0]!==" "){if($t(Ft,Tt.current)===-1&&Ot.key!==" ")xt?.(!1)}if(Ft==null||Ot.key.length!==1||Ot.ctrlKey||Ot.metaKey||Ot.altKey)return;if(kt&&Ot.key!==" ")ss(Ot),xt?.(!0);let Bt=Tt.current==="";if(Bt)Pt.current=St??bt??-1;if(Ft.every((Ht,Gt)=>Ht&&_t(Gt)?Ht[0]?.toLowerCase()!==Ht[1]?.toLowerCase():!0)&&Tt.current===Ot.key)Tt.current="",Pt.current=Mt.current;Tt.current+=Ot.key,Rt.start(Ct,()=>{Tt.current="",Pt.current=Mt.current,xt?.(!1)});let Wt=((Bt?St??bt??-1:Pt.current)??0)+1,Ut=$t(Ft,Tt.current,Wt);if(Ut!==-1)yt?.(Ut),Mt.current=Ut;else if(Ot.key!==" ")Tt.current="",xt?.(!1)}),At=s((Ot)=>{let Dt=Ot.relatedTarget,_t=Et.select("domReferenceElement"),$t=Et.select("floatingElement");if(On(_t,Dt)||On($t,Dt))return;Rt.clear(),Tt.current="",Pt.current=Mt.current,xt?.(!1)});i(()=>{if(!kt&&St!==null)return;if(Rt.clear(),Mt.current=null,Tt.current!=="")Tt.current=""},[kt,St,Rt]);let Nt=Hp.useMemo(()=>({onKeyDown:It,onBlur:At}),[It,At]);return Hp.useMemo(()=>wt?{reference:Nt,floating:Nt}:{},[wt,Nt])}var T2=0.1,pee=T2*T2,uo=0.5;function R0(ot,st,ct,gt,bt,yt){return gt>=st!==yt>=st&&ot<=(bt-ct)*(st-gt)/(yt-gt)+ct}function T0(ot,st,ct,gt,bt,yt,vt,xt,wt,Ct){let St=!1;if(R0(ot,st,ct,gt,bt,yt))St=!St;if(R0(ot,st,bt,yt,vt,xt))St=!St;if(R0(ot,st,vt,xt,wt,Ct))St=!St;if(R0(ot,st,wt,Ct,ct,gt))St=!St;return St}function dee(ot,st,ct){return ot>=ct.x&&ot<=ct.x+ct.width&&st>=ct.y&&st<=ct.y+ct.height}function P0(ot,st,ct,gt,bt,yt){let vt=Math.min(ct,bt),xt=Math.max(ct,bt),wt=Math.min(gt,yt),Ct=Math.max(gt,yt);return ot>=vt&&ot<=xt&&st>=wt&&st<=Ct}function ic(ot={}){let{blockPointerEvents:st=!1}=ot,ct=new Ho,gt=({x:bt,y:yt,placement:vt,elements:xt,onClose:wt,nodeId:Ct,tree:St})=>{let Et=vt?.split("-")[0],kt=!1,Rt=null,Tt=null,Pt=typeof performance<"u"?performance.now():0;function Mt(At,Nt){let Ot=performance.now(),Dt=Ot-Pt;if(Rt===null||Tt===null||Dt===0)return Rt=At,Tt=Nt,Pt=Ot,!1;let _t=At-Rt,$t=Nt-Tt,Ft=_t*_t+$t*$t,Bt=Dt*Dt*pee;return Rt=At,Tt=Nt,Pt=Ot,Ft<Bt}function It(){ct.clear(),wt()}return function(Nt){ct.clear();let{domReference:Ot,floating:Dt}=xt;if(!Ot||!Dt||Et==null||bt==null||yt==null)return;let{clientX:_t,clientY:$t}=Nt,Ft=xr(Nt),Bt=Nt.type==="mouseleave",Lt=On(Dt,Ft),Vt=On(Ot,Ft);if(Lt){if(kt=!0,!Bt)return}if(Vt){if(kt=!1,!Bt){kt=!0;return}}if(Bt&&f(Nt.relatedTarget)&&On(Dt,Nt.relatedTarget))return;function Wt(){return Boolean(St&&Ks(St.nodesRef.current,Ct).length>0)}function Ut(){if(!Wt())It()}if(Wt())return;let Ht=Ot.getBoundingClientRect(),Gt=Dt.getBoundingClientRect(),jt=bt>Gt.right-Gt.width/2,qt=yt>Gt.bottom-Gt.height/2,Qt=Gt.width>Ht.width,Xt=Gt.height>Ht.height,zt=(Qt?Ht:Gt).left,tn=(Qt?Ht:Gt).right,rn=(Xt?Ht:Gt).top,Kt=(Xt?Ht:Gt).bottom;if(Et==="top"&&yt>=Ht.bottom-1||Et==="bottom"&&yt<=Ht.top+1||Et==="left"&&bt>=Ht.right-1||Et==="right"&&bt<=Ht.left+1){Ut();return}let an=!1;switch(Et){case"top":an=P0(_t,$t,zt,Ht.top+1,tn,Gt.bottom-1);break;case"bottom":an=P0(_t,$t,zt,Gt.top+1,tn,Ht.bottom-1);break;case"left":an=P0(_t,$t,Gt.right-1,Kt,Ht.left+1,rn);break;case"right":an=P0(_t,$t,Ht.right-1,Kt,Gt.left+1,rn);break;default:}if(an)return;if(kt&&!dee(_t,$t,Ht)){Ut();return}if(!Bt&&Mt(_t,$t)){Ut();return}let ln=!1;switch(Et){case"top":{let Zt=Qt?uo/2:uo*4,on=Qt?bt+Zt:jt?bt+Zt:bt-Zt,sn=Qt?bt-Zt:jt?bt+Zt:bt-Zt,dn=yt+uo+1,fn=jt?Gt.bottom-uo:Qt?Gt.bottom-uo:Gt.top,bn=jt?Qt?Gt.bottom-uo:Gt.top:Gt.bottom-uo;ln=T0(_t,$t,on,dn,sn,dn,Gt.left,fn,Gt.right,bn);break}case"bottom":{let Zt=Qt?uo/2:uo*4,on=Qt?bt+Zt:jt?bt+Zt:bt-Zt,sn=Qt?bt-Zt:jt?bt+Zt:bt-Zt,dn=yt-uo,fn=jt?Gt.top+uo:Qt?Gt.top+uo:Gt.bottom,bn=jt?Qt?Gt.top+uo:Gt.bottom:Gt.top+uo;ln=T0(_t,$t,on,dn,sn,dn,Gt.left,fn,Gt.right,bn);break}case"left":{let Zt=Xt?uo/2:uo*4,on=Xt?yt+Zt:qt?yt+Zt:yt-Zt,sn=Xt?yt-Zt:qt?yt+Zt:yt-Zt,dn=bt+uo+1,fn=qt?Gt.right-uo:Xt?Gt.right-uo:Gt.left,bn=qt?Xt?Gt.right-uo:Gt.left:Gt.right-uo;ln=T0(_t,$t,fn,Gt.top,bn,Gt.bottom,dn,on,dn,sn);break}case"right":{let Zt=Xt?uo/2:uo*4,on=Xt?yt+Zt:qt?yt+Zt:yt-Zt,sn=Xt?yt-Zt:qt?yt+Zt:yt-Zt,dn=bt-uo,fn=qt?Gt.left+uo:Xt?Gt.left+uo:Gt.right,bn=qt?Xt?Gt.left+uo:Gt.right:Gt.left+uo;ln=T0(_t,$t,dn,on,dn,sn,fn,Gt.top,bn,Gt.bottom);break}default:}if(!ln)Ut();else if(!kt)ct.start(40,Ut);return}};return gt.__options={...ot,blockPointerEvents:st},gt}function P2(ot,st,ct){let{reference:gt,floating:bt}=ot,yt=ls(st),vt=Wg(st),xt=$g(vt),wt=as(st),Ct=yt==="y",St=gt.x+gt.width/2-bt.width/2,Et=gt.y+gt.height/2-bt.height/2,kt=gt[xt]/2-bt[xt]/2,Rt;switch(wt){case"top":Rt={x:St,y:gt.y-bt.height};break;case"bottom":Rt={x:St,y:gt.y+gt.height};break;case"right":Rt={x:gt.x+gt.width,y:Et};break;case"left":Rt={x:gt.x-bt.width,y:Et};break;default:Rt={x:gt.x,y:gt.y}}let Tt=qs(st);if(Tt)Rt[vt]+=kt*(Tt==="end"?1:-1)*(ct&&Ct?-1:1);return Rt}async function I2(ot,st){var ct;if(st===void 0)st={};let{x:gt,y:bt,platform:yt,rects:vt,elements:xt,strategy:wt}=ot,{boundary:Ct="clippingAncestors",rootBoundary:St="viewport",elementContext:Et="floating",altBoundary:kt=!1,padding:Rt=0}=qa(st,ot),Tt=Qy(Rt),Mt=xt[kt?Et==="floating"?"reference":"floating":Et],It=Rp(await yt.getClippingRect({element:((ct=await(yt.isElement==null?void 0:yt.isElement(Mt)))!=null?ct:!0)?Mt:Mt.contextElement||await(yt.getDocumentElement==null?void 0:yt.getDocumentElement(xt.floating)),boundary:Ct,rootBoundary:St,strategy:wt})),At=Et==="floating"?{x:gt,y:bt,width:vt.floating.width,height:vt.floating.height}:vt.reference,Nt=await(yt.getOffsetParent==null?void 0:yt.getOffsetParent(xt.floating)),Ot=await(yt.isElement==null?void 0:yt.isElement(Nt))&&await(yt.getScale==null?void 0:yt.getScale(Nt))||{x:1,y:1},Dt=Rp(yt.convertOffsetParentRelativeRectToViewportRelativeRect?await yt.convertOffsetParentRelativeRectToViewportRelativeRect({elements:xt,rect:At,offsetParent:Nt,strategy:wt}):At);return{top:(It.top-Dt.top+Tt.top)/Ot.y,bottom:(Dt.bottom-It.bottom+Tt.bottom)/Ot.y,left:(It.left-Dt.left+Tt.left)/Ot.x,right:(Dt.right-It.right+Tt.right)/Ot.x}}var fee=50,M2=async(ot,st,ct)=>{let{placement:gt="bottom",strategy:bt="absolute",middleware:yt=[],platform:vt}=ct,xt=vt.detectOverflow?vt:{...vt,detectOverflow:I2},wt=await(vt.isRTL==null?void 0:vt.isRTL(st)),Ct=await vt.getElementRects({reference:ot,floating:st,strategy:bt}),{x:St,y:Et}=P2(Ct,gt,wt),kt=gt,Rt=0,Tt={};for(let Pt=0;Pt<yt.length;Pt++){let Mt=yt[Pt];if(!Mt)continue;let{name:It,fn:At}=Mt,{x:Nt,y:Ot,data:Dt,reset:_t}=await At({x:St,y:Et,initialPlacement:gt,placement:kt,strategy:bt,middlewareData:Tt,rects:Ct,platform:xt,elements:{reference:ot,floating:st}});if(St=Nt!=null?Nt:St,Et=Ot!=null?Ot:Et,Tt[It]={...Tt[It],...Dt},_t&&Rt<fee){if(Rt++,typeof _t==="object"){if(_t.placement)kt=_t.placement;if(_t.rects)Ct=_t.rects===!0?await vt.getElementRects({reference:ot,floating:st,strategy:bt}):_t.rects;({x:St,y:Et}=P2(Ct,kt,wt))}Pt=-1}}return{x:St,y:Et,placement:kt,strategy:bt,middlewareData:Tt}};var A2=function(ot){if(ot===void 0)ot={};return{name:"flip",options:ot,async fn(st){var ct,gt;let{placement:bt,middlewareData:yt,rects:vt,initialPlacement:xt,platform:wt,elements:Ct}=st,{mainAxis:St=!0,crossAxis:Et=!0,fallbackPlacements:kt,fallbackStrategy:Rt="bestFit",fallbackAxisSideDirection:Tt="none",flipAlignment:Pt=!0,...Mt}=qa(ot,st);if((ct=yt.arrow)!=null&&ct.alignmentOffset)return{};let It=as(bt),At=ls(xt),Nt=as(xt)===xt,Ot=await(wt.isRTL==null?void 0:wt.isRTL(Ct.floating)),Dt=kt||(Nt||!Pt?[Fg(xt)]:GD(xt)),_t=Tt!=="none";if(!kt&&_t)Dt.push(...KD(xt,Pt,Tt,Ot));let $t=[xt,...Dt],Ft=await wt.detectOverflow(st,Mt),Bt=[],Lt=((gt=yt.flip)==null?void 0:gt.overflows)||[];if(St)Bt.push(Ft[It]);if(Et){let Ht=VD(bt,vt,Ot);Bt.push(Ft[Ht[0]],Ft[Ht[1]])}if(Lt=[...Lt,{placement:bt,overflows:Bt}],!Bt.every((Ht)=>Ht<=0)){var Vt,Wt;let Ht=(((Vt=yt.flip)==null?void 0:Vt.index)||0)+1,Gt=$t[Ht];if(Gt){if(!(Et==="alignment"?At!==ls(Gt):!1)||Lt.every((Qt)=>ls(Qt.placement)===At?Qt.overflows[0]>0:!0))return{data:{index:Ht,overflows:Lt},reset:{placement:Gt}}}let jt=(Wt=Lt.filter((qt)=>qt.overflows[0]<=0).sort((qt,Qt)=>qt.overflows[1]-Qt.overflows[1])[0])==null?void 0:Wt.placement;if(!jt)switch(Rt){case"bestFit":{var Ut;let qt=(Ut=Lt.filter((Qt)=>{if(_t){let Xt=ls(Qt.placement);return Xt===At||Xt==="y"}return!0}).map((Qt)=>[Qt.placement,Qt.overflows.filter((Xt)=>Xt>0).reduce((Xt,zt)=>Xt+zt,0)]).sort((Qt,Xt)=>Qt[1]-Xt[1])[0])==null?void 0:Ut[0];if(qt)jt=qt;break}case"initialPlacement":jt=xt;break}if(bt!==jt)return{reset:{placement:jt}}}return{}}}};var N2=new Set(["left","top"]);async function mee(ot,st){let{placement:ct,platform:gt,elements:bt}=ot,yt=await(gt.isRTL==null?void 0:gt.isRTL(bt.floating)),vt=as(ct),xt=qs(ct),wt=ls(ct)==="y",Ct=N2.has(vt)?-1:1,St=yt&&wt?-1:1,Et=qa(st,ot),{mainAxis:kt,crossAxis:Rt,alignmentAxis:Tt}=typeof Et==="number"?{mainAxis:Et,crossAxis:0,alignmentAxis:null}:{mainAxis:Et.mainAxis||0,crossAxis:Et.crossAxis||0,alignmentAxis:Et.alignmentAxis};if(xt&&typeof Tt==="number")Rt=xt==="end"?Tt*-1:Tt;return wt?{x:Rt*St,y:kt*Ct}:{x:kt*Ct,y:Rt*St}}var D2=function(ot){if(ot===void 0)ot=0;return{name:"offset",options:ot,async fn(st){var ct,gt;let{x:bt,y:yt,placement:vt,middlewareData:xt}=st,wt=await mee(st,ot);if(vt===((ct=xt.offset)==null?void 0:ct.placement)&&(gt=xt.arrow)!=null&&gt.alignmentOffset)return{};return{x:bt+wt.x,y:yt+wt.y,data:{...wt,placement:vt}}}}},_2=function(ot){if(ot===void 0)ot={};return{name:"shift",options:ot,async fn(st){let{x:ct,y:gt,placement:bt,platform:yt}=st,{mainAxis:vt=!0,crossAxis:xt=!1,limiter:wt={fn:(At)=>{let{x:Nt,y:Ot}=At;return{x:Nt,y:Ot}}},...Ct}=qa(ot,st),St={x:ct,y:gt},Et=await yt.detectOverflow(st,Ct),kt=ls(bt),Rt=qy(kt),Tt=St[Rt],Pt=St[kt],Mt=(At,Nt)=>Ky(Nt+Et[At==="y"?"top":"left"],Nt,Nt-Et[At==="y"?"bottom":"right"]);if(vt)Tt=Mt(Rt,Tt);if(xt)Pt=Mt(kt,Pt);let It=wt.fn({...st,[Rt]:Tt,[kt]:Pt});return{...It,data:{x:It.x-ct,y:It.y-gt,enabled:{[Rt]:vt,[kt]:xt}}}}}},O2=function(ot){if(ot===void 0)ot={};return{options:ot,fn(st){var ct,gt;let{x:bt,y:yt,placement:vt,rects:xt,middlewareData:wt}=st,{offset:Ct=0,mainAxis:St=!0,crossAxis:Et=!0}=qa(ot,st),kt={x:bt,y:yt},Rt=ls(vt),Tt=qy(Rt),Pt=kt[Tt],Mt=kt[Rt],It=qa(Ct,st),At=typeof It==="number"?{mainAxis:It,crossAxis:0}:{mainAxis:(ct=It.mainAxis)!=null?ct:0,crossAxis:(gt=It.crossAxis)!=null?gt:0};if(St){let Dt=Tt==="y"?"height":"width",_t=xt.reference[Tt]-xt.floating[Dt]+At.mainAxis,$t=xt.reference[Tt]+xt.reference[Dt]-At.mainAxis;if(Pt<_t)Pt=_t;else if(Pt>$t)Pt=$t}if(Et){var Nt,Ot;let Dt=Tt==="y"?"width":"height",_t=N2.has(as(vt)),$t=xt.reference[Rt]-xt.floating[Dt]+(_t?((Nt=wt.offset)==null?void 0:Nt[Rt])||0:0)+(_t?0:At.crossAxis),Ft=xt.reference[Rt]+xt.reference[Dt]+(_t?0:((Ot=wt.offset)==null?void 0:Ot[Rt])||0)-(_t?At.crossAxis:0);if(Mt<$t)Mt=$t;else if(Mt>Ft)Mt=Ft}return{[Tt]:Pt,[Rt]:Mt}}}},L2=function(ot){if(ot===void 0)ot={};return{name:"size",options:ot,async fn(st){let{placement:ct,rects:gt,platform:bt,elements:yt}=st,{apply:vt=()=>{},...xt}=qa(ot,st),wt=await bt.detectOverflow(st,xt),Ct=as(ct),St=qs(ct),Et=ls(ct)==="y",{width:kt,height:Rt}=gt.floating,Tt,Pt;if(Ct==="top"||Ct==="bottom")Tt=Ct,Pt=St===(await(bt.isRTL==null?void 0:bt.isRTL(yt.floating))?"start":"end")?"left":"right";else Pt=Ct,Tt=St==="end"?"top":"bottom";let Mt=Rt-wt.top-wt.bottom,It=kt-wt.left-wt.right,At=Fc(Rt-wt[Tt],Mt),Nt=Fc(kt-wt[Pt],It),Ot=st.middlewareData.shift,Dt=!Ot,_t=At,$t=Nt;if(Ot!=null&&Ot.enabled.x)$t=It;if(Ot!=null&&Ot.enabled.y)_t=Mt;if(Dt&&!St)if(Et)$t=kt-2*wa(wt.left,wt.right);else _t=Rt-2*wa(wt.top,wt.bottom);await vt({...st,availableWidth:$t,availableHeight:_t});let Ft=await bt.getDimensions(yt.floating);if(kt!==Ft.width||Rt!==Ft.height)return{reset:{rects:!0}};return{}}}};function H2(ot){let st=F(ot),ct=parseFloat(st.width)||0,gt=parseFloat(st.height)||0,bt=y(ot),yt=bt?ot.offsetWidth:ct,vt=bt?ot.offsetHeight:gt,xt=Hg(ct)!==yt||Hg(gt)!==vt;if(xt)ct=yt,gt=vt;return{width:ct,height:gt,$:xt}}function Pk(ot){return!f(ot)?ot.contextElement:ot}function pf(ot){let st=Pk(ot);if(!y(st))return Ka(1);let ct=st.getBoundingClientRect(),{width:gt,height:bt,$:yt}=H2(st),vt=(yt?Hg(ct.width):ct.width)/gt,xt=(yt?Hg(ct.height):ct.height)/bt;if(!vt||!Number.isFinite(vt))vt=1;if(!xt||!Number.isFinite(xt))xt=1;return{x:vt,y:xt}}var gee=Ka(0);function z2(ot){let st=m(ot);if(!Ge()||!st.visualViewport)return gee;return{x:st.visualViewport.offsetLeft,y:st.visualViewport.offsetTop}}function hee(ot,st,ct){if(st===void 0)st=!1;return!!ct&&st&&ct===m(ot)}function zp(ot,st,ct,gt){if(st===void 0)st=!1;if(ct===void 0)ct=!1;let bt=ot.getBoundingClientRect(),yt=Pk(ot),vt=Ka(1);if(st)if(gt){if(f(gt))vt=pf(gt)}else vt=pf(ot);let xt=hee(yt,ct,gt)?z2(yt):Ka(0),wt=(bt.left+xt.x)/vt.x,Ct=(bt.top+xt.y)/vt.y,St=bt.width/vt.x,Et=bt.height/vt.y;if(yt&&gt){let kt=m(yt),Rt=f(gt)?m(gt):gt,Tt=kt,Pt=Ke(Tt);while(Pt&&Rt!==Tt){let Mt=pf(Pt),It=Pt.getBoundingClientRect(),At=F(Pt),Nt=It.left+(Pt.clientLeft+parseFloat(At.paddingLeft))*Mt.x,Ot=It.top+(Pt.clientTop+parseFloat(At.paddingTop))*Mt.y;wt*=Mt.x,Ct*=Mt.y,St*=Mt.x,Et*=Mt.y,wt+=Nt,Ct+=Ot,Tt=m(Pt),Pt=Ke(Tt)}}return Rp({width:St,height:Et,x:wt,y:Ct})}function I0(ot,st){let ct=Ne(ot).scrollLeft;if(!st)return zp(ee(ot)).left+ct;return st.left+ct}function $2(ot,st){let ct=ot.getBoundingClientRect(),gt=ct.left+st.scrollLeft-I0(ot,ct),bt=ct.top+st.scrollTop;return{x:gt,y:bt}}function bee(ot){let{elements:st,rect:ct,offsetParent:gt,strategy:bt}=ot,yt=bt==="fixed",vt=ee(gt),xt=st?Oe(st.floating):!1;if(gt===vt||xt&&yt)return ct;let wt={scrollLeft:0,scrollTop:0},Ct=Ka(1),St=Ka(0),Et=y(gt);if(Et||!yt){if(D(gt)!=="body"||ge(vt))wt=Ne(gt);if(Et){let Rt=zp(gt);Ct=pf(gt),St.x=Rt.x+gt.clientLeft,St.y=Rt.y+gt.clientTop}}let kt=vt&&!Et&&!yt?$2(vt,wt):Ka(0);return{width:ct.width*Ct.x,height:ct.height*Ct.y,x:ct.x*Ct.x-wt.scrollLeft*Ct.x+St.x+kt.x,y:ct.y*Ct.y-wt.scrollTop*Ct.y+St.y+kt.y}}function yee(ot){return ot.getClientRects?Array.from(ot.getClientRects()):[]}function vee(ot){let st=Ne(ot),ct=ot.ownerDocument.body,gt=wa(ot.scrollWidth,ot.clientWidth,ct.scrollWidth,ct.clientWidth),bt=wa(ot.scrollHeight,ot.clientHeight,ct.scrollHeight,ct.clientHeight),yt=-st.scrollLeft+I0(ot),vt=-st.scrollTop;if(F(ct).direction==="rtl")yt+=wa(ot.clientWidth,ct.clientWidth)-gt;return{width:gt,height:bt,x:yt,y:vt}}var xee=25;function wee(ot,st,ct){if(ct===void 0)ct="viewport";let gt=ct==="layoutViewport",bt=m(ot),yt=ee(ot),vt=bt.visualViewport,{clientWidth:xt,clientHeight:wt}=yt,Ct=0,St=0;if(vt){let kt=!Ge()||st==="fixed";if(gt){if(!kt)Ct=-vt.offsetLeft,St=-vt.offsetTop}else if(xt=vt.width,wt=vt.height,kt)Ct=vt.offsetLeft,St=vt.offsetTop}if(I0(yt)<=0){let kt=yt.ownerDocument,Rt=kt.body,Tt=getComputedStyle(Rt),Pt=kt.compatMode==="CSS1Compat"?parseFloat(Tt.marginLeft)+parseFloat(Tt.marginRight)||0:0,Mt=Math.abs(yt.clientWidth-Rt.clientWidth-Pt),It=getComputedStyle(yt).scrollbarGutter==="stable both-edges"?Mt/2:Mt;if(It<=xee)xt-=It}return{width:xt,height:wt,x:Ct,y:St}}function Cee(ot,st){let ct=zp(ot,!0,st==="fixed"),gt=ct.top+ot.clientTop,bt=ct.left+ot.clientLeft,yt=pf(ot),vt=ot.clientWidth*yt.x,xt=ot.clientHeight*yt.y,wt=bt*yt.x,Ct=gt*yt.y;return{width:vt,height:xt,x:wt,y:Ct}}function B2(ot,st,ct){let gt;if(st==="viewport"||st==="layoutViewport")gt=wee(ot,ct,st);else if(st==="document")gt=vee(ee(ot));else if(f(st))gt=Cee(st,ct);else{let bt=z2(ot);gt={x:st.x-bt.x,y:st.y-bt.y,width:st.width,height:st.height}}return Rp(gt)}function See(ot,st){let ct=st.get(ot);if(ct)return ct;let gt=de(ot,[],!1).filter((xt)=>f(xt)&&D(xt)!=="body"),bt=null,yt=F(ot).position==="fixed",vt=yt?q(ot):ot;while(f(vt)&&!K(vt)){let xt=F(vt),wt=je(vt),Ct=bt?bt.position:yt?"fixed":"";if(!wt&&(Ct==="fixed"||Ct==="absolute"&&xt.position==="static"))gt=gt.filter((Et)=>Et!==vt);else bt=xt;vt=q(vt)}return st.set(ot,gt),gt}function Eee(ot){let{element:st,boundary:ct,rootBoundary:gt,strategy:bt}=ot,vt=[...ct==="clippingAncestors"?Oe(st)?[]:See(st,this._c):[].concat(ct),gt],xt=B2(st,vt[0],bt),{top:wt,right:Ct,bottom:St,left:Et}=xt;for(let kt=1;kt<vt.length;kt++){let Rt=B2(st,vt[kt],bt);wt=wa(Rt.top,wt),Ct=Fc(Rt.right,Ct),St=Fc(Rt.bottom,St),Et=wa(Rt.left,Et)}return{width:Ct-Et,height:St-wt,x:Et,y:wt}}function kee(ot){let{width:st,height:ct}=H2(ot);return{width:st,height:ct}}function Ree(ot,st,ct){let gt=y(st),bt=ee(st),yt=ct==="fixed",vt=zp(ot,!0,yt,st),xt={scrollLeft:0,scrollTop:0},wt=Ka(0);if(gt||!yt){if(D(st)!=="body"||ge(bt))xt=Ne(st);if(gt){let kt=zp(st,!0,yt,st);wt.x=kt.x+st.clientLeft,wt.y=kt.y+st.clientTop}}if(!gt&&bt)wt.x=I0(bt);let Ct=bt&&!gt&&!yt?$2(bt,xt):Ka(0),St=vt.left+xt.scrollLeft-wt.x-Ct.x,Et=vt.top+xt.scrollTop-wt.y-Ct.y;return{x:St,y:Et,width:vt.width,height:vt.height}}function Tk(ot){return F(ot).position==="static"}function F2(ot,st){if(!y(ot)||F(ot).position==="fixed")return null;if(st)return st(ot);let ct=ot.offsetParent;if(ee(ot)===ct)ct=ct.ownerDocument.body;return ct}function W2(ot,st){let ct=m(ot);if(Oe(ot))return ct;if(!y(ot)){let bt=q(ot);while(bt&&!K(bt)){if(f(bt)&&!Tk(bt))return bt;bt=q(bt)}return ct}let gt=F2(ot,st);while(gt&&dt(gt)&&Tk(gt))gt=F2(gt,st);if(gt&&K(gt)&&Tk(gt)&&!je(gt))return ct;return gt||pt(ot)||ct}var Tee=async function(ot){let st=this.getOffsetParent||W2,ct=this.getDimensions,gt=await ct(ot.floating);return{reference:Ree(ot.reference,await st(ot.floating),ot.strategy),floating:{x:0,y:0,width:gt.width,height:gt.height}}};function Pee(ot){return F(ot).direction==="rtl"}var Ik={convertOffsetParentRelativeRectToViewportRelativeRect:bee,getDocumentElement:ee,getClippingRect:Eee,getOffsetParent:W2,getElementRects:Tee,getClientRects:yee,getDimensions:kee,getScale:pf,isElement:f,isRTL:Pee};function U2(ot,st){return ot.x===st.x&&ot.y===st.y&&ot.width===st.width&&ot.height===st.height}function Iee(ot,st,ct){let gt=null,bt,yt=ee(ot);function vt(){var St;clearTimeout(bt),(St=gt)==null||St.disconnect(),gt=null}function xt(St,Et){if(St===void 0)St=!1;if(Et===void 0)Et=1;vt();let kt=ot.getBoundingClientRect(),{left:Rt,top:Tt,width:Pt,height:Mt}=kt;if(!St)st();if(!Pt||!Mt)return;let It=zg(Tt),At=zg(yt.clientWidth-(Rt+Pt)),Nt=zg(yt.clientHeight-(Tt+Mt)),Ot=zg(Rt),_t={rootMargin:-It+"px "+-At+"px "+-Nt+"px "+-Ot+"px",threshold:wa(0,Fc(1,Et))||1},$t=!0;function Ft(Bt){let Lt=Bt[0].intersectionRatio;if(!U2(kt,ot.getBoundingClientRect()))return xt();if(Lt!==Et){if(!$t)return xt();if(!Lt)bt=setTimeout(()=>{xt(!1,0.0000001)},1000);else xt(!1,Lt)}$t=!1}try{gt=new IntersectionObserver(Ft,{..._t,root:yt.ownerDocument})}catch(Bt){gt=new IntersectionObserver(Ft,_t)}gt.observe(ot)}let wt=m(ot),Ct=()=>xt(ct);return wt.addEventListener("resize",Ct),xt(!0),()=>{wt.removeEventListener("resize",Ct),vt()}}function Zg(ot,st,ct,gt){if(gt===void 0)gt={};let{ancestorScroll:bt=!0,ancestorResize:yt=!0,elementResize:vt=typeof ResizeObserver==="function",layoutShift:xt=typeof IntersectionObserver==="function",animationFrame:wt=!1}=gt,Ct=Pk(ot),St=bt||yt?[...Ct?de(Ct):[],...st?de(st):[]]:[];St.forEach((It)=>{bt&&It.addEventListener("scroll",ct),yt&&It.addEventListener("resize",ct)});let Et=Ct&&xt?Iee(Ct,ct,yt):null,kt=-1,Rt=null;if(vt){if(Rt=new ResizeObserver((It)=>{let[At]=It;if(At&&At.target===Ct&&Rt&&st)Rt.unobserve(st),cancelAnimationFrame(kt),kt=requestAnimationFrame(()=>{var Nt;(Nt=Rt)==null||Nt.observe(st)});ct()}),Ct&&!wt)Rt.observe(Ct);if(st)Rt.observe(st)}let Tt,Pt=wt?zp(ot):null;if(wt)Mt();function Mt(){let It=zp(ot);if(Pt&&!U2(Pt,It))ct();Pt=It,Tt=requestAnimationFrame(Mt)}return ct(),()=>{var It;if(St.forEach((At)=>{bt&&At.removeEventListener("scroll",ct),yt&&At.removeEventListener("resize",ct)}),Et==null||Et(),(It=Rt)==null||It.disconnect(),Rt=null,wt)cancelAnimationFrame(Tt)}}var j2=D2;var V2=_2,G2=A2,K2=L2;var q2=O2,M0=(ot,st,ct)=>{let gt=new Map,bt=ct!=null?ct:{},yt={...Ik,...bt.platform,_c:gt};return M2(ot,st,{...bt,platform:yt})};var Jo=e(t(),1),J2=e(t(),1),X2=e(_(),1),Aee=typeof document<"u",Nee=function(){},A0=Aee?J2.useLayoutEffect:Nee;function N0(ot,st){if(ot===st)return!0;if(typeof ot!==typeof st)return!1;if(typeof ot==="function"&&ot.toString()===st.toString())return!0;let ct,gt,bt;if(ot&&st&&typeof ot==="object"){if(Array.isArray(ot)){if(ct=ot.length,ct!==st.length)return!1;for(gt=ct;gt--!==0;)if(!N0(ot[gt],st[gt]))return!1;return!0}if(bt=Object.keys(ot),ct=bt.length,ct!==Object.keys(st).length)return!1;for(gt=ct;gt--!==0;)if(!{}.hasOwnProperty.call(st,bt[gt]))return!1;for(gt=ct;gt--!==0;){let yt=bt[gt];if(yt==="_owner"&&ot.$$typeof)continue;if(!N0(ot[yt],st[yt]))return!1}return!0}return ot!==ot&&st!==st}function Y2(ot){if(typeof window>"u")return 1;return(ot.ownerDocument.defaultView||window).devicePixelRatio||1}function Q2(ot,st){let ct=Y2(ot);return Math.round(st*ct)/ct}function Mk(ot){let st=Jo.useRef(ot);return A0(()=>{st.current=ot}),st}function Z2(ot){if(ot===void 0)ot={};let{placement:st="bottom",strategy:ct="absolute",middleware:gt=[],platform:bt,elements:{reference:yt,floating:vt}={},transform:xt=!0,whileElementsMounted:wt,open:Ct}=ot,[St,Et]=Jo.useState({x:0,y:0,strategy:ct,placement:st,middlewareData:{},isPositioned:!1}),[kt,Rt]=Jo.useState(gt);if(!N0(kt,gt))Rt(gt);let[Tt,Pt]=Jo.useState(null),[Mt,It]=Jo.useState(null),At=Jo.useCallback((Qt)=>{if(Qt!==_t.current)_t.current=Qt,Pt(Qt)},[]),Nt=Jo.useCallback((Qt)=>{if(Qt!==$t.current)$t.current=Qt,It(Qt)},[]),Ot=yt||Tt,Dt=vt||Mt,_t=Jo.useRef(null),$t=Jo.useRef(null),Ft=Jo.useRef(St),Bt=wt!=null,Lt=Mk(wt),Vt=Mk(bt),Wt=Mk(Ct),Ut=Jo.useCallback(()=>{if(!_t.current||!$t.current)return;let Qt={placement:st,strategy:ct,middleware:kt};if(Vt.current)Qt.platform=Vt.current;M0(_t.current,$t.current,Qt).then((Xt)=>{let zt={...Xt,isPositioned:Wt.current!==!1};if(Ht.current&&!N0(Ft.current,zt))Ft.current=zt,X2.flushSync(()=>{Et(zt)})})},[kt,st,ct,Vt,Wt]);A0(()=>{if(Ct===!1&&Ft.current.isPositioned)Ft.current.isPositioned=!1,Et((Qt)=>({...Qt,isPositioned:!1}))},[Ct]);let Ht=Jo.useRef(!1);A0(()=>(Ht.current=!0,()=>{Ht.current=!1}),[]),A0(()=>{if(Ot)_t.current=Ot;if(Dt)$t.current=Dt;if(Ot&&Dt){if(Lt.current)return Lt.current(Ot,Dt,Ut);Ut()}},[Ot,Dt,Ut,Lt,Bt]);let Gt=Jo.useMemo(()=>({reference:_t,floating:$t,setReference:At,setFloating:Nt}),[At,Nt]),jt=Jo.useMemo(()=>({reference:Ot,floating:Dt}),[Ot,Dt]),qt=Jo.useMemo(()=>{let Qt={position:ct,left:0,top:0};if(!jt.floating)return Qt;let Xt=Q2(jt.floating,St.x),zt=Q2(jt.floating,St.y);if(xt)return{...Qt,transform:"translate("+Xt+"px, "+zt+"px)",...Y2(jt.floating)>=1.5&&{willChange:"transform"}};return{position:ct,left:Xt,top:zt}},[ct,xt,jt.floating,St.x,St.y]);return Jo.useMemo(()=>({...St,update:Ut,refs:Gt,elements:jt,floatingStyles:qt}),[St,Ut,Gt,jt,qt])}var Ak=(ot,st)=>{let ct=j2(ot);return{name:ct.name,fn:ct.fn,options:[ot,st]}},Nk=(ot,st)=>{let ct=V2(ot);return{name:ct.name,fn:ct.fn,options:[ot,st]}},Dk=(ot,st)=>({fn:q2(ot).fn,options:[ot,st]}),_k=(ot,st)=>{let ct=G2(ot);return{name:ct.name,fn:ct.fn,options:[ot,st]}},Ok=(ot,st)=>{let ct=K2(ot);return{name:ct.name,fn:ct.fn,options:[ot,st]}};var _i=e(t(),1);function eO(ot){return Dee(ot,ot.rootContext)}function Dee(ot,st){let{nodeId:ct,externalTree:gt}=ot,bt=st.useState("referenceElement"),yt=st.useState("floatingElement"),vt=st.useState("domReferenceElement"),xt=st.useState("open"),wt=st.useState("floatingId"),[Ct,St]=_i.useState(null),[Et,kt]=_i.useState(void 0),[Rt,Tt]=_i.useState(void 0),Pt=_i.useRef(null),Mt=Ni(gt),It=_i.useMemo(()=>({reference:bt,floating:yt,domReference:vt}),[bt,yt,vt]),At=Z2({...ot,elements:{...It,...Ct&&{reference:Ct}}}),Nt=f(Et)?Et:null,Ot=Rt===void 0?st.state.floatingElement:Rt;st.useSyncedValue("referenceElement",Et??null),st.useSyncedValue("domReferenceElement",Et===void 0?vt:Nt),st.useSyncedValue("floatingElement",Ot);let Dt=_i.useCallback((Vt)=>{let Wt=f(Vt)?{getBoundingClientRect:()=>Vt.getBoundingClientRect(),getClientRects:()=>Vt.getClientRects(),contextElement:Vt}:Vt;St(Wt),At.refs.setReference(Wt)},[At.refs]),_t=_i.useCallback((Vt)=>{if(f(Vt)||Vt===null)Pt.current=Vt,kt(Vt);if(f(At.refs.reference.current)||At.refs.reference.current===null||Vt!==null&&!f(Vt))At.refs.setReference(Vt)},[At.refs,kt]),$t=_i.useCallback((Vt)=>{Tt(Vt),At.refs.setFloating(Vt)},[At.refs]),Ft=_i.useMemo(()=>({...At.refs,setReference:_t,setFloating:$t,setPositionReference:Dt,domReference:Pt}),[At.refs,_t,$t,Dt]),Bt=_i.useMemo(()=>({...At.elements,domReference:vt}),[At.elements,vt]),Lt=_i.useMemo(()=>({...At,dataRef:st.context.dataRef,open:xt,onOpenChange:st.setOpen,events:st.context.events,floatingId:wt,refs:Ft,elements:Bt,nodeId:ct,rootStore:st}),[At,Ft,Bt,ct,st,xt,wt]);return i(()=>{if(vt)Pt.current=vt},[vt]),i(()=>{st.context.dataRef.current.floatingContext=Lt;let Vt=Mt?.nodesRef.current.find((Wt)=>Wt.id===ct);if(Vt)Vt.context=Lt}),_i.useMemo(()=>({...At,context:Lt,refs:Ft,elements:Bt,rootStore:st}),[At,Ft,Bt,Lt,st])}var D0=e(t(),1),_ee=D0.createContext(void 0);function ll(){return D0.useContext(_ee)?.direction??"ltr"}var Oee=(ot)=>({name:"arrow",options:ot,async fn(st){let{x:ct,y:gt,placement:bt,rects:yt,platform:vt,elements:xt,middlewareData:wt}=st,{element:Ct,padding:St=0,offsetParent:Et="real"}=qa(ot,st)||{};if(Ct==null)return{};let kt=Qy(St),Rt={x:ct,y:gt},Tt=Wg(bt),Pt=$g(Tt),Mt=await vt.getDimensions(Ct),It=Tt==="y",At=It?"top":"left",Nt=It?"bottom":"right",Ot=It?"clientHeight":"clientWidth",Dt=yt.reference[Pt]+yt.reference[Tt]-Rt[Tt]-yt.floating[Pt],_t=Rt[Tt]-yt.reference[Tt],$t=Et==="real"?await vt.getOffsetParent?.(Ct):xt.floating,Ft=xt.floating[Ot]||yt.floating[Pt];if(!Ft||!await vt.isElement?.($t))Ft=xt.floating[Ot]||yt.floating[Pt];let Bt=Dt/2-_t/2,Lt=Ft/2-Mt[Pt]/2-1,Vt=Math.min(kt[At],Lt),Wt=Math.min(kt[Nt],Lt),Ut=Vt,Ht=Ft-Mt[Pt]-Wt,Gt=Ft/2-Mt[Pt]/2+Bt,jt=Ky(Ut,Gt,Ht),qt=!wt.arrow&&qs(bt)!=null&&Gt!==jt&&yt.reference[Pt]/2-(Gt<Ut?Vt:Wt)-Mt[Pt]/2<0,Qt=qt?Gt<Ut?Gt-Ut:Gt-Ht:0;return{[Tt]:Rt[Tt]+Qt,data:{[Tt]:jt,centerOffset:Gt-jt-Qt,...qt&&{alignmentOffset:Qt}},reset:qt}}}),tO=(ot,st)=>{let{name:ct,fn:gt}=Oee(ot);return{name:ct,fn:gt,options:[ot,st]}};var nO={name:"hide",async fn(ot){let{width:st,height:ct,x:gt,y:bt}=ot.rects.reference,yt=st===0&&ct===0&&gt===0&&bt===0,vt=await ot.platform.detectOverflow(ot,{elementContext:"reference"});return{data:{referenceHidden:vt.top-ct>=0||vt.right-st>=0||vt.bottom-ct>=0||vt.left-st>=0||yt}}}};var rO={sideX:"left",sideY:"top"};var oO="--available-width",iO="--available-height",sO="--anchor-width",aO="--anchor-height",lO="--transform-origin";var cO=oO,uO=iO;function fO(ot,st,ct){let gt=ot==="inline-start"||ot==="inline-end";return{top:"top",right:gt?ct?"inline-start":"inline-end":"right",bottom:"bottom",left:gt?ct?"inline-end":"inline-start":"left"}[st]}function pO(ot,st,ct){let{rects:gt,placement:bt}=ot;return{side:fO(st,as(bt),ct),align:qs(bt)||"center",anchor:{width:gt.reference.width,height:gt.reference.height},positioner:{width:gt.floating.width,height:gt.floating.height}}}function Gc(ot){return Bee(ot,eO)}function Bee(ot,st){let{anchor:ct,positionMethod:gt="absolute",side:bt="bottom",sideOffset:yt=0,align:vt="center",alignOffset:xt=0,collisionBoundary:wt,collisionPadding:Ct=5,sticky:St=!1,arrowPadding:Et=5,disableAnchorTracking:kt=!1,inline:Rt,keepMounted:Tt=!1,floatingRootContext:Pt,mounted:Mt,collisionAvoidance:It,shift:At,nodeId:Nt,adaptiveOrigin:Ot,lazyFlip:Dt=!1,externalTree:_t}=ot,[$t,Ft]=Is.useState(null);if(!Mt&&$t!==null)Ft(null);let Bt=It.side||"flip",Lt=It.align||"flip",Vt=It.fallbackAxisSide||"end",Wt=At?.crossAxis??!1,Ut=At?.rootBoundary,Ht=typeof ct==="function"?ct:void 0,Gt=s(Ht),jt=Ht?Gt:ct,qt=io(ct),Qt=io(Mt),zt=ll()==="rtl",tn=$t||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":zt?"left":"right","inline-start":zt?"right":"left"}[bt],rn=vt==="center"?tn:`${tn}-${vt}`,Kt=Ct;if(typeof Kt==="number")Kt={top:Kt,right:Kt,bottom:Kt,left:Kt};else if(Kt)Kt={top:Kt.top||0,right:Kt.right||0,bottom:Kt.bottom||0,left:Kt.left||0};let an=1,ln=bt==="bottom"?an:0,Zt=bt==="top"?an:0,on=bt==="right"?an:0,sn=bt==="left"?an:0,dn={boundary:wt==="clipping-ancestors"?"clippingAncestors":wt,padding:Kt},fn=Is.useRef(null),bn=io(yt),hn=io(xt),gn=typeof yt!=="function"?yt:0,xn=typeof xt!=="function"?xt:0,wn=[];if(Rt)wn.push(Rt);wn.push(Ak((An)=>{let Vn=pO(An,bt,zt),Jn=typeof bn.current==="function"?bn.current(Vn):bn.current,Yn=typeof hn.current==="function"?hn.current(Vn):hn.current;return{mainAxis:Jn,crossAxis:Yn,alignmentAxis:Yn}},[gn,xn,zt,bt]));let yn=Lt==="none"&&Bt!=="shift",nn=!yn&&(St||Wt||Bt==="shift"),en=Bt==="none"?null:_k({...dn,padding:{top:Kt.top+an+ln,right:Kt.right+an+sn,bottom:Kt.bottom+an+Zt,left:Kt.left+an+on},mainAxis:!Wt&&Bt==="flip",crossAxis:Lt==="flip"?"alignment":!1,fallbackAxisSideDirection:Vt}),pn=yn?null:Nk({...dn,rootBoundary:Ut,mainAxis:Lt!=="none",crossAxis:nn,limiter:St||Wt?void 0:Dk((An)=>{if(!fn.current)return{};let{width:Vn,height:Jn}=fn.current.getBoundingClientRect(),Yn=ls(as(An.placement)),Sn=Yn==="y"?Vn:Jn,Fn=Yn==="y"?Kt.left+Kt.right:Kt.top+Kt.bottom;return{offset:Sn/2+Fn/2}})},[dn,St,Wt,Ut,Kt,Lt]);if(Bt==="shift"||Lt==="shift"||vt==="center")wn.push(pn,en);else wn.push(en,pn);wn.push(Ok({...dn,apply({elements:{floating:An},availableWidth:Vn,availableHeight:Jn,rects:Yn}){if(!Qt.current)return;let Sn=An.style;Sn.setProperty(cO,`${Vn}px`),Sn.setProperty(uO,`${Jn}px`);let Fn=m(An).devicePixelRatio||1,{x:ur,y:Pr,width:Wn,height:Zn}=Yn.reference,vr=(Math.round((ur+Wn)*Fn)-Math.round(ur*Fn))/Fn,wr=(Math.round((Pr+Zn)*Fn)-Math.round(Pr*Fn))/Fn;Sn.setProperty(sO,`${vr}px`),Sn.setProperty(aO,`${wr}px`)}}),tO((An)=>({element:fn.current||d(An.elements.floating).createElement("div"),padding:fn.current?Et:0,offsetParent:"floating"}),[Et]),{name:"transformOrigin",fn(An){let{elements:{floating:Vn},middlewareData:Jn,placement:Yn,platform:Sn,rects:Fn,y:ur}=An,Pr=as(Yn),Wn=qs(Yn),Zn=ls(Pr)==="y",vr=fn.current,wr=typeof yt==="function"?yt(pO(An,bt,zt)):yt,Hn;if(!vr&&Wn&&Math.abs(Zn?Jn.shift?.x||0:Jn.shift?.y||0)<=1)Hn=Wn==="start"===(Zn&&Sn.isRTL?.(Vn)===!0)?"100%":"0%";else{let Qn=Zn?Jn.arrow?.x||0:Jn.arrow?.y||0,br=Zn?vr?.clientWidth||0:vr?.clientHeight||0;Hn=`${Qn+br/2}px`}let er=Pr==="top"||Pr==="left"?`calc(100% + ${wr}px)`:`${-wr}px`;if(nn&&Zn&&Math.abs(Jn.shift?.y||0)>wr)er=`${Fn.reference.y+Fn.reference.height/2-ur}px`;return Vn.style.setProperty(lO,Zn?`${Hn} ${er}`:`${er} ${Hn}`),{}}},nO,Ot),i(()=>{if(!Mt&&Pt)Pt.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[Mt,Pt]);let cn=Is.useMemo(()=>({ancestorScroll:!kt,elementResize:!kt&&typeof ResizeObserver<"u",layoutShift:!kt&&typeof IntersectionObserver<"u"}),[kt]),{refs:mn,elements:Pn,x:Rn,y:Cn,middlewareData:kn,update:Jt,placement:Yt,context:un,isPositioned:vn,floatingStyles:_n}=st({rootContext:Pt,open:Tt?Mt:void 0,placement:rn,middleware:wn,strategy:gt,whileElementsMounted:Tt?void 0:(...An)=>Zg(...An,cn),nodeId:Nt,externalTree:_t}),{sideX:zn,sideY:$n}=kn.adaptiveOrigin||rO,Mn=vn?gt:"fixed",Gn=Is.useMemo(()=>{let An;if(!vn)An={position:Mn,top:0,left:0};else if(Ot)An={position:Mn,[zn]:Rn,[$n]:Cn};else An={..._n,position:Mn};if(An[cO]="100vw",An[uO]="100vh",!vn)An.opacity=0;return An},[Ot,Mn,zn,Rn,$n,Cn,_n,vn]),sr=Is.useRef(null);i(()=>{if(!Mt)return;let An=qt.current,Vn=typeof An==="function"?An():An,Yn=(dO(Vn)?Vn.current:Vn)||null||null;if(Yn!==sr.current)mn.setPositionReference(Yn),sr.current=Yn},[Mt,mn,jt,qt]),Is.useEffect(()=>{if(!Mt)return;let An=qt.current;if(typeof An==="function")return;if(dO(An)&&An.current!==sr.current)mn.setPositionReference(An.current),sr.current=An.current},[Mt,mn,jt,qt]),Is.useEffect(()=>{if(Tt&&Mt&&Pn.reference&&Pn.floating)return Zg(Pn.reference,Pn.floating,Jt,cn);return},[Tt,Mt,Pn,Jt,cn]);let gr=as(Yt),qn=fO(bt,gr,zt),Bn=qs(Yt)||"center",Tr=Boolean(kn.hide?.referenceHidden);i(()=>{if(Dt&&Mt&&vn&&gr!==tn)Ft(gr)},[Dt,Mt,vn,gr,tn]);let lr=Is.useMemo(()=>({position:"absolute",top:kn.arrow?.y,left:kn.arrow?.x}),[kn.arrow]),no=kn.arrow?.centerOffset!==0;return Is.useMemo(()=>({positionerStyles:Gn,arrowStyles:lr,arrowRef:fn,arrowUncentered:no,side:qn,align:Bn,physicalSide:gr,anchorHidden:Tr,refs:mn,context:un,isPositioned:vn,update:Jt}),[Gn,lr,fn,no,qn,Bn,gr,Tr,mn,un,vn,Jt])}function dO(ot){return ot!=null&&"current"in ot}function cl(ot){return ot==="starting"?f_:g}function Kc(ot,st,{styles:ct,transitionStatus:gt,props:bt,refs:yt,hidden:vt,inert:xt=!1}){let wt={...ct};if(xt)wt.pointerEvents="none";return l("div",ot,{state:st,ref:yt,props:[{role:"presentation",hidden:vt,style:wt},cl(gt),bt],stateAttributesMapping:_g})}var mO=e(t(),1);function Lk(){let ot=Dc(),st=ot.useState("toasts");return mO.useMemo(()=>({toasts:st,add:ot.addToast,close:ot.closeToast,update:ot.updateToast,promise:ot.promiseToast}),[st,ot])}function Bk(){let ot=new Set;function st(ct){ot.forEach((gt)=>gt(ct))}return{" subscribe":function(gt){return ot.add(gt),()=>{ot.delete(gt)}},add(ct){let gt=ct.id||$y("toast"),bt={...ct,id:gt,transitionStatus:"starting"};return st({action:"add",options:bt}),gt},close(ct){st({action:"close",options:{id:ct}})},update(ct,gt){st({action:"update",options:{id:ct,updates:gt}})},promise(ct,gt){let bt=ct;return st({action:"promise",options:{...gt,promise:ct,setPromise(yt){bt=yt}}}),bt}}}var Fee=[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}],["path",{d:"M16 5.25l-8 4.5",key:"svg-4"}]],hO=o("outline","package","Package",Fee);var Hee=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M10 10l2 -2v8",key:"svg-1"}]],bO=o("outline","circle-number-1","CircleNumber1",Hee);var zee=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M10 8h3a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 0 -1 1v2a1 1 0 0 0 1 1h3",key:"svg-1"}]],yO=o("outline","circle-number-2","CircleNumber2",zee);var $ee=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M10 9a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1",key:"svg-1"}]],vO=o("outline","circle-number-3","CircleNumber3",$ee);var Wee=[["path",{d:"M3 12h4l3 8l4 -16l3 8h4",key:"svg-0"}]],xO=o("outline","activity","Activity",Wee);var Uee=[["path",{d:"M12.802 2.165l5.575 2.389c.48 .206 .863 .589 1.07 1.07l2.388 5.574c.22 .512 .22 1.092 0 1.604l-2.389 5.575c-.206 .48 -.589 .863 -1.07 1.07l-5.574 2.388c-.512 .22 -1.092 .22 -1.604 0l-5.575 -2.389a2.036 2.036 0 0 1 -1.07 -1.07l-2.388 -5.574a2.036 2.036 0 0 1 0 -1.604l2.389 -5.575c.206 -.48 .589 -.863 1.07 -1.07l5.574 -2.388a2.036 2.036 0 0 1 1.604 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],wO=o("outline","alert-octagon","AlertOctagon",Uee);var jee=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],_0=o("outline","alert-triangle","AlertTriangle",jee);var Vee=[["path",{d:"M4 13h5",key:"svg-0"}],["path",{d:"M12 16v-8h3a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-3",key:"svg-1"}],["path",{d:"M20 8v8",key:"svg-2"}],["path",{d:"M9 16v-5.5a2.5 2.5 0 0 0 -5 0v5.5",key:"svg-3"}]],CO=o("outline","api","Api",Vee);var Gee=[["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2",key:"svg-0"}],["path",{d:"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-10",key:"svg-1"}],["path",{d:"M10 12l4 0",key:"svg-2"}]],SO=o("outline","archive","Archive",Gee);var Kee=[["path",{d:"M9 14l-4 -4l4 -4",key:"svg-0"}],["path",{d:"M5 10h11a4 4 0 1 1 0 8h-1",key:"svg-1"}]],O0=o("outline","arrow-back-up","ArrowBackUp",Kee);var qee=[["path",{d:"M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1",key:"svg-0"}]],EO=o("outline","arrow-back","ArrowBack",qee);var Qee=[["path",{d:"M15 14l4 -4l-4 -4",key:"svg-0"}],["path",{d:"M19 10h-11a4 4 0 1 0 0 8h1",key:"svg-1"}]],kO=o("outline","arrow-forward-up","ArrowForwardUp",Qee);var Jee=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]],L0=o("outline","arrow-right","ArrowRight",Jee);var Xee=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],RO=o("outline","arrow-up","ArrowUp",Xee);var Yee=[["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M7 8h10",key:"svg-1"}],["path",{d:"M7 12h10",key:"svg-2"}],["path",{d:"M7 16h10",key:"svg-3"}]],B0=o("outline","article","Article",Yee);var Zee=[["path",{d:"M12 12v.01",key:"svg-0"}],["path",{d:"M19.071 4.929c-1.562 -1.562 -6 .337 -9.9 4.243c-3.905 3.905 -5.804 8.337 -4.242 9.9c1.562 1.561 6 -.338 9.9 -4.244c3.905 -3.905 5.804 -8.337 4.242 -9.9",key:"svg-1"}],["path",{d:"M4.929 4.929c-1.562 1.562 .337 6 4.243 9.9c3.905 3.905 8.337 5.804 9.9 4.242c1.561 -1.562 -.338 -6 -4.244 -9.9c-3.905 -3.905 -8.337 -5.804 -9.9 -4.242",key:"svg-2"}]],TO=o("outline","atom","Atom",Zee);var ete=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],PO=o("outline","bell","Bell",ete);var tte=[["path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11",key:"svg-0"}]],F0=o("outline","bolt","Bolt",tte);var nte=[["path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-0"}],["path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-1"}],["path",{d:"M3 6l0 13",key:"svg-2"}],["path",{d:"M12 6l0 13",key:"svg-3"}],["path",{d:"M21 6l0 13",key:"svg-4"}]],IO=o("outline","book","Book",nte);var rte=[["path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8",key:"svg-0"}],["path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8",key:"svg-1"}],["path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5",key:"svg-2"}],["path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0",key:"svg-3"}],["path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5",key:"svg-4"}],["path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10",key:"svg-5"}]],MO=o("outline","brain","Brain",rte);var ote=[["path",{d:"M3 9a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -9",key:"svg-0"}],["path",{d:"M8 7v-2a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v2",key:"svg-1"}],["path",{d:"M12 12l0 .01",key:"svg-2"}],["path",{d:"M3 13a20 20 0 0 0 18 0",key:"svg-3"}]],AO=o("outline","briefcase","Briefcase",ote);var ite=[["path",{d:"M4 8h16",key:"svg-0"}],["path",{d:"M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6",key:"svg-1"}],["path",{d:"M8 4v4",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16v6",key:"svg-4"}]],H0=o("outline","browser-plus","BrowserPlus",ite);var ste=[["path",{d:"M9 9v-1a3 3 0 0 1 6 0v1",key:"svg-0"}],["path",{d:"M8 9h8a6 6 0 0 1 1 3v3a5 5 0 0 1 -10 0v-3a6 6 0 0 1 1 -3",key:"svg-1"}],["path",{d:"M3 13l4 0",key:"svg-2"}],["path",{d:"M17 13l4 0",key:"svg-3"}],["path",{d:"M12 20l0 -6",key:"svg-4"}],["path",{d:"M4 19l3.35 -2",key:"svg-5"}],["path",{d:"M20 19l-3.35 -2",key:"svg-6"}],["path",{d:"M4 7l3.75 2.4",key:"svg-7"}],["path",{d:"M20 7l-3.75 2.4",key:"svg-8"}]],NO=o("outline","bug","Bug",ste);var ate=[["path",{d:"M3 12h1m8 -9v1m8 8h1m-15.4 -6.4l.7 .7m12.1 -.7l-.7 .7",key:"svg-0"}],["path",{d:"M9 16a5 5 0 1 1 6 0a3.5 3.5 0 0 0 -1 3a2 2 0 0 1 -4 0a3.5 3.5 0 0 0 -1 -3",key:"svg-1"}],["path",{d:"M9.7 17l4.6 0",key:"svg-2"}]],DO=o("outline","bulb","Bulb",ate);var lte=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],_O=o("outline","calendar","Calendar",lte);var cte=[["path",{d:"M5 7h1a2 2 0 0 0 2 -2a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1a2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M9 13a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],OO=o("outline","camera","Camera",cte);var ute=[["path",{d:"M3 13a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -6",key:"svg-0"}],["path",{d:"M15 9a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -10",key:"svg-1"}],["path",{d:"M9 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -14",key:"svg-2"}],["path",{d:"M4 20h14",key:"svg-3"}]],LO=o("outline","chart-bar","ChartBar",ute);var pte=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Ys=o("outline","check","Check",pte);var dte=[["path",{d:"M12 3c1.918 0 3.52 1.35 3.91 3.151a4 4 0 0 1 2.09 7.723l0 7.126h-12v-7.126a4 4 0 1 1 2.092 -7.723a4 4 0 0 1 3.908 -3.151",key:"svg-0"}],["path",{d:"M6.161 17.009l11.839 -.009",key:"svg-1"}]],BO=o("outline","chef-hat","ChefHat",dte);var fte=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],qc=o("outline","chevron-down","ChevronDown",fte);var mte=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],sc=o("outline","chevron-right","ChevronRight",mte);var gte=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],FO=o("outline","chevron-up","ChevronUp",gte);var hte=[["path",{d:"M7 7l5 5l-5 5",key:"svg-0"}],["path",{d:"M13 7l5 5l-5 5",key:"svg-1"}]],HO=o("outline","chevrons-right","ChevronsRight",hte);var bte=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]],zO=o("outline","circle-check","CircleCheck",bte);var yte=[["path",{d:"M6.657 18c-2.572 0 -4.657 -2.007 -4.657 -4.483c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-11.878",key:"svg-0"}]],$O=o("outline","cloud","Cloud",yte);var vte=[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M14 4l-4 16",key:"svg-2"}]],WO=o("outline","code","Code",vte);var xte=[["path",{d:"M8 16l2 -6l6 -2l-2 6l-6 2",key:"svg-0"}],["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-1"}],["path",{d:"M12 3l0 2",key:"svg-2"}],["path",{d:"M12 19l0 2",key:"svg-3"}],["path",{d:"M3 12l2 0",key:"svg-4"}],["path",{d:"M19 12l2 0",key:"svg-5"}]],UO=o("outline","compass","Compass",xte);var wte=[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],z0=o("outline","copy","Copy",wte);var Cte=[["path",{d:"M5 6a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1l0 -12",key:"svg-0"}],["path",{d:"M9 9h6v6h-6l0 -6",key:"svg-1"}],["path",{d:"M3 10h2",key:"svg-2"}],["path",{d:"M3 14h2",key:"svg-3"}],["path",{d:"M10 3v2",key:"svg-4"}],["path",{d:"M14 3v2",key:"svg-5"}],["path",{d:"M21 10h-2",key:"svg-6"}],["path",{d:"M21 14h-2",key:"svg-7"}],["path",{d:"M14 21v-2",key:"svg-8"}],["path",{d:"M10 21v-2",key:"svg-9"}]],jO=o("outline","cpu","Cpu",Cte);var Ste=[["path",{d:"M21 16.008v-8.018a1.98 1.98 0 0 0 -1 -1.717l-7 -4.008a2.016 2.016 0 0 0 -2 0l-7 4.008c-.619 .355 -1 1.01 -1 1.718v8.018c0 .709 .381 1.363 1 1.717l7 4.008a2.016 2.016 0 0 0 2 0l7 -4.008c.619 -.355 1 -1.01 1 -1.718",key:"svg-0"}],["path",{d:"M12 22v-10",key:"svg-1"}],["path",{d:"M12 12l8.73 -5.04",key:"svg-2"}],["path",{d:"M3.27 6.96l8.73 5.04",key:"svg-3"}]],VO=o("outline","cube","Cube",Ste);var Ete=[["path",{d:"M4 6a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],GO=o("outline","database","Database",Ete);var kte=[["path",{d:"M12 5h3.5a5 5 0 0 1 0 10h-5.5l-4.015 4.227a2.3 2.3 0 0 1 -3.923 -2.035l1.634 -8.173a5 5 0 0 1 4.904 -4.019h3.4",key:"svg-0"}],["path",{d:"M14 15l4.07 4.284a2.3 2.3 0 0 0 3.925 -2.023l-1.6 -8.232",key:"svg-1"}],["path",{d:"M8 9v2",key:"svg-2"}],["path",{d:"M7 10h2",key:"svg-3"}],["path",{d:"M14 10h2",key:"svg-4"}]],KO=o("outline","device-gamepad-2","DeviceGamepad2",kte);var Rte=[["path",{d:"M6 5h12l3 5l-8.5 9.5a.7 .7 0 0 1 -1 0l-8.5 -9.5l3 -5",key:"svg-0"}],["path",{d:"M10 12l-2 -2.2l.6 -1",key:"svg-1"}]],qO=o("outline","diamond","Diamond",Rte);var Tte=[["path",{d:"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],$0=o("outline","dots","Dots",Tte);var Pte=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],QO=o("outline","download","Download",Pte);var Ite=[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],W0=o("outline","edit","Edit",Ite);var Mte=[["path",{d:"M19 14.083c0 4.154 -2.966 6.74 -7 6.917c-4.2 0 -7 -2.763 -7 -6.917c0 -5.538 3.5 -11.09 7 -11.083c3.5 .007 7 5.545 7 11.083",key:"svg-0"}],["path",{d:"M12 3l-1.5 5l3.5 2.5l-2 3.5",key:"svg-1"}]],JO=o("outline","egg-cracked","EggCracked",Mte);var Ate=[["path",{d:"M4 20l10 -10m0 -5v5h5m-9 -1v5h5m-9 -1v5h5m-5 -5l4 -4l4 -4",key:"svg-0"}],["path",{d:"M19 10c.638 -.636 1 -1.515 1 -2.486a3.515 3.515 0 0 0 -3.517 -3.514c-.97 0 -1.847 .367 -2.483 1m-3 13l4 -4l4 -4",key:"svg-1"}]],XO=o("outline","feather","Feather",Ate);var Nte=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M12 21h-5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v4.5",key:"svg-1"}],["path",{d:"M14 17.5a2.5 2.5 0 1 0 5 0a2.5 2.5 0 1 0 -5 0",key:"svg-2"}],["path",{d:"M18.5 19.5l2.5 2.5",key:"svg-3"}]],U0=o("outline","file-search","FileSearch",Nte);var Dte=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}]],df=o("outline","file","File",Dte);var _te=[["path",{d:"M12 10.941c2.333 -3.308 .167 -7.823 -1 -8.941c0 3.395 -2.235 5.299 -3.667 6.706c-1.43 1.408 -2.333 3.294 -2.333 5.588c0 3.704 3.134 6.706 7 6.706c3.866 0 7 -3.002 7 -6.706c0 -1.712 -1.232 -4.403 -2.333 -5.588c-2.084 3.353 -3.257 3.353 -4.667 2.235",key:"svg-0"}]],YO=o("outline","flame","Flame",_te);var Ote=[["path",{d:"M9 3l6 0",key:"svg-0"}],["path",{d:"M10 9l4 0",key:"svg-1"}],["path",{d:"M10 3v6l-4 11a.7 .7 0 0 0 .5 1h11a.7 .7 0 0 0 .5 -1l-4 -11v-6",key:"svg-2"}]],ZO=o("outline","flask","Flask",Ote);var Lte=[["path",{d:"M15 19h-10a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v3.5",key:"svg-0"}],["path",{d:"M19 16v3",key:"svg-1"}],["path",{d:"M19 22v.01",key:"svg-2"}]],eL=o("outline","folder-exclamation","FolderExclamation",Lte);var Bte=[["path",{d:"M8 4h1l3 3h7a2 2 0 0 1 2 2v8m-2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 1.189 -1.829",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]],tL=o("outline","folder-off","FolderOff",Bte);var Fte=[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]],nL=o("outline","folder","Folder",Fte);var Hte=[["path",{d:"M5 11a7 7 0 0 1 14 0v7a1.78 1.78 0 0 1 -3.1 1.4a1.65 1.65 0 0 0 -2.6 0a1.65 1.65 0 0 1 -2.6 0a1.65 1.65 0 0 0 -2.6 0a1.78 1.78 0 0 1 -3.1 -1.4v-7",key:"svg-0"}],["path",{d:"M10 10l.01 0",key:"svg-1"}],["path",{d:"M14 10l.01 0",key:"svg-2"}],["path",{d:"M10 14a3.5 3.5 0 0 0 4 0",key:"svg-3"}]],rL=o("outline","ghost","Ghost",Hte);var zte=[["path",{d:"M3 9a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1l0 -2",key:"svg-0"}],["path",{d:"M12 8l0 13",key:"svg-1"}],["path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7",key:"svg-2"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5",key:"svg-3"}]],oL=o("outline","gift","Gift",zte);var $te=[["path",{d:"M7 9a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M5.75 15a8.015 8.015 0 1 0 9.25 -13",key:"svg-1"}],["path",{d:"M11 17v4",key:"svg-2"}],["path",{d:"M7 21h8",key:"svg-3"}]],iL=o("outline","globe","Globe",$te);var Wte=[["path",{d:"M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572",key:"svg-0"}]],sL=o("outline","heart","Heart",Wte);var Ute=[["path",{d:"M19.875 6.27a2.225 2.225 0 0 1 1.125 1.948v7.284c0 .809 -.443 1.555 -1.158 1.948l-6.75 4.27a2.269 2.269 0 0 1 -2.184 0l-6.75 -4.27a2.225 2.225 0 0 1 -1.158 -1.948v-7.285c0 -.809 .443 -1.554 1.158 -1.947l6.75 -3.98a2.33 2.33 0 0 1 2.25 0l6.75 3.98h-.033",key:"svg-0"}]],aL=o("outline","hexagon","Hexagon",Ute);var jte=[["path",{d:"M12 8l0 4l2 2",key:"svg-0"}],["path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5",key:"svg-1"}]],lL=o("outline","history","History",jte);var Vte=[["path",{d:"M5 12l-2 0l9 -9l9 9l-2 0",key:"svg-0"}],["path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7",key:"svg-1"}],["path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6",key:"svg-2"}]],cL=o("outline","home","Home",Vte);var Gte=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]],uL=o("outline","info-circle","InfoCircle",Gte);var Kte=[["path",{d:"M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0",key:"svg-0"}],["path",{d:"M15 9h.01",key:"svg-1"}]],j0=o("outline","key","Key",Kte);var qte=[["path",{d:"M4 6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -1",key:"svg-0"}],["path",{d:"M4 15a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -3",key:"svg-1"}],["path",{d:"M14 6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -3",key:"svg-2"}],["path",{d:"M14 17a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -1",key:"svg-3"}]],V0=o("outline","layout-2","Layout2",qte);var Qte=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M15 4l0 16",key:"svg-1"}]],pL=o("outline","layout-sidebar-right","LayoutSidebarRight",Qte);var Jte=[["path",{d:"M5 21c.5 -4.5 2.5 -8 7 -10",key:"svg-0"}],["path",{d:"M9 18c6.218 0 10.5 -3.288 11 -12v-2h-4.014c-9 0 -11.986 4 -12 9c0 1 0 3 2 5h3l.014 0",key:"svg-1"}]],dL=o("outline","leaf","Leaf",Jte);var Xte=[["path",{d:"M14 15.5a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0",key:"svg-0"}],["path",{d:"M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5",key:"svg-1"}],["path",{d:"M3 13h7",key:"svg-2"}],["path",{d:"M21 12v7",key:"svg-3"}]],G0=o("outline","letter-case","LetterCase",Xte);var Yte=[["path",{d:"M7 5.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 7.26a2.005 2.005 0 0 0 -1.012 1.737v10c0 1.1 .9 2 2 2h10c.75 0 1.158 -.385 1.5 -1",key:"svg-1"}],["path",{d:"M11 7h5",key:"svg-2"}],["path",{d:"M11 10h6",key:"svg-3"}],["path",{d:"M11 13h3",key:"svg-4"}]],fL=o("outline","library","Library",Yte);var Zte=[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]],No=o("outline","loader-2","Loader2",Zte);var ene=[["path",{d:"M12 6l0 -3",key:"svg-0"}],["path",{d:"M16.25 7.75l2.15 -2.15",key:"svg-1"}],["path",{d:"M18 12l3 0",key:"svg-2"}],["path",{d:"M16.25 16.25l2.15 2.15",key:"svg-3"}],["path",{d:"M12 18l0 3",key:"svg-4"}],["path",{d:"M7.75 16.25l-2.15 2.15",key:"svg-5"}],["path",{d:"M6 12l-3 0",key:"svg-6"}],["path",{d:"M7.75 7.75l-2.15 -2.15",key:"svg-7"}]],mL=o("outline","loader","Loader",ene);var tne=[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]],gL=o("outline","logout","Logout",tne);var nne=[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]],hL=o("outline","mail","Mail",nne);var rne=[["path",{d:"M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13",key:"svg-0"}],["path",{d:"M9 4v13",key:"svg-1"}],["path",{d:"M15 7v13",key:"svg-2"}]],bL=o("outline","map","Map",rne);var one=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M12 21l-3 -3h-3a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6",key:"svg-2"}],["path",{d:"M16 22l5 -5",key:"svg-3"}],["path",{d:"M21 21.5v-4.5h-4.5",key:"svg-4"}]],yL=o("outline","message-2-share","Message2Share",one);var ine=[["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",key:"svg-0"}],["path",{d:"M9.5 9h.01",key:"svg-1"}],["path",{d:"M14.5 9h.01",key:"svg-2"}],["path",{d:"M9.5 13a3.5 3.5 0 0 0 5 0",key:"svg-3"}]],vL=o("outline","message-chatbot","MessageChatbot",ine);var sne=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",key:"svg-2"}]],xL=o("outline","message","Message",sne);var ane=[["path",{d:"M5 12l14 0",key:"svg-0"}]],wL=o("outline","minus","Minus",ane);var lne=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 10l.01 0",key:"svg-1"}],["path",{d:"M15 10l.01 0",key:"svg-2"}],["path",{d:"M9.5 15.25a3.5 3.5 0 0 1 5 0",key:"svg-3"}]],CL=o("outline","mood-sad","MoodSad",lne);var cne=[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008",key:"svg-0"}]],SL=o("outline","moon","Moon",cne);var une=[["path",{d:"M3 20h18l-6.921 -14.612a2.3 2.3 0 0 0 -4.158 0l-6.921 14.612",key:"svg-0"}],["path",{d:"M7.5 11l2 2.5l2.5 -2.5l2 3l2.5 -2",key:"svg-1"}]],EL=o("outline","mountain","Mountain",une);var pne=[["path",{d:"M3 17a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-0"}],["path",{d:"M13 17a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}],["path",{d:"M9 17v-13h10v13",key:"svg-2"}],["path",{d:"M9 8h10",key:"svg-3"}]],kL=o("outline","music","Music",pne);var dne=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],RL=o("outline","palette","Palette",dne);var fne=[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]],K0=o("outline","paperclip","Paperclip",fne);var mne=[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]],TL=o("outline","photo","Photo",mne);var gne=[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10",key:"svg-0"}],["path",{d:"M9 19v-6",key:"svg-1"}],["path",{d:"M8 5v8h2v-8",key:"svg-2"}],["path",{d:"M15 19v-6",key:"svg-3"}],["path",{d:"M14 5v8h2v-8",key:"svg-4"}]],q0=o("outline","piano","Piano",gne);var hne=[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]],PL=o("outline","pin","Pin",hne);var bne=[["path",{d:"M18.816 13.58c2.292 2.138 3.546 4 3.092 4.9c-.745 1.46 -5.783 -.259 -11.255 -3.838c-5.47 -3.579 -9.304 -7.664 -8.56 -9.123c.464 -.91 2.926 -.444 5.803 .805",key:"svg-0"}],["path",{d:"M5 12a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-1"}]],IL=o("outline","planet","Planet",bne);var yne=[["path",{d:"M9.007 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M5 21l3 -3l.75 -1.5",key:"svg-1"}],["path",{d:"M14 21v-4l-4 -3l.5 -6",key:"svg-2"}],["path",{d:"M5 12l1 -3l4.5 -1l3.5 3l4 -.5",key:"svg-3"}],["path",{d:"M18.007 15.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0",key:"svg-4"}]],ML=o("outline","play-basketball","PlayBasketball",yne);var vne=[["path",{d:"M3 17l5 1l.75 -1.5",key:"svg-0"}],["path",{d:"M14 21v-4l-4 -3l1 -6",key:"svg-1"}],["path",{d:"M6 12v-3l5 -1l3 3l3 1",key:"svg-2"}],["path",{d:"M18.007 19.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0",key:"svg-3"}],["path",{d:"M10.007 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-4"}]],Fk=o("outline","play-football","PlayFootball",vne);var xne=[["path",{d:"M11.007 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M19.007 9.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0",key:"svg-1"}],["path",{d:"M2 16l5 1l.5 -2.5",key:"svg-2"}],["path",{d:"M11.5 21l2.5 -5.5l-5.5 -3.5l3.5 -4l3 4l4 2",key:"svg-3"}]],AL=o("outline","play-volleyball","PlayVolleyball",xne);var wne=[["path",{d:"M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5",key:"svg-0"}],["path",{d:"M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5",key:"svg-1"}],["path",{d:"M3 21l2.5 -2.5",key:"svg-2"}],["path",{d:"M18.5 5.5l2.5 -2.5",key:"svg-3"}],["path",{d:"M10 11l-2 2",key:"svg-4"}],["path",{d:"M13 14l-2 2",key:"svg-5"}]],Q0=o("outline","plug-connected","PlugConnected",wne);var Cne=[["path",{d:"M9.785 6l8.215 8.215l-2.054 2.054a5.81 5.81 0 1 1 -8.215 -8.215l2.054 -2.054",key:"svg-0"}],["path",{d:"M4 20l3.5 -3.5",key:"svg-1"}],["path",{d:"M15 4l-3.5 3.5",key:"svg-2"}],["path",{d:"M20 9l-3.5 3.5",key:"svg-3"}]],NL=o("outline","plug","Plug",Cne);var Sne=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],Ci=o("outline","plus","Plus",Sne);var Ene=[["path",{d:"M3 4a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4",key:"svg-0"}],["path",{d:"M15 16a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4",key:"svg-1"}],["path",{d:"M21 11v-3a2 2 0 0 0 -2 -2h-6l3 3m0 -6l-3 3",key:"svg-2"}],["path",{d:"M3 13v3a2 2 0 0 0 2 2h6l-3 -3m0 6l3 -3",key:"svg-3"}]],DL=o("outline","replace","Replace",Ene);var kne=[["path",{d:"M6 6a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -4",key:"svg-0"}],["path",{d:"M12 2v2",key:"svg-1"}],["path",{d:"M9 12v9",key:"svg-2"}],["path",{d:"M15 12v9",key:"svg-3"}],["path",{d:"M5 16l4 -2",key:"svg-4"}],["path",{d:"M15 14l4 2",key:"svg-5"}],["path",{d:"M9 18h6",key:"svg-6"}],["path",{d:"M10 8v.01",key:"svg-7"}],["path",{d:"M14 8v.01",key:"svg-8"}]],_L=o("outline","robot","Robot",kne);var Rne=[["path",{d:"M4 13a8 8 0 0 1 7 7a6 6 0 0 0 3 -5a9 9 0 0 0 6 -8a3 3 0 0 0 -3 -3a9 9 0 0 0 -8 6a6 6 0 0 0 -5 3",key:"svg-0"}],["path",{d:"M7 14a6 6 0 0 0 -3 6a6 6 0 0 0 6 -3",key:"svg-1"}],["path",{d:"M14 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],OL=o("outline","rocket","Rocket",Rne);var Tne=[["path",{d:"M19.953 8.017l1.047 6.983v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-2l1.245 -8.297a2 2 0 0 1 1.977 -1.703h3.778",key:"svg-0"}],["path",{d:"M3 15h18",key:"svg-1"}],["path",{d:"M13 3l5.5 1.5",key:"svg-2"}],["path",{d:"M15.75 3.75l-2 7",key:"svg-3"}],["path",{d:"M7 10.5c1.667 -.667 3.333 -.667 5 0c1.667 .667 3.333 .667 5 0",key:"svg-4"}]],LL=o("outline","sandbox","Sandbox",Tne);var Pne=[["path",{d:"M3 15c2 3 4 4 7 4s7 -3 7 -7s-3 -7 -6 -7s-5 1.5 -5 4s2 5 6 5s8.408 -2.453 10 -5",key:"svg-0"}]],ff=o("outline","scribble","Scribble",Pne);var Ine=[["path",{d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],BL=o("outline","search","Search",Ine);var Mne=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],Qc=o("outline","settings","Settings",Mne);var Ane=[["path",{d:"M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3",key:"svg-0"}]],FL=o("outline","shield","Shield",Ane);var Nne=[["path",{d:"M4 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M15 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M17 17h-11v-14h-2",key:"svg-2"}],["path",{d:"M6 5l14 1l-1 7h-13",key:"svg-3"}]],HL=o("outline","shopping-cart","ShoppingCart",Nne);var Dne=[["path",{d:"M19 8.71l-5.333 -4.148a2.666 2.666 0 0 0 -3.274 0l-5.334 4.148a2.665 2.665 0 0 0 -1.029 2.105v7.2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-7.2c0 -.823 -.38 -1.6 -1.03 -2.105",key:"svg-0"}],["path",{d:"M16 15c-2.21 1.333 -5.792 1.333 -8 0",key:"svg-1"}]],zL=o("outline","smart-home","SmartHome",Dne);var _ne=[["path",{d:"M10 4l2 1l2 -1",key:"svg-0"}],["path",{d:"M12 2v6.5l3 1.72",key:"svg-1"}],["path",{d:"M17.928 6.268l.134 2.232l1.866 1.232",key:"svg-2"}],["path",{d:"M20.66 7l-5.629 3.25l.01 3.458",key:"svg-3"}],["path",{d:"M19.928 14.268l-1.866 1.232l-.134 2.232",key:"svg-4"}],["path",{d:"M20.66 17l-5.629 -3.25l-2.99 1.738",key:"svg-5"}],["path",{d:"M14 20l-2 -1l-2 1",key:"svg-6"}],["path",{d:"M12 22v-6.5l-3 -1.72",key:"svg-7"}],["path",{d:"M6.072 17.732l-.134 -2.232l-1.866 -1.232",key:"svg-8"}],["path",{d:"M3.34 17l5.629 -3.25l-.01 -3.458",key:"svg-9"}],["path",{d:"M4.072 9.732l1.866 -1.232l.134 -2.232",key:"svg-10"}],["path",{d:"M3.34 7l5.629 3.25l2.99 -1.738",key:"svg-11"}]],$L=o("outline","snowflake","Snowflake",_ne);var One=[["path",{d:"M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6",key:"svg-0"}]],WL=o("outline","sparkles","Sparkles",One);var Lne=[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245",key:"svg-0"}]],UL=o("outline","star","Star",Lne);var Bne=[["path",{d:"M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]],jL=o("outline","sun","Sun",Bne);var Fne=[["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M7 12a5 5 0 1 0 10 0a5 5 0 1 0 -10 0",key:"svg-1"}],["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-2"}]],VL=o("outline","target","Target",Fne);var Hne=[["path",{d:"M8 9l3 3l-3 3",key:"svg-0"}],["path",{d:"M13 15l3 0",key:"svg-1"}],["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -12",key:"svg-2"}]],GL=o("outline","terminal-2","Terminal2",Hne);var zne=[["path",{d:"M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5",key:"svg-0"}]],KL=o("outline","tool","Tool",zne);var $ne=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],J0=o("outline","trash","Trash",$ne);var Wne=[["path",{d:"M8 21l8 0",key:"svg-0"}],["path",{d:"M12 17l0 4",key:"svg-1"}],["path",{d:"M7 4l10 0",key:"svg-2"}],["path",{d:"M17 4v8a5 5 0 0 1 -10 0v-8",key:"svg-3"}],["path",{d:"M3 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-4"}],["path",{d:"M17 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-5"}]],qL=o("outline","trophy","Trophy",Wne);var Une=[["path",{d:"M5.343 7.343a8 8 0 1 1 11.314 11.314l-11.314 -11.314",key:"svg-0"}],["path",{d:"M10.828 13.34l-4.242 4.243a2 2 0 1 0 2.828 2.828",key:"svg-1"}]],QL=o("outline","umbrella-2","Umbrella2",Une);var jne=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],JL=o("outline","upload","Upload",jne);var Vne=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],X0=o("outline","user","User",Vne);var Gne=[["path",{d:"M10 13a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M8 21v-1a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v1",key:"svg-1"}],["path",{d:"M15 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-2"}],["path",{d:"M17 10h2a2 2 0 0 1 2 2v1",key:"svg-3"}],["path",{d:"M5 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-4"}],["path",{d:"M3 13v-1a2 2 0 0 1 2 -2h2",key:"svg-5"}]],XL=o("outline","users-group","UsersGroup",Gne);var Kne=[["path",{d:"M17 8v-3a1 1 0 0 0 -1 -1h-10a2 2 0 0 0 0 4h12a1 1 0 0 1 1 1v3m0 4v3a1 1 0 0 1 -1 1h-12a2 2 0 0 1 -2 -2v-12",key:"svg-0"}],["path",{d:"M20 12v4h-4a2 2 0 0 1 0 -4h4",key:"svg-1"}]],YL=o("outline","wallet","Wallet",Kne);var qne=[["path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3",key:"svg-0"}],["path",{d:"M15 6l3 3",key:"svg-1"}],["path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2",key:"svg-2"}],["path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2",key:"svg-3"}]],ZL=o("outline","wand","Wand",qne);var Qne=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M3.6 9h16.8",key:"svg-1"}],["path",{d:"M3.6 15h16.8",key:"svg-2"}],["path",{d:"M11.5 3a17 17 0 0 0 0 18",key:"svg-3"}],["path",{d:"M12.5 3a17 17 0 0 1 0 18",key:"svg-4"}]],e5=o("outline","world","World",Qne);var Jne=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],zo=o("outline","x","X",Jne);var Xne=[["path",{d:"M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm.01 13l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z",key:"svg-0"}]],t5=o("filled","alert-circle-filled","AlertCircleFilled",Xne);var Yne=[["path",{d:"M13 2l.018 .001l.016 .001l.083 .005l.011 .002h.011l.038 .009l.052 .008l.016 .006l.011 .001l.029 .011l.052 .014l.019 .009l.015 .004l.028 .014l.04 .017l.021 .012l.022 .01l.023 .015l.031 .017l.034 .024l.018 .011l.013 .012l.024 .017l.038 .034l.022 .017l.008 .01l.014 .012l.036 .041l.026 .027l.006 .009c.12 .147 .196 .322 .218 .513l.001 .012l.002 .041l.004 .064v6h5a1 1 0 0 1 .868 1.497l-.06 .091l-8 11c-.568 .783 -1.808 .38 -1.808 -.588v-6h-5a1 1 0 0 1 -.868 -1.497l.06 -.091l8 -11l.01 -.013l.018 -.024l.033 -.038l.018 -.022l.009 -.008l.013 -.014l.04 -.036l.028 -.026l.008 -.006a1 1 0 0 1 .402 -.199l.011 -.001l.027 -.005l.074 -.013l.011 -.001l.041 -.002z",key:"svg-0"}]],Hk=o("filled","bolt-filled","BoltFilled",Yne);var Zne=[["path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z",key:"svg-0"}]],Y0=o("filled","circle-check-filled","CircleCheckFilled",Zne);var ere=[["path",{d:"M15.113 3.21l.094 .083l5.5 5.5a1 1 0 0 1 -1.175 1.59l-3.172 3.171l-1.424 3.797a1 1 0 0 1 -.158 .277l-.07 .08l-1.5 1.5a1 1 0 0 1 -1.32 .082l-.095 -.083l-2.793 -2.792l-3.793 3.792a1 1 0 0 1 -1.497 -1.32l.083 -.094l3.792 -3.793l-2.792 -2.793a1 1 0 0 1 -.083 -1.32l.083 -.094l1.5 -1.5a1 1 0 0 1 .258 -.187l.098 -.042l3.796 -1.425l3.171 -3.17a1 1 0 0 1 1.497 -1.26z",key:"svg-0"}]],n5=o("filled","pin-filled","PinFilled",ere);var tre=[["path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",key:"svg-0"}]],r5=o("filled","player-stop-filled","PlayerStopFilled",tre);var Yr=e(r(),1),qr=Bk();function nre({...ot}){return Yr.jsx(s_,{...ot})}function rre({...ot}){return Yr.jsx(Y_,{"data-slot":"toast-portal",...ot})}function ore({className:ot,...st}){return Yr.jsx(u_,{"data-slot":"toast-viewport",className:n("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",ot),...st})}function ire({className:ot,...st}){return Yr.jsx(I_,{"data-slot":"toast",className:n("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-xl bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",ot),...st})}function sre({className:ot,...st}){return Yr.jsx(M_,{"data-slot":"toast-content",className:n("flex items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",ot),...st})}function are({className:ot,...st}){return Yr.jsx(F_,{"data-slot":"toast-title",className:n("text-sm font-medium",ot),...st})}function lre({className:ot,...st}){return Yr.jsx(L_,{"data-slot":"toast-description",className:n("text-sm text-muted-foreground",ot),...st})}function cre({className:ot,render:st=Yr.jsx(a,{variant:"outline",size:"sm"}),...ct}){return Yr.jsx($_,{"data-slot":"toast-action",render:st,className:n("shrink-0",ot),...ct})}function ure({className:ot,children:st,render:ct=Yr.jsx(a,{variant:"ghost",size:"icon-sm"}),...gt}){return Yr.jsx(H_,{"data-slot":"toast-close","aria-label":"Close toast",render:ct,className:n("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",ot),...gt,children:st??Yr.jsx(zo,{"aria-hidden":"true",stroke:1.75})})}function pre({type:ot}){let st=null;if(ot==="success")st=Yr.jsx(zO,{"aria-hidden":"true",stroke:1.75});if(ot==="info")st=Yr.jsx(uL,{"aria-hidden":"true",stroke:1.75});if(ot==="warning")st=Yr.jsx(_0,{"aria-hidden":"true",stroke:1.75});if(ot==="error")st=Yr.jsx(wO,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if(ot==="loading")st=Yr.jsx(mL,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!st)return null;return Yr.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:st})}function dre(){let{toasts:ot}=Lk();return ot.map((st)=>Yr.jsx(ire,{toast:st,children:Yr.jsxs(sre,{children:[Yr.jsx(pre,{type:st.type}),Yr.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[Yr.jsx(are,{}),Yr.jsx(lre,{})]}),Yr.jsx(cre,{}),Yr.jsx(ure,{})]})},st.id))}function o5({children:ot,toastManager:st=qr,...ct}){return Yr.jsxs(nre,{toastManager:st,...ct,children:[ot,Yr.jsx(rre,{children:Yr.jsx(ore,{children:Yr.jsx(dre,{})})})]})}var SBe=Bk,EBe=Lk;var mf=e(t(),1);var Z0=e(t(),1),zk=Z0.createContext(void 0);function Jc(ot){let st=Z0.useContext(zk);if(st===void 0&&!ot)throw Error(c(72));return st}var i5=e(t(),1);var fre={...il,disabled:(ot)=>ot.disabled,instantType:(ot)=>ot.instantType,isInstantPhase:(ot)=>ot.isInstantPhase,trackCursorAxis:(ot)=>ot.trackCursorAxis,disableHoverablePopup:(ot)=>ot.disableHoverablePopup,lastOpenChangeReason:(ot)=>ot.openChangeReason,closeOnClick:(ot)=>ot.closeOnClick,closeDelay:(ot)=>ot.closeDelay,adaptiveOrigin:(ot)=>ot.adaptiveOrigin};class $k extends Gi{constructor(ot,st,ct){let gt=new Ta;super(mre(ot,gt,st,ct),gre(gt),fre)}setOpen=(ot,st)=>{x0(this,ot,st,{extraState:{openChangeReason:st.reason}})};cancelPendingOpen(ot){this.state.floatingRootContext.dispatchOpenChange(!1,Ln(Xa,ot))}}function mre(ot,st,ct,gt=!1){return{...ol(st,ct,gt),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...ot}}function gre(ot){return{popupRef:i5.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:ot}}var eh=e(r(),1),s5=va(function(st){let{disabled:ct=!1,defaultOpen:gt=!1,open:bt,disableHoverablePopup:yt=!1,trackCursorAxis:vt="none",actionsRef:xt,onOpenChange:wt,onOpenChangeComplete:Ct,handle:St,triggerId:Et,defaultTriggerId:kt=null,children:Rt}=st,Tt=jc((Vt,Wt)=>new $k({open:gt,openProp:bt,activeTriggerId:kt,triggerIdProp:Et},Vt,Wt));Tt.useControlledProp("openProp",bt),Tt.useControlledProp("triggerIdProp",Et),Tt.useContextCallback("onOpenChange",wt),Tt.useContextCallback("onOpenChangeComplete",Ct);let Pt=Tt.useState("open"),Mt=!ct&&Pt,It=Tt.useState("activeTriggerId"),At=Tt.useState("mounted"),Nt=Tt.useState("payload");Tt.useSyncedValues({trackCursorAxis:vt,disableHoverablePopup:yt,disabled:ct}),tl(Tt,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:Ot,transitionStatus:Dt}=nl(Mt,Tt),_t=Tt.useState("isInstantPhase"),$t=Tt.useState("instantType"),Ft=Tt.useState("lastOpenChangeReason"),Bt=mf.useRef(null);i(()=>{if(Pt&&ct)Tt.setOpen(!1,Ln(j_))},[Pt,ct,Tt]),i(()=>{if(Dt==="ending"&&Ft===ec||Dt!=="ending"&&_t){if($t!=="delay")Bt.current=$t;Tt.set("instantType","delay")}else if(Bt.current!==null)Tt.set("instantType",Bt.current),Bt.current=null},[Dt,_t,Ft,$t,Tt]),i(()=>{if(Mt){if(It==null)Tt.set("payload",void 0)}},[Tt,It,Mt]),mf.useImperativeHandle(xt,()=>({unmount:Ot,close:()=>Tt.setOpen(!1,Ln(Vg))}),[Ot,Tt]);let Lt=Mt||At||!ct&&vt!=="none";return eh.jsxs(zk.Provider,{value:Tt,children:[St&&eh.jsx(Za,{handle:St,store:Tt}),Lt&&eh.jsx(hre,{store:Tt,disabled:ct,trackCursorAxis:vt}),typeof Rt==="function"?Rt({payload:Nt}):Rt]})});function hre({store:ot,disabled:st,trackCursorAxis:ct}){let gt=ot.useState("floatingRootContext"),bt=Ra(gt,{enabled:!st,referencePress:()=>ot.select("closeOnClick")}),yt=gk(gt,{enabled:!st&&ct!=="none",axis:ct==="none"?void 0:ct}),vt=mf.useMemo(()=>O(yt.reference,bt.reference),[yt.reference,bt.reference]);return rl(ot,{activeTriggerProps:vt,inactiveTriggerProps:vt,popupProps:bt.floating??g}),null}var tv=e(t(),1);function Cr(ot){return Ts(ot,"base-ui")}var ev=e(t(),1),Wk=ev.createContext(void 0);function a5(){return ev.useContext(Wk)}var l5=600;var u5="data-base-ui-tooltip-trigger";function c5(ot){if("composedPath"in ot){let ct=ot.composedPath();for(let gt=0;gt<ct.length;gt+=1){let bt=ct[gt];if(f(bt))return bt}}let st=ot.target;if(f(st))return st;return null}function bre(ot){let st=ot;while(st){let ct=st.closest(`[${u5}]`);if(ct)return ct;let gt=st.getRootNode();st="host"in gt&&f(gt.host)?gt.host:null}return null}var p5=ja(function(st,ct){let{render:gt,className:bt,style:yt,handle:vt,payload:xt,disabled:wt,delay:Ct,closeOnClick:St=!0,closeDelay:Et,id:kt,...Rt}=st,Tt=Jc(!0),Mt=sl(vt)??Tt;if(!Mt)throw Error(c(82));let It=Cr(kt),At=Mt.useState("isTriggerActive",It),Nt=Mt.useState("isOpenedByTrigger",It),Ot=Mt.useState("floatingRootContext"),Dt=tv.useRef(null),_t=Et??0,{registerTrigger:$t,isMountedByThisTrigger:Ft}=el(It,Dt,Mt,{payload:xt,closeOnClick:St,closeDelay:_t}),Bt=a5(),{activeIdRef:Lt,delayRef:Vt,isInstantPhase:Wt,hasProvider:Ut}=lk(Ot,{open:Nt}),Ht=uf(Ot);Mt.useSyncedValue("isInstantPhase",Wt);let Gt=Mt.useState("disabled"),jt=wt??Gt,qt=io(jt),Qt=Mt.useState("trackCursorAxis"),Xt=Mt.useState("disableHoverablePopup"),zt=tv.useRef(!1),tn=Xr(),rn=tv.useRef(void 0);function Kt(){if(Ut&&Lt.current!=null)return 0;return Ct??Bt??l5}function an(gn){let xn=Dt.current;if(!xn||!gn)return!1;let wn=bre(gn);return wn!==null&&wn!==xn&&On(xn,wn)}function ln(gn){let xn=an(gn);if(zt.current=xn,xn)Ht.openChangeTimeout.clear(),Ht.restTimeout.clear(),Ht.restTimeoutPending=!1,tn.clear();return xn}let Zt=oc(Ot,{enabled:!jt,mouseOnly:!0,move:!1,handleClose:!Xt&&Qt!=="both"?ic():null,restMs:Kt,delay(){if(Et==null&&Ut)return{close:ka(Vt.current,"close")};return{close:_t}},triggerElementRef:Dt,isActiveTrigger:At,isClosing:()=>Mt.select("transitionStatus")==="ending",shouldOpen(){return!zt.current}}),on=Fp(Ot,{enabled:!jt}).reference,sn=(gn)=>{let xn=zt.current,wn=c5(gn),yn=ln(wn),nn=Dt.current,en=nn&&wn&&On(nn,wn);if(yn&&Mt.select("open")&&Mt.select("lastOpenChangeReason")===Ao){Mt.setOpen(!1,Ln(Ao,gn));return}if(xn&&!yn&&en&&!qt.current&&!Mt.select("open")&&nn&&Rs(rn.current)){let pn=()=>{if(!zt.current&&!qt.current&&!Mt.select("open"))Mt.setOpen(!0,Ln(Ao,gn,nn))},cn=Kt();if(cn===0)tn.clear(),pn();else tn.start(cn,pn)}},dn=Mt.useState("triggerProps",Ft);return l("button",st,{state:{open:Nt},ref:[ct,$t,Dt],props:[Zt,on,Ft||Qt!=="none"?dn:void 0,{onMouseOver(gn){sn(gn.nativeEvent)},onFocus(gn){if(an(c5(gn.nativeEvent)))gn.preventBaseUIHandler()},onMouseLeave(){zt.current=!1,tn.clear(),rn.current=void 0},onPointerEnter(gn){rn.current=gn.pointerType},onPointerDown(gn){if(rn.current=gn.pointerType,Mt.set("closeOnClick",St),St&&!Mt.select("open"))Mt.cancelPendingOpen(gn.nativeEvent)},onClick(gn){if(St&&!Mt.select("open"))Mt.cancelPendingOpen(gn.nativeEvent)},id:It,[Og]:jt?"":void 0,[u5]:jt?void 0:""},Rt],stateAttributesMapping:Lc})});var f5=e(t(),1);var nv=e(t(),1),Uk=nv.createContext(void 0);function d5(){let ot=nv.useContext(Uk);if(ot===void 0)throw Error(c(70));return ot}var jk=e(r(),1),m5=f5.forwardRef(function(st,ct){let{keepMounted:gt=!1,...bt}=st;if(!(Jc().useState("mounted")||gt))return null;return jk.jsx(Uk.Provider,{value:gt,children:jk.jsx(af,{ref:ct,...bt})})});var ov=e(t(),1);var rv=e(t(),1),Vk=rv.createContext(void 0);function g5(){let ot=rv.useContext(Vk);if(ot===void 0)throw Error(c(71));return ot}var h5=e(r(),1),b5=ov.forwardRef(function(st,ct){let{render:gt,className:bt,anchor:yt,positionMethod:vt="absolute",side:xt="top",align:wt="center",sideOffset:Ct=0,alignOffset:St=0,collisionBoundary:Et="clipping-ancestors",collisionPadding:kt=5,arrowPadding:Rt=5,sticky:Tt=!1,disableAnchorTracking:Pt=!1,collisionAvoidance:Mt=$c,style:It,...At}=st,Nt=Jc(),Ot=d5(),Dt=Nt.useState("open"),_t=Nt.useState("mounted"),$t=Nt.useState("trackCursorAxis"),Ft=Nt.useState("disableHoverablePopup"),Bt=Nt.useState("floatingRootContext"),Lt=Nt.useState("instantType"),Vt=Nt.useState("transitionStatus"),Wt=Nt.useState("adaptiveOrigin"),Ut=Gc({anchor:yt,positionMethod:vt,floatingRootContext:Bt,mounted:_t,side:xt,sideOffset:Ct,align:wt,alignOffset:St,collisionBoundary:Et,collisionPadding:kt,sticky:Tt,arrowPadding:Rt,disableAnchorTracking:Pt,keepMounted:Ot,collisionAvoidance:Mt,adaptiveOrigin:Wt}),Ht=ov.useMemo(()=>({open:Dt,side:Ut.side,align:Ut.align,anchorHidden:Ut.anchorHidden,instant:$t!=="none"?"tracking-cursor":Lt}),[Dt,Ut.side,Ut.align,Ut.anchorHidden,$t,Lt]),Gt=Kc(st,Ht,{styles:Ut.positionerStyles,transitionStatus:Vt,props:At,refs:[ct,Nt.useStateSetter("positionerElement")],hidden:!_t,inert:!Dt||$t==="both"||Ft});return h5.jsx(Vk.Provider,{value:Ut,children:Gt})});var y5=e(t(),1);var v5=y5.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,...vt}=st,xt=Jc(),{side:wt,align:Ct}=g5(),St=xt.useState("open"),Et=xt.useState("instantType"),kt=xt.useState("transitionStatus"),Rt=xt.useState("popupProps"),Tt=xt.useState("floatingRootContext"),Pt=xt.useState("disabled"),Mt=xt.useState("closeDelay");Ro({open:St,ref:xt.context.popupRef,onComplete(){if(St)xt.context.onOpenChangeComplete?.(!0)}}),rc(Tt,{enabled:!Pt,closeDelay:Mt});let It=xt.useStateSetter("popupElement");return l("div",st,{state:{open:St,side:wt,align:Ct,instant:Et,transitionStatus:kt},ref:[ct,xt.context.popupRef,It],props:[Ya,Rt,cl(kt),vt],stateAttributesMapping:Va})});var x5=e(t(),1);var Gk=e(r(),1),w5=function(st){let{delay:ct,closeDelay:gt,timeout:bt=400}=st,yt=x5.useMemo(()=>({open:ct,close:gt}),[ct,gt]);return Gk.jsx(Wk.Provider,{value:ct,children:Gk.jsx(ak,{delay:yt,timeoutMs:bt,children:st.children})})};var iv=e(t(),1),Xc=e(r(),1);function Zs({portal:ot,children:st,...ct}){let[gt,bt]=iv.useState(void 0),yt=iv.useCallback((vt)=>{if(vt)bt(vt.closest("[data-applet]")?.getAttribute("data-applet")??void 0)},[]);return Xc.jsxs(Xc.Fragment,{children:[Xc.jsx("span",{hidden:!0,ref:yt}),Xc.jsx(ot,{...ct,children:Xc.jsx("div",{"data-applet":gt,className:"contents",children:st})})]})}var $p=e(r(),1);function sv({delay:ot=100,...st}){return $p.jsx(w5,{"data-slot":"tooltip-provider",delay:ot,...st})}function Wr({...ot}){return $p.jsx(s5,{"data-slot":"tooltip",...ot})}function Ur({...ot}){return $p.jsx(p5,{"data-slot":"tooltip-trigger",...ot})}function jr({className:ot,side:st="top",sideOffset:ct=6,align:gt="center",alignOffset:bt=0,children:yt,...vt}){return $p.jsx(Zs,{portal:m5,children:$p.jsx(b5,{align:gt,alignOffset:bt,side:st,sideOffset:ct,className:"isolate z-50",children:$p.jsx(v5,{"data-slot":"tooltip-content",className:u("z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",ot),...vt,children:yt})})})}function av({cooldownMs:ot,windowMs:st,maxPerWindow:ct,maxKeys:gt=256,now:bt=Date.now}){let yt=new Map,vt=0,xt=0;return{admit(wt){let Ct=bt(),St=yt.get(wt);if(St!==void 0&&Ct-St<ot)return"cooldown";if(Ct-vt>=st)vt=Ct,xt=0;if(xt>=ct)return"window";if(xt++,yt.set(wt,Ct),yt.size>gt)for(let Et of[...yt.keys()].slice(0,Math.ceil(gt/2)))yt.delete(Et);return"ok"}}}var yre=av({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function Ms(ot,st){let ct=[ot,st.source,st.kind,st.name,st.message].join("\x00");if(yre.admit(ct)!=="ok")return;fetch(`/api/workspaces/${ot}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[st]})}).catch(()=>{})}var vre=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function S5(ot){if(!ot)return null;let st=vre.exec(ot);if(!st)return null;return{workspaceId:st[1],kind:st[2]==="widgets"?"widget":"view",name:st[3]}}var E5=!1;function k5(){if(E5)return;E5=!0;let ot=(st,ct,gt)=>{let bt=ct instanceof Error?ct:null,yt=bt?.stack??"",vt=st??S5(yt);if(!vt)return;Ms(vt.workspaceId,{source:"window",kind:vt.kind,name:vt.name,message:bt?.message||gt||String(ct),...yt?{stack:yt}:{}})};window.addEventListener("error",(st)=>ot(S5(st.filename),st.error,st.message)),window.addEventListener("unhandledrejection",(st)=>ot(null,st.reason))}function gf(ot){return`${location.protocol==="https:"?"wss":"ws"}://${location.host}${ot}`}function hf(ot,st){return`${ot}:${st}`}function th(ot){return ot==="running"}function R5(ot){return Object.values(ot).some(th)}function bf(ot,st,ct){return th(ot[hf(st,ct)])}function cv(ot,st){let ct=`${st}:`;return Object.entries(ot).some(([gt,bt])=>gt.startsWith(ct)&&th(bt))}function As(ot,st){return hf(ot,st??"new")}function lv(ot,st,ct){for(let[gt,bt]of Object.entries(ot)){if(!gt.startsWith(`${st}:`))continue;let yt=bt.find((vt)=>vt.localId===ct);if(yt)return{key:gt,attachment:yt}}}var Mr=Xe()((ot)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(st,ct,gt)=>ot((bt)=>({activity:{...bt.activity,[hf(st,ct)]:gt}})),reconcileActivity:(st)=>ot(()=>({activity:Object.fromEntries(st.map((ct)=>[hf(ct.workspaceId,ct.sessionId),ct.activity]))})),setError:(st,ct,gt)=>ot((bt)=>({errors:{...bt.errors,[hf(st,ct)]:gt}})),setPreview:(st)=>ot((ct)=>({previews:{...ct.previews,[st.messageId]:{workspaceId:st.workspaceId,sessionId:st.sessionId,parentToolUseId:st.parentToolUseId,blocks:st.blocks,updatedAt:Date.now()}}})),clearPreview:(st)=>ot((ct)=>{if(!(st in ct.previews))return ct;let{[st]:gt,...bt}=ct.previews;return{previews:bt}}),clearPreviewsForSession:(st,ct)=>ot((gt)=>{let bt={},yt=!1;for(let[vt,xt]of Object.entries(gt.previews))if(xt.workspaceId===st&&xt.sessionId===ct)yt=!0;else bt[vt]=xt;return yt?{previews:bt}:gt}),clearAllPreviews:()=>ot((st)=>Object.keys(st.previews).length?{previews:{}}:st),sweepPreviews:(st,ct)=>ot((gt)=>{let bt={},yt=!1;for(let[vt,xt]of Object.entries(gt.previews))if(ct-xt.updatedAt>st)yt=!0;else bt[vt]=xt;return yt?{previews:bt}:gt}),addAttachments:(st,ct,gt)=>ot((bt)=>{let yt=As(st,ct);return{attachments:{...bt.attachments,[yt]:[...bt.attachments[yt]??[],...gt]}}}),updateAttachment:(st,ct,gt)=>ot((bt)=>{let yt=lv(bt.attachments,st,ct);if(!yt)return{};let{key:vt,attachment:xt}=yt,wt=bt.attachments[vt];if(xt.kind!=="text"&&xt.previewUrl&&"previewUrl"in gt&&gt.previewUrl!==xt.previewUrl)URL.revokeObjectURL(xt.previewUrl);return{attachments:{...bt.attachments,[vt]:wt.map((Ct)=>Ct.localId===ct&&Ct.kind!=="text"?{...Ct,...gt}:Ct)}}}),removeAttachment:(st,ct)=>ot((gt)=>{let bt=lv(gt.attachments,st,ct);if(!bt)return{};let{key:yt,attachment:vt}=bt,xt=gt.attachments[yt];if(vt.kind!=="text"&&vt.previewUrl)URL.revokeObjectURL(vt.previewUrl);return{attachments:{...gt.attachments,[yt]:xt.filter((wt)=>wt.localId!==ct)}}}),clearAttachments:(st,ct)=>ot((gt)=>{let bt=As(st,ct);for(let vt of gt.attachments[bt]??[])if(vt.kind!=="text"&&vt.previewUrl)URL.revokeObjectURL(vt.previewUrl);let yt={...gt.attachments};return delete yt[bt],{attachments:yt}}),renameSession:(st,ct,gt)=>ot((bt)=>{let yt=As(st,ct),vt=hf(st,gt);if(yt===vt)return bt;if(!(yt in bt.activity)&&!(yt in bt.errors)&&!(yt in bt.attachments)&&!Object.values(bt.previews).some((kt)=>kt.workspaceId===st&&kt.sessionId===ct))return bt;let xt={...bt.activity},wt={...bt.errors};if(yt in xt)xt[vt]=xt[yt],delete xt[yt];if(yt in wt)wt[vt]=wt[yt],delete wt[yt];let Ct=bt.previews,St=!1;for(let[kt,Rt]of Object.entries(bt.previews))if(Rt.workspaceId===st&&Rt.sessionId===ct){if(!St)Ct={...bt.previews},St=!0;Ct[kt]={...Rt,sessionId:gt}}let Et=bt.attachments;if(yt!==vt&&Et[yt])Et={...Et,[vt]:[...Et[vt]??[],...Et[yt]]},delete Et[yt];return{activity:xt,errors:wt,previews:Ct,attachments:Et}})}));function T5(ot,st,ct){if(!ct)return{root:null,byParent:{}};let gt=null,bt={};for(let yt of Object.values(ot)){if(yt.workspaceId!==st||yt.sessionId!==ct)continue;if(yt.parentToolUseId===null){if(!gt||yt.updatedAt>gt.updatedAt)gt=yt}else{let vt=bt[yt.parentToolUseId];if(!vt||yt.updatedAt>vt.updatedAt)bt[yt.parentToolUseId]=yt}}return{root:gt,byParent:bt}}function gi(ot){return rt(Mr,ot)}var Tn={all:["workspaces"],discover:["workspaces","discover"],previews:["workspaces","previews"],layout:(ot)=>["workspaces","layout",ot],widgets:(ot)=>["workspaces","widgets",ot],appletThumbnails:(ot)=>["workspaces","applet-thumbnails",ot],views:(ot)=>["workspaces","views",ot],sessions:(ot)=>["workspaces","sessions",ot],events:(ot,st)=>["workspaces","events",ot,st],state:(ot)=>["workspaces","state",ot],mcp:(ot)=>["workspaces","mcp",ot],harness:(ot)=>["workspaces","harness",ot],skills:(ot)=>["workspaces","skills",ot],env:(ot)=>["workspaces","env",ot]};function nh(){return{turns:[],notices:[]}}function uv(ot,st){switch(st.kind){case"snapshot":return{...ot,snapshot:st.snapshot};case"turn":{let ct=ot.turns.findIndex((bt)=>bt.id===st.turn.id);if(ct>=0)return{...ot,turns:ot.turns.map((bt,yt)=>yt===ct?st.turn:bt)};if(st.turn.seq===void 0)return{...ot,turns:[...ot.turns,st.turn]};let gt=ot.turns.findIndex((bt)=>bt.seq!==void 0&&bt.seq>st.turn.seq);if(gt<0)return{...ot,turns:[...ot.turns,st.turn]};return{...ot,turns:[...ot.turns.slice(0,gt),st.turn,...ot.turns.slice(gt)]}}case"notice":{if(ot.notices.some((ct)=>ct.id===st.notice.id))return{...ot,notices:ot.notices.map((ct)=>ct.id===st.notice.id?st.notice:ct)};return{...ot,notices:[...ot.notices,st.notice]}}case"result":return{...ot,result:st.result}}}function P5(ot){let st=nh(),ct=new Map,gt=new Map,bt=-1/0;for(let yt of ot)switch(yt.kind){case"snapshot":st.snapshot=yt.snapshot;break;case"turn":{let vt=yt.turn,xt=vt.seq,wt=ct.get(vt.id);if(wt!==void 0)st.turns[wt]=vt;else{let Ct=xt!==void 0&&xt<bt?st.turns.findIndex((St)=>St.seq!==void 0&&St.seq>xt):-1;if(Ct<0)ct.set(vt.id,st.turns.length),st.turns.push(vt);else{st.turns.splice(Ct,0,vt);for(let St=Ct;St<st.turns.length;St++)ct.set(st.turns[St].id,St)}}if(xt!==void 0)bt=Math.max(bt,xt);break}case"notice":gt.set(yt.notice.id,yt.notice);break;case"result":st.result=yt.result;break}return st.notices=[...gt.values()],st}var Kk=new WeakMap;function I5(ot,st,ct,gt){for(let bt of Kk.get(ot)??[])if(bt.workspaceId===st&&bt.sessionId===ct)bt.events.push(gt)}function M5(ot,st){return Vl({queryKey:Tn.events(ot,st),queryFn:async({client:ct,signal:gt})=>{let bt=Kk.get(ct)??new Set;Kk.set(ct,bt);let yt={workspaceId:ot,sessionId:st,events:[]};bt.add(yt);try{let vt=await p(`/api/workspaces/${ot}/sessions/${st}/events`,{signal:gt},"Couldn’t load chat");return P5([...vt,...yt.events])}finally{bt.delete(yt)}},staleTime:1/0,gcTime:300000})}var Hf=e(t(),1);var A5={all:["app-ui"],browserTabSelection:(ot)=>["app-ui","browser-tab-selection",ot]};var N5=(ot)=>`moi:collab:${ot}:session`,pv=()=>({selected:{}});function Wp(ot){try{let st=sessionStorage.getItem(N5(ot));if(!st)return pv();if(!st.startsWith("{"))return{selected:{overview:st}};let ct=JSON.parse(st);if(!ct||typeof ct!=="object"||!("selected"in ct))return pv();let gt=ct.selected;if(!gt||typeof gt!=="object"||Array.isArray(gt))return pv();return{selected:Object.fromEntries(Object.entries(gt).filter(([,bt])=>typeof bt==="string"||bt===null))}}catch{return pv()}}function Yc(ot,st){try{sessionStorage.setItem(N5(ot),JSON.stringify({selected:st.selected}))}catch{}}var ps=e(t(),1);function ul(ot){return ot==="overview"||ot==="scratchpad"||typeof ot==="string"&&/^views\/[a-zA-Z0-9_-]+$/.test(ot)}function Up(ot){try{let st=decodeURIComponent(ot);return ul(st)?st:void 0}catch{return}}var To=(ot)=>`views/${ot}`,yf=(ot)=>ot.startsWith("views/")?ot.slice(6):void 0;function pl(ot){return typeof ot==="object"&&ot!==null&&!Array.isArray(ot)}var Zc={status:"disconnected",connectionId:null,connections:[],users:[],error:null},xre=[],D5=(ot,st)=>JSON.stringify([ot,st]);class qk{state=Zc;usersState=Zc;channels=new Map;listeners=new Set;registrations=new Map;location=null;send=()=>{};getSnapshot=()=>this.state;getUsersSnapshot=()=>this.usersState;getPresenceSnapshot=(ot,st)=>this.channels.get(D5(ot,st))??xre;subscribe=(ot)=>(this.listeners.add(ot),()=>{this.listeners.delete(ot)});setSender(ot){this.send=ot}connecting(){this.publish({status:"connecting",error:null})}disconnect(ot){this.publish({...Zc,error:ot??null})}setLocation(ot){if(JSON.stringify(this.location)===JSON.stringify(ot))return;if(this.location=ot,this.publish({},!0),this.state.status==="connected")this.send({type:"location",location:ot})}getLocation(){return this.location}setPresence(ot){let st=this.registrations.get(ot.registrationId);if(st&&JSON.stringify(st)===JSON.stringify(ot))return;if(this.registrations.set(ot.registrationId,ot),this.state.status==="connected")this.send({type:"presence:set",...ot})}deletePresence(ot){if(this.registrations.delete(ot),this.state.status==="connected")this.send({type:"presence:delete",registrationId:ot})}receive(ot){switch(ot.type){case"welcome":this.publish({status:"connected",connectionId:ot.connectionId,connections:ot.connections,users:ot.users,error:null});for(let st of this.registrations.values())this.send({type:"presence:set",...st});break;case"connections":this.publish({connections:ot.connections,users:ot.users});break;case"error":this.publish({error:ot.message});break;case"pong":break}}publish(ot,st=!1){this.state={...this.state,...ot};let ct={...this.state,connections:this.state.connections.map((bt)=>({...bt,presence:[]}))};if(st||JSON.stringify(ct)!==JSON.stringify(this.usersState))this.usersState=ct;let gt=new Map;if(this.location?.status==="active")for(let bt of this.state.connections){if(bt.connectionId===this.state.connectionId||bt.location?.page!==this.location.page||bt.location.status!=="active")continue;for(let yt of bt.presence){let vt=D5(yt.appletId,yt.channel),xt=gt.get(vt)??[];xt.push({registrationId:yt.registrationId,connectionId:bt.connectionId,userId:bt.userId,value:yt.value}),gt.set(vt,xt)}}this.channels=new Map([...gt].map(([bt,yt])=>{let vt=this.channels.get(bt);return[bt,vt&&JSON.stringify(vt)===JSON.stringify(yt)?vt:yt]})),this.listeners.forEach((bt)=>bt())}}var eu=()=>{},_5=[],O5={workspaceId:"",enabled:!1,start:()=>eu,getSnapshot:()=>Zc,getUsersSnapshot:()=>Zc,getPresenceSnapshot:()=>_5,subscribe:()=>eu,getCurrentUser:B,subscribeCurrentUser:ue,getDirectory:()=>{return},subscribeDirectory:()=>eu,getLocation:()=>null,setLocation:eu,setPresence:eu,deletePresence:eu};class Qk{workspaceId;enabled;store=new qk;socket=null;retry;heartbeat;unsubscribeMembers;unsubscribeCurrentUser;presenceTimer;queuedPresence=new Map;stopped=!0;attempts=0;lastMessageAt=0;localDirectory;userId=B()?.id;constructor(ot,st=!0){this.workspaceId=ot;this.enabled=st;this.store.setSender((ct)=>this.send(ct))}getSnapshot=()=>this.enabled?this.store.getSnapshot():Zc;getUsersSnapshot=()=>this.enabled?this.store.getUsersSnapshot():Zc;getPresenceSnapshot=(ot,st)=>this.enabled?this.store.getPresenceSnapshot(ot,st):_5;subscribe=(ot)=>this.enabled?this.store.subscribe(ot):eu;getCurrentUser=B;subscribeCurrentUser=ue;getDirectory=()=>{let ot=ut(this.workspaceId);if(ot!==void 0)return ot;let st=j()!=="external"?B():void 0;if(!st)return;if(this.localDirectory?.[0]!==st)this.localDirectory=[st];return this.localDirectory};subscribeDirectory=(ot)=>{let st=Qe(ot),ct=ue(ot);return()=>{st(),ct()}};getLocation=()=>this.enabled?this.store.getLocation():null;setLocation=(ot)=>{this.store.setLocation(ot)};setPresence=(ot)=>{if(this.enabled)this.store.setPresence(ot)};deletePresence=(ot)=>{if(this.enabled)this.store.deletePresence(ot)};start(){if(!this.enabled)return eu;if(!this.stopped)return()=>{};return this.stopped=!1,this.userId=B()?.id,this.unsubscribeCurrentUser=ue(()=>{let ot=B();if(ot?.id!==this.userId)if(this.userId=ot?.id,this.store.disconnect(),clearTimeout(this.retry),this.socket)this.socket.close();else this.connect();else if(ot)this.send({type:"profile",profile:ot})}),this.unsubscribeMembers=Qe(()=>{if(!this.wantsConnection())clearTimeout(this.retry),this.socket?.close(),this.store.disconnect();else this.connect()}),this.connect(),()=>this.stop()}wantsConnection(){let ot=B();return!this.stopped&&ot!==void 0&&this.getDirectory()?.some((st)=>st.id===ot.id)===!0}connect(){if(!this.wantsConnection()){this.store.disconnect();return}if(this.socket)return;clearTimeout(this.retry),this.store.connecting();let ot=new WebSocket(gf(`/api/workspaces/${encodeURIComponent(this.workspaceId)}/collab/ws`));this.socket=ot,ot.onopen=()=>{if(ot!==this.socket)return;this.lastMessageAt=Date.now();let st=B();if(!st){ot.close();return}this.heartbeat=setInterval(()=>{if(Date.now()-this.lastMessageAt>45000)ot.close();else this.rawSend({type:"ping"})},15000),this.rawSend({type:"join",version:lt,profile:st,location:this.store.getLocation()})},ot.onmessage=(st)=>{if(ot!==this.socket)return;this.lastMessageAt=Date.now();try{let ct=JSON.parse(String(st.data));if(ct.type==="welcome")this.attempts=0;let gt=ct.type==="error"&&this.store.getSnapshot().status!=="connected";if(this.store.receive(ct),gt)ot.close()}catch{this.store.disconnect("The collaboration connection returned an invalid message."),ot.close()}},ot.onerror=()=>ot.close(),ot.onclose=()=>{if(ot!==this.socket)return;if(clearInterval(this.heartbeat),clearTimeout(this.presenceTimer),this.presenceTimer=void 0,this.queuedPresence.clear(),this.socket=null,this.store.disconnect(),this.wantsConnection()){let st=Math.min(500*2**this.attempts++,1e4);this.retry=setTimeout(()=>this.connect(),st)}}}send(ot){if(!B()&&(ot.type==="location"||ot.type==="presence:set"||ot.type==="presence:delete"))return;if(ot.type==="presence:set"){if(this.queuedPresence.set(ot.registrationId,ot),!this.presenceTimer)this.presenceTimer=setTimeout(()=>{this.presenceTimer=void 0;for(let st of this.queuedPresence.values())this.rawSend(st);this.queuedPresence.clear()},50);return}if(ot.type==="presence:delete")this.queuedPresence.delete(ot.registrationId);this.rawSend(ot)}rawSend(ot){if(this.socket?.readyState===WebSocket.OPEN)try{this.socket.send(JSON.stringify(ot))}catch{this.socket.close()}}stop(){this.stopped=!0,this.unsubscribeCurrentUser?.(),this.unsubscribeMembers?.(),clearTimeout(this.retry),clearTimeout(this.presenceTimer),this.presenceTimer=void 0,clearInterval(this.heartbeat),this.queuedPresence.clear(),this.socket?.close(),this.socket=null,this.store.disconnect()}}var Zk=e(r(),1),L5=ps.createContext(O5),B5=ps.createContext(null);function Jk(ot,st,ct=""){let gt=`${ct.replace(/\/$/,"")}/workspace/${encodeURIComponent(st)}/`,bt=ot.startsWith(gt)?ot.slice(gt.length):"";return Up(bt)??(bt||"overview")}function Xk({workspaceId:ot,enabled:st,children:ct}){let gt=ps.useMemo(()=>new Qk(ot,st),[ot,st]),bt=pi(),yt=xp(bt),{base:vt}=bt;return ps.useEffect(()=>gt.start(),[gt]),ps.useEffect(()=>{let xt=()=>gt.setLocation({page:Jk(window.location.pathname,ot,vt),status:document.visibilityState==="hidden"?"away":"active"});return xt(),document.addEventListener("visibilitychange",xt),()=>document.removeEventListener("visibilitychange",xt)},[vt,gt,yt,ot]),Zk.jsx(L5,{value:gt,children:ct})}function rh({appletId:ot,active:st=!0,children:ct}){let{enabled:gt}=tu(),bt=ps.useMemo(()=>({active:gt&&st,appletId:ot}),[gt,st,ot]);return Zk.jsx(B5,{value:bt,children:ct})}function tu(){return ps.useContext(L5)}function Yk(){return ps.useContext(B5)}function Si(){let ot=tu(),st=ps.useSyncExternalStore(ot.subscribeCurrentUser,ot.getCurrentUser,ot.getCurrentUser);return ot.enabled&&st!==void 0}var _v=e(t(),1);var oh=e(t(),1);var dv=e(t(),1),eR=dv.createContext(void 0);function ea(ot){let st=dv.useContext(eR);if(st===void 0&&!ot)throw Error(c(47));return st}var fv=e(t(),1),F5=e(_(),1);var wre={...il,disabled:(ot)=>ot.disabled,instantType:(ot)=>ot.instantType,openMethod:(ot)=>ot.openMethod,openChangeReason:(ot)=>ot.openChangeReason,modal:(ot)=>ot.modal,focusManagerModal:(ot)=>ot.focusManagerModal,stickIfOpen:(ot)=>ot.stickIfOpen,titleElementId:(ot)=>ot.titleElementId,descriptionElementId:(ot)=>ot.descriptionElementId,openOnHover:(ot)=>ot.openOnHover,closeDelay:(ot)=>ot.closeDelay,adaptiveOrigin:(ot)=>ot.adaptiveOrigin};class tR extends Gi{constructor(ot,st,ct){let gt=new Ta;super(Cre(ot,gt,st,ct),Sre(gt),wre)}setOpen=(ot,st)=>{let ct=st.reason===Ao,gt=st.reason===Xa&&st.event.detail===0,bt=!ot&&(st.reason===Ug||st.reason==null),yt=Xg(st),vt=this.select("activeTriggerId");if(!ot&&st.reason===W_&&st.trigger==null&&vt!=null)st.trigger=this.context.triggerElements.getById(vt)??this.select("activeTriggerElement")??void 0;if(this.context.onOpenChange?.(ot,st),st.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(ot,st);let xt=()=>{let Ct=Bp(this.state,ot,st.trigger,yt());Ct.openChangeReason=st.reason,this.update(Ct)};if(ct)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(r0,()=>{this.set("stickIfOpen",!1)}),F5.flushSync(xt);else xt();let wt;if(gt)wt="click";else if(bt)wt="dismiss";else if(st.reason===Ip)wt="focus";this.set("instantType",wt)}}function Cre(ot,st,ct,gt=!1){let bt={...ol(st,ct,gt),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...ot};if(bt.open&&ot?.mounted===void 0)bt.mounted=!0;return bt}function Sre(ot){return{popupRef:fv.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:fv.createRef(),beforeContentFocusGuardRef:fv.createRef(),stickIfOpenTimeout:new Ho,triggerElements:ot}}var nu=e(r(),1),H5=va(function({props:st}){let{children:ct,open:gt,defaultOpen:bt=!1,onOpenChange:yt,onOpenChangeComplete:vt,modal:xt=!1,handle:wt,triggerId:Ct,defaultTriggerId:St=null}=st,Et=Ere(wt,{modal:xt,open:bt,openProp:gt,activeTriggerId:St,triggerIdProp:Ct});Et.useControlledProp("openProp",gt),Et.useControlledProp("triggerIdProp",Ct);let kt=Et.useState("open"),Rt=Et.useState("mounted"),Tt=Et.useState("payload");Et.useContextCallback("onOpenChange",yt),Et.useContextCallback("onOpenChangeComplete",vt),w0(Et,kt),tl(Et);let{forceUnmount:Pt}=nl(kt,Et,()=>{Et.update({stickIfOpen:!0,openChangeReason:null})});Et.useSyncedValues({modal:xt}),oh.useEffect(()=>{if(!kt)Et.context.stickIfOpenTimeout.clear()},[Et,kt]),oh.useImperativeHandle(st.actionsRef,()=>({unmount:Pt,close:()=>Et.setOpen(!1,Ln(Vg))}),[Pt,Et]);let Mt=kt||Rt;return nu.jsxs(eR.Provider,{value:Et,children:[wt&&nu.jsx(Za,{handle:wt,store:Et}),Mt&&nu.jsx(kre,{store:Et,modal:xt}),typeof ct==="function"?ct({payload:Tt}):ct]})});function z5(ot){if(ea(!0))return nu.jsx(H5,{props:ot});return nu.jsx(_p,{children:nu.jsx(H5,{props:ot})})}function Ere(ot,st){let ct=jc((gt,bt)=>new tR(st,gt,bt));return oh.useEffect(()=>ct.context.stickIfOpenTimeout.disposeEffect(),[ct]),ct}function kre({store:ot,modal:st}){let ct=ot.useState("floatingRootContext"),gt=Ra(ct,{outsidePressEvent:{mouse:st==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),{reference:bt,floating:yt}=gt;return rl(ot,{activeTriggerProps:bt,inactiveTriggerProps:bt,popupProps:yt}),null}var lh=e(t(),1);var $5=300;var W5=e(t(),1),nR=e(_(),1);function mv(ot,st){let ct=W5.useRef(null);function gt(yt){nR.flushSync(()=>{ot.setOpen(!1,Ln(Ip,yt.nativeEvent,yt.currentTarget))}),r_(ct.current)?.focus()}function bt(yt){let vt=ot.select("positionerElement");if(vt&&Yl(yt,vt))ot.context.beforeContentFocusGuardRef.current?.focus();else{nR.flushSync(()=>{ot.setOpen(!1,Ln(Ip,yt.nativeEvent,yt.currentTarget))});let xt=n_(ot.context.triggerFocusTargetRef.current||st.current);while(xt!==null&&On(vt,xt)){let wt=xt;if(xt=rf(xt),xt===wt)break}xt?.focus()}}return{preFocusGuardRef:ct,handlePreFocusGuardFocus:gt,handleFocusTargetFocus:bt}}var sh=e(t(),1);var ih=e(t(),1);function U5(ot){let st=ih.useRef(""),ct=ih.useCallback((bt)=>{if(bt.defaultPrevented)return;st.current=bt.pointerType,ot(bt,bt.pointerType)},[ot]);return{onClick:ih.useCallback((bt)=>{if(bt.detail===0){ot(bt,"keyboard");return}if("pointerType"in bt)ot(bt,bt.pointerType);else ot(bt,st.current);st.current=""},[ot]),onPointerDown:ct}}var j5=e(t(),1);function dl(ot,st){let ct=j5.useRef(ot),gt=s(st);i(()=>{if(ct.current!==ot)gt(ct.current);ct.current=ot},[ot,gt])}function ah(ot,st){let ct=s((yt,vt)=>{if(!(typeof ot==="function"?ot():ot))st(vt||(Ql.ios?"touch":""))}),{onClick:gt,onPointerDown:bt}=U5(ct);return sh.useMemo(()=>({onClick:gt,onPointerDown:bt}),[gt,bt])}function V5(ot){let[st,ct]=sh.useState(null),gt=ah(ot,ct);return dl(ot,(bt)=>{if(bt&&!ot)ct(null)}),sh.useMemo(()=>({openMethod:st,triggerProps:gt}),[st,gt])}var vf=e(r(),1),G5=ja(function(st,ct){let{render:gt,className:bt,style:yt,disabled:vt=!1,nativeButton:xt=!0,handle:wt,payload:Ct,openOnHover:St=!1,delay:Et=$5,closeDelay:kt=0,id:Rt,...Tt}=st,Pt=ea(!0),It=sl(wt)??Pt;if(!It)throw Error(c(74));let At=Cr(Rt),Nt=It.useState("isTriggerActive",At),Ot=It.useState("floatingRootContext"),Dt=It.useState("isOpenedByTrigger",At),_t=It.useState("triggerPopupId",At),$t=lh.useRef(null),{registerTrigger:Ft,isMountedByThisTrigger:Bt}=el(At,$t,It,{payload:Ct,disabled:vt,openOnHover:St,closeDelay:kt}),Lt=It.useState("openChangeReason"),Vt=It.useState("stickIfOpen"),Wt=It.useState("openMethod"),Ut=It.useState("focusManagerModal"),Ht=oc(Ot,{enabled:!vt&&St&&(Wt!=="touch"||Lt!==Xa),mouseOnly:!0,move:!1,handleClose:ic(),restMs:Et,delay:{close:kt},triggerElementRef:$t,isActiveTrigger:Nt,isClosing:()=>It.select("transitionStatus")==="ending"}),Gt=Lp(Ot,{stickIfOpen:Vt}),jt=ah(()=>It.select("open"),(on)=>{It.set("openMethod",on)}),qt=It.useState("triggerProps",Bt),{getButtonProps:Qt,buttonRef:Xt}=P({disabled:vt,native:xt}),zt={open(on){if(on&&Lt===Xa)return Dg.open(on);return Lc.open(on)}},{preFocusGuardRef:tn,handlePreFocusGuardFocus:rn,handleFocusTargetFocus:Kt}=mv(It,$t),ln=l("button",st,{state:{disabled:vt,open:Dt},ref:[Xt,ct,Ft,$t],props:[Gt.reference,Ht,qt,jt,{[of]:"",id:At,"aria-haspopup":"dialog","aria-expanded":Dt,"aria-controls":_t},Tt,Qt],stateAttributesMapping:zt}),Zt=vf.jsx(lh.Fragment,{children:ln},At);if(Bt&&!Ut)return vf.jsxs(lh.Fragment,{children:[vf.jsx(cs,{ref:tn,onFocus:rn}),Zt,vf.jsx(cs,{ref:It.context.triggerFocusTargetRef,onFocus:Kt})]});return Zt});var q5=e(t(),1);var gv=e(t(),1),rR=gv.createContext(void 0);function K5(){let ot=gv.useContext(rR);if(ot===void 0)throw Error(c(45));return ot}var oR=e(r(),1),Q5=q5.forwardRef(function(st,ct){let{keepMounted:gt=!1,...bt}=st;if(!(ea().useState("mounted")||gt))return null;return oR.jsx(rR.Provider,{value:gt,children:oR.jsx(Ap,{ref:ct,...bt})})});var xv=e(t(),1);var hv=e(t(),1),iR=hv.createContext(void 0);function J5(){let ot=hv.useContext(iR);if(!ot)throw Error(c(46));return ot}var X5=e(t(),1),Y5=e(r(),1),xf=X5.forwardRef(function(st,ct){let{cutout:gt,...bt}=st,yt;if(gt){let vt=gt.getBoundingClientRect();yt=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${vt.left}px ${vt.top}px,${vt.left}px ${vt.bottom}px,${vt.right}px ${vt.bottom}px,${vt.right}px ${vt.top}px,${vt.left}px ${vt.top}px)`}return Y5.jsx("div",{ref:ct,role:"presentation","data-base-ui-inert":"",...bt,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:yt}})});var oB=e(t(),1);var Z5={},eB={},tB="";function bv(ot,st){return ge(ot)?ot:st}function nB(ot,st,ct){return/hidden|clip/.test(ot.getComputedStyle(bv(st,ct)).overflowY)}function Rre(ot){if(typeof document>"u")return!1;let st=d(ot);return m(st).innerWidth-st.documentElement.clientWidth>0}function Tre(ot){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let ct=d(ot),{documentElement:gt,body:bt}=ct,yt=bv(gt,bt),vt=yt.style.overflowY,xt=gt.style.scrollbarGutter;gt.style.scrollbarGutter="stable",yt.style.overflowY="scroll";let wt=yt.offsetWidth;yt.style.overflowY="hidden";let Ct=yt.offsetWidth;return yt.style.overflowY=vt,gt.style.scrollbarGutter=xt,wt===Ct}function Pre(ot){let st=d(ot),{documentElement:ct,body:gt}=st,bt=bv(ct,gt),yt={overflowY:bt.style.overflowY,overflowX:bt.style.overflowX};return Object.assign(bt.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(bt.style,yt)}}function Ire(ot){let st=d(ot),{documentElement:ct,body:gt}=st,bt=m(ct),yt=0,vt=0,xt=!1,wt=xi.create();if(Oc.webkit&&(bt.visualViewport?.scale??1)!==1)return()=>{};function Ct(){let Rt=bt.getComputedStyle(ct),Tt=bt.getComputedStyle(gt),It=(Rt.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";yt=ct.scrollTop,vt=ct.scrollLeft,Z5={scrollbarGutter:ct.style.scrollbarGutter,overflowY:ct.style.overflowY,overflowX:ct.style.overflowX},tB=ct.style.scrollBehavior,eB={position:gt.style.position,height:gt.style.height,width:gt.style.width,boxSizing:gt.style.boxSizing,overflowY:gt.style.overflowY,overflowX:gt.style.overflowX,scrollBehavior:gt.style.scrollBehavior};let At=ct.scrollHeight>ct.clientHeight,Nt=ct.scrollWidth>ct.clientWidth,Ot=Rt.overflowY==="scroll"||Tt.overflowY==="scroll",Dt=Rt.overflowX==="scroll"||Tt.overflowX==="scroll",_t=Math.max(0,bt.innerWidth-gt.clientWidth),$t=Math.max(0,bt.innerHeight-gt.clientHeight),Ft=parseFloat(Tt.marginTop)+parseFloat(Tt.marginBottom),Bt=parseFloat(Tt.marginLeft)+parseFloat(Tt.marginRight),Lt=bv(ct,gt);if(xt=Tre(ot),xt){ct.style.scrollbarGutter=It,Lt.style.overflowY="hidden",Lt.style.overflowX="hidden";return}if(Object.assign(ct.style,{scrollbarGutter:It,overflowY:"hidden",overflowX:"hidden"}),At||Ot)ct.style.overflowY="scroll";if(Nt||Dt)ct.style.overflowX="scroll";Object.assign(gt.style,{position:"relative",height:Ft||$t?`calc(100dvh - ${Ft+$t}px)`:"100dvh",width:Bt||_t?`calc(100vw - ${Bt+_t}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),gt.scrollTop=yt,gt.scrollLeft=vt,ct.setAttribute("data-base-ui-scroll-locked",""),ct.style.scrollBehavior="unset"}function St(){if(Object.assign(ct.style,Z5),Object.assign(gt.style,eB),!xt)ct.scrollTop=yt,ct.scrollLeft=vt,ct.removeAttribute("data-base-ui-scroll-locked"),ct.style.scrollBehavior=tB}function Et(){St(),wt.request(Ct)}Ct();let kt=Xn(bt,"resize",Et);return()=>{if(wt.cancel(),St(),typeof bt.removeEventListener==="function")kt()}}class rB{lockCount=0;restore=null;timeoutLock=Ho.create();timeoutUnlock=Ho.create();acquire(ot){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock(ot));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(ot){if(this.lockCount===0||this.restore!==null)return;let st=d(ot),{documentElement:ct,body:gt}=st,bt=m(ct);if(nB(bt,ct,gt)){let vt=new bt.MutationObserver(()=>{if(nB(bt,ct,gt))return;vt.disconnect(),this.restore=null,this.lock(ot)}),xt={attributes:!0};vt.observe(ct,xt),vt.observe(gt,xt),this.restore=()=>vt.disconnect();return}let yt=Ql.ios||!Rre(ot);this.restore=yt?Pre(ot):Ire(ot)}}var Mre=new rB;function yv(ot=!0,st=null){i(()=>{if(!ot)return;return Mre.acquire(st)},[ot,st])}var Are=20;function vv(ot,st,ct,gt){let[bt,yt]=oB.useState(!1);i(()=>{if(!ot||!st||ct==null){yt(!1);return}let vt=d(ct).documentElement.clientWidth,xt=ct.offsetWidth;yt(vt>0&&xt>0&&xt>=vt-Are)},[ot,st,ct]),yv(ot&&(!st||bt),gt)}var ch=e(r(),1),iB=xv.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,anchor:vt,positionMethod:xt,side:wt,align:Ct,sideOffset:St,alignOffset:Et,collisionBoundary:kt="clipping-ancestors",collisionPadding:Rt,arrowPadding:Tt,sticky:Pt,disableAnchorTracking:Mt=!1,collisionAvoidance:It=$c,...At}=st,Nt=ea(),Ot=K5(),Dt=nc(),_t=Nt.useState("floatingRootContext"),$t=Nt.useState("mounted"),Ft=Nt.useState("open"),Bt=Nt.useState("openChangeReason"),Lt=Nt.useState("activeTriggerElement"),Vt=Nt.useState("modal"),Wt=Nt.useState("openMethod"),Ut=Nt.useState("positionerElement"),Ht=Nt.useState("instantType"),Gt=Nt.useState("transitionStatus"),jt=Nt.useState("adaptiveOrigin"),qt=xv.useRef(null),Qt=Ja(Ut),Xt=Gc({anchor:vt,floatingRootContext:_t,positionMethod:xt,mounted:$t,side:wt,sideOffset:St,align:Ct,alignOffset:Et,arrowPadding:Tt,collisionBoundary:kt,collisionPadding:Rt,sticky:Pt,disableAnchorTracking:Mt,keepMounted:Ot,nodeId:Dt,collisionAvoidance:It,adaptiveOrigin:jt}),zt=_t.useState("domReferenceElement");i(()=>{let ln=zt,Zt=qt.current;if(ln)qt.current=ln;if(Zt&&ln&&ln!==Zt){Nt.set("instantType",void 0);let on=new AbortController;return Qt(()=>{Nt.set("instantType","trigger-change")},on.signal),()=>{on.abort()}}return},[zt,Qt,Nt]);let tn=Vt===!0&&Bt!==Ao;vv(Ft&&tn,Wt==="touch",Ut,Lt);let rn=Nt.useStateSetter("positionerElement"),Kt={open:Ft,side:Xt.side,align:Xt.align,anchorHidden:Xt.anchorHidden,instant:Ht},an=Kc(st,Kt,{styles:Xt.positionerStyles,transitionStatus:Gt,props:At,refs:[ct,rn],hidden:!$t,inert:!Ft});return ch.jsxs(iR.Provider,{value:Xt,children:[$t&&tn&&ch.jsx(xf,{inert:Qa(!Ft),cutout:Lt}),ch.jsx(Dp,{id:Dt,children:an})]})});var uB=e(t(),1);var wf="ArrowUp",Cf="ArrowDown",Sf="ArrowLeft",Ef="ArrowRight",kf="Home",Rf="End",sR="PageUp",aR="PageDown",Pa=new Set([wf,Cf,Sf,Ef,kf,Rf]),Nre="Shift",aB=[Nre,"Control","Alt","Meta"];function Dre(ot){return y(ot)&&ot.tagName==="INPUT"}function lR(ot){if(Dre(ot)&&ot.selectionStart!=null)return!0;if(y(ot)&&ot.tagName==="TEXTAREA")return!0;return!1}function cR(ot,st,ct,gt){if(!ot||!st||!st.scrollTo)return;let{scrollLeft:bt,scrollTop:yt}=ot,vt=ot.clientWidth<ot.scrollWidth,xt=ot.clientHeight<ot.scrollHeight;if(vt&&gt!=="vertical"){let wt=sB(ot,st,"left"),Ct=wv(ot),St=wv(st);if(ct==="ltr"){if(wt+st.offsetWidth+St.scrollMarginRight>ot.scrollLeft+ot.clientWidth-Ct.scrollPaddingRight)bt=wt+st.offsetWidth+St.scrollMarginRight-ot.clientWidth+Ct.scrollPaddingRight;else if(wt-St.scrollMarginLeft<ot.scrollLeft+Ct.scrollPaddingLeft)bt=wt-St.scrollMarginLeft-Ct.scrollPaddingLeft}if(ct==="rtl"){if(wt-St.scrollMarginLeft<ot.scrollLeft+Ct.scrollPaddingLeft)bt=wt-St.scrollMarginLeft-Ct.scrollPaddingLeft;else if(wt+st.offsetWidth+St.scrollMarginRight>ot.scrollLeft+ot.clientWidth-Ct.scrollPaddingRight)bt=wt+st.offsetWidth+St.scrollMarginRight-ot.clientWidth+Ct.scrollPaddingRight}}if(xt&&gt!=="horizontal"){let wt=sB(ot,st,"top"),Ct=wv(ot),St=wv(st);if(wt-St.scrollMarginTop<ot.scrollTop+Ct.scrollPaddingTop)yt=wt-St.scrollMarginTop-Ct.scrollPaddingTop;else if(wt+st.offsetHeight+St.scrollMarginBottom>ot.scrollTop+ot.clientHeight-Ct.scrollPaddingBottom)yt=wt+st.offsetHeight+St.scrollMarginBottom-ot.clientHeight+Ct.scrollPaddingBottom}ot.scrollTo({left:bt,top:yt,behavior:"auto"})}function sB(ot,st,ct){let gt=ct==="left"?"offsetLeft":"offsetTop",bt=0;while(st.offsetParent){if(bt+=st[gt],st.offsetParent===ot)break;st=st.offsetParent}return bt}function wv(ot){let st=getComputedStyle(ot);return{scrollMarginTop:parseFloat(st.scrollMarginTop)||0,scrollMarginRight:parseFloat(st.scrollMarginRight)||0,scrollMarginBottom:parseFloat(st.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(st.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(st.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(st.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(st.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(st.scrollPaddingLeft)||0}}var Cv=e(t(),1),_re=Cv.createContext(void 0);function Sv(ot){let st=Cv.useContext(_re);if(st===void 0&&!ot)throw Error(c(69));return st}var jp=e(t(),1);var lB=jp.createContext(void 0);function cB(){let[ot,st]=jp.useState(0),ct=s(()=>(st((bt)=>bt+1),()=>{st((bt)=>Math.max(0,bt-1))}));return{context:jp.useMemo(()=>({register:ct}),[ct]),hasClosePart:ot>0}}var uR=e(r(),1),pB=uB.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,initialFocus:vt,finalFocus:xt,...wt}=st,Ct=ea(),St=J5(),Et=Sv(!0)!=null,{context:kt,hasClosePart:Rt}=cB(),Tt=Ct.useState("open"),Pt=Ct.useState("openMethod"),Mt=Ct.useState("instantType"),It=Ct.useState("transitionStatus"),At=Ct.useState("popupProps"),Nt=Ct.useState("titleElementId"),Ot=Ct.useState("descriptionElementId"),Dt=Ct.useState("modal"),_t=Ct.useState("mounted"),$t=Ct.useState("openChangeReason"),Ft=Ct.useState("activeTriggerElement"),Bt=Ct.useState("floatingRootContext"),Lt=Bt.useState("floatingId"),Vt=Ct.useState("disabled"),Wt=Ct.useState("openOnHover"),Ut=Ct.useState("closeDelay");Ro({open:Tt,ref:Ct.context.popupRef,onComplete(){if(Tt)Ct.context.onOpenChangeComplete?.(!0)}}),rc(Bt,{enabled:Wt&&!Vt,closeDelay:Ut});let Ht=vt===void 0?v0(Ct.context.popupRef):vt,Gt=Dt!==!1&&Rt;Ct.useSyncedValue("focusManagerModal",Gt);let jt=Ct.useStateSetter("popupElement"),qt={open:Tt,side:St.side,align:St.align,instant:Mt,transitionStatus:It},Qt=l("div",st,{state:qt,ref:[ct,Ct.context.popupRef,jt],props:[At,{id:Lt,role:"dialog",...Ya,"aria-labelledby":Nt,"aria-describedby":Ot,onKeyDown(Xt){if(Et&&Pa.has(Xt.key))Xt.stopPropagation()}},cl(It),wt],stateAttributesMapping:Va});return uR.jsx(Op,{context:Bt,openInteractionType:Pt,modal:Gt,disabled:!_t||$t===Ao,initialFocus:Ht,returnFocus:xt,restoreFocus:"popup",previousFocusableElement:y(Ft)?Ft:void 0,nextFocusableElement:Ct.context.triggerFocusTargetRef,beforeContentFocusGuardRef:Ct.context.beforeContentFocusGuardRef,children:uR.jsx(lB.Provider,{value:kt,children:Qt})})});var dB=e(t(),1);var fB=dB.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,...vt}=st,xt=ea(),wt=Cr(vt.id);return xt.useSyncedValueWithCleanup("titleElementId",wt),l("h2",st,{ref:ct,props:[{id:wt},vt]})});var ru=e(r(),1);function ou({...ot}){return ru.jsx(z5,{"data-slot":"popover",...ot})}function iu({...ot}){return ru.jsx(G5,{"data-slot":"popover-trigger",...ot})}function su({className:ot,align:st="center",alignOffset:ct=0,side:gt="bottom",sideOffset:bt=4,keepMounted:yt,...vt}){return ru.jsx(Zs,{portal:Q5,keepMounted:yt,children:ru.jsx(iB,{align:st,alignOffset:ct,side:gt,sideOffset:bt,className:"isolate z-50",children:ru.jsx(pB,{"data-slot":"popover-content",className:u("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",ot),...vt})})})}function gB({className:ot,...st}){return ru.jsx("div",{"data-slot":"popover-header",className:u("flex flex-col gap-0.5 text-sm",ot),...st})}function hB({className:ot,...st}){return ru.jsx(fB,{"data-slot":"popover-title",className:u("font-medium",ot),...st})}var kv=e(t(),1),Vp=e(r(),1),Ore=(ot,st)=>`mo-root${ot==="always"?" mo-always":""}${st?" mo-expr":""}`;function Lre(ot){let st=Math.round(ot.num("motion.blink",3500,6500)),ct=Math.round(ot.num("motion.saccade",4200,7600)),gt=ot.num("motion.lookX",1,2.2),bt=ot.num("motion.lookY",0.8,1.7),yt=(vt)=>Math.round(vt*100)/100;return{phase:Math.round(ot.num("motion.phase",0,2800)),bob:Math.round(ot.num("motion.bob",0,3400)),blink:st,blinkPhase:Math.round(ot.num("motion.blinkPhase",0,st)),saccade:ct,saccadePhase:Math.round(ot.num("motion.saccadePhase",0,ct)),lookX:yt(gt)*(ot.bool("motion.lookXFlip")?-1:1),lookY:yt(bt)*(ot.bool("motion.lookYFlip")?-1:1),lookMX:yt(gt),lookMY:yt(bt)}}function Bre(ot){let st=(gt)=>`${-gt}ms`,ct=Lre(ot);return{"--mo-phase":st(ct.phase),"--mo-bob-phase":st(ct.bob),"--mo-blink":`${ct.blink}ms`,"--mo-blink-phase":st(ct.blinkPhase),"--mo-look-x":String(ct.lookX),"--mo-look-mx":String(ct.lookMX),"--mo-look-y":String(ct.lookY),"--mo-look-my":String(ct.lookMY),"--mo-saccade":`${ct.saccade}ms`,"--mo-saccade-phase":st(ct.saccadePhase)}}function pR({l:ot,c:st,h:ct}){let gt=ct*Math.PI/180,bt=st*Math.cos(gt),yt=st*Math.sin(gt),vt=ot+0.3963377774*bt+0.2158037573*yt,xt=ot-0.1055613458*bt-0.0638541728*yt,wt=ot-0.0894841775*bt-1.291485548*yt,Ct=vt*vt*vt,St=xt*xt*xt,Et=wt*wt*wt;return[4.0767416621*Ct-3.3077115913*St+0.2309699292*Et,-1.2684380046*Ct+2.6097574011*St-0.3413193965*Et,-0.0041960863*Ct-0.7034186147*St+1.707614701*Et]}var bB=(ot)=>ot.every((st)=>st>=-0.0001&&st<=1.0001);function wB(ot){let st=pR(ot);if(!bB(st)){let ct=0,gt=ot.c;for(let bt=0;bt<12;bt++){let yt=(ct+gt)/2;if(bB(pR({...ot,c:yt})))ct=yt;else gt=yt}st=pR({...ot,c:ct})}return st.map((ct)=>Math.min(1,Math.max(0,ct)))}function yB(ot){let[st,ct,gt]=wB(ot);return 0.2126*st+0.7152*ct+0.0722*gt}function Ev(ot,st){let ct=yB(ot),gt=yB(st);return(Math.max(ct,gt)+0.05)/(Math.min(ct,gt)+0.05)}function CB(ot,st,ct){if(Ev(ot,st)>=ct)return ot;let gt=ot.l>=st.l?1:-1;for(let vt of[gt,-gt]){let xt={...ot};for(let wt=0;wt<60;wt++){if(xt.l=Math.min(1,Math.max(0,xt.l+vt*0.02)),Ev(xt,st)>=ct)return xt;if(xt.l===0||xt.l===1)break}}let bt={...ot,l:0,c:0},yt={...ot,l:1,c:0};return Ev(bt,st)>=Ev(yt,st)?bt:yt}function Fre(ot){return"#"+wB(ot).map((st)=>{let ct=st<=0.0031308?12.92*st:1.055*Math.pow(st,0.4166666666666667)-0.055;return Math.round(ct*255).toString(16).padStart(2,"0")}).join("")}var vB=[[0.2,{l:0.86,c:0.085}],[0.36,{l:0.9,c:0.028}],[0.62,{l:0.73,c:0.135}],[0.8,{l:0.62,c:0.165}],[0.93,{l:0.87,c:0.16}],[1,{l:0.34,c:0.035}]],Hre=(ot)=>vB.find(([st])=>ot<st)?.[1]??vB[0][1],zre={l:0.145,c:0,h:0},$re=1.5,Wre=(ot,st)=>{let ct=Hre(st),gt=CB({l:ct.l,c:ct.c,h:ot},zre,$re);return{bg:{l:0.965,c:0.01,h:ot},head:gt,eye:gt.l>=0.5?{l:0.17,c:0.02,h:ot}:{l:0.97,c:0.012,h:ot}}},Ure=[["head","bg",1.25],["eye","head",4.5]];function jre(ot,st=!0,ct=0){let gt=Wre(ot,ct);if(st)for(let[bt,yt,vt]of Ure)gt[bt]=CB(gt[bt],gt[yt],vt);return gt}function Vre(ot,st=!0,ct=0){let gt=jre(ot,st,ct),bt={};for(let yt in gt)bt[yt]=Fre(gt[yt]);return bt}var po=(ot)=>{let st=Math.round(ot*100)/100;return Object.is(st,-0)?"0":String(st)};function dR({cx:ot,cy:st,rx:ct,ry:gt,n:bt=4,rot:yt=0}){let vt=Math.min(1,(8*Math.pow(2,-1/bt)-4)/3),xt=ct,wt=gt,Ct=xt*vt,St=wt*vt,Et=[[xt,0],[xt,St],[Ct,wt],[0,wt],[-Ct,wt],[-xt,St],[-xt,0],[-xt,-St],[-Ct,-wt],[0,-wt],[Ct,-wt],[xt,-St],[xt,0]],kt=yt*Math.PI/180,Rt=Math.cos(kt),Tt=Math.sin(kt),Pt=(It)=>{let[At,Nt]=Et[It];return`${po(ot+At*Rt-Nt*Tt)} ${po(st+At*Tt+Nt*Rt)}`},Mt=`M${Pt(0)}`;for(let It=1;It<13;It+=3)Mt+=`C${Pt(It)} ${Pt(It+1)} ${Pt(It+2)}`;return Mt+"Z"}function Gre(ot,st,ct,gt,bt,yt=0){let vt=bt.length,xt=yt*Math.PI/180,wt=bt.map((Et,kt)=>{let Rt=xt+2*Math.PI*kt/vt;return[ot+ct*Et*Math.cos(Rt),st+gt*Et*Math.sin(Rt)]}),Ct=(Et)=>wt[(Et%vt+vt)%vt],St=`M${po(Ct(0)[0])} ${po(Ct(0)[1])}`;for(let Et=0;Et<vt;Et++){let[kt,Rt]=Ct(Et-1),[Tt,Pt]=Ct(Et),[Mt,It]=Ct(Et+1),[At,Nt]=Ct(Et+2);St+=`C${po(Tt+(Mt-kt)/6)} ${po(Pt+(It-Rt)/6)} ${po(Mt-(At-Tt)/6)} ${po(It-(Nt-Pt)/6)} ${po(Mt)} ${po(It)}`}return St+"Z"}function Kre({cx:ot,cy:st,rx:ct,ry:gt,sides:bt,round:yt=0.3,rot:vt=0}){let xt=yt>0?yt<1?yt/2:0.5:0,wt=vt*Math.PI/180-Math.PI/2,Ct=Array.from({length:bt},(Rt,Tt)=>{let Pt=wt+2*Math.PI*Tt/bt;return[ot+ct*Math.cos(Pt),st+gt*Math.sin(Pt)]}),St=(Rt)=>Ct[(Rt%bt+bt)%bt],Et=(Rt,Tt)=>{let[Pt,Mt]=St(Rt),[It,At]=St(Tt);return`${po(Pt+(It-Pt)*xt)} ${po(Mt+(At-Mt)*xt)}`},kt=`M${Et(0,-1)}`;for(let Rt=0;Rt<bt;Rt++){let[Tt,Pt]=St(Rt);if(kt+=`Q${po(Tt)} ${po(Pt)} ${Et(Rt,Rt+1)}`,xt<0.5)kt+=`L${Et(Rt+1,Rt)}`}return kt+"Z"}function qre(ot,st,ct,gt){let bt=po(ot-ct),yt=po(ot+ct);return`M${bt} ${po(st-gt)}H${yt}V${po(st+gt)}H${bt}Z`}function Qre(ot,st,ct,gt,bt){let yt=Math.max(1.05,bt),vt=ct*Math.sqrt(1-1/(yt*yt)),xt=st-gt/yt,wt=st-yt*gt,Ct=vt*0.14,St=xt+0.86*(wt-xt);return`M${po(ot-vt)} ${po(xt)}L${po(ot-Ct)} ${po(St)}Q${po(ot)} ${po(wt)} ${po(ot+Ct)} ${po(St)}L${po(ot+vt)} ${po(xt)}Z`}function fR(ot,st){for(let ct=0;ct<st.length;ct++)ot=Math.imul(ot^st[ct],3432918353),ot=ot<<13|ot>>>19;return ot}function Jre(ot){return ot=Math.imul(ot^ot>>>16,2246822507),ot=Math.imul(ot^ot>>>13,3266489909),(ot^ot>>>16)>>>0}var SB=new TextEncoder;function Xre(ot){return ot.normalize("NFC").trim().toLowerCase()}function Yre(ot,st=!0){let ct=st?Xre(ot):ot;return fR(1779033703^ct.length,SB.encode(ct))}function xB(ot,st){return Jre(fR(fR(ot,Uint8Array.of(255)),SB.encode(st)))/4294967296}function Zre(ot,st=!0,ct){let gt=Yre(ot,st),bt=(yt)=>{let vt=ct?.[yt],xt=Array.isArray(vt)?vt[Math.floor(xB(gt,yt)*vt.length)]:vt;return xt===void 0?xB(gt,yt):xt>0?xt<1?xt:0.999999:0};return bt.num=(yt,vt,xt)=>vt+bt(yt)*(xt-vt),bt.int=(yt,vt,xt)=>vt+Math.floor(bt(yt)*(xt-vt+1)),bt.pick=(yt,vt)=>vt[Math.floor(bt(yt)*vt.length)],bt.bool=(yt,vt=0.5)=>bt(yt)<vt,bt.jitter=(yt,vt)=>(bt(yt)*2-1)*vt,bt}function EB(ot,st,ct){let gt=st.expression;if(ct||!gt)return{l:ot,wrap:""};return gt.bake(ot,gt.p)}var eoe=(ot,st)=>st?.tint?st.tint(ot,st.p):ot,kB=(ot,st)=>st?`<g transform="${st}">${ot}</g>`:ot,toe=(ot)=>ot.replace(/[&<>]/g,(st)=>st==="&"?"&amp;":st==="<"?"&lt;":"&gt;");function RB(ot,st){let ct=Zre(ot,st.normalize??!0,st.traits);return{t:ct,palette:{...Vre(st.hue??ct.num("hue",0,360),st.contrast??!0,st.tone??ct("tone")),...st.palette}}}var noe=(ot)=>ot.title?`<title>${toe(ot.title)}</title>`:"";function TB(ot,st,ct){let gt=st.background??ot.background;if(gt===!1)return;return{d:gt==="square"?"M0 0H100V100H0Z":dR({cx:50,cy:50,rx:50,ry:50,n:gt==="circle"?2:6}),fill:ct.bg}}var roe=(ot)=>ot?`<path d="${ot.d}" fill="${ot.fill}"/>`:"";function ooe(ot){return(st,ct={})=>{let{t:gt,palette:bt}=RB(st,ct),yt=eoe(bt,ct.expression),vt=ct.size?` width="${ct.size}" height="${ct.size}"`:"",xt=EB(ot.layout(gt),ct),wt=noe(ct)+roe(TB(ot,ct,yt))+kB(ot.render(xt.l,yt),xt.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${vt}>${wt}</svg>`}}function ioe(ot){return(st,ct={},gt)=>{let{t:bt,palette:yt}=RB(st,ct),vt=gt?.(bt,yt),xt=EB(ot.layout(bt),ct,vt);return{cls:vt?.cls,bg:TB(ot,ct,yt),inner:kB(ot.render(xt.l,yt,!!vt),xt.wrap),vars:vt?.vars}}}var soe=(ot,st,ct)=>{let gt=st.rx,bt=ot.num("eye.rx",0.075,0.105)*gt,yt=ot.num("eye.ratio",1.9,3.2),vt=ot.num("eye.scale",0.78,1.24),xt=ot.num("eye.stretch",0.85,1.18),wt=ot.num("eye.gap",0.1,0.24)*gt,Ct=bt*Math.max(1,vt),St=bt*yt*Math.max(1,vt*xt),Et=Ct+gt*0.03+wt,kt=ot.jitter("gaze.x",0.09)*ct.rx,Rt=ot.num("gaze.y",-0.2,0.08)*ct.ry,Tt=ot.jitter("eye.dy",0.04)*ct.ry,Pt=Math.hypot(Ct,St),Mt=Math.hypot((Math.abs(kt)+Et+Pt)/ct.rx,(Math.abs(Rt)+Math.abs(Tt)+Pt)/ct.ry),It=Mt>0.9?0.9/Mt:1,At=bt*It,Nt=At*yt,Ot=Et*It,Dt=Math.max(0,Math.min(1,wt/St)),_t=Math.min(12,Math.asin(Dt)*180/Math.PI),$t=ot.num("eye.lean",-1,1)*_t,Ft=Math.max(-12,Math.min(12,$t+ot.jitter("eye.lean2",3.5))),Bt=ct.cx+kt*It,Lt=ct.cy+Rt*It;return[{cx:Bt-Ot,cy:Lt,rx:At,ry:Nt,n:ot.num("eye.n",3.5,6),rot:$t},{cx:Bt+Ot,cy:Lt+Tt*It,rx:At*vt,ry:Nt*vt*xt,n:ot.num("eye.n",3.5,6),rot:Ft}]};function aoe(ot,st){let ct=(yt)=>(ot.find(([,vt])=>yt<vt)??ot[ot.length-1])[0];function gt(yt){let vt=ct(yt("shape")),xt=yt.num("body.r",31,38)*vt.core,wt={cx:50+yt.jitter("body.x",1.5),cy:50+yt.jitter("body.y",1.5),rx:xt,ry:xt*yt.num("body.ratio",0.92,1.08),n:yt.num("body.n",1.9,2.5),rot:0,radii:Array.from({length:yt.int("body.pts",6,8)},(Et,kt)=>1+yt.jitter(`body.r${kt}`,0.16))};vt.body?.(yt,wt);let Ct=vt.face?.(wt)??wt,St={petals:[],extra:[]};return vt.decorate?.(yt,wt,St),{shape:vt.name,draw:vt.path,body:wt,face:Ct,petals:St.petals,extra:St.extra,eyes:st(yt,wt,Ct)}}function bt(yt,vt,xt){let wt=(Et)=>Math.round(Et*100)/100,Ct=(Et,kt)=>{let Rt=`<path d="${dR(Et)}"/>`;return xt?`<g class="mo-eye" style="--mo-wrap:${kt?1:-1};--mo-lean:${wt(Et.rot)};transform-origin:${wt(Et.cx)}px ${wt(Et.cy)}px">${Rt}</g>`:Rt},St=`<g fill="${vt.head}">`+yt.petals.map((Et)=>`<circle cx="${wt(Et.cx)}" cy="${wt(Et.cy)}" r="${wt(Et.r)}"/>`).join("")+yt.extra.map((Et)=>`<path d="${Et}"/>`).join("")+`<path d="${yt.draw?yt.draw(yt.body):dR(yt.body)}"/></g><g fill="${vt.eye}"${xt?' class="mo-eyes"':""}>`+yt.eyes.map(Ct).join("")+"</g>";return xt?`<g class="mo-breathe"><g class="mo-bob">${St}</g></g>`:St}return{layout:gt,render:bt,background:!1}}var PB=(ot)=>Kre(ot),IB=(ot)=>Gre(ot.cx,ot.cy,ot.rx,ot.ry,ot.radii,ot.rot),mR=(ot)=>(st)=>({cx:st.cx,cy:st.cy,rx:st.rx*ot,ry:st.ry*ot}),MB=(ot)=>mR(Math.min(...ot.radii)*0.95)(ot),loe=(ot)=>mR(0.84)(ot),coe={name:"round",core:1},uoe={name:"organic",core:0.98,path:IB,face:MB},poe={name:"boxy",core:0.86,body:(ot,st)=>{st.n=ot.num("body.n",3.4,6),st.rot=ot.num("body.rot",-20,20)}},doe={name:"capsule",core:1.02,body:(ot,st)=>{st.ry*=ot.num("capsule.squat",0.55,0.68)},face:mR(0.94),decorate:(ot,st,ct)=>{for(let gt of[-1,1])ct.petals.push({cx:st.cx+gt*(st.rx-st.ry),cy:st.cy,r:st.ry})},path:(ot)=>qre(ot.cx,ot.cy,ot.rx-ot.ry,ot.ry)},foe={name:"nub",core:0.88,decorate:(ot,st,ct)=>{let gt=ot.int("nub.n",1,2);for(let bt=0;bt<gt;bt++){let yt=ot.num(`nub.a${bt}`,0,2*Math.PI);ct.petals.push({cx:st.cx+Math.cos(yt)*st.rx*0.88,cy:st.cy+Math.sin(yt)*st.rx*0.88,r:st.rx*ot.num(`nub.r${bt}`,0.24,0.4)})}}},moe={name:"cloud",core:0.78,face:MB,path:IB,decorate:(ot,st,ct)=>{let gt=ot.int("cloud.n",4,6);for(let bt=0;bt<gt;bt++){let yt=Math.PI+Math.PI*(bt+0.5)/gt;ct.petals.push({cx:st.cx+Math.cos(yt)*st.rx*0.8,cy:st.cy+Math.sin(yt)*st.rx*0.5,r:st.rx*ot.num(`cloud.r${bt}`,0.44,0.62)})}}},goe={name:"droplet",core:0.78,body:(ot,st)=>{st.cy+=0.22*st.ry,st.n=2},face:(ot)=>({cx:ot.cx,cy:ot.cy+ot.ry*0.05,rx:ot.rx*0.88,ry:ot.ry*0.88}),decorate:(ot,st,ct)=>{ct.extra.push(Qre(st.cx,st.cy,st.rx,st.ry,ot.num("droplet.tip",1.4,1.65)))}},hoe={name:"hexagon",core:1.05,path:PB,face:loe,body:(ot,st)=>{st.sides=6,st.rot=ot.num("body.rot",-12,12),st.round=ot.num("poly.round",0.24,0.5)}},boe={name:"sun",core:0.7,decorate:(ot,st,ct)=>{let gt=ot.int("sun.n",6,9),bt=st.rx*ot.num("sun.dist",1,1.08),yt=st.rx*ot.num("sun.r",0.2,0.26),vt=ot.num("sun.rot",0,2*Math.PI);for(let xt=0;xt<gt;xt++){let wt=vt+2*Math.PI*xt/gt;ct.petals.push({cx:st.cx+Math.cos(wt)*bt,cy:st.cy+Math.sin(wt)*bt,r:yt})}}},yoe={name:"triangle",core:1.15,path:PB,body:(ot,st)=>{st.sides=3,st.rot=ot.num("body.rot",-5,5),st.round=ot.num("poly.round",0.24,0.5)},face:(ot)=>({cx:ot.cx,cy:ot.cy+ot.ry*0.1,rx:ot.rx*0.54,ry:ot.ry*0.36})},voe=[[coe,0.22],[uoe,0.48],[poe,0.6],[doe,0.7],[foe,0.79],[moe,0.86],[goe,0.915],[hoe,0.95],[boe,0.98],[yoe,1]],AB=aoe(voe,soe),xoe=ooe(AB),woe=(ot,st)=>(ct,gt)=>{let bt=st?st.vars(st.p):{},yt=st?.tint?st.tint(gt,st.p):gt;return{cls:Ore(ot,!!Object.keys(bt).length||!!st?.tint),vars:{...Bre(ct),"--mo-head":yt.head,"--mo-eye":yt.eye,...bt}}};function Coe(ot,st={}){return ioe(AB)(ot,st,st.animate&&woe(st.animate,st.expression))}function Soe(ot,st){return"data:image/svg+xml,"+xoe(ot,st).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(ct)=>"%"+ct.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function NB({name:ot,size:st,background:ct,palette:gt,hue:bt,tone:yt,normalize:vt,contrast:xt,title:wt,animate:Ct,expression:St,traits:Et,...kt}){let Rt={size:st,background:ct,palette:gt,hue:bt,tone:yt,normalize:vt,contrast:xt,title:wt,expression:St,traits:Et},Tt=JSON.stringify([ot,Rt,Ct]),Pt=kv.useMemo(()=>Ct?"":Soe(ot,Rt),[Tt]),Mt=kv.useMemo(()=>Ct?Coe(ot,{...Rt,animate:Ct}):null,[Tt]),It=kv.useMemo(()=>({__html:Mt?.inner??""}),[Mt?.inner]);if(Mt){let{style:Ot,...Dt}=kt;return Vp.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:st,height:st,role:wt?"img":void 0,"aria-hidden":wt?void 0:!0,style:{...Mt.vars,...Ot},...Dt,children:[wt?Vp.jsx("title",{children:wt}):null,Mt.bg?Vp.jsx("path",{d:Mt.bg.d,fill:Mt.bg.fill}):null,Vp.jsx("g",{className:Mt.cls,dangerouslySetInnerHTML:It})]})}let{alt:At,...Nt}=kt;return Vp.jsx("img",{src:Pt,width:st,height:st,alt:At??wt??"",...Nt})}var Rv=NB;var Pf=e(t(),1);var Tv=e(t(),1),gR=Tv.createContext(void 0);function Pv(){let ot=Tv.useContext(gR);if(ot===void 0)throw Error(c(13));return ot}var Tf={imageLoadingStatus:()=>null};var DB=e(r(),1),_B=Pf.forwardRef(function(st,ct){let{className:gt,render:bt,style:yt,...vt}=st,[xt,wt]=Pf.useState("idle"),Ct={imageLoadingStatus:xt},St=Pf.useMemo(()=>({imageLoadingStatus:xt,setImageLoadingStatus:wt}),[xt,wt]),Et=l("span",st,{state:Ct,ref:ct,props:vt,stateAttributesMapping:Tf});return DB.jsx(gR.Provider,{value:St,children:Et})});var uh=e(t(),1);var OB=e(t(),1);function LB(ot,{referrerPolicy:st,crossOrigin:ct,sizes:gt,srcSet:bt},yt){let vt=OB.useState("idle"),xt=vt[1];return i(()=>{if(!yt)return w;if(!ot&&!bt)return xt("error"),w;let wt=!0,Ct=new window.Image,St=(Et)=>()=>{if(!wt)return;xt(Et)};if(xt("loading"),Ct.onload=St("loaded"),Ct.onerror=St("error"),st)Ct.referrerPolicy=st;if(Ct.crossOrigin=ct??null,gt)Ct.sizes=gt;if(bt)Ct.srcset=bt;if(ot)Ct.src=ot;if(Ct.complete)xt(Ct.naturalWidth>0?"loaded":"error");return()=>{wt=!1}},[yt,ot,bt,gt,ct,st,xt]),vt}var Eoe={...Tf,...fi},BB=uh.forwardRef(function(st,ct){let{className:gt,render:bt,onLoadingStatusChange:yt,keepMounted:vt=!1,style:xt,sizes:wt,srcSet:Ct,src:St,...Et}=st,{setImageLoadingStatus:kt}=Pv(),[Rt,Tt]=LB(St,st,!vt),Pt=Rt==="loaded",{mounted:Mt,transitionStatus:It,setMounted:At}=Xs(Pt),Nt=uh.useRef(null),Ot=uh.useRef(!0);i(()=>{if(!vt)return;let Vt=Ot.current;Ot.current=!1;let Wt=Nt.current;if(!Wt)return;if(!Wt.complete){Tt("loading");return}let Ut=Wt.naturalWidth>0?"loaded":"error";if(Tt(Ut),Ut==="loaded"&&Vt)At(!0)},[vt,St,Ct,wt,Et.crossOrigin,Et.referrerPolicy,bt,Tt,At]);let Dt=vt?{"data-loading":Rt==="loading"?"":void 0,"data-error":Rt==="error"?"":void 0,"aria-hidden":Rt!=="loaded"||void 0,onLoad(){Tt("loaded")},onError(){Tt("error")}}:void 0,_t=s((Vt)=>{yt?.(Vt),kt(Vt)});i(()=>{if(Rt!=="idle")_t(Rt)},[Rt,_t]),i(()=>()=>kt("idle"),[kt]),Ro({enabled:!Pt,open:Pt,ref:Nt,onComplete(){if(!Pt)At(!1)}});let $t={imageLoadingStatus:Rt,transitionStatus:vt&&It==="ending"?void 0:It},Ft=vt||Mt,Bt={};if(wt!==void 0)Bt.sizes=wt;if(Ct!==void 0)Bt.srcSet=Ct;if(St!==void 0)Bt.src=St;let Lt=l("img",st,{state:$t,ref:[ct,Nt],props:[Dt,Et,Bt],stateAttributesMapping:Eoe,enabled:Ft});if(!Ft)return null;return Lt});var If=e(t(),1);var FB=If.forwardRef(function(st,ct){let{className:gt,render:bt,delay:yt=0,style:vt,...xt}=st,{imageLoadingStatus:wt}=Pv(),[Ct,St]=If.useState(yt===0),Et=Xr();return If.useEffect(()=>{if(yt>0)Et.start(yt,()=>St(!0));else St(!0);return Et.clear},[Et,yt]),l("span",st,{state:{imageLoadingStatus:wt},ref:ct,props:xt,stateAttributesMapping:Tf,enabled:wt!=="loaded"&&(yt===0||Ct)})});var Gp=e(r(),1);function zB({className:ot,size:st="default",...ct}){return Gp.jsx(_B,{"data-slot":"avatar","data-size":st,className:u("group/avatar relative isolate flex shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=default]:size-8 data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5 dark:after:mix-blend-lighten","[--avatar-badge-size:--spacing(2.5)] data-[size=sm]:[--avatar-badge-size:--spacing(2)] data-[size=xs]:[--avatar-badge-size:--spacing(1.5)]","has-[>[data-slot=avatar-badge]]:[&::after,&>:where([data-slot=avatar-image],[data-slot=avatar-fallback])]:mask-[radial-gradient(circle_at_calc(100%_-_var(--avatar-badge-size)/2)_calc(100%_-_var(--avatar-badge-size)/2),transparent_calc(var(--avatar-badge-size)/2_+_2px),black_calc(var(--avatar-badge-size)/2_+_2.5px))]",ot),...ct})}function $B({className:ot,...st}){return Gp.jsx(BB,{"data-slot":"avatar-image",className:u("aspect-square size-full rounded-full object-cover",ot),...st})}function WB({className:ot,...st}){return Gp.jsx(FB,{"data-slot":"avatar-fallback",className:u("flex size-full items-center justify-center overflow-hidden rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs group-data-[size=xs]/avatar:text-xs",ot),...st})}function UB({className:ot,...st}){return Gp.jsx("span",{"data-slot":"avatar-badge",className:u("absolute right-0 bottom-0 size-(--avatar-badge-size) rounded-full bg-primary select-none",ot),...st})}function jB({className:ot,...st}){return Gp.jsx("div",{"data-slot":"avatar-group",className:u("group/avatar-group flex items-center -space-x-2 [--avatar-radius:--spacing(4)]","*:data-[size=lg]:[--avatar-radius:--spacing(5)] *:data-[size=sm]:[--avatar-radius:--spacing(3)] *:data-[size=xs]:[--avatar-radius:--spacing(2.5)]","[&>[data-slot=avatar]:not(:last-child)]:mask-[radial-gradient(circle_at_calc(100%_+_var(--avatar-radius)_-_--spacing(2))_50%,transparent_calc(var(--avatar-radius)_+_2px),black_calc(var(--avatar-radius)_+_2.5px))]",ot),...st})}function VB({className:ot,size:st="default",...ct}){return Gp.jsx("div",{"data-slot":"avatar-group-count","data-size":st,className:u("relative flex shrink-0 items-center justify-center rounded-full bg-accent text-sm text-muted-foreground [&>svg]:size-4","data-[size=default]:size-8 data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5","data-[size=sm]:text-[11px] data-[size=xs]:text-[11px]","data-[size=lg]:[&>svg]:size-5 data-[size=sm]:[&>svg]:size-3 data-[size=xs]:[&>svg]:size-3",ot),...ct})}function au(ot){return ot.name?.trim()||ot.email?.trim()||ot.id}var Po=e(t(),1);function Iv(ot,st){let ct=ot.filter((gt)=>gt.userId===st);return ct.some((gt)=>gt.location?.status==="active")?"active":ct.length?"away":"offline"}function ph(ot,st){let ct=ot.users.find((gt)=>gt.id===st);return ct?{...ct,status:Iv(ot.connections,st)}:void 0}function GB(ot,st,ct,{scope:gt="page",status:bt}={}){let yt=[],vt=new Set(ot.connections.filter((xt)=>xt.userId!==st&&(gt==="workspace"||ct!==null&&xt.location?.page===ct.page)).map((xt)=>xt.userId));for(let xt of vt){let wt=ph(ot,xt);if(wt&&(!bt||wt.status===bt))yt.push(wt)}return yt}function KB(ot,st){return[...st.users].sort((gt,bt)=>Number(bt.id===st.currentUser?.id)-Number(gt.id===st.currentUser?.id)).map((gt)=>{let bt=new Set;for(let vt of ot){if(vt.userId!==gt.id||vt.connectionId===st.connectionId)continue;if(vt.location)bt.add(vt.location.page)}let yt=gt.id===st.currentUser?.id;if(yt&&st.page)bt.add(st.page);return{profile:gt,self:yt,pages:[...bt],status:Iv(ot,gt.id)}})}function qB(ot,st,ct=()=>!0){let gt=!1,bt=()=>{if(!gt)return;gt=!1,ot.deletePresence(st.registrationId)};return{publish(yt,vt){if(!vt||!ct(yt)){bt();return}gt=!0,ot.setPresence({...st,value:yt})},clear:bt}}var koe=[];function hR(){let ot=tu();return Po.useSyncExternalStore(ot.subscribe,ot.getUsersSnapshot,ot.getUsersSnapshot)}function Mf(){let ot=tu(),st=hR(),ct=Po.useSyncExternalStore(ot.subscribeCurrentUser,ot.getCurrentUser,ot.getCurrentUser),bt=Po.useSyncExternalStore(ot.subscribeDirectory,ot.getDirectory,ot.getDirectory)??koe;return{state:st,self:ct,users:bt,engine:ot}}function Af(ot){let{state:st,users:ct}=Mf();return Po.useMemo(()=>ph({...st,users:ct},ot),[st,ct,ot])}function lu(ot){let{state:st,users:ct}=Mf();return ot.map((gt)=>ph({...st,users:ct},gt))}function Mv({status:ot}={}){let{state:st,users:ct}=Mf();return Po.useMemo(()=>ct.map((gt)=>ph({...st,users:ct},gt.id)).filter((gt)=>!ot||gt.status===ot),[st,ct,ot])}function Av(){let{state:ot,self:st}=Mf();return Po.useMemo(()=>st?{...st,status:Iv(ot.connections,st.id)}:void 0,[ot,st])}function QB(ot={}){let{state:st,self:ct,users:gt,engine:bt}=Mf(),{scope:yt,status:vt}=ot;return Po.useMemo(()=>GB({...st,users:gt},ct?.id,bt.getLocation(),{scope:yt,status:vt}),[st,ct,gt,bt,yt,vt])}var Nf={custom:(ot)=>`custom:${ot}`,cursor:(ot)=>`cursor:${ot}`,target:(ot)=>`field:${ot}`};function JB(ot){return dh(Nf.custom(ot))}function dh(ot){let{users:st,engine:ct}=Mf(),gt=Yk(),bt=gt?.appletId??"",yt=Po.useCallback(()=>ct.getPresenceSnapshot(bt,ot),[ct,bt,ot]),vt=Po.useSyncExternalStore(ct.subscribe,yt,yt);return Po.useMemo(()=>{if(!gt?.active)return[];let xt=new Set(st.map((wt)=>wt.id));return vt.filter((wt)=>xt.has(wt.userId)).map((wt)=>({connectionId:wt.connectionId,userId:wt.userId,value:wt.value}))},[vt,st,gt])}function fh(ot,st,ct){let gt=tu(),bt=Yk(),[yt]=Po.useState(()=>crypto.randomUUID()),vt=Po.useRef(st),xt=Po.useRef(!1),wt=bt?.appletId??"",Ct=Po.useMemo(()=>qB(gt,{registrationId:yt,appletId:wt,channel:ot},ct),[gt,yt,wt,ot,ct]),St=Po.useCallback(()=>{Ct.publish(vt.current,bt?.active===!0&&document.visibilityState!=="hidden")},[bt,Ct]);return Po.useLayoutEffect(()=>{if(!bt?.active)return;return xt.current=!0,St(),document.addEventListener("visibilitychange",St),()=>{xt.current=!1,document.removeEventListener("visibilitychange",St),Ct.clear()}},[bt,St,Ct]),Po.useCallback((Et)=>{if(vt.current=Et,xt.current)St()},[St])}function Roe(ot,st,ct){let gt=fh(ot,st,ct);Po.useLayoutEffect(()=>gt(st),[gt,st])}function XB(ot,st){Roe(Nf.custom(ot),st)}var ac=e(r(),1);function YB({id:ot,size:st,showStatusBadge:ct,className:gt}){let bt=Af(ot);return ac.jsx(lc,{profile:bt,size:st,active:ct&&bt?.status==="active",className:gt})}function lc({profile:ot,size:st="default",className:ct,active:gt}){let bt=ot?au(ot):"Unknown user";return ac.jsxs(zB,{size:st,"aria-label":bt,className:n("after:border-0",ct),children:[ot?.avatar&&ac.jsx($B,{src:ot.avatar,alt:""}),ac.jsx(WB,{children:ot?ac.jsx(Rv,{className:"scale-150",name:ot.id,animate:"hover",background:"circle",palette:{bg:"color-mix(in srgb, var(--muted) 85%, var(--foreground))",head:"color-mix(in srgb, var(--muted) 85%, var(--foreground))",eye:"var(--foreground)"}}):ac.jsx(X0,{size:st==="xs"||st==="sm"?12:16,stroke:1.75})}),gt&&ac.jsx(UB,{className:"bg-success"})]})}var Ia=e(r(),1);function Nv({id:ot,showStatusBadge:st,showYouLabel:ct,...gt}){let bt=Af(ot),yt=Av();return Ia.jsx(bR,{...gt,profile:bt,active:st&&bt?.status==="active",showYouLabel:ct&&bt!==void 0&&bt.id===yt?.id})}function bR({profile:ot,size:st="default",active:ct,showYouLabel:gt,description:bt,className:yt}){let vt=ot?au(ot):"Unknown user";return Ia.jsxs("span",{className:n("flex min-w-0 items-center gap-2",yt),children:[Ia.jsx(lc,{profile:ot,size:st,active:ct}),Ia.jsxs("span",{className:n("flex min-w-0 flex-1 text-sm",st==="xs"?"items-baseline":"flex-col"),children:[Ia.jsxs("span",{className:"flex min-w-0 items-baseline gap-1",children:[Ia.jsx("span",{className:n("truncate",!ot&&"text-muted-foreground"),children:vt}),gt&&Ia.jsx("span",{className:"shrink-0 text-muted-foreground",children:"(You)"})]}),bt&&Ia.jsxs("span",{className:n("truncate text-muted-foreground",st==="sm"&&"text-xs leading-tight"),children:[st==="xs"&&Ia.jsx("span",{"aria-hidden":"true",className:"whitespace-pre",children:" · "}),bt]})]})]})}var Df=e(r(),1);function Dv({ids:ot,...st}){let ct=lu([...new Set(ot)]);return Df.jsx(Toe,{users:ct,...st})}function Toe({users:ot,max:st=3,size:ct="sm",className:gt}){let bt=ot.slice(0,st),yt=ot.length-bt.length;return Df.jsxs(jB,{className:gt,"aria-label":`${ot.length} users`,children:[bt.map((vt,xt)=>Df.jsx(lc,{profile:vt,size:ct},vt?.id??xt)),yt>0&&Df.jsxs(VB,{size:ct,"aria-label":`${yt} more`,children:["+",yt]})]})}var Xo=e(r(),1),ZB={active:0,away:1,offline:2};function yR({workspaceId:ot,describeTab:st,onOpenTab:ct}){let gt=Si(),bt=tu(),yt=hR(),vt=Mv(),xt=_v.useSyncExternalStore(bt.subscribeCurrentUser,bt.getCurrentUser,bt.getCurrentUser),wt=pi(),Ct=Jk(xp(wt),ot,wt.base),St=KB(yt.connections,{currentUser:xt,connectionId:yt.connectionId,users:vt,page:Ct}),Et=St.filter((Tt)=>Tt.self||Tt.status!=="offline").map((Tt)=>Tt.profile.id),[kt,Rt]=_v.useState(!1);if(!gt||vt.length<=1)return null;return Xo.jsxs(ou,{open:kt,onOpenChange:Rt,children:[Xo.jsxs(iu,{render:Xo.jsx(a,{variant:"ghost",size:"sm","aria-label":"Users in this workspace",className:"gap-0.5 rounded-full pr-1 pl-1 data-popup-open:bg-accent"}),children:[Xo.jsx(Dv,{ids:Et,size:"xs",max:4}),Xo.jsx(qc,{stroke:2.5,className:"size-3! text-muted-foreground"})]}),Xo.jsxs(su,{align:"end",className:"max-w-64 p-1",children:[Xo.jsx(hB,{className:"sr-only",children:"Users in this workspace"}),Xo.jsx(Poe,{users:St,page:Ct,describeTab:st,onOpenTab:(Tt)=>{Rt(!1),ct(Tt)}}),St.length===0&&Xo.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No workspace users to show."})]})]})}function Poe({users:ot,page:st,describeTab:ct,onOpenTab:gt}){let bt=ot.toSorted((yt,vt)=>ZB[yt.status]-ZB[vt.status]||Number(vt.self)-Number(yt.self));return Xo.jsx("ul",{className:"flex max-h-80 scroll-fade flex-col overflow-y-auto",children:bt.map((yt)=>Xo.jsx(Ioe,{user:yt,page:st,describeTab:ct,onOpenTab:gt},yt.profile.id))})}function Ioe({user:ot,page:st,describeTab:ct,onOpenTab:gt}){let bt=ot.pages.map((kt)=>{let Rt=Up(kt);return{tab:Rt,info:Rt?ct(Rt):null}}),yt=ot.self||ot.status==="offline"?void 0:bt.find(({tab:kt,info:Rt})=>kt!==null&&Rt!==null&&kt!==st),vt=yt?.tab,xt=[...new Set(bt.map(({tab:kt,info:Rt})=>Rt?.label??kt??"Another tab"))].join(", "),wt=ot.status==="offline"?"Offline":ot.status==="away"?xt?`${xt} · Away`:"Away":xt||"Another tab",Ct=ot.status==="offline"?void 0:bt[0]?.info?.Icon,St=Xo.jsx(Nv,{id:ot.profile.id,className:"flex-1",size:"sm",showYouLabel:!0,description:Xo.jsxs("span",{className:"flex items-center gap-1 text-xs",children:[Ct&&Xo.jsx(Ct,{size:12,stroke:1.75,className:"shrink-0"}),Xo.jsx("span",{className:"truncate",children:wt})]})}),Et="flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left";return Xo.jsx("li",{children:vt?Xo.jsx("button",{type:"button",title:`Go to ${yt?.info?.label}`,className:n("flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left","cursor-pointer outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50"),onClick:()=>gt(vt),children:St}):Xo.jsx("div",{className:"flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left",children:St})})}var Kp=e(t(),1);function e3(ot){return l(ot.defaultTagName??"div",ot,ot)}var Moe=oe("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-sm border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg:not([class*=size-])]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-accent [a]:hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function _f({className:ot,variant:st="default",render:ct,...gt}){return e3({defaultTagName:"span",props:O({className:u(Moe({variant:st}),ot)},gt),render:ct,state:{slot:"badge",variant:st}})}var cu=e(t(),1);function Ov(...ot){if(!ot.length||ot.some((st)=>typeof st!=="string"||!st.trim()))throw Error("PresenceGroup, PresenceFrame, and PresenceAvatars require a nonempty id.");return ot.map((st)=>encodeURIComponent(st)).join("/")}var vR=(ot)=>ot!==!1&&ot!==null,Of=cu.createContext([]);function Lv(ot){return Ov(...cu.useContext(Of),ot)}function Bv(ot,st){let ct=st===void 0,gt=cu.useRef(null),bt=Nf.target(ot),yt=dh(bt),vt=fh(bt,!1,vR),xt=(Ct,St)=>St!==null&&Ct instanceof Element&&Ct.closest("[data-presence-target]")===St;cu.useLayoutEffect(()=>{vt(st??xt(document.activeElement,gt.current))},[ot,st,vt]);let wt=new Map;for(let Ct of yt)if(Ct.value===!0&&!wt.has(Ct.userId))wt.set(Ct.userId,{id:Ct.userId,connectionId:Ct.connectionId});return{users:[...wt.values()],props:{ref:gt,"data-collab-target":ot,"data-presence-target":ct?ot:void 0,onFocusCapture:ct?(Ct)=>vt(xt(Ct.target,Ct.currentTarget)):void 0,onBlurCapture:ct?(Ct)=>vt(xt(Ct.relatedTarget,Ct.currentTarget)):void 0}}}var ta=e(r(),1);function Aoe(ot){if(!ot||typeof ot!=="object"||Array.isArray(ot))return null;if(typeof ot.x!=="number"||typeof ot.y!=="number")return null;if(!Number.isFinite(ot.x)||!Number.isFinite(ot.y))return null;return{x:ot.x,y:ot.y,...typeof ot.target==="string"?{target:ot.target}:{},...typeof ot.targetX==="number"&&Number.isFinite(ot.targetX)?{targetX:ot.targetX}:{},...typeof ot.targetY==="number"&&Number.isFinite(ot.targetY)?{targetY:ot.targetY}:{}}}function t3({id:ot="default",...st}){let ct=Nf.cursor(ot),gt=dh(ct),bt=fh(ct,null,vR),yt=new Map;for(let{connectionId:wt,userId:Ct,value:St}of gt){let Et=Aoe(St);if(Et)yt.set(wt,{id:Ct,point:Et})}let vt=[...yt],xt=lu(vt.map(([,wt])=>wt.id));return ta.jsx(Noe,{...st,id:ot,onPositionChange:bt,cursors:vt.map(([wt,{point:Ct}],St)=>({connectionId:wt,point:Ct,profile:xt[St]}))})}function Noe({id:ot="default",children:st,className:ct,cursors:gt,onPositionChange:bt}){let yt=Kp.useRef(null),vt=Kp.useRef(null);Kp.useLayoutEffect(()=>{let wt=yt.current,Ct=vt.current;if(!wt||!Ct)return;let St=()=>{Ct.style.transform=`translate(${wt.scrollLeft}px, ${wt.scrollTop}px)`};return St(),wt.addEventListener("scroll",St),()=>wt.removeEventListener("scroll",St)},[]);let xt=(wt)=>{if(wt.pointerType==="touch")return;let Ct=yt.current;if(!Ct||!(wt.target instanceof Element)||wt.target.closest("[data-collab-cursors]")!==Ct)return;let St=Ct.getBoundingClientRect(),Et=wt.target instanceof Element?wt.target.closest("[data-collab-target]"):null,kt=Et&&Ct.contains(Et)?Et:null,Rt=kt?.getBoundingClientRect();bt?.({x:wt.clientX-St.left-Ct.clientLeft+Ct.scrollLeft,y:wt.clientY-St.top-Ct.clientTop+Ct.scrollTop,...kt&&Rt?{target:kt.dataset.collabTarget??"",targetX:Rt.width?(wt.clientX-Rt.left)/Rt.width:0,targetY:Rt.height?(wt.clientY-Rt.top)/Rt.height:0}:{}})};return ta.jsxs("div",{ref:yt,"data-collab-cursors":ot,className:n("relative",ct),onPointerEnter:xt,onPointerMove:xt,onPointerLeave:(wt)=>{if(wt.target instanceof Element&&wt.target.closest("[data-collab-cursors]")===wt.currentTarget)bt?.(null)},children:[st,ta.jsx("div",{ref:vt,className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":"true",children:gt.map(({connectionId:wt,point:Ct,profile:St})=>ta.jsx(Doe,{root:yt,point:Ct,profile:St},wt))})]})}function Doe({root:ot,point:st,profile:ct}){let gt=Kp.useRef(null);return Kp.useLayoutEffect(()=>{let bt=ot.current,yt=gt.current;if(!bt||!yt)return;let vt=(St=!1)=>{let Et=st.x-bt.scrollLeft,kt=st.y-bt.scrollTop;if(st.target){let Tt=[...bt.querySelectorAll("[data-collab-target]")].find((It)=>It.dataset.collabTarget===st.target);if(!Tt){yt.hidden=!0;return}let Pt=bt.getBoundingClientRect(),Mt=Tt.getBoundingClientRect();Et=Mt.left-Pt.left-bt.clientLeft+Mt.width*(st.targetX??0),kt=Mt.top-Pt.top-bt.clientTop+Mt.height*(st.targetY??0)}let Rt=`translate(${Et}px, ${kt}px)`;if(yt.hidden||yt.style.transform!==Rt)yt.dataset.moving=St&&!yt.hidden?"true":"false",yt.style.transform=Rt;yt.hidden=!1};vt(!0);let xt=()=>vt(),wt=new ResizeObserver(xt);wt.observe(bt);let Ct=new MutationObserver(xt);return Ct.observe(bt,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-collab-target"]}),bt.addEventListener("scroll",xt,!0),window.addEventListener("resize",xt),()=>{wt.disconnect(),Ct.disconnect(),bt.removeEventListener("scroll",xt,!0),window.removeEventListener("resize",xt)}},[ot,st]),ta.jsx(_oe,{ref:gt,profile:ct})}function _oe({profile:ot,ref:st}){return ta.jsx("span",{ref:st,hidden:!0,"aria-hidden":"true","data-collab-color":ot?.color??"unknown",className:"pointer-events-none absolute top-0 left-0 transition-transform duration-100 ease-linear data-[moving=false]:transition-none motion-reduce:transition-none",children:ta.jsxs("span",{className:"relative block animate-in duration-200 zoom-in-75 fade-in",children:[ta.jsx(Ee,{size:24,stroke:1.5,className:"-translate-x-0.5 -translate-y-0.5 fill-collab stroke-white drop-shadow-xs"}),ta.jsx(_f,{className:"absolute top-3.5 left-3.5 bg-collab text-collab-foreground",children:ta.jsx("span",{className:"truncate",children:ot?au(ot):"Someone"})})]})})}var Fv=e(t(),1);var uu=e(r(),1);function n3({id:ot,present:st,align:ct,children:gt,className:bt}){let yt=Lv(ot),vt=Bv(yt,st),xt=lu(vt.users.map((wt)=>wt.id)).filter((wt)=>wt!==void 0);return uu.jsx(Ooe,{...vt.props,users:xt,align:ct,className:bt,children:gt})}function Ooe({users:ot,align:st,children:ct,className:gt,...bt}){return uu.jsxs("div",{className:n("relative",gt),...bt,children:[uu.jsx(Foe,{names:ot.map(au).join(", "),color:ot[0]?.color,align:st}),ct]})}var mh=4,Loe=6,Boe=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Foe({names:ot,color:st,align:ct="end"}){let gt=Fv.useRef(null);return Fv.useLayoutEffect(()=>{let bt=gt.current,yt=bt?.parentElement;if(!ot||!bt||!yt)return;let vt=()=>{let wt=[...yt.children].filter((It)=>{if(It===bt)return!1;let{display:At,position:Nt}=getComputedStyle(It);return At!=="none"&&Nt!=="absolute"&&Nt!=="fixed"}),Ct=[...yt.childNodes].some((It)=>It.nodeType===Node.TEXT_NODE&&It.textContent?.trim()),St=wt.length===1&&!Ct?wt[0]:null,Et=St instanceof HTMLElement?St:null,Rt=(Et??yt).getBoundingClientRect(),Tt=yt.getBoundingClientRect(),Pt=bt.style;Pt.left=`${Rt.left-Tt.left-yt.clientLeft+yt.scrollLeft-mh}px`,Pt.top=`${Rt.top-Tt.top-yt.clientTop+yt.scrollTop-mh}px`,Pt.width=`${Rt.width+mh*2}px`,Pt.height=`${Rt.height+mh*2}px`,Pt.setProperty("--presence-target-width",`${Rt.width}px`);let Mt=Et?getComputedStyle(Et):null;for(let It of Boe)Pt[It]=Mt?`calc(${Mt[It]} + ${mh}px)`:`${Loe}px`};vt();let xt=new ResizeObserver(vt);xt.observe(yt);for(let wt of yt.children)if(wt!==bt)xt.observe(wt);return()=>xt.disconnect()}),uu.jsx("div",{ref:gt,hidden:!ot,"data-align":ct,"data-collab-color":st??"unknown",className:"group/frame pointer-events-none absolute m-0! animate-in ring-2 ring-collab duration-150 fade-in",children:uu.jsx(_f,{className:"absolute bottom-full mb-1.5 max-w-[min(var(--presence-target-width),10rem)] bg-collab text-collab-foreground group-data-[align=end]/frame:-right-0.5 group-data-[align=start]/frame:-left-0.5",children:uu.jsx("span",{className:"truncate",children:ot})})})}var Lf=e(t(),1);var hh=e(r(),1),Ma=e(t(),1);var wR=e(r(),1),c3=e(t(),1),pu=e(t(),1);var s3=e(r(),1);var Hoe=(ot)=>!ot.isLayoutDirty&&ot.willUpdate(!1);function xR(){let ot=new Set,st=new WeakMap,ct=()=>ot.forEach(Hoe);return{add:(gt)=>{ot.add(gt),st.set(gt,gt.addEventListener("willUpdate",ct))},remove:(gt)=>{ot.delete(gt);let bt=st.get(gt);if(bt)bt(),st.delete(gt);ct()},dirty:ct}}var Hv=e(t(),1),cc=e(t(),1);var o3=e(t(),1);function r3(ot,st){if(typeof ot==="function")return ot(st);else if(ot!==null&&ot!==void 0)ot.current=st}function zoe(...ot){return(st)=>{let ct=!1,gt=ot.map((bt)=>{let yt=r3(bt,st);if(!ct&&typeof yt==="function")ct=!0;return yt});if(ct)return()=>{for(let bt=0;bt<gt.length;bt++){let yt=gt[bt];if(typeof yt==="function")yt();else r3(ot[bt],null)}}}}function i3(...ot){return o3.useCallback(zoe(...ot),ot)}class a3 extends Hv.Component{getSnapshotBeforeUpdate(ot){let st=this.props.childRef.current;if(ye(st)&&ot.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let ct=st.offsetParent,gt=ye(ct)?ct.offsetWidth||0:0,bt=ye(ct)?ct.offsetHeight||0:0,yt=getComputedStyle(st),vt=this.props.sizeRef.current;vt.height=parseFloat(yt.height),vt.width=parseFloat(yt.width),vt.top=st.offsetTop,vt.left=st.offsetLeft,vt.right=gt-vt.width-vt.left,vt.bottom=bt-vt.height-vt.top,vt.direction=yt.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function l3({children:ot,isPresent:st,anchorX:ct,anchorY:gt,root:bt,pop:yt}){let vt=cc.useId(),xt=cc.useRef(null),wt=cc.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:Ct}=cc.useContext(le),St=yt!==!1?ot.props?.ref??ot?.ref:void 0,Et=i3(xt,St);return cc.useInsertionEffect(()=>{let{width:kt,height:Rt,top:Tt,left:Pt,right:Mt,bottom:It,direction:At}=wt.current;if(st||yt===!1||!xt.current||!kt||!Rt)return;let Nt=At==="rtl",Ot=ct==="left"?Nt?`right: ${Mt}`:`left: ${Pt}`:Nt?`left: ${Pt}`:`right: ${Mt}`,Dt=gt==="bottom"?`bottom: ${It}`:`top: ${Tt}`;xt.current.dataset.motionPopId=vt;let _t=document.createElement("style");if(Ct)_t.nonce=Ct;let $t=bt??document.head;if($t.appendChild(_t),_t.sheet)_t.sheet.insertRule(`
10
+ [data-motion-pop-id="${vt}"] {
11
+ position: absolute !important;
12
+ width: ${kt}px !important;
13
+ height: ${Rt}px !important;
14
+ ${Ot}px !important;
15
+ ${Dt}px !important;
16
+ }
17
+ `);return()=>{if(xt.current?.removeAttribute("data-motion-pop-id"),$t.contains(_t))$t.removeChild(_t)}},[st]),s3.jsx(a3,{isPresent:st,childRef:xt,sizeRef:wt,pop:yt,children:yt===!1?ot:Hv.cloneElement(ot,{ref:Et})})}var u3=({children:ot,initial:st,isPresent:ct,onExitComplete:gt,custom:bt,presenceAffectsLayout:yt,mode:vt,anchorX:xt,anchorY:wt,root:Ct})=>{let St=fe($oe),Et=pu.useId(),kt=pu.useRef(ct),Rt=pu.useRef(gt);me(()=>{kt.current=ct,Rt.current=gt});let Tt=!0,Pt=pu.useMemo(()=>(Tt=!1,{id:Et,initial:st,isPresent:ct,custom:bt,onExitComplete:(Mt)=>{St.set(Mt,!0);for(let It of St.values())if(!It)return;gt&&gt()},register:(Mt)=>(St.set(Mt,!1),()=>{St.delete(Mt),!kt.current&&!St.size&&Rt.current?.()})}),[ct,St,gt]);if(yt&&Tt)Pt={...Pt};return pu.useMemo(()=>{St.forEach((Mt,It)=>St.set(It,!1))},[ct]),c3.useEffect(()=>{!ct&&!St.size&&gt&&gt()},[ct]),ot=wR.jsx(l3,{pop:vt==="popLayout",isPresent:ct,anchorX:xt,anchorY:wt,root:Ct,children:ot}),wR.jsx(he.Provider,{value:Pt,children:ot})};function $oe(){return new Map}var zv=e(t(),1),gh=(ot)=>ot.key||"";function CR(ot){let st=[];return zv.Children.forEach(ot,(ct)=>{if(zv.isValidElement(ct))st.push(ct)}),st}var Qi=({children:ot,custom:st,initial:ct=!0,onExitComplete:gt,presenceAffectsLayout:bt=!0,mode:yt="sync",propagate:vt=!1,anchorX:xt="left",anchorY:wt="top",root:Ct})=>{let[St,Et]=Ye(vt),kt=Ma.useMemo(()=>CR(ot),[ot]),Rt=vt&&!St?[]:kt.map(gh),Tt=Ma.useRef(!0),Pt=Ma.useRef(kt),Mt=fe(()=>new Map),It=Ma.useRef(new Set),[At,Nt]=Ma.useState(kt),[Ot,Dt]=Ma.useState(kt);me(()=>{Tt.current=!1,Pt.current=kt;for(let Ft=0;Ft<Ot.length;Ft++){let Bt=gh(Ot[Ft]);if(!Rt.includes(Bt)){if(Mt.get(Bt)!==!0)Mt.set(Bt,!1)}else Mt.delete(Bt),It.current.delete(Bt)}},[Ot,Rt.length,Rt.join("-")]);let _t=[];if(kt!==At){let Ft=[...kt];for(let Bt=0;Bt<Ot.length;Bt++){let Lt=Ot[Bt],Vt=gh(Lt);if(!Rt.includes(Vt))Ft.splice(Bt,0,Lt),_t.push(Lt)}if(yt==="wait"&&_t.length)Ft=_t;return Dt(CR(Ft)),Nt(kt),null}let{forceRender:$t}=Ma.useContext(se);return hh.jsx(hh.Fragment,{children:Ot.map((Ft)=>{let Bt=gh(Ft),Lt=vt&&!St?!1:kt===Ot||Rt.includes(Bt),Vt=()=>{if(It.current.has(Bt))return;if(Mt.has(Bt))It.current.add(Bt),Mt.set(Bt,!0);else return;let Wt=!0;if(Mt.forEach((Ut)=>{if(!Ut)Wt=!1}),Wt)$t?.(),Dt(Pt.current),vt&&Et?.(),gt&&gt()};return hh.jsx(u3,{isPresent:Lt,initial:!Tt.current||ct?void 0:!1,custom:st,presenceAffectsLayout:bt,mode:yt,root:Ct,onExitComplete:Lt?void 0:Vt,anchorX:xt,anchorY:wt,children:Ft},Bt)})})};var h3=e(r(),1),qp=e(t(),1);var p3=e(t(),1),d3=p3.createContext(null);var bh=e(t(),1);var f3=e(t(),1);function m3(){let ot=f3.useRef(!1);return me(()=>(ot.current=!0,()=>{ot.current=!1}),[]),ot}function g3(){let ot=m3(),[st,ct]=bh.useState(0),gt=bh.useCallback(()=>{ot.current&&ct(st+1)},[st]);return[bh.useCallback(()=>h.postRender(gt),[gt]),st]}var b3=(ot)=>ot===!0,Woe=(ot)=>b3(ot===!0)||ot==="id",$v=({children:ot,id:st,inherit:ct=!0})=>{let gt=qp.useContext(se),bt=qp.useContext(d3),[yt,vt]=g3(),xt=qp.useRef(null),wt=gt.id||bt;if(xt.current===null){if(Woe(ct)&&wt)st=st?wt+"-"+st:wt;xt.current={id:st,group:b3(ct)?gt.group||xR():xR()}}let Ct=qp.useMemo(()=>({...xt.current,forceRender:yt}),[vt]);return h3.jsx(se.Provider,{value:Ct,children:ot})};var y3=e(r(),1),Wv=e(t(),1);function v3({children:ot,isValidProp:st,...ct}){st&&nt(st);let gt=Wv.useContext(le);ct={...gt,...ct},ct.transition=xe(ct.transition,gt.transition),ct.isStatic=fe(()=>ct.isStatic);let bt=Wv.useMemo(()=>ct,[JSON.stringify(ct.transition),ct.transformPagePoint,ct.reducedMotion,ct.skipAnimations]);return y3.jsx(le.Provider,{value:bt,children:ot})}var yh=e(r(),1);function x3({id:ot,children:st}){let ct=Lf.useContext(Of),gt=Lf.useMemo(()=>(Ov(ot),[...ct,ot]),[ct,ot]);return yh.jsx(Uoe,{children:yh.jsx(Of,{value:gt,children:st})})}function Uoe({children:ot}){let st=Lf.useId();return yh.jsx(v3,{reducedMotion:"user",children:yh.jsx($v,{id:st,children:ot})})}var w3=e(t(),1);var Qp=e(r(),1);function C3({id:ot,present:st,align:ct,children:gt,className:bt}){let yt=Lv(ot),vt=Bv(yt,st),xt=lu(vt.users.map((Ct)=>Ct.id)),wt=w3.useContext(Of).length>0;return Qp.jsx(joe,{...vt.props,users:vt.users.map((Ct,St)=>({...Ct,profile:xt[St]})),animate:wt&&st===void 0,align:ct,className:bt,children:gt})}function joe({users:ot,children:st,animate:ct=!1,align:gt="center",className:bt,...yt}){return Qp.jsxs("div",{className:n("relative pl-8",bt),...yt,children:[st,Qp.jsx("div",{"data-align":gt,className:"pointer-events-none absolute inset-y-0 left-0 flex items-center -space-x-3 data-[align=end]:items-end data-[align=start]:items-start","aria-hidden":"true",children:ot.map(({id:vt,connectionId:xt,profile:wt})=>Qp.jsx(S.span,{layoutId:ct?`presence:${xt}`:void 0,children:Qp.jsx(lc,{profile:wt,size:"sm",className:"animate-in duration-200 zoom-in-75 fade-in"})},vt))})]})}var SR={Cursors:t3,User:Nv,UserAvatar:YB,UserAvatarGroup:Dv,PresenceFrame:n3,PresenceAvatars:C3,PresenceGroup:x3,useMe:Av,usePeers:QB,useUser:Af,useWorkspaceUsers:Mv,usePresence:JB,usePublishPresence:XB};function Bf(ot){return Tn.state(ot)}function S3(ot){return[...Bf(ot),"write"]}function ER(ot,st){return ot.isMutating({mutationKey:S3(st)})}function E3(ot,st){return ot&&ot.revision>st.revision?ot:st}function kR(ot,st){let ct=Bf(st);return{queryKey:ct,queryFn:async({signal:gt})=>{let bt=await p(`/api/workspaces/${st}/state`,{signal:gt}),yt=ot.getQueryData(ct);if(yt&&ER(ot,st)>0)return yt;return E3(yt,bt)},staleTime:0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!0}}function du(ot,st){let ct=Kn();return kr({...kR(ct,ot),select:st})}function na(ot,st){return ot.getQueryData(Bf(st))}function ra(ot,st,ct){ot.setQueryData(Bf(st),(gt)=>{if(!gt)return gt;let bt=structuredClone(gt);return ct(bt),bt})}function Uv(ot,st,ct){ot.setQueryData(Bf(st),(gt)=>E3(gt,ct))}function Ff(ot,{request:st,optimistic:ct,onSuccess:gt,errorTitle:bt}){let yt=Kn(),vt=Bf(ot);return zr({mutationKey:S3(ot),scope:{id:`workspace-state:${ot}`},mutationFn:st,onMutate:async(xt)=>{if(!ct)return;await yt.cancelQueries({queryKey:vt,exact:!0}),ra(yt,ot,(wt)=>ct(wt,xt))},onSuccess:(xt,wt)=>{if(ER(yt,ot)===1)Uv(yt,ot,xt);gt?.(xt,wt)},onError:(xt)=>{qr.add({title:bt,description:xt.message,type:"error"}),yt.invalidateQueries({queryKey:vt,exact:!0})}})}function k3(){let ot=Kn();E((st)=>{if(st.type!=="state:changed")return;if(!na(ot,st.workspaceId))return;if(ER(ot,st.workspaceId)>0)return;Uv(ot,st.workspaceId,st.state)})}function R3(ot,st,ct){if(st===ct)return;let gt=ot.sessions[st];if(gt){let bt=ot.sessions[ct],yt=gt.config||bt?.config?{...gt.config,...bt?.config}:void 0;ot.sessions[ct]={...gt,...bt,...yt?{config:yt}:{}},delete ot.sessions[st]}for(let bt of Object.values(ot.sessions))if(bt.fork?.fromSessionId===st)bt.fork.fromSessionId=ct;for(let[bt,yt]of Object.entries(ot.selected))if(yt===st)ot.selected[bt]=ct;if(ot.pinnedSessionId===st)ot.pinnedSessionId=ct;for(let bt of Object.values(ot.pendingViews))if(bt.buildSessionId===st)bt.buildSessionId=ct}function T3(ot,st){for(let[ct,gt]of Object.entries(ot.selected))if(gt===st)delete ot.selected[ct];if(ot.pinnedSessionId===st)delete ot.pinnedSessionId}var Voe=(ot)=>Le()(Fe((st)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},dockedChatWidth:360,popupChatWidth:440,setDiscoveredWorkspacesOpen:(ct)=>st({discoveredWorkspacesOpen:ct}),markWorkspacePendingAnalysis:(ct)=>st((gt)=>{let bt=gt.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:bt.includes(ct)?bt:[...bt,ct]}}),markMessageSentFromMoi:(ct)=>st((gt)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(gt.workspaceIdsPendingAnalysis??[]).filter((bt)=>bt!==ct)})),setComposerDraft:(ct,gt)=>st((bt)=>{if(gt===null?!(ct in bt.composerDrafts):bt.composerDrafts[ct]===gt)return bt;let yt={...bt.composerDrafts};if(gt===null)delete yt[ct];else yt[ct]=gt;return{composerDrafts:yt}}),moveComposerDraft:(ct,gt)=>st((bt)=>{if(ct===gt||!(ct in bt.composerDrafts))return bt;let yt={...bt.composerDrafts};return yt[gt]??=yt[ct],delete yt[ct],{composerDrafts:yt}}),setDockedChatWidth:(ct)=>st({dockedChatWidth:ct}),setPopupChatWidth:(ct)=>st({popupChatWidth:ct})}),{name:"moi:ui",...ot?{storage:at(()=>ot)}:{}})),Ar=Voe();function Yo(ot){return`draft:${ot}`}function oi(ot,st){return JSON.stringify([ot,st])}function fl(ot){return A5.browserTabSelection(ot)}function RR(ot){return{queryKey:fl(ot),queryFn:()=>Promise.resolve(Wp(ot)),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}}function I3(ot,st,ct){if(!ot)return;if(ot.pinnedSessionId)return ot.pinnedSessionId;if(ct&&st in ct.selected)return ct.selected[st]??null;return ot.selected[st]??null}function TR(ot,st){return ot.getQueryData(fl(st))??Wp(st)}function M3(ot,st,ct,gt){return I3(na(ot,st),ct,gt==="browser-tab"?TR(ot,st):void 0)}function PR(ot,st,ct){let gt={...TR(ot,st).selected};ct(gt),ot.setQueryData(fl(st),{selected:gt}),Yc(st,{selected:gt})}function Goe(ot,st){if(st.show)ot.selected[st.tabId]=st.sessionId;else if(ot.selected[st.tabId]===st.sessionId)delete ot.selected[st.tabId]}function P3(ot,st,ct,gt,bt){if(bt==="browser-tab"){let vt=TR(ot,st);if(gt in vt.selected&&(vt.selected[gt]??null)===ct)return;PR(ot,st,(xt)=>{xt[gt]=ct});return}let yt=na(ot,st)?.selected[gt]??null;if(yt===ct)return;if(ct===null)return yt?{sessionId:yt,tabId:gt,show:!1}:void 0;return{sessionId:ct,tabId:gt,show:!0,ifMatch:yt}}function IR(ot,st,ct,gt,bt){if(bt==="browser-tab")PR(ot,st,(yt)=>{yt[gt]=ct});else ra(ot,st,(yt)=>{yt.selected[gt]=ct})}function jv(ot,st,ct,gt){Ar.getState().moveComposerDraft(oi(st,ct),oi(st,gt)),ra(ot,st,(bt)=>R3(bt,ct,gt)),PR(ot,st,(bt)=>{for(let[yt,vt]of Object.entries(bt))if(vt===ct)bt[yt]=gt})}function uc(){let ot=TE()["*"];return ul(ot)?ot:"overview"}function Koe(ot){return Ff(ot,{request:({sessionId:st,tabId:ct,show:gt,ifMatch:bt})=>p(`/api/workspaces/${ot}/sessions/${encodeURIComponent(st)}/selection`,v(gt?"PUT":"DELETE",gt?{tabId:ct,ifMatch:bt}:{tabId:ct}),"Couldn’t save selected chat"),optimistic:Goe,errorTitle:"Couldn’t save selected chat"})}function pc(ot){let st=uc(),ct=ot??st,gt=b(),yt=Si()?"browser-tab":"shared",vt=Kn(),xt=du(gt).data,wt=kr({...RR(gt),enabled:yt==="browser-tab"}).data,{mutate:Ct,mutateAsync:St}=Koe(gt),Et=Hf.useCallback((Tt)=>{if(na(vt,gt)?.pinnedSessionId)return;let Pt=P3(vt,gt,Tt,ct,yt);if(Pt)Ct(Pt)},[vt,Ct,gt,ct,yt]),kt=Hf.useCallback(async(Tt,Pt)=>{let Mt=P3(vt,gt,Tt,Pt,yt);if(!Mt)return;if((await St(Mt)).selected[Pt]!==Tt)throw Error("Couldn’t save selected chat")},[vt,St,yt,gt]);return[yt==="browser-tab"&&wt===void 0?void 0:I3(xt,ct,yt==="browser-tab"?wt:void 0),Et,kt]}function fu(){let ot=b(),st=Kn(),ct=du(ot).data,{mutate:gt,mutateAsync:bt}=Ff(ot,{request:({sessionId:wt,pinned:Ct})=>p(`/api/workspaces/${ot}/sessions/${encodeURIComponent(wt)}/pin`,{method:Ct?"PUT":"DELETE"},Ct?"Couldn’t pin chat":"Couldn’t unpin chat"),optimistic:(wt,{sessionId:Ct,pinned:St})=>{if(St)wt.pinnedSessionId=Ct;else if(wt.pinnedSessionId===Ct)delete wt.pinnedSessionId},errorTitle:"Couldn’t change the pinned chat"}),yt=Hf.useCallback((wt)=>gt({sessionId:wt,pinned:!0}),[gt]),vt=Hf.useCallback(async()=>{let wt=na(st,ot)?.pinnedSessionId;if(wt)await bt({sessionId:wt,pinned:!1})},[bt,st,ot]),xt=Hf.useCallback(()=>void vt().catch(()=>{}),[vt]);return{pinnedSessionId:ct?.pinnedSessionId,loaded:ct!==void 0,pin:yt,unpin:xt,unpinAsync:vt}}var Vv=e(t(),1);function N3(ot){return{queryKey:Tn.sessions(ot),queryFn:()=>p(`/api/workspaces/${ot}/sessions`),staleTime:30000,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0}}var qoe=(ot)=>ot.sessions;function Gv(ot){let st=kr(N3(ot)).data,ct=du(ot,qoe).data;return{data:Vv.useMemo(()=>st&&ct?st.map((bt)=>{let yt=ct[bt.sessionId]?.tabId;return yt?{...bt,tabId:yt}:bt}):void 0,[st,ct])}}function D3(){let ot=b(),st=Kn(),ct=Si(),[,,gt]=pc(),{unpinAsync:bt}=fu(),yt=k({collabEnabled:ct,selectSessionForTab:gt,unpinAsync:bt});return Vv.useCallback(async(vt,xt,wt)=>{let{collabEnabled:Ct,selectSessionForTab:St,unpinAsync:Et}=yt.current;wt.throwIfAborted();let kt=st.getQueryData(Tn.sessions(ot))??[];if(!kt.some((Mt)=>Mt.sessionId===vt))kt=await st.fetchQuery({...N3(ot),staleTime:0});if(wt.throwIfAborted(),!kt.some((Mt)=>Mt.sessionId===vt))return;let Rt=await st.ensureQueryData(kR(st,ot));if(Ct)await st.ensureQueryData(RR(ot));wt.throwIfAborted();let Tt=Rt.pinnedSessionId,Pt=Tt===vt?xt:Rt.sessions[vt]?.tabId??"overview";if(Tt&&Tt!==vt)await Et(),wt.throwIfAborted();if(Tt!==vt)await St(vt,Pt),wt.throwIfAborted();return Pt},[st,yt,ot])}function Qoe(ot,st){return ot?.filter((ct)=>ct.sessionId!==st)}function MR(ot,st,ct){let gt=Tn.sessions(st);ot.cancelQueries({queryKey:gt}),ot.setQueryData(gt,(xt)=>Qoe(xt,ct)),ot.removeQueries({queryKey:Tn.events(st,ct)}),ra(ot,st,(xt)=>T3(xt,ct));let bt=fl(st),yt=ot.getQueryData(bt)??Wp(st);if(!Object.values(yt.selected).includes(ct))return;let vt=Object.fromEntries(Object.entries(yt.selected).map(([xt,wt])=>[xt,wt===ct?null:wt]));ot.setQueryData(bt,{selected:vt}),Yc(st,{selected:vt})}function _3(ot){let st=Kn();return Ff(ot,{request:(ct)=>p(`/api/workspaces/${ot}/sessions/${encodeURIComponent(ct)}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(ct,gt)=>{MR(st,ot,gt),st.invalidateQueries({queryKey:Tn.previews})},errorTitle:"Couldn’t archive chat"})}function O3(ot,st){return kr({...M5(ot,st??""),enabled:Boolean(st)})}var A3={};function Kv(ot,st){return du(ot,(ct)=>st?ct.sessions[st]??A3:A3)}function L3(ot){return Ff(ot,{request:({sessionId:st,patch:ct})=>p(`/api/workspaces/${ot}/sessions/${encodeURIComponent(st)}/config`,v("PATCH",ct),"Failed to save chat settings"),optimistic:(st,{sessionId:ct,patch:gt})=>{let bt=st.sessions[ct]??={},yt={...bt.config};for(let vt of["model","effort","speedMode"]){let xt=gt[vt];if(xt===null)delete yt[vt];else if(xt!==void 0)Object.assign(yt,{[vt]:xt})}bt.config=yt},errorTitle:"Couldn’t save chat settings"})}function B3(ot,st){let{queryClient:ct,sendMessage:gt,onWorkspaceSwitch:bt}=st,yt=Mr.getState();if(ot.type==="status_snapshot"){yt.reconcileActivity(ot.sessions??[]);return}if(ot.type==="status"){let{workspaceId:Ct,sessionId:St,activity:Et}=ot;if(yt.setActivity(Ct,St,Et),Et!=="running")yt.clearPreviewsForSession(Ct,St);return}if(ot.type==="preview"){let Ct=ot,St=Tn.events(Ct.workspaceId,Ct.sessionId);if(ct?.getQueryData(St)===void 0)return;yt.setPreview({workspaceId:Ct.workspaceId,sessionId:Ct.sessionId,messageId:Ct.messageId,parentToolUseId:Ct.parentToolUseId,blocks:Ct.blocks});return}if(ot.type==="session_renamed"){let{workspaceId:Ct,from:St,to:Et}=ot,kt=Tn.sessions(Ct),Tt=ct?.getQueryData(kt)?.find((Mt)=>Mt.sessionId===St||Mt.sessionId===Et);if(Tt)ct?.cancelQueries({queryKey:kt});if(yt.renameSession(Ct,St,Et),ct)jv(ct,Ct,St,Et);if(Tt)ct?.setQueryData(kt,(Mt)=>[{...Tt,sessionId:Et},...(Mt??[]).filter((It)=>It.sessionId!==St&&It.sessionId!==Et)]);let Pt=ct?.getQueryData(Tn.events(Ct,St));if(Pt!==void 0)ct?.setQueryData(Tn.events(Ct,Et),Pt),ct?.removeQueries({queryKey:Tn.events(Ct,St)});if(!Tt)ct?.invalidateQueries({queryKey:kt});ct?.invalidateQueries({queryKey:Tn.previews});return}if(ot.type==="sessions_changed"||ot.type==="session_archived"){let Ct=ot.workspaceId;if(ct&&ot.type==="session_archived"&&typeof ot.sessionId==="string")MR(ct,Ct,ot.sessionId);let St=Tn.sessions(Ct);ct?.invalidateQueries({queryKey:St}),ct?.invalidateQueries({queryKey:Tn.previews});return}if(ot.type==="workspace:switch"){bt?.(ot.workspaceId);return}if(ot.type==="scratchpad:op"){let Ct=ft(ot.workspaceId);if(!Ct)return;let St=ot.opId;Ct(ot.op).then((Et)=>gt({type:"scratchpad:op-result",opId:St,result:Et}),(Et)=>gt({type:"scratchpad:op-result",opId:St,error:Et instanceof Error?Et.message:String(Et)}));return}let{workspaceId:vt,sessionId:xt}=ot;if(!vt||!xt)return;let wt=ot.kind;if(wt==="snapshot"||wt==="turn"||wt==="notice"||wt==="result"){if(Joe(ct,vt,xt,ot),wt==="turn"){let Ct=ot.turn?.meta?.apiMessageId;if(Ct)yt.clearPreview(Ct)}if(wt==="result")yt.clearPreviewsForSession(vt,xt)}if(wt==="error"&&typeof ot.content==="string"){if(yt.setError(vt,xt,ot.content),ot.terminal!==!1)yt.setActivity(vt,xt,"idle"),yt.clearPreviewsForSession(vt,xt)}if(wt==="stopped")yt.setActivity(vt,xt,"idle"),yt.clearPreviewsForSession(vt,xt)}function Joe(ot,st,ct,gt){if(!ot)return;I5(ot,st,ct,gt);let bt=Tn.events(st,ct),yt=ot.getQueryData(bt);if(yt===void 0)return;ot.setQueryData(bt,uv(yt,gt))}var NR=null,zf=null,qv=0,Qv=null,AR=[],H3=null,F3=null,Xoe=15000;function z3(ot){if(NR=ot,!F3)F3=setInterval(()=>Mr.getState().sweepPreviews(Xoe,Date.now()),5000);if(zf)return;$3()}function $3(){let ot=++qv;if(Qv)clearTimeout(Qv),Qv=null;let st=new WebSocket(gf("/ws"));zf=st,st.onopen=()=>{if(qv!==ot){st.close();return}for(let ct of AR)st.send(JSON.stringify(ct));AR.length=0,NR?.invalidateQueries({queryKey:["workspaces","events"]}),Mr.getState().clearAllPreviews()},st.onmessage=(ct)=>{if(qv!==ot)return;let gt;try{gt=JSON.parse(ct.data)}catch{return}Yoe(gt)},st.onclose=()=>{if(qv!==ot)return;zf=null,Qv=setTimeout($3,1000)},st.onerror=()=>st.close()}function Yoe(ot){B3(ot,{queryClient:NR,sendMessage:Jv,onWorkspaceSwitch:H3})}function Jv(ot){if(zf&&zf.readyState===WebSocket.OPEN)zf.send(JSON.stringify(ot));else AR.push(ot)}function DR(ot){H3=ot}var W3=e(t(),1);function Xv(){return W3.useSyncExternalStore(Ue,U,U)}var Xp=e(t(),1);async function _R(ot,st){let ct=U(),gt=Q();if(!ct||ct.type!=="user"||ct.isAnonymous)throw Error("Sign in to change your profile");let bt=await st(),yt=U();if(gt!==Q()||!yt||yt.type!=="user"||yt.id!==ct.id)throw Error("Your account changed. Reload Moi to try again.");if(ce({...yt,...ot==="name"&&yt.name===ct.name?{name:bt.name}:{},...ot==="avatar"&&yt.avatar===ct.avatar?{avatar:bt.avatar}:{}}),gt===Q())await M.invalidateQueries({queryKey:N.account(W(yt))})}var OR={all:["account"],identityRefresh:["account","identity-refresh"]};class LR extends Error{status;constructor(ot,st){super(ot);this.status=st}}async function Jp(ot,st){let ct=await fetch(`/cloud/api/${ot}`,{...st,credentials:"same-origin"});if(!ct.ok){let gt=await ct.json().catch(()=>{return}),bt=ne(gt)?[gt.error,gt.message].find((yt)=>typeof yt==="string"&&yt.trim().length>0):void 0;throw new LR(bt??"Couldn’t complete this request. Try again.",ct.status)}return ct}var U3=Vl({queryKey:OR.identityRefresh,queryFn:async({signal:ot})=>{let st=_e(),ct;try{ct=ie(await(await Jp("me",{signal:ot})).json())}catch(gt){if(!(gt instanceof LR)||gt.status!==401)throw gt;ct=null}if(!ot.aborted&&_e()===st)ce(ct);return!0},retry:!1,staleTime:30000}),j3=async(ot)=>ie(await(await Jp("me",v("PATCH",ot))).json());async function V3(ot){let st=new FormData;return st.set("file",ot),ie(await(await Jp("me/avatar",{method:"PUT",body:st})).json())}var G3=async()=>ie(await(await Jp("me/avatar",{method:"DELETE"})).json()),K3=()=>Jp("auth/sign-out",v("POST"));var J3=e(r(),1);function Zoe(){let{environment:ot,demo:st}=R(),ct=ot==="cloud",gt=Xp.useSyncExternalStore(ue,B,B),bt=Xp.useSyncExternalStore(ue,j,j),yt=Xv(),vt=Kn(),xt=kr({...U3,enabled:ct&&!st}),wt=ct&&!st&&yt?.type==="user"&&!yt.isAnonymous,Ct=zr({mutationFn:K3,onSuccess:async()=>{await vt.cancelQueries({queryKey:OR.all}),ce(null),window.location.assign("/cloud/login")}});async function St(Rt){let Tt=Rt.trim();if(!Tt||Tt.length>80)throw Error("Enter a name of up to 80 characters");if(ct)return await _R("name",()=>j3({name:Tt})),Tt;let Pt=B();if(j()!=="local"||!Pt||Pt.id!==gt?.id)throw Error("This profile is managed by your sign-in provider");return He({...Pt,name:Tt}),Tt}async function Et(Rt){await _R("avatar",()=>Rt?V3(Rt):G3())}function kt(){if(st)return"signed-out";if(!ct)return gt?"ready":"error";if(yt===void 0)return xt.isError?"error":"loading";if(!yt||yt.type==="user"&&yt.isAnonymous)return"signed-out";return"ready"}return{cloud:ct,demo:st||yt?.type==="user"&&yt.isAnonymous,profile:gt,identity:yt,status:kt(),email:wt&&yt?.type==="user"?yt.email:void 0,canEdit:ct?wt:bt==="local",registered:wt,saveName:St,saveAvatar:Et,signOut:Ct,retry:()=>ct?void xt.refetch():window.location.reload()}}var q3=Xp.createContext(void 0);function Q3({children:ot}){let st=Zoe();return J3.jsx(q3,{value:st,children:ot})}function mu(){let ot=Xp.useContext(q3);if(!ot)throw Error("AccountProvider is required");return ot}var Yv=e(t(),1);class BR{url;listeners=new Set;baseDelayMs;maxDelayMs;socket;closed=!0;reconnectAttempt=0;reconnectTimer;shownWorkspace;constructor(ot,st={}){this.url=ot;this.baseDelayMs=st.reconnectBaseDelayMs??1000,this.maxDelayMs=st.reconnectMaxDelayMs??30000}connect(){this.closed=!1,this.open()}close(){this.closed=!0,clearTimeout(this.reconnectTimer);let ot=this.socket;this.socket=void 0,ot?.close()}subscribe(ot){return this.listeners.add(ot),()=>{this.listeners.delete(ot)}}send(ot){if(this.socket?.readyState!==WebSocket.OPEN)return;this.socket.send(JSON.stringify(ot))}get navigationWorkspace(){return this.shownWorkspace}setNavigationWorkspace(ot){this.shownWorkspace=ot,this.sendNavigationPresence()}sendNavigationPresence(){this.send({type:"navigation:presence",workspaceId:this.shownWorkspace??null,focused:document.visibilityState==="visible"&&document.hasFocus()})}open(){if(this.closed||this.socket)return;let ot=new WebSocket(this.url);this.socket=ot,ot.onopen=()=>{this.reconnectAttempt=0,this.sendNavigationPresence();for(let st of this.listeners)st({type:"connection:opened"})},ot.onmessage=(st)=>{try{let ct=JSON.parse(st.data);for(let gt of this.listeners)gt(ct)}catch{}},ot.onclose=()=>{if(this.socket!==ot)return;if(this.socket=void 0,!this.closed)this.scheduleReconnect()},ot.onerror=()=>{ot.close()}}scheduleReconnect(){let ot=Math.min(this.baseDelayMs*2**this.reconnectAttempt,this.maxDelayMs);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>this.open(),ot)}}var Y3=e(r(),1);function X3({children:ot}){let st=Kn(),[ct]=Yv.useState(()=>({events:new BR(gf("/api/workspaces/ws"))}));return Yv.useEffect(()=>{let gt=ct.events.subscribe((bt)=>{if(bt.type==="harness-status:changed"){let yt=["harness-status"];if(st.cancelQueries({queryKey:yt}),st.setQueryData(yt,(vt)=>vt?{...vt,[bt.harness]:bt.status}:void 0),!st.getQueryData(yt))st.invalidateQueries({queryKey:yt});if(bt.status.availability.status==="available")st.invalidateQueries({queryKey:["workspaces","harness"]})}else if(bt.type==="connection:opened"||bt.type==="harness:updated")st.invalidateQueries({queryKey:["harness-status"]})});return ct.events.connect(),()=>{gt(),ct.events.close()}},[ct,st]),Y3.jsx(it,{value:ct,children:ot})}var FR=e(r(),1);function $f({children:ot,className:st,...ct}){return FR.jsx("section",{...ct,className:n("flex min-h-0 flex-1 flex-col overflow-y-auto bg-muted texture-checker-20",st),children:FR.jsx("div",{className:"flex flex-1 flex-col bg-radial from-background from-25% to-transparent",children:ot})})}var HT=e(t(),1);var HR=["app-settings"];function Zv(){let ot=Kn();return E((st)=>{if(st.type==="settings:updated")ot.setQueryData(HR,st.settings)}),kr({queryKey:HR,queryFn:()=>p("/api/settings"),staleTime:30000})}function Wf(){let ot=Kn();return zr({mutationFn:(st)=>p("/api/settings",v("PATCH",st),"Failed to save settings"),onSuccess:(st)=>{ot.setQueryData(HR,st)}})}function ex(){let st=!R().demo,ct=Zv();return{...ct,enabled:st,loading:st&&ct.isPending,error:st?ct.error:void 0,retry:()=>void ct.refetch()}}function zR(ot){return p("/api/onboarding/cancel",v("POST",{runId:ot}))}function $R(ot,st,ct=!1){return kr({queryKey:["onboarding-job",ot,st,ct],queryFn:({signal:gt})=>p(`/api/onboarding/${ot}`,{...v("POST",{...st,retry:ct}),signal:gt}),enabled:!!st,retry:!1,refetchOnWindowFocus:!1,refetchInterval:(gt)=>gt.state.data?.status==="running"?1500:!1})}var Z3=e(r(),1);function $o({className:ot,...st}){return Z3.jsx(No,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:u("size-4 animate-spin",ot),stroke:1.75,...st})}var Yp=e(r(),1);function Uf({error:ot,onRetry:st}){if(ot)return Yp.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center gap-4 p-6",children:[Yp.jsx("p",{className:"text-sm text-muted-foreground",children:ot.message}),Yp.jsx(a,{variant:"secondary",onClick:st,children:"Try again"})]});return Yp.jsx("div",{role:"status","aria-label":"Loading onboarding",className:"flex flex-1 items-center justify-center",children:Yp.jsx($o,{className:"size-6 text-muted-foreground",stroke:1.5})})}var jx=e(t(),1);var vF=e(t(),1);var tx="/claude-z2xnay0d.svg";var e4="/hermes-pznd63x9.png";var nx="/openai-ep9ht2pq.svg";var t4="/openclaw-a2pyfhpn.svg";var vh=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],oie=new Set(vh);function n4(ot){return oie.has(ot)}var r4={rocket:OL,sparkles:WL,bolt:F0,flame:YO,star:UL,heart:sL,diamond:qO,trophy:qL,target:VL,bulb:DO,brain:MO,robot:_L,wand:ZL,atom:TO,flask:ZO,cpu:jO,code:WO,terminal:GL,api:CO,database:GO,cube:VO,hexagon:aL,plug:NL,tool:KL,bug:NO,activity:xO,chart:LO,briefcase:AO,folder:nL,file:df,book:IO,message:xL,mail:hL,bell:PO,paperclip:K0,key:j0,shield:FL,user:X0,home:cL,globe:iL,world:e5,planet:IL,compass:UO,map:bL,calendar:_O,cloud:$O,sun:jL,moon:SL,snowflake:$L,leaf:dL,mountain:EL,feather:XO,ghost:rL,music:kL,piano:q0,camera:OO,photo:TL,palette:RL,gamepad:KO,gift:oL,cart:HL,chef:BO},o4=vh.map((ot)=>({id:ot,Icon:r4[ot]}));function jf(ot){return ot&&n4(ot)?r4[ot]:null}var iie=(ot,st)=>{if(typeof ot!=="number")return;if(st===3)return{mode:"rgb",r:(ot>>8&15|ot>>4&240)/255,g:(ot>>4&15|ot&240)/255,b:(ot&15|ot<<4&240)/255};if(st===4)return{mode:"rgb",r:(ot>>12&15|ot>>8&240)/255,g:(ot>>8&15|ot>>4&240)/255,b:(ot>>4&15|ot&240)/255,alpha:(ot&15|ot<<4&240)/255};if(st===6)return{mode:"rgb",r:(ot>>16&255)/255,g:(ot>>8&255)/255,b:(ot&255)/255};if(st===8)return{mode:"rgb",r:(ot>>24&255)/255,g:(ot>>16&255)/255,b:(ot>>8&255)/255,alpha:(ot&255)/255}},rx=iie;var sie={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},i4=sie;var aie=(ot)=>rx(i4[ot.toLowerCase()],6),s4=aie;var lie=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,cie=(ot)=>{let st;return(st=ot.match(lie))?rx(parseInt(st[1],16),st[1].length):void 0},a4=cie;var ox="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var Zp="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var xh="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var l4="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var gu="\\s*,\\s*";var N7e=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var uie=new RegExp(`^rgba?\\(\\s*${ox}${gu}${ox}${gu}${ox}\\s*(?:,\\s*${xh}\\s*)?\\)$`),pie=new RegExp(`^rgba?\\(\\s*${Zp}${gu}${Zp}${gu}${Zp}\\s*(?:,\\s*${xh}\\s*)?\\)$`),die=(ot)=>{let st={mode:"rgb"},ct;if(ct=ot.match(uie)){if(ct[1]!==void 0)st.r=ct[1]/255;if(ct[2]!==void 0)st.g=ct[2]/255;if(ct[3]!==void 0)st.b=ct[3]/255}else if(ct=ot.match(pie)){if(ct[1]!==void 0)st.r=ct[1]/100;if(ct[2]!==void 0)st.g=ct[2]/100;if(ct[3]!==void 0)st.b=ct[3]/100}else return;if(ct[4]!==void 0)st.alpha=Math.max(0,Math.min(1,ct[4]/100));else if(ct[5]!==void 0)st.alpha=Math.max(0,Math.min(1,+ct[5]));return st},c4=die;var fie=(ot,st)=>ot===void 0?void 0:typeof ot!=="object"?p4(ot):ot.mode!==void 0?ot:st?{...ot,mode:st}:void 0,u4=fie;var mie=(ot="rgb")=>(st)=>(st=u4(st,ot))!==void 0?st.mode===ot?st:Aa[st.mode][ot]?Aa[st.mode][ot](st):ot==="rgb"?Aa[st.mode].rgb(st):Aa.rgb[ot](Aa[st.mode].rgb(st)):void 0,ix=mie;var Aa={},d4={},wh=[],WR={},gie=(ot)=>ot,ro=(ot)=>{if(Aa[ot.mode]={...Aa[ot.mode],...ot.toMode},Object.keys(ot.fromMode||{}).forEach((st)=>{if(!Aa[st])Aa[st]={};Aa[st][ot.mode]=ot.fromMode[st]}),!ot.ranges)ot.ranges={};if(!ot.difference)ot.difference={};return ot.channels.forEach((st)=>{if(ot.ranges[st]===void 0)ot.ranges[st]=[0,1];if(!ot.interpolate[st])throw Error(`Missing interpolator for: ${st}`);if(typeof ot.interpolate[st]==="function")ot.interpolate[st]={use:ot.interpolate[st]};if(!ot.interpolate[st].fixup)ot.interpolate[st].fixup=gie}),d4[ot.mode]=ot,(ot.parse||[]).forEach((st)=>{hie(st,ot.mode)}),ix(ot.mode)},f4=(ot)=>d4[ot],hie=(ot,st)=>{if(typeof ot==="string"){if(!st)throw Error("'mode' required when 'parser' is a string");WR[ot]=st}else if(typeof ot==="function"){if(wh.indexOf(ot)<0)wh.push(ot)}};var UR=/[^\x00-\x7F]|[a-zA-Z_]/,bie=/[^\x00-\x7F]|[-\w]/,In={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},ar=0;function sx(ot){let st=ot[ar],ct=ot[ar+1];if(st==="-"||st==="+")return/\d/.test(ct)||ct==="."&&/\d/.test(ot[ar+2]);if(st===".")return/\d/.test(ct);return/\d/.test(st)}function jR(ot){if(ar>=ot.length)return!1;let st=ot[ar];if(UR.test(st))return!0;if(st==="-"){if(ot.length-ar<2)return!1;let ct=ot[ar+1];if(ct==="-"||UR.test(ct))return!0;return!1}return!1}var yie={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function Ch(ot){let st="";if(ot[ar]==="-"||ot[ar]==="+")st+=ot[ar++];if(st+=ax(ot),ot[ar]==="."&&/\d/.test(ot[ar+1]))st+=ot[ar++]+ax(ot);if(ot[ar]==="e"||ot[ar]==="E"){if((ot[ar+1]==="-"||ot[ar+1]==="+")&&/\d/.test(ot[ar+2]))st+=ot[ar++]+ot[ar++]+ax(ot);else if(/\d/.test(ot[ar+1]))st+=ot[ar++]+ax(ot)}if(jR(ot)){let ct=lx(ot);if(ct==="deg"||ct==="rad"||ct==="turn"||ct==="grad")return{type:In.Hue,value:st*yie[ct]};return}if(ot[ar]==="%")return ar++,{type:In.Percentage,value:+st};return{type:In.Number,value:+st}}function ax(ot){let st="";while(/\d/.test(ot[ar]))st+=ot[ar++];return st}function lx(ot){let st="";while(ar<ot.length&&bie.test(ot[ar]))st+=ot[ar++];return st}function vie(ot){let st=lx(ot);if(ot[ar]==="(")return ar++,{type:In.Function,value:st};if(st==="none")return{type:In.None,value:void 0};return{type:In.Ident,value:st}}function xie(ot=""){let st=ot.trim(),ct=[],gt;ar=0;while(ar<st.length){if(gt=st[ar++],gt===`
18
+ `||gt==="\t"||gt===" "){while(ar<st.length&&(st[ar]===`
19
+ `||st[ar]==="\t"||st[ar]===" "))ar++;continue}if(gt===",")return;if(gt===")"){ct.push({type:In.ParenClose});continue}if(gt==="+"){if(ar--,sx(st)){ct.push(Ch(st));continue}return}if(gt==="-"){if(ar--,sx(st)){ct.push(Ch(st));continue}if(jR(st)){ct.push({type:In.Ident,value:lx(st)});continue}return}if(gt==="."){if(ar--,sx(st)){ct.push(Ch(st));continue}return}if(gt==="/"){while(ar<st.length&&(st[ar]===`
20
+ `||st[ar]==="\t"||st[ar]===" "))ar++;let bt;if(sx(st)){if(bt=Ch(st),bt.type!==In.Hue){ct.push({type:In.Alpha,value:bt});continue}}if(jR(st)){if(lx(st)==="none"){ct.push({type:In.Alpha,value:{type:In.None,value:void 0}});continue}}return}if(/\d/.test(gt)){ar--,ct.push(Ch(st));continue}if(UR.test(gt)){ar--,ct.push(vie(st));continue}return}return ct}function wie(ot){ot._i=0;let st=ot[ot._i++];if(!st||st.type!==In.Function||st.value!=="color")return;if(st=ot[ot._i++],st.type!==In.Ident)return;let ct=WR[st.value];if(!ct)return;let gt={mode:ct},bt=m4(ot,!1);if(!bt)return;let yt=f4(ct).channels;for(let vt=0,xt,wt;vt<yt.length;vt++)if(xt=bt[vt],wt=yt[vt],xt.type!==In.None){if(gt[wt]=xt.type===In.Number?xt.value:xt.value/100,wt==="alpha")gt[wt]=Math.max(0,Math.min(1,gt[wt]))}return gt}function m4(ot,st){let ct=[],gt;while(ot._i<ot.length){if(gt=ot[ot._i++],gt.type===In.None||gt.type===In.Number||gt.type===In.Alpha||gt.type===In.Percentage||st&&gt.type===In.Hue){ct.push(gt);continue}if(gt.type===In.ParenClose){if(ot._i<ot.length)return;continue}return}if(ct.length<3||ct.length>4)return;if(ct.length===4){if(ct[3].type!==In.Alpha)return;ct[3]=ct[3].value}if(ct.length===3)ct.push({type:In.None,value:void 0});return ct.every((bt)=>bt.type!==In.Alpha)?ct:void 0}function Cie(ot,st){ot._i=0;let ct=ot[ot._i++];if(!ct||ct.type!==In.Function)return;let gt=m4(ot,st);if(!gt)return;return gt.unshift(ct.value),gt}var Sie=(ot)=>{if(typeof ot!=="string")return;let st=xie(ot),ct=st?Cie(st,!0):void 0,gt=void 0,bt=0,yt=wh.length;while(bt<yt)if((gt=wh[bt++](ot,ct))!==void 0)return gt;return st?wie(st):void 0},p4=Sie;function Eie(ot,st){if(!st||st[0]!=="rgb"&&st[0]!=="rgba")return;let ct={mode:"rgb"},[,gt,bt,yt,vt]=st;if(gt.type===In.Hue||bt.type===In.Hue||yt.type===In.Hue)return;if(gt.type!==In.None)ct.r=gt.type===In.Number?gt.value/255:gt.value/100;if(bt.type!==In.None)ct.g=bt.type===In.Number?bt.value/255:bt.value/100;if(yt.type!==In.None)ct.b=yt.type===In.Number?yt.value/255:yt.value/100;if(vt.type!==In.None)ct.alpha=Math.min(1,Math.max(0,vt.type===In.Number?vt.value:vt.value/100));return ct}var g4=Eie;var kie=(ot)=>ot==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,h4=kie;var b4=(ot,st,ct)=>ot+ct*(st-ot);var Rie=(ot)=>{let st=[];for(let ct=0;ct<ot.length-1;ct++){let gt=ot[ct],bt=ot[ct+1];if(gt===void 0&&bt===void 0)st.push(void 0);else if(gt!==void 0&&bt!==void 0)st.push([gt,bt]);else st.push(gt!==void 0?[gt,gt]:[bt,bt])}return st},y4=(ot)=>(st)=>{let ct=Rie(st);return(gt)=>{let bt=gt*ct.length,yt=gt>=1?ct.length-1:Math.max(Math.floor(bt),0),vt=ct[yt];return vt===void 0?void 0:ot(vt[0],vt[1],bt-yt)}};var Nn=y4(b4);var _r=(ot)=>{let st=!1,ct=ot.map((gt)=>{if(gt!==void 0)return st=!0,gt;return 1});return st?ct:ot};var Tie={mode:"rgb",channels:["r","g","b","alpha"],parse:[g4,a4,c4,s4,h4,"srgb"],serialize:"srgb",interpolate:{r:Nn,g:Nn,b:Nn,alpha:{use:Nn,fixup:_r}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},oa=Tie;var VR=(ot=0)=>Math.pow(Math.abs(ot),2.19921875)*Math.sign(ot),Pie=(ot)=>{let st=VR(ot.r),ct=VR(ot.g),gt=VR(ot.b),bt={mode:"xyz65",x:0.5766690429101305*st+0.1855582379065463*ct+0.1882286462349947*gt,y:0.297344975250536*st+0.6273635662554661*ct+0.0752914584939979*gt,z:0.0270313613864123*st+0.0706888525358272*ct+0.9913375368376386*gt};if(ot.alpha!==void 0)bt.alpha=ot.alpha;return bt},GR=Pie;var KR=(ot)=>Math.pow(Math.abs(ot),0.4547069271758437)*Math.sign(ot),Iie=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt={mode:"a98",r:KR(ot*2.0415879038107465-st*0.5650069742788597-0.3447313507783297*ct),g:KR(ot*-0.9692436362808798+st*1.8759675015077206+0.0415550574071756*ct),b:KR(ot*0.0134442806320312-st*0.1183623922310184+1.0151749943912058*ct)};if(gt!==void 0)bt.alpha=gt;return bt},qR=Iie;var QR=(ot=0)=>{let st=Math.abs(ot);if(st<=0.04045)return ot/12.92;return(Math.sign(ot)||1)*Math.pow((st+0.055)/1.055,2.4)},Mie=({r:ot,g:st,b:ct,alpha:gt})=>{let bt={mode:"lrgb",r:QR(ot),g:QR(st),b:QR(ct)};if(gt!==void 0)bt.alpha=gt;return bt},ia=Mie;var Aie=(ot)=>{let{r:st,g:ct,b:gt,alpha:bt}=ia(ot),yt={mode:"xyz65",x:0.4123907992659593*st+0.357584339383878*ct+0.1804807884018343*gt,y:0.2126390058715102*st+0.715168678767756*ct+0.0721923153607337*gt,z:0.0193308187155918*st+0.119194779794626*ct+0.9505321522496607*gt};if(bt!==void 0)yt.alpha=bt;return yt},ds=Aie;var JR=(ot=0)=>{let st=Math.abs(ot);if(st>0.0031308)return(Math.sign(ot)||1)*(1.055*Math.pow(st,0.4166666666666667)-0.055);return ot*12.92},Nie=({r:ot,g:st,b:ct,alpha:gt},bt="rgb")=>{let yt={mode:bt,r:JR(ot),g:JR(st),b:JR(ct)};if(gt!==void 0)yt.alpha=gt;return yt},sa=Nie;var Die=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=sa({r:ot*3.2409699419045226-st*1.537383177570094-0.4986107602930034*ct,g:ot*-0.9692436362808796+st*1.8759675015077204+0.0415550574071756*ct,b:ot*0.0556300796969936-st*0.2039769588889765+1.0569715142428784*ct});if(gt!==void 0)bt.alpha=gt;return bt},fs=Die;var _ie={...oa,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:(ot)=>qR(ds(ot)),xyz65:qR},toMode:{rgb:(ot)=>fs(GR(ot)),xyz65:GR}},v4=_ie;var Oie=(ot)=>(ot=ot%360)<0?ot+360:ot,fo=Oie;var Lie=(ot,st)=>ot.map((ct,gt,bt)=>{if(ct===void 0)return ct;let yt=fo(ct);if(gt===0||ot[gt-1]===void 0)return yt;return st(yt-fo(bt[gt-1]))}).reduce((ct,gt)=>{if(!ct.length||gt===void 0||ct[ct.length-1]===void 0)return ct.push(gt),ct;return ct.push(gt+ct[ct.length-1]),ct},[]),hi=(ot)=>Lie(ot,(st)=>Math.abs(st)<=180?st:st-360*Math.sign(st));var Zo=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],x4=Math.PI/180,w4=180/Math.PI;var C4=Zo[3]*Zo[4],S4=Zo[1]*Zo[4],E4=Zo[1]*Zo[2]-Zo[0]*Zo[3],Bie=({r:ot,g:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=(E4*ct+ot*C4-st*S4)/(E4+C4-S4),yt=ct-bt,vt=(Zo[4]*(st-bt)-Zo[2]*yt)/Zo[3],xt={mode:"cubehelix",l:bt,s:bt===0||bt===1?void 0:Math.sqrt(yt*yt+vt*vt)/(Zo[4]*bt*(1-bt))};if(xt.s)xt.h=Math.atan2(vt,yt)*w4-120;if(gt!==void 0)xt.alpha=gt;return xt},k4=Bie;var Fie=({h:ot,s:st,l:ct,alpha:gt})=>{let bt={mode:"rgb"};if(ot=(ot===void 0?0:ot+120)*x4,ct===void 0)ct=0;let yt=st===void 0?0:st*ct*(1-ct),vt=Math.cos(ot),xt=Math.sin(ot);if(bt.r=ct+yt*(Zo[0]*vt+Zo[1]*xt),bt.g=ct+yt*(Zo[2]*vt+Zo[3]*xt),bt.b=ct+yt*(Zo[4]*vt+Zo[5]*xt),gt!==void 0)bt.alpha=gt;return bt},R4=Fie;var hu=(ot,st)=>{if(ot.h===void 0||st.h===void 0||!ot.s||!st.s)return 0;let ct=fo(ot.h),gt=fo(st.h),bt=Math.sin((gt-ct+360)/2*Math.PI/180);return 2*Math.sqrt(ot.s*st.s)*bt},T4=(ot,st)=>{if(ot.h===void 0||st.h===void 0)return 0;let ct=fo(ot.h),gt=fo(st.h);if(Math.abs(gt-ct)>180)return ct-(gt-360*Math.sign(gt-ct));return gt-ct},bu=(ot,st)=>{if(ot.h===void 0||st.h===void 0||!ot.c||!st.c)return 0;let ct=fo(ot.h),gt=fo(st.h),bt=Math.sin((gt-ct+360)/2*Math.PI/180);return 2*Math.sqrt(ot.c*st.c)*bt};var bi=(ot)=>{let st=ot.reduce((gt,bt)=>{if(bt!==void 0){let yt=bt*Math.PI/180;gt.sin+=Math.sin(yt),gt.cos+=Math.cos(yt)}return gt},{sin:0,cos:0}),ct=Math.atan2(st.sin,st.cos)*180/Math.PI;return ct<0?360+ct:ct};var Hie={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:k4},toMode:{rgb:R4},interpolate:{h:{use:Nn,fixup:hi},s:Nn,l:Nn,alpha:{use:Nn,fixup:_r}},difference:{h:hu},average:{h:bi}},P4=Hie;var zie=({l:ot,a:st,b:ct,alpha:gt},bt="lch")=>{if(st===void 0)st=0;if(ct===void 0)ct=0;let yt=Math.sqrt(st*st+ct*ct),vt={mode:bt,l:ot,c:yt};if(yt)vt.h=fo(Math.atan2(ct,st)*180/Math.PI);if(gt!==void 0)vt.alpha=gt;return vt},Ns=zie;var $ie=({l:ot,c:st,h:ct,alpha:gt},bt="lab")=>{if(ct===void 0)ct=0;let yt={mode:bt,l:ot,a:st?st*Math.cos(ct/180*Math.PI):0,b:st?st*Math.sin(ct/180*Math.PI):0};if(gt!==void 0)yt.alpha=gt;return yt},Ds=$ie;var cx=Math.pow(29,3)/Math.pow(3,3),ux=Math.pow(6,3)/Math.pow(29,3);var Io={X:0.9642956764295677,Y:1,Z:0.8251046025104602},yu={X:0.9504559270516716,Y:1,Z:1.0890577507598784},V$e=Math.pow(29,3)/Math.pow(3,3),G$e=Math.pow(6,3)/Math.pow(29,3);var XR=(ot)=>Math.pow(ot,3)>ux?Math.pow(ot,3):(116*ot-16)/cx,Wie=({l:ot,a:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=(ot+16)/116,yt=st/500+bt,vt=bt-ct/200,xt={mode:"xyz65",x:XR(yt)*yu.X,y:XR(bt)*yu.Y,z:XR(vt)*yu.Z};if(gt!==void 0)xt.alpha=gt;return xt},px=Wie;var Uie=(ot)=>fs(px(ot)),vu=Uie;var YR=(ot)=>ot>ux?Math.cbrt(ot):(cx*ot+16)/116,jie=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=YR(ot/yu.X),yt=YR(st/yu.Y),vt=YR(ct/yu.Z),xt={mode:"lab65",l:116*yt-16,a:500*(bt-yt),b:200*(yt-vt)};if(gt!==void 0)xt.alpha=gt;return xt},dx=jie;var Vie=(ot)=>{let st=dx(ds(ot));if(ot.r===ot.b&&ot.b===ot.g)st.a=st.b=0;return st},xu=Vie;var Vf=1,fx=1,ed=0.14444444444444443*Math.PI,Gf=Math.cos(ed),Kf=Math.sin(ed),mx=100/Math.log(1.39);var Gie=({l:ot,c:st,h:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt={mode:"lab65",l:(Math.exp(ot*Vf/mx)-1)/0.0039},yt=(Math.exp(0.0435*st*fx*Vf)-1)/0.075,vt=yt*Math.cos(ct/180*Math.PI-ed),xt=yt*Math.sin(ct/180*Math.PI-ed);if(bt.a=vt*Gf-xt/0.83*Kf,bt.b=vt*Kf+xt/0.83*Gf,gt!==void 0)bt.alpha=gt;return bt},Sh=Gie;var Kie=({l:ot,a:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=st*Gf+ct*Kf,yt=0.83*(ct*Gf-st*Kf),vt=Math.sqrt(bt*bt+yt*yt),xt={mode:"dlch",l:mx/Vf*Math.log(1+0.0039*ot),c:Math.log(1+0.075*vt)/(0.0435*fx*Vf)};if(xt.c)xt.h=fo((Math.atan2(yt,bt)+ed)/Math.PI*180);if(gt!==void 0)xt.alpha=gt;return xt},Eh=Kie;var I4=(ot)=>Sh(Ns(ot,"dlch")),M4=(ot)=>Ds(Eh(ot),"dlab"),qie={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:I4,rgb:(ot)=>vu(I4(ot))},fromMode:{lab65:M4,rgb:(ot)=>M4(xu(ot))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Nn,a:Nn,b:Nn,alpha:{use:Nn,fixup:_r}}},A4=qie;var Qie={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Sh,dlab:(ot)=>Ds(ot,"dlab"),rgb:(ot)=>vu(Sh(ot))},fromMode:{lab65:Eh,dlab:(ot)=>Ns(ot,"dlch"),rgb:(ot)=>Eh(xu(ot))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Nn,c:Nn,h:{use:Nn,fixup:hi},alpha:{use:Nn,fixup:_r}},difference:{h:bu},average:{h:bi}},N4=Qie;function ZR({h:ot,s:st,i:ct,alpha:gt}){if(ot=fo(ot!==void 0?ot:0),st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.abs(ot/60%2-1),yt;switch(Math.floor(ot/60)){case 0:yt={r:ct*(1+st*(3/(2-bt)-1)),g:ct*(1+st*(3*(1-bt)/(2-bt)-1)),b:ct*(1-st)};break;case 1:yt={r:ct*(1+st*(3*(1-bt)/(2-bt)-1)),g:ct*(1+st*(3/(2-bt)-1)),b:ct*(1-st)};break;case 2:yt={r:ct*(1-st),g:ct*(1+st*(3/(2-bt)-1)),b:ct*(1+st*(3*(1-bt)/(2-bt)-1))};break;case 3:yt={r:ct*(1-st),g:ct*(1+st*(3*(1-bt)/(2-bt)-1)),b:ct*(1+st*(3/(2-bt)-1))};break;case 4:yt={r:ct*(1+st*(3*(1-bt)/(2-bt)-1)),g:ct*(1-st),b:ct*(1+st*(3/(2-bt)-1))};break;case 5:yt={r:ct*(1+st*(3/(2-bt)-1)),g:ct*(1-st),b:ct*(1+st*(3*(1-bt)/(2-bt)-1))};break;default:yt={r:ct*(1-st),g:ct*(1-st),b:ct*(1-st)}}if(yt.mode="rgb",gt!==void 0)yt.alpha=gt;return yt}function eT({r:ot,g:st,b:ct,alpha:gt}){if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.max(ot,st,ct),yt=Math.min(ot,st,ct),vt={mode:"hsi",s:ot+st+ct===0?0:1-3*yt/(ot+st+ct),i:(ot+st+ct)/3};if(bt-yt!==0)vt.h=(bt===ot?(st-ct)/(bt-yt)+(st<ct)*6:bt===st?(ct-ot)/(bt-yt)+2:(ot-st)/(bt-yt)+4)*60;if(gt!==void 0)vt.alpha=gt;return vt}var Jie={mode:"hsi",toMode:{rgb:ZR},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:eT},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:Nn,fixup:hi},s:Nn,i:Nn,alpha:{use:Nn,fixup:_r}},difference:{h:hu},average:{h:bi}},D4=Jie;function tT({h:ot,s:st,l:ct,alpha:gt}){if(ot=fo(ot!==void 0?ot:0),st===void 0)st=0;if(ct===void 0)ct=0;let bt=ct+st*(ct<0.5?ct:1-ct),yt=bt-(bt-ct)*2*Math.abs(ot/60%2-1),vt;switch(Math.floor(ot/60)){case 0:vt={r:bt,g:yt,b:2*ct-bt};break;case 1:vt={r:yt,g:bt,b:2*ct-bt};break;case 2:vt={r:2*ct-bt,g:bt,b:yt};break;case 3:vt={r:2*ct-bt,g:yt,b:bt};break;case 4:vt={r:yt,g:2*ct-bt,b:bt};break;case 5:vt={r:bt,g:2*ct-bt,b:yt};break;default:vt={r:2*ct-bt,g:2*ct-bt,b:2*ct-bt}}if(vt.mode="rgb",gt!==void 0)vt.alpha=gt;return vt}function nT({r:ot,g:st,b:ct,alpha:gt}){if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.max(ot,st,ct),yt=Math.min(ot,st,ct),vt={mode:"hsl",s:bt===yt?0:(bt-yt)/(1-Math.abs(bt+yt-1)),l:0.5*(bt+yt)};if(bt-yt!==0)vt.h=(bt===ot?(st-ct)/(bt-yt)+(st<ct)*6:bt===st?(ct-ot)/(bt-yt)+2:(ot-st)/(bt-yt)+4)*60;if(gt!==void 0)vt.alpha=gt;return vt}var Xie=(ot,st)=>{switch(st){case"deg":return+ot;case"rad":return ot/Math.PI*180;case"grad":return ot/10*9;case"turn":return ot*360}},_4=Xie;var Yie=new RegExp(`^hsla?\\(\\s*${l4}${gu}${Zp}${gu}${Zp}\\s*(?:,\\s*${xh}\\s*)?\\)$`),Zie=(ot)=>{let st=ot.match(Yie);if(!st)return;let ct={mode:"hsl"};if(st[3]!==void 0)ct.h=+st[3];else if(st[1]!==void 0&&st[2]!==void 0)ct.h=_4(st[1],st[2]);if(st[4]!==void 0)ct.s=Math.min(Math.max(0,st[4]/100),1);if(st[5]!==void 0)ct.l=Math.min(Math.max(0,st[5]/100),1);if(st[6]!==void 0)ct.alpha=Math.max(0,Math.min(1,st[6]/100));else if(st[7]!==void 0)ct.alpha=Math.max(0,Math.min(1,+st[7]));return ct},O4=Zie;function ese(ot,st){if(!st||st[0]!=="hsl"&&st[0]!=="hsla")return;let ct={mode:"hsl"},[,gt,bt,yt,vt]=st;if(gt.type!==In.None){if(gt.type===In.Percentage)return;ct.h=gt.value}if(bt.type!==In.None){if(bt.type===In.Hue)return;ct.s=bt.value/100}if(yt.type!==In.None){if(yt.type===In.Hue)return;ct.l=yt.value/100}if(vt.type!==In.None)ct.alpha=Math.min(1,Math.max(0,vt.type===In.Number?vt.value:vt.value/100));return ct}var L4=ese;var tse={mode:"hsl",toMode:{rgb:tT},fromMode:{rgb:nT},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[L4,O4],serialize:(ot)=>`hsl(${ot.h!==void 0?ot.h:"none"} ${ot.s!==void 0?ot.s*100+"%":"none"} ${ot.l!==void 0?ot.l*100+"%":"none"}${ot.alpha<1?` / ${ot.alpha}`:""})`,interpolate:{h:{use:Nn,fixup:hi},s:Nn,l:Nn,alpha:{use:Nn,fixup:_r}},difference:{h:hu},average:{h:bi}},gx=tse;function kh({h:ot,s:st,v:ct,alpha:gt}){if(ot=fo(ot!==void 0?ot:0),st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.abs(ot/60%2-1),yt;switch(Math.floor(ot/60)){case 0:yt={r:ct,g:ct*(1-st*bt),b:ct*(1-st)};break;case 1:yt={r:ct*(1-st*bt),g:ct,b:ct*(1-st)};break;case 2:yt={r:ct*(1-st),g:ct,b:ct*(1-st*bt)};break;case 3:yt={r:ct*(1-st),g:ct*(1-st*bt),b:ct};break;case 4:yt={r:ct*(1-st*bt),g:ct*(1-st),b:ct};break;case 5:yt={r:ct,g:ct*(1-st),b:ct*(1-st*bt)};break;default:yt={r:ct*(1-st),g:ct*(1-st),b:ct*(1-st)}}if(yt.mode="rgb",gt!==void 0)yt.alpha=gt;return yt}function Rh({r:ot,g:st,b:ct,alpha:gt}){if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.max(ot,st,ct),yt=Math.min(ot,st,ct),vt={mode:"hsv",s:bt===0?0:1-yt/bt,v:bt};if(bt-yt!==0)vt.h=(bt===ot?(st-ct)/(bt-yt)+(st<ct)*6:bt===st?(ct-ot)/(bt-yt)+2:(ot-st)/(bt-yt)+4)*60;if(gt!==void 0)vt.alpha=gt;return vt}var nse={mode:"hsv",toMode:{rgb:kh},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:Rh},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:Nn,fixup:hi},s:Nn,v:Nn,alpha:{use:Nn,fixup:_r}},difference:{h:hu},average:{h:bi}},hx=nse;function rT({h:ot,w:st,b:ct,alpha:gt}){if(st===void 0)st=0;if(ct===void 0)ct=0;if(st+ct>1){let bt=st+ct;st/=bt,ct/=bt}return kh({h:ot,s:ct===1?1:1-st/(1-ct),v:1-ct,alpha:gt})}function oT(ot){let st=Rh(ot);if(st===void 0)return;let ct=st.s!==void 0?st.s:0,gt=st.v!==void 0?st.v:0,bt={mode:"hwb",w:(1-ct)*gt,b:1-gt};if(st.h!==void 0)bt.h=st.h;if(st.alpha!==void 0)bt.alpha=st.alpha;return bt}function rse(ot,st){if(!st||st[0]!=="hwb")return;let ct={mode:"hwb"},[,gt,bt,yt,vt]=st;if(gt.type!==In.None){if(gt.type===In.Percentage)return;ct.h=gt.value}if(bt.type!==In.None){if(bt.type===In.Hue)return;ct.w=bt.value/100}if(yt.type!==In.None){if(yt.type===In.Hue)return;ct.b=yt.value/100}if(vt.type!==In.None)ct.alpha=Math.min(1,Math.max(0,vt.type===In.Number?vt.value:vt.value/100));return ct}var B4=rse;var ose={mode:"hwb",toMode:{rgb:rT},fromMode:{rgb:oT},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[B4],serialize:(ot)=>`hwb(${ot.h!==void 0?ot.h:"none"} ${ot.w!==void 0?ot.w*100+"%":"none"} ${ot.b!==void 0?ot.b*100+"%":"none"}${ot.alpha<1?` / ${ot.alpha}`:""})`,interpolate:{h:{use:Nn,fixup:hi},w:Nn,b:Nn,alpha:{use:Nn,fixup:_r}},difference:{h:T4},average:{h:bi}},F4=ose;var bx=203;var yx=0.1593017578125;var vx=0.8359375,xx=18.8515625,wx=18.6875;function Cx(ot){if(ot<0)return 0;let st=Math.pow(ot,0.012683313515655966);return 1e4*Math.pow(Math.max(0,st-0.8359375)/(18.8515625-18.6875*st),6.277394636015326)}function Sx(ot){if(ot<0)return 0;let st=Math.pow(ot/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*st)/(1+18.6875*st),78.84375)}var iT=(ot)=>Math.max(ot/bx,0),ise=({i:ot,t:st,p:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Cx(ot+0.008609037037932761*st+0.11102962500302593*ct),yt=Cx(ot-0.00860903703793275*st-0.11102962500302599*ct),vt=Cx(ot+0.5600313357106791*st-0.32062717498731885*ct),xt={mode:"xyz65",x:iT(2.070152218389422*bt-1.3263473389671556*yt+0.2066510476294051*vt),y:iT(0.3647385209748074*bt+0.680566024947227*yt-0.0453045459220346*vt),z:iT(-0.049747207535812*bt-0.0492609666966138*yt+1.1880659249923042*vt)};if(gt!==void 0)xt.alpha=gt;return xt},sT=ise;var aT=(ot=0)=>Math.max(ot*bx,0),sse=({x:ot,y:st,z:ct,alpha:gt})=>{let bt=aT(ot),yt=aT(st),vt=aT(ct),xt=Sx(0.3592832590121217*bt+0.6976051147779502*yt-0.0358915932320289*vt),wt=Sx(-0.1920808463704995*bt+1.1004767970374323*yt+0.0753748658519118*vt),Ct=Sx(0.0070797844607477*bt+0.0748396662186366*yt+0.8433265453898765*vt),St=0.5*xt+0.5*wt,Et=1.61376953125*xt-3.323486328125*wt+1.709716796875*Ct,kt=4.378173828125*xt-4.24560546875*wt-0.132568359375*Ct,Rt={mode:"itp",i:St,t:Et,p:kt};if(gt!==void 0)Rt.alpha=gt;return Rt},lT=sse;var ase={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:sT,rgb:(ot)=>fs(sT(ot))},fromMode:{xyz65:lT,rgb:(ot)=>lT(ds(ot))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:Nn,t:Nn,p:Nn,alpha:{use:Nn,fixup:_r}}},H4=ase;var lse=134.03437499999998,cse=0.000000000016295499532821565,cT=(ot)=>{if(ot<0)return 0;let st=Math.pow(ot/1e4,yx);return Math.pow((vx+xx*st)/(1+wx*st),lse)},uT=(ot=0)=>Math.max(ot*203,0),use=({x:ot,y:st,z:ct,alpha:gt})=>{ot=uT(ot),st=uT(st),ct=uT(ct);let bt=1.15*ot-0.15*ct,yt=0.66*st+0.34*ot,vt=cT(0.41478972*bt+0.579999*yt+0.014648*ct),xt=cT(-0.20151*bt+1.120649*yt+0.0531008*ct),wt=cT(-0.0166008*bt+0.2648*yt+0.6684799*ct),Ct=(vt+xt)/2,St={mode:"jab",j:0.44*Ct/(1-0.56*Ct)-cse,a:3.524*vt-4.066708*xt+0.542708*wt,b:0.199076*vt+1.096799*xt-1.295875*wt};if(gt!==void 0)St.alpha=gt;return St},Ex=use;var pse=134.03437499999998,z4=0.000000000016295499532821565,pT=(ot)=>{if(ot<0)return 0;let st=Math.pow(ot,1/pse);return 1e4*Math.pow((vx-st)/(wx*st-xx),1/yx)},dT=(ot)=>ot/203,dse=({j:ot,a:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=(ot+z4)/(0.44+0.56*(ot+z4)),yt=pT(bt+0.13860504*st+0.058047316*ct),vt=pT(bt-0.13860504*st-0.058047316*ct),xt=pT(bt-0.096019242*st-0.8118919*ct),wt={mode:"xyz65",x:dT(1.661373024652174*yt-0.914523081304348*vt+0.23136208173913045*xt),y:dT(-0.3250758611844533*yt+1.571847026732543*vt-0.21825383453227928*xt),z:dT(-0.090982811*yt-0.31272829*vt+1.5227666*xt)};if(gt!==void 0)wt.alpha=gt;return wt},kx=dse;var fse=(ot)=>{let st=Ex(ds(ot));if(ot.r===ot.b&&ot.b===ot.g)st.a=st.b=0;return st},Rx=fse;var mse=(ot)=>fs(kx(ot)),Tx=mse;var gse={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:Rx,xyz65:Ex},toMode:{rgb:Tx,xyz65:kx},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:Nn,a:Nn,b:Nn,alpha:{use:Nn,fixup:_r}}},$4=gse;var hse=({j:ot,a:st,b:ct,alpha:gt})=>{if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.sqrt(st*st+ct*ct),yt={mode:"jch",j:ot,c:bt};if(bt)yt.h=fo(Math.atan2(ct,st)*180/Math.PI);if(gt!==void 0)yt.alpha=gt;return yt},fT=hse;var bse=({j:ot,c:st,h:ct,alpha:gt})=>{if(ct===void 0)ct=0;let bt={mode:"jab",j:ot,a:st?st*Math.cos(ct/180*Math.PI):0,b:st?st*Math.sin(ct/180*Math.PI):0};if(gt!==void 0)bt.alpha=gt;return bt},mT=bse;var yse={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:mT,rgb:(ot)=>Tx(mT(ot))},fromMode:{rgb:(ot)=>fT(Rx(ot)),jab:fT},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:Nn,fixup:hi},c:Nn,j:Nn,alpha:{use:Nn,fixup:_r}},difference:{h:bu},average:{h:bi}},W4=yse;var wu=Math.pow(29,3)/Math.pow(3,3),qf=Math.pow(6,3)/Math.pow(29,3);var gT=(ot)=>Math.pow(ot,3)>qf?Math.pow(ot,3):(116*ot-16)/wu,vse=({l:ot,a:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=(ot+16)/116,yt=st/500+bt,vt=bt-ct/200,xt={mode:"xyz50",x:gT(yt)*Io.X,y:gT(bt)*Io.Y,z:gT(vt)*Io.Z};if(gt!==void 0)xt.alpha=gt;return xt},Qf=vse;var xse=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=sa({r:ot*3.1341359569958707-st*1.6173863321612538-0.4906619460083532*ct,g:ot*-0.978795502912089+st*1.916254567259524+0.03344273116131949*ct,b:ot*0.07195537988411677-st*0.2289768264158322+1.405386058324125*ct});if(gt!==void 0)bt.alpha=gt;return bt},ml=xse;var wse=(ot)=>ml(Qf(ot)),Px=wse;var Cse=(ot)=>{let{r:st,g:ct,b:gt,alpha:bt}=ia(ot),yt={mode:"xyz50",x:0.436065742824811*st+0.3851514688337912*ct+0.14307845442264197*gt,y:0.22249319175623702*st+0.7168870538238823*ct+0.06061979053616537*gt,z:0.013923904500943465*st+0.09708128566574634*ct+0.7140993584005155*gt};if(bt!==void 0)yt.alpha=bt;return yt},gl=Cse;var hT=(ot)=>ot>qf?Math.cbrt(ot):(wu*ot+16)/116,Sse=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=hT(ot/Io.X),yt=hT(st/Io.Y),vt=hT(ct/Io.Z),xt={mode:"lab",l:116*yt-16,a:500*(bt-yt),b:200*(yt-vt)};if(gt!==void 0)xt.alpha=gt;return xt},Jf=Sse;var Ese=(ot)=>{let st=Jf(gl(ot));if(ot.r===ot.b&&ot.b===ot.g)st.a=st.b=0;return st},Ix=Ese;function kse(ot,st){if(!st||st[0]!=="lab")return;let ct={mode:"lab"},[,gt,bt,yt,vt]=st;if(gt.type===In.Hue||bt.type===In.Hue||yt.type===In.Hue)return;if(gt.type!==In.None)ct.l=Math.min(Math.max(0,gt.value),100);if(bt.type!==In.None)ct.a=bt.type===In.Number?bt.value:bt.value*125/100;if(yt.type!==In.None)ct.b=yt.type===In.Number?yt.value:yt.value*125/100;if(vt.type!==In.None)ct.alpha=Math.min(1,Math.max(0,vt.type===In.Number?vt.value:vt.value/100));return ct}var U4=kse;var Rse={mode:"lab",toMode:{xyz50:Qf,rgb:Px},fromMode:{xyz50:Jf,rgb:Ix},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[U4],serialize:(ot)=>`lab(${ot.l!==void 0?ot.l:"none"} ${ot.a!==void 0?ot.a:"none"} ${ot.b!==void 0?ot.b:"none"}${ot.alpha<1?` / ${ot.alpha}`:""})`,interpolate:{l:Nn,a:Nn,b:Nn,alpha:{use:Nn,fixup:_r}}},Xf=Rse;var Tse={...Xf,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:px,rgb:vu},fromMode:{xyz65:dx,rgb:xu},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},j4=Tse;function Pse(ot,st){if(!st||st[0]!=="lch")return;let ct={mode:"lch"},[,gt,bt,yt,vt]=st;if(gt.type!==In.None){if(gt.type===In.Hue)return;ct.l=Math.min(Math.max(0,gt.value),100)}if(bt.type!==In.None)ct.c=Math.max(0,bt.type===In.Number?bt.value:bt.value*150/100);if(yt.type!==In.None){if(yt.type===In.Percentage)return;ct.h=yt.value}if(vt.type!==In.None)ct.alpha=Math.min(1,Math.max(0,vt.type===In.Number?vt.value:vt.value/100));return ct}var V4=Pse;var Ise={mode:"lch",toMode:{lab:Ds,rgb:(ot)=>Px(Ds(ot))},fromMode:{rgb:(ot)=>Ns(Ix(ot)),lab:Ns},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[V4],serialize:(ot)=>`lch(${ot.l!==void 0?ot.l:"none"} ${ot.c!==void 0?ot.c:"none"} ${ot.h!==void 0?ot.h:"none"}${ot.alpha<1?` / ${ot.alpha}`:""})`,interpolate:{h:{use:Nn,fixup:hi},c:Nn,l:Nn,alpha:{use:Nn,fixup:_r}},difference:{h:bu},average:{h:bi}},Yf=Ise;var Mse={...Yf,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:(ot)=>Ds(ot,"lab65"),rgb:(ot)=>vu(Ds(ot,"lab65"))},fromMode:{rgb:(ot)=>Ns(xu(ot),"lch65"),lab65:(ot)=>Ns(ot,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},G4=Mse;var Ase=({l:ot,u:st,v:ct,alpha:gt})=>{if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.sqrt(st*st+ct*ct),yt={mode:"lchuv",l:ot,c:bt};if(bt)yt.h=fo(Math.atan2(ct,st)*180/Math.PI);if(gt!==void 0)yt.alpha=gt;return yt},bT=Ase;var Nse=({l:ot,c:st,h:ct,alpha:gt})=>{if(ct===void 0)ct=0;let bt={mode:"luv",l:ot,u:st?st*Math.cos(ct/180*Math.PI):0,v:st?st*Math.sin(ct/180*Math.PI):0};if(gt!==void 0)bt.alpha=gt;return bt},yT=Nse;var K4=(ot,st,ct)=>4*ot/(ot+15*st+3*ct),q4=(ot,st,ct)=>9*st/(ot+15*st+3*ct),Dse=K4(Io.X,Io.Y,Io.Z),_se=q4(Io.X,Io.Y,Io.Z),Ose=(ot)=>ot<=qf?wu*ot:116*Math.cbrt(ot)-16,Lse=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Ose(st/Io.Y),yt=K4(ot,st,ct),vt=q4(ot,st,ct);if(!isFinite(yt)||!isFinite(vt))bt=yt=vt=0;else yt=13*bt*(yt-Dse),vt=13*bt*(vt-_se);let xt={mode:"luv",l:bt,u:yt,v:vt};if(gt!==void 0)xt.alpha=gt;return xt},Th=Lse;var Bse=(ot,st,ct)=>4*ot/(ot+15*st+3*ct),Fse=(ot,st,ct)=>9*st/(ot+15*st+3*ct),Hse=Bse(Io.X,Io.Y,Io.Z),zse=Fse(Io.X,Io.Y,Io.Z),$se=({l:ot,u:st,v:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(ot===0)return{mode:"xyz50",x:0,y:0,z:0};if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=st/(13*ot)+Hse,yt=ct/(13*ot)+zse,vt=Io.Y*(ot<=8?ot/wu:Math.pow((ot+16)/116,3)),xt=vt*(9*bt)/(4*yt),wt=vt*(12-3*bt-20*yt)/(4*yt),Ct={mode:"xyz50",x:xt,y:vt,z:wt};if(gt!==void 0)Ct.alpha=gt;return Ct},Ph=$se;var Wse=(ot)=>bT(Th(gl(ot))),Use=(ot)=>ml(Ph(yT(ot))),jse={mode:"lchuv",toMode:{luv:yT,rgb:Use},fromMode:{rgb:Wse,luv:bT},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Nn,fixup:hi},c:Nn,l:Nn,alpha:{use:Nn,fixup:_r}},difference:{h:bu},average:{h:bi}},Q4=jse;var Vse={...oa,mode:"lrgb",toMode:{rgb:sa},fromMode:{rgb:ia},parse:["srgb-linear"],serialize:"srgb-linear"},J4=Vse;var Gse={mode:"luv",toMode:{xyz50:Ph,rgb:(ot)=>ml(Ph(ot))},fromMode:{xyz50:Th,rgb:(ot)=>Th(gl(ot))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:Nn,u:Nn,v:Nn,alpha:{use:Nn,fixup:_r}}},X4=Gse;var Kse=({r:ot,g:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.cbrt(0.412221469470763*ot+0.5363325372617348*st+0.0514459932675022*ct),yt=Math.cbrt(0.2119034958178252*ot+0.6806995506452344*st+0.1073969535369406*ct),vt=Math.cbrt(0.0883024591900564*ot+0.2817188391361215*st+0.6299787016738222*ct),xt={mode:"oklab",l:0.210454268309314*bt+0.7936177747023054*yt-0.0040720430116193*vt,a:1.9779985324311684*bt-2.42859224204858*yt+0.450593709617411*vt,b:0.0259040424655478*bt+0.7827717124575296*yt-0.8086757549230774*vt};if(gt!==void 0)xt.alpha=gt;return xt},Mx=Kse;var qse=(ot)=>{let st=Mx(ia(ot));if(ot.r===ot.b&&ot.b===ot.g)st.a=st.b=0;return st},Cu=qse;var Qse=({l:ot,a:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=Math.pow(ot+0.3963377773761749*st+0.2158037573099136*ct,3),yt=Math.pow(ot-0.1055613458156586*st-0.0638541728258133*ct,3),vt=Math.pow(ot-0.0894841775298119*st-1.2914855480194092*ct,3),xt={mode:"lrgb",r:4.076741636075957*bt-3.3077115392580616*yt+0.2309699031821044*vt,g:-1.2684379732850317*bt+2.6097573492876887*yt-0.3413193760026573*vt,b:-0.0041960761386756*bt-0.7034186179359362*yt+1.7076146940746117*vt};if(gt!==void 0)xt.alpha=gt;return xt},hl=Qse;var Jse=(ot)=>sa(hl(ot)),Su=Jse;function Ih(ot){return 0.5*(1.170873786407767*ot-0.206+Math.sqrt((1.170873786407767*ot-0.206)*(1.170873786407767*ot-0.206)+0.14050485436893204*ot))}function td(ot){return(ot*ot+0.206*ot)/(1.170873786407767*(ot+0.03))}function Xse(ot,st){let ct,gt,bt,yt,vt,xt,wt,Ct;if(-1.88170328*ot-0.80936493*st>1)ct=1.19086277,gt=1.76576728,bt=0.59662641,yt=0.75515197,vt=0.56771245,xt=4.0767416621,wt=-3.3077115913,Ct=0.2309699292;else if(1.81444104*ot-1.19445276*st>1)ct=0.73956515,gt=-0.45954404,bt=0.08285427,yt=0.1254107,vt=0.14503204,xt=-1.2684380046,wt=2.6097574011,Ct=-0.3413193965;else ct=1.35733652,gt=-0.00915799,bt=-1.1513021,yt=-0.50559606,vt=0.00692167,xt=-0.0041960863,wt=-0.7034186147,Ct=1.707614701;let St=ct+gt*ot+bt*st+yt*ot*ot+vt*ot*st,Et=0.3963377774*ot+0.2158037573*st,kt=-0.1055613458*ot-0.0638541728*st,Rt=-0.0894841775*ot-1.291485548*st;{let Tt=1+St*Et,Pt=1+St*kt,Mt=1+St*Rt,It=Tt*Tt*Tt,At=Pt*Pt*Pt,Nt=Mt*Mt*Mt,Ot=3*Et*Tt*Tt,Dt=3*kt*Pt*Pt,_t=3*Rt*Mt*Mt,$t=6*Et*Et*Tt,Ft=6*kt*kt*Pt,Bt=6*Rt*Rt*Mt,Lt=xt*It+wt*At+Ct*Nt,Vt=xt*Ot+wt*Dt+Ct*_t,Wt=xt*$t+wt*Ft+Ct*Bt;St=St-Lt*Vt/(Vt*Vt-0.5*Lt*Wt)}return St}function vT(ot,st){let ct=Xse(ot,st),gt=hl({l:1,a:ct*ot,b:ct*st}),bt=Math.cbrt(1/Math.max(gt.r,gt.g,gt.b)),yt=bt*ct;return[bt,yt]}function Yse(ot,st,ct,gt,bt,yt=null){if(!yt)yt=vT(ot,st);let vt;if((ct-bt)*yt[1]-(yt[0]-bt)*gt<=0)vt=yt[1]*bt/(gt*yt[0]+yt[1]*(bt-ct));else{vt=yt[1]*(bt-1)/(gt*(yt[0]-1)+yt[1]*(bt-ct));{let xt=ct-bt,wt=gt,Ct=0.3963377774*ot+0.2158037573*st,St=-0.1055613458*ot-0.0638541728*st,Et=-0.0894841775*ot-1.291485548*st,kt=xt+wt*Ct,Rt=xt+wt*St,Tt=xt+wt*Et;{let Pt=bt*(1-vt)+vt*ct,Mt=vt*gt,It=Pt+Mt*Ct,At=Pt+Mt*St,Nt=Pt+Mt*Et,Ot=It*It*It,Dt=At*At*At,_t=Nt*Nt*Nt,$t=3*kt*It*It,Ft=3*Rt*At*At,Bt=3*Tt*Nt*Nt,Lt=6*kt*kt*It,Vt=6*Rt*Rt*At,Wt=6*Tt*Tt*Nt,Ut=4.0767416621*Ot-3.3077115913*Dt+0.2309699292*_t-1,Ht=4.0767416621*$t-3.3077115913*Ft+0.2309699292*Bt,Gt=4.0767416621*Lt-3.3077115913*Vt+0.2309699292*Wt,jt=Ht/(Ht*Ht-0.5*Ut*Gt),qt=-Ut*jt,Qt=-1.2684380046*Ot+2.6097574011*Dt-0.3413193965*_t-1,Xt=-1.2684380046*$t+2.6097574011*Ft-0.3413193965*Bt,zt=-1.2684380046*Lt+2.6097574011*Vt-0.3413193965*Wt,tn=Xt/(Xt*Xt-0.5*Qt*zt),rn=-Qt*tn,Kt=-0.0041960863*Ot-0.7034186147*Dt+1.707614701*_t-1,an=-0.0041960863*$t-0.7034186147*Ft+1.707614701*Bt,ln=-0.0041960863*Lt-0.7034186147*Vt+1.707614701*Wt,Zt=an/(an*an-0.5*Kt*ln),on=-Kt*Zt;qt=jt>=0?qt:1e6,rn=tn>=0?rn:1e6,on=Zt>=0?on:1e6,vt+=Math.min(qt,Math.min(rn,on))}}}return vt}function Mh(ot,st,ct=null){if(!ct)ct=vT(ot,st);let gt=ct[0],bt=ct[1];return[bt/gt,bt/(1-gt)]}function Ax(ot,st,ct){let gt=vT(st,ct),bt=Yse(st,ct,ot,1,ot,gt),yt=Mh(st,ct,gt),vt=0.11516993+1/(7.4477897+4.1590124*ct+st*(-2.19557347+1.75198401*ct+st*(-2.13704948-10.02301043*ct+st*(-4.24894561+5.38770819*ct+4.69891013*st)))),xt=0.11239642+1/(1.6132032-0.68124379*ct+st*(0.40370612+0.90148123*ct+st*(-0.27087943+0.6122399*ct+st*(0.00299215-0.45399568*ct-0.14661872*st)))),wt=bt/Math.min(ot*yt[0],(1-ot)*yt[1]),Ct=ot*vt,St=(1-ot)*xt,Et=0.9*wt*Math.sqrt(Math.sqrt(1/(1/(Ct*Ct*Ct*Ct)+1/(St*St*St*St))));return Ct=ot*0.4,St=(1-ot)*0.8,[Math.sqrt(1/(1/(Ct*Ct)+1/(St*St))),Et,bt]}function Nx(ot){let st=ot.l!==void 0?ot.l:0,ct=ot.a!==void 0?ot.a:0,gt=ot.b!==void 0?ot.b:0,bt={mode:"okhsl",l:Ih(st)};if(ot.alpha!==void 0)bt.alpha=ot.alpha;let yt=Math.sqrt(ct*ct+gt*gt);if(!yt)return bt.s=0,bt;let[vt,xt,wt]=Ax(st,ct/yt,gt/yt),Ct;if(yt<xt){let St=0,Et=0.8*vt,kt=1-Et/xt;Ct=(yt-St)/(Et+kt*(yt-St))*0.8}else{let St=xt,Et=0.2*xt*xt*1.25*1.25/vt,kt=1-Et/(wt-xt);Ct=0.8+0.2*((yt-St)/(Et+kt*(yt-St)))}if(Ct)bt.s=Ct,bt.h=fo(Math.atan2(gt,ct)*180/Math.PI);return bt}function Dx(ot){let st=ot.h!==void 0?ot.h:0,ct=ot.s!==void 0?ot.s:0,gt=ot.l!==void 0?ot.l:0,bt={mode:"oklab",l:td(gt)};if(ot.alpha!==void 0)bt.alpha=ot.alpha;if(!ct||gt===1)return bt.a=bt.b=0,bt;let yt=Math.cos(st/180*Math.PI),vt=Math.sin(st/180*Math.PI),[xt,wt,Ct]=Ax(bt.l,yt,vt),St,Et,kt,Rt;if(ct<0.8)St=1.25*ct,Et=0,kt=0.8*xt,Rt=1-kt/wt;else St=5*(ct-0.8),Et=wt,kt=0.2*wt*wt*1.25*1.25/xt,Rt=1-kt/(Ct-wt);let Tt=Et+St*kt/(1-Rt*St);return bt.a=Tt*yt,bt.b=Tt*vt,bt}var Zse={...gx,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:Nx,rgb:(ot)=>Nx(Cu(ot))},toMode:{oklab:Dx,rgb:(ot)=>Su(Dx(ot))}},Y4=Zse;function _x(ot){let st=ot.l!==void 0?ot.l:0,ct=ot.a!==void 0?ot.a:0,gt=ot.b!==void 0?ot.b:0,bt=Math.sqrt(ct*ct+gt*gt),yt=bt?ct/bt:1,vt=bt?gt/bt:1,[xt,wt]=Mh(yt,vt),Ct=0.5,St=1-Ct/xt,Et=wt/(bt+st*wt),kt=Et*st,Rt=Et*bt,Tt=td(kt),Pt=Rt*Tt/kt,Mt=hl({l:Tt,a:yt*Pt,b:vt*Pt}),It=Math.cbrt(1/Math.max(Mt.r,Mt.g,Mt.b,0));st=st/It,bt=bt/It*Ih(st)/st,st=Ih(st);let At={mode:"okhsv",s:bt?(Ct+wt)*Rt/(wt*Ct+wt*St*Rt):0,v:st?st/kt:0};if(At.s)At.h=fo(Math.atan2(gt,ct)*180/Math.PI);if(ot.alpha!==void 0)At.alpha=ot.alpha;return At}function Ox(ot){let st={mode:"oklab"};if(ot.alpha!==void 0)st.alpha=ot.alpha;let ct=ot.h!==void 0?ot.h:0,gt=ot.s!==void 0?ot.s:0,bt=ot.v!==void 0?ot.v:0,yt=Math.cos(ct/180*Math.PI),vt=Math.sin(ct/180*Math.PI),[xt,wt]=Mh(yt,vt),Ct=0.5,St=1-Ct/xt,Et=1-gt*Ct/(Ct+wt-wt*St*gt),kt=gt*wt*Ct/(Ct+wt-wt*St*gt),Rt=td(Et),Tt=kt*Rt/Et,Pt=hl({l:Rt,a:yt*Tt,b:vt*Tt}),Mt=Math.cbrt(1/Math.max(Pt.r,Pt.g,Pt.b,0)),It=td(bt*Et),At=kt*It/Et;return st.l=It*Mt,st.a=At*yt*Mt,st.b=At*vt*Mt,st}var eae={...hx,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:_x,rgb:(ot)=>_x(Cu(ot))},toMode:{oklab:Ox,rgb:(ot)=>Su(Ox(ot))}},Z4=eae;function tae(ot,st){if(!st||st[0]!=="oklab")return;let ct={mode:"oklab"},[,gt,bt,yt,vt]=st;if(gt.type===In.Hue||bt.type===In.Hue||yt.type===In.Hue)return;if(gt.type!==In.None)ct.l=Math.min(Math.max(0,gt.type===In.Number?gt.value:gt.value/100),1);if(bt.type!==In.None)ct.a=bt.type===In.Number?bt.value:bt.value*0.4/100;if(yt.type!==In.None)ct.b=yt.type===In.Number?yt.value:yt.value*0.4/100;if(vt.type!==In.None)ct.alpha=Math.min(1,Math.max(0,vt.type===In.Number?vt.value:vt.value/100));return ct}var eF=tae;var nae={...Xf,mode:"oklab",toMode:{lrgb:hl,rgb:Su},fromMode:{lrgb:Mx,rgb:Cu},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[eF],serialize:(ot)=>`oklab(${ot.l!==void 0?ot.l:"none"} ${ot.a!==void 0?ot.a:"none"} ${ot.b!==void 0?ot.b:"none"}${ot.alpha<1?` / ${ot.alpha}`:""})`},tF=nae;function rae(ot,st){if(!st||st[0]!=="oklch")return;let ct={mode:"oklch"},[,gt,bt,yt,vt]=st;if(gt.type!==In.None){if(gt.type===In.Hue)return;ct.l=Math.min(Math.max(0,gt.type===In.Number?gt.value:gt.value/100),1)}if(bt.type!==In.None)ct.c=Math.max(0,bt.type===In.Number?bt.value:bt.value*0.4/100);if(yt.type!==In.None){if(yt.type===In.Percentage)return;ct.h=yt.value}if(vt.type!==In.None)ct.alpha=Math.min(1,Math.max(0,vt.type===In.Number?vt.value:vt.value/100));return ct}var nF=rae;var oae={...Yf,mode:"oklch",toMode:{oklab:(ot)=>Ds(ot,"oklab"),rgb:(ot)=>Su(Ds(ot,"oklab"))},fromMode:{rgb:(ot)=>Ns(Cu(ot),"oklch"),oklab:(ot)=>Ns(ot,"oklch")},parse:[nF],serialize:(ot)=>`oklch(${ot.l!==void 0?ot.l:"none"} ${ot.c!==void 0?ot.c:"none"} ${ot.h!==void 0?ot.h:"none"}${ot.alpha<1?` / ${ot.alpha}`:""})`,ranges:{l:[0,1],c:[0,0.4],h:[0,360]}},rF=oae;var iae=(ot)=>{let{r:st,g:ct,b:gt,alpha:bt}=ia(ot),yt={mode:"xyz65",x:0.486570948648216*st+0.265667693169093*ct+0.1982172852343625*gt,y:0.2289745640697487*st+0.6917385218365062*ct+0.079286914093745*gt,z:0*st+0.0451133818589026*ct+1.043944368900976*gt};if(bt!==void 0)yt.alpha=bt;return yt},xT=iae;var sae=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=sa({r:ot*2.4934969119414263-st*0.9313836179191242-0.402710784450717*ct,g:ot*-0.8294889695615749+st*1.7626640603183465+0.0236246858419436*ct,b:ot*0.0358458302437845-st*0.0761723892680418+0.9568845240076871*ct},"p3");if(gt!==void 0)bt.alpha=gt;return bt},wT=sae;var aae={...oa,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:(ot)=>wT(ds(ot)),xyz65:wT},toMode:{rgb:(ot)=>fs(xT(ot)),xyz65:xT}},oF=aae;var CT=(ot)=>{let st=Math.abs(ot);if(st>=0.001953125)return Math.sign(ot)*Math.pow(st,0.5555555555555556);return 16*ot},lae=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt={mode:"prophoto",r:CT(ot*1.3457868816471585-st*0.2555720873797946-0.0511018649755453*ct),g:CT(ot*-0.5446307051249019+st*1.5082477428451466+0.0205274474364214*ct),b:CT(ot*0+st*0+1.2119675456389452*ct)};if(gt!==void 0)bt.alpha=gt;return bt},ST=lae;var ET=(ot=0)=>{let st=Math.abs(ot);if(st>=0.03125)return Math.sign(ot)*Math.pow(st,1.8);return ot/16},cae=(ot)=>{let st=ET(ot.r),ct=ET(ot.g),gt=ET(ot.b),bt={mode:"xyz50",x:0.7977666449006423*st+0.1351812974005331*ct+0.0313477341283922*gt,y:0.2880748288194013*st+0.7118352342418731*ct+0.0000899369387256*gt,z:0*st+0*ct+0.8251046025104602*gt};if(ot.alpha!==void 0)bt.alpha=ot.alpha;return bt},kT=cae;var uae={...oa,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:ST,rgb:(ot)=>ST(gl(ot))},toMode:{xyz50:kT,rgb:(ot)=>ml(kT(ot))}},iF=uae;var RT=(ot)=>{let st=Math.abs(ot);if(st>0.018053968510807)return(Math.sign(ot)||1)*(1.09929682680944*Math.pow(st,0.45)-0.09929682680944008);return 4.5*ot},pae=({x:ot,y:st,z:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt={mode:"rec2020",r:RT(ot*1.7166511879712683-st*0.3556707837763925-0.2533662813736599*ct),g:RT(ot*-0.6666843518324893+st*1.6164812366349395+0.0157685458139111*ct),b:RT(ot*0.0176398574453108-st*0.0427706132578085+0.9421031212354739*ct)};if(gt!==void 0)bt.alpha=gt;return bt},TT=pae;var PT=(ot=0)=>{let st=Math.abs(ot);if(st<0.08124285829863151)return ot/4.5;return(Math.sign(ot)||1)*Math.pow((st+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},dae=(ot)=>{let st=PT(ot.r),ct=PT(ot.g),gt=PT(ot.b),bt={mode:"xyz65",x:0.6369580483012911*st+0.1446169035862083*ct+0.1688809751641721*gt,y:0.262700212011267*st+0.6779980715188708*ct+0.059301716469862*gt,z:0*st+0.0280726930490874*ct+1.0609850577107909*gt};if(ot.alpha!==void 0)bt.alpha=ot.alpha;return bt},IT=dae;var fae={...oa,mode:"rec2020",fromMode:{xyz65:TT,rgb:(ot)=>TT(ds(ot))},toMode:{xyz65:IT,rgb:(ot)=>fs(IT(ot))},parse:["rec2020"],serialize:"rec2020"},sF=fae;var Eu=0.0037930732552754493,Lx=Math.cbrt(0.0037930732552754493);var MT=(ot)=>Math.cbrt(ot)-Lx,mae=(ot)=>{let{r:st,g:ct,b:gt,alpha:bt}=ia(ot),yt=MT(0.3*st+0.622*ct+0.078*gt+Eu),vt=MT(0.23*st+0.692*ct+0.078*gt+Eu),xt=MT(0.2434226892454782*st+0.2047674442449682*ct+0.5518098665095535*gt+Eu),wt={mode:"xyb",x:(yt-vt)/2,y:(yt+vt)/2,b:xt-(yt+vt)/2};if(bt!==void 0)wt.alpha=bt;return wt},aF=mae;var AT=(ot)=>Math.pow(ot+Lx,3),gae=({x:ot,y:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt=AT(ot+st)-Eu,yt=AT(st-ot)-Eu,vt=AT(ct+st)-Eu,xt=sa({r:11.031566904639861*bt-9.866943908131562*yt-0.16462299650829934*vt,g:-3.2541473810744237*bt+4.418770377582723*yt-0.16462299650829934*vt,b:-3.6588512867136815*bt+2.7129230459360922*yt+1.9459282407775895*vt});if(gt!==void 0)xt.alpha=gt;return xt},lF=gae;var hae={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:lF},fromMode:{rgb:aF},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:Nn,y:Nn,b:Nn,alpha:{use:Nn,fixup:_r}}},cF=hae;var bae={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:ml,lab:Jf},fromMode:{rgb:gl,lab:Qf},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:Nn,y:Nn,z:Nn,alpha:{use:Nn,fixup:_r}}},uF=bae;var yae=(ot)=>{let{x:st,y:ct,z:gt,alpha:bt}=ot;if(st===void 0)st=0;if(ct===void 0)ct=0;if(gt===void 0)gt=0;let yt={mode:"xyz50",x:1.0479298208405488*st+0.0229467933410191*ct-0.0501922295431356*gt,y:0.0296278156881593*st+0.990434484573249*ct-0.0170738250293851*gt,z:-0.0092430581525912*st+0.0150551448965779*ct+0.7518742899580008*gt};if(bt!==void 0)yt.alpha=bt;return yt},pF=yae;var vae=(ot)=>{let{x:st,y:ct,z:gt,alpha:bt}=ot;if(st===void 0)st=0;if(ct===void 0)ct=0;if(gt===void 0)gt=0;let yt={mode:"xyz65",x:0.9554734527042182*st-0.0230985368742614*ct+0.0632593086610217*gt,y:-0.0283697069632081*st+1.0099954580058226*ct+0.021041398966943*gt,z:0.0123140016883199*st-0.0205076964334779*ct+1.3303659366080753*gt};if(bt!==void 0)yt.alpha=bt;return yt},dF=vae;var xae={mode:"xyz65",toMode:{rgb:fs,xyz50:pF},fromMode:{rgb:ds,xyz50:dF},ranges:{x:[0,0.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:Nn,y:Nn,z:Nn,alpha:{use:Nn,fixup:_r}}},fF=xae;var wae=({r:ot,g:st,b:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt={mode:"yiq",y:0.29889531*ot+0.58662247*st+0.11448223*ct,i:0.59597799*ot-0.2741761*st-0.32180189*ct,q:0.21147017*ot-0.52261711*st+0.31114694*ct};if(gt!==void 0)bt.alpha=gt;return bt},mF=wae;var Cae=({y:ot,i:st,q:ct,alpha:gt})=>{if(ot===void 0)ot=0;if(st===void 0)st=0;if(ct===void 0)ct=0;let bt={mode:"rgb",r:ot+0.95608445*st+0.6208885*ct,g:ot-0.27137664*st-0.6486059*ct,b:ot-1.10561724*st+1.70250126*ct};if(gt!==void 0)bt.alpha=gt;return bt},gF=Cae;var Sae={mode:"yiq",toMode:{rgb:gF},fromMode:{rgb:mF},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:Nn,i:Nn,q:Nn,alpha:{use:Nn,fixup:_r}}},hF=Sae;function NT(ot){let st=ix("lrgb")(ot);return 0.2126*st.r+0.7152*st.g+0.0722*st.b}var $qe=ro(v4),Wqe=ro(P4),Uqe=ro(A4),jqe=ro(N4),Vqe=ro(D4),Gqe=ro(gx),Kqe=ro(hx),qqe=ro(F4),Qqe=ro(H4),Jqe=ro($4),Xqe=ro(W4),Yqe=ro(Xf),Zqe=ro(j4),eQe=ro(Yf),tQe=ro(G4),nQe=ro(Q4),rQe=ro(J4),oQe=ro(X4),iQe=ro(Y4),sQe=ro(Z4),aQe=ro(tF),lQe=ro(rF),cQe=ro(oF),uQe=ro(iF),pQe=ro(sF),dQe=ro(oa),fQe=ro(cF),mQe=ro(uF),gQe=ro(fF),hQe=ro(hF);var ku={sans:{label:"Sans",sans:"system-ui",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"},serif:{label:"Serif",sans:"Literata",mono:"Geist Mono",googleFontsQuery:"Literata:wght@400;600;700&family=Geist+Mono:wght@400;500"},mono:{label:"Mono",sans:"Geist Mono",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500;600"},geometric:{label:"Geometric",sans:"Manrope",mono:"Geist Mono",googleFontsQuery:"Manrope:wght@400;500;600&family=Geist+Mono:wght@400;500"},rounded:{label:"Rounded",sans:"SN Pro",mono:"Geist Mono",googleFontsQuery:"SN+Pro:wght@400;500;600&family=Geist+Mono:wght@400;500"},blobby:{label:"Blobby",sans:"Sour Gummy",mono:"Azeret Mono",googleFontsQuery:"Sour+Gummy:wght@400;500;600&family=Azeret+Mono:wght@400;500"},awkward:{label:"Awkward",sans:"Averia Sans Libre",mono:"Azeret Mono",googleFontsQuery:"Averia+Sans+Libre:wght@400;500;600&family=Azeret+Mono:wght@400;500"},comic:{label:"Comic",sans:"Comic Sans MS, Comic Sans, cursive",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"}},Ah={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},Nh={blob:{label:"Blob",traits:{shape:0.11,"body.r":0.5,"body.ratio":0,"body.n":0.5}},boxy:{label:"Boxy",traits:{shape:0.54,"body.r":1,"body.ratio":0}},pill:{label:"Pill",traits:{shape:0.65,"body.r":1}},dorito:{label:"Dorito",traits:{shape:0.99,"body.r":1,"body.ratio":0,"body.rot":0}}},DT="oklch(0.205 0 0)";function bF(ot){return NT(ot)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var yF={workspace:{primary:(ot)=>ot,primaryForeground:(ot)=>bF(ot),background:()=>"color-mix(in srgb, var(--primary) 2%, oklch(1 0 0) 98%)",foreground:()=>"color-mix(in srgb, var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 7%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"},widget:{background:(ot)=>ot,foreground:(ot)=>bF(ot),primary:()=>"color-mix(in srgb, var(--background) 2%, oklch(1 0 0) 98%)",primaryForeground:()=>"color-mix(in srgb, var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 15%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"}},_T=Object.keys(yF.workspace);function OT(ot,st="workspace"){let ct={},gt=yF[st];for(let bt of _T)ct[bt]=gt[bt](ot);return ct}var Fx={default:{label:"Default"},paper:{label:"Paper",primary:"oklch(0.4328 0.0351 66.67)"},rose:{label:"Rose",primary:"oklch(0.6322 0.2171 26.02)"},tangerine:{label:"Tangerine",primary:"oklch(0.6886 0.22 37.15)"},sand:{label:"Sand",primary:"oklch(0.8334 0.1271 67.80)"},mint:{label:"Tropics",primary:"oklch(0.5774 0.1399 156.06)"},sky:{label:"Sky",primary:"oklch(0.5824 0.1830 253.59)"},lavender:{label:"Lavender",primary:"oklch(0.6025 0.2426 294.58)"}},bl={font:"sans",color:"default",radius:"soft",agent:"boxy"};function Bx(ot,st,ct){return typeof ot==="string"&&Object.hasOwn(st,ot)?ot:ct}function _s(ot){return{font:Bx(ot?.font,ku,bl.font),color:Bx(ot?.color,Fx,bl.color),radius:Bx(ot?.radius,Ah,bl.radius),agent:Bx(ot?.agent,Nh,bl.agent)}}function Hx(ot,st="workspace"){let ct=_s(ot),bt=Fx[ct.color].primary??(st==="widget"?DT:void 0);return bt?OT(bt,st):void 0}var Dh=e(r(),1),Os={"claude-code":tx,openclaw:t4,codex:nx,hermes:e4};function Eae(ot,st,ct){switch(ot?.type){case"emoji":return Dh.jsx("span",{"aria-hidden":"true",className:n("flex size-full translate-y-[2cqi] items-center justify-center font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif] leading-none",st?"text-[60cqi]":"text-[85cqi]"),children:ot.value});case"upload":return Dh.jsx("img",{src:ot.value,alt:"",className:"size-full"});case"glyph":{let gt=jf(ot.value);if(gt)return vF.createElement(gt,{"aria-hidden":!0,stroke:1.75,className:st?"size-[70%]":"size-[95%] text-foreground"})}default:return Dh.jsx("img",{src:ct,alt:"",className:"size-[95%]"})}}function yl({className:ot,icon:st,workspaceType:ct,workspaceTheme:gt}){let bt=st?.type!=="upload"&&st?.background==="theme",yt=bt?Hx(gt)??OT(DT):void 0,vt=Os[ct??"claude-code"];return Dh.jsx("span",{className:n("@container inline-flex shrink-0 items-center justify-center overflow-hidden",bt&&"shadow-[inset_0_0_1rem_rgba(255,255,255,0.3)]",ot),style:yt?{backgroundColor:yt.primary,color:yt.primaryForeground}:void 0,children:Eae(st,bt,vt)})}var aa={"claude-code":"Claude",openclaw:"OpenClaw",codex:"ChatGPT",hermes:"Hermes"},_h={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};var ei=e(r(),1);function zx({mode:ot="select",cardClassName:st,disabled:ct,options:gt,selectedType:bt,onTypeChange:yt}){return ei.jsx("fieldset",{disabled:ct,"aria-label":"Agent",className:"flex min-w-0 flex-wrap justify-center gap-2",children:gt.map((vt)=>ei.jsx(kae,{option:vt,className:st,selected:ot==="select"?bt===vt.type:void 0,onSelect:yt},vt.type))})}function kae({option:ot,selected:st,onSelect:ct,className:gt}){let bt=Boolean(ot.disabledReason),yt=ei.jsxs("button",{type:"button",disabled:ot.disabled&&!bt,"aria-disabled":ot.disabled||void 0,"aria-pressed":st,onClick:(vt)=>{if(ot.disabled){vt.preventDefault();return}ct(ot.type)},className:n("relative flex h-32 min-w-32 flex-1 flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50",(st===!1||ot.disabled)&&"opacity-70",!st&&!ot.disabled&&"cursor-pointer hover:opacity-100",ot.disabled&&"cursor-not-allowed",gt),children:[ei.jsxs("span",{className:"relative inline-flex",children:[ei.jsx("img",{src:Os[ot.type],alt:"",className:"size-8 shrink-0"}),st&&ei.jsx(Y0,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),ei.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[ei.jsx("span",{className:"text-sm font-medium text-foreground",children:aa[ot.type]}),ei.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:ot.description})]})]});if(!bt)return yt;return ei.jsxs(Wr,{children:[ei.jsx(Ur,{render:yt}),ei.jsx(jr,{className:"max-w-[calc(100vw-2rem)] leading-5 sm:max-w-96",children:ei.jsxs("span",{className:"text-center",children:[ot.disabledReason,ot.disabledCommand&&ei.jsxs(ei.Fragment,{children:[ei.jsx("br",{}),ei.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono wrap-anywhere",children:ot.disabledCommand})]})]})})]})}var Wx=e(t(),1);var wF=e(r(),1);function xF({className:ot,...st}){return wF.jsx("textarea",{"data-slot":"textarea",className:u("flex field-sizing-content min-h-16 w-full rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 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",ot),...st})}var $x=e(t(),1);var Do=e(r(),1);function CF({code:ot,url:st,className:ct}){let[gt,bt]=$x.useState(!1);$x.useEffect(()=>{if(!gt)return;let vt=setTimeout(()=>bt(!1),3000);return()=>clearTimeout(vt)},[gt]);let yt=()=>{navigator.clipboard?.writeText(ot).then(()=>bt(!0)).catch(()=>{})};return Do.jsxs("ol",{className:n("mx-auto grid w-full max-w-64 gap-6 text-left text-sm lg:max-w-3xl lg:grid-cols-3 lg:text-center",ct),children:[Do.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[Do.jsx(bO,{size:24,stroke:1.5,className:"shrink-0"}),Do.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[Do.jsx("p",{children:"Enable device code sign-in for Codex in ChatGPT settings"}),Do.jsxs("a",{href:"https://chatgpt.com/settings/security",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-8 flex-wrap items-center gap-1 font-semibold focus-visible:ring-3 focus-visible:ring-ring/50",children:["Settings",Do.jsx(sc,{size:16,stroke:2,"aria-hidden":"true"}),"Security and login"]})]})]}),Do.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[Do.jsx(yO,{size:24,stroke:1.5,className:"shrink-0"}),Do.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[Do.jsx("p",{children:"Copy the one-time device code provided below"}),Do.jsxs("div",{className:"flex h-8 items-center gap-2 rounded-lg border border-input bg-accent pr-2 pl-3",children:[Do.jsx("code",{className:"cursor-text text-sm font-medium select-text",children:ot}),Do.jsxs("button",{type:"button",className:"relative size-4 cursor-pointer text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground","aria-label":gt?"Code copied":"Copy code",onClick:yt,children:[Do.jsx(z0,{className:n("absolute inset-0 transition-[opacity,filter] duration-200 motion-reduce:transition-none",gt&&"opacity-0 blur-[2px]"),stroke:1.75,size:16}),Do.jsx(Ys,{className:n("absolute inset-0 transition-[opacity,filter] duration-200 motion-reduce:transition-none",!gt&&"opacity-0 blur-[2px]"),stroke:1.75,size:16})]})]})]})]}),Do.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[Do.jsx(vO,{size:24,stroke:1.5,className:"shrink-0"}),Do.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[Do.jsx("p",{children:"Log in to ChatGPT, paste the code, then come back to Moi"}),Do.jsx("a",{href:st,target:"_blank",rel:"noopener noreferrer",className:X(),children:"Open ChatGPT"})]})]})]})}var LT=e(t(),1);function SF(ot){return p(`/api/harnesses/${ot}/auth/login`,{method:"POST"},"Could not start sign-in")}var Zf=Vl({queryKey:["harness-status"],queryFn:({signal:ot})=>p("/api/harnesses/status",{signal:ot}),staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:"always",refetchInterval:(ot)=>Object.values(ot.state.data??{}).some((st)=>st.login?.state==="starting"||st.login?.state==="pending")?2000:!1});function em(){let ot=Kn();return zr({mutationFn:()=>p("/api/harnesses/status?refresh=true"),onMutate:async()=>(await ot.cancelQueries({queryKey:Zf.queryKey}),ot.getQueryData(Zf.queryKey)),onSuccess:(st,ct,gt)=>{if(ot.getQueryData(Zf.queryKey)===gt)ot.setQueryData(Zf.queryKey,st)}})}function tm(){return kr(Zf)}function nm(ot){return kr({...Zf,enabled:ot==="claude-code"||ot==="codex",select:(st)=>ot?st[ot]:void 0})}function EF(ot,st,ct){return H(`/api/harnesses/${ot}/auth/login/${st}/code`,v("POST",{code:ct}))}function kF(ot){return H(`/api/harnesses/${ot}/auth/install`,{method:"POST"})}function RF(ot){let{environment:st,demo:ct}=R(),gt=nm(ot),bt=Kn(),[yt,vt]=LT.useState(""),[xt,wt]=LT.useState(!1),Ct=gt.data?.login,St=Ct?.state==="pending"?Ct:void 0,Et=Ct?.state==="starting",kt=st==="local"&&!xt,Rt=gt.data?.availability,Tt=zr({mutationFn:async(Ot)=>{if(Ot==="install"){if(await kF(ot),(await gt.refetch({throwOnError:!0})).data?.availability.status==="available")return}if(Ot==="start"||Ot==="install")wt(!1),vt(""),await SF(ot);if(Ot==="submit"&&St)await EF(ot,St.id,yt),vt("")},onSettled:()=>bt.invalidateQueries({queryKey:["harness-status"]})}),Pt=st==="local"&&!ct&&Rt?.status==="unavailable"&&Rt.code==="not-installed",Mt=gt.isError||Rt?.status==="unavailable",It=Tt.error?.message??(Ct?.state==="failed"?Ct.reason:void 0),At=Tt.variables==="install"&&(Tt.isPending||Tt.isSuccess&&!St&&Rt?.status!=="available"&&!Mt&&!It),Nt=!Pt&&!At&&!Et&&!St&&Rt?.status==="available";return{auth:gt,needsInstall:Pt,installing:At,code:yt,setCode:vt,manualLogin:xt,setManualLogin:wt,pending:St,starting:Et,waitingForBrowser:kt,connected:Nt,action:Tt,checkError:Mt,failure:It}}var oo=e(r(),1);function Ux({type:ot,onConnected:st,connectedContent:ct}){let{auth:gt,needsInstall:bt,installing:yt,code:vt,setCode:xt,manualLogin:wt,setManualLogin:Ct,pending:St,starting:Et,waitingForBrowser:kt,connected:Rt,action:Tt,checkError:Pt,failure:Mt}=RF(ot),It=em(),At=aa[ot];if(Wx.useEffect(()=>{if(Rt)st()},[Rt,st]),gt.isPending||Rt&&!ct)return oo.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:oo.jsx($o,{className:"size-6 text-muted-foreground",stroke:1.5})});function Nt(){if(Pt&&!bt&&!yt)return oo.jsx(Rae,{retrying:gt.isFetching||It.isPending,onRetry:()=>It.mutate()});if(Rt)return ct;if(St&&!yt)return oo.jsx(Tae,{name:At,pending:St,manualLogin:wt,waitingForBrowser:kt,onManualLogin:()=>Ct(!0),code:vt,onCodeChange:xt,submitting:Tt.isPending,onSubmit:()=>Tt.mutate("submit")});return oo.jsxs(oo.Fragment,{children:[oo.jsx("p",{className:"mt-2 text-center text-sm text-muted-foreground",children:bt||yt?`${At} isn’t installed on your computer yet. Install it, then log in to get started.`:"Let’s log in and get your agent ready"}),oo.jsxs(a,{className:"mt-6 self-center",disabled:yt||Tt.isPending||Et,onClick:()=>Tt.mutate(bt?"install":"start"),children:[yt?"Installing…":bt?`Install ${At}`:"Log in",!bt&&!yt&&oo.jsx(L0,{stroke:1.75,"data-icon":"inline-end"})]})]})}return oo.jsxs("div",{className:"mx-auto flex w-full max-w-5xl flex-1 flex-col items-center justify-center p-6 text-center",children:[oo.jsx("img",{src:Os[ot],alt:"",className:"mb-4 size-10"}),oo.jsxs("h1",{className:"text-center text-xl font-medium",children:["Set up ",At]}),oo.jsxs("section",{className:n("flex w-full flex-col items-center",!St?.userCode&&"max-w-xs"),"aria-label":At,children:[Nt(),Mt&&oo.jsx("p",{role:"alert",className:"mt-6 text-sm text-destructive",children:Mt})]})]})}function Rae({retrying:ot,onRetry:st}){return oo.jsxs("div",{role:"alert",className:"mt-6 flex flex-col items-start gap-2",children:[oo.jsx("p",{children:"Couldn’t check whether you’re logged in"}),oo.jsx(a,{variant:"secondary",disabled:ot,onClick:st,children:"Try again"})]})}function Tae({name:ot,pending:st,manualLogin:ct,waitingForBrowser:gt,onManualLogin:bt,code:yt,onCodeChange:vt,submitting:xt,onSubmit:wt}){if(st.userCode)return oo.jsx(CF,{code:st.userCode,url:st.url,className:"mt-6"});let Ct=Boolean(st.codeUrl&&!gt),St="Log in in your browser, then come back to Moi";if(Ct)St=`Log in to ${ot} to get your authorization code.`;let Et=st.url;if(ct)Et=st.codeUrl??st.url;return oo.jsxs(oo.Fragment,{children:[oo.jsx("p",{role:"status",className:"mt-6 text-sm text-muted-foreground",children:St}),oo.jsxs("a",{className:n(X({variant:"secondary"}),"mt-4"),href:Et,target:"_blank",rel:"noopener noreferrer",children:["Open ",ot]}),gt&&st.codeUrl&&oo.jsx(a,{variant:"ghost",onClick:bt,className:"mt-4",children:"Having trouble logging in?"}),Ct&&oo.jsx(Pae,{code:yt,onCodeChange:vt,submitting:xt,onSubmit:wt})]})}function Pae({code:ot,onCodeChange:st,submitting:ct,onSubmit:gt}){let bt=Wx.useId();return oo.jsxs("form",{className:"mt-6 flex w-full flex-col gap-3",onSubmit:(yt)=>{yt.preventDefault(),gt()},children:[oo.jsx("label",{htmlFor:bt,className:"text-sm text-muted-foreground",children:"Paste the code here:"}),oo.jsx(xF,{id:bt,"aria-label":"Authorization code",rows:3,className:"field-sizing-fixed resize-none",value:ot,onChange:(yt)=>st(yt.target.value),autoComplete:"off",spellCheck:!1}),oo.jsx(a,{type:"submit",className:"mt-3",disabled:!ot.trim()||ct,children:ct?"Connecting…":"Continue"})]})}var Oh=e(r(),1);function Lh({children:ot,className:st,footer:ct}){return Oh.jsxs("div",{className:"grid flex-1 grid-rows-[1fr_auto_1fr] p-6",children:[Oh.jsx("div",{className:n("row-start-2 mx-auto flex w-full flex-col gap-6 py-8",st),children:ot}),Oh.jsx("div",{className:"row-start-3 flex min-h-9 items-end justify-center",children:ct})]})}var vl=e(r(),1);function TF({onComplete:ot}){let[st,ct]=jx.useState(),gt=jx.useCallback(()=>{if(st)ot(st)},[st,ot]);if(!st)return vl.jsx(Iae,{onSelect:ct});return vl.jsx(Ux,{type:st,onConnected:gt})}function Iae({onSelect:ot}){let{environment:st,demo:ct}=R(),gt=st==="local"&&!ct,bt=tm(),yt=em();if(bt.isPending||bt.error)return vl.jsx(Uf,{error:bt.error??void 0,onRetry:()=>yt.mutate()});let vt=["claude-code","codex"].map((xt)=>({type:xt,description:_h[xt],disabled:!gt&&bt.data[xt].availability.status==="unavailable",disabledReason:gt||bt.data[xt].availability.status!=="unavailable"?void 0:"This agent is not installed on your computer"}));return vl.jsxs(Lh,{className:"max-w-sm",children:[vl.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[vl.jsx("h1",{className:"text-xl font-medium",children:"Choose your agent"}),vl.jsx("p",{className:"max-w-60 text-sm text-muted-foreground",children:"Connect an existing subscription to build and personalize Moi"})]}),vl.jsx(zx,{options:vt,mode:"action",cardClassName:"h-36",disabled:!1,onTypeChange:(xt)=>{if(xt==="claude-code"||xt==="codex")ot(xt)}})]})}var dc=e(t(),1);function PF(ot,st){let ct=ot??[],gt=ct.findIndex((bt)=>bt.id===st.id||bt.path===st.path);if(gt===-1)return[st,...ct];return ct.map((bt,yt)=>yt===gt?{...bt,...st}:bt)}function IF(){let ot=Kn();return zr({mutationFn:(st)=>p("/api/workspaces",v("POST",st),"Failed to add workspace"),onSuccess:(st,ct)=>{Ar.getState().markWorkspacePendingAnalysis(st.id),ot.setQueryData(Tn.all,(gt)=>PF(gt,st)),ot.setQueryData(Tn.discover,(gt)=>(gt??[]).filter((bt)=>bt.path!==ct.path))}})}function Vx(){let ot=Kn();return zr({mutationFn:(st)=>p("/api/workspaces/create",v("POST",st),"Failed to create workspace"),onSuccess:(st)=>{ot.setQueryData(Tn.all,(ct)=>PF(ct,st))}})}var Gx=e(t(),1);var BT="moi-fonts",MF="moi-font-previews",Mae=Object.values(ku).map((ot)=>ot.googleFontsQuery).filter(Boolean).join("&family="),NF=[["sans","--sans"],["mono","--mono"]],DF=_T.map((ot)=>[ot,Aae(ot)]),_F="--radius",OF={"--secondary":"var(--accent)","--secondary-foreground":"var(--accent-foreground)"},AF=[...NF.map(([,ot])=>ot),...DF.map(([,ot])=>ot),...Object.keys(OF),_F];function Aae(ot){return`--${ot.replace(/[A-Z]/g,(ct)=>`-${ct.toLowerCase()}`)}`}function Nae(ot){let st={},ct=_s(ot),gt=ct.font===bl.font?void 0:ku[ct.font];for(let[bt,yt]of NF)st[yt]=gt?.[bt];return st}function FT(ot,st="workspace"){let ct={},gt=Hx(ot,st);for(let[bt,yt]of DF)ct[yt]=gt?.[bt];for(let[bt,yt]of Object.entries(OF))ct[bt]=gt?yt:void 0;return ct}function Dae(ot){let st={},ct=_s(ot),gt=ct.radius===bl.radius?void 0:Ah[ct.radius];return st[_F]=gt?.radius,st}function Ls(ot,st="workspace"){return{...Nae(ot),...FT(ot,st),...Dae(ot)}}function rm(){Gx.useEffect(()=>{if(document.getElementById(MF))return;let ot=document.createElement("link");return ot.id=MF,ot.rel="stylesheet",ot.crossOrigin="anonymous",ot.href=`https://fonts.googleapis.com/css2?family=${Mae}&display=swap`,document.head.appendChild(ot),()=>{ot.remove()}},[])}function _ae(ot){Gx.useEffect(()=>{let st=document.documentElement,ct=Ls(ot);for(let gt of AF){let bt=ct[gt];if(bt)st.style.setProperty(gt,bt);else st.style.removeProperty(gt)}return()=>{for(let gt of AF)st.style.removeProperty(gt)}},[ot])}function LF(ot){let{font:st}=_s(ot);_ae(ot),Gx.useEffect(()=>{let ct=ku[st]??ku[bl.font],gt=document.getElementById(BT);if(!ct.googleFontsQuery)gt?.remove();else{let bt=`https://fonts.googleapis.com/css2?family=${ct.googleFontsQuery}&display=swap`;if(gt)gt.href=bt;else{let yt=document.createElement("link");yt.id=BT,yt.rel="stylesheet",yt.crossOrigin="anonymous",yt.href=bt,document.head.appendChild(yt)}}return()=>{document.getElementById(BT)?.remove()}},[st])}var Ru=e(t(),1);var Co=e(r(),1);function BF({idea:ot,state:st,onSelect:ct}){let gt=_s(ot.theme),bt=Ru.useId();return Co.jsxs("button",{type:"button","aria-label":`Build ${ot.name}`,"aria-describedby":bt,"aria-busy":st==="chosen",disabled:st!=="available",onClick:ct,style:Ls(gt),className:n("relative mx-auto flex min-h-96 w-full max-w-sm min-w-0 flex-col rounded-2xl bg-transparent px-5 pb-6 text-center font-sans text-primary-foreground drop-shadow-sm outline-none lg:max-w-none","lg:first:translate-y-6 lg:first:-rotate-4 lg:last:translate-y-5 lg:last:rotate-3","focus-visible:ring-3 focus-visible:ring-ring/50 enabled:cursor-pointer enabled:hover:drop-shadow-lg","motion-safe:transition-[translate,filter] motion-safe:duration-200 motion-safe:enabled:hover:-translate-y-1 motion-safe:enabled:active:translate-y-0","lg:motion-safe:first:enabled:hover:translate-y-5 lg:motion-safe:last:enabled:hover:translate-y-4 lg:motion-safe:first:enabled:active:translate-y-3 lg:motion-safe:last:enabled:active:translate-y-3","disabled:cursor-default",st==="chosen"&&"motion-safe:animate-out motion-safe:ease-in-out motion-safe:animation-duration-1500 motion-safe:direction-alternate motion-safe:repeat-infinite motion-safe:[animation-composition:add] motion-safe:spin-out-3",st==="not-chosen"&&"invisible"),children:[Co.jsx(Lae,{className:"fill-primary"}),Co.jsx("span",{"aria-hidden":"true",className:"relative mb-4 ml-2 h-24 w-2/3 shrink-0 overflow-hidden rounded-b-xl",children:Co.jsx("span",{className:"absolute inset-x-0 -top-2 bottom-0 flex justify-end rounded-b-lg px-1.5 pt-2 pb-1.5 inset-shadow-[0_0_2px_1px] inset-shadow-foreground/15",children:Co.jsx("span",{className:"relative w-3/4 rounded-b-lg bg-background/80",children:Co.jsx("span",{className:"absolute inset-y-2 right-4 w-1/4 rounded-xs bg-primary"})})})}),Co.jsx("span",{className:"relative mx-2 my-2 flex flex-1 rounded-lg p-1.5 inset-shadow-[0_0_2px_1px] inset-shadow-foreground/15",children:Co.jsxs("span",{className:"relative flex flex-1 flex-col items-center justify-center gap-3 rounded-md bg-background px-4 py-8 text-foreground",children:[Co.jsxs("span",{className:"flex max-w-full items-center justify-center gap-2",children:[Co.jsx(yl,{icon:{type:"glyph",value:ot.icon,background:"theme"},workspaceTheme:gt,className:"size-5 rounded-sm"}),Co.jsx("span",{className:"min-w-0 text-lg font-semibold wrap-break-word",children:ot.name})]}),Co.jsx("span",{id:bt,className:"text-sm wrap-break-word",children:ot.description}),ot.views.map((yt,vt)=>Co.jsx(Oae,{view:yt,index:vt},vt))]})})]})}function Oae({view:ot,index:st}){let ct=jf(ot.icon),[gt]=Ru.useState(()=>{let bt=["-rotate-3","-rotate-2","-rotate-1","rotate-1","rotate-2","rotate-3"];return bt[Math.floor(Math.random()*bt.length)]});return Co.jsxs(_f,{variant:"outline",className:n("absolute h-8 max-w-1/2 min-w-0 gap-1.5 rounded-md border-0 bg-background px-2 py-1.5 text-xs font-normal ring-1 ring-border",gt,st===0&&"top-0 right-8 -translate-y-1/2",st===1&&"bottom-0 -left-2 translate-y-1/2",st===2&&"-right-2 bottom-0 translate-y-1/2"),children:[ct&&Ru.createElement(ct,{className:"size-4 shrink-0",stroke:1.75,"aria-hidden":!0}),Co.jsx("span",{className:"truncate font-medium",children:ot.name})]})}function Lae({className:ot}){let st=Ru.useId(),ct=Ru.useId();return Co.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 360 400",preserveAspectRatio:"none",className:n("pointer-events-none absolute inset-0 size-full",ot),children:[Co.jsxs("defs",{children:[Co.jsx("path",{id:st,d:"M12 0H324C328 0 330 1 333 4L356 27C359 30 360 32 360 36V388C360 394.63 354.63 400 348 400H12C5.37 400 0 394.63 0 388V12C0 5.37 5.37 0 12 0Z"}),Co.jsx("clipPath",{id:ct,children:Co.jsx("use",{href:`#${st}`})})]}),Co.jsx("use",{href:`#${st}`}),Co.jsx("foreignObject",{width:"360",height:"400",clipPath:`url(#${ct})`,children:Co.jsx("div",{className:"size-full rounded-xl inset-shadow-[0_0_16px_color-mix(in_oklab,var(--color-white)_20%,transparent)]"})})]})}var mo=e(r(),1);function HF({harness:ot,onFinish:st,finishing:ct,finishError:gt}){let[bt,yt]=dc.useState(),[vt,xt]=dc.useState(),[wt,Ct]=dc.useState(!1),St=$R("discover",bt),Et=$R("create",bt&&vt?{...bt,...vt}:void 0,wt);dc.useEffect(()=>{if(!bt)return;return()=>{zR(bt.runId).catch(()=>{})}},[bt]);let kt=dc.useRef(void 0),Rt=Et.data?.status==="done"?Et.data.workspaceId:void 0;dc.useEffect(()=>{if(!Rt||kt.current===Rt)return;kt.current=Rt,st(Rt)},[Rt,st]);let Tt=Vx(),Pt=Tt.data?.id,Mt=zr({mutationFn:async()=>{if(Pt)return Pt;if(bt)await zR(bt.runId),yt(void 0);if((await p("/api/workspaces")).length>0)return;return(await Tt.mutateAsync({type:ot})).id},onSuccess:(Ft)=>st(Ft)}),It=St.error?.message??St.data?.error,At=Mt.error?.message??Et.error?.message??Et.data?.error??(It?"We couldn’t find ideas this time. Try again, or start on your own.":void 0);function Nt(){Mt.reset(),yt({harness:ot,runId:crypto.randomUUID()})}function Ot(Ft){xt((Bt)=>Bt??{ideaId:Ft,operationId:crypto.randomUUID()})}let Dt=ct||Mt.isPending,_t=mo.jsxs(mo.Fragment,{children:[(At||gt)&&mo.jsx("p",{role:"alert",className:"text-center text-sm text-destructive",children:At||gt}),vt&&(At||gt)&&mo.jsx(a,{size:"lg",className:"self-center",variant:"secondary",disabled:Dt||Et.isFetching,onClick:()=>{if(Rt)st(Rt);else if(wt)Et.refetch();else Ct(!0)},children:"Try again"})]}),$t=!vt&&mo.jsxs(a,{size:"lg",variant:"ghost",disabled:Dt,onClick:()=>Mt.mutate(),children:[Mt.isPending&&mo.jsx($o,{stroke:1.5}),Mt.isPending?"Creating workspace…":"Skip onboarding"]});if(!vt&&(!bt||At||Dt))return mo.jsx(FF,{disabled:Dt||!!Pt,failed:!!It,onFindIdeas:Nt,feedback:_t,footer:$t});if(St.data?.status==="done")return mo.jsx(Fae,{ideas:St.data.ideas??[],selectedIdeaId:vt?.ideaId,onSelect:Ot,feedback:_t,footer:$t});return mo.jsx(FF,{loading:!0,progressMessage:St.data?.progress?.message,disabled:Dt,failed:!1,onFindIdeas:Nt,feedback:_t,footer:$t})}function FF({loading:ot=!1,progressMessage:st,disabled:ct,failed:gt,onFindIdeas:bt,feedback:yt,footer:vt}){return mo.jsxs(Lh,{className:"max-w-sm",footer:vt,children:[mo.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[mo.jsx("h1",{className:"text-xl font-medium",children:"Choose a starting point"}),mo.jsx("p",{className:"text-sm text-muted-foreground",children:"Moi can look through your recent conversations, emails, and connected apps to suggest ideas for you to build"})]}),mo.jsxs("div",{className:"flex flex-col items-center gap-3",children:[ot?mo.jsx(Bae,{message:st}):mo.jsxs(a,{size:"lg",disabled:ct,onClick:bt,children:[mo.jsx(BL,{stroke:1.5,"aria-hidden":"true"}),gt?"Try again":"Find ideas"]}),yt]})]})}function Bae({message:ot}){return mo.jsx("div",{role:"status","aria-label":"Finding ideas",className:"flex h-9 max-w-full min-w-0 items-center text-sm text-muted-foreground",children:mo.jsx("span",{className:"shimmer truncate",title:ot,children:ot??"Taking a first look…"})})}function Fae({ideas:ot,selectedIdeaId:st,onSelect:ct,feedback:gt,footer:bt}){return rm(),mo.jsxs(Lh,{className:"max-w-6xl",footer:bt,children:[mo.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[mo.jsx("h1",{className:"text-xl font-medium",children:"Choose a starting point"}),mo.jsx("p",{className:"text-sm text-muted-foreground",children:"Pick an idea to build, you can change and add things as you go"})]}),mo.jsx("div",{className:"grid justify-items-stretch gap-10 px-3 pt-4 pb-8 lg:grid-cols-3 lg:gap-8",children:ot.map((yt)=>mo.jsx(BF,{idea:yt,state:!st?"available":st===yt.id?"chosen":"not-chosen",onSelect:()=>ct(yt.id)},yt.id))}),gt]})}var Bh=e(r(),1);function zF(){let ot=ex(),st=Wf(),[ct,gt]=HT.useState("/"),[bt,yt]=HT.useState();if(ot.loading||ot.error)return Bh.jsx(Uf,{error:ot.error||void 0,onRetry:ot.retry});if(!ot.enabled||!ot.data?.showOnboarding)return Bh.jsx(Ac,{to:ct});function vt(xt){gt(xt?`/workspace/${xt}/overview`:"/"),st.mutate({showOnboarding:!1})}if(!bt)return Bh.jsx(TF,{onComplete:yt});return Bh.jsx(HF,{harness:bt,onFinish:vt,finishing:st.isPending,finishError:st.error?.message})}var Kx=e(r(),1);function $F(){return Kx.jsx("main",{className:"flex h-dvh flex-col overflow-hidden",children:Kx.jsx($f,{children:Kx.jsx(zF,{})})})}var hE=e(t(),1);function qx(){return kr({queryKey:Tn.all,queryFn:()=>p("/api/workspaces"),staleTime:300000})}var UF=Vl({queryKey:Tn.previews,queryFn:()=>p("/api/workspaces/previews"),staleTime:60000});function jF(){return kr(UF)}function Qx(ot){return kr({...UF,select:(st)=>st[ot]})}function VF(){return kr({queryKey:Tn.discover,queryFn:()=>p("/api/workspaces/discover")})}var WF=["workspaces-reorder"];function GF(){let ot=Kn();return zr({mutationKey:WF,mutationFn:(st)=>p("/api/workspaces/order",v("PUT",{ids:st,origin:V}),"Failed to reorder spaces"),onMutate:async(st)=>{await ot.cancelQueries({queryKey:Tn.all,exact:!0});let ct=ot.getQueryData(Tn.all);if(ct){let gt=new Map(ct.map((yt)=>[yt.id,yt])),bt=st.map((yt)=>gt.get(yt)).filter((yt)=>Boolean(yt));if(bt.length===ct.length)ot.setQueryData(Tn.all,bt)}return{previous:ct}},onError:(st,ct,gt)=>{if(gt?.previous)ot.setQueryData(Tn.all,gt.previous);ot.invalidateQueries({queryKey:Tn.all,exact:!0})},onSuccess:(st)=>{if(ot.isMutating({mutationKey:WF})>1)return;ot.setQueryData(Tn.all,st)}})}function Jx(){let ot=Kn();return zr({mutationFn:(st)=>H(`/api/workspaces/${st}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(st,ct)=>{ot.setQueryData(Tn.all,(gt)=>(gt??[]).filter((bt)=>bt.id!==ct)),ot.invalidateQueries({queryKey:Tn.discover})}})}var JF=e(t(),1);var zT="Wait for active agents to finish, or stop them before updating Moi";var Hae=["update"],KF=300000,zae=1000;function qF(ot){return kr({queryKey:Hae,queryFn:()=>p("/api/update"),staleTime:KF,refetchInterval:ot?zae:KF,refetchOnWindowFocus:!0,retry:!1})}function QF(){return zr({mutationFn:()=>p("/api/update",{method:"POST"},"Could not update Moi")})}var fc=e(r(),1);function $ae(ot,st){return!!st&&ot?.runningVersion===st}function Wae(ot,st,ct){let gt=st||ct,bt=ot&&!gt;return{busy:gt,blocked:bt,label:st?"Updating":ct?"Restarting":bt?zT:"Update"}}function XF(){let ot=QF(),st=qF(ot.isSuccess),ct=gi((xt)=>R5(xt.activity)),gt=st.data,bt=ot.data?.installedVersion??null;if(JF.useEffect(()=>{if($ae(gt,bt))window.location.reload()},[bt,gt]),st.isPending)return{status:"loading"};if(!gt?.availableVersion&&!ot.isSuccess)return{status:"unavailable"};let yt=ot.isSuccess;return{status:"available",button:{...Wae(ct,ot.isPending,yt),errorMessage:ot.error?.message??null,onClick:()=>ot.mutate()}}}function YF({busy:ot,blocked:st,label:ct,errorMessage:gt,onClick:bt}){return fc.jsxs(Wr,{children:[fc.jsx(Ur,{render:fc.jsx("div",{children:fc.jsx(a,{type:"button",size:"icon-sm",variant:ot?"ghost":"default","aria-label":ct,disabled:st||ot,onClick:bt,children:ot?fc.jsx($o,{stroke:1.5}):fc.jsx(QO,{stroke:1.5})})})}),fc.jsx(jr,{side:"right",className:st?"max-w-56":void 0,children:st?zT:gt??ct})]})}var Uh=e(t(),1);var ZF=e(t(),1);var Xx=e(t(),1),$T=Xx.createContext(void 0);function Oi(ot){let st=Xx.useContext($T);if(!ot&&st===void 0)throw Error(c(27));return st}var Yx=ZF.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,forceRender:vt=!1,...xt}=st,wt=Oi(),Ct=wt.useState("open"),St=wt.useState("nested"),Et=wt.useState("mounted"),kt=wt.useState("transitionStatus");return l("div",st,{state:{open:Ct,transitionStatus:kt},ref:[wt.context.backdropRef,ct],stateAttributesMapping:Va,props:[{role:"presentation",hidden:!Et,style:{userSelect:"none",WebkitUserSelect:"none"}},xt],enabled:vt||!St})});var e6=e(t(),1);var Zx=e6.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,disabled:vt=!1,nativeButton:xt=!0,...wt}=st,Ct=Oi(),St=Ct.useState("open"),{getButtonProps:Et,buttonRef:kt}=P({disabled:vt,native:xt}),Rt={disabled:vt};function Tt(Pt){if(St)Ct.setOpen(!1,Ln(W_,Pt.nativeEvent))}return l("button",st,{state:Rt,ref:[ct,kt],props:[{onClick:Tt},wt,Et]})});var t6=e(t(),1);var ew=t6.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,id:vt,...xt}=st,wt=Oi(),Ct=Cr(vt);return wt.useSyncedValueWithCleanup("descriptionElementId",Ct),l("p",st,{ref:ct,props:[{id:Ct},xt]})});var s6=e(t(),1);var tw=e(t(),1),WT=tw.createContext(void 0);function n6(){let ot=tw.useContext(WT);if(ot===void 0)throw Error(c(26));return ot}var r6="--nested-dialogs";var _Xe=WE,OXe=UE,LXe=pZ,BXe=dZ;var o6="data-nested-dialog-open";var i6={..._g,...fi,nestedDialogOpen(ot){return ot?{[o6]:""}:null}};var a6=e(r(),1),nw=s6.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,finalFocus:vt,initialFocus:xt,...wt}=st,Ct=Oi(),St=Ct.useState("descriptionElementId"),Et=Ct.useState("disablePointerDismissal"),kt=Ct.useState("floatingRootContext"),Rt=Ct.useState("popupProps"),Tt=Ct.useState("modal"),Pt=Ct.useState("mounted"),Mt=Ct.useState("nested"),It=Ct.useState("nestedOpenDialogCount"),At=Ct.useState("open"),Nt=Ct.useState("openMethod"),Ot=Ct.useState("titleElementId"),Dt=Ct.useState("transitionStatus"),_t=Ct.useState("role"),$t=kt.useState("floatingId");n6(),Ro({open:At,ref:Ct.context.popupRef,onComplete(){if(At)Ct.context.onOpenChangeComplete?.(!0)}});let Ft=xt===void 0?v0(Ct.context.popupRef):xt,Bt=It>0,Lt=Ct.useStateSetter("popupElement"),Wt=l("div",st,{state:{open:At,nested:Mt,transitionStatus:Dt,nestedDialogOpen:Bt},props:[Rt,{id:$t,"aria-labelledby":Ot,"aria-describedby":St,role:_t,...Ya,hidden:!Pt,onKeyDown(Ut){if(Pa.has(Ut.key))Ut.stopPropagation()},style:{[r6]:It}},wt],ref:[ct,Ct.context.popupRef,Lt],stateAttributesMapping:i6});return a6.jsx(Op,{context:kt,openInteractionType:Nt,disabled:!Pt,closeOnFocusOut:!Et,initialFocus:Ft,returnFocus:vt,modal:Tt!==!1,restoreFocus:"popup",children:Wt})});var l6=e(t(),1);var Fh=e(r(),1),rw=l6.forwardRef(function(st,ct){let{keepMounted:gt=!1,...bt}=st,yt=Oi(),vt=yt.useState("mounted"),xt=yt.useState("modal"),wt=yt.useState("open");if(!(vt||gt))return null;return Fh.jsx(WT.Provider,{value:gt,children:Fh.jsxs(Ap,{ref:ct,...bt,children:[vt&&xt===!0&&Fh.jsx(xf,{ref:yt.context.internalBackdropRef,inert:Qa(!wt)}),st.children]})})});var u6=e(t(),1);var UT=e(t(),1);function c6({store:ot,parentContext:st,isDrawer:ct}){let gt=ot.useState("open"),bt=ot.useState("disablePointerDismissal"),yt=ot.useState("modal"),vt=ot.useState("popupElement"),xt=ot.useState("floatingRootContext"),[wt,Ct]=UT.useState(0),[St,Et]=UT.useState(0),kt=wt===0,Rt=Ra(xt,{outsidePressEvent(){if(ot.context.internalBackdropRef.current||ot.context.backdropRef.current)return"intentional";return{mouse:yt==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(Tt){if(!ot.context.outsidePressEnabledRef.current)return!1;if("button"in Tt&&Tt.button!==0)return!1;if("touches"in Tt){if(Tt.type==="touchend"){if(Tt.changedTouches.length!==1||Tt.touches.length!==0)return!1}else if(Tt.touches.length!==1)return!1}let Pt=xr(Tt);if(kt&&!bt){if(yt){let Mt=ot.context.internalBackdropRef.current,It=ot.context.backdropRef.current;return Mt||It?Mt===Pt||It===Pt||On(Pt,vt)&&!Pt?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:kt});return yv(gt&&yt===!0,vt),ot.useContextCallback("onNestedDialogOpen",(Tt,Pt)=>{Ct(Tt),Et(Pt)}),i(()=>{if(st?.onNestedDialogOpen)if(gt)st.onNestedDialogOpen(wt+1,St+(ct?1:0));else st.onNestedDialogOpen(0,0);return()=>{if(st?.onNestedDialogOpen&&gt)st.onNestedDialogOpen(0,0)}},[ct,gt,wt,St,st]),rl(ot,{activeTriggerProps:Rt.reference,inactiveTriggerProps:Rt.trigger,popupProps:Rt.floating,nestedOpenDialogCount:wt,nestedOpenDrawerCount:St}),null}var ow=e(t(),1);var Vae={...il,modal:(ot)=>ot.modal,nested:(ot)=>ot.nested,nestedOpenDialogCount:(ot)=>ot.nestedOpenDialogCount,nestedOpenDrawerCount:(ot)=>ot.nestedOpenDrawerCount,disablePointerDismissal:(ot)=>ot.disablePointerDismissal,openMethod:(ot)=>ot.openMethod,descriptionElementId:(ot)=>ot.descriptionElementId,titleElementId:(ot)=>ot.titleElementId,viewportElement:(ot)=>ot.viewportElement,role:(ot)=>ot.role};class jT extends Gi{constructor(ot,st,ct){let gt=new Ta,bt=Gae(ot,gt,st,ct);super(bt,Kae(gt),Vae)}setOpen=(ot,st)=>{if(st.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!ot&&st.trigger==null&&this.state.activeTriggerId!=null)st.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.(ot,st),st.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(ot,st),this.update(Bp(this.state,ot,st.trigger))}}function Gae(ot,st,ct,gt=!1){return{...ol(st,ct,gt),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...ot}}function Kae(ot){return{popupRef:ow.createRef(),backdropRef:ow.createRef(),internalBackdropRef:ow.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:ot,onOpenChange:void 0,onOpenChangeComplete:void 0}}var Hh=e(r(),1);function iw(ot,st){let{children:ct,open:gt,defaultOpen:bt=!1,onOpenChange:yt,onOpenChangeComplete:vt,disablePointerDismissal:xt=!1,modal:wt=!0,actionsRef:Ct,handle:St,triggerId:Et,defaultTriggerId:kt=null}=st,Rt=ot==="drawer",Tt=ot==="alert-dialog",Pt=Tt?!0:wt,Mt=Tt||xt,It=Tt?"alertdialog":"dialog",At=Oi(!0),Nt=At!=null,Ot={modal:Pt,disablePointerDismissal:Mt,nested:Nt,role:It},Dt=jc((Vt,Wt)=>new jT({open:bt,openProp:gt,activeTriggerId:kt,triggerIdProp:Et,...Ot},Vt,Wt),!0);Dt.useControlledProp("openProp",gt),Dt.useControlledProp("triggerIdProp",Et),Dt.useSyncedValues(Ot),Dt.useContextCallback("onOpenChange",yt),Dt.useContextCallback("onOpenChangeComplete",vt);let _t=Dt.useState("open"),$t=Dt.useState("mounted"),Ft=Dt.useState("payload");w0(Dt,_t),tl(Dt);let{forceUnmount:Bt}=nl(_t,Dt);u6.useImperativeHandle(Ct,()=>({unmount:Bt,close:()=>Dt.setOpen(!1,Ln(Vg))}),[Bt,Dt]);let Lt=_t||$t;return Hh.jsxs($T.Provider,{value:Dt,children:[St&&Hh.jsx(Za,{handle:St,store:Dt}),Lt&&Hh.jsx(c6,{store:Dt,parentContext:At?.context,isDrawer:Rt}),typeof ct==="function"?ct({payload:Ft}):ct]})}var p6=va(function(st){return iw("dialog",st)});var d6=e(t(),1);var sw=d6.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,id:vt,...xt}=st,wt=Oi(),Ct=Cr(vt);return wt.useSyncedValueWithCleanup("titleElementId",Ct),l("h2",st,{ref:ct,props:[{id:Ct},xt]})});var f6=e(t(),1);var aw=ja(function(st,ct){let{render:gt,className:bt,style:yt,disabled:vt=!1,nativeButton:xt=!0,id:wt,payload:Ct,handle:St,...Et}=st,kt=Oi(!0),Tt=sl(St)??kt;if(!Tt)throw Error(c(79));let Pt=Cr(wt),Mt=Tt.useState("floatingRootContext"),It=Tt.useState("isOpenedByTrigger",Pt),At=Tt.useState("triggerPopupId",Pt),Nt=f6.useRef(null),{registerTrigger:Ot,isMountedByThisTrigger:Dt}=el(Pt,Nt,Tt,{payload:Ct}),{getButtonProps:_t,buttonRef:$t}=P({disabled:vt,native:xt}),Ft=Lp(Mt),Bt=ah(()=>Tt.select("open"),(Wt)=>{Tt.set("openMethod",Wt)}),Lt={disabled:vt,open:It},Vt=Tt.useState("triggerProps",Dt);return l("button",st,{state:Lt,ref:[$t,ct,Ot,Nt],props:[Ft.reference,Vt,Bt,{[of]:"",id:Pt,"aria-haspopup":"dialog","aria-expanded":It,"aria-controls":At},Et,_t],stateAttributesMapping:Lc})});var Li=e(r(),1);function Tu({...ot}){return Li.jsx(p6,{"data-slot":"dialog",...ot})}function mc({...ot}){return Li.jsx(aw,{"data-slot":"dialog-trigger",...ot})}function qae({...ot}){return Li.jsx(Zs,{portal:rw,"data-slot":"dialog-portal",...ot})}function zh({...ot}){return Li.jsx(Zx,{"data-slot":"dialog-close",...ot})}function Qae({className:ot,...st}){return Li.jsx(Yx,{"data-slot":"dialog-overlay",className:u("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",ot),...st})}function om({className:ot,children:st,showCloseButton:ct=!0,...gt}){return Li.jsxs(qae,{children:[Li.jsx(Qae,{}),Li.jsxs(nw,{"data-slot":"dialog-content",className:u("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none sm:max-w-sm 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",ot),...gt,children:[st,ct&&Li.jsxs(zh,{render:Li.jsx(a,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4"}),children:[Li.jsx(zo,{stroke:1.75}),Li.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Pu({className:ot,...st}){return Li.jsx(sw,{"data-slot":"dialog-title",className:u("text-lg font-semibold",ot),...st})}function im({className:ot,...st}){return Li.jsx(ew,{"data-slot":"dialog-description",className:u("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",ot),...st})}var C6=e(t(),1);var lw=e(t(),1);var g6="data-valid",h6="data-invalid";var b6={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Xae={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},y6={disabled:!1,...Xae},Iu={valid(ot){if(ot===null)return null;if(ot)return{[g6]:""};return{[h6]:""}}};var Yae={invalid:void 0,name:void 0,validityData:{state:b6,errors:[],error:"",value:"",initialValue:null},setValidityData:w,disabled:void 0,setTouched:w,setDirty:w,setFilled:w,setFocused:w,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:y6,registerFieldControl:w,validation:{getValidationProps:(ot,st=g)=>st,inputRef:{current:null},registeredInputs:new Map,registerInput:w,getInputControl:()=>null,commit:async()=>{},change:w}},Zae=lw.createContext(Yae);function la(ot=!0){let st=lw.useContext(Zae);if(st.setValidityData===w&&!ot)throw Error(c(28));return st}var cw=e(t(),1);var ele=cw.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:w,validationMode:"onSubmit",submitCountRef:{current:0}});function Mu(){return cw.useContext(ele)}var uw=e(t(),1);var tle=uw.createContext({controlId:void 0,registerControlId:w,resetControlId:w,labelId:void 0,setLabelId:w,messageIds:[],setMessageIds:w,getDescriptionProps:(ot)=>ot});function xl(){return uw.useContext(tle)}var pw=e(t(),1),nle=pw.createContext({disabled:!1});function v6(){return pw.useContext(nle)}var dw=e(t(),1);var nd=e(t(),1);function ms({controlled:ot,default:st,name:ct,state:gt="value"}){let{current:bt}=nd.useRef(ot!==void 0),[yt,vt]=nd.useState(st),xt=bt&&ot!==void 0?ot:yt,wt=nd.useCallback((Ct)=>{if(!bt)vt(Ct)},[]);return[xt,wt]}function Au(ot,st,ct,gt,bt=!0,yt){let{registerFieldControl:vt}=la(),xt=I(()=>Symbol());i(()=>{let wt=xt.current;if(!bt){vt(wt,void 0);return}vt(wt,{controlRef:ot,getValue:gt,id:st,name:yt,value:ct})},[ot,bt,gt,st,yt,vt,xt,ct]),i(()=>{let wt=xt.current;return()=>{vt(wt,void 0)}},[vt,xt])}var VT=e(t(),1);function Nu(ot={}){let{id:st,enabled:ct=!0}=ot,{controlId:gt,registerControlId:bt,resetControlId:yt}=xl(),vt=Cr(),xt=I(()=>Symbol()),wt=VT.useRef(!1),Ct=VT.useRef(!1),St=s(()=>{if(!wt.current||bt===w)return;wt.current=!1,bt(xt.current,void 0)});return i(()=>{if(!ct||bt===w){St();return}let Et;if(st!==void 0)Ct.current=!0,Et=st;else if(Ct.current)Et=vt;else{yt();return}if(Et===void 0){St();return}wt.current=!0,bt(xt.current,Et);return},[st,ct,bt,yt,vt,xt,St]),i(()=>St,[St]),(ct?gt:void 0)??st??vt}var x6=dw.forwardRef(function(st,ct){let{render:gt,className:bt,id:yt,name:vt,value:xt,disabled:wt=!1,onValueChange:Ct,defaultValue:St,autoFocus:Et=!1,style:kt,...Rt}=st,{state:Tt,name:Pt,disabled:Mt,setTouched:It,setDirty:At,validityData:Nt,setFocused:Ot,setFilled:Dt,validationMode:_t,validation:$t}=la(),{clearErrors:Ft,elementRef:Bt,submitCountRef:Lt}=Mu(),Vt=Mt||wt,Wt=Pt??vt,Ut={...Tt,disabled:Vt},{labelId:Ht}=xl(),Gt=Nu({id:yt}),[jt]=ms({controlled:xt,default:St,name:"FieldControl",state:"value"}),qt=xt!==void 0,Qt=qt?jt:void 0,Xt=Qt==null?void 0:String(Qt),zt=s(()=>$t.inputRef.current?.value);Au($t.inputRef,Gt,Xt,zt,!Vt,vt),i(()=>{let an=Xt??$t.inputRef.current?.value;if(an!==void 0)Dt(an!=="")},[Xt,$t.inputRef,Dt]),dl(Xt,()=>{if(Xt===void 0)return;Ft(Wt),At(Xt!==(Nt.initialValue??"")),$t.change(Xt)});let tn=dw.useRef(null),rn=Xr();return i(()=>{if(Et&&tn.current===Kr(d(tn.current)))Ot(!0)},[Et,Ot]),l("input",st,{ref:[ct,tn],state:Ut,props:[{id:Gt,disabled:Vt,name:Wt,ref:$t.inputRef,"aria-labelledby":Ht,autoFocus:Et,...qt?{value:Qt}:{defaultValue:St},onChange(an){let ln=an.currentTarget.value,Zt=Ln(ec,an.nativeEvent);if(Ct?.(ln,Zt),qt)return;if(At(ln!==(Nt.initialValue??"")),Dt(ln!==""),!an.nativeEvent.defaultPrevented&&!Zt.isCanceled)Ft(Wt),$t.change(ln)},onFocus(){Ot(!0)},onBlur(an){if(It(!0),Ot(!1),_t==="onBlur"){let ln=an.currentTarget.value;if($t.commit(ln),qt)queueMicrotask(()=>{let Zt=$t.inputRef.current?.value;if(Zt!==void 0&&Zt!==ln&&Zt!==(Nt.initialValue??""))$t.commit(Zt)})}},onKeyDown(an){if(an.currentTarget.tagName==="INPUT"&&an.key==="Enter"){It(!0);let ln=an.currentTarget.value,Zt=an.currentTarget.form;if(Zt&&Zt===Bt.current&&!an.defaultPrevented){let on=an.currentTarget,sn=Lt.current;rn.start(0,()=>{if(Lt.current===sn)$t.commit(on.value)})}else $t.commit(ln)}}},Rt,(an)=>$t.getValidationProps(Vt,an)],stateAttributesMapping:Iu})});var S6=e(r(),1),$h=C6.forwardRef(function(st,ct){return S6.jsx(x6,{ref:ct,...st})});var E6=e(r(),1);function wl({className:ot,type:st,...ct}){return E6.jsx($h,{type:st,"data-slot":"input",className:u("h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base 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",ot),...ct})}function k6(ot){if(!ot.trim())return"Workspace name is required";if(ot.length>100)return"Workspace name is too long (max 100 characters)";return null}var sm=["claude-code","codex","openclaw","hermes"];var P6=e(t(),1);var R6="/floppy-disk-wmjs0n85.webp";var hr=e(r(),1);function am({trigger:ot,open:st,onOpenChange:ct}){return hr.jsxs(Tu,{open:st,onOpenChange:ct,children:[ot&&hr.jsx(mc,{render:ot}),hr.jsx(ile,{})]})}var T6=2;function ole({demoInstallUrl:ot}){let st=P6.useRef(null);return hr.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(bt)=>{if(!st.current)return;let yt=bt.currentTarget.getBoundingClientRect(),vt=(bt.clientX-yt.left)/yt.width-0.5,xt=(bt.clientY-yt.top)/yt.height-0.5;st.current.style.setProperty("--floppy-x",`${vt*-2*T6}px`),st.current.style.setProperty("--floppy-y",`${xt*-2*T6}px`)},onMouseLeave:()=>{st.current?.style.removeProperty("--floppy-x"),st.current?.style.removeProperty("--floppy-y")},children:hr.jsxs("a",{ref:st,href:ot,target:"_blank",rel:"noreferrer",className:"group absolute top-1/2 left-1/2 w-40 -translate-x-1/2 -translate-y-1/2 rotate-4 [transform:translate3d(var(--floppy-x,0px),var(--floppy-y,0px),0)] rounded-lg transition-transform duration-150 ease-out will-change-transform outline-none focus-visible:ring-3 focus-visible:ring-ring/50 motion-reduce:transform-none motion-reduce:transition-none md:w-36",children:[hr.jsx("img",{src:R6,alt:"",className:"w-full drop-shadow-xl"}),hr.jsxs("div",{className:X({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About Moi",hr.jsx(Pe,{"data-icon":"inline-end",stroke:1.5})]})]})})}function ile(){let{demoInstallUrl:ot}=R();return hr.jsxs(om,{"data-vivid":!0,showCloseButton:!1,className:"block w-full max-w-md overflow-hidden rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground sm:max-w-md md:max-w-2xl",children:[hr.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklch,var(--background)_14%,transparent),color-mix(in_oklch,var(--background)_6%,transparent))]"}),hr.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[hr.jsx("filter",{id:"floppy-grain",children:hr.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),hr.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),hr.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[hr.jsxs("div",{className:"rounded-xl bg-background p-6 text-foreground shadow-sm md:p-8",children:[hr.jsxs("div",{className:"flex flex-col gap-0.5",children:[hr.jsx(Pu,{children:"Set up your personal Moi"}),hr.jsx(im,{className:"mt-1",children:"This is a demo workspace. Sign in and connect your agent to unlock all features."})]}),hr.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[hr.jsxs("li",{className:"flex items-center gap-3",children:[hr.jsx(H0,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),hr.jsx("span",{className:"text-sm text-foreground",children:"Create without limits building as many workspaces as you want"})]}),hr.jsxs("li",{className:"flex items-center gap-3",children:[hr.jsx(XL,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),hr.jsx("span",{className:"text-sm text-foreground",children:"Share what you've built with anyone"})]}),hr.jsxs("li",{className:"flex items-center gap-3",children:[hr.jsx(vL,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),hr.jsxs("span",{className:"text-sm text-foreground",children:["Use your"," ",hr.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[hr.jsx("img",{src:tx,alt:"",className:"size-3.5 self-center object-contain"}),hr.jsx("strong",{className:"font-medium",children:"Claude"})]})," ","or"," ",hr.jsxs("span",{className:"inline-flex items-baseline gap-1",children:[hr.jsx("img",{src:nx,alt:"",className:"size-3.5 self-center object-contain"}),hr.jsx("strong",{className:"font-medium",children:"ChatGPT"})]})," ","subscription and app connectors"]})]})]}),hr.jsxs(a,{render:hr.jsx("a",{href:"/cloud/login"}),className:"mt-6",children:["Sign in",hr.jsx(L0,{"data-icon":"inline-end",stroke:1.5})]})]}),hr.jsx(ole,{demoInstallUrl:ot})]}),hr.jsx(zh,{render:hr.jsx(a,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:hr.jsx(zo,{stroke:1.5})})})]})}var Du=e(t(),1);var I6=e(t(),1);var M6=e(r(),1);function fw({className:ot,onBlur:st,onFocus:ct,onKeyDown:gt,onValueChange:bt,onValueCommit:yt,selectOnFocus:vt,...xt}){let wt=I6.useRef(null);function Ct(kt){let Rt=wt.current!==null;if(wt.current=null,st?.(kt),!kt.defaultPrevented&&Rt)yt?.(kt.currentTarget.value)}function St(kt){if(wt.current=kt.currentTarget.value,vt){let Rt=kt.currentTarget;Rt.select(),requestAnimationFrame(()=>{Rt.scrollLeft=0})}ct?.(kt)}function Et(kt){if(gt?.(kt),kt.defaultPrevented)return;if(kt.key==="Enter")kt.preventDefault(),kt.currentTarget.blur();else if(kt.key==="Escape"){kt.preventDefault();let Rt=wt.current??kt.currentTarget.value;wt.current=null,kt.currentTarget.value=Rt,bt?.(Rt),kt.currentTarget.blur()}}return M6.jsx($h,{"data-slot":"inline-input",className:n("-ml-2 [field-sizing:content] w-auto max-w-full min-w-0 rounded-md bg-transparent px-2 py-0.5 text-sm shadow-none outline-none focus:[field-sizing:fixed] focus:w-full focus-visible:border-ring focus-visible:bg-accent disabled:pointer-events-none",ot),onBlur:Ct,onChange:(kt)=>bt?.(kt.target.value),onFocus:St,onKeyDown:Et,...xt})}var Wh=e(r(),1);function mw({name:ot="Workspace",onNameChange:st,onNameCommit:ct,renderIcon:gt,...bt}){let yt=Wh.jsx(yl,{...bt,className:"size-10 rounded-lg"});return Wh.jsxs("div",{className:"flex max-w-full min-w-0 flex-1 items-center gap-4",children:[gt?gt(yt):yt,Wh.jsx(fw,{"aria-label":"Workspace name",value:ot,onValueChange:st,onValueCommit:ct,readOnly:!st,tabIndex:st?void 0:-1,className:n("min-w-0 truncate text-3xl font-semibold md:text-3xl",!st&&"pointer-events-none")})]})}var lm=e(r(),1),A6=["Welcome to","This is","Make yourself at home in","A fresh start in","Good to see you in"],gw;function N6(ot){gw=ot}function D6(ot){let[st,ct]=Du.useState(()=>gw===ot);return Du.useEffect(()=>{if(gw===ot)gw=void 0;if(!st)return;let gt=setTimeout(()=>ct(!1),3000);return()=>clearTimeout(gt)},[ot,st]),st}function _6({name:ot="Workspace",icon:st,...ct}){let[gt]=Du.useState(()=>A6[Math.floor(Math.random()*A6.length)]),[bt]=Du.useState(()=>{let xt=[...vh];return Array.from({length:4},()=>xt.splice(Math.floor(Math.random()*xt.length),1)[0])}),[yt,vt]=Du.useState(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?4:0);return Du.useEffect(()=>{if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let xt=[500,1000,1500,2000].map((wt,Ct)=>setTimeout(()=>vt(Ct+1),wt));return()=>xt.forEach(clearTimeout)},[]),lm.jsx("div",{"aria-label":"Workspace welcome",className:"flex flex-1 items-center justify-center p-6 text-center",children:lm.jsxs("div",{className:"flex min-w-0 flex-col items-center gap-1",children:[lm.jsx("p",{className:"text-sm text-muted-foreground",children:gt}),lm.jsx(mw,{...ct,name:ot,icon:yt<4?{type:"glyph",value:bt[yt]}:st})]})})}var z6=e(t(),1);var O6=e(r(),1);function Bs({className:ot,...st}){return O6.jsx("div",{"data-slot":"skeleton",className:u("animate-pulse rounded-lg bg-accent",ot),...st})}var GT=e(r(),1);function L6({types:ot}){let st=ot.map((ct)=>aa[ct]).join(", ");return GT.jsx("span",{role:"img","aria-label":st,className:"inline-flex shrink-0 items-center -space-x-0.5",children:ot.map((ct)=>GT.jsx("img",{src:Os[ct],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},ct))})}function rd(ot){if("types"in ot)return ot.path.split("/").pop()||ot.path;if(ot.name)return ot.name;if(ot.type==="openclaw")return ot.agentId??"OpenClaw agent";if(ot.type==="hermes")return ot.agentId??"Hermes agent";return ot.path.split("/").pop()||ot.path}var B6={"claude-code":{reason:"Run in terminal to install Claude:",command:"curl -fsSL https://claude.ai/install.sh | bash"},codex:{reason:"Run in terminal to install ChatGPT:",command:"curl -fsSL https://chatgpt.com/codex/install.sh | sh"},openclaw:{reason:"Run in terminal to connect OpenClaw:",command:"moi openclaw init"},hermes:{reason:"Run in terminal to connect Hermes:",command:"moi hermes init"}};var F6={"claude-code":{importOnly:!1},codex:{importOnly:!1},openclaw:{importOnly:!0},hermes:{importOnly:!0}};function hw(ot,st=[]){if(!ot)return[];let ct=(gt)=>{let bt=ot[gt].availability;return bt.status!=="unavailable"||bt.code!=="not-installed"};return sm.filter((gt)=>ct(gt)||!F6[gt].importOnly).map((gt)=>{let bt=F6[gt],yt=B6[gt],vt=!ct(gt)||bt.importOnly&&!st.includes(gt);return{type:gt,description:_h[gt],disabled:vt,disabledReason:vt?yt.reason:void 0,disabledCommand:vt?yt.command:void 0}})}function H6(ot,st){let ct=ot.find((gt)=>gt.type===st);if(ct&&!ct.disabled)return ct.type;return ot.find((gt)=>!gt.disabled)?.type}var Ji=e(r(),1),sle="Choose the agent to build the workspace";function bw({title:ot,selectedType:st,options:ct,isLoading:gt=!1,isPending:bt,errorMessage:yt,emptyMessage:vt,secondaryAction:xt,primaryLabel:wt,pendingLabel:Ct,onTypeChange:St,onSubmit:Et}){let kt=H6(ct,st),Rt=kt!==st;return z6.useEffect(()=>{if(!bt&&kt&&Rt)St(kt)},[bt,St,kt,Rt]),Ji.jsxs("div",{className:"flex min-w-[min(22rem,calc(100vw-5rem))] flex-col gap-5",children:[Ji.jsxs("div",{className:"flex w-0 min-w-full flex-col gap-0.5 pr-8",children:[Ji.jsx(Pu,{children:ot}),Ji.jsx(im,{children:sle})]}),Ji.jsx("div",{className:"flex flex-col gap-4",children:gt?Ji.jsxs("div",{className:"flex flex-wrap justify-center gap-2",role:"status","aria-label":"Checking installed agents",children:[Ji.jsx(Bs,{className:"h-32 min-w-32 flex-1"}),Ji.jsx(Bs,{className:"h-32 min-w-32 flex-1"})]}):Ji.jsx(zx,{disabled:bt,options:ct,selectedType:Rt?void 0:st,onTypeChange:St})}),yt&&Ji.jsx("p",{role:"alert",className:"w-0 min-w-full text-xs text-destructive",children:yt}),vt&&!kt&&!bt&&!yt&&Ji.jsx("p",{className:"w-0 min-w-full text-sm text-muted-foreground",children:vt}),Ji.jsxs("div",{className:"flex items-center justify-end gap-2",children:[xt,Ji.jsx(a,{onClick:Et,disabled:bt||Rt,children:bt&&Ct?Ct:wt})]})]})}var $6=e(r(),1);function yw({children:ot,showCloseButton:st=!0}){return $6.jsx(om,{showCloseButton:st,className:"block max-h-[calc(100dvh-2rem)] w-max max-w-[calc(100vw-2rem)] overflow-y-auto p-6 sm:max-w-[calc(100vw-2rem)]",children:ot})}var vo=e(r(),1),W6=sm[0];function jh({trigger:ot}){let[,st]=Ai(),ct=R(),gt=tm(),bt=Vx(),[yt,vt]=Uh.useState(!1),[xt,wt]=Uh.useState("name"),[Ct,St]=Uh.useState(W6),[Et,kt]=Uh.useState(""),Rt=Et.trim(),Tt=Rt?k6(Rt):null,Pt=bt.isPending,Mt=gt.isPending||gt.isFetching,It=gt.isError?void 0:gt.data,At=hw(It),Nt=At.some((Lt)=>Lt.type===Ct&&!Lt.disabled),Ot=!Mt&&!It?"Could not check installed agents.":void 0,Dt=!Mt&&!Ot&&Nt;if(ct.demo)return vo.jsx(am,{trigger:ot});function _t(Lt){N6(Lt),vt(!1),st(`/workspace/${Lt}`)}function $t(){wt("name"),St(W6),kt(""),bt.reset()}function Ft(){if(!Rt||Tt)return;bt.reset(),wt("agent")}function Bt(){if(!Rt||Tt||Pt||!Dt)return;bt.reset(),bt.mutate({name:Rt,type:Ct},{onSuccess:(Lt)=>_t(Lt.id)})}return vo.jsxs(Tu,{open:yt,onOpenChange:(Lt)=>{if(!Lt&&Pt)return;if(vt(Lt),Lt)gt.refetch({cancelRefetch:!1})},onOpenChangeComplete:(Lt)=>{if(!Lt)$t()},children:[vo.jsx(mc,{render:ot}),vo.jsx(yw,{showCloseButton:!Pt,children:xt==="name"?vo.jsx(ale,{name:Et,showExistingFolder:ct.environment==="local",validationError:Tt,onNameChange:kt,onSubmit:Ft}):vo.jsx(bw,{title:"Create new workspace",selectedType:Ct,options:At,isLoading:Mt&&!It,errorMessage:Ot??bt.error?.message,emptyMessage:"Install at least one agent to create a new workspace",isPending:Pt||Mt||Boolean(Ot),secondaryAction:vo.jsx(a,{variant:"secondary",disabled:Pt,onClick:()=>wt("name"),children:"Back"}),primaryLabel:"Create workspace",pendingLabel:Pt?"Creating…":void 0,onTypeChange:St,onSubmit:Bt})})]})}function ale({name:ot,showExistingFolder:st,validationError:ct,onNameChange:gt,onSubmit:bt}){function yt(vt){vt.preventDefault(),bt()}return vo.jsxs("form",{className:"flex min-w-[min(22rem,calc(100vw-5rem))] flex-col gap-5",onSubmit:yt,children:[vo.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[vo.jsx(Pu,{children:"Create new workspace"}),vo.jsx(im,{children:"Give it a short and recognizable name"})]}),vo.jsxs("div",{className:"flex flex-col gap-2",children:[vo.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),vo.jsx(wl,{id:"workspace-name",value:ot,onChange:(vt)=>gt(vt.target.value),placeholder:"Workspace name",autoFocus:!0,"aria-invalid":Boolean(ct),"aria-describedby":ct?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),ct&&vo.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:ct})]}),vo.jsxs("div",{className:"flex items-center justify-end gap-2",children:[st&&vo.jsx(lle,{}),vo.jsx(a,{type:"submit",disabled:!ot.trim()||Boolean(ct),children:"Continue"})]})]})}function lle(){return vo.jsxs(Wr,{children:[vo.jsx(Ur,{render:vo.jsx(a,{variant:"secondary","aria-disabled":!0,onClick:(st)=>st.preventDefault(),className:"cursor-not-allowed bg-accent text-muted-foreground hover:bg-accent",children:"Use existing folder"})}),vo.jsx(jr,{className:"max-w-64",children:vo.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",vo.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:"moi init"})," ","in the folder from your console to add it"]})})]})}var vw=e(t(),1),KT=vw.createContext(void 0);function cm(ot){let st=vw.useContext(KT);if(st===void 0&&!ot)throw Error(c(33));return st}var xw=e(t(),1),qT=xw.createContext(void 0);function gs(ot){let st=xw.useContext(qT);if(st===void 0&&!ot)throw Error(c(36));return st}var ww=e(t(),1),cle=ww.createContext(void 0);function um(ot=!0){let st=ww.useContext(cle);if(st===void 0&&!ot)throw Error(c(25));return st}var pm=e(t(),1);var U6=e(t(),1);function j6(ot){let{closeOnClick:st,highlighted:ct,id:gt,nodeId:bt,store:yt,typingRef:vt,itemRef:xt,itemMetadata:wt}=ot,{events:Ct}=yt.useState("floatingTreeRoot"),St=yt.useState("open"),Et=um(!0),kt=Et!==void 0;return U6.useMemo(()=>({id:gt,role:"menuitem",tabIndex:St&&ct?0:-1,onKeyDown(Rt){if(Rt.key===" "&&vt?.current)Rt.preventDefault()},onMouseMove(Rt){if(!bt)return;Ct.emit("itemhover",{nodeId:bt,target:Rt.currentTarget})},onClick(Rt){if(st)Ct.emit("close",{domEvent:Rt,reason:nk})},onMouseUp(Rt){if(Et){let Tt=Et.initialCursorPointRef.current;if(Et.initialCursorPointRef.current=null,kt&&Tt&&Math.abs(Rt.clientX-Tt.x)<=1&&Math.abs(Rt.clientY-Tt.y)<=1)return;if(kt&&!Ql.mac&&Rt.button===2)return}if(xt.current&&yt.context.allowMouseUpTriggerRef.current&&(!kt||Rt.button===2)){if(wt.type==="regular-item")re(xt.current,Rt,{detail:1})}}}),[st,ct,gt,Ct,bt,St,yt,vt,xt,Et,kt,wt])}var Cw={type:"regular-item"};function Sw(ot){let{closeOnClick:st,disabled:ct,highlighted:gt,id:bt,store:yt,typingRef:vt=yt.context.typingRef,nativeButton:xt,itemMetadata:wt,nodeId:Ct}=ot,St=pm.useRef(null),{getButtonProps:Et,buttonRef:kt}=P({disabled:ct,focusableWhenDisabled:!0,native:xt,composite:!0}),Rt=j6({closeOnClick:st,highlighted:gt,id:bt,nodeId:Ct,store:yt,typingRef:vt,itemRef:St,itemMetadata:wt}),Tt=pm.useCallback((Mt)=>O(Rt,{onMouseEnter(){if(wt.type!=="submenu-trigger")return;wt.setActive()}},Mt,Et),[Rt,Et,wt]),Pt=L(St,kt);return pm.useMemo(()=>({getItemProps:Tt,itemRef:Pt}),[Tt,Pt])}var od=e(t(),1);var Ew=e(t(),1),QT=Ew.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function V6(){return Ew.useContext(QT)}function Cl(ot={}){let{guess:st,label:ct,metadata:gt,textRef:bt,index:yt}=ot,{register:vt,unregister:xt,subscribeMapChange:wt,nextIndexRef:Ct}=V6(),St=od.useRef(-1),[Et,kt]=od.useState(yt==null&&st?()=>{if(St.current===-1){let Mt=Ct.current;Ct.current+=1,St.current=Mt}return St.current}:-1),Rt=yt??Et,Tt=od.useRef(null),Pt=od.useCallback((Mt)=>{let It=Tt.current;if(It)xt(It);if(Tt.current=Mt,Mt)vt(Mt,{metadata:gt??null,index:yt??null,label:ct,textRef:bt})},[yt,vt,xt,gt,ct,bt]);return i(()=>{if(yt!=null)return;return wt((Mt)=>{let It=Tt.current?Mt.get(Tt.current)?.index:null;if(It!=null)kt(It)})},[yt,wt]),{ref:Pt,index:Rt}}var G6="data-checked",K6="data-unchecked";var kw={checked(ot){if(ot)return{[G6]:""};return{[K6]:""}},...fi};var Tw=e(t(),1);var Rw=e(t(),1),Vh=Rw.createContext(void 0);function q6(){let ot=Rw.useContext(Vh);if(ot===void 0)throw Error(c(31));return ot}var Q6=e(r(),1),J6=Tw.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,...vt}=st,[xt,wt]=Tw.useState(void 0),Ct=l("div",st,{ref:ct,props:{role:"group","aria-labelledby":xt,...vt}});return Q6.jsx(Vh.Provider,{value:wt,children:Ct})});var X6=e(t(),1);var Y6=X6.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,id:vt,...xt}=st,wt=Cr(vt),Ct=q6();return i(()=>(Ct(wt),()=>{Ct((St)=>St===wt?void 0:St)}),[Ct,wt]),l("div",st,{ref:ct,props:{id:wt,"aria-hidden":!0,...xt}})});var Z6=e(t(),1);var eH=Z6.forwardRef(function(st,ct){let{render:gt,className:bt,id:yt,label:vt,nativeButton:xt=!1,disabled:wt=!1,closeOnClick:Ct=!0,style:St,...Et}=st,kt=Cl({guess:!0,label:vt}),Rt=cm(!0),Tt=Cr(yt),{store:Pt}=gs(),Mt=Pt.useState("disabled"),It=wt||Mt,At=Pt.useState("isActive",kt.index),Nt=Pt.useState("itemProps"),{getItemProps:Ot,itemRef:Dt}=Sw({closeOnClick:Ct,disabled:It,highlighted:At,id:Tt,store:Pt,nativeButton:xt,nodeId:Rt?.context.nodeId,itemMetadata:Cw});return l("div",st,{state:{disabled:It,highlighted:At},props:[Nt,Et,Ot],ref:[Dt,ct,kt.ref]})});var Pw=e(t(),1);var tH=e(r(),1),nH=Pw.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,finalFocus:vt,...xt}=st,{store:wt}=gs(),{side:Ct,align:St}=cm(),Et=Sv(!0)!=null,kt=wt.useState("open"),Rt=wt.useState("transitionStatus"),Tt=wt.useState("popupProps"),Pt=wt.useState("mounted"),Mt=wt.useState("instantType"),It=wt.useState("activeTriggerElement"),At=wt.useState("parent"),Nt=wt.useState("lastOpenChangeReason"),Ot=wt.useState("rootId"),Dt=wt.useState("floatingRootContext"),_t=wt.useState("floatingTreeRoot"),$t=wt.useState("closeDelay"),Ft=wt.useState("hoverEnabled"),Bt=wt.useState("disabled"),Lt=wt.useState("openMethod"),Vt=At.type==="context-menu";Ro({open:kt,ref:wt.context.popupRef,onComplete(){if(kt)wt.context.onOpenChangeComplete?.(!0)}}),Pw.useEffect(()=>{function jt(qt){wt.setOpen(!1,Ln(qt.reason,qt.domEvent))}return _t.events.on("close",jt),()=>{_t.events.off("close",jt)}},[_t.events,wt]),rc(Dt,{enabled:Ft&&!Bt&&!Vt&&At.type!=="menubar",closeDelay:$t});let Wt=wt.useStateSetter("popupElement"),Ut={transitionStatus:Rt,side:Ct,align:St,open:kt,nested:At.type==="menu",instant:Mt},Ht=l("div",st,{state:Ut,ref:[ct,wt.context.popupRef,Wt],stateAttributesMapping:Va,props:[Tt,{onKeyDown(jt){if(Et&&Pa.has(jt.key))jt.stopPropagation()}},cl(Rt),xt,{"data-rootownerid":Ot}]}),Gt=At.type===void 0||Vt;if(It||At.type==="menubar"&&Nt!==tk)Gt=!0;return tH.jsx(Op,{context:Dt,openInteractionType:Lt,modal:Vt,disabled:!Pt,returnFocus:vt===void 0?Gt:vt,initialFocus:At.type!=="menu",restoreFocus:!0,externalTree:At.type!=="menubar"?_t:void 0,previousFocusableElement:It,nextFocusableElement:At.type===void 0?wt.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:At.type===void 0?wt.context.beforeContentFocusGuardRef:void 0,children:Ht})});var oH=e(t(),1);var Iw=e(t(),1),JT=Iw.createContext(void 0);function rH(){let ot=Iw.useContext(JT);if(ot===void 0)throw Error(c(32));return ot}var XT=e(r(),1),iH=oH.forwardRef(function(st,ct){let{keepMounted:gt=!1,...bt}=st,{store:yt,parent:vt}=gs();if(!(yt.useState("mounted")||gt))return null;let Ct=vt.type==="menu"||vt.type==="menubar"?"group":void 0;return XT.jsx(JT.Provider,{value:gt,children:XT.jsx(Ap,{ref:ct,...bt,portalOwnerRole:Ct})})});var Sl=e(t(),1);var gc=e(t(),1);var sH=e(r(),1);function _u(ot){let{children:st,elementsRef:ct,labelsRef:gt,onMapChange:bt}=ot,yt=s(bt),[,vt]=gc.useState(!1),xt=I(dle).current,wt=I(ple).current,Ct=gc.useRef(0),St=gc.useRef(!0),Et=gc.useRef(null),kt=gc.useRef(null),Rt=s(()=>{if(St.current)return;St.current=!0,vt((Dt)=>!Dt)}),Tt=s((Dt,_t)=>{wt.set(Dt,_t),Rt()}),Pt=s((Dt)=>{wt.delete(Dt),Rt()}),Mt=s((Dt)=>{let _t=new Map;if(ct.current.length=0,gt)gt.current.length=0;return Dt.forEach(($t)=>{if(_t.set($t.element,{...$t.registration.metadata??{},index:$t.index}),ct.current[$t.index]=$t.element,gt)gt.current[$t.index]=$t.registration.label!==void 0?$t.registration.label:$t.registration.textRef?.current?.textContent??$t.element.textContent}),Ct.current=ct.current.length,_t});function It(Dt){if(kt.current?.disconnect(),kt.current=null,typeof MutationObserver!=="function"||Dt.length<2)return;let _t=new MutationObserver((Ft)=>{if(!gle(Ft))return;let Bt=null;for(let Lt of Dt){if(!Lt.isConnected)continue;if(Bt&&aH(Bt,Lt)>0){_t.disconnect(),Rt();return}Bt=Lt}});kt.current=_t;let $t=new Set;for(let Ft=1;Ft<Dt.length;Ft+=1){let Bt=mle(Dt[Ft-1],Dt[Ft]);if(Bt)$t.add(Bt)}$t.forEach((Ft)=>_t.observe(Ft,{childList:!0}))}let At=s(()=>{let[Dt,_t]=fle(wt),$t=Mt(Dt),Ft=Et.current,Bt=!Ft||Ft.length!==Dt.length||Dt.some((Lt,Vt)=>{let Wt=Ft[Vt];return Lt.index!==Wt.index||Lt.element!==Wt.element||Lt.registration.index!==Wt.registration.index||Lt.registration.metadata!==Wt.registration.metadata});if(It(_t),Et.current=Dt,St.current=!1,!Bt)return;xt.forEach((Lt)=>Lt($t)),yt($t)});i(()=>{if(!St.current&&Et.current)Mt(Et.current);return()=>{if(ct.current=[],gt)gt.current=[]}},[ct,gt,Mt]),i(()=>{if(St.current)At()}),i(()=>()=>{kt.current?.disconnect(),St.current=!0},[]);let Nt=s((Dt)=>(xt.add(Dt),()=>{xt.delete(Dt)})),Ot=gc.useMemo(()=>({register:Tt,unregister:Pt,subscribeMapChange:Nt,nextIndexRef:Ct}),[Tt,Pt,Nt,Ct]);return sH.jsx(QT.Provider,{value:Ot,children:st})}function ple(){return new Map}function dle(){return new Set}function fle(ot){let st=new Set,ct=[],gt=[];ot.forEach((yt,vt)=>{if(!vt.isConnected)return;let xt=yt.index,wt={index:xt??-1,element:vt,registration:yt};if(xt===null)gt.push(wt);else if(xt>=0)st.add(xt),ct.push(wt)});let bt=0;if(gt.sort((yt,vt)=>aH(yt.element,vt.element)),gt.forEach((yt)=>{while(st.has(bt))bt+=1;yt.index=bt,ct.push(yt),bt+=1}),st.size>0)ct.sort((yt,vt)=>yt.index-vt.index);return[ct,gt.map((yt)=>yt.element)]}function mle(ot,st){let ct=ot.parentElement;while(ct&&!ct.contains(st))ct=ct.parentElement;return ct}function gle(ot){for(let st of ot)for(let ct=0;ct<st.removedNodes.length;ct+=1)if(st.removedNodes[ct].isConnected)return!0;return!1}function aH(ot,st){return ot.compareDocumentPosition(st)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var dm=e(r(),1),lH=Sl.forwardRef(function(st,ct){let{anchor:gt,positionMethod:bt="absolute",className:yt,render:vt,side:xt,align:wt,sideOffset:Ct=0,alignOffset:St=0,collisionBoundary:Et="clipping-ancestors",collisionPadding:kt=5,arrowPadding:Rt=5,sticky:Tt=!1,disableAnchorTracking:Pt=!1,collisionAvoidance:Mt=h_,style:It,...At}=st,{store:Nt}=gs(),Ot=rH(),Dt=um(!0),_t=Nt.useState("parent"),$t=Nt.useState("floatingRootContext"),Ft=Nt.useState("floatingTreeRoot"),Bt=Nt.useState("mounted"),Lt=Nt.useState("open"),Vt=Nt.useState("modal"),Wt=Nt.useState("openMethod"),Ut=Nt.useState("activeTriggerElement"),Ht=Nt.useState("transitionStatus"),Gt=Nt.useState("positionerElement"),jt=Nt.useState("instantType"),qt=Nt.useState("adaptiveOrigin"),Qt=Nt.useState("lastOpenChangeReason"),Xt=Nt.useState("floatingNodeId"),zt=Nt.useState("floatingParentNodeId"),tn=$t.useState("domReferenceElement"),rn=Sl.useRef(null),Kt=Ja(Gt),an=gt,ln=Ct,Zt=St,on=wt,sn=Mt;if(_t.type==="context-menu"){if(an=gt??_t.context?.anchor,on=on??"start",!xt&&on!=="center")Zt=st.alignOffset??2,ln=st.sideOffset??-5}let dn=xt,fn=on;if(_t.type==="menu")dn=dn??"inline-end",fn=fn??"start",sn=st.collisionAvoidance??$c;else if(_t.type==="menubar")dn=dn??(_t.context.orientation==="vertical"?"inline-end":"bottom"),fn=fn??"start";let bn=_t.type==="context-menu",hn=Gc({anchor:an,floatingRootContext:$t,positionMethod:Dt?"fixed":bt,mounted:Bt,side:dn,sideOffset:ln,align:fn,alignOffset:Zt,arrowPadding:bn?0:Rt,collisionBoundary:Et,collisionPadding:kt,sticky:Tt,nodeId:Xt,keepMounted:Ot,disableAnchorTracking:Pt,collisionAvoidance:sn,shift:bn?{crossAxis:!(("side"in sn)&&sn.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:Ft,adaptiveOrigin:qt});Sl.useEffect(()=>{function cn(mn){if(mn.open){if(mn.parentNodeId===Xt)Nt.set("hoverEnabled",!1);if(mn.nodeId!==Xt&&mn.parentNodeId===Nt.select("floatingParentNodeId"))Nt.setOpen(!1,Ln(jg))}}return Ft.events.on("menuopenchange",cn),()=>{Ft.events.off("menuopenchange",cn)}},[Nt,Ft.events,Xt]),Sl.useEffect(()=>{if(Nt.select("floatingParentNodeId")==null)return;function cn(mn){if(mn.open||mn.nodeId!==Nt.select("floatingParentNodeId"))return;let Pn=mn.reason??jg;Nt.setOpen(!1,Ln(Pn))}return Ft.events.on("menuopenchange",cn),()=>{Ft.events.off("menuopenchange",cn)}},[Ft.events,Nt]);let gn=Xr();Sl.useEffect(()=>{if(!Lt)gn.clear()},[Lt,gn]),Sl.useEffect(()=>{function cn(mn){if(!Lt||mn.nodeId!==Nt.select("floatingParentNodeId"))return;if(mn.target&&Ut&&Ut!==mn.target){let Pn=Nt.select("closeDelay");if(Pn>0){if(!gn.isStarted())gn.start(Pn,()=>{Nt.setOpen(!1,Ln(jg))})}else Nt.setOpen(!1,Ln(jg))}else gn.clear()}return Ft.events.on("itemhover",cn),()=>{Ft.events.off("itemhover",cn)}},[Ft.events,Lt,Ut,Nt,gn]),Sl.useEffect(()=>{let cn={open:Lt,nodeId:Xt,parentNodeId:zt,reason:Nt.select("lastOpenChangeReason")};Ft.events.emit("menuopenchange",cn)},[Ft.events,Lt,Nt,Xt,zt]),i(()=>{let cn=tn,mn=rn.current;if(cn)rn.current=cn;if(mn&&cn&&cn!==mn){Nt.set("instantType",void 0);let Pn=new AbortController;return Kt(()=>{Nt.set("instantType","trigger-change")},Pn.signal),()=>{Pn.abort()}}return},[tn,Kt,Nt]);let xn={open:Lt,side:hn.side,align:hn.align,anchorHidden:hn.anchorHidden,nested:_t.type==="menu",instant:jt},wn=_t.type==="menubar"&&_t.context.modal,yn=Vt&&Qt!==Ao;vv(Lt&&(wn||yn),Wt==="touch",Gt,Ut);let nn=Kc(st,xn,{styles:hn.positionerStyles,transitionStatus:Ht,props:At,refs:[ct,Nt.useStateSetter("positionerElement")],hidden:!Bt,inert:!Lt}),en=Bt&&_t.type!=="menu"&&(_t.type!=="menubar"&&Vt&&Qt!==Ao||_t.type==="menubar"&&_t.context.modal),pn=null;if(_t.type==="menubar")pn=_t.context.contentElement;else if(_t.type===void 0)pn=Ut;return dm.jsxs(KT.Provider,{value:hn,children:[en&&dm.jsx(xf,{ref:_t.type==="context-menu"||_t.type==="nested-context-menu"?_t.context.internalBackdropRef:null,inert:Qa(!Lt),cutout:pn}),dm.jsx(Dp,{id:Xt,children:dm.jsx(_u,{elementsRef:Nt.context.itemDomElements,labelsRef:Nt.context.itemLabels,children:nn})})]})});var Ou=e(t(),1);var Mw=e(t(),1),YT=Mw.createContext(void 0);function cH(){let ot=Mw.useContext(YT);if(ot===void 0)throw Error(c(34));return ot}var ZT=e(r(),1),uH=Ou.memo(Ou.forwardRef(function(st,ct){let{render:gt,className:bt,value:yt,defaultValue:vt,onValueChange:xt,disabled:wt=!1,style:Ct,"aria-labelledby":St,...Et}=st,[kt,Rt]=Ou.useState(void 0),[Tt,Pt]=ms({controlled:yt,default:vt,name:"MenuRadioGroup"}),Mt=s((Ot,Dt)=>{if(xt?.(Ot,Dt),Dt.isCanceled)return;Pt(Ot)}),At=l("div",st,{state:{disabled:wt},ref:ct,props:{role:"group","aria-labelledby":St??kt,"aria-disabled":wt||void 0,...Et}}),Nt=Ou.useMemo(()=>({value:Tt,setValue:Mt,disabled:wt}),[Tt,Mt,wt]);return ZT.jsx(Vh.Provider,{value:Rt,children:ZT.jsx(YT.Provider,{value:Nt,children:At})})}));var Nw=e(t(),1);var Aw=e(t(),1),eP=Aw.createContext(void 0);function pH(){let ot=Aw.useContext(eP);if(ot===void 0)throw Error(c(35));return ot}var dH=e(r(),1),fH=Nw.forwardRef(function(st,ct){let{render:gt,className:bt,id:yt,label:vt,nativeButton:xt=!1,disabled:wt=!1,closeOnClick:Ct=!1,value:St,style:Et,...kt}=st,Rt=Cl({guess:!0,label:vt}),Tt=cm(!0),Pt=Cr(yt),{store:Mt}=gs(),It=Mt.useState("isActive",Rt.index),At=Mt.useState("itemProps"),{value:Nt,setValue:Ot,disabled:Dt}=cH(),_t=Mt.useState("disabled"),$t=wt||Dt||_t,Ft=Nt===St,{getItemProps:Bt,itemRef:Lt}=Sw({closeOnClick:Ct,disabled:$t,highlighted:It,id:Pt,store:Mt,nativeButton:xt,nodeId:Tt?.context.nodeId,itemMetadata:Cw}),Vt=Nw.useMemo(()=>({disabled:$t,highlighted:It,checked:Ft}),[$t,It,Ft]);function Wt(Ht){let Gt=Ln(nk,Ht.nativeEvent,void 0,{preventUnmountOnClose:w});Ot(St,Gt)}let Ut=l("div",st,{state:Vt,stateAttributesMapping:kw,props:[At,{role:"menuitemradio","aria-checked":Ft,onClick:Wt},kt,Bt],ref:[Lt,ct,Rt.ref]});return dH.jsx(eP.Provider,{value:Vt,children:Ut})});var Dw=e(t(),1);var mH=Dw.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,keepMounted:vt=!1,...xt}=st,wt=pH(),Ct=Dw.useRef(null),{transitionStatus:St,mounted:Et,setMounted:kt}=Xs(wt.checked);Ro({batch:!0,enabled:!wt.checked,open:wt.checked,ref:Ct,onComplete(){if(!wt.checked)kt(!1)}});let Rt={checked:wt.checked,disabled:wt.disabled,highlighted:wt.highlighted,transitionStatus:St};return l("span",st,{state:Rt,stateAttributesMapping:kw,ref:[ct,Ct],props:{"aria-hidden":!0,...xt},enabled:vt||Et})});var Wo=e(t(),1);var _w=e(t(),1),hle=_w.createContext(null);function Ow(ot){let st=_w.useContext(hle);if(st===null&&!ot)throw Error(c(5));return st}var Gh=e(t(),1);var ble={...il,disabled:(ot)=>ot.parent.type==="menubar"?ot.parent.context.disabled||ot.disabled:ot.disabled,modal:(ot)=>(ot.parent.type===void 0||ot.parent.type==="context-menu")&&(ot.modal??!0),openMethod:(ot)=>ot.openMethod,allowMouseEnter:(ot)=>ot.allowMouseEnter,highlightItemOnHover:(ot)=>ot.highlightItemOnHover,parent:(ot)=>ot.parent,rootId:(ot)=>{if(ot.parent.type==="menu")return ot.parent.store.select("rootId");return ot.parent.type!==void 0?ot.parent.context.rootId:ot.rootId},activeIndex:(ot)=>ot.activeIndex,isActive:(ot,st)=>ot.activeIndex===st,hoverEnabled:(ot)=>ot.hoverEnabled,instantType:(ot)=>ot.instantType,lastOpenChangeReason:(ot)=>ot.openChangeReason,floatingTreeRoot:(ot)=>{if(ot.parent.type==="menu")return ot.parent.store.select("floatingTreeRoot");return ot.floatingTreeRoot},floatingNodeId:(ot)=>ot.floatingNodeId,floatingParentNodeId:(ot)=>ot.floatingParentNodeId,itemProps:(ot)=>ot.itemProps,closeDelay:(ot)=>ot.closeDelay,adaptiveOrigin:(ot)=>ot.adaptiveOrigin,keyboardEventRelay:(ot)=>{if(ot.keyboardEventRelay)return ot.keyboardEventRelay;if(ot.parent.type==="menu")return ot.parent.store.select("keyboardEventRelay");return}};class tP extends Gi{constructor(ot,st,ct=!1){let gt=new Ta,bt=vle(gt,st,ct,ot);super(bt,yle(gt),ble);this.unsubscribeParentListener=this.observe("parent",(yt)=>{if(this.unsubscribeParentListener?.(),yt.type==="menu"){let vt=yt.store.select("rootId"),xt=yt.store.select("floatingTreeRoot"),wt=yt.store.select("keyboardEventRelay");this.unsubscribeParentListener=yt.store.subscribe(()=>{let Ct=yt.store.select("rootId"),St=yt.store.select("floatingTreeRoot"),Et=yt.store.select("keyboardEventRelay");if(vt===Ct&&xt===St&&wt===Et)return;vt=Ct,xt=St,wt=Et,this.notifyAll()}),this.context.allowMouseUpTriggerRef=yt.store.context.allowMouseUpTriggerRef;return}if(yt.type!==void 0)this.context.allowMouseUpTriggerRef=yt.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen(ot,st){this.state.floatingRootContext.context.events.emit("setOpen",{open:ot,eventDetails:st})}unsubscribeParentListener=null}function yle(ot){return{positionerRef:Gh.createRef(),popupRef:Gh.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Gh.createRef(),beforeContentFocusGuardRef:Gh.createRef(),onOpenChangeComplete:void 0,triggerElements:ot}}function vle(ot,st,ct=!1,gt){return{...ol(ot,st,ct),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Np,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:g,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...gt}}var Lw=e(t(),1),xle=Lw.createContext(void 0);function gH(){return Lw.useContext(xle)}var Kh=e(r(),1),hH=va(function(st){let{children:ct,open:gt,onOpenChange:bt,onOpenChangeComplete:yt,defaultOpen:vt=!1,disabled:xt=!1,modal:wt,loopFocus:Ct=!0,orientation:St="vertical",actionsRef:Et,closeParentOnEsc:kt=!1,handle:Rt,triggerId:Tt,defaultTriggerId:Pt=null,highlightItemOnHover:Mt=!0}=st,It=um(!0),At=gs(!0),Nt=Ow(!0),Ot=gH(),Dt=Wo.useMemo(()=>{if(Ot&&At)return{type:"menu",store:At.store};if(Nt)return{type:"menubar",context:Nt};if(It&&!At)return{type:"context-menu",context:It};return{type:void 0}},[It,At,Nt,Ot]),_t=Ts(),$t=Ts(),Ft=Ps(),Bt=Dt.type==="menu"?Dt.store:void 0,Lt=(gt??vt)&&Bt?.state.transitionStatus==="starting",Vt=I(()=>Lt?Bt?.state.instantType:void 0).current,Wt=wle({open:vt,openProp:gt,activeTriggerId:Pt,triggerIdProp:Tt,parent:Dt,disabled:xt,highlightItemOnHover:Mt,modal:Dt.type===void 0?wt:void 0,rootId:_t,instantType:Vt},$t,Ft!=null);Wt.useControlledProp("openProp",gt),Wt.useControlledProp("triggerIdProp",Tt),Wt.useContextCallback("onOpenChangeComplete",yt);let Ut=Wt.useState("floatingTreeRoot"),Ht=nc(Ut),Gt=Wt.useState("open"),jt=Wt.useState("activeTriggerElement"),qt=Wt.useState("positionerElement"),Qt=Wt.useState("hoverEnabled"),Xt=Wt.useState("disabled"),zt=Wt.useState("lastOpenChangeReason"),tn=Wt.useState("parent"),rn=Wt.useState("activeIndex"),Kt=Wt.useState("payload"),an=Wt.useState("floatingParentNodeId"),ln=Wo.useRef(null),Zt=Wo.useRef(tn.type!=="context-menu"),on=Xr(),sn=Wo.useRef(!0),dn=Xr(),fn=an!=null,{openMethod:bn,triggerProps:hn}=V5(Gt);Wt.useSyncedValues({disabled:xt,highlightItemOnHover:Mt,modal:tn.type===void 0?wt:void 0,openMethod:bn,rootId:_t}),tl(Wt);let{forceUnmount:gn,transitionStatus:xn}=nl(Gt,Wt,()=>{Wt.set("allowMouseEnter",!1)},Lt),wn=Ja(Wt.context.popupRef);Wo.useEffect(()=>{if(Vt===void 0)return;let Mn=()=>{if(Wt.state.instantType===Vt)Wt.set("instantType",void 0)};if(!Gt){Mn();return}if(xn!==void 0)return;if(Wt.context.popupRef.current==null){Mn();return}let Gn=new AbortController;return wn(Mn,Gn.signal),()=>{Gn.abort()}},[Vt,Gt,xn,wn,Wt]),i(()=>{if(It&&!At)Wt.update({parent:{type:"context-menu",context:It},floatingNodeId:Ht,floatingParentNodeId:Ft});else if(At)Wt.update({floatingNodeId:Ht,floatingParentNodeId:Ft})},[It,At,Ht,Ft,Wt]),Wo.useEffect(()=>{if(!Gt)ln.current=null;if(tn.type!=="context-menu")return;if(!Gt){on.clear(),Zt.current=!1;return}on.start(500,()=>{Zt.current=!0})},[on,Gt,tn.type]),i(()=>{if(!Gt&&!Qt)Wt.set("hoverEnabled",!0)},[Gt,Qt,Wt]);let yn=s((Mn,Gn)=>{let sr=Gn.reason;if(!Mn&&!Wt.select("open"))return;if(Gt===Mn&&Gn.trigger===jt&&zt===sr)return;let gr=Xg(Gn);if(!Mn&&Gn.trigger==null)Gn.trigger=jt??void 0;if(bt?.(Mn,Gn),Gn.isCanceled)return;Wt.state.floatingRootContext.dispatchOpenChange(Mn,Gn);let qn=Gn.event;if(Mn===!1&&qn?.type==="click"&&qn.pointerType==="touch"&&!sn.current)return;if(Mn&&sr===sf)sn.current=!1,dn.start(300,()=>{sn.current=!0});else sn.current=!0,dn.clear();let Bn=(sr===Xa||sr===nk)&&qn.detail===0,Tr=!Mn&&(sr===Ug||sr==null);ln.current=Gn.event;let lr=Bp(Wt.state,Mn,Gn.trigger,gr());if(lr.openChangeReason=sr,tn.type==="menubar"&&(sr===sf||sr===Ip||sr===Ao||sr===rk||sr===jg))lr.instantType="group";else if(Bn||Tr)lr.instantType=Bn?"click":"dismiss";else lr.instantType=void 0;Wt.update(lr)}),nn=Jg({popupStore:Wt,floatingRootContext:Wt.state.floatingRootContext,floatingId:$t,nested:Ft!=null,onOpenChange:yn}),en=nn.context.events;i(()=>{let Mn=({open:Gn,eventDetails:sr})=>yn(Gn,sr);return en.on("setOpen",Mn),()=>{en?.off("setOpen",Mn)}},[en,yn]);let pn=Wo.useCallback(()=>{Wt.setOpen(!1,Ln(Vg))},[Wt]);Wo.useImperativeHandle(Et,()=>({unmount:gn,close:pn}),[gn,pn]);let cn;if(tn.type==="context-menu")cn=tn.context;Wo.useImperativeHandle(cn?.positionerRef,()=>qt,[qt]),Wo.useImperativeHandle(cn?.actionsRef,()=>({setOpen:yn}),[yn]);let mn=Ra(nn,{enabled:!Xt,bubbles:{escapeKey:kt&&tn.type==="menu"},outsidePress(){if(tn.type!=="context-menu"||ln.current?.type==="contextmenu")return!0;return Zt.current},externalTree:fn?Ut:void 0}),Pn=ll(),Rn=Wo.useCallback((Mn)=>{if(Wt.select("activeIndex")===Mn)return;Wt.set("activeIndex",Mn)},[Wt]),Cn=kk(nn,{enabled:!Xt,listRef:Wt.context.itemDomElements,activeIndex:rn,nested:tn.type!==void 0,loopFocus:Ct,orientation:St,parentOrientation:tn.type==="menubar"?tn.context.orientation:void 0,rtl:Pn==="rtl",disabledIndices:z,onNavigate:Rn,openOnArrowKeyDown:tn.type!=="context-menu",externalTree:fn?Ut:void 0,focusItemOnHover:Mt}),kn=Wo.useCallback((Mn)=>{Wt.context.typingRef.current=Mn},[Wt]),Jt=Rk(nn,{enabled:!Xt,listRef:Wt.context.itemLabels,elementsRef:Wt.context.itemDomElements,activeIndex:rn,resetMs:d_,onMatch:(Mn)=>{if(Gt&&Mn!==rn)Wt.set("activeIndex",Mn)},onTyping:kn}),Yt=Wo.useMemo(()=>{let Mn=O(Jt.reference,Cn.reference,mn.reference,{onMouseMove(){Wt.set("allowMouseEnter",!0)}},hn);return Mn["aria-haspopup"]="menu",Mn["aria-expanded"]=Gt,Mn},[Wt,Jt.reference,Cn.reference,mn.reference,hn,Gt]),un=Wo.useMemo(()=>{let Mn=O(Cn.trigger,mn.trigger,hn);return Mn["aria-haspopup"]="menu",Mn["aria-expanded"]=!1,Mn},[Cn.trigger,mn.trigger,hn]);I(()=>(Wt.update({inactiveTriggerProps:un}),null));let vn=Wo.useMemo(()=>O(Ya,{id:$t,role:"menu","aria-orientation":St==="horizontal"?"horizontal":void 0,"aria-labelledby":jt?.id,onMouseMove(){if(Wt.set("allowMouseEnter",!0),tn.type==="menu")Wt.set("hoverEnabled",!1)},onClick(){if(Wt.select("hoverEnabled"))Wt.set("hoverEnabled",!1)},onKeyDown(Mn){let Gn=Wt.select("keyboardEventRelay");if(Gn&&!Mn.isPropagationStopped())Gn(Mn)}},Jt.floating,Cn.floating,mn.floating),[jt,$t,St,tn.type,Wt,Jt.floating,Cn.floating,mn.floating]),_n=Cn.item??g;rl(Wt,{floatingRootContext:nn,activeTriggerProps:Yt,inactiveTriggerProps:un,popupProps:vn,itemProps:_n});let zn=Wo.useMemo(()=>({store:Wt,parent:Dt}),[Wt,Dt]),$n=Kh.jsxs(qT.Provider,{value:zn,children:[Rt&&Kh.jsx(Za,{handle:Rt,store:Wt}),typeof ct==="function"?ct({payload:Kt}):ct]});if(tn.type===void 0||tn.type==="context-menu")return Kh.jsx(_p,{externalTree:Ut,children:$n});return $n});function wle(ot,st,ct){return I(()=>new tP(ot,st,ct)).current}var Bi=e(t(),1);var Bw=5;function bH(ot,st){let ct=Cle(st);return ot.clientX>=ct.left-Bw&&ot.clientX<=ct.right+Bw&&ot.clientY>=ct.top-Bw&&ot.clientY<=ct.bottom+Bw}function Cle(ot){let st=ot.getBoundingClientRect(),ct=m(ot);if(Ig.jsdom)return st;let gt=ct.getComputedStyle(ot,"::before"),bt=ct.getComputedStyle(ot,"::after");if(!(gt.content!=="none"||bt.content!=="none"))return st;let vt=parseFloat(gt.width)||0,xt=parseFloat(gt.height)||0,wt=parseFloat(bt.width)||0,Ct=parseFloat(bt.height)||0,St=Math.max(st.width,vt,wt),Et=Math.max(st.height,xt,Ct),kt=St-st.width,Rt=Et-st.height;return{left:st.left-kt/2,right:st.right+kt/2,top:st.top-Rt/2,bottom:st.bottom+Rt/2}}var yH=e(t(),1);function Fw(ot={}){let{highlightItemOnHover:st,highlightedIndex:ct,onHighlightedIndexChange:gt}=pe(),{ref:bt,index:yt}=Cl(ot),vt=ct===yt,xt=yH.useRef(null),wt=L(bt,xt);return{compositeProps:{tabIndex:vt?0:-1,onFocus(){gt(yt)},onMouseMove(){let St=xt.current;if(!st||!St)return;let Et=St.hasAttribute("disabled")||St.ariaDisabled==="true";if(!vt&&!Et)St.focus()}},compositeRef:wt,index:yt}}function vH(ot){let{render:st,className:ct,style:gt,state:bt=g,props:yt=z,refs:vt=z,metadata:xt,stateAttributesMapping:wt,tag:Ct="div",...St}=ot,{compositeProps:Et,compositeRef:kt}=Fw({metadata:xt});return l(Ct,ot,{state:bt,ref:[kt,...vt],props:[Et,...yt,St],stateAttributesMapping:wt})}function nP(ot){if(y(ot)&&ot.hasAttribute("data-rootownerid"))return ot.getAttribute("data-rootownerid");if(K(ot))return;return nP(q(ot))}var Hw=e(t(),1);function xH(ot){let{enabled:st=!0,mouseDownAction:ct,open:gt}=ot,bt=Hw.useRef(!1);return Hw.useMemo(()=>{if(!st)return g;return{onMouseDown:(yt)=>{if(ct==="open"&&!gt||ct==="close"&&gt)bt.current=!0,d(yt.currentTarget).addEventListener("click",()=>{bt.current=!1},{once:!0})},onClick:(yt)=>{if(bt.current)bt.current=!1,yt.preventBaseUIHandler()}}},[st,ct,gt])}var Lu=e(r(),1),wH=ja(function(st,ct){let{render:gt,className:bt,style:yt,disabled:vt=!1,nativeButton:xt=!0,id:wt,openOnHover:Ct,delay:St=100,closeDelay:Et=0,handle:kt,payload:Rt,...Tt}=st,Pt=gs(!0),It=sl(kt)??Pt?.store;if(!It)throw Error(c(85));let At=Cr(wt),Nt=It.useState("isTriggerActive",At),Ot=It.useState("floatingRootContext"),Dt=It.useState("isOpenedByTrigger",At),_t=It.useState("triggerPopupId",At),$t=Bi.useRef(null),Ft=Ele(),Bt=pe(!0),Lt=Ni(),Vt=Bi.useMemo(()=>Lt??new Np,[Lt]),Wt=nc(Vt),Ut=Ps(),{registerTrigger:Ht,isMountedByThisTrigger:Gt}=el(At,$t,It,{payload:Rt,closeDelay:Et,parent:Ft,floatingTreeRoot:Vt,floatingNodeId:Wt,floatingParentNodeId:Ut,keyboardEventRelay:Bt?.relayKeyboardEvent}),jt=Ft.type==="menubar",qt=It.useState("disabled"),Qt=vt||qt||jt&&Ft.context.disabled,{getButtonProps:Xt,buttonRef:zt}=P({disabled:Qt,native:xt});Bi.useEffect(()=>{if(!Dt&&Ft.type===void 0)It.context.allowMouseUpTriggerRef.current=!1},[It,Dt,Ft.type]);let tn=Bi.useRef(null),rn=Xr(),Kt=s((cn)=>{if(!tn.current)return;rn.clear(),It.context.allowMouseUpTriggerRef.current=!1;let mn=cn.target;if(On(tn.current,mn)||On(It.select("positionerElement"),mn)||mn===tn.current)return;if(mn!=null&&nP(mn)===It.select("rootId"))return;if(bH(cn,tn.current))return;Vt.events.emit("close",{domEvent:cn,reason:WZ})});Bi.useEffect(()=>{if(Dt&&It.select("lastOpenChangeReason")===Ao)d(tn.current).addEventListener("mouseup",Kt,{once:!0})},[Dt,Kt,It]);let an=jt&&Ft.context.hasSubmenuOpen,Zt=oc(Ot,{enabled:(Ct??an)&&!Qt&&(!jt||an&&!Gt),handleClose:ic({blockPointerEvents:!jt}),mouseOnly:!0,move:!1,restMs:Ft.type===void 0?St:void 0,delay:{close:Et},triggerElementRef:$t,externalTree:Vt,isActiveTrigger:Nt,isClosing:()=>It.select("transitionStatus")==="ending"}),on=Sle(Dt,It.select("lastOpenChangeReason")),sn=Lp(Ot,{enabled:!Qt,event:Dt&&jt?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:Ft.type===void 0?on:!1}),dn=Fp(Ot,{enabled:!Qt&&an}),fn=xH({open:Dt,enabled:jt,mouseDownAction:"open"}),bn=Bi.useMemo(()=>O(dn.reference,sn.reference),[dn.reference,sn.reference]),hn=It.useState("triggerProps",Gt),{preFocusGuardRef:gn,handlePreFocusGuardFocus:xn,handleFocusTargetFocus:wn}=mv(It,$t),yn={disabled:Qt,open:Dt},nn=[tn,ct,zt,Ht,$t],en=[bn,Zt??g,hn,{"aria-haspopup":"menu","aria-controls":_t,id:At,onMouseDown:(cn)=>{if(It.select("open"))return;rn.start(200,()=>{It.context.allowMouseUpTriggerRef.current=!0}),d(cn.currentTarget).addEventListener("mouseup",Kt,{once:!0})}},jt?{role:"menuitem"}:{},fn,Tt,Xt],pn=l("button",st,{enabled:!jt,stateAttributesMapping:Dg,state:yn,ref:nn,props:en});if(jt)return Lu.jsx(vH,{tag:"button",render:gt,className:bt,style:yt,state:yn,refs:nn,props:en,stateAttributesMapping:Dg});if(Dt)return Lu.jsxs(Bi.Fragment,{children:[Lu.jsx(cs,{ref:gn,onFocus:xn},`${At}-pre-focus-guard`),Lu.jsx(Bi.Fragment,{children:pn},At),Lu.jsx(cs,{ref:It.context.triggerFocusTargetRef,onFocus:wn},`${At}-post-focus-guard`)]});return Lu.jsx(Bi.Fragment,{children:pn},At)});function Sle(ot,st){let ct=Xr(),[gt,bt]=Bi.useState(!1);return i(()=>{if(ot&&st===Ao)bt(!0),ct.start(r0,()=>{bt(!1)});else if(!ot)ct.clear(),bt(!1)},[ot,st,ct]),gt}function Ele(){let ot=Ow(!0);return Bi.useMemo(()=>{if(ot)return{type:"menubar",context:ot};return{type:void 0}},[ot])}var CH=e(t(),1);var SH=CH.forwardRef(function(st,ct){let{className:gt,render:bt,orientation:yt="horizontal",style:vt,...xt}=st;return l("div",st,{state:{orientation:yt},ref:ct,props:[{role:"separator","aria-orientation":yt},xt]})});function EH(ot){return ot==null||ot.hasAttribute("disabled")||ot.getAttribute("aria-disabled")==="true"}var Ei=e(r(),1);function hs({...ot}){return Ei.jsx(hH,{"data-slot":"dropdown-menu",...ot})}function kle({...ot}){return Ei.jsx(Zs,{portal:iH,"data-slot":"dropdown-menu-portal",...ot})}function bs({...ot}){return Ei.jsx(wH,{"data-slot":"dropdown-menu-trigger",...ot})}function ys({align:ot="start",alignOffset:st=0,side:ct="bottom",sideOffset:gt=4,className:bt,...yt}){return Ei.jsx(kle,{children:Ei.jsx(lH,{className:"isolate z-50 outline-none",align:ot,alignOffset:st,side:ct,sideOffset:gt,children:Ei.jsx(nH,{"data-slot":"dropdown-menu-content",className:u("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rtl:data-[side=inline-end]:slide-in-from-right-2 rtl:data-[side=inline-start]:slide-in-from-left-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",bt),...yt})})})}function Na({...ot}){return Ei.jsx(J6,{"data-slot":"dropdown-menu-group",...ot})}function zw({className:ot,inset:st,...ct}){return Ei.jsx(Y6,{"data-slot":"dropdown-menu-label","data-inset":st,className:u("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:ps-7",ot),...ct})}function vs({className:ot,inset:st,variant:ct="default",...gt}){return Ei.jsx(eH,{"data-slot":"dropdown-menu-item","data-inset":st,"data-variant":ct,className:u("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm 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:ps-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",ot),...gt})}function $w({...ot}){return Ei.jsx(uH,{"data-slot":"dropdown-menu-radio-group",...ot})}function Ww({className:ot,children:st,inset:ct,...gt}){return Ei.jsxs(fH,{"data-slot":"dropdown-menu-radio-item","data-inset":ct,className:u("relative flex cursor-default items-center gap-2 rounded-md py-1 ps-2 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",ot),...gt,children:[Ei.jsx("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:Ei.jsx(mH,{children:Ei.jsx(Ys,{stroke:1.75})})}),st]})}function rP({className:ot,...st}){return Ei.jsx(SH,{"data-slot":"dropdown-menu-separator",className:u("mx-2 my-1 h-px bg-border",ot),...st})}var xo=e(r(),1),Rle="https://mlfrg.notion.site/3c678a44b6788042b734d775dd2e935e?pvs=105";function RH(){let ot=mu();if(ot.status==="loading")return xo.jsx("div",{className:"flex size-10 items-center justify-center",children:xo.jsx(Bs,{className:"size-8 rounded-full","aria-label":"Loading account"})});if(ot.status==="error")return null;if(ot.status==="signed-out"||!ot.profile)return null;return xo.jsxs(hs,{children:[xo.jsx(bs,{render:xo.jsx(a,{variant:"ghost",size:"icon-lg","aria-label":"User menu"}),children:xo.jsx(lc,{profile:ot.profile,size:"sm"})}),xo.jsxs(ys,{side:"right",align:"end",sideOffset:8,className:"w-52",children:[xo.jsx("div",{className:"px-2 py-1",children:xo.jsx(bR,{profile:ot.profile,size:"sm",description:ot.cloud?ot.profile.name?.trim()?ot.email:void 0:"This computer"})}),xo.jsx(rP,{}),xo.jsxs(Na,{children:[xo.jsxs(vs,{render:xo.jsx("a",{href:Rle,target:"_blank",rel:"noreferrer"}),children:[xo.jsx(yL,{stroke:1.75}),"Leave feedback"]}),xo.jsxs(vs,{render:xo.jsx(ql,{href:"/settings"}),children:[xo.jsx(Qc,{stroke:1.75}),"Settings"]})]}),ot.registered&&xo.jsxs(xo.Fragment,{children:[xo.jsx(rP,{}),xo.jsx(Na,{children:xo.jsxs(vs,{disabled:ot.signOut.isPending,onClick:()=>ot.signOut.mutate(void 0,{onError:(st)=>qr.add({title:"Couldn’t sign out",description:st.message,type:"error"})}),children:[xo.jsx(gL,{stroke:1.75}),"Sign out"]})})]})]})]})}var Fu=e(t(),1);var En=e(t()),cd=e(_());var ti=e(t());var qh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function id(ot){let st=Object.prototype.toString.call(ot);return st==="[object Window]"||st==="[object global]"}function Uw(ot){return"nodeType"in ot}function Fi(ot){var st,ct;if(!ot)return window;if(id(ot))return ot;if(!Uw(ot))return window;return(st=(ct=ot.ownerDocument)==null?void 0:ct.defaultView)!=null?st:window}function jw(ot){let{Document:st}=Fi(ot);return ot instanceof st}function mm(ot){if(id(ot))return!1;return ot instanceof Fi(ot).HTMLElement}function iP(ot){return ot instanceof Fi(ot).SVGElement}function sd(ot){if(!ot)return document;if(id(ot))return ot.document;if(!Uw(ot))return document;if(jw(ot))return ot;if(mm(ot)||iP(ot))return ot.ownerDocument;return document}var El=qh?ti.useLayoutEffect:ti.useEffect;function Qh(ot){let st=ti.useRef(ot);return El(()=>{st.current=ot}),ti.useCallback(function(){for(var ct=arguments.length,gt=Array(ct),bt=0;bt<ct;bt++)gt[bt]=arguments[bt];return st.current==null?void 0:st.current(...gt)},[])}function PH(){let ot=ti.useRef(null),st=ti.useCallback((gt,bt)=>{ot.current=setInterval(gt,bt)},[]),ct=ti.useCallback(()=>{if(ot.current!==null)clearInterval(ot.current),ot.current=null},[]);return[st,ct]}function gm(ot,st){if(st===void 0)st=[ot];let ct=ti.useRef(ot);return El(()=>{if(ct.current!==ot)ct.current=ot},st),ct}function hm(ot,st){let ct=ti.useRef();return ti.useMemo(()=>{let gt=ot(ct.current);return ct.current=gt,gt},[...st])}function Jh(ot){let st=Qh(ot),ct=ti.useRef(null),gt=ti.useCallback((bt)=>{if(bt!==ct.current)st==null||st(bt,ct.current);ct.current=bt},[]);return[ct,gt]}function Xh(ot){let st=ti.useRef();return ti.useEffect(()=>{st.current=ot},[ot]),st.current}var oP={};function Yh(ot,st){return ti.useMemo(()=>{if(st)return st;let ct=oP[ot]==null?0:oP[ot]+1;return oP[ot]=ct,ot+"-"+ct},[ot,st])}function IH(ot){return function(st){for(var ct=arguments.length,gt=Array(ct>1?ct-1:0),bt=1;bt<ct;bt++)gt[bt-1]=arguments[bt];return gt.reduce((yt,vt)=>{let xt=Object.entries(vt);for(let[wt,Ct]of xt){let St=yt[wt];if(St!=null)yt[wt]=St+ot*Ct}return yt},{...st})}}var ad=IH(1),Zh=IH(-1);function Tle(ot){return"clientX"in ot&&"clientY"in ot}function Vw(ot){if(!ot)return!1;let{KeyboardEvent:st}=Fi(ot.target);return st&&ot instanceof st}function Ple(ot){if(!ot)return!1;let{TouchEvent:st}=Fi(ot.target);return st&&ot instanceof st}function eb(ot){if(Ple(ot)){if(ot.touches&&ot.touches.length){let{clientX:st,clientY:ct}=ot.touches[0];return{x:st,y:ct}}else if(ot.changedTouches&&ot.changedTouches.length){let{clientX:st,clientY:ct}=ot.changedTouches[0];return{x:st,y:ct}}}if(Tle(ot))return{x:ot.clientX,y:ot.clientY};return null}var fm=Object.freeze({Translate:{toString(ot){if(!ot)return;let{x:st,y:ct}=ot;return"translate3d("+(st?Math.round(st):0)+"px, "+(ct?Math.round(ct):0)+"px, 0)"}},Scale:{toString(ot){if(!ot)return;let{scaleX:st,scaleY:ct}=ot;return"scaleX("+st+") scaleY("+ct+")"}},Transform:{toString(ot){if(!ot)return;return[fm.Translate.toString(ot),fm.Scale.toString(ot)].join(" ")}},Transition:{toString(ot){let{property:st,duration:ct,easing:gt}=ot;return st+" "+ct+"ms "+gt}}}),TH="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function MH(ot){if(ot.matches(TH))return ot;return ot.querySelector(TH)}var ld=e(t()),Ile={display:"none"};function AH(ot){let{id:st,value:ct}=ot;return ld.default.createElement("div",{id:st,style:Ile},ct)}function NH(ot){let{id:st,announcement:ct,ariaLiveType:gt="assertive"}=ot,bt={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 ld.default.createElement("div",{id:st,style:bt,role:"status","aria-live":gt,"aria-atomic":!0},ct)}function DH(){let[ot,st]=ld.useState("");return{announce:ld.useCallback((gt)=>{if(gt!=null)st(gt)},[]),announcement:ot}}var GH=En.createContext(null);function Mle(ot){let st=En.useContext(GH);En.useEffect(()=>{if(!st)throw Error("useDndMonitor must be used within a children of <DndContext>");return st(ot)},[ot,st])}function Ale(){let[ot]=En.useState(()=>new Set),st=En.useCallback((gt)=>(ot.add(gt),()=>ot.delete(gt)),[ot]);return[En.useCallback((gt)=>{let{type:bt,event:yt}=gt;ot.forEach((vt)=>{var xt;return(xt=vt[bt])==null?void 0:xt.call(vt,yt)})},[ot]),st]}var Nle={draggable:`
21
+ To pick up a draggable item, press the space bar.
22
+ While dragging, use the arrow keys to move the item.
23
+ Press space again to drop the item in its new position, or press escape to cancel.
24
+ `},Dle={onDragStart(ot){let{active:st}=ot;return"Picked up draggable item "+st.id+"."},onDragOver(ot){let{active:st,over:ct}=ot;if(ct)return"Draggable item "+st.id+" was moved over droppable area "+ct.id+".";return"Draggable item "+st.id+" is no longer over a droppable area."},onDragEnd(ot){let{active:st,over:ct}=ot;if(ct)return"Draggable item "+st.id+" was dropped over droppable area "+ct.id;return"Draggable item "+st.id+" was dropped."},onDragCancel(ot){let{active:st}=ot;return"Dragging was cancelled. Draggable item "+st.id+" was dropped."}};function _le(ot){let{announcements:st=Dle,container:ct,hiddenTextDescribedById:gt,screenReaderInstructions:bt=Nle}=ot,{announce:yt,announcement:vt}=DH(),xt=Yh("DndLiveRegion"),[wt,Ct]=En.useState(!1);if(En.useEffect(()=>{Ct(!0)},[]),Mle(En.useMemo(()=>({onDragStart(Et){let{active:kt}=Et;yt(st.onDragStart({active:kt}))},onDragMove(Et){let{active:kt,over:Rt}=Et;if(st.onDragMove)yt(st.onDragMove({active:kt,over:Rt}))},onDragOver(Et){let{active:kt,over:Rt}=Et;yt(st.onDragOver({active:kt,over:Rt}))},onDragEnd(Et){let{active:kt,over:Rt}=Et;yt(st.onDragEnd({active:kt,over:Rt}))},onDragCancel(Et){let{active:kt,over:Rt}=Et;yt(st.onDragCancel({active:kt,over:Rt}))}}),[yt,st])),!wt)return null;let St=En.default.createElement(En.default.Fragment,null,En.default.createElement(AH,{id:gt,value:bt.draggable}),En.default.createElement(NH,{id:xt,announcement:vt}));return ct?cd.createPortal(St,ct):St}var ii;(function(ot){ot.DragStart="dragStart",ot.DragMove="dragMove",ot.DragEnd="dragEnd",ot.DragCancel="dragCancel",ot.DragOver="dragOver",ot.RegisterDroppable="registerDroppable",ot.SetDroppableDisabled="setDroppableDisabled",ot.UnregisterDroppable="unregisterDroppable"})(ii||(ii={}));function Kw(){}function dP(ot,st){return En.useMemo(()=>({sensor:ot,options:st!=null?st:{}}),[ot,st])}function KH(){for(var ot=arguments.length,st=Array(ot),ct=0;ct<ot;ct++)st[ct]=arguments[ct];return En.useMemo(()=>[...st].filter((gt)=>gt!=null),[...st])}var Da=Object.freeze({x:0,y:0});function Ole(ot,st){return Math.sqrt(Math.pow(ot.x-st.x,2)+Math.pow(ot.y-st.y,2))}function Lle(ot,st){let ct=eb(ot);if(!ct)return"0 0";let gt={x:(ct.x-st.left)/st.width*100,y:(ct.y-st.top)/st.height*100};return gt.x+"% "+gt.y+"%"}function Ble(ot,st){let{data:{value:ct}}=ot,{data:{value:gt}}=st;return ct-gt}function Fle(ot,st){let{data:{value:ct}}=ot,{data:{value:gt}}=st;return gt-ct}function Hle(ot,st){if(!ot||ot.length===0)return null;let[ct]=ot;return st?ct[st]:ct}function _H(ot,st,ct){if(st===void 0)st=ot.left;if(ct===void 0)ct=ot.top;return{x:st+ot.width*0.5,y:ct+ot.height*0.5}}var qH=(ot)=>{let{collisionRect:st,droppableRects:ct,droppableContainers:gt}=ot,bt=_H(st,st.left,st.top),yt=[];for(let vt of gt){let{id:xt}=vt,wt=ct.get(xt);if(wt){let Ct=Ole(_H(wt),bt);yt.push({id:xt,data:{droppableContainer:vt,value:Ct}})}}return yt.sort(Ble)};function zle(ot,st){let ct=Math.max(st.top,ot.top),gt=Math.max(st.left,ot.left),bt=Math.min(st.left+st.width,ot.left+ot.width),yt=Math.min(st.top+st.height,ot.top+ot.height),vt=bt-gt,xt=yt-ct;if(gt<bt&&ct<yt){let wt=st.width*st.height,Ct=ot.width*ot.height,St=vt*xt,Et=St/(wt+Ct-St);return Number(Et.toFixed(4))}return 0}var $le=(ot)=>{let{collisionRect:st,droppableRects:ct,droppableContainers:gt}=ot,bt=[];for(let yt of gt){let{id:vt}=yt,xt=ct.get(vt);if(xt){let wt=zle(xt,st);if(wt>0)bt.push({id:vt,data:{droppableContainer:yt,value:wt}})}}return bt.sort(Fle)};function Wle(ot,st,ct){return{...ot,scaleX:st&&ct?st.width/ct.width:1,scaleY:st&&ct?st.height/ct.height:1}}function QH(ot,st){return ot&&st?{x:ot.left-st.left,y:ot.top-st.top}:Da}function Ule(ot){return function(ct){for(var gt=arguments.length,bt=Array(gt>1?gt-1:0),yt=1;yt<gt;yt++)bt[yt-1]=arguments[yt];return bt.reduce((vt,xt)=>({...vt,top:vt.top+ot*xt.y,bottom:vt.bottom+ot*xt.y,left:vt.left+ot*xt.x,right:vt.right+ot*xt.x}),{...ct})}}var jle=Ule(1);function JH(ot){if(ot.startsWith("matrix3d(")){let st=ot.slice(9,-1).split(/, /);return{x:+st[12],y:+st[13],scaleX:+st[0],scaleY:+st[5]}}else if(ot.startsWith("matrix(")){let st=ot.slice(7,-1).split(/, /);return{x:+st[4],y:+st[5],scaleX:+st[0],scaleY:+st[3]}}return null}function Vle(ot,st,ct){let gt=JH(st);if(!gt)return ot;let{scaleX:bt,scaleY:yt,x:vt,y:xt}=gt,wt=ot.left-vt-(1-bt)*parseFloat(ct),Ct=ot.top-xt-(1-yt)*parseFloat(ct.slice(ct.indexOf(" ")+1)),St=bt?ot.width/bt:ot.width,Et=yt?ot.height/yt:ot.height;return{width:St,height:Et,top:Ct,right:wt+St,bottom:Ct+Et,left:wt}}var Gle={ignoreTransform:!1};function rb(ot,st){if(st===void 0)st=Gle;let ct=ot.getBoundingClientRect();if(st.ignoreTransform){let{transform:Ct,transformOrigin:St}=Fi(ot).getComputedStyle(ot);if(Ct)ct=Vle(ct,Ct,St)}let{top:gt,left:bt,width:yt,height:vt,bottom:xt,right:wt}=ct;return{top:gt,left:bt,width:yt,height:vt,bottom:xt,right:wt}}function OH(ot){return rb(ot,{ignoreTransform:!0})}function Kle(ot){let{innerWidth:st,innerHeight:ct}=ot;return{top:0,left:0,right:st,bottom:ct,width:st,height:ct}}function qle(ot,st){if(st===void 0)st=Fi(ot).getComputedStyle(ot);return st.position==="fixed"}function Qle(ot,st){if(st===void 0)st=Fi(ot).getComputedStyle(ot);let ct=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((bt)=>{let yt=st[bt];return typeof yt==="string"?ct.test(yt):!1})}function fP(ot,st){let ct=[];function gt(bt){if(st!=null&&ct.length>=st)return ct;if(!bt)return ct;if(jw(bt)&&bt.scrollingElement!=null&&!ct.includes(bt.scrollingElement))return ct.push(bt.scrollingElement),ct;if(!mm(bt)||iP(bt))return ct;if(ct.includes(bt))return ct;let yt=Fi(ot).getComputedStyle(bt);if(bt!==ot){if(Qle(bt,yt))ct.push(bt)}if(qle(bt,yt))return ct;return gt(bt.parentNode)}if(!ot)return ct;return gt(ot)}function XH(ot){let[st]=fP(ot,1);return st!=null?st:null}function sP(ot){if(!qh||!ot)return null;if(id(ot))return ot;if(!Uw(ot))return null;if(jw(ot)||ot===sd(ot).scrollingElement)return window;if(mm(ot))return ot;return null}function YH(ot){if(id(ot))return ot.scrollX;return ot.scrollLeft}function ZH(ot){if(id(ot))return ot.scrollY;return ot.scrollTop}function cP(ot){return{x:YH(ot),y:ZH(ot)}}var yi;(function(ot){ot[ot.Forward=1]="Forward",ot[ot.Backward=-1]="Backward"})(yi||(yi={}));function e9(ot){if(!qh||!ot)return!1;return ot===document.scrollingElement}function t9(ot){let st={x:0,y:0},ct=e9(ot)?{height:window.innerHeight,width:window.innerWidth}:{height:ot.clientHeight,width:ot.clientWidth},gt={x:ot.scrollWidth-ct.width,y:ot.scrollHeight-ct.height},bt=ot.scrollTop<=st.y,yt=ot.scrollLeft<=st.x,vt=ot.scrollTop>=gt.y,xt=ot.scrollLeft>=gt.x;return{isTop:bt,isLeft:yt,isBottom:vt,isRight:xt,maxScroll:gt,minScroll:st}}var Jle={x:0.2,y:0.2};function Xle(ot,st,ct,gt,bt){let{top:yt,left:vt,right:xt,bottom:wt}=ct;if(gt===void 0)gt=10;if(bt===void 0)bt=Jle;let{isTop:Ct,isBottom:St,isLeft:Et,isRight:kt}=t9(ot),Rt={x:0,y:0},Tt={x:0,y:0},Pt={height:st.height*bt.y,width:st.width*bt.x};if(!Ct&&yt<=st.top+Pt.height)Rt.y=yi.Backward,Tt.y=gt*Math.abs((st.top+Pt.height-yt)/Pt.height);else if(!St&&wt>=st.bottom-Pt.height)Rt.y=yi.Forward,Tt.y=gt*Math.abs((st.bottom-Pt.height-wt)/Pt.height);if(!kt&&xt>=st.right-Pt.width)Rt.x=yi.Forward,Tt.x=gt*Math.abs((st.right-Pt.width-xt)/Pt.width);else if(!Et&&vt<=st.left+Pt.width)Rt.x=yi.Backward,Tt.x=gt*Math.abs((st.left+Pt.width-vt)/Pt.width);return{direction:Rt,speed:Tt}}function Yle(ot){if(ot===document.scrollingElement){let{innerWidth:yt,innerHeight:vt}=window;return{top:0,left:0,right:yt,bottom:vt,width:yt,height:vt}}let{top:st,left:ct,right:gt,bottom:bt}=ot.getBoundingClientRect();return{top:st,left:ct,right:gt,bottom:bt,width:ot.clientWidth,height:ot.clientHeight}}function n9(ot){return ot.reduce((st,ct)=>ad(st,cP(ct)),Da)}function Zle(ot){return ot.reduce((st,ct)=>st+YH(ct),0)}function ece(ot){return ot.reduce((st,ct)=>st+ZH(ct),0)}function r9(ot,st){if(st===void 0)st=rb;if(!ot)return;let{top:ct,left:gt,bottom:bt,right:yt}=st(ot);if(!XH(ot))return;if(bt<=0||yt<=0||ct>=window.innerHeight||gt>=window.innerWidth)ot.scrollIntoView({block:"center",inline:"center"})}var tce=[["x",["left","right"],Zle],["y",["top","bottom"],ece]];class Qw{constructor(ot,st){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 ct=fP(st),gt=n9(ct);this.rect={...ot},this.width=ot.width,this.height=ot.height;for(let[bt,yt,vt]of tce)for(let xt of yt)Object.defineProperty(this,xt,{get:()=>{let wt=vt(ct),Ct=gt[bt]-wt;return this.rect[xt]+Ct},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class bm{constructor(ot){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((st)=>{var ct;return(ct=this.target)==null?void 0:ct.removeEventListener(...st)})},this.target=ot}add(ot,st,ct){var gt;(gt=this.target)==null||gt.addEventListener(ot,st,ct),this.listeners.push([ot,st,ct])}}function nce(ot){let{EventTarget:st}=Fi(ot);return ot instanceof st?ot:sd(ot)}function aP(ot,st){let ct=Math.abs(ot.x),gt=Math.abs(ot.y);if(typeof st==="number")return Math.sqrt(ct**2+gt**2)>st;if("x"in st&&"y"in st)return ct>st.x&&gt>st.y;if("x"in st)return ct>st.x;if("y"in st)return gt>st.y;return!1}var ca;(function(ot){ot.Click="click",ot.DragStart="dragstart",ot.Keydown="keydown",ot.ContextMenu="contextmenu",ot.Resize="resize",ot.SelectionChange="selectionchange",ot.VisibilityChange="visibilitychange"})(ca||(ca={}));function LH(ot){ot.preventDefault()}function rce(ot){ot.stopPropagation()}var Zr;(function(ot){ot.Space="Space",ot.Down="ArrowDown",ot.Right="ArrowRight",ot.Left="ArrowLeft",ot.Up="ArrowUp",ot.Esc="Escape",ot.Enter="Enter",ot.Tab="Tab"})(Zr||(Zr={}));var o9={start:[Zr.Space,Zr.Enter],cancel:[Zr.Esc],end:[Zr.Space,Zr.Enter,Zr.Tab]},oce=(ot,st)=>{let{currentCoordinates:ct}=st;switch(ot.code){case Zr.Right:return{...ct,x:ct.x+25};case Zr.Left:return{...ct,x:ct.x-25};case Zr.Down:return{...ct,y:ct.y+25};case Zr.Up:return{...ct,y:ct.y-25}}return};class ob{constructor(ot){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=ot;let{event:{target:st}}=ot;this.props=ot,this.listeners=new bm(sd(st)),this.windowListeners=new bm(Fi(st)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ca.Resize,this.handleCancel),this.windowListeners.add(ca.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ca.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:ot,onStart:st}=this.props,ct=ot.node.current;if(ct)r9(ct);st(Da)}handleKeyDown(ot){if(Vw(ot)){let{active:st,context:ct,options:gt}=this.props,{keyboardCodes:bt=o9,coordinateGetter:yt=oce,scrollBehavior:vt="smooth"}=gt,{code:xt}=ot;if(bt.end.includes(xt)){this.handleEnd(ot);return}if(bt.cancel.includes(xt)){this.handleCancel(ot);return}let{collisionRect:wt}=ct.current,Ct=wt?{x:wt.left,y:wt.top}:Da;if(!this.referenceCoordinates)this.referenceCoordinates=Ct;let St=yt(ot,{active:st,context:ct.current,currentCoordinates:Ct});if(St){let Et=Zh(St,Ct),kt={x:0,y:0},{scrollableAncestors:Rt}=ct.current;for(let Tt of Rt){let Pt=ot.code,{isTop:Mt,isRight:It,isLeft:At,isBottom:Nt,maxScroll:Ot,minScroll:Dt}=t9(Tt),_t=Yle(Tt),$t={x:Math.min(Pt===Zr.Right?_t.right-_t.width/2:_t.right,Math.max(Pt===Zr.Right?_t.left:_t.left+_t.width/2,St.x)),y:Math.min(Pt===Zr.Down?_t.bottom-_t.height/2:_t.bottom,Math.max(Pt===Zr.Down?_t.top:_t.top+_t.height/2,St.y))},Ft=Pt===Zr.Right&&!It||Pt===Zr.Left&&!At,Bt=Pt===Zr.Down&&!Nt||Pt===Zr.Up&&!Mt;if(Ft&&$t.x!==St.x){let Lt=Tt.scrollLeft+Et.x,Vt=Pt===Zr.Right&&Lt<=Ot.x||Pt===Zr.Left&&Lt>=Dt.x;if(Vt&&!Et.y){Tt.scrollTo({left:Lt,behavior:vt});return}if(Vt)kt.x=Tt.scrollLeft-Lt;else kt.x=Pt===Zr.Right?Tt.scrollLeft-Ot.x:Tt.scrollLeft-Dt.x;if(kt.x)Tt.scrollBy({left:-kt.x,behavior:vt});break}else if(Bt&&$t.y!==St.y){let Lt=Tt.scrollTop+Et.y,Vt=Pt===Zr.Down&&Lt<=Ot.y||Pt===Zr.Up&&Lt>=Dt.y;if(Vt&&!Et.x){Tt.scrollTo({top:Lt,behavior:vt});return}if(Vt)kt.y=Tt.scrollTop-Lt;else kt.y=Pt===Zr.Down?Tt.scrollTop-Ot.y:Tt.scrollTop-Dt.y;if(kt.y)Tt.scrollBy({top:-kt.y,behavior:vt});break}}this.handleMove(ot,ad(Zh(St,this.referenceCoordinates),kt))}}}handleMove(ot,st){let{onMove:ct}=this.props;ot.preventDefault(),ct(st)}handleEnd(ot){let{onEnd:st}=this.props;ot.preventDefault(),this.detach(),st()}handleCancel(ot){let{onCancel:st}=this.props;ot.preventDefault(),this.detach(),st()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}ob.activators=[{eventName:"onKeyDown",handler:(ot,st,ct)=>{let{keyboardCodes:gt=o9,onActivation:bt}=st,{active:yt}=ct,{code:vt}=ot.nativeEvent;if(gt.start.includes(vt)){let xt=yt.activatorNode.current;if(xt&&ot.target!==xt)return!1;return ot.preventDefault(),bt==null||bt({event:ot.nativeEvent}),!0}return!1}}];function BH(ot){return Boolean(ot&&"distance"in ot)}function FH(ot){return Boolean(ot&&"delay"in ot)}class Jw{constructor(ot,st,ct){var gt;if(ct===void 0)ct=nce(ot.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=ot,this.events=st;let{event:bt}=ot,{target:yt}=bt;this.props=ot,this.events=st,this.document=sd(yt),this.documentListeners=new bm(this.document),this.listeners=new bm(ct),this.windowListeners=new bm(Fi(yt)),this.initialCoordinates=(gt=eb(bt))!=null?gt:Da,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:ot,props:{options:{activationConstraint:st,bypassActivationConstraint:ct}}}=this;if(this.listeners.add(ot.move.name,this.handleMove,{passive:!1}),this.listeners.add(ot.end.name,this.handleEnd),ot.cancel)this.listeners.add(ot.cancel.name,this.handleCancel);if(this.windowListeners.add(ca.Resize,this.handleCancel),this.windowListeners.add(ca.DragStart,LH),this.windowListeners.add(ca.VisibilityChange,this.handleCancel),this.windowListeners.add(ca.ContextMenu,LH),this.documentListeners.add(ca.Keydown,this.handleKeydown),st){if(ct!=null&&ct({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(FH(st)){this.timeoutId=setTimeout(this.handleStart,st.delay),this.handlePending(st);return}if(BH(st)){this.handlePending(st);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(ot,st){let{active:ct,onPending:gt}=this.props;gt(ct,ot,this.initialCoordinates,st)}handleStart(){let{initialCoordinates:ot}=this,{onStart:st}=this.props;if(ot)this.activated=!0,this.documentListeners.add(ca.Click,rce,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ca.SelectionChange,this.removeTextSelection),st(ot)}handleMove(ot){var st;let{activated:ct,initialCoordinates:gt,props:bt}=this,{onMove:yt,options:{activationConstraint:vt}}=bt;if(!gt)return;let xt=(st=eb(ot))!=null?st:Da,wt=Zh(gt,xt);if(!ct&&vt){if(BH(vt)){if(vt.tolerance!=null&&aP(wt,vt.tolerance))return this.handleCancel();if(aP(wt,vt.distance))return this.handleStart()}if(FH(vt)){if(aP(wt,vt.tolerance))return this.handleCancel()}this.handlePending(vt,wt);return}if(ot.cancelable)ot.preventDefault();yt(xt)}handleEnd(){let{onAbort:ot,onEnd:st}=this.props;if(this.detach(),!this.activated)ot(this.props.active);st()}handleCancel(){let{onAbort:ot,onCancel:st}=this.props;if(this.detach(),!this.activated)ot(this.props.active);st()}handleKeydown(ot){if(ot.code===Zr.Esc)this.handleCancel()}removeTextSelection(){var ot;(ot=this.document.getSelection())==null||ot.removeAllRanges()}}var ice={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ib extends Jw{constructor(ot){let{event:st}=ot,ct=sd(st.target);super(ot,ice,ct)}}ib.activators=[{eventName:"onPointerDown",handler:(ot,st)=>{let{nativeEvent:ct}=ot,{onActivation:gt}=st;if(!ct.isPrimary||ct.button!==0)return!1;return gt==null||gt({event:ct}),!0}}];var sce={move:{name:"mousemove"},end:{name:"mouseup"}},uP;(function(ot){ot[ot.RightClick=2]="RightClick"})(uP||(uP={}));class i9 extends Jw{constructor(ot){super(ot,sce,sd(ot.event.target))}}i9.activators=[{eventName:"onMouseDown",handler:(ot,st)=>{let{nativeEvent:ct}=ot,{onActivation:gt}=st;if(ct.button===uP.RightClick)return!1;return gt==null||gt({event:ct}),!0}}];var lP={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class s9 extends Jw{constructor(ot){super(ot,lP)}static setup(){return window.addEventListener(lP.move.name,ot,{capture:!1,passive:!1}),function(){window.removeEventListener(lP.move.name,ot)};function ot(){}}}s9.activators=[{eventName:"onTouchStart",handler:(ot,st)=>{let{nativeEvent:ct}=ot,{onActivation:gt}=st,{touches:bt}=ct;if(bt.length>1)return!1;return gt==null||gt({event:ct}),!0}}];var tb;(function(ot){ot[ot.Pointer=0]="Pointer",ot[ot.DraggableRect=1]="DraggableRect"})(tb||(tb={}));var qw;(function(ot){ot[ot.TreeOrder=0]="TreeOrder",ot[ot.ReversedTreeOrder=1]="ReversedTreeOrder"})(qw||(qw={}));function ace(ot){let{acceleration:st,activator:ct=tb.Pointer,canScroll:gt,draggingRect:bt,enabled:yt,interval:vt=5,order:xt=qw.TreeOrder,pointerCoordinates:wt,scrollableAncestors:Ct,scrollableAncestorRects:St,delta:Et,threshold:kt}=ot,Rt=cce({delta:Et,disabled:!yt}),[Tt,Pt]=PH(),Mt=En.useRef({x:0,y:0}),It=En.useRef({x:0,y:0}),At=En.useMemo(()=>{switch(ct){case tb.Pointer:return wt?{top:wt.y,bottom:wt.y,left:wt.x,right:wt.x}:null;case tb.DraggableRect:return bt}},[ct,bt,wt]),Nt=En.useRef(null),Ot=En.useCallback(()=>{let _t=Nt.current;if(!_t)return;let $t=Mt.current.x*It.current.x,Ft=Mt.current.y*It.current.y;_t.scrollBy($t,Ft)},[]),Dt=En.useMemo(()=>xt===qw.TreeOrder?[...Ct].reverse():Ct,[xt,Ct]);En.useEffect(()=>{if(!yt||!Ct.length||!At){Pt();return}for(let _t of Dt){if((gt==null?void 0:gt(_t))===!1)continue;let $t=Ct.indexOf(_t),Ft=St[$t];if(!Ft)continue;let{direction:Bt,speed:Lt}=Xle(_t,Ft,At,st,kt);for(let Vt of["x","y"])if(!Rt[Vt][Bt[Vt]])Lt[Vt]=0,Bt[Vt]=0;if(Lt.x>0||Lt.y>0){Pt(),Nt.current=_t,Tt(Ot,vt),Mt.current=Lt,It.current=Bt;return}}Mt.current={x:0,y:0},It.current={x:0,y:0},Pt()},[st,Ot,gt,Pt,yt,vt,JSON.stringify(At),JSON.stringify(Rt),Tt,Ct,Dt,St,JSON.stringify(kt)])}var lce={x:{[yi.Backward]:!1,[yi.Forward]:!1},y:{[yi.Backward]:!1,[yi.Forward]:!1}};function cce(ot){let{delta:st,disabled:ct}=ot,gt=Xh(st);return hm((bt)=>{if(ct||!gt||!bt)return lce;let yt={x:Math.sign(st.x-gt.x),y:Math.sign(st.y-gt.y)};return{x:{[yi.Backward]:bt.x[yi.Backward]||yt.x===-1,[yi.Forward]:bt.x[yi.Forward]||yt.x===1},y:{[yi.Backward]:bt.y[yi.Backward]||yt.y===-1,[yi.Forward]:bt.y[yi.Forward]||yt.y===1}}},[ct,st,gt])}function uce(ot,st){let ct=st!=null?ot.get(st):void 0,gt=ct?ct.node.current:null;return hm((bt)=>{var yt;if(st==null)return null;return(yt=gt!=null?gt:bt)!=null?yt:null},[gt,st])}function pce(ot,st){return En.useMemo(()=>ot.reduce((ct,gt)=>{let{sensor:bt}=gt,yt=bt.activators.map((vt)=>({eventName:vt.eventName,handler:st(vt.handler,gt)}));return[...ct,...yt]},[]),[ot,st])}var nb;(function(ot){ot[ot.Always=0]="Always",ot[ot.BeforeDragging=1]="BeforeDragging",ot[ot.WhileDragging=2]="WhileDragging"})(nb||(nb={}));var pP;(function(ot){ot.Optimized="optimized"})(pP||(pP={}));var HH=new Map;function dce(ot,st){let{dragging:ct,dependencies:gt,config:bt}=st,[yt,vt]=En.useState(null),{frequency:xt,measure:wt,strategy:Ct}=bt,St=En.useRef(ot),Et=Mt(),kt=gm(Et),Rt=En.useCallback(function(It){if(It===void 0)It=[];if(kt.current)return;vt((At)=>{if(At===null)return It;return At.concat(It.filter((Nt)=>!At.includes(Nt)))})},[kt]),Tt=En.useRef(null),Pt=hm((It)=>{if(Et&&!ct)return HH;if(!It||It===HH||St.current!==ot||yt!=null){let At=new Map;for(let Nt of ot){if(!Nt)continue;if(yt&&yt.length>0&&!yt.includes(Nt.id)&&Nt.rect.current){At.set(Nt.id,Nt.rect.current);continue}let Ot=Nt.node.current,Dt=Ot?new Qw(wt(Ot),Ot):null;if(Nt.rect.current=Dt,Dt)At.set(Nt.id,Dt)}return At}return It},[ot,yt,ct,Et,wt]);return En.useEffect(()=>{St.current=ot},[ot]),En.useEffect(()=>{if(Et)return;Rt()},[ct,Et]),En.useEffect(()=>{if(yt&&yt.length>0)vt(null)},[JSON.stringify(yt)]),En.useEffect(()=>{if(Et||typeof xt!=="number"||Tt.current!==null)return;Tt.current=setTimeout(()=>{Rt(),Tt.current=null},xt)},[xt,Et,Rt,...gt]),{droppableRects:Pt,measureDroppableContainers:Rt,measuringScheduled:yt!=null};function Mt(){switch(Ct){case nb.Always:return!1;case nb.BeforeDragging:return ct;default:return!ct}}}function mP(ot,st){return hm((ct)=>{if(!ot)return null;if(ct)return ct;return typeof st==="function"?st(ot):ot},[st,ot])}function fce(ot,st){return mP(ot,st)}function mce(ot){let{callback:st,disabled:ct}=ot,gt=Qh(st),bt=En.useMemo(()=>{if(ct||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:yt}=window;return new yt(gt)},[gt,ct]);return En.useEffect(()=>()=>bt==null?void 0:bt.disconnect(),[bt]),bt}function Xw(ot){let{callback:st,disabled:ct}=ot,gt=Qh(st),bt=En.useMemo(()=>{if(ct||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:yt}=window;return new yt(gt)},[ct]);return En.useEffect(()=>()=>bt==null?void 0:bt.disconnect(),[bt]),bt}function gce(ot){return new Qw(rb(ot),ot)}function zH(ot,st,ct){if(st===void 0)st=gce;let[gt,bt]=En.useState(null);function yt(){bt((wt)=>{if(!ot)return null;if(ot.isConnected===!1){var Ct;return(Ct=wt!=null?wt:ct)!=null?Ct:null}let St=st(ot);if(JSON.stringify(wt)===JSON.stringify(St))return wt;return St})}let vt=mce({callback(wt){if(!ot)return;for(let Ct of wt){let{type:St,target:Et}=Ct;if(St==="childList"&&Et instanceof HTMLElement&&Et.contains(ot)){yt();break}}}}),xt=Xw({callback:yt});return El(()=>{if(yt(),ot)xt==null||xt.observe(ot),vt==null||vt.observe(document.body,{childList:!0,subtree:!0});else xt==null||xt.disconnect(),vt==null||vt.disconnect()},[ot]),gt}function hce(ot){let st=mP(ot);return QH(ot,st)}var $H=[];function bce(ot){let st=En.useRef(ot),ct=hm((gt)=>{if(!ot)return $H;if(gt&&gt!==$H&&ot&&st.current&&ot.parentNode===st.current.parentNode)return gt;return fP(ot)},[ot]);return En.useEffect(()=>{st.current=ot},[ot]),ct}function yce(ot){let[st,ct]=En.useState(null),gt=En.useRef(ot),bt=En.useCallback((yt)=>{let vt=sP(yt.target);if(!vt)return;ct((xt)=>{if(!xt)return null;return xt.set(vt,cP(vt)),new Map(xt)})},[]);return En.useEffect(()=>{let yt=gt.current;if(ot!==yt){vt(yt);let xt=ot.map((wt)=>{let Ct=sP(wt);if(Ct)return Ct.addEventListener("scroll",bt,{passive:!0}),[Ct,cP(Ct)];return null}).filter((wt)=>wt!=null);ct(xt.length?new Map(xt):null),gt.current=ot}return()=>{vt(ot),vt(yt)};function vt(xt){xt.forEach((wt)=>{let Ct=sP(wt);Ct==null||Ct.removeEventListener("scroll",bt)})}},[bt,ot]),En.useMemo(()=>{if(ot.length)return st?Array.from(st.values()).reduce((yt,vt)=>ad(yt,vt),Da):n9(ot);return Da},[ot,st])}function WH(ot,st){if(st===void 0)st=[];let ct=En.useRef(null);return En.useEffect(()=>{ct.current=null},st),En.useEffect(()=>{let gt=ot!==Da;if(gt&&!ct.current)ct.current=ot;if(!gt&&ct.current)ct.current=null},[ot]),ct.current?Zh(ot,ct.current):Da}function vce(ot){En.useEffect(()=>{if(!qh)return;let st=ot.map((ct)=>{let{sensor:gt}=ct;return gt.setup==null?void 0:gt.setup()});return()=>{for(let ct of st)ct==null||ct()}},ot.map((st)=>{let{sensor:ct}=st;return ct}))}function xce(ot,st){return En.useMemo(()=>ot.reduce((ct,gt)=>{let{eventName:bt,handler:yt}=gt;return ct[bt]=(vt)=>{yt(vt,st)},ct},{}),[ot,st])}function a9(ot){return En.useMemo(()=>ot?Kle(ot):null,[ot])}var UH=[];function wce(ot,st){if(st===void 0)st=rb;let[ct]=ot,gt=a9(ct?Fi(ct):null),[bt,yt]=En.useState(UH);function vt(){yt(()=>{if(!ot.length)return UH;return ot.map((wt)=>e9(wt)?gt:new Qw(st(wt),wt))})}let xt=Xw({callback:vt});return El(()=>{xt==null||xt.disconnect(),vt(),ot.forEach((wt)=>xt==null?void 0:xt.observe(wt))},[ot]),bt}function l9(ot){if(!ot)return null;if(ot.children.length>1)return ot;let st=ot.children[0];return mm(st)?st:ot}function Cce(ot){let{measure:st}=ot,[ct,gt]=En.useState(null),bt=En.useCallback((Ct)=>{for(let{target:St}of Ct)if(mm(St)){gt((Et)=>{let kt=st(St);return Et?{...Et,width:kt.width,height:kt.height}:kt});break}},[st]),yt=Xw({callback:bt}),vt=En.useCallback((Ct)=>{let St=l9(Ct);if(yt==null||yt.disconnect(),St)yt==null||yt.observe(St);gt(St?st(St):null)},[st,yt]),[xt,wt]=Jh(vt);return En.useMemo(()=>({nodeRef:xt,rect:ct,setRef:wt}),[ct,xt,wt])}var Sce=[{sensor:ib,options:{}},{sensor:ob,options:{}}],Ece={current:{}},Gw={draggable:{measure:OH},droppable:{measure:OH,strategy:nb.WhileDragging,frequency:pP.Optimized},dragOverlay:{measure:rb}};class ym extends Map{get(ot){var st;return ot!=null?(st=super.get(ot))!=null?st:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((ot)=>{let{disabled:st}=ot;return!st})}getNodeFor(ot){var st,ct;return(st=(ct=this.get(ot))==null?void 0:ct.node.current)!=null?st:void 0}}var kce={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ym,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Kw},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Gw,measureDroppableContainers:Kw,windowRect:null,measuringScheduled:!1},c9={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Kw,draggableNodes:new Map,over:null,measureDroppableContainers:Kw},sb=En.createContext(c9),u9=En.createContext(kce);function Rce(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ym}}}function Tce(ot,st){switch(st.type){case ii.DragStart:return{...ot,draggable:{...ot.draggable,initialCoordinates:st.initialCoordinates,active:st.active}};case ii.DragMove:if(ot.draggable.active==null)return ot;return{...ot,draggable:{...ot.draggable,translate:{x:st.coordinates.x-ot.draggable.initialCoordinates.x,y:st.coordinates.y-ot.draggable.initialCoordinates.y}}};case ii.DragEnd:case ii.DragCancel:return{...ot,draggable:{...ot.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ii.RegisterDroppable:{let{element:ct}=st,{id:gt}=ct,bt=new ym(ot.droppable.containers);return bt.set(gt,ct),{...ot,droppable:{...ot.droppable,containers:bt}}}case ii.SetDroppableDisabled:{let{id:ct,key:gt,disabled:bt}=st,yt=ot.droppable.containers.get(ct);if(!yt||gt!==yt.key)return ot;let vt=new ym(ot.droppable.containers);return vt.set(ct,{...yt,disabled:bt}),{...ot,droppable:{...ot.droppable,containers:vt}}}case ii.UnregisterDroppable:{let{id:ct,key:gt}=st,bt=ot.droppable.containers.get(ct);if(!bt||gt!==bt.key)return ot;let yt=new ym(ot.droppable.containers);return yt.delete(ct),{...ot,droppable:{...ot.droppable,containers:yt}}}default:return ot}}function Pce(ot){let{disabled:st}=ot,{active:ct,activatorEvent:gt,draggableNodes:bt}=En.useContext(sb),yt=Xh(gt),vt=Xh(ct==null?void 0:ct.id);return En.useEffect(()=>{if(st)return;if(!gt&&yt&&vt!=null){if(!Vw(yt))return;if(document.activeElement===yt.target)return;let xt=bt.get(vt);if(!xt)return;let{activatorNode:wt,node:Ct}=xt;if(!wt.current&&!Ct.current)return;requestAnimationFrame(()=>{for(let St of[wt.current,Ct.current]){if(!St)continue;let Et=MH(St);if(Et){Et.focus();break}}})}},[gt,st,bt,vt,yt]),null}function p9(ot,st){let{transform:ct,...gt}=st;return ot!=null&&ot.length?ot.reduce((bt,yt)=>yt({transform:bt,...gt}),ct):ct}function Ice(ot){return En.useMemo(()=>({draggable:{...Gw.draggable,...ot==null?void 0:ot.draggable},droppable:{...Gw.droppable,...ot==null?void 0:ot.droppable},dragOverlay:{...Gw.dragOverlay,...ot==null?void 0:ot.dragOverlay}}),[ot==null?void 0:ot.draggable,ot==null?void 0:ot.droppable,ot==null?void 0:ot.dragOverlay])}function Mce(ot){let{activeNode:st,measure:ct,initialRect:gt,config:bt=!0}=ot,yt=En.useRef(!1),{x:vt,y:xt}=typeof bt==="boolean"?{x:bt,y:bt}:bt;El(()=>{if(!vt&&!xt||!st){yt.current=!1;return}if(yt.current||!gt)return;let Ct=st==null?void 0:st.node.current;if(!Ct||Ct.isConnected===!1)return;let St=ct(Ct),Et=QH(St,gt);if(!vt)Et.x=0;if(!xt)Et.y=0;if(yt.current=!0,Math.abs(Et.x)>0||Math.abs(Et.y)>0){let kt=XH(Ct);if(kt)kt.scrollBy({top:Et.y,left:Et.x})}},[st,vt,xt,gt,ct])}var Yw=En.createContext({...Da,scaleX:1,scaleY:1}),Bu;(function(ot){ot[ot.Uninitialized=0]="Uninitialized",ot[ot.Initializing=1]="Initializing",ot[ot.Initialized=2]="Initialized"})(Bu||(Bu={}));var d9=En.memo(function(st){var ct,gt,bt,yt;let{id:vt,accessibility:xt,autoScroll:wt=!0,children:Ct,sensors:St=Sce,collisionDetection:Et=$le,measuring:kt,modifiers:Rt,...Tt}=st,Pt=En.useReducer(Tce,void 0,Rce),[Mt,It]=Pt,[At,Nt]=Ale(),[Ot,Dt]=En.useState(Bu.Uninitialized),_t=Ot===Bu.Initialized,{draggable:{active:$t,nodes:Ft,translate:Bt},droppable:{containers:Lt}}=Mt,Vt=$t!=null?Ft.get($t):null,Wt=En.useRef({initial:null,translated:null}),Ut=En.useMemo(()=>{var An;return $t!=null?{id:$t,data:(An=Vt==null?void 0:Vt.data)!=null?An:Ece,rect:Wt}:null},[$t,Vt]),Ht=En.useRef(null),[Gt,jt]=En.useState(null),[qt,Qt]=En.useState(null),Xt=gm(Tt,Object.values(Tt)),zt=Yh("DndDescribedBy",vt),tn=En.useMemo(()=>Lt.getEnabled(),[Lt]),rn=Ice(kt),{droppableRects:Kt,measureDroppableContainers:an,measuringScheduled:ln}=dce(tn,{dragging:_t,dependencies:[Bt.x,Bt.y],config:rn.droppable}),Zt=uce(Ft,$t),on=En.useMemo(()=>qt?eb(qt):null,[qt]),sn=no(),dn=fce(Zt,rn.draggable.measure);Mce({activeNode:$t!=null?Ft.get($t):null,config:sn.layoutShiftCompensation,initialRect:dn,measure:rn.draggable.measure});let fn=zH(Zt,rn.draggable.measure,dn),bn=zH(Zt?Zt.parentElement:null),hn=En.useRef({activatorEvent:null,active:null,activeNode:Zt,collisionRect:null,collisions:null,droppableRects:Kt,draggableNodes:Ft,draggingNode:null,draggingNodeRect:null,droppableContainers:Lt,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),gn=Lt.getNodeFor((ct=hn.current.over)==null?void 0:ct.id),xn=Cce({measure:rn.dragOverlay.measure}),wn=(gt=xn.nodeRef.current)!=null?gt:Zt,yn=_t?(bt=xn.rect)!=null?bt:fn:null,nn=Boolean(xn.nodeRef.current&&xn.rect),en=hce(nn?null:fn),pn=a9(wn?Fi(wn):null),cn=bce(_t?gn!=null?gn:Zt:null),mn=wce(cn),Pn=p9(Rt,{transform:{x:Bt.x-en.x,y:Bt.y-en.y,scaleX:1,scaleY:1},activatorEvent:qt,active:Ut,activeNodeRect:fn,containerNodeRect:bn,draggingNodeRect:yn,over:hn.current.over,overlayNodeRect:xn.rect,scrollableAncestors:cn,scrollableAncestorRects:mn,windowRect:pn}),Rn=on?ad(on,Bt):null,Cn=yce(cn),kn=WH(Cn),Jt=WH(Cn,[fn]),Yt=ad(Pn,kn),un=yn?jle(yn,Pn):null,vn=Ut&&un?Et({active:Ut,collisionRect:un,droppableRects:Kt,droppableContainers:tn,pointerCoordinates:Rn}):null,_n=Hle(vn,"id"),[zn,$n]=En.useState(null),Mn=nn?Pn:ad(Pn,Jt),Gn=Wle(Mn,(yt=zn==null?void 0:zn.rect)!=null?yt:null,fn),sr=En.useRef(null),gr=En.useCallback((An,Vn)=>{let{sensor:Jn,options:Yn}=Vn;if(Ht.current==null)return;let Sn=Ft.get(Ht.current);if(!Sn)return;let Fn=An.nativeEvent,ur=new Jn({active:Ht.current,activeNode:Sn,event:Fn,options:Yn,context:hn,onAbort(Wn){if(!Ft.get(Wn))return;let{onDragAbort:vr}=Xt.current,wr={id:Wn};vr==null||vr(wr),At({type:"onDragAbort",event:wr})},onPending(Wn,Zn,vr,wr){if(!Ft.get(Wn))return;let{onDragPending:er}=Xt.current,Qn={id:Wn,constraint:Zn,initialCoordinates:vr,offset:wr};er==null||er(Qn),At({type:"onDragPending",event:Qn})},onStart(Wn){let Zn=Ht.current;if(Zn==null)return;let vr=Ft.get(Zn);if(!vr)return;let{onDragStart:wr}=Xt.current,Hn={activatorEvent:Fn,active:{id:Zn,data:vr.data,rect:Wt}};cd.unstable_batchedUpdates(()=>{wr==null||wr(Hn),Dt(Bu.Initializing),It({type:ii.DragStart,initialCoordinates:Wn,active:Zn}),At({type:"onDragStart",event:Hn}),jt(sr.current),Qt(Fn)})},onMove(Wn){It({type:ii.DragMove,coordinates:Wn})},onEnd:Pr(ii.DragEnd),onCancel:Pr(ii.DragCancel)});sr.current=ur;function Pr(Wn){return async function(){let{active:vr,collisions:wr,over:Hn,scrollAdjustedTranslate:er}=hn.current,Qn=null;if(vr&&er){let{cancelDrop:br}=Xt.current;if(Qn={activatorEvent:Fn,active:vr,collisions:wr,delta:er,over:Hn},Wn===ii.DragEnd&&typeof br==="function"){if(await Promise.resolve(br(Qn)))Wn=ii.DragCancel}}Ht.current=null,cd.unstable_batchedUpdates(()=>{It({type:Wn}),Dt(Bu.Uninitialized),$n(null),jt(null),Qt(null),sr.current=null;let br=Wn===ii.DragEnd?"onDragEnd":"onDragCancel";if(Qn){let Hr=Xt.current[br];Hr==null||Hr(Qn),At({type:br,event:Qn})}})}}},[Ft]),qn=En.useCallback((An,Vn)=>(Jn,Yn)=>{let Sn=Jn.nativeEvent,Fn=Ft.get(Yn);if(Ht.current!==null||!Fn||Sn.dndKit||Sn.defaultPrevented)return;let ur={active:Fn};if(An(Jn,Vn.options,ur)===!0)Sn.dndKit={capturedBy:Vn.sensor},Ht.current=Yn,gr(Jn,Vn)},[Ft,gr]),Bn=pce(St,qn);vce(St),El(()=>{if(fn&&Ot===Bu.Initializing)Dt(Bu.Initialized)},[fn,Ot]),En.useEffect(()=>{let{onDragMove:An}=Xt.current,{active:Vn,activatorEvent:Jn,collisions:Yn,over:Sn}=hn.current;if(!Vn||!Jn)return;let Fn={active:Vn,activatorEvent:Jn,collisions:Yn,delta:{x:Yt.x,y:Yt.y},over:Sn};cd.unstable_batchedUpdates(()=>{An==null||An(Fn),At({type:"onDragMove",event:Fn})})},[Yt.x,Yt.y]),En.useEffect(()=>{let{active:An,activatorEvent:Vn,collisions:Jn,droppableContainers:Yn,scrollAdjustedTranslate:Sn}=hn.current;if(!An||Ht.current==null||!Vn||!Sn)return;let{onDragOver:Fn}=Xt.current,ur=Yn.get(_n),Pr=ur&&ur.rect.current?{id:ur.id,rect:ur.rect.current,data:ur.data,disabled:ur.disabled}:null,Wn={active:An,activatorEvent:Vn,collisions:Jn,delta:{x:Sn.x,y:Sn.y},over:Pr};cd.unstable_batchedUpdates(()=>{$n(Pr),Fn==null||Fn(Wn),At({type:"onDragOver",event:Wn})})},[_n]),El(()=>{hn.current={activatorEvent:qt,active:Ut,activeNode:Zt,collisionRect:un,collisions:vn,droppableRects:Kt,draggableNodes:Ft,draggingNode:wn,draggingNodeRect:yn,droppableContainers:Lt,over:zn,scrollableAncestors:cn,scrollAdjustedTranslate:Yt},Wt.current={initial:yn,translated:un}},[Ut,Zt,vn,un,Ft,wn,yn,Kt,Lt,zn,cn,Yt]),ace({...sn,delta:Bt,draggingRect:un,pointerCoordinates:Rn,scrollableAncestors:cn,scrollableAncestorRects:mn});let Tr=En.useMemo(()=>({active:Ut,activeNode:Zt,activeNodeRect:fn,activatorEvent:qt,collisions:vn,containerNodeRect:bn,dragOverlay:xn,draggableNodes:Ft,droppableContainers:Lt,droppableRects:Kt,over:zn,measureDroppableContainers:an,scrollableAncestors:cn,scrollableAncestorRects:mn,measuringConfiguration:rn,measuringScheduled:ln,windowRect:pn}),[Ut,Zt,fn,qt,vn,bn,xn,Ft,Lt,Kt,zn,an,cn,mn,rn,ln,pn]),lr=En.useMemo(()=>({activatorEvent:qt,activators:Bn,active:Ut,activeNodeRect:fn,ariaDescribedById:{draggable:zt},dispatch:It,draggableNodes:Ft,over:zn,measureDroppableContainers:an}),[qt,Bn,Ut,fn,It,zt,Ft,zn,an]);return En.default.createElement(GH.Provider,{value:Nt},En.default.createElement(sb.Provider,{value:lr},En.default.createElement(u9.Provider,{value:Tr},En.default.createElement(Yw.Provider,{value:Gn},Ct)),En.default.createElement(Pce,{disabled:(xt==null?void 0:xt.restoreFocus)===!1})),En.default.createElement(_le,{...xt,hiddenTextDescribedById:zt}));function no(){let An=(Gt==null?void 0:Gt.autoScrollEnabled)===!1,Vn=typeof wt==="object"?wt.enabled===!1:wt===!1,Jn=_t&&!An&&!Vn;if(typeof wt==="object")return{...wt,enabled:Jn};return{enabled:Jn}}}),Ace=En.createContext(null),jH="button",Nce="Draggable";function f9(ot){let{id:st,data:ct,disabled:gt=!1,attributes:bt}=ot,yt=Yh(Nce),{activators:vt,activatorEvent:xt,active:wt,activeNodeRect:Ct,ariaDescribedById:St,draggableNodes:Et,over:kt}=En.useContext(sb),{role:Rt=jH,roleDescription:Tt="draggable",tabIndex:Pt=0}=bt!=null?bt:{},Mt=(wt==null?void 0:wt.id)===st,It=En.useContext(Mt?Yw:Ace),[At,Nt]=Jh(),[Ot,Dt]=Jh(),_t=xce(vt,st),$t=gm(ct);El(()=>(Et.set(st,{id:st,key:yt,node:At,activatorNode:Ot,data:$t}),()=>{let Bt=Et.get(st);if(Bt&&Bt.key===yt)Et.delete(st)}),[Et,st]);let Ft=En.useMemo(()=>({role:Rt,tabIndex:Pt,"aria-disabled":gt,"aria-pressed":Mt&&Rt===jH?!0:void 0,"aria-roledescription":Tt,"aria-describedby":St.draggable}),[gt,Rt,Pt,Mt,Tt,St.draggable]);return{active:wt,activatorEvent:xt,activeNodeRect:Ct,attributes:Ft,isDragging:Mt,listeners:gt?void 0:_t,node:At,over:kt,setNodeRef:Nt,setActivatorNodeRef:Dt,transform:It}}function Dce(){return En.useContext(u9)}var _ce="Droppable",Oce={timeout:25};function m9(ot){let{data:st,disabled:ct=!1,id:gt,resizeObserverConfig:bt}=ot,yt=Yh(_ce),{active:vt,dispatch:xt,over:wt,measureDroppableContainers:Ct}=En.useContext(sb),St=En.useRef({disabled:ct}),Et=En.useRef(!1),kt=En.useRef(null),Rt=En.useRef(null),{disabled:Tt,updateMeasurementsFor:Pt,timeout:Mt}={...Oce,...bt},It=gm(Pt!=null?Pt:gt),At=En.useCallback(()=>{if(!Et.current){Et.current=!0;return}if(Rt.current!=null)clearTimeout(Rt.current);Rt.current=setTimeout(()=>{Ct(Array.isArray(It.current)?It.current:[It.current]),Rt.current=null},Mt)},[Mt]),Nt=Xw({callback:At,disabled:Tt||!vt}),Ot=En.useCallback((Ft,Bt)=>{if(!Nt)return;if(Bt)Nt.unobserve(Bt),Et.current=!1;if(Ft)Nt.observe(Ft)},[Nt]),[Dt,_t]=Jh(Ot),$t=gm(st);return En.useEffect(()=>{if(!Nt||!Dt.current)return;Nt.disconnect(),Et.current=!1,Nt.observe(Dt.current)},[Dt,Nt]),En.useEffect(()=>(xt({type:ii.RegisterDroppable,element:{id:gt,key:yt,disabled:ct,node:Dt,rect:kt,data:$t}}),()=>xt({type:ii.UnregisterDroppable,key:yt,id:gt})),[gt]),En.useEffect(()=>{if(ct!==St.current.disabled)xt({type:ii.SetDroppableDisabled,id:gt,key:yt,disabled:ct}),St.current.disabled=ct},[gt,yt,ct,xt]),{active:vt,rect:kt,isOver:(wt==null?void 0:wt.id)===gt,node:Dt,over:wt,setNodeRef:_t}}function Lce(ot){let{animation:st,children:ct}=ot,[gt,bt]=En.useState(null),[yt,vt]=En.useState(null),xt=Xh(ct);if(!ct&&!gt&&xt)bt(xt);return El(()=>{if(!yt)return;let wt=gt==null?void 0:gt.key,Ct=gt==null?void 0:gt.props.id;if(wt==null||Ct==null){bt(null);return}Promise.resolve(st(Ct,yt)).then(()=>{bt(null)})},[st,gt,yt]),En.default.createElement(En.default.Fragment,null,ct,gt?En.cloneElement(gt,{ref:vt}):null)}var Bce={x:0,y:0,scaleX:1,scaleY:1};function Fce(ot){let{children:st}=ot;return En.default.createElement(sb.Provider,{value:c9},En.default.createElement(Yw.Provider,{value:Bce},st))}var Hce={position:"fixed",touchAction:"none"},zce=(ot)=>Vw(ot)?"transform 250ms ease":void 0,$ce=En.forwardRef((ot,st)=>{let{as:ct,activatorEvent:gt,adjustScale:bt,children:yt,className:vt,rect:xt,style:wt,transform:Ct,transition:St=zce}=ot;if(!xt)return null;let Et=bt?Ct:{...Ct,scaleX:1,scaleY:1},kt={...Hce,width:xt.width,height:xt.height,top:xt.top,left:xt.left,transform:fm.Transform.toString(Et),transformOrigin:bt&&gt?Lle(gt,xt):void 0,transition:typeof St==="function"?St(gt):St,...wt};return En.default.createElement(ct,{className:vt,style:kt,ref:st},yt)}),Wce=(ot)=>(st)=>{let{active:ct,dragOverlay:gt}=st,bt={},{styles:yt,className:vt}=ot;if(yt!=null&&yt.active)for(let[xt,wt]of Object.entries(yt.active)){if(wt===void 0)continue;bt[xt]=ct.node.style.getPropertyValue(xt),ct.node.style.setProperty(xt,wt)}if(yt!=null&&yt.dragOverlay)for(let[xt,wt]of Object.entries(yt.dragOverlay)){if(wt===void 0)continue;gt.node.style.setProperty(xt,wt)}if(vt!=null&&vt.active)ct.node.classList.add(vt.active);if(vt!=null&&vt.dragOverlay)gt.node.classList.add(vt.dragOverlay);return function(){for(let[wt,Ct]of Object.entries(bt))ct.node.style.setProperty(wt,Ct);if(vt!=null&&vt.active)ct.node.classList.remove(vt.active)}},Uce=(ot)=>{let{transform:{initial:st,final:ct}}=ot;return[{transform:fm.Transform.toString(st)},{transform:fm.Transform.toString(ct)}]},jce={duration:250,easing:"ease",keyframes:Uce,sideEffects:Wce({styles:{active:{opacity:"0"}}})};function Vce(ot){let{config:st,draggableNodes:ct,droppableContainers:gt,measuringConfiguration:bt}=ot;return Qh((yt,vt)=>{if(st===null)return;let xt=ct.get(yt);if(!xt)return;let wt=xt.node.current;if(!wt)return;let Ct=l9(vt);if(!Ct)return;let{transform:St}=Fi(vt).getComputedStyle(vt),Et=JH(St);if(!Et)return;let kt=typeof st==="function"?st:Gce(st);return r9(wt,bt.draggable.measure),kt({active:{id:yt,data:xt.data,node:wt,rect:bt.draggable.measure(wt)},draggableNodes:ct,dragOverlay:{node:vt,rect:bt.dragOverlay.measure(Ct)},droppableContainers:gt,measuringConfiguration:bt,transform:Et})})}function Gce(ot){let{duration:st,easing:ct,sideEffects:gt,keyframes:bt}={...jce,...ot};return(yt)=>{let{active:vt,dragOverlay:xt,transform:wt,...Ct}=yt;if(!st)return;let St={x:xt.rect.left-vt.rect.left,y:xt.rect.top-vt.rect.top},Et={scaleX:wt.scaleX!==1?vt.rect.width*wt.scaleX/xt.rect.width:1,scaleY:wt.scaleY!==1?vt.rect.height*wt.scaleY/xt.rect.height:1},kt={x:wt.x-St.x,y:wt.y-St.y,...Et},Rt=bt({...Ct,active:vt,dragOverlay:xt,transform:{initial:wt,final:kt}}),[Tt]=Rt,Pt=Rt[Rt.length-1];if(JSON.stringify(Tt)===JSON.stringify(Pt))return;let Mt=gt==null?void 0:gt({active:vt,dragOverlay:xt,...Ct}),It=xt.node.animate(Rt,{duration:st,easing:ct,fill:"forwards"});return new Promise((At)=>{It.onfinish=()=>{Mt==null||Mt(),At()}})}}var VH=0;function Kce(ot){return En.useMemo(()=>{if(ot==null)return;return VH++,VH},[ot])}var g9=En.default.memo((ot)=>{let{adjustScale:st=!1,children:ct,dropAnimation:gt,style:bt,transition:yt,modifiers:vt,wrapperElement:xt="div",className:wt,zIndex:Ct=999}=ot,{activatorEvent:St,active:Et,activeNodeRect:kt,containerNodeRect:Rt,draggableNodes:Tt,droppableContainers:Pt,dragOverlay:Mt,over:It,measuringConfiguration:At,scrollableAncestors:Nt,scrollableAncestorRects:Ot,windowRect:Dt}=Dce(),_t=En.useContext(Yw),$t=Kce(Et==null?void 0:Et.id),Ft=p9(vt,{activatorEvent:St,active:Et,activeNodeRect:kt,containerNodeRect:Rt,draggingNodeRect:Mt.rect,over:It,overlayNodeRect:Mt.rect,scrollableAncestors:Nt,scrollableAncestorRects:Ot,transform:_t,windowRect:Dt}),Bt=mP(kt),Lt=Vce({config:gt,draggableNodes:Tt,droppableContainers:Pt,measuringConfiguration:At}),Vt=Bt?Mt.setRef:void 0;return En.default.createElement(Fce,null,En.default.createElement(Lce,{animation:Lt},Et&&$t?En.default.createElement($ce,{key:$t,id:Et.id,ref:Vt,as:xt,activatorEvent:St,adjustScale:st,className:wt,transition:yt,rect:Bt,style:{zIndex:Ct,...bt},transform:Ft},ct):null))});var ud=e(r(),1),qce={start:[Zr.Space],cancel:[Zr.Esc],end:[Zr.Space,Zr.Tab]};function Qce(ot,st,ct){let gt=ot.indexOf(st),bt=ot.indexOf(ct);if(gt<0||bt<0||gt===bt)return ot;let yt=[...ot],[vt]=yt.splice(gt,1);return yt.splice(bt,0,vt),yt}function Zw({items:ot,getId:st,className:ct,itemClassName:gt,dragDisabled:bt=!1,isItemDragDisabled:yt,onReorder:vt,renderItem:xt,renderPlaceholder:wt,renderOverlay:Ct}){let St=KH(dP(ib,{activationConstraint:{distance:4}}),dP(ob,{keyboardCodes:qce})),[Et,kt]=Fu.useState(null),[Rt,Tt]=Fu.useState(null),Pt=Fu.useRef(null),Mt=Fu.useMemo(()=>ot.map(st),[ot,st]),It=Fu.useMemo(()=>new Map(ot.map((Bt)=>[st(Bt),Bt])),[ot,st]),Nt=(Et&&Rt?Rt:Mt).map((Bt)=>It.get(Bt)).filter((Bt)=>Boolean(Bt)),Ot=Et?It.get(Et):void 0,Dt=yt?ot.filter((Bt)=>!yt(Bt)).length:ot.length,_t=bt||Dt<2;return ud.jsxs(d9,{sensors:St,collisionDetection:qH,onDragStart:(Bt)=>{let Lt=ot.map(st);kt(String(Bt.active.id)),Pt.current=Lt,Tt(Lt)},onDragOver:(Bt)=>{let Lt=String(Bt.active.id),Vt=Bt.over?String(Bt.over.id):void 0,Wt=Pt.current;if(!Vt||Vt===Lt||!Wt)return;let Ut=Qce(Wt,Lt,Vt);if(Ut===Wt)return;Pt.current=Ut,Tt(Ut)},onDragCancel:()=>{Pt.current=null,kt(null),Tt(null)},onDragEnd:(Bt)=>{let Lt=String(Bt.active.id),Vt=Pt.current;if(Pt.current=null,kt(null),Tt(null),!Vt||Vt.join("|")===Mt.join("|"))return;if(!Vt.includes(Lt))return;vt(Vt)},children:[ud.jsx("div",{className:ct,children:Nt.map((Bt)=>ud.jsx(Jce,{id:st(Bt),item:Bt,disabled:_t||yt?.(Bt)===!0,itemClassName:gt,renderItem:xt,renderPlaceholder:wt},st(Bt)))}),ud.jsx(g9,{dropAnimation:null,children:Ot&&Ct?Ct(Ot):null})]})}function Jce({id:ot,item:st,disabled:ct,itemClassName:gt,renderItem:bt,renderPlaceholder:yt}){let{setNodeRef:vt,isOver:xt}=m9({id:ot,disabled:ct}),{attributes:wt,listeners:Ct,setNodeRef:St,isDragging:Et}=f9({id:ot,disabled:ct,attributes:{roleDescription:"sortable item"}}),kt=(Tt)=>{vt(Tt),St(Tt)},Rt={isDragging:Et,isOver:xt,dragDisabled:ct,dragHandleProps:ct?{}:{...wt,...Ct}};return ud.jsxs(S.div,{layout:!0,ref:kt,className:n("relative",gt?.(st,Rt)),transition:{type:"spring",duration:0.25,bounce:0},children:[Et&&yt?.(st),bt(st,Rt)]})}var pr=e(r(),1);function Xce(ot){return n(X({variant:"ghost",size:"icon-lg"}),ot&&"bg-accent text-accent-foreground")}function vm({children:ot,showWorkspaces:st=!0}){let{data:ct}=qx(),gt=Kn();return E((bt)=>{if(bt.type==="workspace:updated"||bt.type==="theme:updated"||bt.type==="workspaces-list:updated"){if(bt.type!=="theme:updated"&&bt.origin===V)return;gt.invalidateQueries({queryKey:Tn.all,exact:!0})}}),pr.jsxs("div",{className:"flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none",children:[pr.jsx(Yce,{workspaces:st?ct??[]:[]}),pr.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:ot})]})}function Yce({workspaces:ot}){let{environment:st}=R(),{demo:ct}=mu(),gt=GF();return pr.jsx(sv,{delay:500,children:pr.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[pr.jsxs(Wr,{children:[pr.jsx(Ur,{render:pr.jsx(ql,{href:"/","aria-label":"Home",className:Xce,children:pr.jsx(zL,{stroke:1.5})})}),pr.jsx(jr,{side:"right",children:"Home"})]}),pr.jsx("nav",{className:"flex max-h-full min-h-0 w-14 flex-1 flex-col items-center justify-center gap-4",children:ot.length>0&&pr.jsxs(pr.Fragment,{children:[pr.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:pr.jsx(Zw,{items:ot,getId:(bt)=>bt.id,className:"flex flex-col gap-4",onReorder:(bt)=>gt.mutate(bt),renderPlaceholder:()=>pr.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-12 rounded-xl bg-accent"}),renderOverlay:(bt)=>pr.jsx(h9,{workspace:bt,dragOverlay:!0}),renderItem:(bt,yt)=>pr.jsx(h9,{workspace:bt,dragState:yt})})}),pr.jsx("div",{className:"shrink-0",children:pr.jsxs(Wr,{children:[pr.jsx(jh,{trigger:pr.jsx(Ur,{render:pr.jsx(a,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:pr.jsx(Ci,{"data-icon":"inline-start",stroke:1.5})})})}),pr.jsx(jr,{side:"right",children:"Create new workspace"})]})})]})}),pr.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-4",children:[st==="local"&&pr.jsx(Zce,{}),ct?pr.jsxs(Wr,{children:[pr.jsx(am,{trigger:pr.jsx(Ur,{render:pr.jsx(a,{size:"icon","aria-label":"Set up Moi",children:pr.jsx(LL,{stroke:1.5})})})}),pr.jsx(jr,{side:"right",children:"Set up Moi"})]}):pr.jsx(RH,{})]})]})})}function Zce(){let ot=XF();return ot.status==="available"?pr.jsx(YF,{...ot.button}):null}function h9({workspace:ot,dragOverlay:st=!1,dragState:ct}){let[gt]=Ai(),bt=`/workspace/${ot.id}`,yt=rd(ot),vt=gt===bt||gt.startsWith(`${bt}/`),xt=pr.jsx("div",{className:n(X({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12 transition-[border-radius,background-color,color] duration-100 ease-out motion-reduce:transition-none",st?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",vt&&!st&&"bg-accent text-accent-foreground"),children:pr.jsx(yl,{icon:ot.icon,workspaceType:ot.type,workspaceTheme:ot.theme,className:"size-7 shrink-0 rounded-md transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"})}),wt=pr.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:yt});if(st)return pr.jsxs("span",{className:"flex w-14 flex-col items-center",children:[xt,wt]});return pr.jsxs(ql,{href:bt,"aria-label":yt,onClick:(Ct)=>{if(ct?.isDragging)Ct.preventDefault()},className:n("group flex w-14 flex-col items-center rounded-xl outline-none",ct?.isDragging&&"invisible"),...ct?.dragHandleProps,children:[xt,pr.jsxs(Wr,{children:[pr.jsx(Ur,{render:wt}),pr.jsx(jr,{side:"right",children:yt})]})]})}var k9=e(t(),1);var xm=e(t(),1);var eue=e(t(),1);var y9=e(r(),1);function b9({className:ot,...st}){return y9.jsx("label",{"data-slot":"label",className:u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",ot),...st})}var Hu=e(r(),1);function e1({className:ot,...st}){return Hu.jsx("div",{"data-slot":"field-group",className:u("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",ot),...st})}var tue=oe("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function ab({className:ot,orientation:st="vertical",...ct}){return Hu.jsx("div",{role:"group","data-slot":"field","data-orientation":st,className:u(tue({orientation:st}),ot),...ct})}function v9({className:ot,...st}){return Hu.jsx("div",{"data-slot":"field-content",className:u("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",ot),...st})}function gP({className:ot,...st}){return Hu.jsx(b9,{"data-slot":"field-label",className:u("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-accent has-data-checked:bg-accent has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-accent has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",ot),...st})}function x9({className:ot,...st}){return Hu.jsx("div",{"data-slot":"field-label",className:u("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",ot),...st})}function w9({className:ot,...st}){return Hu.jsx("p",{"data-slot":"field-description",className:u('text-left text-sm leading-normal font-normal text-muted-foreground [:where([class~="group/field"]):has([data-horizontal])_&]:text-balance [[data-variant=legend]+&]:-mt-1.5',"last:mt-0 nth-last-2:-mt-1","[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",ot),...st})}var C9=e(t(),1),pd=e(r(),1);function t1({title:ot,description:st,children:ct}){let gt=C9.useId();return pd.jsxs("section",{"aria-labelledby":gt,className:"-mx-6 flex min-w-0 flex-col rounded-2xl bg-background p-6 shadow-xs",children:[pd.jsxs("header",{className:"mb-6 flex flex-col gap-1",children:[pd.jsx("h2",{id:gt,className:"text-lg font-medium",children:ot}),st&&pd.jsx("p",{className:"text-sm text-muted-foreground",children:st})]}),pd.jsx("div",{className:"flex min-w-0 flex-col gap-6",children:ct})]})}var _a=e(r(),1);function S9(){let ot=mu();if(!ot.profile)return null;return _a.jsx(t1,{title:"Profile",children:_a.jsxs(e1,{children:[_a.jsx(nue,{name:ot.profile.name??"",readOnly:!ot.canEdit,onSave:ot.saveName},ot.profile.id),ot.email&&_a.jsxs(ab,{children:[_a.jsx(gP,{htmlFor:"profile-email",children:"Email"}),_a.jsx(wl,{id:"profile-email",value:ot.email,readOnly:!0,type:"email"})]})]})})}function nue({name:ot,readOnly:st,onSave:ct}){let gt=xm.useId(),[bt,yt]=xm.useState(),vt=zr({mutationFn:ct,onSuccess:()=>yt(void 0),onError:(St)=>qr.add({title:"Couldn’t save name",description:St.message,type:"error"})}),xt=vt.isPending,wt=xm.useRef(!1);function Ct(){if(st||xt)return;let St=(bt??ot).trim();if(!St||St.length>80||St===ot){yt(void 0);return}yt(St),vt.mutate(St)}return _a.jsxs(ab,{children:[_a.jsx(gP,{htmlFor:gt,children:"Name"}),_a.jsx(wl,{id:gt,value:bt??ot,autoComplete:"name",maxLength:80,readOnly:st,disabled:xt,onChange:(St)=>yt(St.target.value),onBlur:()=>{if(wt.current){wt.current=!1;return}Ct()},onKeyDown:(St)=>{if(St.nativeEvent.isComposing)return;if(St.key==="Enter")St.preventDefault(),St.currentTarget.blur();if(St.key==="Escape")St.preventDefault(),wt.current=!0,yt(void 0),St.currentTarget.blur()}})]})}var kl=e(r(),1);function E9(){let ot=Wf(),[,st]=Ai();return kl.jsxs(t1,{title:"General",children:[kl.jsx(e1,{children:kl.jsxs(ab,{orientation:"responsive",children:[kl.jsxs(v9,{children:[kl.jsx(x9,{children:"Restart onboarding"}),kl.jsx(w9,{children:"Go through the onboarding without logging out"})]}),kl.jsx(a,{variant:"secondary","aria-label":"Restart onboarding",disabled:ot.isPending,onClick:()=>ot.mutate({showOnboarding:!0},{onSuccess:()=>st("/onboarding")}),children:ot.isPending?"Opening…":"Restart"})]})}),ot.isError&&kl.jsx("p",{role:"alert",children:"Couldn’t restart onboarding. Try again"})]})}var Hi=e(r(),1);function R9(){let ot=mu();if(k9.useEffect(()=>{if(ot.cloud&&!ot.demo&&ot.status==="signed-out")window.location.replace("/cloud/login")},[ot.cloud,ot.demo,ot.status,ot.registered]),ot.demo)return Hi.jsx(Ac,{to:"/",replace:!0});if(ot.status==="signed-out")return null;return Hi.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:Hi.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-6 px-6 py-8 sm:px-10 sm:py-12",children:[Hi.jsx("h1",{className:"text-xl font-medium",children:"Settings"}),ot.status==="loading"?Hi.jsxs("div",{className:"flex flex-col gap-4","aria-label":"Loading settings",children:[Hi.jsx(Bs,{className:"h-7 w-32"}),Hi.jsx(Bs,{className:"h-10 w-full max-w-md"}),Hi.jsx(Bs,{className:"h-10 w-full max-w-md"})]}):ot.status==="error"?Hi.jsxs("div",{className:"flex flex-col items-start gap-3",children:[Hi.jsx("p",{role:"alert",children:"Couldn’t load your account"}),Hi.jsx(a,{variant:"outline",onClick:ot.retry,children:"Try again"})]}):Hi.jsxs("div",{className:"flex w-full max-w-xl min-w-0 flex-col gap-4",children:[Hi.jsx(S9,{}),Hi.jsx(E9,{})]})]})})}var hP=e(r(),1);function T9(){return hP.jsx(vm,{showWorkspaces:!1,children:hP.jsx(R9,{})})}var v8=e(t(),1);var P9=e(t(),1);var wm=e(r(),1);function I9({choice:ot,isPending:st,errorMessage:ct,onTypeChange:gt,onSubmit:bt,onReset:yt}){let[vt,xt]=P9.useState(!0),wt=tm(),Ct=wt.isPending||wt.isFetching,St=wt.isError?void 0:wt.data,Et=hw(St,ot.workspace.types),kt=!Ct&&!St?"Could not check installed agents.":void 0,Rt=!st&&!Ct&&!kt&&Et.some((Mt)=>Mt.type===ot.selectedType&&!Mt.disabled);function Tt(Mt){if(!Mt&&st)return;xt(Mt)}function Pt(Mt){if(!Mt)yt()}return wm.jsx(Tu,{open:vt,onOpenChange:Tt,onOpenChangeComplete:Pt,children:wm.jsx(yw,{showCloseButton:!st,children:wm.jsx(bw,{title:`Import ${rd(ot.workspace)}`,selectedType:ot.selectedType,options:Et,isLoading:Ct&&!St,isPending:st||Ct||Boolean(kt),errorMessage:kt??ct,secondaryAction:wm.jsx(zh,{render:wm.jsx(a,{variant:"secondary"}),disabled:st,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:st?"Adding…":void 0,onTypeChange:gt,onSubmit:()=>{if(Rt)bt()}})})})}var M9=e(t(),1);function rue(ot){return ot.types[0]??sm[0]}function A9({onSuccess:ot}){let st=IF(),[ct,gt]=M9.useState(null);function bt(wt){st.reset(),gt({workspace:wt,selectedType:rue(wt)})}function yt(wt){gt((Ct)=>Ct?{...Ct,selectedType:wt}:Ct)}function vt(){if(!ct||st.isPending)return;st.mutate({path:ct.workspace.path,type:ct.selectedType},{onSuccess:ot})}function xt(){gt(null),st.reset()}return{choice:ct,isPending:st.isPending,error:st.error,startImport:bt,selectType:yt,submit:vt,reset:xt}}var cb=e(t(),1);var ub=e(r(),1),oue=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],zu=10,n1=3,iue=2.5,sue={O:1,o:0.5,".":0},aue=3000,lue=2,N9=3,$u=3,D9=0.001,dd={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function cue(ot){let st=Math.max(...ot.map((yt)=>yt.length)),ct=st*zu+(st-1)*n1,gt=ot.length*zu+(ot.length-1)*n1,bt=[];return ot.forEach((yt,vt)=>{Array.from(yt).forEach((xt,wt)=>{let Ct=sue[xt];if(Ct===void 0)return;let St=wt*(zu+n1),Et=vt*(zu+n1);bt.push({x:St,y:Et,centerX:St+zu/2,centerY:Et+zu/2,targetOpacity:Ct})})}),{width:ct,height:gt,fieldColumns:Math.round(ct/$u)+1,fieldRows:Math.round(gt/$u)+1,pixels:bt}}var uue=oue.map(cue);function lb(ot,st,ct){return ot<st?st:ot>ct?ct:ot}function pue(ot){return ot<0.5?2*ot*ot:1-(-2*ot+2)**2/2}class _9{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor(ot,st,ct){this.rects=ot,this.svg=st,this.geometry=ct;let gt=ct.fieldColumns*ct.fieldRows;this.field=new Float32Array(gt),this.previousField=new Float32Array(gt),this.nextField=new Float32Array(gt)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=(ot)=>{let st=this.svg.getBoundingClientRect();if(!st.width||!st.height)return;if(this.pointerActive=ot.clientX>=st.left&&ot.clientX<=st.right&&ot.clientY>=st.top&&ot.clientY<=st.bottom,this.pointerActive)this.pointerX=(ot.clientX-st.left)/st.width*this.geometry.width,this.pointerY=(ot.clientY-st.top)/st.height*this.geometry.height,this.resume()};seedImpulse(){let ot=Math.round(this.geometry.width/2/$u),st=Math.round(this.geometry.height/2/$u),ct=2*N9*N9;for(let gt=0;gt<this.geometry.fieldRows;gt++)for(let bt=0;bt<this.geometry.fieldColumns;bt++){let yt=(bt-ot)**2+(gt-st)**2,vt=lue*Math.exp(-yt/ct),xt=gt*this.geometry.fieldColumns+bt;this.field[xt]=vt,this.previousField[xt]=vt}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=(ot)=>{if(this.stepWave(),this.pointerActive)this.driveWave(ot);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=ot;let ct=(ot-this.introStartedAt)/aue;if(this.activation=1-pue(Math.min(1,ct)),ct>=1)this.intro=!1}else{this.intro=!1;let ct=this.pointerActive?1:0,gt=this.pointerActive?dd.fadeIn:dd.fadeOut;this.activation+=(ct-this.activation)*gt}let st=this.renderWave();if(this.intro||this.pointerActive||this.activation>D9||st>D9){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:ot,fieldRows:st}=this.geometry;for(let gt=1;gt<st-1;gt++)for(let bt=1;bt<ot-1;bt++){let yt=gt*ot+bt,vt=this.field[yt-1]+this.field[yt+1]+this.field[yt-ot]+this.field[yt+ot]-4*this.field[yt];this.nextField[yt]=(2*this.field[yt]-this.previousField[yt]+dd.courantSquared*vt)*dd.damping}let ct=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=ct}driveWave(ot){let st=lb(Math.round(this.pointerX/$u),1,this.geometry.fieldColumns-2),ct=lb(Math.round(this.pointerY/$u),1,this.geometry.fieldRows-2);this.field[ct*this.geometry.fieldColumns+st]=dd.driveAmplitude*Math.sin(ot*dd.driveFrequency)}sampleField(ot,st){let ct=lb(ot/$u,0,this.geometry.fieldColumns-1),gt=lb(st/$u,0,this.geometry.fieldRows-1),bt=Math.floor(ct),yt=Math.floor(gt),vt=Math.min(bt+1,this.geometry.fieldColumns-1),xt=Math.min(yt+1,this.geometry.fieldRows-1),wt=ct-bt,Ct=gt-yt,{fieldColumns:St}=this.geometry,Et=this.field[yt*St+bt],kt=this.field[yt*St+vt],Rt=this.field[xt*St+bt],Tt=this.field[xt*St+vt];return(Et*(1-wt)+kt*wt)*(1-Ct)+(Rt*(1-wt)+Tt*wt)*Ct}renderWave(){let ot=0;return this.geometry.pixels.forEach((st,ct)=>{let gt=this.rects[ct];if(!gt)return;let bt=this.sampleField(st.centerX,st.centerY);ot=Math.max(ot,Math.abs(bt));let yt=lb(0.5+bt*dd.gain,0,1),vt=st.targetOpacity*(1-this.activation)+yt*this.activation;gt.setAttribute("opacity",vt.toFixed(3))}),ot}renderTargets(){this.geometry.pixels.forEach((ot,st)=>{this.rects[st]?.setAttribute("opacity",String(ot.targetOpacity))})}}function due({geometry:ot}){let st=cb.useRef([]),ct=cb.useRef(null);return cb.useEffect(()=>{let gt=ct.current;if(!gt||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let bt=new _9(st.current,gt,ot);return bt.start(),window.addEventListener("pointermove",bt.handlePointerMove),()=>{bt.stop(),window.removeEventListener("pointermove",bt.handlePointerMove)}},[ot]),ub.jsx("svg",{ref:ct,className:"h-8 w-auto",viewBox:`0 0 ${ot.width} ${ot.height}`,fill:"currentColor","aria-hidden":"true",children:ot.pixels.map((gt,bt)=>ub.jsx("rect",{ref:(yt)=>{st.current[bt]=yt},x:gt.x,y:gt.y,width:zu,height:zu,rx:iue,opacity:gt.targetOpacity},`${gt.x}-${gt.y}`))})}function O9({className:ot}){return ub.jsx("div",{role:"img","aria-label":"Moi",className:n("flex items-center gap-2 text-accent",ot),children:uue.map((st,ct)=>ub.jsx(due,{geometry:st},ct))})}function bP({l:ot,c:st,h:ct}){let gt=ct*Math.PI/180,bt=st*Math.cos(gt),yt=st*Math.sin(gt),vt=ot+0.3963377774*bt+0.2158037573*yt,xt=ot-0.1055613458*bt-0.0638541728*yt,wt=ot-0.0894841775*bt-1.291485548*yt,Ct=vt*vt*vt,St=xt*xt*xt,Et=wt*wt*wt;return[4.0767416621*Ct-3.3077115913*St+0.2309699292*Et,-1.2684380046*Ct+2.6097574011*St-0.3413193965*Et,-0.0041960863*Ct-0.7034186147*St+1.707614701*Et]}var L9=(ot)=>ot.every((st)=>st>=-0.0001&&st<=1.0001);function z9(ot){let st=bP(ot);if(!L9(st)){let ct=0,gt=ot.c;for(let bt=0;bt<12;bt++){let yt=(ct+gt)/2;if(L9(bP({...ot,c:yt})))ct=yt;else gt=yt}st=bP({...ot,c:ct})}return st.map((ct)=>Math.min(1,Math.max(0,ct)))}function B9(ot){let[st,ct,gt]=z9(ot);return 0.2126*st+0.7152*ct+0.0722*gt}function pb(ot,st){let ct=B9(ot),gt=B9(st);return(Math.max(ct,gt)+0.05)/(Math.min(ct,gt)+0.05)}function F9(ot,st,ct){if(pb(ot,st)>=ct)return ot;let gt=ot.l>=st.l?1:-1;for(let vt of[gt,-gt]){let xt={...ot};for(let wt=0;wt<60;wt++){if(xt.l=Math.min(1,Math.max(0,xt.l+vt*0.02)),pb(xt,st)>=ct)return xt;if(xt.l===0||xt.l===1)break}}let bt={...ot,l:0,c:0},yt={...ot,l:1,c:0};return pb(bt,st)>=pb(yt,st)?bt:yt}function r1(ot){return"#"+z9(ot).map((st)=>{let ct=st<=0.0031308?12.92*st:1.055*Math.pow(st,0.4166666666666667)-0.055;return Math.round(ct*255).toString(16).padStart(2,"0")}).join("")}function Cm(ot){let st=parseInt(ot.slice(1),16),[ct,gt,bt]=[st>>16&255,st>>8&255,st&255].map((St)=>{let Et=St/255;return Et<=0.04045?Et/12.92:Math.pow((Et+0.055)/1.055,2.4)}),yt=Math.cbrt(0.4122214708*ct+0.5363325363*gt+0.0514459929*bt),vt=Math.cbrt(0.2119034982*ct+0.6806995451*gt+0.1073969566*bt),xt=Math.cbrt(0.0883024619*ct+0.2817188376*gt+0.6299787005*bt),wt=1.9779984951*yt-2.428592205*vt+0.4505937099*xt,Ct=0.0259040371*yt+0.7827717662*vt-0.808675766*xt;return{l:0.2104542553*yt+0.793617785*vt-0.0040720468*xt,c:Math.hypot(wt,Ct),h:Math.atan2(Ct,wt)*180/Math.PI}}function fue(ot,st,ct){let gt=(St)=>St*Math.PI/180,bt=ot.c*Math.cos(gt(ot.h)),yt=ot.c*Math.sin(gt(ot.h)),vt=st.c*Math.cos(gt(st.h)),xt=st.c*Math.sin(gt(st.h)),wt=bt+(vt-bt)*ct,Ct=yt+(xt-yt)*ct;return{l:ot.l+(st.l-ot.l)*ct,c:Math.hypot(wt,Ct),h:Math.atan2(Ct,wt)*180/Math.PI}}var o1=(ot,st,ct)=>r1(fue(Cm(ot),Cm(st),ct));var mue={h:12,l:0.84,pull:0.4,c:0.1};var H9=4.55;function gue(ot,st,ct){let gt=Cm(ot),bt=Cm(st),yt={l:gt.l+(ct.l-gt.l)*ct.pull,c:Math.max(gt.c,ct.c),h:ct.h};yt=F9(yt,hue,bue);let vt=F9(bt,yt,H9),xt=vt.l>=yt.l?1:-1,wt=r1(yt);for(let Ct=0;Ct<40;Ct++){let St=r1(vt),Et=1/0;for(let Rt=0;Rt<=10;Rt++){let Tt=Rt/10;Et=Math.min(Et,pb(Cm(o1(st,St,Tt)),Cm(o1(ot,wt,Tt))))}if(Et>=H9)return[wt,St];let kt=Math.min(1,Math.max(0,vt.l+xt*0.02));if(kt===vt.l)return[wt,St];vt={...vt,l:kt}}return[wt,r1(vt)]}var hue={l:0.145,c:0,h:0},bue=1.5;var yP={esx:1,esy:1,tilt:0,edy:0,edx:0,esx2:0,esy2:0,tilt2:0,edy2:0,lock:0,heat:0,shake:0,rock:0,bdy:0},$9=(ot)=>String(Math.round(ot*1000)/1000);function Rl(ot,st){return{l:{...ot,eyes:ot.eyes.map((ct,gt)=>({...ct,cx:ct.cx+st.edx*(gt?1:-1),cy:ct.cy+st.edy+(gt?st.edy2:0),rx:ct.rx*(st.esx+(gt?st.esx2:0)),ry:ct.ry*(st.esy+(gt?st.esy2:0)),rot:ct.rot*(1-st.lock)+(st.tilt+(gt?st.tilt2:0))*(gt?1:-1)}))},wrap:st.bdy!==0?`translate(0 ${$9(st.bdy)})`:""}}function Tl(ot){let st={};for(let ct in yP){if(ct==="heat")continue;let gt=ot[ct];if(gt!==yP[ct])st["--mo-"+ct]=$9(gt)}return st}function yue(ot,st,ct){let[gt,bt]=gue(ot.head,ot.eye,ct);return{...ot,head:o1(ot.head,gt,st.heat),eye:o1(ot.eye,bt,st.heat)}}var W9={p:yP,vars:Tl,bake:Rl},U9={p:{esx:1.72,esy:0.3,tilt:8,edy:-1.5,edx:1.5,esx2:0.08,esy2:0.05,tilt2:-16,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-2.2},vars:Tl,bake:Rl},j9={p:{esx:0.6,esy:0.56,tilt:26,edy:3.6,edx:1.9,esx2:-0.05,esy2:-0.07,tilt2:-7,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:2.6},vars:Tl,bake:Rl};var V9={p:{esx:1.34,esy:1.2,tilt:-6,edy:-1.05,edx:0.5,esx2:0.05,esy2:0.07,tilt2:3,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.4},vars:Tl,bake:Rl},G9={p:{esx:1.32,esy:0.76,tilt:5,edy:-0.6,edx:0.8,esx2:0.26,esy2:-0.56,tilt2:-11,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.1},vars:Tl,bake:Rl},K9={p:{esx:1.14,esy:0.22,tilt:0,edy:2.4,edx:0.3,esx2:-0.04,esy2:0.03,tilt2:4,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:1.2},vars:Tl,bake:Rl},q9={p:{esx:1.3,esy:0.42,tilt:18,edy:-0.5,edx:0.5,esx2:0.06,esy2:-0.06,tilt2:-36,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1},vars:Tl,bake:Rl},Q9={p:{esx:0.95,esy:1.02,tilt:4,edy:-0.2,edx:0.3,esx2:0.24,esy2:-0.44,tilt2:-18,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:0},vars:Tl,bake:Rl};var J9={p:{esx:0.62,esy:0.5,tilt:10,edy:1.4,edx:-0.2,esx2:-0.05,esy2:-0.04,tilt2:-8,edy2:0,lock:1,heat:0.55,shake:0,rock:0,bdy:0.9},vars:Tl,bake:Rl,tint:(ot,st)=>yue(ot,st,mue)};var X9={p:{esx:1.15,esy:0.62,tilt:0,edy:4.2,edx:0.4,esx2:0.02,esy2:0.06,tilt2:0,edy2:-8.4,lock:1,heat:0,shake:0,rock:0.8,bdy:-0.4},vars:Tl,bake:Rl};var Y9=e(r(),1),vue="moi-agent",xue={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},wue={idle:W9,happy:U9,sad:j9,surprised:V9,wink:G9,sleepy:K9,smug:q9,unsure:Q9,shy:J9,thinking:X9};function Pl({size:ot=56,preset:st=bl.agent,animated:ct=!1,color:gt="default",expression:bt="idle",className:yt}){return Y9.jsx(Rv,{name:vue,size:ot,animate:ct?"always":"hover",palette:xue[gt],expression:bt?wue[bt]:void 0,className:n("shrink-0",yt),traits:Nh[st].traits})}var db=e(t(),1);var i1=e(t(),1);function Z9(ot){let{open:st,defaultOpen:ct=!1,onOpenChange:gt,disabled:bt}=ot,[yt,vt]=ms({controlled:st,default:ct,name:"Collapsible",state:"open"}),{mounted:xt,setMounted:wt,transitionStatus:Ct}=Xs(yt,!0,!0),St=Cr(),[Et,kt]=i1.useState(),Rt=Et===null?void 0:Et??St,Tt=s((Pt)=>{let Mt=!yt,It=Ln(Xa,Pt.nativeEvent);if(gt(Mt,It),It.isCanceled)return;vt(Mt)});return i1.useMemo(()=>({defaultPanelId:St,disabled:bt,handleTrigger:Tt,mounted:xt,open:yt,panelId:Rt,setMounted:wt,setOpen:vt,setPanelIdState:kt,transitionStatus:Ct}),[St,bt,Tt,xt,yt,Rt,wt,vt,kt,Ct])}var s1=e(t(),1),vP=s1.createContext(void 0);function a1(){let ot=s1.useContext(vP);if(ot===void 0)throw Error(c(15));return ot}var e8="data-open",t8="data-closed",n8=Jl,$st=Ep;var o8="data-panel-open";var Sue={[e8]:""},Eue={[t8]:""},i8={open(ot){if(ot)return{[o8]:""};return null}},s8={open(ot){if(ot)return Sue;return Eue}};var l1={...s8,...fi};var a8=e(r(),1),l8=db.forwardRef(function(st,ct){let{render:gt,className:bt,defaultOpen:yt=!1,disabled:vt=!1,onOpenChange:xt,open:wt,style:Ct,...St}=st,Et=s(xt),kt=Z9({open:wt,defaultOpen:yt,onOpenChange:Et,disabled:vt}),Rt=db.useMemo(()=>({open:kt.open,disabled:kt.disabled,transitionStatus:kt.transitionStatus}),[kt.open,kt.disabled,kt.transitionStatus]),Tt=db.useMemo(()=>({...kt,onOpenChange:Et,state:Rt}),[kt,Et,Rt]),Pt=l("div",st,{state:Rt,ref:ct,props:St,stateAttributesMapping:l1});return a8.jsx(vP.Provider,{value:Tt,children:Pt})});var c8=e(t(),1);var kue={...i8,...fi},u8=c8.forwardRef(function(st,ct){let{panelId:gt,open:bt,handleTrigger:yt,state:vt,disabled:xt}=a1(),{className:wt,disabled:Ct=xt,render:St,nativeButton:Et=!0,style:kt,...Rt}=st,{getButtonProps:Tt,buttonRef:Pt}=P({disabled:Ct,focusableWhenDisabled:!0,native:Et});return l("button",st,{state:vt,ref:[ct,Pt],props:[{"aria-controls":bt?gt:void 0,"aria-expanded":bt,onClick:yt},Rt,Tt],stateAttributesMapping:kue})});var xP=e(t(),1);var Xi=e(t(),1);var fb={height:void 0,width:void 0};function d8(ot){let{externalRef:st,hiddenUntilFound:ct,id:gt,keepMounted:bt,mounted:yt,onOpenChange:vt,open:xt,setMounted:wt,setOpen:Ct,transitionStatus:St}=ot,Et=Xi.useRef(null),kt=Xi.useRef(null),[Rt,Tt]=Xi.useState(fb),Pt=Xi.useRef(fb),Mt=Xi.useRef(!1),It=Xi.useRef(xt),At=Xi.useRef(!1),[Nt,Ot]=Xi.useState(!1),Dt=Xi.useRef(null),_t=L(st,Et),$t=io(xt),Ft=Ja(Et),Bt=!xt&&!yt,Lt=Nt?"idle":St,Vt=xt&&(It.current||At.current),Wt=!xt&&yt&&kt.current==="css-animation"&&Rt.height===void 0&&Rt.width===void 0?Pt.current:Rt,Ut=ct&&Bt&&kt.current!=="css-animation",Ht=s((Xt,zt=!0)=>{if(zt)Pt.current=Xt;Tt(Xt)}),Gt=s(()=>{Dt.current?.(),Dt.current=null}),jt=s((Xt)=>{Gt(),Dt.current=()=>{Dt.current=null,Xt()}}),qt=s(()=>{if(xt&&yt&&kt.current==="css-animation")At.current=!0});i(()=>{if(!Nt||St==="starting")return;Ot(!1)},[Nt,St]),Xi.useEffect(()=>()=>{qt(),Gt()},[qt,Gt]),i(()=>{let Xt=Et.current;if(!Xt)return;if(!xt&&Dt.current)Gt();let zt=Rue(Xt,Vt);if(kt.current=zt,xt&&St==="idle"&&It.current&&zt==="css-animation"){Pt.current=Sm(Xt);return}if(xt&&St==="starting"){let Kt=Mt.current;if(Mt.current=!1,zt==="none"){Ht(Sm(Xt)),Ot(!0);return}if(zt==="css-transition"){let Zt=Tue(Xt);if(Ht(Sm(Xt)),!Kt)return Zt;let on=c1(Xt,"transition-duration","0s");return jt(on),Ot(!0),Zt}Ht(Sm(Xt));let an=c1(Xt,"animation-name","none");if(!Kt){an();return}let ln=c1(Xt,"animation-duration","0s");an(),jt(ln),Ot(!0);return}if(!xt&&yt&&(St==="idle"||St==="starting")){if(It.current=!1,At.current=!1,zt==="none"){Ht(fb,!1),wt(!1);return}Ht(Sm(Xt));return}if(St!=="ending")return;if(zt==="none"){wt(!1);return}let tn=Sm(Xt);if(!(tn.height>0||tn.width>0)){wt(!1);return}if(Ht(tn),zt==="css-animation")c1(Xt,"animation-name","none")();return},[yt,xt,Gt,Ht,wt,jt,Vt,St]),Ro({enabled:xt&&yt&&Lt==="idle",open:!0,ref:Et,onComplete(){if(!xt)return;Ht(fb,!1)}}),Xi.useEffect(()=>{if(xt||!yt||Lt!=="ending")return;if(!Et.current)return;let zt=new AbortController,tn=-1;function rn(){if($t.current)return;wt(!1),Ht(fb,!1)}return tn=xi.request(()=>{Ft(rn,zt.signal)}),()=>{xi.cancel(tn),zt.abort()}},[$t,yt,xt,Lt,Ft,Ht,wt]),i(()=>{let Xt=Et.current;if(!Xt||!ct||!Bt)return;Xt.setAttribute("hidden","until-found")},[Bt,ct]),Xi.useEffect(function(){let zt=Et.current;if(!zt)return;function tn(rn){let Kt=Ln(ec,rn);if(vt(!0,Kt),Kt.isCanceled)return;Mt.current=!0,Ct(!0)}return Xn(zt,"beforematch",tn)},[vt,Ct]);let Qt=bt||ct||yt||xt;return{height:Wt.height,props:{...Ut?{[n8]:""}:void 0,hidden:Bt,id:gt},ref:_t,shouldPreventOpenAnimation:Vt,shouldRender:Qt,transitionStatus:Lt,width:Wt.width}}function Sm(ot){return{height:ot.scrollHeight,width:ot.scrollWidth}}function Rue(ot,st){let ct=m(ot).getComputedStyle(ot),gt=(ct.animationName.split(",").map((yt)=>yt.trim()).some((yt)=>yt!==""&&yt!=="none")||st)&&p8(ct.animationDuration),bt=p8(ct.transitionDuration);if(gt&&bt)return"css-transition";if(bt)return"css-transition";if(gt)return"css-animation";return"none"}function p8(ot){return ot.split(",").map((st)=>st.trim()).some((st)=>st!==""&&Number.parseFloat(st)>0)}function c1(ot,st,ct){let gt=ot.style.getPropertyValue(st),bt=ot.style.getPropertyPriority(st);return ot.style.setProperty(st,ct),()=>{if(gt===""){ot.style.removeProperty(st);return}ot.style.setProperty(st,gt,bt)}}function Tue(ot){let st={"justify-content":ot.style.justifyContent,"align-items":ot.style.alignItems,"align-content":ot.style.alignContent,"justify-items":ot.style.justifyItems};Object.keys(st).forEach((bt)=>{ot.style.setProperty(bt,"initial","important")});function ct(){Object.entries(st).forEach(([bt,yt])=>{if(yt===""){ot.style.removeProperty(bt);return}ot.style.setProperty(bt,yt)})}let gt=xi.request(ct);return()=>{xi.cancel(gt),ct()}}var f8="--collapsible-panel-height",m8="--collapsible-panel-width";var g8=xP.forwardRef(function(st,ct){let{className:gt,hiddenUntilFound:bt,keepMounted:yt,render:vt,id:xt,style:wt,...Ct}=st,{defaultPanelId:St,mounted:Et,onOpenChange:kt,open:Rt,setMounted:Tt,setPanelIdState:Pt,setOpen:Mt,state:It,transitionStatus:At}=a1(),Nt=bt??!1,Ot=yt??!1,Dt=xt||void 0,_t=Dt??St;i(()=>(Pt((qt)=>Dt??(qt===null?void 0:qt)),()=>{Pt((qt)=>qt===Dt?null:qt)}),[Dt,Pt]);let{height:$t,props:Ft,ref:Bt,shouldPreventOpenAnimation:Lt,shouldRender:Vt,transitionStatus:Wt,width:Ut}=d8({externalRef:ct,hiddenUntilFound:Nt,id:_t,keepMounted:Ot,mounted:Et,onOpenChange:kt,open:Rt,setMounted:Tt,setOpen:Mt,transitionStatus:At}),Ht={...It,transitionStatus:Wt},Gt=qe(wt,Ht),jt=l("div",{...st,style:void 0},{state:Ht,ref:Bt,props:[Ft,{style:{[f8]:$t===void 0?"auto":`${$t}px`,[m8]:Ut===void 0?"auto":`${Ut}px`}},Ct,Gt?{style:Gt}:void 0,Lt?{style:{animationName:"none"}}:void 0],stateAttributesMapping:l1});if(!Vt)return null;return jt});var f1=e(r(),1);function u1({...ot}){return f1.jsx(l8,{"data-slot":"collapsible",...ot})}function p1({...ot}){return f1.jsx(u8,{"data-slot":"collapsible-trigger",...ot})}function d1({...ot}){return f1.jsx(g8,{"data-slot":"collapsible-content",...ot})}function Fs(ot,{workspaceId:st,base:ct="",apiBase:gt}={}){if(typeof ot!=="string")throw Error("A URL is required");if(!ot.startsWith("moi:")){let Tt=new URL(ot);if(Tt.protocol!=="https:"&&Tt.protocol!=="http:")throw Error("Unsupported URL");return Tt.href}if(!ot.startsWith("moi:/")||ot.startsWith("moi://"))throw Error("Expected a workspace address such as moi:/views/events?eventId=123");let bt=ot.slice(5),yt=bt.search(/[?#]/),vt=yt<0?bt:bt.slice(0,yt),xt=yt<0?"":bt.slice(yt),wt=vt.split("/").map(decodeURIComponent);if(wt.some((Tt)=>!Tt||Tt==="."||Tt===".."||/[/\\\0]/.test(Tt)))throw Error("Invalid workspace address");let Ct=st===void 0?void 0:encodeURIComponent(st);if(wt[0]==="files"){if(wt.length<2)throw Error("Invalid workspace file path");return`${gt??(Ct===void 0?"moi:":`/api/workspaces/${Ct}`)}/files/${wt.slice(1).map(encodeURIComponent).join("/")}${xt}`}let St=wt.join("/");if(ot.includes("#")||/\s/.test(St))throw Error("Invalid workspace address");if(St!=="chat"&&!ul(St)&&!(wt[0]==="chats"&&wt.length===2))throw Error(`Unsupported workspace destination: ${St}`);let Et=new URLSearchParams(xt);Et.sort();let kt=Et.toString();return`${Ct===void 0?"moi:":`${ct.replace(/\/$/,"")}/workspace/${Ct}`}/${wt.map(encodeURIComponent).join("/")}${kt?`?${kt}`:""}`}var Em=e(t(),1);var si=e(r(),1),mb={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function Iue(ot){let{width:st,height:ct,radius:gt,topLeftRadius:bt,bodyTop:yt,tabEnd:vt,shoulder:xt}=mb,wt=Math.min(st/2,gt*ot),Ct=Math.min(st/2,bt*ot),St=Math.max(0,xt.width),Et=vt+St,kt=Math.max(0,Math.min(xt.roundness,St/2));return[`M ${Ct} 0`,`H ${vt}`,`C ${vt+kt} 0 ${Et-kt} ${yt} ${Et} ${yt}`,`H ${st-wt}`,`Q ${st} ${yt} ${st} ${yt+gt}`,`V ${ct-gt}`,`Q ${st} ${ct} ${st-wt} ${ct}`,`H ${wt}`,`Q 0 ${ct} 0 ${ct-gt}`,`V ${bt}`,`Q 0 0 ${Ct} 0`,"Z"].join(" ")}function Mue(){let ot=Em.useRef(null),[st,ct]=Em.useState(1);return Em.useLayoutEffect(()=>{let gt=ot.current;if(!gt)return;let bt=(xt,wt)=>{if(xt<=0||wt<=0)return;let Ct=xt/mb.width,Et=wt/mb.height/Ct;ct((kt)=>Math.abs(kt-Et)<0.001?kt:Et)},yt=gt.getBoundingClientRect();bt(yt.width,yt.height);let vt=new ResizeObserver(([xt])=>{if(xt)bt(xt.contentRect.width,xt.contentRect.height)});return vt.observe(gt),()=>vt.disconnect()},[]),{ref:ot,horizontalRadiusScale:st}}var b8=[{frame:n("-translate-x-3 translate-y-3 -rotate-6","group-focus-within:translate-y-2 group-hover:translate-y-2"),img:"opacity-40"},{frame:n("translate-x-3 translate-y-2 rotate-5","group-focus-within:translate-y-1 group-hover:translate-y-1"),img:"opacity-50"},{frame:n("-translate-x-1 translate-y-1 -rotate-2","group-focus-within:-translate-y-2 group-hover:-translate-y-2"),img:"opacity-100"}];function y8({workspaceId:ot}){let st=Qx(ot),ct=st.data?[...st.data.thumbnails].reverse():[],gt=b8.slice(b8.length-ct.length),bt=st.data?.firstUserMessage,yt=st.data?.theme,{ref:vt,horizontalRadiusScale:xt}=Mue(),wt=Iue(xt),Ct=`folder-noise-${ot}`,St=Ls(yt),Et=FT(yt);return si.jsxs("div",{ref:vt,style:Et,className:"relative h-45 w-full",children:[si.jsxs("svg",{viewBox:`0 0 ${mb.width} ${mb.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[si.jsx("defs",{children:si.jsxs("filter",{id:Ct,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[si.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),si.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),si.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:si.jsx("feFuncA",{type:"linear",slope:"0.24"})}),si.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),si.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),si.jsx("path",{d:wt,filter:`url(#${Ct})`,className:"fill-accent"})]}),ct.map((kt,Rt)=>si.jsx("div",{className:n("absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs squircle","animate-in duration-300 ease-out fade-in",gt[Rt].frame),children:si.jsx("img",{src:kt,alt:"",loading:"lazy",className:n("block h-auto max-h-32 w-auto max-w-full object-contain",gt[Rt].img)})},kt)),ct.length===0&&bt&&si.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:si.jsx("div",{"aria-hidden":"true",style:St,className:n("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs","animate-in transition-transform duration-300 ease-out fade-in","-translate-x-1 translate-y-1 -rotate-2","group-focus-within:translate-y-0.5 group-hover:translate-y-0.5"),children:si.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:bt})})}),si.jsx("div",{className:n("absolute inset-x-2 top-[40%] bottom-2 rounded-3xl bg-[color-mix(in_oklch,var(--accent),var(--foreground)_5%)]","mask-[linear-gradient(to_bottom,rgba(0,0,0,0.9)_0%,black_50%)] backdrop-blur-lg","inset-shadow-[0_0_12px_color-mix(in_oklab,var(--background)_20%,transparent)]")})]})}var or=e(r(),1);function x8(){rm();let[,ot]=Ai(),st=qx();jF();let ct=VF(),gt=A9({onSuccess:(Rt)=>ot(`/workspace/${Rt.id}`)}),bt=R(),[yt,vt]=v8.useState(!1),xt=Ar((Rt)=>Rt.discoveredWorkspacesOpen),wt=Ar((Rt)=>Rt.setDiscoveredWorkspacesOpen);if(st.isPending||ct.isPending)return or.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:or.jsx(No,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(st.isError||ct.isError)return or.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:or.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let Ct=st.data,St=ct.data,Et=Ct.length;function kt(Rt){if(bt.demo){vt(!0);return}gt.startImport(Rt)}return or.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[or.jsx(O9,{className:"mb-10"}),Et>0?or.jsxs("section",{className:"mb-12",children:[or.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[or.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Workspaces"}),or.jsx(jh,{trigger:or.jsxs(a,{variant:"outline",size:"sm",children:[or.jsx(Ci,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),or.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:Ct.map((Rt)=>or.jsx(Aue,{workspace:Rt},Rt.id))})]}):or.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[or.jsx(JO,{size:56,stroke:0.75,className:"text-muted-foreground"}),or.jsxs("div",{className:"flex flex-col gap-1.5",children:[or.jsx("h2",{className:"font-medium",children:"Create your first workspace"}),or.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Workspace is a place for all views and widgets that share the same context. Create a new one or import an existing folder you’ve worked in before."})]}),or.jsx(jh,{trigger:or.jsx(a,{children:"New workspace"})})]}),St.length>0&&or.jsx("section",{children:or.jsxs(u1,{open:xt,onOpenChange:wt,className:"group",children:[or.jsxs(p1,{className:n("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:[or.jsx("span",{className:"text-sm font-medium",children:"Import other workspaces"}),or.jsx(sc,{size:16,stroke:2,className:n("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),or.jsx(d1,{children:or.jsx("ul",{className:"border-t border-border",children:St.map((Rt)=>or.jsx(Nue,{suggestion:Rt,onAdd:kt},Rt.path))})})]})}),gt.choice&&or.jsx(I9,{choice:gt.choice,isPending:gt.isPending,errorMessage:gt.error?.message,onTypeChange:gt.selectType,onSubmit:gt.submit,onReset:gt.reset}),or.jsx(am,{open:yt,onOpenChange:vt})]})}function Aue({workspace:ot}){let st=rd(ot),ct=Qx(ot.id),gt=ot.theme??ct.data?.theme,bt=_s(gt).agent,yt=gi((wt)=>cv(wt.activity,ot.id)),vt=ct.data?.updatedAt??new Date(ot.addedAt).getTime(),xt=`/workspace/${ot.id}`;return or.jsxs("div",{className:"group flex min-w-0 flex-col gap-3",children:[or.jsxs("div",{className:"relative",children:[or.jsx(y8,{workspaceId:ot.id}),or.jsx(ql,{href:xt,"aria-label":`Open ${st}`,className:"absolute inset-0 rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),ct.data&&or.jsxs(Wr,{children:[or.jsx(Ur,{render:or.jsx(ql,{href:Fs("moi:/chat",{workspaceId:ot.id}),"aria-label":`Chat in ${st}`,style:Ls(gt),className:"absolute right-3 bottom-3 rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:or.jsx(Pl,{preset:bt,color:"primary",animated:yt,expression:yt?"thinking":void 0,size:48,className:"drop-shadow-sm drop-shadow-primary/20"})})}),or.jsx(jr,{children:"Chat"})]})]}),or.jsxs(ql,{href:xt,className:"flex min-w-0 flex-col gap-2 rounded-lg px-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[or.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:Ls(gt),children:[or.jsx(yl,{icon:ot.icon,workspaceType:ot.type,workspaceTheme:gt,className:"size-4 shrink-0 rounded-xs"}),or.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:st})]}),or.jsx("span",{className:"text-xs text-muted-foreground",children:Due(vt)})]})]})}function Nue({suggestion:ot,onAdd:st}){let{path:ct,types:gt}=ot,bt=rd(ot);return or.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[or.jsx(L6,{types:gt}),or.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:bt}),or.jsx("span",{title:ct,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:ot.displayPath??ct}),or.jsxs(a,{variant:"outline",size:"sm",onClick:()=>st(ot),children:[or.jsx(Ci,{stroke:1.75}),"Add"]})]})}function Due(ot){let st=Date.now()-ot,ct=Math.floor(st/60000);if(ct<1)return"Updated just now";if(ct<60)return`Updated ${ct} min${ct===1?"":"s"} ago`;let gt=Math.floor(ct/60);if(gt<24)return`Updated ${gt} hour${gt===1?"":"s"} ago`;let bt=Math.floor(gt/24);if(bt<30)return`Updated ${bt} day${bt===1?"":"s"} ago`;return`Updated ${new Date(ot).toLocaleDateString()}`}var Wu=e(r(),1);function w8(){let ot=ex();if(ot.loading||ot.error)return Wu.jsx("main",{className:"flex h-dvh flex-col overflow-hidden",children:Wu.jsx($f,{children:Wu.jsx(Uf,{error:ot.error||void 0,onRetry:ot.retry})})});if(ot.enabled&&ot.data?.showOnboarding)return Wu.jsx(Ac,{to:"/onboarding"});return Wu.jsx(vm,{showWorkspaces:!1,children:Wu.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:Wu.jsx(x8,{})})})}var _ue=(ot)=>`workspaces/${encodeURIComponent(ke(ot))}`;async function C8(ot,st){let ct=await Jp(`${_ue(ot)}/members`,{signal:st});return Me(await ct.json())}function Oue(ot,st){if(!ot)return;let{members:ct,invitations:gt}=ot;for(let{id:bt,action:yt}of st)if(yt.type==="remove")ct=ct.filter((vt)=>vt.membershipId!==yt.membershipId);else if(yt.type==="revoke")gt=gt.filter((vt)=>vt.id!==yt.invitationId);else if(!gt.some((vt)=>vt.email===yt.email))gt=[...gt,{id:`pending:${bt}`,email:yt.email,expiresAt:"",pending:!0}];return{members:ct,invitations:gt}}function S8(ot){let st=Xv(),ct=st?W(st):void 0,gt=!!ot&&st?.type==="user"&&!st.isAnonymous,bt=Q(),yt=["workspace-members-action",bt,ot],vt=kr({queryKey:N.workspace(ct,ot??""),initialData:We,queryFn:async({signal:Ct})=>{let St=await C8(ot,Ct);if(Ct.aborted||bt!==Q())throw Error("Identity changed");return St},enabled:gt,retry:!1,staleTime:30000}),xt=SE({filters:{mutationKey:yt,status:"pending",exact:!0},select:(Ct)=>({id:Ct.state.submittedAt,action:Ct.state.variables})}),wt=Oue(vt.data,xt);return{...vt,data:wt,members:wt?.members,invitations:wt?.invitations}}var E8=e(t(),1);async function m1(ot,st,ct){let gt=ot.getQueryData(Tn.layout(st)),bt=gt?gt.provider??"claude-code":void 0;try{let wt=`moi:workspace-harness:${st}`;bt=sessionStorage.getItem(wt)??bt,sessionStorage.setItem(wt,ct)}catch{}if(!bt||bt===ct)return;let yt=[Tn.layout(st),Tn.state(st),Tn.sessions(st),Tn.mcp(st),Tn.skills(st),Tn.views(st),["workspaces","events",st]],vt={predicate:(wt)=>yt.some((Ct)=>ve({queryKey:Ct},wt))};await ot.cancelQueries(vt),ot.resetQueries({queryKey:Tn.harness(st),exact:!0}),ot.resetQueries({queryKey:Tn.mcp(st),exact:!0}),ot.setQueryData(Tn.layout(st),(wt)=>wt?{...wt,provider:ct,selectedModel:void 0,selectedEffort:void 0,selectedSpeedMode:void 0}:wt),Yc(st,{selected:{}}),ot.setQueryData(fl(st),{selected:{}}),ra(ot,st,(wt)=>{wt.selected={},delete wt.pinnedSessionId});let xt=(wt)=>Object.fromEntries(Object.entries(wt).filter(([Ct])=>!Ct.startsWith(`${st}:`)));Mr.setState((wt)=>({activity:xt(wt.activity),errors:xt(wt.errors),previews:Object.fromEntries(Object.entries(wt.previews).filter(([,Ct])=>Ct.workspaceId!==st))})),ot.removeQueries({queryKey:["workspaces","events",st]}),await Promise.all([ot.invalidateQueries(vt),ot.invalidateQueries({queryKey:Tn.all,exact:!0}),ot.invalidateQueries({queryKey:Tn.previews})])}function k8(ot,st){let ct=Kn();E8.useEffect(()=>{if(st)m1(ct,ot,st)},[st,ot,ct]),E((gt)=>{if(gt.type==="connection:opened")ct.invalidateQueries({queryKey:Tn.layout(ot)});else if(gt.type==="workspace-harness:switched"&&gt.workspaceId===ot)m1(ct,ot,gt.harness)})}var Rm=e(t(),1);var g1=5000,h1=120;var Lue="</moi-attachments>";function wP(ot){if(!pl(ot)||typeof ot.label!=="string")return null;let st=ot.label.trim();if(!st||st.length>h1||typeof ot.text!=="string"||!ot.text.trim()||ot.text.length>g1)return null;return{label:st,text:ot.text}}function R8(ot){return Array.isArray(ot)&&ot.every((st)=>pl(st)&&st.purpose===void 0&&(st.source===void 0||typeof st.source==="string"&&st.source.length>0)&&wP(st)!==null)}function T8(ot){return ot==="annotation"||ot==="sketch"}function Bue(ot){return Array.isArray(ot)&&ot.every((st)=>{if(!pl(st))return!1;if(st.type==="text")return R8([st]);if(st.type!=="file"&&st.type!=="image")return!1;if(st.source!==void 0&&(typeof st.source!=="string"||!st.source))return!1;if(typeof st.mediaType!=="string"||!st.mediaType)return!1;if(st.purpose!==void 0&&(!T8(st.purpose)||!st.mediaType.startsWith("image/")))return!1;let ct=typeof st.path==="string"&&/^(\/|[A-Za-z]:[\\/])/.test(st.path)&&!st.path.includes("\x00");if(st.type==="file")return ct&&st.label===void 0;return st.path===void 0&&st.mediaType.startsWith("image/")&&typeof st.label==="string"&&Boolean(st.label.trim())})}function CP(ot){let st=[],ct=!1,gt=ot.replace(/<moi-attachments>([^<]*)<\/moi-attachments>/g,(bt,yt)=>{try{let vt=JSON.parse(yt),xt=pl(vt)&&vt.version===1&&Array.isArray(vt.attachments)?vt.attachments.map((wt)=>pl(wt)?{type:"text",source:wt.source,label:wt.label,text:wt.text}:wt):vt;if(!Bue(xt))return bt;return st.push(...xt),ct=!0,""}catch{return bt}});return{text:ct?gt.trim():ot,attachments:st}}function SP(ot){return ot.type==="file"?ot.path.split(/[\\/]/).at(-1):ot.label}function P8(ot,st){let{source:ct}=ot,gt=SP(ot);if(ot.type==="text")return{type:"text-attachment",source:ot.source,label:gt,text:ot.text};return{type:"file-attachment",label:gt,mediaType:ot.mediaType,source:ct,...ot.purpose?{purpose:ot.purpose}:{},previewUrl:st,path:ot.type==="file"?ot.path:void 0}}function Fue(ot){return CP(ot).text}function I8(ot){let st=Fue(ot),ct=st.search(/<moi-attachments>\s*(?:\[|\{"version":1,"attachments":\[)/);return(ct<0||st.includes(Lue,ct)?st:st.slice(0,ct)).trimEnd()}var gb=10;function b1(ot){return ot.length>gb?`A message can have at most ${gb} attachments.`:null}var M8=33554432;function A8(ot){return typeof ot==="string"&&ot.length>0&&!/[\\:\0]/.test(ot)&&ot.split("/").every((st)=>st.length>0&&!st.startsWith("."))}var O8=e(t(),1);var N8=()=>({emit(ot,...st){for(let ct=this.events[ot]||[],gt=0,bt=ct.length;gt<bt;gt++)ct[gt](...st)},events:{},on(ot,st){return(this.events[ot]||=[]).push(st),()=>{this.events[ot]=this.events[ot]?.filter((ct)=>st!==ct)}}});var Hue=({kind:ot,name:st})=>`${ot}:${st}`,zue=1000,EP={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function $ue(ot){let st=N8(),ct=av(EP),gt=(vt,xt)=>{Ms(ot,{source:"runtime",kind:vt.kind,name:vt.name,message:xt})},bt=(vt,xt,wt,Ct,St)=>{let Et=vt.admit(wt);if(Et==="ok")return!0;return gt(xt,Et==="cooldown"?Ct:St),!1},yt=(vt,xt,wt)=>bt(ct,vt,`${xt}\x00${wt}`,`sendChatMessage() for "${wt}" was dropped: the same message was already sent less than ${EP.cooldownMs/1000}s ago. Call it from an event handler, not during render.`,`sendChatMessage() for "${wt}" was dropped: more than ${EP.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`);return{on(vt,xt){return st.on(vt,xt)},connect(vt,xt=""){let wt=!0,Ct=Hue(vt);return{bridge:{get collab(){return wt?SR:void 0},addChatAttachment(Et){if(!wt)return;try{let kt=D8(Et,Ct);st.emit("addChatAttachment",kt)}catch(kt){let Rt=kP(kt);qr.add({title:"Couldn’t add attachment",description:Rt,type:"error"}),gt(vt,`addChatAttachment() was dropped: ${Rt}`)}},navigate(Et){if(!wt)return;try{st.emit("navigate",Fs(Et))}catch(kt){gt(vt,`navigate() was dropped: ${kP(kt)}`)}},resolveUrl(Et){if(!wt)return"";return Fs(Et,{workspaceId:ot,base:xt})},sendChatMessage(Et,kt){if(!wt)return;try{if(typeof Et==="string")Et={message:Et,attachments:kt===void 0?[]:[{type:"text",label:"Context",text:JSON.stringify(kt)}]};if(!pl(Et)||typeof Et.message!=="string")throw Error("This message uses an unsupported format");if("context"in Et)throw Error("This message uses an outdated format");let Rt=Et.message.trim();if(!Rt)throw Error("The message is empty");if(Rt.length>zue)throw Error("Messages can be up to 1,000 characters");if(Et.attachments!==void 0&&!Array.isArray(Et.attachments))throw Error("The attachments use an unsupported format");let Tt=Array.from(Et.attachments??[],(Pt)=>D8(Pt,Ct));if(!yt(vt,Ct,Rt))return;st.emit("sendChatMessage",{message:Rt,applet:{kind:vt.kind,id:vt.name},attachments:Tt})}catch(Rt){let Tt=kP(Rt);qr.add({title:"Couldn’t send message",description:Tt,type:"error"}),gt(vt,`sendChatMessage() was dropped: ${Tt}`)}}},dispose:()=>{wt=!1}}}}}function D8(ot,st){if(!pl(ot))throw Error("This attachment isn’t supported");if(ot.type==="text"){let ct=wP(ot);if(ct)return{type:"text",...ct,source:st};if(typeof ot.label!=="string"||!ot.label.trim())throw Error("Add a label to this text attachment");if(ot.label.trim().length>h1)throw Error(`Attachment labels can be up to ${h1} characters`);if(typeof ot.text!=="string"||!ot.text.trim())throw Error("Add some text to this attachment");if(ot.text.length>g1)throw Error(`Text attachments can be up to ${g1.toLocaleString("en-US")} characters`)}else if(ot.type==="file"){if(ot.file instanceof File&&ot.path===void 0){if(ot.file.size>M8)throw Error("Files can be up to 32 MB");return{type:"file",file:ot.file,source:st}}if(typeof ot.path==="string"&&ot.file===void 0){if(!A8(ot.path))throw Error("Choose a file from this workspace");return{type:"file",path:ot.path,source:st}}}throw Error("This attachment isn’t supported")}function kP(ot){return ot instanceof Error?ot.message:String(ot)}var _8=new Map;function v1(ot){let st=_8.get(ot);if(!st)st=$ue(ot),_8.set(ot,st);return st}function x1(ot,st,ct){let gt=k(ct);O8.useEffect(()=>{let bt=(...yt)=>gt.current(...yt);return v1(ot).on(st,bt)},[ot,st,gt])}var y1=new Map;function L8(ot,st,ct,gt,bt=""){let yt=ot.__attachBridge;if(typeof yt!=="function")return;y1.get(ct)?.();let{bridge:vt,dispose:xt}=v1(st).connect(gt,bt);y1.set(ct,xt),yt(vt)}function RP(ot){let st=y1.get(ot);if(!st)return;y1.delete(ot),st()}function w1(ot,st,ct){return`${ot}/${st}/${ct}`}var km=new Map,hb=new Map;function Wue(ot,st,ct){return km.get(w1(ot,st,ct))??0}var Uue="module";function B8(ot,st,ct){return`/api/workspaces/${st}/${ot}/${ct}/${Uue}?v=${Wue(ot,st,ct)}`}function C1(ot,st,ct){return`/api/workspaces/${st}/${ot}/${ct}`}function Uu(ot,st){return`${ot}/${st}`}function F8(ot){return hb.get(ot)}function H8(ot,st){hb.set(ot,st)}function S1(ot,st,ct){let gt=w1(ot,st,ct);hb.delete(gt),km.set(gt,(km.get(gt)??0)+1),RP(gt)}function TP(ot){let st=`${ot}/`;for(let ct of new Set([...hb.keys(),...km.keys()]))if(ct.startsWith(st))hb.delete(ct),km.set(ct,(km.get(ct)??0)+1),RP(ct)}var jue={kind:"widget",segment:"widgets",shouldReload:(ot,st)=>ot.type==="widget:updated"&&ot.name===st||ot.type==="applets:refresh"&&ot.only!=="views"},Vue={kind:"view",segment:"views",shouldReload:(ot,st)=>ot.type==="view:updated"&&ot.name===st||ot.type==="applets:refresh"&&ot.only!=="widgets"};function Gue(ot,st,ct,gt){let{segment:bt}=ot,yt=w1(bt,st,ct),vt=F8(yt);if(vt)return vt;let xt=import(B8(bt,st,ct)).then((wt)=>{if(!wt.default)throw Error(`"${ct}" has no default export`);return L8(wt,st,yt,{kind:ot.kind,name:ct},gt),wt.default});return H8(yt,xt),xt}function z8(ot,st){let ct=b(),{base:gt}=pi(),[bt,yt]=Rm.useState({status:"loading",version:0}),vt=Rm.useCallback(()=>{yt((xt)=>({status:"loading",version:xt.version})),Gue(ot,ct,st,gt).then((xt)=>yt((wt)=>({status:"ready",Component:xt,version:wt.version+1}))).catch((xt)=>{Ms(ct,{source:"load",kind:ot.kind,name:st,message:String(xt),...xt instanceof Error&&xt.stack?{stack:xt.stack}:{}}),yt((wt)=>({status:"error",error:String(xt),version:wt.version+1}))})},[gt,ot,ct,st]);return Rm.useEffect(()=>{vt()},[vt]),E((xt)=>{if(ot.shouldReload(xt,st))S1(ot.segment,ct,st),vt()}),bt}function $8(ot){return z8(jue,ot)}function W8(ot){return z8(Vue,ot)}function U8(){let ot=b();E((st)=>{if(st.type==="view:updated")S1("views",ot,st.name);else if(st.type==="widget:updated")S1("widgets",ot,st.name);else if(st.type==="applets:refresh"){if(st.only!=="views")TP("widgets");if(st.only!=="widgets")TP("views")}})}var pa=e(t(),1);var hc={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function j8(ot){return kr({queryKey:Tn.layout(ot),queryFn:()=>p(`/api/workspaces/${ot}`),...hc})}function ua(ot){let st=Kn();return E((ct)=>{if(ct.type==="harness:updated"&&ct.workspaceId===ot)st.cancelQueries({queryKey:Tn.harness(ot)}),st.setQueryData(Tn.harness(ot),(gt)=>gt?{...gt,availability:ct.availability}:gt);if(ct.type==="env:updated"&&ct.workspaceId===ot)st.invalidateQueries({queryKey:Tn.harness(ot)})}),kr({queryKey:Tn.harness(ot),queryFn:async({signal:ct})=>{let gt=st.getQueryData(Tn.harness(ot)),bt=gt?.hasAuthOverrides&&gt.availability.status!=="available";return p(`/api/workspaces/${ot}/harness${bt?"?refresh=true":""}`,{signal:ct})},staleTime:30000,refetchOnWindowFocus:!0})}function V8(ot){return kr({queryKey:Tn.skills(ot),queryFn:()=>p(`/api/workspaces/${ot}/skills`),...hc})}async function Kue(ot){let st=await fetch(`/api/workspaces/${ot}/skills/update`,{method:"POST"}),ct=await st.text(),gt=null;try{gt=JSON.parse(ct)}catch{}if(!st.ok){let bt=gt&&"error"in gt?gt.error:ct,yt=Error(bt||"Failed to update workspace skill");if(gt?.skills)yt.status={skills:gt.skills,updateAvailable:gt.updateAvailable};throw yt}if(!gt)throw Error("Invalid workspace skill update response");return gt}function G8(ot){let st=Kn();return zr({mutationFn:()=>Kue(ot),onSuccess:(ct)=>{st.setQueryData(Tn.skills(ot),ct)},onError:(ct)=>{if(ct.status)st.setQueryData(Tn.skills(ot),ct.status)}})}function K8(ot){let st=Kn();return zr({mutationFn:(ct)=>H(`/api/workspaces/${ot}`,v("PUT",{...ct,origin:V}),"Failed to save layout"),onSuccess:()=>{st.invalidateQueries({queryKey:Tn.previews})}})}function q8(ot){let st=Kn();return zr({mutationFn:(ct)=>p(`/api/workspaces/${ot}/harness`,v("PATCH",{type:ct})),onSuccess:(ct)=>{m1(st,ot,ct.type??"claude-code")}})}var PP={id:"_moi_views",config:{colSpan:4,rowSpan:1},defaultPosition:{x:0,y:0}},IP=[PP],que=new Set(IP.map((ot)=>ot.id));function Il(ot){return que.has(ot)}function Q8(ot){return[...IP,...ot]}function J8(){return IP.map((ot)=>({i:ot.id,...ot.defaultPosition}))}function E1(){return{open:["overview"],active:"overview"}}function k1(ot){let st=E1();if(!ot||typeof ot!=="object")return st;let ct=ot,gt=Array.isArray(ct.open)?ct.open.filter(ul).filter((vt,xt,wt)=>wt.indexOf(vt)===xt):[];if(gt.length===0)return st;let bt=["overview",...gt.filter((vt)=>vt!=="overview")],yt=ul(ct.active)&&bt.includes(ct.active)?ct.active:"overview";return{open:bt,active:yt}}function X8(){return{version:1,widgetGrid:J8(),layoutMode:"split",tabs:E1()}}function Y8(ot,st,ct){let{tabs:gt,...bt}=ot,yt=st.tabs??ct?.tabs;return yt===void 0?bt:{...bt,tabs:yt}}var nz=e(r(),1),MP=pa.createContext(null);function Sr(){let ot=pa.useContext(MP);if(!ot)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return ot}function ez(){return pa.useContext(MP)?.layout.theme}function Z8(ot){let{cwd:st,name:ct,provider:gt,agentId:bt,...yt}=ot;return yt}function tz({id:ot,children:st}){let ct=Kn(),gt=j8(ot),bt=K8(ot),yt=k(bt.mutate),vt=pa.useRef(null),xt=pa.useRef(null),wt=pa.useCallback((St)=>{let Et=Tn.layout(ot),kt=ct.getQueryData(Et);if(!kt)return;ct.cancelQueries({queryKey:Et});let Rt={...kt,...St};if(ct.setQueryData(Et,Rt),xt.current={...Y8(Z8(Rt),St,xt.current),harness:Rt.provider??"claude-code"},vt.current)clearTimeout(vt.current);vt.current=setTimeout(()=>{vt.current=null;let Tt=xt.current;if(xt.current=null,Tt)yt.current(Tt)},600)},[ot,ct,yt]),Ct=pa.useMemo(()=>({layout:gt.data?Z8(gt.data):X8(),setLayout:wt,name:gt.data?.name??null,cwd:gt.data?.cwd??null,provider:gt.data?gt.data.provider??"claude-code":null,workspaceId:ot,isLoading:gt.isLoading}),[gt.data,gt.isLoading,wt,ot]);return nz.jsx(MP,{value:Ct,children:st})}var Ii=e(t(),1);var T1=e(r(),1);function R1({visible:ot,editing:st,canvasRef:ct,width:gt,height:bt,pointerProps:yt,onKeyDown:vt,children:xt}){if(!ot)return null;return T1.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:vt,children:[T1.jsx("canvas",{ref:ct,...yt,width:gt,height:bt,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),st&&xt]})}var tr=e(t(),1);function AP(ot,st,ct){let gt=Math.max(ot,st);if(gt<=0)return 1;return Math.min(Math.max(ct,1),1568/gt)}function Que(ot){return new Promise((st,ct)=>{setTimeout(()=>ct(Error("Annotation capture timed out")),ot)})}function Jue(ot){if(!(ot instanceof HTMLElement))return;let{overflowX:st,overflowY:ct}=ot.style;if(ct==="auto"||ct==="scroll")ot.style.overflowY="hidden";if(st==="auto"||st==="scroll")ot.style.overflowX="hidden"}async function rz(ot){let st=ot.getBoundingClientRect();if(st.width<=0||st.height<=0)throw Error("Annotation target is not visible");let{createContext:ct,destroyContext:gt,domToCanvas:bt}=await (Y("nf2wkvf9"),import("/chunk-nf2wkvf9.js")),yt=async()=>{let vt=await ct(ot,{width:Math.round(st.width),height:Math.round(st.height),scale:AP(st.width,st.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle(ot).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"},onCloneEachNode:Jue});try{return await bt(vt)}finally{gt(vt)}};return Promise.race([yt(),Que(1e4)])}var NP={past:[],present:[],future:[]};function Xue(ot,st){if(st.type==="commit")return{past:[...ot.past,ot.present],present:[...ot.present,st.stroke],future:[]};if(st.type==="undo"){let ct=ot.past.at(-1);if(!ct)return ot;return{past:ot.past.slice(0,-1),present:ct,future:[ot.present,...ot.future]}}if(st.type==="redo"){let ct=ot.future[0];if(!ct)return ot;return{past:[...ot.past,ot.present],present:ct,future:ot.future.slice(1)}}if(ot.present.length===0)return ot;return{past:[...ot.past,ot.present],present:[],future:[]}}function sz(ot,st,ct){let gt=ot.getBoundingClientRect();return{x:(st-gt.left)/gt.width*ot.width,y:(ct-gt.top)/gt.height*ot.height}}function oz(ot,st){let ct=st.getCoalescedEvents?.()??[];return(ct.length>0?ct:[st]).map((bt)=>sz(ot,bt.clientX,bt.clientY))}var Yue={canUndo:!1,canRedo:!1,hasStrokes:!1};function bb(ot){return tr.useSyncExternalStore(ot.subscribeHistory,ot.getHistoryState,ot.getHistoryState)}function iz(ot,st,ct,gt){let bt=st.points[0];if(!bt)return;ot.beginPath(),ot.lineCap="round",ot.lineJoin="round",ot.lineWidth=gt,ot.strokeStyle=ct,ot.moveTo(bt.x,bt.y);for(let yt=1;yt<st.points.length;yt++){let vt=st.points[yt];ot.lineTo(vt.x,vt.y)}if(st.points.length===1)ot.lineTo(bt.x+0.01,bt.y+0.01);ot.stroke()}function az(ot,st,ct,gt,bt,yt=null){let vt=Math.max(3,Math.min(st,ct)*0.005),xt=vt+Math.max(2,vt*0.75),wt=yt?[...bt,yt]:bt;for(let Ct of wt)iz(ot,Ct,gt.haloColor,xt);for(let Ct of wt)iz(ot,Ct,gt.strokeColor,vt)}function Zue(ot,st,ct,gt=null){let bt=ot.getContext("2d");if(!bt)return;bt.clearRect(0,0,ot.width,ot.height),az(bt,ot.width,ot.height,st,ct,gt)}function epe(ot,st,ct){let gt=ot.getContext("2d");if(!gt)return;gt.clearRect(0,0,ot.width,ot.height),gt.drawImage(st.snapshot,0,0,ot.width,ot.height),az(gt,ot.width,ot.height,st,ct)}function tpe(ot){return new Promise((st,ct)=>{ot.toBlob((gt)=>{if(gt)st(gt);else ct(Error("Could not export drawing"))},"image/png")})}function npe(ot,st,ct){let gt=ot.getBoundingClientRect();if(gt.width<=0||gt.height<=0)return null;let bt=getComputedStyle(ot),yt=AP(gt.width,gt.height,window.devicePixelRatio),vt=Math.max(1,Math.round(gt.width*yt)),xt=Math.max(1,Math.round(gt.height*yt)),wt=document.createElement("canvas");wt.width=vt,wt.height=xt;let Ct=bt.getPropertyValue("--background").trim()||"#ffffff",St=wt.getContext("2d");if(St)St.fillStyle=Ct,St.fillRect(0,0,vt,xt);return st.width=vt,st.height=xt,{id:ct,snapshot:wt,strokeColor:bt.getPropertyValue("--primary").trim()||"#2563eb",haloColor:Ct,targetWidth:gt.width,targetHeight:gt.height}}function rpe(ot){return ot instanceof HTMLInputElement||ot instanceof HTMLTextAreaElement||ot instanceof HTMLElement&&ot.isContentEditable}function P1({mode:ot="annotation",onChange:st,onEditingStart:ct,onFinish:gt}={}){let bt=tr.useRef(null),yt=tr.useRef(null),[vt,xt]=tr.useState(null),wt=tr.useRef(vt),[Ct,St]=tr.useState(!1),Et=tr.useRef(!1),kt=tr.useRef(NP),Rt=tr.useRef(Yue),Tt=tr.useRef(new Set),Pt=tr.useRef(0),Mt=tr.useRef(null),It=tr.useRef(null),At=tr.useRef(0),Nt=tr.useRef(0),Ot=tr.useRef(null),Dt=tr.useRef(null),[_t,$t]=tr.useState(!1),Ft=tr.useRef(!1),[Bt,Lt]=tr.useState(!1),Vt=tr.useRef(!1),Wt=k(st),Ut=k(ct),Ht=k(gt),Gt=tr.useCallback(()=>{let nn=kt.current,en=Rt.current,pn={canUndo:nn.past.length>0,canRedo:nn.future.length>0,hasStrokes:nn.present.length>0};if(pn.canUndo===en.canUndo&&pn.canRedo===en.canRedo&&pn.hasStrokes===en.hasStrokes)return;Rt.current=pn;for(let cn of Tt.current)cn()},[]),jt=tr.useCallback((nn)=>(Tt.current.add(nn),()=>{Tt.current.delete(nn)}),[]),qt=tr.useCallback(()=>Rt.current,[]),Qt=tr.useCallback((nn,en=null)=>{if(At.current)cancelAnimationFrame(At.current),At.current=0;let pn=yt.current,cn=wt.current;if(pn&&cn)Zue(pn,cn,nn,en)},[]),Xt=tr.useCallback(()=>{if(At.current)return;At.current=requestAnimationFrame(()=>{At.current=0,Qt(kt.current.present,Mt.current)})},[Qt]),zt=tr.useCallback((nn,en,pn)=>{let cn=Ot.current;if(cn?.sessionId===nn.id&&cn.historyVersion===pn)return Promise.resolve(cn.blob);let mn=Dt.current;if(mn?.sessionId===nn.id&&mn.historyVersion===pn)return mn.promise;if(en.length===0)return Ot.current={sessionId:nn.id,historyVersion:pn,blob:null},Wt.current?.(null),Promise.resolve(null);let Pn=document.createElement("canvas");Pn.width=nn.snapshot.width,Pn.height=nn.snapshot.height,epe(Pn,nn,en);let Rn=tpe(Pn).then((Cn)=>{if(wt.current?.id!==nn.id||Pt.current!==pn)return Cn;return Ot.current={sessionId:nn.id,historyVersion:pn,blob:Cn},Wt.current?.(Cn),Cn}).catch(()=>{if(wt.current?.id===nn.id&&Pt.current===pn)qr.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(Dt.current?.promise===Rn)Dt.current=null});return Dt.current={sessionId:nn.id,historyVersion:pn,promise:Rn},Rn},[Wt]),tn=tr.useCallback(()=>{if(!Mt.current)return;let nn=yt.current,en=It.current;if(nn&&en!==null&&nn.hasPointerCapture(en))nn.releasePointerCapture(en);Mt.current=null,It.current=null,Qt(kt.current.present)},[Qt]),rn=tr.useCallback((nn)=>{let en=wt.current;if(!en||Vt.current)return;let pn=Xue(kt.current,nn);if(pn===kt.current)return;kt.current=pn,Gt(),Mt.current=null;let cn=++Pt.current;Qt(pn.present),zt(en,pn.present,cn)},[zt,Gt,Qt]),Kt=tr.useCallback((nn)=>{kt.current=NP,Pt.current=0,Ot.current=null,Dt.current=null,Mt.current=null,It.current=null,Gt(),wt.current=nn,xt(nn)},[Gt]),an=tr.useCallback(()=>{if(Et.current)return;Et.current=!0,St(!0),Ut.current?.()},[Ut]),ln=tr.useCallback(async()=>{let nn=bt.current;if(!nn||wt.current||Ft.current)return!1;let en=++Nt.current;Ft.current=!0,$t(!0);try{let pn=await rz(nn);if(en!==Nt.current||bt.current!==nn)return!1;let cn=nn.getBoundingClientRect(),mn=getComputedStyle(nn),Pn={id:en,snapshot:pn,strokeColor:mn.getPropertyValue("--primary").trim()||"#2563eb",haloColor:mn.getPropertyValue("--background").trim()||"#ffffff",targetWidth:cn.width,targetHeight:cn.height};return Kt(Pn),an(),!0}finally{if(en===Nt.current)Ft.current=!1,$t(!1)}},[an,Kt]),Zt=tr.useCallback(()=>{let nn=wt.current;Nt.current+=1,Ft.current=!1,Vt.current=!1,$t(!1),Lt(!1),Et.current=!1,St(!1),tn(),xt(null),kt.current=NP,Gt();let en=Dt.current;if(!nn||en?.sessionId!==nn.id)return wt.current=null,Promise.resolve();return en.promise.then(()=>{if(wt.current?.id===nn.id)wt.current=null})},[tn,Gt]),on=tr.useCallback(async()=>{let nn=wt.current;if(!nn)return null;return tn(),zt(nn,kt.current.present,Pt.current)},[tn,zt]),sn=tr.useCallback(async()=>(Et.current=!1,St(!1),on()),[on]),dn=tr.useCallback(async()=>{let nn=wt.current;if(!nn||Vt.current)return null;Vt.current=!0,Lt(!0),tn();let en=Pt.current,pn=kt.current.present,cn=null;if(pn.length>0||en>0)cn=await zt(nn,pn,en);if(wt.current?.id!==nn.id)return cn;try{await Ht.current?.(cn)}finally{if(wt.current?.id===nn.id)Nt.current+=1,Et.current=!1,St(!1),wt.current=null,xt(null),Vt.current=!1,Lt(!1)}return cn},[tn,zt,Ht]),fn=tr.useCallback(()=>rn({type:"undo"}),[rn]),bn=tr.useCallback(()=>rn({type:"redo"}),[rn]),hn=tr.useCallback(()=>rn({type:"clear"}),[rn]),gn=tr.useMemo(()=>({onPointerDown:(nn)=>{if(Vt.current||!nn.isPrimary||nn.pointerType==="mouse"&&nn.button!==0)return;if(!wt.current&&ot==="sketch"){let en=bt.current;if(!en)return;let pn=npe(en,nn.currentTarget,++Nt.current);if(!pn)return;Kt(pn)}if(!wt.current)return;an(),It.current=nn.pointerId,nn.currentTarget.setPointerCapture(nn.pointerId),Mt.current={points:[sz(nn.currentTarget,nn.clientX,nn.clientY)]},Qt(kt.current.present,Mt.current)},onPointerMove:(nn)=>{if(nn.pointerId!==It.current||!Mt.current)return;Mt.current.points.push(...oz(nn.currentTarget,nn.nativeEvent)),Xt()},onPointerUp:(nn)=>{if(nn.pointerId!==It.current||!Mt.current)return;let en=Mt.current;if(en.points.push(...oz(nn.currentTarget,nn.nativeEvent)),Mt.current=null,It.current=null,nn.currentTarget.hasPointerCapture(nn.pointerId))nn.currentTarget.releasePointerCapture(nn.pointerId);rn({type:"commit",stroke:en})},onPointerCancel:(nn)=>{if(nn.pointerId===It.current)tn()}}),[rn,an,tn,Kt,ot,Qt,Xt]),xn=tr.useCallback((nn)=>{if(rpe(nn.target))return;if(nn.key==="Escape"&&ot==="annotation"){nn.preventDefault(),dn();return}if(!(nn.metaKey||nn.ctrlKey)||nn.key.toLowerCase()!=="z")return;if(nn.preventDefault(),nn.shiftKey)bn();else fn()},[dn,ot,bn,fn]);tr.useLayoutEffect(()=>{if(!vt)return;if(Qt(kt.current.present,Mt.current),Ct)yt.current?.focus()},[Ct,Qt,vt]),tr.useEffect(()=>{if(!vt||ot==="sketch")return;let nn=bt.current;if(!nn){Zt();return}let en=new ResizeObserver((pn)=>{let cn=pn[0]?.contentRect;if(!cn)return;if(Math.abs(cn.width-vt.targetWidth)>1||Math.abs(cn.height-vt.targetHeight)>1)Zt()});return en.observe(nn),()=>en.disconnect()},[Zt,ot,vt]),tr.useEffect(()=>()=>{if(Nt.current+=1,Et.current=!1,wt.current=null,At.current)cancelAnimationFrame(At.current)},[]);let wn=tr.useMemo(()=>({active:Ct,visible:ot==="sketch"||vt!==null,starting:_t,finishing:Bt,open:ln,undo:fn,redo:bn,clear:hn,flush:on,deactivate:sn,finish:dn,cancel:Zt,subscribeHistory:jt,getHistoryState:qt}),[Ct,ot,vt,_t,Bt,ln,fn,bn,hn,on,sn,dn,Zt,jt,qt]),yn=tr.useMemo(()=>({visible:wn.visible,editing:wn.active,canvasRef:yt,width:vt?.snapshot.width??1,height:vt?.snapshot.height??1,pointerProps:gn,onKeyDown:xn}),[wn.active,wn.visible,vt,gn,xn]);return tr.useMemo(()=>({targetRef:bt,controls:wn,layerProps:yn}),[wn,yn])}var Uo=e(r(),1);function I1({controls:ot,title:st,busy:ct,onComplete:gt}){let{canUndo:bt,canRedo:yt,hasStrokes:vt}=bb(ot);return Uo.jsxs("div",{className:"absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-lg bg-popover p-1.5 shadow-md",children:[Uo.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:st}),Uo.jsxs("div",{className:"flex gap-1",children:[Uo.jsxs(Wr,{children:[Uo.jsx(Ur,{render:Uo.jsx(a,{type:"button",variant:"outline",size:"icon-sm",onClick:ot.undo,disabled:ct||!bt,"aria-label":"Undo",children:Uo.jsx(O0,{stroke:1.75})})}),Uo.jsx(jr,{children:"Undo"})]}),Uo.jsxs(Wr,{children:[Uo.jsx(Ur,{render:Uo.jsx(a,{type:"button",variant:"outline",size:"icon-sm",onClick:ot.redo,disabled:ct||!yt,"aria-label":"Redo",children:Uo.jsx(kO,{stroke:1.75})})}),Uo.jsx(jr,{children:"Redo"})]}),Uo.jsx(a,{type:"button",variant:"outline",size:"sm",onClick:ot.clear,disabled:ct||!vt,children:"Clear"})]}),Uo.jsx(Qi,{mode:"popLayout",initial:!1,children:Uo.jsx(S.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.1,bounce:0},children:Uo.jsx(a,{type:"button",variant:vt?"default":"ghost",size:"icon-sm",onClick:gt,disabled:ct,"aria-label":"Complete",className:n(!vt&&"text-muted-foreground"),children:vt?Uo.jsx(Ys,{stroke:1.75}):Uo.jsx(zo,{stroke:1.75})})},vt?"complete":"cancel")})]})}var jo=e(t(),1);async function yb(ot,st){let ct=`/api/workspaces/${ot}/uploads`;if(typeof st==="string")return p(`${ct}/from-path`,v("POST",{path:st}),"The file couldn’t be uploaded");let gt=new FormData;gt.append("files",st);let[bt]=await p(ct,{method:"POST",body:gt},"The file couldn’t be uploaded");if(!bt)throw Error("The upload didn’t finish");return bt}function DP({workspaceId:ot,sessionId:st}){if((Mr.getState().attachments[As(ot,st)]??[]).length<gb)return!0;return qr.add({id:"draft-attachment-limit",title:"Attachment limit reached",description:`You can attach up to ${gb} items. Remove one to add another.`,type:"error"}),!1}function lz(ot,st){for(let ct of st)cz(ot,ct)}async function cz({workspaceId:ot,sessionId:st},ct,gt,bt){if(!DP({workspaceId:ot,sessionId:st}))return;let yt=typeof ct==="string"?null:ct,vt=typeof ct==="string"?ct.split("/").at(-1):ct.name||"file",xt=crypto.randomUUID();Mr.getState().addAttachments(ot,st,[{kind:"file",source:bt,localId:xt,label:vt,mediaType:yt?.type||"application/octet-stream",previewUrl:yt?.type.startsWith("image/")?URL.createObjectURL(yt):void 0,status:"uploading"}]);try{let wt=await yb(ot,ct);Mr.getState().updateAttachment(ot,xt,{status:"ready",upload:wt,label:wt.filename,mediaType:wt.mediaType,...wt.kind==="image"&&!yt?.type.startsWith("image/")?{previewUrl:`/api/workspaces/${ot}/uploads/${wt.id}`}:{}})}catch(wt){let Ct=wt instanceof Error?wt.message:"The file couldn’t be uploaded";Mr.getState().removeAttachment(ot,xt),qr.add({title:`Couldn’t add ${vt}`,description:Ct,type:"error"}),gt?.(Ct)}}function uz(ot,st){if(st.type==="text"){let{source:ct,label:gt,text:bt}=st;return ope(ot,{source:ct,label:gt,text:bt}),Promise.resolve()}return cz(ot,st.file??st.path,(ct)=>{Ms(ot.workspaceId,{source:"runtime",message:`addChatAttachment() from ${st.source}: ${ct}`})},st.source)}function vb({workspaceId:ot,sessionId:st,localId:ct,purpose:gt,source:bt,blob:yt}){let vt=gt==="sketch"?"Sketch":"Annotation",xt=Mr.getState(),wt=lv(xt.attachments,ot,ct);if(!wt&&!DP({workspaceId:ot,sessionId:st}))return!1;let Ct=URL.createObjectURL(yt);if(wt)xt.updateAttachment(ot,ct,{previewUrl:Ct,status:"draft",upload:void 0});else xt.addAttachments(ot,st,[{kind:"drawing",purpose:gt,localId:ct,source:bt,label:`${vt}.png`,mediaType:"image/png",previewUrl:Ct,status:"draft"}]);return!0}async function M1(ot){let{workspaceId:st,localId:ct,purpose:gt,blob:bt,isCurrent:yt}=ot,vt=gt==="sketch"?"Sketch":"Annotation";if(!vb(ot))return;Mr.getState().updateAttachment(st,ct,{status:"uploading"});try{let xt=await yb(st,new File([bt],`${vt}.png`,{type:"image/png"}));if(!yt())return;Mr.getState().updateAttachment(st,ct,{status:"ready",upload:xt,mediaType:xt.mediaType})}catch{if(!yt())return;Mr.getState().removeAttachment(st,ct)}}function ope({workspaceId:ot,sessionId:st},ct){if(!DP({workspaceId:ot,sessionId:st}))return;Mr.getState().addAttachments(ot,st,[{kind:"text",localId:crypto.randomUUID(),...ct}])}function pz({workspaceId:ot,sessionId:st,activeTab:ct,mode:gt,available:bt,closePopup:yt,openPopup:vt}){let xt=jo.useRef(null),wt=jo.useRef(new Map),Ct=k(yt),St=k(vt),Et=jo.useCallback((Ht)=>{let Gt=xt.current;if(!Gt)return;if(!Ht){Mr.getState().removeAttachment(Gt.workspaceId,Gt.attachmentId);return}vb({workspaceId:Gt.workspaceId,sessionId:Gt.sourceSessionId,localId:Gt.attachmentId,purpose:"annotation",source:Gt.source,blob:Ht})},[]),kt=jo.useCallback(async(Ht)=>{let Gt=xt.current;if(!Gt)return;xt.current=null;let jt=(wt.current.get(Gt.attachmentId)??0)+1;wt.current.set(Gt.attachmentId,jt);let qt=()=>wt.current.get(Gt.attachmentId)===jt,Qt=await Ht;if(!Qt||!qt())return;await M1({workspaceId:Gt.workspaceId,sessionId:Gt.sourceSessionId,localId:Gt.attachmentId,purpose:"annotation",source:Gt.source,blob:Qt,isCurrent:qt})},[]),Rt=jo.useCallback(async(Ht)=>{let Gt=xt.current;if(await kt(Ht),Gt?.origin==="popup")St.current()},[St,kt]),Tt=P1({onChange:Et,onFinish:Rt}),{controls:Pt}=Tt,{active:Mt,starting:It,open:At,finish:Nt,flush:Ot,cancel:Dt}=Pt;jo.useLayoutEffect(()=>()=>{if(xt.current)kt(Ot())},[Ot,kt]);let _t=jo.useCallback(async(Ht)=>{if(!bt||Mt||It)return;let Gt={workspaceId:ot,sourceSessionId:st,source:ct,origin:Ht,attachmentId:crypto.randomUUID()};xt.current=Gt;try{if(!await At()){if(xt.current===Gt)xt.current=null;return}if(Ht==="popup")Ct.current()}catch{if(xt.current!==Gt)return;xt.current=null,qr.add({title:"Couldn’t capture this page",type:"error"})}},[Mt,ct,bt,Ct,At,st,It,ot]),$t=jo.useCallback(async()=>{let Ht=xt.current?kt(Ot()):void 0;await Dt(),await Ht},[Dt,Ot,kt]),Ft=jo.useCallback((Ht)=>{let Gt=(wt.current.get(Ht)??0)+1;if(wt.current.set(Ht,Gt),Mr.getState().removeAttachment(ot,Ht),xt.current?.attachmentId===Ht)xt.current=null,Dt()},[Dt,ot]),Bt=jo.useCallback(async()=>{if(It){await $t();return}await Nt()},[$t,Nt,It]),Lt=jo.useCallback(()=>{if(Mt||It)Bt();else _t("docked")},[Mt,Bt,_t,It]),Vt=jo.useCallback(()=>{if(Mt||It)Bt();else _t("popup")},[Mt,Bt,_t,It]);jo.useEffect(()=>{let Ht=xt.current;if(!Ht)return;let Gt=Ht.origin==="docked"?"split":"fullscreen";if(Ht.workspaceId!==ot||Ht.sourceSessionId!==st||Ht.source!==ct||gt!==Gt||!bt)$t()},[ct,bt,$t,gt,st,ot]);let Wt=jo.useMemo(()=>bt?{active:Mt||It,finish:Bt,onRemove:Ft,onToggle:Lt}:void 0,[bt,Mt,It,Bt,Ft,Lt]),Ut=jo.useMemo(()=>bt?{active:Mt||It,finish:Bt,onRemove:Ft,onToggle:Vt}:void 0,[bt,Mt,It,Bt,Ft,Vt]);return jo.useMemo(()=>({...Tt,docked:Wt,popup:Ut}),[Tt,Wt,Ut])}var ws=e(t(),1);var da=e(r(),1);function _P(ot){if(!ot)return;ot.focus();let st=ot.value.length;ot.setSelectionRange(st,st)}function dz({composerRef:ot,className:st,onMouseDown:ct,children:gt,...bt}){return da.jsx("form",{...bt,onMouseDown:(yt)=>{if(ct?.(yt),yt.defaultPrevented)return;if(yt.target instanceof Element&&yt.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;_P(ot.current)},className:n("group/composer flex w-full cursor-text flex-col gap-1 rounded-xl bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",st),children:gt})}function fz({textareaRef:ot,className:st,...ct}){return da.jsx("textarea",{...ct,ref:ot,className:n("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",st)})}function mz({className:ot,children:st,...ct}){return da.jsx("div",{...ct,className:n("flex items-center justify-end gap-3",ot),children:st})}function ipe(ot){if(ot.status==="checking")return"Checking agent status…";return}function xb(ot,st,ct){return ot&&!st&&ct.status==="available"}function gz({label:ot,hasContent:st,busy:ct=!1,loading:gt=!1,availability:bt}){let yt=xb(st,ct||gt,bt),vt=ipe(bt),xt=da.jsx(a,{type:"submit",size:"icon",disabled:!yt,"aria-label":ot,children:gt?da.jsx($o,{}):da.jsx(RO,{stroke:1.5})});if(gt||!vt)return xt;return da.jsxs(Wr,{children:[da.jsx(Ur,{render:da.jsx("span",{className:"inline-flex",children:xt})}),da.jsx(jr,{className:"max-w-64 text-center",children:vt})]})}var Hs=e(t(),1),spe=48;function hz(ot,st){let ct=Hs.useRef(!0),[gt,bt]=Hs.useState(!0),yt=Hs.useCallback((wt)=>{ct.current=wt,bt((Ct)=>Ct===wt?Ct:wt)},[]),vt=Hs.useCallback((wt="auto")=>{let Ct=ot.current;if(!Ct)return;yt(!0),Ct.scrollTo({top:Ct.scrollHeight,behavior:wt})},[ot,yt]),xt=Hs.useCallback(()=>{let wt=ot.current;if(!wt)return;yt(!1),wt.scrollTo({top:0,behavior:"auto"})},[ot,yt]);return Hs.useEffect(()=>{let wt=ot.current;if(!wt)return;let Ct=()=>{let St=wt.scrollHeight-wt.scrollTop-wt.clientHeight;yt(St<=spe)};return wt.addEventListener("scroll",Ct,{passive:!0}),()=>wt.removeEventListener("scroll",Ct)},[ot,yt]),Hs.useEffect(()=>{let wt=ot.current;if(!wt)return;let Ct=wt.firstElementChild??wt,St=new ResizeObserver(()=>{if(ct.current)wt.scrollTop=wt.scrollHeight});return St.observe(Ct),()=>St.disconnect()},[ot]),Hs.useLayoutEffect(()=>{vt("auto")},[st,vt]),{atBottom:gt,scrollToBottom:vt,scrollToTop:xt}}function ape(ot){return ot.origin.kind!=="replay"&&ot.origin.kind!=="synthetic"&&ot.origin.kind!=="subagent-prompt"}function bz(ot,st){let ct=ot.meta||st.meta?{...ot.meta,...st.meta}:void 0;return{...ot,parts:[...ot.parts,...st.parts],timestamp:st.timestamp??ot.timestamp,meta:ct}}function yz(ot,st){if(!st)return ot;let ct=ot.at(-1);if(ct?.role==="assistant")return[...ot.slice(0,-1),bz(ct,st)];return[...ot,st]}function vz(ot){let st=[];for(let ct of ot){if(!ape(ct))continue;if(ct.role!=="assistant"){st.push(ct);continue}let gt=st.length>0?st[st.length-1]:null;if(gt?.role==="assistant")st[st.length-1]=bz(gt,ct);else st.push(ct)}return st.map((ct,gt)=>{let bt=st[gt-1];if(ct.role!=="assistant"||ct.meta?.durationMs!==void 0||bt?.role!=="user"||bt.origin.kind!=="user-input"||!bt.timestamp||!ct.timestamp)return ct;let yt=Date.parse(bt.timestamp),vt=Date.parse(ct.timestamp);if(!Number.isFinite(yt)||!Number.isFinite(vt)||vt<yt)return ct;return{...ct,meta:{...ct.meta,durationMs:vt-yt}}})}function OP(ot){switch(ot.kind){case"warning":return ot.message;case"compact":return"Context compacted";case"model-change":return ot.prev?`Model changed to ${ot.model} (was ${ot.prev})`:`Model changed to ${ot.model}`;case"api-retry":return ot.error?`Retrying: ${ot.error}`:"Retrying the connection";case"rate-limit":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function xz(ot){if(!ot)return;let st=Date.parse(ot);return Number.isNaN(st)?void 0:st}function wz(ot,st){let ct=st.filter((wt)=>OP(wt)!==null);if(ct.length===0)return ot.map((wt)=>({kind:"turn",turn:wt}));let gt=[],bt=[];for(let wt of ct){let Ct=xz(wt.at);if(Ct===void 0)bt.push(wt);else gt.push({notice:wt,time:Ct})}gt.sort((wt,Ct)=>wt.time-Ct.time);let yt=[],vt=0,xt=Number.NEGATIVE_INFINITY;for(let wt of ot){xt=Math.max(xt,xz(wt.timestamp)??xt);while(vt<gt.length&&gt[vt].time<=xt)yt.push({kind:"notice",notice:gt[vt].notice}),vt+=1;yt.push({kind:"turn",turn:wt})}for(;vt<gt.length;vt+=1)yt.push({kind:"notice",notice:gt[vt].notice});for(let wt of bt)yt.push({kind:"notice",notice:wt});return yt}var Vo=e(r(),1);function Tm({label:ot,icon:st,onRemove:ct,previewUrl:gt,loading:bt,className:yt,children:vt,...xt}){return Vo.jsxs("div",{...xt,className:n("group relative flex max-w-full min-w-0 cursor-default items-center rounded-md bg-background text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50",gt?"size-14 overflow-hidden":"h-7 pr-2 pl-0.5",yt),children:[bt&&Vo.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-background/70",children:Vo.jsx(No,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),gt?Vo.jsx(cpe,{label:ot,previewUrl:gt,onRemove:ct}):Vo.jsx(lpe,{label:ot,icon:st,onRemove:ct}),vt]})}function lpe({label:ot,icon:st,onRemove:ct}){return Vo.jsxs(Vo.Fragment,{children:[ct?Vo.jsxs(a,{type:"button",variant:"ghost",size:"icon-sm",onClick:ct,"aria-label":`Remove ${ot}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[Vo.jsx(st,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),Vo.jsx(zo,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}):Vo.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center",children:Vo.jsx(st,{size:16,stroke:1.75})}),Vo.jsx("span",{className:"truncate",children:ot})]})}function cpe({label:ot,previewUrl:st,onRemove:ct}){return Vo.jsxs(Vo.Fragment,{children:[Vo.jsx("img",{src:st,alt:ot,className:"size-full object-cover"}),ct&&Vo.jsx(a,{type:"button",variant:"outline",size:"icon-sm",onClick:ct,"aria-label":`Remove ${ot}`,className:"absolute top-1 right-1 size-4 rounded-xs border-0 opacity-0 shadow-xs transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 [&_svg]:size-3",children:Vo.jsx(zo,{stroke:1.75})})]})}var Cz=e(r(),1);function wb({label:ot,onRemove:st}){return Cz.jsx(Tm,{label:ot,icon:fL,onRemove:st})}var Rz=e(t(),1);var A1=e(t(),1),LP=A1.createContext(void 0);function Ml(ot){let st=A1.useContext(LP);if(st===void 0&&!ot)throw Error(c(50));return st}var Ez=e(t(),1);var Sz=600,N1=300;var upe={...il,instantType:(ot)=>ot.instantType,adaptiveOrigin:(ot)=>ot.adaptiveOrigin,closeDelay:(ot)=>ot.closeDelay};class BP extends Gi{constructor(ot,st,ct){let gt=new Ta;super(ppe(ot,gt,st,ct),dpe(gt),upe)}setOpen=(ot,st)=>{let{inlineRectCoordsRef:ct}=this.context;x0(this,ot,st,{onBeforeDispatch(){let gt=st.event;if(ot&&st.reason===Ao&&st.trigger&&"clientX"in gt&&"clientY"in gt&&ct.current?.element!==st.trigger)hk(ct,st.trigger,gt.clientX,gt.clientY)}})}}function ppe(ot,st,ct,gt=!1){return{...ol(st,ct,gt),instantType:void 0,adaptiveOrigin:void 0,closeDelay:N1,...ot}}function dpe(ot){return{popupRef:Ez.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:ot,inlineRectCoordsRef:{current:void 0}}}var ju=e(r(),1);function kz(ot){let{open:st,defaultOpen:ct=!1,onOpenChange:gt,onOpenChangeComplete:bt,actionsRef:yt,handle:vt,triggerId:xt,defaultTriggerId:wt=null,children:Ct}=ot,St=jc((It,At)=>new BP({open:ct,openProp:st,activeTriggerId:wt,triggerIdProp:xt},It,At));St.useControlledProp("openProp",st),St.useControlledProp("triggerIdProp",xt),St.useContextCallback("onOpenChange",gt),St.useContextCallback("onOpenChangeComplete",bt);let Et=St.useState("open"),kt=St.useState("activeTriggerId"),Rt=St.useState("mounted"),Tt=St.useState("payload");tl(St,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:Pt}=nl(Et,St,()=>{St.context.inlineRectCoordsRef.current=void 0});i(()=>{if(Et){if(kt==null)St.set("payload",void 0)}},[St,kt,Et]),Rz.useImperativeHandle(yt,()=>({unmount:Pt,close:()=>St.setOpen(!1,Ln(Vg))}),[Pt,St]);let Mt=Et||Rt;return ju.jsxs(LP.Provider,{value:St,children:[vt&&ju.jsx(Za,{handle:vt,store:St}),Mt&&ju.jsx(fpe,{store:St}),typeof Ct==="function"?Ct({payload:Tt}):Ct]})}function fpe({store:ot}){let st=ot.useState("floatingRootContext"),ct=Ra(st);return rl(ot,{activeTriggerProps:ct.reference,inactiveTriggerProps:ct.trigger,popupProps:ct.floating}),null}var Tz=va(function(st){if(Ml(!0))return ju.jsx(kz,{...st});return ju.jsx(_p,{children:ju.jsx(kz,{...st})})});var Iz=e(t(),1);var D1=e(t(),1),FP=D1.createContext(void 0);function Pz(){let ot=D1.useContext(FP);if(ot===void 0)throw Error(c(48));return ot}var HP=e(r(),1),Mz=Iz.forwardRef(function(st,ct){let{keepMounted:gt=!1,...bt}=st;if(!(Ml().useState("mounted")||gt))return null;return HP.jsx(FP.Provider,{value:gt,children:HP.jsx(af,{ref:ct,...bt})})});var Az=e(t(),1);var Nz=ja(function(st,ct){let{render:gt,className:bt,delay:yt,closeDelay:vt,id:xt,payload:wt,handle:Ct,style:St,...Et}=st,kt=Ml(!0),Tt=sl(Ct)??kt;if(!Tt)throw Error(c(89));let Pt=Cr(xt),Mt=Tt.useState("isTriggerActive",Pt),It=Tt.useState("isOpenedByTrigger",Pt),At=Tt.useState("floatingRootContext"),Nt=Tt.context.inlineRectCoordsRef,Ot=Az.useRef(null),Dt=yt??Sz,_t=vt??N1,{registerTrigger:$t,isMountedByThisTrigger:Ft}=el(Pt,Ot,Tt,{payload:wt,closeDelay:_t}),Bt=oc(At,{mouseOnly:!0,move:!1,handleClose:ic(),delay:()=>({open:Dt,close:_t}),triggerElementRef:Ot,isActiveTrigger:Mt,isClosing:()=>Tt.select("transitionStatus")==="ending"}),Lt=Fp(At,{delay:Dt}),Vt={open:It},Wt=Tt.useState("triggerProps",Ft),Ut=b2(Nt,It);return l("a",st,{state:Vt,ref:[ct,$t,Ot],props:[Bt,Lt.reference,Wt,Ut,{id:Pt},Et],stateAttributesMapping:Lc})});var _z=e(t(),1);var _1=e(t(),1),zP=_1.createContext(void 0);function Dz(){let ot=_1.useContext(zP);if(ot===void 0)throw Error(c(49));return ot}var $P=e(r(),1),Oz=_z.forwardRef(function(st,ct){let{render:gt,className:bt,anchor:yt,positionMethod:vt="absolute",side:xt="bottom",align:wt="center",sideOffset:Ct=0,alignOffset:St=0,collisionBoundary:Et="clipping-ancestors",collisionPadding:kt=5,arrowPadding:Rt=5,sticky:Tt=!1,disableAnchorTracking:Pt=!1,collisionAvoidance:Mt=$c,style:It,...At}=st,Nt=Ml(),Ot=Pz(),Dt=nc(),_t=Nt.useState("open"),$t=Nt.useState("mounted"),Ft=Nt.useState("floatingRootContext"),Bt=Nt.useState("instantType"),Lt=Nt.useState("transitionStatus"),Vt=Nt.useState("adaptiveOrigin"),Wt=Nt.context.inlineRectCoordsRef,Ut=Gc({anchor:yt,floatingRootContext:Ft,positionMethod:vt,mounted:$t,side:xt,sideOffset:Ct,align:wt,alignOffset:St,arrowPadding:Rt,collisionBoundary:Et,collisionPadding:kt,sticky:Tt,disableAnchorTracking:Pt,keepMounted:Ot,nodeId:Dt,collisionAvoidance:Mt,adaptiveOrigin:Vt,inline:y2(Wt)}),Ht=Ut.update;i(()=>{if(_t&&$t)Ht()},[_t,$t,Ht]);let Gt={open:_t,side:Ut.side,align:Ut.align,anchorHidden:Ut.anchorHidden,instant:Bt},jt=Kc(st,Gt,{styles:Ut.positionerStyles,transitionStatus:Lt,props:At,refs:[ct,Nt.useStateSetter("positionerElement")],hidden:!$t,inert:!_t});return $P.jsx(zP.Provider,{value:Ut,children:$P.jsx(Dp,{id:Dt,children:jt})})});var Lz=e(t(),1);var Bz=Lz.forwardRef(function(st,ct){let{className:gt,render:bt,style:yt,...vt}=st,xt=Ml(),{side:wt,align:Ct}=Dz(),St=xt.useState("open"),Et=xt.useState("instantType"),kt=xt.useState("transitionStatus"),Rt=xt.useState("popupProps"),Tt=xt.useState("floatingRootContext"),Pt=xt.useState("closeDelay");return Ro({open:St,ref:xt.context.popupRef,onComplete(){if(St)xt.context.onOpenChangeComplete?.(!0)}}),rc(Tt,{closeDelay:Pt}),l("div",st,{state:{open:St,side:wt,align:Ct,instant:Et,transitionStatus:kt},ref:[ct,xt.context.popupRef,xt.useStateSetter("popupElement")],props:[Ya,Rt,cl(kt),vt],stateAttributesMapping:Va})});var Pm=e(r(),1);function Hz({...ot}){return Pm.jsx(Tz,{"data-slot":"hover-card",...ot})}function zz({...ot}){return Pm.jsx(Nz,{"data-slot":"hover-card-trigger",...ot})}function $z({className:ot,side:st="bottom",sideOffset:ct=4,align:gt="center",alignOffset:bt=0,...yt}){return Pm.jsx(Zs,{portal:Mz,"data-slot":"hover-card-portal",children:Pm.jsx(Oz,{align:gt,alignOffset:bt,side:st,sideOffset:ct,className:"isolate z-50",children:Pm.jsx(Bz,{"data-slot":"hover-card-content",className:u("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",ot),...yt})})})}var fd=e(r(),1);function Wz({attachment:ot,onRemove:st}){let{previewUrl:ct,purpose:gt}=ot,bt=gt==="sketch"?"Sketch":"Annotation";return fd.jsxs(Hz,{children:[fd.jsx(zz,{render:fd.jsx(Tm,{tabIndex:0,label:bt,icon:ff,onRemove:st})}),ct&&fd.jsx($z,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)] rounded-xl",children:fd.jsx("img",{src:ct,alt:`${bt} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var jz=e(r(),1);function Uz({attachment:ot,onRemove:st}){return jz.jsx(Tm,{label:ot.label,icon:df,onRemove:st,previewUrl:ot.previewUrl,loading:ot.status==="uploading",title:ot.label,className:"max-w-52"})}var gd=e(t(),1);var Nm=e(t(),1);var Gz=e(t(),1),Al=e(r(),1),WP="M13 2l.018 .001l.016 .001l.083 .005l.011 .002h.011l.038 .009l.052 .008l.016 .006l.011 .001l.029 .011l.052 .014l.019 .009l.015 .004l.028 .014l.04 .017l.021 .012l.022 .01l.023 .015l.031 .017l.034 .024l.018 .011l.013 .012l.024 .017l.038 .034l.022 .017l.008 .01l.014 .012l.036 .041l.026 .027l.006 .009c.12 .147 .196 .322 .218 .513l.001 .012l.002 .041l.004 .064v6h5a1 1 0 0 1 .868 1.497l-.06 .091l-8 11c-.568 .783 -1.808 .38 -1.808 -.588v-6h-5a1 1 0 0 1 -.868 -1.497l.06 -.091l8 -11l.01 -.013l.018 -.024l.033 -.038l.018 -.022l.009 -.008l.013 -.014l.04 -.036l.028 -.026l.008 -.006a1 1 0 0 1 .402 -.199l.011 -.001l.027 -.005l.074 -.013l.011 -.001l.041 -.002z",mpe=o("filled","ultrafast","Ultrafast",[]),Vz="translate(5 2.4) scale(.8)",gpe="translate(-1 2.4) scale(.8)";function UP(ot){let st=Gz.useId();return Al.jsxs(mpe,{...ot,children:[Al.jsx("defs",{children:Al.jsxs("mask",{id:st,x:"0",y:"0",width:"24",height:"24",maskUnits:"userSpaceOnUse",children:[Al.jsx("rect",{width:"24",height:"24",fill:"white"}),Al.jsx("path",{d:WP,transform:Vz,fill:"black",stroke:"black",strokeWidth:"4",strokeLinejoin:"round"})]})}),Al.jsx("g",{mask:`url(#${st})`,children:Al.jsx("path",{d:WP,transform:gpe})}),Al.jsx("path",{d:WP,transform:Vz})]})}var hpe=["fable","opus","sonnet","haiku"];function O1(ot,st,ct=ot.find((gt)=>gt.value==="default")?.resolvedModel){let gt=ot.filter((bt)=>bt.value!=="default");return gt.find((bt)=>bt.value===st)??gt.find((bt)=>(bt.resolvedModel??bt.value)===ct)??gt[0]}function Kz(ot){let st=ot.resolvedModel??ot.value,ct=hpe.findIndex((gt)=>st===gt||st.startsWith(`${gt}[`)||st.includes(`-${gt}-`));return ct===-1?void 0:ct}function bpe(ot,st){if(ot===void 0&&st===void 0)return 0;if(ot===void 0)return-1;if(st===void 0)return 1;return ot-st}function ype(ot,st){return bpe(Kz(ot),Kz(st))}var vpe={"claude-code":ype};function xpe(ot,st){return ot.map((ct,gt)=>({model:ct,index:gt})).sort((ct,gt)=>st(ct.model,gt.model)||ct.index-gt.index).map(({model:ct})=>ct)}function jP(ot,st,ct){if(st&&ot.includes(st))return st;if(ct&&ot.includes(ct))return ct;if(ot.includes("high"))return"high";return ot[ot.length-1]}function qz(ot,st,ct){let gt=jP(ot,st,ct);return gt?ot.indexOf(gt):-1}function Qz(ot){return ot.length>1}function L1(ot,st){let ct=st??"normal";if(ct==="ultrafast"&&ot.supportsUltrafastMode)return ct;return ct!=="normal"&&ot.supportsFastMode?"fast":"normal"}function Jz(ot,st){let ct=vpe[st];return ct?xpe(ot,ct):ot}function Xz(ot,st){let ct=[];for(let gt of ot){let bt=gt.group??st,yt=ct.find((vt)=>vt.label===bt);if(yt)yt.models.push(gt);else ct.push({label:bt,models:[gt]})}return ct}var V1=e(t(),1);var Go=e(t(),1);function VP(ot,st,ct=Object.is){let{length:gt}=ot;if(gt!==st.length)return!1;for(let bt=0;bt<gt;bt+=1)if(!ct(ot[bt],st[bt]))return!1;return!0}function Yz(ot){return ot==null?void 0:`${ot}-label`}function Zz(ot,st){return ot??st}function B1(ot,st){return ot-st}function F1(ot,st,ct,gt,bt,yt){let vt=mi(ot,ct,gt);if(!bt)return vt;let xt=yt.slice();return xt[st]=mi(vt,yt[st-1]??-1/0,yt[st+1]??1/0),xt.sort(B1)}function H1(ot,st,ct){if(!Array.isArray(ot))return!0;let gt=st*ct;for(let bt=0;bt<ot.length-1;bt+=1)if(!(Math.abs(ot[bt]-ot[bt+1])>=gt))return!1;return!0}var Im=()=>null,Nl={activeThumbIndex:Im,max:Im,min:Im,minStepsBetweenValues:Im,step:Im,values:Im,...Iu};var z1=e(t(),1),GP=z1.createContext(void 0);function Vu(){let ot=z1.useContext(GP);if(ot===void 0)throw Error(c(62));return ot}var KP=e(r(),1);function wpe(ot,st){return ot===st||Array.isArray(ot)&&Array.isArray(st)&&VP(ot,st)}var e7=Go.forwardRef(function(st,ct){let{"aria-labelledby":gt,className:bt,defaultValue:yt,disabled:vt=!1,id:xt,format:wt,largeStep:Ct=10,locale:St,render:Et,max:kt=100,min:Rt=0,minStepsBetweenValues:Tt=0,form:Pt,name:Mt,onValueChange:It,onValueCommitted:At,orientation:Nt="horizontal",step:Ot=1,thumbCollisionBehavior:Dt="push",thumbAlignment:_t="center",value:$t,style:Ft,...Bt}=st,Lt=Cr(xt),Vt=Yz(Lt),Wt=s(It),Ut=s(At),{clearErrors:Ht}=Mu(),{state:Gt,disabled:jt,name:qt,setTouched:Qt,setDirty:Xt,validityData:zt,validation:tn}=la(),{labelId:rn}=xl(),[Kt,an]=Go.useState(),ln=gt??Zz(rn,Kt),Zt=jt||vt,on=qt??Mt,[sn,dn]=ms({controlled:$t,default:yt??Rt,name:"Slider"}),fn=Go.useRef(null),bn=Go.useRef(null),hn=Go.useRef([]),gn=Go.useRef(null),xn=Go.useRef(-1),wn=Go.useRef(null),yn=Go.useRef(ec),[nn,en]=Go.useState(-1),[pn,cn]=Go.useState(-1),[mn,Pn]=Go.useState(!1),[Rn,Cn]=Go.useState(()=>new Map),[kn,Jt]=Go.useState([void 0,void 0]),Yt=s((qn)=>{if(en(qn),qn!==-1)cn(qn)}),un=s((qn)=>{if(qn)bn.current=qn}),vn=Array.isArray(sn),_n=Go.useMemo(()=>{if(!vn)return[mi(sn,Rt,kt)];return sn.map((qn)=>mi(qn,Rt,kt)).sort(B1)},[kt,Rt,vn,sn]),zn=vn?_n:_n[0];Au(tn.inputRef,Lt,zn,void 0,!Zt,Mt),dl(zn,()=>{Ht(on),tn.change(zn);let qn=zt.initialValue,Bn;if(Array.isArray(zn)&&Array.isArray(qn))Bn=!VP(zn,qn);else Bn=zn!==qn;Xt(Bn)});let $n=s((qn,Bn)=>{if(Number.isNaN(qn)||wpe(qn,sn))return!1;let Tr=Bn.event,no=new Tr.constructor(Tr.type,Tr);if(Object.defineProperty(no,"target",{writable:!0,value:{value:qn,name:on}}),Bn.event=no,Wt(qn,Bn),Bn.isCanceled)return!1;return yn.current=Bn.reason,dn(qn),!0}),Mn=s((qn,Bn,Tr)=>{let lr=F1(qn,Bn,Rt,kt,vn,_n);if(H1(lr,Ot,Tt)){let no="key"in Tr?zZ:HZ,An=$n(lr,Ln(no,Tr.nativeEvent,void 0,{activeThumbIndex:Bn}));if(Qt(!0),An)Ut(lr,d0(no,Tr.nativeEvent))}});i(()=>{if(!Zt)return;let qn=Kr(d(fn.current));if(On(fn.current,qn))qn.blur();if(nn!==-1)Yt(-1)},[nn,Zt,Yt]);let Gn=Go.useMemo(()=>({...Gt,activeThumbIndex:nn,disabled:Zt,dragging:mn,orientation:Nt,max:kt,min:Rt,minStepsBetweenValues:Tt,step:Ot,values:_n}),[Gt,nn,Zt,mn,kt,Rt,Tt,Nt,Ot,_n]),sr=Go.useMemo(()=>({active:nn,controlRef:bn,disabled:Zt,dragging:mn,validation:tn,format:wt,handleInputChange:Mn,indicatorPosition:kn,inset:_t!=="center",labelId:ln,rootLabelId:Vt,largeStep:Ct,lastUsedThumbIndex:pn,lastChangeReasonRef:yn,form:Pt,locale:St,max:kt,min:Rt,minStepsBetweenValues:Tt,name:on,onValueCommitted:Ut,orientation:Nt,pressedThumbCenterOffsetRef:gn,pressedThumbIndexRef:xn,pressedValuesRef:wn,registerFieldControlRef:un,renderBeforeHydration:_t==="edge",setActive:Yt,setDragging:Pn,setIndicatorPosition:Jt,setLabelId:an,setValue:$n,state:Gn,step:Ot,thumbCollisionBehavior:Dt,thumbMap:Rn,thumbRefs:hn,values:_n}),[nn,ln,Vt,Zt,mn,tn,wt,Mn,kn,Ct,pn,Pt,St,kt,Rt,Tt,on,Ut,Nt,un,Yt,$n,Gn,Ot,Dt,_t,Rn,_n]),gr=l("div",st,{state:Gn,ref:[ct,fn],props:[{"aria-labelledby":ln,id:Lt,role:"group"},Bt,(qn)=>tn.getValidationProps(Zt,qn)],stateAttributesMapping:Nl});return KP.jsx(GP.Provider,{value:sr,children:KP.jsx(_u,{elementsRef:hn,onMapChange:Cn,children:gr})})});function qP(ot){if(Array.isArray(ot))return ot.map((st)=>qP(st)).join(",");if(ot==null)return"";return String(ot)}var t7=new Map;function Cpe(ot,st){let ct=JSON.stringify({locale:qP(ot),options:st}),gt=t7.get(ct);if(gt)return gt;let bt=new Intl.NumberFormat(ot,st);return t7.set(ct,bt),bt}function $1(ot,st,ct){if(ot==null)return"";return Cpe(st,ct).format(ot)}var fa=e(t(),1);function W1(ot,st){let ct=ot.getBoundingClientRect();return st?(ct.top+ct.bottom)/2:(ct.left+ct.right)/2}function Mm(ot){if(ot===0)return 0;if(Math.abs(ot)<1){let ct=ot.toExponential().split("e-"),gt=ct[0].split(".")[1];return(gt?gt.length:0)+parseInt(ct[1],10)}let st=ot.toString().split(".")[1];return st?st.length:0}function U1(ot,st,ct){let gt=Math.round((ot-ct)/st)*st+ct;return Number(gt.toFixed(Math.max(Mm(st),Mm(ct))))}function QP(ot,st,ct,gt,bt,yt,vt,xt){let wt=ot.slice(),Ct=yt*vt,St=wt.length-1,Et=xt??ot,kt=gt+st*Ct,Rt=bt-(St-st)*Ct;wt[st]=mi(ct,kt,Rt);for(let Tt=st+1;Tt<=St;Tt+=1){let Pt=wt[Tt-1]+Ct,Mt=bt-(St-Tt)*Ct,It=Et[Tt],At=Math.max(wt[Tt],Pt);if(It<At)At=Math.max(It,Pt);wt[Tt]=mi(At,Pt,Mt)}for(let Tt=st-1;Tt>=0;Tt-=1){let Pt=wt[Tt+1]-Ct,Mt=gt+Tt*Ct,It=Et[Tt],At=Math.min(wt[Tt],Pt);if(It>At)At=Math.min(It,Pt);wt[Tt]=mi(At,Mt,Pt)}for(let Tt=0;Tt<=St;Tt+=1)wt[Tt]=Number(wt[Tt].toFixed(12));return wt}function n7(ot,st,ct,gt,bt,yt,vt,xt,wt,Ct){let St=ct??st,Et=gt??st;if(!(St.length>1))return{value:yt,thumbIndex:0,didSwap:!1};let Rt=wt*Ct;if(ot==="push")return{value:QP(St,bt,yt,vt,xt,wt,Ct),thumbIndex:bt,didSwap:!1};let Tt=St.slice(),Pt=Tt[bt-1],Mt=Tt[bt+1],It=Pt!=null?Pt+Rt:vt,At=Mt!=null?Mt-Rt:xt,Nt=Number(mi(yt,It,At).toFixed(12));switch(Tt[bt]=Nt,ot){case"swap":{let Ot=St[bt],Dt=0.0000001,_t=yt>Ot,$t=yt<Ot,Ft=_t&&Mt!=null&&yt>=Mt-0.0000001,Bt=$t&&Pt!=null&&yt<=Pt+0.0000001;if(!Ft&&!Bt)return{value:Tt,thumbIndex:bt,didSwap:!1};let Lt=Ft?bt+1:bt-1,Vt=Tt.map((zt,tn)=>{if(tn===bt)return Nt;let rn=Et[tn];if(rn!=null)return rn;return St[tn]}),Wt=yt;if(Ft)Wt=Math.max(yt,Tt[Lt]);else Wt=Math.min(yt,Tt[Lt]);let Ut=QP(Tt,Lt,Wt,vt,xt,wt,Ct,Vt),Ht=Ft?Lt-1:Lt+1,Gt=Ut[Ht-1],jt=Ut[Ht+1],qt=Gt!=null?Gt+Rt:vt;qt=Math.max(qt,vt+Ht*Rt);let Qt=jt!=null?jt-Rt:xt;Qt=Math.min(Qt,xt-(Ut.length-1-Ht)*Rt);let Xt=mi(Nt,qt,Qt);return Ut[Ht]=Number(Xt.toFixed(12)),{value:Ut,thumbIndex:Lt,didSwap:!0}}case"none":default:return{value:Tt,thumbIndex:bt,didSwap:!1}}}var Spe=2;function Epe(ot,st){if(!ot)return{start:0,end:0};function ct(yt){let vt=yt!=null?parseFloat(yt):0;return Number.isNaN(vt)?0:vt}let gt=!st?"InlineStart":"Top",bt=!st?"InlineEnd":"Bottom";return{start:ct(ot[`border${gt}Width`])+ct(ot[`padding${gt}`]),end:ct(ot[`border${bt}Width`])+ct(ot[`padding${bt}`])}}function kpe(ot,st){if(st.current!=null&&ot.changedTouches){let ct=ot;for(let gt=0;gt<ct.changedTouches.length;gt+=1){let bt=ct.changedTouches[gt];if(bt.identifier===st.current)return{x:bt.clientX,y:bt.clientY}}return null}return{x:ot.clientX,y:ot.clientY}}var r7=fa.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,...vt}=st,{disabled:xt,dragging:wt,inset:Ct,lastChangeReasonRef:St,max:Et,min:kt,minStepsBetweenValues:Rt,onValueCommitted:Tt,orientation:Pt,pressedThumbCenterOffsetRef:Mt,pressedThumbIndexRef:It,pressedValuesRef:At,registerFieldControlRef:Nt,renderBeforeHydration:Ot,setActive:Dt,setDragging:_t,setValue:$t,state:Ft,step:Bt,thumbCollisionBehavior:Lt,thumbRefs:Vt,values:Wt}=Vu(),Ut=ll(),Ht=Wt.length>1,Gt=Pt==="vertical",jt=fa.useRef(null),qt=fa.useRef(null),Qt=s((en)=>{if(en&&qt.current==null)qt.current=m(en).getComputedStyle(en)}),Xt=fa.useRef(null),zt=fa.useRef(0),tn=fa.useRef(0),rn=fa.useRef(null),Kt=io(Wt);function an(en){return en?.querySelector('input[type="range"]')}function ln(en){if(It.current=en,!Vt.current[en])Mt.current=null}function Zt(){It.current=-1,Mt.current=null}function on(en){if(!f(en))return!1;return Vt.current.some((pn)=>{if(!f(pn)||!On(pn,en))return!1;return an(pn)?.disabled===!0})}function sn(en){let pn=jt.current,cn=It.current;if(!pn||cn<0||cn>=Wt.length){if(cn>=Wt.length)rn.current=null;return null}let{width:mn,height:Pn,bottom:Rn,left:Cn,right:kn}=pn.getBoundingClientRect(),Jt=Epe(qt.current,Gt),Yt=tn.current,un=(Gt?Pn:mn)-Jt.start-Jt.end-Yt*2,vn=Mt.current??0,_n=en.x-vn,zn=en.y-vn,$n=Gt?Rn-zn-Jt.end:(Ut==="rtl"?kn-_n:_n-Cn)-Jt.start,Mn=mi(($n-Yt)/un,0,1),Gn=(Et-kt)*Mn+kt;if(Gn=U1(Gn,Bt,kt),Gn=mi(Gn,kt,Et),!Ht)return{value:Gn,thumbIndex:cn,didSwap:!1};return n7(Lt,Wt,Kt.current,At.current,cn,Gn,kt,Et,Bt,Rt)}function dn(en){At.current=Ht?Wt.slice():null,rn.current=null,Kt.current=Wt;let pn=It.current,cn=pn;if(pn>-1&&pn<Wt.length){if(Wt[pn]===Et){let mn=pn;while(mn>0&&Wt[mn-1]===Et)mn-=1;cn=mn}}else{let mn=!Gt?"x":"y",Pn;cn=-1;for(let Rn=0;Rn<Vt.current.length;Rn+=1){let Cn=Vt.current[Rn];if(f(Cn)&&!an(Cn)?.disabled){let kn=W1(Cn,Gt),Jt=Math.abs(en[mn]-kn);if(Pn===void 0||Jt<=Pn)cn=Rn,Pn=Jt}}}if(cn>-1&&cn!==pn)ln(cn);if(Ct){let mn=Vt.current[cn];if(f(mn)){let Pn=mn.getBoundingClientRect(),Rn=!Gt?"width":"height";tn.current=Pn[Rn]/2}}}function fn(en){let pn=an(Vt.current?.[en]);if(!pn)return;pn.focus({preventScroll:!0,focusVisible:!1})}function bn(en,pn,cn){let mn=$t(en.value,Ln(pn,cn,void 0,{activeThumbIndex:en.thumbIndex}));if(mn){if(rn.current=en.value,Kt.current=Array.isArray(en.value)?en.value:[en.value],en.didSwap)ln(en.thumbIndex),fn(en.thumbIndex)}return mn}let hn=s((en)=>{let pn=kpe(en,Xt);if(pn==null)return;if(zt.current+=1,en.type==="pointermove"&&en.buttons===0){gn(en);return}let cn=sn(pn);if(cn==null)return;if(H1(cn.value,Bt,Rt)){if(!wt&&zt.current>Spe)_t(!0);bn(cn,$Z,en)}}),gn=s((en)=>{Dt(-1),_t(!1),Mt.current=null;let pn=rn.current;if(Array.isArray(pn)&&pn.length!==Wt.length)rn.current=null;if(rn.current!=null){let cn=St.current;Tt(rn.current,d0(cn,en))}if("pointerType"in en&&jt.current?.hasPointerCapture(en.pointerId))jt.current?.releasePointerCapture(en.pointerId);It.current=-1,Xt.current=null,wn()}),xn=s((en)=>{if(xt)return;if(on(xr(en))){Zt();return}let pn=en.changedTouches[0];if(pn==null)return;Xt.current=pn.identifier;let cn={x:pn.clientX,y:pn.clientY};dn(cn);let mn=sn(cn);if(mn==null)return;fn(mn.thumbIndex),bn(mn,U_,en),zt.current=0;let Pn=d(jt.current);Pn.addEventListener("touchmove",hn,{passive:!0}),Pn.addEventListener("touchend",gn,{passive:!0})}),wn=s(()=>{let en=d(jt.current);en.removeEventListener("pointermove",hn),en.removeEventListener("pointerup",gn),en.removeEventListener("touchmove",hn),en.removeEventListener("touchend",gn),At.current=null,rn.current=null}),yn=xa();return fa.useEffect(()=>{let en=jt.current;if(!en)return()=>wn();let pn=Xn(en,"touchstart",xn,{passive:!0});return()=>{pn(),yn.cancel(),wn()}},[wn,xn,jt,yn]),fa.useEffect(()=>{if(xt)wn()},[xt,wn]),l("div",st,{state:Ft,ref:[ct,Nt,jt,Qt],props:[{["data-base-ui-slider-control"]:Ot?"":void 0,onPointerDown(en){let pn=jt.current,cn=xr(en.nativeEvent);if(!pn||xt||en.defaultPrevented||!f(cn)||en.button!==0)return;if(on(cn)){Zt();return}let mn={x:en.clientX,y:en.clientY};dn(mn);let Pn=sn(mn);if(Pn==null)return;if(On(Vt.current[Pn.thumbIndex],Kr(d(pn))))en.preventDefault();else yn.request(()=>{fn(Pn.thumbIndex)});if(_t(!0),Mt.current==null)bn(Pn,U_,en.nativeEvent);if(en.nativeEvent.pointerId)pn.setPointerCapture(en.nativeEvent.pointerId);zt.current=0;let kn=d(pn);kn.addEventListener("pointermove",hn,{passive:!0}),kn.addEventListener("pointerup",gn,{once:!0})}},vt],stateAttributesMapping:Nl})});var o7=e(t(),1);var i7=o7.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,...vt}=st,{state:xt}=Vu();return l("div",st,{state:xt,ref:ct,props:[{style:{position:"relative"}},vt],stateAttributesMapping:Nl})});var ma=e(t(),1);var s7="";var a7=e(Jd(),1);function Rpe(){return w}function Tpe(){return!1}function Ppe(){return!0}function Am(){return a7.useSyncExternalStore(Rpe,Tpe,Ppe)}function Cb(ot,st,ct){return(ot-st)*100/(ct-st)}var dft=e(t(),1);var j1=e(t(),1),Ipe=j1.createContext(void 0),Mpe={disableStyleElements:!1};function l7(){return j1.useContext(Ipe)??Mpe}var c7=e(r(),1);function u7(ot){let{script:st}=ot,{nonce:ct}=l7();if(!Am())return null;return c7.jsx("script",{nonce:ct,dangerouslySetInnerHTML:{__html:st},suppressHydrationWarning:!0})}var p7="data-index";var Sb=e(r(),1),d7,Npe=new Set([...Pa,sR,aR]);function Dpe(ot,st,ct,gt){if(st<0)return;if(ot.length===2)return`${$1(ot[st],gt,ct)} ${st===0?"start":"end"} range`;return ct?$1(ot[st],gt,ct):void 0}function _pe(ot,st,ct,gt,bt){let yt=ot+st*ct,vt=Number(yt.toFixed(Math.max(Mm(ot),Mm(st),Mm(gt))));return mi(vt,gt,bt)}var f7=ma.forwardRef(function(st,ct){let{render:gt,children:bt,className:yt,"aria-describedby":vt,"aria-label":xt,"aria-labelledby":wt,"aria-valuetext":Ct,disabled:St=!1,getAriaLabel:Et,getAriaValueText:kt,id:Rt,index:Tt,inputRef:Pt,onBlur:Mt,onFocus:It,onKeyDown:At,tabIndex:Nt,style:Ot,...Dt}=st,_t=Cr(Rt),{active:$t,lastUsedThumbIndex:Ft,controlRef:Bt,disabled:Lt,validation:Vt,format:Wt,handleInputChange:Ut,inset:Ht,labelId:Gt,largeStep:jt,locale:qt,max:Qt,min:Xt,minStepsBetweenValues:zt,form:tn,name:rn,orientation:Kt,pressedThumbCenterOffsetRef:an,pressedThumbIndexRef:ln,renderBeforeHydration:Zt,setActive:on,setIndicatorPosition:sn,state:dn,step:fn,thumbRefs:bn,values:hn}=Vu(),gn=ll(),xn=St||Lt,wn=hn.length>1,yn=Kt==="vertical",nn=gn==="rtl",{setTouched:en,setFocused:pn,validationMode:cn}=la(),mn=ma.useRef(null),Pn=ma.useRef(null),Rn=ma.useRef(!1),Cn=s((Wn)=>{if(Rn.current)return;It?.(Wn)}),kn=s((Wn)=>{if(Rn.current)return;Mt?.(Wn)}),Jt=Cr(),Yt=Nu(),un=wn?Jt:Yt,vn=ma.useMemo(()=>({inputId:un}),[un]),{ref:_n,index:zn}=Cl({metadata:vn}),$n=!wn?0:Tt??zn,Mn=$n===hn.length-1,Gn=hn[$n],sr=Cb(Gn,Xt,Qt),[gr,qn]=ma.useState(),Bn=Am(),Tr=Ft>=0&&Ft<hn.length?Ft:-1,lr=s(()=>{let Wn=Bt.current,Zn=mn.current;if(!Wn||!Zn)return;let vr=Zn.getBoundingClientRect(),wr=Wn.getBoundingClientRect(),Hn=yn?"height":"width",er=wr[Hn]-vr[Hn],br=(vr[Hn]/2+er*sr/100)/wr[Hn]*100,Hr=Number.isFinite(br)?br:void 0;if(qn(Hr),$n===0)sn((Gr)=>[Hr,Gr[1]]);else if(Mn)sn((Gr)=>[Gr[0],Hr])});i(()=>{if(Ht)queueMicrotask(lr)},[lr,Ht]),i(()=>{if(Ht)lr()},[lr,Ht,sr]),i(()=>{if(!Ht)return;let Wn=Bt.current,Zn=mn.current;if(!Wn||!Zn)return;let vr=m(Wn).ResizeObserver;if(typeof vr!=="function")return;let wr=new vr(lr);return wr.observe(Wn),wr.observe(Zn),()=>{wr.disconnect()}},[Bt,lr,Ht]);let no=yn?"bottom":"insetInlineStart",An=yn?"left":"top",Vn;if(wn){if($t===$n)Vn=2;else if(Tr===$n)Vn=1}else if($t===$n)Vn=1;let Jn;if(!Ht&&!Number.isFinite(sr))Jn=Sa;else Jn={position:"absolute",[no]:Ht?"var(--position)":`${sr}%`,[An]:"50%",translate:`${(yn||!nn?-1:1)*50}% ${(yn?1:-1)*50}%`,zIndex:Vn,...Ht&&{["--position"]:`${gr??0}%`,visibility:Zt&&Bn||gr===void 0?"hidden":void 0}};let Yn;if(yn)Yn=nn?"vertical-rl":"vertical-lr";let Sn=typeof Et==="function"?Et($n):xt,Fn=O({"aria-label":Sn,"aria-labelledby":wt??(Sn==null?Gt:void 0),"aria-describedby":vt,"aria-orientation":Kt,"aria-valuenow":Gn,"aria-valuetext":typeof kt==="function"?kt($1(Gn,qt,Wt),Gn,$n):Ct??Dpe(hn,$n,Wt,qt),disabled:xn,form:tn,id:un,max:Qt,min:Xt,name:rn,onChange(Wn){Ut(Wn.currentTarget.valueAsNumber,$n,Wn)},onFocus(Wn){let Zn=Rn.current;if(Rn.current=!1,on($n),pn(!0),Zn)Wn.stopPropagation()},onBlur(Wn){if(Rn.current){Wn.stopPropagation();return}if(on(-1),bn.current.some((Zn)=>On(Zn,Wn.relatedTarget)))return;if(en(!0),pn(!1),cn==="onBlur")Vt.commit(F1(Gn,$n,Xt,Qt,wn,hn))},onKeyDown(Wn){if(Wn.defaultPrevented)return;if(!Npe.has(Wn.key))return;if(Pa.has(Wn.key))Wn.stopPropagation();let Zn=null,vr=0,wr=Wn.shiftKey?jt:fn,Hn=U1(Gn,fn,Xt);switch(Wn.key){case wf:vr=1;break;case Ef:vr=nn?-1:1;break;case Cf:vr=-1;break;case Sf:vr=nn?1:-1;break;case sR:wr=jt,vr=1;break;case aR:wr=jt,vr=-1;break;case Rf:Zn=wn&&Number.isFinite(hn[$n+1])?hn[$n+1]-fn*zt:Qt;break;case kf:Zn=wn&&Number.isFinite(hn[$n-1])?hn[$n-1]+fn*zt:Xt;break;default:break}if(vr!==0)Zn=_pe(Hn,wr,vr,Xt,Qt);if(Zn!==null){let er=Wn.currentTarget;if(!Ga(er))Rn.current=!0,er.blur(),er.focus({preventScroll:!0,focusVisible:!0});Ut(Zn,$n,Wn),Wn.preventDefault()}},step:fn,style:{...Sa,width:"100%",height:"100%",writingMode:Yn},tabIndex:Nt,type:"range",value:Gn??""},(Wn)=>Vt.getValidationProps(xn,Wn),{onFocus:Cn,onBlur:kn,onKeyDown:At}),ur=L(Pn,Vt.inputRef,Pt);return l("div",st,{state:dn,ref:[ct,_n,mn],props:[{[p7]:$n,children:Sb.jsxs(ma.Fragment,{children:[bt,Sb.jsx("input",{ref:ur,...Fn,suppressHydrationWarning:!0}),Ht&&Mn&&Zt&&(d7||(d7=Sb.jsx(u7,{script:s7})))]}),id:_t,onPointerDown(Wn){if(xn)return;ln.current=$n;let Zn=W1(Wn.currentTarget,yn);an.current=(yn?Wn.clientY:Wn.clientX)-Zn},style:Jn,suppressHydrationWarning:Zt||void 0},Dt],stateAttributesMapping:Nl})});var m7=e(t(),1);function Ope(ot,st,ct,gt,bt,yt){let vt={visibility:yt||ct&&(gt===void 0||st&&bt===void 0)?"hidden":void 0,position:ot?"absolute":"relative",[ot?"width":"height"]:"inherit"},xt=`${gt??0}%`,wt=`${(bt??0)-(gt??0)}%`;if(ct){if(vt["--start-position"]=xt,xt="var(--start-position)",st)vt["--relative-size"]=wt,wt="var(--relative-size)"}return vt[ot?"bottom":"insetInlineStart"]=st?xt:0,vt[ot?"height":"width"]=st?wt:xt,vt}var g7=m7.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,...vt}=st,{indicatorPosition:xt,inset:wt,max:Ct,min:St,orientation:Et,renderBeforeHydration:kt,state:Rt,values:Tt}=Vu(),Pt=Am(),Mt=Et==="vertical",It=Tt.length>1,At=Ope(Mt,It,wt,wt?xt[0]:Cb(Tt[0],St,Ct),wt?xt[1]:Cb(Tt[Tt.length-1],St,Ct),wt&&kt&&Pt);return l("div",st,{state:Rt,ref:ct,props:[{["data-base-ui-slider-indicator"]:kt?"":void 0,style:At,suppressHydrationWarning:kt||void 0},vt],stateAttributesMapping:Nl})});var md=e(r(),1);function b7({animate:ot=!1,children:st,className:ct,defaultValue:gt,value:bt,min:yt=0,max:vt=100,...xt}){let[wt,Ct]=V1.useState(!1),St=Array.isArray(bt)?bt:Array.isArray(gt)?gt:[yt];return V1.useEffect(()=>{let Et=requestAnimationFrame(()=>Ct(!0));return()=>cancelAnimationFrame(Et)},[]),md.jsx(e7,{className:u("data-horizontal:w-full data-vertical:h-full",ct),"data-slot":"slider",defaultValue:gt,value:bt,min:yt,max:vt,thumbAlignment:"edge",...xt,children:md.jsxs(r7,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[md.jsx(i7,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-accent select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:md.jsx(g7,{"data-slot":"slider-range",className:u("bg-primary select-none data-horizontal:h-full data-vertical:w-full",ot&&wt&&"transition-[width,height,inset-inline-start,bottom] duration-100 ease-in-out")})}),st,Array.from({length:St.length},(Et,kt)=>md.jsx(f7,{"data-slot":"slider-thumb",className:u("relative block size-3 shrink-0 rounded-xs bg-white shadow-xs ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50 data-horizontal:cursor-ew-resize data-vertical:cursor-ns-resize",ot&&wt&&"transition-[inset-inline-start,bottom,color,box-shadow] duration-100 ease-in-out")},kt))]})})}var dr=e(r(),1);function Lpe(ot){return ot.charAt(0).toUpperCase()+ot.slice(1)}function Bpe(ot){return ot==="xhigh"?"Extra":Lpe(ot)}function y7(ot){return typeof ot==="number"?ot:ot[0]??0}var v7={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},x7={type:"spring",duration:0.3,delay:0.1,bounce:0};function w7({label:ot,leadingIcon:st,className:ct,...gt}){return dr.jsxs(a,{...gt,variant:"ghost",className:n("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",ct),children:[st,dr.jsx("span",{className:"truncate font-normal",children:ot})]})}function Fpe({current:ot,model:st,models:ct,onValueChange:gt}){let bt=st.displayName,yt=Xz(ct,"Models");return dr.jsxs(hs,{children:[dr.jsx(bs,{render:dr.jsx(w7,{label:bt,className:"shrink","aria-label":`Model: ${bt}`})}),dr.jsx(ys,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:dr.jsx($w,{value:ot,onValueChange:gt,children:yt.map((vt)=>dr.jsxs(Na,{children:[dr.jsx(zw,{children:vt.label}),vt.models.map((xt)=>dr.jsx(Ww,{value:xt.value,closeOnClick:!0,children:xt.displayName},xt.value))]},vt.label))})})]})}function C7({speedMode:ot,supportsFastMode:st,supportsUltrafastMode:ct,onChange:gt}){let bt=ot==="ultrafast"?"normal":ot==="fast"?ct?"ultrafast":"normal":st?"fast":"ultrafast",yt=bt==="normal"?`Disable ${ot==="ultrafast"?"ultrafast":"fast"} mode`:`Enable ${bt} mode`;return dr.jsxs(Wr,{children:[dr.jsx(Ur,{render:dr.jsx(a,{type:"button",variant:"ghost",size:"icon-sm","aria-label":yt,"aria-pressed":ot!=="normal",onClick:()=>gt(bt),className:"-my-1 -mr-1",children:ot==="ultrafast"?dr.jsx(UP,{className:"text-primary",stroke:1.75}):ot==="fast"?dr.jsx(Hk,{className:"text-primary",stroke:1.75}):dr.jsx(F0,{className:"text-muted-foreground",stroke:1.75})})}),dr.jsxs(jr,{align:"center",className:"flex-col gap-0",children:[dr.jsx("span",{children:yt}),dr.jsx("span",{className:"font-normal text-muted-foreground",children:bt==="normal"?"Normal usage":bt==="ultrafast"?"Much more usage":"More usage"})]})]})}function Hpe({currentEffort:ot,effortLevels:st,speedMode:ct,supportsFastMode:gt,supportsUltrafastMode:bt,onSpeedModeChange:yt,onValueChange:vt}){let xt=qz(st,ot),[wt,Ct]=Nm.useState(!1),[St,Et]=Nm.useState(xt),[kt,Rt]=Nm.useState(!1),Pt=st[wt?St:xt]??ot,Mt=Bpe(Pt),It=(Nt)=>{if(Nt)Et(xt);else Rt(!1);Ct(Nt)},At=(Nt)=>{let Ot=st[Nt];if(Ot&&Ot!==ot)vt(Ot)};return dr.jsxs(ou,{open:wt,onOpenChange:It,children:[dr.jsx(iu,{render:dr.jsx(w7,{label:Mt,leadingIcon:ct==="ultrafast"?dr.jsx(UP,{className:"text-muted-foreground",stroke:1.5}):ct==="fast"?dr.jsx(Hk,{className:"text-muted-foreground",stroke:1.5}):void 0,"aria-label":`Effort: ${Mt}`})}),dr.jsxs(su,{align:"end",side:"top",className:"w-64",children:[dr.jsx(gB,{className:"relative h-5 flex-row items-center",children:dr.jsx(Qi,{mode:"popLayout",initial:!1,children:kt?dr.jsxs(S.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:v7,initial:"from",animate:"to",exit:"from",transition:x7,children:[dr.jsx("span",{children:"Faster"}),dr.jsx("span",{children:"Smarter"})]},"range"):dr.jsxs(S.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:v7,initial:"from",animate:"to",exit:"from",transition:x7,children:[dr.jsxs("div",{className:"flex items-center gap-1",children:[dr.jsx("span",{className:"text-muted-foreground",children:"Effort"}),dr.jsx("output",{"aria-live":"polite",children:Mt})]}),(gt||bt)&&dr.jsx(C7,{speedMode:ct,supportsFastMode:gt,supportsUltrafastMode:bt,onChange:yt})]},"effort")})}),dr.jsxs("label",{className:"block",children:[dr.jsx("span",{className:"sr-only",children:"Reasoning effort"}),dr.jsx(b7,{value:[St],min:0,max:st.length-1,step:1,onPointerDown:(Nt)=>{if(Nt.button===0)Rt(!0)},onPointerCancel:()=>Rt(!1),onValueChange:(Nt)=>Et(y7(Nt)),onValueCommitted:(Nt)=>{Rt(!1),At(y7(Nt))},className:n("**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm","**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:ring-0"),animate:!0,children:dr.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:st.length},(Nt,Ot)=>dr.jsx("span",{className:n("size-1 rounded-full",Ot<=St?"bg-primary-foreground/30":"bg-foreground/30")},Ot))})})]})]})]})}var S7=Nm.memo(function({sessionId:st}){let{workspaceId:ct,layout:gt,setLayout:bt}=Sr(),{data:yt}=ua(ct),vt=yt?.models??[],xt=vt.find((_t)=>_t.value==="default"),wt=yt?Jz(vt.filter((_t)=>_t.value!=="default"),yt.provider):[],Ct=Kv(ct,st).data?.config,St=L3(ct),Et=(st?Ct?.model:void 0)??gt.selectedModel,kt=(st?Ct?.effort:void 0)??gt.selectedEffort,Rt=(st?Ct?.speedMode:void 0)??gt.selectedSpeedMode,Tt=(_t)=>{if(st)St.mutate({sessionId:st,patch:{model:_t}});else bt({selectedModel:_t})},Pt=(_t)=>{if(st)St.mutate({sessionId:st,patch:{effort:_t}});else bt({selectedEffort:_t})},Mt=(_t)=>{if(st)St.mutate({sessionId:st,patch:{speedMode:_t}});else bt({selectedSpeedMode:_t})},It=O1(wt,Et,xt?.resolvedModel);if(!It)return null;let At=It.supportsEffort?It.supportedEffortLevels??[]:[],Nt=jP(At,kt,It.defaultEffort),Ot=Qz(At)&&Nt!==void 0,Dt=L1(It,Rt);return dr.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[dr.jsx(Fpe,{current:It.value,model:It,models:wt,onValueChange:Tt}),!Ot&&(It.supportsFastMode||It.supportsUltrafastMode)&&dr.jsx(C7,{speedMode:Dt,supportsFastMode:It.supportsFastMode===!0,supportsUltrafastMode:It.supportsUltrafastMode===!0,onChange:Mt}),Ot&&dr.jsx(Hpe,{currentEffort:Nt,effortLevels:At,speedMode:Dt,supportsFastMode:It.supportsFastMode===!0,supportsUltrafastMode:It.supportsUltrafastMode===!0,onSpeedModeChange:Mt,onValueChange:Pt},It.value)]})});var go=e(r(),1);function k7({composerRef:ot,onSend:st,onStop:ct,processing:gt,sessionId:bt,modelSessionId:yt,availability:vt,chatReady:xt,annotation:wt,onRemoveDrawing:Ct,allowFiles:St=!0,placeholder:Et}){let kt=gd.useRef(null),Rt=b(),Tt=uc(),Pt=oi(Rt,bt??Yo(Tt)),Mt=Ar((Ht)=>Ht.composerDrafts[Pt]??"");gd.useEffect(()=>{if(Tt==="overview")Ar.getState().moveComposerDraft(Rt,Pt)},[Tt,Rt,Pt]);let It=k(Mt),At=gi((Ht)=>Ht.attachments[As(Rt,bt)]??zpe),[Nt,Ot]=gd.useState(!1),Dt=At.some((Ht)=>Ht.kind!=="text"&&Ht.status==="uploading"),_t=At.some((Ht)=>Ht.kind==="text"||Ht.status==="ready"||Ht.status==="draft"),$t=Mt.trim().length>0||_t,Ft=xt&&xb($t,Dt,vt),Bt=(Ht)=>{It.current=Ht,Ar.getState().setComposerDraft(Pt,Ht)},Lt=(Ht)=>{if(St)lz({workspaceId:Rt,sessionId:bt},Ht)},Vt=gd.useRef(!1),Wt=(Ht)=>{if(Ht.kind==="drawing"&&Ct){Ct(Ht.localId);return}Mr.getState().removeAttachment(Rt,Ht.localId)},Ut=async()=>{if(!Ft||Vt.current)return;Vt.current=!0;try{await wt?.finish(),await st(It.current),It.current="",Ar.getState().setComposerDraft(Pt,null)}catch(Ht){qr.add({title:Ht instanceof Error?Ht.message:"Couldn’t send message",type:"error"})}finally{Vt.current=!1}};return go.jsxs(dz,{composerRef:ot,onSubmit:(Ht)=>{Ht.preventDefault(),Ut()},onDragOver:(Ht)=>{if(!Ht.dataTransfer.types.includes("Files"))return;if(Ht.preventDefault(),St)Ot(!0)},onDragLeave:(Ht)=>{if(!St)return;if(Ht.currentTarget.contains(Ht.relatedTarget))return;Ot(!1)},onDrop:(Ht)=>{if(!Ht.dataTransfer.types.includes("Files"))return;Ht.preventDefault(),Ot(!1),Lt(Array.from(Ht.dataTransfer.files))},className:n(Nt&&"ring-2 ring-ring/60"),children:[At.length>0&&go.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:At.toSorted((Ht,Gt)=>E7[Ht.kind]-E7[Gt.kind]).map((Ht)=>Ht.kind==="text"?go.jsx(wb,{label:Ht.label,onRemove:()=>Wt(Ht)},Ht.localId):Ht.kind==="drawing"?go.jsx(Wz,{attachment:Ht,onRemove:()=>Wt(Ht)},Ht.localId):go.jsx(Uz,{attachment:Ht,onRemove:()=>Wt(Ht)},Ht.localId))}),go.jsx(fz,{textareaRef:ot,disabled:vt.status!=="available",id:"chat-input",name:"message",value:Mt,onChange:(Ht)=>Bt(Ht.target.value),onKeyDown:(Ht)=>{if(Ht.key==="Enter"&&!Ht.shiftKey)Ht.preventDefault(),Ut()},onPaste:(Ht)=>{let Gt=Array.from(Ht.clipboardData?.files??[]);if(Gt.length===0)return;Ht.preventDefault(),Lt(Gt)},placeholder:gt?"Queue a follow-up":Et??"Do anything",rows:1}),go.jsxs(mz,{children:[St&&go.jsx("input",{ref:kt,type:"file",multiple:!0,hidden:!0,onChange:(Ht)=>{Lt(Array.from(Ht.target.files??[])),Ht.target.value=""}}),go.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[St&&go.jsxs(Wr,{children:[go.jsx(Ur,{render:go.jsx(a,{type:"button",variant:"ghost",size:"icon",onClick:()=>kt.current?.click(),"aria-label":"Attach files",children:go.jsx(K0,{stroke:1.6,className:"size-4.5!"})})}),go.jsx(jr,{children:"Attach files"})]}),wt&&go.jsxs(Wr,{children:[go.jsx(Ur,{render:go.jsx(a,{type:"button",variant:"ghost",size:"icon",onClick:wt.onToggle,className:n(wt.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":wt.active,children:go.jsx(ff,{stroke:1.5})})}),go.jsx(jr,{children:"Draw annotation"})]})]}),go.jsx(S7,{sessionId:yt}),gt?go.jsxs(Wr,{children:[go.jsx(Ur,{render:go.jsx(a,{type:"button",size:"icon",onClick:ct,"aria-label":"Stop agent",children:go.jsx(r5,{})})}),go.jsx(jr,{children:"Stop answering"})]}):go.jsx(gz,{label:"Send message",hasContent:$t,busy:Dt||!xt,availability:vt})]})]})}var zpe=[],E7={file:0,drawing:1,text:2};var hd=e(r(),1);function JP({className:ot,prompt:st,disabled:ct=!1,onSelect:gt}){let bt=st.icon;return hd.jsxs(a,{type:"button",size:"sm",disabled:ct,onClick:()=>gt(st),className:n("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",ot),children:[hd.jsx(bt,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),hd.jsx("span",{children:st.label})]})}function R7({prompts:ot,disabled:st=!1,onSelect:ct}){return hd.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 @md:grid-cols-3",children:ot.map((gt,bt)=>hd.jsx(JP,{prompt:gt,disabled:st,onSelect:ct,className:n("h-full w-fit @md:w-full",bt===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",bt===1&&"@md:-rotate-1",bt===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},gt.prompt))})}var eo=e(r(),1),XP="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",$pe=[{label:"Check the weather",prompt:"Build me a set of weather widgets that surface current conditions, today's hourly forecast, and a simple weekly outlook at a glance",context:["Build this onboarding example immediately without asking follow-up questions.","Create three separate widgets: current conditions, today's hourly forecast, and a seven-day outlook.","Use one shared Open-Meteo server function with no API key and use Berlin as the default location.","Give each widget an appropriate grid size and a compact, visually distinct layout with loading, error, and last-updated states.","Bundle all three widgets, smoke-test the shared weather function, and check runtime logs before finishing.",XP],icon:QL},{label:"Track my finances",prompt:"Build me a personal finance view for tracking income, expenses, monthly budgets, spending trends, and savings, with an agent action that can add sample transactions",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services or bank connections.","Create a responsive View with a month selector, income, spending, and savings summaries, an income-versus-spending trend, category breakdowns, budget progress, and recent transactions.","Support adding, editing, and deleting income and expense transactions, categories, and monthly category budgets.","Persist transactions, categories, and budgets in a workspace-local SQLite database accessed through server functions. Store monetary amounts as integer cents and seed realistic sample data only when the database is empty.","Add an “Add with agent” action that imports `sendChatMessage` from `moi` and sends a concise request for the agent to generate and insert a realistic batch of sample transactions into the same database.","Provide a small documented workspace script the agent can use to validate and append transactions safely, then refresh the View data after the agent updates the database.","Include loading, empty, and error states, then bundle the View and smoke-test its SQLite persistence and transaction mutations before finishing.",XP],icon:YL},{label:"Build a playful synthesizer",prompt:"Build me a view with a simple, playful synthesizer featuring a keyboard, five sound controls, and the ability to record, save, and load music files from the workspace",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services.","Create a responsive View that uses the browser's audio capabilities, with an onscreen piano and computer-keyboard controls.","Include five clearly labeled sound controls for waveform, attack, release, filter cutoff, and volume.","Let the user record timed note events, play and stop recordings, give them names, and save and load them as JSON music files in a workspace music folder.","Include clear empty and error states, then bundle the View and check runtime logs before finishing.",XP],icon:q0}],Wpe={label:"Explore the workspace",prompt:"Explore this workspace and suggest what Moi can build based on its content",context:["Explore the existing workspace files before making suggestions.","Briefly explain what the workspace appears to be for and which content informed your ideas.","Propose a focused set of useful widgets or views that fit the work already here.","Wait for me to choose before building anything."],icon:U0};function T7({tabId:ot,isViewDraft:st,hasSentMessageFromMoi:ct,isWorkspacePendingAnalysis:gt}){if(st)return"view-draft";if(!ct)return"welcome";if(gt)return"explore-workspace";return ot==="overview"?"overview-empty":"tab-empty"}function P7({agent:ot,kind:st,hasWorkspaceApplets:ct,disabled:gt=!1,onSelectPrompt:bt,onNavigate:yt}){switch(st){case"view-draft":return eo.jsx(Upe,{agent:ot});case"welcome":return eo.jsx(jpe,{agent:ot,disabled:gt,showExamples:!ct,onSelectPrompt:bt,onNavigate:yt});case"explore-workspace":return eo.jsx(Vpe,{agent:ot,disabled:gt,onSelectPrompt:bt});case"overview-empty":return eo.jsx(Gpe,{agent:ot});case"tab-empty":return eo.jsx(Kpe,{agent:ot})}}function Eb({agent:ot,children:st,className:ct}){return eo.jsxs("div",{className:n("flex flex-1 flex-col items-center justify-center self-center",ct),children:[eo.jsx(Pl,{preset:ot,color:"secondary",expression:"idle",className:"mb-2",animated:!0}),st]})}function Upe({agent:ot}){return eo.jsx(Eb,{agent:ot,className:"text-center text-muted-foreground",children:eo.jsx("p",{className:"mx-auto max-w-xs px-8 text-sm",children:"Describe the content, data, and key actions you need in the view"})})}function jpe({agent:ot,disabled:st=!1,showExamples:ct=!0,onSelectPrompt:gt,onNavigate:bt}){return eo.jsx(Eb,{agent:ot,className:"@container w-full max-w-md min-w-0",children:eo.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[eo.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[eo.jsx("p",{children:"Moi is the personal workspace that grows and adapts to your needs."}),eo.jsxs("p",{children:["Ask the agent to build widgets on the"," ",eo.jsx(YP,{Icon:V0,destination:"overview",onNavigate:bt,children:"Overview"})," ","page, or more complex tools as separate"," ",eo.jsx(YP,{Icon:B0,destination:"views",onNavigate:bt,children:"Views"}),". Use"," ",eo.jsx(YP,{Icon:ae,destination:"scratchpad",onNavigate:bt,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),ct&&eo.jsx("p",{children:"Try an example:"})]}),ct&&eo.jsx(R7,{prompts:$pe,disabled:st,onSelect:gt})]})})}function Vpe({agent:ot,disabled:st=!1,onSelectPrompt:ct}){return eo.jsx(Eb,{agent:ot,children:eo.jsxs("div",{className:"flex flex-col items-center gap-4",children:[eo.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:eo.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),eo.jsx(JP,{prompt:Wpe,disabled:st,onSelect:ct})]})})}function Gpe({agent:ot}){return eo.jsx(Eb,{agent:ot,className:"text-center text-muted-foreground",children:eo.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})})}function Kpe({agent:ot}){return eo.jsx(Eb,{agent:ot,className:"text-center text-muted-foreground",children:eo.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent and manage the view from here"})})}function YP({Icon:ot,children:st,destination:ct,onNavigate:gt}){return eo.jsxs("button",{type:"button","data-welcome-destination":ct,onClick:()=>gt(ct),className:"inline-flex cursor-pointer items-center gap-0.5 align-bottom font-medium text-foreground",children:[eo.jsx(ot,{size:16,stroke:1.75,"aria-hidden":!0}),st]})}var kb=e(t(),1);var cr=e(r(),1);function qpe(ot){if(ot.flavor==="cron"||ot.flavor==="subagent")return ot.flavor;let st=ot.origin?.provider.trim().toLowerCase();return st?st:null}function Qpe({active:ot,canArchive:st,confirmingArchive:ct,onArchive:gt,onRequestArchive:bt,onSelect:yt,session:vt,workspaceId:xt}){let wt=kb.useRef(!1),[Ct,St]=kb.useState(!1),Et=gi((Pt)=>bf(Pt.activity,xt,vt.sessionId)),kt=qpe(vt);function Rt(){bt(vt.sessionId)}async function Tt(){if(wt.current)return;wt.current=!0,St(!0);try{await gt(vt.sessionId)}catch{}finally{wt.current=!1,St(!1)}}return cr.jsxs("div",{className:"group/chat relative",children:[cr.jsx(vs,{className:n("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",ot&&"bg-accent text-accent-foreground"),onClick:()=>yt(vt.sessionId),children:cr.jsx("div",{className:n("flex min-w-0 flex-1 overflow-hidden",(Et||Ct)&&"mr-4 mask-r-from-[calc(100%-16px)]",st&&!ct&&"group-focus-within/chat:mr-4 group-focus-within/chat:mask-r-from-[calc(100%-16px)] group-hover/chat:mr-4 group-hover/chat:mask-r-from-[calc(100%-16px)] [@media(hover:none)]:mr-4 [@media(hover:none)]:mask-r-from-[calc(100%-16px)]",ct&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:cr.jsxs("span",{className:n("flex min-w-0 items-baseline gap-1.5",(Et||Ct)&&"-mr-4",ct?"-mr-14":st&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[cr.jsx("span",{className:"min-w-0 truncate",children:vt.summary}),kt&&cr.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:kt})]})})}),Et&&cr.jsx($o,{className:n("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",st&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(ct||Ct)&&"hidden")}),st&&cr.jsx("div",{className:n("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!ct&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",Ct&&"opacity-100!"),children:ct?cr.jsx(a,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${vt.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:Ct,onClick:Tt,onPointerDown:(Pt)=>Pt.stopPropagation(),children:"Confirm"}):cr.jsxs(Wr,{children:[cr.jsx(Ur,{render:cr.jsx(a,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${vt.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:Ct,onClick:Rt,onPointerDown:(Pt)=>Pt.stopPropagation(),children:cr.jsx(SO,{stroke:1.75})})}),cr.jsx(jr,{side:"right",children:"Archive chat"})]})})]})}function Jpe(ot){return`${ot.getFullYear()}-${ot.getMonth()}-${ot.getDate()}`}function I7(ot){return Date.UTC(ot.getFullYear(),ot.getMonth(),ot.getDate())/86400000}function Xpe(ot,st){let ct=I7(st)-I7(ot);if(ct===0)return"Today";if(ct===1)return"Yesterday";if(ct>=2&&ct<=5)return`${ct} days ago`;return ot.toLocaleDateString([],{month:"short",day:"numeric",...ot.getFullYear()===st.getFullYear()?{}:{year:"numeric"}})}function Ype(ot,st=new Date){let ct=new Map;for(let gt of ot.slice().sort((bt,yt)=>yt.lastModified-bt.lastModified)){let bt=new Date(gt.lastModified),yt=Jpe(bt),vt=ct.get(yt);if(vt){vt.sessions.push(gt);continue}ct.set(yt,{key:yt,label:Xpe(bt,st),sessions:[gt]})}return[...ct.values()]}function Zpe(ot,st,ct=new Date){return Ype(ot.filter((gt)=>st==="overview"?!gt.tabId?.startsWith("views/"):gt.tabId===st),ct)}function M7({className:ot}){let st=b(),{pinnedSessionId:ct,loaded:gt,pin:bt,unpin:yt}=fu(),[vt]=pc(),{data:xt=[]}=Gv(st);if(!gt)return null;if(ct){let wt=xt.find((Ct)=>Ct.sessionId===ct)?.summary;if(!wt)return null;return cr.jsxs("div",{className:n("-my-0.5 -ml-0.5 box-content h-7 max-w-64 rounded-lg py-0.5 pr-0.5 pl-3","flex min-w-0 items-center gap-1 bg-accent text-sm font-medium"),children:[cr.jsx("span",{className:"min-w-0 flex-1 truncate",children:wt}),cr.jsxs(Wr,{children:[cr.jsx(Ur,{render:cr.jsx(a,{variant:"ghost",size:"icon-sm",className:ot,onClick:yt,"aria-label":"Unpin chat","aria-pressed":!0,children:cr.jsx(n5,{stroke:1.75})})}),cr.jsx(jr,{children:"Unpin chat"})]},"unpin")]})}return cr.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-1",children:[cr.jsx(ede,{className:ot,sessions:xt}),vt&&cr.jsxs(Wr,{children:[cr.jsx(Ur,{render:cr.jsx(a,{variant:"ghost",size:"icon-sm",className:ot,onClick:()=>bt(vt),"aria-label":"Pin chat to workspace","aria-pressed":!1,children:cr.jsx(PL,{stroke:1.75})})}),cr.jsx(jr,{children:"Pin chat to workspace"})]},"pin")]})}function ede({className:ot,sessions:st}){let ct=b(),gt=uc(),[bt,yt]=pc(),[vt,xt]=kb.useState(null),wt=ua(ct).data?.supportsArchiving===!0,Ct=_3(ct),St=Zpe(st,gt);if(St.length===0&&!bt)return null;function Et(Rt){if(!Rt)xt(null)}async function kt(Rt){xt(null),await Ct.mutateAsync(Rt);let Tt=Mr.getState();if(Tt.clearAttachments(ct,Rt),Tt.clearPreviewsForSession(ct,Rt),bt===Rt)yt(null)}return bt?cr.jsxs(Wr,{children:[cr.jsx(Ur,{render:cr.jsx(a,{variant:"ghost",size:"icon-sm","aria-label":"New chat",onClick:()=>yt(null),className:ot,children:cr.jsx(W0,{stroke:1.75})})}),cr.jsx(jr,{children:"New chat"})]}):cr.jsxs(hs,{onOpenChange:Et,children:[cr.jsxs(Wr,{children:[cr.jsx(bs,{render:cr.jsx(Ur,{render:cr.jsx(a,{variant:"ghost",size:"icon-sm","aria-label":"History",className:ot,children:cr.jsx(lL,{stroke:1.75})})})}),cr.jsx(jr,{children:"History"})]}),cr.jsx(ys,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:cr.jsx("div",{className:"no-scrollbar flex min-h-0 flex-1 scroll-fade flex-col gap-1 overflow-y-auto overscroll-contain [--scroll-fade-reveal:8px]",children:St.map((Rt)=>cr.jsxs(Na,{children:[cr.jsx(zw,{children:Rt.label}),Rt.sessions.map((Tt)=>cr.jsx(Qpe,{session:Tt,active:bt===Tt.sessionId,canArchive:wt,confirmingArchive:vt===Tt.sessionId,onSelect:yt,onArchive:kt,onRequestArchive:xt,workspaceId:ct},Tt.sessionId))]},Rt.key))})})]})}var KG=e(t(),1);function to(){}function G1(){}function A7(ot,st){let ct=st||{};return(ot[ot.length-1]===""?[...ot,""]:ot).join((ct.padRight?" ":"")+","+(ct.padLeft===!1?"":" ")).trim()}var tde=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nde=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rde={};function K1(ot,st){return((st||rde).jsx?nde:tde).test(ot)}var ode=/[ \t\n\f\r]/g;function ZP(ot){return typeof ot==="object"?ot.type==="text"?N7(ot.value):!1:N7(ot)}function N7(ot){return ot.replace(ode,"")===""}class Gu{constructor(ot,st,ct){if(this.normal=st,this.property=ot,ct)this.space=ct}}Gu.prototype.normal={};Gu.prototype.property={};Gu.prototype.space=void 0;function eI(ot,st){let ct={},gt={};for(let bt of ot)Object.assign(ct,bt.property),Object.assign(gt,bt.normal);return new Gu(ct,gt,st)}function Rb(ot){return ot.toLowerCase()}class ki{constructor(ot,st){this.attribute=st,this.property=ot}}ki.prototype.attribute="";ki.prototype.booleanish=!1;ki.prototype.boolean=!1;ki.prototype.commaOrSpaceSeparated=!1;ki.prototype.commaSeparated=!1;ki.prototype.defined=!1;ki.prototype.mustUseProperty=!1;ki.prototype.number=!1;ki.prototype.overloadedBoolean=!1;ki.prototype.property="";ki.prototype.spaceSeparated=!1;ki.prototype.space=void 0;var ide=0,yr=bd(),Bo=bd(),q1=bd(),Dn=bd(),so=bd(),Ku=bd(),xs=bd();function bd(){return 2**++ide}var tI=Object.keys(Tb);class Dm extends ki{constructor(ot,st,ct,gt){let bt=-1;super(ot,st);if(D7(this,"space",gt),typeof ct==="number")while(++bt<tI.length){let yt=tI[bt];D7(this,tI[bt],(ct&Tb[yt])===Tb[yt])}}}Dm.prototype.defined=!0;function D7(ot,st,ct){if(ct)ot[st]=ct}function ga(ot){let st={},ct={};for(let[gt,bt]of Object.entries(ot.properties)){let yt=new Dm(gt,ot.transform(ot.attributes||{},gt),bt,ot.space);if(ot.mustUseProperty&&ot.mustUseProperty.includes(gt))yt.mustUseProperty=!0;st[gt]=yt,ct[Rb(gt)]=gt,ct[Rb(yt.attribute)]=gt}return new Gu(st,ct,ot.space)}var nI=ga({properties:{ariaActiveDescendant:null,ariaAtomic:Bo,ariaAutoComplete:null,ariaBusy:Bo,ariaChecked:Bo,ariaColCount:Dn,ariaColIndex:Dn,ariaColSpan:Dn,ariaControls:so,ariaCurrent:null,ariaDescribedBy:so,ariaDetails:null,ariaDisabled:Bo,ariaDropEffect:so,ariaErrorMessage:null,ariaExpanded:Bo,ariaFlowTo:so,ariaGrabbed:Bo,ariaHasPopup:null,ariaHidden:Bo,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:so,ariaLevel:Dn,ariaLive:null,ariaModal:Bo,ariaMultiLine:Bo,ariaMultiSelectable:Bo,ariaOrientation:null,ariaOwns:so,ariaPlaceholder:null,ariaPosInSet:Dn,ariaPressed:Bo,ariaReadOnly:Bo,ariaRelevant:null,ariaRequired:Bo,ariaRoleDescription:so,ariaRowCount:Dn,ariaRowIndex:Dn,ariaRowSpan:Dn,ariaSelected:Bo,ariaSetSize:Dn,ariaSort:null,ariaValueMax:Dn,ariaValueMin:Dn,ariaValueNow:Dn,ariaValueText:null,role:null},transform(ot,st){return st==="role"?st:"aria-"+st.slice(4).toLowerCase()}});function Q1(ot,st){return st in ot?ot[st]:st}function J1(ot,st){return Q1(ot,st.toLowerCase())}var _7=ga({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ku,acceptCharset:so,accessKey:so,action:null,allow:null,allowFullScreen:yr,allowPaymentRequest:yr,allowUserMedia:yr,alt:null,as:null,async:yr,autoCapitalize:null,autoComplete:so,autoFocus:yr,autoPlay:yr,blocking:so,capture:null,charSet:null,checked:yr,cite:null,className:so,cols:Dn,colSpan:null,content:null,contentEditable:Bo,controls:yr,controlsList:so,coords:Dn|Ku,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yr,defer:yr,dir:null,dirName:null,disabled:yr,download:q1,draggable:Bo,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yr,formTarget:null,headers:so,height:Dn,hidden:q1,high:Dn,href:null,hrefLang:null,htmlFor:so,httpEquiv:so,id:null,imageSizes:null,imageSrcSet:null,inert:yr,inputMode:null,integrity:null,is:null,isMap:yr,itemId:null,itemProp:so,itemRef:so,itemScope:yr,itemType:so,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yr,low:Dn,manifest:null,max:null,maxLength:Dn,media:null,method:null,min:null,minLength:Dn,multiple:yr,muted:yr,name:null,nonce:null,noModule:yr,noValidate:yr,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:yr,optimum:Dn,pattern:null,ping:so,placeholder:null,playsInline:yr,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yr,referrerPolicy:null,rel:so,required:yr,reversed:yr,rows:Dn,rowSpan:Dn,sandbox:so,scope:null,scoped:yr,seamless:yr,selected:yr,shadowRootClonable:yr,shadowRootDelegatesFocus:yr,shadowRootMode:null,shape:null,size:Dn,sizes:null,slot:null,span:Dn,spellCheck:Bo,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Dn,step:null,style:null,tabIndex:Dn,target:null,title:null,translate:null,type:null,typeMustMatch:yr,useMap:null,value:Bo,width:Dn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:so,axis:null,background:null,bgColor:null,border:Dn,borderColor:null,bottomMargin:Dn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yr,declare:yr,event:null,face:null,frame:null,frameBorder:null,hSpace:Dn,leftMargin:Dn,link:null,longDesc:null,lowSrc:null,marginHeight:Dn,marginWidth:Dn,noResize:yr,noHref:yr,noShade:yr,noWrap:yr,object:null,profile:null,prompt:null,rev:null,rightMargin:Dn,rules:null,scheme:null,scrolling:Bo,standby:null,summary:null,text:null,topMargin:Dn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Dn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yr,disableRemotePlayback:yr,prefix:null,property:null,results:Dn,security:null,unselectable:null},space:"html",transform:J1});var O7=ga({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:xs,accentHeight:Dn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Dn,amplitude:Dn,arabicForm:null,ascent:Dn,attributeName:null,attributeType:null,azimuth:Dn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Dn,by:null,calcMode:null,capHeight:Dn,className:so,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:Dn,diffuseConstant:Dn,direction:null,display:null,dur:null,divisor:Dn,dominantBaseline:null,download:yr,dx:null,dy:null,edgeMode:null,editable:null,elevation:Dn,enableBackground:null,end:null,event:null,exponent:Dn,externalResourcesRequired:null,fill:null,fillOpacity:Dn,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:Ku,g2:Ku,glyphName:Ku,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Dn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Dn,horizOriginX:Dn,horizOriginY:Dn,id:null,ideographic:Dn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Dn,k:Dn,k1:Dn,k2:Dn,k3:Dn,k4:Dn,kernelMatrix:xs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Dn,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:Dn,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:Dn,overlineThickness:Dn,paintOrder:null,panose1:null,path:null,pathLength:Dn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:so,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Dn,pointsAtY:Dn,pointsAtZ:Dn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xs,rev:xs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xs,requiredFeatures:xs,requiredFonts:xs,requiredFormats:xs,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:Dn,specularExponent:Dn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Dn,strikethroughThickness:Dn,string:null,stroke:null,strokeDashArray:xs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Dn,strokeOpacity:Dn,strokeWidth:null,style:null,surfaceScale:Dn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xs,tabIndex:Dn,tableValues:null,target:null,targetX:Dn,targetY:Dn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Dn,underlineThickness:Dn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Dn,values:null,vAlphabetic:Dn,vMathematical:Dn,vectorEffect:null,vHanging:Dn,vIdeographic:Dn,version:null,vertAdvY:Dn,vertOriginX:Dn,vertOriginY:Dn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Dn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Q1});var rI=ga({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(ot,st){return"xlink:"+st.slice(5).toLowerCase()}});var oI=ga({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:J1});var iI=ga({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(ot,st){return"xml:"+st.slice(3).toLowerCase()}});var sI={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 sde=/[A-Z]/g,L7=/-[a-z]/g,ade=/^data[-\w.:]+$/i;function aI(ot,st){let ct=Rb(st),gt=st,bt=ki;if(ct in ot.normal)return ot.property[ot.normal[ct]];if(ct.length>4&&ct.slice(0,4)==="data"&&ade.test(st)){if(st.charAt(4)==="-"){let yt=st.slice(5).replace(L7,cde);gt="data"+yt.charAt(0).toUpperCase()+yt.slice(1)}else{let yt=st.slice(4);if(!L7.test(yt)){let vt=yt.replace(sde,lde);if(vt.charAt(0)!=="-")vt="-"+vt;st="data"+vt}}bt=Dm}return new bt(gt,st)}function lde(ot){return"-"+ot.toLowerCase()}function cde(ot){return ot.charAt(1).toUpperCase()}var B7=eI([nI,_7,rI,oI,iI],"html"),X1=eI([nI,O7,rI,oI,iI],"svg");function F7(ot){return ot.join(" ").trim()}var t$=e(X7(),1);var Y1=Y7("end"),_m=Y7("start");function Y7(ot){return st;function st(ct){let gt=ct&&ct.position&&ct.position[ot]||{};if(typeof gt.line==="number"&&gt.line>0&&typeof gt.column==="number"&&gt.column>0)return{line:gt.line,column:gt.column,offset:typeof gt.offset==="number"&&gt.offset>-1?gt.offset:void 0}}}function uI(ot){let st=_m(ot),ct=Y1(ot);if(st&&ct)return{start:st,end:ct}}function qu(ot){if(!ot||typeof ot!=="object")return"";if("position"in ot||"type"in ot)return Z7(ot.position);if("start"in ot||"end"in ot)return Z7(ot);if("line"in ot||"column"in ot)return pI(ot);return""}function pI(ot){return e$(ot&&ot.line)+":"+e$(ot&&ot.column)}function Z7(ot){return pI(ot&&ot.start)+"-"+pI(ot&&ot.end)}function e$(ot){return ot&&typeof ot==="number"?ot:1}class ni extends Error{constructor(ot,st,ct){super();if(typeof st==="string")ct=st,st=void 0;let gt="",bt={},yt=!1;if(st)if("line"in st&&"column"in st)bt={place:st};else if("start"in st&&"end"in st)bt={place:st};else if("type"in st)bt={ancestors:[st],place:st.position};else bt={...st};if(typeof ot==="string")gt=ot;else if(!bt.cause&&ot)yt=!0,gt=ot.message,bt.cause=ot;if(!bt.ruleId&&!bt.source&&typeof ct==="string"){let xt=ct.indexOf(":");if(xt===-1)bt.ruleId=ct;else bt.source=ct.slice(0,xt),bt.ruleId=ct.slice(xt+1)}if(!bt.place&&bt.ancestors&&bt.ancestors){let xt=bt.ancestors[bt.ancestors.length-1];if(xt)bt.place=xt.position}let vt=bt.place&&"start"in bt.place?bt.place.start:bt.place;this.ancestors=bt.ancestors||void 0,this.cause=bt.cause||void 0,this.column=vt?vt.column:void 0,this.fatal=void 0,this.file="",this.message=gt,this.line=vt?vt.line:void 0,this.name=qu(bt.place)||"1:1",this.place=bt.place||void 0,this.reason=this.message,this.ruleId=bt.ruleId||void 0,this.source=bt.source||void 0,this.stack=yt&&bt.cause&&typeof bt.cause.stack==="string"?bt.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ni.prototype.file="";ni.prototype.name="";ni.prototype.reason="";ni.prototype.message="";ni.prototype.stack="";ni.prototype.column=void 0;ni.prototype.line=void 0;ni.prototype.ancestors=void 0;ni.prototype.cause=void 0;ni.prototype.fatal=void 0;ni.prototype.place=void 0;ni.prototype.ruleId=void 0;ni.prototype.source=void 0;var dI={}.hasOwnProperty,Ode=new Map,Lde=/[A-Z]/g,Bde=new Set(["table","tbody","thead","tfoot","tr"]),Fde=new Set(["td","th"]),n$="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fI(ot,st){if(!st||st.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let ct=st.filePath||void 0,gt;if(st.development){if(typeof st.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");gt=Gde(ct,st.jsxDEV)}else{if(typeof st.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof st.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");gt=Vde(ct,st.jsx,st.jsxs)}let bt={Fragment:st.Fragment,ancestors:[],components:st.components||{},create:gt,elementAttributeNameCase:st.elementAttributeNameCase||"react",evaluater:st.createEvaluater?st.createEvaluater():void 0,filePath:ct,ignoreInvalidStyle:st.ignoreInvalidStyle||!1,passKeys:st.passKeys!==!1,passNode:st.passNode||!1,schema:st.space==="svg"?X1:B7,stylePropertyNameCase:st.stylePropertyNameCase||"dom",tableCellAlignToStyle:st.tableCellAlignToStyle!==!1},yt=r$(bt,ot,void 0);if(yt&&typeof yt!=="string")return yt;return bt.create(ot,bt.Fragment,{children:yt||void 0},void 0)}function r$(ot,st,ct){if(st.type==="element")return Hde(ot,st,ct);if(st.type==="mdxFlowExpression"||st.type==="mdxTextExpression")return zde(ot,st);if(st.type==="mdxJsxFlowElement"||st.type==="mdxJsxTextElement")return Wde(ot,st,ct);if(st.type==="mdxjsEsm")return $de(ot,st);if(st.type==="root")return Ude(ot,st,ct);if(st.type==="text")return jde(ot,st)}function Hde(ot,st,ct){let gt=ot.schema,bt=gt;if(st.tagName.toLowerCase()==="svg"&&gt.space==="html")bt=X1,ot.schema=bt;ot.ancestors.push(st);let yt=i$(ot,st.tagName,!1),vt=Kde(ot,st),xt=gI(ot,st);if(Bde.has(st.tagName))xt=xt.filter(function(wt){return typeof wt==="string"?!ZP(wt):!0});return o$(ot,vt,yt,st),mI(vt,xt),ot.ancestors.pop(),ot.schema=gt,ot.create(st,yt,vt,ct)}function zde(ot,st){if(st.data&&st.data.estree&&ot.evaluater){let gt=st.data.estree.body[0];return to(gt.type==="ExpressionStatement"),ot.evaluater.evaluateExpression(gt.expression)}Ib(ot,st.position)}function $de(ot,st){if(st.data&&st.data.estree&&ot.evaluater)return ot.evaluater.evaluateProgram(st.data.estree);Ib(ot,st.position)}function Wde(ot,st,ct){let gt=ot.schema,bt=gt;if(st.name==="svg"&&gt.space==="html")bt=X1,ot.schema=bt;ot.ancestors.push(st);let yt=st.name===null?ot.Fragment:i$(ot,st.name,!0),vt=qde(ot,st),xt=gI(ot,st);return o$(ot,vt,yt,st),mI(vt,xt),ot.ancestors.pop(),ot.schema=gt,ot.create(st,yt,vt,ct)}function Ude(ot,st,ct){let gt={};return mI(gt,gI(ot,st)),ot.create(st,ot.Fragment,gt,ct)}function jde(ot,st){return st.value}function o$(ot,st,ct,gt){if(typeof ct!=="string"&&ct!==ot.Fragment&&ot.passNode)st.node=gt}function mI(ot,st){if(st.length>0){let ct=st.length>1?st:st[0];if(ct)ot.children=ct}}function Vde(ot,st,ct){return gt;function gt(bt,yt,vt,xt){let Ct=Array.isArray(vt.children)?ct:st;return xt?Ct(yt,vt,xt):Ct(yt,vt)}}function Gde(ot,st){return ct;function ct(gt,bt,yt,vt){let xt=Array.isArray(yt.children),wt=_m(gt);return st(bt,yt,vt,xt,{columnNumber:wt?wt.column-1:void 0,fileName:ot,lineNumber:wt?wt.line:void 0},void 0)}}function Kde(ot,st){let ct={},gt,bt;for(bt in st.properties)if(bt!=="children"&&dI.call(st.properties,bt)){let yt=Qde(ot,bt,st.properties[bt]);if(yt){let[vt,xt]=yt;if(ot.tableCellAlignToStyle&&vt==="align"&&typeof xt==="string"&&Fde.has(st.tagName))gt=xt;else ct[vt]=xt}}if(gt){let yt=ct.style||(ct.style={});yt[ot.stylePropertyNameCase==="css"?"text-align":"textAlign"]=gt}return ct}function qde(ot,st){let ct={};for(let gt of st.attributes)if(gt.type==="mdxJsxExpressionAttribute")if(gt.data&&gt.data.estree&&ot.evaluater){let yt=gt.data.estree.body[0];to(yt.type==="ExpressionStatement");let vt=yt.expression;to(vt.type==="ObjectExpression");let xt=vt.properties[0];to(xt.type==="SpreadElement"),Object.assign(ct,ot.evaluater.evaluateExpression(xt.argument))}else Ib(ot,st.position);else{let bt=gt.name,yt;if(gt.value&&typeof gt.value==="object")if(gt.value.data&&gt.value.data.estree&&ot.evaluater){let xt=gt.value.data.estree.body[0];to(xt.type==="ExpressionStatement"),yt=ot.evaluater.evaluateExpression(xt.expression)}else Ib(ot,st.position);else yt=gt.value===null?!0:gt.value;ct[bt]=yt}return ct}function gI(ot,st){let ct=[],gt=-1,bt=ot.passKeys?new Map:Ode;while(++gt<st.children.length){let yt=st.children[gt],vt;if(ot.passKeys){let wt=yt.type==="element"?yt.tagName:yt.type==="mdxJsxFlowElement"||yt.type==="mdxJsxTextElement"?yt.name:void 0;if(wt){let Ct=bt.get(wt)||0;vt=wt+"-"+Ct,bt.set(wt,Ct+1)}}let xt=r$(ot,yt,vt);if(xt!==void 0)ct.push(xt)}return ct}function Qde(ot,st,ct){let gt=aI(ot.schema,st);if(ct===null||ct===void 0||typeof ct==="number"&&Number.isNaN(ct))return;if(Array.isArray(ct))ct=gt.commaSeparated?A7(ct):F7(ct);if(gt.property==="style"){let bt=typeof ct==="object"?ct:Jde(ot,String(ct));if(ot.stylePropertyNameCase==="css")bt=Xde(bt);return["style",bt]}return[ot.elementAttributeNameCase==="react"&&gt.space?sI[gt.property]||gt.property:gt.attribute,ct]}function Jde(ot,st){try{return t$.default(st,{reactCompat:!0})}catch(ct){if(ot.ignoreInvalidStyle)return{};let gt=ct,bt=new ni("Cannot parse `style` attribute",{ancestors:ot.ancestors,cause:gt,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw bt.file=ot.filePath||void 0,bt.url=n$+"#cannot-parse-style-attribute",bt}}function i$(ot,st,ct){let gt;if(!ct)gt={type:"Literal",value:st};else if(st.includes(".")){let bt=st.split("."),yt=-1,vt;while(++yt<bt.length){let xt=K1(bt[yt])?{type:"Identifier",name:bt[yt]}:{type:"Literal",value:bt[yt]};vt=vt?{type:"MemberExpression",object:vt,property:xt,computed:Boolean(yt&&xt.type==="Literal"),optional:!1}:xt}to(vt,"always a result"),gt=vt}else gt=K1(st)&&!/^[a-z]/.test(st)?{type:"Identifier",name:st}:{type:"Literal",value:st};if(gt.type==="Literal"){let bt=gt.value;return dI.call(ot.components,bt)?ot.components[bt]:bt}if(ot.evaluater)return ot.evaluater.evaluateExpression(gt);Ib(ot)}function Ib(ot,st){let ct=new ni("Cannot handle MDX estrees without `createEvaluater`",{ancestors:ot.ancestors,place:st,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw ct.file=ot.filePath||void 0,ct.url=n$+"#cannot-handle-mdx-estrees-without-createevaluater",ct}function Xde(ot){let st={},ct;for(ct in ot)if(dI.call(ot,ct))st[Yde(ct)]=ot[ct];return st}function Yde(ot){let st=ot.replace(Lde,Zde);if(st.slice(0,3)==="ms-")st="-"+st;return st}function Zde(ot){return"-"+ot.toLowerCase()}var Mb={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 Wm=e(r(),1),PW=e(t(),1);var efe={};function vd(ot,st){let ct=st||efe,gt=typeof ct.includeImageAlt==="boolean"?ct.includeImageAlt:!0,bt=typeof ct.includeHtml==="boolean"?ct.includeHtml:!0;return a$(ot,gt,bt)}function a$(ot,st,ct){if(tfe(ot)){if("value"in ot)return ot.type==="html"&&!ct?"":ot.value;if(st&&"alt"in ot&&ot.alt)return ot.alt;if("children"in ot)return s$(ot.children,st,ct)}if(Array.isArray(ot))return s$(ot,st,ct);return""}function s$(ot,st,ct){let gt=[],bt=-1;while(++bt<ot.length)gt[bt]=a$(ot[bt],st,ct);return gt.join("")}function tfe(ot){return Boolean(ot&&typeof ot==="object")}var l$=document.createElement("i");function Om(ot){let st="&"+ot+";";l$.innerHTML=st;let ct=l$.textContent;if(ct.charCodeAt(ct.length-1)===59&&ot!=="semi")return!1;return ct===st?!1:ct}function Ko(ot,st,ct,gt){let bt=ot.length,yt=0,vt;if(st<0)st=-st>bt?0:bt+st;else st=st>bt?bt:st;if(ct=ct>0?ct:0,gt.length<1e4)vt=Array.from(gt),vt.unshift(st,ct),ot.splice(...vt);else{if(ct)ot.splice(st,ct);while(yt<gt.length)vt=gt.slice(yt,yt+1e4),vt.unshift(st,0),ot.splice(...vt),yt+=1e4,st+=1e4}}function Yi(ot,st){if(ot.length>0)return Ko(ot,ot.length,0,st),ot;return st}var c$={}.hasOwnProperty;function Z1(ot){let st={},ct=-1;while(++ct<ot.length)nfe(st,ot[ct]);return st}function nfe(ot,st){let ct;for(ct in st){let bt=(c$.call(ot,ct)?ot[ct]:void 0)||(ot[ct]={}),yt=st[ct],vt;if(yt)for(vt in yt){if(!c$.call(bt,vt))bt[vt]=[];let xt=yt[vt];rfe(bt[vt],Array.isArray(xt)?xt:xt?[xt]:[])}}}function rfe(ot,st){let ct=-1,gt=[];while(++ct<st.length)(st[ct].add==="after"?ot:gt).push(st[ct]);Ko(ot,0,0,gt)}function eC(ot,st){let ct=Number.parseInt(ot,st);if(ct<9||ct===11||ct>13&&ct<32||ct>126&&ct<160||ct>55295&&ct<57344||ct>64975&&ct<65008||(ct&65535)===65535||(ct&65535)===65534||ct>1114111)return"�";return String.fromCodePoint(ct)}function zi(ot){return ot.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var ai=Qu(/[A-Za-z]/),Fo=Qu(/[\dA-Za-z]/),u$=Qu(/[#-'*+\--9=?A-Z^-~]/);function xd(ot){return ot!==null&&(ot<32||ot===127)}var Ab=Qu(/\d/),p$=Qu(/[\dA-Fa-f]/),d$=Qu(/[!-/:-@[-`{-~]/);function jn(ot){return ot!==null&&ot<-2}function Or(ot){return ot!==null&&(ot<0||ot===32)}function ir(ot){return ot===-2||ot===-1||ot===32}var wd=Qu(/\p{P}|\p{S}/u),Dl=Qu(/\s/);function Qu(ot){return st;function st(ct){return ct!==null&&ct>-1&&ot.test(String.fromCharCode(ct))}}function ha(ot){let st=[],ct=-1,gt=0,bt=0;while(++ct<ot.length){let yt=ot.charCodeAt(ct),vt="";if(yt===37&&Fo(ot.charCodeAt(ct+1))&&Fo(ot.charCodeAt(ct+2)))bt=2;else if(yt<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(yt)))vt=String.fromCharCode(yt)}else if(yt>55295&&yt<57344){let xt=ot.charCodeAt(ct+1);if(yt<56320&&xt>56319&&xt<57344)vt=String.fromCharCode(yt,xt),bt=1;else vt="�"}else vt=String.fromCharCode(yt);if(vt)st.push(ot.slice(gt,ct),encodeURIComponent(vt)),gt=ct+bt+1,vt="";if(bt)ct+=bt,bt=0}return st.join("")+ot.slice(gt)}function nr(ot,st,ct,gt){let bt=gt?gt-1:Number.POSITIVE_INFINITY,yt=0;return vt;function vt(wt){if(ir(wt))return ot.enter(ct),xt(wt);return st(wt)}function xt(wt){if(ir(wt)&&yt++<bt)return ot.consume(wt),xt;return ot.exit(ct),st(wt)}}var f$={tokenize:ofe};function ofe(ot){let st=ot.attempt(this.parser.constructs.contentInitial,gt,bt),ct;return st;function gt(xt){if(xt===null){ot.consume(xt);return}return ot.enter("lineEnding"),ot.consume(xt),ot.exit("lineEnding"),nr(ot,st,"linePrefix")}function bt(xt){return ot.enter("paragraph"),yt(xt)}function yt(xt){let wt=ot.enter("chunkText",{contentType:"text",previous:ct});if(ct)ct.next=wt;return ct=wt,vt(xt)}function vt(xt){if(xt===null){ot.exit("chunkText"),ot.exit("paragraph"),ot.consume(xt);return}if(jn(xt))return ot.consume(xt),ot.exit("chunkText"),yt;return ot.consume(xt),vt}}var g$={tokenize:ife},m$={tokenize:sfe};function ife(ot){let st=this,ct=[],gt=0,bt,yt,vt;return xt;function xt(Nt){if(gt<ct.length){let Ot=ct[gt];return st.containerState=Ot[1],ot.attempt(Ot[0].continuation,wt,Ct)(Nt)}return Ct(Nt)}function wt(Nt){if(gt++,st.containerState._closeFlow){if(st.containerState._closeFlow=void 0,bt)At();let Ot=st.events.length,Dt=Ot,_t;while(Dt--)if(st.events[Dt][0]==="exit"&&st.events[Dt][1].type==="chunkFlow"){_t=st.events[Dt][1].end;break}It(gt);let $t=Ot;while($t<st.events.length)st.events[$t][1].end={..._t},$t++;return Ko(st.events,Dt+1,0,st.events.slice(Ot)),st.events.length=$t,Ct(Nt)}return xt(Nt)}function Ct(Nt){if(gt===ct.length){if(!bt)return kt(Nt);if(bt.currentConstruct&&bt.currentConstruct.concrete)return Tt(Nt);st.interrupt=Boolean(bt.currentConstruct&&!bt._gfmTableDynamicInterruptHack)}return st.containerState={},ot.check(m$,St,Et)(Nt)}function St(Nt){if(bt)At();return It(gt),kt(Nt)}function Et(Nt){return st.parser.lazy[st.now().line]=gt!==ct.length,vt=st.now().offset,Tt(Nt)}function kt(Nt){return st.containerState={},ot.attempt(m$,Rt,Tt)(Nt)}function Rt(Nt){return gt++,ct.push([st.currentConstruct,st.containerState]),kt(Nt)}function Tt(Nt){if(Nt===null){if(bt)At();It(0),ot.consume(Nt);return}return bt=bt||st.parser.flow(st.now()),ot.enter("chunkFlow",{_tokenizer:bt,contentType:"flow",previous:yt}),Pt(Nt)}function Pt(Nt){if(Nt===null){Mt(ot.exit("chunkFlow"),!0),It(0),ot.consume(Nt);return}if(jn(Nt))return ot.consume(Nt),Mt(ot.exit("chunkFlow")),gt=0,st.interrupt=void 0,xt;return ot.consume(Nt),Pt}function Mt(Nt,Ot){let Dt=st.sliceStream(Nt);if(Ot)Dt.push(null);if(Nt.previous=yt,yt)yt.next=Nt;if(yt=Nt,bt.defineSkip(Nt.start),bt.write(Dt),st.parser.lazy[Nt.start.line]){let _t=bt.events.length;while(_t--)if(bt.events[_t][1].start.offset<vt&&(!bt.events[_t][1].end||bt.events[_t][1].end.offset>vt))return;let $t=st.events.length,Ft=$t,Bt,Lt;while(Ft--)if(st.events[Ft][0]==="exit"&&st.events[Ft][1].type==="chunkFlow"){if(Bt){Lt=st.events[Ft][1].end;break}Bt=!0}It(gt),_t=$t;while(_t<st.events.length)st.events[_t][1].end={...Lt},_t++;Ko(st.events,Ft+1,0,st.events.slice($t)),st.events.length=_t}}function It(Nt){let Ot=ct.length;while(Ot-- >Nt){let Dt=ct[Ot];st.containerState=Dt[1],Dt[0].exit.call(st,ot)}ct.length=Nt}function At(){bt.write([null]),yt=void 0,bt=void 0,st.containerState._closeFlow=void 0}}function sfe(ot,st,ct){return nr(ot,ot.attempt(this.parser.constructs.document,st,ct),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bc(ot){if(ot===null||Or(ot)||Dl(ot))return 1;if(wd(ot))return 2}function Ju(ot,st,ct){let gt=[],bt=-1;while(++bt<ot.length){let yt=ot[bt].resolveAll;if(yt&&!gt.includes(yt))st=yt(st,ct),gt.push(yt)}return st}var Nb={name:"attention",resolveAll:afe,tokenize:lfe};function afe(ot,st){let ct=-1,gt,bt,yt,vt,xt,wt,Ct,St;while(++ct<ot.length)if(ot[ct][0]==="enter"&&ot[ct][1].type==="attentionSequence"&&ot[ct][1]._close){gt=ct;while(gt--)if(ot[gt][0]==="exit"&&ot[gt][1].type==="attentionSequence"&&ot[gt][1]._open&&st.sliceSerialize(ot[gt][1]).charCodeAt(0)===st.sliceSerialize(ot[ct][1]).charCodeAt(0)){if((ot[gt][1]._close||ot[ct][1]._open)&&(ot[ct][1].end.offset-ot[ct][1].start.offset)%3&&!((ot[gt][1].end.offset-ot[gt][1].start.offset+ot[ct][1].end.offset-ot[ct][1].start.offset)%3))continue;wt=ot[gt][1].end.offset-ot[gt][1].start.offset>1&&ot[ct][1].end.offset-ot[ct][1].start.offset>1?2:1;let Et={...ot[gt][1].end},kt={...ot[ct][1].start};if(h$(Et,-wt),h$(kt,wt),vt={type:wt>1?"strongSequence":"emphasisSequence",start:Et,end:{...ot[gt][1].end}},xt={type:wt>1?"strongSequence":"emphasisSequence",start:{...ot[ct][1].start},end:kt},yt={type:wt>1?"strongText":"emphasisText",start:{...ot[gt][1].end},end:{...ot[ct][1].start}},bt={type:wt>1?"strong":"emphasis",start:{...vt.start},end:{...xt.end}},ot[gt][1].end={...vt.start},ot[ct][1].start={...xt.end},Ct=[],ot[gt][1].end.offset-ot[gt][1].start.offset)Ct=Yi(Ct,[["enter",ot[gt][1],st],["exit",ot[gt][1],st]]);if(Ct=Yi(Ct,[["enter",bt,st],["enter",vt,st],["exit",vt,st],["enter",yt,st]]),Ct=Yi(Ct,Ju(st.parser.constructs.insideSpan.null,ot.slice(gt+1,ct),st)),Ct=Yi(Ct,[["exit",yt,st],["enter",xt,st],["exit",xt,st],["exit",bt,st]]),ot[ct][1].end.offset-ot[ct][1].start.offset)St=2,Ct=Yi(Ct,[["enter",ot[ct][1],st],["exit",ot[ct][1],st]]);else St=0;Ko(ot,gt-1,ct-gt+3,Ct),ct=gt+Ct.length-St-2;break}}ct=-1;while(++ct<ot.length)if(ot[ct][1].type==="attentionSequence")ot[ct][1].type="data";return ot}function lfe(ot,st){let ct=this.parser.constructs.attentionMarkers.null,gt=this.previous,bt=bc(gt),yt;return vt;function vt(wt){return yt=wt,ot.enter("attentionSequence"),xt(wt)}function xt(wt){if(wt===yt)return ot.consume(wt),xt;let Ct=ot.exit("attentionSequence"),St=bc(wt),Et=!St||St===2&&bt||ct.includes(wt),kt=!bt||bt===2&&St||ct.includes(gt);return Ct._open=Boolean(yt===42?Et:Et&&(bt||!kt)),Ct._close=Boolean(yt===42?kt:kt&&(St||!Et)),st(wt)}}function h$(ot,st){ot.column+=st,ot.offset+=st,ot._bufferIndex+=st}var hI={name:"autolink",tokenize:cfe};function cfe(ot,st,ct){let gt=0;return bt;function bt(Rt){return ot.enter("autolink"),ot.enter("autolinkMarker"),ot.consume(Rt),ot.exit("autolinkMarker"),ot.enter("autolinkProtocol"),yt}function yt(Rt){if(ai(Rt))return ot.consume(Rt),vt;if(Rt===64)return ct(Rt);return Ct(Rt)}function vt(Rt){if(Rt===43||Rt===45||Rt===46||Fo(Rt))return gt=1,xt(Rt);return Ct(Rt)}function xt(Rt){if(Rt===58)return ot.consume(Rt),gt=0,wt;if((Rt===43||Rt===45||Rt===46||Fo(Rt))&&gt++<32)return ot.consume(Rt),xt;return gt=0,Ct(Rt)}function wt(Rt){if(Rt===62)return ot.exit("autolinkProtocol"),ot.enter("autolinkMarker"),ot.consume(Rt),ot.exit("autolinkMarker"),ot.exit("autolink"),st;if(Rt===null||Rt===32||Rt===60||xd(Rt))return ct(Rt);return ot.consume(Rt),wt}function Ct(Rt){if(Rt===64)return ot.consume(Rt),St;if(u$(Rt))return ot.consume(Rt),Ct;return ct(Rt)}function St(Rt){return Fo(Rt)?Et(Rt):ct(Rt)}function Et(Rt){if(Rt===46)return ot.consume(Rt),gt=0,St;if(Rt===62)return ot.exit("autolinkProtocol").type="autolinkEmail",ot.enter("autolinkMarker"),ot.consume(Rt),ot.exit("autolinkMarker"),ot.exit("autolink"),st;return kt(Rt)}function kt(Rt){if((Rt===45||Fo(Rt))&&gt++<63){let Tt=Rt===45?kt:Et;return ot.consume(Rt),Tt}return ct(Rt)}}var _l={partial:!0,tokenize:ufe};function ufe(ot,st,ct){return gt;function gt(yt){return ir(yt)?nr(ot,bt,"linePrefix")(yt):bt(yt)}function bt(yt){return yt===null||jn(yt)?st(yt):ct(yt)}}var tC={continuation:{tokenize:dfe},exit:ffe,name:"blockQuote",tokenize:pfe};function pfe(ot,st,ct){let gt=this;return bt;function bt(vt){if(vt===62){let xt=gt.containerState;if(!xt.open)ot.enter("blockQuote",{_container:!0}),xt.open=!0;return ot.enter("blockQuotePrefix"),ot.enter("blockQuoteMarker"),ot.consume(vt),ot.exit("blockQuoteMarker"),yt}return ct(vt)}function yt(vt){if(ir(vt))return ot.enter("blockQuotePrefixWhitespace"),ot.consume(vt),ot.exit("blockQuotePrefixWhitespace"),ot.exit("blockQuotePrefix"),st;return ot.exit("blockQuotePrefix"),st(vt)}}function dfe(ot,st,ct){let gt=this;return bt;function bt(vt){if(ir(vt))return nr(ot,yt,"linePrefix",gt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(vt);return yt(vt)}function yt(vt){return ot.attempt(tC,st,ct)(vt)}}function ffe(ot){ot.exit("blockQuote")}var nC={name:"characterEscape",tokenize:mfe};function mfe(ot,st,ct){return gt;function gt(yt){return ot.enter("characterEscape"),ot.enter("escapeMarker"),ot.consume(yt),ot.exit("escapeMarker"),bt}function bt(yt){if(d$(yt))return ot.enter("characterEscapeValue"),ot.consume(yt),ot.exit("characterEscapeValue"),ot.exit("characterEscape"),st;return ct(yt)}}var rC={name:"characterReference",tokenize:gfe};function gfe(ot,st,ct){let gt=this,bt=0,yt,vt;return xt;function xt(Et){return ot.enter("characterReference"),ot.enter("characterReferenceMarker"),ot.consume(Et),ot.exit("characterReferenceMarker"),wt}function wt(Et){if(Et===35)return ot.enter("characterReferenceMarkerNumeric"),ot.consume(Et),ot.exit("characterReferenceMarkerNumeric"),Ct;return ot.enter("characterReferenceValue"),yt=31,vt=Fo,St(Et)}function Ct(Et){if(Et===88||Et===120)return ot.enter("characterReferenceMarkerHexadecimal"),ot.consume(Et),ot.exit("characterReferenceMarkerHexadecimal"),ot.enter("characterReferenceValue"),yt=6,vt=p$,St;return ot.enter("characterReferenceValue"),yt=7,vt=Ab,St(Et)}function St(Et){if(Et===59&&bt){let kt=ot.exit("characterReferenceValue");if(vt===Fo&&!Om(gt.sliceSerialize(kt)))return ct(Et);return ot.enter("characterReferenceMarker"),ot.consume(Et),ot.exit("characterReferenceMarker"),ot.exit("characterReference"),st}if(vt(Et)&&bt++<yt)return ot.consume(Et),St;return ct(Et)}}var b$={partial:!0,tokenize:bfe},oC={concrete:!0,name:"codeFenced",tokenize:hfe};function hfe(ot,st,ct){let gt=this,bt={partial:!0,tokenize:Dt},yt=0,vt=0,xt;return wt;function wt(_t){return Ct(_t)}function Ct(_t){let $t=gt.events[gt.events.length-1];return yt=$t&&$t[1].type==="linePrefix"?$t[2].sliceSerialize($t[1],!0).length:0,xt=_t,ot.enter("codeFenced"),ot.enter("codeFencedFence"),ot.enter("codeFencedFenceSequence"),St(_t)}function St(_t){if(_t===xt)return vt++,ot.consume(_t),St;if(vt<3)return ct(_t);return ot.exit("codeFencedFenceSequence"),ir(_t)?nr(ot,Et,"whitespace")(_t):Et(_t)}function Et(_t){if(_t===null||jn(_t))return ot.exit("codeFencedFence"),gt.interrupt?st(_t):ot.check(b$,Pt,Ot)(_t);return ot.enter("codeFencedFenceInfo"),ot.enter("chunkString",{contentType:"string"}),kt(_t)}function kt(_t){if(_t===null||jn(_t))return ot.exit("chunkString"),ot.exit("codeFencedFenceInfo"),Et(_t);if(ir(_t))return ot.exit("chunkString"),ot.exit("codeFencedFenceInfo"),nr(ot,Rt,"whitespace")(_t);if(_t===96&&_t===xt)return ct(_t);return ot.consume(_t),kt}function Rt(_t){if(_t===null||jn(_t))return Et(_t);return ot.enter("codeFencedFenceMeta"),ot.enter("chunkString",{contentType:"string"}),Tt(_t)}function Tt(_t){if(_t===null||jn(_t))return ot.exit("chunkString"),ot.exit("codeFencedFenceMeta"),Et(_t);if(_t===96&&_t===xt)return ct(_t);return ot.consume(_t),Tt}function Pt(_t){return ot.attempt(bt,Ot,Mt)(_t)}function Mt(_t){return ot.enter("lineEnding"),ot.consume(_t),ot.exit("lineEnding"),It}function It(_t){return yt>0&&ir(_t)?nr(ot,At,"linePrefix",yt+1)(_t):At(_t)}function At(_t){if(_t===null||jn(_t))return ot.check(b$,Pt,Ot)(_t);return ot.enter("codeFlowValue"),Nt(_t)}function Nt(_t){if(_t===null||jn(_t))return ot.exit("codeFlowValue"),At(_t);return ot.consume(_t),Nt}function Ot(_t){return ot.exit("codeFenced"),st(_t)}function Dt(_t,$t,Ft){let Bt=0;return Lt;function Lt(Gt){return _t.enter("lineEnding"),_t.consume(Gt),_t.exit("lineEnding"),Vt}function Vt(Gt){return _t.enter("codeFencedFence"),ir(Gt)?nr(_t,Wt,"linePrefix",gt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Gt):Wt(Gt)}function Wt(Gt){if(Gt===xt)return _t.enter("codeFencedFenceSequence"),Ut(Gt);return Ft(Gt)}function Ut(Gt){if(Gt===xt)return Bt++,_t.consume(Gt),Ut;if(Bt>=vt)return _t.exit("codeFencedFenceSequence"),ir(Gt)?nr(_t,Ht,"whitespace")(Gt):Ht(Gt);return Ft(Gt)}function Ht(Gt){if(Gt===null||jn(Gt))return _t.exit("codeFencedFence"),$t(Gt);return Ft(Gt)}}}function bfe(ot,st,ct){let gt=this;return bt;function bt(vt){if(vt===null)return ct(vt);return ot.enter("lineEnding"),ot.consume(vt),ot.exit("lineEnding"),yt}function yt(vt){return gt.parser.lazy[gt.now().line]?ct(vt):st(vt)}}var Db={name:"codeIndented",tokenize:vfe},yfe={partial:!0,tokenize:xfe};function vfe(ot,st,ct){let gt=this;return bt;function bt(Ct){return ot.enter("codeIndented"),nr(ot,yt,"linePrefix",5)(Ct)}function yt(Ct){let St=gt.events[gt.events.length-1];return St&&St[1].type==="linePrefix"&&St[2].sliceSerialize(St[1],!0).length>=4?vt(Ct):ct(Ct)}function vt(Ct){if(Ct===null)return wt(Ct);if(jn(Ct))return ot.attempt(yfe,vt,wt)(Ct);return ot.enter("codeFlowValue"),xt(Ct)}function xt(Ct){if(Ct===null||jn(Ct))return ot.exit("codeFlowValue"),vt(Ct);return ot.consume(Ct),xt}function wt(Ct){return ot.exit("codeIndented"),st(Ct)}}function xfe(ot,st,ct){let gt=this;return bt;function bt(vt){if(gt.parser.lazy[gt.now().line])return ct(vt);if(jn(vt))return ot.enter("lineEnding"),ot.consume(vt),ot.exit("lineEnding"),bt;return nr(ot,yt,"linePrefix",5)(vt)}function yt(vt){let xt=gt.events[gt.events.length-1];return xt&&xt[1].type==="linePrefix"&&xt[2].sliceSerialize(xt[1],!0).length>=4?st(vt):jn(vt)?bt(vt):ct(vt)}}var bI={name:"codeText",previous:Cfe,resolve:wfe,tokenize:Sfe};function wfe(ot){let st=ot.length-4,ct=3,gt,bt;if((ot[ct][1].type==="lineEnding"||ot[ct][1].type==="space")&&(ot[st][1].type==="lineEnding"||ot[st][1].type==="space")){gt=ct;while(++gt<st)if(ot[gt][1].type==="codeTextData"){ot[ct][1].type="codeTextPadding",ot[st][1].type="codeTextPadding",ct+=2,st-=2;break}}gt=ct-1,st++;while(++gt<=st)if(bt===void 0){if(gt!==st&&ot[gt][1].type!=="lineEnding")bt=gt}else if(gt===st||ot[gt][1].type==="lineEnding"){if(ot[bt][1].type="codeTextData",gt!==bt+2)ot[bt][1].end=ot[gt-1][1].end,ot.splice(bt+2,gt-bt-2),st-=gt-bt-2,gt=bt+2;bt=void 0}return ot}function Cfe(ot){return ot!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Sfe(ot,st,ct){let gt=this,bt=0,yt,vt;return xt;function xt(kt){return ot.enter("codeText"),ot.enter("codeTextSequence"),wt(kt)}function wt(kt){if(kt===96)return ot.consume(kt),bt++,wt;return ot.exit("codeTextSequence"),Ct(kt)}function Ct(kt){if(kt===null)return ct(kt);if(kt===32)return ot.enter("space"),ot.consume(kt),ot.exit("space"),Ct;if(kt===96)return vt=ot.enter("codeTextSequence"),yt=0,Et(kt);if(jn(kt))return ot.enter("lineEnding"),ot.consume(kt),ot.exit("lineEnding"),Ct;return ot.enter("codeTextData"),St(kt)}function St(kt){if(kt===null||kt===32||kt===96||jn(kt))return ot.exit("codeTextData"),Ct(kt);return ot.consume(kt),St}function Et(kt){if(kt===96)return ot.consume(kt),yt++,Et;if(yt===bt)return ot.exit("codeTextSequence"),ot.exit("codeText"),st(kt);return vt.type="codeTextData",St(kt)}}class yI{constructor(ot){this.left=ot?[...ot]:[],this.right=[]}get(ot){if(ot<0||ot>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+ot+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(ot<this.left.length)return this.left[ot];return this.right[this.right.length-ot+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(ot,st){let ct=st===null||st===void 0?Number.POSITIVE_INFINITY:st;if(ct<this.left.length)return this.left.slice(ot,ct);if(ot>this.left.length)return this.right.slice(this.right.length-ct+this.left.length,this.right.length-ot+this.left.length).reverse();return this.left.slice(ot).concat(this.right.slice(this.right.length-ct+this.left.length).reverse())}splice(ot,st,ct){let gt=st||0;this.setCursor(Math.trunc(ot));let bt=this.right.splice(this.right.length-gt,Number.POSITIVE_INFINITY);if(ct)_b(this.left,ct);return bt.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(ot){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(ot)}pushMany(ot){this.setCursor(Number.POSITIVE_INFINITY),_b(this.left,ot)}unshift(ot){this.setCursor(0),this.right.push(ot)}unshiftMany(ot){this.setCursor(0),_b(this.right,ot.reverse())}setCursor(ot){if(ot===this.left.length||ot>this.left.length&&this.right.length===0||ot<0&&this.left.length===0)return;if(ot<this.left.length){let st=this.left.splice(ot,Number.POSITIVE_INFINITY);_b(this.right,st.reverse())}else{let st=this.right.splice(this.left.length+this.right.length-ot,Number.POSITIVE_INFINITY);_b(this.left,st.reverse())}}}function _b(ot,st){let ct=0;if(st.length<1e4)ot.push(...st);else while(ct<st.length)ot.push(...st.slice(ct,ct+1e4)),ct+=1e4}function iC(ot){let st={},ct=-1,gt,bt,yt,vt,xt,wt,Ct,St=new yI(ot);while(++ct<St.length){while(ct in st)ct=st[ct];if(gt=St.get(ct),ct&&gt[1].type==="chunkFlow"&&St.get(ct-1)[1].type==="listItemPrefix"){if(wt=gt[1]._tokenizer.events,yt=0,yt<wt.length&&wt[yt][1].type==="lineEndingBlank")yt+=2;if(yt<wt.length&&wt[yt][1].type==="content")while(++yt<wt.length){if(wt[yt][1].type==="content")break;if(wt[yt][1].type==="chunkText")wt[yt][1]._isInFirstContentOfListItem=!0,yt++}}if(gt[0]==="enter"){if(gt[1].contentType)Object.assign(st,Efe(St,ct)),ct=st[ct],Ct=!0}else if(gt[1]._container){yt=ct,bt=void 0;while(yt--)if(vt=St.get(yt),vt[1].type==="lineEnding"||vt[1].type==="lineEndingBlank"){if(vt[0]==="enter"){if(bt)St.get(bt)[1].type="lineEndingBlank";vt[1].type="lineEnding",bt=yt}}else if(vt[1].type==="linePrefix"||vt[1].type==="listItemIndent");else break;if(bt)gt[1].end={...St.get(bt)[1].start},xt=St.slice(bt,ct),xt.unshift(gt),St.splice(bt,ct-bt+1,xt)}}return Ko(ot,0,Number.POSITIVE_INFINITY,St.slice(0)),!Ct}function Efe(ot,st){let ct=ot.get(st)[1],gt=ot.get(st)[2],bt=st-1,yt=[],vt=ct._tokenizer;if(!vt){if(vt=gt.parser[ct.contentType](ct.start),ct._contentTypeTextTrailing)vt._contentTypeTextTrailing=!0}let xt=vt.events,wt=[],Ct={},St,Et,kt=-1,Rt=ct,Tt=0,Pt=0,Mt=[Pt];while(Rt){while(ot.get(++bt)[1]!==Rt);if(yt.push(bt),!Rt._tokenizer){if(St=gt.sliceStream(Rt),!Rt.next)St.push(null);if(Et)vt.defineSkip(Rt.start);if(Rt._isInFirstContentOfListItem)vt._gfmTasklistFirstContentOfListItem=!0;if(vt.write(St),Rt._isInFirstContentOfListItem)vt._gfmTasklistFirstContentOfListItem=void 0}Et=Rt,Rt=Rt.next}Rt=ct;while(++kt<xt.length)if(xt[kt][0]==="exit"&&xt[kt-1][0]==="enter"&&xt[kt][1].type===xt[kt-1][1].type&&xt[kt][1].start.line!==xt[kt][1].end.line)Pt=kt+1,Mt.push(Pt),Rt._tokenizer=void 0,Rt.previous=void 0,Rt=Rt.next;if(vt.events=[],Rt)Rt._tokenizer=void 0,Rt.previous=void 0;else Mt.pop();kt=Mt.length;while(kt--){let It=xt.slice(Mt[kt],Mt[kt+1]),At=yt.pop();wt.push([At,At+It.length-1]),ot.splice(At,2,It)}wt.reverse(),kt=-1;while(++kt<wt.length)Ct[Tt+wt[kt][0]]=Tt+wt[kt][1],Tt+=wt[kt][1]-wt[kt][0]-1;return Ct}var vI={resolve:Rfe,tokenize:Tfe},kfe={partial:!0,tokenize:Pfe};function Rfe(ot){return iC(ot),ot}function Tfe(ot,st){let ct;return gt;function gt(xt){return ot.enter("content"),ct=ot.enter("chunkContent",{contentType:"content"}),bt(xt)}function bt(xt){if(xt===null)return yt(xt);if(jn(xt))return ot.check(kfe,vt,yt)(xt);return ot.consume(xt),bt}function yt(xt){return ot.exit("chunkContent"),ot.exit("content"),st(xt)}function vt(xt){return ot.consume(xt),ot.exit("chunkContent"),ct.next=ot.enter("chunkContent",{contentType:"content",previous:ct}),ct=ct.next,bt}}function Pfe(ot,st,ct){let gt=this;return bt;function bt(vt){return ot.exit("chunkContent"),ot.enter("lineEnding"),ot.consume(vt),ot.exit("lineEnding"),nr(ot,yt,"linePrefix")}function yt(vt){if(vt===null||jn(vt))return ct(vt);let xt=gt.events[gt.events.length-1];if(!gt.parser.constructs.disable.null.includes("codeIndented")&&xt&&xt[1].type==="linePrefix"&&xt[2].sliceSerialize(xt[1],!0).length>=4)return st(vt);return ot.interrupt(gt.parser.constructs.flow,ct,st)(vt)}}function sC(ot,st,ct,gt,bt,yt,vt,xt,wt){let Ct=wt||Number.POSITIVE_INFINITY,St=0;return Et;function Et(It){if(It===60)return ot.enter(gt),ot.enter(bt),ot.enter(yt),ot.consume(It),ot.exit(yt),kt;if(It===null||It===32||It===41||xd(It))return ct(It);return ot.enter(gt),ot.enter(vt),ot.enter(xt),ot.enter("chunkString",{contentType:"string"}),Pt(It)}function kt(It){if(It===62)return ot.enter(yt),ot.consume(It),ot.exit(yt),ot.exit(bt),ot.exit(gt),st;return ot.enter(xt),ot.enter("chunkString",{contentType:"string"}),Rt(It)}function Rt(It){if(It===62)return ot.exit("chunkString"),ot.exit(xt),kt(It);if(It===null||It===60||jn(It))return ct(It);return ot.consume(It),It===92?Tt:Rt}function Tt(It){if(It===60||It===62||It===92)return ot.consume(It),Rt;return Rt(It)}function Pt(It){if(!St&&(It===null||It===41||Or(It)))return ot.exit("chunkString"),ot.exit(xt),ot.exit(vt),ot.exit(gt),st(It);if(St<Ct&&It===40)return ot.consume(It),St++,Pt;if(It===41)return ot.consume(It),St--,Pt;if(It===null||It===32||It===40||xd(It))return ct(It);return ot.consume(It),It===92?Mt:Pt}function Mt(It){if(It===40||It===41||It===92)return ot.consume(It),Pt;return Pt(It)}}function aC(ot,st,ct,gt,bt,yt){let vt=this,xt=0,wt;return Ct;function Ct(Rt){return ot.enter(gt),ot.enter(bt),ot.consume(Rt),ot.exit(bt),ot.enter(yt),St}function St(Rt){if(xt>999||Rt===null||Rt===91||Rt===93&&!wt||Rt===94&&!xt&&"_hiddenFootnoteSupport"in vt.parser.constructs)return ct(Rt);if(Rt===93)return ot.exit(yt),ot.enter(bt),ot.consume(Rt),ot.exit(bt),ot.exit(gt),st;if(jn(Rt))return ot.enter("lineEnding"),ot.consume(Rt),ot.exit("lineEnding"),St;return ot.enter("chunkString",{contentType:"string"}),Et(Rt)}function Et(Rt){if(Rt===null||Rt===91||Rt===93||jn(Rt)||xt++>999)return ot.exit("chunkString"),St(Rt);if(ot.consume(Rt),!wt)wt=!ir(Rt);return Rt===92?kt:Et}function kt(Rt){if(Rt===91||Rt===92||Rt===93)return ot.consume(Rt),xt++,Et;return Et(Rt)}}function lC(ot,st,ct,gt,bt,yt){let vt;return xt;function xt(kt){if(kt===34||kt===39||kt===40)return ot.enter(gt),ot.enter(bt),ot.consume(kt),ot.exit(bt),vt=kt===40?41:kt,wt;return ct(kt)}function wt(kt){if(kt===vt)return ot.enter(bt),ot.consume(kt),ot.exit(bt),ot.exit(gt),st;return ot.enter(yt),Ct(kt)}function Ct(kt){if(kt===vt)return ot.exit(yt),wt(vt);if(kt===null)return ct(kt);if(jn(kt))return ot.enter("lineEnding"),ot.consume(kt),ot.exit("lineEnding"),nr(ot,Ct,"linePrefix");return ot.enter("chunkString",{contentType:"string"}),St(kt)}function St(kt){if(kt===vt||kt===null||jn(kt))return ot.exit("chunkString"),Ct(kt);return ot.consume(kt),kt===92?Et:St}function Et(kt){if(kt===vt||kt===92)return ot.consume(kt),St;return St(kt)}}function Cd(ot,st){let ct;return gt;function gt(bt){if(jn(bt))return ot.enter("lineEnding"),ot.consume(bt),ot.exit("lineEnding"),ct=!0,gt;if(ir(bt))return nr(ot,gt,ct?"linePrefix":"lineSuffix")(bt);return st(bt)}}var xI={name:"definition",tokenize:Mfe},Ife={partial:!0,tokenize:Afe};function Mfe(ot,st,ct){let gt=this,bt;return yt;function yt(Rt){return ot.enter("definition"),vt(Rt)}function vt(Rt){return aC.call(gt,ot,xt,ct,"definitionLabel","definitionLabelMarker","definitionLabelString")(Rt)}function xt(Rt){if(bt=zi(gt.sliceSerialize(gt.events[gt.events.length-1][1]).slice(1,-1)),Rt===58)return ot.enter("definitionMarker"),ot.consume(Rt),ot.exit("definitionMarker"),wt;return ct(Rt)}function wt(Rt){return Or(Rt)?Cd(ot,Ct)(Rt):Ct(Rt)}function Ct(Rt){return sC(ot,St,ct,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(Rt)}function St(Rt){return ot.attempt(Ife,Et,Et)(Rt)}function Et(Rt){return ir(Rt)?nr(ot,kt,"whitespace")(Rt):kt(Rt)}function kt(Rt){if(Rt===null||jn(Rt))return ot.exit("definition"),gt.parser.defined.push(bt),st(Rt);return ct(Rt)}}function Afe(ot,st,ct){return gt;function gt(xt){return Or(xt)?Cd(ot,bt)(xt):ct(xt)}function bt(xt){return lC(ot,yt,ct,"definitionTitle","definitionTitleMarker","definitionTitleString")(xt)}function yt(xt){return ir(xt)?nr(ot,vt,"whitespace")(xt):vt(xt)}function vt(xt){return xt===null||jn(xt)?st(xt):ct(xt)}}var wI={name:"hardBreakEscape",tokenize:Nfe};function Nfe(ot,st,ct){return gt;function gt(yt){return ot.enter("hardBreakEscape"),ot.consume(yt),bt}function bt(yt){if(jn(yt))return ot.exit("hardBreakEscape"),st(yt);return ct(yt)}}var CI={name:"headingAtx",resolve:Dfe,tokenize:_fe};function Dfe(ot,st){let ct=ot.length-2,gt=3,bt,yt;if(ot[gt][1].type==="whitespace")gt+=2;if(ct-2>gt&&ot[ct][1].type==="whitespace")ct-=2;if(ot[ct][1].type==="atxHeadingSequence"&&(gt===ct-1||ct-4>gt&&ot[ct-2][1].type==="whitespace"))ct-=gt+1===ct?2:4;if(ct>gt)bt={type:"atxHeadingText",start:ot[gt][1].start,end:ot[ct][1].end},yt={type:"chunkText",start:ot[gt][1].start,end:ot[ct][1].end,contentType:"text"},Ko(ot,gt,ct-gt+1,[["enter",bt,st],["enter",yt,st],["exit",yt,st],["exit",bt,st]]);return ot}function _fe(ot,st,ct){let gt=0;return bt;function bt(St){return ot.enter("atxHeading"),yt(St)}function yt(St){return ot.enter("atxHeadingSequence"),vt(St)}function vt(St){if(St===35&&gt++<6)return ot.consume(St),vt;if(St===null||Or(St))return ot.exit("atxHeadingSequence"),xt(St);return ct(St)}function xt(St){if(St===35)return ot.enter("atxHeadingSequence"),wt(St);if(St===null||jn(St))return ot.exit("atxHeading"),st(St);if(ir(St))return nr(ot,xt,"whitespace")(St);return ot.enter("atxHeadingText"),Ct(St)}function wt(St){if(St===35)return ot.consume(St),wt;return ot.exit("atxHeadingSequence"),xt(St)}function Ct(St){if(St===null||St===35||Or(St))return ot.exit("atxHeadingText"),xt(St);return ot.consume(St),Ct}}var y$=["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"],SI=["pre","script","style","textarea"];var EI={concrete:!0,name:"htmlFlow",resolveTo:Bfe,tokenize:Ffe},Ofe={partial:!0,tokenize:zfe},Lfe={partial:!0,tokenize:Hfe};function Bfe(ot){let st=ot.length;while(st--)if(ot[st][0]==="enter"&&ot[st][1].type==="htmlFlow")break;if(st>1&&ot[st-2][1].type==="linePrefix")ot[st][1].start=ot[st-2][1].start,ot[st+1][1].start=ot[st-2][1].start,ot.splice(st-2,2);return ot}function Ffe(ot,st,ct){let gt=this,bt,yt,vt,xt,wt;return Ct;function Ct(Kt){return St(Kt)}function St(Kt){return ot.enter("htmlFlow"),ot.enter("htmlFlowData"),ot.consume(Kt),Et}function Et(Kt){if(Kt===33)return ot.consume(Kt),kt;if(Kt===47)return ot.consume(Kt),yt=!0,Pt;if(Kt===63)return ot.consume(Kt),bt=3,gt.interrupt?st:zt;if(ai(Kt))return ot.consume(Kt),vt=String.fromCharCode(Kt),Mt;return ct(Kt)}function kt(Kt){if(Kt===45)return ot.consume(Kt),bt=2,Rt;if(Kt===91)return ot.consume(Kt),bt=5,xt=0,Tt;if(ai(Kt))return ot.consume(Kt),bt=4,gt.interrupt?st:zt;return ct(Kt)}function Rt(Kt){if(Kt===45)return ot.consume(Kt),gt.interrupt?st:zt;return ct(Kt)}function Tt(Kt){if(Kt==="CDATA[".charCodeAt(xt++)){if(ot.consume(Kt),xt===6)return gt.interrupt?st:Wt;return Tt}return ct(Kt)}function Pt(Kt){if(ai(Kt))return ot.consume(Kt),vt=String.fromCharCode(Kt),Mt;return ct(Kt)}function Mt(Kt){if(Kt===null||Kt===47||Kt===62||Or(Kt)){let an=Kt===47,ln=vt.toLowerCase();if(!an&&!yt&&SI.includes(ln))return bt=1,gt.interrupt?st(Kt):Wt(Kt);if(y$.includes(vt.toLowerCase())){if(bt=6,an)return ot.consume(Kt),It;return gt.interrupt?st(Kt):Wt(Kt)}return bt=7,gt.interrupt&&!gt.parser.lazy[gt.now().line]?ct(Kt):yt?At(Kt):Nt(Kt)}if(Kt===45||Fo(Kt))return ot.consume(Kt),vt+=String.fromCharCode(Kt),Mt;return ct(Kt)}function It(Kt){if(Kt===62)return ot.consume(Kt),gt.interrupt?st:Wt;return ct(Kt)}function At(Kt){if(ir(Kt))return ot.consume(Kt),At;return Lt(Kt)}function Nt(Kt){if(Kt===47)return ot.consume(Kt),Lt;if(Kt===58||Kt===95||ai(Kt))return ot.consume(Kt),Ot;if(ir(Kt))return ot.consume(Kt),Nt;return Lt(Kt)}function Ot(Kt){if(Kt===45||Kt===46||Kt===58||Kt===95||Fo(Kt))return ot.consume(Kt),Ot;return Dt(Kt)}function Dt(Kt){if(Kt===61)return ot.consume(Kt),_t;if(ir(Kt))return ot.consume(Kt),Dt;return Nt(Kt)}function _t(Kt){if(Kt===null||Kt===60||Kt===61||Kt===62||Kt===96)return ct(Kt);if(Kt===34||Kt===39)return ot.consume(Kt),wt=Kt,$t;if(ir(Kt))return ot.consume(Kt),_t;return Ft(Kt)}function $t(Kt){if(Kt===wt)return ot.consume(Kt),wt=null,Bt;if(Kt===null||jn(Kt))return ct(Kt);return ot.consume(Kt),$t}function Ft(Kt){if(Kt===null||Kt===34||Kt===39||Kt===47||Kt===60||Kt===61||Kt===62||Kt===96||Or(Kt))return Dt(Kt);return ot.consume(Kt),Ft}function Bt(Kt){if(Kt===47||Kt===62||ir(Kt))return Nt(Kt);return ct(Kt)}function Lt(Kt){if(Kt===62)return ot.consume(Kt),Vt;return ct(Kt)}function Vt(Kt){if(Kt===null||jn(Kt))return Wt(Kt);if(ir(Kt))return ot.consume(Kt),Vt;return ct(Kt)}function Wt(Kt){if(Kt===45&&bt===2)return ot.consume(Kt),jt;if(Kt===60&&bt===1)return ot.consume(Kt),qt;if(Kt===62&&bt===4)return ot.consume(Kt),tn;if(Kt===63&&bt===3)return ot.consume(Kt),zt;if(Kt===93&&bt===5)return ot.consume(Kt),Xt;if(jn(Kt)&&(bt===6||bt===7))return ot.exit("htmlFlowData"),ot.check(Ofe,rn,Ut)(Kt);if(Kt===null||jn(Kt))return ot.exit("htmlFlowData"),Ut(Kt);return ot.consume(Kt),Wt}function Ut(Kt){return ot.check(Lfe,Ht,rn)(Kt)}function Ht(Kt){return ot.enter("lineEnding"),ot.consume(Kt),ot.exit("lineEnding"),Gt}function Gt(Kt){if(Kt===null||jn(Kt))return Ut(Kt);return ot.enter("htmlFlowData"),Wt(Kt)}function jt(Kt){if(Kt===45)return ot.consume(Kt),zt;return Wt(Kt)}function qt(Kt){if(Kt===47)return ot.consume(Kt),vt="",Qt;return Wt(Kt)}function Qt(Kt){if(Kt===62){let an=vt.toLowerCase();if(SI.includes(an))return ot.consume(Kt),tn;return Wt(Kt)}if(ai(Kt)&&vt.length<8)return ot.consume(Kt),vt+=String.fromCharCode(Kt),Qt;return Wt(Kt)}function Xt(Kt){if(Kt===93)return ot.consume(Kt),zt;return Wt(Kt)}function zt(Kt){if(Kt===62)return ot.consume(Kt),tn;if(Kt===45&&bt===2)return ot.consume(Kt),zt;return Wt(Kt)}function tn(Kt){if(Kt===null||jn(Kt))return ot.exit("htmlFlowData"),rn(Kt);return ot.consume(Kt),tn}function rn(Kt){return ot.exit("htmlFlow"),st(Kt)}}function Hfe(ot,st,ct){let gt=this;return bt;function bt(vt){if(jn(vt))return ot.enter("lineEnding"),ot.consume(vt),ot.exit("lineEnding"),yt;return ct(vt)}function yt(vt){return gt.parser.lazy[gt.now().line]?ct(vt):st(vt)}}function zfe(ot,st,ct){return gt;function gt(bt){return ot.enter("lineEnding"),ot.consume(bt),ot.exit("lineEnding"),ot.attempt(_l,st,ct)}}var kI={name:"htmlText",tokenize:$fe};function $fe(ot,st,ct){let gt=this,bt,yt,vt;return xt;function xt(zt){return ot.enter("htmlText"),ot.enter("htmlTextData"),ot.consume(zt),wt}function wt(zt){if(zt===33)return ot.consume(zt),Ct;if(zt===47)return ot.consume(zt),Dt;if(zt===63)return ot.consume(zt),Nt;if(ai(zt))return ot.consume(zt),Ft;return ct(zt)}function Ct(zt){if(zt===45)return ot.consume(zt),St;if(zt===91)return ot.consume(zt),yt=0,Tt;if(ai(zt))return ot.consume(zt),At;return ct(zt)}function St(zt){if(zt===45)return ot.consume(zt),Rt;return ct(zt)}function Et(zt){if(zt===null)return ct(zt);if(zt===45)return ot.consume(zt),kt;if(jn(zt))return vt=Et,qt(zt);return ot.consume(zt),Et}function kt(zt){if(zt===45)return ot.consume(zt),Rt;return Et(zt)}function Rt(zt){return zt===62?jt(zt):zt===45?kt(zt):Et(zt)}function Tt(zt){if(zt==="CDATA[".charCodeAt(yt++))return ot.consume(zt),yt===6?Pt:Tt;return ct(zt)}function Pt(zt){if(zt===null)return ct(zt);if(zt===93)return ot.consume(zt),Mt;if(jn(zt))return vt=Pt,qt(zt);return ot.consume(zt),Pt}function Mt(zt){if(zt===93)return ot.consume(zt),It;return Pt(zt)}function It(zt){if(zt===62)return jt(zt);if(zt===93)return ot.consume(zt),It;return Pt(zt)}function At(zt){if(zt===null||zt===62)return jt(zt);if(jn(zt))return vt=At,qt(zt);return ot.consume(zt),At}function Nt(zt){if(zt===null)return ct(zt);if(zt===63)return ot.consume(zt),Ot;if(jn(zt))return vt=Nt,qt(zt);return ot.consume(zt),Nt}function Ot(zt){return zt===62?jt(zt):Nt(zt)}function Dt(zt){if(ai(zt))return ot.consume(zt),_t;return ct(zt)}function _t(zt){if(zt===45||Fo(zt))return ot.consume(zt),_t;return $t(zt)}function $t(zt){if(jn(zt))return vt=$t,qt(zt);if(ir(zt))return ot.consume(zt),$t;return jt(zt)}function Ft(zt){if(zt===45||Fo(zt))return ot.consume(zt),Ft;if(zt===47||zt===62||Or(zt))return Bt(zt);return ct(zt)}function Bt(zt){if(zt===47)return ot.consume(zt),jt;if(zt===58||zt===95||ai(zt))return ot.consume(zt),Lt;if(jn(zt))return vt=Bt,qt(zt);if(ir(zt))return ot.consume(zt),Bt;return jt(zt)}function Lt(zt){if(zt===45||zt===46||zt===58||zt===95||Fo(zt))return ot.consume(zt),Lt;return Vt(zt)}function Vt(zt){if(zt===61)return ot.consume(zt),Wt;if(jn(zt))return vt=Vt,qt(zt);if(ir(zt))return ot.consume(zt),Vt;return Bt(zt)}function Wt(zt){if(zt===null||zt===60||zt===61||zt===62||zt===96)return ct(zt);if(zt===34||zt===39)return ot.consume(zt),bt=zt,Ut;if(jn(zt))return vt=Wt,qt(zt);if(ir(zt))return ot.consume(zt),Wt;return ot.consume(zt),Ht}function Ut(zt){if(zt===bt)return ot.consume(zt),bt=void 0,Gt;if(zt===null)return ct(zt);if(jn(zt))return vt=Ut,qt(zt);return ot.consume(zt),Ut}function Ht(zt){if(zt===null||zt===34||zt===39||zt===60||zt===61||zt===96)return ct(zt);if(zt===47||zt===62||Or(zt))return Bt(zt);return ot.consume(zt),Ht}function Gt(zt){if(zt===47||zt===62||Or(zt))return Bt(zt);return ct(zt)}function jt(zt){if(zt===62)return ot.consume(zt),ot.exit("htmlTextData"),ot.exit("htmlText"),st;return ct(zt)}function qt(zt){return ot.exit("htmlTextData"),ot.enter("lineEnding"),ot.consume(zt),ot.exit("lineEnding"),Qt}function Qt(zt){return ir(zt)?nr(ot,Xt,"linePrefix",gt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(zt):Xt(zt)}function Xt(zt){return ot.enter("htmlTextData"),vt(zt)}}var Sd={name:"labelEnd",resolveAll:Vfe,resolveTo:Gfe,tokenize:Kfe},Wfe={tokenize:qfe},Ufe={tokenize:Qfe},jfe={tokenize:Jfe};function Vfe(ot){let st=-1,ct=[];while(++st<ot.length){let gt=ot[st][1];if(ct.push(ot[st]),gt.type==="labelImage"||gt.type==="labelLink"||gt.type==="labelEnd"){let bt=gt.type==="labelImage"?4:2;gt.type="data",st+=bt}}if(ot.length!==ct.length)Ko(ot,0,ot.length,ct);return ot}function Gfe(ot,st){let ct=ot.length,gt=0,bt,yt,vt,xt;while(ct--)if(bt=ot[ct][1],yt){if(bt.type==="link"||bt.type==="labelLink"&&bt._inactive)break;if(ot[ct][0]==="enter"&&bt.type==="labelLink")bt._inactive=!0}else if(vt){if(ot[ct][0]==="enter"&&(bt.type==="labelImage"||bt.type==="labelLink")&&!bt._balanced){if(yt=ct,bt.type!=="labelLink"){gt=2;break}}}else if(bt.type==="labelEnd")vt=ct;let wt={type:ot[yt][1].type==="labelLink"?"link":"image",start:{...ot[yt][1].start},end:{...ot[ot.length-1][1].end}},Ct={type:"label",start:{...ot[yt][1].start},end:{...ot[vt][1].end}},St={type:"labelText",start:{...ot[yt+gt+2][1].end},end:{...ot[vt-2][1].start}};return xt=[["enter",wt,st],["enter",Ct,st]],xt=Yi(xt,ot.slice(yt+1,yt+gt+3)),xt=Yi(xt,[["enter",St,st]]),xt=Yi(xt,Ju(st.parser.constructs.insideSpan.null,ot.slice(yt+gt+4,vt-3),st)),xt=Yi(xt,[["exit",St,st],ot[vt-2],ot[vt-1],["exit",Ct,st]]),xt=Yi(xt,ot.slice(vt+1)),xt=Yi(xt,[["exit",wt,st]]),Ko(ot,yt,ot.length,xt),ot}function Kfe(ot,st,ct){let gt=this,bt=gt.events.length,yt,vt;while(bt--)if((gt.events[bt][1].type==="labelImage"||gt.events[bt][1].type==="labelLink")&&!gt.events[bt][1]._balanced){yt=gt.events[bt][1];break}return xt;function xt(kt){if(!yt)return ct(kt);if(yt._inactive)return Et(kt);return vt=gt.parser.defined.includes(zi(gt.sliceSerialize({start:yt.end,end:gt.now()}))),ot.enter("labelEnd"),ot.enter("labelMarker"),ot.consume(kt),ot.exit("labelMarker"),ot.exit("labelEnd"),wt}function wt(kt){if(kt===40)return ot.attempt(Wfe,St,vt?St:Et)(kt);if(kt===91)return ot.attempt(Ufe,St,vt?Ct:Et)(kt);return vt?St(kt):Et(kt)}function Ct(kt){return ot.attempt(jfe,St,Et)(kt)}function St(kt){return st(kt)}function Et(kt){return yt._balanced=!0,ct(kt)}}function qfe(ot,st,ct){return gt;function gt(Et){return ot.enter("resource"),ot.enter("resourceMarker"),ot.consume(Et),ot.exit("resourceMarker"),bt}function bt(Et){return Or(Et)?Cd(ot,yt)(Et):yt(Et)}function yt(Et){if(Et===41)return St(Et);return sC(ot,vt,xt,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(Et)}function vt(Et){return Or(Et)?Cd(ot,wt)(Et):St(Et)}function xt(Et){return ct(Et)}function wt(Et){if(Et===34||Et===39||Et===40)return lC(ot,Ct,ct,"resourceTitle","resourceTitleMarker","resourceTitleString")(Et);return St(Et)}function Ct(Et){return Or(Et)?Cd(ot,St)(Et):St(Et)}function St(Et){if(Et===41)return ot.enter("resourceMarker"),ot.consume(Et),ot.exit("resourceMarker"),ot.exit("resource"),st;return ct(Et)}}function Qfe(ot,st,ct){let gt=this;return bt;function bt(xt){return aC.call(gt,ot,yt,vt,"reference","referenceMarker","referenceString")(xt)}function yt(xt){return gt.parser.defined.includes(zi(gt.sliceSerialize(gt.events[gt.events.length-1][1]).slice(1,-1)))?st(xt):ct(xt)}function vt(xt){return ct(xt)}}function Jfe(ot,st,ct){return gt;function gt(yt){return ot.enter("reference"),ot.enter("referenceMarker"),ot.consume(yt),ot.exit("referenceMarker"),bt}function bt(yt){if(yt===93)return ot.enter("referenceMarker"),ot.consume(yt),ot.exit("referenceMarker"),ot.exit("reference"),st;return ct(yt)}}var RI={name:"labelStartImage",resolveAll:Sd.resolveAll,tokenize:Xfe};function Xfe(ot,st,ct){let gt=this;return bt;function bt(xt){return ot.enter("labelImage"),ot.enter("labelImageMarker"),ot.consume(xt),ot.exit("labelImageMarker"),yt}function yt(xt){if(xt===91)return ot.enter("labelMarker"),ot.consume(xt),ot.exit("labelMarker"),ot.exit("labelImage"),vt;return ct(xt)}function vt(xt){return xt===94&&"_hiddenFootnoteSupport"in gt.parser.constructs?ct(xt):st(xt)}}var TI={name:"labelStartLink",resolveAll:Sd.resolveAll,tokenize:Yfe};function Yfe(ot,st,ct){let gt=this;return bt;function bt(vt){return ot.enter("labelLink"),ot.enter("labelMarker"),ot.consume(vt),ot.exit("labelMarker"),ot.exit("labelLink"),yt}function yt(vt){return vt===94&&"_hiddenFootnoteSupport"in gt.parser.constructs?ct(vt):st(vt)}}var Ob={name:"lineEnding",tokenize:Zfe};function Zfe(ot,st){return ct;function ct(gt){return ot.enter("lineEnding"),ot.consume(gt),ot.exit("lineEnding"),nr(ot,st,"linePrefix")}}var Ed={name:"thematicBreak",tokenize:eme};function eme(ot,st,ct){let gt=0,bt;return yt;function yt(Ct){return ot.enter("thematicBreak"),vt(Ct)}function vt(Ct){return bt=Ct,xt(Ct)}function xt(Ct){if(Ct===bt)return ot.enter("thematicBreakSequence"),wt(Ct);if(gt>=3&&(Ct===null||jn(Ct)))return ot.exit("thematicBreak"),st(Ct);return ct(Ct)}function wt(Ct){if(Ct===bt)return ot.consume(Ct),gt++,wt;return ot.exit("thematicBreakSequence"),ir(Ct)?nr(ot,xt,"whitespace")(Ct):xt(Ct)}}var $i={continuation:{tokenize:ome},exit:sme,name:"list",tokenize:rme},tme={partial:!0,tokenize:ame},nme={partial:!0,tokenize:ime};function rme(ot,st,ct){let gt=this,bt=gt.events[gt.events.length-1],yt=bt&&bt[1].type==="linePrefix"?bt[2].sliceSerialize(bt[1],!0).length:0,vt=0;return xt;function xt(Rt){let Tt=gt.containerState.type||(Rt===42||Rt===43||Rt===45?"listUnordered":"listOrdered");if(Tt==="listUnordered"?!gt.containerState.marker||Rt===gt.containerState.marker:Ab(Rt)){if(!gt.containerState.type)gt.containerState.type=Tt,ot.enter(Tt,{_container:!0});if(Tt==="listUnordered")return ot.enter("listItemPrefix"),Rt===42||Rt===45?ot.check(Ed,ct,Ct)(Rt):Ct(Rt);if(!gt.interrupt||Rt===49)return ot.enter("listItemPrefix"),ot.enter("listItemValue"),wt(Rt)}return ct(Rt)}function wt(Rt){if(Ab(Rt)&&++vt<10)return ot.consume(Rt),wt;if((!gt.interrupt||vt<2)&&(gt.containerState.marker?Rt===gt.containerState.marker:Rt===41||Rt===46))return ot.exit("listItemValue"),Ct(Rt);return ct(Rt)}function Ct(Rt){return ot.enter("listItemMarker"),ot.consume(Rt),ot.exit("listItemMarker"),gt.containerState.marker=gt.containerState.marker||Rt,ot.check(_l,gt.interrupt?ct:St,ot.attempt(tme,kt,Et))}function St(Rt){return gt.containerState.initialBlankLine=!0,yt++,kt(Rt)}function Et(Rt){if(ir(Rt))return ot.enter("listItemPrefixWhitespace"),ot.consume(Rt),ot.exit("listItemPrefixWhitespace"),kt;return ct(Rt)}function kt(Rt){return gt.containerState.size=yt+gt.sliceSerialize(ot.exit("listItemPrefix"),!0).length,st(Rt)}}function ome(ot,st,ct){let gt=this;return gt.containerState._closeFlow=void 0,ot.check(_l,bt,yt);function bt(xt){return gt.containerState.furtherBlankLines=gt.containerState.furtherBlankLines||gt.containerState.initialBlankLine,nr(ot,st,"listItemIndent",gt.containerState.size+1)(xt)}function yt(xt){if(gt.containerState.furtherBlankLines||!ir(xt))return gt.containerState.furtherBlankLines=void 0,gt.containerState.initialBlankLine=void 0,vt(xt);return gt.containerState.furtherBlankLines=void 0,gt.containerState.initialBlankLine=void 0,ot.attempt(nme,st,vt)(xt)}function vt(xt){return gt.containerState._closeFlow=!0,gt.interrupt=void 0,nr(ot,ot.attempt($i,st,ct),"linePrefix",gt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(xt)}}function ime(ot,st,ct){let gt=this;return nr(ot,bt,"listItemIndent",gt.containerState.size+1);function bt(yt){let vt=gt.events[gt.events.length-1];return vt&&vt[1].type==="listItemIndent"&&vt[2].sliceSerialize(vt[1],!0).length===gt.containerState.size?st(yt):ct(yt)}}function sme(ot){ot.exit(this.containerState.type)}function ame(ot,st,ct){let gt=this;return nr(ot,bt,"listItemPrefixWhitespace",gt.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function bt(yt){let vt=gt.events[gt.events.length-1];return!ir(yt)&&vt&&vt[1].type==="listItemPrefixWhitespace"?st(yt):ct(yt)}}var cC={name:"setextUnderline",resolveTo:lme,tokenize:cme};function lme(ot,st){let ct=ot.length,gt,bt,yt;while(ct--)if(ot[ct][0]==="enter"){if(ot[ct][1].type==="content"){gt=ct;break}if(ot[ct][1].type==="paragraph")bt=ct}else{if(ot[ct][1].type==="content")ot.splice(ct,1);if(!yt&&ot[ct][1].type==="definition")yt=ct}let vt={type:"setextHeading",start:{...ot[gt][1].start},end:{...ot[ot.length-1][1].end}};if(ot[bt][1].type="setextHeadingText",yt)ot.splice(bt,0,["enter",vt,st]),ot.splice(yt+1,0,["exit",ot[gt][1],st]),ot[gt][1].end={...ot[yt][1].end};else ot[gt][1]=vt;return ot.push(["exit",vt,st]),ot}function cme(ot,st,ct){let gt=this,bt;return yt;function yt(Ct){let St=gt.events.length,Et;while(St--)if(gt.events[St][1].type!=="lineEnding"&&gt.events[St][1].type!=="linePrefix"&&gt.events[St][1].type!=="content"){Et=gt.events[St][1].type==="paragraph";break}if(!gt.parser.lazy[gt.now().line]&&(gt.interrupt||Et))return ot.enter("setextHeadingLine"),bt=Ct,vt(Ct);return ct(Ct)}function vt(Ct){return ot.enter("setextHeadingLineSequence"),xt(Ct)}function xt(Ct){if(Ct===bt)return ot.consume(Ct),xt;return ot.exit("setextHeadingLineSequence"),ir(Ct)?nr(ot,wt,"lineSuffix")(Ct):wt(Ct)}function wt(Ct){if(Ct===null||jn(Ct))return ot.exit("setextHeadingLine"),st(Ct);return ct(Ct)}}var v$={tokenize:ume};function ume(ot){let st=this,ct=ot.attempt(_l,gt,ot.attempt(this.parser.constructs.flowInitial,bt,nr(ot,ot.attempt(this.parser.constructs.flow,bt,ot.attempt(vI,bt)),"linePrefix")));return ct;function gt(yt){if(yt===null){ot.consume(yt);return}return ot.enter("lineEndingBlank"),ot.consume(yt),ot.exit("lineEndingBlank"),st.currentConstruct=void 0,ct}function bt(yt){if(yt===null){ot.consume(yt);return}return ot.enter("lineEnding"),ot.consume(yt),ot.exit("lineEnding"),st.currentConstruct=void 0,ct}}var x$={resolveAll:E$()},w$=S$("string"),C$=S$("text");function S$(ot){return{resolveAll:E$(ot==="text"?pme:void 0),tokenize:st};function st(ct){let gt=this,bt=this.parser.constructs[ot],yt=ct.attempt(bt,vt,xt);return vt;function vt(St){return Ct(St)?yt(St):xt(St)}function xt(St){if(St===null){ct.consume(St);return}return ct.enter("data"),ct.consume(St),wt}function wt(St){if(Ct(St))return ct.exit("data"),yt(St);return ct.consume(St),wt}function Ct(St){if(St===null)return!0;let Et=bt[St],kt=-1;if(Et)while(++kt<Et.length){let Rt=Et[kt];if(!Rt.previous||Rt.previous.call(gt,gt.previous))return!0}return!1}}}function E$(ot){return st;function st(ct,gt){let bt=-1,yt;while(++bt<=ct.length)if(yt===void 0){if(ct[bt]&&ct[bt][1].type==="data")yt=bt,bt++}else if(!ct[bt]||ct[bt][1].type!=="data"){if(bt!==yt+2)ct[yt][1].end=ct[bt-1][1].end,ct.splice(yt+2,bt-yt-2),bt=yt+2;yt=void 0}return ot?ot(ct,gt):ct}}function pme(ot,st){let ct=0;while(++ct<=ot.length)if((ct===ot.length||ot[ct][1].type==="lineEnding")&&ot[ct-1][1].type==="data"){let gt=ot[ct-1][1],bt=st.sliceStream(gt),yt=bt.length,vt=-1,xt=0,wt;while(yt--){let Ct=bt[yt];if(typeof Ct==="string"){vt=Ct.length;while(Ct.charCodeAt(vt-1)===32)xt++,vt--;if(vt)break;vt=-1}else if(Ct===-2)wt=!0,xt++;else if(Ct===-1);else{yt++;break}}if(st._contentTypeTextTrailing&&ct===ot.length)xt=0;if(xt){let Ct={type:ct===ot.length||wt||xt<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:yt?vt:gt.start._bufferIndex+vt,_index:gt.start._index+yt,line:gt.end.line,column:gt.end.column-xt,offset:gt.end.offset-xt},end:{...gt.end}};if(gt.end={...Ct.start},gt.start.offset===gt.end.offset)Object.assign(gt,Ct);else ot.splice(ct,0,["enter",Ct,st],["exit",Ct,st]),ct+=2}ct++}return ot}var dme={[42]:$i,[43]:$i,[45]:$i,[48]:$i,[49]:$i,[50]:$i,[51]:$i,[52]:$i,[53]:$i,[54]:$i,[55]:$i,[56]:$i,[57]:$i,[62]:tC},fme={[91]:xI},mme={[-2]:Db,[-1]:Db,[32]:Db},gme={[35]:CI,[42]:Ed,[45]:[cC,Ed],[60]:EI,[61]:cC,[95]:Ed,[96]:oC,[126]:oC},hme={[38]:rC,[92]:nC},bme={[-5]:Ob,[-4]:Ob,[-3]:Ob,[33]:RI,[38]:rC,[42]:Nb,[60]:[hI,kI],[91]:TI,[92]:[wI,nC],[93]:Sd,[95]:Nb,[96]:bI},yme={null:[Nb,x$]},vme={null:[42,95]},xme={null:[]};function k$(ot,st,ct){let gt={_bufferIndex:-1,_index:0,line:ct&&ct.line||1,column:ct&&ct.column||1,offset:ct&&ct.offset||0},bt={},yt=[],vt=[],xt=[],wt=!0,Ct={attempt:Bt($t),check:Bt(Ft),consume:Ot,enter:Dt,exit:_t,interrupt:Bt(Ft,{interrupt:!0})},St={code:null,containerState:{},defineSkip:It,events:[],now:Mt,parser:ot,previous:null,sliceSerialize:Tt,sliceStream:Pt,write:Rt},Et=st.tokenize.call(St,Ct),kt;if(st.resolveAll)yt.push(st);return St;function Rt(Ut){if(vt=Yi(vt,Ut),At(),vt[vt.length-1]!==null)return[];return Lt(st,0),St.events=Ju(yt,St.events,St),St.events}function Tt(Ut,Ht){return Cme(Pt(Ut),Ht)}function Pt(Ut){return wme(vt,Ut)}function Mt(){let{_bufferIndex:Ut,_index:Ht,line:Gt,column:jt,offset:qt}=gt;return{_bufferIndex:Ut,_index:Ht,line:Gt,column:jt,offset:qt}}function It(Ut){bt[Ut.line]=Ut.column,Wt()}function At(){let Ut;while(gt._index<vt.length){let Ht=vt[gt._index];if(typeof Ht==="string"){if(Ut=gt._index,gt._bufferIndex<0)gt._bufferIndex=0;while(gt._index===Ut&&gt._bufferIndex<Ht.length)Nt(Ht.charCodeAt(gt._bufferIndex))}else Nt(Ht)}}function Nt(Ut){wt=void 0,kt=Ut,Et=Et(Ut)}function Ot(Ut){if(jn(Ut))gt.line++,gt.column=1,gt.offset+=Ut===-3?2:1,Wt();else if(Ut!==-1)gt.column++,gt.offset++;if(gt._bufferIndex<0)gt._index++;else if(gt._bufferIndex++,gt._bufferIndex===vt[gt._index].length)gt._bufferIndex=-1,gt._index++;St.previous=Ut,wt=!0}function Dt(Ut,Ht){let Gt=Ht||{};return Gt.type=Ut,Gt.start=Mt(),St.events.push(["enter",Gt,St]),xt.push(Gt),Gt}function _t(Ut){let Ht=xt.pop();return Ht.end=Mt(),St.events.push(["exit",Ht,St]),Ht}function $t(Ut,Ht){Lt(Ut,Ht.from)}function Ft(Ut,Ht){Ht.restore()}function Bt(Ut,Ht){return Gt;function Gt(jt,qt,Qt){let Xt,zt,tn,rn;return Array.isArray(jt)?an(jt):("tokenize"in jt)?an([jt]):Kt(jt);function Kt(sn){return dn;function dn(fn){let bn=fn!==null&&sn[fn],hn=fn!==null&&sn.null,gn=[...Array.isArray(bn)?bn:bn?[bn]:[],...Array.isArray(hn)?hn:hn?[hn]:[]];return an(gn)(fn)}}function an(sn){if(Xt=sn,zt=0,sn.length===0)return Qt;return ln(sn[zt])}function ln(sn){return dn;function dn(fn){if(rn=Vt(),tn=sn,!sn.partial)St.currentConstruct=sn;if(sn.name&&St.parser.constructs.disable.null.includes(sn.name))return on(fn);return sn.tokenize.call(Ht?Object.assign(Object.create(St),Ht):St,Ct,Zt,on)(fn)}}function Zt(sn){return wt=!0,Ut(tn,rn),qt}function on(sn){if(wt=!0,rn.restore(),++zt<Xt.length)return ln(Xt[zt]);return Qt}}}function Lt(Ut,Ht){if(Ut.resolveAll&&!yt.includes(Ut))yt.push(Ut);if(Ut.resolve)Ko(St.events,Ht,St.events.length-Ht,Ut.resolve(St.events.slice(Ht),St));if(Ut.resolveTo)St.events=Ut.resolveTo(St.events,St)}function Vt(){let Ut=Mt(),{previous:Ht,currentConstruct:Gt}=St,jt=St.events.length,qt=Array.from(xt);return{from:jt,restore:Qt};function Qt(){gt=Ut,St.previous=Ht,St.currentConstruct=Gt,St.events.length=jt,xt=qt,Wt()}}function Wt(){if(gt.line in bt&&gt.column<2)gt.column=bt[gt.line],gt.offset+=bt[gt.line]-1}}function wme(ot,st){let ct=st.start._index,gt=st.start._bufferIndex,bt=st.end._index,yt=st.end._bufferIndex,vt;if(ct===bt)vt=[ot[ct].slice(gt,yt)];else{if(vt=ot.slice(ct,bt),gt>-1){let xt=vt[0];if(typeof xt==="string")vt[0]=xt.slice(gt);else vt.shift()}if(yt>0)vt.push(ot[bt].slice(0,yt))}return vt}function Cme(ot,st){let ct=-1,gt=[],bt;while(++ct<ot.length){let yt=ot[ct],vt;if(typeof yt==="string")vt=yt;else switch(yt){case-5:{vt="\r";break}case-4:{vt=`
25
+ `;break}case-3:{vt=`\r
26
+ `;break}case-2:{vt=st?" ":"\t";break}case-1:{if(!st&&bt)continue;vt=" ";break}default:vt=String.fromCharCode(yt)}bt=yt===-2,gt.push(vt)}return gt.join("")}function II(ot){let gt={constructs:Z1([PI,...(ot||{}).extensions||[]]),content:bt(f$),defined:[],document:bt(g$),flow:bt(v$),lazy:{},string:bt(w$),text:bt(C$)};return gt;function bt(yt){return vt;function vt(xt){return k$(gt,yt,xt)}}}function MI(ot){while(!iC(ot));return ot}var R$=/[\0\t\n\r]/g;function AI(){let ot=1,st="",ct=!0,gt;return bt;function bt(yt,vt,xt){let wt=[],Ct,St,Et,kt,Rt;if(yt=st+(typeof yt==="string"?yt.toString():new TextDecoder(vt||void 0).decode(yt)),Et=0,st="",ct){if(yt.charCodeAt(0)===65279)Et++;ct=void 0}while(Et<yt.length){if(R$.lastIndex=Et,Ct=R$.exec(yt),kt=Ct&&Ct.index!==void 0?Ct.index:yt.length,Rt=yt.charCodeAt(kt),!Ct){st=yt.slice(Et);break}if(Rt===10&&Et===kt&&gt)wt.push(-3),gt=void 0;else{if(gt)wt.push(-5),gt=void 0;if(Et<kt)wt.push(yt.slice(Et,kt)),ot+=kt-Et;switch(Rt){case 0:{wt.push(65533),ot++;break}case 9:{St=Math.ceil(ot/4)*4,wt.push(-2);while(ot++<St)wt.push(-1);break}case 10:{wt.push(-4),ot=1;break}default:gt=!0,ot=1}}Et=kt+1}if(xt){if(gt)wt.push(-5);if(st)wt.push(st);wt.push(null)}return wt}}var Sme=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function T$(ot){return ot.replace(Sme,Eme)}function Eme(ot,st,ct){if(st)return st;if(ct.charCodeAt(0)===35){let bt=ct.charCodeAt(1),yt=bt===120||bt===88;return eC(ct.slice(yt?2:1),yt?16:10)}return Om(ct)||ot}var I$={}.hasOwnProperty;function NI(ot,st,ct){if(st&&typeof st==="object")ct=st,st=void 0;return kme(ct)(MI(II(ct).document().write(AI()(ot,st,!0))))}function kme(ot){let st={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:yt(pn),autolinkProtocol:Bt,autolinkEmail:Bt,atxHeading:yt(wn),blockQuote:yt(fn),characterEscape:Bt,characterReference:Bt,codeFenced:yt(bn),codeFencedFenceInfo:vt,codeFencedFenceMeta:vt,codeIndented:yt(bn,vt),codeText:yt(hn,vt),codeTextData:Bt,data:Bt,codeFlowValue:Bt,definition:yt(gn),definitionDestinationString:vt,definitionLabelString:vt,definitionTitleString:vt,emphasis:yt(xn),hardBreakEscape:yt(yn),hardBreakTrailing:yt(yn),htmlFlow:yt(nn,vt),htmlFlowData:Bt,htmlText:yt(nn,vt),htmlTextData:Bt,image:yt(en),label:vt,link:yt(pn),listItem:yt(mn),listItemValue:kt,listOrdered:yt(cn,Et),listUnordered:yt(cn),paragraph:yt(Pn),reference:Kt,referenceString:vt,resourceDestinationString:vt,resourceTitleString:vt,setextHeading:yt(wn),strong:yt(Rn),thematicBreak:yt(kn)},exit:{atxHeading:wt(),atxHeadingSequence:Dt,autolink:wt(),autolinkEmail:dn,autolinkProtocol:sn,blockQuote:wt(),characterEscapeValue:Lt,characterReferenceMarkerHexadecimal:ln,characterReferenceMarkerNumeric:ln,characterReferenceValue:Zt,characterReference:on,codeFenced:wt(Mt),codeFencedFence:Pt,codeFencedFenceInfo:Rt,codeFencedFenceMeta:Tt,codeFlowValue:Lt,codeIndented:wt(It),codeText:wt(Gt),codeTextData:Lt,data:Lt,definition:wt(),definitionDestinationString:Ot,definitionLabelString:At,definitionTitleString:Nt,emphasis:wt(),hardBreakEscape:wt(Wt),hardBreakTrailing:wt(Wt),htmlFlow:wt(Ut),htmlFlowData:Lt,htmlText:wt(Ht),htmlTextData:Lt,image:wt(qt),label:Xt,labelText:Qt,lineEnding:Vt,link:wt(jt),listItem:wt(),listOrdered:wt(),listUnordered:wt(),paragraph:wt(),referenceString:an,resourceDestinationString:zt,resourceTitleString:tn,resource:rn,setextHeading:wt(Ft),setextHeadingLineSequence:$t,setextHeadingText:_t,strong:wt(),thematicBreak:wt()}};M$(st,(ot||{}).mdastExtensions||[]);let ct={};return gt;function gt(Jt){let Yt={type:"root",children:[]},un={stack:[Yt],tokenStack:[],config:st,enter:xt,exit:Ct,buffer:vt,resume:St,data:ct},vn=[],_n=-1;while(++_n<Jt.length)if(Jt[_n][1].type==="listOrdered"||Jt[_n][1].type==="listUnordered")if(Jt[_n][0]==="enter")vn.push(_n);else{let zn=vn.pop();_n=bt(Jt,zn,_n)}_n=-1;while(++_n<Jt.length){let zn=st[Jt[_n][0]];if(I$.call(zn,Jt[_n][1].type))zn[Jt[_n][1].type].call(Object.assign({sliceSerialize:Jt[_n][2].sliceSerialize},un),Jt[_n][1])}if(un.tokenStack.length>0){let zn=un.tokenStack[un.tokenStack.length-1];(zn[1]||P$).call(un,void 0,zn[0])}Yt.position={start:Xu(Jt.length>0?Jt[0][1].start:{line:1,column:1,offset:0}),end:Xu(Jt.length>0?Jt[Jt.length-2][1].end:{line:1,column:1,offset:0})},_n=-1;while(++_n<st.transforms.length)Yt=st.transforms[_n](Yt)||Yt;return Yt}function bt(Jt,Yt,un){let vn=Yt-1,_n=-1,zn=!1,$n,Mn,Gn,sr;while(++vn<=un){let gr=Jt[vn];switch(gr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(gr[0]==="enter")_n++;else _n--;sr=void 0;break}case"lineEndingBlank":{if(gr[0]==="enter"){if($n&&!sr&&!_n&&!Gn)Gn=vn;sr=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sr=void 0}if(!_n&&gr[0]==="enter"&&gr[1].type==="listItemPrefix"||_n===-1&&gr[0]==="exit"&&(gr[1].type==="listUnordered"||gr[1].type==="listOrdered")){if($n){let qn=vn;Mn=void 0;while(qn--){let Bn=Jt[qn];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;if(Mn)Jt[Mn][1].type="lineEndingBlank",zn=!0;Bn[1].type="lineEnding",Mn=qn}else if(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespace"||Bn[1].type==="blockQuoteMarker"||Bn[1].type==="listItemIndent");else break}if(Gn&&(!Mn||Gn<Mn))$n._spread=!0;$n.end=Object.assign({},Mn?Jt[Mn][1].start:gr[1].end),Jt.splice(Mn||vn,0,["exit",$n,gr[2]]),vn++,un++}if(gr[1].type==="listItemPrefix"){let qn={type:"listItem",_spread:!1,start:Object.assign({},gr[1].start),end:void 0};$n=qn,Jt.splice(vn,0,["enter",qn,gr[2]]),vn++,un++,Gn=void 0,sr=!0}}}return Jt[Yt][1]._spread=zn,un}function yt(Jt,Yt){return un;function un(vn){if(xt.call(this,Jt(vn),vn),Yt)Yt.call(this,vn)}}function vt(){this.stack.push({type:"fragment",children:[]})}function xt(Jt,Yt,un){this.stack[this.stack.length-1].children.push(Jt),this.stack.push(Jt),this.tokenStack.push([Yt,un||void 0]),Jt.position={start:Xu(Yt.start),end:void 0}}function wt(Jt){return Yt;function Yt(un){if(Jt)Jt.call(this,un);Ct.call(this,un)}}function Ct(Jt,Yt){let un=this.stack.pop(),vn=this.tokenStack.pop();if(!vn)throw Error("Cannot close `"+Jt.type+"` ("+qu({start:Jt.start,end:Jt.end})+"): it’s not open");else if(vn[0].type!==Jt.type)if(Yt)Yt.call(this,Jt,vn[0]);else(vn[1]||P$).call(this,Jt,vn[0]);un.position.end=Xu(Jt.end)}function St(){return vd(this.stack.pop())}function Et(){this.data.expectingFirstListItemValue=!0}function kt(Jt){if(this.data.expectingFirstListItemValue){let Yt=this.stack[this.stack.length-2];Yt.start=Number.parseInt(this.sliceSerialize(Jt),10),this.data.expectingFirstListItemValue=void 0}}function Rt(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.lang=Jt}function Tt(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.meta=Jt}function Pt(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function Mt(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.value=Jt.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function It(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.value=Jt.replace(/(\r?\n|\r)$/g,"")}function At(Jt){let Yt=this.resume(),un=this.stack[this.stack.length-1];un.label=Yt,un.identifier=zi(this.sliceSerialize(Jt)).toLowerCase()}function Nt(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.title=Jt}function Ot(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.url=Jt}function Dt(Jt){let Yt=this.stack[this.stack.length-1];if(!Yt.depth){let un=this.sliceSerialize(Jt).length;Yt.depth=un}}function _t(){this.data.setextHeadingSlurpLineEnding=!0}function $t(Jt){let Yt=this.stack[this.stack.length-1];Yt.depth=this.sliceSerialize(Jt).codePointAt(0)===61?1:2}function Ft(){this.data.setextHeadingSlurpLineEnding=void 0}function Bt(Jt){let un=this.stack[this.stack.length-1].children,vn=un[un.length-1];if(!vn||vn.type!=="text")vn=Cn(),vn.position={start:Xu(Jt.start),end:void 0},un.push(vn);this.stack.push(vn)}function Lt(Jt){let Yt=this.stack.pop();Yt.value+=this.sliceSerialize(Jt),Yt.position.end=Xu(Jt.end)}function Vt(Jt){let Yt=this.stack[this.stack.length-1];if(this.data.atHardBreak){let un=Yt.children[Yt.children.length-1];un.position.end=Xu(Jt.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&st.canContainEols.includes(Yt.type))Bt.call(this,Jt),Lt.call(this,Jt)}function Wt(){this.data.atHardBreak=!0}function Ut(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.value=Jt}function Ht(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.value=Jt}function Gt(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.value=Jt}function jt(){let Jt=this.stack[this.stack.length-1];if(this.data.inReference){let Yt=this.data.referenceType||"shortcut";Jt.type+="Reference",Jt.referenceType=Yt,delete Jt.url,delete Jt.title}else delete Jt.identifier,delete Jt.label;this.data.referenceType=void 0}function qt(){let Jt=this.stack[this.stack.length-1];if(this.data.inReference){let Yt=this.data.referenceType||"shortcut";Jt.type+="Reference",Jt.referenceType=Yt,delete Jt.url,delete Jt.title}else delete Jt.identifier,delete Jt.label;this.data.referenceType=void 0}function Qt(Jt){let Yt=this.sliceSerialize(Jt),un=this.stack[this.stack.length-2];un.label=T$(Yt),un.identifier=zi(Yt).toLowerCase()}function Xt(){let Jt=this.stack[this.stack.length-1],Yt=this.resume(),un=this.stack[this.stack.length-1];if(this.data.inReference=!0,un.type==="link"){let vn=Jt.children;un.children=vn}else un.alt=Yt}function zt(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.url=Jt}function tn(){let Jt=this.resume(),Yt=this.stack[this.stack.length-1];Yt.title=Jt}function rn(){this.data.inReference=void 0}function Kt(){this.data.referenceType="collapsed"}function an(Jt){let Yt=this.resume(),un=this.stack[this.stack.length-1];un.label=Yt,un.identifier=zi(this.sliceSerialize(Jt)).toLowerCase(),this.data.referenceType="full"}function ln(Jt){this.data.characterReferenceType=Jt.type}function Zt(Jt){let Yt=this.sliceSerialize(Jt),un=this.data.characterReferenceType,vn;if(un)vn=eC(Yt,un==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else vn=Om(Yt);let _n=this.stack[this.stack.length-1];_n.value+=vn}function on(Jt){let Yt=this.stack.pop();Yt.position.end=Xu(Jt.end)}function sn(Jt){Lt.call(this,Jt);let Yt=this.stack[this.stack.length-1];Yt.url=this.sliceSerialize(Jt)}function dn(Jt){Lt.call(this,Jt);let Yt=this.stack[this.stack.length-1];Yt.url="mailto:"+this.sliceSerialize(Jt)}function fn(){return{type:"blockquote",children:[]}}function bn(){return{type:"code",lang:null,meta:null,value:""}}function hn(){return{type:"inlineCode",value:""}}function gn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xn(){return{type:"emphasis",children:[]}}function wn(){return{type:"heading",depth:0,children:[]}}function yn(){return{type:"break"}}function nn(){return{type:"html",value:""}}function en(){return{type:"image",title:null,url:"",alt:null}}function pn(){return{type:"link",title:null,url:"",children:[]}}function cn(Jt){return{type:"list",ordered:Jt.type==="listOrdered",start:null,spread:Jt._spread,children:[]}}function mn(Jt){return{type:"listItem",spread:Jt._spread,checked:null,children:[]}}function Pn(){return{type:"paragraph",children:[]}}function Rn(){return{type:"strong",children:[]}}function Cn(){return{type:"text",value:""}}function kn(){return{type:"thematicBreak"}}}function Xu(ot){return{line:ot.line,column:ot.column,offset:ot.offset}}function M$(ot,st){let ct=-1;while(++ct<st.length){let gt=st[ct];if(Array.isArray(gt))M$(ot,gt);else Rme(ot,gt)}}function Rme(ot,st){let ct;for(ct in st)if(I$.call(st,ct))switch(ct){case"canContainEols":{let gt=st[ct];if(gt)ot[ct].push(...gt);break}case"transforms":{let gt=st[ct];if(gt)ot[ct].push(...gt);break}case"enter":case"exit":{let gt=st[ct];if(gt)Object.assign(ot[ct],gt);break}}}function P$(ot,st){if(ot)throw Error("Cannot close `"+ot.type+"` ("+qu({start:ot.start,end:ot.end})+"): a different token (`"+st.type+"`, "+qu({start:st.start,end:st.end})+") is open");else throw Error("Cannot close document, a token (`"+st.type+"`, "+qu({start:st.start,end:st.end})+") is still open")}function uC(ot){let st=this;st.parser=ct;function ct(gt){return NI(gt,{...st.data("settings"),...ot,extensions:st.data("micromarkExtensions")||[],mdastExtensions:st.data("fromMarkdownExtensions")||[]})}}var pC=-1,Lm=0,kd=1,Bm=2,Lb=3,Bb=4,Fb=5,Hb=6,dC=7,fC=8;var A$=typeof self==="object"?self:globalThis,Tme=(ot,st)=>{let ct=(bt,yt)=>(ot.set(yt,bt),bt),gt=(bt)=>{if(ot.has(bt))return ot.get(bt);let[yt,vt]=st[bt];switch(yt){case Lm:case pC:return ct(vt,bt);case kd:{let xt=ct([],bt);for(let wt of vt)xt.push(gt(wt));return xt}case Bm:{let xt=ct({},bt);for(let[wt,Ct]of vt)xt[gt(wt)]=gt(Ct);return xt}case Lb:return ct(new Date(vt),bt);case Bb:{let{source:xt,flags:wt}=vt;return ct(new RegExp(xt,wt),bt)}case Fb:{let xt=ct(new Map,bt);for(let[wt,Ct]of vt)xt.set(gt(wt),gt(Ct));return xt}case Hb:{let xt=ct(new Set,bt);for(let wt of vt)xt.add(gt(wt));return xt}case dC:{let{name:xt,message:wt}=vt;return ct(new A$[xt](wt),bt)}case fC:return ct(BigInt(vt),bt);case"BigInt":return ct(Object(BigInt(vt)),bt);case"ArrayBuffer":return ct(new Uint8Array(vt).buffer,vt);case"DataView":{let{buffer:xt}=new Uint8Array(vt);return ct(new DataView(xt),vt)}}return ct(new A$[yt](vt),bt)};return gt},DI=(ot)=>Tme(new Map,ot)(0);var Fm="",{toString:Pme}={},{keys:Ime}=Object,zb=(ot)=>{let st=typeof ot;if(st!=="object"||!ot)return[Lm,st];let ct=Pme.call(ot).slice(8,-1);switch(ct){case"Array":return[kd,Fm];case"Object":return[Bm,Fm];case"Date":return[Lb,Fm];case"RegExp":return[Bb,Fm];case"Map":return[Fb,Fm];case"Set":return[Hb,Fm];case"DataView":return[kd,ct]}if(ct.includes("Array"))return[kd,ct];if(ct.includes("Error"))return[dC,ct];return[Bm,ct]},mC=([ot,st])=>ot===Lm&&(st==="function"||st==="symbol"),Mme=(ot,st,ct,gt)=>{let bt=(vt,xt)=>{let wt=gt.push(vt)-1;return ct.set(xt,wt),wt},yt=(vt)=>{if(ct.has(vt))return ct.get(vt);let[xt,wt]=zb(vt);switch(xt){case Lm:{let St=vt;switch(wt){case"bigint":xt=fC,St=vt.toString();break;case"function":case"symbol":if(ot)throw TypeError("unable to serialize "+wt);St=null;break;case"undefined":return bt([pC],vt)}return bt([xt,St],vt)}case kd:{if(wt){let kt=vt;if(wt==="DataView")kt=new Uint8Array(vt.buffer);else if(wt==="ArrayBuffer")kt=new Uint8Array(vt);return bt([wt,[...kt]],vt)}let St=[],Et=bt([xt,St],vt);for(let kt of vt)St.push(yt(kt));return Et}case Bm:{if(wt)switch(wt){case"BigInt":return bt([wt,vt.toString()],vt);case"Boolean":case"Number":case"String":return bt([wt,vt.valueOf()],vt)}if(st&&"toJSON"in vt)return yt(vt.toJSON());let St=[],Et=bt([xt,St],vt);for(let kt of Ime(vt))if(ot||!mC(zb(vt[kt])))St.push([yt(kt),yt(vt[kt])]);return Et}case Lb:return bt([xt,vt.toISOString()],vt);case Bb:{let{source:St,flags:Et}=vt;return bt([xt,{source:St,flags:Et}],vt)}case Fb:{let St=[],Et=bt([xt,St],vt);for(let[kt,Rt]of vt)if(ot||!(mC(zb(kt))||mC(zb(Rt))))St.push([yt(kt),yt(Rt)]);return Et}case Hb:{let St=[],Et=bt([xt,St],vt);for(let kt of vt)if(ot||!mC(zb(kt)))St.push(yt(kt));return Et}}let{message:Ct}=vt;return bt([xt,{name:wt,message:Ct}],vt)};return yt},_I=(ot,{json:st,lossy:ct}={})=>{let gt=[];return Mme(!(st||ct),!!st,new Map,gt)(ot),gt};var Hm=typeof structuredClone==="function"?(ot,st)=>st&&(("json"in st)||("lossy"in st))?DI(_I(ot,st)):structuredClone(ot):(ot,st)=>DI(_I(ot,st));function Ame(ot,st){let ct=[{type:"text",value:"↩"}];if(st>1)ct.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(st)}]});return ct}function Nme(ot,st){return"Back to reference "+(ot+1)+(st>1?"-"+st:"")}function N$(ot){let st=typeof ot.options.clobberPrefix==="string"?ot.options.clobberPrefix:"user-content-",ct=ot.options.footnoteBackContent||Ame,gt=ot.options.footnoteBackLabel||Nme,bt=ot.options.footnoteLabel||"Footnotes",yt=ot.options.footnoteLabelTagName||"h2",vt=ot.options.footnoteLabelProperties||{className:["sr-only"]},xt=[],wt=-1;while(++wt<ot.footnoteOrder.length){let Ct=ot.footnoteById.get(ot.footnoteOrder[wt]);if(!Ct)continue;let St=ot.all(Ct),Et=String(Ct.identifier).toUpperCase(),kt=ha(Et.toLowerCase()),Rt=0,Tt=[],Pt=ot.footnoteCounts.get(Et);while(Pt!==void 0&&++Rt<=Pt){if(Tt.length>0)Tt.push({type:"text",value:" "});let At=typeof ct==="string"?ct:ct(wt,Rt);if(typeof At==="string")At={type:"text",value:At};Tt.push({type:"element",tagName:"a",properties:{href:"#"+st+"fnref-"+kt+(Rt>1?"-"+Rt:""),dataFootnoteBackref:"",ariaLabel:typeof gt==="string"?gt:gt(wt,Rt),className:["data-footnote-backref"]},children:Array.isArray(At)?At:[At]})}let Mt=St[St.length-1];if(Mt&&Mt.type==="element"&&Mt.tagName==="p"){let At=Mt.children[Mt.children.length-1];if(At&&At.type==="text")At.value+=" ";else Mt.children.push({type:"text",value:" "});Mt.children.push(...Tt)}else St.push(...Tt);let It={type:"element",tagName:"li",properties:{id:st+"fn-"+kt},children:ot.wrap(St,!0)};ot.patch(Ct,It),xt.push(It)}if(xt.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:yt,properties:{...Hm(vt),id:"footnote-label"},children:[{type:"text",value:bt}]},{type:"text",value:`
27
+ `},{type:"element",tagName:"ol",properties:{},children:ot.wrap(xt,!0)},{type:"text",value:`
28
+ `}]}}var Ol=function(ot){if(ot===null||ot===void 0)return Lme;if(typeof ot==="function")return gC(ot);if(typeof ot==="object")return Array.isArray(ot)?Dme(ot):_me(ot);if(typeof ot==="string")return Ome(ot);throw Error("Expected function, string, or object as test")};function Dme(ot){let st=[],ct=-1;while(++ct<ot.length)st[ct]=Ol(ot[ct]);return gC(gt);function gt(...bt){let yt=-1;while(++yt<st.length)if(st[yt].apply(this,bt))return!0;return!1}}function _me(ot){let st=ot;return gC(ct);function ct(gt){let bt=gt,yt;for(yt in ot)if(bt[yt]!==st[yt])return!1;return!0}}function Ome(ot){return gC(st);function st(ct){return ct&&ct.type===ot}}function gC(ot){return st;function st(ct,gt,bt){return Boolean(Bme(ct)&&ot.call(this,ct,typeof gt==="number"?gt:void 0,bt||void 0))}}function Lme(){return!0}function Bme(ot){return ot!==null&&typeof ot==="object"&&"type"in ot}function D$(ot){return ot}var _$=[],hC=!0,Rd=!1,bC="skip";function $b(ot,st,ct,gt){let bt;if(typeof st==="function"&&typeof ct!=="function")gt=ct,ct=st;else bt=st;let yt=Ol(bt),vt=gt?-1:1;xt(ot,void 0,[])();function xt(wt,Ct,St){let Et=wt&&typeof wt==="object"?wt:{};if(typeof Et.type==="string"){let Rt=typeof Et.tagName==="string"?Et.tagName:typeof Et.name==="string"?Et.name:void 0;Object.defineProperty(kt,"name",{value:"node ("+D$(wt.type+(Rt?"<"+Rt+">":""))+")"})}return kt;function kt(){let Rt=_$,Tt,Pt,Mt;if(!st||yt(wt,Ct,St[St.length-1]||void 0)){if(Rt=Fme(ct(wt,St)),Rt[0]===Rd)return Rt}if("children"in wt&&wt.children){let It=wt;if(It.children&&Rt[0]!==bC){Pt=(gt?It.children.length:-1)+vt,Mt=St.concat(It);while(Pt>-1&&Pt<It.children.length){let At=It.children[Pt];if(Tt=xt(At,Pt,Mt)(),Tt[0]===Rd)return Tt;Pt=typeof Tt[1]==="number"?Tt[1]:Pt+vt}}}return Rt}}}function Fme(ot){if(Array.isArray(ot))return ot;if(typeof ot==="number")return[hC,ot];return ot===null||ot===void 0?_$:[ot]}function yc(ot,st,ct,gt){let bt,yt,vt;if(typeof st==="function"&&typeof ct!=="function")yt=void 0,vt=st,bt=ct;else yt=st,vt=ct,bt=gt;$b(ot,yt,xt,bt);function xt(wt,Ct){let St=Ct[Ct.length-1],Et=St?St.children.indexOf(wt):void 0;return vt(wt,Et,St)}}function O$(ot,st){let ct={type:"element",tagName:"blockquote",properties:{},children:ot.wrap(ot.all(st),!0)};return ot.patch(st,ct),ot.applyData(st,ct)}function L$(ot,st){let ct={type:"element",tagName:"br",properties:{},children:[]};return ot.patch(st,ct),[ot.applyData(st,ct),{type:"text",value:`
29
+ `}]}function B$(ot,st){let ct=st.value?st.value+`
30
+ `:"",gt={},bt=st.lang?st.lang.split(/\s+/):[];if(bt.length>0)gt.className=["language-"+bt[0]];let yt={type:"element",tagName:"code",properties:gt,children:[{type:"text",value:ct}]};if(st.meta)yt.data={meta:st.meta};return ot.patch(st,yt),yt=ot.applyData(st,yt),yt={type:"element",tagName:"pre",properties:{},children:[yt]},ot.patch(st,yt),yt}function F$(ot,st){let ct={type:"element",tagName:"del",properties:{},children:ot.all(st)};return ot.patch(st,ct),ot.applyData(st,ct)}function H$(ot,st){let ct={type:"element",tagName:"em",properties:{},children:ot.all(st)};return ot.patch(st,ct),ot.applyData(st,ct)}function z$(ot,st){let ct=typeof ot.options.clobberPrefix==="string"?ot.options.clobberPrefix:"user-content-",gt=String(st.identifier).toUpperCase(),bt=ha(gt.toLowerCase()),yt=ot.footnoteOrder.indexOf(gt),vt,xt=ot.footnoteCounts.get(gt);if(xt===void 0)xt=0,ot.footnoteOrder.push(gt),vt=ot.footnoteOrder.length;else vt=yt+1;xt+=1,ot.footnoteCounts.set(gt,xt);let wt={type:"element",tagName:"a",properties:{href:"#"+ct+"fn-"+bt,id:ct+"fnref-"+bt+(xt>1?"-"+xt:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(vt)}]};ot.patch(st,wt);let Ct={type:"element",tagName:"sup",properties:{},children:[wt]};return ot.patch(st,Ct),ot.applyData(st,Ct)}function $$(ot,st){let ct={type:"element",tagName:"h"+st.depth,properties:{},children:ot.all(st)};return ot.patch(st,ct),ot.applyData(st,ct)}function W$(ot,st){if(ot.options.allowDangerousHtml){let ct={type:"raw",value:st.value};return ot.patch(st,ct),ot.applyData(st,ct)}return}function yC(ot,st){let ct=st.referenceType,gt="]";if(ct==="collapsed")gt+="[]";else if(ct==="full")gt+="["+(st.label||st.identifier)+"]";if(st.type==="imageReference")return[{type:"text",value:"!["+st.alt+gt}];let bt=ot.all(st),yt=bt[0];if(yt&&yt.type==="text")yt.value="["+yt.value;else bt.unshift({type:"text",value:"["});let vt=bt[bt.length-1];if(vt&&vt.type==="text")vt.value+=gt;else bt.push({type:"text",value:gt});return bt}function U$(ot,st){let ct=String(st.identifier).toUpperCase(),gt=ot.definitionById.get(ct);if(!gt)return yC(ot,st);let bt={src:ha(gt.url||""),alt:st.alt};if(gt.title!==null&&gt.title!==void 0)bt.title=gt.title;let yt={type:"element",tagName:"img",properties:bt,children:[]};return ot.patch(st,yt),ot.applyData(st,yt)}function j$(ot,st){let ct={src:ha(st.url)};if(st.alt!==null&&st.alt!==void 0)ct.alt=st.alt;if(st.title!==null&&st.title!==void 0)ct.title=st.title;let gt={type:"element",tagName:"img",properties:ct,children:[]};return ot.patch(st,gt),ot.applyData(st,gt)}function V$(ot,st){let ct={type:"text",value:st.value.replace(/\r?\n|\r/g," ")};ot.patch(st,ct);let gt={type:"element",tagName:"code",properties:{},children:[ct]};return ot.patch(st,gt),ot.applyData(st,gt)}function G$(ot,st){let ct=String(st.identifier).toUpperCase(),gt=ot.definitionById.get(ct);if(!gt)return yC(ot,st);let bt={href:ha(gt.url||"")};if(gt.title!==null&&gt.title!==void 0)bt.title=gt.title;let yt={type:"element",tagName:"a",properties:bt,children:ot.all(st)};return ot.patch(st,yt),ot.applyData(st,yt)}function K$(ot,st){let ct={href:ha(st.url)};if(st.title!==null&&st.title!==void 0)ct.title=st.title;let gt={type:"element",tagName:"a",properties:ct,children:ot.all(st)};return ot.patch(st,gt),ot.applyData(st,gt)}function q$(ot,st,ct){let gt=ot.all(st),bt=ct?Hme(ct):Q$(st),yt={},vt=[];if(typeof st.checked==="boolean"){let St=gt[0],Et;if(St&&St.type==="element"&&St.tagName==="p")Et=St;else Et={type:"element",tagName:"p",properties:{},children:[]},gt.unshift(Et);if(Et.children.length>0)Et.children.unshift({type:"text",value:" "});Et.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:st.checked,disabled:!0},children:[]}),yt.className=["task-list-item"]}let xt=-1;while(++xt<gt.length){let St=gt[xt];if(bt||xt!==0||St.type!=="element"||St.tagName!=="p")vt.push({type:"text",value:`
31
+ `});if(St.type==="element"&&St.tagName==="p"&&!bt)vt.push(...St.children);else vt.push(St)}let wt=gt[gt.length-1];if(wt&&(bt||wt.type!=="element"||wt.tagName!=="p"))vt.push({type:"text",value:`
32
+ `});let Ct={type:"element",tagName:"li",properties:yt,children:vt};return ot.patch(st,Ct),ot.applyData(st,Ct)}function Hme(ot){let st=!1;if(ot.type==="list"){st=ot.spread||!1;let ct=ot.children,gt=-1;while(!st&&++gt<ct.length)st=Q$(ct[gt])}return st}function Q$(ot){let st=ot.spread;return st===null||st===void 0?ot.children.length>1:st}function J$(ot,st){let ct={},gt=ot.all(st),bt=-1;if(typeof st.start==="number"&&st.start!==1)ct.start=st.start;while(++bt<gt.length){let vt=gt[bt];if(vt.type==="element"&&vt.tagName==="li"&&vt.properties&&Array.isArray(vt.properties.className)&&vt.properties.className.includes("task-list-item")){ct.className=["contains-task-list"];break}}let yt={type:"element",tagName:st.ordered?"ol":"ul",properties:ct,children:ot.wrap(gt,!0)};return ot.patch(st,yt),ot.applyData(st,yt)}function X$(ot,st){let ct={type:"element",tagName:"p",properties:{},children:ot.all(st)};return ot.patch(st,ct),ot.applyData(st,ct)}function Y$(ot,st){let ct={type:"root",children:ot.wrap(ot.all(st))};return ot.patch(st,ct),ot.applyData(st,ct)}function Z$(ot,st){let ct={type:"element",tagName:"strong",properties:{},children:ot.all(st)};return ot.patch(st,ct),ot.applyData(st,ct)}function eW(ot,st){let ct=ot.all(st),gt=ct.shift(),bt=[];if(gt){let vt={type:"element",tagName:"thead",properties:{},children:ot.wrap([gt],!0)};ot.patch(st.children[0],vt),bt.push(vt)}if(ct.length>0){let vt={type:"element",tagName:"tbody",properties:{},children:ot.wrap(ct,!0)},xt=_m(st.children[1]),wt=Y1(st.children[st.children.length-1]);if(xt&&wt)vt.position={start:xt,end:wt};bt.push(vt)}let yt={type:"element",tagName:"table",properties:{},children:ot.wrap(bt,!0)};return ot.patch(st,yt),ot.applyData(st,yt)}function tW(ot,st,ct){let gt=ct?ct.children:void 0,yt=(gt?gt.indexOf(st):1)===0?"th":"td",vt=ct&&ct.type==="table"?ct.align:void 0,xt=vt?vt.length:st.children.length,wt=-1,Ct=[];while(++wt<xt){let Et=st.children[wt],kt={},Rt=vt?vt[wt]:void 0;if(Rt)kt.align=Rt;let Tt={type:"element",tagName:yt,properties:kt,children:[]};if(Et)Tt.children=ot.all(Et),ot.patch(Et,Tt),Tt=ot.applyData(Et,Tt);Ct.push(Tt)}let St={type:"element",tagName:"tr",properties:{},children:ot.wrap(Ct,!0)};return ot.patch(st,St),ot.applyData(st,St)}function nW(ot,st){let ct={type:"element",tagName:"td",properties:{},children:ot.all(st)};return ot.patch(st,ct),ot.applyData(st,ct)}function oW(ot){let st=String(ot),ct=/\r?\n|\r/g,gt=ct.exec(st),bt=0,yt=[];while(gt)yt.push(rW(st.slice(bt,gt.index),bt>0,!0),gt[0]),bt=gt.index+gt[0].length,gt=ct.exec(st);return yt.push(rW(st.slice(bt),bt>0,!1)),yt.join("")}function rW(ot,st,ct){let gt=0,bt=ot.length;if(st){let yt=ot.codePointAt(gt);while(yt===9||yt===32)gt++,yt=ot.codePointAt(gt)}if(ct){let yt=ot.codePointAt(bt-1);while(yt===9||yt===32)bt--,yt=ot.codePointAt(bt-1)}return bt>gt?ot.slice(gt,bt):""}function iW(ot,st){let ct={type:"text",value:oW(String(st.value))};return ot.patch(st,ct),ot.applyData(st,ct)}function sW(ot,st){let ct={type:"element",tagName:"hr",properties:{},children:[]};return ot.patch(st,ct),ot.applyData(st,ct)}var aW={blockquote:O$,break:L$,code:B$,delete:F$,emphasis:H$,footnoteReference:z$,heading:$$,html:W$,imageReference:U$,image:j$,inlineCode:V$,linkReference:G$,link:K$,listItem:q$,list:J$,paragraph:X$,root:Y$,strong:Z$,table:eW,tableCell:nW,tableRow:tW,text:iW,thematicBreak:sW,toml:vC,yaml:vC,definition:vC,footnoteDefinition:vC};function vC(){return}var OI={}.hasOwnProperty,zme={};function cW(ot,st){let ct=st||zme,gt=new Map,bt=new Map,yt=new Map,vt={...aW,...ct.handlers},xt={all:Ct,applyData:Wme,definitionById:gt,footnoteById:bt,footnoteCounts:yt,footnoteOrder:[],handlers:vt,one:wt,options:ct,patch:$me,wrap:jme};return yc(ot,function(St){if(St.type==="definition"||St.type==="footnoteDefinition"){let Et=St.type==="definition"?gt:bt,kt=String(St.identifier).toUpperCase();if(!Et.has(kt))Et.set(kt,St)}}),xt;function wt(St,Et){let kt=St.type,Rt=xt.handlers[kt];if(OI.call(xt.handlers,kt)&&Rt)return Rt(xt,St,Et);if(xt.options.passThrough&&xt.options.passThrough.includes(kt)){if("children"in St){let{children:Pt,...Mt}=St,It=Hm(Mt);return It.children=xt.all(St),It}return Hm(St)}return(xt.options.unknownHandler||Ume)(xt,St,Et)}function Ct(St){let Et=[];if("children"in St){let kt=St.children,Rt=-1;while(++Rt<kt.length){let Tt=xt.one(kt[Rt],St);if(Tt){if(Rt&&kt[Rt-1].type==="break"){if(!Array.isArray(Tt)&&Tt.type==="text")Tt.value=lW(Tt.value);if(!Array.isArray(Tt)&&Tt.type==="element"){let Pt=Tt.children[0];if(Pt&&Pt.type==="text")Pt.value=lW(Pt.value)}}if(Array.isArray(Tt))Et.push(...Tt);else Et.push(Tt)}}}return Et}}function $me(ot,st){if(ot.position)st.position=uI(ot)}function Wme(ot,st){let ct=st;if(ot&&ot.data){let gt=ot.data.hName,bt=ot.data.hChildren,yt=ot.data.hProperties;if(typeof gt==="string")if(ct.type==="element")ct.tagName=gt;else{let vt="children"in ct?ct.children:[ct];ct={type:"element",tagName:gt,properties:{},children:vt}}if(ct.type==="element"&&yt)Object.assign(ct.properties,Hm(yt));if("children"in ct&&ct.children&&bt!==null&&bt!==void 0)ct.children=bt}return ct}function Ume(ot,st){let ct=st.data||{},gt="value"in st&&!(OI.call(ct,"hProperties")||OI.call(ct,"hChildren"))?{type:"text",value:st.value}:{type:"element",tagName:"div",properties:{},children:ot.all(st)};return ot.patch(st,gt),ot.applyData(st,gt)}function jme(ot,st){let ct=[],gt=-1;if(st)ct.push({type:"text",value:`
33
+ `});while(++gt<ot.length){if(gt)ct.push({type:"text",value:`
34
+ `});ct.push(ot[gt])}if(st&&ot.length>0)ct.push({type:"text",value:`
35
+ `});return ct}function lW(ot){let st=0,ct=ot.charCodeAt(st);while(ct===9||ct===32)st++,ct=ot.charCodeAt(st);return ot.slice(st)}function xC(ot,st){let ct=cW(ot,st),gt=ct.one(ot,void 0),bt=N$(ct),yt=Array.isArray(gt)?{type:"root",children:gt}:gt||{type:"root",children:[]};if(bt)to("children"in yt),yt.children.push({type:"text",value:`
36
+ `},bt);return yt}function wC(ot,st){if(ot&&"run"in ot)return async function(ct,gt){let bt=xC(ct,{file:gt,...st});await ot.run(bt,gt)};return function(ct,gt){return xC(ct,{file:gt,...ot||st})}}function LI(ot){if(ot)throw ot}var EC=e(yW(),1);function Wb(ot){if(typeof ot!=="object"||ot===null)return!1;let st=Object.getPrototypeOf(ot);return(st===null||st===Object.prototype||Object.getPrototypeOf(st)===null)&&!(Symbol.toStringTag in ot)&&!(Symbol.iterator in ot)}function BI(){let ot=[],st={run:ct,use:gt};return st;function ct(...bt){let yt=-1,vt=bt.pop();if(typeof vt!=="function")throw TypeError("Expected function as last argument, not "+vt);xt(null,...bt);function xt(wt,...Ct){let St=ot[++yt],Et=-1;if(wt){vt(wt);return}while(++Et<bt.length)if(Ct[Et]===null||Ct[Et]===void 0)Ct[Et]=bt[Et];if(bt=Ct,St)vW(St,xt)(...Ct);else vt(null,...Ct)}}function gt(bt){if(typeof bt!=="function")throw TypeError("Expected `middelware` to be a function, not "+bt);return ot.push(bt),st}}function vW(ot,st){let ct;return gt;function gt(...vt){let xt=ot.length>vt.length,wt;if(xt)vt.push(bt);try{wt=ot.apply(this,vt)}catch(Ct){let St=Ct;if(xt&&ct)throw St;return bt(St)}if(!xt)if(wt&&wt.then&&typeof wt.then==="function")wt.then(yt,bt);else if(wt instanceof Error)bt(wt);else yt(wt)}function bt(vt,...xt){if(!ct)ct=!0,st(vt,...xt)}function yt(vt){bt(null,vt)}}var Oa={basename:Vme,dirname:Gme,extname:Kme,join:qme,sep:"/"};function Vme(ot,st){if(st!==void 0&&typeof st!=="string")throw TypeError('"ext" argument must be a string');Ub(ot);let ct=0,gt=-1,bt=ot.length,yt;if(st===void 0||st.length===0||st.length>ot.length){while(bt--)if(ot.codePointAt(bt)===47){if(yt){ct=bt+1;break}}else if(gt<0)yt=!0,gt=bt+1;return gt<0?"":ot.slice(ct,gt)}if(st===ot)return"";let vt=-1,xt=st.length-1;while(bt--)if(ot.codePointAt(bt)===47){if(yt){ct=bt+1;break}}else{if(vt<0)yt=!0,vt=bt+1;if(xt>-1)if(ot.codePointAt(bt)===st.codePointAt(xt--)){if(xt<0)gt=bt}else xt=-1,gt=vt}if(ct===gt)gt=vt;else if(gt<0)gt=ot.length;return ot.slice(ct,gt)}function Gme(ot){if(Ub(ot),ot.length===0)return".";let st=-1,ct=ot.length,gt;while(--ct)if(ot.codePointAt(ct)===47){if(gt){st=ct;break}}else if(!gt)gt=!0;return st<0?ot.codePointAt(0)===47?"/":".":st===1&&ot.codePointAt(0)===47?"//":ot.slice(0,st)}function Kme(ot){Ub(ot);let st=ot.length,ct=-1,gt=0,bt=-1,yt=0,vt;while(st--){let xt=ot.codePointAt(st);if(xt===47){if(vt){gt=st+1;break}continue}if(ct<0)vt=!0,ct=st+1;if(xt===46){if(bt<0)bt=st;else if(yt!==1)yt=1}else if(bt>-1)yt=-1}if(bt<0||ct<0||yt===0||yt===1&&bt===ct-1&&bt===gt+1)return"";return ot.slice(bt,ct)}function qme(...ot){let st=-1,ct;while(++st<ot.length)if(Ub(ot[st]),ot[st])ct=ct===void 0?ot[st]:ct+"/"+ot[st];return ct===void 0?".":Qme(ct)}function Qme(ot){Ub(ot);let st=ot.codePointAt(0)===47,ct=Jme(ot,!st);if(ct.length===0&&!st)ct=".";if(ct.length>0&&ot.codePointAt(ot.length-1)===47)ct+="/";return st?"/"+ct:ct}function Jme(ot,st){let ct="",gt=0,bt=-1,yt=0,vt=-1,xt,wt;while(++vt<=ot.length){if(vt<ot.length)xt=ot.codePointAt(vt);else if(xt===47)break;else xt=47;if(xt===47){if(bt===vt-1||yt===1);else if(bt!==vt-1&&yt===2){if(ct.length<2||gt!==2||ct.codePointAt(ct.length-1)!==46||ct.codePointAt(ct.length-2)!==46){if(ct.length>2){if(wt=ct.lastIndexOf("/"),wt!==ct.length-1){if(wt<0)ct="",gt=0;else ct=ct.slice(0,wt),gt=ct.length-1-ct.lastIndexOf("/");bt=vt,yt=0;continue}}else if(ct.length>0){ct="",gt=0,bt=vt,yt=0;continue}}if(st)ct=ct.length>0?ct+"/..":"..",gt=2}else{if(ct.length>0)ct+="/"+ot.slice(bt+1,vt);else ct=ot.slice(bt+1,vt);gt=vt-bt-1}bt=vt,yt=0}else if(xt===46&&yt>-1)yt++;else yt=-1}return ct}function Ub(ot){if(typeof ot!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(ot))}var xW={cwd:Xme};function Xme(){return"/"}function zm(ot){return Boolean(ot!==null&&typeof ot==="object"&&"href"in ot&&ot.href&&"protocol"in ot&&ot.protocol&&ot.auth===void 0)}function wW(ot){if(typeof ot==="string")ot=new URL(ot);else if(!zm(ot)){let st=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+ot+"`");throw st.code="ERR_INVALID_ARG_TYPE",st}if(ot.protocol!=="file:"){let st=TypeError("The URL must be of scheme file");throw st.code="ERR_INVALID_URL_SCHEME",st}return Yme(ot)}function Yme(ot){if(ot.hostname!==""){let gt=TypeError('File URL host must be "localhost" or empty on darwin');throw gt.code="ERR_INVALID_FILE_URL_HOST",gt}let st=ot.pathname,ct=-1;while(++ct<st.length)if(st.codePointAt(ct)===37&&st.codePointAt(ct+1)===50){let gt=st.codePointAt(ct+2);if(gt===70||gt===102){let bt=TypeError("File URL path must not include encoded / characters");throw bt.code="ERR_INVALID_FILE_URL_PATH",bt}}return decodeURIComponent(st)}var FI=["history","path","basename","stem","extname","dirname"];class $m{constructor(ot){let st;if(!ot)st={};else if(zm(ot))st={path:ot};else if(typeof ot==="string"||Zme(ot))st={value:ot};else st=ot;this.cwd="cwd"in st?"":xW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let ct=-1;while(++ct<FI.length){let bt=FI[ct];if(bt in st&&st[bt]!==void 0&&st[bt]!==null)this[bt]=bt==="history"?[...st[bt]]:st[bt]}let gt;for(gt in st)if(!FI.includes(gt))this[gt]=st[gt]}get basename(){return typeof this.path==="string"?Oa.basename(this.path):void 0}set basename(ot){zI(ot,"basename"),HI(ot,"basename"),this.path=Oa.join(this.dirname||"",ot)}get dirname(){return typeof this.path==="string"?Oa.dirname(this.path):void 0}set dirname(ot){CW(this.basename,"dirname"),this.path=Oa.join(ot||"",this.basename)}get extname(){return typeof this.path==="string"?Oa.extname(this.path):void 0}set extname(ot){if(HI(ot,"extname"),CW(this.dirname,"extname"),ot){if(ot.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(ot.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=Oa.join(this.dirname,this.stem+(ot||""))}get path(){return this.history[this.history.length-1]}set path(ot){if(zm(ot))ot=wW(ot);if(zI(ot,"path"),this.path!==ot)this.history.push(ot)}get stem(){return typeof this.path==="string"?Oa.basename(this.path,this.extname):void 0}set stem(ot){zI(ot,"stem"),HI(ot,"stem"),this.path=Oa.join(this.dirname||"",ot+(this.extname||""))}fail(ot,st,ct){let gt=this.message(ot,st,ct);throw gt.fatal=!0,gt}info(ot,st,ct){let gt=this.message(ot,st,ct);return gt.fatal=void 0,gt}message(ot,st,ct){let gt=new ni(ot,st,ct);if(this.path)gt.name=this.path+":"+gt.name,gt.file=this.path;return gt.fatal=!1,this.messages.push(gt),gt}toString(ot){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(ot||void 0).decode(this.value)}}function HI(ot,st){if(ot&&ot.includes(Oa.sep))throw Error("`"+st+"` cannot be a path: did not expect `"+Oa.sep+"`")}function zI(ot,st){if(!ot)throw Error("`"+st+"` cannot be empty")}function CW(ot,st){if(!ot)throw Error("Setting `"+st+"` requires `path` to be set too")}function Zme(ot){return Boolean(ot&&typeof ot==="object"&&"byteLength"in ot&&"byteOffset"in ot)}var SW=function(ot){let gt=this.constructor.prototype,bt=gt[ot],yt=function(){return bt.apply(yt,arguments)};return Object.setPrototypeOf(yt,gt),yt};var ege={}.hasOwnProperty;class jI extends SW{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=BI()}copy(){let ot=new jI,st=-1;while(++st<this.attachers.length){let ct=this.attachers[st];ot.use(...ct)}return ot.data(EC.default(!0,{},this.namespace)),ot}data(ot,st){if(typeof ot==="string"){if(arguments.length===2)return UI("data",this.frozen),this.namespace[ot]=st,this;return ege.call(this.namespace,ot)&&this.namespace[ot]||void 0}if(ot)return UI("data",this.frozen),this.namespace=ot,this;return this.namespace}freeze(){if(this.frozen)return this;let ot=this;while(++this.freezeIndex<this.attachers.length){let[st,...ct]=this.attachers[this.freezeIndex];if(ct[0]===!1)continue;if(ct[0]===!0)ct[0]=void 0;let gt=st.call(ot,...ct);if(typeof gt==="function")this.transformers.use(gt)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(ot){this.freeze();let st=SC(ot),ct=this.parser||this.Parser;return $I("parse",ct),ct(String(st),st)}process(ot,st){let ct=this;return this.freeze(),$I("process",this.parser||this.Parser),WI("process",this.compiler||this.Compiler),st?gt(void 0,st):new Promise(gt);function gt(bt,yt){let vt=SC(ot),xt=ct.parse(vt);ct.run(xt,vt,function(Ct,St,Et){if(Ct||!St||!Et)return wt(Ct);let kt=St,Rt=ct.stringify(kt,Et);if(nge(Rt))Et.value=Rt;else Et.result=Rt;wt(Ct,Et)});function wt(Ct,St){if(Ct||!St)yt(Ct);else if(bt)bt(St);else to(st,"`done` is defined if `resolve` is not"),st(void 0,St)}}}processSync(ot){let st=!1,ct;return this.freeze(),$I("processSync",this.parser||this.Parser),WI("processSync",this.compiler||this.Compiler),this.process(ot,gt),kW("processSync","process",st),to(ct,"we either bailed on an error or have a tree"),ct;function gt(bt,yt){st=!0,LI(bt),ct=yt}}run(ot,st,ct){EW(ot),this.freeze();let gt=this.transformers;if(!ct&&typeof st==="function")ct=st,st=void 0;return ct?bt(void 0,ct):new Promise(bt);function bt(yt,vt){to(typeof st!=="function","`file` can’t be a `done` anymore, we checked");let xt=SC(st);gt.run(ot,xt,wt);function wt(Ct,St,Et){let kt=St||ot;if(Ct)vt(Ct);else if(yt)yt(kt);else to(ct,"`done` is defined if `resolve` is not"),ct(void 0,kt,Et)}}}runSync(ot,st){let ct=!1,gt;return this.run(ot,st,bt),kW("runSync","run",ct),to(gt,"we either bailed on an error or have a tree"),gt;function bt(yt,vt){LI(yt),gt=vt,ct=!0}}stringify(ot,st){this.freeze();let ct=SC(st),gt=this.compiler||this.Compiler;return WI("stringify",gt),EW(ot),gt(ot,ct)}use(ot,...st){let ct=this.attachers,gt=this.namespace;if(UI("use",this.frozen),ot===null||ot===void 0);else if(typeof ot==="function")xt(ot,st);else if(typeof ot==="object")if(Array.isArray(ot))vt(ot);else yt(ot);else throw TypeError("Expected usable value, not `"+ot+"`");return this;function bt(wt){if(typeof wt==="function")xt(wt,[]);else if(typeof wt==="object")if(Array.isArray(wt)){let[Ct,...St]=wt;xt(Ct,St)}else yt(wt);else throw TypeError("Expected usable value, not `"+wt+"`")}function yt(wt){if(!("plugins"in wt)&&!("settings"in wt))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(vt(wt.plugins),wt.settings)gt.settings=EC.default(!0,gt.settings,wt.settings)}function vt(wt){let Ct=-1;if(wt===null||wt===void 0);else if(Array.isArray(wt))while(++Ct<wt.length){let St=wt[Ct];bt(St)}else throw TypeError("Expected a list of plugins, not `"+wt+"`")}function xt(wt,Ct){let St=-1,Et=-1;while(++St<ct.length)if(ct[St][0]===wt){Et=St;break}if(Et===-1)ct.push([wt,...Ct]);else if(Ct.length>0){let[kt,...Rt]=Ct,Tt=ct[Et][1];if(Wb(Tt)&&Wb(kt))kt=EC.default(!0,Tt,kt);ct[Et]=[wt,kt,...Rt]}}}}var VI=new jI().freeze();function $I(ot,st){if(typeof st!=="function")throw TypeError("Cannot `"+ot+"` without `parser`")}function WI(ot,st){if(typeof st!=="function")throw TypeError("Cannot `"+ot+"` without `compiler`")}function UI(ot,st){if(st)throw Error("Cannot call `"+ot+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function EW(ot){if(!Wb(ot)||typeof ot.type!=="string")throw TypeError("Expected node, got `"+ot+"`")}function kW(ot,st,ct){if(!ct)throw Error("`"+ot+"` finished async. Use `"+st+"` instead")}function SC(ot){return tge(ot)?ot:new $m(ot)}function tge(ot){return Boolean(ot&&typeof ot==="object"&&"message"in ot&&"messages"in ot)}function nge(ot){return typeof ot==="string"||rge(ot)}function rge(ot){return Boolean(ot&&typeof ot==="object"&&"byteLength"in ot&&"byteOffset"in ot)}var oge="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",RW=[],TW={allowDangerousHtml:!0},ige=/^(https?|ircs?|mailto|xmpp)$/i,sge=[{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 kC(ot){let st=age(ot),ct=lge(ot);return cge(st.runSync(st.parse(ct),ct),ot)}function age(ot){let st=ot.rehypePlugins||RW,ct=ot.remarkPlugins||RW,gt=ot.remarkRehypeOptions?{...ot.remarkRehypeOptions,...TW}:TW;return VI().use(uC).use(ct).use(wC,gt).use(st)}function lge(ot){let st=ot.children||"",ct=new $m;if(typeof st==="string")ct.value=st;else G1("Unexpected value `"+st+"` for `children` prop, expected `string`");return ct}function cge(ot,st){let{allowedElements:ct,allowElement:gt,components:bt,disallowedElements:yt,skipHtml:vt,unwrapDisallowed:xt}=st,wt=st.urlTransform||RC;for(let St of sge)if(Object.hasOwn(st,St.from))G1("Unexpected `"+St.from+"` prop, "+(St.to?"use `"+St.to+"` instead":"remove it")+" (see <"+oge+"#"+St.id+"> for more info)");if(ct&&yt)G1("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return yc(ot,Ct),fI(ot,{Fragment:Wm.Fragment,components:bt,ignoreInvalidStyle:!0,jsx:Wm.jsx,jsxs:Wm.jsxs,passKeys:!0,passNode:!0});function Ct(St,Et,kt){if(St.type==="raw"&&kt&&typeof Et==="number"){if(vt)kt.children.splice(Et,1);else kt.children[Et]={type:"text",value:St.value};return Et}if(St.type==="element"){let Rt;for(Rt in Mb)if(Object.hasOwn(Mb,Rt)&&Object.hasOwn(St.properties,Rt)){let Tt=St.properties[Rt],Pt=Mb[Rt];if(Pt===null||Pt.includes(St.tagName))St.properties[Rt]=wt(String(Tt||""),Rt,St)}}if(St.type==="element"){let Rt=ct?!ct.includes(St.tagName):yt?yt.includes(St.tagName):!1;if(!Rt&&gt&&typeof Et==="number")Rt=!gt(St,Et,kt);if(Rt&&kt&&typeof Et==="number"){if(xt&&St.children)kt.children.splice(Et,1,...St.children);else kt.children.splice(Et,1);return Et}}}}function RC(ot){let st=ot.indexOf(":"),ct=ot.indexOf("?"),gt=ot.indexOf("#"),bt=ot.indexOf("/");if(st===-1||bt!==-1&&st>bt||ct!==-1&&st>ct||gt!==-1&&st>gt||ige.test(ot.slice(0,st)))return ot;return""}var TC=function(ot,st,ct){let gt=Ol(ct);if(!ot||!ot.type||!ot.children)throw Error("Expected parent node");if(typeof st==="number"){if(st<0||st===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(st=ot.children.indexOf(st),st<0)throw Error("Expected child node or index");while(++st<ot.children.length)if(gt(ot.children[st],st,ot))return ot.children[st];return};var vc=function(ot){if(ot===null||ot===void 0)return dge;if(typeof ot==="string")return pge(ot);if(typeof ot==="object")return uge(ot);if(typeof ot==="function")return GI(ot);throw Error("Expected function, string, or array as `test`")};function uge(ot){let st=[],ct=-1;while(++ct<ot.length)st[ct]=vc(ot[ct]);return GI(gt);function gt(...bt){let yt=-1;while(++yt<st.length)if(st[yt].apply(this,bt))return!0;return!1}}function pge(ot){return GI(st);function st(ct){return ct.tagName===ot}}function GI(ot){return st;function st(ct,gt,bt){return Boolean(fge(ct)&&ot.call(this,ct,typeof gt==="number"?gt:void 0,bt||void 0))}}function dge(ot){return Boolean(ot&&typeof ot==="object"&&"type"in ot&&ot.type==="element"&&"tagName"in ot&&typeof ot.tagName==="string")}function fge(ot){return ot!==null&&typeof ot==="object"&&"type"in ot&&"tagName"in ot}var IW=/\n/g,MW=/[\t ]+/g,KI=vc("br"),AW=vc(xge),mge=vc("p"),NW=vc("tr"),gge=vc(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",vge,wge]),DW=vc(["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 qI(ot,st){let ct=st||{},gt="children"in ot?ot.children:[],bt=DW(ot),yt=LW(ot,{whitespace:ct.whitespace||"normal",breakBefore:!1,breakAfter:!1}),vt=[];if(ot.type==="text"||ot.type==="comment")vt.push(...OW(ot,{whitespace:yt,breakBefore:!0,breakAfter:!0}));let xt=-1;while(++xt<gt.length)vt.push(..._W(gt[xt],ot,{whitespace:yt,breakBefore:xt?void 0:bt,breakAfter:xt<gt.length-1?KI(gt[xt+1]):bt}));let wt=[],Ct;xt=-1;while(++xt<vt.length){let St=vt[xt];if(typeof St==="number"){if(Ct!==void 0&&St>Ct)Ct=St}else if(St){if(Ct!==void 0&&Ct>-1)wt.push(`
37
+ `.repeat(Ct)||" ");Ct=-1,wt.push(St)}}return wt.join("")}function _W(ot,st,ct){if(ot.type==="element")return hge(ot,st,ct);if(ot.type==="text")return ct.whitespace==="normal"?OW(ot,ct):bge(ot);return[]}function hge(ot,st,ct){let gt=LW(ot,ct),bt=ot.children||[],yt=-1,vt=[];if(gge(ot))return vt;let xt,wt;if(KI(ot))wt=`
38
+ `;else if(NW(ot)&&TC(st,ot,NW))wt=`
39
+ `;else if(mge(ot))xt=2,wt=2;else if(DW(ot))xt=1,wt=1;while(++yt<bt.length)vt=vt.concat(_W(bt[yt],ot,{whitespace:gt,breakBefore:yt?void 0:xt,breakAfter:yt<bt.length-1?KI(bt[yt+1]):wt}));if(AW(ot)&&TC(st,ot,AW))vt.push("\t");if(xt)vt.unshift(xt);if(wt)vt.push(wt);return vt}function OW(ot,st){let ct=String(ot.value),gt=[],bt=[],yt=0;while(yt<=ct.length){IW.lastIndex=yt;let wt=IW.exec(ct),Ct=wt&&"index"in wt?wt.index:ct.length;gt.push(yge(ct.slice(yt,Ct).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),yt===0?st.breakBefore:!0,Ct===ct.length?st.breakAfter:!0)),yt=Ct+1}let vt=-1,xt;while(++vt<gt.length)if(gt[vt].charCodeAt(gt[vt].length-1)===8203||vt<gt.length-1&&gt[vt+1].charCodeAt(0)===8203)bt.push(gt[vt]),xt=void 0;else if(gt[vt]){if(typeof xt==="number")bt.push(xt);bt.push(gt[vt]),xt=0}else if(vt===0||vt===gt.length-1)bt.push(0);return bt}function bge(ot){return[String(ot.value)]}function yge(ot,st,ct){let gt=[],bt=0,yt;while(bt<ot.length){MW.lastIndex=bt;let vt=MW.exec(ot);if(yt=vt?vt.index:ot.length,!bt&&!yt&&vt&&!st)gt.push("");if(bt!==yt)gt.push(ot.slice(bt,yt));bt=vt?yt+vt[0].length:yt}if(bt!==yt&&!ct)gt.push("");return gt.join(" ")}function LW(ot,st){if(ot.type==="element"){let ct=ot.properties||{};switch(ot.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return ct.wrap?"pre-wrap":"pre";case"td":case"th":return ct.noWrap?"nowrap":st.whitespace;case"textarea":return"pre-wrap";default:}}return st.whitespace}function vge(ot){return Boolean((ot.properties||{}).hidden)}function xge(ot){return ot.tagName==="td"||ot.tagName==="th"}function wge(ot){return ot.tagName==="dialog"&&!(ot.properties||{}).open}function Cge(ot){let st=ot.regex,ct=ot.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),gt="decltype\\(auto\\)",bt="[a-zA-Z_]\\w*::",yt="<[^<>]+>",vt="(?!struct)(decltype\\(auto\\)|"+st.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+st.optional("<[^<>]+>")+")",xt={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},wt="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",Ct={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[ot.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:"."},ot.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},St={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},Et={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},ot.inherit(Ct,{className:"string"}),{className:"string",begin:/<.*?>/},ct,ot.C_BLOCK_COMMENT_MODE]},kt={className:"title",begin:st.optional("[a-zA-Z_]\\w*::")+ot.IDENT_RE,relevance:0},Rt=st.optional("[a-zA-Z_]\\w*::")+ot.IDENT_RE+"\\s*\\(",Tt=["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"],Pt=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],Mt=["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"],It=["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"],Ot={type:Pt,keyword:Tt,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:Mt},Dt={className:"function.dispatch",relevance:0,keywords:{_hint:It},begin:st.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,ot.IDENT_RE,st.lookahead(/(<[^<>]+>|)\s*\(/))},_t=[Dt,Et,xt,ct,ot.C_BLOCK_COMMENT_MODE,St,Ct],$t={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:Ot,contains:_t.concat([{begin:/\(/,end:/\)/,keywords:Ot,contains:_t.concat(["self"]),relevance:0}]),relevance:0},Ft={className:"function",begin:"("+vt+"[\\*&\\s]+)+"+Rt,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:Ot,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:Ot,relevance:0},{begin:Rt,returnBegin:!0,contains:[kt],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[Ct,St]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:Ot,relevance:0,contains:[ct,ot.C_BLOCK_COMMENT_MODE,Ct,St,xt,{begin:/\(/,end:/\)/,keywords:Ot,relevance:0,contains:["self",ct,ot.C_BLOCK_COMMENT_MODE,Ct,St,xt]}]},xt,ct,ot.C_BLOCK_COMMENT_MODE,Et]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:Ot,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($t,Ft,Dt,_t,[Et,{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:Ot,contains:["self",xt]},{begin:ot.IDENT_RE+"::",keywords:Ot},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function BW(ot){let st={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"]},ct=Cge(ot),gt=ct.keywords;return gt.type=[...gt.type,...st.type],gt.literal=[...gt.literal,...st.literal],gt.built_in=[...gt.built_in,...st.built_in],gt._hints=st._hints,ct.name="Arduino",ct.aliases=["ino"],ct.supersetOf="cpp",ct}function FW(ot){let st=ot.regex,ct={},gt={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[ct]}]};Object.assign(ct,{className:"variable",variants:[{begin:st.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},gt]});let bt={className:"subst",begin:/\$\(/,end:/\)/,contains:[ot.BACKSLASH_ESCAPE]},yt=ot.inherit(ot.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),vt={begin:/<<-?\s*(?=\w+)/,starts:{contains:[ot.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},xt={className:"string",begin:/"/,end:/"/,contains:[ot.BACKSLASH_ESCAPE,ct,bt]};bt.contains.push(xt);let wt={match:/\\"/},Ct={className:"string",begin:/'/,end:/'/},St={match:/\\'/},Et={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},ot.NUMBER_MODE,ct]},kt=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],Rt=ot.SHEBANG({binary:`(${kt.join("|")})`,relevance:10}),Tt={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[ot.inherit(ot.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},Pt=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],Mt=["true","false"],It={match:/(\/[a-z._-]+)+/},At=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],Nt=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],Ot=["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"],Dt=["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:Pt,literal:Mt,built_in:[...At,...Nt,"set","shopt",...Ot,...Dt]},contains:[Rt,ot.SHEBANG(),Tt,Et,yt,vt,It,xt,wt,Ct,St,ct]}}function HW(ot){let st=ot.regex,ct=ot.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),gt="decltype\\(auto\\)",bt="[a-zA-Z_]\\w*::",yt="<[^<>]+>",vt="(decltype\\(auto\\)|"+st.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+st.optional("<[^<>]+>")+")",xt={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},wt="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",Ct={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[ot.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:"."},ot.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},St={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},Et={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},ot.inherit(Ct,{className:"string"}),{className:"string",begin:/<.*?>/},ct,ot.C_BLOCK_COMMENT_MODE]},kt={className:"title",begin:st.optional("[a-zA-Z_]\\w*::")+ot.IDENT_RE,relevance:0},Rt=st.optional("[a-zA-Z_]\\w*::")+ot.IDENT_RE+"\\s*\\(",Mt={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"},It=[Et,xt,ct,ot.C_BLOCK_COMMENT_MODE,St,Ct],At={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:Mt,contains:It.concat([{begin:/\(/,end:/\)/,keywords:Mt,contains:It.concat(["self"]),relevance:0}]),relevance:0},Nt={begin:"("+vt+"[\\*&\\s]+)+"+Rt,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:Mt,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:Mt,relevance:0},{begin:Rt,returnBegin:!0,contains:[ot.inherit(kt,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:Mt,relevance:0,contains:[ct,ot.C_BLOCK_COMMENT_MODE,Ct,St,xt,{begin:/\(/,end:/\)/,keywords:Mt,relevance:0,contains:["self",ct,ot.C_BLOCK_COMMENT_MODE,Ct,St,xt]}]},xt,ct,ot.C_BLOCK_COMMENT_MODE,Et]};return{name:"C",aliases:["h"],keywords:Mt,disableAutodetect:!0,illegal:"</",contains:[].concat(At,Nt,It,[Et,{begin:ot.IDENT_RE+"::",keywords:Mt},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},ot.TITLE_MODE]}]),exports:{preprocessor:Et,strings:Ct,keywords:Mt}}}function zW(ot){let st=ot.regex,ct=ot.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),gt="decltype\\(auto\\)",bt="[a-zA-Z_]\\w*::",yt="<[^<>]+>",vt="(?!struct)(decltype\\(auto\\)|"+st.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+st.optional("<[^<>]+>")+")",xt={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},wt="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",Ct={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[ot.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:"."},ot.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},St={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},Et={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},ot.inherit(Ct,{className:"string"}),{className:"string",begin:/<.*?>/},ct,ot.C_BLOCK_COMMENT_MODE]},kt={className:"title",begin:st.optional("[a-zA-Z_]\\w*::")+ot.IDENT_RE,relevance:0},Rt=st.optional("[a-zA-Z_]\\w*::")+ot.IDENT_RE+"\\s*\\(",Tt=["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"],Pt=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],Mt=["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"],It=["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"],Ot={type:Pt,keyword:Tt,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:Mt},Dt={className:"function.dispatch",relevance:0,keywords:{_hint:It},begin:st.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,ot.IDENT_RE,st.lookahead(/(<[^<>]+>|)\s*\(/))},_t=[Dt,Et,xt,ct,ot.C_BLOCK_COMMENT_MODE,St,Ct],$t={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:Ot,contains:_t.concat([{begin:/\(/,end:/\)/,keywords:Ot,contains:_t.concat(["self"]),relevance:0}]),relevance:0},Ft={className:"function",begin:"("+vt+"[\\*&\\s]+)+"+Rt,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:Ot,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:Ot,relevance:0},{begin:Rt,returnBegin:!0,contains:[kt],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[Ct,St]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:Ot,relevance:0,contains:[ct,ot.C_BLOCK_COMMENT_MODE,Ct,St,xt,{begin:/\(/,end:/\)/,keywords:Ot,relevance:0,contains:["self",ct,ot.C_BLOCK_COMMENT_MODE,Ct,St,xt]}]},xt,ct,ot.C_BLOCK_COMMENT_MODE,Et]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:Ot,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($t,Ft,Dt,_t,[Et,{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:Ot,contains:["self",xt]},{begin:ot.IDENT_RE+"::",keywords:Ot},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function $W(ot){let st=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],ct=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],gt=["default","false","null","true"],bt=["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"],yt=["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"],vt={keyword:bt.concat(yt),built_in:st,literal:gt},xt=ot.inherit(ot.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),wt={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},Ct={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},St={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},Et=ot.inherit(St,{illegal:/\n/}),kt={className:"subst",begin:/\{/,end:/\}/,keywords:vt},Rt=ot.inherit(kt,{illegal:/\n/}),Tt={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},ot.BACKSLASH_ESCAPE,Rt]},Pt={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},kt]},Mt=ot.inherit(Pt,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},Rt]});kt.contains=[Pt,Tt,St,ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE,wt,ot.C_BLOCK_COMMENT_MODE],Rt.contains=[Mt,Tt,Et,ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE,wt,ot.inherit(ot.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let It={variants:[Ct,Pt,Tt,St,ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE]},At={begin:"<",end:">",contains:[{beginKeywords:"in out"},xt]},Nt=ot.IDENT_RE+"(<"+ot.IDENT_RE+"(\\s*,\\s*"+ot.IDENT_RE+")*>)?(\\[\\])?",Ot={begin:"@"+ot.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:vt,illegal:/::/,contains:[ot.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},It,wt,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},xt,At,ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[xt,ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[xt,At,ot.C_LINE_COMMENT_MODE,ot.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:"("+Nt+"\\s+)+"+ot.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:vt,contains:[{beginKeywords:ct.join(" "),relevance:0},{begin:ot.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[ot.TITLE_MODE,At],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:vt,relevance:0,contains:[It,wt,ot.C_BLOCK_COMMENT_MODE]},ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE]},Ot]}}var Sge=(ot)=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:ot.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:[ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:ot.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_-]*/}}),Ege=["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"],kge=["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"],Rge=[...Ege,...kge],Tge=["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(),Pge=["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(),Ige=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Mge=["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 WW(ot){let st=ot.regex,ct=Sge(ot),gt={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},bt="and or not only",yt=/@-?\w[\w]*(-\w+)*/,vt="[a-zA-Z-][a-zA-Z0-9_-]*",xt=[ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[ct.BLOCK_COMMENT,gt,ct.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},ct.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Pge.join("|")+")"},{begin:":(:)?("+Ige.join("|")+")"}]},ct.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Mge.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[ct.BLOCK_COMMENT,ct.HEXCOLOR,ct.IMPORTANT,ct.CSS_NUMBER_MODE,...xt,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...xt,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},ct.FUNCTION_DISPATCH]},{begin:st.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:yt},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Tge.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...xt,ct.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Rge.join("|")+")\\b"}]}}function UW(ot){let st=ot.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:st.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:st.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 jW(ot){let yt={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:yt,illegal:"</",contains:[ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE,{className:"string",variants:[ot.QUOTE_STRING_MODE,ot.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:[ot.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:yt,illegal:/["']/}]}]}}function VW(ot){let st=ot.regex,ct=/[_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:[ot.HASH_COMMENT_MODE,ot.QUOTE_STRING_MODE,ot.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:st.concat(ct,st.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function GW(ot){let st=ot.regex,ct={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:ot.NUMBER_RE}]},gt=ot.COMMENT();gt.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let bt={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},yt={className:"literal",begin:/\bon|off|true|false|yes|no\b/},vt={className:"string",contains:[ot.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},xt={begin:/\[/,end:/\]/,contains:[gt,yt,bt,vt,ct,"self"],relevance:0},wt=/[A-Za-z0-9_-]+/,Ct=/"(\\"|[^"])*"/,St=/'[^']*'/,Et=st.either(wt,Ct,St),kt=st.concat(Et,"(\\s*\\.\\s*",Et,")*",st.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[gt,{className:"section",begin:/\[+/,end:/\]+/},{begin:kt,className:"attr",starts:{end:/$/,contains:[gt,xt,yt,bt,vt,ct]}}]}}var Um="[0-9](_*[0-9])*",PC=`\\.(${Um})`,IC="[0-9a-fA-F](_*[0-9a-fA-F])*",KW={className:"number",variants:[{begin:`(\\b(${Um})((${PC})|\\.)?|(${PC}))[eE][+-]?(${Um})[fFdD]?\\b`},{begin:`\\b(${Um})((${PC})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${PC})[fFdD]?\\b`},{begin:`\\b(${Um})[fFdD]\\b`},{begin:`\\b0[xX]((${IC})\\.?|(${IC})?\\.(${IC}))[pP][+-]?(${Um})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${IC})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function qW(ot,st,ct){if(ct===-1)return"";return ot.replace(st,(gt)=>qW(ot,st,ct-1))}function QW(ot){let st=ot.regex,ct="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",gt="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+qW("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),wt={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"]},Ct={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},St={className:"params",begin:/\(/,end:/\)/,keywords:wt,relevance:0,contains:[ot.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:wt,illegal:/<\/|#/,contains:[ot.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[ot.BACKSLASH_ESCAPE]},ot.APOS_STRING_MODE,ot.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:[st.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:[St,ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+gt+"\\s+)",ot.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:wt,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:wt,relevance:0,contains:[Ct,ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE,KW,ot.C_BLOCK_COMMENT_MODE]},ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE]},KW,Ct]}}var Age=["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"],Nge=["true","false","null","undefined","NaN","Infinity"],JW=["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"],XW=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],YW=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Dge=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],_ge=[].concat(YW,JW,XW);function ZW(ot){let st=ot.regex,ct=(Qt,{after:Xt})=>{let zt="</"+Qt[0].slice(1);return Qt.input.indexOf(zt,Xt)!==-1},gt="[A-Za-z$_][0-9A-Za-z$_]*",bt={begin:"<>",end:"</>"},yt=/<[A-Za-z0-9\\._:-]+\s*\/>/,vt={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Qt,Xt)=>{let zt=Qt[0].length+Qt.index,tn=Qt.input[zt];if(tn==="<"||tn===","){Xt.ignoreMatch();return}if(tn===">"){if(!ct(Qt,{after:zt}))Xt.ignoreMatch()}let rn,Kt=Qt.input.substring(zt);if(rn=Kt.match(/^\s*=/)){Xt.ignoreMatch();return}if(rn=Kt.match(/^\s+extends\s+/)){if(rn.index===0){Xt.ignoreMatch();return}}}},xt={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:Age,literal:Nge,built_in:_ge,"variable.language":Dge},wt="[0-9](_?[0-9])*",Ct="\\.([0-9](_?[0-9])*)",St="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Et={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},kt={className:"subst",begin:"\\$\\{",end:"\\}",keywords:xt,contains:[]},Rt={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[ot.BACKSLASH_ESCAPE,kt],subLanguage:"xml"}},Tt={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[ot.BACKSLASH_ESCAPE,kt],subLanguage:"css"}},Pt={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[ot.BACKSLASH_ESCAPE,kt],subLanguage:"graphql"}},Mt={className:"string",begin:"`",end:"`",contains:[ot.BACKSLASH_ESCAPE,kt]},At={className:"comment",variants:[ot.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}]}]}),ot.C_BLOCK_COMMENT_MODE,ot.C_LINE_COMMENT_MODE]},Nt=[ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE,Rt,Tt,Pt,Mt,{match:/\$\d+/},Et];kt.contains=Nt.concat({begin:/\{/,end:/\}/,keywords:xt,contains:["self"].concat(Nt)});let Ot=[].concat(At,kt.contains),Dt=Ot.concat([{begin:/(\s*)\(/,end:/\)/,keywords:xt,contains:["self"].concat(Ot)}]),_t={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:xt,contains:Dt},$t={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,st.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",st.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"}}]},Ft={relevance:0,match:st.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:{_:[...JW,...XW]}},Bt={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Lt={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:[_t],illegal:/%/},Vt={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Wt(Qt){return st.concat("(?!",Qt.join("|"),")")}let Ut={match:st.concat(/\b/,Wt([...YW,"super","import"].map((Qt)=>`${Qt}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",st.lookahead(/\s*\(/)),className:"title.function",relevance:0},Ht={begin:st.concat(/\./,st.lookahead(st.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},Gt={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_t]},jt="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+ot.UNDERSCORE_IDENT_RE+")\\s*=>",qt={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,st.lookahead(jt)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_t]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:xt,exports:{PARAMS_CONTAINS:Dt,CLASS_REFERENCE:Ft},illegal:/#(?![$_A-z])/,contains:[ot.SHEBANG({label:"shebang",binary:"node",relevance:5}),Bt,ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE,Rt,Tt,Pt,Mt,At,{match:/\$\d+/},Et,Ft,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+st.lookahead(":"),relevance:0},qt,{begin:"("+ot.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[At,ot.REGEXP_MODE,{className:"function",begin:jt,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:ot.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:xt,contains:Dt}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:bt.begin,end:bt.end},{match:yt},{begin:vt.begin,"on:begin":vt.isTrulyOpeningTag,end:vt.end}],subLanguage:"xml",contains:[{begin:vt.begin,end:vt.end,skip:!0,contains:["self"]}]}]},Lt,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+ot.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_t,ot.inherit(ot.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},Ht,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_t]},Ut,Vt,$t,Gt,{match:/\$[(.]/}]}}function eU(ot){let st={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},ct={match:/[{}[\],:]/,className:"punctuation",relevance:0},gt=["true","false","null"],bt={scope:"literal",beginKeywords:gt.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:gt},contains:[st,ct,ot.QUOTE_STRING_MODE,bt,ot.C_NUMBER_MODE,ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var jm="[0-9](_*[0-9])*",MC=`\\.(${jm})`,AC="[0-9a-fA-F](_*[0-9a-fA-F])*",Oge={className:"number",variants:[{begin:`(\\b(${jm})((${MC})|\\.)?|(${MC}))[eE][+-]?(${jm})[fFdD]?\\b`},{begin:`\\b(${jm})((${MC})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${MC})[fFdD]?\\b`},{begin:`\\b(${jm})[fFdD]\\b`},{begin:`\\b0[xX]((${AC})\\.?|(${AC})?\\.(${AC}))[pP][+-]?(${jm})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${AC})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function tU(ot){let st={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"},ct={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},gt={className:"symbol",begin:ot.UNDERSCORE_IDENT_RE+"@"},bt={className:"subst",begin:/\$\{/,end:/\}/,contains:[ot.C_NUMBER_MODE]},yt={className:"variable",begin:"\\$"+ot.UNDERSCORE_IDENT_RE},vt={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[yt,bt]},{begin:"'",end:"'",illegal:/\n/,contains:[ot.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[ot.BACKSLASH_ESCAPE,yt,bt]}]};bt.contains.push(vt);let xt={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+ot.UNDERSCORE_IDENT_RE+")?"},wt={className:"meta",begin:"@"+ot.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[ot.inherit(vt,{className:"string"}),"self"]}]},Ct=Oge,St=ot.COMMENT("/\\*","\\*/",{contains:[ot.C_BLOCK_COMMENT_MODE]}),Et={variants:[{className:"type",begin:ot.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},kt=Et;return kt.variants[1].contains=[Et],Et.variants[1].contains=[kt],{name:"Kotlin",aliases:["kt","kts"],keywords:st,contains:[ot.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),ot.C_LINE_COMMENT_MODE,St,ct,gt,xt,wt,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:st,relevance:5,contains:[{begin:ot.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[ot.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:st,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[Et,ot.C_LINE_COMMENT_MODE,St],relevance:0},ot.C_LINE_COMMENT_MODE,St,xt,wt,vt,ot.C_NUMBER_MODE]},St]},{begin:[/class|interface|trait/,/\s+/,ot.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},ot.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},xt,wt]},vt,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
40
+ `},Ct]}}var Lge=(ot)=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:ot.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:[ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:ot.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_-]*/}}),Bge=["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"],Fge=["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"],Hge=[...Bge,...Fge],zge=["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(),nU=["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(),rU=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$ge=["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(),Wge=nU.concat(rU).sort().reverse();function oU(ot){let st=Lge(ot),ct=Wge,gt="and or not only",bt="[\\w-]+",yt="([\\w-]+|@\\{[\\w-]+\\})",vt=[],xt=[],wt=function(Nt){return{className:"string",begin:"~?"+Nt+".*?"+Nt}},Ct=function(Nt,Ot,Dt){return{className:Nt,begin:Ot,relevance:Dt}},St={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:zge.join(" ")},Et={begin:"\\(",end:"\\)",contains:xt,keywords:St,relevance:0};xt.push(ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE,wt("'"),wt('"'),st.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},st.HEXCOLOR,Et,Ct("variable","@@?[\\w-]+",10),Ct("variable","@\\{[\\w-]+\\}"),Ct("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},st.IMPORTANT,{beginKeywords:"and not"},st.FUNCTION_DISPATCH);let kt=xt.concat({begin:/\{/,end:/\}/,contains:vt}),Rt={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(xt)},Tt={begin:yt+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},st.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$ge.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:xt}}]},Pt={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:St,returnEnd:!0,contains:xt,relevance:0}},Mt={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:kt}},It={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:yt,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE,Rt,Ct("keyword","all\\b"),Ct("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+Hge.join("|")+")\\b",className:"selector-tag"},st.CSS_NUMBER_MODE,Ct("selector-tag",yt,0),Ct("selector-id","#"+yt),Ct("selector-class","\\."+yt,0),Ct("selector-tag","&",0),st.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+nU.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+rU.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:kt},{begin:"!important"},st.FUNCTION_DISPATCH]},At={begin:`[\\w-]+:(:)?(${ct.join("|")})`,returnBegin:!0,contains:[It]};return vt.push(ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE,Pt,Mt,At,Tt,It,Rt,st.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:vt}}function iU(ot){let gt={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},bt=[ot.COMMENT("--(?!\\[=*\\[)","$"),ot.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[gt],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:ot.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:bt.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[ot.inherit(ot.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:bt}].concat(bt)},ot.C_NUMBER_MODE,ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[gt],relevance:5}])}}function sU(ot){let st={className:"variable",variants:[{begin:"\\$\\("+ot.UNDERSCORE_IDENT_RE+"\\)",contains:[ot.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},ct={className:"string",begin:/"/,end:/"/,contains:[ot.BACKSLASH_ESCAPE,st]},gt={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:[st,ct]},bt={begin:"^"+ot.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},yt={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},vt={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[st]};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:[ot.HASH_COMMENT_MODE,st,ct,gt,bt,yt,vt]}}function aU(ot){let st=ot.regex,ct={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},gt={begin:"^[-\\*]{3,}",end:"$"},bt={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}]},yt={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},vt={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},xt=/[A-Za-z][A-Za-z0-9+.-]*/,wt={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:st.concat(/\[.+?\]\(/,xt,/:\/\/.*?\)/),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}]},Ct={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},St={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},Et=ot.inherit(Ct,{contains:[]}),kt=ot.inherit(St,{contains:[]});Ct.contains.push(kt),St.contains.push(Et);let Rt=[ct,wt];return[Ct,St,Et,kt].forEach((It)=>{It.contains=It.contains.concat(Rt)}),Rt=Rt.concat(Ct,St),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:Rt},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:Rt}]}]},ct,yt,Ct,St,{className:"quote",begin:"^>\\s+",contains:Rt,end:"$"},bt,gt,wt,vt,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function lU(ot){let st={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+"},ct=/[a-zA-Z@][a-zA-Z0-9_]*/,xt={"variable.language":["this","super"],$pattern:ct,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"]},wt={$pattern:ct,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:xt,illegal:"</",contains:[st,ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE,ot.C_NUMBER_MODE,ot.QUOTE_STRING_MODE,ot.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[ot.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},ot.inherit(ot.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+wt.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:wt,contains:[ot.UNDERSCORE_TITLE_MODE]},{begin:"\\."+ot.UNDERSCORE_IDENT_RE,relevance:0}]}}function cU(ot){let st=ot.regex,ct=["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"],gt=/[dualxmsipngr]{0,12}/,bt={$pattern:/[\w.]+/,keyword:ct.join(" ")},yt={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:bt},vt={begin:/->\{/,end:/\}/},xt={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},wt={scope:"variable",variants:[{begin:/\$\d/},{begin:st.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[xt]},Ct={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},St=[ot.BACKSLASH_ESCAPE,yt,wt],Et=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],kt=(Pt,Mt,It="\\1")=>{let At=It==="\\1"?It:st.concat(It,Mt);return st.concat(st.concat("(?:",Pt,")"),Mt,/(?:\\.|[^\\\/])*?/,At,/(?:\\.|[^\\\/])*?/,It,gt)},Rt=(Pt,Mt,It)=>st.concat(st.concat("(?:",Pt,")"),Mt,/(?:\\.|[^\\\/])*?/,It,gt),Tt=[wt,ot.HASH_COMMENT_MODE,ot.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),vt,{className:"string",contains:St,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:[ot.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[ot.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},Ct,{begin:"(\\/\\/|"+ot.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[ot.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:kt("s|tr|y",st.either(...Et,{capture:!0}))},{begin:kt("s|tr|y","\\(","\\)")},{begin:kt("s|tr|y","\\[","\\]")},{begin:kt("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:Rt("(?:m|qr)?",/\//,/\//)},{begin:Rt("m|qr",st.either(...Et,{capture:!0}),/\1/)},{begin:Rt("m|qr",/\(/,/\)/)},{begin:Rt("m|qr",/\[/,/\]/)},{begin:Rt("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[ot.TITLE_MODE,xt]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[ot.TITLE_MODE,xt,Ct]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return yt.contains=Tt,vt.contains=Tt,{name:"Perl",aliases:["pl","pm"],keywords:bt,contains:Tt}}function uU(ot){let st=ot.regex,ct=/(?![A-Za-z0-9])(?![$])/,gt=st.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,ct),bt=st.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,ct),yt=st.concat(/[A-Z]+/,ct),vt={scope:"variable",match:"\\$+"+gt},xt={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},wt={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},Ct=ot.inherit(ot.APOS_STRING_MODE,{illegal:null}),St=ot.inherit(ot.QUOTE_STRING_MODE,{illegal:null,contains:ot.QUOTE_STRING_MODE.contains.concat(wt)}),Et={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:ot.QUOTE_STRING_MODE.contains.concat(wt),"on:begin":(Ht,Gt)=>{Gt.data._beginMatch=Ht[1]||Ht[2]},"on:end":(Ht,Gt)=>{if(Gt.data._beginMatch!==Ht[1])Gt.ignoreMatch()}},kt=ot.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),Rt=`[
41
+ ]`,Tt={scope:"string",variants:[St,Ct,Et,kt]},Pt={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},Mt=["false","null","true"],It=["__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"],At=["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"],Ot={keyword:It,literal:((Ht)=>{let Gt=[];return Ht.forEach((jt)=>{if(Gt.push(jt),jt.toLowerCase()===jt)Gt.push(jt.toUpperCase());else Gt.push(jt.toLowerCase())}),Gt})(Mt),built_in:At},Dt=(Ht)=>Ht.map((Gt)=>Gt.replace(/\|\d+$/,"")),_t={variants:[{match:[/new/,st.concat(`[
42
+ ]`,"+"),st.concat("(?!",Dt(At).join("\\b|"),"\\b)"),bt],scope:{1:"keyword",4:"title.class"}}]},$t=st.concat(gt,"\\b(?!\\()"),Ft={variants:[{match:[st.concat(/::/,st.lookahead(/(?!class\b)/)),$t],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[bt,st.concat(/::/,st.lookahead(/(?!class\b)/)),$t],scope:{1:"title.class",3:"variable.constant"}},{match:[bt,st.concat("::",st.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[bt,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Bt={scope:"attr",match:st.concat(gt,st.lookahead(":"),st.lookahead(/(?!::)/))},Lt={relevance:0,begin:/\(/,end:/\)/,keywords:Ot,contains:[Bt,vt,Ft,ot.C_BLOCK_COMMENT_MODE,Tt,Pt,_t]},Vt={relevance:0,match:[/\b/,st.concat("(?!fn\\b|function\\b|",Dt(It).join("\\b|"),"|",Dt(At).join("\\b|"),"\\b)"),gt,st.concat(`[
43
+ ]`,"*"),st.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[Lt]};Lt.contains.push(Vt);let Wt=[Bt,Ft,ot.C_BLOCK_COMMENT_MODE,Tt,Pt,_t],Ut={begin:st.concat(/#\[\s*\\?/,st.either(bt,yt)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:Mt,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:Mt,keyword:["new","array"]},contains:["self",...Wt]},...Wt,{scope:"meta",variants:[{match:bt},{match:yt}]}]};return{case_insensitive:!1,keywords:Ot,contains:[Ut,ot.HASH_COMMENT_MODE,ot.COMMENT("//","$"),ot.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:ot.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},xt,{scope:"variable.language",match:/\$this\b/},vt,Vt,Ft,{match:[/const/,/\s/,gt],scope:{1:"keyword",3:"variable.constant"}},_t,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},ot.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:Ot,contains:["self",Ut,vt,Ft,ot.C_BLOCK_COMMENT_MODE,Tt,Pt]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},ot.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[ot.inherit(ot.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},ot.UNDERSCORE_TITLE_MODE]},Tt,Pt]}}function pU(ot){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},ot.inherit(ot.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),ot.inherit(ot.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function dU(ot){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function fU(ot){let st=ot.regex,ct=/[\p{XID_Start}_]\p{XID_Continue}*/u,gt=["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"],xt={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:gt,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"]},wt={className:"meta",begin:/^(>>>|\.\.\.) /},Ct={className:"subst",begin:/\{/,end:/\}/,keywords:xt,illegal:/#/},St={begin:/\{\{/,relevance:0},Et={className:"string",contains:[ot.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[ot.BACKSLASH_ESCAPE,wt],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[ot.BACKSLASH_ESCAPE,wt],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[ot.BACKSLASH_ESCAPE,wt,St,Ct]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[ot.BACKSLASH_ESCAPE,wt,St,Ct]},{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:[ot.BACKSLASH_ESCAPE,St,Ct]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[ot.BACKSLASH_ESCAPE,St,Ct]},ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE]},kt="[0-9](_?[0-9])*",Rt="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",Tt=`\\b|${gt.join("|")}`,Pt={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]?(?=${Tt})`},{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]?(?=${Tt})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${Tt})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${Tt})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${Tt})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${Tt})`}]},Mt={className:"comment",begin:st.lookahead(/# type:/),end:/$/,keywords:xt,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},It={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:xt,contains:["self",wt,Pt,Et,ot.HASH_COMMENT_MODE]}]};return Ct.contains=[Et,Pt,wt],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:xt,illegal:/(<\/|\?)|=>/,contains:[wt,Pt,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},Et,Mt,ot.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,ct],scope:{1:"keyword",3:"title.function"},contains:[It]},{variants:[{match:[/\bclass/,/\s+/,ct,/\s*/,/\(\s*/,ct,/\s*\)/]},{match:[/\bclass/,/\s+/,ct]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[Pt,It,Et]}]}}function mU(ot){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function gU(ot){let st=ot.regex,ct=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,gt=st.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]?/),bt=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,yt=st.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:ct,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:[ot.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:st.lookahead(st.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:ct},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),ot.HASH_COMMENT_MODE,{scope:"string",contains:[ot.BACKSLASH_ESCAPE],variants:[ot.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),ot.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),ot.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),ot.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),ot.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),ot.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[bt,gt]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,gt]},{scope:{1:"punctuation",2:"number"},match:[yt,gt]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,gt]}]},{scope:{3:"operator"},match:[ct,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:bt},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:yt},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function hU(ot){let st=ot.regex,ct="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",gt=st.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),bt=st.concat(gt,/(::\w+)*/),vt={"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"]},xt={className:"doctag",begin:"@[A-Za-z]+"},wt={begin:"#<",end:">"},Ct=[ot.COMMENT("#","$",{contains:[xt]}),ot.COMMENT("^=begin","^=end",{contains:[xt],relevance:10}),ot.COMMENT("^__END__",ot.MATCH_NOTHING_RE)],St={className:"subst",begin:/#\{/,end:/\}/,keywords:vt},Et={className:"string",contains:[ot.BACKSLASH_ESCAPE,St],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:st.concat(/<<[-~]?'?/,st.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[ot.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[ot.BACKSLASH_ESCAPE,St]})]}]},kt="[1-9](_?[0-9])*|0",Rt="[0-9](_?[0-9])*",Tt={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"}]},Pt={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:vt}]},_t=[Et,{variants:[{match:[/class\s+/,bt,/\s+<\s+/,bt]},{match:[/\b(class|module)\s+/,bt]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:vt},{match:[/(include|extend)\s+/,bt],scope:{2:"title.class"},keywords:vt},{relevance:0,match:[bt,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:gt,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[Pt]},{begin:ot.IDENT_RE+"::"},{className:"symbol",begin:ot.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[Et,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},Tt,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:vt},{begin:"("+ot.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[ot.BACKSLASH_ESCAPE,St],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(wt,Ct),relevance:0}].concat(wt,Ct);St.contains=_t,Pt.contains=_t;let $t="[>?]>",Ft="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",Bt="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",Lt=[{begin:/^\s*=>/,starts:{end:"$",contains:_t}},{className:"meta.prompt",begin:"^("+$t+"|"+Ft+"|"+Bt+")(?=[ ])",starts:{end:"$",keywords:vt,contains:_t}}];return Ct.unshift(wt),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:vt,illegal:/\/\*/,contains:[ot.SHEBANG({binary:"ruby"})].concat(Lt).concat(Ct).concat(_t)}}function bU(ot){let st=ot.regex,ct=/(r#)?/,gt=st.concat(ct,ot.UNDERSCORE_IDENT_RE),bt=st.concat(ct,ot.IDENT_RE),yt={className:"title.function.invoke",relevance:0,begin:st.concat(/\b/,/(?!let|for|while|if|else|match\b)/,bt,st.lookahead(/\s*\(/))},vt="([ui](8|16|32|64|128|size)|f(32|64))?",xt=["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"],wt=["true","false","Some","None","Ok","Err"],Ct=["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!"],St=["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:ot.IDENT_RE+"!?",type:St,keyword:xt,literal:wt,built_in:Ct},illegal:"</",contains:[ot.C_LINE_COMMENT_MODE,ot.COMMENT("/\\*","\\*/",{contains:["self"]}),ot.inherit(ot.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+/,gt],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[ot.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,gt],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,gt,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,gt],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,gt],className:{1:"keyword",3:"title.class"}},{begin:ot.IDENT_RE+"::",keywords:{keyword:"Self",built_in:Ct,type:St}},{className:"punctuation",begin:"->"},yt]}}var Uge=(ot)=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:ot.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:[ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:ot.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_-]*/}}),jge=["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"],Vge=["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"],Gge=[...jge,...Vge],Kge=["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(),qge=["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(),Qge=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Jge=["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 yU(ot){let st=Uge(ot),ct=Qge,gt=qge,bt="@[a-z-]+",yt="and or not only",vt="[a-zA-Z-][a-zA-Z0-9_-]*",xt={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[ot.C_LINE_COMMENT_MODE,ot.C_BLOCK_COMMENT_MODE,st.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},st.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Gge.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+gt.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ct.join("|")+")"},xt,{begin:/\(/,end:/\)/,contains:[st.CSS_NUMBER_MODE]},st.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Jge.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:[st.BLOCK_COMMENT,xt,st.HEXCOLOR,st.CSS_NUMBER_MODE,ot.QUOTE_STRING_MODE,ot.APOS_STRING_MODE,st.IMPORTANT,st.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:Kge.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},xt,ot.QUOTE_STRING_MODE,ot.APOS_STRING_MODE,st.HEXCOLOR,st.CSS_NUMBER_MODE]},st.FUNCTION_DISPATCH]}}function vU(ot){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function xU(ot){let st=ot.regex,ct=ot.COMMENT("--","$"),gt={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},bt={begin:/"/,end:/"/,contains:[{match:/""/}]},yt=["true","false","unknown"],vt=["double precision","large object","with timezone","without timezone"],xt=["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"],wt=["add","asc","collation","desc","final","first","last","view"],Ct=["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"],St=["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"],Et=["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"],kt=["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"],Rt=St,Tt=[...Ct,...wt].filter((Dt)=>!St.includes(Dt)),Pt={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},Mt={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},It={match:st.concat(/\b/,st.either(...Rt),/\s*\(/),relevance:0,keywords:{built_in:Rt}};function At(Dt){return st.concat(/\b/,st.either(...Dt.map((_t)=>_t.replace(/\s+/,"\\s+"))),/\b/)}let Nt={scope:"keyword",match:At(kt),relevance:0};function Ot(Dt,{exceptions:_t,when:$t}={}){let Ft=$t;return _t=_t||[],Dt.map((Bt)=>{if(Bt.match(/\|\d+$/)||_t.includes(Bt))return Bt;else if(Ft(Bt))return`${Bt}|0`;else return Bt})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:Ot(Tt,{when:(Dt)=>Dt.length<3}),literal:yt,type:xt,built_in:Et},contains:[{scope:"type",match:At(vt)},Nt,It,Pt,gt,bt,ot.C_NUMBER_MODE,ot.C_BLOCK_COMMENT_MODE,ct,Mt]}}function EU(ot){if(!ot)return null;if(typeof ot==="string")return ot;return ot.source}function jb(ot){return ho("(?=",ot,")")}function ho(...ot){return ot.map((ct)=>EU(ct)).join("")}function Xge(ot){let st=ot[ot.length-1];if(typeof st==="object"&&st.constructor===Object)return ot.splice(ot.length-1,1),st;else return{}}function Zi(...ot){return"("+(Xge(ot).capture?"":"?:")+ot.map((gt)=>EU(gt)).join("|")+")"}var XI=(ot)=>ho(/\b/,ot,/\w$/.test(ot)?/\b/:/\B/),Yge=["Protocol","Type"].map(XI),wU=["init","self"].map(XI),Zge=["Any","Self"],QI=["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"],CU=["false","nil","true"],ehe=["assignment","associativity","higherThan","left","lowerThan","none","right"],the=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],SU=["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"],kU=Zi(/[/=\-+!*%<>&|^~?]/,/[\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]/),RU=Zi(kU,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),JI=ho(kU,RU,"*"),TU=Zi(/[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]/),DC=Zi(TU,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ll=ho(TU,DC,"*"),NC=ho(/[A-Z]/,DC,"*"),nhe=["attached","autoclosure",ho(/convention\(/,Zi("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ho(/objc\(/,Ll,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],rhe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function PU(ot){let st={match:/\s+/,relevance:0},ct=ot.COMMENT("/\\*","\\*/",{contains:["self"]}),gt=[ot.C_LINE_COMMENT_MODE,ct],bt={match:[/\./,Zi(...Yge,...wU)],className:{2:"keyword"}},yt={match:ho(/\./,Zi(...QI)),relevance:0},vt=QI.filter((yn)=>typeof yn==="string").concat(["_|0"]),xt=QI.filter((yn)=>typeof yn!=="string").concat(Zge).map(XI),wt={variants:[{className:"keyword",match:Zi(...xt,...wU)}]},Ct={$pattern:Zi(/\b\w+/,/#\w+/),keyword:vt.concat(the),literal:CU},St=[bt,yt,wt],Et={match:ho(/\./,Zi(...SU)),relevance:0},kt={className:"built_in",match:ho(/\b/,Zi(...SU),/(?=\()/)},Rt=[Et,kt],Tt={match:/->/,relevance:0},Pt={className:"operator",relevance:0,variants:[{match:JI},{match:`\\.(\\.|${RU})+`}]},Mt=[Tt,Pt],It="([0-9]_*)+",At="([0-9a-fA-F]_*)+",Nt={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/}]},Ot=(yn="")=>({className:"subst",variants:[{match:ho(/\\/,yn,/[0\\tnr"']/)},{match:ho(/\\/,yn,/u\{[0-9a-fA-F]{1,8}\}/)}]}),Dt=(yn="")=>({className:"subst",match:ho(/\\/,yn,/[\t ]*(?:[\r\n]|\r\n)/)}),_t=(yn="")=>({className:"subst",label:"interpol",begin:ho(/\\/,yn,/\(/),end:/\)/}),$t=(yn="")=>({begin:ho(yn,/"""/),end:ho(/"""/,yn),contains:[Ot(yn),Dt(yn),_t(yn)]}),Ft=(yn="")=>({begin:ho(yn,/"/),end:ho(/"/,yn),contains:[Ot(yn),_t(yn)]}),Bt={className:"string",variants:[$t(),$t("#"),$t("##"),$t("###"),Ft(),Ft("#"),Ft("##"),Ft("###")]},Lt=[ot.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[ot.BACKSLASH_ESCAPE]}],Vt={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Lt},Wt=(yn)=>{let nn=ho(yn,/\//),en=ho(/\//,yn);return{begin:nn,end:en,contains:[...Lt,{scope:"comment",begin:`#(?!.*${en})`,end:/$/}]}},Ut={scope:"regexp",variants:[Wt("###"),Wt("##"),Wt("#"),Vt]},Ht={match:ho(/`/,Ll,/`/)},Gt={className:"variable",match:/\$\d+/},jt={className:"variable",match:`\\$${DC}+`},qt=[Ht,Gt,jt],Qt={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:rhe,contains:[...Mt,Nt,Bt]}]}},Xt={scope:"keyword",match:ho(/@/,Zi(...nhe),jb(Zi(/\(/,/\s+/)))},zt={scope:"meta",match:ho(/@/,Ll)},tn=[Qt,Xt,zt],rn={match:jb(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ho(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,DC,"+")},{className:"type",match:NC,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ho(/\s+&\s+/,jb(NC)),relevance:0}]},Kt={begin:/</,end:/>/,keywords:Ct,contains:[...gt,...St,...tn,Tt,rn]};rn.contains.push(Kt);let an={match:ho(Ll,/\s*:/),keywords:"_|0",relevance:0},ln={begin:/\(/,end:/\)/,relevance:0,keywords:Ct,contains:["self",an,...gt,Ut,...St,...Rt,...Mt,Nt,Bt,...qt,...tn,rn]},Zt={begin:/</,end:/>/,keywords:"repeat each",contains:[...gt,rn]},on={begin:Zi(jb(ho(Ll,/\s*:/)),jb(ho(Ll,/\s+/,Ll,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ll}]},sn={begin:/\(/,end:/\)/,keywords:Ct,contains:[on,...gt,...St,...Mt,Nt,Bt,...tn,rn,ln],endsParent:!0,illegal:/["']/},dn={match:[/(func|macro)/,/\s+/,Zi(Ht.match,Ll,JI)],className:{1:"keyword",3:"title.function"},contains:[Zt,sn,st],illegal:[/\[/,/%/]},fn={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Zt,sn,st],illegal:/\[|%/},bn={match:[/operator/,/\s+/,JI],className:{1:"keyword",3:"title"}},hn={begin:[/precedencegroup/,/\s+/,NC],className:{1:"keyword",3:"title"},contains:[rn],keywords:[...ehe,...CU],end:/}/},gn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},xn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},wn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ll,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:Ct,contains:[Zt,...St,{begin:/:/,end:/\{/,keywords:Ct,contains:[{scope:"title.class.inherited",match:NC},...St],relevance:0}]};for(let yn of Bt.variants){let nn=yn.contains.find((pn)=>pn.label==="interpol");nn.keywords=Ct;let en=[...St,...Rt,...Mt,Nt,Bt,...qt];nn.contains=[...en,{begin:/\(/,end:/\)/,contains:["self",...en]}]}return{name:"Swift",keywords:Ct,contains:[...gt,dn,fn,gn,xn,wn,bn,hn,{beginKeywords:"import",end:/$/,contains:[...gt],relevance:0},Ut,...St,...Rt,...Mt,Nt,Bt,...qt,...tn,rn,ln]}}var IU=["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"],MU=["true","false","null","undefined","NaN","Infinity"],AU=["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"],NU=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],DU=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_U=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],OU=[].concat(DU,AU,NU);function ohe(ot){let st=ot.regex,ct=(Qt,{after:Xt})=>{let zt="</"+Qt[0].slice(1);return Qt.input.indexOf(zt,Xt)!==-1},gt="[A-Za-z$_][0-9A-Za-z$_]*",bt={begin:"<>",end:"</>"},yt=/<[A-Za-z0-9\\._:-]+\s*\/>/,vt={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Qt,Xt)=>{let zt=Qt[0].length+Qt.index,tn=Qt.input[zt];if(tn==="<"||tn===","){Xt.ignoreMatch();return}if(tn===">"){if(!ct(Qt,{after:zt}))Xt.ignoreMatch()}let rn,Kt=Qt.input.substring(zt);if(rn=Kt.match(/^\s*=/)){Xt.ignoreMatch();return}if(rn=Kt.match(/^\s+extends\s+/)){if(rn.index===0){Xt.ignoreMatch();return}}}},xt={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:IU,literal:MU,built_in:OU,"variable.language":_U},wt="[0-9](_?[0-9])*",Ct="\\.([0-9](_?[0-9])*)",St="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",Et={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},kt={className:"subst",begin:"\\$\\{",end:"\\}",keywords:xt,contains:[]},Rt={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[ot.BACKSLASH_ESCAPE,kt],subLanguage:"xml"}},Tt={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[ot.BACKSLASH_ESCAPE,kt],subLanguage:"css"}},Pt={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[ot.BACKSLASH_ESCAPE,kt],subLanguage:"graphql"}},Mt={className:"string",begin:"`",end:"`",contains:[ot.BACKSLASH_ESCAPE,kt]},At={className:"comment",variants:[ot.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}]}]}),ot.C_BLOCK_COMMENT_MODE,ot.C_LINE_COMMENT_MODE]},Nt=[ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE,Rt,Tt,Pt,Mt,{match:/\$\d+/},Et];kt.contains=Nt.concat({begin:/\{/,end:/\}/,keywords:xt,contains:["self"].concat(Nt)});let Ot=[].concat(At,kt.contains),Dt=Ot.concat([{begin:/(\s*)\(/,end:/\)/,keywords:xt,contains:["self"].concat(Ot)}]),_t={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:xt,contains:Dt},$t={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,st.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",st.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"}}]},Ft={relevance:0,match:st.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:{_:[...AU,...NU]}},Bt={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Lt={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:[_t],illegal:/%/},Vt={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Wt(Qt){return st.concat("(?!",Qt.join("|"),")")}let Ut={match:st.concat(/\b/,Wt([...DU,"super","import"].map((Qt)=>`${Qt}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",st.lookahead(/\s*\(/)),className:"title.function",relevance:0},Ht={begin:st.concat(/\./,st.lookahead(st.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},Gt={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_t]},jt="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+ot.UNDERSCORE_IDENT_RE+")\\s*=>",qt={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,st.lookahead(jt)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_t]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:xt,exports:{PARAMS_CONTAINS:Dt,CLASS_REFERENCE:Ft},illegal:/#(?![$_A-z])/,contains:[ot.SHEBANG({label:"shebang",binary:"node",relevance:5}),Bt,ot.APOS_STRING_MODE,ot.QUOTE_STRING_MODE,Rt,Tt,Pt,Mt,At,{match:/\$\d+/},Et,Ft,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+st.lookahead(":"),relevance:0},qt,{begin:"("+ot.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[At,ot.REGEXP_MODE,{className:"function",begin:jt,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:ot.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:xt,contains:Dt}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:bt.begin,end:bt.end},{match:yt},{begin:vt.begin,"on:begin":vt.isTrulyOpeningTag,end:vt.end}],subLanguage:"xml",contains:[{begin:vt.begin,end:vt.end,skip:!0,contains:["self"]}]}]},Lt,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+ot.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_t,ot.inherit(ot.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},Ht,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_t]},Ut,Vt,$t,Gt,{match:/\$[(.]/}]}}function LU(ot){let st=ot.regex,ct=ohe(ot),gt="[A-Za-z$_][0-9A-Za-z$_]*",bt=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],yt={begin:[/namespace/,/\s+/,ot.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},vt={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:bt},contains:[ct.exports.CLASS_REFERENCE]},xt={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},wt=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],Ct={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:IU.concat(wt),literal:MU,built_in:OU.concat(bt),"variable.language":_U},St={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},Et=(Pt,Mt,It)=>{let At=Pt.contains.findIndex((Nt)=>Nt.label===Mt);if(At===-1)throw Error("can not find mode to replace");Pt.contains.splice(At,1,It)};Object.assign(ct.keywords,Ct),ct.exports.PARAMS_CONTAINS.push(St);let kt=ct.contains.find((Pt)=>Pt.scope==="attr"),Rt=Object.assign({},kt,{match:st.concat("[A-Za-z$_][0-9A-Za-z$_]*",st.lookahead(/\s*\?:/))});ct.exports.PARAMS_CONTAINS.push([ct.exports.CLASS_REFERENCE,kt,Rt]),ct.contains=ct.contains.concat([St,yt,vt,Rt]),Et(ct,"shebang",ot.SHEBANG()),Et(ct,"use_strict",xt);let Tt=ct.contains.find((Pt)=>Pt.label==="func.def");return Tt.relevance=0,Object.assign(ct,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),ct}function BU(ot){let st=ot.regex,ct={className:"string",begin:/"(""|[^/n])"C\b/},gt={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},bt=/\d{1,2}\/\d{1,2}\/\d{4}/,yt=/\d{4}-\d{1,2}-\d{1,2}/,vt=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,xt=/\d{1,2}(:\d{1,2}){1,2}/,wt={className:"literal",variants:[{begin:st.concat(/# */,st.either(yt,bt),/ *#/)},{begin:st.concat(/# */,xt,/ *#/)},{begin:st.concat(/# */,vt,/ *#/)},{begin:st.concat(/# */,st.either(yt,bt),/ +/,st.either(vt,xt),/ *#/)}]},Ct={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])|[%&])?/}]},St={className:"label",begin:/^\w+:/},Et=ot.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),kt=ot.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:[ct,gt,wt,Ct,St,Et,kt,{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:[kt]}]}}function FU(ot){ot.regex;let st=ot.COMMENT(/\(;/,/;\)/);st.contains.push("self");let ct=ot.COMMENT(/;;/,/$/),gt=["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"],bt={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},yt={className:"variable",begin:/\$[\w_]+/},vt={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},xt={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/},wt={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},Ct={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:gt},contains:[ct,st,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},yt,vt,bt,ot.QUOTE_STRING_MODE,wt,Ct,xt]}}function HU(ot){let st=ot.regex,ct=st.concat(/[\p{L}_]/u,st.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),gt=/[\p{L}0-9._:-]+/u,bt={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},yt={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},vt=ot.inherit(yt,{begin:/\(/,end:/\)/}),xt=ot.inherit(ot.APOS_STRING_MODE,{className:"string"}),wt=ot.inherit(ot.QUOTE_STRING_MODE,{className:"string"}),Ct={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:gt,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[bt]},{begin:/'/,end:/'/,contains:[bt]},{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:[yt,wt,xt,vt,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[yt,vt,wt,xt]}]}]},ot.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},bt,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[wt]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[Ct],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[Ct],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:st.concat(/</,st.lookahead(st.concat(ct,st.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:ct,relevance:0,starts:Ct}]},{className:"tag",begin:st.concat(/<\//,st.lookahead(st.concat(ct,/>/))),contains:[{className:"name",begin:ct,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function zU(ot){let gt={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},bt={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},yt={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},vt={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[ot.BACKSLASH_ESCAPE,bt]},xt=ot.inherit(vt,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),wt="[0-9]{4}(-[0-9][0-9]){0,2}",Ct="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",St="(\\.[0-9]*)?",Et="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",kt={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"},Rt={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},Tt={begin:/\{/,end:/\}/,contains:[Rt],illegal:"\\n",relevance:0},Pt={begin:"\\[",end:"\\]",contains:[Rt],illegal:"\\n",relevance:0},Mt=[gt,{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:"&"+ot.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+ot.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},ot.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},kt,{className:"number",begin:ot.C_NUMBER_RE+"\\b",relevance:0},Tt,Pt,yt,vt],It=[...Mt];return It.pop(),It.push(xt),Rt.contains=It,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:Mt}}var YI={arduino:BW,bash:FW,c:HW,cpp:zW,csharp:$W,css:WW,diff:UW,go:jW,graphql:VW,ini:GW,java:QW,javascript:ZW,json:eU,kotlin:tU,less:oU,lua:iU,makefile:sU,markdown:aU,objectivec:lU,perl:cU,php:uU,"php-template":pU,plaintext:dU,python:fU,"python-repl":mU,r:gU,ruby:hU,rust:bU,scss:yU,shell:vU,sql:xU,swift:PU,typescript:LU,vbnet:BU,wasm:FU,xml:HU,yaml:zU};var uj=e(cj(),1);var pj=uj.default;var dj={},qhe="hljs-";function iM(ot){let st=pj.newInstance();if(ot)yt(ot);return{highlight:ct,highlightAuto:gt,listLanguages:bt,register:yt,registerAlias:vt,registered:xt};function ct(wt,Ct,St){to(typeof wt==="string","expected `string` as `name`"),to(typeof Ct==="string","expected `string` as `value`");let Et=St||dj,kt=typeof Et.prefix==="string"?Et.prefix:qhe;if(!st.getLanguage(wt))throw Error("Unknown language: `"+wt+"` is not registered");st.configure({__emitter:fj,classPrefix:kt});let Rt=st.highlight(Ct,{ignoreIllegals:!0,language:wt});if(Rt.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:Rt.errorRaised});let Tt=Rt._emitter.root,Pt=Tt.data;return Pt.language=Rt.language,Pt.relevance=Rt.relevance,Tt}function gt(wt,Ct){to(typeof wt==="string","expected `string` as `value`");let Et=(Ct||dj).subset||bt(),kt=-1,Rt=0,Tt;while(++kt<Et.length){let Pt=Et[kt];if(!st.getLanguage(Pt))continue;let Mt=ct(Pt,wt,Ct);if(Mt.data&&Mt.data.relevance!==void 0&&Mt.data.relevance>Rt)Rt=Mt.data.relevance,Tt=Mt}return Tt||{type:"root",children:[],data:{language:void 0,relevance:Rt}}}function bt(){return st.listLanguages()}function yt(wt,Ct){if(typeof wt==="string")to(Ct!==void 0,"expected `grammar`"),st.registerLanguage(wt,Ct);else{let St;for(St in wt)if(Object.hasOwn(wt,St))st.registerLanguage(St,wt[St])}}function vt(wt,Ct){if(typeof wt==="string")to(Ct!==void 0),st.registerAliases(typeof Ct==="string"?Ct:[...Ct],{languageName:wt});else{let St;for(St in wt)if(Object.hasOwn(wt,St)){let Et=wt[St];st.registerAliases(typeof Et==="string"?Et:[...Et],{languageName:St})}}}function xt(wt){return Boolean(st.getLanguage(wt))}}class fj{constructor(ot){this.options=ot,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(ot){if(ot==="")return;let st=this.stack[this.stack.length-1],ct=st.children[st.children.length-1];if(ct&&ct.type==="text")ct.value+=ot;else st.children.push({type:"text",value:ot})}startScope(ot){this.openNode(String(ot))}endScope(){this.closeNode()}__addSublanguage(ot,st){let ct=this.stack[this.stack.length-1],gt=ot.root.children;if(st)ct.children.push({type:"element",tagName:"span",properties:{className:[st]},children:gt});else ct.children.push(...gt)}openNode(ot){let st=this,ct=ot.split(".").map(function(yt,vt){return vt?yt+"_".repeat(vt):st.options.classPrefix+yt}),gt=this.stack[this.stack.length-1],bt={type:"element",tagName:"span",properties:{className:ct},children:[]};gt.children.push(bt),this.stack.push(bt)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var Qhe={};function BC(ot){let st=ot||Qhe,ct=st.aliases,gt=st.detect||!1,bt=st.languages||YI,{plainText:yt,prefix:vt,subset:xt}=st,wt="hljs",Ct=iM(bt);if(ct)Ct.registerAlias(ct);if(vt){let St=vt.indexOf("-");wt=St===-1?vt:vt.slice(0,St)}return function(St,Et){yc(St,"element",function(kt,Rt,Tt){if(kt.tagName!=="code"||!Tt||Tt.type!=="element"||Tt.tagName!=="pre")return;let Pt=Jhe(kt);if(Pt===!1||!Pt&&!gt||Pt&&yt&&yt.includes(Pt))return;if(!Array.isArray(kt.properties.className))kt.properties.className=[];if(!kt.properties.className.includes(wt))kt.properties.className.unshift(wt);let Mt=qI(kt,{whitespace:"pre"}),It;try{It=Pt?Ct.highlight(Pt,Mt,{prefix:vt}):Ct.highlightAuto(Mt,{prefix:vt,subset:xt})}catch(At){let Nt=At;if(Pt&&/Unknown language/.test(Nt.message)){Et.message("Cannot highlight as `"+Pt+"`, it’s not registered",{ancestors:[Tt,kt],cause:Nt,place:kt.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw Nt}if(!Pt&&It.data&&It.data.language)kt.properties.className.push("language-"+It.data.language);if(It.children.length>0)kt.children=It.children})}}function Jhe(ot){let st=ot.properties.className,ct=-1;if(!Array.isArray(st))return;let gt;while(++ct<st.length){let bt=String(st[ct]);if(bt==="no-highlight"||bt==="nohighlight")return!1;if(!gt&&bt.slice(0,5)==="lang-")gt=bt.slice(5);if(!gt&&bt.slice(0,9)==="language-")gt=bt.slice(9)}return gt}function sM(ot,st){let ct=String(ot);if(typeof st!=="string")throw TypeError("Expected character");let gt=0,bt=ct.indexOf(st);while(bt!==-1)gt++,bt=ct.indexOf(st,bt+st.length);return gt}function aM(ot){if(typeof ot!=="string")throw TypeError("Expected a string");return ot.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lM(ot,st,ct){let bt=Ol((ct||{}).ignore||[]),yt=Xhe(st),vt=-1;while(++vt<yt.length)$b(ot,"text",xt);function xt(Ct,St){let Et=-1,kt;while(++Et<St.length){let Rt=St[Et],Tt=kt?kt.children:void 0;if(bt(Rt,Tt?Tt.indexOf(Rt):void 0,kt))return;kt=Rt}if(kt)return wt(Ct,St)}function wt(Ct,St){let Et=St[St.length-1],kt=yt[vt][0],Rt=yt[vt][1],Tt=0,Mt=Et.children.indexOf(Ct),It=!1,At=[];kt.lastIndex=0;let Nt=kt.exec(Ct.value);while(Nt){let Ot=Nt.index,Dt={index:Nt.index,input:Nt.input,stack:[...St,Ct]},_t=Rt(...Nt,Dt);if(typeof _t==="string")_t=_t.length>0?{type:"text",value:_t}:void 0;if(_t===!1)kt.lastIndex=Ot+1;else{if(Tt!==Ot)At.push({type:"text",value:Ct.value.slice(Tt,Ot)});if(Array.isArray(_t))At.push(..._t);else if(_t)At.push(_t);Tt=Ot+Nt[0].length,It=!0}if(!kt.global)break;Nt=kt.exec(Ct.value)}if(It){if(Tt<Ct.value.length)At.push({type:"text",value:Ct.value.slice(Tt)});Et.children.splice(Mt,1,...At)}else At=[Ct];return Mt+At.length}}function Xhe(ot){let st=[];if(!Array.isArray(ot))throw TypeError("Expected find and replace tuple or list of tuples");let ct=!ot[0]||Array.isArray(ot[0])?ot:[ot],gt=-1;while(++gt<ct.length){let bt=ct[gt];st.push([Yhe(bt[0]),Zhe(bt[1])])}return st}function Yhe(ot){return typeof ot==="string"?new RegExp(aM(ot),"g"):ot}function Zhe(ot){return typeof ot==="function"?ot:function(){return ot}}var cM="phrasing",uM=["autolink","link","image","label"];function dM(){return{transforms:[ibe],enter:{literalAutolink:ebe,literalAutolinkEmail:pM,literalAutolinkHttp:pM,literalAutolinkWww:pM},exit:{literalAutolink:obe,literalAutolinkEmail:rbe,literalAutolinkHttp:tbe,literalAutolinkWww:nbe}}}function fM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:cM,notInConstruct:uM},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:cM,notInConstruct:uM},{character:":",before:"[ps]",after:"\\/",inConstruct:cM,notInConstruct:uM}]}}function ebe(ot){this.enter({type:"link",title:null,url:"",children:[]},ot)}function pM(ot){this.config.enter.autolinkProtocol.call(this,ot)}function tbe(ot){this.config.exit.autolinkProtocol.call(this,ot)}function nbe(ot){this.config.exit.data.call(this,ot);let st=this.stack[this.stack.length-1];to(st.type==="link"),st.url="http://"+this.sliceSerialize(ot)}function rbe(ot){this.config.exit.autolinkEmail.call(this,ot)}function obe(ot){this.exit(ot)}function ibe(ot){lM(ot,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,sbe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,abe]],{ignore:["link","linkReference"]})}function sbe(ot,st,ct,gt,bt){let yt="";if(!mj(bt))return!1;if(/^w/i.test(st))ct=st+ct,st="",yt="http://";if(!lbe(ct))return!1;let vt=cbe(ct+gt);if(!vt[0])return!1;let xt={type:"link",title:null,url:yt+st+vt[0],children:[{type:"text",value:st+vt[0]}]};if(vt[1])return[xt,{type:"text",value:vt[1]}];return xt}function abe(ot,st,ct,gt){if(!mj(gt,!0)||/[-\d_]$/.test(ct))return!1;return{type:"link",title:null,url:"mailto:"+st+"@"+ct,children:[{type:"text",value:st+"@"+ct}]}}function lbe(ot){let st=ot.split(".");if(st.length<2||st[st.length-1]&&(/_/.test(st[st.length-1])||!/[a-zA-Z\d]/.test(st[st.length-1]))||st[st.length-2]&&(/_/.test(st[st.length-2])||!/[a-zA-Z\d]/.test(st[st.length-2])))return!1;return!0}function cbe(ot){let st=/[!"&'),.:;<>?\]}]+$/.exec(ot);if(!st)return[ot,void 0];ot=ot.slice(0,st.index);let ct=st[0],gt=ct.indexOf(")"),bt=sM(ot,"("),yt=sM(ot,")");while(gt!==-1&&bt>yt)ot+=ct.slice(0,gt+1),ct=ct.slice(gt+1),gt=ct.indexOf(")"),yt++;return[ot,ct]}function mj(ot,st){let ct=ot.input.charCodeAt(ot.index-1);return(ot.index===0||Dl(ct)||wd(ct))&&(!st||ct!==47)}gj.peek=ybe;function ube(){this.buffer()}function pbe(ot){this.enter({type:"footnoteReference",identifier:"",label:""},ot)}function dbe(){this.buffer()}function fbe(ot){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},ot)}function mbe(ot){let st=this.resume(),ct=this.stack[this.stack.length-1];to(ct.type==="footnoteReference"),ct.identifier=zi(this.sliceSerialize(ot)).toLowerCase(),ct.label=st}function gbe(ot){this.exit(ot)}function hbe(ot){let st=this.resume(),ct=this.stack[this.stack.length-1];to(ct.type==="footnoteDefinition"),ct.identifier=zi(this.sliceSerialize(ot)).toLowerCase(),ct.label=st}function bbe(ot){this.exit(ot)}function ybe(){return"["}function gj(ot,st,ct,gt){let bt=ct.createTracker(gt),yt=bt.move("[^"),vt=ct.enter("footnoteReference"),xt=ct.enter("reference");return yt+=bt.move(ct.safe(ct.associationId(ot),{after:"]",before:yt})),xt(),vt(),yt+=bt.move("]"),yt}function mM(){return{enter:{gfmFootnoteCallString:ube,gfmFootnoteCall:pbe,gfmFootnoteDefinitionLabelString:dbe,gfmFootnoteDefinition:fbe},exit:{gfmFootnoteCallString:mbe,gfmFootnoteCall:gbe,gfmFootnoteDefinitionLabelString:hbe,gfmFootnoteDefinition:bbe}}}function gM(ot){let st=!1;if(ot&&ot.firstLineBlank)st=!0;return{handlers:{footnoteDefinition:ct,footnoteReference:gj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function ct(gt,bt,yt,vt){let xt=yt.createTracker(vt),wt=xt.move("[^"),Ct=yt.enter("footnoteDefinition"),St=yt.enter("label");if(wt+=xt.move(yt.safe(yt.associationId(gt),{before:wt,after:"]"})),St(),wt+=xt.move("]:"),gt.children&&gt.children.length>0)xt.shift(4),wt+=xt.move((st?`
44
+ `:" ")+yt.indentLines(yt.containerFlow(gt,xt.current()),st?hj:vbe));return Ct(),wt}}function vbe(ot,st,ct){return st===0?ot:hj(ot,st,ct)}function hj(ot,st,ct){return(ct?"":" ")+ot}var xbe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bj.peek=Sbe;function hM(){return{canContainEols:["delete"],enter:{strikethrough:wbe},exit:{strikethrough:Cbe}}}function bM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xbe}],handlers:{delete:bj}}}function wbe(ot){this.enter({type:"delete",children:[]},ot)}function Cbe(ot){this.exit(ot)}function bj(ot,st,ct,gt){let bt=ct.createTracker(gt),yt=ct.enter("strikethrough"),vt=bt.move("~~");return vt+=ct.containerPhrasing(ot,{...bt.current(),before:vt,after:"~"}),vt+=bt.move("~~"),yt(),vt}function Sbe(){return"~"}function Ebe(ot){return ot.length}function vj(ot,st){let ct=st||{},gt=(ct.align||[]).concat(),bt=ct.stringLength||Ebe,yt=[],vt=[],xt=[],wt=[],Ct=0,St=-1;while(++St<ot.length){let Pt=[],Mt=[],It=-1;if(ot[St].length>Ct)Ct=ot[St].length;while(++It<ot[St].length){let At=kbe(ot[St][It]);if(ct.alignDelimiters!==!1){let Nt=bt(At);if(Mt[It]=Nt,wt[It]===void 0||Nt>wt[It])wt[It]=Nt}Pt.push(At)}vt[St]=Pt,xt[St]=Mt}let Et=-1;if(typeof gt==="object"&&"length"in gt)while(++Et<Ct)yt[Et]=yj(gt[Et]);else{let Pt=yj(gt);while(++Et<Ct)yt[Et]=Pt}Et=-1;let kt=[],Rt=[];while(++Et<Ct){let Pt=yt[Et],Mt="",It="";if(Pt===99)Mt=":",It=":";else if(Pt===108)Mt=":";else if(Pt===114)It=":";let At=ct.alignDelimiters===!1?1:Math.max(1,wt[Et]-Mt.length-It.length),Nt=Mt+"-".repeat(At)+It;if(ct.alignDelimiters!==!1){if(At=Mt.length+At+It.length,At>wt[Et])wt[Et]=At;Rt[Et]=At}kt[Et]=Nt}vt.splice(1,0,kt),xt.splice(1,0,Rt),St=-1;let Tt=[];while(++St<vt.length){let Pt=vt[St],Mt=xt[St];Et=-1;let It=[];while(++Et<Ct){let At=Pt[Et]||"",Nt="",Ot="";if(ct.alignDelimiters!==!1){let Dt=wt[Et]-(Mt[Et]||0),_t=yt[Et];if(_t===114)Nt=" ".repeat(Dt);else if(_t===99)if(Dt%2)Nt=" ".repeat(Dt/2+0.5),Ot=" ".repeat(Dt/2-0.5);else Nt=" ".repeat(Dt/2),Ot=Nt;else Ot=" ".repeat(Dt)}if(ct.delimiterStart!==!1&&!Et)It.push("|");if(ct.padding!==!1&&!(ct.alignDelimiters===!1&&At==="")&&(ct.delimiterStart!==!1||Et))It.push(" ");if(ct.alignDelimiters!==!1)It.push(Nt);if(It.push(At),ct.alignDelimiters!==!1)It.push(Ot);if(ct.padding!==!1)It.push(" ");if(ct.delimiterEnd!==!1||Et!==Ct-1)It.push("|")}Tt.push(ct.delimiterEnd===!1?It.join("").replace(/ +$/,""):It.join(""))}return Tt.join(`
45
+ `)}function kbe(ot){return ot===null||ot===void 0?"":String(ot)}function yj(ot){let st=typeof ot==="string"?ot.codePointAt(0):0;return st===67||st===99?99:st===76||st===108?108:st===82||st===114?114:0}function xj(ot,st,ct,gt){let bt=ct.enter("blockquote"),yt=ct.createTracker(gt);yt.move("> "),yt.shift(2);let vt=ct.indentLines(ct.containerFlow(ot,yt.current()),Rbe);return bt(),vt}function Rbe(ot,st,ct){return">"+(ct?"":" ")+ot}function Cj(ot,st){return wj(ot,st.inConstruct,!0)&&!wj(ot,st.notInConstruct,!1)}function wj(ot,st,ct){if(typeof st==="string")st=[st];if(!st||st.length===0)return ct;let gt=-1;while(++gt<st.length)if(ot.includes(st[gt]))return!0;return!1}function yM(ot,st,ct,gt){let bt=-1;while(++bt<ct.unsafe.length)if(ct.unsafe[bt].character===`
46
+ `&&Cj(ct.stack,ct.unsafe[bt]))return/[ \t]/.test(gt.before)?"":" ";return"\\\n"}function Sj(ot,st){let ct=String(ot),gt=ct.indexOf(st),bt=gt,yt=0,vt=0;if(typeof st!=="string")throw TypeError("Expected substring");while(gt!==-1){if(gt===bt){if(++yt>vt)vt=yt}else yt=1;bt=gt+st.length,gt=ct.indexOf(st,bt)}return vt}function Ej(ot,st){return Boolean(st.options.fences===!1&&ot.value&&!ot.lang&&/[^ \r\n]/.test(ot.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(ot.value))}function kj(ot){let st=ot.options.fence||"`";if(st!=="`"&&st!=="~")throw Error("Cannot serialize code with `"+st+"` for `options.fence`, expected `` ` `` or `~`");return st}function Rj(ot,st,ct,gt){let bt=kj(ct),yt=ot.value||"",vt=bt==="`"?"GraveAccent":"Tilde";if(Ej(ot,ct)){let Et=ct.enter("codeIndented"),kt=ct.indentLines(yt,Tbe);return Et(),kt}let xt=ct.createTracker(gt),wt=bt.repeat(Math.max(Sj(yt,bt)+1,3)),Ct=ct.enter("codeFenced"),St=xt.move(wt);if(ot.lang){let Et=ct.enter(`codeFencedLang${vt}`);St+=xt.move(ct.safe(ot.lang,{before:St,after:" ",encode:["`"],...xt.current()})),Et()}if(ot.lang&&ot.meta){let Et=ct.enter(`codeFencedMeta${vt}`);St+=xt.move(" "),St+=xt.move(ct.safe(ot.meta,{before:St,after:`
47
+ `,encode:["`"],...xt.current()})),Et()}if(St+=xt.move(`
48
+ `),yt)St+=xt.move(yt+`
49
+ `);return St+=xt.move(wt),Ct(),St}function Tbe(ot,st,ct){return(ct?"":" ")+ot}function Km(ot){let st=ot.options.quote||'"';if(st!=='"'&&st!=="'")throw Error("Cannot serialize title with `"+st+"` for `options.quote`, expected `\"`, or `'`");return st}function Tj(ot,st,ct,gt){let bt=Km(ct),yt=bt==='"'?"Quote":"Apostrophe",vt=ct.enter("definition"),xt=ct.enter("label"),wt=ct.createTracker(gt),Ct=wt.move("[");if(Ct+=wt.move(ct.safe(ct.associationId(ot),{before:Ct,after:"]",...wt.current()})),Ct+=wt.move("]: "),xt(),!ot.url||/[\0- \u007F]/.test(ot.url))xt=ct.enter("destinationLiteral"),Ct+=wt.move("<"),Ct+=wt.move(ct.safe(ot.url,{before:Ct,after:">",...wt.current()})),Ct+=wt.move(">");else xt=ct.enter("destinationRaw"),Ct+=wt.move(ct.safe(ot.url,{before:Ct,after:ot.title?" ":`
50
+ `,...wt.current()}));if(xt(),ot.title)xt=ct.enter(`title${yt}`),Ct+=wt.move(" "+bt),Ct+=wt.move(ct.safe(ot.title,{before:Ct,after:bt,...wt.current()})),Ct+=wt.move(bt),xt();return vt(),Ct}function Pj(ot){let st=ot.options.emphasis||"*";if(st!=="*"&&st!=="_")throw Error("Cannot serialize emphasis with `"+st+"` for `options.emphasis`, expected `*`, or `_`");return st}function Zu(ot){return"&#x"+ot.toString(16).toUpperCase()+";"}function qm(ot,st,ct){let gt=bc(ot),bt=bc(st);if(gt===void 0)return bt===void 0?ct==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:bt===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(gt===1)return bt===void 0?{inside:!1,outside:!1}:bt===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return bt===void 0?{inside:!1,outside:!1}:bt===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vM.peek=Pbe;function vM(ot,st,ct,gt){let bt=Pj(ct),yt=ct.enter("emphasis"),vt=ct.createTracker(gt),xt=vt.move(bt),wt=vt.move(ct.containerPhrasing(ot,{after:bt,before:xt,...vt.current()})),Ct=wt.charCodeAt(0),St=qm(gt.before.charCodeAt(gt.before.length-1),Ct,bt);if(St.inside)wt=Zu(Ct)+wt.slice(1);let Et=wt.charCodeAt(wt.length-1),kt=qm(gt.after.charCodeAt(0),Et,bt);if(kt.inside)wt=wt.slice(0,-1)+Zu(Et);let Rt=vt.move(bt);return yt(),ct.attentionEncodeSurroundingInfo={after:kt.outside,before:St.outside},xt+wt+Rt}function Pbe(ot,st,ct){return ct.options.emphasis||"*"}function Ij(ot,st){let ct=!1;return yc(ot,function(gt){if("value"in gt&&/\r?\n|\r/.test(gt.value)||gt.type==="break")return ct=!0,Rd}),Boolean((!ot.depth||ot.depth<3)&&vd(ot)&&(st.options.setext||ct))}function Mj(ot,st,ct,gt){let bt=Math.max(Math.min(6,ot.depth||1),1),yt=ct.createTracker(gt);if(Ij(ot,ct)){let St=ct.enter("headingSetext"),Et=ct.enter("phrasing"),kt=ct.containerPhrasing(ot,{...yt.current(),before:`
51
+ `,after:`
52
+ `});return Et(),St(),kt+`
53
+ `+(bt===1?"=":"-").repeat(kt.length-(Math.max(kt.lastIndexOf("\r"),kt.lastIndexOf(`
54
+ `))+1))}let vt="#".repeat(bt),xt=ct.enter("headingAtx"),wt=ct.enter("phrasing");yt.move(vt+" ");let Ct=ct.containerPhrasing(ot,{before:"# ",after:`
55
+ `,...yt.current()});if(/^[\t ]/.test(Ct))Ct=Zu(Ct.charCodeAt(0))+Ct.slice(1);if(Ct=Ct?vt+" "+Ct:vt,ct.options.closeAtx)Ct+=" "+vt;return wt(),xt(),Ct}xM.peek=Ibe;function xM(ot){return ot.value||""}function Ibe(){return"<"}wM.peek=Mbe;function wM(ot,st,ct,gt){let bt=Km(ct),yt=bt==='"'?"Quote":"Apostrophe",vt=ct.enter("image"),xt=ct.enter("label"),wt=ct.createTracker(gt),Ct=wt.move("![");if(Ct+=wt.move(ct.safe(ot.alt,{before:Ct,after:"]",...wt.current()})),Ct+=wt.move("]("),xt(),!ot.url&&ot.title||/[\0- \u007F]/.test(ot.url))xt=ct.enter("destinationLiteral"),Ct+=wt.move("<"),Ct+=wt.move(ct.safe(ot.url,{before:Ct,after:">",...wt.current()})),Ct+=wt.move(">");else xt=ct.enter("destinationRaw"),Ct+=wt.move(ct.safe(ot.url,{before:Ct,after:ot.title?" ":")",...wt.current()}));if(xt(),ot.title)xt=ct.enter(`title${yt}`),Ct+=wt.move(" "+bt),Ct+=wt.move(ct.safe(ot.title,{before:Ct,after:bt,...wt.current()})),Ct+=wt.move(bt),xt();return Ct+=wt.move(")"),vt(),Ct}function Mbe(){return"!"}CM.peek=Abe;function CM(ot,st,ct,gt){let bt=ot.referenceType,yt=ct.enter("imageReference"),vt=ct.enter("label"),xt=ct.createTracker(gt),wt=xt.move("!["),Ct=ct.safe(ot.alt,{before:wt,after:"]",...xt.current()});wt+=xt.move(Ct+"]["),vt();let St=ct.stack;ct.stack=[],vt=ct.enter("reference");let Et=ct.safe(ct.associationId(ot),{before:wt,after:"]",...xt.current()});if(vt(),ct.stack=St,yt(),bt==="full"||!Ct||Ct!==Et)wt+=xt.move(Et+"]");else if(bt==="shortcut")wt=wt.slice(0,-1);else wt+=xt.move("]");return wt}function Abe(){return"!"}SM.peek=Nbe;function SM(ot,st,ct){let gt=ot.value||"",bt="`",yt=-1;while(new RegExp("(^|[^`])"+bt+"([^`]|$)").test(gt))bt+="`";if(/[^ \r\n]/.test(gt)&&(/^[ \r\n]/.test(gt)&&/[ \r\n]$/.test(gt)||/^`|`$/.test(gt)))gt=" "+gt+" ";while(++yt<ct.unsafe.length){let vt=ct.unsafe[yt],xt=ct.compilePattern(vt),wt;if(!vt.atBreak)continue;while(wt=xt.exec(gt)){let Ct=wt.index;if(gt.charCodeAt(Ct)===10&&gt.charCodeAt(Ct-1)===13)Ct--;gt=gt.slice(0,Ct)+" "+gt.slice(wt.index+1)}}return bt+gt+bt}function Nbe(){return"`"}function EM(ot,st){let ct=vd(ot);return Boolean(!st.options.resourceLink&&ot.url&&!ot.title&&ot.children&&ot.children.length===1&&ot.children[0].type==="text"&&(ct===ot.url||"mailto:"+ct===ot.url)&&/^[a-z][a-z+.-]+:/i.test(ot.url)&&!/[\0- <>\u007F]/.test(ot.url))}kM.peek=Dbe;function kM(ot,st,ct,gt){let bt=Km(ct),yt=bt==='"'?"Quote":"Apostrophe",vt=ct.createTracker(gt),xt,wt;if(EM(ot,ct)){let St=ct.stack;ct.stack=[],xt=ct.enter("autolink");let Et=vt.move("<");return Et+=vt.move(ct.containerPhrasing(ot,{before:Et,after:">",...vt.current()})),Et+=vt.move(">"),xt(),ct.stack=St,Et}xt=ct.enter("link"),wt=ct.enter("label");let Ct=vt.move("[");if(Ct+=vt.move(ct.containerPhrasing(ot,{before:Ct,after:"](",...vt.current()})),Ct+=vt.move("]("),wt(),!ot.url&&ot.title||/[\0- \u007F]/.test(ot.url))wt=ct.enter("destinationLiteral"),Ct+=vt.move("<"),Ct+=vt.move(ct.safe(ot.url,{before:Ct,after:">",...vt.current()})),Ct+=vt.move(">");else wt=ct.enter("destinationRaw"),Ct+=vt.move(ct.safe(ot.url,{before:Ct,after:ot.title?" ":")",...vt.current()}));if(wt(),ot.title)wt=ct.enter(`title${yt}`),Ct+=vt.move(" "+bt),Ct+=vt.move(ct.safe(ot.title,{before:Ct,after:bt,...vt.current()})),Ct+=vt.move(bt),wt();return Ct+=vt.move(")"),xt(),Ct}function Dbe(ot,st,ct){return EM(ot,ct)?"<":"["}RM.peek=_be;function RM(ot,st,ct,gt){let bt=ot.referenceType,yt=ct.enter("linkReference"),vt=ct.enter("label"),xt=ct.createTracker(gt),wt=xt.move("["),Ct=ct.containerPhrasing(ot,{before:wt,after:"]",...xt.current()});wt+=xt.move(Ct+"]["),vt();let St=ct.stack;ct.stack=[],vt=ct.enter("reference");let Et=ct.safe(ct.associationId(ot),{before:wt,after:"]",...xt.current()});if(vt(),ct.stack=St,yt(),bt==="full"||!Ct||Ct!==Et)wt+=xt.move(Et+"]");else if(bt==="shortcut")wt=wt.slice(0,-1);else wt+=xt.move("]");return wt}function _be(){return"["}function Qm(ot){let st=ot.options.bullet||"*";if(st!=="*"&&st!=="+"&&st!=="-")throw Error("Cannot serialize items with `"+st+"` for `options.bullet`, expected `*`, `+`, or `-`");return st}function Aj(ot){let st=Qm(ot),ct=ot.options.bulletOther;if(!ct)return st==="*"?"-":"*";if(ct!=="*"&&ct!=="+"&&ct!=="-")throw Error("Cannot serialize items with `"+ct+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(ct===st)throw Error("Expected `bullet` (`"+st+"`) and `bulletOther` (`"+ct+"`) to be different");return ct}function Nj(ot){let st=ot.options.bulletOrdered||".";if(st!=="."&&st!==")")throw Error("Cannot serialize items with `"+st+"` for `options.bulletOrdered`, expected `.` or `)`");return st}function FC(ot){let st=ot.options.rule||"*";if(st!=="*"&&st!=="-"&&st!=="_")throw Error("Cannot serialize rules with `"+st+"` for `options.rule`, expected `*`, `-`, or `_`");return st}function Dj(ot,st,ct,gt){let bt=ct.enter("list"),yt=ct.bulletCurrent,vt=ot.ordered?Nj(ct):Qm(ct),xt=ot.ordered?vt==="."?")":".":Aj(ct),wt=st&&ct.bulletLastUsed?vt===ct.bulletLastUsed:!1;if(!ot.ordered){let St=ot.children?ot.children[0]:void 0;if((vt==="*"||vt==="-")&&St&&(!St.children||!St.children[0])&&ct.stack[ct.stack.length-1]==="list"&&ct.stack[ct.stack.length-2]==="listItem"&&ct.stack[ct.stack.length-3]==="list"&&ct.stack[ct.stack.length-4]==="listItem"&&ct.indexStack[ct.indexStack.length-1]===0&&ct.indexStack[ct.indexStack.length-2]===0&&ct.indexStack[ct.indexStack.length-3]===0)wt=!0;if(FC(ct)===vt&&St){let Et=-1;while(++Et<ot.children.length){let kt=ot.children[Et];if(kt&&kt.type==="listItem"&&kt.children&&kt.children[0]&&kt.children[0].type==="thematicBreak"){wt=!0;break}}}}if(wt)vt=xt;ct.bulletCurrent=vt;let Ct=ct.containerFlow(ot,gt);return ct.bulletLastUsed=vt,ct.bulletCurrent=yt,bt(),Ct}function _j(ot){let st=ot.options.listItemIndent||"one";if(st!=="tab"&&st!=="one"&&st!=="mixed")throw Error("Cannot serialize items with `"+st+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return st}function Oj(ot,st,ct,gt){let bt=_j(ct),yt=ct.bulletCurrent||Qm(ct);if(st&&st.type==="list"&&st.ordered)yt=(typeof st.start==="number"&&st.start>-1?st.start:1)+(ct.options.incrementListMarker===!1?0:st.children.indexOf(ot))+yt;let vt=yt.length+1;if(bt==="tab"||bt==="mixed"&&(st&&st.type==="list"&&st.spread||ot.spread))vt=Math.ceil(vt/4)*4;let xt=ct.createTracker(gt);xt.move(yt+" ".repeat(vt-yt.length)),xt.shift(vt);let wt=ct.enter("listItem"),Ct=ct.indentLines(ct.containerFlow(ot,xt.current()),St);return wt(),Ct;function St(Et,kt,Rt){if(kt)return(Rt?"":" ".repeat(vt))+Et;return(Rt?yt:yt+" ".repeat(vt-yt.length))+Et}}function Lj(ot,st,ct,gt){let bt=ct.enter("paragraph"),yt=ct.enter("phrasing"),vt=ct.containerPhrasing(ot,gt);return yt(),bt(),vt}var TM=Ol(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Bj(ot,st,ct,gt){return(ot.children.some(function(vt){return TM(vt)})?ct.containerPhrasing:ct.containerFlow).call(ct,ot,gt)}function Fj(ot){let st=ot.options.strong||"*";if(st!=="*"&&st!=="_")throw Error("Cannot serialize strong with `"+st+"` for `options.strong`, expected `*`, or `_`");return st}PM.peek=Obe;function PM(ot,st,ct,gt){let bt=Fj(ct),yt=ct.enter("strong"),vt=ct.createTracker(gt),xt=vt.move(bt+bt),wt=vt.move(ct.containerPhrasing(ot,{after:bt,before:xt,...vt.current()})),Ct=wt.charCodeAt(0),St=qm(gt.before.charCodeAt(gt.before.length-1),Ct,bt);if(St.inside)wt=Zu(Ct)+wt.slice(1);let Et=wt.charCodeAt(wt.length-1),kt=qm(gt.after.charCodeAt(0),Et,bt);if(kt.inside)wt=wt.slice(0,-1)+Zu(Et);let Rt=vt.move(bt+bt);return yt(),ct.attentionEncodeSurroundingInfo={after:kt.outside,before:St.outside},xt+wt+Rt}function Obe(ot,st,ct){return ct.options.strong||"*"}function Hj(ot,st,ct,gt){return ct.safe(ot.value,gt)}function zj(ot){let st=ot.options.ruleRepetition||3;if(st<3)throw Error("Cannot serialize rules with repetition `"+st+"` for `options.ruleRepetition`, expected `3` or more");return st}function $j(ot,st,ct){let gt=(FC(ct)+(ct.options.ruleSpaces?" ":"")).repeat(zj(ct));return ct.options.ruleSpaces?gt.slice(0,-1):gt}var Kb={blockquote:xj,break:yM,code:Rj,definition:Tj,emphasis:vM,hardBreak:yM,heading:Mj,html:xM,image:wM,imageReference:CM,inlineCode:SM,link:kM,linkReference:RM,list:Dj,listItem:Oj,paragraph:Lj,root:Bj,strong:PM,text:Hj,thematicBreak:$j};function MM(){return{enter:{table:Lbe,tableData:Wj,tableHeader:Wj,tableRow:Fbe},exit:{codeText:Hbe,table:Bbe,tableData:IM,tableHeader:IM,tableRow:IM}}}function Lbe(ot){let st=ot._align;to(st,"expected `_align` on table"),this.enter({type:"table",align:st.map(function(ct){return ct==="none"?null:ct}),children:[]},ot),this.data.inTable=!0}function Bbe(ot){this.exit(ot),this.data.inTable=void 0}function Fbe(ot){this.enter({type:"tableRow",children:[]},ot)}function IM(ot){this.exit(ot)}function Wj(ot){this.enter({type:"tableCell",children:[]},ot)}function Hbe(ot){let st=this.resume();if(this.data.inTable)st=st.replace(/\\([\\|])/g,zbe);let ct=this.stack[this.stack.length-1];to(ct.type==="inlineCode"),ct.value=st,this.exit(ot)}function zbe(ot,st){return st==="|"?st:ot}function AM(ot){let st=ot||{},{tableCellPadding:ct,tablePipeAlign:gt,stringLength:bt}=st,yt=ct?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
56
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:kt,table:vt,tableCell:wt,tableRow:xt}};function vt(Rt,Tt,Pt,Mt){return Ct(St(Rt,Pt,Mt),Rt.align)}function xt(Rt,Tt,Pt,Mt){let It=Et(Rt,Pt,Mt),At=Ct([It]);return At.slice(0,At.indexOf(`
57
+ `))}function wt(Rt,Tt,Pt,Mt){let It=Pt.enter("tableCell"),At=Pt.enter("phrasing"),Nt=Pt.containerPhrasing(Rt,{...Mt,before:yt,after:yt});return At(),It(),Nt}function Ct(Rt,Tt){return vj(Rt,{align:Tt,alignDelimiters:gt,padding:ct,stringLength:bt})}function St(Rt,Tt,Pt){let Mt=Rt.children,It=-1,At=[],Nt=Tt.enter("table");while(++It<Mt.length)At[It]=Et(Mt[It],Tt,Pt);return Nt(),At}function Et(Rt,Tt,Pt){let Mt=Rt.children,It=-1,At=[],Nt=Tt.enter("tableRow");while(++It<Mt.length)At[It]=wt(Mt[It],Rt,Tt,Pt);return Nt(),At}function kt(Rt,Tt,Pt){let Mt=Kb.inlineCode(Rt,Tt,Pt);if(Pt.stack.includes("tableCell"))Mt=Mt.replace(/\|/g,"\\$&");return Mt}}function NM(){return{exit:{taskListCheckValueChecked:Uj,taskListCheckValueUnchecked:Uj,paragraph:$be}}}function DM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Wbe}}}function Uj(ot){let st=this.stack[this.stack.length-2];to(st.type==="listItem"),st.checked=ot.type==="taskListCheckValueChecked"}function $be(ot){let st=this.stack[this.stack.length-2];if(st&&st.type==="listItem"&&typeof st.checked==="boolean"){let ct=this.stack[this.stack.length-1];to(ct.type==="paragraph");let gt=ct.children[0];if(gt&&gt.type==="text"){let bt=st.children,yt=-1,vt;while(++yt<bt.length){let xt=bt[yt];if(xt.type==="paragraph"){vt=xt;break}}if(vt===ct){if(gt.value=gt.value.slice(1),gt.value.length===0)ct.children.shift();else if(ct.position&&gt.position&&typeof gt.position.start.offset==="number")gt.position.start.column++,gt.position.start.offset++,ct.position.start=Object.assign({},gt.position.start)}}}this.exit(ot)}function Wbe(ot,st,ct,gt){let bt=ot.children[0],yt=typeof ot.checked==="boolean"&&bt&&bt.type==="paragraph",vt="["+(ot.checked?"x":" ")+"] ",xt=ct.createTracker(gt);if(yt)xt.move(vt);let wt=Kb.listItem(ot,st,ct,{...gt,...xt.current()});if(yt)wt=wt.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,Ct);return wt;function Ct(St){return St+vt}}function _M(){return[dM(),mM(),hM(),MM(),NM()]}function OM(ot){return{extensions:[fM(),gM(ot),bM(),AM(ot),DM()]}}var Ube={tokenize:qbe,partial:!0},jj={tokenize:Qbe,partial:!0},Vj={tokenize:Jbe,partial:!0},Gj={tokenize:Xbe,partial:!0},jbe={tokenize:Ybe,partial:!0},Kj={name:"wwwAutolink",tokenize:Gbe,previous:Qj},qj={name:"protocolAutolink",tokenize:Kbe,previous:Jj},xc={name:"emailAutolink",tokenize:Vbe,previous:Xj},Bl={};function BM(){return{text:Bl}}var Id=48;while(Id<123)if(Bl[Id]=xc,Id++,Id===58)Id=65;else if(Id===91)Id=97;Bl[43]=xc;Bl[45]=xc;Bl[46]=xc;Bl[95]=xc;Bl[72]=[xc,qj];Bl[104]=[xc,qj];Bl[87]=[xc,Kj];Bl[119]=[xc,Kj];function Vbe(ot,st,ct){let gt=this,bt,yt;return vt;function vt(Et){if(!LM(Et)||!Xj.call(gt,gt.previous)||FM(gt.events))return ct(Et);return ot.enter("literalAutolink"),ot.enter("literalAutolinkEmail"),xt(Et)}function xt(Et){if(LM(Et))return ot.consume(Et),xt;if(Et===64)return ot.consume(Et),wt;return ct(Et)}function wt(Et){if(Et===46)return ot.check(jbe,St,Ct)(Et);if(Et===45||Et===95||Fo(Et))return yt=!0,ot.consume(Et),wt;return St(Et)}function Ct(Et){return ot.consume(Et),bt=!0,wt}function St(Et){if(yt&&bt&&ai(gt.previous))return ot.exit("literalAutolinkEmail"),ot.exit("literalAutolink"),st(Et);return ct(Et)}}function Gbe(ot,st,ct){let gt=this;return bt;function bt(vt){if(vt!==87&&vt!==119||!Qj.call(gt,gt.previous)||FM(gt.events))return ct(vt);return ot.enter("literalAutolink"),ot.enter("literalAutolinkWww"),ot.check(Ube,ot.attempt(jj,ot.attempt(Vj,yt),ct),ct)(vt)}function yt(vt){return ot.exit("literalAutolinkWww"),ot.exit("literalAutolink"),st(vt)}}function Kbe(ot,st,ct){let gt=this,bt="",yt=!1;return vt;function vt(Et){if((Et===72||Et===104)&&Jj.call(gt,gt.previous)&&!FM(gt.events))return ot.enter("literalAutolink"),ot.enter("literalAutolinkHttp"),bt+=String.fromCodePoint(Et),ot.consume(Et),xt;return ct(Et)}function xt(Et){if(ai(Et)&&bt.length<5)return bt+=String.fromCodePoint(Et),ot.consume(Et),xt;if(Et===58){let kt=bt.toLowerCase();if(kt==="http"||kt==="https")return ot.consume(Et),wt}return ct(Et)}function wt(Et){if(Et===47){if(ot.consume(Et),yt)return Ct;return yt=!0,wt}return ct(Et)}function Ct(Et){return Et===null||xd(Et)||Or(Et)||Dl(Et)||wd(Et)?ct(Et):ot.attempt(jj,ot.attempt(Vj,St),ct)(Et)}function St(Et){return ot.exit("literalAutolinkHttp"),ot.exit("literalAutolink"),st(Et)}}function qbe(ot,st,ct){let gt=0;return bt;function bt(vt){if((vt===87||vt===119)&&gt<3)return gt++,ot.consume(vt),bt;if(vt===46&&gt===3)return ot.consume(vt),yt;return ct(vt)}function yt(vt){return vt===null?ct(vt):st(vt)}}function Qbe(ot,st,ct){let gt,bt,yt;return vt;function vt(Ct){if(Ct===46||Ct===95)return ot.check(Gj,wt,xt)(Ct);if(Ct===null||Or(Ct)||Dl(Ct)||Ct!==45&&wd(Ct))return wt(Ct);return yt=!0,ot.consume(Ct),vt}function xt(Ct){if(Ct===95)gt=!0;else bt=gt,gt=void 0;return ot.consume(Ct),vt}function wt(Ct){if(bt||gt||!yt)return ct(Ct);return st(Ct)}}function Jbe(ot,st){let ct=0,gt=0;return bt;function bt(vt){if(vt===40)return ct++,ot.consume(vt),bt;if(vt===41&&gt<ct)return yt(vt);if(vt===33||vt===34||vt===38||vt===39||vt===41||vt===42||vt===44||vt===46||vt===58||vt===59||vt===60||vt===63||vt===93||vt===95||vt===126)return ot.check(Gj,st,yt)(vt);if(vt===null||Or(vt)||Dl(vt))return st(vt);return ot.consume(vt),bt}function yt(vt){if(vt===41)gt++;return ot.consume(vt),bt}}function Xbe(ot,st,ct){return gt;function gt(xt){if(xt===33||xt===34||xt===39||xt===41||xt===42||xt===44||xt===46||xt===58||xt===59||xt===63||xt===95||xt===126)return ot.consume(xt),gt;if(xt===38)return ot.consume(xt),yt;if(xt===93)return ot.consume(xt),bt;if(xt===60||xt===null||Or(xt)||Dl(xt))return st(xt);return ct(xt)}function bt(xt){if(xt===null||xt===40||xt===91||Or(xt)||Dl(xt))return st(xt);return gt(xt)}function yt(xt){return ai(xt)?vt(xt):ct(xt)}function vt(xt){if(xt===59)return ot.consume(xt),gt;if(ai(xt))return ot.consume(xt),vt;return ct(xt)}}function Ybe(ot,st,ct){return gt;function gt(yt){return ot.consume(yt),bt}function bt(yt){return Fo(yt)?ct(yt):st(yt)}}function Qj(ot){return ot===null||ot===40||ot===42||ot===95||ot===91||ot===93||ot===126||Or(ot)}function Jj(ot){return!ai(ot)}function Xj(ot){return!(ot===47||LM(ot))}function LM(ot){return ot===43||ot===45||ot===46||ot===95||Fo(ot)}function FM(ot){let st=ot.length,ct=!1;while(st--){let gt=ot[st][1];if((gt.type==="labelLink"||gt.type==="labelImage")&&!gt._balanced){ct=!0;break}if(gt._gfmAutolinkLiteralWalkedInto){ct=!1;break}}if(ot.length>0&&!ct)ot[ot.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return ct}var Zbe={tokenize:sye,partial:!0};function HM(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:rye,continuation:{tokenize:oye},exit:iye}},text:{[91]:{name:"gfmFootnoteCall",tokenize:nye},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eye,resolveTo:tye}}}}function eye(ot,st,ct){let gt=this,bt=gt.events.length,yt=gt.parser.gfmFootnotes||(gt.parser.gfmFootnotes=[]),vt;while(bt--){let wt=gt.events[bt][1];if(wt.type==="labelImage"){vt=wt;break}if(wt.type==="gfmFootnoteCall"||wt.type==="labelLink"||wt.type==="label"||wt.type==="image"||wt.type==="link")break}return xt;function xt(wt){if(!vt||!vt._balanced)return ct(wt);let Ct=zi(gt.sliceSerialize({start:vt.end,end:gt.now()}));if(Ct.codePointAt(0)!==94||!yt.includes(Ct.slice(1)))return ct(wt);return ot.enter("gfmFootnoteCallLabelMarker"),ot.consume(wt),ot.exit("gfmFootnoteCallLabelMarker"),st(wt)}}function tye(ot,st){let ct=ot.length,gt;while(ct--)if(ot[ct][1].type==="labelImage"&&ot[ct][0]==="enter"){gt=ot[ct][1];break}ot[ct+1][1].type="data",ot[ct+3][1].type="gfmFootnoteCallLabelMarker";let bt={type:"gfmFootnoteCall",start:Object.assign({},ot[ct+3][1].start),end:Object.assign({},ot[ot.length-1][1].end)},yt={type:"gfmFootnoteCallMarker",start:Object.assign({},ot[ct+3][1].end),end:Object.assign({},ot[ct+3][1].end)};yt.end.column++,yt.end.offset++,yt.end._bufferIndex++;let vt={type:"gfmFootnoteCallString",start:Object.assign({},yt.end),end:Object.assign({},ot[ot.length-1][1].start)},xt={type:"chunkString",contentType:"string",start:Object.assign({},vt.start),end:Object.assign({},vt.end)},wt=[ot[ct+1],ot[ct+2],["enter",bt,st],ot[ct+3],ot[ct+4],["enter",yt,st],["exit",yt,st],["enter",vt,st],["enter",xt,st],["exit",xt,st],["exit",vt,st],ot[ot.length-2],ot[ot.length-1],["exit",bt,st]];return ot.splice(ct,ot.length-ct+1,...wt),ot}function nye(ot,st,ct){let gt=this,bt=gt.parser.gfmFootnotes||(gt.parser.gfmFootnotes=[]),yt=0,vt;return xt;function xt(Et){return ot.enter("gfmFootnoteCall"),ot.enter("gfmFootnoteCallLabelMarker"),ot.consume(Et),ot.exit("gfmFootnoteCallLabelMarker"),wt}function wt(Et){if(Et!==94)return ct(Et);return ot.enter("gfmFootnoteCallMarker"),ot.consume(Et),ot.exit("gfmFootnoteCallMarker"),ot.enter("gfmFootnoteCallString"),ot.enter("chunkString").contentType="string",Ct}function Ct(Et){if(yt>999||Et===93&&!vt||Et===null||Et===91||Or(Et))return ct(Et);if(Et===93){ot.exit("chunkString");let kt=ot.exit("gfmFootnoteCallString");if(!bt.includes(zi(gt.sliceSerialize(kt))))return ct(Et);return ot.enter("gfmFootnoteCallLabelMarker"),ot.consume(Et),ot.exit("gfmFootnoteCallLabelMarker"),ot.exit("gfmFootnoteCall"),st}if(!Or(Et))vt=!0;return yt++,ot.consume(Et),Et===92?St:Ct}function St(Et){if(Et===91||Et===92||Et===93)return ot.consume(Et),yt++,Ct;return Ct(Et)}}function rye(ot,st,ct){let gt=this,bt=gt.parser.gfmFootnotes||(gt.parser.gfmFootnotes=[]),yt,vt=0,xt;return wt;function wt(Tt){return ot.enter("gfmFootnoteDefinition")._container=!0,ot.enter("gfmFootnoteDefinitionLabel"),ot.enter("gfmFootnoteDefinitionLabelMarker"),ot.consume(Tt),ot.exit("gfmFootnoteDefinitionLabelMarker"),Ct}function Ct(Tt){if(Tt===94)return ot.enter("gfmFootnoteDefinitionMarker"),ot.consume(Tt),ot.exit("gfmFootnoteDefinitionMarker"),ot.enter("gfmFootnoteDefinitionLabelString"),ot.enter("chunkString").contentType="string",St;return ct(Tt)}function St(Tt){if(vt>999||Tt===93&&!xt||Tt===null||Tt===91||Or(Tt))return ct(Tt);if(Tt===93){ot.exit("chunkString");let Pt=ot.exit("gfmFootnoteDefinitionLabelString");return yt=zi(gt.sliceSerialize(Pt)),ot.enter("gfmFootnoteDefinitionLabelMarker"),ot.consume(Tt),ot.exit("gfmFootnoteDefinitionLabelMarker"),ot.exit("gfmFootnoteDefinitionLabel"),kt}if(!Or(Tt))xt=!0;return vt++,ot.consume(Tt),Tt===92?Et:St}function Et(Tt){if(Tt===91||Tt===92||Tt===93)return ot.consume(Tt),vt++,St;return St(Tt)}function kt(Tt){if(Tt===58){if(ot.enter("definitionMarker"),ot.consume(Tt),ot.exit("definitionMarker"),!bt.includes(yt))bt.push(yt);return nr(ot,Rt,"gfmFootnoteDefinitionWhitespace")}return ct(Tt)}function Rt(Tt){return st(Tt)}}function oye(ot,st,ct){return ot.check(_l,st,ot.attempt(Zbe,st,ct))}function iye(ot){ot.exit("gfmFootnoteDefinition")}function sye(ot,st,ct){let gt=this;return nr(ot,bt,"gfmFootnoteDefinitionIndent",5);function bt(yt){let vt=gt.events[gt.events.length-1];return vt&&vt[1].type==="gfmFootnoteDefinitionIndent"&&vt[2].sliceSerialize(vt[1],!0).length===4?st(yt):ct(yt)}}function zM(ot){let ct=(ot||{}).singleTilde,gt={name:"strikethrough",tokenize:yt,resolveAll:bt};if(ct===null||ct===void 0)ct=!0;return{text:{[126]:gt},insideSpan:{null:[gt]},attentionMarkers:{null:[126]}};function bt(vt,xt){let wt=-1;while(++wt<vt.length)if(vt[wt][0]==="enter"&&vt[wt][1].type==="strikethroughSequenceTemporary"&&vt[wt][1]._close){let Ct=wt;while(Ct--)if(vt[Ct][0]==="exit"&&vt[Ct][1].type==="strikethroughSequenceTemporary"&&vt[Ct][1]._open&&vt[wt][1].end.offset-vt[wt][1].start.offset===vt[Ct][1].end.offset-vt[Ct][1].start.offset){vt[wt][1].type="strikethroughSequence",vt[Ct][1].type="strikethroughSequence";let St={type:"strikethrough",start:Object.assign({},vt[Ct][1].start),end:Object.assign({},vt[wt][1].end)},Et={type:"strikethroughText",start:Object.assign({},vt[Ct][1].end),end:Object.assign({},vt[wt][1].start)},kt=[["enter",St,xt],["enter",vt[Ct][1],xt],["exit",vt[Ct][1],xt],["enter",Et,xt]],Rt=xt.parser.constructs.insideSpan.null;if(Rt)Ko(kt,kt.length,0,Ju(Rt,vt.slice(Ct+1,wt),xt));Ko(kt,kt.length,0,[["exit",Et,xt],["enter",vt[wt][1],xt],["exit",vt[wt][1],xt],["exit",St,xt]]),Ko(vt,Ct-1,wt-Ct+3,kt),wt=Ct+kt.length-2;break}}wt=-1;while(++wt<vt.length)if(vt[wt][1].type==="strikethroughSequenceTemporary")vt[wt][1].type="data";return vt}function yt(vt,xt,wt){let Ct=this.previous,St=this.events,Et=0;return kt;function kt(Tt){if(Ct===126&&St[St.length-1][1].type!=="characterEscape")return wt(Tt);return vt.enter("strikethroughSequenceTemporary"),Rt(Tt)}function Rt(Tt){let Pt=bc(Ct);if(Tt===126){if(Et>1)return wt(Tt);return vt.consume(Tt),Et++,Rt}if(Et<2&&!ct)return wt(Tt);let Mt=vt.exit("strikethroughSequenceTemporary"),It=bc(Tt);return Mt._open=!It||It===2&&Boolean(Pt),Mt._close=!Pt||Pt===2&&Boolean(It),xt(Tt)}}}class $M{constructor(){this.map=[]}add(ot,st,ct){aye(this,ot,st,ct)}consume(ot){if(this.map.sort(function(bt,yt){return bt[0]-yt[0]}),this.map.length===0)return;let st=this.map.length,ct=[];while(st>0)st-=1,ct.push(ot.slice(this.map[st][0]+this.map[st][1]),this.map[st][2]),ot.length=this.map[st][0];ct.push(ot.slice()),ot.length=0;let gt=ct.pop();while(gt){for(let bt of gt)ot.push(bt);gt=ct.pop()}this.map.length=0}}function aye(ot,st,ct,gt){let bt=0;if(ct===0&&gt.length===0)return;while(bt<ot.map.length){if(ot.map[bt][0]===st){ot.map[bt][1]+=ct,ot.map[bt][2].push(...gt);return}bt+=1}ot.map.push([st,ct,gt])}function Yj(ot,st){let ct=!1,gt=[];while(st<ot.length){let bt=ot[st];if(ct){if(bt[0]==="enter"){if(bt[1].type==="tableContent")gt.push(ot[st+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(bt[1].type==="tableContent"){if(ot[st-1][1].type==="tableDelimiterMarker"){let yt=gt.length-1;gt[yt]=gt[yt]==="left"?"center":"right"}}else if(bt[1].type==="tableDelimiterRow")break}else if(bt[0]==="enter"&&bt[1].type==="tableDelimiterRow")ct=!0;st+=1}return gt}function WM(){return{flow:{null:{name:"table",tokenize:lye,resolveAll:cye}}}}function lye(ot,st,ct){let gt=this,bt=0,yt=0,vt;return xt;function xt(Lt){let Vt=gt.events.length-1;while(Vt>-1){let Ht=gt.events[Vt][1].type;if(Ht==="lineEnding"||Ht==="linePrefix")Vt--;else break}let Wt=Vt>-1?gt.events[Vt][1].type:null,Ut=Wt==="tableHead"||Wt==="tableRow"?_t:wt;if(Ut===_t&&gt.parser.lazy[gt.now().line])return ct(Lt);return Ut(Lt)}function wt(Lt){return ot.enter("tableHead"),ot.enter("tableRow"),Ct(Lt)}function Ct(Lt){if(Lt===124)return St(Lt);return vt=!0,yt+=1,St(Lt)}function St(Lt){if(Lt===null)return ct(Lt);if(jn(Lt)){if(yt>1)return yt=0,gt.interrupt=!0,ot.exit("tableRow"),ot.enter("lineEnding"),ot.consume(Lt),ot.exit("lineEnding"),Rt;return ct(Lt)}if(ir(Lt))return nr(ot,St,"whitespace")(Lt);if(yt+=1,vt)vt=!1,bt+=1;if(Lt===124)return ot.enter("tableCellDivider"),ot.consume(Lt),ot.exit("tableCellDivider"),vt=!0,St;return ot.enter("data"),Et(Lt)}function Et(Lt){if(Lt===null||Lt===124||Or(Lt))return ot.exit("data"),St(Lt);return ot.consume(Lt),Lt===92?kt:Et}function kt(Lt){if(Lt===92||Lt===124)return ot.consume(Lt),Et;return Et(Lt)}function Rt(Lt){if(gt.interrupt=!1,gt.parser.lazy[gt.now().line])return ct(Lt);if(ot.enter("tableDelimiterRow"),vt=!1,ir(Lt))return nr(ot,Tt,"linePrefix",gt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Lt);return Tt(Lt)}function Tt(Lt){if(Lt===45||Lt===58)return Mt(Lt);if(Lt===124)return vt=!0,ot.enter("tableCellDivider"),ot.consume(Lt),ot.exit("tableCellDivider"),Pt;return Dt(Lt)}function Pt(Lt){if(ir(Lt))return nr(ot,Mt,"whitespace")(Lt);return Mt(Lt)}function Mt(Lt){if(Lt===58)return yt+=1,vt=!0,ot.enter("tableDelimiterMarker"),ot.consume(Lt),ot.exit("tableDelimiterMarker"),It;if(Lt===45)return yt+=1,It(Lt);if(Lt===null||jn(Lt))return Ot(Lt);return Dt(Lt)}function It(Lt){if(Lt===45)return ot.enter("tableDelimiterFiller"),At(Lt);return Dt(Lt)}function At(Lt){if(Lt===45)return ot.consume(Lt),At;if(Lt===58)return vt=!0,ot.exit("tableDelimiterFiller"),ot.enter("tableDelimiterMarker"),ot.consume(Lt),ot.exit("tableDelimiterMarker"),Nt;return ot.exit("tableDelimiterFiller"),Nt(Lt)}function Nt(Lt){if(ir(Lt))return nr(ot,Ot,"whitespace")(Lt);return Ot(Lt)}function Ot(Lt){if(Lt===124)return Tt(Lt);if(Lt===null||jn(Lt)){if(!vt||bt!==yt)return Dt(Lt);return ot.exit("tableDelimiterRow"),ot.exit("tableHead"),st(Lt)}return Dt(Lt)}function Dt(Lt){return ct(Lt)}function _t(Lt){return ot.enter("tableRow"),$t(Lt)}function $t(Lt){if(Lt===124)return ot.enter("tableCellDivider"),ot.consume(Lt),ot.exit("tableCellDivider"),$t;if(Lt===null||jn(Lt))return ot.exit("tableRow"),st(Lt);if(ir(Lt))return nr(ot,$t,"whitespace")(Lt);return ot.enter("data"),Ft(Lt)}function Ft(Lt){if(Lt===null||Lt===124||Or(Lt))return ot.exit("data"),$t(Lt);return ot.consume(Lt),Lt===92?Bt:Ft}function Bt(Lt){if(Lt===92||Lt===124)return ot.consume(Lt),Ft;return Ft(Lt)}}function cye(ot,st){let ct=-1,gt=!0,bt=0,yt=[0,0,0,0],vt=[0,0,0,0],xt=!1,wt=0,Ct,St,Et,kt=new $M;while(++ct<ot.length){let Rt=ot[ct],Tt=Rt[1];if(Rt[0]==="enter"){if(Tt.type==="tableHead"){if(xt=!1,wt!==0)Zj(kt,st,wt,Ct,St),St=void 0,wt=0;Ct={type:"table",start:Object.assign({},Tt.start),end:Object.assign({},Tt.end)},kt.add(ct,0,[["enter",Ct,st]])}else if(Tt.type==="tableRow"||Tt.type==="tableDelimiterRow"){if(gt=!0,Et=void 0,yt=[0,0,0,0],vt=[0,ct+1,0,0],xt)xt=!1,St={type:"tableBody",start:Object.assign({},Tt.start),end:Object.assign({},Tt.end)},kt.add(ct,0,[["enter",St,st]]);bt=Tt.type==="tableDelimiterRow"?2:St?3:1}else if(bt&&(Tt.type==="data"||Tt.type==="tableDelimiterMarker"||Tt.type==="tableDelimiterFiller")){if(gt=!1,vt[2]===0){if(yt[1]!==0)vt[0]=vt[1],Et=HC(kt,st,yt,bt,void 0,Et),yt=[0,0,0,0];vt[2]=ct}}else if(Tt.type==="tableCellDivider")if(gt)gt=!1;else{if(yt[1]!==0)vt[0]=vt[1],Et=HC(kt,st,yt,bt,void 0,Et);yt=vt,vt=[yt[1],ct,0,0]}}else if(Tt.type==="tableHead")xt=!0,wt=ct;else if(Tt.type==="tableRow"||Tt.type==="tableDelimiterRow"){if(wt=ct,yt[1]!==0)vt[0]=vt[1],Et=HC(kt,st,yt,bt,ct,Et);else if(vt[1]!==0)Et=HC(kt,st,vt,bt,ct,Et);bt=0}else if(bt&&(Tt.type==="data"||Tt.type==="tableDelimiterMarker"||Tt.type==="tableDelimiterFiller"))vt[3]=ct}if(wt!==0)Zj(kt,st,wt,Ct,St);kt.consume(st.events),ct=-1;while(++ct<st.events.length){let Rt=st.events[ct];if(Rt[0]==="enter"&&Rt[1].type==="table")Rt[1]._align=Yj(st.events,ct)}return ot}function HC(ot,st,ct,gt,bt,yt){let vt=gt===1?"tableHeader":gt===2?"tableDelimiter":"tableData",xt="tableContent";if(ct[0]!==0)yt.end=Object.assign({},Jm(st.events,ct[0])),ot.add(ct[0],0,[["exit",yt,st]]);let wt=Jm(st.events,ct[1]);if(yt={type:vt,start:Object.assign({},wt),end:Object.assign({},wt)},ot.add(ct[1],0,[["enter",yt,st]]),ct[2]!==0){let Ct=Jm(st.events,ct[2]),St=Jm(st.events,ct[3]),Et={type:"tableContent",start:Object.assign({},Ct),end:Object.assign({},St)};if(ot.add(ct[2],0,[["enter",Et,st]]),gt!==2){let kt=st.events[ct[2]],Rt=st.events[ct[3]];if(kt[1].end=Object.assign({},Rt[1].end),kt[1].type="chunkText",kt[1].contentType="text",ct[3]>ct[2]+1){let Tt=ct[2]+1,Pt=ct[3]-ct[2]-1;ot.add(Tt,Pt,[])}}ot.add(ct[3]+1,0,[["exit",Et,st]])}if(bt!==void 0)yt.end=Object.assign({},Jm(st.events,bt)),ot.add(bt,0,[["exit",yt,st]]),yt=void 0;return yt}function Zj(ot,st,ct,gt,bt){let yt=[],vt=Jm(st.events,ct);if(bt)bt.end=Object.assign({},vt),yt.push(["exit",bt,st]);gt.end=Object.assign({},vt),yt.push(["exit",gt,st]),ot.add(ct+1,0,yt)}function Jm(ot,st){let ct=ot[st],gt=ct[0]==="enter"?"start":"end";return ct[1][gt]}var uye={name:"tasklistCheck",tokenize:pye};function UM(){return{text:{[91]:uye}}}function pye(ot,st,ct){let gt=this;return bt;function bt(wt){if(gt.previous!==null||!gt._gfmTasklistFirstContentOfListItem)return ct(wt);return ot.enter("taskListCheck"),ot.enter("taskListCheckMarker"),ot.consume(wt),ot.exit("taskListCheckMarker"),yt}function yt(wt){if(Or(wt))return ot.enter("taskListCheckValueUnchecked"),ot.consume(wt),ot.exit("taskListCheckValueUnchecked"),vt;if(wt===88||wt===120)return ot.enter("taskListCheckValueChecked"),ot.consume(wt),ot.exit("taskListCheckValueChecked"),vt;return ct(wt)}function vt(wt){if(wt===93)return ot.enter("taskListCheckMarker"),ot.consume(wt),ot.exit("taskListCheckMarker"),ot.exit("taskListCheck"),xt;return ct(wt)}function xt(wt){if(jn(wt))return st(wt);if(ir(wt))return ot.check({tokenize:dye},st,ct)(wt);return ct(wt)}}function dye(ot,st,ct){return nr(ot,gt,"whitespace");function gt(bt){return bt===null?ct(bt):st(bt)}}function eV(ot){return Z1([BM(),HM(),zM(ot),WM(),UM()])}var fye={};function zC(ot){let st=this,ct=ot||fye,gt=st.data(),bt=gt.micromarkExtensions||(gt.micromarkExtensions=[]),yt=gt.fromMarkdownExtensions||(gt.fromMarkdownExtensions=[]),vt=gt.toMarkdownExtensions||(gt.toMarkdownExtensions=[]);bt.push(eV(ct)),yt.push(_M()),vt.push(OM(ct))}var Md=e(r(),1),mye=[zC],gye=[BC],hye={code({node:ot,className:st,children:ct,...gt}){return Md.jsx("code",{className:n("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",st),...gt,children:ct})},pre({children:ot}){return Md.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:Md.jsx("pre",{className:"overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0",children:ot})})}};function $C({size:ot="sm",content:st}){let ct=b(),{base:gt}=pi();return Md.jsx("div",{className:n("prose max-w-full min-w-0 wrap-anywhere prose-inherit",ot==="sm"&&"prose-sm"),children:Md.jsx(kC,{remarkPlugins:mye,rehypePlugins:gye,components:hye,urlTransform:(bt,yt,vt)=>{if(vt.tagName==="a"&&yt==="href"&&bt.startsWith("moi:"))try{return Fs(bt,{workspaceId:ct,base:gt})}catch{return""}return RC(bt)},children:st})})}function tV({content:ot}){return Md.jsx(kC,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:ot})}var Fl=e(t(),1);var zs=e(r(),1);function nV({content:ot}){let[st,ct]=Fl.useState(!1),[gt,bt]=Fl.useState(!1),yt=Fl.useRef(null),vt=Fl.useRef(null),xt=Fl.useId();return Fl.useEffect(()=>{let wt=yt.current,Ct=vt.current;if(!wt||!Ct)return;let St=()=>{if(!st)bt(Ct.scrollHeight>wt.clientHeight+1)};St();let Et=new ResizeObserver(St);return Et.observe(Ct),Et.observe(wt),()=>Et.disconnect()},[ot,st]),zs.jsxs("div",{className:"max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere text-primary-foreground inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]",children:[zs.jsx("div",{id:xt,ref:yt,className:n(!st&&"max-h-80 overflow-hidden"),onFocusCapture:()=>{if(gt)ct(!0)},children:zs.jsx("div",{ref:vt,children:zs.jsx($C,{content:ot})})}),gt&&zs.jsxs(zs.Fragment,{children:[!st&&zs.jsx("div",{"aria-hidden":"true",children:"…"}),zs.jsxs(a,{variant:"ghost",size:"sm",className:"mt-4 px-0 font-normal hover:bg-transparent hover:text-inherit","aria-expanded":st,"aria-controls":xt,onClick:()=>ct((wt)=>!wt),children:[st?"Show less":"Show more",st?zs.jsx(FO,{stroke:1.75}):zs.jsx(qc,{stroke:1.75})]})]})]})}var uA=e(t(),1);var rV="/airtable-hsa66v6q.png";var oV="/apollo-2ed5dy2d.png";var iV="/asana-tvgtwbx2.png";var sV="/atlassian-b3tq39hs.png";var aV="/box-w3n36t5g.png";var jM="/chrome-tspm94rw.svg";var lV="/clickup-qqrqqvqb.png";var cV="/cloudflare-j9p931v6.png";var uV="/context7-8ht0xjfy.png";var pV="/datadog-70ne3yzt.png";var dV="/discord-vejhptwx.png";var fV="/dropbox-4m5s9mgr.png";var mV="/elevenlabs-2nzzej1t.png";var gV="/exa-qqj3vr0x.png";var hV="/figma-y9898rry.png";var bV="/firecrawl-w2t8nehx.png";var yV="/github-av5r5y3e.png";var vV="/gitlab-4pv5vm6b.png";var xV="/gmail-sg6a5v3x.png";var wV="/googlecalendar-nqhh2v7r.png";var CV="/googledrive-6s8xyab7.png";var SV="/grafana-1yfsnwr6.png";var EV="/granola-7j3b0nk2.png";var kV="/hubspot-hghcmc2t.png";var RV="/huggingface-kxzaxj83.png";var TV="/intercom-td763jt8.png";var PV="/linear-v9s3az2d.png";var IV="/monday-jdbs4wwf.png";var MV="/mongodb-emzxvhd5.png";var AV="/neon-zj4qar44.png";var NV="/notion-w034c0b8.png";var DV="/paper-zbt34fab.png";var _V="/paypal-kwwf7xsc.png";var OV="/perplexity-4y63rxvj.png";var LV="/postgresql-qsspbsr1.png";var BV="/posthog-sphppc4w.png";var FV="/puppeteer-2xjt1a9b.png";var HV="/railway-834de8d2.png";var zV="/redis-spm6w2m1.png";var $V="/salesforce-1mk56v4z.png";var WV="/sentry-hdwpmvek.png";var UV="/shopify-90dadaav.png";var jV="/slack-1c1wj62s.png";var VV="/snowflake-hfpykpgy.png";var GV="/stripe-zrfaqbj3.png";var KV="/supabase-4vg33zf2.png";var qV="/telegram-v6tjyrs7.png";var QV="/twilio-dpyjdwpj.png";var JV="/vercel-7d0ssw28.png";var XV="/zapier-p67qfch0.png";var f0e={airtable:rV,apollo:oV,asana:iV,atlassian:sV,box:aV,chrome:jM,"chrome-devtools":jM,clickup:lV,cloudflare:cV,context7:uV,datadog:pV,discord:dV,dropbox:fV,elevenlabs:mV,exa:gV,figma:hV,firecrawl:bV,github:yV,gitlab:vV,gmail:xV,googlecalendar:wV,googledrive:CV,grafana:SV,granola:EV,hubspot:kV,huggingface:RV,intercom:TV,linear:PV,monday:IV,mongodb:MV,neon:AV,notion:NV,paper:DV,paypal:_V,perplexity:OV,postgresql:LV,posthog:BV,puppeteer:FV,railway:HV,redis:zV,salesforce:$V,sentry:WV,shopify:UV,slack:jV,snowflake:VV,stripe:GV,supabase:KV,telegram:qV,twilio:QV,vercel:JV,zapier:XV},m0e={"google drive":"googledrive","google calendar":"googlecalendar",gcal:"googlecalendar",gdrive:"googledrive","apollo.io":"apollo","paper-desktop":"paper","granola-mcp":"granola","claude-in-chrome":"chrome",postgres:"postgresql","hugging face":"huggingface",jira:"atlassian",confluence:"atlassian"};function YV(ot){let st=ot.match(/^claude[._]ai[._\s]+(.+)$/i);if(!st)return ot;return st[1].replace(/_/g," ")}function WC(ot){return ot.toLowerCase().replace(/[\s._-]+/g,"")}var g0e=new Map(Object.entries(f0e).map(([ot,st])=>[WC(ot),st])),h0e=new Map(Object.entries(m0e).map(([ot,st])=>[WC(ot),WC(st)]));function UC(ot){let st=WC(YV(ot));return g0e.get(h0e.get(st)??st)}function jC(ot){return YV(ot).split(/[\s._-]+/).filter(Boolean).map((st)=>st[0].toUpperCase()+st.slice(1)).join(" ")}var VM=e(r(),1);function qb({open:ot,children:st}){return VM.jsx(Qi,{initial:!1,children:ot&&VM.jsx(S.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",duration:0.25,bounce:0.1},className:"overflow-hidden",children:st},"content")})}var ZV=e(t(),1);var nG=e(r(),1),b0e=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function eG(ot,st){if(ot.name!=="Read"||!st)return null;let ct=ot.input,gt=typeof ct.file_path==="string"?ct.file_path:null;if(!gt||!b0e.test(gt))return null;let bt=st.endsWith("/")?st:`${st}/`;if(!gt.startsWith(bt))return null;return gt.slice(bt.length)}function tG({relPath:ot}){let st=b(),[ct,gt]=ZV.useState(!1);if(ct)return null;let bt=`/api/workspaces/${st}/preview/${ot.split("/").map(encodeURIComponent).join("/")}`;return nG.jsx("img",{src:bt,alt:ot,loading:"lazy",onError:()=>gt(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var Yb=e(t(),1);var oG=e(r(),1),y0e=n("animate-[text-shimmer_2s_ease-in-out_infinite]","bg-clip-text text-transparent","bg-[length:200%_auto]","bg-[linear-gradient(90deg,var(--muted-foreground)_0%,var(--muted-foreground)_40%,var(--foreground)_50%,var(--muted-foreground)_60%,var(--muted-foreground)_100%)]");function rG({children:ot,active:st=!0,className:ct}){return oG.jsx("span",{className:n(ct,st&&y0e),children:ot})}var Qb=e(r(),1);function VC({className:ot}){return Qb.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:ot,"aria-hidden":"true",children:[Qb.jsx("path",{d:"M3.49994 11.7501L11.6717 3.57855C12.7762 2.47398 14.5672 2.47398 15.6717 3.57855C16.7762 4.68312 16.7762 6.47398 15.6717 7.57855M15.6717 7.57855L9.49994 13.7501M15.6717 7.57855C16.7762 6.47398 18.5672 6.47398 19.6717 7.57855C20.7762 8.68312 20.7762 10.474 19.6717 11.5785L12.7072 18.543C12.3167 18.9335 12.3167 19.5667 12.7072 19.9572L13.9999 21.2499"}),Qb.jsx("path",{d:"M17.4999 9.74921L11.3282 15.921C10.2238 17.0255 8.43275 17.0255 7.32825 15.921C6.22376 14.8164 6.22376 13.0255 7.32825 11.921L13.4999 5.74939"})]})}var li=e(r(),1),GC="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function Ym({isFirst:ot,isLast:st,marker:ct,loading:gt=!1,isError:bt=!1,children:yt}){let vt=ct!=null||gt;return li.jsxs("div",{className:"relative flex gap-2.5",children:[li.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!ot&&li.jsx("span",{className:n("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",vt?"h-1":"h-2.5")}),!st&&li.jsx("span",{className:n("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",vt?"top-[26px]":"top-5")}),ct?li.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:ct}):gt?li.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:li.jsx(No,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):li.jsx("span",{className:n("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",bt?"bg-destructive":"bg-border")})]}),yt]})}function Jb({open:ot}){return li.jsx(S.span,{animate:{rotate:ot?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:n("flex shrink-0",ot?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:li.jsx(sc,{size:12,stroke:1.75})})}function Xm({children:ot,className:st}){return li.jsx("span",{className:n("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",st),children:ot})}function iG({icon:ot,size:st=12,stroke:ct=1.75}){return li.jsx(Xm,{children:li.jsx(ot,{size:st,stroke:ct,className:"text-muted-foreground"})})}function sG({src:ot}){if(!ot)return li.jsx(Xm,{children:li.jsx(VC,{className:"size-3 text-muted-foreground"})});return li.jsx(Xm,{children:li.jsx("img",{src:ot,alt:"",className:"size-full object-cover"})})}var I0e=cG(),GM=hG();function M0e(ot){if(!ot)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test(ot)?`$${ot}`:`\${${ot}}`}function A0e(ot){try{return GM(ot,M0e)}catch{return null}}function bG(ot){return ot.split("/").pop()??ot}var N0e=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),D0e=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),_0e=/^[A-Za-z_][A-Za-z0-9_]*=/;function O0e(ot){if(/^-[a-zA-Z]*c$/.test(ot))return!0;let st=ot.toLowerCase();return st==="--command"||st==="-command"}function L0e(ot){let st=A0e(ot);if(!st||st.length<3)return null;let ct=(yt)=>{let vt=st[yt];return typeof vt==="string"?vt:null},gt=0,bt=()=>{while(_0e.test(ct(gt)??""))gt++};if(bt(),bG(ct(gt)??"")==="env")gt++,bt();if(!N0e.has(bG(ct(gt)??"")))return null;gt++;while(gt<st.length){let yt=ct(gt);if(yt===null)return null;if(O0e(yt)){if(gt+2!==st.length)return null;return ct(gt+1)?.trim()||null}if(!yt.startsWith("-")&&!yt.startsWith("+"))return null;gt+=D0e.has(yt)?2:1}return null}function B0e(ot){let st=ot;for(let ct=0;ct<3;ct++){let gt=L0e(st);if(gt===null)return st;st=gt}return st}function F0e(ot){return ot.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function Nd(ot){return F0e(B0e(ot))}function Zm(ot,st){let ct=Nd(ot);return ct?st(`$ ${ct}`):""}var H0e=/^[A-Za-z]:\//;function z0e(ot=""){if(!ot)return ot;return ot.replace(/\\/g,"/").replace(H0e,(st)=>st.toUpperCase())}var $0e=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var yG=/^\/([A-Za-z]:)?$/;function W0e(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var KM=function(...ot){ot=ot.map((gt)=>z0e(gt));let st="",ct=!1;for(let gt=ot.length-1;gt>=-1&&!ct;gt--){let bt=gt>=0?ot[gt]:W0e();if(!bt||bt.length===0)continue;st=`${bt}/${st}`,ct=qM(bt)}if(st=vG(st,!ct),ct&&!qM(st))return`/${st}`;return st.length>0?st:"."};function vG(ot,st){let ct="",gt=0,bt=-1,yt=0,vt=null;for(let xt=0;xt<=ot.length;++xt){if(xt<ot.length)vt=ot[xt];else if(vt==="/")break;else vt="/";if(vt==="/"){if(bt===xt-1||yt===1);else if(yt===2){if(ct.length<2||gt!==2||ct[ct.length-1]!=="."||ct[ct.length-2]!=="."){if(ct.length>2){let wt=ct.lastIndexOf("/");if(wt===-1)ct="",gt=0;else ct=ct.slice(0,wt),gt=ct.length-1-ct.lastIndexOf("/");bt=xt,yt=0;continue}else if(ct.length>0){ct="",gt=0,bt=xt,yt=0;continue}}if(st)ct+=ct.length>0?"/..":"..",gt=2}else{if(ct.length>0)ct+=`/${ot.slice(bt+1,xt)}`;else ct=ot.slice(bt+1,xt);gt=xt-bt-1}bt=xt,yt=0}else if(vt==="."&&yt!==-1)++yt;else yt=-1}return ct}var qM=function(ot){return $0e.test(ot)};var QM=function(ot,st){let ct=KM(ot).replace(yG,"$1").split("/"),gt=KM(st).replace(yG,"$1").split("/");if(gt[0][1]===":"&&ct[0][1]===":"&&ct[0]!==gt[0])return gt.join("/");let bt=[...ct];for(let yt of bt){if(gt[0]!==yt)break;ct.shift(),gt.shift()}return[...ct.map(()=>".."),...gt].join("/")};function eg(ot){return ot.input??{}}function fr(ot,st){let ct=ot[st];return typeof ct==="string"?ct:""}function xG(ot){return(st)=>st.replace(/\/[^\s"']+/g,(ct)=>{if(!ot)return ct;let gt=QM(ot,ct);return gt.startsWith("..")?ct:gt})}function Dd(ot){let st=Math.max(1,Math.round(ot/1000));if(st<60)return`${st}s`;let ct=Math.floor(st/60),gt=st%60;return gt?`${ct}m ${gt}s`:`${ct}m`}var U0e={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function j0e(ot){if(!ot.startsWith("mcp__"))return ot;let st=ot.slice(5).split("__");return st.length>=2?st.slice(1).join("__"):st[0]}function V0e(ot,st){let ct=ot.name,gt=eg(ot);if(ct==="Bash")return Zm(fr(gt,"command"),st);if(ct==="Read"||ct==="Write"||ct==="Edit")return st(fr(gt,"file_path"));if(ct==="Glob")return st(fr(gt,"pattern"));if(ct==="Grep")return`/${fr(gt,"pattern")}/ ${st(fr(gt,"path"))}`;if(ct==="WebSearch")return fr(gt,"query");if(ct==="WebFetch")return fr(gt,"url");if(ct==="ToolSearch"){let bt=fr(gt,"query");if(bt.startsWith("select:"))return bt.slice(7).split(",").map(j0e).join(", ");return bt}return""}var Xb={displayName:(ot)=>U0e[ot.name]??ot.name,brief:V0e};var JM={exec:"Bash",apply_patch:"Edit",web_search:"Web search",update_plan:"Update plan",subagent:"Run sub-agent",subagent_activity:"Sub-agent",review:"Review",view_image:"View image",generate_image:"Generate image",list_mcp_resources:"List MCP resources",list_mcp_resource_templates:"List MCP templates",read_mcp_resource:"Read MCP resource"},CG={read:"Read",listFiles:"List files",search:"Search"};function SG(ot){let st=ot?.commandActions;if(!Array.isArray(st)||st.length===0)return null;let ct=st[0],gt=ct?.type;if(!gt||!(gt in CG))return null;if(st.some((bt)=>bt?.type!==gt))return null;return ct}var wG={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function G0e(ot){if(ot.name==="exec"){let st=SG(ot.input);if(st?.type)return CG[st.type]}if(ot.name==="subagent"){let st=ot.input?.action;if(typeof st==="string"&&st in wG)return wG[st]}return JM[ot.name]??ot.name}function K0e(ot,st){let ct=ot.name,gt=eg(ot);if(ct==="exec"){let bt=SG(gt);if(bt?.type==="read")return st(bt.path||bt.name||"");if(bt?.type==="search")return[bt.query&&`/${bt.query}/`,bt.path&&st(bt.path)].filter(Boolean).join(" ");if(bt?.type==="listFiles")return bt.path?st(bt.path):"";return Zm(fr(gt,"command"),st)}if(ct==="apply_patch"){let bt=gt.changes;if(Array.isArray(bt))return bt.map((vt)=>vt&&typeof vt==="object"?vt.path:void 0).filter((vt)=>typeof vt==="string").map(st).join(", ");return""}if(ct==="web_search"){let bt=gt.queries;if(Array.isArray(bt)&&bt.length>0)return bt.filter((yt)=>typeof yt==="string").join(" · ");return fr(gt,"query")||[fr(gt,"url"),fr(gt,"pattern")].filter(Boolean).join(" · ")}if(ct==="update_plan"){let bt=gt.plan;return typeof bt==="string"?bt.split(`
58
+ `)[0]:""}if(ct==="subagent"){if(fr(gt,"action")==="close_agent")return"";return fr(gt,"prompt")}if(ct==="subagent_activity")return fr(gt,"kind");if(ct==="generate_image")return fr(gt,"prompt").split(`
59
+ `)[0];if(ct==="read_mcp_resource")return fr(gt,"uri");if(ct==="list_mcp_resources"||ct==="list_mcp_resource_templates")return fr(gt,"server");return""}var EG={displayName:G0e,brief:K0e};function kG(ot){let st=ot.indexOf(":"),ct=(st>0?ot.slice(0,st):ot).trim(),gt=st>0?ot.slice(st+1).trim():"",bt=ct.match(/^(.*?)\s*\(([^)]*)\)$/);if(!bt)return{action:ct,qualifier:"",detail:gt};return{action:bt[1].trim(),qualifier:bt[2].trim(),detail:gt}}var q0e={terminal:"Run command",read:"Read",write:"Write",edit:"Edit",patch:"Edit",search:"Search",extract:"Fetch webpage","web extract":"Fetch webpage","web search":"Web search",delegate:"Delegate task","delegate batch":"Delegate tasks",todo:"Update TODO",python:"Run Python","process wait":"Wait for process","session search":"Search sessions","skills list":"List skills","skill view":"View skill"};function Q0e(ot){let{action:st}=kG(ot.name),ct=q0e[st];if(ct)return ct;let gt=st.replace(/_/g," ");return gt.charAt(0).toUpperCase()+gt.slice(1)}function J0e(ot,st){let{action:ct,qualifier:gt,detail:bt}=kG(ot.name),yt=bt||gt;if(!yt)return"";return ct==="terminal"?`$ ${Nd(yt)}`:st(yt)}var RG={displayName:Q0e,brief:J0e};var X0e={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",bash:"Bash",ls:"List files",find:"Find files",grep:"Search",process:"Manage process",web_search:"Web search",web_fetch:"Fetch",sessions_list:"List sessions",sessions_history:"Recall session",sessions_yield:"Yield to session",sessions_send:"Send to session",sessions_spawn:"Spawn session",subagents:"Run sub-agent",agents_list:"List agents",session_status:"Session status",image:"Analyze image",image_generate:"Generate image",memory_get:"Read memory",memory_search:"Search memory",update_plan:"Update plan",message:"Send message",browser:"Browser",canvas:"Canvas",cron:"Cron",gateway:"Gateway",code_execution:"Run Python",tts:"Text-to-speech",music_generate:"Generate music",video_generate:"Generate video",x_search:"Search X"};function Y0e(ot,st){let ct=ot.name,gt=eg(ot);if(ct==="read"||ct==="write"||ct==="edit")return st(fr(gt,"path"));if(ct==="apply_patch"){let bt=gt.changes;if(Array.isArray(bt)&&bt.length>0){let xt=bt.map((wt)=>wt&&typeof wt==="object"?fr(wt,"path"):"").filter(Boolean);if(xt.length===1)return st(xt[0]);if(xt.length>1)return`${xt.length} files`}let yt=fr(gt,"patch")||fr(gt,"input"),vt=yt.split(`
60
+ `).find((xt)=>xt.startsWith("*** "))??yt.split(`
61
+ `)[0];return st(vt??"")}if(ct==="exec"||ct==="bash"){let bt=fr(gt,"command")||fr(gt,"code");return Zm(bt,st)}if(ct==="ls"||ct==="find"||ct==="grep")return st(fr(gt,"path")||fr(gt,"pattern"));if(ct==="process"){let bt=fr(gt,"action"),yt=fr(gt,"name");return[bt,yt].filter(Boolean).join(" ")||st(Nd(fr(gt,"command")))}if(ct==="web_search"||ct==="x_search")return fr(gt,"query");if(ct==="web_fetch")return fr(gt,"url");if(ct==="memory_search")return fr(gt,"query");if(ct==="memory_get")return fr(gt,"key")||fr(gt,"name");if(ct==="sessions_history"||ct==="sessions_send"||ct==="sessions_yield")return fr(gt,"sessionKey")||fr(gt,"agentId");if(ct==="sessions_list"||ct==="agents_list")return fr(gt,"agentId");if(ct==="subagents"||ct==="sessions_spawn")return fr(gt,"task")||fr(gt,"agentId");if(ct==="image"||ct==="image_generate")return fr(gt,"prompt")||st(fr(gt,"path"));if(ct==="message")return fr(gt,"recipient")||fr(gt,"to");if(ct==="update_plan"){let bt=gt.plan;if(Array.isArray(bt)){let vt=bt.find((xt)=>!!xt&&typeof xt==="object"&&xt.status==="in_progress")?.step??bt[0]?.step;if(typeof vt==="string")return vt}return""}return""}var TG={displayName:(ot)=>X0e[ot.name]??Xb.displayName(ot),brief:(ot,st)=>Y0e(ot,st)||Xb.brief(ot,st)};function XM(ot){if(!(ot.name==="Bash"||ot.name==="exec"||ot.name==="bash"))return null;let ct=ot.input??{},gt=typeof ct.command==="string"?ct.command:"";if(!gt)return null;let yt=Nd(gt).match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!yt)return null;return{server:yt[1],tool:yt[2],rest:(yt[3]??"").trim()}}function YM(ot){let st=ot.name;if(!st.startsWith("mcp__"))return null;let ct=st.slice(5),gt=ct.indexOf("__");if(gt<=0)return null;return{server:ct.slice(0,gt),tool:ct.slice(gt+2),rest:""}}function ZM(ot){if(ot.provider!=="codex"||!ot.mcpServer)return null;if(ot.name in JM)return null;if(ot.mcpServer==="codex")return null;let st=ot.name.indexOf(".");if(st>0)return{server:ot.name.slice(0,st),tool:ot.name.slice(st+1),rest:""};return{server:ot.mcpServer,tool:ot.name,rest:""}}function eA(ot,st){let ct=st.toLowerCase();return["-","_","."].find((bt)=>ct.startsWith(ot.toLowerCase()+bt))?st.slice(ot.length+1):st}var Z0e={"claude-code":Xb,openclaw:TG,codex:EG,hermes:RG};function PG(ot){return Z0e[ot.provider??"claude-code"]}function IG(ot){return PG(ot).displayName(ot)}function MG(ot,st){return PG(ot).brief(ot,xG(st))}var qo=e(r(),1),AG=[ML,AL,Fk];function eve(){let[ot,st]=Yb.useState(0);Yb.useEffect(()=>{if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let gt=setInterval(()=>st((bt)=>(bt+1)%AG.length),600);return()=>clearInterval(gt)},[]);let ct=AG[ot];return qo.jsx(Xm,{className:"size-5",children:qo.jsx(ct,{size:16,stroke:1.75,className:"text-foreground"})})}function NG({call:ot,cwd:st,isFirst:ct,isLast:gt,renderNestedParts:bt}){let[yt,vt]=Yb.useState(!1),xt=ot.subagent,wt=ot.input??{},Ct=xt?.description??wt.description??"Subtask",St=xt?.status,Et=ot.state==="error"||St==="failed",kt=ot.state==="running"||St==="running",Rt=xt?.usage?.toolUses,Tt=xt?.usage?.durationMs,Mt=(kt&&xt?.progress?.length?xt.progress[xt.progress.length-1]:null)??(Rt!=null?`Took ${Rt} step${Rt===1?"":"s"}`:null),It=(xt?.transcript??[]).flatMap((Ot)=>Ot.parts),At=typeof ot.output==="string"?ot.output:"",Nt=It.length>0||!!At;return qo.jsx(Ym,{isFirst:ct,isLast:gt,marker:kt?qo.jsx(eve,{}):qo.jsx(Xm,{className:"size-5",children:qo.jsx(Fk,{size:16,stroke:1.75,className:"text-foreground"})}),isError:Et,children:qo.jsxs("div",{className:"min-w-0 flex-1",children:[qo.jsxs("button",{type:"button",title:`Agent: ${Ct}`,onClick:()=>Nt&&vt((Ot)=>!Ot),className:n("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",Nt?"cursor-pointer":"cursor-default"),children:[qo.jsxs("span",{className:"flex w-full items-center gap-2",children:[qo.jsxs(rG,{active:kt,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",Ct]}),!kt&&Tt!=null&&qo.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:Dd(Tt)}),St==="failed"&&qo.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),St==="stopped"&&qo.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),Nt&&qo.jsx(Jb,{open:yt})]}),Mt&&qo.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:Mt})]}),Nt&&qo.jsx(qb,{open:yt,children:qo.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[It.length>0&&qo.jsx("div",{className:"py-1.5 pr-2 pl-3",children:bt(It,st)}),At&&qo.jsx("div",{className:n("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",It.length>0&&"border-t border-border"),children:At})]})})]})})}var _d=e(t(),1);var WG=e(t(),1);var nA=new Set(["<",">","{","}","[","]"]),sA=new Set(["for","do","while","if","else","return","function","var","let","const","true","false","undefined","this","new","delete","typeof","in","instanceof","void","break","continue","switch","case","default","throw","try","catch","finally","debugger","with","yield","async","await","class","extends","super","import","export","from","static"]),tve=new Set([...sA,"type","interface","enum","implements","readonly","abstract","declare","namespace","module","private","protected","public","override","keyof","infer","is","asserts","satisfies","as","unknown","never","any","number","string","boolean","bigint","symbol","object"]),LG=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...nA]),nve={keywords:sA,onCommentStart:zG,onCommentEnd:dve};function rve(ot){let st=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test(ot))st+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test(ot))st+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test(ot))st+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test(ot))st+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test(ot))st+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test(ot))st+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test(ot))st+=1;return st>=2}function ove(ot,st){if(ot[st]!=="<")return!1;let ct=0,gt=!1;for(let bt=st;bt<ot.length;bt++){let yt=ot[bt];if(yt==="<"){ct++;continue}if(yt===">"){if(ct--,ct===0){let vt=bt+1;while(vt<ot.length&&/\s/.test(ot[vt]))vt++;if(!(gt&&ot[vt]==="("))return!1;let xt=ot.slice(vt,vt+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(xt)}continue}if(ct===0)continue;if(/[$A-Za-z_]/.test(yt)){gt=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(yt))continue;return!1}return!1}var JC=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[tg,ive,ep,tA,QC,sve,ave,Hl,DG,rA,_G]=JC.map((ot,st)=>st);function Zb(ot){return/^[^\S\r\n]+$/g.test(ot)}function lve(ot){return LG.has(ot)}var cve={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function uve(ot){if(!/[&<>"']/.test(ot))return ot;return ot.replace(/[&<>"']/g,(st)=>cve[st])}function XC(ot){return/^[\w_]+$/.test(ot)||BG(ot)}function OG(ot){let st=ot[0];return XC(st)&&st===st.toUpperCase()||ot==="null"}function BG(ot){return/[^\u0000-\u007f]/.test(ot)}function FG(ot){return/^[a-zA-Z]$/.test(ot)}function HG(ot){return FG(ot)||BG(ot)}function ng(ot){return HG(ot[0])&&(ot.length===1||XC(ot.slice(1)))}function oA(ot){return ot==="`"}function iA(ot){return ot==='"'||ot==="'"}function pve(ot){return iA(ot)||oA(ot)}function zG(ot,st){let ct=ot+st;if(ct==="/*")return 2;return ct==="//"?1:0}function dve(ot,st){return ot+st==="*/"?2:st===`
62
+ `?1:0}function fve(ot){return ot[0]==="/"&&!zG(ot[0],ot[1])}function mve(ot,st){let ct=st+1;while(ct<ot.length&&/\s/.test(ot[ct]))ct++;return ot[ct]===":"}function gve(ot,st){let ct={...nve,...st},gt=!!(st&&st.keywords instanceof Set),bt=rve(ot),yt=gt?ct.keywords:bt?tve:sA,{onCommentStart:vt,onCommentEnd:xt}=ct,wt=ct.typeKeywords instanceof Set?ct.typeKeywords:null,Ct="",St=-1,Et=[-1,""],kt=[-2,""],Rt=[],Tt=!1,Pt=0,Mt=!1,It=0,At=()=>Tt&&!Mt&&!Pt,Nt=()=>Pt&&!At(),Ot=()=>!Pt&&At()&&!Mt&&It>0,Dt=null,_t=0,$t=!1,Ft=0,Bt=0,Lt=()=>Dt!==null,Vt=()=>$t,Wt=()=>Bt>Ft,Ut=()=>Bt>0&&Bt===Ft,Ht=()=>Lt()||Wt();function Gt(qt){let Qt=qt===`
63
+ `;if(Nt()){if(Lt())return ep;let[,zt]=Et;if(ng(qt)){if(zt==="<"||zt==="</")return sve}}if(Ot())return ave;if(Lt()||Wt())return ep;else if(wt&&wt.has(qt))return Et[1]==="."?tg:tA;else if(yt.has(qt))return Et[1]==="."?tg:ive;else if(Qt)return rA;else if(Zb(qt))return _G;else if(qt.split("").every(lve))return Hl;else if(OG(qt))return Nt()?tg:tA;else{if(ng(qt)){let zt=Et[1]==="."&&ng(kt[1]);if(!Ht()&&!zt)return tg;if(zt)return QC}return ep}}let jt=(qt,Qt)=>{if(Qt)Ct=Qt;if(Ct){St=typeof qt==="number"?qt:Gt(Ct);let Xt=[St,Ct];if(St!==_G&&St!==rA)kt=Et,Et=Xt;Rt.push(Xt)}Ct=""};for(let qt=0;qt<ot.length;qt++){let Qt=ot[qt],Xt=ot[qt-1],zt=ot[qt+1],tn=Xt+Qt,rn=Qt+zt;if(typeof ct.onQuote==="function"&&Qt==="'"&&!Lt()&&!Ot()&&!Wt()){let on=ct.onQuote(Qt,qt,ot);if(typeof on==="number"&&on>=1&&!Number.isNaN(on)){let sn=Math.min(on,ot.length-qt),dn=qt+sn;jt(),Ct=ot.slice(qt,dn),jt(tg),qt=dn-1;continue}}if(iA(Qt)&&!Ot()&&!Wt()){jt();let on=!1;if(Xt!=="\\"){if(Dt&&Qt===Dt)Dt=null,on=!0;else if(!Dt)Dt=Qt,_t=Rt.length}if(jt(ep,Qt),ct.quotedKeys&&on&&mve(ot,qt))for(let sn=_t;sn<Rt.length;sn++)Rt[sn][0]=QC;continue}if(!Wt()){if(Xt!=="\\n"&&oA(Qt)){jt(),jt(ep,Qt),Bt++;continue}}if(Wt()){if(Xt!=="\\n"&&oA(Qt)){if(Bt>0){jt(),Bt--,jt(ep,Qt);continue}}if(rn==="${"){Ft++,jt(ep),jt(Hl,rn),qt++;continue}}if(Ut()&&Qt==="}"){jt(),Ft--,jt(Hl,Qt);continue}if(At()){if(Qt==="{"){jt(),jt(Hl,Qt),Mt=!0;continue}}if(Tt){if(!Pt&&Qt==="<"){if(jt(),zt==="/")Pt=2,Ct=rn,qt++;else Pt=1,Ct=Qt;jt(Hl);continue}if(Pt){if(Qt===">"&&!"/=".includes(Xt)){if(jt(),Pt===1)Pt=0,It++;else Pt=0,Tt=!1;jt(Hl,Qt);continue}if(rn==="/>"||rn==="</"){if(Ct!=="<"&&Ct!=="/")jt();if(rn==="/>")Pt=0;else It--;if(!It)Tt=!1;Ct=rn,qt++,jt(Hl);continue}if(Qt==="<"){jt(),Ct=Qt,jt(Hl);continue}if(zt==="-"&&!Ht()&&!Ot()){if(Ct){jt(QC,Ct+Qt+zt),qt++;continue}}if(zt==="="&&!Ht()){if(!Zb(Qt)){if(Zb(Ct))jt();let on=Ct+Qt;if(ng(on)){jt(QC,on);continue}}}}}if(!Pt&&(Qt==="<"&&HG(zt)||rn==="</")){let on=qt-1;while(on>=0&&/\s/.test(ot[on]))on--;let sn=on>=0?ot[on]:"",[dn,fn]=Et,bn=!1,hn=!1;if(Ct&&!Zb(Ct)){let wn=Ct;if(OG(wn)||wn==="true"||wn==="false")bn=!0;else if(yt.has(wn)&&ng(wn))hn=!0;else if(ng(wn))bn=!0}let gn=Qt==="<"&&/[$\w\]\)]/.test(sn)&&(bn||!hn&&(dn===tg||dn===tA||dn===Hl&&(fn===")"||fn==="]"))),xn=Qt==="<"&&ove(ot,qt);if(!gn&&!xn)Pt=zt==="/"?2:1;if(Qt==="<"&&(zt==="/"||FG(zt))){if(!gn&&!xn&&!Ht()&&!Ot()&&!Vt())Tt=!0}}let Kt=pve(Qt),an=Wt(),ln=!Tt&&fve(rn),Zt=Ot();if(Kt||an||iA(Dt))Ct+=Qt;else if(ln){jt();let[on,sn]=Et;if(ln&&on!==-1&&!(on===Hl&&sn!==")"||on===DG)){Ct=Qt,jt();continue}$t=!0;let dn=qt++,fn=()=>qt>=ot.length,bn=()=>fn()||ot[qt]===`
64
+ `,hn=!1,gn=!1;for(;!bn();qt++){let xn=ot[qt],wn=ot[qt-1]==="\\";if(!wn&&xn==="[")gn=!0;if(!wn&&xn==="]")gn=!1;if(xn==="/"&&!gn&&!wn){hn=!0;while(dn!==qt&&/^[a-z]$/.test(ot[qt+1])&&!bn())qt++;break}}if($t=!1,dn!==qt&&hn)Ct=ot.slice(dn,qt+1),jt(ep);else Ct=Qt,jt(),qt=dn}else if(vt(Qt,zt)){jt();let on=qt,sn=vt(Qt,zt);if(sn){for(;qt<ot.length;qt++)if(xt(ot[qt-1],ot[qt])==sn)break}Ct=ot.slice(on,qt+1),jt(DG)}else if(Qt===" "||Qt===`
65
+ `)if(Qt===" "&&(Zb(Ct)||!Ct||Zt)){let on=qt+1;while(ot[on]===" ")on++;if(Ct+=ot.slice(qt,on),qt=on-1,ot[on]==="<")jt()}else jt(),Ct=Qt,jt();else if(Mt&&Qt==="}")jt(),Ct=Qt,jt(),Mt=!1;else if(Zt&&!nA.has(Qt)||Wt()||(XC(Qt)===XC(Ct[Ct.length-1])||At())&&!LG.has(Qt))Ct+=Qt;else{if(tn==="</")Ct=tn;if(jt(),tn!=="</")Ct=Qt;if(rn==="</"||rn==="/>")Ct=rn,jt(),qt++;else if(nA.has(Qt))jt()}}return jt(),Rt}function hve(ot,st){let ct=[],gt=st&&typeof st.lineClassName==="function"?st.lineClassName:null,bt=0,yt=(Ct,St)=>{let Et=gt?gt(St,bt):"";return bt++,{type:"element",tagName:"span",children:Ct,properties:{className:Et?`sh__line ${Et}`:"sh__line"}}};function vt(Ct){let St=Ct.map(([,kt])=>kt).join(""),Et=Ct.map(([kt,Rt])=>{let Tt=JC[kt];return{type:"element",tagName:"span",children:[{type:"text",value:Rt}],properties:{className:`sh__token--${Tt}`,style:{color:`var(--sh-${Tt})`}}}});ct.push(yt(Et,St))}let xt=[],wt=!1;for(let Ct=0;Ct<ot.length;Ct++){let St=ot[Ct],[Et,kt]=St,Rt=Ct===ot.length-1;if(Et!==rA){if(kt.includes(`
66
+ `)){let Tt=kt.split(`
67
+ `);for(let Pt=0;Pt<Tt.length;Pt++)if(xt.push([Et,Tt[Pt]]),Pt<Tt.length-1)vt(xt),xt.length=0}else xt.push(St);wt=!1}else{if(wt)vt([]);else vt(xt),xt.length=0;if(Rt)vt([]);wt=!0}}if(xt.length)vt(xt);return ct}var bve=(ot)=>{let st=`class="${ot.className}"`;if(ot.style){let ct=Object.entries(ot.style).map(([gt,bt])=>`${gt}:${bt}`).join(";");st+=` style="${ct}"`}return st};function yve(ot){return ot.map((st)=>{let{tagName:ct}=st,gt=st.children.map((bt)=>{let{tagName:yt,children:vt,properties:xt}=bt;return`<${yt} ${bve(xt)}>${uve(vt[0].value)}</${yt}>`}).join("");return`<${ct} class="${st.properties.className}">${gt}</${ct}>`}).join(`
68
+ `)}function $G(ot,st){let ct=gve(ot,st),gt=hve(ct,st);return yve(gt)}var xIt={TokenTypes:JC,TokenMap:new Map(JC.map((ot,st)=>[ot,st]))};var aA=e(r(),1),vve=n("[--sh-identifier:#1f2937]","[--sh-keyword:#cf222e]","[--sh-string:#16a34a]","[--sh-class:#2d6e7e]","[--sh-property:#0550ae]","[--sh-entity:#6f42c1]","[--sh-jsxliterals:#6f42c1]","[--sh-sign:#8b949e]","[--sh-comment:#9ca3af]");function UG({code:ot,className:st}){let ct=WG.useMemo(()=>$G(ot),[ot]);return aA.jsx("pre",{className:n("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",vve,st),children:aA.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:ct}})})}var xve={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",md:"md",mdx:"mdx",css:"css",scss:"scss",html:"html",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",c:"c",h:"c",cpp:"cpp",sh:"sh",bash:"sh",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",php:"php",swift:"swift",kt:"kt"};function wve(ot){let st=ot.split(/[\\/]/).pop()??"",ct=st.lastIndexOf("."),gt=ct>0?st.slice(ct+1).toLowerCase():"";return xve[gt]??null}function Cve(ot){let st=ot.trim();if(st.length<2||!(st.startsWith("{")||st.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(st),null,2)}catch{return null}}function Sve(ot){let st=ot.split(`
69
+ `);if(!st.some((ct)=>/^\s*\d+\t/.test(ct)))return ot;return st.map((ct)=>ct.replace(/^\s*\d+\t/,"")).join(`
70
+ `)}function jG(ot,st){let ct=ot.input??{},gt=typeof ct.file_path==="string"?ct.file_path:typeof ct.path==="string"?ct.path:"",bt=gt?wve(gt):null,yt=ot.name==="Read"||ot.name==="read",vt=ot.name==="Write"||ot.name==="write";if(bt&&yt&&st)return{kind:"highlight",code:Sve(st),label:bt};if(bt&&vt&&typeof ct.content==="string"&&ct.content)return{kind:"highlight",code:ct.content,label:bt};let xt=Cve(st);if(xt)return{kind:"highlight",code:xt,label:"json"};return{kind:"plain"}}var es=e(r(),1),lA="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function VG({call:ot,output:st,isError:ct}){let[gt,bt]=_d.useState(!1),yt=_d.useMemo(()=>ct?{kind:"plain"}:jG(ot,st),[ot,st,ct]);if(yt.kind==="plain")return es.jsx("div",{className:n("rounded-lg border",ct?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:es.jsx("pre",{className:n(lA,"break-all whitespace-pre-wrap",ct?"text-destructive":"text-muted-foreground"),children:st||"(empty)"})});return es.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[es.jsx(Eve,{raw:gt,onRaw:bt,label:yt.label,copyText:gt?st:yt.code}),gt?es.jsx("pre",{className:n(lA,"break-all whitespace-pre-wrap text-muted-foreground"),children:st||"(empty)"}):es.jsx(UG,{code:yt.code,className:n(lA,"text-muted-foreground")})]})}function Eve({raw:ot,onRaw:st,label:ct,copyText:gt}){return es.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,ct],[!0,"raw"]].map(([yt,vt])=>es.jsx(a,{type:"button",variant:ot===yt?"outline":"ghost",size:"sm",onClick:()=>st(yt),className:"rounded-full text-xs uppercase",children:vt},vt)),es.jsx("div",{className:"flex-1"}),es.jsx(kve,{text:gt})]})}function kve({text:ot}){let[st,ct]=_d.useState(!1);return _d.useEffect(()=>{if(!st)return;let bt=setTimeout(()=>ct(!1),1500);return()=>clearTimeout(bt)},[st]),es.jsx(a,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText(ot).then(()=>ct(!0)).catch(()=>{})},"aria-label":st?"Copied":"Copy",children:st?es.jsx(Ys,{stroke:1.75}):es.jsx(z0,{stroke:1.75})})}var Vr=e(r(),1);function YC({parts:ot,cwd:st=null,processing:ct=!1}){let gt=ot.filter((bt)=>bt.type==="reasoning"||bt.type==="tool-call");return Vr.jsx("div",{className:"flex flex-col",children:gt.map((bt,yt)=>{let vt=yt===gt.length-1,xt={isFirst:yt===0,isLast:vt};if(bt.type==="reasoning")return Vr.jsx(Rve,{text:bt.text,durationMs:bt.durationMs,inProgress:ct&&vt,...xt},yt);return Vr.jsx(Tve,{call:bt.call,cwd:st,...xt},bt.call.toolCallId||yt)})})}function cA({isFirst:ot,isLast:st,call:ct,leading:gt,marker:bt,name:yt,brief:vt,preview:xt}){let[wt,Ct]=uA.useState(!1),St=ct.state==="error",Et=ct.state==="running"||ct.state==="pending",kt=St?ct.errorText??"":typeof ct.output==="string"?ct.output:"",Rt=!!(kt||St||xt),Tt=vt?`${yt}: ${vt}`:yt;return Vr.jsx(Ym,{isFirst:ot,isLast:st,marker:bt,loading:Et,isError:St,children:Vr.jsxs("div",{className:"min-w-0 flex-1",children:[Vr.jsxs("button",{type:"button",title:Tt,onClick:()=>Rt&&Ct((Pt)=>!Pt),className:n(GC,Rt?"cursor-pointer":"cursor-default"),children:[gt,Vr.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:yt}),vt&&Vr.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:vt}),Et&&bt&&Vr.jsx(No,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),Rt&&Vr.jsx(Jb,{open:wt})]}),Rt&&Vr.jsx(qb,{open:wt,children:Vr.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[xt,(kt||St)&&Vr.jsx(VG,{call:ct,output:kt,isError:St})]})})]})})}function Rve({isFirst:ot,isLast:st,text:ct,inProgress:gt=!1,durationMs:bt}){let[yt,vt]=uA.useState(!1);if(!ct){let Ct=bt===void 0?"Thought":`Thought for ${Dd(bt)}`;return Vr.jsx(Ym,{isFirst:ot,isLast:st,loading:gt,children:Vr.jsx("div",{className:n(GC,"min-w-0 flex-1 cursor-default"),children:Vr.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:gt?"Thinking":Ct})})})}let xt=gt?"Thinking":"Thought",wt=gt||yt;return Vr.jsx(Ym,{isFirst:ot,isLast:st,loading:gt,children:Vr.jsxs("div",{className:"min-w-0 flex-1",children:[Vr.jsxs("button",{type:"button","aria-expanded":wt,onClick:()=>vt((Ct)=>!Ct),className:n(GC,"cursor-pointer"),children:[Vr.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:xt}),Vr.jsx(Jb,{open:wt})]}),Vr.jsx(qb,{open:wt,children:Vr.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:Vr.jsx(tV,{content:ct})})})]})})}function Tve({call:ot,cwd:st,isFirst:ct,isLast:gt}){if(ot.caller==="subagent")return Vr.jsx(NG,{call:ot,cwd:st,isFirst:ct,isLast:gt,renderNestedParts:(vt,xt)=>Vr.jsx(YC,{parts:vt,cwd:xt})});if(ot.name==="Skill"&&ot.skill){let vt=ot.state==="success";return Vr.jsx(cA,{isFirst:ct,isLast:gt,call:ot,marker:vt?Vr.jsx(iG,{icon:hO,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:ot.skill.skillName})}let bt=XM(ot)??YM(ot)??ZM(ot);if(bt){let vt=eA(bt.server,bt.tool);return Vr.jsx(cA,{isFirst:ct,isLast:gt,call:ot,marker:Vr.jsx(sG,{src:UC(bt.server)}),name:jC(bt.server),brief:bt.rest?`${vt} ${bt.rest}`:vt})}let yt=ot.state==="error"?null:eG(ot,st);return Vr.jsx(cA,{isFirst:ct,isLast:gt,call:ot,leading:Vr.jsx(Pve,{call:ot}),name:IG(ot),brief:MG(ot,st),preview:yt?Vr.jsx(tG,{relPath:yt}):void 0})}function Pve({call:ot}){if(ot.caller!=="mcp"&&ot.caller!=="server-tool")return null;let st=ot.caller==="mcp"?`mcp${ot.mcpServer?`:${ot.mcpServer.slice(0,8)}`:""}`:"server";return Vr.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:st})}var Lr=e(r(),1);function qG(ot){if(ot.type==="reasoning")return!0;if(ot.type==="tool-call")return!0;return!1}function Ive(ot){let st=[];for(let ct of ot)if(qG(ct)){let gt=st[st.length-1];if(gt&&gt.kind==="run")gt.parts.push(ct);else st.push({kind:"run",parts:[ct]})}else st.push({kind:"single",part:ct});return st}function ZC({parts:ot,cwd:st,processing:ct=!1}){let gt=Ive(ot);return Lr.jsx("div",{className:"flex flex-col",children:gt.map((bt,yt)=>{let vt=yt===0?"":"mt-3",xt=yt===gt.length-1;return Lr.jsx("div",{className:vt,children:bt.kind==="run"?Lr.jsx(YC,{parts:bt.parts,cwd:st,processing:ct&&xt}):Lr.jsx(_ve,{part:bt.part})},yt)})})}function Mve(ot){return ot.some((st)=>st.type!=="text"||st.text.trim().length>0)}function Ave(ot){let st=-1;for(let gt=ot.length-1;gt>=0;gt--)if(qG(ot[gt])){st=gt;break}if(st<0)return null;let ct=ot.slice(st+1);if(!Mve(ct))return null;return{work:ot.slice(0,st+1),response:ct}}function Nve({parts:ot,cwd:st,durationMs:ct,defaultOpen:gt}){let bt=ct===void 0?"Worked":`Worked for ${Dd(ct)}`;return Lr.jsxs(u1,{defaultOpen:gt,className:"group/collapsible",children:[Lr.jsxs(p1,{className:"flex w-fit items-center gap-1 rounded-sm py-1 text-left text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[Lr.jsx("span",{children:bt}),Lr.jsx(sc,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),Lr.jsx(d1,{className:"overflow-hidden pt-2",children:Lr.jsx(ZC,{parts:ot,cwd:st})})]})}function Dve({parts:ot,cwd:st,processing:ct=!1,durationMs:gt}){let bt=ct?null:Ave(ot);return Lr.jsx("div",{className:"w-full min-w-0",children:ct?Lr.jsx(ZC,{parts:ot,cwd:st,processing:!0}):bt?Lr.jsxs("div",{className:"flex flex-col gap-3",children:[Lr.jsx(Nve,{parts:bt.work,cwd:st,durationMs:gt}),Lr.jsx(ZC,{parts:bt.response,cwd:st})]}):Lr.jsx(ZC,{parts:ot,cwd:st})})}var QG=KG.memo(function({turn:st,processing:ct=!1}){let gt=Sr().cwd;if(st.role==="user"&&st.origin.kind==="user-input"){let bt=st.parts.filter((xt)=>xt.type==="file-attachment"),yt=st.parts.filter((xt)=>xt.type==="text-attachment"),vt=st.parts.filter((xt)=>xt.type==="text").map((xt)=>xt.type==="text"?xt.text:"").join(`
71
+ `);if(!vt&&bt.length===0&&yt.length===0)return null;return Lr.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[yt.map((xt,wt)=>Lr.jsx(wb,{label:xt.label},`text-attachment:${wt}`)),bt.map((xt,wt)=>Lr.jsx(JG,{mediaType:xt.mediaType,previewUrl:xt.previewUrl,label:xt.label},wt)),vt&&Lr.jsx(nV,{content:vt})]})}return Lr.jsx(Dve,{parts:st.parts,cwd:gt,processing:ct,durationMs:st.meta?.durationMs})});function _ve({part:ot}){switch(ot.type){case"text-attachment":return Lr.jsx(wb,{label:ot.label});case"text":return Lr.jsx($C,{content:ot.text});case"tool-call":return Lr.jsx(YC,{parts:[ot],cwd:null});case"file-attachment":return Lr.jsx(JG,{mediaType:ot.mediaType,previewUrl:ot.previewUrl,label:ot.label});case"source-url":return Lr.jsx(GG,{url:ot.url,title:ot.title});case"source-document":return Lr.jsx(GG,{url:"#",title:ot.title});case"data":return Lr.jsx(Ove,{name:ot.name,data:ot.data});case"reasoning":return null}}function JG({mediaType:ot,previewUrl:st,label:ct}){if(ot.startsWith("image/")&&st)return Lr.jsx("img",{src:st,alt:ct??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return Lr.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[Lr.jsx(df,{size:16,stroke:1.75}),Lr.jsx("span",{className:"truncate",children:ct??ot})]})}function GG({url:ot,title:st}){return Lr.jsx("a",{href:ot,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:st??ot})}function Ove({name:ot,data:st}){return Lr.jsxs("details",{children:[Lr.jsxs("summary",{className:"cursor-pointer list-none text-xs text-muted-foreground marker:hidden [&::-webkit-details-marker]:hidden",children:["data:",ot]}),Lr.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(st,null,2)})]})}var Qr=e(r(),1),Lve=[],Bve=[];function pA({forkedFromSessionId:ot,agent:st,active:ct=!0,focusRequest:gt=0,docked:bt=!1,chatLoaded:yt,hasWorkspaceApplets:vt,view:xt,previewTurn:wt,sessionId:Ct,processing:St,composerBanner:Et,agentAvailability:kt,annotation:Rt,send:Tt,stop:Pt,onNavigateFromWelcome:Mt,onClose:It,viewDraft:At}){let Nt=b(),{base:Ot}=pi(),{data:Dt}=Gv(Nt),_t=Dt?.find((gn)=>gn.sessionId===ot)?.summary,$t=uc(),Ft=ws.useRef(null),Bt=ws.useRef(null),Lt=At?.sessionId??Ct??Yo($t),Vt=At?null:Ct??null,Wt=At?Lve:xt.turns,Ut=Ar((gn)=>gn.hasSentMessageFromMoi),Ht=Ar((gn)=>(gn.workspaceIdsPendingAnalysis??[]).includes(Nt)),Gt=gi((gn)=>(gn.attachments[As(Nt,Lt)]??[]).some((xn)=>xn.kind!=="text"&&xn.status==="uploading")),jt=yt||!!At,qt=!jt||!xb(!0,Gt,kt),Qt=At?null:wt,Xt=At?Bve:xt.notices,zt=ws.useMemo(()=>vz(Wt),[Wt]),tn=ws.useMemo(()=>yz(zt,Qt),[zt,Qt]),rn=ws.useMemo(()=>wz(tn,Xt),[tn,Xt]),Kt=tn.length>0?tn[tn.length-1].id:null,an=At?!1:St,ln=!!At||!ot&&yt&&rn.length===0&&!an,Zt=yt&&!ln,on=T7({tabId:$t,isViewDraft:!!At,hasSentMessageFromMoi:Ut,isWorkspacePendingAnalysis:Ht}),{atBottom:sn,scrollToBottom:dn,scrollToTop:fn}=hz(Bt,Lt);ws.useLayoutEffect(()=>{if(ln&&on!=="overview-empty"&&on!=="tab-empty")fn()},[ln,on,fn]),ws.useEffect(()=>{if(ct)_P(Ft.current)},[ct,gt]);let bn=ws.useCallback(async(gn,xn)=>{await Tt(gn,xn),dn()},[Tt,dn]),hn=ws.useCallback((gn)=>{if(qt)return;bn(gn.prompt,{directives:gn.context})},[bn,qt]);return Qr.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[Qr.jsxs("header",{className:"flex w-full min-w-0 items-center justify-between pr-2 pb-2 pl-2",children:[Qr.jsx("div",{className:"flex h-7 min-w-0 flex-1",children:Qr.jsx(M7,{className:n("text-foreground",bt&&"text-muted-foreground")})}),bt&&Qr.jsxs(Wr,{children:[Qr.jsx(Ur,{render:Qr.jsx(a,{variant:"ghost",size:"icon-sm",onClick:It,"aria-label":"Undock chat",children:Qr.jsx(HO,{className:"size-5! text-muted-foreground",stroke:1.5})})}),Qr.jsx(jr,{children:"Undock chat"})]}),!At&&!bt&&Qr.jsx(a,{variant:"ghost",size:"icon-sm",onClick:It,"aria-label":"Close chat",children:Qr.jsx(zo,{stroke:2})})]}),Qr.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[Qr.jsx("div",{ref:Bt,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-8 [--scroll-fade-reveal:8px]",children:Qr.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[ot&&Qr.jsx("a",{href:Fs(`moi:/chats/${encodeURIComponent(ot)}`,{workspaceId:Nt,base:Ot}),className:"block text-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:Qr.jsxs("div",{className:"flex items-center gap-3",children:[Qr.jsx(O0,{size:20,stroke:1.5,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),Qr.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[Qr.jsx("span",{className:"text-muted-foreground",children:"Started from another chat"}),Qr.jsx("span",{className:"truncate font-medium",title:_t,children:_t||"Another chat"})]})]})}),ln&&Qr.jsx(P7,{agent:st,kind:on,hasWorkspaceApplets:vt,disabled:qt,onSelectPrompt:hn,onNavigate:Mt}),Zt&&rn.map((gn)=>gn.kind==="notice"?Qr.jsx(Fve,{notice:gn.notice},`notice:${gn.notice.id}`):Qr.jsx(QG,{turn:gn.turn,processing:an&&gn.turn.id===Kt},gn.turn.id)),Zt&&Qr.jsx("div",{className:"mt-auto -ml-3 pt-2",children:Qr.jsx(Pl,{preset:st,color:"primary",animated:an,expression:an?"thinking":void 0})})]})}),Zt&&!sn&&Wt.length>0&&Qr.jsx(a,{type:"button",variant:"outline",size:"icon",onClick:()=>dn("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:Qr.jsx(qc,{stroke:1.5})})]}),Qr.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:Qr.jsxs("div",{className:n("@container flex w-full flex-col transition-[padding]",Et&&"gap-2 rounded-t-lg rounded-b-2xl p-2",Et?.tone==="default"&&"bg-accent",Et?.tone==="error"&&"bg-destructive/10"),children:[Et?.content,Qr.jsx(k7,{composerRef:Ft,onSend:bn,onStop:Pt,processing:an,sessionId:Lt,modelSessionId:Vt,availability:kt,chatReady:jt,annotation:At?void 0:Rt,onRemoveDrawing:At?.onRemoveDrawing??Rt?.onRemove,allowFiles:!At,placeholder:At?"Drop in the details":void 0})]})})]})}function Fve({notice:ot}){let st=OP(ot);if(!st)return null;return Qr.jsx("div",{className:"flex justify-center",children:Qr.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:st})})}var ag=e(t(),1);var UK=e(AA(),1);var Ba=e(r(),1);function jK({agent:ot,loading:st,open:ct,onOpenChange:gt,onOpenChangeComplete:bt,children:yt}){let vt=ag.useRef(null),xt=Ar((Pt)=>Pt.popupChatWidth),wt=Ar((Pt)=>Pt.setPopupChatWidth),[Ct,St]=ag.useState({width:xt,min:0,max:xt}),Et=ag.useCallback((Pt)=>{if(vt.current=Pt,!Pt)return;Pt.style.setProperty("--chat-popup-width",`${xt}px`);let Mt=new ResizeObserver(([It])=>{if(!It)return;let{minWidth:At,maxWidth:Nt}=getComputedStyle(Pt);St({width:Math.round(It.contentRect.width),min:parseFloat(At),max:parseFloat(Nt)})});return Mt.observe(Pt),()=>{Mt.disconnect(),vt.current=null}},[xt]),kt=(Pt)=>{if(!vt.current)return;let{minWidth:Mt,maxWidth:It}=getComputedStyle(vt.current);wt(Math.round(Math.min(parseFloat(It),Math.max(parseFloat(Mt),Pt))))},Rt=()=>gt(!1);return Ba.jsxs(ou,{open:ct,onOpenChange:(Pt,Mt)=>{if(!Pt&&(Mt.reason==="outside-press"||Mt.reason==="focus-out")){Mt.cancel();return}gt(Pt)},onOpenChangeComplete:bt,children:[Ba.jsx(iu,{render:Ba.jsx("div",{className:"fixed right-3 bottom-3",children:Ba.jsx(S.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:ct?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:Ba.jsx("button",{type:"button",className:"group block cursor-pointer p-0 drop-shadow-[0_0_4px_var(--background)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":"Agent",children:Ba.jsx(Pl,{preset:ot,color:"primary",animated:st,size:st?80:64,expression:st?"thinking":void 0,className:n("drop-shadow-md drop-shadow-primary/25","group-hover:drop-shadow-lg group-hover:drop-shadow-primary/40","transition-[width,height,filter] duration-300 ease-in-out motion-reduce:transition-none")})})})})}),Ba.jsx(UK.Resizable,{axis:"x",width:Ct.width,height:0,resizeHandles:["w"],minConstraints:[Ct.min,0],maxConstraints:[Ct.max,0],onResize:(Pt,{size:Mt})=>wt(Math.round(Mt.width)),handle:Ba.jsx("div",{role:"separator","aria-label":"Resize chat popup","aria-orientation":"vertical","aria-valuemin":Ct.min,"aria-valuemax":Ct.max,"aria-valuenow":Ct.width,"aria-valuetext":`${Ct.width} pixels wide`,tabIndex:0,className:"absolute inset-y-6 -left-1 w-2 cursor-ew-resize touch-none rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onKeyDown:(Pt)=>{let Mt=vt.current?.offsetWidth??xt,It=Pt.shiftKey?32:16;if(Pt.key==="ArrowLeft")kt(Mt+It);else if(Pt.key==="ArrowRight")kt(Mt-It);else if(Pt.key==="Home")kt(-1/0);else if(Pt.key==="End")kt(1/0);else return;Pt.preventDefault()}}),children:Ba.jsx(su,{ref:Et,side:"top",sideOffset:({anchor:Pt})=>-Pt.height,align:"end",className:"relative flex h-[calc(100vh-2rem)] w-(--chat-popup-width) max-w-[calc(100vw-1.5rem)] min-w-[min(440px,calc(100vw-1.5rem))] flex-col gap-0 rounded-3xl p-0 transition-[opacity,transform] sm:h-[calc(100vh-8rem)]",keepMounted:!0,children:yt(Rt)})})]})}var wc=e(r(),1);function pS({actions:ot,className:st,title:ct,children:gt,onClose:bt,ref:yt}){return wc.jsxs(S.div,{ref:yt,className:n("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-popover text-popover-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad)",gt&&"pb-0",st),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:[wc.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[wc.jsx("p",{className:"text-sm font-medium",children:ct}),wc.jsxs("div",{className:"flex items-center gap-2",children:[ot,wc.jsx(a,{type:"button",variant:"ghost",size:"icon-sm",onClick:bt,"aria-label":"Close panel",children:wc.jsx(zo,{stroke:1.75})})]})]}),gt&&wc.jsx("div",{className:"flex-1 pb-(--page-pad)",children:gt})]})}var ao=e(r(),1),Gwe=Object.entries(ku),Kwe=Object.entries(Fx),qwe=Object.entries(Ah),Qwe=Object.entries(Nh),Jwe="relative w-full rounded-lg text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50";function dS({children:ot,className:st,gridClassName:ct,label:gt}){return ao.jsxs("div",{className:n("flex flex-col gap-2",st),children:[ao.jsx("p",{className:"text-xs font-medium",children:gt}),ao.jsx("div",{role:"group","aria-label":gt,className:n("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",ct),children:ot})]})}function fS({active:ot,children:st,className:ct,onSelect:gt,style:bt}){return ao.jsxs("button",{type:"button","aria-pressed":ot,onClick:gt,className:n(Jwe,"flex items-center gap-2 p-3",ct,!ot&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:bt,children:[ao.jsx("div",{className:"flex flex-1 flex-col justify-center",children:st}),ot&&ao.jsx(Y0,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function VK({onClose:ot,ref:st}){rm();let{layout:ct,setLayout:gt}=Sr(),bt=_s(ct.theme);function yt(vt){gt({theme:{...bt,...vt}})}return ao.jsx(pS,{ref:st,title:"Theme",onClose:ot,className:"@4xl/workspace:max-w-5xl",children:ao.jsxs("div",{className:"grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2",children:[ao.jsx(dS,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:Gwe.map(([vt,xt])=>ao.jsx(fS,{active:vt===bt.font,onSelect:()=>yt({font:vt}),style:{fontFamily:xt.sans},children:ao.jsx("span",{className:"text-sm font-medium",children:xt.label})},vt))}),ao.jsx(dS,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:Kwe.map(([vt,xt])=>ao.jsx(fS,{active:vt===bt.color,className:xt.primary&&"bg-background text-foreground",onSelect:()=>yt({color:vt}),style:Ls({...bt,color:vt}),children:ao.jsxs("div",{className:"flex gap-2",children:[ao.jsx("span",{className:n("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",xt.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),ao.jsx("span",{className:"text-sm font-medium",children:xt.label})]})},vt))}),ao.jsx(dS,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:qwe.map(([vt,xt])=>ao.jsx(fS,{active:vt===bt.radius,onSelect:()=>yt({radius:vt}),style:Ls({...bt,radius:vt}),children:ao.jsxs("div",{className:"flex items-center gap-2",children:[ao.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),ao.jsx("span",{className:"text-sm font-medium",children:xt.label})]})},vt))}),ao.jsx(dS,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:Qwe.map(([vt,xt])=>ao.jsx(fS,{active:vt===bt.agent,onSelect:()=>yt({agent:vt}),children:ao.jsxs("div",{className:"flex items-center gap-2",children:[ao.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:ao.jsx(Pl,{preset:vt,color:"primary",size:28})}),ao.jsx("span",{className:"text-sm font-medium",children:xt.label})]})},vt))})]})})}var YS=e(t(),1);var qK=e(t(),1);function GK(ot){return kr({queryKey:Tn.appletThumbnails(ot),queryFn:async()=>(await p(`/api/workspaces/${ot}/applet-thumbnails`)).thumbnails,...hc})}function KK(ot){let st=Kn();return zr({mutationFn:(ct)=>H(`/api/workspaces/${ot}/applet-thumbnails`,v("PUT",ct),"Failed to save applet thumbnails"),onSuccess:()=>{st.invalidateQueries({queryKey:Tn.appletThumbnails(ot)}),st.invalidateQueries({queryKey:Tn.previews})}})}var Xwe=1000,Ywe=3,Zwe=10800000,e1e=1000,t1e="1000px-3x-webp-q80-v1",n1e=5000,r1e=1000,o1e=1e4,i1e=100,s1e=5000;function a1e(ot){return Math.min(Ywe,Xwe/Math.max(ot.offsetWidth,ot.offsetHeight))}function l1e(ot){return`${t1e}:${ot??""}`}function c1e(ot,st,ct=Date.now()){if(!ot||ot.revision!==st)return!0;let gt=Date.parse(ot.capturedAt);return!Number.isFinite(gt)||ct-gt>=Zwe}function u1e(ot,st){return ot!==void 0&&ot.revision===st&&ot.captureMs!==void 0&&ot.captureMs>=e1e}var p1e=(ot)=>new Promise((st)=>{setTimeout(()=>st(null),ot)});function d1e(ot,st=i1e){let ct=ot.getBoundingClientRect(),gt=ct.top-st,bt=ct.bottom+st,yt=ct.left-st,vt=ct.right+st;return(xt)=>{if(xt.nodeType!==1)return!0;let wt=xt,Ct=wt.getBoundingClientRect();if(Ct.width===0&&Ct.height===0)return wt.ownerDocument?.defaultView?.getComputedStyle(wt).display!=="none";return Ct.bottom>gt&&Ct.top<bt&&Ct.right>yt&&Ct.left<vt}}function f1e(ot,st,ct=s1e){let gt=ct,bt=(yt)=>{for(let vt of yt.children){if(!st(vt))continue;if(--gt<0)return!0;if(bt(vt))return!0}return!1};return bt(ot)}async function m1e(ot,st){let{createContext:ct,destroyContext:gt,domToDataUrl:bt}=await (Y("nf2wkvf9"),import("/chunk-nf2wkvf9.js")),yt=d1e(ot);if(f1e(ot,yt))return null;let vt=async()=>{let xt=await ct(ot,{scale:a1e(ot),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:r1e,filter:yt,...st&&{onCreateForeignObjectSvg:(wt)=>{let Ct=document.createElement("style");Ct.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",wt.append(Ct)}}});try{return await bt(xt)}finally{gt(xt)}};return Promise.race([vt(),p1e(o1e)])}async function g1e(ot,st,ct,gt,bt=m1e,yt=Date.now()){let vt=[];for(let xt of ct){if(gt())return null;let wt=l1e(xt.revision),Ct=st.find((Rt)=>Rt.kind===ot&&Rt.id===xt.id);if(!c1e(Ct,wt,yt)){vt.push({id:xt.id,revision:wt});continue}if(u1e(Ct,wt)){vt.push({id:xt.id,revision:wt});continue}if(!xt.element){vt.push({id:xt.id,revision:wt,image:null});continue}let St=performance.now(),Et=await bt(xt.element,ot==="widget").catch(()=>null),kt=Math.round(performance.now()-St);if(gt())return null;vt.push({id:xt.id,revision:wt,image:Et,captureMs:kt})}return vt}function mS({kind:ot,enabled:st,targets:ct}){let gt=b(),bt=GK(gt).data,yt=KK(gt),vt=k(ct),xt=k(bt??[]),wt=k(yt.mutate),Ct=ct.map((Et)=>`${Et.id}@${Et.revision??""}`).join(`
72
+ `),St=bt!==void 0;qK.useEffect(()=>{if(!st||!St||Ct==="")return;let Et=!1,kt=0,Rt,Tt=()=>{kt+=1;let Pt=kt;if(Rt!==void 0)clearTimeout(Rt);if(document.visibilityState!=="visible")return;Rt=setTimeout(async()=>{Rt=void 0;let Mt=await g1e(ot,xt.current,vt.current.map((It)=>({...It,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(Uu(ot==="view"?"views":"widgets",It.id))}"]`)})),()=>Et||kt!==Pt||document.visibilityState!=="visible");if(!Mt||Et||document.visibilityState!=="visible")return;wt.current({kind:ot,thumbnails:Mt})},n1e)};return document.addEventListener("visibilitychange",Tt),Tt(),()=>{if(Et=!0,Rt!==void 0)clearTimeout(Rt);document.removeEventListener("visibilitychange",Tt)}},[st,ot,St,xt,wt,Ct,vt])}var Cq=e(t(),1);var QK=e(t(),1);var vi=e(r(),1);function h1e(ot){if(ot==="needs-auth")return"Needs auth";return ot[0].toUpperCase()+ot.slice(1)}function b1e({name:ot,status:st,iconUrl:ct}){let[gt,bt]=QK.useState(),yt=ct??UC(ot),vt="size-full rounded-lg ring-2 ring-background";return vi.jsxs("span",{className:"relative size-10 shrink-0",children:[yt&&yt!==gt?vi.jsx("img",{src:yt,alt:"",className:"size-full rounded-lg ring-2 ring-background",onError:()=>bt(yt)}):vi.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:vi.jsx(VC,{className:"size-5"})}),st!=="connected"&&vi.jsx(t5,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function JK(ot){return[...ot].sort((st,ct)=>Number(ct.status==="connected")-Number(st.status==="connected"))}function XK({icon:ot,children:st}){return vi.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[ot,vi.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:st})]})}function YK({server:ot}){return vi.jsxs(XK,{icon:vi.jsx(b1e,{name:ot.displayName??ot.name,status:ot.status,iconUrl:ot.iconUrl}),children:[vi.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:ot.displayName??jC(ot.name)}),vi.jsx("span",{className:"text-sm text-muted-foreground",children:h1e(ot.status)})]})}function ZK(){return vi.jsxs(XK,{icon:vi.jsx(Bs,{className:"size-10 shrink-0 rounded-lg"}),children:[vi.jsx(Bs,{className:"h-4 w-36 max-w-full"}),vi.jsx(Bs,{className:"h-4 w-20"})]})}function NA({children:ot}){return vi.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:ot})}async function eq(ot,st){if(!ot.ok||!ot.body)throw Error("Could not load connectors");let ct=ot.body.pipeThrough(new TextDecoderStream).getReader(),gt="";try{while(!0){let bt=await ct.read();if(bt.done)throw Error("Connector discovery ended before completion");gt+=bt.value;let yt;while((yt=gt.indexOf(`
73
+ `))!==-1){let vt=gt.slice(0,yt);if(gt=gt.slice(yt+1),!vt.trim())continue;let xt=JSON.parse(vt);if(xt.error)throw Error(xt.error);if(!xt.connectors)continue;if(xt.done)return xt.connectors;st(xt.connectors)}}}finally{await ct.cancel().catch(()=>{}),ct.releaseLock()}}function tq(ot,st){let ct=Kn();return kr({queryKey:Tn.mcp(ot),queryFn:async({signal:gt})=>eq(await fetch(`/api/workspaces/${ot}/mcp?stream=true`,{signal:gt}),(bt)=>{if(!gt.aborted)ct.setQueryData(Tn.mcp(ot),bt)}),retry:!1,enabled:st,staleTime:1/0,gcTime:1/0,refetchOnMount:"always",refetchOnWindowFocus:!1})}var Cs=e(r(),1);function lg({title:ot,description:st,children:ct}){return Cs.jsxs("div",{className:"flex flex-col gap-6",children:[Cs.jsxs("header",{className:"flex flex-col gap-0.5",children:[Cs.jsx("h2",{className:"text-lg font-medium",children:ot}),st&&Cs.jsx("p",{className:"text-sm text-muted-foreground",children:st})]}),ct]})}function cg({label:ot,children:st}){return Cs.jsxs("section",{className:"flex flex-col gap-2",children:[ot&&Cs.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:ot}),Cs.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border",children:st})]})}function ug({title:ot,description:st,control:ct}){return Cs.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[Cs.jsxs("div",{className:"flex min-w-0 flex-col",children:[Cs.jsx("span",{className:"text-sm font-medium",children:ot}),st&&Cs.jsx("span",{className:"text-xs text-muted-foreground",children:st})]}),ct&&Cs.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:ct})]})}var _o=e(r(),1),y1e=Array.from({length:4},(ot,st)=>st);function v1e({connectors:ot}){if(ot.isPending)return _o.jsx("div",{role:"status","aria-label":"Loading connectors",children:_o.jsx(NA,{children:y1e.map((st)=>_o.jsx(ZK,{},st))})});if(ot.isError&&!ot.data?.length)return _o.jsxs(DA,{children:[_o.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors"}),_o.jsx(a,{variant:"outline",size:"sm",onClick:()=>ot.refetch(),children:"Retry"})]});if(ot.data.length===0&&!ot.isFetching)return _o.jsxs(DA,{children:[_o.jsx(Q0,{size:24,stroke:1.5,className:"text-muted-foreground"}),_o.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured"})]});return _o.jsxs(_o.Fragment,{children:[_o.jsx(NA,{children:JK(ot.data).map((st)=>_o.jsx(YK,{server:st},st.name))}),ot.isFetching&&_o.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading connectors…"}),ot.isError&&_o.jsxs(DA,{children:[_o.jsx("p",{className:"text-sm text-muted-foreground",children:"Couldn’t load all connectors"}),_o.jsx(a,{variant:"outline",size:"sm",onClick:()=>ot.refetch(),children:"Retry"})]})]})}function DA({children:ot}){return _o.jsx("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 px-8 py-12 text-center",children:ot})}function nq(){let{workspaceId:ot,provider:st}=Sr(),ct=tq(ot,!0);return _o.jsx(lg,{title:"Connectors",description:st==="codex"?"Manage your connectors in the ChatGPT app":st==="claude-code"?"Manage your connectors in the Claude app":"Manage your connectors in your agent’s settings",children:_o.jsx(v1e,{connectors:ct})})}var LA=e(t(),1);var Od=e(t(),1);var gS=e(t(),1),_A=gS.createContext(void 0);function rq(){let ot=gS.useContext(_A);if(ot===void 0)throw Error(c(63));return ot}var oq="data-checked",iq="data-unchecked";var hS={...Iu,checked(ot){if(ot)return{[oq]:""};return{[iq]:""}}};var sq=e(t(),1);function bS(ot,st,ct,gt=!0,bt){let[yt,vt]=sq.useState(),xt=Cr(bt?`${bt}-label`:void 0),wt=ot??st??yt;return i(()=>{let Ct=ot||st||!gt?void 0:w1e(ct.current,xt);if(yt!==Ct)vt(Ct)}),wt}function w1e(ot,st){let ct=C1e(ot);if(!ct)return;if(!ct.id&&st)ct.id=st;return ct.id||void 0}function C1e(ot){if(!ot)return;let st=ot.parentElement;if(st&&st.tagName==="LABEL")return st;let ct=ot.id;if(ct){let bt=ot.nextElementSibling;if(bt&&bt.htmlFor===ct)return bt}let gt=ot.labels;return gt&&gt[0]}var iy=e(r(),1),aq=Od.forwardRef(function(st,ct){let{checked:gt,className:bt,defaultChecked:yt,"aria-labelledby":vt,form:xt,id:wt,inputRef:Ct,name:St,nativeButton:Et=!1,onCheckedChange:kt,readOnly:Rt=!1,required:Tt=!1,disabled:Pt=!1,render:Mt,uncheckedValue:It,value:At,style:Nt,...Ot}=st,{clearErrors:Dt}=Mu(),{state:_t,setTouched:$t,setDirty:Ft,validityData:Bt,setFilled:Lt,setFocused:Vt,validationMode:Wt,disabled:Ut,name:Ht,validation:Gt}=la(),{labelId:jt}=xl(),qt=Ut||Pt,Qt=Ht??St,Xt=Od.useRef(null),zt=L(Xt,Ct,Gt.inputRef),tn=Od.useRef(null),rn=Cr(),Kt=Nu({id:wt}),an=Et?void 0:Kt,[ln,Zt]=ms({controlled:gt,default:Boolean(yt),name:"Switch",state:"checked"});Au(tn,rn,ln,void 0,!qt,St),i(()=>{Lt(ln)},[ln,Lt]),dl(ln,()=>{Dt(Qt),Ft(ln!==Bt.initialValue),Gt.change(ln)});let{getButtonProps:on,buttonRef:sn}=P({disabled:qt,native:Et}),dn=bS(vt,jt,Xt,!Et,an),fn={id:Et?Kt:rn,role:"switch","aria-checked":ln,"aria-readonly":Rt||void 0,"aria-required":Tt||void 0,"aria-labelledby":dn,onFocus(){if(!qt)Vt(!0)},onBlur(){let xn=Xt.current;if(!xn||qt)return;if($t(!0),Vt(!1),Wt==="onBlur")Gt.commit(xn.checked)},onClick(xn){if(Rt||qt)return;xn.preventDefault();let wn=Xt.current;if(!wn)return;re(wn,xn)}},bn={...Gt.getValidationProps(qt),checked:ln,disabled:qt,form:xt,id:an,name:Qt,required:Tt,style:Qt?Zy:Sa,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:zt,onChange(xn){if(xn.nativeEvent.defaultPrevented)return;if(Rt){xn.preventDefault();return}let wn=xn.currentTarget.checked,yn=Ln(ec,xn.nativeEvent);if(kt?.(wn,yn),yn.isCanceled)return;Zt(wn)},onClick(xn){xn.stopPropagation()},onFocus(){tn.current?.focus()},...At!==void 0?{value:At}:g},hn=Od.useMemo(()=>({..._t,checked:ln,disabled:qt,readOnly:Rt,required:Tt}),[_t,ln,qt,Rt,Tt]),gn=l("span",st,{state:hn,ref:[ct,tn,sn],props:[fn,Ot,on,(xn)=>Gt.getValidationProps(qt,xn)],stateAttributesMapping:hS});return iy.jsxs(_A.Provider,{value:hn,children:[gn,!ln&&Qt&&It!==void 0&&iy.jsx("input",{type:"hidden",form:xt,name:Qt,value:It,disabled:qt}),iy.jsx("input",{...bn,suppressHydrationWarning:!0})]})});var lq=e(t(),1);var cq=lq.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,...vt}=st,xt=rq();return l("span",st,{state:xt,ref:ct,stateAttributesMapping:hS,props:vt})});var OA=e(r(),1);function pq({className:ot,...st}){return OA.jsx(aq,{"data-slot":"switch",className:u('peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-sm border border-transparent p-px transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:bg-primary data-unchecked:bg-accent data-disabled:cursor-not-allowed data-disabled:opacity-50 [:where([class~="group/field-label"]:has(:focus-visible))_&]:border-transparent [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',ot),...st,children:OA.jsx(cq,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-xs bg-background shadow-xs ring-0 transition-transform data-checked:translate-x-full data-checked:bg-white data-unchecked:translate-x-0"})})}function dq(ot){return kr({queryKey:Tn.env(ot),queryFn:()=>p(`/api/workspaces/${ot}/env`),...hc})}function fq(ot){let st=Kn();return zr({mutationFn:(ct)=>p(`/api/workspaces/${ot}/env`,v("PUT",ct)),onSuccess:(ct)=>{st.setQueryData(Tn.env(ot),ct)}})}function mq(ot){let st=Kn();return zr({mutationFn:(ct)=>H(`/api/workspaces/${ot}/config`,v("PUT",{name:ct}),"Failed to save name"),onSuccess:()=>{st.invalidateQueries({queryKey:Tn.layout(ot)}),st.invalidateQueries({queryKey:Tn.all})}})}function gq(ot){let st=Kn(),ct=["workspace-icon",ot];return zr({mutationKey:ct,scope:{id:`workspace-icon:${ot}`},mutationFn:async(gt)=>{if(gt.kind==="set"){await H(`/api/workspaces/${ot}/config`,v("PUT",{icon:gt.icon,origin:V}),"Failed to save icon");return}if(gt.kind==="reset"){await H(`/api/workspaces/${ot}/icon`,{method:"DELETE"},"Failed to reset icon");return}await p(`/api/workspaces/${ot}/icon`,{method:"PUT",headers:{"Content-Type":gt.file.type||"application/octet-stream"},body:gt.file})},onMutate:async(gt)=>{if(gt.kind!=="set")return;await Promise.all([st.cancelQueries({queryKey:Tn.layout(ot)}),st.cancelQueries({queryKey:Tn.all,exact:!0})]);let bt={icon:gt.icon};st.setQueryData(Tn.layout(ot),(yt)=>yt?{...yt,...bt}:yt),st.setQueryData(Tn.all,(yt)=>yt?.map((vt)=>vt.id===ot?{...vt,...bt}:vt))},onSettled:()=>{if(st.isMutating({mutationKey:ct})>1)return;st.invalidateQueries({queryKey:Tn.layout(ot)}),st.invalidateQueries({queryKey:Tn.all,exact:!0})}})}function hq(ot){let st=Kn();return E((ct)=>{if(ct.type==="env:updated"&&ct.workspaceId===ot)st.invalidateQueries({queryKey:Tn.env(ot)})}),{env:dq(ot),update:fq(ot)}}var Oo=e(r(),1),S1e={dotenv:".env",custom:"secret",both:"override"},E1e=/^[A-Za-z_][A-Za-z0-9_]*$/;function bq(){let{workspaceId:ot}=Sr(),{env:st,update:ct}=hq(ot),[gt,bt]=LA.useState(""),[yt,vt]=LA.useState(""),xt=E1e.test(gt),wt=xt&&yt.length>0&&!ct.isPending,Ct=()=>{if(!wt)return;ct.mutate({set:{[gt]:yt}},{onSuccess:()=>{bt(""),vt("")}})},St=st.data?.vars??[],Et=st.data?.files.reduce((Rt,Tt)=>Rt+Tt.count,0)??0,kt=st.data?.files.length??0;return Oo.jsxs(lg,{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:[Oo.jsxs(cg,{label:"Variables",children:[st.isLoading?Oo.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:Oo.jsx(No,{className:"size-4 animate-spin",stroke:1.75})}):St.length===0?Oo.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet"}):St.map((Rt)=>{let Tt=Rt.source!=="dotenv";return Oo.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[Oo.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:Rt.key}),Oo.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),Oo.jsx("span",{className:n("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",Rt.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:S1e[Rt.source]}),!Tt&&Oo.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),Oo.jsx(a,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>ct.mutate({remove:[Rt.key]}),disabled:!Tt,"aria-label":`Delete ${Rt.key}`,className:"disabled:invisible",children:Oo.jsx(J0,{stroke:1.75})})]},Rt.key)}),Oo.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[Oo.jsx(wl,{value:gt,onChange:(Rt)=>bt(Rt.target.value),placeholder:"NEW_KEY","aria-invalid":gt.length>0&&!xt,className:"h-7 w-40 font-mono text-xs"}),Oo.jsx(wl,{value:yt,onChange:(Rt)=>vt(Rt.target.value),onKeyDown:(Rt)=>{if(Rt.key==="Enter")Ct()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),Oo.jsxs(a,{variant:"outline",size:"sm",onClick:Ct,disabled:!wt,children:[ct.isPending?Oo.jsx(No,{stroke:1.75,className:"animate-spin"}):Oo.jsx(Ci,{stroke:1.75}),"Add"]})]})]}),Oo.jsx(cg,{label:"From .env files",children:Oo.jsx(ug,{title:"Inherit .env files",description:kt>0?`Discovered ${Et} ${Et===1?"key":"keys"} across ${kt} ${kt===1?"file":"files"} in this space`:"No .env files found in this space",control:Oo.jsx(pq,{checked:st.data?.inheritDotenv??!0,disabled:st.isLoading,onCheckedChange:(Rt)=>ct.mutate({inheritDotenv:Rt})})})})]})}function yq(ot){return iw("alert-dialog",ot)}var vq=aw;var Ui=e(r(),1);function yS({...ot}){return Ui.jsx(yq,{"data-slot":"alert-dialog",...ot})}function vS({...ot}){return Ui.jsx(vq,{"data-slot":"alert-dialog-trigger",...ot})}function k1e({...ot}){return Ui.jsx(Zs,{portal:rw,"data-slot":"alert-dialog-portal",...ot})}function R1e({className:ot,...st}){return Ui.jsx(Yx,{"data-slot":"alert-dialog-overlay",className:u("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",ot),...st})}function xS({className:ot,size:st="default",...ct}){return Ui.jsxs(k1e,{children:[Ui.jsx(R1e,{}),Ui.jsx(nw,{"data-slot":"alert-dialog-content","data-size":st,className:u("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm 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",ot),...ct})]})}function wS({className:ot,...st}){return Ui.jsx("div",{"data-slot":"alert-dialog-header",className:u("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",ot),...st})}function CS({className:ot,...st}){return Ui.jsx("div",{"data-slot":"alert-dialog-footer",className:u("-mx-6 -mb-6 flex flex-col-reverse gap-2 rounded-b-xl p-6 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",ot),...st})}function SS({className:ot,...st}){return Ui.jsx(sw,{"data-slot":"alert-dialog-title",className:u('text-base font-medium sm:group-data-[size=default]/alert-dialog-content:[:where([class~="group/alert-dialog-content"]):has([data-slot=alert-dialog-media])_&]:col-start-2',ot),...st})}function ES({className:ot,...st}){return Ui.jsx(ew,{"data-slot":"alert-dialog-description",className:u("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",ot),...st})}function kS({className:ot,...st}){return Ui.jsx(a,{"data-slot":"alert-dialog-action",className:u(ot),...st})}function RS({className:ot,variant:st="outline",size:ct="default",...gt}){return Ui.jsx(Zx,{"data-slot":"alert-dialog-cancel",className:u(ot),render:Ui.jsx(a,{variant:st,size:ct}),...gt})}var Nr=e(r(),1);function wq(){let{demo:ot,environment:st}=R(),{name:ct,cwd:gt,workspaceId:bt}=Sr(),[,yt]=Ai(),vt=Jx(),xt=ct??gt??"this space",wt=()=>{vt.mutate(bt,{onSuccess:()=>yt("/")})};return Nr.jsxs(lg,{title:"General",description:"Basic details for this space",children:[Nr.jsxs(cg,{children:[st==="local"&&Nr.jsx(ug,{title:"Path",control:Nr.jsx(wl,{value:gt??"","aria-label":"Workspace path",title:gt??void 0,className:"w-56",readOnly:!0})}),Nr.jsx(T1e,{})]}),!ot&&Nr.jsx(cg,{label:"Danger zone",children:Nr.jsx(ug,{title:"Remove space",description:"Removes this space from Moi, its folder and chats stay on disk",control:Nr.jsxs(yS,{children:[Nr.jsx(vS,{render:Nr.jsx(a,{type:"button",variant:"destructive"}),disabled:vt.isPending,children:"Remove"}),Nr.jsxs(xS,{children:[Nr.jsxs(wS,{children:[Nr.jsxs(SS,{children:["Remove “",xt,"” from your workspaces?"]}),Nr.jsx(ES,{children:"This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time."})]}),vt.isError&&Nr.jsx("p",{className:"text-xs text-destructive",children:vt.error.message}),Nr.jsxs(CS,{children:[Nr.jsx(RS,{disabled:vt.isPending,children:"Cancel"}),Nr.jsxs(kS,{type:"button",variant:"destructive",onClick:wt,disabled:vt.isPending,children:[vt.isPending&&Nr.jsx(No,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})]})]})]})})})]})}function T1e(){let{demo:ot}=R(),{workspaceId:st,provider:ct}=Sr(),gt=ct??"claude-code",bt=q8(st),yt=gi((xt)=>Object.entries(xt.activity).some(([wt,Ct])=>wt.startsWith(`${st}:`)&&Ct!=="idle")),vt=ot?"Changing agents is unavailable in the demo":gt==="hermes"||gt==="openclaw"?"This workspace belongs to its agent and cannot use another agent":yt?"Wait for the agent to finish before changing it":void 0;return Nr.jsxs(Nr.Fragment,{children:[Nr.jsx(ug,{title:"Agent",description:"Changing the agent changes which chats you see in this space",control:Nr.jsxs(Wr,{disabled:!vt,children:[Nr.jsx(Ur,{render:Nr.jsx("span",{tabIndex:vt?0:void 0,"aria-label":vt}),children:Nr.jsxs(hs,{children:[Nr.jsxs(bs,{render:Nr.jsx(a,{variant:"outline"}),disabled:Boolean(vt)||bt.isPending,"aria-label":"Agent",children:[Nr.jsx("img",{src:Os[gt],alt:"",className:"size-4 shrink-0"}),aa[gt],Nr.jsx(qc,{stroke:1.5})]}),Nr.jsx(ys,{align:"end",className:"min-w-44",children:Nr.jsx($w,{value:gt,onValueChange:(xt)=>bt.mutate(xt),children:["claude-code","codex"].map((xt)=>Nr.jsxs(Ww,{value:xt,children:[Nr.jsx("img",{src:Os[xt],alt:"",className:"size-4 shrink-0"}),aa[xt]]},xt))})})]})}),Nr.jsx(jr,{children:vt})]})}),bt.error&&Nr.jsx("p",{role:"alert",className:"text-sm text-destructive",children:bt.error.message})]})}var Ss=e(r(),1),P1e=[{id:"general",label:"General",icon:Qc},{id:"connectors",label:"Connectors",icon:Q0},{id:"environment",label:"Environment",icon:j0}];function TS({children:ot}){let[st,ct]=Cq.useState("general");return Ss.jsxs(Tu,{children:[ot,Ss.jsxs(om,{className:"flex h-[min(680px,90vh)] w-[880px] gap-0 overflow-hidden p-0 sm:max-w-[94vw]",children:[Ss.jsx(Pu,{className:"sr-only",children:"Space settings"}),Ss.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r bg-muted p-3",children:[Ss.jsx("p",{className:"px-2.5 pt-4 pb-2 text-xs text-muted-foreground",children:"Settings"}),P1e.map((gt)=>Ss.jsxs(a,{type:"button",variant:st===gt.id?"secondary":"ghost",size:"sm",onClick:()=>ct(gt.id),className:"justify-start",children:[Ss.jsx(gt.icon,{stroke:1.75}),gt.label]},gt.id))]}),Ss.jsx("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:Ss.jsxs("div",{className:"px-8 py-7",children:[st==="general"&&Ss.jsx(wq,{}),st==="connectors"&&Ss.jsx(nq,{}),st==="environment"&&Ss.jsx(bq,{})]})})]})]})}var Mq=e(t(),1);var Sq=e(t(),1);function I1e(ot){return{queryKey:Tn.views(ot),queryFn:async()=>(await p(`/api/workspaces/${ot}/views`)).views,staleTime:30000,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0}}function Eq(ot,st){if(!ot||!st)return;let ct=new Set(ot.map((bt)=>bt.id)),gt=Object.entries(st).filter(([bt])=>!ct.has(bt)).map(([bt,yt])=>({id:bt,...yt}));return[...ot,...gt]}function BA(ot,st){return Eq(ot.getQueryData(Tn.views(st)),na(ot,st)?.pendingViews)}var M1e=(ot)=>ot.pendingViews;function PS(ot){let st=Kn();E((yt)=>{if(yt.type==="view-layout:updated"&&yt.workspaceId===ot){let vt=Tn.views(ot);st.cancelQueries({queryKey:vt}),st.setQueryData(vt,yt.views)}if(yt.type==="view:deleted"&&yt.workspaceId===ot)st.invalidateQueries({queryKey:Tn.views(ot)}),st.invalidateQueries({queryKey:Tn.sessions(ot)})});let ct=kr(I1e(ot)),gt=du(ot,M1e);return{data:Sq.useMemo(()=>Eq(ct.data,gt.data),[ct.data,gt.data]),isLoading:ct.isLoading||gt.isLoading}}function sy(ot,st){let ct=Kn();return zr({mutationFn:st,onSuccess:()=>ct.invalidateQueries({queryKey:Tn.views(ot)})})}function kq(ot){return sy(ot,({viewId:st,title:ct})=>p(`/api/workspaces/${ot}/views/${encodeURIComponent(st)}`,v("PATCH",{title:ct}),"Couldn’t rename view"))}function FA(ot){return sy(ot,(st)=>H(`/api/workspaces/${ot}/views/${encodeURIComponent(st)}`,{method:"DELETE"},"Couldn’t delete view"))}function Rq(ot){return sy(ot,()=>p(`/api/workspaces/${ot}/views`,v("POST"),"Couldn’t create view"))}function Tq(ot){return sy(ot,({viewId:st,requirements:ct})=>p(`/api/workspaces/${ot}/views/${st}`,v("PATCH",{requirements:ct}),"Couldn’t save view requirements"))}function Pq(ot){return sy(ot,({viewId:st,...ct})=>p(`/api/workspaces/${ot}/views/${st}/submit`,v("POST",ct),"Couldn’t start view chat"))}var Iq=FA;function ay(ot){return ot.title||(ot.status==="compiled"?ot.id:"New view")}function ly(ot){return jf(ot.icon)??B0}var Er=e(r(),1);function A1e({outlined:ot,onClick:st}){return Er.jsxs("button",{type:"button","aria-label":"Create new view",onClick:st,className:n("group flex w-20 shrink-0 cursor-pointer flex-col items-center gap-2 text-sm",ot?"text-foreground":"text-muted-foreground"),children:[Er.jsx("div",{className:n("size-16 rounded-2xl squircle",ot&&"shadow-xs transition-shadow duration-300 ease-out group-hover:shadow-2xl"),children:Er.jsx("div",{className:n("flex size-full items-center justify-center rounded-2xl squircle",ot?"bg-background text-foreground":"bg-accent"),children:Er.jsx(Ci,{size:32,stroke:1.25})})}),Er.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:"New view"})]})}function N1e({view:ot,Icon:st,onOpen:ct}){let{workspaceId:gt}=Sr(),bt=kq(gt),yt=FA(gt),vt=ay(ot),[xt,wt]=Mq.useState(!1);function Ct(){wt(!0)}function St(Et){let kt=Et.trim();if(!kt||kt===vt)return;bt.mutate({viewId:ot.id,title:kt},{onError:(Rt)=>{qr.add({title:"Couldn’t rename view",description:Rt.message,type:"error"})}})}return Er.jsxs("div",{className:"group/item relative w-20 shrink-0",children:[Er.jsxs("button",{type:"button","aria-label":`Open ${vt}`,onClick:ct,className:"group flex w-20 cursor-pointer flex-col items-center gap-2 text-sm text-foreground",children:[Er.jsx("div",{className:"size-16 rounded-2xl transition-shadow duration-300 ease-out squircle group-hover:shadow-xl group-hover/item:shadow-xl",children:Er.jsx("div",{"data-vivid":!0,className:"flex size-full items-center justify-center rounded-2xl bg-primary text-primary-foreground inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)] squircle",children:Er.jsx(st,{size:32,stroke:1.25})})}),Er.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:xt?"":vt})]}),xt&&Er.jsx(fw,{autoFocus:!0,selectOnFocus:!0,"aria-label":`Rename ${vt}`,defaultValue:vt,onBlur:()=>wt(!1),onValueCommit:St,className:"absolute top-18 left-0 m-0 h-auto w-20 max-w-20 min-w-0 rounded-xs px-1 py-0 text-center text-xs leading-snug font-medium"}),Er.jsxs(yS,{children:[Er.jsxs(hs,{children:[Er.jsx(bs,{render:Er.jsx(a,{type:"button",variant:"outline",size:"icon-xs","aria-label":`View actions for ${vt}`,className:"absolute -top-1 right-1 border-0 opacity-0 shadow-xs transition-opacity group-hover/item:opacity-100 group-hover/item:delay-400 focus-visible:opacity-100 data-popup-open:opacity-100",children:Er.jsx($0,{stroke:1.75})})}),Er.jsxs(ys,{align:"end",className:"min-w-32",children:[Er.jsxs(vs,{onClick:Ct,disabled:bt.isPending,children:[Er.jsx(W0,{stroke:1.75}),"Rename"]}),Er.jsxs(vs,{nativeButton:!0,render:Er.jsx(vS,{}),disabled:yt.isPending,onClick:()=>yt.reset(),className:"w-full",children:[Er.jsx(J0,{stroke:1.75}),"Delete"]})]})]}),Er.jsxs(xS,{children:[Er.jsxs(wS,{children:[Er.jsxs(SS,{children:["Delete “",vt,"”?"]}),Er.jsx(ES,{children:"This deletes the view and its source code. Related data and shared files stay in the workspace."})]}),yt.isError&&Er.jsx("p",{className:"text-xs text-destructive",children:yt.error.message}),Er.jsxs(CS,{children:[Er.jsx(RS,{disabled:yt.isPending,children:"Cancel"}),Er.jsxs(kS,{type:"button",variant:"destructive",disabled:yt.isPending,onClick:()=>yt.mutate(ot.id),children:[yt.isPending&&Er.jsx(No,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Delete view"]})]})]})]})]})}function Aq({views:ot,onOpenView:st,onCreateView:ct,showOnboarding:gt}){let bt=ot.filter((vt)=>vt.status!=="draft"),yt=bt.length===0;return Er.jsxs("div",{className:"relative no-scrollbar flex size-full items-center overflow-hidden bg-muted",children:[yt&&Er.jsx("div",{className:"pointer-events-none absolute inset-0 texture-checker [mask-image:linear-gradient(to_right,transparent_40%,black_80%)]","aria-hidden":!0}),Er.jsx("h2",{className:"relative pr-6 pl-12 text-2xl font-semibold text-foreground",children:"Views"}),Er.jsxs("div",{className:"relative no-scrollbar flex scroll-fade-x gap-2 overflow-x-auto px-6 pt-4 [--scroll-fade-reveal:16px]",children:[bt.map((vt)=>Er.jsx(N1e,{view:vt,Icon:ly(vt),onOpen:()=>st(vt.id)},vt.id)),Er.jsx(A1e,{outlined:yt,onClick:ct})]}),yt&&gt&&Er.jsx("p",{className:"relative mr-8 ml-auto max-w-56 text-right text-sm text-muted-foreground",children:"Create new views when you need separate pages for focused tasks"})]})}var Dq=e(r(),1),D1e={[PP.id]:(ot)=>Dq.jsx(Aq,{views:ot.views,onOpenView:ot.onOpenView,onCreateView:ot.onCreateView,showOnboarding:ot.showOnboarding})};function Nq(ot,st){if(!Il(ot))return;return D1e[ot](st)}function _q(ot,st,ct,gt){let bt=ot.reduce((yt,vt)=>Math.max(yt,vt.y+vt.h),0);for(let yt=0;yt<=bt+ct;yt++)for(let vt=0;vt<=gt-st;vt++)if(!ot.some((wt)=>!(vt+st<=wt.x||wt.x+wt.w<=vt||yt+ct<=wt.y||wt.y+wt.h<=yt)))return{x:vt,y:yt};return{x:0,y:bt}}function cy(ot,st=[],ct=4){let gt=[];for(let bt of ot){let{x:yt,y:vt}=bt.x!==void 0&&bt.y!==void 0?{x:bt.x,y:bt.y}:_q([...st,...gt],bt.w,bt.h,ct);gt.push({i:bt.id,x:yt,y:vt,w:bt.w,h:bt.h})}return gt}function IS(ot,st,ct){return _q(ot,st,ct,4)}function Oq(ot,st){let ct=new Map(st.map((gt)=>[gt.id,gt]));return ot.map((gt)=>{let bt=ct.get(gt.i);return bt?{...gt,x:bt.x,y:bt.y}:gt})}var HA=e(t(),1),MS=new Map;function _1e(ot){let st=window.__moiAppletCss?.get(ot)??"",ct=MS.get(ot);if(!ct){let yt=document.createElement("style");yt.dataset.appletStyle=ot,document.head.appendChild(yt),ct={el:yt,refs:0},MS.set(ot,ct)}if(ct.el.textContent!==st)ct.el.textContent=st;ct.refs++;let gt=ct,bt=!1;return()=>{if(bt)return;if(bt=!0,gt.refs--,gt.refs<=0)gt.el.remove(),MS.delete(ot)}}function O1e(ot){let st=MS.get(ot);if(!st||st.el===document.head.lastElementChild)return;document.head.appendChild(st.el)}function AS(ot,st,ct=!1){HA.useInsertionEffect(()=>_1e(ot),[ot,st]),HA.useInsertionEffect(()=>{if(ct)O1e(ot)},[ot,ct,st])}var zA=e(r(),1);function Lq({segment:ot,name:st,version:ct,children:gt}){let bt=b(),yt=Uu(ot,st);return AS(C1(ot,bt,st),ct),zA.jsx("div",{"data-applet":yt,className:"size-full",children:zA.jsx(rh,{appletId:yt,children:gt})})}var Bq=e(t(),1);var pg=e(r(),1);class uy extends Bq.Component{state={error:null};static getDerivedStateFromError(ot){return{error:ot}}componentDidCatch(ot,st){console.error(`[widget:${this.props.name}]`,ot,st.componentStack),Ms(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:ot.message||String(ot),stack:[ot.stack,st.componentStack].filter(Boolean).join(`
74
+ `)})}componentDidUpdate(ot){if(ot.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return pg.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[pg.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[pg.jsx(_0,{size:16,stroke:1.75}),"Widget crashed"]}),pg.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var rp=e(r(),1);function Fq({name:ot}){let st=b(),ct=$8(ot);return rp.jsxs(Qi,{mode:"wait",initial:!1,children:[ct.status==="ready"&&rp.jsx(S.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:rp.jsx(uy,{name:ot,kind:"widget",workspaceId:st,resetKey:ct.version,children:rp.jsx(Lq,{segment:"widgets",name:ot,version:ct.version,children:rp.jsx(ct.Component,{})})})},ct.version),ct.status==="error"&&rp.jsx(S.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:ct.error},`err-${ct.version}`)]})}var Hq=e(t(),1);var op=e(r(),1);function NS({customizing:ot,hidden:st,widgetId:ct,onRemove:gt,children:bt}){let yt=ez(),vt=!ct||!Il(ct);return op.jsxs(S.div,{variants:{idle:{rotate:0},wiggle:{rotate:[0.5,-0.5],transition:{rotate:{repeat:1/0,repeatType:"reverse",duration:0.15,ease:"easeInOut"}}}},animate:ot?"wiggle":"idle",transition:{type:"spring",duration:0.35,bounce:0},className:"group/widget relative size-full",children:[op.jsx("div",{"data-widget-chrome":!0,"data-vivid":vt?!0:void 0,style:vt?Ls(yt,"widget"):void 0,className:n("absolute inset-0 overflow-hidden rounded-2xl text-foreground squircle",ot&&"pointer-events-none"),children:bt}),ot&&gt&&op.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:op.jsx(a,{size:"icon-sm",variant:"outline",className:"rounded-full","aria-label":st?"Restore widget":"Hide widget",onPointerDown:(xt)=>xt.stopPropagation(),onClick:gt,children:st?op.jsx(Ci,{stroke:1.75}):op.jsx(wL,{stroke:1.75})})})]})}var Cc=e(r(),1),L1e={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},B1e={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"},F1e={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},H1e={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function zq({items:ot,renderItem:st,onCreateWidget:ct,onClose:gt,onRestore:bt,ref:yt}){let vt=Hq.useMemo(()=>cy(ot),[ot]);return Cc.jsx(pS,{ref:yt,title:"Widgets",actions:Cc.jsxs(a,{type:"button",variant:"secondary",size:"sm",onClick:ct,children:[Cc.jsx(Ci,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),onClose:gt,className:"max-h-[60vh]",children:vt.length>0&&Cc.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:Cc.jsx(Qi,{children:vt.map((xt)=>Cc.jsx(S.div,{layoutId:xt.i,className:n(L1e[xt.x],B1e[xt.y],F1e[xt.w],H1e[xt.h]),transition:{type:"spring",duration:0.35,bounce:0},children:Cc.jsx(NS,{customizing:!0,widgetId:xt.i,onRemove:()=>bt(xt.i),hidden:!0,children:st(xt.i)})},xt.i))})})})}var GS=e(t(),1);var rs=e(t(),1);var rr=e(t(),1),dg=e(t(),1),js=e(t(),1),lQ=e(r(),1),_S=e(t(),1),OS=e(t(),1),Br=e(r(),1),z1e=Object.defineProperty,$1e=(ot,st)=>{for(var ct in st)z1e(ot,ct,{get:st[ct],enumerable:!0})},Sc={};$1e(Sc,{ActiveEmoji:()=>EQ,Empty:()=>SQ,List:()=>xQ,Loading:()=>CQ,Root:()=>fQ,Search:()=>mQ,SkinTone:()=>kQ,SkinToneSelector:()=>wQ,Viewport:()=>gQ});var nQ="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",UA=["none","light","medium-light","medium","medium-dark","dark"];function $A(ot){return ot.charAt(0).toUpperCase()+ot.slice(1)}var Fa=2,ji=null;function $q(ot){try{ji??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!ji||(queueMicrotask(()=>{ji&&(ji=null)}),ji.canvas.width=Fa,ji.canvas.height=Fa,ji.font=`2px ${nQ}`,ji.textBaseline="middle",ji.measureText(ot).width>=Fa*2))return!1;ji.fillStyle="#00f",ji.fillText(ot,0,0);let st=ji.getImageData(0,0,Fa,Fa).data;ji.clearRect(0,0,Fa,Fa),ji.fillStyle="#f00",ji.fillText(ot,0,0);let ct=ji.getImageData(0,0,Fa,Fa).data;for(let gt=0;gt<Fa*Fa*4;gt+=4)if(st[gt]!==ct[gt]||st[gt+1]!==ct[gt+1]||st[gt+2]!==ct[gt+2])return!1;return!0}function Wq(ot,st,ct){try{let gt=ot.getItem(st);if(!gt)throw Error(`No value found for "${st}".`);let bt=JSON.parse(gt);return ct(bt)}catch{return null}}function rQ(ot,st,ct){ot.setItem(st,JSON.stringify(ct))}function Uq(ot){return(st)=>st===void 0?void 0:ot(st)}function jq(ot){return(st)=>st===null?null:ot(st)}function Ri(ot){if(typeof ot!="string")throw Error();return ot}function DS(ot){if(typeof ot!="number")throw Error();return ot}function oQ(ot){if(typeof ot!="boolean")throw Error();return ot}function ip(ot){return(st)=>{if(typeof st!="object"||st===null)throw Error();let ct={};for(let gt in ot){let bt=st[gt];bt===void 0&&ot[gt](void 0),ct[gt]=ot[gt](bt)}return ct}}function WA(ot){return(st)=>{if(!Array.isArray(st))throw Error();return st.length>0&&ot(st[0]),st}}var iQ=(ot,st)=>`${ot}/${st}/data.json`,sQ=(ot,st)=>`${ot}/${st}/messages.json`,W1e=["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"],Vq="en",aQ=(ot)=>`frimousse/data/${ot}`,Gq="frimousse/metadata";async function Kq(ot,st){try{return(await fetch(ot,{method:"HEAD",signal:st})).headers.get("etag")}catch{return null}}async function U1e(ot,st,ct){let[{emojis:gt,emojisEtag:bt},{messages:yt,messagesEtag:vt}]=await Promise.all([fetch(iQ(ot,st),{signal:ct}).then(async(xt)=>({emojis:await xt.json(),emojisEtag:xt.headers.get("etag")})),fetch(sQ(ot,st),{signal:ct}).then(async(xt)=>({messages:await xt.json(),messagesEtag:xt.headers.get("etag")}))]);return{emojis:gt,messages:yt,emojisEtag:bt,messagesEtag:vt}}async function j1e(ot,st,ct){let[gt,bt]=await Promise.all([Kq(iQ(ot,st),ct),Kq(sQ(ot,st),ct)]);return{emojisEtag:gt,messagesEtag:bt}}function V1e(ot){return ot.skins?ot.skins.filter((st)=>typeof st.tone=="number").reduce((st,ct)=>{let gt=UA[ct.tone];return st[gt]=ct.emoji,st},{}):void 0}async function qq(ot,st,ct){let{emojis:gt,emojisEtag:bt,messages:yt,messagesEtag:vt}=await U1e(ot,st,ct),xt=yt.subgroups.find((Tt)=>Tt.key==="country-flag"||Tt.key==="subdivision-flag"),wt=yt.groups.filter((Tt)=>Tt.key!=="component"),Ct=gt.filter((Tt)=>("group"in Tt)),St=wt.map((Tt)=>({index:Tt.order,label:$A(Tt.message)})),Et=yt.skinTones.reduce((Tt,Pt)=>(Tt[Pt.key]=$A(Pt.message),Tt),{}),kt=Ct.map((Tt)=>({emoji:Tt.emoji,category:Tt.group,version:Tt.version,label:$A(Tt.label),tags:Tt.tags??[],countryFlag:xt&&Tt.subgroup===xt.order||void 0,skins:V1e(Tt)})),Rt={locale:st,emojis:kt,categories:St,skinTones:Et};return rQ(localStorage,aQ(st),{data:Rt,metadata:{emojisEtag:bt,messagesEtag:vt}}),Rt}function G1e(ot,st){let ct=new Map;for(let vt of ot)ct.has(vt.version)||ct.set(vt.version,vt.emoji);let gt=[...ct.keys()].sort((vt,xt)=>xt-vt),bt=gt[0]??0,yt=$q("\uD83C\uDDEA\uD83C\uDDFA");if(typeof st=="number")return{emojiVersion:st,countryFlags:yt};for(let vt of gt){let xt=ct.get(vt);if($q(xt))return{emojiVersion:vt,countryFlags:yt}}return{emojiVersion:bt,countryFlags:yt}}var K1e=ip({emojiVersion:DS,countryFlags:oQ}),q1e=ip({data:ip({locale:Ri,emojis:WA(ip({emoji:Ri,category:DS,label:Ri,version:DS,tags:WA(Ri),countryFlag:Uq(oQ),skins:Uq(ip({light:Ri,"medium-light":Ri,medium:Ri,"medium-dark":Ri,dark:Ri}))})),categories:WA(ip({index:DS,label:Ri})),skinTones:ip({light:Ri,"medium-light":Ri,medium:Ri,"medium-dark":Ri,dark:Ri})}),metadata:ip({emojisEtag:jq(Ri),messagesEtag:jq(Ri)})});async function Q1e({locale:ot,emojiVersion:st,emojibaseUrl:ct,signal:gt}){let bt=typeof ct=="string"?ct:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof st=="number"?Math.floor(st):"latest"}`,yt=Wq(sessionStorage,Gq,K1e),vt=Wq(localStorage,aQ(ot),q1e),xt;if(!vt)xt=await qq(bt,ot,gt);else if(yt)xt=vt.data;else try{let{emojisEtag:Ct,messagesEtag:St}=await j1e(bt,ot,gt);xt=!Ct||!St||Ct!==vt.metadata.emojisEtag||St!==vt.metadata.messagesEtag?await qq(bt,ot,gt):vt.data}catch{xt=vt.data}yt??=G1e(xt.emojis,st),rQ(sessionStorage,Gq,yt);let wt=xt.emojis.filter((Ct)=>{let St=Ct.version<=yt.emojiVersion;return Ct.countryFlag?St&&yt.countryFlags:St});return{locale:ot,emojis:wt,categories:xt.categories,skinTones:xt.skinTones}}function Qq(ot){return W1e.includes(ot)?ot:(console.warn(`Locale "${ot}" is not supported, using "${Vq}" instead.`),Vq)}function Jq(ot){return UA.includes(ot)?ot:(console.warn(`Skin tone "${ot}" is not valid, using "none" instead.`),"none")}function J1e(ot,st){let ct=[];if(st<=0)return ct;for(let gt=0,bt=ot.length;gt<bt;gt+=st)ct.push(ot.slice(gt,gt+st));return ct}function X1e(ot,st){if(!st)return ot;let ct=st.toLowerCase().trim(),gt=new WeakMap;return ot.filter((bt)=>{let yt=0;bt.label.toLowerCase().includes(ct)&&(yt+=10);for(let vt of bt.tags)vt.toLowerCase().includes(ct)&&(yt+=1);return yt>0?(gt.set(bt,yt),!0):!1}).sort((bt,yt)=>(gt.get(yt)??0)-(gt.get(bt)??0))}function Y1e(ot,st,ct,gt){let bt=X1e(ot.emojis,gt),yt=[],vt=[],xt=[],wt={},Ct=0,St=0;for(let Et of bt)wt[Et.category]||(wt[Et.category]=[]),wt[Et.category].push({emoji:ct&&ct!=="none"&&Et.skins?Et.skins[ct]:Et.emoji,label:Et.label});for(let Et of ot.categories){let kt=wt[Et.index];if(!kt||kt.length===0)continue;let Rt=J1e(Array.from(kt),st).map((Tt)=>({categoryIndex:Ct,emojis:Tt}));yt.push(...Rt),vt.push({label:Et.label,rowsCount:Rt.length,startRowIndex:St}),xt.push(St),Ct++,St+=Rt.length}return{count:bt.length,categories:vt,categoriesStartRowIndices:xt,rows:yt,skinTones:ot.skinTones}}function Z1e(ot){let st={},ct=null,gt=null,bt=new Set,yt=()=>{if(ct){st=ct,ct=null;for(let Ct of bt)Ct(st)}gt=null},vt=()=>ct??st,xt=(Ct)=>{ct??=st,Object.assign(ct,typeof Ct=="function"?Ct(vt()):Ct),gt||(gt=requestAnimationFrame(yt))},wt=(Ct)=>(bt.add(Ct),()=>bt.delete(Ct));return st=ot(xt,vt),{get:vt,set:xt,subscribe:wt}}function eCe(ot){let[st]=js.useState(ot);return st}function tCe(ot){let st=js.createContext(null);return{useStore:()=>{let ct=js.useContext(st);if(!ct)throw Error(ot);return ct},Provider:({store:ct,children:gt})=>lQ.jsx(st.Provider,{value:ct,children:gt})}}function Us(ot,st,ct=Object.is){let[gt,bt]=js.useState(()=>st(ot.get()));return js.useEffect(()=>ot.subscribe(()=>{let yt=st(ot.get());bt((vt)=>ct(vt,yt)?vt:yt)}),[ot,st,ct]),js.useDebugValue(gt),gt}function zl(ot,st,ct){let gt=js.useCallback((bt)=>bt[st],[st]);return Us(ot,gt,ct)}var Xq=2;function nCe(ot,st,ct,gt,bt){let yt=0;return Z1e((vt,xt)=>({locale:st,columns:ct,sticky:gt,skinTone:bt,onEmojiSelect:ot,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:(wt)=>{let Ct=xt(),St=wt?.data??Ct.data,Et=wt?.categoryHeaderHeight??Ct.categoryHeaderHeight,kt=wt?.rowHeight??Ct.rowHeight,Rt=wt?.viewportHeight??Ct.viewportHeight;if(!St||St.rows.length===0||!Et||!kt||!Rt)return vt({...wt,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let Tt=0,Pt=0;for(let Ft of St.categories)if(Pt++*Et+Ft.startRowIndex*kt<yt)Tt+=Et;else break;let Mt=St.categories.length*Et+St.rows.length*kt,It=Math.floor(Xq*kt/2),At=Math.ceil(Xq*kt/2),Nt=Math.min(yt-Tt-It,Mt-Rt),Ot=Nt+Rt+At,Dt=Math.max(0,Math.floor(Nt/kt)),_t=Math.min(St.rows.length-1,Math.ceil(Ot/kt)),$t=St.rows[Dt]?.categoryIndex;return vt($t===void 0&&wt?wt:{...wt,viewportStartCategoryIndex:$t,viewportStartRowIndex:Dt,viewportEndRowIndex:_t})},onDataChange:(wt)=>{xt().updateViewportState({data:wt,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(wt)=>{vt({search:wt,interaction:wt?"keyboard":"none"})},onActiveEmojiChange:(wt,Ct,St)=>{if(vt({interaction:wt,activeColumnIndex:Ct,activeRowIndex:St}),wt!=="keyboard")return;let{listRef:Et,viewportRef:kt,sticky:Rt,rowHeight:Tt,viewportHeight:Pt,categoryHeaderHeight:Mt}=xt(),It=Et?.current,At=kt?.current;if(!It||!At||!Tt||!Mt||!Pt)return;let Nt=St;Nt===0&&At.scrollTo({top:0,behavior:"instant"});let Ot=It.querySelector(`[aria-rowindex="${Nt}"]`);if(!(Ot instanceof HTMLElement))return;let Dt=Ot.offsetTop,_t=getComputedStyle(Ot),$t=Number.parseFloat(_t.scrollMarginTop),Ft=Number.parseFloat(_t.scrollMarginBottom),Bt=yt+$t;Rt&&Dt<yt+Pt/2&&(Bt+=Mt);let Lt=Bt+Pt-Ft;(Dt<Bt||Dt+Tt>Lt)&&At.scrollTo({top:Math.max(Dt<Bt+Mt?Dt-Math.max(Rt?Mt:0,$t):Dt-Pt+Tt+Ft,0),behavior:"instant"})},onActiveEmojiReset:()=>{vt({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(wt)=>{xt().updateViewportState({rowHeight:wt})},onCategoryHeaderHeightChange:(wt)=>{xt().updateViewportState({categoryHeaderHeight:wt})},onViewportSizeChange:(wt,Ct)=>{xt().updateViewportState({viewportWidth:wt,viewportHeight:Ct})},onViewportScroll:(wt)=>{yt=wt,xt().updateViewportState()}}))}var{useStore:Es,Provider:rCe}=tCe("EmojiPicker.Root is missing.");function oCe(ot){return ot.search}function jA(ot){return ot.interaction==="none"?void 0:ot.data?.rows[ot.activeRowIndex]?.emojis[ot.activeColumnIndex]}function iCe(ot){return ot.data===void 0||typeof ot.data?.count=="number"&&ot.data.count===0}function sCe(ot){return ot.data===null||ot.viewportHeight===null||ot.rowHeight===null||ot.categoryHeaderHeight===null}function cQ(ot){return ot.data?.rows.length}function aCe(ot){return ot.data?.categories.length}function lCe(ot){return ot.data?.categoriesStartRowIndices}function cCe(ot){return ot.data?.skinTones}function uQ(ot,st){return ot?.emoji===st?.emoji}function uCe(ot,st){return ot?.categoryIndex!==st?.categoryIndex||ot?.emojis.length!==st?.emojis.length?!1:!!ot?.emojis.every((ct,gt)=>uQ(ct,st?.emojis[gt]))}var py="‍",Yq=/\p{Emoji_Modifier_Base}/u,pCe=/\uFE0F$/,dCe=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,fCe={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function mCe(ot,st){if(!ot.split(py).some((gt)=>Yq.test(gt)))return ot;let ct=ot.split(py).map((gt)=>gt.replace(dCe,"")).join(py);return st==="none"?ct:ct.split(py).map((gt,bt,yt)=>{let vt=yt.length>1;return!Yq.test(gt)||vt&&gt==="\uD83E\uDD1D"?gt:gt.replace(pCe,"")+fCe[st]}).join(py)}function gCe(ot){return UA.map((st)=>({skinTone:st,emoji:mCe(ot,st)}))}function pQ(){let ot=Es(),st=Us(ot,jA,uQ);return dg.useDeferredValue(st)}function dQ(ot="✋"){let st=Es(),ct=zl(st,"skinTone"),gt=dg.useMemo(()=>gCe(ot),[ot]),bt=dg.useCallback((yt)=>{st.set({skinTone:yt})},[]);return[ct,bt,gt]}function VA(ot,st){if(Object.is(ot,st))return!0;if(typeof ot!="object"||typeof st!="object"||ot===null||st===null||Array.isArray(ot)!==Array.isArray(st))return!1;let ct=Object.keys(ot),gt=Object.keys(st);return ct.length!==gt.length?!1:ct.every((bt)=>(bt in st)&&ot[bt]===st[bt])}function hCe(...ot){}function bCe(ot,st){let ct=null;if(typeof window.requestIdleCallback=="function")ct=window.requestIdleCallback(ot,st);else{let gt=Date.now();ct=window.setTimeout(()=>{ot({didTimeout:!1,timeRemaining:()=>Math.max(0,(st?.timeout??50)-(Date.now()-gt))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(ct):window.clearTimeout(ct)}}var Ha=typeof window<"u"?_S.useLayoutEffect:_S.useEffect;function yCe(ot){let st=OS.useRef(ot);return Ha(()=>{st.current=ot}),OS.useCallback((...ct)=>st.current(...ct),[])}function vCe({emojiVersion:ot,emojibaseUrl:st}){let[ct,gt]=rr.useState(void 0),bt=Es(),yt=zl(bt,"locale"),vt=zl(bt,"columns"),xt=zl(bt,"skinTone"),wt=zl(bt,"search");return rr.useEffect(()=>{let Ct=new AbortController,St=Ct.signal;return Q1e({locale:yt,emojiVersion:ot,emojibaseUrl:st,signal:St}).then((Et)=>{gt(Et)}).catch((Et)=>{St.aborted||console.error(Et)}),()=>{Ct.abort()}},[ot,st,yt]),rr.useEffect(()=>{if(ct)return bCe(()=>{bt.get().onDataChange(Y1e(ct,vt,xt,wt))},{timeout:100})},[ct,vt,xt,wt]),null}var fQ=rr.forwardRef(({locale:ot="en",columns:st=9,skinTone:ct="none",onEmojiSelect:gt=hCe,emojiVersion:bt,emojibaseUrl:yt,onFocusCapture:vt,onBlurCapture:xt,children:wt,style:Ct,sticky:St=!0,...Et},kt)=>{let Rt=yCe(gt),Tt=eCe(()=>nCe(Rt,Qq(ot),st,St,Jq(ct))),[Pt,Mt]=rr.useState(!1),It=rr.useRef(null),At=rr.useCallback((Dt)=>{Dt&&(It.current=Dt,Tt.set({rootRef:It}))},[]);Ha(()=>{Tt.set({locale:Qq(ot)})},[ot]),Ha(()=>{Tt.set({columns:st})},[st]),Ha(()=>{Tt.set({sticky:St})},[St]),Ha(()=>{Tt.set({skinTone:Jq(ct)})},[ct]);let Nt=rr.useCallback((Dt)=>{vt?.(Dt);let{searchRef:_t,viewportRef:$t}=Tt.get(),Ft=Dt.target===_t?.current||Dt.target.hasAttribute("frimousse-search"),Bt=Dt.target===$t?.current||Dt.target.hasAttribute("frimousse-viewport");Dt.isDefaultPrevented()||(Mt(Ft||Bt),Dt.isDefaultPrevented()||(Mt(Ft||Bt),Bt?Tt.get().onActiveEmojiChange("keyboard",0,0):Ft&&Tt.get().search===""&&Tt.set({interaction:"none"})))},[vt]),Ot=rr.useCallback((Dt)=>{xt?.(Dt),!Dt.isDefaultPrevented()&&!Dt.currentTarget.contains(Dt.relatedTarget)&&Mt(!1)},[xt]);return Ha(()=>{Pt||Tt.get().onActiveEmojiReset()},[Pt]),rr.useImperativeHandle(kt,()=>It.current),rr.useEffect(()=>{if(!Pt)return;function Dt(_t){if(_t.defaultPrevented||!_t.key.startsWith("Arrow")&&_t.key!=="Enter")return;let{data:$t,onEmojiSelect:Ft,onActiveEmojiChange:Bt,interaction:Lt,activeColumnIndex:Vt,activeRowIndex:Wt}=Tt.get();if(_t.key==="Enter"){let Ut=jA(Tt.get());Ut&&(_t.preventDefault(),Ft(Ut))}if(_t.key.startsWith("Arrow")){let Ut=Vt,Ht=Wt;if(_t.preventDefault(),Lt!=="none"){if($t?.rows&&$t.rows.length>0)switch(_t.key){case"ArrowLeft":{if(Ut===0){let Gt=Ht-1,jt=$t.rows[Gt];jt&&(Ht=Gt,Ut=jt.emojis.length-1)}else Ut-=1;break}case"ArrowRight":{if(Ut===$t.rows[Ht].emojis.length-1){let Gt=Ht+1;$t.rows[Gt]&&(Ht=Gt,Ut=0)}else Ut+=1;break}case"ArrowUp":{let Gt=$t.rows[Ht-1];Gt&&(Ht-=1,Gt.emojis[Ut]||(Ut=Gt.emojis.length-1));break}case"ArrowDown":{let Gt=$t.rows[Ht+1];Gt&&(Ht+=1,Gt.emojis[Ut]||(Ut=Gt.emojis.length-1));break}}Bt("keyboard",Ut,Ht)}else Bt("keyboard",0,0)}}return document.addEventListener("keydown",Dt),()=>{document.removeEventListener("keydown",Dt)}},[Pt]),Ha(()=>{let Dt=null,_t=null,$t=null,Ft=null,Bt=Tt.subscribe((Ht)=>{It.current&&(Dt!==Ht.viewportWidth&&(Dt=Ht.viewportWidth,It.current.style.setProperty("--frimousse-viewport-width",`${Ht.viewportWidth}px`)),_t!==Ht.viewportHeight&&(_t=Ht.viewportHeight,It.current.style.setProperty("--frimousse-viewport-height",`${Ht.viewportHeight}px`)),$t!==Ht.rowHeight&&($t=Ht.rowHeight,It.current.style.setProperty("--frimousse-row-height",`${Ht.rowHeight}px`)),Ft!==Ht.categoryHeaderHeight&&(Ft=Ht.categoryHeaderHeight,It.current.style.setProperty("--frimousse-category-header-height",`${Ht.categoryHeaderHeight}px`)))}),{viewportWidth:Lt,viewportHeight:Vt,rowHeight:Wt,categoryHeaderHeight:Ut}=Tt.get();return Lt&&It.current.style.setProperty("--frimousse-viewport-width",`${Lt}px`),Vt&&It.current.style.setProperty("--frimousse-viewport-height",`${Vt}px`),Wt&&It.current.style.setProperty("--frimousse-row-height",`${Wt}px`),Ut&&It.current.style.setProperty("--frimousse-category-header-height",`${Ut}px`),Bt},[]),Br.jsx("div",{"data-focused":Pt?"":void 0,"frimousse-root":"",onBlurCapture:Ot,onFocusCapture:Nt,...Et,ref:At,style:{"--frimousse-emoji-font":nQ,...Ct},children:Br.jsxs(rCe,{store:Tt,children:[Br.jsx(vCe,{emojiVersion:bt,emojibaseUrl:yt}),wt]})})}),mQ=rr.forwardRef(({value:ot,defaultValue:st,onChange:ct,...gt},bt)=>{let yt=Es(),vt=rr.useRef(null),xt=rr.useCallback((Et)=>{Et&&(vt.current=Et,yt.set({searchRef:vt}))},[]),wt=typeof ot=="string",Ct=rr.useRef(wt);rr.useEffect(()=>{Ct.current=wt},[wt]),Ha(()=>{yt.set({search:typeof ot=="string"?ot:typeof st=="string"?st:""})},[]),Ha(()=>{typeof ot=="string"&&yt.get().onSearchChange(ot)},[ot]);let St=rr.useCallback((Et)=>{ct?.(Et),Et.isDefaultPrevented()||yt.get().onSearchChange(Et.target.value)},[ct]);return rr.useImperativeHandle(bt,()=>vt.current),Br.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...gt,defaultValue:st,onChange:St,ref:xt,value:ot})}),xCe=rr.memo(()=>{let ot=pQ();return ot?Br.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:ot.label}):null}),gQ=rr.forwardRef(({children:ot,onScroll:st,onKeyDown:ct,style:gt,...bt},yt)=>{let vt=Es(),xt=rr.useRef(null),wt=rr.useCallback((kt)=>{kt&&(xt.current=kt,vt.set({viewportRef:xt}))},[]),Ct=Us(vt,cQ),St=Us(vt,aCe),Et=rr.useCallback((kt)=>{st?.(kt),vt.get().onViewportScroll(kt.currentTarget.scrollTop)},[st]);return Ha(()=>{if(!xt.current)return;let kt=new ResizeObserver(([Rt])=>{let Tt=Rt?.borderBoxSize[0]?.inlineSize??0,Pt=Rt?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:Mt,viewportHeight:It,viewportWidth:At}=vt.get();(It!==Pt||At!==Tt)&&Mt(Tt,Pt)});return kt.observe(xt.current),vt.get().onViewportSizeChange(xt.current.offsetWidth,xt.current.clientHeight),()=>{kt.disconnect()}},[]),rr.useImperativeHandle(yt,()=>xt.current),Br.jsxs("div",{"frimousse-viewport":"",...bt,onScroll:Et,ref:wt,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof Ct=="number"&&typeof St=="number"?`var(--frimousse-viewport-width, auto) calc(${Ct} * var(--frimousse-row-height) + ${St} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...gt},children:[Br.jsx(xCe,{}),ot]})});function hQ(ot,st,ct){return{emoji:{...ot,isActive:ct},role:"gridcell","aria-colindex":st,"aria-selected":ct||void 0,"aria-label":ot.label,"data-active":ct?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function bQ(ot,st=!1){return{role:st?void 0:"row","aria-rowindex":st?void 0:ot,"frimousse-row":"",style:{contain:st?void 0:"content",height:st?void 0:"var(--frimousse-row-height)",display:"flex"}}}function yQ(ot,st){return{"frimousse-category":"",style:{contain:"content",top:st?`calc(${ot} * var(--frimousse-category-header-height) + ${st.startRowIndex} * var(--frimousse-row-height))`:void 0,height:st?`calc(var(--frimousse-category-header-height) + ${st.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function vQ(ot,st=!1,ct=!0){return{category:ot,"frimousse-category-header":"",style:{contain:st?void 0:"layout paint",height:st?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:ct?"sticky":void 0,top:0}}}function Zq(ot,st,ct,gt){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${ot} * var(--frimousse-row-height) + ${st} * var(--frimousse-category-header-height))`,paddingTop:`calc(${ct} * var(--frimousse-row-height) + ${gt} * var(--frimousse-category-header-height))`}}}function eQ(ot,st,ct){return{"aria-colcount":ot,"aria-rowcount":st,"frimousse-list":"",style:{"--frimousse-list-columns":ot,...ct},role:"grid"}}function wCe(ot){ot.preventDefault()}var CCe=rr.memo(({Emoji:ot,emoji:st,columnIndex:ct,rowIndex:gt})=>{let bt=Es(),yt=Us(bt,(Ct)=>jA(Ct)?.emoji===st.emoji),vt=rr.useCallback(()=>{bt.get().onEmojiSelect(st)},[st]),xt=rr.useCallback(()=>{bt.get().onActiveEmojiChange("pointer",ct,gt)},[ct,gt]),wt=rr.useCallback(()=>{bt.get().onActiveEmojiReset()},[]);return Br.jsx(ot,{...hQ(st,ct,yt),onClick:vt,onPointerDown:wCe,onPointerEnter:xt,onPointerLeave:wt})}),SCe=rr.memo(({Row:ot,Emoji:st,rowIndex:ct})=>{let gt=Es(),bt=Us(gt,(yt)=>yt.data?.rows[ct],uCe);return bt?Br.jsx(ot,{...bQ(ct),children:bt.emojis.map((yt,vt)=>Br.jsx(CCe,{Emoji:st,columnIndex:vt,emoji:yt,rowIndex:ct},yt.label))}):null}),ECe=rr.memo(({CategoryHeader:ot,categoryIndex:st})=>{let ct=Es(),gt=Us(ct,(yt)=>yt.data?.categories[st],VA),bt=zl(ct,"sticky");return gt?Br.jsx("div",{...yQ(st,gt),children:Br.jsx(ot,{...vQ({label:gt.label},!1,bt)})}):null}),tQ=rr.memo(({CategoryHeader:ot,Row:st,Emoji:ct})=>{let gt=rr.useRef(null),bt=Es(),yt=zl(bt,"columns"),vt=rr.useMemo(()=>Array(yt).fill({emoji:"\uD83D\uDE42",label:""}),[yt]),xt=rr.useMemo(()=>({label:"Category"}),[]),wt=rr.useRef(null),Ct=rr.useRef(null);return Ha(()=>{let St=gt.current?.parentElement?.parentElement;if(!St||!wt.current||!Ct.current)return;let Et=new ResizeObserver((Tt)=>{for(let Pt of Tt){let Mt=Pt.contentRect.height,{onRowHeightChange:It,onCategoryHeaderHeightChange:At,rowHeight:Nt,categoryHeaderHeight:Ot}=bt.get();Pt.target===wt.current&&Nt!==Mt&&It(Mt),Pt.target===Ct.current&&Ot!==Mt&&At(Mt)}});Et.observe(St),Et.observe(wt.current),Et.observe(Ct.current);let{onRowHeightChange:kt,onCategoryHeaderHeightChange:Rt}=bt.get();return kt(wt.current.clientHeight),Rt(Ct.current.clientHeight),()=>{Et.disconnect()}},[]),Br.jsxs("div",{"aria-hidden":!0,ref:gt,style:{height:0,visibility:"hidden"},children:[Br.jsx("div",{"frimousse-row-sizer":"",ref:wt,children:Br.jsx(st,{...bQ(-1,!0),children:vt.map((St,Et)=>Br.jsx(ct,{...hQ(St,Et,!1)},Et))})}),Br.jsx("div",{...yQ(-1),children:Br.jsx("div",{"frimousse-category-header-sizer":"",ref:Ct,children:Br.jsx(ot,{...vQ(xt,!0)})})})]})});function kCe({category:ot,...st}){return Br.jsx("div",{...st,children:ot.label})}function RCe({emoji:ot,...st}){return Br.jsx("button",{type:"button",...st,children:ot.emoji})}function TCe({...ot}){return Br.jsx("div",{...ot})}var xQ=rr.forwardRef(({style:ot,components:st,...ct},gt)=>{let bt=Es(),yt=rr.useRef(null),vt=rr.useCallback((It)=>{It&&(yt.current=It,bt.set({listRef:yt}))},[]),xt=st?.CategoryHeader??kCe,wt=st?.Emoji??RCe,Ct=st?.Row??TCe,St=zl(bt,"columns"),Et=zl(bt,"viewportStartRowIndex"),kt=zl(bt,"viewportEndRowIndex"),Rt=Us(bt,cQ),Tt=Us(bt,lCe,VA),Pt=rr.useMemo(()=>Tt?.filter((It)=>It<Et).length??0,[Tt,Et]),Mt=Tt?.length??0;return rr.useImperativeHandle(gt,()=>yt.current),!Rt||!Tt||Mt===0?Br.jsx("div",{...eQ(St,0,ot),...ct,children:Br.jsx("div",{...Zq(0,0,0,0),children:Br.jsx(tQ,{CategoryHeader:xt,Emoji:wt,Row:Ct})})}):Br.jsx("div",{...eQ(St,Rt,ot),...ct,ref:vt,children:Br.jsxs("div",{...Zq(Rt,Mt,Et,Pt),children:[Br.jsx(tQ,{CategoryHeader:xt,Emoji:wt,Row:Ct}),Array.from({length:kt-Et+1},(It,At)=>{let Nt=Et+At,Ot=Tt.indexOf(Nt);return Br.jsxs(rr.Fragment,{children:[Ot>=0&&Br.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),Br.jsx(SCe,{Emoji:wt,Row:Ct,rowIndex:Nt})]},Nt)}),Array.from({length:Mt},(It,At)=>Br.jsx(ECe,{CategoryHeader:xt,categoryIndex:At},At))]})})}),wQ=rr.forwardRef(({emoji:ot,onClick:st,"aria-label":ct="Change skin tone",...gt},bt)=>{let yt=Es(),vt=Us(yt,cCe,VA),[xt,wt,Ct]=dQ(ot),St=rr.useMemo(()=>Math.max(0,Ct.findIndex((Mt)=>Mt.skinTone===xt)),[xt,Ct]),Et=Ct[St],kt=Ct[(St+1)%Ct.length].skinTone,Rt=xt==="none"?void 0:vt?.[xt],Tt=kt==="none"?void 0:vt?.[kt],Pt=rr.useCallback((Mt)=>{st?.(Mt),Mt.isDefaultPrevented()||wt(kt)},[st,wt,kt]);return Br.jsx("button",{type:"button",...gt,"aria-label":ct+(Tt?` (${Tt})`:""),"aria-live":"polite","aria-valuetext":Rt,"frimousse-skin-tone-selector":"",onClick:Pt,ref:bt,children:Et.emoji})});function CQ({children:ot,...st}){let ct=Es();return Us(ct,sCe)?Br.jsx("span",{"frimousse-loading":"",...st,children:ot}):null}function PCe({children:ot}){let st=Es(),ct=Us(st,oCe);return ot({search:ct})}function SQ({children:ot,...st}){let ct=Es();return Us(ct,iCe)?Br.jsx("span",{"frimousse-empty":"",...st,children:typeof ot=="function"?Br.jsx(PCe,{children:ot}):ot}):null}function EQ({children:ot}){let st=pQ();return ot({emoji:st})}function kQ({children:ot,emoji:st}){let[ct,gt,bt]=dQ(st);return ot({skinTone:ct,setSkinTone:gt,skinToneVariations:bt})}fQ.displayName="EmojiPicker.Root";mQ.displayName="EmojiPicker.Search";gQ.displayName="EmojiPicker.Viewport";xQ.displayName="EmojiPicker.List";CQ.displayName="EmojiPicker.Loading";SQ.displayName="EmojiPicker.Empty";wQ.displayName="EmojiPicker.SkinToneSelector";EQ.displayName="EmojiPicker.ActiveEmoji";kQ.displayName="EmojiPicker.SkinTone";var za=e(t(),1);function RQ(ot){if(!ot)return null;for(let st of ot.elements){let ct=st.tagName;if(ct==="BUTTON"||ct==="INPUT"){let gt=st;if(gt.type==="submit")return gt}}return null}var TQ="data-checked",PQ="data-unchecked";function LS(ot){return{checked(st){if(ot.indeterminate)return{};if(st)return{[TQ]:""};return{[PQ]:""}},...Iu}}var BS=e(t(),1),MCe=BS.createContext(void 0);function IQ(){return BS.useContext(MCe)}var FS=e(t(),1),GA=FS.createContext(void 0);function MQ(){let ot=FS.useContext(GA);if(ot===void 0)throw Error(c(14));return ot}var dy=e(r(),1),ACe="data-parent",AQ=za.forwardRef(function(st,ct){let{checked:gt,className:bt,defaultChecked:yt=!1,"aria-labelledby":vt,disabled:xt=!1,form:wt,id:Ct,indeterminate:St=!1,inputRef:Et,name:kt,onCheckedChange:Rt,parent:Tt=!1,readOnly:Pt=!1,render:Mt,required:It=!1,uncheckedValue:At,value:Nt,nativeButton:Ot=!1,style:Dt,..._t}=st,{clearErrors:$t}=Mu(),{disabled:Ft,name:Bt,setDirty:Lt,setFilled:Vt,setFocused:Wt,setTouched:Ut,state:Ht,validationMode:Gt,validityData:jt,validation:qt}=la(),Qt=v6(),{labelId:Xt,registerControlId:zt,getDescriptionProps:tn}=xl(),rn=IQ(),Kt=rn?.allValues===void 0?void 0:rn.parent,an=Kt!==void 0,ln=Ft||Qt.disabled||rn?.disabled||xt,Zt=Bt??kt,on=Nt??Zt,sn=Cr(),dn=rn?.registerControlId!==zt,fn=Nu({id:Ct||void 0,enabled:dn}),bn=Ot?fn:sn,hn={};if(an){if(Tt)hn=Kt.getParentProps();else if(on!==void 0)hn=Kt.getChildProps(on)}let{checked:gn=gt,indeterminate:xn=St,onCheckedChange:wn,...yn}=hn,nn=rn?.value,en=za.useRef(null),{getButtonProps:pn,buttonRef:cn}=P({disabled:ln,native:Ot}),mn=rn?.validation??qt,[Pn,Rn]=ms({controlled:on!==void 0&&nn!==void 0&&!Tt?nn.includes(on):gn,default:yt,name:"Checkbox",state:"checked"}),Cn=an?Boolean(gn):Pn,kn=an?xn||St:St;Au(en,sn,Pn,void 0,!rn&&!ln,kt);let Jt=Kt?.registerChildId,Yt=za.useRef(null),un=mn.registerInput,vn=rn?on:void 0,_n=za.useCallback((Bn)=>un(Bn,{controlRef:en,value:vn}),[un,vn]),zn=L(Et,Yt,Tt?void 0:_n),$n=bS(vt,Xt,Yt,!Ot,fn);i(()=>{if(Yt.current)Yt.current.indeterminate=kn;if(!rn)Vt(Pn)},[Pn,kn,rn,Vt]),dl(Pn,()=>{if(rn)return;$t(Zt),Lt(Pn!==jt.initialValue),mn.change(Pn)});let Mn=O({checked:Pn,disabled:ln,form:wt,name:Tt?void 0:Zt,id:Ot?void 0:fn,required:It,ref:zn,style:Zt?Zy:Sa,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Bn){if(Bn.nativeEvent.defaultPrevented)return;if(Pt){Bn.preventDefault();return}let Tr=Bn.currentTarget.checked,lr=Ln(ec,Bn.nativeEvent);if(Rt?.(Tr,lr),lr.isCanceled)return;if(wn?.(Tr,lr),lr.isCanceled)return;if(Rn(Tr),on!==void 0&&rn!==void 0&&!Tt&&!an){let no=Tr?[...rn.value,on]:rn.value.filter((An)=>An!==on);rn.setValue(no,lr)}},onClick(Bn){Bn.stopPropagation()},onFocus(){en.current?.focus()}},Nt!==void 0?{value:(rn?Pn&&Nt:Nt)||""}:g,tn,(Bn)=>mn.getValidationProps(ln,Bn));za.useEffect(()=>{if(!Kt||on===void 0)return;let Bn=Kt.disabledStatesRef.current;return Bn.set(on,ln),()=>{Bn.delete(on)}},[Kt,ln,on]);let Gn=za.useMemo(()=>({...Ht,checked:Cn,disabled:ln,readOnly:Pt,required:It,indeterminate:kn}),[Ht,Cn,ln,Pt,It,kn]),sr=LS(Gn),gr=l("span",st,{state:Gn,ref:[cn,en,ct],props:[{id:bn,role:"checkbox","aria-checked":kn?"mixed":Cn,"aria-readonly":Pt||void 0,"aria-required":It||void 0,"aria-labelledby":$n,[ACe]:Tt?"":void 0,onFocus(){if(!ln)Wt(!0)},onBlur(){let Bn=Yt.current;if(!Bn)return;if(Ut(!0),Wt(!1),Gt==="onBlur")mn.commit(rn?nn:Bn.checked)},onKeyDown(Bn){if(Bn.key!=="Enter")return;if(Bn.preventBaseUIHandler(),Bn.defaultPrevented)return;let Tr=Yt.current?.form??null,{currentTarget:lr,nativeEvent:no,preventDefault:An}=Bn,Vn=no.preventDefault,Jn=!1;Bn.preventDefault=()=>{Jn=!0,An.call(Bn)},no.preventDefault=()=>{Jn=!0,Vn.call(no)},Vn.call(no),m(lr).queueMicrotask(()=>{if(Bn.preventDefault=An,no.preventDefault=Vn,!Jn)RQ(Tr)?.click()})},onClick(Bn){if(Pt||ln)return;Bn.preventDefault();let Tr=Yt.current;if(!Tr)return;re(Tr,Bn)}},_t,yn,pn,tn,(Bn)=>mn.getValidationProps(ln,Bn)],stateAttributesMapping:sr}),qn=gr.props.id;return i(()=>{if(!Jt||Tt||on===void 0||qn===void 0)return;return Jt(on,qn)},[Jt,Tt,on,qn]),dy.jsxs(GA.Provider,{value:Gn,children:[gr,!Pn&&!rn&&Zt&&!Tt&&At!==void 0&&dy.jsx("input",{type:"hidden",form:wt,name:Zt,value:At,disabled:ln}),dy.jsx("input",{...Mn,suppressHydrationWarning:!0})]})});var HS=e(t(),1);var NQ=HS.forwardRef(function(st,ct){let{render:gt,className:bt,style:yt,keepMounted:vt=!1,...xt}=st,wt=MQ(),Ct=wt.checked||wt.indeterminate,{mounted:St,transitionStatus:Et,setMounted:kt}=Xs(Ct),Rt=HS.useRef(null),Tt={...wt,transitionStatus:Et};Ro({batch:!0,enabled:!Ct,open:Ct,ref:Rt,onComplete(){if(!Ct)kt(!1)}});let Mt={...LS(wt),...fi},It=vt||St,At=l("span",st,{ref:[ct,Rt],state:Tt,stateAttributesMapping:Mt,props:xt});if(!It)return null;return At});var zS=e(r(),1);function _Q({className:ot,...st}){return zS.jsx(AQ,{"data-slot":"checkbox",className:u('peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground [:where([class~="group/field"]):has(:disabled)_&]:opacity-50 [:where([class~="group/field-label"]):has(:focus-visible)_&]:not-data-checked:border-border [:where([class~="group/field-label"]):has(:focus-visible)_&]:data-checked:border-primary [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',ot),...st,children:zS.jsx(NQ,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:zS.jsx(Ys,{stroke:2})})})}var Qo=e(t(),1);var $S=e(t(),1),KA=$S.createContext(void 0);function fg(){let ot=$S.useContext(KA);if(ot===void 0)throw Error(c(64));return ot}var OQ="data-activation-direction";var sp={tabActivationDirection:(ot)=>({[OQ]:ot})};var qA=e(r(),1),BQ=Qo.forwardRef(function(st,ct){let{className:gt,defaultValue:bt=0,onValueChange:yt,orientation:vt="horizontal",render:xt,value:wt,style:Ct,...St}=st,Et=st.defaultValue!==void 0,kt=Qo.useRef([]),[Rt,Tt]=Qo.useState(()=>new Map),[Pt,Mt]=ms({controlled:wt,default:bt,name:"Tabs",state:"value"}),It=wt!==void 0,[At,Nt]=Qo.useState(()=>new Map),Ot=Qo.useRef(void 0),Dt=Qo.useCallback((sn)=>QA(At,sn),[At]),[_t,$t]=Qo.useState(()=>({previousValue:Pt,tabActivationDirection:"none"})),{previousValue:Ft,tabActivationDirection:Bt}=_t,Lt=Bt,Vt=!1;if(Ft!==Pt)Lt=LQ(Ft,Pt,vt,At),Vt=Ft!=null&&Pt!=null&&Dt(Pt)==null;let Wt=Vt?Ft:Pt,Ut=Ft!==Wt||Bt!==Lt;i(()=>{if(!Ut)return;$t({previousValue:Wt,tabActivationDirection:Lt})},[Wt,Ut,Lt]);let Ht=s((sn,dn)=>{let fn=LQ(Pt,sn,vt,At);if(dn.activationDirection=fn,yt?.(sn,dn),dn.isCanceled)return;Mt(sn)}),Gt=s((sn,dn)=>{yt?.(sn,Ln(dn,void 0,void 0,{activationDirection:"none"}))}),jt=s((sn,dn)=>(Tt((fn)=>{let bn=new Map(fn);return bn.set(sn,dn),bn}),()=>{Tt((fn)=>{if(fn.get(sn)!==dn)return fn;let bn=new Map(fn);return bn.delete(sn),bn})})),qt=Qo.useCallback((sn)=>Rt.get(sn),[Rt]),Qt=Qo.useCallback((sn)=>{for(let dn of At.values())if(sn===dn.value)return dn.id;return},[At]),Xt=Qo.useMemo(()=>({getTabElementBySelectedValue:Dt,getTabIdByPanelValue:Qt,getTabPanelIdByValue:qt,onValueChange:Ht,orientation:vt,registerMountedTabPanel:jt,setTabMap:Nt,tabActivationDirection:Lt,value:Pt}),[Dt,Qt,qt,Ht,vt,jt,Nt,Lt,Pt]),zt=Qo.useMemo(()=>{for(let sn of At.values())if(sn.value===Pt)return sn;return},[At,Pt]),tn=Qo.useMemo(()=>{for(let sn of At.values())if(!sn.disabled)return sn.value;return},[At]),rn=Qo.useRef(!Et),Kt=Qo.useRef(bt),an=Qo.useRef(Et),ln=Qo.useRef(!1);i(()=>{if(It)return;function sn(hn,gn){Mt(hn),$t({previousValue:hn,tabActivationDirection:"none"}),Gt(hn,gn),rn.current=!1}if(At.size===0){if(ln.current&&Pt!==null&&!Ot.current?.isConnected)sn(null,V_);return}ln.current=!0,Ot.current=At.keys().next().value;let dn=zt?.disabled,fn=zt==null&&Pt!==null;if(!dn&&Pt===Kt.current)an.current=!1;if(an.current&&dn&&Pt===Kt.current)return;let bn=rn.current;if(dn||fn){let hn=tn??null;if(Pt===hn){rn.current=!1;return}let gn=V_;if(bn)gn=G_;else if(dn)gn=j_;sn(hn,gn);return}if(bn&&zt!=null)Gt(Pt,G_),rn.current=!1},[tn,It,Gt,zt,Mt,At,Pt]);let on=l("div",st,{state:{orientation:vt,tabActivationDirection:Lt},ref:ct,props:St,stateAttributesMapping:sp});return qA.jsx(KA.Provider,{value:Xt,children:qA.jsx(_u,{elementsRef:kt,children:on})})});function QA(ot,st){for(let[ct,gt]of ot.entries())if(st===gt.value)return ct;return null}function LQ(ot,st,ct,gt){if(ot==null||st==null)return"none";let[bt,yt,vt]=ct==="horizontal"?["left","left","right"]:["top","up","down"],xt=QA(gt,ot),wt=QA(gt,st);if(xt==null||wt==null){if(xt!==wt&&(typeof ot==="number"||typeof ot==="string")&&typeof ot===typeof st)return st>ot?vt:yt;return"none"}let Ct=xt.getBoundingClientRect()[bt],St=wt.getBoundingClientRect()[bt];if(St<Ct)return yt;if(St>Ct)return vt;return"none"}var Ec=e(t(),1);var fy="data-composite-item-active";var WS=e(t(),1),JA=WS.createContext(void 0);function FQ(){let ot=WS.useContext(JA);if(ot===void 0)throw Error(c(65));return ot}var HQ=Ec.forwardRef(function(st,ct){let{className:gt,disabled:bt=!1,render:yt,value:vt,id:xt,nativeButton:wt=!0,style:Ct,...St}=st,{value:Et,getTabPanelIdByValue:kt,onValueChange:Rt,orientation:Tt,tabActivationDirection:Pt}=fg(),{activateOnFocus:Mt,registerTabResizeObserverElement:It,tabsListElement:At}=FQ(),{highlightedIndex:Nt,onHighlightedIndexChange:Ot}=pe(),Dt=Cr(xt),_t=Ec.useMemo(()=>({disabled:bt,id:Dt,value:vt}),[bt,Dt,vt]),{compositeProps:$t,compositeRef:Ft,index:Bt}=Fw({metadata:_t}),Lt=vt===Et,Vt=Ec.useRef(!1),Wt=Ec.useRef(null),Ut=s((ln)=>{Wt.current?.(),Wt.current=ln?It(ln):null});i(()=>{if(Vt.current){Vt.current=!1;return}if(!(Lt&&Bt>-1&&Nt!==Bt))return;let ln=At;if(ln!=null){let Zt=Kr(d(ln));if(Zt&&On(ln,Zt))return}if(!bt)Ot(Bt)},[Lt,Bt,Nt,Ot,bt,At]);let{getButtonProps:Ht,buttonRef:Gt}=P({disabled:bt,native:wt,focusableWhenDisabled:!0}),jt=kt(vt),qt=Ec.useRef(!1),Qt=Ec.useRef(!1);function Xt(ln){Rt(vt,Ln(ec,ln.nativeEvent,void 0,{activationDirection:"none"}))}function zt(ln){if(Lt||bt)return;Xt(ln)}function tn(ln){if(Lt||bt)return;if(Mt&&(!qt.current||Qt.current))Xt(ln)}function rn(ln){if(Lt||bt)return;qt.current=!0,Qt.current=ln.button===0;let Zt=d(ln.currentTarget);function on(){qt.current=!1,Qt.current=!1,Zt.removeEventListener("pointerup",on),Zt.removeEventListener("pointercancel",on)}Zt.addEventListener("pointerup",on),Zt.addEventListener("pointercancel",on)}return l("button",st,{state:{disabled:bt,active:Lt,orientation:Tt,tabActivationDirection:Pt},ref:[ct,Gt,Ft,Ut],props:[$t,{role:"tab","aria-controls":jt,"aria-selected":Lt,id:Dt,onClick:zt,onFocus:tn,onPointerDown:rn,[fy]:Lt?"":void 0,onKeyDownCapture(){Vt.current=!0}},St,Ht],stateAttributesMapping:sp})});var US=e(t(),1);var zQ="data-index";var rOt=Jl,oOt=Ep;var _Ce={...sp,...fi},$Q=US.forwardRef(function(st,ct){let{className:gt,value:bt,render:yt,keepMounted:vt=!1,style:xt,...wt}=st,{value:Ct,getTabIdByPanelValue:St,orientation:Et,tabActivationDirection:kt,registerMountedTabPanel:Rt}=fg(),Tt=Cr(),{ref:Pt,index:Mt}=Cl(),It=bt===Ct,{mounted:At,transitionStatus:Nt,setMounted:Ot}=Xs(It),Dt=!At,_t=St(bt),$t={hidden:Dt,orientation:Et,tabActivationDirection:kt,transitionStatus:Nt},Ft=US.useRef(null),Bt=l("div",st,{state:$t,ref:[ct,Pt,Ft],props:[{"aria-labelledby":_t,hidden:Dt,id:Tt,role:"tabpanel",tabIndex:It?0:-1,inert:Qa(!It),[zQ]:Mt},wt],stateAttributesMapping:_Ce});if(Ro({open:It,ref:Ft,onComplete(){if(!It)Ot(!1)}}),i(()=>{if(Tt==null||Dt&&!vt)return;return Rt(bt,Tt)},[Dt,vt,bt,Tt,Rt]),!(vt||At))return null;return Bt});var $a=e(t(),1);var UQ=e(t(),1);var Ld=e(t(),1);function WQ(ot){let{loopFocus:st=!0,orientation:ct="both",grid:gt,onLoop:bt,direction:yt,highlightedIndex:vt,onHighlightedIndexChange:xt,rootRef:wt,enableHomeAndEndKeys:Ct=!1,stopEventPropagation:St,disabledIndices:Et,modifierKeys:kt=z}=ot,[Rt,Tt]=Ld.useState(0),Pt=gt!=null,Mt=Ld.useRef(null),It=L(Mt,wt),At=Ld.useRef([]),Nt=Ld.useRef(!1),Ot=Ld.useRef(null),Dt=vt??Rt,_t=s((Vt,Wt=!1)=>{if(Ot.current=At.current[Vt]??null,(xt??Tt)(Vt),Wt){let Ut=At.current[Vt];cR(Mt.current,Ut,yt,ct)}}),$t=s((Vt)=>{if(Vt.size===0)return;if(Nt.current){let Gt=At.current,jt=Gt.indexOf(Ot.current);if(jt===-1){let qt=Gt[Dt];if(!qt||Xl(Gt,Dt,Et))_t(OCe(Gt,Et));else Ot.current=qt}else if(jt!==Dt)_t(jt);return}Nt.current=!0;let Wt=Array.from(Vt.keys()),Ut=Wt.find((Gt)=>Gt?.hasAttribute(fy))??null,Ht=Ut?Vt.get(Ut)?.index??-1:-1;if(Ht!==-1)_t(Ht);else if(Xl(Wt,Dt,Et)){let Gt=Qs(Wt,{disabledIndices:Et});if(!Hc(Wt,Gt))_t(Gt)}cR(Mt.current,Ut,yt,ct)});i(()=>{if(Et==null||vt!=null||!Nt.current)return;let Vt=At.current;if(Xl(Vt,Dt,Et)){let Wt=Qs(Vt,{disabledIndices:Et});if(!Hc(Vt,Wt))_t(Wt)}},[Et,vt,Dt,At,_t]);let Ft=s((Vt,Wt,Ut)=>{if(!bt)return Ut;return bt(Vt,Wt,Ut,At)}),Bt=s((Vt)=>{let Wt=Vt.key===kf||Vt.key===Rf;if(!Pa.has(Vt.key)||!Ct&&Wt)return;if(LCe(Vt,kt))return;if(!Mt.current)return;let Ht=yt==="rtl",Gt=Ht?Sf:Ef,jt=Ht?Ef:Sf,qt=ct==="vertical"?Cf:Gt,Qt=ct==="vertical"?wf:jt,Xt=xr(Vt.nativeEvent);if(Xt!=null&&lR(Xt)&&!EH(Xt)){let{selectionStart:ln,selectionEnd:Zt,value:on}=Xt;if(ln==null||Vt.shiftKey||ln!==Zt)return;if(Vt.key!==Qt&&ln<on.length)return;if(Vt.key!==qt&&ln>0)return}let zt=Dt,tn=Tp(At,Et),rn=tf(At,Et);if(gt!=null)zt=gt({disabledIndices:Et,elementsRef:At,event:Vt,highlightedIndex:Dt,loopFocus:st,maxIndex:rn,minIndex:tn,onLoop:Ft,orientation:ct,rtl:Ht});let Kt=ct!=="vertical"&&Vt.key===Gt||ct!=="horizontal"&&Vt.key===Cf,an=ct!=="vertical"&&Vt.key===jt||ct!=="horizontal"&&Vt.key===wf;if(Ct){if(Vt.key===kf)zt=tn;else if(Vt.key===Rf)zt=rn}if(zt===Dt&&(Kt||an))if(st&&zt===rn&&Kt){if(zt=tn,bt)zt=bt(Vt,Dt,zt,At)}else if(st&&zt===tn&&an){if(zt=rn,bt)zt=bt(Vt,Dt,zt,At)}else zt=Qs(At.current,{startingIndex:zt,decrement:an,disabledIndices:Et});if(zt!==Dt&&!Hc(At.current,zt)){if(St)Vt.stopPropagation();if(Pt||Wt||Kt||an)Vt.preventDefault();_t(zt,!0),queueMicrotask(()=>{At.current[zt]?.focus()})}});return{props:{ref:It,onFocus(Vt){let Wt=Mt.current,Ut=xr(Vt.nativeEvent);if(!Wt||Ut==null||!lR(Ut))return;Ut.setSelectionRange(0,Ut.value.length)},onKeyDown:Bt},highlightedIndex:Dt,onHighlightedIndexChange:_t,elementsRef:At,onMapChange:$t,relayKeyboardEvent:Bt}}function OCe(ot,st){let ct=-1;for(let gt=0;gt<ot.length;gt+=1){let bt=ot[gt];if(!bt||Xl(ot,gt,st))continue;if(bt.hasAttribute(fy))return gt;if(ct===-1)ct=gt}return Math.max(ct,0)}function LCe(ot,st){for(let ct of aB){if(st.includes(ct))continue;if(ot.getModifierState(ct))return!0}return!1}var XA=e(r(),1);function jQ(ot){let{render:st,className:ct,style:gt,refs:bt=z,props:yt=z,state:vt=g,stateAttributesMapping:xt,highlightedIndex:wt,onHighlightedIndexChange:Ct,orientation:St,grid:Et,loopFocus:kt,onLoop:Rt,enableHomeAndEndKeys:Tt,onMapChange:Pt,stopEventPropagation:Mt=!0,rootRef:It,disabledIndices:At,modifierKeys:Nt,highlightItemOnHover:Ot=!1,tag:Dt="div",..._t}=ot,$t=ll(),{props:Ft,highlightedIndex:Bt,onHighlightedIndexChange:Lt,elementsRef:Vt,onMapChange:Wt,relayKeyboardEvent:Ut}=WQ({grid:Et,loopFocus:kt,onLoop:Rt,orientation:St,highlightedIndex:wt,onHighlightedIndexChange:Ct,rootRef:It,stopEventPropagation:Mt,enableHomeAndEndKeys:Tt,direction:$t,disabledIndices:At,modifierKeys:Nt}),Ht=l(Dt,ot,{state:vt,ref:bt,props:[Ft,...yt,_t],stateAttributesMapping:xt}),Gt=UQ.useMemo(()=>({highlightedIndex:Bt,onHighlightedIndexChange:Lt,highlightItemOnHover:Ot,relayKeyboardEvent:Ut}),[Bt,Lt,Ot,Ut]);return XA.jsx(et.Provider,{value:Gt,children:XA.jsx(_u,{elementsRef:Vt,onMapChange:(jt)=>{Pt?.(jt),Wt(jt)},children:Ht})})}var YA=e(r(),1),VQ=$a.forwardRef(function(st,ct){let{activateOnFocus:gt=!1,className:bt,loopFocus:yt=!0,render:vt,style:xt,...wt}=st,{orientation:Ct,setTabMap:St,tabActivationDirection:Et}=fg(),[kt,Rt]=$a.useState(0),[Tt,Pt]=$a.useState(null),Mt=$a.useRef(new Set),It=$a.useRef(new Set),At=$a.useRef(null);i(()=>{if(typeof ResizeObserver>"u")return;let Ft=new ResizeObserver(()=>{Mt.current.forEach((Bt)=>{Bt()})});if(At.current=Ft,Tt)Ft.observe(Tt);return It.current.forEach((Bt)=>{Ft.observe(Bt)}),()=>{Ft.disconnect(),At.current=null}},[Tt]);let Nt=s((Ft)=>(Mt.current.add(Ft),()=>{Mt.current.delete(Ft)})),Ot=s((Ft)=>(It.current.add(Ft),At.current?.observe(Ft),()=>{It.current.delete(Ft),At.current?.unobserve(Ft)})),Dt={orientation:Ct,tabActivationDirection:Et},_t={"aria-orientation":Ct==="vertical"?"vertical":void 0,role:"tablist"},$t=$a.useMemo(()=>({activateOnFocus:gt,registerIndicatorUpdateListener:Nt,registerTabResizeObserverElement:Ot,tabsListElement:Tt}),[gt,Nt,Ot,Tt]);return YA.jsx(JA.Provider,{value:$t,children:YA.jsx(jQ,{render:vt,className:bt,style:xt,state:Dt,refs:[ct,Pt],props:[_t,wt],stateAttributesMapping:sp,highlightedIndex:kt,enableHomeAndEndKeys:!0,loopFocus:yt,orientation:Ct,onHighlightedIndexChange:Rt,onMapChange:St,disabledIndices:z})})});var my=e(r(),1);function KQ({className:ot,orientation:st="horizontal",...ct}){return my.jsx(BQ,{"data-slot":"tabs","data-orientation":st,orientation:st,className:u("group/tabs flex gap-2 data-horizontal:flex-col",ot),...ct})}var BCe=oe("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-accent",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function qQ({className:ot,variant:st="default",...ct}){return my.jsx(VQ,{"data-slot":"tabs-list","data-variant":st,className:u(BCe({variant:st}),ot),...ct})}function jS({className:ot,...st}){return my.jsx(HQ,{"data-slot":"tabs-trigger",className:u("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground data-active:ring-1 data-active:ring-border","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",ot),...st})}function VS({className:ot,...st}){return my.jsx($Q,{"data-slot":"tabs-content",className:u("flex-1 text-sm outline-none",ot),...st})}var QQ=["\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","☕"],ZA="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var mr=e(r(),1),FCe=32,JQ=4,HCe=12,ZQ="flex pt-4 pb-2 items-center bg-background px-3 text-xs font-medium text-muted-foreground",eJ=rs.createContext(null);function XQ(ot,st){if(st)return{...ot,background:"theme"};if(ot.type==="emoji")return{type:"emoji",value:ot.value};return{type:"glyph",value:ot.value}}function zCe({category:ot,className:st,...ct}){return mr.jsx("div",{...ct,className:n(ZQ,st),children:ot.label})}function YQ({className:ot,...st}){return mr.jsx("div",{className:n("flex flex-wrap content-start gap-1",ot),...st})}function eN({className:ot,selected:st=!1,...ct}){return mr.jsx(a,{type:"button",variant:"ghost",size:"icon","aria-pressed":st,className:n("shrink-0 data-active:bg-accent",st&&"bg-accent",ot),...ct})}function $Ce({children:ot,className:st,...ct}){return mr.jsx("div",{...ct,className:n("flex h-8 gap-1 px-1.5",st),children:ot})}function WCe({emoji:ot,...st}){let ct=rs.useContext(eJ);return mr.jsx(eN,{selected:ct===ot.emoji,className:ZA,...st,children:mr.jsx("span",{className:"text-xl leading-none",children:ot.emoji})})}function tJ(){let{layout:ot,workspaceId:st}=Sr(),{icon:ct}=ot,gt=gq(st),[bt,yt]=rs.useState(ct?.type??"glyph"),[vt,xt]=rs.useState(!ct||ct.type!=="upload"&&ct.background==="theme"),wt=ct?.type==="upload"?void 0:ct,[Ct,St]=rs.useState(""),[Et,kt]=rs.useState(13),[Rt,Tt]=rs.useState(null),[Pt,Mt]=rs.useState(!1),It=rs.useRef(null),At=(Dt)=>{let _t=XQ(Dt,vt);gt.mutate({kind:"set",icon:_t})},Nt=(Dt)=>{gt.mutate({kind:"upload",file:Dt})},Ot=(Dt)=>{if(xt(Dt),wt){let _t=XQ(wt,Dt);gt.mutate({kind:"set",icon:_t})}};return rs.useEffect(()=>{if(!Rt)return;let Dt=($t)=>{let Ft=Math.max(1,Math.floor(($t-HCe+JQ)/(FCe+JQ)));kt((Bt)=>Bt===Ft?Bt:Ft)};Dt(Rt.clientWidth);let _t=new ResizeObserver(([$t])=>{Dt($t?.contentRect.width??Rt.clientWidth)});return _t.observe(Rt),()=>_t.disconnect()},[Rt]),mr.jsxs(KQ,{value:bt,onValueChange:(Dt)=>yt(Dt),className:"min-w-0 gap-4",children:[mr.jsxs("div",{className:"flex items-center justify-between gap-4",children:[mr.jsxs(qQ,{"aria-label":"Icon source",children:[mr.jsx(jS,{value:"glyph",children:"Icon"}),mr.jsx(jS,{value:"emoji",children:"Emoji"}),mr.jsx(jS,{value:"upload",children:"Upload"})]}),ct&&mr.jsxs(a,{type:"button",variant:"ghost",onClick:()=>{xt(!0),gt.mutate({kind:"reset"})},className:"text-muted-foreground",children:[mr.jsx(EO,{"data-icon":"inline-start",stroke:1.5}),"Reset"]})]}),mr.jsx(VS,{value:"emoji",className:"flex-none",children:mr.jsx(eJ,{value:wt?.type==="emoji"?wt.value:null,children:mr.jsxs(Sc.Root,{onEmojiSelect:(Dt)=>At({type:"emoji",value:Dt.emoji}),emojibaseUrl:"/vendor/emojibase",columns:Et,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[mr.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[mr.jsx(Sc.Search,{placeholder:"Search emoji",onChange:(Dt)=>St(Dt.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"}),mr.jsx(Sc.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),mr.jsxs(Sc.Viewport,{ref:Tt,className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[mr.jsxs(Sc.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[mr.jsx(No,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),Ct.trim()===""&&mr.jsxs("div",{className:"border-b border-dashed border-border",children:[mr.jsx("p",{className:n("sticky top-0",ZQ),children:"Favorites"}),mr.jsx(YQ,{className:"px-1.5 pb-1.5",children:QQ.map((Dt)=>mr.jsx(eN,{onClick:()=>At({type:"emoji",value:Dt}),selected:wt?.type==="emoji"&&wt.value===Dt,className:ZA,children:mr.jsx("span",{className:"text-xl leading-none",children:Dt})},Dt))})]}),mr.jsxs(Sc.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[mr.jsx(CL,{size:20,stroke:1.5}),"No emoji found"]}),mr.jsx(Sc.List,{className:"select-none",components:{CategoryHeader:zCe,Row:$Ce,Emoji:WCe}})]})]})})}),mr.jsx(VS,{value:"glyph",className:"scrollbar-thin h-72 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:mr.jsx(YQ,{children:o4.map(({id:Dt,Icon:_t})=>mr.jsx(eN,{"aria-label":Dt,onClick:()=>At({type:"glyph",value:Dt}),selected:wt?.type==="glyph"&&wt.value===Dt,className:"text-muted-foreground aria-pressed:text-accent-foreground",children:mr.jsx(_t,{stroke:1.75})},Dt))})}),mr.jsx(VS,{value:"upload",className:"flex-none",children:mr.jsxs("button",{type:"button",onClick:()=>It.current?.click(),onDragOver:(Dt)=>{Dt.preventDefault(),Mt(!0)},onDragLeave:()=>Mt(!1),onDrop:(Dt)=>{Dt.preventDefault(),Mt(!1);let _t=Dt.dataTransfer.files?.[0];if(_t)Nt(_t)},className:n("flex h-72 w-full flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",Pt?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[mr.jsx(JL,{size:24,stroke:1.5}),mr.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),mr.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]})}),bt!=="upload"&&mr.jsxs("label",{htmlFor:"workspace-icon-theme-background",className:"flex w-fit cursor-pointer items-center gap-2 text-sm font-medium",children:[mr.jsx(_Q,{id:"workspace-icon-theme-background",checked:vt,onCheckedChange:Ot}),"Use theme background"]}),gt.error&&mr.jsx("p",{className:"text-xs text-destructive","aria-live":"polite",children:gt.error.message}),mr.jsx("input",{ref:It,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(Dt)=>{let _t=Dt.target.files?.[0];if(_t)Nt(_t);Dt.target.value=""}})]})}var ap=e(r(),1);function nJ(){let{layout:ot,name:st,provider:ct,workspaceId:gt}=Sr(),bt=st??"Workspace",yt=mq(gt),[vt,xt]=GS.useState(bt);GS.useEffect(()=>xt(bt),[bt]);function wt(Ct){let St=Ct.trim();if(xt(St),St!==bt)yt.mutate(St===""?null:St)}return ap.jsx(mw,{name:vt,icon:ot.icon,workspaceType:ct,workspaceTheme:ot.theme,onNameChange:xt,onNameCommit:wt,renderIcon:(Ct)=>ap.jsxs(ou,{children:[ap.jsx(iu,{render:ap.jsx("button",{type:"button","aria-label":"Change workspace icon",className:"group inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-lg p-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:Ct})}),ap.jsx(su,{align:"start",sideOffset:8,className:"w-[min(32rem,calc(100vw-2rem))] gap-4 rounded-2xl p-6",children:ap.jsx(tJ,{})})]})})}var Sy=e(t(),1);function cp(ot){let{margin:st,containerPadding:ct,containerWidth:gt,cols:bt}=ot;return(gt-st[0]*(bt-1)-ct[0]*2)/bt}function Wa(ot,st,ct){if(!Number.isFinite(ot))return ot;return Math.round(st*ot+Math.max(0,ot-1)*ct)}function hy(ot,st,ct,gt,bt,yt,vt){let{margin:xt,containerPadding:wt,rowHeight:Ct}=ot,St=cp(ot),Et,kt,Rt,Tt;if(vt)Et=Math.round(vt.width),kt=Math.round(vt.height);else Et=Wa(gt,St,xt[0]),kt=Wa(bt,Ct,xt[1]);if(yt)Rt=Math.round(yt.top),Tt=Math.round(yt.left);else if(vt)Rt=Math.round(vt.top),Tt=Math.round(vt.left);else Rt=Math.round((Ct+xt[1])*ct+wt[1]),Tt=Math.round((St+xt[0])*st+wt[0]);if(!yt&&!vt){if(Number.isFinite(gt)){let Mt=Math.round((St+xt[0])*(st+gt)+wt[0])-Tt-Et;if(Mt!==xt[0])Et+=Mt-xt[0]}if(Number.isFinite(bt)){let Mt=Math.round((Ct+xt[1])*(ct+bt)+wt[1])-Rt-kt;if(Mt!==xt[1])kt+=Mt-xt[1]}}return{top:Rt,left:Tt,width:Et,height:kt}}function oJ(ot,st,ct,gt,bt){let{margin:yt,containerPadding:vt,cols:xt,rowHeight:wt,maxRows:Ct}=ot,St=cp(ot),Et=Math.round((ct-vt[0])/(St+yt[0])),kt=Math.round((st-vt[1])/(wt+yt[1]));return Et=gy(Et,0,xt-gt),kt=gy(kt,0,Ct-bt),{x:Et,y:kt}}function by(ot,st,ct){let{margin:gt,containerPadding:bt,rowHeight:yt}=ot,vt=cp(ot),xt=Math.round((ct-bt[0])/(vt+gt[0])),wt=Math.round((st-bt[1])/(yt+gt[1]));return{x:xt,y:wt}}function iJ(ot,st,ct){let{margin:gt,rowHeight:bt}=ot,yt=cp(ot),vt=Math.max(1,Math.round((st+gt[0])/(yt+gt[0]))),xt=Math.max(1,Math.round((ct+gt[1])/(bt+gt[1])));return{w:vt,h:xt}}function gy(ot,st,ct){return Math.max(Math.min(ot,ct),st)}function qS(ot,st){if(ot.i===st.i)return!1;if(ot.x+ot.w<=st.x)return!1;if(ot.x>=st.x+st.w)return!1;if(ot.y+ot.h<=st.y)return!1;if(ot.y>=st.y+st.h)return!1;return!0}function up(ot,st){for(let ct=0;ct<ot.length;ct++){let gt=ot[ct];if(gt!==void 0&&qS(gt,st))return gt}return}function tN(ot,st){return ot.filter((ct)=>qS(ct,st))}function UCe(ot,st){if(st==="horizontal")return nN(ot);if(st==="vertical")return KS(ot);if(st==="wrap")return KS(ot);return[...ot]}function KS(ot){return[...ot].sort((st,ct)=>{if(st.y!==ct.y)return st.y-ct.y;return st.x-ct.x})}function nN(ot){return[...ot].sort((st,ct)=>{if(st.x!==ct.x)return st.x-ct.x;return st.y-ct.y})}function yy(ot){let st=0;for(let ct=0;ct<ot.length;ct++){let gt=ot[ct];if(gt!==void 0){let bt=gt.y+gt.h;if(bt>st)st=bt}}return st}function pp(ot,st){for(let ct=0;ct<ot.length;ct++){let gt=ot[ct];if(gt!==void 0&&gt.i===st)return gt}return}function vy(ot){return ot.filter((st)=>st.static===!0)}function kc(ot){return{i:ot.i,x:ot.x,y:ot.y,w:ot.w,h:ot.h,minW:ot.minW,maxW:ot.maxW,minH:ot.minH,maxH:ot.maxH,moved:Boolean(ot.moved),static:Boolean(ot.static),isDraggable:ot.isDraggable,isResizable:ot.isResizable,resizeHandles:ot.resizeHandles,constraints:ot.constraints,isBounded:ot.isBounded}}function mg(ot){let st=Array(ot.length);for(let ct=0;ct<ot.length;ct++){let gt=ot[ct];if(gt!==void 0)st[ct]=kc(gt)}return st}function jCe(ot,st){let ct=Array(ot.length);for(let gt=0;gt<ot.length;gt++){let bt=ot[gt];if(bt!==void 0)if(st.i===bt.i)ct[gt]=st;else ct[gt]=bt}return ct}function sJ(ot,st,ct){let gt=pp(ot,st);if(!gt)return[[...ot],null];return gt=ct(kc(gt)),[jCe(ot,gt),gt]}function rN(ot,st){let ct=vy(ot);for(let gt=0;gt<ot.length;gt++){let bt=ot[gt];if(bt===void 0)continue;if(bt.x+bt.w>st.cols)bt.x=st.cols-bt.w;if(bt.x<0)bt.x=0,bt.w=st.cols;if(!bt.static)ct.push(bt);else while(up(ct,bt))bt.y++}return ot}function lp(ot,st,ct,gt,bt,yt,vt,xt,wt){if(st.static&&st.isDraggable!==!0)return[...ot];if(st.y===gt&&st.x===ct)return[...ot];let{x:Ct,y:St}=st;if(typeof ct==="number")st.x=ct;if(typeof gt==="number")st.y=gt;st.moved=!0;let Et=UCe(ot,vt);if(vt==="vertical"&&typeof gt==="number"?St>=gt:vt==="horizontal"&&typeof ct==="number"?Ct>=ct:!1)Et=Et.reverse();let Rt=tN(Et,st),Tt=Rt.length>0;if(Tt&&wt)return mg(ot);if(Tt&&yt)return st.x=Ct,st.y=St,st.moved=!1,ot;let Pt=[...ot];for(let Mt=0;Mt<Rt.length;Mt++){let It=Rt[Mt];if(It===void 0)continue;if(It.moved)continue;if(It.static)Pt=rJ(Pt,It,st,bt,vt);else Pt=rJ(Pt,st,It,bt,vt)}return Pt}function rJ(ot,st,ct,gt,bt,yt){let vt=bt==="horizontal",xt=bt==="vertical",wt=st.static;if(gt){gt=!1;let Et={x:vt?Math.max(st.x-ct.w,0):ct.x,y:xt?Math.max(st.y-ct.h,0):ct.y,w:ct.w,h:ct.h,i:"-1"},kt=up(ot,Et),Rt=kt!==void 0&&kt.y+kt.h>st.y,Tt=kt!==void 0&&st.x+st.w>kt.x;if(!kt)return lp(ot,ct,vt?Et.x:void 0,xt?Et.y:void 0,gt,wt,bt);if(Rt&&xt)return lp(ot,ct,void 0,ct.y+1,gt,wt,bt);if(Rt&&bt===null)return st.y=ct.y,ct.y=ct.y+ct.h,[...ot];if(Tt&&vt)return lp(ot,st,ct.x,void 0,gt,wt,bt)}let Ct=vt?ct.x+1:void 0,St=xt?ct.y+1:void 0;if(Ct===void 0&&St===void 0)return[...ot];return lp(ot,ct,Ct,St,gt,wt,bt)}function gg(ot,st,ct){return Math.max(st,Math.min(ct,ot))}var VCe={name:"gridBounds",constrainPosition(ot,st,ct,{cols:gt,maxRows:bt}){return{x:gg(st,0,Math.max(0,gt-ot.w)),y:gg(ct,0,Math.max(0,bt-ot.h))}},constrainSize(ot,st,ct,gt,{cols:bt,maxRows:yt}){let vt=gt==="w"||gt==="nw"||gt==="sw"?ot.x+ot.w:bt-ot.x,xt=gt==="n"||gt==="nw"||gt==="ne"?ot.y+ot.h:yt-ot.y;return{w:gg(st,1,Math.max(1,vt)),h:gg(ct,1,Math.max(1,xt))}}},GCe={name:"minMaxSize",constrainSize(ot,st,ct){return{w:gg(st,ot.minW??1,ot.maxW??1/0),h:gg(ct,ot.minH??1,ot.maxH??1/0)}}};var oN=[VCe,GCe];function xy(ot,st,ct,gt,bt){let yt={x:ct,y:gt};for(let vt of ot)if(vt.constrainPosition)yt=vt.constrainPosition(st,yt.x,yt.y,bt);if(st.constraints){for(let vt of st.constraints)if(vt.constrainPosition)yt=vt.constrainPosition(st,yt.x,yt.y,bt)}return yt}function aJ(ot,st,ct,gt,bt,yt){let vt={w:ct,h:gt};for(let xt of ot)if(xt.constrainSize)vt=xt.constrainSize(st,vt.w,vt.h,bt,yt);if(st.constraints){for(let xt of st.constraints)if(xt.constrainSize)vt=xt.constrainSize(st,vt.w,vt.h,bt,yt)}return vt}function JS({top:ot,left:st,width:ct,height:gt}){let bt=`translate(${st}px,${ot}px)`;return{transform:bt,WebkitTransform:bt,MozTransform:bt,msTransform:bt,OTransform:bt,width:`${ct}px`,height:`${gt}px`,position:"absolute"}}function iN({top:ot,left:st,width:ct,height:gt}){return{top:`${ot}px`,left:`${st}px`,width:`${ct}px`,height:`${gt}px`,position:"absolute"}}function sN(ot){return ot*100+"%"}function KCe(ot,st,ct,gt){return ot+ct>gt?st:ct}function lJ(ot,st,ct){return ot<0?st:ct}function qCe(ot){return Math.max(0,ot)}function QS(ot){return Math.max(0,ot)}var aN=(ot,st,ct)=>{let{left:gt,height:bt,width:yt}=st,vt=ot.top-(bt-ot.height);return{left:gt,width:yt,height:lJ(vt,ot.height,bt),top:QS(vt)}},lN=(ot,st,ct)=>{let{top:gt,left:bt,height:yt,width:vt}=st;return{top:gt,height:yt,width:KCe(ot.left,ot.width,vt,ct),left:qCe(bt)}},cN=(ot,st,ct)=>{let{top:gt,height:bt,width:yt}=st,vt=ot.left+ot.width-yt;if(vt<0)return{height:bt,width:ot.left+ot.width,top:QS(gt),left:0};return{height:bt,width:yt,top:QS(gt),left:vt}},uN=(ot,st,ct)=>{let{top:gt,left:bt,height:yt,width:vt}=st;return{width:vt,left:bt,height:lJ(gt,ot.height,yt),top:QS(gt)}},QCe=(ot,st,ct)=>aN(ot,lN(ot,st,ct)),JCe=(ot,st,ct)=>aN(ot,cN(ot,st)),XCe=(ot,st,ct)=>uN(ot,lN(ot,st,ct)),YCe=(ot,st,ct)=>uN(ot,cN(ot,st)),ZCe={n:aN,ne:QCe,e:lN,se:XCe,s:uN,sw:YCe,w:cN,nw:JCe};function cJ(ot,st,ct,gt){let bt=ZCe[ot];if(!bt)return ct;return bt(st,{...st,...ct},gt)}var eSe={type:"transform",scale:1,calcStyle(ot){return JS(ot)}};var uJ=eSe,pJ={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},dJ={enabled:!0,bounded:!1,threshold:3},fJ={enabled:!0,handles:["se"]},mJ={enabled:!1,defaultItem:{w:1,h:1}};function pN(ot,st,ct,gt,bt){let yt=gt==="x"?"w":"h";st[gt]+=1;let vt=ot.findIndex((wt)=>wt.i===st.i),xt=bt??vy(ot).length>0;for(let wt=vt+1;wt<ot.length;wt++){let Ct=ot[wt];if(Ct===void 0)continue;if(Ct.static)continue;if(!xt&&Ct.y>st.y+st.h)break;if(qS(st,Ct))pN(ot,Ct,ct+st[yt],gt,xt)}st[gt]=ct}function tSe(ot,st,ct,gt){st.x=Math.max(st.x,0),st.y=Math.max(st.y,0),st.y=Math.min(gt,st.y);while(st.y>0&&!up(ot,st))st.y--;let bt;while((bt=up(ot,st))!==void 0)pN(ct,st,bt.y+bt.h,"y");return st.y=Math.max(st.y,0),st}function nSe(ot,st,ct,gt){st.x=Math.max(st.x,0),st.y=Math.max(st.y,0);while(st.x>0&&!up(ot,st))st.x--;let bt;while((bt=up(ot,st))!==void 0)if(pN(gt,st,bt.x+bt.w,"x"),st.x+st.w>ct){st.x=ct-st.w,st.y++;while(st.x>0&&!up(ot,st))st.x--}return st.x=Math.max(st.x,0),st}var wy={type:"vertical",allowOverlap:!1,compact(ot,st){let ct=vy(ot),gt=yy(ct),bt=KS(ot),yt=Array(ot.length);for(let vt=0;vt<bt.length;vt++){let xt=bt[vt];if(xt===void 0)continue;let wt=kc(xt);if(!wt.static)wt=tSe(ct,wt,bt,gt),gt=Math.max(gt,wt.y+wt.h),ct.push(wt);let Ct=ot.indexOf(xt);yt[Ct]=wt,wt.moved=!1}return yt}},dN={type:"horizontal",allowOverlap:!1,compact(ot,st){let ct=vy(ot),gt=nN(ot),bt=Array(ot.length);for(let yt=0;yt<gt.length;yt++){let vt=gt[yt];if(vt===void 0)continue;let xt=kc(vt);if(!xt.static)xt=nSe(ct,xt,st,gt),ct.push(xt);let wt=ot.indexOf(vt);bt[wt]=xt,xt.moved=!1}return bt}},fN={type:null,allowOverlap:!1,compact(ot,st){return mg(ot)}},rSe={...wy,allowOverlap:!0,compact(ot,st){return mg(ot)}},oSe={...dN,allowOverlap:!0,compact(ot,st){return mg(ot)}},iSe={...fN,allowOverlap:!0};function mN(ot,st=!1,ct=!1){let gt;if(st)if(ot==="vertical")gt=rSe;else if(ot==="horizontal")gt=oSe;else gt=iSe;else if(ot==="vertical")gt=wy;else if(ot==="horizontal")gt=dN;else gt=fN;if(ct)return{...gt,preventCollision:ct};return gt}var Ua=e(t(),1);function sSe(ot){let st=typeof globalThis.getComputedStyle==="function"?globalThis.getComputedStyle(ot):null;if(!st)return ot.clientWidth;let ct=(bt)=>{let yt=Number.parseFloat(bt);return Number.isFinite(yt)?yt:0},gt=Number.parseFloat(st.width);if(Number.isFinite(gt))return Math.max(0,gt);return Math.max(0,ot.clientWidth-ct(st.paddingLeft)-ct(st.paddingRight))}function gN(ot={}){let{measureBeforeMount:st=!1,initialWidth:ct=1280}=ot,[gt,bt]=Ua.useState(ct),[yt,vt]=Ua.useState(!st),xt=Ua.useRef(null),wt=Ua.useRef(null),Ct=Ua.useCallback(()=>{let St=xt.current;if(St){let Et=Math.round(sSe(St));if(bt((kt)=>kt===Et?kt:Et),!yt)vt(!0)}},[yt]);return Ua.useEffect(()=>{let St=xt.current;if(!St)return;if(Ct(),typeof ResizeObserver<"u"){let Et=null;return wt.current=new ResizeObserver((kt)=>{let Rt=kt[0];if(Rt){let Tt=Math.round(Rt.contentRect.width);if(Et!==null)cancelAnimationFrame(Et);Et=requestAnimationFrame(()=>{bt((Pt)=>Pt===Tt?Pt:Tt),Et=null})}}),wt.current.observe(St),()=>{if(Et!==null)cancelAnimationFrame(Et);if(wt.current)wt.current.disconnect(),wt.current=null}}return()=>{if(wt.current)wt.current.disconnect(),wt.current=null}},[Ct]),{width:gt,mounted:yt,containerRef:xt,measureWidth:Ct}}var Un=e(t(),1),vJ=e(aS(),1),xJ=e(AA(),1);var Tc=e(r(),1),Bd=e(hJ(),1);function hN(ot){let{children:st,cols:ct,containerWidth:gt,margin:bt,containerPadding:yt,rowHeight:vt,maxRows:xt,isDraggable:wt,isResizable:Ct,isBounded:St,static:Et,useCSSTransforms:kt=!0,usePercentages:Rt=!1,transformScale:Tt=1,positionStrategy:Pt,dragThreshold:Mt=0,droppingPosition:It,className:At="",style:Nt,handle:Ot="",cancel:Dt="",x:_t,y:$t,w:Ft,h:Bt,minW:Lt=1,maxW:Vt=1/0,minH:Wt=1,maxH:Ut=1/0,i:Ht,resizeHandles:Gt,resizeHandle:jt,constraints:qt=oN,layoutItem:Qt,layout:Xt=[],onDragStart:zt,onDrag:tn,onDragStop:rn,onResizeStart:Kt,onResize:an,onResizeStop:ln}=ot,[Zt,on]=Un.useState(!1),[sn,dn]=Un.useState(!1),fn=Un.useRef(null),bn=Un.useRef({left:0,top:0}),hn=Un.useRef({top:0,left:0,width:0,height:0}),gn=Un.useRef(void 0),xn=Un.useRef(Xt);xn.current=Xt;let wn=Un.useRef(null),yn=Un.useRef(null),nn=Un.useRef(!1),en=Un.useRef({x:0,y:0}),pn=Un.useRef(!1),cn=Un.useMemo(()=>({cols:ct,containerPadding:yt,containerWidth:gt,margin:bt,maxRows:xt,rowHeight:vt}),[ct,yt,gt,bt,xt,vt]),mn=Un.useMemo(()=>({cols:ct,maxRows:xt,containerWidth:gt,containerHeight:0,rowHeight:vt,margin:bt,layout:[]}),[ct,xt,gt,vt,bt]),Pn=Un.useCallback(()=>({...mn,layout:xn.current}),[mn]),Rn=Un.useMemo(()=>Qt??{i:Ht,x:_t,y:$t,w:Ft,h:Bt,minW:Lt,maxW:Vt,minH:Wt,maxH:Ut},[Qt,Ht,_t,$t,Ft,Bt,Lt,Vt,Wt,Ut]),Cn=Un.useCallback((An)=>{if(Pt?.calcStyle)return Pt.calcStyle(An);if(kt)return JS(An);let Vn=iN(An);if(Rt)return{...Vn,left:sN(An.left/gt),width:sN(An.width/gt)};return Vn},[Pt,kt,Rt,gt]),kn=Un.useCallback((An,{node:Vn})=>{if(!zt)return;let{offsetParent:Jn}=Vn;if(!Jn)return;let Yn=Jn.getBoundingClientRect(),Sn=Vn.getBoundingClientRect(),Fn=Sn.left/Tt,ur=Yn.left/Tt,Pr=Sn.top/Tt,Wn=Yn.top/Tt,Zn;if(Pt?.calcDragPosition){let er=An;Zn=Pt.calcDragPosition(er.clientX,er.clientY,er.clientX-Sn.left,er.clientY-Sn.top)}else Zn={left:Fn-ur+Jn.scrollLeft,top:Pr-Wn+Jn.scrollTop};if(bn.current=Zn,Mt>0){let er=An;en.current={x:er.clientX,y:er.clientY},nn.current=!0,pn.current=!1,on(!0);return}on(!0);let vr=by(cn,Zn.top,Zn.left),{x:wr,y:Hn}=xy(qt,Rn,vr.x,vr.y,Pn());zt(Ht,wr,Hn,{e:An,node:Vn,newPosition:Zn})},[zt,Tt,cn,Pt,Mt,qt,Rn,Pn,Ht]),Jt=Un.useCallback((An,{node:Vn,deltaX:Jn,deltaY:Yn})=>{if(!tn||!Zt)return;let Sn=An;if(nn.current&&!pn.current){let wr=Sn.clientX-en.current.x,Hn=Sn.clientY-en.current.y;if(Math.hypot(wr,Hn)<Mt)return;if(pn.current=!0,nn.current=!1,zt){let Qn=by(cn,bn.current.top,bn.current.left),{x:br,y:Hr}=xy(qt,Rn,Qn.x,Qn.y,Pn());zt(Ht,br,Hr,{e:An,node:Vn,newPosition:bn.current})}}let Fn=bn.current.top+Yn,ur=bn.current.left+Jn;if(St){let{offsetParent:wr}=Vn;if(wr){let Hn=wr.clientHeight-Wa(Bt,vt,bt[1]);Fn=gy(Fn,0,Hn);let er=cp(cn),Qn=gt-Wa(Ft,er,bt[0]);ur=gy(ur,0,Qn)}}let Pr={top:Fn,left:ur};bn.current=Pr;let Wn=by(cn,Fn,ur),{x:Zn,y:vr}=xy(qt,Rn,Wn.x,Wn.y,Pn());tn(Ht,Zn,vr,{e:An,node:Vn,newPosition:Pr})},[tn,zt,Zt,Mt,St,Bt,vt,bt,cn,gt,Ft,Ht,qt,Rn,Pn]),Yt=Un.useCallback((An,{node:Vn})=>{if(!rn||!Zt)return;let Jn=nn.current;if(nn.current=!1,pn.current=!1,en.current={x:0,y:0},Jn){on(!1),bn.current={left:0,top:0};return}let{left:Yn,top:Sn}=bn.current,Fn={top:Sn,left:Yn};on(!1),bn.current={left:0,top:0};let ur=by(cn,Sn,Yn),{x:Pr,y:Wn}=xy(qt,Rn,ur.x,ur.y,Pn());rn(Ht,Pr,Wn,{e:An,node:Vn,newPosition:Fn})},[rn,Zt,cn,qt,Rn,Pn,Ht]);wn.current=kn,yn.current=Jt;let un=Un.useCallback((An,{node:Vn,size:Jn,handle:Yn},Sn,Fn)=>{let ur=Fn==="onResizeStart"?Kt:Fn==="onResize"?an:ln;if(!ur)return;let Pr;if(Vn)Pr=cJ(Yn,Sn,Jn,gt);else Pr={...Jn,top:Sn.top,left:Sn.left};hn.current=Pr;let Wn=iJ(cn,Pr.width,Pr.height),{w:Zn,h:vr}=aJ(qt,Rn,Wn.w,Wn.h,Yn,Pn());ur(Ht,Zn,vr,{e:An.nativeEvent??An,node:Vn,size:Pr,handle:Yn})},[Kt,an,ln,gt,cn,Ht,qt,Rn,Pn]),vn=Un.useCallback((An,Vn)=>{dn(!0);let Jn=hy(cn,_t,$t,Ft,Bt),Yn={...Vn,handle:Vn.handle};un(An,Yn,Jn,"onResizeStart")},[un,cn,_t,$t,Ft,Bt]),_n=Un.useCallback((An,Vn)=>{let Jn=hy(cn,_t,$t,Ft,Bt),Yn={...Vn,handle:Vn.handle};un(An,Yn,Jn,"onResize")},[un,cn,_t,$t,Ft,Bt]),zn=Un.useCallback((An,Vn)=>{dn(!1),hn.current={top:0,left:0,width:0,height:0};let Jn=hy(cn,_t,$t,Ft,Bt),Yn={...Vn,handle:Vn.handle};un(An,Yn,Jn,"onResizeStop")},[un,cn,_t,$t,Ft,Bt]);Un.useEffect(()=>{if(!It)return;let An=fn.current;if(!An)return;let Vn=gn.current||{left:0,top:0},Jn=Zt&&(It.left!==Vn.left||It.top!==Vn.top);if(!Zt){let Yn={node:An,deltaX:It.left,deltaY:It.top,lastX:0,lastY:0,x:It.left,y:It.top};wn.current?.(It.e,Yn)}else if(Jn){let Yn=It.left-bn.current.left,Sn=It.top-bn.current.top,Fn={node:An,deltaX:Yn,deltaY:Sn,lastX:bn.current.left,lastY:bn.current.top,x:It.left,y:It.top};yn.current?.(It.e,Fn)}gn.current=It},[It,Zt,Ht]);let $n=hy(cn,_t,$t,Ft,Bt,Zt?bn.current:null,sn?hn.current:null),Mn=Un.default.Children.only(st),Gn=cp(cn),sr=[Wa(Lt,Gn,bt[0]),Wa(Wt,vt,bt[1])],gr=[Wa(Vt,Gn,bt[0]),Wa(Ut,vt,bt[1])],qn=Mn.props,{className:Bn,style:Tr}=qn,lr=Un.default.cloneElement(Mn,{ref:fn,className:tt("react-grid-item",Bn,At,{static:Et,resizing:sn,"react-draggable":wt,"react-draggable-dragging":Zt,dropping:Boolean(It),cssTransforms:kt}),style:{...Nt,...Tr,...Cn($n)}}),no=jt;return lr=Tc.jsx(xJ.Resizable,{draggableOpts:{disabled:!Ct},className:Ct?void 0:"react-resizable-hide",width:$n.width,height:$n.height,minConstraints:sr,maxConstraints:gr,onResizeStart:vn,onResize:_n,onResizeStop:zn,transformScale:Tt,resizeHandles:Gt,handle:no,children:lr}),lr=Tc.jsx(vJ.DraggableCore,{disabled:!wt,onStart:kn,onDrag:Jt,onStop:Yt,handle:Ot,cancel:".react-resizable-handle"+(Dt?","+Dt:""),scale:Tt,nodeRef:fn,children:lr}),lr}var Rc=()=>{},bJ="react-grid-layout",wJ=!1;try{wJ=/firefox/i.test(navigator.userAgent)}catch{}function uSe(ot,st){let ct=Un.default.Children.toArray(ot),gt=Un.default.Children.toArray(st);if(ct.length!==gt.length)return!1;for(let bt=0;bt<ct.length;bt++){let yt=ct[bt],vt=gt[bt];if(yt?.key!==vt?.key)return!1}return!0}function yJ(ot,st,ct,gt){let bt=[],yt=new Set;Un.default.Children.forEach(st,(xt)=>{if(!Un.default.isValidElement(xt)||xt.key===null)return;let wt=String(xt.key);yt.add(wt);let Ct=ot.find((St)=>St.i===wt);if(Ct)bt.push(kc(Ct));else{let Et=xt.props["data-grid"];if(Et)bt.push({i:wt,x:Et.x??0,y:Et.y??0,w:Et.w??1,h:Et.h??1,minW:Et.minW,maxW:Et.maxW,minH:Et.minH,maxH:Et.maxH,static:Et.static,isDraggable:Et.isDraggable,isResizable:Et.isResizable,resizeHandles:Et.resizeHandles,isBounded:Et.isBounded});else bt.push({i:wt,x:0,y:yy(bt),w:1,h:1})}});let vt=rN(bt,{cols:ct});return gt.compact(vt,ct)}function Cy(ot){let{children:st,width:ct,gridConfig:gt,dragConfig:bt,resizeConfig:yt,dropConfig:vt,positionStrategy:xt=uJ,compactor:wt,constraints:Ct=oN,layout:St=[],droppingItem:Et,autoSize:kt=!0,className:Rt="",style:Tt={},innerRef:Pt,onLayoutChange:Mt=Rc,onDragStart:It=Rc,onDrag:At=Rc,onDragStop:Nt=Rc,onResizeStart:Ot=Rc,onResize:Dt=Rc,onResizeStop:_t=Rc,onDrop:$t=Rc,onDropDragOver:Ft=Rc}=ot,Bt=Un.useMemo(()=>({...pJ,...gt}),[gt]),Lt=Un.useMemo(()=>({...dJ,...bt}),[bt]),Vt=Un.useMemo(()=>({...fJ,...yt}),[yt]),Wt=Un.useMemo(()=>({...mJ,...vt}),[vt]),{cols:Ut,rowHeight:Ht,maxRows:Gt,margin:jt,containerPadding:qt}=Bt,{enabled:Qt,bounded:Xt,handle:zt,cancel:tn,threshold:rn}=Lt,{enabled:Kt,handles:an,handleComponent:ln}=Vt,{enabled:Zt,defaultItem:on,onDragOver:sn}=Wt,dn=wt??mN("vertical"),{type:fn,allowOverlap:bn}=dn,hn=dn.preventCollision??!1,gn=Un.useMemo(()=>Et??{i:"__dropping-elem__",...on},[Et,on]),xn=xt.type==="transform",wn=xt.scale,yn=qt??jt,[nn,en]=Un.useState(!1),[pn,cn]=Un.useState(()=>yJ(St,st,Ut,dn)),[mn,Pn]=Un.useState(null),[Rn,Cn]=Un.useState(!1),[kn,Jt]=Un.useState(null),[Yt,un]=Un.useState(),vn=Un.useRef(null),_n=Un.useRef(null),zn=Un.useRef(null),$n=Un.useRef(0),Mn=Un.useRef(pn),Gn=Un.useRef(St),sr=Un.useRef(st),gr=Un.useRef(fn),qn=Un.useRef(pn);qn.current=pn,Un.useEffect(()=>{if(en(!0),!Bd.deepEqual(pn,St))Mt(pn)},[]),Un.useEffect(()=>{if(mn)return;if(kn)return;let Hn=!Bd.deepEqual(St,Gn.current),er=!uSe(st,sr.current),Qn=fn!==gr.current;if(Hn||er||Qn){let Hr=yJ(Hn?St:pn,st,Ut,dn);if(!Bd.deepEqual(Hr,pn))cn(Hr)}Gn.current=St,sr.current=st,gr.current=fn},[St,st,Ut,fn,dn,mn,kn,pn]),Un.useEffect(()=>{if(!mn&&!Bd.deepEqual(pn,Mn.current)){Mn.current=pn;let Hn=pn.filter((er)=>er.i!==gn.i);Mt(Hn)}},[pn,mn,Mt,gn.i]);let Bn=Un.useMemo(()=>{if(!kt)return;let Hn=yy(pn),er=yn[1];return Hn*Ht+(Hn-1)*jt[1]+er*2+"px"},[kt,pn,Ht,jt,yn]),Tr=Un.useCallback((Hn,er,Qn,br)=>{let Hr=qn.current,Gr=pp(Hr,Hn);if(!Gr)return;let Eo={w:Gr.w,h:Gr.h,x:Gr.x,y:Gr.y,i:Hn};vn.current=kc(Gr),zn.current=Hr,Pn(Eo),It(Hr,Gr,Gr,null,br.e,br.node)},[It]),lr=Un.useCallback((Hn,er,Qn,br)=>{let Hr=qn.current,Gr=vn.current,Eo=pp(Hr,Hn);if(!Eo)return;let ui={w:Eo.w,h:Eo.h,x:Eo.x,y:Eo.y,i:Hn},ko=lp(Hr,Eo,er,Qn,!0,hn,fn,Ut,bn);At(ko,Gr,Eo,ui,br.e,br.node),cn(dn.compact(ko,Ut)),Pn(ui)},[hn,fn,Ut,bn,dn,At]),no=Un.useCallback((Hn,er,Qn,br)=>{if(!mn)return;let Hr=qn.current,Gr=vn.current,Eo=pp(Hr,Hn);if(!Eo)return;let ui=lp(Hr,Eo,er,Qn,!0,hn,fn,Ut,bn),ko=dn.compact(ui,Ut);Nt(ko,Gr,Eo,null,br.e,br.node);let Mi=zn.current;if(vn.current=null,zn.current=null,Pn(null),cn(ko),Mi&&!Bd.deepEqual(Mi,ko))Mt(ko)},[mn,hn,fn,Ut,bn,dn,Nt,Mt]),An=Un.useCallback((Hn,er,Qn,br)=>{let Hr=qn.current,Gr=pp(Hr,Hn);if(!Gr)return;_n.current=kc(Gr),zn.current=Hr,Cn(!0),Ot(Hr,Gr,Gr,null,br.e,br.node)},[Ot]),Vn=Un.useCallback((Hn,er,Qn,br)=>{let Hr=qn.current,Gr=_n.current,{handle:Eo}=br,ui=!1,ko,Mi,[Iy,jl]=sJ(Hr,Hn,(Mo)=>{if(ko=Mo.x,Mi=Mo.y,["sw","w","nw","n","ne"].includes(Eo)){if(["sw","nw","w"].includes(Eo))ko=Mo.x+(Mo.w-er),er=Mo.x!==ko&&ko<0?Mo.w:er,ko=ko<0?0:ko;if(["ne","n","nw"].includes(Eo))Mi=Mo.y+(Mo.h-Qn),Qn=Mo.y!==Mi&&Mi<0?Mo.h:Qn,Mi=Mi<0?0:Mi;ui=!0}if(hn&&!bn){if(tN(Hr,{...Mo,w:er,h:Qn,x:ko??Mo.x,y:Mi??Mo.y}).filter((Ay)=>Ay.i!==Mo.i).length>0)Mi=Mo.y,Qn=Mo.h,ko=Mo.x,er=Mo.w,ui=!1}return Mo.w=er,Mo.h=Qn,Mo});if(!jl)return;let kg=Iy;if(ui&&ko!==void 0&&Mi!==void 0)kg=lp(Iy,jl,ko,Mi,!0,hn,fn,Ut,bn);let My={w:jl.w,h:jl.h,x:jl.x,y:jl.y,i:Hn,static:!0};Dt(kg,Gr,jl,My,br.e,br.node),cn(dn.compact(kg,Ut)),Pn(My)},[hn,fn,Ut,bn,dn,Dt]),Jn=Un.useCallback((Hn,er,Qn,br)=>{let Hr=qn.current,Gr=_n.current,Eo=pp(Hr,Hn),ui=dn.compact(Hr,Ut);_t(ui,Gr,Eo??null,null,br.e,br.node);let ko=zn.current;if(_n.current=null,zn.current=null,Pn(null),Cn(!1),cn(ui),ko&&!Bd.deepEqual(ko,ui))Mt(ui)},[Ut,dn,_t,Mt]),Yn=Un.useCallback(()=>{let Hn=qn.current;if(!Hn.some((br)=>br.i===gn.i)){Jt(null),Pn(null),un(void 0);return}let Qn=dn.compact(Hn.filter((br)=>br.i!==gn.i),Ut);cn(Qn),Jt(null),Pn(null),un(void 0)},[gn.i,Ut,dn]),Sn=Un.useCallback((Hn)=>{if(Hn.preventDefault(),Hn.stopPropagation(),wJ&&!Hn.nativeEvent.target?.classList.contains(bJ))return!1;let er=sn?sn(Hn.nativeEvent):Ft(Hn);if(er===!1){if(kn)Yn();return!1}let{dragOffsetX:Qn=0,dragOffsetY:br=0,...Hr}=er??{},Gr={...gn,...Hr},Eo=Hn.currentTarget.getBoundingClientRect(),ui={cols:Ut,margin:jt,maxRows:Gt,rowHeight:Ht,containerWidth:ct,containerPadding:yn},ko=cp(ui),Mi=Wa(Gr.w,ko,jt[0]),Iy=Wa(Gr.h,Ht,jt[1]),jl=Mi/2,kg=Iy/2,My=Hn.clientX-Eo.left+Qn-jl,Mo=Hn.clientY-Eo.top+br-kg,bE=Math.max(0,My),Ay=Math.max(0,Mo),Ny={left:bE/wn,top:Ay/wn,e:Hn.nativeEvent};if(!kn){let yE=oJ(ui,Ay,bE,Gr.w,Gr.h);Jt(Tc.jsx("div",{},Gr.i)),un(Ny);let hY=qn.current.filter((bY)=>bY.i!==Gr.i);cn([...hY,{...Gr,x:yE.x,y:yE.y,static:!1,isDraggable:!0}])}else if(Yt){if(Yt.left!==Ny.left||Yt.top!==Ny.top)un(Ny)}},[kn,Yt,gn,sn,Ft,Yn,wn,Ut,jt,Gt,Ht,ct,yn]),Fn=Un.useCallback((Hn)=>{if(Hn.preventDefault(),Hn.stopPropagation(),$n.current--,$n.current<0)$n.current=0;if($n.current===0)Yn()},[Yn]),ur=Un.useCallback((Hn)=>{Hn.preventDefault(),Hn.stopPropagation(),$n.current++},[]),Pr=Un.useCallback((Hn)=>{Hn.preventDefault(),Hn.stopPropagation();let er=qn.current,Qn=er.find((br)=>br.i===gn.i);$n.current=0,Yn(),$t(er,Qn,Hn.nativeEvent)},[gn.i,Yn,$t]),Wn=Un.useCallback((Hn,er)=>{if(!Hn||!Hn.key)return null;let Qn=pp(pn,String(Hn.key));if(!Qn)return null;let br=typeof Qn.isDraggable==="boolean"?Qn.isDraggable:!Qn.static&&Qt,Hr=typeof Qn.isResizable==="boolean"?Qn.isResizable:!Qn.static&&Kt,Gr=Qn.resizeHandles||[...an],Eo=br&&Xt&&Qn.isBounded!==!1,ui=ln;return Tc.jsx(hN,{containerWidth:ct,cols:Ut,margin:jt,containerPadding:yn,maxRows:Gt,rowHeight:Ht,cancel:tn,handle:zt,onDragStart:Tr,onDrag:lr,onDragStop:no,onResizeStart:An,onResize:Vn,onResizeStop:Jn,isDraggable:br,isResizable:Hr,isBounded:Eo,useCSSTransforms:xn&&nn,usePercentages:!nn,transformScale:wn,positionStrategy:xt,dragThreshold:rn,w:Qn.w,h:Qn.h,x:Qn.x,y:Qn.y,i:Qn.i,minH:Qn.minH,minW:Qn.minW,maxH:Qn.maxH,maxW:Qn.maxW,static:Qn.static,droppingPosition:er?Yt:void 0,resizeHandles:Gr,resizeHandle:ui,constraints:Ct,layoutItem:Qn,layout:pn,children:Hn},Qn.i)},[pn,ct,Ut,jt,yn,Gt,Ht,tn,zt,Tr,lr,no,An,Vn,Jn,Qt,Kt,Xt,xn,nn,wn,xt,rn,Yt,an,ln,Ct]),Zn=()=>{if(!mn)return null;return Tc.jsx(hN,{w:mn.w,h:mn.h,x:mn.x,y:mn.y,i:mn.i,className:`react-grid-placeholder ${Rn?"placeholder-resizing":""}`,containerWidth:ct,cols:Ut,margin:jt,containerPadding:yn,maxRows:Gt,rowHeight:Ht,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:xn,transformScale:wn,constraints:Ct,layout:pn,children:Tc.jsx("div",{})})},vr=tt(bJ,Rt),wr={height:Bn,...Tt};return Tc.jsxs("div",{ref:Pt,className:vr,style:wr,onDrop:Zt?Pr:void 0,onDragLeave:Zt?Fn:void 0,onDragEnter:Zt?ur:void 0,onDragOver:Zt?Sn:void 0,children:[Un.default.Children.map(st,(Hn)=>{if(!Un.default.isValidElement(Hn))return null;return Wn(Hn)}),Zt&&kn&&Wn(kn,!0),Zn()]})}var Vs=e(r(),1),bN="moi:empty-state",CJ={type:"spring",duration:0.35,bounce:0};function dSe({items:ot,customizing:st,emptyState:ct,renderItem:gt,onMove:bt,onRemove:yt}){let[vt,xt]=Sy.useState(()=>cy(ot)),[wt,Ct]=Sy.useState(ot),{width:St,containerRef:Et,mounted:kt}=gN({measureBeforeMount:!0});if(wt!==ot)Ct(ot),xt((Pt)=>{let Mt=new Map(Pt.map((Nt)=>[Nt.i,Nt])),It=ot.filter((Nt)=>Mt.has(Nt.id)).map((Nt)=>({...Mt.get(Nt.id),w:Nt.w,h:Nt.h})),At=new Set(It.map((Nt)=>Nt.i));return[...It,...cy(ot.filter((Nt)=>!At.has(Nt.id)),It)]});let Rt=ct?[...vt,{i:bN,x:0,y:vt.reduce((Pt,Mt)=>Math.max(Pt,Mt.y+Mt.h),0),w:4,h:1,static:!0}]:vt,Tt=Sy.useCallback((Pt)=>{let Mt=Pt.filter((It)=>It.i!==bN);xt(Mt),bt?.(Mt.map((It)=>({id:It.i,x:It.x,y:It.y})))},[bt]);return Vs.jsx("div",{ref:Et,className:"w-full",children:kt&&Vs.jsxs(Cy,{width:St,layout:Rt,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!st},resizeConfig:{enabled:!1},compactor:wy,onLayoutChange:Tt,children:[vt.map((Pt)=>Vs.jsx("div",{children:Vs.jsx(S.div,{layoutId:Pt.i,"data-applet-thumbnail":Uu("widgets",Pt.i),className:"size-full",transition:CJ,children:Vs.jsx(NS,{customizing:st,widgetId:Pt.i,onRemove:yt?()=>yt(Pt.i):void 0,children:gt(Pt.i)})})},Pt.i)),ct&&Vs.jsx("div",{children:Vs.jsx(S.div,{layout:!0,className:"size-full",transition:CJ,children:ct})},bN)]})})}function SJ({items:ot,customizing:st,header:ct,emptyState:gt,bottomInset:bt=0,renderItem:yt,onMove:vt,onRemove:xt}){return Vs.jsxs("div",{className:"size-full overflow-y-auto p-4",children:[Vs.jsx("div",{className:"mx-auto h-32 w-full max-w-(--column-w)",children:ct}),Vs.jsx(S.div,{className:"mx-auto flex min-h-0 w-full max-w-(--column-w) flex-col gap-2",animate:{marginBottom:bt},transition:{type:"spring",duration:0.3,bounce:0},children:(ot.length>0||gt)&&Vs.jsx(dSe,{items:ot,customizing:st,emptyState:gt,renderItem:yt,onMove:vt,onRemove:xt})})]})}var Jr=e(r(),1);function fSe({onCreateWidget:ot,showOnboarding:st}){return Jr.jsxs("div",{className:"relative grid size-full grid-cols-2 grid-rows-1 gap-2 overflow-hidden",children:[Jr.jsx("div",{className:"overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:Jr.jsx("div",{className:"flex size-full items-center justify-start bg-linear-to-r from-muted from-40% to-transparent p-12",children:Jr.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Widgets"})})}),Jr.jsx("div",{className:"overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:st&&Jr.jsx("div",{className:"flex size-full items-end justify-end",children:Jr.jsx("span",{className:"m-8 max-w-56 text-right text-sm text-muted-foreground",children:"Widgets can surface information, read data, and perform actions"})})}),Jr.jsxs(a,{type:"button",variant:"outline",className:n("absolute inset-0 m-auto h-fit w-fit","flex-col gap-1 rounded-2xl border-0 py-4 pr-8 pl-8! text-xs shadow-sm transition-shadow duration-300 ease-out squircle hover:bg-background hover:shadow-lg [&_svg]:size-8"),onClick:ot,children:[Jr.jsx(Ci,{"data-icon":"inline-start",stroke:1.5}),"New widget"]})]})}function yN({Icon:ot,label:st,active:ct,className:gt,...bt}){return Jr.jsx(a,{type:"button",variant:ct?"default":"secondary",className:n("relative h-16 w-24 rounded-lg px-4 py-0 text-xs [&_svg]:size-5",gt),"aria-pressed":ct,...bt,children:Jr.jsx(Qi,{mode:"popLayout",initial:!1,children:Jr.jsxs(S.span,{className:"flex flex-col items-center gap-1.5",variants:{from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.2,bounce:0},children:[ct?Jr.jsx(Ys,{stroke:1.5}):Jr.jsx(ot,{stroke:1.5}),Jr.jsx("span",{children:ct?"Done":st})]},ct?"done":"action")})})}function mSe({customizing:ot,theming:st,onCustomizingChange:ct,onThemingChange:gt}){return Jr.jsxs("div",{className:"flex size-full items-center gap-4",children:[Jr.jsx(nJ,{}),Jr.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[Jr.jsx(yN,{Icon:DL,label:"Customize",active:ot,onClick:()=>ct(!ot)}),Jr.jsx(yN,{Icon:G0,label:"Theme",active:st,onClick:()=>gt(!st)}),Jr.jsx(TS,{children:Jr.jsx(mc,{render:Jr.jsx(yN,{Icon:Qc,label:"Settings"})})})]})]})}function gSe(){let[ot,st]=YS.useState(0);return[YS.useCallback((gt)=>{if(!gt)return;let bt=new ResizeObserver(([yt])=>{let vt=yt.borderBoxSize?.[0];st(vt?vt.blockSize:yt.contentRect.height)});return bt.observe(gt),()=>bt.disconnect()},[]),ot]}function EJ({onCreateWidget:ot,onCreateView:st,onOpenView:ct,customizing:gt,theming:bt,onThemingChange:yt,onCustomizingChange:vt,widgets:xt,views:wt}){let{layout:Ct,setLayout:St}=Sr(),Et=Ar((Bt)=>Bt.hasSentMessageFromMoi),kt=new Map(xt.map((Bt)=>[Bt.id,Bt])),Rt=new Set(Ct.widgetGrid.map((Bt)=>Bt.i)),Tt=Ct.widgetGrid.filter((Bt)=>kt.has(Bt.i)).map((Bt)=>{let Lt=kt.get(Bt.i);return{id:Bt.i,w:Lt.config.colSpan,h:Lt.config.rowSpan,x:Bt.x,y:Bt.y}}),Pt=xt.filter((Bt)=>!Rt.has(Bt.id)).map((Bt)=>({id:Bt.id,w:Bt.config.colSpan,h:Bt.config.rowSpan})),Mt=!gt&&Tt.every((Bt)=>Il(Bt.id)),It=!Et&&xt.every((Bt)=>Il(Bt.id)),[At,Nt]=gSe(),Ot=gt;mS({kind:"widget",enabled:!gt,targets:Tt.filter((Bt)=>!Il(Bt.id)).map((Bt)=>({id:Bt.id,revision:kt.get(Bt.id)?.revision}))});function Dt(Bt){let Lt=Nq(Bt,{views:wt,onOpenView:ct,onCreateView:st,showOnboarding:It});if(Lt)return Lt;return Jr.jsx(Fq,{name:Bt})}function _t(Bt){St({widgetGrid:Ct.widgetGrid.filter((Lt)=>Lt.i!==Bt)})}function $t(Bt){let Lt=kt.get(Bt);if(!Lt)return;let Vt=Ct.widgetGrid.map((Ut)=>{let Ht=kt.get(Ut.i);return{...Ut,w:Ht?.config.colSpan??1,h:Ht?.config.rowSpan??1}}),Wt=IS(Vt,Lt.config.colSpan,Lt.config.rowSpan);St({widgetGrid:[...Ct.widgetGrid,{i:Bt,x:Wt.x,y:Wt.y}]})}function Ft(Bt){St({widgetGrid:Oq(Ct.widgetGrid,Bt)})}return Jr.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:Jr.jsxs($v,{children:[Jr.jsx(SJ,{items:Tt,customizing:gt,header:Jr.jsx(mSe,{customizing:gt,theming:bt,onCustomizingChange:vt,onThemingChange:yt}),emptyState:Mt?Jr.jsx(fSe,{onCreateWidget:ot,showOnboarding:It}):void 0,bottomInset:Ot?Nt:0,renderItem:Dt,onMove:Ft,onRemove:_t}),Jr.jsx(Qi,{children:gt&&Jr.jsx(zq,{ref:At,items:Pt,renderItem:Dt,onCreateWidget:ot,onClose:()=>vt(!1),onRestore:$t})})]})})}var RJ=e(r(),1);function kJ({children:ot}){return RJ.jsx("header",{className:n("@container relative flex shrink-0 items-center gap-1 py-2 pr-3 pl-4","after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border"),children:ot})}var TJ=!0;var hSe=64;function PJ(ot,st=[]){let ct=CP(ot),gt=ct.attachments.map(SP);return(I8(ct.text).trim()||(gt.length?gt:st).filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,hSe).trimEnd()}function ZS(ot,st,ct={}){if("id"in ot){let vt={source:ct.source,...ot.kind==="image"?{purpose:ct.purpose}:{}};return{attachment:{type:"upload",uploadId:ot.id,...vt},part:{type:"file-attachment",mediaType:ot.mediaType,label:ot.filename,...vt,previewUrl:ot.kind==="image"?st:void 0}}}let{source:gt,label:bt,text:yt}=ot;return{attachment:{type:"text",source:gt,label:bt,text:yt},part:P8({type:"text",source:gt,label:bt,text:yt})}}function IJ(ot){return{attachments:ot.map((st)=>st.attachment),parts:ot.map((st)=>st.part)}}async function MJ(ot,st){let ct=b1(st);if(ct)throw Error(ct);return IJ(await Promise.all(st.map(async(gt)=>{if(gt.type==="text")return ZS(gt);let bt=await yb(ot,gt.file??gt.path);return ZS(bt,`/api/workspaces/${ot}/uploads/${bt.id}`,{source:gt.source})})))}function vN(ot){return IJ(ot.flatMap((st)=>{if(st.kind==="text")return[ZS(st)];if(!st.upload)return[];return[ZS({...st.upload,filename:st.label,mediaType:st.mediaType},st.previewUrl,{source:st.source,purpose:st.kind==="drawing"?st.purpose:void 0})]}))}function xN(ot){return!ot?.applet&&!ot?.preparedAttachments}function eE(ot,st,ct){if(!xN(ct))return[];return(Mr.getState().attachments[As(ot,st)]??[]).filter((bt)=>bt.kind==="text"||bt.status==="ready"&&bt.upload)}function bSe({queryClient:ot,workspaceId:st,sessionId:ct,parts:gt}){let bt=`optimistic:${crypto.randomUUID()}`;return ot.setQueryData(Tn.events(st,ct),(yt)=>uv(yt??nh(),{kind:"turn",turn:{id:bt,role:"user",origin:{kind:"user-input"},parts:gt,timestamp:new Date().toISOString()}})),Mr.getState().setActivity(st,ct,"running"),Mr.getState().setError(st,ct,null),bt}function tE({tabId:ot,queryClient:st,workspaceId:ct,sessionId:gt,text:bt,filenames:yt=[]}){if(ot&&ot!=="overview")ra(st,ct,(xt)=>{xt.sessions[gt]={...xt.sessions[gt],tabId:ot}});let vt=PJ(bt,yt);if(!vt)return;st.setQueryData(Tn.sessions(ct),(xt)=>[{sessionId:gt,summary:vt,lastModified:Date.now()},...(xt??[]).filter((wt)=>wt.sessionId!==gt)])}function nE(ot,st,ct,gt){let bt=ot?.models,yt=!st||!bt||bt.some((Et)=>Et.value===st)?st:void 0,vt=ot?.provider==="codex"?O1(ot.models,st):bt?.find((Et)=>Et.value===(yt??"default")),xt=ot?.provider==="codex"&&vt?vt.resolvedModel??vt.value:yt,wt=ct&&(!vt||(vt.supportedEffortLevels??[]).includes(ct))?ct:void 0,Ct=vt?L1(vt,gt):gt,St=TJ&&ot?.supportsStreaming?!0:void 0;return{model:xt,effort:wt,...Ct!==void 0?{speedMode:Ct}:{},stream:St}}function dp(ot,st,ct){Mr.getState().renameSession(ot,st,ct),Ar.getState().moveComposerDraft(oi(ot,st),oi(ot,ct))}function rE(ot,st,ct=vN(st)){let gt=[...ct.parts];if(ot.text)gt.push({type:"text",text:ot.text});return{attachments:ct.attachments,optimisticId:bSe({...ot,parts:gt})}}function oE(ot,st){for(let ct of st)Mr.getState().removeAttachment(ot,ct.localId);Ar.getState().markMessageSentFromMoi(ot)}var NJ=e(t(),1);function AJ(ot){if(ot.status==="available")return null;if(ot.status==="checking")return"The agent is still connecting";if(ot.status==="disconnected")return"This workspace is disconnected from Moi";if(ot.status==="login-required")return"Sign in to the agent to send this message";return"The agent is unavailable in this workspace"}function ySe(ot,st,ct,gt="shared"){let bt=new Set,yt=!1,vt=()=>M3(st,ot,ct().tabId,gt)??null;async function xt(wt){if(yt)return;let Ct=(Nt)=>{qr.add({title:"Couldn’t send message",description:Nt,type:"error"}),Ms(ot,{source:"runtime",message:`sendChatMessage() from ${wt.applet.kind}:${wt.applet.id}: ${Nt}`})},St=AJ(ct().agentAvailability);if(St){Ct(St);return}let Et=vt(),kt=ct().tabId,Rt=!0,Tt,Pt=()=>{if(Rt=!1,It(),bt.delete(Mt),Tt)qr.close(Tt)},Mt=()=>{if(!Rt)return;Pt(),qr.add({title:"Message canceled",description:"The active chat changed before attachments were ready",type:"info"})},It=st.getQueryCache().subscribe(()=>{if(vt()!==Et||ct().tabId!==kt)Mt()});if(bt.add(Mt),ct().sessionId!==Et){Mt();return}ct().revealChat();let At;try{if(wt.attachments.some((Dt)=>Dt.type==="file"))Tt=qr.add({title:"Preparing attachments…",type:"loading",timeout:0});if(At=await MJ(ot,wt.attachments),!Rt)return;let Nt=ct(),Ot=AJ(Nt.agentAvailability);if(Ot)throw Error(Ot);if(Nt.sessionId!==Et||Nt.tabId!==kt){Mt();return}}catch(Nt){if(Rt)Pt(),Ct(Nt instanceof Error?Nt.message:"Couldn’t prepare the attachments");return}Pt();try{ct().send(wt.message,{applet:wt.applet,preparedAttachments:At})}catch(Nt){Ct(Nt instanceof Error?Nt.message:"Something went wrong while sending this message")}}return{handle:xt,dispose(){yt=!0;for(let wt of bt)wt()}}}function DJ(ot){let st=b(),ct=Kn(),gt=uc(),bt=Si(),yt=k({...ot,tabId:gt});NJ.useLayoutEffect(()=>{let vt=ySe(st,ct,()=>yt.current,bt?"browser-tab":"shared"),xt=v1(st).on("sendChatMessage",(wt)=>{vt.handle(wt)});return()=>{xt(),vt.dispose()}},[st,ct,yt,gt,bt])}function _J(ot,st){let ct=b();x1(ct,"addChatAttachment",(gt)=>{uz({workspaceId:ct,sessionId:ot},gt),st()})}var Fd=e(t(),1);var LJ=e(t(),1);var OJ=new Map;function vSe(ot){let st=OJ.get(ot)??[];return OJ.delete(ot),st}function xSe(ot,st=[]){return[...vSe(ot),...st]}function wSe(ot,st){if(!ot.startsWith("views/"))return;return Object.keys(st).length>0?st:void 0}function CSe(ot,st){if(ot.startsWith("views/"))return st?.find((ct)=>ct.id===ot.slice(6))?.title||void 0;return}function BJ({activeTab:ot,appletParams:st}){let ct=b(),gt=PS(ct).data;return LJ.useCallback((bt={})=>{let yt=xSe(ct,bt.directives??[]),vt=wSe(ot,st);return{activeTab:{id:ot,title:CSe(ot,gt),...vt?{params:vt}:{}},...bt.applet?{applet:bt.applet}:{},...yt.length>0?{directives:yt}:{}}},[ct,ot,st,gt])}function FJ(ot,st){if(!st?.throughMessageId)return ot;let ct=st.throughMessageId,gt=ot.turns.findIndex((yt)=>yt.id===ct);if(gt<0)return ot;let bt=new Set(st.noticeIds);return{...ot,turns:ot.turns.slice(gt+1),notices:ot.notices.filter((yt)=>!bt.has(yt.id))}}function SSe(ot){return ot.filter((st)=>st.text.length>0).map((st)=>st.kind==="reasoning"?{type:"reasoning",text:st.text}:{type:"text",text:st.text})}function HJ(ot){let st=SSe(ot?.blocks??[]);if(st.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:st}}var zJ=nh();function $J(ot){let st=b(),ct=Kn(),{layout:gt}=Sr(),[bt,yt]=pc(ot.activeTab),vt=Si(),xt=ua(st).data,wt=bt??null,Ct=wt??Yo(ot.activeTab),St=BJ(ot),Et=gi((Ut)=>wt?Ut.activity[`${st}:${wt}`]??"idle":"idle"),kt=th(Et),Rt=gi((Ut)=>wt?Ut.errors[`${st}:${wt}`]??null:null),Tt=O3(st,wt),{refetch:Pt}=Tt,Mt=Kv(st,wt),{refetch:It}=Mt,At=Fd.useCallback(async()=>{await Pt(),await It()},[Pt,It]),Nt=Mt.data?.fork,Ot=!wt||Mt.data!==void 0,Dt=Ot?Tt.data??zJ:zJ;if(Tt.data&&Nt)Dt=FJ(Tt.data,Nt);let _t=bt!==void 0&&Ot&&(wt===null||Tt.data!==void 0),$t=gi((Ut)=>T5(Ut.previews,st,wt).root),Ft=Fd.useMemo(()=>HJ($t),[$t]),Bt=Mt.data?.config,Lt=Fd.useCallback((Ut,Ht)=>{let Gt=Ut.trim(),jt=eE(st,Ct,Ht);if(!Gt&&jt.length===0&&!Ht?.preparedAttachments?.attachments.length)return;let qt=Ht?.preparedAttachments??vN(jt),Qt=b1(qt.attachments);if(Qt){qr.add({title:"Couldn’t send message",description:Qt,type:"error"});return}let Xt=wt,zt=!1;if(!Xt){if(Xt=crypto.randomUUID(),zt=!0,!xN(Ht))dp(st,Ct,Xt);yt(Xt),tE({tabId:ot.activeTab,queryClient:ct,workspaceId:st,sessionId:Xt,text:Gt,filenames:jt.map((fn)=>fn.label)})}let{attachments:tn,optimisticId:rn}=rE({queryClient:ct,workspaceId:st,sessionId:Xt,text:Gt},jt,qt),Kt=Bt?.model??gt.selectedModel,an=Bt?.effort??gt.selectedEffort,ln=Bt?.speedMode??gt.selectedSpeedMode,{model:Zt,effort:on,speedMode:sn,stream:dn}=nE(xt,Kt,an,ln);if(Jv({type:"chat",workspaceId:st,content:Gt,sessionId:Xt,isNew:zt,selectedSessionScope:vt?"browser-tab":"shared",optimisticId:rn,model:Zt,effort:on,speedMode:sn,stream:dn,context:St(Ht),...tn.length>0?{attachments:tn}:{}}),oE(st,jt),zt)ct.invalidateQueries({queryKey:Tn.previews})},[ot.activeTab,Ct,wt,st,ct,gt.selectedModel,gt.selectedEffort,gt.selectedSpeedMode,St,Bt?.model,Bt?.effort,Bt?.speedMode,yt,vt,xt]),Vt=Fd.useCallback(()=>{if(!wt)return;Mr.getState().setError(st,wt,null)},[wt,st]),Wt=Fd.useCallback(()=>{if(!kt||!wt)return;Jv({type:"stop",workspaceId:st,sessionId:wt})},[kt,wt,st]);return{view:Dt,forkedFromSessionId:Nt?.fromSessionId,chatLoaded:_t,previewTurn:Ft,sessionId:wt,composerSessionId:Ct,processing:kt,error:Rt,loadError:Mt.error?.message??Tt.error?.message??null,retryLoad:At,send:Lt,stop:Wt,selectSession:yt,dismissError:Vt}}var UJ=e(t(),1);var Ti=e(t(),1);function WJ({active:ot,viewId:st,sessionId:ct,source:gt,workspaceId:bt,onEditingStart:yt,onContinueInChat:vt}){let xt=Ti.useRef(`sketch:${st}`),wt=Ti.useRef(0),Ct=Ti.useRef(null),St=Ti.useRef(null),Et=Ti.useRef(!0),[kt,Rt]=Ti.useState(!1),Tt=k(yt),Pt=k(vt),Mt=Ti.useCallback((Ft)=>{if(!Et.current)return;if(!Ft){wt.current+=1,Ct.current=null,St.current=null,Mr.getState().removeAttachment(bt,xt.current);return}vb({workspaceId:bt,sessionId:ct,localId:xt.current,purpose:"sketch",source:gt,blob:Ft})},[ct,gt,bt]),It=Ti.useCallback((Ft)=>{if(!Ft)return St.current??Promise.resolve();if(Ft===Ct.current){if(Mr.getState().attachments[As(bt,ct)]?.some((Wt)=>Wt.localId===xt.current&&Wt.kind!=="text"&&(Wt.status==="ready"||Wt.status==="uploading")))return St.current??Promise.resolve()}Ct.current=Ft;let Bt=++wt.current,Lt=M1({workspaceId:bt,sessionId:ct,localId:xt.current,purpose:"sketch",source:gt,blob:Ft,isCurrent:()=>wt.current===Bt});return St.current=Lt,Lt},[ct,gt,bt]),At=P1({mode:"sketch",onChange:Mt,onEditingStart:()=>Tt.current()}),{controls:Nt}=At,Ot=Ti.useCallback(async()=>{await It(await Nt.flush())},[Nt,It]),Dt=Ti.useCallback(async()=>{await It(await Nt.deactivate())},[Nt,It]),_t=Ti.useCallback(async()=>{if(kt)return;Rt(!0);try{await Dt(),Pt.current()}finally{Rt(!1)}},[kt,Dt,Pt]),$t=Ti.useCallback(async()=>{Et.current=!1,wt.current+=1,Ct.current=null,St.current=null,Mr.getState().removeAttachment(bt,xt.current);try{await Nt.cancel()}finally{Et.current=!0}},[Nt,bt]);return Ti.useEffect(()=>{if(!ot&&Nt.active)Dt()},[ot,Nt.active,Dt]),{...At,continuing:kt,continueInChat:_t,prepareForSend:Ot,resetDocument:$t}}var Fr=e(r(),1);function jJ({ref:ot,active:st,pendingView:ct,running:gt,sketchSessionId:bt,chatDocked:yt,chatOpen:vt=!1,workspaceId:xt,onEditingStart:wt,onContinueInChat:Ct,onOpenChat:St,onDiscard:Et}){let kt=ct.status==="submitted"?gt?"building":"waiting":ct.status,Rt=WJ({active:st&&ct.status==="draft",viewId:ct.id,sessionId:bt??ct.buildSessionId??Yo(To(ct.id)),source:To(ct.id),workspaceId:xt,onEditingStart:wt,onContinueInChat:Ct});return UJ.useImperativeHandle(ot,()=>({prepareSketchForSend:Rt.prepareForSend,resetSketch:Rt.resetDocument}),[Rt.prepareForSend,Rt.resetDocument]),Fr.jsx(RSe,{active:st,chatDocked:yt,chatOpen:vt,error:ct.error,sketch:Rt,displayStatus:kt,onDiscard:Et,onOpenChat:St})}function ESe(){return Fr.jsx(iE,{children:Fr.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 p-8 text-center",children:[Fr.jsx($o,{className:"size-6 text-muted-foreground"}),Fr.jsx("p",{className:"text-sm text-muted-foreground",children:"Starting view chat…"})]})})}function kSe({error:ot,chatOpen:st,onOpenChat:ct,onDiscard:gt}){return Fr.jsx(iE,{children:Fr.jsxs("div",{className:"pointer-events-auto flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-8 text-center",children:[Fr.jsx("p",{className:"text-sm text-muted-foreground",children:ot}),Fr.jsx(a,{variant:st?"secondary":"default",onClick:ct,children:st?"Go to chat":"Open chat"}),Fr.jsx(a,{variant:"secondary",onClick:gt,children:"Discard view"})]})})}function RSe({active:ot,chatDocked:st,chatOpen:ct=!1,error:gt,sketch:bt,displayStatus:yt,onDiscard:vt,onOpenChat:xt}){let wt=yt==="draft";return Fr.jsxs("div",{className:n("relative min-h-0 flex-1 overflow-hidden bg-background",ot?"flex":"hidden"),children:[Fr.jsx(TSe,{chatDocked:st,sketch:bt,draft:wt}),Fr.jsx("div",{inert:wt?void 0:!0,className:n("absolute inset-0",!wt&&"pointer-events-none opacity-50"),children:Fr.jsx(R1,{...bt.layerProps,children:wt&&Fr.jsx(I1,{controls:bt.controls,title:"Sketch the view",busy:bt.continuing,onComplete:()=>void bt.continueInChat()})})}),Fr.jsx("div",{"aria-hidden":!0,className:n("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",yt==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),yt==="building"&&Fr.jsx(ISe,{controls:bt.controls}),yt==="starting"&&Fr.jsx(ESe,{}),yt==="waiting"&&Fr.jsx(PSe,{error:gt,chatOpen:ct,onDiscard:vt,onOpenChat:xt}),yt==="failed"&&Fr.jsx(kSe,{chatOpen:ct,error:gt,onOpenChat:xt,onDiscard:vt})]})}function TSe({chatDocked:ot,sketch:st,draft:ct}){let{controls:gt,targetRef:bt}=st,{hasStrokes:yt}=bb(gt);return Fr.jsx("div",{ref:bt,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:ct&&!gt.active&&!yt&&Fr.jsxs("div",{className:n("mb-4 flex h-full flex-col items-center justify-center gap-2 p-12 text-center text-sm text-muted-foreground","bg-radial from-background from-10% to-transparent",ot?"w-full":"mr-auto w-[calc(100%-var(--chat-max))]"),children:[Fr.jsx(ff,{size:56,stroke:0.5}),Fr.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function PSe({error:ot,chatOpen:st,onDiscard:ct,onOpenChat:gt}){return Fr.jsx(iE,{children:Fr.jsxs("div",{className:"pointer-events-auto flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-12 text-center",children:[Fr.jsxs("div",{className:"flex flex-col gap-1",children:[Fr.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),Fr.jsx("p",{className:"text-sm text-muted-foreground",children:ot??"Use the chat to work through the issue and continue"})]}),Fr.jsxs("div",{className:"flex gap-2",children:[Fr.jsx(a,{variant:st?"secondary":"default",onClick:gt,children:st?"Go to chat":"Open chat"}),Fr.jsx(a,{variant:"secondary",onClick:ct,children:"Discard view"})]})]})})}function ISe({controls:ot}){let{hasStrokes:st}=bb(ot);return Fr.jsx(iE,{children:!st&&Fr.jsx($o,{className:"size-8 text-muted-foreground",stroke:0.75})})}function iE({children:ot}){return Fr.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:ot})}var ks=e(t(),1);function VJ(ot,{activeId:st,available:ct,now:gt}){let bt=[];if(st!==null&&ct.has(st))bt.push({id:st,releasedAt:null});for(let yt of ot){if(yt.id===st||!ct.has(yt.id))continue;let vt=yt.releasedAt??gt;if(gt-vt>=60000)continue;if(bt.length>=4)break;bt.push({id:yt.id,releasedAt:vt})}return bt}function GJ(ot,st){let ct=null;for(let{releasedAt:gt}of ot){if(gt===null)continue;let bt=gt+60000;if(ct===null||bt<ct)ct=bt}return ct===null?null:Math.max(0,ct-st)}function KJ(ot,st){return ot.length===st.length&&ot.every((ct,gt)=>{let bt=st[gt];return ct.id===bt.id&&ct.releasedAt===bt.releasedAt})}var ci=e(r(),1),QJ=ks.memo(function({views:st,activeViewId:ct,params:gt}){let bt=MSe(ct,st),yt=new Set(bt.map((vt)=>vt.id));return ci.jsx("div",{className:n("relative min-h-0 flex-1 overflow-hidden",!ct&&"hidden"),children:st.filter((vt)=>yt.has(vt.id)).map((vt)=>ci.jsx(ASe,{view:vt,active:vt.id===ct,params:gt},vt.id))})});function MSe(ot,st){let[ct,gt]=ks.useState([]),bt=k(st),yt=st.map((xt)=>xt.id).join(`
75
+ `),vt=ks.useCallback(()=>{gt((xt)=>{let wt=VJ(xt,{activeId:ot,available:new Set(bt.current.map((Ct)=>Ct.id)),now:Date.now()});return KJ(xt,wt)?xt:wt})},[ot,bt]);return ks.useEffect(()=>{vt()},[yt,vt]),ks.useEffect(()=>{let xt=GJ(ct,Date.now());if(xt===null)return;let wt=setTimeout(vt,xt);return()=>clearTimeout(wt)},[vt,ct]),ct}function ASe({view:ot,active:st,params:ct}){let gt=b(),bt=W8(ot.id),{current:yt,outgoing:vt}=DSe(bt,st),[xt,wt]=ks.useState(ct);if(st&&xt!==ct)wt(ct);AS(C1("views",gt,ot.id),yt?.version??bt.version,st);let Ct=bt.status==="error";return mS({kind:"view",enabled:st&&Boolean(yt)&&!Ct,targets:[{id:ot.id,revision:ot.revision}]}),ci.jsxs(ci.Fragment,{children:[st&&Ct&&ci.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:bt.error}),st&&!Ct&&!yt&&ci.jsx(_Se,{}),yt&&!Ct&&ci.jsxs(ks.Activity,{mode:st?"visible":"hidden",children:[vt&&ci.jsx(qJ,{view:ot,build:vt,params:xt},vt.version),ci.jsx(qJ,{view:ot,build:yt,params:xt,entering:vt!==null,current:!0},yt.version)]})]})}function qJ({view:ot,build:st,params:ct,entering:gt,current:bt=!1}){let yt=b(),vt=Uu("views",ot.id);return ci.jsx("div",{"data-applet-thumbnail":bt?vt:void 0,"data-applet":vt,className:n("absolute inset-0 isolate",gt&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:ci.jsx("div",{className:"size-full overflow-auto",children:ci.jsx(uy,{name:ot.id,kind:"view",workspaceId:yt,resetKey:st.version,children:ci.jsx(rh,{appletId:vt,active:bt,children:ci.jsx(st.Component,{params:ct})})})})})}var NSe=200;function DSe(ot,st){let[ct,gt]=ks.useState({current:null,outgoing:null});if(ot.status==="ready"&&ct.current?.version!==ot.version){let bt={Component:ot.Component,version:ot.version};gt((yt)=>({current:bt,outgoing:st?yt.current:null}))}return ks.useEffect(()=>{if(!ct.outgoing)return;let bt=setTimeout(()=>gt((yt)=>({...yt,outgoing:null})),NSe);return()=>clearTimeout(bt)},[ct.outgoing]),ct}function _Se(){return ci.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:ci.jsx($o,{className:"text-muted-foreground"})})}async function JJ(ot,st,ct,gt,bt,yt,vt="shared"){let xt=To(ct),wt=na(ot,st)?.pendingViews[ct]?.buildSessionId??gt;try{let Et=await p(`/api/workspaces/${st}/state`),kt=Et.pendingViews[ct];if(!yt&&kt?.status==="draft")wt=Yo(xt),ot.setQueryData(Tn.sessions(st),(Rt)=>Rt?.filter((Tt)=>Tt.sessionId!==gt)),ot.removeQueries({queryKey:Tn.events(st,gt)});else wt=kt?.buildSessionId??(yt?Et.pinnedSessionId:Et.selected[xt])??gt;if(dp(st,gt,wt),kt?.status==="draft"||kt?.status==="failed")Mr.getState().setActivity(st,wt,"idle");if(Uv(ot,st,Et),vt==="browser-tab"&&!yt){let Tt={...(ot.getQueryData(fl(st))??Wp(st)).selected};if(kt?.status==="draft")delete Tt[xt];else Tt[xt]=wt;ot.setQueryData(fl(st),{selected:Tt}),Yc(st,{selected:Tt})}}catch{dp(st,gt,wt),ot.invalidateQueries({queryKey:Tn.state(st)})}let Ct=oi(st,wt),St=Ar.getState();St.setComposerDraft(Ct,St.composerDrafts[Ct]??bt)}function XJ(){let ot=Kn(),ct=Si()?"browser-tab":"shared",{workspaceId:gt,layout:bt}=Sr(),{pinnedSessionId:yt}=fu(),vt=ua(gt).data,xt=Rq(gt),wt=Tq(gt),Ct=Pq(gt),St=Iq(gt);return{create:()=>xt.mutateAsync(),save:(Pt,Mt)=>wt.mutateAsync({viewId:Pt,requirements:Mt}),submit:async(Pt,Mt)=>{let It=Mt.trim(),At=yt??Yo(To(Pt.id)),Nt=yt??crypto.randomUUID(),Ot=eE(gt,At);if(!It&&Ot.length===0)return;if(!yt)tE({tabId:To(Pt.id),queryClient:ot,workspaceId:gt,sessionId:Nt,text:It,filenames:Ot.map((Vt)=>Vt.label)});if(!yt)dp(gt,At,Nt),IR(ot,gt,Nt,To(Pt.id),ct);let Dt=rE({queryClient:ot,workspaceId:gt,sessionId:Nt,text:It},Ot),_t=na(ot,gt)?.sessions[Nt]?.config,{model:$t,effort:Ft,speedMode:Bt,stream:Lt}=nE(vt,_t?.model??bt.selectedModel,_t?.effort??bt.selectedEffort,_t?.speedMode??bt.selectedSpeedMode);ra(ot,gt,(Vt)=>{let Wt=Vt.pendingViews[Pt.id];if(Wt?.status==="draft")Object.assign(Wt,{status:"starting",requirements:It,buildSessionId:Nt})});try{let Vt=await Ct.mutateAsync({viewId:Pt.id,sessionId:Nt,requirements:It,optimisticId:Dt.optimisticId,selectedSessionScope:ct,...Ot.length>0?{attachments:Dt.attachments}:{},model:$t,effort:Ft,speedMode:Bt,stream:Lt});if(dp(gt,Nt,Vt.sessionId),jv(ot,gt,Nt,Vt.sessionId),!yt)IR(ot,gt,Vt.sessionId,To(Pt.id),ct);oE(gt,Ot);let Wt=oi(gt,Vt.sessionId),Ut=Ar.getState();if(Ut.composerDrafts[Wt]?.trim()===It)Ut.setComposerDraft(Wt,null)}catch(Vt){throw await JJ(ot,gt,Pt.id,Nt,It,!!yt,ct),Vt}},discard:(Pt)=>St.mutateAsync(Pt)}}var fp=e(t(),1);function YJ({workspaceId:ot,pendingViews:st,onSave:ct}){let gt=fp.useRef(new Set),bt=fp.useRef(new Map),yt=k(st),vt=k(ct),xt=fp.useCallback((wt)=>{clearTimeout(bt.current.get(wt)),bt.current.delete(wt),Ar.getState().setComposerDraft(oi(ot,Yo(To(wt))),null)},[ot]);return fp.useEffect(()=>{for(let wt of st){let Ct=Yo(To(wt.id)),St=oi(ot,Ct);if(Ar.getState().moveComposerDraft(Ct,St),wt.status!=="draft")xt(wt.id);else if(!gt.current.has(St)){if(gt.current.add(St),Ar.getState().composerDrafts[St]===void 0)Ar.getState().setComposerDraft(St,wt.requirements)}}},[ot,st,xt]),fp.useEffect(()=>{let wt=bt.current,Ct=(Et)=>{if(yt.current.find((Tt)=>Tt.id===Et)?.status!=="draft")return;let kt=oi(ot,Yo(To(Et))),Rt=Ar.getState().composerDrafts[kt];if(Rt===void 0)return;vt.current(Et,Rt).catch(()=>{qr.add({title:"Couldn’t save view description",type:"error"})})},St=Ar.subscribe((Et,kt)=>{for(let Rt of yt.current){if(Rt.status!=="draft")continue;let Tt=oi(ot,Yo(To(Rt.id))),Pt=Et.composerDrafts[Tt];if(Pt===kt.composerDrafts[Tt])continue;if(clearTimeout(wt.get(Rt.id)),wt.delete(Rt.id),Pt===void 0)continue;wt.set(Rt.id,setTimeout(()=>{wt.delete(Rt.id),Ct(Rt.id)},500))}});return()=>{St();for(let[Et,kt]of wt)clearTimeout(kt),Ct(Et);wt.clear()}},[ot,yt,vt]),{clear:xt}}function ZJ(ot,st){if(st)return{status:"disconnected"};return ot??{status:"checking"}}var eX=e(r(),1);function Ey({className:ot,...st}){return eX.jsx("div",{...st,className:n("w-full p-2 text-sm @xl:p-1 @xl:pl-3",ot)})}var Hd=e(r(),1);function sE({error:ot,onDismiss:st,onRetry:ct}){return Hd.jsxs(Ey,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[Hd.jsx("span",{className:"flex-1 wrap-break-word",children:ot}),ct&&Hd.jsx(a,{type:"button",variant:"ghost",size:"sm",onClick:ct,children:"Retry"}),st&&Hd.jsx(a,{type:"button",variant:"ghost",size:"icon-sm",onClick:st,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:Hd.jsx(zo,{stroke:1.75})})]})}var Pi=e(r(),1);function tX({error:ot,pendingAction:st,onUpdate:ct,onDismiss:gt}){if(!ot&&st==="auto")return Pi.jsxs(Ey,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[Pi.jsx(No,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),Pi.jsx("span",{className:"wrap-break-word",children:"Updating Moi skills…"})]});let bt=st!==null;return Pi.jsxs(Ey,{role:ot?"alert":"status",className:n("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",ot&&"text-destructive"),children:[Pi.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[Pi.jsx(eL,{size:20,stroke:1.5,className:"shrink-0"}),ot?Pi.jsx("span",{className:"wrap-break-word",children:`Update failed: ${ot}`}):Pi.jsx("span",{className:"wrap-break-word",children:"This workspace is using old Moi skills"})]}),Pi.jsx(a,{type:"button",variant:"ghost",size:"icon-sm",onClick:gt,className:"col-start-2 row-start-1 -mt-1 -mr-1 text-muted-foreground hover:text-foreground @xl:order-4 @xl:m-0","aria-label":"Dismiss skill update",children:Pi.jsx(zo,{stroke:1.75})}),Pi.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[Pi.jsxs(a,{type:"button",variant:"default",size:"sm",onClick:()=>ct("auto"),disabled:bt,className:"@xl:order-2",children:[st==="auto"&&Pi.jsx(No,{stroke:1.75,className:"animate-spin"}),st==="auto"?"Updating…":"Auto-update"]}),Pi.jsxs(a,{type:"button",variant:"secondary",size:"sm",onClick:()=>ct("once"),disabled:bt,className:"@xl:order-3",children:[st==="once"&&Pi.jsx(No,{stroke:1.75,className:"animate-spin"}),st==="once"?"Updating…":"Update once"]})]})]})}var mp=e(t(),1);function wN(ot){return{workspaceId:ot,phase:"idle",pendingAction:null,error:null}}function OSe(ot){return ot.phase==="active"||ot.phase==="idle"&&ot.updateAvailable&&!ot.autoUpdateEnabled}function LSe(ot){return ot.updateAvailable&&ot.autoUpdateEnabled&&!ot.updatePending&&ot.phase==="idle"}function nX(ot){let st=V8(ot),{isPending:ct,mutate:gt,reset:bt}=G8(ot),yt=Zv(),{mutate:vt}=Wf(),xt=yt.data!==void 0,wt=yt.data?.autoUpdateSkills??!1,Ct=mp.useCallback(()=>vt({autoUpdateSkills:!0}),[vt]),[St,Et]=mp.useState(()=>wN(ot)),kt=St.workspaceId===ot?St:wN(ot);mp.useEffect(()=>{Et(wN(ot)),bt()},[ot,bt]);let Rt=mp.useCallback((Mt)=>{if(ct)return;if(Mt==="auto")Ct();Et({workspaceId:ot,phase:"active",pendingAction:Mt,error:null}),gt(void 0,{onSuccess:()=>{Et((It)=>It.workspaceId===ot?{...It,phase:"dismissed",pendingAction:null,error:null}:It)},onError:(It)=>{Et((At)=>At.workspaceId===ot&&At.phase!=="dismissed"?{...At,phase:"active",pendingAction:null,error:It.message}:At)}})},[Ct,ct,gt,ot]),Tt=st.data?.updateAvailable??!1;return mp.useEffect(()=>{if(xt&&LSe({updateAvailable:Tt,autoUpdateEnabled:wt,updatePending:ct,phase:kt.phase}))Rt("auto")},[wt,kt.phase,Rt,xt,Tt,ct]),{bannerProps:xt&&OSe({updateAvailable:Tt,autoUpdateEnabled:wt,phase:kt.phase})?{error:kt.error,pendingAction:kt.pendingAction,onUpdate:Rt,onDismiss:()=>{Et((Mt)=>Mt.workspaceId===ot?{...Mt,phase:"dismissed",pendingAction:null,error:null}:Mt)}}:null}}var ky=e(r(),1);function rX(ot,{chatError:st,onDismissChatError:ct,chatLoadError:gt,onRetryChatLoad:bt}){let yt=ua(ot),vt=yt.data,xt=nm(vt?.hasAuthOverrides||vt?.isFolderMissing?void 0:vt?.provider),wt=xt.isEnabled?xt:yt,Ct=wt.error??yt.error,St=yt.isError?yt.refetch:wt.refetch,Et=wt.data?.availability,{bannerProps:kt}=nX(ot),Rt=ZJ(Et,Boolean(Ct)),Tt=Ct?{tone:"error",content:ky.jsx(sE,{error:"Could not check agent availability",onRetry:()=>void St()})}:void 0,Pt;if(gt)Pt={tone:"error",content:ky.jsx(sE,{error:gt,onRetry:bt})};else if(st)Pt={tone:"error",content:ky.jsx(sE,{error:st,onDismiss:ct})};let Mt=kt?{tone:"default",content:ky.jsx(tX,{...kt})}:void 0;return{agentAvailability:Rt,composerBanner:Tt??Pt??Mt,viewDraftComposerBanner:Tt??Mt}}var oX=e(t(),1);var os=e(r(),1);function iX({onOpenTheme:ot}){let{layout:st,name:ct,provider:gt}=Sr(),[bt,yt]=oX.useState(!1);return os.jsx(TS,{children:os.jsxs(hs,{children:[os.jsxs(bs,{className:"flex min-w-0 cursor-pointer items-center gap-2 rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":`${ct??"Workspace"} menu`,onPointerEnter:()=>yt(!0),onPointerLeave:()=>yt(!1),children:[bt?os.jsx($0,{size:20,stroke:1.5,className:"shrink-0","aria-hidden":"true"}):os.jsx(yl,{icon:st.icon,workspaceType:gt,workspaceTheme:st.theme,className:"size-5 rounded-sm"}),ct&&os.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:ct})]}),os.jsx(ys,{align:"start",sideOffset:6,className:"w-36",children:os.jsxs(Na,{children:[os.jsxs(vs,{onClick:ot,children:[os.jsx(G0,{stroke:1.75}),"Theme"]}),os.jsxs(vs,{nativeButton:!0,render:os.jsx(mc,{}),className:"w-full",children:[os.jsx(Qc,{stroke:1.75}),"Settings"]})]})})]})})}var BSe=E1();function Pc(ot,st){if(ot==="overview"||ot==="scratchpad")return!0;let ct=yf(ot);return ct?st.some((gt)=>gt.id===ct):!1}function aE(ot,st){let ct=ot.open.filter((gt)=>Pc(gt,st));return ct.length>0?ct:BSe.open}function CN(ot,st,ct){if(ot!==void 0)return ot;let gt=aE(st,ct);return gt.includes(st.active)?st.active:gt[0]??"overview"}var ri=e(t(),1);var hg=e(t(),1);var sX=(ot)=>`moi:collab:${ot}:tabs`;function FSe(ot,st){try{let ct=sessionStorage.getItem(sX(ot));return ct?k1(JSON.parse(ct)):st}catch{return st}}function HSe(ot,st){try{sessionStorage.setItem(sX(ot),JSON.stringify(st))}catch{}}function aX(){let{workspaceId:ot,layout:st,setLayout:ct}=Sr(),gt=Si(),bt=hg.useMemo(()=>k1(st.tabs),[st.tabs]),[yt,vt]=hg.useState(()=>gt?FSe(ot,bt):bt),xt=hg.useCallback((wt)=>{let Ct=k1(wt);if(gt)vt(Ct),HSe(ot,Ct);else ct({tabs:Ct});return Ct},[gt,ct,ot]);return[gt?yt:bt,xt]}function cX(ot){let st=new URLSearchParams(ot);st.sort();let ct=st.toString();return ct?`?${ct}`:""}function SN(){return window.location.pathname+cX(window.location.search)}function lE(ot,st){return ot.get(st)??`moi:/${st}`}var lX=new Map;function uX({views:ot,onOpenChat:st}){let ct=Kn(),{workspaceId:gt}=Sr(),[bt,yt]=aX(),vt=ri.useRef({views:ot,tabsState:bt,onOpenChat:st});ri.useLayoutEffect(()=>{vt.current={views:ot,tabsState:bt,onOpenChat:st}},[ot,bt,st]);let xt=D3(),wt=ri.useRef(null),[,Ct]=Ai(),St=pi(),{base:Et}=St,kt=`${Et.replace(/\/$/,"")}/workspace/${encodeURIComponent(gt)}/`,Rt=xp(St).slice(kt.length),Tt=cX(Ly(St)),Pt=ri.useMemo(()=>{let Wt=new URLSearchParams(Tt);return Object.fromEntries(Array.from(Wt.keys(),(Ut)=>[Ut,Wt.get(Ut)]))},[Tt]),Mt=ri.useMemo(()=>{let Wt=lX.get(gt);if(!Wt)lX.set(gt,Wt=new Map);return Wt},[gt]),It=Up(Rt),At=Rt==="chat"||Rt==="chats"||Rt.startsWith("chats/"),Nt=CN(It,bt,ot),Ot=Boolean(Rt)&&!At&&(!It||!Pc(It,ot)),Dt=It!==void 0&&!Ot,_t=ri.useCallback((Wt)=>{vt.current={...vt.current,tabsState:yt(Wt)}},[vt,yt]),$t=ri.useCallback(()=>{let Wt=Up(window.location.pathname.slice(kt.length)),{tabsState:Ut,views:Ht}=vt.current,Gt=Wt??CN(void 0,Ut,Ht),jt=Wt?`moi:/${Gt}${window.location.search}`:lE(Mt,Gt);return{tab:Gt,href:jt}},[vt,kt,Mt]),Ft=ri.useCallback(async(Wt,{replace:Ut=!1}={},Ht=new AbortController)=>{let Gt=Fs(Wt,{workspaceId:gt,base:Et});if(wt.current?.controller.abort(),!Gt.startsWith(kt)){wt.current=null,Ht.signal.throwIfAborted(),window.location.assign(Gt);return}wt.current={controller:Ht,address:SN()};let jt=(qt)=>{if(Ht.signal.throwIfAborted(),wt.current=null,SN()!==qt||window.location.hash)Ct(`~${qt}`,{replace:Ut})};try{let qt=Gt.slice(kt.length).split("?",1)[0];if(qt==="chat"||qt.startsWith("chats/")){let{tab:Xt,href:zt}=$t(),tn=qt==="chat"?Xt:await xt(decodeURIComponent(qt.slice(6)),Xt,Ht.signal),rn=tn&&tn!==Xt?lE(Mt,tn):zt;if(jt(Fs(rn,{workspaceId:gt,base:Et})),tn)vt.current.onOpenChat();return}if(!ul(qt))throw Error("This destination is unavailable in this workspace");let Qt=BA(ct,gt)??vt.current.views;if(!Pc(qt,Qt))await Promise.all([Tn.views(gt),Tn.state(gt)].map((Xt)=>ct.refetchQueries({queryKey:Xt,exact:!0},{throwOnError:!0}))),Qt=BA(ct,gt)??vt.current.views;if(!Pc(qt,Qt))throw Error("This destination is unavailable in this workspace");jt(Gt)}finally{if(wt.current?.controller===Ht)wt.current=null}},[Et,$t,vt,kt,ct,Mt,xt,Ct,gt]);ri.useEffect(()=>{let Wt=wt.current;if(Wt&&Wt.address!==SN())Wt.controller.abort()},[Rt,Tt,gt]),ri.useEffect(()=>()=>wt.current?.controller.abort(),[]);let Bt=ri.useCallback((Wt)=>{if(Wt instanceof Error&&Wt.name==="AbortError")return;let Ut=Wt instanceof Error?Wt.message:"Navigation failed";qr.add({type:"error",title:"Could not navigate",description:Ut}),Ms(gt,{source:"runtime",message:Ut})},[gt]),Lt=ri.useCallback((Wt,Ut={})=>{Ft(lE(Mt,Wt),Ut).catch(Bt)},[Ft,Mt,Bt]);x1(gt,"navigate",(Wt)=>{Ft(Wt).catch(Bt)}),ht(gt,Ft),ri.useEffect(()=>{if(Rt&&!At)return;let Wt=lE(Mt,Nt);if(At)try{Wt=Fs(`moi:/${Rt}`)}catch{}let Ut=new AbortController;return Ft(Wt,{replace:!0},Ut).catch((Ht)=>{if(!Ut.signal.aborted)Bt(Ht)}),()=>Ut.abort()},[Nt,At,Ft,Rt,Mt,Bt,Tt]),ri.useEffect(()=>{if(!Dt)return;Mt.set(Nt,`moi:/${Nt}${Tt}`);let Wt=vt.current.tabsState,Ut=Wt.open.includes(Nt)?Wt.open:[...Wt.open,Nt];if(Ut!==Wt.open||Wt.active!==Nt)_t({open:Ut,active:Nt})},[Nt,Dt,vt,Mt,Tt,_t]);let Vt=ri.useCallback((Wt)=>{if(Wt.defaultPrevented||Wt.button!==0||Wt.metaKey||Wt.ctrlKey||Wt.altKey||Wt.shiftKey)return;let Ut=Wt.target instanceof Element?Wt.target.closest("a[href]"):null;if(!(Ut instanceof HTMLAnchorElement)||Ut.hasAttribute("download")||Ut.target&&Ut.target!=="_self")return;let Ht=new URL(Ut.href);if(Ht.origin!==window.location.origin||!Ht.pathname.startsWith(kt))return;if(Ht.hash)return;Wt.preventDefault(),Ft(`moi:/${Ht.pathname.slice(kt.length)}${Ht.search}`).catch(Bt)},[Ft,kt,Bt]);return{tabsState:bt,activeTab:Nt,appletParams:Pt,navigateToTab:Lt,setTabs:_t,isUnavailable:Ot,onNavigationClick:Vt}}var yo=e(r(),1),zSe=oe([X({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 $Se({items:ot}){return yo.jsxs(hs,{children:[yo.jsx(bs,{render:yo.jsx(a,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:yo.jsx(Ci,{stroke:1.75})})}),yo.jsx(ys,{align:"start",className:"min-w-48",children:yo.jsx(Na,{children:ot.map((st)=>yo.jsxs(vs,{onClick:st.onClick,className:"font-medium",children:[yo.jsx(st.Icon,{stroke:2}),st.label]},st.key))})})]})}function pX(ot){let{tab:st,active:ct}=ot,gt=ot.preview===!0;return yo.jsxs("button",{type:"button","aria-hidden":gt||void 0,"aria-label":st.needsAttention&&!st.loading?`${st.label}: needs attention`:st.label,disabled:gt,tabIndex:gt?-1:void 0,onClick:ot.preview?void 0:()=>ot.onSelect(st.key),className:zSe({active:ct,dragging:ot.preview?!1:ot.state.isDragging,preview:gt}),...ot.preview?{}:ot.state.dragHandleProps,children:[yo.jsxs("div",{className:n("flex items-center gap-1 overflow-hidden select-none",st.closable&&"group-hover/tab:mr-3"),children:[st.loading?yo.jsx($o,{"data-icon":"inline-start",className:"shrink-0"}):yo.jsxs("span",{className:"relative size-4 shrink-0",title:st.needsAttention?"Needs attention":void 0,children:[yo.jsx(st.Icon,{"data-icon":"inline-start",stroke:1.75,className:n("size-4",st.needsAttention&&"[mask-image:radial-gradient(circle_at_calc(100%_-_0.1875rem)_0.1875rem,transparent_0.3125rem,black_0.3125rem)]")}),st.needsAttention&&yo.jsx("span",{"aria-hidden":"true",className:"absolute top-0 right-0 size-1.5 rounded-full bg-primary"})]}),yo.jsx("span",{className:n("truncate",st.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:st.label})]}),st.closable&&yo.jsx("div",{"aria-label":`Close ${st.label}`,tabIndex:gt?-1:void 0,className:n("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",gt&&"pointer-events-none"),onClick:ot.preview?void 0:(bt)=>{bt.stopPropagation(),ot.onClose(st.key)},children:yo.jsx(zo,{stroke:1.75,className:"size-4 shrink-0"})})]})}function dX({tabs:ot,active:st,createItems:ct,onSelect:gt,onClose:bt,onReorder:yt}){return yo.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[yo.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:yo.jsx(Zw,{items:ot,getId:(vt)=>vt.key,isItemDragDisabled:(vt)=>vt.reorderable===!1,className:"flex w-max items-center gap-1",onReorder:(vt)=>yt(vt),renderPlaceholder:()=>yo.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(vt)=>yo.jsx(pX,{tab:vt,active:st===vt.key,preview:!0}),renderItem:(vt,xt)=>yo.jsx(pX,{tab:vt,active:st===vt.key,state:xt,onSelect:gt,onClose:bt})})}),yo.jsx("div",{className:"shrink-0",children:yo.jsx($Se,{items:ct})})]})}var bg=e(t(),1);function EN(ot){let st=document.documentElement,ct=getComputedStyle(st).getPropertyValue(ot).trim(),gt=Number.parseFloat(ct);if(!Number.isFinite(gt))return 0;return ct.endsWith("rem")?gt*Number.parseFloat(getComputedStyle(st).fontSize):gt}function fX(){let ot=bg.useRef(null),[st,ct]=bg.useState(null);return bg.useLayoutEffect(()=>{let gt=ot.current;if(!gt)return;let bt=(vt)=>{let xt=EN("--column-w"),wt=EN("--chat-min"),Ct=EN("--chat-max"),St={fits:vt-wt>=xt,workspaceMinWidth:xt,chatMinWidth:wt,chatMaxWidth:Ct};ct((Et)=>Et?.fits===St.fits&&Et.workspaceMinWidth===St.workspaceMinWidth&&Et.chatMinWidth===St.chatMinWidth&&Et.chatMaxWidth===St.chatMaxWidth?Et:St)};bt(gt.getBoundingClientRect().width);let yt=()=>bt(gt.getBoundingClientRect().width);return window.addEventListener("resize",yt),()=>window.removeEventListener("resize",yt)},[]),{ref:ot,fits:st?.fits??!1,constraints:st?{workspaceMinWidth:st.workspaceMinWidth,chatMinWidth:st.chatMinWidth,chatMaxWidth:st.chatMaxWidth}:null}}var yp=e(t(),1);var Cg=e(r(),1),Dr=e(t(),1);function WSe(ot,st){let ct=getComputedStyle(ot),gt=parseFloat(ct.fontSize);return st*gt}function USe(ot,st){let ct=getComputedStyle(ot.ownerDocument.documentElement),gt=parseFloat(ct.fontSize);return st*gt}function jSe(ot){return ot/100*window.innerHeight}function VSe(ot){return ot/100*window.innerWidth}function GSe(ot){switch(typeof ot){case"number":return[ot,"px"];case"string":{let st=parseFloat(ot);return ot.endsWith("%")?[st,"%"]:ot.endsWith("px")?[st,"px"]:ot.endsWith("rem")?[st,"rem"]:ot.endsWith("em")?[st,"em"]:ot.endsWith("vh")?[st,"vh"]:ot.endsWith("vw")?[st,"vw"]:[st,"%"]}}}function Ry({groupSize:ot,panelElement:st,styleProp:ct}){let gt,[bt,yt]=GSe(ct);switch(yt){case"%":{gt=bt/100*ot;break}case"px":{gt=bt;break}case"rem":{gt=USe(st,bt);break}case"em":{gt=WSe(st,bt);break}case"vh":{gt=jSe(bt);break}case"vw":{gt=VSe(bt);break}}return gt}function is(ot){return parseFloat(ot.toFixed(3))}function Sg({group:ot}){let{orientation:st,panels:ct}=ot;return ct.reduce((gt,bt)=>(gt+=st==="horizontal"?bt.element.offsetWidth:bt.element.offsetHeight,gt),0)}function RN(ot){let{panels:st}=ot,ct=Sg({group:ot});return ct===0?st.map((gt)=>({groupResizeBehavior:gt.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:gt.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:gt.panelConstraints.disabled,minSize:0,maxSize:100,panelId:gt.id})):st.map((gt)=>{let{element:bt,panelConstraints:yt}=gt,vt=0;if(yt.collapsedSize!==void 0){let St=Ry({groupSize:ct,panelElement:bt,styleProp:yt.collapsedSize});vt=is(St/ct*100)}let xt;if(yt.defaultSize!==void 0){let St=Ry({groupSize:ct,panelElement:bt,styleProp:yt.defaultSize});xt=is(St/ct*100)}let wt=0;if(yt.minSize!==void 0){let St=Ry({groupSize:ct,panelElement:bt,styleProp:yt.minSize});wt=is(St/ct*100)}let Ct=100;if(yt.maxSize!==void 0){let St=Ry({groupSize:ct,panelElement:bt,styleProp:yt.maxSize});Ct=is(St/ct*100)}return{groupResizeBehavior:yt.groupResizeBehavior,collapsedSize:vt,collapsible:yt.collapsible===!0,defaultSize:xt,disabled:yt.disabled,minSize:wt,maxSize:Ct,panelId:gt.id}})}function bo(ot,st="Assertion error"){if(!ot)throw Error(st)}function TN(ot,st){return Array.from(st).sort(ot==="horizontal"?KSe:qSe)}function KSe(ot,st){let ct=ot.element.offsetLeft-st.element.offsetLeft;return ct!==0?ct:ot.element.offsetWidth-st.element.offsetWidth}function qSe(ot,st){let ct=ot.element.offsetTop-st.element.offsetTop;return ct!==0?ct:ot.element.offsetHeight-st.element.offsetHeight}function AX(ot){return ot!==null&&typeof ot=="object"&&"nodeType"in ot&&ot.nodeType===Node.ELEMENT_NODE}function NX(ot,st){return{x:ot.x>=st.left&&ot.x<=st.right?0:Math.min(Math.abs(ot.x-st.left),Math.abs(ot.x-st.right)),y:ot.y>=st.top&&ot.y<=st.bottom?0:Math.min(Math.abs(ot.y-st.top),Math.abs(ot.y-st.bottom))}}function QSe({orientation:ot,rects:st,targetRect:ct}){let gt={x:ct.x+ct.width/2,y:ct.y+ct.height/2},bt,yt=Number.MAX_VALUE;for(let vt of st){let{x:xt,y:wt}=NX(gt,vt),Ct=ot==="horizontal"?xt:wt;Ct<yt&&(yt=Ct,bt=vt)}return bo(bt,"No rect found"),bt}var cE;function JSe(){return cE===void 0&&(typeof matchMedia=="function"?cE=!!matchMedia("(pointer:coarse)").matches:cE=!1),cE}function DX(ot){let{element:st,orientation:ct,panels:gt,separators:bt}=ot,yt=TN(ct,Array.from(st.children).filter(AX).map((Tt)=>({element:Tt}))).map(({element:Tt})=>Tt),vt=[],xt=!1,wt=!1,Ct=-1,St=-1,Et=0,kt,Rt=[];{let Tt=-1;for(let Pt of yt)Pt.hasAttribute("data-panel")&&(Tt++,Pt.hasAttribute("data-disabled")||(Et++,Ct===-1&&(Ct=Tt),St=Tt))}if(Et>1){let Tt=-1;for(let Pt of yt)if(Pt.hasAttribute("data-panel")){Tt++;let Mt=gt.find((It)=>It.element===Pt);if(Mt){if(kt){let It=kt.element.getBoundingClientRect(),At=Pt.getBoundingClientRect(),Nt;if(wt){let Ot=ct==="horizontal"?new DOMRect(It.right,It.top,0,It.height):new DOMRect(It.left,It.bottom,It.width,0),Dt=ct==="horizontal"?new DOMRect(At.left,At.top,0,At.height):new DOMRect(At.left,At.top,At.width,0);switch(Rt.length){case 0:{Nt=[Ot,Dt];break}case 1:{let _t=Rt[0],$t=QSe({orientation:ct,rects:[It,At],targetRect:_t.element.getBoundingClientRect()});Nt=[_t,$t===It?Dt:Ot];break}default:{Nt=Rt;break}}}else Rt.length?Nt=Rt:Nt=[ct==="horizontal"?new DOMRect(It.right,At.top,At.left-It.right,At.height):new DOMRect(At.left,It.bottom,At.width,At.top-It.bottom)];for(let Ot of Nt){let Dt="width"in Ot?Ot:Ot.element.getBoundingClientRect(),_t=JSe()?ot.resizeTargetMinimumSize.coarse:ot.resizeTargetMinimumSize.fine;if(Dt.width<_t){let Ft=_t-Dt.width;Dt=new DOMRect(Dt.x-Ft/2,Dt.y,Dt.width+Ft,Dt.height)}if(Dt.height<_t){let Ft=_t-Dt.height;Dt=new DOMRect(Dt.x,Dt.y-Ft/2,Dt.width,Dt.height+Ft)}let $t=Tt<=Ct||Tt>St;!xt&&!$t&&vt.push({group:ot,groupSize:Sg({group:ot}),panels:[kt,Mt],separator:"width"in Ot?void 0:Ot,rect:Dt}),xt=!1}}wt=!1,kt=Mt,Rt=[]}}else if(Pt.hasAttribute("data-separator")){Pt.ariaDisabled!==null&&(xt=!0);let Mt=bt.find((It)=>It.element===Pt);Mt?Rt.push(Mt):(kt=void 0,Rt=[])}else wt=!0}return vt}class PN{#t={};addListener(ot,st){let ct=this.#t[ot];return ct===void 0?this.#t[ot]=[st]:ct.includes(st)||ct.push(st),()=>{this.removeListener(ot,st)}}emit(ot,st){let ct=this.#t[ot];if(ct!==void 0)if(ct.length===1)ct[0].call(null,st);else{let gt=!1,bt=null,yt=Array.from(ct);for(let vt=0;vt<yt.length;vt++){let xt=yt[vt];try{xt.call(null,st)}catch(wt){bt===null&&(gt=!0,bt=wt)}}if(gt)throw bt}}removeAllListeners(){this.#t={}}removeListener(ot,st){let ct=this.#t[ot];if(ct!==void 0){let gt=ct.indexOf(st);gt>=0&&ct.splice(gt,1)}}}var xg={cursorFlags:0,state:"inactive"},IN=new PN;function $d(){return xg}function XSe(ot){return IN.addListener("change",ot)}function YSe(ot){let st=xg,ct={...xg};ct.cursorFlags=ot,xg=ct,IN.emit("change",{prev:st,next:ct})}function wg(ot){let st=xg;xg=ot,IN.emit("change",{prev:st,next:ot})}var ZSe=(ot)=>ot,kN=()=>{},_X=1,OX=2,LX=4,BX=8,mX=3,gX=12,uE;function hX(){return uE===void 0&&(uE=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(uE=!0)),uE}function eEe({cursorFlags:ot,groups:st,state:ct}){let gt=0,bt=0;switch(ct){case"active":case"hover":st.forEach((yt)=>{if(!yt.mutableState.disableCursor)switch(yt.orientation){case"horizontal":{gt++;break}case"vertical":{bt++;break}}})}if(!(gt===0&&bt===0)){switch(ct){case"active":{if(ot&&hX()){let yt=(ot&_X)!==0,vt=(ot&OX)!==0,xt=(ot&LX)!==0,wt=(ot&BX)!==0;if(yt)return xt?"se-resize":wt?"ne-resize":"e-resize";if(vt)return xt?"sw-resize":wt?"nw-resize":"w-resize";if(xt)return"s-resize";if(wt)return"n-resize"}break}}return hX()?gt>0&&bt>0?"move":gt>0?"ew-resize":"ns-resize":gt>0&&bt>0?"grab":gt>0?"col-resize":"row-resize"}}var bX=new WeakMap;function MN(ot){if(!ot.defaultView||!ot.adoptedStyleSheets)return;let{prevStyle:st,styleSheet:ct}=bX.get(ot)??{};ct===void 0&&(ct=new ot.defaultView.CSSStyleSheet,ot.adoptedStyleSheets&&(Object.isExtensible(ot.adoptedStyleSheets)?ot.adoptedStyleSheets.push(ct):ot.adoptedStyleSheets=[...ot.adoptedStyleSheets,ct]));let gt=$d();switch(gt.state){case"active":case"hover":{let bt=eEe({cursorFlags:gt.cursorFlags,groups:gt.hitRegions.map((vt)=>vt.group),state:gt.state}),yt=`*, *:hover {cursor: ${bt} !important; }`;if(st===yt)return;st=yt,bt?ct.cssRules.length===0?ct.insertRule(yt):ct.replaceSync(yt):ct.cssRules.length===1&&ct.deleteRule(0);break}case"inactive":{st=void 0,ct.cssRules.length===1&&ct.deleteRule(0);break}}bX.set(ot,{prevStyle:st,styleSheet:ct})}var Wl=new Map,FX=new PN;function tEe(ot){Wl=new Map(Wl),Wl.delete(ot)}function yX(ot,st){for(let[ct]of Wl)if(ct.id===ot)return ct}function gp(ot,st){for(let[ct,gt]of Wl)if(ct.id===ot)return gt;if(st)throw Error(`Could not find data for Group with id ${ot}`)}function hp(){return Wl}function AN(ot,st){return FX.addListener("groupChange",(ct)=>{ct.group.id===ot&&st(ct)})}function Ic(ot,st,ct){let gt=Wl.get(ot);Wl=new Map(Wl),Wl.set(ot,st),FX.emit("groupChange",{group:ot,isUserInteraction:ct?.isUserInteraction===!0,prev:gt,next:st})}function HX(ot){let st=$d(),ct=hp(),gt=!1;switch(st.state){case"active":wg({cursorFlags:0,state:"inactive"}),st.hitRegions.length>0&&(MN(ot),gt=!0,st.hitRegions.forEach((bt)=>{if(!ct.has(bt.group))return;let yt=gp(bt.group.id,!0);Ic(bt.group,yt,{isUserInteraction:!0})}))}return gt}function vX(ot){ot.defaultPrevented||HX(ot.currentTarget)}function nEe(ot,st,ct){let gt,bt={x:1/0,y:1/0};for(let yt of st){let vt=NX(ct,yt.rect);switch(ot){case"horizontal":{vt.x<=bt.x&&(gt=yt,bt=vt);break}case"vertical":{vt.y<=bt.y&&(gt=yt,bt=vt);break}}}return gt?{distance:bt,hitRegion:gt}:void 0}function rEe(ot){return ot!==null&&typeof ot=="object"&&"nodeType"in ot&&ot.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function oEe(ot,st){if(ot===st)throw Error("Cannot compare node with itself");let ct={a:CX(ot),b:CX(st)},gt;for(;ct.a.at(-1)===ct.b.at(-1);)gt=ct.a.pop(),ct.b.pop();bo(gt,"Stacking order can only be calculated for elements with a common ancestor");let bt={a:wX(xX(ct.a)),b:wX(xX(ct.b))};if(bt.a===bt.b){let yt=gt.childNodes,vt={a:ct.a.at(-1),b:ct.b.at(-1)},xt=yt.length;for(;xt--;){let wt=yt[xt];if(wt===vt.a)return 1;if(wt===vt.b)return-1}}return Math.sign(bt.a-bt.b)}var iEe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function sEe(ot){let st=getComputedStyle(zX(ot)??ot).display;return st==="flex"||st==="inline-flex"}function aEe(ot){let st=getComputedStyle(ot);return!!(st.position==="fixed"||st.zIndex!=="auto"&&(st.position!=="static"||sEe(ot))||+st.opacity<1||("transform"in st)&&st.transform!=="none"||("webkitTransform"in st)&&st.webkitTransform!=="none"||("mixBlendMode"in st)&&st.mixBlendMode!=="normal"||("filter"in st)&&st.filter!=="none"||("webkitFilter"in st)&&st.webkitFilter!=="none"||("isolation"in st)&&st.isolation==="isolate"||iEe.test(st.willChange)||st.webkitOverflowScrolling==="touch")}function xX(ot){let st=ot.length;for(;st--;){let ct=ot[st];if(bo(ct,"Missing node"),aEe(ct))return ct}return null}function wX(ot){return ot&&Number(getComputedStyle(ot).zIndex)||0}function CX(ot){let st=[];for(;ot;)st.push(ot),ot=zX(ot);return st}function zX(ot){let{parentNode:st}=ot;return rEe(st)?st.host:st}function lEe(ot,st){return ot.x<st.x+st.width&&ot.x+ot.width>st.x&&ot.y<st.y+st.height&&ot.y+ot.height>st.y}function cEe({groupElement:ot,hitRegion:st,pointerEventTarget:ct}){if(!AX(ct)||ct.contains(ot)||ot.contains(ct))return!0;if(oEe(ct,ot)>0){let gt=ct;for(;gt;){if(gt.contains(ot))return!0;if(lEe(gt.getBoundingClientRect(),st))return!1;gt=gt.parentElement}}return!0}function NN(ot,st){let ct=[];return st.forEach((gt,bt)=>{if(bt.disabled)return;let yt=DX(bt),vt=nEe(bt.orientation,yt,{x:ot.clientX,y:ot.clientY});vt&&vt.distance.x<=0&&vt.distance.y<=0&&cEe({groupElement:bt.element,hitRegion:vt.hitRegion.rect,pointerEventTarget:ot.target})&&ct.push(vt.hitRegion)}),ct}function uEe(ot,st){if(ot.length!==st.length)return!1;for(let ct=0;ct<ot.length;ct++)if(ot[ct]!=st[ct])return!1;return!0}function Vi(ot,st,ct=0){return Math.abs(is(ot)-is(st))<=ct}function $l(ot,st){return Vi(ot,st)?0:ot>st?1:-1}function vg({overrideDisabledPanels:ot,panelConstraints:st,prevSize:ct,size:gt}){let{collapsedSize:bt=0,collapsible:yt,disabled:vt,maxSize:xt=100,minSize:wt=0}=st;if(vt&&!ot)return ct;if($l(gt,wt)<0)if(yt){let Ct=(bt+wt)/2;$l(gt,Ct)<0?gt=bt:gt=wt}else gt=wt;return gt=Math.min(xt,gt),gt=is(gt),gt}function Py({delta:ot,initialLayout:st,panelConstraints:ct,pivotIndices:gt,prevLayout:bt,trigger:yt}){if(Vi(ot,0))return st;let vt=yt==="imperative-api",xt=Object.values(st),wt=Object.values(bt),Ct=[...xt],[St,Et]=gt;bo(St!=null,"Invalid first pivot index"),bo(Et!=null,"Invalid second pivot index");let kt=0;switch(yt){case"keyboard":{{let Pt=ot<0?Et:St,Mt=ct[Pt];bo(Mt,`Panel constraints not found for index ${Pt}`);let{collapsedSize:It=0,collapsible:At,minSize:Nt=0}=Mt;if(At){let Ot=xt[Pt];if(bo(Ot!=null,`Previous layout not found for panel index ${Pt}`),Vi(Ot,It)){let Dt=Nt-Ot;$l(Dt,Math.abs(ot))>0&&(ot=ot<0?0-Dt:Dt)}}}{let Pt=ot<0?St:Et,Mt=ct[Pt];bo(Mt,`No panel constraints found for index ${Pt}`);let{collapsedSize:It=0,collapsible:At,minSize:Nt=0}=Mt;if(At){let Ot=xt[Pt];if(bo(Ot!=null,`Previous layout not found for panel index ${Pt}`),Vi(Ot,Nt)){let Dt=Ot-It;$l(Dt,Math.abs(ot))>0&&(ot=ot<0?0-Dt:Dt)}}}break}default:{let Pt=ot<0?Et:St,Mt=ct[Pt];bo(Mt,`Panel constraints not found for index ${Pt}`);let It=xt[Pt],{collapsible:At,collapsedSize:Nt,minSize:Ot}=Mt;if(At&&$l(It,Ot)<0)if(ot>0){let Dt=Ot-Nt,_t=Dt/2,$t=It+ot;$l($t,Ot)<0&&(ot=$l(ot,_t)<=0?0:Dt)}else{let Dt=Ot-Nt,_t=100-Dt/2,$t=It-ot;$l($t,Ot)<0&&(ot=$l(100+ot,_t)>0?0:-Dt)}break}}{let Pt=ot<0?1:-1,Mt=ot<0?Et:St,It=0;for(;;){let Nt=xt[Mt];bo(Nt!=null,`Previous layout not found for panel index ${Mt}`);let Ot=vg({overrideDisabledPanels:vt,panelConstraints:ct[Mt],prevSize:Nt,size:100})-Nt;if(It+=Ot,Mt+=Pt,Mt<0||Mt>=ct.length)break}let At=Math.min(Math.abs(ot),Math.abs(It));ot=ot<0?0-At:At}{let Pt=ot<0?St:Et;for(;Pt>=0&&Pt<ct.length;){let Mt=Math.abs(ot)-Math.abs(kt),It=xt[Pt];bo(It!=null,`Previous layout not found for panel index ${Pt}`);let At=It-Mt,Nt=vg({overrideDisabledPanels:vt,panelConstraints:ct[Pt],prevSize:It,size:At});if(!Vi(It,Nt)&&(kt+=It-Nt,Ct[Pt]=Nt,kt.toFixed(3).localeCompare(Math.abs(ot).toFixed(3),void 0,{numeric:!0})>=0))break;ot<0?Pt--:Pt++}}if(uEe(wt,Ct))return bt;{let Pt=ot<0?Et:St,Mt=xt[Pt];bo(Mt!=null,`Previous layout not found for panel index ${Pt}`);let It=Mt+kt,At=vg({overrideDisabledPanels:vt,panelConstraints:ct[Pt],prevSize:Mt,size:It});if(Ct[Pt]=At,!Vi(At,It)){let Nt=It-At,Ot=ot<0?Et:St;for(;Ot>=0&&Ot<ct.length;){let Dt=Ct[Ot];bo(Dt!=null,`Previous layout not found for panel index ${Ot}`);let _t=Dt+Nt,$t=vg({overrideDisabledPanels:vt,panelConstraints:ct[Ot],prevSize:Dt,size:_t});if(Vi(Dt,$t)||(Nt-=$t-Dt,Ct[Ot]=$t),Vi(Nt,0))break;ot>0?Ot--:Ot++}}}let Rt=Object.values(Ct).reduce((Pt,Mt)=>Mt+Pt,0);if(!Vi(Rt,100,0.1))return bt;let Tt=Object.keys(bt);return Ct.reduce((Pt,Mt,It)=>(Pt[Tt[It]]=Mt,Pt),{})}function Wd(ot,st){if(Object.keys(ot).length!==Object.keys(st).length)return!1;for(let ct in ot)if(st[ct]===void 0||$l(ot[ct],st[ct])!==0)return!1;return!0}function Ud({layout:ot,panelConstraints:st}){let ct=Object.values(ot),gt=[...ct],bt=gt.reduce((xt,wt)=>xt+wt,0);if(gt.length!==st.length)throw Error(`Invalid ${st.length} panel layout: ${gt.map((xt)=>`${xt}%`).join(", ")}`);if(!Vi(bt,100)&&gt.length>0)for(let xt=0;xt<st.length;xt++){let wt=gt[xt];bo(wt!=null,`No layout data found for index ${xt}`);let Ct=100/bt*wt;gt[xt]=Ct}let yt=0;for(let xt=0;xt<st.length;xt++){let wt=ct[xt];bo(wt!=null,`No layout data found for index ${xt}`);let Ct=gt[xt];bo(Ct!=null,`No layout data found for index ${xt}`);let St=vg({overrideDisabledPanels:!0,panelConstraints:st[xt],prevSize:wt,size:Ct});Ct!=St&&(yt+=Ct-St,gt[xt]=St)}if(!Vi(yt,0))for(let xt=0;xt<st.length;xt++){let wt=gt[xt];bo(wt!=null,`No layout data found for index ${xt}`);let Ct=wt+yt,St=vg({overrideDisabledPanels:!0,panelConstraints:st[xt],prevSize:wt,size:Ct});if(wt!==St&&(yt-=St-wt,gt[xt]=St,Vi(yt,0)))break}let vt=Object.keys(ot);return gt.reduce((xt,wt,Ct)=>(xt[vt[Ct]]=wt,xt),{})}function $X({groupId:ot,panelId:st}){let ct=()=>{let wt=hp();for(let[Ct,{defaultLayoutDeferred:St,derivedPanelConstraints:Et,layout:kt,groupSize:Rt,separatorToPanels:Tt}]of wt)if(Ct.id===ot)return{defaultLayoutDeferred:St,derivedPanelConstraints:Et,group:Ct,groupSize:Rt,layout:kt,separatorToPanels:Tt};throw Error(`Group ${ot} not found`)},gt=()=>{let wt=ct().derivedPanelConstraints.find((Ct)=>Ct.panelId===st);if(wt!==void 0)return wt;throw Error(`Panel constraints not found for Panel ${st}`)},bt=()=>{let wt=ct().group.panels.find((Ct)=>Ct.id===st);if(wt!==void 0)return wt;throw Error(`Layout not found for Panel ${st}`)},yt=()=>{let wt=ct().layout[st];if(wt!==void 0)return wt;throw Error(`Layout not found for Panel ${st}`)},vt=({nextSize:wt,panels:Ct,prevLayout:St,derivedPanelConstraints:Et})=>{let kt=yt(),Rt=Ct.findIndex((Mt)=>Mt.id===st),Tt=Rt===0,Pt=Rt===Ct.length-1;if(Pt&&wt<kt&&(Tt||Ct.slice(0,Rt).every((Mt,It)=>{let At=Et[It];return At?.collapsible&&Vi(At.collapsedSize,St[At.panelId])}))){let Mt=Ct.slice(0,Rt).reduce((It,At)=>It+St[At.id],0);return{...St,[st]:is(100-Mt)}}return Py({delta:Pt?kt-wt:wt-kt,initialLayout:St,panelConstraints:Et,pivotIndices:Pt?[Rt-1,Rt]:[Rt,Rt+1],prevLayout:St,trigger:"imperative-api"})},xt=(wt)=>{let Ct=yt();if(wt===Ct)return;let{defaultLayoutDeferred:St,derivedPanelConstraints:Et,group:kt,groupSize:Rt,layout:Tt,separatorToPanels:Pt}=ct(),Mt=vt({nextSize:wt,panels:kt.panels,prevLayout:Tt,derivedPanelConstraints:Et}),It=Ud({layout:Mt,panelConstraints:Et});Wd(Tt,It)||Ic(kt,{defaultLayoutDeferred:St,derivedPanelConstraints:Et,groupSize:Rt,layout:It,separatorToPanels:Pt})};return{collapse:()=>{let{collapsible:wt,collapsedSize:Ct}=gt(),{mutableValues:St}=bt(),Et=yt();wt&&Et!==Ct&&(St.expandToSize=Et,xt(Ct))},expand:()=>{let{collapsible:wt,collapsedSize:Ct,minSize:St}=gt(),{mutableValues:Et}=bt(),kt=yt();if(wt&&kt===Ct){let Rt=Et.expandToSize??St;Rt===0&&(Rt=1),xt(Rt)}},getSize:()=>{let{group:wt}=ct(),Ct=yt(),{element:St}=bt(),Et=wt.orientation==="horizontal"?St.offsetWidth:St.offsetHeight;return{asPercentage:Ct,inPixels:Et}},isCollapsed:()=>{let{collapsible:wt,collapsedSize:Ct}=gt(),St=yt();return wt&&Vi(Ct,St)},resize:(wt)=>{let{group:Ct}=ct(),{element:St}=bt(),Et=Sg({group:Ct}),kt=Ry({groupSize:Et,panelElement:St,styleProp:wt}),Rt=is(kt/Et*100);xt(Rt)}}}function SX(ot){if(ot.defaultPrevented)return;let st=hp();NN(ot,st).forEach((ct)=>{if(ct.separator&&!ct.separator.disableDoubleClick){let gt=ct.panels.find((bt)=>bt.panelConstraints.defaultSize!==void 0);if(gt){let bt=gt.panelConstraints.defaultSize,yt=$X({groupId:ct.group.id,panelId:gt.id});yt&&bt!==void 0&&(yt.resize(bt),ot.preventDefault())}}})}function pE(ot){let st=hp();for(let[ct]of st)if(ct.separators.some((gt)=>gt.element===ot))return ct;throw Error("Could not find parent Group for separator element")}function WX({groupId:ot}){let st=()=>{let ct=hp();for(let[gt,bt]of ct)if(gt.id===ot)return{group:gt,...bt};throw Error(`Could not find Group with id "${ot}"`)};return{getLayout(){let{defaultLayoutDeferred:ct,layout:gt}=st();return ct?{}:gt},setLayout(ct){let{defaultLayoutDeferred:gt,derivedPanelConstraints:bt,group:yt,groupSize:vt,layout:xt,separatorToPanels:wt}=st(),Ct=Ud({layout:ct,panelConstraints:bt});return gt?xt:(Wd(xt,Ct)||Ic(yt,{defaultLayoutDeferred:gt,derivedPanelConstraints:bt,groupSize:vt,layout:Ct,separatorToPanels:wt}),Ct)}}}function zd(ot,st){let ct=pE(ot),gt=gp(ct.id,!0),bt=ct.separators.find((St)=>St.element===ot);bo(bt,"Matching separator not found");let yt=gt.separatorToPanels.get(bt);bo(yt,"Matching panels not found");let vt=yt.map((St)=>ct.panels.indexOf(St)),xt=WX({groupId:ct.id}).getLayout(),wt=Py({delta:st,initialLayout:xt,panelConstraints:gt.derivedPanelConstraints,pivotIndices:vt,prevLayout:xt,trigger:"keyboard"}),Ct=Ud({layout:wt,panelConstraints:gt.derivedPanelConstraints});Wd(xt,Ct)||Ic(ct,{defaultLayoutDeferred:gt.defaultLayoutDeferred,derivedPanelConstraints:gt.derivedPanelConstraints,groupSize:gt.groupSize,layout:Ct,separatorToPanels:gt.separatorToPanels},{isUserInteraction:!0})}function EX(ot){if(ot.defaultPrevented)return;let st=ot.currentTarget,ct=pE(st);if(!ct.disabled)switch(ot.key){case"ArrowDown":{ot.preventDefault(),ct.orientation==="vertical"&&zd(st,5);break}case"ArrowLeft":{ot.preventDefault(),ct.orientation==="horizontal"&&zd(st,-5);break}case"ArrowRight":{ot.preventDefault(),ct.orientation==="horizontal"&&zd(st,5);break}case"ArrowUp":{ot.preventDefault(),ct.orientation==="vertical"&&zd(st,-5);break}case"End":{ot.preventDefault(),zd(st,100);break}case"Enter":{ot.preventDefault();let gt=pE(st),bt=gp(gt.id,!0),{derivedPanelConstraints:yt,layout:vt,separatorToPanels:xt}=bt,wt=gt.separators.find((kt)=>kt.element===st);bo(wt,"Matching separator not found");let Ct=xt.get(wt);bo(Ct,"Matching panels not found");let St=Ct[0],Et=yt.find((kt)=>kt.panelId===St.id);if(bo(Et,"Panel metadata not found"),Et.collapsible){let kt=vt[St.id],Rt=Et.collapsedSize===kt?gt.mutableState.expandedPanelSizes[St.id]??Et.minSize:Et.collapsedSize;zd(st,Rt-kt)}break}case"F6":{ot.preventDefault();let gt=pE(st).separators.map((vt)=>vt.element),bt=Array.from(gt).findIndex((vt)=>vt===ot.currentTarget);bo(bt!==null,"Index not found");let yt=ot.shiftKey?bt>0?bt-1:gt.length-1:bt+1<gt.length?bt+1:0;gt[yt].focus({preventScroll:!0});break}case"Home":{ot.preventDefault(),zd(st,-100);break}}}function kX(ot){if(ot.defaultPrevented)return;if(ot.pointerType==="mouse"&&ot.button>0)return;let st=hp(),ct=NN(ot,st),gt=new Map,bt=!1;ct.forEach((yt)=>{yt.separator&&(bt||(bt=!0,yt.separator.element.focus({focusVisible:!1,preventScroll:!0})));let vt=st.get(yt.group);vt&&gt.set(yt.group,vt.layout)}),wg({cursorFlags:0,hitRegions:ct,initialLayoutMap:gt,pointerDownAtPoint:{x:ot.clientX,y:ot.clientY},state:"active"}),ct.length&&ot.preventDefault()}function UX({document:ot,event:st,hitRegions:ct,initialLayoutMap:gt,mountedGroups:bt,pointerDownAtPoint:yt,prevCursorFlags:vt}){let xt=0;ct.forEach((Ct)=>{let{group:St,groupSize:Et}=Ct,{orientation:kt,panels:Rt}=St,{disableCursor:Tt}=St.mutableState,Pt=0;yt?kt==="horizontal"?Pt=(st.clientX-yt.x)/Et*100:Pt=(st.clientY-yt.y)/Et*100:kt==="horizontal"?Pt=st.clientX<0?-100:100:Pt=st.clientY<0?-100:100;let Mt=gt.get(St),It=bt.get(St);if(!Mt||!It)return;let{defaultLayoutDeferred:At,derivedPanelConstraints:Nt,groupSize:Ot,layout:Dt,separatorToPanels:_t}=It;if(Nt&&Dt&&_t){let $t=Py({delta:Pt,initialLayout:Mt,panelConstraints:Nt,pivotIndices:Ct.panels.map((Ft)=>Rt.indexOf(Ft)),prevLayout:Dt,trigger:"mouse-or-touch"});if(Wd($t,Dt)){if(Pt!==0&&!Tt)switch(kt){case"horizontal":{xt|=Pt<0?_X:OX;break}case"vertical":{xt|=Pt<0?LX:BX;break}}}else Ic(Ct.group,{defaultLayoutDeferred:At,derivedPanelConstraints:Nt,groupSize:Ot,layout:$t,separatorToPanels:_t})}});let wt=0;st.movementX===0?wt|=vt&mX:wt|=xt&mX,st.movementY===0?wt|=vt&gX:wt|=xt&gX,YSe(wt),MN(ot)}function RX(ot){let st=hp(),ct=$d();switch(ct.state){case"active":UX({document:ot.currentTarget,event:ot,hitRegions:ct.hitRegions,initialLayoutMap:ct.initialLayoutMap,mountedGroups:st,prevCursorFlags:ct.cursorFlags})}}function TX(ot){if(ot.defaultPrevented)return;let st=$d(),ct=hp();switch(st.state){case"active":{if(ot.buttons===0){wg({cursorFlags:0,state:"inactive"}),st.hitRegions.forEach((gt)=>{if(!ct.has(gt.group))return;let bt=gp(gt.group.id,!0);Ic(gt.group,bt,{isUserInteraction:!0})});return}for(let gt of st.hitRegions)if(gt.separator){let{element:bt}=gt.separator;bt.isConnected&&!bt.hasPointerCapture?.(ot.pointerId)&&bt.setPointerCapture?.(ot.pointerId)}UX({document:ot.currentTarget,event:ot,hitRegions:st.hitRegions,initialLayoutMap:st.initialLayoutMap,mountedGroups:ct,pointerDownAtPoint:st.pointerDownAtPoint,prevCursorFlags:st.cursorFlags});break}default:{let gt=NN(ot,ct);gt.length===0?st.state!=="inactive"&&wg({cursorFlags:0,state:"inactive"}):wg({cursorFlags:0,hitRegions:gt,state:"hover"}),MN(ot.currentTarget);break}}}function PX(ot){if(ot.relatedTarget instanceof HTMLIFrameElement)switch($d().state){case"hover":wg({cursorFlags:0,state:"inactive"})}}function IX(ot){if(ot.defaultPrevented)return;if(ot.pointerType==="mouse"&&ot.button>0)return;HX(ot.currentTarget)&&ot.preventDefault()}function MX(ot){let st=0,ct=0,gt={};for(let yt of ot)if(yt.defaultSize!==void 0){st++;let vt=is(yt.defaultSize);ct+=vt,gt[yt.panelId]=vt}else gt[yt.panelId]=void 0;let bt=ot.length-st;if(bt!==0){let yt=is((100-ct)/bt);for(let vt of ot)vt.defaultSize===void 0&&(gt[vt.panelId]=yt)}return gt}function pEe(ot,st,ct){if(!ct[0])return;let gt=ot.panels.find((wt)=>wt.element===st);if(!gt||!gt.onResize)return;let bt=Sg({group:ot}),yt=ot.orientation==="horizontal"?gt.element.offsetWidth:gt.element.offsetHeight,vt=gt.mutableValues.prevSize,xt={asPercentage:is(yt/bt*100),inPixels:yt};gt.mutableValues.prevSize=xt,gt.onResize(xt,gt.id,vt)}function dEe(ot,st){if(Object.keys(ot).length!==Object.keys(st).length)return!1;for(let ct in ot)if(ot[ct]!==st[ct])return!1;return!0}function fEe(ot,st){return ot.length!==st.length?!1:ot.every((ct,gt)=>dEe(ct,st[gt]))}function mEe({group:ot,nextGroupSize:st,prevGroupSize:ct,prevLayout:gt}){if(ct<=0||st<=0||ct===st)return gt;let bt=0,yt=0,vt=!1,xt=new Map,wt=[];for(let Et of ot.panels){let kt=gt[Et.id]??0;switch(Et.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{vt=!0;let Rt=kt/100*ct,Tt=is(Rt/st*100);xt.set(Et.id,Tt),bt+=Tt;break}case"preserve-relative-size":default:{wt.push(Et.id),yt+=kt;break}}}if(!vt||wt.length===0)return gt;let Ct=100-bt,St={...gt};if(xt.forEach((Et,kt)=>{St[kt]=Et}),yt>0)for(let Et of wt){let kt=gt[Et]??0;St[Et]=is(kt/yt*Ct)}else{let Et=is(Ct/wt.length);for(let kt of wt)St[kt]=Et}return St}function gEe(ot,st){let ct=ot.map((bt)=>bt.id),gt=Object.keys(st);if(ct.length!==gt.length)return!1;for(let bt of ct)if(!gt.includes(bt))return!1;return!0}var yg=new Map;function hEe(ot){let st=!0;bo(ot.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let ct=ot.element.ownerDocument.defaultView.ResizeObserver,gt=new Set,bt=new Set,yt=new ct((Tt)=>{for(let Pt of Tt){let{borderBoxSize:Mt,target:It}=Pt;if(It===ot.element){if(st){let At=Sg({group:ot});if(At===0)return;let Nt=gp(ot.id);if(!Nt)return;let Ot=RN(ot),Dt=Nt.defaultLayoutDeferred?MX(Ot):Nt.layout,_t=mEe({group:ot,nextGroupSize:At,prevGroupSize:Nt.groupSize,prevLayout:Dt}),$t=Ud({layout:_t,panelConstraints:Ot});if(!Nt.defaultLayoutDeferred&&Wd(Nt.layout,$t)&&fEe(Nt.derivedPanelConstraints,Ot)&&Nt.groupSize===At)continue;Ic(ot,{defaultLayoutDeferred:!1,derivedPanelConstraints:Ot,groupSize:At,layout:$t,separatorToPanels:Nt.separatorToPanels})}}else pEe(ot,It,Mt)}});yt.observe(ot.element),ot.panels.forEach((Tt)=>{bo(!gt.has(Tt.id),`Panel ids must be unique; id "${Tt.id}" was used more than once`),gt.add(Tt.id),Tt.onResize&&yt.observe(Tt.element)});let vt=Sg({group:ot}),xt=RN(ot),wt=ot.panels.map(({id:Tt})=>Tt).join(","),Ct=ot.mutableState.defaultLayout;Ct&&(gEe(ot.panels,Ct)||(Ct=void 0));let St=ot.mutableState.layouts[wt]??Ct??MX(xt),Et=Ud({layout:St,panelConstraints:xt}),kt=ot.element.ownerDocument;yg.set(kt,(yg.get(kt)??0)+1);let Rt=new Map;return DX(ot).forEach((Tt)=>{Tt.separator&&Rt.set(Tt.separator,Tt.panels)}),Ic(ot,{defaultLayoutDeferred:vt===0,derivedPanelConstraints:xt,groupSize:vt,layout:Et,separatorToPanels:Rt}),ot.separators.forEach((Tt)=>{bo(!bt.has(Tt.id),`Separator ids must be unique; id "${Tt.id}" was used more than once`),bt.add(Tt.id),Tt.element.addEventListener("keydown",EX)}),yg.get(kt)===1&&(kt.addEventListener("contextmenu",vX,!0),kt.addEventListener("dblclick",SX,!0),kt.addEventListener("pointerdown",kX,!0),kt.addEventListener("pointerleave",RX),kt.addEventListener("pointermove",TX),kt.addEventListener("pointerout",PX),kt.addEventListener("pointerup",IX,!0)),function(){st=!1,yg.set(kt,Math.max(0,(yg.get(kt)??0)-1)),tEe(ot),ot.separators.forEach((Tt)=>{Tt.element.removeEventListener("keydown",EX)}),yg.get(kt)||(kt.removeEventListener("contextmenu",vX,!0),kt.removeEventListener("dblclick",SX,!0),kt.removeEventListener("pointerdown",kX,!0),kt.removeEventListener("pointerleave",RX),kt.removeEventListener("pointermove",TX),kt.removeEventListener("pointerout",PX),kt.removeEventListener("pointerup",IX,!0)),yt.disconnect()}}function bEe(){let[ot,st]=Dr.useState({}),ct=Dr.useCallback(()=>st({}),[]);return[ot,ct]}function DN(ot){let st=Dr.useId();return`${ot??st}`}var jd=typeof window<"u"?Dr.useLayoutEffect:Dr.useEffect;function Ty(ot){let st=Dr.useRef(ot);return jd(()=>{st.current=ot},[ot]),Dr.useCallback((...ct)=>st.current?.(...ct),[st])}function _N(...ot){return Ty((st)=>{ot.forEach((ct)=>{if(ct)switch(typeof ct){case"function":{ct(st);break}case"object":{ct.current=st;break}}})})}function ON(ot){let st=Dr.useRef({...ot});return jd(()=>{for(let ct in ot)st.current[ct]=ot[ct]},[ot]),st.current}var jX=Dr.createContext(null);function yEe(ot,st){let ct=Dr.useRef({getLayout:()=>({}),setLayout:ZSe});Dr.useImperativeHandle(st,()=>ct.current,[]),jd(()=>{Object.assign(ct.current,WX({groupId:ot}))})}function LN({children:ot,className:st,defaultLayout:ct,disableCursor:gt,disabled:bt,elementRef:yt,groupRef:vt,id:xt,onLayoutChange:wt,onLayoutChanged:Ct,orientation:St="horizontal",resizeTargetMinimumSize:Et={coarse:20,fine:10},style:kt,...Rt}){let Tt=Dr.useRef({onLayoutChange:{},onLayoutChanged:{}}),Pt=Ty((Vt)=>{Wd(Tt.current.onLayoutChange,Vt)||(Tt.current.onLayoutChange=Vt,wt?.(Vt))}),Mt=Ty((Vt,Wt)=>{Wd(Tt.current.onLayoutChanged,Vt)||(Tt.current.onLayoutChanged=Vt,Ct?.(Vt,{isUserInteraction:Wt}))}),It=DN(xt),At=Dr.useRef(null),[Nt,Ot]=bEe(),Dt=Dr.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:Et,separators:[]}),_t=_N(At,yt);yEe(It,vt);let $t=Ty((Vt,Wt)=>{let Ut=$d(),Ht=yX(Vt),Gt=gp(Vt);if(Gt){let jt=!1;switch(Ut.state){case"active":{jt=Ut.hitRegions.some((qt)=>qt.group===Ht);break}}return{flexGrow:Gt.layout[Wt]??1,pointerEvents:jt?"none":void 0}}if(ct?.[Wt])return{flexGrow:ct?.[Wt]}}),Ft=ON({defaultLayout:ct,disableCursor:gt}),Bt=Dr.useMemo(()=>({get disableCursor(){return!!Ft.disableCursor},getPanelStyles:$t,id:It,orientation:St,registerPanel:(Vt)=>{let Wt=Dt.current;return Wt.panels=TN(St,[...Wt.panels,Vt]),Ot(),()=>{Wt.panels=Wt.panels.filter((Ut)=>Ut!==Vt),Ot()}},registerSeparator:(Vt)=>{let Wt=Dt.current;return Wt.separators=TN(St,[...Wt.separators,Vt]),Ot(),()=>{Wt.separators=Wt.separators.filter((Ut)=>Ut!==Vt),Ot()}},updatePanelProps:(Vt,{disabled:Wt})=>{let Ut=Dt.current.panels.find((jt)=>jt.id===Vt);Ut&&(Ut.panelConstraints.disabled=Wt);let Ht=yX(It),Gt=gp(It);Ht&&Gt&&Ic(Ht,{...Gt,derivedPanelConstraints:RN(Ht)})},updateSeparatorProps:(Vt,{disabled:Wt,disableDoubleClick:Ut})=>{let Ht=Dt.current.separators.find((Gt)=>Gt.id===Vt);Ht&&(Ht.disabled=Wt,Ht.disableDoubleClick=Ut)}}),[$t,It,Ot,St,Ft]),Lt=Dr.useRef(null);return jd(()=>{let Vt=At.current;if(Vt===null)return;let Wt=Dt.current,Ut;if(Ft.defaultLayout!==void 0&&Object.keys(Ft.defaultLayout).length===Wt.panels.length){Ut={};for(let zt of Wt.panels){let tn=Ft.defaultLayout[zt.id];tn!==void 0&&(Ut[zt.id]=tn)}}let Ht={disabled:!!bt,element:Vt,id:It,mutableState:{defaultLayout:Ut,disableCursor:!!Ft.disableCursor,expandedPanelSizes:Dt.current.lastExpandedPanelSizes,layouts:Dt.current.layouts},orientation:St,panels:Wt.panels,resizeTargetMinimumSize:Wt.resizeTargetMinimumSize,separators:Wt.separators};Lt.current=Ht;let Gt=hEe(Ht),{defaultLayoutDeferred:jt,derivedPanelConstraints:qt,layout:Qt}=gp(Ht.id,!0);!jt&&qt.length>0&&(Pt(Qt),Mt(Qt,!1));let Xt=AN(It,(zt)=>{let{defaultLayoutDeferred:tn,derivedPanelConstraints:rn,layout:Kt}=zt.next;if(tn||rn.length===0)return;let an=Ht.panels.map(({id:Zt})=>Zt).join(",");Ht.mutableState.layouts[an]=Kt,rn.forEach((Zt)=>{if(Zt.collapsible){let{layout:on}=zt.prev??{};if(on){let sn=Vi(Zt.collapsedSize,Kt[Zt.panelId]),dn=Vi(Zt.collapsedSize,on[Zt.panelId]);sn&&!dn&&(Ht.mutableState.expandedPanelSizes[Zt.panelId]=on[Zt.panelId])}}});let ln=$d().state!=="active";Pt(Kt),ln&&Mt(Kt,zt.isUserInteraction)});return()=>{Lt.current=null,Gt(),Xt()}},[bt,It,Mt,Pt,St,Nt,Ft]),Dr.useEffect(()=>{let Vt=Lt.current;Vt&&(Vt.mutableState.defaultLayout=ct,Vt.mutableState.disableCursor=!!gt)}),Cg.jsx(jX.Provider,{value:Bt,children:Cg.jsx("div",{...Rt,className:st,"data-group":!0,"data-testid":It,id:It,ref:_t,style:{height:"100%",width:"100%",overflow:"hidden",...kt,display:"flex",flexDirection:St==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:St==="horizontal"?"pan-y":"pan-x"},children:ot})})}LN.displayName="Group";function BN(){let ot=Dr.useContext(jX);return bo(ot,"Group Context not found; did you render a Panel or Separator outside of a Group?"),ot}function vEe(ot,st){let{id:ct}=BN(),gt=Dr.useRef({collapse:kN,expand:kN,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:kN});Dr.useImperativeHandle(st,()=>gt.current,[]),jd(()=>{Object.assign(gt.current,$X({groupId:ct,panelId:ot}))})}function FN({children:ot,className:st,collapsedSize:ct="0%",collapsible:gt=!1,defaultSize:bt,disabled:yt,elementRef:vt,groupResizeBehavior:xt="preserve-relative-size",id:wt,maxSize:Ct="100%",minSize:St="0%",onResize:Et,panelRef:kt,style:Rt,...Tt}){let Pt=!!wt,Mt=DN(wt),It=ON({disabled:yt}),At=Dr.useRef(null),Nt=_N(At,vt),{getPanelStyles:Ot,id:Dt,orientation:_t,registerPanel:$t,updatePanelProps:Ft}=BN(),Bt=Et!==null,Lt=Ty((Ht,Gt,jt)=>{Et?.(Ht,wt,jt)});jd(()=>{let Ht=At.current;if(Ht!==null){let Gt={element:Ht,id:Mt,idIsStable:Pt,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:Bt?Lt:void 0,panelConstraints:{groupResizeBehavior:xt,collapsedSize:ct,collapsible:gt,defaultSize:bt,disabled:It.disabled,maxSize:Ct,minSize:St}};return $t(Gt)}},[xt,ct,gt,bt,Bt,Mt,Pt,Ct,St,Lt,$t,It]),Dr.useEffect(()=>{Ft(Mt,{disabled:yt})},[yt,Mt,Ft]),vEe(Mt,kt);let Vt=()=>{let Ht=Ot(Dt,Mt);if(Ht)return JSON.stringify(Ht)},Wt=Dr.useSyncExternalStore((Ht)=>AN(Dt,Ht),Vt,Vt),Ut;return Wt?Ut=JSON.parse(Wt):bt!==void 0?Ut={flexGrow:void 0,flexShrink:void 0,flexBasis:bt}:Ut={flexGrow:1},Cg.jsx("div",{...Tt,"data-disabled":yt||void 0,"data-panel":!0,"data-testid":Mt,id:Mt,ref:Nt,style:{...xEe,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...Ut},children:Cg.jsx("div",{className:st,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...Rt,touchAction:_t==="horizontal"?"pan-y":"pan-x"},children:ot})})}FN.displayName="Panel";var xEe={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function wEe({layout:ot,panelConstraints:st,panelId:ct,panelIndex:gt}){let bt,yt,vt=ot[ct],xt=st.find((wt)=>wt.panelId===ct);if(xt){let wt=xt.maxSize,Ct=xt.collapsible?xt.collapsedSize:xt.minSize,St=[gt,gt+1];yt=Ud({layout:Py({delta:Ct-vt,initialLayout:ot,panelConstraints:st,pivotIndices:St,prevLayout:ot}),panelConstraints:st})[ct],bt=Ud({layout:Py({delta:wt-vt,initialLayout:ot,panelConstraints:st,pivotIndices:St,prevLayout:ot}),panelConstraints:st})[ct]}return{valueControls:ct,valueMax:bt,valueMin:yt,valueNow:vt}}function HN({children:ot,className:st,disabled:ct,disableDoubleClick:gt,elementRef:bt,id:yt,style:vt,...xt}){let wt=DN(yt),Ct=ON({disabled:ct,disableDoubleClick:gt}),[St,Et]=Dr.useState({}),[kt,Rt]=Dr.useState("inactive"),[Tt,Pt]=Dr.useState(!1),Mt=Dr.useRef(null),It=_N(Mt,bt),{disableCursor:At,id:Nt,orientation:Ot,registerSeparator:Dt,updateSeparatorProps:_t}=BN(),$t=Ot==="horizontal"?"vertical":"horizontal";jd(()=>{let Lt=Mt.current;if(Lt!==null){let Vt={disabled:Ct.disabled,disableDoubleClick:Ct.disableDoubleClick,element:Lt,id:wt},Wt=Dt(Vt),Ut=XSe((Gt)=>{Rt(Gt.next.state!=="inactive"&&Gt.next.hitRegions.some((jt)=>jt.separator===Vt)?Gt.next.state:"inactive")}),Ht=AN(Nt,(Gt)=>{let{derivedPanelConstraints:jt,layout:qt,separatorToPanels:Qt}=Gt.next,Xt=Qt.get(Vt);if(Xt){let zt=Xt[0],tn=jt.findIndex((rn)=>rn.panelId===zt.id);Et(wEe({layout:qt,panelConstraints:jt,panelId:zt.id,panelIndex:tn}))}});return()=>{Ut(),Ht(),Wt()}}},[Nt,wt,Dt,Ct]),Dr.useEffect(()=>{_t(wt,{disabled:ct,disableDoubleClick:gt})},[ct,gt,wt,_t]);let Ft;ct&&!At&&(Ft="not-allowed");let Bt;if(ct)Bt="disabled";else switch(kt){case"active":{Bt="active";break}default:Tt?Bt="focus":Bt=kt}return Cg.jsx("div",{...xt,"aria-controls":St.valueControls,"aria-disabled":ct||void 0,"aria-orientation":$t,"aria-valuemax":St.valueMax,"aria-valuemin":St.valueMin,"aria-valuenow":St.valueNow,children:ot,className:st,"data-separator":Bt,"data-testid":wt,id:wt,onBlur:()=>Pt(!1),onFocus:()=>Pt(!0),ref:It,role:"separator",style:{flexBasis:"auto",cursor:Ft,...vt,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:ct?void 0:0})}HN.displayName="Separator";var dE=e(r(),1);function VX({className:ot,...st}){return dE.jsx(LN,{"data-slot":"resizable-panel-group",className:u("flex h-full w-full aria-[orientation=vertical]:flex-col",ot),...st})}function zN({...ot}){return dE.jsx(FN,{"data-slot":"resizable-panel",...ot})}function GX({showDivider:ot=!0,className:st,...ct}){return dE.jsx(HN,{"data-slot":"resizable-handle",className:u("relative flex items-center justify-center ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2",ot?"w-px bg-border aria-[orientation=horizontal]:h-px":"w-0 aria-[orientation=horizontal]:h-0",st),...ct})}var bp=e(r(),1);function KX({workspace:ot,chat:st,open:ct,workspaceMinWidth:gt,chatMinWidth:bt,chatMaxWidth:yt,chatWidth:vt,onCollapse:xt,onChatWidthChange:wt}){let Ct=yp.useRef(null),St=yp.useRef(null),[Et,kt]=yp.useState(!1),Rt=Math.min(Math.max(vt,bt),yt),[Tt]=yp.useState(()=>ct?Rt:0);return yp.useLayoutEffect(()=>{let Pt=Ct.current;if(!Pt)return;if(ct)Pt.resize(Rt);else Pt.collapse()},[Rt,ct]),bp.jsxs(VX,{orientation:"horizontal",className:n("overflow-visible!",Et&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",Et&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(Pt,Mt)=>{if(!Et&&St.current===null)St.current=requestAnimationFrame(()=>{kt(!0)});if(Mt.isUserInteraction)requestAnimationFrame(()=>{let It=Ct.current;if(!It)return;let At=It.getSize();if(At.inPixels>0)wt(Math.round(At.inPixels))})},children:[bp.jsx(zN,{id:"workspace",className:"overflow-visible!",minSize:gt,children:bp.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:ot})}),bp.jsx(GX,{"aria-label":"Resize chat",showDivider:!1,hidden:!ct,disabled:!ct}),bp.jsx(zN,{id:"chat","aria-hidden":!ct,inert:!ct,collapsible:!0,collapsedSize:0,defaultSize:Tt,minSize:bt,maxSize:yt,groupResizeBehavior:"preserve-pixel-size",panelRef:Ct,onResize:(Pt,Mt,It)=>{if(ct&&Pt.inPixels===0&&It&&It.inPixels>0)xt()},className:n("overflow-hidden!",Et&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",ct?"opacity-100":"opacity-0"),children:bp.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:st})})]})}var Eg=e(r(),1);function qX(ot=!1){let{layout:st,setLayout:ct}=Sr(),{ref:gt,fits:bt,constraints:yt}=fX(),vt=Ar((St)=>St.dockedChatWidth),xt=Ar((St)=>St.setDockedChatWidth),wt=!ot&&bt&&st.layoutMode==="split"?"split":"fullscreen";return{ref:gt,canUseSplit:bt,constraints:yt,mode:wt,setMode:(St)=>ct({layoutMode:St}),chatWidth:vt,setChatWidth:xt}}function QX({frame:ot,workspace:st,chat:ct,children:gt,onClick:bt}){let{ref:yt,canUseSplit:vt,constraints:xt,mode:wt,setMode:Ct,chatWidth:St,setChatWidth:Et}=ot;return Eg.jsxs("div",{onClick:bt,className:"relative flex h-full min-h-0 flex-1 flex-col font-sans text-foreground",children:[Eg.jsx("div",{ref:yt,className:"flex min-h-0 flex-1",children:vt&&xt?Eg.jsx(KX,{...xt,workspace:st,chat:ct,open:wt==="split",chatWidth:St,onCollapse:()=>Ct("fullscreen"),onChatWidthChange:Et}):st}),gt]})}function fE({mode:ot,children:st}){return Eg.jsx("div",{"data-slot":"workspace-pane",className:n("@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius,background-color] duration-100 ease-out motion-reduce:transition-none",ot==="split"&&"rounded-xl"),children:st})}var Vd=e(r(),1);function JX({onOpenOverview:ot}){return Vd.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[Vd.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[Vd.jsx(U0,{size:56,stroke:0.5,"aria-hidden":!0}),Vd.jsx("p",{className:"text-sm",children:"There's no such page in this workspace"})]}),Vd.jsx(a,{variant:"secondary",onClick:ot,children:"Back to overview"})]})}var lo=e(r(),1),SEe=Ii.lazy(()=>(Y("00s35r33"),import("/chunk-00s35r33.js")).then((ot)=>({default:ot.Scratchpad})));function XX(ot,st,ct,gt){if(ot==="overview")return{key:ot,Icon:V0,label:"Overview",closable:!1,reorderable:!1};if(ot==="scratchpad")return{key:ot,Icon:ae,label:"Scratchpad",closable:ct};let bt=yf(ot),yt=bt?st.find((vt)=>vt.id===bt):null;return yt?{key:ot,Icon:ly(yt),label:ay(yt),closable:ct||yt.status!=="compiled",loading:yt.status!=="compiled"&&!!yt.buildSessionId&&gt(yt.buildSessionId),needsAttention:yt.status==="failed"||yt.status==="submitted"&&(!yt.buildSessionId||!gt(yt.buildSessionId))}:null}function YX({widgets:ot,views:st}){let{layout:ct,workspaceId:gt}=Sr(),bt=_s(ct.theme),yt=XJ(),vt=qX(),{mode:xt,canUseSplit:wt,setMode:Ct}=vt,[St,Et]=Ii.useState("idle"),[kt,Rt]=Ii.useState(!1),[Tt,Pt]=Ii.useState(0),Mt=Ii.useRef(new Map),It=gi((Sn)=>Sn.activity),At=st.filter((Sn)=>Sn.status==="compiled"),Nt=st.filter((Sn)=>Sn.status!=="compiled"),Ot=cv(It,gt),Dt=YJ({workspaceId:gt,pendingViews:Nt,onSave:(Sn,Fn)=>yt.save(Sn,Fn)}),_t=ot.some((Sn)=>!Il(Sn.id)),$t=_t||At.length>0,Ft=Ii.useCallback(()=>{Rt(!0),Pt((Sn)=>Sn+1)},[]),{tabsState:Bt,activeTab:Lt,appletParams:Vt,navigateToTab:Wt,setTabs:Ut,isUnavailable:Ht,onNavigationClick:Gt}=uX({views:st,onOpenChat:Ft}),{view:jt,forkedFromSessionId:qt,chatLoaded:Qt,previewTurn:Xt,sessionId:zt,composerSessionId:tn,processing:rn,error:Kt,loadError:an,retryLoad:ln,send:Zt,stop:on,selectSession:sn,dismissError:dn}=$J({activeTab:Lt,appletParams:Vt}),{pinnedSessionId:fn}=fu(),{composerBanner:bn,viewDraftComposerBanner:hn,agentAvailability:gn}=rX(gt,{chatError:Kt,onDismissChatError:dn,chatLoadError:an,onRetryChatLoad:ln}),xn=aE(Bt,st),wn=new Set(Bt.open),yn=xn.length>1,nn=xn.map((Sn)=>XX(Sn,st,yn,(Fn)=>bf(It,gt,Fn))).filter((Sn)=>Boolean(Sn)),en=yf(Lt),pn=en?At.find((Sn)=>Sn.id===en):void 0,cn=en?Nt.find((Sn)=>Sn.id===en):void 0,mn=!fn&&zt===null&&cn?.status==="draft"&&(!cn.buildSessionId||!bf(It,gt,cn.buildSessionId))?cn:void 0,Pn=mn?.id,Rn=!fn&&cn?.status==="starting",Cn=Qt&&!Rn,kn=St==="idle"&&(Lt==="overview"&&_t||pn!==void 0),{controls:Jt,docked:Yt,layerProps:un,popup:vn,targetRef:_n}=pz({workspaceId:gt,sessionId:tn,activeTab:Lt,mode:xt,available:kn,closePopup:()=>Rt(!1),openPopup:()=>Rt(!0)});Ii.useEffect(()=>{if(Bt.open.filter((ur)=>Pc(ur,st)).length===Bt.open.length)return;let Fn=aE(Bt,st);Ut({open:Fn,active:Fn.includes(Bt.active)?Bt.active:Fn[0]})},[st,Ut,Bt]),Ii.useEffect(()=>{if(xt!=="fullscreen")Rt(!1)},[xt]),Ii.useEffect(()=>{if(!Pn)return;if(xt==="fullscreen")Rt(!0);Pt((Sn)=>Sn+1)},[Pn,xt]);let zn=Wt,$n=()=>{yt.create().then((Sn)=>zn(To(Sn.id)))},Mn=(Sn)=>{if(Sn==="views"){let Fn=At[0];if(Fn)zn(To(Fn.id));else $n()}else zn(Sn);Rt(!1)};E((Sn)=>{if(Sn.type==="view:deleted"&&Sn.workspaceId===gt&&Lt===To(Sn.name))zn("overview")});let Gn=async(Sn)=>{let Fn=Mt.current.get(Sn.id);try{await yt.discard(Sn.id)}catch(ur){return qr.add({title:ur instanceof Error?ur.message:"Couldn’t discard view",type:"error"}),!1}return await Fn?.resetSketch(),Dt.clear(Sn.id),!0},sr=(Sn)=>{if(Sn==="overview")return;let Fn=yf(Sn),ur=Fn?Nt.find((wr)=>wr.id===Fn):void 0;if(!yn&&!ur||!wn.has(Sn))return;let Pr=Bt.open.filter((wr)=>wr!==Sn);if(Pr.length===0)Pr=["overview"];let Wn=xn.indexOf(Sn),Zn=xn[Wn+1]??xn[Wn-1]??Pr.find((wr)=>Pc(wr,st))??"overview",vr=Bt.active===Sn||!Pr.includes(Bt.active)?Zn:Bt.active;if(Ut({open:Pr,active:vr}),Lt===Sn)Wt(Zn);if(ur?.status==="draft")Gn(ur)},gr=async(Sn)=>{if(!await Gn(Sn))return;let Fn=To(Sn.id);if(!wn.has(Fn))return;let ur=Bt.open.filter((Zn)=>Zn!==Fn);if(ur.length===0)ur=["overview"];let Pr=ur.find((Zn)=>Pc(Zn,st))??"overview",Wn=Bt.active===Fn?Pr:Bt.active;if(Ut({open:ur,active:Wn}),Lt===Fn)Wt(Pr,{replace:!0})},qn=(Sn)=>{Ut({open:Sn,active:Bt.active})},Bn=(Sn)=>{if(Sn!==void 0)Ar.getState().setComposerDraft(oi(gt,tn),Sn);if(xt==="fullscreen"){if(Rt(!0),kt)Pt((Fn)=>Fn+1);return}Pt((Fn)=>Fn+1)};DJ({sessionId:zt,send:Zt,revealChat:Bn,agentAvailability:gn}),_J(tn,Bn);let Tr=[...!wn.has("scratchpad")?[{key:"scratchpad",Icon:ae,label:"Scratchpad",onClick:()=>zn("scratchpad")}]:[],...st.map((Sn)=>({view:Sn,tab:To(Sn.id)})).filter(({tab:Sn})=>!wn.has(Sn)).map(({view:Sn,tab:Fn})=>({key:Fn,Icon:ly(Sn),label:ay(Sn),onClick:()=>zn(Fn)})),{key:"create-view",Icon:H0,label:"New view",onClick:$n}],lr=Ii.useCallback(()=>{if(mn)Mt.current.get(mn.id)?.resetSketch()},[mn]),no=async(Sn,Fn)=>{if(cn?.status==="draft")await Mt.current.get(cn.id)?.prepareSketchForSend(),await yt.submit(cn,Sn),Dt.clear(cn.id);else await Zt(Sn,Fn)},An=mn?{sessionId:Yo(To(mn.id)),onRemoveDrawing:lr}:void 0,Vn={agent:bt.agent,focusRequest:Tt,chatLoaded:Cn,hasWorkspaceApplets:$t,view:jt,forkedFromSessionId:qt,previewTurn:Xt,sessionId:zt,processing:rn,composerBanner:mn?hn:bn,agentAvailability:gn,send:no,stop:on,onNavigateFromWelcome:Mn,viewDraft:An},Jn=lo.jsx(pA,{...Vn,active:xt==="split",onClose:()=>Ct("fullscreen"),annotation:Yt,docked:!0}),Yn=lo.jsxs(fE,{mode:xt,children:[lo.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[lo.jsxs("div",{ref:_n,inert:Jt.active||void 0,"aria-hidden":Jt.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background transition-colors duration-100 ease-out motion-reduce:transition-none",children:[Ht?lo.jsx(JX,{onOpenOverview:()=>zn("overview")}):Lt==="overview"?lo.jsx(EJ,{customizing:St==="customizing",theming:St==="theming",onThemingChange:(Sn)=>Et(Sn?"theming":"idle"),onCustomizingChange:(Sn)=>Et(Sn?"customizing":"idle"),widgets:ot,views:st,onOpenView:(Sn)=>zn(To(Sn)),onCreateView:$n,onCreateWidget:()=>{sn(null),Bn("Create widget")}}):Lt==="scratchpad"?lo.jsx(Ii.Suspense,{fallback:null,children:lo.jsx(SEe,{})}):null,Nt.map((Sn)=>lo.jsx(jJ,{ref:(Fn)=>{if(Fn)Mt.current.set(Sn.id,Fn);else Mt.current.delete(Sn.id)},active:!Ht&&cn?.id===Sn.id,pendingView:Sn,running:!!Sn.buildSessionId&&bf(It,gt,Sn.buildSessionId),sketchSessionId:Sn.status==="draft"?fn??Yo(To(Sn.id)):void 0,chatDocked:xt==="split",chatOpen:xt==="split"||kt,workspaceId:gt,onEditingStart:()=>{if(xt==="fullscreen")Rt(!1)},onContinueInChat:Bn,onOpenChat:()=>Bn(),onDiscard:()=>gr(Sn)},Sn.id)),lo.jsx(QJ,{views:At,activeViewId:Ht?null:pn?.id??null,params:Vt})]}),lo.jsx(R1,{...un,children:lo.jsx(I1,{controls:Jt,title:"Draw annotation",busy:Jt.finishing,onComplete:()=>void Jt.finish()})})]}),lo.jsx(Qi,{children:St==="theming"&&lo.jsx(VK,{onClose:()=>Et("idle")})}),lo.jsxs(kJ,{children:[lo.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[lo.jsx(iX,{onOpenTheme:()=>Et("theming")}),lo.jsx(dX,{tabs:nn,active:Lt,createItems:Tr,onSelect:zn,onClose:sr,onReorder:qn})]}),lo.jsx(yR,{workspaceId:gt,describeTab:(Sn)=>XX(Sn,st,!1,()=>!1),onOpenTab:zn}),wt&&xt==="fullscreen"&&lo.jsxs(Wr,{children:[lo.jsx(Ur,{render:lo.jsx(a,{variant:"ghost",size:"icon-sm",onClick:()=>Ct("split"),"aria-label":"Dock chat",className:"text-muted-foreground",children:lo.jsx(pL,{stroke:1.75})})}),lo.jsx(jr,{children:"Dock chat"})]})]})]});return lo.jsx(QX,{frame:vt,workspace:Yn,chat:Jn,onClick:Gt,children:xt==="fullscreen"&&lo.jsx(jK,{agent:bt.agent,loading:Ot,open:kt,onOpenChange:Rt,onOpenChangeComplete:(Sn)=>{if(Sn)Pt((Fn)=>Fn+1)},children:(Sn)=>lo.jsx(pA,{...Vn,active:kt,onClose:Sn,annotation:vn})})})}var iY=e(t(),1);var Gd=e(r(),1);function ZX({type:ot,reason:st,checking:ct,onRecheck:gt,onConnected:bt=gt}){return Gd.jsx(Ux,{type:ot,onConnected:bt,connectedContent:Gd.jsx(EEe,{name:aa[ot],reason:st,checking:ct,onRecheck:gt})})}function EEe({name:ot,reason:st,checking:ct,onRecheck:gt}){let bt=`Logged in to ${ot}, but this workspace still needs attention. ${st}`;if(ct)bt="Checking workspace access…";return Gd.jsxs("div",{role:"status",className:"mt-6 flex flex-col items-center gap-4",children:[Gd.jsx("p",{className:"text-sm text-muted-foreground",children:bt}),Gd.jsx(a,{variant:"secondary",disabled:ct,onClick:gt,children:"Try again"})]})}var Lo=e(r(),1);function eY(ot){return Lo.jsx(oY,{title:"Could not check your agent",...ot,children:"Could not check this workspace’s agent. Try again."})}function tY({workspaceId:ot}){let[,st]=Ai(),ct=Jx();return Lo.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[Lo.jsx(tL,{size:56,stroke:0.5,className:"text-muted-foreground","aria-hidden":!0}),Lo.jsx("h1",{className:"font-medium",children:"The workspace folder is missing"}),Lo.jsx(a,{variant:"secondary",disabled:ct.isPending,onClick:()=>ct.mutate(ot,{onSuccess:()=>st("/")}),children:ct.isPending?"Deleting workspace…":"Delete workspace"}),ct.error&&Lo.jsx("p",{role:"alert",className:"text-sm text-destructive",children:ct.error.message})]})}function nY({type:ot,availability:st,...ct}){let gt=st.status==="login-required";return Lo.jsxs(oY,{title:gt?"Connect your agent":"Your agent is unavailable",type:ot,...ct,children:[st.reason,gt&&Lo.jsxs(Lo.Fragment,{children:[Lo.jsx("br",{}),Lo.jsx("br",{}),"Complete sign-in in your agent’s terminal, then try again."]})]})}function rY(){return Lo.jsx("div",{className:"flex flex-1 items-center justify-center",children:Lo.jsx($o,{className:"size-6 text-muted-foreground",stroke:1.5})})}function oY({title:ot,type:st,children:ct,retrying:gt,onRetry:bt}){return Lo.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:Lo.jsxs("div",{className:"flex w-full max-w-md flex-col gap-6",children:[st&&Lo.jsx("img",{src:Os[st],alt:"",className:"size-10 self-center"}),Lo.jsx("h1",{className:"text-center text-xl font-medium",children:ot}),Lo.jsxs("div",{role:"alert",className:"flex flex-col items-center gap-4",children:[Lo.jsx("p",{className:"text-sm wrap-anywhere whitespace-pre-wrap text-muted-foreground",children:ct}),Lo.jsx(a,{variant:"secondary",disabled:gt,onClick:bt,children:"Try again"})]})]})})}var Kd=e(r(),1);function sY(ot,st=!1,ct={}){let{environment:gt,demo:bt}=R(),yt=ua(ot),{data:vt}=yt,xt=nm(vt?.hasAuthOverrides||vt?.isFolderMissing?void 0:vt?.provider),wt=em(),Ct=xt.isEnabled?xt:yt,St=Ct.isFetching||yt.isFetching||wt.isPending,Et=yt.isError?yt.refetch:Ct.refetch,kt=Ct.data?.availability,Rt=Ct.isError||yt.isError||wt.isError,Tt=yt.isPending||Ct.isPending,Pt=iY.useCallback(()=>{Et()},[Et]),Mt=()=>{if(xt.isEnabled&&!yt.isError)wt.mutate();else Pt()};function It(){if(Tt)return;if(Rt&&kt?.status==="available")return;if(Rt||!vt||!kt)return Kd.jsx(eY,{retrying:St,onRetry:Mt});if(vt.isFolderMissing)return Kd.jsx(tY,{workspaceId:ot});let{provider:Dt}=vt;if(kt.status==="available")return;if((kt.status==="login-required"||gt==="local"&&!bt&&kt.status==="unavailable"&&kt.code==="not-installed")&&(Dt==="claude-code"||Dt==="codex"))return Kd.jsx(ZX,{type:Dt,reason:kt.reason,checking:St,onConnected:Pt,onRecheck:Mt});return Kd.jsx(nY,{type:Dt,availability:kt,retrying:St,onRetry:Mt})}let At=It(),Nt=!At&&!st&&!Tt,Ot=D6(ot);return{content:Ot?Kd.jsx(_6,{...ct}):At??Kd.jsx(rY,{}),ready:Nt&&!Ot,setupRequired:Ot||!!At}}var mE=e(r(),1);function aY({setupRequired:ot=!1,children:st}){return mE.jsx("div",{className:"relative flex h-full min-h-0 flex-1 flex-col font-sans text-foreground",children:ot?mE.jsx(fE,{mode:"fullscreen",children:mE.jsx($f,{"aria-label":"Workspace setup",children:st})}):st})}var $N=e(r(),1);function lY({contentPending:ot,widgets:st,views:ct}){let{layout:gt,workspaceId:bt,name:yt,provider:vt}=Sr(),{content:xt,ready:wt,setupRequired:Ct}=sY(bt,ot,{name:yt??"Workspace",icon:gt.icon,workspaceType:vt,workspaceTheme:gt.theme});return wt?$N.jsx(YX,{widgets:st,views:ct}):$N.jsx(aY,{setupRequired:Ct,children:xt})}var uY=e(t(),1);var gE=e(t(),1);function kEe(ot){return new Map(ot.map((st)=>[st.id,{w:st.config.colSpan,h:st.config.rowSpan}]))}function REe(ot,st,ct){let gt=new Set(ot.map((St)=>St.i)),bt=st.filter((St)=>{let Et=ct.get(St.id);if(!Et)return!gt.has(St.id);if(!gt.has(St.id))return!1;return Et.w!==St.config.colSpan||Et.h!==St.config.rowSpan});if(bt.length===0)return null;let yt=new Set(bt.map((St)=>St.id)),vt=new Map(st.map((St)=>[St.id,St.config])),xt=ot.filter((St)=>!yt.has(St.i)&&vt.has(St.i)).map((St)=>{let Et=vt.get(St.i);return{...St,w:Et.colSpan,h:Et.rowSpan}}),wt=xt.map(({i:St,x:Et,y:kt})=>({i:St,x:Et,y:kt})),Ct=[...xt];for(let St of bt){let Et=IS(Ct,St.config.colSpan,St.config.rowSpan);wt.push({i:St.id,...Et}),Ct.push({i:St.id,...Et,w:St.config.colSpan,h:St.config.rowSpan})}return wt}function cY(ot,st,ct,gt){let bt=gE.useRef(null);gE.useEffect(()=>{if(!st)return;let yt=kEe(st);if(bt.current?.workspaceId!==ot){bt.current={workspaceId:ot,sizes:yt};return}let vt=REe(ct.widgetGrid,st,bt.current.sizes);if(bt.current={workspaceId:ot,sizes:yt},vt)gt({widgetGrid:vt})},[ot,st,ct.widgetGrid,gt])}function pY(ot){let{layout:st,setLayout:ct}=Sr(),gt=kr({queryKey:Tn.widgets(ot),queryFn:async()=>(await p(`/api/workspaces/${ot}/widgets`)).widgets,...hc}),bt=uY.useMemo(()=>Q8(gt.data??[]),[gt.data]);return cY(ot,gt.data?bt:void 0,st,ct),{...gt,data:bt}}var qd=e(r(),1);function dY({id:ot}){S8(ot);let{collab:st}=R();return qd.jsx(vm,{children:qd.jsx(mt,{id:ot,children:qd.jsx(tz,{id:ot,children:qd.jsx(Xk,{workspaceId:ot,enabled:st,children:qd.jsx(TEe,{id:ot})})})})})}function TEe({id:ot}){let st=Si(),ct=Kn(),[gt]=pc(),{isLoading:bt,layout:yt,provider:vt}=Sr();k8(ot,vt),LF(yt.theme);let xt=pY(ot),wt=PS(ot);U8(),E((St)=>{if(St.type==="theme:updated"||St.type==="workspace:updated"){if(St.origin===V)return;ct.invalidateQueries({queryKey:Tn.layout(ot)})}else if(St.type==="widget-layout:updated"||St.type==="widget:updated")ct.invalidateQueries({queryKey:Tn.widgets(ot)});else if(St.type==="view:updated")ct.invalidateQueries({queryKey:Tn.views(ot)})});let Ct=bt||gt===void 0||xt.isLoading||wt.isLoading;return qd.jsx(lY,{contentPending:Ct,widgets:xt.data,views:wt.data??[]},st?"browser-tab":"shared")}var ba=e(r(),1),fY=null;function PEe(){if(!fY)return ba.jsx(Ac,{to:"/"});return ba.jsx(hE.Suspense,{fallback:null,children:ba.jsx(fY,{})})}function mY(){let[,ot]=Ai();return k3(),hE.useEffect(()=>(DR((st)=>ot(`/workspace/${st}`)),()=>DR(null)),[ot]),ba.jsxs(SD,{children:[ba.jsx(Xd,{path:"/dev/*?",component:PEe}),ba.jsx(Xd,{path:"/",component:w8}),ba.jsx(Xd,{path:"/onboarding",component:$F}),ba.jsx(Xd,{path:"/settings",component:T9}),ba.jsx(Xd,{path:"/workspace/:id/*?",children:(st)=>ba.jsx(dY,{id:st.id},st.id)})]})}var Ul=e(r(),1);z3(M);k5();function D6t(ot){function st(){return Ul.jsx(xE,{client:M,children:Ul.jsx(X3,{children:Ul.jsxs(sv,{children:[Ul.jsx(IE,{children:Ul.jsx(Q3,{children:Ul.jsx(mY,{})})}),Ul.jsx(o5,{})]})})})}gY.createRoot(ot).render(Ul.jsx(st,{}))}export{D6t as mount};