create-opentray 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/create-openspec-template-iOS-Dark-1024@1x.png +0 -0
- package/assets/create-openspec-template-iOS-Default-1024@1x.png +0 -0
- package/assets/inter-glyph.OFL.txt +93 -0
- package/assets/inter-glyph.ttf +0 -0
- package/dist/{bin-DDNgskyb.mjs → bin-BQb2Bjcu.mjs} +276 -2764
- package/dist/bin-BQb2Bjcu.mjs.map +1 -0
- package/dist/bin.mjs +1 -1
- package/dist/{decode-ico-D3SL2BXi.mjs → decode-ico-BHd2POHf.mjs} +2 -2
- package/dist/{decode-ico-D3SL2BXi.mjs.map → decode-ico-BHd2POHf.mjs.map} +1 -1
- package/dist/index.d.mts +17 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{raster-BQ07mKLu.mjs → raster-DeMbA2zI.mjs} +15 -16
- package/dist/{raster-BQ07mKLu.mjs.map → raster-DeMbA2zI.mjs.map} +1 -1
- package/dist/shell/assets/browse.js +1 -1
- package/dist/shell/assets/index.css +1 -1
- package/dist/shell/assets/index.js +9 -9
- package/dist/shell/assets/input.js +1 -1
- package/dist/shell/assets/main.js +19 -19
- package/dist/shell/assets/terminal-pane.js +1 -1
- package/dist/shell/assets/terminal.js +1 -1
- package/dist/shell/browse.html +1 -1
- package/dist/shell/index.html +1 -1
- package/dist/shell/terminal.html +1 -1
- package/dist/webui/assets/browse.js +1 -1
- package/dist/webui/assets/index.css +1 -1
- package/dist/webui/assets/index.js +9 -9
- package/dist/webui/assets/input.js +1 -1
- package/dist/webui/assets/main.js +19 -19
- package/dist/webui/assets/terminal-pane.js +1 -1
- package/dist/webui/assets/terminal.js +1 -1
- package/dist/webui/browse.html +1 -1
- package/dist/webui/index.html +1 -1
- package/dist/webui/terminal.html +1 -1
- package/package.json +15 -6
- package/dist/avif-DCXcyYJR.mjs +0 -2
- package/dist/bin-DDNgskyb.mjs.map +0 -1
- package/dist/decode-C4b5NXc_.mjs +0 -1236
- package/dist/decode-C4b5NXc_.mjs.map +0 -1
- package/dist/decode-Dsj9J0OD.mjs +0 -1214
- package/dist/decode-Dsj9J0OD.mjs.map +0 -1
- package/dist/decode-FysWS28R.mjs +0 -254
- package/dist/decode-FysWS28R.mjs.map +0 -1
- package/dist/decode-Xr7mARKr.mjs +0 -1262
- package/dist/decode-Xr7mARKr.mjs.map +0 -1
- package/dist/full.umd-oM1VUBRH.mjs +0 -3055
- package/dist/full.umd-oM1VUBRH.mjs.map +0 -1
- package/dist/jpeg-B4tsxG5f.mjs +0 -2
- package/dist/png-rD0XEazj.mjs +0 -35
- package/dist/png-rD0XEazj.mjs.map +0 -1
- package/dist/resize-B47sgoOb.mjs +0 -489
- package/dist/resize-B47sgoOb.mjs.map +0 -1
- package/dist/resvg-wasm-fcJTLpJs.mjs +0 -522
- package/dist/resvg-wasm-fcJTLpJs.mjs.map +0 -1
- package/dist/rolldown-runtime-JspESFgx.mjs +0 -35
- package/dist/webp-CcbaCrQ7.mjs +0 -2
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index2.js","assets/terminal-pane.js","assets/index.js","assets/index.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as He,r as d,E as Ot,u as Rt,b as Zp,d as Cu,f as st,e as Me,j as l,N as Sr,g as ct,h as zt,i as Iu,k as he,m as Ft,l as Ti,n as Jp,o as $p,R as Xp,a as qp}from"./index.js";import{u as wt,b as ae,i as $e,c as Te,d as ve,g as Ht,o as je,e as Ct,f as kt,h as Ni,j as de,k as Yt,l as Ce,m as eh,n as jt,p as Mn,q as $n,r as th,t as at,s as Go,v as ot,w as gt,x as Nn,y as zo,z as Bn,C as Xn,D as si,E as Cn,F as _i,H as nh,J as wu,K as rh,L as Oi,M as Yo,N as ku,O as vl,P as Yn,Q as ii,S as Hi,B as Oe,T as Eu,U as Li,V as Ir,W as br,X as Ki,Y as Su,Z as Wi,_ as Qi,$ as Uo,a0 as Gi,a1 as sn,a2 as zi,a3 as oh,I as Xe,a4 as Yi,a5 as sh,G as ai,a6 as yl,a7 as Cl,A as ih,a as ah,R as lh}from"./input.js";import{u as Ru,B as Io,T as Rr,_ as ch,p as uh,c as dh}from"./terminal-pane.js";const fh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ui=He("check",fh);const ph=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_n=He("chevron-down",ph);const hh=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Vi=He("chevron-up",hh);const gh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ah=He("circle-check",gh);const mh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],xh=He("circle-question-mark",mh);const bh=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],vh=He("copy",bh);const yh=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ch=He("download",yh);const Ih=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Du=He("external-link",Ih);const wh=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],kh=He("file-text",wh);const Eh=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Sh=He("folder-open",Eh);const Rh=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Dh=He("folder",Rh);const Fh=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Bh=He("link-2",Fh);const jh=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Mh=He("list",jh);const Ph=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Th=He("loader-circle",Ph);const Nh=[["path",{d:"M5 12h14",key:"1ays0h"}]],_h=He("minus",Nh);const Oh=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Hh=He("monitor",Oh);const Lh=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Kh=He("moon",Lh);const Wh=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Il=He("panel-left",Wh);const Qh=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Fu=He("pencil",Qh);const Gh=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],zh=He("play",Gh);const Yh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Bu=He("plus",Yh);const Uh=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Vh=He("refresh-cw",Uh);const Zh=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Jh=He("settings-2",Zh);const $h=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Xh=He("share-2",$h);const qh=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],eg=He("square",qh);const tg=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ng=He("sun",tg);const rg=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],og=He("trash-2",rg);const sg=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ig=He("triangle-alert",sg);const ag=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ju=He("upload",ag);const lg=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zi=He("x",lg);function Mu(e,t,n,r=!0,o){const[s,i]=d.useState(),a=wt(o?`${o}-label`:void 0),c=e??t??s;return ae(()=>{const u=e||t||!r?void 0:cg(n.current,a);s!==u&&i(u)}),c}function cg(e,t){const n=ug(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ug(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}function dg(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:fg,platform:pg,maxTouchPoints:hg}=dg(),Vo=fg.toLowerCase(),Dr=pg.toLowerCase(),Zo=/^i(os$|p)/.test(Dr)||Dr==="macintel"&&hg>1,wl="android",li=Dr===wl||Vo.includes(wl),Ji=!Zo&&Dr.startsWith("mac");Dr.startsWith("win");const gg=Ji||Zo,ln=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!ln&&Vo.includes("firefox");!ln&&Vo.includes("chrom");const Ag=gg,$i=/jsdom|happydom/.test(Vo),ci="data-base-ui-focusable",Pu="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Jo="ArrowLeft",$o="ArrowRight",Tu="ArrowUp",Xi="ArrowDown";function wo(e,t){if(!Te(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(ve(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Ds(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function mg(e){return e.matches("html,body")}function Xo(e){return $e(e)&&e.matches(Pu)}function xg(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Pu}`)!=null}function ui(e){return e?e.getAttribute("role")==="combobox"&&Xo(e):!1}function bg(e){if(!e||$i)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ko(e){return e?e.hasAttribute(ci)?e:e.querySelector(`[${ci}]`)||e:null}function bn(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...bn(e,o.id,n)])}function kl(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Kt(e){e.preventDefault(),e.stopPropagation()}function vg(e){return"nativeEvent"in e}function qi(e){return e.pointerType===""&&e.isTrusted?!0:li&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ea(e){return $i?!1:!li&&e.width===0&&e.height===0||li&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function xn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function yg(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const qn=Math.min,rn=Math.max,Eo=Math.round,Xr=Math.floor,on=e=>({x:e,y:e}),Cg={left:"right",right:"left",bottom:"top",top:"bottom"};function Nu(e,t,n){return rn(e,qn(t,n))}function vn(e,t){return typeof e=="function"?e(t):e}function Bt(e){return e.split("-")[0]}function In(e){return e.split("-")[1]}function ta(e){return e==="x"?"y":"x"}function na(e){return e==="y"?"height":"width"}function Dt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ra(e){return ta(Dt(e))}function Ig(e,t,n){n===void 0&&(n=!1);const r=In(e),o=ra(e),s=na(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=So(i)),[i,So(i)]}function wg(e){const t=So(e);return[di(e),t,di(t)]}function di(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const El=["left","right"],Sl=["right","left"],kg=["top","bottom"],Eg=["bottom","top"];function Sg(e,t,n){switch(e){case"top":case"bottom":return n?t?Sl:El:t?El:Sl;case"left":case"right":return t?kg:Eg;default:return[]}}function Rg(e,t,n,r){const o=In(e);let s=Sg(Bt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(di)))),s}function So(e){const t=Bt(e);return Cg[t]+e.slice(t.length)}function Dg(e){var t,n,r,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(o=e.left)!=null?o:0}}function _u(e){return typeof e!="number"?Dg(e):{top:e,right:e,bottom:e,left:e}}function Fr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function wr(e,t){return t<0||t>=e.length}function bo(e,t){return nn(e.current,{disabledIndices:t})}function fi(e,t){return nn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&Ro(e,s,r));return s}function Ro(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!qo(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function Fg(e){return e.visibility==="hidden"||e.visibility==="collapse"}function qo(e,t=e?Ht(e):null){return!e||!e.isConnected||!t||Fg(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Bg='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function jg(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Ni(n)?n.host:null}function pi(e){for(const t of Array.from(e.children))if(kt(t)==="summary")return t;return null}function Mg(e,t){const n=pi(t);return!!n&&(e===n||ve(n,e))}function Ou(e){const t=e?kt(e):"";return e!=null&&e.matches(Bg)&&(t!=="summary"||e.parentElement!=null&&kt(e.parentElement)==="details"&&pi(e.parentElement)===e)&&(t!=="details"||pi(e)==null)&&(t!=="input"||e.type!=="hidden")}function Hu(e){if(!Ou(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=jg(t)){const n=t!==e,r=kt(t)==="slot";if(t.hasAttribute("inert")||n&&kt(t)==="details"&&!t.open&&!Mg(e,t)||t.hasAttribute("hidden")||!r&&!Pg(t,n))return!1}return!0}function Pg(e,t){const n=Ht(e);return t?n.display!=="none":qo(e,n)}function Lu(e){const t=e.tabIndex;if(t<0){const n=kt(e);if(n==="details"||n==="audio"||n==="video"||$e(e)&&e.isContentEditable)return 0}return t}function Fs(e){if(kt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Tg(e,t){const n=Fs(e);if(!n)return!0;const r=t.find(o=>{const s=Fs(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=Fs(o);return s?.name===n.name&&s.form===n.form})===n}function Ku(e){if($e(e)&&kt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return $e(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Wu(e,t){Ku(e).forEach(n=>{Ou(n)&&t.push(n),Wu(n,t)})}function Qu(e,t,n){Ku(e).forEach(r=>{$e(r)&&r.matches(t)&&n.push(r),Qu(r,t,n)})}function oa(e){return Hu(e)&&Lu(e)>=0}function Gu(e){const t=[];return Wu(e,t),t.filter(Hu)}function Wr(e){const t=Gu(e);return t.filter(n=>Lu(n)>=0&&Tg(n,t))}function zu(e,t){const n=Wr(e),r=n.length;if(r===0)return;const o=Ct(je(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function sa(e){return zu(je(e).body,1)||e}function Yu(e){return zu(je(e).body,-1)||e}function Uu(e,t){if(!e)return null;const n=Wr(je(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Ng(e){return Uu(e,1)}function _g(e){return Uu(e,-1)}function Un(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ve(n,r)}function Og(e){Wr(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rl(e){const t=[];Qu(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function ia(e){d.useEffect(e,Ot)}const lr=0;class Lt{static create(){return new Lt}currentId=lr;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=lr,n()},t)}isStarted(){return this.currentId!==lr}clear=()=>{this.currentId!==lr&&(clearTimeout(this.currentId),this.currentId=lr)};disposeEffect=()=>this.clear}function pt(){const e=Rt(Lt.create).current;return ia(e.disposeEffect),e}const Hg=d.createContext({disabled:!1});function Lg(){return d.useContext(Hg)}var an=Zp();const qr=null;class Kg{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let eo=new Kg;class It{static create(){return new It}static request(t){return eo.request(t)}static cancel(t){return eo.cancel(t)}currentId=qr;request(t){this.cancel(),this.currentId=eo.request(()=>{this.currentId=qr,t()})}cancel=()=>{this.currentId!==qr&&(eo.cancel(this.currentId),this.currentId=qr)};disposeEffect=()=>this.cancel}function er(){const e=Rt(It.create).current;return ia(e.disposeEffect),e}function qt(e){return e==null?e:"current"in e?e.current:e}function aa(e,t=!1){const n=er();return de((r,o=null)=>{n.cancel();const s=qt(e);if(s==null)return;const i=s,a=()=>{an.flushSync(r)};if(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(i.getAnimations().map(u=>u.finished)).then(()=>{o?.aborted||a()},()=>{if(o?.aborted)return;if(i.getAnimations().some(f=>f.pending||f.playState!=="finished")){c();return}a()})}if(t){const u="data-starting-style";if(!i.hasAttribute(u)){n.request(c);return}const f=new MutationObserver(()=>{i.hasAttribute(u)||(f.disconnect(),c())});f.observe(i,{attributes:!0,attributeFilter:[u]}),o?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}n.request(c)})}function Ut(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=de(o),i=aa(r,n);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let Do=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Wg={"data-starting-style":""},Qg={"data-ending-style":""},On={transitionStatus(e){return e==="starting"?Wg:e==="ending"?Qg:null}};function ir(e,t=!1,n=!1){const[r,o]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),ae(()=>{if(!e&&s&&r!=="ending"&&n){const a=It.request(()=>{o("ending")});return()=>{It.cancel(a)}}},[e,s,r,n]),ae(()=>{if(!e||t)return;const a=It.request(()=>{o(void 0)});return()=>{It.cancel(a)}},[t,e]),ae(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=It.request(()=>{o("idle")});return()=>{It.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}var Bs={exports:{}},js={};var Dl;function Gg(){if(Dl)return js;Dl=1;var e=Cu();function t(h,A){return h===A&&(h!==0||1/h===1/A)||h!==h&&A!==A}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(h,A){var g=A(),p=r({inst:{value:g,getSnapshot:A}}),x=p[0].inst,m=p[1];return s(function(){x.value=g,x.getSnapshot=A,c(x)&&m({inst:x})},[h,g,A]),o(function(){return c(x)&&m({inst:x}),h(function(){c(x)&&m({inst:x})})},[h]),i(g),g}function c(h){var A=h.getSnapshot;h=h.value;try{var g=A();return!n(h,g)}catch{return!0}}function u(h,A){return A()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return js.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,js}var Fl;function Vu(){return Fl||(Fl=1,Bs.exports=Gg()),Bs.exports}var es=Vu();const vr={v:[]},Bl=()=>vr.v.forEach(e=>e()),zg=e=>(vr.v.push(e)===1&&addEventListener("hashchange",Bl),()=>{vr.v=vr.v.filter(t=>t!==e),vr.v.length||removeEventListener("hashchange",Bl)}),Yg=()=>"/"+location.hash.replace(/^#?\/?/,""),Ug=(e,{state:t=null,replace:n=!1}={})=>{const r=location.href,[o,s]=e.replace(/^#?\/?/,"").split("?"),i=new URL(location.href);i.hash=`/${o}`,s&&(i.search=s);const a=i.href;n?history.replaceState(t,"",a):history.pushState(t,"",a);const c=typeof HashChangeEvent<"u"?new HashChangeEvent("hashchange",{oldURL:r,newURL:a}):new Event("hashchange",{detail:{oldURL:r,newURL:a}});dispatchEvent(c)},Zu=({ssrPath:e="/"}={})=>[es.useSyncExternalStore(zg,Yg,()=>e),Ug];Zu.hrefs=e=>"#"+e;const Ms=768;function Vg(){const[e,t]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ms-1}px)`),r=()=>t(window.innerWidth<Ms);return n.addEventListener("change",r),t(window.innerWidth<Ms),()=>n.removeEventListener("change",r)},[]),!!e}const Ju=d.createContext(void 0);function Hn(e){const t=d.useContext(Ju);if(!e&&t===void 0)throw new Error(st(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Do.startingStyle]="startingStyle",e[e.endingStyle=Do.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Zg={"data-popup-open":""},Jg={"data-popup-open":"","data-pressed":""},$g={"data-open":""},Xg={"data-closed":""},qg={"data-anchor-hidden":""},$u={open(e){return e?Zg:null}},hi={open(e){return e?Jg:null}},Qr={open(e){return e?$g:Xg},anchorHidden(e){return e?qg:null}},la={...Qr,...On},ca=d.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,c=Hn(),u=c.useState("open"),f=c.useState("nested"),h=c.useState("mounted"),A=c.useState("transitionStatus");return Me("div",t,{state:{open:u,transitionStatus:A},ref:[c.context.backdropRef,n],stateAttributesMapping:la,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!f})}),Gr=d.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:i=!1,nativeButton:a=!0,...c}=t,u=Hn(),f=u.useState("open"),{getButtonProps:h,buttonRef:A}=Yt({disabled:i,native:a}),g={disabled:i};function p(x){f&&u.setOpen(!1,Ce(eh,x.nativeEvent))}return Me("button",t,{state:g,ref:[n,A],props:[{onClick:p},c,h]})}),ua=d.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,c=Hn(),u=wt(i);return c.useSyncedValueWithCleanup("descriptionElementId",u),Me("p",t,{ref:n,props:[{id:u},a]})});function eA(e,t){return t!=null&&!xn(t)?0:typeof e=="function"?e():e}function tr(e,t,n){const r=eA(e,n);return typeof r=="number"?r:r?.[t]}function jl(e){return typeof e=="function"?e():e}function Xu(e,t){return t||e==="click"||e==="mousedown"}function tA(e){return e?.includes("mouse")&&e!=="mousedown"}const nA=d.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Lt,currentIdRef:{current:null},currentContextRef:{current:null}});function rA(e,t){e.current=t.current}function oA(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,o=r.useState("floatingId"),s=d.useContext(nA),{currentIdRef:i,delayRef:a,timeoutMs:c,initialDelayRef:u,currentContextRef:f,hasProvider:h,timeout:A}=s,[g,p]=d.useState(!1),x=d.useRef(n);return ae(()=>{x.current=n},[n]),ae(()=>{function m(){f.current?.setIsInstantPhase(!1),i.current=null,f.current=null,a.current=u.current,A.clear()}if(i.current&&!n&&i.current===o){if(p(!1),c){const v=o;return A.start(c,()=>{r.select("open")||i.current&&i.current!==v||m()}),()=>{(x.current||i.current!==v)&&A.clear()}}m()}},[n,o,i,a,c,u,f,A,r]),ae(()=>{if(!n)return;const m=f.current,v=i.current;A.clear(),f.current={onOpenChange:r.setOpen,setIsInstantPhase:p},i.current=o,a.current={open:0,close:tr(u.current,"close")},v!==null&&v!==o?(p(!0),m?.setIsInstantPhase(!0),m?.onOpenChange(!1,Ce(jt))):(p(!1),m?.setIsInstantPhase(!1))},[n,o,r,i,a,u,f,A]),ae(()=>()=>{if(i.current===o){if(f.current=null,!x.current)return;i.current=null,rA(a,u),A.clear()}},[f,i,a,o,u,A]),d.useMemo(()=>({hasProvider:h,delayRef:a,isInstantPhase:g}),[h,a,g])}function De(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Gt(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function et(e){const t=Rt(sA,e).current;return t.next=e,ae(t.effect),t}function sA(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const qu={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ts={...qu,position:"fixed",top:0,left:0},da={...qu,position:"absolute"},nr=d.forwardRef(function(t,n){const[r,o]=d.useState();ae(()=>{Ag&&ln&&o("button")},[]);const s={tabIndex:0,role:r};return l.jsx("span",{...t,ref:n,style:ts,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Br(e){return`data-base-ui-${e}`}let to=0;function vo(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame(to);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Sr;const i=requestAnimationFrame(s);return to=i,()=>{to===i&&(cancelAnimationFrame(i),to=0)}}const Ps={inert:new WeakMap,"aria-hidden":new WeakMap},Ml="data-base-ui-inert",gi={inert:new WeakSet,"aria-hidden":new WeakSet};let cr=new WeakMap,Ts=0;function iA(e){return gi[e]}function ed(e){return e?Ni(e)?e.host:ed(e.parentNode):null}const Pl=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=ed(n);return e.contains(r)?r:null}).filter(n=>n!=null),Tl=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Nl=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{kt(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function aA(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let i=null,a=null;const c=Pl(t,e),u=o?Nl(t,Tl(c),new Set(c)):[],f=[],h=[];if(s){const A=Ps[s],g=iA(s);a=g,i=A;const p=Pl(t,Array.from(t.querySelectorAll("[aria-live]"))),x=c.concat(p);Nl(t,Tl(x),new Set(x)).forEach(v=>{const b=v.getAttribute(s),y=b!==null&&b!=="false",C=(A.get(v)||0)+1;A.set(v,C),f.push(v),C===1&&y&&g.add(v),y||v.setAttribute(s,s==="inert"?"":"true")})}return o&&u.forEach(A=>{const g=(cr.get(A)||0)+1;cr.set(A,g),h.push(A),g===1&&A.setAttribute(Ml,"")}),Ts+=1,()=>{i&&f.forEach(A=>{const p=(i.get(A)||0)-1;i.set(A,p),p||(!a?.has(A)&&s&&A.removeAttribute(s),a?.delete(A))}),o&&h.forEach(A=>{const g=(cr.get(A)||0)-1;cr.set(A,g),g||A.removeAttribute(Ml)}),Ts-=1,Ts||(Ps.inert=new WeakMap,Ps["aria-hidden"]=new WeakMap,gi.inert=new WeakSet,gi["aria-hidden"]=new WeakSet,cr=new WeakMap)}}function _l(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=je(e[0]).body;return aA(e,s,n,r,{mark:o})}const lA=500,cA=500,uA={style:{transition:"none"}},dA="data-base-ui-click-trigger",td={fallbackAxisSide:"none"},nd={fallbackAxisSide:"end"},fA={clipPath:"inset(50%)",position:"fixed",top:0,left:0},rd=d.createContext(null),od=()=>d.useContext(rd),pA=Br("portal");function sd(e={}){const{ref:t,container:n,componentProps:r=ct,elementProps:o}=e,s=$n(),a=od()?.portalNode,[c,u]=d.useState(null),[f,h]=d.useState(null),A=de(m=>{m!==null&&h(m)}),g=d.useRef(null);ae(()=>{if(n===null){g.current&&(g.current=null,h(null),u(null));return}const m=(n&&(th(n)?n:n.current))??a??document.body;if(m==null){g.current&&(g.current=null,h(null),u(null));return}g.current!==m&&(g.current=m,h(null),u(m))},[n,a]);const p=Me("div",r,{ref:[t,A],props:[{id:s,[pA]:""},o]}),x=c&&p?an.createPortal(p,c):null;return{node:f,nodeId:d.isValidElement(p)?p.props.id:void 0,subtree:x}}const fa=d.forwardRef(function(t,n){const{render:r,className:o,style:s,children:i,container:a,...c}=t,{node:u,nodeId:f,subtree:h}=sd({container:a,ref:n,componentProps:t,elementProps:c}),A=d.useRef(null),g=d.useRef(null),p=d.useRef(null),x=d.useRef(null),[m,v]=d.useState(null),b=d.useRef(!1),y=m?.modal,C=m?.open,I=!!m&&!m.modal&&m.open&&!!u;d.useEffect(()=>{if(!u||y)return;function S(R){u&&R.relatedTarget&&Un(R)&&(R.type==="focusin"?b.current&&(Rl(u),b.current=!1):(Og(u),b.current=!0))}return Gt(De(u,"focusin",S,!0),De(u,"focusout",S,!0))},[u,y]),ae(()=>{!u||C!==!0||!b.current||(Rl(u),b.current=!1)},[C,u]);const w=d.useMemo(()=>({beforeOutsideRef:A,afterOutsideRef:g,beforeInsideRef:p,afterInsideRef:x,portalNode:u,setFocusManagerState:v}),[u]);return l.jsxs(d.Fragment,{children:[h,l.jsxs(rd.Provider,{value:w,children:[I&&u&&l.jsx(nr,{"data-type":"outside",ref:A,onFocus:S=>{if(Un(S,u))p.current?.focus();else{const R=m?m.domReference:null;Yu(R)?.focus()}}}),I&&u&&l.jsx("span",{"aria-owns":f,style:fA}),u&&an.createPortal(i,u),I&&u&&l.jsx(nr,{"data-type":"outside",ref:g,onFocus:S=>{if(Un(S,u))x.current?.focus();else{const R=m?m.domReference:null;sa(R)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Ce(Mn,S.nativeEvent))}}})]})]})});function id(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class pa{nodesRef={current:[]};events=id();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ad=d.createContext(null),ld=d.createContext(null),wn=()=>d.useContext(ad)?.id||null,kn=e=>{const t=d.useContext(ld);return e??t};function cd(e){const t=$n(),n=kn(e),r=wn();return ae(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function hA(e){const{children:t,id:n}=e,r=wn();return l.jsx(ad.Provider,{value:d.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function gA(e){const{children:t,externalTree:n}=e,r=Rt(()=>n??new pa).current;return l.jsx(ld.Provider,{value:r,children:t})}function AA(e,t){const n=ot(gt(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Ol=20;let mn=[];function ha(){mn=mn.filter(e=>e.deref()?.isConnected)}function Hl(e){ha(),e&&kt(e)!=="body"&&(mn.push(new WeakRef(e)),mn.length>Ol&&(mn=mn.slice(-Ol)))}function Ll(){return ha(),mn[mn.length-1]?.deref()}function mA(e){return e?oa(e)?e:Wr(e)[0]||e:null}function Kl(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Gu(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return oa(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ga(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:f,previousFocusableElement:h,beforeContentFocusGuardRef:A,externalTree:g,getInsideElements:p}=e,x="rootStore"in t?t.rootStore:t,m=x.useState("open"),v=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:y,dataRef:C}=x.context,I=de(()=>C.current.floatingContext?.nodeId),w=o===!1,S=ui(v)&&w,R=et(o),E=et(s),k=et(u),B=et(m),T=kn(g),F=od(),j=d.useRef(!1),D=d.useRef(!1),H=d.useRef(!1),_=d.useRef(null),P=d.useRef(""),L=d.useRef(""),N=d.useRef(null),M=d.useRef(null),O=zt(N,A,F?.beforeInsideRef),G=zt(M,F?.afterInsideRef),Z=pt(),J=pt(),Q=er(),$=F!=null,K=ko(b),te=de((ee=K)=>ee?Wr(ee):[]),le=de(()=>p?.().filter(ee=>ee!=null)??[]);d.useEffect(()=>{if(r||!a)return;function ee(ue){ue.key==="Tab"&&ve(K,Ct(je(K)))&&te().length===0&&!S&&Kt(ue)}const U=je(K);return De(U,"keydown",ee)},[r,K,a,S,te]),d.useEffect(()=>{if(r||!m)return;const ee=je(K);function U(){H.current=!1}function ue(be){const re=gt(be),Ae=le(),ie=ve(b,re)||ve(v,re)||ve(F?.portalNode,re)||Ae.some(oe=>oe===re||ve(oe,re));H.current=!ie,L.current=be.pointerType||"keyboard",re?.closest(`[${dA}]`)&&(D.current=!0,J.start(0,()=>{D.current=!1}))}function se(){L.current="keyboard"}return Gt(De(ee,"pointerdown",ue,!0),De(ee,"pointerup",U,!0),De(ee,"pointercancel",U,!0),De(ee,"keydown",se,!0),U)},[r,b,v,K,m,F,J,le]),d.useEffect(()=>{if(r||!c)return;const ee=je(K);function U(){D.current=!0,J.start(0,()=>{D.current=!1})}function ue(Ae){const ie=gt(Ae);oa(ie)&&(_.current=ie)}function se(Ae){const ie=Ae.relatedTarget,oe=Ae.currentTarget,ce=gt(Ae);a&&ie==null&&ce!=null&&ve(b,ce)&&Hl(ce),queueMicrotask(()=>{const me=I(),ge=x.context.triggerElements,W=le(),V=ie?.hasAttribute(Br("focus-guard"))&&[N.current,M.current,F?.beforeInsideRef.current,F?.afterInsideRef.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,qt(h),qt(f)].includes(ie),ye=!(ve(v,ie)||ve(b,ie)||ve(ie,b)||ve(F?.portalNode,ie)||W.some(q=>q===ie||ve(q,ie))||ge.hasMatchingElement(q=>ve(q,ie))||V||T&&(bn(T.nodesRef.current,me).find(q=>ve(q.context?.elements.floating,ie)||ve(q.context?.elements.domReference,ie))||kl(T.nodesRef.current,me).find(q=>[q.context?.elements.floating,ko(q.context?.elements.floating)].includes(ie)||q.context?.elements.domReference===ie)));if(oe===v&&K&&Kl(K),i&&oe!==v&&!qo(ce)&&Ct(ee)===ee.body){if($e(K)&&(K.focus(),i==="popup")){Q.request(()=>{K.focus()});return}const q=te(),ne=_.current,ke=(ne&&q.includes(ne)?ne:null)||q[q.length-1]||K;$e(ke)&&ke.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(S||!a)&&ie&&ye&&!D.current&&(S||ie!==Ll())&&(j.current=!0,x.setOpen(!1,Ce(Mn,Ae)))})}function be(){H.current||(C.current.insideReactTree=!0,Z.start(0,()=>{C.current.insideReactTree=!1}))}const re=$e(v)?v:null;if(!(!b&&!re))return Gt(re&&De(re,"focusout",se),re&&De(re,"pointerdown",U),b&&De(b,"focusin",ue),b&&De(b,"focusout",se),b&&F&&De(b,"focusout",be,!0))},[r,v,b,K,a,T,F,x,c,i,te,S,I,C,Z,J,Q,f,h,le]),d.useEffect(()=>{if(r||!b||!m)return;const ee=Array.from(F?.portalNode?.querySelectorAll(`[${Br("portal")}]`)||[]),ue=(T?kl(T.nodesRef.current,I()):[]).find(oe=>ui(oe.context?.elements.domReference||null))?.context?.elements.domReference,be=[...[b,...ee,N.current,M.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,...le()],ue,qt(h),qt(f),S?v:null].filter(oe=>oe!=null),re=_l(be,{ariaHidden:a||S,mark:!1}),Ae=[b,...ee].filter(oe=>oe!=null),ie=_l(Ae);return()=>{ie(),re()}},[m,r,v,b,a,F,S,T,I,f,h,le]),ae(()=>{if(!m||r||!$e(K))return;P.current="",L.current="";const ee=je(K),U=Ct(ee);queueMicrotask(()=>{const ue=R.current,se=typeof ue=="function"?ue(k.current||""):ue;if(se===void 0||se===!1||ve(K,U))return;let re=null;const Ae=()=>(re==null&&(re=te(K)),re[0]||K);let ie;se===!0||se===null?ie=Ae():ie=qt(se),ie=ie||Ae();const oe=ve(K,Ct(ee));vo(ie,{preventScroll:ie===K,shouldFocus(){if(!B.current)return!1;if(oe)return!0;const ce=Ct(ee);return!(ce!==ie&&ve(K,ce))}})})},[r,m,K,te,R,k,B]),ae(()=>{if(r||!K)return;const ee=je(K),U=Ct(ee),ue=k.current==null;Hl(U);function se(re){if(re.open||(P.current=AA(re.nativeEvent,L.current)),re.reason===at&&re.nativeEvent.type==="mouseleave"&&(j.current=!0),re.reason===Go)if(re.nested)j.current=!1;else if(qi(re.nativeEvent)||ea(re.nativeEvent))j.current=!1;else{let Ae=!1;je(K).createElement("div").focus({get preventScroll(){return Ae=!0,!1}}),Ae?j.current=!1:j.current=!0}}y.on("openchange",se);function be(re){const Ae=E.current;let ie=typeof Ae=="function"?Ae(re):Ae;if(ie===void 0||ie===!1)return null;ie===null&&(ie=!0);const oe=v?.isConnected?v:null,ce=U?.isConnected&&kt(U)!=="body"?U:null;let me=ue?ce||oe:oe||ce;return me||(me=Ll()||null),typeof ie=="boolean"?me:qt(ie)||me||null}return()=>{y.off("openchange",se);const re=Ct(ee),Ae=le(),ie=ve(b,re)||Ae.some(ge=>ge===re||ve(ge,re))||T&&bn(T.nodesRef.current,I(),!1).some(ge=>ve(ge.context?.elements.floating,re)),oe=E.current,ce=P.current,me=be(ce);queueMicrotask(()=>{const ge=mA(me),W=typeof oe!="boolean";if(oe&&!j.current&&$e(ge)&&(!(!W&&ge!==re&&re!==ee.body)||ie)){const V={preventScroll:!0};ce==="keyboard"&&(V.focusVisible=!0),ge.focus(V)}j.current=!1})}},[r,b,K,E,k,y,T,v,I,le]),ae(()=>{if(!ln||m||!b)return;const ee=Ct(je(b));!$e(ee)||!Xo(ee)||ve(b,ee)&&ee.blur()},[m,b]),ae(()=>{if(!(r||!F))return F.setFocusManagerState({modal:a,closeOnFocusOut:c,open:m,onOpenChange:x.setOpen,domReference:v}),()=>{F.setFocusManagerState(null)}},[r,F,a,m,x,c,v]),ae(()=>{if(!(r||!K))return Kl(K),()=>{queueMicrotask(ha)}},[r,K]);const X=!r&&(a?!S:!0)&&($||a);return l.jsxs(d.Fragment,{children:[X&&l.jsx(nr,{"data-type":"inside",ref:O,onFocus:ee=>{if(a){const U=te();vo(U[U.length-1])}else F?.portalNode&&(j.current=!1,Un(ee,F.portalNode)?sa(v)?.focus():qt(h??F.beforeOutsideRef)?.focus())}}),n,X&&l.jsx(nr,{"data-type":"inside",ref:G,onFocus:ee=>{a?vo(te()[0]):F?.portalNode&&(c&&(j.current=!0),Un(ee,F.portalNode)?Yu(v)?.focus():qt(f??F.afterOutsideRef)?.focus())}})]})}function ud(e,t={}){const{enabled:n=!0,event:r="click",toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:i=!0,touchOpenDelay:a=0,reason:c=Nn}=t,u="rootStore"in e?e.rootStore:e,f=u.context.dataRef,h=d.useRef(void 0),A=er(),g=pt(),p=d.useMemo(()=>{function x(v,b,y,C){const I=Ce(c,b,y);v&&C==="touch"&&a>0?g.start(a,()=>{u.setOpen(!0,I)}):u.setOpen(v,I)}function m(v,b,y){const C=f.current.openEvent,I=u.select("domReferenceElement")!==b;return v&&I||!v||!o?!0:C&&i?!y(C.type):!1}return{onPointerDown(v){h.current=xn(v.pointerType,!0)&&ea(v.nativeEvent)?"virtual":v.pointerType},onMouseDown(v){const b=h.current,y=v.nativeEvent,C=u.select("open");if(v.button!==0||r==="click"||xn(b,!0)&&s)return;const I=m(C,v.currentTarget,R=>R==="click"||R==="mousedown"),w=gt(y);if(Xo(w)){x(I,y,w,b);return}const S=v.currentTarget;A.request(()=>{x(I,y,S,b)})},onClick(v){if(r==="mousedown-only")return;const b=h.current;if(r==="mousedown"&&b){h.current=void 0;return}if(xn(b,!0)&&s)return;const y=u.select("open"),C=m(y,v.currentTarget,I=>I==="click"||I==="mousedown"||I==="keydown"||I==="keyup");x(C,v.nativeEvent,v.currentTarget,b)},onKeyDown(){h.current=void 0}}},[f,r,s,c,u,i,o,A,g,a]);return d.useMemo(()=>n?{reference:p}:ct,[n,p])}function xA(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){const s=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let u=s.width,f=s.height,h=s.x,A=s.y;return n==null&&t.x&&i&&(n=s.x-t.x),r==null&&t.y&&a&&(r=s.y-t.y),h-=n||0,A-=r||0,u=0,f=0,!o||c?(u=t.axis==="y"?s.width:0,f=t.axis==="x"?s.height:0,h=i&&t.x!=null?t.x:h,A=a&&t.y!=null?t.y:A):o&&!c&&(f=t.axis==="x"?s.height:f,u=t.axis==="y"?s.width:u),o=!0,{width:u,height:f,x:h,y:A,top:A,right:h+u,bottom:A+f,left:h}}}}function Wl(e){return e!=null&&e.clientX!=null}function bA(e,t={}){const{enabled:n=!0,axis:r="both"}=t,o="rootStore"in e?e.rootStore:e,s=o.useState("open"),i=o.useState("floatingElement"),a=o.useState("domReferenceElement"),c=o.context.dataRef,u=d.useRef(!1),f=d.useRef(null),[h,A]=d.useState(),[g,p]=d.useState([]),x=de(C=>{o.set("positionReference",C)}),m=de((C,I,w)=>{u.current||c.current.openEvent&&!Wl(c.current.openEvent)||o.set("positionReference",xA(w??a,{x:C,y:I,axis:r,dataRef:c,pointerType:h}))}),v=de(C=>{s?f.current||(m(C.clientX,C.clientY,C.currentTarget),p([])):m(C.clientX,C.clientY,C.currentTarget)}),b=xn(h)?i:s;d.useEffect(()=>{if(!n){x(a);return}if(!b)return;function C(){f.current?.(),f.current=null}const I=ot(i);function w(S){const R=gt(S);ve(i,R)?C():m(S.clientX,S.clientY)}return!c.current.openEvent||Wl(c.current.openEvent)?f.current=De(I,"mousemove",w):x(a),C},[b,n,i,c,a,o,m,x,g]),d.useEffect(()=>()=>{o.set("positionReference",null)},[o]),d.useEffect(()=>{n&&!i&&(u.current=!1)},[n,i]),d.useEffect(()=>{!n&&s&&(u.current=!0)},[n,s]);const y=d.useMemo(()=>{function C(I){A(I.pointerType)}return{onPointerDown:C,onPointerEnter:C,onMouseMove:v,onMouseEnter:v}},[v]);return d.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function vA(){return!1}function yA(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function ns(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:i=vA,bubbles:a,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,f=u.useState("open"),h=u.useState("floatingElement"),{dataRef:A}=u.context,g=kn(c),p=de(typeof o=="function"?o:()=>!1),x=typeof o=="function"?p:o,m=x!==!1,v=de(()=>s),{escapeKey:b,outsidePress:y}=yA(a),C=d.useRef(!1),I=d.useRef(!1),w=d.useRef(!1),S=d.useRef(!1),R=d.useRef(""),E=d.useRef(null),k=pt(),B=pt(),T=de(()=>{B.clear(),A.current.insideReactTree=!1}),F=de(O=>{const G=A.current.floatingContext?.nodeId;return(g?bn(g.nodesRef.current,G):[]).some(J=>J.context?.open&&!J.context.dataRef.current[O])}),j=de(O=>Ds(O,u.select("floatingElement"))||Ds(O,u.select("domReferenceElement"))),D=de(O=>{i()&&u.setOpen(!1,Ce(Nn,O.nativeEvent))}),H=de(O=>{if(!f||!n||!r||O.key!=="Escape"||S.current||!b&&F("__escapeKeyBubbles"))return;const G=vg(O)?O.nativeEvent:O,Z=Ce(zo,G);u.setOpen(!1,Z),Z.isCanceled||O.preventDefault(),!b&&!Z.isPropagationAllowed&&O.stopPropagation()}),_=de(()=>{A.current.insideReactTree=!0,B.start(0,T)}),P=de(O=>{if(!f||!n||O.button!==0)return;const G=gt(O.nativeEvent);ve(u.select("floatingElement"),G)&&(C.current||(C.current=!0,I.current=!1))}),L=de(O=>{!f||!n||(O.defaultPrevented||O.nativeEvent.defaultPrevented)&&C.current&&(I.current=!0)});d.useEffect(()=>{if(!f||!n)return T;A.current.__escapeKeyBubbles=b,A.current.__outsidePressBubbles=y;const O=new Lt,G=new Lt;function Z(){O.clear(),S.current=!0}function J(){O.start(ln?5:0,()=>{S.current=!1})}function Q(){w.current=!0,G.start(0,()=>{w.current=!1})}function $(){C.current=!1,I.current=!1}function K(){const W=R.current,V=W==="pen"||!W?"mouse":W,ye=v(),q=typeof ye=="function"?ye():ye;return typeof q=="string"?q:q[V]}function te(W){const V=K();return V==="intentional"&&W.type!=="click"||V==="sloppy"&&W.type==="click"}function le(W){const V=A.current.floatingContext?.nodeId,ye=g&&bn(g.nodesRef.current,V).some(q=>Ds(W,q.context?.elements.floating));return j(W)||ye}function X(W){if(te(W)){W.type!=="click"&&!j(W)&&(G.clear(),w.current=!1),T();return}if(A.current.insideReactTree){T();return}const V=gt(W),ye=`[${Br("inert")}]`,q=Te(V)?V.getRootNode():null,ne=Array.from((Ni(q)?q:je(u.select("floatingElement"))).querySelectorAll(ye)),ke=u.context.triggerElements;if(V&&(ke.hasElement(V)||ke.hasMatchingElement(Qe=>ve(Qe,V))))return;let Se=Te(V)?V:null;for(;Se&&!Bn(Se);){const Qe=Xn(Se);if(Bn(Qe)||!Te(Qe))break;Se=Qe}if(!(ne.length&&Te(V)&&!mg(V)&&!ve(V,u.select("floatingElement"))&&ne.every(Qe=>!ve(Se,Qe)))){if($e(V)&&!("touches"in W)){const Qe=Bn(V),tt=Ht(V),Le=/auto|scroll/,ht=Qe||Le.test(tt.overflowX),Ke=Qe||Le.test(tt.overflowY),Ge=ht&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,ut=Ke&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,Re=tt.direction==="rtl",Ue=ut&&(Re?W.offsetX<=V.offsetWidth-V.clientWidth:W.offsetX>V.clientWidth),_e=Ge&&W.offsetY>V.clientHeight;if(Ue||_e)return}if(!le(W)){if(K()==="intentional"&&w.current){G.clear(),w.current=!1;return}typeof x=="function"&&!x(W)||F("__outsidePressBubbles")||(u.setOpen(!1,Ce(Go,W)),T())}}}function ee(W){K()!=="sloppy"||W.pointerType==="touch"||!u.select("open")||!n||j(W)||X(W)}function U(W){if(K()!=="sloppy"||!u.select("open")||!n||j(W))return;const V=W.touches[0];V&&(E.current={startTime:Date.now(),startX:V.clientX,startY:V.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function ue(W,V){const ye=gt(W);if(!ye)return;const q=De(ye,W.type,()=>{V(W),q()})}function se(W){R.current="touch",ue(W,U)}function be(W){k.clear(),W.type==="pointerdown"&&(R.current=W.pointerType),!(W.type==="mousedown"&&E.current&&!E.current.dismissOnMouseDown)&&ue(W,V=>{V.type==="pointerdown"?ee(V):X(V)})}function re(W){if(!C.current)return;const V=I.current;if($(),K()==="intentional"){if(W.type==="pointercancel"){V&&Q();return}if(!le(W)){if(V){Q();return}typeof x=="function"&&!x(W)||(G.clear(),w.current=!0,T())}}}function Ae(W){if(K()!=="sloppy"||!E.current||j(W))return;const V=W.touches[0];if(!V)return;const ye=Math.abs(V.clientX-E.current.startX),q=Math.abs(V.clientY-E.current.startY),ne=Math.sqrt(ye*ye+q*q);ne>5&&(E.current.dismissOnTouchEnd=!0),ne>10&&(X(W),k.clear(),E.current=null)}function ie(W){ue(W,Ae)}function oe(W){K()!=="sloppy"||!E.current||j(W)||(E.current.dismissOnTouchEnd&&X(W),k.clear(),E.current=null)}function ce(W){ue(W,oe)}const me=je(h),ge=Gt(r&&Gt(De(me,"keydown",H),De(me,"compositionstart",Z),De(me,"compositionend",J)),m&&Gt(De(me,"click",be,!0),De(me,"pointerdown",be,!0),De(me,"pointerup",re,!0),De(me,"pointercancel",re,!0),De(me,"mousedown",be,!0),De(me,"mouseup",re,!0),De(me,"touchstart",se,!0),De(me,"touchmove",ie,!0),De(me,"touchend",ce,!0)));return()=>{ge(),O.clear(),G.clear(),$(),w.current=!1,T()}},[A,h,r,m,x,f,n,b,y,H,T,v,F,j,g,u,k]);const N=d.useMemo(()=>({onKeyDown:H,onPointerDown:D,onClick:D}),[H,D]),M=d.useMemo(()=>({onKeyDown:H,onPointerDown:L,onMouseDown:L,onClickCapture:_,onMouseDownCapture(O){_(),P(O)},onPointerDownCapture(O){_(),P(O)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[H,_,P,L]);return d.useMemo(()=>n?{reference:N,floating:M,trigger:N}:{},[n,N,M])}function Ql(e,t,n){let{reference:r,floating:o}=e;const s=Dt(t),i=ra(t),a=na(i),c=Bt(t),u=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,A=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}const p=In(t);return p&&(g[i]+=A*(p==="end"?1:-1)*(n&&u?-1:1)),g}async function CA(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:A=!1,padding:g=0}=vn(t,e),p=_u(g),m=a[A?h==="floating"?"reference":"floating":h],v=Fr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:c})),b=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},I=Fr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:c}):b);return{top:(v.top-I.top+p.top)/C.y,bottom:(I.bottom-v.bottom+p.bottom)/C.y,left:(v.left-I.left+p.left)/C.x,right:(I.right-v.right+p.right)/C.x}}const IA=50,wA=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:CA},c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Ql(u,r,c),A=r,g=0;const p={};for(let x=0;x<s.length;x++){const m=s[x];if(!m)continue;const{name:v,fn:b}=m,{x:y,y:C,data:I,reset:w}=await b({x:f,y:h,initialPlacement:r,placement:A,strategy:o,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});f=y??f,h=C??h,p[v]={...p[v],...I},w&&g<IA&&(g++,typeof w=="object"&&(w.placement&&(A=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:f,y:h}=Ql(u,A,c)),x=-1)}return{x:f,y:h,placement:A,strategy:o,middlewareData:p}},kA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:A,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:x=!0,...m}=vn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Bt(o),b=Dt(a),y=Bt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),I=A||(y||!x?[So(a)]:wg(a)),w=p!=="none";!A&&w&&I.push(...Rg(a,x,p,C));const S=[a,...I],R=await c.detectOverflow(t,m),E=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&E.push(R[v]),h){const j=Ig(o,i,C);E.push(R[j[0]],R[j[1]])}if(k=[...k,{placement:o,overflows:E}],!E.every(j=>j<=0)){var B,T;const j=(((B=s.flip)==null?void 0:B.index)||0)+1,D=S[j];if(D&&(!(h==="alignment"?b!==Dt(D):!1)||k.every(P=>Dt(P.placement)===b?P.overflows[0]>0:!0)))return{data:{index:j,overflows:k},reset:{placement:D}};let H=(T=k.filter(_=>_.overflows[0]<=0).sort((_,P)=>_.overflows[1]-P.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(g){case"bestFit":{var F;const _=(F=k.filter(P=>{if(w){const L=Dt(P.placement);return L===b||L==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(L=>L>0).reduce((L,N)=>L+N,0)]).sort((P,L)=>P[1]-L[1])[0])==null?void 0:F[0];_&&(H=_);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}},dd=new Set(["left","top"]);async function EA(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Bt(n),a=In(n),c=Dt(n)==="y",u=dd.has(i)?-1:1,f=s&&c?-1:1,h=vn(t,e);let{mainAxis:A,crossAxis:g,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(g=a==="end"?p*-1:p),c?{x:g*f,y:A*u}:{x:A*u,y:g*f}}const SA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await EA(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},RA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:b=>{let{x:y,y:C}=b;return{x:y,y:C}}},...u}=vn(e,t),f={x:n,y:r},h=await s.detectOverflow(t,u),A=Dt(o),g=ta(A);let p=f[g],x=f[A];const m=(b,y)=>Nu(y+h[b==="y"?"top":"left"],y,y-h[b==="y"?"bottom":"right"]);i&&(p=m(g,p)),a&&(x=m(A,x));const v=c.fn({...t,[g]:p,[A]:x});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:i,[A]:a}}}}}},DA=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:o,y:s,placement:i,rects:a,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=vn(e,t),A={x:o,y:s},g=Dt(i),p=ta(g);let x=A[p],m=A[g];const v=vn(u,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(r=v.crossAxis)!=null?r:0};if(f){const I=p==="y"?"height":"width",w=a.reference[p]-a.floating[I]+b.mainAxis,S=a.reference[p]+a.reference[I]-b.mainAxis;x<w?x=w:x>S&&(x=S)}if(h){var y,C;const I=p==="y"?"width":"height",w=dd.has(Bt(i)),S=a.reference[g]-a.floating[I]+(w&&((y=c.offset)==null?void 0:y[g])||0)+(w?0:b.crossAxis),R=a.reference[g]+a.reference[I]+(w?0:((C=c.offset)==null?void 0:C[g])||0)-(w?b.crossAxis:0);m<S?m=S:m>R&&(m=R)}return{[p]:x,[g]:m}}}},FA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=vn(e,t),c=await o.detectOverflow(t,a),u=Bt(n),f=In(n),h=Dt(n)==="y",{width:A,height:g}=r.floating;let p,x;u==="top"||u==="bottom"?(p=u,x=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(x=u,p=f==="end"?"top":"bottom");const m=g-c.top-c.bottom,v=A-c.left-c.right,b=qn(g-c[p],m),y=qn(A-c[x],v),C=t.middlewareData.shift,I=!C;let w=b,S=y;C!=null&&C.enabled.x&&(S=v),C!=null&&C.enabled.y&&(w=m),I&&!f&&(h?S=A-2*rn(c.left,c.right):w=g-2*rn(c.top,c.bottom)),await i({...t,availableWidth:S,availableHeight:w});const R=await o.getDimensions(s.floating);return A!==R.width||g!==R.height?{reset:{rects:!0}}:{}}}};function fd(e){const t=Ht(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$e(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Eo(n)!==s||Eo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Aa(e){return Te(e)?e:e.contextElement}function Vn(e){const t=Aa(e);if(!$e(t))return on(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=fd(t);let i=(s?Eo(n.width):n.width)/r,a=(s?Eo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const BA=on(0);function pd(e){const t=ot(e);return!ku()||!t.visualViewport?BA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jA(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ot(e)}function Pn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Aa(e);let i=on(1);t&&(r?Te(r)&&(i=Vn(r)):i=Vn(e));const a=jA(s,n,r)?pd(s):on(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s&&r){const A=ot(s),g=Te(r)?ot(r):r;let p=A,x=vl(p);for(;x&&g!==p;){const m=Vn(x),v=x.getBoundingClientRect(),b=Ht(x),y=v.left+(x.clientLeft+parseFloat(b.paddingLeft))*m.x,C=v.top+(x.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,u*=m.y,f*=m.x,h*=m.y,c+=y,u+=C,p=ot(x),x=vl(p)}}return Fr({width:f,height:h,x:c,y:u})}function rs(e,t){const n=Yo(e).scrollLeft;return t?t.left+n:Pn(Cn(e)).left+n}function hd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function MA(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Cn(r),a=t?_i(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=on(1);const f=on(0),h=$e(r);if((h||!s)&&((kt(r)!=="body"||Oi(i))&&(c=Yo(r)),h)){const g=Pn(r);u=Vn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const A=i&&!h&&!s?hd(i,c):on(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+A.x,y:n.y*u.y-c.scrollTop*u.y+f.y+A.y}}function PA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function TA(e){const t=Yo(e),n=e.ownerDocument.body,r=rn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=rn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+rs(e);const i=-t.scrollTop;return Ht(n).direction==="rtl"&&(s+=rn(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const NA=25;function _A(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=ot(e),s=Cn(e),i=o.visualViewport;let a=s.clientWidth,c=s.clientHeight,u=0,f=0;if(i){const A=!ku()||t==="fixed";r?A||(u=-i.offsetLeft,f=-i.offsetTop):(a=i.width,c=i.height,A&&(u=i.offsetLeft,f=i.offsetTop))}if(rs(s)<=0){const A=s.ownerDocument,g=A.body,p=getComputedStyle(g),x=A.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(s.clientWidth-g.clientWidth-x),v=getComputedStyle(s).scrollbarGutter==="stable both-edges"?m/2:m;v<=NA&&(a-=v)}return{width:a,height:c,x:u,y:f}}function OA(e,t){const n=Pn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Vn(e),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function Gl(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=_A(e,n,t);else if(t==="document")r=TA(Cn(e));else if(Te(t))r=OA(t,n);else{const o=pd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Fr(r)}function HA(e,t){const n=t.get(e);if(n)return n;let r=si(e,[],!1).filter(a=>Te(a)&&kt(a)!=="body"),o=null;const s=Ht(e).position==="fixed";let i=s?Xn(e):e;for(;Te(i)&&!Bn(i);){const a=Ht(i),c=wu(i),u=o?o.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&a.position==="static")?r=r.filter(h=>h!==i):o=a,i=Xn(i)}return t.set(e,r),r}function LA(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?_i(t)?[]:HA(t,this._c):[].concat(n),r],a=Gl(t,i[0],o);let c=a.top,u=a.right,f=a.bottom,h=a.left;for(let A=1;A<i.length;A++){const g=Gl(t,i[A],o);c=rn(g.top,c),u=qn(g.right,u),f=qn(g.bottom,f),h=rn(g.left,h)}return{width:u-h,height:f-c,x:h,y:c}}function KA(e){const{width:t,height:n}=fd(e);return{width:t,height:n}}function WA(e,t,n){const r=$e(t),o=Cn(t),s=n==="fixed",i=Pn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=on(0);if((r||!s)&&((kt(t)!=="body"||Oi(o))&&(a=Yo(t)),r)){const A=Pn(t,!0,s,t);c.x=A.x+t.clientLeft,c.y=A.y+t.clientTop}!r&&o&&(c.x=rs(o));const u=o&&!r&&!s?hd(o,a):on(0),f=i.left+a.scrollLeft-c.x-u.x,h=i.top+a.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function Ns(e){return Ht(e).position==="static"}function zl(e,t){if(!$e(e)||Ht(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function gd(e,t){const n=ot(e);if(_i(e))return n;if(!$e(e)){let o=Xn(e);for(;o&&!Bn(o);){if(Te(o)&&!Ns(o))return o;o=Xn(o)}return n}let r=zl(e,t);for(;r&&nh(r)&&Ns(r);)r=zl(r,t);return r&&Bn(r)&&Ns(r)&&!wu(r)?n:r||rh(e)||n}const QA=async function(e){const t=this.getOffsetParent||gd,n=this.getDimensions,r=await n(e.floating);return{reference:WA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GA(e){return Ht(e).direction==="rtl"}const Ad={convertOffsetParentRelativeRectToViewportRelativeRect:MA,getDocumentElement:Cn,getClippingRect:LA,getOffsetParent:gd,getElementRects:QA,getClientRects:PA,getDimensions:KA,getScale:Vn,isElement:Te,isRTL:GA};function md(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zA(e,t,n){let r=null,o;const s=Cn(e);function i(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function a(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),i();const A=e.getBoundingClientRect(),{left:g,top:p,width:x,height:m}=A;if(f||t(),!x||!m)return;const v=Xr(p),b=Xr(s.clientWidth-(g+x)),y=Xr(s.clientHeight-(p+m)),C=Xr(g),w={rootMargin:-v+"px "+-b+"px "+-y+"px "+-C+"px",threshold:rn(0,qn(1,h))||1};let S=!0;function R(E){const k=E[0].intersectionRatio;if(!md(A,e.getBoundingClientRect()))return a();if(k!==h){if(!S)return a();k?a(!1,k):o=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(R,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(R,w)}r.observe(e)}const c=ot(e),u=()=>a(n);return c.addEventListener("resize",u),a(!0),()=>{c.removeEventListener("resize",u),i()}}function Yl(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Aa(e),f=o||s?[...u?si(u):[],...t?si(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n),s&&v.addEventListener("resize",n)});const h=u&&a?zA(u,n,s):null;let A=-1,g=null;i&&(g=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&g&&t&&(g.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(t)})),n()}),u&&!c&&g.observe(u),t&&g.observe(t));let p,x=c?Pn(e):null;c&&m();function m(){const v=Pn(e);x&&!md(x,v)&&n(),x=v,p=requestAnimationFrame(m)}return n(),()=>{var v;f.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),h?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(p)}}const YA=SA,UA=RA,VA=kA,ZA=FA,JA=DA,$A=(e,t,n)=>{const r=new Map,o=n??{},s={...Ad,...o.platform,_c:r};return wA(e,t,{...o,platform:s})};var XA=typeof document<"u",qA=function(){},yo=XA?d.useLayoutEffect:qA;function Fo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fo(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Fo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ul(e,t){const n=xd(e);return Math.round(t*n)/n}function _s(e){const t=d.useRef(e);return yo(()=>{t.current=e}),t}function em(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[f,h]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[A,g]=d.useState(r);Fo(A,r)||g(r);const[p,x]=d.useState(null),[m,v]=d.useState(null),b=d.useCallback(P=>{P!==w.current&&(w.current=P,x(P))},[]),y=d.useCallback(P=>{P!==S.current&&(S.current=P,v(P))},[]),C=s||p,I=i||m,w=d.useRef(null),S=d.useRef(null),R=d.useRef(f),E=c!=null,k=_s(c),B=_s(o),T=_s(u),F=d.useCallback(()=>{if(!w.current||!S.current)return;const P={placement:t,strategy:n,middleware:A};B.current&&(P.platform=B.current),$A(w.current,S.current,P).then(L=>{const N={...L,isPositioned:T.current!==!1};j.current&&!Fo(R.current,N)&&(R.current=N,an.flushSync(()=>{h(N)}))})},[A,t,n,B,T]);yo(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[u]);const j=d.useRef(!1);yo(()=>(j.current=!0,()=>{j.current=!1}),[]),yo(()=>{if(C&&(w.current=C),I&&(S.current=I),C&&I){if(k.current)return k.current(C,I,F);F()}},[C,I,F,k,E]);const D=d.useMemo(()=>({reference:w,floating:S,setReference:b,setFloating:y}),[b,y]),H=d.useMemo(()=>({reference:C,floating:I}),[C,I]),_=d.useMemo(()=>{const P={position:n,left:0,top:0};if(!H.floating)return P;const L=Ul(H.floating,f.x),N=Ul(H.floating,f.y);return a?{...P,transform:"translate("+L+"px, "+N+"px)",...xd(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:N}},[n,a,H.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:F,refs:D,elements:H,floatingStyles:_}),[f,F,D,H,_])}const tm=(e,t)=>{const n=YA(e);return{name:n.name,fn:n.fn,options:[e,t]}},nm=(e,t)=>{const n=UA(e);return{name:n.name,fn:n.fn,options:[e,t]}},rm=(e,t)=>({fn:JA(e).fn,options:[e,t]}),om=(e,t)=>{const n=VA(e);return{name:n.name,fn:n.fn,options:[e,t]}},sm=(e,t)=>{const n=ZA(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Os={exports:{}},Hs={};var Vl;function im(){if(Vl)return Hs;Vl=1;var e=Cu(),t=Vu();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Hs.useSyncExternalStoreWithSelector=function(u,f,h,A,g){var p=s(null);if(p.current===null){var x={hasValue:!1,value:null};p.current=x}else x=p.current;p=a(function(){function v(w){if(!b){if(b=!0,y=w,w=A(w),g!==void 0&&x.hasValue){var S=x.value;if(g(S,w))return C=S}return C=w}if(S=C,r(y,w))return S;var R=A(w);return g!==void 0&&g(S,R)?(y=w,S):(y=w,C=R)}var b=!1,y,C,I=h===void 0?null:h;return[function(){return v(f())},I===null?void 0:function(){return v(I())}]},[f,h,A,g]);var m=o(u,p[0],p[1]);return i(function(){x.hasValue=!0,x.value=m},[m]),c(m),m},Hs}var Zl;function am(){return Zl||(Zl=1,Os.exports=im()),Os.exports}var lm=am();const Ai=[];let mi;function cm(){return mi}function um(e){Ai.push(e)}function ma(e){const t=(n,r)=>{const o=Rt(dm).current;let s;try{mi=o;for(const i of Ai)i.before(o);s=e(n,r);for(const i of Ai)i.after(o);o.didInitialize=!0}finally{mi=void 0}return s};return t.displayName=e.displayName||e.name,t}function bd(e){return d.forwardRef(ma(e))}function dm(){return{didInitialize:!1}}const fm=Iu(19),pm=fm?gm:Am;function Ie(e,t,n,r,o){return pm(e,t,n,r,o)}function hm(e,t,n,r,o){const s=d.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return es.useSyncExternalStore(e.subscribe,s,s)}um({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),es.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function gm(e,t,n,r,o){const s=cm();if(!s)return hm(e,t,n,r,o);const i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,n)||!Object.is(a.a2,r)||!Object.is(a.a3,o))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=n,a.a2=r,a.a3=o,a.value=t(e.getSnapshot(),n,r,o))):(a={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(a)),a.value}function Am(e,t,n,r,o){return lm.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class mm{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Ie(this,t,n,r,o)}}class zr extends mm{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){d.useDebugValue(t);const r=this;ae(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;ae(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);ae(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){d.useDebugValue(t);const r=this,o=n!==void 0;ae(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return d.useDebugValue(t),Ie(this,this.selectors[t],n,r,o)}useContextCallback(t,n){d.useDebugValue(t);const r=de(n??Sr);this.context[t]=r}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}const xm={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class os extends zr{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:id(),nested:r,triggerElements:s},xm),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&yg(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function vd(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:i}=e,a=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),f=t.context.triggerElements,h=i,A=d.useRef(null);r===void 0&&A.current===null&&(A.current=new os({open:a,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:f,onOpenChange:h,floatingId:o,syncOnly:!0,nested:s}));const g=r??A.current;return t.useSyncedValue("floatingId",o),ae(()=>{const p={open:a,floatingId:o,referenceElement:c,floatingElement:u};Te(c)&&(p.domReferenceElement=c),g.state.positionReference===g.state.referenceElement&&(p.positionReference=c),g.update(p)},[a,o,c,u,g]),g.context.onOpenChange=h,g.context.nested=s,g}const ss={tabIndex:-1,[ci]:""};function bm(e){return t=>t==="touch"?e.current:!0}function yd(e,t=!1){const n=$n(),r=wn()!=null,o=Rt(()=>e(n,r)).current;return vd({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function xa({handle:e,store:t}){return ae(()=>e.attachStore(t),[e,t]),null}function vm(e,t){const n=d.useRef(null),r=d.useRef(null);return d.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const i=n.current,a=r.current,c=t.context.triggerElements.getById(i);a&&c===a&&(t.context.triggerElements.delete(i),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function ba(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function Cd(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ym(e,t,n,r={}){const o=n.reason,s=o===at,i=t&&o===Yn,a=!t&&(o===Nn||o===zo),c=Cd(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const u=()=>{const f={...r.extraState,open:t};i?f.instantType="focus":a?f.instantType="dismiss":s&&(f.instantType=void 0),ba(f,t,n.trigger,c()),e.update(f)};s?an.flushSync(u):u()}function Id(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=vm(e,n),i=de(c=>{const u=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...u?r:null});return}f==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})}),a=d.useCallback(c=>{s(c),c&&i(c)},[s,i]);return ae(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:o}}function va(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=d.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),i=e.useState("activeTriggerId"),a=e.useState("activeTriggerElement");ae(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const f=e.select("activeTriggerId");let h=null;if(f){const A=e.context.triggerElements.getById(f);if(A)r.current=f,A!==e.state.activeTriggerElement&&(u.activeTriggerElement=A);else{for(const[g,p]of e.context.triggerElements.entries())if(p===e.state.activeTriggerElement){u.activeTriggerId=g,u.activeTriggerElement=p,r.current=g;break}u.activeTriggerId===void 0&&(r.current===f?h=f:r.current=null)}}else r.current=null;if(!h&&!f&&c===1){const A=e.context.triggerElements.entries().next();if(!A.done){const[g,p]=A.value;u.activeTriggerId=g,u.activeTriggerElement=p,r.current=g}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),h&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const A=Ce(jt);e.setOpen(!1,A),A.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,i,a,n])}function ya(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=ir(e),i=t.useState("preventUnmountingOnClose"),a=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:a});const c=de(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Ut({enabled:r&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function Ca(e,t){e.useSyncedValues(t),ae(()=>()=>{e.update({activeTriggerProps:ct,inactiveTriggerProps:ct,popupProps:ct})},[e])}function Cm(e,t){ae(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ae(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Yr{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Im(){return new os({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Yr,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Ia(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Im(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ct,inactiveTriggerProps:ct,popupProps:ct}}function wd(e,t,n=!1){return new os({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const kr=e=>e.triggerIdProp??e.activeTriggerId,wa=e=>e.openProp??e.open,Jl=e=>(e.popupElement?.id??e.floatingId)||void 0;function kd(e,t){return t!==void 0&&wa(e)&&kr(e)===t}function wm(e,t){return kd(e,t)?!0:t!==void 0&&wa(e)&&kr(e)==null&&e.triggerCount===1}const ka={open:wa,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:kr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Jl,isTriggerActive:(e,t)=>t!==void 0&&kr(e)===t,isOpenedByTrigger:(e,t)=>kd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&kr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>wm(e,t)?Jl(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ed(e){const t=d.useCallback(r=>e===void 0?Sr:e.subscribeStore(r),[e]),n=d.useCallback(()=>e===void 0?void 0:e.store,[e]);return es.useSyncExternalStore(t,n,()=>e?.serverStore)}function km(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=$n(),s=wn()!=null,i=Rt(()=>new os({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Yr,floatingId:o,syncOnly:!1,nested:s})).current;return ae(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=Te(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function Em(e){return Sm(e,e.rootContext)}function Sm(e,t){const{nodeId:n,externalTree:r}=e,o=t.useState("referenceElement"),s=t.useState("floatingElement"),i=t.useState("domReferenceElement"),a=t.useState("open"),c=t.useState("floatingId"),[u,f]=d.useState(null),[h,A]=d.useState(void 0),[g,p]=d.useState(void 0),x=d.useRef(null),m=kn(r),v=d.useMemo(()=>({reference:o,floating:s,domReference:i}),[o,s,i]),b=em({...e,elements:{...v,...u&&{reference:u}}}),y=Te(h)?h:null,C=g===void 0?t.state.floatingElement:g;t.useSyncedValue("referenceElement",h??null),t.useSyncedValue("domReferenceElement",h===void 0?i:y),t.useSyncedValue("floatingElement",C);const I=d.useCallback(B=>{const T=Te(B)?{getBoundingClientRect:()=>B.getBoundingClientRect(),getClientRects:()=>B.getClientRects(),contextElement:B}:B;f(T),b.refs.setReference(T)},[b.refs]),w=d.useCallback(B=>{(Te(B)||B===null)&&(x.current=B,A(B)),(Te(b.refs.reference.current)||b.refs.reference.current===null||B!==null&&!Te(B))&&b.refs.setReference(B)},[b.refs,A]),S=d.useCallback(B=>{p(B),b.refs.setFloating(B)},[b.refs]),R=d.useMemo(()=>({...b.refs,setReference:w,setFloating:S,setPositionReference:I,domReference:x}),[b.refs,w,S,I]),E=d.useMemo(()=>({...b.elements,domReference:i}),[b.elements,i]),k=d.useMemo(()=>({...b,dataRef:t.context.dataRef,open:a,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:R,elements:E,nodeId:n,rootStore:t}),[b,R,E,n,t,a,c]);return ae(()=>{i&&(x.current=i)},[i]),ae(()=>{t.context.dataRef.current.floatingContext=k;const B=m?.nodesRef.current.find(T=>T.id===n);B&&(B.context=k)}),d.useMemo(()=>({...b,context:k,refs:R,elements:E,rootStore:t}),[b,R,E,k,t])}const Ls=Ji&&ln;function Sd(e,t={}){const{enabled:n=!0,delay:r}=t,o="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=o.context,a=d.useRef(!1),c=d.useRef(null),u=d.useRef(!0),f=pt();d.useEffect(()=>{const A=o.select("domReferenceElement");if(!n)return;const g=ot(A);function p(){const v=o.select("domReferenceElement");!o.select("open")&&$e(v)&&v===Ct(je(v))&&(a.current=!0)}function x(){u.current=!0}function m(){u.current=!1}return Gt(De(g,"blur",p),Ls&&De(g,"keydown",x,!0),Ls&&De(g,"pointerdown",m,!0))},[o,n]),d.useEffect(()=>{if(!n)return;function A(g){if(g.reason===Nn||g.reason===zo){const p=o.select("domReferenceElement");Te(p)&&(c.current=p,a.current=!0)}}return s.on("openchange",A),()=>{s.off("openchange",A)}},[s,n,o]);const h=d.useMemo(()=>{function A(){a.current=!1,c.current=null}return{onMouseLeave(){A()},onFocus(g){const p=g.currentTarget;if(a.current){if(c.current===p)return;A()}const x=gt(g.nativeEvent);if(Te(x)){if(Ls&&!g.relatedTarget){if(!u.current&&!Xo(x))return}else if(!bg(x))return}const m=wo(g.relatedTarget,o.context.triggerElements),{nativeEvent:v,currentTarget:b}=g,y=typeof r=="function"?r():r;if(o.select("open")&&m||y===0||y===void 0){o.setOpen(!0,Ce(Yn,v,b));return}f.start(y,()=>{a.current||o.setOpen(!0,Ce(Yn,v,b))})},onBlur(g){A();const p=g.relatedTarget,x=g.nativeEvent,m=Te(p)&&p.hasAttribute(Br("focus-guard"))&&p.getAttribute("data-type")==="outside";f.start(0,()=>{const v=o.select("domReferenceElement"),b=Ct(je(v));!p&&b===v||ve(i.current.floatingContext?.refs.floating.current,b)||ve(v,b)||m||wo(p??b,o.context.triggerElements)||o.setOpen(!1,Ce(Yn,x))})}}},[i,r,o,f]);return d.useMemo(()=>n?{reference:h,trigger:h}:{},[n,h])}class Ea{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 Lt,this.restTimeout=new Lt,this.handleCloseOptions=void 0}static create(){return new Ea}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Bo=new WeakMap;function jo(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Bo.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Bo.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Rd(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,s=Bo.get(n);s&&s!==e&&jo(s),jo(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,Bo.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function Sa(e){const t=e.context.dataRef.current,n=Rt(()=>t.hoverInteractionState??Ea.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),ia(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Dd(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:o}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),a=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,f=kn(),h=wn(),A=Sa(s),g=pt(),p=de(()=>Xu(u.current.openEvent?.type,A.interactedInside)),x=de(()=>tA(u.current.openEvent?.type)),m=de(()=>{jo(A)});ae(()=>{i||(A.pointerType=void 0,A.restTimeoutPending=!1,A.interactedInside=!1,m())},[i,A,m]),d.useEffect(()=>m,[m]),ae(()=>{if(n&&i&&A.handleCloseOptions?.blockPointerEvents&&x()&&Te(c)&&a){const v=c,b=a,y=je(a),C=f?.nodesRef.current.find(R=>R.id===h)?.context?.elements.floating;C&&(C.style.pointerEvents="");const I=A.pointerEventsScopeElement!==b?A.pointerEventsScopeElement:null,w=C!==b?C:null,S=A.handleCloseOptions?.getScope?.()??I??w??v.closest("[data-rootownerid]")??y.body;return Rd(A,{scopeElement:S,referenceElement:v,floatingElement:b}),()=>{m()}}},[n,i,c,a,A,x,f,h,m]),d.useEffect(()=>{if(!n)return;function v(){return!!(f&&h&&bn(f.nodesRef.current,h).length>0)}function b(R){const E=tr(r,"close",A.pointerType),k=()=>{s.setOpen(!1,Ce(at,R)),f?.events.emit("floating.closed",R)};E?A.openChangeTimeout.start(E,k):(A.openChangeTimeout.clear(),k())}function y(R){const E=gt(R);if(!xg(E)){A.interactedInside=!1;return}A.interactedInside=E?.closest("[aria-haspopup]")!=null}function C(){A.openChangeTimeout.clear(),g.clear(),f?.events.off("floating.closed",w),m()}function I(R){if(v()&&f){f.events.on("floating.closed",w);return}if(wo(R.relatedTarget,s.context.triggerElements))return;const E=u.current.floatingContext?.nodeId??o,k=R.relatedTarget;if(!(f&&E&&Te(k)&&bn(f.nodesRef.current,E,!1).some(T=>ve(T.context?.elements.floating,k)))){if(A.handler){A.handler(R);return}m(),x()&&!p()&&b(R)}}function w(R){!f||!h||v()||g.start(0,()=>{f.events.off("floating.closed",w),s.setOpen(!1,Ce(at,R)),f.events.emit("floating.closed",R)})}const S=a;return Gt(S&&De(S,"mouseenter",C),S&&De(S,"mouseleave",I),S&&De(S,"pointerdown",y,!0),()=>{f?.events.off("floating.closed",w)})},[n,a,s,u,r,o,x,p,m,A,f,h,g])}const Rm={current:null};function Fd(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:s=!1,restMs:i=0,move:a=!0,triggerElementRef:c=Rm,externalTree:u,isActiveTrigger:f=!0,getHandleCloseContext:h,isClosing:A,shouldOpen:g,guardStaleOpen:p=!1}=t,x="rootStore"in e?e.rootStore:e,{dataRef:m,events:v}=x.context,b=kn(u),y=Sa(x),C=d.useRef(!1),I=et(o),w=et(r),S=et(i),R=et(n),E=et(g),k=et(A),B=de(()=>Xu(m.current.openEvent?.type,y.interactedInside)),T=de(()=>E.current?.()!==!1),F=de((H,_,P)=>{const L=x.context.triggerElements;if(L.hasElement(_))return!H||!ve(H,_);if(!Te(P))return!1;const N=P;return L.hasMatchingElement(M=>ve(M,N))&&(!H||!ve(H,N))}),j=de(()=>{if(!y.handler)return;je(x.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),D=de(()=>{jo(y)});return f&&(y.handleCloseOptions=I.current?.__options),d.useEffect(()=>j,[j]),d.useEffect(()=>{if(!n)return;function H(_){_.open?C.current=!1:(C.current=_.reason===at,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return v.on("openchange",H),()=>{v.off("openchange",H)}},[n,v,y,j]),d.useEffect(()=>{if(!n)return;function H(O,G=!0){const Z=tr(w.current,"close",y.pointerType);Z?y.openChangeTimeout.start(Z,()=>{x.setOpen(!1,Ce(at,O)),b?.events.emit("floating.closed",O)}):G&&(y.openChangeTimeout.clear(),x.setOpen(!1,Ce(at,O)),b?.events.emit("floating.closed",O))}const _=c.current??(f?x.select("domReferenceElement"):null);if(!Te(_))return;function P(O){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,s&&!xn(y.pointerType))return;const G=jl(S.current),Z=tr(w.current,"open",y.pointerType),J=gt(O),Q=O.currentTarget??null,$=x.select("domReferenceElement");let K=Q;if(Te(J)&&!x.context.triggerElements.hasElement(J)){for(const re of x.context.triggerElements.elements())if(ve(re,J)){K=re;break}}Te(Q)&&Te($)&&!x.context.triggerElements.hasElement(Q)&&ve(Q,$)&&(K=$);const te=K==null?!1:F($,K,J),le=x.select("open"),X=k.current?.()??x.select("transitionStatus")==="ending",ee=!le&&X&&C.current,U=!te&&Te(K)&&Te($)&&ve($,K)&&ee,ue=G>0&&!Z,se=te&&(le||ee)||U,be=!le||te;if(se){T()&&x.setOpen(!0,Ce(at,O,K));return}ue||(Z?y.openChangeTimeout.start(Z,()=>{be&&T()&&x.setOpen(!0,Ce(at,O,K))}):be&&T()&&x.setOpen(!0,Ce(at,O,K)))}function L(O){if(B()){D();return}j();const G=x.select("domReferenceElement"),Z=je(G);y.restTimeout.clear(),y.restTimeoutPending=!1;const J=m.current.floatingContext??h?.();if(wo(O.relatedTarget,x.context.triggerElements))return;if(I.current&&J){x.select("open")||y.openChangeTimeout.clear();const $=c.current;y.handler=I.current({...J,tree:b,x:O.clientX,y:O.clientY,onClose(){D(),j(),R.current&&!B()&&$===x.select("domReferenceElement")&&H(O,!0)}}),Z.addEventListener("mousemove",y.handler),y.handler(O);return}(y.pointerType!=="touch"||!ve(x.select("floatingElement"),O.relatedTarget))&&H(O)}function N(O){ve(_,O.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}const M=p?De(_,"mouseout",N):void 0;return a?Gt(De(_,"mousemove",P,{once:!0}),De(_,"mouseenter",P),De(_,"mouseleave",L),M):Gt(De(_,"mouseenter",P),De(_,"mouseleave",L),M)},[j,D,m,w,x,n,I,y,f,F,B,s,a,S,c,b,R,h,k,T,p]),d.useMemo(()=>{if(!n)return;function H(_){y.pointerType=_.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(_){const{nativeEvent:P}=_,L=_.currentTarget,N=x.select("domReferenceElement"),M=x.select("open"),O=F(N,L,_.target);if(s&&!xn(y.pointerType))return;if(M&&O&&y.handleCloseOptions?.blockPointerEvents){const J=x.select("floatingElement");if(J){const Q=y.handleCloseOptions?.getScope?.()??L.ownerDocument.body;Rd(y,{scopeElement:Q,referenceElement:L,floatingElement:J})}}const G=jl(S.current);if(M&&!O||G===0||!O&&y.restTimeoutPending&&_.movementX**2+_.movementY**2<2)return;y.restTimeout.clear();function Z(){if(y.restTimeoutPending=!1,B())return;const J=x.select("open");!y.blockMouseMove&&(!J||O)&&T()&&x.setOpen(!0,Ce(at,P,L))}y.pointerType==="touch"?an.flushSync(()=>{Z()}):O&&M?Z():(y.restTimeoutPending=!0,y.restTimeout.start(G,Z))}}},[n,y,B,F,s,x,S,T])}const Dm="Escape";function $l(e){return ln&&e.movementX===0&&e.movementY===0}function is(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function no(e,t){return is(t,e===Tu||e===Xi,e===Jo||e===$o)}function Ks(e,t,n){return is(t,e===Xi,n?e===Jo:e===$o)||e==="Enter"||e===" "||e===""}function Fm(e,t,n){return is(t,n?e===Jo:e===$o,e===Xi)}function Bm(e,t,n,r){const o=n?e===$o:e===Jo,s=e===Tu;return t==="both"||t==="horizontal"&&r?e===Dm:is(t,o,s)}function Bd(e,t){const{listRef:n,activeIndex:r,onNavigate:o=()=>{},enabled:s=!0,selectedIndex:i=null,allowEscape:a=!1,loopFocus:c=!1,nested:u=!1,rtl:f=!1,virtual:h=!1,focusItemOnOpen:A="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:p=!0,disabledIndices:x=void 0,orientation:m="vertical",parentOrientation:v,id:b,resetOnPointerLeave:y=!0,externalTree:C,grid:I}=t,w=I!=null,S="rootStore"in e?e.rootStore:e,R=S.useState("open"),E=S.useState("floatingElement"),k=S.useState("domReferenceElement"),B=S.context.dataRef,T=ko(E),F=ui(k),j=et(T),D=wn(),H=kn(C),_=d.useRef(A),P=d.useRef(i??-1),L=d.useRef(null),N=d.useRef(!0),M=de(W=>{o(P.current===-1?null:P.current,W)}),O=d.useRef(!!E),G=d.useRef(R),Z=d.useRef(!1),J=d.useRef(!1),Q=d.useRef(null),$=et(x),K=et(R),te=et(i),le=et(y),X=er(),ee=er(),U=de(()=>{function W(ne){h?H?.events.emit("virtualfocus",ne):Q.current=vo(ne,{sync:Z.current,preventScroll:!0})}const V=n.current[P.current],ye=J.current;V&&W(V),(Z.current?ne=>ne():ne=>X.request(ne))(()=>{const ne=n.current[P.current]||V;if(!ne)return;V||W(ne),ie&&(ye||!N.current)&&ne.scrollIntoView?.({block:"nearest",inline:"nearest"})})});ae(()=>{B.current.orientation=m},[B,m]),ae(()=>{s&&(R&&E?(P.current=i??-1,_.current&&i!=null&&(J.current=!0,M())):O.current&&(P.current=-1,M()))},[s,R,E,i,M]),ae(()=>{if(s){if(!R){Z.current=!1;return}if(E)if(r==null){if(Z.current=!1,te.current!=null)return;if(O.current&&(P.current=-1,U()),(!G.current||!O.current)&&_.current&&(L.current!=null||_.current===!0&&L.current==null)){let W=0;const V=()=>{n.current[0]==null?(W<2&&(W?q=>ee.request(q):queueMicrotask)(V),W+=1):(P.current=L.current==null||Ks(L.current,m,f)||u?bo(n):fi(n),L.current=null,M())};V()}}else wr(n.current,r)||(P.current=r,U(),J.current=!1)}},[s,R,E,r,te,u,n,m,f,M,U,ee]),ae(()=>{if(!s||E||!H||h||!O.current)return;const W=H.nodesRef.current,V=W.find(ne=>ne.id===D)?.context?.elements.floating,ye=Ct(je(k??V??null)),q=W.some(ne=>ne.context&&ve(ne.context.elements.floating,ye));V&&!q&&N.current&&V.focus({preventScroll:!0})},[s,E,k,H,D,h]),ae(()=>{G.current=R,O.current=!!E}),ae(()=>{R||(L.current=null,_.current=A)},[R,A]);const ue=r!=null,se=de(W=>{if(!K.current)return;const V=n.current.indexOf(W.currentTarget);V!==-1&&(P.current!==V||r!==V)&&(P.current=V,M(W))}),be=de(()=>v??H?.nodesRef.current.find(W=>W.id===D)?.context?.dataRef?.current.orientation),re=de(()=>bo(n,$.current)),Ae=de(W=>{if(N.current=!1,Z.current=!0,W.which===229||!K.current&&W.currentTarget===j.current)return;if(u&&Bm(W.key,m,f,w)){no(W.key,be())||Kt(W),S.setOpen(!1,Ce(ii,W.nativeEvent)),$e(k)&&(h?H?.events.emit("virtualfocus",k):k.focus());return}const V=P.current,ye=bo(n,x),q=fi(n,x);if(F||(W.key==="Home"&&(Kt(W),P.current=ye,M(W)),W.key==="End"&&(Kt(W),P.current=q,M(W))),I!=null){const ne=I(W,P.current,n,m,c,f,x,ye,q);if(ne!=null&&(P.current=ne,M(W)),m==="both")return}if(no(W.key,m)){if(Kt(W),R&&!h&&Ct(W.currentTarget.ownerDocument)===W.currentTarget){P.current=Ks(W.key,m,f)?ye:q,M(W);return}Ks(W.key,m,f)?c?V>=q?a&&V!==n.current.length?P.current=-1:(Z.current=!1,P.current=ye):P.current=nn(n.current,{startingIndex:V,disabledIndices:x}):P.current=Math.min(q,nn(n.current,{startingIndex:V,disabledIndices:x})):c?V<=ye?a&&V!==-1?P.current=n.current.length:(Z.current=!1,P.current=q):P.current=nn(n.current,{startingIndex:V,decrement:!0,disabledIndices:x}):P.current=Math.max(ye,nn(n.current,{startingIndex:V,decrement:!0,disabledIndices:x})),wr(n.current,P.current)&&(P.current=-1),M(W)}}),ie=d.useMemo(()=>({onFocus(V){Z.current=!0,se(V)},onClick:({currentTarget:V})=>V.focus({preventScroll:!0}),onMouseMove(V){$l(V)||(Z.current=!0,J.current=!1,g&&se(V))},onPointerLeave(V){if(!K.current||!N.current||V.pointerType==="touch")return;Z.current=!0;const ye=V.relatedTarget;if(!(!g||n.current.includes(ye))&&le.current&&(Q.current?.(),Q.current=null,P.current=-1,M(V),!h)){const q=j.current,ne=Ct(je(q));q&&ve(q,ne)&&q.focus({preventScroll:!0})}}}),[se,K,j,g,n,M,le,h]),oe=d.useMemo(()=>h&&R&&ue&&{"aria-activedescendant":`${b}-${r}`},[h,R,ue,b,r]),ce=d.useMemo(()=>({"aria-orientation":m==="both"?void 0:m,...F?{}:oe,onKeyDown(W){if(W.key==="Tab"&&W.shiftKey&&R&&!h){const V=gt(W.nativeEvent);if(V&&!ve(j.current,V))return;Kt(W),S.setOpen(!1,Ce(Mn,W.nativeEvent)),$e(k)&&k.focus();return}Ae(W)},onPointerMove(W){$l(W)||(N.current=!0)}}),[oe,Ae,j,m,F,S,R,h,k]),me=d.useMemo(()=>{function W(q){S.setOpen(!0,Ce(ii,q.nativeEvent,q.currentTarget))}function V(q){A==="auto"&&qi(q.nativeEvent)&&(_.current=!h)}function ye(q){_.current=A,A==="auto"&&ea(q.nativeEvent)&&(_.current=!0)}return{onKeyDown(q){const ne=S.select("open");N.current=!1;const ke=q.key.startsWith("Arrow"),Se=Fm(q.key,be(),f),Qe=no(q.key,m),tt=(u?Se:Qe)||q.key==="Enter"||q.key.trim()==="";if(h&&ne)return Ae(q);if(!(!ne&&!p&&ke)){if(tt){const Le=no(q.key,be());L.current=u&&Le?null:q.key}if(u){Se&&(Kt(q),ne?(P.current=re(),M(q)):W(q));return}Qe&&(te.current!=null&&(P.current=te.current),Kt(q),!ne&&p?W(q):Ae(q),ne&&M(q))}},onFocus(q){S.select("open")&&!h&&(P.current=-1,M(q))},onPointerDown:ye,onPointerEnter:ye,onMouseDown:V,onClick:V}},[Ae,A,re,u,M,S,p,m,be,f,te,h]),ge=d.useMemo(()=>({...oe,...me}),[oe,me]);return d.useMemo(()=>s?{reference:ge,floating:ce,item:ie,trigger:me}:{},[s,ge,ce,me,ie])}function jd(e,t){const{listRef:n,elementsRef:r,activeIndex:o,onMatch:s,disabledIndices:i,onTyping:a,enabled:c=!0,resetMs:u=750,selectedIndex:f=null}=t,h="rootStore"in e?e.rootStore:e,A=h.useState("open"),g=pt(),p=d.useRef(""),x=d.useRef(f??o??-1),m=d.useRef(null),v=de(C=>{function I(j){return r?.current[j]}function w(j){const D=I(j);return D&&!qo(D)||D?.matches(":disabled")?!1:i==null||!Ro(Ot,j,i)}function S(j,D,H=0){if(j.length===0)return-1;const _=(H%j.length+j.length)%j.length,P=D.toLowerCase();for(let L=0;L<j.length;L+=1){const N=(_+L)%j.length;if(!(!j[N]?.toLowerCase().startsWith(P)||!w(N)))return N}return-1}const R=n.current;if(p.current.length>0&&C.key===" "&&(Kt(C),a?.(!0)),p.current.length>0&&p.current[0]!==" "&&S(R,p.current)===-1&&C.key!==" "&&a?.(!1),R==null||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;A&&C.key!==" "&&(Kt(C),a?.(!0));const E=p.current==="";E&&(x.current=f??o??-1),R.every((j,D)=>j&&w(D)?j[0]?.toLowerCase()!==j[1]?.toLowerCase():!0)&&p.current===C.key&&(p.current="",x.current=m.current),p.current+=C.key,g.start(u,()=>{p.current="",x.current=m.current,a?.(!1)});const T=((E?f??o??-1:x.current)??0)+1,F=S(R,p.current,T);F!==-1?(s?.(F),m.current=F):C.key!==" "&&(p.current="",a?.(!1))}),b=de(C=>{const I=C.relatedTarget,w=h.select("domReferenceElement"),S=h.select("floatingElement");ve(w,I)||ve(S,I)||(g.clear(),p.current="",x.current=m.current,a?.(!1))});ae(()=>{!A&&f!==null||(g.clear(),m.current=null,p.current!==""&&(p.current=""))},[A,f,g]);const y=d.useMemo(()=>({onKeyDown:v,onBlur:b}),[v,b]);return d.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}const Xl=.1,jm=Xl*Xl,We=.5;function ro(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function oo(e,t,n,r,o,s,i,a,c,u){let f=!1;return ro(e,t,n,r,o,s)&&(f=!f),ro(e,t,o,s,i,a)&&(f=!f),ro(e,t,i,a,c,u)&&(f=!f),ro(e,t,c,u,n,r)&&(f=!f),f}function Mm(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function so(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),c=Math.min(r,s),u=Math.max(r,s);return e>=i&&e<=a&&t>=c&&t<=u}function Md(e={}){const{blockPointerEvents:t=!1}=e,n=new Lt,r=({x:o,y:s,placement:i,elements:a,onClose:c,nodeId:u,tree:f})=>{const h=i?.split("-")[0];let A=!1,g=null,p=null,x=typeof performance<"u"?performance.now():0;function m(b,y){const C=performance.now(),I=C-x;if(g===null||p===null||I===0)return g=b,p=y,x=C,!1;const w=b-g,S=y-p,R=w*w+S*S,E=I*I*jm;return g=b,p=y,x=C,R<E}function v(){n.clear(),c()}return function(y){n.clear();const C=a.domReference,I=a.floating;if(!C||!I||h==null||o==null||s==null)return;const{clientX:w,clientY:S}=y,R=gt(y),E=y.type==="mouseleave",k=ve(I,R),B=ve(C,R);if(k&&(A=!0,!E))return;if(B&&(A=!1,!E)){A=!0;return}if(E&&Te(y.relatedTarget)&&ve(I,y.relatedTarget))return;function T(){return!!(f&&bn(f.nodesRef.current,u).length>0)}function F(){T()||v()}if(T())return;const j=C.getBoundingClientRect(),D=I.getBoundingClientRect(),H=o>D.right-D.width/2,_=s>D.bottom-D.height/2,P=D.width>j.width,L=D.height>j.height,N=(P?j:D).left,M=(P?j:D).right,O=(L?j:D).top,G=(L?j:D).bottom;if(h==="top"&&s>=j.bottom-1||h==="bottom"&&s<=j.top+1||h==="left"&&o>=j.right-1||h==="right"&&o<=j.left+1){F();return}let Z=!1;switch(h){case"top":Z=so(w,S,N,j.top+1,M,D.bottom-1);break;case"bottom":Z=so(w,S,N,D.top+1,M,j.bottom-1);break;case"left":Z=so(w,S,D.right-1,G,j.left+1,O);break;case"right":Z=so(w,S,j.right-1,G,D.left+1,O);break}if(Z)return;if(A&&!Mm(w,S,j)){F();return}if(!E&&m(w,S)){F();return}let J=!1;switch(h){case"top":{const Q=P?We/2:We*4,$=P||H?o+Q:o-Q,K=P?o-Q:H?o+Q:o-Q,te=s+We+1,le=H||P?D.bottom-We:D.top,X=H?P?D.bottom-We:D.top:D.bottom-We;J=oo(w,S,$,te,K,te,D.left,le,D.right,X);break}case"bottom":{const Q=P?We/2:We*4,$=P||H?o+Q:o-Q,K=P?o-Q:H?o+Q:o-Q,te=s-We,le=H||P?D.top+We:D.bottom,X=H?P?D.top+We:D.bottom:D.top+We;J=oo(w,S,$,te,K,te,D.left,le,D.right,X);break}case"left":{const Q=L?We/2:We*4,$=L||_?s+Q:s-Q,K=L?s-Q:_?s+Q:s-Q,te=o+We+1,le=_||L?D.right-We:D.left,X=_?L?D.right-We:D.left:D.right-We;J=oo(w,S,le,D.top,X,D.bottom,te,$,te,K);break}case"right":{const Q=L?We/2:We*4,$=L||_?s+Q:s-Q,K=L?s-Q:_?s+Q:s-Q,te=o-We,le=_||L?D.left+We:D.right,X=_?L?D.left+We:D.right:D.left+We;J=oo(w,S,te,$,te,K,le,D.top,X,D.bottom);break}}J?A||n.start(40,F):F()}};return r.__options={...e,blockPointerEvents:t},r}const Pd=d.createContext(void 0);function Pm(){const e=d.useContext(Pd);if(e===void 0)throw new Error(st(26));return e}const xi="ArrowUp",bi="ArrowDown",vi="ArrowLeft",yi="ArrowRight",Ci="Home",Ii="End",as=new Set([xi,bi,vi,yi,Ci,Ii]),Tm="Shift",Nm=[Tm,"Control","Alt","Meta"];function _m(e){return $e(e)&&e.tagName==="INPUT"}function ql(e){return!!(_m(e)&&e.selectionStart!=null||$e(e)&&e.tagName==="TEXTAREA")}function ec(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const c=tc(e,t,"left"),u=io(e),f=io(t);n==="ltr"&&(c+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?o=c+t.offsetWidth+f.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:c-f.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(o=c-f.scrollMarginLeft-u.scrollPaddingLeft)),n==="rtl"&&(c-f.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft?o=c-f.scrollMarginLeft-u.scrollPaddingLeft:c+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(o=c+t.offsetWidth+f.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(a&&r!=="horizontal"){const c=tc(e,t,"top"),u=io(e),f=io(t);c-f.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?s=c-f.scrollMarginTop-u.scrollPaddingTop:c+t.offsetHeight+f.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(s=c+t.offsetHeight+f.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function tc(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function io(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Om={...Qr,...On,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Ra=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,initialFocus:a,...c}=t,u=Hn(),f=u.useState("descriptionElementId"),h=u.useState("disablePointerDismissal"),A=u.useState("floatingRootContext"),g=u.useState("popupProps"),p=u.useState("modal"),x=u.useState("mounted"),m=u.useState("nested"),v=u.useState("nestedOpenDialogCount"),b=u.useState("open"),y=u.useState("openMethod"),C=u.useState("titleElementId"),I=u.useState("transitionStatus"),w=u.useState("role"),S=A.useState("floatingId");Pm(),Ut({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});const R=a===void 0?bm(u.context.popupRef):a,E=v>0,k=u.useStateSetter("popupElement"),T=Me("div",t,{state:{open:b,nested:m,transitionStatus:I,nestedDialogOpen:E},props:[g,{id:S,"aria-labelledby":C,"aria-describedby":f,role:w,...ss,hidden:!x,onKeyDown(F){as.has(F.key)&&F.stopPropagation()},style:{"--nested-dialogs":v}},c],ref:[n,u.context.popupRef,k],stateAttributesMapping:Om});return l.jsx(ga,{context:A,openInteractionType:y,disabled:!x,closeOnFocusOut:!h,initialFocus:R,returnFocus:i,modal:p!==!1,restoreFocus:"popup",children:T})});function Da(e){return Iu(19)?e:e?"true":void 0}const Fa=d.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return l.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),Ba=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=Hn(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||r?l.jsx(Pd.Provider,{value:r,children:l.jsxs(fa,{ref:n,...o,children:[i&&a===!0&&l.jsx(Fa,{ref:s.context.internalBackdropRef,inert:Da(!c)}),t.children]})}):null});let nc={},rc={},oc="";function ls(e,t){return Oi(e)?e:t}function sc(e,t,n){return/hidden|clip/.test(e.getComputedStyle(ls(t,n)).overflowY)}function Hm(e){if(typeof document>"u")return!1;const t=je(e);return ot(t).innerWidth-t.documentElement.clientWidth>0}function Lm(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=je(e),r=n.documentElement,o=n.body,s=ls(r,o),i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,c===u}function Km(e){const t=je(e),n=t.documentElement,r=t.body,o=ls(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Wm(e){const t=je(e),n=t.documentElement,r=t.body,o=ot(n);let s=0,i=0,a=!1;const c=It.create();if(ln&&(o.visualViewport?.scale??1)!==1)return()=>{};function u(){const g=o.getComputedStyle(n),p=o.getComputedStyle(r),v=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,nc={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},oc=n.style.scrollBehavior,rc={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,C=g.overflowY==="scroll"||p.overflowY==="scroll",I=g.overflowX==="scroll"||p.overflowX==="scroll",w=Math.max(0,o.innerWidth-r.clientWidth),S=Math.max(0,o.innerHeight-r.clientHeight),R=parseFloat(p.marginTop)+parseFloat(p.marginBottom),E=parseFloat(p.marginLeft)+parseFloat(p.marginRight),k=ls(n,r);if(a=Lm(e),a){n.style.scrollbarGutter=v,k.style.overflowY="hidden",k.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(b||C)&&(n.style.overflowY="scroll"),(y||I)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:R||S?`calc(100dvh - ${R+S}px)`:"100dvh",width:E||w?`calc(100vw - ${E+w}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,nc),Object.assign(r.style,rc),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=oc)}function h(){f(),c.request(u)}u();const A=De(o,"resize",h);return()=>{c.cancel(),f(),typeof o.removeEventListener=="function"&&A()}}class Qm{lockCount=0;restore=null;timeoutLock=Lt.create();timeoutUnlock=Lt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=je(t),r=n.documentElement,o=n.body,s=ot(r);if(sc(s,r,o)){const a=new s.MutationObserver(()=>{sc(s,r,o)||(a.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};a.observe(r,c),a.observe(o,c),this.restore=()=>a.disconnect();return}const i=Zo||!Hm(t);this.restore=i?Km(t):Wm(t)}}const Gm=new Qm;function Td(e=!0,t=null){ae(()=>{if(e)return Gm.acquire(t)},[e,t])}function zm({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),a=e.useState("floatingRootContext"),[c,u]=d.useState(0),[f,h]=d.useState(0),A=c===0,g=ns(a,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(p){if(!e.context.outsidePressEnabledRef.current||"button"in p&&p.button!==0)return!1;if("touches"in p){if(p.type==="touchend"){if(p.changedTouches.length!==1||p.touches.length!==0)return!1}else if(p.touches.length!==1)return!1}const x=gt(p);if(A&&!o){if(s){const m=e.context.internalBackdropRef.current,v=e.context.backdropRef.current;return m||v?m===x||v===x||ve(x,i)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:A});return Td(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(p,x)=>{u(p),h(x)}),ae(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,f+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,f,t]),Ca(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:f}),null}const Ym={...ka,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class Um extends zr{constructor(t,n,r){const o=new Yr,s=Vm(t,o,n,r);super(s,Zm(o),Ym)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};ba(r,t,n.trigger),this.update(r)}}function Vm(e,t,n,r=!1){const o={...Ia(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=wd(t,n,r),o}function Zm(e){return{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Nd(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:i,disablePointerDismissal:a=!1,modal:c=!0,actionsRef:u,handle:f,triggerId:h,defaultTriggerId:A=null}=t,g=e==="drawer",p=e==="alert-dialog",x=p?!0:c,m=p||a,v=p?"alertdialog":"dialog",b=Hn(!0),y=b!=null,C={modal:x,disablePointerDismissal:m,nested:y,role:v},I=yd((B,T)=>new Um({open:o,openProp:r,activeTriggerId:A,triggerIdProp:h,...C},B,T),!0);I.useControlledProp("openProp",r),I.useControlledProp("triggerIdProp",h),I.useSyncedValues(C),I.useContextCallback("onOpenChange",s),I.useContextCallback("onOpenChangeComplete",i);const w=I.useState("open"),S=I.useState("mounted"),R=I.useState("payload");Cm(I,w),va(I);const{forceUnmount:E}=ya(w,I);d.useImperativeHandle(u,()=>({unmount:E,close:()=>I.setOpen(!1,Ce(Hi))}),[E,I]);const k=w||S;return l.jsxs(Ju.Provider,{value:I,children:[f&&l.jsx(xa,{handle:f,store:I}),k&&l.jsx(zm,{store:I,parentContext:b?.context,isDrawer:g}),typeof n=="function"?n({payload:R}):n]})}function _d(e){return Nd("dialog",e)}const ja=d.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,c=Hn(),u=wt(i);return c.useSyncedValueWithCleanup("titleElementId",u),Me("h2",t,{ref:n,props:[{id:u},a]})});function Jm(e){const t=d.useRef(""),n=d.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:d.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function cs(e,t){const n=d.useRef(e),r=de(t);ae(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function $m(e,t){const n=de((s,i)=>{(typeof e=="function"?e():e)||t(i||(Zo?"touch":""))}),{onClick:r,onPointerDown:o}=Jm(n);return d.useMemo(()=>({onClick:r,onPointerDown:o}),[r,o])}function Od(e){const[t,n]=d.useState(null),r=$m(e,n);return cs(e,o=>{o&&!e&&n(null)}),d.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Xm({...e}){return l.jsx(_d,{"data-slot":"sheet",...e})}function qm({...e}){return l.jsx(Ba,{"data-slot":"sheet-portal",...e})}function e0({className:e,...t}){return l.jsx(ca,{"data-slot":"sheet-overlay",className:he("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function t0({className:e,children:t,side:n="right",showCloseButton:r=!0,...o}){return l.jsxs(qm,{children:[l.jsx(e0,{}),l.jsxs(Ra,{"data-slot":"sheet-content","data-side":n,className:he("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...o,children:[t,r&&l.jsxs(Gr,{"data-slot":"sheet-close",render:l.jsx(Oe,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[l.jsx(Zi,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function n0({className:e,...t}){return l.jsx("div",{"data-slot":"sheet-header",className:he("flex flex-col gap-0.5 p-4",e),...t})}function r0({className:e,...t}){return l.jsx(ja,{"data-slot":"sheet-title",className:he("cn-font-heading text-base font-medium text-foreground",e),...t})}function o0({className:e,...t}){return l.jsx(ua,{"data-slot":"sheet-description",className:he("text-sm text-muted-foreground",e),...t})}function en({className:e,...t}){return l.jsx("div",{"data-slot":"skeleton",className:he("animate-pulse rounded-md bg-muted",e),...t})}const Hd=d.createContext(void 0);function Ur(e){const t=d.useContext(Hd);if(t===void 0&&!e)throw new Error(st(72));return t}const s0={...ka,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class i0 extends zr{constructor(t,n,r){const o=new Yr;super(a0(t,o,n,r),l0(o),s0)}setOpen=(t,n)=>{ym(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,Ce(Nn,t))}}function a0(e,t,n,r=!1){const o={...Ia(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return o.floatingRootContext=wd(t,n,r),o}function l0(e){return{popupRef:d.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const c0=ma(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:o,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:c,onOpenChangeComplete:u,handle:f,triggerId:h,defaultTriggerId:A=null,children:g}=t,p=yd((B,T)=>new i0({open:r,openProp:o,activeTriggerId:A,triggerIdProp:h},B,T));p.useControlledProp("openProp",o),p.useControlledProp("triggerIdProp",h),p.useContextCallback("onOpenChange",c),p.useContextCallback("onOpenChangeComplete",u);const x=p.useState("open"),m=!n&&x,v=p.useState("activeTriggerId"),b=p.useState("mounted"),y=p.useState("payload");p.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s,disabled:n}),va(p,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:C,transitionStatus:I}=ya(m,p),w=p.useState("isInstantPhase"),S=p.useState("instantType"),R=p.useState("lastOpenChangeReason"),E=d.useRef(null);ae(()=>{x&&n&&p.setOpen(!1,Ce(Eu))},[x,n,p]),ae(()=>{I==="ending"&&R===jt||I!=="ending"&&w?(S!=="delay"&&(E.current=S),p.set("instantType","delay")):E.current!==null&&(p.set("instantType",E.current),E.current=null)},[I,w,R,S,p]),ae(()=>{m&&v==null&&p.set("payload",void 0)},[p,v,m]),d.useImperativeHandle(a,()=>({unmount:C,close:()=>p.setOpen(!1,Ce(Hi))}),[C,p]);const k=m||b||!n&&i!=="none";return l.jsxs(Hd.Provider,{value:p,children:[f&&l.jsx(xa,{handle:f,store:p}),k&&l.jsx(u0,{store:p,disabled:n,trackCursorAxis:i}),typeof g=="function"?g({payload:y}):g]})});function u0({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),o=ns(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=bA(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=d.useMemo(()=>Ft(s.reference,o.reference),[s.reference,o.reference]);return Ca(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:o.floating??ct}),null}const d0=d.createContext(void 0);function f0(){return d.useContext(d0)}const ic=600,Ld="data-base-ui-tooltip-trigger";function ac(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const o=n[r];if(Te(o))return o}}const t=e.target;return Te(t)?t:null}function p0(e){let t=e;for(;t;){const n=t.closest(`[${Ld}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Te(r.host)?r.host:null}return null}const h0=bd(function(t,n){const{render:r,className:o,style:s,handle:i,payload:a,disabled:c,delay:u,closeOnClick:f=!0,closeDelay:h,id:A,...g}=t,p=Ur(!0),m=Ed(i)??p;if(!m)throw new Error(st(82));const v=wt(A),b=m.useState("isTriggerActive",v),y=m.useState("isOpenedByTrigger",v),C=m.useState("floatingRootContext"),I=d.useRef(null),w=u??ic,S=h??0,{registerTrigger:R,isMountedByThisTrigger:E}=Id(v,I,m,{payload:a,closeOnClick:f,closeDelay:S}),k=f0(),{delayRef:B,isInstantPhase:T,hasProvider:F}=oA(C,{open:y}),j=Sa(C);m.useSyncedValue("isInstantPhase",T);const D=m.useState("disabled"),H=c??D,_=et(H),P=m.useState("trackCursorAxis"),L=m.useState("disableHoverablePopup"),N=d.useRef(!1),M=pt(),O=d.useRef(void 0);function G(){return F?tr(B.current,"open")===0?0:u??k??ic:w}function Z(U){const ue=I.current;if(!ue||!U)return!1;const se=p0(U);return se!==null&&se!==ue&&ve(ue,se)}function J(U){const ue=Z(U);return N.current=ue,ue&&(j.openChangeTimeout.clear(),j.restTimeout.clear(),j.restTimeoutPending=!1,M.clear()),ue}const Q=Fd(C,{enabled:!H,mouseOnly:!0,move:!1,handleClose:!L&&P!=="both"?Md():null,restMs:G,delay(){return h==null&&F?{close:tr(B.current,"close")}:{close:S}},triggerElementRef:I,isActiveTrigger:b,isClosing:()=>m.select("transitionStatus")==="ending",shouldOpen(){return!N.current}}),$=Sd(C,{enabled:!H}).reference,K=U=>{const ue=N.current,se=ac(U),be=J(se),re=I.current,Ae=re&&se&&ve(re,se);if(be&&m.select("open")&&m.select("lastOpenChangeReason")===at){m.setOpen(!1,Ce(at,U));return}if(ue&&!be&&Ae&&!_.current&&!m.select("open")&&re&&xn(O.current)){const ie=()=>{!N.current&&!_.current&&!m.select("open")&&m.setOpen(!0,Ce(at,U,re))},oe=G();oe===0?(M.clear(),ie()):M.start(oe,ie)}},te=m.useState("triggerProps",E);return Me("button",t,{state:{open:y},ref:[n,R,I],props:[Q,$,E||P!=="none"?te:void 0,{onMouseOver(U){K(U.nativeEvent)},onFocus(U){Z(ac(U.nativeEvent))&&U.preventBaseUIHandler()},onMouseLeave(){N.current=!1,M.clear(),O.current=void 0},onPointerEnter(U){O.current=U.pointerType},onPointerDown(U){O.current=U.pointerType,m.set("closeOnClick",f),f&&!m.select("open")&&m.cancelPendingOpen(U.nativeEvent)},onClick(U){f&&!m.select("open")&&m.cancelPendingOpen(U.nativeEvent)},id:v,"data-trigger-disabled":H?"":void 0,[Ld]:H?void 0:""},g],stateAttributesMapping:$u})}),Kd=d.createContext(void 0);function g0(){const e=d.useContext(Kd);if(e===void 0)throw new Error(st(70));return e}const A0=d.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,style:a,...c}=t,{node:u,subtree:f}=sd({container:o,ref:n,componentProps:t,elementProps:c});return!f&&!u?null:l.jsxs(d.Fragment,{children:[f,u&&an.createPortal(r,u)]})}),m0=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return Ur().useState("mounted")||r?l.jsx(Kd.Provider,{value:r,children:l.jsx(A0,{ref:n,...o})}):null}),Wd=d.createContext(void 0);function Qd(){const e=d.useContext(Wd);if(e===void 0)throw new Error(st(71));return e}const x0=d.createContext(void 0);function us(){return d.useContext(x0)?.direction??"ltr"}const b0=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:f=0,offsetParent:h="real"}=vn(e,t)||{};if(u==null)return{};const A=_u(f),g={x:n,y:r},p=ra(o),x=na(p),m=await i.getDimensions(u),v=p==="y",b=v?"top":"left",y=v?"bottom":"right",C=v?"clientHeight":"clientWidth",I=s.reference[x]+s.reference[p]-g[p]-s.floating[x],w=g[p]-s.reference[p],S=h==="real"?await i.getOffsetParent?.(u):a.floating;let R=a.floating[C]||s.floating[x];(!R||!await i.isElement?.(S))&&(R=a.floating[C]||s.floating[x]);const E=I/2-w/2,k=R/2-m[x]/2-1,B=Math.min(A[b],k),T=Math.min(A[y],k),F=B,j=R-m[x]-T,D=R/2-m[x]/2+E,H=Nu(F,D,j),_=!c.arrow&&In(o)!=null&&D!==H&&s.reference[x]/2-(D<F?B:T)-m[x]/2<0,P=_?D<F?D-F:D-j:0;return{[p]:g[p]+P,data:{[p]:H,centerOffset:D-H-P,..._&&{alignmentOffset:P}},reset:_}}}),v0=(e,t)=>({...b0(e),options:[e,t]}),y0={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-n>=0||i.right-t>=0||i.bottom-n>=0||i.left-t>=0||s}}}},C0={sideX:"left",sideY:"top"},lc="--available-width",cc="--available-height";function Gd(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function uc(e,t,n){const{rects:r,placement:o}=e;return{side:Gd(t,Bt(o),n),align:In(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ma(e){return I0(e,Em)}function I0(e,t){const{anchor:n,positionMethod:r="absolute",side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,collisionBoundary:c,collisionPadding:u=5,sticky:f=!1,arrowPadding:h=5,disableAnchorTracking:A=!1,inline:g,keepMounted:p=!1,floatingRootContext:x,mounted:m,collisionAvoidance:v,shift:b,nodeId:y,adaptiveOrigin:C,lazyFlip:I=!1,externalTree:w}=e,[S,R]=d.useState(null);!m&&S!==null&&R(null);const E=v.side||"flip",k=v.align||"flip",B=v.fallbackAxisSide||"end",T=b?.crossAxis??!1,F=b?.rootBoundary,j=typeof n=="function"?n:void 0,D=de(j),H=j?D:n,_=et(n),P=et(m),N=us()==="rtl",M=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":N?"left":"right","inline-start":N?"right":"left"}[o],O=i==="center"?M:`${M}-${i}`;let G=u;typeof G=="number"?G={top:G,right:G,bottom:G,left:G}:G&&(G={top:G.top||0,right:G.right||0,bottom:G.bottom||0,left:G.left||0});const Z=1,J=o==="bottom"?Z:0,Q=o==="top"?Z:0,$=o==="right"?Z:0,K=o==="left"?Z:0,te={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:G},le=d.useRef(null),X=et(s),ee=et(a),U=typeof s!="function"?s:0,ue=typeof a!="function"?a:0,se=[];g&&se.push(g),se.push(tm(Ee=>{const Ve=uc(Ee,o,N),Ze=typeof X.current=="function"?X.current(Ve):X.current,Je=typeof ee.current=="function"?ee.current(Ve):ee.current;return{mainAxis:Ze,crossAxis:Je,alignmentAxis:Je}},[U,ue,N,o]));const be=k==="none"&&E!=="shift",re=!be&&(f||T||E==="shift"),Ae=E==="none"?null:om({...te,padding:{top:G.top+Z+J,right:G.right+Z+K,bottom:G.bottom+Z+Q,left:G.left+Z+$},mainAxis:!T&&E==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),ie=be?null:nm({...te,rootBoundary:F,mainAxis:k!=="none",crossAxis:re,limiter:f||T?void 0:rm(Ee=>{if(!le.current)return{};const{width:Ve,height:Ze}=le.current.getBoundingClientRect(),Je=Dt(Bt(Ee.placement)),rt=Je==="y"?Ve:Ze,it=Je==="y"?G.left+G.right:G.top+G.bottom;return{offset:rt/2+it/2}})},[te,f,T,F,G,k]);E==="shift"||k==="shift"||i==="center"?se.push(ie,Ae):se.push(Ae,ie),se.push(sm({...te,apply({elements:{floating:Ee},availableWidth:Ve,availableHeight:Ze,rects:Je}){if(!P.current)return;const rt=Ee.style;rt.setProperty(lc,`${Ve}px`),rt.setProperty(cc,`${Ze}px`);const it=ot(Ee).devicePixelRatio||1,{x:At,y:dt,width:xt,height:Mt}=Je.reference,$t=(Math.round((At+xt)*it)-Math.round(At*it))/it,Be=(Math.round((dt+Mt)*it)-Math.round(dt*it))/it;rt.setProperty("--anchor-width",`${$t}px`),rt.setProperty("--anchor-height",`${Be}px`)}}),v0(Ee=>({element:le.current||je(Ee.elements.floating).createElement("div"),padding:h,offsetParent:"floating"}),[h]),{name:"transformOrigin",fn(Ee){const{elements:Ve,middlewareData:Ze,placement:Je,rects:rt,y:it}=Ee,At=Bt(Je),dt=Dt(At),xt=le.current,Mt=Ze.arrow?.x||0,$t=Ze.arrow?.y||0,Be=xt?.clientWidth||0,ze=xt?.clientHeight||0,bt=Mt+Be/2,Et=$t+ze/2,St=Math.abs(Ze.shift?.y||0),Pt=rt.reference.height/2,Tt=typeof s=="function"?s(uc(Ee,o,N)):s,vt=St>Tt,un={top:`${bt}px calc(100% + ${Tt}px)`,bottom:`${bt}px ${-Tt}px`,left:`calc(100% + ${Tt}px) ${Et}px`,right:`${-Tt}px ${Et}px`}[At],En=`${bt}px ${rt.reference.y+Pt-it}px`;return Ve.floating.style.setProperty("--transform-origin",re&&dt==="y"&&vt?En:un),{}}},y0,C),ae(()=>{!m&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,x]);const oe=d.useMemo(()=>({elementResize:!A&&typeof ResizeObserver<"u",layoutShift:!A&&typeof IntersectionObserver<"u"}),[A]),{refs:ce,elements:me,x:ge,y:W,middlewareData:V,update:ye,placement:q,context:ne,isPositioned:ke,floatingStyles:Se}=t({rootContext:x,open:p?m:void 0,placement:O,middleware:se,strategy:r,whileElementsMounted:p?void 0:(...Ee)=>Yl(...Ee,oe),nodeId:y,externalTree:w}),{sideX:Qe,sideY:tt}=V.adaptiveOrigin||C0,Le=ke?r:"fixed",ht=d.useMemo(()=>{let Ee;return ke?C?Ee={position:Le,[Qe]:ge,[tt]:W}:Ee={...Se,position:Le}:Ee={position:Le,top:0,left:0},Ee[lc]="100vw",Ee[cc]="100vh",ke||(Ee.opacity=0),Ee},[C,Le,Qe,ge,tt,W,Se,ke]),Ke=d.useRef(null);ae(()=>{if(!m)return;const Ee=_.current,Ve=typeof Ee=="function"?Ee():Ee,Je=(dc(Ve)?Ve.current:Ve)||null||null;Je!==Ke.current&&(ce.setPositionReference(Je),Ke.current=Je)},[m,ce,H,_]),d.useEffect(()=>{if(!m)return;const Ee=_.current;typeof Ee!="function"&&dc(Ee)&&Ee.current!==Ke.current&&(ce.setPositionReference(Ee.current),Ke.current=Ee.current)},[m,ce,H,_]),d.useEffect(()=>{if(p&&m&&me.reference&&me.floating)return Yl(me.reference,me.floating,ye,oe)},[p,m,me,ye,oe]);const Ge=Bt(q),ut=Gd(o,Ge,N),Re=In(q)||"center",Ue=!!V.hide?.referenceHidden;ae(()=>{I&&m&&ke&&Ge!==M&&R(Ge)},[I,m,ke,Ge,M]);const _e=d.useMemo(()=>({position:"absolute",top:V.arrow?.y,left:V.arrow?.x}),[V.arrow]),nt=V.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:ht,arrowStyles:_e,arrowRef:le,arrowUncentered:nt,side:ut,align:Re,physicalSide:Ge,anchorHidden:Ue,refs:ce,context:ne,isPositioned:ke,update:ye}),[ht,_e,le,nt,ut,Re,Ge,Ue,ce,ne,ke,ye])}function dc(e){return e!=null&&"current"in e}function ds(e){return e==="starting"?uA:ct}function Pa(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),Me("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:c},ds(r),o],stateAttributesMapping:Qr})}const w0=d.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="top",align:c="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:h="clipping-ancestors",collisionPadding:A=5,arrowPadding:g=5,sticky:p=!1,disableAnchorTracking:x=!1,collisionAvoidance:m=nd,style:v,...b}=t,y=Ur(),C=g0(),I=y.useState("open"),w=y.useState("mounted"),S=y.useState("trackCursorAxis"),R=y.useState("disableHoverablePopup"),E=y.useState("floatingRootContext"),k=y.useState("instantType"),B=y.useState("transitionStatus"),T=y.useState("adaptiveOrigin"),F=Ma({anchor:s,positionMethod:i,floatingRootContext:E,mounted:w,side:a,sideOffset:u,align:c,alignOffset:f,collisionBoundary:h,collisionPadding:A,sticky:p,arrowPadding:g,disableAnchorTracking:x,keepMounted:C,collisionAvoidance:m,adaptiveOrigin:T}),j=d.useMemo(()=>({open:I,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:S!=="none"?"tracking-cursor":k}),[I,F.side,F.align,F.anchorHidden,S,k]),D=Pa(t,j,{styles:F.positionerStyles,transitionStatus:B,props:b,refs:[n,y.useStateSetter("positionerElement")],hidden:!w,inert:!I||S==="both"||R});return l.jsx(Wd.Provider,{value:F,children:D})}),k0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=Ur(),{side:c,align:u}=Qd(),f=a.useState("open"),h=a.useState("instantType"),A=a.useState("transitionStatus"),g=a.useState("popupProps"),p=a.useState("floatingRootContext"),x=a.useState("disabled"),m=a.useState("closeDelay");Ut({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),Dd(p,{enabled:!x,closeDelay:m});const v=a.useStateSetter("popupElement");return Me("div",t,{state:{open:f,side:c,align:u,instant:h,transitionStatus:A},ref:[n,a.context.popupRef,v],props:[ss,g,ds(A),i],stateAttributesMapping:la})}),E0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=Ur(),{arrowRef:c,side:u,align:f,arrowUncentered:h,arrowStyles:A}=Qd(),g=a.useState("open"),p=a.useState("instantType");return Me("div",t,{state:{open:g,side:u,align:f,uncentered:h,instant:p},ref:[n,c],props:[{style:A,"aria-hidden":!0},i],stateAttributesMapping:Qr})});function S0(e){const[t,n]=d.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function fs({...e}){return l.jsx(c0,{"data-slot":"tooltip",...e})}function ps({...e}){return l.jsx(h0,{"data-slot":"tooltip-trigger",...e})}function hs({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:s,...i}){return l.jsx(m0,{children:l.jsx(w0,{align:r,alignOffset:o,side:t,sideOffset:n,className:"isolate z-50",children:l.jsxs(k0,{"data-slot":"tooltip-content",className:he("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background 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-sm 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",e),...i,children:[s,l.jsx(E0,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const R0="sidebar_state",D0=3600*24*7,F0="16rem",B0="18rem",j0="3rem",M0="b",zd=d.createContext(null);function gs(){const e=d.useContext(zd);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function P0({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:s,...i}){const a=Vg(),[c,u]=d.useState(!1),[f,h]=d.useState(e),A=t??f,g=d.useCallback(v=>{const b=typeof v=="function"?v(A):v;n?n(b):h(b),document.cookie=`${R0}=${b}; path=/; max-age=${D0}`},[n,A]),p=d.useCallback(()=>a?u(v=>!v):g(v=>!v),[a,g,u]);d.useEffect(()=>{const v=b=>{b.key===M0&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),p())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[p]);const x=A?"expanded":"collapsed",m=d.useMemo(()=>({state:x,open:A,setOpen:g,isMobile:a,openMobile:c,setOpenMobile:u,toggleSidebar:p}),[x,A,g,a,c,u,p]);return l.jsx(zd.Provider,{value:m,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":F0,"--sidebar-width-icon":j0,...o},className:he("group/sidebar-wrapper flex h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...i,children:s})})}function T0({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,dir:s,...i}){const{isMobile:a,state:c,openMobile:u,setOpenMobile:f}=gs();return n==="none"?l.jsx("div",{"data-slot":"sidebar",className:he("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...i,children:o}):a?l.jsx(Xm,{open:u,onOpenChange:f,...i,children:l.jsxs(t0,{dir:s,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":B0},side:e,children:[l.jsxs(n0,{className:"sr-only",children:[l.jsx(r0,{children:"Sidebar"}),l.jsx(o0,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):l.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[l.jsx("div",{"data-slot":"sidebar-gap",className:he("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:he("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:o})})]})}function N0({className:e,...t}){const{toggleSidebar:n}=gs();return l.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:he("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function _0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:he("flex flex-col gap-2 p-2",e),...t})}function O0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:he("flex flex-col gap-2 p-2",e),...t})}function H0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:he("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function L0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:he("relative flex w-full min-w-0 flex-col p-2",e),...t})}function K0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:he("w-full text-sm",e),...t})}function Ws({className:e,...t}){return l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:he("flex w-full min-w-0 flex-col gap-0",e),...t})}function ao({className:e,...t}){return l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:he("group/menu-item relative",e),...t})}const W0=Ti("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Er({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:s,...i}){const{isMobile:a,state:c}=gs(),u=Ru({defaultTagName:"button",props:Ft({className:he(W0({variant:n,size:r}),s)},i),render:o?l.jsx(ps,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return o?(typeof o=="string"&&(o={children:o}),l.jsxs(fs,{children:[u,l.jsx(hs,{side:"right",align:"center",hidden:c!=="collapsed"||a,...o})]})):u}const Yd=d.createContext(void 0);function Ud(e){const t=d.useContext(Yd);if(t===void 0&&!e)throw new Error(st(33));return t}const Vd=d.createContext(void 0);function ar(e){const t=d.useContext(Vd);if(t===void 0&&!e)throw new Error(st(36));return t}const Q0=d.createContext(void 0);function Ta(e=!0){const t=d.useContext(Q0);if(t===void 0&&!e)throw new Error(st(25));return t}function G0(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:o,store:s,typingRef:i,itemRef:a,itemMetadata:c}=e,{events:u}=s.useState("floatingTreeRoot"),f=s.useState("open"),h=Ta(!0),A=h!==void 0;return d.useMemo(()=>({id:r,role:"menuitem",tabIndex:f&&n?0:-1,onKeyDown(g){g.key===" "&&i?.current&&g.preventDefault()},onMouseMove(g){o&&u.emit("itemhover",{nodeId:o,target:g.currentTarget})},onClick(g){t&&u.emit("close",{domEvent:g,reason:Ir})},onMouseUp(g){if(h){const p=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,A&&p&&Math.abs(g.clientX-p.x)<=1&&Math.abs(g.clientY-p.y)<=1||A&&!Ji&&g.button===2)return}a.current&&s.context.allowMouseUpTriggerRef.current&&(!A||g.button===2)&&c.type==="regular-item"&&Li(a.current,g,{detail:1})}}),[t,n,r,u,o,f,s,i,a,h,A,c])}const z0={type:"regular-item"};function Y0(e){const{closeOnClick:t,disabled:n,highlighted:r,id:o,store:s,typingRef:i=s.context.typingRef,nativeButton:a,itemMetadata:c,nodeId:u}=e,f=d.useRef(null),{getButtonProps:h,buttonRef:A}=Yt({disabled:n,focusableWhenDisabled:!0,native:a,composite:!0}),g=G0({closeOnClick:t,highlighted:r,id:o,nodeId:u,store:s,typingRef:i,itemRef:f,itemMetadata:c}),p=d.useCallback(m=>Ft(g,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()}},m,h),[g,h,c]),x=zt(f,A);return d.useMemo(()=>({getItemProps:p,itemRef:x}),[p,x])}const Zd=d.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function U0(){return d.useContext(Zd)}function As(e={}){const{guess:t,label:n,metadata:r,textRef:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:c,nextIndexRef:u}=U0(),f=d.useRef(-1),[h,A]=d.useState(s==null&&t?()=>{if(f.current===-1){const m=u.current;u.current+=1,f.current=m}return f.current}:-1),g=s??h,p=d.useRef(null),x=d.useCallback(m=>{const v=p.current;v&&a(v),p.current=m,m&&i(m,{metadata:r??null,index:s??null,label:n,textRef:o})},[s,i,a,r,n,o]);return ae(()=>{if(s==null)return c(m=>{const v=p.current?m.get(p.current)?.index:null;v!=null&&A(v)})},[s,c]),{ref:x,index:g}}const V0=d.forwardRef(function(t,n){const{render:r,className:o,id:s,label:i,nativeButton:a=!1,disabled:c=!1,closeOnClick:u=!0,style:f,...h}=t,A=As({guess:!0,label:i}),g=Ud(!0),p=wt(s),{store:x}=ar(),m=x.useState("disabled"),v=c||m,b=x.useState("isActive",A.index),y=x.useState("itemProps"),{getItemProps:C,itemRef:I}=Y0({closeOnClick:u,disabled:v,highlighted:b,id:p,store:x,nativeButton:a,nodeId:g?.context.nodeId,itemMetadata:z0});return Me("div",t,{state:{disabled:v,highlighted:b},props:[y,h,C],ref:[I,n,A.ref]})}),Z0=d.createContext(void 0);function Na(e){return d.useContext(Z0)}const J0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c}=ar(),{side:u,align:f}=Ud(),h=Na()!=null,A=c.useState("open"),g=c.useState("transitionStatus"),p=c.useState("popupProps"),x=c.useState("mounted"),m=c.useState("instantType"),v=c.useState("activeTriggerElement"),b=c.useState("parent"),y=c.useState("lastOpenChangeReason"),C=c.useState("rootId"),I=c.useState("floatingRootContext"),w=c.useState("floatingTreeRoot"),S=c.useState("closeDelay"),R=c.useState("hoverEnabled"),E=c.useState("disabled"),k=c.useState("openMethod"),B=b.type==="context-menu";Ut({open:A,ref:c.context.popupRef,onComplete(){A&&c.context.onOpenChangeComplete?.(!0)}}),d.useEffect(()=>{function H(_){c.setOpen(!1,Ce(_.reason,_.domEvent))}return w.events.on("close",H),()=>{w.events.off("close",H)}},[w.events,c]),Dd(I,{enabled:R&&!E&&!B&&b.type!=="menubar",closeDelay:S});const T=c.useStateSetter("popupElement"),F={transitionStatus:g,side:u,align:f,open:A,nested:b.type==="menu",instant:m},j=Me("div",t,{state:F,ref:[n,c.context.popupRef,T],stateAttributesMapping:la,props:[p,{onKeyDown(H){h&&as.has(H.key)&&H.stopPropagation()}},ds(g),a,{"data-rootownerid":C}]});let D=b.type===void 0||B;return(v||b.type==="menubar"&&y!==Go)&&(D=!0),l.jsx(ga,{context:I,openInteractionType:k,modal:B,disabled:!x,returnFocus:i===void 0?D:i,initialFocus:b.type!=="menu",restoreFocus:!0,externalTree:b.type!=="menubar"?w:void 0,previousFocusableElement:v,nextFocusableElement:b.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:b.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:j})}),Jd=d.createContext(void 0);function $0(){const e=d.useContext(Jd);if(e===void 0)throw new Error(st(32));return e}const X0=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=ar();return s.useState("mounted")||r?l.jsx(Jd.Provider,{value:r,children:l.jsx(fa,{ref:n,...o})}):null});function Vr(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=de(o),[,i]=d.useState(!1),a=Rt(ex).current,c=Rt(q0).current,u=d.useRef(0),f=d.useRef(!0),h=d.useRef([]),A=d.useRef(null),g=de(()=>{f.current||(f.current=!0,i(I=>!I))}),p=de((I,w)=>{c.set(I,w),g()}),x=de(I=>{c.delete(I),g()}),m=de(I=>{const w=new Map;return n.current.length=0,r&&(r.current.length=0),I.forEach(S=>{w.set(S.element,{...S.registration.metadata??{},index:S.index}),n.current[S.index]=S.element,r&&(r.current[S.index]=S.registration.label!==void 0?S.registration.label:S.registration.textRef?.current?.textContent??S.element.textContent)}),u.current=n.current.length,w});function v(I){if(A.current?.disconnect(),A.current=null,typeof MutationObserver!="function"||I.length<2)return;const w=new MutationObserver(R=>{if(!rx(R))return;let E=null;for(const k of I)if(k.isConnected){if(E&&$d(E,k)>0){w.disconnect(),g();return}E=k}});A.current=w;const S=new Set;for(let R=1;R<I.length;R+=1){const E=nx(I[R-1],I[R]);E&&S.add(E)}S.forEach(R=>w.observe(R,{childList:!0}))}const b=de(()=>{const[I,w]=tx(c),S=m(I);v(w),h.current=I,f.current=!1,a.forEach(R=>R(S)),s(S)});ae(()=>(f.current||m(h.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,m]),ae(()=>{f.current&&b()}),ae(()=>()=>{A.current?.disconnect(),f.current=!0},[]);const y=de(I=>(a.add(I),()=>{a.delete(I)})),C=d.useMemo(()=>({register:p,unregister:x,subscribeMapChange:y,nextIndexRef:u}),[p,x,y,u]);return l.jsx(Zd.Provider,{value:C,children:t})}function q0(){return new Map}function ex(){return new Set}function tx(e){const t=new Set,n=[],r=[];e.forEach((s,i)=>{if(!i.isConnected)return;const a=s.index,c={index:a??-1,element:i,registration:s};a===null?r.push(c):a>=0&&(t.add(a),n.push(c))});let o=0;return r.sort((s,i)=>$d(s.element,i.element)),r.forEach(s=>{for(;t.has(o);)o+=1;s.index=o,n.push(s),o+=1}),t.size>0&&n.sort((s,i)=>s.index-i.index),[n,r.map(s=>s.element)]}function nx(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function rx(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function $d(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const ox=20;function Xd(e,t,n,r){const[o,s]=d.useState(!1);ae(()=>{if(!e||!t||n==null){s(!1);return}const i=je(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-ox)},[e,t,n]),Td(e&&(!t||o),r)}const sx=d.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:a,align:c,sideOffset:u=0,alignOffset:f=0,collisionBoundary:h="clipping-ancestors",collisionPadding:A=5,arrowPadding:g=5,sticky:p=!1,disableAnchorTracking:x=!1,collisionAvoidance:m=td,style:v,...b}=t,{store:y}=ar(),C=$0(),I=Ta(!0),w=y.useState("parent"),S=y.useState("floatingRootContext"),R=y.useState("floatingTreeRoot"),E=y.useState("mounted"),k=y.useState("open"),B=y.useState("modal"),T=y.useState("openMethod"),F=y.useState("activeTriggerElement"),j=y.useState("transitionStatus"),D=y.useState("positionerElement"),H=y.useState("instantType"),_=y.useState("adaptiveOrigin"),P=y.useState("lastOpenChangeReason"),L=y.useState("floatingNodeId"),N=y.useState("floatingParentNodeId"),M=S.useState("domReferenceElement"),O=d.useRef(null),G=aa(D);let Z=r,J=u,Q=f,$=c,K=m;w.type==="context-menu"&&(Z=r??w.context?.anchor,$=$??"start",!a&&$!=="center"&&(Q=t.alignOffset??2,J=t.sideOffset??-5));let te=a,le=$;w.type==="menu"?(te=te??"inline-end",le=le??"start",K=t.collisionAvoidance??nd):w.type==="menubar"&&(te=te??(w.context.orientation==="vertical"?"inline-end":"bottom"),le=le??"start");const X=w.type==="context-menu",ee=Ma({anchor:Z,floatingRootContext:S,positionMethod:I?"fixed":o,mounted:E,side:te,sideOffset:J,align:le,alignOffset:Q,arrowPadding:X?0:g,collisionBoundary:h,collisionPadding:A,sticky:p,nodeId:L,keepMounted:C,disableAnchorTracking:x,collisionAvoidance:K,shift:X?{crossAxis:!("side"in K&&K.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:R,adaptiveOrigin:_});d.useEffect(()=>{function oe(ce){ce.open&&(ce.parentNodeId===L&&y.set("hoverEnabled",!1),ce.nodeId!==L&&ce.parentNodeId===y.select("floatingParentNodeId")&&y.setOpen(!1,Ce(br)))}return R.events.on("menuopenchange",oe),()=>{R.events.off("menuopenchange",oe)}},[y,R.events,L]),d.useEffect(()=>{if(y.select("floatingParentNodeId")==null)return;function oe(ce){if(ce.open||ce.nodeId!==y.select("floatingParentNodeId"))return;const me=ce.reason??br;y.setOpen(!1,Ce(me))}return R.events.on("menuopenchange",oe),()=>{R.events.off("menuopenchange",oe)}},[R.events,y]);const U=pt();d.useEffect(()=>{k||U.clear()},[k,U]),d.useEffect(()=>{function oe(ce){if(!(!k||ce.nodeId!==y.select("floatingParentNodeId")))if(ce.target&&F&&F!==ce.target){const me=y.select("closeDelay");me>0?U.isStarted()||U.start(me,()=>{y.setOpen(!1,Ce(br))}):y.setOpen(!1,Ce(br))}else U.clear()}return R.events.on("itemhover",oe),()=>{R.events.off("itemhover",oe)}},[R.events,k,F,y,U]),d.useEffect(()=>{const oe={open:k,nodeId:L,parentNodeId:N,reason:y.select("lastOpenChangeReason")};R.events.emit("menuopenchange",oe)},[R.events,k,y,L,N]),ae(()=>{const oe=M,ce=O.current;if(oe&&(O.current=oe),ce&&oe&&oe!==ce){y.set("instantType",void 0);const me=new AbortController;return G(()=>{y.set("instantType","trigger-change")},me.signal),()=>{me.abort()}}},[M,G,y]);const ue={open:k,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,nested:w.type==="menu",instant:H},se=w.type==="menubar"&&w.context.modal;Xd(k&&(se||B&&P!==at),T==="touch",D,F);const re=Pa(t,ue,{styles:ee.positionerStyles,transitionStatus:j,props:b,refs:[n,y.useStateSetter("positionerElement")],hidden:!E,inert:!k}),Ae=E&&w.type!=="menu"&&(w.type!=="menubar"&&B&&P!==at||w.type==="menubar"&&w.context.modal);let ie=null;return w.type==="menubar"?ie=w.context.contentElement:w.type===void 0&&(ie=F),l.jsxs(Yd.Provider,{value:ee,children:[Ae&&l.jsx(Fa,{ref:w.type==="context-menu"||w.type==="nested-context-menu"?w.context.internalBackdropRef:null,inert:Da(!k),cutout:ie}),l.jsx(hA,{id:L,children:l.jsx(Vr,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:re})})]})}),ix=d.createContext(null);function qd(e){return d.useContext(ix)}const ax={...ka,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class lx extends zr{constructor(t){super({...ux(),...t},cx(),ax),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),o=n.store.select("floatingTreeRoot"),s=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const i=n.store.select("rootId"),a=n.store.select("floatingTreeRoot"),c=n.store.select("keyboardEventRelay");r===i&&o===a&&s===c||(r=i,o=a,s=c,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}unsubscribeParentListener=null}function cx(){return{positionerRef:d.createRef(),popupRef:d.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),onOpenChangeComplete:void 0,triggerElements:new Yr}}function ux(){return{...Ia(),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 pa,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ct,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}const dx=d.createContext(void 0);function fx(){return d.useContext(dx)}const px=ma(function(t){const{children:n,open:r,onOpenChange:o,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:a=!1,modal:c,loopFocus:u=!0,orientation:f="vertical",actionsRef:h,closeParentOnEsc:A=!1,handle:g,triggerId:p,defaultTriggerId:x=null,highlightItemOnHover:m=!0}=t,v=Ta(!0),b=ar(!0),y=qd(!0),C=fx(),I=d.useMemo(()=>C&&b?{type:"menu",store:b.store}:y?{type:"menubar",context:y}:v&&!b?{type:"context-menu",context:v}:{type:void 0},[v,b,y,C]),w=hx({open:i,openProp:r,activeTriggerId:x,triggerIdProp:p,parent:I});w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",p),w.useContextCallback("onOpenChangeComplete",s);const S=$n(),R=$n(),E=w.useState("floatingTreeRoot"),k=cd(E),B=wn(),T=w.useState("open"),F=w.useState("activeTriggerElement"),j=w.useState("positionerElement"),D=w.useState("hoverEnabled"),H=w.useState("disabled"),_=w.useState("lastOpenChangeReason"),P=w.useState("parent"),L=w.useState("activeIndex"),N=w.useState("payload"),M=w.useState("floatingParentNodeId"),O=d.useRef(null),G=d.useRef(P.type!=="context-menu"),Z=pt(),J=d.useRef(!0),Q=pt(),$=M!=null,{openMethod:K,triggerProps:te}=Od(T);w.useSyncedValues({disabled:a,highlightItemOnHover:m,modal:P.type===void 0?c:void 0,openMethod:K,rootId:S}),va(w);const{forceUnmount:le}=ya(T,w,()=>{w.set("allowMouseEnter",!1)});ae(()=>{v&&!b?w.update({parent:{type:"context-menu",context:v},floatingNodeId:k,floatingParentNodeId:B}):b&&w.update({floatingNodeId:k,floatingParentNodeId:B})},[v,b,k,B,w]),d.useEffect(()=>{if(T||(O.current=null),P.type==="context-menu"){if(!T){Z.clear(),G.current=!1;return}Z.start(500,()=>{G.current=!0})}},[Z,T,P.type]),ae(()=>{!T&&!D&&w.set("hoverEnabled",!0)},[T,D,w]);const X=de((ne,ke)=>{const Se=ke.reason;if(!ne&&!w.select("open")||T===ne&&ke.trigger===F&&_===Se)return;const Qe=Cd(ke);if(!ne&&ke.trigger==null&&(ke.trigger=F??void 0),o?.(ne,ke),ke.isCanceled)return;w.state.floatingRootContext.dispatchOpenChange(ne,ke);const tt=ke.event;if(ne===!1&&tt?.type==="click"&&tt.pointerType==="touch"&&!J.current)return;ne&&Se===Yn?(J.current=!1,Q.start(300,()=>{J.current=!0})):(J.current=!0,Q.clear());const Le=(Se===Nn||Se===Ir)&&tt.detail===0,ht=!ne&&(Se===zo||Se==null),Ke={open:ne,openChangeReason:Se};O.current=ke.event,ba(Ke,ne,ke.trigger,Qe()),w.update(Ke),P.type==="menubar"&&(Se===Yn||Se===Mn||Se===at||Se===ii||Se===br)?w.set("instantType","group"):Le||ht?w.set("instantType",Le?"click":"dismiss"):w.set("instantType",void 0)}),ee=vd({popupStore:w,floatingId:R,nested:B!=null,onOpenChange:X}),U=ee.context.events;ae(()=>{const ne=({open:ke,eventDetails:Se})=>X(ke,Se);return U.on("setOpen",ne),()=>{U?.off("setOpen",ne)}},[U,X]);const ue=d.useCallback(()=>{w.setOpen(!1,Ce(Hi))},[w]);d.useImperativeHandle(h,()=>({unmount:le,close:ue}),[le,ue]);let se;P.type==="context-menu"&&(se=P.context),d.useImperativeHandle(se?.positionerRef,()=>j,[j]),d.useImperativeHandle(se?.actionsRef,()=>({setOpen:X}),[X]);const be=ns(ee,{enabled:!H,bubbles:{escapeKey:A&&P.type==="menu"},outsidePress(){return P.type!=="context-menu"||O.current?.type==="contextmenu"?!0:G.current},externalTree:$?E:void 0}),re=us(),Ae=d.useCallback(ne=>{w.select("activeIndex")!==ne&&w.set("activeIndex",ne)},[w]),ie=Bd(ee,{enabled:!H,listRef:w.context.itemDomElements,activeIndex:L,nested:P.type!==void 0,loopFocus:u,orientation:f,parentOrientation:P.type==="menubar"?P.context.orientation:void 0,rtl:re==="rtl",disabledIndices:Ot,onNavigate:Ae,openOnArrowKeyDown:P.type!=="context-menu",externalTree:$?E:void 0,focusItemOnHover:m}),oe=d.useCallback(ne=>{w.context.typingRef.current=ne},[w]),ce=jd(ee,{enabled:!H,listRef:w.context.itemLabels,elementsRef:w.context.itemDomElements,activeIndex:L,resetMs:lA,onMatch:ne=>{T&&ne!==L&&w.set("activeIndex",ne)},onTyping:oe}),me=d.useMemo(()=>{const ne=Ft(ce.reference,ie.reference,be.reference,{onMouseMove(){w.set("allowMouseEnter",!0)}},te);return ne["aria-haspopup"]="menu",ne["aria-expanded"]=T,ne},[w,ce.reference,ie.reference,be.reference,te,T]),ge=d.useMemo(()=>{const ne=Ft(ie.trigger,be.trigger,te);return ne["aria-haspopup"]="menu",ne["aria-expanded"]=!1,ne},[ie.trigger,be.trigger,te]),W=d.useMemo(()=>Ft(ss,{id:R,role:"menu","aria-labelledby":F?.id,onMouseMove(){w.set("allowMouseEnter",!0),P.type==="menu"&&w.set("hoverEnabled",!1)},onClick(){w.select("hoverEnabled")&&w.set("hoverEnabled",!1)},onKeyDown(ne){const ke=w.select("keyboardEventRelay");ke&&!ne.isPropagationStopped()&&ke(ne)}},ce.floating,ie.floating,be.floating),[F,R,P.type,w,ce.floating,ie.floating,be.floating]),V=ie.item??ct;Ca(w,{floatingRootContext:ee,activeTriggerProps:me,inactiveTriggerProps:ge,popupProps:W,itemProps:V});const ye=d.useMemo(()=>({store:w,parent:I}),[w,I]),q=l.jsxs(Vd.Provider,{value:ye,children:[g&&l.jsx(xa,{handle:g,store:w}),typeof n=="function"?n({payload:N}):n]});return P.type===void 0||P.type==="context-menu"?l.jsx(gA,{externalTree:E,children:q}):q});function hx(e){return Rt(()=>new lx(e)).current}const lo=5;function ef(e,t){const n=gx(t);return e.clientX>=n.left-lo&&e.clientX<=n.right+lo&&e.clientY>=n.top-lo&&e.clientY<=n.bottom+lo}function gx(e){const t=e.getBoundingClientRect(),n=ot(e);if($i)return t;const r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||o.content!=="none"))return t;const i=parseFloat(r.width)||0,a=parseFloat(r.height)||0,c=parseFloat(o.width)||0,u=parseFloat(o.height)||0,f=Math.max(t.width,i,c),h=Math.max(t.height,a,u),A=f-t.width,g=h-t.height;return{left:t.left-A/2,right:t.right+A/2,top:t.top-g/2,bottom:t.bottom+g/2}}function tf(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ki(),{ref:o,index:s}=As(e),i=n===s,a=d.useRef(null),c=zt(o,a);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(s)},onMouseMove(){const f=a.current;if(!t||!f)return;const h=f.hasAttribute("disabled")||f.ariaDisabled==="true";!i&&!h&&f.focus()}},compositeRef:c,index:s}}function nf(e){const{render:t,className:n,style:r,state:o=ct,props:s=Ot,refs:i=Ot,metadata:a,stateAttributesMapping:c,tag:u="div",...f}=e,{compositeProps:h,compositeRef:A}=tf({metadata:a});return Me(u,e,{state:o,ref:[A,...i],props:[h,...s,f],stateAttributesMapping:c})}function rf(e){if($e(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Bn(e))return rf(Xn(e))}function Ax(e,t){const n=d.useRef(null);function r(s){an.flushSync(()=>{e.setOpen(!1,Ce(Mn,s.nativeEvent,s.currentTarget))}),_g(n.current)?.focus()}function o(s){const i=e.select("positionerElement");if(i&&Un(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{an.flushSync(()=>{e.setOpen(!1,Ce(Mn,s.nativeEvent,s.currentTarget))});let a=Ng(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&ve(i,a);){const c=a;if(a=sa(a),a===c)break}a?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:o}}function mx(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,o=d.useRef(!1);return d.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!r||n==="close"&&r)&&(o.current=!0,je(s.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:s=>{o.current&&(o.current=!1,s.preventBaseUIHandler())}}:ct,[t,n,r])}const xx=bd(function(t,n){const{render:r,className:o,style:s,disabled:i=!1,nativeButton:a=!0,id:c,openOnHover:u,delay:f=100,closeDelay:h=0,handle:A,payload:g,...p}=t,x=ar(!0),v=Ed(A)??x?.store;if(!v)throw new Error(st(85));const b=wt(c),y=v.useState("isTriggerActive",b),C=v.useState("floatingRootContext"),I=v.useState("isOpenedByTrigger",b),w=v.useState("triggerPopupId",b),S=d.useRef(null),R=vx(),E=Ki(!0),k=kn(),B=d.useMemo(()=>k??new pa,[k]),T=cd(B),F=wn(),{registerTrigger:j,isMountedByThisTrigger:D}=Id(b,S,v,{payload:g,closeDelay:h,parent:R,floatingTreeRoot:B,floatingNodeId:T,floatingParentNodeId:F,keyboardEventRelay:E?.relayKeyboardEvent}),H=R.type==="menubar",_=v.useState("disabled"),P=i||_||H&&R.context.disabled,{getButtonProps:L,buttonRef:N}=Yt({disabled:P,native:a});d.useEffect(()=>{!I&&R.type===void 0&&(v.context.allowMouseUpTriggerRef.current=!1)},[v,I,R.type]);const M=d.useRef(null),O=pt(),G=de(oe=>{if(!M.current)return;O.clear(),v.context.allowMouseUpTriggerRef.current=!1;const ce=oe.target;ve(M.current,ce)||ve(v.select("positionerElement"),ce)||ce===M.current||ce!=null&&rf(ce)===v.select("rootId")||ef(oe,M.current)||B.events.emit("close",{domEvent:oe,reason:Su})});d.useEffect(()=>{I&&v.select("lastOpenChangeReason")===at&&je(M.current).addEventListener("mouseup",G,{once:!0})},[I,G,v]);const Z=H&&R.context.hasSubmenuOpen,Q=Fd(C,{enabled:(u??Z)&&!P&&(!H||Z&&!D),handleClose:Md({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:R.type===void 0?f:void 0,delay:{close:h},triggerElementRef:S,externalTree:B,isActiveTrigger:y,isClosing:()=>v.select("transitionStatus")==="ending"}),$=bx(I,v.select("lastOpenChangeReason")),K=ud(C,{enabled:!P,event:I&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:R.type===void 0?$:!1}),te=Sd(C,{enabled:!P&&Z}),le=mx({open:I,enabled:H,mouseDownAction:"open"}),X=d.useMemo(()=>Ft(te.reference,K.reference),[te.reference,K.reference]),ee=v.useState("triggerProps",D),{preFocusGuardRef:U,handlePreFocusGuardFocus:ue,handleFocusTargetFocus:se}=Ax(v,S),be={disabled:P,open:I},re=[M,n,N,j,S],Ae=[X,Q??ct,ee,{"aria-haspopup":"menu","aria-controls":w,id:b,onMouseDown:oe=>{if(v.select("open"))return;O.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),je(oe.currentTarget).addEventListener("mouseup",G,{once:!0})}},H?{role:"menuitem"}:{},le,p,L],ie=Me("button",t,{enabled:!H,stateAttributesMapping:hi,state:be,ref:re,props:Ae});return H?l.jsx(nf,{tag:"button",render:r,className:o,style:s,state:be,refs:re,props:Ae,stateAttributesMapping:hi}):I?l.jsxs(d.Fragment,{children:[l.jsx(nr,{ref:U,onFocus:ue},`${b}-pre-focus-guard`),l.jsx(d.Fragment,{children:ie},b),l.jsx(nr,{ref:v.context.triggerFocusTargetRef,onFocus:se},`${b}-post-focus-guard`)]}):l.jsx(d.Fragment,{children:ie},b)});function bx(e,t){const n=pt(),[r,o]=d.useState(!1);return ae(()=>{e&&t===at?(o(!0),n.start(cA,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}function vx(){const e=qd();return d.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}function of(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function Mo({...e}){return l.jsx(px,{"data-slot":"dropdown-menu",...e})}function Po({...e}){return l.jsx(xx,{"data-slot":"dropdown-menu-trigger",...e})}function To({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:o,...s}){return l.jsx(X0,{children:l.jsx(sx,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:l.jsx(J0,{"data-slot":"dropdown-menu-content",className:he("cn-menu-target cn-menu-translucent 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 ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...s})})})}function No({className:e,inset:t,variant:n="default",...r}){return l.jsx(V0,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:he("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}const _o=["zh-CN","ja","ko","en","ar","fr","es","de","ru"],yx=["ar"],sf=e=>yx.includes(e)?"rtl":"ltr",Cx=e=>({"zh-CN":"简体中文",ja:"日本語",ko:"한국어",en:"English",ar:"العربية",fr:"Français",es:"Español",de:"Deutsch",ru:"Русский"})[e],Ix=e=>{for(const t of e){const n=t.toLowerCase(),r=_o.find(i=>i.toLowerCase()===n);if(r!==void 0)return r;const o=n.split("-")[0],s=_o.find(i=>i.toLowerCase().split("-")[0]===o);if(s!==void 0)return s;if(o==="zh")return"zh-CN"}return"en"},Xt={nav:{add:"Add",applications:"Applications",help:"Help Center"},shell:{product:"create-opentray",toggleSidebar:"Toggle Sidebar"},common:{loading:"Loading…",error:"Something went wrong.",retry:"Retry",cancel:"Cancel",confirm:"Confirm",close:"Close",copy:"Copy",copied:"Copied",download:"Download",refresh:"Refresh",empty:"Nothing here yet."},theme:{title:"Theme",system:"System",light:"Light",dark:"Dark"},language:{title:"Language"},applications:{title:"Applications",statusHealthy:"Healthy",statusInvalidConfig:"Invalid config",statusIncompatible:"Incompatible version",statusMissingPayload:"Missing payload",statusBrokenLink:"Broken link",statusRunning:"Running",edit:"Edit",open:"Open",share:"Share",details:"Details",source:"Source",sourceWizard:"Wizard",sourceRegistered:"Registered",detailsCommand:"Command",detailsCwd:"Working directory",detailsEnv:"Environment keys",detailsPm:"Package manager",detailsWindow:"Window",detailsDevMode:"Developer mode",detailsProjectDir:"Project directory",detailsServiceHint:"Service port hint",uninstall:"Uninstall",uninstallTitle:"Uninstall application?",uninstallDescription:"The registration and its payload link are removed. Dock/taskbar pins must be removed manually.",uninstallWizardDescription:"The wizard project directory and its materialized app bundle are removed after stopping a running entry when authorized. Dock/taskbar pins must be removed manually.",stopRunningTitle:"Force stop and uninstall?",stopRunningDescription:"The application is still running (likely a leftover from an earlier session). Continuing terminates its process tree first, then removes the project.",stopRunningConfirm:"Force stop and uninstall",stopRunningPids:"Running pids",uninstallPurge:"Also delete the linked external target",uninstallPurgeHint:"Deletes the external directory itself after identity revalidation. This cannot be undone.",uninstallPinHint:"macOS Dock pins and Windows taskbar pins are user-managed; remove them manually if present.",emptyHint:"No applications yet — create one from Add.",payload:"Payload",registration:"Registration",linked:"Linked",uninstallRetained:"External target retained:",uninstallDeleted:"External target deleted:"},help:{title:"Help Center",listTitle:"Documents",empty:"No documents available.",readError:"This document could not be read."},export:{title:"Export",shareTitle:"Share application",shareSubtitle:"Built from the current wizard parameters — nothing runs, nothing is written.",command:"Direct command",scriptSh:"Shell script (.sh)",scriptPs1:"PowerShell script (.ps1)",copyCommand:"Copy command",downloadScript:"Download script",downloadFile:"Download file",viewFull:"View full content",building:"Building…",inlineIcon:"Inline icon bytes",inlineIconHint:"Web-scraped icons share as their original URL by default and local icons embed their bytes; toggle to switch between embedding and sharing by reference.",forceCopy:"Force direct copy with embedded icon",forceCopyHint:"Uploaded icons embed as very long data URLs. Scripts are the default; check this only if you accept the length.",envAck:"I reviewed the environment values and accept exporting them",envAckHint:"This application defines environment entries. Complete export includes their values.",envReview:"Environment values (editable before export)",blocked:"Export blocked:"}},dn=(e,t)=>{const n=(r,o)=>{if(typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof o=="object"&&o!==null){const s={...r};for(const[i,a]of Object.entries(o))a!==void 0&&(s[i]=n(r[i],a));return s}return o===void 0?r:o};return n(e,t)},wx={shell:{product:"create-opentray",toggleSidebar:"切换侧边栏"},nav:{add:"新增",applications:"应用列表",help:"帮助中心"},common:{loading:"加载中…",error:"出错了。",retry:"重试",cancel:"取消",confirm:"确认",close:"关闭",copy:"复制",copied:"已复制",download:"下载",refresh:"刷新",empty:"暂无内容。"},theme:{title:"主题",system:"跟随系统",light:"浅色",dark:"深色"},language:{title:"语言"},applications:{title:"应用列表",statusHealthy:"正常",statusInvalidConfig:"配置无效",statusIncompatible:"版本不兼容",statusMissingPayload:"负载缺失",statusBrokenLink:"链接失效",statusRunning:"运行中",edit:"编辑",open:"打开应用",share:"分享",details:"详情",source:"来源",sourceWizard:"向导",sourceRegistered:"注册",detailsCommand:"命令",detailsCwd:"工作目录",detailsEnv:"环境变量键",detailsPm:"包管理器",detailsWindow:"窗口",detailsDevMode:"开发者模式",detailsProjectDir:"项目目录",detailsServiceHint:"服务端口提示",uninstall:"卸载",uninstallTitle:"卸载应用?",uninstallDescription:"将删除注册信息与负载链接。Dock/任务栏图标需手动移除。",uninstallWizardDescription:"将停止运行中的应用(如已授权)并删除项目目录与已物化的应用 Bundle。Dock/任务栏图标需手动移除。",stopRunningTitle:"强制停止并卸载?",stopRunningDescription:"应用仍在运行(可能是上次会话的残留)。继续将先终止其进程树,再删除项目目录与已物化的 Bundle。",stopRunningConfirm:"强制停止并卸载",stopRunningPids:"运行中的进程",uninstallPurge:"同时删除链接的外部目录",uninstallPurgeHint:"重新校验身份后删除外部目录本身,此操作不可撤销。",uninstallPinHint:"macOS Dock 与 Windows 任务栏图标由系统管理,请手动移除。",emptyHint:"还没有应用——去「新增」创建一个。",payload:"负载",registration:"注册",linked:"链接",uninstallRetained:"外部目录已保留:",uninstallDeleted:"外部目录已删除:"},help:{title:"帮助中心",listTitle:"文档",empty:"暂无文档。",readError:"无法读取该文档。"},export:{title:"导出",shareTitle:"分享应用",shareSubtitle:"基于当前向导参数构建——不运行命令、不写入任何内容。",command:"直接命令",scriptSh:"Shell 脚本(.sh)",scriptPs1:"PowerShell 脚本(.ps1)",copyCommand:"复制命令",downloadScript:"下载脚本",downloadFile:"下载文件",viewFull:"查看完整内容",building:"生成中…",inlineIcon:"内联图标字节",inlineIconHint:"网页抓取的图标默认以原始链接分享、本地图标默认内嵌字节;勾选状态即在内嵌与按引用分享之间切换。",forceCopy:"强制直接复制(内嵌图标)",forceCopyHint:"上传的图标会以很长的 data URL 内嵌,默认导出脚本;仅在你接受长度时勾选。",envAck:"我已检查环境变量并接受导出",envAckHint:"该应用定义了环境变量,完整导出将包含其值。",envReview:"环境变量(导出前可编辑)",blocked:"导出被阻止:"}},kx={shell:{product:"create-opentray",toggleSidebar:"サイドバー切替"},nav:{add:"追加",applications:"アプリ一覧",help:"ヘルプセンター"},common:{loading:"読み込み中…",error:"エラーが発生しました。",retry:"再試行",cancel:"キャンセル",confirm:"確認",close:"閉じる",copy:"コピー",copied:"コピーしました",download:"ダウンロード",refresh:"更新",empty:"まだ何もありません。"},theme:{title:"テーマ",system:"システム",light:"ライト",dark:"ダーク"},language:{title:"言語"},applications:{title:"アプリ一覧",statusHealthy:"正常",statusInvalidConfig:"設定が無効",statusIncompatible:"バージョン非対応",statusMissingPayload:"ペイロード欠落",statusBrokenLink:"リンク切れ",statusRunning:"実行中",edit:"編集",uninstall:"アンインストール",uninstallTitle:"アプリをアンインストールしますか?",uninstallDescription:"登録とペイロードリンクを削除します。Dock/タスクバーのピンは手動で外してください。",uninstallPurge:"リンク先の外部ディレクトリも削除する",uninstallPurgeHint:"身份を再検証した上で外部ディレクトリ自体を削除します。元に戻せません。",uninstallPinHint:"macOS の Dock ピンと Windows のタスクバーピンは手動で管理してください。",emptyHint:"登録済みアプリはまだありません。「追加」から作成してください。",payload:"ペイロード",registration:"登録",linked:"リンク",uninstallRetained:"外部ディレクトリは保持されました:",uninstallDeleted:"外部ディレクトリを削除しました:"},help:{title:"ヘルプセンター",listTitle:"ドキュメント",empty:"ドキュメントはありません。",readError:"このドキュメントは読み込めませんでした。"},export:{title:"エクスポート",command:"直接コマンド",scriptSh:"Shell スクリプト(.sh)",scriptPs1:"PowerShell スクリプト(.ps1)",copyCommand:"コマンドをコピー",downloadScript:"スクリプトをダウンロード",forceCopy:"アイコン埋め込みの直接コピーを強制する",forceCopyHint:"アップロードしたアイコンは非常に長い data URL として埋め込まれます。既定はスクリプトです。",envAck:"環境変数を確認し、エクスポートを許可します",envAckHint:"このアプリには環境変数が定義されており、完全なエクスポートに値が含まれます。",envReview:"環境変数(エクスポート前に編集可)",blocked:"エクスポートをブロック:"}},Ex={shell:{product:"create-opentray",toggleSidebar:"사이드바 전환"},nav:{add:"추가",applications:"앱 목록",help:"도움말 센터"},common:{loading:"불러오는 중…",error:"문제가 발생했습니다.",retry:"재시도",cancel:"취소",confirm:"확인",close:"닫기",copy:"복사",copied:"복사됨",download:"다운로드",refresh:"새로고침",empty:"아직 없습니다."},theme:{title:"테마",system:"시스템",light:"라이트",dark:"다크"},language:{title:"언어"},applications:{title:"앱 목록",statusHealthy:"정상",statusInvalidConfig:"구성 무효",statusIncompatible:"버전 비호환",statusMissingPayload:"페이로드 누락",statusBrokenLink:"링크 끊김",statusRunning:"실행 중",edit:"편집",uninstall:"제거",uninstallTitle:"앱을 제거할까요?",uninstallDescription:"등록 정보와 페이로드 링크가 삭제됩니다. Dock/작업표시줄 고정은 직접 해제하세요.",uninstallPurge:"연결된 외부 디렉터리도 삭제",uninstallPurgeHint:"신원 재검증 후 외부 디렉터리 자체를 삭제합니다. 되돌릴 수 없습니다.",uninstallPinHint:"macOS Dock 고정과 Windows 작업표시줄 고정은 직접 관리해야 합니다.",emptyHint:"등록된 앱이 아직 없습니다. 「추가」에서 만들어 보세요.",payload:"페이로드",registration:"등록",linked:"링크",uninstallRetained:"외부 디렉터리 유지됨:",uninstallDeleted:"외부 디렉터리 삭제됨:"},help:{title:"도움말 센터",listTitle:"문서",empty:"문서가 없습니다.",readError:"이 문서를 읽을 수 없습니다."},export:{title:"내보내기",command:"직접 명령",scriptSh:"Shell 스크립트(.sh)",scriptPs1:"PowerShell 스크립트(.ps1)",copyCommand:"명령 복사",downloadScript:"스크립트 다운로드",forceCopy:"아이콘 포함 직접 복사 강제",forceCopyHint:"업로드한 아이콘은 매우 긴 data URL로 포함됩니다. 기본은 스크립트입니다.",envAck:"환경 변수를 확인했으며 내보내기를 허용합니다",envAckHint:"이 앱에는 환경 변수가 정의되어 있어 전체 내보내기에 값이 포함됩니다.",envReview:"환경 변수(내보내기 전 편집 가능)",blocked:"내보내기 차단:"}},Sx={shell:{product:"create-opentray",toggleSidebar:"تبديل الشريط الجانبي"},nav:{add:"إضافة",applications:"التطبيقات",help:"مركز المساعدة"},common:{loading:"جارٍ التحميل…",error:"حدث خطأ.",retry:"إعادة المحاولة",cancel:"إلغاء",confirm:"تأكيد",close:"إغلاق",copy:"نسخ",copied:"تم النسخ",download:"تنزيل",refresh:"تحديث",empty:"لا يوجد شيء بعد."},theme:{title:"المظهر",system:"النظام",light:"فاتح",dark:"داكن"},language:{title:"اللغة"},applications:{title:"التطبيقات",statusHealthy:"سليم",statusInvalidConfig:"تهيئة غير صالحة",statusIncompatible:"إصدار غير متوافق",statusMissingPayload:"الحِمل مفقود",statusBrokenLink:"رابط معطّل",statusRunning:"قيد التشغيل",edit:"تحرير",uninstall:"إزالة",uninstallTitle:"إزالة التطبيق؟",uninstallDescription:"سيُحذف التسجيل ورابط الحِمل. يجب إزالة تثبيت Dock/شريط المهام يدويًا.",uninstallPurge:"حذف الدليل الخارجي المرتبط أيضًا",uninstallPurgeHint:"يحذف الدليل الخارجي نفسه بعد إعادة التحقق من الهوية. لا يمكن التراجع.",uninstallPinHint:"تثبيتات Dock في macOS وشريط المهام في Windows يديرها المستخدم؛ أزلها يدويًا.",emptyHint:"لا توجد تطبيقات مسجلة بعد — أنشئ واحدًا من «إضافة».",payload:"الحِمل",registration:"التسجيل",linked:"مرتبط",uninstallRetained:"احتُفظ بالدليل الخارجي:",uninstallDeleted:"حُذف الدليل الخارجي:"},help:{title:"مركز المساعدة",listTitle:"المستندات",empty:"لا توجد مستندات.",readError:"تعذّرت قراءة هذا المستند."},export:{title:"تصدير",command:"أمر مباشر",scriptSh:"سكربت Shell (.sh)",scriptPs1:"سكربت PowerShell (.ps1)",copyCommand:"نسخ الأمر",downloadScript:"تنزيل السكربت",forceCopy:"فرض النسخ المباشر مع تضمين الأيقونة",forceCopyHint:"تُضمَّن الأيقونات المرفوعة كعناوين data URL طويلة جدًا؛ السكربت هو الافتراضي.",envAck:"راجعت متغيرات البيئة وأوافق على تصديرها",envAckHint:"يحدّد هذا التطبيق متغيرات بيئة، وسيشمل التصدير الكامل قيمها.",envReview:"متغيرات البيئة (قابلة للتحرير قبل التصدير)",blocked:"التصدير محجوب:"}},Rx={shell:{product:"create-opentray",toggleSidebar:"Basculer la barre latérale"},nav:{add:"Ajouter",applications:"Applications",help:"Centre d'aide"},common:{loading:"Chargement…",error:"Une erreur est survenue.",retry:"Réessayer",cancel:"Annuler",confirm:"Confirmer",close:"Fermer",copy:"Copier",copied:"Copié",download:"Télécharger",refresh:"Actualiser",empty:"Rien pour le moment."},theme:{title:"Thème",system:"Système",light:"Clair",dark:"Sombre"},language:{title:"Langue"},applications:{title:"Applications",statusHealthy:"Sain",statusInvalidConfig:"Config invalide",statusIncompatible:"Version incompatible",statusMissingPayload:"Charge utile manquante",statusBrokenLink:"Lien rompu",statusRunning:"En cours",edit:"Modifier",uninstall:"Désinstaller",uninstallTitle:"Désinstaller l'application ?",uninstallDescription:"L'enregistrement et le lien de charge utile sont supprimés. Les épingles Dock/barre des tâches se retirent manuellement.",uninstallPurge:"Supprimer aussi le répertoire externe lié",uninstallPurgeHint:"Supprime le répertoire externe lui-même après revalidation de l'identité. Irréversible.",uninstallPinHint:"Les épingles Dock (macOS) et barre des tâches (Windows) sont gérées par l'utilisateur.",emptyHint:"Aucune application enregistrée — créez-en une depuis Ajouter.",payload:"Charge utile",registration:"Enregistrement",linked:"Lié",uninstallRetained:"Répertoire externe conservé :",uninstallDeleted:"Répertoire externe supprimé :"},help:{title:"Centre d'aide",listTitle:"Documents",empty:"Aucun document.",readError:"Impossible de lire ce document."},export:{title:"Exporter",command:"Commande directe",scriptSh:"Script shell (.sh)",scriptPs1:"Script PowerShell (.ps1)",copyCommand:"Copier la commande",downloadScript:"Télécharger le script",forceCopy:"Forcer la copie directe avec icône intégrée",forceCopyHint:"Les icônes téléversées sont incorporées en data URLs très longues ; le script est la valeur par défaut.",envAck:"J'ai revu les variables d'environnement et accepte de les exporter",envAckHint:"Cette application définit des variables d'environnement ; l'export complet inclut leurs valeurs.",envReview:"Variables d'environnement (modifiables avant export)",blocked:"Export bloqué :"}},Dx={shell:{product:"create-opentray",toggleSidebar:"Alternar barra lateral"},nav:{add:"Añadir",applications:"Aplicaciones",help:"Centro de ayuda"},common:{loading:"Cargando…",error:"Algo salió mal.",retry:"Reintentar",cancel:"Cancelar",confirm:"Confirmar",close:"Cerrar",copy:"Copiar",copied:"Copiado",download:"Descargar",refresh:"Actualizar",empty:"Aún no hay nada."},theme:{title:"Tema",system:"Sistema",light:"Claro",dark:"Oscuro"},language:{title:"Idioma"},applications:{title:"Aplicaciones",statusHealthy:"Sano",statusInvalidConfig:"Config no válida",statusIncompatible:"Versión incompatible",statusMissingPayload:"Carga útil ausente",statusBrokenLink:"Enlace roto",statusRunning:"En ejecución",edit:"Editar",uninstall:"Desinstalar",uninstallTitle:"¿Desinstalar la aplicación?",uninstallDescription:"Se eliminan el registro y el enlace de carga útil. Los anclajes del Dock/barra de tareas se quitan manualmente.",uninstallPurge:"Eliminar también el directorio externo enlazado",uninstallPurgeHint:"Elimina el directorio externo tras revalidar la identidad. No se puede deshacer.",uninstallPinHint:"Los anclajes del Dock (macOS) y de la barra de tareas (Windows) los gestiona el usuario.",emptyHint:"Aún no hay aplicaciones registradas: crea una desde Añadir.",payload:"Carga útil",registration:"Registro",linked:"Enlazado",uninstallRetained:"Directorio externo conservado:",uninstallDeleted:"Directorio externo eliminado:"},help:{title:"Centro de ayuda",listTitle:"Documentos",empty:"No hay documentos.",readError:"No se pudo leer este documento."},export:{title:"Exportar",command:"Comando directo",scriptSh:"Script de shell (.sh)",scriptPs1:"Script de PowerShell (.ps1)",copyCommand:"Copiar comando",downloadScript:"Descargar script",forceCopy:"Forzar copia directa con icono incrustado",forceCopyHint:"Los iconos subidos se incrustan como data URLs muy largas; el script es la opción predeterminada.",envAck:"He revisado las variables de entorno y acepto exportarlas",envAckHint:"Esta aplicación define variables de entorno; la exportación completa incluye sus valores.",envReview:"Variables de entorno (editables antes de exportar)",blocked:"Exportación bloqueada:"}},Fx={shell:{product:"create-opentray",toggleSidebar:"Seitenleiste umschalten"},nav:{add:"Hinzufügen",applications:"Anwendungen",help:"Hilfecenter"},common:{loading:"Lädt…",error:"Etwas ist schiefgelaufen.",retry:"Erneut versuchen",cancel:"Abbrechen",confirm:"Bestätigen",close:"Schließen",copy:"Kopieren",copied:"Kopiert",download:"Herunterladen",refresh:"Aktualisieren",empty:"Noch nichts vorhanden."},theme:{title:"Design",system:"System",light:"Hell",dark:"Dunkel"},language:{title:"Sprache"},applications:{title:"Anwendungen",statusHealthy:"Intakt",statusInvalidConfig:"Ungültige Konfiguration",statusIncompatible:"Inkompatible Version",statusMissingPayload:"Payload fehlt",statusBrokenLink:"Defekter Link",statusRunning:"Läuft",edit:"Bearbeiten",uninstall:"Deinstallieren",uninstallTitle:"Anwendung deinstallieren?",uninstallDescription:"Registrierung und Payload-Link werden entfernt. Dock-/Taskleisten-Anker bitte manuell entfernen.",uninstallPurge:"Verknüpftes externes Verzeichnis ebenfalls löschen",uninstallPurgeHint:"Löscht das externe Verzeichnis nach Identitätsprüfung. Nicht rückgängig machbar.",uninstallPinHint:"Dock-Anker (macOS) und Taskleisten-Anker (Windows) verwaltet der Benutzer manuell.",emptyHint:"Noch keine registrierten Anwendungen — erstelle eine unter „Hinzufügen“.",payload:"Payload",registration:"Registrierung",linked:"Verknüpft",uninstallRetained:"Externes Verzeichnis behalten:",uninstallDeleted:"Externes Verzeichnis gelöscht:"},help:{title:"Hilfecenter",listTitle:"Dokumente",empty:"Keine Dokumente.",readError:"Dieses Dokument konnte nicht gelesen werden."},export:{title:"Exportieren",command:"Direktbefehl",scriptSh:"Shell-Skript (.sh)",scriptPs1:"PowerShell-Skript (.ps1)",copyCommand:"Befehl kopieren",downloadScript:"Skript herunterladen",forceCopy:"Direktes Kopieren mit eingebettetem Symbol erzwingen",forceCopyHint:"Hochgeladene Symbole werden als sehr lange Data-URLs eingebettet; Standard ist das Skript.",envAck:"Ich habe die Umgebungsvariablen geprüft und akzeptiere ihren Export",envAckHint:"Diese Anwendung definiert Umgebungsvariablen; der vollständige Export enthält deren Werte.",envReview:"Umgebungsvariablen (vor dem Export bearbeitbar)",blocked:"Export blockiert:"}},Bx={shell:{product:"create-opentray",toggleSidebar:"Показать/скрыть боковую панель"},nav:{add:"Добавить",applications:"Приложения",help:"Центр справки"},common:{loading:"Загрузка…",error:"Что-то пошло не так.",retry:"Повторить",cancel:"Отмена",confirm:"Подтвердить",close:"Закрыть",copy:"Копировать",copied:"Скопировано",download:"Скачать",refresh:"Обновить",empty:"Пока ничего нет."},theme:{title:"Тема",system:"Системная",light:"Светлая",dark:"Тёмная"},language:{title:"Язык"},applications:{title:"Приложения",statusHealthy:"Исправно",statusInvalidConfig:"Неверная конфигурация",statusIncompatible:"Несовместимая версия",statusMissingPayload:"Отсутствует payload",statusBrokenLink:"Битая ссылка",statusRunning:"Выполняется",edit:"Изменить",uninstall:"Удалить",uninstallTitle:"Удалить приложение?",uninstallDescription:"Регистрация и ссылка payload будут удалены. Значки Dock/панели задач удаляйте вручную.",uninstallPurge:"Также удалить связанный внешний каталог",uninstallPurgeHint:"Удаляет внешний каталог после повторной проверки идентичности. Отменить нельзя.",uninstallPinHint:"Значки Dock (macOS) и панели задач (Windows) управляются пользователем вручную.",emptyHint:"Зарегистрированных приложений пока нет — создайте первое в разделе «Добавить».",payload:"Payload",registration:"Регистрация",linked:"Ссылка",uninstallRetained:"Внешний каталог сохранён:",uninstallDeleted:"Внешний каталог удалён:"},help:{title:"Центр справки",listTitle:"Документы",empty:"Документов нет.",readError:"Не удалось прочитать этот документ."},export:{title:"Экспорт",command:"Прямая команда",scriptSh:"Скрипт shell (.sh)",scriptPs1:"Скрипт PowerShell (.ps1)",copyCommand:"Копировать команду",downloadScript:"Скачать скрипт",forceCopy:"Принудительное копирование со встроенной иконкой",forceCopyHint:"Загруженные иконки встраиваются как очень длинные data-URL; по умолчанию — скрипт.",envAck:"Я проверил переменные окружения и согласен на их экспорт",envAckHint:"В этом приложении заданы переменные окружения; полный экспорт включает их значения.",envReview:"Переменные окружения (можно изменить перед экспортом)",blocked:"Экспорт заблокирован:"}},jx={en:Xt,"zh-CN":dn(Xt,wx),ja:dn(Xt,kx),ko:dn(Xt,Ex),ar:dn(Xt,Sx),fr:dn(Xt,Rx),es:dn(Xt,Dx),de:dn(Xt,Fx),ru:dn(Xt,Bx)},Mx=e=>jx[e],af="create-opentray.locale",lf="create-opentray.theme",cf="lang",uf=new Set(_o),Px=()=>{try{const t=new URLSearchParams(window.location.search).get(cf);return t!==null&&uf.has(t)?t:null}catch{return null}},Tx=e=>{try{const t=new URL(window.location.href);t.searchParams.set(cf,e),window.history.replaceState(null,"",t)}catch{}},fc=e=>{try{return window.localStorage.getItem(e)}catch{return null}},pc=(e,t)=>{try{window.localStorage.setItem(e,t)}catch{}},Nx=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,hc=e=>e==="system"?Nx()?"dark":"light":e,wi=(e,t)=>{const n=document.documentElement;n.lang=e,n.dir=sf(e),n.classList.toggle("dark",hc(t)==="dark"),n.style.colorScheme=hc(t)},_x=()=>{const e=Px(),t=e!==null?e:null,n=fc(af),r=t!==null?t:n!==null&&uf.has(n)?n:Ix(navigator.languages??[navigator.language]),o=fc(lf);return{locale:r,theme:o==="light"||o==="dark"||o==="system"?o:"system"}},df=d.createContext(void 0),Ox=({initialLocale:e,initialTheme:t,children:n})=>{const[r,o]=d.useState(e),[s,i]=d.useState(t);d.useEffect(()=>{wi(r,s)},[r,s]),d.useEffect(()=>{if(s!=="system")return;const f=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{wi(r,"system")};return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[s,r]);const a=d.useCallback(f=>{Tx(f),pc(af,f),o(f)},[]),c=d.useCallback(f=>{pc(lf,f),i(f)},[]),u=d.useMemo(()=>({locale:r,messages:Mx(r),direction:sf(r),theme:s,setLocale:a,setTheme:c}),[r,s,a,c]);return l.jsx(df.Provider,{value:u,children:n})},ms=()=>{const e=d.useContext(df);if(e===void 0)throw new Error("usePreferences must be used inside PreferencesProvider");return e},ff=d.createContext(void 0),pf=()=>{const[e]=Zu(),t=d.useMemo(()=>new URLSearchParams(e.split("?")[1]??""),[e]),n=(e.split("?")[0]??"/add").replace(/^\/?/u,"");return{route:n==="applications"||n==="help"?n:"add",query:t}},hf=()=>{const e=d.useContext(ff);if(e===void 0)throw new Error("useWorkbenchNavigation must be used inside WorkbenchShell");return e},Hx={"zh-CN":"中",ja:"日",ko:"한",en:"EN",ar:"ع",fr:"FR",es:"ES",de:"DE",ru:"RU"},Lx=({product:e})=>{const{state:t,toggleSidebar:n}=gs(),r=t==="collapsed",o=`${e} · ${r?"展开":"收起"}`;return r?l.jsx(Er,{size:"lg",className:"group/brand relative justify-center",children:l.jsxs("span",{className:"relative grid size-8 shrink-0 place-items-center",children:[l.jsx("img",{src:"/logo.png",alt:e,width:24,height:24,className:"size-6 rounded-md transition-opacity group-hover/brand:opacity-0 focus-visible-within:opacity-0"}),l.jsx("button",{type:"button",onClick:n,"aria-label":o,title:o,className:"absolute inset-0 grid place-items-center rounded-md opacity-0 transition-opacity hover:bg-sidebar-accent focus-visible:opacity-100 group-hover/brand:opacity-100",children:l.jsx(Il,{"aria-hidden":!0,className:"size-4"})})]})}):l.jsxs(Er,{size:"lg",className:"justify-start pr-1",children:[l.jsx("img",{src:"/logo.png",alt:e,width:24,height:24,className:"size-6 shrink-0 rounded-md"}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),l.jsx("button",{type:"button",onClick:n,"aria-label":o,title:o,className:"grid size-6 shrink-0 place-items-center rounded-md hover:bg-sidebar-accent",children:l.jsx(Il,{"aria-hidden":!0,className:"size-4"})})]})},Kx=({children:e,panelOpen:t})=>{const{locale:n,messages:r,setLocale:o,theme:s,setTheme:i}=ms(),{route:a}=pf(),c=d.useCallback(x=>{window.location.hash=`#/${x}`},[]),[u,f]=d.useState(()=>window.innerWidth>=768),h=t===!0;d.useEffect(()=>{const x=window.matchMedia("(min-width: 768px)"),m=()=>{f(x.matches&&!h)};return m(),x.addEventListener("change",m),()=>x.removeEventListener("change",m)},[h]);const A=d.useMemo(()=>({route:a,navigate:c}),[a,c]),g=[{route:"add",icon:l.jsx(Bu,{"aria-hidden":!0}),label:r.nav.add},{route:"applications",icon:l.jsx(Mh,{"aria-hidden":!0}),label:r.nav.applications},{route:"help",icon:l.jsx(xh,{"aria-hidden":!0}),label:r.nav.help}],p=s==="system"?r.theme.system:s==="light"?r.theme.light:r.theme.dark;return l.jsx(ff.Provider,{value:A,children:l.jsxs(P0,{open:u,onOpenChange:f,children:[l.jsxs(T0,{collapsible:"icon",children:[l.jsx(_0,{children:l.jsx(Ws,{children:l.jsx(ao,{children:l.jsx(Lx,{product:r.shell.product})})})}),l.jsx(H0,{children:l.jsx(L0,{children:l.jsx(K0,{children:l.jsx(Ws,{children:g.map(x=>l.jsx(ao,{children:l.jsxs(fs,{children:[l.jsxs(ps,{render:l.jsx(Er,{isActive:a===x.route,tooltip:x.label,"aria-label":x.label,onClick:()=>{c(x.route)}}),children:[x.icon,l.jsx("span",{children:x.label})]}),l.jsx(hs,{side:"right",children:x.label})]})},x.route))})})})}),l.jsx(O0,{children:l.jsxs(Ws,{children:[l.jsx(ao,{children:l.jsxs(Mo,{children:[l.jsx(Po,{render:l.jsxs(Er,{tooltip:r.language.title,"aria-label":r.language.title,children:[l.jsx("span",{"aria-hidden":!0,className:"text-xs font-semibold",children:Hx[n]}),l.jsx("span",{children:r.language.title})]})}),l.jsx(To,{side:"top",align:"start",children:_o.map(x=>l.jsx(No,{onClick:()=>{o(x)},children:Cx(x)},x))})]})}),l.jsx(ao,{children:l.jsxs(Mo,{children:[l.jsx(Po,{render:l.jsxs(Er,{tooltip:`${r.theme.title}: ${p}`,"aria-label":`${r.theme.title}: ${p}`,children:[s==="light"?l.jsx(ng,{"aria-hidden":!0}):s==="dark"?l.jsx(Kh,{"aria-hidden":!0}):l.jsx(Hh,{"aria-hidden":!0}),l.jsx("span",{children:p})]})}),l.jsx(To,{side:"top",align:"start",children:[["system",r.theme.system],["light",r.theme.light],["dark",r.theme.dark]].map(([x,m])=>l.jsx(No,{onClick:()=>{i(x)},children:m},x))})]})})]})}),l.jsx(N0,{"aria-label":r.shell.toggleSidebar})]}),l.jsx("main",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:e})]})})},Wx=()=>new URLSearchParams(window.location.search).get("token")??"",cn=async(e,t={})=>{const n=await fetch(e,{method:t.method??"GET",headers:{authorization:`Bearer ${Wx()}`,...t.body===void 0?{}:{"content-type":"application/json"}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}}),r=await n.json().catch(()=>({}));return{status:n.status,data:r}},Qx=()=>cn("/api/apps"),gf=e=>cn(`/api/apps/${encodeURIComponent(e)}/config`),Gx=e=>cn(`/api/apps/${encodeURIComponent(e)}/icon`),zx=(e,t)=>cn(`/api/apps/${encodeURIComponent(e)}/uninstall`,{method:"POST",body:{...t}}),Yx=()=>cn("/api/skill/list"),Ux=e=>cn(`/api/skill?path=${encodeURIComponent(e)}`),Vx=(e,t)=>cn(`/api/apps/${encodeURIComponent(e)}/export`,{method:"POST",body:{...t}}),Zx=e=>cn(`/api/apps/${encodeURIComponent(e)}/open`,{method:"POST",body:{}}),Jx=e=>cn("/api/export",{method:"POST",body:{...e}}).then(t=>{if(t.status!==200)return t;const n=t.data;return n.ok!==!0?{status:409,data:{code:n.code,message:n.message}}:{status:200,data:n.kind==="command"?{command:n.command}:{filename:n.filename,content:n.content,...n.commandLine===void 0?{}:{commandLine:n.commandLine},...n.iconSharedAs===void 0?{}:{iconSharedAs:n.iconSharedAs},...n.iconReference===void 0?{}:{iconReference:n.iconReference}}}});function $x(e){if(!e)return null;for(const t of e.elements){const n=t.tagName;if(n==="BUTTON"||n==="INPUT"){const r=t;if(r.type==="submit")return r}}return null}function Af(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":""}:{"data-unchecked":""}},...Wi}}const Xx=d.createContext(void 0);function qx(){return d.useContext(Xx)}const mf=d.createContext(void 0);function eb(){const e=d.useContext(mf);if(e===void 0)throw new Error(st(14));return e}const tb="data-parent",nb=d.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:c,id:u,indeterminate:f=!1,inputRef:h,name:A,onCheckedChange:g,parent:p=!1,readOnly:x=!1,render:m,required:v=!1,uncheckedValue:b,value:y,nativeButton:C=!1,style:I,...w}=t,{clearErrors:S}=Qi(),{disabled:R,name:E,setDirty:k,setFilled:B,setFocused:T,setTouched:F,state:j,validationMode:D,validityData:H,validation:_}=Uo(),P=Lg(),{labelId:L,controlId:N,registerControlId:M,getDescriptionProps:O}=Gi(),G=qx(),Z=G?.allValues===void 0?void 0:G.parent,J=Z!==void 0,Q=R||P.disabled||G?.disabled||a,$=E??A,K=y??$,te=wt(),le=wt();let X=u||N;J&&(p?X=le:K!==void 0?X=`${Z.id}-${K}`:X||=le);let ee={};J&&(p?ee=Z.getParentProps():K!==void 0&&(ee=Z.getChildProps(K)));const{checked:U=r,indeterminate:ue=f,onCheckedChange:se,...be}=ee,re=G?.value,Ae=d.useRef(null),ie=Rt(()=>Symbol()),oe=d.useRef(!1),{getButtonProps:ce,buttonRef:me}=Yt({disabled:Q,native:C}),ge=G?.validation??_,[W,V]=sn({controlled:K!==void 0&&re!==void 0&&!p?re.includes(K):U,default:s,name:"Checkbox",state:"checked"}),ye=J?!!U:W,q=J&&ue||f;ae(()=>{M!==Sr&&(oe.current=!0,M(ie.current,X))},[X,M,ie]),d.useEffect(()=>{const Re=ie.current;return()=>{!oe.current||M===Sr||(oe.current=!1,M(Re,void 0))}},[M,ie]),zi(Ae,te,W,void 0,!G&&!Q,A);const ne=d.useRef(null),ke=ge.registerInput,Se=G?K:void 0,Qe=d.useCallback(Re=>ke(Re,{controlRef:Ae,value:Se}),[ke,Se]),tt=zt(h,ne,p?void 0:Qe),Le=Mu(i,L,ne,!C,X??void 0);ae(()=>{ne.current&&(ne.current.indeterminate=q,W&&B(!0))},[W,q,B]),cs(W,()=>{G||(S($),B(W),k(W!==H.initialValue),ge.change(W))});const ht=Ft({checked:W,disabled:Q,form:c,name:p?void 0:$,id:C?void 0:X??void 0,required:v,ref:tt,style:$?da:ts,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Re){if(Re.nativeEvent.defaultPrevented)return;if(x){Re.preventDefault();return}const Ue=Re.currentTarget.checked,_e=Ce(jt,Re.nativeEvent);if(g?.(Ue,_e),!_e.isCanceled&&(se?.(Ue,_e),!_e.isCanceled&&(V(Ue),K!==void 0&&G!==void 0&&!p&&!J))){const nt=Ue?[...G.value,K]:G.value.filter(Ee=>Ee!==K);G.setValue(nt,_e)}},onClick(Re){Re.stopPropagation()},onFocus(){Ae.current?.focus()}},y!==void 0?{value:(G?W&&y:y)||""}:ct,O,Re=>ge.getValidationProps(Q,Re));d.useEffect(()=>{if(!Z||K===void 0)return;const Re=Z.disabledStatesRef.current;return Re.set(K,Q),()=>{Re.delete(K)}},[Z,Q,K]);const Ke=d.useMemo(()=>({...j,checked:ye,disabled:Q,readOnly:x,required:v,indeterminate:q}),[j,ye,Q,x,v,q]),Ge=Af(Ke),ut=Me("span",t,{state:Ke,ref:[me,Ae,n],props:[{id:C?X??void 0:te,role:"checkbox","aria-checked":q?"mixed":ye,"aria-readonly":x||void 0,"aria-required":v||void 0,"aria-labelledby":Le,[tb]:p?"":void 0,onFocus(){Q||T(!0)},onBlur(){const Re=ne.current;Re&&(F(!0),T(!1),D==="onBlur"&&ge.commit(G?re:Re.checked))},onKeyDown(Re){if(Re.key!=="Enter"||(Re.preventBaseUIHandler(),Re.defaultPrevented))return;const Ue=ne.current?.form??null,_e=Re.currentTarget,nt=Re.nativeEvent,Ee=Re.preventDefault,Ve=nt.preventDefault;let Ze=!1;Re.preventDefault=()=>{Ze=!0,Ee.call(Re)},nt.preventDefault=()=>{Ze=!0,Ve.call(nt)},Ve.call(nt),ot(_e).queueMicrotask(()=>{Re.preventDefault=Ee,nt.preventDefault=Ve,Ze||$x(Ue)?.click()})},onClick(Re){if(x||Q)return;Re.preventDefault();const Ue=ne.current;Ue&&Li(Ue,Re)}},w,be,ce,O,Re=>ge.getValidationProps(Q,Re)],stateAttributesMapping:Ge});return l.jsxs(mf.Provider,{value:Ke,children:[ut,!W&&!G&&$&&!p&&b!==void 0&&l.jsx("input",{type:"hidden",form:c,name:$,value:b,disabled:Q}),l.jsx("input",{...ht,suppressHydrationWarning:!0})]})}),rb=d.forwardRef(function(t,n){const{render:r,className:o,style:s,keepMounted:i=!1,...a}=t,c=eb(),u=c.checked||c.indeterminate,{mounted:f,transitionStatus:h,setMounted:A}=ir(u),g=d.useRef(null),p={...c,transitionStatus:h};Ut({open:u,ref:g,onComplete(){u||A(!1)}});const m={...Af(c),...On},v=i||f,b=Me("span",t,{ref:[n,g],state:p,stateAttributesMapping:m,props:a});return v?b:null});function ki({className:e,...t}){return l.jsx(nb,{"data-slot":"checkbox",className:he("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 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 dark:data-checked:bg-primary",e),...t,children:l.jsx(rb,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:l.jsx(Ui,{})})})}function Pe({className:e,...t}){return l.jsx("label",{"data-slot":"label",className:he("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",e),...t})}const xf=d.createContext(void 0);function bf(){const e=d.useContext(xf);if(e===void 0)throw new Error(st(10));return e}const ob={value:()=>null},sb=d.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,hiddenUntilFound:i,keepMounted:a,loopFocus:c,onValueChange:u,multiple:f=!1,orientation:h="vertical",value:A,defaultValue:g,style:p,...x}=t,m=d.useMemo(()=>{if(A===void 0)return g??[]},[A,g]),v=d.useRef([]),[b,y]=sn({controlled:A,default:m,name:"Accordion",state:"value"}),C=de((R,E,k)=>{if(f)if(E){const B=b.slice();if(B.push(R),u?.(B,k),k.isCanceled)return;y(B)}else{const B=b.filter(T=>T!==R);if(u?.(B,k),k.isCanceled)return;y(B)}else{const B=b[0]===R?[]:[R];if(u?.(B,k),k.isCanceled)return;y(B)}}),I=d.useMemo(()=>({value:b,disabled:s,orientation:h}),[b,s,h]),w=d.useMemo(()=>({disabled:s,handleValueChange:C,hiddenUntilFound:i??!1,keepMounted:a??!1,state:I,value:b}),[s,C,i,a,I,b]),S=Me("div",t,{state:I,ref:n,props:x,stateAttributesMapping:ob});return l.jsx(xf.Provider,{value:w,children:l.jsx(Vr,{elementsRef:v,children:S})})});function ib(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:o}=e,[s,i]=sn({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:a,setMounted:c,transitionStatus:u}=ir(s,!0,!0),f=wt(),[h,A]=d.useState(),g=h===null?void 0:h??f,p=de(x=>{const m=!s,v=Ce(Nn,x.nativeEvent);r(m,v),!v.isCanceled&&i(m)});return d.useMemo(()=>({defaultPanelId:f,disabled:o,handleTrigger:p,mounted:a,open:s,panelId:g,setMounted:c,setOpen:i,setPanelIdState:A,transitionStatus:u}),[f,o,p,a,s,g,c,i,A,u])}const vf=d.createContext(void 0);function yf(){const e=d.useContext(vf);if(e===void 0)throw new Error(st(15));return e}const Cf=d.createContext(void 0);function _a(){const e=d.useContext(Cf);if(e===void 0)throw new Error(st(9));return e}let Oa=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Do.startingStyle]="startingStyle",e[e.endingStyle=Do.endingStyle]="endingStyle",e})({}),ab=(function(e){return e.panelOpen="data-panel-open",e})({});const lb={[Oa.open]:""},cb={[Oa.closed]:""},ub={open(e){return e?{[ab.panelOpen]:""}:null}},db={open(e){return e?lb:cb}};let fb=(function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e})({});const Ha={...db,index:e=>({[fb.index]:String(e)}),...On,value:()=>null},pb=d.forwardRef(function(t,n){const{className:r,disabled:o=!1,onOpenChange:s,render:i,value:a,style:c,...u}=t,{ref:f,index:h}=As(),A=zt(n,f),{disabled:g,handleValueChange:p,state:x,value:m}=bf(),v=wt(),b=a??v,y=o||g,C=m.indexOf(b)!==-1,I=de((H,_)=>{s?.(H,_),!_.isCanceled&&p(b,H,_)}),w=ib({open:C,onOpenChange:I,disabled:y}),S=d.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),R=d.useMemo(()=>({...w,onOpenChange:I,state:S}),[w,S,I]),E=d.useMemo(()=>({...x,hidden:!C&&!w.mounted,index:h,disabled:y,open:C}),[w.mounted,y,h,C,x]),k=wt(),[B,T]=d.useState(),F=B===null?void 0:B??k,j=d.useMemo(()=>({defaultTriggerId:k,open:C,state:E,setTriggerId:T,triggerId:F}),[k,C,E,T,F]),D=Me("div",t,{state:E,ref:A,props:u,stateAttributesMapping:Ha});return l.jsx(vf.Provider,{value:R,children:l.jsx(Cf.Provider,{value:j,children:D})})}),hb=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{state:a}=_a();return Me("h3",t,{state:a,ref:n,props:i,stateAttributesMapping:Ha})}),gb=d.forwardRef(function(t,n){const{disabled:r,className:o,id:s,render:i,nativeButton:a=!0,style:c,...u}=t,{panelId:f,open:h,handleTrigger:A,disabled:g}=yf(),p=r||g,{getButtonProps:x,buttonRef:m}=Yt({disabled:p,focusableWhenDisabled:!0,native:a}),{defaultTriggerId:v,state:b,setTriggerId:y}=_a(),C=s||void 0,I=C??v;return ae(()=>(y(R=>C??(R===null?void 0:R)),()=>{y(R=>R===C?null:R)}),[C,y]),Me("button",t,{state:b,ref:[n,m],props:[{"aria-controls":h?f:void 0,"aria-expanded":h,id:I,onClick:A},u,x],stateAttributesMapping:ub})}),ur={height:void 0,width:void 0};function Ab(e){const{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:o,mounted:s,onOpenChange:i,open:a,setMounted:c,setOpen:u,transitionStatus:f}=e,h=d.useRef(null),A=d.useRef(null),[g,p]=d.useState(ur),x=d.useRef(ur),m=d.useRef(!1),v=d.useRef(a),b=d.useRef(!1),[y,C]=d.useState(!1),I=d.useRef(null),w=zt(t,h),S=et(a),R=aa(h),E=!a&&!s,k=y?"idle":f,B=a&&(v.current||b.current),T=!a&&s&&A.current==="css-animation"&&g.height===void 0&&g.width===void 0?x.current:g,F=n&&E&&A.current!=="css-animation",j=de((L,N=!0)=>{N&&(x.current=L),p(L)}),D=de(()=>{I.current?.(),I.current=null}),H=de(L=>{D(),I.current=()=>{I.current=null,L()}}),_=de(()=>{a&&s&&A.current==="css-animation"&&(b.current=!0)});ae(()=>{!y||f==="starting"||C(!1)},[y,f]),d.useEffect(()=>()=>{_(),D()},[_,D]),ae(()=>{const L=h.current;if(!L)return;!a&&I.current&&D();const N=mb(L,B);if(A.current=N,a&&f==="idle"&&v.current&&N==="css-animation"){x.current=Kn(L);return}if(a&&f==="starting"){const G=m.current;if(m.current=!1,N==="none"){j(Kn(L)),C(!0);return}if(N==="css-transition"){const Q=xb(L);if(j(Kn(L)),!G)return Q;const $=co(L,"transition-duration","0s");return H($),C(!0),Q}j(Kn(L));const Z=co(L,"animation-name","none");if(!G){Z();return}const J=co(L,"animation-duration","0s");Z(),H(J),C(!0);return}if(!a&&s&&(f==="idle"||f==="starting")){if(v.current=!1,b.current=!1,N==="none"){j(ur,!1),c(!1);return}j(Kn(L));return}if(f!=="ending")return;if(N==="none"){c(!1);return}const M=Kn(L);if(!(M.height>0||M.width>0)){c(!1);return}j(M),N==="css-animation"&&co(L,"animation-name","none")()},[s,a,D,j,c,H,B,f]),Ut({enabled:a&&s&&k==="idle",open:!0,ref:h,onComplete(){a&&j(ur,!1)}}),d.useEffect(()=>{if(a||!s||k!=="ending"||!h.current)return;const N=new AbortController;let M=-1;function O(){S.current||(c(!1),j(ur,!1))}return M=It.request(()=>{R(O,N.signal)}),()=>{It.cancel(M),N.abort()}},[S,s,a,k,R,j,c]),ae(()=>{const L=h.current;!L||!n||!E||L.setAttribute("hidden","until-found")},[E,n]),d.useEffect(function(){const N=h.current;if(!N)return;function M(O){const G=Ce(jt,O);i(!0,G),!G.isCanceled&&(m.current=!0,u(!0))}return De(N,"beforematch",M)},[i,u]);const P=o||n||s||a;return{height:T.height,props:{...F?{[Oa.startingStyle]:""}:void 0,hidden:E,id:r},ref:w,shouldPreventOpenAnimation:B,shouldRender:P,transitionStatus:k,width:T.width}}function Kn(e){return{height:e.scrollHeight,width:e.scrollWidth}}function mb(e,t){const n=ot(e).getComputedStyle(e),r=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&gc(n.animationDuration),o=gc(n.transitionDuration);return r&&o||o?"css-transition":r?"css-animation":"none"}function gc(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function co(e,t,n){const r=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===""){e.style.removeProperty(t);return}e.style.setProperty(t,r,o)}}function xb(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(o=>{e.style.setProperty(o,"initial","important")});function n(){Object.entries(t).forEach(([o,s])=>{if(s===""){e.style.removeProperty(o);return}e.style.setProperty(o,s)})}const r=It.request(n);return()=>{It.cancel(r),n()}}let Ac=(function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e})({});const bb=d.forwardRef(function(t,n){const{className:r,hiddenUntilFound:o,keepMounted:s,id:i,render:a,style:c,...u}=t,{hiddenUntilFound:f,keepMounted:h}=bf(),{defaultPanelId:A,mounted:g,onOpenChange:p,open:x,setMounted:m,setOpen:v,setPanelIdState:b,transitionStatus:y}=yf(),C=o??f,I=s??h,w=i||void 0,S=i??A;ae(()=>(b(N=>w??(N===null?void 0:N)),()=>{b(N=>N===w?null:N)}),[w,b]);const{height:R,props:E,ref:k,shouldPreventOpenAnimation:B,shouldRender:T,transitionStatus:F,width:j}=Ab({externalRef:n,hiddenUntilFound:C,id:S,keepMounted:I,mounted:g,onOpenChange:p,open:x,setMounted:m,setOpen:v,transitionStatus:y}),{state:D,triggerId:H}=_a(),_={...D,transitionStatus:F},P=Jp(c,_),L=Me("div",{...t,style:void 0},{state:_,ref:k,props:[E,{"aria-labelledby":H,role:"region",style:{[Ac.accordionPanelHeight]:R===void 0?"auto":`${R}px`,[Ac.accordionPanelWidth]:j===void 0?"auto":`${j}px`}},u,P?{style:P}:void 0,B?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Ha});return T?L:null});function La({className:e,...t}){return l.jsx(sb,{"data-slot":"accordion",className:he("flex w-full flex-col",e),...t})}function Ka({className:e,...t}){return l.jsx(pb,{"data-slot":"accordion-item",className:he("not-last:border-b",e),...t})}function Wa({className:e,children:t,...n}){return l.jsx(hb,{className:"flex",children:l.jsxs(gb,{"data-slot":"accordion-trigger",className:he("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",e),...n,children:[t,l.jsx(_n,{className:"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"}),l.jsx(Vi,{className:"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"})]})})}function Qa({className:e,children:t,...n}){return l.jsx(bb,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",...n,children:l.jsx("div",{className:he("h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),children:t})})}const If=d.createContext(void 0);function vb(){return d.useContext(If)}const yb=d.forwardRef(function(t,n){const{className:r,defaultPressed:o=!1,disabled:s=!1,form:i,onPressedChange:a,pressed:c,render:u,type:f,value:h,nativeButton:A=!0,style:g,...p}=t,x=wt(h||void 0),m=vb(),v=m?.value??[],b=m?void 0:o,y=(s||m?.disabled)??!1,[C,I]=sn({controlled:m?x!==void 0&&v.indexOf(x)>-1:c,default:b,name:"Toggle",state:"pressed"}),{getButtonProps:w,buttonRef:S}=Yt({disabled:y,native:A}),R={disabled:y,pressed:C},E=[S,n],k=[{"aria-pressed":C,onClick(F){const j=!C,D=Ce(jt,F.nativeEvent);a?.(j,D),!D.isCanceled&&(x&&m?.setGroupValue?.(x,j,D),!D.isCanceled&&I(j))}},p,w],B=Me("button",t,{enabled:!m,state:R,ref:E,props:k}),T=d.useMemo(()=>({disabled:y,focusableWhenDisabled:!1}),[y]);return m?l.jsx(nf,{tag:"button",render:u,className:r,style:g,metadata:T,state:R,refs:E,props:k}):B}),wf="data-composite-item-active",Cb=[];function Ib(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:o,direction:s,highlightedIndex:i,onHighlightedIndexChange:a,rootRef:c,enableHomeAndEndKeys:u=!1,stopEventPropagation:f,disabledIndices:h,modifierKeys:A=Cb}=e,[g,p]=d.useState(0),x=r!=null,m=d.useRef(null),v=zt(m,c),b=d.useRef([]),y=d.useRef(!1),C=i??g,I=de((k,B=!1)=>{if((a??p)(k),B){const T=b.current[k];ec(m.current,T,s,n)}}),w=de(k=>{if(k.size===0||y.current)return;y.current=!0;const B=Array.from(k.keys()),T=B.find(j=>j?.hasAttribute(wf))??null,F=T?k.get(T)?.index??-1:-1;if(F!==-1)I(F);else if(Ro(B,C,h)){const j=nn(B,{disabledIndices:h});wr(B,j)||I(j)}ec(m.current,T,s,n)});ae(()=>{if(h==null||i!=null||!y.current)return;const k=b.current;if(Ro(k,C,h)){const B=nn(k,{disabledIndices:h});wr(k,B)||I(B)}},[h,i,C,b,I]);const S=de((k,B,T)=>o?o(k,B,T,b):T),R=de(k=>{const B=k.key===Ci||k.key===Ii;if(!as.has(k.key)||!u&&B||wb(k,A)||!m.current)return;const F=s==="rtl",j=F?vi:yi,D=F?yi:vi,H=n==="vertical"?bi:j,_=n==="vertical"?xi:D,P=gt(k.nativeEvent);if(P!=null&&ql(P)&&!of(P)){const Z=P.selectionStart,J=P.selectionEnd,Q=P.value;if(Z==null||k.shiftKey||Z!==J||k.key!==_&&Z<Q.length||k.key!==H&&Z>0)return}let L=C;const N=bo(b,h),M=fi(b,h);r!=null&&(L=r({disabledIndices:h,elementsRef:b,event:k,highlightedIndex:C,loopFocus:t,maxIndex:M,minIndex:N,onLoop:S,orientation:n,rtl:F}));const O=n!=="vertical"&&k.key===j||n!=="horizontal"&&k.key===bi,G=n!=="vertical"&&k.key===D||n!=="horizontal"&&k.key===xi;u&&(k.key===Ci?L=N:k.key===Ii&&(L=M)),L===C&&(O||G)&&(t&&L===M&&O?(L=N,o&&(L=o(k,C,L,b))):t&&L===N&&G?(L=M,o&&(L=o(k,C,L,b))):L=nn(b.current,{startingIndex:L,decrement:G,disabledIndices:h})),L!==C&&!wr(b.current,L)&&(f&&k.stopPropagation(),(x||B||O||G)&&k.preventDefault(),I(L,!0),queueMicrotask(()=>{b.current[L]?.focus()}))});return{props:{ref:v,onFocus(k){const B=m.current,T=gt(k.nativeEvent);!B||T==null||!ql(T)||T.setSelectionRange(0,T.value.length)},onKeyDown:R},highlightedIndex:C,onHighlightedIndexChange:I,elementsRef:b,onMapChange:w,relayKeyboardEvent:R}}function wb(e,t){for(const n of Nm)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function kf(e){const{render:t,className:n,style:r,refs:o=Ot,props:s=Ot,state:i=ct,stateAttributesMapping:a,highlightedIndex:c,onHighlightedIndexChange:u,orientation:f,grid:h,loopFocus:A,onLoop:g,enableHomeAndEndKeys:p,onMapChange:x,stopEventPropagation:m=!0,rootRef:v,disabledIndices:b,modifierKeys:y,highlightItemOnHover:C=!1,tag:I="div",...w}=e,S=us(),{props:R,highlightedIndex:E,onHighlightedIndexChange:k,elementsRef:B,onMapChange:T,relayKeyboardEvent:F}=Ib({grid:h,loopFocus:A,onLoop:g,orientation:f,highlightedIndex:c,onHighlightedIndexChange:u,rootRef:v,stopEventPropagation:m,enableHomeAndEndKeys:p,direction:S,disabledIndices:b,modifierKeys:y}),j=Me(I,e,{state:i,ref:o,props:[R,...s,w],stateAttributesMapping:a}),D=d.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:k,highlightItemOnHover:C,relayKeyboardEvent:F}),[E,k,C,F]);return l.jsx(oh.Provider,{value:D,children:l.jsx(Vr,{elementsRef:B,onMapChange:H=>{x?.(H),T(H)},children:j})})}const kb=d.createContext(void 0);function Eb(){return d.useContext(kb)}const Sb=d.forwardRef(function(t,n){const{defaultValue:r,disabled:o=!1,loopFocus:s=!0,onValueChange:i,orientation:a="horizontal",multiple:c=!1,value:u,className:f,render:h,style:A,...g}=t,p=Na(),x=Eb(),m=u!==void 0||r!==void 0,v=(p?.disabled??!1)||(x?.disabled??!1)||o,[b,y]=sn({controlled:u,default:u===void 0?r??Ot:void 0,name:"ToggleGroup",state:"value"}),C=de((E,k,B)=>{let T;c?(T=b.slice(),k?T.push(E):T.splice(b.indexOf(E),1)):T=k?[E]:[],i?.(T,B),!B.isCanceled&&y(T)}),I={disabled:v,multiple:c,orientation:a},w=d.useMemo(()=>({disabled:v,setGroupValue:C,value:b,isValueInitialized:m}),[v,C,b,m]),S={role:"group"},R=Me("div",t,{enabled:!!p,state:I,ref:n,props:[S,g]});return l.jsx(If.Provider,{value:w,children:p?R:l.jsx(kf,{render:h,className:f,style:A,state:I,refs:[n],props:[S,g],loopFocus:s,enableHomeAndEndKeys:!0,orientation:a})})}),Rb=Ti("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}}),Ef=d.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function Ga({className:e,variant:t,size:n,spacing:r=2,orientation:o="horizontal",children:s,...i}){return l.jsx(Sb,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":o,style:{"--gap":r},className:he("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",e),...i,children:l.jsx(Ef.Provider,{value:{variant:t,size:n,spacing:r,orientation:o},children:s})})}function jr({className:e,children:t,variant:n="default",size:r="default",...o}){const s=d.useContext(Ef);return l.jsx(yb,{"data-slot":"toggle-group-item","data-variant":s.variant||n,"data-size":s.size||r,"data-spacing":s.spacing,className:he("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",Rb({variant:s.variant||n,size:s.size||r}),e),...o,children:t})}function za({...e}){return l.jsx(_d,{"data-slot":"dialog",...e})}function Db({...e}){return l.jsx(Ba,{"data-slot":"dialog-portal",...e})}function Fb({...e}){return l.jsx(Gr,{"data-slot":"dialog-close",...e})}function Bb({className:e,...t}){return l.jsx(ca,{"data-slot":"dialog-overlay",className:he("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",e),...t})}function Ya({className:e,children:t,showCloseButton:n=!0,...r}){return l.jsxs(Db,{children:[l.jsx(Bb,{}),l.jsxs(Ra,{"data-slot":"dialog-content",className:he("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-4 text-sm text-popover-foreground ring-1 ring-foreground/10 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",e),...r,children:[t,n&&l.jsxs(Gr,{"data-slot":"dialog-close",render:l.jsx(Oe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[l.jsx(Zi,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Qn({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:he("flex flex-col gap-2",e),...t})}function jb({className:e,showCloseButton:t=!1,children:n,...r}){return l.jsxs("div",{"data-slot":"dialog-footer",className:he("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&l.jsx(Gr,{render:l.jsx(Oe,{variant:"outline"}),children:"Close"})]})}function Gn({className:e,...t}){return l.jsx(ja,{"data-slot":"dialog-title",className:he("cn-font-heading text-base leading-none font-medium",e),...t})}function Ua({className:e,...t}){return l.jsx(ua,{"data-slot":"dialog-description",className:he("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const Sf=new Set(["npx","create-opentray","create","set"]),tn={comment:"text-muted-foreground italic",keyword:"text-emerald-600 dark:text-emerald-400 font-medium",flag:"text-sky-600 dark:text-sky-400",string:"text-amber-700 dark:text-amber-300 break-all",env:"text-violet-600 dark:text-violet-400",variable:"text-rose-600 dark:text-rose-400"},Mb=(e,t)=>e.split(/(\s+|\$[A-Za-z_][A-Za-z0-9_]*)/g).map((r,o)=>{const s=`${t}-u${o}`;return r.startsWith("$")?l.jsx("span",{className:tn.variable,children:r},s):Sf.has(r)?l.jsx("span",{className:tn.keyword,children:r},s):r.startsWith("--")?l.jsx("span",{className:tn.flag,children:r},s):/^[A-Za-z_][A-Za-z0-9_]*=/.test(r)?l.jsx("span",{className:tn.env,children:r},s):l.jsx("span",{children:r},s)}),Pb=(e,t)=>e.startsWith("#")?l.jsx("span",{className:tn.comment,children:e}):e.split(/('(?:[^']|'\\'')*')/g).map((r,o)=>{const s=`${t}-s${o}`;if(!r.startsWith("'"))return l.jsx("span",{children:Mb(r,s)},s);const i=r.slice(1,-1);return Sf.has(i)?l.jsx("span",{className:tn.keyword,children:r},s):i.startsWith("--")?l.jsx("span",{className:tn.flag,children:r},s):/^[A-Za-z_][A-Za-z0-9_]*=/.test(i)?l.jsx("span",{className:tn.env,children:r},s):l.jsx("span",{className:tn.string,children:r},s)}),Tb=({content:e})=>l.jsx("pre",{className:"tech-ltr bg-muted max-h-72 overflow-auto rounded-md p-2 text-xs whitespace-pre-wrap break-words",children:e.split(`
|
|
3
|
-
`).map((t,n)=>
|
|
4
|
-
`))},B=async(D,H)=>{const _=await zx(D.key,{...H,purgeTarget:h});if(_.status===200)k(_.data);else{const P=_.data;if(_.status===409&&P.code==="app_running"&&(P.pids!==void 0||P.pid!==void 0)){const L=P.pids??(P.pid!==void 0?[P.pid]:[]);f({app:D,pids:L});return}p(P.message??e.common.error)}await S()},T=async()=>{const D=a;c(null),D!==null&&await B(D,{stopRunning:!1})},F=async()=>{const D=u;f(null),D!==null&&await B(D.app,{stopRunning:!0})},j=D=>x===null?Promise.resolve({status:400,data:{code:"state_error",message:"no target"}}):Vx(x.key,D);return l.jsxs("section",{className:"flex h-full flex-col overflow-hidden","aria-label":e.applications.title,children:[l.jsxs("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[l.jsx("h1",{className:"text-sm font-semibold",children:e.applications.title}),l.jsx(Oe,{variant:"ghost",size:"icon-sm","aria-label":e.common.refresh,onClick:()=>{S()},children:l.jsx(Vh,{width:16,height:16,"aria-hidden":!0})})]}),l.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[s==="loading"&&l.jsxs("div",{className:"space-y-2","aria-label":e.common.loading,children:[l.jsx(en,{className:"h-14 w-full"}),l.jsx(en,{className:"h-14 w-full"}),l.jsx(en,{className:"h-14 w-full"})]}),s!=="loading"&&r.length===0&&l.jsx("p",{className:"text-muted-foreground text-sm",children:e.applications.emptyHint}),r.length>0&&l.jsx("ul",{className:"space-y-2",children:r.map(D=>{const H=v===D.key,_=y[D.key],P=D.status!=="healthy";return l.jsxs("li",{className:"border-border bg-card text-card-foreground rounded-lg border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Lb,{app:D,dataUrl:I[D.key]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"truncate text-sm font-medium",children:D.appName??D.key}),P&&l.jsxs(fs,{children:[l.jsx(ps,{render:L=>l.jsx(Io,{variant:"destructive",...L,children:Ec(e)[kc[D.status]]})}),l.jsx(hs,{children:D.error?.message??Ec(e)[kc[D.status]]})]}),D.isLink&&l.jsx(Io,{variant:"outline",children:e.applications.linked})]}),l.jsx("div",{className:"tech-ltr text-muted-foreground truncate text-xs",children:D.appId??D.key})]}),l.jsxs(Oe,{variant:"ghost",size:"sm","aria-expanded":H,onClick:()=>{R(D)},children:[H?l.jsx(Vi,{width:14,height:14,"aria-hidden":!0}):l.jsx(_n,{width:14,height:14,"aria-hidden":!0}),e.applications.details]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>{window.location.hash=`#/add?edit=${encodeURIComponent(D.key)}`},children:[l.jsx(Fu,{width:14,height:14,"aria-hidden":!0}),e.applications.edit]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>{E(D)},children:[l.jsx(Du,{width:14,height:14,"aria-hidden":!0}),e.applications.open]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>m(D),children:[l.jsx(Xh,{width:14,height:14,"aria-hidden":!0}),e.applications.share]}),l.jsxs(Oe,{variant:"destructive",size:"sm",onClick:()=>c(D),children:[l.jsx(og,{width:14,height:14,"aria-hidden":!0}),e.applications.uninstall]})]}),H&&l.jsxs("div",{className:"border-border mt-2 space-y-1 rounded-md border bg-muted/40 p-3",children:[_===void 0&&l.jsx("p",{className:"text-muted-foreground text-xs",children:e.common.loading}),_==="error"&&l.jsx("p",{className:"text-destructive text-xs",role:"alert",children:e.common.error}),_!==void 0&&_!=="error"&&l.jsxs(l.Fragment,{children:[l.jsx(fn,{label:e.applications.source,value:D.source==="wizard"?e.applications.sourceWizard:e.applications.sourceRegistered}),l.jsx(fn,{label:e.applications.detailsCommand,value:_.command}),l.jsx(fn,{label:e.applications.detailsCwd,value:_.cwd}),l.jsx(fn,{label:e.applications.detailsEnv,value:_.envKeys.length>0?_.envKeys.join(", "):"—"}),l.jsx(fn,{label:e.applications.detailsPm,value:_.packageManager}),l.jsx(fn,{label:e.applications.detailsWindow,value:_.window}),l.jsx(fn,{label:e.applications.detailsDevMode,value:_.developerMode?"ON":"OFF"}),l.jsx(fn,{label:e.applications.detailsProjectDir,value:D.projectDir??D.payloadPath??D.registrationDir})]})]})]},D.key)})}),s==="stale"&&l.jsx("p",{className:"text-warning mt-3 text-xs",role:"status",children:e.common.error}),g!==null&&l.jsx("p",{className:"text-muted-foreground bg-muted mt-3 whitespace-pre-line rounded-md p-3 text-xs",role:"status",children:g})]}),l.jsx(mc,{open:a!==null,onOpenChange:D=>{D||c(null)},children:l.jsxs(xc,{children:[l.jsxs(bc,{children:[l.jsx(yc,{children:e.applications.uninstallTitle}),l.jsxs(Cc,{children:[a?.source==="wizard"?e.applications.uninstallWizardDescription:e.applications.uninstallDescription,l.jsx("span",{className:"tech-ltr mt-2 block truncate",children:a?.appId??a?.key}),a?.projectDir!==void 0&&l.jsx("span",{className:"tech-ltr mt-1 block truncate",children:a.projectDir})]})]}),a?.isLink===!0&&l.jsxs("label",{className:"flex items-start gap-2 text-xs",children:[l.jsx(ki,{checked:h,onCheckedChange:D=>A(D===!0)}),l.jsxs("span",{children:[e.applications.uninstallPurge,l.jsx("span",{className:"text-muted-foreground block",children:e.applications.uninstallPurgeHint})]})]}),l.jsx("p",{className:"text-muted-foreground text-xs",children:e.applications.uninstallPinHint}),l.jsxs(vc,{children:[l.jsx(wc,{children:e.common.cancel}),l.jsx(Ic,{onClick:()=>{T()},children:e.applications.uninstall})]})]})}),l.jsx(mc,{open:u!==null,onOpenChange:D=>{D||f(null)},children:l.jsxs(xc,{children:[l.jsxs(bc,{children:[l.jsx(yc,{children:e.applications.stopRunningTitle}),l.jsxs(Cc,{children:[e.applications.stopRunningDescription,l.jsxs("span",{className:"tech-ltr mt-2 block",children:[e.applications.stopRunningPids,": ",u?.pids.join(", ")]}),l.jsx("span",{className:"tech-ltr mt-1 block truncate",children:u?.app.appId??u?.app.key})]})]}),l.jsx("p",{className:"text-muted-foreground text-xs",children:e.applications.uninstallPinHint}),l.jsxs(vc,{children:[l.jsx(wc,{children:e.common.cancel}),l.jsx(Ic,{onClick:()=>{F()},children:e.applications.stopRunningConfirm})]})]})}),l.jsx(Rf,{open:x!==null,subtitle:x?.appId??x?.key??"",hasEnv:x?.hasEnv===!0,runner:j,onClose:()=>m(null)})]})},Va=d.createContext({indent:20,currentItem:void 0,tree:void 0,toggleIconType:"plus-minus"});function Df(){return d.useContext(Va)}function Wb({indent:e=20,tree:t,className:n,toggleIconType:r="chevron",...o}){const s=t&&typeof t.getContainerProps=="function"?t.getContainerProps():{},i={...o,...s},{style:a,...c}=i,u={...a,"--tree-indent":`${e}px`};return l.jsx(Va.Provider,{value:{indent:e,tree:t,toggleIconType:r},children:l.jsx("div",{"data-slot":"tree",style:u,className:he("flex flex-col",n),...c})})}function Qb({item:e,className:t,render:n,children:r,...o}){const s=Df(),{indent:i}=s,a=typeof e.getProps=="function"?e.getProps():{},c={...o,children:r,...a},{style:u,...f}=c,A={"data-slot":"tree-item",style:{...u,"--tree-padding":`${e.getItemMeta().level*i}px`},className:he("z-10 ps-(--tree-padding) outline-hidden select-none not-last:pb-0.5 focus:z-20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),"data-focus":typeof e.isFocused=="function"?e.isFocused()||!1:void 0,"data-folder":typeof e.isFolder=="function"?e.isFolder()||!1:void 0,"data-selected":typeof e.isSelected=="function"?e.isSelected()||!1:void 0,"data-drag-target":typeof e.isDragTarget=="function"?e.isDragTarget()||!1:void 0,"data-search-match":typeof e.isMatchingSearch=="function"?e.isMatchingSearch()||!1:void 0,"aria-expanded":e.isExpanded()};return l.jsx(Va.Provider,{value:{...s,currentItem:e},children:Ru({defaultTagName:"button",render:n,props:Ft(A,f)})})}function Gb({item:e,children:t,className:n,...r}){const{currentItem:o,toggleIconType:s}=Df(),i=e||o;return i?l.jsxs("span",{"data-slot":"tree-item-label",className:he("in-focus-visible:ring-ring/50 bg-background hover:bg-accent in-data-[selected=true]:bg-accent in-data-[selected=true]:text-accent-foreground in-data-[drag-target=true]:bg-accent flex items-center gap-1 transition-colors not-in-data-[folder=true]:ps-7 in-focus-visible:ring-[3px] in-data-[search-match=true]:bg-blue-50! [&_svg]:pointer-events-none [&_svg]:shrink-0","rounded-md","py-1.5","px-2","text-sm",n),...r,children:[i.isFolder()&&(s==="plus-minus"?i.isExpanded()?l.jsx(_h,{"aria-hidden":!0,className:"text-muted-foreground size-3.5",stroke:"currentColor",strokeWidth:"1"}):l.jsx(Bu,{"aria-hidden":!0,className:"text-muted-foreground size-3.5",stroke:"currentColor",strokeWidth:"1"}):l.jsx(_n,{"aria-hidden":!0,className:"text-muted-foreground size-4 in-aria-[expanded=false]:-rotate-90"})),t||(typeof i.getItemName=="function"?i.getItemName():null)]}):(console.warn("TreeItemLabel: No item provided via props or context"),null)}const Sc={};function zb(e){let t=Sc[e];if(t)return t;t=Sc[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function rr(e,t){typeof t!="string"&&(t=rr.defaultChars);const n=zb(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let s=0,i=r.length;s<i;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){o+=n[a];continue}if((a&224)===192&&s+3<i){const c=parseInt(r.slice(s+4,s+6),16);if((c&192)===128){const u=a<<6&1984|c&63;u<128?o+="��":o+=String.fromCharCode(u),s+=3;continue}}if((a&240)===224&&s+6<i){const c=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16);if((c&192)===128&&(u&192)===128){const f=a<<12&61440|c<<6&4032|u&63;f<2048||f>=55296&&f<=57343?o+="���":o+=String.fromCharCode(f),s+=6;continue}}if((a&248)===240&&s+9<i){const c=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16),f=parseInt(r.slice(s+10,s+12),16);if((c&192)===128&&(u&192)===128&&(f&192)===128){let h=a<<18&1835008|c<<12&258048|u<<6&4032|f&63;h<65536||h>1114111?o+="����":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="�"}return o})}rr.defaultChars=";/?:@&=+$,#";rr.componentChars="";const Rc={};function Yb(e){let t=Rc[e];if(t)return t;t=Rc[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Zr(e,t,n){typeof t!="string"&&(n=t,t=Zr.defaultChars),typeof n>"u"&&(n=!0);const r=Yb(t);let o="";for(let s=0,i=e.length;s<i;s++){const a=e.charCodeAt(s);if(n&&a===37&&s+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(s+1,s+3))){o+=e.slice(s,s+3),s+=2;continue}if(a<128){o+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<i){const c=e.charCodeAt(s+1);if(c>=56320&&c<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}Zr.defaultChars=";/?:@&=+$,-_.!~*'()#";Zr.componentChars="-_.!~*'()";function Ei(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Oo(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Ub=/^([a-z0-9.+-]+:)/i,Vb=/:[0-9]*$/,Zb=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Jb=["<",">",'"',"`"," ","\r",`
|
|
5
|
-
`," "],$b=["{","}","|","\\","^","`"].concat(Jb),Xb=["'"].concat($b),Dc=["%","/","?",";","#"].concat(Xb),Fc=["/","?","#"],qb=255,Bc=/^[+a-z0-9A-Z_-]{0,63}$/,ev=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jc={javascript:!0,"javascript:":!0},Mc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Si(e,t){if(e&&e instanceof Oo)return e;const n=new Oo;return n.parse(e,t),n}Oo.prototype.parse=function(e,t){let n,r,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Zb.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let i=Ub.exec(s);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,s=s.substr(i.length)),(t||i||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(i&&jc[i])&&(s=s.substr(2),this.slashes=!0)),!jc[i]&&(o||i&&!Mc[i])){let u=-1;for(let p=0;p<Fc.length;p++)r=s.indexOf(Fc[p]),r!==-1&&(u===-1||r<u)&&(u=r);let f,h;u===-1?h=s.lastIndexOf("@"):h=s.lastIndexOf("@",u),h!==-1&&(f=s.slice(0,h),s=s.slice(h+1),this.auth=f),u=-1;for(let p=0;p<Dc.length;p++)r=s.indexOf(Dc[p]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=s.length),s[u-1]===":"&&u--;const A=s.slice(0,u);s=s.slice(u),this.parseHost(A),this.hostname=this.hostname||"";const g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){const p=this.hostname.split(/\./);for(let x=0,m=p.length;x<m;x++){const v=p[x];if(v&&!v.match(Bc)){let b="";for(let y=0,C=v.length;y<C;y++)v.charCodeAt(y)>127?b+="x":b+=v[y];if(!b.match(Bc)){const y=p.slice(0,x),C=p.slice(x+1),I=v.match(ev);I&&(y.push(I[1]),C.unshift(I[2])),C.length&&(s=C.join(".")+s),this.hostname=y.join(".");break}}}}this.hostname.length>qb&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const c=s.indexOf("?");return c!==-1&&(this.search=s.substr(c),s=s.slice(0,c)),s&&(this.pathname=s),Mc[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Oo.prototype.parseHost=function(e){let t=Vb.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const tv=Object.freeze(Object.defineProperty({__proto__:null,decode:rr,encode:Zr,format:Ei,parse:Si},Symbol.toStringTag,{value:"Module"})),Ff=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Bf=/[\0-\x1F\x7F-\x9F]/,nv=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Za=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,jf=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,Mf=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,rv=Object.freeze(Object.defineProperty({__proto__:null,Any:Ff,Cc:Bf,Cf:nv,P:Za,S:jf,Z:Mf},Symbol.toStringTag,{value:"Module"})),ov=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function sv(e){return e>=55296&&e<=57343||e>1114111?65533:ov.get(e)??e}function iv(e){const t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let o=0,s=0;o<n;o+=2){const i=t.charCodeAt(o),a=t.charCodeAt(o+1);r[s++]=i|a<<8}return r}const av=iv("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXE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AHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var yt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(yt||(yt={}));var qe;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(qe||(qe={}));const Pc=32;function Ri(e){return e>=qe.ZERO&&e<=qe.NINE}function lv(e){return e>=qe.UPPER_A&&e<=qe.UPPER_F||e>=qe.LOWER_A&&e<=qe.LOWER_F}function cv(e){return e>=qe.UPPER_A&&e<=qe.UPPER_Z||e>=qe.LOWER_A&&e<=qe.LOWER_Z||Ri(e)}function uv(e){return e===qe.EQUALS||cv(e)}var ft;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ft||(ft={}));var An;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(An||(An={}));class dv{decodeTree;emitCodePoint;errors;constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r}state=ft.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=An.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=ft.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,n){switch(this.state){case ft.EntityStart:return t.charCodeAt(n)===qe.NUM?(this.state=ft.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ft.NamedEntity,this.stateNamedEntity(t,n));case ft.NumericStart:return this.stateNumericStart(t,n);case ft.NumericDecimal:return this.stateNumericDecimal(t,n);case ft.NumericHex:return this.stateNumericHex(t,n);case ft.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Pc)===qe.LOWER_X?(this.state=ft.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ft.NumericDecimal,this.stateNumericDecimal(t,n))}stateNumericHex(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(Ri(r)||lv(r)){const o=r<=qe.NINE?r-qe.ZERO:(r|Pc)-qe.LOWER_A+10;this.result=this.result*16+o,this.consumed++,n++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(Ri(r))this.result=this.result*10+(r-qe.ZERO),this.consumed++,n++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(t,n){if(this.consumed<=n)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===qe.SEMI)this.consumed+=1;else if(this.decodeMode===An.Strict)return 0;return this.emitCodePoint(sv(this.result),this.consumed),this.errors&&(t!==qe.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&yt.VALUE_LENGTH)>>14;for(;n<t.length;){if(s===0&&(o&yt.FLAG13)!==0){const a=(o&yt.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const c=o&yt.JUMP_TABLE;if(t.charCodeAt(n)!==c)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(n>=t.length)return-1;const c=this.runConsumed-1,u=r[this.treeIndex+1+(c>>1)],f=c%2===0?u&255:u>>8&255;if(t.charCodeAt(n)!==f)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),o=r[this.treeIndex],s=(o&yt.VALUE_LENGTH)>>14}if(n>=t.length)break;const i=t.charCodeAt(n);if(i===qe.SEMI&&s!==0&&(o&yt.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=pv(r,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===An.Attribute&&(s===0||uv(i))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&yt.VALUE_LENGTH)>>14,s!==0){if(i===qe.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==An.Strict&&(o&yt.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:t,decodeTree:n}=this,r=(n[t]&yt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~(yt.VALUE_LENGTH|yt.FLAG13):o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){switch(this.state){case ft.NamedEntity:return this.result!==0&&(this.decodeMode!==An.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ft.NumericDecimal:return this.emitNumericEntity(0,2);case ft.NumericHex:return this.emitNumericEntity(0,3);case ft.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ft.EntityStart:return 0}}}function fv(e){let t="";const n=new dv(e,r=>t+=String.fromCodePoint(r));return function(o,s){let i=0,a=0;for(;(a=o.indexOf("&",a))>=0;){t+=o.slice(i,a),n.startEntity(s);const u=n.write(o,a+1);if(u<0){i=a+n.end();break}i=a+u,a=u===0?i+1:i}const c=t+o.slice(i);return t="",c}}function pv(e,t,n,r){const o=(t&yt.BRANCH_LENGTH)>>7,s=t&yt.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:e[n+u]-1}const i=o+1>>1;let a=0,c=o-1;for(;a<=c;){const u=a+c>>>1,f=u>>1,A=e[n+f]>>(u&1)*8&255;if(A<r)a=u+1;else if(A>r)c=u-1;else return e[n+i+u]}return-1}const hv=fv(av);function Pf(e){return hv(e,An.Strict)}var gv=class{src_Any=Ff.source;src_Cc=Bf.source;src_Z=Mf.source;src_P=Za.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const r=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${r}|${o}).)`;let i=`${r}${s}{0,1000}${o}`;for(let a=2;a<=n;a++)i=`${r}(?:${s}|${i}){0,1000}${o}`;return i}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},Qs={validate:(e,t,n)=>{const r=n.re.get_http_validator();r.lastIndex=t;const o=r.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},Av={"http:":Qs,"https:":Qs,"ftp:":Qs,"//":{validate:function(e,t,n){const r=n.re.get_relative_proto_validator();r.lastIndex=t;const o=r.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const r=n.re.get_mailto_validator();r.lastIndex=t;const o=r.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},mv="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",xv="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function bv(){const e=xv.split("|");return mv.split("|").forEach(t=>{const n=t.indexOf(":"),r=t.slice(0,n);for(const o of t.slice(n+1))e.push(r+o)}),e}var vv={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:bv(),urlAuth:!1,maxLength:1e4},Tc=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,r){const o=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=o,this.text=o,this.url=o}},yv=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...vv,...n},this.__schemas__={...Av},this.re=t||new gv,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(r,o)=>o.normalize(r),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const r=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(r.lastIndex=0;(t=r.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let r,o,s,i,a,c,u=!1,f=!1,h=!1,A=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const g=Math.max(A-1,0);if(o&&s&&!h&&(!a||a.index<A))for(o.lastIndex<g&&(o.lastIndex=g);;){const b=o.exec(e);if(!b){h=!0,a=void 0;break}const y=s.exec(e.slice(Math.max(0,b.index-65),b.index));if(y){if(a={schema:"mailto:",index:b.index-y[1].length,lastIndex:b.index+b[0].length},a.index>=A)break;o.lastIndex<g&&(o.lastIndex=g)}}if(r&&!f&&(!i||i.index<A))for(r.lastIndex<g&&(r.lastIndex=g);;){const b=r.exec(e);if(!b){f=!0,i=void 0;break}if(i={schema:"",index:b.index+b[1].length,lastIndex:b.index+b[0].length},i.index>=A)break;r.lastIndex<g&&(r.lastIndex=g)}let p=a;(!p||i&&(i.index<p.index||i.index===p.index&&i.lastIndex>p.lastIndex))&&(p=i);let x;if(!u)for(;;){if(!c){n.lastIndex<g&&(n.lastIndex=g);const C=n.exec(e);if(!C){u=!0;break}c={schema:C[2],index:C.index+C[1].length,lastIndex:C.index+C[0].length}}if(c.index<A){c=void 0;continue}if(p&&c.index>p.index)break;const b=c;c=void 0;const y=this.testSchemaAt(e,b.schema,b.lastIndex);if(y){x={schema:b.schema,index:b.index,lastIndex:b.lastIndex+y};break}}let m=x;if((!m||a&&(a.index<m.index||a.index===m.index&&a.lastIndex>m.lastIndex))&&(m=a),(!m||i&&(i.index<m.index||i.index===m.index&&i.lastIndex>m.lastIndex))&&(m=i),!m)break;m===a?a=void 0:m===i&&(i=void 0);const v=new Tc(e,m.schema,m.index,m.lastIndex);v.schema?this.__schemas__[v.schema].normalize(v,this):this.normalize(v),t.push(v),A=m.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const r=new Tc(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};const Zn=2147483647,Wt=36,Ja=1,Mr=26,Cv=38,Iv=700,Tf=72,Nf=128,_f="-",wv=/^xn--/,kv=/[^\0-\x7F]/,Ev=/[\x2E\u3002\uFF0E\uFF61]/g,Sv={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Gs=Wt-Ja,Qt=Math.floor,zs=String.fromCharCode;function pn(e){throw new RangeError(Sv[e])}function Rv(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Of(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(Ev,".");const o=e.split("."),s=Rv(o,t).join(".");return r+s}function Hf(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const s=e.charCodeAt(n++);(s&64512)==56320?t.push(((o&1023)<<10)+(s&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const Dv=e=>String.fromCodePoint(...e),Fv=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Wt},Nc=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Lf=function(e,t,n){let r=0;for(e=n?Qt(e/Iv):e>>1,e+=Qt(e/t);e>Gs*Mr>>1;r+=Wt)e=Qt(e/Gs);return Qt(r+(Gs+1)*e/(e+Cv))},Kf=function(e){const t=[],n=e.length;let r=0,o=Nf,s=Tf,i=e.lastIndexOf(_f);i<0&&(i=0);for(let a=0;a<i;++a)e.charCodeAt(a)>=128&&pn("not-basic"),t.push(e.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){const c=r;for(let f=1,h=Wt;;h+=Wt){a>=n&&pn("invalid-input");const A=Fv(e.charCodeAt(a++));A>=Wt&&pn("invalid-input"),A>Qt((Zn-r)/f)&&pn("overflow"),r+=A*f;const g=h<=s?Ja:h>=s+Mr?Mr:h-s;if(A<g)break;const p=Wt-g;f>Qt(Zn/p)&&pn("overflow"),f*=p}const u=t.length+1;s=Lf(r-c,u,c==0),Qt(r/u)>Zn-o&&pn("overflow"),o+=Qt(r/u),r%=u,t.splice(r++,0,o)}return String.fromCodePoint(...t)},Wf=function(e){const t=[];e=Hf(e);const n=e.length;let r=Nf,o=0,s=Tf;for(const c of e)c<128&&t.push(zs(c));const i=t.length;let a=i;for(i&&t.push(_f);a<n;){let c=Zn;for(const f of e)f>=r&&f<c&&(c=f);const u=a+1;c-r>Qt((Zn-o)/u)&&pn("overflow"),o+=(c-r)*u,r=c;for(const f of e)if(f<r&&++o>Zn&&pn("overflow"),f===r){let h=o;for(let A=Wt;;A+=Wt){const g=A<=s?Ja:A>=s+Mr?Mr:A-s;if(h<g)break;const p=h-g,x=Wt-g;t.push(zs(Nc(g+p%x,0))),h=Qt(p/x)}t.push(zs(Nc(h,0))),s=Lf(o,u,a===i),o=0,++a}++o,++r}return t.join("")},Bv=function(e){return Of(e,function(t){return wv.test(t)?Kf(t.slice(4).toLowerCase()):t})},jv=function(e){return Of(e,function(t){return kv.test(t)?"xn--"+Wf(t):t})},_c={version:"2.3.1",ucs2:{decode:Hf,encode:Dv},decode:Kf,encode:Wf,toASCII:jv,toUnicode:Bv};var Oc=Object.defineProperty,Qf=(e,t)=>{let n={};for(var r in e)Oc(n,r,{get:e[r],enumerable:!0});return Oc(n,Symbol.toStringTag,{value:"Module"}),n},Mv=Qf({arrayReplaceAt:()=>zf,asciiTrim:()=>bs,callable:()=>Gf,escapeHtml:()=>yn,escapeRE:()=>Qv,fromCodePoint:()=>Pr,isMdAsciiPunct:()=>_r,isPunctChar:()=>Uf,isPunctCharCode:()=>Nr,isSpace:()=>Ye,isValidEntityCode:()=>$a,isWhiteSpace:()=>Tr,lib:()=>Gv,normalizeReference:()=>xs,unescapeAll:()=>or,unescapeMd:()=>_v});function Gf(e){const t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function zf(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function $a(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Pr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Yf=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Pv=new RegExp(`${Yf.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Tv=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Nv(e,t){if(t.charCodeAt(0)===35&&Tv.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return $a(r)?Pr(r):e}const n=Pf(e);return n!==e?n:e}function _v(e){return e.indexOf("\\")<0?e:e.replace(Yf,"$1")}function or(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Pv,function(t,n,r){return n||Nv(t,r)})}var Ov=/[&<>"]/,Hv=/[&<>"]/g,Lv={"&":"&","<":"<",">":">",'"':"""};function Kv(e){return Lv[e]}function yn(e){return Ov.test(e)?e.replace(Hv,Kv):e}var Wv=/[.?*+^$[\]\\(){}|-]/g;function Qv(e){return e.replace(Wv,"\\$&")}function Ye(e){switch(e){case 9:case 32:return!0}return!1}function Tr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Uf(e){return Za.test(e)||jf.test(e)}function Nr(e){return Uf(Pr(e))}function _r(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function xs(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function Hc(e){return e===32||e===9||e===10||e===13}function bs(e){let t=0;for(;t<e.length&&Hc(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Hc(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Gv={mdurl:tv,ucmicro:rv};function zv(e,t,n){let r,o,s,i;const a=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(s=e.src.charCodeAt(e.pos),s===93&&(r--,r===0)){o=!0;break}if(i=e.pos,e.md.inline.skipToken(e),s===91){if(i===e.pos-1)r++;else if(n)return e.pos=c,-1}}let u=-1;return o&&(u=e.pos),e.pos=c,u}function Yv(e,t,n){let r,o=t;const s={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(r=e.charCodeAt(o),r===10||r===60)return s;if(r===62)return s.pos=o+1,s.str=or(e.slice(t+1,o)),s.ok=!0,s;if(r===92&&o+1<n){o+=2;continue}o++}return s}let i=0;for(;o<n&&(r=e.charCodeAt(o),!(r===32||r<32||r===127));){if(r===92&&o+1<n){if(e.charCodeAt(o+1)===32){o++;continue}o+=2;continue}if(r===40&&(i++,i>32))return s;if(r===41){if(i===0)break;i--}o++}return t===o||i!==0||(s.str=or(e.slice(t,o)),s.pos=o,s.ok=!0),s}function Uv(e,t,n,r){let o,s=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(s>=n)return i;let a=e.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return i;t++,s++,a===40&&(a=41),i.marker=a}for(;s<n;){if(o=e.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=or(e.slice(t,s)),i.ok=!0,i;if(o===40&&i.marker===41)return i;o===92&&s+1<n&&s++,s++}return i.can_continue=!0,i.str+=or(e.slice(t,s)),i}var Vv=Qf({parseLinkDestination:()=>Yv,parseLinkLabel:()=>zv,parseLinkTitle:()=>Uv});function Or(e){"@babel/helpers - typeof";return Or=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Or(e)}function Zv(e,t){if(Or(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Or(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jv(e){var t=Zv(e,"string");return Or(t)=="symbol"?t:t+""}function xe(e,t,n){return(t=Jv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jn=class{constructor(e,t,n){xe(this,"map",null),xe(this,"level",0),xe(this,"children",null),xe(this,"content",""),xe(this,"markup",""),xe(this,"info",""),xe(this,"block",!1),xe(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Hr=class{constructor(){xe(this,"__rules__",[]),xe(this,"__cache__",null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){const e=new Set;this.__rules__.forEach(t=>{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){const r=this.__find__(e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=n.alt||[],this.__cache__=null}before(e,t,n,r={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}after(e,t,n,r={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const o=this.__find__(r);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[o].enabled=!0,n.push(r)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const o=this.__find__(r);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[o].enabled=!1,n.push(r)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},Vt={};Vt.code_inline=function(e,t,n,r,o){const s=e[t];return`<code${o.renderAttrs(s)}>${yn(s.content)}</code>`};Vt.code_block=function(e,t,n,r,o){const s=e[t];return`<pre${o.renderAttrs(s)}><code>${yn(e[t].content)}</code></pre>
|
|
6
|
-
`};
|
|
7
|
-
`;if(i){const
|
|
2
|
+
import{d as Ke,r as f,E as Ht,e as Ft,f as Hp,g as xu,h as at,i as Me,j as c,N as Er,k as dt,l as Ut,m as bu,n as ge,o as Nt,p as ji,u as mt,L as Kp,q as Wp,s as Lp,t as Qp,v as Gp,w as Yp,x as vu,y as zp,z as Up,A as Vp,B as Zp,C as Jp,D as $p,F as xl,G as Ye,H as Xp,a as qp,b as eh,R as th,c as nh,P as rh}from"./index.js";import{u as wt,b as le,i as Xe,c as Te,d as ve,g as Kt,o as je,e as yt,f as kt,h as Mi,j as ue,k as Vt,l as Ce,m as oh,n as Pt,p as jn,q as Jn,r as sh,t as ct,s as Lo,v as it,w as gt,x as Tn,y as Qo,z as Fn,C as $n,D as ri,E as Cn,F as Ni,H as ih,J as yu,K as ah,L as Ti,M as Go,N as Cu,O as bl,P as Yn,Q as oi,S as Pi,B as He,T as Iu,U as _i,V as Cr,W as xr,X as Oi,Y as wu,Z as Hi,_ as Ki,$ as Yo,a0 as Wi,a1 as ln,a2 as Li,a3 as lh,I as et,a4 as Qi,a5 as ch,G as si,a6 as vl,a7 as yl,A as uh,a as dh,R as fh}from"./input.js";import{u as ku,B as Co,T as Sr,_ as ph,p as hh,c as Ah}from"./terminal-pane.js";const gh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Gi=Ke("check",gh);const mh=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Pn=Ke("chevron-down",mh);const xh=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Yi=Ke("chevron-up",xh);const bh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],vh=Ke("circle-check",bh);const yh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ch=Ke("circle-question-mark",yh);const Ih=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],wh=Ke("copy",Ih);const kh=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Eh=Ke("download",kh);const Sh=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Eu=Ke("external-link",Sh);const Rh=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Dh=Ke("file-text",Rh);const Fh=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Bh=Ke("folder-open",Fh);const jh=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Mh=Ke("folder",jh);const Nh=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Th=Ke("link-2",Nh);const Ph=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],_h=Ke("list",Ph);const Oh=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Hh=Ke("loader-circle",Oh);const Kh=[["path",{d:"M5 12h14",key:"1ays0h"}]],Wh=Ke("minus",Kh);const Lh=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Qh=Ke("monitor",Lh);const Gh=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Yh=Ke("moon",Gh);const zh=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Cl=Ke("panel-left",zh);const Uh=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Su=Ke("pencil",Uh);const Vh=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Zh=Ke("play",Vh);const Jh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ru=Ke("plus",Jh);const $h=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Xh=Ke("refresh-cw",$h);const qh=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],eA=Ke("settings-2",qh);const tA=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],nA=Ke("share-2",tA);const rA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],oA=Ke("square",rA);const sA=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],iA=Ke("sun",sA);const aA=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],lA=Ke("trash-2",aA);const cA=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],uA=Ke("triangle-alert",cA);const dA=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Du=Ke("upload",dA);const fA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zi=Ke("x",fA);function Fu(e,t,n,r=!0,o){const[s,i]=f.useState(),a=wt(o?`${o}-label`:void 0),l=e??t??s;return le(()=>{const u=e||t||!r?void 0:pA(n.current,a);s!==u&&i(u)}),l}function pA(e,t){const n=hA(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function hA(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}function AA(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:gA,platform:mA,maxTouchPoints:xA}=AA(),zo=gA.toLowerCase(),Rr=mA.toLowerCase(),Uo=/^i(os$|p)/.test(Rr)||Rr==="macintel"&&xA>1,Il="android",ii=Rr===Il||zo.includes(Il),Ui=!Uo&&Rr.startsWith("mac");Rr.startsWith("win");const bA=Ui||Uo,un=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!un&&zo.includes("firefox");!un&&zo.includes("chrom");const vA=bA,Vi=/jsdom|happydom/.test(zo),ai="data-base-ui-focusable",Bu="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Vo="ArrowLeft",Zo="ArrowRight",ju="ArrowUp",Zi="ArrowDown";function Io(e,t){if(!Te(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(ve(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Ss(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function yA(e){return e.matches("html,body")}function Jo(e){return Xe(e)&&e.matches(Bu)}function CA(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Bu}`)!=null}function li(e){return e?e.getAttribute("role")==="combobox"&&Jo(e):!1}function IA(e){if(!e||Vi)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function wo(e){return e?e.hasAttribute(ai)?e:e.querySelector(`[${ai}]`)||e:null}function bn(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...bn(e,o.id,n)])}function wl(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Qt(e){e.preventDefault(),e.stopPropagation()}function wA(e){return"nativeEvent"in e}function Ji(e){return e.pointerType===""&&e.isTrusted?!0:ii&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $i(e){return Vi?!1:!ii&&e.width===0&&e.height===0||ii&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function xn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function kA(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Xn=Math.min,sn=Math.max,ko=Math.round,$r=Math.floor,an=e=>({x:e,y:e}),EA={left:"right",right:"left",bottom:"top",top:"bottom"};function Mu(e,t,n){return sn(e,Xn(t,n))}function vn(e,t){return typeof e=="function"?e(t):e}function Tt(e){return e.split("-")[0]}function In(e){return e.split("-")[1]}function Xi(e){return e==="x"?"y":"x"}function qi(e){return e==="y"?"height":"width"}function Mt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ea(e){return Xi(Mt(e))}function SA(e,t,n){n===void 0&&(n=!1);const r=In(e),o=ea(e),s=qi(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Eo(i)),[i,Eo(i)]}function RA(e){const t=Eo(e);return[ci(e),t,ci(t)]}function ci(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const kl=["left","right"],El=["right","left"],DA=["top","bottom"],FA=["bottom","top"];function BA(e,t,n){switch(e){case"top":case"bottom":return n?t?El:kl:t?kl:El;case"left":case"right":return t?DA:FA;default:return[]}}function jA(e,t,n,r){const o=In(e);let s=BA(Tt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ci)))),s}function Eo(e){const t=Tt(e);return EA[t]+e.slice(t.length)}function MA(e){var t,n,r,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(o=e.left)!=null?o:0}}function Nu(e){return typeof e!="number"?MA(e):{top:e,right:e,bottom:e,left:e}}function Dr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ir(e,t){return t<0||t>=e.length}function xo(e,t){return on(e.current,{disabledIndices:t})}function ui(e,t){return on(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function on(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&So(e,s,r));return s}function So(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!$o(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function NA(e){return e.visibility==="hidden"||e.visibility==="collapse"}function $o(e,t=e?Kt(e):null){return!e||!e.isConnected||!t||NA(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const TA='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function PA(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Mi(n)?n.host:null}function di(e){for(const t of Array.from(e.children))if(kt(t)==="summary")return t;return null}function _A(e,t){const n=di(t);return!!n&&(e===n||ve(n,e))}function Tu(e){const t=e?kt(e):"";return e!=null&&e.matches(TA)&&(t!=="summary"||e.parentElement!=null&&kt(e.parentElement)==="details"&&di(e.parentElement)===e)&&(t!=="details"||di(e)==null)&&(t!=="input"||e.type!=="hidden")}function Pu(e){if(!Tu(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=PA(t)){const n=t!==e,r=kt(t)==="slot";if(t.hasAttribute("inert")||n&&kt(t)==="details"&&!t.open&&!_A(e,t)||t.hasAttribute("hidden")||!r&&!OA(t,n))return!1}return!0}function OA(e,t){const n=Kt(e);return t?n.display!=="none":$o(e,n)}function _u(e){const t=e.tabIndex;if(t<0){const n=kt(e);if(n==="details"||n==="audio"||n==="video"||Xe(e)&&e.isContentEditable)return 0}return t}function Rs(e){if(kt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function HA(e,t){const n=Rs(e);if(!n)return!0;const r=t.find(o=>{const s=Rs(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=Rs(o);return s?.name===n.name&&s.form===n.form})===n}function Ou(e){if(Xe(e)&&kt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Xe(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Hu(e,t){Ou(e).forEach(n=>{Tu(n)&&t.push(n),Hu(n,t)})}function Ku(e,t,n){Ou(e).forEach(r=>{Xe(r)&&r.matches(t)&&n.push(r),Ku(r,t,n)})}function ta(e){return Pu(e)&&_u(e)>=0}function Wu(e){const t=[];return Hu(e,t),t.filter(Pu)}function Wr(e){const t=Wu(e);return t.filter(n=>_u(n)>=0&&HA(n,t))}function Lu(e,t){const n=Wr(e),r=n.length;if(r===0)return;const o=yt(je(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function na(e){return Lu(je(e).body,1)||e}function Qu(e){return Lu(je(e).body,-1)||e}function Gu(e,t){if(!e)return null;const n=Wr(je(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function KA(e){return Gu(e,1)}function WA(e){return Gu(e,-1)}function zn(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ve(n,r)}function LA(e){Wr(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Sl(e){const t=[];Ku(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function ra(e){f.useEffect(e,Ht)}const ar=0;class Wt{static create(){return new Wt}currentId=ar;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ar,n()},t)}isStarted(){return this.currentId!==ar}clear=()=>{this.currentId!==ar&&(clearTimeout(this.currentId),this.currentId=ar)};disposeEffect=()=>this.clear}function ht(){const e=Ft(Wt.create).current;return ra(e.disposeEffect),e}const QA=f.createContext({disabled:!1});function GA(){return f.useContext(QA)}var cn=Hp();const Xr=null;class YA{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let qr=new YA;class It{static create(){return new It}static request(t){return qr.request(t)}static cancel(t){return qr.cancel(t)}currentId=Xr;request(t){this.cancel(),this.currentId=qr.request(()=>{this.currentId=Xr,t()})}cancel=()=>{this.currentId!==Xr&&(qr.cancel(this.currentId),this.currentId=Xr)};disposeEffect=()=>this.cancel}function qn(){const e=Ft(It.create).current;return ra(e.disposeEffect),e}function tn(e){return e==null?e:"current"in e?e.current:e}function oa(e,t=!1){const n=qn();return ue((r,o=null)=>{n.cancel();const s=tn(e);if(s==null)return;const i=s,a=()=>{cn.flushSync(r)};if(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function l(){Promise.all(i.getAnimations().map(u=>u.finished)).then(()=>{o?.aborted||a()},()=>{if(o?.aborted)return;if(i.getAnimations().some(d=>d.pending||d.playState!=="finished")){l();return}a()})}if(t){const u="data-starting-style";if(!i.hasAttribute(u)){n.request(l);return}const d=new MutationObserver(()=>{i.hasAttribute(u)||(d.disconnect(),l())});d.observe(i,{attributes:!0,attributeFilter:[u]}),o?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(l)})}function Zt(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=ue(o),i=oa(r,n);f.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let Ro=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const zA={"data-starting-style":""},UA={"data-ending-style":""},_n={transitionStatus(e){return e==="starting"?zA:e==="ending"?UA:null}};function sr(e,t=!1,n=!1){const[r,o]=f.useState(e&&t?"idle":void 0),[s,i]=f.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),le(()=>{if(!e&&s&&r!=="ending"&&n){const a=It.request(()=>{o("ending")});return()=>{It.cancel(a)}}},[e,s,r,n]),le(()=>{if(!e||t)return;const a=It.request(()=>{o(void 0)});return()=>{It.cancel(a)}},[t,e]),le(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=It.request(()=>{o("idle")});return()=>{It.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}var Ds={exports:{}},Fs={};var Rl;function VA(){if(Rl)return Fs;Rl=1;var e=xu();function t(p,A){return p===A&&(p!==0||1/p===1/A)||p!==p&&A!==A}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(p,A){var m=A(),h=r({inst:{value:m,getSnapshot:A}}),g=h[0].inst,x=h[1];return s(function(){g.value=m,g.getSnapshot=A,l(g)&&x({inst:g})},[p,m,A]),o(function(){return l(g)&&x({inst:g}),p(function(){l(g)&&x({inst:g})})},[p]),i(m),m}function l(p){var A=p.getSnapshot;p=p.value;try{var m=A();return!n(p,m)}catch{return!0}}function u(p,A){return A()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Fs.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Fs}var Dl;function Yu(){return Dl||(Dl=1,Ds.exports=VA()),Ds.exports}var Xo=Yu();const br={v:[]},Fl=()=>br.v.forEach(e=>e()),ZA=e=>(br.v.push(e)===1&&addEventListener("hashchange",Fl),()=>{br.v=br.v.filter(t=>t!==e),br.v.length||removeEventListener("hashchange",Fl)}),JA=()=>"/"+location.hash.replace(/^#?\/?/,""),$A=(e,{state:t=null,replace:n=!1}={})=>{const r=location.href,[o,s]=e.replace(/^#?\/?/,"").split("?"),i=new URL(location.href);i.hash=`/${o}`,s&&(i.search=s);const a=i.href;n?history.replaceState(t,"",a):history.pushState(t,"",a);const l=typeof HashChangeEvent<"u"?new HashChangeEvent("hashchange",{oldURL:r,newURL:a}):new Event("hashchange",{detail:{oldURL:r,newURL:a}});dispatchEvent(l)},zu=({ssrPath:e="/"}={})=>[Xo.useSyncExternalStore(ZA,JA,()=>e),$A];zu.hrefs=e=>"#"+e;const Bs=768;function XA(){const[e,t]=f.useState(void 0);return f.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Bs-1}px)`),r=()=>t(window.innerWidth<Bs);return n.addEventListener("change",r),t(window.innerWidth<Bs),()=>n.removeEventListener("change",r)},[]),!!e}const Uu=f.createContext(void 0);function On(e){const t=f.useContext(Uu);if(!e&&t===void 0)throw new Error(at(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ro.startingStyle]="startingStyle",e[e.endingStyle=Ro.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const qA={"data-popup-open":""},eg={"data-popup-open":"","data-pressed":""},tg={"data-open":""},ng={"data-closed":""},rg={"data-anchor-hidden":""},Vu={open(e){return e?qA:null}},fi={open(e){return e?eg:null}},Lr={open(e){return e?tg:ng},anchorHidden(e){return e?rg:null}},sa={...Lr,..._n},ia=f.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,l=On(),u=l.useState("open"),d=l.useState("nested"),p=l.useState("mounted"),A=l.useState("transitionStatus");return Me("div",t,{state:{open:u,transitionStatus:A},ref:[l.context.backdropRef,n],stateAttributesMapping:sa,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!d})}),Qr=f.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:i=!1,nativeButton:a=!0,...l}=t,u=On(),d=u.useState("open"),{getButtonProps:p,buttonRef:A}=Vt({disabled:i,native:a}),m={disabled:i};function h(g){d&&u.setOpen(!1,Ce(oh,g.nativeEvent))}return Me("button",t,{state:m,ref:[n,A],props:[{onClick:h},l,p]})}),aa=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,l=On(),u=wt(i);return l.useSyncedValueWithCleanup("descriptionElementId",u),Me("p",t,{ref:n,props:[{id:u},a]})});function og(e,t){return t!=null&&!xn(t)?0:typeof e=="function"?e():e}function er(e,t,n){const r=og(e,n);return typeof r=="number"?r:r?.[t]}function Bl(e){return typeof e=="function"?e():e}function Zu(e,t){return t||e==="click"||e==="mousedown"}function sg(e){return e?.includes("mouse")&&e!=="mousedown"}const ig=f.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Wt,currentIdRef:{current:null},currentContextRef:{current:null}});function ag(e,t){e.current=t.current}function lg(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,o=r.useState("floatingId"),s=f.useContext(ig),{currentIdRef:i,delayRef:a,timeoutMs:l,initialDelayRef:u,currentContextRef:d,hasProvider:p,timeout:A}=s,[m,h]=f.useState(!1),g=f.useRef(n);return le(()=>{g.current=n},[n]),le(()=>{function x(){d.current?.setIsInstantPhase(!1),i.current=null,d.current=null,a.current=u.current,A.clear()}if(i.current&&!n&&i.current===o){if(h(!1),l){const b=o;return A.start(l,()=>{r.select("open")||i.current&&i.current!==b||x()}),()=>{(g.current||i.current!==b)&&A.clear()}}x()}},[n,o,i,a,l,u,d,A,r]),le(()=>{if(!n)return;const x=d.current,b=i.current;A.clear(),d.current={onOpenChange:r.setOpen,setIsInstantPhase:h},i.current=o,a.current={open:0,close:er(u.current,"close")},b!==null&&b!==o?(h(!0),x?.setIsInstantPhase(!0),x?.onOpenChange(!1,Ce(Pt))):(h(!1),x?.setIsInstantPhase(!1))},[n,o,r,i,a,u,d,A]),le(()=>()=>{if(i.current===o){if(d.current=null,!g.current)return;i.current=null,ag(a,u),A.clear()}},[d,i,a,o,u,A]),f.useMemo(()=>({hasProvider:p,delayRef:a,isInstantPhase:m}),[p,a,m])}function De(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zt(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function nt(e){const t=Ft(cg,e).current;return t.next=e,le(t.effect),t}function cg(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Ju={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},qo={...Ju,position:"fixed",top:0,left:0},la={...Ju,position:"absolute"},tr=f.forwardRef(function(t,n){const[r,o]=f.useState();le(()=>{vA&&un&&o("button")},[]);const s={tabIndex:0,role:r};return c.jsx("span",{...t,ref:n,style:qo,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Fr(e){return`data-base-ui-${e}`}let eo=0;function bo(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame(eo);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Er;const i=requestAnimationFrame(s);return eo=i,()=>{eo===i&&(cancelAnimationFrame(i),eo=0)}}const js={inert:new WeakMap,"aria-hidden":new WeakMap},jl="data-base-ui-inert",pi={inert:new WeakSet,"aria-hidden":new WeakSet};let lr=new WeakMap,Ms=0;function ug(e){return pi[e]}function $u(e){return e?Mi(e)?e.host:$u(e.parentNode):null}const Ml=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=$u(n);return e.contains(r)?r:null}).filter(n=>n!=null),Nl=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Tl=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{kt(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function dg(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let i=null,a=null;const l=Ml(t,e),u=o?Tl(t,Nl(l),new Set(l)):[],d=[],p=[];if(s){const A=js[s],m=ug(s);a=m,i=A;const h=Ml(t,Array.from(t.querySelectorAll("[aria-live]"))),g=l.concat(h);Tl(t,Nl(g),new Set(g)).forEach(b=>{const v=b.getAttribute(s),y=v!==null&&v!=="false",C=(A.get(b)||0)+1;A.set(b,C),d.push(b),C===1&&y&&m.add(b),y||b.setAttribute(s,s==="inert"?"":"true")})}return o&&u.forEach(A=>{const m=(lr.get(A)||0)+1;lr.set(A,m),p.push(A),m===1&&A.setAttribute(jl,"")}),Ms+=1,()=>{i&&d.forEach(A=>{const h=(i.get(A)||0)-1;i.set(A,h),h||(!a?.has(A)&&s&&A.removeAttribute(s),a?.delete(A))}),o&&p.forEach(A=>{const m=(lr.get(A)||0)-1;lr.set(A,m),m||A.removeAttribute(jl)}),Ms-=1,Ms||(js.inert=new WeakMap,js["aria-hidden"]=new WeakMap,pi.inert=new WeakSet,pi["aria-hidden"]=new WeakSet,lr=new WeakMap)}}function Pl(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=je(e[0]).body;return dg(e,s,n,r,{mark:o})}const fg=500,pg=500,hg={style:{transition:"none"}},Ag="data-base-ui-click-trigger",Xu={fallbackAxisSide:"none"},qu={fallbackAxisSide:"end"},gg={clipPath:"inset(50%)",position:"fixed",top:0,left:0},ed=f.createContext(null),td=()=>f.useContext(ed),mg=Fr("portal");function nd(e={}){const{ref:t,container:n,componentProps:r=dt,elementProps:o}=e,s=Jn(),a=td()?.portalNode,[l,u]=f.useState(null),[d,p]=f.useState(null),A=ue(x=>{x!==null&&p(x)}),m=f.useRef(null);le(()=>{if(n===null){m.current&&(m.current=null,p(null),u(null));return}const x=(n&&(sh(n)?n:n.current))??a??document.body;if(x==null){m.current&&(m.current=null,p(null),u(null));return}m.current!==x&&(m.current=x,p(null),u(x))},[n,a]);const h=Me("div",r,{ref:[t,A],props:[{id:s,[mg]:""},o]}),g=l&&h?cn.createPortal(h,l):null;return{node:d,nodeId:f.isValidElement(h)?h.props.id:void 0,subtree:g}}const ca=f.forwardRef(function(t,n){const{render:r,className:o,style:s,children:i,container:a,...l}=t,{node:u,nodeId:d,subtree:p}=nd({container:a,ref:n,componentProps:t,elementProps:l}),A=f.useRef(null),m=f.useRef(null),h=f.useRef(null),g=f.useRef(null),[x,b]=f.useState(null),v=f.useRef(!1),y=x?.modal,C=x?.open,I=!!x&&!x.modal&&x.open&&!!u;f.useEffect(()=>{if(!u||y)return;function E(S){u&&S.relatedTarget&&zn(S)&&(S.type==="focusin"?v.current&&(Sl(u),v.current=!1):(LA(u),v.current=!0))}return zt(De(u,"focusin",E,!0),De(u,"focusout",E,!0))},[u,y]),le(()=>{!u||C!==!0||!v.current||(Sl(u),v.current=!1)},[C,u]);const w=f.useMemo(()=>({beforeOutsideRef:A,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:u,setFocusManagerState:b}),[u]);return c.jsxs(f.Fragment,{children:[p,c.jsxs(ed.Provider,{value:w,children:[I&&u&&c.jsx(tr,{"data-type":"outside",ref:A,onFocus:E=>{if(zn(E,u))h.current?.focus();else{const S=x?x.domReference:null;Qu(S)?.focus()}}}),I&&u&&c.jsx("span",{"aria-owns":d,style:gg}),u&&cn.createPortal(i,u),I&&u&&c.jsx(tr,{"data-type":"outside",ref:m,onFocus:E=>{if(zn(E,u))g.current?.focus();else{const S=x?x.domReference:null;na(S)?.focus(),x?.closeOnFocusOut&&x?.onOpenChange(!1,Ce(jn,E.nativeEvent))}}})]})]})});function rd(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class ua{nodesRef={current:[]};events=rd();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const od=f.createContext(null),sd=f.createContext(null),wn=()=>f.useContext(od)?.id||null,kn=e=>{const t=f.useContext(sd);return e??t};function id(e){const t=Jn(),n=kn(e),r=wn();return le(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function xg(e){const{children:t,id:n}=e,r=wn();return c.jsx(od.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function bg(e){const{children:t,externalTree:n}=e,r=Ft(()=>n??new ua).current;return c.jsx(sd.Provider,{value:r,children:t})}function vg(e,t){const n=it(gt(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const _l=20;let mn=[];function da(){mn=mn.filter(e=>e.deref()?.isConnected)}function Ol(e){da(),e&&kt(e)!=="body"&&(mn.push(new WeakRef(e)),mn.length>_l&&(mn=mn.slice(-_l)))}function Hl(){return da(),mn[mn.length-1]?.deref()}function yg(e){return e?ta(e)?e:Wr(e)[0]||e:null}function Kl(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Wu(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return ta(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function fa(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:p,beforeContentFocusGuardRef:A,externalTree:m,getInsideElements:h}=e,g="rootStore"in t?t.rootStore:t,x=g.useState("open"),b=g.useState("domReferenceElement"),v=g.useState("floatingElement"),{events:y,dataRef:C}=g.context,I=ue(()=>C.current.floatingContext?.nodeId),w=o===!1,E=li(b)&&w,S=nt(o),D=nt(s),k=nt(u),j=nt(x),N=kn(m),T=td(),F=f.useRef(!1),R=f.useRef(!1),O=f.useRef(!1),_=f.useRef(null),M=f.useRef(""),H=f.useRef(""),G=f.useRef(null),B=f.useRef(null),P=Ut(G,A,T?.beforeInsideRef),W=Ut(B,T?.afterInsideRef),Y=ht(),Z=ht(),Q=qn(),J=T!=null,K=wo(v),ee=ue(($=K)=>$?Wr($):[]),ce=ue(()=>h?.().filter($=>$!=null)??[]);f.useEffect(()=>{if(r||!a)return;function $(ne){ne.key==="Tab"&&ve(K,yt(je(K)))&&ee().length===0&&!E&&Qt(ne)}const X=je(K);return De(X,"keydown",$)},[r,K,a,E,ee]),f.useEffect(()=>{if(r||!x)return;const $=je(K);function X(){O.current=!1}function ne(fe){const ie=gt(fe),he=ce(),oe=ve(v,ie)||ve(b,ie)||ve(T?.portalNode,ie)||he.some(se=>se===ie||ve(se,ie));O.current=!oe,H.current=fe.pointerType||"keyboard",ie?.closest(`[${Ag}]`)&&(R.current=!0,Z.start(0,()=>{R.current=!1}))}function de(){H.current="keyboard"}return zt(De($,"pointerdown",ne,!0),De($,"pointerup",X,!0),De($,"pointercancel",X,!0),De($,"keydown",de,!0),X)},[r,v,b,K,x,T,Z,ce]),f.useEffect(()=>{if(r||!l)return;const $=je(K);function X(){R.current=!0,Z.start(0,()=>{R.current=!1})}function ne(he){const oe=gt(he);ta(oe)&&(_.current=oe)}function de(he){const oe=he.relatedTarget,se=he.currentTarget,ae=gt(he);a&&oe==null&&ae!=null&&ve(v,ae)&&Ol(ae),queueMicrotask(()=>{const xe=I(),me=g.context.triggerElements,L=ce(),z=oe?.hasAttribute(Fr("focus-guard"))&&[G.current,B.current,T?.beforeInsideRef.current,T?.afterInsideRef.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,tn(p),tn(d)].includes(oe),ye=!(ve(b,oe)||ve(v,oe)||ve(oe,v)||ve(T?.portalNode,oe)||L.some(q=>q===oe||ve(q,oe))||me.hasMatchingElement(q=>ve(q,oe))||z||N&&(bn(N.nodesRef.current,xe).find(q=>ve(q.context?.elements.floating,oe)||ve(q.context?.elements.domReference,oe))||wl(N.nodesRef.current,xe).find(q=>[q.context?.elements.floating,wo(q.context?.elements.floating)].includes(oe)||q.context?.elements.domReference===oe)));if(se===b&&K&&Kl(K),i&&se!==b&&!$o(ae)&&yt($)===$.body){if(Xe(K)&&(K.focus(),i==="popup")){Q.request(()=>{K.focus()});return}const q=ee(),re=_.current,Se=(re&&q.includes(re)?re:null)||q[q.length-1]||K;Xe(Se)&&Se.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(E||!a)&&oe&&ye&&!R.current&&(E||oe!==Hl())&&(F.current=!0,g.setOpen(!1,Ce(jn,he)))})}function fe(){O.current||(C.current.insideReactTree=!0,Y.start(0,()=>{C.current.insideReactTree=!1}))}const ie=Xe(b)?b:null;if(!(!v&&!ie))return zt(ie&&De(ie,"focusout",de),ie&&De(ie,"pointerdown",X),v&&De(v,"focusin",ne),v&&De(v,"focusout",de),v&&T&&De(v,"focusout",fe,!0))},[r,b,v,K,a,N,T,g,l,i,ee,E,I,C,Y,Z,Q,d,p,ce]),f.useEffect(()=>{if(r||!v||!x)return;const $=Array.from(T?.portalNode?.querySelectorAll(`[${Fr("portal")}]`)||[]),ne=(N?wl(N.nodesRef.current,I()):[]).find(se=>li(se.context?.elements.domReference||null))?.context?.elements.domReference,fe=[...[v,...$,G.current,B.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,...ce()],ne,tn(p),tn(d),E?b:null].filter(se=>se!=null),ie=Pl(fe,{ariaHidden:a||E,mark:!1}),he=[v,...$].filter(se=>se!=null),oe=Pl(he);return()=>{oe(),ie()}},[x,r,b,v,a,T,E,N,I,d,p,ce]),le(()=>{if(!x||r||!Xe(K))return;M.current="",H.current="";const $=je(K),X=yt($);queueMicrotask(()=>{const ne=S.current,de=typeof ne=="function"?ne(k.current||""):ne;if(de===void 0||de===!1||ve(K,X))return;let ie=null;const he=()=>(ie==null&&(ie=ee(K)),ie[0]||K);let oe;de===!0||de===null?oe=he():oe=tn(de),oe=oe||he();const se=ve(K,yt($));bo(oe,{preventScroll:oe===K,shouldFocus(){if(!j.current)return!1;if(se)return!0;const ae=yt($);return!(ae!==oe&&ve(K,ae))}})})},[r,x,K,ee,S,k,j]),le(()=>{if(r||!K)return;const $=je(K),X=yt($),ne=k.current==null;Ol(X);function de(ie){if(ie.open||(M.current=vg(ie.nativeEvent,H.current)),ie.reason===ct&&ie.nativeEvent.type==="mouseleave"&&(F.current=!0),ie.reason===Lo)if(ie.nested)F.current=!1;else if(Ji(ie.nativeEvent)||$i(ie.nativeEvent))F.current=!1;else{let he=!1;je(K).createElement("div").focus({get preventScroll(){return he=!0,!1}}),he?F.current=!1:F.current=!0}}y.on("openchange",de);function fe(ie){const he=D.current;let oe=typeof he=="function"?he(ie):he;if(oe===void 0||oe===!1)return null;oe===null&&(oe=!0);const se=b?.isConnected?b:null,ae=X?.isConnected&&kt(X)!=="body"?X:null;let xe=ne?ae||se:se||ae;return xe||(xe=Hl()||null),typeof oe=="boolean"?xe:tn(oe)||xe||null}return()=>{y.off("openchange",de);const ie=yt($),he=ce(),oe=ve(v,ie)||he.some(me=>me===ie||ve(me,ie))||N&&bn(N.nodesRef.current,I(),!1).some(me=>ve(me.context?.elements.floating,ie)),se=D.current,ae=M.current,xe=fe(ae);queueMicrotask(()=>{const me=yg(xe),L=typeof se!="boolean";if(se&&!F.current&&Xe(me)&&(!(!L&&me!==ie&&ie!==$.body)||oe)){const z={preventScroll:!0};ae==="keyboard"&&(z.focusVisible=!0),me.focus(z)}F.current=!1})}},[r,v,K,D,k,y,N,b,I,ce]),le(()=>{if(!un||x||!v)return;const $=yt(je(v));!Xe($)||!Jo($)||ve(v,$)&&$.blur()},[x,v]),le(()=>{if(!(r||!T))return T.setFocusManagerState({modal:a,closeOnFocusOut:l,open:x,onOpenChange:g.setOpen,domReference:b}),()=>{T.setFocusManagerState(null)}},[r,T,a,x,g,l,b]),le(()=>{if(!(r||!K))return Kl(K),()=>{queueMicrotask(da)}},[r,K]);const te=!r&&(a?!E:!0)&&(J||a);return c.jsxs(f.Fragment,{children:[te&&c.jsx(tr,{"data-type":"inside",ref:P,onFocus:$=>{if(a){const X=ee();bo(X[X.length-1])}else T?.portalNode&&(F.current=!1,zn($,T.portalNode)?na(b)?.focus():tn(p??T.beforeOutsideRef)?.focus())}}),n,te&&c.jsx(tr,{"data-type":"inside",ref:W,onFocus:$=>{a?bo(ee()[0]):T?.portalNode&&(l&&(F.current=!0),zn($,T.portalNode)?Qu(b)?.focus():tn(d??T.afterOutsideRef)?.focus())}})]})}function ad(e,t={}){const{enabled:n=!0,event:r="click",toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:i=!0,touchOpenDelay:a=0,reason:l=Tn}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,p=f.useRef(void 0),A=qn(),m=ht(),h=f.useMemo(()=>{function g(b,v,y,C){const I=Ce(l,v,y);b&&C==="touch"&&a>0?m.start(a,()=>{u.setOpen(!0,I)}):u.setOpen(b,I)}function x(b,v,y){const C=d.current.openEvent,I=u.select("domReferenceElement")!==v;return b&&I||!b||!o?!0:C&&i?!y(C.type):!1}return{onPointerDown(b){p.current=xn(b.pointerType,!0)&&$i(b.nativeEvent)?"virtual":b.pointerType},onMouseDown(b){const v=p.current,y=b.nativeEvent,C=u.select("open");if(b.button!==0||r==="click"||xn(v,!0)&&s)return;const I=x(C,b.currentTarget,S=>S==="click"||S==="mousedown"),w=gt(y);if(Jo(w)){g(I,y,w,v);return}const E=b.currentTarget;A.request(()=>{g(I,y,E,v)})},onClick(b){if(r==="mousedown-only")return;const v=p.current;if(r==="mousedown"&&v){p.current=void 0;return}if(xn(v,!0)&&s)return;const y=u.select("open"),C=x(y,b.currentTarget,I=>I==="click"||I==="mousedown"||I==="keydown"||I==="keyup");g(C,b.nativeEvent,b.currentTarget,v)},onKeyDown(){p.current=void 0}}},[d,r,s,l,u,i,o,A,m,a]);return f.useMemo(()=>n?{reference:h}:dt,[n,h])}function Cg(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){const s=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",l=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let u=s.width,d=s.height,p=s.x,A=s.y;return n==null&&t.x&&i&&(n=s.x-t.x),r==null&&t.y&&a&&(r=s.y-t.y),p-=n||0,A-=r||0,u=0,d=0,!o||l?(u=t.axis==="y"?s.width:0,d=t.axis==="x"?s.height:0,p=i&&t.x!=null?t.x:p,A=a&&t.y!=null?t.y:A):o&&!l&&(d=t.axis==="x"?s.height:d,u=t.axis==="y"?s.width:u),o=!0,{width:u,height:d,x:p,y:A,top:A,right:p+u,bottom:A+d,left:p}}}}function Wl(e){return e!=null&&e.clientX!=null}function Ig(e,t={}){const{enabled:n=!0,axis:r="both"}=t,o="rootStore"in e?e.rootStore:e,s=o.useState("open"),i=o.useState("floatingElement"),a=o.useState("domReferenceElement"),l=o.context.dataRef,u=f.useRef(!1),d=f.useRef(null),[p,A]=f.useState(),[m,h]=f.useState([]),g=ue(C=>{o.set("positionReference",C)}),x=ue((C,I,w)=>{u.current||l.current.openEvent&&!Wl(l.current.openEvent)||o.set("positionReference",Cg(w??a,{x:C,y:I,axis:r,dataRef:l,pointerType:p}))}),b=ue(C=>{s?d.current||(x(C.clientX,C.clientY,C.currentTarget),h([])):x(C.clientX,C.clientY,C.currentTarget)}),v=xn(p)?i:s;f.useEffect(()=>{if(!n){g(a);return}if(!v)return;function C(){d.current?.(),d.current=null}const I=it(i);function w(E){const S=gt(E);ve(i,S)?C():x(E.clientX,E.clientY)}return!l.current.openEvent||Wl(l.current.openEvent)?d.current=De(I,"mousemove",w):g(a),C},[v,n,i,l,a,o,x,g,m]),f.useEffect(()=>()=>{o.set("positionReference",null)},[o]),f.useEffect(()=>{n&&!i&&(u.current=!1)},[n,i]),f.useEffect(()=>{!n&&s&&(u.current=!0)},[n,s]);const y=f.useMemo(()=>{function C(I){A(I.pointerType)}return{onPointerDown:C,onPointerEnter:C,onMouseMove:b,onMouseEnter:b}},[b]);return f.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function wg(){return!1}function kg(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function es(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:i=wg,bubbles:a,externalTree:l}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),p=u.useState("floatingElement"),{dataRef:A}=u.context,m=kn(l),h=ue(typeof o=="function"?o:()=>!1),g=typeof o=="function"?h:o,x=g!==!1,b=ue(()=>s),{escapeKey:v,outsidePress:y}=kg(a),C=f.useRef(!1),I=f.useRef(!1),w=f.useRef(!1),E=f.useRef(!1),S=f.useRef(""),D=f.useRef(null),k=ht(),j=ht(),N=ue(()=>{j.clear(),A.current.insideReactTree=!1}),T=ue(P=>{const W=A.current.floatingContext?.nodeId;return(m?bn(m.nodesRef.current,W):[]).some(Z=>Z.context?.open&&!Z.context.dataRef.current[P])}),F=ue(P=>Ss(P,u.select("floatingElement"))||Ss(P,u.select("domReferenceElement"))),R=ue(P=>{i()&&u.setOpen(!1,Ce(Tn,P.nativeEvent))}),O=ue(P=>{if(!d||!n||!r||P.key!=="Escape"||E.current||!v&&T("__escapeKeyBubbles"))return;const W=wA(P)?P.nativeEvent:P,Y=Ce(Qo,W);u.setOpen(!1,Y),Y.isCanceled||P.preventDefault(),!v&&!Y.isPropagationAllowed&&P.stopPropagation()}),_=ue(()=>{A.current.insideReactTree=!0,j.start(0,N)}),M=ue(P=>{if(!d||!n||P.button!==0)return;const W=gt(P.nativeEvent);ve(u.select("floatingElement"),W)&&(C.current||(C.current=!0,I.current=!1))}),H=ue(P=>{!d||!n||(P.defaultPrevented||P.nativeEvent.defaultPrevented)&&C.current&&(I.current=!0)});f.useEffect(()=>{if(!d||!n)return N;A.current.__escapeKeyBubbles=v,A.current.__outsidePressBubbles=y;const P=new Wt,W=new Wt;function Y(){P.clear(),E.current=!0}function Z(){P.start(un?5:0,()=>{E.current=!1})}function Q(){w.current=!0,W.start(0,()=>{w.current=!1})}function J(){C.current=!1,I.current=!1}function K(){const L=S.current,z=L==="pen"||!L?"mouse":L,ye=b(),q=typeof ye=="function"?ye():ye;return typeof q=="string"?q:q[z]}function ee(L){const z=K();return z==="intentional"&&L.type!=="click"||z==="sloppy"&&L.type==="click"}function ce(L){const z=A.current.floatingContext?.nodeId,ye=m&&bn(m.nodesRef.current,z).some(q=>Ss(L,q.context?.elements.floating));return F(L)||ye}function te(L){if(ee(L)){L.type!=="click"&&!F(L)&&(W.clear(),w.current=!1),N();return}if(A.current.insideReactTree){N();return}const z=gt(L),ye=`[${Fr("inert")}]`,q=Te(z)?z.getRootNode():null,re=Array.from((Mi(q)?q:je(u.select("floatingElement"))).querySelectorAll(ye)),Se=u.context.triggerElements;if(z&&(Se.hasElement(z)||Se.hasMatchingElement(We=>ve(We,z))))return;let ke=Te(z)?z:null;for(;ke&&!Fn(ke);){const We=$n(ke);if(Fn(We)||!Te(We))break;ke=We}if(!(re.length&&Te(z)&&!yA(z)&&!ve(z,u.select("floatingElement"))&&re.every(We=>!ve(ke,We)))){if(Xe(z)&&!("touches"in L)){const We=Fn(z),rt=Kt(z),Ge=/auto|scroll/,At=We||Ge.test(rt.overflowX),$e=We||Ge.test(rt.overflowY),Oe=At&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,lt=$e&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,Ee=rt.direction==="rtl",Le=lt&&(Ee?L.offsetX<=z.offsetWidth-z.clientWidth:L.offsetX>z.clientWidth),Ze=Oe&&L.offsetY>z.clientHeight;if(Le||Ze)return}if(!ce(L)){if(K()==="intentional"&&w.current){W.clear(),w.current=!1;return}typeof g=="function"&&!g(L)||T("__outsidePressBubbles")||(u.setOpen(!1,Ce(Lo,L)),N())}}}function $(L){K()!=="sloppy"||L.pointerType==="touch"||!u.select("open")||!n||F(L)||te(L)}function X(L){if(K()!=="sloppy"||!u.select("open")||!n||F(L))return;const z=L.touches[0];z&&(D.current={startTime:Date.now(),startX:z.clientX,startY:z.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function ne(L,z){const ye=gt(L);if(!ye)return;const q=De(ye,L.type,()=>{z(L),q()})}function de(L){S.current="touch",ne(L,X)}function fe(L){k.clear(),L.type==="pointerdown"&&(S.current=L.pointerType),!(L.type==="mousedown"&&D.current&&!D.current.dismissOnMouseDown)&&ne(L,z=>{z.type==="pointerdown"?$(z):te(z)})}function ie(L){if(!C.current)return;const z=I.current;if(J(),K()==="intentional"){if(L.type==="pointercancel"){z&&Q();return}if(!ce(L)){if(z){Q();return}typeof g=="function"&&!g(L)||(W.clear(),w.current=!0,N())}}}function he(L){if(K()!=="sloppy"||!D.current||F(L))return;const z=L.touches[0];if(!z)return;const ye=Math.abs(z.clientX-D.current.startX),q=Math.abs(z.clientY-D.current.startY),re=Math.sqrt(ye*ye+q*q);re>5&&(D.current.dismissOnTouchEnd=!0),re>10&&(te(L),k.clear(),D.current=null)}function oe(L){ne(L,he)}function se(L){K()!=="sloppy"||!D.current||F(L)||(D.current.dismissOnTouchEnd&&te(L),k.clear(),D.current=null)}function ae(L){ne(L,se)}const xe=je(p),me=zt(r&&zt(De(xe,"keydown",O),De(xe,"compositionstart",Y),De(xe,"compositionend",Z)),x&&zt(De(xe,"click",fe,!0),De(xe,"pointerdown",fe,!0),De(xe,"pointerup",ie,!0),De(xe,"pointercancel",ie,!0),De(xe,"mousedown",fe,!0),De(xe,"mouseup",ie,!0),De(xe,"touchstart",de,!0),De(xe,"touchmove",oe,!0),De(xe,"touchend",ae,!0)));return()=>{me(),P.clear(),W.clear(),J(),w.current=!1,N()}},[A,p,r,x,g,d,n,v,y,O,N,b,T,F,m,u,k]);const G=f.useMemo(()=>({onKeyDown:O,onPointerDown:R,onClick:R}),[O,R]),B=f.useMemo(()=>({onKeyDown:O,onPointerDown:H,onMouseDown:H,onClickCapture:_,onMouseDownCapture(P){_(),M(P)},onPointerDownCapture(P){_(),M(P)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[O,_,M,H]);return f.useMemo(()=>n?{reference:G,floating:B,trigger:G}:{},[n,G,B])}function Ll(e,t,n){let{reference:r,floating:o}=e;const s=Mt(t),i=ea(t),a=qi(i),l=Tt(t),u=s==="y",d=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,A=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:p};break;case"left":m={x:r.x-o.width,y:p};break;default:m={x:r.x,y:r.y}}const h=In(t);return h&&(m[i]+=A*(h==="end"?1:-1)*(n&&u?-1:1)),m}async function Eg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:A=!1,padding:m=0}=vn(t,e),h=Nu(m),x=a[A?p==="floating"?"reference":"floating":p],b=Dr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),v=p==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},I=Dr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(b.top-I.top+h.top)/C.y,bottom:(I.bottom-b.bottom+h.bottom)/C.y,left:(b.left-I.left+h.left)/C.x,right:(I.right-b.right+h.right)/C.x}}const Sg=50,Rg=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Eg},l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=Ll(u,r,l),A=r,m=0;const h={};for(let g=0;g<s.length;g++){const x=s[g];if(!x)continue;const{name:b,fn:v}=x,{x:y,y:C,data:I,reset:w}=await v({x:d,y:p,initialPlacement:r,placement:A,strategy:o,middlewareData:h,rects:u,platform:a,elements:{reference:e,floating:t}});d=y??d,p=C??p,h[b]={...h[b],...I},w&&m<Sg&&(m++,typeof w=="object"&&(w.placement&&(A=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:d,y:p}=Ll(u,A,l)),g=-1)}return{x:d,y:p,placement:A,strategy:o,middlewareData:h}},Dg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:A,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...x}=vn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Tt(o),v=Mt(a),y=Tt(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),I=A||(y||!g?[Eo(a)]:RA(a)),w=h!=="none";!A&&w&&I.push(...jA(a,g,h,C));const E=[a,...I],S=await l.detectOverflow(t,x),D=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&D.push(S[b]),p){const F=SA(o,i,C);D.push(S[F[0]],S[F[1]])}if(k=[...k,{placement:o,overflows:D}],!D.every(F=>F<=0)){var j,N;const F=(((j=s.flip)==null?void 0:j.index)||0)+1,R=E[F];if(R&&(!(p==="alignment"?v!==Mt(R):!1)||k.every(M=>Mt(M.placement)===v?M.overflows[0]>0:!0)))return{data:{index:F,overflows:k},reset:{placement:R}};let O=(N=k.filter(_=>_.overflows[0]<=0).sort((_,M)=>_.overflows[1]-M.overflows[1])[0])==null?void 0:N.placement;if(!O)switch(m){case"bestFit":{var T;const _=(T=k.filter(M=>{if(w){const H=Mt(M.placement);return H===v||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,G)=>H+G,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:T[0];_&&(O=_);break}case"initialPlacement":O=a;break}if(o!==O)return{reset:{placement:O}}}return{}}}},ld=new Set(["left","top"]);async function Fg(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Tt(n),a=In(n),l=Mt(n)==="y",u=ld.has(i)?-1:1,d=s&&l?-1:1,p=vn(t,e);let{mainAxis:A,crossAxis:m,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof h=="number"&&(m=a==="end"?h*-1:h),l?{x:m*d,y:A*u}:{x:A*u,y:m*d}}const Bg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Fg(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},jg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:y,y:C}=v;return{x:y,y:C}}},...u}=vn(e,t),d={x:n,y:r},p=await s.detectOverflow(t,u),A=Mt(o),m=Xi(A);let h=d[m],g=d[A];const x=(v,y)=>Mu(y+p[v==="y"?"top":"left"],y,y-p[v==="y"?"bottom":"right"]);i&&(h=x(m,h)),a&&(g=x(A,g));const b=l.fn({...t,[m]:h,[A]:g});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:i,[A]:a}}}}}},Mg=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:o,y:s,placement:i,rects:a,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:p=!0}=vn(e,t),A={x:o,y:s},m=Mt(i),h=Xi(m);let g=A[h],x=A[m];const b=vn(u,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(n=b.mainAxis)!=null?n:0,crossAxis:(r=b.crossAxis)!=null?r:0};if(d){const I=h==="y"?"height":"width",w=a.reference[h]-a.floating[I]+v.mainAxis,E=a.reference[h]+a.reference[I]-v.mainAxis;g<w?g=w:g>E&&(g=E)}if(p){var y,C;const I=h==="y"?"width":"height",w=ld.has(Tt(i)),E=a.reference[m]-a.floating[I]+(w&&((y=l.offset)==null?void 0:y[m])||0)+(w?0:v.crossAxis),S=a.reference[m]+a.reference[I]+(w?0:((C=l.offset)==null?void 0:C[m])||0)-(w?v.crossAxis:0);x<E?x=E:x>S&&(x=S)}return{[h]:g,[m]:x}}}},Ng=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...a}=vn(e,t),l=await o.detectOverflow(t,a),u=Tt(n),d=In(n),p=Mt(n)==="y",{width:A,height:m}=r.floating;let h,g;u==="top"||u==="bottom"?(h=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,h=d==="end"?"top":"bottom");const x=m-l.top-l.bottom,b=A-l.left-l.right,v=Xn(m-l[h],x),y=Xn(A-l[g],b),C=t.middlewareData.shift,I=!C;let w=v,E=y;C!=null&&C.enabled.x&&(E=b),C!=null&&C.enabled.y&&(w=x),I&&!d&&(p?E=A-2*sn(l.left,l.right):w=m-2*sn(l.top,l.bottom)),await i({...t,availableWidth:E,availableHeight:w});const S=await o.getDimensions(s.floating);return A!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}};function cd(e){const t=Kt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ko(n)!==s||ko(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function pa(e){return Te(e)?e:e.contextElement}function Un(e){const t=pa(e);if(!Xe(t))return an(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=cd(t);let i=(s?ko(n.width):n.width)/r,a=(s?ko(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Tg=an(0);function ud(e){const t=it(e);return!Cu()||!t.visualViewport?Tg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pg(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===it(e)}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=pa(e);let i=an(1);t&&(r?Te(r)&&(i=Un(r)):i=Un(e));const a=Pg(s,n,r)?ud(s):an(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,p=o.height/i.y;if(s&&r){const A=it(s),m=Te(r)?it(r):r;let h=A,g=bl(h);for(;g&&m!==h;){const x=Un(g),b=g.getBoundingClientRect(),v=Kt(g),y=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*x.x,C=b.top+(g.clientTop+parseFloat(v.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,p*=x.y,l+=y,u+=C,h=it(g),g=bl(h)}}return Dr({width:d,height:p,x:l,y:u})}function ts(e,t){const n=Go(e).scrollLeft;return t?t.left+n:Mn(Cn(e)).left+n}function dd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ts(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function _g(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Cn(r),a=t?Ni(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=an(1);const d=an(0),p=Xe(r);if((p||!s)&&((kt(r)!=="body"||Ti(i))&&(l=Go(r)),p)){const m=Mn(r);u=Un(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const A=i&&!p&&!s?dd(i,l):an(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+A.x,y:n.y*u.y-l.scrollTop*u.y+d.y+A.y}}function Og(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Hg(e){const t=Go(e),n=e.ownerDocument.body,r=sn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=sn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+ts(e);const i=-t.scrollTop;return Kt(n).direction==="rtl"&&(s+=sn(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const Kg=25;function Wg(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=it(e),s=Cn(e),i=o.visualViewport;let a=s.clientWidth,l=s.clientHeight,u=0,d=0;if(i){const A=!Cu()||t==="fixed";r?A||(u=-i.offsetLeft,d=-i.offsetTop):(a=i.width,l=i.height,A&&(u=i.offsetLeft,d=i.offsetTop))}if(ts(s)<=0){const A=s.ownerDocument,m=A.body,h=getComputedStyle(m),g=A.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(s.clientWidth-m.clientWidth-g),b=getComputedStyle(s).scrollbarGutter==="stable both-edges"?x/2:x;b<=Kg&&(a-=b)}return{width:a,height:l,x:u,y:d}}function Lg(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Un(e),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function Ql(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=Wg(e,n,t);else if(t==="document")r=Hg(Cn(e));else if(Te(t))r=Lg(t,n);else{const o=ud(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dr(r)}function Qg(e,t){const n=t.get(e);if(n)return n;let r=ri(e,[],!1).filter(a=>Te(a)&&kt(a)!=="body"),o=null;const s=Kt(e).position==="fixed";let i=s?$n(e):e;for(;Te(i)&&!Fn(i);){const a=Kt(i),l=yu(i),u=o?o.position:s?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&a.position==="static")?r=r.filter(p=>p!==i):o=a,i=$n(i)}return t.set(e,r),r}function Gg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Ni(t)?[]:Qg(t,this._c):[].concat(n),r],a=Ql(t,i[0],o);let l=a.top,u=a.right,d=a.bottom,p=a.left;for(let A=1;A<i.length;A++){const m=Ql(t,i[A],o);l=sn(m.top,l),u=Xn(m.right,u),d=Xn(m.bottom,d),p=sn(m.left,p)}return{width:u-p,height:d-l,x:p,y:l}}function Yg(e){const{width:t,height:n}=cd(e);return{width:t,height:n}}function zg(e,t,n){const r=Xe(t),o=Cn(t),s=n==="fixed",i=Mn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=an(0);if((r||!s)&&((kt(t)!=="body"||Ti(o))&&(a=Go(t)),r)){const A=Mn(t,!0,s,t);l.x=A.x+t.clientLeft,l.y=A.y+t.clientTop}!r&&o&&(l.x=ts(o));const u=o&&!r&&!s?dd(o,a):an(0),d=i.left+a.scrollLeft-l.x-u.x,p=i.top+a.scrollTop-l.y-u.y;return{x:d,y:p,width:i.width,height:i.height}}function Ns(e){return Kt(e).position==="static"}function Gl(e,t){if(!Xe(e)||Kt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function fd(e,t){const n=it(e);if(Ni(e))return n;if(!Xe(e)){let o=$n(e);for(;o&&!Fn(o);){if(Te(o)&&!Ns(o))return o;o=$n(o)}return n}let r=Gl(e,t);for(;r&&ih(r)&&Ns(r);)r=Gl(r,t);return r&&Fn(r)&&Ns(r)&&!yu(r)?n:r||ah(e)||n}const Ug=async function(e){const t=this.getOffsetParent||fd,n=this.getDimensions,r=await n(e.floating);return{reference:zg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vg(e){return Kt(e).direction==="rtl"}const pd={convertOffsetParentRelativeRectToViewportRelativeRect:_g,getDocumentElement:Cn,getClippingRect:Gg,getOffsetParent:fd,getElementRects:Ug,getClientRects:Og,getDimensions:Yg,getScale:Un,isElement:Te,isRTL:Vg};function hd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zg(e,t,n){let r=null,o;const s=Cn(e);function i(){var d;clearTimeout(o),(d=r)==null||d.disconnect(),r=null}function a(d,p){d===void 0&&(d=!1),p===void 0&&(p=1),i();const A=e.getBoundingClientRect(),{left:m,top:h,width:g,height:x}=A;if(d||t(),!g||!x)return;const b=$r(h),v=$r(s.clientWidth-(m+g)),y=$r(s.clientHeight-(h+x)),C=$r(m),w={rootMargin:-b+"px "+-v+"px "+-y+"px "+-C+"px",threshold:sn(0,Xn(1,p))||1};let E=!0;function S(D){const k=D[0].intersectionRatio;if(!hd(A,e.getBoundingClientRect()))return a();if(k!==p){if(!E)return a();k?a(!1,k):o=setTimeout(()=>{a(!1,1e-7)},1e3)}E=!1}try{r=new IntersectionObserver(S,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,w)}r.observe(e)}const l=it(e),u=()=>a(n);return l.addEventListener("resize",u),a(!0),()=>{l.removeEventListener("resize",u),i()}}function Yl(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=pa(e),d=o||s?[...u?ri(u):[],...t?ri(t):[]]:[];d.forEach(b=>{o&&b.addEventListener("scroll",n),s&&b.addEventListener("resize",n)});const p=u&&a?Zg(u,n,s):null;let A=-1,m=null;i&&(m=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(t)})),n()}),u&&!l&&m.observe(u),t&&m.observe(t));let h,g=l?Mn(e):null;l&&x();function x(){const b=Mn(e);g&&!hd(g,b)&&n(),g=b,h=requestAnimationFrame(x)}return n(),()=>{var b;d.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),p?.(),(b=m)==null||b.disconnect(),m=null,l&&cancelAnimationFrame(h)}}const Jg=Bg,$g=jg,Xg=Dg,qg=Ng,em=Mg,tm=(e,t,n)=>{const r=new Map,o=n??{},s={...pd,...o.platform,_c:r};return Rg(e,t,{...o,platform:s})};var nm=typeof document<"u",rm=function(){},vo=nm?f.useLayoutEffect:rm;function Do(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Do(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Do(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ad(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zl(e,t){const n=Ad(e);return Math.round(t*n)/n}function Ts(e){const t=f.useRef(e);return vo(()=>{t.current=e}),t}function om(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,p]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[A,m]=f.useState(r);Do(A,r)||m(r);const[h,g]=f.useState(null),[x,b]=f.useState(null),v=f.useCallback(M=>{M!==w.current&&(w.current=M,g(M))},[]),y=f.useCallback(M=>{M!==E.current&&(E.current=M,b(M))},[]),C=s||h,I=i||x,w=f.useRef(null),E=f.useRef(null),S=f.useRef(d),D=l!=null,k=Ts(l),j=Ts(o),N=Ts(u),T=f.useCallback(()=>{if(!w.current||!E.current)return;const M={placement:t,strategy:n,middleware:A};j.current&&(M.platform=j.current),tm(w.current,E.current,M).then(H=>{const G={...H,isPositioned:N.current!==!1};F.current&&!Do(S.current,G)&&(S.current=G,cn.flushSync(()=>{p(G)}))})},[A,t,n,j,N]);vo(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,p(M=>({...M,isPositioned:!1})))},[u]);const F=f.useRef(!1);vo(()=>(F.current=!0,()=>{F.current=!1}),[]),vo(()=>{if(C&&(w.current=C),I&&(E.current=I),C&&I){if(k.current)return k.current(C,I,T);T()}},[C,I,T,k,D]);const R=f.useMemo(()=>({reference:w,floating:E,setReference:v,setFloating:y}),[v,y]),O=f.useMemo(()=>({reference:C,floating:I}),[C,I]),_=f.useMemo(()=>{const M={position:n,left:0,top:0};if(!O.floating)return M;const H=zl(O.floating,d.x),G=zl(O.floating,d.y);return a?{...M,transform:"translate("+H+"px, "+G+"px)",...Ad(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:G}},[n,a,O.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:T,refs:R,elements:O,floatingStyles:_}),[d,T,R,O,_])}const sm=(e,t)=>{const n=Jg(e);return{name:n.name,fn:n.fn,options:[e,t]}},im=(e,t)=>{const n=$g(e);return{name:n.name,fn:n.fn,options:[e,t]}},am=(e,t)=>({fn:em(e).fn,options:[e,t]}),lm=(e,t)=>{const n=Xg(e);return{name:n.name,fn:n.fn,options:[e,t]}},cm=(e,t)=>{const n=qg(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ps={exports:{}},_s={};var Ul;function um(){if(Ul)return _s;Ul=1;var e=xu(),t=Yu();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return _s.useSyncExternalStoreWithSelector=function(u,d,p,A,m){var h=s(null);if(h.current===null){var g={hasValue:!1,value:null};h.current=g}else g=h.current;h=a(function(){function b(w){if(!v){if(v=!0,y=w,w=A(w),m!==void 0&&g.hasValue){var E=g.value;if(m(E,w))return C=E}return C=w}if(E=C,r(y,w))return E;var S=A(w);return m!==void 0&&m(E,S)?(y=w,E):(y=w,C=S)}var v=!1,y,C,I=p===void 0?null:p;return[function(){return b(d())},I===null?void 0:function(){return b(I())}]},[d,p,A,m]);var x=o(u,h[0],h[1]);return i(function(){g.hasValue=!0,g.value=x},[x]),l(x),x},_s}var Vl;function dm(){return Vl||(Vl=1,Ps.exports=um()),Ps.exports}var fm=dm();const hi=[];let Ai;function pm(){return Ai}function hm(e){hi.push(e)}function ha(e){const t=(n,r)=>{const o=Ft(Am).current;let s;try{Ai=o;for(const i of hi)i.before(o);s=e(n,r);for(const i of hi)i.after(o);o.didInitialize=!0}finally{Ai=void 0}return s};return t.displayName=e.displayName||e.name,t}function gd(e){return f.forwardRef(ha(e))}function Am(){return{didInitialize:!1}}const gm=bu(19),mm=gm?bm:vm;function Ie(e,t,n,r,o){return mm(e,t,n,r,o)}function xm(e,t,n,r,o){const s=f.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Xo.useSyncExternalStore(e.subscribe,s,s)}hm({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),Xo.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function bm(e,t,n,r,o){const s=pm();if(!s)return xm(e,t,n,r,o);const i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,n)||!Object.is(a.a2,r)||!Object.is(a.a3,o))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=n,a.a2=r,a.a3=o,a.value=t(e.getSnapshot(),n,r,o))):(a={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(a)),a.value}function vm(e,t,n,r,o){return fm.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class ym{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Ie(this,t,n,r,o)}}class Gr extends ym{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){f.useDebugValue(t);const r=this;le(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;le(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);le(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){f.useDebugValue(t);const r=this,o=n!==void 0;le(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return f.useDebugValue(t),Ie(this,this.selectors[t],n,r,o)}useContextCallback(t,n){f.useDebugValue(t);const r=ue(n??Er);this.context[t]=r}useStateSetter(t){const n=f.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}const Cm={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class ns extends Gr{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:rd(),nested:r,triggerElements:s},Cm),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&kA(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function md(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:i}=e,a=t.useState("open"),l=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,p=i,A=f.useRef(null);r===void 0&&A.current===null&&(A.current=new ns({open:a,transitionStatus:void 0,referenceElement:l,floatingElement:u,triggerElements:d,onOpenChange:p,floatingId:o,syncOnly:!0,nested:s}));const m=r??A.current;return t.useSyncedValue("floatingId",o),le(()=>{const h={open:a,floatingId:o,referenceElement:l,floatingElement:u};Te(l)&&(h.domReferenceElement=l),m.state.positionReference===m.state.referenceElement&&(h.positionReference=l),m.update(h)},[a,o,l,u,m]),m.context.onOpenChange=p,m.context.nested=s,m}const rs={tabIndex:-1,[ai]:""};function Im(e){return t=>t==="touch"?e.current:!0}function xd(e,t=!1){const n=Jn(),r=wn()!=null,o=Ft(()=>e(n,r)).current;return md({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function Aa({handle:e,store:t}){return le(()=>e.attachStore(t),[e,t]),null}function wm(e,t){const n=f.useRef(null),r=f.useRef(null);return f.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const i=n.current,a=r.current,l=t.context.triggerElements.getById(i);a&&l===a&&(t.context.triggerElements.delete(i),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function ga(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function bd(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function km(e,t,n,r={}){const o=n.reason,s=o===ct,i=t&&o===Yn,a=!t&&(o===Tn||o===Qo),l=bd(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const u=()=>{const d={...r.extraState,open:t};i?d.instantType="focus":a?d.instantType="dismiss":s&&(d.instantType=void 0),ga(d,t,n.trigger,l()),e.update(d)};s?cn.flushSync(u):u()}function vd(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=wm(e,n),i=ue(l=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:l,...u?r:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:l,...r})}),a=f.useCallback(l=>{s(l),l&&i(l)},[s,i]);return le(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:o}}function ma(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=f.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),i=e.useState("activeTriggerId"),a=e.useState("activeTriggerElement");le(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const l=e.context.triggerElements.size,u={};e.state.triggerCount!==l&&(u.triggerCount=l);const d=e.select("activeTriggerId");let p=null;if(d){const A=e.context.triggerElements.getById(d);if(A)r.current=d,A!==e.state.activeTriggerElement&&(u.activeTriggerElement=A);else{for(const[m,h]of e.context.triggerElements.entries())if(h===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=h,r.current=m;break}u.activeTriggerId===void 0&&(r.current===d?p=d:r.current=null)}}else r.current=null;if(!p&&!d&&l===1){const A=e.context.triggerElements.entries().next();if(!A.done){const[m,h]=A.value;u.activeTriggerId=m,u.activeTriggerElement=h,r.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),p&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===p&&!e.context.triggerElements.getById(p)){const A=Ce(Pt);e.setOpen(!1,A),A.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,i,a,n])}function xa(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=sr(e),i=t.useState("preventUnmountingOnClose"),a=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:a});const l=ue(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Zt({enabled:r&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:s}}function ba(e,t){e.useSyncedValues(t),le(()=>()=>{e.update({activeTriggerProps:dt,inactiveTriggerProps:dt,popupProps:dt})},[e])}function Em(e,t){le(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),le(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Yr{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Sm(){return new ns({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Yr,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function va(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Sm(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:dt,inactiveTriggerProps:dt,popupProps:dt}}function yd(e,t,n=!1){return new ns({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const wr=e=>e.triggerIdProp??e.activeTriggerId,ya=e=>e.openProp??e.open,Zl=e=>(e.popupElement?.id??e.floatingId)||void 0;function Cd(e,t){return t!==void 0&&ya(e)&&wr(e)===t}function Rm(e,t){return Cd(e,t)?!0:t!==void 0&&ya(e)&&wr(e)==null&&e.triggerCount===1}const Ca={open:ya,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:wr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Zl,isTriggerActive:(e,t)=>t!==void 0&&wr(e)===t,isOpenedByTrigger:(e,t)=>Cd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&wr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Rm(e,t)?Zl(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Id(e){const t=f.useCallback(r=>e===void 0?Er:e.subscribeStore(r),[e]),n=f.useCallback(()=>e===void 0?void 0:e.store,[e]);return Xo.useSyncExternalStore(t,n,()=>e?.serverStore)}function Dm(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=Jn(),s=wn()!=null,i=Ft(()=>new ns({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Yr,floatingId:o,syncOnly:!1,nested:s})).current;return le(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=Te(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function Fm(e){return Bm(e,e.rootContext)}function Bm(e,t){const{nodeId:n,externalTree:r}=e,o=t.useState("referenceElement"),s=t.useState("floatingElement"),i=t.useState("domReferenceElement"),a=t.useState("open"),l=t.useState("floatingId"),[u,d]=f.useState(null),[p,A]=f.useState(void 0),[m,h]=f.useState(void 0),g=f.useRef(null),x=kn(r),b=f.useMemo(()=>({reference:o,floating:s,domReference:i}),[o,s,i]),v=om({...e,elements:{...b,...u&&{reference:u}}}),y=Te(p)?p:null,C=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",p??null),t.useSyncedValue("domReferenceElement",p===void 0?i:y),t.useSyncedValue("floatingElement",C);const I=f.useCallback(j=>{const N=Te(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;d(N),v.refs.setReference(N)},[v.refs]),w=f.useCallback(j=>{(Te(j)||j===null)&&(g.current=j,A(j)),(Te(v.refs.reference.current)||v.refs.reference.current===null||j!==null&&!Te(j))&&v.refs.setReference(j)},[v.refs,A]),E=f.useCallback(j=>{h(j),v.refs.setFloating(j)},[v.refs]),S=f.useMemo(()=>({...v.refs,setReference:w,setFloating:E,setPositionReference:I,domReference:g}),[v.refs,w,E,I]),D=f.useMemo(()=>({...v.elements,domReference:i}),[v.elements,i]),k=f.useMemo(()=>({...v,dataRef:t.context.dataRef,open:a,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:S,elements:D,nodeId:n,rootStore:t}),[v,S,D,n,t,a,l]);return le(()=>{i&&(g.current=i)},[i]),le(()=>{t.context.dataRef.current.floatingContext=k;const j=x?.nodesRef.current.find(N=>N.id===n);j&&(j.context=k)}),f.useMemo(()=>({...v,context:k,refs:S,elements:D,rootStore:t}),[v,S,D,k,t])}const Os=Ui&&un;function wd(e,t={}){const{enabled:n=!0,delay:r}=t,o="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=o.context,a=f.useRef(!1),l=f.useRef(null),u=f.useRef(!0),d=ht();f.useEffect(()=>{const A=o.select("domReferenceElement");if(!n)return;const m=it(A);function h(){const b=o.select("domReferenceElement");!o.select("open")&&Xe(b)&&b===yt(je(b))&&(a.current=!0)}function g(){u.current=!0}function x(){u.current=!1}return zt(De(m,"blur",h),Os&&De(m,"keydown",g,!0),Os&&De(m,"pointerdown",x,!0))},[o,n]),f.useEffect(()=>{if(!n)return;function A(m){if(m.reason===Tn||m.reason===Qo){const h=o.select("domReferenceElement");Te(h)&&(l.current=h,a.current=!0)}}return s.on("openchange",A),()=>{s.off("openchange",A)}},[s,n,o]);const p=f.useMemo(()=>{function A(){a.current=!1,l.current=null}return{onMouseLeave(){A()},onFocus(m){const h=m.currentTarget;if(a.current){if(l.current===h)return;A()}const g=gt(m.nativeEvent);if(Te(g)){if(Os&&!m.relatedTarget){if(!u.current&&!Jo(g))return}else if(!IA(g))return}const x=Io(m.relatedTarget,o.context.triggerElements),{nativeEvent:b,currentTarget:v}=m,y=typeof r=="function"?r():r;if(o.select("open")&&x||y===0||y===void 0){o.setOpen(!0,Ce(Yn,b,v));return}d.start(y,()=>{a.current||o.setOpen(!0,Ce(Yn,b,v))})},onBlur(m){A();const h=m.relatedTarget,g=m.nativeEvent,x=Te(h)&&h.hasAttribute(Fr("focus-guard"))&&h.getAttribute("data-type")==="outside";d.start(0,()=>{const b=o.select("domReferenceElement"),v=yt(je(b));!h&&v===b||ve(i.current.floatingContext?.refs.floating.current,v)||ve(b,v)||x||Io(h??v,o.context.triggerElements)||o.setOpen(!1,Ce(Yn,g))})}}},[i,r,o,d]);return f.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class Ia{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 Wt,this.restTimeout=new Wt,this.handleCloseOptions=void 0}static create(){return new Ia}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Fo=new WeakMap;function Bo(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Fo.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Fo.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kd(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,s=Fo.get(n);s&&s!==e&&Bo(s),Bo(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,Fo.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function wa(e){const t=e.context.dataRef.current,n=Ft(()=>t.hoverInteractionState??Ia.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),ra(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ed(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:o}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),a=s.useState("floatingElement"),l=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=kn(),p=wn(),A=wa(s),m=ht(),h=ue(()=>Zu(u.current.openEvent?.type,A.interactedInside)),g=ue(()=>sg(u.current.openEvent?.type)),x=ue(()=>{Bo(A)});le(()=>{i||(A.pointerType=void 0,A.restTimeoutPending=!1,A.interactedInside=!1,x())},[i,A,x]),f.useEffect(()=>x,[x]),le(()=>{if(n&&i&&A.handleCloseOptions?.blockPointerEvents&&g()&&Te(l)&&a){const b=l,v=a,y=je(a),C=d?.nodesRef.current.find(S=>S.id===p)?.context?.elements.floating;C&&(C.style.pointerEvents="");const I=A.pointerEventsScopeElement!==v?A.pointerEventsScopeElement:null,w=C!==v?C:null,E=A.handleCloseOptions?.getScope?.()??I??w??b.closest("[data-rootownerid]")??y.body;return kd(A,{scopeElement:E,referenceElement:b,floatingElement:v}),()=>{x()}}},[n,i,l,a,A,g,d,p,x]),f.useEffect(()=>{if(!n)return;function b(){return!!(d&&p&&bn(d.nodesRef.current,p).length>0)}function v(S){const D=er(r,"close",A.pointerType),k=()=>{s.setOpen(!1,Ce(ct,S)),d?.events.emit("floating.closed",S)};D?A.openChangeTimeout.start(D,k):(A.openChangeTimeout.clear(),k())}function y(S){const D=gt(S);if(!CA(D)){A.interactedInside=!1;return}A.interactedInside=D?.closest("[aria-haspopup]")!=null}function C(){A.openChangeTimeout.clear(),m.clear(),d?.events.off("floating.closed",w),x()}function I(S){if(b()&&d){d.events.on("floating.closed",w);return}if(Io(S.relatedTarget,s.context.triggerElements))return;const D=u.current.floatingContext?.nodeId??o,k=S.relatedTarget;if(!(d&&D&&Te(k)&&bn(d.nodesRef.current,D,!1).some(N=>ve(N.context?.elements.floating,k)))){if(A.handler){A.handler(S);return}x(),g()&&!h()&&v(S)}}function w(S){!d||!p||b()||m.start(0,()=>{d.events.off("floating.closed",w),s.setOpen(!1,Ce(ct,S)),d.events.emit("floating.closed",S)})}const E=a;return zt(E&&De(E,"mouseenter",C),E&&De(E,"mouseleave",I),E&&De(E,"pointerdown",y,!0),()=>{d?.events.off("floating.closed",w)})},[n,a,s,u,r,o,g,h,x,A,d,p,m])}const jm={current:null};function Sd(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:s=!1,restMs:i=0,move:a=!0,triggerElementRef:l=jm,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:p,isClosing:A,shouldOpen:m,guardStaleOpen:h=!1}=t,g="rootStore"in e?e.rootStore:e,{dataRef:x,events:b}=g.context,v=kn(u),y=wa(g),C=f.useRef(!1),I=nt(o),w=nt(r),E=nt(i),S=nt(n),D=nt(m),k=nt(A),j=ue(()=>Zu(x.current.openEvent?.type,y.interactedInside)),N=ue(()=>D.current?.()!==!1),T=ue((O,_,M)=>{const H=g.context.triggerElements;if(H.hasElement(_))return!O||!ve(O,_);if(!Te(M))return!1;const G=M;return H.hasMatchingElement(B=>ve(B,G))&&(!O||!ve(O,G))}),F=ue(()=>{if(!y.handler)return;je(g.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),R=ue(()=>{Bo(y)});return d&&(y.handleCloseOptions=I.current?.__options),f.useEffect(()=>F,[F]),f.useEffect(()=>{if(!n)return;function O(_){_.open?C.current=!1:(C.current=_.reason===ct,F(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return b.on("openchange",O),()=>{b.off("openchange",O)}},[n,b,y,F]),f.useEffect(()=>{if(!n)return;function O(P,W=!0){const Y=er(w.current,"close",y.pointerType);Y?y.openChangeTimeout.start(Y,()=>{g.setOpen(!1,Ce(ct,P)),v?.events.emit("floating.closed",P)}):W&&(y.openChangeTimeout.clear(),g.setOpen(!1,Ce(ct,P)),v?.events.emit("floating.closed",P))}const _=l.current??(d?g.select("domReferenceElement"):null);if(!Te(_))return;function M(P){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,s&&!xn(y.pointerType))return;const W=Bl(E.current),Y=er(w.current,"open",y.pointerType),Z=gt(P),Q=P.currentTarget??null,J=g.select("domReferenceElement");let K=Q;if(Te(Z)&&!g.context.triggerElements.hasElement(Z)){for(const ie of g.context.triggerElements.elements())if(ve(ie,Z)){K=ie;break}}Te(Q)&&Te(J)&&!g.context.triggerElements.hasElement(Q)&&ve(Q,J)&&(K=J);const ee=K==null?!1:T(J,K,Z),ce=g.select("open"),te=k.current?.()??g.select("transitionStatus")==="ending",$=!ce&&te&&C.current,X=!ee&&Te(K)&&Te(J)&&ve(J,K)&&$,ne=W>0&&!Y,de=ee&&(ce||$)||X,fe=!ce||ee;if(de){N()&&g.setOpen(!0,Ce(ct,P,K));return}ne||(Y?y.openChangeTimeout.start(Y,()=>{fe&&N()&&g.setOpen(!0,Ce(ct,P,K))}):fe&&N()&&g.setOpen(!0,Ce(ct,P,K)))}function H(P){if(j()){R();return}F();const W=g.select("domReferenceElement"),Y=je(W);y.restTimeout.clear(),y.restTimeoutPending=!1;const Z=x.current.floatingContext??p?.();if(Io(P.relatedTarget,g.context.triggerElements))return;if(I.current&&Z){g.select("open")||y.openChangeTimeout.clear();const J=l.current;y.handler=I.current({...Z,tree:v,x:P.clientX,y:P.clientY,onClose(){R(),F(),S.current&&!j()&&J===g.select("domReferenceElement")&&O(P,!0)}}),Y.addEventListener("mousemove",y.handler),y.handler(P);return}(y.pointerType!=="touch"||!ve(g.select("floatingElement"),P.relatedTarget))&&O(P)}function G(P){ve(_,P.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}const B=h?De(_,"mouseout",G):void 0;return a?zt(De(_,"mousemove",M,{once:!0}),De(_,"mouseenter",M),De(_,"mouseleave",H),B):zt(De(_,"mouseenter",M),De(_,"mouseleave",H),B)},[F,R,x,w,g,n,I,y,d,T,j,s,a,E,l,v,S,p,k,N,h]),f.useMemo(()=>{if(!n)return;function O(_){y.pointerType=_.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(_){const{nativeEvent:M}=_,H=_.currentTarget,G=g.select("domReferenceElement"),B=g.select("open"),P=T(G,H,_.target);if(s&&!xn(y.pointerType))return;if(B&&P&&y.handleCloseOptions?.blockPointerEvents){const Z=g.select("floatingElement");if(Z){const Q=y.handleCloseOptions?.getScope?.()??H.ownerDocument.body;kd(y,{scopeElement:Q,referenceElement:H,floatingElement:Z})}}const W=Bl(E.current);if(B&&!P||W===0||!P&&y.restTimeoutPending&&_.movementX**2+_.movementY**2<2)return;y.restTimeout.clear();function Y(){if(y.restTimeoutPending=!1,j())return;const Z=g.select("open");!y.blockMouseMove&&(!Z||P)&&N()&&g.setOpen(!0,Ce(ct,M,H))}y.pointerType==="touch"?cn.flushSync(()=>{Y()}):P&&B?Y():(y.restTimeoutPending=!0,y.restTimeout.start(W,Y))}}},[n,y,j,T,s,g,E,N])}const Mm="Escape";function Jl(e){return un&&e.movementX===0&&e.movementY===0}function os(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function to(e,t){return os(t,e===ju||e===Zi,e===Vo||e===Zo)}function Hs(e,t,n){return os(t,e===Zi,n?e===Vo:e===Zo)||e==="Enter"||e===" "||e===""}function Nm(e,t,n){return os(t,n?e===Vo:e===Zo,e===Zi)}function Tm(e,t,n,r){const o=n?e===Zo:e===Vo,s=e===ju;return t==="both"||t==="horizontal"&&r?e===Mm:os(t,o,s)}function Rd(e,t){const{listRef:n,activeIndex:r,onNavigate:o=()=>{},enabled:s=!0,selectedIndex:i=null,allowEscape:a=!1,loopFocus:l=!1,nested:u=!1,rtl:d=!1,virtual:p=!1,focusItemOnOpen:A="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:x="vertical",parentOrientation:b,id:v,resetOnPointerLeave:y=!0,externalTree:C,grid:I}=t,w=I!=null,E="rootStore"in e?e.rootStore:e,S=E.useState("open"),D=E.useState("floatingElement"),k=E.useState("domReferenceElement"),j=E.context.dataRef,N=wo(D),T=li(k),F=nt(N),R=wn(),O=kn(C),_=f.useRef(A),M=f.useRef(i??-1),H=f.useRef(null),G=f.useRef(!0),B=ue(L=>{o(M.current===-1?null:M.current,L)}),P=f.useRef(!!D),W=f.useRef(S),Y=f.useRef(!1),Z=f.useRef(!1),Q=f.useRef(null),J=nt(g),K=nt(S),ee=nt(i),ce=nt(y),te=qn(),$=qn(),X=ue(()=>{function L(re){p?O?.events.emit("virtualfocus",re):Q.current=bo(re,{sync:Y.current,preventScroll:!0})}const z=n.current[M.current],ye=Z.current;z&&L(z),(Y.current?re=>re():re=>te.request(re))(()=>{const re=n.current[M.current]||z;if(!re)return;z||L(re),oe&&(ye||!G.current)&&re.scrollIntoView?.({block:"nearest",inline:"nearest"})})});le(()=>{j.current.orientation=x},[j,x]),le(()=>{s&&(S&&D?(M.current=i??-1,_.current&&i!=null&&(Z.current=!0,B())):P.current&&(M.current=-1,B()))},[s,S,D,i,B]),le(()=>{if(s){if(!S){Y.current=!1;return}if(D)if(r==null){if(Y.current=!1,ee.current!=null)return;if(P.current&&(M.current=-1,X()),(!W.current||!P.current)&&_.current&&(H.current!=null||_.current===!0&&H.current==null)){let L=0;const z=()=>{n.current[0]==null?(L<2&&(L?q=>$.request(q):queueMicrotask)(z),L+=1):(M.current=H.current==null||Hs(H.current,x,d)||u?xo(n):ui(n),H.current=null,B())};z()}}else Ir(n.current,r)||(M.current=r,X(),Z.current=!1)}},[s,S,D,r,ee,u,n,x,d,B,X,$]),le(()=>{if(!s||D||!O||p||!P.current)return;const L=O.nodesRef.current,z=L.find(re=>re.id===R)?.context?.elements.floating,ye=yt(je(k??z??null)),q=L.some(re=>re.context&&ve(re.context.elements.floating,ye));z&&!q&&G.current&&z.focus({preventScroll:!0})},[s,D,k,O,R,p]),le(()=>{W.current=S,P.current=!!D}),le(()=>{S||(H.current=null,_.current=A)},[S,A]);const ne=r!=null,de=ue(L=>{if(!K.current)return;const z=n.current.indexOf(L.currentTarget);z!==-1&&(M.current!==z||r!==z)&&(M.current=z,B(L))}),fe=ue(()=>b??O?.nodesRef.current.find(L=>L.id===R)?.context?.dataRef?.current.orientation),ie=ue(()=>xo(n,J.current)),he=ue(L=>{if(G.current=!1,Y.current=!0,L.which===229||!K.current&&L.currentTarget===F.current)return;if(u&&Tm(L.key,x,d,w)){to(L.key,fe())||Qt(L),E.setOpen(!1,Ce(oi,L.nativeEvent)),Xe(k)&&(p?O?.events.emit("virtualfocus",k):k.focus());return}const z=M.current,ye=xo(n,g),q=ui(n,g);if(T||(L.key==="Home"&&(Qt(L),M.current=ye,B(L)),L.key==="End"&&(Qt(L),M.current=q,B(L))),I!=null){const re=I(L,M.current,n,x,l,d,g,ye,q);if(re!=null&&(M.current=re,B(L)),x==="both")return}if(to(L.key,x)){if(Qt(L),S&&!p&&yt(L.currentTarget.ownerDocument)===L.currentTarget){M.current=Hs(L.key,x,d)?ye:q,B(L);return}Hs(L.key,x,d)?l?z>=q?a&&z!==n.current.length?M.current=-1:(Y.current=!1,M.current=ye):M.current=on(n.current,{startingIndex:z,disabledIndices:g}):M.current=Math.min(q,on(n.current,{startingIndex:z,disabledIndices:g})):l?z<=ye?a&&z!==-1?M.current=n.current.length:(Y.current=!1,M.current=q):M.current=on(n.current,{startingIndex:z,decrement:!0,disabledIndices:g}):M.current=Math.max(ye,on(n.current,{startingIndex:z,decrement:!0,disabledIndices:g})),Ir(n.current,M.current)&&(M.current=-1),B(L)}}),oe=f.useMemo(()=>({onFocus(z){Y.current=!0,de(z)},onClick:({currentTarget:z})=>z.focus({preventScroll:!0}),onMouseMove(z){Jl(z)||(Y.current=!0,Z.current=!1,m&&de(z))},onPointerLeave(z){if(!K.current||!G.current||z.pointerType==="touch")return;Y.current=!0;const ye=z.relatedTarget;if(!(!m||n.current.includes(ye))&&ce.current&&(Q.current?.(),Q.current=null,M.current=-1,B(z),!p)){const q=F.current,re=yt(je(q));q&&ve(q,re)&&q.focus({preventScroll:!0})}}}),[de,K,F,m,n,B,ce,p]),se=f.useMemo(()=>p&&S&&ne&&{"aria-activedescendant":`${v}-${r}`},[p,S,ne,v,r]),ae=f.useMemo(()=>({"aria-orientation":x==="both"?void 0:x,...T?{}:se,onKeyDown(L){if(L.key==="Tab"&&L.shiftKey&&S&&!p){const z=gt(L.nativeEvent);if(z&&!ve(F.current,z))return;Qt(L),E.setOpen(!1,Ce(jn,L.nativeEvent)),Xe(k)&&k.focus();return}he(L)},onPointerMove(L){Jl(L)||(G.current=!0)}}),[se,he,F,x,T,E,S,p,k]),xe=f.useMemo(()=>{function L(q){E.setOpen(!0,Ce(oi,q.nativeEvent,q.currentTarget))}function z(q){A==="auto"&&Ji(q.nativeEvent)&&(_.current=!p)}function ye(q){_.current=A,A==="auto"&&$i(q.nativeEvent)&&(_.current=!0)}return{onKeyDown(q){const re=E.select("open");G.current=!1;const Se=q.key.startsWith("Arrow"),ke=Nm(q.key,fe(),d),We=to(q.key,x),rt=(u?ke:We)||q.key==="Enter"||q.key.trim()==="";if(p&&re)return he(q);if(!(!re&&!h&&Se)){if(rt){const Ge=to(q.key,fe());H.current=u&&Ge?null:q.key}if(u){ke&&(Qt(q),re?(M.current=ie(),B(q)):L(q));return}We&&(ee.current!=null&&(M.current=ee.current),Qt(q),!re&&h?L(q):he(q),re&&B(q))}},onFocus(q){E.select("open")&&!p&&(M.current=-1,B(q))},onPointerDown:ye,onPointerEnter:ye,onMouseDown:z,onClick:z}},[he,A,ie,u,B,E,h,x,fe,d,ee,p]),me=f.useMemo(()=>({...se,...xe}),[se,xe]);return f.useMemo(()=>s?{reference:me,floating:ae,item:oe,trigger:xe}:{},[s,me,ae,xe,oe])}function Dd(e,t){const{listRef:n,elementsRef:r,activeIndex:o,onMatch:s,disabledIndices:i,onTyping:a,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,p="rootStore"in e?e.rootStore:e,A=p.useState("open"),m=ht(),h=f.useRef(""),g=f.useRef(d??o??-1),x=f.useRef(null),b=ue(C=>{function I(F){return r?.current[F]}function w(F){const R=I(F);return R&&!$o(R)||R?.matches(":disabled")?!1:i==null||!So(Ht,F,i)}function E(F,R,O=0){if(F.length===0)return-1;const _=(O%F.length+F.length)%F.length,M=R.toLowerCase();for(let H=0;H<F.length;H+=1){const G=(_+H)%F.length;if(!(!F[G]?.toLowerCase().startsWith(M)||!w(G)))return G}return-1}const S=n.current;if(h.current.length>0&&C.key===" "&&(Qt(C),a?.(!0)),h.current.length>0&&h.current[0]!==" "&&E(S,h.current)===-1&&C.key!==" "&&a?.(!1),S==null||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;A&&C.key!==" "&&(Qt(C),a?.(!0));const D=h.current==="";D&&(g.current=d??o??-1),S.every((F,R)=>F&&w(R)?F[0]?.toLowerCase()!==F[1]?.toLowerCase():!0)&&h.current===C.key&&(h.current="",g.current=x.current),h.current+=C.key,m.start(u,()=>{h.current="",g.current=x.current,a?.(!1)});const N=((D?d??o??-1:g.current)??0)+1,T=E(S,h.current,N);T!==-1?(s?.(T),x.current=T):C.key!==" "&&(h.current="",a?.(!1))}),v=ue(C=>{const I=C.relatedTarget,w=p.select("domReferenceElement"),E=p.select("floatingElement");ve(w,I)||ve(E,I)||(m.clear(),h.current="",g.current=x.current,a?.(!1))});le(()=>{!A&&d!==null||(m.clear(),x.current=null,h.current!==""&&(h.current=""))},[A,d,m]);const y=f.useMemo(()=>({onKeyDown:b,onBlur:v}),[b,v]);return f.useMemo(()=>l?{reference:y,floating:y}:{},[l,y])}const $l=.1,Pm=$l*$l,Qe=.5;function no(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function ro(e,t,n,r,o,s,i,a,l,u){let d=!1;return no(e,t,n,r,o,s)&&(d=!d),no(e,t,o,s,i,a)&&(d=!d),no(e,t,i,a,l,u)&&(d=!d),no(e,t,l,u,n,r)&&(d=!d),d}function _m(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function oo(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),l=Math.min(r,s),u=Math.max(r,s);return e>=i&&e<=a&&t>=l&&t<=u}function Fd(e={}){const{blockPointerEvents:t=!1}=e,n=new Wt,r=({x:o,y:s,placement:i,elements:a,onClose:l,nodeId:u,tree:d})=>{const p=i?.split("-")[0];let A=!1,m=null,h=null,g=typeof performance<"u"?performance.now():0;function x(v,y){const C=performance.now(),I=C-g;if(m===null||h===null||I===0)return m=v,h=y,g=C,!1;const w=v-m,E=y-h,S=w*w+E*E,D=I*I*Pm;return m=v,h=y,g=C,S<D}function b(){n.clear(),l()}return function(y){n.clear();const C=a.domReference,I=a.floating;if(!C||!I||p==null||o==null||s==null)return;const{clientX:w,clientY:E}=y,S=gt(y),D=y.type==="mouseleave",k=ve(I,S),j=ve(C,S);if(k&&(A=!0,!D))return;if(j&&(A=!1,!D)){A=!0;return}if(D&&Te(y.relatedTarget)&&ve(I,y.relatedTarget))return;function N(){return!!(d&&bn(d.nodesRef.current,u).length>0)}function T(){N()||b()}if(N())return;const F=C.getBoundingClientRect(),R=I.getBoundingClientRect(),O=o>R.right-R.width/2,_=s>R.bottom-R.height/2,M=R.width>F.width,H=R.height>F.height,G=(M?F:R).left,B=(M?F:R).right,P=(H?F:R).top,W=(H?F:R).bottom;if(p==="top"&&s>=F.bottom-1||p==="bottom"&&s<=F.top+1||p==="left"&&o>=F.right-1||p==="right"&&o<=F.left+1){T();return}let Y=!1;switch(p){case"top":Y=oo(w,E,G,F.top+1,B,R.bottom-1);break;case"bottom":Y=oo(w,E,G,R.top+1,B,F.bottom-1);break;case"left":Y=oo(w,E,R.right-1,W,F.left+1,P);break;case"right":Y=oo(w,E,F.right-1,W,R.left+1,P);break}if(Y)return;if(A&&!_m(w,E,F)){T();return}if(!D&&x(w,E)){T();return}let Z=!1;switch(p){case"top":{const Q=M?Qe/2:Qe*4,J=M||O?o+Q:o-Q,K=M?o-Q:O?o+Q:o-Q,ee=s+Qe+1,ce=O||M?R.bottom-Qe:R.top,te=O?M?R.bottom-Qe:R.top:R.bottom-Qe;Z=ro(w,E,J,ee,K,ee,R.left,ce,R.right,te);break}case"bottom":{const Q=M?Qe/2:Qe*4,J=M||O?o+Q:o-Q,K=M?o-Q:O?o+Q:o-Q,ee=s-Qe,ce=O||M?R.top+Qe:R.bottom,te=O?M?R.top+Qe:R.bottom:R.top+Qe;Z=ro(w,E,J,ee,K,ee,R.left,ce,R.right,te);break}case"left":{const Q=H?Qe/2:Qe*4,J=H||_?s+Q:s-Q,K=H?s-Q:_?s+Q:s-Q,ee=o+Qe+1,ce=_||H?R.right-Qe:R.left,te=_?H?R.right-Qe:R.left:R.right-Qe;Z=ro(w,E,ce,R.top,te,R.bottom,ee,J,ee,K);break}case"right":{const Q=H?Qe/2:Qe*4,J=H||_?s+Q:s-Q,K=H?s-Q:_?s+Q:s-Q,ee=o-Qe,ce=_||H?R.left+Qe:R.right,te=_?H?R.left+Qe:R.right:R.left+Qe;Z=ro(w,E,ee,J,ee,K,ce,R.top,te,R.bottom);break}}Z?A||n.start(40,T):T()}};return r.__options={...e,blockPointerEvents:t},r}const Bd=f.createContext(void 0);function Om(){const e=f.useContext(Bd);if(e===void 0)throw new Error(at(26));return e}const gi="ArrowUp",mi="ArrowDown",xi="ArrowLeft",bi="ArrowRight",vi="Home",yi="End",ss=new Set([gi,mi,xi,bi,vi,yi]),Hm="Shift",Km=[Hm,"Control","Alt","Meta"];function Wm(e){return Xe(e)&&e.tagName==="INPUT"}function Xl(e){return!!(Wm(e)&&e.selectionStart!=null||Xe(e)&&e.tagName==="TEXTAREA")}function ql(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const l=ec(e,t,"left"),u=so(e),d=so(t);n==="ltr"&&(l+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?o=l+t.offsetWidth+d.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:l-d.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(o=l-d.scrollMarginLeft-u.scrollPaddingLeft)),n==="rtl"&&(l-d.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft?o=l-d.scrollMarginLeft-u.scrollPaddingLeft:l+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(o=l+t.offsetWidth+d.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(a&&r!=="horizontal"){const l=ec(e,t,"top"),u=so(e),d=so(t);l-d.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?s=l-d.scrollMarginTop-u.scrollPaddingTop:l+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(s=l+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function ec(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function so(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Lm={...Lr,..._n,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},ka=f.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,initialFocus:a,...l}=t,u=On(),d=u.useState("descriptionElementId"),p=u.useState("disablePointerDismissal"),A=u.useState("floatingRootContext"),m=u.useState("popupProps"),h=u.useState("modal"),g=u.useState("mounted"),x=u.useState("nested"),b=u.useState("nestedOpenDialogCount"),v=u.useState("open"),y=u.useState("openMethod"),C=u.useState("titleElementId"),I=u.useState("transitionStatus"),w=u.useState("role"),E=A.useState("floatingId");Om(),Zt({open:v,ref:u.context.popupRef,onComplete(){v&&u.context.onOpenChangeComplete?.(!0)}});const S=a===void 0?Im(u.context.popupRef):a,D=b>0,k=u.useStateSetter("popupElement"),N=Me("div",t,{state:{open:v,nested:x,transitionStatus:I,nestedDialogOpen:D},props:[m,{id:E,"aria-labelledby":C,"aria-describedby":d,role:w,...rs,hidden:!g,onKeyDown(T){ss.has(T.key)&&T.stopPropagation()},style:{"--nested-dialogs":b}},l],ref:[n,u.context.popupRef,k],stateAttributesMapping:Lm});return c.jsx(fa,{context:A,openInteractionType:y,disabled:!g,closeOnFocusOut:!p,initialFocus:S,returnFocus:i,modal:h!==!1,restoreFocus:"popup",children:N})});function Ea(e){return bu(19)?e:e?"true":void 0}const Sa=f.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return c.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),Ra=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=On(),i=s.useState("mounted"),a=s.useState("modal"),l=s.useState("open");return i||r?c.jsx(Bd.Provider,{value:r,children:c.jsxs(ca,{ref:n,...o,children:[i&&a===!0&&c.jsx(Sa,{ref:s.context.internalBackdropRef,inert:Ea(!l)}),t.children]})}):null});let tc={},nc={},rc="";function is(e,t){return Ti(e)?e:t}function oc(e,t,n){return/hidden|clip/.test(e.getComputedStyle(is(t,n)).overflowY)}function Qm(e){if(typeof document>"u")return!1;const t=je(e);return it(t).innerWidth-t.documentElement.clientWidth>0}function Gm(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=je(e),r=n.documentElement,o=n.body,s=is(r,o),i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const l=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,l===u}function Ym(e){const t=je(e),n=t.documentElement,r=t.body,o=is(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function zm(e){const t=je(e),n=t.documentElement,r=t.body,o=it(n);let s=0,i=0,a=!1;const l=It.create();if(un&&(o.visualViewport?.scale??1)!==1)return()=>{};function u(){const m=o.getComputedStyle(n),h=o.getComputedStyle(r),b=(m.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,tc={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},rc=n.style.scrollBehavior,nc={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const v=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,C=m.overflowY==="scroll"||h.overflowY==="scroll",I=m.overflowX==="scroll"||h.overflowX==="scroll",w=Math.max(0,o.innerWidth-r.clientWidth),E=Math.max(0,o.innerHeight-r.clientHeight),S=parseFloat(h.marginTop)+parseFloat(h.marginBottom),D=parseFloat(h.marginLeft)+parseFloat(h.marginRight),k=is(n,r);if(a=Gm(e),a){n.style.scrollbarGutter=b,k.style.overflowY="hidden",k.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:b,overflowY:"hidden",overflowX:"hidden"}),(v||C)&&(n.style.overflowY="scroll"),(y||I)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:S||E?`calc(100dvh - ${S+E}px)`:"100dvh",width:D||w?`calc(100vw - ${D+w}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,tc),Object.assign(r.style,nc),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=rc)}function p(){d(),l.request(u)}u();const A=De(o,"resize",p);return()=>{l.cancel(),d(),typeof o.removeEventListener=="function"&&A()}}class Um{lockCount=0;restore=null;timeoutLock=Wt.create();timeoutUnlock=Wt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=je(t),r=n.documentElement,o=n.body,s=it(r);if(oc(s,r,o)){const a=new s.MutationObserver(()=>{oc(s,r,o)||(a.disconnect(),this.restore=null,this.lock(t))}),l={attributes:!0};a.observe(r,l),a.observe(o,l),this.restore=()=>a.disconnect();return}const i=Uo||!Qm(t);this.restore=i?Ym(t):zm(t)}}const Vm=new Um;function jd(e=!0,t=null){le(()=>{if(e)return Vm.acquire(t)},[e,t])}function Zm({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),a=e.useState("floatingRootContext"),[l,u]=f.useState(0),[d,p]=f.useState(0),A=l===0,m=es(a,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(h){if(!e.context.outsidePressEnabledRef.current||"button"in h&&h.button!==0)return!1;if("touches"in h){if(h.type==="touchend"){if(h.changedTouches.length!==1||h.touches.length!==0)return!1}else if(h.touches.length!==1)return!1}const g=gt(h);if(A&&!o){if(s){const x=e.context.internalBackdropRef.current,b=e.context.backdropRef.current;return x||b?x===g||b===g||ve(g,i)&&!g?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:A});return jd(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(h,g)=>{u(h),p(g)}),le(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(l+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),ba(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}const Jm={...Ca,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class $m extends Gr{constructor(t,n,r){const o=new Yr,s=Xm(t,o,n,r);super(s,qm(o),Jm)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};ga(r,t,n.trigger),this.update(r)}}function Xm(e,t,n,r=!1){const o={...va(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=yd(t,n,r),o}function qm(e){return{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Md(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:i,disablePointerDismissal:a=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:p,defaultTriggerId:A=null}=t,m=e==="drawer",h=e==="alert-dialog",g=h?!0:l,x=h||a,b=h?"alertdialog":"dialog",v=On(!0),y=v!=null,C={modal:g,disablePointerDismissal:x,nested:y,role:b},I=xd((j,N)=>new $m({open:o,openProp:r,activeTriggerId:A,triggerIdProp:p,...C},j,N),!0);I.useControlledProp("openProp",r),I.useControlledProp("triggerIdProp",p),I.useSyncedValues(C),I.useContextCallback("onOpenChange",s),I.useContextCallback("onOpenChangeComplete",i);const w=I.useState("open"),E=I.useState("mounted"),S=I.useState("payload");Em(I,w),ma(I);const{forceUnmount:D}=xa(w,I);f.useImperativeHandle(u,()=>({unmount:D,close:()=>I.setOpen(!1,Ce(Pi))}),[D,I]);const k=w||E;return c.jsxs(Uu.Provider,{value:I,children:[d&&c.jsx(Aa,{handle:d,store:I}),k&&c.jsx(Zm,{store:I,parentContext:v?.context,isDrawer:m}),typeof n=="function"?n({payload:S}):n]})}function Nd(e){return Md("dialog",e)}const Da=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,l=On(),u=wt(i);return l.useSyncedValueWithCleanup("titleElementId",u),Me("h2",t,{ref:n,props:[{id:u},a]})});function e0(e){const t=f.useRef(""),n=f.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:f.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function as(e,t){const n=f.useRef(e),r=ue(t);le(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function t0(e,t){const n=ue((s,i)=>{(typeof e=="function"?e():e)||t(i||(Uo?"touch":""))}),{onClick:r,onPointerDown:o}=e0(n);return f.useMemo(()=>({onClick:r,onPointerDown:o}),[r,o])}function Td(e){const[t,n]=f.useState(null),r=t0(e,n);return as(e,o=>{o&&!e&&n(null)}),f.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function n0({...e}){return c.jsx(Nd,{"data-slot":"sheet",...e})}function r0({...e}){return c.jsx(Ra,{"data-slot":"sheet-portal",...e})}function o0({className:e,...t}){return c.jsx(ia,{"data-slot":"sheet-overlay",className:ge("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function s0({className:e,children:t,side:n="right",showCloseButton:r=!0,...o}){return c.jsxs(r0,{children:[c.jsx(o0,{}),c.jsxs(ka,{"data-slot":"sheet-content","data-side":n,className:ge("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...o,children:[t,r&&c.jsxs(Qr,{"data-slot":"sheet-close",render:c.jsx(He,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[c.jsx(zi,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function i0({className:e,...t}){return c.jsx("div",{"data-slot":"sheet-header",className:ge("flex flex-col gap-0.5 p-4",e),...t})}function a0({className:e,...t}){return c.jsx(Da,{"data-slot":"sheet-title",className:ge("cn-font-heading text-base font-medium text-foreground",e),...t})}function l0({className:e,...t}){return c.jsx(aa,{"data-slot":"sheet-description",className:ge("text-sm text-muted-foreground",e),...t})}function nn({className:e,...t}){return c.jsx("div",{"data-slot":"skeleton",className:ge("animate-pulse rounded-md bg-muted",e),...t})}const Pd=f.createContext(void 0);function zr(e){const t=f.useContext(Pd);if(t===void 0&&!e)throw new Error(at(72));return t}const c0={...Ca,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class u0 extends Gr{constructor(t,n,r){const o=new Yr;super(d0(t,o,n,r),f0(o),c0)}setOpen=(t,n)=>{km(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,Ce(Tn,t))}}function d0(e,t,n,r=!1){const o={...va(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return o.floatingRootContext=yd(t,n,r),o}function f0(e){return{popupRef:f.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const p0=ha(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:o,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:l,onOpenChangeComplete:u,handle:d,triggerId:p,defaultTriggerId:A=null,children:m}=t,h=xd((j,N)=>new u0({open:r,openProp:o,activeTriggerId:A,triggerIdProp:p},j,N));h.useControlledProp("openProp",o),h.useControlledProp("triggerIdProp",p),h.useContextCallback("onOpenChange",l),h.useContextCallback("onOpenChangeComplete",u);const g=h.useState("open"),x=!n&&g,b=h.useState("activeTriggerId"),v=h.useState("mounted"),y=h.useState("payload");h.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s,disabled:n}),ma(h,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:C,transitionStatus:I}=xa(x,h),w=h.useState("isInstantPhase"),E=h.useState("instantType"),S=h.useState("lastOpenChangeReason"),D=f.useRef(null);le(()=>{g&&n&&h.setOpen(!1,Ce(Iu))},[g,n,h]),le(()=>{I==="ending"&&S===Pt||I!=="ending"&&w?(E!=="delay"&&(D.current=E),h.set("instantType","delay")):D.current!==null&&(h.set("instantType",D.current),D.current=null)},[I,w,S,E,h]),le(()=>{x&&b==null&&h.set("payload",void 0)},[h,b,x]),f.useImperativeHandle(a,()=>({unmount:C,close:()=>h.setOpen(!1,Ce(Pi))}),[C,h]);const k=x||v||!n&&i!=="none";return c.jsxs(Pd.Provider,{value:h,children:[d&&c.jsx(Aa,{handle:d,store:h}),k&&c.jsx(h0,{store:h,disabled:n,trackCursorAxis:i}),typeof m=="function"?m({payload:y}):m]})});function h0({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),o=es(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=Ig(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=f.useMemo(()=>Nt(s.reference,o.reference),[s.reference,o.reference]);return ba(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:o.floating??dt}),null}const A0=f.createContext(void 0);function g0(){return f.useContext(A0)}const sc=600,_d="data-base-ui-tooltip-trigger";function ic(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const o=n[r];if(Te(o))return o}}const t=e.target;return Te(t)?t:null}function m0(e){let t=e;for(;t;){const n=t.closest(`[${_d}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Te(r.host)?r.host:null}return null}const x0=gd(function(t,n){const{render:r,className:o,style:s,handle:i,payload:a,disabled:l,delay:u,closeOnClick:d=!0,closeDelay:p,id:A,...m}=t,h=zr(!0),x=Id(i)??h;if(!x)throw new Error(at(82));const b=wt(A),v=x.useState("isTriggerActive",b),y=x.useState("isOpenedByTrigger",b),C=x.useState("floatingRootContext"),I=f.useRef(null),w=u??sc,E=p??0,{registerTrigger:S,isMountedByThisTrigger:D}=vd(b,I,x,{payload:a,closeOnClick:d,closeDelay:E}),k=g0(),{delayRef:j,isInstantPhase:N,hasProvider:T}=lg(C,{open:y}),F=wa(C);x.useSyncedValue("isInstantPhase",N);const R=x.useState("disabled"),O=l??R,_=nt(O),M=x.useState("trackCursorAxis"),H=x.useState("disableHoverablePopup"),G=f.useRef(!1),B=ht(),P=f.useRef(void 0);function W(){return T?er(j.current,"open")===0?0:u??k??sc:w}function Y(X){const ne=I.current;if(!ne||!X)return!1;const de=m0(X);return de!==null&&de!==ne&&ve(ne,de)}function Z(X){const ne=Y(X);return G.current=ne,ne&&(F.openChangeTimeout.clear(),F.restTimeout.clear(),F.restTimeoutPending=!1,B.clear()),ne}const Q=Sd(C,{enabled:!O,mouseOnly:!0,move:!1,handleClose:!H&&M!=="both"?Fd():null,restMs:W,delay(){return p==null&&T?{close:er(j.current,"close")}:{close:E}},triggerElementRef:I,isActiveTrigger:v,isClosing:()=>x.select("transitionStatus")==="ending",shouldOpen(){return!G.current}}),J=wd(C,{enabled:!O}).reference,K=X=>{const ne=G.current,de=ic(X),fe=Z(de),ie=I.current,he=ie&&de&&ve(ie,de);if(fe&&x.select("open")&&x.select("lastOpenChangeReason")===ct){x.setOpen(!1,Ce(ct,X));return}if(ne&&!fe&&he&&!_.current&&!x.select("open")&&ie&&xn(P.current)){const oe=()=>{!G.current&&!_.current&&!x.select("open")&&x.setOpen(!0,Ce(ct,X,ie))},se=W();se===0?(B.clear(),oe()):B.start(se,oe)}},ee=x.useState("triggerProps",D);return Me("button",t,{state:{open:y},ref:[n,S,I],props:[Q,J,D||M!=="none"?ee:void 0,{onMouseOver(X){K(X.nativeEvent)},onFocus(X){Y(ic(X.nativeEvent))&&X.preventBaseUIHandler()},onMouseLeave(){G.current=!1,B.clear(),P.current=void 0},onPointerEnter(X){P.current=X.pointerType},onPointerDown(X){P.current=X.pointerType,x.set("closeOnClick",d),d&&!x.select("open")&&x.cancelPendingOpen(X.nativeEvent)},onClick(X){d&&!x.select("open")&&x.cancelPendingOpen(X.nativeEvent)},id:b,"data-trigger-disabled":O?"":void 0,[_d]:O?void 0:""},m],stateAttributesMapping:Vu})}),Od=f.createContext(void 0);function b0(){const e=f.useContext(Od);if(e===void 0)throw new Error(at(70));return e}const v0=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,style:a,...l}=t,{node:u,subtree:d}=nd({container:o,ref:n,componentProps:t,elementProps:l});return!d&&!u?null:c.jsxs(f.Fragment,{children:[d,u&&cn.createPortal(r,u)]})}),y0=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return zr().useState("mounted")||r?c.jsx(Od.Provider,{value:r,children:c.jsx(v0,{ref:n,...o})}):null}),Hd=f.createContext(void 0);function Kd(){const e=f.useContext(Hd);if(e===void 0)throw new Error(at(71));return e}const C0=f.createContext(void 0);function ls(){return f.useContext(C0)?.direction??"ltr"}const I0=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:d=0,offsetParent:p="real"}=vn(e,t)||{};if(u==null)return{};const A=Nu(d),m={x:n,y:r},h=ea(o),g=qi(h),x=await i.getDimensions(u),b=h==="y",v=b?"top":"left",y=b?"bottom":"right",C=b?"clientHeight":"clientWidth",I=s.reference[g]+s.reference[h]-m[h]-s.floating[g],w=m[h]-s.reference[h],E=p==="real"?await i.getOffsetParent?.(u):a.floating;let S=a.floating[C]||s.floating[g];(!S||!await i.isElement?.(E))&&(S=a.floating[C]||s.floating[g]);const D=I/2-w/2,k=S/2-x[g]/2-1,j=Math.min(A[v],k),N=Math.min(A[y],k),T=j,F=S-x[g]-N,R=S/2-x[g]/2+D,O=Mu(T,R,F),_=!l.arrow&&In(o)!=null&&R!==O&&s.reference[g]/2-(R<T?j:N)-x[g]/2<0,M=_?R<T?R-T:R-F:0;return{[h]:m[h]+M,data:{[h]:O,centerOffset:R-O-M,..._&&{alignmentOffset:M}},reset:_}}}),w0=(e,t)=>({...I0(e),options:[e,t]}),k0={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-n>=0||i.right-t>=0||i.bottom-n>=0||i.left-t>=0||s}}}},E0={sideX:"left",sideY:"top"},ac="--available-width",lc="--available-height";function Wd(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function cc(e,t,n){const{rects:r,placement:o}=e;return{side:Wd(t,Tt(o),n),align:In(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Fa(e){return S0(e,Fm)}function S0(e,t){const{anchor:n,positionMethod:r="absolute",side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,collisionBoundary:l,collisionPadding:u=5,sticky:d=!1,arrowPadding:p=5,disableAnchorTracking:A=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:x,collisionAvoidance:b,shift:v,nodeId:y,adaptiveOrigin:C,lazyFlip:I=!1,externalTree:w}=e,[E,S]=f.useState(null);!x&&E!==null&&S(null);const D=b.side||"flip",k=b.align||"flip",j=b.fallbackAxisSide||"end",N=v?.crossAxis??!1,T=v?.rootBoundary,F=typeof n=="function"?n:void 0,R=ue(F),O=F?R:n,_=nt(n),M=nt(x),G=ls()==="rtl",B=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":G?"left":"right","inline-start":G?"right":"left"}[o],P=i==="center"?B:`${B}-${i}`;let W=u;typeof W=="number"?W={top:W,right:W,bottom:W,left:W}:W&&(W={top:W.top||0,right:W.right||0,bottom:W.bottom||0,left:W.left||0});const Y=1,Z=o==="bottom"?Y:0,Q=o==="top"?Y:0,J=o==="right"?Y:0,K=o==="left"?Y:0,ee={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:W},ce=f.useRef(null),te=nt(s),$=nt(a),X=typeof s!="function"?s:0,ne=typeof a!="function"?a:0,de=[];m&&de.push(m),de.push(sm(Re=>{const Pe=cc(Re,o,G),Je=typeof te.current=="function"?te.current(Pe):te.current,qe=typeof $.current=="function"?$.current(Pe):$.current;return{mainAxis:Je,crossAxis:qe,alignmentAxis:qe}},[X,ne,G,o]));const fe=k==="none"&&D!=="shift",ie=!fe&&(d||N||D==="shift"),he=D==="none"?null:lm({...ee,padding:{top:W.top+Y+Z,right:W.right+Y+K,bottom:W.bottom+Y+Q,left:W.left+Y+J},mainAxis:!N&&D==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:j}),oe=fe?null:im({...ee,rootBoundary:T,mainAxis:k!=="none",crossAxis:ie,limiter:d||N?void 0:am(Re=>{if(!ce.current)return{};const{width:Pe,height:Je}=ce.current.getBoundingClientRect(),qe=Mt(Tt(Re.placement)),ft=qe==="y"?Pe:Je,ot=qe==="y"?W.left+W.right:W.top+W.bottom;return{offset:ft/2+ot/2}})},[ee,d,N,T,W,k]);D==="shift"||k==="shift"||i==="center"?de.push(oe,he):de.push(he,oe),de.push(cm({...ee,apply({elements:{floating:Re},availableWidth:Pe,availableHeight:Je,rects:qe}){if(!M.current)return;const ft=Re.style;ft.setProperty(ac,`${Pe}px`),ft.setProperty(lc,`${Je}px`);const ot=it(Re).devicePixelRatio||1,{x:Ct,y:st,width:Et,height:St}=qe.reference,qt=(Math.round((Ct+Et)*ot)-Math.round(Ct*ot))/ot,Be=(Math.round((st+St)*ot)-Math.round(st*ot))/ot;ft.setProperty("--anchor-width",`${qt}px`),ft.setProperty("--anchor-height",`${Be}px`)}}),w0(Re=>({element:ce.current||je(Re.elements.floating).createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(Re){const{elements:Pe,middlewareData:Je,placement:qe,rects:ft,y:ot}=Re,Ct=Tt(qe),st=Mt(Ct),Et=ce.current,St=Je.arrow?.x||0,qt=Je.arrow?.y||0,Be=Et?.clientWidth||0,Ue=Et?.clientHeight||0,bt=St+Be/2,Rt=qt+Ue/2,Bt=Math.abs(Je.shift?.y||0),jt=ft.reference.height/2,Lt=typeof s=="function"?s(cc(Re,o,G)):s,dn=Bt>Lt,Dt={top:`${bt}px calc(100% + ${Lt}px)`,bottom:`${bt}px ${-Lt}px`,left:`calc(100% + ${Lt}px) ${Rt}px`,right:`${-Lt}px ${Rt}px`}[Ct],en=`${bt}px ${ft.reference.y+jt-ot}px`;return Pe.floating.style.setProperty("--transform-origin",ie&&st==="y"&&dn?en:Dt),{}}},k0,C),le(()=>{!x&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[x,g]);const se=f.useMemo(()=>({elementResize:!A&&typeof ResizeObserver<"u",layoutShift:!A&&typeof IntersectionObserver<"u"}),[A]),{refs:ae,elements:xe,x:me,y:L,middlewareData:z,update:ye,placement:q,context:re,isPositioned:Se,floatingStyles:ke}=t({rootContext:g,open:h?x:void 0,placement:P,middleware:de,strategy:r,whileElementsMounted:h?void 0:(...Re)=>Yl(...Re,se),nodeId:y,externalTree:w}),{sideX:We,sideY:rt}=z.adaptiveOrigin||E0,Ge=Se?r:"fixed",At=f.useMemo(()=>{let Re;return Se?C?Re={position:Ge,[We]:me,[rt]:L}:Re={...ke,position:Ge}:Re={position:Ge,top:0,left:0},Re[ac]="100vw",Re[lc]="100vh",Se||(Re.opacity=0),Re},[C,Ge,We,me,rt,L,ke,Se]),$e=f.useRef(null);le(()=>{if(!x)return;const Re=_.current,Pe=typeof Re=="function"?Re():Re,qe=(uc(Pe)?Pe.current:Pe)||null||null;qe!==$e.current&&(ae.setPositionReference(qe),$e.current=qe)},[x,ae,O,_]),f.useEffect(()=>{if(!x)return;const Re=_.current;typeof Re!="function"&&uc(Re)&&Re.current!==$e.current&&(ae.setPositionReference(Re.current),$e.current=Re.current)},[x,ae,O,_]),f.useEffect(()=>{if(h&&x&&xe.reference&&xe.floating)return Yl(xe.reference,xe.floating,ye,se)},[h,x,xe,ye,se]);const Oe=Tt(q),lt=Wd(o,Oe,G),Ee=In(q)||"center",Le=!!z.hide?.referenceHidden;le(()=>{I&&x&&Se&&Oe!==B&&S(Oe)},[I,x,Se,Oe,B]);const Ze=f.useMemo(()=>({position:"absolute",top:z.arrow?.y,left:z.arrow?.x}),[z.arrow]),ze=z.arrow?.centerOffset!==0;return f.useMemo(()=>({positionerStyles:At,arrowStyles:Ze,arrowRef:ce,arrowUncentered:ze,side:lt,align:Ee,physicalSide:Oe,anchorHidden:Le,refs:ae,context:re,isPositioned:Se,update:ye}),[At,Ze,ce,ze,lt,Ee,Oe,Le,ae,re,Se,ye])}function uc(e){return e!=null&&"current"in e}function cs(e){return e==="starting"?hg:dt}function Ba(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:a=!1}){const l={...n};return a&&(l.pointerEvents="none"),Me("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:l},cs(r),o],stateAttributesMapping:Lr})}const R0=f.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="top",align:l="center",sideOffset:u=0,alignOffset:d=0,collisionBoundary:p="clipping-ancestors",collisionPadding:A=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:x=qu,style:b,...v}=t,y=zr(),C=b0(),I=y.useState("open"),w=y.useState("mounted"),E=y.useState("trackCursorAxis"),S=y.useState("disableHoverablePopup"),D=y.useState("floatingRootContext"),k=y.useState("instantType"),j=y.useState("transitionStatus"),N=y.useState("adaptiveOrigin"),T=Fa({anchor:s,positionMethod:i,floatingRootContext:D,mounted:w,side:a,sideOffset:u,align:l,alignOffset:d,collisionBoundary:p,collisionPadding:A,sticky:h,arrowPadding:m,disableAnchorTracking:g,keepMounted:C,collisionAvoidance:x,adaptiveOrigin:N}),F=f.useMemo(()=>({open:I,side:T.side,align:T.align,anchorHidden:T.anchorHidden,instant:E!=="none"?"tracking-cursor":k}),[I,T.side,T.align,T.anchorHidden,E,k]),R=Ba(t,F,{styles:T.positionerStyles,transitionStatus:j,props:v,refs:[n,y.useStateSetter("positionerElement")],hidden:!w,inert:!I||E==="both"||S});return c.jsx(Hd.Provider,{value:T,children:R})}),D0=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=zr(),{side:l,align:u}=Kd(),d=a.useState("open"),p=a.useState("instantType"),A=a.useState("transitionStatus"),m=a.useState("popupProps"),h=a.useState("floatingRootContext"),g=a.useState("disabled"),x=a.useState("closeDelay");Zt({open:d,ref:a.context.popupRef,onComplete(){d&&a.context.onOpenChangeComplete?.(!0)}}),Ed(h,{enabled:!g,closeDelay:x});const b=a.useStateSetter("popupElement");return Me("div",t,{state:{open:d,side:l,align:u,instant:p,transitionStatus:A},ref:[n,a.context.popupRef,b],props:[rs,m,cs(A),i],stateAttributesMapping:sa})}),F0=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=zr(),{arrowRef:l,side:u,align:d,arrowUncentered:p,arrowStyles:A}=Kd(),m=a.useState("open"),h=a.useState("instantType");return Me("div",t,{state:{open:m,side:u,align:d,uncentered:p,instant:h},ref:[n,l],props:[{style:A,"aria-hidden":!0},i],stateAttributesMapping:Lr})});function B0(e){const[t,n]=f.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function us({...e}){return c.jsx(p0,{"data-slot":"tooltip",...e})}function ds({...e}){return c.jsx(x0,{"data-slot":"tooltip-trigger",...e})}function fs({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:s,...i}){return c.jsx(y0,{children:c.jsx(R0,{align:r,alignOffset:o,side:t,sideOffset:n,className:"isolate z-50",children:c.jsxs(D0,{"data-slot":"tooltip-content",className:ge("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background 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-sm 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",e),...i,children:[s,c.jsx(F0,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const j0="sidebar_state",M0=3600*24*7,N0="16rem",T0="18rem",P0="3rem",_0="b",Ld=f.createContext(null);function ps(){const e=f.useContext(Ld);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function O0({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:s,...i}){const a=XA(),[l,u]=f.useState(!1),[d,p]=f.useState(e),A=t??d,m=f.useCallback(b=>{const v=typeof b=="function"?b(A):b;n?n(v):p(v),document.cookie=`${j0}=${v}; path=/; max-age=${M0}`},[n,A]),h=f.useCallback(()=>a?u(b=>!b):m(b=>!b),[a,m,u]);f.useEffect(()=>{const b=v=>{v.key===_0&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),h())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[h]);const g=A?"expanded":"collapsed",x=f.useMemo(()=>({state:g,open:A,setOpen:m,isMobile:a,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,A,m,a,l,u,h]);return c.jsx(Ld.Provider,{value:x,children:c.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":N0,"--sidebar-width-icon":P0,...o},className:ge("group/sidebar-wrapper flex h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...i,children:s})})}function H0({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,dir:s,...i}){const{isMobile:a,state:l,openMobile:u,setOpenMobile:d}=ps();return n==="none"?c.jsx("div",{"data-slot":"sidebar",className:ge("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...i,children:o}):a?c.jsx(n0,{open:u,onOpenChange:d,...i,children:c.jsxs(s0,{dir:s,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":T0},side:e,children:[c.jsxs(i0,{className:"sr-only",children:[c.jsx(a0,{children:"Sidebar"}),c.jsx(l0,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):c.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[c.jsx("div",{"data-slot":"sidebar-gap",className:ge("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),c.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:ge("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:c.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:o})})]})}function K0({className:e,...t}){const{toggleSidebar:n}=ps();return c.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:ge("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function W0({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ge("flex flex-col gap-2 p-2",e),...t})}function L0({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ge("flex flex-col gap-2 p-2",e),...t})}function Q0({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ge("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function G0({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ge("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Y0({className:e,...t}){return c.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ge("w-full text-sm",e),...t})}function Ks({className:e,...t}){return c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ge("flex w-full min-w-0 flex-col gap-0",e),...t})}function io({className:e,...t}){return c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ge("group/menu-item relative",e),...t})}const z0=ji("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function kr({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:s,...i}){const{isMobile:a,state:l}=ps(),u=ku({defaultTagName:"button",props:Nt({className:ge(z0({variant:n,size:r}),s)},i),render:o?c.jsx(ds,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return o?(typeof o=="string"&&(o={children:o}),c.jsxs(us,{children:[u,c.jsx(fs,{side:"right",align:"center",hidden:l!=="collapsed"||a,...o})]})):u}const Qd=f.createContext(void 0);function Gd(e){const t=f.useContext(Qd);if(t===void 0&&!e)throw new Error(at(33));return t}const Yd=f.createContext(void 0);function ir(e){const t=f.useContext(Yd);if(t===void 0&&!e)throw new Error(at(36));return t}const U0=f.createContext(void 0);function ja(e=!0){const t=f.useContext(U0);if(t===void 0&&!e)throw new Error(at(25));return t}function V0(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:o,store:s,typingRef:i,itemRef:a,itemMetadata:l}=e,{events:u}=s.useState("floatingTreeRoot"),d=s.useState("open"),p=ja(!0),A=p!==void 0;return f.useMemo(()=>({id:r,role:"menuitem",tabIndex:d&&n?0:-1,onKeyDown(m){m.key===" "&&i?.current&&m.preventDefault()},onMouseMove(m){o&&u.emit("itemhover",{nodeId:o,target:m.currentTarget})},onClick(m){t&&u.emit("close",{domEvent:m,reason:Cr})},onMouseUp(m){if(p){const h=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,A&&h&&Math.abs(m.clientX-h.x)<=1&&Math.abs(m.clientY-h.y)<=1||A&&!Ui&&m.button===2)return}a.current&&s.context.allowMouseUpTriggerRef.current&&(!A||m.button===2)&&l.type==="regular-item"&&_i(a.current,m,{detail:1})}}),[t,n,r,u,o,d,s,i,a,p,A,l])}const Z0={type:"regular-item"};function J0(e){const{closeOnClick:t,disabled:n,highlighted:r,id:o,store:s,typingRef:i=s.context.typingRef,nativeButton:a,itemMetadata:l,nodeId:u}=e,d=f.useRef(null),{getButtonProps:p,buttonRef:A}=Vt({disabled:n,focusableWhenDisabled:!0,native:a,composite:!0}),m=V0({closeOnClick:t,highlighted:r,id:o,nodeId:u,store:s,typingRef:i,itemRef:d,itemMetadata:l}),h=f.useCallback(x=>Nt(m,{onMouseEnter(){l.type==="submenu-trigger"&&l.setActive()}},x,p),[m,p,l]),g=Ut(d,A);return f.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}const zd=f.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function $0(){return f.useContext(zd)}function hs(e={}){const{guess:t,label:n,metadata:r,textRef:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:l,nextIndexRef:u}=$0(),d=f.useRef(-1),[p,A]=f.useState(s==null&&t?()=>{if(d.current===-1){const x=u.current;u.current+=1,d.current=x}return d.current}:-1),m=s??p,h=f.useRef(null),g=f.useCallback(x=>{const b=h.current;b&&a(b),h.current=x,x&&i(x,{metadata:r??null,index:s??null,label:n,textRef:o})},[s,i,a,r,n,o]);return le(()=>{if(s==null)return l(x=>{const b=h.current?x.get(h.current)?.index:null;b!=null&&A(b)})},[s,l]),{ref:g,index:m}}const X0=f.forwardRef(function(t,n){const{render:r,className:o,id:s,label:i,nativeButton:a=!1,disabled:l=!1,closeOnClick:u=!0,style:d,...p}=t,A=hs({guess:!0,label:i}),m=Gd(!0),h=wt(s),{store:g}=ir(),x=g.useState("disabled"),b=l||x,v=g.useState("isActive",A.index),y=g.useState("itemProps"),{getItemProps:C,itemRef:I}=J0({closeOnClick:u,disabled:b,highlighted:v,id:h,store:g,nativeButton:a,nodeId:m?.context.nodeId,itemMetadata:Z0});return Me("div",t,{state:{disabled:b,highlighted:v},props:[y,p,C],ref:[I,n,A.ref]})}),q0=f.createContext(void 0);function Ma(e){return f.useContext(q0)}const ex=f.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:l}=ir(),{side:u,align:d}=Gd(),p=Ma()!=null,A=l.useState("open"),m=l.useState("transitionStatus"),h=l.useState("popupProps"),g=l.useState("mounted"),x=l.useState("instantType"),b=l.useState("activeTriggerElement"),v=l.useState("parent"),y=l.useState("lastOpenChangeReason"),C=l.useState("rootId"),I=l.useState("floatingRootContext"),w=l.useState("floatingTreeRoot"),E=l.useState("closeDelay"),S=l.useState("hoverEnabled"),D=l.useState("disabled"),k=l.useState("openMethod"),j=v.type==="context-menu";Zt({open:A,ref:l.context.popupRef,onComplete(){A&&l.context.onOpenChangeComplete?.(!0)}}),f.useEffect(()=>{function O(_){l.setOpen(!1,Ce(_.reason,_.domEvent))}return w.events.on("close",O),()=>{w.events.off("close",O)}},[w.events,l]),Ed(I,{enabled:S&&!D&&!j&&v.type!=="menubar",closeDelay:E});const N=l.useStateSetter("popupElement"),T={transitionStatus:m,side:u,align:d,open:A,nested:v.type==="menu",instant:x},F=Me("div",t,{state:T,ref:[n,l.context.popupRef,N],stateAttributesMapping:sa,props:[h,{onKeyDown(O){p&&ss.has(O.key)&&O.stopPropagation()}},cs(m),a,{"data-rootownerid":C}]});let R=v.type===void 0||j;return(b||v.type==="menubar"&&y!==Lo)&&(R=!0),c.jsx(fa,{context:I,openInteractionType:k,modal:j,disabled:!g,returnFocus:i===void 0?R:i,initialFocus:v.type!=="menu",restoreFocus:!0,externalTree:v.type!=="menubar"?w:void 0,previousFocusableElement:b,nextFocusableElement:v.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:v.type===void 0?l.context.beforeContentFocusGuardRef:void 0,children:F})}),Ud=f.createContext(void 0);function tx(){const e=f.useContext(Ud);if(e===void 0)throw new Error(at(32));return e}const nx=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=ir();return s.useState("mounted")||r?c.jsx(Ud.Provider,{value:r,children:c.jsx(ca,{ref:n,...o})}):null});function Ur(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=ue(o),[,i]=f.useState(!1),a=Ft(ox).current,l=Ft(rx).current,u=f.useRef(0),d=f.useRef(!0),p=f.useRef([]),A=f.useRef(null),m=ue(()=>{d.current||(d.current=!0,i(I=>!I))}),h=ue((I,w)=>{l.set(I,w),m()}),g=ue(I=>{l.delete(I),m()}),x=ue(I=>{const w=new Map;return n.current.length=0,r&&(r.current.length=0),I.forEach(E=>{w.set(E.element,{...E.registration.metadata??{},index:E.index}),n.current[E.index]=E.element,r&&(r.current[E.index]=E.registration.label!==void 0?E.registration.label:E.registration.textRef?.current?.textContent??E.element.textContent)}),u.current=n.current.length,w});function b(I){if(A.current?.disconnect(),A.current=null,typeof MutationObserver!="function"||I.length<2)return;const w=new MutationObserver(S=>{if(!ax(S))return;let D=null;for(const k of I)if(k.isConnected){if(D&&Vd(D,k)>0){w.disconnect(),m();return}D=k}});A.current=w;const E=new Set;for(let S=1;S<I.length;S+=1){const D=ix(I[S-1],I[S]);D&&E.add(D)}E.forEach(S=>w.observe(S,{childList:!0}))}const v=ue(()=>{const[I,w]=sx(l),E=x(I);b(w),p.current=I,d.current=!1,a.forEach(S=>S(E)),s(E)});le(()=>(d.current||x(p.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,x]),le(()=>{d.current&&v()}),le(()=>()=>{A.current?.disconnect(),d.current=!0},[]);const y=ue(I=>(a.add(I),()=>{a.delete(I)})),C=f.useMemo(()=>({register:h,unregister:g,subscribeMapChange:y,nextIndexRef:u}),[h,g,y,u]);return c.jsx(zd.Provider,{value:C,children:t})}function rx(){return new Map}function ox(){return new Set}function sx(e){const t=new Set,n=[],r=[];e.forEach((s,i)=>{if(!i.isConnected)return;const a=s.index,l={index:a??-1,element:i,registration:s};a===null?r.push(l):a>=0&&(t.add(a),n.push(l))});let o=0;return r.sort((s,i)=>Vd(s.element,i.element)),r.forEach(s=>{for(;t.has(o);)o+=1;s.index=o,n.push(s),o+=1}),t.size>0&&n.sort((s,i)=>s.index-i.index),[n,r.map(s=>s.element)]}function ix(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ax(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function Vd(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const lx=20;function Zd(e,t,n,r){const[o,s]=f.useState(!1);le(()=>{if(!e||!t||n==null){s(!1);return}const i=je(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-lx)},[e,t,n]),jd(e&&(!t||o),r)}const cx=f.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:a,align:l,sideOffset:u=0,alignOffset:d=0,collisionBoundary:p="clipping-ancestors",collisionPadding:A=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:x=Xu,style:b,...v}=t,{store:y}=ir(),C=tx(),I=ja(!0),w=y.useState("parent"),E=y.useState("floatingRootContext"),S=y.useState("floatingTreeRoot"),D=y.useState("mounted"),k=y.useState("open"),j=y.useState("modal"),N=y.useState("openMethod"),T=y.useState("activeTriggerElement"),F=y.useState("transitionStatus"),R=y.useState("positionerElement"),O=y.useState("instantType"),_=y.useState("adaptiveOrigin"),M=y.useState("lastOpenChangeReason"),H=y.useState("floatingNodeId"),G=y.useState("floatingParentNodeId"),B=E.useState("domReferenceElement"),P=f.useRef(null),W=oa(R);let Y=r,Z=u,Q=d,J=l,K=x;w.type==="context-menu"&&(Y=r??w.context?.anchor,J=J??"start",!a&&J!=="center"&&(Q=t.alignOffset??2,Z=t.sideOffset??-5));let ee=a,ce=J;w.type==="menu"?(ee=ee??"inline-end",ce=ce??"start",K=t.collisionAvoidance??qu):w.type==="menubar"&&(ee=ee??(w.context.orientation==="vertical"?"inline-end":"bottom"),ce=ce??"start");const te=w.type==="context-menu",$=Fa({anchor:Y,floatingRootContext:E,positionMethod:I?"fixed":o,mounted:D,side:ee,sideOffset:Z,align:ce,alignOffset:Q,arrowPadding:te?0:m,collisionBoundary:p,collisionPadding:A,sticky:h,nodeId:H,keepMounted:C,disableAnchorTracking:g,collisionAvoidance:K,shift:te?{crossAxis:!("side"in K&&K.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:S,adaptiveOrigin:_});f.useEffect(()=>{function se(ae){ae.open&&(ae.parentNodeId===H&&y.set("hoverEnabled",!1),ae.nodeId!==H&&ae.parentNodeId===y.select("floatingParentNodeId")&&y.setOpen(!1,Ce(xr)))}return S.events.on("menuopenchange",se),()=>{S.events.off("menuopenchange",se)}},[y,S.events,H]),f.useEffect(()=>{if(y.select("floatingParentNodeId")==null)return;function se(ae){if(ae.open||ae.nodeId!==y.select("floatingParentNodeId"))return;const xe=ae.reason??xr;y.setOpen(!1,Ce(xe))}return S.events.on("menuopenchange",se),()=>{S.events.off("menuopenchange",se)}},[S.events,y]);const X=ht();f.useEffect(()=>{k||X.clear()},[k,X]),f.useEffect(()=>{function se(ae){if(!(!k||ae.nodeId!==y.select("floatingParentNodeId")))if(ae.target&&T&&T!==ae.target){const xe=y.select("closeDelay");xe>0?X.isStarted()||X.start(xe,()=>{y.setOpen(!1,Ce(xr))}):y.setOpen(!1,Ce(xr))}else X.clear()}return S.events.on("itemhover",se),()=>{S.events.off("itemhover",se)}},[S.events,k,T,y,X]),f.useEffect(()=>{const se={open:k,nodeId:H,parentNodeId:G,reason:y.select("lastOpenChangeReason")};S.events.emit("menuopenchange",se)},[S.events,k,y,H,G]),le(()=>{const se=B,ae=P.current;if(se&&(P.current=se),ae&&se&&se!==ae){y.set("instantType",void 0);const xe=new AbortController;return W(()=>{y.set("instantType","trigger-change")},xe.signal),()=>{xe.abort()}}},[B,W,y]);const ne={open:k,side:$.side,align:$.align,anchorHidden:$.anchorHidden,nested:w.type==="menu",instant:O},de=w.type==="menubar"&&w.context.modal;Zd(k&&(de||j&&M!==ct),N==="touch",R,T);const ie=Ba(t,ne,{styles:$.positionerStyles,transitionStatus:F,props:v,refs:[n,y.useStateSetter("positionerElement")],hidden:!D,inert:!k}),he=D&&w.type!=="menu"&&(w.type!=="menubar"&&j&&M!==ct||w.type==="menubar"&&w.context.modal);let oe=null;return w.type==="menubar"?oe=w.context.contentElement:w.type===void 0&&(oe=T),c.jsxs(Qd.Provider,{value:$,children:[he&&c.jsx(Sa,{ref:w.type==="context-menu"||w.type==="nested-context-menu"?w.context.internalBackdropRef:null,inert:Ea(!k),cutout:oe}),c.jsx(xg,{id:H,children:c.jsx(Ur,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:ie})})]})}),ux=f.createContext(null);function Jd(e){return f.useContext(ux)}const dx={...Ca,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class fx extends Gr{constructor(t){super({...hx(),...t},px(),dx),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),o=n.store.select("floatingTreeRoot"),s=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const i=n.store.select("rootId"),a=n.store.select("floatingTreeRoot"),l=n.store.select("keyboardEventRelay");r===i&&o===a&&s===l||(r=i,o=a,s=l,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}unsubscribeParentListener=null}function px(){return{positionerRef:f.createRef(),popupRef:f.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:f.createRef(),beforeContentFocusGuardRef:f.createRef(),onOpenChangeComplete:void 0,triggerElements:new Yr}}function hx(){return{...va(),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 ua,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:dt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}const Ax=f.createContext(void 0);function gx(){return f.useContext(Ax)}const mx=ha(function(t){const{children:n,open:r,onOpenChange:o,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:a=!1,modal:l,loopFocus:u=!0,orientation:d="vertical",actionsRef:p,closeParentOnEsc:A=!1,handle:m,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:x=!0}=t,b=ja(!0),v=ir(!0),y=Jd(!0),C=gx(),I=f.useMemo(()=>C&&v?{type:"menu",store:v.store}:y?{type:"menubar",context:y}:b&&!v?{type:"context-menu",context:b}:{type:void 0},[b,v,y,C]),w=xx({open:i,openProp:r,activeTriggerId:g,triggerIdProp:h,parent:I});w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",h),w.useContextCallback("onOpenChangeComplete",s);const E=Jn(),S=Jn(),D=w.useState("floatingTreeRoot"),k=id(D),j=wn(),N=w.useState("open"),T=w.useState("activeTriggerElement"),F=w.useState("positionerElement"),R=w.useState("hoverEnabled"),O=w.useState("disabled"),_=w.useState("lastOpenChangeReason"),M=w.useState("parent"),H=w.useState("activeIndex"),G=w.useState("payload"),B=w.useState("floatingParentNodeId"),P=f.useRef(null),W=f.useRef(M.type!=="context-menu"),Y=ht(),Z=f.useRef(!0),Q=ht(),J=B!=null,{openMethod:K,triggerProps:ee}=Td(N);w.useSyncedValues({disabled:a,highlightItemOnHover:x,modal:M.type===void 0?l:void 0,openMethod:K,rootId:E}),ma(w);const{forceUnmount:ce}=xa(N,w,()=>{w.set("allowMouseEnter",!1)});le(()=>{b&&!v?w.update({parent:{type:"context-menu",context:b},floatingNodeId:k,floatingParentNodeId:j}):v&&w.update({floatingNodeId:k,floatingParentNodeId:j})},[b,v,k,j,w]),f.useEffect(()=>{if(N||(P.current=null),M.type==="context-menu"){if(!N){Y.clear(),W.current=!1;return}Y.start(500,()=>{W.current=!0})}},[Y,N,M.type]),le(()=>{!N&&!R&&w.set("hoverEnabled",!0)},[N,R,w]);const te=ue((re,Se)=>{const ke=Se.reason;if(!re&&!w.select("open")||N===re&&Se.trigger===T&&_===ke)return;const We=bd(Se);if(!re&&Se.trigger==null&&(Se.trigger=T??void 0),o?.(re,Se),Se.isCanceled)return;w.state.floatingRootContext.dispatchOpenChange(re,Se);const rt=Se.event;if(re===!1&&rt?.type==="click"&&rt.pointerType==="touch"&&!Z.current)return;re&&ke===Yn?(Z.current=!1,Q.start(300,()=>{Z.current=!0})):(Z.current=!0,Q.clear());const Ge=(ke===Tn||ke===Cr)&&rt.detail===0,At=!re&&(ke===Qo||ke==null),$e={open:re,openChangeReason:ke};P.current=Se.event,ga($e,re,Se.trigger,We()),w.update($e),M.type==="menubar"&&(ke===Yn||ke===jn||ke===ct||ke===oi||ke===xr)?w.set("instantType","group"):Ge||At?w.set("instantType",Ge?"click":"dismiss"):w.set("instantType",void 0)}),$=md({popupStore:w,floatingId:S,nested:j!=null,onOpenChange:te}),X=$.context.events;le(()=>{const re=({open:Se,eventDetails:ke})=>te(Se,ke);return X.on("setOpen",re),()=>{X?.off("setOpen",re)}},[X,te]);const ne=f.useCallback(()=>{w.setOpen(!1,Ce(Pi))},[w]);f.useImperativeHandle(p,()=>({unmount:ce,close:ne}),[ce,ne]);let de;M.type==="context-menu"&&(de=M.context),f.useImperativeHandle(de?.positionerRef,()=>F,[F]),f.useImperativeHandle(de?.actionsRef,()=>({setOpen:te}),[te]);const fe=es($,{enabled:!O,bubbles:{escapeKey:A&&M.type==="menu"},outsidePress(){return M.type!=="context-menu"||P.current?.type==="contextmenu"?!0:W.current},externalTree:J?D:void 0}),ie=ls(),he=f.useCallback(re=>{w.select("activeIndex")!==re&&w.set("activeIndex",re)},[w]),oe=Rd($,{enabled:!O,listRef:w.context.itemDomElements,activeIndex:H,nested:M.type!==void 0,loopFocus:u,orientation:d,parentOrientation:M.type==="menubar"?M.context.orientation:void 0,rtl:ie==="rtl",disabledIndices:Ht,onNavigate:he,openOnArrowKeyDown:M.type!=="context-menu",externalTree:J?D:void 0,focusItemOnHover:x}),se=f.useCallback(re=>{w.context.typingRef.current=re},[w]),ae=Dd($,{enabled:!O,listRef:w.context.itemLabels,elementsRef:w.context.itemDomElements,activeIndex:H,resetMs:fg,onMatch:re=>{N&&re!==H&&w.set("activeIndex",re)},onTyping:se}),xe=f.useMemo(()=>{const re=Nt(ae.reference,oe.reference,fe.reference,{onMouseMove(){w.set("allowMouseEnter",!0)}},ee);return re["aria-haspopup"]="menu",re["aria-expanded"]=N,re},[w,ae.reference,oe.reference,fe.reference,ee,N]),me=f.useMemo(()=>{const re=Nt(oe.trigger,fe.trigger,ee);return re["aria-haspopup"]="menu",re["aria-expanded"]=!1,re},[oe.trigger,fe.trigger,ee]),L=f.useMemo(()=>Nt(rs,{id:S,role:"menu","aria-labelledby":T?.id,onMouseMove(){w.set("allowMouseEnter",!0),M.type==="menu"&&w.set("hoverEnabled",!1)},onClick(){w.select("hoverEnabled")&&w.set("hoverEnabled",!1)},onKeyDown(re){const Se=w.select("keyboardEventRelay");Se&&!re.isPropagationStopped()&&Se(re)}},ae.floating,oe.floating,fe.floating),[T,S,M.type,w,ae.floating,oe.floating,fe.floating]),z=oe.item??dt;ba(w,{floatingRootContext:$,activeTriggerProps:xe,inactiveTriggerProps:me,popupProps:L,itemProps:z});const ye=f.useMemo(()=>({store:w,parent:I}),[w,I]),q=c.jsxs(Yd.Provider,{value:ye,children:[m&&c.jsx(Aa,{handle:m,store:w}),typeof n=="function"?n({payload:G}):n]});return M.type===void 0||M.type==="context-menu"?c.jsx(bg,{externalTree:D,children:q}):q});function xx(e){return Ft(()=>new fx(e)).current}const ao=5;function $d(e,t){const n=bx(t);return e.clientX>=n.left-ao&&e.clientX<=n.right+ao&&e.clientY>=n.top-ao&&e.clientY<=n.bottom+ao}function bx(e){const t=e.getBoundingClientRect(),n=it(e);if(Vi)return t;const r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||o.content!=="none"))return t;const i=parseFloat(r.width)||0,a=parseFloat(r.height)||0,l=parseFloat(o.width)||0,u=parseFloat(o.height)||0,d=Math.max(t.width,i,l),p=Math.max(t.height,a,u),A=d-t.width,m=p-t.height;return{left:t.left-A/2,right:t.right+A/2,top:t.top-m/2,bottom:t.bottom+m/2}}function Xd(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Oi(),{ref:o,index:s}=hs(e),i=n===s,a=f.useRef(null),l=Ut(o,a);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(s)},onMouseMove(){const d=a.current;if(!t||!d)return;const p=d.hasAttribute("disabled")||d.ariaDisabled==="true";!i&&!p&&d.focus()}},compositeRef:l,index:s}}function qd(e){const{render:t,className:n,style:r,state:o=dt,props:s=Ht,refs:i=Ht,metadata:a,stateAttributesMapping:l,tag:u="div",...d}=e,{compositeProps:p,compositeRef:A}=Xd({metadata:a});return Me(u,e,{state:o,ref:[A,...i],props:[p,...s,d],stateAttributesMapping:l})}function ef(e){if(Xe(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Fn(e))return ef($n(e))}function vx(e,t){const n=f.useRef(null);function r(s){cn.flushSync(()=>{e.setOpen(!1,Ce(jn,s.nativeEvent,s.currentTarget))}),WA(n.current)?.focus()}function o(s){const i=e.select("positionerElement");if(i&&zn(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{cn.flushSync(()=>{e.setOpen(!1,Ce(jn,s.nativeEvent,s.currentTarget))});let a=KA(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&ve(i,a);){const l=a;if(a=na(a),a===l)break}a?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:o}}function yx(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,o=f.useRef(!1);return f.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!r||n==="close"&&r)&&(o.current=!0,je(s.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:s=>{o.current&&(o.current=!1,s.preventBaseUIHandler())}}:dt,[t,n,r])}const Cx=gd(function(t,n){const{render:r,className:o,style:s,disabled:i=!1,nativeButton:a=!0,id:l,openOnHover:u,delay:d=100,closeDelay:p=0,handle:A,payload:m,...h}=t,g=ir(!0),b=Id(A)??g?.store;if(!b)throw new Error(at(85));const v=wt(l),y=b.useState("isTriggerActive",v),C=b.useState("floatingRootContext"),I=b.useState("isOpenedByTrigger",v),w=b.useState("triggerPopupId",v),E=f.useRef(null),S=wx(),D=Oi(!0),k=kn(),j=f.useMemo(()=>k??new ua,[k]),N=id(j),T=wn(),{registerTrigger:F,isMountedByThisTrigger:R}=vd(v,E,b,{payload:m,closeDelay:p,parent:S,floatingTreeRoot:j,floatingNodeId:N,floatingParentNodeId:T,keyboardEventRelay:D?.relayKeyboardEvent}),O=S.type==="menubar",_=b.useState("disabled"),M=i||_||O&&S.context.disabled,{getButtonProps:H,buttonRef:G}=Vt({disabled:M,native:a});f.useEffect(()=>{!I&&S.type===void 0&&(b.context.allowMouseUpTriggerRef.current=!1)},[b,I,S.type]);const B=f.useRef(null),P=ht(),W=ue(se=>{if(!B.current)return;P.clear(),b.context.allowMouseUpTriggerRef.current=!1;const ae=se.target;ve(B.current,ae)||ve(b.select("positionerElement"),ae)||ae===B.current||ae!=null&&ef(ae)===b.select("rootId")||$d(se,B.current)||j.events.emit("close",{domEvent:se,reason:wu})});f.useEffect(()=>{I&&b.select("lastOpenChangeReason")===ct&&je(B.current).addEventListener("mouseup",W,{once:!0})},[I,W,b]);const Y=O&&S.context.hasSubmenuOpen,Q=Sd(C,{enabled:(u??Y)&&!M&&(!O||Y&&!R),handleClose:Fd({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?d:void 0,delay:{close:p},triggerElementRef:E,externalTree:j,isActiveTrigger:y,isClosing:()=>b.select("transitionStatus")==="ending"}),J=Ix(I,b.select("lastOpenChangeReason")),K=ad(C,{enabled:!M,event:I&&O?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0?J:!1}),ee=wd(C,{enabled:!M&&Y}),ce=yx({open:I,enabled:O,mouseDownAction:"open"}),te=f.useMemo(()=>Nt(ee.reference,K.reference),[ee.reference,K.reference]),$=b.useState("triggerProps",R),{preFocusGuardRef:X,handlePreFocusGuardFocus:ne,handleFocusTargetFocus:de}=vx(b,E),fe={disabled:M,open:I},ie=[B,n,G,F,E],he=[te,Q??dt,$,{"aria-haspopup":"menu","aria-controls":w,id:v,onMouseDown:se=>{if(b.select("open"))return;P.start(200,()=>{b.context.allowMouseUpTriggerRef.current=!0}),je(se.currentTarget).addEventListener("mouseup",W,{once:!0})}},O?{role:"menuitem"}:{},ce,h,H],oe=Me("button",t,{enabled:!O,stateAttributesMapping:fi,state:fe,ref:ie,props:he});return O?c.jsx(qd,{tag:"button",render:r,className:o,style:s,state:fe,refs:ie,props:he,stateAttributesMapping:fi}):I?c.jsxs(f.Fragment,{children:[c.jsx(tr,{ref:X,onFocus:ne},`${v}-pre-focus-guard`),c.jsx(f.Fragment,{children:oe},v),c.jsx(tr,{ref:b.context.triggerFocusTargetRef,onFocus:de},`${v}-post-focus-guard`)]}):c.jsx(f.Fragment,{children:oe},v)});function Ix(e,t){const n=ht(),[r,o]=f.useState(!1);return le(()=>{e&&t===ct?(o(!0),n.start(pg,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}function wx(){const e=Jd();return f.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}function tf(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function jo({...e}){return c.jsx(mx,{"data-slot":"dropdown-menu",...e})}function Mo({...e}){return c.jsx(Cx,{"data-slot":"dropdown-menu-trigger",...e})}function No({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:o,...s}){return c.jsx(nx,{children:c.jsx(cx,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:c.jsx(ex,{"data-slot":"dropdown-menu-content",className:ge("cn-menu-target cn-menu-translucent 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 ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...s})})})}function To({className:e,inset:t,variant:n="default",...r}){return c.jsx(X0,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ge("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}const nf=f.createContext(void 0),rf=()=>{const[e]=zu(),t=f.useMemo(()=>new URLSearchParams(e.split("?")[1]??""),[e]),n=(e.split("?")[0]??"/add").replace(/^\/?/u,"");return{route:n==="applications"||n==="help"?n:"add",query:t}},of=()=>{const e=f.useContext(nf);if(e===void 0)throw new Error("useWorkbenchNavigation must be used inside WorkbenchShell");return e},kx=({product:e})=>{const{messages:t}=mt(),{state:n,toggleSidebar:r}=ps(),o=n==="collapsed",s=`${e} · ${o?t.shell.expand:t.shell.collapse}`;return o?c.jsx(kr,{size:"lg",className:"group/brand relative justify-center",children:c.jsxs("span",{className:"relative grid size-8 shrink-0 place-items-center",children:[c.jsx("img",{src:"/logo.png",alt:e,width:24,height:24,className:"size-6 rounded-md transition-opacity group-hover/brand:opacity-0 focus-visible-within:opacity-0"}),c.jsx("button",{type:"button",onClick:r,"aria-label":s,title:s,className:"absolute inset-0 grid place-items-center rounded-md opacity-0 transition-opacity hover:bg-sidebar-accent focus-visible:opacity-100 group-hover/brand:opacity-100",children:c.jsx(Cl,{"aria-hidden":!0,className:"size-4"})})]})}):c.jsxs(kr,{size:"lg",className:"justify-start pr-1",children:[c.jsx("img",{src:"/logo.png",alt:e,width:24,height:24,className:"size-6 shrink-0 rounded-md"}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),c.jsx("button",{type:"button",onClick:r,"aria-label":s,title:s,className:"grid size-6 shrink-0 place-items-center rounded-md hover:bg-sidebar-accent",children:c.jsx(Cl,{"aria-hidden":!0,className:"size-4"})})]})},Ex=({children:e,panelOpen:t})=>{const{locale:n,messages:r,setLocale:o,theme:s,setTheme:i}=mt(),{route:a}=rf(),l=f.useCallback(g=>{window.location.hash=`#/${g}`},[]),[u,d]=f.useState(()=>window.innerWidth>=768),p=t===!0;f.useEffect(()=>{const g=window.matchMedia("(min-width: 768px)"),x=()=>{d(g.matches&&!p)};return x(),g.addEventListener("change",x),()=>g.removeEventListener("change",x)},[p]);const A=f.useMemo(()=>({route:a,navigate:l}),[a,l]),m=[{route:"add",icon:c.jsx(Ru,{"aria-hidden":!0}),label:r.nav.add},{route:"applications",icon:c.jsx(_h,{"aria-hidden":!0}),label:r.nav.applications},{route:"help",icon:c.jsx(Ch,{"aria-hidden":!0}),label:r.nav.help}],h=s==="system"?r.theme.system:s==="light"?r.theme.light:r.theme.dark;return c.jsx(nf.Provider,{value:A,children:c.jsxs(O0,{open:u,onOpenChange:d,children:[c.jsxs(H0,{collapsible:"icon",children:[c.jsx(W0,{children:c.jsx(Ks,{children:c.jsx(io,{children:c.jsx(kx,{product:r.shell.product})})})}),c.jsx(Q0,{children:c.jsx(G0,{children:c.jsx(Y0,{children:c.jsx(Ks,{children:m.map(g=>c.jsx(io,{children:c.jsxs(us,{children:[c.jsxs(ds,{render:c.jsx(kr,{isActive:a===g.route,tooltip:g.label,"aria-label":g.label,onClick:()=>{l(g.route)}}),children:[g.icon,c.jsx("span",{children:g.label})]}),c.jsx(fs,{side:"right",children:g.label})]})},g.route))})})})}),c.jsx(L0,{children:c.jsxs(Ks,{children:[c.jsx(io,{children:c.jsxs(jo,{children:[c.jsx(Mo,{render:c.jsxs(kr,{tooltip:r.language.title,"aria-label":r.language.title,children:[c.jsx("span",{"aria-hidden":!0,className:"text-xs font-semibold",children:Kp[n]}),c.jsx("span",{children:r.language.title})]})}),c.jsx(No,{side:"top",align:"start",children:Wp.map(g=>c.jsx(To,{onClick:()=>{o(g)},children:Lp(g)},g))})]})}),c.jsx(io,{children:c.jsxs(jo,{children:[c.jsx(Mo,{render:c.jsxs(kr,{tooltip:`${r.theme.title}: ${h}`,"aria-label":`${r.theme.title}: ${h}`,children:[s==="light"?c.jsx(iA,{"aria-hidden":!0}):s==="dark"?c.jsx(Yh,{"aria-hidden":!0}):c.jsx(Qh,{"aria-hidden":!0}),c.jsx("span",{children:h})]})}),c.jsx(No,{side:"top",align:"start",children:[["system",r.theme.system],["light",r.theme.light],["dark",r.theme.dark]].map(([g,x])=>c.jsx(To,{onClick:()=>{i(g)},children:x},g))})]})})]})}),c.jsx(K0,{"aria-label":r.shell.toggleSidebar})]}),c.jsx("main",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:e})]})})};function Sx(e){if(!e)return null;for(const t of e.elements){const n=t.tagName;if(n==="BUTTON"||n==="INPUT"){const r=t;if(r.type==="submit")return r}}return null}function sf(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":""}:{"data-unchecked":""}},...Hi}}const Rx=f.createContext(void 0);function Dx(){return f.useContext(Rx)}const af=f.createContext(void 0);function Fx(){const e=f.useContext(af);if(e===void 0)throw new Error(at(14));return e}const Bx="data-parent",jx=f.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:l,id:u,indeterminate:d=!1,inputRef:p,name:A,onCheckedChange:m,parent:h=!1,readOnly:g=!1,render:x,required:b=!1,uncheckedValue:v,value:y,nativeButton:C=!1,style:I,...w}=t,{clearErrors:E}=Ki(),{disabled:S,name:D,setDirty:k,setFilled:j,setFocused:N,setTouched:T,state:F,validationMode:R,validityData:O,validation:_}=Yo(),M=GA(),{labelId:H,controlId:G,registerControlId:B,getDescriptionProps:P}=Wi(),W=Dx(),Y=W?.allValues===void 0?void 0:W.parent,Z=Y!==void 0,Q=S||M.disabled||W?.disabled||a,J=D??A,K=y??J,ee=wt(),ce=wt();let te=u||G;Z&&(h?te=ce:K!==void 0?te=`${Y.id}-${K}`:te||=ce);let $={};Z&&(h?$=Y.getParentProps():K!==void 0&&($=Y.getChildProps(K)));const{checked:X=r,indeterminate:ne=d,onCheckedChange:de,...fe}=$,ie=W?.value,he=f.useRef(null),oe=Ft(()=>Symbol()),se=f.useRef(!1),{getButtonProps:ae,buttonRef:xe}=Vt({disabled:Q,native:C}),me=W?.validation??_,[L,z]=ln({controlled:K!==void 0&&ie!==void 0&&!h?ie.includes(K):X,default:s,name:"Checkbox",state:"checked"}),ye=Z?!!X:L,q=Z&&ne||d;le(()=>{B!==Er&&(se.current=!0,B(oe.current,te))},[te,B,oe]),f.useEffect(()=>{const Ee=oe.current;return()=>{!se.current||B===Er||(se.current=!1,B(Ee,void 0))}},[B,oe]),Li(he,ee,L,void 0,!W&&!Q,A);const re=f.useRef(null),Se=me.registerInput,ke=W?K:void 0,We=f.useCallback(Ee=>Se(Ee,{controlRef:he,value:ke}),[Se,ke]),rt=Ut(p,re,h?void 0:We),Ge=Fu(i,H,re,!C,te??void 0);le(()=>{re.current&&(re.current.indeterminate=q,L&&j(!0))},[L,q,j]),as(L,()=>{W||(E(J),j(L),k(L!==O.initialValue),me.change(L))});const At=Nt({checked:L,disabled:Q,form:l,name:h?void 0:J,id:C?void 0:te??void 0,required:b,ref:rt,style:J?la:qo,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Ee){if(Ee.nativeEvent.defaultPrevented)return;if(g){Ee.preventDefault();return}const Le=Ee.currentTarget.checked,Ze=Ce(Pt,Ee.nativeEvent);if(m?.(Le,Ze),!Ze.isCanceled&&(de?.(Le,Ze),!Ze.isCanceled&&(z(Le),K!==void 0&&W!==void 0&&!h&&!Z))){const ze=Le?[...W.value,K]:W.value.filter(Re=>Re!==K);W.setValue(ze,Ze)}},onClick(Ee){Ee.stopPropagation()},onFocus(){he.current?.focus()}},y!==void 0?{value:(W?L&&y:y)||""}:dt,P,Ee=>me.getValidationProps(Q,Ee));f.useEffect(()=>{if(!Y||K===void 0)return;const Ee=Y.disabledStatesRef.current;return Ee.set(K,Q),()=>{Ee.delete(K)}},[Y,Q,K]);const $e=f.useMemo(()=>({...F,checked:ye,disabled:Q,readOnly:g,required:b,indeterminate:q}),[F,ye,Q,g,b,q]),Oe=sf($e),lt=Me("span",t,{state:$e,ref:[xe,he,n],props:[{id:C?te??void 0:ee,role:"checkbox","aria-checked":q?"mixed":ye,"aria-readonly":g||void 0,"aria-required":b||void 0,"aria-labelledby":Ge,[Bx]:h?"":void 0,onFocus(){Q||N(!0)},onBlur(){const Ee=re.current;Ee&&(T(!0),N(!1),R==="onBlur"&&me.commit(W?ie:Ee.checked))},onKeyDown(Ee){if(Ee.key!=="Enter"||(Ee.preventBaseUIHandler(),Ee.defaultPrevented))return;const Le=re.current?.form??null,Ze=Ee.currentTarget,ze=Ee.nativeEvent,Re=Ee.preventDefault,Pe=ze.preventDefault;let Je=!1;Ee.preventDefault=()=>{Je=!0,Re.call(Ee)},ze.preventDefault=()=>{Je=!0,Pe.call(ze)},Pe.call(ze),it(Ze).queueMicrotask(()=>{Ee.preventDefault=Re,ze.preventDefault=Pe,Je||Sx(Le)?.click()})},onClick(Ee){if(g||Q)return;Ee.preventDefault();const Le=re.current;Le&&_i(Le,Ee)}},w,fe,ae,P,Ee=>me.getValidationProps(Q,Ee)],stateAttributesMapping:Oe});return c.jsxs(af.Provider,{value:$e,children:[lt,!L&&!W&&J&&!h&&v!==void 0&&c.jsx("input",{type:"hidden",form:l,name:J,value:v,disabled:Q}),c.jsx("input",{...At,suppressHydrationWarning:!0})]})}),Mx=f.forwardRef(function(t,n){const{render:r,className:o,style:s,keepMounted:i=!1,...a}=t,l=Fx(),u=l.checked||l.indeterminate,{mounted:d,transitionStatus:p,setMounted:A}=sr(u),m=f.useRef(null),h={...l,transitionStatus:p};Zt({open:u,ref:m,onComplete(){u||A(!1)}});const x={...sf(l),..._n},b=i||d,v=Me("span",t,{ref:[n,m],state:h,stateAttributesMapping:x,props:a});return b?v:null});function Ci({className:e,...t}){return c.jsx(jx,{"data-slot":"checkbox",className:ge("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 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 dark:data-checked:bg-primary",e),...t,children:c.jsx(Mx,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:c.jsx(Gi,{})})})}function Ne({className:e,...t}){return c.jsx("label",{"data-slot":"label",className:ge("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",e),...t})}const lf=f.createContext(void 0);function cf(){const e=f.useContext(lf);if(e===void 0)throw new Error(at(10));return e}const Nx={value:()=>null},Tx=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,hiddenUntilFound:i,keepMounted:a,loopFocus:l,onValueChange:u,multiple:d=!1,orientation:p="vertical",value:A,defaultValue:m,style:h,...g}=t,x=f.useMemo(()=>{if(A===void 0)return m??[]},[A,m]),b=f.useRef([]),[v,y]=ln({controlled:A,default:x,name:"Accordion",state:"value"}),C=ue((S,D,k)=>{if(d)if(D){const j=v.slice();if(j.push(S),u?.(j,k),k.isCanceled)return;y(j)}else{const j=v.filter(N=>N!==S);if(u?.(j,k),k.isCanceled)return;y(j)}else{const j=v[0]===S?[]:[S];if(u?.(j,k),k.isCanceled)return;y(j)}}),I=f.useMemo(()=>({value:v,disabled:s,orientation:p}),[v,s,p]),w=f.useMemo(()=>({disabled:s,handleValueChange:C,hiddenUntilFound:i??!1,keepMounted:a??!1,state:I,value:v}),[s,C,i,a,I,v]),E=Me("div",t,{state:I,ref:n,props:g,stateAttributesMapping:Nx});return c.jsx(lf.Provider,{value:w,children:c.jsx(Ur,{elementsRef:b,children:E})})});function Px(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:o}=e,[s,i]=ln({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:a,setMounted:l,transitionStatus:u}=sr(s,!0,!0),d=wt(),[p,A]=f.useState(),m=p===null?void 0:p??d,h=ue(g=>{const x=!s,b=Ce(Tn,g.nativeEvent);r(x,b),!b.isCanceled&&i(x)});return f.useMemo(()=>({defaultPanelId:d,disabled:o,handleTrigger:h,mounted:a,open:s,panelId:m,setMounted:l,setOpen:i,setPanelIdState:A,transitionStatus:u}),[d,o,h,a,s,m,l,i,A,u])}const uf=f.createContext(void 0);function df(){const e=f.useContext(uf);if(e===void 0)throw new Error(at(15));return e}const ff=f.createContext(void 0);function Na(){const e=f.useContext(ff);if(e===void 0)throw new Error(at(9));return e}let Ta=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ro.startingStyle]="startingStyle",e[e.endingStyle=Ro.endingStyle]="endingStyle",e})({}),_x=(function(e){return e.panelOpen="data-panel-open",e})({});const Ox={[Ta.open]:""},Hx={[Ta.closed]:""},Kx={open(e){return e?{[_x.panelOpen]:""}:null}},Wx={open(e){return e?Ox:Hx}};let Lx=(function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e})({});const Pa={...Wx,index:e=>({[Lx.index]:String(e)}),..._n,value:()=>null},Qx=f.forwardRef(function(t,n){const{className:r,disabled:o=!1,onOpenChange:s,render:i,value:a,style:l,...u}=t,{ref:d,index:p}=hs(),A=Ut(n,d),{disabled:m,handleValueChange:h,state:g,value:x}=cf(),b=wt(),v=a??b,y=o||m,C=x.indexOf(v)!==-1,I=ue((O,_)=>{s?.(O,_),!_.isCanceled&&h(v,O,_)}),w=Px({open:C,onOpenChange:I,disabled:y}),E=f.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),S=f.useMemo(()=>({...w,onOpenChange:I,state:E}),[w,E,I]),D=f.useMemo(()=>({...g,hidden:!C&&!w.mounted,index:p,disabled:y,open:C}),[w.mounted,y,p,C,g]),k=wt(),[j,N]=f.useState(),T=j===null?void 0:j??k,F=f.useMemo(()=>({defaultTriggerId:k,open:C,state:D,setTriggerId:N,triggerId:T}),[k,C,D,N,T]),R=Me("div",t,{state:D,ref:A,props:u,stateAttributesMapping:Pa});return c.jsx(uf.Provider,{value:S,children:c.jsx(ff.Provider,{value:F,children:R})})}),Gx=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{state:a}=Na();return Me("h3",t,{state:a,ref:n,props:i,stateAttributesMapping:Pa})}),Yx=f.forwardRef(function(t,n){const{disabled:r,className:o,id:s,render:i,nativeButton:a=!0,style:l,...u}=t,{panelId:d,open:p,handleTrigger:A,disabled:m}=df(),h=r||m,{getButtonProps:g,buttonRef:x}=Vt({disabled:h,focusableWhenDisabled:!0,native:a}),{defaultTriggerId:b,state:v,setTriggerId:y}=Na(),C=s||void 0,I=C??b;return le(()=>(y(S=>C??(S===null?void 0:S)),()=>{y(S=>S===C?null:S)}),[C,y]),Me("button",t,{state:v,ref:[n,x],props:[{"aria-controls":p?d:void 0,"aria-expanded":p,id:I,onClick:A},u,g],stateAttributesMapping:Kx})}),cr={height:void 0,width:void 0};function zx(e){const{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:o,mounted:s,onOpenChange:i,open:a,setMounted:l,setOpen:u,transitionStatus:d}=e,p=f.useRef(null),A=f.useRef(null),[m,h]=f.useState(cr),g=f.useRef(cr),x=f.useRef(!1),b=f.useRef(a),v=f.useRef(!1),[y,C]=f.useState(!1),I=f.useRef(null),w=Ut(t,p),E=nt(a),S=oa(p),D=!a&&!s,k=y?"idle":d,j=a&&(b.current||v.current),N=!a&&s&&A.current==="css-animation"&&m.height===void 0&&m.width===void 0?g.current:m,T=n&&D&&A.current!=="css-animation",F=ue((H,G=!0)=>{G&&(g.current=H),h(H)}),R=ue(()=>{I.current?.(),I.current=null}),O=ue(H=>{R(),I.current=()=>{I.current=null,H()}}),_=ue(()=>{a&&s&&A.current==="css-animation"&&(v.current=!0)});le(()=>{!y||d==="starting"||C(!1)},[y,d]),f.useEffect(()=>()=>{_(),R()},[_,R]),le(()=>{const H=p.current;if(!H)return;!a&&I.current&&R();const G=Ux(H,j);if(A.current=G,a&&d==="idle"&&b.current&&G==="css-animation"){g.current=Kn(H);return}if(a&&d==="starting"){const W=x.current;if(x.current=!1,G==="none"){F(Kn(H)),C(!0);return}if(G==="css-transition"){const Q=Vx(H);if(F(Kn(H)),!W)return Q;const J=lo(H,"transition-duration","0s");return O(J),C(!0),Q}F(Kn(H));const Y=lo(H,"animation-name","none");if(!W){Y();return}const Z=lo(H,"animation-duration","0s");Y(),O(Z),C(!0);return}if(!a&&s&&(d==="idle"||d==="starting")){if(b.current=!1,v.current=!1,G==="none"){F(cr,!1),l(!1);return}F(Kn(H));return}if(d!=="ending")return;if(G==="none"){l(!1);return}const B=Kn(H);if(!(B.height>0||B.width>0)){l(!1);return}F(B),G==="css-animation"&&lo(H,"animation-name","none")()},[s,a,R,F,l,O,j,d]),Zt({enabled:a&&s&&k==="idle",open:!0,ref:p,onComplete(){a&&F(cr,!1)}}),f.useEffect(()=>{if(a||!s||k!=="ending"||!p.current)return;const G=new AbortController;let B=-1;function P(){E.current||(l(!1),F(cr,!1))}return B=It.request(()=>{S(P,G.signal)}),()=>{It.cancel(B),G.abort()}},[E,s,a,k,S,F,l]),le(()=>{const H=p.current;!H||!n||!D||H.setAttribute("hidden","until-found")},[D,n]),f.useEffect(function(){const G=p.current;if(!G)return;function B(P){const W=Ce(Pt,P);i(!0,W),!W.isCanceled&&(x.current=!0,u(!0))}return De(G,"beforematch",B)},[i,u]);const M=o||n||s||a;return{height:N.height,props:{...T?{[Ta.startingStyle]:""}:void 0,hidden:D,id:r},ref:w,shouldPreventOpenAnimation:j,shouldRender:M,transitionStatus:k,width:N.width}}function Kn(e){return{height:e.scrollHeight,width:e.scrollWidth}}function Ux(e,t){const n=it(e).getComputedStyle(e),r=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&dc(n.animationDuration),o=dc(n.transitionDuration);return r&&o||o?"css-transition":r?"css-animation":"none"}function dc(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function lo(e,t,n){const r=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===""){e.style.removeProperty(t);return}e.style.setProperty(t,r,o)}}function Vx(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(o=>{e.style.setProperty(o,"initial","important")});function n(){Object.entries(t).forEach(([o,s])=>{if(s===""){e.style.removeProperty(o);return}e.style.setProperty(o,s)})}const r=It.request(n);return()=>{It.cancel(r),n()}}let fc=(function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e})({});const Zx=f.forwardRef(function(t,n){const{className:r,hiddenUntilFound:o,keepMounted:s,id:i,render:a,style:l,...u}=t,{hiddenUntilFound:d,keepMounted:p}=cf(),{defaultPanelId:A,mounted:m,onOpenChange:h,open:g,setMounted:x,setOpen:b,setPanelIdState:v,transitionStatus:y}=df(),C=o??d,I=s??p,w=i||void 0,E=i??A;le(()=>(v(G=>w??(G===null?void 0:G)),()=>{v(G=>G===w?null:G)}),[w,v]);const{height:S,props:D,ref:k,shouldPreventOpenAnimation:j,shouldRender:N,transitionStatus:T,width:F}=zx({externalRef:n,hiddenUntilFound:C,id:E,keepMounted:I,mounted:m,onOpenChange:h,open:g,setMounted:x,setOpen:b,transitionStatus:y}),{state:R,triggerId:O}=Na(),_={...R,transitionStatus:T},M=Qp(l,_),H=Me("div",{...t,style:void 0},{state:_,ref:k,props:[D,{"aria-labelledby":O,role:"region",style:{[fc.accordionPanelHeight]:S===void 0?"auto":`${S}px`,[fc.accordionPanelWidth]:F===void 0?"auto":`${F}px`}},u,M?{style:M}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Pa});return N?H:null});function _a({className:e,...t}){return c.jsx(Tx,{"data-slot":"accordion",className:ge("flex w-full flex-col",e),...t})}function Oa({className:e,...t}){return c.jsx(Qx,{"data-slot":"accordion-item",className:ge("not-last:border-b",e),...t})}function Ha({className:e,children:t,...n}){return c.jsx(Gx,{className:"flex",children:c.jsxs(Yx,{"data-slot":"accordion-trigger",className:ge("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",e),...n,children:[t,c.jsx(Pn,{className:"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"}),c.jsx(Yi,{className:"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"})]})})}function Ka({className:e,children:t,...n}){return c.jsx(Zx,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",...n,children:c.jsx("div",{className:ge("h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),children:t})})}const pf=f.createContext(void 0);function Jx(){return f.useContext(pf)}const $x=f.forwardRef(function(t,n){const{className:r,defaultPressed:o=!1,disabled:s=!1,form:i,onPressedChange:a,pressed:l,render:u,type:d,value:p,nativeButton:A=!0,style:m,...h}=t,g=wt(p||void 0),x=Jx(),b=x?.value??[],v=x?void 0:o,y=(s||x?.disabled)??!1,[C,I]=ln({controlled:x?g!==void 0&&b.indexOf(g)>-1:l,default:v,name:"Toggle",state:"pressed"}),{getButtonProps:w,buttonRef:E}=Vt({disabled:y,native:A}),S={disabled:y,pressed:C},D=[E,n],k=[{"aria-pressed":C,onClick(T){const F=!C,R=Ce(Pt,T.nativeEvent);a?.(F,R),!R.isCanceled&&(g&&x?.setGroupValue?.(g,F,R),!R.isCanceled&&I(F))}},h,w],j=Me("button",t,{enabled:!x,state:S,ref:D,props:k}),N=f.useMemo(()=>({disabled:y,focusableWhenDisabled:!1}),[y]);return x?c.jsx(qd,{tag:"button",render:u,className:r,style:m,metadata:N,state:S,refs:D,props:k}):j}),hf="data-composite-item-active",Xx=[];function qx(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:o,direction:s,highlightedIndex:i,onHighlightedIndexChange:a,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d,disabledIndices:p,modifierKeys:A=Xx}=e,[m,h]=f.useState(0),g=r!=null,x=f.useRef(null),b=Ut(x,l),v=f.useRef([]),y=f.useRef(!1),C=i??m,I=ue((k,j=!1)=>{if((a??h)(k),j){const N=v.current[k];ql(x.current,N,s,n)}}),w=ue(k=>{if(k.size===0||y.current)return;y.current=!0;const j=Array.from(k.keys()),N=j.find(F=>F?.hasAttribute(hf))??null,T=N?k.get(N)?.index??-1:-1;if(T!==-1)I(T);else if(So(j,C,p)){const F=on(j,{disabledIndices:p});Ir(j,F)||I(F)}ql(x.current,N,s,n)});le(()=>{if(p==null||i!=null||!y.current)return;const k=v.current;if(So(k,C,p)){const j=on(k,{disabledIndices:p});Ir(k,j)||I(j)}},[p,i,C,v,I]);const E=ue((k,j,N)=>o?o(k,j,N,v):N),S=ue(k=>{const j=k.key===vi||k.key===yi;if(!ss.has(k.key)||!u&&j||eb(k,A)||!x.current)return;const T=s==="rtl",F=T?xi:bi,R=T?bi:xi,O=n==="vertical"?mi:F,_=n==="vertical"?gi:R,M=gt(k.nativeEvent);if(M!=null&&Xl(M)&&!tf(M)){const Y=M.selectionStart,Z=M.selectionEnd,Q=M.value;if(Y==null||k.shiftKey||Y!==Z||k.key!==_&&Y<Q.length||k.key!==O&&Y>0)return}let H=C;const G=xo(v,p),B=ui(v,p);r!=null&&(H=r({disabledIndices:p,elementsRef:v,event:k,highlightedIndex:C,loopFocus:t,maxIndex:B,minIndex:G,onLoop:E,orientation:n,rtl:T}));const P=n!=="vertical"&&k.key===F||n!=="horizontal"&&k.key===mi,W=n!=="vertical"&&k.key===R||n!=="horizontal"&&k.key===gi;u&&(k.key===vi?H=G:k.key===yi&&(H=B)),H===C&&(P||W)&&(t&&H===B&&P?(H=G,o&&(H=o(k,C,H,v))):t&&H===G&&W?(H=B,o&&(H=o(k,C,H,v))):H=on(v.current,{startingIndex:H,decrement:W,disabledIndices:p})),H!==C&&!Ir(v.current,H)&&(d&&k.stopPropagation(),(g||j||P||W)&&k.preventDefault(),I(H,!0),queueMicrotask(()=>{v.current[H]?.focus()}))});return{props:{ref:b,onFocus(k){const j=x.current,N=gt(k.nativeEvent);!j||N==null||!Xl(N)||N.setSelectionRange(0,N.value.length)},onKeyDown:S},highlightedIndex:C,onHighlightedIndexChange:I,elementsRef:v,onMapChange:w,relayKeyboardEvent:S}}function eb(e,t){for(const n of Km)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Af(e){const{render:t,className:n,style:r,refs:o=Ht,props:s=Ht,state:i=dt,stateAttributesMapping:a,highlightedIndex:l,onHighlightedIndexChange:u,orientation:d,grid:p,loopFocus:A,onLoop:m,enableHomeAndEndKeys:h,onMapChange:g,stopEventPropagation:x=!0,rootRef:b,disabledIndices:v,modifierKeys:y,highlightItemOnHover:C=!1,tag:I="div",...w}=e,E=ls(),{props:S,highlightedIndex:D,onHighlightedIndexChange:k,elementsRef:j,onMapChange:N,relayKeyboardEvent:T}=qx({grid:p,loopFocus:A,onLoop:m,orientation:d,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:b,stopEventPropagation:x,enableHomeAndEndKeys:h,direction:E,disabledIndices:v,modifierKeys:y}),F=Me(I,e,{state:i,ref:o,props:[S,...s,w],stateAttributesMapping:a}),R=f.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:k,highlightItemOnHover:C,relayKeyboardEvent:T}),[D,k,C,T]);return c.jsx(lh.Provider,{value:R,children:c.jsx(Ur,{elementsRef:j,onMapChange:O=>{g?.(O),N(O)},children:F})})}const tb=f.createContext(void 0);function nb(){return f.useContext(tb)}const rb=f.forwardRef(function(t,n){const{defaultValue:r,disabled:o=!1,loopFocus:s=!0,onValueChange:i,orientation:a="horizontal",multiple:l=!1,value:u,className:d,render:p,style:A,...m}=t,h=Ma(),g=nb(),x=u!==void 0||r!==void 0,b=(h?.disabled??!1)||(g?.disabled??!1)||o,[v,y]=ln({controlled:u,default:u===void 0?r??Ht:void 0,name:"ToggleGroup",state:"value"}),C=ue((D,k,j)=>{let N;l?(N=v.slice(),k?N.push(D):N.splice(v.indexOf(D),1)):N=k?[D]:[],i?.(N,j),!j.isCanceled&&y(N)}),I={disabled:b,multiple:l,orientation:a},w=f.useMemo(()=>({disabled:b,setGroupValue:C,value:v,isValueInitialized:x}),[b,C,v,x]),E={role:"group"},S=Me("div",t,{enabled:!!h,state:I,ref:n,props:[E,m]});return c.jsx(pf.Provider,{value:w,children:h?S:c.jsx(Af,{render:p,className:d,style:A,state:I,refs:[n],props:[E,m],loopFocus:s,enableHomeAndEndKeys:!0,orientation:a})})}),ob=ji("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}}),gf=f.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function Wa({className:e,variant:t,size:n,spacing:r=2,orientation:o="horizontal",children:s,...i}){return c.jsx(rb,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":o,style:{"--gap":r},className:ge("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",e),...i,children:c.jsx(gf.Provider,{value:{variant:t,size:n,spacing:r,orientation:o},children:s})})}function Br({className:e,children:t,variant:n="default",size:r="default",...o}){const s=f.useContext(gf);return c.jsx($x,{"data-slot":"toggle-group-item","data-variant":s.variant||n,"data-size":s.size||r,"data-spacing":s.spacing,className:ge("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",ob({variant:s.variant||n,size:s.size||r}),e),...o,children:t})}function La({...e}){return c.jsx(Nd,{"data-slot":"dialog",...e})}function sb({...e}){return c.jsx(Ra,{"data-slot":"dialog-portal",...e})}function ib({...e}){return c.jsx(Qr,{"data-slot":"dialog-close",...e})}function ab({className:e,...t}){return c.jsx(ia,{"data-slot":"dialog-overlay",className:ge("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",e),...t})}function Qa({className:e,children:t,showCloseButton:n=!0,...r}){return c.jsxs(sb,{children:[c.jsx(ab,{}),c.jsxs(ka,{"data-slot":"dialog-content",className:ge("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-4 text-sm text-popover-foreground ring-1 ring-foreground/10 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",e),...r,children:[t,n&&c.jsxs(Qr,{"data-slot":"dialog-close",render:c.jsx(He,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[c.jsx(zi,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ln({className:e,...t}){return c.jsx("div",{"data-slot":"dialog-header",className:ge("flex flex-col gap-2",e),...t})}function lb({className:e,showCloseButton:t=!1,children:n,...r}){return c.jsxs("div",{"data-slot":"dialog-footer",className:ge("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&c.jsx(Qr,{render:c.jsx(He,{variant:"outline"}),children:"Close"})]})}function Qn({className:e,...t}){return c.jsx(Da,{"data-slot":"dialog-title",className:ge("cn-font-heading text-base leading-none font-medium",e),...t})}function Ga({className:e,...t}){return c.jsx(aa,{"data-slot":"dialog-description",className:ge("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const mf=new Set(["npx","create-opentray","create","set"]),rn={comment:"text-muted-foreground italic",keyword:"text-emerald-600 dark:text-emerald-400 font-medium",flag:"text-sky-600 dark:text-sky-400",string:"text-amber-700 dark:text-amber-300 break-all",env:"text-violet-600 dark:text-violet-400",variable:"text-rose-600 dark:text-rose-400"},cb=(e,t)=>e.split(/(\s+|\$[A-Za-z_][A-Za-z0-9_]*)/g).map((r,o)=>{const s=`${t}-u${o}`;return r.startsWith("$")?c.jsx("span",{className:rn.variable,children:r},s):mf.has(r)?c.jsx("span",{className:rn.keyword,children:r},s):r.startsWith("--")?c.jsx("span",{className:rn.flag,children:r},s):/^[A-Za-z_][A-Za-z0-9_]*=/.test(r)?c.jsx("span",{className:rn.env,children:r},s):c.jsx("span",{children:r},s)}),ub=(e,t)=>e.startsWith("#")?c.jsx("span",{className:rn.comment,children:e}):e.split(/('(?:[^']|'\\'')*')/g).map((r,o)=>{const s=`${t}-s${o}`;if(!r.startsWith("'"))return c.jsx("span",{children:cb(r,s)},s);const i=r.slice(1,-1);return mf.has(i)?c.jsx("span",{className:rn.keyword,children:r},s):i.startsWith("--")?c.jsx("span",{className:rn.flag,children:r},s):/^[A-Za-z_][A-Za-z0-9_]*=/.test(i)?c.jsx("span",{className:rn.env,children:r},s):c.jsx("span",{className:rn.string,children:r},s)}),db=({content:e})=>c.jsx("pre",{className:"tech-ltr bg-muted max-h-72 overflow-auto rounded-md p-2 text-xs whitespace-pre-wrap break-words",children:e.split(`
|
|
3
|
+
`).map((t,n)=>c.jsx("div",{children:t.length===0?" ":ub(t,n)},n))}),xf=({open:e,subtitle:t,hasEnv:n,share:r=!1,runner:o,onClose:s})=>{const{messages:i}=mt(),[a,l]=f.useState("sh"),[u,d]=f.useState(!1),[p,A]=f.useState(null),[m,h]=f.useState(null),[g,x]=f.useState(null),[b,v]=f.useState(!1),[y,C]=f.useState(!1),I=f.useRef(o);I.current=o,f.useEffect(()=>{d(!1),A(null)},[e]),f.useEffect(()=>{if(!e){h(null),x(null);return}if(n&&!u){h(null),v(!1);return}let D=!1;return v(!0),C(!1),x(null),(async()=>{const k=await I.current({format:a,acknowledgeEnv:u,...p===null?{}:{inlineIcon:p}});if(D)return;if(v(!1),k.status===200){const N=k.data;"content"in N&&N.content!==void 0&&(p===null&&N.iconSharedAs!==void 0&&A(N.iconSharedAs==="embedded"),h({filename:N.filename??"create-opentray.sh",content:N.content,...N.commandLine===void 0?{}:{commandLine:N.commandLine},...N.iconReference===void 0?{}:{iconReference:N.iconReference}}));return}h(null);const j=k.data;"code"in j&&x(`${j.message??j.code}`)})(),()=>{D=!0}},[e,a,u,p,n]);const w=!n||u,E=()=>{if(m===null)return;const D=new Blob([m.content],{type:a==="sh"?"text/x-shellscript":"text/plain"}),k=URL.createObjectURL(D),j=document.createElement("a");j.href=k,j.download=m.filename,j.click(),URL.revokeObjectURL(k)},S=async()=>{m!==null&&(await navigator.clipboard.writeText(m.commandLine??m.content),C(!0))};return c.jsx(La,{open:e,onOpenChange:D=>{D||s()},children:c.jsxs(Qa,{children:[c.jsxs(Ln,{children:[c.jsx(Qn,{children:r?i.export.shareTitle:i.export.title}),c.jsxs(Ga,{children:[c.jsx("span",{className:"tech-ltr block truncate",children:t}),r&&c.jsx("span",{className:"text-muted-foreground mt-1 block text-xs",children:i.export.shareSubtitle})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(Wa,{variant:"outline",size:"sm",spacing:0,value:[a],onValueChange:D=>{const k=D[0];(k==="sh"||k==="ps1")&&l(k)},children:[c.jsx(Br,{value:"sh",children:i.export.scriptSh}),c.jsx(Br,{value:"ps1",children:i.export.scriptPs1})]}),b&&c.jsx("span",{className:"text-muted-foreground self-center text-xs",children:i.export.building})]}),n&&c.jsx("div",{className:"border-warning rounded-md border p-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(Ci,{id:"export-env-ack",checked:u,onCheckedChange:D=>d(D===!0)}),c.jsxs(Ne,{htmlFor:"export-env-ack",className:"text-xs leading-snug",children:[i.export.envAck,c.jsx("span",{className:"text-muted-foreground block",children:i.export.envAckHint})]})]})}),m?.iconReference!==void 0&&m.iconReference!=="none"&&c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(Ci,{id:"export-inline-icon",checked:p===!0,onCheckedChange:D=>A(D===!0)}),c.jsxs(Ne,{htmlFor:"export-inline-icon",className:"text-xs leading-snug",children:[i.export.inlineIcon,c.jsx("span",{className:"text-muted-foreground block",children:i.export.inlineIconHint})]})]}),g!==null&&c.jsxs("p",{className:"text-destructive text-xs",role:"alert",children:[i.export.blocked," ",g]}),m!==null&&c.jsx(_a,{children:c.jsxs(Oa,{value:"content",children:[c.jsx(Ha,{className:"text-xs",children:i.export.viewFull}),c.jsx(Ka,{children:c.jsx(db,{content:m.content})})]})}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsxs(He,{size:"sm",variant:"outline",disabled:!w||m===null,onClick:()=>{S()},children:[c.jsx(wh,{width:14,height:14,"aria-hidden":!0}),y?i.common.copied:i.export.copyCommand]}),c.jsxs(He,{size:"sm",disabled:!w||m===null,onClick:E,children:[c.jsx(Eh,{width:14,height:14,"aria-hidden":!0}),i.export.downloadFile]})]})]})})};function fb(e){return Md("alert-dialog",e)}function pc({...e}){return c.jsx(fb,{"data-slot":"alert-dialog",...e})}function pb({...e}){return c.jsx(Ra,{"data-slot":"alert-dialog-portal",...e})}function hb({className:e,...t}){return c.jsx(ia,{"data-slot":"alert-dialog-overlay",className:ge("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",e),...t})}function hc({className:e,size:t="default",...n}){return c.jsxs(pb,{children:[c.jsx(hb,{}),c.jsx(ka,{"data-slot":"alert-dialog-content","data-size":t,className:ge("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-4 text-popover-foreground ring-1 ring-foreground/10 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",e),...n})]})}function Ac({className:e,...t}){return c.jsx("div",{"data-slot":"alert-dialog-header",className:ge("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]",e),...t})}function gc({className:e,...t}){return c.jsx("div",{"data-slot":"alert-dialog-footer",className:ge("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function mc({className:e,...t}){return c.jsx(Da,{"data-slot":"alert-dialog-title",className:ge("cn-font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function xc({className:e,...t}){return c.jsx(aa,{"data-slot":"alert-dialog-description",className:ge("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function bc({className:e,...t}){return c.jsx(He,{"data-slot":"alert-dialog-action",className:ge(e),...t})}function vc({className:e,variant:t="outline",size:n="default",...r}){return c.jsx(Qr,{"data-slot":"alert-dialog-cancel",className:ge(e),render:c.jsx(He,{variant:t,size:n}),...r})}const yc={healthy:"statusHealthy","invalid-config":"statusInvalidConfig","incompatible-version":"statusIncompatible","missing-payload":"statusMissingPayload","broken-link":"statusBrokenLink",running:"statusRunning"},Cc=e=>({statusHealthy:e.applications.statusHealthy,statusInvalidConfig:e.applications.statusInvalidConfig,statusIncompatible:e.applications.statusIncompatible,statusMissingPayload:e.applications.statusMissingPayload,statusBrokenLink:e.applications.statusBrokenLink,statusRunning:e.applications.statusRunning}),Ab=e=>{const t=e.command??{},n=e.window??{};return{command:[t.executable??"",...t.args??[]].filter(Boolean).join(" "),cwd:t.cwd??"",envKeys:Object.keys(t.env??{}),packageManager:typeof e.packageManager=="string"?e.packageManager:"",window:`${n.width??"—"}×${n.height??"—"}`.replace(/—×—/u,"—"),developerMode:e.developerMode===!0}},fn=({label:e,value:t})=>c.jsxs("div",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-1 text-xs",children:[c.jsx("span",{className:"text-muted-foreground",children:e}),c.jsx("span",{className:"tech-ltr break-all",children:t})]}),gb=({app:e,dataUrl:t})=>{const n=(e.appName??e.key).trim().charAt(0).toUpperCase()||"A";return c.jsx("span",{className:"bg-muted text-muted-foreground flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-md text-sm font-semibold","aria-hidden":!0,children:t!==void 0?c.jsx("img",{src:t,alt:"",className:"size-full object-contain"}):n})},mb=()=>{const{messages:e}=mt(),{navigate:t,route:n}=of(),[r,o]=f.useState([]),[s,i]=f.useState("loading"),[a,l]=f.useState(null),[u,d]=f.useState(null),[p,A]=f.useState(!1),[m,h]=f.useState(null),[g,x]=f.useState(null),[b,v]=f.useState(null),[y,C]=f.useState({}),[I,w]=f.useState({}),E=f.useCallback(async()=>{i(O=>O==="ready"?"stale":"loading");const R=await Gp();R.status===200?(o(R.data),C({}),i("ready"),await Promise.all(R.data.filter(O=>O.hasIcon===!0).map(async O=>{const _=await Yp(O.key),M=_.data;_.status===200&&"dataUrl"in M&&M.dataUrl!==void 0&&w(H=>({...H,[O.key]:M.dataUrl}))}))):i("stale")},[]);f.useEffect(()=>{n==="applications"&&E()},[n,E]),f.useEffect(()=>{const R=()=>{E()};return window.addEventListener("create-opentray:apps-changed",R),()=>window.removeEventListener("create-opentray:apps-changed",R)},[E]);const S=async R=>{if(b===R.key){v(null);return}if(v(R.key),y[R.key]===void 0){const O=await vu(R.key);C(_=>({..._,[R.key]:O.status===200?Ab(O.data):"error"}))}},D=async R=>{const O=await zp(R.key),_=O.data;h(O.status===200&&"ok"in _&&_.ok===!0?_.detail:"message"in _?_.message:e.common.error)},k=R=>{h([R.projectPath!==void 0?R.projectPath:"",R.targetRetained===!0?`${e.applications.uninstallRetained} ${R.payloadPath??""}`:"",R.targetDeleted===!0?`${e.applications.uninstallDeleted} ${R.payloadPath??""}`:"",R.manualPinCleanupHint].filter(Boolean).join(`
|
|
4
|
+
`))},j=async(R,O)=>{const _=await Vp(R.key,{...O,purgeTarget:p});if(_.status===200)k(_.data);else{const M=_.data;if(_.status===409&&M.code==="app_running"&&(M.pids!==void 0||M.pid!==void 0)){const H=M.pids??(M.pid!==void 0?[M.pid]:[]);d({app:R,pids:H});return}h(M.message??e.common.error)}await E()},N=async()=>{const R=a;l(null),R!==null&&await j(R,{stopRunning:!1})},T=async()=>{const R=u;d(null),R!==null&&await j(R.app,{stopRunning:!0})},F=R=>g===null?Promise.resolve({status:400,data:{code:"state_error",message:"no target"}}):Up(g.key,R);return c.jsxs("section",{className:"flex h-full flex-col overflow-hidden","aria-label":e.applications.title,children:[c.jsxs("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[c.jsx("h1",{className:"text-sm font-semibold",children:e.applications.title}),c.jsx(He,{variant:"ghost",size:"icon-sm","aria-label":e.common.refresh,onClick:()=>{E()},children:c.jsx(Xh,{width:16,height:16,"aria-hidden":!0})})]}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[s==="loading"&&c.jsxs("div",{className:"space-y-2","aria-label":e.common.loading,children:[c.jsx(nn,{className:"h-14 w-full"}),c.jsx(nn,{className:"h-14 w-full"}),c.jsx(nn,{className:"h-14 w-full"})]}),s!=="loading"&&r.length===0&&c.jsx("p",{className:"text-muted-foreground text-sm",children:e.applications.emptyHint}),r.length>0&&c.jsx("ul",{className:"space-y-2",children:r.map(R=>{const O=b===R.key,_=y[R.key],M=R.status!=="healthy";return c.jsxs("li",{className:"border-border bg-card text-card-foreground rounded-lg border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(gb,{app:R,dataUrl:I[R.key]}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"truncate text-sm font-medium",children:R.appName??R.key}),M&&c.jsxs(us,{children:[c.jsx(ds,{render:H=>c.jsx(Co,{variant:"destructive",...H,children:Cc(e)[yc[R.status]]})}),c.jsx(fs,{children:R.error?.message??Cc(e)[yc[R.status]]})]}),R.isLink&&c.jsx(Co,{variant:"outline",children:e.applications.linked})]}),c.jsx("div",{className:"tech-ltr text-muted-foreground truncate text-xs",children:R.appId??R.key})]}),c.jsxs(He,{variant:"ghost",size:"sm","aria-expanded":O,onClick:()=>{S(R)},children:[O?c.jsx(Yi,{width:14,height:14,"aria-hidden":!0}):c.jsx(Pn,{width:14,height:14,"aria-hidden":!0}),e.applications.details]}),c.jsxs(He,{variant:"outline",size:"sm",onClick:()=>{window.location.hash=`#/add?edit=${encodeURIComponent(R.key)}`},children:[c.jsx(Su,{width:14,height:14,"aria-hidden":!0}),e.applications.edit]}),c.jsxs(He,{variant:"outline",size:"sm",onClick:()=>{D(R)},children:[c.jsx(Eu,{width:14,height:14,"aria-hidden":!0}),e.applications.open]}),c.jsxs(He,{variant:"outline",size:"sm",onClick:()=>x(R),children:[c.jsx(nA,{width:14,height:14,"aria-hidden":!0}),e.applications.share]}),c.jsxs(He,{variant:"destructive",size:"sm",onClick:()=>l(R),children:[c.jsx(lA,{width:14,height:14,"aria-hidden":!0}),e.applications.uninstall]})]}),O&&c.jsxs("div",{className:"border-border mt-2 space-y-1 rounded-md border bg-muted/40 p-3",children:[_===void 0&&c.jsx("p",{className:"text-muted-foreground text-xs",children:e.common.loading}),_==="error"&&c.jsx("p",{className:"text-destructive text-xs",role:"alert",children:e.common.error}),_!==void 0&&_!=="error"&&c.jsxs(c.Fragment,{children:[c.jsx(fn,{label:e.applications.source,value:R.source==="wizard"?e.applications.sourceWizard:e.applications.sourceRegistered}),c.jsx(fn,{label:e.applications.detailsCommand,value:_.command}),c.jsx(fn,{label:e.applications.detailsCwd,value:_.cwd}),c.jsx(fn,{label:e.applications.detailsEnv,value:_.envKeys.length>0?_.envKeys.join(", "):"—"}),c.jsx(fn,{label:e.applications.detailsPm,value:_.packageManager}),c.jsx(fn,{label:e.applications.detailsWindow,value:_.window}),c.jsx(fn,{label:e.applications.detailsDevMode,value:_.developerMode?"ON":"OFF"}),c.jsx(fn,{label:e.applications.detailsProjectDir,value:R.projectDir??R.payloadPath??R.registrationDir})]})]})]},R.key)})}),s==="stale"&&c.jsx("p",{className:"text-warning mt-3 text-xs",role:"status",children:e.common.error}),m!==null&&c.jsx("p",{className:"text-muted-foreground bg-muted mt-3 whitespace-pre-line rounded-md p-3 text-xs",role:"status",children:m})]}),c.jsx(pc,{open:a!==null,onOpenChange:R=>{R||l(null)},children:c.jsxs(hc,{children:[c.jsxs(Ac,{children:[c.jsx(mc,{children:e.applications.uninstallTitle}),c.jsxs(xc,{children:[a?.source==="wizard"?e.applications.uninstallWizardDescription:e.applications.uninstallDescription,c.jsx("span",{className:"tech-ltr mt-2 block truncate",children:a?.appId??a?.key}),a?.projectDir!==void 0&&c.jsx("span",{className:"tech-ltr mt-1 block truncate",children:a.projectDir})]})]}),a?.isLink===!0&&c.jsxs("label",{className:"flex items-start gap-2 text-xs",children:[c.jsx(Ci,{checked:p,onCheckedChange:R=>A(R===!0)}),c.jsxs("span",{children:[e.applications.uninstallPurge,c.jsx("span",{className:"text-muted-foreground block",children:e.applications.uninstallPurgeHint})]})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:e.applications.uninstallPinHint}),c.jsxs(gc,{children:[c.jsx(vc,{children:e.common.cancel}),c.jsx(bc,{onClick:()=>{N()},children:e.applications.uninstall})]})]})}),c.jsx(pc,{open:u!==null,onOpenChange:R=>{R||d(null)},children:c.jsxs(hc,{children:[c.jsxs(Ac,{children:[c.jsx(mc,{children:e.applications.stopRunningTitle}),c.jsxs(xc,{children:[e.applications.stopRunningDescription,c.jsxs("span",{className:"tech-ltr mt-2 block",children:[e.applications.stopRunningPids,": ",u?.pids.join(", ")]}),c.jsx("span",{className:"tech-ltr mt-1 block truncate",children:u?.app.appId??u?.app.key})]})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:e.applications.uninstallPinHint}),c.jsxs(gc,{children:[c.jsx(vc,{children:e.common.cancel}),c.jsx(bc,{onClick:()=>{T()},children:e.applications.stopRunningConfirm})]})]})}),c.jsx(xf,{open:g!==null,subtitle:g?.appId??g?.key??"",hasEnv:g?.hasEnv===!0,runner:F,onClose:()=>x(null)})]})},Ya=f.createContext({indent:20,currentItem:void 0,tree:void 0,toggleIconType:"plus-minus"});function bf(){return f.useContext(Ya)}function xb({indent:e=20,tree:t,className:n,toggleIconType:r="chevron",...o}){const s=t&&typeof t.getContainerProps=="function"?t.getContainerProps():{},i={...o,...s},{style:a,...l}=i,u={...a,"--tree-indent":`${e}px`};return c.jsx(Ya.Provider,{value:{indent:e,tree:t,toggleIconType:r},children:c.jsx("div",{"data-slot":"tree",style:u,className:ge("flex flex-col",n),...l})})}function bb({item:e,className:t,render:n,children:r,...o}){const s=bf(),{indent:i}=s,a=typeof e.getProps=="function"?e.getProps():{},l={...o,children:r,...a},{style:u,...d}=l,A={"data-slot":"tree-item",style:{...u,"--tree-padding":`${e.getItemMeta().level*i}px`},className:ge("z-10 ps-(--tree-padding) outline-hidden select-none not-last:pb-0.5 focus:z-20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),"data-focus":typeof e.isFocused=="function"?e.isFocused()||!1:void 0,"data-folder":typeof e.isFolder=="function"?e.isFolder()||!1:void 0,"data-selected":typeof e.isSelected=="function"?e.isSelected()||!1:void 0,"data-drag-target":typeof e.isDragTarget=="function"?e.isDragTarget()||!1:void 0,"data-search-match":typeof e.isMatchingSearch=="function"?e.isMatchingSearch()||!1:void 0,"aria-expanded":e.isExpanded()};return c.jsx(Ya.Provider,{value:{...s,currentItem:e},children:ku({defaultTagName:"button",render:n,props:Nt(A,d)})})}function vb({item:e,children:t,className:n,...r}){const{currentItem:o,toggleIconType:s}=bf(),i=e||o;return i?c.jsxs("span",{"data-slot":"tree-item-label",className:ge("in-focus-visible:ring-ring/50 bg-background hover:bg-accent in-data-[selected=true]:bg-accent in-data-[selected=true]:text-accent-foreground in-data-[drag-target=true]:bg-accent flex items-center gap-1 transition-colors not-in-data-[folder=true]:ps-7 in-focus-visible:ring-[3px] in-data-[search-match=true]:bg-blue-50! [&_svg]:pointer-events-none [&_svg]:shrink-0","rounded-md","py-1.5","px-2","text-sm",n),...r,children:[i.isFolder()&&(s==="plus-minus"?i.isExpanded()?c.jsx(Wh,{"aria-hidden":!0,className:"text-muted-foreground size-3.5",stroke:"currentColor",strokeWidth:"1"}):c.jsx(Ru,{"aria-hidden":!0,className:"text-muted-foreground size-3.5",stroke:"currentColor",strokeWidth:"1"}):c.jsx(Pn,{"aria-hidden":!0,className:"text-muted-foreground size-4 in-aria-[expanded=false]:-rotate-90"})),t||(typeof i.getItemName=="function"?i.getItemName():null)]}):(console.warn("TreeItemLabel: No item provided via props or context"),null)}const Ic={};function yb(e){let t=Ic[e];if(t)return t;t=Ic[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function nr(e,t){typeof t!="string"&&(t=nr.defaultChars);const n=yb(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let s=0,i=r.length;s<i;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){o+=n[a];continue}if((a&224)===192&&s+3<i){const l=parseInt(r.slice(s+4,s+6),16);if((l&192)===128){const u=a<<6&1984|l&63;u<128?o+="��":o+=String.fromCharCode(u),s+=3;continue}}if((a&240)===224&&s+6<i){const l=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16);if((l&192)===128&&(u&192)===128){const d=a<<12&61440|l<<6&4032|u&63;d<2048||d>=55296&&d<=57343?o+="���":o+=String.fromCharCode(d),s+=6;continue}}if((a&248)===240&&s+9<i){const l=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16),d=parseInt(r.slice(s+10,s+12),16);if((l&192)===128&&(u&192)===128&&(d&192)===128){let p=a<<18&1835008|l<<12&258048|u<<6&4032|d&63;p<65536||p>1114111?o+="����":(p-=65536,o+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),s+=9;continue}}o+="�"}return o})}nr.defaultChars=";/?:@&=+$,#";nr.componentChars="";const wc={};function Cb(e){let t=wc[e];if(t)return t;t=wc[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Vr(e,t,n){typeof t!="string"&&(n=t,t=Vr.defaultChars),typeof n>"u"&&(n=!0);const r=Cb(t);let o="";for(let s=0,i=e.length;s<i;s++){const a=e.charCodeAt(s);if(n&&a===37&&s+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(s+1,s+3))){o+=e.slice(s,s+3),s+=2;continue}if(a<128){o+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<i){const l=e.charCodeAt(s+1);if(l>=56320&&l<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}Vr.defaultChars=";/?:@&=+$,-_.!~*'()#";Vr.componentChars="-_.!~*'()";function Ii(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Po(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Ib=/^([a-z0-9.+-]+:)/i,wb=/:[0-9]*$/,kb=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Eb=["<",">",'"',"`"," ","\r",`
|
|
5
|
+
`," "],Sb=["{","}","|","\\","^","`"].concat(Eb),Rb=["'"].concat(Sb),kc=["%","/","?",";","#"].concat(Rb),Ec=["/","?","#"],Db=255,Sc=/^[+a-z0-9A-Z_-]{0,63}$/,Fb=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Rc={javascript:!0,"javascript:":!0},Dc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function wi(e,t){if(e&&e instanceof Po)return e;const n=new Po;return n.parse(e,t),n}Po.prototype.parse=function(e,t){let n,r,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=kb.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let i=Ib.exec(s);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,s=s.substr(i.length)),(t||i||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(i&&Rc[i])&&(s=s.substr(2),this.slashes=!0)),!Rc[i]&&(o||i&&!Dc[i])){let u=-1;for(let h=0;h<Ec.length;h++)r=s.indexOf(Ec[h]),r!==-1&&(u===-1||r<u)&&(u=r);let d,p;u===-1?p=s.lastIndexOf("@"):p=s.lastIndexOf("@",u),p!==-1&&(d=s.slice(0,p),s=s.slice(p+1),this.auth=d),u=-1;for(let h=0;h<kc.length;h++)r=s.indexOf(kc[h]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=s.length),s[u-1]===":"&&u--;const A=s.slice(0,u);s=s.slice(u),this.parseHost(A),this.hostname=this.hostname||"";const m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m){const h=this.hostname.split(/\./);for(let g=0,x=h.length;g<x;g++){const b=h[g];if(b&&!b.match(Sc)){let v="";for(let y=0,C=b.length;y<C;y++)b.charCodeAt(y)>127?v+="x":v+=b[y];if(!v.match(Sc)){const y=h.slice(0,g),C=h.slice(g+1),I=b.match(Fb);I&&(y.push(I[1]),C.unshift(I[2])),C.length&&(s=C.join(".")+s),this.hostname=y.join(".");break}}}}this.hostname.length>Db&&(this.hostname=""),m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return l!==-1&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),Dc[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Po.prototype.parseHost=function(e){let t=wb.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Bb=Object.freeze(Object.defineProperty({__proto__:null,decode:nr,encode:Vr,format:Ii,parse:wi},Symbol.toStringTag,{value:"Module"})),vf=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,yf=/[\0-\x1F\x7F-\x9F]/,jb=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,za=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,Cf=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,If=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Mb=Object.freeze(Object.defineProperty({__proto__:null,Any:vf,Cc:yf,Cf:jb,P:za,S:Cf,Z:If},Symbol.toStringTag,{value:"Module"})),Nb=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Tb(e){return e>=55296&&e<=57343||e>1114111?65533:Nb.get(e)??e}function Pb(e){const t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let o=0,s=0;o<n;o+=2){const i=t.charCodeAt(o),a=t.charCodeAt(o+1);r[s++]=i|a<<8}return r}const _b=Pb("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCA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5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var vt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(vt||(vt={}));var tt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(tt||(tt={}));const Fc=32;function ki(e){return e>=tt.ZERO&&e<=tt.NINE}function Ob(e){return e>=tt.UPPER_A&&e<=tt.UPPER_F||e>=tt.LOWER_A&&e<=tt.LOWER_F}function Hb(e){return e>=tt.UPPER_A&&e<=tt.UPPER_Z||e>=tt.LOWER_A&&e<=tt.LOWER_Z||ki(e)}function Kb(e){return e===tt.EQUALS||Hb(e)}var pt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(pt||(pt={}));var gn;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(gn||(gn={}));class Wb{decodeTree;emitCodePoint;errors;constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r}state=pt.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=gn.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=pt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,n){switch(this.state){case pt.EntityStart:return t.charCodeAt(n)===tt.NUM?(this.state=pt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=pt.NamedEntity,this.stateNamedEntity(t,n));case pt.NumericStart:return this.stateNumericStart(t,n);case pt.NumericDecimal:return this.stateNumericDecimal(t,n);case pt.NumericHex:return this.stateNumericHex(t,n);case pt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Fc)===tt.LOWER_X?(this.state=pt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=pt.NumericDecimal,this.stateNumericDecimal(t,n))}stateNumericHex(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(ki(r)||Ob(r)){const o=r<=tt.NINE?r-tt.ZERO:(r|Fc)-tt.LOWER_A+10;this.result=this.result*16+o,this.consumed++,n++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(ki(r))this.result=this.result*10+(r-tt.ZERO),this.consumed++,n++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(t,n){if(this.consumed<=n)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===tt.SEMI)this.consumed+=1;else if(this.decodeMode===gn.Strict)return 0;return this.emitCodePoint(Tb(this.result),this.consumed),this.errors&&(t!==tt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&vt.VALUE_LENGTH)>>14;for(;n<t.length;){if(s===0&&(o&vt.FLAG13)!==0){const a=(o&vt.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const l=o&vt.JUMP_TABLE;if(t.charCodeAt(n)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(n>=t.length)return-1;const l=this.runConsumed-1,u=r[this.treeIndex+1+(l>>1)],d=l%2===0?u&255:u>>8&255;if(t.charCodeAt(n)!==d)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),o=r[this.treeIndex],s=(o&vt.VALUE_LENGTH)>>14}if(n>=t.length)break;const i=t.charCodeAt(n);if(i===tt.SEMI&&s!==0&&(o&vt.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=Qb(r,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===gn.Attribute&&(s===0||Kb(i))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&vt.VALUE_LENGTH)>>14,s!==0){if(i===tt.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==gn.Strict&&(o&vt.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:t,decodeTree:n}=this,r=(n[t]&vt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~(vt.VALUE_LENGTH|vt.FLAG13):o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){switch(this.state){case pt.NamedEntity:return this.result!==0&&(this.decodeMode!==gn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case pt.NumericDecimal:return this.emitNumericEntity(0,2);case pt.NumericHex:return this.emitNumericEntity(0,3);case pt.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case pt.EntityStart:return 0}}}function Lb(e){let t="";const n=new Wb(e,r=>t+=String.fromCodePoint(r));return function(o,s){let i=0,a=0;for(;(a=o.indexOf("&",a))>=0;){t+=o.slice(i,a),n.startEntity(s);const u=n.write(o,a+1);if(u<0){i=a+n.end();break}i=a+u,a=u===0?i+1:i}const l=t+o.slice(i);return t="",l}}function Qb(e,t,n,r){const o=(t&vt.BRANCH_LENGTH)>>7,s=t&vt.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:e[n+u]-1}const i=o+1>>1;let a=0,l=o-1;for(;a<=l;){const u=a+l>>>1,d=u>>1,A=e[n+d]>>(u&1)*8&255;if(A<r)a=u+1;else if(A>r)l=u-1;else return e[n+i+u]}return-1}const Gb=Lb(_b);function wf(e){return Gb(e,gn.Strict)}var Yb=class{src_Any=vf.source;src_Cc=yf.source;src_Z=If.source;src_P=za.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const r=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${r}|${o}).)`;let i=`${r}${s}{0,1000}${o}`;for(let a=2;a<=n;a++)i=`${r}(?:${s}|${i}){0,1000}${o}`;return i}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},Ws={validate:(e,t,n)=>{const r=n.re.get_http_validator();r.lastIndex=t;const o=r.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},zb={"http:":Ws,"https:":Ws,"ftp:":Ws,"//":{validate:function(e,t,n){const r=n.re.get_relative_proto_validator();r.lastIndex=t;const o=r.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const r=n.re.get_mailto_validator();r.lastIndex=t;const o=r.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},Ub="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Vb="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function Zb(){const e=Vb.split("|");return Ub.split("|").forEach(t=>{const n=t.indexOf(":"),r=t.slice(0,n);for(const o of t.slice(n+1))e.push(r+o)}),e}var Jb={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Zb(),urlAuth:!1,maxLength:1e4},Bc=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,r){const o=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=o,this.text=o,this.url=o}},$b=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...Jb,...n},this.__schemas__={...zb},this.re=t||new Yb,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(r,o)=>o.normalize(r),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const r=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(r.lastIndex=0;(t=r.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let r,o,s,i,a,l,u=!1,d=!1,p=!1,A=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const m=Math.max(A-1,0);if(o&&s&&!p&&(!a||a.index<A))for(o.lastIndex<m&&(o.lastIndex=m);;){const v=o.exec(e);if(!v){p=!0,a=void 0;break}const y=s.exec(e.slice(Math.max(0,v.index-65),v.index));if(y){if(a={schema:"mailto:",index:v.index-y[1].length,lastIndex:v.index+v[0].length},a.index>=A)break;o.lastIndex<m&&(o.lastIndex=m)}}if(r&&!d&&(!i||i.index<A))for(r.lastIndex<m&&(r.lastIndex=m);;){const v=r.exec(e);if(!v){d=!0,i=void 0;break}if(i={schema:"",index:v.index+v[1].length,lastIndex:v.index+v[0].length},i.index>=A)break;r.lastIndex<m&&(r.lastIndex=m)}let h=a;(!h||i&&(i.index<h.index||i.index===h.index&&i.lastIndex>h.lastIndex))&&(h=i);let g;if(!u)for(;;){if(!l){n.lastIndex<m&&(n.lastIndex=m);const C=n.exec(e);if(!C){u=!0;break}l={schema:C[2],index:C.index+C[1].length,lastIndex:C.index+C[0].length}}if(l.index<A){l=void 0;continue}if(h&&l.index>h.index)break;const v=l;l=void 0;const y=this.testSchemaAt(e,v.schema,v.lastIndex);if(y){g={schema:v.schema,index:v.index,lastIndex:v.lastIndex+y};break}}let x=g;if((!x||a&&(a.index<x.index||a.index===x.index&&a.lastIndex>x.lastIndex))&&(x=a),(!x||i&&(i.index<x.index||i.index===x.index&&i.lastIndex>x.lastIndex))&&(x=i),!x)break;x===a?a=void 0:x===i&&(i=void 0);const b=new Bc(e,x.schema,x.index,x.lastIndex);b.schema?this.__schemas__[b.schema].normalize(b,this):this.normalize(b),t.push(b),A=x.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const r=new Bc(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};const Vn=2147483647,Gt=36,Ua=1,jr=26,Xb=38,qb=700,kf=72,Ef=128,Sf="-",ev=/^xn--/,tv=/[^\0-\x7F]/,nv=/[\x2E\u3002\uFF0E\uFF61]/g,rv={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ls=Gt-Ua,Yt=Math.floor,Qs=String.fromCharCode;function pn(e){throw new RangeError(rv[e])}function ov(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Rf(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(nv,".");const o=e.split("."),s=ov(o,t).join(".");return r+s}function Df(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const s=e.charCodeAt(n++);(s&64512)==56320?t.push(((o&1023)<<10)+(s&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const sv=e=>String.fromCodePoint(...e),iv=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Gt},jc=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Ff=function(e,t,n){let r=0;for(e=n?Yt(e/qb):e>>1,e+=Yt(e/t);e>Ls*jr>>1;r+=Gt)e=Yt(e/Ls);return Yt(r+(Ls+1)*e/(e+Xb))},Bf=function(e){const t=[],n=e.length;let r=0,o=Ef,s=kf,i=e.lastIndexOf(Sf);i<0&&(i=0);for(let a=0;a<i;++a)e.charCodeAt(a)>=128&&pn("not-basic"),t.push(e.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){const l=r;for(let d=1,p=Gt;;p+=Gt){a>=n&&pn("invalid-input");const A=iv(e.charCodeAt(a++));A>=Gt&&pn("invalid-input"),A>Yt((Vn-r)/d)&&pn("overflow"),r+=A*d;const m=p<=s?Ua:p>=s+jr?jr:p-s;if(A<m)break;const h=Gt-m;d>Yt(Vn/h)&&pn("overflow"),d*=h}const u=t.length+1;s=Ff(r-l,u,l==0),Yt(r/u)>Vn-o&&pn("overflow"),o+=Yt(r/u),r%=u,t.splice(r++,0,o)}return String.fromCodePoint(...t)},jf=function(e){const t=[];e=Df(e);const n=e.length;let r=Ef,o=0,s=kf;for(const l of e)l<128&&t.push(Qs(l));const i=t.length;let a=i;for(i&&t.push(Sf);a<n;){let l=Vn;for(const d of e)d>=r&&d<l&&(l=d);const u=a+1;l-r>Yt((Vn-o)/u)&&pn("overflow"),o+=(l-r)*u,r=l;for(const d of e)if(d<r&&++o>Vn&&pn("overflow"),d===r){let p=o;for(let A=Gt;;A+=Gt){const m=A<=s?Ua:A>=s+jr?jr:A-s;if(p<m)break;const h=p-m,g=Gt-m;t.push(Qs(jc(m+h%g,0))),p=Yt(h/g)}t.push(Qs(jc(p,0))),s=Ff(o,u,a===i),o=0,++a}++o,++r}return t.join("")},av=function(e){return Rf(e,function(t){return ev.test(t)?Bf(t.slice(4).toLowerCase()):t})},lv=function(e){return Rf(e,function(t){return tv.test(t)?"xn--"+jf(t):t})},Mc={version:"2.3.1",ucs2:{decode:Df,encode:sv},decode:Bf,encode:jf,toASCII:lv,toUnicode:av};var Nc=Object.defineProperty,Mf=(e,t)=>{let n={};for(var r in e)Nc(n,r,{get:e[r],enumerable:!0});return Nc(n,Symbol.toStringTag,{value:"Module"}),n},cv=Mf({arrayReplaceAt:()=>Tf,asciiTrim:()=>gs,callable:()=>Nf,escapeHtml:()=>yn,escapeRE:()=>bv,fromCodePoint:()=>Mr,isMdAsciiPunct:()=>Pr,isPunctChar:()=>_f,isPunctCharCode:()=>Tr,isSpace:()=>Ve,isValidEntityCode:()=>Va,isWhiteSpace:()=>Nr,lib:()=>vv,normalizeReference:()=>As,unescapeAll:()=>rr,unescapeMd:()=>pv});function Nf(e){const t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function Tf(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Va(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Mr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Pf=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,uv=new RegExp(`${Pf.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),dv=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function fv(e,t){if(t.charCodeAt(0)===35&&dv.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Va(r)?Mr(r):e}const n=wf(e);return n!==e?n:e}function pv(e){return e.indexOf("\\")<0?e:e.replace(Pf,"$1")}function rr(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(uv,function(t,n,r){return n||fv(t,r)})}var hv=/[&<>"]/,Av=/[&<>"]/g,gv={"&":"&","<":"<",">":">",'"':"""};function mv(e){return gv[e]}function yn(e){return hv.test(e)?e.replace(Av,mv):e}var xv=/[.?*+^$[\]\\(){}|-]/g;function bv(e){return e.replace(xv,"\\$&")}function Ve(e){switch(e){case 9:case 32:return!0}return!1}function Nr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function _f(e){return za.test(e)||Cf.test(e)}function Tr(e){return _f(Mr(e))}function Pr(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function As(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function Tc(e){return e===32||e===9||e===10||e===13}function gs(e){let t=0;for(;t<e.length&&Tc(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Tc(e.charCodeAt(n));n--);return e.slice(t,n+1)}var vv={mdurl:Bb,ucmicro:Mb};function yv(e,t,n){let r,o,s,i;const a=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(s=e.src.charCodeAt(e.pos),s===93&&(r--,r===0)){o=!0;break}if(i=e.pos,e.md.inline.skipToken(e),s===91){if(i===e.pos-1)r++;else if(n)return e.pos=l,-1}}let u=-1;return o&&(u=e.pos),e.pos=l,u}function Cv(e,t,n){let r,o=t;const s={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(r=e.charCodeAt(o),r===10||r===60)return s;if(r===62)return s.pos=o+1,s.str=rr(e.slice(t+1,o)),s.ok=!0,s;if(r===92&&o+1<n){o+=2;continue}o++}return s}let i=0;for(;o<n&&(r=e.charCodeAt(o),!(r===32||r<32||r===127));){if(r===92&&o+1<n){if(e.charCodeAt(o+1)===32){o++;continue}o+=2;continue}if(r===40&&(i++,i>32))return s;if(r===41){if(i===0)break;i--}o++}return t===o||i!==0||(s.str=rr(e.slice(t,o)),s.pos=o,s.ok=!0),s}function Iv(e,t,n,r){let o,s=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(s>=n)return i;let a=e.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return i;t++,s++,a===40&&(a=41),i.marker=a}for(;s<n;){if(o=e.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=rr(e.slice(t,s)),i.ok=!0,i;if(o===40&&i.marker===41)return i;o===92&&s+1<n&&s++,s++}return i.can_continue=!0,i.str+=rr(e.slice(t,s)),i}var wv=Mf({parseLinkDestination:()=>Cv,parseLinkLabel:()=>yv,parseLinkTitle:()=>Iv});function _r(e){"@babel/helpers - typeof";return _r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(e)}function kv(e,t){if(_r(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_r(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ev(e){var t=kv(e,"string");return _r(t)=="symbol"?t:t+""}function be(e,t,n){return(t=Ev(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bn=class{constructor(e,t,n){be(this,"map",null),be(this,"level",0),be(this,"children",null),be(this,"content",""),be(this,"markup",""),be(this,"info",""),be(this,"block",!1),be(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Or=class{constructor(){be(this,"__rules__",[]),be(this,"__cache__",null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){const e=new Set;this.__rules__.forEach(t=>{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){const r=this.__find__(e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=n.alt||[],this.__cache__=null}before(e,t,n,r={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}after(e,t,n,r={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const o=this.__find__(r);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[o].enabled=!0,n.push(r)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const o=this.__find__(r);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[o].enabled=!1,n.push(r)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},Jt={};Jt.code_inline=function(e,t,n,r,o){const s=e[t];return`<code${o.renderAttrs(s)}>${yn(s.content)}</code>`};Jt.code_block=function(e,t,n,r,o){const s=e[t];return`<pre${o.renderAttrs(s)}><code>${yn(e[t].content)}</code></pre>
|
|
6
|
+
`};Jt.fence=function(e,t,n,r,o){const s=e[t],i=s.info?rr(s.info).trim():"";let a="",l="";if(i){const d=i.split(/(\s+)/g);a=d[0],l=d.slice(2).join("")}let u;if(n.highlight?u=n.highlight(s.content,a,l)||yn(s.content):u=yn(s.content),u.indexOf("<pre")===0)return u+`
|
|
7
|
+
`;if(i){const d=s.attrIndex("class"),p=s.attrs?s.attrs.slice():[];d<0?p.push(["class",`${n.langPrefix}${a}`]):(p[d]=[p[d][0],p[d][1]],p[d][1]+=` ${n.langPrefix}${a}`);const A={attrs:p};return`<pre><code${o.renderAttrs(A)}>${u}</code></pre>
|
|
8
8
|
`}return`<pre><code${o.renderAttrs(s)}>${u}</code></pre>
|
|
9
|
-
`};
|
|
9
|
+
`};Jt.image=function(e,t,n,r,o){const s=e[t];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,n,r),o.renderToken(e,t,n)};Jt.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
10
10
|
`:`<br>
|
|
11
|
-
`};
|
|
11
|
+
`};Jt.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
12
12
|
`:`<br>
|
|
13
13
|
`:`
|
|
14
|
-
`};
|
|
15
|
-
`),o+=(r.nesting===-1?"</":"<")+r.tag,o+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(o+=" /");let i=!1;if(r.block&&(i=!0,r.nesting===1)){let a=t+1;for(;a<e.length&&e[a].hidden&&e[a].nesting===0;)a++;if(a<e.length){const
|
|
14
|
+
`};Jt.text=function(e,t){return yn(e[t].content)};Jt.html_block=function(e,t){return e[t].content};Jt.html_inline=function(e,t){return e[t].content};var Of=class{constructor(){be(this,"rules",Object.assign({},Jt))}renderAttrs(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=` ${yn(e.attrs[t][0])}="${yn(String(e.attrs[t][1]))}"`;return r}renderToken(e,t,n){const r=e[t];let o="";if(r.hidden)return"";let s=t-1;for(;s>=0&&e[s].hidden&&e[s].nesting===0;)s--;r.block&&r.nesting!==-1&&s>=0&&e[s].hidden&&e[s].nesting===-1&&(o+=`
|
|
15
|
+
`),o+=(r.nesting===-1?"</":"<")+r.tag,o+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(o+=" /");let i=!1;if(r.block&&(i=!0,r.nesting===1)){let a=t+1;for(;a<e.length&&e[a].hidden&&e[a].nesting===0;)a++;if(a<e.length){const l=e[a];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===r.tag)&&(i=!1)}}return o+=i?`>
|
|
16
16
|
`:">",o}renderInline(e,t,n){let r="";const o=this.rules;for(let s=0,i=e.length;s<i;s++){const a=e[s].type;typeof o[a]<"u"?r+=o[a](e,s,t,n,this):r+=this.renderToken(e,s,t)}return r}renderInlineAsText(e,t,n){let r="";for(let o=0,s=e.length;o<s;o++)switch(e[o].type){case"text":case"code_inline":r+=e[o].content;break;case"image":r+=this.renderInlineAsText(e[o].children,t,n);break;case"html_inline":case"html_block":r+=e[o].content;break;case"softbreak":case"hardbreak":r+=`
|
|
17
|
-
`}return r}render(e,t,n){let r="";const o=this.rules;for(let s=0,i=e.length;s<i;s++){const a=e[s].type;a==="inline"?r+=this.renderInline(e[s].children,t,n):typeof o[a]<"u"?r+=o[a](e,s,t,n,this):r+=this.renderToken(e,s,t)}return r}},
|
|
18
|
-
`),t=t.replace(Xv,"�"),e.src=t}function ey(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function ty(e){const t=e.tokens;let n=0;for(let r=0;r<t.length;r++)t[r].type!=="reference_definition"&&(r!==n&&(t[n]=t[r]),n++);t.length!==n&&(t.length=n)}function ny(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const o=t[n];o.type==="inline"&&e.md.inline.parse(o.content,e.md,e.env,o.children)}}function ry(e){return/^<a[>\s]/i.test(e)}function oy(e){return/^<\/a\s*>/i.test(e)}function sy(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.test(t[n].content))continue;let o=t[n].children,s=0;for(let i=o.length-1;i>=0;i--){const a=o[i];if(a.type==="link_close"){for(i--;o[i].level!==a.level&&o[i].type!=="link_open";)i--;continue}if(a.type==="html_inline"&&(ry(a.content)&&s>0&&s--,oy(a.content)&&s++),!(s>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const c=a.content;let u=e.md.linkify.match(c);const f=[];let h=a.level,A=0;u.length>0&&u[0].index===0&&i>0&&o[i-1].type==="text_special"&&(u=u.slice(1));for(let g=0;g<u.length;g++){const p=u[g].url,x=e.md.normalizeLink(p);if(!e.md.validateLink(x))continue;let m=u[g].text;u[g].schema?u[g].schema==="mailto:"&&!/^mailto:/i.test(m)?m=e.md.normalizeLinkText(`mailto:${m}`).replace(/^mailto:/,""):m=e.md.normalizeLinkText(m):m=e.md.normalizeLinkText(`http://${m}`).replace(/^http:\/\//,"");const v=u[g].index;if(v>A){const I=new e.Token("text","",0);I.content=c.slice(A,v),I.level=h,f.push(I)}const b=new e.Token("link_open","a",1);b.attrs=[["href",x]],b.level=h++,b.markup="linkify",b.info="auto",f.push(b);const y=new e.Token("text","",0);y.content=m,y.level=h,f.push(y);const C=new e.Token("link_close","a",-1);C.level=--h,C.markup="linkify",C.info="auto",f.push(C),A=u[g].lastIndex}if(A<c.length){const g=new e.Token("text","",0);g.content=c.slice(A),g.level=h,f.push(g)}t[n].children=o=zf(o,i,f)}}}}var Jf=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,iy=/\((c|tm|r)\)/i,ay=/\((c|tm|r)\)/gi,ly={c:"©",r:"®",tm:"™"};function cy(e,t){return ly[t.toLowerCase()]}function uy(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(ay,cy)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function dy(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&Jf.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function fy(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(iy.test(e.tokens[t].content)&&uy(e.tokens[t].children),Jf.test(e.tokens[t].content)&&dy(e.tokens[t].children))}var py=/['"]/,Lc=/['"]/g,Kc="’";function uo(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function hy(e,t){let n="",r=0;t.sort((o,s)=>o.pos-s.pos);for(let o=0;o<t.length;o++){const s=t[o];n+=e.slice(r,s.pos)+s.ch,r=s.pos+1}return n+e.slice(r)}function gy(e,t){let n;const r=[],o={};for(let s=0;s<e.length;s++){const i=e[s],a=e[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,i.type!=="text")continue;const c=i.content;let u=0;const f=c.length;e:for(;u<f;){Lc.lastIndex=u;const h=Lc.exec(c);if(!h)break;let A=!0,g=!0;u=h.index+1;const p=h[0]==="'";let x=32;if(h.index-1>=0)x=c.charCodeAt(h.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){x=e[n].content.charCodeAt(e[n].content.length-1);break}let m=32;if(u<f)m=c.charCodeAt(u);else for(n=s+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){m=e[n].content.charCodeAt(0);break}const v=_r(x)||Nr(x),b=_r(m)||Nr(m),y=Tr(x),C=Tr(m);if(C?A=!1:b&&(y||v||(A=!1)),y?g=!1:v&&(C||b||(g=!1)),m===34&&h[0]==='"'&&x>=48&&x<=57&&(g=A=!1),A&&g&&(A=v,g=b),!A&&!g){p&&uo(o,s,h.index,Kc);continue}if(g)for(n=r.length-1;n>=0;n--){let I=r[n];if(r[n].level<a)break;if(I.single===p&&r[n].level===a){I=r[n];let w,S;p?(w=t.md.options.quotes[2],S=t.md.options.quotes[3]):(w=t.md.options.quotes[0],S=t.md.options.quotes[1]),uo(o,s,h.index,S),uo(o,I.token,I.pos,w),r.length=n;continue e}}A?r.push({token:s,pos:h.index,single:p,level:a}):g&&p&&uo(o,s,h.index,Kc)}}Object.keys(o).forEach(function(s){const i=Number(s);e[i].content=hy(e[i].content,o[s])})}function Ay(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!py.test(e.tokens[t].content)||gy(e.tokens[t].children,e)}function my(e){let t,n;const r=e.length;for(t=0;t<r;t++)e[t].type==="text_special"&&(e[t].type="text");for(t=n=0;t<r;t++)e[t].type==="text"&&t+1<r&&e[t+1].type==="text"?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}function xy(e){let t,n;const r=e.tokens,o=r.length;for(let s=0;s<o;s++){if(r[s].type!=="inline")continue;const i=r[s].children,a=i.length;for(t=0;t<a;t++)i[t].type==="text_special"&&(i[t].type="text"),i[t].children&&my(i[t].children);for(t=n=0;t<a;t++)i[t].type==="text"&&t+1<a&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var Ys=[["normalize",qv],["block",ey],["strip_references",ty],["inline",ny],["linkify",sy],["replacements",fy],["smartquotes",Ay],["text_join",xy]],$f=class{constructor(){xe(this,"ruler",new Hr),xe(this,"State",Zf);for(let e=0;e<Ys.length;e++)this.ruler.push(Ys[e][0],Ys[e][1])}process(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)}},Xf=class{constructor(e,t,n,r){xe(this,"bMarks",[]),xe(this,"eMarks",[]),xe(this,"tShift",[]),xe(this,"sCount",[]),xe(this,"bsCount",[]),xe(this,"blkIndent",0),xe(this,"line",0),xe(this,"lineMax",0),xe(this,"tight",!1),xe(this,"listIndent",-1),xe(this,"parentType","root"),xe(this,"level",0),xe(this,"Token",jn),this.src=e,this.md=t,this.env=n,this.tokens=r;const o=this.src;for(let s=0,i=0,a=0,c=0,u=o.length,f=!1;i<u;i++){const h=o.charCodeAt(i);if(!f)if(Ye(h)){a++,h===9?c+=4-c%4:c++;continue}else f=!0;(h===10||i===u-1)&&(h!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(a),this.sCount.push(c),this.bsCount.push(0),f=!1,a=0,c=0,s=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){const r=new jn(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){for(let t=this.src.length;e<t&&Ye(this.src.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;for(;e>t;)if(!Ye(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";const o=new Array(t-e);for(let s=0,i=e;i<t;i++,s++){let a=0;const c=this.bMarks[i];let u=c,f;for(i+1<t||r?f=this.eMarks[i]+1:f=this.eMarks[i];u<f&&a<n;){const h=this.src.charCodeAt(u);if(Ye(h))h===9?a+=4-(a+this.bsCount[i])%4:a++;else if(u-c<this.tShift[i])a++;else break;u++}a>n?o[s]=new Array(a-n+1).join(" ")+this.src.slice(u,f):o[s]=this.src.slice(u,f)}return o.join("")}},by=65536;function Us(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Wc(e){const t=[],n=e.length;let r=0,o=e.charCodeAt(r),s=!1,i=0,a="";for(;r<n;)o===124&&(s?(a+=e.substring(i,r-1),i=r):(t.push(a+e.substring(i,r)),a="",i=r+1)),s=o===92,r++,o=e.charCodeAt(r);return t.push(a+e.substring(i)),t}function vy(e,t,n,r){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const i=e.src.charCodeAt(s++);if(i!==124&&i!==45&&i!==58||s>=e.eMarks[o])return!1;const a=e.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!Ye(a)||i===45&&Ye(a))return!1;for(;s<e.eMarks[o];){const C=e.src.charCodeAt(s);if(C!==124&&C!==45&&C!==58&&!Ye(C))return!1;s++}let c=Us(e,t+1),u=c.split("|");const f=[];for(let C=0;C<u.length;C++){const I=u[C].trim();if(!I){if(C===0||C===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(I))return!1;I.charCodeAt(I.length-1)===58?f.push(I.charCodeAt(0)===58?"center":"right"):I.charCodeAt(0)===58?f.push("left"):f.push("")}if(c=Us(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=Wc(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const h=u.length;if(h===0||h!==f.length)return!1;if(r)return!0;const A=e.parentType;e.parentType="table";const g=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),x=[t,0];p.map=x;const m=e.push("thead_open","thead",1);m.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let C=0;C<u.length;C++){const I=e.push("th_open","th",1);f[C]&&(I.attrs=[["style",`text-align:${f[C]}`]]);const w=e.push("inline","",0);w.content=u[C].trim(),w.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let b,y=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let C=!1;for(let w=0,S=g.length;w<S;w++)if(g[w](e,o,n,!0)){C=!0;break}if(C||(c=Us(e,o).trim(),!c)||e.sCount[o]-e.blkIndent>=4||(u=Wc(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),y+=h-u.length,y>by))break;if(o===t+2){const w=e.push("tbody_open","tbody",1);w.map=b=[t+2,0]}const I=e.push("tr_open","tr",1);I.map=[o,o+1];for(let w=0;w<h;w++){const S=e.push("td_open","td",1);f[w]&&(S.attrs=[["style",`text-align:${f[w]}`]]);const R=e.push("inline","",0);R.content=u[w]?u[w].trim():"",R.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return b&&(e.push("tbody_close","tbody",-1),b[1]=o),e.push("table_close","table",-1),x[1]=o,e.parentType=A,e.line=o,!0}function yy(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,o=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,o=r;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=e.getLines(t,o,4+e.blkIndent,!1)+`
|
|
19
|
-
`,s.map=[t,e.line],!0}function Cy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const i=e.src.charCodeAt(o);if(i!==126&&i!==96)return!1;let a=o;o=e.skipChars(o,i);let c=o-a;if(c<3)return!1;const u=e.src.slice(a,o),f=e.src.slice(o,s);if(i===96&&f.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let h=t,A=!1;for(;h++,!(h>=n||(o=a=e.bMarks[h]+e.tShift[h],s=e.eMarks[h],o<s&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(o)===i&&!(e.sCount[h]-e.blkIndent>=4)&&(o=e.skipChars(o,i),!(o-a<c)&&(o=e.skipSpaces(o),!(o<s)))){A=!0;break}c=e.sCount[t],e.line=h+(A?1:0);const g=e.push("fence","code",0);return g.info=f,g.content=e.getLines(t+1,h,c,!0),g.markup=u,g.map=[t,e.line],!0}function Iy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==62)return!1;if(r)return!0;const a=[],c=[],u=[],f=[],h=e.md.block.ruler.getRules("blockquote"),A=e.parentType;e.parentType="blockquote";let g=!1,p;for(p=t;p<n;p++){const y=e.sCount[p]<e.blkIndent;if(o=e.bMarks[p]+e.tShift[p],s=e.eMarks[p],o>=s)break;if(e.src.charCodeAt(o++)===62&&!y){let I=e.sCount[p]+1,w,S;e.src.charCodeAt(o)===32?(o++,I++,S=!1,w=!0):e.src.charCodeAt(o)===9?(w=!0,(e.bsCount[p]+I)%4===3?(o++,I++,S=!1):S=!0):w=!1;let R=I;for(a.push(e.bMarks[p]),e.bMarks[p]=o;o<s;){const E=e.src.charCodeAt(o);if(Ye(E))E===9?R+=4-(R+e.bsCount[p]+(S?1:0))%4:R++;else break;o++}g=o>=s,c.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(w?1:0),u.push(e.sCount[p]),e.sCount[p]=R-I,f.push(e.tShift[p]),e.tShift[p]=o-e.bMarks[p];continue}if(g)break;let C=!1;for(let I=0,w=h.length;I<w;I++)if(h[I](e,p,n,!0)){C=!0;break}if(C){e.lineMax=p,e.blkIndent!==0&&(a.push(e.bMarks[p]),c.push(e.bsCount[p]),f.push(e.tShift[p]),u.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}a.push(e.bMarks[p]),c.push(e.bsCount[p]),f.push(e.tShift[p]),u.push(e.sCount[p]),e.sCount[p]=-1}const x=e.blkIndent;e.blkIndent=0;const m=e.push("blockquote_open","blockquote",1);m.markup=">";const v=[t,0];m.map=v,e.md.block.tokenize(e,t,p);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=i,e.parentType=A,v[1]=e.line;for(let y=0;y<f.length;y++)e.bMarks[y+t]=a[y],e.tShift[y+t]=f[y],e.sCount[y+t]=u[y],e.bsCount[y+t]=c[y];return e.blkIndent=x,!0}function wy(e,t,n,r){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(s++);if(i!==42&&i!==45&&i!==95)return!1;let a=1;for(;s<o;){const u=e.src.charCodeAt(s++);if(u!==i&&!Ye(u))return!1;u===i&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(a+1).join(String.fromCharCode(i)),!0}function Qc(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(r++);return o!==42&&o!==45&&o!==43||r<n&&!Ye(e.src.charCodeAt(r))?-1:r}function Gc(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let o=n;if(o+1>=r)return-1;let s=e.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=r)return-1;if(s=e.src.charCodeAt(o++),s>=48&&s<=57){if(o-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return o<r&&(s=e.src.charCodeAt(o),!Ye(s))?-1:o}function ky(e,t){const n=e.level+2;for(let r=t+2,o=e.tokens.length-2;r<o;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Ey(e,t,n,r){let o,s,i,a,c=t,u=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let f=!1;r&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(f=!0);let h,A,g;if((g=Gc(e,c))>=0){if(h=!0,i=e.bMarks[c]+e.tShift[c],A=Number(e.src.slice(i,g-1)),f&&A!==1)return!1}else if((g=Qc(e,c))>=0)h=!1;else return!1;if(f&&e.skipSpaces(g)>=e.eMarks[c])return!1;if(r)return!0;const p=e.src.charCodeAt(g-1),x=e.tokens.length;h?(a=e.push("ordered_list_open","ol",1),A!==1&&(a.attrs=[["start",A]])):a=e.push("bullet_list_open","ul",1);const m=[c,0];a.map=m,a.markup=String.fromCharCode(p);let v=!1;const b=e.md.block.ruler.getRules("list"),y=e.parentType;for(e.parentType="list";c<n;){s=g,o=e.eMarks[c];const C=e.sCount[c]+g-(e.bMarks[c]+e.tShift[c]);let I=C;for(;s<o;){const D=e.src.charCodeAt(s);if(D===9)I+=4-(I+e.bsCount[c])%4;else if(D===32)I++;else break;s++}const w=s;let S;w>=o?S=1:S=I-C,S>4&&(S=1);const R=C+S;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const E=[c,0];a.map=E,h&&(a.info=e.src.slice(i,g-1));const k=e.tight,B=e.tShift[c],T=e.sCount[c],F=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=R,e.tight=!0,e.tShift[c]=w-e.bMarks[c],e.sCount[c]=I,w>=o&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n),(!e.tight||v)&&(u=!1),v=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=F,e.tShift[c]=B,e.sCount[c]=T,e.tight=k,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),c=e.line,E[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let j=!1;for(let D=0,H=b.length;D<H;D++)if(b[D](e,c,n,!0)){j=!0;break}if(j)break;if(h){if(g=Gc(e,c),g<0)break;i=e.bMarks[c]+e.tShift[c]}else if(g=Qc(e,c),g<0)break;if(p!==e.src.charCodeAt(g-1))break}return h?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(p),m[1]=c,e.line=c,e.parentType=y,u&&ky(e,x),!0}function Sy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const I=e.lineMax;if(C>=I||e.isEmpty(C))return null;let w=!1;if(e.sCount[C]-e.blkIndent>3&&(w=!0),e.sCount[C]<0&&(w=!0),!w){const E=e.md.block.ruler.getRules("reference"),k=e.parentType;e.parentType="reference";let B=!1;for(let T=0,F=E.length;T<F;T++)if(E[T](e,C,I,!0)){B=!0;break}if(e.parentType=k,B)return null}const S=e.bMarks[C]+e.tShift[C],R=e.eMarks[C];return e.src.slice(S,R+1)}let c=e.src.slice(o,s+1);s=c.length;let u=-1;for(o=1;o<s;o++){const C=c.charCodeAt(o);if(C===91)return!1;if(C===93){u=o;break}else if(C===10){const I=a(i);I!==null&&(c+=I,s=c.length,i++)}else if(C===92&&(o++,o<s&&c.charCodeAt(o)===10)){const I=a(i);I!==null&&(c+=I,s=c.length,i++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<s;o++){const C=c.charCodeAt(o);if(C===10){const I=a(i);I!==null&&(c+=I,s=c.length,i++)}else if(!Ye(C))break}const f=e.md.helpers.parseLinkDestination(c,o,s);if(!f.ok)return!1;const h=e.md.normalizeLink(f.str);if(!e.md.validateLink(h))return!1;o=f.pos;const A=o,g=i,p=o;for(;o<s;o++){const C=c.charCodeAt(o);if(C===10){const I=a(i);I!==null&&(c+=I,s=c.length,i++)}else if(!Ye(C))break}let x=e.md.helpers.parseLinkTitle(c,o,s);for(;x.can_continue;){const C=a(i);if(C===null)break;c+=C,o=s,s=c.length,i++,x=e.md.helpers.parseLinkTitle(c,o,s,x)}let m;for(o<s&&p!==o&&x.ok?(m=x.str,o=x.pos):(m="",o=A,i=g);o<s&&Ye(c.charCodeAt(o));)o++;if(o<s&&c.charCodeAt(o)!==10&&m)for(m="",o=A,i=g;o<s&&Ye(c.charCodeAt(o));)o++;if(o<s&&c.charCodeAt(o)!==10)return!1;const v=xs(c.slice(1,u));if(!v)return!1;if(r)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:m,href:h});const b=e.push("reference_definition","",0);b.map=[t,i],b.hidden=!0;const y=Object.create(null);return y.label=v,b.meta=y,e.line=i,!0}var Ry=["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"],qf=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,ep="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Dy=new RegExp(`^(?:${qf}|${ep}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Fy=new RegExp(`^(?:${qf}|${ep})`),Sn=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${Ry.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${Fy.source}\\s*$`),/^$/,!1]];function By(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let i=e.src.slice(o,s),a=0;for(;a<Sn.length&&!Sn[a][0].test(i);a++);if(a===Sn.length)return!1;if(r)return Sn[a][2];let c=t+1;const u=Sn[a][1].test("");if(!Sn[a][1].test(i)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(u||!e.isEmpty(c)));c++)if(o=e.bMarks[c]+e.tShift[c],s=e.eMarks[c],i=e.src.slice(o,s),Sn[a][1].test(i)){i.length!==0&&c++;break}}e.line=c;const f=e.push("html_block","",0);return f.map=[t,c],f.content=e.getLines(t,c,e.blkIndent,!0),!0}function jy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(o);if(i!==35||o>=s)return!1;let a=1;for(i=e.src.charCodeAt(++o);i===35&&o<s&&a<=6;)a++,i=e.src.charCodeAt(++o);if(a>6||o<s&&!Ye(i))return!1;if(r)return!0;s=e.skipSpacesBack(s,o);const c=e.skipCharsBack(s,35,o);c>o&&Ye(e.src.charCodeAt(c-1))&&(s=c),e.line=t+1;const u=e.push("heading_open",`h${a}`,1);u.markup="########".slice(0,a),u.map=[t,e.line];const f=e.push("inline","",0);f.content=bs(e.src.slice(o,s)),f.map=[t,e.line],f.children=[];const h=e.push("heading_close",`h${a}`,-1);return h.markup="########".slice(0,a),!0}function My(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let s=0,i,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let g=e.bMarks[a]+e.tShift[a];const p=e.eMarks[a];if(g<p&&(i=e.src.charCodeAt(g),(i===45||i===61)&&(g=e.skipChars(g,i),g=e.skipSpaces(g),g>=p))){s=i===61?1:2;break}}if(e.sCount[a]<0)continue;let A=!1;for(let g=0,p=r.length;g<p;g++)if(r[g](e,a,n,!0)){A=!0;break}if(A)break}if(!s)return e.parentType=o,!1;const c=bs(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const u=e.push("heading_open",`h${s}`,1);u.markup=String.fromCharCode(i),u.map=[t,e.line];const f=e.push("inline","",0);f.content=c,f.map=[t,e.line-1],f.children=[];const h=e.push("heading_close",`h${s}`,-1);return h.markup=String.fromCharCode(i),e.parentType=o,!0}function Py(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let s=t+1;for(e.parentType="paragraph";s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3||e.sCount[s]<0)continue;let u=!1;for(let f=0,h=r.length;f<h;f++)if(r[f](e,s,n,!0)){u=!0;break}if(u)break}const i=bs(e.getLines(t,s,e.blkIndent,!1));e.line=s;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const c=e.push("inline","",0);return c.content=i,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}var fo=[["table",vy,["paragraph","reference"]],["code",yy],["fence",Cy,["paragraph","reference","blockquote","list"]],["blockquote",Iy,["paragraph","reference","blockquote","list"]],["hr",wy,["paragraph","reference","blockquote","list"]],["list",Ey,["paragraph","reference","blockquote"]],["reference",Sy],["html_block",By,["paragraph","reference","blockquote"]],["heading",jy,["paragraph","reference","blockquote"]],["lheading",My],["paragraph",Py]],tp=class{constructor(){xe(this,"ruler",new Hr),xe(this,"State",Xf);for(let e=0;e<fo.length;e++)this.ruler.push(fo[e][0],fo[e][1],{alt:(fo[e][2]||[]).slice()})}tokenize(e,t,n){const r=this.ruler.getRules(""),o=r.length,s=e.md.options.maxNesting;let i=t,a=!1;for(;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n||e.sCount[i]<e.blkIndent));){if(e.level>=s){e.line=n;break}const c=e.line;let u=!1;for(let f=0;f<o;f++)if(u=r[f](e,i,n,!1),u){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),i=e.line,i<n&&e.isEmpty(i)&&(a=!0,i++,e.line=i)}}parse(e,t,n,r){if(!e)return;const o=new this.State(e,t,n,r);this.tokenize(o,o.line,o.lineMax)}},np=class{constructor(e,t,n,r){xe(this,"pos",0),xe(this,"level",0),xe(this,"pending",""),xe(this,"pendingLevel",0),xe(this,"cache",{}),xe(this,"backticks",{}),xe(this,"backticksScanned",!1),xe(this,"linkLevel",0),xe(this,"delimiters",[]),xe(this,"_prev_delimiters",[]),xe(this,"Token",jn),this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){const e=new jn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){this.pending&&this.pushPending();const r=new jn(e,t,n);let o;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r}scanDelims(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let o;if(e===0)o=32;else if(e===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(e-1),(o&64512)===56320){const p=this.src.charCodeAt(e-2);o=(p&64512)===55296?65536+(p-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=e;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const i=s-e;let a=s<n?this.src.charCodeAt(s):32;if((a&64512)===55296){const p=this.src.charCodeAt(s+1);a=(p&64512)===56320?65536+(a-55296<<10)+(p-56320):65533}else(a&64512)===56320&&(a=65533);const c=_r(o)||Nr(o),u=_r(a)||Nr(a),f=Tr(o),h=Tr(a),A=!h&&(!u||f||c),g=!f&&(!c||h||u);return{can_open:A&&(t||!g||c),can_close:g&&(t||!A||u),length:i}}};function Ty(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Ny(e,t){let n=e.pos;for(;n<e.posMax&&!Ty(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var _y=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Oy(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=e.pending.match(_y);if(!o)return!1;const s=o[1],i=e.md.linkify.matchAtStart(e.src.slice(n-s.length));if(!i)return!1;let a=i.url;if(a.length<=s.length)return!1;let c=a.length;for(;c>0&&a.charCodeAt(c-1)===42;)c--;c!==a.length&&(a=a.slice(0,c));const u=e.md.normalizeLink(a);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const f=e.push("link_open","a",1);f.attrs=[["href",u]],f.markup="linkify",f.info="auto";const h=e.push("text","",0);h.content=e.md.normalizeLinkText(a);const A=e.push("link_close","a",-1);A.markup="linkify",A.info="auto"}return e.pos+=a.length-s.length,!0}function Hy(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,o=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<o&&Ye(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Xa=[];for(let e=0;e<256;e++)Xa.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Xa[e.charCodeAt(0)]=1});function Ly(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=e.src.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(o=e.src.charCodeAt(n),!!Ye(o));)n++;return e.pos=n,!0}if(o===32){if(!t){const a=e.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return e.pos=n,!0}let s=e.src[n];if(o>=55296&&o<=56319&&n+1<r){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=e.src[n+1],n++)}const i="\\"+s;if(!t){const a=e.push("text_special","",0);o<256&&Xa[o]!==0?a.content=s:a.content=i,a.markup=i,a.info="escape"}return e.pos=n+1,!0}function Ky(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(r,n),i=s.length;if(e.backticksScanned&&(e.backticks[i]||0)<=r)return t||(e.pending+=s),e.pos+=i,!0;let a=n,c;for(;(c=e.src.indexOf("`",a))!==-1;){for(a=c+1;a<o&&e.src.charCodeAt(a)===96;)a++;const u=a-c;if(u===i){if(!t){const f=e.push("code_inline","code",0);f.markup=s,f.content=e.src.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=i,!0}function Wy(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const o=e.scanDelims(e.pos,!0);let s=o.length;const i=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=i,s--);for(let c=0;c<s;c+=2)a=e.push("text","",0),a.content=i+i,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function zc(e,t){let n;const r=[],o=t.length;for(let s=0;s<o;s++){const i=t[s];if(i.marker!==126||i.end===-1)continue;const a=t[i.end];n=e.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let i=s+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,s!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[s],e.tokens[s]=n)}}function Qy(e){const t=e.tokens_meta,n=e.tokens_meta.length;zc(e,e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&zc(e,s)}}var rp={tokenize:Wy,postProcess:Qy};function Gy(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const o=e.scanDelims(e.pos,r===42);for(let s=0;s<o.length;s++){const i=e.push("text","",0);i.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Yc(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const o=t[r];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const s=t[o.end],i=r>0&&t[r-1].end===o.end+1&&t[r-1].marker===o.marker&&t[r-1].token===o.token-1&&t[o.end+1].token===s.token+1,a=String.fromCharCode(o.marker),c=e.tokens[o.token];c.type=i?"strong_open":"em_open",c.tag=i?"strong":"em",c.nesting=1,c.markup=i?a+a:a,c.content="";const u=e.tokens[s.token];u.type=i?"strong_close":"em_close",u.tag=i?"strong":"em",u.nesting=-1,u.markup=i?a+a:a,u.content="",i&&(e.tokens[t[r-1].token].content="",e.tokens[t[o.end+1].token].content="",r--)}}function zy(e){const t=e.tokens_meta,n=e.tokens_meta.length;Yc(e,e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Yc(e,s)}}var op={tokenize:Gy,postProcess:zy};function Yy(e,t){let n,r,o,s,i="",a="",c=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,h=e.posMax,A=e.pos+1,g=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(g<0)return!1;let p=g+1;if(p<h&&e.src.charCodeAt(p)===40){for(u=!1,p++;p<h&&(n=e.src.charCodeAt(p),!(!Ye(n)&&n!==10));p++);if(p>=h)return!1;if(c=p,o=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),o.ok){for(i=e.md.normalizeLink(o.str),e.md.validateLink(i)?p=o.pos:i="",c=p;p<h&&(n=e.src.charCodeAt(p),!(!Ye(n)&&n!==10));p++);if(o=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<h&&c!==p&&o.ok)for(a=o.str,p=o.pos;p<h&&(n=e.src.charCodeAt(p),!(!Ye(n)&&n!==10));p++);}(p>=h||e.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof e.env.references>"u")return!1;if(p<h&&e.src.charCodeAt(p)===91?(c=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?r=e.src.slice(c,p++):p=g+1):p=g+1,r||(r=e.src.slice(A,g)),r=xs(r),s=e.env.references[r],!s)return e.pos=f,!1;i=s.href,a=s.title}if(!t){e.pos=A,e.posMax=g;const x=e.push("link_open","a",1),m=[["href",i]];if(x.attrs=m,a&&m.push(["title",a]),r){const v=Object.create(null);v.label=r,x.meta=v}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=h,!0}function Uy(e,t){let n,r,o,s,i,a,c,u,f="";const h=e.pos,A=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const g=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(s=p+1,s<A&&e.src.charCodeAt(s)===40){for(s++;s<A&&(n=e.src.charCodeAt(s),!(!Ye(n)&&n!==10));s++);if(s>=A)return!1;for(u=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(f=e.md.normalizeLink(a.str),e.md.validateLink(f)?s=a.pos:f=""),u=s;s<A&&(n=e.src.charCodeAt(s),!(!Ye(n)&&n!==10));s++);if(a=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<A&&u!==s&&a.ok)for(c=a.str,s=a.pos;s<A&&(n=e.src.charCodeAt(s),!(!Ye(n)&&n!==10));s++);else c="";if(s>=A||e.src.charCodeAt(s)!==41)return e.pos=h,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s<A&&e.src.charCodeAt(s)===91?(u=s+1,s=e.md.helpers.parseLinkLabel(e,s),s>=0?o=e.src.slice(u,s++):s=p+1):s=p+1,o||(o=e.src.slice(g,p)),o=xs(o),i=e.env.references[o],!i)return e.pos=h,!1;f=i.href,c=i.title}if(!t){r=e.src.slice(g,p);const x=[];e.md.inline.parse(r,e.md,e.env,x);const m=e.push("image","img",0),v=[["src",f],["alt",""]];if(m.attrs=v,m.children=x,m.content=r,c&&v.push(["title",c]),o){const b=Object.create(null);b.label=o,m.meta=b}}return e.pos=s,e.posMax=A,!0}var Vy=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Zy=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Jy(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,o=e.posMax;for(;;){if(++n>=o)return!1;const i=e.src.charCodeAt(n);if(i===60)return!1;if(i===62)break}const s=e.src.slice(r+1,n);if(Zy.test(s)){const i=e.md.normalizeLink(s);if(!e.md.validateLink(i))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=s.length+2,!0}if(Vy.test(s)){const i=e.md.normalizeLink(`mailto:${s}`);if(!e.md.validateLink(i))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=s.length+2,!0}return!1}function $y(e){return/^<a[>\s]/i.test(e)}function Xy(e){return/^<\/a\s*>/i.test(e)}function qy(e){const t=e|32;return t>=97&&t<=122}function e1(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const o=e.src.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!qy(o))return!1;const s=e.src.slice(r).match(Dy);if(!s)return!1;if(!t){const i=e.push("html_inline","",0);i.content=s[0],$y(i.content)&&e.linkLevel++,Xy(i.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}var t1=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,n1=/^&([a-z][a-z0-9]{1,31});/i;function r1(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(t1);if(o){if(!t){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=e.push("text_special","",0);i.content=$a(s)?Pr(s):Pr(65533),i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(n1);if(o){const s=Pf(o[0]);if(s!==o[0]){if(!t){const i=e.push("text_special","",0);i.content=s,i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function Uc(e){const t={},n=e.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const a=e[i];if(s.push(0),(e[r].marker!==a.marker||o!==a.token-1)&&(r=i),o=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[a.marker][(a.open?3:0)+a.length%3];let u=r-s[r]-1,f=u;for(;u>c;u-=s[u]+1){const h=e[u];if(h.marker===a.marker&&h.open&&h.end<0){let A=!1;if((h.close||a.open)&&(h.length+a.length)%3===0&&(h.length%3!==0||a.length%3!==0)&&(A=!0),!A){const g=u>0&&!e[u-1].open?s[u-1]+1:0;s[i]=i-u+g,s[u]=g,a.open=!1,h.end=i,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=f)}}function o1(e){const t=e.tokens_meta,n=e.tokens_meta.length;Uc(e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Uc(s)}}function s1(e){let t,n,r=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)o[t].nesting<0&&r--,o[t].level=r,o[t].nesting>0&&r++,o[t].type==="text"&&t+1<s&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}var Vs=[["text",Ny],["linkify",Oy],["newline",Hy],["escape",Ly],["backticks",Ky],["strikethrough",rp.tokenize],["emphasis",op.tokenize],["link",Yy],["image",Uy],["autolink",Jy],["html_inline",e1],["entity",r1]],Zs=[["balance_pairs",o1],["strikethrough",rp.postProcess],["emphasis",op.postProcess],["fragments_join",s1]],sp=class{constructor(){xe(this,"ruler",new Hr),xe(this,"ruler2",new Hr),xe(this,"State",np);for(let e=0;e<Vs.length;e++)this.ruler.push(Vs[e][0],Vs[e][1]);for(let e=0;e<Zs.length;e++)this.ruler2.push(Zs[e][0],Zs[e][1])}skipToken(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting,s=e.cache;if(typeof s[t]<"u"){e.pos=s[t];return}let i=!1;if(e.level<o){for(let a=0;a<r;a++)if(e.level++,i=n[a](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,s[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,o=e.md.options.maxNesting;for(;e.pos<r;){const s=e.pos;let i=!1;if(e.level<o){for(let a=0;a<n;a++)if(i=t[a](e,!1),i){if(s>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){const o=new this.State(e,t,n,r);this.tokenize(o);const s=this.ruler2.getRules(""),i=s.length;for(let a=0;a<i;a++)s[a](o)}},i1={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},a1=/^(vbscript|javascript|file|data):/,l1=/^data:image\/(gif|png|jpeg|webp);/,Vc=["http:","https:","mailto:"],Zt=class{validateLink(e){const t=e.trim().toLowerCase();return a1.test(t)?l1.test(t):!0}normalizeLink(e){const t=Si(e,!0);if(t.hostname&&(!t.protocol||Vc.indexOf(t.protocol)>=0))try{t.hostname=_c.toASCII(t.hostname)}catch{}return Zr(Ei(t))}normalizeLinkText(e){const t=Si(e,!0);if(t.hostname&&(!t.protocol||Vc.indexOf(t.protocol)>=0))try{t.hostname=_c.toUnicode(t.hostname)}catch{}return rr(Ei(t),rr.defaultChars+"%")}constructor(...e){xe(this,"inline",new sp),xe(this,"block",new tp),xe(this,"core",new $f),xe(this,"renderer",new Vf),xe(this,"linkify",new yv),xe(this,"utils",Mv),xe(this,"helpers",Object.assign({},Vv));const[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){const o=e;if(t=i1[o],!t)throw new Error(`Wrong 'markdown-it' preset "${o}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});const n=t.components;if(n){var r;["core","block","inline"].forEach(s=>{var i;const a=(i=n[s])===null||i===void 0?void 0:i.rules;a&&this[s].ruler.enableOnly(a)});const o=(r=n.inline)===null||r===void 0?void 0:r.rules2;o&&this.inline.ruler2.enableOnly(o)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(o=>n.indexOf(o)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(o=>n.indexOf(o)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};xe(Zt,"Token",jn);xe(Zt,"Ruler",Hr);xe(Zt,"Renderer",Vf);xe(Zt,"ParserCore",$f);xe(Zt,"StateCore",Zf);xe(Zt,"ParserBlock",tp);xe(Zt,"StateBlock",Xf);xe(Zt,"ParserInline",sp);xe(Zt,"StateInline",np);var c1=Gf(Zt),Js,Zc;function u1(){return Zc||(Zc=1,Js=function(t,n){var r=3,o="-",s=o.charCodeAt(0),i=o.length;function a(c,u,f,h){var A,g,p,x,m,v,b,y=!1,C=c.bMarks[u]+c.tShift[u],I=c.eMarks[u];if(u!==0||s!==c.src.charCodeAt(0))return!1;for(A=C+1;A<=I;A++)if(o[(A-C)%i]!==c.src[A]){b=A+1;break}if(p=Math.floor((A-C)/i),p<r)return!1;if(A-=(A-C)%i,h)return!0;for(g=u;g++,!(g>=f||c.src.slice(C,I)==="..."||(C=c.bMarks[g]+c.tShift[g],I=c.eMarks[g],C<I&&c.sCount[g]<c.blkIndent));)if(s===c.src.charCodeAt(C)&&!(c.sCount[g]-c.blkIndent>=4)){for(A=C+1;A<=I&&o[(A-C)%i]===c.src[A];A++);if(!(Math.floor((A-C)/i)<p)&&(A-=(A-C)%i,A=c.skipSpaces(A),!(A<I))){y=!0;break}}return m=c.parentType,v=c.lineMax,c.parentType="container",c.lineMax=g,x=c.push("front_matter",null,0),x.hidden=!0,x.markup=c.src.slice(u,A),x.block=!0,x.map=[u,g+(y?1:0)],x.meta=c.src.slice(b,C-1),c.parentType=m,c.lineMax=v,c.line=g+(y?1:0),n(x.meta),!0}t.block.ruler.before("table","front_matter",a,{alt:["paragraph","reference","blockquote","list"]})}),Js}var d1=u1();const f1=$p(d1);var p1=Object.defineProperty,h1=Object.defineProperties,g1=Object.getOwnPropertyDescriptors,Jc=Object.getOwnPropertySymbols,A1=Object.prototype.hasOwnProperty,m1=Object.prototype.propertyIsEnumerable,$c=(e,t,n)=>t in e?p1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))A1.call(t,n)&&$c(e,n,t[n]);if(Jc)for(var n of Jc(t))m1.call(t,n)&&$c(e,n,t[n]);return e},Lr=(e,t)=>h1(e,g1(t)),Ho=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{a(n.next(c))}catch(u){o(u)}},i=c=>{try{a(n.throw(c))}catch(u){o(u)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,i);a((n=n.apply(e,t)).next())});function x1(e,t){return typeof e=="function"?e(t):e}function Kr(e,t){return n=>{t.setState(r=>Lr(lt({},r),{[e]:x1(n,r[e])}))}}var Xc=(e,t=100,n=1e3)=>new Promise(r=>{let o;const s=setInterval(()=>{e()&&(r(),clearInterval(s),clearTimeout(o))},t);o=setTimeout(()=>{clearInterval(s),r()},n)}),ip="Headless Tree: ",Di=e=>Error(ip+e),b1=e=>console.warn(ip+e),v1={key:"tree",getInitialState:e=>lt({expandedItems:[],focusedItem:null},e),getDefaultConfig:(e,t)=>lt({setExpandedItems:Kr("expandedItems",t),setFocusedItem:Kr("focusedItem",t)},e),stateHandlerNames:{expandedItems:"setExpandedItems",focusedItem:"setFocusedItem"},treeInstance:{getItemsMeta:({tree:e})=>{const{rootItemId:t}=e.getConfig(),{expandedItems:n}=e.getState(),r=[],o=new Set(n),s=(c,u,f,h,A)=>{var g;if(u.includes(c)){b1(`Circular reference for ${u.join(".")}`);return}if(r.push({itemId:c,level:f,index:r.length,parentId:u.at(-1),setSize:h,posInSet:A}),o.has(c)){const p=(g=e.retrieveChildrenIds(c))!=null?g:[];let x=0;for(const m of p)s(m,u.concat(c),f+1,p.length,x++)}},i=e.retrieveChildrenIds(t);let a=0;for(const c of i)s(c,[t],0,i.length,a++);return r},getFocusedItem:({tree:e})=>{var t;const n=e.getState().focusedItem;return(t=n!==null?e.getItemInstance(n):null)!=null?t:e.getItems()[0]},getRootItem:({tree:e})=>{const{rootItemId:t}=e.getConfig();return e.getItemInstance(t)},focusNextItem:({tree:e})=>{var t;const n=e.getFocusedItem().getItemMeta();if(!n)return;const r=Math.min(n.index+1,e.getItems().length-1);(t=e.getItems()[r])==null||t.setFocused()},focusPreviousItem:({tree:e})=>{var t;const n=e.getFocusedItem().getItemMeta();if(!n)return;const r=Math.max(n.index-1,0);(t=e.getItems()[r])==null||t.setFocused()},updateDomFocus:({tree:e})=>{setTimeout(()=>Ho(null,null,function*(){var t,n,r,o,s;const i=e.getFocusedItem();(n=(t=e.getConfig()).scrollToItem)==null||n.call(t,i),yield Xc(()=>i.getElement()!==null,20,500);const a=i.getElement();if(!a){(r=e.getItems()[0])==null||r.setFocused(),(s=(o=e.getItems()[0])==null?void 0:o.getElement())==null||s.focus();return}a.focus()}))},getContainerProps:({prev:e,tree:t},n)=>Lr(lt({},e?.()),{role:"tree","aria-label":n??"",ref:t.registerElement}),isSearchOpen:()=>!1},itemInstance:{scrollTo:(e,t)=>Ho(null,[e,t],function*({tree:n,item:r},o){var s,i,a;(i=(s=n.getConfig()).scrollToItem)==null||i.call(s,r),yield Xc(()=>r.getElement()!==null,20),(a=r.getElement())==null||a.scrollIntoView(o)}),getId:({itemId:e})=>e,getKey:({itemId:e})=>e,getProps:({item:e,prev:t})=>{const n=e.getItemMeta();return Lr(lt({},t?.()),{ref:e.registerElement,role:"treeitem","aria-setsize":n.setSize,"aria-posinset":n.posInSet+1,"aria-selected":"false","aria-label":e.getItemName(),"aria-level":n.level+1,"aria-expanded":e.isFolder()?e.isExpanded():void 0,tabIndex:e.isFocused()?0:-1,onClick:r=>{e.setFocused(),e.primaryAction(),!(r.ctrlKey||r.shiftKey||r.metaKey)&&e.isFolder()&&(e.isExpanded()?e.collapse():e.expand())}})},expand:({tree:e,item:t,itemId:n})=>{var r;t.isFolder()&&((r=e.getState().loadingItemChildrens)!=null&&r.includes(n)||(e.applySubStateUpdate("expandedItems",o=>[...o,n]),e.rebuildTree()))},collapse:({tree:e,item:t,itemId:n})=>{t.isFolder()&&(e.applySubStateUpdate("expandedItems",r=>r.filter(o=>o!==n)),e.rebuildTree())},getItemData:({tree:e,itemId:t})=>e.retrieveItemData(t),equals:({item:e},t)=>e.getId()===t?.getId(),isExpanded:({tree:e,itemId:t})=>e.getState().expandedItems.includes(t),isDescendentOf:({item:e},t)=>{const n=e.getParent();return!!(n?.getId()===t||n?.isDescendentOf(t))},isFocused:({tree:e,item:t,itemId:n})=>e.getState().focusedItem===n||e.getState().focusedItem===null&&t.getItemMeta().index===0,isFolder:({tree:e,item:t,itemId:n})=>n===e.getConfig().rootItemId||e.getConfig().isItemFolder(t),getItemName:({tree:e,item:t})=>e.getConfig().getItemName(t),setFocused:({tree:e,itemId:t})=>{e.applySubStateUpdate("focusedItem",t)},primaryAction:({tree:e,item:t})=>{var n,r;return(r=(n=e.getConfig()).onPrimaryAction)==null?void 0:r.call(n,t)},getParent:({tree:e,item:t})=>t.getItemMeta().parentId?e.getItemInstance(t.getItemMeta().parentId):void 0,getIndexInParent:({item:e})=>e.getItemMeta().posInSet,getChildren:({tree:e,itemId:t})=>e.retrieveChildrenIds(t).map(n=>e.getItemInstance(n)),getTree:({tree:e})=>e,getItemAbove:({tree:e,item:t})=>e.getItems()[t.getItemMeta().index-1],getItemBelow:({tree:e,item:t})=>e.getItems()[t.getItemMeta().index+1]},hotkeys:{focusNextItem:{hotkey:"ArrowDown",canRepeat:!0,preventDefault:!0,isEnabled:e=>{var t,n;return!((n=(t=e.isSearchOpen)==null?void 0:t.call(e))!=null&&n)&&!e.getState().dnd},handler:(e,t)=>{t.focusNextItem(),t.updateDomFocus()}},focusPreviousItem:{hotkey:"ArrowUp",canRepeat:!0,preventDefault:!0,isEnabled:e=>{var t,n;return!((n=(t=e.isSearchOpen)==null?void 0:t.call(e))!=null&&n)&&!e.getState().dnd},handler:(e,t)=>{t.focusPreviousItem(),t.updateDomFocus()}},expandOrDown:{hotkey:"ArrowRight",canRepeat:!0,handler:(e,t)=>{const n=t.getFocusedItem();n.isExpanded()||!n.isFolder()?(t.focusNextItem(),t.updateDomFocus()):n.expand()}},collapseOrUp:{hotkey:"ArrowLeft",canRepeat:!0,handler:(e,t)=>{var n;const r=t.getFocusedItem();(!r.isExpanded()||!r.isFolder())&&r.getItemMeta().level!==0?((n=r.getParent())==null||n.setFocused(),t.updateDomFocus()):r.collapse()}},focusFirstItem:{hotkey:"Home",handler:(e,t)=>{var n;(n=t.getItems()[0])==null||n.setFocused(),t.updateDomFocus()}},focusLastItem:{hotkey:"End",handler:(e,t)=>{var n;(n=t.getItems()[t.getItems().length-1])==null||n.setFocused(),t.updateDomFocus()}}}},y1=(e,t,n)=>{const r={};return[r,()=>{const s=n(r);e:for(let i=0;i<e.length;i++){const a=e[i][t];if(!a)continue e;t:for(const[c,u]of Object.entries(a)){if(!u)continue t;const f=r[c];r[c]=(...h)=>u(Lr(lt({},s),{prev:f}),...h)}}}]},C1=e=>{var t;const n=e?.map(r=>r.key);for(const r of e??[]){const o=(t=r.deps)==null?void 0:t.find(s=>!n?.includes(s));if(o)throw Di(`${r.key} needs ${o}`)}},I1=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)for(let o=r+1;o<n;o++)t(e[o],e[r])<0&&([e[r],e[o]]=[e[o],e[r]]);return e},w1=e=>(t,n)=>{var r,o;return n.key&&((r=t.overwrites)!=null&&r.includes(n.key))?1:t.key&&((o=n.overwrites)!=null&&o.includes(t.key))?-1:e.indexOf(t)-e.indexOf(n)},k1=(e=[])=>I1(e,w1(e)),E1=e=>{var t,n,r,o;const s=(t=e.instanceBuilder)!=null?t:y1,i=[v1,...k1(e.features)];C1(i);const a=[...i],[c,u]=s(a,"treeInstance",E=>({tree:E}));let f=i.reduce((E,k)=>{var B,T;return(T=(B=k.getInitialState)==null?void 0:B.call(k,E,c))!=null?T:E},(r=(n=e.initialState)!=null?n:e.state)!=null?r:{}),h=i.reduce((E,k)=>{var B,T;return(T=(B=k.getDefaultConfig)==null?void 0:B.call(k,E,c))!=null?T:E},e);const A=i.reduce((E,k)=>lt(lt({},E),k.stateHandlerNames),{});let g;const p={current:{}};let x=!1;const m={};let v=[];const b={},y={};let C={};const I={},w=()=>{v=[],C={};const[E,k]=s(a,"itemInstance",B=>({item:B,tree:c,itemId:h.rootItemId}));k(),m[h.rootItemId]=E,C[h.rootItemId]={itemId:h.rootItemId,index:-1,parentId:null,level:-1,posInSet:0,setSize:1};for(const B of c.getItemsMeta())if(C[B.itemId]=B,m[B.itemId])v.push(m[B.itemId]);else{const[T,F]=s(a,"itemInstance",j=>({item:j,tree:c,itemId:B.itemId}));F(),m[B.itemId]=T,v.push(T)}x=!1},S=E=>{for(const k of i)E(k)},R={key:"main",treeInstance:{getState:()=>f,setState:({},E)=>{var k;(k=h.setState)==null||k.call(h,f)},setMounted:({},E)=>{var k;const B=p.current;B.isMounted=E,E&&((k=B.waitingForMount)==null||k.forEach(T=>T()),B.waitingForMount=[])},applySubStateUpdate:({},E,k)=>{var B;const T=()=>{f[E]=typeof k=="function"?k(f[E]):k;const j=h[A[E]];j?.(f[E])},F=p.current;F.isMounted?T():((B=F.waitingForMount)!=null||(F.waitingForMount=[]),F.waitingForMount.push(T))},rebuildTree:()=>{var E,k;const B=p.current;B.isMounted?(w(),(E=h.setState)==null||E.call(h,f)):((k=B.waitingForMount)!=null||(B.waitingForMount=[]),B.waitingForMount.push(()=>{var T;w(),(T=h.setState)==null||T.call(h,f)}))},scheduleRebuildTree:()=>{x=!0},getConfig:()=>h,setConfig:(E,k)=>{var B,T,F;const j=typeof k=="function"?k(h):k,D=((B=j.state)==null?void 0:B.expandedItems)&&((T=j.state)==null?void 0:T.expandedItems)!==f.expandedItems;h=j,j.state&&(f=lt(lt({},f),j.state)),D&&(w(),(F=h.setState)==null||F.call(h,f))},getItemInstance:({},E)=>{const k=m[E];if(!k){const[B,T]=s(a,"itemInstance",F=>({item:F,tree:c,itemId:E}));return T(),B}return k},getItems:()=>(x&&w(),v),registerElement:({},E)=>{g!==E&&(g&&!E?S(k=>{var B;return(B=k.onTreeUnmount)==null?void 0:B.call(k,c,g)}):!g&&E&&S(k=>{var B;return(B=k.onTreeMount)==null?void 0:B.call(k,c,E)}),g=E)},getElement:()=>g,getDataRef:()=>p,getHotkeyPresets:()=>I},itemInstance:{registerElement:({itemId:E,item:k},B)=>{if(b[E]===B)return;const T=b[E];T&&!B?S(F=>{var j;return(j=F.onItemUnmount)==null?void 0:j.call(F,k,T,c)}):!T&&B&&S(F=>{var j;return(j=F.onItemMount)==null?void 0:j.call(F,k,B,c)}),b[E]=B},getElement:({itemId:E})=>b[E],getDataRef:({itemId:E})=>{var k;return(k=y[E])!=null?k:y[E]={current:{}}},getItemMeta:({itemId:E})=>{var k;return(k=C[E])!=null?k:{itemId:E,parentId:null,level:-1,index:-1,posInSet:0,setSize:1}}}};a.unshift(R);for(const E of a)Object.assign(I,(o=E.hotkeys)!=null?o:{});return u(),c},S1={key:"selection",getInitialState:e=>lt({selectedItems:[]},e),getDefaultConfig:(e,t)=>lt({setSelectedItems:Kr("selectedItems",t)},e),stateHandlerNames:{selectedItems:"setSelectedItems"},treeInstance:{setSelectedItems:({tree:e},t)=>{e.applySubStateUpdate("selectedItems",t)},getSelectedItems:({tree:e})=>e.getState().selectedItems.map(e.getItemInstance)},itemInstance:{select:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();e.setSelectedItems(n.includes(t)?n:[...n,t])},deselect:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();e.setSelectedItems(n.filter(r=>r!==t))},isSelected:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();return n.includes(t)},selectUpTo:({tree:e,item:t,itemId:n},r)=>{const o=t.getItemMeta().index,s=e.getDataRef();if(!s.current.selectUpToAnchorId){s.current.selectUpToAnchorId=n,e.setSelectedItems([n]);return}const a=e.getItemInstance(s.current.selectUpToAnchorId).getItemMeta().index,[c,u]=o<a?[o,a]:[a,o],f=e.getItems().slice(c,u+1).map(g=>g.getItemMeta().itemId);if(!r){e.setSelectedItems(f);return}const{selectedItems:h}=e.getState(),A=[...new Set([...h,...f])];e.setSelectedItems(A)},toggleSelect:({item:e})=>{e.isSelected()?e.deselect():e.select()},getProps:({tree:e,item:t,itemId:n,prev:r})=>Lr(lt({},r?.()),{"aria-selected":t.isSelected()?"true":"false",onClick:o=>{var s,i;o.shiftKey?t.selectUpTo(o.ctrlKey||o.metaKey):o.ctrlKey||o.metaKey?t.toggleSelect():e.setSelectedItems([n]),o.shiftKey||(e.getDataRef().current.selectUpToAnchorId=n),(i=(s=r?.())==null?void 0:s.onClick)==null||i.call(s,o)}})},hotkeys:{toggleSelectedItem:{hotkey:"Control+Space",preventDefault:!0,handler:(e,t)=>{t.getFocusedItem().toggleSelect()}},selectUpwards:{hotkey:"Shift+ArrowUp",handler:(e,t)=>{const n=t.getFocusedItem(),r=n.getItemAbove();r&&(n.isSelected()&&r.isSelected()?n.deselect():r.select(),r.setFocused(),t.updateDomFocus())}},selectDownwards:{hotkey:"Shift+ArrowDown",handler:(e,t)=>{const n=t.getFocusedItem(),r=n.getItemBelow();r&&(n.isSelected()&&r.isSelected()?n.deselect():r.select(),r.setFocused(),t.updateDomFocus())}},selectAll:{hotkey:"Control+KeyA",preventDefault:!0,handler:(e,t)=>{t.setSelectedItems(t.getItems().map(n=>n.getId()))}}}},qc=e=>e.code!==""&&e.code!=="Unidentified"?e.code:e.key,eu={letter:/^Key[A-Z]$/,letterornumber:/^(Key[A-Z]|Digit[0-9])$/,plus:/^(NumpadAdd|Plus)$/,minus:/^(NumpadSubtract|Minus)$/,control:/^(ControlLeft|ControlRight)$/,shift:/^(ShiftLeft|ShiftRight)$/,metaorcontrol:/^(MetaLeft|MetaRight|ControlLeft|ControlRight)$/,enter:/^(Enter|NumpadEnter)$/},tu=new Set(["MetaLeft","MetaRight","Meta","ControlLeft","ControlRight","Control","AltLeft","AltRight","Alt","ShiftLeft","ShiftRight","Shift"]),R1=(e,t,n)=>{const r=n.hotkey.toLowerCase().split("+"),o=r.every(i=>{if(i in eu)return[...e].some(c=>eu[i].test(c));const a=[...e].map(c=>c.toLowerCase());return a.includes(i.toLowerCase())||a.includes(`key${i.toLowerCase()}`)}),s=!n.isEnabled||n.isEnabled(t);return o&&s&&e.size===r.length},D1=(e,t,n,r)=>{var o;return(o=Object.entries(lt(lt({},n),r)).find(([,s])=>R1(e,t,s)))==null?void 0:o[0]},$s={clearPressedKeys:e=>{e.current.pressedKeys=new Set},dispatchKeyDown:(e,t,n,r={})=>{var o,s,i,a,c;const{isInputFocused:u=!1,releaseAfterDispatch:f=!1}=r,{ignoreHotkeysOnInputs:h,onTreeHotkey:A,hotkeys:g}=e.getConfig();if(u&&h)return;const p=qc({code:(o=n.code)!=null?o:"",key:(s=n.key)!=null?s:""});(a=(i=t.current).pressedKeys)!=null||(i.pressedKeys=new Set);const x=!t.current.pressedKeys.has(p);p&&t.current.pressedKeys.add(p);const m=D1(t.current.pressedKeys,e,e.getHotkeyPresets(),g);if(f&&p&&t.current.pressedKeys.delete(p),!m)return;const v=lt(lt({},e.getHotkeyPresets()[m]),g?.[m]);v&&(!v.allowWhenInputFocused&&u||!v.canRepeat&&!x||(v.preventDefault&&((c=n.preventDefault)==null||c.call(n)),v.handler(n,e),A?.(m,n)))},dispatchKeyUp:(e,t)=>{var n,r,o,s;const i=qc({code:(n=t.code)!=null?n:"",key:(r=t.key)!=null?r:""});i&&((s=(o=e.current).pressedKeys)!=null||(o.pressedKeys=new Set),tu.has(i)&&(e.current.pressedKeys=new Set([...e.current.pressedKeys].filter(a=>tu.has(a)))),e.current.pressedKeys.delete(i))}},F1={key:"hotkeys-core",onTreeMount:(e,t)=>{const n=e.getDataRef(),r=i=>{const a=i.target instanceof HTMLInputElement;$s.dispatchKeyDown(e,n,i,{isInputFocused:a,releaseAfterDispatch:a})},o=i=>{$s.dispatchKeyUp(n,i)},s=()=>{$s.clearPressedKeys(n)};t.addEventListener("keydown",r),document.addEventListener("keyup",o),window.addEventListener("focus",s),n.current.keydownHandler=r,n.current.keyupHandler=o,n.current.resetHandler=s},onTreeUnmount:(e,t)=>{const n=e.getDataRef();n.current.keyupHandler&&(document.removeEventListener("keyup",n.current.keyupHandler),delete n.current.keyupHandler),n.current.keydownHandler&&(t.removeEventListener("keydown",n.current.keydownHandler),delete n.current.keydownHandler),n.current.resetHandler&&(window.removeEventListener("focus",n.current.resetHandler),delete n.current.resetHandler)}},B1="sync dataLoader returned undefined",j1="sync dataLoader returned promise",Xs=e=>{if(!e)throw Di(B1);if(typeof e=="object"&&"then"in e)throw Di(j1);return e},M1={key:"sync-data-loader",getInitialState:e=>lt({loadingItemData:[],loadingItemChildrens:[]},e),getDefaultConfig:(e,t)=>lt({setLoadingItemData:Kr("loadingItemData",t),setLoadingItemChildrens:Kr("loadingItemChildrens",t)},e),stateHandlerNames:{loadingItemData:"setLoadingItemData",loadingItemChildrens:"setLoadingItemChildrens"},treeInstance:{waitForItemDataLoaded:()=>Ho(null,null,function*(){}),waitForItemChildrenLoaded:()=>Ho(null,null,function*(){}),retrieveItemData:({tree:e},t)=>Xs(e.getConfig().dataLoader.getItem(t)),retrieveChildrenIds:({tree:e},t)=>{const{dataLoader:n}=e.getConfig();return"getChildren"in n?Xs(n.getChildren(t)):Xs(n.getChildrenWithData(t)).map(r=>r.data)},loadItemData:({tree:e},t)=>e.retrieveItemData(t),loadChildrenIds:({tree:e},t)=>e.retrieveChildrenIds(t)},itemInstance:{isLoading:()=>!1,hasLoadedData:()=>!0}},P1=Object.defineProperty,T1=Object.defineProperties,N1=Object.getOwnPropertyDescriptors,nu=Object.getOwnPropertySymbols,_1=Object.prototype.hasOwnProperty,O1=Object.prototype.propertyIsEnumerable,ru=(e,t,n)=>t in e?P1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,po=(e,t)=>{for(var n in t||(t={}))_1.call(t,n)&&ru(e,n,t[n]);if(nu)for(var n of nu(t))O1.call(t,n)&&ru(e,n,t[n]);return e},H1=(e,t)=>T1(e,N1(t)),L1=e=>{const[t]=d.useState(()=>({current:E1(e)})),[n,r]=d.useState(()=>t.current.getState());return d.useEffect(()=>(t.current.setMounted(!0),t.current.rebuildTree(),()=>{t.current.setMounted(!1)}),[t]),t.current.setConfig(o=>H1(po(po({},o),e),{state:po(po({},n),e.state),setState:s=>{var i;r(s),(i=e.setState)==null||i.call(e,s)}})),t.current};const K1=/^(https?:|mailto:|#|\.\/|#\/)/iu,W1=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',"""),Tn=c1({html:!1,linkify:!0,typographer:!1,breaks:!1});f1(Tn,()=>{});Tn.core.ruler.push("render_front_matter",e=>{for(const t of e.tokens)t.type==="front_matter"&&(t.type="fence",t.tag="code",t.info="yaml",t.content=String(t.meta??"").replace(/\n$/,""),t.block=!0);return!0});Tn.validateLink=e=>K1.test(e.trim());const ap=e=>{for(const t of e)t.type==="link_open"&&(t.attrSet("rel","noreferrer noopener"),t.attrSet("target","_blank")),t.children!==null&&ap(t.children)};Tn.core.ruler.push("external_links",e=>(ap(e.tokens),!0));Tn.renderer.rules.fence=(e,t)=>{const n=e[t];return`<pre class="tech-ltr"><code${n.info.trim().length>0?` class="language-${W1(n.info.trim())}"`:""}>${Tn.utils.escapeHtml(n.content)}</code></pre>
|
|
20
|
-
`};const Q1=e=>Tn.render(e),G1=["prose prose-sm","dark:prose-invert","max-w-[75ch]","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-xl prose-h2:text-lg prose-h3:text-base","prose-p:my-2 prose-li:my-0.5","prose-code:before:content-none prose-code:after:content-none","prose-code:font-mono prose-code:text-[0.85em]","prose-pre:bg-muted prose-pre:text-foreground prose-pre:rounded-lg","prose-a:text-primary prose-a:decoration-primary/40 hover:prose-a:decoration-primary","prose-table:border-collapse prose-table:text-xs","prose-th:border prose-th:border-border prose-th:bg-muted prose-th:px-2 prose-th:py-1 prose-th:text-start prose-th:font-semibold","prose-td:border prose-td:border-border prose-td:px-2 prose-td:py-1 prose-td:align-top","prose-td:font-mono","prose-hr:border-border prose-blockquote:border-primary/40"].join(" "),z1=(e,t)=>e.children!==void 0?t?l.jsx(Sh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-amber-500"}):l.jsx(Dh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-amber-500"}):l.jsx(kh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-muted-foreground"}),ou=16,Y1=({entries:e,selected:t,onSelect:n})=>{const r=d.useMemo(()=>{const c=new Map;for(const f of e){const h=f.path.split("/"),A=h[h.length-1]??f.path;f.type==="directory"?c.set(f.path,{name:A,path:f.path,children:[]}):c.set(f.path,{name:A,path:f.path})}for(const f of e){const h=f.path.split("/");for(let A=1;A<h.length;A+=1){const g=h.slice(0,A).join("/");c.has(g)||c.set(g,{name:h[A-1]??g,path:g,children:[]})}}for(const f of c.values())f.children!==void 0&&(f.children=[...c.values()].filter(h=>h.path!==""&&h.path.split("/").slice(0,-1).join("/")===f.path).map(h=>h.path));const u={name:"skill",path:"",children:[]};return u.children=[...c.values()].filter(f=>f.path!==""&&f.path.split("/").length===1).map(f=>f.path),c.set("root",u),Object.fromEntries(c)},[e]),o=d.useMemo(()=>Object.values(r).filter(c=>c.children!==void 0&&c.path!=="").map(c=>c.path),[r]),[s,i]=d.useState([t]),a=L1({initialState:{selectedItems:[t],expandedItems:o},setSelectedItems:c=>{i(u=>{const f=typeof c=="function"?c(u):c,h=f[0];return h!==void 0&&r[h]?.children===void 0&&h!=="root"&&n(h),f})},indent:ou,rootItemId:"root",getItemName:c=>c.getItemData().name,isItemFolder:c=>(c.getItemData()?.children?.length??0)>0,dataLoader:{getItem:c=>r[c]??{name:c,path:""},getChildren:c=>r[c]?.children??[]},features:[M1,S1,F1]});return l.jsx(Wb,{indent:ou,tree:a,children:a.getItems().map(c=>{const u=c.getItemData(),f=u.children===void 0&&u.path!=="";return l.jsx(Qb,{item:c,onClick:()=>{f&&n(u.path)},children:l.jsx(Gb,{className:"tech-ltr relative before:bg-background before:absolute before:inset-x-0 before:-inset-y-0.5 before:-z-10",children:l.jsxs("span",{className:"flex items-center gap-2",children:[z1(u,c.isExpanded()),c.getItemName()]})})},c.getId())})})},U1=()=>{const{messages:e}=ms(),[t,n]=d.useState([]),[r,o]=d.useState("SKILL.md"),[s,i]=d.useState(null),[a,c]=d.useState(null),[u,f]=d.useState(!0),[h,A]=d.useState(!1);d.useEffect(()=>{(async()=>{const p=await Yx();p.status===200?n(p.data):c(e.help.readError),f(!1)})()},[e.help.readError]),d.useEffect(()=>{A(!0),c(null),(async()=>{const p=await Ux(r);p.status===200&&"content"in p.data?i(p.data.content):(i(null),c(e.help.readError)),A(!1)})()},[r,e.help.readError]);const g=d.useMemo(()=>s===null?"":Q1(s),[s]);return l.jsxs("section",{className:"flex h-full min-h-0 overflow-hidden","aria-label":e.help.title,children:[l.jsx("nav",{className:"w-64 shrink-0 overflow-y-auto border-e border-border p-2","aria-label":e.help.listTitle,children:u?l.jsxs("div",{className:"space-y-2",children:[l.jsx(en,{className:"h-5 w-full"}),l.jsx(en,{className:"h-5 w-4/5"}),l.jsx(en,{className:"h-5 w-3/5"})]}):t.length===0?l.jsx("p",{className:"text-muted-foreground px-2 text-xs",children:e.help.empty}):l.jsx(Y1,{entries:t,selected:r,onSelect:o})}),l.jsx("article",{className:"min-h-0 min-w-0 flex-1 overflow-y-auto p-6","aria-live":"polite",children:h?l.jsxs("div",{className:"space-y-2",children:[l.jsx(en,{className:"h-6 w-1/2"}),l.jsx(en,{className:"h-4 w-full"}),l.jsx(en,{className:"h-4 w-5/6"})]}):a!==null?l.jsx("p",{className:"text-destructive text-sm",children:a}):l.jsx("div",{className:G1,dangerouslySetInnerHTML:{__html:g}})})]})},lp=e=>`/api/icon-composed/${e}?token=${encodeURIComponent(new URLSearchParams(location.search).get("token")??"")}`,V1={cwd:"",env:[],argsMode:"string",family:null},qa=new URLSearchParams(location.search).get("token")??"",Ne=(e,t={})=>fetch(e,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${qa}`},body:JSON.stringify(t)}),Z1=()=>new EventSource(`/api/events?token=${encodeURIComponent(qa)}`),Dn=(e,t,n=0)=>`/api/icon-data/${e}/${t}?g=${n}&token=${encodeURIComponent(qa)}`,Fi=e=>{try{return new URL(e).hostname}catch{return e}};function J1({values:e,defaults:t,frozen:n,iconCandidates:r,iconCandidatesPort:o,iconCandidatesGeneration:s,uploadedIconUrl:i,selectedIconRef:a,iconAnalysis:c,iconComposition:u,iconComposeError:f,iconBackground:h,iconScale:A,subjectExtracting:g,subjectStage:p,subjectSettings:x,onSubjectSettingsChange:m,onIconBackgroundChange:v,onIconScaleChange:b,onPickIconCandidate:y,onUploadIcon:C,onClearIcon:I,onPatch:w}){const S=n,R=d.useRef(null),[E,k]=d.useState(!1),[B,T]=d.useState(!1);return l.jsxs("div",{className:"grid grid-cols-1 gap-y-1",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"应用图标"}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-start gap-3",children:[l.jsx("button",{type:"button",disabled:S,"aria-label":"选择本地图片作为应用图标",onClick:()=>R.current?.click(),onDragOver:F=>{F.preventDefault(),S||k(!0)},onDragLeave:()=>k(!1),onDrop:F=>{if(F.preventDefault(),k(!1),S)return;const j=F.dataTransfer.files[0];j!==void 0&&C(j)},className:he("flex size-20 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-dashed border-border bg-popover transition-colors",S?"opacity-50":"hover:border-primary",E&&"border-primary bg-primary/10"),children:i!==void 0?l.jsx("img",{src:i,alt:"已选图标",className:"icon-checker size-full rounded object-contain"}):l.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[l.jsx(ju,{className:"size-4"}),l.jsx("span",{className:"text-[10px] leading-tight",children:"点击或拖入图片"})]})}),l.jsx("input",{ref:R,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:S,onChange:F=>{const j=F.target.files?.[0];j!==void 0&&C(j),F.target.value=""}}),l.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[r.length===0?l.jsx("span",{className:"text-xs text-muted-foreground",children:"未抓取到候选图标;将使用首字母图标"}):r.filter(F=>F.variant==="original"||F.variant==="subject").map(F=>{const j=o===void 0?void 0:Dn(o,F.index,s),D=a===`${o}:${F.index}`,H=a===void 0&&F.variant==="original"&&F.index===(r.find(_=>_.variant==="original")?.index??-1);return l.jsx("button",{type:"button",disabled:S,title:F.variant==="subject"?`AI 主体提取 ${F.width}×${F.height} ${F.format.toUpperCase()}`:`${F.width}×${F.height} ${F.format.toUpperCase()}`,onClick:()=>y(F),className:he("icon-checker flex size-14 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",D||H?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",S&&"opacity-50"),children:j!==void 0?l.jsx("img",{src:j,alt:F.variant==="subject"?`主体提取候选 ${F.width}×${F.height}`:`候选图标 ${F.width}×${F.height}`,className:"size-full object-contain"}):null},F.index)}),g?l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",role:"status",children:[l.jsx("span",{className:"inline-block size-3 animate-spin rounded-full border-2 border-muted-foreground/40 border-t-muted-foreground"}),p??"AI 提取主体中…"]}):null,l.jsx("button",{type:"button",disabled:S,"aria-expanded":B,onClick:()=>T(F=>!F),className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"AI 提取设置"})]}),B?l.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-2.5 rounded-lg border border-border p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"模型精度"}),l.jsx("div",{className:"flex gap-1.5",children:[["isnet","高精"],["isnet_fp16","标准"],["isnet_quint8","轻量"]].map(([F,j])=>l.jsx("button",{type:"button",disabled:S,"aria-pressed":x.model===F,onClick:()=>m({...x,model:F}),className:he("h-7 rounded-md border px-2.5 text-[11px] transition-colors",x.model===F?"border-foreground bg-secondary text-secondary-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:j},F))})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"去除半透明残留(alpha 阈值)"}),l.jsx("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:x.alphaThreshold===0?"关闭":x.alphaThreshold})]}),l.jsx("input",{type:"range",min:0,max:128,step:8,value:x.alphaThreshold,disabled:S,onChange:F=>m({...x,alphaThreshold:Number(F.target.value)}),className:"mt-1 w-full accent-foreground","aria-label":"主体提取 alpha 阈值"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"边缘收缩(去白边/光晕)"}),l.jsx("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:x.shrink===0?"关闭":`${x.shrink}px`})]}),l.jsx("input",{type:"range",min:0,max:6,step:1,value:x.shrink,disabled:S,onChange:F=>m({...x,shrink:Number(F.target.value)}),className:"mt-1 w-full accent-foreground","aria-label":"主体提取边缘收缩"})]}),l.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:"调整设置会自动重新提取,并替换现有主体候选及其托盘剪影。"})]}):null,a!==void 0||i!==void 0?l.jsx("button",{type:"button",disabled:S,onClick:I,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"清除选择(回到默认)"}):null]}),(a!==void 0||i!==void 0)&&l.jsx("div",{className:"mt-3 rounded-lg border border-border p-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{role:"img",className:"icon-checker size-14 shrink-0 overflow-hidden rounded-[10px]","aria-label":"图标合成预览",children:u!==void 0?l.jsx("img",{src:lp(u.key),alt:"图标合成预览",className:"size-full object-contain",onError:F=>{F.currentTarget.style.display="none"}}):l.jsx("span",{className:"flex size-full items-center justify-center text-[10px] text-muted-foreground",children:"预览"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx(Pe,{children:"图标背景"}),l.jsx("div",{className:"mt-1.5 flex gap-1.5",children:["black","white","transparent"].map(F=>l.jsxs("button",{type:"button",disabled:S,"aria-pressed":h===F,onClick:()=>v(F),className:he("flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-[11px] transition-colors",h===F?"border-foreground bg-secondary text-secondary-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:[F==="black"?"黑色":F==="white"?"白色":"透明",c!==void 0&&c.suggested===F?l.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:"自动"}):null]},F))}),l.jsxs("div",{className:"mt-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Pe,{className:"text-[11px]",children:"前景缩放"}),l.jsxs("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:[Math.round(A*100),"%"]})]}),l.jsx("input",{type:"range",min:50,max:95,step:5,value:Math.round(A*100),disabled:S,onChange:F=>b(Number(F.target.value)/100),className:"mt-1 w-full accent-foreground","aria-label":"前景图标缩放"})]}),f!==void 0?l.jsx("p",{role:"alert",className:"mt-1.5 text-[11px] font-medium text-red-400",children:f}):null,c!==void 0?l.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:h==="transparent"?"透明背景:原始像素直接透出。":`已按明暗自动选择${c.suggested===h?"":"(已手动覆盖)"}:${c.luminance===void 0?"无法分析明暗":`前景明度 ${c.luminance.toFixed(2)}、覆盖率 ${(c.coverage*100).toFixed(0)}%`}。`}):null]})]})})]}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"appId",children:"App ID"}),l.jsx(Xe,{id:"appId",className:"mt-1 font-mono",disabled:S,value:e.appId,placeholder:t.appId||"由命令推导(如 start.somecommand.npx)",onChange:F=>w({appId:F.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"appName",children:"应用名称"}),l.jsx(Xe,{id:"appName",className:"mt-1",disabled:S,value:e.appName,placeholder:t.appName||"从服务页面标题抓取",onChange:F=>w({appName:F.target.value})})]})]})}function $1({candidates:e,port:t,generation:n,disabled:r,selectedRef:o,uploadedUrl:s,includeVariants:i,defaultLabel:a,onPick:c,onUpload:u,onClear:f}){const h=d.useRef(null),[A,g]=d.useState(!1),p=i?e:e.filter(m=>m.variant==="original"),x=e.filter(m=>m.variant==="original");return l.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[l.jsx("button",{type:"button",disabled:r,"aria-label":"选择本地图片",onClick:()=>h.current?.click(),onDragOver:m=>{m.preventDefault(),r||g(!0)},onDragLeave:()=>g(!1),onDrop:m=>{if(m.preventDefault(),g(!1),r)return;const v=m.dataTransfer.files[0];v!==void 0&&u(v)},className:he("flex size-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-dashed border-border bg-popover transition-colors",r?"opacity-50":"hover:border-primary",A&&"border-primary bg-primary/10"),children:s!==void 0?l.jsx("img",{src:s,alt:"已选图标",className:"icon-checker size-full rounded object-contain"}):l.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[l.jsx(ju,{className:"size-4"}),l.jsx("span",{className:"text-[10px] leading-tight",children:"上传"})]})}),l.jsx("input",{ref:h,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:r,onChange:m=>{const v=m.target.files?.[0];v!==void 0&&u(v),m.target.value=""}}),l.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[p.length===0?l.jsx("span",{className:"text-xs text-muted-foreground",children:"暂无候选图标"}):p.map(m=>{const v=t===void 0?void 0:Dn(t,m.index,n),b=o===`${t}:${m.index}`,y=o===void 0&&m.variant==="original"&&m.index===(x[0]?.index??-1);return l.jsx("button",{type:"button",disabled:r,title:m.variant==="original"?`${m.width}×${m.height} ${m.format.toUpperCase()}`:m.variant==="subject"?`AI 主体提取 ${m.width}×${m.height} ${m.format.toUpperCase()}`:`${m.variant==="solid-black"?"黑色":"白色"}纯色 ${m.format.toUpperCase()}`,onClick:()=>c(m),className:he("icon-checker flex size-12 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",b||y?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",r&&"opacity-50"),children:v!==void 0?l.jsx("img",{src:v,alt:`候选 ${m.variant}`,className:"size-full object-contain"}):null},`${m.variant}:${m.index}`)}),a!==void 0&&o===void 0&&p.length>0?l.jsx("span",{className:"text-[11px] text-muted-foreground",children:a}):null]}),o!==void 0||s!==void 0?l.jsx("button",{type:"button",disabled:r,onClick:f,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"清除"}):null]})}function X1(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}const cp=d.createContext(null);function Jt(){const e=d.useContext(cp);if(e===null)throw new Error(st(60));return e}const q1=(e,t)=>Object.is(e,t);function sr(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Co(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:sr(r,t,n))}function eC(e,t,n){return e.filter(r=>!sr(t,r,n))}function Bi(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function up(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function tC(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(up(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function dp(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Bi(e)}function Wn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Bi(e.value):Bi(e)}function fp(e,t,n){function r(){return dp(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=t,s=up(o)?o.flatMap(i=>i.items):o;if(e==null||typeof e!="object"){const i=s.find(a=>a.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=s.find(a=>a&&a.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function nC(e,t,n){return e.reduce((r,o,s)=>(s>0&&r.push(", "),r.push(l.jsx(d.Fragment,{children:fp(o,t,n)},s)),r),[])}const we={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Wn(t,r)!==""},hasNullItemLabel:(e,t)=>t?tC(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(o=>sr(t,o,n)):sr(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function rC(e,t,n=(r,o)=>r===o){return e.length===t.length&&e.every((r,o)=>n(r,t[o]))}function yr(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const _t=1;function el(e,t){return Math.max(0,e-t)}function Lo(e,t){if(t<=0)return 0;const n=yr(e,0,t),r=n,o=t-n,s=r<=_t,i=o<=_t;return s&&i?r<=o?0:t:s?0:i?t:n}function oC(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:a,name:c,form:u,autoComplete:f,disabled:h=!1,readOnly:A=!1,required:g=!1,modal:p=!0,actionsRef:x,inputRef:m,onOpenChangeComplete:v,items:b,multiple:y=!1,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w=q1,highlightItemOnHover:S=!0,children:R}=e,{clearErrors:E}=Qi(),{setDirty:k,setTouched:B,setFocused:T,validityData:F,setFilled:j,name:D,disabled:H,validation:_,validationMode:P}=Uo(),L=Yi({id:t}),N=H||h,M=D??c,[O,G]=sn({controlled:n,default:y?r??Ot:r,name:"Select",state:"value"}),[Z,J]=sn({controlled:s,default:i,name:"Select",state:"open"}),Q=d.useRef([]),$=d.useRef([]),K=d.useRef(null),te=d.useRef(null),le=d.useRef(0),X=d.useRef(null),ee=d.useRef([]),U=d.useRef(!1),ue=d.useRef(null),se=d.useRef(null),be=d.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),re=d.useRef(!1),{mounted:Ae,setMounted:ie,transitionStatus:oe}=ir(Z),{openMethod:ce,triggerProps:me}=Od(Z),ge=Rt(()=>new zr({id:L,labelId:void 0,modal:p,multiple:y,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w,value:O,open:Z,mounted:Ae,transitionStatus:oe,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,W=Ie(ge,we.activeIndex),V=Ie(ge,we.selectedIndex),ye=Ie(ge,we.triggerElement),q=Ie(ge,we.positionerElement),ne=S0(ce),ke=ce??ne,Se=d.useMemo(()=>y?"":Wn(O,I),[y,O,I]),Qe=d.useMemo(()=>y&&Array.isArray(O)?O.map(Be=>Wn(Be,I)):Wn(O,I),[y,O,I]),tt=et(ye),Le=de(()=>Qe);zi(tt,L,O,Le,!N,c);const ht=d.useRef(O),Ke=y?Array.isArray(O)&&O.length>0:O!=null&&Se!=="";ae(()=>{j(Ke)},[Ke,j]),ae(function(){let ze=O,bt=!1;if(y){const Pt=Array.isArray(O)?O:[];bt=Pt.length===0,ze=Pt[Pt.length-1]}const Et=bt?-1:Co(ee.current,ze,w),St=Et===-1?null:Et;St===null&&(se.current=null),!Z&&ge.set("selectedIndex",St)},[y,Z,O,w,ge]);function Ge(Be){const ze=F.initialValue;return Array.isArray(Be)&&Array.isArray(ze)?!rC(Be,ze,(bt,Et)=>sr(bt,Et,w)):Be!==ze}cs(O,()=>{E(M),k(Ge(O)),_.change(O)});const ut=de((Be,ze)=>{a?.(Be,ze),!ze.isCanceled&&(J(Be),!Be&&(ze.reason===Mn||ze.reason===Go)&&(B(!0),T(!1),P==="onBlur"&&_.commit(O)))}),Re=de(()=>{ie(!1),ge.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),v?.(!1)});Ut({enabled:!x,open:Z,ref:K,onComplete(){Z||Re()}}),d.useImperativeHandle(x,()=>({unmount:Re}),[Re]);const Ue=de((Be,ze)=>{o?.(Be,ze),!ze.isCanceled&&G(Be)}),_e=de(Be=>{const ze=el(Be.scrollHeight,Be.clientHeight),bt=Lo(Be.scrollTop,ze),Et=bt>0,St=bt<ze;ge.set("scrollUpArrowVisible",Et),ge.set("scrollDownArrowVisible",St)}),nt=km({open:Z,onOpenChange:ut,elements:{reference:ye,floating:q}}),Ee=ud(nt,{enabled:!A&&!N,event:"mousedown"}),Ve=ns(nt),Ze=Bd(nt,{enabled:!A&&!N,listRef:Q,activeIndex:W,selectedIndex:V,disabledIndices:Ot,onNavigate(Be){Be===null&&!Z||ge.set("activeIndex",Be)},focusItemOnHover:S}),Je=jd(nt,{enabled:!A&&!N&&(Z||!y),listRef:$,activeIndex:W,selectedIndex:V,disabledIndices:Be=>of(Q.current[Be]),onMatch(Be){Z?ge.set("activeIndex",Be):Ue(ee.current[Be],Ce(jt))},onTyping(Be){U.current=Be}}),rt=d.useMemo(()=>Ft(Je.reference,Ze.reference,Ve.reference,Ee.reference,me),[Ee.reference,Je.reference,Ze.reference,Ve.reference,me]),it=d.useMemo(()=>Ft(ss,Je.floating,Ze.floating,Ve.floating),[Je.floating,Ze.floating,Ve.floating]),At=Ze.item??ct;X1(()=>{ge.update({popupProps:it,triggerProps:rt})}),ge.useSyncedValues({id:L,modal:p,multiple:y,value:O,open:Z,mounted:Ae,transitionStatus:oe,popupProps:it,triggerProps:rt,items:b,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w,openMethod:ke});const dt=d.useMemo(()=>({store:ge,floatingContext:nt,required:g,disabled:N,readOnly:A,multiple:y,highlightItemOnHover:S,setValue:Ue,setOpen:ut,listRef:Q,popupRef:K,scrollHandlerRef:te,handleScrollArrowVisibility:_e,scrollArrowsMountedCountRef:le,itemProps:At,valueRef:X,valuesRef:ee,labelsRef:$,typingRef:U,selectionRef:be,firstItemTextRef:ue,selectedItemTextRef:se,validation:_,onOpenChangeComplete:v,alignItemWithTriggerActiveRef:re,initialValueRef:ht}),[ge,nt,g,N,A,y,S,Ue,ut,At,_,v,_e]),xt=zt(m,_.inputRef),Mt=y?void 0:M,$t=d.useMemo(()=>!y||!Array.isArray(O)||!M?null:O.map(Be=>{const ze=Wn(Be,I);return l.jsx("input",{type:"hidden",form:u,name:M,value:ze,disabled:N},ze)}),[y,O,u,M,I,N]);return l.jsxs(cp.Provider,{value:dt,children:[R,l.jsx("input",{..._.getValidationProps(N,{onFocus(){ge.state.triggerElement?.focus({focusVisible:!0})},onChange(Be){if(Be.nativeEvent.defaultPrevented||N||A)return;const ze=Be.currentTarget.value,bt=Ce(jt,Be.nativeEvent);function Et(){if(y)return;const St=ze.toLowerCase();let Pt=ee.current.findIndex(vt=>Wn(vt,I).toLowerCase()===St||dp(vt,C).toLowerCase()===St);Pt===-1&&(Pt=ee.current.findIndex((vt,un)=>{const En=$.current[un];return En!=null&&En.toLowerCase()===St}));const Tt=ee.current[Pt];Tt!=null&&Ue(Tt,bt)}ge.set("forceMount",!0),queueMicrotask(Et)}}),id:L&&Mt==null?`${L}-hidden-input`:void 0,form:u,name:Mt,autoComplete:f,value:Se,disabled:N,required:g&&!(y&&Ke),readOnly:A,ref:xt,style:M?da:ts,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),$t]})}function sC(e,t){return e??t}const iC=400,aC={...hi,...Wi,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},lC=d.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:a=!0,style:c,...u}=t,{setTouched:f,setFocused:h,validationMode:A,state:g,disabled:p}=Uo(),{labelId:x}=Gi(),{store:m,setOpen:v,selectionRef:b,validation:y,readOnly:C,required:I,alignItemWithTriggerActiveRef:w,disabled:S}=Jt(),R=p||S||i,E=Ie(m,we.open),k=Ie(m,we.mounted),B=Ie(m,we.value),T=Ie(m,we.triggerProps),F=Ie(m,we.positionerElement),j=Ie(m,we.listElement),D=Ie(m,we.popupSide),H=Ie(m,we.id),_=Ie(m,we.labelId),P=Ie(m,we.hasSelectedValue),L=k&&F?D:null,N=s??H,M=sC(x,_);Yi({id:N});const O=et(F),G=d.useRef(null),{getButtonProps:Z,buttonRef:J}=Yt({disabled:R,native:a}),Q=m.useStateSetter("triggerElement"),$=pt(),K=pt(),te=pt();d.useEffect(()=>{if(E)return te.start(iC,()=>{b.current.allowUnselectedMouseUp=!0,b.current.allowSelectedMouseUp=!0}),()=>{te.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[E,b,K,te]);const le=Ft(T,{id:N,role:"combobox","aria-expanded":E,"aria-haspopup":"listbox","aria-controls":E?j?.id??ko(F)?.id:void 0,"aria-labelledby":M,"aria-readonly":C||void 0,"aria-required":I||void 0,tabIndex:R?-1:0,onFocus(U){h(!0),E&&w.current&&v(!1,Ce(jt,U.nativeEvent)),$.start(0,()=>{m.set("forceMount",!0)})},onBlur(U){ve(F,U.relatedTarget)||(f(!0),h(!1),A==="onBlur"&&y.commit(B))},onMouseDown(U){if(E)return;const ue=je(U.currentTarget);function se(be){if(!G.current)return;const re=be.target;ve(G.current,re)||ve(O.current,re)||ef(be,G.current)||v(!1,Ce(Su,be))}K.start(0,()=>{ue.addEventListener("mouseup",se,{once:!0})})}},u,Z),X=y.getValidationProps(R,le);X.role="combobox";const ee={...g,open:E,disabled:R,value:B,readOnly:C,popupSide:L,placeholder:!P};return Me("button",t,{ref:[n,G,J,Q],state:ee,stateAttributesMapping:aC,props:X})}),cC={value:()=>null},uC=d.forwardRef(function(t,n){const{className:r,render:o,children:s,placeholder:i,style:a,...c}=t,{store:u,valueRef:f}=Jt(),h=Ie(u,we.value),A=Ie(u,we.items),g=Ie(u,we.itemToStringLabel),p=Ie(u,we.hasSelectedValue),x=!p&&i!=null&&s==null,m=Ie(u,we.hasNullItemLabel,x),v={value:h,placeholder:!p};let b=null;return typeof s=="function"?b=s(h):s!=null?b=s:x&&!m?b=i:Array.isArray(h)?b=nC(h,A,g):b=fp(h,A,g),Me("span",t,{state:v,ref:[n,f],props:[{children:b},c],stateAttributesMapping:cC})}),dC=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=Jt(),u={open:Ie(a,we.open)};return Me("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},i],stateAttributesMapping:$u})}),fC=d.forwardRef(function(t,n){const{store:r}=Jt(),o=Ie(r,we.mounted),s=Ie(r,we.forceMount);return o||s?l.jsx(fa,{ref:n,...t}):null}),pp=d.createContext(void 0);function tl(){const e=d.useContext(pp);if(!e)throw new Error(st(59));return e}function Ko(e,t){e&&Object.assign(e.style,t)}const hp={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},pC={position:"fixed"},hC=d.forwardRef(function(t,n){const{anchor:r,className:o,render:s,positionMethod:i,side:a,align:c,sideOffset:u,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:A,arrowPadding:g,sticky:p,disableAnchorTracking:x,alignItemWithTrigger:m=!0,collisionAvoidance:v=td,style:b,...y}=t,{store:C,listRef:I,labelsRef:w,alignItemWithTriggerActiveRef:S,selectedItemTextRef:R,valuesRef:E,initialValueRef:k,popupRef:B,setValue:T,floatingContext:F}=Jt(),j=Ie(C,we.open),D=Ie(C,we.mounted),H=Ie(C,we.modal),_=Ie(C,we.value),P=Ie(C,we.openMethod),L=Ie(C,we.positionerElement),N=Ie(C,we.triggerElement),M=Ie(C,we.isItemEqualToValue),O=Ie(C,we.transitionStatus),G=d.useRef(null),Z=d.useRef(null),[J,Q]=d.useState(m),$=D&&J&&P!=="touch";!D&&J!==m&&Q(m),d.useImperativeHandle(S,()=>$),Xd(($||H)&&j,P==="touch",L,N);const K=Ma({anchor:r,floatingRootContext:F,positionMethod:i,mounted:D,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:A,sticky:p,disableAnchorTracking:x??$,collisionAvoidance:v,keepMounted:!0}),te=$?"none":K.side,le=$?pC:K.positionerStyles,X={open:j,side:te,align:K.align,anchorHidden:K.anchorHidden};ae(()=>{C.set("popupSide",K.side)},[C,K.side]);const ee=C.useStateSetter("positionerElement"),U=Pa(t,X,{styles:le,transitionStatus:O,props:y,refs:[n,ee],hidden:!D,inert:!j}),ue=d.useRef(0),se=de(re=>{if(E.current.length===0)return;const Ae=ue.current;if(ue.current=re.size,re.size===Ae)return;const ie=Ce(jt);if(Ae!==0&&!C.state.multiple&&_!==null&&Co(E.current,_,M)===-1){const ce=k.current,ge=ce!=null&&Co(E.current,ce,M)!==-1?ce:null;T(ge,ie),ge===null&&(C.set("selectedIndex",null),R.current=null)}if(Ae!==0&&C.state.multiple&&Array.isArray(_)){const oe=_.filter(ce=>Co(E.current,ce,M)!==-1);oe.length!==_.length&&(T(oe,ie),oe.length===0&&(C.set("selectedIndex",null),R.current=null))}if(j&&$){C.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const oe={height:""};Ko(L,oe),Ko(B.current,oe)}}),be=d.useMemo(()=>({...K,side:te,alignItemWithTriggerActive:$,setControlledAlignItemWithTrigger:Q,scrollUpArrowRef:G,scrollDownArrowRef:Z}),[K,te,$,Q]);return l.jsx(Vr,{elementsRef:I,labelsRef:w,onMapChange:se,children:l.jsxs(pp.Provider,{value:be,children:[D&&H&&l.jsx(Fa,{inert:Da(!j),cutout:N}),U]})})}),ho="base-ui-disable-scrollbar",ji={className:ho,getElement(e){return l.jsx("style",{nonce:e,href:ho,precedence:"base-ui:low",children:`.${ho}{scrollbar-width:none}.${ho}::-webkit-scrollbar{display:none}`})}},gC=d.createContext(void 0),AC={disableStyleElements:!1};function mC(){return d.useContext(gC)??AC}const xC={...Qr,...On},bC=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c,popupRef:u,onOpenChangeComplete:f,setOpen:h,valueRef:A,firstItemTextRef:g,selectedItemTextRef:p,multiple:x,handleScrollArrowVisibility:m,scrollHandlerRef:v,listRef:b,highlightItemOnHover:y,floatingContext:C}=Jt(),{side:I,align:w,alignItemWithTriggerActive:S,isPositioned:R,setControlledAlignItemWithTrigger:E}=tl(),k=Na()!=null,B=us(),{nonce:T,disableStyleElements:F}=mC(),j=Ie(c,we.id),D=Ie(c,we.open),H=Ie(c,we.openMethod),_=Ie(c,we.mounted),P=Ie(c,we.popupProps),L=Ie(c,we.transitionStatus),N=Ie(c,we.triggerElement),M=Ie(c,we.positionerElement),O=Ie(c,we.listElement),G=d.useRef(!1),Z=d.useRef(!1),J=d.useRef({}),Q=er(),$=de(X=>{if(!M||!u.current||!Z.current)return;const ee=M.style.top==="0px",U=M.style.bottom==="0px";if(G.current||!S||!ee&&!U){m(X);return}const ue=iu(M),se=Cr(M.getBoundingClientRect().height,"y",ue),be=je(M),re=ot(M),Ae=re.getComputedStyle(M),ie=parseFloat(Ae.marginTop),oe=parseFloat(Ae.marginBottom),ce=su(re.getComputedStyle(u.current)),me=Math.min(be.documentElement.clientHeight-ie-oe,ce),ge=X.scrollTop,W=go(X);let V=null;const ye=Se=>{M.style.height=`${Se}px`},q=ee?W-ge:ge,ne=Math.min(se+q,me);if(q<=_t){const Se=yr(q,0,me-se);Se>0&&ye(se+Se),X.scrollTop=ee?W:0,me-(se+Se)<=_t&&(G.current=!0),m(X);return}if(me-ne>_t)V=ee?1/0:0;else if(U&&ge<W){const Se=se+q-me;V=ge-(q-Se)}const ke=Math.ceil(ne);if(ke!==0&&ye(ke),V!=null){const Se=yr(V,0,go(X));Math.abs(X.scrollTop-Se)>_t&&(X.scrollTop=Se)}ke>=me-_t&&(G.current=!0),m(X)});d.useImperativeHandle(v,()=>$,[$]),Ut({open:D,ref:u,onComplete(){D&&f?.(!0)}});const K={open:D,transitionStatus:L,side:I,align:w};ae(()=>{!M||!u.current||Object.keys(J.current).length||(J.current={top:M.style.top||"0",left:M.style.left||"0",right:M.style.right,height:M.style.height,bottom:M.style.bottom,minHeight:M.style.minHeight,maxHeight:M.style.maxHeight,marginTop:M.style.marginTop,marginBottom:M.style.marginBottom})},[u,M]),ae(()=>{D||S||(Z.current=!1,G.current=!1,Ko(M,J.current))},[D,S,M,u]),ae(()=>{const X=u.current;if(!D||!N||!M||!X||S&&!R||c.state.transitionStatus==="ending")return;if(Z.current=!0,X.style.removeProperty("--transform-origin"),!S){Q.request(()=>m(O||X));return}const ee=vC(X);try{let U=p.current;U?.isConnected||(U=!we.hasSelectedValue(c.state)&&g.current?.isConnected?g.current:null);const ue=A.current,se=ot(M),be=se.getComputedStyle(M),re=se.getComputedStyle(X),Ae=je(N),ie=iu(N),oe=Ao(N.getBoundingClientRect(),ie),ce=Ao(M.getBoundingClientRect(),ie),me=oe.height,ge=O||X,W=ge.scrollHeight,V=parseFloat(re.borderBottomWidth),ye=parseFloat(be.marginTop)||10,q=parseFloat(be.marginBottom)||10,ne=parseFloat(be.minHeight)||100,ke=su(re),Se=5,Qe=5,tt=20,Le=Ae.documentElement.clientHeight-ye-q,ht=Ae.documentElement.clientWidth,Ke=Le-oe.bottom+me;let Ge,ut=B==="rtl"?oe.right-ce.width:oe.left,Re=0;if(U&&ue){const dt=Ao(ue.getBoundingClientRect(),ie);Ge=Ao(U.getBoundingClientRect(),ie),ut=ce.left+(B==="rtl"?dt.right-Ge.right:dt.left-Ge.left);const xt=dt.top-oe.top+dt.height/2;Re=Ge.top-ce.top+Ge.height/2-xt}const Ue=Ke+Re+q+V;let _e=Math.min(Le,Ue);const nt=Le-ye-q,Ee=Ue-_e,Ve=ht-Qe;M.style.left=`${yr(ut,Se,Ve-ce.width)}px`,M.style.height=`${_e}px`,M.style.maxHeight="none",M.style.marginTop=`${ye}px`,M.style.marginBottom=`${q}px`,X.style.height="100%";const Ze=go(ge),Je=Ee>=Ze-_t;Je&&(_e=Math.min(Le,ce.height)-(Ee-Ze));const rt=oe.top<tt||oe.bottom>Le-tt||Math.ceil(_e)+_t<Math.min(W,ne),it=(se.visualViewport?.scale??1)!==1&&ln;if(rt||it){Ko(M,J.current),E(!1);return}const At=Math.max(ne,_e);if(Je){const dt=Math.max(0,Le-Ue);M.style.top=ce.height>=nt?"0":`${dt}px`,M.style.height=`${_e}px`,ge.scrollTop=go(ge)}else M.style.bottom="0",ge.scrollTop=Ee;if(Ge){const dt=ce.top,xt=ce.height,Mt=Ge.top+Ge.height/2,$t=yr(xt>0?(Mt-dt)/xt*100:50,0,100);X.style.setProperty("--transform-origin",`50% ${$t}%`)}(At===Le||_e>=ke)&&(G.current=!0),m(ge),y&&c.state.selectedIndex===null&&c.state.activeIndex===null&&b.current[0]!=null&&c.set("activeIndex",0)}finally{ee()}},[c,D,M,N,A,g,p,u,m,S,E,Q,O,b,y,B,R]),d.useEffect(()=>{if(!S||!M||!D)return;const X=ot(M);function ee(U){h(!1,Ce(sh,U))}return De(X,"resize",ee)},[h,S,M,D]);const te={...O?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":x||void 0,id:`${j}-list`},onKeyDown(X){k&&as.has(X.key)&&X.stopPropagation()},onScroll(X){O||$(X.currentTarget)},...S&&{style:O?{height:"100%"}:hp},className:!O&&S?ji.className:void 0},le=Me("div",t,{ref:[n,u],state:K,stateAttributesMapping:xC,props:[P,te,ds(L),a]});return l.jsxs(d.Fragment,{children:[!F&&ji.getElement(T),l.jsx(ga,{context:C,modal:!1,disabled:!_,openInteractionType:H,returnFocus:i,restoreFocus:!0,children:le})]})});function su(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function go(e){return el(e.scrollHeight,e.clientHeight)}function iu(e){return Ad.getScale(e)}function Cr(e,t,n){return e/n[t]}function Ao(e,t){return Fr({x:Cr(e.x,"x",t),y:Cr(e.y,"y",t),width:Cr(e.width,"x",t),height:Cr(e.height,"y",t)})}const au=[["transform","none"],["scale","1"],["translate","0 0"]];function vC(e){const{style:t}=e,n={};for(const[r,o]of au)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of au){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const yC=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a,scrollHandlerRef:c,multiple:u}=Jt(),{alignItemWithTriggerActive:f}=tl(),h=Ie(a,we.hasScrollArrows),A=Ie(a,we.openMethod),p={id:`${Ie(a,we.id)}-list`,role:"listbox","aria-multiselectable":u||void 0,onScroll(m){c.current?.(m.currentTarget)},...f&&{style:hp},className:h&&A!=="touch"?ji.className:void 0},x=a.useStateSetter("listElement");return Me("div",t,{ref:[n,x],props:[p,i]})}),gp=d.createContext(void 0);function nl(){const e=d.useContext(gp);if(!e)throw new Error(st(57));return e}const CC=d.memo(d.forwardRef(function(t,n){const{render:r,className:o,style:s,value:i=null,label:a,disabled:c=!1,nativeButton:u=!1,...f}=t,h=d.useRef(null),A=As({guess:!0,label:a,textRef:h}),{store:g,itemProps:p,setOpen:x,setValue:m,selectionRef:v,typingRef:b,valuesRef:y,multiple:C,selectedItemTextRef:I,disabled:w,readOnly:S}=Jt(),R=w||c,E=Ie(g,we.isActive,A.index),k=Ie(g,we.open),B=Ie(g,we.isSelected,i),T=Ie(g,we.isSelectedByFocus,A.index),F=Ie(g,we.isItemEqualToValue),j=A.index,D=d.useRef(null);ae(()=>{const Q=y.current;return Q[j]=i,()=>{delete Q[j]}},[j,i,y]),ae(()=>{const Q=g.state.value;let $=Q;C&&Array.isArray(Q)&&($=Q.length>0?Q[Q.length-1]:void 0),$!==void 0&&sr(i,$,F)&&(g.set("selectedIndex",j),h.current&&(I.current=h.current))},[j,C,F,g,i,I]);const H=d.useRef("mouse"),_=d.useRef(!1),{getButtonProps:P,buttonRef:L}=Yt({disabled:R,focusableWhenDisabled:!0,native:u,composite:!0}),N={disabled:R,selected:B,highlighted:E};function M(Q){if(w||S)return;const $=g.state.value;if(C){const K=Array.isArray($)?$:[],te=B?eC(K,i,F):[...K,i];m(te,Ce(Ir,Q))}else m(i,Ce(Ir,Q)),x(!1,Ce(Ir,Q))}function O(){v.current.dragY=0}const G={role:"option","aria-selected":B,tabIndex:k&&E?0:-1,onKeyDown(Q){g.set("activeIndex",j),Q.key===" "&&b.current&&Q.preventDefault()},onClick(Q){const $=H.current!=="touch",K=Q.nativeEvent.pointerType,te=$&&qi(Q.nativeEvent)&&(K!==void 0||E),le=$&&!te&&!_.current;_.current=!1,!(R||le)&&M(Q.nativeEvent)},onPointerEnter(Q){H.current=Q.pointerType},onPointerMove(Q){if(Q.pointerType==="mouse"&&Q.buttons===1){const $=v.current;$.dragY+=Q.movementY,$.dragY**2>=64&&($.allowUnselectedMouseUp=!0)}},onPointerDown(Q){H.current=Q.pointerType,_.current=!0,O()},onMouseUp(){if(O(),R||H.current==="touch"||_.current)return;const Q=!v.current.allowSelectedMouseUp&&B,$=!v.current.allowUnselectedMouseUp&&!B;Q||$||(_.current=!0,D.current?.click(),_.current=!1)}},Z=Me("div",t,{ref:[L,n,A.ref,D],state:N,props:[p,G,f,P]}),J=d.useMemo(()=>({selected:B,index:j,textRef:h,selectedByFocus:T}),[B,j,h,T]);return l.jsx(gp.Provider,{value:J,children:Z})})),IC=d.forwardRef(function(t,n){const{selected:r}=nl();return t.keepMounted||r?l.jsx(wC,{...t,ref:n}):null}),wC=d.memo(d.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:a}=nl(),c=d.useRef(null),{transitionStatus:u,setMounted:f}=ir(a),A=Me("span",e,{ref:[t,c],state:{selected:a,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:On});return Ut({open:a,ref:c,onComplete(){a||f(!1)}}),A})),kC=d.memo(d.forwardRef(function(t,n){const{index:r,textRef:o,selectedByFocus:s}=nl(),{firstItemTextRef:i,selectedItemTextRef:a}=Jt(),{render:c,className:u,style:f,...h}=t,A=d.useCallback(p=>{p&&(r===0&&(i.current=p),s&&(a.current=p))},[i,a,r,s]);return Me("div",t,{ref:[A,n,o],props:h})})),Ap=d.forwardRef(function(t,n){const{render:r,className:o,style:s,direction:i,keepMounted:a,...c}=t,u=i==="up",{store:f,popupRef:h,listRef:A,handleScrollArrowVisibility:g,scrollArrowsMountedCountRef:p}=Jt(),{side:x,scrollDownArrowRef:m,scrollUpArrowRef:v}=tl(),b=u?we.scrollUpArrowVisible:we.scrollDownArrowVisible,y=Ie(f,b),C=Ie(f,we.openMethod),I=y&&C!=="touch",w=pt(),S=u?v:m,{mounted:R,transitionStatus:E,setMounted:k}=ir(I);ae(()=>(p.current+=1,f.set("hasScrollArrows",!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&f.set("hasScrollArrows",!1)}),[f,p]),Ut({open:I,ref:S,onComplete(){I||k(!1)}});const F=Me("div",t,{ref:[n,S],state:{direction:i,visible:I,side:x,transitionStatus:E},props:[{"aria-hidden":!0,children:u?"▲":"▼",style:{position:"absolute"},onMouseMove(D){if(D.movementX===0&&D.movementY===0||w.isStarted())return;f.set("activeIndex",null);function H(){const _=f.state.listElement??h.current;if(!_)return;f.set("activeIndex",null),g(_);const P=el(_.scrollHeight,_.clientHeight),L=Lo(_.scrollTop,P),N=L===(u?0:P),M=A.current;if(L!==_.scrollTop&&(_.scrollTop=L),N){w.clear();return}if(M.length>0){const O=S.current?.offsetHeight||0;_.scrollTop=EC(M,u,L,_.clientHeight,O,P)}w.start(40,H)}w.start(40,H)},onMouseLeave(){w.clear()}},c],stateAttributesMapping:On});return R||a?F:null});function EC(e,t,n,r,o,s){if(t){let f=0;const h=n+o-_t;for(let p=0;p<e.length;p+=1){const x=e[p];if(x&&x.offsetTop>=h){f=p;break}}const A=Math.max(0,f-1),g=e[A];return A<f&&g?Lo(g.offsetTop-o,s):0}let i=e.length-1;const a=n+r-o+_t;for(let f=0;f<e.length;f+=1){const h=e[f];if(h&&h.offsetTop+h.offsetHeight>a){i=Math.max(0,f-1);break}}const c=Math.min(e.length-1,i+1),u=e[c];return c>i&&u?Lo(u.offsetTop+u.offsetHeight-r+o,s):s}const SC=d.forwardRef(function(t,n){return l.jsx(Ap,{...t,ref:n,direction:"down"})}),RC=d.forwardRef(function(t,n){return l.jsx(Ap,{...t,ref:n,direction:"up"})}),DC=oC;function FC({className:e,...t}){return l.jsx(uC,{"data-slot":"select-value",className:he("flex flex-1 text-left",e),...t})}function BC({className:e,size:t="default",children:n,...r}){return l.jsxs(lC,{"data-slot":"select-trigger","data-size":t,className:he("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none 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 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,l.jsx(dC,{render:l.jsx(_n,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function jC({className:e,children:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:s=0,alignItemWithTrigger:i=!0,...a}){return l.jsx(fC,{children:l.jsx(hC,{side:n,sideOffset:r,align:o,alignOffset:s,alignItemWithTrigger:i,className:"isolate z-50",children:l.jsxs(bC,{"data-slot":"select-content","data-align-trigger":i,className:he("cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[l.jsx(MC,{}),l.jsx(yC,{children:t}),l.jsx(PC,{})]})})})}function qs({className:e,children:t,...n}){return l.jsxs(CC,{"data-slot":"select-item",className:he("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[l.jsx(kC,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),l.jsx(IC,{render:l.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:l.jsx(Ui,{className:"pointer-events-none"})})]})}function MC({className:e,...t}){return l.jsx(RC,{"data-slot":"select-scroll-up-button",className:he("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:l.jsx(Vi,{})})}function PC({className:e,...t}){return l.jsx(SC,{"data-slot":"select-scroll-down-button",className:he("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:l.jsx(_n,{})})}const mp=d.createContext(void 0);function TC(){const e=d.useContext(mp);if(e===void 0)throw new Error(st(63));return e}const xp={...Wi,checked(e){return e?{"data-checked":""}:{"data-unchecked":""}}},NC=d.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s,"aria-labelledby":i,form:a,id:c,inputRef:u,name:f,nativeButton:h=!1,onCheckedChange:A,readOnly:g=!1,required:p=!1,disabled:x=!1,render:m,uncheckedValue:v,value:b,style:y,...C}=t,{clearErrors:I}=Qi(),{state:w,setTouched:S,setDirty:R,validityData:E,setFilled:k,setFocused:B,validationMode:T,disabled:F,name:j,validation:D}=Uo(),{labelId:H}=Gi(),_=F||x,P=j??f,L=d.useRef(null),N=zt(L,u,D.inputRef),M=d.useRef(null),O=wt(),G=Yi({id:c,implicit:!1,controlRef:M}),Z=h?void 0:G,[J,Q]=sn({controlled:r,default:!!s,name:"Switch",state:"checked"});zi(M,O,J,void 0,!_,f),ae(()=>{L.current&&k(L.current.checked)},[k]),cs(J,()=>{I(P),R(J!==E.initialValue),k(J),D.change(J)});const{getButtonProps:$,buttonRef:K}=Yt({disabled:_,native:h}),te=Mu(i,H,L,!h,Z),le={id:h?G:O,role:"switch","aria-checked":J,"aria-readonly":g||void 0,"aria-required":p||void 0,"aria-labelledby":te,onFocus(){_||B(!0)},onBlur(){const ue=L.current;!ue||_||(S(!0),B(!1),T==="onBlur"&&D.commit(ue.checked))},onClick(ue){if(g||_)return;ue.preventDefault();const se=L.current;se&&Li(se,ue)}},X={...D.getValidationProps(_),checked:J,disabled:_,form:a,id:Z,name:P,required:p,style:P?da:ts,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:N,onChange(ue){if(ue.nativeEvent.defaultPrevented)return;if(g){ue.preventDefault();return}const se=ue.currentTarget.checked,be=Ce(jt,ue.nativeEvent);A?.(se,be),!be.isCanceled&&Q(se)},onClick(ue){ue.stopPropagation()},onFocus(){M.current?.focus()},...b!==void 0?{value:b}:ct},ee=d.useMemo(()=>({...w,checked:J,disabled:_,readOnly:g,required:p}),[w,J,_,g,p]),U=Me("span",t,{state:ee,ref:[n,M,K],props:[le,C,$,ue=>D.getValidationProps(_,ue)],stateAttributesMapping:xp});return l.jsxs(mp.Provider,{value:ee,children:[U,!J&&P&&v!==void 0&&l.jsx("input",{type:"hidden",form:a,name:P,value:v,disabled:_}),l.jsx("input",{...X,suppressHydrationWarning:!0})]})}),_C=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=TC();return Me("span",t,{state:a,ref:n,stateAttributesMapping:xp,props:i})});function dr({className:e,size:t="default",...n}){return l.jsx(NC,{"data-slot":"switch","data-size":t,className:he("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent 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-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:l.jsx(_C,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function OC({frozen:e,values:t,defaults:n,candidates:r,candidatesPort:o,candidatesGeneration:s,selectedIconRef:i,uploadedIconUrl:a,iconAnalysis:c,iconComposition:u,iconComposeError:f,iconBackground:h,iconScale:A,subjectExtracting:g,subjectStage:p,subjectSettings:x,onSubjectSettingsChange:m,onIconBackgroundChange:v,onIconScaleChange:b,selectedTrayRef:y,uploadedTrayUrl:C,selectedPort:I,targetDirExists:w,onPickIconCandidate:S,onUploadIcon:R,onClearIcon:E,onPickTray:k,onUploadTray:B,onClearTray:T,onPatch:F,onConfirm:j}){return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsx(J1,{values:t,defaults:n,frozen:e,iconCandidates:r,iconCandidatesPort:o,iconCandidatesGeneration:s,uploadedIconUrl:a,selectedIconRef:i,iconAnalysis:c,iconComposition:u,iconComposeError:f,iconBackground:h,iconScale:A,subjectExtracting:g,...p===void 0?{}:{subjectStage:p},subjectSettings:x,onSubjectSettingsChange:m,onIconBackgroundChange:v,onIconScaleChange:b,onPickIconCandidate:S,onUploadIcon:R,onClearIcon:E,onPatch:F}),l.jsx(La,{className:"mt-4 border-t border-border pt-1",children:l.jsxs(Ka,{value:"advanced",className:"border-b-0",children:[l.jsx(Wa,{children:"高级选项"}),l.jsxs(Qa,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(dr,{id:"showStartupTerminal",checked:t.showStartupTerminal,disabled:e,onCheckedChange:D=>F({showStartupTerminal:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"showStartupTerminal",className:"text-foreground",children:"显示启动终端"}),l.jsxs("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:[l.jsx(Rr,{className:"mr-0.5 inline size-3"}),"应用启动时打开独立终端窗口,实时显示命令的 PTY 输出(可交互)。"]})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(dr,{id:"showAddressBar",checked:t.showAddressBar,disabled:e,onCheckedChange:D=>F({showAddressBar:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"showAddressBar",className:"text-foreground",children:"显示地址栏"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"服务窗口顶部显示地址栏(Web Navigation API 管理导航)。"})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(dr,{id:"imageSmoothingEnabled",checked:t.imageSmoothingEnabled,disabled:e,onCheckedChange:D=>F({imageSmoothingEnabled:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"imageSmoothingEnabled",className:"text-foreground",children:"平滑缩放(imageSmoothingEnabled)"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"默认开启高质量缩放;上传低分辨率像素风图标时关闭可保留硬边锯齿(等比放大应用到应用图标前景与托盘图标)。"})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(dr,{id:"developerMode",checked:t.developerMode,disabled:e,onCheckedChange:D=>F({developerMode:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"developerMode",className:"text-foreground",children:"允许开发者模式"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"仅表示生成应用内的 WebView DevTools 准入;不改变其它行为。"})]})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"托盘图标"}),l.jsx("p",{className:"mb-1.5 mt-0.5 text-[11px] text-muted-foreground",children:"默认与应用图标一致;纯色候选适合系统托盘(macOS 模板风格)。"}),l.jsx($1,{candidates:r,port:o,generation:s,disabled:e,selectedRef:y,uploadedUrl:C,includeVariants:!0,defaultLabel:"默认跟随应用图标",onPick:k,onUpload:B,onClear:T})]}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"pm",children:"包管理器"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"仅为生成的应用安装依赖时使用的工具(决定 install 命令与锁文件形态),不影响应用本身的运行方式——生成的应用始终以 Node 启动。默认自动跟随你启动向导所用的包管理器,一般无需修改。"}),l.jsxs(DC,{value:t.pm,disabled:e,onValueChange:D=>F({pm:D}),children:[l.jsx(BC,{id:"pm",className:"mt-0",children:l.jsx(FC,{})}),l.jsxs(jC,{children:[l.jsx(qs,{value:"npm",children:"npm"}),l.jsx(qs,{value:"pnpm",children:"pnpm"}),l.jsx(qs,{value:"bun",children:"bun"})]})]})]}),l.jsxs("div",{className:"rounded-lg border border-border p-3",children:[l.jsx(Pe,{children:"生成位置"}),l.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:n.targetDir||"~/.opentray/create/<应用名>"}),l.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"生成的项目默认落在 OpenTray 主目录下,同一命令重复创建会落到同一位置; 也可在启动向导时通过位置参数指定其他目录。"}),w?l.jsx("p",{className:"mt-2 text-[11px] font-medium text-amber-400",children:"目标目录已存在且非空——继续生成会失败,或开启下方强制覆盖。"}):null,l.jsxs("div",{className:"mt-3 flex items-start gap-3",children:[l.jsx(dr,{id:"force-overwrite",checked:t.force,disabled:e,onCheckedChange:D=>F({force:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"force-overwrite",className:"text-foreground",children:"强制覆盖已存在的目录"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"开启后将清空目标目录内的现有内容并重新生成(等同 --force)。请确认目录中没有你需要的文件。"})]})]})]})]})]})}),l.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[l.jsx(Oe,{onClick:j,disabled:e,children:"确定创建应用"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:I!==void 0?`已选服务 :${I}(点击状态栏服务可切换)`:"未运行也不影响:应用启动时会自行嗅探命令的监听端口"})]})]})}var mo={},ei,lu;function HC(){if(lu)return ei;lu=1;var e=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],t=/[\n\r\u2028\u2029]/,n=/[\s#!"$&'():;<=>@\\^`|]/g;return ei=function(o){return o.map(function(s){if(s==="")return"''";if(s&&typeof s=="object"){if("op"in s&&s.op==="glob"){if(typeof s.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(t.test(s.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return s.pattern.replace(n,"\\$&")}if("op"in s&&typeof s.op=="string"){if(e.indexOf(s.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(s.op));return s.op.replace(/[\s\S]/g,"\\$&")}if("comment"in s&&typeof s.comment=="string"){if(t.test(s.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+s.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(s)&&!/'/.test(s)?"'"+s.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(s)?'"'+s.replace(/(["\\$`!])/g,"\\$1")+'"':String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},ei}var ti,cu;function LC(){if(cu)return ti;cu=1;for(var e="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",t=new RegExp("^"+e+"$"),n="|&;()<> \\t",r="'([^']*?)'",o='"((\\\\"|[^"])*?)"',s=/^#$/,i="'",a='"',c="$",u="",f=4294967296,h=0;h<4;h++)u+=(f*Math.random()).toString(16);var A=new RegExp("^"+u);function g(m,v){for(var b=v.lastIndex,y=[],C;C=v.exec(m);)y[y.length]=C,v.lastIndex===C.index&&(v.lastIndex+=1);return v.lastIndex=b,y}function p(m,v,b){var y=typeof m=="function"?m(b):m[b];return typeof y>"u"&&b!=""?y="":typeof y>"u"&&(y="$"),typeof y=="object"?v+u+JSON.stringify(y)+u:v+y}function x(m,v,b){b||(b={});var y=b.escape||"\\",C=b.splitUnquoted===!0?`
|
|
21
|
-
`:typeof
|
|
22
|
-
`?0:1:
|
|
23
|
-
`&&(H+=1)}}else F+=M}}if(_)return{op:"glob",pattern:F};if(C){if(H!==null&&H>0){j[j.length]=F,F="";for(var Q=1;Q<H;Q+=1)j[j.length]=""}return(F!==""||D&&j.length===0)&&(j[j.length]=F),j}return F}).reduce(function(E,k){return typeof k>"u"||[].concat(k).forEach(function(B){E[E.length]=B}),E},[])}return ti=function(v,b,y){var C=x(v,b,y);return typeof b!="function"?C:C.reduce(function(I,w){if(typeof w=="object")return I[I.length]=w,I;var S=w.split(RegExp("("+u+".*?"+u+")","g"));return S.length===1?(I[I.length]=S[0],I):(S.filter(Boolean).forEach(function(R){I[I.length]=A.test(R)?JSON.parse(R.split(u)[1]):R}),I)},[])},ti}var uu;function KC(){return uu||(uu=1,mo.quote=HC(),mo.parse=LC()),mo}var WC=KC();const bp=["npm","go","rust","python","dotnet","custom"],hn={npm:"npm",go:"Go",rust:"Rust",python:"Python",dotnet:".NET",custom:"自定义"},QC={npm:"npmjs",go:"golang",rust:"rust",python:"python",dotnet:"dotnet"},vp=["npx","pnpx","bunx","yarn dlx","nubx","deno run","vpx"],GC=["uvx","pipx run"],yp={family:"npm",runner:"npx",runnerFlags:"",pkg:"",version:"",args:"",binary:"",raw:""},rl=e=>{if(/["']/.test(e)){const r=(e.match(/'/gu)??[]).length,o=(e.match(/"/gu)??[]).length;if(r%2===1||o%2===1)return[]}const t=WC.parse(e),n=[];for(const r of t){if(typeof r!="string")return[];n.push(r)}return n.length===0?[]:n},ol=e=>e.startsWith("-")&&e.length>1,Fn=e=>{const t=e.lastIndexOf("@");return t>0?{base:e.slice(0,t),version:e.slice(t+1)}:{base:e,version:""}},zn=e=>e.map(t=>t.trim()).filter(t=>t.length>0).join(" "),fr=(e,t)=>{if(t.trim().length===0)return e;const{version:n}=Fn(e);return n.length>0?e:`${e}@${t.trim()}`},zC=e=>/^(npm|jsr):/.test(e)?e:`npm:${e}`,YC=/^[A-Za-z0-9@._/:+=-]+$/u,UC=e=>YC.test(e)&&e.length>0?e:`'${e.replaceAll("'","'\\''")}'`,Rn=e=>e.map(UC).join(" "),pr=e=>{const t=[];let n=0;for(;n<e.length&&ol(e[n]??"");)t.push(e[n]??""),n+=1;return{flags:t,rest:e.slice(n)}},VC=[new Set(["-A","--allow-all","--allow-read","--allow-write","--allow-net","--allow-env","--allow-run","--allow-sys","--allow-ffi","--allow-hrtime","--no-check","--no-remote","--quiet","-q","--cached-only"]),new Set(["-y","--yes"])],ZC=e=>e.includes("=")?!1:VC.some(t=>t.has(e)),hr=e=>e.every(t=>ZC(t)),JC=(e,t)=>{const n=t.split(" ");if(e.length<n.length)return-1;for(let r=0;r<n.length;r+=1)if((e[r]??"")!==(n[r]??""))return-1;return n.length},gn=e=>({...yp,...e}),gr=e=>gn({family:"custom",raw:Rn(e)}),$C=e=>{const t=e[0]??"",n=e[1]??"";for(const r of vp){const o=JC(e,r);if(o>0){const{flags:s,rest:i}=pr(e.slice(o));if(!hr(s))return gr(e);const a=i[0]??"",{base:c,version:u}=a.length>0?Fn(a):{base:"",version:""};return gn({family:"npm",runner:r,runnerFlags:s.join(" "),pkg:c,version:u,args:Rn(i.slice(1)),raw:e.join(" ")})}}if(t==="go"&&n==="run"){const{flags:r,rest:o}=pr(e.slice(2));if(!hr(r))return gr(e);const s=o[0]??"",{base:i,version:a}=s.length>0?Fn(s):{base:"",version:""};return gn({family:"go",runner:"",runnerFlags:r.join(" "),pkg:i,version:a,args:Rn(o.slice(1)),raw:e.join(" ")})}if(t==="cargo"&&n==="install"){const{flags:r,rest:o}=pr(e.slice(2));if(!hr(r))return gr(e);const s=o[0]??"",i=s.length>0?Fn(s).base:"";return gn({family:"rust",runner:"",runnerFlags:r.join(" "),pkg:i,args:Rn(o.slice(1)),raw:e.join(" ")})}if(t==="uvx"||t==="pipx"&&n==="run"){const r=t==="uvx"?1:2,{flags:o,rest:s}=pr(e.slice(r));if(!hr(o))return gr(e);const i=s[0]??"",{base:a,version:c}=i.length>0?Fn(i):{base:"",version:""};return gn({family:"python",runner:t==="uvx"?"uvx":"pipx run",runnerFlags:o.join(" "),pkg:a,version:c,args:Rn(s.slice(1)),raw:e.join(" ")})}if(t==="dnx"){const{flags:r,rest:o}=pr(e.slice(1));if(!hr(r))return gr(e);const s=o[0]??"",{base:i,version:a}=s.length>0?Fn(s):{base:"",version:""};return gn({family:"dotnet",runner:"",runnerFlags:r.join(" "),pkg:i,version:a,args:Rn(o.slice(1)),raw:e.join(" ")})}return gn({family:"custom",raw:Rn(e)})},XC=e=>{const t=rl(e);return t.length===0?gn({family:"custom",raw:e}):$C(t)},Cp=e=>{const t=e.pkg.trim(),n=e.binary.trim().length>0?e.binary.trim():t;return{install:zn(["cargo","install",e.runnerFlags,t]),run:zn([n,e.args])}},Mi=e=>{switch(e.family){case"custom":return e.raw.trim();case"rust":return Cp(e).run;case"npm":{const t=e.runner==="deno run"?zC(fr(e.pkg.trim(),e.version)):fr(e.pkg.trim(),e.version);return zn([e.runner,e.runnerFlags,t,e.args])}case"go":return zn(["go","run",e.runnerFlags,fr(e.pkg.trim(),e.version),e.args]);case"python":return zn([e.runner,e.runnerFlags,fr(e.pkg.trim(),e.version),e.args]);case"dotnet":return zn(["dnx",e.runnerFlags,fr(e.pkg.trim(),e.version),e.args])}},Ar=(e,t)=>{const n=e.trim().replace(/^(npm|jsr):/,""),r=n.split(/[/\\]/).filter(i=>i.length>0&&!i.startsWith("@")),o=r[r.length-1]??n;let s=Fn(o).base.toLowerCase();return t==="python"&&(s=s.replace(/[._]/g,"-")),s.replace(/[^a-z0-9-]/g,"")},mr=e=>{const t=[];for(const n of rl(e)){if(ol(n))break;const r=n.toLowerCase().replace(/[^a-z0-9-]/g,"");if(r.length===0)break;t.push(r)}return t},qC=e=>{if(e.family==="custom"){const i=[];for(const u of rl(e.raw)){if(ol(u))break;i.push(u)}const a=i.map(u=>{const f=u.split(/[/\\]/).filter(h=>h.length>0);if(f.some(h=>h.startsWith("@"))){const h=f.filter(A=>!A.startsWith("@"));return(h[h.length-1]??"").split("@")[0]??""}return(f[f.length-1]??u).split("@")[0]??""}).filter(u=>u.length>0).reverse(),c=a.length>0?a.join("."):"app.opentray";return{appId:c,appName:c==="app.opentray"?"Opentray App":c.split(".").filter(u=>u.length>0).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join(" "),identitySegments:a,tail:""}}const t=QC[e.family];let n;switch(e.family){case"npm":n=[...mr(e.args),Ar(e.pkg,"npm")];break;case"go":n=[...mr(e.args),Ar(e.pkg,"go")];break;case"rust":{const i=Ar(e.pkg,"rust"),a=e.binary.trim().length>0?e.binary.trim().toLowerCase().replace(/[^a-z0-9-]/g,""):i;n=[...mr(e.args),a];break}case"python":n=[...mr(e.args),Ar(e.pkg,"python")];break;case"dotnet":n=[...mr(e.args),Ar(e.pkg,"dotnet")];break}const r=n.filter(i=>i.length>0),o=r.length>0?`${r.join(".")}.${t}`:"app.opentray",s=r.length>0?r.map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):"Opentray App";return{appId:o,appName:s,identitySegments:r,tail:t}},eI=e=>{const t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"opentray-app"},tI=(e,t)=>{let n;for(const r of e)r.key.trim()===t&&(n=r.value);return n},nI=e=>e.family==="npm"&&(e.runner==="npx"||e.runner==="pnpx")?[{key:"npm_config_yes",value:"true",note:"跳过 npm 安装确认(等效 -y),首次运行无需交互"}]:[],rI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>.NET</title><path d="M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z"/></svg>',oI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Go</title><path d="M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z"/></svg>',sI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>npm</title><path d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/></svg>',iI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Python</title><path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"/></svg>',aI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Rust</title><path d="M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z"/></svg>',xr=e=>{const t=e.replace(/<title>[\s\S]*?<\/title>/g,"");return({className:r})=>l.jsx("span",{"aria-hidden":"true",className:he("inline-flex size-4 shrink-0 [&_svg]:size-full [&_svg]:fill-current",r),dangerouslySetInnerHTML:{__html:t}})},Wo={npm:xr(sI),go:xr(oI),rust:xr(aI),python:xr(iI),dotnet:xr(rI),custom:Fu},lI=bp.filter(e=>e!=="custom"),du=(e,t,n)=>l.jsx(Ga,{variant:"outline",size:"sm",className:"flex max-w-full flex-wrap",value:[t],onValueChange:r=>{const o=r[0];o!==void 0&&e.includes(o)&&n(o)},children:e.map(r=>l.jsx(jr,{value:r,className:"px-2.5 text-xs",children:r},r))});function cI({open:e,draft:t,envPreset:n,onEnvPresetChange:r,onDraftChange:o,onFamilyChange:s,onCancel:i,onApply:a}){const c=p=>{p||i()},u=p=>o({...t,...p}),f=qC(t),h=Mi(t),A=t.family==="rust"?Cp(t):null,g=Wo[t.family];return l.jsx(za,{open:e,onOpenChange:c,children:l.jsxs(Ya,{className:"max-h-[85vh] overflow-y-auto sm:max-w-md",children:[l.jsxs(Qn,{children:[l.jsxs(Gn,{className:"flex items-center gap-2",children:[l.jsxs(Mo,{children:[l.jsxs(Po,{className:"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","aria-label":"切换命令系列",title:"切换命令系列",children:[l.jsx(g,{className:"size-4"}),l.jsx(_n,{className:"size-3"})]}),l.jsx(To,{align:"start",className:"w-36",children:lI.map(p=>{const x=Wo[p];return l.jsxs(No,{onClick:()=>s(p),className:p===t.family?"bg-accent/60":void 0,children:[l.jsx(x,{className:"text-muted-foreground"}),hn[p]]},p)})})]}),"配置 ",hn[t.family]," 系列命令"]}),l.jsx(Ua,{children:"修改字段实时预览命令与默认应用标识;确定后写回命令行。"})]}),l.jsxs("div",{className:"space-y-4",children:[t.family==="npm"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"Runner"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"同一包换 runner 推导结果不变;deno run 自动补 npm: 前缀。"}),du(vp,t.runner,p=>u({runner:p}))]}),t.runnerFlags.length>0||t.runner==="deno run"?l.jsxs("div",{children:[l.jsx(Pe,{children:"Runner 参数"}),l.jsx(Xe,{className:"mt-1.5 font-mono text-xs",placeholder:"-A",value:t.runnerFlags,onChange:p=>u({runnerFlags:p.target.value})})]}):null,l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"包名"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"支持 @scope/name 与 npm: 前缀。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"@deepseek-ai/dsh",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"版本"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空 = latest。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"追加在包名之后;子命令参与 appId 推导。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"web --port 3000",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="go"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"Module 路径"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"取末段作为身份,如 rsc.io/fortune → fortune。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"rsc.io/fortune",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"版本"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空 = 本地/默认。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"serve --port 8080",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="rust"&&A!==null?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"安装 crate"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"cargo install 目标;Rust 不能直跑,需先安装。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"ripgrep",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行二进制"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空默认与 crate 同名。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:t.pkg.trim().length>0?t.pkg.trim():"二进制名",value:t.binary,onChange:p=>u({binary:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"--json .",value:t.args,onChange:p=>u({args:p.target.value})})]}),l.jsxs("div",{className:"space-y-1 rounded-lg bg-muted/60 p-2.5 font-mono text-xs",children:[l.jsxs("p",{className:"text-muted-foreground",children:[l.jsx("span",{className:"mr-1.5 select-none",children:"$"}),A.install]}),l.jsxs("p",{children:[l.jsx("span",{className:"mr-1.5 select-none text-muted-foreground",children:"$"}),A.run]})]})]}):null,t.family==="python"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"Runner"}),du(GC,t.runner,p=>u({runner:p}))]}),l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"包名"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"包名中的 . _ 归一为 - 参与推导。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"ruff",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"版本"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"format --check .",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="dotnet"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"工具 ID"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:".NET 10 dnx:NuGet 工具临时运行,无需安装。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"dotnet-format",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"版本"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"--verify-no-changes",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null]},t.family),l.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/60 px-3 py-2",children:l.jsx("code",{className:"min-w-0 flex-1 font-mono text-xs break-all",children:h.length>0?h:l.jsx("span",{className:"text-muted-foreground",children:"填写后生成命令…"})})}),n!==null?l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"环境变量预设"}),n.state==="off"?l.jsxs("button",{type:"button",className:"rounded-md px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground underline-offset-2 transition-colors hover:bg-accent hover:text-foreground hover:underline",title:n.defaultNote,onClick:()=>r("enable"),children:["+ ",n.key,"=true(启用)"]}):l.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-secondary/60 py-0.5 pr-1 pl-1.5 font-mono text-[11px]",title:"来自下方「命令选项 → 环境变量」配置(唯一可信源),两侧同步",children:[n.key,"=",n.explicitValue??"",l.jsx("span",{className:"font-sans text-[10px] text-muted-foreground",children:"env 已配置"}),l.jsx("button",{type:"button","aria-label":"移除环境变量预设",title:n.defaultNote,className:"rounded px-1 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>r("disable"),children:"×"})]})]}):l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"此系列/runner 无需注入环境变量。"}),l.jsxs("div",{className:"space-y-1 rounded-lg border border-border bg-muted/40 p-3",children:[l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"默认应用标识(由命令推导,可在下方应用配置中覆盖)"}),l.jsx("code",{className:"font-mono text-sm font-medium break-all",children:f.appId}),l.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["名称 ",f.appName," · ~/.opentray/create/",eI(f.appId),"/"]})]}),l.jsxs(jb,{children:[l.jsx(Fb,{render:l.jsx(Oe,{variant:"outline"}),children:"取消"}),l.jsxs(Oe,{onClick:()=>{a(t)},children:[l.jsx(Ui,{}),"确定"]})]})]})})}const fu=e=>({...yp,family:e,runner:e==="python"?"uvx":e==="npm"?"npx":""}),pu=e=>e!=="custom",ni=(e,t)=>e.family===t.family&&e.runner===t.runner&&e.runnerFlags===t.runnerFlags&&e.pkg===t.pkg&&e.version===t.version&&e.args===t.args&&e.binary===t.binary&&e.raw===t.raw;function uI({command:e,onCommandChange:t,commandOptions:n,onCommandOptionsChange:r,disabled:o,onRun:s}){const i=d.useMemo(()=>XC(e),[e]),a=n.family,c=d.useRef({}),[u,f]=d.useState(null),[h,A]=d.useState(a?.family??null);d.useEffect(()=>{if(a!==null){if(c.current[a.family]=a,u===null){A(N=>N===a.family?N:a.family);return}!pu(a.family)||u.currentFamily!==a.family||f(N=>{if(N===null||N.currentFamily!==a.family)return N;const M=N.drafts[a.family],O=N.bases[a.family];return M===void 0||O===void 0||!ni(M,O)?N:{...N,drafts:{...N.drafts,[a.family]:a},bases:{...N.bases,[a.family]:a}}})}},[a,u===null]);const g=h??i.family,p=N=>{if(a!==null&&a.family===N)return a;const M=c.current[N];return M!==void 0?M:i.family===N?i:fu(N)},[x,m]=d.useState(!1),[v,b]=d.useState(!1),[y,C]=d.useState(!1),I=u===null?void 0:u.drafts[u.currentFamily],w=I??n.family??i,S=nI(w)[0],R=S===void 0?void 0:tI(n.env,S.key),E=S===void 0?null:{key:S.key,defaultNote:S.note,state:R!==void 0?"explicit":"off",...R!==void 0?{explicitValue:R}:{}},k=R!==void 0,B=N=>{const M=S?.key??"npm_config_yes",O=N==="enable"?[...n.env.filter(G=>G.key.trim()!==M),{key:M,value:"true"}]:n.env.filter(G=>G.key.trim()!==M);r({...n,env:O})},T=N=>{if(N===g)return;A(N);const M={...n,...n.argsMode==="array"?{argsMode:"string"}:{}},O=p(N);c.current[N]===void 0&&(c.current[N]=O),r({...M,family:N==="custom"?null:O}),t(Mi(O))},F=()=>{if(!pu(g))return;const N=p(g);f({snapshot:{family:g,state:N},currentFamily:g,drafts:{[g]:N},bases:{[g]:N}})},j=N=>{f(M=>M===null||M.currentFamily!==N.family?M:{...M,drafts:{...M.drafts,[N.family]:N}})},D=N=>{f(M=>{if(M===null||M.currentFamily===N)return M;const O=M.drafts[N],G=M.bases[N],Z=p(N),J=O!==void 0&&G!==void 0&&!ni(O,G),Q=J?O:Z;return{...M,currentFamily:N,drafts:{...M.drafts,[N]:Q},bases:{...M.bases,[N]:J?G:Z}}})},H=()=>{f(N=>{if(N===null)return N;const M=c.current[N.snapshot.family];return(M===void 0||ni(M,N.snapshot.state))&&(c.current[N.snapshot.family]=N.snapshot.state),null})},_=N=>{c.current[N.family]=N,A(N.family),t(Mi(N)),r({...n,...n.argsMode==="array"?{argsMode:"string"}:{},family:N}),f(null)},P=Wo[g],L=g==="custom";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex h-8 w-full min-w-0 items-stretch rounded-lg border border-input bg-transparent transition-colors outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 disabled:opacity-50 dark:bg-input/30",children:[l.jsxs(Mo,{children:[l.jsxs(Po,{disabled:o,className:"flex w-11 items-center justify-between gap-1 rounded-l-lg border-r border-input transition-colors outline-none hover:bg-accent focus-visible:z-10 focus-visible:border-ring","aria-label":`命令系列:${hn[g]},点击切换`,title:`命令系列:${hn[g]}`,children:[l.jsx(P,{className:"size-4 text-muted-foreground ms-2"}),l.jsx(_n,{className:"size-3 text-muted-foreground/70 me-0.75"})]}),l.jsx(To,{align:"start",className:"w-36",children:bp.map(N=>{const M=Wo[N];return l.jsxs(No,{onClick:()=>T(N),className:N===g?"bg-accent/60":void 0,children:[l.jsx(M,{className:"text-muted-foreground"}),hn[N]]},N)})})]}),L?l.jsx("input",{className:"h-full w-full min-w-0 flex-1 bg-transparent px-2.5 font-mono text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed",placeholder:"npx somecommand start --xx",disabled:o,value:e,onChange:N=>t(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!o&&s()}}):l.jsx("button",{type:"button",className:"h-full min-w-0 flex-1 cursor-pointer truncate px-2.5 text-left font-mono text-sm outline-none select-none disabled:cursor-not-allowed disabled:opacity-60",disabled:o,title:e.length>0?e:`点击配置 ${hn[g]} 系列命令`,"aria-label":`配置 ${hn[g]} 系列命令`,onClick:F,children:e.length>0?e:l.jsxs("span",{className:"text-muted-foreground",children:["点击配置 ",hn[g]," 系列命令…"]})}),k&&S!==void 0?l.jsxs(fs,{open:x||v||y,onOpenChange:N=>{N||C(!1)},children:[l.jsx(ps,{render:l.jsx("span",{tabIndex:0,className:"mr-1 flex size-6 shrink-0 self-center cursor-help items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","aria-label":"命令将携带 npm_config_yes 环境变量,悬停或点击查看",onPointerEnter:()=>m(!0),onPointerLeave:()=>m(!1),onFocus:()=>b(!0),onBlur:()=>b(!1),onClick:()=>C(N=>!N)}),children:l.jsx(Rr,{className:"size-3.5"})}),l.jsx(hs,{side:"top",children:l.jsxs("div",{className:"space-y-1 text-left",children:[l.jsx("p",{className:"text-[11px] opacity-70",children:"环境变量预设"}),l.jsxs("p",{className:"font-mono text-xs",children:[S.key,"=",R]}),l.jsx("p",{className:"text-[11px] opacity-70",children:"来自「命令选项 → 环境变量」配置(唯一可信源,两侧同步)"})]})})]}):null]}),l.jsx(cI,{open:u!==null,draft:I??fu(g),envPreset:E,onEnvPresetChange:B,onDraftChange:j,onFamilyChange:D,onCancel:H,onApply:_})]})}function dI({tags:e,onTagsChange:t,disabled:n=!1,placeholder:r,className:o,...s}){const[i,a]=d.useState(""),c=()=>{i.length!==0&&(t([...e,i]),a(""))};return l.jsxs("div",{className:he("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent px-2 py-1.5 font-mono text-xs shadow-xs focus-within:border-ring",n&&"opacity-50",o),children:[e.map((u,f)=>l.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent px-1.5 py-0.5 text-accent-foreground",children:[l.jsx("span",{className:"max-w-56 truncate",title:u,children:u}),n?null:l.jsx("button",{type:"button","aria-label":`移除参数 ${f+1}`,className:"text-muted-foreground hover:text-foreground",onClick:()=>{t(e.filter((h,A)=>A!==f))},children:l.jsx(Zi,{className:"size-3"})})]},`${f}:${u}`)),l.jsx("input",{className:"min-w-24 flex-1 bg-transparent font-mono text-xs outline-none placeholder:text-muted-foreground",value:i,disabled:n,placeholder:r??(e.length===0?"程序(如 npx)":"参数,回车添加"),onChange:u=>a(u.target.value),onKeyDown:u=>{if(u.key==="Enter"){u.preventDefault(),c();return}u.key==="Backspace"&&i.length===0&&e.length>0&&(u.preventDefault(),t(e.slice(0,-1)))},onBlur:c,...s})]})}function fI({command:e,onCommandChange:t,argv:n,onArgvChange:r,runAlive:o,frozen:s,failedReason:i,commandOptions:a,defaultCwd:c,onCommandOptionsChange:u,onRun:f,onStop:h}){const A=g=>{u({...a,...g})};return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsxs("div",{className:"flex gap-2",children:[a.argsMode==="array"?l.jsx(dI,{tags:n,onTagsChange:r,disabled:o,"aria-label":"命令参数(argv)"}):l.jsx(uI,{command:e,onCommandChange:t,commandOptions:a,onCommandOptionsChange:u,disabled:o||s,onRun:f}),o?l.jsxs(Oe,{variant:"destructive",onClick:h,"aria-label":"中断命令",children:[l.jsx(eg,{}),"中断"]}):l.jsxs(Oe,{disabled:s,onClick:f,"aria-label":"运行命令",children:[l.jsx(zh,{}),"运行"]})]}),i!==void 0?l.jsx("p",{className:"mt-2 font-mono text-xs text-red-400",children:i}):null,l.jsx(La,{defaultValue:["command"],className:"mt-3 border-t border-border pt-1",children:l.jsxs(Ka,{value:"command",className:"border-b-0",children:[l.jsx(Wa,{children:l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(Jh,{className:"size-4 text-muted-foreground"}),"命令选项"]})}),l.jsxs(Qa,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"参数输入模式"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"数组模式逐个输入参数(回车添加),原样传递、绝不拆分。"}),l.jsxs(Ga,{variant:"outline",size:"sm",spacing:0,value:[a.argsMode],onValueChange:g=>{const p=g[0];(p==="string"||p==="array")&&A({argsMode:p})},disabled:s,children:[l.jsx(jr,{value:"string",children:"字符串"}),l.jsx(jr,{value:"array",children:"数组 (argv)"})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"cmd-cwd",children:"工作目录 (cwd)"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空使用用户主目录(下方完整路径);相对路径按主目录解析。"}),l.jsx(Xe,{id:"cmd-cwd",className:"mt-0 font-mono text-xs",disabled:s,value:a.cwd,placeholder:c.length>0?`默认:${c}`:"默认:用户主目录",title:c,onChange:g=>A({cwd:g.target.value})}),c.length>0&&a.cwd.trim().length===0?l.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:c}):null]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"环境变量 (env)"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"启动命令时叠加在当前环境之上;同时写入生成的应用。"}),l.jsxs("div",{className:"space-y-1.5",children:[a.env.length===0?l.jsx("p",{className:"text-xs text-muted-foreground",children:"未配置"}):a.env.map((g,p)=>l.jsxs("div",{className:"flex gap-1.5",children:[l.jsx(Xe,{className:"font-mono text-xs",disabled:s,"aria-label":`env 名称 ${p+1}`,value:g.key,placeholder:"NAME",onChange:x=>{const m=[...a.env];m[p]={...g,key:x.target.value},A({env:m})}}),l.jsx(Xe,{className:"font-mono text-xs",disabled:s,"aria-label":`env 值 ${p+1}`,value:g.value,placeholder:"value",onChange:x=>{const m=[...a.env];m[p]={...g,value:x.target.value},A({env:m})}}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:s,"aria-label":"删除环境变量",onClick:()=>{A({env:a.env.filter((x,m)=>m!==p)})},children:"×"})]},p)),l.jsxs(Oe,{variant:"outline",size:"sm",disabled:s,onClick:()=>A({env:[...a.env,{key:"",value:""}]}),children:[l.jsx(Rr,{className:"size-3.5"}),"添加变量"]})]})]})]})]})})]})}const hu=e=>{const t=e.trim();return t.length===0?"":/^https?:\/\//iu.test(t)?t:`https://${t}`};function pI({value:e,onChange:t,activeSource:n,frozen:r,loading:o,failedReason:s,onSubmit:i}){return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 pb-3 text-sm font-medium text-muted-foreground",children:[l.jsx(Bh,{className:"size-4"}),"网页地址"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(ai,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),l.jsx(Xe,{className:"pl-8 font-mono text-xs",value:e,placeholder:"https://example.com",disabled:r,onChange:a=>t(a.target.value),onKeyDown:a=>{if(a.key!=="Enter"||r||o)return;const c=hu(e);t(c),i(c)},"aria-label":"网页地址"})]}),l.jsxs(Oe,{size:"sm",disabled:r||o||e.trim().length===0,onClick:()=>{const a=hu(e);t(a),i(a)},children:[o?l.jsx(Th,{className:"size-4 animate-spin"}):null,"获取预设"]})]}),s!==void 0?l.jsx("p",{className:"pt-2 text-xs text-destructive",role:"alert",children:s}):null,n!==void 0?l.jsxs("p",{className:"pt-2 text-xs text-muted-foreground",children:["源地址:",l.jsx("span",{className:"font-mono",children:n}),"——标题/图标预设来自该页面,均可在下方修改。"]}):l.jsx("p",{className:"pt-2 text-xs text-muted-foreground",children:"直接把网页打包成应用:不需要命令,创建时抓取页面标题与图标作为预设。"})]})}const ri=["scaffold","icon","install"];function hI({open:e,phase:t,frozenValues:n,iconSrc:r,iconLabel:o,traySrc:s,trayLabel:i,selectedPort:a,currentStep:c,logs:u,error:f,result:h,onBack:A,onCreate:g,onShare:p,onOpenApp:x,onClose:m,confirmError:v,onOpenChange:b}){const y=d.useRef(null);d.useEffect(()=>{y.current?.scrollTo({top:y.current.scrollHeight})},[u.length]);const C=I=>{const w=ri.indexOf(I),S=ri.indexOf(c);return t==="success"||w<S?"done":w===S?"active":""};return l.jsx(za,{open:e,onOpenChange:I=>{t==="pending"&&I===!1||b(I)},children:l.jsx(Ya,{className:"max-w-xl",children:t==="confirm"?l.jsxs(l.Fragment,{children:[l.jsxs(Qn,{children:[l.jsx(Gn,{children:"确认应用信息"}),l.jsx(Ua,{children:"表单已固定,以下值将用于生成应用。"})]}),l.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[l.jsx("dt",{className:"text-muted-foreground",children:"App ID"}),l.jsx("dd",{className:"font-mono break-all",children:n.appId}),l.jsx("dt",{className:"text-muted-foreground",children:"应用名称"}),l.jsx("dd",{className:"break-all",children:n.appName}),l.jsx("dt",{className:"text-muted-foreground",children:"图标"}),l.jsxs("dd",{className:"flex flex-wrap items-center gap-4",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":"应用图标预览",children:r!==void 0?l.jsx("img",{src:r,alt:"应用图标",className:"size-full object-contain"}):l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"无"})}),l.jsxs("span",{className:"flex flex-col",children:[l.jsx("span",{className:"text-xs leading-tight",children:"应用图标"}),l.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:o})]})]}),l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":"托盘图标预览",children:s!==void 0?l.jsx("img",{src:s,alt:"托盘图标",className:"size-full object-contain"}):l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"文字"})}),l.jsxs("span",{className:"flex flex-col",children:[l.jsx("span",{className:"text-xs leading-tight",children:"托盘图标"}),l.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:i})]})]})]}),l.jsx("dt",{className:"text-muted-foreground",children:"服务端口"}),l.jsx("dd",{className:"font-mono",children:a!==void 0?`:${a}(生成后运行时重新嗅探)`:"运行时嗅探"}),l.jsx("dt",{className:"text-muted-foreground",children:"包管理器"}),l.jsx("dd",{children:n.pm})]}),v!==void 0?l.jsx("p",{className:"text-xs font-medium text-red-400",children:v}):null,l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Oe,{variant:"outline",onClick:A,children:"返回修改"}),l.jsx(Oe,{variant:"outline",onClick:p,children:"分享"}),l.jsx(Oe,{onClick:g,children:"确认生成"})]})]}):t==="pending"?l.jsxs(l.Fragment,{children:[l.jsx(Qn,{children:l.jsx(Gn,{children:"正在生成应用…"})}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:ri.map(I=>l.jsx(Io,{variant:C(I)==="done"?"default":"secondary",children:I},I))}),l.jsx("div",{ref:y,className:"h-48 overflow-y-auto rounded-md border border-border bg-[#05070b] p-3 font-mono text-[11px] leading-5 text-[#b7c3d8] whitespace-pre-wrap",children:u.join(`
|
|
24
|
-
`)})]}):t==="success"&&h!==void 0?l.jsxs(l.Fragment,{children:[l.jsx(Qn,{children:l.jsxs(Gn,{className:"flex items-center gap-2",children:[l.jsx(Ah,{className:"size-5 text-emerald-400"}),"应用已生成"]})}),l.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[l.jsx("dt",{className:"text-muted-foreground",children:"项目目录"}),l.jsx("dd",{className:"font-mono break-all",children:h.projectDir}),h.bundlePath?l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:"macOS Bundle"}),l.jsx("dd",{className:"font-mono break-all",children:h.bundlePath})]}):null]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Oe,{variant:"outline",onClick:m,children:"完成"}),l.jsxs(Oe,{onClick:x,children:[l.jsx(Du,{}),"打开应用"]})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:h.pinHint})]}):l.jsxs(l.Fragment,{children:[l.jsx(Qn,{children:l.jsxs(Gn,{className:"flex items-center gap-2",children:[l.jsx(ig,{className:"size-5 text-red-400"}),"生成失败"]})}),l.jsx("p",{className:"break-all font-mono text-xs text-red-400",children:f??"未知错误"}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Oe,{variant:"outline",onClick:A,children:"返回重试"})})]})})})}const oi=(e,t)=>{const n=d.useRef(e);n.current=e;const r=d.useRef(void 0),o=d.useRef(void 0),s=d.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0);const f=o.current;o.current=void 0,f!==void 0&&n.current(...f)},[]),i=d.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0),o.current=void 0},[]),a=d.useCallback((...f)=>{o.current=f,r.current!==void 0&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=void 0;const h=o.current;o.current=void 0,h!==void 0&&n.current(...h)},t)},[t]);d.useEffect(()=>s,[s]);const c=d.useRef(a);c.current=a;const u=d.useCallback((...f)=>{c.current(...f)},[]);return u.flush=s,u.cancel=i,u},Ip=d.createContext(void 0);function wp(){const e=d.useContext(Ip);if(e===void 0)throw new Error(st(64));return e}const sl={tabActivationDirection:e=>({"data-activation-direction":e})},gI=d.forwardRef(function(t,n){const{className:r,defaultValue:o=0,onValueChange:s,orientation:i="horizontal",render:a,value:c,style:u,...f}=t,h=t.defaultValue!==void 0,A=d.useRef([]),[g,p]=d.useState(()=>new Map),[x,m]=sn({controlled:c,default:o,name:"Tabs",state:"value"}),v=c!==void 0,[b,y]=d.useState(()=>new Map),C=d.useRef(void 0),I=d.useCallback(K=>Pi(b,K),[b]),[w,S]=d.useState(()=>({previousValue:x,tabActivationDirection:"none"})),{previousValue:R,tabActivationDirection:E}=w;let k=E,B=!1;R!==x&&(k=gu(R,x,i,b),B=R!=null&&x!=null&&I(x)==null);const T=B?R:x,F=R!==T||E!==k;ae(()=>{F&&S({previousValue:T,tabActivationDirection:k})},[T,F,k]);const j=de((K,te)=>{const le=gu(x,K,i,b);te.activationDirection=le,s?.(K,te),!te.isCanceled&&m(K)}),D=de((K,te)=>{s?.(K,Ce(te,void 0,void 0,{activationDirection:"none"}))}),H=de((K,te)=>(p(le=>{const X=new Map(le);return X.set(K,te),X}),()=>{p(le=>{if(le.get(K)!==te)return le;const X=new Map(le);return X.delete(K),X})})),_=d.useCallback(K=>g.get(K),[g]),P=d.useCallback(K=>{for(const te of b.values())if(K===te.value)return te.id},[b]),L=d.useMemo(()=>({getTabElementBySelectedValue:I,getTabIdByPanelValue:P,getTabPanelIdByValue:_,onValueChange:j,orientation:i,registerMountedTabPanel:H,setTabMap:y,tabActivationDirection:k,value:x}),[I,P,_,j,i,H,y,k,x]),N=d.useMemo(()=>{for(const K of b.values())if(K.value===x)return K},[b,x]),M=d.useMemo(()=>{for(const K of b.values())if(!K.disabled)return K.value},[b]),O=d.useRef(!h),G=d.useRef(o),Z=d.useRef(h),J=d.useRef(!1);ae(()=>{if(v)return;function K(ee,U){m(ee),S({previousValue:ee,tabActivationDirection:"none"}),D(ee,U),O.current=!1}if(b.size===0){J.current&&x!==null&&!C.current?.isConnected&&K(null,Cl);return}J.current=!0,C.current=b.keys().next().value;const te=N?.disabled,le=N==null&&x!==null;if(!te&&x===G.current&&(Z.current=!1),Z.current&&te&&x===G.current)return;const X=O.current;if(te||le){const ee=M??null;if(x===ee){O.current=!1;return}let U=Cl;X?U=yl:te&&(U=Eu),K(ee,U);return}X&&N!=null&&(D(x,yl),O.current=!1)},[M,v,D,N,m,b,x]);const $=Me("div",t,{state:{orientation:i,tabActivationDirection:k},ref:n,props:f,stateAttributesMapping:sl});return l.jsx(Ip.Provider,{value:L,children:l.jsx(Vr,{elementsRef:A,children:$})})});function Pi(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function gu(e,t,n,r){if(e==null||t==null)return"none";const[o,s,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],a=Pi(r,e),c=Pi(r,t);if(a==null||c==null)return a!==c&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:s:"none";const u=a.getBoundingClientRect()[o],f=c.getBoundingClientRect()[o];return f<u?s:f>u?i:"none"}const kp=d.createContext(void 0);function AI(){const e=d.useContext(kp);if(e===void 0)throw new Error(st(65));return e}const mI=d.forwardRef(function(t,n){const{className:r,disabled:o=!1,render:s,value:i,id:a,nativeButton:c=!0,style:u,...f}=t,{value:h,getTabPanelIdByValue:A,onValueChange:g,orientation:p,tabActivationDirection:x}=wp(),{activateOnFocus:m,registerTabResizeObserverElement:v,tabsListElement:b}=AI(),{highlightedIndex:y,onHighlightedIndexChange:C}=Ki(),I=wt(a),w=d.useMemo(()=>({disabled:o,id:I,value:i}),[o,I,i]),{compositeProps:S,compositeRef:R,index:E}=tf({metadata:w}),k=i===h,B=d.useRef(!1),T=d.useRef(null),F=de(J=>{T.current?.(),T.current=J?v(J):null});ae(()=>{if(B.current){B.current=!1;return}if(!(k&&E>-1&&y!==E))return;const J=b;if(J!=null){const Q=Ct(je(J));if(Q&&ve(J,Q))return}o||C(E)},[k,E,y,C,o,b]);const{getButtonProps:j,buttonRef:D}=Yt({disabled:o,native:c,focusableWhenDisabled:!0}),H=A(i),_=d.useRef(!1),P=d.useRef(!1);function L(J){g(i,Ce(jt,J.nativeEvent,void 0,{activationDirection:"none"}))}function N(J){k||o||L(J)}function M(J){k||o||m&&(!_.current||P.current)&&L(J)}function O(J){if(k||o)return;_.current=!0,P.current=J.button===0;const Q=je(J.currentTarget);function $(){_.current=!1,P.current=!1,Q.removeEventListener("pointerup",$),Q.removeEventListener("pointercancel",$)}Q.addEventListener("pointerup",$),Q.addEventListener("pointercancel",$)}return Me("button",t,{state:{disabled:o,active:k,orientation:p,tabActivationDirection:x},ref:[n,D,R,F],props:[S,{role:"tab","aria-controls":H,"aria-selected":k,id:I,onClick:N,onFocus:M,onPointerDown:O,[wf]:k?"":void 0,onKeyDownCapture(){B.current=!0}},f,j],stateAttributesMapping:sl})}),xI=d.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:o,loopFocus:s=!0,render:i,style:a,...c}=t,{orientation:u,setTabMap:f,tabActivationDirection:h}=wp(),[A,g]=d.useState(0),[p,x]=d.useState(null),m=d.useRef(new Set),v=d.useRef(new Set),b=d.useRef(null);ae(()=>{if(typeof ResizeObserver>"u")return;const R=new ResizeObserver(()=>{m.current.forEach(E=>{E()})});return b.current=R,p&&R.observe(p),v.current.forEach(E=>{R.observe(E)}),()=>{R.disconnect(),b.current=null}},[p]);const y=de(R=>(m.current.add(R),()=>{m.current.delete(R)})),C=de(R=>(v.current.add(R),b.current?.observe(R),()=>{v.current.delete(R),b.current?.unobserve(R)})),I={orientation:u,tabActivationDirection:h},w={"aria-orientation":u==="vertical"?"vertical":void 0,role:"tablist"},S=d.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:C,tabsListElement:p}),[r,y,C,p]);return l.jsx(kp.Provider,{value:S,children:l.jsx(kf,{render:i,className:o,style:a,state:I,refs:[n,x],props:[w,c],stateAttributesMapping:sl,highlightedIndex:A,enableHomeAndEndKeys:!0,loopFocus:s,orientation:u,onHighlightedIndexChange:g,onMapChange:f,disabledIndices:Ot})})});function bI({className:e,orientation:t="horizontal",...n}){return l.jsx(gI,{"data-slot":"tabs","data-orientation":t,className:he("group/tabs flex gap-2 data-horizontal:flex-col",e),...n})}const vI=Ti("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-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function yI({className:e,variant:t="default",...n}){return l.jsx(xI,{"data-slot":"tabs-list","data-variant":t,className:he(vI({variant:t}),e),...n})}function Au({className:e,...t}){return l.jsx(mI,{"data-slot":"tabs-trigger",className:he("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-foreground/60 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 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm 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 dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","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",e),...t})}function mu({className:e,size:t="default",...n}){return l.jsx("div",{"data-slot":"card","data-size":t,className:he("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})}function xu({className:e,...t}){return l.jsx("div",{"data-slot":"card-header",className:he("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function bu({className:e,...t}){return l.jsx("div",{"data-slot":"card-content",className:he("px-(--card-spacing)",e),...t})}function CI({className:e,...t}){return l.jsx("div",{"data-slot":"card-footer",className:he("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}const Ep=d.memo(({port:e,url:t,visible:n,className:r})=>{const o=d.useRef(null),s=d.useRef(t);return d.useEffect(()=>{const i=o.current;if(i===null){s.current=t;return}s.current!==t&&(s.current=t,i.src=t)},[t]),l.jsx("iframe",{ref:o,title:`service-${e}`,src:t,className:r,style:{width:"100%",height:"100%",border:0,background:"#fff",display:n?"block":"none"},sandbox:"allow-same-origin allow-scripts allow-forms"})});Ep.displayName="StableIframe";const II=e=>{const t=e.trim();if(t.length!==0)try{return new URL(/^https?:\/\//iu.test(t)?t:`http://${t}`).href}catch{return}},vu=({status:e,services:t,activeTab:n,onJumpToService:r})=>l.jsxs(CI,{className:"h-8 shrink-0 gap-3 overflow-x-auto px-3 py-0 text-[11px] text-muted-foreground",children:[l.jsxs("span",{className:"font-mono whitespace-nowrap",children:["光标 ",e.cursorY,":",e.cursorX]}),l.jsxs("span",{className:"font-mono whitespace-nowrap",children:[e.cols,"×",e.rows]}),l.jsx("span",{className:"font-mono whitespace-nowrap",children:e.selection===void 0?"无选区":`选区 ${e.selection.start.y}:${e.selection.start.x} – ${e.selection.end.y}:${e.selection.end.x}`}),l.jsx("span",{className:"h-3 w-px bg-border"}),t.length===0?l.jsx("span",{children:"嗅探 HTTP 服务中…(未发现不影响创建应用)"}):t.map(o=>l.jsxs(Io,{variant:n===`svc-${o.port}`?"default":"secondary",className:"cursor-pointer font-mono whitespace-nowrap",onClick:()=>r(o.port),children:[":",o.port,o.title?` · ${o.title}`:""]},o.port))]});function wI({command:e,terminalHostRef:t,terminalReady:n,interactive:r,status:o,services:s,iframeTabs:i,activeTab:a,onActiveTabChange:c,onIframeNavigate:u,onIframeHistoryMove:f,onJumpToService:h,hideTerminal:A=!1,className:g}){return l.jsxs("div",{className:he("flex min-h-0 flex-col gap-2",g),children:[l.jsx(bI,{value:a,onValueChange:c,children:l.jsxs(yI,{variant:"line",className:"w-full justify-start border-b px-2",children:[A?null:l.jsxs(Au,{value:"terminal",children:[l.jsx(Rr,{className:"size-3.5"}),"终端",!r&&n?l.jsx("span",{className:"text-[10px] text-amber-400",children:"非交互"}):null]}),i.map(p=>l.jsxs(Au,{value:`svc-${p.port}`,children:[l.jsx(ai,{className:"size-3.5"}),new URL(p.url).port===""?Fi(p.url):`${Fi(p.url)}:${new URL(p.url).port}`]},p.port))]})}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",hidden:A||a!=="terminal",children:l.jsxs(mu,{size:"sm",className:"min-h-0 flex-1 gap-0",children:[l.jsx(xu,{className:"border-b [.border-b]:pb-2",children:l.jsxs("span",{className:"tech-ltr flex min-w-0 items-center gap-2 font-mono text-xs text-muted-foreground",children:[l.jsx(Rr,{className:"size-4 shrink-0"}),l.jsx("span",{className:"truncate",children:e||"尚未运行命令"})]})}),l.jsxs(bu,{className:"min-h-0 flex-1 p-0",children:[l.jsx("div",{ref:t,className:"min-h-0 min-w-0 h-full bg-[#05070b] px-1"}),n?null:l.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"正在加载终端渲染器…"})]}),l.jsx(vu,{status:o,services:s,activeTab:a,onJumpToService:h})]})}),i.map(p=>l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",hidden:a!==`svc-${p.port}`,children:l.jsxs(mu,{size:"sm",className:"min-h-0 flex-1 gap-0",children:[l.jsx(xu,{className:"border-b [.border-b]:pb-2",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:p.historyIndex===0,onClick:()=>f(p.port,-1),"aria-label":"后退",children:l.jsx(ih,{})}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:p.historyIndex>=p.history.length-1,onClick:()=>f(p.port,1),"aria-label":"前进",children:l.jsx(ah,{})}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",onClick:()=>u(p.port,p.url,"replace"),"aria-label":"重新加载",children:l.jsx(lh,{})}),l.jsx(ai,{className:"size-4 shrink-0 text-muted-foreground"}),l.jsx(Xe,{className:"tech-ltr h-7 font-mono text-xs",defaultValue:p.url,placeholder:"输入 URL 跳转",onKeyDown:x=>{if(x.key!=="Enter")return;const m=x.target.value,v=II(m);v!==void 0&&u(p.port,v,"push")}},`${p.port}:${p.historyIndex}:${p.url}`)]})}),l.jsx(bu,{className:"min-h-0 flex-1 p-0",children:l.jsx(Ep,{port:p.port,url:p.url,visible:a===`svc-${p.port}`})}),l.jsx(vu,{status:o,services:s,activeTab:a,onJumpToService:h})]})},p.port))]})}const Sp={model:"isnet_fp16",alphaThreshold:0,shrink:0},kI="1.7.0";let xo;const EI=async()=>(xo!==void 0||(xo=(await ch(()=>import("./index2.js"),__vite__mapDeps([0,1,2,3]))).removeBackground),xo),SI=()=>new URL(`/imgly-data/${kI}/`,window.location.origin).toString(),RI=(e,t)=>{if(t.alphaThreshold<=0&&t.shrink<=0)return e;const{width:n,height:r}=e;let o=new Uint8ClampedArray(n*r);for(let i=0;i<o.length;i+=1){const a=e.data[i*4+3]??0;o[i]=t.alphaThreshold>0&&a<t.alphaThreshold?0:a}for(let i=0;i<t.shrink;i+=1){const a=new Uint8ClampedArray(o.length);for(let c=0;c<r;c+=1)for(let u=0;u<n;u+=1){let f=o[c*n+u]??0;for(let h=-1;h<=1&&f>0;h+=1)for(let A=-1;A<=1&&f>0;A+=1){const g=c+h,p=u+A,x=g<0||g>=r||p<0||p>=n?0:o[g*n+p]??0;x<f&&(f=x)}a[c*n+u]=f}o=a}const s={data:new Uint8ClampedArray(e.data),width:n,height:r};for(let i=0;i<o.length;i+=1)s.data[i*4+3]=o[i]??0;return s},DI=async(e,t=Sp,n)=>{try{const r=await EI(),o=(c,u,f)=>{if(f<=0)return;const h=Math.min(100,Math.round(u/f*100));n?.(c.startsWith("fetch:")?`AI 提取主体中(下载模型 ${h}%)`:"AI 提取主体中(推理中)")},s=await r(e,{model:t.model,device:"gpu",publicPath:SI(),progress:o});let i=s;const a=await createImageBitmap(s);try{if(t.alphaThreshold>0||t.shrink>0){const c=document.createElement("canvas");c.width=a.width,c.height=a.height;const u=c.getContext("2d");if(u!==null){u.drawImage(a,0,0);const f=u.getImageData(0,0,c.width,c.height),h=RI(f,t);f.data.set(h.data),u.putImageData(f,0,0);const A=await new Promise(g=>c.toBlob(g,"image/png"));A!==null&&(i=A)}}return{bytes:i,width:a.width,height:a.height}}finally{a.close()}}catch{return}},yu={appId:"",appName:"",iconPath:"",iconBackground:"transparent",iconScale:.8,trayIconPath:"",force:!1,pm:"npm",showStartupTerminal:!1,showAddressBar:!1,imageSmoothingEnabled:!0,developerMode:!1},FI={appId:"",appName:"",targetDir:"",iconPath:""};function BI(){const{query:e}=pf(),t=e.get("edit"),[n,r]=d.useState(void 0),[o,s]=d.useState(""),[i,a]=d.useState([]),[c,u]=d.useState(V1),[f,h]=d.useState(""),[A,g]=d.useState(!1),[p,x]=d.useState(!1),m=d.useCallback(z=>{x(z),Jn.set(z)},[]);d.useEffect(()=>(Jn.set(p),()=>Jn.set(!1)),[p]);const[v,b]=d.useState(void 0),[y,C]=d.useState(!1),[I,w]=d.useState(""),[S,R]=d.useState(!1),[E,k]=d.useState("idle"),[B,T]=d.useState(),[F,j]=d.useState(""),[D,H]=d.useState(!0),[_,P]=d.useState(!1),[L,N]=d.useState(),[M,O]=d.useState(yu),[G,Z]=d.useState(FI),[J,Q]=d.useState([]),[$,K]=d.useState(),[te,le]=d.useState(!1),[X,ee]=d.useState([]),[U,ue]=d.useState(),[se,be]=d.useState(0),[re,Ae]=d.useState(),[ie,oe]=d.useState(),[ce,me]=d.useState(),[ge,W]=d.useState(),[V,ye]=d.useState("transparent"),[q,ne]=d.useState(.8),ke=d.useRef(void 0),Se=d.useRef(void 0),Qe=d.useRef(!1),tt=d.useRef(!1),[Le,ht]=d.useState(),[Ke,Ge]=d.useState(),[ut,Re]=d.useState(),[Ue,_e]=d.useState("terminal"),[nt,Ee]=d.useState([]),[Ve,Ze]=d.useState({cursorX:0,cursorY:0,cols:0,rows:0}),[Je,rt]=d.useState(!1),[it,At]=d.useState("confirm"),[dt,xt]=d.useState([]),[Mt,$t]=d.useState(""),[Be,ze]=d.useState(),[bt,Et]=d.useState(),[St,Pt]=d.useState(yu),Tt=d.useRef(null),vt=d.useRef(void 0),un=d.useRef([]),En=d.useRef(M);En.current=M;const il=d.useRef(E);il.current=E;const Jr=(z,pe,Y)=>{if(pe===void 0)return!1;const fe=Number.parseInt(pe.split(":")[1]??"",10);return!z.some(Fe=>Fe.index===fe)||pe.split(":")[0]!==String(Y)},vs=d.useRef(void 0);d.useEffect(()=>{const z=M.iconPath.trim().length>0?M.iconPath.trim():G.iconPath.trim().length>0?G.iconPath.trim():void 0;if(vs.current=z,z===void 0){oe(void 0),W(void 0),ke.current=void 0;return}z===ke.current&&ge!==void 0||(async()=>{try{me(void 0);const pe=await Ne("/api/icon-analyze",{path:z});if(!pe.ok)throw new Error("analyze failed");const Y=await pe.json();if(vs.current!==z)return;oe(Y),Qe.current=!1,ye(Y.suggested),Ne("/api/form",{iconBackground:Y.suggested});const fe=await Ne("/api/icon-compose",{foregroundPath:z,background:Y.suggested,scale:q});if(!fe.ok)throw new Error("compose failed");const Fe=await fe.json();if(vs.current!==z)return;W(Fe),ke.current=z}catch{oe(void 0),W(void 0),me("图标分析或合成失败,预览不可用")}})()},[M.iconPath,G.iconPath]);const[Rp,al]=d.useState(!1),[Dp,ll]=d.useState(void 0),[ys,Fp]=d.useState(Sp),cl=d.useRef(ys);cl.current=ys;const $r=d.useRef(new Set),Cs=d.useRef(0),Is=d.useRef(!1),ws=d.useRef(!1),ks=d.useCallback(async(z,pe,Y)=>{Is.current=!0,al(!0);try{const fe=await(await fetch(Dn(pe,z.index,Y))).blob(),Fe=await DI(fe,cl.current,ll);if(Fe===void 0||Cs.current!==Y)return;const Nt=`token=${encodeURIComponent(new URLSearchParams(location.search).get("token")??"")}&port=${pe}&variantOf=${z.index}&width=${Fe.width}&height=${Fe.height}`;await fetch(`/api/icon-candidate?${Nt}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:Fe.bytes})}catch{}finally{Is.current=!1,al(!1),ll(void 0),ws.current&&(ws.current=!1,ul())}},[]),ul=oi(()=>{if(E==="frozen"||E==="materializing"||E==="success")return;const z=U,pe=X.find(Y=>Y.variant==="original");if(!(z===void 0||pe===void 0)){if(Is.current){ws.current=!0;return}ks(pe,z,se)}},500),Bp=z=>{Fp(z),ul()},Ln=d.useRef(void 0);d.useEffect(()=>{if(!(re===void 0&&Ke===void 0)&&U!==void 0){if(Ln.current===void 0){Ln.current=se;return}Ln.current!==se&&(Ln.current=se,re!==void 0&&!Jr(X,re,U)&&Ne("/api/icon-select",{port:U,index:Number.parseInt(re.split(":")[1]??"",10)}),Ke!==void 0&&!Jr(X,Ke,U)&&Ne("/api/tray-icon-select",{port:U,index:Number.parseInt(Ke.split(":")[1]??"",10)}))}},[se,re,Ke,X,U]),d.useEffect(()=>{const z=U,pe=X.find(fe=>fe.variant==="original");if(z===void 0||pe===void 0||E==="frozen"||E==="materializing"||E==="success")return;Cs.current!==se&&(Cs.current=se,$r.current=new Set);const Y=`${z}:${pe.index}`;$r.current.has(Y)||X.some(fe=>fe.variant==="subject"&&fe.variantOf===pe.index)||($r.current=new Set([...$r.current,Y]),ks(pe,z,se))},[X,U,se,E,ks]);const dl=oi(z=>{Ne("/api/form",{iconScale:z});const pe=pl();hl(pe,V,z)},250),jp=z=>{ne(z),dl(z)},fl=oi(z=>{Ne("/api/form",{iconBackground:z});const pe=pl();hl(pe,z,q)},120),Mp=z=>{Qe.current=!0,ye(z),fl(z)},pl=()=>M.iconPath.trim().length>0?M.iconPath.trim():G.iconPath.trim().length>0?G.iconPath.trim():void 0,hl=d.useCallback(async(z,pe,Y)=>{if(z===void 0){oe(void 0),W(void 0),ke.current=void 0,Se.current=void 0;return}Se.current=z;try{const fe=await Ne("/api/icon-analyze",{path:z});if(!fe.ok)throw new Error("analyze failed");const Fe=await fe.json();if(Se.current!==z)return;oe(Fe);const mt=await Ne("/api/icon-compose",{foregroundPath:z,background:pe,scale:Y});if(!mt.ok)throw new Error("compose failed");const Nt=await mt.json();if(Se.current!==z)return;W(Nt),ke.current=z}catch{oe(void 0),W(void 0),me("图标合成失败,预览未更新")}},[]);d.useEffect(()=>{uh()},[]);const Pp=d.useRef(!1);d.useEffect(()=>{t===null||n===t||(r(t),(async()=>{const z=await gf(t);if(z.status!==200||"code"in z.data)return;const pe=z.data;if(pe.command?.executable!==void 0&&s(pe.command.executable),pe.command?.args!==void 0&&a([...pe.command.args]),pe.command?.executable!==void 0&&u(Y=>({...Y,argsMode:"array"})),pe.appName!==void 0){const Y=pe.appName;O(fe=>({...fe,appName:Y}))}if(pe.icons?.imageSmoothingEnabled!==void 0){const Y=pe.icons.imageSmoothingEnabled;O(fe=>({...fe,imageSmoothingEnabled:Y}))}if(pe.developerMode!==void 0){const Y=pe.developerMode;O(fe=>({...fe,developerMode:Y,force:!0}))}if(pe.command?.cwd!==void 0){const Y=pe.command.cwd;u(fe=>({...fe,cwd:Y}))}if(pe.command?.env!==void 0){const Y=Object.entries(pe.command.env).map(([fe,Fe])=>({key:fe,value:Fe}));u(fe=>({...fe,env:Y}))}Pp.current=!0})())},[t,n]),d.useEffect(()=>{if(!p)return;let z=!1;return(async()=>{const pe=Tt.current;if(pe===null)return;const Y=await dh(pe);if(z||Y===void 0){z||N("ghostty-web 加载失败,输出将以纯文本显示");return}vt.current=Y,P(!0);const fe=un.current;un.current=[];for(const mt of fe)Y.write(mt);Y.onData(mt=>{gl.current&&Ne("/api/terminal-input",{data:mt})}),Y.onResize(({cols:mt,rows:Nt})=>{Ne("/api/terminal-resize",{cols:mt,rows:Nt})});const Fe=window.setInterval(()=>{if(!(il.current==="idle"&&!vt.current))try{Ze(Y.readState())}catch{}},300);return()=>window.clearInterval(Fe)})(),()=>{z=!0,vt.current?.dispose(),vt.current=void 0}},[p]);const gl=d.useRef(!0);d.useEffect(()=>{gl.current=D},[D]),d.useEffect(()=>{const z=Z1();return z.onmessage=pe=>{const Y=JSON.parse(pe.data);switch(Y.type){case"snapshot":{k(Y.state),R(Y.runAlive),b(Y.urlSource),s(Y.command),j(Y.command),u(Y.commandOptions),H(Y.interactive),O(Y.form),Z(Y.defaults),g(Y.targetDirExists),Q(Y.services),K(Y.selectedPort),ee(Y.icons??[]),ue(Y.iconsPort),be(Y.iconsGeneration??0),Ee(Y.urlSource!==void 0?[{port:0,url:Y.urlSource,history:[Y.urlSource],historyIndex:0}]:Y.services.map(Fe=>({port:Fe.port,url:Fe.url,history:[Fe.url],historyIndex:0})));const fe=Y.runAlive||Y.services.length>0||Y.urlSource!==void 0;m(fe),_e(Y.urlSource!==void 0?"svc-0":fe&&Y.services.length>0?`svc-${Y.services[0].port}`:"terminal");break}case"state":k(Y.state),Y.state==="failed"&&T(Y.reason),Y.state==="frozen"&&(At("confirm"),rt(!0)),Y.state==="materializing"&&(At("pending"),xt([])),Y.state==="success"&&At("success"),Y.state==="failed"&&ml.current&&(At("failed"),ze(Y.reason));break;case"log":{vt.current!==void 0?vt.current.write(Y.chunk):Al.current!==void 0?N(fe=>(fe??"")+Y.chunk):un.current.push(Y.chunk);break}case"term-mode":if(H(Y.interactive),!Y.interactive&&Y.message!==void 0){const fe=`\x1B[33m${Y.message}\x1B[0m\r
|
|
25
|
-
`;
|
|
17
|
+
`}return r}render(e,t,n){let r="";const o=this.rules;for(let s=0,i=e.length;s<i;s++){const a=e[s].type;a==="inline"?r+=this.renderInline(e[s].children,t,n):typeof o[a]<"u"?r+=o[a](e,s,t,n,this):r+=this.renderToken(e,s,t)}return r}},Hf=class{constructor(e,t,n){be(this,"tokens",[]),be(this,"inlineMode",!1),be(this,"Token",Bn),this.src=e,this.env=n,this.md=t}},Sv=/\r\n?|\n/g,Rv=/\0/g;function Dv(e){let t;t=e.src.replace(Sv,`
|
|
18
|
+
`),t=t.replace(Rv,"�"),e.src=t}function Fv(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Bv(e){const t=e.tokens;let n=0;for(let r=0;r<t.length;r++)t[r].type!=="reference_definition"&&(r!==n&&(t[n]=t[r]),n++);t.length!==n&&(t.length=n)}function jv(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const o=t[n];o.type==="inline"&&e.md.inline.parse(o.content,e.md,e.env,o.children)}}function Mv(e){return/^<a[>\s]/i.test(e)}function Nv(e){return/^<\/a\s*>/i.test(e)}function Tv(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.test(t[n].content))continue;let o=t[n].children,s=0;for(let i=o.length-1;i>=0;i--){const a=o[i];if(a.type==="link_close"){for(i--;o[i].level!==a.level&&o[i].type!=="link_open";)i--;continue}if(a.type==="html_inline"&&(Mv(a.content)&&s>0&&s--,Nv(a.content)&&s++),!(s>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const l=a.content;let u=e.md.linkify.match(l);const d=[];let p=a.level,A=0;u.length>0&&u[0].index===0&&i>0&&o[i-1].type==="text_special"&&(u=u.slice(1));for(let m=0;m<u.length;m++){const h=u[m].url,g=e.md.normalizeLink(h);if(!e.md.validateLink(g))continue;let x=u[m].text;u[m].schema?u[m].schema==="mailto:"&&!/^mailto:/i.test(x)?x=e.md.normalizeLinkText(`mailto:${x}`).replace(/^mailto:/,""):x=e.md.normalizeLinkText(x):x=e.md.normalizeLinkText(`http://${x}`).replace(/^http:\/\//,"");const b=u[m].index;if(b>A){const I=new e.Token("text","",0);I.content=l.slice(A,b),I.level=p,d.push(I)}const v=new e.Token("link_open","a",1);v.attrs=[["href",g]],v.level=p++,v.markup="linkify",v.info="auto",d.push(v);const y=new e.Token("text","",0);y.content=x,y.level=p,d.push(y);const C=new e.Token("link_close","a",-1);C.level=--p,C.markup="linkify",C.info="auto",d.push(C),A=u[m].lastIndex}if(A<l.length){const m=new e.Token("text","",0);m.content=l.slice(A),m.level=p,d.push(m)}t[n].children=o=Tf(o,i,d)}}}}var Kf=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Pv=/\((c|tm|r)\)/i,_v=/\((c|tm|r)\)/gi,Ov={c:"©",r:"®",tm:"™"};function Hv(e,t){return Ov[t.toLowerCase()]}function Kv(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(_v,Hv)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function Wv(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&Kf.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function Lv(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(Pv.test(e.tokens[t].content)&&Kv(e.tokens[t].children),Kf.test(e.tokens[t].content)&&Wv(e.tokens[t].children))}var Qv=/['"]/,Pc=/['"]/g,_c="’";function co(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Gv(e,t){let n="",r=0;t.sort((o,s)=>o.pos-s.pos);for(let o=0;o<t.length;o++){const s=t[o];n+=e.slice(r,s.pos)+s.ch,r=s.pos+1}return n+e.slice(r)}function Yv(e,t){let n;const r=[],o={};for(let s=0;s<e.length;s++){const i=e[s],a=e[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,i.type!=="text")continue;const l=i.content;let u=0;const d=l.length;e:for(;u<d;){Pc.lastIndex=u;const p=Pc.exec(l);if(!p)break;let A=!0,m=!0;u=p.index+1;const h=p[0]==="'";let g=32;if(p.index-1>=0)g=l.charCodeAt(p.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let x=32;if(u<d)x=l.charCodeAt(u);else for(n=s+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const b=Pr(g)||Tr(g),v=Pr(x)||Tr(x),y=Nr(g),C=Nr(x);if(C?A=!1:v&&(y||b||(A=!1)),y?m=!1:b&&(C||v||(m=!1)),x===34&&p[0]==='"'&&g>=48&&g<=57&&(m=A=!1),A&&m&&(A=b,m=v),!A&&!m){h&&co(o,s,p.index,_c);continue}if(m)for(n=r.length-1;n>=0;n--){let I=r[n];if(r[n].level<a)break;if(I.single===h&&r[n].level===a){I=r[n];let w,E;h?(w=t.md.options.quotes[2],E=t.md.options.quotes[3]):(w=t.md.options.quotes[0],E=t.md.options.quotes[1]),co(o,s,p.index,E),co(o,I.token,I.pos,w),r.length=n;continue e}}A?r.push({token:s,pos:p.index,single:h,level:a}):m&&h&&co(o,s,p.index,_c)}}Object.keys(o).forEach(function(s){const i=Number(s);e[i].content=Gv(e[i].content,o[s])})}function zv(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!Qv.test(e.tokens[t].content)||Yv(e.tokens[t].children,e)}function Uv(e){let t,n;const r=e.length;for(t=0;t<r;t++)e[t].type==="text_special"&&(e[t].type="text");for(t=n=0;t<r;t++)e[t].type==="text"&&t+1<r&&e[t+1].type==="text"?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}function Vv(e){let t,n;const r=e.tokens,o=r.length;for(let s=0;s<o;s++){if(r[s].type!=="inline")continue;const i=r[s].children,a=i.length;for(t=0;t<a;t++)i[t].type==="text_special"&&(i[t].type="text"),i[t].children&&Uv(i[t].children);for(t=n=0;t<a;t++)i[t].type==="text"&&t+1<a&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var Gs=[["normalize",Dv],["block",Fv],["strip_references",Bv],["inline",jv],["linkify",Tv],["replacements",Lv],["smartquotes",zv],["text_join",Vv]],Wf=class{constructor(){be(this,"ruler",new Or),be(this,"State",Hf);for(let e=0;e<Gs.length;e++)this.ruler.push(Gs[e][0],Gs[e][1])}process(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)}},Lf=class{constructor(e,t,n,r){be(this,"bMarks",[]),be(this,"eMarks",[]),be(this,"tShift",[]),be(this,"sCount",[]),be(this,"bsCount",[]),be(this,"blkIndent",0),be(this,"line",0),be(this,"lineMax",0),be(this,"tight",!1),be(this,"listIndent",-1),be(this,"parentType","root"),be(this,"level",0),be(this,"Token",Bn),this.src=e,this.md=t,this.env=n,this.tokens=r;const o=this.src;for(let s=0,i=0,a=0,l=0,u=o.length,d=!1;i<u;i++){const p=o.charCodeAt(i);if(!d)if(Ve(p)){a++,p===9?l+=4-l%4:l++;continue}else d=!0;(p===10||i===u-1)&&(p!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),d=!1,a=0,l=0,s=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){const r=new Bn(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){for(let t=this.src.length;e<t&&Ve(this.src.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;for(;e>t;)if(!Ve(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";const o=new Array(t-e);for(let s=0,i=e;i<t;i++,s++){let a=0;const l=this.bMarks[i];let u=l,d;for(i+1<t||r?d=this.eMarks[i]+1:d=this.eMarks[i];u<d&&a<n;){const p=this.src.charCodeAt(u);if(Ve(p))p===9?a+=4-(a+this.bsCount[i])%4:a++;else if(u-l<this.tShift[i])a++;else break;u++}a>n?o[s]=new Array(a-n+1).join(" ")+this.src.slice(u,d):o[s]=this.src.slice(u,d)}return o.join("")}},Zv=65536;function Ys(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Oc(e){const t=[],n=e.length;let r=0,o=e.charCodeAt(r),s=!1,i=0,a="";for(;r<n;)o===124&&(s?(a+=e.substring(i,r-1),i=r):(t.push(a+e.substring(i,r)),a="",i=r+1)),s=o===92,r++,o=e.charCodeAt(r);return t.push(a+e.substring(i)),t}function Jv(e,t,n,r){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const i=e.src.charCodeAt(s++);if(i!==124&&i!==45&&i!==58||s>=e.eMarks[o])return!1;const a=e.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!Ve(a)||i===45&&Ve(a))return!1;for(;s<e.eMarks[o];){const C=e.src.charCodeAt(s);if(C!==124&&C!==45&&C!==58&&!Ve(C))return!1;s++}let l=Ys(e,t+1),u=l.split("|");const d=[];for(let C=0;C<u.length;C++){const I=u[C].trim();if(!I){if(C===0||C===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(I))return!1;I.charCodeAt(I.length-1)===58?d.push(I.charCodeAt(0)===58?"center":"right"):I.charCodeAt(0)===58?d.push("left"):d.push("")}if(l=Ys(e,t).trim(),l.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=Oc(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const p=u.length;if(p===0||p!==d.length)return!1;if(r)return!0;const A=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRules("blockquote"),h=e.push("table_open","table",1),g=[t,0];h.map=g;const x=e.push("thead_open","thead",1);x.map=[t,t+1];const b=e.push("tr_open","tr",1);b.map=[t,t+1];for(let C=0;C<u.length;C++){const I=e.push("th_open","th",1);d[C]&&(I.attrs=[["style",`text-align:${d[C]}`]]);const w=e.push("inline","",0);w.content=u[C].trim(),w.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let v,y=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let C=!1;for(let w=0,E=m.length;w<E;w++)if(m[w](e,o,n,!0)){C=!0;break}if(C||(l=Ys(e,o).trim(),!l)||e.sCount[o]-e.blkIndent>=4||(u=Oc(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),y+=p-u.length,y>Zv))break;if(o===t+2){const w=e.push("tbody_open","tbody",1);w.map=v=[t+2,0]}const I=e.push("tr_open","tr",1);I.map=[o,o+1];for(let w=0;w<p;w++){const E=e.push("td_open","td",1);d[w]&&(E.attrs=[["style",`text-align:${d[w]}`]]);const S=e.push("inline","",0);S.content=u[w]?u[w].trim():"",S.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return v&&(e.push("tbody_close","tbody",-1),v[1]=o),e.push("table_close","table",-1),g[1]=o,e.parentType=A,e.line=o,!0}function $v(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,o=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,o=r;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=e.getLines(t,o,4+e.blkIndent,!1)+`
|
|
19
|
+
`,s.map=[t,e.line],!0}function Xv(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const i=e.src.charCodeAt(o);if(i!==126&&i!==96)return!1;let a=o;o=e.skipChars(o,i);let l=o-a;if(l<3)return!1;const u=e.src.slice(a,o),d=e.src.slice(o,s);if(i===96&&d.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let p=t,A=!1;for(;p++,!(p>=n||(o=a=e.bMarks[p]+e.tShift[p],s=e.eMarks[p],o<s&&e.sCount[p]<e.blkIndent));)if(e.src.charCodeAt(o)===i&&!(e.sCount[p]-e.blkIndent>=4)&&(o=e.skipChars(o,i),!(o-a<l)&&(o=e.skipSpaces(o),!(o<s)))){A=!0;break}l=e.sCount[t],e.line=p+(A?1:0);const m=e.push("fence","code",0);return m.info=d,m.content=e.getLines(t+1,p,l,!0),m.markup=u,m.map=[t,e.line],!0}function qv(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==62)return!1;if(r)return!0;const a=[],l=[],u=[],d=[],p=e.md.block.ruler.getRules("blockquote"),A=e.parentType;e.parentType="blockquote";let m=!1,h;for(h=t;h<n;h++){const y=e.sCount[h]<e.blkIndent;if(o=e.bMarks[h]+e.tShift[h],s=e.eMarks[h],o>=s)break;if(e.src.charCodeAt(o++)===62&&!y){let I=e.sCount[h]+1,w,E;e.src.charCodeAt(o)===32?(o++,I++,E=!1,w=!0):e.src.charCodeAt(o)===9?(w=!0,(e.bsCount[h]+I)%4===3?(o++,I++,E=!1):E=!0):w=!1;let S=I;for(a.push(e.bMarks[h]),e.bMarks[h]=o;o<s;){const D=e.src.charCodeAt(o);if(Ve(D))D===9?S+=4-(S+e.bsCount[h]+(E?1:0))%4:S++;else break;o++}m=o>=s,l.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(w?1:0),u.push(e.sCount[h]),e.sCount[h]=S-I,d.push(e.tShift[h]),e.tShift[h]=o-e.bMarks[h];continue}if(m)break;let C=!1;for(let I=0,w=p.length;I<w;I++)if(p[I](e,h,n,!0)){C=!0;break}if(C){e.lineMax=h,e.blkIndent!==0&&(a.push(e.bMarks[h]),l.push(e.bsCount[h]),d.push(e.tShift[h]),u.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}a.push(e.bMarks[h]),l.push(e.bsCount[h]),d.push(e.tShift[h]),u.push(e.sCount[h]),e.sCount[h]=-1}const g=e.blkIndent;e.blkIndent=0;const x=e.push("blockquote_open","blockquote",1);x.markup=">";const b=[t,0];x.map=b,e.md.block.tokenize(e,t,h);const v=e.push("blockquote_close","blockquote",-1);v.markup=">",e.lineMax=i,e.parentType=A,b[1]=e.line;for(let y=0;y<d.length;y++)e.bMarks[y+t]=a[y],e.tShift[y+t]=d[y],e.sCount[y+t]=u[y],e.bsCount[y+t]=l[y];return e.blkIndent=g,!0}function ey(e,t,n,r){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(s++);if(i!==42&&i!==45&&i!==95)return!1;let a=1;for(;s<o;){const u=e.src.charCodeAt(s++);if(u!==i&&!Ve(u))return!1;u===i&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(i)),!0}function Hc(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(r++);return o!==42&&o!==45&&o!==43||r<n&&!Ve(e.src.charCodeAt(r))?-1:r}function Kc(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let o=n;if(o+1>=r)return-1;let s=e.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=r)return-1;if(s=e.src.charCodeAt(o++),s>=48&&s<=57){if(o-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return o<r&&(s=e.src.charCodeAt(o),!Ve(s))?-1:o}function ty(e,t){const n=e.level+2;for(let r=t+2,o=e.tokens.length-2;r<o;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function ny(e,t,n,r){let o,s,i,a,l=t,u=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let d=!1;r&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(d=!0);let p,A,m;if((m=Kc(e,l))>=0){if(p=!0,i=e.bMarks[l]+e.tShift[l],A=Number(e.src.slice(i,m-1)),d&&A!==1)return!1}else if((m=Hc(e,l))>=0)p=!1;else return!1;if(d&&e.skipSpaces(m)>=e.eMarks[l])return!1;if(r)return!0;const h=e.src.charCodeAt(m-1),g=e.tokens.length;p?(a=e.push("ordered_list_open","ol",1),A!==1&&(a.attrs=[["start",A]])):a=e.push("bullet_list_open","ul",1);const x=[l,0];a.map=x,a.markup=String.fromCharCode(h);let b=!1;const v=e.md.block.ruler.getRules("list"),y=e.parentType;for(e.parentType="list";l<n;){s=m,o=e.eMarks[l];const C=e.sCount[l]+m-(e.bMarks[l]+e.tShift[l]);let I=C;for(;s<o;){const R=e.src.charCodeAt(s);if(R===9)I+=4-(I+e.bsCount[l])%4;else if(R===32)I++;else break;s++}const w=s;let E;w>=o?E=1:E=I-C,E>4&&(E=1);const S=C+E;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(h);const D=[l,0];a.map=D,p&&(a.info=e.src.slice(i,m-1));const k=e.tight,j=e.tShift[l],N=e.sCount[l],T=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=S,e.tight=!0,e.tShift[l]=w-e.bMarks[l],e.sCount[l]=I,w>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n),(!e.tight||b)&&(u=!1),b=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=T,e.tShift[l]=j,e.sCount[l]=N,e.tight=k,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(h),l=e.line,D[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let F=!1;for(let R=0,O=v.length;R<O;R++)if(v[R](e,l,n,!0)){F=!0;break}if(F)break;if(p){if(m=Kc(e,l),m<0)break;i=e.bMarks[l]+e.tShift[l]}else if(m=Hc(e,l),m<0)break;if(h!==e.src.charCodeAt(m-1))break}return p?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(h),x[1]=l,e.line=l,e.parentType=y,u&&ty(e,g),!0}function ry(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const I=e.lineMax;if(C>=I||e.isEmpty(C))return null;let w=!1;if(e.sCount[C]-e.blkIndent>3&&(w=!0),e.sCount[C]<0&&(w=!0),!w){const D=e.md.block.ruler.getRules("reference"),k=e.parentType;e.parentType="reference";let j=!1;for(let N=0,T=D.length;N<T;N++)if(D[N](e,C,I,!0)){j=!0;break}if(e.parentType=k,j)return null}const E=e.bMarks[C]+e.tShift[C],S=e.eMarks[C];return e.src.slice(E,S+1)}let l=e.src.slice(o,s+1);s=l.length;let u=-1;for(o=1;o<s;o++){const C=l.charCodeAt(o);if(C===91)return!1;if(C===93){u=o;break}else if(C===10){const I=a(i);I!==null&&(l+=I,s=l.length,i++)}else if(C===92&&(o++,o<s&&l.charCodeAt(o)===10)){const I=a(i);I!==null&&(l+=I,s=l.length,i++)}}if(u<0||l.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<s;o++){const C=l.charCodeAt(o);if(C===10){const I=a(i);I!==null&&(l+=I,s=l.length,i++)}else if(!Ve(C))break}const d=e.md.helpers.parseLinkDestination(l,o,s);if(!d.ok)return!1;const p=e.md.normalizeLink(d.str);if(!e.md.validateLink(p))return!1;o=d.pos;const A=o,m=i,h=o;for(;o<s;o++){const C=l.charCodeAt(o);if(C===10){const I=a(i);I!==null&&(l+=I,s=l.length,i++)}else if(!Ve(C))break}let g=e.md.helpers.parseLinkTitle(l,o,s);for(;g.can_continue;){const C=a(i);if(C===null)break;l+=C,o=s,s=l.length,i++,g=e.md.helpers.parseLinkTitle(l,o,s,g)}let x;for(o<s&&h!==o&&g.ok?(x=g.str,o=g.pos):(x="",o=A,i=m);o<s&&Ve(l.charCodeAt(o));)o++;if(o<s&&l.charCodeAt(o)!==10&&x)for(x="",o=A,i=m;o<s&&Ve(l.charCodeAt(o));)o++;if(o<s&&l.charCodeAt(o)!==10)return!1;const b=As(l.slice(1,u));if(!b)return!1;if(r)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:x,href:p});const v=e.push("reference_definition","",0);v.map=[t,i],v.hidden=!0;const y=Object.create(null);return y.label=b,v.meta=y,e.line=i,!0}var oy=["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"],Qf=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Gf="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",sy=new RegExp(`^(?:${Qf}|${Gf}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),iy=new RegExp(`^(?:${Qf}|${Gf})`),En=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${oy.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${iy.source}\\s*$`),/^$/,!1]];function ay(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let i=e.src.slice(o,s),a=0;for(;a<En.length&&!En[a][0].test(i);a++);if(a===En.length)return!1;if(r)return En[a][2];let l=t+1;const u=En[a][1].test("");if(!En[a][1].test(i)){for(;l<n&&!(e.sCount[l]<e.blkIndent&&(u||!e.isEmpty(l)));l++)if(o=e.bMarks[l]+e.tShift[l],s=e.eMarks[l],i=e.src.slice(o,s),En[a][1].test(i)){i.length!==0&&l++;break}}e.line=l;const d=e.push("html_block","",0);return d.map=[t,l],d.content=e.getLines(t,l,e.blkIndent,!0),!0}function ly(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(o);if(i!==35||o>=s)return!1;let a=1;for(i=e.src.charCodeAt(++o);i===35&&o<s&&a<=6;)a++,i=e.src.charCodeAt(++o);if(a>6||o<s&&!Ve(i))return!1;if(r)return!0;s=e.skipSpacesBack(s,o);const l=e.skipCharsBack(s,35,o);l>o&&Ve(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;const u=e.push("heading_open",`h${a}`,1);u.markup="########".slice(0,a),u.map=[t,e.line];const d=e.push("inline","",0);d.content=gs(e.src.slice(o,s)),d.map=[t,e.line],d.children=[];const p=e.push("heading_close",`h${a}`,-1);return p.markup="########".slice(0,a),!0}function cy(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let s=0,i,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let m=e.bMarks[a]+e.tShift[a];const h=e.eMarks[a];if(m<h&&(i=e.src.charCodeAt(m),(i===45||i===61)&&(m=e.skipChars(m,i),m=e.skipSpaces(m),m>=h))){s=i===61?1:2;break}}if(e.sCount[a]<0)continue;let A=!1;for(let m=0,h=r.length;m<h;m++)if(r[m](e,a,n,!0)){A=!0;break}if(A)break}if(!s)return e.parentType=o,!1;const l=gs(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const u=e.push("heading_open",`h${s}`,1);u.markup=String.fromCharCode(i),u.map=[t,e.line];const d=e.push("inline","",0);d.content=l,d.map=[t,e.line-1],d.children=[];const p=e.push("heading_close",`h${s}`,-1);return p.markup=String.fromCharCode(i),e.parentType=o,!0}function uy(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let s=t+1;for(e.parentType="paragraph";s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3||e.sCount[s]<0)continue;let u=!1;for(let d=0,p=r.length;d<p;d++)if(r[d](e,s,n,!0)){u=!0;break}if(u)break}const i=gs(e.getLines(t,s,e.blkIndent,!1));e.line=s;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const l=e.push("inline","",0);return l.content=i,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}var uo=[["table",Jv,["paragraph","reference"]],["code",$v],["fence",Xv,["paragraph","reference","blockquote","list"]],["blockquote",qv,["paragraph","reference","blockquote","list"]],["hr",ey,["paragraph","reference","blockquote","list"]],["list",ny,["paragraph","reference","blockquote"]],["reference",ry],["html_block",ay,["paragraph","reference","blockquote"]],["heading",ly,["paragraph","reference","blockquote"]],["lheading",cy],["paragraph",uy]],Yf=class{constructor(){be(this,"ruler",new Or),be(this,"State",Lf);for(let e=0;e<uo.length;e++)this.ruler.push(uo[e][0],uo[e][1],{alt:(uo[e][2]||[]).slice()})}tokenize(e,t,n){const r=this.ruler.getRules(""),o=r.length,s=e.md.options.maxNesting;let i=t,a=!1;for(;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n||e.sCount[i]<e.blkIndent));){if(e.level>=s){e.line=n;break}const l=e.line;let u=!1;for(let d=0;d<o;d++)if(u=r[d](e,i,n,!1),u){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),i=e.line,i<n&&e.isEmpty(i)&&(a=!0,i++,e.line=i)}}parse(e,t,n,r){if(!e)return;const o=new this.State(e,t,n,r);this.tokenize(o,o.line,o.lineMax)}},zf=class{constructor(e,t,n,r){be(this,"pos",0),be(this,"level",0),be(this,"pending",""),be(this,"pendingLevel",0),be(this,"cache",{}),be(this,"backticks",{}),be(this,"backticksScanned",!1),be(this,"linkLevel",0),be(this,"delimiters",[]),be(this,"_prev_delimiters",[]),be(this,"Token",Bn),this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){const e=new Bn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){this.pending&&this.pushPending();const r=new Bn(e,t,n);let o;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r}scanDelims(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let o;if(e===0)o=32;else if(e===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(e-1),(o&64512)===56320){const h=this.src.charCodeAt(e-2);o=(h&64512)===55296?65536+(h-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=e;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const i=s-e;let a=s<n?this.src.charCodeAt(s):32;if((a&64512)===55296){const h=this.src.charCodeAt(s+1);a=(h&64512)===56320?65536+(a-55296<<10)+(h-56320):65533}else(a&64512)===56320&&(a=65533);const l=Pr(o)||Tr(o),u=Pr(a)||Tr(a),d=Nr(o),p=Nr(a),A=!p&&(!u||d||l),m=!d&&(!l||p||u);return{can_open:A&&(t||!m||l),can_close:m&&(t||!A||u),length:i}}};function dy(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function fy(e,t){let n=e.pos;for(;n<e.posMax&&!dy(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var py=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function hy(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=e.pending.match(py);if(!o)return!1;const s=o[1],i=e.md.linkify.matchAtStart(e.src.slice(n-s.length));if(!i)return!1;let a=i.url;if(a.length<=s.length)return!1;let l=a.length;for(;l>0&&a.charCodeAt(l-1)===42;)l--;l!==a.length&&(a=a.slice(0,l));const u=e.md.normalizeLink(a);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const d=e.push("link_open","a",1);d.attrs=[["href",u]],d.markup="linkify",d.info="auto";const p=e.push("text","",0);p.content=e.md.normalizeLinkText(a);const A=e.push("link_close","a",-1);A.markup="linkify",A.info="auto"}return e.pos+=a.length-s.length,!0}function Ay(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,o=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<o&&Ve(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Za=[];for(let e=0;e<256;e++)Za.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Za[e.charCodeAt(0)]=1});function gy(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=e.src.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(o=e.src.charCodeAt(n),!!Ve(o));)n++;return e.pos=n,!0}if(o===32){if(!t){const a=e.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return e.pos=n,!0}let s=e.src[n];if(o>=55296&&o<=56319&&n+1<r){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=e.src[n+1],n++)}const i="\\"+s;if(!t){const a=e.push("text_special","",0);o<256&&Za[o]!==0?a.content=s:a.content=i,a.markup=i,a.info="escape"}return e.pos=n+1,!0}function my(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(r,n),i=s.length;if(e.backticksScanned&&(e.backticks[i]||0)<=r)return t||(e.pending+=s),e.pos+=i,!0;let a=n,l;for(;(l=e.src.indexOf("`",a))!==-1;){for(a=l+1;a<o&&e.src.charCodeAt(a)===96;)a++;const u=a-l;if(u===i){if(!t){const d=e.push("code_inline","code",0);d.markup=s,d.content=e.src.slice(n,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[u]=l}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=i,!0}function xy(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const o=e.scanDelims(e.pos,!0);let s=o.length;const i=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=i,s--);for(let l=0;l<s;l+=2)a=e.push("text","",0),a.content=i+i,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function Wc(e,t){let n;const r=[],o=t.length;for(let s=0;s<o;s++){const i=t[s];if(i.marker!==126||i.end===-1)continue;const a=t[i.end];n=e.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let i=s+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,s!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[s],e.tokens[s]=n)}}function by(e){const t=e.tokens_meta,n=e.tokens_meta.length;Wc(e,e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Wc(e,s)}}var Uf={tokenize:xy,postProcess:by};function vy(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const o=e.scanDelims(e.pos,r===42);for(let s=0;s<o.length;s++){const i=e.push("text","",0);i.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Lc(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const o=t[r];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const s=t[o.end],i=r>0&&t[r-1].end===o.end+1&&t[r-1].marker===o.marker&&t[r-1].token===o.token-1&&t[o.end+1].token===s.token+1,a=String.fromCharCode(o.marker),l=e.tokens[o.token];l.type=i?"strong_open":"em_open",l.tag=i?"strong":"em",l.nesting=1,l.markup=i?a+a:a,l.content="";const u=e.tokens[s.token];u.type=i?"strong_close":"em_close",u.tag=i?"strong":"em",u.nesting=-1,u.markup=i?a+a:a,u.content="",i&&(e.tokens[t[r-1].token].content="",e.tokens[t[o.end+1].token].content="",r--)}}function yy(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lc(e,e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Lc(e,s)}}var Vf={tokenize:vy,postProcess:yy};function Cy(e,t){let n,r,o,s,i="",a="",l=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const d=e.pos,p=e.posMax,A=e.pos+1,m=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(m<0)return!1;let h=m+1;if(h<p&&e.src.charCodeAt(h)===40){for(u=!1,h++;h<p&&(n=e.src.charCodeAt(h),!(!Ve(n)&&n!==10));h++);if(h>=p)return!1;if(l=h,o=e.md.helpers.parseLinkDestination(e.src,h,e.posMax),o.ok){for(i=e.md.normalizeLink(o.str),e.md.validateLink(i)?h=o.pos:i="",l=h;h<p&&(n=e.src.charCodeAt(h),!(!Ve(n)&&n!==10));h++);if(o=e.md.helpers.parseLinkTitle(e.src,h,e.posMax),h<p&&l!==h&&o.ok)for(a=o.str,h=o.pos;h<p&&(n=e.src.charCodeAt(h),!(!Ve(n)&&n!==10));h++);}(h>=p||e.src.charCodeAt(h)!==41)&&(u=!0),h++}if(u){if(typeof e.env.references>"u")return!1;if(h<p&&e.src.charCodeAt(h)===91?(l=h+1,h=e.md.helpers.parseLinkLabel(e,h),h>=0?r=e.src.slice(l,h++):h=m+1):h=m+1,r||(r=e.src.slice(A,m)),r=As(r),s=e.env.references[r],!s)return e.pos=d,!1;i=s.href,a=s.title}if(!t){e.pos=A,e.posMax=m;const g=e.push("link_open","a",1),x=[["href",i]];if(g.attrs=x,a&&x.push(["title",a]),r){const b=Object.create(null);b.label=r,g.meta=b}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=p,!0}function Iy(e,t){let n,r,o,s,i,a,l,u,d="";const p=e.pos,A=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,h=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(h<0)return!1;if(s=h+1,s<A&&e.src.charCodeAt(s)===40){for(s++;s<A&&(n=e.src.charCodeAt(s),!(!Ve(n)&&n!==10));s++);if(s>=A)return!1;for(u=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(d=e.md.normalizeLink(a.str),e.md.validateLink(d)?s=a.pos:d=""),u=s;s<A&&(n=e.src.charCodeAt(s),!(!Ve(n)&&n!==10));s++);if(a=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<A&&u!==s&&a.ok)for(l=a.str,s=a.pos;s<A&&(n=e.src.charCodeAt(s),!(!Ve(n)&&n!==10));s++);else l="";if(s>=A||e.src.charCodeAt(s)!==41)return e.pos=p,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s<A&&e.src.charCodeAt(s)===91?(u=s+1,s=e.md.helpers.parseLinkLabel(e,s),s>=0?o=e.src.slice(u,s++):s=h+1):s=h+1,o||(o=e.src.slice(m,h)),o=As(o),i=e.env.references[o],!i)return e.pos=p,!1;d=i.href,l=i.title}if(!t){r=e.src.slice(m,h);const g=[];e.md.inline.parse(r,e.md,e.env,g);const x=e.push("image","img",0),b=[["src",d],["alt",""]];if(x.attrs=b,x.children=g,x.content=r,l&&b.push(["title",l]),o){const v=Object.create(null);v.label=o,x.meta=v}}return e.pos=s,e.posMax=A,!0}var wy=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,ky=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Ey(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,o=e.posMax;for(;;){if(++n>=o)return!1;const i=e.src.charCodeAt(n);if(i===60)return!1;if(i===62)break}const s=e.src.slice(r+1,n);if(ky.test(s)){const i=e.md.normalizeLink(s);if(!e.md.validateLink(i))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(s);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=s.length+2,!0}if(wy.test(s)){const i=e.md.normalizeLink(`mailto:${s}`);if(!e.md.validateLink(i))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(s);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=s.length+2,!0}return!1}function Sy(e){return/^<a[>\s]/i.test(e)}function Ry(e){return/^<\/a\s*>/i.test(e)}function Dy(e){const t=e|32;return t>=97&&t<=122}function Fy(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const o=e.src.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!Dy(o))return!1;const s=e.src.slice(r).match(sy);if(!s)return!1;if(!t){const i=e.push("html_inline","",0);i.content=s[0],Sy(i.content)&&e.linkLevel++,Ry(i.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}var By=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,jy=/^&([a-z][a-z0-9]{1,31});/i;function My(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(By);if(o){if(!t){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=e.push("text_special","",0);i.content=Va(s)?Mr(s):Mr(65533),i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(jy);if(o){const s=wf(o[0]);if(s!==o[0]){if(!t){const i=e.push("text_special","",0);i.content=s,i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function Qc(e){const t={},n=e.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const a=e[i];if(s.push(0),(e[r].marker!==a.marker||o!==a.token-1)&&(r=i),o=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const l=t[a.marker][(a.open?3:0)+a.length%3];let u=r-s[r]-1,d=u;for(;u>l;u-=s[u]+1){const p=e[u];if(p.marker===a.marker&&p.open&&p.end<0){let A=!1;if((p.close||a.open)&&(p.length+a.length)%3===0&&(p.length%3!==0||a.length%3!==0)&&(A=!0),!A){const m=u>0&&!e[u-1].open?s[u-1]+1:0;s[i]=i-u+m,s[u]=m,a.open=!1,p.end=i,p.close=!1,d=-1,o=-2;break}}}d!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=d)}}function Ny(e){const t=e.tokens_meta,n=e.tokens_meta.length;Qc(e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Qc(s)}}function Ty(e){let t,n,r=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)o[t].nesting<0&&r--,o[t].level=r,o[t].nesting>0&&r++,o[t].type==="text"&&t+1<s&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}var zs=[["text",fy],["linkify",hy],["newline",Ay],["escape",gy],["backticks",my],["strikethrough",Uf.tokenize],["emphasis",Vf.tokenize],["link",Cy],["image",Iy],["autolink",Ey],["html_inline",Fy],["entity",My]],Us=[["balance_pairs",Ny],["strikethrough",Uf.postProcess],["emphasis",Vf.postProcess],["fragments_join",Ty]],Zf=class{constructor(){be(this,"ruler",new Or),be(this,"ruler2",new Or),be(this,"State",zf);for(let e=0;e<zs.length;e++)this.ruler.push(zs[e][0],zs[e][1]);for(let e=0;e<Us.length;e++)this.ruler2.push(Us[e][0],Us[e][1])}skipToken(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting,s=e.cache;if(typeof s[t]<"u"){e.pos=s[t];return}let i=!1;if(e.level<o){for(let a=0;a<r;a++)if(e.level++,i=n[a](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,s[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,o=e.md.options.maxNesting;for(;e.pos<r;){const s=e.pos;let i=!1;if(e.level<o){for(let a=0;a<n;a++)if(i=t[a](e,!1),i){if(s>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){const o=new this.State(e,t,n,r);this.tokenize(o);const s=this.ruler2.getRules(""),i=s.length;for(let a=0;a<i;a++)s[a](o)}},Py={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},_y=/^(vbscript|javascript|file|data):/,Oy=/^data:image\/(gif|png|jpeg|webp);/,Gc=["http:","https:","mailto:"],$t=class{validateLink(e){const t=e.trim().toLowerCase();return _y.test(t)?Oy.test(t):!0}normalizeLink(e){const t=wi(e,!0);if(t.hostname&&(!t.protocol||Gc.indexOf(t.protocol)>=0))try{t.hostname=Mc.toASCII(t.hostname)}catch{}return Vr(Ii(t))}normalizeLinkText(e){const t=wi(e,!0);if(t.hostname&&(!t.protocol||Gc.indexOf(t.protocol)>=0))try{t.hostname=Mc.toUnicode(t.hostname)}catch{}return nr(Ii(t),nr.defaultChars+"%")}constructor(...e){be(this,"inline",new Zf),be(this,"block",new Yf),be(this,"core",new Wf),be(this,"renderer",new Of),be(this,"linkify",new $b),be(this,"utils",cv),be(this,"helpers",Object.assign({},wv));const[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){const o=e;if(t=Py[o],!t)throw new Error(`Wrong 'markdown-it' preset "${o}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});const n=t.components;if(n){var r;["core","block","inline"].forEach(s=>{var i;const a=(i=n[s])===null||i===void 0?void 0:i.rules;a&&this[s].ruler.enableOnly(a)});const o=(r=n.inline)===null||r===void 0?void 0:r.rules2;o&&this.inline.ruler2.enableOnly(o)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(o=>n.indexOf(o)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(o=>n.indexOf(o)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};be($t,"Token",Bn);be($t,"Ruler",Or);be($t,"Renderer",Of);be($t,"ParserCore",Wf);be($t,"StateCore",Hf);be($t,"ParserBlock",Yf);be($t,"StateBlock",Lf);be($t,"ParserInline",Zf);be($t,"StateInline",zf);var Hy=Nf($t),Vs,Yc;function Ky(){return Yc||(Yc=1,Vs=function(t,n){var r=3,o="-",s=o.charCodeAt(0),i=o.length;function a(l,u,d,p){var A,m,h,g,x,b,v,y=!1,C=l.bMarks[u]+l.tShift[u],I=l.eMarks[u];if(u!==0||s!==l.src.charCodeAt(0))return!1;for(A=C+1;A<=I;A++)if(o[(A-C)%i]!==l.src[A]){v=A+1;break}if(h=Math.floor((A-C)/i),h<r)return!1;if(A-=(A-C)%i,p)return!0;for(m=u;m++,!(m>=d||l.src.slice(C,I)==="..."||(C=l.bMarks[m]+l.tShift[m],I=l.eMarks[m],C<I&&l.sCount[m]<l.blkIndent));)if(s===l.src.charCodeAt(C)&&!(l.sCount[m]-l.blkIndent>=4)){for(A=C+1;A<=I&&o[(A-C)%i]===l.src[A];A++);if(!(Math.floor((A-C)/i)<h)&&(A-=(A-C)%i,A=l.skipSpaces(A),!(A<I))){y=!0;break}}return x=l.parentType,b=l.lineMax,l.parentType="container",l.lineMax=m,g=l.push("front_matter",null,0),g.hidden=!0,g.markup=l.src.slice(u,A),g.block=!0,g.map=[u,m+(y?1:0)],g.meta=l.src.slice(v,C-1),l.parentType=x,l.lineMax=b,l.line=m+(y?1:0),n(g.meta),!0}t.block.ruler.before("table","front_matter",a,{alt:["paragraph","reference","blockquote","list"]})}),Vs}var Wy=Ky();const Ly=Zp(Wy);var Qy=Object.defineProperty,Gy=Object.defineProperties,Yy=Object.getOwnPropertyDescriptors,zc=Object.getOwnPropertySymbols,zy=Object.prototype.hasOwnProperty,Uy=Object.prototype.propertyIsEnumerable,Uc=(e,t,n)=>t in e?Qy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ut=(e,t)=>{for(var n in t||(t={}))zy.call(t,n)&&Uc(e,n,t[n]);if(zc)for(var n of zc(t))Uy.call(t,n)&&Uc(e,n,t[n]);return e},Hr=(e,t)=>Gy(e,Yy(t)),_o=(e,t,n)=>new Promise((r,o)=>{var s=l=>{try{a(n.next(l))}catch(u){o(u)}},i=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,i);a((n=n.apply(e,t)).next())});function Vy(e,t){return typeof e=="function"?e(t):e}function Kr(e,t){return n=>{t.setState(r=>Hr(ut({},r),{[e]:Vy(n,r[e])}))}}var Vc=(e,t=100,n=1e3)=>new Promise(r=>{let o;const s=setInterval(()=>{e()&&(r(),clearInterval(s),clearTimeout(o))},t);o=setTimeout(()=>{clearInterval(s),r()},n)}),Jf="Headless Tree: ",Ei=e=>Error(Jf+e),Zy=e=>console.warn(Jf+e),Jy={key:"tree",getInitialState:e=>ut({expandedItems:[],focusedItem:null},e),getDefaultConfig:(e,t)=>ut({setExpandedItems:Kr("expandedItems",t),setFocusedItem:Kr("focusedItem",t)},e),stateHandlerNames:{expandedItems:"setExpandedItems",focusedItem:"setFocusedItem"},treeInstance:{getItemsMeta:({tree:e})=>{const{rootItemId:t}=e.getConfig(),{expandedItems:n}=e.getState(),r=[],o=new Set(n),s=(l,u,d,p,A)=>{var m;if(u.includes(l)){Zy(`Circular reference for ${u.join(".")}`);return}if(r.push({itemId:l,level:d,index:r.length,parentId:u.at(-1),setSize:p,posInSet:A}),o.has(l)){const h=(m=e.retrieveChildrenIds(l))!=null?m:[];let g=0;for(const x of h)s(x,u.concat(l),d+1,h.length,g++)}},i=e.retrieveChildrenIds(t);let a=0;for(const l of i)s(l,[t],0,i.length,a++);return r},getFocusedItem:({tree:e})=>{var t;const n=e.getState().focusedItem;return(t=n!==null?e.getItemInstance(n):null)!=null?t:e.getItems()[0]},getRootItem:({tree:e})=>{const{rootItemId:t}=e.getConfig();return e.getItemInstance(t)},focusNextItem:({tree:e})=>{var t;const n=e.getFocusedItem().getItemMeta();if(!n)return;const r=Math.min(n.index+1,e.getItems().length-1);(t=e.getItems()[r])==null||t.setFocused()},focusPreviousItem:({tree:e})=>{var t;const n=e.getFocusedItem().getItemMeta();if(!n)return;const r=Math.max(n.index-1,0);(t=e.getItems()[r])==null||t.setFocused()},updateDomFocus:({tree:e})=>{setTimeout(()=>_o(null,null,function*(){var t,n,r,o,s;const i=e.getFocusedItem();(n=(t=e.getConfig()).scrollToItem)==null||n.call(t,i),yield Vc(()=>i.getElement()!==null,20,500);const a=i.getElement();if(!a){(r=e.getItems()[0])==null||r.setFocused(),(s=(o=e.getItems()[0])==null?void 0:o.getElement())==null||s.focus();return}a.focus()}))},getContainerProps:({prev:e,tree:t},n)=>Hr(ut({},e?.()),{role:"tree","aria-label":n??"",ref:t.registerElement}),isSearchOpen:()=>!1},itemInstance:{scrollTo:(e,t)=>_o(null,[e,t],function*({tree:n,item:r},o){var s,i,a;(i=(s=n.getConfig()).scrollToItem)==null||i.call(s,r),yield Vc(()=>r.getElement()!==null,20),(a=r.getElement())==null||a.scrollIntoView(o)}),getId:({itemId:e})=>e,getKey:({itemId:e})=>e,getProps:({item:e,prev:t})=>{const n=e.getItemMeta();return Hr(ut({},t?.()),{ref:e.registerElement,role:"treeitem","aria-setsize":n.setSize,"aria-posinset":n.posInSet+1,"aria-selected":"false","aria-label":e.getItemName(),"aria-level":n.level+1,"aria-expanded":e.isFolder()?e.isExpanded():void 0,tabIndex:e.isFocused()?0:-1,onClick:r=>{e.setFocused(),e.primaryAction(),!(r.ctrlKey||r.shiftKey||r.metaKey)&&e.isFolder()&&(e.isExpanded()?e.collapse():e.expand())}})},expand:({tree:e,item:t,itemId:n})=>{var r;t.isFolder()&&((r=e.getState().loadingItemChildrens)!=null&&r.includes(n)||(e.applySubStateUpdate("expandedItems",o=>[...o,n]),e.rebuildTree()))},collapse:({tree:e,item:t,itemId:n})=>{t.isFolder()&&(e.applySubStateUpdate("expandedItems",r=>r.filter(o=>o!==n)),e.rebuildTree())},getItemData:({tree:e,itemId:t})=>e.retrieveItemData(t),equals:({item:e},t)=>e.getId()===t?.getId(),isExpanded:({tree:e,itemId:t})=>e.getState().expandedItems.includes(t),isDescendentOf:({item:e},t)=>{const n=e.getParent();return!!(n?.getId()===t||n?.isDescendentOf(t))},isFocused:({tree:e,item:t,itemId:n})=>e.getState().focusedItem===n||e.getState().focusedItem===null&&t.getItemMeta().index===0,isFolder:({tree:e,item:t,itemId:n})=>n===e.getConfig().rootItemId||e.getConfig().isItemFolder(t),getItemName:({tree:e,item:t})=>e.getConfig().getItemName(t),setFocused:({tree:e,itemId:t})=>{e.applySubStateUpdate("focusedItem",t)},primaryAction:({tree:e,item:t})=>{var n,r;return(r=(n=e.getConfig()).onPrimaryAction)==null?void 0:r.call(n,t)},getParent:({tree:e,item:t})=>t.getItemMeta().parentId?e.getItemInstance(t.getItemMeta().parentId):void 0,getIndexInParent:({item:e})=>e.getItemMeta().posInSet,getChildren:({tree:e,itemId:t})=>e.retrieveChildrenIds(t).map(n=>e.getItemInstance(n)),getTree:({tree:e})=>e,getItemAbove:({tree:e,item:t})=>e.getItems()[t.getItemMeta().index-1],getItemBelow:({tree:e,item:t})=>e.getItems()[t.getItemMeta().index+1]},hotkeys:{focusNextItem:{hotkey:"ArrowDown",canRepeat:!0,preventDefault:!0,isEnabled:e=>{var t,n;return!((n=(t=e.isSearchOpen)==null?void 0:t.call(e))!=null&&n)&&!e.getState().dnd},handler:(e,t)=>{t.focusNextItem(),t.updateDomFocus()}},focusPreviousItem:{hotkey:"ArrowUp",canRepeat:!0,preventDefault:!0,isEnabled:e=>{var t,n;return!((n=(t=e.isSearchOpen)==null?void 0:t.call(e))!=null&&n)&&!e.getState().dnd},handler:(e,t)=>{t.focusPreviousItem(),t.updateDomFocus()}},expandOrDown:{hotkey:"ArrowRight",canRepeat:!0,handler:(e,t)=>{const n=t.getFocusedItem();n.isExpanded()||!n.isFolder()?(t.focusNextItem(),t.updateDomFocus()):n.expand()}},collapseOrUp:{hotkey:"ArrowLeft",canRepeat:!0,handler:(e,t)=>{var n;const r=t.getFocusedItem();(!r.isExpanded()||!r.isFolder())&&r.getItemMeta().level!==0?((n=r.getParent())==null||n.setFocused(),t.updateDomFocus()):r.collapse()}},focusFirstItem:{hotkey:"Home",handler:(e,t)=>{var n;(n=t.getItems()[0])==null||n.setFocused(),t.updateDomFocus()}},focusLastItem:{hotkey:"End",handler:(e,t)=>{var n;(n=t.getItems()[t.getItems().length-1])==null||n.setFocused(),t.updateDomFocus()}}}},$y=(e,t,n)=>{const r={};return[r,()=>{const s=n(r);e:for(let i=0;i<e.length;i++){const a=e[i][t];if(!a)continue e;t:for(const[l,u]of Object.entries(a)){if(!u)continue t;const d=r[l];r[l]=(...p)=>u(Hr(ut({},s),{prev:d}),...p)}}}]},Xy=e=>{var t;const n=e?.map(r=>r.key);for(const r of e??[]){const o=(t=r.deps)==null?void 0:t.find(s=>!n?.includes(s));if(o)throw Ei(`${r.key} needs ${o}`)}},qy=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)for(let o=r+1;o<n;o++)t(e[o],e[r])<0&&([e[r],e[o]]=[e[o],e[r]]);return e},e1=e=>(t,n)=>{var r,o;return n.key&&((r=t.overwrites)!=null&&r.includes(n.key))?1:t.key&&((o=n.overwrites)!=null&&o.includes(t.key))?-1:e.indexOf(t)-e.indexOf(n)},t1=(e=[])=>qy(e,e1(e)),n1=e=>{var t,n,r,o;const s=(t=e.instanceBuilder)!=null?t:$y,i=[Jy,...t1(e.features)];Xy(i);const a=[...i],[l,u]=s(a,"treeInstance",D=>({tree:D}));let d=i.reduce((D,k)=>{var j,N;return(N=(j=k.getInitialState)==null?void 0:j.call(k,D,l))!=null?N:D},(r=(n=e.initialState)!=null?n:e.state)!=null?r:{}),p=i.reduce((D,k)=>{var j,N;return(N=(j=k.getDefaultConfig)==null?void 0:j.call(k,D,l))!=null?N:D},e);const A=i.reduce((D,k)=>ut(ut({},D),k.stateHandlerNames),{});let m;const h={current:{}};let g=!1;const x={};let b=[];const v={},y={};let C={};const I={},w=()=>{b=[],C={};const[D,k]=s(a,"itemInstance",j=>({item:j,tree:l,itemId:p.rootItemId}));k(),x[p.rootItemId]=D,C[p.rootItemId]={itemId:p.rootItemId,index:-1,parentId:null,level:-1,posInSet:0,setSize:1};for(const j of l.getItemsMeta())if(C[j.itemId]=j,x[j.itemId])b.push(x[j.itemId]);else{const[N,T]=s(a,"itemInstance",F=>({item:F,tree:l,itemId:j.itemId}));T(),x[j.itemId]=N,b.push(N)}g=!1},E=D=>{for(const k of i)D(k)},S={key:"main",treeInstance:{getState:()=>d,setState:({},D)=>{var k;(k=p.setState)==null||k.call(p,d)},setMounted:({},D)=>{var k;const j=h.current;j.isMounted=D,D&&((k=j.waitingForMount)==null||k.forEach(N=>N()),j.waitingForMount=[])},applySubStateUpdate:({},D,k)=>{var j;const N=()=>{d[D]=typeof k=="function"?k(d[D]):k;const F=p[A[D]];F?.(d[D])},T=h.current;T.isMounted?N():((j=T.waitingForMount)!=null||(T.waitingForMount=[]),T.waitingForMount.push(N))},rebuildTree:()=>{var D,k;const j=h.current;j.isMounted?(w(),(D=p.setState)==null||D.call(p,d)):((k=j.waitingForMount)!=null||(j.waitingForMount=[]),j.waitingForMount.push(()=>{var N;w(),(N=p.setState)==null||N.call(p,d)}))},scheduleRebuildTree:()=>{g=!0},getConfig:()=>p,setConfig:(D,k)=>{var j,N,T;const F=typeof k=="function"?k(p):k,R=((j=F.state)==null?void 0:j.expandedItems)&&((N=F.state)==null?void 0:N.expandedItems)!==d.expandedItems;p=F,F.state&&(d=ut(ut({},d),F.state)),R&&(w(),(T=p.setState)==null||T.call(p,d))},getItemInstance:({},D)=>{const k=x[D];if(!k){const[j,N]=s(a,"itemInstance",T=>({item:T,tree:l,itemId:D}));return N(),j}return k},getItems:()=>(g&&w(),b),registerElement:({},D)=>{m!==D&&(m&&!D?E(k=>{var j;return(j=k.onTreeUnmount)==null?void 0:j.call(k,l,m)}):!m&&D&&E(k=>{var j;return(j=k.onTreeMount)==null?void 0:j.call(k,l,D)}),m=D)},getElement:()=>m,getDataRef:()=>h,getHotkeyPresets:()=>I},itemInstance:{registerElement:({itemId:D,item:k},j)=>{if(v[D]===j)return;const N=v[D];N&&!j?E(T=>{var F;return(F=T.onItemUnmount)==null?void 0:F.call(T,k,N,l)}):!N&&j&&E(T=>{var F;return(F=T.onItemMount)==null?void 0:F.call(T,k,j,l)}),v[D]=j},getElement:({itemId:D})=>v[D],getDataRef:({itemId:D})=>{var k;return(k=y[D])!=null?k:y[D]={current:{}}},getItemMeta:({itemId:D})=>{var k;return(k=C[D])!=null?k:{itemId:D,parentId:null,level:-1,index:-1,posInSet:0,setSize:1}}}};a.unshift(S);for(const D of a)Object.assign(I,(o=D.hotkeys)!=null?o:{});return u(),l},r1={key:"selection",getInitialState:e=>ut({selectedItems:[]},e),getDefaultConfig:(e,t)=>ut({setSelectedItems:Kr("selectedItems",t)},e),stateHandlerNames:{selectedItems:"setSelectedItems"},treeInstance:{setSelectedItems:({tree:e},t)=>{e.applySubStateUpdate("selectedItems",t)},getSelectedItems:({tree:e})=>e.getState().selectedItems.map(e.getItemInstance)},itemInstance:{select:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();e.setSelectedItems(n.includes(t)?n:[...n,t])},deselect:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();e.setSelectedItems(n.filter(r=>r!==t))},isSelected:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();return n.includes(t)},selectUpTo:({tree:e,item:t,itemId:n},r)=>{const o=t.getItemMeta().index,s=e.getDataRef();if(!s.current.selectUpToAnchorId){s.current.selectUpToAnchorId=n,e.setSelectedItems([n]);return}const a=e.getItemInstance(s.current.selectUpToAnchorId).getItemMeta().index,[l,u]=o<a?[o,a]:[a,o],d=e.getItems().slice(l,u+1).map(m=>m.getItemMeta().itemId);if(!r){e.setSelectedItems(d);return}const{selectedItems:p}=e.getState(),A=[...new Set([...p,...d])];e.setSelectedItems(A)},toggleSelect:({item:e})=>{e.isSelected()?e.deselect():e.select()},getProps:({tree:e,item:t,itemId:n,prev:r})=>Hr(ut({},r?.()),{"aria-selected":t.isSelected()?"true":"false",onClick:o=>{var s,i;o.shiftKey?t.selectUpTo(o.ctrlKey||o.metaKey):o.ctrlKey||o.metaKey?t.toggleSelect():e.setSelectedItems([n]),o.shiftKey||(e.getDataRef().current.selectUpToAnchorId=n),(i=(s=r?.())==null?void 0:s.onClick)==null||i.call(s,o)}})},hotkeys:{toggleSelectedItem:{hotkey:"Control+Space",preventDefault:!0,handler:(e,t)=>{t.getFocusedItem().toggleSelect()}},selectUpwards:{hotkey:"Shift+ArrowUp",handler:(e,t)=>{const n=t.getFocusedItem(),r=n.getItemAbove();r&&(n.isSelected()&&r.isSelected()?n.deselect():r.select(),r.setFocused(),t.updateDomFocus())}},selectDownwards:{hotkey:"Shift+ArrowDown",handler:(e,t)=>{const n=t.getFocusedItem(),r=n.getItemBelow();r&&(n.isSelected()&&r.isSelected()?n.deselect():r.select(),r.setFocused(),t.updateDomFocus())}},selectAll:{hotkey:"Control+KeyA",preventDefault:!0,handler:(e,t)=>{t.setSelectedItems(t.getItems().map(n=>n.getId()))}}}},Zc=e=>e.code!==""&&e.code!=="Unidentified"?e.code:e.key,Jc={letter:/^Key[A-Z]$/,letterornumber:/^(Key[A-Z]|Digit[0-9])$/,plus:/^(NumpadAdd|Plus)$/,minus:/^(NumpadSubtract|Minus)$/,control:/^(ControlLeft|ControlRight)$/,shift:/^(ShiftLeft|ShiftRight)$/,metaorcontrol:/^(MetaLeft|MetaRight|ControlLeft|ControlRight)$/,enter:/^(Enter|NumpadEnter)$/},$c=new Set(["MetaLeft","MetaRight","Meta","ControlLeft","ControlRight","Control","AltLeft","AltRight","Alt","ShiftLeft","ShiftRight","Shift"]),o1=(e,t,n)=>{const r=n.hotkey.toLowerCase().split("+"),o=r.every(i=>{if(i in Jc)return[...e].some(l=>Jc[i].test(l));const a=[...e].map(l=>l.toLowerCase());return a.includes(i.toLowerCase())||a.includes(`key${i.toLowerCase()}`)}),s=!n.isEnabled||n.isEnabled(t);return o&&s&&e.size===r.length},s1=(e,t,n,r)=>{var o;return(o=Object.entries(ut(ut({},n),r)).find(([,s])=>o1(e,t,s)))==null?void 0:o[0]},Zs={clearPressedKeys:e=>{e.current.pressedKeys=new Set},dispatchKeyDown:(e,t,n,r={})=>{var o,s,i,a,l;const{isInputFocused:u=!1,releaseAfterDispatch:d=!1}=r,{ignoreHotkeysOnInputs:p,onTreeHotkey:A,hotkeys:m}=e.getConfig();if(u&&p)return;const h=Zc({code:(o=n.code)!=null?o:"",key:(s=n.key)!=null?s:""});(a=(i=t.current).pressedKeys)!=null||(i.pressedKeys=new Set);const g=!t.current.pressedKeys.has(h);h&&t.current.pressedKeys.add(h);const x=s1(t.current.pressedKeys,e,e.getHotkeyPresets(),m);if(d&&h&&t.current.pressedKeys.delete(h),!x)return;const b=ut(ut({},e.getHotkeyPresets()[x]),m?.[x]);b&&(!b.allowWhenInputFocused&&u||!b.canRepeat&&!g||(b.preventDefault&&((l=n.preventDefault)==null||l.call(n)),b.handler(n,e),A?.(x,n)))},dispatchKeyUp:(e,t)=>{var n,r,o,s;const i=Zc({code:(n=t.code)!=null?n:"",key:(r=t.key)!=null?r:""});i&&((s=(o=e.current).pressedKeys)!=null||(o.pressedKeys=new Set),$c.has(i)&&(e.current.pressedKeys=new Set([...e.current.pressedKeys].filter(a=>$c.has(a)))),e.current.pressedKeys.delete(i))}},i1={key:"hotkeys-core",onTreeMount:(e,t)=>{const n=e.getDataRef(),r=i=>{const a=i.target instanceof HTMLInputElement;Zs.dispatchKeyDown(e,n,i,{isInputFocused:a,releaseAfterDispatch:a})},o=i=>{Zs.dispatchKeyUp(n,i)},s=()=>{Zs.clearPressedKeys(n)};t.addEventListener("keydown",r),document.addEventListener("keyup",o),window.addEventListener("focus",s),n.current.keydownHandler=r,n.current.keyupHandler=o,n.current.resetHandler=s},onTreeUnmount:(e,t)=>{const n=e.getDataRef();n.current.keyupHandler&&(document.removeEventListener("keyup",n.current.keyupHandler),delete n.current.keyupHandler),n.current.keydownHandler&&(t.removeEventListener("keydown",n.current.keydownHandler),delete n.current.keydownHandler),n.current.resetHandler&&(window.removeEventListener("focus",n.current.resetHandler),delete n.current.resetHandler)}},a1="sync dataLoader returned undefined",l1="sync dataLoader returned promise",Js=e=>{if(!e)throw Ei(a1);if(typeof e=="object"&&"then"in e)throw Ei(l1);return e},c1={key:"sync-data-loader",getInitialState:e=>ut({loadingItemData:[],loadingItemChildrens:[]},e),getDefaultConfig:(e,t)=>ut({setLoadingItemData:Kr("loadingItemData",t),setLoadingItemChildrens:Kr("loadingItemChildrens",t)},e),stateHandlerNames:{loadingItemData:"setLoadingItemData",loadingItemChildrens:"setLoadingItemChildrens"},treeInstance:{waitForItemDataLoaded:()=>_o(null,null,function*(){}),waitForItemChildrenLoaded:()=>_o(null,null,function*(){}),retrieveItemData:({tree:e},t)=>Js(e.getConfig().dataLoader.getItem(t)),retrieveChildrenIds:({tree:e},t)=>{const{dataLoader:n}=e.getConfig();return"getChildren"in n?Js(n.getChildren(t)):Js(n.getChildrenWithData(t)).map(r=>r.data)},loadItemData:({tree:e},t)=>e.retrieveItemData(t),loadChildrenIds:({tree:e},t)=>e.retrieveChildrenIds(t)},itemInstance:{isLoading:()=>!1,hasLoadedData:()=>!0}},u1=Object.defineProperty,d1=Object.defineProperties,f1=Object.getOwnPropertyDescriptors,Xc=Object.getOwnPropertySymbols,p1=Object.prototype.hasOwnProperty,h1=Object.prototype.propertyIsEnumerable,qc=(e,t,n)=>t in e?u1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fo=(e,t)=>{for(var n in t||(t={}))p1.call(t,n)&&qc(e,n,t[n]);if(Xc)for(var n of Xc(t))h1.call(t,n)&&qc(e,n,t[n]);return e},A1=(e,t)=>d1(e,f1(t)),g1=e=>{const[t]=f.useState(()=>({current:n1(e)})),[n,r]=f.useState(()=>t.current.getState());return f.useEffect(()=>(t.current.setMounted(!0),t.current.rebuildTree(),()=>{t.current.setMounted(!1)}),[t]),t.current.setConfig(o=>A1(fo(fo({},o),e),{state:fo(fo({},n),e.state),setState:s=>{var i;r(s),(i=e.setState)==null||i.call(e,s)}})),t.current};const m1=/^(https?:|mailto:|#|\.\/|#\/)/iu,x1=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',"""),Nn=Hy({html:!1,linkify:!0,typographer:!1,breaks:!1});Ly(Nn,()=>{});Nn.core.ruler.push("render_front_matter",e=>{for(const t of e.tokens)t.type==="front_matter"&&(t.type="fence",t.tag="code",t.info="yaml",t.content=String(t.meta??"").replace(/\n$/,""),t.block=!0);return!0});Nn.validateLink=e=>m1.test(e.trim());const $f=e=>{for(const t of e)t.type==="link_open"&&(t.attrSet("rel","noreferrer noopener"),t.attrSet("target","_blank")),t.children!==null&&$f(t.children)};Nn.core.ruler.push("external_links",e=>($f(e.tokens),!0));Nn.renderer.rules.fence=(e,t)=>{const n=e[t];return`<pre class="tech-ltr"><code${n.info.trim().length>0?` class="language-${x1(n.info.trim())}"`:""}>${Nn.utils.escapeHtml(n.content)}</code></pre>
|
|
20
|
+
`};const b1=e=>Nn.render(e),v1=["prose prose-sm","dark:prose-invert","max-w-[75ch]","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-xl prose-h2:text-lg prose-h3:text-base","prose-p:my-2 prose-li:my-0.5","prose-code:before:content-none prose-code:after:content-none","prose-code:font-mono prose-code:text-[0.85em]","prose-pre:bg-muted prose-pre:text-foreground prose-pre:rounded-lg","prose-a:text-primary prose-a:decoration-primary/40 hover:prose-a:decoration-primary","prose-table:border-collapse prose-table:text-xs","prose-th:border prose-th:border-border prose-th:bg-muted prose-th:px-2 prose-th:py-1 prose-th:text-start prose-th:font-semibold","prose-td:border prose-td:border-border prose-td:px-2 prose-td:py-1 prose-td:align-top","prose-td:font-mono","prose-hr:border-border prose-blockquote:border-primary/40"].join(" "),y1=(e,t)=>e.children!==void 0?t?c.jsx(Bh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-amber-500"}):c.jsx(Mh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-amber-500"}):c.jsx(Dh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-muted-foreground"}),eu=16,C1=({entries:e,selected:t,onSelect:n})=>{const r=f.useMemo(()=>{const l=new Map;for(const d of e){const p=d.path.split("/"),A=p[p.length-1]??d.path;d.type==="directory"?l.set(d.path,{name:A,path:d.path,children:[]}):l.set(d.path,{name:A,path:d.path})}for(const d of e){const p=d.path.split("/");for(let A=1;A<p.length;A+=1){const m=p.slice(0,A).join("/");l.has(m)||l.set(m,{name:p[A-1]??m,path:m,children:[]})}}for(const d of l.values())d.children!==void 0&&(d.children=[...l.values()].filter(p=>p.path!==""&&p.path.split("/").slice(0,-1).join("/")===d.path).map(p=>p.path));const u={name:"skill",path:"",children:[]};return u.children=[...l.values()].filter(d=>d.path!==""&&d.path.split("/").length===1).map(d=>d.path),l.set("root",u),Object.fromEntries(l)},[e]),o=f.useMemo(()=>Object.values(r).filter(l=>l.children!==void 0&&l.path!=="").map(l=>l.path),[r]),[s,i]=f.useState([t]),a=g1({initialState:{selectedItems:[t],expandedItems:o},setSelectedItems:l=>{i(u=>{const d=typeof l=="function"?l(u):l,p=d[0];return p!==void 0&&r[p]?.children===void 0&&p!=="root"&&n(p),d})},indent:eu,rootItemId:"root",getItemName:l=>l.getItemData().name,isItemFolder:l=>(l.getItemData()?.children?.length??0)>0,dataLoader:{getItem:l=>r[l]??{name:l,path:""},getChildren:l=>r[l]?.children??[]},features:[c1,r1,i1]});return c.jsx(xb,{indent:eu,tree:a,children:a.getItems().map(l=>{const u=l.getItemData(),d=u.children===void 0&&u.path!=="";return c.jsx(bb,{item:l,onClick:()=>{d&&n(u.path)},children:c.jsx(vb,{className:"tech-ltr relative before:bg-background before:absolute before:inset-x-0 before:-inset-y-0.5 before:-z-10",children:c.jsxs("span",{className:"flex items-center gap-2",children:[y1(u,l.isExpanded()),l.getItemName()]})})},l.getId())})})},I1=()=>{const{messages:e}=mt(),[t,n]=f.useState([]),[r,o]=f.useState("SKILL.md"),[s,i]=f.useState(null),[a,l]=f.useState(null),[u,d]=f.useState(!0),[p,A]=f.useState(!1);f.useEffect(()=>{(async()=>{const h=await Jp();h.status===200?n(h.data):l(e.help.readError),d(!1)})()},[e.help.readError]),f.useEffect(()=>{A(!0),l(null),(async()=>{const h=await $p(r);h.status===200&&"content"in h.data?i(h.data.content):(i(null),l(e.help.readError)),A(!1)})()},[r,e.help.readError]);const m=f.useMemo(()=>s===null?"":b1(s),[s]);return c.jsxs("section",{className:"flex h-full min-h-0 overflow-hidden","aria-label":e.help.title,children:[c.jsx("nav",{className:"w-64 shrink-0 overflow-y-auto border-e border-border p-2","aria-label":e.help.listTitle,children:u?c.jsxs("div",{className:"space-y-2",children:[c.jsx(nn,{className:"h-5 w-full"}),c.jsx(nn,{className:"h-5 w-4/5"}),c.jsx(nn,{className:"h-5 w-3/5"})]}):t.length===0?c.jsx("p",{className:"text-muted-foreground px-2 text-xs",children:e.help.empty}):c.jsx(C1,{entries:t,selected:r,onSelect:o})}),c.jsx("article",{className:"min-h-0 min-w-0 flex-1 overflow-y-auto p-6","aria-live":"polite",children:p?c.jsxs("div",{className:"space-y-2",children:[c.jsx(nn,{className:"h-6 w-1/2"}),c.jsx(nn,{className:"h-4 w-full"}),c.jsx(nn,{className:"h-4 w-5/6"})]}):a!==null?c.jsx("p",{className:"text-destructive text-sm",children:a}):c.jsx("div",{className:v1,dangerouslySetInnerHTML:{__html:m}})})]})},Xf=e=>`/api/icon-composed/${e}?token=${encodeURIComponent(new URLSearchParams(location.search).get("token")??"")}`,w1={cwd:"",env:[],argsMode:"string",family:null},Ja=new URLSearchParams(location.search).get("token")??"",_e=(e,t={})=>fetch(e,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${Ja}`},body:JSON.stringify(t)}),k1=()=>new EventSource(`/api/events?token=${encodeURIComponent(Ja)}${xl()===void 0?"":`&lang=${encodeURIComponent(xl())}`}`),Rn=(e,t,n=0)=>`/api/icon-data/${e}/${t}?g=${n}&token=${encodeURIComponent(Ja)}`,Si=e=>{try{return new URL(e).hostname}catch{return e}};function E1({values:e,defaults:t,frozen:n,iconCandidates:r,iconCandidatesPort:o,iconCandidatesGeneration:s,uploadedIconUrl:i,selectedIconRef:a,iconAnalysis:l,iconComposition:u,iconComposeError:d,iconBackground:p,iconScale:A,subjectExtracting:m,subjectStage:h,subjectSettings:g,onSubjectSettingsChange:x,onIconBackgroundChange:b,onIconScaleChange:v,onPickIconCandidate:y,onUploadIcon:C,onClearIcon:I,onPatch:w}){const{messages:E}=mt(),S=n,D=f.useRef(null),[k,j]=f.useState(!1),[N,T]=f.useState(!1);return c.jsxs("div",{className:"grid grid-cols-1 gap-y-1",children:[c.jsxs("div",{children:[c.jsx(Ne,{children:E.icon.appLabel}),c.jsxs("div",{className:"mt-1.5 flex flex-wrap items-start gap-3",children:[c.jsx("button",{type:"button",disabled:S,"aria-label":E.icon.uploadAria,onClick:()=>D.current?.click(),onDragOver:F=>{F.preventDefault(),S||j(!0)},onDragLeave:()=>j(!1),onDrop:F=>{if(F.preventDefault(),j(!1),S)return;const R=F.dataTransfer.files[0];R!==void 0&&C(R)},className:ge("flex size-20 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-dashed border-border bg-popover transition-colors",S?"opacity-50":"hover:border-primary",k&&"border-primary bg-primary/10"),children:i!==void 0?c.jsx("img",{src:i,alt:E.icon.uploadedAlt,className:"icon-checker size-full rounded object-contain"}):c.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[c.jsx(Du,{className:"size-4"}),c.jsx("span",{className:"text-[10px] leading-tight",children:E.icon.clickOrDrop})]})}),c.jsx("input",{ref:D,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:S,onChange:F=>{const R=F.target.files?.[0];R!==void 0&&C(R),F.target.value=""}}),c.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[r.length===0?c.jsx("span",{className:"text-xs text-muted-foreground",children:E.icon.noCandidates}):r.filter(F=>F.variant==="original"||F.variant==="subject").map(F=>{const R=o===void 0?void 0:Rn(o,F.index,s),O=a===`${o}:${F.index}`,_=a===void 0&&F.variant==="original"&&F.index===(r.find(M=>M.variant==="original")?.index??-1);return c.jsx("button",{type:"button",disabled:S,title:F.variant==="subject"?Ye(E.icon.subjectTitle,{w:F.width,h:F.height,format:F.format.toUpperCase()}):`${F.width}×${F.height} ${F.format.toUpperCase()}`,onClick:()=>y(F),className:ge("icon-checker flex size-14 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",O||_?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",S&&"opacity-50"),children:R!==void 0?c.jsx("img",{src:R,alt:F.variant==="subject"?Ye(E.icon.subjectAlt,{w:F.width,h:F.height}):Ye(E.icon.candidateAlt,{w:F.width,h:F.height}),className:"size-full object-contain"}):null},F.index)}),m?c.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",role:"status",children:[c.jsx("span",{className:"inline-block size-3 animate-spin rounded-full border-2 border-muted-foreground/40 border-t-muted-foreground"}),h??E.icon.extracting]}):null,c.jsx("button",{type:"button",disabled:S,"aria-expanded":N,onClick:()=>T(F=>!F),className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:E.icon.settings})]}),N?c.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-2.5 rounded-lg border border-border p-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"text-[11px] text-muted-foreground",children:E.icon.modelPrecision}),c.jsx("div",{className:"flex gap-1.5",children:[["isnet",E.icon.modelHigh],["isnet_fp16",E.icon.modelStandard],["isnet_quint8",E.icon.modelLight]].map(([F,R])=>c.jsx("button",{type:"button",disabled:S,"aria-pressed":g.model===F,onClick:()=>x({...g,model:F}),className:ge("h-7 rounded-md border px-2.5 text-[11px] transition-colors",g.model===F?"border-foreground bg-secondary text-secondary-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:R},F))})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-[11px] text-muted-foreground",children:E.icon.alphaLabel}),c.jsx("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:g.alphaThreshold===0?E.common.off:g.alphaThreshold})]}),c.jsx("input",{type:"range",min:0,max:128,step:8,value:g.alphaThreshold,disabled:S,onChange:F=>x({...g,alphaThreshold:Number(F.target.value)}),className:"mt-1 w-full accent-foreground","aria-label":E.icon.alphaAria})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-[11px] text-muted-foreground",children:E.icon.shrinkLabel}),c.jsx("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:g.shrink===0?E.common.off:`${g.shrink}px`})]}),c.jsx("input",{type:"range",min:0,max:6,step:1,value:g.shrink,disabled:S,onChange:F=>x({...g,shrink:Number(F.target.value)}),className:"mt-1 w-full accent-foreground","aria-label":E.icon.shrinkAria})]}),c.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:E.icon.settingsHint})]}):null,a!==void 0||i!==void 0?c.jsx("button",{type:"button",disabled:S,onClick:I,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:E.icon.clearSelection}):null]}),(a!==void 0||i!==void 0)&&c.jsx("div",{className:"mt-3 rounded-lg border border-border p-3",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{role:"img",className:"icon-checker size-14 shrink-0 overflow-hidden rounded-[10px]","aria-label":E.icon.composePreviewAria,children:u!==void 0?c.jsx("img",{src:Xf(u.key),alt:E.icon.composePreviewAria,className:"size-full object-contain",onError:F=>{F.currentTarget.style.display="none"}}):c.jsx("span",{className:"flex size-full items-center justify-center text-[10px] text-muted-foreground",children:E.icon.previewOnly})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(Ne,{children:E.icon.background}),c.jsx("div",{className:"mt-1.5 flex gap-1.5",children:["black","white","transparent"].map(F=>c.jsxs("button",{type:"button",disabled:S,"aria-pressed":p===F,onClick:()=>b(F),className:ge("flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-[11px] transition-colors",p===F?"border-foreground bg-secondary text-secondary-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:[F==="black"?E.icon.bgBlack:F==="white"?E.icon.bgWhite:E.icon.bgTransparent,l!==void 0&&l.suggested===F?c.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:E.icon.autoBadge}):null]},F))}),c.jsxs("div",{className:"mt-2.5",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ne,{className:"text-[11px]",children:E.icon.scale}),c.jsxs("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:[Math.round(A*100),"%"]})]}),c.jsx("input",{type:"range",min:50,max:95,step:5,value:Math.round(A*100),disabled:S,onChange:F=>v(Number(F.target.value)/100),className:"mt-1 w-full accent-foreground","aria-label":E.icon.scaleAria})]}),d!==void 0?c.jsx("p",{role:"alert",className:"mt-1.5 text-[11px] font-medium text-red-400",children:d}):null,l!==void 0?c.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:p==="transparent"?E.icon.transparentNote:Ye(E.icon.luminanceNote,{manual:l.suggested===p?"":E.icon.manualOverride,detail:l.luminance===void 0?E.icon.luminanceUnavailable:Ye(E.icon.luminanceDetail,{luminance:l.luminance.toFixed(2),coverage:(l.coverage*100).toFixed(0)})})}):null]})]})})]}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"appId",children:"App ID"}),c.jsx(et,{id:"appId",className:"mt-1 font-mono",disabled:S,value:e.appId,placeholder:t.appId||E.form.appIdPlaceholder,onChange:F=>w({appId:F.target.value})})]}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"appName",children:E.form.appName}),c.jsx(et,{id:"appName",className:"mt-1",disabled:S,value:e.appName,placeholder:t.appName||E.form.appNamePlaceholder,onChange:F=>w({appName:F.target.value})})]})]})}function S1({candidates:e,port:t,generation:n,disabled:r,selectedRef:o,uploadedUrl:s,includeVariants:i,defaultLabel:a,onPick:l,onUpload:u,onClear:d}){const{messages:p}=mt(),A=f.useRef(null),[m,h]=f.useState(!1),g=i?e:e.filter(b=>b.variant==="original"),x=e.filter(b=>b.variant==="original");return c.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[c.jsx("button",{type:"button",disabled:r,"aria-label":p.icon.uploadShortAria,onClick:()=>A.current?.click(),onDragOver:b=>{b.preventDefault(),r||h(!0)},onDragLeave:()=>h(!1),onDrop:b=>{if(b.preventDefault(),h(!1),r)return;const v=b.dataTransfer.files[0];v!==void 0&&u(v)},className:ge("flex size-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-dashed border-border bg-popover transition-colors",r?"opacity-50":"hover:border-primary",m&&"border-primary bg-primary/10"),children:s!==void 0?c.jsx("img",{src:s,alt:p.icon.uploadedAlt,className:"icon-checker size-full rounded object-contain"}):c.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[c.jsx(Du,{className:"size-4"}),c.jsx("span",{className:"text-[10px] leading-tight",children:p.icon.upload})]})}),c.jsx("input",{ref:A,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:r,onChange:b=>{const v=b.target.files?.[0];v!==void 0&&u(v),b.target.value=""}}),c.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[g.length===0?c.jsx("span",{className:"text-xs text-muted-foreground",children:p.icon.noCandidatesShort}):g.map(b=>{const v=t===void 0?void 0:Rn(t,b.index,n),y=o===`${t}:${b.index}`,C=o===void 0&&b.variant==="original"&&b.index===(x[0]?.index??-1);return c.jsx("button",{type:"button",disabled:r,title:b.variant==="original"?`${b.width}×${b.height} ${b.format.toUpperCase()}`:b.variant==="subject"?Ye(p.icon.subjectTitle,{w:b.width,h:b.height,format:b.format.toUpperCase()}):Ye(p.icon.solid,{color:b.variant==="solid-black"?p.icon.colorBlack:p.icon.colorWhite,format:b.format.toUpperCase()}),onClick:()=>l(b),className:ge("icon-checker flex size-12 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",y||C?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",r&&"opacity-50"),children:v!==void 0?c.jsx("img",{src:v,alt:Ye(p.icon.candidateVariant,{variant:b.variant}),className:"size-full object-contain"}):null},`${b.variant}:${b.index}`)}),a!==void 0&&o===void 0&&g.length>0?c.jsx("span",{className:"text-[11px] text-muted-foreground",children:a}):null]}),o!==void 0||s!==void 0?c.jsx("button",{type:"button",disabled:r,onClick:d,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:p.icon.clear}):null]})}function R1(e){const t=f.useRef(!0);t.current&&(t.current=!1,e())}const qf=f.createContext(null);function Xt(){const e=f.useContext(qf);if(e===null)throw new Error(at(60));return e}const D1=(e,t)=>Object.is(e,t);function or(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function yo(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:or(r,t,n))}function F1(e,t,n){return e.filter(r=>!or(t,r,n))}function Ri(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function ep(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function B1(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(ep(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function tp(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Ri(e)}function Wn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ri(e.value):Ri(e)}function np(e,t,n){function r(){return tp(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=t,s=ep(o)?o.flatMap(i=>i.items):o;if(e==null||typeof e!="object"){const i=s.find(a=>a.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=s.find(a=>a&&a.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function j1(e,t,n){return e.reduce((r,o,s)=>(s>0&&r.push(", "),r.push(c.jsx(f.Fragment,{children:np(o,t,n)},s)),r),[])}const we={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Wn(t,r)!==""},hasNullItemLabel:(e,t)=>t?B1(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(o=>or(t,o,n)):or(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function M1(e,t,n=(r,o)=>r===o){return e.length===t.length&&e.every((r,o)=>n(r,t[o]))}function vr(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Ot=1;function $a(e,t){return Math.max(0,e-t)}function Oo(e,t){if(t<=0)return 0;const n=vr(e,0,t),r=n,o=t-n,s=r<=Ot,i=o<=Ot;return s&&i?r<=o?0:t:s?0:i?t:n}function N1(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:a,name:l,form:u,autoComplete:d,disabled:p=!1,readOnly:A=!1,required:m=!1,modal:h=!0,actionsRef:g,inputRef:x,onOpenChangeComplete:b,items:v,multiple:y=!1,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w=D1,highlightItemOnHover:E=!0,children:S}=e,{clearErrors:D}=Ki(),{setDirty:k,setTouched:j,setFocused:N,validityData:T,setFilled:F,name:R,disabled:O,validation:_,validationMode:M}=Yo(),H=Qi({id:t}),G=O||p,B=R??l,[P,W]=ln({controlled:n,default:y?r??Ht:r,name:"Select",state:"value"}),[Y,Z]=ln({controlled:s,default:i,name:"Select",state:"open"}),Q=f.useRef([]),J=f.useRef([]),K=f.useRef(null),ee=f.useRef(null),ce=f.useRef(0),te=f.useRef(null),$=f.useRef([]),X=f.useRef(!1),ne=f.useRef(null),de=f.useRef(null),fe=f.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ie=f.useRef(!1),{mounted:he,setMounted:oe,transitionStatus:se}=sr(Y),{openMethod:ae,triggerProps:xe}=Td(Y),me=Ft(()=>new Gr({id:H,labelId:void 0,modal:h,multiple:y,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w,value:P,open:Y,mounted:he,transitionStatus:se,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,L=Ie(me,we.activeIndex),z=Ie(me,we.selectedIndex),ye=Ie(me,we.triggerElement),q=Ie(me,we.positionerElement),re=B0(ae),Se=ae??re,ke=f.useMemo(()=>y?"":Wn(P,I),[y,P,I]),We=f.useMemo(()=>y&&Array.isArray(P)?P.map(Be=>Wn(Be,I)):Wn(P,I),[y,P,I]),rt=nt(ye),Ge=ue(()=>We);Li(rt,H,P,Ge,!G,l);const At=f.useRef(P),$e=y?Array.isArray(P)&&P.length>0:P!=null&&ke!=="";le(()=>{F($e)},[$e,F]),le(function(){let Ue=P,bt=!1;if(y){const jt=Array.isArray(P)?P:[];bt=jt.length===0,Ue=jt[jt.length-1]}const Rt=bt?-1:yo($.current,Ue,w),Bt=Rt===-1?null:Rt;Bt===null&&(de.current=null),!Y&&me.set("selectedIndex",Bt)},[y,Y,P,w,me]);function Oe(Be){const Ue=T.initialValue;return Array.isArray(Be)&&Array.isArray(Ue)?!M1(Be,Ue,(bt,Rt)=>or(bt,Rt,w)):Be!==Ue}as(P,()=>{D(B),k(Oe(P)),_.change(P)});const lt=ue((Be,Ue)=>{a?.(Be,Ue),!Ue.isCanceled&&(Z(Be),!Be&&(Ue.reason===jn||Ue.reason===Lo)&&(j(!0),N(!1),M==="onBlur"&&_.commit(P)))}),Ee=ue(()=>{oe(!1),me.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),b?.(!1)});Zt({enabled:!g,open:Y,ref:K,onComplete(){Y||Ee()}}),f.useImperativeHandle(g,()=>({unmount:Ee}),[Ee]);const Le=ue((Be,Ue)=>{o?.(Be,Ue),!Ue.isCanceled&&W(Be)}),Ze=ue(Be=>{const Ue=$a(Be.scrollHeight,Be.clientHeight),bt=Oo(Be.scrollTop,Ue),Rt=bt>0,Bt=bt<Ue;me.set("scrollUpArrowVisible",Rt),me.set("scrollDownArrowVisible",Bt)}),ze=Dm({open:Y,onOpenChange:lt,elements:{reference:ye,floating:q}}),Re=ad(ze,{enabled:!A&&!G,event:"mousedown"}),Pe=es(ze),Je=Rd(ze,{enabled:!A&&!G,listRef:Q,activeIndex:L,selectedIndex:z,disabledIndices:Ht,onNavigate(Be){Be===null&&!Y||me.set("activeIndex",Be)},focusItemOnHover:E}),qe=Dd(ze,{enabled:!A&&!G&&(Y||!y),listRef:J,activeIndex:L,selectedIndex:z,disabledIndices:Be=>tf(Q.current[Be]),onMatch(Be){Y?me.set("activeIndex",Be):Le($.current[Be],Ce(Pt))},onTyping(Be){X.current=Be}}),ft=f.useMemo(()=>Nt(qe.reference,Je.reference,Pe.reference,Re.reference,xe),[Re.reference,qe.reference,Je.reference,Pe.reference,xe]),ot=f.useMemo(()=>Nt(rs,qe.floating,Je.floating,Pe.floating),[qe.floating,Je.floating,Pe.floating]),Ct=Je.item??dt;R1(()=>{me.update({popupProps:ot,triggerProps:ft})}),me.useSyncedValues({id:H,modal:h,multiple:y,value:P,open:Y,mounted:he,transitionStatus:se,popupProps:ot,triggerProps:ft,items:v,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w,openMethod:Se});const st=f.useMemo(()=>({store:me,floatingContext:ze,required:m,disabled:G,readOnly:A,multiple:y,highlightItemOnHover:E,setValue:Le,setOpen:lt,listRef:Q,popupRef:K,scrollHandlerRef:ee,handleScrollArrowVisibility:Ze,scrollArrowsMountedCountRef:ce,itemProps:Ct,valueRef:te,valuesRef:$,labelsRef:J,typingRef:X,selectionRef:fe,firstItemTextRef:ne,selectedItemTextRef:de,validation:_,onOpenChangeComplete:b,alignItemWithTriggerActiveRef:ie,initialValueRef:At}),[me,ze,m,G,A,y,E,Le,lt,Ct,_,b,Ze]),Et=Ut(x,_.inputRef),St=y?void 0:B,qt=f.useMemo(()=>!y||!Array.isArray(P)||!B?null:P.map(Be=>{const Ue=Wn(Be,I);return c.jsx("input",{type:"hidden",form:u,name:B,value:Ue,disabled:G},Ue)}),[y,P,u,B,I,G]);return c.jsxs(qf.Provider,{value:st,children:[S,c.jsx("input",{..._.getValidationProps(G,{onFocus(){me.state.triggerElement?.focus({focusVisible:!0})},onChange(Be){if(Be.nativeEvent.defaultPrevented||G||A)return;const Ue=Be.currentTarget.value,bt=Ce(Pt,Be.nativeEvent);function Rt(){if(y)return;const Bt=Ue.toLowerCase();let jt=$.current.findIndex(dn=>Wn(dn,I).toLowerCase()===Bt||tp(dn,C).toLowerCase()===Bt);jt===-1&&(jt=$.current.findIndex((dn,Dt)=>{const en=J.current[Dt];return en!=null&&en.toLowerCase()===Bt}));const Lt=$.current[jt];Lt!=null&&Le(Lt,bt)}me.set("forceMount",!0),queueMicrotask(Rt)}}),id:H&&St==null?`${H}-hidden-input`:void 0,form:u,name:St,autoComplete:d,value:ke,disabled:G,required:m&&!(y&&$e),readOnly:A,ref:Et,style:B?la:qo,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),qt]})}function T1(e,t){return e??t}const P1=400,_1={...fi,...Hi,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},O1=f.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:a=!0,style:l,...u}=t,{setTouched:d,setFocused:p,validationMode:A,state:m,disabled:h}=Yo(),{labelId:g}=Wi(),{store:x,setOpen:b,selectionRef:v,validation:y,readOnly:C,required:I,alignItemWithTriggerActiveRef:w,disabled:E}=Xt(),S=h||E||i,D=Ie(x,we.open),k=Ie(x,we.mounted),j=Ie(x,we.value),N=Ie(x,we.triggerProps),T=Ie(x,we.positionerElement),F=Ie(x,we.listElement),R=Ie(x,we.popupSide),O=Ie(x,we.id),_=Ie(x,we.labelId),M=Ie(x,we.hasSelectedValue),H=k&&T?R:null,G=s??O,B=T1(g,_);Qi({id:G});const P=nt(T),W=f.useRef(null),{getButtonProps:Y,buttonRef:Z}=Vt({disabled:S,native:a}),Q=x.useStateSetter("triggerElement"),J=ht(),K=ht(),ee=ht();f.useEffect(()=>{if(D)return ee.start(P1,()=>{v.current.allowUnselectedMouseUp=!0,v.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};v.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[D,v,K,ee]);const ce=Nt(N,{id:G,role:"combobox","aria-expanded":D,"aria-haspopup":"listbox","aria-controls":D?F?.id??wo(T)?.id:void 0,"aria-labelledby":B,"aria-readonly":C||void 0,"aria-required":I||void 0,tabIndex:S?-1:0,onFocus(X){p(!0),D&&w.current&&b(!1,Ce(Pt,X.nativeEvent)),J.start(0,()=>{x.set("forceMount",!0)})},onBlur(X){ve(T,X.relatedTarget)||(d(!0),p(!1),A==="onBlur"&&y.commit(j))},onMouseDown(X){if(D)return;const ne=je(X.currentTarget);function de(fe){if(!W.current)return;const ie=fe.target;ve(W.current,ie)||ve(P.current,ie)||$d(fe,W.current)||b(!1,Ce(wu,fe))}K.start(0,()=>{ne.addEventListener("mouseup",de,{once:!0})})}},u,Y),te=y.getValidationProps(S,ce);te.role="combobox";const $={...m,open:D,disabled:S,value:j,readOnly:C,popupSide:H,placeholder:!M};return Me("button",t,{ref:[n,W,Z,Q],state:$,stateAttributesMapping:_1,props:te})}),H1={value:()=>null},K1=f.forwardRef(function(t,n){const{className:r,render:o,children:s,placeholder:i,style:a,...l}=t,{store:u,valueRef:d}=Xt(),p=Ie(u,we.value),A=Ie(u,we.items),m=Ie(u,we.itemToStringLabel),h=Ie(u,we.hasSelectedValue),g=!h&&i!=null&&s==null,x=Ie(u,we.hasNullItemLabel,g),b={value:p,placeholder:!h};let v=null;return typeof s=="function"?v=s(p):s!=null?v=s:g&&!x?v=i:Array.isArray(p)?v=j1(p,A,m):v=np(p,A,m),Me("span",t,{state:b,ref:[n,d],props:[{children:v},l],stateAttributesMapping:H1})}),W1=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=Xt(),u={open:Ie(a,we.open)};return Me("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},i],stateAttributesMapping:Vu})}),L1=f.forwardRef(function(t,n){const{store:r}=Xt(),o=Ie(r,we.mounted),s=Ie(r,we.forceMount);return o||s?c.jsx(ca,{ref:n,...t}):null}),rp=f.createContext(void 0);function Xa(){const e=f.useContext(rp);if(!e)throw new Error(at(59));return e}function Ho(e,t){e&&Object.assign(e.style,t)}const op={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Q1={position:"fixed"},G1=f.forwardRef(function(t,n){const{anchor:r,className:o,render:s,positionMethod:i,side:a,align:l,sideOffset:u,alignOffset:d,collisionBoundary:p="clipping-ancestors",collisionPadding:A,arrowPadding:m,sticky:h,disableAnchorTracking:g,alignItemWithTrigger:x=!0,collisionAvoidance:b=Xu,style:v,...y}=t,{store:C,listRef:I,labelsRef:w,alignItemWithTriggerActiveRef:E,selectedItemTextRef:S,valuesRef:D,initialValueRef:k,popupRef:j,setValue:N,floatingContext:T}=Xt(),F=Ie(C,we.open),R=Ie(C,we.mounted),O=Ie(C,we.modal),_=Ie(C,we.value),M=Ie(C,we.openMethod),H=Ie(C,we.positionerElement),G=Ie(C,we.triggerElement),B=Ie(C,we.isItemEqualToValue),P=Ie(C,we.transitionStatus),W=f.useRef(null),Y=f.useRef(null),[Z,Q]=f.useState(x),J=R&&Z&&M!=="touch";!R&&Z!==x&&Q(x),f.useImperativeHandle(E,()=>J),Zd((J||O)&&F,M==="touch",H,G);const K=Fa({anchor:r,floatingRootContext:T,positionMethod:i,mounted:R,side:a,sideOffset:u,align:l,alignOffset:d,arrowPadding:m,collisionBoundary:p,collisionPadding:A,sticky:h,disableAnchorTracking:g??J,collisionAvoidance:b,keepMounted:!0}),ee=J?"none":K.side,ce=J?Q1:K.positionerStyles,te={open:F,side:ee,align:K.align,anchorHidden:K.anchorHidden};le(()=>{C.set("popupSide",K.side)},[C,K.side]);const $=C.useStateSetter("positionerElement"),X=Ba(t,te,{styles:ce,transitionStatus:P,props:y,refs:[n,$],hidden:!R,inert:!F}),ne=f.useRef(0),de=ue(ie=>{if(D.current.length===0)return;const he=ne.current;if(ne.current=ie.size,ie.size===he)return;const oe=Ce(Pt);if(he!==0&&!C.state.multiple&&_!==null&&yo(D.current,_,B)===-1){const ae=k.current,me=ae!=null&&yo(D.current,ae,B)!==-1?ae:null;N(me,oe),me===null&&(C.set("selectedIndex",null),S.current=null)}if(he!==0&&C.state.multiple&&Array.isArray(_)){const se=_.filter(ae=>yo(D.current,ae,B)!==-1);se.length!==_.length&&(N(se,oe),se.length===0&&(C.set("selectedIndex",null),S.current=null))}if(F&&J){C.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const se={height:""};Ho(H,se),Ho(j.current,se)}}),fe=f.useMemo(()=>({...K,side:ee,alignItemWithTriggerActive:J,setControlledAlignItemWithTrigger:Q,scrollUpArrowRef:W,scrollDownArrowRef:Y}),[K,ee,J,Q]);return c.jsx(Ur,{elementsRef:I,labelsRef:w,onMapChange:de,children:c.jsxs(rp.Provider,{value:fe,children:[R&&O&&c.jsx(Sa,{inert:Ea(!F),cutout:G}),X]})})}),po="base-ui-disable-scrollbar",Di={className:po,getElement(e){return c.jsx("style",{nonce:e,href:po,precedence:"base-ui:low",children:`.${po}{scrollbar-width:none}.${po}::-webkit-scrollbar{display:none}`})}},Y1=f.createContext(void 0),z1={disableStyleElements:!1};function U1(){return f.useContext(Y1)??z1}const V1={...Lr,..._n},Z1=f.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:l,popupRef:u,onOpenChangeComplete:d,setOpen:p,valueRef:A,firstItemTextRef:m,selectedItemTextRef:h,multiple:g,handleScrollArrowVisibility:x,scrollHandlerRef:b,listRef:v,highlightItemOnHover:y,floatingContext:C}=Xt(),{side:I,align:w,alignItemWithTriggerActive:E,isPositioned:S,setControlledAlignItemWithTrigger:D}=Xa(),k=Ma()!=null,j=ls(),{nonce:N,disableStyleElements:T}=U1(),F=Ie(l,we.id),R=Ie(l,we.open),O=Ie(l,we.openMethod),_=Ie(l,we.mounted),M=Ie(l,we.popupProps),H=Ie(l,we.transitionStatus),G=Ie(l,we.triggerElement),B=Ie(l,we.positionerElement),P=Ie(l,we.listElement),W=f.useRef(!1),Y=f.useRef(!1),Z=f.useRef({}),Q=qn(),J=ue(te=>{if(!B||!u.current||!Y.current)return;const $=B.style.top==="0px",X=B.style.bottom==="0px";if(W.current||!E||!$&&!X){x(te);return}const ne=nu(B),de=yr(B.getBoundingClientRect().height,"y",ne),fe=je(B),ie=it(B),he=ie.getComputedStyle(B),oe=parseFloat(he.marginTop),se=parseFloat(he.marginBottom),ae=tu(ie.getComputedStyle(u.current)),xe=Math.min(fe.documentElement.clientHeight-oe-se,ae),me=te.scrollTop,L=ho(te);let z=null;const ye=ke=>{B.style.height=`${ke}px`},q=$?L-me:me,re=Math.min(de+q,xe);if(q<=Ot){const ke=vr(q,0,xe-de);ke>0&&ye(de+ke),te.scrollTop=$?L:0,xe-(de+ke)<=Ot&&(W.current=!0),x(te);return}if(xe-re>Ot)z=$?1/0:0;else if(X&&me<L){const ke=de+q-xe;z=me-(q-ke)}const Se=Math.ceil(re);if(Se!==0&&ye(Se),z!=null){const ke=vr(z,0,ho(te));Math.abs(te.scrollTop-ke)>Ot&&(te.scrollTop=ke)}Se>=xe-Ot&&(W.current=!0),x(te)});f.useImperativeHandle(b,()=>J,[J]),Zt({open:R,ref:u,onComplete(){R&&d?.(!0)}});const K={open:R,transitionStatus:H,side:I,align:w};le(()=>{!B||!u.current||Object.keys(Z.current).length||(Z.current={top:B.style.top||"0",left:B.style.left||"0",right:B.style.right,height:B.style.height,bottom:B.style.bottom,minHeight:B.style.minHeight,maxHeight:B.style.maxHeight,marginTop:B.style.marginTop,marginBottom:B.style.marginBottom})},[u,B]),le(()=>{R||E||(Y.current=!1,W.current=!1,Ho(B,Z.current))},[R,E,B,u]),le(()=>{const te=u.current;if(!R||!G||!B||!te||E&&!S||l.state.transitionStatus==="ending")return;if(Y.current=!0,te.style.removeProperty("--transform-origin"),!E){Q.request(()=>x(P||te));return}const $=J1(te);try{let X=h.current;X?.isConnected||(X=!we.hasSelectedValue(l.state)&&m.current?.isConnected?m.current:null);const ne=A.current,de=it(B),fe=de.getComputedStyle(B),ie=de.getComputedStyle(te),he=je(G),oe=nu(G),se=Ao(G.getBoundingClientRect(),oe),ae=Ao(B.getBoundingClientRect(),oe),xe=se.height,me=P||te,L=me.scrollHeight,z=parseFloat(ie.borderBottomWidth),ye=parseFloat(fe.marginTop)||10,q=parseFloat(fe.marginBottom)||10,re=parseFloat(fe.minHeight)||100,Se=tu(ie),ke=5,We=5,rt=20,Ge=he.documentElement.clientHeight-ye-q,At=he.documentElement.clientWidth,$e=Ge-se.bottom+xe;let Oe,lt=j==="rtl"?se.right-ae.width:se.left,Ee=0;if(X&&ne){const st=Ao(ne.getBoundingClientRect(),oe);Oe=Ao(X.getBoundingClientRect(),oe),lt=ae.left+(j==="rtl"?st.right-Oe.right:st.left-Oe.left);const Et=st.top-se.top+st.height/2;Ee=Oe.top-ae.top+Oe.height/2-Et}const Le=$e+Ee+q+z;let Ze=Math.min(Ge,Le);const ze=Ge-ye-q,Re=Le-Ze,Pe=At-We;B.style.left=`${vr(lt,ke,Pe-ae.width)}px`,B.style.height=`${Ze}px`,B.style.maxHeight="none",B.style.marginTop=`${ye}px`,B.style.marginBottom=`${q}px`,te.style.height="100%";const Je=ho(me),qe=Re>=Je-Ot;qe&&(Ze=Math.min(Ge,ae.height)-(Re-Je));const ft=se.top<rt||se.bottom>Ge-rt||Math.ceil(Ze)+Ot<Math.min(L,re),ot=(de.visualViewport?.scale??1)!==1&&un;if(ft||ot){Ho(B,Z.current),D(!1);return}const Ct=Math.max(re,Ze);if(qe){const st=Math.max(0,Ge-Le);B.style.top=ae.height>=ze?"0":`${st}px`,B.style.height=`${Ze}px`,me.scrollTop=ho(me)}else B.style.bottom="0",me.scrollTop=Re;if(Oe){const st=ae.top,Et=ae.height,St=Oe.top+Oe.height/2,qt=vr(Et>0?(St-st)/Et*100:50,0,100);te.style.setProperty("--transform-origin",`50% ${qt}%`)}(Ct===Ge||Ze>=Se)&&(W.current=!0),x(me),y&&l.state.selectedIndex===null&&l.state.activeIndex===null&&v.current[0]!=null&&l.set("activeIndex",0)}finally{$()}},[l,R,B,G,A,m,h,u,x,E,D,Q,P,v,y,j,S]),f.useEffect(()=>{if(!E||!B||!R)return;const te=it(B);function $(X){p(!1,Ce(ch,X))}return De(te,"resize",$)},[p,E,B,R]);const ee={...P?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${F}-list`},onKeyDown(te){k&&ss.has(te.key)&&te.stopPropagation()},onScroll(te){P||J(te.currentTarget)},...E&&{style:P?{height:"100%"}:op},className:!P&&E?Di.className:void 0},ce=Me("div",t,{ref:[n,u],state:K,stateAttributesMapping:V1,props:[M,ee,cs(H),a]});return c.jsxs(f.Fragment,{children:[!T&&Di.getElement(N),c.jsx(fa,{context:C,modal:!1,disabled:!_,openInteractionType:O,returnFocus:i,restoreFocus:!0,children:ce})]})});function tu(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function ho(e){return $a(e.scrollHeight,e.clientHeight)}function nu(e){return pd.getScale(e)}function yr(e,t,n){return e/n[t]}function Ao(e,t){return Dr({x:yr(e.x,"x",t),y:yr(e.y,"y",t),width:yr(e.width,"x",t),height:yr(e.height,"y",t)})}const ru=[["transform","none"],["scale","1"],["translate","0 0"]];function J1(e){const{style:t}=e,n={};for(const[r,o]of ru)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of ru){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const $1=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a,scrollHandlerRef:l,multiple:u}=Xt(),{alignItemWithTriggerActive:d}=Xa(),p=Ie(a,we.hasScrollArrows),A=Ie(a,we.openMethod),h={id:`${Ie(a,we.id)}-list`,role:"listbox","aria-multiselectable":u||void 0,onScroll(x){l.current?.(x.currentTarget)},...d&&{style:op},className:p&&A!=="touch"?Di.className:void 0},g=a.useStateSetter("listElement");return Me("div",t,{ref:[n,g],props:[h,i]})}),sp=f.createContext(void 0);function qa(){const e=f.useContext(sp);if(!e)throw new Error(at(57));return e}const X1=f.memo(f.forwardRef(function(t,n){const{render:r,className:o,style:s,value:i=null,label:a,disabled:l=!1,nativeButton:u=!1,...d}=t,p=f.useRef(null),A=hs({guess:!0,label:a,textRef:p}),{store:m,itemProps:h,setOpen:g,setValue:x,selectionRef:b,typingRef:v,valuesRef:y,multiple:C,selectedItemTextRef:I,disabled:w,readOnly:E}=Xt(),S=w||l,D=Ie(m,we.isActive,A.index),k=Ie(m,we.open),j=Ie(m,we.isSelected,i),N=Ie(m,we.isSelectedByFocus,A.index),T=Ie(m,we.isItemEqualToValue),F=A.index,R=f.useRef(null);le(()=>{const Q=y.current;return Q[F]=i,()=>{delete Q[F]}},[F,i,y]),le(()=>{const Q=m.state.value;let J=Q;C&&Array.isArray(Q)&&(J=Q.length>0?Q[Q.length-1]:void 0),J!==void 0&&or(i,J,T)&&(m.set("selectedIndex",F),p.current&&(I.current=p.current))},[F,C,T,m,i,I]);const O=f.useRef("mouse"),_=f.useRef(!1),{getButtonProps:M,buttonRef:H}=Vt({disabled:S,focusableWhenDisabled:!0,native:u,composite:!0}),G={disabled:S,selected:j,highlighted:D};function B(Q){if(w||E)return;const J=m.state.value;if(C){const K=Array.isArray(J)?J:[],ee=j?F1(K,i,T):[...K,i];x(ee,Ce(Cr,Q))}else x(i,Ce(Cr,Q)),g(!1,Ce(Cr,Q))}function P(){b.current.dragY=0}const W={role:"option","aria-selected":j,tabIndex:k&&D?0:-1,onKeyDown(Q){m.set("activeIndex",F),Q.key===" "&&v.current&&Q.preventDefault()},onClick(Q){const J=O.current!=="touch",K=Q.nativeEvent.pointerType,ee=J&&Ji(Q.nativeEvent)&&(K!==void 0||D),ce=J&&!ee&&!_.current;_.current=!1,!(S||ce)&&B(Q.nativeEvent)},onPointerEnter(Q){O.current=Q.pointerType},onPointerMove(Q){if(Q.pointerType==="mouse"&&Q.buttons===1){const J=b.current;J.dragY+=Q.movementY,J.dragY**2>=64&&(J.allowUnselectedMouseUp=!0)}},onPointerDown(Q){O.current=Q.pointerType,_.current=!0,P()},onMouseUp(){if(P(),S||O.current==="touch"||_.current)return;const Q=!b.current.allowSelectedMouseUp&&j,J=!b.current.allowUnselectedMouseUp&&!j;Q||J||(_.current=!0,R.current?.click(),_.current=!1)}},Y=Me("div",t,{ref:[H,n,A.ref,R],state:G,props:[h,W,d,M]}),Z=f.useMemo(()=>({selected:j,index:F,textRef:p,selectedByFocus:N}),[j,F,p,N]);return c.jsx(sp.Provider,{value:Z,children:Y})})),q1=f.forwardRef(function(t,n){const{selected:r}=qa();return t.keepMounted||r?c.jsx(eC,{...t,ref:n}):null}),eC=f.memo(f.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:a}=qa(),l=f.useRef(null),{transitionStatus:u,setMounted:d}=sr(a),A=Me("span",e,{ref:[t,l],state:{selected:a,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:_n});return Zt({open:a,ref:l,onComplete(){a||d(!1)}}),A})),tC=f.memo(f.forwardRef(function(t,n){const{index:r,textRef:o,selectedByFocus:s}=qa(),{firstItemTextRef:i,selectedItemTextRef:a}=Xt(),{render:l,className:u,style:d,...p}=t,A=f.useCallback(h=>{h&&(r===0&&(i.current=h),s&&(a.current=h))},[i,a,r,s]);return Me("div",t,{ref:[A,n,o],props:p})})),ip=f.forwardRef(function(t,n){const{render:r,className:o,style:s,direction:i,keepMounted:a,...l}=t,u=i==="up",{store:d,popupRef:p,listRef:A,handleScrollArrowVisibility:m,scrollArrowsMountedCountRef:h}=Xt(),{side:g,scrollDownArrowRef:x,scrollUpArrowRef:b}=Xa(),v=u?we.scrollUpArrowVisible:we.scrollDownArrowVisible,y=Ie(d,v),C=Ie(d,we.openMethod),I=y&&C!=="touch",w=ht(),E=u?b:x,{mounted:S,transitionStatus:D,setMounted:k}=sr(I);le(()=>(h.current+=1,d.set("hasScrollArrows",!0),()=>{h.current=Math.max(0,h.current-1),h.current===0&&d.set("hasScrollArrows",!1)}),[d,h]),Zt({open:I,ref:E,onComplete(){I||k(!1)}});const T=Me("div",t,{ref:[n,E],state:{direction:i,visible:I,side:g,transitionStatus:D},props:[{"aria-hidden":!0,children:u?"▲":"▼",style:{position:"absolute"},onMouseMove(R){if(R.movementX===0&&R.movementY===0||w.isStarted())return;d.set("activeIndex",null);function O(){const _=d.state.listElement??p.current;if(!_)return;d.set("activeIndex",null),m(_);const M=$a(_.scrollHeight,_.clientHeight),H=Oo(_.scrollTop,M),G=H===(u?0:M),B=A.current;if(H!==_.scrollTop&&(_.scrollTop=H),G){w.clear();return}if(B.length>0){const P=E.current?.offsetHeight||0;_.scrollTop=nC(B,u,H,_.clientHeight,P,M)}w.start(40,O)}w.start(40,O)},onMouseLeave(){w.clear()}},l],stateAttributesMapping:_n});return S||a?T:null});function nC(e,t,n,r,o,s){if(t){let d=0;const p=n+o-Ot;for(let h=0;h<e.length;h+=1){const g=e[h];if(g&&g.offsetTop>=p){d=h;break}}const A=Math.max(0,d-1),m=e[A];return A<d&&m?Oo(m.offsetTop-o,s):0}let i=e.length-1;const a=n+r-o+Ot;for(let d=0;d<e.length;d+=1){const p=e[d];if(p&&p.offsetTop+p.offsetHeight>a){i=Math.max(0,d-1);break}}const l=Math.min(e.length-1,i+1),u=e[l];return l>i&&u?Oo(u.offsetTop+u.offsetHeight-r+o,s):s}const rC=f.forwardRef(function(t,n){return c.jsx(ip,{...t,ref:n,direction:"down"})}),oC=f.forwardRef(function(t,n){return c.jsx(ip,{...t,ref:n,direction:"up"})}),sC=N1;function iC({className:e,...t}){return c.jsx(K1,{"data-slot":"select-value",className:ge("flex flex-1 text-left",e),...t})}function aC({className:e,size:t="default",children:n,...r}){return c.jsxs(O1,{"data-slot":"select-trigger","data-size":t,className:ge("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none 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 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,c.jsx(W1,{render:c.jsx(Pn,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function lC({className:e,children:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:s=0,alignItemWithTrigger:i=!0,...a}){return c.jsx(L1,{children:c.jsx(G1,{side:n,sideOffset:r,align:o,alignOffset:s,alignItemWithTrigger:i,className:"isolate z-50",children:c.jsxs(Z1,{"data-slot":"select-content","data-align-trigger":i,className:ge("cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[c.jsx(cC,{}),c.jsx($1,{children:t}),c.jsx(uC,{})]})})})}function $s({className:e,children:t,...n}){return c.jsxs(X1,{"data-slot":"select-item",className:ge("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[c.jsx(tC,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),c.jsx(q1,{render:c.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:c.jsx(Gi,{className:"pointer-events-none"})})]})}function cC({className:e,...t}){return c.jsx(oC,{"data-slot":"select-scroll-up-button",className:ge("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:c.jsx(Yi,{})})}function uC({className:e,...t}){return c.jsx(rC,{"data-slot":"select-scroll-down-button",className:ge("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:c.jsx(Pn,{})})}const ap=f.createContext(void 0);function dC(){const e=f.useContext(ap);if(e===void 0)throw new Error(at(63));return e}const lp={...Hi,checked(e){return e?{"data-checked":""}:{"data-unchecked":""}}},fC=f.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s,"aria-labelledby":i,form:a,id:l,inputRef:u,name:d,nativeButton:p=!1,onCheckedChange:A,readOnly:m=!1,required:h=!1,disabled:g=!1,render:x,uncheckedValue:b,value:v,style:y,...C}=t,{clearErrors:I}=Ki(),{state:w,setTouched:E,setDirty:S,validityData:D,setFilled:k,setFocused:j,validationMode:N,disabled:T,name:F,validation:R}=Yo(),{labelId:O}=Wi(),_=T||g,M=F??d,H=f.useRef(null),G=Ut(H,u,R.inputRef),B=f.useRef(null),P=wt(),W=Qi({id:l,implicit:!1,controlRef:B}),Y=p?void 0:W,[Z,Q]=ln({controlled:r,default:!!s,name:"Switch",state:"checked"});Li(B,P,Z,void 0,!_,d),le(()=>{H.current&&k(H.current.checked)},[k]),as(Z,()=>{I(M),S(Z!==D.initialValue),k(Z),R.change(Z)});const{getButtonProps:J,buttonRef:K}=Vt({disabled:_,native:p}),ee=Fu(i,O,H,!p,Y),ce={id:p?W:P,role:"switch","aria-checked":Z,"aria-readonly":m||void 0,"aria-required":h||void 0,"aria-labelledby":ee,onFocus(){_||j(!0)},onBlur(){const ne=H.current;!ne||_||(E(!0),j(!1),N==="onBlur"&&R.commit(ne.checked))},onClick(ne){if(m||_)return;ne.preventDefault();const de=H.current;de&&_i(de,ne)}},te={...R.getValidationProps(_),checked:Z,disabled:_,form:a,id:Y,name:M,required:h,style:M?la:qo,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:G,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;if(m){ne.preventDefault();return}const de=ne.currentTarget.checked,fe=Ce(Pt,ne.nativeEvent);A?.(de,fe),!fe.isCanceled&&Q(de)},onClick(ne){ne.stopPropagation()},onFocus(){B.current?.focus()},...v!==void 0?{value:v}:dt},$=f.useMemo(()=>({...w,checked:Z,disabled:_,readOnly:m,required:h}),[w,Z,_,m,h]),X=Me("span",t,{state:$,ref:[n,B,K],props:[ce,C,J,ne=>R.getValidationProps(_,ne)],stateAttributesMapping:lp});return c.jsxs(ap.Provider,{value:$,children:[X,!Z&&M&&b!==void 0&&c.jsx("input",{type:"hidden",form:a,name:M,value:b,disabled:_}),c.jsx("input",{...te,suppressHydrationWarning:!0})]})}),pC=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=dC();return Me("span",t,{state:a,ref:n,stateAttributesMapping:lp,props:i})});function ur({className:e,size:t="default",...n}){return c.jsx(fC,{"data-slot":"switch","data-size":t,className:ge("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent 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-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:c.jsx(pC,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function hC({frozen:e,values:t,defaults:n,candidates:r,candidatesPort:o,candidatesGeneration:s,selectedIconRef:i,uploadedIconUrl:a,iconAnalysis:l,iconComposition:u,iconComposeError:d,iconBackground:p,iconScale:A,subjectExtracting:m,subjectStage:h,subjectSettings:g,onSubjectSettingsChange:x,onIconBackgroundChange:b,onIconScaleChange:v,selectedTrayRef:y,uploadedTrayUrl:C,selectedPort:I,targetDirExists:w,onPickIconCandidate:E,onUploadIcon:S,onClearIcon:D,onPickTray:k,onUploadTray:j,onClearTray:N,onPatch:T,onConfirm:F}){const{messages:R}=mt();return c.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[c.jsx(E1,{values:t,defaults:n,frozen:e,iconCandidates:r,iconCandidatesPort:o,iconCandidatesGeneration:s,uploadedIconUrl:a,selectedIconRef:i,iconAnalysis:l,iconComposition:u,iconComposeError:d,iconBackground:p,iconScale:A,subjectExtracting:m,...h===void 0?{}:{subjectStage:h},subjectSettings:g,onSubjectSettingsChange:x,onIconBackgroundChange:b,onIconScaleChange:v,onPickIconCandidate:E,onUploadIcon:S,onClearIcon:D,onPatch:T}),c.jsx(_a,{className:"mt-4 border-t border-border pt-1",children:c.jsxs(Oa,{value:"advanced",className:"border-b-0",children:[c.jsx(Ha,{children:R.advanced.title}),c.jsxs(Ka,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[c.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[c.jsx(ur,{id:"showStartupTerminal",checked:t.showStartupTerminal,disabled:e,onCheckedChange:O=>T({showStartupTerminal:O})}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"showStartupTerminal",className:"text-foreground",children:R.advanced.startupTerminal}),c.jsxs("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:[c.jsx(Sr,{className:"mr-0.5 inline size-3"}),R.advanced.startupTerminalHint]})]})]}),c.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[c.jsx(ur,{id:"showAddressBar",checked:t.showAddressBar,disabled:e,onCheckedChange:O=>T({showAddressBar:O})}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"showAddressBar",className:"text-foreground",children:R.advanced.addressBar}),c.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:R.advanced.addressBarHint})]})]}),c.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[c.jsx(ur,{id:"imageSmoothingEnabled",checked:t.imageSmoothingEnabled,disabled:e,onCheckedChange:O=>T({imageSmoothingEnabled:O})}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"imageSmoothingEnabled",className:"text-foreground",children:R.advanced.smoothing}),c.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:R.advanced.smoothingHint})]})]}),c.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[c.jsx(ur,{id:"developerMode",checked:t.developerMode,disabled:e,onCheckedChange:O=>T({developerMode:O})}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"developerMode",className:"text-foreground",children:R.advanced.developer}),c.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:R.advanced.developerHint})]})]})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:R.advanced.tray}),c.jsx("p",{className:"mb-1.5 mt-0.5 text-[11px] text-muted-foreground",children:R.advanced.trayHint}),c.jsx(S1,{candidates:r,port:o,generation:s,disabled:e,selectedRef:y,uploadedUrl:C,includeVariants:!0,defaultLabel:R.icon.followApp,onPick:k,onUpload:j,onClear:N})]}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"pm",children:R.advanced.pm}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] leading-relaxed text-muted-foreground",children:R.advanced.pmHint}),c.jsxs(sC,{value:t.pm,disabled:e,onValueChange:O=>T({pm:O}),children:[c.jsx(aC,{id:"pm",className:"mt-0",children:c.jsx(iC,{})}),c.jsxs(lC,{children:[c.jsx($s,{value:"npm",children:"npm"}),c.jsx($s,{value:"pnpm",children:"pnpm"}),c.jsx($s,{value:"bun",children:"bun"})]})]})]}),c.jsxs("div",{className:"rounded-lg border border-border p-3",children:[c.jsx(Ne,{children:R.advanced.location}),c.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:n.targetDir||R.advanced.locationDefault}),c.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:R.advanced.locationHint}),w?c.jsx("p",{className:"mt-2 text-[11px] font-medium text-amber-400",children:R.advanced.dirExistsWarning}):null,c.jsxs("div",{className:"mt-3 flex items-start gap-3",children:[c.jsx(ur,{id:"force-overwrite",checked:t.force,disabled:e,onCheckedChange:O=>T({force:O})}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"force-overwrite",className:"text-foreground",children:R.advanced.force}),c.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:R.advanced.forceHint})]})]})]})]})]})}),c.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[c.jsx(He,{onClick:F,disabled:e,children:R.advanced.confirm}),c.jsx("span",{className:"text-xs text-muted-foreground",children:I!==void 0?Ye(R.advanced.serviceSelected,{port:I}):R.advanced.serviceNone})]})]})}var go={},Xs,ou;function AC(){if(ou)return Xs;ou=1;var e=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],t=/[\n\r\u2028\u2029]/,n=/[\s#!"$&'():;<=>@\\^`|]/g;return Xs=function(o){return o.map(function(s){if(s==="")return"''";if(s&&typeof s=="object"){if("op"in s&&s.op==="glob"){if(typeof s.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(t.test(s.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return s.pattern.replace(n,"\\$&")}if("op"in s&&typeof s.op=="string"){if(e.indexOf(s.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(s.op));return s.op.replace(/[\s\S]/g,"\\$&")}if("comment"in s&&typeof s.comment=="string"){if(t.test(s.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+s.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(s)&&!/'/.test(s)?"'"+s.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(s)?'"'+s.replace(/(["\\$`!])/g,"\\$1")+'"':String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},Xs}var qs,su;function gC(){if(su)return qs;su=1;for(var e="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",t=new RegExp("^"+e+"$"),n="|&;()<> \\t",r="'([^']*?)'",o='"((\\\\"|[^"])*?)"',s=/^#$/,i="'",a='"',l="$",u="",d=4294967296,p=0;p<4;p++)u+=(d*Math.random()).toString(16);var A=new RegExp("^"+u);function m(x,b){for(var v=b.lastIndex,y=[],C;C=b.exec(x);)y[y.length]=C,b.lastIndex===C.index&&(b.lastIndex+=1);return b.lastIndex=v,y}function h(x,b,v){var y=typeof x=="function"?x(v):x[v];return typeof y>"u"&&v!=""?y="":typeof y>"u"&&(y="$"),typeof y=="object"?b+u+JSON.stringify(y)+u:b+y}function g(x,b,v){v||(v={});var y=v.escape||"\\",C=v.splitUnquoted===!0?`
|
|
21
|
+
`:typeof v.splitUnquoted=="string"?v.splitUnquoted:"",I="(\\"+y+`['"`+n+`]|[^\\s'"`+n+"])+",w=new RegExp(["("+e+")","("+I+"|"+o+"|"+r+")+"].join("|"),"g"),E=m(x,w);if(E.length===0)return[];b||(b={});var S=!1;return E.map(function(D){var k=D[0];if(!k||S)return;if(t.test(k))return{op:k};var j=!1,N=!1,T="",F=[],R=!1,O=null,_=!1,M;function H(){M+=1;var J,K,ee=k.charAt(M);if(ee==="{"){if(M+=1,k.charAt(M)==="}")throw new Error("Bad substitution: "+k.slice(M-2,M+1));var ce=1;for(J=M;ce>0&&J<k.length;)k.charAt(J)==="{"&&k.charAt(J-1)==="$"?ce+=1:k.charAt(J)==="}"&&(ce-=1),J+=1;if(ce!==0)throw new Error("Bad substitution: "+k.slice(M));J-=1,K=k.slice(M,J),M=J}else if(/[*@#?$!_-]/.test(ee))K=ee,M+=1;else{var te=k.slice(M);J=te.match(/[^\w\d_]/),J?(K=te.slice(0,J.index),M+=J.index-1):(K=te,M=k.length)}return h(b,"",K)}function G(){if(O!==null){if(O===0)T!==""&&(F[F.length]=T,T="");else{F[F.length]=T,T="";for(var J=1;J<O;J+=1)F[F.length]=""}O=null}}for(M=0;M<k.length;M++){var B=k.charAt(M);if(C&&B!==l&&G(),_=_||!j&&(B==="*"||B==="?"),N)T+=B,N=!1;else if(j)B===j?j=!1:j==i?T+=B:B===y?(M+=1,B=k.charAt(M),B===a||B===y||B===l?T+=B:T+=y+B):B===l?T+=H():T+=B;else if(B===a||B===i)j=B,R=!0;else{if(t.test(B))return{op:k};if(s.test(B)){S=!0;var P={comment:x.slice(D.index+M+1)};return T.length?[T,P]:[P]}else if(B===y)N=!0;else if(B===l){var W=H();if(!C)T+=W;else for(var Y=0;Y<W.length;Y+=1){var Z=W.charAt(Y);C.indexOf(Z)<0?(G(),T+=Z):O===null?O=Z===" "||Z===" "||Z===`
|
|
22
|
+
`?0:1:Z!==" "&&Z!==" "&&Z!==`
|
|
23
|
+
`&&(O+=1)}}else T+=B}}if(_)return{op:"glob",pattern:T};if(C){if(O!==null&&O>0){F[F.length]=T,T="";for(var Q=1;Q<O;Q+=1)F[F.length]=""}return(T!==""||R&&F.length===0)&&(F[F.length]=T),F}return T}).reduce(function(D,k){return typeof k>"u"||[].concat(k).forEach(function(j){D[D.length]=j}),D},[])}return qs=function(b,v,y){var C=g(b,v,y);return typeof v!="function"?C:C.reduce(function(I,w){if(typeof w=="object")return I[I.length]=w,I;var E=w.split(RegExp("("+u+".*?"+u+")","g"));return E.length===1?(I[I.length]=E[0],I):(E.filter(Boolean).forEach(function(S){I[I.length]=A.test(S)?JSON.parse(S.split(u)[1]):S}),I)},[])},qs}var iu;function mC(){return iu||(iu=1,go.quote=AC(),go.parse=gC()),go}var xC=mC();const cp=["npm","go","rust","python","dotnet","custom"],bC={npm:"npm",go:"Go",rust:"Rust",python:"Python",dotnet:".NET",custom:"自定义"},vC={npm:"npmjs",go:"golang",rust:"rust",python:"python",dotnet:"dotnet"},up=["npx","pnpx","bunx","yarn dlx","nubx","deno run","vpx"],yC=["uvx","pipx run"],dp={family:"npm",runner:"npx",runnerFlags:"",pkg:"",version:"",args:"",binary:"",raw:""},el=e=>{if(/["']/.test(e)){const r=(e.match(/'/gu)??[]).length,o=(e.match(/"/gu)??[]).length;if(r%2===1||o%2===1)return[]}const t=xC.parse(e),n=[];for(const r of t){if(typeof r!="string")return[];n.push(r)}return n.length===0?[]:n},tl=e=>e.startsWith("-")&&e.length>1,Dn=e=>{const t=e.lastIndexOf("@");return t>0?{base:e.slice(0,t),version:e.slice(t+1)}:{base:e,version:""}},Gn=e=>e.map(t=>t.trim()).filter(t=>t.length>0).join(" "),dr=(e,t)=>{if(t.trim().length===0)return e;const{version:n}=Dn(e);return n.length>0?e:`${e}@${t.trim()}`},CC=e=>/^(npm|jsr):/.test(e)?e:`npm:${e}`,IC=/^[A-Za-z0-9@._/:+=-]+$/u,wC=e=>IC.test(e)&&e.length>0?e:`'${e.replaceAll("'","'\\''")}'`,Sn=e=>e.map(wC).join(" "),fr=e=>{const t=[];let n=0;for(;n<e.length&&tl(e[n]??"");)t.push(e[n]??""),n+=1;return{flags:t,rest:e.slice(n)}},kC=[new Set(["-A","--allow-all","--allow-read","--allow-write","--allow-net","--allow-env","--allow-run","--allow-sys","--allow-ffi","--allow-hrtime","--no-check","--no-remote","--quiet","-q","--cached-only"]),new Set(["-y","--yes"])],EC=e=>e.includes("=")?!1:kC.some(t=>t.has(e)),pr=e=>e.every(t=>EC(t)),SC=(e,t)=>{const n=t.split(" ");if(e.length<n.length)return-1;for(let r=0;r<n.length;r+=1)if((e[r]??"")!==(n[r]??""))return-1;return n.length},hn=e=>({...dp,...e}),hr=e=>hn({family:"custom",raw:Sn(e)}),RC=e=>{const t=e[0]??"",n=e[1]??"";for(const r of up){const o=SC(e,r);if(o>0){const{flags:s,rest:i}=fr(e.slice(o));if(!pr(s))return hr(e);const a=i[0]??"",{base:l,version:u}=a.length>0?Dn(a):{base:"",version:""};return hn({family:"npm",runner:r,runnerFlags:s.join(" "),pkg:l,version:u,args:Sn(i.slice(1)),raw:e.join(" ")})}}if(t==="go"&&n==="run"){const{flags:r,rest:o}=fr(e.slice(2));if(!pr(r))return hr(e);const s=o[0]??"",{base:i,version:a}=s.length>0?Dn(s):{base:"",version:""};return hn({family:"go",runner:"",runnerFlags:r.join(" "),pkg:i,version:a,args:Sn(o.slice(1)),raw:e.join(" ")})}if(t==="cargo"&&n==="install"){const{flags:r,rest:o}=fr(e.slice(2));if(!pr(r))return hr(e);const s=o[0]??"",i=s.length>0?Dn(s).base:"";return hn({family:"rust",runner:"",runnerFlags:r.join(" "),pkg:i,args:Sn(o.slice(1)),raw:e.join(" ")})}if(t==="uvx"||t==="pipx"&&n==="run"){const r=t==="uvx"?1:2,{flags:o,rest:s}=fr(e.slice(r));if(!pr(o))return hr(e);const i=s[0]??"",{base:a,version:l}=i.length>0?Dn(i):{base:"",version:""};return hn({family:"python",runner:t==="uvx"?"uvx":"pipx run",runnerFlags:o.join(" "),pkg:a,version:l,args:Sn(s.slice(1)),raw:e.join(" ")})}if(t==="dnx"){const{flags:r,rest:o}=fr(e.slice(1));if(!pr(r))return hr(e);const s=o[0]??"",{base:i,version:a}=s.length>0?Dn(s):{base:"",version:""};return hn({family:"dotnet",runner:"",runnerFlags:r.join(" "),pkg:i,version:a,args:Sn(o.slice(1)),raw:e.join(" ")})}return hn({family:"custom",raw:Sn(e)})},DC=e=>{const t=el(e);return t.length===0?hn({family:"custom",raw:e}):RC(t)},fp=e=>{const t=e.pkg.trim(),n=e.binary.trim().length>0?e.binary.trim():t;return{install:Gn(["cargo","install",e.runnerFlags,t]),run:Gn([n,e.args])}},Fi=e=>{switch(e.family){case"custom":return e.raw.trim();case"rust":return fp(e).run;case"npm":{const t=e.runner==="deno run"?CC(dr(e.pkg.trim(),e.version)):dr(e.pkg.trim(),e.version);return Gn([e.runner,e.runnerFlags,t,e.args])}case"go":return Gn(["go","run",e.runnerFlags,dr(e.pkg.trim(),e.version),e.args]);case"python":return Gn([e.runner,e.runnerFlags,dr(e.pkg.trim(),e.version),e.args]);case"dotnet":return Gn(["dnx",e.runnerFlags,dr(e.pkg.trim(),e.version),e.args])}},Ar=(e,t)=>{const n=e.trim().replace(/^(npm|jsr):/,""),r=n.split(/[/\\]/).filter(i=>i.length>0&&!i.startsWith("@")),o=r[r.length-1]??n;let s=Dn(o).base.toLowerCase();return t==="python"&&(s=s.replace(/[._]/g,"-")),s.replace(/[^a-z0-9-]/g,"")},gr=e=>{const t=[];for(const n of el(e)){if(tl(n))break;const r=n.toLowerCase().replace(/[^a-z0-9-]/g,"");if(r.length===0)break;t.push(r)}return t},FC=e=>{if(e.family==="custom"){const i=[];for(const u of el(e.raw)){if(tl(u))break;i.push(u)}const a=i.map(u=>{const d=u.split(/[/\\]/).filter(p=>p.length>0);if(d.some(p=>p.startsWith("@"))){const p=d.filter(A=>!A.startsWith("@"));return(p[p.length-1]??"").split("@")[0]??""}return(d[d.length-1]??u).split("@")[0]??""}).filter(u=>u.length>0).reverse(),l=a.length>0?a.join("."):"app.opentray";return{appId:l,appName:l==="app.opentray"?"Opentray App":l.split(".").filter(u=>u.length>0).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join(" "),identitySegments:a,tail:""}}const t=vC[e.family];let n;switch(e.family){case"npm":n=[...gr(e.args),Ar(e.pkg,"npm")];break;case"go":n=[...gr(e.args),Ar(e.pkg,"go")];break;case"rust":{const i=Ar(e.pkg,"rust"),a=e.binary.trim().length>0?e.binary.trim().toLowerCase().replace(/[^a-z0-9-]/g,""):i;n=[...gr(e.args),a];break}case"python":n=[...gr(e.args),Ar(e.pkg,"python")];break;case"dotnet":n=[...gr(e.args),Ar(e.pkg,"dotnet")];break}const r=n.filter(i=>i.length>0),o=r.length>0?`${r.join(".")}.${t}`:"app.opentray",s=r.length>0?r.map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):"Opentray App";return{appId:o,appName:s,identitySegments:r,tail:t}},BC=e=>{const t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"opentray-app"},jC=(e,t)=>{let n;for(const r of e)r.key.trim()===t&&(n=r.value);return n},MC=e=>e.family==="npm"&&(e.runner==="npx"||e.runner==="pnpx")?[{key:"npm_config_yes",value:"true",note:"跳过 npm 安装确认(等效 -y),首次运行无需交互"}]:[],An=(e,t)=>e==="custom"?t.family.custom:bC[e],NC='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>.NET</title><path d="M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z"/></svg>',TC='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Go</title><path d="M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z"/></svg>',PC='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>npm</title><path d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/></svg>',_C='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Python</title><path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"/></svg>',OC='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Rust</title><path d="M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z"/></svg>',mr=e=>{const t=e.replace(/<title>[\s\S]*?<\/title>/g,"");return({className:r})=>c.jsx("span",{"aria-hidden":"true",className:ge("inline-flex size-4 shrink-0 [&_svg]:size-full [&_svg]:fill-current",r),dangerouslySetInnerHTML:{__html:t}})},Ko={npm:mr(PC),go:mr(TC),rust:mr(OC),python:mr(_C),dotnet:mr(NC),custom:Su},HC=cp.filter(e=>e!=="custom"),au=(e,t,n)=>c.jsx(Wa,{variant:"outline",size:"sm",className:"flex max-w-full flex-wrap",value:[t],onValueChange:r=>{const o=r[0];o!==void 0&&e.includes(o)&&n(o)},children:e.map(r=>c.jsx(Br,{value:r,className:"px-2.5 text-xs",children:r},r))});function KC({open:e,draft:t,envPreset:n,onEnvPresetChange:r,onDraftChange:o,onFamilyChange:s,onCancel:i,onApply:a}){const{messages:l}=mt(),u=g=>{g||i()},d=g=>o({...t,...g}),p=FC(t),A=Fi(t),m=t.family==="rust"?fp(t):null,h=Ko[t.family];return c.jsx(La,{open:e,onOpenChange:u,children:c.jsxs(Qa,{className:"max-h-[85vh] overflow-y-auto sm:max-w-md",children:[c.jsxs(Ln,{children:[c.jsxs(Qn,{className:"flex items-center gap-2",children:[c.jsxs(jo,{children:[c.jsxs(Mo,{className:"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","aria-label":l.family.switchAria,title:l.family.switchAria,children:[c.jsx(h,{className:"size-4"}),c.jsx(Pn,{className:"size-3"})]}),c.jsx(No,{align:"start",className:"w-36",children:HC.map(g=>{const x=Ko[g];return c.jsxs(To,{onClick:()=>s(g),className:g===t.family?"bg-accent/60":void 0,children:[c.jsx(x,{className:"text-muted-foreground"}),An(g,l)]},g)})})]}),Ye(l.family.dialogTitle,{name:An(t.family,l)})]}),c.jsx(Ga,{children:l.family.dialogDescription})]}),c.jsxs("div",{className:"space-y-4",children:[t.family==="npm"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.runner}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.runnerHint}),au(up,t.runner,g=>d({runner:g}))]}),t.runnerFlags.length>0||t.runner==="deno run"?c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.runnerFlags}),c.jsx(et,{className:"mt-1.5 font-mono text-xs",placeholder:"-A",value:t.runnerFlags,onChange:g=>d({runnerFlags:g.target.value})})]}):null,c.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.pkg}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.pkgHint}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"@deepseek-ai/dsh",value:t.pkg,onChange:g=>d({pkg:g.target.value})})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.version}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.versionLatest}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:g=>d({version:g.target.value})})]})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.args}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.argsHint}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"web --port 3000",value:t.args,onChange:g=>d({args:g.target.value})})]})]}):null,t.family==="go"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.modulePath}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.modulePathHint}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"rsc.io/fortune",value:t.pkg,onChange:g=>d({pkg:g.target.value})})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.version}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.versionLocal}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:g=>d({version:g.target.value})})]})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.args}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"serve --port 8080",value:t.args,onChange:g=>d({args:g.target.value})})]})]}):null,t.family==="rust"&&m!==null?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.crate}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.crateHint}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"ripgrep",value:t.pkg,onChange:g=>d({pkg:g.target.value})})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.binary}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.binaryHint}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:t.pkg.trim().length>0?t.pkg.trim():l.family.binaryPlaceholder,value:t.binary,onChange:g=>d({binary:g.target.value})})]})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.args}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"--json .",value:t.args,onChange:g=>d({args:g.target.value})})]}),c.jsxs("div",{className:"space-y-1 rounded-lg bg-muted/60 p-2.5 font-mono text-xs",children:[c.jsxs("p",{className:"text-muted-foreground",children:[c.jsx("span",{className:"mr-1.5 select-none",children:"$"}),m.install]}),c.jsxs("p",{children:[c.jsx("span",{className:"mr-1.5 select-none text-muted-foreground",children:"$"}),m.run]})]})]}):null,t.family==="python"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.runner}),au(yC,t.runner,g=>d({runner:g}))]}),c.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.pkg}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.pkgPythonHint}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"ruff",value:t.pkg,onChange:g=>d({pkg:g.target.value})})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.version}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:g=>d({version:g.target.value})})]})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.args}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"format --check .",value:t.args,onChange:g=>d({args:g.target.value})})]})]}):null,t.family==="dotnet"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.toolId}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:l.family.toolIdHint}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"dotnet-format",value:t.pkg,onChange:g=>d({pkg:g.target.value})})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.version}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:g=>d({version:g.target.value})})]})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:l.family.args}),c.jsx(et,{className:"mt-0 font-mono text-xs",placeholder:"--verify-no-changes",value:t.args,onChange:g=>d({args:g.target.value})})]})]}):null]},t.family),c.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/60 px-3 py-2",children:c.jsx("code",{className:"min-w-0 flex-1 font-mono text-xs break-all",children:A.length>0?A:c.jsx("span",{className:"text-muted-foreground",children:l.family.commandPreviewEmpty})})}),n!==null?c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[c.jsx("span",{className:"text-[11px] text-muted-foreground",children:l.family.envPresetTitle}),n.state==="off"?c.jsx("button",{type:"button",className:"rounded-md px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground underline-offset-2 transition-colors hover:bg-accent hover:text-foreground hover:underline",title:n.defaultNote,onClick:()=>r("enable"),children:Ye(l.family.presetEnable,{key:n.key})}):c.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-secondary/60 py-0.5 pr-1 pl-1.5 font-mono text-[11px]",title:l.family.envPresetSourceDialog,children:[n.key,"=",n.explicitValue??"",c.jsx("span",{className:"font-sans text-[10px] text-muted-foreground",children:l.family.presetConfigured}),c.jsx("button",{type:"button","aria-label":l.family.presetRemove,title:n.defaultNote,className:"rounded px-1 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>r("disable"),children:"×"})]})]}):c.jsx("p",{className:"text-[11px] text-muted-foreground",children:l.family.presetNone}),c.jsxs("div",{className:"space-y-1 rounded-lg border border-border bg-muted/40 p-3",children:[c.jsx("p",{className:"text-[11px] text-muted-foreground",children:l.family.appIdPreview}),c.jsx("code",{className:"font-mono text-sm font-medium break-all",children:p.appId}),c.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ye(l.family.namePreview,{name:p.appName,dir:BC(p.appId)})})]}),c.jsxs(lb,{children:[c.jsx(ib,{render:c.jsx(He,{variant:"outline"}),children:l.common.cancel}),c.jsxs(He,{onClick:()=>{a(t)},children:[c.jsx(Gi,{}),l.family.apply]})]})]})})}const lu=e=>({...dp,family:e,runner:e==="python"?"uvx":e==="npm"?"npx":""}),cu=e=>e!=="custom",ei=(e,t)=>e.family===t.family&&e.runner===t.runner&&e.runnerFlags===t.runnerFlags&&e.pkg===t.pkg&&e.version===t.version&&e.args===t.args&&e.binary===t.binary&&e.raw===t.raw;function WC({command:e,onCommandChange:t,commandOptions:n,onCommandOptionsChange:r,disabled:o,onRun:s}){const{messages:i}=mt(),a=f.useMemo(()=>DC(e),[e]),l=n.family,u=f.useRef({}),[d,p]=f.useState(null),[A,m]=f.useState(l?.family??null);f.useEffect(()=>{if(l!==null){if(u.current[l.family]=l,d===null){m(B=>B===l.family?B:l.family);return}!cu(l.family)||d.currentFamily!==l.family||p(B=>{if(B===null||B.currentFamily!==l.family)return B;const P=B.drafts[l.family],W=B.bases[l.family];return P===void 0||W===void 0||!ei(P,W)?B:{...B,drafts:{...B.drafts,[l.family]:l},bases:{...B.bases,[l.family]:l}}})}},[l,d===null]);const h=A??a.family,g=B=>{if(l!==null&&l.family===B)return l;const P=u.current[B];return P!==void 0?P:a.family===B?a:lu(B)},[x,b]=f.useState(!1),[v,y]=f.useState(!1),[C,I]=f.useState(!1),w=d===null?void 0:d.drafts[d.currentFamily],E=w??n.family??a,S=MC(E)[0],D=S===void 0?void 0:jC(n.env,S.key),k=S===void 0?null:{key:S.key,defaultNote:S.note,state:D!==void 0?"explicit":"off",...D!==void 0?{explicitValue:D}:{}},j=D!==void 0,N=B=>{const P=S?.key??"npm_config_yes",W=B==="enable"?[...n.env.filter(Y=>Y.key.trim()!==P),{key:P,value:"true"}]:n.env.filter(Y=>Y.key.trim()!==P);r({...n,env:W})},T=B=>{if(B===h)return;m(B);const P={...n,...n.argsMode==="array"?{argsMode:"string"}:{}},W=g(B);u.current[B]===void 0&&(u.current[B]=W),r({...P,family:B==="custom"?null:W}),t(Fi(W))},F=()=>{if(!cu(h))return;const B=g(h);p({snapshot:{family:h,state:B},currentFamily:h,drafts:{[h]:B},bases:{[h]:B}})},R=B=>{p(P=>P===null||P.currentFamily!==B.family?P:{...P,drafts:{...P.drafts,[B.family]:B}})},O=B=>{p(P=>{if(P===null||P.currentFamily===B)return P;const W=P.drafts[B],Y=P.bases[B],Z=g(B),Q=W!==void 0&&Y!==void 0&&!ei(W,Y),J=Q?W:Z;return{...P,currentFamily:B,drafts:{...P.drafts,[B]:J},bases:{...P.bases,[B]:Q?Y:Z}}})},_=()=>{p(B=>{if(B===null)return B;const P=u.current[B.snapshot.family];return(P===void 0||ei(P,B.snapshot.state))&&(u.current[B.snapshot.family]=B.snapshot.state),null})},M=B=>{u.current[B.family]=B,m(B.family),t(Fi(B)),r({...n,...n.argsMode==="array"?{argsMode:"string"}:{},family:B}),p(null)},H=Ko[h],G=h==="custom";return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex h-8 w-full min-w-0 items-stretch rounded-lg border border-input bg-transparent transition-colors outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 disabled:opacity-50 dark:bg-input/30",children:[c.jsxs(jo,{children:[c.jsxs(Mo,{disabled:o,className:"flex w-11 items-center justify-between gap-1 rounded-l-lg border-r border-input transition-colors outline-none hover:bg-accent focus-visible:z-10 focus-visible:border-ring","aria-label":Ye(i.family.selectorAria,{name:An(h,i)}),title:Ye(i.family.selectorTitle,{name:An(h,i)}),children:[c.jsx(H,{className:"size-4 text-muted-foreground ms-2"}),c.jsx(Pn,{className:"size-3 text-muted-foreground/70 me-0.75"})]}),c.jsx(No,{align:"start",className:"w-36",children:cp.map(B=>{const P=Ko[B];return c.jsxs(To,{onClick:()=>T(B),className:B===h?"bg-accent/60":void 0,children:[c.jsx(P,{className:"text-muted-foreground"}),An(B,i)]},B)})})]}),G?c.jsx("input",{className:"h-full w-full min-w-0 flex-1 bg-transparent px-2.5 font-mono text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed",placeholder:"npx somecommand start --xx",disabled:o,value:e,onChange:B=>t(B.target.value),onKeyDown:B=>{B.key==="Enter"&&!o&&s()}}):c.jsx("button",{type:"button",className:"h-full min-w-0 flex-1 cursor-pointer truncate px-2.5 text-left font-mono text-sm outline-none select-none disabled:cursor-not-allowed disabled:opacity-60",disabled:o,title:e.length>0?e:Ye(i.family.configureTitle,{name:An(h,i)}),"aria-label":Ye(i.family.configureAria,{name:An(h,i)}),onClick:F,children:e.length>0?e:c.jsx("span",{className:"text-muted-foreground",children:Ye(i.family.configurePlaceholder,{name:An(h,i)})})}),j&&S!==void 0?c.jsxs(us,{open:x||v||C,onOpenChange:B=>{B||I(!1)},children:[c.jsx(ds,{render:c.jsx("span",{tabIndex:0,className:"mr-1 flex size-6 shrink-0 self-center cursor-help items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","aria-label":i.family.envCarryAria,onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),onFocus:()=>y(!0),onBlur:()=>y(!1),onClick:()=>I(B=>!B)}),children:c.jsx(Sr,{className:"size-3.5"})}),c.jsx(fs,{side:"top",children:c.jsxs("div",{className:"space-y-1 text-left",children:[c.jsx("p",{className:"text-[11px] opacity-70",children:i.family.envPresetTitle}),c.jsxs("p",{className:"font-mono text-xs",children:[S.key,"=",D]}),c.jsx("p",{className:"text-[11px] opacity-70",children:i.family.envPresetSource})]})})]}):null]}),c.jsx(KC,{open:d!==null,draft:w??lu(h),envPreset:k,onEnvPresetChange:N,onDraftChange:R,onFamilyChange:O,onCancel:_,onApply:M})]})}function LC({tags:e,onTagsChange:t,disabled:n=!1,placeholder:r,className:o,...s}){const{messages:i}=mt(),[a,l]=f.useState(""),u=()=>{a.length!==0&&(t([...e,a]),l(""))};return c.jsxs("div",{className:ge("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent px-2 py-1.5 font-mono text-xs shadow-xs focus-within:border-ring",n&&"opacity-50",o),children:[e.map((d,p)=>c.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent px-1.5 py-0.5 text-accent-foreground",children:[c.jsx("span",{className:"max-w-56 truncate",title:d,children:d}),n?null:c.jsx("button",{type:"button","aria-label":Ye(i.command.argvRemove,{n:p+1}),className:"text-muted-foreground hover:text-foreground",onClick:()=>{t(e.filter((A,m)=>m!==p))},children:c.jsx(zi,{className:"size-3"})})]},`${p}:${d}`)),c.jsx("input",{className:"min-w-24 flex-1 bg-transparent font-mono text-xs outline-none placeholder:text-muted-foreground",value:a,disabled:n,placeholder:r??(e.length===0?i.command.argvProgram:i.command.argvArg),onChange:d=>l(d.target.value),onKeyDown:d=>{if(d.key==="Enter"){d.preventDefault(),u();return}d.key==="Backspace"&&a.length===0&&e.length>0&&(d.preventDefault(),t(e.slice(0,-1)))},onBlur:u,...s})]})}function QC({command:e,onCommandChange:t,argv:n,onArgvChange:r,runAlive:o,frozen:s,failedReason:i,commandOptions:a,defaultCwd:l,onCommandOptionsChange:u,onRun:d,onStop:p}){const{messages:A}=mt(),m=h=>{u({...a,...h})};return c.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[c.jsxs("div",{className:"flex gap-2",children:[a.argsMode==="array"?c.jsx(LC,{tags:n,onTagsChange:r,disabled:o,"aria-label":A.command.argvAria}):c.jsx(WC,{command:e,onCommandChange:t,commandOptions:a,onCommandOptionsChange:u,disabled:o||s,onRun:d}),o?c.jsxs(He,{variant:"destructive",onClick:p,"aria-label":A.command.stopAria,children:[c.jsx(oA,{}),A.command.stop]}):c.jsxs(He,{disabled:s,onClick:d,"aria-label":A.command.runAria,children:[c.jsx(Zh,{}),A.command.run]})]}),i!==void 0?c.jsx("p",{className:"mt-2 font-mono text-xs text-red-400",children:i}):null,c.jsx(_a,{defaultValue:["command"],className:"mt-3 border-t border-border pt-1",children:c.jsxs(Oa,{value:"command",className:"border-b-0",children:[c.jsx(Ha,{children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(eA,{className:"size-4 text-muted-foreground"}),A.command.options]})}),c.jsxs(Ka,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[c.jsxs("div",{children:[c.jsx(Ne,{children:A.command.argsModeLabel}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:A.command.argsModeHint}),c.jsxs(Wa,{variant:"outline",size:"sm",spacing:0,value:[a.argsMode],onValueChange:h=>{const g=h[0];(g==="string"||g==="array")&&m({argsMode:g})},disabled:s,children:[c.jsx(Br,{value:"string",children:A.command.modeString}),c.jsx(Br,{value:"array",children:A.command.modeArray})]})]}),c.jsxs("div",{children:[c.jsx(Ne,{htmlFor:"cmd-cwd",children:A.command.cwdLabel}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:A.command.cwdHint}),c.jsx(et,{id:"cmd-cwd",className:"mt-0 font-mono text-xs",disabled:s,value:a.cwd,placeholder:l.length>0?Ye(A.command.cwdDefault,{path:l}):A.command.cwdDefaultHome,title:l,onChange:h=>m({cwd:h.target.value})}),l.length>0&&a.cwd.trim().length===0?c.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:l}):null]})]}),c.jsxs("div",{children:[c.jsx(Ne,{children:A.command.envLabel}),c.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:A.command.envHint}),c.jsxs("div",{className:"space-y-1.5",children:[a.env.length===0?c.jsx("p",{className:"text-xs text-muted-foreground",children:A.command.envEmpty}):a.env.map((h,g)=>c.jsxs("div",{className:"flex gap-1.5",children:[c.jsx(et,{className:"font-mono text-xs",disabled:s,"aria-label":Ye(A.command.envName,{n:g+1}),value:h.key,placeholder:"NAME",onChange:x=>{const b=[...a.env];b[g]={...h,key:x.target.value},m({env:b})}}),c.jsx(et,{className:"font-mono text-xs",disabled:s,"aria-label":Ye(A.command.envValue,{n:g+1}),value:h.value,placeholder:"value",onChange:x=>{const b=[...a.env];b[g]={...h,value:x.target.value},m({env:b})}}),c.jsx(He,{variant:"ghost",size:"icon-sm",disabled:s,"aria-label":A.command.envRemove,onClick:()=>{m({env:a.env.filter((x,b)=>b!==g)})},children:"×"})]},g)),c.jsxs(He,{variant:"outline",size:"sm",disabled:s,onClick:()=>m({env:[...a.env,{key:"",value:""}]}),children:[c.jsx(Sr,{className:"size-3.5"}),A.command.envAdd]})]})]})]})]})})]})}const uu=e=>{const t=e.trim();return t.length===0?"":/^https?:\/\//iu.test(t)?t:`https://${t}`};function GC({value:e,onChange:t,activeSource:n,frozen:r,loading:o,failedReason:s,onSubmit:i}){const{messages:a}=mt();return c.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[c.jsxs("div",{className:"flex items-center gap-2 pb-3 text-sm font-medium text-muted-foreground",children:[c.jsx(Th,{className:"size-4"}),a.wizard.sourceUrl]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(si,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(et,{className:"pl-8 font-mono text-xs",value:e,placeholder:"https://example.com",disabled:r,onChange:l=>t(l.target.value),onKeyDown:l=>{if(l.key!=="Enter"||r||o)return;const u=uu(e);t(u),i(u)},"aria-label":a.wizard.sourceUrl})]}),c.jsxs(He,{size:"sm",disabled:r||o||e.trim().length===0,onClick:()=>{const l=uu(e);t(l),i(l)},children:[o?c.jsx(Hh,{className:"size-4 animate-spin"}):null,a.url.fetch]})]}),s!==void 0?c.jsx("p",{className:"pt-2 text-xs text-destructive",role:"alert",children:s}):null,n!==void 0?c.jsxs("p",{className:"pt-2 text-xs text-muted-foreground",children:[c.jsx("span",{children:a.url.sourcePrefix}),c.jsx("span",{className:"font-mono",children:n}),c.jsx("span",{children:a.url.activeSuffix})]}):c.jsx("p",{className:"pt-2 text-xs text-muted-foreground",children:a.url.idleNote})]})}const ti=["scaffold","icon","install"];function YC({open:e,phase:t,frozenValues:n,iconSrc:r,iconLabel:o,traySrc:s,trayLabel:i,selectedPort:a,currentStep:l,logs:u,error:d,result:p,onBack:A,onCreate:m,onShare:h,onOpenApp:g,onClose:x,confirmError:b,onOpenChange:v}){const{messages:y}=mt(),C={scaffold:y.dialog.stepScaffold,icon:y.dialog.stepIcon,install:y.dialog.stepInstall},I=f.useRef(null);f.useEffect(()=>{I.current?.scrollTo({top:I.current.scrollHeight})},[u.length]);const w=E=>{const S=ti.indexOf(E),D=ti.indexOf(l);return t==="success"||S<D?"done":S===D?"active":""};return c.jsx(La,{open:e,onOpenChange:E=>{t==="pending"&&E===!1||v(E)},children:c.jsx(Qa,{className:"max-w-xl",children:t==="confirm"?c.jsxs(c.Fragment,{children:[c.jsxs(Ln,{children:[c.jsx(Qn,{children:y.dialog.confirmTitle}),c.jsx(Ga,{children:y.dialog.confirmDescription})]}),c.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[c.jsx("dt",{className:"text-muted-foreground",children:"App ID"}),c.jsx("dd",{className:"font-mono break-all",children:n.appId}),c.jsx("dt",{className:"text-muted-foreground",children:y.form.appName}),c.jsx("dd",{className:"break-all",children:n.appName}),c.jsx("dt",{className:"text-muted-foreground",children:y.dialog.icon}),c.jsxs("dd",{className:"flex flex-wrap items-center gap-4",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":y.dialog.appIconPreview,children:r!==void 0?c.jsx("img",{src:r,alt:y.dialog.appIcon,className:"size-full object-contain"}):c.jsx("span",{className:"text-[10px] text-muted-foreground",children:y.common.none})}),c.jsxs("span",{className:"flex flex-col",children:[c.jsx("span",{className:"text-xs leading-tight",children:y.dialog.appIcon}),c.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:o})]})]}),c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":y.dialog.trayIconPreview,children:s!==void 0?c.jsx("img",{src:s,alt:y.dialog.trayIcon,className:"size-full object-contain"}):c.jsx("span",{className:"text-[10px] text-muted-foreground",children:y.dialog.textTray})}),c.jsxs("span",{className:"flex flex-col",children:[c.jsx("span",{className:"text-xs leading-tight",children:y.dialog.trayIcon}),c.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:i})]})]})]}),c.jsx("dt",{className:"text-muted-foreground",children:y.dialog.port}),c.jsx("dd",{className:"font-mono",children:a!==void 0?Ye(y.dialog.portSelected,{port:a}):y.dialog.portRuntime}),c.jsx("dt",{className:"text-muted-foreground",children:y.advanced.pm}),c.jsx("dd",{children:n.pm})]}),b!==void 0?c.jsx("p",{className:"text-xs font-medium text-red-400",children:b}):null,c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(He,{variant:"outline",onClick:A,children:y.dialog.back}),c.jsx(He,{variant:"outline",onClick:h,children:y.dialog.share}),c.jsx(He,{onClick:m,children:y.dialog.confirmCreate})]})]}):t==="pending"?c.jsxs(c.Fragment,{children:[c.jsx(Ln,{children:c.jsx(Qn,{children:y.dialog.pendingTitle})}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:ti.map(E=>c.jsx(Co,{variant:w(E)==="done"?"default":"secondary",children:C[E]},E))}),c.jsx("div",{ref:I,className:"h-48 overflow-y-auto rounded-md border border-border bg-[#05070b] p-3 font-mono text-[11px] leading-5 text-[#b7c3d8] whitespace-pre-wrap",children:u.join(`
|
|
24
|
+
`)})]}):t==="success"&&p!==void 0?c.jsxs(c.Fragment,{children:[c.jsx(Ln,{children:c.jsxs(Qn,{className:"flex items-center gap-2",children:[c.jsx(vh,{className:"size-5 text-emerald-400"}),y.dialog.successTitle]})}),c.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[c.jsx("dt",{className:"text-muted-foreground",children:y.dialog.projectDir}),c.jsx("dd",{className:"font-mono break-all",children:p.projectDir}),p.bundlePath?c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"text-muted-foreground",children:y.dialog.macosBundle}),c.jsx("dd",{className:"font-mono break-all",children:p.bundlePath})]}):null]}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(He,{variant:"outline",onClick:x,children:y.dialog.done}),c.jsxs(He,{onClick:g,children:[c.jsx(Eu,{}),y.dialog.openApp]})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:p.pinHint})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ln,{children:c.jsxs(Qn,{className:"flex items-center gap-2",children:[c.jsx(uA,{className:"size-5 text-red-400"}),y.dialog.failedTitle]})}),c.jsx("p",{className:"break-all font-mono text-xs text-red-400",children:d??y.dialog.unknownError}),c.jsx("div",{className:"flex justify-end",children:c.jsx(He,{variant:"outline",onClick:A,children:y.dialog.backRetry})})]})})})}const ni=(e,t)=>{const n=f.useRef(e);n.current=e;const r=f.useRef(void 0),o=f.useRef(void 0),s=f.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0);const d=o.current;o.current=void 0,d!==void 0&&n.current(...d)},[]),i=f.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0),o.current=void 0},[]),a=f.useCallback((...d)=>{o.current=d,r.current!==void 0&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=void 0;const p=o.current;o.current=void 0,p!==void 0&&n.current(...p)},t)},[t]);f.useEffect(()=>s,[s]);const l=f.useRef(a);l.current=a;const u=f.useCallback((...d)=>{l.current(...d)},[]);return u.flush=s,u.cancel=i,u},pp=f.createContext(void 0);function hp(){const e=f.useContext(pp);if(e===void 0)throw new Error(at(64));return e}const nl={tabActivationDirection:e=>({"data-activation-direction":e})},zC=f.forwardRef(function(t,n){const{className:r,defaultValue:o=0,onValueChange:s,orientation:i="horizontal",render:a,value:l,style:u,...d}=t,p=t.defaultValue!==void 0,A=f.useRef([]),[m,h]=f.useState(()=>new Map),[g,x]=ln({controlled:l,default:o,name:"Tabs",state:"value"}),b=l!==void 0,[v,y]=f.useState(()=>new Map),C=f.useRef(void 0),I=f.useCallback(K=>Bi(v,K),[v]),[w,E]=f.useState(()=>({previousValue:g,tabActivationDirection:"none"})),{previousValue:S,tabActivationDirection:D}=w;let k=D,j=!1;S!==g&&(k=du(S,g,i,v),j=S!=null&&g!=null&&I(g)==null);const N=j?S:g,T=S!==N||D!==k;le(()=>{T&&E({previousValue:N,tabActivationDirection:k})},[N,T,k]);const F=ue((K,ee)=>{const ce=du(g,K,i,v);ee.activationDirection=ce,s?.(K,ee),!ee.isCanceled&&x(K)}),R=ue((K,ee)=>{s?.(K,Ce(ee,void 0,void 0,{activationDirection:"none"}))}),O=ue((K,ee)=>(h(ce=>{const te=new Map(ce);return te.set(K,ee),te}),()=>{h(ce=>{if(ce.get(K)!==ee)return ce;const te=new Map(ce);return te.delete(K),te})})),_=f.useCallback(K=>m.get(K),[m]),M=f.useCallback(K=>{for(const ee of v.values())if(K===ee.value)return ee.id},[v]),H=f.useMemo(()=>({getTabElementBySelectedValue:I,getTabIdByPanelValue:M,getTabPanelIdByValue:_,onValueChange:F,orientation:i,registerMountedTabPanel:O,setTabMap:y,tabActivationDirection:k,value:g}),[I,M,_,F,i,O,y,k,g]),G=f.useMemo(()=>{for(const K of v.values())if(K.value===g)return K},[v,g]),B=f.useMemo(()=>{for(const K of v.values())if(!K.disabled)return K.value},[v]),P=f.useRef(!p),W=f.useRef(o),Y=f.useRef(p),Z=f.useRef(!1);le(()=>{if(b)return;function K($,X){x($),E({previousValue:$,tabActivationDirection:"none"}),R($,X),P.current=!1}if(v.size===0){Z.current&&g!==null&&!C.current?.isConnected&&K(null,yl);return}Z.current=!0,C.current=v.keys().next().value;const ee=G?.disabled,ce=G==null&&g!==null;if(!ee&&g===W.current&&(Y.current=!1),Y.current&&ee&&g===W.current)return;const te=P.current;if(ee||ce){const $=B??null;if(g===$){P.current=!1;return}let X=yl;te?X=vl:ee&&(X=Iu),K($,X);return}te&&G!=null&&(R(g,vl),P.current=!1)},[B,b,R,G,x,v,g]);const J=Me("div",t,{state:{orientation:i,tabActivationDirection:k},ref:n,props:d,stateAttributesMapping:nl});return c.jsx(pp.Provider,{value:H,children:c.jsx(Ur,{elementsRef:A,children:J})})});function Bi(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function du(e,t,n,r){if(e==null||t==null)return"none";const[o,s,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],a=Bi(r,e),l=Bi(r,t);if(a==null||l==null)return a!==l&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:s:"none";const u=a.getBoundingClientRect()[o],d=l.getBoundingClientRect()[o];return d<u?s:d>u?i:"none"}const Ap=f.createContext(void 0);function UC(){const e=f.useContext(Ap);if(e===void 0)throw new Error(at(65));return e}const VC=f.forwardRef(function(t,n){const{className:r,disabled:o=!1,render:s,value:i,id:a,nativeButton:l=!0,style:u,...d}=t,{value:p,getTabPanelIdByValue:A,onValueChange:m,orientation:h,tabActivationDirection:g}=hp(),{activateOnFocus:x,registerTabResizeObserverElement:b,tabsListElement:v}=UC(),{highlightedIndex:y,onHighlightedIndexChange:C}=Oi(),I=wt(a),w=f.useMemo(()=>({disabled:o,id:I,value:i}),[o,I,i]),{compositeProps:E,compositeRef:S,index:D}=Xd({metadata:w}),k=i===p,j=f.useRef(!1),N=f.useRef(null),T=ue(Z=>{N.current?.(),N.current=Z?b(Z):null});le(()=>{if(j.current){j.current=!1;return}if(!(k&&D>-1&&y!==D))return;const Z=v;if(Z!=null){const Q=yt(je(Z));if(Q&&ve(Z,Q))return}o||C(D)},[k,D,y,C,o,v]);const{getButtonProps:F,buttonRef:R}=Vt({disabled:o,native:l,focusableWhenDisabled:!0}),O=A(i),_=f.useRef(!1),M=f.useRef(!1);function H(Z){m(i,Ce(Pt,Z.nativeEvent,void 0,{activationDirection:"none"}))}function G(Z){k||o||H(Z)}function B(Z){k||o||x&&(!_.current||M.current)&&H(Z)}function P(Z){if(k||o)return;_.current=!0,M.current=Z.button===0;const Q=je(Z.currentTarget);function J(){_.current=!1,M.current=!1,Q.removeEventListener("pointerup",J),Q.removeEventListener("pointercancel",J)}Q.addEventListener("pointerup",J),Q.addEventListener("pointercancel",J)}return Me("button",t,{state:{disabled:o,active:k,orientation:h,tabActivationDirection:g},ref:[n,R,S,T],props:[E,{role:"tab","aria-controls":O,"aria-selected":k,id:I,onClick:G,onFocus:B,onPointerDown:P,[hf]:k?"":void 0,onKeyDownCapture(){j.current=!0}},d,F],stateAttributesMapping:nl})}),ZC=f.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:o,loopFocus:s=!0,render:i,style:a,...l}=t,{orientation:u,setTabMap:d,tabActivationDirection:p}=hp(),[A,m]=f.useState(0),[h,g]=f.useState(null),x=f.useRef(new Set),b=f.useRef(new Set),v=f.useRef(null);le(()=>{if(typeof ResizeObserver>"u")return;const S=new ResizeObserver(()=>{x.current.forEach(D=>{D()})});return v.current=S,h&&S.observe(h),b.current.forEach(D=>{S.observe(D)}),()=>{S.disconnect(),v.current=null}},[h]);const y=ue(S=>(x.current.add(S),()=>{x.current.delete(S)})),C=ue(S=>(b.current.add(S),v.current?.observe(S),()=>{b.current.delete(S),v.current?.unobserve(S)})),I={orientation:u,tabActivationDirection:p},w={"aria-orientation":u==="vertical"?"vertical":void 0,role:"tablist"},E=f.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:C,tabsListElement:h}),[r,y,C,h]);return c.jsx(Ap.Provider,{value:E,children:c.jsx(Af,{render:i,className:o,style:a,state:I,refs:[n,g],props:[w,l],stateAttributesMapping:nl,highlightedIndex:A,enableHomeAndEndKeys:!0,loopFocus:s,orientation:u,onHighlightedIndexChange:m,onMapChange:d,disabledIndices:Ht})})});function JC({className:e,orientation:t="horizontal",...n}){return c.jsx(zC,{"data-slot":"tabs","data-orientation":t,className:ge("group/tabs flex gap-2 data-horizontal:flex-col",e),...n})}const $C=ji("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-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function XC({className:e,variant:t="default",...n}){return c.jsx(ZC,{"data-slot":"tabs-list","data-variant":t,className:ge($C({variant:t}),e),...n})}function fu({className:e,...t}){return c.jsx(VC,{"data-slot":"tabs-trigger",className:ge("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-foreground/60 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 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm 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 dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","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",e),...t})}function pu({className:e,size:t="default",...n}){return c.jsx("div",{"data-slot":"card","data-size":t,className:ge("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})}function hu({className:e,...t}){return c.jsx("div",{"data-slot":"card-header",className:ge("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function Au({className:e,...t}){return c.jsx("div",{"data-slot":"card-content",className:ge("px-(--card-spacing)",e),...t})}function qC({className:e,...t}){return c.jsx("div",{"data-slot":"card-footer",className:ge("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}const gp=f.memo(({port:e,url:t,visible:n,className:r})=>{const o=f.useRef(null),s=f.useRef(t);return f.useEffect(()=>{const i=o.current;if(i===null){s.current=t;return}s.current!==t&&(s.current=t,i.src=t)},[t]),c.jsx("iframe",{ref:o,title:`service-${e}`,src:t,className:r,style:{width:"100%",height:"100%",border:0,background:"#fff",display:n?"block":"none"},sandbox:"allow-same-origin allow-scripts allow-forms"})});gp.displayName="StableIframe";const eI=e=>{const t=e.trim();if(t.length!==0)try{return new URL(/^https?:\/\//iu.test(t)?t:`http://${t}`).href}catch{return}},gu=({status:e,services:t,activeTab:n,onJumpToService:r})=>{const{messages:o}=mt();return c.jsxs(qC,{className:"h-8 shrink-0 gap-3 overflow-x-auto px-3 py-0 text-[11px] text-muted-foreground",children:[c.jsx("span",{className:"font-mono whitespace-nowrap",children:Ye(o.tabs.cursor,{y:e.cursorY,x:e.cursorX})}),c.jsxs("span",{className:"font-mono whitespace-nowrap",children:[e.cols,"×",e.rows]}),c.jsx("span",{className:"font-mono whitespace-nowrap",children:e.selection===void 0?o.tabs.noSelection:Ye(o.tabs.selection,{start:`${e.selection.start.y}:${e.selection.start.x}`,end:`${e.selection.end.y}:${e.selection.end.x}`})}),c.jsx("span",{className:"h-3 w-px bg-border"}),t.length===0?c.jsx("span",{children:o.tabs.sniffing}):t.map(s=>c.jsxs(Co,{variant:n===`svc-${s.port}`?"default":"secondary",className:"cursor-pointer font-mono whitespace-nowrap",onClick:()=>r(s.port),children:[":",s.port,s.title?` · ${s.title}`:""]},s.port))]})};function tI({command:e,terminalHostRef:t,terminalReady:n,interactive:r,status:o,services:s,iframeTabs:i,activeTab:a,onActiveTabChange:l,onIframeNavigate:u,onIframeHistoryMove:d,onJumpToService:p,hideTerminal:A=!1,className:m}){const{messages:h}=mt();return c.jsxs("div",{className:ge("flex min-h-0 flex-col gap-2",m),children:[c.jsx(JC,{value:a,onValueChange:l,children:c.jsxs(XC,{variant:"line",className:"w-full justify-start border-b px-2",children:[A?null:c.jsxs(fu,{value:"terminal",children:[c.jsx(Sr,{className:"size-3.5"}),h.tabs.terminal,!r&&n?c.jsx("span",{className:"text-[10px] text-amber-400",children:h.tabs.nonInteractive}):null]}),i.map(g=>c.jsxs(fu,{value:`svc-${g.port}`,children:[c.jsx(si,{className:"size-3.5"}),new URL(g.url).port===""?Si(g.url):`${Si(g.url)}:${new URL(g.url).port}`]},g.port))]})}),c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",hidden:A||a!=="terminal",children:c.jsxs(pu,{size:"sm",className:"min-h-0 flex-1 gap-0",children:[c.jsx(hu,{className:"border-b [.border-b]:pb-2",children:c.jsxs("span",{className:"tech-ltr flex min-w-0 items-center gap-2 font-mono text-xs text-muted-foreground",children:[c.jsx(Sr,{className:"size-4 shrink-0"}),c.jsx("span",{className:"truncate",children:e||h.tabs.noCommand})]})}),c.jsxs(Au,{className:"min-h-0 flex-1 p-0",children:[c.jsx("div",{ref:t,className:"min-h-0 min-w-0 h-full bg-[#05070b] px-1"}),n?null:c.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:h.tabs.loadingRenderer})]}),c.jsx(gu,{status:o,services:s,activeTab:a,onJumpToService:p})]})}),i.map(g=>c.jsx("div",{className:"flex min-h-0 flex-1 flex-col",hidden:a!==`svc-${g.port}`,children:c.jsxs(pu,{size:"sm",className:"min-h-0 flex-1 gap-0",children:[c.jsx(hu,{className:"border-b [.border-b]:pb-2",children:c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(He,{variant:"ghost",size:"icon-sm",disabled:g.historyIndex===0,onClick:()=>d(g.port,-1),"aria-label":h.common.back,children:c.jsx(uh,{})}),c.jsx(He,{variant:"ghost",size:"icon-sm",disabled:g.historyIndex>=g.history.length-1,onClick:()=>d(g.port,1),"aria-label":h.common.forward,children:c.jsx(dh,{})}),c.jsx(He,{variant:"ghost",size:"icon-sm",onClick:()=>u(g.port,g.url,"replace"),"aria-label":h.common.reload,children:c.jsx(fh,{})}),c.jsx(si,{className:"size-4 shrink-0 text-muted-foreground"}),c.jsx(et,{className:"tech-ltr h-7 font-mono text-xs",defaultValue:g.url,placeholder:h.tabs.urlPlaceholder,onKeyDown:x=>{if(x.key!=="Enter")return;const b=x.target.value,v=eI(b);v!==void 0&&u(g.port,v,"push")}},`${g.port}:${g.historyIndex}:${g.url}`)]})}),c.jsx(Au,{className:"min-h-0 flex-1 p-0",children:c.jsx(gp,{port:g.port,url:g.url,visible:a===`svc-${g.port}`})}),c.jsx(gu,{status:o,services:s,activeTab:a,onJumpToService:p})]})},g.port))]})}const mp={model:"isnet_fp16",alphaThreshold:0,shrink:0},nI="1.7.0";let mo;const rI=async()=>(mo!==void 0||(mo=(await ph(()=>import("./index2.js"),__vite__mapDeps([0,1,2,3]))).removeBackground),mo),oI=()=>new URL(`/imgly-data/${nI}/`,window.location.origin).toString(),sI=(e,t)=>{if(t.alphaThreshold<=0&&t.shrink<=0)return e;const{width:n,height:r}=e;let o=new Uint8ClampedArray(n*r);for(let i=0;i<o.length;i+=1){const a=e.data[i*4+3]??0;o[i]=t.alphaThreshold>0&&a<t.alphaThreshold?0:a}for(let i=0;i<t.shrink;i+=1){const a=new Uint8ClampedArray(o.length);for(let l=0;l<r;l+=1)for(let u=0;u<n;u+=1){let d=o[l*n+u]??0;for(let p=-1;p<=1&&d>0;p+=1)for(let A=-1;A<=1&&d>0;A+=1){const m=l+p,h=u+A,g=m<0||m>=r||h<0||h>=n?0:o[m*n+h]??0;g<d&&(d=g)}a[l*n+u]=d}o=a}const s={data:new Uint8ClampedArray(e.data),width:n,height:r};for(let i=0;i<o.length;i+=1)s.data[i*4+3]=o[i]??0;return s},iI=async(e,t=mp,n)=>{try{const r=await rI(),o=(l,u,d)=>{if(d<=0)return;const p=Math.min(100,Math.round(u/d*100));n?.(l.startsWith("fetch:")?{kind:"download",percent:p}:{kind:"infer"})},s=await r(e,{model:t.model,device:"gpu",publicPath:oI(),progress:o});let i=s;const a=await createImageBitmap(s);try{if(t.alphaThreshold>0||t.shrink>0){const l=document.createElement("canvas");l.width=a.width,l.height=a.height;const u=l.getContext("2d");if(u!==null){u.drawImage(a,0,0);const d=u.getImageData(0,0,l.width,l.height),p=sI(d,t);d.data.set(p.data),u.putImageData(d,0,0);const A=await new Promise(m=>l.toBlob(m,"image/png"));A!==null&&(i=A)}}return{bytes:i,width:a.width,height:a.height}}finally{a.close()}}catch{return}},mu={appId:"",appName:"",iconPath:"",iconBackground:"transparent",iconScale:.8,trayIconPath:"",force:!1,pm:"npm",showStartupTerminal:!1,showAddressBar:!1,imageSmoothingEnabled:!0,developerMode:!1},aI={appId:"",appName:"",targetDir:"",iconPath:""};function lI(){const{messages:e}=mt(),{query:t}=rf(),n=t.get("edit"),[r,o]=f.useState(void 0),[s,i]=f.useState(""),[a,l]=f.useState([]),[u,d]=f.useState(w1),[p,A]=f.useState(""),[m,h]=f.useState(!1),[g,x]=f.useState(!1),b=f.useCallback(U=>{x(U),Zn.set(U)},[]);f.useEffect(()=>(Zn.set(g),()=>Zn.set(!1)),[g]);const[v,y]=f.useState(void 0),[C,I]=f.useState(!1),[w,E]=f.useState(""),[S,D]=f.useState(!1),[k,j]=f.useState("idle"),[N,T]=f.useState(),[F,R]=f.useState(""),[O,_]=f.useState(!0),[M,H]=f.useState(!1),[G,B]=f.useState(),[P,W]=f.useState(mu),[Y,Z]=f.useState(aI),[Q,J]=f.useState([]),[K,ee]=f.useState(),[ce,te]=f.useState(!1),[$,X]=f.useState([]),[ne,de]=f.useState(),[fe,ie]=f.useState(0),[he,oe]=f.useState(),[se,ae]=f.useState(),[xe,me]=f.useState(),[L,z]=f.useState(),[ye,q]=f.useState("transparent"),[re,Se]=f.useState(.8),ke=f.useRef(void 0),We=f.useRef(void 0),rt=f.useRef(!1),Ge=f.useRef(!1),[At,$e]=f.useState(),[Oe,lt]=f.useState(),[Ee,Le]=f.useState(),[Ze,ze]=f.useState("terminal"),[Re,Pe]=f.useState([]),[Je,qe]=f.useState({cursorX:0,cursorY:0,cols:0,rows:0}),[ft,ot]=f.useState(!1),[Ct,st]=f.useState("confirm"),[Et,St]=f.useState([]),[qt,Be]=f.useState(""),[Ue,bt]=f.useState(),[Rt,Bt]=f.useState(),[jt,Lt]=f.useState(mu),dn=f.useRef(null),Dt=f.useRef(void 0),en=f.useRef([]),rl=f.useRef(P);rl.current=P;const ol=f.useRef(k);ol.current=k;const Zr=(U,Ae,V)=>{if(Ae===void 0)return!1;const pe=Number.parseInt(Ae.split(":")[1]??"",10);return!U.some(Fe=>Fe.index===pe)||Ae.split(":")[0]!==String(V)},ms=f.useRef(void 0);f.useEffect(()=>{const U=P.iconPath.trim().length>0?P.iconPath.trim():Y.iconPath.trim().length>0?Y.iconPath.trim():void 0;if(ms.current=U,U===void 0){ae(void 0),z(void 0),ke.current=void 0;return}U===ke.current&&L!==void 0||(async()=>{try{me(void 0);const Ae=await _e("/api/icon-analyze",{path:U});if(!Ae.ok)throw new Error("analyze failed");const V=await Ae.json();if(ms.current!==U)return;ae(V),rt.current=!1,q(V.suggested),_e("/api/form",{iconBackground:V.suggested});const pe=await _e("/api/icon-compose",{foregroundPath:U,background:V.suggested,scale:re});if(!pe.ok)throw new Error("compose failed");const Fe=await pe.json();if(ms.current!==U)return;z(Fe),ke.current=U}catch{ae(void 0),z(void 0),me(e.icon.composeError)}})()},[P.iconPath,Y.iconPath]);const[xp,sl]=f.useState(!1),[bp,il]=f.useState(void 0),[xs,vp]=f.useState(mp),al=f.useRef(xs);al.current=xs;const Jr=f.useRef(new Set),bs=f.useRef(0),vs=f.useRef(!1),ys=f.useRef(!1),Cs=f.useCallback(async(U,Ae,V)=>{vs.current=!0,sl(!0);try{const pe=await(await fetch(Rn(Ae,U.index,V))).blob(),Fe=await iI(pe,al.current,Es=>il(Es.kind==="download"?Ye(e.icon.extractingDownload,{percent:Es.percent}):e.icon.extractingInfer));if(Fe===void 0||bs.current!==V)return;const _t=`token=${encodeURIComponent(new URLSearchParams(location.search).get("token")??"")}&port=${Ae}&variantOf=${U.index}&width=${Fe.width}&height=${Fe.height}`;await fetch(`/api/icon-candidate?${_t}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:Fe.bytes})}catch{}finally{vs.current=!1,sl(!1),il(void 0),ys.current&&(ys.current=!1,ll())}},[]),ll=ni(()=>{if(k==="frozen"||k==="materializing"||k==="success")return;const U=ne,Ae=$.find(V=>V.variant==="original");if(!(U===void 0||Ae===void 0)){if(vs.current){ys.current=!0;return}Cs(Ae,U,fe)}},500),yp=U=>{vp(U),ll()},Hn=f.useRef(void 0);f.useEffect(()=>{if(!(he===void 0&&Oe===void 0)&&ne!==void 0){if(Hn.current===void 0){Hn.current=fe;return}Hn.current!==fe&&(Hn.current=fe,he!==void 0&&!Zr($,he,ne)&&_e("/api/icon-select",{port:ne,index:Number.parseInt(he.split(":")[1]??"",10)}),Oe!==void 0&&!Zr($,Oe,ne)&&_e("/api/tray-icon-select",{port:ne,index:Number.parseInt(Oe.split(":")[1]??"",10)}))}},[fe,he,Oe,$,ne]),f.useEffect(()=>{const U=ne,Ae=$.find(pe=>pe.variant==="original");if(U===void 0||Ae===void 0||k==="frozen"||k==="materializing"||k==="success")return;bs.current!==fe&&(bs.current=fe,Jr.current=new Set);const V=`${U}:${Ae.index}`;Jr.current.has(V)||$.some(pe=>pe.variant==="subject"&&pe.variantOf===Ae.index)||(Jr.current=new Set([...Jr.current,V]),Cs(Ae,U,fe))},[$,ne,fe,k,Cs]);const cl=ni(U=>{_e("/api/form",{iconScale:U});const Ae=dl();fl(Ae,ye,U)},250),Cp=U=>{Se(U),cl(U)},ul=ni(U=>{_e("/api/form",{iconBackground:U});const Ae=dl();fl(Ae,U,re)},120),Ip=U=>{rt.current=!0,q(U),ul(U)},dl=()=>P.iconPath.trim().length>0?P.iconPath.trim():Y.iconPath.trim().length>0?Y.iconPath.trim():void 0,fl=f.useCallback(async(U,Ae,V)=>{if(U===void 0){ae(void 0),z(void 0),ke.current=void 0,We.current=void 0;return}We.current=U;try{const pe=await _e("/api/icon-analyze",{path:U});if(!pe.ok)throw new Error("analyze failed");const Fe=await pe.json();if(We.current!==U)return;ae(Fe);const xt=await _e("/api/icon-compose",{foregroundPath:U,background:Ae,scale:V});if(!xt.ok)throw new Error("compose failed");const _t=await xt.json();if(We.current!==U)return;z(_t),ke.current=U}catch{ae(void 0),z(void 0),me(e.icon.recomposeError)}},[]);f.useEffect(()=>{hh()},[]);const wp=f.useRef(!1);f.useEffect(()=>{n===null||r===n||(o(n),(async()=>{const U=await vu(n);if(U.status!==200||"code"in U.data)return;const Ae=U.data;if(Ae.command?.executable!==void 0&&i(Ae.command.executable),Ae.command?.args!==void 0&&l([...Ae.command.args]),Ae.command?.executable!==void 0&&d(V=>({...V,argsMode:"array"})),Ae.appName!==void 0){const V=Ae.appName;W(pe=>({...pe,appName:V}))}if(Ae.icons?.imageSmoothingEnabled!==void 0){const V=Ae.icons.imageSmoothingEnabled;W(pe=>({...pe,imageSmoothingEnabled:V}))}if(Ae.developerMode!==void 0){const V=Ae.developerMode;W(pe=>({...pe,developerMode:V,force:!0}))}if(Ae.command?.cwd!==void 0){const V=Ae.command.cwd;d(pe=>({...pe,cwd:V}))}if(Ae.command?.env!==void 0){const V=Object.entries(Ae.command.env).map(([pe,Fe])=>({key:pe,value:Fe}));d(pe=>({...pe,env:V}))}wp.current=!0})())},[n,r]),f.useEffect(()=>{if(!g)return;let U=!1;return(async()=>{const Ae=dn.current;if(Ae===null)return;const V=await Ah(Ae);if(U||V===void 0){U||B(e.tabs.ghosttyFallback);return}Dt.current=V,H(!0);const pe=en.current;en.current=[];for(const xt of pe)V.write(xt);V.onData(xt=>{pl.current&&_e("/api/terminal-input",{data:xt})}),V.onResize(({cols:xt,rows:_t})=>{_e("/api/terminal-resize",{cols:xt,rows:_t})});const Fe=window.setInterval(()=>{if(!(ol.current==="idle"&&!Dt.current))try{qe(V.readState())}catch{}},300);return()=>window.clearInterval(Fe)})(),()=>{U=!0,Dt.current?.dispose(),Dt.current=void 0}},[g]);const pl=f.useRef(!0);f.useEffect(()=>{pl.current=O},[O]),f.useEffect(()=>{const U=k1();return U.onmessage=Ae=>{const V=JSON.parse(Ae.data);switch(V.type){case"snapshot":{j(V.state),D(V.runAlive),y(V.urlSource),i(V.command),R(V.command),d(V.commandOptions),_(V.interactive),W(V.form),Z(V.defaults),h(V.targetDirExists),J(V.services),ee(V.selectedPort),X(V.icons??[]),de(V.iconsPort),ie(V.iconsGeneration??0),Pe(V.urlSource!==void 0?[{port:0,url:V.urlSource,history:[V.urlSource],historyIndex:0}]:V.services.map(Fe=>({port:Fe.port,url:Fe.url,history:[Fe.url],historyIndex:0})));const pe=V.runAlive||V.services.length>0||V.urlSource!==void 0;b(pe),ze(V.urlSource!==void 0?"svc-0":pe&&V.services.length>0?`svc-${V.services[0].port}`:"terminal");break}case"state":j(V.state),V.state==="failed"&&T(V.reason),V.state==="frozen"&&(st("confirm"),ot(!0)),V.state==="materializing"&&(st("pending"),St([])),V.state==="success"&&st("success"),V.state==="failed"&&Al.current&&(st("failed"),bt(V.reason));break;case"log":{Dt.current!==void 0?Dt.current.write(V.chunk):hl.current!==void 0?B(pe=>(pe??"")+V.chunk):en.current.push(V.chunk);break}case"term-mode":if(_(V.interactive),!V.interactive&&V.message!==void 0){const pe=`\x1B[33m${V.message}\x1B[0m\r
|
|
25
|
+
`;Dt.current!==void 0?Dt.current.write(pe):en.current.push(pe)}break;case"run-status":D(V.running);break;case"command-display":R(V.command);break;case"command-options":d(V.options),A(V.defaultCwd);break;case"services":{J(V.services),ee(V.selectedPort),Pe(pe=>{const Fe=[...pe];let xt;for(const _t of V.services)Fe.find(Op=>Op.port===_t.port)===void 0&&(Fe.push({port:_t.port,url:_t.url,history:[_t.url],historyIndex:0}),xt=_t.port);return xt!==void 0&&ze(`svc-${xt}`),Fe});break}case"icons":X(V.icons),de(V.port),ie(V.generation),Zr(V.icons,he,V.port)&&oe(void 0),Zr(V.icons,Oe,V.port)&<(void 0);break;case"scrape":te(V.hasIcon);break;case"form":{W(n!==null?Fe=>Fe:V.values),Z(V.defaults),h(V.targetDirExists),Ge.current||(Ge.current=!0,q(V.values.iconBackground),Se(V.values.iconScale));break}case"materialize-step":Be(V.step),St(pe=>[...pe,`[${V.step}] ${V.message}`]);break;case"materialize-log":St(pe=>[...pe,V.message]);break;case"success":Bt({projectDir:V.projectDir,...V.bundlePath===void 0?{}:{bundlePath:V.bundlePath},pinHint:V.pinHint}),window.dispatchEvent(new Event("create-opentray:apps-changed"));break}},()=>U.close()},[]);const hl=f.useRef(void 0);f.useEffect(()=>{hl.current=G},[G]);const Al=f.useRef(!1);f.useEffect(()=>{Al.current=ft},[ft]);const Is=he===void 0?void 0:Number.parseInt(he.split(":")[1]??"",10),kp=L!==void 0?Xf(L.key):At!==void 0?At:ne!==void 0&&Is!==void 0&&$.some(U=>U.index===Is)?Rn(ne,Is,fe):ne!==void 0&&$!==void 0&&$[0]!==void 0&&he===void 0?Rn(ne,$[0].index,fe):void 0,Ep=L!==void 0?Ye(e.icon.composed,{background:L.background==="transparent"?e.icon.bgNameTransparent:L.background==="black"?e.icon.bgNameBlack:e.icon.bgNameWhite}):At!==void 0?e.icon.localImage:$[0]!==void 0?`${$[0].width}×${$[0].height} ${$[0].format.toUpperCase()}`:e.icon.firstLetter,gl=(()=>{if(Ee!==void 0)return Ee;const U=P.trayIconPath.trim();if(U.length>0&&ne!==void 0){const V=$.find(pe=>pe.path===U);if(V!==void 0)return Rn(ne,V.index,fe)}const Ae=/^([^:]+):(\d+)$/.exec(Oe??"");if(Ae!==null){const V=Number(Ae[1]),pe=Number(Ae[2]);if(Number.isInteger(V)&&Number.isInteger(pe))return Rn(V,pe,fe)}U.length})(),Sp=Ee!==void 0?e.icon.localImage:gl!==void 0?e.icon.followSource:e.icon.followApp;f.useEffect(()=>{const U=s.trim();if(U.length===0)return;const Ae=window.setTimeout(()=>{_e("/api/prime",{command:U})},400);return()=>window.clearTimeout(Ae)},[s]);const Rp=async()=>{const U=s.trim();if(!(u.argsMode==="string"&&U.length===0)){if(b(!0),ze("terminal"),Dt.current?.reset(),Pe([]),J([]),te(!1),X([]),de(void 0),oe(void 0),$e(void 0),lt(void 0),Le(void 0),u.argsMode==="array"){if(a.length===0||(a[0]??"").trim().length===0)return;await _e("/api/command",{argv:a});return}await _e("/api/command",{command:U})}},Dp=U=>{if(Re.find(V=>V.port===U)===void 0){_e("/api/select-service",{port:U});return}_e("/api/select-service",{port:U}),ze(`svc-${U}`)},Fp=(U,Ae,V)=>{Pe(pe=>pe.map(Fe=>{if(Fe.port!==U)return Fe;if(V==="replace")return{...Fe,url:Ae};const xt=[...Fe.history.slice(0,Fe.historyIndex+1),Ae];return{...Fe,url:Ae,history:xt,historyIndex:xt.length-1}}))},Bp=(U,Ae)=>{Pe(V=>V.map(pe=>{if(pe.port!==U)return pe;const Fe=pe.historyIndex+Ae;return Fe<0||Fe>=pe.history.length?pe:{...pe,historyIndex:Fe,url:pe.history[Fe]}}))},[jp,ws]=f.useState(),Mp=async()=>{cl.flush(),ul.flush(),st("confirm"),ot(!0);try{const U=await _e("/api/confirm",{});if(!U.ok){const Ae=await U.json().catch(()=>({}));ws(Ae.error??Ye(e.dialog.confirmFailed,{status:U.status}));return}ws(void 0)}catch{ws(e.dialog.confirmRequestFailed)}};f.useEffect(()=>{k==="frozen"&&Lt({...rl.current,...P})},[k]);const Np=async()=>{await _e("/api/create",{})},[Tp,ml]=f.useState(!1),Pp=U=>Xp(U),ks=async()=>{ot(!1),(await _e("/api/cancel",{})).ok||j(Ae=>Ae==="frozen"?"discovered":Ae)},_p=g?"minmax(0, 520px) minmax(0, 1fr) minmax(0, 0fr)":"minmax(0, 1fr) minmax(0, var(--list-w)) minmax(0, 1fr)";return c.jsxs("div",{className:"grid h-full w-full overflow-hidden",style:{"--list-w":"min(520px, 100vw - 40px)",gridTemplateColumns:_p,transition:"grid-template-columns 450ms cubic-bezier(0.4, 0, 0.2, 1)"},children:[c.jsxs("div",{className:"flex w-full flex-col gap-4 overflow-y-auto p-5 pr-2 max-md:min-h-full "+(g?"md:border-r md:border-border":""),style:{gridColumn:g?"1":"2",gridRow:"1",transition:"border-color 450ms",scrollbarGutter:"stable"},children:[c.jsx("div",{className:"flex items-center justify-center",children:c.jsxs("div",{className:"inline-flex rounded-lg border border-border bg-card p-0.5 text-xs",children:[c.jsx("button",{type:"button",className:"rounded-md px-3 py-1.5 transition-colors "+(v===void 0&&!C?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),disabled:k==="materializing"||k==="success",onClick:()=>{I(!1),v!==void 0&&(E(""),y(void 0),Pe([]),b(!1),_e("/api/url",{url:"",exit:!0}))},children:e.wizard.sourceCommand}),c.jsx("button",{type:"button",className:"rounded-md px-3 py-1.5 transition-colors "+(v!==void 0||C?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),disabled:k==="materializing"||k==="success",onClick:()=>I(!0),children:e.wizard.sourceUrl})]})}),v!==void 0||C?c.jsx(GC,{value:w,onChange:E,activeSource:v,frozen:k==="materializing"||k==="frozen"||k==="success",loading:!1,failedReason:k==="failed"?N:void 0,onSubmit:U=>{_e("/api/url",{url:U}).then(Ae=>{Ae.ok&&(y(U),Pe([{port:0,url:U,history:[U],historyIndex:0}]),b(!0),ze("svc-0"))})}}):c.jsx(c.Fragment,{children:c.jsx(QC,{command:s,onCommandChange:i,argv:a,onArgvChange:U=>l([...U]),runAlive:S,frozen:k==="materializing"||k==="frozen"||k==="success",failedReason:k==="failed"?N:void 0,commandOptions:u,defaultCwd:p,onCommandOptionsChange:U=>{d(U),_e("/api/command-options",{cwd:U.cwd,env:U.env,argsMode:U.argsMode,family:U.family})},onRun:()=>{Rp()},onStop:()=>{_e("/api/stop",{})}})}),c.jsx(hC,{frozen:k==="frozen"||k==="materializing"||k==="success",values:P,defaults:Y,candidates:$,candidatesPort:ne,candidatesGeneration:fe,selectedIconRef:he,uploadedIconUrl:At,iconAnalysis:se,iconComposition:L,iconComposeError:xe,iconBackground:ye,iconScale:re,subjectExtracting:xp,subjectStage:bp,subjectSettings:xs,onSubjectSettingsChange:yp,onIconBackgroundChange:Ip,onIconScaleChange:Cp,selectedTrayRef:Oe,uploadedTrayUrl:Ee,selectedPort:K,targetDirExists:m,onPickIconCandidate:U=>{ne!==void 0&&(oe(`${ne}:${U.index}`),$e(void 0),Hn.current=fe,_e("/api/icon-select",{port:ne,index:U.index}))},onUploadIcon:U=>{const Ae=URL.createObjectURL(U);$e(Ae),oe(void 0),U.arrayBuffer().then(V=>{fetch("/api/icon-upload",{method:"POST",headers:{"content-type":U.type||"application/octet-stream",authorization:`Bearer ${new URLSearchParams(location.search).get("token")??""}`},body:V}).then(pe=>pe.json()).then(({path:pe})=>{pe===void 0||pe.length===0||(W(Fe=>({...Fe,iconPath:pe})),_e("/api/form",{iconPath:pe}))}).catch(()=>{})})},onClearIcon:()=>{oe(void 0),$e(void 0),W(U=>({...U,iconPath:""})),_e("/api/form",{iconPath:""})},onPickTray:U=>{ne!==void 0&&(lt(`${ne}:${U.index}`),Le(void 0),Hn.current=fe,_e("/api/tray-icon-select",{port:ne,index:U.index}))},onUploadTray:U=>{const Ae=URL.createObjectURL(U);Le(Ae),lt(void 0),U.arrayBuffer().then(V=>{fetch("/api/icon-upload",{method:"POST",headers:{"content-type":U.type||"application/octet-stream",authorization:`Bearer ${new URLSearchParams(location.search).get("token")??""}`},body:V}).then(pe=>pe.json()).then(({path:pe})=>{pe===void 0||pe.length===0||(W(Fe=>({...Fe,trayIconPath:pe})),_e("/api/form",{trayIconPath:pe}))}).catch(()=>{})})},onClearTray:()=>{lt(void 0),Le(void 0),W(U=>({...U,trayIconPath:""})),_e("/api/form",{trayIconPath:""})},onPatch:U=>{W(Ae=>({...Ae,...U})),_e("/api/form",U)},onConfirm:()=>{Mp()}})]}),c.jsx("div",{className:"flex min-h-0 min-w-0 flex-col gap-4 overflow-y-auto p-4 pr-1 max-md:hidden",style:{scrollbarGutter:"stable",gridColumn:g?"2":"3",gridRow:"1",opacity:g?1:0,visibility:g?"visible":"hidden",transition:"opacity 450ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear "+(g?"0s":"450ms")},children:g?c.jsxs(c.Fragment,{children:[c.jsx(tI,{command:F,terminalHostRef:dn,terminalReady:M,interactive:O,status:Je,services:v!==void 0?[{port:0,url:v,firstSeenAt:0,title:Si(v)}]:[...Q],hideTerminal:v!==void 0,iframeTabs:Re,activeTab:Ze,onActiveTabChange:ze,onIframeNavigate:Fp,onIframeHistoryMove:Bp,onJumpToService:Dp,className:"min-h-[480px] flex-1"}),G!==void 0?c.jsx("pre",{className:"max-h-56 overflow-auto rounded-xl border border-border bg-card p-3 font-mono text-xs whitespace-pre-wrap",children:G}):null]}):null}),c.jsx(YC,{open:ft,onOpenChange:U=>{if(U){ot(!0);return}if(Ct==="confirm"){ks();return}ot(!1)},phase:Ct,frozenValues:jt,iconSrc:kp,iconLabel:Ep,traySrc:gl,trayLabel:Sp,selectedPort:K,currentStep:qt,logs:Et,error:Ue??N,result:Rt,onBack:()=>{ks()},onCreate:()=>{Np()},onShare:()=>ml(!0),onOpenApp:()=>{_e("/api/open-app",{})},confirmError:jp,onClose:()=>{if(Ct==="confirm"){ks();return}ot(!1)}}),c.jsx(xf,{open:Tp,subtitle:jt?.appId??F,hasEnv:u.env.some(U=>U.key.trim().length>0),share:!0,runner:Pp,onClose:()=>ml(!1)})]})}function cI(){const{route:e}=of();return c.jsxs(c.Fragment,{children:[c.jsx("div",{hidden:e!=="add",className:"min-h-0 flex-1",children:c.jsx(lI,{})}),c.jsx("div",{hidden:e!=="applications",className:"min-h-0 flex-1",children:c.jsx(mb,{})}),c.jsx("div",{hidden:e!=="help",className:"min-h-0 flex-1",children:c.jsx(I1,{})})]})}const Zn={open:!1,listeners:new Set,set(e){if(this.open!==e){this.open=e;for(const t of this.listeners)t()}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}},uI=()=>{const[e,t]=f.useState(Zn.open);return f.useEffect(()=>Zn.subscribe(()=>t(Zn.open)),[]),e};function dI(){return c.jsx(Ex,{panelOpen:uI(),children:c.jsx(cI,{})})}const Wo=qp();eh(Wo.locale,Wo.theme);th.createRoot(document.getElementById("root")).render(c.jsx(nh.StrictMode,{children:c.jsx(rh,{initialLocale:Wo.locale,initialTheme:Wo.theme,children:c.jsx(dI,{})})}));
|