@stacksjs/components 0.2.908 → 0.2.910

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.
@@ -72,7 +72,9 @@ const preferredSide = {{ position }}
72
72
  const panelLimits = 'position:fixed;max-width:calc(100vw - 16px);margin:0;'
73
73
  const panelStyle = state(nativePopup ? { position: 'absolute', margin: 0, transform: [] } : panelLimits)
74
74
  const arrowStyle = state('')
75
- const tooltipContent = useReactiveProp('content', {{ content }})
75
+ // The instance root carries its own content prop. Baking that value into the
76
+ // fallback duplicated this entire setup for every different hint on a page.
77
+ const tooltipContent = useReactiveProp('content', '')
76
78
  const isDisabled = useReactiveProp('disabled', {{ disabled }})
77
79
  // Reactive prop binding — parent can drive `show` via signals. See #1704.
78
80
  const isVisible = useReactiveProp('show', {{ show }})
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ var Ha={__stx:!0,src:"./components/CodeBlock.stx"};var Va={__stx:!0,src:"./compo
10
10
  ${i.join(`
11
11
  `)}`)}return{valid:i.length===0,errors:i}}function ae(e,t,s){return(a)=>Mo(e,a,t,s)}function vu(e,t,s="value"){if(!t.validate(e,s,"assertion"))throw Error(t.message(e,s,"assertion"))}function wu(e,t,s="value"){if(!t.validate(e,s,"warning"))console.warn(t.message(e,s,"warning"))}var Ro="./Button-ghdfqwg0.stx";var Lo={variant:f.oneOf(["primary","secondary","outline","ghost","danger"]),appearance:f.oneOf(["mac"]),size:f.oneOf(["xs","sm","md","lg","xl"]),disabled:f.boolean,loading:f.boolean,type:f.oneOf(["button","submit","reset"]),fullWidth:f.boolean,label:f.string,text:f.string,leftIcon:f.string,rightIcon:f.string,className:f.string,onClick:f.func},$u=ae("Button",Lo);function Tu(e){return Zt(e,"Button","onClick")}function Eu(e){if(e&&!["primary","secondary","outline","ghost","danger"].includes(e))throw xe.invalidProp("Button","variant",e,["primary","secondary","outline","ghost","danger"])}function Iu(e){if(e&&!["xs","sm","md","lg","xl"].includes(e))throw xe.invalidProp("Button","size",e,["xs","sm","md","lg","xl"])}var Do="./Calendar-5vs6x7gj.stx";var Ho="./DateRangePicker-4zmf34e4.stx";var jo="./EmptyState-snj7gbsn.stx";var Bo="./ErrorState-qb7af5zb.stx";var Ko="./ThemeToggle-4wm9zare.stx";var Wo="./Card-r55zpjqh.stx";var Uo="./Checkbox-355qsbwd.stx";var Yo="./ChoiceChips-8dcf172n.stx";var Zo="./CodeEditor-kaywcb83.stx";var en="./ColorSwatches-ecfxphjy.stx";var sn="./Combobox-9n04ec5w.stx";var on="./ComboboxButton-4r6a45s1.stx";var rn="./ComboboxInput-1gyfpnca.stx";var cn="./ComboboxOption-wkw70js7.stx";var pn="./ComboboxOptions-zhr9b6rx.stx";var un="./CommandPalette-qqjdbcyg.stx";var mn="./CommandPaletteItem-7290ce1z.stx";var xn="./ContextMenu-43g3w5tp.stx";function bt(e,t=[]){let s=[];if(!Array.isArray(e))return s;for(let a of e){if(!a||typeof a!=="object")continue;if(a.separator){if(s.length>0&&!s[s.length-1].separator)s.push({separator:!0,id:"",path:[]});continue}s.push({...a,id:a.id==null?"":String(a.id),path:[]})}while(s.length>0&&s[s.length-1].separator)s.pop();return s.forEach((a,o)=>{if(a.path=[...t,o],a.separator||a.id==="")a.id=a.path.join(".");if(!a.separator&&Array.isArray(a.children))a.children=bt(a.children,a.path)}),s}function Qt(e){return Boolean(e)&&!e.separator}function es(e){return Boolean(e)&&!e.separator&&!e.disabled}function be(e){return Boolean(e)&&!e.separator&&Array.isArray(e.children)&&e.children.length>0}function $e(e,t,s){let a=e.length;if(a===0)return-1;let o=t;for(let n=0;n<a;n++)if(o=o<0?s===1?0:a-1:(o+s+a)%a,Qt(e[o]))return o;return-1}function Te(e){return $e(e,-1,1)}function ts(e){return $e(e,-1,-1)}function ss(e,t,s){let a=s.toLowerCase();if(a===""||e.length===0)return-1;let o=a.length>1&&a.split("").every((r)=>r===a.charAt(0)),n=o?a.charAt(0):a,i=a.length===1||o?t+1:Math.max(t,0);for(let r=0;r<e.length;r++){let c=(i+r+e.length)%e.length,l=e[c];if(Qt(l)&&(l.label||"").toLowerCase().startsWith(n))return c}return-1}function bn(e,t){for(let s of e){if(s.separator)continue;if(s.id===t)return s;if(s.children){let a=bn(s.children,t);if(a)return a}}return null}function as(e,t,s,a=8){let o=(n,i,r)=>{if(n+i<=r-a)return n;if(n-i>=a)return n-i;return Math.max(a,r-a-i)};return{x:o(e.x,t.width,s.width),y:o(e.y,t.height,s.height)}}function os(e,t,s,a=8,o=4){let n=e.left;if(n+t.width>s.width-a)n=Math.max(a,Math.min(e.right-t.width,s.width-a-t.width));let i=e.bottom+o;if(i+t.height>s.height-a){let r=e.top-o-t.height;i=r>=a?r:Math.max(a,s.height-a-t.height)}return{x:Math.max(a,n),y:i}}function ns(e,t,s,a=8,o=4){let n="right",i=e.right-o;if(i+t.width>s.width-a){let c=e.left+o-t.width;if(c>=a)i=c,n="left";else i=Math.max(a,s.width-a-t.width)}let r=Math.max(a,Math.min(e.top-o,s.height-a-t.height));return{x:i,y:r,side:n}}var vn={mod:"\u2318",meta:"\u2318",cmd:"\u2318",command:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7"},wn={mod:"Ctrl",meta:"Win",cmd:"Ctrl",command:"Ctrl",ctrl:"Ctrl",control:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift"},yn={enter:"\u21A9",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",space:"Space"},kn={escape:"Esc",esc:"Esc",delete:"Del",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",space:"Space"},Sn=["ctrl","control","alt","option","shift","mod","meta","cmd","command"],Cn=["mod","ctrl","control","cmd","command","meta","alt","option","shift"];function is(e){let s=(e.endsWith("++")?[...e.slice(0,-2).split("+"),"+"]:e.split("+")).map((o)=>o.trim()).filter((o)=>o!==""),a=s.pop()||"";return{modifiers:s.map((o)=>o.toLowerCase()),key:a}}function je(e){return e.length===1?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function rs(e,t){if(!e)return"";let{modifiers:s,key:a}=is(e),o=t?Sn:Cn,i=[...s].sort((c,l)=>o.indexOf(c)-o.indexOf(l)).map((c)=>(t?vn:wn)[c]??je(c)),r=(t?yn:kn)[a.toLowerCase()]??je(a);return t?i.join("")+r:[...new Set(i),r].join("+")}function ls(e,t){if(!e)return"";let{modifiers:s,key:a}=is(e),o={mod:t?"Meta":"Control",meta:"Meta",cmd:"Meta",command:"Meta",ctrl:"Control",control:"Control",alt:"Alt",option:"Alt",shift:"Shift"};return[...new Set(s.map((n)=>o[n]??je(n))),je(a)].join("+")}var $n=160,Tn=600;function En(){let e=typeof navigator>"u"?"":navigator.platform||navigator.userAgent||"";return/mac|iphone|ipad/i.test(e)}var In=0;class An{root;callbacks;items;label;disabled;apple;layer;uid=`stx-menu-${++In}`;stack=[];target=null;returnFocus=null;hoverTimer=null;typed="";typedAt=0;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.items=t.items??null,this.label=t.label||"Context menu",this.disabled=Boolean(t.disabled),this.apple=t.apple??En(),this.layer=document.createElement("div"),this.layer.className="stx-menu-layer",this.layer.setAttribute("data-menu-layer",""),this.layer.__stx_inert_content=!0,"popover"in HTMLElement.prototype)this.layer.setAttribute("popover","manual");else this.layer.hidden=!0;this.root.appendChild(this.layer),this.listen(this.root,"contextmenu",(a)=>this.onContextMenu(a)),this.listen(this.root,"keydown",(a)=>this.onHostKeyDown(a)),this.listen(this.layer,"keydown",(a)=>this.onMenuKeyDown(a)),this.listen(this.layer,"click",(a)=>this.onMenuClick(a)),this.listen(this.layer,"pointermove",(a)=>this.onMenuPointerMove(a)),this.listen(this.layer,"contextmenu",(a)=>a.preventDefault()),this.root.setAttribute("data-menu-ready","")}get isOpen(){return this.stack.length>0}setItems(e){this.items=e??null}setDisabled(e){if(this.disabled=e,e)this.close("api")}setLabel(e){this.label=e||"Context menu"}open(e,t,s={}){this.close("api",!1);let a=e instanceof Element?e:null,o=s.target??a??null,n=t??(typeof this.items==="function"?this.items(o):this.items),i=bt(n);if(i.length===0)return!1;this.target=o;let r=document.activeElement;this.returnFocus=r instanceof HTMLElement&&r!==document.body?r:null,this.showLayer();let c=this.buildMenu(i,null),l=c.element.getBoundingClientRect(),d={width:window.innerWidth,height:window.innerHeight},h=a?os(cs(a),l,d):as(e,l,d);if(this.position(c.element,h),this.listenWhileOpen(),s.keyboard||a)this.focusItem(c,Te(c.items));else c.element.focus({preventScroll:!0});return this.callbacks.onOpen?.({x:h.x,y:h.y,target:o,keyboard:Boolean(s.keyboard)}),!0}close(e="api",t=!0){if(!this.isOpen)return;this.clearHover();for(let a of this.stack)a.element.remove();this.stack=[],this.hideLayer(),this.stopListeningWhileOpen();let s=this.returnFocus;if(this.returnFocus=null,this.target=null,t&&e!=="outside"&&e!=="blur"&&s&&s.isConnected)s.focus({preventScroll:!0});this.callbacks.onClose?.({reason:e})}destroy(){this.close("api",!1);for(let e of this.disposers)e();this.layer.remove(),this.root.removeAttribute("data-menu-ready")}listen(e,t,s,a){e.addEventListener(t,s,a);let o=()=>e.removeEventListener(t,s,a);return this.disposers.push(o),o}whileOpen=[];listenWhileOpen(){let e=(s,a,o,n)=>{s.addEventListener(a,o,n),this.whileOpen.push(()=>s.removeEventListener(a,o,n))},t=(s)=>{if(!(s.target instanceof Node)||!this.layer.contains(s.target))this.close("outside")};e(document,"pointerdown",t,{capture:!0}),e(document,"scroll",t,{capture:!0,passive:!0}),e(window,"resize",()=>this.close("blur")),e(window,"blur",()=>this.close("blur"))}stopListeningWhileOpen(){for(let e of this.whileOpen)e();this.whileOpen=[]}showLayer(){if(this.layer.hasAttribute("popover"))try{this.layer.showPopover()}catch{}else this.layer.hidden=!1}hideLayer(){if(this.layer.hasAttribute("popover"))try{this.layer.hidePopover()}catch{}else this.layer.hidden=!0}position(e,t){e.style.left=`${Math.round(t.x)}px`,e.style.top=`${Math.round(t.y)}px`}buildMenu(e,t){let s=document.createElement("div");if(s.className="stx-menu",s.setAttribute("role","menu"),s.setAttribute("tabindex","-1"),s.setAttribute("data-menu-depth",String(this.stack.length)),t)s.setAttribute("aria-labelledby",t.id);else s.setAttribute("aria-label",this.label);e.forEach((o,n)=>{if(o.separator){let l=document.createElement("div");l.className="stx-menu-separator",l.setAttribute("role","separator"),s.appendChild(l);return}let i=document.createElement("div");if(i.className="stx-menu-item",i.id=`${this.uid}-${o.path.join("-")}`,i.setAttribute("role",typeof o.checked==="boolean"?"menuitemcheckbox":"menuitem"),i.setAttribute("tabindex","-1"),i.setAttribute("data-menu-index",String(n)),i.setAttribute("data-menu-id",o.id),typeof o.checked==="boolean")i.setAttribute("aria-checked",String(o.checked));if(o.disabled)i.setAttribute("aria-disabled","true");if(o.danger)i.setAttribute("data-danger","");let r=document.createElement("span");r.className="stx-menu-check",r.setAttribute("aria-hidden","true"),r.textContent=o.checked===!0?"\u2713":"",i.appendChild(r);let c=document.createElement("span");if(c.className="stx-menu-label",c.textContent=o.label||"",i.appendChild(c),be(o)){i.setAttribute("aria-haspopup","menu"),i.setAttribute("aria-expanded","false");let l=document.createElement("span");l.className="stx-menu-arrow",l.setAttribute("aria-hidden","true"),l.textContent="\u203A",i.appendChild(l)}else if(o.shortcut){i.setAttribute("aria-keyshortcuts",ls(o.shortcut,this.apple));let l=document.createElement("span");l.className="stx-menu-shortcut",l.setAttribute("aria-hidden","true"),l.textContent=rs(o.shortcut,this.apple),i.appendChild(l)}s.appendChild(i)}),this.layer.appendChild(s);let a={element:s,items:e,opener:t};return this.stack.push(a),a}menuOf(e){if(!(e instanceof Element))return null;let t=e.closest(".stx-menu");return this.stack.find((s)=>s.element===t)??null}rowAt(e,t){return t<0?null:e.element.querySelector(`:scope > [data-menu-index="${t}"]`)}activeIndex(e){let t=document.activeElement;if(!(t instanceof HTMLElement)||t.parentElement!==e.element)return-1;let s=Number(t.getAttribute("data-menu-index"));return Number.isInteger(s)?s:-1}focusItem(e,t){let s=this.rowAt(e,t);if(s)s.focus({preventScroll:!1});else e.element.focus({preventScroll:!0})}closeBelow(e){let t=this.stack.indexOf(e);for(let s of this.stack.splice(t+1))s.opener?.setAttribute("aria-expanded","false"),s.element.remove()}openSubmenu(e,t,s){let a=e.items[t],o=this.rowAt(e,t);if(!o||!be(a)||a.disabled)return;let n=this.stack[this.stack.indexOf(e)+1];if(n&&n.opener===o){if(s)this.focusItem(n,Te(n.items));return}this.closeBelow(e),o.setAttribute("aria-expanded","true");let i=this.buildMenu(a.children,o),r=ns(cs(o),i.element.getBoundingClientRect(),{width:window.innerWidth,height:window.innerHeight});if(i.element.setAttribute("data-side",r.side),this.position(i.element,r),s)this.focusItem(i,Te(i.items))}choose(e,t){let s=e.items[t];if(!es(s))return;if(be(s)){this.openSubmenu(e,t,!0);return}let{children:a,path:o,id:n,...i}=s,r={item:{...i,id:n},id:n,path:[...o],target:this.target};this.close("select"),this.callbacks.onSelect?.(r)}clearHover(){if(this.hoverTimer)clearTimeout(this.hoverTimer);this.hoverTimer=null}onContextMenu(e){if(this.disabled||this.layer.contains(e.target))return;let t=e.target instanceof Element?e.target:null;if(e.button!==2&&e.detail===0&&e.clientX===0&&e.clientY===0&&t?this.open(t,null,{keyboard:!0,target:t}):this.open({x:e.clientX,y:e.clientY},null,{target:t}))e.preventDefault()}onHostKeyDown(e){if(this.disabled||this.isOpen||this.layer.contains(e.target))return;if(e.key!=="ContextMenu"&&!(e.key==="F10"&&e.shiftKey))return;let t=e.target instanceof Element?e.target:null;if(t&&this.open(t,null,{keyboard:!0,target:t}))e.preventDefault()}onMenuClick(e){let t=this.menuOf(e.target),s=e.target instanceof Element?e.target.closest(".stx-menu-item"):null;if(!t||!s)return;this.choose(t,Number(s.getAttribute("data-menu-index")))}onMenuPointerMove(e){let t=this.menuOf(e.target),s=e.target instanceof Element?e.target.closest(".stx-menu-item"):null;if(!t||!s||document.activeElement===s)return;let a=Number(s.getAttribute("data-menu-index"));s.focus({preventScroll:!0}),this.clearHover(),this.hoverTimer=setTimeout(()=>{if(document.activeElement!==s)return;if(be(t.items[a]))this.openSubmenu(t,a,!1);else this.closeBelow(t)},$n)}onMenuKeyDown(e){let t=this.menuOf(e.target)??this.stack[this.stack.length-1];if(!t)return;let s=this.activeIndex(t),a=this.stack.indexOf(t),o=!0;switch(e.key){case"ArrowDown":this.focusItem(t,$e(t.items,s,1));break;case"ArrowUp":this.focusItem(t,$e(t.items,s,-1));break;case"Home":case"PageUp":this.focusItem(t,Te(t.items));break;case"End":case"PageDown":this.focusItem(t,ts(t.items));break;case"ArrowRight":if(be(t.items[s]))this.openSubmenu(t,s,!0);break;case"ArrowLeft":if(a>0)this.closeSubmenu(t);break;case"Escape":if(a>0)this.closeSubmenu(t);else this.close("escape");break;case"Enter":case" ":if(s>=0)this.choose(t,s);break;case"Tab":this.close("tab"),o=!1;break;default:o=this.typeAhead(t,s,e)}if(o)e.preventDefault(),e.stopPropagation()}closeSubmenu(e){let t=e.opener,s=this.stack[this.stack.indexOf(e)-1];if(s)this.closeBelow(s);t?.focus({preventScroll:!0})}typeAhead(e,t,s){if(s.key.length!==1||s.metaKey||s.ctrlKey||s.altKey)return!1;let a=Date.now();this.typed=a-this.typedAt>Tn?s.key:this.typed+s.key,this.typedAt=a;let o=ss(e.items,t,this.typed);if(o>=0)this.focusItem(e,o);return!0}}function cs(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}var Nf=48,Rf=2000,Lf=420,Of=160,Pn=/^-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,Mn=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/;function Ie(e,t){let s=new WeakSet,a=JSON.stringify(e,(o,n)=>{if(typeof n==="bigint")return n.toString();if(typeof n==="object"&&n!==null){if(s.has(n))return"[Circular]";s.add(n)}return n},t);return a===void 0?"null":a}function oe(e,t){if(t.accessor)return t.accessor(e);return e==null?void 0:e[t.key]}function Nn(e){let t=0,s=0,a=0,o=0,n=0;for(let i of e){if(i===null||i===void 0||i==="")continue;if(t++,typeof i==="number"||typeof i==="bigint")s++;else if(typeof i==="boolean")o++;else if(i instanceof Date)a++;else if(typeof i==="object")n++;else if(typeof i==="string"){let r=i.trim();if(Pn.test(r))s++;else if(Mn.test(r)&&!Number.isNaN(Date.parse(r)))a++}}if(t===0)return"string";if(s===t)return"number";if(a===t)return"date";if(o===t)return"boolean";if(n===t)return"json";return"string"}function Rn(e,t=200){let s=[],a=new Set,o=Math.min(e.length,t);for(let n=0;n<o;n++){let i=e[n];if(i===null||typeof i!=="object")continue;if(Array.isArray(i)){for(let r=0;r<i.length;r++){let c=String(r);if(!a.has(c))a.add(c),s.push(c)}continue}for(let r in i)if(!a.has(r))a.add(r),s.push(r)}if(s.length>0&&s.every((n)=>/^\d+$/.test(n)))s.sort((n,i)=>Number(n)-Number(i));return s.map((n)=>({key:n}))}function hs(e){if(e===null)return"null";return e===void 0?"undefined":"value"}function Ee(e,t="string"){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e==="string")return e;if(typeof e==="number"||typeof e==="boolean"||typeof e==="bigint")return String(e);if(e instanceof Date)return Number.isNaN(e.getTime())?"Invalid Date":e.toISOString();if(typeof e==="object"||t==="json"){let s=Ie(e);return s.length>160?`${s.slice(0,160)}...`:s}return String(e)}function us(e){return Ie(e)}function fs(e,t){let s={};for(let a of t){let o=oe(e,a);s[a.key]=o===void 0?null:o}return s}function ms(e,t){return Ie(fs(e,t),2)}function Ln(e,t){return Ie(e.map((s)=>fs(s,t)),2)}function ds(e){if(e===null||e===void 0)return"";let t;if(typeof e==="string")t=e;else if(e instanceof Date)t=Number.isNaN(e.getTime())?"":e.toISOString();else if(typeof e==="object")t=Ie(e);else t=String(e);if(/[",\r\n]/.test(t)||t!==t.trim())return`"${t.replace(/"/g,'""')}"`;return t}function On(e,t){let s=Array.from({length:e.length+1});s[0]=t.map((o)=>ds(o.label??o.key)).join(",");let a=t.length;for(let o=0;o<e.length;o++){let n=e[o],i="";for(let r=0;r<a;r++){if(r>0)i+=",";i+=ds(oe(n,t[r]))}s[o+1]=i}return`${s.join(`\r
12
12
  `)}\r
13
- `}function gs(e,t,s,a,o=0){if(a<=0||s<=0)return{start:0,end:0};let n=Math.floor(Math.max(0,e)/s),i=Math.ceil((Math.max(0,e)+Math.max(0,t))/s),r=Math.min(a,Math.max(0,n-o));return{start:r,end:Math.max(r,Math.min(a,i+o))}}function xs(e,t,s){let a=s.rows-1,o=Math.max(0,s.columns-1),n=Math.max(1,s.page),{row:i,column:r}=e;switch(t){case"ArrowUp":i=Math.max(-1,i-1);break;case"ArrowDown":i=Math.min(a,i+1);break;case"ArrowLeft":r-=1;break;case"ArrowRight":r+=1;break;case"PageUp":i=i<=0?i:Math.max(0,i-n);break;case"PageDown":i=Math.min(a,Math.max(0,i)+(i<0?0:n));break;case"Home":if(r=0,s.mod)i=Math.min(0,a);break;case"End":if(r=o,s.mod)i=a;break;default:return e}return{row:Math.max(-1,Math.min(a,i)),column:Math.max(0,Math.min(o,r))}}function Dn(e,t,s=!1){let a=e.find((n)=>n.key===t),o=!a?{key:t,direction:"asc"}:a.direction==="asc"?{key:t,direction:"desc"}:null;if(!s)return o?[o]:[];if(!a)return[...e,o];return o?e.map((n)=>n.key===t?o:n):e.filter((n)=>n.key!==t)}var ps=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});class vt{rows=[];columns=[];view=new Uint32Array(0);sort=[];filter="";selected=new Set;given=null;filtered=new Uint32Array(0);searchText=null;sortKeys=new Map;offsets=new Float64Array(1);anchor=-1;charWidth;cellPadding;constructor(e=[],t=null,s={}){this.charWidth=s.charWidth??7.25,this.cellPadding=s.cellPadding??24,this.given=t&&t.length>0?[...t]:null,this.setRows(e)}get count(){return this.view.length}get totalWidth(){return this.offsets[this.columns.length]}setRows(e){this.rows=Array.isArray(e)?e:[],this.selected.clear(),this.anchor=-1,this.forget(),this.resolveColumns(),this.refilter()}setColumns(e){this.given=e&&e.length>0?[...e]:null,this.forget(),this.resolveColumns(),this.sort=this.sort.filter((t)=>this.columns.some((s)=>s.key===t.key)),this.refilter()}setFilter(e){return this.filter=e==null?"":String(e),this.refilter(),this.count}setSort(e){this.sort=(e??[]).filter((t)=>t&&(t.direction==="asc"||t.direction==="desc")&&this.columns.some((s)=>s.key===t.key)),this.resort()}toggleSort(e,t=!1){let s=this.columns.find((a)=>a.key===e);if(!s||!s.sortable)return this.sort;return this.sort=Dn(this.sort,e,t),this.resort(),this.sort}sortOf(e){let t=this.sort.findIndex((s)=>s.key===e);return t<0?null:{direction:this.sort[t].direction,priority:t+1}}rowAt(e){return e>=0&&e<this.view.length?this.rows[this.view[e]]:void 0}valueAt(e,t){let s=this.columns[t],a=this.rowAt(e);return s&&a!==void 0?oe(a,s):void 0}viewRows(){let e=Array.from({length:this.view.length});for(let t=0;t<e.length;t++)e[t]=this.rows[this.view[t]];return e}toCsv(){return On(this.viewRows(),this.columns)}toJson(){return Ln(this.viewRows(),this.columns)}select(e,t="replace"){if(e<0||e>=this.view.length)return;let s=this.view[e];if(t==="range"&&this.anchor>=0){let a=Math.min(this.anchor,e),o=Math.max(this.anchor,e);this.selected.clear();for(let n=a;n<=o&&n<this.view.length;n++)this.selected.add(this.view[n]);return}if(t==="toggle")if(this.selected.has(s))this.selected.delete(s);else this.selected.add(s);else this.selected.clear(),this.selected.add(s);this.anchor=e}selectAll(){this.selected.clear();for(let e=0;e<this.view.length;e++)this.selected.add(this.view[e])}clearSelection(){this.selected.clear(),this.anchor=-1}isSelected(e){return e>=0&&e<this.view.length&&this.selected.has(this.view[e])}selectedIndices(){return[...this.selected].sort((e,t)=>e-t)}selectedRows(){return this.selectedIndices().map((e)=>this.rows[e])}offsetOf(e){return this.offsets[Math.max(0,Math.min(this.columns.length,e))]}columnAt(e){let t=this.columns.length;if(t===0)return-1;let s=0,a=t-1;while(s<a){let o=s+a+1>>1;if(this.offsets[o]<=e)s=o;else a=o-1}return s}columnRange(e,t,s=0){let a=this.columns.length;if(a===0)return{start:0,end:0};let o=this.columnAt(Math.max(0,e)),n=this.columnAt(Math.max(0,e)+Math.max(0,t));return{start:Math.max(0,o-s),end:Math.min(a,n+1+s)}}resizeColumn(e,t){let s=this.columns[e];if(!s)return 0;return s.width=Math.round(Math.max(s.minWidth,Math.min(s.maxWidth,t))),this.measure(),s.width}autoWidth(e,t=200){let s=this.columns[e];if(!s)return 0;let a=s.label.length+3,o=Math.min(this.view.length,t);for(let i=0;i<o;i++){let r=Ee(oe(this.rows[this.view[i]],s),s.type).length;if(r>a)a=r}let n=Math.ceil(a*this.charWidth+this.cellPadding);return Math.max(s.minWidth,Math.min(s.maxWidth,420,n))}forget(){this.searchText=null,this.sortKeys.clear()}resolveColumns(){let e=this.given??Rn(this.rows),t=Math.min(this.rows.length,200),s=this.view;this.view=new Uint32Array(t);for(let a=0;a<t;a++)this.view[a]=a;this.columns=e.map((a)=>{let o=a.type;if(!o){let n=[];for(let i=0;i<t;i++)n.push(oe(this.rows[i],a));o=Nn(n)}return{...a,label:a.label??a.key,type:o,width:a.width??0,minWidth:a.minWidth??48,maxWidth:a.maxWidth??2000,align:a.align??(o==="number"?"right":"left"),sortable:a.sortable!==!1}}),this.columns.forEach((a,o)=>{if(!a.width)a.width=this.autoWidth(o);a.width=Math.max(a.minWidth,Math.min(a.maxWidth,a.width))}),this.view=s,this.measure()}measure(){let e=new Float64Array(this.columns.length+1);for(let t=0;t<this.columns.length;t++)e[t+1]=e[t]+this.columns[t].width;this.offsets=e}searchable(){if(this.searchText)return this.searchText;let e=this.rows,t=this.columns,s=Array.from({length:e.length});for(let a=0;a<e.length;a++){let o=e[a],n="";for(let i=0;i<t.length;i++){let r=oe(o,t[i]);if(r===null||r===void 0)continue;n+=typeof r==="string"?r:Ee(r,t[i].type),n+="\x01"}s[a]=n.toLowerCase()}return this.searchText=s,s}refilter(){let e=this.rows.length,t=this.filter.toLowerCase().split(/\s+/).filter(Boolean);if(t.length===0){let s=new Uint32Array(e);for(let a=0;a<e;a++)s[a]=a;this.filtered=s}else{let s=this.searchable(),a=new Uint32Array(e),o=0,n=t.length===1?t[0]:null;for(let i=0;i<e;i++){let r=s[i];if(n!==null){if(r.includes(n))a[o++]=i;continue}let c=!0;for(let l=0;l<t.length;l++)if(!r.includes(t[l])){c=!1;break}if(c)a[o++]=i}this.filtered=a.slice(0,o)}this.anchor=-1,this.resort()}keysFor(e){let t=this.sortKeys.get(e.key);if(t)return t;let s=this.rows,a=new Float64Array(s.length);if(e.type==="number"||e.type==="date"||e.type==="boolean")for(let o=0;o<s.length;o++){let n=oe(s[o],e),i=Number.NaN;if(n===null||n===void 0||n==="")i=Number.NaN;else if(typeof n==="number")i=n;else if(typeof n==="boolean")i=n?1:0;else if(n instanceof Date)i=n.getTime();else if(e.type==="date")i=Date.parse(String(n));else if(e.type==="boolean")i=String(n).toLowerCase()==="true"?1:0;else i=Number(n);a[o]=i}else{let o=Array.from({length:s.length}),n=new Map;for(let c=0;c<s.length;c++){let l=oe(s[c],e);if(l===null||l===void 0){o[c]=null;continue}let d=typeof l==="string"?l:Ee(l,e.type);if(o[c]=d,!n.has(d))n.set(d,0)}let i=[...n.keys()].sort(ps.compare),r=0;for(let c=0;c<i.length;c++){if(c>0&&ps.compare(i[c-1],i[c])!==0)r++;n.set(i[c],r)}for(let c=0;c<s.length;c++){let l=o[c];a[c]=l===null?Number.NaN:n.get(l)}}return this.sortKeys.set(e.key,a),a}resort(){let e=[];for(let s of this.sort){let a=this.columns.find((o)=>o.key===s.key);if(a)e.push({keys:this.keysFor(a),sign:s.direction==="desc"?-1:1})}let t=this.filtered.slice();if(e.length===1){let{keys:s,sign:a}=e[0];t.sort((o,n)=>{let i=s[o],r=s[n];if(i<r)return-a;if(i>r)return a;if(i===r)return o-n;let c=i!==i;return c===(r!==r)?o-n:c?1:-1})}else if(e.length>1)t.sort((s,a)=>{for(let o=0;o<e.length;o++){let n=e[o].keys[s],i=e[o].keys[a];if(n<i)return-e[o].sign;if(n>i)return e[o].sign;if(n===i)continue;let r=n!==n;if(r!==(i!==i))return r?1:-1}return s-a});this.view=t}}var Hn="./DataGrid-7rt7v865.stx";var Vn=120,Fe=new Intl.NumberFormat("en-US");function re(e,t){return e.querySelector(`[data-dg="${t}"]`)}function jn(e){let t=()=>{let s=document.createElement("textarea");s.value=e,s.setAttribute("aria-hidden","true"),s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(s);let a=document.activeElement;s.select();try{document.execCommand("copy")}catch{}s.remove(),a?.focus({preventScroll:!0})};if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText==="function")navigator.clipboard.writeText(e).catch(t);else t()}class Fn{root;callbacks;model;scroller;content;header;body;status;filterInput;prefix;rowHeight;headerHeight;overscan;columnOverscan;selectable;resizeStep;fileName;contextMenu;slots=new Map;pool=[];headerCells=[];rows={start:0,end:0};cols={start:0,end:0};stale=!0;active={row:0,column:0};activeEl=null;filterTimer=null;resize=null;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;let a=re(e,"scroller"),o=re(e,"content"),n=re(e,"header"),i=re(e,"body");if(!a||!o||!n||!i)throw Error("DataGridView: the root is missing its scroller, content, header or body");if(this.scroller=a,this.content=o,this.header=n,this.body=i,this.status=re(e,"status"),this.filterInput=re(e,"filter"),this.prefix=a.id||`data-grid-${Math.random().toString(36).slice(2,8)}`,this.rowHeight=Math.max(8,t.rowHeight??28),this.headerHeight=Math.max(8,t.headerHeight??32),this.overscan=t.overscan??6,this.columnOverscan=t.columnOverscan??2,this.selectable=t.selectable!==!1,this.resizeStep=t.resizeStep??16,this.fileName=t.fileName||"data",this.contextMenu=Boolean(t.contextMenu),this.header.__stx_inert_content=!0,this.body.__stx_inert_content=!0,e.style.setProperty("--stx-grid-row-height",`${this.rowHeight}px`),e.style.setProperty("--stx-grid-header-height",`${this.headerHeight}px`),this.model=new vt(t.rows??[],t.columns??null),t.filter){if(this.model.setFilter(t.filter),this.filterInput)this.filterInput.value=t.filter}if(this.listen(this.scroller,"scroll",()=>this.render()),this.listen(this.scroller,"keydown",(l)=>this.onKeyDown(l)),this.listen(this.body,"click",(l)=>this.onBodyClick(l)),this.listen(this.body,"dblclick",(l)=>this.onBodyDoubleClick(l)),this.listen(this.body,"contextmenu",(l)=>this.onContextMenu(l)),this.listen(this.header,"click",(l)=>this.onHeaderClick(l)),this.listen(this.header,"dblclick",(l)=>this.onHeaderDoubleClick(l)),this.listen(this.header,"pointerdown",(l)=>this.onResizeStart(l)),this.listen(this.header,"pointermove",(l)=>this.onResizeMove(l)),this.listen(this.header,"pointerup",(l)=>this.onResizeEnd(l)),this.listen(this.header,"pointercancel",(l)=>this.onResizeEnd(l)),this.filterInput)this.listen(this.filterInput,"input",()=>this.onFilterInput());let r=re(e,"export-csv"),c=re(e,"export-json");if(r)this.listen(r,"click",()=>this.download("csv"));if(c)this.listen(c,"click",()=>this.download("json"));if(typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.render()),this.observer.observe(this.scroller);this.refresh(),e.setAttribute("data-dg-ready","")}setRows(e){this.model.setRows(e),this.active={row:Math.min(0,this.model.count-1),column:Math.min(this.active.column,Math.max(0,this.model.columns.length-1))},this.scroller.scrollTop=0,this.refresh()}setColumns(e){this.model.setColumns(e),this.active={row:this.active.row,column:Math.min(this.active.column,Math.max(0,this.model.columns.length-1))},this.refresh()}setFilter(e){let t=e==null?"":String(e);if(this.filterInput&&this.filterInput.value!==t)this.filterInput.value=t;this.applyFilter(t)}setSort(e){this.model.setSort(e),this.refresh()}setFileName(e){this.fileName=e||"data"}getView(){return this.model.viewRows()}getSelection(){let e=this.model.selectedIndices();return{rows:e.map((t)=>this.model.rows[t]),indices:e}}clearSelection(){this.model.clearSelection(),this.paintSelection(),this.reportSelection()}exportCsv(){return this.model.toCsv()}exportJson(){return this.model.toJson()}download(e){let t=e==="json"?this.model.toJson():this.model.toCsv(),s=new Blob([t],{type:e==="json"?"application/json":"text/csv;charset=utf-8"}),a=URL.createObjectURL(s),o=document.createElement("a");return o.href=a,o.download=`${this.fileName}.${e}`,o.style.display="none",this.root.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(a),1000),this.callbacks.onExport?.({format:e,text:t,rows:this.model.count}),t}scrollToRow(e){let t=Math.max(0,Math.min(this.model.count-1,e));this.revealRow(t),this.render()}focus(){this.scroller.focus({preventScroll:!0})}getActiveCell(){return{...this.active}}setActiveCell(e,t){this.moveTo({row:e,column:t},!1)}destroy(){if(this.observer?.disconnect(),this.filterTimer)clearTimeout(this.filterTimer);for(let e of this.disposers)e();this.header.replaceChildren(),this.body.replaceChildren(),this.slots.clear(),this.pool.length=0,this.root.removeAttribute("data-dg-ready")}refresh(){let e=this.model;this.content.style.width=`${e.totalWidth}px`,this.content.style.height=`${this.headerHeight+e.count*this.rowHeight}px`,this.header.style.width=`${e.totalWidth}px`,this.body.style.height=`${e.count*this.rowHeight}px`,this.scroller.setAttribute("aria-rowcount",String(e.count+1)),this.scroller.setAttribute("aria-colcount",String(e.columns.length)),this.root.toggleAttribute("data-empty",e.count===0),this.stale=!0,this.render(),this.paintStatus()}render(){let e=this.model,t=this.scroller,s=gs(t.scrollTop,Math.max(0,t.clientHeight-this.headerHeight),this.rowHeight,e.count,this.overscan),a=e.columnRange(t.scrollLeft,t.clientWidth,this.columnOverscan),o=this.stale||a.start!==this.cols.start||a.end!==this.cols.end;if(!o&&s.start===this.rows.start&&s.end===this.rows.end)return;if(this.rows=s,this.cols=a,o)this.renderHeader();for(let[n,i]of this.slots)if(n<s.start||n>=s.end)this.slots.delete(n),i.index=-1,i.el.style.display="none",this.pool.push(i);for(let n=s.start;n<s.end;n++){let i=this.slots.get(n);if(i){if(o)this.fill(i);continue}i=this.pool.pop()??this.createSlot(),i.index=n,i.el.style.display="",this.slots.set(n,i),this.fill(i)}this.stale=!1,this.paintActive()}createSlot(){let e=document.createElement("div");return e.className="stx-dg-row",e.setAttribute("role","row"),this.body.appendChild(e),{el:e,index:-1,cells:[]}}fill(e){let t=this.model,s=e.index,a=t.rowAt(s),o=this.selectable&&t.isSelected(s),n=e.el;if(n.__dgRow=s,n.style.transform=`translateY(${s*this.rowHeight}px)`,n.setAttribute("aria-rowindex",String(s+2)),this.selectable)n.setAttribute("aria-selected",o?"true":"false");let i=this.cols.end-this.cols.start;while(e.cells.length<i){let r=document.createElement("div");r.className="stx-dg-cell",r.setAttribute("role","gridcell"),r.appendChild(document.createTextNode("")),n.appendChild(r),e.cells.push(r)}while(e.cells.length>i)e.cells.pop().remove();for(let r=0;r<i;r++){let c=this.cols.start+r,l=t.columns[c],d=e.cells[r],h=a===void 0?void 0:oe(a,l),p=hs(h);if(d.__dgColumn=c,d.id=`${this.prefix}-r${s}-c${c}`,d.style.left=`${t.offsetOf(c)}px`,d.style.width=`${l.width}px`,d.setAttribute("aria-colindex",String(c+1)),d.setAttribute("data-type",l.type),d.setAttribute("data-align",l.align),p==="value")d.removeAttribute("data-empty");else d.setAttribute("data-empty",p);if(this.selectable)d.setAttribute("aria-selected",o?"true":"false");d.firstChild.data=typeof h==="string"?h:Ee(h,l.type)}}renderHeader(){let e=this.model,t=this.cols.end-this.cols.start;while(this.headerCells.length<t){let s=document.createElement("div");s.className="stx-dg-head",s.setAttribute("role","columnheader");let a=document.createElement("span");a.className="stx-dg-head-label",a.appendChild(document.createTextNode(""));let o=document.createElement("span");o.className="stx-dg-sort",o.setAttribute("aria-hidden","true"),o.appendChild(document.createTextNode(""));let n=document.createElement("span");n.className="stx-dg-resize",n.setAttribute("aria-hidden","true"),s.append(a,o,n),this.header.appendChild(s),this.headerCells.push(s)}while(this.headerCells.length>t)this.headerCells.pop().remove();for(let s=0;s<t;s++){let a=this.cols.start+s,o=e.columns[a],n=this.headerCells[s],i=e.sortOf(o.key);if(n.__dgColumn=a,n.id=`${this.prefix}-h-c${a}`,n.style.left=`${e.offsetOf(a)}px`,n.style.width=`${o.width}px`,n.setAttribute("aria-colindex",String(a+1)),n.setAttribute("data-align",o.align),n.toggleAttribute("data-sortable",o.sortable),o.sortable)n.setAttribute("aria-sort",i?i.direction==="asc"?"ascending":"descending":"none");else n.removeAttribute("aria-sort");n.children[0].firstChild.data=o.label,n.children[1].firstChild.data=i?`${i.direction==="asc"?"\u25B2":"\u25BC"}${e.sort.length>1?i.priority:""}`:""}}cellElement(e){if(e.column<this.cols.start||e.column>=this.cols.end)return null;let t=e.column-this.cols.start;if(e.row<0)return this.headerCells[t]??null;return this.slots.get(e.row)?.cells[t]??null}paintActive(){let e=this.cellElement(this.active);if(this.activeEl&&this.activeEl!==e)this.activeEl.removeAttribute("data-active");if(this.activeEl=e,e)e.setAttribute("data-active",""),this.scroller.setAttribute("aria-activedescendant",e.id);else this.scroller.removeAttribute("aria-activedescendant")}paintSelection(){if(!this.selectable)return;for(let[e,t]of this.slots){let s=this.model.isSelected(e)?"true":"false";t.el.setAttribute("aria-selected",s);for(let a of t.cells)a.setAttribute("aria-selected",s)}this.paintStatus()}paintStatus(){if(!this.status)return;let e=this.model,t=e.rows.length,s=e.count===t?`${Fe.format(t)} ${t===1?"row":"rows"}`:`${Fe.format(e.count)} of ${Fe.format(t)} rows`;if(e.selected.size>0)s+=`, ${Fe.format(e.selected.size)} selected`;if(this.status.textContent!==s)this.status.textContent=s}revealRow(e){let t=this.scroller,s=e*this.rowHeight,a=t.clientHeight-this.headerHeight;if(s<t.scrollTop)t.scrollTop=s;else if(s+this.rowHeight>t.scrollTop+a)t.scrollTop=s+this.rowHeight-a}revealColumn(e){let t=this.scroller,s=this.model.offsetOf(e),a=this.model.offsetOf(e+1);if(s<t.scrollLeft)t.scrollLeft=s;else if(a>t.scrollLeft+t.clientWidth)t.scrollLeft=Math.min(s,a-t.clientWidth)}detail(e){return{row:this.model.rowAt(e.row),rowIndex:e.row,column:this.model.columns[e.column],value:e.row<0?void 0:this.model.valueAt(e.row,e.column)}}moveTo(e,t=!0){let s=this.model,a={row:Math.max(-1,Math.min(s.count-1,e.row)),column:Math.max(0,Math.min(s.columns.length-1,e.column))};if(this.active=a,a.row>=0)this.revealRow(a.row);if(this.revealColumn(a.column),this.render(),this.paintActive(),t)this.callbacks.onCell?.(this.detail(a))}reportSelection(){this.callbacks.onSelect?.(this.getSelection())}applyFilter(e){let t=this.model.setFilter(e);this.active={row:Math.min(0,t-1),column:this.active.column},this.scroller.scrollTop=0,this.refresh(),this.callbacks.onFilter?.({text:e,count:t})}sortBy(e,t){let s=this.model.columns[e];if(!s||!s.sortable)return;let a=this.model.toggleSort(s.key,t);this.refresh(),this.callbacks.onSort?.([...a])}setColumnWidth(e,t){this.model.resizeColumn(e,t),this.content.style.width=`${this.model.totalWidth}px`,this.header.style.width=`${this.model.totalWidth}px`,this.stale=!0,this.render()}copy(e){if(this.active.row<0)return;let t=this.model.rowAt(this.active.row);if(t===void 0)return;let s=e==="row"?ms(t,this.model.columns):us(this.model.valueAt(this.active.row,this.active.column));jn(s),this.callbacks.onCopy?.({what:e,text:s})}listen(e,t,s){e.addEventListener(t,s),this.disposers.push(()=>e.removeEventListener(t,s))}cellFrom(e){let s=e.target?.closest(".stx-dg-cell"),a=s?.parentElement;if(!s||!a||s.__dgColumn===void 0||a.__dgRow===void 0)return null;return{row:a.__dgRow,column:s.__dgColumn}}headFrom(e){let t=e.target,s=t?.closest(".stx-dg-head");if(!s||s.__dgColumn===void 0)return null;let a=t.closest(".stx-dg-resize");return{column:s.__dgColumn,onHandle:Boolean(a),handle:a}}onBodyClick(e){let t=this.cellFrom(e);if(!t)return;if(this.selectable)this.model.select(t.row,e.shiftKey?"range":e.metaKey||e.ctrlKey?"toggle":"replace"),this.paintSelection(),this.reportSelection();this.moveTo(t)}onBodyDoubleClick(e){let t=this.cellFrom(e),s=t?this.model.rowAt(t.row):void 0;if(t&&s!==void 0)this.callbacks.onActivate?.({row:s,rowIndex:t.row})}onContextMenu(e){let t=this.cellFrom(e);if(!t)return;if(this.contextMenu)e.preventDefault();this.moveTo(t,!1),this.callbacks.onContext?.({...this.detail(t),x:e.clientX,y:e.clientY})}onHeaderClick(e){let t=this.headFrom(e);if(!t||t.onHandle)return;this.active={row:-1,column:t.column},this.sortBy(t.column,e.shiftKey)}onHeaderDoubleClick(e){let t=this.headFrom(e);if(t&&t.onHandle)this.setColumnWidth(t.column,this.model.autoWidth(t.column))}onResizeStart(e){let t=this.headFrom(e);if(!t||!t.onHandle||!t.handle||e.button!==0)return;e.preventDefault();try{t.handle.setPointerCapture(e.pointerId)}catch{}this.resize={column:t.column,start:e.clientX,width:this.model.columns[t.column].width,pointer:e.pointerId,handle:t.handle},this.root.setAttribute("data-resizing","")}onResizeMove(e){let t=this.resize;if(!t||e.pointerId!==t.pointer)return;this.setColumnWidth(t.column,t.width+e.clientX-t.start)}onResizeEnd(e){let t=this.resize;if(!t||e.pointerId!==t.pointer)return;this.resize=null,this.root.removeAttribute("data-resizing");try{t.handle.releasePointerCapture(e.pointerId)}catch{}}onFilterInput(){if(this.filterTimer)clearTimeout(this.filterTimer);this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.applyFilter(this.filterInput?this.filterInput.value:"")},Vn)}onKeyDown(e){if(e.target!==this.scroller)return;let t=this.model,s=e.metaKey||e.ctrlKey,a=this.active.row<0,o=e.key;if(s&&(o==="a"||o==="A")){if(!this.selectable)return;e.preventDefault(),t.selectAll(),this.paintSelection(),this.reportSelection();return}if(s&&(o==="c"||o==="C")){if(a)return;e.preventDefault(),this.copy(e.shiftKey?"row":"cell");return}if(a&&e.altKey&&(o==="ArrowLeft"||o==="ArrowRight")){e.preventDefault();let r=t.columns[this.active.column];if(r)this.setColumnWidth(this.active.column,r.width+(o==="ArrowRight"?this.resizeStep:-this.resizeStep));this.paintActive();return}if(o==="Enter"||o===" "){if(e.preventDefault(),a){this.sortBy(this.active.column,e.shiftKey);return}if(o===" "){if(!this.selectable)return;t.select(this.active.row,"toggle"),this.paintSelection(),this.reportSelection();return}let r=t.rowAt(this.active.row);if(r!==void 0)this.callbacks.onActivate?.({row:r,rowIndex:this.active.row});return}if(o==="Escape"&&this.selectable&&t.selected.size>0){e.preventDefault(),this.clearSelection();return}let n=Math.max(1,Math.floor((this.scroller.clientHeight-this.headerHeight)/this.rowHeight)-1),i=xs(this.active,o,{rows:t.count,columns:t.columns.length,page:n,mod:s});if(i===this.active)return;if(e.preventDefault(),i.row===this.active.row&&i.column===this.active.column)return;if(e.shiftKey&&this.selectable&&i.row>=0&&i.row!==this.active.row){if(t.selected.size===0&&this.active.row>=0)t.select(this.active.row,"replace");t.select(i.row,"range"),this.paintSelection(),this.reportSelection()}this.moveTo(i)}}var _n="./Dialog-wm7zjqnb.stx";var qn="./DialogBackdrop-de5m5m4w.stx";var Gn="./DialogDescription-yd2jgt2m.stx";var Jn="./DialogPanel-v972ztcc.stx";var Xn="./DialogTitle-nw0pw114.stx";var Qn="./Drawer-d78cdr6d.stx";var ti="./Dropdown-hb8ks69x.stx";var ai="./DropdownButton-wxc25hsy.stx";var ni="./DropdownItem-af0vzc8a.stx";var ri="./DropdownItems-bkz7jkyz.stx";var ci="./Form-cybgg9ym.stx";var di={action:f.string,method:f.oneOf(["GET","POST","PUT","DELETE","PATCH"]),validationSchema:f.object,initialValues:f.object,validateOnChange:f.boolean,validateOnBlur:f.boolean,onSubmit:f.func,onError:f.func,className:f.string},mm=ae("Form",di);var bs=(e)=>Math.round(e*100)/100,Q=(e)=>`${bs(e.x)} ${bs(e.y)}`;function vs(e,t,s){let a=s.x-e.x,o=s.y-e.y;if(a===0&&o===0)return{x:e.x,y:e.y};let n=a===0?Number.POSITIVE_INFINITY:t.width/2/Math.abs(a),i=o===0?Number.POSITIVE_INFINITY:t.height/2/Math.abs(o),r=Math.min(n,i);return{x:e.x+a*r,y:e.y+o*r}}function ws(e,t,s){let a=e.x-t.x,o=e.y-t.y,n=Math.sqrt(a*a+o*o);if(s<=0||n<=s)return e;return{x:e.x-a/n*s,y:e.y-o/n*s}}function pi(e,t,s=0){let a=26+Math.abs(s),o={x:e.x+t.width/4,y:e.y-t.height/2},n={x:e.x+t.width/2,y:e.y-t.height/4},i={x:o.x,y:o.y-a},r={x:n.x+a,y:n.y};return{d:`M ${Q(o)} C ${Q(i)}, ${Q(r)}, ${Q(n)}`,start:o,end:n,label:ys(o,i,r,n,0.5),angle:Math.atan2(n.y-r.y,n.x-r.x)}}function ys(e,t,s,a,o){let n=1-o;return{x:n*n*n*e.x+3*n*n*o*t.x+3*n*o*o*s.x+o*o*o*a.x,y:n*n*n*e.y+3*n*n*o*t.y+3*n*o*o*s.y+o*o*o*a.y}}function ks(e,t={}){let{source:s,sourceSize:a,target:o,targetSize:n}=e,i=t.offset??0,r=t.inset??0;if(s.x===o.x&&s.y===o.y)return pi(s,a,i);if(t.curve==="bezier"){let w=t.direction!=="TB",y=(w?o.x-s.x:o.y-s.y)>=0?1:-1,v=w?{x:s.x+y*a.width/2,y:s.y}:{x:s.x,y:s.y+y*a.height/2},b=w?{x:o.x-y*n.width/2,y:o.y}:{x:o.x,y:o.y-y*n.height/2},C=Math.abs(w?b.x-v.x:b.y-v.y),P=Math.max(C/2,24)*y,T=w?{x:b.x-y*r,y:b.y}:{x:b.x,y:b.y-y*r},V=w?{x:v.x+P,y:v.y+i}:{x:v.x+i,y:v.y+P},j=w?{x:T.x-P,y:T.y+i}:{x:T.x+i,y:T.y-P};return{d:`M ${Q(v)} C ${Q(V)}, ${Q(j)}, ${Q(T)}`,start:v,end:T,label:ys(v,V,j,T,0.5),angle:Math.atan2(T.y-j.y,T.x-j.x)}}let c=vs(s,a,o),l=vs(o,n,s);if(i===0){let w=ws(l,c,r);return{d:`M ${Q(c)} L ${Q(w)}`,start:c,end:w,label:{x:(c.x+w.x)/2,y:(c.y+w.y)/2},angle:Math.atan2(w.y-c.y,w.x-c.x)}}let d=s.x<o.x||s.x===o.x&&s.y<o.y?1:-1,h=(o.x-s.x)*d,p=(o.y-s.y)*d,u=Math.sqrt(h*h+p*p)||1,g={x:(c.x+l.x)/2+-p/u*i*2,y:(c.y+l.y)/2+h/u*i*2},m=ws(l,g,r);return{d:`M ${Q(c)} Q ${Q(g)}, ${Q(m)}`,start:c,end:m,label:{x:0.25*c.x+0.5*g.x+0.25*m.x,y:0.25*c.y+0.5*g.y+0.25*m.y},angle:Math.atan2(m.y-g.y,m.x-g.x)}}function Ss(e,t=14){let s=new Map;for(let o of e){let n=o.source<o.target?`${o.source}\x00${o.target}`:`${o.target}\x00${o.source}`,i=s.get(n);if(i)i.push(o);else s.set(n,[o])}let a=new Map;for(let o of s.values()){if(o.length<2)continue;o.forEach((n,i)=>{let r=(i-(o.length-1)/2)*t;a.set(n.id,n.source===n.target?i*t:r)})}return a}var wt={charWidth:7,paddingX:12,minWidth:48,maxWidth:220,height:32,detailHeight:14};function ne(e){return e.label==null||e.label===""?e.id:String(e.label)}function Cs(e){return e.id!=null&&e.id!==""?String(e.id):`${e.source}->${e.target}${e.label?`:${e.label}`:""}`}function $s(e,t=wt){let s=Math.max(ne(e).length,e.detail?e.detail.length*0.85:0),a=e.expandable===!0?t.charWidth+4:0;return{width:Math.min(t.maxWidth,Math.max(t.minWidth,Math.ceil(s*t.charWidth)+t.paddingX*2+a)),height:t.height+(e.detail?t.detailHeight:0)}}function Ts(e=wt){return Math.floor((e.maxWidth-e.paddingX*2)/e.charWidth)}function Be(e,t){return e.length<=t?e:`${e.slice(0,Math.max(1,t-1))}\u2026`}class _e{metrics;nodeMap=new Map;edgeMap=new Map;incident=new Map;sizes=new Map;constructor(e=[],t=[],s=wt){this.metrics=s;this.merge(e,t)}get nodes(){return[...this.nodeMap.values()]}get edges(){return[...this.edgeMap.values()]}get nodeCount(){return this.nodeMap.size}get edgeCount(){return this.edgeMap.size}has(e){return this.nodeMap.has(e)}node(e){return this.nodeMap.get(e)}edge(e){return this.edgeMap.get(e)}addNode(e){if(!e||e.id==null||e.id==="")return!1;let t=String(e.id);if(this.nodeMap.has(t))return!1;let s={...e,id:t};return this.nodeMap.set(t,s),this.incident.set(t,new Set),this.sizes.set(t,$s(s,this.metrics)),!0}addEdge(e){if(!e)return!1;let t=String(e.source),s=String(e.target);if(!this.nodeMap.has(t)||!this.nodeMap.has(s))return!1;let a=Cs({...e,source:t,target:s});if(this.edgeMap.has(a))return!1;return this.edgeMap.set(a,{...e,id:a,source:t,target:s}),this.incident.get(t).add(a),this.incident.get(s).add(a),!0}updateNode(e,t){let s=this.nodeMap.get(e);if(!s)return!1;let a={...s,...t,id:e};return this.nodeMap.set(e,a),this.sizes.set(e,$s(a,this.metrics)),!0}removeNode(e){if(!this.nodeMap.has(e))return!1;for(let t of[...this.incident.get(e)])this.removeEdge(t);return this.nodeMap.delete(e),this.incident.delete(e),this.sizes.delete(e),!0}removeEdge(e){let t=this.edgeMap.get(e);if(!t)return!1;return this.edgeMap.delete(e),this.incident.get(t.source)?.delete(e),this.incident.get(t.target)?.delete(e),!0}merge(e=[],t=[]){let s={nodes:[],edges:[]};for(let a of e)if(this.addNode(a))s.nodes.push(String(a.id));for(let a of t)if(this.addEdge(a))s.edges.push(Cs({...a,source:String(a.source),target:String(a.target)}));return s}edgesOf(e){let t=this.incident.get(e);return t?[...t].map((s)=>this.edgeMap.get(s)):[]}neighbours(e){let t=new Set;for(let s of this.edgesOf(e)){let a=s.source===e?s.target:s.source;if(a!==e)t.add(a)}return[...t]}degree(e){return this.neighbours(e).length}size(e){return this.sizes.get(e)??{width:this.metrics.minWidth,height:this.metrics.height}}bounds(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:o}=Number;for(let[n,i]of e){if(!this.nodeMap.has(n))continue;let r=this.size(n);t=Math.min(t,i.x-r.width/2),a=Math.max(a,i.x+r.width/2),s=Math.min(s,i.y-r.height/2),o=Math.max(o,i.y+r.height/2)}return Number.isFinite(t)?{x:t,y:s,width:a-t,height:o-s}:null}}function Es(e){let t=e>>>0||1;return()=>{t=t+1831565813>>>0;let s=t;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}var hi=0.15,Is=0.06;function As(e,t={}){let s=e.nodes,a=s.length,o=new Map;if(a===0)return o;let n=t.linkDistance??90,i=t.padding??16,r=Es(t.seed??1),c=t.positions??null,l=new Set(t.pinned??[]),d=new Map(s.map((N,R)=>[N.id,R])),h=new Float64Array(a),p=new Float64Array(a),u=new Float64Array(a),g=new Float64Array(a),m=new Uint8Array(a),w=new Uint8Array(a),y=new Float64Array(a).fill(1),v=0;s.forEach((N,R)=>{let E=e.size(N.id);u[R]=E.width/2,g[R]=E.height/2;let M=c?.get(N.id);if(M&&Number.isFinite(M.x)&&Number.isFinite(M.y))h[R]=M.x,p[R]=M.y,w[R]=1,m[R]=l.has(N.id)?1:0,y[R]=0,v++});let b=n*Math.sqrt(a)*0.6;s.forEach((N,R)=>{if(w[R])return;let E=e.neighbours(N.id).map((k)=>d.get(k)).find((k)=>w[k]),M=r()*Math.PI*2;if(E!==void 0)h[R]=h[E]+Math.cos(M)*n*0.5,p[R]=p[E]+Math.sin(M)*n*0.5;else{let k=Math.sqrt(r())*b;h[R]=Math.cos(M)*k,p[R]=Math.sin(M)*k}});let C=Uint8Array.from(w),P=v>0,T=Math.max(0,t.iterations??(P?80:300)),V=[],j=new Set;for(let N of e.edges){let R=d.get(N.source),E=d.get(N.target);if(R===E)continue;let M=R<E?R*a+E:E*a+R;if(!j.has(M))j.add(M),V.push(R,E)}let F=new Float64Array(a),x=new Float64Array(a),S=n,L=P?S*0.5:S*1.5;for(let N=0;N<T;N++){let R=L*(1-N/T);F.fill(0),x.fill(0);for(let E=0;E<a;E++)for(let M=E+1;M<a;M++){if(C[E]&&C[M])continue;let k=h[E]-h[M],D=p[E]-p[M],O=Math.sqrt(k*k+D*D);if(O<0.01){let K=(E*31+M*17)%360*Math.PI/180;k=Math.cos(K)*0.01,D=Math.sin(K)*0.01,O=0.01}let Y=Math.max(1,O-(u[E]+u[M])*0.5),H=S*S*hi/Y/O;F[E]+=k*H,x[E]+=D*H,F[M]-=k*H,x[M]-=D*H}for(let E=0;E<V.length;E+=2){let M=V[E],k=V[E+1];if(C[M]&&C[k])continue;let D=h[M]-h[k],O=p[M]-p[k],Y=Math.sqrt(D*D+O*O)||0.01,H=(u[M]+u[k])*0.5,K=Math.max(0,Y-H),te=K*K/S/Y;F[M]-=D*te,x[M]-=O*te,F[k]+=D*te,x[k]+=O*te}for(let E=0;E<a;E++){if(m[E])continue;if(!C[E])F[E]-=h[E]*Is,x[E]-=p[E]*Is;let M=Math.sqrt(F[E]*F[E]+x[E]*x[E]);if(M>0){let k=Math.min(M,R)/M*y[E];h[E]+=F[E]*k,p[E]+=x[E]*k}}}return ui(h,p,u,g,m,i),s.forEach((N,R)=>{o.set(N.id,{x:Math.round(h[R]*100)/100,y:Math.round(p[R]*100)/100})}),o}function ui(e,t,s,a,o,n){let i=e.length;for(let r=0;r<40;r++){let c=!1;for(let l=0;l<i;l++)for(let d=l+1;d<i;d++){let h=s[l]+s[d]+n-Math.abs(e[l]-e[d]);if(h<=0)continue;let p=a[l]+a[d]+n-Math.abs(t[l]-t[d]);if(p<=0)continue;if(o[l]&&o[d])continue;c=!0;let u=o[l]?0:o[d]?1:0.5,g=1-u;if(h<p){let m=e[l]<e[d]||e[l]===e[d]&&l<d?-1:1;e[l]+=m*h*u,e[d]-=m*h*g}else{let m=t[l]<t[d]||t[l]===t[d]&&l<d?-1:1;t[l]+=m*p*u,t[d]-=m*p*g}}if(!c)break}}function fi(e){let t=new Set,s=[];for(let o of e.nodes){if(t.has(o.id))continue;let n=[],i=[o.id];t.add(o.id);while(i.length){let r=i.shift();n.push(r);for(let c of e.neighbours(r))if(!t.has(c))t.add(c),i.push(c)}s.push(n)}let a=new Map(e.nodes.map((o,n)=>[o.id,n]));for(let o of s)o.sort((n,i)=>a.get(n)-a.get(i));return s}function mi(e){let t=new Map;for(let o of e.nodes)t.set(o.id,[]);for(let o of e.edges)if(o.source!==o.target)t.get(o.source).push({id:o.id,to:o.target});let s=new Set,a=new Map;for(let o of e.nodes){if(a.has(o.id))continue;let n=[{id:o.id,next:0}];a.set(o.id,1);while(n.length){let i=n[n.length-1],r=t.get(i.id);if(i.next>=r.length){a.set(i.id,2),n.pop();continue}let c=r[i.next++],l=a.get(c.to);if(l===1)s.add(c.id);else if(l===void 0)a.set(c.to,1),n.push({id:c.to,next:0})}}return s}function Ps(e,t){let s=e.map((o)=>[t.get(o.from),t.get(o.to)]).sort((o,n)=>o[0]-n[0]||o[1]-n[1]),a=0;for(let o=0;o<s.length;o++)for(let n=o+1;n<s.length;n++)if(s[o][0]<s[n][0]&&s[o][1]>s[n][1])a++;return a}function Ms(e,t={}){let s=t.direction==="TB"?"TB":"LR",a=t.nodeGap??24,o=t.layerGap??80,n=t.componentGap??48,i=t.sweeps??4,r=s==="LR",c=mi(e),l=[],d=new Set;for(let b of e.edges){if(b.source===b.target)continue;let C=c.has(b.id)?b.target:b.source,P=c.has(b.id)?b.source:b.target,T=`${C}\x00${P}`;if(!d.has(T))d.add(T),l.push({from:C,to:P})}let h=new Map,p=new Map;for(let b of e.nodes)h.set(b.id,[]),p.set(b.id,[]);for(let b of l)h.get(b.from).push(b.to),p.get(b.to).push(b.from);let u=new Map,g=new Map,m=[];for(let b of e.nodes)if(g.set(b.id,p.get(b.id).length),p.get(b.id).length===0)m.push(b.id),u.set(b.id,0);for(let b=0;b<m.length;b++){let C=m[b];for(let P of h.get(C)){u.set(P,Math.max(u.get(P)??0,u.get(C)+1));let T=g.get(P)-1;if(g.set(P,T),T===0)m.push(P)}}let w=new Map,y=[],v=0;for(let b of fi(e)){let C=[];for(let k of b){let D=u.get(k)??0;while(C.length<=D)C.push([]);C[D].push(k)}let P=new Set(b),T=l.filter((k)=>P.has(k.from)&&u.get(k.to)-u.get(k.from)===1),V=new Map,j=()=>{for(let k of C)k.forEach((D,O)=>V.set(D,k.length>1?O/(k.length-1):0.5))},F=(k,D)=>{let O=new Map;k.forEach((H,K)=>{let te=D.get(H),Le=k.length>1?K/(k.length-1):0.5;O.set(H,te.length?te.reduce((pt,Oe)=>pt+V.get(Oe),0)/te.length:Le)});let Y=new Map(k.map((H,K)=>[H,K]));k.sort((H,K)=>O.get(H)-O.get(K)||Y.get(H)-Y.get(K)),k.forEach((H,K)=>V.set(H,k.length>1?K/(k.length-1):0.5))};j();let x=C.map((k)=>[...k]),S=Ps(T,V);for(let k=0;k<i&&S>0;k++){for(let O=1;O<C.length;O++)F(C[O],p);for(let O=C.length-2;O>=0;O--)F(C[O],h);let D=Ps(T,V);if(D<S)S=D,x=C.map((O)=>[...O])}let L=(k)=>r?e.size(k).width:e.size(k).height,N=(k)=>r?e.size(k).height:e.size(k).width,R=x.map((k)=>k.reduce((D,O)=>D+N(O),0)+a*Math.max(0,k.length-1)),E=Math.max(0,...R),M=0;x.forEach((k,D)=>{let O=Math.max(0,...k.map(L)),Y=v+(E-R[D])/2;for(let H of k){let K=Y+N(H)/2;w.set(H,r?{x:M+O/2,y:K}:{x:K,y:M+O/2}),Y+=N(H)+a}M+=O+o}),y.push(x),v+=E+n}return{positions:w,layerOf:u,reversed:c,components:y,bounds:e.bounds(w)}}var gi={x:0,y:0,k:1};function Ns(e,t,s){return Math.min(Math.max(e,t),s)}function Sm(e,t){return{x:t.x*e.k+e.x,y:t.y*e.k+e.y}}function yt(e,t){return{x:(t.x-e.x)/e.k,y:(t.y-e.y)/e.k}}function Ke(e,t,s){return{x:e.x+t,y:e.y+s,k:e.k}}function Rs(e,t,s,a=0.1,o=4){let n=Ns(e.k*s,a,o),i=n/e.k;return{x:t.x-(t.x-e.x)*i,y:t.y-(t.y-e.y)*i,k:n}}function Ls(e,t,s=24,a=0.1,o=1){if(!e||t.width<=0||t.height<=0)return{...gi};let n=Math.max(1,t.width-s*2),i=Math.max(1,t.height-s*2),r=Ns(Math.min(n/Math.max(1,e.width),i/Math.max(1,e.height)),a,o);return{x:t.width/2-(e.x+e.width/2)*r,y:t.height/2-(e.y+e.height/2)*r,k:r}}function Os(e,t,s){return{x:s.width/2-t.x*e.k,y:s.height/2-t.y*e.k,k:e.k}}function Ds(e,t,s,a=16){let o=t.x*e.k+e.x,n=t.y*e.k+e.y,i=o+t.width*e.k,r=n+t.height*e.k,c=0,l=0;if(o<a)c=a-o;else if(i>s.width-a)c=s.width-a-i;if(n<a)l=a-n;else if(r>s.height-a)l=s.height-a-r;return c===0&&l===0?e:Ke(e,c,l)}function zs(e,t,s){let a=e.get(t);if(!a)return null;let o=s==="left"?-1:s==="right"?1:0,n=s==="up"?-1:s==="down"?1:0,i=null,r=Number.POSITIVE_INFINITY;for(let[c,l]of e){if(c===t)continue;let d=l.x-a.x,h=l.y-a.y,p=d*o+h*n;if(p<=0.5)continue;let u=Math.abs(d*n)+Math.abs(h*o);if(u>p*2)continue;let g=p+u*2;if(g<r)r=g,i=c}return i}function Hs(e,t){let s=null,a=Number.POSITIVE_INFINITY;for(let[o,n]of e){let i=(n.x-t.x)**2+(n.y-t.y)**2;if(i<a)a=i,s=o}return s}function Cm(e,t,s){let a=null;for(let[o,n]of t){let i=e.size(o);if(Math.abs(s.x-n.x)<=i.width/2&&Math.abs(s.y-n.y)<=i.height/2)a=o}return a}var bi="./GraphView-0t3t9mec.stx";var vi="http://www.w3.org/2000/svg",Vs=3,js=350,wi=240,yi=6.2;function q(e,t={}){let s=document.createElementNS(vi,e);for(let a in t)s.setAttribute(a,String(t[a]));return s}var ki=0;class Si{root;callbacks;timings={layout:0,render:0};model=new _e;positions=new Map;shown=new Map;pinned=new Set;view={x:0,y:0,k:1};size={width:0,height:0};layoutName;direction;selected=null;autoFit=!0;animate;minZoom;maxZoom;contextMenu;prefix;surface;status;svg;stage;edgeLayer;nodeLayer;labelLayer;nodeEls=new Map;edgeEls=new Map;idOf=new WeakMap;offsets=new Map;serial=0;gesture=null;pinch=null;lastClick={id:"",at:0};lastExpand=0;frame=0;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.prefix=`${e.id||"graph"}-${++ki}`,this.layoutName=t.layout==="force"?"force":"layered",this.direction=t.direction==="TB"?"TB":"LR",this.minZoom=t.minZoom??0.1,this.maxZoom=t.maxZoom??4,this.contextMenu=Boolean(t.contextMenu),this.animate=t.animate!==!1,this.surface=e.querySelector('[data-gv="surface"]')??e,this.status=e.querySelector('[data-gv="status"]'),t.label)this.surface.setAttribute("aria-label",t.label);this.svg=q("svg",{class:"stx-gv-svg","aria-hidden":"false",focusable:"false"}),this.svg.__stx_inert_content=!0;let a=q("defs");for(let o of["arrow","arrow-active"]){let n=q("marker",{id:`${this.prefix}-${o}`,viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",class:`stx-gv-${o}`});n.append(q("path",{d:"M 0 0 L 10 5 L 0 10 z"})),a.append(n)}if(this.stage=q("g",{class:"stx-gv-stage"}),this.edgeLayer=q("g",{class:"stx-gv-edges"}),this.nodeLayer=q("g",{class:"stx-gv-nodes"}),this.labelLayer=q("g",{class:"stx-gv-edge-labels"}),this.stage.append(this.edgeLayer,this.nodeLayer,this.labelLayer),this.svg.append(a,this.stage),this.surface.append(this.svg),this.listen(),this.measure(),this.setGraph(t.nodes??[],t.edges??[]),t.selected)this.select(t.selected,{silent:!0});if(typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>{if(this.measure(),this.autoFit)this.fit()}),this.observer.observe(this.surface);e.setAttribute("data-gv-ready","")}graph(){return this.model}getViewport(){return{...this.view}}getLayout(){return this.layoutName}getSelected(){return this.selected}getPositions(){return Object.fromEntries([...this.positions].map(([e,t])=>[e,{...t}]))}setGraph(e,t){if(this.stop(),this.model=new _e(e??[],t??[]),this.positions=new Map,this.pinned.clear(),this.selected&&!this.model.has(this.selected))this.selected=null;this.layout(!1),this.shown=new Map(this.positions),this.render(),this.autoFit=!0,this.fit(),this.mark()}addNeighbours(e,t,s){let a=this.model.merge(t??[],s??[]);if(a.nodes.length===0&&a.edges.length===0)return a;let o=this.shown.get(e)??this.positions.get(e)??yt(this.view,{x:this.size.width/2,y:this.size.height/2});for(let n of a.nodes)this.shown.set(n,{...o});if(this.layout(!0),this.sync(),this.moveToPlace(),this.mark(),a.nodes.length)this.announce(`${a.nodes.length} ${a.nodes.length===1?"node":"nodes"} added${this.model.has(e)?` to ${ne(this.model.node(e))}`:""}`);return a}updateNode(e,t){if(!this.model.updateNode(e,t))return;let s=this.nodeEls.get(e);if(s)s.remove(),this.nodeEls.delete(e);this.sync(),this.draw(),this.mark()}setLayout(e){let t=e==="force"?"force":"layered";if(t===this.layoutName)return;this.layoutName=t,this.relayout(),this.callbacks.onLayout?.({layout:t})}setDirection(e){let t=e==="TB"?"TB":"LR";if(t===this.direction)return;if(this.direction=t,this.layoutName==="layered")this.relayout()}select(e,t={}){let s=e!=null&&this.model.has(e)?e:null;if(s===this.selected)return;if(this.selected=s,this.mark(),s)this.describe(s);if(!t.silent)this.callbacks.onSelect?.(this.selection())}focusNode(e){if(!this.model.has(e))return;this.select(e);let t=this.positions.get(e);if(t)this.autoFit=!1,this.setView(Os(this.view,t,this.size))}fit(){this.measure(),this.setView(Ls(this.model.bounds(this.positions),this.size,32,this.minZoom,Math.min(1,this.maxZoom))),this.autoFit=!0}zoomIn(){this.zoomBy(1.25)}zoomOut(){this.zoomBy(0.8)}zoomBy(e,t){this.autoFit=!1,this.setView(Rs(this.view,t??{x:this.size.width/2,y:this.size.height/2},e,this.minZoom,this.maxZoom))}panBy(e,t){this.autoFit=!1,this.setView(Ke(this.view,e,t))}setZoomLimits(e,t){this.minZoom=e,this.maxZoom=t}destroy(){this.stop(),this.observer?.disconnect();for(let e of this.disposers)e();this.svg.remove(),this.root.removeAttribute("data-gv-ready")}selection(){let e=this.selected?this.model.node(this.selected)??null:null;return{node:e,neighbours:e?this.model.neighbours(e.id).map((t)=>this.model.node(t)):[]}}measure(){let e=this.surface.getBoundingClientRect();this.size={width:e.width,height:e.height}}layout(e){let t=performance.now();if(this.layoutName==="layered")this.positions=Ms(this.model,{direction:this.direction}).positions;else this.positions=As(this.model,{positions:e&&this.positions.size?this.positions:null,pinned:e?this.pinned:null});this.timings.layout=performance.now()-t}relayout(){if(this.pinned.clear(),this.layout(!1),this.sync(),this.moveToPlace(),this.autoFit)this.fit()}render(){let e=performance.now();this.sync(),this.draw(),this.timings.render=performance.now()-e}sync(){let e=Ts(this.model.metrics);for(let[t,s]of this.nodeEls)if(!this.model.has(t))s.remove(),this.nodeEls.delete(t);for(let t of this.model.nodes){let s=this.nodeEls.get(t.id);if(!s)s=this.buildNode(t,e),this.nodeEls.set(t.id,s),this.idOf.set(s,t.id),this.nodeLayer.append(s);let a=this.model.degree(t.id);s.setAttribute("aria-label",`${ne(t)}, ${a} ${a===1?"connection":"connections"}`)}for(let[t,s]of this.edgeEls)if(!this.model.edge(t))s.group.remove(),s.label?.remove(),this.edgeEls.delete(t);for(let t of this.model.edges)if(!this.edgeEls.has(t.id))this.edgeEls.set(t.id,this.buildEdge(t));this.offsets=Ss(this.model.edges)}buildNode(e,t){let s=this.model.size(e.id),a=q("g",{class:"stx-gv-node",id:`${this.prefix}-node-${this.serial++}`,role:"group","data-node":e.id});if(e.kind)a.setAttribute("data-kind",e.kind);if(e.expandable===!0)a.setAttribute("data-expandable","");let o=q("title");o.textContent=e.detail?`${ne(e)}: ${e.detail}`:ne(e);let n=q("rect",{x:-s.width/2,y:-s.height/2,width:s.width,height:s.height,rx:6,ry:6}),i=e.expandable===!0?(this.model.metrics.charWidth+4)/2:0,r=q("text",{class:"stx-gv-node-label",x:-i,y:e.detail?-6:0,"text-anchor":"middle","dominant-baseline":"central"});if(r.textContent=Be(ne(e),t),a.append(o,n,r),e.detail){let c=q("text",{class:"stx-gv-node-detail",x:-i,y:9,"text-anchor":"middle","dominant-baseline":"central"});c.textContent=Be(e.detail,Math.floor(t/0.85)),a.append(c)}if(e.expandable===!0){let c=q("text",{class:"stx-gv-node-mark",x:s.width/2-10,y:0,"text-anchor":"middle","dominant-baseline":"central","aria-hidden":"true"});c.textContent="+",a.append(c)}return a}buildEdge(e){let t=q("g",{class:"stx-gv-edge","data-edge":e.id}),s=q("path",{fill:"none"});if(e.directed!==!1)s.setAttribute("marker-end",`url(#${this.prefix}-arrow)`);t.append(s),this.edgeLayer.append(t);let a=null;if(e.label){let o=Be(String(e.label),32),n=Math.ceil(o.length*yi)+8;a=q("g",{class:"stx-gv-edge-label","data-edge":e.id});let i=q("rect",{x:-n/2,y:-8,width:n,height:16,rx:3,ry:3}),r=q("text",{"text-anchor":"middle","dominant-baseline":"central"});r.textContent=o,a.append(i,r),this.labelLayer.append(a)}return{group:t,path:s,label:a}}draw(){for(let[e,t]of this.nodeEls){let s=this.shown.get(e)??this.positions.get(e);if(s)t.setAttribute("transform",`translate(${s.x} ${s.y})`)}for(let e of this.model.edges)this.drawEdge(e)}shape(e){let t=this.shown.get(e.source)??this.positions.get(e.source),s=this.shown.get(e.target)??this.positions.get(e.target);if(!t||!s)return null;return ks({source:t,sourceSize:this.model.size(e.source),target:s,targetSize:this.model.size(e.target)},{curve:this.layoutName==="layered"?"bezier":"straight",direction:this.direction,offset:this.offsets.get(e.id)??0,inset:e.directed!==!1?1:0})}drawEdge(e){let t=this.edgeEls.get(e.id),s=t&&this.shape(e);if(!t||!s)return;t.path.setAttribute("d",s.d),t.label?.setAttribute("transform",`translate(${Math.round(s.label.x*10)/10} ${Math.round(s.label.y*10)/10})`)}moveToPlace(){this.stop();let e=typeof matchMedia==="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!this.animate||e||typeof requestAnimationFrame!=="function"){this.shown=new Map(this.positions),this.draw();return}let t=new Map;for(let[o,n]of this.positions)t.set(o,this.shown.get(o)??n);let s=performance.now(),a=(o)=>{let n=Math.min(1,(o-s)/wi),i=1-(1-n)**3;for(let[r,c]of this.positions){let l=t.get(r);this.shown.set(r,{x:l.x+(c.x-l.x)*i,y:l.y+(c.y-l.y)*i})}if(this.draw(),this.frame=n<1?requestAnimationFrame(a):0,n>=1)this.shown=new Map(this.positions)};this.frame=requestAnimationFrame(a)}stop(){if(this.frame)cancelAnimationFrame(this.frame);this.frame=0}setView(e){this.view=e,this.stage.setAttribute("transform",`translate(${e.x} ${e.y}) scale(${e.k})`),this.callbacks.onViewport?.({...e})}mark(){let e=this.selected,t=new Set(e?this.model.neighbours(e):[]);this.root.toggleAttribute("data-has-selection",Boolean(e));for(let[a,o]of this.nodeEls)if(o.toggleAttribute("data-selected",a===e),o.toggleAttribute("data-neighbour",t.has(a)),a===e)o.setAttribute("aria-current","true");else o.removeAttribute("aria-current");for(let a of this.model.edges){let o=this.edgeEls.get(a.id);if(!o)continue;let n=e!=null&&(a.source===e||a.target===e);if(o.group.toggleAttribute("data-active",n),o.label?.toggleAttribute("data-active",n),a.directed!==!1)o.path.setAttribute("marker-end",`url(#${this.prefix}-${n?"arrow-active":"arrow"})`)}let s=e?this.nodeEls.get(e):null;if(s)this.surface.setAttribute("aria-activedescendant",s.id);else this.surface.removeAttribute("aria-activedescendant")}describe(e){let t=this.model.node(e);if(!t)return;let s=this.model.neighbours(e).map((n)=>ne(this.model.node(n))),a=s.slice(0,5).join(", "),o=s.length>5?` and ${s.length-5} more`:"";this.announce(s.length===0?`${ne(t)}, no connections`:`${ne(t)}, ${s.length} ${s.length===1?"connection":"connections"}: ${a}${o}`)}announce(e){if(this.status)this.status.textContent=e}expand(e,t=!1){let s=this.model.node(e);if(!s)return;if(this.lastExpand=performance.now(),t||s.expandable===!1)this.callbacks.onOpen?.({node:s});else this.callbacks.onExpand?.({node:s})}nodeUnder(e){let t=e instanceof Element?e.closest(".stx-gv-node"):null;return t?this.idOf.get(t)??null:null}local(e){let t=this.surface.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}listen(){let e=(s,a,o)=>{this.surface.addEventListener(s,a,o),this.disposers.push(()=>this.surface.removeEventListener(s,a,o))};e("pointerdown",(s)=>this.onPointerDown(s)),e("pointermove",(s)=>this.onPointerMove(s)),e("pointerup",(s)=>this.onPointerUp(s)),e("pointercancel",()=>this.endGesture()),e("dblclick",(s)=>{let a=this.nodeUnder(s.target);if(a&&performance.now()-this.lastExpand>js)this.expand(a,s.metaKey||s.ctrlKey)}),e("wheel",(s)=>this.onWheel(s),{passive:!1}),e("keydown",(s)=>this.onKeyDown(s)),e("contextmenu",(s)=>{if(this.contextMenu)s.preventDefault();let a=this.nodeUnder(s.target);if(a)this.select(a);this.callbacks.onContext?.({node:a?this.model.node(a):null,x:s.clientX,y:s.clientY})});let t=(s,a)=>{this.surface.addEventListener(s,a),this.disposers.push(()=>this.surface.removeEventListener(s,a))};t("gesturestart",(s)=>{s.preventDefault();let a=this.local(s);this.pinch={k:this.view.k,x:a.x,y:a.y}}),t("gesturechange",(s)=>{if(!this.pinch)return;s.preventDefault(),this.zoomBy(this.pinch.k*s.scale/this.view.k,{x:this.pinch.x,y:this.pinch.y})}),t("gestureend",()=>{this.pinch=null})}onPointerDown(e){if(e.button!==0)return;let t=this.nodeUnder(e.target);this.surface.focus({preventScroll:!0});try{this.surface.setPointerCapture(e.pointerId)}catch{}this.gesture={pointer:e.pointerId,node:t,startX:e.clientX,startY:e.clientY,origin:t?{...this.positions.get(t)??{x:0,y:0}}:{x:0,y:0},view:{...this.view},moved:!1}}onPointerMove(e){let t=this.gesture;if(!t||e.pointerId!==t.pointer)return;let s=e.clientX-t.startX,a=e.clientY-t.startY;if(!t.moved){if(Math.abs(s)<Vs&&Math.abs(a)<Vs)return;t.moved=!0,this.stop(),this.shown=new Map(this.positions),this.root.setAttribute("data-dragging",t.node?"node":"pan")}if(t.node){let o={x:t.origin.x+s/this.view.k,y:t.origin.y+a/this.view.k};this.positions.set(t.node,o),this.shown.set(t.node,o),this.nodeEls.get(t.node)?.setAttribute("transform",`translate(${o.x} ${o.y})`);for(let n of this.model.edgesOf(t.node))this.drawEdge(n)}else this.autoFit=!1,this.setView(Ke(t.view,s,a))}onPointerUp(e){let t=this.gesture;if(!t||e.pointerId!==t.pointer)return;if(this.endGesture(),t.moved){if(t.node){this.pinned.add(t.node),this.autoFit=!1;let o=this.positions.get(t.node);this.callbacks.onMove?.({node:this.model.node(t.node),x:o.x,y:o.y})}return}if(!t.node){this.select(null);return}let s=performance.now(),a=this.lastClick.id===t.node&&s-this.lastClick.at<js;if(this.lastClick=a?{id:"",at:0}:{id:t.node,at:s},this.select(t.node),a)this.expand(t.node,e.metaKey||e.ctrlKey)}endGesture(){let e=this.gesture;if(this.gesture=null,this.root.removeAttribute("data-dragging"),e)try{this.surface.releasePointerCapture(e.pointer)}catch{}}onWheel(e){if(e.preventDefault(),e.ctrlKey||e.metaKey){this.zoomBy(Math.exp(-e.deltaY*(e.deltaMode===1?0.05:0.01)),this.local(e));return}let t=e.deltaMode===1?16:1;this.panBy(-e.deltaX*t,-e.deltaY*t)}onKeyDown(e){let s={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"}[e.key];if(s){e.preventDefault();let o=this.selected?zs(this.positions,this.selected,s):Hs(this.positions,yt(this.view,{x:this.size.width/2,y:this.size.height/2}));if(o)this.select(o),this.bringIntoView(o);return}let a=e.metaKey||e.ctrlKey;if(e.key==="Enter"||e.key===" "){if(!this.selected)return;e.preventDefault(),this.expand(this.selected,a)}else if(a||e.altKey);else if(e.key==="+"||e.key==="=")e.preventDefault(),this.zoomIn();else if(e.key==="-"||e.key==="_")e.preventDefault(),this.zoomOut();else if(e.key==="0")e.preventDefault(),this.fit();else if(e.key==="f"||e.key==="F"){if(!this.selected)return;e.preventDefault(),this.focusNode(this.selected)}else if(e.key==="o"||e.key==="O"){if(!this.selected)return;e.preventDefault(),this.expand(this.selected,!0)}else if(e.key==="Escape"&&this.selected)e.preventDefault(),this.select(null)}bringIntoView(e){let t=this.positions.get(e);if(!t)return;let s=this.model.size(e),a=Ds(this.view,{x:t.x-s.width/2,y:t.y-s.height/2,width:s.width,height:s.height},this.size);if(a!==this.view)this.autoFit=!1,this.setView(a)}}var $i="./GroupedList-j3sxv5pb.stx";var Ei="./GroupedListRow-dnqc6j85.stx";var Ai="./Image-6x38ddd7.stx";var Mi="./EmailInput-sf9jfrgz.stx";var Ri="./NumberInput-e2afxyh3.stx";var Oi="./PasswordInput-d78bk8r0.stx";var zi="./SearchInput-w15r5t95.stx";var Vi="./TextInput-fge1b7tk.stx";var ji={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string},Fi={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,leftIcon:f.string,rightIcon:f.string,clearable:f.boolean,maxLength:f.number,showCount:f.boolean,type:f.oneOf(["text","date","time","datetime-local","month","week","url","tel","color","search","email","number","password"]),pattern:f.string,list:f.string,minLength:f.number,htmlSize:f.number,autofocus:f.boolean},Bi={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,min:f.number,max:f.number,step:f.number,showControls:f.boolean},_i={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,showStrength:f.boolean},Ki={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,onSearch:f.func,loading:f.boolean},Gm=ae("TextInput",Fi),Um=ae("EmailInput",ji),Jm=ae("PasswordInput",_i),Ym=ae("NumberInput",Bi),Xm=ae("SearchInput",Ki);var qi=new Set(["array","set"]),Wi=/^[A-Z_$][\w$]*$/i;function Ct(e){return qi.has(e.kind)}function kt(e){return e.ref===void 0&&(e.children!==void 0&&e.children.length>0||(e.more??0)>0)}function $t(e,t="$"){let s=t;for(let a of e)if(typeof a==="number")s+=`[${a}]`;else if(Wi.test(a))s+=`.${a}`;else s+=`[${JSON.stringify(a)}]`;return s}function St(e){if(e.ref!==void 0)return"[Circular]";if(e.children){if(Ct(e))return e.children.map((s)=>St(s));let t={};return e.children.forEach((s,a)=>{t[s.key!==void 0?String(s.key):s.label??String(a)]=St(s)}),t}if("value"in e){let t=e.value;if(typeof t==="bigint")return t.toString();if(typeof t==="number"&&!Number.isFinite(t))return String(t);if(typeof t==="function"||typeof t==="symbol")return e.preview??String(t);return t}return e.preview??null}function Bs(e,t=2){let s=St(e);return s===void 0?"undefined":JSON.stringify(s,null,t)}var Fs=80;function Tt(e){if(e.preview!==void 0)return e.preview;if(e.ref!==void 0)return"[Circular]";if(e.children||e.more){let t=(e.children?.length??0)+(e.more??0);if(Ct(e))return`${e.kind==="set"?"Set":"Array"}(${t})`;return t===0?"{}":`{${t}}`}if("value"in e){let t=e.value;if(typeof t==="string")return JSON.stringify(t.length>Fs?`${t.slice(0,Fs)}\u2026`:t);if(typeof t==="bigint")return`${t}n`;return String(t)}return e.kind}function og(e,t,s={}){let a=s.maxItems??1000,o=s.maxDepth??32,n=new Map,i=1,r=(l,d)=>{if(d!==void 0)l.label=d;return l},c=(l,d,h)=>{if(l===null)return r({kind:"null",value:null,preview:"null"},d);switch(typeof l){case"undefined":return r({kind:"undefined",value:void 0,preview:"undefined"},d);case"string":case"number":case"boolean":case"bigint":return r({kind:typeof l,value:l},d);case"symbol":return r({kind:"symbol",preview:l.toString()},d);case"function":return r({kind:"function",preview:`\u0192 ${l.name||"(anonymous)"}()`},d)}let p=l,u=n.get(p);if(u!==void 0)return r({kind:"ref",ref:u},d);if(p instanceof Date)return r({kind:"date",value:Number.isNaN(p.getTime())?null:p.toISOString(),preview:Number.isNaN(p.getTime())?"Invalid Date":p.toISOString()},d);if(p instanceof RegExp)return r({kind:"regexp",value:p.toString(),preview:p.toString()},d);let g=`v${i++}`;n.set(p,g);let m=Array.isArray(p),w=p instanceof Set,y=p instanceof Map,v=r({id:g,kind:m?"array":w?"set":y?"map":"object",children:[]},d);if(h>=o)return v.preview=m?"Array":"Object",delete v.children,v;let b=v.children,C=0;if(m||w)for(let P of p){if(C<a)b.push(c(P,String(C),h+1));C++}else if(y)for(let[P,T]of p){if(C<a)b.push(c(T,typeof P==="string"?P:Tt(c(P,void 0,o)),h+1));C++}else{for(let T of Object.keys(p)){if(C<a)b.push(c(p[T],T,h+1));C++}let P=p.constructor?.name;if(P&&P!=="Object")v.preview=`${P} {${C}}`}if(C>b.length)v.more=C-b.length;if(y)v.preview=`Map(${C})`;return v};return c(e,t,0)}class Et{rows=[];version=0;roots=[];depth;opened=new Set;closed=new Set;index=null;constructor(e,t={}){this.depth=t.depth??1,this.setValue(e)}setValue(e){this.roots=e==null?[]:Array.isArray(e)?e:[e],this.opened.clear(),this.closed.clear(),this.flatten()}setDepth(e){this.depth=e,this.opened.clear(),this.closed.clear(),this.flatten()}getRoots(){return this.roots}indexOf(e){if(!this.index){this.index=new Map;for(let t=0;t<this.rows.length;t++)this.index.set(this.rows[t].id,t)}return this.index.get(e)??-1}pathOf(e){let t=[];for(let s=e;s>=0;s=this.rows[s].parent){let a=this.rows[s];if(a.isMore)continue;if(a.parent!==-1||this.roots.length>1)t.push(a.key)}return t.reverse()}isExpanded(e,t){return this.opened.has(e)||t<this.depth&&!this.closed.has(e)}expand(e){return this.set(e,!0)}collapse(e){return this.set(e,!1)}toggle(e){let t=this.indexOf(e);if(t===-1)return!1;return this.set(e,!this.rows[t].expanded)}expandAll(e){let t=(s,a,o)=>{if(!kt(s))return;if(o>=this.depth)this.opened.add(a);this.closed.delete(a),s.children?.forEach((n,i)=>t(n,n.id??`${a}.${i}`,o+1))};if(e===void 0)this.roots.forEach((s,a)=>t(s,s.id??String(a),0));else{let s=this.find(e);if(!s)return;t(s.node,e,s.ancestors.length)}this.flatten()}collapseAll(){this.opened.clear(),this.closed.clear();let e=(t,s,a)=>{if(a>=this.depth||!kt(t))return;this.closed.add(s),t.children?.forEach((o,n)=>e(o,o.id??`${s}.${n}`,a+1))};this.roots.forEach((t,s)=>e(t,t.id??String(s),0)),this.flatten()}reveal(e){let t=this.find(e);if(!t)return-1;return t.ancestors.forEach((s,a)=>{if(this.closed.delete(s),a>=this.depth)this.opened.add(s)}),this.flatten(),this.indexOf(e)}appendChildren(e,t,s=0){let a=this.find(e);if(!a)return!1;let o=a.node;if(o.children=[...o.children??[],...t],s>0)o.more=s;else delete o.more;return this.flatten(),!0}move(e,t,s=10){let a=this.rows.length-1;if(a<0)return{index:-1,changed:!1};let o=Math.min(Math.max(e,0),a),n=this.rows[o],i=(r)=>({index:Math.min(Math.max(r,0),a),changed:!1});switch(t){case"ArrowDown":return i(e<0?0:o+1);case"ArrowUp":return i(o-1);case"Home":return i(0);case"End":return i(a);case"PageDown":return i(o+s);case"PageUp":return i(o-s);case"ArrowRight":if(!n.expandable||n.isMore)return i(o);if(!n.expanded)return{index:o,changed:this.expand(n.id)};return i(o+1);case"ArrowLeft":if(n.expanded&&!n.isMore)return{index:o,changed:this.collapse(n.id)};return i(n.parent===-1?o:n.parent);case"*":{let r=!1,c=n.parent,l=this.rows.filter((d)=>d.parent===c&&d.depth===n.depth&&d.expandable&&!d.expanded&&!d.isMore);for(let d of l)this.mark(d.id,d.depth,!0),r=!0;if(r)this.flatten();return{index:this.indexOf(n.id),changed:r}}}return i(o)}typeahead(e,t){let s=t.toLowerCase(),a=this.rows.length;if(s===""||a===0)return-1;let o=s.length===1?e+1:Math.max(e,0);for(let n=0;n<a;n++){let i=(o+n+a)%a,r=this.rows[i];if(!r.isMore&&(r.node.label??"").toLowerCase().startsWith(s))return i}return-1}set(e,t){let s=this.indexOf(e);if(s===-1)return!1;let a=this.rows[s];if(!a.expandable||a.isMore||a.expanded===t)return!1;return this.mark(e,a.depth,t),this.flatten(),!0}mark(e,t,s){if(s){if(this.closed.delete(e),t>=this.depth)this.opened.add(e)}else if(this.opened.delete(e),t<this.depth)this.closed.add(e)}find(e){let t=[];for(let s=this.roots.length-1;s>=0;s--)t.push({node:this.roots[s],id:this.roots[s].id??String(s),ancestors:[]});while(t.length>0){let s=t.pop();if(s.id===e)return{node:s.node,ancestors:s.ancestors};let a=s.node.children;if(!a||s.node.ref!==void 0)continue;let o=[...s.ancestors,s.id];for(let n=a.length-1;n>=0;n--)t.push({node:a[n],id:a[n].id??`${s.id}.${n}`,ancestors:o})}return null}flatten(){let e=[],t=(s,a,o,n,i,r,c)=>{let l=kt(s),d=l&&this.isExpanded(a,o),h=e.length;if(e.push({id:a,node:s,depth:o,key:i,parent:n,expandable:l,expanded:d,posInSet:r,setSize:c,isMore:!1}),!d)return;let p=s.children??[],u=s.more??0,g=Ct(s),m=p.length+(u>0?1:0);for(let w=0;w<p.length;w++){let y=p[w];t(y,y.id??`${a}.${w}`,o+1,h,y.key??(g?w:y.label??w),w+1,m)}if(u>0)e.push({id:`${a}.+`,node:s,depth:o+1,key:"",parent:h,expandable:!1,expanded:!1,posInSet:m,setSize:m,isMore:!0})};this.roots.forEach((s,a)=>t(s,s.id??String(a),0,-1,s.key??a,a+1,this.roots.length)),this.rows=e,this.index=null,this.version++}}var Ui="./JsonTree-satc4010.stx";var qs=new Set(["array","object","map","set","model","error"]);function Ji(e){return e.t==="object"||e.t==="model"}function _s(e){return e.length>0&&e.slice(0,20).every(Ji)}function Ks(e){return e.some((t)=>qs.has(t.t))}function It(e,t){let s=e.length>120?`${e.slice(0,120)}\u2026`:e;return t?`${JSON.stringify(s)} (${t} more characters)`:JSON.stringify(s)}function Yi(e){if(!e.file)return"";return[e.file,e.line,e.column].filter((t)=>t!==void 0).join(":")}function rg(e,t,s={}){let a=s.idPrefix??"t",o=(l)=>`${a}${l}`,n=(l,d)=>{if(d!==void 0)l.label=d;return l},i=(l)=>c(l,void 0).preview??l.t,r=(l,d)=>{if(d.length>0)l.openable=d.length===1?d[0]:d;return l};function c(l,d){switch(l.t){case"undefined":return n({kind:"undefined",value:void 0,preview:"undefined"},d);case"null":return n({kind:"null",value:null,preview:"null"},d);case"boolean":return n({kind:"boolean",value:l.v,preview:String(l.v)},d);case"number":{let h=typeof l.v==="number"?l.v:l.v==="-0"?-0:Number(l.v);return n({kind:"number",value:h,preview:String(l.v)},d)}case"bigint":return n({kind:"bigint",value:l.v,preview:`${l.v}n`},d);case"string":return n({kind:"string",value:l.v,preview:It(l.v,l.truncated)},d);case"symbol":return n({kind:"symbol",preview:`Symbol(${l.v})`},d);case"function":{let h=l.kind==="class"?`class ${l.name}`:`${l.kind==="async"?"async ":""}\u0192${l.kind==="generator"?"*":""} ${l.name}()`;return n({kind:"function",preview:h},d)}case"date":return n({kind:"date",value:l.v,preview:l.v??"Invalid Date"},d);case"regexp":return n({kind:"regexp",value:l.v,preview:l.v},d);case"url":return n({kind:"url",value:l.v,preview:l.v},d);case"promise":return n({kind:"promise",preview:"Promise"},d);case"bytes":{let h=l.length*2>l.hex.length;return n({kind:"bytes",value:l.hex,preview:`${l.ctor}(${l.length}) <${l.hex}${h?"\u2026":""}>`},d)}case"ref":return n({kind:"ref",ref:o(l.id),preview:"[Circular]"},d);case"cut":return n({kind:"cut",preview:`${l.ctor??"Object"} \u2026 (${l.reason==="depth"?"too deep to show":"result too large to show"})`},d);case"array":{let h={id:o(l.id),kind:"array",preview:`${l.ctor??"Array"}(${l.length})`,children:l.items.map((p,u)=>c(p,String(u)))};if(l.more)h.more=l.more;return n(r(h,_s(l.items)?["table"]:[]),d)}case"set":{let h={id:o(l.id),kind:"set",preview:`Set(${l.size})`,children:l.items.map((p,u)=>c(p,String(u)))};if(l.more)h.more=l.more;return n(r(h,_s(l.items)?["table"]:[]),d)}case"object":{let h=l.entries.slice(0,5).map(([m])=>m).join(", "),p=l.entries.length+(l.more??0),u=p===0?"{}":`{${h}${p>5?", \u2026":""}}`,g={id:o(l.id),kind:"object",preview:l.ctor&&l.ctor!=="Object"?`${l.ctor} ${u}`:u,children:l.entries.map(([m,w])=>c(w,m))};if(l.more)g.more=l.more;return n(r(g,Ks(l.entries.map((m)=>m[1]))?["graph"]:[]),d)}case"map":{let h={id:o(l.id),kind:"map",preview:`Map(${l.size})`,children:l.entries.map(([p,u],g)=>{if(!qs.has(p.t)){let m=c(u,i(p));return m.key=p.t==="string"?p.v:i(p),m}return{kind:"entry",label:String(g),key:g,preview:`${i(p)} => ${i(u)}`,children:[c(p,"key"),c(u,"value")]}})};if(l.more)h.more=l.more;return n(r(h,Ks(l.entries.map((p)=>p[1]))?["graph"]:[]),d)}case"model":{let h=l.attributes.map(([g,m])=>c(m,g));for(let[g,m]of l.loaded??[]){let w=c(m,g);w.meta=w.meta??{relation:!0},h.push(w)}if(l.hidden?.length)h.push({kind:"hidden",label:"[hidden]",key:"[hidden]",preview:l.hidden.join(", "),children:l.hidden.map((g,m)=>({kind:"hidden",label:String(m),value:g,preview:g}))});if(l.relations?.length)h.push({kind:"relations",label:"[relations]",key:"[relations]",preview:`${l.relations.length} declared`,children:l.relations.map((g)=>({kind:"relation",label:g.name??g.model,value:g,preview:`${g.kind} ${g.model}`}))});let p={model:l.model,hidden:l.hidden??[],relations:l.relations??[]};if(l.table)p.table=l.table;if(l.primaryKey)p.primaryKey=l.primaryKey;let u={id:o(l.id),kind:"model",preview:l.key?`${l.model} #${i(l.key).replace(/^"|"$/g,"")}`:l.model,children:h,meta:p};if(l.more)u.more=l.more;return n(r(u,["graph"]),d)}case"html":{let h={kind:l.kind};if(l.title)h.title=l.title;if(l.text)h.text=l.text;if(l.truncated)h.truncated=l.truncated;let p=l.truncated?`, ${l.truncated} more cut`:"",u=l.title?`: ${l.title}`:"";return n(r({kind:"html",value:l.html,preview:`${l.kind}${u} (${l.html.length} characters${p})`,meta:h},["preview"]),d)}case"error":{let h=[{kind:"string",label:"message",value:l.message,preview:It(l.message)}];if(l.frames?.length)h.push({kind:"stack",label:"stack",preview:`${l.frames.length} frames`,value:l.stack,children:l.frames.map((p,u)=>({kind:"frame",label:String(u),value:p,preview:[p.function,Yi(p)].filter(Boolean).join(" at ")||"(unknown)",meta:p}))});else if(l.stack)h.push({kind:"string",label:"stack",value:l.stack,preview:It(l.stack)});if(l.cause)h.push(c(l.cause,"cause"));for(let[p,u]of l.entries??[])h.push(c(u,p));return n({kind:"error",preview:l.message?`${l.name}: ${l.message}`:l.name,children:h},d)}}return n({kind:"unknown",preview:String(l.t??"unknown")},d)}return c(e,t)}var Xi=600,Ws=400,Gs={table:"Table",graph:"Graph",preview:"Preview"};function Us(e){return e.length>Ws?`${e.slice(0,Ws)}\u2026`:e}function Js(e){if(e==null||e==="")return[];return Array.isArray(e)?e:[e]}class Zi{root;callbacks;model;scroller;content;rowsEl;status;prefix;rowHeight;overscan;openable;contextMenu;pool=[];parts=new WeakMap;active=-1;activeId="";typed="";typedAt=0;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;let a=(n)=>e.querySelector(`[data-jt="${n}"]`);this.scroller=a("scroller")??e,this.content=a("content")??this.scroller,this.rowsEl=a("rows")??this.content,this.status=a("status"),this.prefix=`${e.id||`json-tree-${Math.random().toString(36).slice(2,8)}`}-row-`,this.rowHeight=t.rowHeight&&t.rowHeight>0?t.rowHeight:22,this.overscan=t.overscan??6,this.openable=t.openable??null,this.contextMenu=Boolean(t.contextMenu),this.model=new Et(t.value,{depth:t.depth??1}),this.rowsEl.__stx_inert_content=!0,e.style.setProperty("--stx-tree-row-height",`${this.rowHeight}px`);let o=(n,i,r,c)=>{n.addEventListener(i,r,c),this.disposers.push(()=>n.removeEventListener(i,r,c))};if(o(this.scroller,"scroll",()=>this.render(),{passive:!0}),o(this.scroller,"keydown",(n)=>this.onKeyDown(n)),o(this.scroller,"focus",()=>{if(this.active===-1&&this.model.rows.length>0)this.setActive(0,!1)}),o(this.rowsEl,"mousedown",(n)=>{if(n.target.closest("[data-jt-action]"))n.preventDefault()}),o(this.rowsEl,"click",(n)=>this.onClick(n)),o(this.rowsEl,"dblclick",(n)=>this.onDoubleClick(n)),o(this.rowsEl,"contextmenu",(n)=>this.onContextMenu(n)),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.render()),this.observer.observe(this.scroller);this.render(),e.setAttribute("data-jt-ready","")}setValue(e){this.model.setValue(e),this.active=-1,this.activeId="",this.scroller.scrollTop=0,this.render()}setDepth(e){this.model.setDepth(e),this.afterChange()}setOpenable(e){this.openable=e??null,this.model.version++,this.render()}setContextMenu(e){this.contextMenu=e}expandAll(e){this.model.expandAll(e),this.afterChange()}collapseAll(){this.model.collapseAll(),this.afterChange()}expand(e){let t=this.model.expand(e);if(t)this.afterChange();return t}collapse(e){let t=this.model.collapse(e);if(t)this.afterChange();return t}reveal(e){let t=this.model.reveal(e);if(t===-1)return this.afterChange(),!1;return this.active=t,this.activeId=e,this.scrollToRow(t),this.render(),this.emitSelect(),!0}appendChildren(e,t,s=0){let a=this.model.appendChildren(e,t,s);if(a)this.afterChange();return a}getSelected(){return this.active===-1?null:this.detail(this.active)}select(e){let t=this.model.indexOf(e);if(t===-1)return!1;return this.setActive(t,!0),!0}focus(){this.scroller.focus()}get drawn(){return this.pool.filter((e)=>e.style.display!=="none").length}destroy(){this.observer?.disconnect();for(let e of this.disposers)e();this.rowsEl.textContent="",this.pool=[],this.root.removeAttribute("data-jt-ready")}afterChange(){if(this.activeId){let e=this.model.indexOf(this.activeId);if(this.active=e,e===-1)this.activeId=""}this.render()}detail(e){let t=this.model.rows[e],s=this.model.pathOf(e);return{id:t.id,node:t.node,path:s,pathText:$t(s)}}emitSelect(){if(this.active!==-1)this.callbacks.onSelect?.(this.detail(this.active))}setActive(e,t){if(e<0||e>=this.model.rows.length)return;let s=e!==this.active;if(this.active=e,this.activeId=this.model.rows[e].id,t)this.scrollToRow(e);if(this.render(),s)this.emitSelect()}scrollToRow(e){let t=e*this.rowHeight,s=this.scroller.clientHeight;if(t<this.scroller.scrollTop)this.scroller.scrollTop=t;else if(t+this.rowHeight>this.scroller.scrollTop+s)this.scroller.scrollTop=t+this.rowHeight-s}pageSize(){return Math.max(1,Math.floor(this.scroller.clientHeight/this.rowHeight)-1)}createRow(){let e=document.createElement("div");e.setAttribute("role","treeitem"),e.className="stx-jt-row";let t=(a,o)=>{let n=document.createElement("span");if(n.className=a,o)n.setAttribute("aria-hidden","true");return e.appendChild(n),n},s={twisty:t("stx-jt-twisty",!0),label:t("stx-jt-label",!1),separator:t("stx-jt-separator",!0),preview:t("stx-jt-preview",!1),actions:t("stx-jt-actions",!1)};return s.separator.textContent=": ",this.parts.set(e,s),this.rowsEl.appendChild(e),e}button(e,t,s,a){let o=document.createElement("button");if(o.type="button",o.tabIndex=-1,o.className="stx-jt-action",o.setAttribute("data-jt-action",e),a)o.setAttribute("data-jt-as",a);return o.setAttribute("aria-label",s),o.textContent=t,o}opensOf(e,t){if(e.isMore)return[];if(this.openable){let s=this.openable(e.node,this.model.pathOf(t));if(s!==void 0)return Js(s)}return Js(e.node.openable)}render(){let e=this.model.rows,t=e.length,s=this.scroller.clientHeight;this.content.style.height=`${t*this.rowHeight}px`;let a=Math.max(0,Math.min(this.scroller.scrollTop,t*this.rowHeight-s)),o=Math.max(0,Math.floor(a/this.rowHeight)-this.overscan),n=Math.min(t,Math.ceil((a+s)/this.rowHeight)+this.overscan),i=Math.max(0,n-o);while(this.pool.length<i)this.pool.push(this.createRow());let r=this.pool.length,c=new Uint8Array(r);for(let d=o;d<n;d++){let h=d%r;c[h]=1,this.paint(this.pool[h],e[d],d)}for(let d=0;d<r;d++)if(!c[d]&&this.pool[d].style.display!=="none")this.pool[d].style.display="none",this.pool[d].__jt=void 0,this.pool[d].removeAttribute("id");if(this.active>=o&&this.active<n)this.scroller.setAttribute("aria-activedescendant",this.prefix+this.active);else this.scroller.removeAttribute("aria-activedescendant")}paint(e,t,s){let a=this.model.version,o=s===this.active,n=e.__jt;if(!n||n.index!==s||n.version!==a){let i=this.parts.get(e),r=t.node;if(e.style.display="",e.style.transform=`translateY(${s*this.rowHeight}px)`,e.style.setProperty("--stx-tree-depth",String(t.depth)),e.id=this.prefix+s,e.setAttribute("data-jt-index",String(s)),e.setAttribute("aria-level",String(t.depth+1)),e.setAttribute("aria-posinset",String(t.posInSet)),e.setAttribute("aria-setsize",String(t.setSize)),t.expandable)e.setAttribute("aria-expanded",t.expanded?"true":"false");else e.removeAttribute("aria-expanded");if(t.isMore)e.setAttribute("data-kind","more"),i.twisty.textContent="",i.label.textContent="",i.separator.style.display="none",i.preview.textContent=`\u2026 ${r.more} more`,i.preview.setAttribute("data-kind","more");else{e.setAttribute("data-kind",r.kind),i.twisty.textContent=t.expandable?t.expanded?"\u25BE":"\u25B8":"";let d=r.label??(typeof t.key==="number"&&t.parent!==-1?String(t.key):"");i.label.textContent=Us(d),i.separator.style.display=d===""?"none":"",i.preview.textContent=Us(Tt(r)),i.preview.setAttribute("data-kind",r.kind)}let c=this.opensOf(t,s),l=t.isMore?"+":c.join("|");if(!n||n.opens!==l)if(i.actions.textContent="",t.isMore)i.actions.appendChild(this.button("more","Load","Load more"));else{for(let d of c)i.actions.appendChild(this.button("open",Gs[d]??d,`Open as ${Gs[d]?.toLowerCase()??d}`,d));i.actions.appendChild(this.button("copy-value","Copy","Copy value")),i.actions.appendChild(this.button("copy-path","Path","Copy path"))}e.__jt={index:s,version:a,opens:l}}if(o)e.setAttribute("aria-selected","true"),e.setAttribute("data-active","");else e.setAttribute("aria-selected","false"),e.removeAttribute("data-active")}rowIndexOf(e){let t=e instanceof Element?e.closest("[data-jt-index]"):null;if(!t||t.style.display==="none")return-1;return Number(t.getAttribute("data-jt-index"))}say(e){if(this.status)this.status.textContent=e}toggleRow(e){let t=this.model.rows[e];if(!t)return;if(t.isMore){this.loadMore(e);return}if(t.node.ref!==void 0){this.follow(e);return}if(!t.expandable)return;let s=t.id;this.model.toggle(s),this.afterChange();let a=this.model.indexOf(s);if(a!==-1)this.callbacks.onToggle?.({...this.detail(a),expanded:this.model.rows[a].expanded})}follow(e){let t=this.model.rows[e].node.ref;if(t===void 0)return;if(!this.reveal(t))this.say("The value this points back to is not part of what was sent.")}loadMore(e){let s=this.model.rows[e].parent;if(s===-1)return;this.callbacks.onLoadMore?.(this.detail(s))}copy(e,t){let s=this.model.rows[e];if(!s)return;let a=s.isMore?s.parent:e,o=this.model.pathOf(a),n=this.model.rows[a].node,i=t==="path"?$t(o):Bs(n);try{navigator.clipboard?.writeText(i)?.catch(()=>{})}catch{}this.say(t==="path"?`Copied path ${i}`:"Copied value"),this.callbacks.onCopy?.({what:t,text:i,path:o,node:n})}open(e,t){let s=this.model.rows[e];if(!s||s.isMore)return;let a=t??this.opensOf(s,e)[0];if(a===void 0)return;this.callbacks.onOpen?.({...this.detail(e),as:a})}onClick(e){let t=this.rowIndexOf(e.target);if(t===-1)return;let s=e.target instanceof Element?e.target.closest("[data-jt-action]"):null;if(this.setActive(t,!1),s){let o=s.getAttribute("data-jt-action");if(o==="copy-value")this.copy(t,"value");else if(o==="copy-path")this.copy(t,"path");else if(o==="open")this.open(t,s.getAttribute("data-jt-as")??void 0);else if(o==="more")this.loadMore(t);return}let a=this.model.rows[t];if(a.expandable||a.isMore||a.node.ref!==void 0)this.toggleRow(t)}onDoubleClick(e){let t=this.rowIndexOf(e.target);if(t===-1||e.target instanceof Element&&e.target.closest("[data-jt-action]"))return;let s=this.model.rows[t];if(!s.expandable&&!s.isMore&&s.node.ref===void 0)this.open(t)}onContextMenu(e){let t=this.rowIndexOf(e.target);if(t===-1)return;if(this.setActive(t,!1),this.contextMenu)e.preventDefault();this.callbacks.onContext?.({...this.detail(t),x:e.clientX,y:e.clientY})}onKeyDown(e){let t=this.model.rows;if(t.length===0)return;let s=e.metaKey||e.ctrlKey,a=e.key;if(s&&(a==="c"||a==="C")){if(this.active===-1)return;e.preventDefault(),this.copy(this.active,e.shiftKey?"path":"value");return}if(s||e.altKey)return;if(a==="Enter"&&e.shiftKey){if(e.preventDefault(),this.active!==-1)this.open(this.active);return}let o=this.typed!==""&&Date.now()-this.typedAt<=Xi;if(a==="Enter"||a===" "&&!o){if(e.preventDefault(),this.active!==-1)this.toggleRow(this.active);return}if(a==="ArrowDown"||a==="ArrowUp"||a==="ArrowLeft"||a==="ArrowRight"||a==="Home"||a==="End"||a==="PageDown"||a==="PageUp"||a==="*"){e.preventDefault(),this.typed="";let n=this.active===-1?null:t[this.active],i=n?.expanded,r=this.model.move(this.active,a,this.pageSize());if(r.changed){if(this.active=r.index,this.activeId=this.model.rows[r.index]?.id??"",this.scrollToRow(r.index),this.render(),n&&a!=="*"){let c=this.model.indexOf(n.id);if(c!==-1&&this.model.rows[c].expanded!==i)this.callbacks.onToggle?.({...this.detail(c),expanded:this.model.rows[c].expanded})}}else this.setActive(r.index,!0);return}if(a.length===1){let n=Date.now();if(!o)this.typed="";this.typedAt=n,this.typed+=a;let i=this.model.typeahead(this.active,this.typed);if(i!==-1)e.preventDefault(),this.setActive(i,!0)}}}var er="./List-5ey6k813.stx";var sr="./Listbox-83j2q4x6.stx";var or="./ListboxButton-gan8e3nw.stx";var ir="./ListboxLabel-ka0hfm7b.stx";var lr="./ListboxOption-gpaqvk3s.stx";var dr="./ListboxOptions-2928864k.stx";var hr="./FilterChip-bynt5maa.stx";var fr="./FilterChips-xg7pgkk2.stx";var gr="./ListRow-1qvkjt4v.stx";var br="./NavBar-ky8tedjb.stx";var wr="./SectionCard-8b5fyrjd.stx";var kr="./TabBar-6m1ajm1d.stx";var Cr="./TabBarItem-kddfnhk3.stx";var Tr="./Navigator-1yk1c3pp.stx";var Ir="./Notification-b3cz24f0.stx";var Pr="./Pager-w4eb64na.stx";var Nr="./PagerDots-076w890y.stx";var Lr="./Pagination-8bhbkpcp.stx";var Dr="./Checkout-crbegxyv.stx";var Hr="./DefaultPaymentMethod-ss3x61tr.stx";var jr="./PaymentMethods-z4hhr0kv.stx";var Br="./SubscriptionCheckout-rdcv32n1.stx";var Kr="./Popover-jjt7p7sn.stx";var Wr="./PopoverButton-ks3cttd9.stx";var Ur="./PopoverPanel-ddgj4gz3.stx";var Yr="./Portal-m73vz879.stx";var Xs=[{name:"phone",label:"Phone",width:390,height:844},{name:"tablet",label:"Tablet",width:820,height:1180},{name:"desktop",label:"Desktop",width:1280,height:800}];function Ys(e){let t=typeof e==="string"?Number.parseFloat(e):e;return typeof t==="number"&&Number.isFinite(t)&&t>0?Math.round(t):null}function At(e,t={}){let s=Ys(t.width),a=Ys(t.height),o=Boolean(t.landscape);if(s&&a)return{name:"custom",size:{width:s,height:a},landscape:!1};let n=Xs.find((r)=>r.name===e);if(!n)return{name:"fill",size:null,landscape:!1};let i=o&&n.height>n.width;return{name:n.name,size:i?{width:n.height,height:n.width}:{width:n.width,height:n.height},landscape:i}}function Zs(e,t,s=0){let a=t.width-s*2,o=t.height-s*2;if(a<=0||o<=0||e.width<=0||e.height<=0)return 1;return Math.min(1,a/e.width,o/e.height)}function Qs(e,t=1){if(!e.size)return"Fills the frame";let s=`${e.size.width} \xD7 ${e.size.height}`;return t<0.995?`${s} at ${Math.round(t*100)}%`:s}function Pt(e){return e==="light"||e==="dark"?e:"auto"}var Xr=["allow-same-origin","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols","allow-popups","allow-popups-to-escape-sandbox","allow-modals","allow-downloads","allow-pointer-lock","allow-presentation","allow-storage-access-by-user-activation"];function ea(e={}){let t=[];if(e.scripts)t.push("allow-scripts");if(e.forms)t.push("allow-forms");return t.join(" ")}function Cx(e){return!e.toLowerCase().split(/\s+/).filter(Boolean).some((s)=>Xr.includes(s))}var Zr=/<!doctype\s|<html[\s>]/i,qe=/<head(?:\s[^>]*)?>/i,We=/<html(?:\s[^>]*)?>/i,Qr=/<base[\s>]/i,el=/<meta[^>]+name\s*=\s*["']?color-scheme/i,tl=/\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)/gi,sl=/(<(style|script)\b[^>]*>)([\s\S]*?)(<\/\2\s*>)/gi,al=/(\smedia\s*=\s*)("[^"]*"|'[^']*')/gi,ol="(min-width: 0px)",nl="(max-width: 0px)";function il(e,t){let s=(n)=>n.replace(tl,(i,r)=>r.toLowerCase()===t?ol:nl),a=e.replace(sl,(n,i,r,c,l)=>i+s(c)+l).replace(al,(n,i,r)=>i+s(r)),o=`<style data-stx-preview-scheme>:root{color-scheme:${t} !important}</style>`;if(qe.test(a))return a.replace(qe,(n)=>n+o);if(We.test(a))return a.replace(We,(n)=>`${n}<head>${o}</head>`);return o+a}function rl(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ta(e,t={}){let s=ll(e,t);return t.forceScheme?il(s,t.forceScheme):s}function ll(e,t){let s=e==null?"":String(e),a='<base target="_blank">';if(!Zr.test(s))return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="color-scheme" content="light dark"><base target="_blank">${t.title?`<title>${rl(t.title)}</title>`:""}</head><body>${s}</body></html>`;if(Qr.test(s))return s;if(qe.test(s))return s.replace(qe,(o)=>o+'<base target="_blank">');if(We.test(s))return s.replace(We,(o)=>`${o}<head><base target="_blank"></head>`);return'<base target="_blank">'+s}function $x(e){return el.test(e)}function sa(e,t){let s=["fill",...Xs.map((o)=>o.name)],a=s.indexOf(e);return s[((a<0?0:a)+t+s.length)%s.length]}var dl="./PreviewFrame-erbgvzj8.stx";var pl=16,aa="(prefers-color-scheme: dark)",Ae;function hl(){if(Ae!==void 0)return Ae;try{if(typeof matchMedia!=="function"||!document.body)return!0;let e=matchMedia(aa).matches,t=document.createElement("iframe");t.setAttribute("aria-hidden","true"),t.tabIndex=-1,t.style.cssText=`position:absolute;width:1px;height:1px;border:0;opacity:0;pointer-events:none;color-scheme:${e?"light":"dark"}`,document.body.appendChild(t),t.offsetWidth;let s=t.contentWindow?.matchMedia?.(aa).matches;t.remove(),Ae=typeof s==="boolean"?s!==e:!0}catch{Ae=!0}return Ae}class ul{root;callbacks;html;viewportName;frameWidth;frameHeight;landscape;scheme;scripts;forms;title;viewport;scale=1;frame=null;written;stage;device;observer=null;pending=0;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;this.html=t.html??"",this.viewportName=t.viewport||"fill",this.frameWidth=t.frameWidth??null,this.frameHeight=t.frameHeight??null,this.landscape=Boolean(t.landscape),this.scheme=Pt(t.scheme),this.scripts=Boolean(t.scripts),this.forms=Boolean(t.forms),this.title=t.title||"Preview",this.viewport=this.resolve(),this.stage=this.part("stage"),this.device=this.part("device");let a=(n)=>this.onToolbarClick(n),o=(n)=>this.onToolbarKey(n);if(this.root.addEventListener("click",a),this.root.addEventListener("keydown",o),this.disposers.push(()=>this.root.removeEventListener("click",a),()=>this.root.removeEventListener("keydown",o)),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>{cancelAnimationFrame(this.pending),this.pending=requestAnimationFrame(()=>this.layout())}),this.observer.observe(this.stage);this.load(),this.reflect(),this.root.setAttribute("data-preview-ready","")}getState(){return{viewport:this.viewport.name,width:this.viewport.size?.width??null,height:this.viewport.size?.height??null,landscape:this.viewport.landscape,scale:this.scale,scheme:this.scheme,effectiveScheme:this.effectiveScheme()}}setHtml(e){let t=e==null?"":String(e);if(t===this.html)return;this.html=t,this.load()}setViewport(e,t={}){if(this.viewportName=e||"fill","landscape"in t)this.landscape=Boolean(t.landscape);if("width"in t)this.frameWidth=t.width??null;if("height"in t)this.frameHeight=t.height??null;let s=JSON.stringify(this.viewport);if(this.viewport=this.resolve(),this.layout(),this.reflect(),JSON.stringify(this.viewport)!==s)this.callbacks.onViewport?.(this.getState())}setScheme(e){let t=Pt(e);if(t===this.scheme)return;if(this.scheme=t,this.schemeToWrite()!==this.written)this.load();else this.applyScheme();this.reflect(),this.callbacks.onScheme?.(this.getState())}setPermissions(e){let t=e.scripts??this.scripts,s=e.forms??this.forms;if(t===this.scripts&&s===this.forms)return;this.scripts=t,this.forms=s,this.load()}reload(){this.load(),this.callbacks.onReload?.(this.getState())}destroy(){this.observer?.disconnect(),cancelAnimationFrame(this.pending);for(let e of this.disposers)e();this.frame?.remove(),this.frame=null,this.root.removeAttribute("data-preview-ready")}part(e){let t=this.root.querySelector(`[data-pf="${e}"]`);if(!t)throw Error(`PreviewFrame: the template has no ${e} part`);return t}resolve(){return At(this.viewportName,{width:this.frameWidth,height:this.frameHeight,landscape:this.landscape})}effectiveScheme(){if(this.scheme!=="auto")return this.scheme;if(this.root.closest(".dark"))return"dark";if(this.root.closest(".light"))return"light";return typeof matchMedia==="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}schemeToWrite(){if(hl())return;if(this.scheme==="auto"&&!this.root.closest(".dark, .light"))return;return this.effectiveScheme()}load(){let e=document.createElement("iframe");e.setAttribute("sandbox",ea({scripts:this.scripts,forms:this.forms})),e.setAttribute("referrerpolicy","no-referrer"),e.setAttribute("title",this.title),e.setAttribute("data-pf","frame"),e.className="stx-preview-frame",e.addEventListener("load",()=>{if(e===this.frame)this.callbacks.onLoad?.(this.getState())}),this.written=this.schemeToWrite(),e.srcdoc=ta(this.html,{title:this.title,forceScheme:this.written}),this.frame?.remove(),this.frame=e,this.applyScheme(),this.device.appendChild(e),this.layout()}applyScheme(){let e=this.effectiveScheme();if(this.root.setAttribute("data-scheme",e),this.frame)this.frame.style.colorScheme=e}layout(){let e=this.frame;if(!e)return;let t=this.viewport.size;if(this.root.setAttribute("data-viewport",this.viewport.name),!t)this.scale=1,this.device.style.width="",this.device.style.height="",e.style.width="",e.style.height="",e.style.transform="";else{let a=this.stage.getBoundingClientRect();this.scale=Zs(t,{width:a.width,height:a.height},pl),this.device.style.width=`${t.width*this.scale}px`,this.device.style.height=`${t.height*this.scale}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.style.transform=this.scale===1?"":`scale(${this.scale})`}let s=this.root.querySelector('[data-pf="size"]');if(s)s.textContent=Qs(this.viewport,this.scale)}reflect(){for(let a of this.root.querySelectorAll("[data-pf-viewport]")){let o=a.getAttribute("data-pf-viewport")===this.viewport.name;a.setAttribute("aria-checked",String(o)),a.tabIndex=o?0:-1}if(!this.root.querySelector('[data-pf-viewport][tabindex="0"]'))this.root.querySelector("[data-pf-viewport]")?.setAttribute("tabindex","0");let e=this.effectiveScheme()==="dark",t=this.root.querySelector('[data-pf-action="scheme"]');if(t){t.setAttribute("aria-pressed",String(e));let a=t.querySelector('[data-pf="scheme-text"]');if(a)a.textContent=e?"Dark":"Light"}let s=this.root.querySelector('[data-pf-action="rotate"]');if(s){let a=At(this.viewportName,{width:this.frameWidth,height:this.frameHeight}).size;s.disabled=!a||this.viewport.name==="custom"||a.height<=a.width,s.setAttribute("aria-pressed",String(this.viewport.landscape))}}onToolbarClick(e){let t=e.target instanceof Element?e.target.closest("[data-pf-viewport], [data-pf-action]"):null;if(!t||!this.root.contains(t))return;let s=t.getAttribute("data-pf-viewport");if(s){this.setViewport(s,{width:null,height:null});return}switch(t.getAttribute("data-pf-action")){case"scheme":this.setScheme(this.effectiveScheme()==="dark"?"light":"dark");break;case"rotate":this.setViewport(this.viewportName,{landscape:!this.landscape});break;case"reload":this.reload();break}}onToolbarKey(e){let t=e.target instanceof Element?e.target.closest("[data-pf-viewport]"):null;if(!t)return;let s=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(s===0)return;e.preventDefault();let a=t.getAttribute("data-pf-viewport")||"fill",o=sa(a,s);this.setViewport(o,{width:null,height:null}),this.root.querySelector(`[data-pf-viewport="${o}"]`)?.focus()}}var ml="./Progress-2qzb77kc.stx";var xl="./Radio-8153x74w.stx";var vl="./RadioGroup-ps9kn22f.stx";var yl="./RadioGroupDescription-z34r9avr.stx";var Sl="./RadioGroupLabel-ka0hfm7b.stx";var $l="./RadioGroupOption-6hyy1bvb.stx";var El="./SegmentedControl-b93n9n2v.stx";var Al="./Select-p8mgxthn.stx";var Z={NONE:0,KEYWORD:1,SUBSTRING:2,WORD_PREFIX:3,PREFIX:4},tb=700,Ge=1600;function ve(e){return`stx:settings:${e}`}function U(e,t){if(!t)return null;return e.find((s)=>s.id===t)??null}function Pl(e){return(e.find((s)=>!s.parent)??e[0])?.id??""}function Ue(e,...t){for(let s of t)if(U(e,s))return s;return Pl(e)}function Je(e,t){let s=new Set,a=U(e,t);while(a&&a.parent&&!s.has(a.id)){s.add(a.id);let o=U(e,a.parent);if(!o)break;a=o}return a?.id??""}function he(e,t){let s=U(e,t);if(!s?.parent||s.parent===t)return"";return U(e,s.parent)?s.parent:""}function Ye(){return{trail:[],cursor:-1}}function ue(e){return e.trail[e.cursor]??""}function Pe(e,t){if(!t||ue(e)===t)return e;let s=[...e.trail.slice(0,e.cursor+1),t];return{trail:s,cursor:s.length-1}}function Me(e){return e.cursor<e.trail.length-1}function Xe(e,t=[]){if(e.cursor>0)return!0;return e.cursor===0&&he(t,ue(e))!==""}function Ze(e,t=[]){if(e.cursor>0)return{trail:e.trail,cursor:e.cursor-1};if(e.cursor===0){let s=he(t,ue(e));if(s)return{trail:[s,...e.trail],cursor:0}}return e}function Qe(e){return Me(e)?{trail:e.trail,cursor:e.cursor+1}:e}function pe(e){return String(e??"").normalize("NFD").replace(/[\u0300-\u036F]/g,"").toLowerCase().replace(/\s+/g," ").trim()}function oa(e,t){let s=e.indexOf(t);while(s!==-1){if(s===0||!/[\p{L}\p{N}]/u.test(e.charAt(s-1)))return!0;s=e.indexOf(t,s+1)}return!1}function na(e,t,s){if(t.startsWith(e))return Z.PREFIX;if(oa(t,e))return Z.WORD_PREFIX;if(t.includes(e))return Z.SUBSTRING;if(oa(s,e))return Z.KEYWORD;return Z.NONE}function ia(e,t,s=""){let a=pe(e);if(a==="")return Z.NONE;let o=pe(t),n=pe(s),i=na(a,o,n),r=a.split(" ");if(i!==Z.NONE||r.length===1)return i;let c=Z.PREFIX;for(let l of r){let d=na(l,o,n);if(d===Z.NONE)return Z.NONE;c=Math.min(c,d===Z.PREFIX&&l!==r[0]?Z.WORD_PREFIX:d)}return c}function et(e,t){let s=pe(e);if(s==="")return{query:"",panes:[],settings:[]};let a=[];for(let n of t.items){let i=U(t.panes,n.id),r=`${n.keywords??""} ${i?.keywords??""} ${i&&i.title!==n.label?i.title:""}`;if(ia(s,n.label,r)!==Z.NONE)a.push(n.id)}let o=[];return t.rows.forEach((n,i)=>{if(!n.label)return;let c=U(t.panes,n.pane)?.title??"",l=ia(s,n.label,`${n.keywords??""} ${c}`);if(l!==Z.NONE)o.push({id:n.id,label:n.label,pane:n.pane,paneTitle:c,row:i,rank:l})}),o.sort((n,i)=>i.rank-n.rank||n.row-i.row),{query:s,panes:a,settings:o}}function ra(e){if(e<=0)return"No results";return e===1?"1 result":`${e} results`}function Mt(e,t,s){if(s<=0)return-1;if(e==="ArrowDown")return Math.min(s-1,t+1);if(e==="ArrowUp")return t<0?s-1:Math.max(0,t-1);if(e==="Home")return 0;if(e==="End")return s-1;return-1}function la(e,t,s,a=700){return{buffer:(!e||s-e.at>a?"":e.buffer)+pe(t),at:s}}function ca(e,t,s){let a=e.length,o=pe(t);if(a===0||o==="")return-1;let n=o.split("").every((c)=>c===o.charAt(0)),i=n?o.charAt(0):o,r=n?s+1:Math.max(0,s);for(let c=0;c<a;c++){let l=((r+c)%a+a)%a;if(pe(e[l]).startsWith(i))return l}return-1}var Nl="./SettingsGroup-g1hnxp1p.stx";var Ll="./SettingsPane-9svk1w3e.stx";var Dl="./SettingsPaneHeader-am42srhp.stx";var Hl="./SettingsRow-kgda3nv1.stx";var jl="./SettingsSidebarGroup-4ag5qjpw.stx";var Bl="./SettingsSidebarItem-ga2jxq53.stx";var Kl="./SettingsUpdateRow-ajpnqx8a.stx";var Wl="./SettingsWindow-586aps08.stx";var Gl="data-stx-settings",we="data-settings-item",ye="data-settings-pane",Ul="data-settings-row";class Jl{tree;root;options;callbacks;history=Ye();current="";query="";hits=[];highlighted=null;highlightTimer=null;pressed=new Map;visible=new Map;disposers=[];destroyed=!1;constructor(e,t,s={},a={}){this.tree=e;this.root=t;this.options=s;this.callbacks=a;this.hear(),this.disposers.push(e.observeChildren(t,()=>{if(this.destroyed)return;this.hear(),this.show(!1),this.applySearch(!1)}));let o=this.panes(),n=this.paneNodes().find((i)=>this.tree.getAttribute(i,"data-active")!=null);this.history=Pe(this.history,Ue(o,this.stored(),s.pane,n?this.attribute(n,ye):"")),this.show(!0),this.applySearch(!1)}getPane(){return this.current}showPane(e){if(!U(this.panes(),e))return!1;return this.open(e),!0}revealSetting(e){if(!e)return!1;let t=this.rowNodes().find((a)=>this.attribute(a,"data-setting")===e),s=t?this.paneOf(t):"";if(!t||!s)return!1;return this.open(s),this.reveal(t),!0}back(){this.travel(Ze(this.history,this.panes()))}forward(){this.travel(Qe(this.history))}search(e){this.query=String(e??""),this.applySearch(!0)}chooseResult(e){let t=this.hits[e];if(!t||this.tree.parent(t.row)===null)return;this.open(t.hit.pane),this.reveal(t.row)}destroy(){this.destroyed=!0;for(let e of this.disposers)e();this.disposers.length=0;for(let e of this.pressed.values())e();this.pressed.clear(),this.visible.clear(),this.clearHighlight()}attribute(e,t){return this.tree.getAttribute(e,t)??""}toggle(e,t){let s=this.attribute(e,"class").split(/\s+/).filter(Boolean),a=this.visible.has(e)?this.visible.get(e):!s.includes("hidden");if(this.visible.set(e,t),a===t)return;let o=s.filter((n)=>n!=="hidden");this.tree.setAttribute(e,"class",(t?o:[...o,"hidden"]).join(" "))}has(e,t){return this.tree.getAttribute(e,t)!=null}closest(e,t){for(let s=e;s;s=this.tree.parent(s))if(this.has(s,t))return s;return null}all(e,t=this.root){return this.tree.descendants(t).filter((s)=>this.has(s,e)&&this.closest(this.tree.parent(s),Gl)===this.root)}paneNodes(){return this.all(ye)}panes(){return this.paneNodes().map((e)=>{let t=this.attribute(e,ye);return{id:t,title:this.attribute(e,"data-title")||t,keywords:this.attribute(e,"data-keywords"),parent:this.attribute(e,"data-parent")}})}itemNodes(){return this.all(we)}items(){return this.itemNodes().map((e)=>({id:this.attribute(e,we),label:this.attribute(e,"data-label").trim(),keywords:this.attribute(e,"data-keywords")}))}rowNodes(){return this.all(Ul).filter((e)=>this.paneOf(e)!=="")}paneOf(e){let t=this.closest(e,ye);return t?this.attribute(t,ye):""}stored(){if(!this.options.storageKey||!this.options.storage)return"";try{return this.options.storage.get(ve(this.options.storageKey))||""}catch{return""}}store(){if(!this.options.storageKey||!this.options.storage||!this.current)return;try{this.options.storage.set(ve(this.options.storageKey),this.current)}catch{}}hear(){let e=new Set;for(let t of this.itemNodes())if(e.add(t),!this.pressed.has(t))this.pressed.set(t,this.tree.listen(t,"click",()=>this.open(this.attribute(t,we))));for(let t of this.rowNodes()){if(!this.has(t,"data-navigate"))continue;if(e.add(t),!this.pressed.has(t))this.pressed.set(t,this.tree.listen(t,"click",()=>this.navigate(t)))}for(let[t,s]of this.pressed){if(e.has(t))continue;s(),this.pressed.delete(t)}}navigate(e){if(this.attribute(e,"aria-disabled")==="true")return;let t=this.attribute(e,"data-navigate");if(!U(this.panes(),t))return;let s=this.current;this.open(t),this.callbacks.onNavigate?.({id:t,from:s,setting:this.attribute(e,"data-setting")})}open(e){if(!e)return;this.history=Pe(this.history,e),this.show(!0)}travel(e){if(e===this.history)return;this.history=e,this.show(!0)}show(e){let t=this.panes(),s=ue(this.history),a=U(t,s);if(!a)return;for(let i of this.paneNodes())this.toggle(i,this.attribute(i,ye)===s);let o=Je(t,s);for(let i of this.itemNodes()){let r=this.attribute(i,we)===o;for(let c of[i,...this.tree.descendants(i)])this.tree.setAttribute(c,"aria-selected",r?"true":"false")}let n=this.current!==s;if(this.current=s,this.report(),n){if(this.store(),e)this.callbacks.onPane?.({id:s,title:a.title,parent:he(t,s)})}}report(){let e=this.panes(),t=U(e,this.current),s=this.query.trim()!=="";this.callbacks.onState?.({pane:this.current,title:t?.title??"",canGoBack:Xe(this.history,e),canGoForward:Me(this.history),query:this.query,searching:s,results:this.hits.map(({hit:a},o)=>({position:o,label:a.label,pane:a.paneTitle})),empty:s&&this.shownItems===0&&this.hits.length===0})}shownItems=0;applySearch(e){let t=this.rowNodes(),s=t.map((r)=>({id:this.attribute(r,"data-setting"),label:this.attribute(r,"data-label").trim(),keywords:this.attribute(r,"data-keywords"),pane:this.paneOf(r)})),a=et(this.query,{panes:this.panes(),items:this.items(),rows:s}),o=a.query!=="",n=new Set;for(let r of this.itemNodes()){let c=!o||a.panes.includes(this.attribute(r,we));if(c)n.add(r);this.toggle(r,c)}this.shownItems=o?a.panes.length:n.size;let i=!0;for(let r of this.all("data-settings-group")){let c=this.all(we,r).some((l)=>n.has(l));this.toggle(r,c);for(let l of this.all("data-settings-group-gap",r))this.toggle(l,c&&!i);if(c)i=!1}for(let r of this.all("data-settings-account"))this.toggle(r,!o);if(this.hits=a.settings.map((r)=>({hit:r,row:t[r.row]})),this.report(),e)this.callbacks.onSearch?.({query:this.query.trim(),panes:a.panes,settings:a.settings.map((r)=>({id:r.id,label:r.label,pane:r.pane}))})}reveal(e){this.clearHighlight(),this.tree.setAttribute(e,"data-highlight","");let t=this.options.wash?.();if(t)this.tree.setStyle(e,{backgroundColor:t});this.highlighted=e,this.highlightTimer=setTimeout(()=>this.clearHighlight(),Ge)}clearHighlight(){if(this.highlightTimer)clearTimeout(this.highlightTimer);if(this.highlightTimer=null,this.highlighted)this.tree.removeAttribute(this.highlighted,"data-highlight"),this.tree.setStyle(this.highlighted,{backgroundColor:"transparent"});this.highlighted=null}}var ub={grey:"bg-[#8e8e93] dark:bg-[#8e8e93]",blue:"bg-[#007aff] dark:bg-[#0a84ff]",red:"bg-[#ff3b30] dark:bg-[#ff453a]",orange:"bg-[#ff9500] dark:bg-[#ff9f0a]",yellow:"bg-[#ffcc00] dark:bg-[#ffd60a]",green:"bg-[#34c759] dark:bg-[#30d158]",indigo:"bg-[#5856d6] dark:bg-[#5e5ce6]",purple:"bg-[#af52de] dark:bg-[#bf5af2]",pink:"bg-[#ff2d55] dark:bg-[#ff375f]",ink:"bg-[#1d1d1f] dark:bg-[#dcdce0]"};function fb(e){return e==="ink"?"text-[#ffffff] dark:text-[#1d1d1f]":"text-[#ffffff]"}var le="text-[#000000]/85 dark:text-[#ffffff]/85",ee="text-[#000000]/50 dark:text-[#ffffff]/55",da="text-[#000000]/26 dark:text-[#ffffff]/25",Nt="text-[#ff3b30] dark:text-[#ff453a]",Yl="text-[#007aff] dark:text-[#0a84ff]",Xl="aria-selected:bg-[#007aff] dark:aria-selected:bg-[#0a84ff]",pa="aria-selected:text-[#ffffff] dark:aria-selected:text-[#ffffff]",Zl="bg-[#000000]/10 dark:bg-[#ffffff]/10",ha="bg-[#000000]/4 dark:bg-[#ffffff]/5",mb={shell:"flex-1 flex-row",sidebar:"flex-col bg-[#f2f1f0] dark:bg-[#2a2a2a]",sidebarWidth:226,sidebarMaterial:"sidebar",sidebarTop:"pt-[38px] px-[9px] pb-[6px]",search:"h-[28px] text-[13px]",nav:"flex-1 flex-col px-[9px] pb-[12px]",account:"mt-[7px]",list:"flex-col pt-[7px]",results:"flex-col gap-[2px] pt-[7px]",result:"flex-col justify-center min-h-[38px] px-[8px] py-[4px] rounded-[8px] hover:bg-[#000000]/5 dark:hover:bg-[#ffffff]/6",resultLabel:`text-[13px] ${le}`,resultPane:`text-[11px] ${ee}`,empty:`py-[24px] px-[8px] text-[13px] text-center ${ee}`,group:"flex-col gap-[2px]",groupGap:"h-[11px]",groupLabel:`px-[8px] pb-[3px] text-[11px] font-semibold ${ee}`,item:`flex-row items-center gap-[8px] h-[30px] px-[8px] rounded-[8px] ${Xl}`,itemTile:"h-[20px] w-[20px] rounded-[5.5px] items-center justify-center",itemGlyph:"h-[13px] w-[13px]",itemLabel:`flex-1 text-[13px] ${le} ${pa}`,itemBadge:`text-[11px] ${ee} ${pa}`,detail:"flex-1 flex-col bg-[#ffffff] dark:bg-[#1e1e1e]",toolbar:"flex-row items-center gap-[12px] h-[52px] pl-[8px] pr-[16px]",history:"flex-row items-center",historyButton:`text-[15px] ${ee}`,title:`flex-1 text-[20px] font-semibold ${le}`,body:"flex-1 flex-col",pane:"flex-1",paneContent:"flex-col px-[20px] pt-[11px] pb-[20px]",hero:`flex-col items-center mb-[10px] p-[22px] rounded-[12px] ${ha}`,heroTile:"h-[48px] w-[48px] rounded-[12px] items-center justify-center",heroGlyph:"h-[30px] w-[30px]",heroTitle:`mt-[10px] text-[17px] font-semibold text-center ${le}`,heroDescription:`mt-[4px] text-[13px] text-center ${ee}`,heroExtra:"mt-[8px] flex-col items-center",section:"flex-col mb-[10px]",sectionHeader:`pt-[18px] px-[10px] pb-[8px] text-[13px] font-bold ${le}`,card:`flex-col rounded-[12px] ${ha}`,sectionFooter:`pt-[6px] px-[10px] text-[11px] ${ee}`,rowRule:`mx-[10px] h-[0.5px] ${Zl}`,row:"flex-row items-center gap-[10px] min-h-[38px] px-[10px]",rowTall:"min-h-[44px]",rowMultiline:"items-start",rowStacked:"flex-col items-stretch gap-[4px] min-h-[38px] px-[10px]",rowPressed:"active:bg-[#000000]/5 dark:active:bg-[#ffffff]/6",rowWash:{light:"#007aff33",dark:"#0a84ff33"},rowTile:"h-[24px] w-[24px] rounded-[6px] items-center justify-center",rowTileMultiline:"mt-[10px]",rowGlyph:"h-[15px] w-[15px]",rowText:"flex-1 flex-col justify-center py-[7px]",rowTextMultiline:"flex-1 flex-col py-[10px]",rowTextStacked:"flex-col pt-[10px]",rowLabel:`text-[13px] ${le}`,rowLabelDestructive:`text-[13px] ${Nt}`,rowDescription:`mt-[1px] text-[11px] ${ee}`,rowControl:"flex-row items-center justify-end gap-[8px]",rowControlMultiline:"flex-row items-center justify-end gap-[8px] py-[10px]",rowControlStacked:"flex-col items-stretch pb-[7px]",rowValue:`text-[13px] ${ee}`,rowChevron:`h-[11px] w-[11px] ${da}`,rowDisabled:"opacity-50",appearance:"flex-row gap-[14px]",appearanceOption:"flex-col items-center gap-[5px]",appearanceFrame:"p-[3px] rounded-[9px] border-2 border-transparent aria-checked:border-[#007aff] dark:aria-checked:border-[#0a84ff]",appearanceThumb:"h-[44px] w-[67px] flex-row rounded-[6px] overflow-hidden",appearanceLight:"flex-1 bg-[#e9e9eb]",appearanceDark:"flex-1 bg-[#2c2c2e]",appearanceCaption:`text-[11px] ${le}`,updateStatus:`mt-[1px] text-[11px] ${ee}`,updateError:`mt-[1px] text-[11px] ${Nt}`,updateProgress:`text-[11px] ${ee}`,ink:le,inkSecondary:ee,inkTertiary:da,danger:Nt,accentText:Yl},gb={back:"chevron.left",forward:"chevron.right",disclosure:"chevron.right"};var Ql={check:"Check Now",install:"Download and Install",relaunch:"Restart to Update"};function ec(e){let t=Number(e);if(!Number.isFinite(t))return"";return`${Math.round(Math.min(1,Math.max(0,t))*100)}%`}function bb(e,t=""){let s=String(t||"").trim(),a=String(e?.currentVersion||"").trim(),o=[s,a].filter(Boolean).join(" "),n=(h,p,u={})=>({title:o,sentence:h,action:p,actionLabel:p?Ql[p]:"",busy:!1,progress:"",failed:!1,...u});if(!e||typeof e.state!=="string")return n("",null);let i=s||"This app",r=String(e.version||"").trim(),c=r?`Version ${r}`:"An update",l=e.selfUpdating!==!1,d=String(e.reason||"").trim();switch(e.state){case"unavailable":return n(d||`${i} cannot update itself.`,null);case"idle":return n("Check for a newer version.","check");case"checking":return n("Checking for updates...","check",{busy:!0});case"current":return n(`${i} is up to date.`,"check");case"available":return l?n(`${c} is available.`,"install"):n(`${c} is available. ${d||`${i} cannot update itself.`}`,"check");case"downloading":return n(`Downloading ${r?`version ${r}`:"the update"}...`,"install",{busy:!0,progress:ec(e.progress)});case"installing":return n(`Installing ${r?`version ${r}`:"the update"}...`,"install",{busy:!0});case"installed":return n(`${c} is installed. Restart ${i} to finish updating.`,"relaunch");case"error":return n(String(e.error||"").trim()||"The update could not be completed.","check",{failed:!0});default:return n("",null)}}var Rt="[data-stx-settings]",tt="[data-settings-item]",ua="[data-settings-pane]",tc="[data-settings-row]",Lt="[data-settings-result]",sc='button, a[href], input, select, textarea, label, [role="switch"], [role="checkbox"], [role="radio"], [role="slider"], [role="button"], [contenteditable]';function fa(e){return e.replace(/[^\w-]+/g,"-")}class ac{root;callbacks;history=Ye();current="";query="";storageKey;typed=null;hits=[];highlighted=null;highlightTimer=null;disposers=[];list;account;input;field;results;empty;live;backButton;forwardButton;title;body;constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.storageKey=t.storageKey||"",!e.id)e.id=`settings-${Math.random().toString(36).slice(2,8)}`;this.list=this.own("[data-settings-list]"),this.account=this.own("[data-settings-account]"),this.input=this.own("[data-settings-search-input]"),this.field=this.own("[data-settings-search]"),this.results=this.own("[data-settings-results]"),this.empty=this.own("[data-settings-empty]"),this.live=this.own("[data-settings-live]"),this.backButton=this.own("[data-settings-back]"),this.forwardButton=this.own("[data-settings-forward]"),this.title=this.own("[data-settings-title]"),this.body=this.own("[data-settings-body]");for(let n of[this.results,this.live,this.title])if(n)n.__stx_inert_content=!0;if(this.listen(e,"click",(n)=>this.onClick(n)),this.listen(t.globalKeys?document:e,"keydown",(n)=>this.onKeyDown(n)),this.input)this.listen(this.input,"input",()=>this.search(this.input.value));if(this.body)this.listen(this.body,"scroll",()=>this.syncScrolled(),{passive:!0});this.listen(window,"focus",()=>e.setAttribute("data-stx-window-active","true")),this.listen(window,"blur",()=>e.setAttribute("data-stx-window-active","false")),this.describe();let a=this.panes(),o=this.paneElements().find((n)=>!n.hidden)?.getAttribute("data-settings-pane");this.open(Ue(a,this.stored(),t.pane,o)),e.setAttribute("data-settings-ready","")}getPane(){return this.current}showPane(e){if(!U(this.panes(),e))return!1;return this.open(e),!0}revealSetting(e){if(!e)return!1;let t=this.rowElements().find((a)=>a.getAttribute("data-setting")===e),s=t?this.paneOf(t):"";if(!t||!s)return!1;return this.open(s),this.reveal(t),!0}back(){this.travel(Ze(this.history,this.panes()))}forward(){this.travel(Qe(this.history))}focusSearch(){if(!this.input)return;this.input.focus(),this.input.select()}search(e){if(this.query=e,this.input&&this.input.value!==e)this.input.value=e;this.applySearch(!0)}destroy(){for(let e of this.disposers)e();this.disposers.length=0,this.clearHighlight(),this.root.removeAttribute("data-settings-ready")}own(e){return this.all(e)[0]??null}all(e,t=this.root){return Array.from(t.querySelectorAll(e)).filter((s)=>s.closest(Rt)===this.root)}listen(e,t,s,a){e.addEventListener(t,s,a),this.disposers.push(()=>e.removeEventListener(t,s,a))}paneElements(){return this.all(ua)}paneElement(e){return this.paneElements().find((t)=>t.getAttribute("data-settings-pane")===e)??null}panes(){return this.paneElements().map((e)=>({id:e.getAttribute("data-settings-pane")||"",title:e.getAttribute("data-title")||e.getAttribute("data-settings-pane")||"",keywords:e.getAttribute("data-keywords")||"",parent:e.getAttribute("data-parent")||""})).filter((e)=>e.id!=="")}itemElements(){return this.list?this.all(tt,this.list):[]}visibleItems(){return this.itemElements().filter((e)=>!e.hidden&&!e.disabled)}labelOf(e){return(e.querySelector(".stx-settings-item-label")?.textContent||e.getAttribute("aria-label")||e.textContent||"").trim()}items(){return this.itemElements().map((e)=>({id:e.getAttribute("data-settings-item")||"",label:this.labelOf(e),keywords:e.getAttribute("data-keywords")||""}))}rowElements(){return this.all(tc).filter((e)=>this.paneOf(e)!=="")}paneOf(e){return e.closest(ua)?.getAttribute("data-settings-pane")||""}stored(){if(!this.storageKey)return"";try{return localStorage.getItem(ve(this.storageKey))||""}catch{return""}}store(){if(!this.storageKey||!this.current)return;try{localStorage.setItem(ve(this.storageKey),this.current)}catch{}}describe(){let e=this.root.id,t=new Map;for(let s of this.itemElements()){let a=s.getAttribute("data-settings-item")||"";if(!s.id)s.id=`${e}-item-${fa(a)}`;s.setAttribute("role","tab"),t.set(a,s);for(let o=s.parentElement;o&&o!==this.list;o=o.parentElement)if(!o.hasAttribute("role"))o.setAttribute("role","presentation")}for(let s of this.paneElements()){let a=s.getAttribute("data-settings-pane")||"";if(!s.id)s.id=`${e}-pane-${fa(a)}`;let o=t.get(a);if(o)o.setAttribute("aria-controls",s.id),s.setAttribute("role","tabpanel"),s.setAttribute("aria-labelledby",o.id),s.removeAttribute("aria-label");else if(this.title?.id){if(s.setAttribute("role","region"),!s.hasAttribute("aria-label"))s.setAttribute("aria-label",s.getAttribute("data-title")||a)}}}open(e){if(!e)return;this.history=Pe(this.history,e),this.show()}travel(e){if(e===this.history)return;this.history=e,this.show()}show(){this.describe();let e=this.panes(),t=ue(this.history),s=U(e,t),a=this.paneElement(t);if(!s||!a)return;let o=document.activeElement,n=o instanceof HTMLElement&&this.paneElements().some((c)=>c!==a&&c.contains(o));for(let c of this.paneElements())c.hidden=c!==a,c.toggleAttribute("data-active",c===a);let i=Je(e,t);for(let c of this.itemElements()){let l=c.getAttribute("data-settings-item")===i;c.setAttribute("aria-selected",l?"true":"false"),c.toggleAttribute("data-active",l)}if(this.syncTabStops(),this.title)this.title.textContent=s.title;this.root.setAttribute("data-pane",t),this.root.toggleAttribute("data-subpane",he(e,t)!==""),this.syncHistoryButtons(e);let r=t!==this.current;if(this.current=t,r){if(this.clearHighlight(),this.body)this.body.scrollTop=0;if(this.syncScrolled(),n){if(!a.hasAttribute("tabindex"))a.setAttribute("tabindex","-1");a.focus({preventScroll:!0})}this.store(),this.callbacks.onPane?.({id:t,title:s.title,parent:he(e,t)})}}syncTabStops(){let e=this.visibleItems(),t=e.find((s)=>s.getAttribute("aria-selected")==="true")??e[0];for(let s of this.itemElements())s.setAttribute("tabindex",s===t?"0":"-1")}syncHistoryButtons(e){let t=(o,n,i)=>{if(!o)return;let r=document.activeElement===o;if(o.disabled=!n,r&&!n&&i&&!i.disabled)i.focus()},s=Xe(this.history,e),a=Me(this.history);if(s)t(this.backButton,!0,null),t(this.forwardButton,a,this.backButton);else t(this.forwardButton,a,null),t(this.backButton,!1,this.forwardButton)}syncScrolled(){this.root.toggleAttribute("data-scrolled",Boolean(this.body&&this.body.scrollTop>0))}applySearch(e){let t=this.rowElements(),s=t.map((i)=>({id:i.getAttribute("data-setting")||"",label:(i.getAttribute("data-label")||"").trim(),keywords:i.getAttribute("data-keywords")||"",pane:this.paneOf(i)})),a=et(this.query,{panes:this.panes(),items:this.items(),rows:s}),o=a.query!=="";this.root.toggleAttribute("data-searching",o),this.field?.toggleAttribute("data-filled",this.query!=="");for(let i of this.itemElements())i.hidden=o&&!a.panes.includes(i.getAttribute("data-settings-item")||"");if(this.list){for(let i of this.all("[data-settings-group]",this.list))i.hidden=o&&this.all(tt,i).every((r)=>r.hidden);this.list.hidden=o&&a.panes.length===0}if(this.account)this.account.hidden=o;this.hits=a.settings.map((i)=>({hit:i,row:t[i.row]})),this.drawResults();let n=a.panes.length+a.settings.length;if(this.empty)this.empty.hidden=!o||n>0;if(this.live)this.live.textContent=o?ra(n):"";if(this.syncTabStops(),e)this.callbacks.onSearch?.({query:this.query.trim(),panes:a.panes,settings:a.settings.map((i)=>({id:i.id,label:i.label,pane:i.pane}))})}drawResults(){let e=this.results;if(!e)return;e.replaceChildren(),e.hidden=this.hits.length===0,this.hits.forEach(({hit:t},s)=>{let a=document.createElement("button");a.type="button",a.className="stx-settings-result",a.setAttribute("data-settings-result",String(s)),a.setAttribute("tabindex","-1");let o=document.createElement("span");o.className="stx-settings-result-label",o.textContent=t.label;let n=document.createElement("span");n.className="stx-settings-result-pane",n.textContent=t.paneTitle,a.append(o,n),e.append(a)})}chooseResult(e){let t=this.hits[e];if(!t||!t.row.isConnected)return;this.open(t.hit.pane),this.reveal(t.row)}clearSearch(){if(this.query===""&&(!this.input||this.input.value===""))return;this.search("")}reveal(e){if(this.body){let t=this.body.getBoundingClientRect(),s=e.getBoundingClientRect();this.body.scrollTop+=s.top-t.top-(t.height-s.height)/2,this.syncScrolled()}this.clearHighlight(),e.setAttribute("data-highlight",""),this.highlighted=e,this.highlightTimer=setTimeout(()=>this.clearHighlight(),Ge)}clearHighlight(){if(this.highlightTimer)clearTimeout(this.highlightTimer);this.highlightTimer=null,this.highlighted?.removeAttribute("data-highlight"),this.highlighted=null}inside(e){return e instanceof Element&&e.closest(Rt)===this.root}navigationRow(e){let t=e.closest("[data-navigate]");if(!t||t.closest(Rt)!==this.root||t.getAttribute("aria-disabled")==="true")return null;let s=e.closest(sc);if(s&&s!==t&&t.contains(s))return null;return t}navigate(e){let t=e.getAttribute("data-navigate")||"";if(!U(this.panes(),t))return;let s=this.current;this.open(t),this.callbacks.onNavigate?.({id:t,from:s,setting:e.getAttribute("data-setting")||""})}onClick(e){let t=e.target;if(!this.inside(t))return;let s=t.closest(tt);if(s&&this.list?.contains(s)){this.open(s.getAttribute("data-settings-item")||"");return}let a=t.closest(Lt);if(a){this.chooseResult(Number(a.getAttribute("data-settings-result")));return}if(t.closest("[data-settings-back]")){this.back();return}if(t.closest("[data-settings-forward]")){this.forward();return}if(t.closest("[data-settings-search-clear]")){this.clearSearch(),this.input?.focus();return}let o=this.navigationRow(t);if(o)this.navigate(o)}onKeyDown(e){if(e.defaultPrevented)return;let t=(e.metaKey||e.ctrlKey)&&!e.altKey;if(t&&!e.shiftKey){let n=e.key.toLowerCase();if(n==="f"&&this.input){e.preventDefault(),this.focusSearch();return}if(n==="["){e.preventDefault(),this.back();return}if(n==="]"){e.preventDefault(),this.forward();return}}let s=e.target;if(!this.inside(s))return;if(e.key==="Escape"&&this.query!==""){e.preventDefault(),this.clearSearch(),this.visibleItems().find((n)=>n.getAttribute("tabindex")==="0")?.focus();return}if(s===this.input){this.onSearchKey(e);return}let a=s.closest(Lt);if(a){this.onResultKey(e,a);return}let o=s.closest(tt);if(o&&this.list?.contains(o)){this.onItemKey(e,o);return}if((e.key==="Enter"||e.key===" ")&&!t&&!e.altKey){let n=s.closest("[data-navigate]");if(n&&n===s&&this.navigationRow(s))e.preventDefault(),this.navigate(n)}}resultButtons(){return this.results?Array.from(this.results.querySelectorAll(Lt)):[]}onSearchKey(e){if(e.key==="ArrowDown"){let t=this.visibleItems()[0]??this.resultButtons()[0];if(t)e.preventDefault(),t.focus()}else if(e.key==="Enter"&&this.query.trim()!==""){e.preventDefault();let t=this.visibleItems()[0];if(t)this.open(t.getAttribute("data-settings-item")||"");else this.chooseResult(0)}}onResultKey(e,t){let s=this.resultButtons(),a=s.indexOf(t);if(e.key==="ArrowUp"&&a===0){let n=this.visibleItems(),i=n[n.length-1]??this.input;if(i)e.preventDefault(),i.focus();return}let o=Mt(e.key,a,s.length);if(o===-1)return;e.preventDefault(),s[o].focus()}onItemKey(e,t){if(e.metaKey||e.ctrlKey||e.altKey)return;let s=this.visibleItems(),a=s.indexOf(t);if(e.key==="ArrowDown"&&a===s.length-1){let n=this.resultButtons()[0];if(n){e.preventDefault(),n.focus();return}}let o=Mt(e.key,a,s.length);if(o===-1&&e.key.length===1&&(e.key!==" "||this.typed!==null)){let n=la(this.typed,e.key,Date.now());if(e.key===" "&&n.buffer.trim()===""){this.typed=null;return}if(this.typed=n,o=ca(s.map((i)=>this.labelOf(i)),n.buffer,a),o===-1){e.preventDefault();return}}if(o===-1)return;e.preventDefault(),s[o].focus(),this.open(s[o].getAttribute("data-settings-item")||"")}}var nc="./Sidebar-8dygywjv.stx";var rc="./SidebarFooter-s7skj92y.stx";var cc="./SidebarHeader-x7jdhmyr.stx";var pc="./SidebarItem-64sjb2fe.stx";var uc="./SidebarPinned-48kyk193.stx";var mc="./SidebarSection-vx5bahsk.stx";var xc="./SidebarSpace-bwv98azf.stx";var vc="./SidebarSpaces-mdtrynr2.stx";var yc="./SidebarSpaceSwitcher-1mycft2g.stx";var st={blue:"#0088ff",red:"#ff383c",pink:"#ff2d55",orange:"#ff8d28",yellow:"#ffcc00",green:"#34c759",teal:"#00c3d0",cyan:"#00c0e8",indigo:"#6155f5",purple:"#cb30e0",brown:"#ac7f5e",gray:"#8e8e93"},fe={pane:["bg-[#f2f2f4]/90 dark:bg-[#1c1c1e]/88","backdrop-blur-[50px] backdrop-saturate-[180%]","text-black dark:text-white","select-none"].join(" "),selection:"accent",layers:{shimmerRim:!0},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[10px] pb-[10px]",sectionHeader:["group/section flex w-full items-center","pl-[8px] pr-[6px] pt-[16px] pb-[5px]","text-[11px] font-semibold leading-[13px]","text-[#3c3c43]/75 dark:text-[#ebebf5]/60"].join(" "),sectionChevron:["i-f7-chevron-down h-[11px] w-[11px] ml-auto","text-[#3c3c43]/60 dark:text-[#ebebf5]/45","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col",item:{base:["flex w-full items-center","h-[32px] rounded-[8px] pl-[4px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-black dark:text-white","transition-colors duration-150 ease-out"].join(" "),hover:"hover:bg-black/4 dark:hover:bg-white/6",active:"",pressed:"active:bg-black/10 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[18px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[11px] w-[11px]","text-[#3c3c43]/60 dark:text-[#ebebf5]/55","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[20px] w-[22px] shrink-0 items-center justify-center mr-[7px]",icon:"h-[17px] w-[17px]",image:"h-[20px] w-[20px] rounded-[4px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[13px] leading-[16px]","text-[#3c3c43]/75 dark:text-[#ebebf5]/60"].join(" "),indentPerLevel:16}},kc={selection:"classes",pane:"bg-[#f4f4f3] dark:bg-neutral-950 text-zinc-950 dark:text-white select-none",layers:{},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",sectionHeader:"group/section flex w-full items-center gap-2.5 px-4 pb-2 pt-5 text-[13px] font-semibold uppercase tracking-[0.12em] text-zinc-400 dark:text-zinc-500",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[16px] px-3.5 py-2 text-[14px] leading-tight transition-colors duration-150",hover:"hover:bg-[#ececea] hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e7e7e5] text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-[#e2e2e0] dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-500 dark:text-zinc-500",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/70 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},Sc={selection:"classes",pane:"bg-[#f3f3f1]/48 dark:bg-neutral-950/32 backdrop-blur-3xl backdrop-saturate-150 text-zinc-950 dark:text-white select-none",layers:{tint:"bg-[linear-gradient(112deg,rgba(255,255,255,0.20)_0%,rgba(255,255,255,0.04)_45%,rgba(226,226,222,0.16)_100%)] dark:bg-[linear-gradient(112deg,rgba(255,255,255,0.08)_0%,rgba(255,255,255,0.02)_46%,rgba(255,255,255,0.06)_100%)]"},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-2",sectionHeader:"group/section flex w-full items-center gap-2.5 px-3 pb-1.5 pt-3 rounded-[14px] text-[12px] font-semibold uppercase tracking-[0.10em] text-zinc-500/80 dark:text-zinc-400/80",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[14px] px-3 py-1.5 text-[13.5px] leading-tight transition-colors duration-150",hover:"hover:bg-white/38 hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e8e8e6]/90 text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-white/50 dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-600 dark:text-zinc-400",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/72 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},Cc={selection:"classes",pane:["bg-[#f7f5f1]/92 dark:bg-[#1a1a1c]/92","backdrop-blur-[40px] backdrop-saturate-[160%]","text-[#2c2a28] dark:text-[#ededf0]","select-none"].join(" "),layers:{tint:["bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,251,242,0.55))_0%,rgba(255,255,255,0)_38%)]","dark:bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,255,255,0.05))_0%,rgba(255,255,255,0)_42%)]"].join(" ")},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[16px] pb-[8px]",sectionHeader:["group/section flex w-full items-center","px-[8px] pt-[14px] pb-[4px]","text-[11px] font-medium leading-[13px]","opacity-55"].join(" "),sectionChevron:["i-f7-chevron-down h-[10px] w-[10px] ml-auto","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col space-y-[2px]",item:{base:["flex w-full items-center","h-[30px] rounded-[8px] pl-[6px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-current","transition-[background-color,box-shadow,color] duration-150 ease-out"].join(" "),hover:"hover:bg-white/55 dark:hover:bg-white/8",active:["bg-white dark:bg-white/14","font-medium","shadow-[0_1px_2px_rgba(0,0,0,0.08)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]","ring-1 ring-black/5 dark:ring-white/8"].join(" "),pressed:"active:bg-white/80 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[16px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[10px] w-[10px] opacity-45","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[18px] w-[18px] shrink-0 items-center justify-center mr-[8px]",icon:"h-[16px] w-[16px]",image:"h-[18px] w-[18px] rounded-[5px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[12px] leading-[16px] opacity-45"].join(" "),indentPerLevel:14}},$c={...fe,pane:"bg-stone-100 dark:bg-neutral-900 text-black dark:text-white select-none",layers:{}},Tc={...fe,pane:"bg-transparent text-black dark:text-white select-none",layers:{}},Ec={...fe,pane:"bg-white/50 dark:bg-black/40 backdrop-blur-3xl backdrop-saturate-200 text-black dark:text-white select-none",layers:{}},ma={macos:fe,tahoe:fe,"macos-tahoe":fe,"macos-latest":fe,arc:Cc,workspace:kc,desktop:Sc,solid:$c,transparent:Tc,vibrancy:Ec};function qb(e){return ma[e||"macos"]||ma.macos}function Wb(e){if(!e)return;return st[e]||e}var Ic=st.gray;function ce(e,t,s){return`color-mix(in oklab, ${e} ${t}%, ${s})`}function ga(e){return{light:{from:ce(e,35,"#ffffff"),to:ce(e,12.5,"#ffffff"),ink:ce(e,22,"#17171b"),accent:ce(e,88,"#2a2a30")},dark:{from:ce(e,27,"#101014"),to:ce(e,10,"#08080b"),ink:ce(e,12,"#f4f4f7"),accent:ce(e,74,"#ffffff")}}}function Jb(e,t){return`linear-gradient(180deg, ${e} 0%, ${t} 100%)`}function Ac(e){if(!e)return ga(Ic);if(typeof e!=="string")return e;return ga(st[e]||e)}function Pc(e){return[`--stx-space-light-from: ${e.light.from}`,`--stx-space-light-to: ${e.light.to}`,`--stx-space-light-ink: ${e.light.ink}`,`--stx-space-light-accent: ${e.light.accent}`,`--stx-space-dark-from: ${e.dark.from}`,`--stx-space-dark-to: ${e.dark.to}`,`--stx-space-dark-ink: ${e.dark.ink}`,`--stx-space-dark-accent: ${e.dark.accent}`].join("; ")}function xa(e,t,s,a){if(!e||!e.label)return null;return{id:e.id||`${t}-${s}`,label:e.label,icon:e.icon||a}}function Mc(e){let t=Ac(e.tint);return{id:e.id,label:e.label||"",icon:e.icon||"",pinned:e.pinned||[],sections:e.sections||[],action:xa(e.action,e.id,"action","i-f7-plus"),clear:xa(e.clear,e.id,"clear","i-f7-arrow-down"),tint:t,style:Pc(t),deferred:e.deferred===!0,showTitle:e.showTitle??!0}}function Yb(e){return(e||[]).map(Mc)}function Xb(e,t){if(!t)return 0;let s=e.findIndex((a)=>a.id===t);return s===-1?0:s}function Zb(e){return e.map((t)=>t.tint)}var Rc="./Skeleton-m4p66zcs.stx";var gv=101;function ke(e,t){let s=typeof e==="number"?e:Number.parseFloat(String(e));return Number.isFinite(s)?s:t}function xv(e,t,s){let a=ke(e,0),o=ke(t,100),n=ke(s,1);return{min:Math.min(a,o),max:Math.max(a,o),step:n>0?n:0}}function ba(e){if(!Number.isFinite(e))return 0;let t=String(e).toLowerCase(),s=t.indexOf("e-");if(s!==-1)return Number.parseInt(t.slice(s+2),10)+Math.max(0,t.slice(0,s).split(".")[1]?.length??0);return t.split(".")[1]?.length??0}function me(e,t){let{min:s,max:a,step:o}=t,n=Math.min(a,Math.max(s,ke(e,s)));if(o<=0)return n;let i=Math.round((n-s)/o),r=Math.floor((a-s)/o+0.0000001);if(i>r)i=r;let c=Math.max(ba(o),ba(s));return Number((s+i*o).toFixed(Math.min(c,20)))}function bv(e,t){let s=t.max-t.min;if(s<=0)return 0;return(Math.min(t.max,Math.max(t.min,ke(e,t.min)))-t.min)/s}function vv(e,t){let s=Math.min(1,Math.max(0,Number.isFinite(e)?e:0));return me(t.min+s*(t.max-t.min),t)}function wv(e,t){let s=t.max-t.min;if(s<=0||e===!1||e==null||e===""||e==="false")return[];if(e===!0||e==="true"){if(t.step<=0)return[];let o=Math.floor(s/t.step+0.0000001)+1;if(o<2||o>101)return[];return Array.from({length:o},(n,i)=>Math.min(1,i*t.step/s))}let a=Math.floor(ke(e,0));if(a<2||a>101)return[];return Array.from({length:a},(o,n)=>n/(a-1))}function yv(e,t,s,a=10){let o=s.step>0?s.step:(s.max-s.min)/100;if(e==="ArrowRight"||e==="ArrowUp")return me(t+o,s);if(e==="ArrowLeft"||e==="ArrowDown")return me(t-o,s);if(e==="PageUp")return me(t+o*a,s);if(e==="PageDown")return me(t-o*a,s);if(e==="Home")return me(s.min,s);if(e==="End")return me(s.max,s);return null}var Oc="./Slider-j59dgw1c.stx";var zc="./Spinner-vhnc3y03.stx";function Hc(e){return Array.from({length:e},()=>1/e)}function at(e,t){if(t<=0)return[];if(!e||e.length!==t||e.some((a)=>typeof a!=="number"||!Number.isFinite(a)||a<=0))return Hc(t);let s=e.reduce((a,o)=>a+o,0);return e.map((a)=>a/s)}function va(e){let t=e;if(typeof e==="string"){let a=e.trim();if(a==="")return null;if(a.charAt(0)==="[")try{t=JSON.parse(a)}catch{return null}else t=a.split(/[\s,]+/).map((o)=>Number.parseFloat(o))}if(!Array.isArray(t)||t.length===0)return null;let s=t.map((a)=>typeof a==="string"?Number.parseFloat(a):a);return s.every((a)=>typeof a==="number"&&Number.isFinite(a)&&a>0)?s:null}function Ot(e,t){if(typeof e==="number")return Number.isFinite(e)&&e>=0?e:t;if(typeof e!=="string"||e.trim()==="")return t;let s=Number.parseFloat(e);return Number.isFinite(s)&&s>=0?s:t}function wa(e,t,s){let a=e.length;if(a===0||t<=0)return[...e];let o=s.map((c)=>Math.max(0,c.min)),n=o.reduce((c,l)=>c+l,0);if(n>=t)return n===0?[...e]:o.map((c)=>c/n);let i=e.map((c)=>c*t);for(let c=0;c<=a;c++){let l=0;for(let p=0;p<a;p++){let u=Math.min(Math.max(i[p],o[p]),s[p].max);l+=i[p]-u,i[p]=u}if(Math.abs(l)<0.000000001)break;let d=i.map((p,u)=>l>0?s[u].max-p:p-o[u]),h=d.reduce((p,u)=>p+(Number.isFinite(u)?u:t),0);if(h<0.000000001)break;for(let p=0;p<a;p++){let u=(Number.isFinite(d[p])?d[p]:t)/h;i[p]+=l*u}}let r=i.reduce((c,l)=>c+l,0);return i.map((c)=>c/r)}function Dt(e,t,s,a,o){let n=e.length;if(t<0||t>=n-1||a<=0||s===0)return[...e];let i=e.map((p)=>p*a),r=s>0,c=r?t:t+1,l=r?1:-1,d=Math.min(Math.abs(s),o[c].max-i[c]);if(d<=0)return[...e];let h=0;for(let p=r?t+1:t;p>=0&&p<n&&d>0.000000001;p+=l){let u=Math.min(d,Math.max(0,i[p]-Math.max(0,o[p].min)));i[p]-=u,h+=u,d-=u}return i[c]+=h,i.map((p)=>p/a)}function ot(e,t,s,a){let o=e.map((i)=>i*s),n=(i,r)=>{let c=0;for(let l=i;l<=r;l++)c+=Math.max(0,o[l]-Math.max(0,a[l].min));return c};return{back:Math.min(n(0,t),a[t+1].max-o[t+1]),forward:Math.min(n(t+1,e.length-1),a[t].max-o[t])}}function ya(e,t,s,a){let o=ot(e,t,s,a),n=e[t]*100,i=s>0?100/s:0;return{now:Math.round(n),min:Math.round(n-o.back*i),max:Math.round(n+o.forward*i)}}function zt(e){return`stx:split-pane:${e}`}function ka(e){return JSON.stringify(e.map((t)=>Math.round(t*1e4)/1e4))}var jc="./SplitPane-7sqfdwqa.stx";var Sa="data-split-separator";class Fc{root;callbacks;direction;panes=[];separators=[];sizes=[];initial=[];limits=[];minSize;step;label;storageKey;observer=null;drag=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.direction=t.direction==="vertical"?"vertical":"horizontal",this.minSize=t.minSize??48,this.step=t.step??16,this.label=t.label||"Resize panes",this.storageKey=t.storageKey||"",this.collect(),this.initial=this.startingSizes(t.sizes),this.sizes=at(this.stored()??this.initial,this.panes.length),this.build(),this.apply(!1),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.apply(!1)),this.observer.observe(this.root);this.root.setAttribute("data-split-ready","")}getSizes(){return[...this.sizes]}setSizes(e){if(!e||e.length!==this.panes.length)return;this.sizes=at(e,this.panes.length),this.apply(!0),this.report(-1,"api",!0)}reset(e=-1){this.sizes=[...this.initial],this.apply(!0),this.report(e,"reset",!0)}setDirection(e){let t=e==="vertical"?"vertical":"horizontal";if(t===this.direction)return;this.direction=t,this.root.setAttribute("data-direction",t);for(let s of this.separators)s.setAttribute("aria-orientation",t==="horizontal"?"vertical":"horizontal");this.apply(!1)}destroy(){this.observer?.disconnect();for(let e of this.disposers)e();for(let e of this.separators)e.remove();for(let e of this.panes)e.style.removeProperty("flex"),e.removeAttribute("data-split-pane");this.root.removeAttribute("data-split-ready")}available(){let e=this.root.getBoundingClientRect(),t=this.direction==="horizontal"?e.width:e.height,s=0;for(let a of this.separators){let o=a.getBoundingClientRect();s+=this.direction==="horizontal"?o.width:o.height}return Math.max(0,t-s)}collect(){this.panes=Array.from(this.root.children).filter((e)=>e instanceof HTMLElement&&!e.hasAttribute(Sa)),this.limits=this.panes.map((e)=>({min:Ot(e.getAttribute("data-min-size"),this.minSize),max:Ot(e.getAttribute("data-max-size"),Number.POSITIVE_INFINITY)}))}startingSizes(e){let t=this.panes.map((a)=>Number.parseFloat(a.getAttribute("data-size")||"")),s=t.every((a)=>Number.isFinite(a)&&a>0)?t:null;return at(e&&e.length===this.panes.length?e:s,this.panes.length)}stored(){if(!this.storageKey)return null;try{let e=va(localStorage.getItem(zt(this.storageKey)));return e&&e.length===this.panes.length?e:null}catch{return null}}store(){if(!this.storageKey)return;try{localStorage.setItem(zt(this.storageKey),ka(this.sizes))}catch{}}build(){let e=this.root.id||`split-${Math.random().toString(36).slice(2,8)}`;this.panes.forEach((t,s)=>{if(t.setAttribute("data-split-pane",""),!t.id)t.id=`${e}-pane-${s}`;if(s===this.panes.length-1)return;let a=document.createElement("div");a.setAttribute(Sa,""),a.setAttribute("role","separator"),a.setAttribute("tabindex","0"),a.setAttribute("aria-orientation",this.direction==="horizontal"?"vertical":"horizontal"),a.setAttribute("aria-controls",t.id),a.setAttribute("aria-label",this.panes.length>2?`${this.label} ${s+1} and ${s+2}`:this.label),a.className="stx-split-separator",t.after(a),this.separators.push(a);let o=(n,i)=>{a.addEventListener(n,i),this.disposers.push(()=>a.removeEventListener(n,i))};o("pointerdown",(n)=>this.onPointerDown(n,s)),o("pointermove",(n)=>this.onPointerMove(n)),o("pointerup",(n)=>this.onPointerEnd(n)),o("pointercancel",(n)=>this.onPointerEnd(n)),o("dblclick",()=>this.reset(s)),o("keydown",(n)=>this.onKeyDown(n,s))})}apply(e){let t=this.available();if(t>0)this.sizes=wa(this.sizes,t,this.limits);if(this.panes.forEach((s,a)=>{s.style.flex=`${(this.sizes[a]*1000).toFixed(3)} 1 0px`}),this.separators.forEach((s,a)=>{let o=ya(this.sizes,a,t,this.limits);s.setAttribute("aria-valuenow",String(o.now)),s.setAttribute("aria-valuemin",String(o.min)),s.setAttribute("aria-valuemax",String(o.max))}),e)this.store()}report(e,t,s){let a=this.available(),o={sizes:[...this.sizes],pixels:this.sizes.map((n)=>Math.round(n*a)),index:e,source:t};if(this.callbacks.onResize?.(o),s)this.callbacks.onResizeEnd?.(o)}position(e){return this.direction==="horizontal"?e.clientX:e.clientY}onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();let s=this.separators[t];try{s.setPointerCapture(e.pointerId)}catch{}this.drag={index:t,start:this.position(e),sizes:[...this.sizes],pointer:e.pointerId},this.root.setAttribute("data-dragging",""),s.setAttribute("data-active","")}onPointerMove(e){let t=this.drag;if(!t||e.pointerId!==t.pointer)return;this.sizes=Dt(t.sizes,t.index,this.position(e)-t.start,this.available(),this.limits),this.apply(!1),this.report(t.index,"pointer",!1)}onPointerEnd(e){let t=this.drag;if(!t||e.pointerId!==t.pointer)return;this.drag=null,this.root.removeAttribute("data-dragging"),this.separators[t.index].removeAttribute("data-active");try{this.separators[t.index].releasePointerCapture(e.pointerId)}catch{}this.store(),this.report(t.index,"pointer",!0)}onKeyDown(e,t){let s=this.direction==="horizontal",a=this.available(),o=this.step*(e.shiftKey?5:1),n=0;if(e.key===(s?"ArrowLeft":"ArrowUp"))n=-o;else if(e.key===(s?"ArrowRight":"ArrowDown"))n=o;else if(e.key==="Home")n=-ot(this.sizes,t,a,this.limits).back;else if(e.key==="End")n=ot(this.sizes,t,a,this.limits).forward;else if(e.key==="Enter"){e.preventDefault(),this.reset(t);return}else return;e.preventDefault(),this.sizes=Dt(this.sizes,t,n,a,this.limits),this.apply(!0),this.report(t,"keyboard",!0)}}var _c="./Stepper-68gxcmej.stx";var qc="./StepperStep-zf4pq1s0.stx";class nt{storage;namespace;watchers=new Map;encryptionKey="stx-storage-key";constructor(e="local",t=""){if(this.storage=e==="local"?globalThis.localStorage:globalThis.sessionStorage,this.namespace=t,typeof window<"u")window.addEventListener("storage",this.handleStorageEvent.bind(this))}handleStorageEvent(e){if(!e.key)return;let t=this.namespace&&e.key.startsWith(`${this.namespace}:`)?e.key.slice(this.namespace.length+1):e.key,s=this.watchers.get(t);if(s){let a=e.oldValue?JSON.parse(e.oldValue).value:null,o=e.newValue?JSON.parse(e.newValue).value:null;s.forEach((n)=>n(o,a,t))}}encrypt(e){let t="";for(let s=0;s<e.length;s++)t+=String.fromCharCode(e.charCodeAt(s)^this.encryptionKey.charCodeAt(s%this.encryptionKey.length));return btoa(t)}decrypt(e){try{let t=atob(e),s="";for(let a=0;a<t.length;a++)s+=String.fromCharCode(t.charCodeAt(a)^this.encryptionKey.charCodeAt(a%this.encryptionKey.length));return s}catch{return e}}compress(e){if(e.length<100)return e;let t={},s=256,a=[],o="";for(let n=0;n<e.length;n++){let i=e.charAt(n),r=o+i;if(t[r]!==void 0)o=r;else a.push(o.length>1?t[o]:o.charCodeAt(0)),t[r]=s++,o=i}if(o!=="")a.push(o.length>1?t[o]:o.charCodeAt(0));return JSON.stringify(a)}decompress(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return e;let s={},a=256,o=String.fromCharCode(t[0]),n=o;for(let i=1;i<t.length;i++){let r=t[i],c;if(s[r]!==void 0)c=s[r];else if(r===a)c=o+o.charAt(0);else return e;n+=c,s[a++]=o+c.charAt(0),o=c}return n}catch{return e}}getKey(e){return this.namespace?`${this.namespace}:${e}`:e}set(e,t,s){let a=this.getKey(e),o=this.get(e),n={value:t,timestamp:Date.now(),expire:s?.expire,encrypted:s?.encrypt||!1,compressed:s?.compress||!1};try{let i=JSON.stringify(n);if(s?.compress)i=this.compress(i);if(s?.encrypt)i=this.encrypt(i);this.storage.setItem(a,i),this.notifyWatchers(e,t,o)}catch(i){console.error("Storage set error:",i)}}get(e){let t=this.getKey(e);try{let s=this.storage.getItem(t);if(!s)return null;if(s.match(/^[A-Z0-9+/]+=*$/i))try{s=this.decrypt(s)}catch{}if(s.startsWith("["))try{s=this.decompress(s)}catch{}let a=JSON.parse(s);if(a.expire&&Date.now()-a.timestamp>a.expire)return this.remove(e),null;return a.value}catch(s){return console.error("Storage get error:",s),null}}watch(e,t){if(!this.watchers.has(e))this.watchers.set(e,new Set);return this.watchers.get(e).add(t),()=>{let s=this.watchers.get(e);if(s){if(s.delete(t),s.size===0)this.watchers.delete(e)}}}notifyWatchers(e,t,s){let a=this.watchers.get(e);if(a)a.forEach((o)=>o(t,s,e))}remove(e){let t=this.getKey(e),s=this.get(e);this.storage.removeItem(t),this.notifyWatchers(e,null,s)}clear(){if(this.namespace)this.keys().forEach((t)=>this.remove(t));else this.storage.clear()}has(e){return this.get(e)!==null}keys(){let e=Object.keys(this.storage);if(this.namespace){let t=`${this.namespace}:`;return e.filter((s)=>s.startsWith(t)).map((s)=>s.slice(t.length))}return e}size(){return this.keys().length}getQuota(){if("storage"in navigator&&"estimate"in navigator.storage)return null;try{let e=0;for(let s=0;s<this.storage.length;s++){let a=this.storage.key(s);if(a){let o=this.storage.getItem(a)||"";e+=a.length+o.length}}let t=5242880;return{usage:e*2,quota:t,percentage:e*2/t*100}}catch{return null}}setMany(e,t){Object.entries(e).forEach(([s,a])=>{this.set(s,a,t)})}getMany(e){let t={};return e.forEach((s)=>{t[s]=this.get(s)}),t}removeMany(e){e.forEach((t)=>this.remove(t))}}var _v={local:new nt("local"),session:new nt("session")};function Kv(e="local",t){return new nt(e,t)}var Gc="./Switch-vd8k23sr.stx";var Jc="./Table-0a4y46vd.stx";var Xc="./TableBody-y49bqb1p.stx";var Qc="./TableCell-jhvsxw8b.stx";var td="./TableHead-e9xvjx2j.stx";var ad="./TableHeader-krzcx4sv.stx";var nd="./TableRow-dt8e11aj.stx";var rd="./Tab-j9f4t166.stx";var cd="./TabList-r1pc87xs.stx";var pd="./TabPanel-5htevsq6.stx";var ud="./Tabs-psm5wj7c.stx";var md="./Teleport-vqs75x36.stx";var xd="./Textarea-bb63fsz0.stx";var vd="./AiTextarea-bg6xq5wc.stx";var yd="./Tooltip-wy1nrv9a.stx";var Sd="./Transition-7m0mk45s.stx";var $d="./Video-bqsx3wr8.stx";var Ed="./VirtualList-fa7v5a3h.stx";var Ad="./VirtualTable-kp7b3wyv.stx";var Pd=0;function Ca(e="a11y"){return`${e}-${++Pd}-${Date.now()}`}function jw(e,t,s={}){let{visible:a=!1,id:o=Ca("label")}=s,n=document.createElement(a?"label":"span");if(n.id=o,n.textContent=e,!a)Object.assign(n.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"});if(t)if(t.setAttribute("aria-labelledby",o),t.parentElement)t.parentElement.insertBefore(n,t);else document.body.appendChild(n);return o}function Fw(e,t){let s=Ca("desc"),a=document.createElement("span");if(a.id=s,a.textContent=e,Object.assign(a.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t)if(t.setAttribute("aria-describedby",s),t.parentElement)t.parentElement.insertBefore(a,t);else document.body.appendChild(a);return s}function Bw(e,t="polite"){let s=document.createElement("div");s.setAttribute("role","status"),s.setAttribute("aria-live",t),s.setAttribute("aria-atomic","true"),Object.assign(s.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(s),setTimeout(()=>{s.textContent=e},100),setTimeout(()=>{s.parentNode?.removeChild(s)},1000)}function Ht(e){let t=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(t)).filter((s)=>s.offsetParent!==null)}function _w(e,t={}){let{initialFocus:s,returnFocus:a,escapeDeactivates:o=!0,clickOutsideDeactivates:n=!0,allowOutsideClick:i=!1,onActivate:r,onDeactivate:c}=t,l=!1,d=!1,h=null,p=(v)=>{if(d)return;if(o&&v.key==="Escape"){v.preventDefault(),m();return}if(v.key==="Tab"){let b=Ht(e);if(b.length===0){v.preventDefault();return}let C=b[0],P=b[b.length-1];if(v.shiftKey){if(document.activeElement===C)v.preventDefault(),P.focus()}else if(document.activeElement===P)v.preventDefault(),C.focus()}},u=(v)=>{if(d)return;if(!e.contains(v.target)){if(typeof i==="function"){if(!i(v)&&n)m()}else if(!i&&n)m()}};function g(){if(l)return;l=!0,h=document.activeElement;let v=s||Ht(e)[0];if(v&&typeof v.focus==="function")v.focus();document.addEventListener("keydown",p),document.addEventListener("click",u),r?.()}function m(){if(!l)return;l=!1;let v=a||h;if(v&&typeof v.focus==="function")v.focus();document.removeEventListener("keydown",p),document.removeEventListener("click",u),c?.()}function w(){d=!0}function y(){d=!1}return{activate:g,deactivate:m,pause:w,unpause:y}}function Kw(e,t={}){let{selector:s='[role="option"], [role="menuitem"], [role="tab"], button',initialIndex:a=0,orientation:o="both",loop:n=!0,onFocusChange:i}=t,r=a,c=()=>Array.from(e.querySelectorAll(s)),l=(h)=>{let p=c();if(h<0||h>=p.length)return;p.forEach((u,g)=>{if(g===h){if(u.setAttribute("tabindex","0"),typeof u.focus==="function")u.focus()}else u.setAttribute("tabindex","-1")}),r=h,i?.(h,p[h])},d=(h)=>{let u=c().length-1,g=!1,m=r;switch(h.key){case"ArrowRight":if(o==="horizontal"||o==="both"){if(m=r+1,m>u)m=n?0:u;g=!0}break;case"ArrowLeft":if(o==="horizontal"||o==="both"){if(m=r-1,m<0)m=n?u:0;g=!0}break;case"ArrowDown":if(o==="vertical"||o==="both"){if(m=r+1,m>u)m=n?0:u;g=!0}break;case"ArrowUp":if(o==="vertical"||o==="both"){if(m=r-1,m<0)m=n?u:0;g=!0}break;case"Home":m=0,g=!0;break;case"End":m=u,g=!0;break}if(g)h.preventDefault(),l(m)};return l(a),e.addEventListener("keydown",d),()=>{e.removeEventListener("keydown",d)}}var qw={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Tab:"Tab",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown"};function Ww(e){return document.activeElement===e}function Gw(e,t){let s=t||document.activeElement,a=Ht(document.body),o=a.indexOf(s);if(o===-1)return;let n=e==="next"?o+1:o-1,i=a[n];if(i)i.focus()}function Uw(e){if(e.getAttribute("aria-hidden")==="true")return!1;let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1;return!0}var Jw={setExpanded(e,t){e.setAttribute("aria-expanded",String(t))},setSelected(e,t){e.setAttribute("aria-selected",String(t))},setChecked(e,t){e.setAttribute("aria-checked",String(t))},setDisabled(e,t){if(e.setAttribute("aria-disabled",String(t)),t)e.setAttribute("tabindex","-1");else e.removeAttribute("tabindex")},setHidden(e,t){if(t)e.setAttribute("aria-hidden","true");else e.removeAttribute("aria-hidden")},setPressed(e,t){e.setAttribute("aria-pressed",String(t))},setInvalid(e,t){e.setAttribute("aria-invalid",String(t))},setRequired(e,t){e.setAttribute("aria-required",String(t))},setLive(e,t){e.setAttribute("aria-live",t)},setBusy(e,t){e.setAttribute("aria-busy",String(t))}};function Yw(e){let t=document.createElement("span");return t.textContent=e,t.className="sr-only",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t}function Xw(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-reduced-motion: reduce)").matches;return!1}function Zw(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-contrast: high)").matches;return!1}function Qw(){if(typeof window.matchMedia==="function"){if(window.matchMedia("(prefers-color-scheme: dark)").matches)return"dark";if(window.matchMedia("(prefers-color-scheme: light)").matches)return"light"}return null}function ey(e,t="Skip to main content"){let s=document.createElement("a");return s.href=`#${e}`,s.textContent=t,s.className="skip-link",Object.assign(s.style,{position:"absolute",top:"-40px",left:"0",background:"#000",color:"#fff",padding:"8px",textDecoration:"none",zIndex:"100"}),s.addEventListener("focus",()=>{s.style.top="0"}),s.addEventListener("blur",()=>{s.style.top="-40px"}),s}function ty(e){let t=[],s=(a)=>{let o=e.getAttribute(a);if(o){let n=o.split(" ");for(let i of n)if(!document.getElementById(i))t.push(`${a} references non-existent ID: ${i}`)}};return s("aria-labelledby"),s("aria-describedby"),s("aria-controls"),s("aria-owns"),s("aria-activedescendant"),t}var Md=(e,t,s,a)=>s*e/a+t,Nd=(e,t,s,a)=>(e/=a,s*e*e+t),Rd=(e,t,s,a)=>(e/=a,-s*e*(e-2)+t),Ld=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e+t;return e--,-s/2*(e*(e-2)-1)+t},Od=(e,t,s,a)=>(e/=a,s*e*e*e+t),Dd=(e,t,s,a)=>(e/=a,e--,s*(e*e*e+1)+t),zd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e+t;return e-=2,s/2*(e*e*e+2)+t},Hd=(e,t,s,a)=>(e/=a,s*e*e*e*e+t),Vd=(e,t,s,a)=>(e/=a,e--,-s*(e*e*e*e-1)+t),jd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e*e+t;return e-=2,-s/2*(e*e*e*e-2)+t},Fd=(e,t,s,a)=>(e/=a,s*e*e*e*e*e+t),Bd=(e,t,s,a)=>(e/=a,e--,s*(e*e*e*e*e+1)+t),_d=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e*e*e+t;return e-=2,s/2*(e*e*e*e*e+2)+t},Kd=(e,t,s,a)=>-s*Math.cos(e/a*(Math.PI/2))+s+t,qd=(e,t,s,a)=>s*Math.sin(e/a*(Math.PI/2))+t,Wd=(e,t,s,a)=>-s/2*(Math.cos(Math.PI*e/a)-1)+t,Gd=(e,t,s,a)=>e===0?t:s*2**(10*(e/a-1))+t,Ud=(e,t,s,a)=>e===a?t+s:s*(-(2**(-10*e/a))+1)+t,Jd=(e,t,s,a)=>{if(e===0)return t;if(e===a)return t+s;if(e/=a/2,e<1)return s/2*2**(10*(e-1))+t;return e--,s/2*(-(2**(-10*e))+2)+t},Yd=(e,t,s,a)=>(e/=a,-s*(Math.sqrt(1-e*e)-1)+t),Xd=(e,t,s,a)=>(e/=a,e--,s*Math.sqrt(1-e*e)+t),Zd=(e,t,s,a)=>{if(e/=a/2,e<1)return-s/2*(Math.sqrt(1-e*e)-1)+t;return e-=2,s/2*(Math.sqrt(1-e*e)+1)+t},Qd=(e,t,s,a)=>{let o=1.70158,n=0,i=s;if(e===0)return t;if(e/=a,e===1)return t+s;if(!n)n=a*0.3;if(i<Math.abs(s))i=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/i);return e-=1,-(i*2**(10*e)*Math.sin((e*a-o)*(2*Math.PI)/n))+t},ep=(e,t,s,a)=>{let o=1.70158,n=0,i=s;if(e===0)return t;if(e/=a,e===1)return t+s;if(!n)n=a*0.3;if(i<Math.abs(s))i=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/i);return i*2**(-10*e)*Math.sin((e*a-o)*(2*Math.PI)/n)+s+t},tp=(e,t,s,a)=>{let o=1.70158,n=0,i=s;if(e===0)return t;if(e/=a/2,e===2)return t+s;if(!n)n=a*0.44999999999999996;if(i<Math.abs(s))i=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/i);if(e<1)return e-=1,-0.5*(i*2**(10*e)*Math.sin((e*a-o)*(2*Math.PI)/n))+t;return e-=1,i*2**(-10*e)*Math.sin((e*a-o)*(2*Math.PI)/n)*0.5+s+t},sp=(e,t,s,a)=>(e/=a,s*e*e*(2.70158*e-1.70158)+t),ap=(e,t,s,a)=>(e/=a,e--,s*(e*e*(2.70158*e+1.70158)+1)+t),op=(e,t,s,a)=>{let o=1.70158;if(e/=a/2,e<1)return o*=1.525,s/2*(e*e*((o+1)*e-o))+t;return e-=2,o*=1.525,s/2*(e*e*((o+1)*e+o)+2)+t},Vt=(e,t,s,a)=>{if(e/=a,e<0.36363636363636365)return s*(7.5625*e*e)+t;else if(e<0.7272727272727273)return e-=0.5454545454545454,s*(7.5625*e*e+0.75)+t;else if(e<0.9090909090909091)return e-=0.8181818181818182,s*(7.5625*e*e+0.9375)+t;else return e-=0.9545454545454546,s*(7.5625*e*e+0.984375)+t},$a=(e,t,s,a)=>s-Vt(a-e,0,s,a)+t,np=(e,t,s,a)=>{if(e<a/2)return $a(e*2,0,s,a)*0.5+t;return Vt(e*2-a,0,s,a)*0.5+s*0.5+t},ay={linear:Md,easeInQuad:Nd,easeOutQuad:Rd,easeInOutQuad:Ld,easeInCubic:Od,easeOutCubic:Dd,easeInOutCubic:zd,easeInQuart:Hd,easeOutQuart:Vd,easeInOutQuart:jd,easeInQuint:Fd,easeOutQuint:Bd,easeInOutQuint:_d,easeInSine:Kd,easeOutSine:qd,easeInOutSine:Wd,easeInExpo:Gd,easeOutExpo:Ud,easeInOutExpo:Jd,easeInCirc:Yd,easeOutCirc:Xd,easeInOutCirc:Zd,easeInElastic:Qd,easeOutElastic:ep,easeInOutElastic:tp,easeInBack:sp,easeOutBack:ap,easeInOutBack:op,easeInBounce:$a,easeOutBounce:Vt,easeInOutBounce:np};function ip(e,t={}){let{duration:s="1s",timing:a="ease",delay:o="0s",iteration:n="1",direction:i="normal",fill:r="both",playState:c="running"}=t;return`${e} ${s} ${a} ${o} ${n} ${i} ${r} ${c}`}function Ta(e,t,s={}){e.style.animation=ip(t,s)}function ny(e){e.style.animation=""}function rp(e){return new Promise((t)=>{let s=()=>{e.removeEventListener("animationend",s),t()};e.addEventListener("animationend",s)})}function iy(e,t,s={}){let{stagger:a=100,...o}=s;e.forEach((n,i)=>{let r=`${i*a}ms`;Ta(n,t,{...o,delay:r})})}async function ry(e,t){for(let s of t)Ta(e,s.name,s.options),await rp(e)}var ly={fadeIn:"animate-fade-in",fadeOut:"animate-fade-out",slideInUp:"animate-slide-in-up",slideInDown:"animate-slide-in-down",slideInLeft:"animate-slide-in-left",slideInRight:"animate-slide-in-right",zoomIn:"animate-zoom-in",zoomOut:"animate-zoom-out",bounce:"animate-bounce",spin:"animate-spin",ping:"animate-ping",pulse:"animate-pulse"};function cy(e,t,s=1000){return new Promise((a)=>{e.classList.add(t),setTimeout(()=>{e.classList.remove(t),a()},s)})}function dy(e,t){let s=`
13
+ `}function gs(e,t,s,a,o=0){if(a<=0||s<=0)return{start:0,end:0};let n=Math.floor(Math.max(0,e)/s),i=Math.ceil((Math.max(0,e)+Math.max(0,t))/s),r=Math.min(a,Math.max(0,n-o));return{start:r,end:Math.max(r,Math.min(a,i+o))}}function xs(e,t,s){let a=s.rows-1,o=Math.max(0,s.columns-1),n=Math.max(1,s.page),{row:i,column:r}=e;switch(t){case"ArrowUp":i=Math.max(-1,i-1);break;case"ArrowDown":i=Math.min(a,i+1);break;case"ArrowLeft":r-=1;break;case"ArrowRight":r+=1;break;case"PageUp":i=i<=0?i:Math.max(0,i-n);break;case"PageDown":i=Math.min(a,Math.max(0,i)+(i<0?0:n));break;case"Home":if(r=0,s.mod)i=Math.min(0,a);break;case"End":if(r=o,s.mod)i=a;break;default:return e}return{row:Math.max(-1,Math.min(a,i)),column:Math.max(0,Math.min(o,r))}}function Dn(e,t,s=!1){let a=e.find((n)=>n.key===t),o=!a?{key:t,direction:"asc"}:a.direction==="asc"?{key:t,direction:"desc"}:null;if(!s)return o?[o]:[];if(!a)return[...e,o];return o?e.map((n)=>n.key===t?o:n):e.filter((n)=>n.key!==t)}var ps=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});class vt{rows=[];columns=[];view=new Uint32Array(0);sort=[];filter="";selected=new Set;given=null;filtered=new Uint32Array(0);searchText=null;sortKeys=new Map;offsets=new Float64Array(1);anchor=-1;charWidth;cellPadding;constructor(e=[],t=null,s={}){this.charWidth=s.charWidth??7.25,this.cellPadding=s.cellPadding??24,this.given=t&&t.length>0?[...t]:null,this.setRows(e)}get count(){return this.view.length}get totalWidth(){return this.offsets[this.columns.length]}setRows(e){this.rows=Array.isArray(e)?e:[],this.selected.clear(),this.anchor=-1,this.forget(),this.resolveColumns(),this.refilter()}setColumns(e){this.given=e&&e.length>0?[...e]:null,this.forget(),this.resolveColumns(),this.sort=this.sort.filter((t)=>this.columns.some((s)=>s.key===t.key)),this.refilter()}setFilter(e){return this.filter=e==null?"":String(e),this.refilter(),this.count}setSort(e){this.sort=(e??[]).filter((t)=>t&&(t.direction==="asc"||t.direction==="desc")&&this.columns.some((s)=>s.key===t.key)),this.resort()}toggleSort(e,t=!1){let s=this.columns.find((a)=>a.key===e);if(!s||!s.sortable)return this.sort;return this.sort=Dn(this.sort,e,t),this.resort(),this.sort}sortOf(e){let t=this.sort.findIndex((s)=>s.key===e);return t<0?null:{direction:this.sort[t].direction,priority:t+1}}rowAt(e){return e>=0&&e<this.view.length?this.rows[this.view[e]]:void 0}valueAt(e,t){let s=this.columns[t],a=this.rowAt(e);return s&&a!==void 0?oe(a,s):void 0}viewRows(){let e=Array.from({length:this.view.length});for(let t=0;t<e.length;t++)e[t]=this.rows[this.view[t]];return e}toCsv(){return On(this.viewRows(),this.columns)}toJson(){return Ln(this.viewRows(),this.columns)}select(e,t="replace"){if(e<0||e>=this.view.length)return;let s=this.view[e];if(t==="range"&&this.anchor>=0){let a=Math.min(this.anchor,e),o=Math.max(this.anchor,e);this.selected.clear();for(let n=a;n<=o&&n<this.view.length;n++)this.selected.add(this.view[n]);return}if(t==="toggle")if(this.selected.has(s))this.selected.delete(s);else this.selected.add(s);else this.selected.clear(),this.selected.add(s);this.anchor=e}selectAll(){this.selected.clear();for(let e=0;e<this.view.length;e++)this.selected.add(this.view[e])}clearSelection(){this.selected.clear(),this.anchor=-1}isSelected(e){return e>=0&&e<this.view.length&&this.selected.has(this.view[e])}selectedIndices(){return[...this.selected].sort((e,t)=>e-t)}selectedRows(){return this.selectedIndices().map((e)=>this.rows[e])}offsetOf(e){return this.offsets[Math.max(0,Math.min(this.columns.length,e))]}columnAt(e){let t=this.columns.length;if(t===0)return-1;let s=0,a=t-1;while(s<a){let o=s+a+1>>1;if(this.offsets[o]<=e)s=o;else a=o-1}return s}columnRange(e,t,s=0){let a=this.columns.length;if(a===0)return{start:0,end:0};let o=this.columnAt(Math.max(0,e)),n=this.columnAt(Math.max(0,e)+Math.max(0,t));return{start:Math.max(0,o-s),end:Math.min(a,n+1+s)}}resizeColumn(e,t){let s=this.columns[e];if(!s)return 0;return s.width=Math.round(Math.max(s.minWidth,Math.min(s.maxWidth,t))),this.measure(),s.width}autoWidth(e,t=200){let s=this.columns[e];if(!s)return 0;let a=s.label.length+3,o=Math.min(this.view.length,t);for(let i=0;i<o;i++){let r=Ee(oe(this.rows[this.view[i]],s),s.type).length;if(r>a)a=r}let n=Math.ceil(a*this.charWidth+this.cellPadding);return Math.max(s.minWidth,Math.min(s.maxWidth,420,n))}forget(){this.searchText=null,this.sortKeys.clear()}resolveColumns(){let e=this.given??Rn(this.rows),t=Math.min(this.rows.length,200),s=this.view;this.view=new Uint32Array(t);for(let a=0;a<t;a++)this.view[a]=a;this.columns=e.map((a)=>{let o=a.type;if(!o){let n=[];for(let i=0;i<t;i++)n.push(oe(this.rows[i],a));o=Nn(n)}return{...a,label:a.label??a.key,type:o,width:a.width??0,minWidth:a.minWidth??48,maxWidth:a.maxWidth??2000,align:a.align??(o==="number"?"right":"left"),sortable:a.sortable!==!1}}),this.columns.forEach((a,o)=>{if(!a.width)a.width=this.autoWidth(o);a.width=Math.max(a.minWidth,Math.min(a.maxWidth,a.width))}),this.view=s,this.measure()}measure(){let e=new Float64Array(this.columns.length+1);for(let t=0;t<this.columns.length;t++)e[t+1]=e[t]+this.columns[t].width;this.offsets=e}searchable(){if(this.searchText)return this.searchText;let e=this.rows,t=this.columns,s=Array.from({length:e.length});for(let a=0;a<e.length;a++){let o=e[a],n="";for(let i=0;i<t.length;i++){let r=oe(o,t[i]);if(r===null||r===void 0)continue;n+=typeof r==="string"?r:Ee(r,t[i].type),n+="\x01"}s[a]=n.toLowerCase()}return this.searchText=s,s}refilter(){let e=this.rows.length,t=this.filter.toLowerCase().split(/\s+/).filter(Boolean);if(t.length===0){let s=new Uint32Array(e);for(let a=0;a<e;a++)s[a]=a;this.filtered=s}else{let s=this.searchable(),a=new Uint32Array(e),o=0,n=t.length===1?t[0]:null;for(let i=0;i<e;i++){let r=s[i];if(n!==null){if(r.includes(n))a[o++]=i;continue}let c=!0;for(let l=0;l<t.length;l++)if(!r.includes(t[l])){c=!1;break}if(c)a[o++]=i}this.filtered=a.slice(0,o)}this.anchor=-1,this.resort()}keysFor(e){let t=this.sortKeys.get(e.key);if(t)return t;let s=this.rows,a=new Float64Array(s.length);if(e.type==="number"||e.type==="date"||e.type==="boolean")for(let o=0;o<s.length;o++){let n=oe(s[o],e),i=Number.NaN;if(n===null||n===void 0||n==="")i=Number.NaN;else if(typeof n==="number")i=n;else if(typeof n==="boolean")i=n?1:0;else if(n instanceof Date)i=n.getTime();else if(e.type==="date")i=Date.parse(String(n));else if(e.type==="boolean")i=String(n).toLowerCase()==="true"?1:0;else i=Number(n);a[o]=i}else{let o=Array.from({length:s.length}),n=new Map;for(let c=0;c<s.length;c++){let l=oe(s[c],e);if(l===null||l===void 0){o[c]=null;continue}let d=typeof l==="string"?l:Ee(l,e.type);if(o[c]=d,!n.has(d))n.set(d,0)}let i=[...n.keys()].sort(ps.compare),r=0;for(let c=0;c<i.length;c++){if(c>0&&ps.compare(i[c-1],i[c])!==0)r++;n.set(i[c],r)}for(let c=0;c<s.length;c++){let l=o[c];a[c]=l===null?Number.NaN:n.get(l)}}return this.sortKeys.set(e.key,a),a}resort(){let e=[];for(let s of this.sort){let a=this.columns.find((o)=>o.key===s.key);if(a)e.push({keys:this.keysFor(a),sign:s.direction==="desc"?-1:1})}let t=this.filtered.slice();if(e.length===1){let{keys:s,sign:a}=e[0];t.sort((o,n)=>{let i=s[o],r=s[n];if(i<r)return-a;if(i>r)return a;if(i===r)return o-n;let c=i!==i;return c===(r!==r)?o-n:c?1:-1})}else if(e.length>1)t.sort((s,a)=>{for(let o=0;o<e.length;o++){let n=e[o].keys[s],i=e[o].keys[a];if(n<i)return-e[o].sign;if(n>i)return e[o].sign;if(n===i)continue;let r=n!==n;if(r!==(i!==i))return r?1:-1}return s-a});this.view=t}}var Hn="./DataGrid-7rt7v865.stx";var Vn=120,Fe=new Intl.NumberFormat("en-US");function re(e,t){return e.querySelector(`[data-dg="${t}"]`)}function jn(e){let t=()=>{let s=document.createElement("textarea");s.value=e,s.setAttribute("aria-hidden","true"),s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(s);let a=document.activeElement;s.select();try{document.execCommand("copy")}catch{}s.remove(),a?.focus({preventScroll:!0})};if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText==="function")navigator.clipboard.writeText(e).catch(t);else t()}class Fn{root;callbacks;model;scroller;content;header;body;status;filterInput;prefix;rowHeight;headerHeight;overscan;columnOverscan;selectable;resizeStep;fileName;contextMenu;slots=new Map;pool=[];headerCells=[];rows={start:0,end:0};cols={start:0,end:0};stale=!0;active={row:0,column:0};activeEl=null;filterTimer=null;resize=null;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;let a=re(e,"scroller"),o=re(e,"content"),n=re(e,"header"),i=re(e,"body");if(!a||!o||!n||!i)throw Error("DataGridView: the root is missing its scroller, content, header or body");if(this.scroller=a,this.content=o,this.header=n,this.body=i,this.status=re(e,"status"),this.filterInput=re(e,"filter"),this.prefix=a.id||`data-grid-${Math.random().toString(36).slice(2,8)}`,this.rowHeight=Math.max(8,t.rowHeight??28),this.headerHeight=Math.max(8,t.headerHeight??32),this.overscan=t.overscan??6,this.columnOverscan=t.columnOverscan??2,this.selectable=t.selectable!==!1,this.resizeStep=t.resizeStep??16,this.fileName=t.fileName||"data",this.contextMenu=Boolean(t.contextMenu),this.header.__stx_inert_content=!0,this.body.__stx_inert_content=!0,e.style.setProperty("--stx-grid-row-height",`${this.rowHeight}px`),e.style.setProperty("--stx-grid-header-height",`${this.headerHeight}px`),this.model=new vt(t.rows??[],t.columns??null),t.filter){if(this.model.setFilter(t.filter),this.filterInput)this.filterInput.value=t.filter}if(this.listen(this.scroller,"scroll",()=>this.render()),this.listen(this.scroller,"keydown",(l)=>this.onKeyDown(l)),this.listen(this.body,"click",(l)=>this.onBodyClick(l)),this.listen(this.body,"dblclick",(l)=>this.onBodyDoubleClick(l)),this.listen(this.body,"contextmenu",(l)=>this.onContextMenu(l)),this.listen(this.header,"click",(l)=>this.onHeaderClick(l)),this.listen(this.header,"dblclick",(l)=>this.onHeaderDoubleClick(l)),this.listen(this.header,"pointerdown",(l)=>this.onResizeStart(l)),this.listen(this.header,"pointermove",(l)=>this.onResizeMove(l)),this.listen(this.header,"pointerup",(l)=>this.onResizeEnd(l)),this.listen(this.header,"pointercancel",(l)=>this.onResizeEnd(l)),this.filterInput)this.listen(this.filterInput,"input",()=>this.onFilterInput());let r=re(e,"export-csv"),c=re(e,"export-json");if(r)this.listen(r,"click",()=>this.download("csv"));if(c)this.listen(c,"click",()=>this.download("json"));if(typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.render()),this.observer.observe(this.scroller);this.refresh(),e.setAttribute("data-dg-ready","")}setRows(e){this.model.setRows(e),this.active={row:Math.min(0,this.model.count-1),column:Math.min(this.active.column,Math.max(0,this.model.columns.length-1))},this.scroller.scrollTop=0,this.refresh()}setColumns(e){this.model.setColumns(e),this.active={row:this.active.row,column:Math.min(this.active.column,Math.max(0,this.model.columns.length-1))},this.refresh()}setFilter(e){let t=e==null?"":String(e);if(this.filterInput&&this.filterInput.value!==t)this.filterInput.value=t;this.applyFilter(t)}setSort(e){this.model.setSort(e),this.refresh()}setFileName(e){this.fileName=e||"data"}getView(){return this.model.viewRows()}getSelection(){let e=this.model.selectedIndices();return{rows:e.map((t)=>this.model.rows[t]),indices:e}}clearSelection(){this.model.clearSelection(),this.paintSelection(),this.reportSelection()}exportCsv(){return this.model.toCsv()}exportJson(){return this.model.toJson()}download(e){let t=e==="json"?this.model.toJson():this.model.toCsv(),s=new Blob([t],{type:e==="json"?"application/json":"text/csv;charset=utf-8"}),a=URL.createObjectURL(s),o=document.createElement("a");return o.href=a,o.download=`${this.fileName}.${e}`,o.style.display="none",this.root.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(a),1000),this.callbacks.onExport?.({format:e,text:t,rows:this.model.count}),t}scrollToRow(e){let t=Math.max(0,Math.min(this.model.count-1,e));this.revealRow(t),this.render()}focus(){this.scroller.focus({preventScroll:!0})}getActiveCell(){return{...this.active}}setActiveCell(e,t){this.moveTo({row:e,column:t},!1)}destroy(){if(this.observer?.disconnect(),this.filterTimer)clearTimeout(this.filterTimer);for(let e of this.disposers)e();this.header.replaceChildren(),this.body.replaceChildren(),this.slots.clear(),this.pool.length=0,this.root.removeAttribute("data-dg-ready")}refresh(){let e=this.model;this.content.style.width=`${e.totalWidth}px`,this.content.style.height=`${this.headerHeight+e.count*this.rowHeight}px`,this.header.style.width=`${e.totalWidth}px`,this.body.style.height=`${e.count*this.rowHeight}px`,this.scroller.setAttribute("aria-rowcount",String(e.count+1)),this.scroller.setAttribute("aria-colcount",String(e.columns.length)),this.root.toggleAttribute("data-empty",e.count===0),this.stale=!0,this.render(),this.paintStatus()}render(){let e=this.model,t=this.scroller,s=gs(t.scrollTop,Math.max(0,t.clientHeight-this.headerHeight),this.rowHeight,e.count,this.overscan),a=e.columnRange(t.scrollLeft,t.clientWidth,this.columnOverscan),o=this.stale||a.start!==this.cols.start||a.end!==this.cols.end;if(!o&&s.start===this.rows.start&&s.end===this.rows.end)return;if(this.rows=s,this.cols=a,o)this.renderHeader();for(let[n,i]of this.slots)if(n<s.start||n>=s.end)this.slots.delete(n),i.index=-1,i.el.style.display="none",this.pool.push(i);for(let n=s.start;n<s.end;n++){let i=this.slots.get(n);if(i){if(o)this.fill(i);continue}i=this.pool.pop()??this.createSlot(),i.index=n,i.el.style.display="",this.slots.set(n,i),this.fill(i)}this.stale=!1,this.paintActive()}createSlot(){let e=document.createElement("div");return e.className="stx-dg-row",e.setAttribute("role","row"),this.body.appendChild(e),{el:e,index:-1,cells:[]}}fill(e){let t=this.model,s=e.index,a=t.rowAt(s),o=this.selectable&&t.isSelected(s),n=e.el;if(n.__dgRow=s,n.style.transform=`translateY(${s*this.rowHeight}px)`,n.setAttribute("aria-rowindex",String(s+2)),this.selectable)n.setAttribute("aria-selected",o?"true":"false");let i=this.cols.end-this.cols.start;while(e.cells.length<i){let r=document.createElement("div");r.className="stx-dg-cell",r.setAttribute("role","gridcell"),r.appendChild(document.createTextNode("")),n.appendChild(r),e.cells.push(r)}while(e.cells.length>i)e.cells.pop().remove();for(let r=0;r<i;r++){let c=this.cols.start+r,l=t.columns[c],d=e.cells[r],h=a===void 0?void 0:oe(a,l),p=hs(h);if(d.__dgColumn=c,d.id=`${this.prefix}-r${s}-c${c}`,d.style.left=`${t.offsetOf(c)}px`,d.style.width=`${l.width}px`,d.setAttribute("aria-colindex",String(c+1)),d.setAttribute("data-type",l.type),d.setAttribute("data-align",l.align),p==="value")d.removeAttribute("data-empty");else d.setAttribute("data-empty",p);if(this.selectable)d.setAttribute("aria-selected",o?"true":"false");d.firstChild.data=typeof h==="string"?h:Ee(h,l.type)}}renderHeader(){let e=this.model,t=this.cols.end-this.cols.start;while(this.headerCells.length<t){let s=document.createElement("div");s.className="stx-dg-head",s.setAttribute("role","columnheader");let a=document.createElement("span");a.className="stx-dg-head-label",a.appendChild(document.createTextNode(""));let o=document.createElement("span");o.className="stx-dg-sort",o.setAttribute("aria-hidden","true"),o.appendChild(document.createTextNode(""));let n=document.createElement("span");n.className="stx-dg-resize",n.setAttribute("aria-hidden","true"),s.append(a,o,n),this.header.appendChild(s),this.headerCells.push(s)}while(this.headerCells.length>t)this.headerCells.pop().remove();for(let s=0;s<t;s++){let a=this.cols.start+s,o=e.columns[a],n=this.headerCells[s],i=e.sortOf(o.key);if(n.__dgColumn=a,n.id=`${this.prefix}-h-c${a}`,n.style.left=`${e.offsetOf(a)}px`,n.style.width=`${o.width}px`,n.setAttribute("aria-colindex",String(a+1)),n.setAttribute("data-align",o.align),n.toggleAttribute("data-sortable",o.sortable),o.sortable)n.setAttribute("aria-sort",i?i.direction==="asc"?"ascending":"descending":"none");else n.removeAttribute("aria-sort");n.children[0].firstChild.data=o.label,n.children[1].firstChild.data=i?`${i.direction==="asc"?"\u25B2":"\u25BC"}${e.sort.length>1?i.priority:""}`:""}}cellElement(e){if(e.column<this.cols.start||e.column>=this.cols.end)return null;let t=e.column-this.cols.start;if(e.row<0)return this.headerCells[t]??null;return this.slots.get(e.row)?.cells[t]??null}paintActive(){let e=this.cellElement(this.active);if(this.activeEl&&this.activeEl!==e)this.activeEl.removeAttribute("data-active");if(this.activeEl=e,e)e.setAttribute("data-active",""),this.scroller.setAttribute("aria-activedescendant",e.id);else this.scroller.removeAttribute("aria-activedescendant")}paintSelection(){if(!this.selectable)return;for(let[e,t]of this.slots){let s=this.model.isSelected(e)?"true":"false";t.el.setAttribute("aria-selected",s);for(let a of t.cells)a.setAttribute("aria-selected",s)}this.paintStatus()}paintStatus(){if(!this.status)return;let e=this.model,t=e.rows.length,s=e.count===t?`${Fe.format(t)} ${t===1?"row":"rows"}`:`${Fe.format(e.count)} of ${Fe.format(t)} rows`;if(e.selected.size>0)s+=`, ${Fe.format(e.selected.size)} selected`;if(this.status.textContent!==s)this.status.textContent=s}revealRow(e){let t=this.scroller,s=e*this.rowHeight,a=t.clientHeight-this.headerHeight;if(s<t.scrollTop)t.scrollTop=s;else if(s+this.rowHeight>t.scrollTop+a)t.scrollTop=s+this.rowHeight-a}revealColumn(e){let t=this.scroller,s=this.model.offsetOf(e),a=this.model.offsetOf(e+1);if(s<t.scrollLeft)t.scrollLeft=s;else if(a>t.scrollLeft+t.clientWidth)t.scrollLeft=Math.min(s,a-t.clientWidth)}detail(e){return{row:this.model.rowAt(e.row),rowIndex:e.row,column:this.model.columns[e.column],value:e.row<0?void 0:this.model.valueAt(e.row,e.column)}}moveTo(e,t=!0){let s=this.model,a={row:Math.max(-1,Math.min(s.count-1,e.row)),column:Math.max(0,Math.min(s.columns.length-1,e.column))};if(this.active=a,a.row>=0)this.revealRow(a.row);if(this.revealColumn(a.column),this.render(),this.paintActive(),t)this.callbacks.onCell?.(this.detail(a))}reportSelection(){this.callbacks.onSelect?.(this.getSelection())}applyFilter(e){let t=this.model.setFilter(e);this.active={row:Math.min(0,t-1),column:this.active.column},this.scroller.scrollTop=0,this.refresh(),this.callbacks.onFilter?.({text:e,count:t})}sortBy(e,t){let s=this.model.columns[e];if(!s||!s.sortable)return;let a=this.model.toggleSort(s.key,t);this.refresh(),this.callbacks.onSort?.([...a])}setColumnWidth(e,t){this.model.resizeColumn(e,t),this.content.style.width=`${this.model.totalWidth}px`,this.header.style.width=`${this.model.totalWidth}px`,this.stale=!0,this.render()}copy(e){if(this.active.row<0)return;let t=this.model.rowAt(this.active.row);if(t===void 0)return;let s=e==="row"?ms(t,this.model.columns):us(this.model.valueAt(this.active.row,this.active.column));jn(s),this.callbacks.onCopy?.({what:e,text:s})}listen(e,t,s){e.addEventListener(t,s),this.disposers.push(()=>e.removeEventListener(t,s))}cellFrom(e){let s=e.target?.closest(".stx-dg-cell"),a=s?.parentElement;if(!s||!a||s.__dgColumn===void 0||a.__dgRow===void 0)return null;return{row:a.__dgRow,column:s.__dgColumn}}headFrom(e){let t=e.target,s=t?.closest(".stx-dg-head");if(!s||s.__dgColumn===void 0)return null;let a=t.closest(".stx-dg-resize");return{column:s.__dgColumn,onHandle:Boolean(a),handle:a}}onBodyClick(e){let t=this.cellFrom(e);if(!t)return;if(this.selectable)this.model.select(t.row,e.shiftKey?"range":e.metaKey||e.ctrlKey?"toggle":"replace"),this.paintSelection(),this.reportSelection();this.moveTo(t)}onBodyDoubleClick(e){let t=this.cellFrom(e),s=t?this.model.rowAt(t.row):void 0;if(t&&s!==void 0)this.callbacks.onActivate?.({row:s,rowIndex:t.row})}onContextMenu(e){let t=this.cellFrom(e);if(!t)return;if(this.contextMenu)e.preventDefault();this.moveTo(t,!1),this.callbacks.onContext?.({...this.detail(t),x:e.clientX,y:e.clientY})}onHeaderClick(e){let t=this.headFrom(e);if(!t||t.onHandle)return;this.active={row:-1,column:t.column},this.sortBy(t.column,e.shiftKey)}onHeaderDoubleClick(e){let t=this.headFrom(e);if(t&&t.onHandle)this.setColumnWidth(t.column,this.model.autoWidth(t.column))}onResizeStart(e){let t=this.headFrom(e);if(!t||!t.onHandle||!t.handle||e.button!==0)return;e.preventDefault();try{t.handle.setPointerCapture(e.pointerId)}catch{}this.resize={column:t.column,start:e.clientX,width:this.model.columns[t.column].width,pointer:e.pointerId,handle:t.handle},this.root.setAttribute("data-resizing","")}onResizeMove(e){let t=this.resize;if(!t||e.pointerId!==t.pointer)return;this.setColumnWidth(t.column,t.width+e.clientX-t.start)}onResizeEnd(e){let t=this.resize;if(!t||e.pointerId!==t.pointer)return;this.resize=null,this.root.removeAttribute("data-resizing");try{t.handle.releasePointerCapture(e.pointerId)}catch{}}onFilterInput(){if(this.filterTimer)clearTimeout(this.filterTimer);this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.applyFilter(this.filterInput?this.filterInput.value:"")},Vn)}onKeyDown(e){if(e.target!==this.scroller)return;let t=this.model,s=e.metaKey||e.ctrlKey,a=this.active.row<0,o=e.key;if(s&&(o==="a"||o==="A")){if(!this.selectable)return;e.preventDefault(),t.selectAll(),this.paintSelection(),this.reportSelection();return}if(s&&(o==="c"||o==="C")){if(a)return;e.preventDefault(),this.copy(e.shiftKey?"row":"cell");return}if(a&&e.altKey&&(o==="ArrowLeft"||o==="ArrowRight")){e.preventDefault();let r=t.columns[this.active.column];if(r)this.setColumnWidth(this.active.column,r.width+(o==="ArrowRight"?this.resizeStep:-this.resizeStep));this.paintActive();return}if(o==="Enter"||o===" "){if(e.preventDefault(),a){this.sortBy(this.active.column,e.shiftKey);return}if(o===" "){if(!this.selectable)return;t.select(this.active.row,"toggle"),this.paintSelection(),this.reportSelection();return}let r=t.rowAt(this.active.row);if(r!==void 0)this.callbacks.onActivate?.({row:r,rowIndex:this.active.row});return}if(o==="Escape"&&this.selectable&&t.selected.size>0){e.preventDefault(),this.clearSelection();return}let n=Math.max(1,Math.floor((this.scroller.clientHeight-this.headerHeight)/this.rowHeight)-1),i=xs(this.active,o,{rows:t.count,columns:t.columns.length,page:n,mod:s});if(i===this.active)return;if(e.preventDefault(),i.row===this.active.row&&i.column===this.active.column)return;if(e.shiftKey&&this.selectable&&i.row>=0&&i.row!==this.active.row){if(t.selected.size===0&&this.active.row>=0)t.select(this.active.row,"replace");t.select(i.row,"range"),this.paintSelection(),this.reportSelection()}this.moveTo(i)}}var _n="./Dialog-wm7zjqnb.stx";var qn="./DialogBackdrop-de5m5m4w.stx";var Gn="./DialogDescription-yd2jgt2m.stx";var Jn="./DialogPanel-v972ztcc.stx";var Xn="./DialogTitle-nw0pw114.stx";var Qn="./Drawer-d78cdr6d.stx";var ti="./Dropdown-hb8ks69x.stx";var ai="./DropdownButton-wxc25hsy.stx";var ni="./DropdownItem-af0vzc8a.stx";var ri="./DropdownItems-bkz7jkyz.stx";var ci="./Form-cybgg9ym.stx";var di={action:f.string,method:f.oneOf(["GET","POST","PUT","DELETE","PATCH"]),validationSchema:f.object,initialValues:f.object,validateOnChange:f.boolean,validateOnBlur:f.boolean,onSubmit:f.func,onError:f.func,className:f.string},mm=ae("Form",di);var bs=(e)=>Math.round(e*100)/100,Q=(e)=>`${bs(e.x)} ${bs(e.y)}`;function vs(e,t,s){let a=s.x-e.x,o=s.y-e.y;if(a===0&&o===0)return{x:e.x,y:e.y};let n=a===0?Number.POSITIVE_INFINITY:t.width/2/Math.abs(a),i=o===0?Number.POSITIVE_INFINITY:t.height/2/Math.abs(o),r=Math.min(n,i);return{x:e.x+a*r,y:e.y+o*r}}function ws(e,t,s){let a=e.x-t.x,o=e.y-t.y,n=Math.sqrt(a*a+o*o);if(s<=0||n<=s)return e;return{x:e.x-a/n*s,y:e.y-o/n*s}}function pi(e,t,s=0){let a=26+Math.abs(s),o={x:e.x+t.width/4,y:e.y-t.height/2},n={x:e.x+t.width/2,y:e.y-t.height/4},i={x:o.x,y:o.y-a},r={x:n.x+a,y:n.y};return{d:`M ${Q(o)} C ${Q(i)}, ${Q(r)}, ${Q(n)}`,start:o,end:n,label:ys(o,i,r,n,0.5),angle:Math.atan2(n.y-r.y,n.x-r.x)}}function ys(e,t,s,a,o){let n=1-o;return{x:n*n*n*e.x+3*n*n*o*t.x+3*n*o*o*s.x+o*o*o*a.x,y:n*n*n*e.y+3*n*n*o*t.y+3*n*o*o*s.y+o*o*o*a.y}}function ks(e,t={}){let{source:s,sourceSize:a,target:o,targetSize:n}=e,i=t.offset??0,r=t.inset??0;if(s.x===o.x&&s.y===o.y)return pi(s,a,i);if(t.curve==="bezier"){let w=t.direction!=="TB",y=(w?o.x-s.x:o.y-s.y)>=0?1:-1,v=w?{x:s.x+y*a.width/2,y:s.y}:{x:s.x,y:s.y+y*a.height/2},b=w?{x:o.x-y*n.width/2,y:o.y}:{x:o.x,y:o.y-y*n.height/2},C=Math.abs(w?b.x-v.x:b.y-v.y),P=Math.max(C/2,24)*y,T=w?{x:b.x-y*r,y:b.y}:{x:b.x,y:b.y-y*r},V=w?{x:v.x+P,y:v.y+i}:{x:v.x+i,y:v.y+P},j=w?{x:T.x-P,y:T.y+i}:{x:T.x+i,y:T.y-P};return{d:`M ${Q(v)} C ${Q(V)}, ${Q(j)}, ${Q(T)}`,start:v,end:T,label:ys(v,V,j,T,0.5),angle:Math.atan2(T.y-j.y,T.x-j.x)}}let c=vs(s,a,o),l=vs(o,n,s);if(i===0){let w=ws(l,c,r);return{d:`M ${Q(c)} L ${Q(w)}`,start:c,end:w,label:{x:(c.x+w.x)/2,y:(c.y+w.y)/2},angle:Math.atan2(w.y-c.y,w.x-c.x)}}let d=s.x<o.x||s.x===o.x&&s.y<o.y?1:-1,h=(o.x-s.x)*d,p=(o.y-s.y)*d,u=Math.sqrt(h*h+p*p)||1,g={x:(c.x+l.x)/2+-p/u*i*2,y:(c.y+l.y)/2+h/u*i*2},m=ws(l,g,r);return{d:`M ${Q(c)} Q ${Q(g)}, ${Q(m)}`,start:c,end:m,label:{x:0.25*c.x+0.5*g.x+0.25*m.x,y:0.25*c.y+0.5*g.y+0.25*m.y},angle:Math.atan2(m.y-g.y,m.x-g.x)}}function Ss(e,t=14){let s=new Map;for(let o of e){let n=o.source<o.target?`${o.source}\x00${o.target}`:`${o.target}\x00${o.source}`,i=s.get(n);if(i)i.push(o);else s.set(n,[o])}let a=new Map;for(let o of s.values()){if(o.length<2)continue;o.forEach((n,i)=>{let r=(i-(o.length-1)/2)*t;a.set(n.id,n.source===n.target?i*t:r)})}return a}var wt={charWidth:7,paddingX:12,minWidth:48,maxWidth:220,height:32,detailHeight:14};function ne(e){return e.label==null||e.label===""?e.id:String(e.label)}function Cs(e){return e.id!=null&&e.id!==""?String(e.id):`${e.source}->${e.target}${e.label?`:${e.label}`:""}`}function $s(e,t=wt){let s=Math.max(ne(e).length,e.detail?e.detail.length*0.85:0),a=e.expandable===!0?t.charWidth+4:0;return{width:Math.min(t.maxWidth,Math.max(t.minWidth,Math.ceil(s*t.charWidth)+t.paddingX*2+a)),height:t.height+(e.detail?t.detailHeight:0)}}function Ts(e=wt){return Math.floor((e.maxWidth-e.paddingX*2)/e.charWidth)}function Be(e,t){return e.length<=t?e:`${e.slice(0,Math.max(1,t-1))}\u2026`}class _e{metrics;nodeMap=new Map;edgeMap=new Map;incident=new Map;sizes=new Map;constructor(e=[],t=[],s=wt){this.metrics=s;this.merge(e,t)}get nodes(){return[...this.nodeMap.values()]}get edges(){return[...this.edgeMap.values()]}get nodeCount(){return this.nodeMap.size}get edgeCount(){return this.edgeMap.size}has(e){return this.nodeMap.has(e)}node(e){return this.nodeMap.get(e)}edge(e){return this.edgeMap.get(e)}addNode(e){if(!e||e.id==null||e.id==="")return!1;let t=String(e.id);if(this.nodeMap.has(t))return!1;let s={...e,id:t};return this.nodeMap.set(t,s),this.incident.set(t,new Set),this.sizes.set(t,$s(s,this.metrics)),!0}addEdge(e){if(!e)return!1;let t=String(e.source),s=String(e.target);if(!this.nodeMap.has(t)||!this.nodeMap.has(s))return!1;let a=Cs({...e,source:t,target:s});if(this.edgeMap.has(a))return!1;return this.edgeMap.set(a,{...e,id:a,source:t,target:s}),this.incident.get(t).add(a),this.incident.get(s).add(a),!0}updateNode(e,t){let s=this.nodeMap.get(e);if(!s)return!1;let a={...s,...t,id:e};return this.nodeMap.set(e,a),this.sizes.set(e,$s(a,this.metrics)),!0}removeNode(e){if(!this.nodeMap.has(e))return!1;for(let t of[...this.incident.get(e)])this.removeEdge(t);return this.nodeMap.delete(e),this.incident.delete(e),this.sizes.delete(e),!0}removeEdge(e){let t=this.edgeMap.get(e);if(!t)return!1;return this.edgeMap.delete(e),this.incident.get(t.source)?.delete(e),this.incident.get(t.target)?.delete(e),!0}merge(e=[],t=[]){let s={nodes:[],edges:[]};for(let a of e)if(this.addNode(a))s.nodes.push(String(a.id));for(let a of t)if(this.addEdge(a))s.edges.push(Cs({...a,source:String(a.source),target:String(a.target)}));return s}edgesOf(e){let t=this.incident.get(e);return t?[...t].map((s)=>this.edgeMap.get(s)):[]}neighbours(e){let t=new Set;for(let s of this.edgesOf(e)){let a=s.source===e?s.target:s.source;if(a!==e)t.add(a)}return[...t]}degree(e){return this.neighbours(e).length}size(e){return this.sizes.get(e)??{width:this.metrics.minWidth,height:this.metrics.height}}bounds(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:o}=Number;for(let[n,i]of e){if(!this.nodeMap.has(n))continue;let r=this.size(n);t=Math.min(t,i.x-r.width/2),a=Math.max(a,i.x+r.width/2),s=Math.min(s,i.y-r.height/2),o=Math.max(o,i.y+r.height/2)}return Number.isFinite(t)?{x:t,y:s,width:a-t,height:o-s}:null}}function Es(e){let t=e>>>0||1;return()=>{t=t+1831565813>>>0;let s=t;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}var hi=0.15,Is=0.06;function As(e,t={}){let s=e.nodes,a=s.length,o=new Map;if(a===0)return o;let n=t.linkDistance??90,i=t.padding??16,r=Es(t.seed??1),c=t.positions??null,l=new Set(t.pinned??[]),d=new Map(s.map((N,R)=>[N.id,R])),h=new Float64Array(a),p=new Float64Array(a),u=new Float64Array(a),g=new Float64Array(a),m=new Uint8Array(a),w=new Uint8Array(a),y=new Float64Array(a).fill(1),v=0;s.forEach((N,R)=>{let E=e.size(N.id);u[R]=E.width/2,g[R]=E.height/2;let M=c?.get(N.id);if(M&&Number.isFinite(M.x)&&Number.isFinite(M.y))h[R]=M.x,p[R]=M.y,w[R]=1,m[R]=l.has(N.id)?1:0,y[R]=0,v++});let b=n*Math.sqrt(a)*0.6;s.forEach((N,R)=>{if(w[R])return;let E=e.neighbours(N.id).map((k)=>d.get(k)).find((k)=>w[k]),M=r()*Math.PI*2;if(E!==void 0)h[R]=h[E]+Math.cos(M)*n*0.5,p[R]=p[E]+Math.sin(M)*n*0.5;else{let k=Math.sqrt(r())*b;h[R]=Math.cos(M)*k,p[R]=Math.sin(M)*k}});let C=Uint8Array.from(w),P=v>0,T=Math.max(0,t.iterations??(P?80:300)),V=[],j=new Set;for(let N of e.edges){let R=d.get(N.source),E=d.get(N.target);if(R===E)continue;let M=R<E?R*a+E:E*a+R;if(!j.has(M))j.add(M),V.push(R,E)}let F=new Float64Array(a),x=new Float64Array(a),S=n,L=P?S*0.5:S*1.5;for(let N=0;N<T;N++){let R=L*(1-N/T);F.fill(0),x.fill(0);for(let E=0;E<a;E++)for(let M=E+1;M<a;M++){if(C[E]&&C[M])continue;let k=h[E]-h[M],D=p[E]-p[M],O=Math.sqrt(k*k+D*D);if(O<0.01){let K=(E*31+M*17)%360*Math.PI/180;k=Math.cos(K)*0.01,D=Math.sin(K)*0.01,O=0.01}let Y=Math.max(1,O-(u[E]+u[M])*0.5),H=S*S*hi/Y/O;F[E]+=k*H,x[E]+=D*H,F[M]-=k*H,x[M]-=D*H}for(let E=0;E<V.length;E+=2){let M=V[E],k=V[E+1];if(C[M]&&C[k])continue;let D=h[M]-h[k],O=p[M]-p[k],Y=Math.sqrt(D*D+O*O)||0.01,H=(u[M]+u[k])*0.5,K=Math.max(0,Y-H),te=K*K/S/Y;F[M]-=D*te,x[M]-=O*te,F[k]+=D*te,x[k]+=O*te}for(let E=0;E<a;E++){if(m[E])continue;if(!C[E])F[E]-=h[E]*Is,x[E]-=p[E]*Is;let M=Math.sqrt(F[E]*F[E]+x[E]*x[E]);if(M>0){let k=Math.min(M,R)/M*y[E];h[E]+=F[E]*k,p[E]+=x[E]*k}}}return ui(h,p,u,g,m,i),s.forEach((N,R)=>{o.set(N.id,{x:Math.round(h[R]*100)/100,y:Math.round(p[R]*100)/100})}),o}function ui(e,t,s,a,o,n){let i=e.length;for(let r=0;r<40;r++){let c=!1;for(let l=0;l<i;l++)for(let d=l+1;d<i;d++){let h=s[l]+s[d]+n-Math.abs(e[l]-e[d]);if(h<=0)continue;let p=a[l]+a[d]+n-Math.abs(t[l]-t[d]);if(p<=0)continue;if(o[l]&&o[d])continue;c=!0;let u=o[l]?0:o[d]?1:0.5,g=1-u;if(h<p){let m=e[l]<e[d]||e[l]===e[d]&&l<d?-1:1;e[l]+=m*h*u,e[d]-=m*h*g}else{let m=t[l]<t[d]||t[l]===t[d]&&l<d?-1:1;t[l]+=m*p*u,t[d]-=m*p*g}}if(!c)break}}function fi(e){let t=new Set,s=[];for(let o of e.nodes){if(t.has(o.id))continue;let n=[],i=[o.id];t.add(o.id);while(i.length){let r=i.shift();n.push(r);for(let c of e.neighbours(r))if(!t.has(c))t.add(c),i.push(c)}s.push(n)}let a=new Map(e.nodes.map((o,n)=>[o.id,n]));for(let o of s)o.sort((n,i)=>a.get(n)-a.get(i));return s}function mi(e){let t=new Map;for(let o of e.nodes)t.set(o.id,[]);for(let o of e.edges)if(o.source!==o.target)t.get(o.source).push({id:o.id,to:o.target});let s=new Set,a=new Map;for(let o of e.nodes){if(a.has(o.id))continue;let n=[{id:o.id,next:0}];a.set(o.id,1);while(n.length){let i=n[n.length-1],r=t.get(i.id);if(i.next>=r.length){a.set(i.id,2),n.pop();continue}let c=r[i.next++],l=a.get(c.to);if(l===1)s.add(c.id);else if(l===void 0)a.set(c.to,1),n.push({id:c.to,next:0})}}return s}function Ps(e,t){let s=e.map((o)=>[t.get(o.from),t.get(o.to)]).sort((o,n)=>o[0]-n[0]||o[1]-n[1]),a=0;for(let o=0;o<s.length;o++)for(let n=o+1;n<s.length;n++)if(s[o][0]<s[n][0]&&s[o][1]>s[n][1])a++;return a}function Ms(e,t={}){let s=t.direction==="TB"?"TB":"LR",a=t.nodeGap??24,o=t.layerGap??80,n=t.componentGap??48,i=t.sweeps??4,r=s==="LR",c=mi(e),l=[],d=new Set;for(let b of e.edges){if(b.source===b.target)continue;let C=c.has(b.id)?b.target:b.source,P=c.has(b.id)?b.source:b.target,T=`${C}\x00${P}`;if(!d.has(T))d.add(T),l.push({from:C,to:P})}let h=new Map,p=new Map;for(let b of e.nodes)h.set(b.id,[]),p.set(b.id,[]);for(let b of l)h.get(b.from).push(b.to),p.get(b.to).push(b.from);let u=new Map,g=new Map,m=[];for(let b of e.nodes)if(g.set(b.id,p.get(b.id).length),p.get(b.id).length===0)m.push(b.id),u.set(b.id,0);for(let b=0;b<m.length;b++){let C=m[b];for(let P of h.get(C)){u.set(P,Math.max(u.get(P)??0,u.get(C)+1));let T=g.get(P)-1;if(g.set(P,T),T===0)m.push(P)}}let w=new Map,y=[],v=0;for(let b of fi(e)){let C=[];for(let k of b){let D=u.get(k)??0;while(C.length<=D)C.push([]);C[D].push(k)}let P=new Set(b),T=l.filter((k)=>P.has(k.from)&&u.get(k.to)-u.get(k.from)===1),V=new Map,j=()=>{for(let k of C)k.forEach((D,O)=>V.set(D,k.length>1?O/(k.length-1):0.5))},F=(k,D)=>{let O=new Map;k.forEach((H,K)=>{let te=D.get(H),Le=k.length>1?K/(k.length-1):0.5;O.set(H,te.length?te.reduce((pt,Oe)=>pt+V.get(Oe),0)/te.length:Le)});let Y=new Map(k.map((H,K)=>[H,K]));k.sort((H,K)=>O.get(H)-O.get(K)||Y.get(H)-Y.get(K)),k.forEach((H,K)=>V.set(H,k.length>1?K/(k.length-1):0.5))};j();let x=C.map((k)=>[...k]),S=Ps(T,V);for(let k=0;k<i&&S>0;k++){for(let O=1;O<C.length;O++)F(C[O],p);for(let O=C.length-2;O>=0;O--)F(C[O],h);let D=Ps(T,V);if(D<S)S=D,x=C.map((O)=>[...O])}let L=(k)=>r?e.size(k).width:e.size(k).height,N=(k)=>r?e.size(k).height:e.size(k).width,R=x.map((k)=>k.reduce((D,O)=>D+N(O),0)+a*Math.max(0,k.length-1)),E=Math.max(0,...R),M=0;x.forEach((k,D)=>{let O=Math.max(0,...k.map(L)),Y=v+(E-R[D])/2;for(let H of k){let K=Y+N(H)/2;w.set(H,r?{x:M+O/2,y:K}:{x:K,y:M+O/2}),Y+=N(H)+a}M+=O+o}),y.push(x),v+=E+n}return{positions:w,layerOf:u,reversed:c,components:y,bounds:e.bounds(w)}}var gi={x:0,y:0,k:1};function Ns(e,t,s){return Math.min(Math.max(e,t),s)}function Sm(e,t){return{x:t.x*e.k+e.x,y:t.y*e.k+e.y}}function yt(e,t){return{x:(t.x-e.x)/e.k,y:(t.y-e.y)/e.k}}function Ke(e,t,s){return{x:e.x+t,y:e.y+s,k:e.k}}function Rs(e,t,s,a=0.1,o=4){let n=Ns(e.k*s,a,o),i=n/e.k;return{x:t.x-(t.x-e.x)*i,y:t.y-(t.y-e.y)*i,k:n}}function Ls(e,t,s=24,a=0.1,o=1){if(!e||t.width<=0||t.height<=0)return{...gi};let n=Math.max(1,t.width-s*2),i=Math.max(1,t.height-s*2),r=Ns(Math.min(n/Math.max(1,e.width),i/Math.max(1,e.height)),a,o);return{x:t.width/2-(e.x+e.width/2)*r,y:t.height/2-(e.y+e.height/2)*r,k:r}}function Os(e,t,s){return{x:s.width/2-t.x*e.k,y:s.height/2-t.y*e.k,k:e.k}}function Ds(e,t,s,a=16){let o=t.x*e.k+e.x,n=t.y*e.k+e.y,i=o+t.width*e.k,r=n+t.height*e.k,c=0,l=0;if(o<a)c=a-o;else if(i>s.width-a)c=s.width-a-i;if(n<a)l=a-n;else if(r>s.height-a)l=s.height-a-r;return c===0&&l===0?e:Ke(e,c,l)}function zs(e,t,s){let a=e.get(t);if(!a)return null;let o=s==="left"?-1:s==="right"?1:0,n=s==="up"?-1:s==="down"?1:0,i=null,r=Number.POSITIVE_INFINITY;for(let[c,l]of e){if(c===t)continue;let d=l.x-a.x,h=l.y-a.y,p=d*o+h*n;if(p<=0.5)continue;let u=Math.abs(d*n)+Math.abs(h*o);if(u>p*2)continue;let g=p+u*2;if(g<r)r=g,i=c}return i}function Hs(e,t){let s=null,a=Number.POSITIVE_INFINITY;for(let[o,n]of e){let i=(n.x-t.x)**2+(n.y-t.y)**2;if(i<a)a=i,s=o}return s}function Cm(e,t,s){let a=null;for(let[o,n]of t){let i=e.size(o);if(Math.abs(s.x-n.x)<=i.width/2&&Math.abs(s.y-n.y)<=i.height/2)a=o}return a}var bi="./GraphView-0t3t9mec.stx";var vi="http://www.w3.org/2000/svg",Vs=3,js=350,wi=240,yi=6.2;function q(e,t={}){let s=document.createElementNS(vi,e);for(let a in t)s.setAttribute(a,String(t[a]));return s}var ki=0;class Si{root;callbacks;timings={layout:0,render:0};model=new _e;positions=new Map;shown=new Map;pinned=new Set;view={x:0,y:0,k:1};size={width:0,height:0};layoutName;direction;selected=null;autoFit=!0;animate;minZoom;maxZoom;contextMenu;prefix;surface;status;svg;stage;edgeLayer;nodeLayer;labelLayer;nodeEls=new Map;edgeEls=new Map;idOf=new WeakMap;offsets=new Map;serial=0;gesture=null;pinch=null;lastClick={id:"",at:0};lastExpand=0;frame=0;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.prefix=`${e.id||"graph"}-${++ki}`,this.layoutName=t.layout==="force"?"force":"layered",this.direction=t.direction==="TB"?"TB":"LR",this.minZoom=t.minZoom??0.1,this.maxZoom=t.maxZoom??4,this.contextMenu=Boolean(t.contextMenu),this.animate=t.animate!==!1,this.surface=e.querySelector('[data-gv="surface"]')??e,this.status=e.querySelector('[data-gv="status"]'),t.label)this.surface.setAttribute("aria-label",t.label);this.svg=q("svg",{class:"stx-gv-svg","aria-hidden":"false",focusable:"false"}),this.svg.__stx_inert_content=!0;let a=q("defs");for(let o of["arrow","arrow-active"]){let n=q("marker",{id:`${this.prefix}-${o}`,viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",class:`stx-gv-${o}`});n.append(q("path",{d:"M 0 0 L 10 5 L 0 10 z"})),a.append(n)}if(this.stage=q("g",{class:"stx-gv-stage"}),this.edgeLayer=q("g",{class:"stx-gv-edges"}),this.nodeLayer=q("g",{class:"stx-gv-nodes"}),this.labelLayer=q("g",{class:"stx-gv-edge-labels"}),this.stage.append(this.edgeLayer,this.nodeLayer,this.labelLayer),this.svg.append(a,this.stage),this.surface.append(this.svg),this.listen(),this.measure(),this.setGraph(t.nodes??[],t.edges??[]),t.selected)this.select(t.selected,{silent:!0});if(typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>{if(this.measure(),this.autoFit)this.fit()}),this.observer.observe(this.surface);e.setAttribute("data-gv-ready","")}graph(){return this.model}getViewport(){return{...this.view}}getLayout(){return this.layoutName}getSelected(){return this.selected}getPositions(){return Object.fromEntries([...this.positions].map(([e,t])=>[e,{...t}]))}setGraph(e,t){if(this.stop(),this.model=new _e(e??[],t??[]),this.positions=new Map,this.pinned.clear(),this.selected&&!this.model.has(this.selected))this.selected=null;this.layout(!1),this.shown=new Map(this.positions),this.render(),this.autoFit=!0,this.fit(),this.mark()}addNeighbours(e,t,s){let a=this.model.merge(t??[],s??[]);if(a.nodes.length===0&&a.edges.length===0)return a;let o=this.shown.get(e)??this.positions.get(e)??yt(this.view,{x:this.size.width/2,y:this.size.height/2});for(let n of a.nodes)this.shown.set(n,{...o});if(this.layout(!0),this.sync(),this.moveToPlace(),this.mark(),a.nodes.length)this.announce(`${a.nodes.length} ${a.nodes.length===1?"node":"nodes"} added${this.model.has(e)?` to ${ne(this.model.node(e))}`:""}`);return a}updateNode(e,t){if(!this.model.updateNode(e,t))return;let s=this.nodeEls.get(e);if(s)s.remove(),this.nodeEls.delete(e);this.sync(),this.draw(),this.mark()}setLayout(e){let t=e==="force"?"force":"layered";if(t===this.layoutName)return;this.layoutName=t,this.relayout(),this.callbacks.onLayout?.({layout:t})}setDirection(e){let t=e==="TB"?"TB":"LR";if(t===this.direction)return;if(this.direction=t,this.layoutName==="layered")this.relayout()}select(e,t={}){let s=e!=null&&this.model.has(e)?e:null;if(s===this.selected)return;if(this.selected=s,this.mark(),s)this.describe(s);if(!t.silent)this.callbacks.onSelect?.(this.selection())}focusNode(e){if(!this.model.has(e))return;this.select(e);let t=this.positions.get(e);if(t)this.autoFit=!1,this.setView(Os(this.view,t,this.size))}fit(){this.measure(),this.setView(Ls(this.model.bounds(this.positions),this.size,32,this.minZoom,Math.min(1,this.maxZoom))),this.autoFit=!0}zoomIn(){this.zoomBy(1.25)}zoomOut(){this.zoomBy(0.8)}zoomBy(e,t){this.autoFit=!1,this.setView(Rs(this.view,t??{x:this.size.width/2,y:this.size.height/2},e,this.minZoom,this.maxZoom))}panBy(e,t){this.autoFit=!1,this.setView(Ke(this.view,e,t))}setZoomLimits(e,t){this.minZoom=e,this.maxZoom=t}destroy(){this.stop(),this.observer?.disconnect();for(let e of this.disposers)e();this.svg.remove(),this.root.removeAttribute("data-gv-ready")}selection(){let e=this.selected?this.model.node(this.selected)??null:null;return{node:e,neighbours:e?this.model.neighbours(e.id).map((t)=>this.model.node(t)):[]}}measure(){let e=this.surface.getBoundingClientRect();this.size={width:e.width,height:e.height}}layout(e){let t=performance.now();if(this.layoutName==="layered")this.positions=Ms(this.model,{direction:this.direction}).positions;else this.positions=As(this.model,{positions:e&&this.positions.size?this.positions:null,pinned:e?this.pinned:null});this.timings.layout=performance.now()-t}relayout(){if(this.pinned.clear(),this.layout(!1),this.sync(),this.moveToPlace(),this.autoFit)this.fit()}render(){let e=performance.now();this.sync(),this.draw(),this.timings.render=performance.now()-e}sync(){let e=Ts(this.model.metrics);for(let[t,s]of this.nodeEls)if(!this.model.has(t))s.remove(),this.nodeEls.delete(t);for(let t of this.model.nodes){let s=this.nodeEls.get(t.id);if(!s)s=this.buildNode(t,e),this.nodeEls.set(t.id,s),this.idOf.set(s,t.id),this.nodeLayer.append(s);let a=this.model.degree(t.id);s.setAttribute("aria-label",`${ne(t)}, ${a} ${a===1?"connection":"connections"}`)}for(let[t,s]of this.edgeEls)if(!this.model.edge(t))s.group.remove(),s.label?.remove(),this.edgeEls.delete(t);for(let t of this.model.edges)if(!this.edgeEls.has(t.id))this.edgeEls.set(t.id,this.buildEdge(t));this.offsets=Ss(this.model.edges)}buildNode(e,t){let s=this.model.size(e.id),a=q("g",{class:"stx-gv-node",id:`${this.prefix}-node-${this.serial++}`,role:"group","data-node":e.id});if(e.kind)a.setAttribute("data-kind",e.kind);if(e.expandable===!0)a.setAttribute("data-expandable","");let o=q("title");o.textContent=e.detail?`${ne(e)}: ${e.detail}`:ne(e);let n=q("rect",{x:-s.width/2,y:-s.height/2,width:s.width,height:s.height,rx:6,ry:6}),i=e.expandable===!0?(this.model.metrics.charWidth+4)/2:0,r=q("text",{class:"stx-gv-node-label",x:-i,y:e.detail?-6:0,"text-anchor":"middle","dominant-baseline":"central"});if(r.textContent=Be(ne(e),t),a.append(o,n,r),e.detail){let c=q("text",{class:"stx-gv-node-detail",x:-i,y:9,"text-anchor":"middle","dominant-baseline":"central"});c.textContent=Be(e.detail,Math.floor(t/0.85)),a.append(c)}if(e.expandable===!0){let c=q("text",{class:"stx-gv-node-mark",x:s.width/2-10,y:0,"text-anchor":"middle","dominant-baseline":"central","aria-hidden":"true"});c.textContent="+",a.append(c)}return a}buildEdge(e){let t=q("g",{class:"stx-gv-edge","data-edge":e.id}),s=q("path",{fill:"none"});if(e.directed!==!1)s.setAttribute("marker-end",`url(#${this.prefix}-arrow)`);t.append(s),this.edgeLayer.append(t);let a=null;if(e.label){let o=Be(String(e.label),32),n=Math.ceil(o.length*yi)+8;a=q("g",{class:"stx-gv-edge-label","data-edge":e.id});let i=q("rect",{x:-n/2,y:-8,width:n,height:16,rx:3,ry:3}),r=q("text",{"text-anchor":"middle","dominant-baseline":"central"});r.textContent=o,a.append(i,r),this.labelLayer.append(a)}return{group:t,path:s,label:a}}draw(){for(let[e,t]of this.nodeEls){let s=this.shown.get(e)??this.positions.get(e);if(s)t.setAttribute("transform",`translate(${s.x} ${s.y})`)}for(let e of this.model.edges)this.drawEdge(e)}shape(e){let t=this.shown.get(e.source)??this.positions.get(e.source),s=this.shown.get(e.target)??this.positions.get(e.target);if(!t||!s)return null;return ks({source:t,sourceSize:this.model.size(e.source),target:s,targetSize:this.model.size(e.target)},{curve:this.layoutName==="layered"?"bezier":"straight",direction:this.direction,offset:this.offsets.get(e.id)??0,inset:e.directed!==!1?1:0})}drawEdge(e){let t=this.edgeEls.get(e.id),s=t&&this.shape(e);if(!t||!s)return;t.path.setAttribute("d",s.d),t.label?.setAttribute("transform",`translate(${Math.round(s.label.x*10)/10} ${Math.round(s.label.y*10)/10})`)}moveToPlace(){this.stop();let e=typeof matchMedia==="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!this.animate||e||typeof requestAnimationFrame!=="function"){this.shown=new Map(this.positions),this.draw();return}let t=new Map;for(let[o,n]of this.positions)t.set(o,this.shown.get(o)??n);let s=performance.now(),a=(o)=>{let n=Math.min(1,(o-s)/wi),i=1-(1-n)**3;for(let[r,c]of this.positions){let l=t.get(r);this.shown.set(r,{x:l.x+(c.x-l.x)*i,y:l.y+(c.y-l.y)*i})}if(this.draw(),this.frame=n<1?requestAnimationFrame(a):0,n>=1)this.shown=new Map(this.positions)};this.frame=requestAnimationFrame(a)}stop(){if(this.frame)cancelAnimationFrame(this.frame);this.frame=0}setView(e){this.view=e,this.stage.setAttribute("transform",`translate(${e.x} ${e.y}) scale(${e.k})`),this.callbacks.onViewport?.({...e})}mark(){let e=this.selected,t=new Set(e?this.model.neighbours(e):[]);this.root.toggleAttribute("data-has-selection",Boolean(e));for(let[a,o]of this.nodeEls)if(o.toggleAttribute("data-selected",a===e),o.toggleAttribute("data-neighbour",t.has(a)),a===e)o.setAttribute("aria-current","true");else o.removeAttribute("aria-current");for(let a of this.model.edges){let o=this.edgeEls.get(a.id);if(!o)continue;let n=e!=null&&(a.source===e||a.target===e);if(o.group.toggleAttribute("data-active",n),o.label?.toggleAttribute("data-active",n),a.directed!==!1)o.path.setAttribute("marker-end",`url(#${this.prefix}-${n?"arrow-active":"arrow"})`)}let s=e?this.nodeEls.get(e):null;if(s)this.surface.setAttribute("aria-activedescendant",s.id);else this.surface.removeAttribute("aria-activedescendant")}describe(e){let t=this.model.node(e);if(!t)return;let s=this.model.neighbours(e).map((n)=>ne(this.model.node(n))),a=s.slice(0,5).join(", "),o=s.length>5?` and ${s.length-5} more`:"";this.announce(s.length===0?`${ne(t)}, no connections`:`${ne(t)}, ${s.length} ${s.length===1?"connection":"connections"}: ${a}${o}`)}announce(e){if(this.status)this.status.textContent=e}expand(e,t=!1){let s=this.model.node(e);if(!s)return;if(this.lastExpand=performance.now(),t||s.expandable===!1)this.callbacks.onOpen?.({node:s});else this.callbacks.onExpand?.({node:s})}nodeUnder(e){let t=e instanceof Element?e.closest(".stx-gv-node"):null;return t?this.idOf.get(t)??null:null}local(e){let t=this.surface.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}listen(){let e=(s,a,o)=>{this.surface.addEventListener(s,a,o),this.disposers.push(()=>this.surface.removeEventListener(s,a,o))};e("pointerdown",(s)=>this.onPointerDown(s)),e("pointermove",(s)=>this.onPointerMove(s)),e("pointerup",(s)=>this.onPointerUp(s)),e("pointercancel",()=>this.endGesture()),e("dblclick",(s)=>{let a=this.nodeUnder(s.target);if(a&&performance.now()-this.lastExpand>js)this.expand(a,s.metaKey||s.ctrlKey)}),e("wheel",(s)=>this.onWheel(s),{passive:!1}),e("keydown",(s)=>this.onKeyDown(s)),e("contextmenu",(s)=>{if(this.contextMenu)s.preventDefault();let a=this.nodeUnder(s.target);if(a)this.select(a);this.callbacks.onContext?.({node:a?this.model.node(a):null,x:s.clientX,y:s.clientY})});let t=(s,a)=>{this.surface.addEventListener(s,a),this.disposers.push(()=>this.surface.removeEventListener(s,a))};t("gesturestart",(s)=>{s.preventDefault();let a=this.local(s);this.pinch={k:this.view.k,x:a.x,y:a.y}}),t("gesturechange",(s)=>{if(!this.pinch)return;s.preventDefault(),this.zoomBy(this.pinch.k*s.scale/this.view.k,{x:this.pinch.x,y:this.pinch.y})}),t("gestureend",()=>{this.pinch=null})}onPointerDown(e){if(e.button!==0)return;let t=this.nodeUnder(e.target);this.surface.focus({preventScroll:!0});try{this.surface.setPointerCapture(e.pointerId)}catch{}this.gesture={pointer:e.pointerId,node:t,startX:e.clientX,startY:e.clientY,origin:t?{...this.positions.get(t)??{x:0,y:0}}:{x:0,y:0},view:{...this.view},moved:!1}}onPointerMove(e){let t=this.gesture;if(!t||e.pointerId!==t.pointer)return;let s=e.clientX-t.startX,a=e.clientY-t.startY;if(!t.moved){if(Math.abs(s)<Vs&&Math.abs(a)<Vs)return;t.moved=!0,this.stop(),this.shown=new Map(this.positions),this.root.setAttribute("data-dragging",t.node?"node":"pan")}if(t.node){let o={x:t.origin.x+s/this.view.k,y:t.origin.y+a/this.view.k};this.positions.set(t.node,o),this.shown.set(t.node,o),this.nodeEls.get(t.node)?.setAttribute("transform",`translate(${o.x} ${o.y})`);for(let n of this.model.edgesOf(t.node))this.drawEdge(n)}else this.autoFit=!1,this.setView(Ke(t.view,s,a))}onPointerUp(e){let t=this.gesture;if(!t||e.pointerId!==t.pointer)return;if(this.endGesture(),t.moved){if(t.node){this.pinned.add(t.node),this.autoFit=!1;let o=this.positions.get(t.node);this.callbacks.onMove?.({node:this.model.node(t.node),x:o.x,y:o.y})}return}if(!t.node){this.select(null);return}let s=performance.now(),a=this.lastClick.id===t.node&&s-this.lastClick.at<js;if(this.lastClick=a?{id:"",at:0}:{id:t.node,at:s},this.select(t.node),a)this.expand(t.node,e.metaKey||e.ctrlKey)}endGesture(){let e=this.gesture;if(this.gesture=null,this.root.removeAttribute("data-dragging"),e)try{this.surface.releasePointerCapture(e.pointer)}catch{}}onWheel(e){if(e.preventDefault(),e.ctrlKey||e.metaKey){this.zoomBy(Math.exp(-e.deltaY*(e.deltaMode===1?0.05:0.01)),this.local(e));return}let t=e.deltaMode===1?16:1;this.panBy(-e.deltaX*t,-e.deltaY*t)}onKeyDown(e){let s={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"}[e.key];if(s){e.preventDefault();let o=this.selected?zs(this.positions,this.selected,s):Hs(this.positions,yt(this.view,{x:this.size.width/2,y:this.size.height/2}));if(o)this.select(o),this.bringIntoView(o);return}let a=e.metaKey||e.ctrlKey;if(e.key==="Enter"||e.key===" "){if(!this.selected)return;e.preventDefault(),this.expand(this.selected,a)}else if(a||e.altKey);else if(e.key==="+"||e.key==="=")e.preventDefault(),this.zoomIn();else if(e.key==="-"||e.key==="_")e.preventDefault(),this.zoomOut();else if(e.key==="0")e.preventDefault(),this.fit();else if(e.key==="f"||e.key==="F"){if(!this.selected)return;e.preventDefault(),this.focusNode(this.selected)}else if(e.key==="o"||e.key==="O"){if(!this.selected)return;e.preventDefault(),this.expand(this.selected,!0)}else if(e.key==="Escape"&&this.selected)e.preventDefault(),this.select(null)}bringIntoView(e){let t=this.positions.get(e);if(!t)return;let s=this.model.size(e),a=Ds(this.view,{x:t.x-s.width/2,y:t.y-s.height/2,width:s.width,height:s.height},this.size);if(a!==this.view)this.autoFit=!1,this.setView(a)}}var $i="./GroupedList-j3sxv5pb.stx";var Ei="./GroupedListRow-dnqc6j85.stx";var Ai="./Image-6x38ddd7.stx";var Mi="./EmailInput-sf9jfrgz.stx";var Ri="./NumberInput-e2afxyh3.stx";var Oi="./PasswordInput-d78bk8r0.stx";var zi="./SearchInput-w15r5t95.stx";var Vi="./TextInput-fge1b7tk.stx";var ji={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string},Fi={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,leftIcon:f.string,rightIcon:f.string,clearable:f.boolean,maxLength:f.number,showCount:f.boolean,type:f.oneOf(["text","date","time","datetime-local","month","week","url","tel","color","search","email","number","password"]),pattern:f.string,list:f.string,minLength:f.number,htmlSize:f.number,autofocus:f.boolean},Bi={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,min:f.number,max:f.number,step:f.number,showControls:f.boolean},_i={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,showStrength:f.boolean},Ki={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,onSearch:f.func,loading:f.boolean},Gm=ae("TextInput",Fi),Um=ae("EmailInput",ji),Jm=ae("PasswordInput",_i),Ym=ae("NumberInput",Bi),Xm=ae("SearchInput",Ki);var qi=new Set(["array","set"]),Wi=/^[A-Z_$][\w$]*$/i;function Ct(e){return qi.has(e.kind)}function kt(e){return e.ref===void 0&&(e.children!==void 0&&e.children.length>0||(e.more??0)>0)}function $t(e,t="$"){let s=t;for(let a of e)if(typeof a==="number")s+=`[${a}]`;else if(Wi.test(a))s+=`.${a}`;else s+=`[${JSON.stringify(a)}]`;return s}function St(e){if(e.ref!==void 0)return"[Circular]";if(e.children){if(Ct(e))return e.children.map((s)=>St(s));let t={};return e.children.forEach((s,a)=>{t[s.key!==void 0?String(s.key):s.label??String(a)]=St(s)}),t}if("value"in e){let t=e.value;if(typeof t==="bigint")return t.toString();if(typeof t==="number"&&!Number.isFinite(t))return String(t);if(typeof t==="function"||typeof t==="symbol")return e.preview??String(t);return t}return e.preview??null}function Bs(e,t=2){let s=St(e);return s===void 0?"undefined":JSON.stringify(s,null,t)}var Fs=80;function Tt(e){if(e.preview!==void 0)return e.preview;if(e.ref!==void 0)return"[Circular]";if(e.children||e.more){let t=(e.children?.length??0)+(e.more??0);if(Ct(e))return`${e.kind==="set"?"Set":"Array"}(${t})`;return t===0?"{}":`{${t}}`}if("value"in e){let t=e.value;if(typeof t==="string")return JSON.stringify(t.length>Fs?`${t.slice(0,Fs)}\u2026`:t);if(typeof t==="bigint")return`${t}n`;return String(t)}return e.kind}function og(e,t,s={}){let a=s.maxItems??1000,o=s.maxDepth??32,n=new Map,i=1,r=(l,d)=>{if(d!==void 0)l.label=d;return l},c=(l,d,h)=>{if(l===null)return r({kind:"null",value:null,preview:"null"},d);switch(typeof l){case"undefined":return r({kind:"undefined",value:void 0,preview:"undefined"},d);case"string":case"number":case"boolean":case"bigint":return r({kind:typeof l,value:l},d);case"symbol":return r({kind:"symbol",preview:l.toString()},d);case"function":return r({kind:"function",preview:`\u0192 ${l.name||"(anonymous)"}()`},d)}let p=l,u=n.get(p);if(u!==void 0)return r({kind:"ref",ref:u},d);if(p instanceof Date)return r({kind:"date",value:Number.isNaN(p.getTime())?null:p.toISOString(),preview:Number.isNaN(p.getTime())?"Invalid Date":p.toISOString()},d);if(p instanceof RegExp)return r({kind:"regexp",value:p.toString(),preview:p.toString()},d);let g=`v${i++}`;n.set(p,g);let m=Array.isArray(p),w=p instanceof Set,y=p instanceof Map,v=r({id:g,kind:m?"array":w?"set":y?"map":"object",children:[]},d);if(h>=o)return v.preview=m?"Array":"Object",delete v.children,v;let b=v.children,C=0;if(m||w)for(let P of p){if(C<a)b.push(c(P,String(C),h+1));C++}else if(y)for(let[P,T]of p){if(C<a)b.push(c(T,typeof P==="string"?P:Tt(c(P,void 0,o)),h+1));C++}else{for(let T of Object.keys(p)){if(C<a)b.push(c(p[T],T,h+1));C++}let P=p.constructor?.name;if(P&&P!=="Object")v.preview=`${P} {${C}}`}if(C>b.length)v.more=C-b.length;if(y)v.preview=`Map(${C})`;return v};return c(e,t,0)}class Et{rows=[];version=0;roots=[];depth;opened=new Set;closed=new Set;index=null;constructor(e,t={}){this.depth=t.depth??1,this.setValue(e)}setValue(e){this.roots=e==null?[]:Array.isArray(e)?e:[e],this.opened.clear(),this.closed.clear(),this.flatten()}setDepth(e){this.depth=e,this.opened.clear(),this.closed.clear(),this.flatten()}getRoots(){return this.roots}indexOf(e){if(!this.index){this.index=new Map;for(let t=0;t<this.rows.length;t++)this.index.set(this.rows[t].id,t)}return this.index.get(e)??-1}pathOf(e){let t=[];for(let s=e;s>=0;s=this.rows[s].parent){let a=this.rows[s];if(a.isMore)continue;if(a.parent!==-1||this.roots.length>1)t.push(a.key)}return t.reverse()}isExpanded(e,t){return this.opened.has(e)||t<this.depth&&!this.closed.has(e)}expand(e){return this.set(e,!0)}collapse(e){return this.set(e,!1)}toggle(e){let t=this.indexOf(e);if(t===-1)return!1;return this.set(e,!this.rows[t].expanded)}expandAll(e){let t=(s,a,o)=>{if(!kt(s))return;if(o>=this.depth)this.opened.add(a);this.closed.delete(a),s.children?.forEach((n,i)=>t(n,n.id??`${a}.${i}`,o+1))};if(e===void 0)this.roots.forEach((s,a)=>t(s,s.id??String(a),0));else{let s=this.find(e);if(!s)return;t(s.node,e,s.ancestors.length)}this.flatten()}collapseAll(){this.opened.clear(),this.closed.clear();let e=(t,s,a)=>{if(a>=this.depth||!kt(t))return;this.closed.add(s),t.children?.forEach((o,n)=>e(o,o.id??`${s}.${n}`,a+1))};this.roots.forEach((t,s)=>e(t,t.id??String(s),0)),this.flatten()}reveal(e){let t=this.find(e);if(!t)return-1;return t.ancestors.forEach((s,a)=>{if(this.closed.delete(s),a>=this.depth)this.opened.add(s)}),this.flatten(),this.indexOf(e)}appendChildren(e,t,s=0){let a=this.find(e);if(!a)return!1;let o=a.node;if(o.children=[...o.children??[],...t],s>0)o.more=s;else delete o.more;return this.flatten(),!0}move(e,t,s=10){let a=this.rows.length-1;if(a<0)return{index:-1,changed:!1};let o=Math.min(Math.max(e,0),a),n=this.rows[o],i=(r)=>({index:Math.min(Math.max(r,0),a),changed:!1});switch(t){case"ArrowDown":return i(e<0?0:o+1);case"ArrowUp":return i(o-1);case"Home":return i(0);case"End":return i(a);case"PageDown":return i(o+s);case"PageUp":return i(o-s);case"ArrowRight":if(!n.expandable||n.isMore)return i(o);if(!n.expanded)return{index:o,changed:this.expand(n.id)};return i(o+1);case"ArrowLeft":if(n.expanded&&!n.isMore)return{index:o,changed:this.collapse(n.id)};return i(n.parent===-1?o:n.parent);case"*":{let r=!1,c=n.parent,l=this.rows.filter((d)=>d.parent===c&&d.depth===n.depth&&d.expandable&&!d.expanded&&!d.isMore);for(let d of l)this.mark(d.id,d.depth,!0),r=!0;if(r)this.flatten();return{index:this.indexOf(n.id),changed:r}}}return i(o)}typeahead(e,t){let s=t.toLowerCase(),a=this.rows.length;if(s===""||a===0)return-1;let o=s.length===1?e+1:Math.max(e,0);for(let n=0;n<a;n++){let i=(o+n+a)%a,r=this.rows[i];if(!r.isMore&&(r.node.label??"").toLowerCase().startsWith(s))return i}return-1}set(e,t){let s=this.indexOf(e);if(s===-1)return!1;let a=this.rows[s];if(!a.expandable||a.isMore||a.expanded===t)return!1;return this.mark(e,a.depth,t),this.flatten(),!0}mark(e,t,s){if(s){if(this.closed.delete(e),t>=this.depth)this.opened.add(e)}else if(this.opened.delete(e),t<this.depth)this.closed.add(e)}find(e){let t=[];for(let s=this.roots.length-1;s>=0;s--)t.push({node:this.roots[s],id:this.roots[s].id??String(s),ancestors:[]});while(t.length>0){let s=t.pop();if(s.id===e)return{node:s.node,ancestors:s.ancestors};let a=s.node.children;if(!a||s.node.ref!==void 0)continue;let o=[...s.ancestors,s.id];for(let n=a.length-1;n>=0;n--)t.push({node:a[n],id:a[n].id??`${s.id}.${n}`,ancestors:o})}return null}flatten(){let e=[],t=(s,a,o,n,i,r,c)=>{let l=kt(s),d=l&&this.isExpanded(a,o),h=e.length;if(e.push({id:a,node:s,depth:o,key:i,parent:n,expandable:l,expanded:d,posInSet:r,setSize:c,isMore:!1}),!d)return;let p=s.children??[],u=s.more??0,g=Ct(s),m=p.length+(u>0?1:0);for(let w=0;w<p.length;w++){let y=p[w];t(y,y.id??`${a}.${w}`,o+1,h,y.key??(g?w:y.label??w),w+1,m)}if(u>0)e.push({id:`${a}.+`,node:s,depth:o+1,key:"",parent:h,expandable:!1,expanded:!1,posInSet:m,setSize:m,isMore:!0})};this.roots.forEach((s,a)=>t(s,s.id??String(a),0,-1,s.key??a,a+1,this.roots.length)),this.rows=e,this.index=null,this.version++}}var Ui="./JsonTree-satc4010.stx";var qs=new Set(["array","object","map","set","model","error"]);function Ji(e){return e.t==="object"||e.t==="model"}function _s(e){return e.length>0&&e.slice(0,20).every(Ji)}function Ks(e){return e.some((t)=>qs.has(t.t))}function It(e,t){let s=e.length>120?`${e.slice(0,120)}\u2026`:e;return t?`${JSON.stringify(s)} (${t} more characters)`:JSON.stringify(s)}function Yi(e){if(!e.file)return"";return[e.file,e.line,e.column].filter((t)=>t!==void 0).join(":")}function rg(e,t,s={}){let a=s.idPrefix??"t",o=(l)=>`${a}${l}`,n=(l,d)=>{if(d!==void 0)l.label=d;return l},i=(l)=>c(l,void 0).preview??l.t,r=(l,d)=>{if(d.length>0)l.openable=d.length===1?d[0]:d;return l};function c(l,d){switch(l.t){case"undefined":return n({kind:"undefined",value:void 0,preview:"undefined"},d);case"null":return n({kind:"null",value:null,preview:"null"},d);case"boolean":return n({kind:"boolean",value:l.v,preview:String(l.v)},d);case"number":{let h=typeof l.v==="number"?l.v:l.v==="-0"?-0:Number(l.v);return n({kind:"number",value:h,preview:String(l.v)},d)}case"bigint":return n({kind:"bigint",value:l.v,preview:`${l.v}n`},d);case"string":return n({kind:"string",value:l.v,preview:It(l.v,l.truncated)},d);case"symbol":return n({kind:"symbol",preview:`Symbol(${l.v})`},d);case"function":{let h=l.kind==="class"?`class ${l.name}`:`${l.kind==="async"?"async ":""}\u0192${l.kind==="generator"?"*":""} ${l.name}()`;return n({kind:"function",preview:h},d)}case"date":return n({kind:"date",value:l.v,preview:l.v??"Invalid Date"},d);case"regexp":return n({kind:"regexp",value:l.v,preview:l.v},d);case"url":return n({kind:"url",value:l.v,preview:l.v},d);case"promise":return n({kind:"promise",preview:"Promise"},d);case"bytes":{let h=l.length*2>l.hex.length;return n({kind:"bytes",value:l.hex,preview:`${l.ctor}(${l.length}) <${l.hex}${h?"\u2026":""}>`},d)}case"ref":return n({kind:"ref",ref:o(l.id),preview:"[Circular]"},d);case"cut":return n({kind:"cut",preview:`${l.ctor??"Object"} \u2026 (${l.reason==="depth"?"too deep to show":"result too large to show"})`},d);case"array":{let h={id:o(l.id),kind:"array",preview:`${l.ctor??"Array"}(${l.length})`,children:l.items.map((p,u)=>c(p,String(u)))};if(l.more)h.more=l.more;return n(r(h,_s(l.items)?["table"]:[]),d)}case"set":{let h={id:o(l.id),kind:"set",preview:`Set(${l.size})`,children:l.items.map((p,u)=>c(p,String(u)))};if(l.more)h.more=l.more;return n(r(h,_s(l.items)?["table"]:[]),d)}case"object":{let h=l.entries.slice(0,5).map(([m])=>m).join(", "),p=l.entries.length+(l.more??0),u=p===0?"{}":`{${h}${p>5?", \u2026":""}}`,g={id:o(l.id),kind:"object",preview:l.ctor&&l.ctor!=="Object"?`${l.ctor} ${u}`:u,children:l.entries.map(([m,w])=>c(w,m))};if(l.more)g.more=l.more;return n(r(g,Ks(l.entries.map((m)=>m[1]))?["graph"]:[]),d)}case"map":{let h={id:o(l.id),kind:"map",preview:`Map(${l.size})`,children:l.entries.map(([p,u],g)=>{if(!qs.has(p.t)){let m=c(u,i(p));return m.key=p.t==="string"?p.v:i(p),m}return{kind:"entry",label:String(g),key:g,preview:`${i(p)} => ${i(u)}`,children:[c(p,"key"),c(u,"value")]}})};if(l.more)h.more=l.more;return n(r(h,Ks(l.entries.map((p)=>p[1]))?["graph"]:[]),d)}case"model":{let h=l.attributes.map(([g,m])=>c(m,g));for(let[g,m]of l.loaded??[]){let w=c(m,g);w.meta=w.meta??{relation:!0},h.push(w)}if(l.hidden?.length)h.push({kind:"hidden",label:"[hidden]",key:"[hidden]",preview:l.hidden.join(", "),children:l.hidden.map((g,m)=>({kind:"hidden",label:String(m),value:g,preview:g}))});if(l.relations?.length)h.push({kind:"relations",label:"[relations]",key:"[relations]",preview:`${l.relations.length} declared`,children:l.relations.map((g)=>({kind:"relation",label:g.name??g.model,value:g,preview:`${g.kind} ${g.model}`}))});let p={model:l.model,hidden:l.hidden??[],relations:l.relations??[]};if(l.table)p.table=l.table;if(l.primaryKey)p.primaryKey=l.primaryKey;let u={id:o(l.id),kind:"model",preview:l.key?`${l.model} #${i(l.key).replace(/^"|"$/g,"")}`:l.model,children:h,meta:p};if(l.more)u.more=l.more;return n(r(u,["graph"]),d)}case"html":{let h={kind:l.kind};if(l.title)h.title=l.title;if(l.text)h.text=l.text;if(l.truncated)h.truncated=l.truncated;let p=l.truncated?`, ${l.truncated} more cut`:"",u=l.title?`: ${l.title}`:"";return n(r({kind:"html",value:l.html,preview:`${l.kind}${u} (${l.html.length} characters${p})`,meta:h},["preview"]),d)}case"error":{let h=[{kind:"string",label:"message",value:l.message,preview:It(l.message)}];if(l.frames?.length)h.push({kind:"stack",label:"stack",preview:`${l.frames.length} frames`,value:l.stack,children:l.frames.map((p,u)=>({kind:"frame",label:String(u),value:p,preview:[p.function,Yi(p)].filter(Boolean).join(" at ")||"(unknown)",meta:p}))});else if(l.stack)h.push({kind:"string",label:"stack",value:l.stack,preview:It(l.stack)});if(l.cause)h.push(c(l.cause,"cause"));for(let[p,u]of l.entries??[])h.push(c(u,p));return n({kind:"error",preview:l.message?`${l.name}: ${l.message}`:l.name,children:h},d)}}return n({kind:"unknown",preview:String(l.t??"unknown")},d)}return c(e,t)}var Xi=600,Ws=400,Gs={table:"Table",graph:"Graph",preview:"Preview"};function Us(e){return e.length>Ws?`${e.slice(0,Ws)}\u2026`:e}function Js(e){if(e==null||e==="")return[];return Array.isArray(e)?e:[e]}class Zi{root;callbacks;model;scroller;content;rowsEl;status;prefix;rowHeight;overscan;openable;contextMenu;pool=[];parts=new WeakMap;active=-1;activeId="";typed="";typedAt=0;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;let a=(n)=>e.querySelector(`[data-jt="${n}"]`);this.scroller=a("scroller")??e,this.content=a("content")??this.scroller,this.rowsEl=a("rows")??this.content,this.status=a("status"),this.prefix=`${e.id||`json-tree-${Math.random().toString(36).slice(2,8)}`}-row-`,this.rowHeight=t.rowHeight&&t.rowHeight>0?t.rowHeight:22,this.overscan=t.overscan??6,this.openable=t.openable??null,this.contextMenu=Boolean(t.contextMenu),this.model=new Et(t.value,{depth:t.depth??1}),this.rowsEl.__stx_inert_content=!0,e.style.setProperty("--stx-tree-row-height",`${this.rowHeight}px`);let o=(n,i,r,c)=>{n.addEventListener(i,r,c),this.disposers.push(()=>n.removeEventListener(i,r,c))};if(o(this.scroller,"scroll",()=>this.render(),{passive:!0}),o(this.scroller,"keydown",(n)=>this.onKeyDown(n)),o(this.scroller,"focus",()=>{if(this.active===-1&&this.model.rows.length>0)this.setActive(0,!1)}),o(this.rowsEl,"mousedown",(n)=>{if(n.target.closest("[data-jt-action]"))n.preventDefault()}),o(this.rowsEl,"click",(n)=>this.onClick(n)),o(this.rowsEl,"dblclick",(n)=>this.onDoubleClick(n)),o(this.rowsEl,"contextmenu",(n)=>this.onContextMenu(n)),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.render()),this.observer.observe(this.scroller);this.render(),e.setAttribute("data-jt-ready","")}setValue(e){this.model.setValue(e),this.active=-1,this.activeId="",this.scroller.scrollTop=0,this.render()}setDepth(e){this.model.setDepth(e),this.afterChange()}setOpenable(e){this.openable=e??null,this.model.version++,this.render()}setContextMenu(e){this.contextMenu=e}expandAll(e){this.model.expandAll(e),this.afterChange()}collapseAll(){this.model.collapseAll(),this.afterChange()}expand(e){let t=this.model.expand(e);if(t)this.afterChange();return t}collapse(e){let t=this.model.collapse(e);if(t)this.afterChange();return t}reveal(e){let t=this.model.reveal(e);if(t===-1)return this.afterChange(),!1;return this.active=t,this.activeId=e,this.scrollToRow(t),this.render(),this.emitSelect(),!0}appendChildren(e,t,s=0){let a=this.model.appendChildren(e,t,s);if(a)this.afterChange();return a}getSelected(){return this.active===-1?null:this.detail(this.active)}select(e){let t=this.model.indexOf(e);if(t===-1)return!1;return this.setActive(t,!0),!0}focus(){this.scroller.focus()}get drawn(){return this.pool.filter((e)=>e.style.display!=="none").length}destroy(){this.observer?.disconnect();for(let e of this.disposers)e();this.rowsEl.textContent="",this.pool=[],this.root.removeAttribute("data-jt-ready")}afterChange(){if(this.activeId){let e=this.model.indexOf(this.activeId);if(this.active=e,e===-1)this.activeId=""}this.render()}detail(e){let t=this.model.rows[e],s=this.model.pathOf(e);return{id:t.id,node:t.node,path:s,pathText:$t(s)}}emitSelect(){if(this.active!==-1)this.callbacks.onSelect?.(this.detail(this.active))}setActive(e,t){if(e<0||e>=this.model.rows.length)return;let s=e!==this.active;if(this.active=e,this.activeId=this.model.rows[e].id,t)this.scrollToRow(e);if(this.render(),s)this.emitSelect()}scrollToRow(e){let t=e*this.rowHeight,s=this.scroller.clientHeight;if(t<this.scroller.scrollTop)this.scroller.scrollTop=t;else if(t+this.rowHeight>this.scroller.scrollTop+s)this.scroller.scrollTop=t+this.rowHeight-s}pageSize(){return Math.max(1,Math.floor(this.scroller.clientHeight/this.rowHeight)-1)}createRow(){let e=document.createElement("div");e.setAttribute("role","treeitem"),e.className="stx-jt-row";let t=(a,o)=>{let n=document.createElement("span");if(n.className=a,o)n.setAttribute("aria-hidden","true");return e.appendChild(n),n},s={twisty:t("stx-jt-twisty",!0),label:t("stx-jt-label",!1),separator:t("stx-jt-separator",!0),preview:t("stx-jt-preview",!1),actions:t("stx-jt-actions",!1)};return s.separator.textContent=": ",this.parts.set(e,s),this.rowsEl.appendChild(e),e}button(e,t,s,a){let o=document.createElement("button");if(o.type="button",o.tabIndex=-1,o.className="stx-jt-action",o.setAttribute("data-jt-action",e),a)o.setAttribute("data-jt-as",a);return o.setAttribute("aria-label",s),o.textContent=t,o}opensOf(e,t){if(e.isMore)return[];if(this.openable){let s=this.openable(e.node,this.model.pathOf(t));if(s!==void 0)return Js(s)}return Js(e.node.openable)}render(){let e=this.model.rows,t=e.length,s=this.scroller.clientHeight;this.content.style.height=`${t*this.rowHeight}px`;let a=Math.max(0,Math.min(this.scroller.scrollTop,t*this.rowHeight-s)),o=Math.max(0,Math.floor(a/this.rowHeight)-this.overscan),n=Math.min(t,Math.ceil((a+s)/this.rowHeight)+this.overscan),i=Math.max(0,n-o);while(this.pool.length<i)this.pool.push(this.createRow());let r=this.pool.length,c=new Uint8Array(r);for(let d=o;d<n;d++){let h=d%r;c[h]=1,this.paint(this.pool[h],e[d],d)}for(let d=0;d<r;d++)if(!c[d]&&this.pool[d].style.display!=="none")this.pool[d].style.display="none",this.pool[d].__jt=void 0,this.pool[d].removeAttribute("id");if(this.active>=o&&this.active<n)this.scroller.setAttribute("aria-activedescendant",this.prefix+this.active);else this.scroller.removeAttribute("aria-activedescendant")}paint(e,t,s){let a=this.model.version,o=s===this.active,n=e.__jt;if(!n||n.index!==s||n.version!==a){let i=this.parts.get(e),r=t.node;if(e.style.display="",e.style.transform=`translateY(${s*this.rowHeight}px)`,e.style.setProperty("--stx-tree-depth",String(t.depth)),e.id=this.prefix+s,e.setAttribute("data-jt-index",String(s)),e.setAttribute("aria-level",String(t.depth+1)),e.setAttribute("aria-posinset",String(t.posInSet)),e.setAttribute("aria-setsize",String(t.setSize)),t.expandable)e.setAttribute("aria-expanded",t.expanded?"true":"false");else e.removeAttribute("aria-expanded");if(t.isMore)e.setAttribute("data-kind","more"),i.twisty.textContent="",i.label.textContent="",i.separator.style.display="none",i.preview.textContent=`\u2026 ${r.more} more`,i.preview.setAttribute("data-kind","more");else{e.setAttribute("data-kind",r.kind),i.twisty.textContent=t.expandable?t.expanded?"\u25BE":"\u25B8":"";let d=r.label??(typeof t.key==="number"&&t.parent!==-1?String(t.key):"");i.label.textContent=Us(d),i.separator.style.display=d===""?"none":"",i.preview.textContent=Us(Tt(r)),i.preview.setAttribute("data-kind",r.kind)}let c=this.opensOf(t,s),l=t.isMore?"+":c.join("|");if(!n||n.opens!==l)if(i.actions.textContent="",t.isMore)i.actions.appendChild(this.button("more","Load","Load more"));else{for(let d of c)i.actions.appendChild(this.button("open",Gs[d]??d,`Open as ${Gs[d]?.toLowerCase()??d}`,d));i.actions.appendChild(this.button("copy-value","Copy","Copy value")),i.actions.appendChild(this.button("copy-path","Path","Copy path"))}e.__jt={index:s,version:a,opens:l}}if(o)e.setAttribute("aria-selected","true"),e.setAttribute("data-active","");else e.setAttribute("aria-selected","false"),e.removeAttribute("data-active")}rowIndexOf(e){let t=e instanceof Element?e.closest("[data-jt-index]"):null;if(!t||t.style.display==="none")return-1;return Number(t.getAttribute("data-jt-index"))}say(e){if(this.status)this.status.textContent=e}toggleRow(e){let t=this.model.rows[e];if(!t)return;if(t.isMore){this.loadMore(e);return}if(t.node.ref!==void 0){this.follow(e);return}if(!t.expandable)return;let s=t.id;this.model.toggle(s),this.afterChange();let a=this.model.indexOf(s);if(a!==-1)this.callbacks.onToggle?.({...this.detail(a),expanded:this.model.rows[a].expanded})}follow(e){let t=this.model.rows[e].node.ref;if(t===void 0)return;if(!this.reveal(t))this.say("The value this points back to is not part of what was sent.")}loadMore(e){let s=this.model.rows[e].parent;if(s===-1)return;this.callbacks.onLoadMore?.(this.detail(s))}copy(e,t){let s=this.model.rows[e];if(!s)return;let a=s.isMore?s.parent:e,o=this.model.pathOf(a),n=this.model.rows[a].node,i=t==="path"?$t(o):Bs(n);try{navigator.clipboard?.writeText(i)?.catch(()=>{})}catch{}this.say(t==="path"?`Copied path ${i}`:"Copied value"),this.callbacks.onCopy?.({what:t,text:i,path:o,node:n})}open(e,t){let s=this.model.rows[e];if(!s||s.isMore)return;let a=t??this.opensOf(s,e)[0];if(a===void 0)return;this.callbacks.onOpen?.({...this.detail(e),as:a})}onClick(e){let t=this.rowIndexOf(e.target);if(t===-1)return;let s=e.target instanceof Element?e.target.closest("[data-jt-action]"):null;if(this.setActive(t,!1),s){let o=s.getAttribute("data-jt-action");if(o==="copy-value")this.copy(t,"value");else if(o==="copy-path")this.copy(t,"path");else if(o==="open")this.open(t,s.getAttribute("data-jt-as")??void 0);else if(o==="more")this.loadMore(t);return}let a=this.model.rows[t];if(a.expandable||a.isMore||a.node.ref!==void 0)this.toggleRow(t)}onDoubleClick(e){let t=this.rowIndexOf(e.target);if(t===-1||e.target instanceof Element&&e.target.closest("[data-jt-action]"))return;let s=this.model.rows[t];if(!s.expandable&&!s.isMore&&s.node.ref===void 0)this.open(t)}onContextMenu(e){let t=this.rowIndexOf(e.target);if(t===-1)return;if(this.setActive(t,!1),this.contextMenu)e.preventDefault();this.callbacks.onContext?.({...this.detail(t),x:e.clientX,y:e.clientY})}onKeyDown(e){let t=this.model.rows;if(t.length===0)return;let s=e.metaKey||e.ctrlKey,a=e.key;if(s&&(a==="c"||a==="C")){if(this.active===-1)return;e.preventDefault(),this.copy(this.active,e.shiftKey?"path":"value");return}if(s||e.altKey)return;if(a==="Enter"&&e.shiftKey){if(e.preventDefault(),this.active!==-1)this.open(this.active);return}let o=this.typed!==""&&Date.now()-this.typedAt<=Xi;if(a==="Enter"||a===" "&&!o){if(e.preventDefault(),this.active!==-1)this.toggleRow(this.active);return}if(a==="ArrowDown"||a==="ArrowUp"||a==="ArrowLeft"||a==="ArrowRight"||a==="Home"||a==="End"||a==="PageDown"||a==="PageUp"||a==="*"){e.preventDefault(),this.typed="";let n=this.active===-1?null:t[this.active],i=n?.expanded,r=this.model.move(this.active,a,this.pageSize());if(r.changed){if(this.active=r.index,this.activeId=this.model.rows[r.index]?.id??"",this.scrollToRow(r.index),this.render(),n&&a!=="*"){let c=this.model.indexOf(n.id);if(c!==-1&&this.model.rows[c].expanded!==i)this.callbacks.onToggle?.({...this.detail(c),expanded:this.model.rows[c].expanded})}}else this.setActive(r.index,!0);return}if(a.length===1){let n=Date.now();if(!o)this.typed="";this.typedAt=n,this.typed+=a;let i=this.model.typeahead(this.active,this.typed);if(i!==-1)e.preventDefault(),this.setActive(i,!0)}}}var er="./List-5ey6k813.stx";var sr="./Listbox-83j2q4x6.stx";var or="./ListboxButton-gan8e3nw.stx";var ir="./ListboxLabel-ka0hfm7b.stx";var lr="./ListboxOption-gpaqvk3s.stx";var dr="./ListboxOptions-2928864k.stx";var hr="./FilterChip-bynt5maa.stx";var fr="./FilterChips-xg7pgkk2.stx";var gr="./ListRow-1qvkjt4v.stx";var br="./NavBar-ky8tedjb.stx";var wr="./SectionCard-8b5fyrjd.stx";var kr="./TabBar-6m1ajm1d.stx";var Cr="./TabBarItem-kddfnhk3.stx";var Tr="./Navigator-1yk1c3pp.stx";var Ir="./Notification-b3cz24f0.stx";var Pr="./Pager-w4eb64na.stx";var Nr="./PagerDots-076w890y.stx";var Lr="./Pagination-8bhbkpcp.stx";var Dr="./Checkout-crbegxyv.stx";var Hr="./DefaultPaymentMethod-ss3x61tr.stx";var jr="./PaymentMethods-z4hhr0kv.stx";var Br="./SubscriptionCheckout-rdcv32n1.stx";var Kr="./Popover-jjt7p7sn.stx";var Wr="./PopoverButton-ks3cttd9.stx";var Ur="./PopoverPanel-ddgj4gz3.stx";var Yr="./Portal-m73vz879.stx";var Xs=[{name:"phone",label:"Phone",width:390,height:844},{name:"tablet",label:"Tablet",width:820,height:1180},{name:"desktop",label:"Desktop",width:1280,height:800}];function Ys(e){let t=typeof e==="string"?Number.parseFloat(e):e;return typeof t==="number"&&Number.isFinite(t)&&t>0?Math.round(t):null}function At(e,t={}){let s=Ys(t.width),a=Ys(t.height),o=Boolean(t.landscape);if(s&&a)return{name:"custom",size:{width:s,height:a},landscape:!1};let n=Xs.find((r)=>r.name===e);if(!n)return{name:"fill",size:null,landscape:!1};let i=o&&n.height>n.width;return{name:n.name,size:i?{width:n.height,height:n.width}:{width:n.width,height:n.height},landscape:i}}function Zs(e,t,s=0){let a=t.width-s*2,o=t.height-s*2;if(a<=0||o<=0||e.width<=0||e.height<=0)return 1;return Math.min(1,a/e.width,o/e.height)}function Qs(e,t=1){if(!e.size)return"Fills the frame";let s=`${e.size.width} \xD7 ${e.size.height}`;return t<0.995?`${s} at ${Math.round(t*100)}%`:s}function Pt(e){return e==="light"||e==="dark"?e:"auto"}var Xr=["allow-same-origin","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols","allow-popups","allow-popups-to-escape-sandbox","allow-modals","allow-downloads","allow-pointer-lock","allow-presentation","allow-storage-access-by-user-activation"];function ea(e={}){let t=[];if(e.scripts)t.push("allow-scripts");if(e.forms)t.push("allow-forms");return t.join(" ")}function Cx(e){return!e.toLowerCase().split(/\s+/).filter(Boolean).some((s)=>Xr.includes(s))}var Zr=/<!doctype\s|<html[\s>]/i,qe=/<head(?:\s[^>]*)?>/i,We=/<html(?:\s[^>]*)?>/i,Qr=/<base[\s>]/i,el=/<meta[^>]+name\s*=\s*["']?color-scheme/i,tl=/\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)/gi,sl=/(<(style|script)\b[^>]*>)([\s\S]*?)(<\/\2\s*>)/gi,al=/(\smedia\s*=\s*)("[^"]*"|'[^']*')/gi,ol="(min-width: 0px)",nl="(max-width: 0px)";function il(e,t){let s=(n)=>n.replace(tl,(i,r)=>r.toLowerCase()===t?ol:nl),a=e.replace(sl,(n,i,r,c,l)=>i+s(c)+l).replace(al,(n,i,r)=>i+s(r)),o=`<style data-stx-preview-scheme>:root{color-scheme:${t} !important}</style>`;if(qe.test(a))return a.replace(qe,(n)=>n+o);if(We.test(a))return a.replace(We,(n)=>`${n}<head>${o}</head>`);return o+a}function rl(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ta(e,t={}){let s=ll(e,t);return t.forceScheme?il(s,t.forceScheme):s}function ll(e,t){let s=e==null?"":String(e),a='<base target="_blank">';if(!Zr.test(s))return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="color-scheme" content="light dark"><base target="_blank">${t.title?`<title>${rl(t.title)}</title>`:""}</head><body>${s}</body></html>`;if(Qr.test(s))return s;if(qe.test(s))return s.replace(qe,(o)=>o+'<base target="_blank">');if(We.test(s))return s.replace(We,(o)=>`${o}<head><base target="_blank"></head>`);return'<base target="_blank">'+s}function $x(e){return el.test(e)}function sa(e,t){let s=["fill",...Xs.map((o)=>o.name)],a=s.indexOf(e);return s[((a<0?0:a)+t+s.length)%s.length]}var dl="./PreviewFrame-erbgvzj8.stx";var pl=16,aa="(prefers-color-scheme: dark)",Ae;function hl(){if(Ae!==void 0)return Ae;try{if(typeof matchMedia!=="function"||!document.body)return!0;let e=matchMedia(aa).matches,t=document.createElement("iframe");t.setAttribute("aria-hidden","true"),t.tabIndex=-1,t.style.cssText=`position:absolute;width:1px;height:1px;border:0;opacity:0;pointer-events:none;color-scheme:${e?"light":"dark"}`,document.body.appendChild(t),t.offsetWidth;let s=t.contentWindow?.matchMedia?.(aa).matches;t.remove(),Ae=typeof s==="boolean"?s!==e:!0}catch{Ae=!0}return Ae}class ul{root;callbacks;html;viewportName;frameWidth;frameHeight;landscape;scheme;scripts;forms;title;viewport;scale=1;frame=null;written;stage;device;observer=null;pending=0;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;this.html=t.html??"",this.viewportName=t.viewport||"fill",this.frameWidth=t.frameWidth??null,this.frameHeight=t.frameHeight??null,this.landscape=Boolean(t.landscape),this.scheme=Pt(t.scheme),this.scripts=Boolean(t.scripts),this.forms=Boolean(t.forms),this.title=t.title||"Preview",this.viewport=this.resolve(),this.stage=this.part("stage"),this.device=this.part("device");let a=(n)=>this.onToolbarClick(n),o=(n)=>this.onToolbarKey(n);if(this.root.addEventListener("click",a),this.root.addEventListener("keydown",o),this.disposers.push(()=>this.root.removeEventListener("click",a),()=>this.root.removeEventListener("keydown",o)),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>{cancelAnimationFrame(this.pending),this.pending=requestAnimationFrame(()=>this.layout())}),this.observer.observe(this.stage);this.load(),this.reflect(),this.root.setAttribute("data-preview-ready","")}getState(){return{viewport:this.viewport.name,width:this.viewport.size?.width??null,height:this.viewport.size?.height??null,landscape:this.viewport.landscape,scale:this.scale,scheme:this.scheme,effectiveScheme:this.effectiveScheme()}}setHtml(e){let t=e==null?"":String(e);if(t===this.html)return;this.html=t,this.load()}setViewport(e,t={}){if(this.viewportName=e||"fill","landscape"in t)this.landscape=Boolean(t.landscape);if("width"in t)this.frameWidth=t.width??null;if("height"in t)this.frameHeight=t.height??null;let s=JSON.stringify(this.viewport);if(this.viewport=this.resolve(),this.layout(),this.reflect(),JSON.stringify(this.viewport)!==s)this.callbacks.onViewport?.(this.getState())}setScheme(e){let t=Pt(e);if(t===this.scheme)return;if(this.scheme=t,this.schemeToWrite()!==this.written)this.load();else this.applyScheme();this.reflect(),this.callbacks.onScheme?.(this.getState())}setPermissions(e){let t=e.scripts??this.scripts,s=e.forms??this.forms;if(t===this.scripts&&s===this.forms)return;this.scripts=t,this.forms=s,this.load()}reload(){this.load(),this.callbacks.onReload?.(this.getState())}destroy(){this.observer?.disconnect(),cancelAnimationFrame(this.pending);for(let e of this.disposers)e();this.frame?.remove(),this.frame=null,this.root.removeAttribute("data-preview-ready")}part(e){let t=this.root.querySelector(`[data-pf="${e}"]`);if(!t)throw Error(`PreviewFrame: the template has no ${e} part`);return t}resolve(){return At(this.viewportName,{width:this.frameWidth,height:this.frameHeight,landscape:this.landscape})}effectiveScheme(){if(this.scheme!=="auto")return this.scheme;if(this.root.closest(".dark"))return"dark";if(this.root.closest(".light"))return"light";return typeof matchMedia==="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}schemeToWrite(){if(hl())return;if(this.scheme==="auto"&&!this.root.closest(".dark, .light"))return;return this.effectiveScheme()}load(){let e=document.createElement("iframe");e.setAttribute("sandbox",ea({scripts:this.scripts,forms:this.forms})),e.setAttribute("referrerpolicy","no-referrer"),e.setAttribute("title",this.title),e.setAttribute("data-pf","frame"),e.className="stx-preview-frame",e.addEventListener("load",()=>{if(e===this.frame)this.callbacks.onLoad?.(this.getState())}),this.written=this.schemeToWrite(),e.srcdoc=ta(this.html,{title:this.title,forceScheme:this.written}),this.frame?.remove(),this.frame=e,this.applyScheme(),this.device.appendChild(e),this.layout()}applyScheme(){let e=this.effectiveScheme();if(this.root.setAttribute("data-scheme",e),this.frame)this.frame.style.colorScheme=e}layout(){let e=this.frame;if(!e)return;let t=this.viewport.size;if(this.root.setAttribute("data-viewport",this.viewport.name),!t)this.scale=1,this.device.style.width="",this.device.style.height="",e.style.width="",e.style.height="",e.style.transform="";else{let a=this.stage.getBoundingClientRect();this.scale=Zs(t,{width:a.width,height:a.height},pl),this.device.style.width=`${t.width*this.scale}px`,this.device.style.height=`${t.height*this.scale}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.style.transform=this.scale===1?"":`scale(${this.scale})`}let s=this.root.querySelector('[data-pf="size"]');if(s)s.textContent=Qs(this.viewport,this.scale)}reflect(){for(let a of this.root.querySelectorAll("[data-pf-viewport]")){let o=a.getAttribute("data-pf-viewport")===this.viewport.name;a.setAttribute("aria-checked",String(o)),a.tabIndex=o?0:-1}if(!this.root.querySelector('[data-pf-viewport][tabindex="0"]'))this.root.querySelector("[data-pf-viewport]")?.setAttribute("tabindex","0");let e=this.effectiveScheme()==="dark",t=this.root.querySelector('[data-pf-action="scheme"]');if(t){t.setAttribute("aria-pressed",String(e));let a=t.querySelector('[data-pf="scheme-text"]');if(a)a.textContent=e?"Dark":"Light"}let s=this.root.querySelector('[data-pf-action="rotate"]');if(s){let a=At(this.viewportName,{width:this.frameWidth,height:this.frameHeight}).size;s.disabled=!a||this.viewport.name==="custom"||a.height<=a.width,s.setAttribute("aria-pressed",String(this.viewport.landscape))}}onToolbarClick(e){let t=e.target instanceof Element?e.target.closest("[data-pf-viewport], [data-pf-action]"):null;if(!t||!this.root.contains(t))return;let s=t.getAttribute("data-pf-viewport");if(s){this.setViewport(s,{width:null,height:null});return}switch(t.getAttribute("data-pf-action")){case"scheme":this.setScheme(this.effectiveScheme()==="dark"?"light":"dark");break;case"rotate":this.setViewport(this.viewportName,{landscape:!this.landscape});break;case"reload":this.reload();break}}onToolbarKey(e){let t=e.target instanceof Element?e.target.closest("[data-pf-viewport]"):null;if(!t)return;let s=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(s===0)return;e.preventDefault();let a=t.getAttribute("data-pf-viewport")||"fill",o=sa(a,s);this.setViewport(o,{width:null,height:null}),this.root.querySelector(`[data-pf-viewport="${o}"]`)?.focus()}}var ml="./Progress-2qzb77kc.stx";var xl="./Radio-8153x74w.stx";var vl="./RadioGroup-ps9kn22f.stx";var yl="./RadioGroupDescription-z34r9avr.stx";var Sl="./RadioGroupLabel-ka0hfm7b.stx";var $l="./RadioGroupOption-6hyy1bvb.stx";var El="./SegmentedControl-b93n9n2v.stx";var Al="./Select-p8mgxthn.stx";var Z={NONE:0,KEYWORD:1,SUBSTRING:2,WORD_PREFIX:3,PREFIX:4},tb=700,Ge=1600;function ve(e){return`stx:settings:${e}`}function U(e,t){if(!t)return null;return e.find((s)=>s.id===t)??null}function Pl(e){return(e.find((s)=>!s.parent)??e[0])?.id??""}function Ue(e,...t){for(let s of t)if(U(e,s))return s;return Pl(e)}function Je(e,t){let s=new Set,a=U(e,t);while(a&&a.parent&&!s.has(a.id)){s.add(a.id);let o=U(e,a.parent);if(!o)break;a=o}return a?.id??""}function he(e,t){let s=U(e,t);if(!s?.parent||s.parent===t)return"";return U(e,s.parent)?s.parent:""}function Ye(){return{trail:[],cursor:-1}}function ue(e){return e.trail[e.cursor]??""}function Pe(e,t){if(!t||ue(e)===t)return e;let s=[...e.trail.slice(0,e.cursor+1),t];return{trail:s,cursor:s.length-1}}function Me(e){return e.cursor<e.trail.length-1}function Xe(e,t=[]){if(e.cursor>0)return!0;return e.cursor===0&&he(t,ue(e))!==""}function Ze(e,t=[]){if(e.cursor>0)return{trail:e.trail,cursor:e.cursor-1};if(e.cursor===0){let s=he(t,ue(e));if(s)return{trail:[s,...e.trail],cursor:0}}return e}function Qe(e){return Me(e)?{trail:e.trail,cursor:e.cursor+1}:e}function pe(e){return String(e??"").normalize("NFD").replace(/[\u0300-\u036F]/g,"").toLowerCase().replace(/\s+/g," ").trim()}function oa(e,t){let s=e.indexOf(t);while(s!==-1){if(s===0||!/[\p{L}\p{N}]/u.test(e.charAt(s-1)))return!0;s=e.indexOf(t,s+1)}return!1}function na(e,t,s){if(t.startsWith(e))return Z.PREFIX;if(oa(t,e))return Z.WORD_PREFIX;if(t.includes(e))return Z.SUBSTRING;if(oa(s,e))return Z.KEYWORD;return Z.NONE}function ia(e,t,s=""){let a=pe(e);if(a==="")return Z.NONE;let o=pe(t),n=pe(s),i=na(a,o,n),r=a.split(" ");if(i!==Z.NONE||r.length===1)return i;let c=Z.PREFIX;for(let l of r){let d=na(l,o,n);if(d===Z.NONE)return Z.NONE;c=Math.min(c,d===Z.PREFIX&&l!==r[0]?Z.WORD_PREFIX:d)}return c}function et(e,t){let s=pe(e);if(s==="")return{query:"",panes:[],settings:[]};let a=[];for(let n of t.items){let i=U(t.panes,n.id),r=`${n.keywords??""} ${i?.keywords??""} ${i&&i.title!==n.label?i.title:""}`;if(ia(s,n.label,r)!==Z.NONE)a.push(n.id)}let o=[];return t.rows.forEach((n,i)=>{if(!n.label)return;let c=U(t.panes,n.pane)?.title??"",l=ia(s,n.label,`${n.keywords??""} ${c}`);if(l!==Z.NONE)o.push({id:n.id,label:n.label,pane:n.pane,paneTitle:c,row:i,rank:l})}),o.sort((n,i)=>i.rank-n.rank||n.row-i.row),{query:s,panes:a,settings:o}}function ra(e){if(e<=0)return"No results";return e===1?"1 result":`${e} results`}function Mt(e,t,s){if(s<=0)return-1;if(e==="ArrowDown")return Math.min(s-1,t+1);if(e==="ArrowUp")return t<0?s-1:Math.max(0,t-1);if(e==="Home")return 0;if(e==="End")return s-1;return-1}function la(e,t,s,a=700){return{buffer:(!e||s-e.at>a?"":e.buffer)+pe(t),at:s}}function ca(e,t,s){let a=e.length,o=pe(t);if(a===0||o==="")return-1;let n=o.split("").every((c)=>c===o.charAt(0)),i=n?o.charAt(0):o,r=n?s+1:Math.max(0,s);for(let c=0;c<a;c++){let l=((r+c)%a+a)%a;if(pe(e[l]).startsWith(i))return l}return-1}var Nl="./SettingsGroup-g1hnxp1p.stx";var Ll="./SettingsPane-9svk1w3e.stx";var Dl="./SettingsPaneHeader-am42srhp.stx";var Hl="./SettingsRow-kgda3nv1.stx";var jl="./SettingsSidebarGroup-4ag5qjpw.stx";var Bl="./SettingsSidebarItem-ga2jxq53.stx";var Kl="./SettingsUpdateRow-ajpnqx8a.stx";var Wl="./SettingsWindow-586aps08.stx";var Gl="data-stx-settings",we="data-settings-item",ye="data-settings-pane",Ul="data-settings-row";class Jl{tree;root;options;callbacks;history=Ye();current="";query="";hits=[];highlighted=null;highlightTimer=null;pressed=new Map;visible=new Map;disposers=[];destroyed=!1;constructor(e,t,s={},a={}){this.tree=e;this.root=t;this.options=s;this.callbacks=a;this.hear(),this.disposers.push(e.observeChildren(t,()=>{if(this.destroyed)return;this.hear(),this.show(!1),this.applySearch(!1)}));let o=this.panes(),n=this.paneNodes().find((i)=>this.tree.getAttribute(i,"data-active")!=null);this.history=Pe(this.history,Ue(o,this.stored(),s.pane,n?this.attribute(n,ye):"")),this.show(!0),this.applySearch(!1)}getPane(){return this.current}showPane(e){if(!U(this.panes(),e))return!1;return this.open(e),!0}revealSetting(e){if(!e)return!1;let t=this.rowNodes().find((a)=>this.attribute(a,"data-setting")===e),s=t?this.paneOf(t):"";if(!t||!s)return!1;return this.open(s),this.reveal(t),!0}back(){this.travel(Ze(this.history,this.panes()))}forward(){this.travel(Qe(this.history))}search(e){this.query=String(e??""),this.applySearch(!0)}chooseResult(e){let t=this.hits[e];if(!t||this.tree.parent(t.row)===null)return;this.open(t.hit.pane),this.reveal(t.row)}destroy(){this.destroyed=!0;for(let e of this.disposers)e();this.disposers.length=0;for(let e of this.pressed.values())e();this.pressed.clear(),this.visible.clear(),this.clearHighlight()}attribute(e,t){return this.tree.getAttribute(e,t)??""}toggle(e,t){let s=this.attribute(e,"class").split(/\s+/).filter(Boolean),a=this.visible.has(e)?this.visible.get(e):!s.includes("hidden");if(this.visible.set(e,t),a===t)return;let o=s.filter((n)=>n!=="hidden");this.tree.setAttribute(e,"class",(t?o:[...o,"hidden"]).join(" "))}has(e,t){return this.tree.getAttribute(e,t)!=null}closest(e,t){for(let s=e;s;s=this.tree.parent(s))if(this.has(s,t))return s;return null}all(e,t=this.root){return this.tree.descendants(t).filter((s)=>this.has(s,e)&&this.closest(this.tree.parent(s),Gl)===this.root)}paneNodes(){return this.all(ye)}panes(){return this.paneNodes().map((e)=>{let t=this.attribute(e,ye);return{id:t,title:this.attribute(e,"data-title")||t,keywords:this.attribute(e,"data-keywords"),parent:this.attribute(e,"data-parent")}})}itemNodes(){return this.all(we)}items(){return this.itemNodes().map((e)=>({id:this.attribute(e,we),label:this.attribute(e,"data-label").trim(),keywords:this.attribute(e,"data-keywords")}))}rowNodes(){return this.all(Ul).filter((e)=>this.paneOf(e)!=="")}paneOf(e){let t=this.closest(e,ye);return t?this.attribute(t,ye):""}stored(){if(!this.options.storageKey||!this.options.storage)return"";try{return this.options.storage.get(ve(this.options.storageKey))||""}catch{return""}}store(){if(!this.options.storageKey||!this.options.storage||!this.current)return;try{this.options.storage.set(ve(this.options.storageKey),this.current)}catch{}}hear(){let e=new Set;for(let t of this.itemNodes())if(e.add(t),!this.pressed.has(t))this.pressed.set(t,this.tree.listen(t,"click",()=>this.open(this.attribute(t,we))));for(let t of this.rowNodes()){if(!this.has(t,"data-navigate"))continue;if(e.add(t),!this.pressed.has(t))this.pressed.set(t,this.tree.listen(t,"click",()=>this.navigate(t)))}for(let[t,s]of this.pressed){if(e.has(t))continue;s(),this.pressed.delete(t)}}navigate(e){if(this.attribute(e,"aria-disabled")==="true")return;let t=this.attribute(e,"data-navigate");if(!U(this.panes(),t))return;let s=this.current;this.open(t),this.callbacks.onNavigate?.({id:t,from:s,setting:this.attribute(e,"data-setting")})}open(e){if(!e)return;this.history=Pe(this.history,e),this.show(!0)}travel(e){if(e===this.history)return;this.history=e,this.show(!0)}show(e){let t=this.panes(),s=ue(this.history),a=U(t,s);if(!a)return;for(let i of this.paneNodes())this.toggle(i,this.attribute(i,ye)===s);let o=Je(t,s);for(let i of this.itemNodes()){let r=this.attribute(i,we)===o;for(let c of[i,...this.tree.descendants(i)])this.tree.setAttribute(c,"aria-selected",r?"true":"false")}let n=this.current!==s;if(this.current=s,this.report(),n){if(this.store(),e)this.callbacks.onPane?.({id:s,title:a.title,parent:he(t,s)})}}report(){let e=this.panes(),t=U(e,this.current),s=this.query.trim()!=="";this.callbacks.onState?.({pane:this.current,title:t?.title??"",canGoBack:Xe(this.history,e),canGoForward:Me(this.history),query:this.query,searching:s,results:this.hits.map(({hit:a},o)=>({position:o,label:a.label,pane:a.paneTitle})),empty:s&&this.shownItems===0&&this.hits.length===0})}shownItems=0;applySearch(e){let t=this.rowNodes(),s=t.map((r)=>({id:this.attribute(r,"data-setting"),label:this.attribute(r,"data-label").trim(),keywords:this.attribute(r,"data-keywords"),pane:this.paneOf(r)})),a=et(this.query,{panes:this.panes(),items:this.items(),rows:s}),o=a.query!=="",n=new Set;for(let r of this.itemNodes()){let c=!o||a.panes.includes(this.attribute(r,we));if(c)n.add(r);this.toggle(r,c)}this.shownItems=o?a.panes.length:n.size;let i=!0;for(let r of this.all("data-settings-group")){let c=this.all(we,r).some((l)=>n.has(l));this.toggle(r,c);for(let l of this.all("data-settings-group-gap",r))this.toggle(l,c&&!i);if(c)i=!1}for(let r of this.all("data-settings-account"))this.toggle(r,!o);if(this.hits=a.settings.map((r)=>({hit:r,row:t[r.row]})),this.report(),e)this.callbacks.onSearch?.({query:this.query.trim(),panes:a.panes,settings:a.settings.map((r)=>({id:r.id,label:r.label,pane:r.pane}))})}reveal(e){this.clearHighlight(),this.tree.setAttribute(e,"data-highlight","");let t=this.options.wash?.();if(t)this.tree.setStyle(e,{backgroundColor:t});this.highlighted=e,this.highlightTimer=setTimeout(()=>this.clearHighlight(),Ge)}clearHighlight(){if(this.highlightTimer)clearTimeout(this.highlightTimer);if(this.highlightTimer=null,this.highlighted)this.tree.removeAttribute(this.highlighted,"data-highlight"),this.tree.setStyle(this.highlighted,{backgroundColor:"transparent"});this.highlighted=null}}var ub={grey:"bg-[#8e8e93] dark:bg-[#8e8e93]",blue:"bg-[#007aff] dark:bg-[#0a84ff]",red:"bg-[#ff3b30] dark:bg-[#ff453a]",orange:"bg-[#ff9500] dark:bg-[#ff9f0a]",yellow:"bg-[#ffcc00] dark:bg-[#ffd60a]",green:"bg-[#34c759] dark:bg-[#30d158]",indigo:"bg-[#5856d6] dark:bg-[#5e5ce6]",purple:"bg-[#af52de] dark:bg-[#bf5af2]",pink:"bg-[#ff2d55] dark:bg-[#ff375f]",ink:"bg-[#1d1d1f] dark:bg-[#dcdce0]"};function fb(e){return e==="ink"?"text-[#ffffff] dark:text-[#1d1d1f]":"text-[#ffffff]"}var le="text-[#000000]/85 dark:text-[#ffffff]/85",ee="text-[#000000]/50 dark:text-[#ffffff]/55",da="text-[#000000]/26 dark:text-[#ffffff]/25",Nt="text-[#ff3b30] dark:text-[#ff453a]",Yl="text-[#007aff] dark:text-[#0a84ff]",Xl="aria-selected:bg-[#007aff] dark:aria-selected:bg-[#0a84ff]",pa="aria-selected:text-[#ffffff] dark:aria-selected:text-[#ffffff]",Zl="bg-[#000000]/10 dark:bg-[#ffffff]/10",ha="bg-[#000000]/4 dark:bg-[#ffffff]/5",mb={shell:"flex-1 flex-row",sidebar:"flex-col bg-[#f2f1f0] dark:bg-[#2a2a2a]",sidebarWidth:226,sidebarMaterial:"sidebar",sidebarTop:"pt-[38px] px-[9px] pb-[6px]",search:"h-[28px] text-[13px]",nav:"flex-1 flex-col px-[9px] pb-[12px]",account:"mt-[7px]",list:"flex-col pt-[7px]",results:"flex-col gap-[2px] pt-[7px]",result:"flex-col justify-center min-h-[38px] px-[8px] py-[4px] rounded-[8px] hover:bg-[#000000]/5 dark:hover:bg-[#ffffff]/6",resultLabel:`text-[13px] ${le}`,resultPane:`text-[11px] ${ee}`,empty:`py-[24px] px-[8px] text-[13px] text-center ${ee}`,group:"flex-col gap-[2px]",groupGap:"h-[11px]",groupLabel:`px-[8px] pb-[3px] text-[11px] font-semibold ${ee}`,item:`flex-row items-center gap-[8px] h-[30px] px-[8px] rounded-[8px] ${Xl}`,itemTile:"h-[20px] w-[20px] rounded-[5.5px] items-center justify-center",itemGlyph:"h-[13px] w-[13px]",itemLabel:`flex-1 text-[13px] ${le} ${pa}`,itemBadge:`text-[11px] ${ee} ${pa}`,detail:"flex-1 flex-col bg-[#ffffff] dark:bg-[#1e1e1e]",toolbar:"flex-row items-center gap-[12px] h-[52px] pl-[8px] pr-[16px]",history:"flex-row items-center",historyButton:`text-[15px] ${ee}`,title:`flex-1 text-[20px] font-semibold ${le}`,body:"flex-1 flex-col",pane:"flex-1",paneContent:"flex-col px-[20px] pt-[11px] pb-[20px]",hero:`flex-col items-center mb-[10px] p-[22px] rounded-[12px] ${ha}`,heroTile:"h-[48px] w-[48px] rounded-[12px] items-center justify-center",heroGlyph:"h-[30px] w-[30px]",heroTitle:`mt-[10px] text-[17px] font-semibold text-center ${le}`,heroDescription:`mt-[4px] text-[13px] text-center ${ee}`,heroExtra:"mt-[8px] flex-col items-center",section:"flex-col mb-[10px]",sectionHeader:`pt-[18px] px-[10px] pb-[8px] text-[13px] font-bold ${le}`,card:`flex-col rounded-[12px] ${ha}`,sectionFooter:`pt-[6px] px-[10px] text-[11px] ${ee}`,rowRule:`mx-[10px] h-[0.5px] ${Zl}`,row:"flex-row items-center gap-[10px] min-h-[38px] px-[10px]",rowTall:"min-h-[44px]",rowMultiline:"items-start",rowStacked:"flex-col items-stretch gap-[4px] min-h-[38px] px-[10px]",rowPressed:"active:bg-[#000000]/5 dark:active:bg-[#ffffff]/6",rowWash:{light:"#007aff33",dark:"#0a84ff33"},rowTile:"h-[24px] w-[24px] rounded-[6px] items-center justify-center",rowTileMultiline:"mt-[10px]",rowGlyph:"h-[15px] w-[15px]",rowText:"flex-1 flex-col justify-center py-[7px]",rowTextMultiline:"flex-1 flex-col py-[10px]",rowTextStacked:"flex-col pt-[10px]",rowLabel:`text-[13px] ${le}`,rowLabelDestructive:`text-[13px] ${Nt}`,rowDescription:`mt-[1px] text-[11px] ${ee}`,rowControl:"flex-row items-center justify-end gap-[8px]",rowControlMultiline:"flex-row items-center justify-end gap-[8px] py-[10px]",rowControlStacked:"flex-col items-stretch pb-[7px]",rowValue:`text-[13px] ${ee}`,rowChevron:`h-[11px] w-[11px] ${da}`,rowDisabled:"opacity-50",appearance:"flex-row gap-[14px]",appearanceOption:"flex-col items-center gap-[5px]",appearanceFrame:"p-[3px] rounded-[9px] border-2 border-transparent aria-checked:border-[#007aff] dark:aria-checked:border-[#0a84ff]",appearanceThumb:"h-[44px] w-[67px] flex-row rounded-[6px] overflow-hidden",appearanceLight:"flex-1 bg-[#e9e9eb]",appearanceDark:"flex-1 bg-[#2c2c2e]",appearanceCaption:`text-[11px] ${le}`,updateStatus:`mt-[1px] text-[11px] ${ee}`,updateError:`mt-[1px] text-[11px] ${Nt}`,updateProgress:`text-[11px] ${ee}`,ink:le,inkSecondary:ee,inkTertiary:da,danger:Nt,accentText:Yl},gb={back:"chevron.left",forward:"chevron.right",disclosure:"chevron.right"};var Ql={check:"Check Now",install:"Download and Install",relaunch:"Restart to Update"};function ec(e){let t=Number(e);if(!Number.isFinite(t))return"";return`${Math.round(Math.min(1,Math.max(0,t))*100)}%`}function bb(e,t=""){let s=String(t||"").trim(),a=String(e?.currentVersion||"").trim(),o=[s,a].filter(Boolean).join(" "),n=(h,p,u={})=>({title:o,sentence:h,action:p,actionLabel:p?Ql[p]:"",busy:!1,progress:"",failed:!1,...u});if(!e||typeof e.state!=="string")return n("",null);let i=s||"This app",r=String(e.version||"").trim(),c=r?`Version ${r}`:"An update",l=e.selfUpdating!==!1,d=String(e.reason||"").trim();switch(e.state){case"unavailable":return n(d||`${i} cannot update itself.`,null);case"idle":return n("Check for a newer version.","check");case"checking":return n("Checking for updates...","check",{busy:!0});case"current":return n(`${i} is up to date.`,"check");case"available":return l?n(`${c} is available.`,"install"):n(`${c} is available. ${d||`${i} cannot update itself.`}`,"check");case"downloading":return n(`Downloading ${r?`version ${r}`:"the update"}...`,"install",{busy:!0,progress:ec(e.progress)});case"installing":return n(`Installing ${r?`version ${r}`:"the update"}...`,"install",{busy:!0});case"installed":return n(`${c} is installed. Restart ${i} to finish updating.`,"relaunch");case"error":return n(String(e.error||"").trim()||"The update could not be completed.","check",{failed:!0});default:return n("",null)}}var Rt="[data-stx-settings]",tt="[data-settings-item]",ua="[data-settings-pane]",tc="[data-settings-row]",Lt="[data-settings-result]",sc='button, a[href], input, select, textarea, label, [role="switch"], [role="checkbox"], [role="radio"], [role="slider"], [role="button"], [contenteditable]';function fa(e){return e.replace(/[^\w-]+/g,"-")}class ac{root;callbacks;history=Ye();current="";query="";storageKey;typed=null;hits=[];highlighted=null;highlightTimer=null;disposers=[];list;account;input;field;results;empty;live;backButton;forwardButton;title;body;constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.storageKey=t.storageKey||"",!e.id)e.id=`settings-${Math.random().toString(36).slice(2,8)}`;this.list=this.own("[data-settings-list]"),this.account=this.own("[data-settings-account]"),this.input=this.own("[data-settings-search-input]"),this.field=this.own("[data-settings-search]"),this.results=this.own("[data-settings-results]"),this.empty=this.own("[data-settings-empty]"),this.live=this.own("[data-settings-live]"),this.backButton=this.own("[data-settings-back]"),this.forwardButton=this.own("[data-settings-forward]"),this.title=this.own("[data-settings-title]"),this.body=this.own("[data-settings-body]");for(let n of[this.results,this.live,this.title])if(n)n.__stx_inert_content=!0;if(this.listen(e,"click",(n)=>this.onClick(n)),this.listen(t.globalKeys?document:e,"keydown",(n)=>this.onKeyDown(n)),this.input)this.listen(this.input,"input",()=>this.search(this.input.value));if(this.body)this.listen(this.body,"scroll",()=>this.syncScrolled(),{passive:!0});this.listen(window,"focus",()=>e.setAttribute("data-stx-window-active","true")),this.listen(window,"blur",()=>e.setAttribute("data-stx-window-active","false")),this.describe();let a=this.panes(),o=this.paneElements().find((n)=>!n.hidden)?.getAttribute("data-settings-pane");this.open(Ue(a,this.stored(),t.pane,o)),e.setAttribute("data-settings-ready","")}getPane(){return this.current}showPane(e){if(!U(this.panes(),e))return!1;return this.open(e),!0}revealSetting(e){if(!e)return!1;let t=this.rowElements().find((a)=>a.getAttribute("data-setting")===e),s=t?this.paneOf(t):"";if(!t||!s)return!1;return this.open(s),this.reveal(t),!0}back(){this.travel(Ze(this.history,this.panes()))}forward(){this.travel(Qe(this.history))}focusSearch(){if(!this.input)return;this.input.focus(),this.input.select()}search(e){if(this.query=e,this.input&&this.input.value!==e)this.input.value=e;this.applySearch(!0)}destroy(){for(let e of this.disposers)e();this.disposers.length=0,this.clearHighlight(),this.root.removeAttribute("data-settings-ready")}own(e){return this.all(e)[0]??null}all(e,t=this.root){return Array.from(t.querySelectorAll(e)).filter((s)=>s.closest(Rt)===this.root)}listen(e,t,s,a){e.addEventListener(t,s,a),this.disposers.push(()=>e.removeEventListener(t,s,a))}paneElements(){return this.all(ua)}paneElement(e){return this.paneElements().find((t)=>t.getAttribute("data-settings-pane")===e)??null}panes(){return this.paneElements().map((e)=>({id:e.getAttribute("data-settings-pane")||"",title:e.getAttribute("data-title")||e.getAttribute("data-settings-pane")||"",keywords:e.getAttribute("data-keywords")||"",parent:e.getAttribute("data-parent")||""})).filter((e)=>e.id!=="")}itemElements(){return this.list?this.all(tt,this.list):[]}visibleItems(){return this.itemElements().filter((e)=>!e.hidden&&!e.disabled)}labelOf(e){return(e.querySelector(".stx-settings-item-label")?.textContent||e.getAttribute("aria-label")||e.textContent||"").trim()}items(){return this.itemElements().map((e)=>({id:e.getAttribute("data-settings-item")||"",label:this.labelOf(e),keywords:e.getAttribute("data-keywords")||""}))}rowElements(){return this.all(tc).filter((e)=>this.paneOf(e)!=="")}paneOf(e){return e.closest(ua)?.getAttribute("data-settings-pane")||""}stored(){if(!this.storageKey)return"";try{return localStorage.getItem(ve(this.storageKey))||""}catch{return""}}store(){if(!this.storageKey||!this.current)return;try{localStorage.setItem(ve(this.storageKey),this.current)}catch{}}describe(){let e=this.root.id,t=new Map;for(let s of this.itemElements()){let a=s.getAttribute("data-settings-item")||"";if(!s.id)s.id=`${e}-item-${fa(a)}`;s.setAttribute("role","tab"),t.set(a,s);for(let o=s.parentElement;o&&o!==this.list;o=o.parentElement)if(!o.hasAttribute("role"))o.setAttribute("role","presentation")}for(let s of this.paneElements()){let a=s.getAttribute("data-settings-pane")||"";if(!s.id)s.id=`${e}-pane-${fa(a)}`;let o=t.get(a);if(o)o.setAttribute("aria-controls",s.id),s.setAttribute("role","tabpanel"),s.setAttribute("aria-labelledby",o.id),s.removeAttribute("aria-label");else if(this.title?.id){if(s.setAttribute("role","region"),!s.hasAttribute("aria-label"))s.setAttribute("aria-label",s.getAttribute("data-title")||a)}}}open(e){if(!e)return;this.history=Pe(this.history,e),this.show()}travel(e){if(e===this.history)return;this.history=e,this.show()}show(){this.describe();let e=this.panes(),t=ue(this.history),s=U(e,t),a=this.paneElement(t);if(!s||!a)return;let o=document.activeElement,n=o instanceof HTMLElement&&this.paneElements().some((c)=>c!==a&&c.contains(o));for(let c of this.paneElements())c.hidden=c!==a,c.toggleAttribute("data-active",c===a);let i=Je(e,t);for(let c of this.itemElements()){let l=c.getAttribute("data-settings-item")===i;c.setAttribute("aria-selected",l?"true":"false"),c.toggleAttribute("data-active",l)}if(this.syncTabStops(),this.title)this.title.textContent=s.title;this.root.setAttribute("data-pane",t),this.root.toggleAttribute("data-subpane",he(e,t)!==""),this.syncHistoryButtons(e);let r=t!==this.current;if(this.current=t,r){if(this.clearHighlight(),this.body)this.body.scrollTop=0;if(this.syncScrolled(),n){if(!a.hasAttribute("tabindex"))a.setAttribute("tabindex","-1");a.focus({preventScroll:!0})}this.store(),this.callbacks.onPane?.({id:t,title:s.title,parent:he(e,t)})}}syncTabStops(){let e=this.visibleItems(),t=e.find((s)=>s.getAttribute("aria-selected")==="true")??e[0];for(let s of this.itemElements())s.setAttribute("tabindex",s===t?"0":"-1")}syncHistoryButtons(e){let t=(o,n,i)=>{if(!o)return;let r=document.activeElement===o;if(o.disabled=!n,r&&!n&&i&&!i.disabled)i.focus()},s=Xe(this.history,e),a=Me(this.history);if(s)t(this.backButton,!0,null),t(this.forwardButton,a,this.backButton);else t(this.forwardButton,a,null),t(this.backButton,!1,this.forwardButton)}syncScrolled(){this.root.toggleAttribute("data-scrolled",Boolean(this.body&&this.body.scrollTop>0))}applySearch(e){let t=this.rowElements(),s=t.map((i)=>({id:i.getAttribute("data-setting")||"",label:(i.getAttribute("data-label")||"").trim(),keywords:i.getAttribute("data-keywords")||"",pane:this.paneOf(i)})),a=et(this.query,{panes:this.panes(),items:this.items(),rows:s}),o=a.query!=="";this.root.toggleAttribute("data-searching",o),this.field?.toggleAttribute("data-filled",this.query!=="");for(let i of this.itemElements())i.hidden=o&&!a.panes.includes(i.getAttribute("data-settings-item")||"");if(this.list){for(let i of this.all("[data-settings-group]",this.list))i.hidden=o&&this.all(tt,i).every((r)=>r.hidden);this.list.hidden=o&&a.panes.length===0}if(this.account)this.account.hidden=o;this.hits=a.settings.map((i)=>({hit:i,row:t[i.row]})),this.drawResults();let n=a.panes.length+a.settings.length;if(this.empty)this.empty.hidden=!o||n>0;if(this.live)this.live.textContent=o?ra(n):"";if(this.syncTabStops(),e)this.callbacks.onSearch?.({query:this.query.trim(),panes:a.panes,settings:a.settings.map((i)=>({id:i.id,label:i.label,pane:i.pane}))})}drawResults(){let e=this.results;if(!e)return;e.replaceChildren(),e.hidden=this.hits.length===0,this.hits.forEach(({hit:t},s)=>{let a=document.createElement("button");a.type="button",a.className="stx-settings-result",a.setAttribute("data-settings-result",String(s)),a.setAttribute("tabindex","-1");let o=document.createElement("span");o.className="stx-settings-result-label",o.textContent=t.label;let n=document.createElement("span");n.className="stx-settings-result-pane",n.textContent=t.paneTitle,a.append(o,n),e.append(a)})}chooseResult(e){let t=this.hits[e];if(!t||!t.row.isConnected)return;this.open(t.hit.pane),this.reveal(t.row)}clearSearch(){if(this.query===""&&(!this.input||this.input.value===""))return;this.search("")}reveal(e){if(this.body){let t=this.body.getBoundingClientRect(),s=e.getBoundingClientRect();this.body.scrollTop+=s.top-t.top-(t.height-s.height)/2,this.syncScrolled()}this.clearHighlight(),e.setAttribute("data-highlight",""),this.highlighted=e,this.highlightTimer=setTimeout(()=>this.clearHighlight(),Ge)}clearHighlight(){if(this.highlightTimer)clearTimeout(this.highlightTimer);this.highlightTimer=null,this.highlighted?.removeAttribute("data-highlight"),this.highlighted=null}inside(e){return e instanceof Element&&e.closest(Rt)===this.root}navigationRow(e){let t=e.closest("[data-navigate]");if(!t||t.closest(Rt)!==this.root||t.getAttribute("aria-disabled")==="true")return null;let s=e.closest(sc);if(s&&s!==t&&t.contains(s))return null;return t}navigate(e){let t=e.getAttribute("data-navigate")||"";if(!U(this.panes(),t))return;let s=this.current;this.open(t),this.callbacks.onNavigate?.({id:t,from:s,setting:e.getAttribute("data-setting")||""})}onClick(e){let t=e.target;if(!this.inside(t))return;let s=t.closest(tt);if(s&&this.list?.contains(s)){this.open(s.getAttribute("data-settings-item")||"");return}let a=t.closest(Lt);if(a){this.chooseResult(Number(a.getAttribute("data-settings-result")));return}if(t.closest("[data-settings-back]")){this.back();return}if(t.closest("[data-settings-forward]")){this.forward();return}if(t.closest("[data-settings-search-clear]")){this.clearSearch(),this.input?.focus();return}let o=this.navigationRow(t);if(o)this.navigate(o)}onKeyDown(e){if(e.defaultPrevented)return;let t=(e.metaKey||e.ctrlKey)&&!e.altKey;if(t&&!e.shiftKey){let n=e.key.toLowerCase();if(n==="f"&&this.input){e.preventDefault(),this.focusSearch();return}if(n==="["){e.preventDefault(),this.back();return}if(n==="]"){e.preventDefault(),this.forward();return}}let s=e.target;if(!this.inside(s))return;if(e.key==="Escape"&&this.query!==""){e.preventDefault(),this.clearSearch(),this.visibleItems().find((n)=>n.getAttribute("tabindex")==="0")?.focus();return}if(s===this.input){this.onSearchKey(e);return}let a=s.closest(Lt);if(a){this.onResultKey(e,a);return}let o=s.closest(tt);if(o&&this.list?.contains(o)){this.onItemKey(e,o);return}if((e.key==="Enter"||e.key===" ")&&!t&&!e.altKey){let n=s.closest("[data-navigate]");if(n&&n===s&&this.navigationRow(s))e.preventDefault(),this.navigate(n)}}resultButtons(){return this.results?Array.from(this.results.querySelectorAll(Lt)):[]}onSearchKey(e){if(e.key==="ArrowDown"){let t=this.visibleItems()[0]??this.resultButtons()[0];if(t)e.preventDefault(),t.focus()}else if(e.key==="Enter"&&this.query.trim()!==""){e.preventDefault();let t=this.visibleItems()[0];if(t)this.open(t.getAttribute("data-settings-item")||"");else this.chooseResult(0)}}onResultKey(e,t){let s=this.resultButtons(),a=s.indexOf(t);if(e.key==="ArrowUp"&&a===0){let n=this.visibleItems(),i=n[n.length-1]??this.input;if(i)e.preventDefault(),i.focus();return}let o=Mt(e.key,a,s.length);if(o===-1)return;e.preventDefault(),s[o].focus()}onItemKey(e,t){if(e.metaKey||e.ctrlKey||e.altKey)return;let s=this.visibleItems(),a=s.indexOf(t);if(e.key==="ArrowDown"&&a===s.length-1){let n=this.resultButtons()[0];if(n){e.preventDefault(),n.focus();return}}let o=Mt(e.key,a,s.length);if(o===-1&&e.key.length===1&&(e.key!==" "||this.typed!==null)){let n=la(this.typed,e.key,Date.now());if(e.key===" "&&n.buffer.trim()===""){this.typed=null;return}if(this.typed=n,o=ca(s.map((i)=>this.labelOf(i)),n.buffer,a),o===-1){e.preventDefault();return}}if(o===-1)return;e.preventDefault(),s[o].focus(),this.open(s[o].getAttribute("data-settings-item")||"")}}var nc="./Sidebar-8dygywjv.stx";var rc="./SidebarFooter-s7skj92y.stx";var cc="./SidebarHeader-x7jdhmyr.stx";var pc="./SidebarItem-64sjb2fe.stx";var uc="./SidebarPinned-48kyk193.stx";var mc="./SidebarSection-vx5bahsk.stx";var xc="./SidebarSpace-bwv98azf.stx";var vc="./SidebarSpaces-mdtrynr2.stx";var yc="./SidebarSpaceSwitcher-1mycft2g.stx";var st={blue:"#0088ff",red:"#ff383c",pink:"#ff2d55",orange:"#ff8d28",yellow:"#ffcc00",green:"#34c759",teal:"#00c3d0",cyan:"#00c0e8",indigo:"#6155f5",purple:"#cb30e0",brown:"#ac7f5e",gray:"#8e8e93"},fe={pane:["bg-[#f2f2f4]/90 dark:bg-[#1c1c1e]/88","backdrop-blur-[50px] backdrop-saturate-[180%]","text-black dark:text-white","select-none"].join(" "),selection:"accent",layers:{shimmerRim:!0},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[10px] pb-[10px]",sectionHeader:["group/section flex w-full items-center","pl-[8px] pr-[6px] pt-[16px] pb-[5px]","text-[11px] font-semibold leading-[13px]","text-[#3c3c43]/75 dark:text-[#ebebf5]/60"].join(" "),sectionChevron:["i-f7-chevron-down h-[11px] w-[11px] ml-auto","text-[#3c3c43]/60 dark:text-[#ebebf5]/45","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col",item:{base:["flex w-full items-center","h-[32px] rounded-[8px] pl-[4px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-black dark:text-white","transition-colors duration-150 ease-out"].join(" "),hover:"hover:bg-black/4 dark:hover:bg-white/6",active:"",pressed:"active:bg-black/10 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[18px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[11px] w-[11px]","text-[#3c3c43]/60 dark:text-[#ebebf5]/55","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[20px] w-[22px] shrink-0 items-center justify-center mr-[7px]",icon:"h-[17px] w-[17px]",image:"h-[20px] w-[20px] rounded-[4px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[13px] leading-[16px]","text-[#3c3c43]/75 dark:text-[#ebebf5]/60"].join(" "),indentPerLevel:16}},kc={selection:"classes",pane:"bg-[#f4f4f3] dark:bg-neutral-950 text-zinc-950 dark:text-white select-none",layers:{},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",sectionHeader:"group/section flex w-full items-center gap-2.5 px-4 pb-2 pt-5 text-[13px] font-semibold uppercase tracking-[0.12em] text-zinc-400 dark:text-zinc-500",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[16px] px-3.5 py-2 text-[14px] leading-tight transition-colors duration-150",hover:"hover:bg-[#ececea] hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e7e7e5] text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-[#e2e2e0] dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-500 dark:text-zinc-500",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/70 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},Sc={selection:"classes",pane:"bg-[#f3f3f1]/48 dark:bg-neutral-950/32 backdrop-blur-3xl backdrop-saturate-150 text-zinc-950 dark:text-white select-none",layers:{tint:"bg-[linear-gradient(112deg,rgba(255,255,255,0.20)_0%,rgba(255,255,255,0.04)_45%,rgba(226,226,222,0.16)_100%)] dark:bg-[linear-gradient(112deg,rgba(255,255,255,0.08)_0%,rgba(255,255,255,0.02)_46%,rgba(255,255,255,0.06)_100%)]"},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-2",sectionHeader:"group/section flex w-full items-center gap-2.5 px-3 pb-1.5 pt-3 rounded-[14px] text-[12px] font-semibold uppercase tracking-[0.10em] text-zinc-500/80 dark:text-zinc-400/80",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[14px] px-3 py-1.5 text-[13.5px] leading-tight transition-colors duration-150",hover:"hover:bg-white/38 hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e8e8e6]/90 text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-white/50 dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-600 dark:text-zinc-400",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/72 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},Cc={selection:"classes",pane:["bg-[#f7f5f1]/92 dark:bg-[#1a1a1c]/92","backdrop-blur-[40px] backdrop-saturate-[160%]","text-[#2c2a28] dark:text-[#ededf0]","select-none"].join(" "),layers:{tint:["bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,251,242,0.55))_0%,rgba(255,255,255,0)_38%)]","dark:bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,255,255,0.05))_0%,rgba(255,255,255,0)_42%)]"].join(" ")},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[16px] pb-[8px]",sectionHeader:["group/section flex w-full items-center","px-[8px] pt-[14px] pb-[4px]","text-[11px] font-medium leading-[13px]","opacity-55"].join(" "),sectionChevron:["i-f7-chevron-down h-[10px] w-[10px] ml-auto","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col space-y-[2px]",item:{base:["flex w-full items-center","h-[30px] rounded-[8px] pl-[6px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-current","transition-[background-color,box-shadow,color] duration-150 ease-out"].join(" "),hover:"hover:bg-white/55 dark:hover:bg-white/8",active:["bg-white dark:bg-white/14","font-medium","shadow-[0_1px_2px_rgba(0,0,0,0.08)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]","ring-1 ring-black/5 dark:ring-white/8"].join(" "),pressed:"active:bg-white/80 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[16px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[10px] w-[10px] opacity-45","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[18px] w-[18px] shrink-0 items-center justify-center mr-[8px]",icon:"h-[16px] w-[16px]",image:"h-[18px] w-[18px] rounded-[5px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[12px] leading-[16px] opacity-45"].join(" "),indentPerLevel:14}},$c={...fe,pane:"bg-stone-100 dark:bg-neutral-900 text-black dark:text-white select-none",layers:{}},Tc={...fe,pane:"bg-transparent text-black dark:text-white select-none",layers:{}},Ec={...fe,pane:"bg-white/50 dark:bg-black/40 backdrop-blur-3xl backdrop-saturate-200 text-black dark:text-white select-none",layers:{}},ma={macos:fe,tahoe:fe,"macos-tahoe":fe,"macos-latest":fe,arc:Cc,workspace:kc,desktop:Sc,solid:$c,transparent:Tc,vibrancy:Ec};function qb(e){return ma[e||"macos"]||ma.macos}function Wb(e){if(!e)return;return st[e]||e}var Ic=st.gray;function ce(e,t,s){return`color-mix(in oklab, ${e} ${t}%, ${s})`}function ga(e){return{light:{from:ce(e,35,"#ffffff"),to:ce(e,12.5,"#ffffff"),ink:ce(e,22,"#17171b"),accent:ce(e,88,"#2a2a30")},dark:{from:ce(e,27,"#101014"),to:ce(e,10,"#08080b"),ink:ce(e,12,"#f4f4f7"),accent:ce(e,74,"#ffffff")}}}function Jb(e,t){return`linear-gradient(180deg, ${e} 0%, ${t} 100%)`}function Ac(e){if(!e)return ga(Ic);if(typeof e!=="string")return e;return ga(st[e]||e)}function Pc(e){return[`--stx-space-light-from: ${e.light.from}`,`--stx-space-light-to: ${e.light.to}`,`--stx-space-light-ink: ${e.light.ink}`,`--stx-space-light-accent: ${e.light.accent}`,`--stx-space-dark-from: ${e.dark.from}`,`--stx-space-dark-to: ${e.dark.to}`,`--stx-space-dark-ink: ${e.dark.ink}`,`--stx-space-dark-accent: ${e.dark.accent}`].join("; ")}function xa(e,t,s,a){if(!e||!e.label)return null;return{id:e.id||`${t}-${s}`,label:e.label,icon:e.icon||a}}function Mc(e){let t=Ac(e.tint);return{id:e.id,label:e.label||"",icon:e.icon||"",pinned:e.pinned||[],sections:e.sections||[],action:xa(e.action,e.id,"action","i-f7-plus"),clear:xa(e.clear,e.id,"clear","i-f7-arrow-down"),tint:t,style:Pc(t),deferred:e.deferred===!0,showTitle:e.showTitle??!0}}function Yb(e){return(e||[]).map(Mc)}function Xb(e,t){if(!t)return 0;let s=e.findIndex((a)=>a.id===t);return s===-1?0:s}function Zb(e){return e.map((t)=>t.tint)}var Rc="./Skeleton-m4p66zcs.stx";var gv=101;function ke(e,t){let s=typeof e==="number"?e:Number.parseFloat(String(e));return Number.isFinite(s)?s:t}function xv(e,t,s){let a=ke(e,0),o=ke(t,100),n=ke(s,1);return{min:Math.min(a,o),max:Math.max(a,o),step:n>0?n:0}}function ba(e){if(!Number.isFinite(e))return 0;let t=String(e).toLowerCase(),s=t.indexOf("e-");if(s!==-1)return Number.parseInt(t.slice(s+2),10)+Math.max(0,t.slice(0,s).split(".")[1]?.length??0);return t.split(".")[1]?.length??0}function me(e,t){let{min:s,max:a,step:o}=t,n=Math.min(a,Math.max(s,ke(e,s)));if(o<=0)return n;let i=Math.round((n-s)/o),r=Math.floor((a-s)/o+0.0000001);if(i>r)i=r;let c=Math.max(ba(o),ba(s));return Number((s+i*o).toFixed(Math.min(c,20)))}function bv(e,t){let s=t.max-t.min;if(s<=0)return 0;return(Math.min(t.max,Math.max(t.min,ke(e,t.min)))-t.min)/s}function vv(e,t){let s=Math.min(1,Math.max(0,Number.isFinite(e)?e:0));return me(t.min+s*(t.max-t.min),t)}function wv(e,t){let s=t.max-t.min;if(s<=0||e===!1||e==null||e===""||e==="false")return[];if(e===!0||e==="true"){if(t.step<=0)return[];let o=Math.floor(s/t.step+0.0000001)+1;if(o<2||o>101)return[];return Array.from({length:o},(n,i)=>Math.min(1,i*t.step/s))}let a=Math.floor(ke(e,0));if(a<2||a>101)return[];return Array.from({length:a},(o,n)=>n/(a-1))}function yv(e,t,s,a=10){let o=s.step>0?s.step:(s.max-s.min)/100;if(e==="ArrowRight"||e==="ArrowUp")return me(t+o,s);if(e==="ArrowLeft"||e==="ArrowDown")return me(t-o,s);if(e==="PageUp")return me(t+o*a,s);if(e==="PageDown")return me(t-o*a,s);if(e==="Home")return me(s.min,s);if(e==="End")return me(s.max,s);return null}var Oc="./Slider-j59dgw1c.stx";var zc="./Spinner-vhnc3y03.stx";function Hc(e){return Array.from({length:e},()=>1/e)}function at(e,t){if(t<=0)return[];if(!e||e.length!==t||e.some((a)=>typeof a!=="number"||!Number.isFinite(a)||a<=0))return Hc(t);let s=e.reduce((a,o)=>a+o,0);return e.map((a)=>a/s)}function va(e){let t=e;if(typeof e==="string"){let a=e.trim();if(a==="")return null;if(a.charAt(0)==="[")try{t=JSON.parse(a)}catch{return null}else t=a.split(/[\s,]+/).map((o)=>Number.parseFloat(o))}if(!Array.isArray(t)||t.length===0)return null;let s=t.map((a)=>typeof a==="string"?Number.parseFloat(a):a);return s.every((a)=>typeof a==="number"&&Number.isFinite(a)&&a>0)?s:null}function Ot(e,t){if(typeof e==="number")return Number.isFinite(e)&&e>=0?e:t;if(typeof e!=="string"||e.trim()==="")return t;let s=Number.parseFloat(e);return Number.isFinite(s)&&s>=0?s:t}function wa(e,t,s){let a=e.length;if(a===0||t<=0)return[...e];let o=s.map((c)=>Math.max(0,c.min)),n=o.reduce((c,l)=>c+l,0);if(n>=t)return n===0?[...e]:o.map((c)=>c/n);let i=e.map((c)=>c*t);for(let c=0;c<=a;c++){let l=0;for(let p=0;p<a;p++){let u=Math.min(Math.max(i[p],o[p]),s[p].max);l+=i[p]-u,i[p]=u}if(Math.abs(l)<0.000000001)break;let d=i.map((p,u)=>l>0?s[u].max-p:p-o[u]),h=d.reduce((p,u)=>p+(Number.isFinite(u)?u:t),0);if(h<0.000000001)break;for(let p=0;p<a;p++){let u=(Number.isFinite(d[p])?d[p]:t)/h;i[p]+=l*u}}let r=i.reduce((c,l)=>c+l,0);return i.map((c)=>c/r)}function Dt(e,t,s,a,o){let n=e.length;if(t<0||t>=n-1||a<=0||s===0)return[...e];let i=e.map((p)=>p*a),r=s>0,c=r?t:t+1,l=r?1:-1,d=Math.min(Math.abs(s),o[c].max-i[c]);if(d<=0)return[...e];let h=0;for(let p=r?t+1:t;p>=0&&p<n&&d>0.000000001;p+=l){let u=Math.min(d,Math.max(0,i[p]-Math.max(0,o[p].min)));i[p]-=u,h+=u,d-=u}return i[c]+=h,i.map((p)=>p/a)}function ot(e,t,s,a){let o=e.map((i)=>i*s),n=(i,r)=>{let c=0;for(let l=i;l<=r;l++)c+=Math.max(0,o[l]-Math.max(0,a[l].min));return c};return{back:Math.min(n(0,t),a[t+1].max-o[t+1]),forward:Math.min(n(t+1,e.length-1),a[t].max-o[t])}}function ya(e,t,s,a){let o=ot(e,t,s,a),n=e[t]*100,i=s>0?100/s:0;return{now:Math.round(n),min:Math.round(n-o.back*i),max:Math.round(n+o.forward*i)}}function zt(e){return`stx:split-pane:${e}`}function ka(e){return JSON.stringify(e.map((t)=>Math.round(t*1e4)/1e4))}var jc="./SplitPane-7sqfdwqa.stx";var Sa="data-split-separator";class Fc{root;callbacks;direction;panes=[];separators=[];sizes=[];initial=[];limits=[];minSize;step;label;storageKey;observer=null;drag=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.direction=t.direction==="vertical"?"vertical":"horizontal",this.minSize=t.minSize??48,this.step=t.step??16,this.label=t.label||"Resize panes",this.storageKey=t.storageKey||"",this.collect(),this.initial=this.startingSizes(t.sizes),this.sizes=at(this.stored()??this.initial,this.panes.length),this.build(),this.apply(!1),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.apply(!1)),this.observer.observe(this.root);this.root.setAttribute("data-split-ready","")}getSizes(){return[...this.sizes]}setSizes(e){if(!e||e.length!==this.panes.length)return;this.sizes=at(e,this.panes.length),this.apply(!0),this.report(-1,"api",!0)}reset(e=-1){this.sizes=[...this.initial],this.apply(!0),this.report(e,"reset",!0)}setDirection(e){let t=e==="vertical"?"vertical":"horizontal";if(t===this.direction)return;this.direction=t,this.root.setAttribute("data-direction",t);for(let s of this.separators)s.setAttribute("aria-orientation",t==="horizontal"?"vertical":"horizontal");this.apply(!1)}destroy(){this.observer?.disconnect();for(let e of this.disposers)e();for(let e of this.separators)e.remove();for(let e of this.panes)e.style.removeProperty("flex"),e.removeAttribute("data-split-pane");this.root.removeAttribute("data-split-ready")}available(){let e=this.root.getBoundingClientRect(),t=this.direction==="horizontal"?e.width:e.height,s=0;for(let a of this.separators){let o=a.getBoundingClientRect();s+=this.direction==="horizontal"?o.width:o.height}return Math.max(0,t-s)}collect(){this.panes=Array.from(this.root.children).filter((e)=>e instanceof HTMLElement&&!e.hasAttribute(Sa)),this.limits=this.panes.map((e)=>({min:Ot(e.getAttribute("data-min-size"),this.minSize),max:Ot(e.getAttribute("data-max-size"),Number.POSITIVE_INFINITY)}))}startingSizes(e){let t=this.panes.map((a)=>Number.parseFloat(a.getAttribute("data-size")||"")),s=t.every((a)=>Number.isFinite(a)&&a>0)?t:null;return at(e&&e.length===this.panes.length?e:s,this.panes.length)}stored(){if(!this.storageKey)return null;try{let e=va(localStorage.getItem(zt(this.storageKey)));return e&&e.length===this.panes.length?e:null}catch{return null}}store(){if(!this.storageKey)return;try{localStorage.setItem(zt(this.storageKey),ka(this.sizes))}catch{}}build(){let e=this.root.id||`split-${Math.random().toString(36).slice(2,8)}`;this.panes.forEach((t,s)=>{if(t.setAttribute("data-split-pane",""),!t.id)t.id=`${e}-pane-${s}`;if(s===this.panes.length-1)return;let a=document.createElement("div");a.setAttribute(Sa,""),a.setAttribute("role","separator"),a.setAttribute("tabindex","0"),a.setAttribute("aria-orientation",this.direction==="horizontal"?"vertical":"horizontal"),a.setAttribute("aria-controls",t.id),a.setAttribute("aria-label",this.panes.length>2?`${this.label} ${s+1} and ${s+2}`:this.label),a.className="stx-split-separator",t.after(a),this.separators.push(a);let o=(n,i)=>{a.addEventListener(n,i),this.disposers.push(()=>a.removeEventListener(n,i))};o("pointerdown",(n)=>this.onPointerDown(n,s)),o("pointermove",(n)=>this.onPointerMove(n)),o("pointerup",(n)=>this.onPointerEnd(n)),o("pointercancel",(n)=>this.onPointerEnd(n)),o("dblclick",()=>this.reset(s)),o("keydown",(n)=>this.onKeyDown(n,s))})}apply(e){let t=this.available();if(t>0)this.sizes=wa(this.sizes,t,this.limits);if(this.panes.forEach((s,a)=>{s.style.flex=`${(this.sizes[a]*1000).toFixed(3)} 1 0px`}),this.separators.forEach((s,a)=>{let o=ya(this.sizes,a,t,this.limits);s.setAttribute("aria-valuenow",String(o.now)),s.setAttribute("aria-valuemin",String(o.min)),s.setAttribute("aria-valuemax",String(o.max))}),e)this.store()}report(e,t,s){let a=this.available(),o={sizes:[...this.sizes],pixels:this.sizes.map((n)=>Math.round(n*a)),index:e,source:t};if(this.callbacks.onResize?.(o),s)this.callbacks.onResizeEnd?.(o)}position(e){return this.direction==="horizontal"?e.clientX:e.clientY}onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();let s=this.separators[t];try{s.setPointerCapture(e.pointerId)}catch{}this.drag={index:t,start:this.position(e),sizes:[...this.sizes],pointer:e.pointerId},this.root.setAttribute("data-dragging",""),s.setAttribute("data-active","")}onPointerMove(e){let t=this.drag;if(!t||e.pointerId!==t.pointer)return;this.sizes=Dt(t.sizes,t.index,this.position(e)-t.start,this.available(),this.limits),this.apply(!1),this.report(t.index,"pointer",!1)}onPointerEnd(e){let t=this.drag;if(!t||e.pointerId!==t.pointer)return;this.drag=null,this.root.removeAttribute("data-dragging"),this.separators[t.index].removeAttribute("data-active");try{this.separators[t.index].releasePointerCapture(e.pointerId)}catch{}this.store(),this.report(t.index,"pointer",!0)}onKeyDown(e,t){let s=this.direction==="horizontal",a=this.available(),o=this.step*(e.shiftKey?5:1),n=0;if(e.key===(s?"ArrowLeft":"ArrowUp"))n=-o;else if(e.key===(s?"ArrowRight":"ArrowDown"))n=o;else if(e.key==="Home")n=-ot(this.sizes,t,a,this.limits).back;else if(e.key==="End")n=ot(this.sizes,t,a,this.limits).forward;else if(e.key==="Enter"){e.preventDefault(),this.reset(t);return}else return;e.preventDefault(),this.sizes=Dt(this.sizes,t,n,a,this.limits),this.apply(!0),this.report(t,"keyboard",!0)}}var _c="./Stepper-68gxcmej.stx";var qc="./StepperStep-zf4pq1s0.stx";class nt{storage;namespace;watchers=new Map;encryptionKey="stx-storage-key";constructor(e="local",t=""){if(this.storage=e==="local"?globalThis.localStorage:globalThis.sessionStorage,this.namespace=t,typeof window<"u")window.addEventListener("storage",this.handleStorageEvent.bind(this))}handleStorageEvent(e){if(!e.key)return;let t=this.namespace&&e.key.startsWith(`${this.namespace}:`)?e.key.slice(this.namespace.length+1):e.key,s=this.watchers.get(t);if(s){let a=e.oldValue?JSON.parse(e.oldValue).value:null,o=e.newValue?JSON.parse(e.newValue).value:null;s.forEach((n)=>n(o,a,t))}}encrypt(e){let t="";for(let s=0;s<e.length;s++)t+=String.fromCharCode(e.charCodeAt(s)^this.encryptionKey.charCodeAt(s%this.encryptionKey.length));return btoa(t)}decrypt(e){try{let t=atob(e),s="";for(let a=0;a<t.length;a++)s+=String.fromCharCode(t.charCodeAt(a)^this.encryptionKey.charCodeAt(a%this.encryptionKey.length));return s}catch{return e}}compress(e){if(e.length<100)return e;let t={},s=256,a=[],o="";for(let n=0;n<e.length;n++){let i=e.charAt(n),r=o+i;if(t[r]!==void 0)o=r;else a.push(o.length>1?t[o]:o.charCodeAt(0)),t[r]=s++,o=i}if(o!=="")a.push(o.length>1?t[o]:o.charCodeAt(0));return JSON.stringify(a)}decompress(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return e;let s={},a=256,o=String.fromCharCode(t[0]),n=o;for(let i=1;i<t.length;i++){let r=t[i],c;if(s[r]!==void 0)c=s[r];else if(r===a)c=o+o.charAt(0);else return e;n+=c,s[a++]=o+c.charAt(0),o=c}return n}catch{return e}}getKey(e){return this.namespace?`${this.namespace}:${e}`:e}set(e,t,s){let a=this.getKey(e),o=this.get(e),n={value:t,timestamp:Date.now(),expire:s?.expire,encrypted:s?.encrypt||!1,compressed:s?.compress||!1};try{let i=JSON.stringify(n);if(s?.compress)i=this.compress(i);if(s?.encrypt)i=this.encrypt(i);this.storage.setItem(a,i),this.notifyWatchers(e,t,o)}catch(i){console.error("Storage set error:",i)}}get(e){let t=this.getKey(e);try{let s=this.storage.getItem(t);if(!s)return null;if(s.match(/^[A-Z0-9+/]+=*$/i))try{s=this.decrypt(s)}catch{}if(s.startsWith("["))try{s=this.decompress(s)}catch{}let a=JSON.parse(s);if(a.expire&&Date.now()-a.timestamp>a.expire)return this.remove(e),null;return a.value}catch(s){return console.error("Storage get error:",s),null}}watch(e,t){if(!this.watchers.has(e))this.watchers.set(e,new Set);return this.watchers.get(e).add(t),()=>{let s=this.watchers.get(e);if(s){if(s.delete(t),s.size===0)this.watchers.delete(e)}}}notifyWatchers(e,t,s){let a=this.watchers.get(e);if(a)a.forEach((o)=>o(t,s,e))}remove(e){let t=this.getKey(e),s=this.get(e);this.storage.removeItem(t),this.notifyWatchers(e,null,s)}clear(){if(this.namespace)this.keys().forEach((t)=>this.remove(t));else this.storage.clear()}has(e){return this.get(e)!==null}keys(){let e=Object.keys(this.storage);if(this.namespace){let t=`${this.namespace}:`;return e.filter((s)=>s.startsWith(t)).map((s)=>s.slice(t.length))}return e}size(){return this.keys().length}getQuota(){if("storage"in navigator&&"estimate"in navigator.storage)return null;try{let e=0;for(let s=0;s<this.storage.length;s++){let a=this.storage.key(s);if(a){let o=this.storage.getItem(a)||"";e+=a.length+o.length}}let t=5242880;return{usage:e*2,quota:t,percentage:e*2/t*100}}catch{return null}}setMany(e,t){Object.entries(e).forEach(([s,a])=>{this.set(s,a,t)})}getMany(e){let t={};return e.forEach((s)=>{t[s]=this.get(s)}),t}removeMany(e){e.forEach((t)=>this.remove(t))}}var _v={local:new nt("local"),session:new nt("session")};function Kv(e="local",t){return new nt(e,t)}var Gc="./Switch-vd8k23sr.stx";var Jc="./Table-0a4y46vd.stx";var Xc="./TableBody-y49bqb1p.stx";var Qc="./TableCell-jhvsxw8b.stx";var td="./TableHead-e9xvjx2j.stx";var ad="./TableHeader-krzcx4sv.stx";var nd="./TableRow-dt8e11aj.stx";var rd="./Tab-j9f4t166.stx";var cd="./TabList-r1pc87xs.stx";var pd="./TabPanel-5htevsq6.stx";var ud="./Tabs-psm5wj7c.stx";var md="./Teleport-vqs75x36.stx";var xd="./Textarea-bb63fsz0.stx";var vd="./AiTextarea-bg6xq5wc.stx";var yd="./Tooltip-1cnzascv.stx";var Sd="./Transition-7m0mk45s.stx";var $d="./Video-bqsx3wr8.stx";var Ed="./VirtualList-fa7v5a3h.stx";var Ad="./VirtualTable-kp7b3wyv.stx";var Pd=0;function Ca(e="a11y"){return`${e}-${++Pd}-${Date.now()}`}function jw(e,t,s={}){let{visible:a=!1,id:o=Ca("label")}=s,n=document.createElement(a?"label":"span");if(n.id=o,n.textContent=e,!a)Object.assign(n.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"});if(t)if(t.setAttribute("aria-labelledby",o),t.parentElement)t.parentElement.insertBefore(n,t);else document.body.appendChild(n);return o}function Fw(e,t){let s=Ca("desc"),a=document.createElement("span");if(a.id=s,a.textContent=e,Object.assign(a.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t)if(t.setAttribute("aria-describedby",s),t.parentElement)t.parentElement.insertBefore(a,t);else document.body.appendChild(a);return s}function Bw(e,t="polite"){let s=document.createElement("div");s.setAttribute("role","status"),s.setAttribute("aria-live",t),s.setAttribute("aria-atomic","true"),Object.assign(s.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(s),setTimeout(()=>{s.textContent=e},100),setTimeout(()=>{s.parentNode?.removeChild(s)},1000)}function Ht(e){let t=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(t)).filter((s)=>s.offsetParent!==null)}function _w(e,t={}){let{initialFocus:s,returnFocus:a,escapeDeactivates:o=!0,clickOutsideDeactivates:n=!0,allowOutsideClick:i=!1,onActivate:r,onDeactivate:c}=t,l=!1,d=!1,h=null,p=(v)=>{if(d)return;if(o&&v.key==="Escape"){v.preventDefault(),m();return}if(v.key==="Tab"){let b=Ht(e);if(b.length===0){v.preventDefault();return}let C=b[0],P=b[b.length-1];if(v.shiftKey){if(document.activeElement===C)v.preventDefault(),P.focus()}else if(document.activeElement===P)v.preventDefault(),C.focus()}},u=(v)=>{if(d)return;if(!e.contains(v.target)){if(typeof i==="function"){if(!i(v)&&n)m()}else if(!i&&n)m()}};function g(){if(l)return;l=!0,h=document.activeElement;let v=s||Ht(e)[0];if(v&&typeof v.focus==="function")v.focus();document.addEventListener("keydown",p),document.addEventListener("click",u),r?.()}function m(){if(!l)return;l=!1;let v=a||h;if(v&&typeof v.focus==="function")v.focus();document.removeEventListener("keydown",p),document.removeEventListener("click",u),c?.()}function w(){d=!0}function y(){d=!1}return{activate:g,deactivate:m,pause:w,unpause:y}}function Kw(e,t={}){let{selector:s='[role="option"], [role="menuitem"], [role="tab"], button',initialIndex:a=0,orientation:o="both",loop:n=!0,onFocusChange:i}=t,r=a,c=()=>Array.from(e.querySelectorAll(s)),l=(h)=>{let p=c();if(h<0||h>=p.length)return;p.forEach((u,g)=>{if(g===h){if(u.setAttribute("tabindex","0"),typeof u.focus==="function")u.focus()}else u.setAttribute("tabindex","-1")}),r=h,i?.(h,p[h])},d=(h)=>{let u=c().length-1,g=!1,m=r;switch(h.key){case"ArrowRight":if(o==="horizontal"||o==="both"){if(m=r+1,m>u)m=n?0:u;g=!0}break;case"ArrowLeft":if(o==="horizontal"||o==="both"){if(m=r-1,m<0)m=n?u:0;g=!0}break;case"ArrowDown":if(o==="vertical"||o==="both"){if(m=r+1,m>u)m=n?0:u;g=!0}break;case"ArrowUp":if(o==="vertical"||o==="both"){if(m=r-1,m<0)m=n?u:0;g=!0}break;case"Home":m=0,g=!0;break;case"End":m=u,g=!0;break}if(g)h.preventDefault(),l(m)};return l(a),e.addEventListener("keydown",d),()=>{e.removeEventListener("keydown",d)}}var qw={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Tab:"Tab",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown"};function Ww(e){return document.activeElement===e}function Gw(e,t){let s=t||document.activeElement,a=Ht(document.body),o=a.indexOf(s);if(o===-1)return;let n=e==="next"?o+1:o-1,i=a[n];if(i)i.focus()}function Uw(e){if(e.getAttribute("aria-hidden")==="true")return!1;let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1;return!0}var Jw={setExpanded(e,t){e.setAttribute("aria-expanded",String(t))},setSelected(e,t){e.setAttribute("aria-selected",String(t))},setChecked(e,t){e.setAttribute("aria-checked",String(t))},setDisabled(e,t){if(e.setAttribute("aria-disabled",String(t)),t)e.setAttribute("tabindex","-1");else e.removeAttribute("tabindex")},setHidden(e,t){if(t)e.setAttribute("aria-hidden","true");else e.removeAttribute("aria-hidden")},setPressed(e,t){e.setAttribute("aria-pressed",String(t))},setInvalid(e,t){e.setAttribute("aria-invalid",String(t))},setRequired(e,t){e.setAttribute("aria-required",String(t))},setLive(e,t){e.setAttribute("aria-live",t)},setBusy(e,t){e.setAttribute("aria-busy",String(t))}};function Yw(e){let t=document.createElement("span");return t.textContent=e,t.className="sr-only",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t}function Xw(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-reduced-motion: reduce)").matches;return!1}function Zw(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-contrast: high)").matches;return!1}function Qw(){if(typeof window.matchMedia==="function"){if(window.matchMedia("(prefers-color-scheme: dark)").matches)return"dark";if(window.matchMedia("(prefers-color-scheme: light)").matches)return"light"}return null}function ey(e,t="Skip to main content"){let s=document.createElement("a");return s.href=`#${e}`,s.textContent=t,s.className="skip-link",Object.assign(s.style,{position:"absolute",top:"-40px",left:"0",background:"#000",color:"#fff",padding:"8px",textDecoration:"none",zIndex:"100"}),s.addEventListener("focus",()=>{s.style.top="0"}),s.addEventListener("blur",()=>{s.style.top="-40px"}),s}function ty(e){let t=[],s=(a)=>{let o=e.getAttribute(a);if(o){let n=o.split(" ");for(let i of n)if(!document.getElementById(i))t.push(`${a} references non-existent ID: ${i}`)}};return s("aria-labelledby"),s("aria-describedby"),s("aria-controls"),s("aria-owns"),s("aria-activedescendant"),t}var Md=(e,t,s,a)=>s*e/a+t,Nd=(e,t,s,a)=>(e/=a,s*e*e+t),Rd=(e,t,s,a)=>(e/=a,-s*e*(e-2)+t),Ld=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e+t;return e--,-s/2*(e*(e-2)-1)+t},Od=(e,t,s,a)=>(e/=a,s*e*e*e+t),Dd=(e,t,s,a)=>(e/=a,e--,s*(e*e*e+1)+t),zd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e+t;return e-=2,s/2*(e*e*e+2)+t},Hd=(e,t,s,a)=>(e/=a,s*e*e*e*e+t),Vd=(e,t,s,a)=>(e/=a,e--,-s*(e*e*e*e-1)+t),jd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e*e+t;return e-=2,-s/2*(e*e*e*e-2)+t},Fd=(e,t,s,a)=>(e/=a,s*e*e*e*e*e+t),Bd=(e,t,s,a)=>(e/=a,e--,s*(e*e*e*e*e+1)+t),_d=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e*e*e+t;return e-=2,s/2*(e*e*e*e*e+2)+t},Kd=(e,t,s,a)=>-s*Math.cos(e/a*(Math.PI/2))+s+t,qd=(e,t,s,a)=>s*Math.sin(e/a*(Math.PI/2))+t,Wd=(e,t,s,a)=>-s/2*(Math.cos(Math.PI*e/a)-1)+t,Gd=(e,t,s,a)=>e===0?t:s*2**(10*(e/a-1))+t,Ud=(e,t,s,a)=>e===a?t+s:s*(-(2**(-10*e/a))+1)+t,Jd=(e,t,s,a)=>{if(e===0)return t;if(e===a)return t+s;if(e/=a/2,e<1)return s/2*2**(10*(e-1))+t;return e--,s/2*(-(2**(-10*e))+2)+t},Yd=(e,t,s,a)=>(e/=a,-s*(Math.sqrt(1-e*e)-1)+t),Xd=(e,t,s,a)=>(e/=a,e--,s*Math.sqrt(1-e*e)+t),Zd=(e,t,s,a)=>{if(e/=a/2,e<1)return-s/2*(Math.sqrt(1-e*e)-1)+t;return e-=2,s/2*(Math.sqrt(1-e*e)+1)+t},Qd=(e,t,s,a)=>{let o=1.70158,n=0,i=s;if(e===0)return t;if(e/=a,e===1)return t+s;if(!n)n=a*0.3;if(i<Math.abs(s))i=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/i);return e-=1,-(i*2**(10*e)*Math.sin((e*a-o)*(2*Math.PI)/n))+t},ep=(e,t,s,a)=>{let o=1.70158,n=0,i=s;if(e===0)return t;if(e/=a,e===1)return t+s;if(!n)n=a*0.3;if(i<Math.abs(s))i=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/i);return i*2**(-10*e)*Math.sin((e*a-o)*(2*Math.PI)/n)+s+t},tp=(e,t,s,a)=>{let o=1.70158,n=0,i=s;if(e===0)return t;if(e/=a/2,e===2)return t+s;if(!n)n=a*0.44999999999999996;if(i<Math.abs(s))i=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/i);if(e<1)return e-=1,-0.5*(i*2**(10*e)*Math.sin((e*a-o)*(2*Math.PI)/n))+t;return e-=1,i*2**(-10*e)*Math.sin((e*a-o)*(2*Math.PI)/n)*0.5+s+t},sp=(e,t,s,a)=>(e/=a,s*e*e*(2.70158*e-1.70158)+t),ap=(e,t,s,a)=>(e/=a,e--,s*(e*e*(2.70158*e+1.70158)+1)+t),op=(e,t,s,a)=>{let o=1.70158;if(e/=a/2,e<1)return o*=1.525,s/2*(e*e*((o+1)*e-o))+t;return e-=2,o*=1.525,s/2*(e*e*((o+1)*e+o)+2)+t},Vt=(e,t,s,a)=>{if(e/=a,e<0.36363636363636365)return s*(7.5625*e*e)+t;else if(e<0.7272727272727273)return e-=0.5454545454545454,s*(7.5625*e*e+0.75)+t;else if(e<0.9090909090909091)return e-=0.8181818181818182,s*(7.5625*e*e+0.9375)+t;else return e-=0.9545454545454546,s*(7.5625*e*e+0.984375)+t},$a=(e,t,s,a)=>s-Vt(a-e,0,s,a)+t,np=(e,t,s,a)=>{if(e<a/2)return $a(e*2,0,s,a)*0.5+t;return Vt(e*2-a,0,s,a)*0.5+s*0.5+t},ay={linear:Md,easeInQuad:Nd,easeOutQuad:Rd,easeInOutQuad:Ld,easeInCubic:Od,easeOutCubic:Dd,easeInOutCubic:zd,easeInQuart:Hd,easeOutQuart:Vd,easeInOutQuart:jd,easeInQuint:Fd,easeOutQuint:Bd,easeInOutQuint:_d,easeInSine:Kd,easeOutSine:qd,easeInOutSine:Wd,easeInExpo:Gd,easeOutExpo:Ud,easeInOutExpo:Jd,easeInCirc:Yd,easeOutCirc:Xd,easeInOutCirc:Zd,easeInElastic:Qd,easeOutElastic:ep,easeInOutElastic:tp,easeInBack:sp,easeOutBack:ap,easeInOutBack:op,easeInBounce:$a,easeOutBounce:Vt,easeInOutBounce:np};function ip(e,t={}){let{duration:s="1s",timing:a="ease",delay:o="0s",iteration:n="1",direction:i="normal",fill:r="both",playState:c="running"}=t;return`${e} ${s} ${a} ${o} ${n} ${i} ${r} ${c}`}function Ta(e,t,s={}){e.style.animation=ip(t,s)}function ny(e){e.style.animation=""}function rp(e){return new Promise((t)=>{let s=()=>{e.removeEventListener("animationend",s),t()};e.addEventListener("animationend",s)})}function iy(e,t,s={}){let{stagger:a=100,...o}=s;e.forEach((n,i)=>{let r=`${i*a}ms`;Ta(n,t,{...o,delay:r})})}async function ry(e,t){for(let s of t)Ta(e,s.name,s.options),await rp(e)}var ly={fadeIn:"animate-fade-in",fadeOut:"animate-fade-out",slideInUp:"animate-slide-in-up",slideInDown:"animate-slide-in-down",slideInLeft:"animate-slide-in-left",slideInRight:"animate-slide-in-right",zoomIn:"animate-zoom-in",zoomOut:"animate-zoom-out",bounce:"animate-bounce",spin:"animate-spin",ping:"animate-ping",pulse:"animate-pulse"};function cy(e,t,s=1000){return new Promise((a)=>{e.classList.add(t),setTimeout(()=>{e.classList.remove(t),a()},s)})}function dy(e,t){let s=`
14
14
  @keyframes ${e} {
15
15
  ${Object.entries(t).map(([o,n])=>{let i=Object.entries(n).map(([r,c])=>`${r}: ${c};`).join(" ");return`${o} { ${i} }`}).join(`
16
16
  `)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/components",
3
3
  "type": "module",
4
- "version": "0.2.908",
4
+ "version": "0.2.910",
5
5
  "description": "A modern component library built with STX, featuring headwind utility classes and TypeScript syntax highlighting.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -129,8 +129,8 @@
129
129
  "dependencies": {
130
130
  "@iconify-json/f7": "^1.2.2",
131
131
  "@stacksjs/ts-css": "^0.3.11",
132
- "@stacksjs/stx": "0.2.908",
133
- "bun-plugin-stx": "0.2.908",
132
+ "@stacksjs/stx": "0.2.910",
133
+ "bun-plugin-stx": "0.2.910",
134
134
  "ts-syntax-highlighter": "^0.2.20",
135
135
  "ts-video-player": "^0.1.11"
136
136
  },
@@ -72,7 +72,9 @@ const preferredSide = {{ position }}
72
72
  const panelLimits = 'position:fixed;max-width:calc(100vw - 16px);margin:0;'
73
73
  const panelStyle = state(nativePopup ? { position: 'absolute', margin: 0, transform: [] } : panelLimits)
74
74
  const arrowStyle = state('')
75
- const tooltipContent = useReactiveProp('content', {{ content }})
75
+ // The instance root carries its own content prop. Baking that value into the
76
+ // fallback duplicated this entire setup for every different hint on a page.
77
+ const tooltipContent = useReactiveProp('content', '')
76
78
  const isDisabled = useReactiveProp('disabled', {{ disabled }})
77
79
  // Reactive prop binding — parent can drive `show` via signals. See #1704.
78
80
  const isVisible = useReactiveProp('show', {{ show }})