@granularjs/ui 0.3.1 → 0.3.4
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/LICENSE +201 -0
- package/dist/granular-ui.min.js +46 -10
- package/dist/granular-ui.min.js.map +3 -3
- package/package.json +2 -2
- package/src/components/Accordion.js +7 -3
- package/src/components/Tabs.js +12 -8
- package/src/theme/styles.js +44 -8
- package/src/utils.js +2 -1
- package/types/utils.d.ts +1 -0
package/dist/granular-ui.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Et="granular-ui-styles",sa=new URL("./fonts/Poppins-400.ttf",import.meta.url).href,ua=new URL("./fonts/Poppins-500.ttf",import.meta.url).href,ga=new URL("./fonts/Poppins-600.ttf",import.meta.url).href,la=new URL("./fonts/Poppins-700.ttf",import.meta.url).href,ca=new URL("./fonts/Arimo-400.ttf",import.meta.url).href,pa=new URL("./fonts/Arimo-500.ttf",import.meta.url).href,da=new URL("./fonts/Arimo-600.ttf",import.meta.url).href,ma=new URL("./fonts/Arimo-700.ttf",import.meta.url).href,fa=new URL("./fonts/Inter-400.woff2",import.meta.url).href,ha=new URL("./fonts/Inter-500.woff2",import.meta.url).href,va=new URL("./fonts/Inter-600.woff2",import.meta.url).href,ba=new URL("./fonts/Inter-700.woff2",import.meta.url).href,xa=`
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: 'Poppins';
|
|
4
4
|
font-style: normal;
|
|
@@ -1306,6 +1306,45 @@ body .g-ui-card-shadow-lg { box-shadow: var(--g-ui-shadow-lg); }
|
|
|
1306
1306
|
color: var(--g-ui-primary-fg);
|
|
1307
1307
|
}
|
|
1308
1308
|
|
|
1309
|
+
.g-ui-tabs-vertical {
|
|
1310
|
+
display: grid;
|
|
1311
|
+
grid-template-columns: 200px 1fr;
|
|
1312
|
+
gap: var(--g-ui-space-16);
|
|
1313
|
+
}
|
|
1314
|
+
.g-ui-tabs-vertical .g-ui-tabs-list {
|
|
1315
|
+
flex-direction: column;
|
|
1316
|
+
}
|
|
1317
|
+
.g-ui-tabs-align-left .g-ui-tabs-list {
|
|
1318
|
+
justify-content: flex-start;
|
|
1319
|
+
}
|
|
1320
|
+
.g-ui-tabs-align-center .g-ui-tabs-list {
|
|
1321
|
+
justify-content: center;
|
|
1322
|
+
}
|
|
1323
|
+
.g-ui-tabs-align-right .g-ui-tabs-list {
|
|
1324
|
+
justify-content: flex-end;
|
|
1325
|
+
}
|
|
1326
|
+
.
|
|
1327
|
+
.g-ui-tabs-size-xs .g-ui-tabs-tab {
|
|
1328
|
+
padding: var(--g-ui-space-6) var(--g-ui-space-10);
|
|
1329
|
+
font-size: 12px;
|
|
1330
|
+
}
|
|
1331
|
+
.g-ui-tabs-size-sm .g-ui-tabs-tab {
|
|
1332
|
+
padding: var(--g-ui-space-8) var(--g-ui-space-12);
|
|
1333
|
+
font-size:
|
|
1334
|
+
}
|
|
1335
|
+
.g-ui-tabs-size-md .g-ui-tabs-tab {
|
|
1336
|
+
padding: var(--g-ui-space-10) var(--g-ui-space-14);
|
|
1337
|
+
font-size: 16px;
|
|
1338
|
+
}
|
|
1339
|
+
.g-ui-tabs-size-lg .g-ui-tabs-tab {
|
|
1340
|
+
padding: var(--g-ui-space-12) var(--g-ui-space-16);
|
|
1341
|
+
font-size: 18px;
|
|
1342
|
+
}
|
|
1343
|
+
.g-ui-tabs-size-xl .g-ui-tabs-tab {
|
|
1344
|
+
padding: var(--g-ui-space-14) var(--g-ui-space-20);
|
|
1345
|
+
font-size: 20px;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1309
1348
|
.g-ui-table {
|
|
1310
1349
|
width: 100%;
|
|
1311
1350
|
border-collapse: collapse;
|
|
@@ -2229,6 +2268,11 @@ body .g-ui-card-shadow-lg { box-shadow: var(--g-ui-shadow-lg); }
|
|
|
2229
2268
|
.g-ui-timeline-pin-size-md .g-ui-timeline-dot { width: 20px; height: 20px; border-width: 4px; }
|
|
2230
2269
|
.g-ui-timeline-pin-size-lg .g-ui-timeline-dot { width: 24px; height: 24px; border-width: 4px; }
|
|
2231
2270
|
.g-ui-timeline-pin-size-xl .g-ui-timeline-dot { width: 28px; height: 28px; border-width: 4px; }
|
|
2271
|
+
.g-ui-timeline-line-width-xs .g-ui-timeline-track-segment { width: 2px; left: 13px; }
|
|
2272
|
+
.g-ui-timeline-line-width-sm .g-ui-timeline-track-segment { width: 3px; }
|
|
2273
|
+
.g-ui-timeline-line-width-md .g-ui-timeline-track-segment { width: 4px; }
|
|
2274
|
+
.g-ui-timeline-line-width-lg .g-ui-timeline-track-segment { width: 6px; left: 11px; }
|
|
2275
|
+
.g-ui-timeline-line-width-xl .g-ui-timeline-track-segment { width: 10px; left: 9px; }
|
|
2232
2276
|
.g-ui-timeline-pin-radius-xs .g-ui-timeline-dot { border-radius: 2px; }
|
|
2233
2277
|
.g-ui-timeline-pin-radius-sm .g-ui-timeline-dot { border-radius: 4px; }
|
|
2234
2278
|
.g-ui-timeline-pin-radius-md .g-ui-timeline-dot { border-radius: 50%; }
|
|
@@ -2998,14 +3042,6 @@ body .g-ui-card-shadow-lg { box-shadow: var(--g-ui-shadow-lg); }
|
|
|
2998
3042
|
}
|
|
2999
3043
|
.g-ui-toast-title { font-weight: 600; }
|
|
3000
3044
|
|
|
3001
|
-
.g-ui-tabs-vertical {
|
|
3002
|
-
display: grid;
|
|
3003
|
-
grid-template-columns: 200px 1fr;
|
|
3004
|
-
gap: var(--g-ui-space-16);
|
|
3005
|
-
}
|
|
3006
|
-
.g-ui-tabs-vertical .g-ui-tabs-list {
|
|
3007
|
-
flex-direction: column;
|
|
3008
|
-
}
|
|
3009
3045
|
|
|
3010
3046
|
.g-ui-drawer-shadowed {
|
|
3011
3047
|
box-shadow: var(--g-ui-shadow);
|
|
@@ -4119,5 +4155,5 @@ body .g-ui-card-shadow-lg { box-shadow: var(--g-ui-shadow-lg); }
|
|
|
4119
4155
|
@keyframes g-ui-spin { to { transform: rotate(360deg); } }
|
|
4120
4156
|
@keyframes g-ui-bounce { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(-5px); opacity: 1; } }
|
|
4121
4157
|
@keyframes g-ui-bars { 0%, 100% { transform: scaleY(.6); } 50% { transform: scaleY(1.2); } }
|
|
4122
|
-
`;function Rt(){if(typeof document>"u"||document.getElementById(jt))return;let e=document.createElement("style");e.id=jt,e.textContent=xa,document.head.appendChild(e)}var wa=new Set(["--g-ui-bg","--g-ui-bg-subtle","--g-ui-bg-muted","--g-ui-bg-emphasized","--g-ui-bg-inverted","--g-ui-bg-panel","--g-ui-fg","--g-ui-fg-muted","--g-ui-fg-subtle","--g-ui-fg-inverted","--g-ui-border","--g-ui-border-subtle","--g-ui-border-emphasized","--g-ui-border-inverted","--g-ui-primary","--g-ui-primary-hover","--g-ui-primary-active","--g-ui-primary-subtle","--g-ui-primary-muted","--g-ui-primary-emphasized","--g-ui-success","--g-ui-success-hover","--g-ui-success-active","--g-ui-success-subtle","--g-ui-success-muted","--g-ui-danger","--g-ui-danger-hover","--g-ui-danger-active","--g-ui-danger-subtle","--g-ui-danger-muted","--g-ui-warning","--g-ui-warning-hover","--g-ui-warning-active","--g-ui-warning-subtle","--g-ui-warning-muted","--g-ui-info","--g-ui-info-hover","--g-ui-info-active","--g-ui-info-subtle","--g-ui-info-muted","--g-ui-shadow-xs","--g-ui-shadow-sm","--g-ui-shadow-md","--g-ui-shadow-lg","--g-ui-shadow-xl","--g-ui-shadow-2xl","--g-ui-radius","--g-ui-font","--g-ui-surface","--g-ui-text","--g-ui-muted","--g-ui-primary-strong","--g-ui-shadow"]);function ya(e={},i=document?.documentElement){if(i)for(let[t,r]of Object.entries(e)){let a=t.startsWith("--")?t:`--g-ui-${t}`;wa.has(a)&&i.style.setProperty(a,String(r))}}function ka(e="dark",i=document?.documentElement){i&&(i.classList.remove("g-ui-theme-dark","g-ui-theme-light"),i.classList.add(e==="light"?"g-ui-theme-light":"g-ui-theme-dark"))}function za(e=document?.documentElement){return e.classList.contains("g-ui-theme-light")?"light":"dark"}import{Renderer as Ht,isSignal as Wt,isState as Ot,isStatePath as qt,isComputed as Yt,resolve as Ee,computed as Na,after as qi,concat as Ca}from"@granularjs/core";function Yi(e){return Wt(e)||Ot(e)||qt(e)||Yt(e)}function s(...e){return Ca(...e,{separator:" ",filterFalsy:!0})}function Gt(e){if(!(e==null||e===""))return typeof e=="number"?`${e}px`:e}function g(e,i){let t={},r=[],a=o=>!!o&&typeof o=="object"&&!Array.isArray(o)&&!Ht.isRenderable(o)&&!Ht.isDomNode(o)&&!Wt(o)&&!Ot(o)&&!qt(o)&&!Yt(o);for(let o of e)a(o)?Object.assign(t,o):r.push(o);if(i&&typeof i=="object")for(let o of Object.keys(i))t[o]===void 0&&(t[o]=i[o]);return{props:Na(t),rawProps:t,children:r}}function m(e){return Ee(e)}function ke(e){return!!Ee(e)}function N(e,i,t){let r=a=>{let o=Ee(a),n=o==null||o===""?t:o;return n==null||n===""?"":`${e}${n}`};return Yi(i)?qi(i).compute(a=>r(a)):r(i)}function U(e,i){return Yi(i)?qi(i).compute(t=>Ee(t)?e:""):Ee(i)?e:""}function he(e,i,t){let r=a=>i[a]||null;return Yi(e)?qi(e).compute(a=>r(Ee(a??t))):r(Ee(e??t))}import{Button as Sa,Span as Gi,when as _i,after as Da}from"@granularjs/core";function Zi(...e){let{props:i,children:t}=g(e,{variant:"filled",size:"md",justify:"center"}),{variant:r,color:a,size:o,fullWidth:n,loading:u,leftSection:c,rightSection:d,className:p,disabled:w,justify:f,...l}=i,b=Da(w,u).compute(([z,$])=>z||$);return Sa({...l,disabled:b,className:s("g-ui-button",N("g-ui-button-variant-",r,"filled"),N("g-ui-button-color-",a,"primary"),N("g-ui-justify-",f,"center"),N("g-ui-button-size-",o,"md"),U("g-ui-button-full",n),U("g-ui-button-loading",u),p)},_i(c,()=>Gi({className:"g-ui-button-section-left"},c)),_i(u,()=>Gi("Loading..."),()=>t),_i(d,()=>Gi({className:"g-ui-button-section-right"},d)))}import{Span as Pa}from"@granularjs/core";function Ui(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,weight:a,color:o,dimmed:n,align:u,ellipsis:c,decoration:d,className:p,style:w,...f}=i,l=he(a,{bold:"g-ui-text-weight-700",semibold:"g-ui-text-weight-600",medium:"g-ui-text-weight-500",700:"g-ui-text-weight-700",600:"g-ui-text-weight-600",500:"g-ui-text-weight-500",400:"g-ui-text-weight-400"}),b=he(o,{primary:"g-ui-text-primary",success:"g-ui-text-success",danger:"g-ui-text-danger",muted:"g-ui-text-dimmed"}),z=he(u,{center:"g-ui-text-align-center",right:"g-ui-text-align-right",left:"g-ui-text-align-left"}),$=he(d,{underline:"g-ui-text-decoration-underline","line-through":"g-ui-text-decoration-line-through",overline:"g-ui-text-decoration-overline",none:"g-ui-text-decoration-none"});return Pa({...f,style:w,className:s("g-ui-text",N("g-ui-text-size-",r,"md"),U("g-ui-text-dimmed",n),U("g-ui-text-ellipsis",c),l,b,z,$,p)},t)}import{H1 as Ma,H2 as _t,H3 as Ta,H4 as Va,H5 as La,H6 as Ia}from"@granularjs/core";var $a={1:Ma,2:_t,3:Ta,4:Va,5:La,6:Ia};function Aa(...e){let{props:i,children:t}=g(e,{order:2}),{order:r,className:a,style:o,...n}=i,u=m(r)||2;return($a[u]||_t)({...n,className:s("g-ui-title",N("g-ui-title-order-",r,2),a)},t)}import{Div as Ba}from"@granularjs/core";function Fa(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,fluid:a,className:o,style:n,...u}=i;return Ba({...u,style:n,className:s("g-ui-container",U("g-ui-container-fluid",a),N("g-ui-container-size-",r,"md"),o)},t)}import{Div as Ea}from"@granularjs/core";function ja(...e){let{props:i,children:t}=g(e,{gap:"md"}),{gap:r,align:a,justify:o,className:n,style:u,...c}=i,d=he(o,{between:"g-ui-justify-between",center:"g-ui-justify-center",end:"g-ui-justify-end",start:"g-ui-justify-start"});return Ea({...c,style:u,className:s("g-ui-stack",N("g-ui-gap-",r,"md"),N("g-ui-align-",a),d,n)},t)}import{Div as Ra}from"@granularjs/core";function Ha(...e){let{props:i,children:t}=g(e,{gap:"md",align:"center"}),{gap:r,align:a,justify:o,position:n,noWrap:u,className:c,style:d,...p}=i,w=he(n,{apart:"g-ui-justify-between",center:"g-ui-justify-center",right:"g-ui-justify-end",left:"g-ui-justify-start"});return Ra({...p,style:d,className:s("g-ui-group",N("g-ui-gap-",r,"md"),N("g-ui-align-",a,"center"),N("g-ui-justify-",o,"none"),w,U("g-ui-no-wrap",u),c)},t)}import{Div as bi,list as Wa,when as Xi,after as Zt}from"@granularjs/core";function Oa(...e){let{props:i,children:t}=g(e,{padding:"md",radius:"md",shadow:"none",border:"default"}),{title:r,content:a,actions:o,border:n,padding:u,radius:c,shadow:d,className:p,style:w,...f}=i;return bi({style:w},Xi(r,()=>bi({className:"g-ui-card-title"},r)),Xi(a,()=>bi({className:"g-ui-card-content"},a)),{className:s("g-ui-card",N("g-ui-card-border-",n,"md"),N("g-ui-card-padding-",u,"md"),N("g-ui-card-radius-",c,"md"),N("g-ui-card-shadow-",d,"md"),p),...f},t,Xi(o,()=>bi({className:"g-ui-card-actions"},Wa(o,l=>Zi({className:"g-ui-card-action",onClick:b=>l.get().onClick?.(b),leftSection:l.leftSection,rightSection:l.rightSection,size:Zt(l.size).compute(b=>b||"sm"),variant:Zt(l.variant).compute(b=>b||"outline"),...l.get().props||{}},l.label)))))}import{Span as qa}from"@granularjs/core";function Ya(...e){let{props:i,children:t}=g(e,{variant:"filled",size:"md"}),{variant:r,size:a,className:o,dot:n,style:u,...c}=i,d=he(r,{dot:"g-ui-badge-dot"});return qa({...c,className:s("g-ui-badge",N("g-ui-badge-variant-",r,"filled"),N("g-ui-badge-size-",a,"md"),U("g-ui-badge-dot",n),d,o)},t)}import{Div as ii,Input as Ga,Textarea as _a,Label as Za,Span as Ua,when as ti,state as Xa,after as Ka,isState as Qa}from"@granularjs/core";function be(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,description:a,error:o,size:n,leftSection:u,rightSection:c,className:d,inputClassName:p,multiline:w,value:f,...l}=i,{value:b,node:z,onChange:$,onInput:D,onFocus:C,onBlur:P,onKeyDown:L,onKeyUp:y,onClick:k}=t,h=Qa(b)&&!$&&!D,S=h?b:Xa(m(f)??"");Ka(f).change(E=>{h||S.set(m(E)??"")});let V=E=>{let G=E?.target?.value??"";G!==f.get()&&(S.set(G),$?.(E),D?.(E))},A=ke(w),Q=A?_a:Ga,se=s(p,A&&"g-ui-textarea"),te=Q({...l,node:z,value:S,onInput:V,onChange:V,onFocus:C,onBlur:P,onKeyDown:L,onKeyUp:y,onClick:k,className:s("g-ui-input",se)});return ii({className:s("g-ui-text-input",d)},ti(r,()=>Za({className:"g-ui-text-input-label"},r)),ti(a,()=>Ua({className:"g-ui-text-input-description"},a)),ii({className:s("g-ui-input-wrapper",U("g-ui-input-multiline",w),N("g-ui-input-size-",n,"md"),U("g-ui-input-error",o))},ti(u,()=>ii({className:"g-ui-input-section"},u)),te,ti(c,()=>ii({className:"g-ui-input-section"},c))),ti(o,()=>ii({className:"g-ui-text-input-error-text"},o)))}function Ki(...e){let{props:i}=g(e,{size:"md"}),{size:t,leftSection:r,rightSection:a,className:o,...n}=i;return be({...n,size:t,className:o,leftSection:r,rightSection:a,multiline:!0})}import{Div as Ut,Span as Xt,after as je,state as Ja}from"@granularjs/core";function Qi(...e){let{props:i,rawProps:t}=g(e,{size:"md",step:1,allowDecimal:!0,allowNegative:!0,clampBehavior:"blur",hideControls:!1,decimalSeparator:".",thousandSeparator:"",format:null,prefix:"",suffix:""}),{value:r,min:a,max:o,step:n,size:u,allowDecimal:c,allowNegative:d,decimalSeparator:p,thousandSeparator:w,decimalScale:f,clampBehavior:l,hideControls:b,format:z,locale:$,currency:D,formatOptions:C,prefix:P,suffix:L,leftSection:y,rightSection:k,className:h,onChange:S,onInput:V,...A}=i,{onChange:Q,onInput:se,onBlur:te,onFocus:E,onKeyDown:G}=t,J=I=>{Q?.(I.target?.value??""),se?.(I.target?.value??"")},re=J,X=Ja(""),M=I=>String(I??"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=()=>{if(!!!m(c))return 0;let T=m(f);if(T!=null&&T!==""&&Number.isFinite(Number(T)))return Math.max(0,Number(T));let O=m(z);return O==="currency"||O==="percent"?2:0},x=I=>{let T=m(p)??".",O=m(w)??"",_=String(I??"");if(O&&(_=_.split(O).join("")),!_||_==="-"||_===T||_.endsWith(T))return null;let ae=_.replace(T,"."),ee=Number(ae);return Number.isFinite(ee)?ee:null},B=I=>{let T=m(w)??"";return T?I.replace(/\B(?=(\d{3})+(?!\d))/g,T):I},R=I=>{let T=m(p)??".",O=j(),_=Number(I);if(!Number.isFinite(_))return"";let ae=_<0?"-":"",ee=Math.abs(_),[K,ie=""]=String(ee).split("."),le=B(K);if(O>0){let xe=ie.slice(0,O).padEnd(O,"0");return`${ae}${le}${T}${xe}`}return`${ae}${le}`},q=(I,T)=>{try{let O=m($),_=m(D)??"USD",ae=m(C)??{},ee=j(),K=T==="currency"?"currency":"decimal";return new Intl.NumberFormat(O,{style:K,currency:_,...ee>0?{minimumFractionDigits:ee,maximumFractionDigits:ee}:{maximumFractionDigits:0},...ae}).format(I)}catch{return R(I)}},Y=I=>{let T=I,O=m(a),_=m(o);return O!=null&&Number.isFinite(Number(O))&&(T=Math.max(T,Number(O))),_!=null&&Number.isFinite(Number(_))&&(T=Math.min(T,Number(_))),!m(d)&&T<0&&(T=0),T},oe=()=>{let I=m(L)??"",T=m(z);return!I&&T==="percent"?"%":I},ve=(I,T,O)=>{let _=m(P)??"",ae=oe(),ee=String(I??"").replace(/\u00A0/g," "),K=String(_??"").replace(/\u00A0/g," "),ie=String(ae??"").replace(/\u00A0/g," "),le=K&&ee.startsWith(K),xe=ie&&ee.endsWith(ie);return`${T??""}${le?"":_}${I}${xe?"":ae}`},ze=(I,T)=>{let O=j(),_=m(p)??".",ee=String(I??"").replace(/\D/g,"")||"0",K=O>0?ee.padStart(O+1,"0"):ee,le=(O>0?K.slice(0,-O):K).replace(/^0+(?=\d)/,"")||"0",xe=O>0?K.slice(-O):"",Ae=O>0?`${le}${_}${xe}`:le;return`${T??""}${Ae}`},Pe=I=>{let T=m(P)??"",O=oe(),_=String(I??""),ae=String(T??"").replace(/\u00A0/g," "),ee=String(O??"").replace(/\u00A0/g," ");return ae&&_.replace(/\u00A0/g," ").startsWith(ae)&&(_=_.slice(T.length)),ee&&_.replace(/\u00A0/g," ").endsWith(ee)&&(_=_.slice(0,-O.length)),_},_e=I=>{let T=!!m(d),O=Pe(I),_=T&&O.includes("-")?"-":"",ae=O.replace(/\D/g,""),ee=ze(ae,_);if(m(l)==="strict"){let K=x(ee);if(K!=null){let ie=Y(K);ee=`${ie<0?"-":""}${R(Math.abs(ie))}`}}return ee},Ze=I=>{if(I==null||I==="")return ze("","");if(typeof I=="number"&&Number.isFinite(I)){let ie=m(l)==="strict"?Y(I):I;return`${ie<0?"-":""}${R(Math.abs(ie))}`}let T=Pe(I),O=m(p)??".",ae=!!m(d)&&String(T).includes("-")?"-":"",ee=String(T??"").replace(new RegExp(`[^0-9${M(O)}]`,"g"),""),K=x(`${ae}${ee}`);if(K!=null){let ie=m(l)==="strict"?Y(K):K;return`${ie<0?"-":""}${R(Math.abs(ie))}`}return _e(I)},Me,ei=I=>{let T=m(I);if(T===void 0)return;let O=Ze(T);O!==X.get()&&(Me=O,X.set(O))};ei(r),je(r).change(I=>{ei(I)}),je(X).change(I=>{if(I===Me){Me=void 0;return}Me=void 0;let T=x(I);if(T==null){J?.(I??"");return}J?.(T)});let Ri=je(k).compute(I=>I!=null&&I!==!1),Hi=je(b,Ri).compute(([I,T])=>!m(I)&&!T),vi=je(c).compute(I=>m(I)?"decimal":"numeric"),Wi=je(z,P,L,c,d,p,w,f,l,a,o,$,D,C).compute(()=>({mode:"both",format:I=>{let T=_e(I),O=m(z),ae=!!m(d)&&T.startsWith("-")?"-":"",ee=x(T),K=T.replace(ae,"");if(ee!=null){let ie=Math.abs(ee);if(typeof O=="function")try{K=O(ie)}catch{K=R(ie)}else if(O==="currency")K=q(ie,"currency");else if(O==="decimal"){let le=m($),xe=m(C);K=le||xe?q(ie,"decimal"):R(ie)}else K=R(ie)}return{value:T,raw:T,visual:ve(K,ae,O)}}})),v=I=>{let T=x(X.get()),O=Number(m(n)??1),ae=Y((T??0)+O*I);X.set(R(ae))},H=I=>{if(!I||typeof I.setSelectionRange!="function")return;let T=()=>{try{let O=String(I.value??"").length;I.setSelectionRange(O,O)}catch{}};typeof requestAnimationFrame=="function"?requestAnimationFrame(T):T()},ce=I=>{re?.(I);let T=I?.target;T&&H(T)},Z=I=>{if(te?.(I),m(l)!=="blur")return;let T=x(X.get());if(T==null)return;let O=Y(T);X.set(R(O))},ge=I=>{E?.(I),H(I?.target)},fe=I=>{G?.(I);let T=I?.target;if(!T)return;let O=m(P)??"",_=oe();_&&typeof T.selectionEnd=="number"&&(T.selectionEnd=Math.min(T.selectionEnd,String(T.value??"").length-_.length)),O&&typeof T.selectionStart=="number"&&(T.selectionStart=Math.max(T.selectionStart,O.length))},ue=Ut({className:"g-ui-number-field-controls"},Xt({className:"g-ui-number-field-control",onClick:()=>v(1)},"+"),Xt({className:"g-ui-number-field-control",onClick:()=>v(-1)},"\u2212")),Te=Ut({className:"g-ui-number-field-controls-wrapper"},ue),Ve=je(Hi,k).compute(([I,T])=>I?Te:T);return be({...A,size:u,className:s("g-ui-number-field",h),leftSection:y,rightSection:Ve,type:"text",inputMode:vi,inputClassName:s("g-ui-input-number"),value:X,format:Wi,onInput:ce,onBlur:Z,onFocus:ge,onKeyDown:fe})}function eo(...e){return Qi(...e)}import{Div as ki,Button as io,portal as to,when as Ji,after as ro}from"@granularjs/core";var xi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>',wi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>',yi='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M379.33-244 154-469.33 201.67-517l177.66 177.67 378.34-378.34L805.33-670l-426 426Z"/></svg>',Kt='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M240-446.67v-66.66h480v66.66H240Z"/></svg>',Be='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M312-265.33 265.33-312l168-168-168-167L312-693.67l168 168 167-168L693.67-647l-168 167 168 168L647-265.33l-167-168-168 168Z"/></svg>',Qt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>',Jt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>',er='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h357l-80 80H200v560h560v-278l80-80v358q0 33-23.5 56.5T760-120H200Zm280-360v-80h240v80H480Zm0 160v-80h320v80H480Zm0 160v-80h320v80H480ZM360-360v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm160-320h280l-36-37 37-37v74H520Zm-160 0h80v-80h-80v80ZM120-600v-160l160-160h160l-80 80H200v240h-80Zm80-240v-80 80Z"/></svg>',ir='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>',tr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Z"/></svg>',rr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"/></svg>';function ri(...e){let{props:i,rawProps:t,children:r}=g(e,{size:"md",centered:!0,overlay:"normal"}),{opened:a,title:o,size:n,centered:u,overlay:c,position:d,className:p,style:w}=i,{onClose:f}=t,l=ro(d,u).compute(([b,z])=>`g-ui-modal-position-${b??(z===!1?"top-center":"center")}`);return Ji(a,()=>to(ki({className:s("g-ui-modal-overlay",N("g-ui-modal-overlay-",c,"normal"),l),onClick:b=>{b.target===b.currentTarget&&f?.()}},ki({className:s("g-ui-modal",N("g-ui-modal-size-",n,"md"),p)},ki({className:"g-ui-modal-header"},Ji(o,()=>ki({className:"g-ui-modal-title"},o)),Ji(f,()=>io({type:"button",className:"g-ui-button g-ui-button-variant-subtle g-ui-button-size-xs g-ui-modal-close",onClick:f,innerHTML:Be}))),r))))}import{Div as zi,Span as et,after as ar,when as or}from"@granularjs/core";function ai(...e){let{props:i}=g(e,{variant:"spinner",size:"md"}),{variant:t,size:r,className:a}=i,o=ar(t).compute(u=>u==="dots"),n=ar(t).compute(u=>u==="bars");return or(o,()=>zi({className:s("g-ui-loading g-ui-dots",N("g-ui-loading-size-",r,"md"),a)}),()=>or(n,()=>zi({className:s("g-ui-loading g-ui-bars",N("g-ui-loading-size-",r,"md"),a)},et(""),et(""),et("")),()=>zi({className:s("g-ui-loading",N("g-ui-loading-size-",r,"md"),a)},zi({className:"g-ui-spinner"}))))}import{Div as it,Input as ao,Label as oo,Span as nr,when as tt,state as no,after as so}from"@granularjs/core";function rt(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{checked:r,label:a,description:o,size:n,indeterminate:u,className:c,style:d,inputProps:p,...w}=i,{onChange:f}=t,l=no(ke(r));so(r).change(z=>{z!=null&&(l.set(!!z),f?.(z))});let b=oo({className:"g-ui-checkbox-control"},ao({type:"checkbox",indeterminate:u,checked:l,className:s("g-ui-checkbox-input",N("g-ui-checkbox-size-",n,"md"),p?.className),...w}),tt(l,()=>it({className:"g-ui-checkbox-checked",innerHTML:yi}),()=>{if(!l.get()&&u.get())return it({className:"g-ui-checkbox-indeterminate",innerHTML:Kt})}),tt(a,()=>nr({className:"g-ui-checkbox-label"},a)));return it({className:s("g-ui-checkbox",N("g-ui-checkbox-size-",n,"md"),c)},b,tt(o,()=>nr({className:"g-ui-checkbox-description"},o)))}import{Input as co,Label as po,Span as mo,when as fo,after as ot,state as ho}from"@granularjs/core";import{Div as uo,context as go,after as sr}from"@granularjs/core";var at=go({name:null,selected:null});function lo(...e){let{props:i,rawProps:t,children:r}=g(e),{className:a,name:o,selected:n,onChange:u,...c}=i,{onChange:d}=t,p=at.scope({name:o?.get(),selected:n?.get()});return sr(p.selected).change(w=>{d?.(w)}),sr(n).change(w=>{w!==p.selected.get()&&(p.set().selected=w)}),p.serve(uo({...c,className:s("g-ui-switch-group",a)},r))}function vo(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,size:a,className:o,style:n,inputProps:u,checked:c,value:d,...p}=i,{onChange:w}=t,f=ho(c),l=at.state(),b=ot(l).compute(z=>({name:z.name,type:z.name?"radio":"checkbox"}));return ot(l.selected).change(z=>{f.set(z===d.get())}),ot(f).change(z=>{if(w?.(z),!z)return;let $=l.get().selected;l.set().selected=d.get()}),po({className:s("g-ui-switch",N("g-ui-switch-size-",a,"md"),o)},co({type:b.type,name:b.name,value:d,checked:f,className:s("g-ui-switch-input",N("g-ui-switch-size-",a,"md"),u?.className),...p}),fo(r,()=>mo({className:"g-ui-switch-label"},r)))}import{Div as Re,Span as ur,when as nt,state as gr,after as Ni}from"@granularjs/core";import{Span as bo}from"@granularjs/core";function ye(...e){let{props:i,children:t}=g(e,{size:"md"});return bo({...i,className:s("g-ui-icon",N("g-ui-icon-size-",i.size,"md"),N("g-ui-icon-color-",i.color),i.className)},...t)}function xo(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md"}),{data:r,value:a,size:o,leftSection:n,rightSection:u,placeholder:c,className:d,...p}=i,{onChange:w}=t,f=gr(!1),l=gr(m(a)??"");Ni(a).change(D=>{let C=m(D);C!==void 0&&l.set(C??"")});let b=D=>{l.set(D),w?.(D),f.set(!1)},z=Ni(l).compute(D=>D?"":"g-ui-select-placeholder"),$=Ni(l).compute(D=>{let P=(m(r)??[]).find(L=>L.value===D);return D?P?.label??"":c??""});return Re({...p,className:s("g-ui-select-root",d)},Re({className:s("g-ui-input-wrapper",N("g-ui-input-size-",o,"md"))},nt(n,()=>Re({className:"g-ui-input-section"},n)),Re({className:s("g-ui-select",z),onClick:()=>f.set(!f.get())},ur({className:"g-ui-select-value"},$)),nt(u,()=>Re({className:"g-ui-input-section"},u),()=>ur({className:"g-ui-select-caret"},ye({innerHTML:rr})))),nt(f,()=>Re({className:"g-ui-select-dropdown"},(m(r)??[]).map(D=>Re({className:s("g-ui-select-item",Ni(l).compute(C=>C===D.value?"g-ui-select-item-active":"")),onClick:()=>b(D.value)},D.label)))))}import{Button as wo,Div as Ue,state as Le,after as oi,list as yo,when as ko}from"@granularjs/core";function zo(...e){let{props:i,rawProps:t}=g(e,{tabs:[],orientation:"horizontal",variant:"default",sticky:!0}),{value:r,tabs:a,orientation:o,variant:n,sticky:u,className:c,style:d}=i,{onChange:p}=t,w=Le(m(r)??m(a)?.[0]?.value??""),f=Le(),l=Le(),b=Le(0),z=Le(0),$=Le(0),D=Le(0),C=Le(!1),P=Le(0),L=!1,y=null,k=!1,h=new Set;oi(r).change(x=>{let B=m(x);B!=null&&w.set(B)});let S=x=>{w.set(x),p?.(x)},V=x=>{let B=[],R=x?.parentElement;for(;R;){let q=getComputedStyle(R),Y=`${q.overflow}${q.overflowY}${q.overflowX}`;/(auto|scroll)/.test(Y)&&B.push(R),R=R.parentElement}return B},A=x=>V(x)[0]??null,Q=x=>x?x.getBoundingClientRect().top:0,se=x=>x?x.scrollTop:window.scrollY||window.pageYOffset||0,te=(x,B)=>x>B?"down":x<B?"up":"none",E=(x,B,R,q)=>x==="down"&&B<R?!0:x==="up"&&B>=R?!1:q,G=()=>{let x=f.get(),B=l.get();if(!x||!B)return;if(!ke(u)){C.set(!1),b.set(0);return}if(typeof window>"u")return;let R=x.getBoundingClientRect(),q=B.getBoundingClientRect(),Y=A(x),oe=Q(Y),ve=se(Y),ze=te(ve,P.get());P.set(ve);let Pe=E(ze,R.top,oe,C.get());b.set(q.height),z.set(R.left),$.set(R.width),D.set(oe),Pe!==C.get()&&C.set(Pe)},J=()=>{y==null&&(y=requestAnimationFrame(()=>{y=null,G()}))},re=x=>{!x||h.has(x)||(h.add(x),x.addEventListener("scroll",J,{passive:!0}))},X=()=>{if(L)return;let x=f.get(),B=l.get();!x||!B||typeof window>"u"||(L=!0,G(),re(window),window.addEventListener("resize",J),V(x).forEach(re))};oi(l,f,u).change(X),!k&&typeof window<"u"&&(k=!0,setTimeout(()=>X(),0));let M=oi(C,z,$,D).compute(x=>{let[B,R,q,Y]=x;return B?{position:"fixed",top:`${Y}px`,left:`${R}px`,width:`${q}px`,background:"var(--g-ui-surface)",zIndex:100}:{position:"static",top:"auto",left:"auto",width:"auto",zIndex:"auto",background:"transparent"}}),j=oi(C,b).compute(x=>{let[B,R]=x;return{height:B?`${R}px`:"0px"}});return Ue(Ue({className:s("g-ui-tabs",he(o,{vertical:"g-ui-tabs-vertical"}),N("g-ui-tabs-variant-",n,"default"),i.className??c)},Ue({node:f}),Ue({style:j}),Ue({node:l,className:"g-ui-tabs-list",style:M},yo(a,x=>wo({className:oi(w,x.value).compute(([B,R])=>s("g-ui-tabs-tab",R===B&&"g-ui-tabs-tab-active")),onClick:()=>S(x.get().value)},x.label))),Ue({className:"g-ui-tabs-panel"},ko(w,()=>a.get()?.find(x=>x.value===w.get())?.content??null))))}import{Table as No,Thead as Co,Tbody as So,Tr as Do,Th as Po,Td as Mo,list as cr,when as pr,after as st}from"@granularjs/core";function To(...e){let{props:i}=g(e,{headers:[],rows:[]}),{headers:t,rows:r,striped:a,highlightOnHover:o,withBorder:n,withColumnBorders:u,withRowBorders:c,className:d,style:p,...w}=i,f=st(t).compute(l=>l.length>0);return No({...w,className:s("g-ui-table",U("g-ui-table-striped",a),U("g-ui-table-hover",o),U("g-ui-table-with-border",n),U("g-ui-table-column-borders",u),U("g-ui-table-row-borders",c),d)},pr(f,()=>Co(lr(t,!0))),So(cr(r,l=>lr(l,!1))))}var lr=(e,i)=>{let t=st(e).compute(o=>Array.isArray(o)),r=o=>{let n=st(o).compute(u=>Object.values(u));return a(n)},a=o=>cr(o,n=>i?Lo(n):Vo(n));return Do(pr(t,()=>a(e),()=>r(e)))},Vo=e=>Mo(e),Lo=e=>Po(e);import{Div as ut}from"@granularjs/core";import{state as Io,when as $o,after as Ao}from"@granularjs/core";function Bo(...e){let{props:i,children:t}=g(e,{opened:!1}),{opened:r,className:a,...o}=i,n=Io(ke(r));Ao(r).change(p=>{n.set(ke(p))});let u=()=>{n.set(!n.get())},c=t[0],d=t[1];return ut({...o,className:s("g-ui-accordion",a)},ut({className:"g-ui-accordion-header",onClick:u},c),$o(n,()=>ut({className:"g-ui-accordion-content"},d)))}import{Span as dr}from"@granularjs/core";function Fo(...e){let{props:i,children:t}=g(e),{label:r,className:a,style:o}=i;return dr({className:s("g-ui-tooltip",a)},t,dr({className:"g-ui-tooltip-content"},r))}import{Div as ni,when as Eo,after as jo,state as si,portal as Ro}from"@granularjs/core";var gt=si({currentOpenState:null});function Ho(...e){let i=si(),t=si(),r=si({}),{props:a,rawProps:o,children:n}=g(e,{position:"right"}),{opened:u,content:c,position:d,className:p,...w}=a,{onChange:f}=o,l=si(m(u)??!1);jo(u).change(L=>{let y=m(L);y!=null&&(l.set(!!y),y&&b())});let b=()=>{gt.get().currentOpenState!==l&&(gt.get().currentOpenState?.set(!1),gt.set().currentOpenState=l)};u.get()&&b();let z=L=>{let k=String(L??"right").toLowerCase().split("-").filter(Boolean);if(k.length===1){let V=k[0];return V==="top"||V==="bottom"?{placement:V,align:"center"}:V==="left"||V==="right"?{placement:"bottom",align:V}:V==="center"?{placement:"bottom",align:"center"}:{placement:"bottom",align:"right"}}let[h,S]=k;return h==="top"||h==="bottom"?{placement:h,align:S||"center"}:h==="left"||h==="right"?{placement:h,align:S||"center"}:{placement:"bottom",align:"right"}},$=()=>{let L=i.get(),y=t.get();if(!L||!y||typeof window>"u")return;let k=L.getBoundingClientRect(),h=y.getBoundingClientRect(),S=m(d)??"right",V=getComputedStyle(document.documentElement).getPropertyValue("--g-ui-space-20"),A=Number.parseFloat(V)||20,Q=window.innerWidth||0,se=window.innerHeight||0,te=Math.max(A,Q-h.width-A),E=Math.max(A,se-h.height-A),{placement:G,align:J}=z(S),re=8,X=k.bottom+re,M=k.left;G==="top"||G==="bottom"?(X=G==="top"?k.top-h.height-re:k.bottom+re,J==="center"?M=k.left+k.width/2-h.width/2:J==="right"?M=k.right-h.width:M=k.left):(G==="left"||G==="right")&&(M=G==="left"?k.left-h.width-re:k.right+re,J==="center"?X=k.top+k.height/2-h.height/2:J==="bottom"?X=k.bottom-h.height:X=k.top),M=Math.max(A,Math.min(M,te)),X=Math.max(A,Math.min(X,E)),r.set({top:`${X}px`,left:`${M}px`})},D=L=>{l.set(L),f?.(L),L&&(b(),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>$()):setTimeout(()=>$(),0))},C=()=>D(!l.get()),P=()=>D(!1);return ni({...w,node:i,className:s("g-ui-menu",p)},ni({onClick:C},n),Eo(l,()=>Ro(ni(ni({className:"g-ui-menu-overlay",onClick:P}),ni({className:"g-ui-menu-dropdown",node:t,style:r},c)))))}import{Div as mr,portal as Wo,when as Oo}from"@granularjs/core";function qo(...e){let{props:i,children:t}=g(e,{position:"right",size:"md",overlay:"normal",shadowed:!0}),{opened:r,onClose:a,position:o,size:n,overlay:u,shadowed:c,className:d,style:p}=i;return Oo(r,()=>Wo(mr({className:s("g-ui-drawer-overlay",N("g-ui-drawer-overlay-",u,"normal")),onClick:a},mr({className:s("g-ui-drawer",he(c,{true:"g-ui-drawer-shadowed"},!0),N("g-ui-drawer-",o,"right"),N("g-ui-drawer-size-",n,"md"),d),onClick:w=>w.stopPropagation()},t))))}import{Button as Yo,Div as lt,Span as fr,when as Ci,after as hr}from"@granularjs/core";function ct(...e){let{props:i,rawProps:t,children:r}=g(e,{color:"blue",withCloseButton:!0}),{title:a,color:o,icon:n,loading:u,withCloseButton:c,withBorder:d,className:p,style:w}=i,{onClose:f}=t,l=hr(n,u).compute(([z,$])=>!z&&!!$),b=hr(n,u).compute(([z,$])=>!!z||!!$);return lt({className:s("g-ui-notification",[d,"g-ui-notification-bordered"],[o,z=>`g-ui-notification-${z}`],[b,"g-ui-notification-with-icon"],p)},Ci(n,()=>fr({className:"g-ui-notification-icon"},n)),Ci(l,()=>ai({size:"sm",className:"g-ui-notification-loader"})),lt({className:"g-ui-notification-body"},Ci(a,()=>lt({className:"g-ui-notification-title"},a)),r),Ci(c,()=>Yo({type:"button",className:"g-ui-notification-close",onClick:()=>f?.()},fr({innerHTML:Be}))))}import{Div as Go,when as _o}from"@granularjs/core";function Zo(...e){let{props:i}=g(e,{labelPosition:"center"}),{label:t,labelPosition:r,vertical:a,className:o,...n}=i;return Go({...n,className:s("g-ui-divider",U("label",t),N("g-ui-divider-label-",r,"center"),U("g-ui-divider-vertical",a),o)},_o(t,()=>Ui({className:"g-ui-divider-label-text",size:"sm"},t)))}import{Div as Uo}from"@granularjs/core";function Xo(...e){let{props:i,children:t}=g(e,{padding:"md",radius:"md",shadow:"none"}),{padding:r,radius:a,shadow:o,className:n,...u}=i;return Uo({...u,className:s("g-ui-paper",[r,c=>`g-ui-card-padding-${c}`],[a,c=>`g-ui-card-radius-${c}`],[o,c=>`g-ui-card-shadow-${c}`],n)},t)}import{Button as Ko,Div as pt,Span as Qo,after as vr,when as dt}from"@granularjs/core";function Jo(...e){let{props:i,rawProps:t,children:r}=g(e,{color:"blue"}),{title:a,color:o,icon:n,withCloseButton:u,className:c,...d}=i,{onClose:p}=t,w=vr(a,u).compute(([l,b])=>l||b),f=vr(n).compute(l=>l!==void 0);return pt({...d,className:s("g-ui-alert",[o,l=>`g-ui-alert-${l}`],c)},pt({className:"g-ui-alert-header"},dt(n,()=>Qo({className:"g-ui-alert-icon"},n)),dt(a,()=>pt({className:"g-ui-alert-title"},a)),dt(u,()=>Ko({type:"button",className:"g-ui-alert-close",onClick:()=>p?.()},"\xD7"))),r)}import{Div as en,Img as tn,when as rn}from"@granularjs/core";function an(...e){let{props:i,children:t}=g(e,{size:"md",alt:""}),{src:r,size:a,alt:o,className:n,...u}=i;return en({...u,className:s("g-ui-avatar",[a,c=>`g-ui-avatar-size-${c}`],n)},rn(r,()=>tn({className:"g-ui-avatar-img",src:r,alt:o}),()=>t))}import{Span as on}from"@granularjs/core";function nn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return on({...a,className:s("g-ui-kbd",r)},t)}import{Code as sn}from"@granularjs/core";function un(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return sn({...a,className:s("g-ui-code",r)},t)}import{Blockquote as gn}from"@granularjs/core";function ln(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return gn({...a,className:s("g-ui-blockquote",r)},t)}import{Div as cn}from"@granularjs/core";function pn(...e){let{props:i,children:t}=g(e,{cols:3,gap:"md"}),{cols:r,gap:a,className:o,...n}=i;return cn({...n,className:s("g-ui-grid",[a,u=>`g-ui-gap-${u}`],[r,u=>`g-ui-grid-cols-${u}`],o)},t)}import{Ul as dn,Ol as mn,Li as mt,Div as Si,Span as ft,after as ht,when as He,isSignal as fn,isState as hn,isStatePath as vn,isComputed as bn}from"@granularjs/core";function br(...e){let{props:i,children:t}=g(e,{type:"none",size:"md"}),{type:r,size:a,withPadding:o,className:n,...u}=i,c=he(r,{ordered:"g-ui-list-ordered",unordered:"g-ui-list-unordered",none:"g-ui-list-none"}),d=ht(r).compute(z=>z==="ordered"),p=z=>z&&typeof z=="object"&&typeof z.tagName=="string"&&(z.tagName.toLowerCase()==="ul"||z.tagName.toLowerCase()==="ol"),w=z=>z&&typeof z=="object"&&typeof z.tagName=="string"&&z.tagName.toLowerCase()==="li",f=z=>{let $=D=>D?.nodeType==="granular-list-node"?D:D==null||D===!1?null:Array.isArray(D)?D.map(C=>$(C)):w(D)?D:p(D)?mt({className:"g-ui-list-nested-item"},D):mt(ft({className:"g-ui-list-item-shell"},D));return fn(z)||hn(z)||vn(z)||bn(z)?ht(z).compute(D=>$(D)):$(z)},l=He(t,()=>t.map(z=>f(z))),b={...u,className:s("g-ui-list",N("g-ui-list-size-",a,"md"),U("g-ui-list-with-padding",o),c,n)};return He(d,()=>mn(b,l),()=>dn(b,l))}function xn(...e){let{props:i,children:t}=g(e,{withBorder:!1}),{leftSection:r,rightSection:a,title:o,body:n,withBorder:u,className:c,verticalPadding:d,horizontalPadding:p,...w}=i,f=ht(o,n).compute(([l,b])=>!!l||!!b);return mt({...w,className:s("g-ui-list-item",U("g-ui-list-item-border",u),N("g-ui-list-item-vertical-padding-",d,"md"),N("g-ui-list-item-horizontal-padding-",p,"md"),c)},Si({className:"g-ui-list-item-shell"},He(r,()=>ft({className:"g-ui-list-item-section g-ui-list-item-section-left"},r)),He(f,()=>Si({className:"g-ui-list-item-content"},He(o,()=>Si({className:"g-ui-list-item-title"},o)),He(n,()=>Si({className:"g-ui-list-item-body"},n))),()=>t),He(a,()=>ft({className:"g-ui-list-item-section g-ui-list-item-section-right"},a))))}br.Item=xn;import{A as wn}from"@granularjs/core";function yn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return wn({...a,className:s("g-ui-anchor",r)},t)}import{Img as kn}from"@granularjs/core";function zn(...e){let{props:i}=g(e),{className:t,...r}=i;return kn({...r,className:s("g-ui-image",t)})}import{Div as xr}from"@granularjs/core";function Nn(...e){let{props:i}=g(e,{value:0,color:"primary",size:"md"}),{value:t,color:r,size:a,className:o,...n}=i;return xr({...n,className:s("g-ui-progress",N("g-ui-progress-size-",a,"md"),[t,u=>{let c=Math.max(0,Math.min(100,Number(u)||0));return`g-ui-progress-${Math.round(c/5)*5}`}],[r,u=>u?`g-ui-progress-${u}`:""],o)},xr({className:"g-ui-progress-bar"}))}import{Div as Fe,after as We,state as Cn,when as wr,list as Sn}from"@granularjs/core";function Dn(...e){let{props:i,rawProps:t}=g(e,{size:"md",min:0,max:100,step:1}),{onChange:r}=t,{value:a,marks:o,size:n,min:u,max:c,step:d,disabled:p,className:w,...f}=i,l=Cn(m(a??u)),b=We(o).compute(y=>y&&y.length>0);We(a).change(y=>{y!=null&&l.set(m(y))});let z=()=>{let y=Number(m(u)),k=Number(m(c));return!Number.isFinite(y)||!Number.isFinite(k)?{minValue:0,maxValue:100}:{minValue:Math.min(y,k),maxValue:Math.max(y,k)}},$=()=>{let y=Number(m(d));return Number.isFinite(y)&&y>0?y:1},D=y=>{let{minValue:k,maxValue:h}=z(),S=$(),V=Math.max(k,Math.min(h,Number(y))),A=Math.round((V-k)/S)*S+k;A!==l.get()&&(l.set(A),r?.(A))},C=We(l).compute(y=>{let{minValue:k,maxValue:h}=z(),S=h-k;if(S<=0)return 0;let V=(Number(y??k)-k)/S*100;return Math.max(0,Math.min(100,V))}),P=(y,k)=>{let h=k?.();if(!h||h.width===0)return;let V=Math.min(Math.max(y.clientX-h.left,0),h.width)/h.width,{minValue:A,maxValue:Q}=z();D(A+V*(Q-A))},L=y=>{if(ke(p))return;y.preventDefault?.();let k=y.currentTarget,h=()=>k.getBoundingClientRect();k.setPointerCapture?.(y.pointerId),P(y,h);let S=A=>P(A,h),V=()=>{k.releasePointerCapture?.(y.pointerId),window.removeEventListener("pointermove",S),window.removeEventListener("pointerup",V)};window.addEventListener("pointermove",S),window.addEventListener("pointerup",V)};return Fe({...f,className:s("g-ui-slider",N("g-ui-slider-size-",n,"md"),U("g-ui-slider-disabled",p),w)},Fe({className:"g-ui-slider-track",onPointerDown:L},Fe({className:"g-ui-slider-bar",style:We(C).compute(y=>({width:`${y}%`}))}),Fe({className:"g-ui-slider-thumb",style:We(C).compute(y=>({left:`${y}%`}))})),wr(b,()=>Fe({className:"g-ui-slider-marks-placeholder"})),wr(o,()=>Fe({className:"g-ui-slider-marks"},Sn(o,y=>vt({mark:y,getBounds:z})))))}var vt=({mark:e,getBounds:i})=>{let{minValue:t,maxValue:r}=i(),a=r-t,o=We(e).compute(d=>d.value??d),n=We(e).compute(d=>d.label??String(d.value)??o),u=Number(o),c=0;return a>0&&(c=(u-t)/a*100),Fe({className:"g-ui-slider-mark",style:{left:`${Math.max(0,Math.min(100,c))}%`}},Fe({className:"g-ui-slider-mark-label"},n))};import{Div as Pn,after as Mn}from"@granularjs/core";function Tn(...e){let{props:i}=g(e,{height:"md",width:"full"}),{height:t,width:r,className:a,...o}=i,n=Mn(t,r).compute(([u,c])=>{let d={};return isNaN(u)||(d.height=`${u}px`),isNaN(c)||(d.width=`${c}px`),d});return Pn({...o,style:{width:n.width,height:n.height,...o.style||{}},className:s("g-ui-skeleton",[t,u=>`g-ui-skeleton-h-${u}`],[r,u=>`g-ui-skeleton-w-${u}`],a)})}import{Button as Vn,after as yr,state as Ln}from"@granularjs/core";function In(...e){let{props:i,rawProps:t,children:r}=g(e,{size:"md",variant:"filled",color:"primary"}),{checked:a,size:o,variant:n,color:u,className:c,...d}=i,{onChange:p}=t,w=Ln(!!a);yr(a).change(l=>{l!=null&&w.set(!!l)});let f=l=>{w.set(l),p?.(l)};return Vn({...d,type:"button",className:s("g-ui-chip",N("g-ui-chip-size-",o,"md"),N("g-ui-chip-variant-",n,"filled"),N("g-ui-chip-color-",u,"primary"),yr(w).compute(l=>l?"g-ui-chip-active":""),c),onClick:()=>f(!w.get())},r)}import{Div as bt,after as kr,state as $n,list as An}from"@granularjs/core";function Bn(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"sm"}),{value:r,data:a,size:o,scroll:n,className:u,...c}=i,{onChange:d}=t,p=$n(m(r));kr(r).change(f=>{let l=m(f);l!=null&&p.set(l)});let w=f=>{p.set(f),d?.(f)};return bt({...c,className:s(n&&"g-ui-segmented-scroll")},bt({className:s("g-ui-segmented",N("g-ui-segmented-size-",o,"sm"),u)},An(a,(f=>bt({className:s("g-ui-segmented-item",kr(p).compute(l=>f.get().value===l?"g-ui-segmented-active":"")),onClick:()=>w(f.get().value)},f.label)))))}import{Button as xt,Div as Fn,state as En,after as Di}from"@granularjs/core";function jn(...e){let{props:i,rawProps:t}=g(e,{total:1,size:"md"}),{page:r,total:a,size:o,className:n,...u}=i,{onChange:c}=t,d=En(m(r)??1);Di(r).change(l=>{let b=m(l);b!=null&&d.set(b)});let p=l=>{let b=Number(m(a))||1,z=Math.max(1,Math.min(b,l));d.set(z),c?.(z)},w=[],f=Number(m(a))||1;for(let l=1;l<=f;l+=1)w.push(l);return Fn({...u,className:s("g-ui-pagination",N("g-ui-pagination-size-",o,"md"),i.className??n)},xt({className:"g-ui-pagination-item",onClick:()=>p((d.get?.()??d)-1),disabled:Di(d).compute(l=>l<=1)},"<"),w.map(l=>xt({className:Di(d).compute(b=>s("g-ui-pagination-item",l===b&&"g-ui-pagination-item-active")),onClick:()=>p(l)},String(l))),xt({className:"g-ui-pagination-item",onClick:()=>p((d.get?.()??d)+1),disabled:Di(d).compute(l=>l>=a)},">"))}import{Div as On,Input as qn,Label as Yn,Span as zr,when as Nr,after as kt,state as Gn}from"@granularjs/core";import{Div as Rn,context as Hn,after as wt}from"@granularjs/core";var yt=Hn({name:"",selected:null});function Wn(...e){let{props:i,children:t,rawProps:r}=g(e),{className:a,name:o,selected:n,onChange:u,...c}=i,{onChange:d}=r,p=yt.scope({name:o?.get(),selected:n?.get()});return console.log("selected?.get()",n?.get()),wt(o).change(w=>{p.set().name=w}),wt(n).change(w=>{w!==p.selected.get()&&(p.set().selected=w)}),wt(p.selected).change(w=>{d?.(w)}),p.serve(Rn({...c,className:s("g-ui-stack g-ui-gap-sm",a)},t))}function _n(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,name:a,value:o,checked:n,description:u,size:c,className:d,inputProps:p,...w}=i,{onChange:f}=t,l=Gn(n?.get()??!1),b=yt.state(),z=kt(b.name,a).compute(([D,C])=>D||C);kt(n,b.selected).change(D=>{let[C,P]=D;b.get().name?l.set(P===o.get()):l.set(C)}),kt(l).change(D=>{f?.(D),D&&b.get().name&&(b.set().selected=o.get())});let $=Yn({className:"g-ui-radio-control"},qn({type:"radio",name:z,value:o,checked:l,className:s("g-ui-radio-input",N("g-ui-radio-size-",c,"md"),p?.className),...w}),Nr(r,()=>zr({className:"g-ui-radio-label"},r)));return On({className:s("g-ui-radio",N("g-ui-radio-size-",c,"md"),d)},$,Nr(u,()=>zr({className:"g-ui-radio-description"},u)))}import{Nav as Zn,Span as Un}from"@granularjs/core";function Xn(...e){let{props:i,children:t}=g(e,{separator:"/"}),{separator:r,className:a,...o}=i,n=[];Array.isArray(t)?n.push(...t):n.push(t);let u=n.filter(Boolean),c=[];return u.forEach((d,p)=>{c.push(d),p<u.length-1&&c.push(Un({className:"g-ui-breadcrumbs-separator"},r))}),Zn({...o,className:s("g-ui-breadcrumbs",a)},c)}import{Div as Kn}from"@granularjs/core";function Qn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Kn({...a,className:s("g-ui-center",r)},t)}import{Div as Jn}from"@granularjs/core";function es(...e){let{props:i}=g(e,{size:"md"}),{size:t,className:r,...a}=i;return Jn({...a,className:s("g-ui-space",[t,o=>`g-ui-space-${o}`],r)})}import{Div as is,when as ts}from"@granularjs/core";function rs(...e){let{props:i,children:t}=g(e),{opened:r,className:a,...o}=i;return ts(r,()=>is({...o,className:s("g-ui-collapse",a)},t))}import{Button as as}from"@granularjs/core";function Oe(...e){let{props:i,children:t}=g(e,{size:"md",variant:"filled"}),{size:r,variant:a,color:o,className:n,...u}=i;return as({...u,type:"button",className:s("g-ui-action-icon",N("g-ui-action-icon-size-",r,"md"),N("g-ui-action-icon-color-",o,"primary"),N("g-ui-action-icon-",a,"filled"),n)},t)}import{Div as zt,when as os,after as ns,state as ss}from"@granularjs/core";function Nt(...e){let{props:i,rawProps:t,children:r}=g(e,{position:"left"}),{opened:a,position:o,content:n,className:u,...c}=i,{onChange:d}=t,p=ss(m(a)??!1);ns(a).change(f=>{let l=m(f);l!=null&&p.set(!!l)});let w=f=>{p.set(f),d?.(f)};return zt({...c,className:s("g-ui-popover",i.className??u)},zt({onClick:()=>w(!p.get())},r),os(p,()=>zt({className:s("g-ui-popover-dropdown",o==="right"&&"g-ui-popover-right",o==="center"&&"g-ui-popover-center")},n)))}import{Div as Cr}from"@granularjs/core";function us(...e){let{props:i,children:t}=g(e,{position:"left"}),{position:r,content:a,className:o,...n}=i;return Cr({...n,className:s("g-ui-hover-card",o)},t,Cr({className:s("g-ui-hover-card-dropdown",[r,u=>u==="right"?"g-ui-hover-card-right":""],[r,u=>u==="center"?"g-ui-hover-card-center":""])},a))}import{Div as gs}from"@granularjs/core";function ls(...e){let{props:i,children:t}=g(e,{position:"bottom-right"}),{position:r,className:a,...o}=i;return gs({...o,className:s("g-ui-affix",[r,n=>`g-ui-affix-${n}`],a)},t)}import{Fieldset as cs,Legend as ps,when as ds}from"@granularjs/core";function ms(...e){let{props:i,children:t}=g(e),{legend:r,className:a,...o}=i;return cs({...o,className:s("g-ui-fieldset",a)},ds(r,()=>ps({className:"g-ui-legend"},r)),t)}import{Div as fs}from"@granularjs/core";function hs(...e){let{props:i,children:t}=g(e,{position:"sticky"}),{position:r,className:a,...o}=i;return fs({...o,className:s("g-ui-appbar",N("g-ui-appbar-",r,"sticky"),a)},t)}import{Div as Ct,portal as vs,after as Pi,state as Sr,when as Dr}from"@granularjs/core";function bs(...e){let{props:i,children:t}=g(e,{position:"left",size:"md",blur:!0,fixed:!1,minWidth:"button"});return Dr(i.fixed,()=>ws(i,t),()=>xs(i,t))}var xs=(e,i)=>{let{open:t,onClose:r,position:a,size:o,blur:n,fixed:u,minWidth:c,className:d,...p}=e,w=Sr(!1),f=Sr(!1),l=220,b=D=>{if(D){w.set(!0),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>f.set(!0)):setTimeout(()=>f.set(!0),0);return}f.set(!1),setTimeout(()=>w.set(!1),l)};b(!!t.get()),Pi(t).change(D=>b(!!D));let z=Pi(f,n).compute(D=>{let[C,P]=D;return s("g-ui-sidebar-overlay",C&&"g-ui-sidebar-overlay-open",!P&&"g-ui-sidebar-overlay-noblur")}),$=Pi(o,a,f,d).compute(D=>{let[C,P,L,y]=D,k=P==="right"?"g-ui-sidebar-drawer-right g-ui-sidebar-position-right":"g-ui-sidebar-drawer-left";return s("g-ui-sidebar","g-ui-sidebar-drawer",`g-ui-sidebar-size-${C}`,k,L&&"g-ui-sidebar-drawer-open",m(y))});return Dr(w,()=>vs(Ct({className:z,onClick:r},Ct({className:$,onClick:D=>D.stopPropagation()},i))))},ws=(e,i)=>{let{open:t,position:r,size:a,minWidth:o,className:n,...u}=e,c=Pi(a,r,t,o,n).compute(d=>{let[p,w,f,l,b]=d,z=l||"button",$=null;return z==="button"?$="g-ui-sidebar-min-button":z==="xs"?$="g-ui-sidebar-min-xs":z==="sm"?$="g-ui-sidebar-min-sm":z==="md"&&($="g-ui-sidebar-min-md"),s("g-ui-sidebar g-ui-sidebar-fixed",`g-ui-sidebar-size-${p||"md"}`,$,f&&"g-ui-sidebar-fixed-open",b)});return Ct({...u,className:c},i)};import{Div as Ne,when as Mi,list as Pr,after as ne,resolve as pe,state as ys,Img as ks,Span as zs}from"@granularjs/core";var Mr={xs:6,sm:8,md:10,lg:12,xl:14},Ns={xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px"},Cs={xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px"},Ss=14;function Ds(e){if(e==null||e==="")return"var(--g-ui-primary)";let i=String(e).trim();return i.startsWith("#")?i:`var(--g-ui-${i})`}function Ps(e){return(e??[]).map(t=>{if(t==null)return 1;let r=Number(t.weight);return Number.isFinite(r)&&r>=0?r:1})}function Ti(e){let i=(e??[]).length;if(i<2)return{totalWeight:0,cumulativeWeights:[0]};let r=Ps(e).slice(0,i-1),a=r.reduce((n,u)=>n+u,0),o=[0];for(let n=0;n<r.length;n++)o.push(o[n]+r[n]);return{totalWeight:a,cumulativeWeights:o}}function Tr(e,i,t,r){if(r<1||t<=0)return 0;let a=Math.max(0,Math.min(100,e));for(let o=r-1;o>=0;o--){let n=i[o]/t*100;if(a>=n)return o}return 0}function Ms(e,i,t,r,a,o,n){let u=e,c=(n??[]).length;if(c===0)return{activeStep:0,progressPct:0};if(u==="step")return{activeStep:Math.max(0,Math.min(c-1,Math.floor(i??0))),progressPct:0};if(u==="percent"){let d=Math.max(0,Math.min(100,Number(t)||0)),p=Ti(n);return{activeStep:Tr(d,p.cumulativeWeights,p.totalWeight,c),progressPct:d}}if(u==="time"){let d=Number(r)||0,p=a,w=o,f=0;if(Array.isArray(p)&&p.length>=c?f=p.slice(0,c).reduce((C,P)=>C+(Number(P)||0),0):typeof w=="number"&&w>0&&(f=w),f<=0)return{activeStep:0,progressPct:0};let l=f/c,b=0;if(Array.isArray(p)&&p.length>=c){let C=0;for(let P=0;P<c;P++){if(C+=Number(p[P])||0,d<C){b=P;break}b=P}}else b=Math.min(c-1,Math.floor(d/l));let z=Math.min(100,d/f*100),$=Ti(n);return{activeStep:Tr(z,$.cumulativeWeights,$.totalWeight,c),progressPct:z}}return{activeStep:0,progressPct:0}}function Ts(e,i,t,r,a,o){if(a<2||r<0||r>=a-1)return 0;if(e==="step")return i>r?100:0;let{totalWeight:n,cumulativeWeights:u}=o??Ti([]);if(n<=0)return 0;let c=u[r]/n*100,d=u[r+1]/n*100;if(t<=c)return 0;if(t>=d)return 100;let p=d-c;return p<=0?0:(t-c)/p*100}var Vs=0;function Ls(e){let i=document.getElementById(e);if(!i)return[];let t=i.querySelectorAll(".g-ui-timeline-item");if(t.length<2)return[];let r=i.dataset.pinSize||"md",a=Mr[r]??Mr.md,o=[];for(let n=0;n<t.length-1;n++){let u=t[n].offsetTop+a,c=t[n+1].offsetTop-t[n].offsetTop;o.push({top:u,height:c})}return o}function Is(...e){let{props:i,rawProps:t}=g(e,{items:[],mode:"step",active:0,progress:0,elapsedMs:0,stepDurationsMs:null,totalDurationMs:null,clickable:!1,pinRadius:"md",reverseActive:!1,lineWidth:"md",pinSize:"md",activeColor:"primary",align:"left",pinMode:"default"}),{items:r,mode:a,active:o,progress:n,elapsedMs:u,stepDurationsMs:c,totalDurationMs:d,clickable:p,pinRadius:w,reverseActive:f,lineWidth:l,pinSize:b,activeColor:z,align:$,pinMode:D,className:C,...P}=i,{onChange:L}=t,y=ne(z).compute(E=>Ds(pe(E))),k=`g-ui-timeline-${++Vs}`,h=ys([]),S=ne(a,o,n,u,c,d,r).compute(E=>{let[G,J,re,X,M,j,x]=E;return Ms(G,J,re,X,M,j,x)}),V=ne(h,f).compute(([E,G])=>{if(!pe(G)||!E?.length)return null;let J=E[0],re=0;for(let X of E)re+=X.height;return{top:J.top,height:re}}),A=ne(S).compute(E=>E?.progressPct!=null?`${Math.max(0,Math.min(100,E.progressPct))}%`:"0%"),Q=ne(a).compute(E=>{let G=pe(E);return G==="time"||G==="percent"||G==="step"}),se=ne(a).compute(E=>pe(E));function te(){setTimeout(()=>{let E=Ls(k);E.length&&h.set(E)},0)}return ne(r).change(()=>te()),ne(b).change(()=>te()),te(),Ne({...P,id:k,"data-pin-size":ne(b).compute(E=>pe(E)??"md"),"data-active-color":ne(z).compute(E=>{let G=pe(E);if(G==null||typeof G!="string")return"primary";let J=String(G).trim();return J.startsWith("#")?"custom":J||"primary"}),style:ne(z,l,b).compute(([E,G,J])=>{let re={"--g-ui-timeline-line-width":Ns[pe(G)]??"4px","--g-ui-timeline-track-offset":`calc(${Ss}px - var(--g-ui-timeline-line-width) / 2)`,"--g-ui-timeline-pin-half":Cs[pe(J)]??"10px"},X=pe(E);return X&&String(X).trim().startsWith("#")&&(re["--g-ui-timeline-active-color"]=String(X).trim()),re}),className:s("g-ui-timeline",ne(a).compute(E=>E?`g-ui-timeline-mode-${pe(E)}`:""),ne(Q).compute(E=>E?"g-ui-timeline-has-track":""),ne(p).compute(E=>pe(E)?"g-ui-timeline-clickable":""),ne(f).compute(E=>pe(E)?"g-ui-timeline-reverse":""),ne($).compute(E=>pe(E)==="right"?"g-ui-timeline-align-right":""),N("g-ui-timeline-pin-radius-",w,"md"),N("g-ui-timeline-line-width-",l,"md"),N("g-ui-timeline-pin-size-",b,"md"),ne(D).compute(E=>E?`g-ui-timeline-pin-mode-${pe(E)}`:""),C)},Mi(Q,()=>ne(f).compute(E=>pe(E)?Ne({className:"g-ui-timeline-track-segment g-ui-timeline-track-reverse",style:ne(V).compute(G=>G?{top:`${G.top}px`,height:`${G.height}px`}:{})},Ne({className:"g-ui-timeline-track-fill",style:ne(A).compute(G=>G?{height:G}:{height:"0%"})})):Pr(h,(G,J)=>{let re=ne(G).compute(j=>j?{top:`${j.top}px`,height:`${j.height}px`}:{}),X=ne(S,J,r,se).compute(([j,x,B,R])=>{let q=B??[],Y=q.length,oe=Ti(q);return Ts(R,j?.activeStep??0,j?.progressPct??0,pe(x)??0,Y,oe)}),M=ne(X).compute(j=>`${Math.max(0,Math.min(100,j))}%`);return Ne({className:"g-ui-timeline-track-segment",style:ne(re).compute(j=>j)},Ne({className:"g-ui-timeline-track-fill",style:ne(M).compute(j=>j?{height:j}:{height:"0%"})}))}))),Pr(r,(E,G)=>{let J=ne(S,G,r,f).compute(([q,Y,oe,ve])=>{let ze=q?.activeStep??0,Pe=pe(Y)??0,_e=(oe??[]).length,Ze=pe(ve)?_e-1-Pe:Pe;return Ze<ze?"completed":Ze===ze?"active":"future"}),re=ne(J).compute(q=>q?`g-ui-timeline-item-${q}`:""),X=pe(p)&&typeof L=="function"?()=>{let q=pe(G);typeof q=="number"&&L(q)}:void 0,M=ne(D).compute(q=>pe(q)??"default"),j=ne(M,E).compute(([q,Y])=>{let oe=q??"default";return oe==="icon"&&(Y?.icon!=null||Y?.pinIcon!=null)?zs({className:"g-ui-timeline-pin-icon material-symbols-outlined"},Y.icon??Y.pinIcon??""):oe==="image"&&(Y?.image!=null||Y?.pinImage!=null||Y?.src!=null)?ks({className:"g-ui-timeline-pin-image",src:Y.image??Y.pinImage??Y.src,alt:Y.pinImageAlt??""}):oe==="custom"&&Y?.pinContent!=null?Y.pinContent:null}),x=ne(M,E).compute(([q,Y])=>{let oe=q??"default";return oe==="icon"?Y?.icon!=null||Y?.pinIcon!=null:oe==="image"?Y?.image!=null||Y?.pinImage!=null||Y?.src!=null:oe==="custom"?Y?.pinContent!=null:!1}),B=Ne({className:"g-ui-timeline-dot"},Ne({className:"g-ui-timeline-dot-inner"}),Mi(x,()=>j)),R=Ne({className:"g-ui-timeline-content"},Mi(E.title,()=>Ne({className:"g-ui-timeline-title"},E.title)),Mi(E.description,()=>Ne({className:"g-ui-timeline-desc"},E.description)),E.content);return Ne({className:s("g-ui-timeline-item",re),style:ne(y).compute(q=>q?{"--g-ui-timeline-active-color":q}:void 0),onClick:X,role:X?"button":void 0,tabIndex:X?0:void 0},Ne({className:"g-ui-dot-wrapper"},B),R)}))}import{Div as Vi,list as $s}from"@granularjs/core";function As(...e){let{props:i}=g(e,{active:0,items:[]}),{active:t,items:r,className:a,...o}=i;return Vi({...o,className:s("g-ui-stepper",a)},$s(r,(n,u)=>Vi({className:s("g-ui-stepper-item",[t,c=>(console.log("value",c,"idx",u),u.get()===c?"g-ui-stepper-active":"")])},Vi({className:"g-ui-stepper-index"},String(u+1)),Vi({className:"g-ui-stepper-label"},n.label))))}import{Span as Vr,after as Lr,state as Bs}from"@granularjs/core";function Fs(...e){let{props:i,rawProps:t}=g(e,{value:0,max:5,size:"md"}),{value:r,max:a,size:o,className:n,...u}=i,{onChange:c}=t,d=Bs(m(r));Lr(r).change(l=>{let b=m(l);b!=null&&d.set(b)});let p=l=>{d.set(l),c?.(l)},w=[],f=Number(m(a))||0;for(let l=1;l<=f;l+=1)w.push(l);return Vr({...u,className:s("g-ui-rating",N("g-ui-rating-size-",o,"md"),i.className??n)},w.map(l=>Vr({className:s("g-ui-rating-item",Lr(d).compute(b=>l<=b?"g-ui-rating-item-active":"")),onClick:()=>p(l)},"\u2605")))}import{Span as Es}from"@granularjs/core";function js(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Es({...a,className:s("g-ui-tag",r)},t)}import{Button as Ir,Div as Xe,state as $r,after as Li}from"@granularjs/core";var Rs=["S","M","T","W","T","F","S"];function ui(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{value:r,className:a,size:o,...n}=i,{onChange:u}=t,c=C=>{let P=m(C);if(P instanceof Date)return P;if(P==null)return null;let L=new Date(P);return Number.isNaN(L.getTime())?null:L},d=$r(c(r)??new Date),p=$r(new Date(d.get()));Li(r).change(C=>{let P=c(C);P!=null&&(d.set(P),p.set(new Date(P)))});let w=(C,P,L)=>{let y=new Date(C,P+1,0).getDate();return new Date(C,P,Math.min(L,y))},f=C=>{let P=p.get(),L=w(P.getFullYear(),P.getMonth(),C);d.set(L),p.set(L),u?.(L)},l=C=>{let P=p.get(),L=w(P.getFullYear(),P.getMonth()+C,P.getDate());p.set(L)},b=C=>{let P=p.get(),L=w(P.getFullYear()+C,P.getMonth(),P.getDate());p.set(L)},z=Li(p).compute(C=>C.toLocaleString("default",{month:"long"})),$=Li(p).compute(C=>String(C.getFullYear())),D=Li(p,d).compute(([C,P])=>{let L=C.getFullYear(),y=C.getMonth(),h=new Date(L,y,1).getDay(),S=new Date(L,y+1,0).getDate(),V=[];for(let A=0;A<h;A+=1)V.push({muted:!0,label:""});for(let A=1;A<=S;A+=1)V.push({label:A});return[...Rs.map(A=>Xe({className:"g-ui-calendar-cell g-ui-calendar-cell-muted"},A)),...V.map(A=>Xe({className:s("g-ui-calendar-cell",A.muted&&"g-ui-calendar-cell-muted",A.label&&P.getFullYear()===L&&P.getMonth()===y&&A.label===P.getDate()&&"g-ui-calendar-cell-active"),onClick:()=>A.label&&f(A.label)},A.label))]});return Xe({...n,className:s("g-ui-calendar",a,N("g-ui-calendar-size-",o,"md"))},Xe({className:"g-ui-calendar-header"},Oe({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>l(-1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:wi})),Xe({className:"g-ui-calendar-title-group"},Ir({type:"button",className:"g-ui-calendar-title-button",onClick:()=>l(1)},z),Ir({type:"button",className:"g-ui-calendar-title-button",onClick:()=>b(1)},$)),Oe({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>l(1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:xi}))),Xe({className:"g-ui-calendar-grid"},D))}import{Div as gi,Span as Ke,Input as Hs,when as St,after as De,state as Ii}from"@granularjs/core";function Ws(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md",searchable:!0}),{value:r,data:a,size:o,className:n,placeholder:u,searchable:c,...d}=i,{onChange:p,onSearchChange:w}=t,f=Ii(m(r)??[]),l=Ii(""),b=Ii(!1),z=Ii(null),$=h=>(m(h)??[]).map(V=>typeof V=="string"?{value:V,label:V}:V&&typeof V=="object"?V:{value:String(V),label:String(V)});De(r).change(h=>{let S=m(h);S!=null&&f.set(S)});let D=null;De(b).change(h=>{if(D&&(D(),D=null),!h)return;let S=V=>{let A=z.get();A&&(A.contains(V.target)||b.set(!1))};document.addEventListener("mousedown",S),D=()=>document.removeEventListener("mousedown",S)}),De(l).change(h=>{w?.(h)});let C=h=>{let S=f.get()??[],V=S.includes(h)?S.filter(A=>A!==h):S.concat(h);f.set(V),p?.(V)},P=De(a).compute(h=>$(h)),L=De(P,l).compute(([h,S])=>{let V=String(m(S)??"").toLowerCase().trim();return V?h.filter(A=>String(A.label??"").toLowerCase().includes(V)):h}),y=De(f,l).compute(([h,S])=>{let V=m(h)??[],A=String(m(S)??"");return!V.length&&!A}),k=De(c).compute(h=>!!h);return gi({...d,node:z,className:s("g-ui-select-multi-root",n)},gi({className:s("g-ui-select-multi",N("g-ui-select-multi-size-",o,"md")),onClick:()=>b.set(!0)},De(P,f).compute(([h,S])=>(m(S)??[]).map(A=>{let se=(h??[]).find(te=>te.value===A)?.label??A;return Ke({className:"g-ui-select-tag"},Ke({className:"g-ui-select-tag-label",onClick:te=>{te?.stopPropagation?.()}},se),Ke({className:"g-ui-select-tag-remove",innerHTML:Be,onClick:te=>{te?.stopPropagation?.(),C(A)}}))})),St(y,()=>Ke({className:"g-ui-select-multi-placeholder"},u??"Select...")),St(k,()=>Hs({className:"g-ui-select-multi-input",value:l,onInput:h=>l.set(h.target?.value??""),onFocus:()=>b.set(!0)}))),St(b,()=>gi({className:"g-ui-select-dropdown"},De(L).compute(h=>h.length?h.map(S=>gi({className:s("g-ui-select-item",S.disabled&&"g-ui-select-item-disabled",De(f).compute(V=>(m(V)??[]).includes(S.value)?"g-ui-select-item-active":"")),onClick:()=>{S.disabled||C(S.value)}},Ke({className:"g-ui-select-item-check",innerHTML:De(f).compute(V=>(m(V)??[]).includes(S.value)?yi:"")}),Ke({className:"g-ui-select-item-label"},S.label))):gi({className:"g-ui-select-item"},"Nothing found")))))}import{Div as Ys,list as Gs,portal as _s}from"@granularjs/core";import{Div as Dt,Button as Os,when as Ar,state as qs}from"@granularjs/core";function Pt(...e){let{props:i,rawProps:t,children:r}=g(e),{title:a,className:o,...n}=i,{onClose:u}=t,c=qs(!0),d=()=>{c.set(!1),u?.(),console.log("close")};return Ar(c,()=>Dt({...n,className:s("g-ui-toast",o)},Dt({className:"g-ui-toast-row"},Ar(a,()=>Dt({className:"g-ui-toast-title"},a)),Os({className:"g-ui-toast-close",onClick:d},ye({innerHTML:Be}))),r))}function Zs(...e){let{props:i,rawProps:t}=g(e,{items:[]}),{items:r,className:a,timeout:o,...n}=i,{onClose:u}=t;return _s(Ys({...n,className:s("g-ui-toast-stack",a)},Gs(r,c=>Pt({title:c.title,onClose:()=>u?.(c)},c.message))))}function Us(...e){let{props:i}=g(e);return ui(i)}import{Div as Xs,after as Ks}from"@granularjs/core";function Qs(...e){let{props:i,rawProps:t}=g(e,{items:[],position:"top-right"}),{items:r,position:a,className:o,...n}=i,{onRemove:u}=t,c=new Map,d=(w,f)=>w?.id??w?.key??f,p=Ks(r).compute(w=>{let f=m(w)??[],l=new Set;f.forEach((b,z)=>{let $=d(b,z);if(l.add($),b?.autoClose&&!c.has($)){let D=setTimeout(()=>{c.delete($),u?.(b)},b.autoClose);c.set($,D)}});for(let[b,z]of c.entries())l.has(b)||(clearTimeout(z),c.delete(b));return f.map((b,z)=>ct({key:d(b,z),title:b.title,color:b.color,icon:b.icon,loading:b.loading,withCloseButton:b.withCloseButton,withBorder:b.withBorder,onClose:()=>{b.onClose?.(),u?.(b)}},b.message??b.body??b.content??b.text))});return Xs({...n,className:s("g-ui-notifications",N("g-ui-notifications-position-",a,"top-right"),o)},p)}import{Div as Qe,after as li,state as Js,when as eu}from"@granularjs/core";function iu(...e){let{props:i,rawProps:t}=g(e,{min:0,max:100,step:1,size:"md"}),{value:r,marks:a,min:o,max:n,step:u,size:c,disabled:d,className:p,...w}=i,{onChange:f}=t,l=Js(m(r??[o,n])),b=()=>{let y=Number(m(o)),k=Number(m(n));return!Number.isFinite(y)||!Number.isFinite(k)?{minValue:0,maxValue:100}:{minValue:Math.min(y,k),maxValue:Math.max(y,k)}},z=()=>{let y=Number(m(u));return Number.isFinite(y)&&y>0?y:1},$=y=>{let{minValue:k,maxValue:h}=b(),S=z(),V=[k,h];Array.isArray(y)&&(V=y);let A=Math.max(k,Math.min(h,Number(V[0]))),Q=Math.max(k,Math.min(h,Number(V[1]))),se=Math.round(Math.min(A,Q)/S)*S,te=Math.round(Math.max(A,Q)/S)*S;return[se,te]};li(r).change(y=>{y!=null&&l.set($(y))});let D=y=>{let k=$(y);k?.[0]===l.get()?.[0]&&k?.[1]===l.get()?.[1]||(l.set(k),f?.(k))},C=li(l).compute(y=>{let{minValue:k,maxValue:h}=b(),S=h-k,[V,A]=$(y);if(S<=0)return{lowPct:0,highPct:0};let Q=(V-k)/S*100,se=(A-k)/S*100;return{lowPct:Math.max(0,Math.min(100,Q)),highPct:Math.max(0,Math.min(100,se))}}),P=(y,k,h)=>{let S=k?.();if(!S||S.width===0)return;let A=Math.min(Math.max(y.clientX-S.left,0),S.width)/S.width,{minValue:Q,maxValue:se}=b(),te=Q+A*(se-Q),E=l;typeof l.get=="function"&&(E=l.get());let[G,J]=$(E);D(h==="low"?[te,J]:[G,te])},L=(y,k,h)=>{if(ke(d))return;y.preventDefault?.();let S=h||y.currentTarget,V=()=>S.getBoundingClientRect(),A=V(),Q=C;typeof C.get=="function"&&(Q=C.get());let{lowPct:se,highPct:te}=Q,E=(y.clientX-A.left)/A.width*100,G=k;if(!G){let X=Math.abs(E-se)<=Math.abs(E-te);G="high",X&&(G="low")}S.setPointerCapture?.(y.pointerId),P(y,V,G);let J=X=>P(X,V,G),re=()=>{S.releasePointerCapture?.(y.pointerId),window.removeEventListener("pointermove",J),window.removeEventListener("pointerup",re)};window.addEventListener("pointermove",J),window.addEventListener("pointerup",re)};return Qe({...w,className:s("g-ui-range-slider",N("g-ui-slider-size-",c,"md"),U("g-ui-slider-disabled",d),i.className??p)},Qe({className:"g-ui-slider-track",onPointerDown:y=>L(y)},Qe({className:"g-ui-slider-bar",style:li(C).compute(({lowPct:y,highPct:k})=>({left:`${y}%`,width:`${Math.max(0,k-y)}%`}))}),Qe({className:"g-ui-slider-thumb",style:li(C).compute(({lowPct:y})=>({left:`${y}%`})),onPointerDown:y=>{y.stopPropagation?.(),L(y,"low",y.currentTarget.parentElement)}}),Qe({className:"g-ui-slider-thumb",style:li(C).compute(({highPct:y})=>({left:`${y}%`})),onPointerDown:y=>{y.stopPropagation?.(),L(y,"high",y.currentTarget.parentElement)}})),eu(a,()=>Qe({className:"g-ui-slider-marks"},a.map(y=>vt({mark:y,getBounds:b})))))}import{state as Mt,after as Br}from"@granularjs/core";function $i(...e){let{props:i,rawProps:t}=g(e,{size:"md",format:{pattern:"dddd-dd-dd"}}),{value:r,size:a,calendarSize:o,leftSection:n,rightSection:u,className:c,format:d,minDate:p,maxDate:w,...f}=i,{onChange:l}=t,b=k=>{let h=m(k);if(h instanceof Date)return h;if(h==null||h==="")return null;let S=new Date(h);return Number.isNaN(S.getTime())?null:S},z=(k,h)=>k&&h&&k.getFullYear()===h.getFullYear()&&k.getMonth()===h.getMonth()&&k.getDate()===h.getDate(),$=k=>{if(!k)return"";let h=String(k.getFullYear()).padStart(4,"0"),S=String(k.getMonth()+1).padStart(2,"0"),V=String(k.getDate()).padStart(2,"0");return`${h}-${S}-${V}`},D=k=>{let h=String(k??"").replace(/\D/g,"");if(h.length<8)return null;let S=Number(h.slice(0,4)),V=Number(h.slice(4,6)),A=Number(h.slice(6,8));if(!S||!V||!A)return null;let Q=new Date(S,V-1,A);if(Q.getFullYear()!==S||Q.getMonth()!==V-1||Q.getDate()!==A)return null;let se=b(p);if(se&&Q<se)return null;let te=b(w);return te&&Q>te?null:Q},C=Mt(b(r)),P=Mt($(C.get())),L=Mt(!1);Br(r).change(k=>{let h=b(k);if(!z(h,C.get())){if(h==null){C.set(null),P.set("");return}C.set(h),P.set($(h))}}),Br(P).change(k=>{let h=D(k);h&&(z(h,C.get())||(C.set(h),l?.(h)))});let y=k=>{k&&(z(k,C.get())||(C.set(k),P.set($(k)),l?.(k),L.set(!1)))};return Nt({opened:L,onChange:k=>L.set(!!k),content:ui({size:N("",o,"xs"),value:C,onChange:y}),className:"g-ui-date-input-popover"},be({...f,size:a,className:s("g-ui-dateinput",c),leftSection:n,rightSection:u,type:"text",inputMode:"numeric",format:d,value:P,onChange:k=>P.set(k)}))}import{Div as Tt,when as tu,after as ru,state as au}from"@granularjs/core";function ou(...e){let{props:i,rawProps:t,children:r}=g(e),{opened:a,content:o,className:n,...u}=i,{onChange:c}=t,d=au(m(a)??!1);ru(a).change(w=>{let f=m(w);f!=null&&d.set(!!f)});let p=w=>{d.set(w),c?.(w)};return Tt({...u,className:s("g-ui-popper",n)},Tt({onClick:()=>p(!d.get())},r),tu(d,()=>Tt({className:"g-ui-popper-dropdown"},o)))}import{Button as nu,after as Fr,when as su,state as uu}from"@granularjs/core";function gu(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{size:r,className:a,rightSection:o,...n}=i,{onChange:u}=t,c=uu(!1),d=Fr(c).compute(w=>w?"text":"password"),p=Fr(o).compute(w=>w??nu({className:"g-ui-password-toggle",onClick:()=>c.set(!c.get())},su(c,()=>"Hide",()=>"Show")));return be({...n,size:r,className:a,onChange:u,rightSection:p,type:d})}import{Div as lu}from"@granularjs/core";function cu(...e){let{props:i}=g(e,{size:"md"}),{size:t,className:r,...a}=i;return be({...a,size:t,className:r,leftSection:lu({className:"g-ui-search-input-left-section",innerHTML:Qt}),type:"text",inputMode:"search"})}import{Button as pu,after as du,when as Er}from"@granularjs/core";import{state as mu}from"@granularjs/core";function fu(...e){let{props:i,children:t}=g(e,{value:"",timeout:1500}),{value:r,timeout:a,className:o,...n}=i,u=mu(!1),c=du(u).compute(p=>s("g-ui-copy-button",p&&"g-ui-copy-button-done",o));return pu({...n,className:c,onClick:async()=>{try{await navigator.clipboard.writeText(String(r)),u.set(!0),setTimeout(()=>u.set(!1),a)}catch{}},type:"button"},Er(t?.length,()=>t,()=>Er(u,()=>"Copied",()=>"Copy")))}import{Div as jr,after as ci,resolve as hu}from"@granularjs/core";function Rr(e){let i=Number(e);return Number.isNaN(i)?0:Math.max(0,Math.min(100,i))}function vu(...e){let{props:i}=g(e,{size:"md",value:null,color:"primary"}),{size:t,value:r,color:a,className:o,...n}=i,u=ci(r).compute(f=>f!=null&&f!==""),c=ci(r).compute(f=>Rr(f)),d=ci(c,u).compute(([f,l])=>{if(!l)return{};let b=Number(f),z=Number.isNaN(b)?0:Math.max(0,Math.min(360,b*3.6));return{background:`conic-gradient(var(--g-ui-progress-ring-fill, var(--g-ui-primary)) 0deg ${z}deg, var(--g-ui-border-muted) ${z}deg 360deg)`}}),p=ci(u).compute(f=>f?"":"g-ui-progress-ring-indeterminate"),w=ci(u,r).compute(([f,l])=>f?Rr(l):void 0);return jr({...n,className:s("g-ui-progress-ring",N("g-ui-progress-ring-",a,"primary"),[t,f=>`g-ui-progress-ring-size-${hu(f)??"md"}`],p,o),style:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":w},jr({className:"g-ui-progress-ring-hole"}))}import{Div as Ai,state as Lt,after as qe,list as xu,when as wu}from"@granularjs/core";import{Div as bu}from"@granularjs/core";function Vt(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,className:a,...o}=i;return bu({...o,className:s("g-ui-scroll-area",[r,n=>`g-ui-scroll-area-${n}`],a)},t)}function Ie(e,i){if(i==null||i==="")return e;let t=String(i).trim().split("."),r=e;for(let a of t)r=r?.[a];return r}function yu(e,i,t){let r=t(i);return String(r??"").toLowerCase().includes(String(e??"").toLowerCase())}function It(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md",valuePath:"value",labelPath:"label"}),{data:r,value:a,size:o,valuePath:n,labelPath:u,filter:c,placeholder:d,label:p,description:w,error:f,leftSection:l,rightSection:b,className:z,inputClassName:$,disabled:D,...C}=i,{onChange:P,renderItem:L}=t,y=Lt(!1),k=Lt(""),h=Lt(m(a));qe(a).change(x=>{let B=m(x);B!==h.get()&&h.set(B)});let S=qe(r).compute(x=>Array.isArray(x)?x:[]),V=qe(S,h,n).compute(([x,B,R])=>{if(B==null)return null;let q=Y=>R==null||R===""?Y:Ie(Y,R);return x.find(Y=>q(Y)===B)??null}),A=qe(V,y,k,u).compute(([x,B,R,q])=>{let Y=oe=>q==null||q===""?String(oe??""):String(Ie(oe,q)??"");return B?R??"":x?Y(x):""}),Q=qe(S,k,c,u).compute(([x,B,R,q])=>{let Y=ve=>q==null||q===""?String(ve??""):String(Ie(ve,q)??""),oe=m(R)??yu;return x.filter(ve=>oe(B,ve,Y))}),se=x=>{let B=m(n),R=B==null||B===""?x:Ie(x,B);h.set(R),k.set(""),y.set(!1),P?.(R)},te=()=>{if(m(D))return;y.set(!0);let x=V.get(),B=m(u),R=q=>B==null||B===""?String(q??""):String(Ie(q,B)??"");k.set(x?R(x):"")},E=()=>{y.set(!1);let x=V.get(),B=m(u),R=q=>B==null||B===""?String(q??""):String(Ie(q,B)??"");k.set(x?R(x):"")},{onChange:G,...J}=C,re={...J,size:o,label:p,description:w,error:f,leftSection:l,rightSection:b,placeholder:m(d)??void 0,disabled:D,value:A,onInput:x=>k.set(x?.target?.value??""),onFocus:te,onClick:te,onBlur:()=>setTimeout(()=>E(),150)},X=x=>{let B=m(n);return B==null||B===""?x:Ie(x,B)},M=x=>qe(h,n).compute(([B,R])=>(Y=>R==null||R===""?Y:Ie(Y,R))(x)===B?"g-ui-autocomplete-item-active":""),j=x=>{if(L&&typeof L=="function"){let B=L(x);if(B!=null)return Ai({className:s("g-ui-autocomplete-item",M(x)),onClick:()=>se(x),role:"option"},B)}return Ai({className:s("g-ui-autocomplete-item",M(x)),onClick:()=>se(x),role:"option"},qe(u).compute(B=>B==null||B===""?String(x??""):String(Ie(x,B)??"")))};return Ai({className:s("g-ui-autocomplete",z,U("g-ui-autocomplete-disabled",D))},be({...re,className:s("g-ui-autocomplete-input-wrapper",re.className),inputClassName:s("g-ui-autocomplete-input",$)}),wu(y,()=>Ai({className:"g-ui-autocomplete-dropdown",role:"listbox"},Vt({className:"g-ui-autocomplete-list",style:{maxHeight:"240px"}},xu(Q,x=>j(x))))))}function ku(...e){return It(...e)}import{Div as zu,Span as Nu,state as Hr,after as Cu}from"@granularjs/core";function Wr(e){let i=m(e);if(i instanceof Date)return i;if(i==null||i==="")return null;let t=new Date(i);return Number.isNaN(t.getTime())?null:t}function Or(e){let i=m(e);if(i==null)return[null,null];let t=Array.isArray(i)?i:[i];return[Wr(t[0]),Wr(t[1])]}function qr(e,i){return!e||!i?e===i:e.getFullYear()===i.getFullYear()&&e.getMonth()===i.getMonth()&&e.getDate()===i.getDate()}function Su(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{value:r,size:a,minDate:o,maxDate:n,className:u,placeholderMin:c,placeholderMax:d,...p}=i,{onChange:w}=t,[f,l]=Or(r),b=Hr(f),z=Hr(l);Cu(r).change(P=>{let[L,y]=Or(P);qr(L,b.get())&&qr(y,z.get())||(b.set(L),z.set(y))});let $=()=>{let P=b.get(),L=z.get();w?.([P??null,L??null])},D=P=>{let L=z.get();P&&L&&P>L&&z.set(P),b.set(P),$()},C=P=>{let L=b.get();P&&L&&P<L&&b.set(P),z.set(P),$()};return zu({...p,className:s("g-ui-range-picker",i.className??u)},$i({...p,size:a,value:b,onChange:D,maxDate:z,placeholder:m(c)??void 0}),Nu({className:"g-ui-range-picker-separator"},"\u2013"),$i({...p,size:a,value:z,onChange:C,minDate:b,placeholder:m(d)??void 0}))}import{Div as Du}from"@granularjs/core";function Pu(...e){let{props:i,children:t}=g(e,{align:"center",direction:"row"}),{direction:r,wrap:a,align:o,justify:n,gap:u,className:c,...d}=i;return Du({...d,className:s("g-ui-flex",[r,p=>p==="column"?"g-ui-flex-column":"g-ui-flex-row"],[a,"g-ui-flex-wrap"],[o,p=>p&&`g-ui-align-${p}`],[n,p=>p&&`g-ui-justify-${p}`],[u,p=>p&&`g-ui-gap-${p}`],c)},t)}import{A as Mu,Div as pi,Span as Yr,when as di,after as Gr,state as Tu}from"@granularjs/core";function Vu(...e){let{props:i,rawProps:t,children:r}=g(e,{variant:"subtle",childrenOffset:24}),{label:a,description:o,leftSection:n,rightSection:u,active:c,disabled:d,variant:p,childrenOffset:w,opened:f,defaultOpened:l,className:b,padding:z,...$}=i,{onClick:D,onChange:C}=t,P=r.length>0,L=Tu(m(f)??m(l)??!1);Gr(f).change(h=>{let S=m(h);S!=null&&L.set(!!S)});let y=Gr(w).compute(h=>({paddingLeft:Gt(m(h??24))??"24px"})),k=h=>{if(m(d)){h?.preventDefault?.();return}if(P){let S=!L.get();L.set(S),C?.(S)}D?.(h)};return pi({className:s("g-ui-navlink-root",b)},Mu({...$,className:s("g-ui-navlink",N("g-ui-navlink-variant-",p,"subtle"),U("g-ui-navlink-active",c),U("g-ui-navlink-disabled",d),N("g-ui-navlink-padding-",z,"md")),onClick:k},di(n,()=>Yr({className:"g-ui-navlink-section g-ui-navlink-left"},n)),pi({className:"g-ui-navlink-body"},di(a,()=>pi({className:"g-ui-navlink-label"},a)),di(o,()=>pi({className:"g-ui-navlink-description"},o))),di(u,()=>Yr({className:"g-ui-navlink-section g-ui-navlink-right"},u))),P?di(L,()=>pi({className:"g-ui-navlink-children",style:y},r)):null)}import{Div as _r,when as Lu}from"@granularjs/core";function Iu(...e){let{props:i,children:t}=g(e,{show:!0,position:"top-right",color:"danger",size:"md"}),{show:r,position:a,color:o,size:n,className:u,...c}=i;return _r({...c,className:s("g-ui-indicator",N("g-ui-indicator-position-",a,"top-right"),N("g-ui-indicator-color-",o,"danger"),N("g-ui-indicator-size-",n,"md"),u)},t,Lu(r,()=>_r({className:"g-ui-indicator-badge"})))}import{Span as Bi}from"@granularjs/core";function $u(...e){let{props:i}=g(e),{opened:t,className:r,...a}=i;return Bi({...a,className:s("g-ui-burger",[t,"g-ui-burger-open"],r)},Bi(""),Bi(""),Bi(""))}import{Div as Au,when as Bu}from"@granularjs/core";function Fu(...e){let{props:i}=g(e),{visible:t,...r}=i;return Bu(t,()=>Au({...r,className:"g-ui-loading-overlay"},ai({})))}import{Div as Eu}from"@granularjs/core";function ju(...e){let{props:i,children:t}=g(e,{gap:"md"}),{className:r,gap:a,...o}=i;return Eu({...o,className:s("g-ui-grid-system",[a,n=>`g-ui-gap-${n}`],r)},t)}import{Div as Ru}from"@granularjs/core";function Hu(...e){let{props:i,children:t}=g(e,{span:12}),{span:r,className:a,...o}=i;return Ru({...o,className:s([r,n=>`g-ui-col-span-${n}`],a)},t)}import{Div as Zr,Input as Wu,after as $e,state as $t,when as Ur,list as Ou}from"@granularjs/core";function qu(...e){let{props:i,rawProps:t}=g(e,{length:4,size:"md",type:"alphanumeric",mask:!1,placeholder:"\u25CB",disabled:!1,error:!1,oneTimeCode:!1}),{length:r,value:a,size:o,type:n,mask:u,placeholder:c,disabled:d,error:p,oneTimeCode:w,className:f}=i,{onChange:l,onComplete:b}=t,z=$t(m(r)??4),$=()=>z.get();$e(r).change(M=>{let j=m(M)??4,x=z.get();if(j===x)return;z.set(j);let B=C.get(),R=D.get();C.set(Array.from({length:j},(q,Y)=>B[Y]??"")),D.set(Array.from({length:j},(q,Y)=>R[Y]??null))});let D=$t(Array.from({length:$()},()=>null)),C=$t(Array.from({length:$()},(M,j)=>{let x=m(a);return typeof x=="string"||Array.isArray(x)?x[j]??"":""}));$e(a).change(M=>{if(M==null)return;let j=$();typeof M=="string"?C.set(Array.from({length:j},(x,B)=>M[B]??"")):Array.isArray(M)&&C.set(Array.from({length:j},(x,B)=>M[B]??""))});let P=()=>C.get().join(""),L=M=>{C.set(M);let j=M.join("");l?.(j),M.every(x=>x!=="")&&M.length===$()&&b?.(j)},y=M=>{let j=$(),x=D.get();M>=0&&M<j&&x[M]&&(x[M].focus(),x[M].select())},k=()=>{let M=m(n);return M==="number"?/^[0-9]$/:M instanceof RegExp?M:/^[a-zA-Z0-9]$/},h=(M,j)=>{let x=j.target.value,B=k();if(x.length>1){S(M,x);return}if(x&&!B.test(x)){j.target.value=C.get()[M]??"";return}let R=C.get().slice();R[M]=x,L(R),x&&M<$()-1&&y(M+1)},S=(M,j)=>{let x=k(),B=j.split("").filter(oe=>x.test(oe)),R=C.get().slice(),q=$();B.forEach((oe,ve)=>{let ze=M+ve;ze<q&&(R[ze]=oe)}),L(R);let Y=R.findIndex((oe,ve)=>ve>=M&&oe==="");Y>=0?y(Y):y(Math.min(M+B.length,q-1))},V=(M,j)=>{if(j.key==="Backspace"){let x=C.get().slice();x[M]===""&&M>0?(j.preventDefault(),x[M-1]="",L(x),y(M-1)):x[M]!==""&&(x[M]="",L(x))}else j.key==="ArrowLeft"&&M>0?(j.preventDefault(),y(M-1)):j.key==="ArrowRight"&&M<$()-1&&(j.preventDefault(),y(M+1))},A=(M,j)=>{j.target.select()},Q=()=>{let M=C.get(),j=M.findIndex(x=>x==="");j>=0?y(j):y(M.length-1)},se=$e(u).compute(M=>m(M)?"password":"text"),te=$e(n).compute(M=>m(M)==="number"?"numeric":"text"),E=$e(w).compute(M=>m(M)?"one-time-code":"off"),G=$e(d).compute(M=>!!m(M)),J=$e(p).compute(M=>!!m(M)),re=$e(z).compute(M=>Array.from({length:M},(j,x)=>x)),X=M=>Wu({className:s("g-ui-pin-input-field",Ur(J,()=>"g-ui-pin-input-error")),type:se,inputMode:te,autocomplete:E,maxLength:2,placeholder:Ur(G,()=>"",()=>c),disabled:G,value:$e(C,M).compute(([j,x])=>j[x]??""),node:D[M.get()],onInput:j=>h(M.get(),j),onChange:j=>h(M.get(),j),onKeyDown:j=>V(M.get(),j),onFocus:j=>A(M.get(),j)});return Zr({className:s("g-ui-pin-input",N("g-ui-input-size-",o,"md"),f),onClick:Q},Zr({className:"g-ui-pin-input-wrapper"},Ou(re,X)))}import{Div as Yu}from"@granularjs/core";function Gu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Yu({...a,className:s("g-ui-checkbox-group",r)},t)}import{Div as _u}from"@granularjs/core";function Zu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return _u({...a,className:s("g-ui-avatar-group",r)},t)}import{Div as Uu}from"@granularjs/core";function Xu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Uu({...a,className:s("g-ui-badge-group",r)},t)}import{Div as Fi,Span as Ku,after as mi,context as Xr}from"@granularjs/core";var Qu=Xr([]),Kr=Xr({sort:null,onSort:null});function At(...e){let{props:i,rawProps:t,children:r}=g(e,{sizes:[],sort:null,stickyHeader:!1}),{className:a,sizes:o,sort:n,stickyHeader:u,...c}=i,{onSort:d}=t,p=Qu.scope(o.get());mi(o).change(f=>p.set(f));let w=Kr.scope({sort:n.get(),onSort:d||null});return mi(n).change(f=>w.set().sort=f),p.serve(w.serve(Fi({className:s("g-ui-grid-table",U("g-ui-grid-table-sticky",u),a),style:{gridTemplateColumns:mi(p).compute(f=>Array.isArray(f)?f.join(" "):"")},...c},r)))}At.GridRow=(...e)=>{let{props:i,children:t}=g(e,{}),{className:r,header:a,...o}=i;return Fi({className:s("g-ui-grid-table-row",U("g-ui-grid-table-row-header",a),r),...o},...t)};At.GridCell=function(...e){let{props:i,rawProps:t,children:r}=g(e,{}),{className:a,sort:o,...n}=i,u=t.sort;if(u){let c=Kr.state(),d=mi(c.sort).compute(w=>w?.key===u?w.direction:null),p=()=>{let w=c.get().sort,f;w?.key===u?f=w.direction==="asc"?{key:u,direction:"desc"}:null:f={key:u,direction:"asc"},c.set().sort=f;let{onSort:l}=c.get();l&&l(f)};return Fi({className:s("g-ui-grid-table-cell","g-ui-grid-table-cell-sortable",a),onClick:p,...n},r,Ku({className:"g-ui-grid-table-sort-icon"},mi(d).compute(w=>w==="asc"?" \u2191":w==="desc"?" \u2193":"")))}return Fi({className:s("g-ui-grid-table-cell",a),...n},r)};import{Button as Ju,Div as eg,Span as Qr,when as Jr}from"@granularjs/core";function ea(...e){let{props:i,children:t}=g(e,{grow:!0}),{grow:r,className:a,...o}=i;return eg({...o,className:s("g-ui-bottombar",U("g-ui-bottombar-grow",r),a)},t)}ea.Action=function(...i){let{props:t,rawProps:r,children:a}=g(i,{variant:"subtle"}),{icon:o,label:n,active:u,disabled:c,variant:d,className:p,...w}=t,{onClick:f}=r;return Ju({...w,className:s("g-ui-bottombar-action",N("g-ui-bottombar-action-variant-",d,"subtle"),U("g-ui-bottombar-action-active",u),U("g-ui-bottombar-action-disabled",c),p),onClick:f,disabled:c},Jr(o,()=>Qr({className:"g-ui-bottombar-action-icon"},o)),Jr(n,()=>Qr({className:"g-ui-bottombar-action-label"},n)),a)};import{Div as W,Button as Ye,state as de,after as Ce,when as me,Input as Ei,Label as fi,Span as Ge}from"@granularjs/core";var ig=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tg=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"}];function ji(e){if(e instanceof Date)return e;if(e==null)return null;let i=new Date(e);return Number.isNaN(i.getTime())?null:i}function ra(e){let i=ji(e.start),t=ji(e.end);return!i||!t?null:{...e,id:e.id??`${i.getTime()}-${e.title??"event"}`,title:e.title??"",start:i,end:t,allDay:!!e.allDay,description:e.description??"",location:e.location??"",attendees:Array.isArray(e.attendees)?e.attendees:[],color:e.color??null}}function aa(e,i,t){let r=ji(i).getTime(),a=ji(t).getTime();return e.map(ra).filter(Boolean).filter(o=>o.end.getTime()>r&&o.start.getTime()<a)}function ia(e,i){let t=new Date(i);t.setHours(0,0,0,0);let r=t.getTime();t.setHours(23,59,59,999);let a=t.getTime();return aa(e,r,a)}function Bt(e,i){let t=new Date(e),a=(t.getDay()-i+7)%7;return t.setDate(t.getDate()-a),t.setHours(0,0,0,0),t}function Je(e,i="default"){return e.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})}function hi(e,i="default"){return e.toLocaleDateString(i,{weekday:"short",month:"short",day:"numeric"})}function rg(e,i="default"){return e.toLocaleDateString(i,{month:"long",year:"numeric"})}function ag(e,i="default"){let t=new Date(e);return t.setDate(t.getDate()+6),`${e.toLocaleDateString(i,{month:"short",day:"numeric"})} \u2013 ${t.toLocaleDateString(i,{month:"short",day:"numeric",year:"numeric"})}`}function ta(e,i,t,r){let a=new Date(e).setHours(t,0,0,0),o=new Date(e).setHours(r,0,0,0),n=(r-t)*60,u=Math.max(e.getTime(),a),d=(Math.min(i.getTime(),o)-u)/6e4,p=(u-a)/6e4/n*100,w=d/n*100;return{top:p,height:w}}function og(...e){let{props:i,rawProps:t}=g(e,{defaultView:"month",firstDayOfWeek:0,locale:"default",hourSlotDuration:30,minTime:6,maxTime:22,eventCreationColorOptions:[]}),{events:r=[],defaultView:a,firstDayOfWeek:o,locale:n,hourSlotDuration:u,minTime:c,maxTime:d,eventCreationColorOptions:p,className:w,...f}=i,{onCreateEventRequest:l,onViewEventRequest:b,onUpdateEventRequest:z,onRemoveEventRequest:$,eventCreationEmailLookup:D,eventCreationLocationsCallback:C,eventCreationCalendarsCallback:P,onSlotClick:L,onDateRangeChange:y}=t,k=de(m(a)??"month"),h=de(new Date),S=de(null),V=de(null),A=de({title:"",start:null,end:null,allDay:!1,description:"",location:"",attendees:[],color:null}),Q=Ce(r).compute(v=>Array.isArray(v)?v:[]),se=h.get(),te=Bt(se,m(o)??0),E=m(c)??6,G=m(d)??22,J=m(u)??30,re=()=>{let v=new Date(h.get());k.get()==="month"?v.setMonth(v.getMonth()-1):k.get()==="week"?v.setDate(v.getDate()-7):v.setDate(v.getDate()-1),h.set(v),y?.({start:v,end:v,view:k.get()})},X=()=>{let v=new Date(h.get());k.get()==="month"?v.setMonth(v.getMonth()+1):k.get()==="week"?v.setDate(v.getDate()+7):v.setDate(v.getDate()+1),h.set(v),y?.({start:v,end:v,view:k.get()})},M=()=>{let v=new Date;h.set(v),y?.({start:v,end:v,view:k.get()})},j=(v,H,ce=!1)=>{let Z=v?new Date(v):new Date(h.get()),ge=H?new Date(H):new Date(Z.getTime()+3600*1e3);ce&&(Z.setHours(0,0,0,0),ge.setHours(23,59,59,999)),A.set({title:"",start:Z,end:ge,allDay:ce,description:"",location:"",attendees:[],color:null}),S.set("create")},x=v=>{V.set(ra(v)),S.set("view"),b?.(v)},B=()=>{let v=V.get();v&&(A.set({title:v.title,start:new Date(v.start),end:new Date(v.end),allDay:v.allDay,description:v.description??"",location:v.location??"",attendees:[...v.attendees||[]],color:v.color??null}),S.set("edit"))},R=()=>{S.set(null),V.set(null)},q=(v,H,ce)=>{if(L){L({date:v,hour:H,allDay:ce});return}let Z=new Date(v);if(ce){Z.setHours(0,0,0,0);let ge=new Date(Z);ge.setHours(23,59,59,999),j(Z,ge,!0)}else{Z.setHours(H,0,0,0);let ge=new Date(Z.getTime()+J*60*1e3);j(Z,ge,!1)}},Y=()=>{let v=A.get();!v.start||!v.end||l?.({title:v.title,start:v.start,end:v.end,allDay:v.allDay,description:v.description,location:v.location,attendees:v.attendees,color:v.color},()=>{R()})},oe=()=>{let v=V.get(),H=A.get();!v||!H.start||!H.end||z?.(v,{title:H.title,start:H.start,end:H.end,allDay:H.allDay,description:H.description,location:H.location,attendees:H.attendees,color:H.color},()=>R())},ve=()=>{let v=V.get();v&&$?.(v,()=>R())},ze=Ce(k,h).compute(([v,H])=>v==="month"?rg(H,m(n)):v==="week"?ag(Bt(H,m(o)??0),m(n)):hi(H,m(n))),Pe=W({className:"g-ui-event-calendar-header"},W({className:"g-ui-event-calendar-nav-group"},Oe({size:"sm",variant:"subtle",onClick:re,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:wi})),Oe({size:"sm",variant:"subtle",onClick:X,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:xi})),Ye({type:"button",variant:"subtle",size:"sm",className:"g-ui-event-calendar-today",onClick:M},ye({size:"sm",className:"g-ui-event-calendar-today-icon",innerHTML:tr}),"Today")),W({className:"g-ui-event-calendar-title"},ze),W({className:"g-ui-event-calendar-actions"},tg.map(v=>W({className:s("g-ui-event-calendar-view-option",Ce(k).compute(H=>H===v.value?"g-ui-event-calendar-view-option-active":"")),onClick:()=>{k.set(v.value),y?.({start:h.get(),end:h.get(),view:v.value})}},v.label)),Ye({type:"button",variant:"filled",size:"sm",className:"g-ui-event-calendar-create-btn",onClick:()=>j(h.get(),null,!1)},ye({size:"sm",innerHTML:Jt}),"Create"))),_e=Ce(h,Q,o).compute(([v,H,ce])=>{let Z=v.getFullYear(),ge=v.getMonth(),ue=(new Date(Z,ge,1).getDay()-(ce??0)+7)%7,Te=new Date(Z,ge+1,0).getDate(),Ve=new Date(Z,ge,0).getDate(),I=[],T=1,O=1,_=Math.ceil((ue+Te)/7)*7,ae=[];for(let ee=0;ee<_;ee+=1){let K,ie,le;ee<ue?(K=Ve-ue+ee+1,le=new Date(Z,ge-1,K),ie=!1):T<=Te?(K=T,le=new Date(Z,ge,K),ie=!0,T+=1):(K=O,le=new Date(Z,ge+1,K),ie=!1,O+=1);let xe=ia(H,le),Ae=le.getDate()===new Date().getDate()&&le.getMonth()===new Date().getMonth()&&le.getFullYear()===new Date().getFullYear();ae.push(W({key:le.getTime(),className:s("g-ui-event-calendar-month-cell",!ie&&"g-ui-event-calendar-month-cell-outside",Ae&&"g-ui-event-calendar-month-cell-today")},W({className:"g-ui-event-calendar-month-cell-header",onClick:()=>q(le,0,!0)},Ge({className:"g-ui-event-calendar-month-cell-day"},le.getDate())),W({className:"g-ui-event-calendar-month-cell-events"},xe.slice(0,3).map(Se=>W({key:Se.id,className:"g-ui-event-calendar-month-event",style:Se.color?{borderLeftColor:Se.color,backgroundColor:`${Se.color}20`}:{},onClick:Oi=>{Oi.stopPropagation(),x(Se)}},Se.title||"(No title)")),me(xe.length>3,()=>W({className:"g-ui-event-calendar-month-more",onClick:Se=>{Se.stopPropagation(),x(xe[3])}},`+${xe.length-3} more`)))))}return ae}),Ze=W({className:"g-ui-event-calendar-month"},W({className:"g-ui-event-calendar-weekdays"},ig.map(v=>W({key:v,className:"g-ui-event-calendar-weekday"},v))),W({className:"g-ui-event-calendar-month-grid"},_e)),Me=[];for(let v=E;v<G;v+=1)for(let H=0;H<60;H+=J)Me.push(v+H/60);let ei=Ce(h,o).compute(([v,H])=>{let ce=Bt(v,H??0),Z=[];for(let ge=0;ge<7;ge+=1){let fe=new Date(ce);fe.setDate(fe.getDate()+ge),Z.push(fe)}return Z}),Ri=W({className:"g-ui-event-calendar-week"},Ce(ei).compute(v=>W({className:"g-ui-event-calendar-week-days"},W({className:"g-ui-event-calendar-week-time-col"},""),(v||[]).map(H=>W({key:H.getTime(),className:"g-ui-event-calendar-week-day-col"},W({className:"g-ui-event-calendar-week-day-header"},hi(H,m(n))))))),W({className:"g-ui-event-calendar-week-body"},W({className:"g-ui-event-calendar-week-time-col"},Me.map(v=>{let H=Math.floor(v),ce=(v-H)*60,Z=`${H<=12?H:H-12}:${ce===0?"00":ce} ${H<12?"AM":"PM"}`;return W({key:v,className:"g-ui-event-calendar-week-slot-label"},Z)})),Ce(ei,Q).compute(([v,H])=>{if(!v||!v.length)return null;let ce=v[0],Z=new Date(v[6]);Z.setHours(23,59,59,999);let ge=aa(H,ce,Z);return W({className:"g-ui-event-calendar-week-grid-cols"},v.map(fe=>W({key:fe.getTime(),className:"g-ui-event-calendar-week-day-col g-ui-event-calendar-week-day-col-body"},Me.map(ue=>W({key:ue,className:"g-ui-event-calendar-week-slot",onClick:()=>q(fe,ue,!1)})),ge.filter(ue=>!ue.allDay&&ue.start.getDate()===fe.getDate()&&ue.start.getMonth()===fe.getMonth()&&ue.start.getFullYear()===fe.getFullYear()).map(ue=>{let{top:Te,height:Ve}=ta(ue.start,ue.end,E,G);return W({key:ue.id,className:"g-ui-event-calendar-week-event",style:{top:`${Te}%`,height:`${Ve}%`,borderLeftColor:ue.color||"var(--g-ui-primary)"},onClick:I=>{I.stopPropagation(),x(ue)}},W({className:"g-ui-event-calendar-week-event-title"},ue.title||"(No title)"),me(!ue.allDay,()=>Ge({className:"g-ui-event-calendar-week-event-time"},`${Je(ue.start,m(n))} \u2013 ${Je(ue.end,m(n))}`)))}))))}))),Hi=W({className:"g-ui-event-calendar-day"},W({className:"g-ui-event-calendar-day-body"},W({className:"g-ui-event-calendar-day-time-col"},Me.map(v=>{let H=Math.floor(v),ce=(v-H)*60,Z=`${H<=12?H:H-12}:${ce===0?"00":ce} ${H<12?"AM":"PM"}`;return W({key:v,className:"g-ui-event-calendar-day-slot-label"},Z)})),W({className:"g-ui-event-calendar-day-slots"},Me.map(v=>W({key:v,className:"g-ui-event-calendar-day-slot",onClick:()=>q(h.get(),v,!1)})),Ce(Q,h).compute(([v,H])=>H?ia(v,H).filter(Z=>!Z.allDay).map(Z=>{let{top:ge,height:fe}=ta(Z.start,Z.end,E,G);return W({key:Z.id,className:"g-ui-event-calendar-day-event",style:{top:`${ge}%`,height:`${fe}%`,borderLeftColor:Z.color||"var(--g-ui-primary)"},onClick:ue=>{ue.stopPropagation(),x(Z)}},W({className:"g-ui-event-calendar-day-event-title"},Z.title||"(No title)"),Ge({className:"g-ui-event-calendar-day-event-time"},`${Je(Z.start,m(n))} \u2013 ${Je(Z.end,m(n))}`))}):[])))),vi=v=>{let H=A.get(),ce=new Date,Z=H.start||ce,ge=H.end||new Date(ce.getTime()+3600*1e3),fe=de(H.title),ue=de(Z.toISOString().slice(0,10)),Te=de(!H.allDay&&Z?Z.toTimeString().slice(0,5):"09:00"),Ve=de(ge.toISOString().slice(0,10)),I=de(!H.allDay&&ge?ge.toTimeString().slice(0,5):"10:00"),T=de(H.allDay),O=de(H.description),_=de(H.location),ae=de(H.attendees||[]),ee=de(""),K=de([]),ie=de([]),le=de(""),xe=Array.isArray(p)?p:[],Ae=de(H.color),Se=()=>{let F=new Date(ue.get()+"T"+(T.get()?"00:00:00":Te.get()+":00")),we=new Date(Ve.get()+"T"+(T.get()?"23:59:59":I.get()+":00"));A.set({title:fe.get(),start:F,end:we,allDay:T.get(),description:O.get(),location:_.get(),attendees:ae.get(),color:Ae.get()})},Oi=F=>{if(ee.set(F),!D||!F.trim()){K.set([]);return}Promise.resolve(D(F.trim())).then(we=>K.set(Array.isArray(we)?we:[])).catch(()=>K.set([]))},oa=F=>{let we=ae.get();we.some(Et=>(Et.email||Et.id)===(F.email||F.id))||(ae.set([...we,{id:F.id,email:F.email??F.label,label:F.label}]),ee.set(""),K.set([]))},na=F=>{let we=[...ae.get()];we.splice(F,1),ae.set(we)},Ft=()=>{C&&Promise.resolve(C(le.get())).then(F=>ie.set(Array.isArray(F)?F:[])).catch(()=>ie.set([]))};return W({className:"g-ui-event-calendar-form"},W({className:"g-ui-event-calendar-form-row"},be({label:"Title",placeholder:"Event title",value:fe,onInput:F=>fe.set(F?.target?.value??"")})),W({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},rt({label:"All day",checked:T,onChange:F=>T.set(F)})),W({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},W({className:"g-ui-event-calendar-form-field"},fi({className:"g-ui-event-calendar-form-label"},"Start"),Ei({type:"date",className:"g-ui-input g-ui-input-size-md",value:ue,onInput:F=>ue.set(F?.target?.value??"")}),me(!T,()=>Ei({type:"time",className:"g-ui-input g-ui-input-size-md",value:Te,onInput:F=>Te.set(F?.target?.value??"")}))),W({className:"g-ui-event-calendar-form-field"},fi({className:"g-ui-event-calendar-form-label"},"End"),Ei({type:"date",className:"g-ui-input g-ui-input-size-md",value:Ve,onInput:F=>Ve.set(F?.target?.value??"")}),me(!T,()=>Ei({type:"time",className:"g-ui-input g-ui-input-size-md",value:I,onInput:F=>I.set(F?.target?.value??"")})))),me(C,()=>W({className:"g-ui-event-calendar-form-row"},fi({className:"g-ui-event-calendar-form-label"},"Location"),be({placeholder:"Search or type location",value:le,onInput:F=>{le.set(F?.target?.value??""),Ft()},onFocus:Ft}),me(Ce(ie).compute(F=>F&&F.length>0),()=>W({className:"g-ui-event-calendar-form-suggestions"},ie.get().map(F=>W({key:F.id??F.label,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>{_.set(F.label??F.id),le.set(""),ie.set([])}},F.label??F.id)))),me(Ce(_).compute(F=>!!F),()=>Ge({className:"g-ui-event-calendar-form-chip"},_)))),me(D,()=>W({className:"g-ui-event-calendar-form-row"},fi({className:"g-ui-event-calendar-form-label"},"Add guests"),be({placeholder:"Type email to search",value:ee,onInput:F=>Oi(F?.target?.value??"")}),W({className:"g-ui-event-calendar-form-chips"},ae.get().map((F,we)=>Ge({key:(F.email||F.id)+we,className:"g-ui-event-calendar-form-chip g-ui-event-calendar-form-chip-removable",onClick:()=>na(we)},F.label||F.email||F.id," \xD7"))),me(Ce(K).compute(F=>F&&F.length>0),()=>W({className:"g-ui-event-calendar-form-suggestions"},K.get().map(F=>W({key:F.id??F.email,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>oa(F)},F.label??F.email??F.id)))))),W({className:"g-ui-event-calendar-form-row"},Ki({label:"Description",placeholder:"Add description",value:O,onInput:F=>O.set(F?.target?.value??"")})),me(xe.length>0,()=>W({className:"g-ui-event-calendar-form-row"},fi({className:"g-ui-event-calendar-form-label"},"Color"),W({className:"g-ui-event-calendar-form-colors"},xe.map(F=>W({key:F.value??F.id??F,className:s("g-ui-event-calendar-form-color-swatch",Ce(Ae).compute(we=>we===(F.value??F.id??F)?"g-ui-event-calendar-form-color-swatch-active":"")),style:{backgroundColor:F.color??F.value??F},onClick:()=>Ae.set(F.value??F.id??F)}))))),W({className:"g-ui-event-calendar-form-actions"},Ye({variant:"subtle",onClick:R},"Cancel"),Ye({variant:"filled",onClick:()=>{Se(),v?oe():Y()}},v?"Save":"Create")))},Wi=()=>{let v=V.get();return v?W({className:"g-ui-event-calendar-view-modal"},W({className:"g-ui-event-calendar-view-modal-title"},v.title||"(No title)"),W({className:"g-ui-event-calendar-view-modal-meta"},v.allDay?Ge({className:"g-ui-event-calendar-view-modal-date"},hi(v.start,m(n))+(v.start.getTime()!==v.end.getTime()?` \u2013 ${hi(v.end,m(n))}`:"")):Ge({className:"g-ui-event-calendar-view-modal-date"},`${hi(v.start,m(n))} \xB7 ${Je(v.start,m(n))} \u2013 ${Je(v.end,m(n))}`)),me(v.location,()=>W({className:"g-ui-event-calendar-view-modal-field"},"Location: ",v.location)),me(v.description,()=>W({className:"g-ui-event-calendar-view-modal-field"},v.description)),me(v.attendees?.length,()=>W({className:"g-ui-event-calendar-view-modal-field"},"Guests: ",v.attendees.map(H=>H.label||H.email||H.id).join(", "))),W({className:"g-ui-event-calendar-view-modal-actions"},Ye({variant:"subtle",size:"sm",onClick:B},ye({size:"sm",innerHTML:er})," Edit"),Ye({variant:"subtle",size:"sm",onClick:ve,className:"g-ui-event-calendar-view-modal-delete"},ye({size:"sm",innerHTML:ir})," Delete"),Ye({variant:"filled",size:"sm",onClick:R},"Close"))):null};return W({...f,className:s("g-ui-event-calendar",w)},Pe,me(k,v=>v==="month",()=>Ze),me(k,v=>v==="week",()=>Ri),me(k,v=>v==="day",()=>Hi),me(S,v=>v==="create",()=>ri({opened:!0,title:"New event",size:"lg",onClose:R},vi(!1))),me(S,v=>v==="view",()=>ri({opened:!0,title:"Event",size:"md",onClose:R},Wi())),me(S,v=>v==="edit",()=>ri({opened:!0,title:"Edit event",size:"lg",onClose:R},vi(!0))))}import{state as ng}from"@granularjs/core";function sg(e=!1){let i=ng(!!e);return[i,{open:()=>i.set(!0),close:()=>i.set(!1),toggle:()=>i.set(!i.get())}]}Rt();export{Bo as Accordion,Oe as ActionIcon,ls as Affix,Jo as Alert,yn as Anchor,hs as AppBar,It as Autocomplete,an as Avatar,Zu as AvatarGroup,Ya as Badge,Xu as BadgeGroup,ln as Blockquote,ea as BottomBar,Xn as Breadcrumbs,$u as Burger,Zi as Button,ui as Calendar,Oa as Card,Qn as Center,rt as Checkbox,Gu as CheckboxGroup,In as Chip,un as Code,Hu as Col,rs as Collapse,Fa as Container,fu as CopyButton,$i as DateInput,Us as DatePicker,Zo as Divider,qo as Drawer,og as EventCalendar,ms as Fieldset,Pu as Flex,ju as Grid,At as GridTable,Ha as Group,us as HoverCard,ye as Icon,zn as Image,Iu as Indicator,nn as Kbd,br as List,ai as Loading,Fu as LoadingOverlay,Ho as Menu,ri as Modal,Ws as MultiSelect,Vu as NavLink,ct as Notification,Qs as Notifications,Qi as NumberField,eo as NumberInput,jn as Pagination,Xo as Paper,gu as PasswordInput,qu as PinInput,Nt as Popover,ou as Popper,Nn as Progress,vu as ProgressRing,_n as Radio,Wn as RadioGroup,Su as RangePicker,iu as RangeSlider,Fs as Rating,Vt as ScrollArea,cu as SearchInput,Bn as SegmentedControl,xo as Select,ku as SelectSearch,bs as Sidebar,pn as SimpleGrid,Tn as Skeleton,Dn as Slider,es as Space,ja as Stack,As as Stepper,vo as Switch,lo as SwitchGroup,To as Table,zo as Tabs,js as Tag,Ui as Text,be as TextInput,Ki as Textarea,Is as Timeline,Aa as Title,Pt as Toast,Zs as ToastStack,Fo as Tooltip,U as classFlag,he as classMap,N as classVar,s as cx,za as getThemeMode,ka as setThemeMode,ya as setThemeVars,g as splitPropsChildren,sg as useDisclosure};
|
|
4158
|
+
`;function Rt(){if(typeof document>"u"||document.getElementById(Et))return;let e=document.createElement("style");e.id=Et,e.textContent=xa,document.head.appendChild(e)}var wa=new Set(["--g-ui-bg","--g-ui-bg-subtle","--g-ui-bg-muted","--g-ui-bg-emphasized","--g-ui-bg-inverted","--g-ui-bg-panel","--g-ui-fg","--g-ui-fg-muted","--g-ui-fg-subtle","--g-ui-fg-inverted","--g-ui-border","--g-ui-border-subtle","--g-ui-border-emphasized","--g-ui-border-inverted","--g-ui-primary","--g-ui-primary-hover","--g-ui-primary-active","--g-ui-primary-subtle","--g-ui-primary-muted","--g-ui-primary-emphasized","--g-ui-success","--g-ui-success-hover","--g-ui-success-active","--g-ui-success-subtle","--g-ui-success-muted","--g-ui-danger","--g-ui-danger-hover","--g-ui-danger-active","--g-ui-danger-subtle","--g-ui-danger-muted","--g-ui-warning","--g-ui-warning-hover","--g-ui-warning-active","--g-ui-warning-subtle","--g-ui-warning-muted","--g-ui-info","--g-ui-info-hover","--g-ui-info-active","--g-ui-info-subtle","--g-ui-info-muted","--g-ui-shadow-xs","--g-ui-shadow-sm","--g-ui-shadow-md","--g-ui-shadow-lg","--g-ui-shadow-xl","--g-ui-shadow-2xl","--g-ui-radius","--g-ui-font","--g-ui-surface","--g-ui-text","--g-ui-muted","--g-ui-primary-strong","--g-ui-shadow"]);function ya(e={},i=document?.documentElement){if(i)for(let[t,r]of Object.entries(e)){let a=t.startsWith("--")?t:`--g-ui-${t}`;wa.has(a)&&i.style.setProperty(a,String(r))}}function ka(e="dark",i=document?.documentElement){i&&(i.classList.remove("g-ui-theme-dark","g-ui-theme-light"),i.classList.add(e==="light"?"g-ui-theme-light":"g-ui-theme-dark"))}function za(e=document?.documentElement){return e.classList.contains("g-ui-theme-light")?"light":"dark"}import{Renderer as Ht,isSignal as Ot,isState as Wt,isStatePath as qt,isComputed as Yt,resolve as Re,computed as Na,after as Yi,concat as Ca}from"@granularjs/core";function ii(e){return Ot(e)||Wt(e)||qt(e)||Yt(e)}function s(...e){return Ca(...e,{separator:" ",filterFalsy:!0})}function Gt(e){if(!(e==null||e===""))return typeof e=="number"?`${e}px`:e}function g(e,i){let t={},r=[],a=o=>!!o&&typeof o=="object"&&!Array.isArray(o)&&!Ht.isRenderable(o)&&!Ht.isDomNode(o)&&!Ot(o)&&!Wt(o)&&!qt(o)&&!Yt(o);for(let o of e)a(o)?Object.assign(t,o):r.push(o);if(i&&typeof i=="object")for(let o of Object.keys(i))t[o]===void 0&&(t[o]=i[o]);return{props:Na(t),rawProps:t,children:r}}function m(e){return Re(e)}function ze(e){return!!Re(e)}function z(e,i,t){let r=a=>{let o=Re(a),n=o==null||o===""?t:o;return n==null||n===""?"":`${e}${n}`};return ii(i)?Yi(i).compute(a=>r(a)):r(i)}function U(e,i){return ii(i)?Yi(i).compute(t=>Re(t)?e:""):Re(i)?e:""}function ve(e,i,t){let r=a=>i[a]||null;return ii(e)?Yi(e).compute(a=>r(Re(a??t))):r(Re(e??t))}import{Button as Sa,Span as Gi,when as _i,after as Da}from"@granularjs/core";function Zi(...e){let{props:i,children:t}=g(e,{variant:"filled",size:"md",justify:"center"}),{variant:r,color:a,size:o,fullWidth:n,loading:u,leftSection:c,rightSection:p,className:d,disabled:x,justify:f,...l}=i,v=Da(x,u).compute(([k,$])=>k||$);return Sa({...l,disabled:v,className:s("g-ui-button",z("g-ui-button-variant-",r,"filled"),z("g-ui-button-color-",a,"primary"),z("g-ui-justify-",f,"center"),z("g-ui-button-size-",o,"md"),U("g-ui-button-full",n),U("g-ui-button-loading",u),d)},_i(c,()=>Gi({className:"g-ui-button-section-left"},c)),_i(u,()=>Gi("Loading..."),()=>t),_i(p,()=>Gi({className:"g-ui-button-section-right"},p)))}import{Span as Pa}from"@granularjs/core";function Ui(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,weight:a,color:o,dimmed:n,align:u,ellipsis:c,decoration:p,className:d,style:x,...f}=i,l=ve(a,{bold:"g-ui-text-weight-700",semibold:"g-ui-text-weight-600",medium:"g-ui-text-weight-500",700:"g-ui-text-weight-700",600:"g-ui-text-weight-600",500:"g-ui-text-weight-500",400:"g-ui-text-weight-400"}),v=ve(o,{primary:"g-ui-text-primary",success:"g-ui-text-success",danger:"g-ui-text-danger",muted:"g-ui-text-dimmed"}),k=ve(u,{center:"g-ui-text-align-center",right:"g-ui-text-align-right",left:"g-ui-text-align-left"}),$=ve(p,{underline:"g-ui-text-decoration-underline","line-through":"g-ui-text-decoration-line-through",overline:"g-ui-text-decoration-overline",none:"g-ui-text-decoration-none"});return Pa({...f,style:x,className:s("g-ui-text",z("g-ui-text-size-",r,"md"),U("g-ui-text-dimmed",n),U("g-ui-text-ellipsis",c),l,v,k,$,d)},t)}import{H1 as Ma,H2 as _t,H3 as Ta,H4 as Va,H5 as La,H6 as Ia}from"@granularjs/core";var $a={1:Ma,2:_t,3:Ta,4:Va,5:La,6:Ia};function Aa(...e){let{props:i,children:t}=g(e,{order:2}),{order:r,className:a,style:o,...n}=i,u=m(r)||2;return($a[u]||_t)({...n,className:s("g-ui-title",z("g-ui-title-order-",r,2),a)},t)}import{Div as Ba}from"@granularjs/core";function Fa(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,fluid:a,className:o,style:n,...u}=i;return Ba({...u,style:n,className:s("g-ui-container",U("g-ui-container-fluid",a),z("g-ui-container-size-",r,"md"),o)},t)}import{Div as ja}from"@granularjs/core";function Ea(...e){let{props:i,children:t}=g(e,{gap:"md"}),{gap:r,align:a,justify:o,className:n,style:u,...c}=i,p=ve(o,{between:"g-ui-justify-between",center:"g-ui-justify-center",end:"g-ui-justify-end",start:"g-ui-justify-start"});return ja({...c,style:u,className:s("g-ui-stack",z("g-ui-gap-",r,"md"),z("g-ui-align-",a),p,n)},t)}import{Div as Ra}from"@granularjs/core";function Ha(...e){let{props:i,children:t}=g(e,{gap:"md",align:"center"}),{gap:r,align:a,justify:o,position:n,noWrap:u,className:c,style:p,...d}=i,x=ve(n,{apart:"g-ui-justify-between",center:"g-ui-justify-center",right:"g-ui-justify-end",left:"g-ui-justify-start"});return Ra({...d,style:p,className:s("g-ui-group",z("g-ui-gap-",r,"md"),z("g-ui-align-",a,"center"),z("g-ui-justify-",o,"none"),x,U("g-ui-no-wrap",u),c)},t)}import{Div as xi,list as Oa,when as Xi,after as Zt}from"@granularjs/core";function Wa(...e){let{props:i,children:t}=g(e,{padding:"md",radius:"md",shadow:"none",border:"default"}),{title:r,content:a,actions:o,border:n,padding:u,radius:c,shadow:p,className:d,style:x,...f}=i;return xi({style:x},Xi(r,()=>xi({className:"g-ui-card-title"},r)),Xi(a,()=>xi({className:"g-ui-card-content"},a)),{className:s("g-ui-card",z("g-ui-card-border-",n,"md"),z("g-ui-card-padding-",u,"md"),z("g-ui-card-radius-",c,"md"),z("g-ui-card-shadow-",p,"md"),d),...f},t,Xi(o,()=>xi({className:"g-ui-card-actions"},Oa(o,l=>Zi({className:"g-ui-card-action",onClick:v=>l.get().onClick?.(v),leftSection:l.leftSection,rightSection:l.rightSection,size:Zt(l.size).compute(v=>v||"sm"),variant:Zt(l.variant).compute(v=>v||"outline"),...l.get().props||{}},l.label)))))}import{Span as qa}from"@granularjs/core";function Ya(...e){let{props:i,children:t}=g(e,{variant:"filled",size:"md"}),{variant:r,size:a,className:o,dot:n,style:u,...c}=i,p=ve(r,{dot:"g-ui-badge-dot"});return qa({...c,className:s("g-ui-badge",z("g-ui-badge-variant-",r,"filled"),z("g-ui-badge-size-",a,"md"),U("g-ui-badge-dot",n),p,o)},t)}import{Div as ti,Input as Ga,Textarea as _a,Label as Za,Span as Ua,when as ri,state as Xa,after as Ka,isState as Qa}from"@granularjs/core";function be(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,description:a,error:o,size:n,leftSection:u,rightSection:c,className:p,inputClassName:d,multiline:x,value:f,...l}=i,{value:v,node:k,onChange:$,onInput:S,onFocus:N,onBlur:M,onKeyDown:V,onKeyUp:w,onClick:y}=t,h=Qa(v)&&!$&&!S,C=h?v:Xa(m(f)??"");Ka(f).change(E=>{h||C.set(m(E)??"")});let I=E=>{let G=E?.target?.value??"";G!==f.get()&&(C.set(G),$?.(E),S?.(E))},B=ze(x),Q=B?_a:Ga,se=s(d,B&&"g-ui-textarea"),re=Q({...l,node:k,value:C,onInput:I,onChange:I,onFocus:N,onBlur:M,onKeyDown:V,onKeyUp:w,onClick:y,className:s("g-ui-input",se)});return ti({className:s("g-ui-text-input",p)},ri(r,()=>Za({className:"g-ui-text-input-label"},r)),ri(a,()=>Ua({className:"g-ui-text-input-description"},a)),ti({className:s("g-ui-input-wrapper",U("g-ui-input-multiline",x),z("g-ui-input-size-",n,"md"),U("g-ui-input-error",o))},ri(u,()=>ti({className:"g-ui-input-section"},u)),re,ri(c,()=>ti({className:"g-ui-input-section"},c))),ri(o,()=>ti({className:"g-ui-text-input-error-text"},o)))}function Ki(...e){let{props:i}=g(e,{size:"md"}),{size:t,leftSection:r,rightSection:a,className:o,...n}=i;return be({...n,size:t,className:o,leftSection:r,rightSection:a,multiline:!0})}import{Div as Ut,Span as Xt,after as He,state as Ja}from"@granularjs/core";function Qi(...e){let{props:i,rawProps:t}=g(e,{size:"md",step:1,allowDecimal:!0,allowNegative:!0,clampBehavior:"blur",hideControls:!1,decimalSeparator:".",thousandSeparator:"",format:null,prefix:"",suffix:""}),{value:r,min:a,max:o,step:n,size:u,allowDecimal:c,allowNegative:p,decimalSeparator:d,thousandSeparator:x,decimalScale:f,clampBehavior:l,hideControls:v,format:k,locale:$,currency:S,formatOptions:N,prefix:M,suffix:V,leftSection:w,rightSection:y,className:h,onChange:C,onInput:I,...B}=i,{onChange:Q,onInput:se,onBlur:re,onFocus:E,onKeyDown:G}=t,ee=A=>{Q?.(A.target?.value??""),se?.(A.target?.value??"")},ae=ee,X=Ja(""),T=A=>String(A??"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=()=>{if(!!!m(c))return 0;let L=m(f);if(L!=null&&L!==""&&Number.isFinite(Number(L)))return Math.max(0,Number(L));let q=m(k);return q==="currency"||q==="percent"?2:0},D=A=>{let L=m(d)??".",q=m(x)??"",_=String(A??"");if(q&&(_=_.split(q).join("")),!_||_==="-"||_===L||_.endsWith(L))return null;let oe=_.replace(L,"."),ie=Number(oe);return Number.isFinite(ie)?ie:null},Y=A=>{let L=m(x)??"";return L?A.replace(/\B(?=(\d{3})+(?!\d))/g,L):A},P=A=>{let L=m(d)??".",q=j(),_=Number(A);if(!Number.isFinite(_))return"";let oe=_<0?"-":"",ie=Math.abs(_),[K,te=""]=String(ie).split("."),le=Y(K);if(q>0){let xe=te.slice(0,q).padEnd(q,"0");return`${oe}${le}${L}${xe}`}return`${oe}${le}`},R=(A,L)=>{try{let q=m($),_=m(S)??"USD",oe=m(N)??{},ie=j(),K=L==="currency"?"currency":"decimal";return new Intl.NumberFormat(q,{style:K,currency:_,...ie>0?{minimumFractionDigits:ie,maximumFractionDigits:ie}:{maximumFractionDigits:0},...oe}).format(A)}catch{return P(A)}},H=A=>{let L=A,q=m(a),_=m(o);return q!=null&&Number.isFinite(Number(q))&&(L=Math.max(L,Number(q))),_!=null&&Number.isFinite(Number(_))&&(L=Math.min(L,Number(_))),!m(p)&&L<0&&(L=0),L},J=()=>{let A=m(V)??"",L=m(k);return!A&&L==="percent"?"%":A},pe=(A,L,q)=>{let _=m(M)??"",oe=J(),ie=String(A??"").replace(/\u00A0/g," "),K=String(_??"").replace(/\u00A0/g," "),te=String(oe??"").replace(/\u00A0/g," "),le=K&&ie.startsWith(K),xe=te&&ie.endsWith(te);return`${L??""}${le?"":_}${A}${xe?"":oe}`},ke=(A,L)=>{let q=j(),_=m(d)??".",ie=String(A??"").replace(/\D/g,"")||"0",K=q>0?ie.padStart(q+1,"0"):ie,le=(q>0?K.slice(0,-q):K).replace(/^0+(?=\d)/,"")||"0",xe=q>0?K.slice(-q):"",Fe=q>0?`${le}${_}${xe}`:le;return`${L??""}${Fe}`},Pe=A=>{let L=m(M)??"",q=J(),_=String(A??""),oe=String(L??"").replace(/\u00A0/g," "),ie=String(q??"").replace(/\u00A0/g," ");return oe&&_.replace(/\u00A0/g," ").startsWith(oe)&&(_=_.slice(L.length)),ie&&_.replace(/\u00A0/g," ").endsWith(ie)&&(_=_.slice(0,-q.length)),_},Be=A=>{let L=!!m(p),q=Pe(A),_=L&&q.includes("-")?"-":"",oe=q.replace(/\D/g,""),ie=ke(oe,_);if(m(l)==="strict"){let K=D(ie);if(K!=null){let te=H(K);ie=`${te<0?"-":""}${P(Math.abs(te))}`}}return ie},Ve=A=>{if(A==null||A==="")return ke("","");if(typeof A=="number"&&Number.isFinite(A)){let te=m(l)==="strict"?H(A):A;return`${te<0?"-":""}${P(Math.abs(te))}`}let L=Pe(A),q=m(d)??".",oe=!!m(p)&&String(L).includes("-")?"-":"",ie=String(L??"").replace(new RegExp(`[^0-9${T(q)}]`,"g"),""),K=D(`${oe}${ie}`);if(K!=null){let te=m(l)==="strict"?H(K):K;return`${te<0?"-":""}${P(Math.abs(te))}`}return Be(A)},Me,ei=A=>{let L=m(A);if(L===void 0)return;let q=Ve(L);q!==X.get()&&(Me=q,X.set(q))};ei(r),He(r).change(A=>{ei(A)}),He(X).change(A=>{if(A===Me){Me=void 0;return}Me=void 0;let L=D(A);if(L==null){ee?.(A??"");return}ee?.(L)});let Hi=He(y).compute(A=>A!=null&&A!==!1),Oi=He(v,Hi).compute(([A,L])=>!m(A)&&!L),bi=He(c).compute(A=>m(A)?"decimal":"numeric"),Wi=He(k,M,V,c,p,d,x,f,l,a,o,$,S,N).compute(()=>({mode:"both",format:A=>{let L=Be(A),q=m(k),oe=!!m(p)&&L.startsWith("-")?"-":"",ie=D(L),K=L.replace(oe,"");if(ie!=null){let te=Math.abs(ie);if(typeof q=="function")try{K=q(te)}catch{K=P(te)}else if(q==="currency")K=R(te,"currency");else if(q==="decimal"){let le=m($),xe=m(N);K=le||xe?R(te,"decimal"):P(te)}else K=P(te)}return{value:L,raw:L,visual:pe(K,oe,q)}}})),b=A=>{let L=D(X.get()),q=Number(m(n)??1),oe=H((L??0)+q*A);X.set(P(oe))},O=A=>{if(!A||typeof A.setSelectionRange!="function")return;let L=()=>{try{let q=String(A.value??"").length;A.setSelectionRange(q,q)}catch{}};typeof requestAnimationFrame=="function"?requestAnimationFrame(L):L()},ce=A=>{ae?.(A);let L=A?.target;L&&O(L)},Z=A=>{if(re?.(A),m(l)!=="blur")return;let L=D(X.get());if(L==null)return;let q=H(L);X.set(P(q))},ge=A=>{E?.(A),O(A?.target)},he=A=>{G?.(A);let L=A?.target;if(!L)return;let q=m(M)??"",_=J();_&&typeof L.selectionEnd=="number"&&(L.selectionEnd=Math.min(L.selectionEnd,String(L.value??"").length-_.length)),q&&typeof L.selectionStart=="number"&&(L.selectionStart=Math.max(L.selectionStart,q.length))},ue=Ut({className:"g-ui-number-field-controls"},Xt({className:"g-ui-number-field-control",onClick:()=>b(1)},"+"),Xt({className:"g-ui-number-field-control",onClick:()=>b(-1)},"\u2212")),Te=Ut({className:"g-ui-number-field-controls-wrapper"},ue),Le=He(Oi,y).compute(([A,L])=>A?Te:L);return be({...B,size:u,className:s("g-ui-number-field",h),leftSection:w,rightSection:Le,type:"text",inputMode:bi,inputClassName:s("g-ui-input-number"),value:X,format:Wi,onInput:ce,onBlur:Z,onFocus:ge,onKeyDown:he})}function eo(...e){return Qi(...e)}import{Div as zi,Button as io,portal as to,when as Ji,after as ro}from"@granularjs/core";var wi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>',yi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>',ki='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M379.33-244 154-469.33 201.67-517l177.66 177.67 378.34-378.34L805.33-670l-426 426Z"/></svg>',Kt='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M240-446.67v-66.66h480v66.66H240Z"/></svg>',je='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M312-265.33 265.33-312l168-168-168-167L312-693.67l168 168 167-168L693.67-647l-168 167 168 168L647-265.33l-167-168-168 168Z"/></svg>',Qt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>',Jt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>',er='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h357l-80 80H200v560h560v-278l80-80v358q0 33-23.5 56.5T760-120H200Zm280-360v-80h240v80H480Zm0 160v-80h320v80H480Zm0 160v-80h320v80H480ZM360-360v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm160-320h280l-36-37 37-37v74H520Zm-160 0h80v-80h-80v80ZM120-600v-160l160-160h160l-80 80H200v240h-80Zm80-240v-80 80Z"/></svg>',ir='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>',tr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Z"/></svg>',rr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"/></svg>';function ai(...e){let{props:i,rawProps:t,children:r}=g(e,{size:"md",centered:!0,overlay:"normal"}),{opened:a,title:o,size:n,centered:u,overlay:c,position:p,className:d,style:x}=i,{onClose:f}=t,l=ro(p,u).compute(([v,k])=>`g-ui-modal-position-${v??(k===!1?"top-center":"center")}`);return Ji(a,()=>to(zi({className:s("g-ui-modal-overlay",z("g-ui-modal-overlay-",c,"normal"),l),onClick:v=>{v.target===v.currentTarget&&f?.()}},zi({className:s("g-ui-modal",z("g-ui-modal-size-",n,"md"),d)},zi({className:"g-ui-modal-header"},Ji(o,()=>zi({className:"g-ui-modal-title"},o)),Ji(f,()=>io({type:"button",className:"g-ui-button g-ui-button-variant-subtle g-ui-button-size-xs g-ui-modal-close",onClick:f,innerHTML:je}))),r))))}import{Div as Ni,Span as et,after as ar,when as or}from"@granularjs/core";function oi(...e){let{props:i}=g(e,{variant:"spinner",size:"md"}),{variant:t,size:r,className:a}=i,o=ar(t).compute(u=>u==="dots"),n=ar(t).compute(u=>u==="bars");return or(o,()=>Ni({className:s("g-ui-loading g-ui-dots",z("g-ui-loading-size-",r,"md"),a)}),()=>or(n,()=>Ni({className:s("g-ui-loading g-ui-bars",z("g-ui-loading-size-",r,"md"),a)},et(""),et(""),et("")),()=>Ni({className:s("g-ui-loading",z("g-ui-loading-size-",r,"md"),a)},Ni({className:"g-ui-spinner"}))))}import{Div as it,Input as ao,Label as oo,Span as nr,when as tt,state as no,after as so}from"@granularjs/core";function rt(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{checked:r,label:a,description:o,size:n,indeterminate:u,className:c,style:p,inputProps:d,...x}=i,{onChange:f}=t,l=no(ze(r));so(r).change(k=>{k!=null&&(l.set(!!k),f?.(k))});let v=oo({className:"g-ui-checkbox-control"},ao({type:"checkbox",indeterminate:u,checked:l,className:s("g-ui-checkbox-input",z("g-ui-checkbox-size-",n,"md"),d?.className),...x}),tt(l,()=>it({className:"g-ui-checkbox-checked",innerHTML:ki}),()=>{if(!l.get()&&u.get())return it({className:"g-ui-checkbox-indeterminate",innerHTML:Kt})}),tt(a,()=>nr({className:"g-ui-checkbox-label"},a)));return it({className:s("g-ui-checkbox",z("g-ui-checkbox-size-",n,"md"),c)},v,tt(o,()=>nr({className:"g-ui-checkbox-description"},o)))}import{Input as co,Label as po,Span as mo,when as fo,after as ot,state as ho}from"@granularjs/core";import{Div as uo,context as go,after as sr}from"@granularjs/core";var at=go({name:null,selected:null});function lo(...e){let{props:i,rawProps:t,children:r}=g(e),{className:a,name:o,selected:n,onChange:u,...c}=i,{onChange:p}=t,d=at.scope({name:o?.get(),selected:n?.get()});return sr(d.selected).change(x=>{p?.(x)}),sr(n).change(x=>{x!==d.selected.get()&&(d.set().selected=x)}),d.serve(uo({...c,className:s("g-ui-switch-group",a)},r))}function vo(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,size:a,className:o,style:n,inputProps:u,checked:c,value:p,...d}=i,{onChange:x}=t,f=ho(c),l=at.state(),v=ot(l).compute(k=>({name:k.name,type:k.name?"radio":"checkbox"}));return ot(l.selected).change(k=>{f.set(k===p.get())}),ot(f).change(k=>{if(x?.(k),!k)return;let $=l.get().selected;l.set().selected=p.get()}),po({className:s("g-ui-switch",z("g-ui-switch-size-",a,"md"),o)},co({type:v.type,name:v.name,value:p,checked:f,className:s("g-ui-switch-input",z("g-ui-switch-size-",a,"md"),u?.className),...d}),fo(r,()=>mo({className:"g-ui-switch-label"},r)))}import{Div as Oe,Span as ur,when as nt,state as gr,after as Ci}from"@granularjs/core";import{Span as bo}from"@granularjs/core";function ye(...e){let{props:i,children:t}=g(e,{size:"md"});return bo({...i,className:s("g-ui-icon",z("g-ui-icon-size-",i.size,"md"),z("g-ui-icon-color-",i.color),i.className)},...t)}function xo(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md"}),{data:r,value:a,size:o,leftSection:n,rightSection:u,placeholder:c,className:p,...d}=i,{onChange:x}=t,f=gr(!1),l=gr(m(a)??"");Ci(a).change(S=>{let N=m(S);N!==void 0&&l.set(N??"")});let v=S=>{l.set(S),x?.(S),f.set(!1)},k=Ci(l).compute(S=>S?"":"g-ui-select-placeholder"),$=Ci(l).compute(S=>{let M=(m(r)??[]).find(V=>V.value===S);return S?M?.label??"":c??""});return Oe({...d,className:s("g-ui-select-root",p)},Oe({className:s("g-ui-input-wrapper",z("g-ui-input-size-",o,"md"))},nt(n,()=>Oe({className:"g-ui-input-section"},n)),Oe({className:s("g-ui-select",k),onClick:()=>f.set(!f.get())},ur({className:"g-ui-select-value"},$)),nt(u,()=>Oe({className:"g-ui-input-section"},u),()=>ur({className:"g-ui-select-caret"},ye({innerHTML:rr})))),nt(f,()=>Oe({className:"g-ui-select-dropdown"},(m(r)??[]).map(S=>Oe({className:s("g-ui-select-item",Ci(l).compute(N=>N===S.value?"g-ui-select-item-active":"")),onClick:()=>v(S.value)},S.label)))))}import{Button as wo,Div as Ue,state as Ie,after as ni,list as yo,when as ko}from"@granularjs/core";function zo(...e){let{props:i,rawProps:t}=g(e,{tabs:[],orientation:"horizontal",variant:"default",sticky:!0,align:"left",size:"md"}),{value:r,tabs:a,orientation:o,variant:n,sticky:u,className:c,style:p,align:d,size:x}=i,{onChange:f}=t,l=Ie(m(r)??m(a)?.[0]?.value??""),v=Ie(),k=Ie(),$=Ie(0),S=Ie(0),N=Ie(0),M=Ie(0),V=Ie(!1),w=Ie(0),y=!1,h=null,C=!1,I=new Set;ni(r).change(P=>{let R=m(P);R!=null&&l.set(R)});let B=P=>{l.set(P),f?.(P)},Q=P=>{let R=[],H=P?.parentElement;for(;H;){let J=getComputedStyle(H),pe=`${J.overflow}${J.overflowY}${J.overflowX}`;/(auto|scroll)/.test(pe)&&R.push(H),H=H.parentElement}return R},se=P=>Q(P)[0]??null,re=P=>P?P.getBoundingClientRect().top:0,E=P=>P?P.scrollTop:window.scrollY||window.pageYOffset||0,G=(P,R)=>P>R?"down":P<R?"up":"none",ee=(P,R,H,J)=>P==="down"&&R<H?!0:P==="up"&&R>=H?!1:J,ae=()=>{let P=v.get(),R=k.get();if(!P||!R)return;if(!ze(u)){V.set(!1),$.set(0);return}if(typeof window>"u")return;let H=P.getBoundingClientRect(),J=R.getBoundingClientRect(),pe=se(P),ke=re(pe),Pe=E(pe),Be=G(Pe,w.get());w.set(Pe);let Ve=ee(Be,H.top,ke,V.get());$.set(J.height),S.set(H.left),N.set(H.width),M.set(ke),Ve!==V.get()&&V.set(Ve)},X=()=>{h==null&&(h=requestAnimationFrame(()=>{h=null,ae()}))},T=P=>{!P||I.has(P)||(I.add(P),P.addEventListener("scroll",X,{passive:!0}))},j=()=>{if(y)return;let P=v.get(),R=k.get();!P||!R||typeof window>"u"||(y=!0,ae(),T(window),window.addEventListener("resize",X),Q(P).forEach(T))};ni(k,v,u).change(j),!C&&typeof window<"u"&&(C=!0,setTimeout(()=>j(),0));let D=ni(V,S,N,M).compute(P=>{let[R,H,J,pe]=P;return R?{position:"fixed",top:`${pe}px`,left:`${H}px`,width:`${J}px`,background:"var(--g-ui-surface)",zIndex:100}:{position:"static",top:"auto",left:"auto",width:"auto",zIndex:"auto",background:"transparent"}}),Y=ni(V,$).compute(P=>{let[R,H]=P;return{height:R?`${H}px`:"0px"}});return Ue(Ue({className:s("g-ui-tabs",ve(o,{vertical:"g-ui-tabs-vertical"}),z("g-ui-tabs-variant-",n,"default"),z("g-ui-tabs-align-",d,"left"),z("g-ui-tabs-size-",x,"md"),i.className??c)},Ue({node:v}),Ue({style:Y}),Ue({node:k,className:"g-ui-tabs-list",style:D},yo(a,P=>wo({className:ni(l,P.value).compute(([R,H])=>s("g-ui-tabs-tab",H===R&&"g-ui-tabs-tab-active")),onClick:()=>B(P.get().value)},P.label))),Ue({className:"g-ui-tabs-panel"},ko(l,()=>a.get()?.find(P=>P.value===l.get())?.content??null))))}import{Table as No,Thead as Co,Tbody as So,Tr as Do,Th as Po,Td as Mo,list as cr,when as pr,after as st}from"@granularjs/core";function To(...e){let{props:i}=g(e,{headers:[],rows:[]}),{headers:t,rows:r,striped:a,highlightOnHover:o,withBorder:n,withColumnBorders:u,withRowBorders:c,className:p,style:d,...x}=i,f=st(t).compute(l=>l.length>0);return No({...x,className:s("g-ui-table",U("g-ui-table-striped",a),U("g-ui-table-hover",o),U("g-ui-table-with-border",n),U("g-ui-table-column-borders",u),U("g-ui-table-row-borders",c),p)},pr(f,()=>Co(lr(t,!0))),So(cr(r,l=>lr(l,!1))))}var lr=(e,i)=>{let t=st(e).compute(o=>Array.isArray(o)),r=o=>{let n=st(o).compute(u=>Object.values(u));return a(n)},a=o=>cr(o,n=>i?Lo(n):Vo(n));return Do(pr(t,()=>a(e),()=>r(e)))},Vo=e=>Mo(e),Lo=e=>Po(e);import{Div as ut}from"@granularjs/core";import{state as Io,when as $o,after as Ao}from"@granularjs/core";function Bo(...e){let{props:i,rawProps:t,children:r}=g(e,{opened:!1}),{opened:a,className:o,...n}=i,{opened:u}=t,c=ii(u),p=c?u:Io(ze(a));Ao(a).change(l=>{c||p.set(ze(l))});let d=()=>{c||p.set(!p.get())},x=r[0],f=r[1];return ut({...n,className:s("g-ui-accordion",o)},ut({className:"g-ui-accordion-header",onClick:d},x),$o(p,()=>ut({className:"g-ui-accordion-content"},f)))}import{Span as dr}from"@granularjs/core";function Fo(...e){let{props:i,children:t}=g(e),{label:r,className:a,style:o}=i;return dr({className:s("g-ui-tooltip",a)},t,dr({className:"g-ui-tooltip-content"},r))}import{Div as si,when as jo,after as Eo,state as ui,portal as Ro}from"@granularjs/core";var gt=ui({currentOpenState:null});function Ho(...e){let i=ui(),t=ui(),r=ui({}),{props:a,rawProps:o,children:n}=g(e,{position:"right"}),{opened:u,content:c,position:p,className:d,...x}=a,{onChange:f}=o,l=ui(m(u)??!1);Eo(u).change(V=>{let w=m(V);w!=null&&(l.set(!!w),w&&v())});let v=()=>{gt.get().currentOpenState!==l&&(gt.get().currentOpenState?.set(!1),gt.set().currentOpenState=l)};u.get()&&v();let k=V=>{let y=String(V??"right").toLowerCase().split("-").filter(Boolean);if(y.length===1){let I=y[0];return I==="top"||I==="bottom"?{placement:I,align:"center"}:I==="left"||I==="right"?{placement:"bottom",align:I}:I==="center"?{placement:"bottom",align:"center"}:{placement:"bottom",align:"right"}}let[h,C]=y;return h==="top"||h==="bottom"?{placement:h,align:C||"center"}:h==="left"||h==="right"?{placement:h,align:C||"center"}:{placement:"bottom",align:"right"}},$=()=>{let V=i.get(),w=t.get();if(!V||!w||typeof window>"u")return;let y=V.getBoundingClientRect(),h=w.getBoundingClientRect(),C=m(p)??"right",I=getComputedStyle(document.documentElement).getPropertyValue("--g-ui-space-20"),B=Number.parseFloat(I)||20,Q=window.innerWidth||0,se=window.innerHeight||0,re=Math.max(B,Q-h.width-B),E=Math.max(B,se-h.height-B),{placement:G,align:ee}=k(C),ae=8,X=y.bottom+ae,T=y.left;G==="top"||G==="bottom"?(X=G==="top"?y.top-h.height-ae:y.bottom+ae,ee==="center"?T=y.left+y.width/2-h.width/2:ee==="right"?T=y.right-h.width:T=y.left):(G==="left"||G==="right")&&(T=G==="left"?y.left-h.width-ae:y.right+ae,ee==="center"?X=y.top+y.height/2-h.height/2:ee==="bottom"?X=y.bottom-h.height:X=y.top),T=Math.max(B,Math.min(T,re)),X=Math.max(B,Math.min(X,E)),r.set({top:`${X}px`,left:`${T}px`})},S=V=>{l.set(V),f?.(V),V&&(v(),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>$()):setTimeout(()=>$(),0))},N=()=>S(!l.get()),M=()=>S(!1);return si({...x,node:i,className:s("g-ui-menu",d)},si({onClick:N},n),jo(l,()=>Ro(si(si({className:"g-ui-menu-overlay",onClick:M}),si({className:"g-ui-menu-dropdown",node:t,style:r},c)))))}import{Div as mr,portal as Oo,when as Wo}from"@granularjs/core";function qo(...e){let{props:i,children:t}=g(e,{position:"right",size:"md",overlay:"normal",shadowed:!0}),{opened:r,onClose:a,position:o,size:n,overlay:u,shadowed:c,className:p,style:d}=i;return Wo(r,()=>Oo(mr({className:s("g-ui-drawer-overlay",z("g-ui-drawer-overlay-",u,"normal")),onClick:a},mr({className:s("g-ui-drawer",ve(c,{true:"g-ui-drawer-shadowed"},!0),z("g-ui-drawer-",o,"right"),z("g-ui-drawer-size-",n,"md"),p),onClick:x=>x.stopPropagation()},t))))}import{Button as Yo,Div as lt,Span as fr,when as Si,after as hr}from"@granularjs/core";function ct(...e){let{props:i,rawProps:t,children:r}=g(e,{color:"blue",withCloseButton:!0}),{title:a,color:o,icon:n,loading:u,withCloseButton:c,withBorder:p,className:d,style:x}=i,{onClose:f}=t,l=hr(n,u).compute(([k,$])=>!k&&!!$),v=hr(n,u).compute(([k,$])=>!!k||!!$);return lt({className:s("g-ui-notification",[p,"g-ui-notification-bordered"],[o,k=>`g-ui-notification-${k}`],[v,"g-ui-notification-with-icon"],d)},Si(n,()=>fr({className:"g-ui-notification-icon"},n)),Si(l,()=>oi({size:"sm",className:"g-ui-notification-loader"})),lt({className:"g-ui-notification-body"},Si(a,()=>lt({className:"g-ui-notification-title"},a)),r),Si(c,()=>Yo({type:"button",className:"g-ui-notification-close",onClick:()=>f?.()},fr({innerHTML:je}))))}import{Div as Go,when as _o}from"@granularjs/core";function Zo(...e){let{props:i}=g(e,{labelPosition:"center"}),{label:t,labelPosition:r,vertical:a,className:o,...n}=i;return Go({...n,className:s("g-ui-divider",U("label",t),z("g-ui-divider-label-",r,"center"),U("g-ui-divider-vertical",a),o)},_o(t,()=>Ui({className:"g-ui-divider-label-text",size:"sm"},t)))}import{Div as Uo}from"@granularjs/core";function Xo(...e){let{props:i,children:t}=g(e,{padding:"md",radius:"md",shadow:"none"}),{padding:r,radius:a,shadow:o,className:n,...u}=i;return Uo({...u,className:s("g-ui-paper",[r,c=>`g-ui-card-padding-${c}`],[a,c=>`g-ui-card-radius-${c}`],[o,c=>`g-ui-card-shadow-${c}`],n)},t)}import{Button as Ko,Div as pt,Span as Qo,after as vr,when as dt}from"@granularjs/core";function Jo(...e){let{props:i,rawProps:t,children:r}=g(e,{color:"blue"}),{title:a,color:o,icon:n,withCloseButton:u,className:c,...p}=i,{onClose:d}=t,x=vr(a,u).compute(([l,v])=>l||v),f=vr(n).compute(l=>l!==void 0);return pt({...p,className:s("g-ui-alert",[o,l=>`g-ui-alert-${l}`],c)},pt({className:"g-ui-alert-header"},dt(n,()=>Qo({className:"g-ui-alert-icon"},n)),dt(a,()=>pt({className:"g-ui-alert-title"},a)),dt(u,()=>Ko({type:"button",className:"g-ui-alert-close",onClick:()=>d?.()},"\xD7"))),r)}import{Div as en,Img as tn,when as rn}from"@granularjs/core";function an(...e){let{props:i,children:t}=g(e,{size:"md",alt:""}),{src:r,size:a,alt:o,className:n,...u}=i;return en({...u,className:s("g-ui-avatar",[a,c=>`g-ui-avatar-size-${c}`],n)},rn(r,()=>tn({className:"g-ui-avatar-img",src:r,alt:o}),()=>t))}import{Span as on}from"@granularjs/core";function nn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return on({...a,className:s("g-ui-kbd",r)},t)}import{Code as sn}from"@granularjs/core";function un(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return sn({...a,className:s("g-ui-code",r)},t)}import{Blockquote as gn}from"@granularjs/core";function ln(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return gn({...a,className:s("g-ui-blockquote",r)},t)}import{Div as cn}from"@granularjs/core";function pn(...e){let{props:i,children:t}=g(e,{cols:3,gap:"md"}),{cols:r,gap:a,className:o,...n}=i;return cn({...n,className:s("g-ui-grid",[a,u=>`g-ui-gap-${u}`],[r,u=>`g-ui-grid-cols-${u}`],o)},t)}import{Ul as dn,Ol as mn,Li as mt,Div as Di,Span as ft,after as ht,when as We,isSignal as fn,isState as hn,isStatePath as vn,isComputed as bn}from"@granularjs/core";function br(...e){let{props:i,children:t}=g(e,{type:"none",size:"md"}),{type:r,size:a,withPadding:o,className:n,...u}=i,c=ve(r,{ordered:"g-ui-list-ordered",unordered:"g-ui-list-unordered",none:"g-ui-list-none"}),p=ht(r).compute(k=>k==="ordered"),d=k=>k&&typeof k=="object"&&typeof k.tagName=="string"&&(k.tagName.toLowerCase()==="ul"||k.tagName.toLowerCase()==="ol"),x=k=>k&&typeof k=="object"&&typeof k.tagName=="string"&&k.tagName.toLowerCase()==="li",f=k=>{let $=S=>S?.nodeType==="granular-list-node"?S:S==null||S===!1?null:Array.isArray(S)?S.map(N=>$(N)):x(S)?S:d(S)?mt({className:"g-ui-list-nested-item"},S):mt(ft({className:"g-ui-list-item-shell"},S));return fn(k)||hn(k)||vn(k)||bn(k)?ht(k).compute(S=>$(S)):$(k)},l=We(t,()=>t.map(k=>f(k))),v={...u,className:s("g-ui-list",z("g-ui-list-size-",a,"md"),U("g-ui-list-with-padding",o),c,n)};return We(p,()=>mn(v,l),()=>dn(v,l))}function xn(...e){let{props:i,children:t}=g(e,{withBorder:!1}),{leftSection:r,rightSection:a,title:o,body:n,withBorder:u,className:c,verticalPadding:p,horizontalPadding:d,...x}=i,f=ht(o,n).compute(([l,v])=>!!l||!!v);return mt({...x,className:s("g-ui-list-item",U("g-ui-list-item-border",u),z("g-ui-list-item-vertical-padding-",p,"md"),z("g-ui-list-item-horizontal-padding-",d,"md"),c)},Di({className:"g-ui-list-item-shell"},We(r,()=>ft({className:"g-ui-list-item-section g-ui-list-item-section-left"},r)),We(f,()=>Di({className:"g-ui-list-item-content"},We(o,()=>Di({className:"g-ui-list-item-title"},o)),We(n,()=>Di({className:"g-ui-list-item-body"},n))),()=>t),We(a,()=>ft({className:"g-ui-list-item-section g-ui-list-item-section-right"},a))))}br.Item=xn;import{A as wn}from"@granularjs/core";function yn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return wn({...a,className:s("g-ui-anchor",r)},t)}import{Img as kn}from"@granularjs/core";function zn(...e){let{props:i}=g(e),{className:t,...r}=i;return kn({...r,className:s("g-ui-image",t)})}import{Div as xr}from"@granularjs/core";function Nn(...e){let{props:i}=g(e,{value:0,color:"primary",size:"md"}),{value:t,color:r,size:a,className:o,...n}=i;return xr({...n,className:s("g-ui-progress",z("g-ui-progress-size-",a,"md"),[t,u=>{let c=Math.max(0,Math.min(100,Number(u)||0));return`g-ui-progress-${Math.round(c/5)*5}`}],[r,u=>u?`g-ui-progress-${u}`:""],o)},xr({className:"g-ui-progress-bar"}))}import{Div as Ee,after as qe,state as Cn,when as wr,list as Sn}from"@granularjs/core";function Dn(...e){let{props:i,rawProps:t}=g(e,{size:"md",min:0,max:100,step:1}),{onChange:r}=t,{value:a,marks:o,size:n,min:u,max:c,step:p,disabled:d,className:x,...f}=i,l=Cn(m(a??u)),v=qe(o).compute(w=>w&&w.length>0);qe(a).change(w=>{w!=null&&l.set(m(w))});let k=()=>{let w=Number(m(u)),y=Number(m(c));return!Number.isFinite(w)||!Number.isFinite(y)?{minValue:0,maxValue:100}:{minValue:Math.min(w,y),maxValue:Math.max(w,y)}},$=()=>{let w=Number(m(p));return Number.isFinite(w)&&w>0?w:1},S=w=>{let{minValue:y,maxValue:h}=k(),C=$(),I=Math.max(y,Math.min(h,Number(w))),B=Math.round((I-y)/C)*C+y;B!==l.get()&&(l.set(B),r?.(B))},N=qe(l).compute(w=>{let{minValue:y,maxValue:h}=k(),C=h-y;if(C<=0)return 0;let I=(Number(w??y)-y)/C*100;return Math.max(0,Math.min(100,I))}),M=(w,y)=>{let h=y?.();if(!h||h.width===0)return;let I=Math.min(Math.max(w.clientX-h.left,0),h.width)/h.width,{minValue:B,maxValue:Q}=k();S(B+I*(Q-B))},V=w=>{if(ze(d))return;w.preventDefault?.();let y=w.currentTarget,h=()=>y.getBoundingClientRect();y.setPointerCapture?.(w.pointerId),M(w,h);let C=B=>M(B,h),I=()=>{y.releasePointerCapture?.(w.pointerId),window.removeEventListener("pointermove",C),window.removeEventListener("pointerup",I)};window.addEventListener("pointermove",C),window.addEventListener("pointerup",I)};return Ee({...f,className:s("g-ui-slider",z("g-ui-slider-size-",n,"md"),U("g-ui-slider-disabled",d),x)},Ee({className:"g-ui-slider-track",onPointerDown:V},Ee({className:"g-ui-slider-bar",style:qe(N).compute(w=>({width:`${w}%`}))}),Ee({className:"g-ui-slider-thumb",style:qe(N).compute(w=>({left:`${w}%`}))})),wr(v,()=>Ee({className:"g-ui-slider-marks-placeholder"})),wr(o,()=>Ee({className:"g-ui-slider-marks"},Sn(o,w=>vt({mark:w,getBounds:k})))))}var vt=({mark:e,getBounds:i})=>{let{minValue:t,maxValue:r}=i(),a=r-t,o=qe(e).compute(p=>p.value??p),n=qe(e).compute(p=>p.label??String(p.value)??o),u=Number(o),c=0;return a>0&&(c=(u-t)/a*100),Ee({className:"g-ui-slider-mark",style:{left:`${Math.max(0,Math.min(100,c))}%`}},Ee({className:"g-ui-slider-mark-label"},n))};import{Div as Pn,after as Mn}from"@granularjs/core";function Tn(...e){let{props:i}=g(e,{height:"md",width:"full"}),{height:t,width:r,className:a,...o}=i,n=Mn(t,r).compute(([u,c])=>{let p={};return isNaN(u)||(p.height=`${u}px`),isNaN(c)||(p.width=`${c}px`),p});return Pn({...o,style:{width:n.width,height:n.height,...o.style||{}},className:s("g-ui-skeleton",[t,u=>`g-ui-skeleton-h-${u}`],[r,u=>`g-ui-skeleton-w-${u}`],a)})}import{Button as Vn,after as yr,state as Ln}from"@granularjs/core";function In(...e){let{props:i,rawProps:t,children:r}=g(e,{size:"md",variant:"filled",color:"primary"}),{checked:a,size:o,variant:n,color:u,className:c,...p}=i,{onChange:d}=t,x=Ln(!!a);yr(a).change(l=>{l!=null&&x.set(!!l)});let f=l=>{x.set(l),d?.(l)};return Vn({...p,type:"button",className:s("g-ui-chip",z("g-ui-chip-size-",o,"md"),z("g-ui-chip-variant-",n,"filled"),z("g-ui-chip-color-",u,"primary"),yr(x).compute(l=>l?"g-ui-chip-active":""),c),onClick:()=>f(!x.get())},r)}import{Div as bt,after as kr,state as $n,list as An}from"@granularjs/core";function Bn(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"sm"}),{value:r,data:a,size:o,scroll:n,className:u,...c}=i,{onChange:p}=t,d=$n(m(r));kr(r).change(f=>{let l=m(f);l!=null&&d.set(l)});let x=f=>{d.set(f),p?.(f)};return bt({...c,className:s(n&&"g-ui-segmented-scroll")},bt({className:s("g-ui-segmented",z("g-ui-segmented-size-",o,"sm"),u)},An(a,(f=>bt({className:s("g-ui-segmented-item",kr(d).compute(l=>f.get().value===l?"g-ui-segmented-active":"")),onClick:()=>x(f.get().value)},f.label)))))}import{Button as xt,Div as Fn,state as jn,after as Pi}from"@granularjs/core";function En(...e){let{props:i,rawProps:t}=g(e,{total:1,size:"md"}),{page:r,total:a,size:o,className:n,...u}=i,{onChange:c}=t,p=jn(m(r)??1);Pi(r).change(l=>{let v=m(l);v!=null&&p.set(v)});let d=l=>{let v=Number(m(a))||1,k=Math.max(1,Math.min(v,l));p.set(k),c?.(k)},x=[],f=Number(m(a))||1;for(let l=1;l<=f;l+=1)x.push(l);return Fn({...u,className:s("g-ui-pagination",z("g-ui-pagination-size-",o,"md"),i.className??n)},xt({className:"g-ui-pagination-item",onClick:()=>d((p.get?.()??p)-1),disabled:Pi(p).compute(l=>l<=1)},"<"),x.map(l=>xt({className:Pi(p).compute(v=>s("g-ui-pagination-item",l===v&&"g-ui-pagination-item-active")),onClick:()=>d(l)},String(l))),xt({className:"g-ui-pagination-item",onClick:()=>d((p.get?.()??p)+1),disabled:Pi(p).compute(l=>l>=a)},">"))}import{Div as Wn,Input as qn,Label as Yn,Span as zr,when as Nr,after as kt,state as Gn}from"@granularjs/core";import{Div as Rn,context as Hn,after as wt}from"@granularjs/core";var yt=Hn({name:"",selected:null});function On(...e){let{props:i,children:t,rawProps:r}=g(e),{className:a,name:o,selected:n,onChange:u,...c}=i,{onChange:p}=r,d=yt.scope({name:o?.get(),selected:n?.get()});return console.log("selected?.get()",n?.get()),wt(o).change(x=>{d.set().name=x}),wt(n).change(x=>{x!==d.selected.get()&&(d.set().selected=x)}),wt(d.selected).change(x=>{p?.(x)}),d.serve(Rn({...c,className:s("g-ui-stack g-ui-gap-sm",a)},t))}function _n(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,name:a,value:o,checked:n,description:u,size:c,className:p,inputProps:d,...x}=i,{onChange:f}=t,l=Gn(n?.get()??!1),v=yt.state(),k=kt(v.name,a).compute(([S,N])=>S||N);kt(n,v.selected).change(S=>{let[N,M]=S;v.get().name?l.set(M===o.get()):l.set(N)}),kt(l).change(S=>{f?.(S),S&&v.get().name&&(v.set().selected=o.get())});let $=Yn({className:"g-ui-radio-control"},qn({type:"radio",name:k,value:o,checked:l,className:s("g-ui-radio-input",z("g-ui-radio-size-",c,"md"),d?.className),...x}),Nr(r,()=>zr({className:"g-ui-radio-label"},r)));return Wn({className:s("g-ui-radio",z("g-ui-radio-size-",c,"md"),p)},$,Nr(u,()=>zr({className:"g-ui-radio-description"},u)))}import{Nav as Zn,Span as Un}from"@granularjs/core";function Xn(...e){let{props:i,children:t}=g(e,{separator:"/"}),{separator:r,className:a,...o}=i,n=[];Array.isArray(t)?n.push(...t):n.push(t);let u=n.filter(Boolean),c=[];return u.forEach((p,d)=>{c.push(p),d<u.length-1&&c.push(Un({className:"g-ui-breadcrumbs-separator"},r))}),Zn({...o,className:s("g-ui-breadcrumbs",a)},c)}import{Div as Kn}from"@granularjs/core";function Qn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Kn({...a,className:s("g-ui-center",r)},t)}import{Div as Jn}from"@granularjs/core";function es(...e){let{props:i}=g(e,{size:"md"}),{size:t,className:r,...a}=i;return Jn({...a,className:s("g-ui-space",[t,o=>`g-ui-space-${o}`],r)})}import{Div as is,when as ts}from"@granularjs/core";function rs(...e){let{props:i,children:t}=g(e),{opened:r,className:a,...o}=i;return ts(r,()=>is({...o,className:s("g-ui-collapse",a)},t))}import{Button as as}from"@granularjs/core";function Ye(...e){let{props:i,children:t}=g(e,{size:"md",variant:"filled"}),{size:r,variant:a,color:o,className:n,...u}=i;return as({...u,type:"button",className:s("g-ui-action-icon",z("g-ui-action-icon-size-",r,"md"),z("g-ui-action-icon-color-",o,"primary"),z("g-ui-action-icon-",a,"filled"),n)},t)}import{Div as zt,when as os,after as ns,state as ss}from"@granularjs/core";function Nt(...e){let{props:i,rawProps:t,children:r}=g(e,{position:"left"}),{opened:a,position:o,content:n,className:u,...c}=i,{onChange:p}=t,d=ss(m(a)??!1);ns(a).change(f=>{let l=m(f);l!=null&&d.set(!!l)});let x=f=>{d.set(f),p?.(f)};return zt({...c,className:s("g-ui-popover",i.className??u)},zt({onClick:()=>x(!d.get())},r),os(d,()=>zt({className:s("g-ui-popover-dropdown",o==="right"&&"g-ui-popover-right",o==="center"&&"g-ui-popover-center")},n)))}import{Div as Cr}from"@granularjs/core";function us(...e){let{props:i,children:t}=g(e,{position:"left"}),{position:r,content:a,className:o,...n}=i;return Cr({...n,className:s("g-ui-hover-card",o)},t,Cr({className:s("g-ui-hover-card-dropdown",[r,u=>u==="right"?"g-ui-hover-card-right":""],[r,u=>u==="center"?"g-ui-hover-card-center":""])},a))}import{Div as gs}from"@granularjs/core";function ls(...e){let{props:i,children:t}=g(e,{position:"bottom-right"}),{position:r,className:a,...o}=i;return gs({...o,className:s("g-ui-affix",[r,n=>`g-ui-affix-${n}`],a)},t)}import{Fieldset as cs,Legend as ps,when as ds}from"@granularjs/core";function ms(...e){let{props:i,children:t}=g(e),{legend:r,className:a,...o}=i;return cs({...o,className:s("g-ui-fieldset",a)},ds(r,()=>ps({className:"g-ui-legend"},r)),t)}import{Div as fs}from"@granularjs/core";function hs(...e){let{props:i,children:t}=g(e,{position:"sticky"}),{position:r,className:a,...o}=i;return fs({...o,className:s("g-ui-appbar",z("g-ui-appbar-",r,"sticky"),a)},t)}import{Div as Ct,portal as vs,after as Mi,state as Sr,when as Dr}from"@granularjs/core";function bs(...e){let{props:i,children:t}=g(e,{position:"left",size:"md",blur:!0,fixed:!1,minWidth:"button"});return Dr(i.fixed,()=>ws(i,t),()=>xs(i,t))}var xs=(e,i)=>{let{open:t,onClose:r,position:a,size:o,blur:n,fixed:u,minWidth:c,className:p,...d}=e,x=Sr(!1),f=Sr(!1),l=220,v=S=>{if(S){x.set(!0),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>f.set(!0)):setTimeout(()=>f.set(!0),0);return}f.set(!1),setTimeout(()=>x.set(!1),l)};v(!!t.get()),Mi(t).change(S=>v(!!S));let k=Mi(f,n).compute(S=>{let[N,M]=S;return s("g-ui-sidebar-overlay",N&&"g-ui-sidebar-overlay-open",!M&&"g-ui-sidebar-overlay-noblur")}),$=Mi(o,a,f,p).compute(S=>{let[N,M,V,w]=S,y=M==="right"?"g-ui-sidebar-drawer-right g-ui-sidebar-position-right":"g-ui-sidebar-drawer-left";return s("g-ui-sidebar","g-ui-sidebar-drawer",`g-ui-sidebar-size-${N}`,y,V&&"g-ui-sidebar-drawer-open",m(w))});return Dr(x,()=>vs(Ct({className:k,onClick:r},Ct({className:$,onClick:S=>S.stopPropagation()},i))))},ws=(e,i)=>{let{open:t,position:r,size:a,minWidth:o,className:n,...u}=e,c=Mi(a,r,t,o,n).compute(p=>{let[d,x,f,l,v]=p,k=l||"button",$=null;return k==="button"?$="g-ui-sidebar-min-button":k==="xs"?$="g-ui-sidebar-min-xs":k==="sm"?$="g-ui-sidebar-min-sm":k==="md"&&($="g-ui-sidebar-min-md"),s("g-ui-sidebar g-ui-sidebar-fixed",`g-ui-sidebar-size-${d||"md"}`,$,f&&"g-ui-sidebar-fixed-open",v)});return Ct({...u,className:c},i)};import{Div as Ne,when as Ti,list as Pr,after as ne,resolve as de,state as ys,Img as ks,Span as zs}from"@granularjs/core";var Mr={xs:6,sm:8,md:10,lg:12,xl:14},Ns={xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px"},Cs={xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px"},Ss=14;function Ds(e){if(e==null||e==="")return"var(--g-ui-primary)";let i=String(e).trim();return i.startsWith("#")?i:`var(--g-ui-${i})`}function Ps(e){return(e??[]).map(t=>{if(t==null)return 1;let r=Number(t.weight);return Number.isFinite(r)&&r>=0?r:1})}function Vi(e){let i=(e??[]).length;if(i<2)return{totalWeight:0,cumulativeWeights:[0]};let r=Ps(e).slice(0,i-1),a=r.reduce((n,u)=>n+u,0),o=[0];for(let n=0;n<r.length;n++)o.push(o[n]+r[n]);return{totalWeight:a,cumulativeWeights:o}}function Tr(e,i,t,r){if(r<1||t<=0)return 0;let a=Math.max(0,Math.min(100,e));for(let o=r-1;o>=0;o--){let n=i[o]/t*100;if(a>=n)return o}return 0}function Ms(e,i,t,r,a,o,n){let u=e,c=(n??[]).length;if(c===0)return{activeStep:0,progressPct:0};if(u==="step")return{activeStep:Math.max(0,Math.min(c-1,Math.floor(i??0))),progressPct:0};if(u==="percent"){let p=Math.max(0,Math.min(100,Number(t)||0)),d=Vi(n);return{activeStep:Tr(p,d.cumulativeWeights,d.totalWeight,c),progressPct:p}}if(u==="time"){let p=Number(r)||0,d=a,x=o,f=0;if(Array.isArray(d)&&d.length>=c?f=d.slice(0,c).reduce((N,M)=>N+(Number(M)||0),0):typeof x=="number"&&x>0&&(f=x),f<=0)return{activeStep:0,progressPct:0};let l=f/c,v=0;if(Array.isArray(d)&&d.length>=c){let N=0;for(let M=0;M<c;M++){if(N+=Number(d[M])||0,p<N){v=M;break}v=M}}else v=Math.min(c-1,Math.floor(p/l));let k=Math.min(100,p/f*100),$=Vi(n);return{activeStep:Tr(k,$.cumulativeWeights,$.totalWeight,c),progressPct:k}}return{activeStep:0,progressPct:0}}function Ts(e,i,t,r,a,o){if(a<2||r<0||r>=a-1)return 0;if(e==="step")return i>r?100:0;let{totalWeight:n,cumulativeWeights:u}=o??Vi([]);if(n<=0)return 0;let c=u[r]/n*100,p=u[r+1]/n*100;if(t<=c)return 0;if(t>=p)return 100;let d=p-c;return d<=0?0:(t-c)/d*100}var Vs=0;function Ls(e){let i=document.getElementById(e);if(!i)return[];let t=i.querySelectorAll(".g-ui-timeline-item");if(t.length<2)return[];let r=i.dataset.pinSize||"md",a=Mr[r]??Mr.md,o=[];for(let n=0;n<t.length-1;n++){let u=t[n].offsetTop+a,c=t[n+1].offsetTop-t[n].offsetTop;o.push({top:u,height:c})}return o}function Is(...e){let{props:i,rawProps:t}=g(e,{items:[],mode:"step",active:0,progress:0,elapsedMs:0,stepDurationsMs:null,totalDurationMs:null,clickable:!1,pinRadius:"md",reverseActive:!1,lineWidth:"md",pinSize:"md",activeColor:"primary",align:"left",pinMode:"default"}),{items:r,mode:a,active:o,progress:n,elapsedMs:u,stepDurationsMs:c,totalDurationMs:p,clickable:d,pinRadius:x,reverseActive:f,lineWidth:l,pinSize:v,activeColor:k,align:$,pinMode:S,className:N,...M}=i,{onChange:V}=t,w=ne(k).compute(E=>Ds(de(E))),y=`g-ui-timeline-${++Vs}`,h=ys([]),C=ne(a,o,n,u,c,p,r).compute(E=>{let[G,ee,ae,X,T,j,D]=E;return Ms(G,ee,ae,X,T,j,D)}),I=ne(h,f).compute(([E,G])=>{if(!de(G)||!E?.length)return null;let ee=E[0],ae=0;for(let X of E)ae+=X.height;return{top:ee.top,height:ae}}),B=ne(C).compute(E=>E?.progressPct!=null?`${Math.max(0,Math.min(100,E.progressPct))}%`:"0%"),Q=ne(a).compute(E=>{let G=de(E);return G==="time"||G==="percent"||G==="step"}),se=ne(a).compute(E=>de(E));function re(){setTimeout(()=>{let E=Ls(y);E.length&&h.set(E)},0)}return ne(r).change(()=>re()),ne(v).change(()=>re()),re(),Ne({...M,id:y,"data-pin-size":ne(v).compute(E=>de(E)??"md"),"data-active-color":ne(k).compute(E=>{let G=de(E);if(G==null||typeof G!="string")return"primary";let ee=String(G).trim();return ee.startsWith("#")?"custom":ee||"primary"}),style:ne(k,l,v).compute(([E,G,ee])=>{let ae={"--g-ui-timeline-line-width":Ns[de(G)]??"4px","--g-ui-timeline-track-offset":`calc(${Ss}px - var(--g-ui-timeline-line-width) / 2)`,"--g-ui-timeline-pin-half":Cs[de(ee)]??"10px"},X=de(E);return X&&String(X).trim().startsWith("#")&&(ae["--g-ui-timeline-active-color"]=String(X).trim()),ae}),className:s("g-ui-timeline",ne(a).compute(E=>E?`g-ui-timeline-mode-${de(E)}`:""),ne(Q).compute(E=>E?"g-ui-timeline-has-track":""),ne(d).compute(E=>de(E)?"g-ui-timeline-clickable":""),ne(f).compute(E=>de(E)?"g-ui-timeline-reverse":""),ne($).compute(E=>de(E)==="right"?"g-ui-timeline-align-right":""),z("g-ui-timeline-pin-radius-",x,"md"),z("g-ui-timeline-line-width-",l,"md"),z("g-ui-timeline-pin-size-",v,"md"),ne(S).compute(E=>E?`g-ui-timeline-pin-mode-${de(E)}`:""),N)},Ti(Q,()=>ne(f).compute(E=>de(E)?Ne({className:"g-ui-timeline-track-segment g-ui-timeline-track-reverse",style:ne(I).compute(G=>G?{top:`${G.top}px`,height:`${G.height}px`}:{})},Ne({className:"g-ui-timeline-track-fill",style:ne(B).compute(G=>G?{height:G}:{height:"0%"})})):Pr(h,(G,ee)=>{let ae=ne(G).compute(j=>j?{top:`${j.top}px`,height:`${j.height}px`}:{}),X=ne(C,ee,r,se).compute(([j,D,Y,P])=>{let R=Y??[],H=R.length,J=Vi(R);return Ts(P,j?.activeStep??0,j?.progressPct??0,de(D)??0,H,J)}),T=ne(X).compute(j=>`${Math.max(0,Math.min(100,j))}%`);return Ne({className:"g-ui-timeline-track-segment",style:ne(ae).compute(j=>j)},Ne({className:"g-ui-timeline-track-fill",style:ne(T).compute(j=>j?{height:j}:{height:"0%"})}))}))),Pr(r,(E,G)=>{let ee=ne(C,G,r,f).compute(([R,H,J,pe])=>{let ke=R?.activeStep??0,Pe=de(H)??0,Be=(J??[]).length,Ve=de(pe)?Be-1-Pe:Pe;return Ve<ke?"completed":Ve===ke?"active":"future"}),ae=ne(ee).compute(R=>R?`g-ui-timeline-item-${R}`:""),X=de(d)&&typeof V=="function"?()=>{let R=de(G);typeof R=="number"&&V(R)}:void 0,T=ne(S).compute(R=>de(R)??"default"),j=ne(T,E).compute(([R,H])=>{let J=R??"default";return J==="icon"&&(H?.icon!=null||H?.pinIcon!=null)?zs({className:"g-ui-timeline-pin-icon material-symbols-outlined"},H.icon??H.pinIcon??""):J==="image"&&(H?.image!=null||H?.pinImage!=null||H?.src!=null)?ks({className:"g-ui-timeline-pin-image",src:H.image??H.pinImage??H.src,alt:H.pinImageAlt??""}):J==="custom"&&H?.pinContent!=null?H.pinContent:null}),D=ne(T,E).compute(([R,H])=>{let J=R??"default";return J==="icon"?H?.icon!=null||H?.pinIcon!=null:J==="image"?H?.image!=null||H?.pinImage!=null||H?.src!=null:J==="custom"?H?.pinContent!=null:!1}),Y=Ne({className:"g-ui-timeline-dot"},Ne({className:"g-ui-timeline-dot-inner"}),Ti(D,()=>j)),P=Ne({className:"g-ui-timeline-content"},Ti(E.title,()=>Ne({className:"g-ui-timeline-title"},E.title)),Ti(E.description,()=>Ne({className:"g-ui-timeline-desc"},E.description)),E.content);return Ne({className:s("g-ui-timeline-item",ae),style:ne(w).compute(R=>R?{"--g-ui-timeline-active-color":R}:void 0),onClick:X,role:X?"button":void 0,tabIndex:X?0:void 0},Ne({className:"g-ui-dot-wrapper"},Y),P)}))}import{Div as Li,list as $s}from"@granularjs/core";function As(...e){let{props:i}=g(e,{active:0,items:[]}),{active:t,items:r,className:a,...o}=i;return Li({...o,className:s("g-ui-stepper",a)},$s(r,(n,u)=>Li({className:s("g-ui-stepper-item",[t,c=>(console.log("value",c,"idx",u),u.get()===c?"g-ui-stepper-active":"")])},Li({className:"g-ui-stepper-index"},String(u+1)),Li({className:"g-ui-stepper-label"},n.label))))}import{Span as Vr,after as Lr,state as Bs}from"@granularjs/core";function Fs(...e){let{props:i,rawProps:t}=g(e,{value:0,max:5,size:"md"}),{value:r,max:a,size:o,className:n,...u}=i,{onChange:c}=t,p=Bs(m(r));Lr(r).change(l=>{let v=m(l);v!=null&&p.set(v)});let d=l=>{p.set(l),c?.(l)},x=[],f=Number(m(a))||0;for(let l=1;l<=f;l+=1)x.push(l);return Vr({...u,className:s("g-ui-rating",z("g-ui-rating-size-",o,"md"),i.className??n)},x.map(l=>Vr({className:s("g-ui-rating-item",Lr(p).compute(v=>l<=v?"g-ui-rating-item-active":"")),onClick:()=>d(l)},"\u2605")))}import{Span as js}from"@granularjs/core";function Es(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return js({...a,className:s("g-ui-tag",r)},t)}import{Button as Ir,Div as Xe,state as $r,after as Ii}from"@granularjs/core";var Rs=["S","M","T","W","T","F","S"];function gi(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{value:r,className:a,size:o,...n}=i,{onChange:u}=t,c=N=>{let M=m(N);if(M instanceof Date)return M;if(M==null)return null;let V=new Date(M);return Number.isNaN(V.getTime())?null:V},p=$r(c(r)??new Date),d=$r(new Date(p.get()));Ii(r).change(N=>{let M=c(N);M!=null&&(p.set(M),d.set(new Date(M)))});let x=(N,M,V)=>{let w=new Date(N,M+1,0).getDate();return new Date(N,M,Math.min(V,w))},f=N=>{let M=d.get(),V=x(M.getFullYear(),M.getMonth(),N);p.set(V),d.set(V),u?.(V)},l=N=>{let M=d.get(),V=x(M.getFullYear(),M.getMonth()+N,M.getDate());d.set(V)},v=N=>{let M=d.get(),V=x(M.getFullYear()+N,M.getMonth(),M.getDate());d.set(V)},k=Ii(d).compute(N=>N.toLocaleString("default",{month:"long"})),$=Ii(d).compute(N=>String(N.getFullYear())),S=Ii(d,p).compute(([N,M])=>{let V=N.getFullYear(),w=N.getMonth(),h=new Date(V,w,1).getDay(),C=new Date(V,w+1,0).getDate(),I=[];for(let B=0;B<h;B+=1)I.push({muted:!0,label:""});for(let B=1;B<=C;B+=1)I.push({label:B});return[...Rs.map(B=>Xe({className:"g-ui-calendar-cell g-ui-calendar-cell-muted"},B)),...I.map(B=>Xe({className:s("g-ui-calendar-cell",B.muted&&"g-ui-calendar-cell-muted",B.label&&M.getFullYear()===V&&M.getMonth()===w&&B.label===M.getDate()&&"g-ui-calendar-cell-active"),onClick:()=>B.label&&f(B.label)},B.label))]});return Xe({...n,className:s("g-ui-calendar",a,z("g-ui-calendar-size-",o,"md"))},Xe({className:"g-ui-calendar-header"},Ye({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>l(-1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:yi})),Xe({className:"g-ui-calendar-title-group"},Ir({type:"button",className:"g-ui-calendar-title-button",onClick:()=>l(1)},k),Ir({type:"button",className:"g-ui-calendar-title-button",onClick:()=>v(1)},$)),Ye({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>l(1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:wi}))),Xe({className:"g-ui-calendar-grid"},S))}import{Div as li,Span as Ke,Input as Hs,when as St,after as De,state as $i}from"@granularjs/core";function Os(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md",searchable:!0}),{value:r,data:a,size:o,className:n,placeholder:u,searchable:c,...p}=i,{onChange:d,onSearchChange:x}=t,f=$i(m(r)??[]),l=$i(""),v=$i(!1),k=$i(null),$=h=>(m(h)??[]).map(I=>typeof I=="string"?{value:I,label:I}:I&&typeof I=="object"?I:{value:String(I),label:String(I)});De(r).change(h=>{let C=m(h);C!=null&&f.set(C)});let S=null;De(v).change(h=>{if(S&&(S(),S=null),!h)return;let C=I=>{let B=k.get();B&&(B.contains(I.target)||v.set(!1))};document.addEventListener("mousedown",C),S=()=>document.removeEventListener("mousedown",C)}),De(l).change(h=>{x?.(h)});let N=h=>{let C=f.get()??[],I=C.includes(h)?C.filter(B=>B!==h):C.concat(h);f.set(I),d?.(I)},M=De(a).compute(h=>$(h)),V=De(M,l).compute(([h,C])=>{let I=String(m(C)??"").toLowerCase().trim();return I?h.filter(B=>String(B.label??"").toLowerCase().includes(I)):h}),w=De(f,l).compute(([h,C])=>{let I=m(h)??[],B=String(m(C)??"");return!I.length&&!B}),y=De(c).compute(h=>!!h);return li({...p,node:k,className:s("g-ui-select-multi-root",n)},li({className:s("g-ui-select-multi",z("g-ui-select-multi-size-",o,"md")),onClick:()=>v.set(!0)},De(M,f).compute(([h,C])=>(m(C)??[]).map(B=>{let se=(h??[]).find(re=>re.value===B)?.label??B;return Ke({className:"g-ui-select-tag"},Ke({className:"g-ui-select-tag-label",onClick:re=>{re?.stopPropagation?.()}},se),Ke({className:"g-ui-select-tag-remove",innerHTML:je,onClick:re=>{re?.stopPropagation?.(),N(B)}}))})),St(w,()=>Ke({className:"g-ui-select-multi-placeholder"},u??"Select...")),St(y,()=>Hs({className:"g-ui-select-multi-input",value:l,onInput:h=>l.set(h.target?.value??""),onFocus:()=>v.set(!0)}))),St(v,()=>li({className:"g-ui-select-dropdown"},De(V).compute(h=>h.length?h.map(C=>li({className:s("g-ui-select-item",C.disabled&&"g-ui-select-item-disabled",De(f).compute(I=>(m(I)??[]).includes(C.value)?"g-ui-select-item-active":"")),onClick:()=>{C.disabled||N(C.value)}},Ke({className:"g-ui-select-item-check",innerHTML:De(f).compute(I=>(m(I)??[]).includes(C.value)?ki:"")}),Ke({className:"g-ui-select-item-label"},C.label))):li({className:"g-ui-select-item"},"Nothing found")))))}import{Div as Ys,list as Gs,portal as _s}from"@granularjs/core";import{Div as Dt,Button as Ws,when as Ar,state as qs}from"@granularjs/core";function Pt(...e){let{props:i,rawProps:t,children:r}=g(e),{title:a,className:o,...n}=i,{onClose:u}=t,c=qs(!0),p=()=>{c.set(!1),u?.(),console.log("close")};return Ar(c,()=>Dt({...n,className:s("g-ui-toast",o)},Dt({className:"g-ui-toast-row"},Ar(a,()=>Dt({className:"g-ui-toast-title"},a)),Ws({className:"g-ui-toast-close",onClick:p},ye({innerHTML:je}))),r))}function Zs(...e){let{props:i,rawProps:t}=g(e,{items:[]}),{items:r,className:a,timeout:o,...n}=i,{onClose:u}=t;return _s(Ys({...n,className:s("g-ui-toast-stack",a)},Gs(r,c=>Pt({title:c.title,onClose:()=>u?.(c)},c.message))))}function Us(...e){let{props:i}=g(e);return gi(i)}import{Div as Xs,after as Ks}from"@granularjs/core";function Qs(...e){let{props:i,rawProps:t}=g(e,{items:[],position:"top-right"}),{items:r,position:a,className:o,...n}=i,{onRemove:u}=t,c=new Map,p=(x,f)=>x?.id??x?.key??f,d=Ks(r).compute(x=>{let f=m(x)??[],l=new Set;f.forEach((v,k)=>{let $=p(v,k);if(l.add($),v?.autoClose&&!c.has($)){let S=setTimeout(()=>{c.delete($),u?.(v)},v.autoClose);c.set($,S)}});for(let[v,k]of c.entries())l.has(v)||(clearTimeout(k),c.delete(v));return f.map((v,k)=>ct({key:p(v,k),title:v.title,color:v.color,icon:v.icon,loading:v.loading,withCloseButton:v.withCloseButton,withBorder:v.withBorder,onClose:()=>{v.onClose?.(),u?.(v)}},v.message??v.body??v.content??v.text))});return Xs({...n,className:s("g-ui-notifications",z("g-ui-notifications-position-",a,"top-right"),o)},d)}import{Div as Qe,after as ci,state as Js,when as eu}from"@granularjs/core";function iu(...e){let{props:i,rawProps:t}=g(e,{min:0,max:100,step:1,size:"md"}),{value:r,marks:a,min:o,max:n,step:u,size:c,disabled:p,className:d,...x}=i,{onChange:f}=t,l=Js(m(r??[o,n])),v=()=>{let w=Number(m(o)),y=Number(m(n));return!Number.isFinite(w)||!Number.isFinite(y)?{minValue:0,maxValue:100}:{minValue:Math.min(w,y),maxValue:Math.max(w,y)}},k=()=>{let w=Number(m(u));return Number.isFinite(w)&&w>0?w:1},$=w=>{let{minValue:y,maxValue:h}=v(),C=k(),I=[y,h];Array.isArray(w)&&(I=w);let B=Math.max(y,Math.min(h,Number(I[0]))),Q=Math.max(y,Math.min(h,Number(I[1]))),se=Math.round(Math.min(B,Q)/C)*C,re=Math.round(Math.max(B,Q)/C)*C;return[se,re]};ci(r).change(w=>{w!=null&&l.set($(w))});let S=w=>{let y=$(w);y?.[0]===l.get()?.[0]&&y?.[1]===l.get()?.[1]||(l.set(y),f?.(y))},N=ci(l).compute(w=>{let{minValue:y,maxValue:h}=v(),C=h-y,[I,B]=$(w);if(C<=0)return{lowPct:0,highPct:0};let Q=(I-y)/C*100,se=(B-y)/C*100;return{lowPct:Math.max(0,Math.min(100,Q)),highPct:Math.max(0,Math.min(100,se))}}),M=(w,y,h)=>{let C=y?.();if(!C||C.width===0)return;let B=Math.min(Math.max(w.clientX-C.left,0),C.width)/C.width,{minValue:Q,maxValue:se}=v(),re=Q+B*(se-Q),E=l;typeof l.get=="function"&&(E=l.get());let[G,ee]=$(E);S(h==="low"?[re,ee]:[G,re])},V=(w,y,h)=>{if(ze(p))return;w.preventDefault?.();let C=h||w.currentTarget,I=()=>C.getBoundingClientRect(),B=I(),Q=N;typeof N.get=="function"&&(Q=N.get());let{lowPct:se,highPct:re}=Q,E=(w.clientX-B.left)/B.width*100,G=y;if(!G){let X=Math.abs(E-se)<=Math.abs(E-re);G="high",X&&(G="low")}C.setPointerCapture?.(w.pointerId),M(w,I,G);let ee=X=>M(X,I,G),ae=()=>{C.releasePointerCapture?.(w.pointerId),window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",ae)};window.addEventListener("pointermove",ee),window.addEventListener("pointerup",ae)};return Qe({...x,className:s("g-ui-range-slider",z("g-ui-slider-size-",c,"md"),U("g-ui-slider-disabled",p),i.className??d)},Qe({className:"g-ui-slider-track",onPointerDown:w=>V(w)},Qe({className:"g-ui-slider-bar",style:ci(N).compute(({lowPct:w,highPct:y})=>({left:`${w}%`,width:`${Math.max(0,y-w)}%`}))}),Qe({className:"g-ui-slider-thumb",style:ci(N).compute(({lowPct:w})=>({left:`${w}%`})),onPointerDown:w=>{w.stopPropagation?.(),V(w,"low",w.currentTarget.parentElement)}}),Qe({className:"g-ui-slider-thumb",style:ci(N).compute(({highPct:w})=>({left:`${w}%`})),onPointerDown:w=>{w.stopPropagation?.(),V(w,"high",w.currentTarget.parentElement)}})),eu(a,()=>Qe({className:"g-ui-slider-marks"},a.map(w=>vt({mark:w,getBounds:v})))))}import{state as Mt,after as Br}from"@granularjs/core";function Ai(...e){let{props:i,rawProps:t}=g(e,{size:"md",format:{pattern:"dddd-dd-dd"}}),{value:r,size:a,calendarSize:o,leftSection:n,rightSection:u,className:c,format:p,minDate:d,maxDate:x,...f}=i,{onChange:l}=t,v=y=>{let h=m(y);if(h instanceof Date)return h;if(h==null||h==="")return null;let C=new Date(h);return Number.isNaN(C.getTime())?null:C},k=(y,h)=>y&&h&&y.getFullYear()===h.getFullYear()&&y.getMonth()===h.getMonth()&&y.getDate()===h.getDate(),$=y=>{if(!y)return"";let h=String(y.getFullYear()).padStart(4,"0"),C=String(y.getMonth()+1).padStart(2,"0"),I=String(y.getDate()).padStart(2,"0");return`${h}-${C}-${I}`},S=y=>{let h=String(y??"").replace(/\D/g,"");if(h.length<8)return null;let C=Number(h.slice(0,4)),I=Number(h.slice(4,6)),B=Number(h.slice(6,8));if(!C||!I||!B)return null;let Q=new Date(C,I-1,B);if(Q.getFullYear()!==C||Q.getMonth()!==I-1||Q.getDate()!==B)return null;let se=v(d);if(se&&Q<se)return null;let re=v(x);return re&&Q>re?null:Q},N=Mt(v(r)),M=Mt($(N.get())),V=Mt(!1);Br(r).change(y=>{let h=v(y);if(!k(h,N.get())){if(h==null){N.set(null),M.set("");return}N.set(h),M.set($(h))}}),Br(M).change(y=>{let h=S(y);h&&(k(h,N.get())||(N.set(h),l?.(h)))});let w=y=>{y&&(k(y,N.get())||(N.set(y),M.set($(y)),l?.(y),V.set(!1)))};return Nt({opened:V,onChange:y=>V.set(!!y),content:gi({size:z("",o,"xs"),value:N,onChange:w}),className:"g-ui-date-input-popover"},be({...f,size:a,className:s("g-ui-dateinput",c),leftSection:n,rightSection:u,type:"text",inputMode:"numeric",format:p,value:M,onChange:y=>M.set(y)}))}import{Div as Tt,when as tu,after as ru,state as au}from"@granularjs/core";function ou(...e){let{props:i,rawProps:t,children:r}=g(e),{opened:a,content:o,className:n,...u}=i,{onChange:c}=t,p=au(m(a)??!1);ru(a).change(x=>{let f=m(x);f!=null&&p.set(!!f)});let d=x=>{p.set(x),c?.(x)};return Tt({...u,className:s("g-ui-popper",n)},Tt({onClick:()=>d(!p.get())},r),tu(p,()=>Tt({className:"g-ui-popper-dropdown"},o)))}import{Button as nu,after as Fr,when as su,state as uu}from"@granularjs/core";function gu(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{size:r,className:a,rightSection:o,...n}=i,{onChange:u}=t,c=uu(!1),p=Fr(c).compute(x=>x?"text":"password"),d=Fr(o).compute(x=>x??nu({className:"g-ui-password-toggle",onClick:()=>c.set(!c.get())},su(c,()=>"Hide",()=>"Show")));return be({...n,size:r,className:a,onChange:u,rightSection:d,type:p})}import{Div as lu}from"@granularjs/core";function cu(...e){let{props:i}=g(e,{size:"md"}),{size:t,className:r,...a}=i;return be({...a,size:t,className:r,leftSection:lu({className:"g-ui-search-input-left-section",innerHTML:Qt}),type:"text",inputMode:"search"})}import{Button as pu,after as du,when as jr}from"@granularjs/core";import{state as mu}from"@granularjs/core";function fu(...e){let{props:i,children:t}=g(e,{value:"",timeout:1500}),{value:r,timeout:a,className:o,...n}=i,u=mu(!1),c=du(u).compute(d=>s("g-ui-copy-button",d&&"g-ui-copy-button-done",o));return pu({...n,className:c,onClick:async()=>{try{await navigator.clipboard.writeText(String(r)),u.set(!0),setTimeout(()=>u.set(!1),a)}catch{}},type:"button"},jr(t?.length,()=>t,()=>jr(u,()=>"Copied",()=>"Copy")))}import{Div as Er,after as pi,resolve as hu}from"@granularjs/core";function Rr(e){let i=Number(e);return Number.isNaN(i)?0:Math.max(0,Math.min(100,i))}function vu(...e){let{props:i}=g(e,{size:"md",value:null,color:"primary"}),{size:t,value:r,color:a,className:o,...n}=i,u=pi(r).compute(f=>f!=null&&f!==""),c=pi(r).compute(f=>Rr(f)),p=pi(c,u).compute(([f,l])=>{if(!l)return{};let v=Number(f),k=Number.isNaN(v)?0:Math.max(0,Math.min(360,v*3.6));return{background:`conic-gradient(var(--g-ui-progress-ring-fill, var(--g-ui-primary)) 0deg ${k}deg, var(--g-ui-border-muted) ${k}deg 360deg)`}}),d=pi(u).compute(f=>f?"":"g-ui-progress-ring-indeterminate"),x=pi(u,r).compute(([f,l])=>f?Rr(l):void 0);return Er({...n,className:s("g-ui-progress-ring",z("g-ui-progress-ring-",a,"primary"),[t,f=>`g-ui-progress-ring-size-${hu(f)??"md"}`],d,o),style:p,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x},Er({className:"g-ui-progress-ring-hole"}))}import{Div as Bi,state as Lt,after as Ge,list as xu,when as wu}from"@granularjs/core";import{Div as bu}from"@granularjs/core";function Vt(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,className:a,...o}=i;return bu({...o,className:s("g-ui-scroll-area",[r,n=>`g-ui-scroll-area-${n}`],a)},t)}function $e(e,i){if(i==null||i==="")return e;let t=String(i).trim().split("."),r=e;for(let a of t)r=r?.[a];return r}function yu(e,i,t){let r=t(i);return String(r??"").toLowerCase().includes(String(e??"").toLowerCase())}function It(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md",valuePath:"value",labelPath:"label"}),{data:r,value:a,size:o,valuePath:n,labelPath:u,filter:c,placeholder:p,label:d,description:x,error:f,leftSection:l,rightSection:v,className:k,inputClassName:$,disabled:S,...N}=i,{onChange:M,renderItem:V}=t,w=Lt(!1),y=Lt(""),h=Lt(m(a));Ge(a).change(D=>{let Y=m(D);Y!==h.get()&&h.set(Y)});let C=Ge(r).compute(D=>Array.isArray(D)?D:[]),I=Ge(C,h,n).compute(([D,Y,P])=>{if(Y==null)return null;let R=H=>P==null||P===""?H:$e(H,P);return D.find(H=>R(H)===Y)??null}),B=Ge(I,w,y,u).compute(([D,Y,P,R])=>{let H=J=>R==null||R===""?String(J??""):String($e(J,R)??"");return Y?P??"":D?H(D):""}),Q=Ge(C,y,c,u).compute(([D,Y,P,R])=>{let H=pe=>R==null||R===""?String(pe??""):String($e(pe,R)??""),J=m(P)??yu;return D.filter(pe=>J(Y,pe,H))}),se=D=>{let Y=m(n),P=Y==null||Y===""?D:$e(D,Y);h.set(P),y.set(""),w.set(!1),M?.(P)},re=()=>{if(m(S))return;w.set(!0);let D=I.get(),Y=m(u),P=R=>Y==null||Y===""?String(R??""):String($e(R,Y)??"");y.set(D?P(D):"")},E=()=>{w.set(!1);let D=I.get(),Y=m(u),P=R=>Y==null||Y===""?String(R??""):String($e(R,Y)??"");y.set(D?P(D):"")},{onChange:G,...ee}=N,ae={...ee,size:o,label:d,description:x,error:f,leftSection:l,rightSection:v,placeholder:m(p)??void 0,disabled:S,value:B,onInput:D=>y.set(D?.target?.value??""),onFocus:re,onClick:re,onBlur:()=>setTimeout(()=>E(),150)},X=D=>{let Y=m(n);return Y==null||Y===""?D:$e(D,Y)},T=D=>Ge(h,n).compute(([Y,P])=>(H=>P==null||P===""?H:$e(H,P))(D)===Y?"g-ui-autocomplete-item-active":""),j=D=>{if(V&&typeof V=="function"){let Y=V(D);if(Y!=null)return Bi({className:s("g-ui-autocomplete-item",T(D)),onClick:()=>se(D),role:"option"},Y)}return Bi({className:s("g-ui-autocomplete-item",T(D)),onClick:()=>se(D),role:"option"},Ge(u).compute(Y=>Y==null||Y===""?String(D??""):String($e(D,Y)??"")))};return Bi({className:s("g-ui-autocomplete",k,U("g-ui-autocomplete-disabled",S))},be({...ae,className:s("g-ui-autocomplete-input-wrapper",ae.className),inputClassName:s("g-ui-autocomplete-input",$)}),wu(w,()=>Bi({className:"g-ui-autocomplete-dropdown",role:"listbox"},Vt({className:"g-ui-autocomplete-list",style:{maxHeight:"240px"}},xu(Q,D=>j(D))))))}function ku(...e){return It(...e)}import{Div as zu,Span as Nu,state as Hr,after as Cu}from"@granularjs/core";function Or(e){let i=m(e);if(i instanceof Date)return i;if(i==null||i==="")return null;let t=new Date(i);return Number.isNaN(t.getTime())?null:t}function Wr(e){let i=m(e);if(i==null)return[null,null];let t=Array.isArray(i)?i:[i];return[Or(t[0]),Or(t[1])]}function qr(e,i){return!e||!i?e===i:e.getFullYear()===i.getFullYear()&&e.getMonth()===i.getMonth()&&e.getDate()===i.getDate()}function Su(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{value:r,size:a,minDate:o,maxDate:n,className:u,placeholderMin:c,placeholderMax:p,...d}=i,{onChange:x}=t,[f,l]=Wr(r),v=Hr(f),k=Hr(l);Cu(r).change(M=>{let[V,w]=Wr(M);qr(V,v.get())&&qr(w,k.get())||(v.set(V),k.set(w))});let $=()=>{let M=v.get(),V=k.get();x?.([M??null,V??null])},S=M=>{let V=k.get();M&&V&&M>V&&k.set(M),v.set(M),$()},N=M=>{let V=v.get();M&&V&&M<V&&v.set(M),k.set(M),$()};return zu({...d,className:s("g-ui-range-picker",i.className??u)},Ai({...d,size:a,value:v,onChange:S,maxDate:k,placeholder:m(c)??void 0}),Nu({className:"g-ui-range-picker-separator"},"\u2013"),Ai({...d,size:a,value:k,onChange:N,minDate:v,placeholder:m(p)??void 0}))}import{Div as Du}from"@granularjs/core";function Pu(...e){let{props:i,children:t}=g(e,{align:"center",direction:"row"}),{direction:r,wrap:a,align:o,justify:n,gap:u,className:c,...p}=i;return Du({...p,className:s("g-ui-flex",[r,d=>d==="column"?"g-ui-flex-column":"g-ui-flex-row"],[a,"g-ui-flex-wrap"],[o,d=>d&&`g-ui-align-${d}`],[n,d=>d&&`g-ui-justify-${d}`],[u,d=>d&&`g-ui-gap-${d}`],c)},t)}import{A as Mu,Div as di,Span as Yr,when as mi,after as Gr,state as Tu}from"@granularjs/core";function Vu(...e){let{props:i,rawProps:t,children:r}=g(e,{variant:"subtle",childrenOffset:24}),{label:a,description:o,leftSection:n,rightSection:u,active:c,disabled:p,variant:d,childrenOffset:x,opened:f,defaultOpened:l,className:v,padding:k,...$}=i,{onClick:S,onChange:N}=t,M=r.length>0,V=Tu(m(f)??m(l)??!1);Gr(f).change(h=>{let C=m(h);C!=null&&V.set(!!C)});let w=Gr(x).compute(h=>({paddingLeft:Gt(m(h??24))??"24px"})),y=h=>{if(m(p)){h?.preventDefault?.();return}if(M){let C=!V.get();V.set(C),N?.(C)}S?.(h)};return di({className:s("g-ui-navlink-root",v)},Mu({...$,className:s("g-ui-navlink",z("g-ui-navlink-variant-",d,"subtle"),U("g-ui-navlink-active",c),U("g-ui-navlink-disabled",p),z("g-ui-navlink-padding-",k,"md")),onClick:y},mi(n,()=>Yr({className:"g-ui-navlink-section g-ui-navlink-left"},n)),di({className:"g-ui-navlink-body"},mi(a,()=>di({className:"g-ui-navlink-label"},a)),mi(o,()=>di({className:"g-ui-navlink-description"},o))),mi(u,()=>Yr({className:"g-ui-navlink-section g-ui-navlink-right"},u))),M?mi(V,()=>di({className:"g-ui-navlink-children",style:w},r)):null)}import{Div as _r,when as Lu}from"@granularjs/core";function Iu(...e){let{props:i,children:t}=g(e,{show:!0,position:"top-right",color:"danger",size:"md"}),{show:r,position:a,color:o,size:n,className:u,...c}=i;return _r({...c,className:s("g-ui-indicator",z("g-ui-indicator-position-",a,"top-right"),z("g-ui-indicator-color-",o,"danger"),z("g-ui-indicator-size-",n,"md"),u)},t,Lu(r,()=>_r({className:"g-ui-indicator-badge"})))}import{Span as Fi}from"@granularjs/core";function $u(...e){let{props:i}=g(e),{opened:t,className:r,...a}=i;return Fi({...a,className:s("g-ui-burger",[t,"g-ui-burger-open"],r)},Fi(""),Fi(""),Fi(""))}import{Div as Au,when as Bu}from"@granularjs/core";function Fu(...e){let{props:i}=g(e),{visible:t,...r}=i;return Bu(t,()=>Au({...r,className:"g-ui-loading-overlay"},oi({})))}import{Div as ju}from"@granularjs/core";function Eu(...e){let{props:i,children:t}=g(e,{gap:"md"}),{className:r,gap:a,...o}=i;return ju({...o,className:s("g-ui-grid-system",[a,n=>`g-ui-gap-${n}`],r)},t)}import{Div as Ru}from"@granularjs/core";function Hu(...e){let{props:i,children:t}=g(e,{span:12}),{span:r,className:a,...o}=i;return Ru({...o,className:s([r,n=>`g-ui-col-span-${n}`],a)},t)}import{Div as Zr,Input as Ou,after as Ae,state as $t,when as Ur,list as Wu}from"@granularjs/core";function qu(...e){let{props:i,rawProps:t}=g(e,{length:4,size:"md",type:"alphanumeric",mask:!1,placeholder:"\u25CB",disabled:!1,error:!1,oneTimeCode:!1}),{length:r,value:a,size:o,type:n,mask:u,placeholder:c,disabled:p,error:d,oneTimeCode:x,className:f}=i,{onChange:l,onComplete:v}=t,k=$t(m(r)??4),$=()=>k.get();Ae(r).change(T=>{let j=m(T)??4,D=k.get();if(j===D)return;k.set(j);let Y=N.get(),P=S.get();N.set(Array.from({length:j},(R,H)=>Y[H]??"")),S.set(Array.from({length:j},(R,H)=>P[H]??null))});let S=$t(Array.from({length:$()},()=>null)),N=$t(Array.from({length:$()},(T,j)=>{let D=m(a);return typeof D=="string"||Array.isArray(D)?D[j]??"":""}));Ae(a).change(T=>{if(T==null)return;let j=$();typeof T=="string"?N.set(Array.from({length:j},(D,Y)=>T[Y]??"")):Array.isArray(T)&&N.set(Array.from({length:j},(D,Y)=>T[Y]??""))});let M=()=>N.get().join(""),V=T=>{N.set(T);let j=T.join("");l?.(j),T.every(D=>D!=="")&&T.length===$()&&v?.(j)},w=T=>{let j=$(),D=S.get();T>=0&&T<j&&D[T]&&(D[T].focus(),D[T].select())},y=()=>{let T=m(n);return T==="number"?/^[0-9]$/:T instanceof RegExp?T:/^[a-zA-Z0-9]$/},h=(T,j)=>{let D=j.target.value,Y=y();if(D.length>1){C(T,D);return}if(D&&!Y.test(D)){j.target.value=N.get()[T]??"";return}let P=N.get().slice();P[T]=D,V(P),D&&T<$()-1&&w(T+1)},C=(T,j)=>{let D=y(),Y=j.split("").filter(J=>D.test(J)),P=N.get().slice(),R=$();Y.forEach((J,pe)=>{let ke=T+pe;ke<R&&(P[ke]=J)}),V(P);let H=P.findIndex((J,pe)=>pe>=T&&J==="");H>=0?w(H):w(Math.min(T+Y.length,R-1))},I=(T,j)=>{if(j.key==="Backspace"){let D=N.get().slice();D[T]===""&&T>0?(j.preventDefault(),D[T-1]="",V(D),w(T-1)):D[T]!==""&&(D[T]="",V(D))}else j.key==="ArrowLeft"&&T>0?(j.preventDefault(),w(T-1)):j.key==="ArrowRight"&&T<$()-1&&(j.preventDefault(),w(T+1))},B=(T,j)=>{j.target.select()},Q=()=>{let T=N.get(),j=T.findIndex(D=>D==="");j>=0?w(j):w(T.length-1)},se=Ae(u).compute(T=>m(T)?"password":"text"),re=Ae(n).compute(T=>m(T)==="number"?"numeric":"text"),E=Ae(x).compute(T=>m(T)?"one-time-code":"off"),G=Ae(p).compute(T=>!!m(T)),ee=Ae(d).compute(T=>!!m(T)),ae=Ae(k).compute(T=>Array.from({length:T},(j,D)=>D)),X=T=>Ou({className:s("g-ui-pin-input-field",Ur(ee,()=>"g-ui-pin-input-error")),type:se,inputMode:re,autocomplete:E,maxLength:2,placeholder:Ur(G,()=>"",()=>c),disabled:G,value:Ae(N,T).compute(([j,D])=>j[D]??""),node:S[T.get()],onInput:j=>h(T.get(),j),onChange:j=>h(T.get(),j),onKeyDown:j=>I(T.get(),j),onFocus:j=>B(T.get(),j)});return Zr({className:s("g-ui-pin-input",z("g-ui-input-size-",o,"md"),f),onClick:Q},Zr({className:"g-ui-pin-input-wrapper"},Wu(ae,X)))}import{Div as Yu}from"@granularjs/core";function Gu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Yu({...a,className:s("g-ui-checkbox-group",r)},t)}import{Div as _u}from"@granularjs/core";function Zu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return _u({...a,className:s("g-ui-avatar-group",r)},t)}import{Div as Uu}from"@granularjs/core";function Xu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Uu({...a,className:s("g-ui-badge-group",r)},t)}import{Div as ji,Span as Ku,after as fi,context as Xr}from"@granularjs/core";var Qu=Xr([]),Kr=Xr({sort:null,onSort:null});function At(...e){let{props:i,rawProps:t,children:r}=g(e,{sizes:[],sort:null,stickyHeader:!1}),{className:a,sizes:o,sort:n,stickyHeader:u,...c}=i,{onSort:p}=t,d=Qu.scope(o.get());fi(o).change(f=>d.set(f));let x=Kr.scope({sort:n.get(),onSort:p||null});return fi(n).change(f=>x.set().sort=f),d.serve(x.serve(ji({className:s("g-ui-grid-table",U("g-ui-grid-table-sticky",u),a),style:{gridTemplateColumns:fi(d).compute(f=>Array.isArray(f)?f.join(" "):"")},...c},r)))}At.GridRow=(...e)=>{let{props:i,children:t}=g(e,{}),{className:r,header:a,...o}=i;return ji({className:s("g-ui-grid-table-row",U("g-ui-grid-table-row-header",a),r),...o},...t)};At.GridCell=function(...e){let{props:i,rawProps:t,children:r}=g(e,{}),{className:a,sort:o,...n}=i,u=t.sort;if(u){let c=Kr.state(),p=fi(c.sort).compute(x=>x?.key===u?x.direction:null),d=()=>{let x=c.get().sort,f;x?.key===u?f=x.direction==="asc"?{key:u,direction:"desc"}:null:f={key:u,direction:"asc"},c.set().sort=f;let{onSort:l}=c.get();l&&l(f)};return ji({className:s("g-ui-grid-table-cell","g-ui-grid-table-cell-sortable",a),onClick:d,...n},r,Ku({className:"g-ui-grid-table-sort-icon"},fi(p).compute(x=>x==="asc"?" \u2191":x==="desc"?" \u2193":"")))}return ji({className:s("g-ui-grid-table-cell",a),...n},r)};import{Button as Ju,Div as eg,Span as Qr,when as Jr}from"@granularjs/core";function ea(...e){let{props:i,children:t}=g(e,{grow:!0}),{grow:r,className:a,...o}=i;return eg({...o,className:s("g-ui-bottombar",U("g-ui-bottombar-grow",r),a)},t)}ea.Action=function(...i){let{props:t,rawProps:r,children:a}=g(i,{variant:"subtle"}),{icon:o,label:n,active:u,disabled:c,variant:p,className:d,...x}=t,{onClick:f}=r;return Ju({...x,className:s("g-ui-bottombar-action",z("g-ui-bottombar-action-variant-",p,"subtle"),U("g-ui-bottombar-action-active",u),U("g-ui-bottombar-action-disabled",c),d),onClick:f,disabled:c},Jr(o,()=>Qr({className:"g-ui-bottombar-action-icon"},o)),Jr(n,()=>Qr({className:"g-ui-bottombar-action-label"},n)),a)};import{Div as W,Button as _e,state as me,after as Ce,when as fe,Input as Ei,Label as hi,Span as Ze}from"@granularjs/core";var ig=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tg=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"}];function Ri(e){if(e instanceof Date)return e;if(e==null)return null;let i=new Date(e);return Number.isNaN(i.getTime())?null:i}function ra(e){let i=Ri(e.start),t=Ri(e.end);return!i||!t?null:{...e,id:e.id??`${i.getTime()}-${e.title??"event"}`,title:e.title??"",start:i,end:t,allDay:!!e.allDay,description:e.description??"",location:e.location??"",attendees:Array.isArray(e.attendees)?e.attendees:[],color:e.color??null}}function aa(e,i,t){let r=Ri(i).getTime(),a=Ri(t).getTime();return e.map(ra).filter(Boolean).filter(o=>o.end.getTime()>r&&o.start.getTime()<a)}function ia(e,i){let t=new Date(i);t.setHours(0,0,0,0);let r=t.getTime();t.setHours(23,59,59,999);let a=t.getTime();return aa(e,r,a)}function Bt(e,i){let t=new Date(e),a=(t.getDay()-i+7)%7;return t.setDate(t.getDate()-a),t.setHours(0,0,0,0),t}function Je(e,i="default"){return e.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})}function vi(e,i="default"){return e.toLocaleDateString(i,{weekday:"short",month:"short",day:"numeric"})}function rg(e,i="default"){return e.toLocaleDateString(i,{month:"long",year:"numeric"})}function ag(e,i="default"){let t=new Date(e);return t.setDate(t.getDate()+6),`${e.toLocaleDateString(i,{month:"short",day:"numeric"})} \u2013 ${t.toLocaleDateString(i,{month:"short",day:"numeric",year:"numeric"})}`}function ta(e,i,t,r){let a=new Date(e).setHours(t,0,0,0),o=new Date(e).setHours(r,0,0,0),n=(r-t)*60,u=Math.max(e.getTime(),a),p=(Math.min(i.getTime(),o)-u)/6e4,d=(u-a)/6e4/n*100,x=p/n*100;return{top:d,height:x}}function og(...e){let{props:i,rawProps:t}=g(e,{defaultView:"month",firstDayOfWeek:0,locale:"default",hourSlotDuration:30,minTime:6,maxTime:22,eventCreationColorOptions:[]}),{events:r=[],defaultView:a,firstDayOfWeek:o,locale:n,hourSlotDuration:u,minTime:c,maxTime:p,eventCreationColorOptions:d,className:x,...f}=i,{onCreateEventRequest:l,onViewEventRequest:v,onUpdateEventRequest:k,onRemoveEventRequest:$,eventCreationEmailLookup:S,eventCreationLocationsCallback:N,eventCreationCalendarsCallback:M,onSlotClick:V,onDateRangeChange:w}=t,y=me(m(a)??"month"),h=me(new Date),C=me(null),I=me(null),B=me({title:"",start:null,end:null,allDay:!1,description:"",location:"",attendees:[],color:null}),Q=Ce(r).compute(b=>Array.isArray(b)?b:[]),se=h.get(),re=Bt(se,m(o)??0),E=m(c)??6,G=m(p)??22,ee=m(u)??30,ae=()=>{let b=new Date(h.get());y.get()==="month"?b.setMonth(b.getMonth()-1):y.get()==="week"?b.setDate(b.getDate()-7):b.setDate(b.getDate()-1),h.set(b),w?.({start:b,end:b,view:y.get()})},X=()=>{let b=new Date(h.get());y.get()==="month"?b.setMonth(b.getMonth()+1):y.get()==="week"?b.setDate(b.getDate()+7):b.setDate(b.getDate()+1),h.set(b),w?.({start:b,end:b,view:y.get()})},T=()=>{let b=new Date;h.set(b),w?.({start:b,end:b,view:y.get()})},j=(b,O,ce=!1)=>{let Z=b?new Date(b):new Date(h.get()),ge=O?new Date(O):new Date(Z.getTime()+3600*1e3);ce&&(Z.setHours(0,0,0,0),ge.setHours(23,59,59,999)),B.set({title:"",start:Z,end:ge,allDay:ce,description:"",location:"",attendees:[],color:null}),C.set("create")},D=b=>{I.set(ra(b)),C.set("view"),v?.(b)},Y=()=>{let b=I.get();b&&(B.set({title:b.title,start:new Date(b.start),end:new Date(b.end),allDay:b.allDay,description:b.description??"",location:b.location??"",attendees:[...b.attendees||[]],color:b.color??null}),C.set("edit"))},P=()=>{C.set(null),I.set(null)},R=(b,O,ce)=>{if(V){V({date:b,hour:O,allDay:ce});return}let Z=new Date(b);if(ce){Z.setHours(0,0,0,0);let ge=new Date(Z);ge.setHours(23,59,59,999),j(Z,ge,!0)}else{Z.setHours(O,0,0,0);let ge=new Date(Z.getTime()+ee*60*1e3);j(Z,ge,!1)}},H=()=>{let b=B.get();!b.start||!b.end||l?.({title:b.title,start:b.start,end:b.end,allDay:b.allDay,description:b.description,location:b.location,attendees:b.attendees,color:b.color},()=>{P()})},J=()=>{let b=I.get(),O=B.get();!b||!O.start||!O.end||k?.(b,{title:O.title,start:O.start,end:O.end,allDay:O.allDay,description:O.description,location:O.location,attendees:O.attendees,color:O.color},()=>P())},pe=()=>{let b=I.get();b&&$?.(b,()=>P())},ke=Ce(y,h).compute(([b,O])=>b==="month"?rg(O,m(n)):b==="week"?ag(Bt(O,m(o)??0),m(n)):vi(O,m(n))),Pe=W({className:"g-ui-event-calendar-header"},W({className:"g-ui-event-calendar-nav-group"},Ye({size:"sm",variant:"subtle",onClick:ae,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:yi})),Ye({size:"sm",variant:"subtle",onClick:X,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:wi})),_e({type:"button",variant:"subtle",size:"sm",className:"g-ui-event-calendar-today",onClick:T},ye({size:"sm",className:"g-ui-event-calendar-today-icon",innerHTML:tr}),"Today")),W({className:"g-ui-event-calendar-title"},ke),W({className:"g-ui-event-calendar-actions"},tg.map(b=>W({className:s("g-ui-event-calendar-view-option",Ce(y).compute(O=>O===b.value?"g-ui-event-calendar-view-option-active":"")),onClick:()=>{y.set(b.value),w?.({start:h.get(),end:h.get(),view:b.value})}},b.label)),_e({type:"button",variant:"filled",size:"sm",className:"g-ui-event-calendar-create-btn",onClick:()=>j(h.get(),null,!1)},ye({size:"sm",innerHTML:Jt}),"Create"))),Be=Ce(h,Q,o).compute(([b,O,ce])=>{let Z=b.getFullYear(),ge=b.getMonth(),ue=(new Date(Z,ge,1).getDay()-(ce??0)+7)%7,Te=new Date(Z,ge+1,0).getDate(),Le=new Date(Z,ge,0).getDate(),A=[],L=1,q=1,_=Math.ceil((ue+Te)/7)*7,oe=[];for(let ie=0;ie<_;ie+=1){let K,te,le;ie<ue?(K=Le-ue+ie+1,le=new Date(Z,ge-1,K),te=!1):L<=Te?(K=L,le=new Date(Z,ge,K),te=!0,L+=1):(K=q,le=new Date(Z,ge+1,K),te=!1,q+=1);let xe=ia(O,le),Fe=le.getDate()===new Date().getDate()&&le.getMonth()===new Date().getMonth()&&le.getFullYear()===new Date().getFullYear();oe.push(W({key:le.getTime(),className:s("g-ui-event-calendar-month-cell",!te&&"g-ui-event-calendar-month-cell-outside",Fe&&"g-ui-event-calendar-month-cell-today")},W({className:"g-ui-event-calendar-month-cell-header",onClick:()=>R(le,0,!0)},Ze({className:"g-ui-event-calendar-month-cell-day"},le.getDate())),W({className:"g-ui-event-calendar-month-cell-events"},xe.slice(0,3).map(Se=>W({key:Se.id,className:"g-ui-event-calendar-month-event",style:Se.color?{borderLeftColor:Se.color,backgroundColor:`${Se.color}20`}:{},onClick:qi=>{qi.stopPropagation(),D(Se)}},Se.title||"(No title)")),fe(xe.length>3,()=>W({className:"g-ui-event-calendar-month-more",onClick:Se=>{Se.stopPropagation(),D(xe[3])}},`+${xe.length-3} more`)))))}return oe}),Ve=W({className:"g-ui-event-calendar-month"},W({className:"g-ui-event-calendar-weekdays"},ig.map(b=>W({key:b,className:"g-ui-event-calendar-weekday"},b))),W({className:"g-ui-event-calendar-month-grid"},Be)),Me=[];for(let b=E;b<G;b+=1)for(let O=0;O<60;O+=ee)Me.push(b+O/60);let ei=Ce(h,o).compute(([b,O])=>{let ce=Bt(b,O??0),Z=[];for(let ge=0;ge<7;ge+=1){let he=new Date(ce);he.setDate(he.getDate()+ge),Z.push(he)}return Z}),Hi=W({className:"g-ui-event-calendar-week"},Ce(ei).compute(b=>W({className:"g-ui-event-calendar-week-days"},W({className:"g-ui-event-calendar-week-time-col"},""),(b||[]).map(O=>W({key:O.getTime(),className:"g-ui-event-calendar-week-day-col"},W({className:"g-ui-event-calendar-week-day-header"},vi(O,m(n))))))),W({className:"g-ui-event-calendar-week-body"},W({className:"g-ui-event-calendar-week-time-col"},Me.map(b=>{let O=Math.floor(b),ce=(b-O)*60,Z=`${O<=12?O:O-12}:${ce===0?"00":ce} ${O<12?"AM":"PM"}`;return W({key:b,className:"g-ui-event-calendar-week-slot-label"},Z)})),Ce(ei,Q).compute(([b,O])=>{if(!b||!b.length)return null;let ce=b[0],Z=new Date(b[6]);Z.setHours(23,59,59,999);let ge=aa(O,ce,Z);return W({className:"g-ui-event-calendar-week-grid-cols"},b.map(he=>W({key:he.getTime(),className:"g-ui-event-calendar-week-day-col g-ui-event-calendar-week-day-col-body"},Me.map(ue=>W({key:ue,className:"g-ui-event-calendar-week-slot",onClick:()=>R(he,ue,!1)})),ge.filter(ue=>!ue.allDay&&ue.start.getDate()===he.getDate()&&ue.start.getMonth()===he.getMonth()&&ue.start.getFullYear()===he.getFullYear()).map(ue=>{let{top:Te,height:Le}=ta(ue.start,ue.end,E,G);return W({key:ue.id,className:"g-ui-event-calendar-week-event",style:{top:`${Te}%`,height:`${Le}%`,borderLeftColor:ue.color||"var(--g-ui-primary)"},onClick:A=>{A.stopPropagation(),D(ue)}},W({className:"g-ui-event-calendar-week-event-title"},ue.title||"(No title)"),fe(!ue.allDay,()=>Ze({className:"g-ui-event-calendar-week-event-time"},`${Je(ue.start,m(n))} \u2013 ${Je(ue.end,m(n))}`)))}))))}))),Oi=W({className:"g-ui-event-calendar-day"},W({className:"g-ui-event-calendar-day-body"},W({className:"g-ui-event-calendar-day-time-col"},Me.map(b=>{let O=Math.floor(b),ce=(b-O)*60,Z=`${O<=12?O:O-12}:${ce===0?"00":ce} ${O<12?"AM":"PM"}`;return W({key:b,className:"g-ui-event-calendar-day-slot-label"},Z)})),W({className:"g-ui-event-calendar-day-slots"},Me.map(b=>W({key:b,className:"g-ui-event-calendar-day-slot",onClick:()=>R(h.get(),b,!1)})),Ce(Q,h).compute(([b,O])=>O?ia(b,O).filter(Z=>!Z.allDay).map(Z=>{let{top:ge,height:he}=ta(Z.start,Z.end,E,G);return W({key:Z.id,className:"g-ui-event-calendar-day-event",style:{top:`${ge}%`,height:`${he}%`,borderLeftColor:Z.color||"var(--g-ui-primary)"},onClick:ue=>{ue.stopPropagation(),D(Z)}},W({className:"g-ui-event-calendar-day-event-title"},Z.title||"(No title)"),Ze({className:"g-ui-event-calendar-day-event-time"},`${Je(Z.start,m(n))} \u2013 ${Je(Z.end,m(n))}`))}):[])))),bi=b=>{let O=B.get(),ce=new Date,Z=O.start||ce,ge=O.end||new Date(ce.getTime()+3600*1e3),he=me(O.title),ue=me(Z.toISOString().slice(0,10)),Te=me(!O.allDay&&Z?Z.toTimeString().slice(0,5):"09:00"),Le=me(ge.toISOString().slice(0,10)),A=me(!O.allDay&&ge?ge.toTimeString().slice(0,5):"10:00"),L=me(O.allDay),q=me(O.description),_=me(O.location),oe=me(O.attendees||[]),ie=me(""),K=me([]),te=me([]),le=me(""),xe=Array.isArray(d)?d:[],Fe=me(O.color),Se=()=>{let F=new Date(ue.get()+"T"+(L.get()?"00:00:00":Te.get()+":00")),we=new Date(Le.get()+"T"+(L.get()?"23:59:59":A.get()+":00"));B.set({title:he.get(),start:F,end:we,allDay:L.get(),description:q.get(),location:_.get(),attendees:oe.get(),color:Fe.get()})},qi=F=>{if(ie.set(F),!S||!F.trim()){K.set([]);return}Promise.resolve(S(F.trim())).then(we=>K.set(Array.isArray(we)?we:[])).catch(()=>K.set([]))},oa=F=>{let we=oe.get();we.some(jt=>(jt.email||jt.id)===(F.email||F.id))||(oe.set([...we,{id:F.id,email:F.email??F.label,label:F.label}]),ie.set(""),K.set([]))},na=F=>{let we=[...oe.get()];we.splice(F,1),oe.set(we)},Ft=()=>{N&&Promise.resolve(N(le.get())).then(F=>te.set(Array.isArray(F)?F:[])).catch(()=>te.set([]))};return W({className:"g-ui-event-calendar-form"},W({className:"g-ui-event-calendar-form-row"},be({label:"Title",placeholder:"Event title",value:he,onInput:F=>he.set(F?.target?.value??"")})),W({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},rt({label:"All day",checked:L,onChange:F=>L.set(F)})),W({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},W({className:"g-ui-event-calendar-form-field"},hi({className:"g-ui-event-calendar-form-label"},"Start"),Ei({type:"date",className:"g-ui-input g-ui-input-size-md",value:ue,onInput:F=>ue.set(F?.target?.value??"")}),fe(!L,()=>Ei({type:"time",className:"g-ui-input g-ui-input-size-md",value:Te,onInput:F=>Te.set(F?.target?.value??"")}))),W({className:"g-ui-event-calendar-form-field"},hi({className:"g-ui-event-calendar-form-label"},"End"),Ei({type:"date",className:"g-ui-input g-ui-input-size-md",value:Le,onInput:F=>Le.set(F?.target?.value??"")}),fe(!L,()=>Ei({type:"time",className:"g-ui-input g-ui-input-size-md",value:A,onInput:F=>A.set(F?.target?.value??"")})))),fe(N,()=>W({className:"g-ui-event-calendar-form-row"},hi({className:"g-ui-event-calendar-form-label"},"Location"),be({placeholder:"Search or type location",value:le,onInput:F=>{le.set(F?.target?.value??""),Ft()},onFocus:Ft}),fe(Ce(te).compute(F=>F&&F.length>0),()=>W({className:"g-ui-event-calendar-form-suggestions"},te.get().map(F=>W({key:F.id??F.label,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>{_.set(F.label??F.id),le.set(""),te.set([])}},F.label??F.id)))),fe(Ce(_).compute(F=>!!F),()=>Ze({className:"g-ui-event-calendar-form-chip"},_)))),fe(S,()=>W({className:"g-ui-event-calendar-form-row"},hi({className:"g-ui-event-calendar-form-label"},"Add guests"),be({placeholder:"Type email to search",value:ie,onInput:F=>qi(F?.target?.value??"")}),W({className:"g-ui-event-calendar-form-chips"},oe.get().map((F,we)=>Ze({key:(F.email||F.id)+we,className:"g-ui-event-calendar-form-chip g-ui-event-calendar-form-chip-removable",onClick:()=>na(we)},F.label||F.email||F.id," \xD7"))),fe(Ce(K).compute(F=>F&&F.length>0),()=>W({className:"g-ui-event-calendar-form-suggestions"},K.get().map(F=>W({key:F.id??F.email,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>oa(F)},F.label??F.email??F.id)))))),W({className:"g-ui-event-calendar-form-row"},Ki({label:"Description",placeholder:"Add description",value:q,onInput:F=>q.set(F?.target?.value??"")})),fe(xe.length>0,()=>W({className:"g-ui-event-calendar-form-row"},hi({className:"g-ui-event-calendar-form-label"},"Color"),W({className:"g-ui-event-calendar-form-colors"},xe.map(F=>W({key:F.value??F.id??F,className:s("g-ui-event-calendar-form-color-swatch",Ce(Fe).compute(we=>we===(F.value??F.id??F)?"g-ui-event-calendar-form-color-swatch-active":"")),style:{backgroundColor:F.color??F.value??F},onClick:()=>Fe.set(F.value??F.id??F)}))))),W({className:"g-ui-event-calendar-form-actions"},_e({variant:"subtle",onClick:P},"Cancel"),_e({variant:"filled",onClick:()=>{Se(),b?J():H()}},b?"Save":"Create")))},Wi=()=>{let b=I.get();return b?W({className:"g-ui-event-calendar-view-modal"},W({className:"g-ui-event-calendar-view-modal-title"},b.title||"(No title)"),W({className:"g-ui-event-calendar-view-modal-meta"},b.allDay?Ze({className:"g-ui-event-calendar-view-modal-date"},vi(b.start,m(n))+(b.start.getTime()!==b.end.getTime()?` \u2013 ${vi(b.end,m(n))}`:"")):Ze({className:"g-ui-event-calendar-view-modal-date"},`${vi(b.start,m(n))} \xB7 ${Je(b.start,m(n))} \u2013 ${Je(b.end,m(n))}`)),fe(b.location,()=>W({className:"g-ui-event-calendar-view-modal-field"},"Location: ",b.location)),fe(b.description,()=>W({className:"g-ui-event-calendar-view-modal-field"},b.description)),fe(b.attendees?.length,()=>W({className:"g-ui-event-calendar-view-modal-field"},"Guests: ",b.attendees.map(O=>O.label||O.email||O.id).join(", "))),W({className:"g-ui-event-calendar-view-modal-actions"},_e({variant:"subtle",size:"sm",onClick:Y},ye({size:"sm",innerHTML:er})," Edit"),_e({variant:"subtle",size:"sm",onClick:pe,className:"g-ui-event-calendar-view-modal-delete"},ye({size:"sm",innerHTML:ir})," Delete"),_e({variant:"filled",size:"sm",onClick:P},"Close"))):null};return W({...f,className:s("g-ui-event-calendar",x)},Pe,fe(y,b=>b==="month",()=>Ve),fe(y,b=>b==="week",()=>Hi),fe(y,b=>b==="day",()=>Oi),fe(C,b=>b==="create",()=>ai({opened:!0,title:"New event",size:"lg",onClose:P},bi(!1))),fe(C,b=>b==="view",()=>ai({opened:!0,title:"Event",size:"md",onClose:P},Wi())),fe(C,b=>b==="edit",()=>ai({opened:!0,title:"Edit event",size:"lg",onClose:P},bi(!0))))}import{state as ng}from"@granularjs/core";function sg(e=!1){let i=ng(!!e);return[i,{open:()=>i.set(!0),close:()=>i.set(!1),toggle:()=>i.set(!i.get())}]}Rt();export{Bo as Accordion,Ye as ActionIcon,ls as Affix,Jo as Alert,yn as Anchor,hs as AppBar,It as Autocomplete,an as Avatar,Zu as AvatarGroup,Ya as Badge,Xu as BadgeGroup,ln as Blockquote,ea as BottomBar,Xn as Breadcrumbs,$u as Burger,Zi as Button,gi as Calendar,Wa as Card,Qn as Center,rt as Checkbox,Gu as CheckboxGroup,In as Chip,un as Code,Hu as Col,rs as Collapse,Fa as Container,fu as CopyButton,Ai as DateInput,Us as DatePicker,Zo as Divider,qo as Drawer,og as EventCalendar,ms as Fieldset,Pu as Flex,Eu as Grid,At as GridTable,Ha as Group,us as HoverCard,ye as Icon,zn as Image,Iu as Indicator,nn as Kbd,br as List,oi as Loading,Fu as LoadingOverlay,Ho as Menu,ai as Modal,Os as MultiSelect,Vu as NavLink,ct as Notification,Qs as Notifications,Qi as NumberField,eo as NumberInput,En as Pagination,Xo as Paper,gu as PasswordInput,qu as PinInput,Nt as Popover,ou as Popper,Nn as Progress,vu as ProgressRing,_n as Radio,On as RadioGroup,Su as RangePicker,iu as RangeSlider,Fs as Rating,Vt as ScrollArea,cu as SearchInput,Bn as SegmentedControl,xo as Select,ku as SelectSearch,bs as Sidebar,pn as SimpleGrid,Tn as Skeleton,Dn as Slider,es as Space,Ea as Stack,As as Stepper,vo as Switch,lo as SwitchGroup,To as Table,zo as Tabs,Es as Tag,Ui as Text,be as TextInput,Ki as Textarea,Is as Timeline,Aa as Title,Pt as Toast,Zs as ToastStack,Fo as Tooltip,U as classFlag,ve as classMap,z as classVar,s as cx,za as getThemeMode,ka as setThemeMode,ya as setThemeVars,g as splitPropsChildren,sg as useDisclosure};
|
|
4123
4159
|
//# sourceMappingURL=granular-ui.min.js.map
|