glyphx 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -0
- package/dist/index.js +2398 -0
- package/dist/index.umd.cjs +84 -0
- package/dist/vite.svg +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
(function(me,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],G):(me=typeof globalThis<"u"?globalThis:me||self,G(me.Glyph={},me.React,me.ReactDOM))})(this,(function(me,G,dt){"use strict";function vt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=vt(G),vn=vt(dt);function pn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var je={exports:{}},Ie={};var pt;function mn(){if(pt)return Ie;pt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,a){var c=null;if(a!==void 0&&(c=""+a),o.key!==void 0&&(c=""+o.key),"key"in o){a={};for(var s in o)s!=="key"&&(a[s]=o[s])}else a=o;return o=a.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:a}}return Ie.Fragment=t,Ie.jsx=n,Ie.jsxs=n,Ie}var De={};var mt;function hn(){return mt||(mt=1,process.env.NODE_ENV!=="production"&&(function(){function e(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===Q?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case R:return"Fragment";case j:return"Profiler";case T:return"StrictMode";case X:return"Suspense";case A:return"SuspenseList";case ce:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case g:return"Portal";case B:return f.displayName||"Context";case M:return(f._context.displayName||"Context")+".Consumer";case Y:var P=f.render;return f=f.displayName,f||(f=P.displayName||P.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case K:return P=f.displayName||null,P!==null?P:e(f.type)||"Memo";case re:P=f._payload,f=f._init;try{return e(f(P))}catch{}}return null}function t(f){return""+f}function n(f){try{t(f);var P=!1}catch{P=!0}if(P){P=console;var U=P.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return U.call(P,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),t(f)}}function r(f){if(f===R)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===re)return"<...>";try{var P=e(f);return P?"<"+P+">":"<...>"}catch{return"<...>"}}function o(){var f=ae.A;return f===null?null:f.getOwner()}function a(){return Error("react-stack-top-frame")}function c(f){if(Ne.call(f,"key")){var P=Object.getOwnPropertyDescriptor(f,"key").get;if(P&&P.isReactWarning)return!1}return f.key!==void 0}function s(f,P){function U(){de||(de=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",P))}U.isReactWarning=!0,Object.defineProperty(f,"key",{get:U,configurable:!0})}function h(){var f=e(this.type);return Te[f]||(Te[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function d(f,P,U,l,u,v){var p=U.ref;return f={$$typeof:$,type:f,key:P,props:U,_owner:l},(p!==void 0?p:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:h}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:u}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:v}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function E(f,P,U,l,u,v){var p=P.children;if(p!==void 0)if(l)if(ye(p)){for(l=0;l<p.length;l++)y(p[l]);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(p);if(Ne.call(P,"key")){p=e(f);var w=Object.keys(P).filter(function(m){return m!=="key"});l=0<w.length?"{key: someKey, "+w.join(": ..., ")+": ...}":"{key: someKey}",H[p+l]||(w=0<w.length?"{"+w.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,l,p,w,p),H[p+l]=!0)}if(p=null,U!==void 0&&(n(U),p=""+U),c(P)&&(n(P.key),p=""+P.key),"key"in P){U={};for(var x in P)x!=="key"&&(U[x]=P[x])}else U=P;return p&&s(U,typeof f=="function"?f.displayName||f.name||"Unknown":f),d(f,p,U,o(),u,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"),A=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,Ne=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)(),Ae=be(r(a)),H={};De.Fragment=R,De.jsx=function(f,P,U){var l=1e4>ae.recentlyCreatedOwnerStacks++;return E(f,P,U,!1,l?Error("react-stack-top-frame"):ee,l?be(r(f)):Ae)},De.jsxs=function(f,P,U){var l=1e4>ae.recentlyCreatedOwnerStacks++;return E(f,P,U,!0,l?Error("react-stack-top-frame"):ee,l?be(r(f)):Ae)}})()),De}var ht;function gn(){return ht||(ht=1,process.env.NODE_ENV==="production"?je.exports=mn():je.exports=hn()),je.exports}var b=gn();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},yn=(e=>e?gt(e):gt),bn=e=>e;function En(e,t=bn){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=yn(e),n=r=>En(t,r);return Object.assign(n,t),n},xn=(e=>e?yt(e):yt);function wn(e){return e.map(t=>{const n=[t.title,t.subtitle,...t.keywords??[]];return{...t,searchText:n.join(" ").toLowerCase()}})}var Me={exports:{}},Sn=Me.exports,bt;function _n(){return bt||(bt=1,(function(e){((t,n)=>{e.exports?e.exports=n():t.fuzzysort=n()})(Sn,t=>{var n=(l,u)=>{if(!l||!u)return H;var v=$(l);de(u)||(u=_(u));var p=v.bitflags;return(p&u._bitflags)!==p?H:R(v,u)},r=(l,u,v)=>{if(!l)return v?.all?g(u,v):Ae;var p=$(l),w=p.bitflags,x=p.containsSpace,m=y(v?.threshold||0),O=v?.limit||Te,S=0,k=0,I=u.length;function se(_e){S<O?(U.add(_e),++S):(++k,_e._score>U.peek()._score&&U.replaceTop(_e))}if(v?.key)for(var te=v.key,L=0;L<I;++L){var oe=u[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,ue=Ee.length;e:for(var L=0;L<I;++L){var oe=u[L];{for(var ne=0,D=0;D<ue;++D){var te=Ee[D],F=be(oe,te);if(!F){Ne[D]=f;continue}de(F)||(F=_(F)),Ne[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<ue;++D){if(F=Ne[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 N=!1;for(let W=0;W<ue;W++)if(ye[W]._score!==ee){N=!0;break}if(!N)continue}var ie=new h(ue);for(let W=0;W<ue;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<ue;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<I;++L){var F=u[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 Ae;for(var xe=new Array(S),L=S-1;L>=0;--L)xe[L]=U.poll();return xe.total=S+k,xe},o=(l,u="<b>",v="</b>")=>{for(var p=typeof u=="function"?u:void 0,w=l.target,x=w.length,m=l.indexes,O="",S=0,k=0,I=!1,se=[],te=0;te<x;++te){var L=w[te];if(m[k]===te){if(++k,I||(I=!0,p?(se.push(O),O=""):O+=u),k===m.length){p?(O+=L,se.push(p(O,S++)),O="",se.push(w.substr(te+1))):O+=L+v+w.substr(te+1);break}}else I&&(I=!1,p?(se.push(p(O,S++)),O=""):O+=v);O+=L}return p?se:O},a=l=>{typeof l=="number"?l=""+l:typeof l!="string"&&(l="");var u=M(l);return d(l,{_targetLower:u._lower,_targetLowerCodes:u.lowerCodes,_bitflags:u.bitflags})},c=()=>{X.clear(),A.clear()};class s{get indexes(){return this._indexes.slice(0,this._indexes.len).sort((u,v)=>u-v)}set indexes(u){return this._indexes=u}highlight(u,v){return o(this,u,v)}get score(){return E(this._score)}set score(u){this._score=y(u)}}class h extends Array{get score(){return E(this._score)}set score(u){this._score=y(u)}}var d=(l,u)=>{const v=new s;return v.target=l,v.obj=u.obj??H,v._score=u._score??ee,v._indexes=u._indexes??[],v._targetLower=u._targetLower??"",v._targetLowerCodes=u._targetLowerCodes??H,v._nextBeginningIndexes=u._nextBeginningIndexes??H,v._bitflags=u._bitflags??0,v},E=l=>l===ee?0:l>1?l:Math.E**(((-l+1)**.04307-1)*-2),y=l=>l===0?ee:l>1?l:1-Math.pow(Math.log(l)/-2+1,1/.04307),C=l=>{typeof l=="number"?l=""+l:typeof l!="string"&&(l=""),l=l.trim();var u=M(l),v=[];if(u.containsSpace){var p=l.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:u.lowerCodes,_lower:u._lower,containsSpace:u.containsSpace,bitflags:u.bitflags,spaceSearches:v}},_=l=>{if(l.length>999)return a(l);var u=X.get(l);return u!==void 0||(u=a(l),X.set(l,u)),u},$=l=>{if(l.length>999)return C(l);var u=A.get(l);return u!==void 0||(u=C(l),A.set(l,u)),u},g=(l,u)=>{var v=[];v.total=l.length;var p=u?.limit||Te;if(u?.key)for(var w=0;w<l.length;w++){var x=l[w],m=be(x,u.key);if(m!=H){de(m)||(m=_(m));var O=d(m.target,{_score:m._score,obj:x});if(v.push(O),v.length>=p)return v}}else if(u?.keys)for(var w=0;w<l.length;w++){for(var x=l[w],S=new h(u.keys.length),k=u.keys.length-1;k>=0;--k){var m=be(x,u.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<l.length;w++){var m=l[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=(l,u,v=!1,p=!1)=>{if(v===!1&&l.containsSpace)return T(l,u,p);for(var w=l._lower,x=l.lowerCodes,m=x[0],O=u._targetLowerCodes,S=x.length,k=O.length,L=0,I=0,se=0;;){var te=m===O[I];if(te){if(K[se++]=I,++L,L===S)break;m=x[L]}if(++I,I>=k)return H}var L=0,oe=!1,F=0,z=u._nextBeginningIndexes;z===H&&(z=u._nextBeginningIndexes=Y(u.target)),I=K[0]===0?0:z[K[0]-1];var Ee=0;if(I!==k)for(;;)if(I>=k){if(L<=0||(++Ee,Ee>200))break;--L;var ue=re[--F];I=z[ue]}else{var te=x[L]===O[I];if(te){if(re[F++]=I,++L,L===S){oe=!0;break}++I}else I=z[I]}var ne=S<=1?-1:u._targetLower.indexOf(w,K[0]),D=!!~ne,Z=D?ne===0||u._nextBeginningIndexes[ne-1]===ne:!1;if(D&&!Z){for(var N=0;N<z.length;N=z[N])if(!(N<=ne)){for(var ie=0;ie<S&&x[ie]===u._targetLowerCodes[N+ie];ie++);if(ie===S){ne=N,Z=!0;break}}}var q=W=>{for(var V=0,dn=0,pe=1;pe<S;++pe)W[pe]-W[pe-1]!==1&&(V-=W[pe],++dn);var Wo=W[S-1]-W[0]-(S-1);if(V-=(12+Wo)*dn,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 N=0;N<S;++N)K[N]=ne+N;var xe=K,_e=q(K)}else var xe=re,_e=q(re);else{if(D)for(var N=0;N<S;++N)K[N]=ne+N;var xe=K,_e=q(xe)}u._score=_e;for(var N=0;N<S;++N)u._indexes[N]=xe[N];u._indexes.len=S;const Xe=new s;return Xe.target=u.target,Xe._score=u._score,Xe._indexes=u._indexes,Xe},T=(l,u,v)=>{for(var p=new Set,w=0,x=H,m=0,O=l.spaceSearches,S=O.length,k=0,I=()=>{for(let Z=k-1;Z>=0;Z--)u._nextBeginningIndexes[ce[Z*2+0]]=ce[Z*2+1]},se=!1,D=0;D<S;++D){ae[D]=ee;var te=O[D];if(x=R(te,u),v){if(x===H)continue;se=!0}else if(x===H)return I(),H;var L=D===S-1;if(!L){var oe=x._indexes,F=!0;for(let N=0;N<oe.len-1;N++)if(oe[N+1]-oe[N]!==1){F=!1;break}if(F){var z=oe[oe.len-1]+1,Ee=u._nextBeginningIndexes[z-1];for(let N=z-1;N>=0&&Ee===u._nextBeginningIndexes[N];N--)u._nextBeginningIndexes[N]=z,ce[k*2+0]=N,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 ue=0;ue<x._indexes.len;++ue)p.add(x._indexes[ue])}if(v&&!se)return H;I();var ne=R(l,u,!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=u),x._score=w;var D=0;for(let Z of p)x._indexes[D++]=Z;return x._indexes.len=D,x},j=l=>l.replace(new RegExp("\\p{Script=Latin}+","gu"),u=>u.normalize("NFD")).replace(/[\u0300-\u036f]/g,""),M=l=>{l=j(l);for(var u=l.length,v=l.toLowerCase(),p=[],w=0,x=!1,m=0;m<u;++m){var O=p[m]=v.charCodeAt(m);if(O===32){x=!0;continue}var S=O>=97&&O<=122?O-97:O>=48&&O<=57?26:O<=127?30:31;w|=1<<S}return{lowerCodes:p,bitflags:w,containsSpace:x,_lower:v}},B=l=>{for(var u=l.length,v=[],p=0,w=!1,x=!1,m=0;m<u;++m){var O=l.charCodeAt(m),S=O>=65&&O<=90,k=S||O>=97&&O<=122||O>=48&&O<=57,I=S&&!w||!x||!k;w=S,x=k,I&&(v[p++]=m)}return v},Y=l=>{l=j(l);for(var u=l.length,v=B(l),p=[],w=v[0],x=0,m=0;m<u;++m)w>m?p[m]=w:(w=v[++x],p[m]=w===void 0?u:w);return p},X=new Map,A=new Map,K=[],re=[],ce=[],Q=[],ae=[],Ne=[],ye=[],be=(l,u)=>{var v=l[u];if(v!==void 0)return v;if(typeof u=="function")return u(l);var p=u;Array.isArray(u)||(p=u.split("."));for(var w=p.length,x=-1;l&&++x<w;)l=l[p[x]];return l},de=l=>typeof l=="object"&&typeof l._bitflags=="number",Te=1/0,ee=-Te,Ae=[];Ae.total=0;var H=null,f=a(""),P=l=>{var u=[],v=0,p={},w=x=>{for(var m=0,O=u[m],S=1;S<v;){var k=S+1;m=S,k<v&&u[k]._score<u[S]._score&&(m=k),u[m-1>>1]=u[m],S=1+(m<<1)}for(var I=m-1>>1;m>0&&O._score<u[I]._score;I=(m=I)-1>>1)u[m]=u[I];u[m]=O};return p.add=(x=>{var m=v;u[v++]=x;for(var O=m-1>>1;m>0&&x._score<u[O]._score;O=(m=O)-1>>1)u[m]=u[O];u[m]=x}),p.poll=(x=>{if(v!==0){var m=u[0];return u[0]=u[--v],w(),m}}),p.peek=(x=>{if(v!==0)return u[0]}),p.replaceTop=(x=>{u[0]=x,w()}),p},U=P();return{single:n,go:r,prepare:a,cleanup:c}})})(Me)),Me.exports}var Cn=_n();const Rn=pn(Cn);function On(e,t){return t.trim()?Rn.go(t,e,{key:"searchText",threshold:-1e3}).map(r=>({item:r.obj,indexes:r.indexes})):e.map(r=>({item:r,indexes:null}))}async function Pn(e){try{await e.run()}catch(t){console.error(`[command-palette] Command failed: ${e.id}`,t)}}const J=xn((e,t)=>({commands:[],normalized:[],results:[],query:"",isOpen:!1,selectedIndex:0,registerCommands:n=>{const r=wn(n);e({commands:n,normalized:r,results:r.map(o=>({item:o,indexes:null})),selectedIndex:0})},setQuery:n=>{const{normalized:r}=t(),o=On(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({isOpen:!1,query:"",selectedIndex:0})}));function Nn(e){G.useEffect(()=>{const t=n=>{const r=n.key.toLowerCase()==="k";if(navigator.platform.startsWith("Mac")){n.metaKey&&r&&(n.preventDefault(),e());return}n.ctrlKey&&r&&(n.preventDefault(),e())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e])}function he(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Et(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=Et(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():Et(e[o],null)}}}}function we(...e){return i.useCallback(Ze(...e),e)}function Tn(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 An(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,In(o,...t)]}function In(...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:()=>{},Dn=i[" useId ".trim().toString()]||(()=>{}),kn=0;function Je(e){const[t,n]=i.useState(Dn());return ke(()=>{n(r=>r??String(kn++))},[e]),e||(t?`radix-${t}`:"")}var Ln=i[" useInsertionEffect ".trim().toString()]||ke;function jn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,c]=Mn({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=Fn(E)?E(e):E;y!==e&&c.current?.(y)}else a(E)},[s,e,a,c]);return[h,d]}function Mn({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),a=i.useRef(t);return Ln(()=>{a.current=t},[t]),i.useEffect(()=>{o.current!==n&&(a.current?.(n),o.current=n)},[n,o]),[n,r,a]}function Fn(e){return typeof e=="function"}function xt(e){const t=Wn(e),n=i.forwardRef((r,o)=>{const{children:a,...c}=r,s=i.Children.toArray(a),h=s.find(Bn);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 Wn(e){const t=i.forwardRef((n,r)=>{const{children:o,...a}=n;if(i.isValidElement(o)){const c=zn(o),s=Un(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 $n=Symbol("radix.slottable");function Bn(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$n}function Un(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 zn(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 Vn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=Vn.reduce((e,t)=>{const n=xt(`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 Yn(e,t){e&&vn.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 Hn(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 Gn="DismissableLayer",Qe="dismissableLayer.update",Kn="dismissableLayer.pointerDownOutside",qn="dismissableLayer.focusOutside",wt,St=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_t=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:s,...h}=e,d=i.useContext(St),[E,y]=i.useState(null),C=E?.ownerDocument??globalThis?.document,[,_]=i.useState({}),$=we(t,A=>y(A)),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=Jn(A=>{const K=A.target,re=[...d.branches].some(ce=>ce.contains(K));!B||re||(o?.(A),c?.(A),A.defaultPrevented||s?.())},C),X=Qn(A=>{const K=A.target;[...d.branches].some(ce=>ce.contains(K))||(a?.(A),c?.(A),A.defaultPrevented||s?.())},C);return Hn(A=>{j===d.layers.size-1&&(r?.(A),!A.defaultPrevented&&s&&(A.preventDefault(),s()))},C),i.useEffect(()=>{if(E)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(wt=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(E)),d.layers.add(E),Ct(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=wt)}},[E,C,n,d]),i.useEffect(()=>()=>{E&&(d.layers.delete(E),d.layersWithOutsidePointerEventsDisabled.delete(E),Ct())},[E,d]),i.useEffect(()=>{const A=()=>_({});return document.addEventListener(Qe,A),()=>document.removeEventListener(Qe,A)},[]),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)})});_t.displayName=Gn;var Xn="DismissableLayerBranch",Zn=i.forwardRef((e,t)=>{const n=i.useContext(St),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})});Zn.displayName=Xn;function Jn(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(){Rt(Kn,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 Qn(e,t=globalThis?.document){const n=Le(e),r=i.useRef(!1);return i.useEffect(()=>{const o=a=>{a.target&&!r.current&&Rt(qn,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 Ct(){const e=new CustomEvent(Qe);document.dispatchEvent(e)}function Rt(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?Yn(o,a):o.dispatchEvent(a)}var et="focusScope.autoFocusOnMount",tt="focusScope.autoFocusOnUnmount",Ot={bubbles:!1,cancelable:!0},er="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||(tr(sr(Nt(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]=nr(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=er;function tr(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ge(r,{select:t}),document.activeElement!==n)return}function nr(e){const t=Nt(e),n=Tt(t,e),r=Tt(t.reverse(),e);return[n,r]}function Nt(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 Tt(e,t){for(const n of e)if(!rr(n,{upTo:t}))return n}function rr(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 or(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&&or(e)&&t&&e.select()}}var At=ar();function ar(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=It(e,t),e.unshift(t)},remove(t){e=It(e,t),e[0]?.resume()}}}function It(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sr(e){return e.filter(t=>t.tagName!=="A")}var ir="Portal",Dt=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});Dt.displayName=ir;function cr(e,t){return i.useReducer((n,r)=>t[n][r]??n,e)}var Fe=e=>{const{present:t,children:n}=e,r=ur(t),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),a=we(r.ref,lr(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:a}):null};Fe.displayName="Presence";function ur(e){const[t,n]=i.useState(),r=i.useRef(null),o=i.useRef(e),a=i.useRef("none"),c=e?"mounted":"unmounted",[s,h]=cr(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 lr(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 fr(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kt()),document.body.insertAdjacentElement("beforeend",e[1]??kt()),nt++,()=>{nt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),nt--}},[])}function kt(){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 Lt(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 dr(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",vr="with-scroll-bars-hidden",pr="--removed-body-scroll-bar-size";function rt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mr(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 hr=typeof window<"u"?i.useLayoutEffect:i.useEffect,jt=new WeakMap;function gr(e,t){var n=mr(null,function(r){return e.forEach(function(o){return rt(o,r)})});return hr(function(){var r=jt.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)})}jt.set(n,e)},[e]),n}function yr(e){return e}function br(e,t){t===void 0&&(t=yr);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 Er(e){e===void 0&&(e={});var t=br(null);return t.options=fe({async:!0,ssr:!1},e),t}var Mt=function(e){var t=e.sideCar,n=Lt(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))};Mt.isSideCarExport=!0;function xr(e,t){return e.useMedium(t),Mt}var Ft=Er(),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=Lt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),Y=C,X=gr([n,t]),A=fe(fe({},B),o);return i.createElement(i.Fragment,null,E&&i.createElement(Y,{sideCar:Ft,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({},A),{ref:X})):i.createElement(j,fe({},A,{className:h,ref:X}),s))});Ue.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ue.classNames={fullWidth:Be,zeroRight:$e};var wr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Sr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wr();return t&&e.setAttribute("nonce",t),e}function _r(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Cr(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Rr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sr())&&(_r(t,n),Cr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Or=function(){var e=Rr();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Wt=function(){var e=Or(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Pr={left:0,top:0,right:0,gap:0},at=function(e){return parseInt(e||"",10)||0},Nr=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)]},Tr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pr;var t=Nr(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])}},Ar=Wt(),Ce="data-scroll-locked",Ir=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
|
+
.`.concat(vr,` {
|
|
8
|
+
overflow: hidden `).concat(r,`;
|
|
9
|
+
padding-right: `).concat(s,"px ").concat(r,`;
|
|
10
|
+
}
|
|
11
|
+
body[`).concat(Ce,`] {
|
|
12
|
+
overflow: hidden `).concat(r,`;
|
|
13
|
+
overscroll-behavior: contain;
|
|
14
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
15
|
+
padding-left: `.concat(o,`px;
|
|
16
|
+
padding-top: `).concat(a,`px;
|
|
17
|
+
padding-right: `).concat(c,`px;
|
|
18
|
+
margin-left:0;
|
|
19
|
+
margin-top:0;
|
|
20
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
21
|
+
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.`).concat($e,` {
|
|
25
|
+
right: `).concat(s,"px ").concat(r,`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.`).concat(Be,` {
|
|
29
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.`).concat($e," .").concat($e,` {
|
|
33
|
+
right: 0 `).concat(r,`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.`).concat(Be," .").concat(Be,` {
|
|
37
|
+
margin-right: 0 `).concat(r,`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
body[`).concat(Ce,`] {
|
|
41
|
+
`).concat(pr,": ").concat(s,`px;
|
|
42
|
+
}
|
|
43
|
+
`)},$t=function(){var e=parseInt(document.body.getAttribute(Ce)||"0",10);return isFinite(e)?e:0},Dr=function(){i.useEffect(function(){return document.body.setAttribute(Ce,($t()+1).toString()),function(){var e=$t()-1;e<=0?document.body.removeAttribute(Ce):document.body.setAttribute(Ce,e.toString())}},[])},kr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Dr();var a=i.useMemo(function(){return Tr(o)},[o]);return i.createElement(Ar,{styles:Ir(a,!t,o,n?"":"!important")})},st=!1;if(typeof window<"u")try{var ze=Object.defineProperty({},"passive",{get:function(){return st=!0,!0}});window.addEventListener("test",ze,ze),window.removeEventListener("test",ze,ze)}catch{st=!1}var Re=st?{passive:!1}:!1,Lr=function(e){return e.tagName==="TEXTAREA"},Bt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Lr(e)&&n[t]==="visible")},jr=function(e){return Bt(e,"overflowY")},Mr=function(e){return Bt(e,"overflowX")},Ut=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=zt(e,r);if(o){var a=Vt(e,r),c=a[1],s=a[2];if(c>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fr=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Wr=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},zt=function(e,t){return e==="v"?jr(t):Mr(t)},Vt=function(e,t){return e==="v"?Fr(t):Wr(t)},$r=function(e,t){return e==="h"&&t==="rtl"?-1:1},Br=function(e,t,n,r,o){var a=$r(e,window.getComputedStyle(t).direction),c=a*r,s=n.target,h=t.contains(s),d=!1,E=c>0,y=0,C=0;do{if(!s)break;var _=Vt(e,s),$=_[0],g=_[1],R=_[2],T=g-R-a*$;($||T)&&zt(e,s)&&(y+=T,C+=$);var j=s.parentNode;s=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!h&&s!==document.body||h&&(t.contains(s)||t===s));return(E&&Math.abs(y)<1||!E&&Math.abs(C)<1)&&(d=!0),d},Ve=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yt=function(e){return[e.deltaX,e.deltaY]},Ht=function(e){return e&&"current"in e?e.current:e},Ur=function(e,t){return e[0]===t[0]&&e[1]===t[1]},zr=function(e){return`
|
|
44
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
45
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
46
|
+
`)},Vr=0,Oe=[];function Yr(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(Vr++)[0],a=i.useState(Wt)[0],c=i.useRef(e);i.useEffect(function(){c.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=dr([e.lockRef.current],(e.shards||[]).map(Ht),!0).filter(Boolean);return g.forEach(function(R){return R.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=i.useCallback(function(g,R){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!c.current.allowPinchZoom;var T=Ve(g),j=n.current,M="deltaX"in g?g.deltaX:j[0]-T[0],B="deltaY"in g?g.deltaY:j[1]-T[1],Y,X=g.target,A=Math.abs(M)>Math.abs(B)?"h":"v";if("touches"in g&&A==="h"&&X.type==="range")return!1;var K=window.getSelection(),re=K&&K.anchorNode,ce=re?re===X||re.contains(X):!1;if(ce)return!1;var Q=Ut(A,X);if(!Q)return!0;if(Q?Y=A:(Y=A==="v"?"h":"v",Q=Ut(A,X)),!Q)return!1;if(!r.current&&"changedTouches"in g&&(M||B)&&(r.current=Y),!Y)return!0;var ae=r.current||Y;return Br(ae,R,g,ae==="h"?M:B)},[]),h=i.useCallback(function(g){var R=g;if(!(!Oe.length||Oe[Oe.length-1]!==a)){var T="deltaY"in R?Yt(R):Ve(R),j=t.current.filter(function(Y){return Y.name===R.type&&(Y.target===R.target||R.target===Y.shadowParent)&&Ur(Y.delta,T)})[0];if(j&&j.should){R.cancelable&&R.preventDefault();return}if(!j){var M=(c.current.shards||[]).map(Ht).filter(Boolean).filter(function(Y){return Y.contains(R.target)}),B=M.length>0?s(R,M[0]):!c.current.noIsolation;B&&R.cancelable&&R.preventDefault()}}},[]),d=i.useCallback(function(g,R,T,j){var M={name:g,delta:R,target:T,should:j,shadowParent:Hr(T)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(B){return B!==M})},1)},[]),E=i.useCallback(function(g){n.current=Ve(g),r.current=void 0},[]),y=i.useCallback(function(g){d(g.type,Yt(g),g.target,s(g,e.lockRef.current))},[]),C=i.useCallback(function(g){d(g.type,Ve(g),g.target,s(g,e.lockRef.current))},[]);i.useEffect(function(){return Oe.push(a),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:C}),document.addEventListener("wheel",h,Re),document.addEventListener("touchmove",h,Re),document.addEventListener("touchstart",E,Re),function(){Oe=Oe.filter(function(g){return g!==a}),document.removeEventListener("wheel",h,Re),document.removeEventListener("touchmove",h,Re),document.removeEventListener("touchstart",E,Re)}},[]);var _=e.removeScrollBar,$=e.inert;return i.createElement(i.Fragment,null,$?i.createElement(a,{styles:zr(o)}):null,_?i.createElement(kr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Hr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Gr=xr(Ft,Yr);var Gt=i.forwardRef(function(e,t){return i.createElement(Ue,fe({},e,{ref:t,sideCar:Gr}))});Gt.classNames=Ue.classNames;var Kr=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Pe=new WeakMap,Ye=new WeakMap,He={},it=0,Kt=function(e){return e&&(e.host||Kt(e.parentNode))},qr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Kt(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Xr=function(e,t,n,r){var o=qr(t,Array.isArray(e)?e:[e]);He[n]||(He[n]=new WeakMap);var a=He[n],c=[],s=new Set,h=new Set(o),d=function(y){!y||s.has(y)||(s.add(y),d(y.parentNode))};o.forEach(d);var E=function(y){!y||h.has(y)||Array.prototype.forEach.call(y.children,function(C){if(s.has(C))E(C);else try{var _=C.getAttribute(r),$=_!==null&&_!=="false",g=(Pe.get(C)||0)+1,R=(a.get(C)||0)+1;Pe.set(C,g),a.set(C,R),c.push(C),g===1&&$&&Ye.set(C,!0),R===1&&C.setAttribute(n,"true"),$||C.setAttribute(r,"true")}catch(T){console.error("aria-hidden: cannot operate on ",C,T)}})};return E(t),s.clear(),it++,function(){c.forEach(function(y){var C=Pe.get(y)-1,_=a.get(y)-1;Pe.set(y,C),a.set(y,_),C||(Ye.has(y)||y.removeAttribute(r),Ye.delete(y)),_||y.removeAttribute(n)}),it--,it||(Pe=new WeakMap,Pe=new WeakMap,Ye=new WeakMap,He={})}},Zr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Kr(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Xr(r,o,n,"aria-hidden")):function(){return null}},Ge="Dialog",[qt]=An(Ge),[Jr,le]=qt(Ge),Xt=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:c=!0}=e,s=i.useRef(null),h=i.useRef(null),[d,E]=jn({prop:r,defaultProp:o??!1,onChange:a,caller:Ge});return b.jsx(Jr,{scope:t,triggerRef:s,contentRef:h,contentId:Je(),titleId:Je(),descriptionId:Je(),open:d,onOpenChange:E,onOpenToggle:i.useCallback(()=>E(y=>!y),[E]),modal:c,children:n})};Xt.displayName=Ge;var Zt="DialogTrigger",Qr=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(Zt,n),a=we(t,o.triggerRef);return b.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":lt(o.open),...r,ref:a,onClick:he(e.onClick,o.onOpenToggle)})});Qr.displayName=Zt;var ct="DialogPortal",[eo,Jt]=qt(ct,{forceMount:void 0}),Qt=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=le(ct,t);return b.jsx(eo,{scope:t,forceMount:n,children:i.Children.map(r,c=>b.jsx(Fe,{present:n||a.open,children:b.jsx(Dt,{asChild:!0,container:o,children:c})}))})};Qt.displayName=ct;var Ke="DialogOverlay",en=i.forwardRef((e,t)=>{const n=Jt(Ke,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=le(Ke,e.__scopeDialog);return a.modal?b.jsx(Fe,{present:r||a.open,children:b.jsx(no,{...o,ref:t})}):null});en.displayName=Ke;var to=xt("DialogOverlay.RemoveScroll"),no=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(Ke,n);return b.jsx(Gt,{as:to,allowPinchZoom:!0,shards:[o.contentRef],children:b.jsx(ve.div,{"data-state":lt(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Se="DialogContent",tn=i.forwardRef((e,t)=>{const n=Jt(Se,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=le(Se,e.__scopeDialog);return b.jsx(Fe,{present:r||a.open,children:a.modal?b.jsx(ro,{...o,ref:t}):b.jsx(oo,{...o,ref:t})})});tn.displayName=Se;var ro=i.forwardRef((e,t)=>{const n=le(Se,e.__scopeDialog),r=i.useRef(null),o=we(t,n.contentRef,r);return i.useEffect(()=>{const a=r.current;if(a)return Zr(a)},[]),b.jsx(nn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:he(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:he(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,s=c.button===0&&c.ctrlKey===!0;(c.button===2||s)&&a.preventDefault()}),onFocusOutside:he(e.onFocusOutside,a=>a.preventDefault())})}),oo=i.forwardRef((e,t)=>{const n=le(Se,e.__scopeDialog),r=i.useRef(!1),o=i.useRef(!1);return b.jsx(nn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;n.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),nn=i.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...c}=e,s=le(Se,n),h=i.useRef(null),d=we(t,h);return fr(),b.jsxs(b.Fragment,{children:[b.jsx(Pt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:b.jsx(_t,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":lt(s.open),...c,ref:d,onDismiss:()=>s.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(so,{titleId:s.titleId}),b.jsx(co,{contentRef:h,descriptionId:s.descriptionId})]})]})}),ut="DialogTitle",rn=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(ut,n);return b.jsx(ve.h2,{id:o.titleId,...r,ref:t})});rn.displayName=ut;var on="DialogDescription",an=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(on,n);return b.jsx(ve.p,{id:o.descriptionId,...r,ref:t})});an.displayName=on;var sn="DialogClose",ao=i.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=le(sn,n);return b.jsx(ve.button,{type:"button",...r,ref:t,onClick:he(e.onClick,()=>o.onOpenChange(!1))})});ao.displayName=sn;function lt(e){return e?"open":"closed"}var cn="DialogTitleWarning",[$o,un]=Tn(cn,{contentName:Se,titleName:ut,docsSlug:"dialog"}),so=({titleId:e})=>{const t=un(cn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
47
|
+
|
|
48
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
49
|
+
|
|
50
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},io="DialogDescriptionWarning",co=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${un(io).contentName}}.`;return i.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},uo=Xt,lo=Qt,fo=en,vo=tn,po=rn,mo=an,ho=Symbol.for("react.lazy"),qe=i[" use ".trim().toString()];function go(e){return typeof e=="object"&&e!==null&&"then"in e}function ln(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ho&&"_payload"in e&&go(e._payload)}function yo(e){const t=bo(e),n=i.forwardRef((r,o)=>{let{children:a,...c}=r;ln(a)&&typeof qe=="function"&&(a=qe(a._payload));const s=i.Children.toArray(a),h=s.find(xo);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 bo(e){const t=i.forwardRef((n,r)=>{let{children:o,...a}=n;if(ln(o)&&typeof qe=="function"&&(o=qe(o._payload)),i.isValidElement(o)){const c=So(o),s=wo(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 Eo=Symbol("radix.slottable");function xo(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Eo}function wo(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 So(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 _o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Co=_o.reduce((e,t)=>{const n=yo(`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}},{}),Ro=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Oo="VisuallyHidden",fn=i.forwardRef((e,t)=>b.jsx(Co.span,{...e,ref:t,style:{...Ro,...e.style}}));fn.displayName=Oo;var Po=fn;function No({open:e,onOpenChange:t,children:n}){return b.jsx(uo,{open:e,onOpenChange:t,children:b.jsxs(lo,{children:[b.jsx(fo,{className:"fixed inset-0 bg-black/30 backdrop-blur-sm"}),b.jsx("div",{className:`
|
|
51
|
+
fixed left-1/2 top-[20%]
|
|
52
|
+
-translate-x-1/2
|
|
53
|
+
will-change-transform will-change-opacity
|
|
54
|
+
data-[state=open]:animate-[spotlight-in_180ms_cubic-bezier(0.16,1,0.3,1)]
|
|
55
|
+
data-[state=closed]:animate-[spotlight-out_120ms_ease-out]
|
|
56
|
+
`,"data-state":e?"open":"closed",children:b.jsxs(vo,{"aria-describedby":"command-palette-description",className:`
|
|
57
|
+
w-[520px] max-w-[90vw]
|
|
58
|
+
rounded-xl
|
|
59
|
+
border border-[rgb(var(--border))]
|
|
60
|
+
bg-[rgb(var(--glass))]
|
|
61
|
+
text-[rgb(var(--fg))]
|
|
62
|
+
backdrop-blur-xl
|
|
63
|
+
shadow-xl
|
|
64
|
+
`,children:[b.jsxs(Po,{children:[b.jsx(po,{children:"Command Palette"}),b.jsx(mo,{id:"command-palette-description",children:"Type to search and run commands"})]}),n]})})]})})}function To(){const e=J(r=>r.query),t=J(r=>r.setQuery),n=G.useRef(null);return G.useEffect(()=>{const r=requestAnimationFrame(()=>{n.current?.focus()});return()=>cancelAnimationFrame(r)},[]),b.jsx("input",{ref:n,value:e,onChange:r=>t(r.target.value),placeholder:"Type a command…",spellCheck:!1,autoComplete:"off",className:`
|
|
65
|
+
w-full
|
|
66
|
+
bg-transparent
|
|
67
|
+
px-3 py-2
|
|
68
|
+
text-sm
|
|
69
|
+
placeholder:text-[rgb(var(--muted))]
|
|
70
|
+
caret-color-[rgb(var(--fg))]
|
|
71
|
+
focus:outline-none
|
|
72
|
+
`})}function Ao(e){const t=new Map;for(const n of e){const r=n.item.group??"Other";t.has(r)||t.set(r,[]),t.get(r).push(n)}return Array.from(t.entries()).map(([n,r])=>({group:n,items:r}))}function Io(e,t){G.useEffect(()=>{t&&e.current&&e.current.scrollIntoView({block:"nearest",inline:"nearest"})},[t,e])}function Do(e,t){return!t||t.length===0?e:e.split("").map((n,r)=>t.includes(r)?b.jsx("span",{className:"text-blue-400",children:n},r):b.jsx("span",{children:n},r))}function ko({command:e,matchIndexes:t,index:n}){const r=J(s=>s.close),o=J(s=>s.selectedIndex),a=n===o,c=G.useRef(null);return Io(c,a),b.jsx("li",{children:b.jsxs("button",{ref:c,onClick:async()=>{await Pn(e),r()},className:`
|
|
73
|
+
flex w-full items-center justify-between
|
|
74
|
+
rounded-md px-3 py-2 text-left text-sm
|
|
75
|
+
${a?"bg-zinc-800 text-white":"text-zinc-100 hover:bg-zinc-800"}
|
|
76
|
+
`,children:[b.jsx("span",{children:Do(e.title,t)}),e.shortcut&&b.jsx("span",{className:"text-xs text-zinc-500",children:e.shortcut})]})})}function Lo(){const e=J(r=>r.results);if(e.length===0)return b.jsxs("div",{className:"px-3 py-8 text-center text-sm text-[rgb(var(--muted))]",children:[b.jsx("p",{children:"No matching commands"}),b.jsx("p",{className:"mt-1 text-xs",children:"Try a different keyword"})]});const t=Ao(e);let n=0;return b.jsx("div",{className:`max-h-64 overflow-y-auto transition-opacity
|
|
77
|
+
duration-150
|
|
78
|
+
opacity-100
|
|
79
|
+
data-[empty=true]:opacity-60`,children:t.map(({group:r,items:o})=>b.jsxs("div",{children:[b.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-zinc-500",children:r}),b.jsx("ul",{children:o.map(a=>{const c=n++;return b.jsx(ko,{command:a.item,matchIndexes:a.indexes,index:c},a.item.id)})})]},r))})}function jo(){const e=J(c=>c.isOpen),t=J(c=>c.close),n=J(c=>c.selectNext),r=J(c=>c.selectPrev),o=J(c=>c.results),a=J(c=>c.selectedIndex);G.useEffect(()=>{if(!e)return;const c=s=>{switch(s.key){case"ArrowDown":s.preventDefault(),n();break;case"ArrowUp":s.preventDefault(),r();break;case"Enter":s.preventDefault();const h=o[a];h&&(h.item.run(),t());break;case"Escape":s.preventDefault(),t();break}};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e,n,r,t,o,a])}function Mo({onOpenChange:e}){const t=J(r=>r.isOpen),n=J(r=>r.close);return jo(),b.jsx(No,{open:t,onOpenChange:r=>{r||n(),e?.(r)},children:b.jsxs("div",{className:"relative flex flex-col gap-2 p-2",children:[b.jsxs("span",{className:`
|
|
80
|
+
absolute right-3 top-3
|
|
81
|
+
text-xs text-[rgb(var(--muted))]
|
|
82
|
+
pointer-events-none
|
|
83
|
+
select-none
|
|
84
|
+
`,children:[b.jsx("kbd",{className:"rounded border px-1.5 py-0.5 text-[10px]",children:"Esc"})," to close"]}),b.jsx(To,{}),b.jsx(Lo,{})]})})}function Fo({commands:e,open:t,onOpenChange:n}){const r=J(c=>c.open),o=J(c=>c.close),a=J(c=>c.registerCommands);return Nn(()=>{n?.(!0),r()}),G.useEffect(()=>{a(e)},[e,a]),G.useEffect(()=>{t!==void 0&&(t?r():o())},[t,r,o]),b.jsx(Mo,{onOpenChange:c=>{n?.(c),c||o()}})}me.GlyphX=Fo,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "glyphx",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A fast, keyboard-first, Spotlight-style command palette for React",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": ["dist"],
|
|
11
|
+
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"preview": "vite preview"
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": "^18 || ^19",
|
|
27
|
+
"react-dom": "^18 || ^19"
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
32
|
+
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
33
|
+
"clsx": "^2.1.1",
|
|
34
|
+
"cmdk": "^1.1.1",
|
|
35
|
+
"fuzzysort": "^3.1.0",
|
|
36
|
+
"zustand": "^5.0.9"
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^9.39.1",
|
|
41
|
+
"@tailwindcss/cli": "^4.1.18",
|
|
42
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
43
|
+
"@types/node": "^24.10.1",
|
|
44
|
+
"@types/react": "^19.2.5",
|
|
45
|
+
"@types/react-dom": "^19.2.3",
|
|
46
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
47
|
+
"autoprefixer": "^10.4.23",
|
|
48
|
+
"eslint": "^9.39.1",
|
|
49
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
50
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
51
|
+
"globals": "^16.5.0",
|
|
52
|
+
"postcss": "^8.5.6",
|
|
53
|
+
"tailwindcss": "^4.1.18",
|
|
54
|
+
"typescript": "~5.9.3",
|
|
55
|
+
"typescript-eslint": "^8.46.4",
|
|
56
|
+
"vite": "^7.2.4"
|
|
57
|
+
}
|
|
58
|
+
}
|