@paperkite/plugin-runtime-console 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/public/_app/immutable/assets/0.8e19Eas9.css +1 -0
- package/public/_app/immutable/chunks/0P6E5PgQ.js +1 -0
- package/public/_app/immutable/chunks/473aTmYL.js +1 -0
- package/public/_app/immutable/chunks/{DVEB1r5D.js → 8TLgZ-vL.js} +1 -1
- package/public/_app/immutable/chunks/AUu53b1K.js +2 -0
- package/public/_app/immutable/chunks/BKJ0Y2X2.js +1 -0
- package/public/_app/immutable/chunks/Bkcwen-N.js +1 -0
- package/public/_app/immutable/chunks/BwDU-fss.js +1 -0
- package/public/_app/immutable/chunks/{BpJGvxOD.js → C7x1AckM.js} +1 -1
- package/public/_app/immutable/chunks/{C1_V7OdN.js → CES7FAnl.js} +1 -1
- package/public/_app/immutable/chunks/CK68nzZP.js +1 -0
- package/public/_app/immutable/chunks/CTs8zH2A.js +1 -0
- package/public/_app/immutable/chunks/CVQRPBHI.js +1 -0
- package/public/_app/immutable/chunks/{-MWhb9c-.js → CYrhPW18.js} +1 -1
- package/public/_app/immutable/chunks/{B1VSXVja.js → CjpBsztx.js} +1 -1
- package/public/_app/immutable/chunks/CpCbeTkV.js +2 -0
- package/public/_app/immutable/chunks/D1JMNvQG.js +1 -0
- package/public/_app/immutable/chunks/{Dk_FALGi.js → D5ygbMy_.js} +1 -1
- package/public/_app/immutable/chunks/{JYomMW8A.js → DHgbx_fZ.js} +1 -1
- package/public/_app/immutable/chunks/{BM-d1iyU.js → DYakwjaq.js} +1 -1
- package/public/_app/immutable/chunks/{CBkgBsl2.js → Dk8UGBZ2.js} +1 -1
- package/public/_app/immutable/chunks/{u9x_yOz5.js → Dnszd-a_.js} +2 -2
- package/public/_app/immutable/chunks/KZaYLgoS.js +1 -0
- package/public/_app/immutable/chunks/NLo5Zh3E.js +1 -0
- package/public/_app/immutable/chunks/{D4TYZfw1.js → XK2XwNCE.js} +2 -2
- package/public/_app/immutable/chunks/{DwNr-XJb.js → Xaflb_xi.js} +1 -1
- package/public/_app/immutable/chunks/{BHsjJ8bF.js → bzYZcIpo.js} +1 -1
- package/public/_app/immutable/chunks/{DLXc3MsS.js → rz89OrhQ.js} +1 -1
- package/public/_app/immutable/chunks/{BKgPCz3n.js → vGOpwVvV.js} +1 -1
- package/public/_app/immutable/entry/{app.xGcxUCtq.js → app.BRhmEJql.js} +2 -2
- package/public/_app/immutable/entry/{start.BfgCqfOg.js → start.BkvLfThy.js} +1 -1
- package/public/_app/immutable/nodes/0.0pNZvtKd.js +1 -0
- package/public/_app/immutable/nodes/1.B81L6iLG.js +1 -0
- package/public/_app/immutable/nodes/2.osjLQP-7.js +1 -0
- package/public/_app/immutable/nodes/{3.Bkc35OBN.js → 3.5Qv8DQzq.js} +2 -2
- package/public/_app/immutable/nodes/4.C6R1dt1K.js +1 -0
- package/public/_app/immutable/nodes/5.DZHiidRm.js +2 -0
- package/public/_app/immutable/nodes/6.Dpfuh3uG.js +2 -0
- package/public/_app/immutable/nodes/7.DKyaWWa3.js +1 -0
- package/public/_app/immutable/nodes/8.De3ko3u7.js +1 -0
- package/public/_app/version.json +1 -1
- package/public/index.html +26 -25
- package/public/_app/immutable/assets/0.DtIwIIdd.css +0 -1
- package/public/_app/immutable/chunks/1mqgODEB.js +0 -1
- package/public/_app/immutable/chunks/4FxxAFXN.js +0 -1
- package/public/_app/immutable/chunks/B36KvkWl.js +0 -1
- package/public/_app/immutable/chunks/B8_hs9R4.js +0 -1
- package/public/_app/immutable/chunks/BkeJCmZR.js +0 -1
- package/public/_app/immutable/chunks/C1dm7snI.js +0 -2
- package/public/_app/immutable/chunks/C3IMQzMn.js +0 -1
- package/public/_app/immutable/chunks/C59Htmoo.js +0 -1
- package/public/_app/immutable/chunks/CXE75xOj.js +0 -1
- package/public/_app/immutable/chunks/Cl3lhUWL.js +0 -1
- package/public/_app/immutable/chunks/D3H57P1T.js +0 -1
- package/public/_app/immutable/chunks/DpIbH5kQ.js +0 -1
- package/public/_app/immutable/chunks/ywqHnl7S.js +0 -2
- package/public/_app/immutable/nodes/0.6NyaEHme.js +0 -1
- package/public/_app/immutable/nodes/1.BuZaC350.js +0 -1
- package/public/_app/immutable/nodes/2.B86h23eK.js +0 -1
- package/public/_app/immutable/nodes/4.DTipQFjn.js +0 -1
- package/public/_app/immutable/nodes/5.CcLKuLYX.js +0 -1
- package/public/_app/immutable/nodes/6.DPrxF31w.js +0 -2
- package/public/_app/immutable/nodes/7.HhYOLA1h.js +0 -1
- package/public/_app/immutable/nodes/8.b5y1XVkv.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{e as Oe,o as T,c as N,a as F,m as Le,u as De}from"./
|
|
1
|
+
import{e as Oe,o as T,c as N,a as F,m as Le,u as De}from"./CpCbeTkV.js";import{Z as Be,v as _e,_ as We,a0 as Re,o as Ke,g as p,k as C,i as y,F as yt,a as d,a1 as Lt,a2 as Ue,a3 as G,a4 as Ve,a5 as Dt,a6 as je,u as Ge,b as D,P as gt,t as ze,c as k,I as K,p as U,a7 as qe,h as V,a8 as Zt}from"./rz89OrhQ.js";import{v as ft,a as j}from"./AUu53b1K.js";import{B as Xe,i as Ye,p as w}from"./BwDU-fss.js";function He(){return Symbol(Be)}const Ze=Symbol("NaN");function Je(n,t,e){_e&&We();var r=new Xe(n),i=!Re();Ke(()=>{var o=t();o!==o&&(o=Ze),i&&o!==null&&typeof o=="object"&&(o={}),r.ensure(o,e)})}function Qe(n){return typeof n=="function"}function J(n){return n!==null&&typeof n=="object"}const $e=["string","number","bigint","boolean"];function bt(n){return n==null||$e.includes(typeof n)?!0:Array.isArray(n)?n.every(t=>bt(t)):typeof n=="object"?Object.getPrototypeOf(n)===Object.prototype:!1}const R=Symbol("box"),lt=Symbol("is-writable");function b(n,t){const e=C(n);return t?{[R]:!0,[lt]:!0,get current(){return p(e)},set current(r){t(r)}}:{[R]:!0,get current(){return n()}}}function Q(n){return J(n)&&R in n}function wt(n){return Q(n)&< in n}function tn(n){return Q(n)?n:Qe(n)?b(n):Jt(n)}function en(n){return Object.entries(n).reduce((t,[e,r])=>Q(r)?(wt(r)?Object.defineProperty(t,e,{get(){return r.current},set(i){r.current=i}}):Object.defineProperty(t,e,{get(){return r.current}}),t):Object.assign(t,{[e]:r}),{})}function nn(n){return wt(n)?{[R]:!0,get current(){return n.current}}:n}function Jt(n){let t=y(yt(n));return{[R]:!0,[lt]:!0,get current(){return p(t)},set current(e){d(t,e,!0)}}}function B(n){let t=y(yt(n));return{[R]:!0,[lt]:!0,get current(){return p(t)},set current(e){d(t,e,!0)}}}B.from=tn;B.with=b;B.flatten=en;B.readonly=nn;B.isBox=Q;B.isWritableBox=wt;function Qt(...n){return function(t){for(const e of n)if(e){if(t.defaultPrevented)return;typeof e=="function"?e.call(this,t):e.current?.call(this,t)}}}var Bt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,rn=/\n/g,sn=/^\s*/,on=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,un=/^:\s*/,an=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,cn=/^[;\s]*/,ln=/^\s+|\s+$/g,hn=`
|
|
2
2
|
`,_t="/",Wt="*",O="",fn="comment",dn="declaration";function pn(n,t){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];t=t||{};var e=1,r=1;function i(g){var f=g.match(rn);f&&(e+=f.length);var E=g.lastIndexOf(hn);r=~E?g.length-E:r+g.length}function o(){var g={line:e,column:r};return function(f){return f.position=new s(g),l(),f}}function s(g){this.start=g,this.end={line:e,column:r},this.source=t.source}s.prototype.content=n;function u(g){var f=new Error(t.source+":"+e+":"+r+": "+g);if(f.reason=g,f.filename=t.source,f.line=e,f.column=r,f.source=n,!t.silent)throw f}function a(g){var f=g.exec(n);if(f){var E=f[0];return i(E),n=n.slice(E.length),f}}function l(){a(sn)}function h(g){var f;for(g=g||[];f=c();)f!==!1&&g.push(f);return g}function c(){var g=o();if(!(_t!=n.charAt(0)||Wt!=n.charAt(1))){for(var f=2;O!=n.charAt(f)&&(Wt!=n.charAt(f)||_t!=n.charAt(f+1));)++f;if(f+=2,O===n.charAt(f-1))return u("End of comment missing");var E=n.slice(2,f-2);return r+=2,i(E),n=n.slice(f),r+=2,g({type:fn,comment:E})}}function v(){var g=o(),f=a(on);if(f){if(c(),!a(un))return u("property missing ':'");var E=a(an),Ot=g({type:dn,property:Rt(f[0].replace(Bt,O)),value:E?Rt(E[0].replace(Bt,O)):O});return a(cn),Ot}}function m(){var g=[];h(g);for(var f;f=v();)f!==!1&&(g.push(f),h(g));return g}return l(),m()}function Rt(n){return n?n.replace(ln,O):O}function gn(n,t){let e=null;if(!n||typeof n!="string")return e;const r=pn(n),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:u}=o;i?t(s,u,o):u&&(e=e||{},e[s]=u)}),e}const bn=/\d/,mn=["-","_","/","."];function vn(n=""){if(!bn.test(n))return n!==n.toLowerCase()}function yn(n){const t=[];let e="",r,i;for(const o of n){const s=mn.includes(o);if(s===!0){t.push(e),e="",r=void 0;continue}const u=vn(o);if(i===!1){if(r===!1&&u===!0){t.push(e),e=o,r=u;continue}if(r===!0&&u===!1&&e.length>1){const a=e.at(-1);t.push(e.slice(0,Math.max(0,e.length-1))),e=a+o,r=u;continue}}e+=o,r=u,i=s}return t.push(e),t}function $t(n){return n?yn(n).map(t=>Tn(t)).join(""):""}function wn(n){return Sn($t(n||""))}function Tn(n){return n?n[0].toUpperCase()+n.slice(1):""}function Sn(n){return n?n[0].toLowerCase()+n.slice(1):""}function tt(n){if(!n)return{};const t={};function e(r,i){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){t[$t(r)]=i;return}if(r.startsWith("--")){t[r]=i;return}t[wn(r)]=i}return gn(n,e),t}function W(...n){return(...t)=>{for(const e of n)typeof e=="function"&&e(...t)}}function En(n,t){const e=RegExp(n,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(e)?r.replace(e,t):r}}const Cn=En(/[A-Z]/,n=>`-${n.toLowerCase()}`);function Mn(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${Cn(t)}: ${n[t]};`).join(`
|
|
3
3
|
`)}function xn(n={}){return Mn(n).replace(`
|
|
4
4
|
`," ")}const An=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],In=new Set(An);function Nn(n){return In.has(n)}function Fn(...n){const t={...n[0]};for(let e=1;e<n.length;e++){const r=n[e];if(r){for(const i of Object.keys(r)){const o=t[i],s=r[i],u=typeof o=="function",a=typeof s=="function";if(u&&Nn(i)){const l=o,h=s;t[i]=Qt(l,h)}else if(u&&a)t[i]=W(o,s);else if(i==="class"){const l=bt(o),h=bt(s);l&&h?t[i]=ft(o,s):l?t[i]=ft(o):h&&(t[i]=ft(s))}else if(i==="style"){const l=typeof o=="object",h=typeof s=="object",c=typeof o=="string",v=typeof s=="string";if(l&&h)t[i]={...o,...s};else if(l&&v){const m=tt(s);t[i]={...o,...m}}else if(c&&h){const m=tt(o);t[i]={...m,...s}}else if(c&&v){const m=tt(o),g=tt(s);t[i]={...m,...g}}else l?t[i]=o:h?t[i]=s:c?t[i]=o:v&&(t[i]=s)}else t[i]=s!==void 0?s:o}for(const i of Object.getOwnPropertySymbols(r)){const o=t[i],s=r[i];t[i]=s!==void 0?s:o}}}return typeof t.style=="object"&&(t.style=xn(t.style).replaceAll(`
|
|
5
|
-
`," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const kn=typeof window<"u"?window:void 0;function Pn(n){let t=n.activeElement;for(;t?.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}class On extends Map{#t=new Map;#e=y(0);#n=y(0);#r=Lt||-1;constructor(t){if(super(),t){for(var[e,r]of t)super.set(e,r);this.#n.v=super.size}}#i(t){return Lt===this.#r?y(t):Ue(t)}has(t){var e=this.#t,r=e.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),e.set(t,r);else return p(this.#e),!1;return p(r),!0}forEach(t,e){this.#s(),super.forEach(t,e)}get(t){var e=this.#t,r=e.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),e.set(t,r);else{p(this.#e);return}return p(r),super.get(t)}getOrInsert(t,e){return super.has(t)||this.set(t,e),this.get(t)}getOrInsertComputed(t,e){return super.has(t)||this.set(t,e(t)),this.get(t)}set(t,e){var r=this.#t,i=r.get(t),o=super.get(t),s=super.set(t,e),u=this.#e;if(i===void 0)i=this.#i(0),r.set(t,i),d(this.#n,super.size),G(u);else if(o!==e){G(i);var a=u.reactions===null?null:new Set(u.reactions),l=a===null||!i.reactions?.every(h=>a.has(h));l&&G(u)}return s}delete(t){var e=this.#t,r=e.get(t),i=super.delete(t);return r!==void 0&&(e.delete(t),d(r,-1)),i&&(d(this.#n,super.size),G(this.#e)),i}clear(){if(super.size!==0){super.clear();var t=this.#t;d(this.#n,0);for(var e of t.values())d(e,-1);G(this.#e),t.clear()}}#s(){p(this.#e);var t=this.#t;if(this.#n.v!==t.size){for(var e of super.keys())if(!t.has(e)){var r=this.#i(0);t.set(e,r)}}for([,r]of this.#t)p(r)}keys(){return p(this.#e),super.keys()}values(){return this.#s(),super.values()}entries(){return this.#s(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return p(this.#n),super.size}}class Ln{#t;#e;constructor(t={}){const{window:e=kn,document:r=e?.document}=t;e!==void 0&&(this.#t=r,this.#e=Oe(i=>{const o=T(e,"focusin",i),s=T(e,"focusout",i);return()=>{o(),s()}}))}get current(){return this.#e?.(),this.#t?Pn(this.#t):null}}new Ln;class ht{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Ve(this.#e)}get(){const t=Dt(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const e=Dt(this.#e);return e===void 0?t:e}set(t){return je(this.#e,t)}}function Dn(n,t){switch(n){case"post":D(t);break;case"pre":Ge(t);break}}function te(n,t,e,r={}){const{lazy:i=!1}=r;let o=!i,s=Array.isArray(n)?[]:void 0;Dn(t,()=>{const u=Array.isArray(n)?n.map(l=>l()):n();if(!o){o=!0,s=u;return}const a=gt(()=>e(u,s));return s=u,a})}function M(n,t,e){te(n,"post",t,e)}function Bn(n,t,e){te(n,"pre",t,e)}M.pre=Bn;function _(n){D(()=>()=>{n()})}function _n(n,t){return setTimeout(t,n)}function x(n){ze().then(n)}const Wn=1,Rn=9,Kn=11;function mt(n){return J(n)&&n.nodeType===Wn&&typeof n.nodeName=="string"}function ee(n){return J(n)&&n.nodeType===Rn}function Un(n){return J(n)&&n.constructor?.name==="VisualViewport"}function Vn(n){return J(n)&&n.nodeType!==void 0}function ne(n){return Vn(n)&&n.nodeType===Kn&&"host"in n}function jn(n,t){if(!n||!t||!mt(n)||!mt(t))return!1;const e=t.getRootNode?.();if(n===t||n.contains(t))return!0;if(e&&ne(e)){let r=t;for(;r;){if(n===r)return!0;r=r.parentNode||r.host}}return!1}function $(n){return ee(n)?n:Un(n)?n.document:n?.ownerDocument??document}function Gn(n){return ne(n)?Gn(n.host):ee(n)?n.defaultView??window:mt(n)?n.ownerDocument?.defaultView??window:window}function zn(n){let t=n.activeElement;for(;t?.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}class Tt{element;#t=C(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return p(this.#t)}set root(t){d(this.#t,t)}constructor(t){typeof t=="function"?this.element=b(t):this.element=t}getDocument=()=>$(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>zn(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,e)=>this.getWindow().setTimeout(t,e);clearTimeout=t=>this.getWindow().clearTimeout(t)}function St(n,t){return{[He()]:e=>Q(n)?(n.current=e,gt(()=>t?.(e)),()=>{"isConnected"in e&&e.isConnected||(n.current=null,t?.(null))}):(n(e),gt(()=>t?.(e)),()=>{"isConnected"in e&&e.isConnected||(n(null),t?.(null))})}}function re(n){return n?"true":"false"}function di(n){return n?"true":void 0}function ie(n){return n?"":void 0}function pi(n){return n?!0:void 0}function se(n){return n?"open":"closed"}function gi(n){return n?"checked":"unchecked"}function Yn(n){return n==="starting"?{"data-starting-style":""}:n==="ending"?{"data-ending-style":""}:{}}function bi(n,t){return n?"true":"false"}class qn{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(e=>[e,this.getAttr(e)]))}getAttr(t,e){return e?`data-${e}-${t}`:`${this.#e}${t}`}selector(t,e){return`[${this.getAttr(t,e)}]`}}function Xn(n){const t=new qn(n);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Z="ArrowDown",Et="ArrowLeft",Ct="ArrowRight",it="ArrowUp",oe="End",ue="Enter",Hn="Escape",ae="Home",Zn="PageDown",Jn="PageUp",Mt=" ",Qn="Tab";function $n(n){return window.getComputedStyle(n).getPropertyValue("direction")}function tr(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Et:Ct,vertical:Z}[t]}function er(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Ct:Et,vertical:it}[t]}function nr(n="ltr",t="horizontal"){return["ltr","rtl"].includes(n)||(n="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:tr(n,t),prevKey:er(n,t)}}const ce=typeof document<"u",Kt=rr();function rr(){return ce&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function P(n){return n instanceof HTMLElement}function X(n){return n instanceof Element}function le(n){return n instanceof Element||n instanceof SVGElement}function mi(n){return n!==null}function ir(n){return n instanceof HTMLInputElement&&"select"in n}class sr{#t;#e=B(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,e,r=!1){const i=this.#t.rootNode.current;if(!i||!t)return;const o=this.getCandidateNodes();if(!o.length)return;const s=o.indexOf(t),u=$n(i),{nextKey:a,prevKey:l}=nr(u,this.#t.orientation.current),h=this.#t.loop.current,c={[a]:s+1,[l]:s-1,[ae]:0,[oe]:o.length-1};if(r){const g=a===Z?Ct:Z,f=l===it?Et:it;c[g]=s+1,c[f]=s-1}let v=c[e.key];if(v===void 0)return;e.preventDefault(),v<0&&h?v=o.length-1:v===o.length&&h&&(v=0);const m=o[v];if(m)return m.focus(),this.#e.current=m.id,this.#t.onCandidateFocus?.(m),m}getTabIndex(t){const e=this.getCandidateNodes(),r=this.#e.current!==null;return t&&!r&&e[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const e=this.#t.rootNode.current?.querySelector(`#${t}`);!e||!P(e)||e.focus()}}class or{#t;#e=null;#n=null;#r=0;constructor(t){this.#t=t,_(()=>this.#i())}#i(){this.#e!==null&&(window.cancelAnimationFrame(this.#e),this.#e=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(t){this.#i();const e=this.#t.ref.current;if(!e)return;if(typeof e.getAnimations!="function"){this.#s(t);return}const r=this.#r,i=()=>{r===this.#r&&this.#s(t)},o=()=>{if(r!==this.#r)return;const u=e.getAnimations();if(u.length===0){i();return}Promise.all(u.map(a=>a.finished)).then(()=>{i()}).catch(()=>{if(r!==this.#r)return;if(e.getAnimations().some(h=>h.pending||h.playState!=="finished")){o();return}i()})},s=()=>{this.#e=window.requestAnimationFrame(()=>{this.#e=null,o()})};if(!this.#t.afterTick.current){s();return}this.#e=window.requestAnimationFrame(()=>{this.#e=null;const u="data-starting-style";if(!e.hasAttribute(u)){s();return}this.#n=new MutationObserver(()=>{r===this.#r&&(e.hasAttribute(u)||(this.#n?.disconnect(),this.#n=null,s()))}),this.#n.observe(e,{attributes:!0,attributeFilter:[u]})})}#s(t){const e=()=>{t()};this.#t.afterTick?x(e):e()}}class ur{#t;#e;#n;#r=y(!1);#i=y(void 0);#s=!1;#o=null;constructor(t){this.#t=t,d(this.#r,t.open.current,!0),this.#e=t.enabled??!0,this.#n=new or({ref:this.#t.ref,afterTick:this.#t.open}),_(()=>this.#u()),M(()=>this.#t.open.current,e=>{if(!this.#s){this.#s=!0;return}if(this.#u(),!e&&this.#t.shouldSkipExitAnimation?.()){d(this.#r,!1),d(this.#i,void 0),this.#t.onComplete?.();return}if(e&&d(this.#r,!0),d(this.#i,e?"starting":"ending",!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#t.open.current&&d(this.#i,void 0)})),!this.#e){e||d(this.#r,!1),d(this.#i,void 0),this.#t.onComplete?.();return}this.#n.run(()=>{e===this.#t.open.current&&(this.#t.open.current||d(this.#r,!1),d(this.#i,void 0),this.#t.onComplete?.())})})}get shouldRender(){return p(this.#r)}get transitionStatus(){return p(this.#i)}#u(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}}function S(){}function vi(n,t){return`bits-${n}`}function ar(n,t){var e=N(),r=k(e);Je(r,()=>t.children,i=>{var o=N(),s=k(o);j(s,()=>t.children??K),F(i,o)}),F(n,e)}const cr=new ht("BitsConfig");function lr(){const n=new hr(null,{});return cr.getOr(n).opts}class hr{opts;constructor(t,e){const r=fr(t,e);this.opts={defaultPortalTo:r(i=>i.defaultPortalTo),defaultLocale:r(i=>i.defaultLocale)}}}function fr(n,t){return e=>b(()=>{const i=e(t)?.current;if(i!==void 0)return i;if(n!==null)return e(n.opts)?.current})}function dr(n,t){return e=>{const r=lr();return b(()=>{const i=e();if(i!==void 0)return i;const o=n(r).current;return o!==void 0?o:t})}}const pr=dr(n=>n.defaultPortalTo,"body");function yi(n,t){U(t,!0);const e=pr(()=>t.to),r=Ye();let i=C(o);function o(){if(!ce||t.disabled)return null;let c=null;return typeof e.current=="string"?c=document.querySelector(e.current):c=e.current,c}let s;function u(){s&&(De(s),s=null)}M([()=>p(i),()=>t.disabled],([c,v])=>{if(!c||v){u();return}return s=Le(ar,{target:c,props:{children:t.children},context:r}),()=>{u()}});var a=N(),l=k(a);{var h=c=>{var v=N(),m=k(v);j(m,()=>t.children??K),F(c,v)};Xe(l,c=>{t.disabled&&c(h)})}F(n,a),V()}class gr{eventName;options;constructor(t,e={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=e}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,e){const r=this.createEvent(e);return t.dispatchEvent(r),r}listen(t,e,r){const i=o=>{e(o)};return T(t,this.eventName,i,r)}}function Ut(n,t=500){let e=null;const r=(...i)=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{n(...i)},t)};return r.destroy=()=>{e!==null&&(clearTimeout(e),e=null)},r}function he(n,t){return n===t||n.contains(t)}function fe(n){return n?.ownerDocument??document}function br(n,t){const{clientX:e,clientY:r}=n,i=t.getBoundingClientRect();return e<i.left||e>i.right||r<i.top||r>i.bottom}const mr=[ue,Mt],vr=[Z,Jn,ae],de=[it,Zn,oe],yr=[...vr,...de];function A(n){return n.pointerType==="mouse"}function wr(n,{select:t=!1}={}){if(!n||!n.focus)return;const e=$(n);if(e.activeElement===n)return;const r=e.activeElement;n.focus({preventScroll:!0}),n!==r&&ir(n)&&t&&n.select()}function Tr(n,{select:t=!1}={},e){const r=e();for(const i of n)if(wr(i,{select:t}),e()!==r)return!0}let z=y(!1);class I{static _refs=0;static _cleanup;constructor(){D(()=>(I._refs===0&&(I._cleanup=Zt(()=>{const t=[],e=i=>{d(z,!1)},r=i=>{d(z,!0)};return t.push(T(document,"pointerdown",e,{capture:!0}),T(document,"pointermove",e,{capture:!0}),T(document,"keydown",r,{capture:!0})),W(...t)})),I._refs++,()=>{I._refs--,I._refs===0&&(d(z,!1),I._cleanup?.())}))}get current(){return p(z)}set current(t){d(z,t,!0)}}var pe=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],st=pe.join(","),ge=typeof Element>"u",L=ge?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ot=!ge&&Element.prototype.getRootNode?function(n){var t;return n==null||(t=n.getRootNode)===null||t===void 0?void 0:t.call(n)}:function(n){return n?.ownerDocument},ut=function(t,e){var r;e===void 0&&(e=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||e&&t&&(typeof t.closest=="function"?t.closest("[inert]"):ut(t.parentNode));return s},Sr=function(t){var e,r=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return r===""||r==="true"},be=function(t,e,r){if(ut(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(st));return e&&L.call(t,st)&&i.unshift(t),i=i.filter(r),i},at=function(t,e,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!ut(s,!1))if(s.tagName==="SLOT"){var u=s.assignedElements(),a=u.length?u:s.children,l=at(a,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:s,candidates:l})}else{var h=L.call(s,st);h&&r.filter(s)&&(e||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),v=!ut(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&v){var m=at(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scopeParent:s,candidates:m})}else o.unshift.apply(o,s.children)}}return i},me=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ve=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Sr(t))&&!me(t)?0:t.tabIndex},Er=function(t,e){var r=ve(t);return r<0&&e&&!me(t)?0:r},Cr=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},ye=function(t){return t.tagName==="INPUT"},Mr=function(t){return ye(t)&&t.type==="hidden"},xr=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return e},Ar=function(t,e){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===e)return t[r]},Ir=function(t){if(!t.name)return!0;var e=t.form||ot(t),r=function(u){return e.querySelectorAll('input[type="radio"][name="'+u+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=Ar(i,t.form);return!o||o===t},Nr=function(t){return ye(t)&&t.type==="radio"},Fr=function(t){return Nr(t)&&!Ir(t)},kr=function(t){var e,r=t&&ot(t),i=(e=r)===null||e===void 0?void 0:e.host,o=!1;if(r&&r!==t){var s,u,a;for(o=!!((s=i)!==null&&s!==void 0&&(u=s.ownerDocument)!==null&&u!==void 0&&u.contains(i)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!o&&i;){var l,h,c;r=ot(i),i=(l=r)===null||l===void 0?void 0:l.host,o=!!((h=i)!==null&&h!==void 0&&(c=h.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},Vt=function(t){var e=t.getBoundingClientRect(),r=e.width,i=e.height;return r===0&&i===0},Pr=function(t,e){var r=e.displayCheck,i=e.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}var s=getComputedStyle(t),u=s.visibility;if(u==="hidden"||u==="collapse")return!0;var a=L.call(t,"details>summary:first-of-type"),l=a?t.parentElement:t;if(L.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var h=t;t;){var c=t.parentElement,v=ot(t);if(c&&!c.shadowRoot&&i(c)===!0)return Vt(t);t.assignedSlot?t=t.assignedSlot:!c&&v!==t.ownerDocument?t=v.host:t=c}t=h}if(kr(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Vt(t);return!1},Or=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var r=0;r<e.children.length;r++){var i=e.children.item(r);if(i.tagName==="LEGEND")return L.call(e,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}e=e.parentElement}return!1},ct=function(t,e){return!(e.disabled||Mr(e)||Pr(e,t)||xr(e)||Or(e))},vt=function(t,e){return!(Fr(e)||ve(e)<0||!ct(t,e))},Lr=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},we=function(t){var e=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,u=s?i.scopeParent:i,a=Er(u,s),l=s?we(i.candidates):u;a===0?s?e.push.apply(e,l):e.push(u):r.push({documentOrder:o,tabIndex:a,item:i,isScope:s,content:l})}),r.sort(Cr).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(e)},Te=function(t,e){e=e||{};var r;return e.getShadowRoot?r=at([t],e.includeContainer,{filter:vt.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:Lr}):r=be(t,e.includeContainer,vt.bind(null,e)),we(r)},Se=function(t,e){e=e||{};var r;return e.getShadowRoot?r=at([t],e.includeContainer,{filter:ct.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):r=be(t,e.includeContainer,ct.bind(null,e)),r},xt=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return L.call(t,st)===!1?!1:vt(e,t)},Dr=pe.concat("iframe:not([inert]):not([inert] *)").join(","),Ee=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return L.call(t,Dr)===!1?!1:ct(e,t)};function H(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Br(n,t){if(!xt(n,H()))return _r(n,t);const e=$(n),r=Te(e.body,H());t==="prev"&&r.reverse();const i=r.indexOf(n);return i===-1?e.body:r.slice(i+1)[0]}function _r(n,t){const e=$(n);if(!Ee(n,H()))return e.body;const r=Se(e.body,H());t==="prev"&&r.reverse();const i=r.indexOf(n);return i===-1?e.body:r.slice(i+1).find(s=>xt(s,H()))??e.body}function wi(n,t,e=!0){if(!(n.length===0||t<0||t>=n.length))return n.length===1&&t===0?n[0]:t===n.length-1?e?n[0]:void 0:n[t+1]}function Ti(n,t,e=!0){if(!(n.length===0||t<0||t>=n.length))return n.length===1&&t===0?n[0]:t===0?e?n[n.length-1]:void 0:n[t-1]}function Si(n,t,e,r=!0){if(n.length===0||t<0||t>=n.length)return;let i=t+e;return r?i=(i%n.length+n.length)%n.length:i=Math.max(0,Math.min(i,n.length-1)),n[i]}function Ei(n,t,e,r=!0){if(n.length===0||t<0||t>=n.length)return;let i=t-e;return r?i=(i%n.length+n.length)%n.length:i=Math.max(0,Math.min(i,n.length-1)),n[i]}function Ce(n,t,e){const r=t.toLowerCase();if(r.endsWith(" ")){const c=r.slice(0,-1);if(n.filter(f=>f.toLowerCase().startsWith(c)).length<=1)return Ce(n,c,e);const m=e?.toLowerCase();if(m&&m.startsWith(c)&&m.charAt(c.length)===" "&&t.trim()===c)return e;const g=n.filter(f=>f.toLowerCase().startsWith(r));if(g.length>0){const f=e?n.indexOf(e):-1;return jt(g,Math.max(f,0)).find(Pe=>Pe!==e)||e}}const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=o.toLowerCase(),u=e?n.indexOf(e):-1;let a=jt(n,Math.max(u,0));o.length===1&&(a=a.filter(c=>c!==e));const h=a.find(c=>c?.toLowerCase().startsWith(s));return h!==e?h:void 0}function jt(n,t){return n.map((e,r)=>n[(t+r)%n.length])}const Wr={afterMs:1e4,onChange:S};function Rr(n,t){const{afterMs:e,onChange:r,getWindow:i}={...Wr,...t};let o=null,s=y(yt(n));function u(){return i().setTimeout(()=>{d(s,n,!0),r?.(n)},e)}return D(()=>()=>{o&&i().clearTimeout(o)}),b(()=>p(s),a=>{d(s,a,!0),r?.(a),o&&i().clearTimeout(o),o=u()})}class Kr{#t;#e;#n=C(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#r=C(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=Rr("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,e){if(!e.length)return;this.#e.current=this.#e.current+t;const r=p(this.#r)(),i=e.find(a=>a===r)?.textContent?.trim()??"",o=e.map(a=>a.textContent?.trim()??""),s=Ce(o,this.#e.current,i),u=e.find(a=>a.textContent?.trim()===s);return u&&p(this.#n)(u),u}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}const Ur="data-context-menu-trigger",Vr="data-context-menu-content",jr=new ht("Menu.Root"),At=new ht("Menu.Root | Menu.Sub"),Me=new ht("Menu.Content"),Gr=new gr("bitsmenuopen",{bubbles:!1,cancelable:!0}),zr=Xn({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class Yr{#t;#e=null;#n=null;#r=!1;#i=null;#s=null;#o=null;#u=null;constructor(t){this.#t=t,M([t.triggerNode,t.contentNode,t.enabled],([e,r,i])=>{if(this.#b(),!e||!r||!i)return;const o=c=>{A(c)&&(this.#u={x:c.clientX,y:c.clientY},this.#r||this.#c(c,"content"))},s=c=>{A(c)&&this.#v(c,"content")},u=c=>{A(c)&&(this.#r||this.#c(c,"trigger"))},a=c=>{if(A(c)){if(X(c.relatedTarget)){const v=this.#t.subContentSelector(),m=c.relatedTarget.closest(v);if(m&&m!==r&&m.id&&!!r.querySelector(`[aria-controls="${m.id}"]`))return}this.#v(c,"trigger")}},l=c=>{A(c)&&this.#p()},h=c=>{A(c)&&this.#p()};return e.addEventListener("pointermove",o),e.addEventListener("pointerleave",s),e.addEventListener("pointerenter",l),r.addEventListener("pointermove",u),r.addEventListener("pointerleave",a),r.addEventListener("pointerenter",h),()=>{e.removeEventListener("pointermove",o),e.removeEventListener("pointerleave",s),e.removeEventListener("pointerenter",l),r.removeEventListener("pointermove",u),r.removeEventListener("pointerleave",a),r.removeEventListener("pointerenter",h),this.#b()}}),_(()=>{this.#b()})}#l(){const t=this.#t.parentContentNode();return t?t.getBoundingClientRect():this.#t.triggerNode()?.getBoundingClientRect()??null}#a(t,e){const r=this.#t.triggerNode(),i=this.#t.contentNode();if(!r||!i)return null;const o=r.getBoundingClientRect(),s=i.getBoundingClientRect(),u=Xr(o,s);let a,l,h;return e==="content"?(a=this.#r?this.#s??t:t,l=s):(a=this.#u??t,l=this.#l()??o,h=s),this.#s=a,{corridor:Hr(o,s,u),intent:Zr(a,l,u,e,h),targetRect:l,side:u}}#h(t,e,r){return Gt(t,e)||Gt(t,r)}#c(t,e){const r={x:t.clientX,y:t.clientY};this.#a(r,e)&&(this.#i=e,this.#o=r)}#v(t,e){if(!this.#t.enabled())return;const r=this.#t.triggerNode(),i=this.#t.contentNode();if(!r||!i)return;const o=t.relatedTarget;if(X(o)&&(e==="content"&&i.contains(o)||e==="trigger"&&r.contains(o)))return;const s={x:t.clientX,y:t.clientY},u=this.#a(s,e);if(u){if(!zt(s,u.targetRect)&&!this.#h(s,u.corridor,u.intent)){this.#E();return}this.#r=!0,this.#i=e,this.#o=s,this.#t.setIsPointerInTransit(!0),this.#C(),this.#S()}}#f=null;#p(){if(!this.#r)return;const t=this.#i==="trigger";this.#T(),this.#m(),this.#r=!1,this.#E(),t?(this.#g(),this.#f=setTimeout(()=>{this.#f=null,this.#t.setIsPointerInTransit(!1)},100)):this.#t.setIsPointerInTransit(!1)}#g(){this.#f!==null&&(clearTimeout(this.#f),this.#f=null)}#d(){const t=this.#o;this.#T(),this.#m(),this.#g(),this.#r=!1,this.#t.setIsPointerInTransit(!1),this.#E(),this.#t.onIntentExit(t)}#b(){this.#T(),this.#m(),this.#g(),this.#r&&this.#t.setIsPointerInTransit(!1),this.#r=!1,this.#i=null,this.#s=null,this.#o=null,this.#u=null}#w(t){const e=this.#t.contentNode();if(!e)return!1;const i=e.ownerDocument.elementFromPoint(t.x,t.y);if(!i)return!1;const o=this.#t.subContentSelector(),s=i.closest(o);return!s||s===e?!1:s.id?!!e.querySelector(`[aria-controls="${s.id}"]`):!1}#y=t=>{if(!this.#r||!this.#i||!A(t))return;const e=this.#t.triggerNode(),r=this.#t.contentNode();if(!e||!r){this.#d();return}this.#m();const i={x:t.clientX,y:t.clientY};this.#o=i;const o=e.getBoundingClientRect(),s=r.getBoundingClientRect();if(this.#i==="content"&&zt(i,s)){this.#p();return}if(this.#i==="trigger"&&qr(i,o,4)){this.#p();return}if(this.#w(i)){this.#S();return}const u=this.#a(i,this.#i);if(!u){this.#d();return}if(this.#h(i,u.corridor,u.intent)){this.#S();return}this.#d()};#C(){if(this.#e)return;const t=$(this.#t.triggerNode()??this.#t.contentNode());t&&(t.addEventListener("pointermove",this.#y,!0),this.#e=()=>{t.removeEventListener("pointermove",this.#y,!0),this.#e=null})}#T(){this.#e?.()}#S(){this.#m(),this.#n=setTimeout(()=>{this.#n=null,this.#r&&this.#d()},500)}#m(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#E(){this.#i=null,this.#s=null,this.#o=null}}function Gt(n,t){const{x:e,y:r}=n;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const u=t[o].x,a=t[o].y,l=t[s].x,h=t[s].y;a>r!=h>r&&e<(l-u)*(r-a)/(h-a)+u&&(i=!i)}return i}function zt(n,t){return n.x>=t.left&&n.x<=t.right&&n.y>=t.top&&n.y<=t.bottom}function qr(n,t,e){return n.x>=t.left+e&&n.x<=t.right-e&&n.y>=t.top+e&&n.y<=t.bottom-e}function Xr(n,t){const e=n.left+n.width/2,r=n.top+n.height/2,i=t.left+t.width/2,o=t.top+t.height/2,s=i-e,u=o-r;return Math.abs(s)>Math.abs(u)?s>0?"right":"left":u>0?"bottom":"top"}function Hr(n,t,e){switch(e){case"top":return[{x:Math.min(n.left,t.left)-2,y:n.top},{x:Math.min(n.left,t.left)-2,y:t.bottom},{x:Math.max(n.right,t.right)+2,y:t.bottom},{x:Math.max(n.right,t.right)+2,y:n.top}];case"bottom":return[{x:Math.min(n.left,t.left)-2,y:n.bottom},{x:Math.min(n.left,t.left)-2,y:t.top},{x:Math.max(n.right,t.right)+2,y:t.top},{x:Math.max(n.right,t.right)+2,y:n.bottom}];case"left":return[{x:n.left,y:Math.min(n.top,t.top)-2},{x:t.right,y:Math.min(n.top,t.top)-2},{x:t.right,y:Math.max(n.bottom,t.bottom)+2},{x:n.left,y:Math.max(n.bottom,t.bottom)+2}];case"right":return[{x:n.right,y:Math.min(n.top,t.top)-2},{x:t.left,y:Math.min(n.top,t.top)-2},{x:t.left,y:Math.max(n.bottom,t.bottom)+2},{x:n.right,y:Math.max(n.bottom,t.bottom)+2}]}}function Zr(n,t,e,r,i){const s=r==="trigger"?Jr(e):e,u=i?Math.min(t.top,i.top)-8:t.top-8,a=i?Math.max(t.bottom,i.bottom)+8:t.bottom+8,l=i?Math.min(t.left,i.left)-8:t.left-8,h=i?Math.max(t.right,i.right)+8:t.right+8;switch(s){case"right":return[n,{x:t.left,y:u},{x:t.left,y:a}];case"left":return[n,{x:t.right,y:u},{x:t.right,y:a}];case"bottom":return[n,{x:l,y:t.top},{x:h,y:t.top}];case"top":return[n,{x:l,y:t.bottom},{x:h,y:t.bottom}]}}function Jr(n){switch(n){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}class xe{static create(t){const e=new xe(t);return jr.set(e)}opts;isUsingKeyboard=new I;#t=y(!1);get ignoreCloseAutoFocus(){return p(this.#t)}set ignoreCloseAutoFocus(t){d(this.#t,t,!0)}#e=y(!1);get isPointerInTransit(){return p(this.#e)}set isPointerInTransit(t){d(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>zr.getAttr(t,this.opts.variant.current)}class Ae{static create(t,e){return At.set(new Ae(t,e,null))}opts;root;parentMenu;contentId=b(()=>"");#t=y(null);get contentNode(){return p(this.#t)}set contentNode(t){d(this.#t,t,!0)}contentPresence;#e=y(null);get triggerNode(){return p(this.#e)}set triggerNode(t){d(this.#e,t,!0)}constructor(t,e,r){this.opts=t,this.root=e,this.parentMenu=r,this.contentPresence=new ur({ref:b(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)},shouldSkipExitAnimation:()=>this.root.opts.variant.current!=="menubar"||this.parentMenu!==null?!1:this.root.opts.shouldSkipExitAnimation?.()??!1}),r&&M(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class Ie{static create(t){return Me.set(new Ie(t,At.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=y("");get search(){return p(this.#t)}set search(t){d(this.#t,t,!0)}#e=0;#n;#r=y(!1);get mounted(){return p(this.#r)}set mounted(t){d(this.#r,t,!0)}#i;constructor(t,e){this.opts=t,this.parentMenu=e,this.domContext=new Tt(t.ref),this.attachment=St(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),e.contentId=t.id,this.#i=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Yr({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,parentContentNode:()=>this.parentMenu.parentMenu?.contentNode??null,subContentSelector:()=>`[${this.parentMenu.root.getBitsAttr("sub-content")}]`,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onIntentExit:r=>{this.parentMenu.opts.open.current=!1,this.#u(r)},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),this.#n=new Kr({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new sr({rootNode:b(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:b(()=>"vertical")}),M(()=>this.parentMenu.contentNode,r=>{if(!r)return;const i=()=>{x(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return Gr.listen(r,i)}),D(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#s(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#o(){return this.parentMenu.root.isPointerInTransit}#u(t){if(!t)return;const e=this.parentMenu.parentMenu?.contentNode;if(!e)return;const r=this.domContext.getDocument().elementFromPoint(t.x,t.y);if(!X(r))return;const i=r.closest(`[${this.parentMenu.root.getBitsAttr("sub-trigger")}]`);!i||!e.contains(i)||i!==this.parentMenu.triggerNode&&i.dispatchEvent(new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,pointerType:"mouse",clientX:t.x,clientY:t.y}))}onCloseAutoFocus=t=>{if(this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#i)){if(this.parentMenu.root.ignoreCloseAutoFocus){t.preventDefault();return}this.parentMenu.triggerNode&&xt(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())}};handleTabKeyDown(t){let e=this.parentMenu;for(;e.parentMenu!==null;)e=e.parentMenu;if(!e.triggerNode)return;t.preventDefault();const r=Br(e.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,e.onClose(),x(()=>{r.focus(),x(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===Qn){this.handleTabKeyDown(t);return}const e=t.target,r=t.currentTarget;if(!P(e)||!P(r))return;const i=e.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,o=t.ctrlKey||t.altKey||t.metaKey,s=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(e,t)||t.code==="Space")return;const a=this.#s();i&&!o&&s&&this.#n(t.key,a),t.target?.id===this.parentMenu.contentId.current&&yr.includes(t.key)&&(t.preventDefault(),de.includes(t.key)&&a.reverse(),Tr(a,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){X(t.currentTarget)&&X(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&x(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#o()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#o()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus({preventScroll:!0}),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#o()}handleInteractOutside(t){if(!le(t.target))return;const e=this.parentMenu.triggerNode?.id;if(t.target.id===e){t.preventDefault();return}if(t.target.closest(`#${e}`)){t.preventDefault();return}this.parentMenu.root.ignoreCloseAutoFocus=!0,x(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#l=C(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return p(this.#l)}set snippetProps(t){d(this.#l,t)}#a=C(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":se(this.parentMenu.opts.open.current),...Yn(this.parentMenu.contentPresence.transitionStatus),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return p(this.#a)}set props(t){d(this.#a,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Qr{opts;content;attachment;#t=y(!1);constructor(t,e){this.opts=t,this.content=e,this.attachment=St(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&A(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!P(r))return;r.focus({preventScroll:!0})}}onpointerleave(t){t.defaultPrevented||A(t)&&this.content.onItemLeave(t)}onfocus(t){x(()=>{t.defaultPrevented||this.opts.disabled.current||d(this.#t,!0)})}onblur(t){x(()=>{t.defaultPrevented||d(this.#t,!1)})}#e=C(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":re(this.opts.disabled.current),"data-disabled":ie(this.opts.disabled.current),"data-highlighted":p(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return p(this.#e)}set props(t){d(this.#e,t)}}class Ne{static create(t){const e=new Qr(t,Me.get());return new Ne(t,e)}opts;item;root;#t=!1;constructor(t,e){this.opts=t,this.item=e,this.root=e.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const e=this.item.content.search!=="";if(!(this.item.opts.disabled.current||e&&t.key===Mt)&&mr.includes(t.key)){if(!P(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!P(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#n=C(()=>Fn(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return p(this.#n)}set props(t){d(this.#n,t)}}class Fe{static create(t){return new Fe(t,At.get())}opts;parentMenu;attachment;constructor(t,e){this.opts=t,this.parentMenu=e,this.attachment=St(this.opts.ref,r=>this.parentMenu.triggerNode=r)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===Mt||t.key===ue){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Z&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=C(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=C(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":re(this.parentMenu.opts.open.current),"aria-controls":p(this.#t),"data-disabled":ie(this.opts.disabled.current),"data-state":se(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return p(this.#e)}set props(t){d(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class It{static create(t){return new It(t)}opts;#t;#e;#n={pointerdown:!1};#r=!1;#i=!1;#s=void 0;#o;#u=S;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#o=t.onFocusOutside,D(()=>{this.#s=fe(this.opts.ref.current)});let e=S,r=null,i=!1;const o=()=>{r!=null&&(clearTimeout(r),r=null)},s=()=>{o(),this.#d(),globalThis.bitsDismissableLayers.delete(this),this.#c.destroy(),e()};M([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return o(),r=_n(1,()=>{r=null,!(i||!this.opts.ref.current)&&(globalThis.bitsDismissableLayers.set(this,this.#e),e(),e=this.#a())}),s}),_(()=>{i=!0,o(),this.#d.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#c.destroy(),this.#u(),e()})}#l=t=>{t.defaultPrevented||this.opts.ref.current&&x(()=>{!this.opts.ref.current||this.#g(t.target)||t.target&&!this.#i&&this.#o.current?.(t)})};#a(){return W(T(this.#s,"pointerdown",W(this.#v,this.#p),{capture:!0}),T(this.#s,"pointerdown",W(this.#f,this.#c)),T(this.#s,"focusin",this.#l))}#h=t=>{let e=t;e.defaultPrevented&&(e=Yt(t)),this.#t.current(t)};#c=Ut(t=>{if(!this.opts.ref.current){this.#u();return}const e=this.opts.isValidEvent.current(t,this.opts.ref.current)||ei(t,this.opts.ref.current);if(!this.#r||this.#b()||!e){this.#u();return}let r=t;if(r.defaultPrevented&&(r=Yt(r)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#u();return}t.pointerType==="touch"?(this.#u(),this.#u=T(this.#s,"click",this.#h,{once:!0})):this.#t.current(r)},10);#v=t=>{this.#n[t.type]=!0};#f=t=>{this.#n[t.type]=!1};#p=()=>{this.opts.ref.current&&(this.#r=ti(this.opts.ref.current))};#g=t=>this.opts.ref.current?he(this.opts.ref.current,t):!1;#d=Ut(()=>{for(const t in this.#n)this.#n[t]=!1;this.#r=!1},20);#b(){return Object.values(this.#n).some(Boolean)}#w=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#w,onblurcapture:this.#y}}function $r(n=[...globalThis.bitsDismissableLayers]){return n.findLast(([t,{current:e}])=>e==="close"||e==="ignore")}function ti(n){const t=[...globalThis.bitsDismissableLayers],e=$r(t);if(e)return e[0].opts.ref.current===n;const[r]=t[0];return r.opts.ref.current===n}function ei(n,t){const e=n.target;if(!le(e))return!1;const r=!!e.closest(`[${Ur}]`),i=!!t.closest(`[${Vr}]`);return"button"in n&&n.button>0&&!r?!1:"button"in n&&n.button===0&&r&&i?!0:r&&i?!1:fe(e).documentElement.contains(e)&&!he(t,e)&&br(n,t)}function Yt(n){const t=n.currentTarget,e=n.target;let r;n instanceof PointerEvent?r=new PointerEvent(n.type,n):r=new PointerEvent("pointerdown",n);let i=!1;return new Proxy(r,{get:(s,u)=>u==="currentTarget"?t:u==="target"?e:u==="preventDefault"?()=>{i=!0,typeof s.preventDefault=="function"&&s.preventDefault()}:u==="defaultPrevented"?i:u in s?s[u]:n[u]})}function Ci(n,t){U(t,!0);let e=w(t,"interactOutsideBehavior",3,"close"),r=w(t,"onInteractOutside",3,S),i=w(t,"onFocusOutside",3,S),o=w(t,"isValidEvent",3,()=>!1);const s=It.create({id:b(()=>t.id),interactOutsideBehavior:b(()=>e()),onInteractOutside:b(()=>r()),enabled:b(()=>t.enabled),onFocusOutside:b(()=>i()),isValidEvent:b(()=>o()),ref:t.ref});var u=N(),a=k(u);j(a,()=>t.children??K,()=>({props:s.props})),F(n,u),V()}globalThis.bitsEscapeLayers??=new Map;class Nt{static create(t){return new Nt(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new Tt(this.opts.ref);let e=S;M(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),e=this.#t()),()=>{e(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>T(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==Hn||!ni(this))return;const e=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(e)}}function ni(n){const t=[...globalThis.bitsEscapeLayers],e=t.findLast(([i,{current:o}])=>o==="close"||o==="ignore");if(e)return e[0]===n;const[r]=t[0];return r===n}function Mi(n,t){U(t,!0);let e=w(t,"escapeKeydownBehavior",3,"close"),r=w(t,"onEscapeKeydown",3,S);Nt.create({escapeKeydownBehavior:b(()=>e()),onEscapeKeydown:b(()=>r()),enabled:b(()=>t.enabled),ref:t.ref});var i=N(),o=k(i);j(o,()=>t.children??K),F(n,i),V()}class Ft{static instance;#t=Jt([]);#e=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new Ft),this.instance}register(t){const e=this.getActive();e&&e!==t&&e.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(t,r),this.#t.current=this.#t.current.filter(i=>i!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(r=>r!==t);const e=this.getActive();e&&e.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,e){this.#e.set(t,e)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,e){this.#n.set(t,e)}getPreFocusMemory(t){return this.#n.get(t)}clearPreFocusMemory(t){this.#n.delete(t)}}class kt{#t=!1;#e=null;#n=Ft.getInstance();#r=[];#i;constructor(t){this.#i=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#s(){for(const t of this.#r)t();this.#r=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#n.register(this),this.#l(),this.#o()}unmount(){this.#e&&(this.#s(),this.#u(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#e=null)}#o(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const e=this.#h();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#e.focus()})}#u(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#l(){if(!this.#e||!this.#i.trap.current)return;const t=this.#e,e=t.ownerDocument,r=s=>{if(this.#t||!this.#n.isActiveScope(this))return;const u=s.target;if(!u)return;if(t.contains(u))this.#n.setFocusMemory(this,u);else{const l=this.#n.getFocusMemory(this);if(l&&t.contains(l)&&Ee(l))s.preventDefault(),l.focus();else{const h=this.#h(),c=this.#c()[0];(h||c||t).focus()}}},i=s=>{if(!this.#i.loop||this.#t||s.key!=="Tab"||!this.#n.isActiveScope(this))return;const u=this.#a();if(u.length===0)return;const a=u[0],l=u[u.length-1];!s.shiftKey&&e.activeElement===l?(s.preventDefault(),a.focus()):s.shiftKey&&e.activeElement===a&&(s.preventDefault(),l.focus())};this.#r.push(T(e,"focusin",r,{capture:!0}),T(t,"keydown",i));const o=new MutationObserver(()=>{const s=this.#n.getFocusMemory(this);if(s&&!t.contains(s)){const u=this.#h(),a=this.#c()[0],l=u||a;l?(l.focus(),this.#n.setFocusMemory(this,l)):t.focus()}});o.observe(t,{childList:!0,subtree:!0}),this.#r.push(()=>o.disconnect())}#a(){return this.#e?Te(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#h(){return this.#a()[0]||null}#c(){return this.#e?Se(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let e=null;return M([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(e||(e=new kt(t)),e.mount(r)):e&&(e.unmount(),e=null)}),_(()=>{e?.unmount()}),{get props(){return{tabindex:-1}}}}}function xi(n,t){U(t,!0);let e=w(t,"enabled",3,!1),r=w(t,"trapFocus",3,!1),i=w(t,"loop",3,!1),o=w(t,"onCloseAutoFocus",3,S),s=w(t,"onOpenAutoFocus",3,S);const u=kt.use({enabled:b(()=>e()),trap:b(()=>r()),loop:i(),onCloseAutoFocus:b(()=>o()),onOpenAutoFocus:b(()=>s()),ref:t.ref});var a=N(),l=k(a);j(l,()=>t.focusScope??K,()=>({props:u.props})),F(n,a),V()}const qt=()=>{};globalThis.bitsTextSelectionLayers??=new Map;class Pt{static create(t){return new Pt(t)}opts;domContext;#t=S;#e=!1;#n=qt;#r=qt;constructor(t){this.opts=t,this.domContext=new Tt(t.ref);let e=S;M(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([r,i,o])=>(this.#e=r,this.#n=i,this.#r=o,r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),e(),e=this.#i()),()=>{this.#e=!1,e(),this.#u(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return W(T(this.domContext.getDocument(),"pointerdown",this.#o),T(this.domContext.getDocument(),"pointerup",Qt(this.#u,this.#s)))}#s=t=>{this.#r(t)};#o=t=>{if(!this.#e)return;const e=this.opts.ref.current,r=t.target;!P(e)||!P(r)||!ii(this)||!jn(e,r)||(this.#n(t),!t.defaultPrevented&&(this.#t=ri(e,this.domContext.getDocument().body)))};#u=()=>{this.#t(),this.#t=S}}const Xt=n=>n.style.userSelect||n.style.webkitUserSelect;function ri(n,t){const e=Xt(t),r=Xt(n);return et(t,"none"),et(n,"text"),()=>{et(t,e),et(n,r)}}function et(n,t){n.style.userSelect=t,n.style.webkitUserSelect=t}function ii(n){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const e=t.at(-1);return e?e[0]===n:!1}function Ai(n,t){U(t,!0);let e=w(t,"preventOverflowTextSelection",3,!0),r=w(t,"onPointerDown",3,S),i=w(t,"onPointerUp",3,S);Pt.create({id:b(()=>t.id),onPointerDown:b(()=>r()),onPointerUp:b(()=>i()),enabled:b(()=>t.enabled&&e()),ref:t.ref});var o=N(),s=k(o);j(s,()=>t.children??K),F(n,o),V()}globalThis.bitsIdCounter??={current:0};function si(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}class oi{#t;#e=0;#n=y();#r;constructor(t){this.#t=t}#i(){this.#e-=1,this.#r&&this.#e<=0&&(this.#r(),d(this.#n,void 0),this.#r=void 0)}get(...t){return this.#e+=1,p(this.#n)===void 0&&(this.#r=Zt(()=>{d(this.#n,this.#t(...t),!0)})),D(()=>()=>{this.#i()}),p(this.#n)}}const rt=new On;let nt=y(null),dt=null,Y=null,q=!1;const Ht=b(()=>{for(const n of rt.values())if(n)return!0;return!1});let pt=null;const ui=new oi(()=>{function n(){document.body.setAttribute("style",p(nt)??""),document.body.style.removeProperty("--scrollbar-width"),Kt&&dt?.(),d(nt,null)}function t(){Y!==null&&(window.clearTimeout(Y),Y=null)}function e(i,o){t(),q=!0,pt=Date.now();const s=pt,u=()=>{Y=null,pt===s&&(ke(rt)?q=!1:(q=!1,o()))},a=i===null?24:i;Y=window.setTimeout(u,a)}function r(){p(nt)===null&&rt.size===0&&!q&&d(nt,document.body.getAttribute("style"),!0)}return M(()=>Ht.current,()=>{if(!Ht.current)return;r(),q=!1;const i=getComputedStyle(document.documentElement),o=getComputedStyle(document.body),s=i.scrollbarGutter?.includes("stable")||o.scrollbarGutter?.includes("stable"),u=window.innerWidth-document.documentElement.clientWidth,l={padding:Number.parseInt(o.paddingRight??"0",10)+u,margin:Number.parseInt(o.marginRight??"0",10)};u>0&&!s&&(document.body.style.paddingRight=`${l.padding}px`,document.body.style.marginRight=`${l.margin}px`,document.body.style.setProperty("--scrollbar-width",`${u}px`)),document.body.style.overflow="hidden",Kt&&(dt=T(document,"touchmove",h=>{h.target===document.documentElement&&(h.touches.length>1||h.preventDefault())},{passive:!1})),x(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),_(()=>()=>{dt?.()}),{get lockMap(){return rt},resetBodyStyle:n,scheduleCleanupIfNoNewLocks:e,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});class ai{#t=si();#e;#n=()=>null;#r;locked;constructor(t,e=()=>null){this.#e=t,this.#n=e,this.#r=ui.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#t,this.#e??!1),this.locked=b(()=>this.#r.lockMap.get(this.#t)??!1,r=>this.#r.lockMap.set(this.#t,r)),_(()=>{if(this.#r.lockMap.delete(this.#t),ke(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function ke(n){for(const[t,e]of n)if(e)return!0;return!1}function Ii(n,t){U(t,!0);let e=w(t,"preventScroll",3,!0),r=w(t,"restoreScrollDelay",3,null);e()&&new ai(e(),()=>r()),V()}export{Ti as $,Jt as A,tn as B,ht as C,Fe as D,ue as E,xi as F,si as G,tt as H,mi as I,Gn as J,Rr as K,Ce as L,Ne as M,Tt as N,Kr as O,yi as P,it as Q,sr as R,Mt as S,Ai as T,Z as U,Qn as V,Jn as W,ae as X,Zn as Y,oe as Z,wi as _,xe as a,Si as a0,Ei as a1,x as a2,di as a3,Kt as a4,b,vi as c,Ae as d,Ie as e,St as f,pi as g,re as h,ie as i,On as j,Xn as k,Mi as l,Fn as m,S as n,Ci as o,Ii as p,_n as q,ur as r,_ as s,se as t,Yn as u,gi as v,M as w,bi as x,xn as y,kn as z};
|
|
5
|
+
`," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const kn=typeof window<"u"?window:void 0;function Pn(n){let t=n.activeElement;for(;t?.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}class On extends Map{#t=new Map;#e=y(0);#n=y(0);#r=Lt||-1;constructor(t){if(super(),t){for(var[e,r]of t)super.set(e,r);this.#n.v=super.size}}#i(t){return Lt===this.#r?y(t):Ue(t)}has(t){var e=this.#t,r=e.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),e.set(t,r);else return p(this.#e),!1;return p(r),!0}forEach(t,e){this.#s(),super.forEach(t,e)}get(t){var e=this.#t,r=e.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),e.set(t,r);else{p(this.#e);return}return p(r),super.get(t)}getOrInsert(t,e){return super.has(t)||this.set(t,e),this.get(t)}getOrInsertComputed(t,e){return super.has(t)||this.set(t,e(t)),this.get(t)}set(t,e){var r=this.#t,i=r.get(t),o=super.get(t),s=super.set(t,e),u=this.#e;if(i===void 0)i=this.#i(0),r.set(t,i),d(this.#n,super.size),G(u);else if(o!==e){G(i);var a=u.reactions===null?null:new Set(u.reactions),l=a===null||!i.reactions?.every(h=>a.has(h));l&&G(u)}return s}delete(t){var e=this.#t,r=e.get(t),i=super.delete(t);return r!==void 0&&(e.delete(t),d(r,-1)),i&&(d(this.#n,super.size),G(this.#e)),i}clear(){if(super.size!==0){super.clear();var t=this.#t;d(this.#n,0);for(var e of t.values())d(e,-1);G(this.#e),t.clear()}}#s(){p(this.#e);var t=this.#t;if(this.#n.v!==t.size){for(var e of super.keys())if(!t.has(e)){var r=this.#i(0);t.set(e,r)}}for([,r]of this.#t)p(r)}keys(){return p(this.#e),super.keys()}values(){return this.#s(),super.values()}entries(){return this.#s(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return p(this.#n),super.size}}class Ln{#t;#e;constructor(t={}){const{window:e=kn,document:r=e?.document}=t;e!==void 0&&(this.#t=r,this.#e=Oe(i=>{const o=T(e,"focusin",i),s=T(e,"focusout",i);return()=>{o(),s()}}))}get current(){return this.#e?.(),this.#t?Pn(this.#t):null}}new Ln;class ht{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Ve(this.#e)}get(){const t=Dt(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const e=Dt(this.#e);return e===void 0?t:e}set(t){return je(this.#e,t)}}function Dn(n,t){switch(n){case"post":D(t);break;case"pre":Ge(t);break}}function te(n,t,e,r={}){const{lazy:i=!1}=r;let o=!i,s=Array.isArray(n)?[]:void 0;Dn(t,()=>{const u=Array.isArray(n)?n.map(l=>l()):n();if(!o){o=!0,s=u;return}const a=gt(()=>e(u,s));return s=u,a})}function M(n,t,e){te(n,"post",t,e)}function Bn(n,t,e){te(n,"pre",t,e)}M.pre=Bn;function _(n){D(()=>()=>{n()})}function _n(n,t){return setTimeout(t,n)}function x(n){ze().then(n)}const Wn=1,Rn=9,Kn=11;function mt(n){return J(n)&&n.nodeType===Wn&&typeof n.nodeName=="string"}function ee(n){return J(n)&&n.nodeType===Rn}function Un(n){return J(n)&&n.constructor?.name==="VisualViewport"}function Vn(n){return J(n)&&n.nodeType!==void 0}function ne(n){return Vn(n)&&n.nodeType===Kn&&"host"in n}function jn(n,t){if(!n||!t||!mt(n)||!mt(t))return!1;const e=t.getRootNode?.();if(n===t||n.contains(t))return!0;if(e&&ne(e)){let r=t;for(;r;){if(n===r)return!0;r=r.parentNode||r.host}}return!1}function $(n){return ee(n)?n:Un(n)?n.document:n?.ownerDocument??document}function Gn(n){return ne(n)?Gn(n.host):ee(n)?n.defaultView??window:mt(n)?n.ownerDocument?.defaultView??window:window}function zn(n){let t=n.activeElement;for(;t?.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}class Tt{element;#t=C(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return p(this.#t)}set root(t){d(this.#t,t)}constructor(t){typeof t=="function"?this.element=b(t):this.element=t}getDocument=()=>$(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>zn(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,e)=>this.getWindow().setTimeout(t,e);clearTimeout=t=>this.getWindow().clearTimeout(t)}function St(n,t){return{[He()]:e=>Q(n)?(n.current=e,gt(()=>t?.(e)),()=>{"isConnected"in e&&e.isConnected||(n.current=null,t?.(null))}):(n(e),gt(()=>t?.(e)),()=>{"isConnected"in e&&e.isConnected||(n(null),t?.(null))})}}function re(n){return n?"true":"false"}function di(n){return n?"true":void 0}function ie(n){return n?"":void 0}function pi(n){return n?!0:void 0}function se(n){return n?"open":"closed"}function gi(n){return n?"checked":"unchecked"}function qn(n){return n==="starting"?{"data-starting-style":""}:n==="ending"?{"data-ending-style":""}:{}}function bi(n,t){return n?"true":"false"}class Xn{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(e=>[e,this.getAttr(e)]))}getAttr(t,e){return e?`data-${e}-${t}`:`${this.#e}${t}`}selector(t,e){return`[${this.getAttr(t,e)}]`}}function Yn(n){const t=new Xn(n);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Z="ArrowDown",Et="ArrowLeft",Ct="ArrowRight",it="ArrowUp",oe="End",ue="Enter",Hn="Escape",ae="Home",Zn="PageDown",Jn="PageUp",Mt=" ",Qn="Tab";function $n(n){return window.getComputedStyle(n).getPropertyValue("direction")}function tr(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Et:Ct,vertical:Z}[t]}function er(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Ct:Et,vertical:it}[t]}function nr(n="ltr",t="horizontal"){return["ltr","rtl"].includes(n)||(n="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:tr(n,t),prevKey:er(n,t)}}const ce=typeof document<"u",Kt=rr();function rr(){return ce&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function P(n){return n instanceof HTMLElement}function Y(n){return n instanceof Element}function le(n){return n instanceof Element||n instanceof SVGElement}function mi(n){return n!==null}function ir(n){return n instanceof HTMLInputElement&&"select"in n}class sr{#t;#e=B(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,e,r=!1){const i=this.#t.rootNode.current;if(!i||!t)return;const o=this.getCandidateNodes();if(!o.length)return;const s=o.indexOf(t),u=$n(i),{nextKey:a,prevKey:l}=nr(u,this.#t.orientation.current),h=this.#t.loop.current,c={[a]:s+1,[l]:s-1,[ae]:0,[oe]:o.length-1};if(r){const g=a===Z?Ct:Z,f=l===it?Et:it;c[g]=s+1,c[f]=s-1}let v=c[e.key];if(v===void 0)return;e.preventDefault(),v<0&&h?v=o.length-1:v===o.length&&h&&(v=0);const m=o[v];if(m)return m.focus(),this.#e.current=m.id,this.#t.onCandidateFocus?.(m),m}getTabIndex(t){const e=this.getCandidateNodes(),r=this.#e.current!==null;return t&&!r&&e[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const e=this.#t.rootNode.current?.querySelector(`#${t}`);!e||!P(e)||e.focus()}}class or{#t;#e=null;#n=null;#r=0;constructor(t){this.#t=t,_(()=>this.#i())}#i(){this.#e!==null&&(window.cancelAnimationFrame(this.#e),this.#e=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(t){this.#i();const e=this.#t.ref.current;if(!e)return;if(typeof e.getAnimations!="function"){this.#s(t);return}const r=this.#r,i=()=>{r===this.#r&&this.#s(t)},o=()=>{if(r!==this.#r)return;const u=e.getAnimations();if(u.length===0){i();return}Promise.all(u.map(a=>a.finished)).then(()=>{i()}).catch(()=>{if(r!==this.#r)return;if(e.getAnimations().some(h=>h.pending||h.playState!=="finished")){o();return}i()})},s=()=>{this.#e=window.requestAnimationFrame(()=>{this.#e=null,o()})};if(!this.#t.afterTick.current){s();return}this.#e=window.requestAnimationFrame(()=>{this.#e=null;const u="data-starting-style";if(!e.hasAttribute(u)){s();return}this.#n=new MutationObserver(()=>{r===this.#r&&(e.hasAttribute(u)||(this.#n?.disconnect(),this.#n=null,s()))}),this.#n.observe(e,{attributes:!0,attributeFilter:[u]})})}#s(t){const e=()=>{t()};this.#t.afterTick?x(e):e()}}class ur{#t;#e;#n;#r=y(!1);#i=y(void 0);#s=!1;#o=null;constructor(t){this.#t=t,d(this.#r,t.open.current,!0),this.#e=t.enabled??!0,this.#n=new or({ref:this.#t.ref,afterTick:this.#t.open}),_(()=>this.#u()),M(()=>this.#t.open.current,e=>{if(!this.#s){this.#s=!0;return}if(this.#u(),!e&&this.#t.shouldSkipExitAnimation?.()){d(this.#r,!1),d(this.#i,void 0),this.#t.onComplete?.();return}if(e&&d(this.#r,!0),d(this.#i,e?"starting":"ending",!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#t.open.current&&d(this.#i,void 0)})),!this.#e){e||d(this.#r,!1),d(this.#i,void 0),this.#t.onComplete?.();return}this.#n.run(()=>{e===this.#t.open.current&&(this.#t.open.current||d(this.#r,!1),d(this.#i,void 0),this.#t.onComplete?.())})})}get shouldRender(){return p(this.#r)}get transitionStatus(){return p(this.#i)}#u(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}}function S(){}function vi(n,t){return`bits-${n}`}function ar(n,t){var e=N(),r=k(e);Je(r,()=>t.children,i=>{var o=N(),s=k(o);j(s,()=>t.children??K),F(i,o)}),F(n,e)}const cr=new ht("BitsConfig");function lr(){const n=new hr(null,{});return cr.getOr(n).opts}class hr{opts;constructor(t,e){const r=fr(t,e);this.opts={defaultPortalTo:r(i=>i.defaultPortalTo),defaultLocale:r(i=>i.defaultLocale)}}}function fr(n,t){return e=>b(()=>{const i=e(t)?.current;if(i!==void 0)return i;if(n!==null)return e(n.opts)?.current})}function dr(n,t){return e=>{const r=lr();return b(()=>{const i=e();if(i!==void 0)return i;const o=n(r).current;return o!==void 0?o:t})}}const pr=dr(n=>n.defaultPortalTo,"body");function yi(n,t){U(t,!0);const e=pr(()=>t.to),r=qe();let i=C(o);function o(){if(!ce||t.disabled)return null;let c=null;return typeof e.current=="string"?c=document.querySelector(e.current):c=e.current,c}let s;function u(){s&&(De(s),s=null)}M([()=>p(i),()=>t.disabled],([c,v])=>{if(!c||v){u();return}return s=Le(ar,{target:c,props:{children:t.children},context:r}),()=>{u()}});var a=N(),l=k(a);{var h=c=>{var v=N(),m=k(v);j(m,()=>t.children??K),F(c,v)};Ye(l,c=>{t.disabled&&c(h)})}F(n,a),V()}class gr{eventName;options;constructor(t,e={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=e}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,e){const r=this.createEvent(e);return t.dispatchEvent(r),r}listen(t,e,r){const i=o=>{e(o)};return T(t,this.eventName,i,r)}}function Ut(n,t=500){let e=null;const r=(...i)=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{n(...i)},t)};return r.destroy=()=>{e!==null&&(clearTimeout(e),e=null)},r}function he(n,t){return n===t||n.contains(t)}function fe(n){return n?.ownerDocument??document}function br(n,t){const{clientX:e,clientY:r}=n,i=t.getBoundingClientRect();return e<i.left||e>i.right||r<i.top||r>i.bottom}const mr=[ue,Mt],vr=[Z,Jn,ae],de=[it,Zn,oe],yr=[...vr,...de];function A(n){return n.pointerType==="mouse"}function wr(n,{select:t=!1}={}){if(!n||!n.focus)return;const e=$(n);if(e.activeElement===n)return;const r=e.activeElement;n.focus({preventScroll:!0}),n!==r&&ir(n)&&t&&n.select()}function Tr(n,{select:t=!1}={},e){const r=e();for(const i of n)if(wr(i,{select:t}),e()!==r)return!0}let z=y(!1);class I{static _refs=0;static _cleanup;constructor(){D(()=>(I._refs===0&&(I._cleanup=Zt(()=>{const t=[],e=i=>{d(z,!1)},r=i=>{d(z,!0)};return t.push(T(document,"pointerdown",e,{capture:!0}),T(document,"pointermove",e,{capture:!0}),T(document,"keydown",r,{capture:!0})),W(...t)})),I._refs++,()=>{I._refs--,I._refs===0&&(d(z,!1),I._cleanup?.())}))}get current(){return p(z)}set current(t){d(z,t,!0)}}var pe=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],st=pe.join(","),ge=typeof Element>"u",L=ge?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ot=!ge&&Element.prototype.getRootNode?function(n){var t;return n==null||(t=n.getRootNode)===null||t===void 0?void 0:t.call(n)}:function(n){return n?.ownerDocument},ut=function(t,e){var r;e===void 0&&(e=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||e&&t&&(typeof t.closest=="function"?t.closest("[inert]"):ut(t.parentNode));return s},Sr=function(t){var e,r=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return r===""||r==="true"},be=function(t,e,r){if(ut(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(st));return e&&L.call(t,st)&&i.unshift(t),i=i.filter(r),i},at=function(t,e,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!ut(s,!1))if(s.tagName==="SLOT"){var u=s.assignedElements(),a=u.length?u:s.children,l=at(a,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:s,candidates:l})}else{var h=L.call(s,st);h&&r.filter(s)&&(e||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),v=!ut(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&v){var m=at(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scopeParent:s,candidates:m})}else o.unshift.apply(o,s.children)}}return i},me=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ve=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Sr(t))&&!me(t)?0:t.tabIndex},Er=function(t,e){var r=ve(t);return r<0&&e&&!me(t)?0:r},Cr=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},ye=function(t){return t.tagName==="INPUT"},Mr=function(t){return ye(t)&&t.type==="hidden"},xr=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return e},Ar=function(t,e){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===e)return t[r]},Ir=function(t){if(!t.name)return!0;var e=t.form||ot(t),r=function(u){return e.querySelectorAll('input[type="radio"][name="'+u+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=Ar(i,t.form);return!o||o===t},Nr=function(t){return ye(t)&&t.type==="radio"},Fr=function(t){return Nr(t)&&!Ir(t)},kr=function(t){var e,r=t&&ot(t),i=(e=r)===null||e===void 0?void 0:e.host,o=!1;if(r&&r!==t){var s,u,a;for(o=!!((s=i)!==null&&s!==void 0&&(u=s.ownerDocument)!==null&&u!==void 0&&u.contains(i)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!o&&i;){var l,h,c;r=ot(i),i=(l=r)===null||l===void 0?void 0:l.host,o=!!((h=i)!==null&&h!==void 0&&(c=h.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},Vt=function(t){var e=t.getBoundingClientRect(),r=e.width,i=e.height;return r===0&&i===0},Pr=function(t,e){var r=e.displayCheck,i=e.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}var s=getComputedStyle(t),u=s.visibility;if(u==="hidden"||u==="collapse")return!0;var a=L.call(t,"details>summary:first-of-type"),l=a?t.parentElement:t;if(L.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var h=t;t;){var c=t.parentElement,v=ot(t);if(c&&!c.shadowRoot&&i(c)===!0)return Vt(t);t.assignedSlot?t=t.assignedSlot:!c&&v!==t.ownerDocument?t=v.host:t=c}t=h}if(kr(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Vt(t);return!1},Or=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var r=0;r<e.children.length;r++){var i=e.children.item(r);if(i.tagName==="LEGEND")return L.call(e,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}e=e.parentElement}return!1},ct=function(t,e){return!(e.disabled||Mr(e)||Pr(e,t)||xr(e)||Or(e))},vt=function(t,e){return!(Fr(e)||ve(e)<0||!ct(t,e))},Lr=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},we=function(t){var e=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,u=s?i.scopeParent:i,a=Er(u,s),l=s?we(i.candidates):u;a===0?s?e.push.apply(e,l):e.push(u):r.push({documentOrder:o,tabIndex:a,item:i,isScope:s,content:l})}),r.sort(Cr).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(e)},Te=function(t,e){e=e||{};var r;return e.getShadowRoot?r=at([t],e.includeContainer,{filter:vt.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:Lr}):r=be(t,e.includeContainer,vt.bind(null,e)),we(r)},Se=function(t,e){e=e||{};var r;return e.getShadowRoot?r=at([t],e.includeContainer,{filter:ct.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):r=be(t,e.includeContainer,ct.bind(null,e)),r},xt=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return L.call(t,st)===!1?!1:vt(e,t)},Dr=pe.concat("iframe:not([inert]):not([inert] *)").join(","),Ee=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return L.call(t,Dr)===!1?!1:ct(e,t)};function H(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Br(n,t){if(!xt(n,H()))return _r(n,t);const e=$(n),r=Te(e.body,H());t==="prev"&&r.reverse();const i=r.indexOf(n);return i===-1?e.body:r.slice(i+1)[0]}function _r(n,t){const e=$(n);if(!Ee(n,H()))return e.body;const r=Se(e.body,H());t==="prev"&&r.reverse();const i=r.indexOf(n);return i===-1?e.body:r.slice(i+1).find(s=>xt(s,H()))??e.body}function wi(n,t,e=!0){if(!(n.length===0||t<0||t>=n.length))return n.length===1&&t===0?n[0]:t===n.length-1?e?n[0]:void 0:n[t+1]}function Ti(n,t,e=!0){if(!(n.length===0||t<0||t>=n.length))return n.length===1&&t===0?n[0]:t===0?e?n[n.length-1]:void 0:n[t-1]}function Si(n,t,e,r=!0){if(n.length===0||t<0||t>=n.length)return;let i=t+e;return r?i=(i%n.length+n.length)%n.length:i=Math.max(0,Math.min(i,n.length-1)),n[i]}function Ei(n,t,e,r=!0){if(n.length===0||t<0||t>=n.length)return;let i=t-e;return r?i=(i%n.length+n.length)%n.length:i=Math.max(0,Math.min(i,n.length-1)),n[i]}function Ce(n,t,e){const r=t.toLowerCase();if(r.endsWith(" ")){const c=r.slice(0,-1);if(n.filter(f=>f.toLowerCase().startsWith(c)).length<=1)return Ce(n,c,e);const m=e?.toLowerCase();if(m&&m.startsWith(c)&&m.charAt(c.length)===" "&&t.trim()===c)return e;const g=n.filter(f=>f.toLowerCase().startsWith(r));if(g.length>0){const f=e?n.indexOf(e):-1;return jt(g,Math.max(f,0)).find(Pe=>Pe!==e)||e}}const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=o.toLowerCase(),u=e?n.indexOf(e):-1;let a=jt(n,Math.max(u,0));o.length===1&&(a=a.filter(c=>c!==e));const h=a.find(c=>c?.toLowerCase().startsWith(s));return h!==e?h:void 0}function jt(n,t){return n.map((e,r)=>n[(t+r)%n.length])}const Wr={afterMs:1e4,onChange:S};function Rr(n,t){const{afterMs:e,onChange:r,getWindow:i}={...Wr,...t};let o=null,s=y(yt(n));function u(){return i().setTimeout(()=>{d(s,n,!0),r?.(n)},e)}return D(()=>()=>{o&&i().clearTimeout(o)}),b(()=>p(s),a=>{d(s,a,!0),r?.(a),o&&i().clearTimeout(o),o=u()})}class Kr{#t;#e;#n=C(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#r=C(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=Rr("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,e){if(!e.length)return;this.#e.current=this.#e.current+t;const r=p(this.#r)(),i=e.find(a=>a===r)?.textContent?.trim()??"",o=e.map(a=>a.textContent?.trim()??""),s=Ce(o,this.#e.current,i),u=e.find(a=>a.textContent?.trim()===s);return u&&p(this.#n)(u),u}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}const Ur="data-context-menu-trigger",Vr="data-context-menu-content",jr=new ht("Menu.Root"),At=new ht("Menu.Root | Menu.Sub"),Me=new ht("Menu.Content"),Gr=new gr("bitsmenuopen",{bubbles:!1,cancelable:!0}),zr=Yn({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class qr{#t;#e=null;#n=null;#r=!1;#i=null;#s=null;#o=null;#u=null;constructor(t){this.#t=t,M([t.triggerNode,t.contentNode,t.enabled],([e,r,i])=>{if(this.#b(),!e||!r||!i)return;const o=c=>{A(c)&&(this.#u={x:c.clientX,y:c.clientY},this.#r||this.#c(c,"content"))},s=c=>{A(c)&&this.#v(c,"content")},u=c=>{A(c)&&(this.#r||this.#c(c,"trigger"))},a=c=>{if(A(c)){if(Y(c.relatedTarget)){const v=this.#t.subContentSelector(),m=c.relatedTarget.closest(v);if(m&&m!==r&&m.id&&!!r.querySelector(`[aria-controls="${m.id}"]`))return}this.#v(c,"trigger")}},l=c=>{A(c)&&this.#p()},h=c=>{A(c)&&this.#p()};return e.addEventListener("pointermove",o),e.addEventListener("pointerleave",s),e.addEventListener("pointerenter",l),r.addEventListener("pointermove",u),r.addEventListener("pointerleave",a),r.addEventListener("pointerenter",h),()=>{e.removeEventListener("pointermove",o),e.removeEventListener("pointerleave",s),e.removeEventListener("pointerenter",l),r.removeEventListener("pointermove",u),r.removeEventListener("pointerleave",a),r.removeEventListener("pointerenter",h),this.#b()}}),_(()=>{this.#b()})}#l(){const t=this.#t.parentContentNode();return t?t.getBoundingClientRect():this.#t.triggerNode()?.getBoundingClientRect()??null}#a(t,e){const r=this.#t.triggerNode(),i=this.#t.contentNode();if(!r||!i)return null;const o=r.getBoundingClientRect(),s=i.getBoundingClientRect(),u=Yr(o,s);let a,l,h;return e==="content"?(a=this.#r?this.#s??t:t,l=s):(a=this.#u??t,l=this.#l()??o,h=s),this.#s=a,{corridor:Hr(o,s,u),intent:Zr(a,l,u,e,h),targetRect:l,side:u}}#h(t,e,r){return Gt(t,e)||Gt(t,r)}#c(t,e){const r={x:t.clientX,y:t.clientY};this.#a(r,e)&&(this.#i=e,this.#o=r)}#v(t,e){if(!this.#t.enabled())return;const r=this.#t.triggerNode(),i=this.#t.contentNode();if(!r||!i)return;const o=t.relatedTarget;if(Y(o)&&(e==="content"&&i.contains(o)||e==="trigger"&&r.contains(o)))return;const s={x:t.clientX,y:t.clientY},u=this.#a(s,e);if(u){if(!zt(s,u.targetRect)&&!this.#h(s,u.corridor,u.intent)){this.#E();return}this.#r=!0,this.#i=e,this.#o=s,this.#t.setIsPointerInTransit(!0),this.#C(),this.#S()}}#f=null;#p(){if(!this.#r)return;const t=this.#i==="trigger";this.#T(),this.#m(),this.#r=!1,this.#E(),t?(this.#g(),this.#f=setTimeout(()=>{this.#f=null,this.#t.setIsPointerInTransit(!1)},100)):this.#t.setIsPointerInTransit(!1)}#g(){this.#f!==null&&(clearTimeout(this.#f),this.#f=null)}#d(){const t=this.#o;this.#T(),this.#m(),this.#g(),this.#r=!1,this.#t.setIsPointerInTransit(!1),this.#E(),this.#t.onIntentExit(t)}#b(){this.#T(),this.#m(),this.#g(),this.#r&&this.#t.setIsPointerInTransit(!1),this.#r=!1,this.#i=null,this.#s=null,this.#o=null,this.#u=null}#w(t){const e=this.#t.contentNode();if(!e)return!1;const i=e.ownerDocument.elementFromPoint(t.x,t.y);if(!i)return!1;const o=this.#t.subContentSelector(),s=i.closest(o);return!s||s===e?!1:s.id?!!e.querySelector(`[aria-controls="${s.id}"]`):!1}#y=t=>{if(!this.#r||!this.#i||!A(t))return;const e=this.#t.triggerNode(),r=this.#t.contentNode();if(!e||!r){this.#d();return}this.#m();const i={x:t.clientX,y:t.clientY};this.#o=i;const o=e.getBoundingClientRect(),s=r.getBoundingClientRect();if(this.#i==="content"&&zt(i,s)){this.#p();return}if(this.#i==="trigger"&&Xr(i,o,4)){this.#p();return}if(this.#w(i)){this.#S();return}const u=this.#a(i,this.#i);if(!u){this.#d();return}if(this.#h(i,u.corridor,u.intent)){this.#S();return}this.#d()};#C(){if(this.#e)return;const t=$(this.#t.triggerNode()??this.#t.contentNode());t&&(t.addEventListener("pointermove",this.#y,!0),this.#e=()=>{t.removeEventListener("pointermove",this.#y,!0),this.#e=null})}#T(){this.#e?.()}#S(){this.#m(),this.#n=setTimeout(()=>{this.#n=null,this.#r&&this.#d()},500)}#m(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#E(){this.#i=null,this.#s=null,this.#o=null}}function Gt(n,t){const{x:e,y:r}=n;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const u=t[o].x,a=t[o].y,l=t[s].x,h=t[s].y;a>r!=h>r&&e<(l-u)*(r-a)/(h-a)+u&&(i=!i)}return i}function zt(n,t){return n.x>=t.left&&n.x<=t.right&&n.y>=t.top&&n.y<=t.bottom}function Xr(n,t,e){return n.x>=t.left+e&&n.x<=t.right-e&&n.y>=t.top+e&&n.y<=t.bottom-e}function Yr(n,t){const e=n.left+n.width/2,r=n.top+n.height/2,i=t.left+t.width/2,o=t.top+t.height/2,s=i-e,u=o-r;return Math.abs(s)>Math.abs(u)?s>0?"right":"left":u>0?"bottom":"top"}function Hr(n,t,e){switch(e){case"top":return[{x:Math.min(n.left,t.left)-2,y:n.top},{x:Math.min(n.left,t.left)-2,y:t.bottom},{x:Math.max(n.right,t.right)+2,y:t.bottom},{x:Math.max(n.right,t.right)+2,y:n.top}];case"bottom":return[{x:Math.min(n.left,t.left)-2,y:n.bottom},{x:Math.min(n.left,t.left)-2,y:t.top},{x:Math.max(n.right,t.right)+2,y:t.top},{x:Math.max(n.right,t.right)+2,y:n.bottom}];case"left":return[{x:n.left,y:Math.min(n.top,t.top)-2},{x:t.right,y:Math.min(n.top,t.top)-2},{x:t.right,y:Math.max(n.bottom,t.bottom)+2},{x:n.left,y:Math.max(n.bottom,t.bottom)+2}];case"right":return[{x:n.right,y:Math.min(n.top,t.top)-2},{x:t.left,y:Math.min(n.top,t.top)-2},{x:t.left,y:Math.max(n.bottom,t.bottom)+2},{x:n.right,y:Math.max(n.bottom,t.bottom)+2}]}}function Zr(n,t,e,r,i){const s=r==="trigger"?Jr(e):e,u=i?Math.min(t.top,i.top)-8:t.top-8,a=i?Math.max(t.bottom,i.bottom)+8:t.bottom+8,l=i?Math.min(t.left,i.left)-8:t.left-8,h=i?Math.max(t.right,i.right)+8:t.right+8;switch(s){case"right":return[n,{x:t.left,y:u},{x:t.left,y:a}];case"left":return[n,{x:t.right,y:u},{x:t.right,y:a}];case"bottom":return[n,{x:l,y:t.top},{x:h,y:t.top}];case"top":return[n,{x:l,y:t.bottom},{x:h,y:t.bottom}]}}function Jr(n){switch(n){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}class xe{static create(t){const e=new xe(t);return jr.set(e)}opts;isUsingKeyboard=new I;#t=y(!1);get ignoreCloseAutoFocus(){return p(this.#t)}set ignoreCloseAutoFocus(t){d(this.#t,t,!0)}#e=y(!1);get isPointerInTransit(){return p(this.#e)}set isPointerInTransit(t){d(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>zr.getAttr(t,this.opts.variant.current)}class Ae{static create(t,e){return At.set(new Ae(t,e,null))}opts;root;parentMenu;contentId=b(()=>"");#t=y(null);get contentNode(){return p(this.#t)}set contentNode(t){d(this.#t,t,!0)}contentPresence;#e=y(null);get triggerNode(){return p(this.#e)}set triggerNode(t){d(this.#e,t,!0)}constructor(t,e,r){this.opts=t,this.root=e,this.parentMenu=r,this.contentPresence=new ur({ref:b(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)},shouldSkipExitAnimation:()=>this.root.opts.variant.current!=="menubar"||this.parentMenu!==null?!1:this.root.opts.shouldSkipExitAnimation?.()??!1}),r&&M(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class Ie{static create(t){return Me.set(new Ie(t,At.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=y("");get search(){return p(this.#t)}set search(t){d(this.#t,t,!0)}#e=0;#n;#r=y(!1);get mounted(){return p(this.#r)}set mounted(t){d(this.#r,t,!0)}#i;constructor(t,e){this.opts=t,this.parentMenu=e,this.domContext=new Tt(t.ref),this.attachment=St(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),e.contentId=t.id,this.#i=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new qr({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,parentContentNode:()=>this.parentMenu.parentMenu?.contentNode??null,subContentSelector:()=>`[${this.parentMenu.root.getBitsAttr("sub-content")}]`,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onIntentExit:r=>{this.parentMenu.opts.open.current=!1,this.#u(r)},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),this.#n=new Kr({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new sr({rootNode:b(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:b(()=>"vertical")}),M(()=>this.parentMenu.contentNode,r=>{if(!r)return;const i=()=>{x(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return Gr.listen(r,i)}),D(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#s(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#o(){return this.parentMenu.root.isPointerInTransit}#u(t){if(!t)return;const e=this.parentMenu.parentMenu?.contentNode;if(!e)return;const r=this.domContext.getDocument().elementFromPoint(t.x,t.y);if(!Y(r))return;const i=r.closest(`[${this.parentMenu.root.getBitsAttr("sub-trigger")}]`);!i||!e.contains(i)||i!==this.parentMenu.triggerNode&&i.dispatchEvent(new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,pointerType:"mouse",clientX:t.x,clientY:t.y}))}onCloseAutoFocus=t=>{if(this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#i)){if(this.parentMenu.root.ignoreCloseAutoFocus){t.preventDefault();return}this.parentMenu.triggerNode&&xt(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())}};handleTabKeyDown(t){let e=this.parentMenu;for(;e.parentMenu!==null;)e=e.parentMenu;if(!e.triggerNode)return;t.preventDefault();const r=Br(e.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,e.onClose(),x(()=>{r.focus(),x(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===Qn){this.handleTabKeyDown(t);return}const e=t.target,r=t.currentTarget;if(!P(e)||!P(r))return;const i=e.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,o=t.ctrlKey||t.altKey||t.metaKey,s=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(e,t)||t.code==="Space")return;const a=this.#s();i&&!o&&s&&this.#n(t.key,a),t.target?.id===this.parentMenu.contentId.current&&yr.includes(t.key)&&(t.preventDefault(),de.includes(t.key)&&a.reverse(),Tr(a,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){Y(t.currentTarget)&&Y(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&x(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#o()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#o()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus({preventScroll:!0}),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#o()}handleInteractOutside(t){if(!le(t.target))return;const e=this.parentMenu.triggerNode?.id;if(t.target.id===e){t.preventDefault();return}if(t.target.closest(`#${e}`)){t.preventDefault();return}this.parentMenu.root.ignoreCloseAutoFocus=!0,x(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#l=C(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return p(this.#l)}set snippetProps(t){d(this.#l,t)}#a=C(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":se(this.parentMenu.opts.open.current),...qn(this.parentMenu.contentPresence.transitionStatus),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return p(this.#a)}set props(t){d(this.#a,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Qr{opts;content;attachment;#t=y(!1);constructor(t,e){this.opts=t,this.content=e,this.attachment=St(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&A(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!P(r))return;r.focus({preventScroll:!0})}}onpointerleave(t){t.defaultPrevented||A(t)&&this.content.onItemLeave(t)}onfocus(t){x(()=>{t.defaultPrevented||this.opts.disabled.current||d(this.#t,!0)})}onblur(t){x(()=>{t.defaultPrevented||d(this.#t,!1)})}#e=C(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":re(this.opts.disabled.current),"data-disabled":ie(this.opts.disabled.current),"data-highlighted":p(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return p(this.#e)}set props(t){d(this.#e,t)}}class Ne{static create(t){const e=new Qr(t,Me.get());return new Ne(t,e)}opts;item;root;#t=!1;constructor(t,e){this.opts=t,this.item=e,this.root=e.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const e=this.item.content.search!=="";if(!(this.item.opts.disabled.current||e&&t.key===Mt)&&mr.includes(t.key)){if(!P(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!P(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#n=C(()=>Fn(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return p(this.#n)}set props(t){d(this.#n,t)}}class Fe{static create(t){return new Fe(t,At.get())}opts;parentMenu;attachment;constructor(t,e){this.opts=t,this.parentMenu=e,this.attachment=St(this.opts.ref,r=>this.parentMenu.triggerNode=r)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===Mt||t.key===ue){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Z&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=C(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=C(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":re(this.parentMenu.opts.open.current),"aria-controls":p(this.#t),"data-disabled":ie(this.opts.disabled.current),"data-state":se(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return p(this.#e)}set props(t){d(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class It{static create(t){return new It(t)}opts;#t;#e;#n={pointerdown:!1};#r=!1;#i=!1;#s=void 0;#o;#u=S;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#o=t.onFocusOutside,D(()=>{this.#s=fe(this.opts.ref.current)});let e=S,r=null,i=!1;const o=()=>{r!=null&&(clearTimeout(r),r=null)},s=()=>{o(),this.#d(),globalThis.bitsDismissableLayers.delete(this),this.#c.destroy(),e()};M([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return o(),r=_n(1,()=>{r=null,!(i||!this.opts.ref.current)&&(globalThis.bitsDismissableLayers.set(this,this.#e),e(),e=this.#a())}),s}),_(()=>{i=!0,o(),this.#d.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#c.destroy(),this.#u(),e()})}#l=t=>{t.defaultPrevented||this.opts.ref.current&&x(()=>{!this.opts.ref.current||this.#g(t.target)||t.target&&!this.#i&&this.#o.current?.(t)})};#a(){return W(T(this.#s,"pointerdown",W(this.#v,this.#p),{capture:!0}),T(this.#s,"pointerdown",W(this.#f,this.#c)),T(this.#s,"focusin",this.#l))}#h=t=>{let e=t;e.defaultPrevented&&(e=qt(t)),this.#t.current(t)};#c=Ut(t=>{if(!this.opts.ref.current){this.#u();return}const e=this.opts.isValidEvent.current(t,this.opts.ref.current)||ei(t,this.opts.ref.current);if(!this.#r||this.#b()||!e){this.#u();return}let r=t;if(r.defaultPrevented&&(r=qt(r)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#u();return}t.pointerType==="touch"?(this.#u(),this.#u=T(this.#s,"click",this.#h,{once:!0})):this.#t.current(r)},10);#v=t=>{this.#n[t.type]=!0};#f=t=>{this.#n[t.type]=!1};#p=()=>{this.opts.ref.current&&(this.#r=ti(this.opts.ref.current))};#g=t=>this.opts.ref.current?he(this.opts.ref.current,t):!1;#d=Ut(()=>{for(const t in this.#n)this.#n[t]=!1;this.#r=!1},20);#b(){return Object.values(this.#n).some(Boolean)}#w=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#w,onblurcapture:this.#y}}function $r(n=[...globalThis.bitsDismissableLayers]){return n.findLast(([t,{current:e}])=>e==="close"||e==="ignore")}function ti(n){const t=[...globalThis.bitsDismissableLayers],e=$r(t);if(e)return e[0].opts.ref.current===n;const[r]=t[0];return r.opts.ref.current===n}function ei(n,t){const e=n.target;if(!le(e))return!1;const r=!!e.closest(`[${Ur}]`),i=!!t.closest(`[${Vr}]`);return"button"in n&&n.button>0&&!r?!1:"button"in n&&n.button===0&&r&&i?!0:r&&i?!1:fe(e).documentElement.contains(e)&&!he(t,e)&&br(n,t)}function qt(n){const t=n.currentTarget,e=n.target;let r;n instanceof PointerEvent?r=new PointerEvent(n.type,n):r=new PointerEvent("pointerdown",n);let i=!1;return new Proxy(r,{get:(s,u)=>u==="currentTarget"?t:u==="target"?e:u==="preventDefault"?()=>{i=!0,typeof s.preventDefault=="function"&&s.preventDefault()}:u==="defaultPrevented"?i:u in s?s[u]:n[u]})}function Ci(n,t){U(t,!0);let e=w(t,"interactOutsideBehavior",3,"close"),r=w(t,"onInteractOutside",3,S),i=w(t,"onFocusOutside",3,S),o=w(t,"isValidEvent",3,()=>!1);const s=It.create({id:b(()=>t.id),interactOutsideBehavior:b(()=>e()),onInteractOutside:b(()=>r()),enabled:b(()=>t.enabled),onFocusOutside:b(()=>i()),isValidEvent:b(()=>o()),ref:t.ref});var u=N(),a=k(u);j(a,()=>t.children??K,()=>({props:s.props})),F(n,u),V()}globalThis.bitsEscapeLayers??=new Map;class Nt{static create(t){return new Nt(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new Tt(this.opts.ref);let e=S;M(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),e=this.#t()),()=>{e(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>T(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==Hn||!ni(this))return;const e=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(e)}}function ni(n){const t=[...globalThis.bitsEscapeLayers],e=t.findLast(([i,{current:o}])=>o==="close"||o==="ignore");if(e)return e[0]===n;const[r]=t[0];return r===n}function Mi(n,t){U(t,!0);let e=w(t,"escapeKeydownBehavior",3,"close"),r=w(t,"onEscapeKeydown",3,S);Nt.create({escapeKeydownBehavior:b(()=>e()),onEscapeKeydown:b(()=>r()),enabled:b(()=>t.enabled),ref:t.ref});var i=N(),o=k(i);j(o,()=>t.children??K),F(n,i),V()}class Ft{static instance;#t=Jt([]);#e=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new Ft),this.instance}register(t){const e=this.getActive();e&&e!==t&&e.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(t,r),this.#t.current=this.#t.current.filter(i=>i!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(r=>r!==t);const e=this.getActive();e&&e.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,e){this.#e.set(t,e)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,e){this.#n.set(t,e)}getPreFocusMemory(t){return this.#n.get(t)}clearPreFocusMemory(t){this.#n.delete(t)}}class kt{#t=!1;#e=null;#n=Ft.getInstance();#r=[];#i;constructor(t){this.#i=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#s(){for(const t of this.#r)t();this.#r=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#n.register(this),this.#l(),this.#o()}unmount(){this.#e&&(this.#s(),this.#u(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#e=null)}#o(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const e=this.#h();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#e.focus()})}#u(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#l(){if(!this.#e||!this.#i.trap.current)return;const t=this.#e,e=t.ownerDocument,r=s=>{if(this.#t||!this.#n.isActiveScope(this))return;const u=s.target;if(!u)return;if(t.contains(u))this.#n.setFocusMemory(this,u);else{const l=this.#n.getFocusMemory(this);if(l&&t.contains(l)&&Ee(l))s.preventDefault(),l.focus();else{const h=this.#h(),c=this.#c()[0];(h||c||t).focus()}}},i=s=>{if(!this.#i.loop||this.#t||s.key!=="Tab"||!this.#n.isActiveScope(this))return;const u=this.#a();if(u.length===0)return;const a=u[0],l=u[u.length-1];!s.shiftKey&&e.activeElement===l?(s.preventDefault(),a.focus()):s.shiftKey&&e.activeElement===a&&(s.preventDefault(),l.focus())};this.#r.push(T(e,"focusin",r,{capture:!0}),T(t,"keydown",i));const o=new MutationObserver(()=>{const s=this.#n.getFocusMemory(this);if(s&&!t.contains(s)){const u=this.#h(),a=this.#c()[0],l=u||a;l?(l.focus(),this.#n.setFocusMemory(this,l)):t.focus()}});o.observe(t,{childList:!0,subtree:!0}),this.#r.push(()=>o.disconnect())}#a(){return this.#e?Te(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#h(){return this.#a()[0]||null}#c(){return this.#e?Se(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let e=null;return M([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(e||(e=new kt(t)),e.mount(r)):e&&(e.unmount(),e=null)}),_(()=>{e?.unmount()}),{get props(){return{tabindex:-1}}}}}function xi(n,t){U(t,!0);let e=w(t,"enabled",3,!1),r=w(t,"trapFocus",3,!1),i=w(t,"loop",3,!1),o=w(t,"onCloseAutoFocus",3,S),s=w(t,"onOpenAutoFocus",3,S);const u=kt.use({enabled:b(()=>e()),trap:b(()=>r()),loop:i(),onCloseAutoFocus:b(()=>o()),onOpenAutoFocus:b(()=>s()),ref:t.ref});var a=N(),l=k(a);j(l,()=>t.focusScope??K,()=>({props:u.props})),F(n,a),V()}const Xt=()=>{};globalThis.bitsTextSelectionLayers??=new Map;class Pt{static create(t){return new Pt(t)}opts;domContext;#t=S;#e=!1;#n=Xt;#r=Xt;constructor(t){this.opts=t,this.domContext=new Tt(t.ref);let e=S;M(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([r,i,o])=>(this.#e=r,this.#n=i,this.#r=o,r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),e(),e=this.#i()),()=>{this.#e=!1,e(),this.#u(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return W(T(this.domContext.getDocument(),"pointerdown",this.#o),T(this.domContext.getDocument(),"pointerup",Qt(this.#u,this.#s)))}#s=t=>{this.#r(t)};#o=t=>{if(!this.#e)return;const e=this.opts.ref.current,r=t.target;!P(e)||!P(r)||!ii(this)||!jn(e,r)||(this.#n(t),!t.defaultPrevented&&(this.#t=ri(e,this.domContext.getDocument().body)))};#u=()=>{this.#t(),this.#t=S}}const Yt=n=>n.style.userSelect||n.style.webkitUserSelect;function ri(n,t){const e=Yt(t),r=Yt(n);return et(t,"none"),et(n,"text"),()=>{et(t,e),et(n,r)}}function et(n,t){n.style.userSelect=t,n.style.webkitUserSelect=t}function ii(n){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const e=t.at(-1);return e?e[0]===n:!1}function Ai(n,t){U(t,!0);let e=w(t,"preventOverflowTextSelection",3,!0),r=w(t,"onPointerDown",3,S),i=w(t,"onPointerUp",3,S);Pt.create({id:b(()=>t.id),onPointerDown:b(()=>r()),onPointerUp:b(()=>i()),enabled:b(()=>t.enabled&&e()),ref:t.ref});var o=N(),s=k(o);j(s,()=>t.children??K),F(n,o),V()}globalThis.bitsIdCounter??={current:0};function si(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}class oi{#t;#e=0;#n=y();#r;constructor(t){this.#t=t}#i(){this.#e-=1,this.#r&&this.#e<=0&&(this.#r(),d(this.#n,void 0),this.#r=void 0)}get(...t){return this.#e+=1,p(this.#n)===void 0&&(this.#r=Zt(()=>{d(this.#n,this.#t(...t),!0)})),D(()=>()=>{this.#i()}),p(this.#n)}}const rt=new On;let nt=y(null),dt=null,q=null,X=!1;const Ht=b(()=>{for(const n of rt.values())if(n)return!0;return!1});let pt=null;const ui=new oi(()=>{function n(){document.body.setAttribute("style",p(nt)??""),document.body.style.removeProperty("--scrollbar-width"),Kt&&dt?.(),d(nt,null)}function t(){q!==null&&(window.clearTimeout(q),q=null)}function e(i,o){t(),X=!0,pt=Date.now();const s=pt,u=()=>{q=null,pt===s&&(ke(rt)?X=!1:(X=!1,o()))},a=i===null?24:i;q=window.setTimeout(u,a)}function r(){p(nt)===null&&rt.size===0&&!X&&d(nt,document.body.getAttribute("style"),!0)}return M(()=>Ht.current,()=>{if(!Ht.current)return;r(),X=!1;const i=getComputedStyle(document.documentElement),o=getComputedStyle(document.body),s=i.scrollbarGutter?.includes("stable")||o.scrollbarGutter?.includes("stable"),u=window.innerWidth-document.documentElement.clientWidth,l={padding:Number.parseInt(o.paddingRight??"0",10)+u,margin:Number.parseInt(o.marginRight??"0",10)};u>0&&!s&&(document.body.style.paddingRight=`${l.padding}px`,document.body.style.marginRight=`${l.margin}px`,document.body.style.setProperty("--scrollbar-width",`${u}px`)),document.body.style.overflow="hidden",Kt&&(dt=T(document,"touchmove",h=>{h.target===document.documentElement&&(h.touches.length>1||h.preventDefault())},{passive:!1})),x(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),_(()=>()=>{dt?.()}),{get lockMap(){return rt},resetBodyStyle:n,scheduleCleanupIfNoNewLocks:e,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});class ai{#t=si();#e;#n=()=>null;#r;locked;constructor(t,e=()=>null){this.#e=t,this.#n=e,this.#r=ui.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#t,this.#e??!1),this.locked=b(()=>this.#r.lockMap.get(this.#t)??!1,r=>this.#r.lockMap.set(this.#t,r)),_(()=>{if(this.#r.lockMap.delete(this.#t),ke(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function ke(n){for(const[t,e]of n)if(e)return!0;return!1}function Ii(n,t){U(t,!0);let e=w(t,"preventScroll",3,!0),r=w(t,"restoreScrollDelay",3,null);e()&&new ai(e(),()=>r()),V()}export{Ti as $,Jt as A,tn as B,ht as C,Fe as D,ue as E,xi as F,si as G,tt as H,mi as I,Gn as J,Rr as K,Ce as L,Ne as M,Tt as N,Kr as O,yi as P,it as Q,sr as R,Mt as S,Ai as T,Z as U,Qn as V,Jn as W,ae as X,Zn as Y,oe as Z,wi as _,xe as a,Si as a0,Ei as a1,x as a2,di as a3,Kt as a4,b,vi as c,Ae as d,Ie as e,St as f,pi as g,re as h,ie as i,On as j,Yn as k,Mi as l,Fn as m,S as n,Ci as o,Ii as p,_n as q,ur as r,_ as s,se as t,qn as u,gi as v,M as w,bi as x,xn as y,kn as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,f as p,c as x}from"./CpCbeTkV.js";import{p as y,h as _,j as w,r as z,c as I,F as S}from"./rz89OrhQ.js";import{n as k,c as A,a as N}from"./AUu53b1K.js";import{p as i,i as T,r as j}from"./BwDU-fss.js";var B=new Set(["$$slots","$$events","$$legacy","variant","size","class","children"]),R=p("<button><!></button>");function V(e,s){y(s,!0);const o={default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90"},r={default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-8"};let a=i(s,"variant",3,"default"),l=i(s,"size",3,"default"),m=i(s,"class",3,""),v=j(s,B);var n=R();k(n,t=>({class:t,...v}),[()=>A("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4",o[a()],r[l()],m())]);var g=w(n);{var h=t=>{var u=x(),b=I(u);N(b,()=>s.children),f(t,u)};T(g,t=>{s.children&&t(h)})}z(n),f(e,n),_()}const D=3600;let E=1;const c=S([]);function d(e,s){const o=E++;c.push({id:o,kind:e,message:s}),setTimeout(()=>{const r=c.findIndex(a=>a.id===o);r>=0&&c.splice(r,1)},D)}const Z={success(e){d("success",e)},error(e){d("error",e)},info(e){d("info",e)}};export{V as B,Z as a,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as C,a as m,p as N,f as E}from"./CpCbeTkV.js";import{k as s,g as r,a as v,p as x,c as P,h as R,e as Z,j as U,I as B,r as M}from"./rz89OrhQ.js";import{i as A,s as $,p as t,r as W}from"./BwDU-fss.js";import{u as ee,a as q,n as F,c as te}from"./AUu53b1K.js";import{C as re,f as G,E as se,S as oe,i as I,v as ae,h as ie,x as ne,g as ce,k as de,c as J,n as he,b as h,m as K}from"./Dnszd-a_.js";import{H as le}from"./Dk8UGBZ2.js";const L=de({component:"switch",parts:["root","thumb"]}),O=new re("Switch.Root");class j{static create(e){return O.set(new j(e))}opts;attachment;constructor(e){this.opts=e,this.attachment=G(e.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this)}#e(){this.opts.checked.current=!this.opts.checked.current}onkeydown(e){!(e.key===se||e.key===oe)||this.opts.disabled.current||(e.preventDefault(),this.#e())}onclick(e){this.opts.disabled.current||this.#e()}#t=s(()=>({"data-disabled":I(this.opts.disabled.current),"data-state":ae(this.opts.checked.current),"data-required":I(this.opts.required.current)}));get sharedProps(){return r(this.#t)}set sharedProps(e){v(this.#t,e)}#r=s(()=>({checked:this.opts.checked.current}));get snippetProps(){return r(this.#r)}set snippetProps(e){v(this.#r,e)}#s=s(()=>({...this.sharedProps,id:this.opts.id.current,role:"switch",disabled:ce(this.opts.disabled.current),"aria-checked":ne(this.opts.checked.current),"aria-required":ie(this.opts.required.current),[L.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return r(this.#s)}set props(e){v(this.#s,e)}}class z{static create(){return new z(O.get())}root;#e=s(()=>this.root.opts.name.current!==void 0);get shouldRender(){return r(this.#e)}set shouldRender(e){v(this.#e,e)}constructor(e){this.root=e}#t=s(()=>({type:"checkbox",name:this.root.opts.name.current,value:this.root.opts.value.current,checked:this.root.opts.checked.current,disabled:this.root.opts.disabled.current,required:this.root.opts.required.current}));get props(){return r(this.#t)}set props(e){v(this.#t,e)}}class D{static create(e){return new D(e,O.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=G(e.ref)}#e=s(()=>({checked:this.root.opts.checked.current}));get snippetProps(){return r(this.#e)}set snippetProps(e){v(this.#e,e)}#t=s(()=>({...this.root.sharedProps,id:this.opts.id.current,[L.thumb]:"",...this.attachment}));get props(){return r(this.#t)}set props(e){v(this.#t,e)}}function ue(p,e){x(e,!1);const n=z.create();ee();var c=C(),l=P(c);{var f=o=>{le(o,$(()=>n.props))};A(l,o=>{n.shouldRender&&o(f)})}m(p,c),R()}var pe=new Set(["$$slots","$$events","$$legacy","child","children","ref","id","disabled","required","checked","value","name","type","onCheckedChange"]),fe=E("<button><!></button>"),be=E("<!> <!>",1);function ge(p,e){const n=N();x(e,!0);let c=t(e,"ref",15,null),l=t(e,"id",19,()=>J(n)),f=t(e,"disabled",3,!1),o=t(e,"required",3,!1),b=t(e,"checked",15,!1),w=t(e,"value",3,"on"),u=t(e,"name",3,void 0),g=t(e,"type",3,"button"),y=t(e,"onCheckedChange",3,he),d=W(e,pe);const a=j.create({checked:h(()=>b(),i=>{b(i),y()?.(i)}),disabled:h(()=>f()??!1),required:h(()=>o()),value:h(()=>w()),name:h(()=>u()),id:h(()=>l()),ref:h(()=>c(),i=>c(i))}),_=s(()=>K(d,a.props,{type:g()}));var S=be(),H=P(S);{var Q=i=>{var k=C(),T=P(k);{let Y=s(()=>({props:r(_),...a.snippetProps}));q(T,()=>e.child,()=>r(Y))}m(i,k)},V=i=>{var k=fe();F(k,()=>({...r(_)}));var T=U(k);q(T,()=>e.children??B,()=>a.snippetProps),M(k),m(i,k)};A(H,i=>{e.child?i(Q):i(V,-1)})}var X=Z(H,2);ue(X,{}),m(p,S),R()}var ke=new Set(["$$slots","$$events","$$legacy","child","children","ref","id"]),me=E("<span><!></span>");function ve(p,e){const n=N();x(e,!0);let c=t(e,"ref",15,null),l=t(e,"id",19,()=>J(n)),f=W(e,ke);const o=D.create({id:h(()=>l()),ref:h(()=>c(),d=>c(d))}),b=s(()=>K(f,o.props));var w=C(),u=P(w);{var g=d=>{var a=C(),_=P(a);{let S=s(()=>({props:r(b),...o.snippetProps}));q(_,()=>e.child,()=>r(S))}m(d,a)},y=d=>{var a=me();F(a,()=>({...r(b)}));var _=U(a);q(_,()=>e.children??B,()=>o.snippetProps),M(a),m(d,a)};A(u,d=>{e.child?d(g):d(y,-1)})}m(p,w),R()}const we=Object.freeze(Object.defineProperty({__proto__:null,Root:ge,Thumb:ve},Symbol.toStringTag,{value:"Module"}));function xe(p,e){x(e,!0);const{Root:n,Thumb:c}=we;let l=t(e,"checked",15,!1),f=t(e,"controlled",3,!1),o=t(e,"disabled",3,!1),b=t(e,"class",3,"");function w(u){f()||l(u),e.onCheckedChange?.(u)}{let u=s(()=>te("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",b()));n(p,{get checked(){return l()},onCheckedChange:w,get disabled(){return o()},get id(){return e.id},get"aria-label"(){return e["aria-label"]},onclick:g=>e.onclick?.(g),get class(){return r(u)},children:(g,y)=>{c(g,{class:"pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"})},$$slots:{default:!0}})}R()}export{xe as S};
|