glyphx 0.2.0 → 0.2.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/README.md +8 -0
- package/dist/engine/command.d.ts +9 -0
- package/dist/engine/execute.d.ts +2 -0
- package/dist/engine/index.d.ts +5 -0
- package/dist/engine/normalize.d.ts +7 -0
- package/dist/engine/search.d.ts +7 -0
- package/dist/hooks/useAutoScroll.d.ts +2 -0
- package/dist/hooks/useCommandShortcut.d.ts +2 -0
- package/dist/hooks/usePaletteNavigation.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -3
- package/dist/index.umd.cjs +1 -1
- package/dist/palette/CommandPaletteProvider.d.ts +2 -0
- package/dist/palette/types.d.ts +12 -0
- package/dist/state/groupResults.d.ts +7 -0
- package/dist/state/paletteStore.d.ts +20 -0
- package/dist/ui/CommandDialog.d.ts +8 -0
- package/dist/ui/CommandInput.d.ts +1 -0
- package/dist/ui/CommandItem.d.ts +10 -0
- package/dist/ui/CommandList.d.ts +1 -0
- package/dist/ui/CommandPalette.d.ts +5 -0
- package/dist/ui/highlight.d.ts +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -133,6 +133,14 @@ A user typing "appearance" or "night mode" will surface this command even though
|
|
|
133
133
|
|
|
134
134
|
GlyphX is intended as a foundational UI primitive, not a full application.
|
|
135
135
|
|
|
136
|
+
## Upgrading from 0.1.x
|
|
137
|
+
|
|
138
|
+
The default keyboard shortcut changed from `⌘/Ctrl + K` to `⌘/Ctrl + Shift + P` to avoid conflicting with the browser's address-bar shortcut. If you want to keep the old shortcut, pass it explicitly:
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
<GlyphX commands={commands} shortcut={{ key: "k" }} />
|
|
142
|
+
```
|
|
143
|
+
|
|
136
144
|
## Known Limitations
|
|
137
145
|
|
|
138
146
|
- **Single instance per page:** GlyphX uses a module-level state store. Rendering two `<GlyphX>` components on the same page will cause them to share state (commands, open/closed status, query). Use one instance per page.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NormalizedCommand } from './normalize';
|
|
2
|
+
export type SearchResult<T> = {
|
|
3
|
+
item: T;
|
|
4
|
+
titleIndexes: readonly number[] | null;
|
|
5
|
+
subtitleIndexes: readonly number[] | null;
|
|
6
|
+
};
|
|
7
|
+
export declare function searchCommands(commands: NormalizedCommand[], query: string): SearchResult<NormalizedCommand>[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePaletteNavigation(): void;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -781,10 +781,10 @@ const te = Rn((e, t) => ({
|
|
|
781
781
|
})), kn = { key: "p", shift: !0 };
|
|
782
782
|
function Ln(e, t = kn) {
|
|
783
783
|
Te(() => {
|
|
784
|
-
const
|
|
785
|
-
(
|
|
784
|
+
const r = (navigator.userAgentData?.platform ?? navigator.platform).toLowerCase().startsWith("mac"), o = (a) => {
|
|
785
|
+
(r ? a.metaKey : a.ctrlKey) && a.key.toLowerCase() === t.key.toLowerCase() && !!a.shiftKey == !!t.shift && !!a.altKey == !!t.alt && (a.preventDefault(), a.stopPropagation(), e());
|
|
786
786
|
};
|
|
787
|
-
return window.addEventListener("keydown",
|
|
787
|
+
return window.addEventListener("keydown", o, { capture: !0 }), () => window.removeEventListener("keydown", o, { capture: !0 });
|
|
788
788
|
}, [e, t]);
|
|
789
789
|
}
|
|
790
790
|
function be(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
package/dist/index.umd.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,u,p,w,p),H[p+u]=!0)}if(p=null,U!==void 0&&(n(U),p=""+U),c(O)&&(n(O.key),p=""+O.key),"key"in O){U={};for(var x in O)x!=="key"&&(U[x]=O[x])}else U=O;return p&&s(U,typeof f=="function"?f.displayName||f.name||"Unknown":f),d(f,p,U,o(),l,v)}function y(f){C(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===re&&(f._payload.status==="fulfilled"?C(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function C(f){return typeof f=="object"&&f!==null&&f.$$typeof===$}var _=G,$=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),B=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),ae=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pe=Object.prototype.hasOwnProperty,ye=Array.isArray,be=console.createTask?console.createTask:function(){return null};_={react_stack_bottom_frame:function(f){return f()}};var de,Te={},ee=_.react_stack_bottom_frame.bind(_,a)(),Ie=be(r(a)),H={};De.Fragment=R,De.jsx=function(f,O,U){var u=1e4>ae.recentlyCreatedOwnerStacks++;return E(f,O,U,!1,u?Error("react-stack-top-frame"):ee,u?be(r(f)):Ie)},De.jsxs=function(f,O,U){var u=1e4>ae.recentlyCreatedOwnerStacks++;return E(f,O,U,!0,u?Error("react-stack-top-frame"):ee,u?be(r(f)):Ie)}})()),De}var ht;function bn(){return ht||(ht=1,process.env.NODE_ENV==="production"?je.exports=gn():je.exports=yn()),je.exports}var b=bn();const gt=e=>{let t;const n=new Set,r=(d,E)=>{const y=typeof d=="function"?d(t):d;if(!Object.is(y,t)){const C=t;t=E??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(_=>_(t,C))}},o=()=>t,s={setState:r,getState:o,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,o,s);return s},En=(e=>e?gt(e):gt),xn=e=>e;function wn(e,t=xn){const n=G.useSyncExternalStore(e.subscribe,G.useCallback(()=>t(e.getState()),[e,t]),G.useCallback(()=>t(e.getInitialState()),[e,t]));return G.useDebugValue(n),n}const yt=e=>{const t=En(e),n=r=>wn(t,r);return Object.assign(n,t),n},Sn=(e=>e?yt(e):yt);function _n(e){return e.map(t=>{const n=[t.title,t.subtitle,...t.keywords??[]].filter(r=>!!r);return{...t,searchText:n.join(" ").toLowerCase(),titleLength:t.title.toLowerCase().length,subtitleLength:t.subtitle?.toLowerCase().length??0}})}var Me={exports:{}},Cn=Me.exports,bt;function Rn(){return bt||(bt=1,(function(e){((t,n)=>{e.exports?e.exports=n():t.fuzzysort=n()})(Cn,t=>{var n=(u,l)=>{if(!u||!l)return H;var v=$(u);de(l)||(l=_(l));var p=v.bitflags;return(p&l._bitflags)!==p?H:R(v,l)},r=(u,l,v)=>{if(!u)return v?.all?g(l,v):Ie;var p=$(u),w=p.bitflags,x=p.containsSpace,m=y(v?.threshold||0),N=v?.limit||Te,S=0,k=0,A=l.length;function se(_e){S<N?(U.add(_e),++S):(++k,_e._score>U.peek()._score&&U.replaceTop(_e))}if(v?.key)for(var te=v.key,L=0;L<A;++L){var oe=l[L],F=be(oe,te);if(F&&(de(F)||(F=_(F)),(w&F._bitflags)===w)){var z=R(p,F);z!==H&&(z._score<m||(z.obj=oe,se(z)))}}else if(v?.keys){var Ee=v.keys,le=Ee.length;e:for(var L=0;L<A;++L){var oe=l[L];{for(var ne=0,D=0;D<le;++D){var te=Ee[D],F=be(oe,te);if(!F){Pe[D]=f;continue}de(F)||(F=_(F)),Pe[D]=F,ne|=F._bitflags}if((w&ne)!==w)continue}if(x)for(let W=0;W<p.spaceSearches.length;W++)Q[W]=ee;for(var D=0;D<le;++D){if(F=Pe[D],F===f){ye[D]=f;continue}if(ye[D]=R(p,F,!1,x),ye[D]===H){ye[D]=f;continue}if(x)for(let V=0;V<p.spaceSearches.length;V++){if(ae[V]>-1e3&&Q[V]>ee){var Z=(Q[V]+ae[V])/4;Z>Q[V]&&(Q[V]=Z)}ae[V]>Q[V]&&(Q[V]=ae[V])}}if(x){for(let W=0;W<p.spaceSearches.length;W++)if(Q[W]===ee)continue e}else{var P=!1;for(let W=0;W<le;W++)if(ye[W]._score!==ee){P=!0;break}if(!P)continue}var ie=new h(le);for(let W=0;W<le;W++)ie[W]=ye[W];if(x){var q=0;for(let W=0;W<p.spaceSearches.length;W++)q+=Q[W]}else{var q=ee;for(let V=0;V<le;V++){var z=ie[V];if(z._score>-1e3&&q>ee){var Z=(q+z._score)/4;Z>q&&(q=Z)}z._score>q&&(q=z._score)}}if(ie.obj=oe,ie._score=q,v?.scoreFn){if(q=v.scoreFn(ie),!q)continue;q=y(q),ie._score=q}q<m||se(ie)}}else for(var L=0;L<A;++L){var F=l[L];if(F&&(de(F)||(F=_(F)),(w&F._bitflags)===w)){var z=R(p,F);z!==H&&(z._score<m||se(z))}}if(S===0)return Ie;for(var xe=new Array(S),L=S-1;L>=0;--L)xe[L]=U.poll();return xe.total=S+k,xe},o=(u,l="<b>",v="</b>")=>{for(var p=typeof l=="function"?l:void 0,w=u.target,x=w.length,m=u.indexes,N="",S=0,k=0,A=!1,se=[],te=0;te<x;++te){var L=w[te];if(m[k]===te){if(++k,A||(A=!0,p?(se.push(N),N=""):N+=l),k===m.length){p?(N+=L,se.push(p(N,S++)),N="",se.push(w.substr(te+1))):N+=L+v+w.substr(te+1);break}}else A&&(A=!1,p?(se.push(p(N,S++)),N=""):N+=v);N+=L}return p?se:N},a=u=>{typeof u=="number"?u=""+u:typeof u!="string"&&(u="");var l=M(u);return d(u,{_targetLower:l._lower,_targetLowerCodes:l.lowerCodes,_bitflags:l.bitflags})},c=()=>{X.clear(),I.clear()};class s{get indexes(){return this._indexes.slice(0,this._indexes.len).sort((l,v)=>l-v)}set indexes(l){return this._indexes=l}highlight(l,v){return o(this,l,v)}get score(){return E(this._score)}set score(l){this._score=y(l)}}class h extends Array{get score(){return E(this._score)}set score(l){this._score=y(l)}}var d=(u,l)=>{const v=new s;return v.target=u,v.obj=l.obj??H,v._score=l._score??ee,v._indexes=l._indexes??[],v._targetLower=l._targetLower??"",v._targetLowerCodes=l._targetLowerCodes??H,v._nextBeginningIndexes=l._nextBeginningIndexes??H,v._bitflags=l._bitflags??0,v},E=u=>u===ee?0:u>1?u:Math.E**(((-u+1)**.04307-1)*-2),y=u=>u===0?ee:u>1?u:1-Math.pow(Math.log(u)/-2+1,1/.04307),C=u=>{typeof u=="number"?u=""+u:typeof u!="string"&&(u=""),u=u.trim();var l=M(u),v=[];if(l.containsSpace){var p=u.split(/\s+/);p=[...new Set(p)];for(var w=0;w<p.length;w++)if(p[w]!==""){var x=M(p[w]);v.push({lowerCodes:x.lowerCodes,_lower:p[w].toLowerCase(),containsSpace:!1})}}return{lowerCodes:l.lowerCodes,_lower:l._lower,containsSpace:l.containsSpace,bitflags:l.bitflags,spaceSearches:v}},_=u=>{if(u.length>999)return a(u);var l=X.get(u);return l!==void 0||(l=a(u),X.set(u,l)),l},$=u=>{if(u.length>999)return C(u);var l=I.get(u);return l!==void 0||(l=C(u),I.set(u,l)),l},g=(u,l)=>{var v=[];v.total=u.length;var p=l?.limit||Te;if(l?.key)for(var w=0;w<u.length;w++){var x=u[w],m=be(x,l.key);if(m!=H){de(m)||(m=_(m));var N=d(m.target,{_score:m._score,obj:x});if(v.push(N),v.length>=p)return v}}else if(l?.keys)for(var w=0;w<u.length;w++){for(var x=u[w],S=new h(l.keys.length),k=l.keys.length-1;k>=0;--k){var m=be(x,l.keys[k]);if(!m){S[k]=f;continue}de(m)||(m=_(m)),m._score=ee,m._indexes.len=0,S[k]=m}if(S.obj=x,S._score=ee,v.push(S),v.length>=p)return v}else for(var w=0;w<u.length;w++){var m=u[w];if(m!=H&&(de(m)||(m=_(m)),m._score=ee,m._indexes.len=0,v.push(m),v.length>=p))return v}return v},R=(u,l,v=!1,p=!1)=>{if(v===!1&&u.containsSpace)return T(u,l,p);for(var w=u._lower,x=u.lowerCodes,m=x[0],N=l._targetLowerCodes,S=x.length,k=N.length,L=0,A=0,se=0;;){var te=m===N[A];if(te){if(K[se++]=A,++L,L===S)break;m=x[L]}if(++A,A>=k)return H}var L=0,oe=!1,F=0,z=l._nextBeginningIndexes;z===H&&(z=l._nextBeginningIndexes=Y(l.target)),A=K[0]===0?0:z[K[0]-1];var Ee=0;if(A!==k)for(;;)if(A>=k){if(L<=0||(++Ee,Ee>200))break;--L;var le=re[--F];A=z[le]}else{var te=x[L]===N[A];if(te){if(re[F++]=A,++L,L===S){oe=!0;break}++A}else A=z[A]}var ne=S<=1?-1:l._targetLower.indexOf(w,K[0]),D=!!~ne,Z=D?ne===0||l._nextBeginningIndexes[ne-1]===ne:!1;if(D&&!Z){for(var P=0;P<z.length;P=z[P])if(!(P<=ne)){for(var ie=0;ie<S&&x[ie]===l._targetLowerCodes[P+ie];ie++);if(ie===S){ne=P,Z=!0;break}}}var q=W=>{for(var V=0,pn=0,pe=1;pe<S;++pe)W[pe]-W[pe-1]!==1&&(V-=W[pe],++pn);var Uo=W[S-1]-W[0]-(S-1);if(V-=(12+Uo)*pn,W[0]!==0&&(V-=W[0]*W[0]*.2),!oe)V*=1e3;else{for(var ft=1,pe=z[0];pe<k;pe=z[pe])++ft;ft>24&&(V*=(ft-24)*10)}return V-=(k-S)/2,D&&(V/=1+S*S*1),Z&&(V/=1+S*S*1),V-=(k-S)/2,V};if(oe)if(Z){for(var P=0;P<S;++P)K[P]=ne+P;var xe=K,_e=q(K)}else var xe=re,_e=q(re);else{if(D)for(var P=0;P<S;++P)K[P]=ne+P;var xe=K,_e=q(xe)}l._score=_e;for(var P=0;P<S;++P)l._indexes[P]=xe[P];l._indexes.len=S;const Xe=new s;return Xe.target=l.target,Xe._score=l._score,Xe._indexes=l._indexes,Xe},T=(u,l,v)=>{for(var p=new Set,w=0,x=H,m=0,N=u.spaceSearches,S=N.length,k=0,A=()=>{for(let Z=k-1;Z>=0;Z--)l._nextBeginningIndexes[ce[Z*2+0]]=ce[Z*2+1]},se=!1,D=0;D<S;++D){ae[D]=ee;var te=N[D];if(x=R(te,l),v){if(x===H)continue;se=!0}else if(x===H)return A(),H;var L=D===S-1;if(!L){var oe=x._indexes,F=!0;for(let P=0;P<oe.len-1;P++)if(oe[P+1]-oe[P]!==1){F=!1;break}if(F){var z=oe[oe.len-1]+1,Ee=l._nextBeginningIndexes[z-1];for(let P=z-1;P>=0&&Ee===l._nextBeginningIndexes[P];P--)l._nextBeginningIndexes[P]=z,ce[k*2+0]=P,ce[k*2+1]=Ee,k++}}w+=x._score/S,ae[D]=x._score/S,x._indexes[0]<m&&(w-=(m-x._indexes[0])*2),m=x._indexes[0];for(var le=0;le<x._indexes.len;++le)p.add(x._indexes[le])}if(v&&!se)return H;A();var ne=R(u,l,!0);if(ne!==H&&ne._score>w){if(v)for(var D=0;D<S;++D)ae[D]=ne._score/S;return ne}v&&(x=l),x._score=w;var D=0;for(let Z of p)x._indexes[D++]=Z;return x._indexes.len=D,x},j=u=>u.replace(new RegExp("\\p{Script=Latin}+","gu"),l=>l.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),M=u=>{u=j(u);for(var l=u.length,v=u.toLowerCase(),p=[],w=0,x=!1,m=0;m<l;++m){var N=p[m]=v.charCodeAt(m);if(N===32){x=!0;continue}var S=N>=97&&N<=122?N-97:N>=48&&N<=57?26:N<=127?30:31;w|=1<<S}return{lowerCodes:p,bitflags:w,containsSpace:x,_lower:v}},B=u=>{for(var l=u.length,v=[],p=0,w=!1,x=!1,m=0;m<l;++m){var N=u.charCodeAt(m),S=N>=65&&N<=90,k=S||N>=97&&N<=122||N>=48&&N<=57,A=S&&!w||!x||!k;w=S,x=k,A&&(v[p++]=m)}return v},Y=u=>{u=j(u);for(var l=u.length,v=B(u),p=[],w=v[0],x=0,m=0;m<l;++m)w>m?p[m]=w:(w=v[++x],p[m]=w===void 0?l:w);return p},X=new Map,I=new Map,K=[],re=[],ce=[],Q=[],ae=[],Pe=[],ye=[],be=(u,l)=>{var v=u[l];if(v!==void 0)return v;if(typeof l=="function")return l(u);var p=l;Array.isArray(l)||(p=l.split("."));for(var w=p.length,x=-1;u&&++x<w;)u=u[p[x]];return u},de=u=>typeof u=="object"&&typeof u._bitflags=="number",Te=1/0,ee=-Te,Ie=[];Ie.total=0;var H=null,f=a(""),O=u=>{var l=[],v=0,p={},w=x=>{for(var m=0,N=l[m],S=1;S<v;){var k=S+1;m=S,k<v&&l[k]._score<l[S]._score&&(m=k),l[m-1>>1]=l[m],S=1+(m<<1)}for(var A=m-1>>1;m>0&&N._score<l[A]._score;A=(m=A)-1>>1)l[m]=l[A];l[m]=N};return p.add=(x=>{var m=v;l[v++]=x;for(var N=m-1>>1;m>0&&x._score<l[N]._score;N=(m=N)-1>>1)l[m]=l[N];l[m]=x}),p.poll=(x=>{if(v!==0){var m=l[0];return l[0]=l[--v],w(),m}}),p.peek=(x=>{if(v!==0)return l[0]}),p.replaceTop=(x=>{l[0]=x,w()}),p},U=O();return{single:n,go:r,prepare:a,cleanup:c}})})(Me)),Me.exports}var Nn=Rn();const On=hn(Nn);function Pn(e,t,n){const r=t+1,o=r+n,a=[],c=[];for(const s of e)s<t?a.push(s):n>0&&s>=r&&s<o&&c.push(s-r);return{titleIndexes:a,subtitleIndexes:c}}function Tn(e,t){return t.trim()?On.go(t,e,{key:"searchText",threshold:-1e3}).map(r=>{const{titleIndexes:o,subtitleIndexes:a}=Pn(r.indexes,r.obj.titleLength,r.obj.subtitleLength);return{item:r.obj,titleIndexes:o.length>0?o:null,subtitleIndexes:a.length>0?a:null}}):e.map(r=>({item:r,titleIndexes:null,subtitleIndexes:null}))}async function Et(e){try{await e.run()}catch(t){console.error(`[command-palette] Command failed: ${e.id}`,t)}}const J=Sn((e,t)=>({commands:[],normalized:[],results:[],query:"",isOpen:!1,selectedIndex:0,registerCommands:n=>{const r=_n(n);e({commands:n,normalized:r,results:r.map(o=>({item:o,titleIndexes:null,subtitleIndexes:null})),selectedIndex:0})},setQuery:n=>{const{normalized:r}=t(),o=Tn(r,n);e({query:n,results:o,selectedIndex:0})},selectNext:()=>{const{selectedIndex:n,results:r}=t();e({selectedIndex:r.length===0?0:(n+1)%r.length})},selectPrev:()=>{const{selectedIndex:n,results:r}=t();e({selectedIndex:r.length===0?0:(n-1+r.length)%r.length})},selectFirst:()=>e({selectedIndex:0}),open:()=>e({isOpen:!0}),close:()=>e(n=>({isOpen:!1,query:"",selectedIndex:0,results:n.normalized.map(r=>({item:r,titleIndexes:null,subtitleIndexes:null}))}))})),In={key:"p",shift:!0};function An(e,t=In){G.useEffect(()=>{const n=(navigator.userAgentData?.platform??navigator.platform).toLowerCase().startsWith("mac"),r=o=>{(n?o.metaKey:o.ctrlKey)&&o.key.toLowerCase()===t.key.toLowerCase()&&!!o.shiftKey==!!t.shift&&!!o.altKey==!!t.alt&&(o.preventDefault(),o.stopPropagation(),e())};return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[e,t])}function he(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function xt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ze(...e){return t=>{let n=!1;const r=e.map(o=>{const a=xt(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():xt(e[o],null)}}}}function we(...e){return i.useCallback(Ze(...e),e)}function Dn(e,t){const n=i.createContext(t),r=a=>{const{children:c,...s}=a,h=i.useMemo(()=>s,Object.values(s));return b.jsx(n.Provider,{value:h,children:c})};r.displayName=e+"Provider";function o(a){const c=i.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function kn(e,t=[]){let n=[];function r(a,c){const s=i.createContext(c),h=n.length;n=[...n,c];const d=y=>{const{scope:C,children:_,...$}=y,g=C?.[e]?.[h]||s,R=i.useMemo(()=>$,Object.values($));return b.jsx(g.Provider,{value:R,children:_})};d.displayName=a+"Provider";function E(y,C){const _=C?.[e]?.[h]||s,$=i.useContext(_);if($)return $;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${a}\``)}return[d,E]}const o=()=>{const a=n.map(c=>i.createContext(c));return function(s){const h=s?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...s,[e]:h}}),[s,h])}};return o.scopeName=e,[r,Ln(o,...t)]}function Ln(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((s,{useScope:h,scopeName:d})=>{const y=h(a)[`__scope${d}`];return{...s,...y}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var ke=globalThis?.document?i.useLayoutEffect:()=>{},jn=i[" useId ".trim().toString()]||(()=>{}),Mn=0;function Je(e){const[t,n]=i.useState(jn());return ke(()=>{n(r=>r??String(Mn++))},[e]),e||(t?`radix-${t}`:"")}var Fn=i[" useInsertionEffect ".trim().toString()]||ke;function Wn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=$n({defaultProp:t,onChange:n}),s=e!==void 0,h=s?e:o;{const E=i.useRef(e!==void 0);i.useEffect(()=>{const y=E.current;y!==s&&console.warn(`${r} is changing from ${y?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),E.current=s},[s,r])}const d=i.useCallback(E=>{if(s){const y=Bn(E)?E(e):E;y!==e&&c.current?.(y)}else a(E)},[s,e,a,c]);return[h,d]}function $n({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return Fn(()=>{a.current=t},[t]),i.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function Bn(e){return typeof e=="function"}function wt(e){const t=Un(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),h=s.find(Vn);if(h){const d=h.props.children,E=s.map(y=>y===h?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:y);return b.jsx(t,{...c,ref:o,children:i.isValidElement(d)?i.cloneElement(d,void 0,E):null})}return b.jsx(t,{...c,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function Un(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=Hn(o),s=Yn(a,o.props);return o.type!==i.Fragment&&(s.ref=r?Ze(r,c):c),i.cloneElement(o,s)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zn=Symbol("radix.slottable");function Vn(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zn}function Yn(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const h=a(...s);return o(...s),h}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Hn(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=Gn.reduce((e,t)=>{const n=wt(`Primitive.${t}`),r=i.forwardRef((o,a)=>{const{asChild:c,...s}=o,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kn(e,t){e&&mn.flushSync(()=>e.dispatchEvent(t))}function Le(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}function qn(e,t=globalThis?.document){const n=Le(e);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Xn="DismissableLayer",Qe="dismissableLayer.update",Zn="dismissableLayer.pointerDownOutside",Jn="dismissableLayer.focusOutside",St,_t=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ct=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...h}=e,d=i.useContext(_t),[E,y]=i.useState(null),C=E?.ownerDocument??globalThis?.document,[,_]=i.useState({}),$=we(t,I=>y(I)),g=Array.from(d.layers),[R]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=g.indexOf(R),j=E?g.indexOf(E):-1,M=d.layersWithOutsidePointerEventsDisabled.size>0,B=j>=T,Y=tr(I=>{const K=I.target,re=[...d.branches].some(ce=>ce.contains(K));!B||re||(o?.(I),c?.(I),I.defaultPrevented||s?.())},C),X=nr(I=>{const K=I.target;[...d.branches].some(ce=>ce.contains(K))||(a?.(I),c?.(I),I.defaultPrevented||s?.())},C);return qn(I=>{j===d.layers.size-1&&(r?.(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},C),i.useEffect(()=>{if(E)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(St=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(E)),d.layers.add(E),Rt(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=St)}},[E,C,n,d]),i.useEffect(()=>()=>{E&&(d.layers.delete(E),d.layersWithOutsidePointerEventsDisabled.delete(E),Rt())},[E,d]),i.useEffect(()=>{const I=()=>_({});return document.addEventListener(Qe,I),()=>document.removeEventListener(Qe,I)},[]),b.jsx(ve.div,{...h,ref:$,style:{pointerEvents:M?B?"auto":"none":void 0,...e.style},onFocusCapture:he(e.onFocusCapture,X.onFocusCapture),onBlurCapture:he(e.onBlurCapture,X.onBlurCapture),onPointerDownCapture:he(e.onPointerDownCapture,Y.onPointerDownCapture)})});Ct.displayName=Xn;var Qn="DismissableLayerBranch",er=i.forwardRef((e,t)=>{const n=i.useContext(_t),r=i.useRef(null),o=we(t,r);return i.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),b.jsx(ve.div,{...e,ref:o})});er.displayName=Qn;function tr(e,t=globalThis?.document){const n=Le(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let h=function(){Nt(Zn,n,d,{discrete:!0})};const d={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function nr(e,t=globalThis?.document){const n=Le(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&Nt(Jn,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Rt(){const e=new CustomEvent(Qe);document.dispatchEvent(e)}function Nt(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Kn(o,a):o.dispatchEvent(a)}var et="focusScope.autoFocusOnMount",tt="focusScope.autoFocusOnUnmount",Ot={bubbles:!1,cancelable:!0},rr="FocusScope",Pt=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[s,h]=i.useState(null),d=Le(o),E=Le(a),y=i.useRef(null),C=we(t,g=>h(g)),_=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let g=function(M){if(_.paused||!s)return;const B=M.target;s.contains(B)?y.current=B:ge(y.current,{select:!0})},R=function(M){if(_.paused||!s)return;const B=M.relatedTarget;B!==null&&(s.contains(B)||ge(y.current,{select:!0}))},T=function(M){if(document.activeElement===document.body)for(const Y of M)Y.removedNodes.length>0&&ge(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",R);const j=new MutationObserver(T);return s&&j.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",R),j.disconnect()}}},[r,s,_.paused]),i.useEffect(()=>{if(s){At.add(_);const g=document.activeElement;if(!s.contains(g)){const T=new CustomEvent(et,Ot);s.addEventListener(et,d),s.dispatchEvent(T),T.defaultPrevented||(or(lr(Tt(s)),{select:!0}),document.activeElement===g&&ge(s))}return()=>{s.removeEventListener(et,d),setTimeout(()=>{const T=new CustomEvent(tt,Ot);s.addEventListener(tt,E),s.dispatchEvent(T),T.defaultPrevented||ge(g??document.body,{select:!0}),s.removeEventListener(tt,E),At.remove(_)},0)}}},[s,d,E,_]);const $=i.useCallback(g=>{if(!n&&!r||_.paused)return;const R=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,T=document.activeElement;if(R&&T){const j=g.currentTarget,[M,B]=ar(j);M&&B?!g.shiftKey&&T===B?(g.preventDefault(),n&&ge(M,{select:!0})):g.shiftKey&&T===M&&(g.preventDefault(),n&&ge(B,{select:!0})):T===j&&g.preventDefault()}},[n,r,_.paused]);return b.jsx(ve.div,{tabIndex:-1,...c,ref:C,onKeyDown:$})});Pt.displayName=rr;function or(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ge(r,{select:t}),document.activeElement!==n)return}function ar(e){const t=Tt(e),n=It(t,e),r=It(t.reverse(),e);return[n,r]}function Tt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function It(e,t){for(const n of e)if(!sr(n,{upTo:t}))return n}function sr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ir(e){return e instanceof HTMLInputElement&&"select"in e}function ge(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ir(e)&&t&&e.select()}}var At=cr();function cr(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Dt(e,t),e.unshift(t)},remove(t){e=Dt(e,t),e[0]?.resume()}}}function Dt(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lr(e){return e.filter(t=>t.tagName!=="A")}var ur="Portal",kt=i.forwardRef((e,t)=>{const{container:n,...r}=e,[o,a]=i.useState(!1);ke(()=>a(!0),[]);const c=n||o&&globalThis?.document?.body;return c?dt.createPortal(b.jsx(ve.div,{...r,ref:t}),c):null});kt.displayName=ur;function fr(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var Fe=e=>{const{present:t,children:n}=e,r=dr(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=we(r.ref,vr(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};Fe.displayName="Presence";function dr(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,h]=fr(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const d=We(r.current);a.current=s==="mounted"?d:"none"},[s]),ke(()=>{const d=r.current,E=o.current;if(E!==e){const C=a.current,_=We(d);e?h("MOUNT"):_==="none"||d?.display==="none"?h("UNMOUNT"):h(E&&C!==_?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),ke(()=>{if(t){let d;const E=t.ownerDocument.defaultView??window,y=_=>{const g=We(r.current).includes(CSS.escape(_.animationName));if(_.target===t&&g&&(h("ANIMATION_END"),!o.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",d=E.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},C=_=>{_.target===t&&(a.current=We(r.current))};return t.addEventListener("animationstart",C),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{E.clearTimeout(d),t.removeEventListener("animationstart",C),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function We(e){return e?.animationName||"none"}function vr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nt=0;function pr(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Lt()),document.body.insertAdjacentElement("beforeend",e[1]??Lt()),nt++,()=>{nt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),nt--}},[])}function Lt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var fe=function(){return fe=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},fe.apply(this,arguments)};function jt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function mr(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var $e="right-scroll-bar-position",Be="width-before-scroll-bar",hr="with-scroll-bars-hidden",gr="--removed-body-scroll-bar-size";function rt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yr(e,t){var n=G.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var br=typeof window<"u"?i.useLayoutEffect:i.useEffect,Mt=new WeakMap;function Er(e,t){var n=yr(null,function(r){return e.forEach(function(o){return rt(o,r)})});return br(function(){var r=Mt.get(n);if(r){var o=new Set(r),a=new Set(e),c=n.current;o.forEach(function(s){a.has(s)||rt(s,null)}),a.forEach(function(s){o.has(s)||rt(s,c)})}Mt.set(n,e)},[e]),n}function xr(e){return e}function wr(e,t){t===void 0&&(t=xr);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var c=t(a,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(a),c=n}var h=function(){var E=c;c=[],E.forEach(a)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(E){c.push(E),d()},filter:function(E){return c=c.filter(E),n}}}};return o}function Sr(e){e===void 0&&(e={});var t=wr(null);return t.options=fe({async:!0,ssr:!1},e),t}var Ft=function(e){var t=e.sideCar,n=jt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,fe({},n))};Ft.isSideCarExport=!0;function _r(e,t){return e.useMedium(t),Ft}var Wt=Sr(),ot=function(){},Ue=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ot,onWheelCapture:ot,onTouchMoveCapture:ot}),o=r[0],a=r[1],c=e.forwardProps,s=e.children,h=e.className,d=e.removeScrollBar,E=e.enabled,y=e.shards,C=e.sideCar,_=e.noRelative,$=e.noIsolation,g=e.inert,R=e.allowPinchZoom,T=e.as,j=T===void 0?"div":T,M=e.gapMode,B=jt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),Y=C,X=Er([n,t]),I=fe(fe({},B),o);return i.createElement(i.Fragment,null,E&&i.createElement(Y,{sideCar:Wt,removeScrollBar:d,shards:y,noRelative:_,noIsolation:$,inert:g,setCallbacks:a,allowPinchZoom:!!R,lockRef:n,gapMode:M}),c?i.cloneElement(i.Children.only(s),fe(fe({},I),{ref:X})):i.createElement(j,fe({},I,{className:h,ref:X}),s))});Ue.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ue.classNames={fullWidth:Be,zeroRight:$e};var Cr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Cr();return t&&e.setAttribute("nonce",t),e}function Nr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Or(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Pr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rr())&&(Nr(t,n),Or(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Tr=function(){var e=Pr();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$t=function(){var e=Tr(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ir={left:0,top:0,right:0,gap:0},at=function(e){return parseInt(e||"",10)||0},Ar=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[at(n),at(r),at(o)]},Dr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ir;var t=Ar(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},kr=$t(),Ce="data-scroll-locked",Lr=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
6
|
+
<%s key={someKey} {...props} />`,u,p,w,p),H[p+u]=!0)}if(p=null,U!==void 0&&(n(U),p=""+U),c(O)&&(n(O.key),p=""+O.key),"key"in O){U={};for(var x in O)x!=="key"&&(U[x]=O[x])}else U=O;return p&&s(U,typeof f=="function"?f.displayName||f.name||"Unknown":f),d(f,p,U,o(),l,v)}function y(f){C(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===re&&(f._payload.status==="fulfilled"?C(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function C(f){return typeof f=="object"&&f!==null&&f.$$typeof===$}var _=G,$=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),B=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),ae=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pe=Object.prototype.hasOwnProperty,ye=Array.isArray,be=console.createTask?console.createTask:function(){return null};_={react_stack_bottom_frame:function(f){return f()}};var de,Te={},ee=_.react_stack_bottom_frame.bind(_,a)(),Ie=be(r(a)),H={};De.Fragment=R,De.jsx=function(f,O,U){var u=1e4>ae.recentlyCreatedOwnerStacks++;return E(f,O,U,!1,u?Error("react-stack-top-frame"):ee,u?be(r(f)):Ie)},De.jsxs=function(f,O,U){var u=1e4>ae.recentlyCreatedOwnerStacks++;return E(f,O,U,!0,u?Error("react-stack-top-frame"):ee,u?be(r(f)):Ie)}})()),De}var ht;function bn(){return ht||(ht=1,process.env.NODE_ENV==="production"?je.exports=gn():je.exports=yn()),je.exports}var b=bn();const gt=e=>{let t;const n=new Set,r=(d,E)=>{const y=typeof d=="function"?d(t):d;if(!Object.is(y,t)){const C=t;t=E??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(_=>_(t,C))}},o=()=>t,s={setState:r,getState:o,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,o,s);return s},En=(e=>e?gt(e):gt),xn=e=>e;function wn(e,t=xn){const n=G.useSyncExternalStore(e.subscribe,G.useCallback(()=>t(e.getState()),[e,t]),G.useCallback(()=>t(e.getInitialState()),[e,t]));return G.useDebugValue(n),n}const yt=e=>{const t=En(e),n=r=>wn(t,r);return Object.assign(n,t),n},Sn=(e=>e?yt(e):yt);function _n(e){return e.map(t=>{const n=[t.title,t.subtitle,...t.keywords??[]].filter(r=>!!r);return{...t,searchText:n.join(" ").toLowerCase(),titleLength:t.title.toLowerCase().length,subtitleLength:t.subtitle?.toLowerCase().length??0}})}var Me={exports:{}},Cn=Me.exports,bt;function Rn(){return bt||(bt=1,(function(e){((t,n)=>{e.exports?e.exports=n():t.fuzzysort=n()})(Cn,t=>{var n=(u,l)=>{if(!u||!l)return H;var v=$(u);de(l)||(l=_(l));var p=v.bitflags;return(p&l._bitflags)!==p?H:R(v,l)},r=(u,l,v)=>{if(!u)return v?.all?g(l,v):Ie;var p=$(u),w=p.bitflags,x=p.containsSpace,m=y(v?.threshold||0),N=v?.limit||Te,S=0,k=0,A=l.length;function se(_e){S<N?(U.add(_e),++S):(++k,_e._score>U.peek()._score&&U.replaceTop(_e))}if(v?.key)for(var te=v.key,L=0;L<A;++L){var oe=l[L],F=be(oe,te);if(F&&(de(F)||(F=_(F)),(w&F._bitflags)===w)){var z=R(p,F);z!==H&&(z._score<m||(z.obj=oe,se(z)))}}else if(v?.keys){var Ee=v.keys,le=Ee.length;e:for(var L=0;L<A;++L){var oe=l[L];{for(var ne=0,D=0;D<le;++D){var te=Ee[D],F=be(oe,te);if(!F){Pe[D]=f;continue}de(F)||(F=_(F)),Pe[D]=F,ne|=F._bitflags}if((w&ne)!==w)continue}if(x)for(let W=0;W<p.spaceSearches.length;W++)Q[W]=ee;for(var D=0;D<le;++D){if(F=Pe[D],F===f){ye[D]=f;continue}if(ye[D]=R(p,F,!1,x),ye[D]===H){ye[D]=f;continue}if(x)for(let V=0;V<p.spaceSearches.length;V++){if(ae[V]>-1e3&&Q[V]>ee){var Z=(Q[V]+ae[V])/4;Z>Q[V]&&(Q[V]=Z)}ae[V]>Q[V]&&(Q[V]=ae[V])}}if(x){for(let W=0;W<p.spaceSearches.length;W++)if(Q[W]===ee)continue e}else{var P=!1;for(let W=0;W<le;W++)if(ye[W]._score!==ee){P=!0;break}if(!P)continue}var ie=new h(le);for(let W=0;W<le;W++)ie[W]=ye[W];if(x){var q=0;for(let W=0;W<p.spaceSearches.length;W++)q+=Q[W]}else{var q=ee;for(let V=0;V<le;V++){var z=ie[V];if(z._score>-1e3&&q>ee){var Z=(q+z._score)/4;Z>q&&(q=Z)}z._score>q&&(q=z._score)}}if(ie.obj=oe,ie._score=q,v?.scoreFn){if(q=v.scoreFn(ie),!q)continue;q=y(q),ie._score=q}q<m||se(ie)}}else for(var L=0;L<A;++L){var F=l[L];if(F&&(de(F)||(F=_(F)),(w&F._bitflags)===w)){var z=R(p,F);z!==H&&(z._score<m||se(z))}}if(S===0)return Ie;for(var xe=new Array(S),L=S-1;L>=0;--L)xe[L]=U.poll();return xe.total=S+k,xe},o=(u,l="<b>",v="</b>")=>{for(var p=typeof l=="function"?l:void 0,w=u.target,x=w.length,m=u.indexes,N="",S=0,k=0,A=!1,se=[],te=0;te<x;++te){var L=w[te];if(m[k]===te){if(++k,A||(A=!0,p?(se.push(N),N=""):N+=l),k===m.length){p?(N+=L,se.push(p(N,S++)),N="",se.push(w.substr(te+1))):N+=L+v+w.substr(te+1);break}}else A&&(A=!1,p?(se.push(p(N,S++)),N=""):N+=v);N+=L}return p?se:N},a=u=>{typeof u=="number"?u=""+u:typeof u!="string"&&(u="");var l=M(u);return d(u,{_targetLower:l._lower,_targetLowerCodes:l.lowerCodes,_bitflags:l.bitflags})},c=()=>{X.clear(),I.clear()};class s{get indexes(){return this._indexes.slice(0,this._indexes.len).sort((l,v)=>l-v)}set indexes(l){return this._indexes=l}highlight(l,v){return o(this,l,v)}get score(){return E(this._score)}set score(l){this._score=y(l)}}class h extends Array{get score(){return E(this._score)}set score(l){this._score=y(l)}}var d=(u,l)=>{const v=new s;return v.target=u,v.obj=l.obj??H,v._score=l._score??ee,v._indexes=l._indexes??[],v._targetLower=l._targetLower??"",v._targetLowerCodes=l._targetLowerCodes??H,v._nextBeginningIndexes=l._nextBeginningIndexes??H,v._bitflags=l._bitflags??0,v},E=u=>u===ee?0:u>1?u:Math.E**(((-u+1)**.04307-1)*-2),y=u=>u===0?ee:u>1?u:1-Math.pow(Math.log(u)/-2+1,1/.04307),C=u=>{typeof u=="number"?u=""+u:typeof u!="string"&&(u=""),u=u.trim();var l=M(u),v=[];if(l.containsSpace){var p=u.split(/\s+/);p=[...new Set(p)];for(var w=0;w<p.length;w++)if(p[w]!==""){var x=M(p[w]);v.push({lowerCodes:x.lowerCodes,_lower:p[w].toLowerCase(),containsSpace:!1})}}return{lowerCodes:l.lowerCodes,_lower:l._lower,containsSpace:l.containsSpace,bitflags:l.bitflags,spaceSearches:v}},_=u=>{if(u.length>999)return a(u);var l=X.get(u);return l!==void 0||(l=a(u),X.set(u,l)),l},$=u=>{if(u.length>999)return C(u);var l=I.get(u);return l!==void 0||(l=C(u),I.set(u,l)),l},g=(u,l)=>{var v=[];v.total=u.length;var p=l?.limit||Te;if(l?.key)for(var w=0;w<u.length;w++){var x=u[w],m=be(x,l.key);if(m!=H){de(m)||(m=_(m));var N=d(m.target,{_score:m._score,obj:x});if(v.push(N),v.length>=p)return v}}else if(l?.keys)for(var w=0;w<u.length;w++){for(var x=u[w],S=new h(l.keys.length),k=l.keys.length-1;k>=0;--k){var m=be(x,l.keys[k]);if(!m){S[k]=f;continue}de(m)||(m=_(m)),m._score=ee,m._indexes.len=0,S[k]=m}if(S.obj=x,S._score=ee,v.push(S),v.length>=p)return v}else for(var w=0;w<u.length;w++){var m=u[w];if(m!=H&&(de(m)||(m=_(m)),m._score=ee,m._indexes.len=0,v.push(m),v.length>=p))return v}return v},R=(u,l,v=!1,p=!1)=>{if(v===!1&&u.containsSpace)return T(u,l,p);for(var w=u._lower,x=u.lowerCodes,m=x[0],N=l._targetLowerCodes,S=x.length,k=N.length,L=0,A=0,se=0;;){var te=m===N[A];if(te){if(K[se++]=A,++L,L===S)break;m=x[L]}if(++A,A>=k)return H}var L=0,oe=!1,F=0,z=l._nextBeginningIndexes;z===H&&(z=l._nextBeginningIndexes=Y(l.target)),A=K[0]===0?0:z[K[0]-1];var Ee=0;if(A!==k)for(;;)if(A>=k){if(L<=0||(++Ee,Ee>200))break;--L;var le=re[--F];A=z[le]}else{var te=x[L]===N[A];if(te){if(re[F++]=A,++L,L===S){oe=!0;break}++A}else A=z[A]}var ne=S<=1?-1:l._targetLower.indexOf(w,K[0]),D=!!~ne,Z=D?ne===0||l._nextBeginningIndexes[ne-1]===ne:!1;if(D&&!Z){for(var P=0;P<z.length;P=z[P])if(!(P<=ne)){for(var ie=0;ie<S&&x[ie]===l._targetLowerCodes[P+ie];ie++);if(ie===S){ne=P,Z=!0;break}}}var q=W=>{for(var V=0,pn=0,pe=1;pe<S;++pe)W[pe]-W[pe-1]!==1&&(V-=W[pe],++pn);var Uo=W[S-1]-W[0]-(S-1);if(V-=(12+Uo)*pn,W[0]!==0&&(V-=W[0]*W[0]*.2),!oe)V*=1e3;else{for(var ft=1,pe=z[0];pe<k;pe=z[pe])++ft;ft>24&&(V*=(ft-24)*10)}return V-=(k-S)/2,D&&(V/=1+S*S*1),Z&&(V/=1+S*S*1),V-=(k-S)/2,V};if(oe)if(Z){for(var P=0;P<S;++P)K[P]=ne+P;var xe=K,_e=q(K)}else var xe=re,_e=q(re);else{if(D)for(var P=0;P<S;++P)K[P]=ne+P;var xe=K,_e=q(xe)}l._score=_e;for(var P=0;P<S;++P)l._indexes[P]=xe[P];l._indexes.len=S;const Xe=new s;return Xe.target=l.target,Xe._score=l._score,Xe._indexes=l._indexes,Xe},T=(u,l,v)=>{for(var p=new Set,w=0,x=H,m=0,N=u.spaceSearches,S=N.length,k=0,A=()=>{for(let Z=k-1;Z>=0;Z--)l._nextBeginningIndexes[ce[Z*2+0]]=ce[Z*2+1]},se=!1,D=0;D<S;++D){ae[D]=ee;var te=N[D];if(x=R(te,l),v){if(x===H)continue;se=!0}else if(x===H)return A(),H;var L=D===S-1;if(!L){var oe=x._indexes,F=!0;for(let P=0;P<oe.len-1;P++)if(oe[P+1]-oe[P]!==1){F=!1;break}if(F){var z=oe[oe.len-1]+1,Ee=l._nextBeginningIndexes[z-1];for(let P=z-1;P>=0&&Ee===l._nextBeginningIndexes[P];P--)l._nextBeginningIndexes[P]=z,ce[k*2+0]=P,ce[k*2+1]=Ee,k++}}w+=x._score/S,ae[D]=x._score/S,x._indexes[0]<m&&(w-=(m-x._indexes[0])*2),m=x._indexes[0];for(var le=0;le<x._indexes.len;++le)p.add(x._indexes[le])}if(v&&!se)return H;A();var ne=R(u,l,!0);if(ne!==H&&ne._score>w){if(v)for(var D=0;D<S;++D)ae[D]=ne._score/S;return ne}v&&(x=l),x._score=w;var D=0;for(let Z of p)x._indexes[D++]=Z;return x._indexes.len=D,x},j=u=>u.replace(new RegExp("\\p{Script=Latin}+","gu"),l=>l.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),M=u=>{u=j(u);for(var l=u.length,v=u.toLowerCase(),p=[],w=0,x=!1,m=0;m<l;++m){var N=p[m]=v.charCodeAt(m);if(N===32){x=!0;continue}var S=N>=97&&N<=122?N-97:N>=48&&N<=57?26:N<=127?30:31;w|=1<<S}return{lowerCodes:p,bitflags:w,containsSpace:x,_lower:v}},B=u=>{for(var l=u.length,v=[],p=0,w=!1,x=!1,m=0;m<l;++m){var N=u.charCodeAt(m),S=N>=65&&N<=90,k=S||N>=97&&N<=122||N>=48&&N<=57,A=S&&!w||!x||!k;w=S,x=k,A&&(v[p++]=m)}return v},Y=u=>{u=j(u);for(var l=u.length,v=B(u),p=[],w=v[0],x=0,m=0;m<l;++m)w>m?p[m]=w:(w=v[++x],p[m]=w===void 0?l:w);return p},X=new Map,I=new Map,K=[],re=[],ce=[],Q=[],ae=[],Pe=[],ye=[],be=(u,l)=>{var v=u[l];if(v!==void 0)return v;if(typeof l=="function")return l(u);var p=l;Array.isArray(l)||(p=l.split("."));for(var w=p.length,x=-1;u&&++x<w;)u=u[p[x]];return u},de=u=>typeof u=="object"&&typeof u._bitflags=="number",Te=1/0,ee=-Te,Ie=[];Ie.total=0;var H=null,f=a(""),O=u=>{var l=[],v=0,p={},w=x=>{for(var m=0,N=l[m],S=1;S<v;){var k=S+1;m=S,k<v&&l[k]._score<l[S]._score&&(m=k),l[m-1>>1]=l[m],S=1+(m<<1)}for(var A=m-1>>1;m>0&&N._score<l[A]._score;A=(m=A)-1>>1)l[m]=l[A];l[m]=N};return p.add=(x=>{var m=v;l[v++]=x;for(var N=m-1>>1;m>0&&x._score<l[N]._score;N=(m=N)-1>>1)l[m]=l[N];l[m]=x}),p.poll=(x=>{if(v!==0){var m=l[0];return l[0]=l[--v],w(),m}}),p.peek=(x=>{if(v!==0)return l[0]}),p.replaceTop=(x=>{l[0]=x,w()}),p},U=O();return{single:n,go:r,prepare:a,cleanup:c}})})(Me)),Me.exports}var Nn=Rn();const On=hn(Nn);function Pn(e,t,n){const r=t+1,o=r+n,a=[],c=[];for(const s of e)s<t?a.push(s):n>0&&s>=r&&s<o&&c.push(s-r);return{titleIndexes:a,subtitleIndexes:c}}function Tn(e,t){return t.trim()?On.go(t,e,{key:"searchText",threshold:-1e3}).map(r=>{const{titleIndexes:o,subtitleIndexes:a}=Pn(r.indexes,r.obj.titleLength,r.obj.subtitleLength);return{item:r.obj,titleIndexes:o.length>0?o:null,subtitleIndexes:a.length>0?a:null}}):e.map(r=>({item:r,titleIndexes:null,subtitleIndexes:null}))}async function Et(e){try{await e.run()}catch(t){console.error(`[command-palette] Command failed: ${e.id}`,t)}}const J=Sn((e,t)=>({commands:[],normalized:[],results:[],query:"",isOpen:!1,selectedIndex:0,registerCommands:n=>{const r=_n(n);e({commands:n,normalized:r,results:r.map(o=>({item:o,titleIndexes:null,subtitleIndexes:null})),selectedIndex:0})},setQuery:n=>{const{normalized:r}=t(),o=Tn(r,n);e({query:n,results:o,selectedIndex:0})},selectNext:()=>{const{selectedIndex:n,results:r}=t();e({selectedIndex:r.length===0?0:(n+1)%r.length})},selectPrev:()=>{const{selectedIndex:n,results:r}=t();e({selectedIndex:r.length===0?0:(n-1+r.length)%r.length})},selectFirst:()=>e({selectedIndex:0}),open:()=>e({isOpen:!0}),close:()=>e(n=>({isOpen:!1,query:"",selectedIndex:0,results:n.normalized.map(r=>({item:r,titleIndexes:null,subtitleIndexes:null}))}))})),In={key:"p",shift:!0};function An(e,t=In){G.useEffect(()=>{const r=(navigator.userAgentData?.platform??navigator.platform).toLowerCase().startsWith("mac"),o=a=>{(r?a.metaKey:a.ctrlKey)&&a.key.toLowerCase()===t.key.toLowerCase()&&!!a.shiftKey==!!t.shift&&!!a.altKey==!!t.alt&&(a.preventDefault(),a.stopPropagation(),e())};return window.addEventListener("keydown",o,{capture:!0}),()=>window.removeEventListener("keydown",o,{capture:!0})},[e,t])}function he(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function xt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ze(...e){return t=>{let n=!1;const r=e.map(o=>{const a=xt(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():xt(e[o],null)}}}}function we(...e){return i.useCallback(Ze(...e),e)}function Dn(e,t){const n=i.createContext(t),r=a=>{const{children:c,...s}=a,h=i.useMemo(()=>s,Object.values(s));return b.jsx(n.Provider,{value:h,children:c})};r.displayName=e+"Provider";function o(a){const c=i.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function kn(e,t=[]){let n=[];function r(a,c){const s=i.createContext(c),h=n.length;n=[...n,c];const d=y=>{const{scope:C,children:_,...$}=y,g=C?.[e]?.[h]||s,R=i.useMemo(()=>$,Object.values($));return b.jsx(g.Provider,{value:R,children:_})};d.displayName=a+"Provider";function E(y,C){const _=C?.[e]?.[h]||s,$=i.useContext(_);if($)return $;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${a}\``)}return[d,E]}const o=()=>{const a=n.map(c=>i.createContext(c));return function(s){const h=s?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...s,[e]:h}}),[s,h])}};return o.scopeName=e,[r,Ln(o,...t)]}function Ln(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((s,{useScope:h,scopeName:d})=>{const y=h(a)[`__scope${d}`];return{...s,...y}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var ke=globalThis?.document?i.useLayoutEffect:()=>{},jn=i[" useId ".trim().toString()]||(()=>{}),Mn=0;function Je(e){const[t,n]=i.useState(jn());return ke(()=>{n(r=>r??String(Mn++))},[e]),e||(t?`radix-${t}`:"")}var Fn=i[" useInsertionEffect ".trim().toString()]||ke;function Wn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=$n({defaultProp:t,onChange:n}),s=e!==void 0,h=s?e:o;{const E=i.useRef(e!==void 0);i.useEffect(()=>{const y=E.current;y!==s&&console.warn(`${r} is changing from ${y?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),E.current=s},[s,r])}const d=i.useCallback(E=>{if(s){const y=Bn(E)?E(e):E;y!==e&&c.current?.(y)}else a(E)},[s,e,a,c]);return[h,d]}function $n({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return Fn(()=>{a.current=t},[t]),i.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function Bn(e){return typeof e=="function"}function wt(e){const t=Un(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),h=s.find(Vn);if(h){const d=h.props.children,E=s.map(y=>y===h?i.Children.count(d)>1?i.Children.only(null):i.isValidElement(d)?d.props.children:null:y);return b.jsx(t,{...c,ref:o,children:i.isValidElement(d)?i.cloneElement(d,void 0,E):null})}return b.jsx(t,{...c,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}function Un(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=Hn(o),s=Yn(a,o.props);return o.type!==i.Fragment&&(s.ref=r?Ze(r,c):c),i.cloneElement(o,s)}return i.Children.count(o)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zn=Symbol("radix.slottable");function Vn(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zn}function Yn(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const h=a(...s);return o(...s),h}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Hn(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=Gn.reduce((e,t)=>{const n=wt(`Primitive.${t}`),r=i.forwardRef((o,a)=>{const{asChild:c,...s}=o,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kn(e,t){e&&mn.flushSync(()=>e.dispatchEvent(t))}function Le(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}function qn(e,t=globalThis?.document){const n=Le(e);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Xn="DismissableLayer",Qe="dismissableLayer.update",Zn="dismissableLayer.pointerDownOutside",Jn="dismissableLayer.focusOutside",St,_t=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ct=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...h}=e,d=i.useContext(_t),[E,y]=i.useState(null),C=E?.ownerDocument??globalThis?.document,[,_]=i.useState({}),$=we(t,I=>y(I)),g=Array.from(d.layers),[R]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=g.indexOf(R),j=E?g.indexOf(E):-1,M=d.layersWithOutsidePointerEventsDisabled.size>0,B=j>=T,Y=tr(I=>{const K=I.target,re=[...d.branches].some(ce=>ce.contains(K));!B||re||(o?.(I),c?.(I),I.defaultPrevented||s?.())},C),X=nr(I=>{const K=I.target;[...d.branches].some(ce=>ce.contains(K))||(a?.(I),c?.(I),I.defaultPrevented||s?.())},C);return qn(I=>{j===d.layers.size-1&&(r?.(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},C),i.useEffect(()=>{if(E)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(St=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(E)),d.layers.add(E),Rt(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=St)}},[E,C,n,d]),i.useEffect(()=>()=>{E&&(d.layers.delete(E),d.layersWithOutsidePointerEventsDisabled.delete(E),Rt())},[E,d]),i.useEffect(()=>{const I=()=>_({});return document.addEventListener(Qe,I),()=>document.removeEventListener(Qe,I)},[]),b.jsx(ve.div,{...h,ref:$,style:{pointerEvents:M?B?"auto":"none":void 0,...e.style},onFocusCapture:he(e.onFocusCapture,X.onFocusCapture),onBlurCapture:he(e.onBlurCapture,X.onBlurCapture),onPointerDownCapture:he(e.onPointerDownCapture,Y.onPointerDownCapture)})});Ct.displayName=Xn;var Qn="DismissableLayerBranch",er=i.forwardRef((e,t)=>{const n=i.useContext(_t),r=i.useRef(null),o=we(t,r);return i.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),b.jsx(ve.div,{...e,ref:o})});er.displayName=Qn;function tr(e,t=globalThis?.document){const n=Le(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let h=function(){Nt(Zn,n,d,{discrete:!0})};const d={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function nr(e,t=globalThis?.document){const n=Le(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&Nt(Jn,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Rt(){const e=new CustomEvent(Qe);document.dispatchEvent(e)}function Nt(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Kn(o,a):o.dispatchEvent(a)}var et="focusScope.autoFocusOnMount",tt="focusScope.autoFocusOnUnmount",Ot={bubbles:!1,cancelable:!0},rr="FocusScope",Pt=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=e,[s,h]=i.useState(null),d=Le(o),E=Le(a),y=i.useRef(null),C=we(t,g=>h(g)),_=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let g=function(M){if(_.paused||!s)return;const B=M.target;s.contains(B)?y.current=B:ge(y.current,{select:!0})},R=function(M){if(_.paused||!s)return;const B=M.relatedTarget;B!==null&&(s.contains(B)||ge(y.current,{select:!0}))},T=function(M){if(document.activeElement===document.body)for(const Y of M)Y.removedNodes.length>0&&ge(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",R);const j=new MutationObserver(T);return s&&j.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",R),j.disconnect()}}},[r,s,_.paused]),i.useEffect(()=>{if(s){At.add(_);const g=document.activeElement;if(!s.contains(g)){const T=new CustomEvent(et,Ot);s.addEventListener(et,d),s.dispatchEvent(T),T.defaultPrevented||(or(lr(Tt(s)),{select:!0}),document.activeElement===g&&ge(s))}return()=>{s.removeEventListener(et,d),setTimeout(()=>{const T=new CustomEvent(tt,Ot);s.addEventListener(tt,E),s.dispatchEvent(T),T.defaultPrevented||ge(g??document.body,{select:!0}),s.removeEventListener(tt,E),At.remove(_)},0)}}},[s,d,E,_]);const $=i.useCallback(g=>{if(!n&&!r||_.paused)return;const R=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,T=document.activeElement;if(R&&T){const j=g.currentTarget,[M,B]=ar(j);M&&B?!g.shiftKey&&T===B?(g.preventDefault(),n&&ge(M,{select:!0})):g.shiftKey&&T===M&&(g.preventDefault(),n&&ge(B,{select:!0})):T===j&&g.preventDefault()}},[n,r,_.paused]);return b.jsx(ve.div,{tabIndex:-1,...c,ref:C,onKeyDown:$})});Pt.displayName=rr;function or(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ge(r,{select:t}),document.activeElement!==n)return}function ar(e){const t=Tt(e),n=It(t,e),r=It(t.reverse(),e);return[n,r]}function Tt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function It(e,t){for(const n of e)if(!sr(n,{upTo:t}))return n}function sr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ir(e){return e instanceof HTMLInputElement&&"select"in e}function ge(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ir(e)&&t&&e.select()}}var At=cr();function cr(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Dt(e,t),e.unshift(t)},remove(t){e=Dt(e,t),e[0]?.resume()}}}function Dt(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lr(e){return e.filter(t=>t.tagName!=="A")}var ur="Portal",kt=i.forwardRef((e,t)=>{const{container:n,...r}=e,[o,a]=i.useState(!1);ke(()=>a(!0),[]);const c=n||o&&globalThis?.document?.body;return c?dt.createPortal(b.jsx(ve.div,{...r,ref:t}),c):null});kt.displayName=ur;function fr(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var Fe=e=>{const{present:t,children:n}=e,r=dr(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=we(r.ref,vr(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};Fe.displayName="Presence";function dr(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,h]=fr(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const d=We(r.current);a.current=s==="mounted"?d:"none"},[s]),ke(()=>{const d=r.current,E=o.current;if(E!==e){const C=a.current,_=We(d);e?h("MOUNT"):_==="none"||d?.display==="none"?h("UNMOUNT"):h(E&&C!==_?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),ke(()=>{if(t){let d;const E=t.ownerDocument.defaultView??window,y=_=>{const g=We(r.current).includes(CSS.escape(_.animationName));if(_.target===t&&g&&(h("ANIMATION_END"),!o.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",d=E.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},C=_=>{_.target===t&&(a.current=We(r.current))};return t.addEventListener("animationstart",C),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{E.clearTimeout(d),t.removeEventListener("animationstart",C),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:i.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function We(e){return e?.animationName||"none"}function vr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nt=0;function pr(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Lt()),document.body.insertAdjacentElement("beforeend",e[1]??Lt()),nt++,()=>{nt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),nt--}},[])}function Lt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var fe=function(){return fe=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},fe.apply(this,arguments)};function jt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function mr(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var $e="right-scroll-bar-position",Be="width-before-scroll-bar",hr="with-scroll-bars-hidden",gr="--removed-body-scroll-bar-size";function rt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yr(e,t){var n=G.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var br=typeof window<"u"?i.useLayoutEffect:i.useEffect,Mt=new WeakMap;function Er(e,t){var n=yr(null,function(r){return e.forEach(function(o){return rt(o,r)})});return br(function(){var r=Mt.get(n);if(r){var o=new Set(r),a=new Set(e),c=n.current;o.forEach(function(s){a.has(s)||rt(s,null)}),a.forEach(function(s){o.has(s)||rt(s,c)})}Mt.set(n,e)},[e]),n}function xr(e){return e}function wr(e,t){t===void 0&&(t=xr);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var c=t(a,r);return n.push(c),function(){n=n.filter(function(s){return s!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var s=n;n=[],s.forEach(a),c=n}var h=function(){var E=c;c=[],E.forEach(a)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(E){c.push(E),d()},filter:function(E){return c=c.filter(E),n}}}};return o}function Sr(e){e===void 0&&(e={});var t=wr(null);return t.options=fe({async:!0,ssr:!1},e),t}var Ft=function(e){var t=e.sideCar,n=jt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,fe({},n))};Ft.isSideCarExport=!0;function _r(e,t){return e.useMedium(t),Ft}var Wt=Sr(),ot=function(){},Ue=i.forwardRef(function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:ot,onWheelCapture:ot,onTouchMoveCapture:ot}),o=r[0],a=r[1],c=e.forwardProps,s=e.children,h=e.className,d=e.removeScrollBar,E=e.enabled,y=e.shards,C=e.sideCar,_=e.noRelative,$=e.noIsolation,g=e.inert,R=e.allowPinchZoom,T=e.as,j=T===void 0?"div":T,M=e.gapMode,B=jt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),Y=C,X=Er([n,t]),I=fe(fe({},B),o);return i.createElement(i.Fragment,null,E&&i.createElement(Y,{sideCar:Wt,removeScrollBar:d,shards:y,noRelative:_,noIsolation:$,inert:g,setCallbacks:a,allowPinchZoom:!!R,lockRef:n,gapMode:M}),c?i.cloneElement(i.Children.only(s),fe(fe({},I),{ref:X})):i.createElement(j,fe({},I,{className:h,ref:X}),s))});Ue.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ue.classNames={fullWidth:Be,zeroRight:$e};var Cr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Cr();return t&&e.setAttribute("nonce",t),e}function Nr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Or(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Pr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rr())&&(Nr(t,n),Or(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Tr=function(){var e=Pr();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$t=function(){var e=Tr(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ir={left:0,top:0,right:0,gap:0},at=function(e){return parseInt(e||"",10)||0},Ar=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[at(n),at(r),at(o)]},Dr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ir;var t=Ar(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},kr=$t(),Ce="data-scroll-locked",Lr=function(e,t,n,r){var o=e.left,a=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
7
7
|
.`.concat(hr,` {
|
|
8
8
|
overflow: hidden `).concat(r,`;
|
|
9
9
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '../engine';
|
|
2
|
+
export type ShortcutConfig = {
|
|
3
|
+
key: string;
|
|
4
|
+
shift?: boolean;
|
|
5
|
+
alt?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type GlyphXProps = {
|
|
8
|
+
commands: Command[];
|
|
9
|
+
open?: boolean;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
shortcut?: ShortcutConfig;
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SearchResult } from '../engine/search';
|
|
2
|
+
import { Command } from '../engine';
|
|
3
|
+
export type GroupedResults = {
|
|
4
|
+
group: string;
|
|
5
|
+
items: SearchResult<Command>[];
|
|
6
|
+
}[];
|
|
7
|
+
export declare function groupResults(results: SearchResult<Command>[]): GroupedResults;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from '../engine';
|
|
2
|
+
import { NormalizedCommand } from '../engine/normalize';
|
|
3
|
+
import { SearchResult } from '../engine/search';
|
|
4
|
+
type PaletteState = {
|
|
5
|
+
commands: Command[];
|
|
6
|
+
normalized: NormalizedCommand[];
|
|
7
|
+
results: SearchResult<NormalizedCommand>[];
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
query: string;
|
|
10
|
+
selectedIndex: number;
|
|
11
|
+
registerCommands: (commands: Command[]) => void;
|
|
12
|
+
setQuery: (query: string) => void;
|
|
13
|
+
selectNext: () => void;
|
|
14
|
+
selectPrev: () => void;
|
|
15
|
+
selectFirst: () => void;
|
|
16
|
+
open: () => void;
|
|
17
|
+
close: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const usePaletteStore: import('zustand').UseBoundStore<import('zustand').StoreApi<PaletteState>>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function CommandDialog({ open, onOpenChange, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CommandInput(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from '../engine';
|
|
2
|
+
type Props = {
|
|
3
|
+
command: Command;
|
|
4
|
+
titleIndexes: readonly number[] | null;
|
|
5
|
+
subtitleIndexes: readonly number[] | null;
|
|
6
|
+
index: number;
|
|
7
|
+
};
|
|
8
|
+
declare function CommandItemImpl({ command, titleIndexes, subtitleIndexes, index }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const CommandItem: import('react').MemoExoticComponent<typeof CommandItemImpl>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CommandList(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function highlightText(text: string, indexes: readonly number[] | null): string | import("react/jsx-runtime").JSX.Element[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glyphx",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A fast, keyboard-first, Spotlight-style command palette for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"typescript": "~5.9.3",
|
|
57
57
|
"typescript-eslint": "^8.46.4",
|
|
58
58
|
"vite": "^7.2.4",
|
|
59
|
+
"vite-plugin-dts": "^5.0.2",
|
|
59
60
|
"vitest": "^4.1.8"
|
|
60
61
|
},
|
|
61
62
|
"keywords": [
|