notifkit 0.1.10 → 0.1.11
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/dashboard/dist/assets/{index-7mvXb4bS.js → index-Bsrmo9LE.js} +1 -1
- package/dashboard/dist/assets/index-s-SXGIwv.css +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/bootstrap-GRXzgPvW.mjs +89 -0
- package/dist/bulk-BvRfz6Of.mjs +77 -0
- package/dist/index.d.mts +1100 -8883
- package/dist/index.mjs +2 -38
- package/dist/{main-C9s-2ArH.mjs → main-BENOY7HG.mjs} +49 -75
- package/dist/{main-BiFiOX9D.mjs → main-BpnuFX62.mjs} +119 -112
- package/dist/{main-Dz2sUh3c.mjs → main-BqVH2BHj.mjs} +57 -54
- package/dist/{main-BgmT1MPe.mjs → main-C_5VFIwp.mjs} +135 -79
- package/dist/main-D6od9N8h.mjs +312 -0
- package/dist/main-D84OX0ux.mjs +811 -0
- package/dist/{main-39DtKrX4.mjs → main-HH-WwsMM.mjs} +395 -184
- package/dist/{main-B3iQrl3t.mjs → main-HY_TDs61.mjs} +149 -134
- package/dist/{src-QiTu5e_a.mjs → src-CI7FGf3h.mjs} +1220 -651
- package/drizzle/0006_message_logs_redundant_indexes.sql +7 -0
- package/drizzle/0007_workflow_status_canceled.sql +3 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +17 -17
- package/src/client.ts +15 -5
- package/src/config/index.ts +26 -3
- package/src/contracts/events/notification-ai-pending.ts +12 -0
- package/src/contracts/events/notification-delivered.ts +7 -0
- package/src/contracts/events/notification-dispatched.ts +21 -2
- package/src/contracts/events/notification-enriched.ts +16 -0
- package/src/contracts/events/notification-failed.ts +2 -0
- package/src/contracts/events/notification-requested.ts +2 -0
- package/src/contracts/registry.ts +2 -2
- package/src/contracts/sdk.ts +77 -29
- package/src/db/bulk.ts +132 -0
- package/src/db/index.ts +2 -2
- package/src/db/schema.ts +3 -50
- package/src/idempotency/index.ts +60 -6
- package/src/logger/index.ts +0 -12
- package/src/queue/index.ts +255 -76
- package/src/rate-limiter/index.ts +217 -16
- package/src/redis/index.ts +265 -0
- package/src/repositories/index.ts +171 -82
- package/src/server.ts +61 -41
- package/src/services/ai/main.ts +83 -70
- package/src/services/api/admin-static.ts +41 -12
- package/src/services/api/handlers.ts +357 -159
- package/src/services/api/http.ts +34 -7
- package/src/services/api/main.ts +104 -67
- package/src/services/api/router.ts +18 -5
- package/src/services/delivery/main.ts +495 -230
- package/src/services/delivery/throttle.ts +42 -59
- package/src/services/engine/main.ts +206 -152
- package/src/services/enricher/main.ts +155 -107
- package/src/services/events/main.ts +100 -55
- package/src/services/scheduler/main.ts +151 -79
- package/src/services/scheduler/send-gate.ts +117 -0
- package/src/services/workflow/main.ts +220 -100
- package/src/shared/batch-processor.ts +65 -34
- package/src/shared/dataloader.ts +58 -22
- package/src/shared/events.ts +3 -0
- package/src/shared/index.ts +0 -1
- package/src/shared/utils.ts +2 -47
- package/src/templates/index.ts +0 -67
- package/src/transport/index.ts +6 -0
- package/src/workers/bootstrap.ts +124 -0
- package/src/workers/index.ts +99 -24
- package/src/workflows/sdk.ts +2 -0
- package/dashboard/dist/assets/index-o7L-f3-c.css +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/main-39DtKrX4.mjs.map +0 -1
- package/dist/main-B3iQrl3t.mjs.map +0 -1
- package/dist/main-BM8DH3v3.mjs +0 -632
- package/dist/main-BM8DH3v3.mjs.map +0 -1
- package/dist/main-BgmT1MPe.mjs.map +0 -1
- package/dist/main-BiFiOX9D.mjs.map +0 -1
- package/dist/main-C9s-2ArH.mjs.map +0 -1
- package/dist/main-Cqo3rSb5.mjs +0 -224
- package/dist/main-Cqo3rSb5.mjs.map +0 -1
- package/dist/main-Dz2sUh3c.mjs.map +0 -1
- package/dist/src-QiTu5e_a.mjs.map +0 -1
|
@@ -307,4 +307,4 @@ Please change the parent <Route path="${z}"> to <Route path="${z==="/"?"*":`${z}
|
|
|
307
307
|
*
|
|
308
308
|
* This source code is licensed under the ISC license.
|
|
309
309
|
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const Mb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],zp=Ce("users",Mb);function _p(l){var i,u,c="";if(typeof l=="string"||typeof l=="number")c+=l;else if(typeof l=="object")if(Array.isArray(l)){var d=l.length;for(i=0;i<d;i++)l[i]&&(u=_p(l[i]))&&(c&&(c+=" "),c+=u)}else for(u in l)l[u]&&(c&&(c+=" "),c+=u);return c}function Rp(){for(var l,i,u=0,c="",d=arguments.length;u<d;u++)(l=arguments[u])&&(i=_p(l))&&(c&&(c+=" "),c+=i);return c}const kb=(l,i)=>{const u=new Array(l.length+i.length);for(let c=0;c<l.length;c++)u[c]=l[c];for(let c=0;c<i.length;c++)u[l.length+c]=i[c];return u},Db=(l,i)=>({classGroupId:l,validator:i}),Mp=(l=new Map,i=null,u)=>({nextPart:l,validators:i,classGroupId:u}),Oo="-",z0=[],Ob="arbitrary..",Ub=l=>{const i=Hb(l),{conflictingClassGroups:u,conflictingClassGroupModifiers:c}=l;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return Lb(p);const y=p.split(Oo),v=y[0]===""&&y.length>1?1:0;return kp(y,v,i)},getConflictingClassGroupIds:(p,y)=>{if(y){const v=c[p],h=u[p];return v?h?kb(h,v):v:h||z0}return u[p]||z0}}},kp=(l,i,u)=>{if(l.length-i===0)return u.classGroupId;const d=l[i],m=u.nextPart.get(d);if(m){const h=kp(l,i+1,m);if(h)return h}const p=u.validators;if(p===null)return;const y=i===0?l.join(Oo):l.slice(i).join(Oo),v=p.length;for(let h=0;h<v;h++){const S=p[h];if(S.validator(y))return S.classGroupId}},Lb=l=>l.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=l.slice(1,-1),u=i.indexOf(":"),c=i.slice(0,u);return c?Ob+c:void 0})(),Hb=l=>{const{theme:i,classGroups:u}=l;return Bb(u,i)},Bb=(l,i)=>{const u=Mp();for(const c in l){const d=l[c];Cd(d,u,c,i)}return u},Cd=(l,i,u,c)=>{const d=l.length;for(let m=0;m<d;m++){const p=l[m];qb(p,i,u,c)}},qb=(l,i,u,c)=>{if(typeof l=="string"){Yb(l,i,u);return}if(typeof l=="function"){Gb(l,i,u,c);return}Vb(l,i,u,c)},Yb=(l,i,u)=>{const c=l===""?i:Dp(i,l);c.classGroupId=u},Gb=(l,i,u,c)=>{if(Xb(l)){Cd(l(c),i,u,c);return}i.validators===null&&(i.validators=[]),i.validators.push(Db(u,l))},Vb=(l,i,u,c)=>{const d=Object.entries(l),m=d.length;for(let p=0;p<m;p++){const[y,v]=d[p];Cd(v,Dp(i,y),u,c)}},Dp=(l,i)=>{let u=l;const c=i.split(Oo),d=c.length;for(let m=0;m<d;m++){const p=c[m];let y=u.nextPart.get(p);y||(y=Mp(),u.nextPart.set(p,y)),u=y}return u},Xb=l=>"isThemeGetter"in l&&l.isThemeGetter===!0,Qb=l=>{if(l<1)return{get:()=>{},set:()=>{}};let i=0,u=Object.create(null),c=Object.create(null);const d=(m,p)=>{u[m]=p,i++,i>l&&(i=0,c=u,u=Object.create(null))};return{get(m){let p=u[m];if(p!==void 0)return p;if((p=c[m])!==void 0)return d(m,p),p},set(m,p){m in u?u[m]=p:d(m,p)}}},nd="!",_0=":",Zb=[],R0=(l,i,u,c,d)=>({modifiers:l,hasImportantModifier:i,baseClassName:u,maybePostfixModifierPosition:c,isExternal:d}),Kb=l=>{const{prefix:i,experimentalParseClassName:u}=l;let c=d=>{const m=[];let p=0,y=0,v=0,h;const S=d.length;for(let C=0;C<S;C++){const _=d[C];if(p===0&&y===0){if(_===_0){m.push(d.slice(v,C)),v=C+1;continue}if(_==="/"){h=C;continue}}_==="["?p++:_==="]"?p--:_==="("?y++:_===")"&&y--}const g=m.length===0?d:d.slice(v);let w=g,E=!1;g.endsWith(nd)?(w=g.slice(0,-1),E=!0):g.startsWith(nd)&&(w=g.slice(1),E=!0);const j=h&&h>v?h-v:void 0;return R0(m,E,w,j)};if(i){const d=i+_0,m=c;c=p=>p.startsWith(d)?m(p.slice(d.length)):R0(Zb,!1,p,void 0,!0)}if(u){const d=c;c=m=>u({className:m,parseClassName:d})}return c},$b=l=>{const i=new Map;return l.orderSensitiveModifiers.forEach((u,c)=>{i.set(u,1e6+c)}),u=>{const c=[];let d=[];for(let m=0;m<u.length;m++){const p=u[m],y=p[0]==="[",v=i.has(p);y||v?(d.length>0&&(d.sort(),c.push(...d),d=[]),c.push(p)):d.push(p)}return d.length>0&&(d.sort(),c.push(...d)),c}},Jb=l=>({cache:Qb(l.cacheSize),parseClassName:Kb(l),sortModifiers:$b(l),postfixLookupClassGroupIds:Wb(l),...Ub(l)}),Wb=l=>{const i=Object.create(null),u=l.postfixLookupClassGroups;if(u)for(let c=0;c<u.length;c++)i[u[c]]=!0;return i},Ib=/\s+/,Fb=(l,i)=>{const{parseClassName:u,getClassGroupId:c,getConflictingClassGroupIds:d,sortModifiers:m,postfixLookupClassGroupIds:p}=i,y=[],v=l.trim().split(Ib);let h="";for(let S=v.length-1;S>=0;S-=1){const g=v[S],{isExternal:w,modifiers:E,hasImportantModifier:j,baseClassName:C,maybePostfixModifierPosition:_}=u(g);if(w){h=g+(h.length>0?" "+h:h);continue}let z=!!_,L;if(z){const Z=C.substring(0,_);L=c(Z);const Q=L&&p[L]?c(C):void 0;Q&&Q!==L&&(L=Q,z=!1)}else L=c(C);if(!L){if(!z){h=g+(h.length>0?" "+h:h);continue}if(L=c(C),!L){h=g+(h.length>0?" "+h:h);continue}z=!1}const K=E.length===0?"":E.length===1?E[0]:m(E).join(":"),ee=j?K+nd:K,J=ee+L;if(y.indexOf(J)>-1)continue;y.push(J);const I=d(L,z);for(let Z=0;Z<I.length;++Z){const Q=I[Z];y.push(ee+Q)}h=g+(h.length>0?" "+h:h)}return h},Pb=(...l)=>{let i=0,u,c,d="";for(;i<l.length;)(u=l[i++])&&(c=Op(u))&&(d&&(d+=" "),d+=c);return d},Op=l=>{if(typeof l=="string")return l;let i,u="";for(let c=0;c<l.length;c++)l[c]&&(i=Op(l[c]))&&(u&&(u+=" "),u+=i);return u},e1=(l,...i)=>{let u,c,d,m;const p=v=>{const h=i.reduce((S,g)=>g(S),l());return u=Jb(h),c=u.cache.get,d=u.cache.set,m=y,y(v)},y=v=>{const h=c(v);if(h)return h;const S=Fb(v,u);return d(v,S),S};return m=p,(...v)=>m(Pb(...v))},t1=[],Bt=l=>{const i=u=>u[l]||t1;return i.isThemeGetter=!0,i},Up=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,a1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,n1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,l1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,r1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,s1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jl=l=>a1.test(l),_e=l=>!!l&&!Number.isNaN(Number(l)),Dn=l=>!!l&&Number.isInteger(Number(l)),Fu=l=>l.endsWith("%")&&_e(l.slice(0,-1)),dl=l=>n1.test(l),Hp=()=>!0,o1=l=>l1.test(l)&&!r1.test(l),Td=()=>!1,c1=l=>s1.test(l),u1=l=>i1.test(l),d1=l=>!se(l)&&!ie(l),f1=l=>l.startsWith("@container")&&(l[10]==="/"&&l[11]!==void 0||l[11]==="s"&&l[16]!==void 0&&l.startsWith("-size/",10)||l[11]==="n"&&l[18]!==void 0&&l.startsWith("-normal/",10)),m1=l=>Pl(l,Yp,Td),se=l=>Up.test(l),jr=l=>Pl(l,Gp,o1),M0=l=>Pl(l,S1,_e),h1=l=>Pl(l,Xp,Hp),p1=l=>Pl(l,Vp,Td),k0=l=>Pl(l,Bp,Td),g1=l=>Pl(l,qp,u1),To=l=>Pl(l,Qp,c1),ie=l=>Lp.test(l),fi=l=>Tr(l,Gp),v1=l=>Tr(l,Vp),D0=l=>Tr(l,Bp),y1=l=>Tr(l,Yp),x1=l=>Tr(l,qp),zo=l=>Tr(l,Qp,!0),b1=l=>Tr(l,Xp,!0),Pl=(l,i,u)=>{const c=Up.exec(l);return c?c[1]?i(c[1]):u(c[2]):!1},Tr=(l,i,u=!1)=>{const c=Lp.exec(l);return c?c[1]?i(c[1]):u:!1},Bp=l=>l==="position"||l==="percentage",qp=l=>l==="image"||l==="url",Yp=l=>l==="length"||l==="size"||l==="bg-size",Gp=l=>l==="length",S1=l=>l==="number",Vp=l=>l==="family-name",Xp=l=>l==="number"||l==="weight",Qp=l=>l==="shadow",w1=()=>{const l=Bt("color"),i=Bt("font"),u=Bt("text"),c=Bt("font-weight"),d=Bt("tracking"),m=Bt("leading"),p=Bt("breakpoint"),y=Bt("container"),v=Bt("spacing"),h=Bt("radius"),S=Bt("shadow"),g=Bt("inset-shadow"),w=Bt("text-shadow"),E=Bt("drop-shadow"),j=Bt("blur"),C=Bt("perspective"),_=Bt("aspect"),z=Bt("ease"),L=Bt("animate"),K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],J=()=>[...ee(),ie,se],I=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto","contain","none"],Q=()=>[ie,se,v],pe=()=>[Jl,"full","auto",...Q()],xe=()=>[Dn,"none","subgrid",ie,se],Ee=()=>["auto",{span:["full",Dn,ie,se]},Dn,ie,se],Re=()=>[Dn,"auto",ie,se],Xe=()=>["auto","min","max","fr",ie,se],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...Q()],G=()=>[Jl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Q()],re=()=>[Jl,"screen","full","dvw","lvw","svw","min","max","fit",...Q()],Se=()=>[Jl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Q()],W=()=>[l,ie,se],A=()=>[...ee(),D0,k0,{position:[ie,se]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",y1,m1,{size:[ie,se]}],P=()=>[Fu,fi,jr],te=()=>["","none","full",h,ie,se],le=()=>["",_e,fi,jr],je=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[_e,Fu,D0,k0],ea=()=>["","none",j,ie,se],Wt=()=>["none",_e,ie,se],dt=()=>["none",_e,ie,se],xa=()=>[_e,ie,se],Mt=()=>[Jl,"full",...Q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[dl],breakpoint:[dl],color:[Hp],container:[dl],"drop-shadow":[dl],ease:["in","out","in-out"],font:[d1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[dl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[dl],shadow:[dl],spacing:["px",_e],text:[dl],"text-shadow":[dl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jl,se,ie,_]}],container:["container"],"container-type":[{"@container":["","normal","size",ie,se]}],"container-named":[f1],columns:[{columns:[_e,se,ie,y]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:J()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:pe()}],"inset-x":[{"inset-x":pe()}],"inset-y":[{"inset-y":pe()}],start:[{"inset-s":pe(),start:pe()}],end:[{"inset-e":pe(),end:pe()}],"inset-bs":[{"inset-bs":pe()}],"inset-be":[{"inset-be":pe()}],top:[{top:pe()}],right:[{right:pe()}],bottom:[{bottom:pe()}],left:[{left:pe()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",ie,se]}],basis:[{basis:[Jl,"full","auto",y,...Q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Jl,"auto","initial","none",se]}],grow:[{grow:["",_e,ie,se]}],shrink:[{shrink:["",_e,ie,se]}],order:[{order:[Dn,"first","last","none",ie,se]}],"grid-cols":[{"grid-cols":xe()}],"col-start-end":[{col:Ee()}],"col-start":[{"col-start":Re()}],"col-end":[{"col-end":Re()}],"grid-rows":[{"grid-rows":xe()}],"row-start-end":[{row:Ee()}],"row-start":[{"row-start":Re()}],"row-end":[{"row-end":Re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Xe()}],"auto-rows":[{"auto-rows":Xe()}],gap:[{gap:Q()}],"gap-x":[{"gap-x":Q()}],"gap-y":[{"gap-y":Q()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:Q()}],px:[{px:Q()}],py:[{py:Q()}],ps:[{ps:Q()}],pe:[{pe:Q()}],pbs:[{pbs:Q()}],pbe:[{pbe:Q()}],pt:[{pt:Q()}],pr:[{pr:Q()}],pb:[{pb:Q()}],pl:[{pl:Q()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":Q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Q()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...Se()]}],"min-block-size":[{"min-block":["auto",...Se()]}],"max-block-size":[{"max-block":["none",...Se()]}],w:[{w:[y,"screen",...G()]}],"min-w":[{"min-w":[y,"screen","none",...G()]}],"max-w":[{"max-w":[y,"screen","none","prose",{screen:[p]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",u,fi,jr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,b1,h1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fu,se]}],"font-family":[{font:[v1,p1,i]}],"font-features":[{"font-features":[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,ie,se]}],"line-clamp":[{"line-clamp":[_e,"none",ie,M0]}],leading:[{leading:[m,...Q()]}],"list-image":[{"list-image":["none",ie,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ie,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ie,jr]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[_e,"auto",ie,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Q()}],"tab-size":[{tab:[Dn,ie,se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,ie,se],radial:["",ie,se],conic:[Dn,ie,se]},x1,g1]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...je(),"hidden","none"]}],"divide-style":[{divide:[...je(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...je(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ie,se]}],"outline-w":[{outline:["",_e,fi,jr]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",S,zo,To]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",g,zo,To]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[_e,jr]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",w,zo,To]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[_e,ie,se]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[ie,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":ee()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ie,se]}],filter:[{filter:["","none",ie,se]}],blur:[{blur:ea()}],brightness:[{brightness:[_e,ie,se]}],contrast:[{contrast:[_e,ie,se]}],"drop-shadow":[{"drop-shadow":["","none",E,zo,To]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",_e,ie,se]}],"hue-rotate":[{"hue-rotate":[_e,ie,se]}],invert:[{invert:["",_e,ie,se]}],saturate:[{saturate:[_e,ie,se]}],sepia:[{sepia:["",_e,ie,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ie,se]}],"backdrop-blur":[{"backdrop-blur":ea()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ie,se]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ie,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ie,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ie,se]}],"backdrop-invert":[{"backdrop-invert":["",_e,ie,se]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ie,se]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ie,se]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ie,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Q()}],"border-spacing-x":[{"border-spacing-x":Q()}],"border-spacing-y":[{"border-spacing-y":Q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ie,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ie,se]}],ease:[{ease:["linear","initial",z,ie,se]}],delay:[{delay:[_e,ie,se]}],animate:[{animate:["none",L,ie,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ie,se]}],"perspective-origin":[{"perspective-origin":J()}],rotate:[{rotate:Wt()}],"rotate-x":[{"rotate-x":Wt()}],"rotate-y":[{"rotate-y":Wt()}],"rotate-z":[{"rotate-z":Wt()}],scale:[{scale:dt()}],"scale-x":[{"scale-x":dt()}],"scale-y":[{"scale-y":dt()}],"scale-z":[{"scale-z":dt()}],"scale-3d":["scale-3d"],skew:[{skew:xa()}],"skew-x":[{"skew-x":xa()}],"skew-y":[{"skew-y":xa()}],transform:[{transform:[ie,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:J()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Mt()}],"translate-x":[{"translate-x":Mt()}],"translate-y":[{"translate-y":Mt()}],"translate-z":[{"translate-z":Mt()}],"translate-none":["translate-none"],zoom:[{zoom:[Dn,ie,se]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":Q()}],"scroll-mx":[{"scroll-mx":Q()}],"scroll-my":[{"scroll-my":Q()}],"scroll-ms":[{"scroll-ms":Q()}],"scroll-me":[{"scroll-me":Q()}],"scroll-mbs":[{"scroll-mbs":Q()}],"scroll-mbe":[{"scroll-mbe":Q()}],"scroll-mt":[{"scroll-mt":Q()}],"scroll-mr":[{"scroll-mr":Q()}],"scroll-mb":[{"scroll-mb":Q()}],"scroll-ml":[{"scroll-ml":Q()}],"scroll-p":[{"scroll-p":Q()}],"scroll-px":[{"scroll-px":Q()}],"scroll-py":[{"scroll-py":Q()}],"scroll-ps":[{"scroll-ps":Q()}],"scroll-pe":[{"scroll-pe":Q()}],"scroll-pbs":[{"scroll-pbs":Q()}],"scroll-pbe":[{"scroll-pbe":Q()}],"scroll-pt":[{"scroll-pt":Q()}],"scroll-pr":[{"scroll-pr":Q()}],"scroll-pb":[{"scroll-pb":Q()}],"scroll-pl":[{"scroll-pl":Q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie,se]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[_e,fi,jr,M0]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},j1=e1(w1);function O0(...l){return j1(Rp(l))}const N1=[{name:"Live Feed",href:"/",icon:Nd},{name:"History Logs",href:"/logs",icon:Cp},{name:"System Health",href:"/system",icon:Ep},{name:"Analytics & Queue",href:"/analytics",icon:Sp},{name:"Dead Letter (DLQ)",href:"/dlq",icon:Go},{name:"Scheduled",href:"/scheduled",icon:fl},{name:"Workflows",href:"/workflows",icon:Np},{name:"Templates",href:"/templates",icon:jp},{name:"Users",href:"/users",icon:zp},{name:"Projects & Keys",href:"/projects",icon:Ed}];function E1(){const l=yn(),{user:i,logout:u,isAuthenticated:c}=ya();return l.pathname==="/login"||l.pathname==="/login/"||!c?null:o.jsxs("div",{className:"flex flex-col w-64 border-r border-border bg-card h-full shrink-0",children:[o.jsxs("div",{className:"p-6 border-b border-border flex items-center gap-3",children:[o.jsx("div",{className:"bg-primary text-primary-foreground p-2 rounded-lg",children:o.jsx(Px,{className:"w-5 h-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"font-bold text-lg tracking-tight text-foreground",children:"Notifkit"}),o.jsx("span",{className:"text-[10px] uppercase font-semibold tracking-wider text-muted-foreground",children:"Admin Console"})]})]}),o.jsx("nav",{className:"flex-1 overflow-y-auto p-4 space-y-1",children:N1.map(m=>{const p=m.href==="/"?l.pathname==="/":l.pathname.startsWith(m.href);return o.jsxs(jd,{to:m.href,className:O0("flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors group relative",p?"text-primary-foreground bg-primary shadow-xs":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:[o.jsx(m.icon,{className:O0("w-4 h-4 transition-colors",p?"text-primary-foreground":"text-muted-foreground group-hover:text-foreground")}),m.name]},m.name)})}),o.jsxs("div",{className:"p-4 border-t border-border bg-muted/40 space-y-3",children:[i&&o.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1.5",children:[o.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0 border border-border",children:o.jsx(zb,{className:"h-3.5 w-3.5 text-foreground"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-xs font-semibold text-foreground truncate",children:i.username||i.email}),o.jsx("p",{className:"text-[10px] text-muted-foreground capitalize",children:i.role})]})]}),o.jsxs("button",{onClick:()=>void u(),className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-md text-xs font-medium text-muted-foreground hover:text-destructive hover:bg-destructive/10 border border-transparent transition-colors cursor-pointer",children:[o.jsx(lb,{className:"h-3.5 w-3.5"}),o.jsx("span",{children:"Sign Out"})]})]})]})}var A1=(l,i,u,c,d,m,p,y)=>{let v=document.documentElement,h=["light","dark"];function S(E){(Array.isArray(l)?l:[l]).forEach(j=>{let C=j==="class",_=C&&m?d.map(z=>m[z]||z):d;C?(v.classList.remove(..._),v.classList.add(m&&m[E]?m[E]:E)):v.setAttribute(j,E)}),g(E)}function g(E){y&&h.includes(E)&&(v.style.colorScheme=E)}function w(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(c)S(c);else try{let E=localStorage.getItem(i)||u,j=p&&E==="system"?w():E;S(j)}catch{}},C1=b.createContext(void 0),T1={setTheme:l=>{},themes:[]},z1=()=>{var l;return(l=b.useContext(C1))!=null?l:T1};b.memo(({forcedTheme:l,storageKey:i,attribute:u,enableSystem:c,enableColorScheme:d,defaultTheme:m,value:p,themes:y,nonce:v,scriptProps:h})=>{let S=JSON.stringify([u,i,m,l,y,p,c,d]).slice(1,-1);return b.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?v:"",dangerouslySetInnerHTML:{__html:`(${A1.toString()})(${S})`}})});function _1(l){if(typeof document>"u")return;let i=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css",i.appendChild(u),u.styleSheet?u.styleSheet.cssText=l:u.appendChild(document.createTextNode(l))}const R1=l=>{switch(l){case"success":return D1;case"info":return U1;case"warning":return O1;case"error":return L1;default:return null}},M1=Array(12).fill(0),k1=({visible:l,className:i})=>ae.createElement("div",{className:["sonner-loading-wrapper",i].filter(Boolean).join(" "),"data-visible":l},ae.createElement("div",{className:"sonner-spinner"},M1.map((u,c)=>ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${c}`})))),D1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),O1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),U1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),L1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),H1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),B1=()=>{const[l,i]=ae.useState(document.hidden);return ae.useEffect(()=>{const u=()=>{i(document.hidden)};return document.addEventListener("visibilitychange",u),()=>window.removeEventListener("visibilitychange",u)},[]),l};let ld=1;class q1{constructor(){this.subscribe=i=>(this.subscribers.push(i),()=>{const u=this.subscribers.indexOf(i);this.subscribers.splice(u,1)}),this.publish=i=>{this.subscribers.forEach(u=>u(i))},this.addToast=i=>{this.publish(i),this.toasts=[...this.toasts,i]},this.create=i=>{var u;const{message:c,...d}=i,m=typeof(i==null?void 0:i.id)=="number"||((u=i.id)==null?void 0:u.length)>0?i.id:ld++,p=this.toasts.find(v=>v.id===m),y=i.dismissible===void 0?!0:i.dismissible;return this.dismissedToasts.has(m)&&this.dismissedToasts.delete(m),p?this.toasts=this.toasts.map(v=>v.id===m?(this.publish({...v,...i,id:m,title:c}),{...v,...i,id:m,dismissible:y,title:c}):v):this.addToast({title:c,...d,dismissible:y,id:m}),m},this.dismiss=i=>(i?(this.dismissedToasts.add(i),requestAnimationFrame(()=>this.subscribers.forEach(u=>u({id:i,dismiss:!0})))):this.toasts.forEach(u=>{this.subscribers.forEach(c=>c({id:u.id,dismiss:!0}))}),i),this.message=(i,u)=>this.create({...u,message:i}),this.error=(i,u)=>this.create({...u,message:i,type:"error"}),this.success=(i,u)=>this.create({...u,type:"success",message:i}),this.info=(i,u)=>this.create({...u,type:"info",message:i}),this.warning=(i,u)=>this.create({...u,type:"warning",message:i}),this.loading=(i,u)=>this.create({...u,type:"loading",message:i}),this.promise=(i,u)=>{if(!u)return;let c;u.loading!==void 0&&(c=this.create({...u,promise:i,type:"loading",message:u.loading,description:typeof u.description!="function"?u.description:void 0}));const d=Promise.resolve(i instanceof Function?i():i);let m=c!==void 0,p;const y=d.then(async h=>{if(p=["resolve",h],ae.isValidElement(h))m=!1,this.create({id:c,type:"default",message:h});else if(G1(h)&&!h.ok){m=!1;const g=typeof u.error=="function"?await u.error(`HTTP error! status: ${h.status}`):u.error,w=typeof u.description=="function"?await u.description(`HTTP error! status: ${h.status}`):u.description,j=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:c,type:"error",description:w,...j})}else if(h instanceof Error){m=!1;const g=typeof u.error=="function"?await u.error(h):u.error,w=typeof u.description=="function"?await u.description(h):u.description,j=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:c,type:"error",description:w,...j})}else if(u.success!==void 0){m=!1;const g=typeof u.success=="function"?await u.success(h):u.success,w=typeof u.description=="function"?await u.description(h):u.description,j=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:c,type:"success",description:w,...j})}}).catch(async h=>{if(p=["reject",h],u.error!==void 0){m=!1;const S=typeof u.error=="function"?await u.error(h):u.error,g=typeof u.description=="function"?await u.description(h):u.description,E=typeof S=="object"&&!ae.isValidElement(S)?S:{message:S};this.create({id:c,type:"error",description:g,...E})}}).finally(()=>{m&&(this.dismiss(c),c=void 0),u.finally==null||u.finally.call(u)}),v=()=>new Promise((h,S)=>y.then(()=>p[0]==="reject"?S(p[1]):h(p[1])).catch(S));return typeof c!="string"&&typeof c!="number"?{unwrap:v}:Object.assign(c,{unwrap:v})},this.custom=(i,u)=>{const c=(u==null?void 0:u.id)||ld++;return this.create({jsx:i(c),id:c,...u}),c},this.getActiveToasts=()=>this.toasts.filter(i=>!this.dismissedToasts.has(i.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const va=new q1,Y1=(l,i)=>{const u=(i==null?void 0:i.id)||ld++;return va.addToast({title:l,...i,id:u}),u},G1=l=>l&&typeof l=="object"&&"ok"in l&&typeof l.ok=="boolean"&&"status"in l&&typeof l.status=="number",V1=Y1,X1=()=>va.toasts,Q1=()=>va.getActiveToasts(),Ge=Object.assign(V1,{success:va.success,info:va.info,warning:va.warning,error:va.error,custom:va.custom,message:va.message,promise:va.promise,dismiss:va.dismiss,loading:va.loading},{getHistory:X1,getToasts:Q1});_1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function _o(l){return l.label!==void 0}const Z1=3,K1="24px",$1="16px",U0=4e3,J1=356,W1=14,I1=45,F1=200;function On(...l){return l.filter(Boolean).join(" ")}function P1(l){const[i,u]=l.split("-"),c=[];return i&&c.push(i),u&&c.push(u),c}const eS=l=>{var i,u,c,d,m,p,y,v,h;const{invert:S,toast:g,unstyled:w,interacting:E,setHeights:j,visibleToasts:C,heights:_,index:z,toasts:L,expanded:K,removeToast:ee,defaultRichColors:J,closeButton:I,style:Z,cancelButtonStyle:Q,actionButtonStyle:pe,className:xe="",descriptionClassName:Ee="",duration:Re,position:Xe,gap:ne,expandByDefault:ge,classNames:M,icons:G,closeButtonAriaLabel:re="Close toast"}=l,[Se,W]=ae.useState(null),[A,q]=ae.useState(null),[V,P]=ae.useState(!1),[te,le]=ae.useState(!1),[je,we]=ae.useState(!1),[ve,ea]=ae.useState(!1),[Wt,dt]=ae.useState(!1),[xa,Mt]=ae.useState(0),[La,Ha]=ae.useState(0),bn=ae.useRef(g.duration||Re||U0),vl=ae.useRef(null),ta=ae.useRef(null),Sn=z===0,tr=z+1<=C,Vt=g.type,Ba=g.dismissible!==!1,Xt=g.className||"",ws=g.descriptionClassName||"",Yn=ae.useMemo(()=>_.findIndex(ye=>ye.toastId===g.id)||0,[_,g.id]),zr=ae.useMemo(()=>{var ye;return(ye=g.closeButton)!=null?ye:I},[g.closeButton,I]),Gn=ae.useMemo(()=>g.duration||Re||U0,[g.duration,Re]),ar=ae.useRef(0),qa=ae.useRef(0),yl=ae.useRef(0),Ya=ae.useRef(null),[Ga,Yt]=Xe.split("-"),ba=ae.useMemo(()=>_.reduce((ye,at,pt)=>pt>=Yn?ye:ye+at.height,0),[_,Yn]),kt=B1(),xl=g.invert||S,nr=Vt==="loading";qa.current=ae.useMemo(()=>Yn*ne+ba,[Yn,ba]),ae.useEffect(()=>{bn.current=Gn},[Gn]),ae.useEffect(()=>{P(!0)},[]),ae.useEffect(()=>{const ye=ta.current;if(ye){const at=ye.getBoundingClientRect().height;return Ha(at),j(pt=>[{toastId:g.id,height:at,position:g.position},...pt]),()=>j(pt=>pt.filter(Dt=>Dt.toastId!==g.id))}},[j,g.id]),ae.useLayoutEffect(()=>{if(!V)return;const ye=ta.current,at=ye.style.height;ye.style.height="auto";const pt=ye.getBoundingClientRect().height;ye.style.height=at,Ha(pt),j(Dt=>Dt.find(lt=>lt.toastId===g.id)?Dt.map(lt=>lt.toastId===g.id?{...lt,height:pt}:lt):[{toastId:g.id,height:pt,position:g.position},...Dt])},[V,g.title,g.description,j,g.id,g.jsx,g.action,g.cancel]);const Va=ae.useCallback(()=>{le(!0),Mt(qa.current),j(ye=>ye.filter(at=>at.toastId!==g.id)),setTimeout(()=>{ee(g)},F1)},[g,ee,j,qa]);ae.useEffect(()=>{if(g.promise&&Vt==="loading"||g.duration===1/0||g.type==="loading")return;let ye;return K||E||kt?(()=>{if(yl.current<ar.current){const Dt=new Date().getTime()-ar.current;bn.current=bn.current-Dt}yl.current=new Date().getTime()})():(()=>{bn.current!==1/0&&(ar.current=new Date().getTime(),ye=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),Va()},bn.current))})(),()=>clearTimeout(ye)},[K,E,g,Vt,kt,Va]),ae.useEffect(()=>{g.delete&&(Va(),g.onDismiss==null||g.onDismiss.call(g,g))},[Va,g.delete]);function Vn(){var ye;if(G!=null&&G.loading){var at;return ae.createElement("div",{className:On(M==null?void 0:M.loader,g==null||(at=g.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":Vt==="loading"},G.loading)}return ae.createElement(k1,{className:On(M==null?void 0:M.loader,g==null||(ye=g.classNames)==null?void 0:ye.loader),visible:Vt==="loading"})}const Xa=g.icon||(G==null?void 0:G[Vt])||R1(Vt);var cn,wt;return ae.createElement("li",{tabIndex:0,ref:ta,className:On(xe,Xt,M==null?void 0:M.toast,g==null||(i=g.classNames)==null?void 0:i.toast,M==null?void 0:M.default,M==null?void 0:M[Vt],g==null||(u=g.classNames)==null?void 0:u[Vt]),"data-sonner-toast":"","data-rich-colors":(cn=g.richColors)!=null?cn:J,"data-styled":!(g.jsx||g.unstyled||w),"data-mounted":V,"data-promise":!!g.promise,"data-swiped":Wt,"data-removed":te,"data-visible":tr,"data-y-position":Ga,"data-x-position":Yt,"data-index":z,"data-front":Sn,"data-swiping":je,"data-dismissible":Ba,"data-type":Vt,"data-invert":xl,"data-swipe-out":ve,"data-swipe-direction":A,"data-expanded":!!(K||ge&&V),"data-testid":g.testId,style:{"--index":z,"--toasts-before":z,"--z-index":L.length-z,"--offset":`${te?xa:qa.current}px`,"--initial-height":ge?"auto":`${La}px`,...Z,...g.style},onDragEnd:()=>{we(!1),W(null),Ya.current=null},onPointerDown:ye=>{ye.button!==2&&(nr||!Ba||(vl.current=new Date,Mt(qa.current),ye.target.setPointerCapture(ye.pointerId),ye.target.tagName!=="BUTTON"&&(we(!0),Ya.current={x:ye.clientX,y:ye.clientY})))},onPointerUp:()=>{var ye,at,pt;if(ve||!Ba)return;Ya.current=null;const Dt=Number(((ye=ta.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),un=Number(((at=ta.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),lt=new Date().getTime()-((pt=vl.current)==null?void 0:pt.getTime()),rt=Se==="x"?Dt:un,Qa=Math.abs(rt)/lt;if(Math.abs(rt)>=I1||Qa>.11){Mt(qa.current),g.onDismiss==null||g.onDismiss.call(g,g),q(Se==="x"?Dt>0?"right":"left":un>0?"down":"up"),Va(),ea(!0);return}else{var gt,vt;(gt=ta.current)==null||gt.style.setProperty("--swipe-amount-x","0px"),(vt=ta.current)==null||vt.style.setProperty("--swipe-amount-y","0px")}dt(!1),we(!1),W(null)},onPointerMove:ye=>{var at,pt,Dt;if(!Ya.current||!Ba||((at=window.getSelection())==null?void 0:at.toString().length)>0)return;const lt=ye.clientY-Ya.current.y,rt=ye.clientX-Ya.current.x;var Qa;const gt=(Qa=l.swipeDirections)!=null?Qa:P1(Xe);!Se&&(Math.abs(rt)>1||Math.abs(lt)>1)&&W(Math.abs(rt)>Math.abs(lt)?"x":"y");let vt={x:0,y:0};const Sa=It=>1/(1.5+Math.abs(It)/20);if(Se==="y"){if(gt.includes("top")||gt.includes("bottom"))if(gt.includes("top")&<<0||gt.includes("bottom")&<>0)vt.y=lt;else{const It=lt*Sa(lt);vt.y=Math.abs(It)<Math.abs(lt)?It:lt}}else if(Se==="x"&&(gt.includes("left")||gt.includes("right")))if(gt.includes("left")&&rt<0||gt.includes("right")&&rt>0)vt.x=rt;else{const It=rt*Sa(rt);vt.x=Math.abs(It)<Math.abs(rt)?It:rt}(Math.abs(vt.x)>0||Math.abs(vt.y)>0)&&dt(!0),(pt=ta.current)==null||pt.style.setProperty("--swipe-amount-x",`${vt.x}px`),(Dt=ta.current)==null||Dt.style.setProperty("--swipe-amount-y",`${vt.y}px`)}},zr&&!g.jsx&&Vt!=="loading"?ae.createElement("button",{"aria-label":re,"data-disabled":nr,"data-close-button":!0,onClick:nr||!Ba?()=>{}:()=>{Va(),g.onDismiss==null||g.onDismiss.call(g,g)},className:On(M==null?void 0:M.closeButton,g==null||(c=g.classNames)==null?void 0:c.closeButton)},(wt=G==null?void 0:G.close)!=null?wt:H1):null,(Vt||g.icon||g.promise)&&g.icon!==null&&((G==null?void 0:G[Vt])!==null||g.icon)?ae.createElement("div",{"data-icon":"",className:On(M==null?void 0:M.icon,g==null||(d=g.classNames)==null?void 0:d.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Vn():null,g.type!=="loading"?Xa:null):null,ae.createElement("div",{"data-content":"",className:On(M==null?void 0:M.content,g==null||(m=g.classNames)==null?void 0:m.content)},ae.createElement("div",{"data-title":"",className:On(M==null?void 0:M.title,g==null||(p=g.classNames)==null?void 0:p.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?ae.createElement("div",{"data-description":"",className:On(Ee,ws,M==null?void 0:M.description,g==null||(y=g.classNames)==null?void 0:y.description)},typeof g.description=="function"?g.description():g.description):null),ae.isValidElement(g.cancel)?g.cancel:g.cancel&&_o(g.cancel)?ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||Q,onClick:ye=>{_o(g.cancel)&&Ba&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,ye),Va())},className:On(M==null?void 0:M.cancelButton,g==null||(v=g.classNames)==null?void 0:v.cancelButton)},g.cancel.label):null,ae.isValidElement(g.action)?g.action:g.action&&_o(g.action)?ae.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||pe,onClick:ye=>{_o(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,ye),!ye.defaultPrevented&&Va())},className:On(M==null?void 0:M.actionButton,g==null||(h=g.classNames)==null?void 0:h.actionButton)},g.action.label):null)};function L0(){if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?window.getComputedStyle(document.documentElement).direction:l}function tS(l,i){const u={};return[l,i].forEach((c,d)=>{const m=d===1,p=m?"--mobile-offset":"--offset",y=m?$1:K1;function v(h){["top","right","bottom","left"].forEach(S=>{u[`${p}-${S}`]=typeof h=="number"?`${h}px`:h})}typeof c=="number"||typeof c=="string"?v(c):typeof c=="object"?["top","right","bottom","left"].forEach(h=>{c[h]===void 0?u[`${p}-${h}`]=y:u[`${p}-${h}`]=typeof c[h]=="number"?`${c[h]}px`:c[h]}):v(y)}),u}const aS=ae.forwardRef(function(i,u){const{id:c,invert:d,position:m="bottom-right",hotkey:p=["altKey","KeyT"],expand:y,closeButton:v,className:h,offset:S,mobileOffset:g,theme:w="light",richColors:E,duration:j,style:C,visibleToasts:_=Z1,toastOptions:z,dir:L=L0(),gap:K=W1,icons:ee,containerAriaLabel:J="Notifications"}=i,[I,Z]=ae.useState([]),Q=ae.useMemo(()=>c?I.filter(V=>V.toasterId===c):I.filter(V=>!V.toasterId),[I,c]),pe=ae.useMemo(()=>Array.from(new Set([m].concat(Q.filter(V=>V.position).map(V=>V.position)))),[Q,m]),[xe,Ee]=ae.useState([]),[Re,Xe]=ae.useState(!1),[ne,ge]=ae.useState(!1),[M,G]=ae.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=ae.useRef(null),Se=p.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ae.useRef(null),A=ae.useRef(!1),q=ae.useCallback(V=>{Z(P=>{var te;return(te=P.find(le=>le.id===V.id))!=null&&te.delete||va.dismiss(V.id),P.filter(({id:le})=>le!==V.id)})},[]);return ae.useEffect(()=>va.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{Z(P=>P.map(te=>te.id===V.id?{...te,delete:!0}:te))});return}setTimeout(()=>{mx.flushSync(()=>{Z(P=>{const te=P.findIndex(le=>le.id===V.id);return te!==-1?[...P.slice(0,te),{...P[te],...V},...P.slice(te+1)]:[V,...P]})})})}),[I]),ae.useEffect(()=>{if(w!=="system"){G(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:P})=>{G(P?"dark":"light")})}catch{V.addListener(({matches:te})=>{try{G(te?"dark":"light")}catch(le){console.error(le)}})}},[w]),ae.useEffect(()=>{I.length<=1&&Xe(!1)},[I]),ae.useEffect(()=>{const V=P=>{var te;if(p.every(we=>P[we]||P.code===we)){var je;Xe(!0),(je=re.current)==null||je.focus()}P.code==="Escape"&&(document.activeElement===re.current||(te=re.current)!=null&&te.contains(document.activeElement))&&Xe(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[p]),ae.useEffect(()=>{if(re.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,A.current=!1)}},[re.current]),ae.createElement("section",{ref:u,"aria-label":`${J} ${Se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},pe.map((V,P)=>{var te;const[le,je]=V.split("-");return Q.length?ae.createElement("ol",{key:V,dir:L==="auto"?L0():L,tabIndex:-1,ref:re,className:h,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":le,"data-x-position":je,style:{"--front-toast-height":`${((te=xe[0])==null?void 0:te.height)||0}px`,"--width":`${J1}px`,"--gap":`${K}px`,...C,...tS(S,g)},onBlur:we=>{A.current&&!we.currentTarget.contains(we.relatedTarget)&&(A.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:we=>{we.target instanceof HTMLElement&&we.target.dataset.dismissible==="false"||A.current||(A.current=!0,W.current=we.relatedTarget)},onMouseEnter:()=>Xe(!0),onMouseMove:()=>Xe(!0),onMouseLeave:()=>{ne||Xe(!1)},onDragEnd:()=>Xe(!1),onPointerDown:we=>{we.target instanceof HTMLElement&&we.target.dataset.dismissible==="false"||ge(!0)},onPointerUp:()=>ge(!1)},Q.filter(we=>!we.position&&P===0||we.position===V).map((we,ve)=>{var ea,Wt;return ae.createElement(eS,{key:we.id,icons:ee,index:ve,toast:we,defaultRichColors:E,duration:(ea=z==null?void 0:z.duration)!=null?ea:j,className:z==null?void 0:z.className,descriptionClassName:z==null?void 0:z.descriptionClassName,invert:d,visibleToasts:_,closeButton:(Wt=z==null?void 0:z.closeButton)!=null?Wt:v,interacting:ne,position:V,style:z==null?void 0:z.style,unstyled:z==null?void 0:z.unstyled,classNames:z==null?void 0:z.classNames,cancelButtonStyle:z==null?void 0:z.cancelButtonStyle,actionButtonStyle:z==null?void 0:z.actionButtonStyle,closeButtonAriaLabel:z==null?void 0:z.closeButtonAriaLabel,removeToast:q,toasts:Q.filter(dt=>dt.position==we.position),heights:xe.filter(dt=>dt.position==we.position),setHeights:Ee,expandByDefault:y,gap:K,expanded:Re,swipeDirections:i.swipeDirections})})):null}))}),nS=({...l})=>{const{theme:i="system"}=z1();return o.jsx(aS,{theme:i,className:"toaster group",icons:{success:o.jsx(hs,{className:"size-4"}),info:o.jsx(Wx,{className:"size-4"}),warning:o.jsx(Go,{className:"size-4"}),error:o.jsx(ob,{className:"size-4"}),loading:o.jsx(mi,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...l})},H0=l=>typeof l=="boolean"?`${l}`:l===0?"0":l,B0=Rp,Zp=(l,i)=>u=>{var c;if((i==null?void 0:i.variants)==null)return B0(l,u==null?void 0:u.class,u==null?void 0:u.className);const{variants:d,defaultVariants:m}=i,p=Object.keys(d).map(h=>{const S=u==null?void 0:u[h],g=m==null?void 0:m[h];if(S===null)return null;const w=H0(S)||H0(g);return d[h][w]}),y=u&&Object.entries(u).reduce((h,S)=>{let[g,w]=S;return w===void 0||(h[g]=w),h},{}),v=i==null||(c=i.compoundVariants)===null||c===void 0?void 0:c.reduce((h,S)=>{let{class:g,className:w,...E}=S;return Object.entries(E).every(j=>{let[C,_]=j;return Array.isArray(_)?_.includes({...m,...y}[C]):{...m,...y}[C]===_})?[...h,g,w]:h},[]);return B0(l,p,v,u==null?void 0:u.class,u==null?void 0:u.className)},Kp=48,Bn=(l,i=0)=>{const u=new Int32Array(l.length);for(let c=0;c<l.length;c++)u[c]=l.charCodeAt(c)-Kp-i;return u},Vo=l=>{const i=new Int32Array(l.length+1);for(let u=0;u<l.length;u++)i[u+1]=i[u]+l[u];return i},Fl=l=>{const i=new Int32Array(l.length);let u=0;for(let c=0;c<l.length;c++){const d=l.charCodeAt(c)-Kp;u+=d>>>1^-(d&1),i[c]=u}return i},lS=384,rS=[],Er=Vo(Bn("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),sS=Vo(Bn(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),iS="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",oS=(()=>{const l=Er.length-1,i=new Int32Array(l);for(let d=l-1;d>=0;d--){let m=1,p=d+1;for(let y=Er[d];y<Er[d+1];y++)m+=i[p],p+=i[p];i[d]=m}const u=new Int32Array(Er[l]);let c=0;for(let d=0;d<l;d++){let m=d+1;for(let p=Er[d];p<Er[d+1];p++)u[c++]=m,m+=i[m]}return u})(),cS=Bn("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),uS=Vo(Bn("1233333593464636351265367151576")),dS=Bn("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0324325853;D>E?3257D>03258432585:0325B:;0328B:032"),fS=Bn("012123445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EJK4444::EJ4444441691;644444114244444:;L6666555555555555555999666664444444444444444444444226?6:66644M9N?D:111::::6DJ199"),mS=Fl("0202002020020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),hS=(()=>{const l=new Int32Array(319).fill(-1),i=Fl("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),u=Fl("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let c=0;c<i.length;c++)l[i[c]]=u[c];return l})(),pS="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top|none | auto square video| auto fr max min px| auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(l=>{const i=l.split(" "),u=i.shift();for(let c=0;c<i.length;c++)i[c]=u+i[c];return i}),q0=Fl("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),gS=Fl("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),vS=Fl("02222222222222222222222222222222222222222222222222222222222222222203062222222222IL2200IL021042222]`222IL0gj2e50n2222U00X202[^2y0000560|{~22>22|22222222222G000qOVI00000}2>40000B00000I¨000°00000000000000021Q²±00´000000000000000000000222HGHa5¾222Ã6À2222ÍÐ000°2±"),$p=new Int32Array(991),Jp=new Int32Array(991),Wp=new Int32Array(991);let rd="";const sd=new Int32Array(1030);{const l=new Map;let i=0,u=0;for(let c=0;c<q0.length;c++)for(const d of pS[vS[c]]){let m=l.get(d);m===void 0&&(m=i++,l.set(d,m),sd[m*2]=rd.length,sd[m*2+1]=d.length,rd+=d),$p[u]=q0[c],Jp[u]=gS[c],Wp[u]=m,u++}}const yS=Fl("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),xS=Vo(Bn("1::22222432:222:22:22>222222:22:2221322511111311111114")),bS=Fl("24A;33N=C@H4A;33N=C@<2;363@QTQʰ222ˉºŴŽ2R2=18cƴÅŇÜÛŲǝȈ:ħ25=11D3A@216Er25;11B3?<438Cn9@7=<8192>2E121@9@EHE@9>2T25511<398216=V25511<398216=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),SS=Bn("ij"),wS=Bn(""),jS=Bn("1"),NS="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var ES={GROUP_COUNT:lS,customValidatorNames:rS,edgeStart:Er,labelStart:sS,labelText:iS,edgeTarget:oS,nodeGroup:cS,nodeVlist:hS,vlistPat:uS,vlistOps:dS,vlistRef:fS,vlistGroup:mS,litAnchor:$p,litGroup:Jp,litPool:Wp,poolOffsets:sd,poolText:rd,adjGid:yS,adjStart:xS,adjTgt:bS,patGid:SS,patTgt:wS,postfixLookupGroups:jS,orderSensitiveModifiers:NS};const AS="line"in new Error,Un=-1,Nr=-1,Pu=(l,i,u)=>{let c=2166136261;for(let d=i;d<u;d++)c=Math.imul(c^l.charCodeAt(d),16777619);return c},ed=(l,i,u)=>{const c=u-i;let d=Math.imul(c,2654435761)^l.charCodeAt(i);if(c>3){const m=c>>2,p=c>>1;d=Math.imul(d^l.charCodeAt(i+1)<<8^l.charCodeAt(i+2)<<16^l.charCodeAt(i+m),2246822507),d=Math.imul(d^l.charCodeAt(i+p)<<8^l.charCodeAt(i+p+m)<<16^l.charCodeAt(u-3),3266489909),d^=l.charCodeAt(u-2)<<8^l.charCodeAt(u-1)<<16;for(let y=i+3,v=u-4;y<i+8&&y<v;y++,v--)d=Math.imul(d^l.charCodeAt(y)^l.charCodeAt(v)<<8,16777619)}return d^d>>>15|0},CS=(l,i,u={})=>{const{GROUP_COUNT:c,edgeStart:d,labelStart:m,labelText:p,edgeTarget:y,nodeGroup:v,nodeVlist:h,vlistPat:S,vlistOps:g,vlistRef:w,vlistGroup:E,litAnchor:j,litGroup:C,litPool:_,poolOffsets:z,poolText:L,adjGid:K,adjStart:ee,adjTgt:J,patGid:I,patTgt:Z,postfixLookupGroups:Q,customValidatorNames:pe,orderSensitiveModifiers:xe}=l,Ee=new Int32Array(c).fill(-1);for(let O=0;O<K.length;O++)Ee[K[O]]=O;let Re=0;for(let O=0;O+1<ee.length;O++){const $=ee[O+1]-ee[O];$>Re&&(Re=$)}let Xe=32;for(;Xe<2*(1+Re+I.length);)Xe<<=1;const ne=new Int32Array(w.length+1);for(let O=0;O<w.length;O++)ne[O+1]=ne[O]+S[w[O]+1]-S[w[O]];const ge=new Uint8Array(c);for(let O=0;O<Q.length;O++)ge[Q[O]]=1;const M=d.length-1,G=new Uint8Array(M);let re=0,Se=!0;for(let O=0;O<j.length;O++){G[j[O]]=1;const $=z[_[O]*2+1];$>re&&(re=$);const F=L.charCodeAt(z[_[O]*2]);(F===91||F===40)&&(Se=!1)}let W=1;for(;W<j.length*2;)W<<=1;const A=new Int32Array(W).fill(-1);for(let O=0;O<j.length;O++){const $=z[_[O]*2];let F=(Pu(L,$,$+z[_[O]*2+1])^Math.imul(j[O],2654435761)|0)&W-1;for(;A[F]!==-1;)F=F+1&W-1;A[F]=O}const q=(O,$,F,ue)=>{let fe=(Pu($,F,ue)^Math.imul(O,2654435761)|0)&W-1;const be=ue-F;for(;;){const Be=A[fe];if(Be===-1)return-1;if(j[Be]===O&&z[_[Be]*2+1]===be){const st=z[_[Be]*2];let qe=!0;for(let me=0;me<be;me++)if(L.charCodeAt(st+me)!==$.charCodeAt(F+me)){qe=!1;break}if(qe)return C[Be]}fe=fe+1&W-1}},V=u.cacheSize??8192,P=u.prefix??l.prefix??"",te=P===""?"":P+":",le=te.length,je=(pe??[]).map(O=>{throw new Error("cn: missing validator "+O)}),we=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ve=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ea=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let dt=0,xa=-1,Mt=-1,La=-1,Ha=-1;const bn=O=>O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95,vl=O=>/\s/.test(String.fromCharCode(O)),ta=(O,$,F)=>{if(dt=0,xa=-1,F-$<3)return;const ue=O.charCodeAt($),fe=O.charCodeAt(F-1);if(ue===91&&fe===93)dt=1;else if(ue===40&&fe===41)dt=2;else return;La=$+1,Ha=F-1;let be=$+1;if(bn(O.charCodeAt(be))){for(be++;be<F-1;){const Be=O.charCodeAt(be);if(!bn(Be)&&Be!==45)break;be++}be<F-2&&O.charCodeAt(be)===58&&(xa=$+1,Mt=be,La=be+1)}},Sn=(O,$,F,ue)=>{if(F-$!==ue.length)return!1;for(let fe=0;fe<ue.length;fe++)if(O.charCodeAt($+fe)!==ue.charCodeAt(fe))return!1;return!0},tr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Vt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ba=O=>!!O&&!Number.isNaN(Number(O)),Xt=(O,$,F)=>{if(F-$<11||!Sn(O,$,$+10,"@container"))return!1;if(O.charCodeAt($+10)===47)return F-$>=12;const ue=O.charCodeAt($+11);return ue===115&&F-$>=17&&Sn(O,$+10,$+16,"-size/")||ue===110&&F-$>=19&&Sn(O,$+10,$+18,"-normal/")},ws=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Yn="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(O=>O.split(" ")),zr=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Gn=(O,$,F,ue)=>{if(O>=10){if(O>=25)return je[O-25]($.slice(F,ue));const fe=O-10;if(dt!==ws[fe])return!1;if(xa>=0){for(const be of Yn[fe])if(Sn($,xa,Mt,be))return!0;return!1}switch(zr[fe]){case 0:return!1;case 1:return!0;case 2:{const be=$.slice(La,Ha);return we.test(be)&&!ve.test(be)}case 3:return Ba($.slice(La,Ha));case 4:return Wt.test($.slice(La,Ha));default:return ea.test($.slice(La,Ha))}}switch(O){case 0:return!0;case 1:return dt===0;case 2:return dt===1;case 3:return dt===2;case 4:return tr.test($.slice(F,ue));case 5:return Ba($.slice(F,ue));case 6:{const fe=$.slice(F,ue);return!!fe&&Number.isInteger(Number(fe))}case 7:return ue>F&&$.charCodeAt(ue-1)===37&&Ba($.slice(F,ue-1));case 8:return Vt.test($.slice(F,ue));default:return Xt($,F,ue)}},ar=new Set(typeof xe=="string"?xe.split(" "):xe),qa=(O,$,F,ue,fe,be)=>{const Be=Pu($,F,ue)^(fe?2654435769:0)|0;let st=O.get(Be);if(st!==void 0)e:for(let Ae=0;Ae<st.length;Ae++){const Me=st[Ae];if(!(Me.imp!==fe||Me.k.length!==ue-F)){for(let yt=0;yt<Me.k.length;yt++)if(Me.k.charCodeAt(yt)!==$.charCodeAt(F+yt))continue e;return Me.id}}else O.set(Be,st=[]);const qe=$.slice(F,ue),me=be(qe);return st.push({k:qe,imp:fe,id:me}),me};let yl=new Map,Ya=new Map,Ga=2;const Yt=4096,ba=(O,$)=>{const F=[];let ue=0,fe=0,be=0;for(let me=0;me<O.length;me++){const Ae=O.charCodeAt(me);ue===0&&fe===0&&Ae===58?(F.push(O.slice(be,me)),be=me+1):Ae===91?ue++:Ae===93?ue--:Ae===40?fe++:Ae===41&&fe--}F.push(O.slice(be));let Be=F[0];if(F.length>1){const me=[];let Ae=[];for(const Me of F)Me.charCodeAt(0)===91||ar.has(Me)?(Ae.length&&(me.push(...Ae.sort()),Ae=[]),me.push(Me)):Ae.push(Me);Ae.length&&me.push(...Ae.sort()),Be=me.join(":")}const st=$?Be+" !":Be;let qe=Ya.get(st);return qe===void 0&&Ya.set(st,qe=Ga++),qe};let kt=new Map,xl=c;const nr=c+4096,Va=()=>xl++,Vn=2097152,Xa=8192,cn=new Int32Array(Xa),wt=new Array(Xa).fill(null),ye=new Int32Array(Xa),at=new Int32Array(Xa),pt=new Uint8Array(Xa);let Dt=0;const un=(O,$,F,ue,fe,be,Be,st)=>{let qe=O;if(wt[O]!==null)if(wt[O|1]===null)qe=O|1;else if((Dt++&3)===0)qe=O|Dt>>2&1;else return;wt[qe]=$.slice(F,ue),cn[qe]=fe,ye[qe]=be,at[qe]=Be,pt[qe]=st},lt=()=>wt.fill(null);let rt=256,Qa=[new Int32Array(rt),new Int32Array(rt),new Int32Array(rt),new Int32Array(rt)],[gt,vt,Sa,It]=Qa,Xn=new Uint8Array(rt),Qn=new Uint8Array(rt);const wn=()=>{rt*=2,Qa=Qa.map($=>{const F=new Int32Array(rt);return F.set($),F}),[gt,vt,Sa,It]=Qa;const O=new Uint8Array(rt);O.set(Xn),Xn=O,Qn=new Uint8Array(rt)};let ct=64,jt=new Int32Array(ct),Za=new Int32Array(ct);const lr=new Int32Array(c);let jn=2048,wi=21,_r=new Float64Array(jn),Nn=new Int32Array(jn),Ka=0;const En=(O,$)=>{if(O===0&&$<c)return lr[$]===Ka?1:(lr[$]=Ka,0);const F=O*2097152+$+1;let ue=Math.imul(F,2654435761)>>>wi;for(;Nn[ue]===Ka;){if(_r[ue]===F)return 1;ue=ue+1&jn-1}return _r[ue]=F,Nn[ue]=Ka,0},dn=(O,$,F,ue,fe)=>{if(F-$>=2&&O.charCodeAt($)===91&&O.charCodeAt(F-1)===93){let be=-1;for(let Be=$+1;Be<F-1;Be++)if(O.charCodeAt(Be)===58){be=Be;break}return be===-1||be===$+1?Un:qa(kt,O,$+1,be,0,Va)}if(ue>=0&&v[ue]>=0)return v[ue];for(let be=fe-1;be>=0;be--){const Be=Za[be];if(Be>F)continue;const st=jt[be],qe=F-Be;if(G[st]===1&&qe>0&&qe<=re){const xt=O.charCodeAt(Be);if(Se===!1||xt!==91&&xt!==40){const $a=q(st,O,Be,F);if($a>=0)return $a}}const me=h[st];if(me<0)continue;const Ae=w[me],Me=S[Ae],yt=S[Ae+1];if(Me===yt)continue;ta(O,Be,F);const Ot=ne[me]-Me;for(let xt=Me;xt<yt;xt++)if(Gn(g[xt],O,Be,F))return E[Ot+xt]}return Un},An=O=>{const $=O.length;let F=0,ue=0,fe=!1;(Ga>Yt||yl.size>Yt)&&(yl=new Map,Ya=new Map,Ga=2,lt()),xl>nr&&(kt=new Map,xl=c,lt());let be=0;for(;be<$;){let me=O.charCodeAt(be);if(me===32||me>=9&&me<=13||me>=160&&vl(me)){me!==32&&(fe=!0),be++;continue}const Ae=be;let Me=0;for(;be<$;){if(me=O.charCodeAt(be),me<=32){if(me===32)break;if(me>=9&&me<=13){fe=!0;break}}else if(me>=160&&vl(me)){fe=!0;break}Me=Math.imul(Me^me,16777619),be++}const yt=be,Ot=yt-Ae;F===rt&&wn();const xt=F++;gt[xt]=Ae,vt[xt]=yt,ue+=Ot,Me^=Math.imul(Ot,2654435761);const $a=Me^Me>>>15|0,Ja=$a&8190;{let Ve=-1;if(cn[Ja]===$a&&wt[Ja]!==null&&wt[Ja].length===Ot?Ve=Ja:cn[Ja|1]===$a&&wt[Ja|1]!==null&&wt[Ja|1].length===Ot&&(Ve=Ja|1),Ve>=0){const Aa=wt[Ve];let Ca=!0;for(let Ta=0;Ta<Ot;Ta++)if(Aa.charCodeAt(Ta)!==O.charCodeAt(Ae+Ta)){Ca=!1;break}if(Ca){Sa[xt]=ye[Ve],It[xt]=at[Ve],Xn[xt]=pt[Ve];continue}}}let Sl=Ae;if(le!==0){if(yt-Ae<=le||!O.startsWith(te,Ae)){Sa[xt]=Un,un(Ja,O,Ae,yt,$a,Un,0,0);continue}Sl=Ae+le}let wl=0,ja=0,Kn=-1,ir=-1;for(let Ve=Sl;Ve<yt;Ve++){const Aa=O.charCodeAt(Ve);if(wl===0&&ja===0){if(Aa===58){Kn=Ve;continue}if(Aa===47){ir=Ve;continue}}Aa===91?wl++:Aa===93?wl--:Aa===40?ja++:Aa===41&&ja--}const $n=Kn>=Sl?Kn+1:Sl;let Ut=$n,na=yt,Jn=!1,Ns=0;na>Ut&&O.charCodeAt(na-1)===33?(Jn=!0,na--):na>Ut&&O.charCodeAt(Ut)===33&&(Jn=!0,Ut++,Ns=1);let Na=-1;ir>$n&&(Na=ir+Ns,Na>=na&&(Na=-1));let Ea=Ut;na-Ut>1&&O.charCodeAt(Ut)===45&&(Ea=Ut+1);let ua=0,da=0,la=0,Dr=-1,ra=0;(h[0]>=0||G[0]===1)&&(jt[0]=0,Za[0]=Ea,ra=1);let Or=Nr,jl=0;for(let Ve=Ea;Ve<na;Ve++)if(Ve===Na&&(Or=da<la?Nr:ua,jl=ra),ua!==Nr){const Aa=O.charCodeAt(Ve);let Ca=-1;if(da<la)p.charCodeAt(da)===Aa?(da++,da===la&&(Ca=ua=Dr)):ua=Nr;else{const Ta=d[ua],Tn=d[ua+1];let Al=Nr;for(let zn=Ta;zn<Tn;zn++){const Es=m[zn];if(p.charCodeAt(Es)===Aa){m[zn+1]-Es===1?Ca=Al=y[zn]:(da=Es+1,la=m[zn+1],Dr=y[zn],Al=ua);break}}ua=Al}if(Ca>=0&&(h[Ca]>=0||G[Ca]===1)&&Ve+1<na&&O.charCodeAt(Ve+1)===45){if(ra===ct){ct*=2;const Ta=new Int32Array(ct);Ta.set(jt),jt=Ta;const Tn=new Int32Array(ct);Tn.set(Za),Za=Tn}jt[ra]=Ca,Za[ra]=Ve+2,ra++}}Na===na&&(Or=da<la?Nr:ua,jl=ra);const Nl=da<la?Nr:ua;let sa,Lt=!1;if(Na>=0)if(Lt=!0,sa=dn(O,Ut,Na,Or,jl),sa!==Un&&sa<c&&ge[sa]){const Ve=dn(O,Ut,na,Nl,ra);Ve!==Un&&Ve!==sa&&(sa=Ve,Lt=!1)}else sa===Un&&(sa=dn(O,Ut,na,Nl,ra),Lt=!1);else sa=dn(O,Ut,na,Nl,ra);let mn=0,El=0;sa===Un?Sa[xt]=Un:(El=Lt?1:0,mn=Sl>=Kn?Jn?1:0:qa(yl,O,Sl,Kn,Jn?1:0,Ve=>ba(Ve,Jn)),Sa[xt]=sa,Xn[xt]=El,It[xt]=mn),un(Ja,O,Ae,yt,$a,sa,mn,El)}if(F===0)return"";if(F===1)return gt[0]===0&&vt[0]===$?O:O.slice(gt[0],vt[0]);if(F*Xe>jn){for(;F*Xe>jn;)jn<<=1,wi--;_r=new Float64Array(jn),Nn=new Int32Array(jn)}if(Ga>=Vn||xl>=Vn)throw new Error("cn: too many distinct classes in one merge");Ka=Ka+1|0,Ka===0&&(lr.fill(0),Nn.fill(0),Ka=1);let Be=!1;for(let me=F-1;me>=0;me--){const Ae=Sa[me];if(Ae===Un){Qn[me]=1;continue}const Me=It[me];if(En(Me,Ae)===1){Qn[me]=0,Be=!0;continue}if(Qn[me]=1,Ae<c){const yt=Ee[Ae];if(yt>=0)for(let Ot=ee[yt];Ot<ee[yt+1];Ot++)En(Me,J[Ot]);if(Xn[me]&1)for(let Ot=0;Ot<I.length;Ot++)I[Ot]===Ae&&En(Me,Z[Ot])}}if(!Be&&!fe&&$===ue+F-1)return O;let st="",qe=0;for(;qe<F;){if(!Qn[qe]){qe++;continue}const me=gt[qe];let Ae=vt[qe],Me=qe+1;for(;Me<F&&Qn[Me]&>[Me]===Ae+1&&O.charCodeAt(Ae)===32;)Ae=vt[Me],Me++;st.length>0&&(st+=" "),st+=O.slice(me,Ae),qe=Me}return st},aa=16384,Fe=new Int32Array(aa*2);let rr=0,oa=1,wa=Object.create(null),Zn=Object.create(null),bl=new Map,js=new Map,sr=0,Rr=0;const Cn=()=>{rr^=aa,oa=oa+1|0,Rr=0},Mr=O=>{let $=wa[O];if($!==void 0)return $;const F=ed(O,0,O.length),ue=(F&16383)+rr,fe=Fe[ue]===(F^oa)||Fe[ue^aa]===(F^oa-1);return fe&&($=Zn[O],$!==void 0)?(wa[O]=$,$):($=An(O),fe?(wa[O]=$,++sr>V&&(sr=0,Zn=wa,wa=Object.create(null),Cn())):(Fe[ue]=F^oa,++Rr>aa&&Cn()),$)},fn=O=>{let $=bl.get(O);if($!==void 0)return $;const F=ed(O,0,O.length),ue=(F&16383)+rr,fe=Fe[ue]===(F^oa)||Fe[ue^aa]===(F^oa-1);return fe&&($=js.get(O),$!==void 0)?(bl.set(O,$),$):($=An(O),fe?(bl.set(O,$),++sr>V&&(sr=0,js=bl,bl=new Map,Cn())):(Fe[ue]=F^oa,++Rr>aa&&Cn()),$)},ca=O=>{const $=ed(O,0,O.length),F=($&16383)+rr;return Fe[F]===($^oa)||Fe[F^aa]===($^oa-1)?!0:(Fe[F]=$^oa,++Rr>aa&&Cn(),!1)},kr=V===0?An:AS?O=>{const $=bl.get(O);return $!==void 0?$:fn(O)}:Mr;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?kr(arguments[0]):kr(zS.apply(null,arguments))},mergeString:kr,seenBefore:V===0?()=>!1:ca,mergeUncached:An}},Uo=(l,i)=>{if(!l)return"";if(typeof l=="string")return l;let u="";if(typeof l.length=="number"&&(!i||Array.isArray(l))){const c=l;for(let d=0;d<c.length;d++){const m=c[d];if(!m)continue;const p=typeof m=="string"?m:Uo(m,i);p&&(u&&(u+=" "),u+=p)}return u}if(i){if(typeof l=="number")return""+l;if(typeof l=="object")for(const c in l)l[c]&&(u&&(u+=" "),u+=c)}return u},TS=(l,i)=>{let u="";for(let c=0;c<l.length;c++){const d=l[c];if(!d)continue;const m=typeof d=="string"?d:Uo(d,i);m&&(u&&(u+=" "),u+=m)}return u},zS=function(){return TS(arguments,!1)},_S=(l,i)=>{const u=i===void 0?()=>!0:i.seenBefore,c=i===void 0?l:i.mergeUncached;let d=new Map,m=new Map,p=0,y=null;const v=(w,E,j,C)=>{let _=0;if(E){if(E!==w.a0)return!1;_=1}if(j){if(j!==(_===0?w.a0:w.a1))return!1;_++}if(C){if(C!==(_===0?w.a0:_===1?w.a1:w.a2))return!1;_++}return _===w.t},h=(w,E)=>{const j=w.a;let C=0;for(let _=0;_<E.length;_++){const z=E[_];if(z){if(z!==j[C])return!1;C++}}return C===w.t},S=(w,E)=>{const j=w.length,C=y===null?null:y.n;if(!E){if(C!==null&&h(C,w))return y=C,C.r;if(y!==null&&y!==C&&h(y,w))return y.r}let _="",z=-1,L=0,K=!1;for(let I=0;I<j;I++){let Z=w[I];if(Z){if(typeof Z!="string"){if(Z=w[I]=Uo(Z,!0),!Z)continue;K=!0}z<0&&(_=Z,z=I),L++}}if(L===0)return"";if(L===1)return l(_);if(K){if(C!==null&&h(C,w))return y=C,C.r;if(y!==null&&y!==C&&h(y,w))return y.r}let ee=d.get(_);ee===void 0&&(ee=m.get(_),ee!==void 0&&d.set(_,ee));let J=null;if(ee!==void 0)e:for(let I=0;I<ee.length;I++){const Z=ee[I];if(Z.t!==L)continue;const Q=Z.a;let pe=1;for(let xe=z+1;xe<j;xe++){const Ee=w[xe];if(Ee&&Ee!==Q[pe++])continue e}J=Z;break}if(J===null){let I=_;const Z=[_];for(let Q=z+1;Q<j;Q++){const pe=w[Q];pe&&(I+=" "+pe,Z.push(pe))}if(!u(I))return c(I);J={r:l(I),t:Z.length,a0:Z[0],a1:Z[1],a2:Z[2]??"",a:Z,n:null},ee===void 0&&d.set(_,ee=[]),ee.length>=256&&ee.shift(),ee.push(J),++p>1e3&&(p=0,m=d,d=new Map)}return y!==null&&y!==J&&(y.n=J),y=J,J.r},g=w=>Array.isArray(w)?S(w.slice(),!1):l(Uo(w,!0));return function(w,E,j){const C=arguments.length;if((C|1)===3){const L=y;if(L!==null){const K=L.n;if(K!==null&&v(K,w,E,j))return y=K,K.r;if(L!==K&&v(L,w,E,j))return L.r}return S([w,E,j],!0)}if(C===1)return typeof w=="string"?l(w):g(w);const _=y;if(_!==null){const L=_.n;if(L!==null){const K=L.a;let ee=0,J=!0;for(let I=0;I<C;I++){const Z=arguments[I];if(Z){if(Z!==K[ee]){J=!1;break}ee++}}if(J&&ee===L.t)return y=L,L.r}if(_!==L){const K=_.a;let ee=0,J=!0;for(let I=0;I<C;I++){const Z=arguments[I];if(Z){if(Z!==K[ee]){J=!1;break}ee++}}if(J&&ee===_.t)return _.r}}const z=[];for(let L=0;L<C;L++)z.push(arguments[L]);return S(z,!0)}},Y0=CS(ES),Pt=_S(Y0.mergeString,Y0);var RS=Object.defineProperty,zd=(l,i)=>RS(l,"name",{value:i,configurable:!0});function id(l,i){if(typeof l=="function")return l(i);l!=null&&(l.current=i)}zd(id,"setRef");function Ip(...l){return i=>{let u=!1;const c=l.map(d=>{const m=id(d,i);return!u&&typeof m=="function"&&(u=!0),m});if(u)return()=>{for(let d=0;d<c.length;d++){const m=c[d];typeof m=="function"?m():id(l[d],null)}}}}zd(Ip,"composeRefs");function er(...l){return b.useCallback(Ip(...l),l)}zd(er,"useComposedRefs");var MS=Object.defineProperty,xn=(l,i)=>MS(l,"name",{value:i,configurable:!0});function _d(l){const i=b.forwardRef((u,c)=>{let{children:d,...m}=u,p=null,y=!1;const v=[];od(d)&&typeof Ro=="function"&&(d=Ro(d._payload)),b.Children.forEach(d,w=>{var E;if(ag(w)){y=!0;const j=w;let C="child"in j.props?j.props.child:j.props.children;od(C)&&typeof Ro=="function"&&(C=Ro(C._payload)),p=DS(j,C),v.push((E=p==null?void 0:p.props)==null?void 0:E.children)}else v.push(w)}),p?p=b.cloneElement(p,void 0,v):!y&&b.Children.count(d)===1&&b.isValidElement(d)&&(p=d);const h=p?tg(p):void 0,S=er(c,h);if(!p){if(d||d===0)throw new Error(y?LS(l):US(l));return d}const g=eg(m,p.props??{});return p.type!==b.Fragment&&(g.ref=c?S:h),b.cloneElement(p,g)});return i.displayName=`${l}.Slot`,i}xn(_d,"createSlot");var Fp=_d("Slot"),Pp=Symbol.for("radix.slottable");function kS(l){const i=xn(u=>"child"in u?u.children(u.child):u.children,"Slottable");return i.displayName=`${l}.Slottable`,i.__radixId=Pp,i}xn(kS,"createSlottable");var DS=xn((l,i)=>{if("child"in l.props){const u=l.props.child;return b.isValidElement(u)?b.cloneElement(u,void 0,l.props.children(u.props.children)):null}return b.isValidElement(i)?i:null},"getSlottableElementFromSlottable");function eg(l,i){const u={...i};for(const c in i){const d=l[c],m=i[c];/^on[A-Z]/.test(c)?d&&m?u[c]=(...y)=>{const v=m(...y);return d(...y),v}:d&&(u[c]=d):c==="style"?u[c]={...d,...m}:c==="className"&&(u[c]=[d,m].filter(Boolean).join(" "))}return{...l,...u}}xn(eg,"mergeProps");function tg(l){var c,d;let i=(c=Object.getOwnPropertyDescriptor(l.props,"ref"))==null?void 0:c.get,u=i&&"isReactWarning"in i&&i.isReactWarning;return u?l.ref:(i=(d=Object.getOwnPropertyDescriptor(l,"ref"))==null?void 0:d.get,u=i&&"isReactWarning"in i&&i.isReactWarning,u?l.props.ref:l.props.ref||l.ref)}xn(tg,"getElementRef");function ag(l){return b.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Pp}xn(ag,"isSlottable");var OS=Symbol.for("react.lazy");function od(l){return l!=null&&typeof l=="object"&&"$$typeof"in l&&l.$$typeof===OS&&"_payload"in l&&ng(l._payload)}xn(od,"isLazyComponent");function ng(l){return typeof l=="object"&&l!==null&&"then"in l}xn(ng,"isPromiseLike");var US=xn(l=>`${l} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),LS=xn(l=>`${l} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ro=Cv[" use ".trim().toString()],HS=Object.defineProperty,BS=(l,i)=>HS(l,"name",{value:i,configurable:!0}),qS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xi=qS.reduce((l,i)=>{const u=_d(`Primitive.${i}`),c=b.forwardRef((d,m)=>{const{asChild:p,...y}=d,v=p?u:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(v,{...y,ref:m})});return c.displayName=`Primitive.${i}`,{...l,[i]:c}},{});function YS(l,i){l&&gp.flushSync(()=>l.dispatchEvent(i))}BS(YS,"dispatchDiscreteCustomEvent");var GS=Object.defineProperty,ln=(l,i)=>GS(l,"name",{value:i,configurable:!0});function VS(l,i){const u=b.createContext(i);u.displayName=l+"Context";const c=ln(m=>{const{children:p,...y}=m,v=b.useMemo(()=>y,Object.values(y));return o.jsx(u.Provider,{value:v,children:p})},"Provider");c.displayName=l+"Provider";function d(m,p={}){const{optional:y=!1}=p,v=b.useContext(u);if(v)return v;if(i!==void 0)return i;if(!y)throw new Error(`\`${m}\` must be used within \`${l}\``)}return ln(d,"useContext"),[c,d]}ln(VS,"createContext");function lg(l,i=[]){let u=[];function c(m,p){const y=b.createContext(p);y.displayName=m+"Context";const v=u.length;u=[...u,p];const h=ln(g=>{var z;const{scope:w,children:E,...j}=g,C=((z=w==null?void 0:w[l])==null?void 0:z[v])||y,_=b.useMemo(()=>j,Object.values(j));return o.jsx(C.Provider,{value:_,children:E})},"Provider");h.displayName=m+"Provider";function S(g,w,E={}){var z;const{optional:j=!1}=E,C=((z=w==null?void 0:w[l])==null?void 0:z[v])||y,_=b.useContext(C);if(_)return _;if(p!==void 0)return p;if(!j)throw new Error(`\`${g}\` must be used within \`${m}\``)}return ln(S,"useContext"),[h,S]}ln(c,"createContext");const d=ln(()=>{const m=u.map(p=>b.createContext(p));return ln(function(y){const v=(y==null?void 0:y[l])||m;return b.useMemo(()=>({[`__scope${l}`]:{...y,[l]:v}}),[y,v])},"useScope")},"createScope");return d.scopeName=l,[c,rg(d,...i)]}ln(lg,"createContextScope");function rg(...l){const i=l[0];if(l.length===1)return i;const u=ln(()=>{const c=l.map(d=>({useScope:d(),scopeName:d.scopeName}));return ln(function(m){const p=c.reduce((y,{useScope:v,scopeName:h})=>{const g=v(m)[`__scope${h}`];return{...y,...g}},{});return b.useMemo(()=>({[`__scope${i.scopeName}`]:p}),[p])},"useComposedScopes")},"createScope");return u.scopeName=i.scopeName,u}ln(rg,"composeContextScopes");var XS=Object.defineProperty,ys=(l,i)=>XS(l,"name",{value:i,configurable:!0}),sg=!!(typeof window<"u"&&window.document&&window.document.createElement);function Il(l,i,{checkForDefaultPrevented:u=!0}={}){return ys(function(d){if(l==null||l(d),u===!1||!d||!d.defaultPrevented)return i==null?void 0:i(d)},"handleEvent")}ys(Il,"composeEventHandlers");function QS(l){var i;if(!sg)throw new Error("Cannot access window outside of the DOM");return((i=l==null?void 0:l.ownerDocument)==null?void 0:i.defaultView)??window}ys(QS,"getOwnerWindow");function cd(l){if(!sg)throw new Error("Cannot access document outside of the DOM");return(l==null?void 0:l.ownerDocument)??document}ys(cd,"getOwnerDocument");function ig(l,i=!1){const{activeElement:u}=cd(l);if(!(u!=null&&u.nodeName))return null;if(og(u)&&u.contentDocument)return ig(u.contentDocument.body,i);if(i){const c=u.getAttribute("aria-activedescendant");if(c){const d=cd(u).getElementById(c);if(d)return d}}return u}ys(ig,"getActiveElement");function og(l){return l.tagName==="IFRAME"}ys(og,"isFrame");var ud=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},ZS=Object.defineProperty,hl=(l,i)=>ZS(l,"name",{value:i,configurable:!0});function cg(l,i){return b.useReducer((u,c)=>i[u][c]??u,l)}hl(cg,"useStateMachine");var Xo=hl(l=>{const{present:i,children:u}=l,c=ug(i),d=typeof u=="function"?u({present:c.isPresent}):b.Children.only(u),m=dg(c.ref,fg(d));return typeof u=="function"||c.isPresent?b.cloneElement(d,{ref:m}):null},"Presence");function ug(l){const[i,u]=b.useState(),c=b.useRef(null),d=b.useRef(l),m=b.useRef("none"),p=b.useRef(void 0),y=l?"mounted":"unmounted",[v,h]=cg(y,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{v==="mounted"?(m.current=p.current??ds(c.current),p.current=void 0):m.current="none"},[v]),ud(()=>{const S=c.current,g=d.current;if(g!==l){const E=m.current,j=ds(S);l?(p.current=j,h("MOUNT")):j==="none"||(S==null?void 0:S.display)==="none"?h("UNMOUNT"):h(g&&E!==j?"ANIMATION_OUT":"UNMOUNT"),d.current=l}},[l,h]),ud(()=>{if(i){let S;const g=i.ownerDocument.defaultView??window,w=hl(j=>{const _=ds(c.current).includes(CSS.escape(j.animationName));if(j.target===i&&_&&(h("ANIMATION_END"),!d.current)){const z=i.style.animationFillMode;i.style.animationFillMode="forwards",S=g.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=z)})}},"handleAnimationEnd"),E=hl(j=>{j.target===i&&(m.current=ds(c.current))},"handleAnimationStart");return i.addEventListener("animationstart",E),i.addEventListener("animationcancel",w),i.addEventListener("animationend",w),()=>{g.clearTimeout(S),i.removeEventListener("animationstart",E),i.removeEventListener("animationcancel",w),i.removeEventListener("animationend",w)}}else h("ANIMATION_END")},[i,h]),{isPresent:["mounted","unmountSuspended"].includes(v),ref:b.useCallback(S=>{if(S){const g=getComputedStyle(S);c.current=g,p.current=ds(g)}else c.current=null;u(S)},[])}}hl(ug,"usePresence");function dd(l,i){if(typeof l=="function")return l(i);l!=null&&(l.current=i)}hl(dd,"setRef");function dg(...l){const i=b.useRef(l);return i.current=l,b.useCallback(u=>{const c=i.current;let d=!1;const m=c.map(p=>{const y=dd(p,u);return!d&&typeof y=="function"&&(d=!0),y});if(d)return()=>{for(let p=0;p<m.length;p++){const y=m[p];typeof y=="function"?y():dd(c[p],null)}}},[])}hl(dg,"useStableComposedRefs");function ds(l){return(l==null?void 0:l.animationName)||"none"}hl(ds,"getAnimationName");function fg(l){var c,d;let i=(c=Object.getOwnPropertyDescriptor(l.props,"ref"))==null?void 0:c.get,u=i&&"isReactWarning"in i&&i.isReactWarning;return u?l.ref:(i=(d=Object.getOwnPropertyDescriptor(l,"ref"))==null?void 0:d.get,u=i&&"isReactWarning"in i&&i.isReactWarning,u?l.props.ref:l.props.ref||l.ref)}hl(fg,"getElementRef");var KS=Object.defineProperty,$S=(l,i)=>KS(l,"name",{value:i,configurable:!0}),JS=b.createContext(void 0);function mg(l){const i=b.useContext(JS);return l||i||"ltr"}$S(mg,"useDirection");var WS=Object.defineProperty,IS=(l,i)=>WS(l,"name",{value:i,configurable:!0});function Wl(l){const i=b.useRef(l);return b.useEffect(()=>{i.current=l}),b.useMemo(()=>((...u)=>{var c;return(c=i.current)==null?void 0:c.call(i,...u)}),[])}IS(Wl,"useCallbackRef");var FS=Object.defineProperty,PS=(l,i)=>FS(l,"name",{value:i,configurable:!0});function hg(l,[i,u]){return Math.min(u,Math.max(i,l))}PS(hg,"clamp");var ew=Object.defineProperty,Ue=(l,i)=>ew(l,"name",{value:i,configurable:!0});function pg(l,i){return b.useReducer((u,c)=>i[u][c]??u,l)}Ue(pg,"useStateMachine");var gg="ScrollArea",[vg,qw]=lg(gg),[tw,on]=vg(gg),aw=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,type:d="hover",dir:m,scrollHideDelay:p=600,...y}=i,[v,h]=b.useState(null),[S,g]=b.useState(null),[w,E]=b.useState(null),[j,C]=b.useState(null),[_,z]=b.useState(null),[L,K]=b.useState(0),[ee,J]=b.useState(0),[I,Z]=b.useState(!1),[Q,pe]=b.useState(!1),xe=er(u,h),Ee=mg(m);return o.jsx(tw,{scope:c,type:d,dir:Ee,scrollHideDelay:p,scrollArea:v,viewport:S,onViewportChange:g,content:w,onContentChange:E,scrollbarX:j,onScrollbarXChange:C,scrollbarXEnabled:I,onScrollbarXEnabledChange:Z,scrollbarY:_,onScrollbarYChange:z,scrollbarYEnabled:Q,onScrollbarYEnabledChange:pe,onCornerWidthChange:K,onCornerHeightChange:J,children:o.jsx(xi.div,{dir:Ee,...y,ref:xe,style:{position:"relative","--radix-scroll-area-corner-width":L+"px","--radix-scroll-area-corner-height":ee+"px",...i.style}})})},"ScrollArea")),nw="ScrollAreaViewport",lw=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,children:d,nonce:m,...p}=i,y=on(nw,c),v=b.useRef(null),h=er(u,v,y.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx(rw,{nonce:m}),o.jsx(xi.div,{"data-radix-scroll-area-viewport":"",...p,ref:h,style:{overflowX:y.scrollbarXEnabled?"scroll":"hidden",overflowY:y.scrollbarYEnabled?"scroll":"hidden",...i.style},children:o.jsx("div",{ref:y.onContentChange,style:{minWidth:"100%",display:"table"},children:d})})]})},"ScrollAreaViewport")),rw=b.memo(Ue(function({nonce:i}){return o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i})},"ScrollAreaViewportStyle"),(l,i)=>l.nonce===i.nonce),gl="ScrollAreaScrollbar",sw=b.forwardRef(Ue(function(i,u){const{forceMount:c,...d}=i,m=on(gl,i.__scopeScrollArea),{onScrollbarXEnabledChange:p,onScrollbarYEnabledChange:y}=m,v=i.orientation==="horizontal";return b.useEffect(()=>(v?p(!0):y(!0),()=>{v?p(!1):y(!1)}),[v,p,y]),m.type==="hover"?o.jsx(iw,{...d,ref:u,forceMount:c}):m.type==="scroll"?o.jsx(ow,{...d,ref:u,forceMount:c}):m.type==="auto"?o.jsx(yg,{...d,ref:u,forceMount:c}):m.type==="always"?o.jsx(Rd,{...d,ref:u,"data-state":"visible"}):null},"ScrollAreaScrollbar")),iw=b.forwardRef(Ue(function(i,u){const{forceMount:c,...d}=i,m=on(gl,i.__scopeScrollArea),[p,y]=b.useState(!1);return b.useEffect(()=>{const v=m.scrollArea;let h=0;if(v){const S=Ue(()=>{window.clearTimeout(h),y(!0)},"handlePointerEnter"),g=Ue(()=>{h=window.setTimeout(()=>y(!1),m.scrollHideDelay)},"handlePointerLeave");return v.addEventListener("pointerenter",S),v.addEventListener("pointerleave",g),()=>{window.clearTimeout(h),v.removeEventListener("pointerenter",S),v.removeEventListener("pointerleave",g)}}},[m.scrollArea,m.scrollHideDelay]),o.jsx(Xo,{present:c||p,children:o.jsx(yg,{"data-state":p?"visible":"hidden",...d,ref:u})})},"ScrollAreaScrollbarHover")),ow=b.forwardRef(Ue(function(i,u){const{forceMount:c,...d}=i,m=on(gl,i.__scopeScrollArea),p=i.orientation==="horizontal",y=Si(()=>h("SCROLL_END"),100),[v,h]=pg("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(v==="idle"){const S=window.setTimeout(()=>h("HIDE"),m.scrollHideDelay);return()=>window.clearTimeout(S)}},[v,m.scrollHideDelay,h]),b.useEffect(()=>{const S=m.viewport,g=p?"scrollLeft":"scrollTop";if(S){let w=S[g];const E=Ue(()=>{const j=S[g];w!==j&&(h("SCROLL"),y()),w=j},"handleScroll");return S.addEventListener("scroll",E),()=>S.removeEventListener("scroll",E)}},[m.viewport,p,h,y]),o.jsx(Xo,{present:c||v!=="hidden",children:o.jsx(Rd,{"data-state":v==="hidden"?"hidden":"visible",...d,ref:u,onPointerEnter:Il(i.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Il(i.onPointerLeave,()=>h("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),yg=b.forwardRef(Ue(function(i,u){const c=on(gl,i.__scopeScrollArea),{forceMount:d,...m}=i,[p,y]=b.useState(!1),v=i.orientation==="horizontal",h=Si(()=>{if(c.viewport){const S=c.viewport.offsetWidth<c.viewport.scrollWidth,g=c.viewport.offsetHeight<c.viewport.scrollHeight;y(v?S:g)}},10);return Ar(c.viewport,h),Ar(c.content,h),o.jsx(Xo,{present:d||p,children:o.jsx(Rd,{"data-state":p?"visible":"hidden",...m,ref:u})})},"ScrollAreaScrollbarAuto")),Rd=b.forwardRef(Ue(function(i,u){const{orientation:c="vertical",...d}=i,m=on(gl,i.__scopeScrollArea),p=b.useRef(null),y=b.useRef(0),[v,h]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),S=Md(v.viewport,v.content),g={...d,sizes:v,onSizesChange:h,hasThumb:S>0&&S<1,onThumbChange:Ue(E=>p.current=E,"onThumbChange"),onThumbPointerUp:Ue(()=>y.current=0,"onThumbPointerUp"),onThumbPointerDown:Ue(E=>y.current=E,"onThumbPointerDown")};function w(E,j){return wg(E,y.current,v,j)}return Ue(w,"getScrollPosition"),c==="horizontal"?o.jsx(cw,{...g,ref:u,onThumbPositionChange:()=>{if(m.viewport&&p.current){const E=m.viewport.scrollLeft,j=md(E,v,m.dir);p.current.style.transform=`translate3d(${j}px, 0, 0)`}},onWheelScroll:E=>{m.viewport&&(m.viewport.scrollLeft=E)},onDragScroll:E=>{m.viewport&&(m.viewport.scrollLeft=w(E,m.dir))}}):c==="vertical"?o.jsx(uw,{...g,ref:u,onThumbPositionChange:()=>{if(m.viewport&&p.current){const E=m.viewport.scrollTop,j=md(E,v);p.current.style.transform=`translate3d(0, ${j}px, 0)`}},onWheelScroll:E=>{m.viewport&&(m.viewport.scrollTop=E)},onDragScroll:E=>{m.viewport&&(m.viewport.scrollTop=w(E))}}):null},"ScrollAreaScrollbarVisible")),cw=b.forwardRef(Ue(function(i,u){const{sizes:c,onSizesChange:d,...m}=i,p=on(gl,i.__scopeScrollArea),[y,v]=b.useState(),h=b.useRef(null),S=er(u,h,p.onScrollbarXChange);return b.useEffect(()=>{h.current&&v(getComputedStyle(h.current))},[h]),o.jsx(bg,{"data-orientation":"horizontal",...m,ref:S,sizes:c,style:{bottom:0,left:p.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:p.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":bi(c)+"px",...i.style},onThumbPointerDown:g=>i.onThumbPointerDown(g.x),onDragScroll:g=>i.onDragScroll(g.x),onWheelScroll:(g,w)=>{if(p.viewport){const E=p.viewport.scrollLeft+g.deltaX;i.onWheelScroll(E),Dd(E,w)&&g.preventDefault()}},onResize:()=>{h.current&&p.viewport&&y&&d({content:p.viewport.scrollWidth,viewport:p.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:hi(y.paddingLeft),paddingEnd:hi(y.paddingRight)}})}})},"ScrollAreaScrollbarX")),uw=b.forwardRef(Ue(function(i,u){const{sizes:c,onSizesChange:d,...m}=i,p=on(gl,i.__scopeScrollArea),[y,v]=b.useState(),h=b.useRef(null),S=er(u,h,p.onScrollbarYChange);return b.useEffect(()=>{h.current&&v(getComputedStyle(h.current))},[h]),o.jsx(bg,{"data-orientation":"vertical",...m,ref:S,sizes:c,style:{top:0,right:p.dir==="ltr"?0:void 0,left:p.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":bi(c)+"px",...i.style},onThumbPointerDown:g=>i.onThumbPointerDown(g.y),onDragScroll:g=>i.onDragScroll(g.y),onWheelScroll:(g,w)=>{if(p.viewport){const E=p.viewport.scrollTop+g.deltaY;i.onWheelScroll(E),Dd(E,w)&&g.preventDefault()}},onResize:()=>{h.current&&p.viewport&&y&&d({content:p.viewport.scrollHeight,viewport:p.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:hi(y.paddingTop),paddingEnd:hi(y.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[dw,xg]=vg(gl),bg=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,sizes:d,hasThumb:m,onThumbChange:p,onThumbPointerUp:y,onThumbPointerDown:v,onThumbPositionChange:h,onDragScroll:S,onWheelScroll:g,onResize:w,...E}=i,j=on(gl,c),[C,_]=b.useState(null),z=er(u,_),L=b.useRef(null),K=b.useRef(""),ee=j.viewport,J=d.content-d.viewport,I=Wl(g),Z=Wl(h),Q=Si(w,10);function pe(xe){if(L.current){const Ee=xe.clientX-L.current.left,Re=xe.clientY-L.current.top;S({x:Ee,y:Re})}}return Ue(pe,"handleDragScroll"),b.useEffect(()=>{const xe=Ue(Ee=>{const Re=Ee.target;(C==null?void 0:C.contains(Re))&&I(Ee,J)},"handleWheel");return document.addEventListener("wheel",xe,{passive:!1}),()=>document.removeEventListener("wheel",xe,{passive:!1})},[ee,C,J,I]),b.useEffect(Z,[d,Z]),Ar(C,Q),Ar(j.content,Q),o.jsx(dw,{scope:c,scrollbar:C,hasThumb:m,onThumbChange:Wl(p),onThumbPointerUp:Wl(y),onThumbPositionChange:Z,onThumbPointerDown:Wl(v),children:o.jsx(xi.div,{...E,ref:z,style:{position:"absolute",...E.style},onPointerDown:Il(i.onPointerDown,xe=>{xe.button===0&&(xe.target.setPointerCapture(xe.pointerId),L.current=C.getBoundingClientRect(),K.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",j.viewport&&(j.viewport.style.scrollBehavior="auto"),pe(xe))}),onPointerMove:Il(i.onPointerMove,pe),onPointerUp:Il(i.onPointerUp,xe=>{const Ee=xe.target;Ee.hasPointerCapture(xe.pointerId)&&Ee.releasePointerCapture(xe.pointerId),document.body.style.webkitUserSelect=K.current,j.viewport&&(j.viewport.style.scrollBehavior=""),L.current=null})})})},"ScrollAreaScrollbarImpl")),fd="ScrollAreaThumb",fw=b.forwardRef(Ue(function(i,u){const{forceMount:c,...d}=i,m=xg(fd,i.__scopeScrollArea);return o.jsx(Xo,{present:c||m.hasThumb,children:o.jsx(mw,{ref:u,...d})})},"ScrollAreaThumb")),mw=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,style:d,...m}=i,p=on(fd,c),y=xg(fd,c),{onThumbPositionChange:v}=y,h=er(u,y.onThumbChange),S=b.useRef(void 0),g=Si(()=>{S.current&&(S.current(),S.current=void 0)},100);return b.useEffect(()=>{const w=p.viewport;if(w){const E=Ue(()=>{if(g(),!S.current){const j=gw(w,v);S.current=j,v()}},"handleScroll");return v(),w.addEventListener("scroll",E),()=>w.removeEventListener("scroll",E)}},[p.viewport,g,v]),o.jsx(xi.div,{"data-state":y.hasThumb?"visible":"hidden",...m,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...d},onPointerDownCapture:Il(i.onPointerDownCapture,w=>{const j=w.target.getBoundingClientRect(),C=w.clientX-j.left,_=w.clientY-j.top;y.onThumbPointerDown({x:C,y:_})}),onPointerUp:Il(i.onPointerUp,y.onThumbPointerUp)})},"ScrollAreaThumbImpl")),Sg="ScrollAreaCorner",hw=b.forwardRef(Ue(function(i,u){const c=on(Sg,i.__scopeScrollArea),d=!!(c.scrollbarX&&c.scrollbarY);return c.type!=="scroll"&&d?o.jsx(pw,{...i,ref:u}):null},"ScrollAreaCorner")),pw=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,...d}=i,m=on(Sg,c),[p,y]=b.useState(0),[v,h]=b.useState(0),S=!!(p&&v),{onCornerWidthChange:g,onCornerHeightChange:w}=m;return Ar(m.scrollbarX,()=>{var j;const E=((j=m.scrollbarX)==null?void 0:j.offsetHeight)||0;m.onCornerHeightChange(E),h(E)}),Ar(m.scrollbarY,()=>{var j;const E=((j=m.scrollbarY)==null?void 0:j.offsetWidth)||0;m.onCornerWidthChange(E),y(E)}),b.useEffect(()=>()=>{g(0),w(0)},[g,w]),S?o.jsx(xi.div,{...d,ref:u,style:{width:p,height:v,position:"absolute",right:m.dir==="ltr"?0:void 0,left:m.dir==="rtl"?0:void 0,bottom:0,...i.style}}):null},"ScrollAreaCornerImpl"));function hi(l){return l?parseInt(l,10):0}Ue(hi,"toInt");function Md(l,i){const u=l/i;return isNaN(u)?0:u}Ue(Md,"getThumbRatio");function bi(l){const i=Md(l.viewport,l.content),u=l.scrollbar.paddingStart+l.scrollbar.paddingEnd,c=(l.scrollbar.size-u)*i;return Math.max(c,18)}Ue(bi,"getThumbSize");function wg(l,i,u,c="ltr"){const d=bi(u),m=d/2,p=i||m,y=d-p,v=u.scrollbar.paddingStart+p,h=u.scrollbar.size-u.scrollbar.paddingEnd-y,S=u.content-u.viewport,g=c==="ltr"?[0,S]:[S*-1,0];return kd([v,h],g)(l)}Ue(wg,"getScrollPositionFromPointer");function md(l,i,u="ltr"){const c=bi(i),d=i.scrollbar.paddingStart+i.scrollbar.paddingEnd,m=i.scrollbar.size-d,p=i.content-i.viewport,y=m-c,v=u==="ltr"?[0,p]:[p*-1,0],h=hg(l,v);return kd([0,p],[0,y])(h)}Ue(md,"getThumbOffsetFromScroll");function kd(l,i){return u=>{if(l[0]===l[1]||i[0]===i[1])return i[0];const c=(i[1]-i[0])/(l[1]-l[0]);return i[0]+c*(u-l[0])}}Ue(kd,"linearScale");function Dd(l,i){return l>0&&l<i}Ue(Dd,"isScrollingWithinScrollbarBounds");var gw=Ue((l,i=()=>{})=>{let u={left:l.scrollLeft,top:l.scrollTop},c=0;return Ue((function d(){const m={left:l.scrollLeft,top:l.scrollTop},p=u.left!==m.left,y=u.top!==m.top;(p||y)&&i(),u=m,c=window.requestAnimationFrame(d)}),"loop")(),()=>window.cancelAnimationFrame(c)},"addUnlinkedScrollListener");function Si(l,i){const u=Wl(l),c=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(c.current),[]),b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(u,i)},[u,i])}Ue(Si,"useDebounceCallback");function Ar(l,i){const u=Wl(i);ud(()=>{let c=0;if(l){const d=new ResizeObserver(()=>{cancelAnimationFrame(c),c=window.requestAnimationFrame(u)});return d.observe(l),()=>{window.cancelAnimationFrame(c),d.unobserve(l)}}},[l,u])}Ue(Ar,"useResizeObserver");var vw=aw,yw=lw,xw=hw;const bw=Zp("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Jt({className:l,variant:i="default",asChild:u=!1,...c}){const d=u?Fp:"span";return o.jsx(d,{"data-slot":"badge","data-variant":i,className:Pt(bw({variant:i}),l),...c})}function qn({isConnected:l}){const{projects:i,selectedProjectId:u,setSelectedProjectId:c,projectApiKey:d}=Hn(),{apiUrl:m,token:p}=ya(),[y,v]=b.useState(!1);return b.useEffect(()=>{const h=d||p;if(!h)return;const S=async()=>{try{const w={Authorization:`Bearer ${h}`};u&&(w["x-project-id"]=u);const E=await fetch(`${m}/v1/system/metrics`,{headers:w});if(E.ok){const C=(await E.json()).streams||{},_=Math.max(...Object.values(C),0);v(_>8e3)}}catch{}};S();const g=setInterval(()=>void S(),1e4);return()=>clearInterval(g)},[m,d,u,p]),o.jsx("header",{className:"sticky top-0 z-40 w-full border-b border-border bg-background",children:o.jsxs("div",{className:"container mx-auto flex h-14 items-center justify-between px-4",children:[o.jsxs("div",{className:"flex items-center gap-2 font-bold text-lg tracking-tight",children:[o.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted text-foreground border border-border",children:o.jsx(bp,{className:"h-4 w-4 text-foreground"})}),"Notifkit ",o.jsx("span",{className:"text-muted-foreground font-normal",children:"Observability"})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[y&&o.jsxs(Jt,{variant:"destructive",className:"flex items-center gap-1.5 px-2.5 py-1 text-xs",children:[o.jsx(Go,{className:"h-3.5 w-3.5"}),"Queue Backpressure Warning (>80% Cap)"]}),i.length>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ed,{className:"h-4 w-4 text-muted-foreground"}),o.jsx("select",{className:"bg-muted border border-border text-sm rounded-md px-2.5 py-1.5 outline-none cursor-pointer text-foreground max-w-[200px] truncate",value:u,onChange:h=>c(h.target.value),children:i.map(h=>o.jsx("option",{value:h.id,children:h.name},h.id))})]}),o.jsxs(Jt,{variant:l?"default":"destructive",className:"flex items-center gap-1.5 px-3 py-1",children:[o.jsx(Nd,{className:"h-3.5 w-3.5"}),l?"Live Stream Active":"Disconnected"]})]})]})})}function Tt({className:l,...i}){return o.jsx("div",{"data-slot":"card",className:Pt("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",l),...i})}function zt({className:l,...i}){return o.jsx("div",{"data-slot":"card-header",className:Pt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",l),...i})}function _t({className:l,...i}){return o.jsx("div",{"data-slot":"card-title",className:Pt("leading-none font-semibold",l),...i})}function rn({className:l,...i}){return o.jsx("div",{"data-slot":"card-description",className:Pt("text-sm text-muted-foreground",l),...i})}function Rt({className:l,...i}){return o.jsx("div",{"data-slot":"card-content",className:Pt("px-6",l),...i})}function Sw({className:l,children:i,...u}){return o.jsxs(vw,{"data-slot":"scroll-area",className:Pt("relative",l),...u,children:[o.jsx(yw,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:i}),o.jsx(ww,{}),o.jsx(xw,{})]})}function ww({className:l,orientation:i="vertical",...u}){return o.jsx(sw,{"data-slot":"scroll-area-scrollbar",orientation:i,className:Pt("flex touch-none p-px transition-colors select-none",i==="vertical"&&"h-full w-2.5 border-l border-l-transparent",i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",l),...u,children:o.jsx(fw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function jw({setIsConnected:l}){const[i,u]=b.useState([]),{projects:c,selectedProjectId:d,projectApiKey:m,isLoadingProjects:p}=Hn(),{apiUrl:y}=ya();return b.useEffect(()=>{if(!m||!d)return;l(!1);const v=new EventSource(`${y}/v1/events/stream?token=${encodeURIComponent(m)}&projectId=${encodeURIComponent(d)}`);v.onopen=()=>{l(!0),Ge.success("Connected to real-time feed")},v.onerror=()=>{l(!1)};const h=g=>{try{const w=JSON.parse(g.data),E={id:crypto.randomUUID(),type:"delivered",taskId:w.taskId,channel:w.channel,providerMessageId:w.providerMessageId,timestamp:new Date};u(j=>[E,...j].slice(0,100))}catch(w){console.error("Failed to parse delivered event",w)}},S=g=>{try{const w=JSON.parse(g.data),E={id:crypto.randomUUID(),type:"failed",taskId:w.taskId,channel:w.channel,error:w.error,timestamp:new Date};u(j=>[E,...j].slice(0,100))}catch(w){console.error("Failed to parse failed event",w)}};return v.addEventListener("delivery:delivered",h),v.addEventListener("delivery:failed",S),()=>{v.removeEventListener("delivery:delivered",h),v.removeEventListener("delivery:failed",S),v.close()}},[y,m,d,l]),o.jsxs(Tt,{className:"h-full flex flex-col border-border bg-card",children:[o.jsxs(zt,{className:"pb-3 border-b border-border flex flex-row items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(_t,{className:"text-xl flex items-center gap-2",children:[o.jsx(Nw,{}),"Live Activity Feed"]}),o.jsx(rn,{children:"Real-time delivery events from the notification pipeline"})]}),o.jsxs("div",{className:"flex items-center gap-2 text-sm bg-muted p-1.5 rounded-md border border-border px-3",children:[o.jsx(jb,{className:"w-4 h-4 text-muted-foreground"}),o.jsx("span",{className:"text-xs font-medium text-foreground",children:"Instant Stream"})]})]}),o.jsx(Rt,{className:"flex-1 p-0 overflow-hidden",children:o.jsx(Sw,{className:"h-full min-h-[500px] w-full px-6 py-4",children:p?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"Loading projects..."})]}):c.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No projects exist. Create one in the Projects & Keys tab."})]}):m?i.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"Waiting for events..."})]}):o.jsx("div",{className:"flex flex-col gap-3",children:i.map(v=>o.jsxs("div",{className:"rounded-lg border border-border p-4 bg-card hover:bg-muted/50 transition-colors shadow-xs",children:[o.jsxs("div",{className:"flex justify-between items-start mb-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[v.type==="delivered"?o.jsx(hs,{className:"h-4 w-4 text-foreground"}):o.jsx(Yo,{className:"h-4 w-4 text-destructive"}),o.jsx("span",{className:"font-semibold text-sm capitalize",children:v.type})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:v.timestamp.toLocaleTimeString()})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm mt-3",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Channel"}),o.jsx(Jt,{variant:"secondary",className:"w-fit mt-1 text-xs capitalize font-normal",children:v.channel})]}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Task ID"}),o.jsx("span",{className:"font-mono text-xs truncate mt-1 text-foreground",children:v.taskId})]})]}),v.error&&o.jsx("div",{className:"mt-3 text-xs bg-destructive/10 text-destructive p-2.5 rounded-md border border-destructive/20 font-mono",children:v.error})]},v.id))}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No API key found for this project."})]})})})]})}function Nw(){return o.jsxs("div",{className:"relative flex h-2.5 w-2.5",children:[o.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),o.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-primary"})]})}function G0(){const[l,i]=b.useState(!1);return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:l}),o.jsx("main",{className:"flex-1 container mx-auto p-4 md:p-6",children:o.jsx("div",{className:"pb-4",children:o.jsx("div",{className:"min-h-[500px]",children:o.jsx(jw,{setIsConnected:i})})})})]})}const Ew=Zp("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ke({className:l,variant:i="default",size:u="default",asChild:c=!1,...d}){const m=c?Fp:"button";return o.jsx(m,{"data-slot":"button","data-variant":i,"data-size":u,className:Pt(Ew({variant:i,size:u,className:l})),...d})}function pi({className:l,type:i,...u}){return o.jsx("input",{type:i,"data-slot":"input",className:Pt("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",l),...u})}function Aw(){const{login:l}=ya(),[i,u]=b.useState(""),[c,d]=b.useState(""),[m,p]=b.useState(!1),[y,v]=b.useState(null),h=async S=>{if(S.preventDefault(),!i.trim()||!c){v("Please enter both your email/user ID and password.");return}p(!0),v(null);const g=await l(i.trim(),c);p(!1),g.success?Ge.success("Welcome back!",{description:"Logged in successfully."}):(v(g.error||"Invalid email/user ID or password."),Ge.error("Authentication failed",{description:g.error}))};return o.jsx("div",{className:"min-h-screen w-full flex items-center justify-center p-4 bg-background",children:o.jsxs("div",{className:"w-full max-w-md",children:[o.jsxs("div",{className:"flex flex-col items-center mb-8 text-center",children:[o.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-primary text-primary-foreground mb-4",children:o.jsx(bp,{className:"h-6 w-6"})}),o.jsx("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Notifkit Admin"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sign in to access your notification engine and observability suite."})]}),o.jsxs(Tt,{className:"border-border bg-card shadow-sm",children:[o.jsxs(zt,{className:"space-y-1 pb-4",children:[o.jsx(_t,{className:"text-lg font-semibold",children:"Admin Login"}),o.jsx(rn,{className:"text-xs",children:"Enter your admin credentials below"})]}),o.jsxs(Rt,{children:[y&&o.jsxs("div",{className:"mb-4 flex items-center gap-2 p-3 text-xs rounded-md bg-destructive/10 text-destructive border border-destructive/20",children:[o.jsx(qo,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{children:y})]}),o.jsxs("form",{onSubmit:S=>{S.preventDefault(),h(S)},className:"space-y-4",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"text-xs font-medium text-foreground flex items-center gap-1.5",children:[o.jsx(Rb,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Email or Username"]}),o.jsx(pi,{type:"text",required:!0,autoFocus:!0,placeholder:"admin@example.com",value:i,onChange:S=>u(S.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"text-xs font-medium text-foreground flex items-center gap-1.5",children:[o.jsx(ab,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Password"]}),o.jsx(pi,{type:"password",required:!0,placeholder:"••••••••••••",value:c,onChange:S=>d(S.target.value)})]}),o.jsx(Ke,{type:"submit",disabled:m,className:"w-full mt-2",children:m?o.jsxs(o.Fragment,{children:[o.jsx(mi,{className:"h-4 w-4 animate-spin mr-2"}),o.jsx("span",{children:"Signing in..."})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"Sign In"}),o.jsx(Nx,{className:"h-4 w-4 ml-2"})]})})]}),o.jsxs("div",{className:"mt-6 pt-4 border-t border-border flex items-center justify-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Eb,{className:"h-3.5 w-3.5 text-foreground"}),o.jsx("span",{children:"Protected by salted Scrypt & Redis session auth"})]})]})]})]})})}function xs({className:l,...i}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:Pt("w-full caption-bottom text-sm",l),...i})})}function bs({className:l,...i}){return o.jsx("thead",{"data-slot":"table-header",className:Pt("[&_tr]:border-b",l),...i})}function Ss({className:l,...i}){return o.jsx("tbody",{"data-slot":"table-body",className:Pt("[&_tr:last-child]:border-0",l),...i})}function qt({className:l,...i}){return o.jsx("tr",{"data-slot":"table-row",className:Pt("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",l),...i})}function Je({className:l,...i}){return o.jsx("th",{"data-slot":"table-head",className:Pt("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...i})}function ke({className:l,...i}){return o.jsx("td",{"data-slot":"table-cell",className:Pt("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...i})}function Cw(){const[l,i]=b.useState([]),[u,c]=b.useState(null),[d,m]=b.useState([null]),[p,y]=b.useState(0),[v,h]=b.useState(!1),[S,g]=b.useState(""),[w,E]=b.useState(""),[j,C]=b.useState(""),[_,z]=b.useState(null),[L,K]=b.useState([]),[ee,J]=b.useState(!1),{projects:I,selectedProjectId:Z,projectApiKey:Q,isLoadingProjects:pe}=Hn(),{apiUrl:xe}=ya(),Ee=b.useCallback(async(ne,ge,M)=>{h(!0);try{const G=new URLSearchParams({limit:"25"});M&&G.set("cursor",M),S&&G.set("search",S),w&&G.set("channel",w),j&&G.set("status",j);const re=await fetch(`${xe}/v1/notifications/logs?${G.toString()}`,{headers:{Authorization:`Bearer ${ne}`,"x-project-id":ge}});if(!re.ok)throw new Error(`Failed to fetch: ${re.statusText}`);const Se=await re.json();i(Se.logs||[]),c(Se.nextCursor||null)}catch(G){console.error(G),Ge.error("Failed to fetch logs")}finally{h(!1)}},[xe,S,w,j]);b.useEffect(()=>{Q&&Z?(m([null]),y(0),Ee(Q,Z,null)):i([])},[Q,Z,S,w,j,Ee]),b.useEffect(()=>{_&&Q&&Z?(J(!0),fetch(`${xe}/v1/notifications/${_.taskId}`,{headers:{Authorization:`Bearer ${Q}`,"x-project-id":Z}}).then(ne=>ne.ok?ne.json():null).then(ne=>{if(ne&&ne.logs){const ge=[...ne.logs].sort((M,G)=>new Date(M.timestamp).getTime()-new Date(G.timestamp).getTime());K(ge)}else K([_])}).catch(()=>K([_])).finally(()=>J(!1))):K([])},[xe,_,Q,Z]);const Re=()=>{if(u&&Q&&Z){const ne=[...d.slice(0,p+1),u];m(ne),y(p+1),Ee(Q,Z,u)}},Xe=()=>{if(p>0&&Q&&Z){const ne=d[p-1]??null;y(p-1),Ee(Q,Z,ne)}};return o.jsxs(Tt,{className:"h-full flex flex-col border-border bg-card",children:[o.jsxs(zt,{className:"pb-3 border-b border-border space-y-3",children:[o.jsxs("div",{className:"flex flex-row items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(_t,{className:"text-xl flex items-center gap-2",children:[o.jsx(wp,{className:"h-5 w-5 text-foreground"}),"Historical Dispatches & Audit Logs"]}),o.jsx(rn,{children:"Comprehensive notification audit trail with payload context"})]}),o.jsx(Ke,{variant:"outline",size:"icon",onClick:()=>{Q&&Z&&Ee(Q,Z,d[p])},disabled:v||!Q||!Z,className:"h-8 w-8 rounded-md border-border",children:o.jsx(Cr,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 pt-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Tp,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(pi,{type:"text",placeholder:"Search Task ID or Template...",value:S,onChange:ne=>g(ne.target.value),className:"pl-9 text-xs font-mono"})]}),o.jsxs("select",{value:w,onChange:ne=>E(ne.target.value),className:"px-3 py-1.5 bg-background border border-input rounded-md text-xs focus:outline-none focus:ring-1 focus:ring-ring text-foreground",children:[o.jsx("option",{value:"",children:"All Channels"}),o.jsx("option",{value:"email",children:"Email"}),o.jsx("option",{value:"sms",children:"SMS"}),o.jsx("option",{value:"push",children:"Push"})]}),o.jsxs("select",{value:j,onChange:ne=>C(ne.target.value),className:"px-3 py-1.5 bg-background border border-input rounded-md text-xs focus:outline-none focus:ring-1 focus:ring-ring text-foreground",children:[o.jsx("option",{value:"",children:"All Statuses"}),o.jsx("option",{value:"delivered",children:"Delivered"}),o.jsx("option",{value:"failed",children:"Failed"}),o.jsx("option",{value:"dispatched",children:"Dispatched"}),o.jsx("option",{value:"pending",children:"Pending"})]})]})]}),o.jsx(Rt,{className:"flex-1 p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50 sticky top-0",children:o.jsxs(qt,{children:[o.jsx(Je,{className:"font-medium",children:"Timestamp"}),o.jsx(Je,{className:"font-medium",children:"Task ID"}),o.jsx(Je,{className:"font-medium",children:"Template"}),o.jsx(Je,{className:"font-medium",children:"Channel"}),o.jsx(Je,{className:"font-medium",children:"Status"}),o.jsx(Je,{className:"font-medium text-right",children:"Details"})]})}),o.jsx(Ss,{children:pe?o.jsx(qt,{children:o.jsx(ke,{colSpan:6,className:"h-24 text-center text-muted-foreground",children:"Loading projects..."})}):I.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:6,className:"h-24 text-center text-muted-foreground",children:"No projects exist. Create one in Projects & Keys tab."})}):l.length===0&&!v?o.jsx(qt,{children:o.jsx(ke,{colSpan:6,className:"h-24 text-center text-muted-foreground",children:"No log entries match your filter."})}):Array.from(l.reduce((ne,ge)=>(ne.has(ge.taskId)?ne.get(ge.taskId).status==="dispatched"&&ge.status!=="dispatched"&&ne.set(ge.taskId,ge):ne.set(ge.taskId,ge),ne),new Map).values()).map(ne=>o.jsxs(qt,{className:"hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>z(ne),children:[o.jsx(ke,{className:"text-muted-foreground whitespace-nowrap text-xs",children:new Date(ne.timestamp).toLocaleString()}),o.jsx(ke,{className:"font-mono text-xs font-semibold text-foreground",children:ne.taskId}),o.jsx(ke,{className:"font-medium text-xs",children:ne.templateId}),o.jsx(ke,{children:o.jsx(Jt,{variant:"secondary",className:"capitalize font-normal text-xs",children:ne.channel})}),o.jsx(ke,{children:o.jsx(V0,{status:ne.status})}),o.jsx(ke,{className:"text-right",children:o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",children:o.jsx(vs,{className:"h-4 w-4"})})})]},ne.id))})]})}),o.jsxs("div",{className:"p-3 border-t border-border flex items-center justify-between text-xs text-muted-foreground bg-muted/20",children:[o.jsxs("span",{children:["Page ",p+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(Ke,{variant:"outline",size:"sm",onClick:Xe,disabled:p===0||v,className:"h-7 text-xs border-border",children:[o.jsx(Tx,{className:"h-3.5 w-3.5 mr-1"})," Previous"]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:Re,disabled:!u||v,className:"h-7 text-xs border-border",children:["Next ",o.jsx(_x,{className:"h-3.5 w-3.5 ml-1"})]})]})]}),_&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-bold text-foreground",children:"Event Lifecycle & Detail"}),o.jsxs("p",{className:"text-xs text-muted-foreground font-mono",children:["Task ID: ",_.taskId]})]}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>z(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-1.5",children:[o.jsx(Zx,{className:"h-4 w-4 text-foreground"}),"Notification Event Lifecycle"]}),ee?o.jsx("div",{className:"p-4 rounded-lg bg-muted text-xs text-muted-foreground animate-pulse",children:"Loading complete event lifecycle logs..."}):L.length===0?o.jsx("div",{className:"p-4 rounded-lg bg-muted text-xs text-muted-foreground",children:"No lifecycle history recorded."}):o.jsx("div",{className:"relative pl-6 space-y-4 before:absolute before:left-2.5 before:top-2 before:bottom-2 before:w-px before:bg-border",children:L.map(ne=>{const ge=new Date(L[0].timestamp).getTime(),G=new Date(ne.timestamp).getTime()-ge;return o.jsxs("div",{className:"relative group",children:[o.jsx("div",{className:"absolute -left-6 top-0.5 h-5 w-5 rounded-full bg-background border border-border flex items-center justify-center",children:ne.status==="delivered"?o.jsx(hs,{className:"h-3 w-3 text-foreground"}):ne.status==="failed"?o.jsx(qo,{className:"h-3 w-3 text-destructive"}):o.jsx(xb,{className:"h-2.5 w-2.5 text-muted-foreground"})}),o.jsxs("div",{className:"p-3 rounded-lg bg-muted/40 border border-border text-xs space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(V0,{status:ne.status}),o.jsx("span",{className:"font-semibold capitalize text-foreground",children:ne.kind==="attempt"?`Attempt #${ne.attempt||1}`:ne.kind})]}),o.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:G>0?`+${G}ms`:"Start"})]}),o.jsxs("div",{className:"flex items-center justify-between text-muted-foreground text-[11px]",children:[o.jsxs("span",{children:["Channel:"," ",o.jsx("strong",{className:"text-foreground capitalize",children:ne.channel})]}),o.jsx("span",{children:new Date(ne.timestamp).toLocaleTimeString()})]}),ne.providerMessageId&&o.jsxs("div",{className:"text-[11px] text-muted-foreground font-mono",children:["Provider Msg ID:"," ",o.jsx("span",{className:"text-foreground",children:ne.providerMessageId})]})]})]},ne.id)})})]}),o.jsxs("div",{className:"space-y-2 text-xs border-t border-border pt-4",children:[o.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Selected Log Record Metadata"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 p-3 rounded-lg bg-muted/40 border border-border",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Log UUID:"}),o.jsx("div",{className:"font-mono text-foreground truncate",children:_.id})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Template ID:"}),o.jsx("div",{className:"font-semibold text-foreground",children:_.templateId})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Provider Message ID:"}),o.jsx("div",{className:"font-mono text-foreground truncate",children:_.providerMessageId||"N/A"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Workflow Instance:"}),o.jsx("div",{className:"font-mono text-foreground truncate",children:_.workflowInstanceId||"Direct Send"})]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-semibold text-muted-foreground",children:"Full JSON Context"}),o.jsx("pre",{className:"mt-1 p-4 rounded-lg bg-muted border border-border text-xs font-mono overflow-x-auto text-foreground",children:JSON.stringify(_,null,2)})]})]})})]})}function V0({status:l}){let i="outline";switch(l){case"delivered":i="default";break;case"failed":i="destructive";break;case"pending":case"dispatched":i="secondary";break;case"canceled":case"skipped":i="outline";break}return o.jsx(Jt,{variant:i,className:"capitalize text-[10px] font-medium",children:l})}function Tw(){return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsx("main",{className:"flex-1 container mx-auto p-4 md:p-6",children:o.jsx("div",{className:"pb-4",children:o.jsx("div",{className:"min-h-[500px]",children:o.jsx(Cw,{})})})})]})}function zw(){var S,g,w,E,j,C;const[l,i]=b.useState(null),[u,c]=b.useState(!0),{projectApiKey:d,selectedProjectId:m}=Hn(),{apiUrl:p,token:y}=ya(),v=b.useCallback(async()=>{const _=d||y;if(!_){c(!1);return}try{const z={Authorization:`Bearer ${_}`};m&&(z["x-project-id"]=m);const L=await fetch(`${p}/v1/system/health`,{headers:z});if(!L.ok)throw new Error(`HTTP ${L.status}`);const K=await L.json();i(K)}catch(z){console.error(z),Ge.error("Failed to fetch system health")}finally{c(!1)}},[p,d,m,y]);b.useEffect(()=>{if(d||y){v();const z=setInterval(()=>void v(),5e3);return()=>clearInterval(z)}},[d,y,v]);const h=["enricher","engine","scheduler","delivery","ai","workflow","events"];return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:(l==null?void 0:l.status)==="healthy"}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(Ep,{className:"h-6 w-6 text-foreground"}),"System Infrastructure & Worker Health"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Real-time heartbeats, database/Redis latencies, and microservice status"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>{c(!0),v()},disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Redis Connection"}),o.jsx(Sb,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Rt,{children:u&&!l?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(mi,{className:"h-4 w-4 animate-spin"})," Checking..."]}):o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-2xl font-bold",children:[((S=l==null?void 0:l.redis)==null?void 0:S.latencyMs)??0," ms"]}),o.jsx(Jt,{variant:(g=l==null?void 0:l.redis)!=null&&g.ok?"default":"destructive",children:(w=l==null?void 0:l.redis)!=null&&w.ok?"Connected":"Disconnected"})]})})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"PostgreSQL Database"}),o.jsx(wp,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Rt,{children:u&&!l?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(mi,{className:"h-4 w-4 animate-spin"})," Checking..."]}):o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-2xl font-bold",children:[((E=l==null?void 0:l.db)==null?void 0:E.latencyMs)??0," ms"]}),o.jsx(Jt,{variant:(j=l==null?void 0:l.db)!=null&&j.ok?"default":"destructive",children:(C=l==null?void 0:l.db)!=null&&C.ok?"Healthy":"Unreachable"})]})})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Overall Cluster State"}),o.jsx(Hx,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Rt,{children:u&&!l?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(mi,{className:"h-4 w-4 animate-spin"})," Checking..."]}):o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-2xl font-bold capitalize",children:(l==null?void 0:l.status)??"Checking"}),o.jsx(_w,{status:l==null?void 0:l.status})]})})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsx(_t,{className:"text-lg",children:"Worker Heartbeats & Concurrency"}),o.jsx(rn,{children:"Monitored active workers in the event pipeline"})]}),o.jsx(Rt,{children:o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:h.map(_=>{var ee;const z=(ee=l==null?void 0:l.workers)==null?void 0:ee[_],L=!!(z&&z.status!=="error"&&z.status!=="unknown"&&(z.redis!==!1||z.status==="active"||z.status==="healthy"||z.state)),K=(z==null?void 0:z.state)||(z!=null&&z.status&&z.status!=="unknown"?z.status:null)||(z!=null&&z.redis?"Active":"Idle / Standby");return o.jsxs("div",{className:"p-4 rounded-lg border border-border bg-muted/40 flex flex-col justify-between space-y-3 hover:border-border transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"font-semibold text-sm capitalize",children:[_," Worker"]}),o.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${L?"bg-foreground":"bg-muted-foreground/40"}`})]}),o.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{children:"Status:"}),o.jsx("span",{className:"font-medium text-foreground capitalize",children:K})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{children:"Active Concurrency:"}),o.jsxs("span",{className:"font-mono text-foreground font-semibold",children:[(z==null?void 0:z.activeTasks)??0," tasks"]})]})]})]},_)})})})]})]})]})}function _w({status:l}){return l==="healthy"?o.jsx(hs,{className:"h-5 w-5 text-foreground"}):l==="degraded"?o.jsx(qo,{className:"h-5 w-5 text-muted-foreground"}):o.jsx(Yo,{className:"h-5 w-5 text-destructive"})}function Rw(){var S,g,w,E;const[l,i]=b.useState(null),[u,c]=b.useState(!0),{projectApiKey:d,selectedProjectId:m}=Hn(),{apiUrl:p,token:y}=ya(),v=b.useCallback(async()=>{const j=d||y;if(!j){c(!1);return}c(!0);try{const C={Authorization:`Bearer ${j}`};m&&(C["x-project-id"]=m);const _=await fetch(`${p}/v1/system/metrics`,{headers:C});if(!_.ok)throw new Error(`HTTP ${_.status}`);const z=await _.json();i(z)}catch(C){console.error(C),Ge.error("Failed to fetch analytics & queue metrics")}finally{c(!1)}},[p,d,m,y]);b.useEffect(()=>{if(d||y){v();const C=setInterval(()=>void v(),5e3);return()=>clearInterval(C)}},[d,y,v]);const h=[{key:"INBOUND_CRITICAL",label:"Inbound Critical Stream"},{key:"INBOUND_NORMAL",label:"Inbound Normal Stream"},{key:"INBOUND_LOW",label:"Inbound Low Stream"},{key:"OUTBOUND_CRITICAL",label:"Outbound Critical Stream"},{key:"OUTBOUND_NORMAL",label:"Outbound Normal Stream"},{key:"OUTBOUND_LOW",label:"Outbound Low Stream"},{key:"WORKFLOW_INBOUND",label:"Workflow Inbound Stream"},{key:"EVENTS_INBOUND",label:"Events Inbound Stream"}];return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(Sp,{className:"h-6 w-6 text-foreground"}),"Pipeline Analytics & Queue Depths"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Delivery success rate SLA, dispatch throughput, and Redis stream queue depths"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void v(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Delivery Success Rate"}),o.jsx(hs,{className:"h-4 w-4 text-foreground"})]}),o.jsxs(Rt,{children:[o.jsxs("div",{className:"text-3xl font-bold text-foreground",children:[((S=l==null?void 0:l.deliveryStats)==null?void 0:S.successRate)??100,"%"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"SLA Target > 99.0%"})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Total Dispatches"}),o.jsx(Nd,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Rt,{children:[o.jsx("div",{className:"text-3xl font-bold",children:((g=l==null?void 0:l.deliveryStats)==null?void 0:g.total)??0}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Processed across channels"})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Delivered Messages"}),o.jsx(hs,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Rt,{children:[o.jsx("div",{className:"text-3xl font-bold text-foreground",children:((w=l==null?void 0:l.deliveryStats)==null?void 0:w.delivered)??0}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Confirmed provider handoffs"})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Permanent Failures"}),o.jsx(Yo,{className:"h-4 w-4 text-destructive"})]}),o.jsxs(Rt,{children:[o.jsx("div",{className:"text-3xl font-bold text-destructive",children:((E=l==null?void 0:l.deliveryStats)==null?void 0:E.failed)??0}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Routed to DLQ"})]})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg flex items-center gap-2",children:[o.jsx(Ap,{className:"h-5 w-5 text-foreground"}),"Stream Queue Depths & Backlog Meters"]}),o.jsx(rn,{children:"Real-time item count inside Redis Streams"})]}),o.jsx(Rt,{children:o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:h.map(j=>{var L;const C=((L=l==null?void 0:l.streams)==null?void 0:L[j.key])??0,z=Math.min(100,Math.round(C/1e4*100));return o.jsxs("div",{className:"space-y-2 p-4 rounded-lg bg-muted/40 border border-border",children:[o.jsxs("div",{className:"flex justify-between items-center text-sm",children:[o.jsx("span",{className:"font-semibold text-foreground",children:j.label}),o.jsxs("span",{className:"font-mono text-xs font-bold text-muted-foreground",children:[C," items"]})]}),o.jsx("div",{className:"w-full h-2.5 rounded-full bg-muted overflow-hidden relative",children:o.jsx("div",{className:"h-full bg-primary transition-all duration-300 rounded-full",style:{width:`${Math.max(4,z)}%`}})}),o.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[o.jsx("span",{children:"0"}),o.jsx("span",{children:"Cap: 10,000"})]})]},j.key)})})})]})]})]})}function Mw(){const[l,i]=b.useState([]),[u,c]=b.useState(!0),[d,m]=b.useState(null),{projectApiKey:p,selectedProjectId:y}=Hn(),{apiUrl:v,token:h}=ya(),S=b.useCallback(async()=>{const E=p||h;if(!E){c(!1);return}c(!0);try{const j={Authorization:`Bearer ${E}`};y&&(j["x-project-id"]=y);const C=await fetch(`${v}/v1/dlq`,{headers:j});if(!C.ok)throw new Error(`HTTP ${C.status}`);const _=await C.json();i(_.messages||[])}catch(j){console.error(j),Ge.error("Failed to fetch Dead Letter Queue messages")}finally{c(!1)}},[v,p,y,h]);b.useEffect(()=>{(p||h)&&S()},[p,h,S]);const g=async E=>{const j=p||h;if(j)try{const C={"Content-Type":"application/json",Authorization:`Bearer ${j}`};if(y&&(C["x-project-id"]=y),!(await fetch(`${v}/v1/dlq/replay`,{method:"POST",headers:C,body:JSON.stringify({id:E})})).ok)throw new Error("Replay request failed");Ge.success(`Message ${E} replayed into queue`),S()}catch{Ge.error("Failed to replay message")}},w=async E=>{const j=p||h;if(j)try{const C={Authorization:`Bearer ${j}`};if(y&&(C["x-project-id"]=y),!(await fetch(`${v}/v1/dlq/${E}`,{method:"DELETE",headers:C})).ok)throw new Error("Delete failed");Ge.success(`Message ${E} purged from DLQ`),S()}catch{Ge.error("Failed to delete message")}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(Go,{className:"h-6 w-6 text-destructive"}),"Dead Letter Queue (DLQ) & Failure Diagnostics"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Inspect undeliverable messages, review failure context, and execute stream replays"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void S(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg",children:["Poison & Failed Stream Messages (",l.length,")"]}),o.jsx(rn,{children:"Messages routed to STREAMS.DEAD_LETTER after exhausting retry limits"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"Timestamp"}),o.jsx(Je,{children:"Stream Message ID"}),o.jsx(Je,{children:"Event Type"}),o.jsx(Je,{children:"Failure Reason"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:"No dead-letter messages found. Pipeline is operating smoothly!"})}):l.map(E=>o.jsxs(qt,{className:"hover:bg-muted/50",children:[o.jsx(ke,{className:"text-muted-foreground text-xs whitespace-nowrap",children:new Date(E.timestamp).toLocaleString()}),o.jsx(ke,{className:"font-mono text-xs text-foreground font-medium",children:E.id}),o.jsx(ke,{children:o.jsx(Jt,{variant:"secondary",className:"font-mono text-[11px]",children:E.eventType})}),o.jsx(ke,{className:"text-destructive text-xs truncate max-w-[250px] font-mono",children:E.error}),o.jsxs(ke,{className:"text-right space-x-1",children:[o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>m(E),children:o.jsx(vs,{className:"h-4 w-4"})}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground",onClick:()=>void g(E.id),title:"Replay Message",children:o.jsx(gb,{className:"h-4 w-4"})}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:bg-destructive/10",onClick:()=>void w(E.id),title:"Purge Message",children:o.jsx(Ad,{className:"h-4 w-4"})})]})]},E.id))})]})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-4 flex flex-col justify-between",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsx("h2",{className:"text-lg font-bold text-foreground",children:"DLQ Message Payload"}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>m(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"ID:"})," ",o.jsx("span",{className:"font-mono text-foreground font-medium",children:d.id})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Error:"})," ",o.jsx("span",{className:"font-mono text-destructive",children:d.error})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-semibold text-muted-foreground",children:"Raw Data Payload"}),o.jsx("pre",{className:"mt-1 p-4 rounded-md bg-muted border border-border text-xs font-mono overflow-x-auto text-foreground",children:JSON.stringify(d.payload,null,2)})]})]}),o.jsx("div",{className:"flex gap-2 justify-end pt-4 border-t border-border",children:o.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>{g(d.id),m(null)},children:"Replay Message"})})]})})]})}function kw(){const[l,i]=b.useState([]),[u,c]=b.useState(!0),{projectApiKey:d,selectedProjectId:m}=Hn(),{apiUrl:p}=ya(),y=b.useCallback(async()=>{c(!0);try{const h=await fetch(`${p}/v1/notifications/scheduled`,{headers:{Authorization:`Bearer ${d}`,"x-project-id":m}});if(!h.ok)throw new Error(`HTTP ${h.status}`);const S=await h.json();i(S.scheduled||[])}catch(h){console.error(h),Ge.error("Failed to fetch scheduled notifications")}finally{c(!1)}},[p,d,m]);b.useEffect(()=>{d&&m&&y()},[d,m,y]);const v=async h=>{try{if(!(await fetch(`${p}/v1/notifications/${h}`,{method:"DELETE",headers:{Authorization:`Bearer ${d}`,"x-project-id":m}})).ok)throw new Error("Cancel failed");Ge.success(`Task ${h} canceled`),y()}catch{Ge.error("Failed to cancel scheduled task")}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(fl,{className:"h-6 w-6 text-foreground"}),"Scheduled & Deferred Notification Pipeline"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Notifications queued for future timestamps or deferred due to recipient quiet hours"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void y(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg",children:["Pending Scheduled Messages (",l.length,")"]}),o.jsx(rn,{children:"Managed via Redis Sorted Sets (ZSET) and persistent storage"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"Created At"}),o.jsx(Je,{children:"Task ID"}),o.jsx(Je,{children:"Template"}),o.jsx(Je,{children:"Target"}),o.jsx(Je,{children:"Scheduled Send At"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:6,className:"h-32 text-center text-muted-foreground",children:"No pending scheduled or deferred messages found."})}):l.map(h=>{var w,E,j,C,_,z,L,K,ee;const S=(w=h.payload)==null?void 0:w.scheduledAt,g=((E=h.payload)==null?void 0:E.recipientId)||((C=(j=h.payload)==null?void 0:j.recipient)==null?void 0:C.id)||(typeof((_=h.payload)==null?void 0:_.target)=="object"?JSON.stringify((z=h.payload)==null?void 0:z.target):String(((L=h.payload)==null?void 0:L.target)||"N/A"));return o.jsxs(qt,{className:"hover:bg-muted/50",children:[o.jsx(ke,{className:"text-muted-foreground text-xs whitespace-nowrap",children:new Date(h.createdAt).toLocaleString()}),o.jsx(ke,{className:"font-mono text-xs font-semibold text-foreground max-w-[180px] truncate",title:h.taskId,children:h.taskId}),o.jsx(ke,{className:"font-medium text-xs",children:((K=h.payload)==null?void 0:K.templateId)||((ee=h.payload)==null?void 0:ee.template)||"N/A"}),o.jsx(ke,{className:"font-mono text-xs text-muted-foreground truncate max-w-[150px]",children:g}),o.jsx(ke,{children:o.jsx(Jt,{variant:"outline",className:"font-mono text-[11px]",children:S?new Date(S).toLocaleString():"Pending Dispatch"})}),o.jsx(ke,{className:"text-right",children:o.jsxs(Ke,{variant:"ghost",size:"sm",className:"h-8 text-destructive hover:bg-destructive/10",onClick:()=>void v(h.taskId),children:[o.jsx(Yo,{className:"h-4 w-4 mr-1"}),"Cancel Task"]})})]},h.taskId)})})]})})]})]})]})}function Dw(){const[l,i]=b.useState([]),[u,c]=b.useState(!0),[d,m]=b.useState(null),[p,y]=b.useState(""),[v,h]=b.useState(null),[S,g]=b.useState(!1),{projectApiKey:w,selectedProjectId:E}=Hn(),{apiUrl:j}=ya(),C=b.useCallback(async()=>{c(!0);try{const L=await fetch(`${j}/v1/workflows`,{headers:{Authorization:`Bearer ${w}`,"x-project-id":E}});if(!L.ok)throw new Error(`HTTP ${L.status}`);const K=await L.json();i(K.workflows||[])}catch(L){console.error(L),Ge.error("Failed to fetch workflows")}finally{c(!1)}},[j,w,E]);b.useEffect(()=>{w&&E&&C()},[w,E,C]);const _=async L=>{try{const K=await fetch(`${j}/v1/workflows/trigger`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`,"x-project-id":E},body:JSON.stringify({name:L,input:{}})});if(!K.ok)throw new Error("Trigger failed");const ee=await K.json();Ge.success(`Workflow "${L}" triggered! Instance ID: ${ee.instanceId}`),ee.instanceId&&(y(ee.instanceId),z(ee.instanceId))}catch{Ge.error("Failed to trigger workflow")}},z=async L=>{const K=L||p.trim();if(K){g(!0);try{const ee=await fetch(`${j}/v1/workflows/instances/${encodeURIComponent(K)}`,{headers:{Authorization:`Bearer ${w}`,"x-project-id":E}});if(!ee.ok)throw new Error("Instance not found");const J=await ee.json();h(J)}catch{Ge.error("Workflow instance not found"),h(null)}finally{g(!1)}}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(Np,{className:"h-6 w-6 text-foreground"}),"Workflows & Event Orchestration"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Multi-step notification orchestration definitions, step execution history, and instance tracing"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void C(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-3",children:[o.jsxs(_t,{className:"text-sm font-semibold flex items-center gap-2",children:[o.jsx(Tp,{className:"h-4 w-4 text-muted-foreground"}),"Workflow Instance Lookup & Step Execution Visualizer"]}),o.jsx(rn,{className:"text-xs",children:"Search by instance UUID to view step-by-step execution state and payload progress"})]}),o.jsxs(Rt,{className:"space-y-4",children:[o.jsxs("div",{className:"flex gap-2 max-w-lg",children:[o.jsx(pi,{type:"text",placeholder:"Enter Workflow Instance ID...",value:p,onChange:L=>y(L.target.value),className:"text-xs font-mono"}),o.jsx(Ke,{variant:"secondary",size:"sm",className:"text-xs",onClick:()=>void z(),disabled:S,children:S?"Searching...":"Trace Instance"})]}),v&&o.jsxs("div",{className:"p-4 rounded-lg bg-muted/40 border border-border space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Instance ID:"})," ",o.jsx("span",{className:"font-mono text-foreground font-bold",children:v.id})]}),o.jsx(Jt,{variant:v.status==="completed"?"default":"secondary",className:"capitalize",children:v.status})]}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:["Workflow Name:"," ",o.jsx("strong",{className:"text-foreground",children:v.workflowName})," | Step Pointer:"," ",o.jsx("strong",{className:"text-foreground",children:v.currentStepIndex??0})]})]})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg",children:["Registered Workflows (",l.length,")"]}),o.jsx(rn,{children:"Definitions registered for background execution"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"Created At"}),o.jsx(Je,{children:"Workflow Name"}),o.jsx(Je,{children:"Steps Count"}),o.jsx(Je,{children:"Definition Structure"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:"No registered workflows found. Register workflows using POST /v1/workflows"})}):l.map(L=>o.jsxs(qt,{className:"hover:bg-muted/50",children:[o.jsx(ke,{className:"text-muted-foreground text-xs whitespace-nowrap",children:new Date(L.createdAt).toLocaleString()}),o.jsx(ke,{className:"font-bold text-sm font-mono text-foreground",children:L.name}),o.jsx(ke,{children:o.jsxs(Jt,{variant:"secondary",className:"font-mono text-[11px]",children:[Array.isArray(L.steps)?L.steps.length:0," steps"]})}),o.jsx(ke,{className:"font-mono text-xs text-muted-foreground truncate max-w-[300px]",children:JSON.stringify(L.steps)}),o.jsxs(ke,{className:"text-right space-x-2",children:[o.jsxs(Ke,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:()=>m(L),children:[o.jsx(vs,{className:"h-4 w-4 mr-1"}),"View Diagram"]}),o.jsxs(Ke,{variant:"outline",size:"sm",className:"h-8",onClick:()=>void _(L.name),children:[o.jsx(ub,{className:"h-3.5 w-3.5 mr-1"}),"Trigger Now"]})]})]},L.id))})]})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"text-lg font-bold text-foreground",children:["Workflow Diagram: ",d.name]}),o.jsxs("p",{className:"text-xs text-muted-foreground font-mono",children:["ID: ",d.id]})]}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>m(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-1.5",children:[o.jsx(Ap,{className:"h-4 w-4 text-foreground"}),"Execution Step Graph Flow"]}),o.jsx("div",{className:"space-y-3 relative pl-4 before:absolute before:left-2 before:top-2 before:bottom-2 before:w-px before:bg-border",children:(d.steps||[]).map((L,K)=>o.jsxs("div",{className:"p-3 rounded-lg bg-muted/40 border border-border text-xs space-y-1",children:[o.jsxs("div",{className:"flex items-center justify-between font-semibold",children:[o.jsxs("span",{className:"text-foreground",children:["Step ",K+1,": ",L.type||L.name||"Action"]}),o.jsx(Jt,{variant:"outline",className:"text-[10px] font-mono",children:L.channel||L.action||"Step Node"})]}),o.jsx("pre",{className:"text-[11px] text-muted-foreground overflow-x-auto font-mono",children:JSON.stringify(L,null,2)})]},K))})]})]})})]})}function Ow(){const[l,i]=b.useState([]),[u,c]=b.useState(!0),[d,m]=b.useState(null),{projectApiKey:p,selectedProjectId:y}=Hn(),{apiUrl:v}=ya(),h=b.useCallback(async()=>{c(!0);try{const g=await fetch(`${v}/v1/templates`,{headers:{Authorization:`Bearer ${p}`,"x-project-id":y}});if(!g.ok)throw new Error(`HTTP ${g.status}`);const w=await g.json();i(w.templates||[])}catch(g){console.error(g),Ge.error("Failed to fetch templates")}finally{c(!1)}},[v,p,y]);b.useEffect(()=>{p&&y&&h()},[p,y,h]);const S=async g=>{try{if(!(await fetch(`${v}/v1/templates/${g}`,{method:"DELETE",headers:{Authorization:`Bearer ${p}`,"x-project-id":y}})).ok)throw new Error("Delete failed");Ge.success(`Template ${g} deleted`),h()}catch{Ge.error("Failed to delete template")}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(jp,{className:"h-6 w-6 text-foreground"}),"Template Directory & Channel Bindings"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Registered notification templates, topic bindings, and AI prompts"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void h(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg",children:["Notification Templates (",l.length,")"]}),o.jsx(rn,{children:"Managed via PUT /v1/templates API endpoint"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"Template ID"}),o.jsx(Je,{children:"Channel"}),o.jsx(Je,{children:"Topics"}),o.jsx(Je,{children:"Last Updated"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:"No templates synced for this project. Sync using initializeApp() or PUT /v1/templates"})}):l.map(g=>o.jsxs(qt,{className:"hover:bg-muted/50",children:[o.jsx(ke,{className:"font-mono text-sm font-bold text-foreground",children:g.id}),o.jsx(ke,{children:o.jsx(Jt,{variant:"secondary",className:"capitalize font-normal text-xs",children:g.channel})}),o.jsx(ke,{children:o.jsx("div",{className:"flex gap-1 flex-wrap",children:(g.topics||[]).map(w=>o.jsx(Jt,{variant:"outline",className:"text-[10px]",children:w},w))})}),o.jsx(ke,{className:"text-muted-foreground text-xs whitespace-nowrap",children:new Date(g.updatedAt).toLocaleString()}),o.jsxs(ke,{className:"text-right space-x-1",children:[o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>m(g),children:o.jsx(vs,{className:"h-4 w-4"})}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:bg-destructive/10",onClick:()=>void S(g.id),children:o.jsx(Ad,{className:"h-4 w-4"})})]})]},g.id))})]})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsxs("h2",{className:"text-lg font-bold text-foreground",children:["Template: ",d.id]}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>m(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Channel:"})," ",o.jsx("span",{className:"font-semibold capitalize text-foreground",children:d.channel})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Topics:"})," ",o.jsx("span",{className:"font-mono text-foreground",children:(d.topics||[]).join(", ")})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-semibold text-muted-foreground",children:"Template Content"}),o.jsx("pre",{className:"mt-1 p-4 rounded-md bg-muted border border-border text-xs font-mono overflow-x-auto text-foreground",children:JSON.stringify(d.content,null,2)})]})]})})]})}function Uw(){var E;const[l,i]=b.useState([]),[u,c]=b.useState(!1),[d,m]=b.useState(null),{projects:p,selectedProjectId:y,projectApiKey:v,isLoadingProjects:h}=Hn(),{apiUrl:S}=ya(),g=b.useCallback(async(j,C)=>{c(!0);try{const _=await fetch(`${S}/v1/users`,{headers:{Authorization:`Bearer ${j}`,"x-project-id":C}});if(_.ok){const z=await _.json();i(z.users||[])}else Ge.error("Failed to load users")}catch(_){console.error(_),Ge.error("Failed to load users")}finally{c(!1)}},[S]);b.useEffect(()=>{v&&y?g(v,y):i([])},[v,y,g]);const w=async j=>{const C=j.externalId||j.userId||j.id;if(C)try{const _=await fetch(`${S}/v1/users/${encodeURIComponent(C)}/details`,{headers:{Authorization:`Bearer ${v}`,"x-project-id":y}});if(_.ok){const z=await _.json();m(z)}else m({...j,contacts:[],logs:[]})}catch{m({...j,contacts:[],logs:[]})}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsx("div",{className:"flex justify-between items-center",children:o.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[o.jsx(zp,{className:"w-6 h-6 text-foreground"}),"User Directory & Contact Preferences"]})}),o.jsxs(Tt,{className:"bg-card border-border",children:[o.jsxs(zt,{children:[o.jsx(_t,{children:"Registered End-Users"}),o.jsx(rn,{children:"Recipient profiles, channel addresses, and preference overrides"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:h?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"Loading projects..."})]}):p.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No projects exist. Create one in the Projects & Keys tab."})]}):v?u?o.jsx("div",{className:"text-muted-foreground text-sm p-6 text-center",children:"Loading users..."}):l.length===0?o.jsx("div",{className:"text-muted-foreground text-sm text-center p-8",children:"No users found."}):o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"External User ID"}),o.jsx(Je,{children:"Primary Contact"}),o.jsx(Je,{children:"Created At"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.map((j,C)=>{const _=j.externalId||j.userId||j.id||`user-${C}`;return o.jsxs(qt,{className:"hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>void w(j),children:[o.jsx(ke,{className:"font-mono font-bold text-foreground",children:_}),o.jsx(ke,{className:"text-muted-foreground",children:j.email?j.email:o.jsx("span",{className:"italic opacity-50",children:"Not provided"})}),o.jsx(ke,{className:"text-muted-foreground text-xs",children:new Date(j.createdAt).toLocaleDateString()}),o.jsx(ke,{className:"text-right",children:o.jsxs(Ke,{variant:"outline",size:"sm",className:"h-7",onClick:z=>{z.stopPropagation(),w(j)},children:[o.jsx(vs,{className:"h-3.5 w-3.5 mr-1"})," View Profile"]})})]},_)})})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No API key found for this project."})]})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"text-xl font-bold font-mono text-foreground",children:["User: ",d.externalId||d.userId||d.id]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Registered contact endpoints and preferences"})]}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>m(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[o.jsx(sb,{className:"h-4 w-4 text-muted-foreground"}),"Contact Channels (",((E=d.contacts)==null?void 0:E.length)??0,")"]}),!d.contacts||d.contacts.length===0?o.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No contact endpoints registered for this user."}):o.jsx("div",{className:"space-y-2",children:d.contacts.map(j=>o.jsxs("div",{className:"p-3 rounded-md bg-muted/40 border border-border flex items-center justify-between text-xs",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Jt,{variant:"outline",className:"capitalize font-mono text-[10px]",children:j.channel}),o.jsx("span",{className:"font-mono text-foreground",children:j.target})]}),o.jsx(Jt,{variant:j.enabled!==!1?"default":"destructive",children:j.enabled!==!1?"Active":"Opted-out"})]},j.id))})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[o.jsx(Cp,{className:"h-4 w-4 text-muted-foreground"}),"Per-User Delivery Audit Trail"]}),!d.logs||d.logs.length===0?o.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No recent notifications logged for this user."}):o.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:d.logs.map(j=>o.jsxs("div",{className:"p-2.5 rounded-md bg-muted/40 border border-border flex items-center justify-between text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-mono text-foreground font-semibold",children:j.taskId}),o.jsxs("span",{className:"text-muted-foreground ml-2",children:["(",j.templateId,")"]})]}),o.jsx(Jt,{variant:"secondary",className:"capitalize text-[10px]",children:j.status})]},j.id))})]})]})})]})}function Lw(){const{apiUrl:l,token:i}=ya(),[u,c]=b.useState([]),[d,m]=b.useState(!0),[p,y]=b.useState(""),[v,h]=b.useState(null),[S,g]=b.useState([]),[w,E]=b.useState(null),[j,C]=b.useState(!1),_=async()=>{try{const J=await fetch(`${l}/v1/projects`,{headers:{Authorization:`Bearer ${i}`}});if(J.ok){const I=await J.json();c(I.projects||[])}}catch(J){console.error(J),Ge.error("Failed to load projects")}finally{m(!1)}},z=async J=>{try{const I=await fetch(`${l}/v1/projects/${J}/keys`,{headers:{Authorization:`Bearer ${i}`}});if(I.ok){const Z=await I.json();g(Z.keys||[])}}catch(I){console.error(I),Ge.error("Failed to load API keys")}};b.useEffect(()=>{_()},[]),b.useEffect(()=>{v?(z(v),E(null),C(!1)):g([])},[v]);const L=async J=>{if(J.preventDefault(),!!p.trim())try{const I=await fetch(`${l}/v1/projects`,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify({name:p})});if(I.ok){const Z=await I.json();Ge.success("Project created!"),y(""),_(),Z.apiKey&&(E(Z.apiKey),C(!1))}else{const Z=await I.json();Ge.error(`Error: ${Z.message||"Failed to create project"}`)}}catch{Ge.error("Failed to create project")}},K=async()=>{if(v)try{const J=await fetch(`${l}/v1/projects/${v}/keys`,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify({role:"admin"})});if(J.ok){const I=await J.json();E(I.apiKey),C(!1),Ge.success("New API Key generated successfully"),z(v)}else Ge.error("Failed to generate key")}catch{Ge.error("Failed to generate key")}},ee=async J=>{if(v&&confirm("Are you sure you want to revoke this API key? Systems using it will immediately stop working."))try{(await fetch(`${l}/v1/projects/${v}/keys/${J}`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}})).ok?(Ge.success("API Key revoked"),z(v)):Ge.error("Failed to revoke key")}catch{Ge.error("Failed to revoke key")}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6",children:[o.jsx("div",{className:"flex justify-between items-center mb-6",children:o.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[o.jsx(Ed,{className:"w-6 h-6 text-foreground"}),"Projects & API Keys"]})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[o.jsxs(Tt,{className:"lg:col-span-1 bg-card border-border h-fit",children:[o.jsxs(zt,{children:[o.jsx(_t,{children:"Create Project"}),o.jsx(rn,{children:"Add a new tenant to Notifkit"})]}),o.jsx(Rt,{children:o.jsxs("form",{onSubmit:J=>{L(J)},className:"space-y-4",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("label",{htmlFor:"name",className:"text-sm font-medium",children:"Project Name"}),o.jsx(pi,{id:"name",type:"text",value:p,onChange:J=>y(J.target.value),placeholder:"My Project"})]}),o.jsxs(Ke,{type:"submit",className:"w-full gap-2",children:[o.jsx(fb,{className:"w-4 h-4"}),"Create"]})]})})]}),o.jsxs(Tt,{className:"lg:col-span-2 bg-card border-border",children:[o.jsx(zt,{children:o.jsx(_t,{children:"Existing Projects"})}),o.jsxs(Rt,{children:[d?o.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading projects..."}):u.length===0?o.jsx("div",{className:"text-muted-foreground text-sm text-center py-8",children:"No projects found. Create one to get started."}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-3 text-xs font-semibold text-muted-foreground uppercase pb-2 border-b border-border",children:[o.jsx("div",{children:"Name"}),o.jsx("div",{children:"Rate Limit"}),o.jsx("div",{children:"Created"})]}),u.map(J=>o.jsxs("div",{className:`grid grid-cols-3 text-sm py-2 px-3 rounded-md cursor-pointer transition-colors ${v===J.id?"bg-muted text-foreground border border-border":"hover:bg-muted/50"}`,onClick:()=>h(J.id),children:[o.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:[J.name,v===J.id&&o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-foreground"})]}),o.jsx("div",{className:"text-muted-foreground font-mono text-xs flex flex-col gap-1 justify-center",children:o.jsx("span",{children:J.rateLimitRpm?`${J.rateLimitRpm} RPM`:"600 RPM"})}),o.jsx("div",{className:"text-muted-foreground text-xs",children:new Date(J.createdAt).toLocaleDateString()})]},J.id))]}),v&&o.jsxs("div",{className:"mt-8 pt-6 border-t border-border",children:[o.jsxs("div",{className:"flex justify-between items-center mb-4",children:[o.jsx("h3",{className:"font-semibold text-base",children:"API Keys"}),o.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>{K()},children:"Generate New Key"})]}),w&&o.jsxs("div",{className:"mb-6 p-4 rounded-lg bg-muted border border-border space-y-3",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(qo,{className:"w-4 h-4 mt-0.5 text-foreground"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm text-foreground",children:"Please copy your new API key"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"For security reasons, this key will not be shown again. Make sure to copy it now."})]})]}),o.jsxs("div",{className:"flex items-center gap-2 bg-background rounded-md p-2 border border-border",children:[o.jsx("code",{className:"flex-1 text-xs font-mono break-all text-foreground",children:j?w:w.replace(new RegExp("(?<=^nk_live_).*"),"********************************")}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>C(!j),children:j?o.jsx(Yx,{className:"w-4 h-4"}):o.jsx(vs,{className:"w-4 h-4"})}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>{navigator.clipboard.writeText(w),Ge.success("Copied to clipboard!")},children:o.jsx(Ux,{className:"w-4 h-4"})})]})]}),S.length===0?o.jsx("div",{className:"text-sm text-muted-foreground",children:"No API keys found for this project."}):o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"grid grid-cols-4 text-xs font-semibold text-muted-foreground uppercase pb-2",children:[o.jsx("div",{className:"col-span-2",children:"Key ID"}),o.jsx("div",{children:"Role"}),o.jsx("div",{className:"text-right",children:"Actions"})]}),S.map(J=>o.jsxs("div",{className:"grid grid-cols-4 text-sm py-2 items-center group",children:[o.jsx("div",{className:"col-span-2 font-mono text-muted-foreground truncate pr-4 text-xs",children:J.id}),o.jsx("div",{className:"capitalize text-muted-foreground text-xs",children:J.role}),o.jsx("div",{className:"text-right",children:o.jsxs(Ke,{variant:"ghost",size:"sm",className:"h-8 text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{ee(J.id)},children:[o.jsx(Ad,{className:"w-4 h-4 mr-1.5"}),"Revoke"]})})]},J.id))]})]})]})]})]})]})]})}function Hw(){return o.jsxs("div",{className:"h-screen flex bg-background text-foreground overflow-hidden",children:[o.jsx(E1,{}),o.jsx("main",{className:"flex-1 overflow-y-auto",children:o.jsxs(ky,{children:[o.jsx(Ua,{path:"/",element:o.jsx(G0,{})}),o.jsx(Ua,{path:"/login",element:o.jsx(Aw,{})}),o.jsx(Ua,{path:"/logs",element:o.jsx(Tw,{})}),o.jsx(Ua,{path:"/system",element:o.jsx(zw,{})}),o.jsx(Ua,{path:"/analytics",element:o.jsx(Rw,{})}),o.jsx(Ua,{path:"/dlq",element:o.jsx(Mw,{})}),o.jsx(Ua,{path:"/scheduled",element:o.jsx(kw,{})}),o.jsx(Ua,{path:"/workflows",element:o.jsx(Dw,{})}),o.jsx(Ua,{path:"/templates",element:o.jsx(Ow,{})}),o.jsx(Ua,{path:"/users",element:o.jsx(Uw,{})}),o.jsx(Ua,{path:"/projects",element:o.jsx(Lw,{})}),o.jsx(Ua,{path:"*",element:o.jsx(G0,{})})]})}),o.jsx(nS,{theme:"dark"})]})}const Bw=window.location.pathname.startsWith("/admin")?"/admin":"/";kv.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(nx,{basename:Bw,children:o.jsx(hx,{children:o.jsx(px,{children:o.jsx(Hw,{})})})})}));
|
|
310
|
+
*/const Mb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],zp=Ce("users",Mb);function _p(l){var i,u,c="";if(typeof l=="string"||typeof l=="number")c+=l;else if(typeof l=="object")if(Array.isArray(l)){var d=l.length;for(i=0;i<d;i++)l[i]&&(u=_p(l[i]))&&(c&&(c+=" "),c+=u)}else for(u in l)l[u]&&(c&&(c+=" "),c+=u);return c}function Rp(){for(var l,i,u=0,c="",d=arguments.length;u<d;u++)(l=arguments[u])&&(i=_p(l))&&(c&&(c+=" "),c+=i);return c}const kb=(l,i)=>{const u=new Array(l.length+i.length);for(let c=0;c<l.length;c++)u[c]=l[c];for(let c=0;c<i.length;c++)u[l.length+c]=i[c];return u},Db=(l,i)=>({classGroupId:l,validator:i}),Mp=(l=new Map,i=null,u)=>({nextPart:l,validators:i,classGroupId:u}),Oo="-",z0=[],Ob="arbitrary..",Ub=l=>{const i=Hb(l),{conflictingClassGroups:u,conflictingClassGroupModifiers:c}=l;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return Lb(p);const y=p.split(Oo),v=y[0]===""&&y.length>1?1:0;return kp(y,v,i)},getConflictingClassGroupIds:(p,y)=>{if(y){const v=c[p],h=u[p];return v?h?kb(h,v):v:h||z0}return u[p]||z0}}},kp=(l,i,u)=>{if(l.length-i===0)return u.classGroupId;const d=l[i],m=u.nextPart.get(d);if(m){const h=kp(l,i+1,m);if(h)return h}const p=u.validators;if(p===null)return;const y=i===0?l.join(Oo):l.slice(i).join(Oo),v=p.length;for(let h=0;h<v;h++){const S=p[h];if(S.validator(y))return S.classGroupId}},Lb=l=>l.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=l.slice(1,-1),u=i.indexOf(":"),c=i.slice(0,u);return c?Ob+c:void 0})(),Hb=l=>{const{theme:i,classGroups:u}=l;return Bb(u,i)},Bb=(l,i)=>{const u=Mp();for(const c in l){const d=l[c];Cd(d,u,c,i)}return u},Cd=(l,i,u,c)=>{const d=l.length;for(let m=0;m<d;m++){const p=l[m];qb(p,i,u,c)}},qb=(l,i,u,c)=>{if(typeof l=="string"){Yb(l,i,u);return}if(typeof l=="function"){Gb(l,i,u,c);return}Vb(l,i,u,c)},Yb=(l,i,u)=>{const c=l===""?i:Dp(i,l);c.classGroupId=u},Gb=(l,i,u,c)=>{if(Xb(l)){Cd(l(c),i,u,c);return}i.validators===null&&(i.validators=[]),i.validators.push(Db(u,l))},Vb=(l,i,u,c)=>{const d=Object.entries(l),m=d.length;for(let p=0;p<m;p++){const[y,v]=d[p];Cd(v,Dp(i,y),u,c)}},Dp=(l,i)=>{let u=l;const c=i.split(Oo),d=c.length;for(let m=0;m<d;m++){const p=c[m];let y=u.nextPart.get(p);y||(y=Mp(),u.nextPart.set(p,y)),u=y}return u},Xb=l=>"isThemeGetter"in l&&l.isThemeGetter===!0,Qb=l=>{if(l<1)return{get:()=>{},set:()=>{}};let i=0,u=Object.create(null),c=Object.create(null);const d=(m,p)=>{u[m]=p,i++,i>l&&(i=0,c=u,u=Object.create(null))};return{get(m){let p=u[m];if(p!==void 0)return p;if((p=c[m])!==void 0)return d(m,p),p},set(m,p){m in u?u[m]=p:d(m,p)}}},nd="!",_0=":",Zb=[],R0=(l,i,u,c,d)=>({modifiers:l,hasImportantModifier:i,baseClassName:u,maybePostfixModifierPosition:c,isExternal:d}),Kb=l=>{const{prefix:i,experimentalParseClassName:u}=l;let c=d=>{const m=[];let p=0,y=0,v=0,h;const S=d.length;for(let C=0;C<S;C++){const _=d[C];if(p===0&&y===0){if(_===_0){m.push(d.slice(v,C)),v=C+1;continue}if(_==="/"){h=C;continue}}_==="["?p++:_==="]"?p--:_==="("?y++:_===")"&&y--}const g=m.length===0?d:d.slice(v);let w=g,E=!1;g.endsWith(nd)?(w=g.slice(0,-1),E=!0):g.startsWith(nd)&&(w=g.slice(1),E=!0);const j=h&&h>v?h-v:void 0;return R0(m,E,w,j)};if(i){const d=i+_0,m=c;c=p=>p.startsWith(d)?m(p.slice(d.length)):R0(Zb,!1,p,void 0,!0)}if(u){const d=c;c=m=>u({className:m,parseClassName:d})}return c},$b=l=>{const i=new Map;return l.orderSensitiveModifiers.forEach((u,c)=>{i.set(u,1e6+c)}),u=>{const c=[];let d=[];for(let m=0;m<u.length;m++){const p=u[m],y=p[0]==="[",v=i.has(p);y||v?(d.length>0&&(d.sort(),c.push(...d),d=[]),c.push(p)):d.push(p)}return d.length>0&&(d.sort(),c.push(...d)),c}},Jb=l=>({cache:Qb(l.cacheSize),parseClassName:Kb(l),sortModifiers:$b(l),postfixLookupClassGroupIds:Wb(l),...Ub(l)}),Wb=l=>{const i=Object.create(null),u=l.postfixLookupClassGroups;if(u)for(let c=0;c<u.length;c++)i[u[c]]=!0;return i},Ib=/\s+/,Fb=(l,i)=>{const{parseClassName:u,getClassGroupId:c,getConflictingClassGroupIds:d,sortModifiers:m,postfixLookupClassGroupIds:p}=i,y=[],v=l.trim().split(Ib);let h="";for(let S=v.length-1;S>=0;S-=1){const g=v[S],{isExternal:w,modifiers:E,hasImportantModifier:j,baseClassName:C,maybePostfixModifierPosition:_}=u(g);if(w){h=g+(h.length>0?" "+h:h);continue}let z=!!_,L;if(z){const Z=C.substring(0,_);L=c(Z);const Q=L&&p[L]?c(C):void 0;Q&&Q!==L&&(L=Q,z=!1)}else L=c(C);if(!L){if(!z){h=g+(h.length>0?" "+h:h);continue}if(L=c(C),!L){h=g+(h.length>0?" "+h:h);continue}z=!1}const K=E.length===0?"":E.length===1?E[0]:m(E).join(":"),ee=j?K+nd:K,J=ee+L;if(y.indexOf(J)>-1)continue;y.push(J);const I=d(L,z);for(let Z=0;Z<I.length;++Z){const Q=I[Z];y.push(ee+Q)}h=g+(h.length>0?" "+h:h)}return h},Pb=(...l)=>{let i=0,u,c,d="";for(;i<l.length;)(u=l[i++])&&(c=Op(u))&&(d&&(d+=" "),d+=c);return d},Op=l=>{if(typeof l=="string")return l;let i,u="";for(let c=0;c<l.length;c++)l[c]&&(i=Op(l[c]))&&(u&&(u+=" "),u+=i);return u},e1=(l,...i)=>{let u,c,d,m;const p=v=>{const h=i.reduce((S,g)=>g(S),l());return u=Jb(h),c=u.cache.get,d=u.cache.set,m=y,y(v)},y=v=>{const h=c(v);if(h)return h;const S=Fb(v,u);return d(v,S),S};return m=p,(...v)=>m(Pb(...v))},t1=[],Bt=l=>{const i=u=>u[l]||t1;return i.isThemeGetter=!0,i},Up=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,a1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,n1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,l1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,r1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,s1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jl=l=>a1.test(l),_e=l=>!!l&&!Number.isNaN(Number(l)),Dn=l=>!!l&&Number.isInteger(Number(l)),Fu=l=>l.endsWith("%")&&_e(l.slice(0,-1)),dl=l=>n1.test(l),Hp=()=>!0,o1=l=>l1.test(l)&&!r1.test(l),Td=()=>!1,c1=l=>s1.test(l),u1=l=>i1.test(l),d1=l=>!se(l)&&!ie(l),f1=l=>l.startsWith("@container")&&(l[10]==="/"&&l[11]!==void 0||l[11]==="s"&&l[16]!==void 0&&l.startsWith("-size/",10)||l[11]==="n"&&l[18]!==void 0&&l.startsWith("-normal/",10)),m1=l=>Pl(l,Yp,Td),se=l=>Up.test(l),jr=l=>Pl(l,Gp,o1),M0=l=>Pl(l,S1,_e),h1=l=>Pl(l,Xp,Hp),p1=l=>Pl(l,Vp,Td),k0=l=>Pl(l,Bp,Td),g1=l=>Pl(l,qp,u1),To=l=>Pl(l,Qp,c1),ie=l=>Lp.test(l),fi=l=>Tr(l,Gp),v1=l=>Tr(l,Vp),D0=l=>Tr(l,Bp),y1=l=>Tr(l,Yp),x1=l=>Tr(l,qp),zo=l=>Tr(l,Qp,!0),b1=l=>Tr(l,Xp,!0),Pl=(l,i,u)=>{const c=Up.exec(l);return c?c[1]?i(c[1]):u(c[2]):!1},Tr=(l,i,u=!1)=>{const c=Lp.exec(l);return c?c[1]?i(c[1]):u:!1},Bp=l=>l==="position"||l==="percentage",qp=l=>l==="image"||l==="url",Yp=l=>l==="length"||l==="size"||l==="bg-size",Gp=l=>l==="length",S1=l=>l==="number",Vp=l=>l==="family-name",Xp=l=>l==="number"||l==="weight",Qp=l=>l==="shadow",w1=()=>{const l=Bt("color"),i=Bt("font"),u=Bt("text"),c=Bt("font-weight"),d=Bt("tracking"),m=Bt("leading"),p=Bt("breakpoint"),y=Bt("container"),v=Bt("spacing"),h=Bt("radius"),S=Bt("shadow"),g=Bt("inset-shadow"),w=Bt("text-shadow"),E=Bt("drop-shadow"),j=Bt("blur"),C=Bt("perspective"),_=Bt("aspect"),z=Bt("ease"),L=Bt("animate"),K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],J=()=>[...ee(),ie,se],I=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto","contain","none"],Q=()=>[ie,se,v],pe=()=>[Jl,"full","auto",...Q()],xe=()=>[Dn,"none","subgrid",ie,se],Ee=()=>["auto",{span:["full",Dn,ie,se]},Dn,ie,se],Re=()=>[Dn,"auto",ie,se],Xe=()=>["auto","min","max","fr",ie,se],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...Q()],G=()=>[Jl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Q()],re=()=>[Jl,"screen","full","dvw","lvw","svw","min","max","fit",...Q()],Se=()=>[Jl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Q()],W=()=>[l,ie,se],A=()=>[...ee(),D0,k0,{position:[ie,se]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",y1,m1,{size:[ie,se]}],P=()=>[Fu,fi,jr],te=()=>["","none","full",h,ie,se],le=()=>["",_e,fi,jr],je=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[_e,Fu,D0,k0],ea=()=>["","none",j,ie,se],Wt=()=>["none",_e,ie,se],dt=()=>["none",_e,ie,se],xa=()=>[_e,ie,se],Mt=()=>[Jl,"full",...Q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[dl],breakpoint:[dl],color:[Hp],container:[dl],"drop-shadow":[dl],ease:["in","out","in-out"],font:[d1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[dl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[dl],shadow:[dl],spacing:["px",_e],text:[dl],"text-shadow":[dl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jl,se,ie,_]}],container:["container"],"container-type":[{"@container":["","normal","size",ie,se]}],"container-named":[f1],columns:[{columns:[_e,se,ie,y]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:J()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:pe()}],"inset-x":[{"inset-x":pe()}],"inset-y":[{"inset-y":pe()}],start:[{"inset-s":pe(),start:pe()}],end:[{"inset-e":pe(),end:pe()}],"inset-bs":[{"inset-bs":pe()}],"inset-be":[{"inset-be":pe()}],top:[{top:pe()}],right:[{right:pe()}],bottom:[{bottom:pe()}],left:[{left:pe()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",ie,se]}],basis:[{basis:[Jl,"full","auto",y,...Q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Jl,"auto","initial","none",se]}],grow:[{grow:["",_e,ie,se]}],shrink:[{shrink:["",_e,ie,se]}],order:[{order:[Dn,"first","last","none",ie,se]}],"grid-cols":[{"grid-cols":xe()}],"col-start-end":[{col:Ee()}],"col-start":[{"col-start":Re()}],"col-end":[{"col-end":Re()}],"grid-rows":[{"grid-rows":xe()}],"row-start-end":[{row:Ee()}],"row-start":[{"row-start":Re()}],"row-end":[{"row-end":Re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Xe()}],"auto-rows":[{"auto-rows":Xe()}],gap:[{gap:Q()}],"gap-x":[{"gap-x":Q()}],"gap-y":[{"gap-y":Q()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:Q()}],px:[{px:Q()}],py:[{py:Q()}],ps:[{ps:Q()}],pe:[{pe:Q()}],pbs:[{pbs:Q()}],pbe:[{pbe:Q()}],pt:[{pt:Q()}],pr:[{pr:Q()}],pb:[{pb:Q()}],pl:[{pl:Q()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":Q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Q()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...Se()]}],"min-block-size":[{"min-block":["auto",...Se()]}],"max-block-size":[{"max-block":["none",...Se()]}],w:[{w:[y,"screen",...G()]}],"min-w":[{"min-w":[y,"screen","none",...G()]}],"max-w":[{"max-w":[y,"screen","none","prose",{screen:[p]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",u,fi,jr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,b1,h1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fu,se]}],"font-family":[{font:[v1,p1,i]}],"font-features":[{"font-features":[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,ie,se]}],"line-clamp":[{"line-clamp":[_e,"none",ie,M0]}],leading:[{leading:[m,...Q()]}],"list-image":[{"list-image":["none",ie,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ie,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ie,jr]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[_e,"auto",ie,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Q()}],"tab-size":[{tab:[Dn,ie,se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,ie,se],radial:["",ie,se],conic:[Dn,ie,se]},x1,g1]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...je(),"hidden","none"]}],"divide-style":[{divide:[...je(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...je(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ie,se]}],"outline-w":[{outline:["",_e,fi,jr]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",S,zo,To]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",g,zo,To]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[_e,jr]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",w,zo,To]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[_e,ie,se]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[ie,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":ee()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ie,se]}],filter:[{filter:["","none",ie,se]}],blur:[{blur:ea()}],brightness:[{brightness:[_e,ie,se]}],contrast:[{contrast:[_e,ie,se]}],"drop-shadow":[{"drop-shadow":["","none",E,zo,To]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",_e,ie,se]}],"hue-rotate":[{"hue-rotate":[_e,ie,se]}],invert:[{invert:["",_e,ie,se]}],saturate:[{saturate:[_e,ie,se]}],sepia:[{sepia:["",_e,ie,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ie,se]}],"backdrop-blur":[{"backdrop-blur":ea()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ie,se]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ie,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ie,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ie,se]}],"backdrop-invert":[{"backdrop-invert":["",_e,ie,se]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ie,se]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ie,se]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ie,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Q()}],"border-spacing-x":[{"border-spacing-x":Q()}],"border-spacing-y":[{"border-spacing-y":Q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ie,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ie,se]}],ease:[{ease:["linear","initial",z,ie,se]}],delay:[{delay:[_e,ie,se]}],animate:[{animate:["none",L,ie,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ie,se]}],"perspective-origin":[{"perspective-origin":J()}],rotate:[{rotate:Wt()}],"rotate-x":[{"rotate-x":Wt()}],"rotate-y":[{"rotate-y":Wt()}],"rotate-z":[{"rotate-z":Wt()}],scale:[{scale:dt()}],"scale-x":[{"scale-x":dt()}],"scale-y":[{"scale-y":dt()}],"scale-z":[{"scale-z":dt()}],"scale-3d":["scale-3d"],skew:[{skew:xa()}],"skew-x":[{"skew-x":xa()}],"skew-y":[{"skew-y":xa()}],transform:[{transform:[ie,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:J()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Mt()}],"translate-x":[{"translate-x":Mt()}],"translate-y":[{"translate-y":Mt()}],"translate-z":[{"translate-z":Mt()}],"translate-none":["translate-none"],zoom:[{zoom:[Dn,ie,se]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":Q()}],"scroll-mx":[{"scroll-mx":Q()}],"scroll-my":[{"scroll-my":Q()}],"scroll-ms":[{"scroll-ms":Q()}],"scroll-me":[{"scroll-me":Q()}],"scroll-mbs":[{"scroll-mbs":Q()}],"scroll-mbe":[{"scroll-mbe":Q()}],"scroll-mt":[{"scroll-mt":Q()}],"scroll-mr":[{"scroll-mr":Q()}],"scroll-mb":[{"scroll-mb":Q()}],"scroll-ml":[{"scroll-ml":Q()}],"scroll-p":[{"scroll-p":Q()}],"scroll-px":[{"scroll-px":Q()}],"scroll-py":[{"scroll-py":Q()}],"scroll-ps":[{"scroll-ps":Q()}],"scroll-pe":[{"scroll-pe":Q()}],"scroll-pbs":[{"scroll-pbs":Q()}],"scroll-pbe":[{"scroll-pbe":Q()}],"scroll-pt":[{"scroll-pt":Q()}],"scroll-pr":[{"scroll-pr":Q()}],"scroll-pb":[{"scroll-pb":Q()}],"scroll-pl":[{"scroll-pl":Q()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie,se]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[_e,fi,jr,M0]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},j1=e1(w1);function O0(...l){return j1(Rp(l))}const N1=[{name:"Live Feed",href:"/",icon:Nd},{name:"History Logs",href:"/logs",icon:Cp},{name:"System Health",href:"/system",icon:Ep},{name:"Analytics & Queue",href:"/analytics",icon:Sp},{name:"Dead Letter (DLQ)",href:"/dlq",icon:Go},{name:"Scheduled",href:"/scheduled",icon:fl},{name:"Workflows",href:"/workflows",icon:Np},{name:"Templates",href:"/templates",icon:jp},{name:"Users",href:"/users",icon:zp},{name:"Projects & Keys",href:"/projects",icon:Ed}];function E1(){const l=yn(),{user:i,logout:u,isAuthenticated:c}=ya();return l.pathname==="/login"||l.pathname==="/login/"||!c?null:o.jsxs("div",{className:"flex flex-col w-64 border-r border-border bg-card h-full shrink-0",children:[o.jsxs("div",{className:"p-6 border-b border-border flex items-center gap-3",children:[o.jsx("div",{className:"bg-primary text-primary-foreground p-2 rounded-lg",children:o.jsx(Px,{className:"w-5 h-5"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"font-bold text-lg tracking-tight text-foreground",children:"Notifkit"}),o.jsx("span",{className:"text-[10px] uppercase font-semibold tracking-wider text-muted-foreground",children:"Admin Console"})]})]}),o.jsx("nav",{className:"flex-1 overflow-y-auto p-4 space-y-1",children:N1.map(m=>{const p=m.href==="/"?l.pathname==="/":l.pathname.startsWith(m.href);return o.jsxs(jd,{to:m.href,className:O0("flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors group relative",p?"text-primary-foreground bg-primary shadow-xs":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:[o.jsx(m.icon,{className:O0("w-4 h-4 transition-colors",p?"text-primary-foreground":"text-muted-foreground group-hover:text-foreground")}),m.name]},m.name)})}),o.jsxs("div",{className:"p-4 border-t border-border bg-muted/40 space-y-3",children:[i&&o.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1.5",children:[o.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0 border border-border",children:o.jsx(zb,{className:"h-3.5 w-3.5 text-foreground"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-xs font-semibold text-foreground truncate",children:i.username||i.email}),o.jsx("p",{className:"text-[10px] text-muted-foreground capitalize",children:i.role})]})]}),o.jsxs("button",{onClick:()=>void u(),className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-md text-xs font-medium text-muted-foreground hover:text-destructive hover:bg-destructive/10 border border-transparent transition-colors cursor-pointer",children:[o.jsx(lb,{className:"h-3.5 w-3.5"}),o.jsx("span",{children:"Sign Out"})]})]})]})}var A1=(l,i,u,c,d,m,p,y)=>{let v=document.documentElement,h=["light","dark"];function S(E){(Array.isArray(l)?l:[l]).forEach(j=>{let C=j==="class",_=C&&m?d.map(z=>m[z]||z):d;C?(v.classList.remove(..._),v.classList.add(m&&m[E]?m[E]:E)):v.setAttribute(j,E)}),g(E)}function g(E){y&&h.includes(E)&&(v.style.colorScheme=E)}function w(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(c)S(c);else try{let E=localStorage.getItem(i)||u,j=p&&E==="system"?w():E;S(j)}catch{}},C1=b.createContext(void 0),T1={setTheme:l=>{},themes:[]},z1=()=>{var l;return(l=b.useContext(C1))!=null?l:T1};b.memo(({forcedTheme:l,storageKey:i,attribute:u,enableSystem:c,enableColorScheme:d,defaultTheme:m,value:p,themes:y,nonce:v,scriptProps:h})=>{let S=JSON.stringify([u,i,m,l,y,p,c,d]).slice(1,-1);return b.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?v:"",dangerouslySetInnerHTML:{__html:`(${A1.toString()})(${S})`}})});function _1(l){if(typeof document>"u")return;let i=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css",i.appendChild(u),u.styleSheet?u.styleSheet.cssText=l:u.appendChild(document.createTextNode(l))}const R1=l=>{switch(l){case"success":return D1;case"info":return U1;case"warning":return O1;case"error":return L1;default:return null}},M1=Array(12).fill(0),k1=({visible:l,className:i})=>ae.createElement("div",{className:["sonner-loading-wrapper",i].filter(Boolean).join(" "),"data-visible":l},ae.createElement("div",{className:"sonner-spinner"},M1.map((u,c)=>ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${c}`})))),D1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),O1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),U1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),L1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),H1=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),B1=()=>{const[l,i]=ae.useState(document.hidden);return ae.useEffect(()=>{const u=()=>{i(document.hidden)};return document.addEventListener("visibilitychange",u),()=>window.removeEventListener("visibilitychange",u)},[]),l};let ld=1;class q1{constructor(){this.subscribe=i=>(this.subscribers.push(i),()=>{const u=this.subscribers.indexOf(i);this.subscribers.splice(u,1)}),this.publish=i=>{this.subscribers.forEach(u=>u(i))},this.addToast=i=>{this.publish(i),this.toasts=[...this.toasts,i]},this.create=i=>{var u;const{message:c,...d}=i,m=typeof(i==null?void 0:i.id)=="number"||((u=i.id)==null?void 0:u.length)>0?i.id:ld++,p=this.toasts.find(v=>v.id===m),y=i.dismissible===void 0?!0:i.dismissible;return this.dismissedToasts.has(m)&&this.dismissedToasts.delete(m),p?this.toasts=this.toasts.map(v=>v.id===m?(this.publish({...v,...i,id:m,title:c}),{...v,...i,id:m,dismissible:y,title:c}):v):this.addToast({title:c,...d,dismissible:y,id:m}),m},this.dismiss=i=>(i?(this.dismissedToasts.add(i),requestAnimationFrame(()=>this.subscribers.forEach(u=>u({id:i,dismiss:!0})))):this.toasts.forEach(u=>{this.subscribers.forEach(c=>c({id:u.id,dismiss:!0}))}),i),this.message=(i,u)=>this.create({...u,message:i}),this.error=(i,u)=>this.create({...u,message:i,type:"error"}),this.success=(i,u)=>this.create({...u,type:"success",message:i}),this.info=(i,u)=>this.create({...u,type:"info",message:i}),this.warning=(i,u)=>this.create({...u,type:"warning",message:i}),this.loading=(i,u)=>this.create({...u,type:"loading",message:i}),this.promise=(i,u)=>{if(!u)return;let c;u.loading!==void 0&&(c=this.create({...u,promise:i,type:"loading",message:u.loading,description:typeof u.description!="function"?u.description:void 0}));const d=Promise.resolve(i instanceof Function?i():i);let m=c!==void 0,p;const y=d.then(async h=>{if(p=["resolve",h],ae.isValidElement(h))m=!1,this.create({id:c,type:"default",message:h});else if(G1(h)&&!h.ok){m=!1;const g=typeof u.error=="function"?await u.error(`HTTP error! status: ${h.status}`):u.error,w=typeof u.description=="function"?await u.description(`HTTP error! status: ${h.status}`):u.description,j=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:c,type:"error",description:w,...j})}else if(h instanceof Error){m=!1;const g=typeof u.error=="function"?await u.error(h):u.error,w=typeof u.description=="function"?await u.description(h):u.description,j=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:c,type:"error",description:w,...j})}else if(u.success!==void 0){m=!1;const g=typeof u.success=="function"?await u.success(h):u.success,w=typeof u.description=="function"?await u.description(h):u.description,j=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:c,type:"success",description:w,...j})}}).catch(async h=>{if(p=["reject",h],u.error!==void 0){m=!1;const S=typeof u.error=="function"?await u.error(h):u.error,g=typeof u.description=="function"?await u.description(h):u.description,E=typeof S=="object"&&!ae.isValidElement(S)?S:{message:S};this.create({id:c,type:"error",description:g,...E})}}).finally(()=>{m&&(this.dismiss(c),c=void 0),u.finally==null||u.finally.call(u)}),v=()=>new Promise((h,S)=>y.then(()=>p[0]==="reject"?S(p[1]):h(p[1])).catch(S));return typeof c!="string"&&typeof c!="number"?{unwrap:v}:Object.assign(c,{unwrap:v})},this.custom=(i,u)=>{const c=(u==null?void 0:u.id)||ld++;return this.create({jsx:i(c),id:c,...u}),c},this.getActiveToasts=()=>this.toasts.filter(i=>!this.dismissedToasts.has(i.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const va=new q1,Y1=(l,i)=>{const u=(i==null?void 0:i.id)||ld++;return va.addToast({title:l,...i,id:u}),u},G1=l=>l&&typeof l=="object"&&"ok"in l&&typeof l.ok=="boolean"&&"status"in l&&typeof l.status=="number",V1=Y1,X1=()=>va.toasts,Q1=()=>va.getActiveToasts(),Ge=Object.assign(V1,{success:va.success,info:va.info,warning:va.warning,error:va.error,custom:va.custom,message:va.message,promise:va.promise,dismiss:va.dismiss,loading:va.loading},{getHistory:X1,getToasts:Q1});_1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function _o(l){return l.label!==void 0}const Z1=3,K1="24px",$1="16px",U0=4e3,J1=356,W1=14,I1=45,F1=200;function On(...l){return l.filter(Boolean).join(" ")}function P1(l){const[i,u]=l.split("-"),c=[];return i&&c.push(i),u&&c.push(u),c}const eS=l=>{var i,u,c,d,m,p,y,v,h;const{invert:S,toast:g,unstyled:w,interacting:E,setHeights:j,visibleToasts:C,heights:_,index:z,toasts:L,expanded:K,removeToast:ee,defaultRichColors:J,closeButton:I,style:Z,cancelButtonStyle:Q,actionButtonStyle:pe,className:xe="",descriptionClassName:Ee="",duration:Re,position:Xe,gap:ne,expandByDefault:ge,classNames:M,icons:G,closeButtonAriaLabel:re="Close toast"}=l,[Se,W]=ae.useState(null),[A,q]=ae.useState(null),[V,P]=ae.useState(!1),[te,le]=ae.useState(!1),[je,we]=ae.useState(!1),[ve,ea]=ae.useState(!1),[Wt,dt]=ae.useState(!1),[xa,Mt]=ae.useState(0),[La,Ha]=ae.useState(0),bn=ae.useRef(g.duration||Re||U0),vl=ae.useRef(null),ta=ae.useRef(null),Sn=z===0,tr=z+1<=C,Vt=g.type,Ba=g.dismissible!==!1,Xt=g.className||"",ws=g.descriptionClassName||"",Yn=ae.useMemo(()=>_.findIndex(ye=>ye.toastId===g.id)||0,[_,g.id]),zr=ae.useMemo(()=>{var ye;return(ye=g.closeButton)!=null?ye:I},[g.closeButton,I]),Gn=ae.useMemo(()=>g.duration||Re||U0,[g.duration,Re]),ar=ae.useRef(0),qa=ae.useRef(0),yl=ae.useRef(0),Ya=ae.useRef(null),[Ga,Yt]=Xe.split("-"),ba=ae.useMemo(()=>_.reduce((ye,at,pt)=>pt>=Yn?ye:ye+at.height,0),[_,Yn]),kt=B1(),xl=g.invert||S,nr=Vt==="loading";qa.current=ae.useMemo(()=>Yn*ne+ba,[Yn,ba]),ae.useEffect(()=>{bn.current=Gn},[Gn]),ae.useEffect(()=>{P(!0)},[]),ae.useEffect(()=>{const ye=ta.current;if(ye){const at=ye.getBoundingClientRect().height;return Ha(at),j(pt=>[{toastId:g.id,height:at,position:g.position},...pt]),()=>j(pt=>pt.filter(Dt=>Dt.toastId!==g.id))}},[j,g.id]),ae.useLayoutEffect(()=>{if(!V)return;const ye=ta.current,at=ye.style.height;ye.style.height="auto";const pt=ye.getBoundingClientRect().height;ye.style.height=at,Ha(pt),j(Dt=>Dt.find(lt=>lt.toastId===g.id)?Dt.map(lt=>lt.toastId===g.id?{...lt,height:pt}:lt):[{toastId:g.id,height:pt,position:g.position},...Dt])},[V,g.title,g.description,j,g.id,g.jsx,g.action,g.cancel]);const Va=ae.useCallback(()=>{le(!0),Mt(qa.current),j(ye=>ye.filter(at=>at.toastId!==g.id)),setTimeout(()=>{ee(g)},F1)},[g,ee,j,qa]);ae.useEffect(()=>{if(g.promise&&Vt==="loading"||g.duration===1/0||g.type==="loading")return;let ye;return K||E||kt?(()=>{if(yl.current<ar.current){const Dt=new Date().getTime()-ar.current;bn.current=bn.current-Dt}yl.current=new Date().getTime()})():(()=>{bn.current!==1/0&&(ar.current=new Date().getTime(),ye=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),Va()},bn.current))})(),()=>clearTimeout(ye)},[K,E,g,Vt,kt,Va]),ae.useEffect(()=>{g.delete&&(Va(),g.onDismiss==null||g.onDismiss.call(g,g))},[Va,g.delete]);function Vn(){var ye;if(G!=null&&G.loading){var at;return ae.createElement("div",{className:On(M==null?void 0:M.loader,g==null||(at=g.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":Vt==="loading"},G.loading)}return ae.createElement(k1,{className:On(M==null?void 0:M.loader,g==null||(ye=g.classNames)==null?void 0:ye.loader),visible:Vt==="loading"})}const Xa=g.icon||(G==null?void 0:G[Vt])||R1(Vt);var cn,wt;return ae.createElement("li",{tabIndex:0,ref:ta,className:On(xe,Xt,M==null?void 0:M.toast,g==null||(i=g.classNames)==null?void 0:i.toast,M==null?void 0:M.default,M==null?void 0:M[Vt],g==null||(u=g.classNames)==null?void 0:u[Vt]),"data-sonner-toast":"","data-rich-colors":(cn=g.richColors)!=null?cn:J,"data-styled":!(g.jsx||g.unstyled||w),"data-mounted":V,"data-promise":!!g.promise,"data-swiped":Wt,"data-removed":te,"data-visible":tr,"data-y-position":Ga,"data-x-position":Yt,"data-index":z,"data-front":Sn,"data-swiping":je,"data-dismissible":Ba,"data-type":Vt,"data-invert":xl,"data-swipe-out":ve,"data-swipe-direction":A,"data-expanded":!!(K||ge&&V),"data-testid":g.testId,style:{"--index":z,"--toasts-before":z,"--z-index":L.length-z,"--offset":`${te?xa:qa.current}px`,"--initial-height":ge?"auto":`${La}px`,...Z,...g.style},onDragEnd:()=>{we(!1),W(null),Ya.current=null},onPointerDown:ye=>{ye.button!==2&&(nr||!Ba||(vl.current=new Date,Mt(qa.current),ye.target.setPointerCapture(ye.pointerId),ye.target.tagName!=="BUTTON"&&(we(!0),Ya.current={x:ye.clientX,y:ye.clientY})))},onPointerUp:()=>{var ye,at,pt;if(ve||!Ba)return;Ya.current=null;const Dt=Number(((ye=ta.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),un=Number(((at=ta.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),lt=new Date().getTime()-((pt=vl.current)==null?void 0:pt.getTime()),rt=Se==="x"?Dt:un,Qa=Math.abs(rt)/lt;if(Math.abs(rt)>=I1||Qa>.11){Mt(qa.current),g.onDismiss==null||g.onDismiss.call(g,g),q(Se==="x"?Dt>0?"right":"left":un>0?"down":"up"),Va(),ea(!0);return}else{var gt,vt;(gt=ta.current)==null||gt.style.setProperty("--swipe-amount-x","0px"),(vt=ta.current)==null||vt.style.setProperty("--swipe-amount-y","0px")}dt(!1),we(!1),W(null)},onPointerMove:ye=>{var at,pt,Dt;if(!Ya.current||!Ba||((at=window.getSelection())==null?void 0:at.toString().length)>0)return;const lt=ye.clientY-Ya.current.y,rt=ye.clientX-Ya.current.x;var Qa;const gt=(Qa=l.swipeDirections)!=null?Qa:P1(Xe);!Se&&(Math.abs(rt)>1||Math.abs(lt)>1)&&W(Math.abs(rt)>Math.abs(lt)?"x":"y");let vt={x:0,y:0};const Sa=It=>1/(1.5+Math.abs(It)/20);if(Se==="y"){if(gt.includes("top")||gt.includes("bottom"))if(gt.includes("top")&<<0||gt.includes("bottom")&<>0)vt.y=lt;else{const It=lt*Sa(lt);vt.y=Math.abs(It)<Math.abs(lt)?It:lt}}else if(Se==="x"&&(gt.includes("left")||gt.includes("right")))if(gt.includes("left")&&rt<0||gt.includes("right")&&rt>0)vt.x=rt;else{const It=rt*Sa(rt);vt.x=Math.abs(It)<Math.abs(rt)?It:rt}(Math.abs(vt.x)>0||Math.abs(vt.y)>0)&&dt(!0),(pt=ta.current)==null||pt.style.setProperty("--swipe-amount-x",`${vt.x}px`),(Dt=ta.current)==null||Dt.style.setProperty("--swipe-amount-y",`${vt.y}px`)}},zr&&!g.jsx&&Vt!=="loading"?ae.createElement("button",{"aria-label":re,"data-disabled":nr,"data-close-button":!0,onClick:nr||!Ba?()=>{}:()=>{Va(),g.onDismiss==null||g.onDismiss.call(g,g)},className:On(M==null?void 0:M.closeButton,g==null||(c=g.classNames)==null?void 0:c.closeButton)},(wt=G==null?void 0:G.close)!=null?wt:H1):null,(Vt||g.icon||g.promise)&&g.icon!==null&&((G==null?void 0:G[Vt])!==null||g.icon)?ae.createElement("div",{"data-icon":"",className:On(M==null?void 0:M.icon,g==null||(d=g.classNames)==null?void 0:d.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Vn():null,g.type!=="loading"?Xa:null):null,ae.createElement("div",{"data-content":"",className:On(M==null?void 0:M.content,g==null||(m=g.classNames)==null?void 0:m.content)},ae.createElement("div",{"data-title":"",className:On(M==null?void 0:M.title,g==null||(p=g.classNames)==null?void 0:p.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?ae.createElement("div",{"data-description":"",className:On(Ee,ws,M==null?void 0:M.description,g==null||(y=g.classNames)==null?void 0:y.description)},typeof g.description=="function"?g.description():g.description):null),ae.isValidElement(g.cancel)?g.cancel:g.cancel&&_o(g.cancel)?ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||Q,onClick:ye=>{_o(g.cancel)&&Ba&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,ye),Va())},className:On(M==null?void 0:M.cancelButton,g==null||(v=g.classNames)==null?void 0:v.cancelButton)},g.cancel.label):null,ae.isValidElement(g.action)?g.action:g.action&&_o(g.action)?ae.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||pe,onClick:ye=>{_o(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,ye),!ye.defaultPrevented&&Va())},className:On(M==null?void 0:M.actionButton,g==null||(h=g.classNames)==null?void 0:h.actionButton)},g.action.label):null)};function L0(){if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?window.getComputedStyle(document.documentElement).direction:l}function tS(l,i){const u={};return[l,i].forEach((c,d)=>{const m=d===1,p=m?"--mobile-offset":"--offset",y=m?$1:K1;function v(h){["top","right","bottom","left"].forEach(S=>{u[`${p}-${S}`]=typeof h=="number"?`${h}px`:h})}typeof c=="number"||typeof c=="string"?v(c):typeof c=="object"?["top","right","bottom","left"].forEach(h=>{c[h]===void 0?u[`${p}-${h}`]=y:u[`${p}-${h}`]=typeof c[h]=="number"?`${c[h]}px`:c[h]}):v(y)}),u}const aS=ae.forwardRef(function(i,u){const{id:c,invert:d,position:m="bottom-right",hotkey:p=["altKey","KeyT"],expand:y,closeButton:v,className:h,offset:S,mobileOffset:g,theme:w="light",richColors:E,duration:j,style:C,visibleToasts:_=Z1,toastOptions:z,dir:L=L0(),gap:K=W1,icons:ee,containerAriaLabel:J="Notifications"}=i,[I,Z]=ae.useState([]),Q=ae.useMemo(()=>c?I.filter(V=>V.toasterId===c):I.filter(V=>!V.toasterId),[I,c]),pe=ae.useMemo(()=>Array.from(new Set([m].concat(Q.filter(V=>V.position).map(V=>V.position)))),[Q,m]),[xe,Ee]=ae.useState([]),[Re,Xe]=ae.useState(!1),[ne,ge]=ae.useState(!1),[M,G]=ae.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=ae.useRef(null),Se=p.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ae.useRef(null),A=ae.useRef(!1),q=ae.useCallback(V=>{Z(P=>{var te;return(te=P.find(le=>le.id===V.id))!=null&&te.delete||va.dismiss(V.id),P.filter(({id:le})=>le!==V.id)})},[]);return ae.useEffect(()=>va.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{Z(P=>P.map(te=>te.id===V.id?{...te,delete:!0}:te))});return}setTimeout(()=>{mx.flushSync(()=>{Z(P=>{const te=P.findIndex(le=>le.id===V.id);return te!==-1?[...P.slice(0,te),{...P[te],...V},...P.slice(te+1)]:[V,...P]})})})}),[I]),ae.useEffect(()=>{if(w!=="system"){G(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:P})=>{G(P?"dark":"light")})}catch{V.addListener(({matches:te})=>{try{G(te?"dark":"light")}catch(le){console.error(le)}})}},[w]),ae.useEffect(()=>{I.length<=1&&Xe(!1)},[I]),ae.useEffect(()=>{const V=P=>{var te;if(p.every(we=>P[we]||P.code===we)){var je;Xe(!0),(je=re.current)==null||je.focus()}P.code==="Escape"&&(document.activeElement===re.current||(te=re.current)!=null&&te.contains(document.activeElement))&&Xe(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[p]),ae.useEffect(()=>{if(re.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,A.current=!1)}},[re.current]),ae.createElement("section",{ref:u,"aria-label":`${J} ${Se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},pe.map((V,P)=>{var te;const[le,je]=V.split("-");return Q.length?ae.createElement("ol",{key:V,dir:L==="auto"?L0():L,tabIndex:-1,ref:re,className:h,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":le,"data-x-position":je,style:{"--front-toast-height":`${((te=xe[0])==null?void 0:te.height)||0}px`,"--width":`${J1}px`,"--gap":`${K}px`,...C,...tS(S,g)},onBlur:we=>{A.current&&!we.currentTarget.contains(we.relatedTarget)&&(A.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:we=>{we.target instanceof HTMLElement&&we.target.dataset.dismissible==="false"||A.current||(A.current=!0,W.current=we.relatedTarget)},onMouseEnter:()=>Xe(!0),onMouseMove:()=>Xe(!0),onMouseLeave:()=>{ne||Xe(!1)},onDragEnd:()=>Xe(!1),onPointerDown:we=>{we.target instanceof HTMLElement&&we.target.dataset.dismissible==="false"||ge(!0)},onPointerUp:()=>ge(!1)},Q.filter(we=>!we.position&&P===0||we.position===V).map((we,ve)=>{var ea,Wt;return ae.createElement(eS,{key:we.id,icons:ee,index:ve,toast:we,defaultRichColors:E,duration:(ea=z==null?void 0:z.duration)!=null?ea:j,className:z==null?void 0:z.className,descriptionClassName:z==null?void 0:z.descriptionClassName,invert:d,visibleToasts:_,closeButton:(Wt=z==null?void 0:z.closeButton)!=null?Wt:v,interacting:ne,position:V,style:z==null?void 0:z.style,unstyled:z==null?void 0:z.unstyled,classNames:z==null?void 0:z.classNames,cancelButtonStyle:z==null?void 0:z.cancelButtonStyle,actionButtonStyle:z==null?void 0:z.actionButtonStyle,closeButtonAriaLabel:z==null?void 0:z.closeButtonAriaLabel,removeToast:q,toasts:Q.filter(dt=>dt.position==we.position),heights:xe.filter(dt=>dt.position==we.position),setHeights:Ee,expandByDefault:y,gap:K,expanded:Re,swipeDirections:i.swipeDirections})})):null}))}),nS=({...l})=>{const{theme:i="system"}=z1();return o.jsx(aS,{theme:i,className:"toaster group",icons:{success:o.jsx(hs,{className:"size-4"}),info:o.jsx(Wx,{className:"size-4"}),warning:o.jsx(Go,{className:"size-4"}),error:o.jsx(ob,{className:"size-4"}),loading:o.jsx(mi,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...l})},H0=l=>typeof l=="boolean"?`${l}`:l===0?"0":l,B0=Rp,Zp=(l,i)=>u=>{var c;if((i==null?void 0:i.variants)==null)return B0(l,u==null?void 0:u.class,u==null?void 0:u.className);const{variants:d,defaultVariants:m}=i,p=Object.keys(d).map(h=>{const S=u==null?void 0:u[h],g=m==null?void 0:m[h];if(S===null)return null;const w=H0(S)||H0(g);return d[h][w]}),y=u&&Object.entries(u).reduce((h,S)=>{let[g,w]=S;return w===void 0||(h[g]=w),h},{}),v=i==null||(c=i.compoundVariants)===null||c===void 0?void 0:c.reduce((h,S)=>{let{class:g,className:w,...E}=S;return Object.entries(E).every(j=>{let[C,_]=j;return Array.isArray(_)?_.includes({...m,...y}[C]):{...m,...y}[C]===_})?[...h,g,w]:h},[]);return B0(l,p,v,u==null?void 0:u.class,u==null?void 0:u.className)},Kp=48,Bn=(l,i=0)=>{const u=new Int32Array(l.length);for(let c=0;c<l.length;c++)u[c]=l.charCodeAt(c)-Kp-i;return u},Vo=l=>{const i=new Int32Array(l.length+1);for(let u=0;u<l.length;u++)i[u+1]=i[u]+l[u];return i},Fl=l=>{const i=new Int32Array(l.length);let u=0;for(let c=0;c<l.length;c++){const d=l.charCodeAt(c)-Kp;u+=d>>>1^-(d&1),i[c]=u}return i},lS=384,rS=[],Er=Vo(Bn("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),sS=Vo(Bn(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),iS="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",oS=(()=>{const l=Er.length-1,i=new Int32Array(l);for(let d=l-1;d>=0;d--){let m=1,p=d+1;for(let y=Er[d];y<Er[d+1];y++)m+=i[p],p+=i[p];i[d]=m}const u=new Int32Array(Er[l]);let c=0;for(let d=0;d<l;d++){let m=d+1;for(let p=Er[d];p<Er[d+1];p++)u[c++]=m,m+=i[m]}return u})(),cS=Bn("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),uS=Vo(Bn("1233333593464636351265367151576")),dS=Bn("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0324325853;D>E?3257D>03258432585:0325B:;0328B:032"),fS=Bn("012123445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EJK4444::EJ4444441691;644444114244444:;L6666555555555555555999666664444444444444444444444226?6:66644M9N?D:111::::6DJ199"),mS=Fl("0202002020020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),hS=(()=>{const l=new Int32Array(319).fill(-1),i=Fl("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),u=Fl("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let c=0;c<i.length;c++)l[i[c]]=u[c];return l})(),pS="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top|none | auto square video| auto fr max min px| auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(l=>{const i=l.split(" "),u=i.shift();for(let c=0;c<i.length;c++)i[c]=u+i[c];return i}),q0=Fl("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),gS=Fl("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),vS=Fl("02222222222222222222222222222222222222222222222222222222222222222203062222222222IL2200IL021042222]`222IL0gj2e50n2222U00X202[^2y0000560|{~22>22|22222222222G000qOVI00000}2>40000B00000I¨000°00000000000000021Q²±00´000000000000000000000222HGHa5¾222Ã6À2222ÍÐ000°2±"),$p=new Int32Array(991),Jp=new Int32Array(991),Wp=new Int32Array(991);let rd="";const sd=new Int32Array(1030);{const l=new Map;let i=0,u=0;for(let c=0;c<q0.length;c++)for(const d of pS[vS[c]]){let m=l.get(d);m===void 0&&(m=i++,l.set(d,m),sd[m*2]=rd.length,sd[m*2+1]=d.length,rd+=d),$p[u]=q0[c],Jp[u]=gS[c],Wp[u]=m,u++}}const yS=Fl("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),xS=Vo(Bn("1::22222432:222:22:22>222222:22:2221322511111311111114")),bS=Fl("24A;33N=C@H4A;33N=C@<2;363@QTQʰ222ˉºŴŽ2R2=18cƴÅŇÜÛŲǝȈ:ħ25=11D3A@216Er25;11B3?<438Cn9@7=<8192>2E121@9@EHE@9>2T25511<398216=V25511<398216=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),SS=Bn("ij"),wS=Bn(""),jS=Bn("1"),NS="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var ES={GROUP_COUNT:lS,customValidatorNames:rS,edgeStart:Er,labelStart:sS,labelText:iS,edgeTarget:oS,nodeGroup:cS,nodeVlist:hS,vlistPat:uS,vlistOps:dS,vlistRef:fS,vlistGroup:mS,litAnchor:$p,litGroup:Jp,litPool:Wp,poolOffsets:sd,poolText:rd,adjGid:yS,adjStart:xS,adjTgt:bS,patGid:SS,patTgt:wS,postfixLookupGroups:jS,orderSensitiveModifiers:NS};const AS="line"in new Error,Un=-1,Nr=-1,Pu=(l,i,u)=>{let c=2166136261;for(let d=i;d<u;d++)c=Math.imul(c^l.charCodeAt(d),16777619);return c},ed=(l,i,u)=>{const c=u-i;let d=Math.imul(c,2654435761)^l.charCodeAt(i);if(c>3){const m=c>>2,p=c>>1;d=Math.imul(d^l.charCodeAt(i+1)<<8^l.charCodeAt(i+2)<<16^l.charCodeAt(i+m),2246822507),d=Math.imul(d^l.charCodeAt(i+p)<<8^l.charCodeAt(i+p+m)<<16^l.charCodeAt(u-3),3266489909),d^=l.charCodeAt(u-2)<<8^l.charCodeAt(u-1)<<16;for(let y=i+3,v=u-4;y<i+8&&y<v;y++,v--)d=Math.imul(d^l.charCodeAt(y)^l.charCodeAt(v)<<8,16777619)}return d^d>>>15|0},CS=(l,i,u={})=>{const{GROUP_COUNT:c,edgeStart:d,labelStart:m,labelText:p,edgeTarget:y,nodeGroup:v,nodeVlist:h,vlistPat:S,vlistOps:g,vlistRef:w,vlistGroup:E,litAnchor:j,litGroup:C,litPool:_,poolOffsets:z,poolText:L,adjGid:K,adjStart:ee,adjTgt:J,patGid:I,patTgt:Z,postfixLookupGroups:Q,customValidatorNames:pe,orderSensitiveModifiers:xe}=l,Ee=new Int32Array(c).fill(-1);for(let O=0;O<K.length;O++)Ee[K[O]]=O;let Re=0;for(let O=0;O+1<ee.length;O++){const $=ee[O+1]-ee[O];$>Re&&(Re=$)}let Xe=32;for(;Xe<2*(1+Re+I.length);)Xe<<=1;const ne=new Int32Array(w.length+1);for(let O=0;O<w.length;O++)ne[O+1]=ne[O]+S[w[O]+1]-S[w[O]];const ge=new Uint8Array(c);for(let O=0;O<Q.length;O++)ge[Q[O]]=1;const M=d.length-1,G=new Uint8Array(M);let re=0,Se=!0;for(let O=0;O<j.length;O++){G[j[O]]=1;const $=z[_[O]*2+1];$>re&&(re=$);const F=L.charCodeAt(z[_[O]*2]);(F===91||F===40)&&(Se=!1)}let W=1;for(;W<j.length*2;)W<<=1;const A=new Int32Array(W).fill(-1);for(let O=0;O<j.length;O++){const $=z[_[O]*2];let F=(Pu(L,$,$+z[_[O]*2+1])^Math.imul(j[O],2654435761)|0)&W-1;for(;A[F]!==-1;)F=F+1&W-1;A[F]=O}const q=(O,$,F,ue)=>{let fe=(Pu($,F,ue)^Math.imul(O,2654435761)|0)&W-1;const be=ue-F;for(;;){const Be=A[fe];if(Be===-1)return-1;if(j[Be]===O&&z[_[Be]*2+1]===be){const st=z[_[Be]*2];let qe=!0;for(let me=0;me<be;me++)if(L.charCodeAt(st+me)!==$.charCodeAt(F+me)){qe=!1;break}if(qe)return C[Be]}fe=fe+1&W-1}},V=u.cacheSize??8192,P=u.prefix??l.prefix??"",te=P===""?"":P+":",le=te.length,je=(pe??[]).map(O=>{throw new Error("cn: missing validator "+O)}),we=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ve=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ea=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let dt=0,xa=-1,Mt=-1,La=-1,Ha=-1;const bn=O=>O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95,vl=O=>/\s/.test(String.fromCharCode(O)),ta=(O,$,F)=>{if(dt=0,xa=-1,F-$<3)return;const ue=O.charCodeAt($),fe=O.charCodeAt(F-1);if(ue===91&&fe===93)dt=1;else if(ue===40&&fe===41)dt=2;else return;La=$+1,Ha=F-1;let be=$+1;if(bn(O.charCodeAt(be))){for(be++;be<F-1;){const Be=O.charCodeAt(be);if(!bn(Be)&&Be!==45)break;be++}be<F-2&&O.charCodeAt(be)===58&&(xa=$+1,Mt=be,La=be+1)}},Sn=(O,$,F,ue)=>{if(F-$!==ue.length)return!1;for(let fe=0;fe<ue.length;fe++)if(O.charCodeAt($+fe)!==ue.charCodeAt(fe))return!1;return!0},tr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Vt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ba=O=>!!O&&!Number.isNaN(Number(O)),Xt=(O,$,F)=>{if(F-$<11||!Sn(O,$,$+10,"@container"))return!1;if(O.charCodeAt($+10)===47)return F-$>=12;const ue=O.charCodeAt($+11);return ue===115&&F-$>=17&&Sn(O,$+10,$+16,"-size/")||ue===110&&F-$>=19&&Sn(O,$+10,$+18,"-normal/")},ws=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Yn="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(O=>O.split(" ")),zr=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Gn=(O,$,F,ue)=>{if(O>=10){if(O>=25)return je[O-25]($.slice(F,ue));const fe=O-10;if(dt!==ws[fe])return!1;if(xa>=0){for(const be of Yn[fe])if(Sn($,xa,Mt,be))return!0;return!1}switch(zr[fe]){case 0:return!1;case 1:return!0;case 2:{const be=$.slice(La,Ha);return we.test(be)&&!ve.test(be)}case 3:return Ba($.slice(La,Ha));case 4:return Wt.test($.slice(La,Ha));default:return ea.test($.slice(La,Ha))}}switch(O){case 0:return!0;case 1:return dt===0;case 2:return dt===1;case 3:return dt===2;case 4:return tr.test($.slice(F,ue));case 5:return Ba($.slice(F,ue));case 6:{const fe=$.slice(F,ue);return!!fe&&Number.isInteger(Number(fe))}case 7:return ue>F&&$.charCodeAt(ue-1)===37&&Ba($.slice(F,ue-1));case 8:return Vt.test($.slice(F,ue));default:return Xt($,F,ue)}},ar=new Set(typeof xe=="string"?xe.split(" "):xe),qa=(O,$,F,ue,fe,be)=>{const Be=Pu($,F,ue)^(fe?2654435769:0)|0;let st=O.get(Be);if(st!==void 0)e:for(let Ae=0;Ae<st.length;Ae++){const Me=st[Ae];if(!(Me.imp!==fe||Me.k.length!==ue-F)){for(let yt=0;yt<Me.k.length;yt++)if(Me.k.charCodeAt(yt)!==$.charCodeAt(F+yt))continue e;return Me.id}}else O.set(Be,st=[]);const qe=$.slice(F,ue),me=be(qe);return st.push({k:qe,imp:fe,id:me}),me};let yl=new Map,Ya=new Map,Ga=2;const Yt=4096,ba=(O,$)=>{const F=[];let ue=0,fe=0,be=0;for(let me=0;me<O.length;me++){const Ae=O.charCodeAt(me);ue===0&&fe===0&&Ae===58?(F.push(O.slice(be,me)),be=me+1):Ae===91?ue++:Ae===93?ue--:Ae===40?fe++:Ae===41&&fe--}F.push(O.slice(be));let Be=F[0];if(F.length>1){const me=[];let Ae=[];for(const Me of F)Me.charCodeAt(0)===91||ar.has(Me)?(Ae.length&&(me.push(...Ae.sort()),Ae=[]),me.push(Me)):Ae.push(Me);Ae.length&&me.push(...Ae.sort()),Be=me.join(":")}const st=$?Be+" !":Be;let qe=Ya.get(st);return qe===void 0&&Ya.set(st,qe=Ga++),qe};let kt=new Map,xl=c;const nr=c+4096,Va=()=>xl++,Vn=2097152,Xa=8192,cn=new Int32Array(Xa),wt=new Array(Xa).fill(null),ye=new Int32Array(Xa),at=new Int32Array(Xa),pt=new Uint8Array(Xa);let Dt=0;const un=(O,$,F,ue,fe,be,Be,st)=>{let qe=O;if(wt[O]!==null)if(wt[O|1]===null)qe=O|1;else if((Dt++&3)===0)qe=O|Dt>>2&1;else return;wt[qe]=$.slice(F,ue),cn[qe]=fe,ye[qe]=be,at[qe]=Be,pt[qe]=st},lt=()=>wt.fill(null);let rt=256,Qa=[new Int32Array(rt),new Int32Array(rt),new Int32Array(rt),new Int32Array(rt)],[gt,vt,Sa,It]=Qa,Xn=new Uint8Array(rt),Qn=new Uint8Array(rt);const wn=()=>{rt*=2,Qa=Qa.map($=>{const F=new Int32Array(rt);return F.set($),F}),[gt,vt,Sa,It]=Qa;const O=new Uint8Array(rt);O.set(Xn),Xn=O,Qn=new Uint8Array(rt)};let ct=64,jt=new Int32Array(ct),Za=new Int32Array(ct);const lr=new Int32Array(c);let jn=2048,wi=21,_r=new Float64Array(jn),Nn=new Int32Array(jn),Ka=0;const En=(O,$)=>{if(O===0&&$<c)return lr[$]===Ka?1:(lr[$]=Ka,0);const F=O*2097152+$+1;let ue=Math.imul(F,2654435761)>>>wi;for(;Nn[ue]===Ka;){if(_r[ue]===F)return 1;ue=ue+1&jn-1}return _r[ue]=F,Nn[ue]=Ka,0},dn=(O,$,F,ue,fe)=>{if(F-$>=2&&O.charCodeAt($)===91&&O.charCodeAt(F-1)===93){let be=-1;for(let Be=$+1;Be<F-1;Be++)if(O.charCodeAt(Be)===58){be=Be;break}return be===-1||be===$+1?Un:qa(kt,O,$+1,be,0,Va)}if(ue>=0&&v[ue]>=0)return v[ue];for(let be=fe-1;be>=0;be--){const Be=Za[be];if(Be>F)continue;const st=jt[be],qe=F-Be;if(G[st]===1&&qe>0&&qe<=re){const xt=O.charCodeAt(Be);if(Se===!1||xt!==91&&xt!==40){const $a=q(st,O,Be,F);if($a>=0)return $a}}const me=h[st];if(me<0)continue;const Ae=w[me],Me=S[Ae],yt=S[Ae+1];if(Me===yt)continue;ta(O,Be,F);const Ot=ne[me]-Me;for(let xt=Me;xt<yt;xt++)if(Gn(g[xt],O,Be,F))return E[Ot+xt]}return Un},An=O=>{const $=O.length;let F=0,ue=0,fe=!1;(Ga>Yt||yl.size>Yt)&&(yl=new Map,Ya=new Map,Ga=2,lt()),xl>nr&&(kt=new Map,xl=c,lt());let be=0;for(;be<$;){let me=O.charCodeAt(be);if(me===32||me>=9&&me<=13||me>=160&&vl(me)){me!==32&&(fe=!0),be++;continue}const Ae=be;let Me=0;for(;be<$;){if(me=O.charCodeAt(be),me<=32){if(me===32)break;if(me>=9&&me<=13){fe=!0;break}}else if(me>=160&&vl(me)){fe=!0;break}Me=Math.imul(Me^me,16777619),be++}const yt=be,Ot=yt-Ae;F===rt&&wn();const xt=F++;gt[xt]=Ae,vt[xt]=yt,ue+=Ot,Me^=Math.imul(Ot,2654435761);const $a=Me^Me>>>15|0,Ja=$a&8190;{let Ve=-1;if(cn[Ja]===$a&&wt[Ja]!==null&&wt[Ja].length===Ot?Ve=Ja:cn[Ja|1]===$a&&wt[Ja|1]!==null&&wt[Ja|1].length===Ot&&(Ve=Ja|1),Ve>=0){const Aa=wt[Ve];let Ca=!0;for(let Ta=0;Ta<Ot;Ta++)if(Aa.charCodeAt(Ta)!==O.charCodeAt(Ae+Ta)){Ca=!1;break}if(Ca){Sa[xt]=ye[Ve],It[xt]=at[Ve],Xn[xt]=pt[Ve];continue}}}let Sl=Ae;if(le!==0){if(yt-Ae<=le||!O.startsWith(te,Ae)){Sa[xt]=Un,un(Ja,O,Ae,yt,$a,Un,0,0);continue}Sl=Ae+le}let wl=0,ja=0,Kn=-1,ir=-1;for(let Ve=Sl;Ve<yt;Ve++){const Aa=O.charCodeAt(Ve);if(wl===0&&ja===0){if(Aa===58){Kn=Ve;continue}if(Aa===47){ir=Ve;continue}}Aa===91?wl++:Aa===93?wl--:Aa===40?ja++:Aa===41&&ja--}const $n=Kn>=Sl?Kn+1:Sl;let Ut=$n,na=yt,Jn=!1,Ns=0;na>Ut&&O.charCodeAt(na-1)===33?(Jn=!0,na--):na>Ut&&O.charCodeAt(Ut)===33&&(Jn=!0,Ut++,Ns=1);let Na=-1;ir>$n&&(Na=ir+Ns,Na>=na&&(Na=-1));let Ea=Ut;na-Ut>1&&O.charCodeAt(Ut)===45&&(Ea=Ut+1);let ua=0,da=0,la=0,Dr=-1,ra=0;(h[0]>=0||G[0]===1)&&(jt[0]=0,Za[0]=Ea,ra=1);let Or=Nr,jl=0;for(let Ve=Ea;Ve<na;Ve++)if(Ve===Na&&(Or=da<la?Nr:ua,jl=ra),ua!==Nr){const Aa=O.charCodeAt(Ve);let Ca=-1;if(da<la)p.charCodeAt(da)===Aa?(da++,da===la&&(Ca=ua=Dr)):ua=Nr;else{const Ta=d[ua],Tn=d[ua+1];let Al=Nr;for(let zn=Ta;zn<Tn;zn++){const Es=m[zn];if(p.charCodeAt(Es)===Aa){m[zn+1]-Es===1?Ca=Al=y[zn]:(da=Es+1,la=m[zn+1],Dr=y[zn],Al=ua);break}}ua=Al}if(Ca>=0&&(h[Ca]>=0||G[Ca]===1)&&Ve+1<na&&O.charCodeAt(Ve+1)===45){if(ra===ct){ct*=2;const Ta=new Int32Array(ct);Ta.set(jt),jt=Ta;const Tn=new Int32Array(ct);Tn.set(Za),Za=Tn}jt[ra]=Ca,Za[ra]=Ve+2,ra++}}Na===na&&(Or=da<la?Nr:ua,jl=ra);const Nl=da<la?Nr:ua;let sa,Lt=!1;if(Na>=0)if(Lt=!0,sa=dn(O,Ut,Na,Or,jl),sa!==Un&&sa<c&&ge[sa]){const Ve=dn(O,Ut,na,Nl,ra);Ve!==Un&&Ve!==sa&&(sa=Ve,Lt=!1)}else sa===Un&&(sa=dn(O,Ut,na,Nl,ra),Lt=!1);else sa=dn(O,Ut,na,Nl,ra);let mn=0,El=0;sa===Un?Sa[xt]=Un:(El=Lt?1:0,mn=Sl>=Kn?Jn?1:0:qa(yl,O,Sl,Kn,Jn?1:0,Ve=>ba(Ve,Jn)),Sa[xt]=sa,Xn[xt]=El,It[xt]=mn),un(Ja,O,Ae,yt,$a,sa,mn,El)}if(F===0)return"";if(F===1)return gt[0]===0&&vt[0]===$?O:O.slice(gt[0],vt[0]);if(F*Xe>jn){for(;F*Xe>jn;)jn<<=1,wi--;_r=new Float64Array(jn),Nn=new Int32Array(jn)}if(Ga>=Vn||xl>=Vn)throw new Error("cn: too many distinct classes in one merge");Ka=Ka+1|0,Ka===0&&(lr.fill(0),Nn.fill(0),Ka=1);let Be=!1;for(let me=F-1;me>=0;me--){const Ae=Sa[me];if(Ae===Un){Qn[me]=1;continue}const Me=It[me];if(En(Me,Ae)===1){Qn[me]=0,Be=!0;continue}if(Qn[me]=1,Ae<c){const yt=Ee[Ae];if(yt>=0)for(let Ot=ee[yt];Ot<ee[yt+1];Ot++)En(Me,J[Ot]);if(Xn[me]&1)for(let Ot=0;Ot<I.length;Ot++)I[Ot]===Ae&&En(Me,Z[Ot])}}if(!Be&&!fe&&$===ue+F-1)return O;let st="",qe=0;for(;qe<F;){if(!Qn[qe]){qe++;continue}const me=gt[qe];let Ae=vt[qe],Me=qe+1;for(;Me<F&&Qn[Me]&>[Me]===Ae+1&&O.charCodeAt(Ae)===32;)Ae=vt[Me],Me++;st.length>0&&(st+=" "),st+=O.slice(me,Ae),qe=Me}return st},aa=16384,Fe=new Int32Array(aa*2);let rr=0,oa=1,wa=Object.create(null),Zn=Object.create(null),bl=new Map,js=new Map,sr=0,Rr=0;const Cn=()=>{rr^=aa,oa=oa+1|0,Rr=0},Mr=O=>{let $=wa[O];if($!==void 0)return $;const F=ed(O,0,O.length),ue=(F&16383)+rr,fe=Fe[ue]===(F^oa)||Fe[ue^aa]===(F^oa-1);return fe&&($=Zn[O],$!==void 0)?(wa[O]=$,$):($=An(O),fe?(wa[O]=$,++sr>V&&(sr=0,Zn=wa,wa=Object.create(null),Cn())):(Fe[ue]=F^oa,++Rr>aa&&Cn()),$)},fn=O=>{let $=bl.get(O);if($!==void 0)return $;const F=ed(O,0,O.length),ue=(F&16383)+rr,fe=Fe[ue]===(F^oa)||Fe[ue^aa]===(F^oa-1);return fe&&($=js.get(O),$!==void 0)?(bl.set(O,$),$):($=An(O),fe?(bl.set(O,$),++sr>V&&(sr=0,js=bl,bl=new Map,Cn())):(Fe[ue]=F^oa,++Rr>aa&&Cn()),$)},ca=O=>{const $=ed(O,0,O.length),F=($&16383)+rr;return Fe[F]===($^oa)||Fe[F^aa]===($^oa-1)?!0:(Fe[F]=$^oa,++Rr>aa&&Cn(),!1)},kr=V===0?An:AS?O=>{const $=bl.get(O);return $!==void 0?$:fn(O)}:Mr;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?kr(arguments[0]):kr(zS.apply(null,arguments))},mergeString:kr,seenBefore:V===0?()=>!1:ca,mergeUncached:An}},Uo=(l,i)=>{if(!l)return"";if(typeof l=="string")return l;let u="";if(typeof l.length=="number"&&(!i||Array.isArray(l))){const c=l;for(let d=0;d<c.length;d++){const m=c[d];if(!m)continue;const p=typeof m=="string"?m:Uo(m,i);p&&(u&&(u+=" "),u+=p)}return u}if(i){if(typeof l=="number")return""+l;if(typeof l=="object")for(const c in l)l[c]&&(u&&(u+=" "),u+=c)}return u},TS=(l,i)=>{let u="";for(let c=0;c<l.length;c++){const d=l[c];if(!d)continue;const m=typeof d=="string"?d:Uo(d,i);m&&(u&&(u+=" "),u+=m)}return u},zS=function(){return TS(arguments,!1)},_S=(l,i)=>{const u=i===void 0?()=>!0:i.seenBefore,c=i===void 0?l:i.mergeUncached;let d=new Map,m=new Map,p=0,y=null;const v=(w,E,j,C)=>{let _=0;if(E){if(E!==w.a0)return!1;_=1}if(j){if(j!==(_===0?w.a0:w.a1))return!1;_++}if(C){if(C!==(_===0?w.a0:_===1?w.a1:w.a2))return!1;_++}return _===w.t},h=(w,E)=>{const j=w.a;let C=0;for(let _=0;_<E.length;_++){const z=E[_];if(z){if(z!==j[C])return!1;C++}}return C===w.t},S=(w,E)=>{const j=w.length,C=y===null?null:y.n;if(!E){if(C!==null&&h(C,w))return y=C,C.r;if(y!==null&&y!==C&&h(y,w))return y.r}let _="",z=-1,L=0,K=!1;for(let I=0;I<j;I++){let Z=w[I];if(Z){if(typeof Z!="string"){if(Z=w[I]=Uo(Z,!0),!Z)continue;K=!0}z<0&&(_=Z,z=I),L++}}if(L===0)return"";if(L===1)return l(_);if(K){if(C!==null&&h(C,w))return y=C,C.r;if(y!==null&&y!==C&&h(y,w))return y.r}let ee=d.get(_);ee===void 0&&(ee=m.get(_),ee!==void 0&&d.set(_,ee));let J=null;if(ee!==void 0)e:for(let I=0;I<ee.length;I++){const Z=ee[I];if(Z.t!==L)continue;const Q=Z.a;let pe=1;for(let xe=z+1;xe<j;xe++){const Ee=w[xe];if(Ee&&Ee!==Q[pe++])continue e}J=Z;break}if(J===null){let I=_;const Z=[_];for(let Q=z+1;Q<j;Q++){const pe=w[Q];pe&&(I+=" "+pe,Z.push(pe))}if(!u(I))return c(I);J={r:l(I),t:Z.length,a0:Z[0],a1:Z[1],a2:Z[2]??"",a:Z,n:null},ee===void 0&&d.set(_,ee=[]),ee.length>=256&&ee.shift(),ee.push(J),++p>1e3&&(p=0,m=d,d=new Map)}return y!==null&&y!==J&&(y.n=J),y=J,J.r},g=w=>Array.isArray(w)?S(w.slice(),!1):l(Uo(w,!0));return function(w,E,j){const C=arguments.length;if((C|1)===3){const L=y;if(L!==null){const K=L.n;if(K!==null&&v(K,w,E,j))return y=K,K.r;if(L!==K&&v(L,w,E,j))return L.r}return S([w,E,j],!0)}if(C===1)return typeof w=="string"?l(w):g(w);const _=y;if(_!==null){const L=_.n;if(L!==null){const K=L.a;let ee=0,J=!0;for(let I=0;I<C;I++){const Z=arguments[I];if(Z){if(Z!==K[ee]){J=!1;break}ee++}}if(J&&ee===L.t)return y=L,L.r}if(_!==L){const K=_.a;let ee=0,J=!0;for(let I=0;I<C;I++){const Z=arguments[I];if(Z){if(Z!==K[ee]){J=!1;break}ee++}}if(J&&ee===_.t)return _.r}}const z=[];for(let L=0;L<C;L++)z.push(arguments[L]);return S(z,!0)}},Y0=CS(ES),Pt=_S(Y0.mergeString,Y0);var RS=Object.defineProperty,zd=(l,i)=>RS(l,"name",{value:i,configurable:!0});function id(l,i){if(typeof l=="function")return l(i);l!=null&&(l.current=i)}zd(id,"setRef");function Ip(...l){return i=>{let u=!1;const c=l.map(d=>{const m=id(d,i);return!u&&typeof m=="function"&&(u=!0),m});if(u)return()=>{for(let d=0;d<c.length;d++){const m=c[d];typeof m=="function"?m():id(l[d],null)}}}}zd(Ip,"composeRefs");function er(...l){return b.useCallback(Ip(...l),l)}zd(er,"useComposedRefs");var MS=Object.defineProperty,xn=(l,i)=>MS(l,"name",{value:i,configurable:!0});function _d(l){const i=b.forwardRef((u,c)=>{let{children:d,...m}=u,p=null,y=!1;const v=[];od(d)&&typeof Ro=="function"&&(d=Ro(d._payload)),b.Children.forEach(d,w=>{var E;if(ag(w)){y=!0;const j=w;let C="child"in j.props?j.props.child:j.props.children;od(C)&&typeof Ro=="function"&&(C=Ro(C._payload)),p=DS(j,C),v.push((E=p==null?void 0:p.props)==null?void 0:E.children)}else v.push(w)}),p?p=b.cloneElement(p,void 0,v):!y&&b.Children.count(d)===1&&b.isValidElement(d)&&(p=d);const h=p?tg(p):void 0,S=er(c,h);if(!p){if(d||d===0)throw new Error(y?LS(l):US(l));return d}const g=eg(m,p.props??{});return p.type!==b.Fragment&&(g.ref=c?S:h),b.cloneElement(p,g)});return i.displayName=`${l}.Slot`,i}xn(_d,"createSlot");var Fp=_d("Slot"),Pp=Symbol.for("radix.slottable");function kS(l){const i=xn(u=>"child"in u?u.children(u.child):u.children,"Slottable");return i.displayName=`${l}.Slottable`,i.__radixId=Pp,i}xn(kS,"createSlottable");var DS=xn((l,i)=>{if("child"in l.props){const u=l.props.child;return b.isValidElement(u)?b.cloneElement(u,void 0,l.props.children(u.props.children)):null}return b.isValidElement(i)?i:null},"getSlottableElementFromSlottable");function eg(l,i){const u={...i};for(const c in i){const d=l[c],m=i[c];/^on[A-Z]/.test(c)?d&&m?u[c]=(...y)=>{const v=m(...y);return d(...y),v}:d&&(u[c]=d):c==="style"?u[c]={...d,...m}:c==="className"&&(u[c]=[d,m].filter(Boolean).join(" "))}return{...l,...u}}xn(eg,"mergeProps");function tg(l){var c,d;let i=(c=Object.getOwnPropertyDescriptor(l.props,"ref"))==null?void 0:c.get,u=i&&"isReactWarning"in i&&i.isReactWarning;return u?l.ref:(i=(d=Object.getOwnPropertyDescriptor(l,"ref"))==null?void 0:d.get,u=i&&"isReactWarning"in i&&i.isReactWarning,u?l.props.ref:l.props.ref||l.ref)}xn(tg,"getElementRef");function ag(l){return b.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Pp}xn(ag,"isSlottable");var OS=Symbol.for("react.lazy");function od(l){return l!=null&&typeof l=="object"&&"$$typeof"in l&&l.$$typeof===OS&&"_payload"in l&&ng(l._payload)}xn(od,"isLazyComponent");function ng(l){return typeof l=="object"&&l!==null&&"then"in l}xn(ng,"isPromiseLike");var US=xn(l=>`${l} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),LS=xn(l=>`${l} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ro=Cv[" use ".trim().toString()],HS=Object.defineProperty,BS=(l,i)=>HS(l,"name",{value:i,configurable:!0}),qS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xi=qS.reduce((l,i)=>{const u=_d(`Primitive.${i}`),c=b.forwardRef((d,m)=>{const{asChild:p,...y}=d,v=p?u:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(v,{...y,ref:m})});return c.displayName=`Primitive.${i}`,{...l,[i]:c}},{});function YS(l,i){l&&gp.flushSync(()=>l.dispatchEvent(i))}BS(YS,"dispatchDiscreteCustomEvent");var GS=Object.defineProperty,ln=(l,i)=>GS(l,"name",{value:i,configurable:!0});function VS(l,i){const u=b.createContext(i);u.displayName=l+"Context";const c=ln(m=>{const{children:p,...y}=m,v=b.useMemo(()=>y,Object.values(y));return o.jsx(u.Provider,{value:v,children:p})},"Provider");c.displayName=l+"Provider";function d(m,p={}){const{optional:y=!1}=p,v=b.useContext(u);if(v)return v;if(i!==void 0)return i;if(!y)throw new Error(`\`${m}\` must be used within \`${l}\``)}return ln(d,"useContext"),[c,d]}ln(VS,"createContext");function lg(l,i=[]){let u=[];function c(m,p){const y=b.createContext(p);y.displayName=m+"Context";const v=u.length;u=[...u,p];const h=ln(g=>{var z;const{scope:w,children:E,...j}=g,C=((z=w==null?void 0:w[l])==null?void 0:z[v])||y,_=b.useMemo(()=>j,Object.values(j));return o.jsx(C.Provider,{value:_,children:E})},"Provider");h.displayName=m+"Provider";function S(g,w,E={}){var z;const{optional:j=!1}=E,C=((z=w==null?void 0:w[l])==null?void 0:z[v])||y,_=b.useContext(C);if(_)return _;if(p!==void 0)return p;if(!j)throw new Error(`\`${g}\` must be used within \`${m}\``)}return ln(S,"useContext"),[h,S]}ln(c,"createContext");const d=ln(()=>{const m=u.map(p=>b.createContext(p));return ln(function(y){const v=(y==null?void 0:y[l])||m;return b.useMemo(()=>({[`__scope${l}`]:{...y,[l]:v}}),[y,v])},"useScope")},"createScope");return d.scopeName=l,[c,rg(d,...i)]}ln(lg,"createContextScope");function rg(...l){const i=l[0];if(l.length===1)return i;const u=ln(()=>{const c=l.map(d=>({useScope:d(),scopeName:d.scopeName}));return ln(function(m){const p=c.reduce((y,{useScope:v,scopeName:h})=>{const g=v(m)[`__scope${h}`];return{...y,...g}},{});return b.useMemo(()=>({[`__scope${i.scopeName}`]:p}),[p])},"useComposedScopes")},"createScope");return u.scopeName=i.scopeName,u}ln(rg,"composeContextScopes");var XS=Object.defineProperty,ys=(l,i)=>XS(l,"name",{value:i,configurable:!0}),sg=!!(typeof window<"u"&&window.document&&window.document.createElement);function Il(l,i,{checkForDefaultPrevented:u=!0}={}){return ys(function(d){if(l==null||l(d),u===!1||!d||!d.defaultPrevented)return i==null?void 0:i(d)},"handleEvent")}ys(Il,"composeEventHandlers");function QS(l){var i;if(!sg)throw new Error("Cannot access window outside of the DOM");return((i=l==null?void 0:l.ownerDocument)==null?void 0:i.defaultView)??window}ys(QS,"getOwnerWindow");function cd(l){if(!sg)throw new Error("Cannot access document outside of the DOM");return(l==null?void 0:l.ownerDocument)??document}ys(cd,"getOwnerDocument");function ig(l,i=!1){const{activeElement:u}=cd(l);if(!(u!=null&&u.nodeName))return null;if(og(u)&&u.contentDocument)return ig(u.contentDocument.body,i);if(i){const c=u.getAttribute("aria-activedescendant");if(c){const d=cd(u).getElementById(c);if(d)return d}}return u}ys(ig,"getActiveElement");function og(l){return l.tagName==="IFRAME"}ys(og,"isFrame");var ud=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},ZS=Object.defineProperty,hl=(l,i)=>ZS(l,"name",{value:i,configurable:!0});function cg(l,i){return b.useReducer((u,c)=>i[u][c]??u,l)}hl(cg,"useStateMachine");var Xo=hl(l=>{const{present:i,children:u}=l,c=ug(i),d=typeof u=="function"?u({present:c.isPresent}):b.Children.only(u),m=dg(c.ref,fg(d));return typeof u=="function"||c.isPresent?b.cloneElement(d,{ref:m}):null},"Presence");function ug(l){const[i,u]=b.useState(),c=b.useRef(null),d=b.useRef(l),m=b.useRef("none"),p=b.useRef(void 0),y=l?"mounted":"unmounted",[v,h]=cg(y,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{v==="mounted"?(m.current=p.current??ds(c.current),p.current=void 0):m.current="none"},[v]),ud(()=>{const S=c.current,g=d.current;if(g!==l){const E=m.current,j=ds(S);l?(p.current=j,h("MOUNT")):j==="none"||(S==null?void 0:S.display)==="none"?h("UNMOUNT"):h(g&&E!==j?"ANIMATION_OUT":"UNMOUNT"),d.current=l}},[l,h]),ud(()=>{if(i){let S;const g=i.ownerDocument.defaultView??window,w=hl(j=>{const _=ds(c.current).includes(CSS.escape(j.animationName));if(j.target===i&&_&&(h("ANIMATION_END"),!d.current)){const z=i.style.animationFillMode;i.style.animationFillMode="forwards",S=g.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=z)})}},"handleAnimationEnd"),E=hl(j=>{j.target===i&&(m.current=ds(c.current))},"handleAnimationStart");return i.addEventListener("animationstart",E),i.addEventListener("animationcancel",w),i.addEventListener("animationend",w),()=>{g.clearTimeout(S),i.removeEventListener("animationstart",E),i.removeEventListener("animationcancel",w),i.removeEventListener("animationend",w)}}else h("ANIMATION_END")},[i,h]),{isPresent:["mounted","unmountSuspended"].includes(v),ref:b.useCallback(S=>{if(S){const g=getComputedStyle(S);c.current=g,p.current=ds(g)}else c.current=null;u(S)},[])}}hl(ug,"usePresence");function dd(l,i){if(typeof l=="function")return l(i);l!=null&&(l.current=i)}hl(dd,"setRef");function dg(...l){const i=b.useRef(l);return i.current=l,b.useCallback(u=>{const c=i.current;let d=!1;const m=c.map(p=>{const y=dd(p,u);return!d&&typeof y=="function"&&(d=!0),y});if(d)return()=>{for(let p=0;p<m.length;p++){const y=m[p];typeof y=="function"?y():dd(c[p],null)}}},[])}hl(dg,"useStableComposedRefs");function ds(l){return(l==null?void 0:l.animationName)||"none"}hl(ds,"getAnimationName");function fg(l){var c,d;let i=(c=Object.getOwnPropertyDescriptor(l.props,"ref"))==null?void 0:c.get,u=i&&"isReactWarning"in i&&i.isReactWarning;return u?l.ref:(i=(d=Object.getOwnPropertyDescriptor(l,"ref"))==null?void 0:d.get,u=i&&"isReactWarning"in i&&i.isReactWarning,u?l.props.ref:l.props.ref||l.ref)}hl(fg,"getElementRef");var KS=Object.defineProperty,$S=(l,i)=>KS(l,"name",{value:i,configurable:!0}),JS=b.createContext(void 0);function mg(l){const i=b.useContext(JS);return l||i||"ltr"}$S(mg,"useDirection");var WS=Object.defineProperty,IS=(l,i)=>WS(l,"name",{value:i,configurable:!0});function Wl(l){const i=b.useRef(l);return b.useEffect(()=>{i.current=l}),b.useMemo(()=>((...u)=>{var c;return(c=i.current)==null?void 0:c.call(i,...u)}),[])}IS(Wl,"useCallbackRef");var FS=Object.defineProperty,PS=(l,i)=>FS(l,"name",{value:i,configurable:!0});function hg(l,[i,u]){return Math.min(u,Math.max(i,l))}PS(hg,"clamp");var ew=Object.defineProperty,Ue=(l,i)=>ew(l,"name",{value:i,configurable:!0});function pg(l,i){return b.useReducer((u,c)=>i[u][c]??u,l)}Ue(pg,"useStateMachine");var gg="ScrollArea",[vg,qw]=lg(gg),[tw,on]=vg(gg),aw=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,type:d="hover",dir:m,scrollHideDelay:p=600,...y}=i,[v,h]=b.useState(null),[S,g]=b.useState(null),[w,E]=b.useState(null),[j,C]=b.useState(null),[_,z]=b.useState(null),[L,K]=b.useState(0),[ee,J]=b.useState(0),[I,Z]=b.useState(!1),[Q,pe]=b.useState(!1),xe=er(u,h),Ee=mg(m);return o.jsx(tw,{scope:c,type:d,dir:Ee,scrollHideDelay:p,scrollArea:v,viewport:S,onViewportChange:g,content:w,onContentChange:E,scrollbarX:j,onScrollbarXChange:C,scrollbarXEnabled:I,onScrollbarXEnabledChange:Z,scrollbarY:_,onScrollbarYChange:z,scrollbarYEnabled:Q,onScrollbarYEnabledChange:pe,onCornerWidthChange:K,onCornerHeightChange:J,children:o.jsx(xi.div,{dir:Ee,...y,ref:xe,style:{position:"relative","--radix-scroll-area-corner-width":L+"px","--radix-scroll-area-corner-height":ee+"px",...i.style}})})},"ScrollArea")),nw="ScrollAreaViewport",lw=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,children:d,nonce:m,...p}=i,y=on(nw,c),v=b.useRef(null),h=er(u,v,y.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx(rw,{nonce:m}),o.jsx(xi.div,{"data-radix-scroll-area-viewport":"",...p,ref:h,style:{overflowX:y.scrollbarXEnabled?"scroll":"hidden",overflowY:y.scrollbarYEnabled?"scroll":"hidden",...i.style},children:o.jsx("div",{ref:y.onContentChange,style:{minWidth:"100%",display:"table"},children:d})})]})},"ScrollAreaViewport")),rw=b.memo(Ue(function({nonce:i}){return o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i})},"ScrollAreaViewportStyle"),(l,i)=>l.nonce===i.nonce),gl="ScrollAreaScrollbar",sw=b.forwardRef(Ue(function(i,u){const{forceMount:c,...d}=i,m=on(gl,i.__scopeScrollArea),{onScrollbarXEnabledChange:p,onScrollbarYEnabledChange:y}=m,v=i.orientation==="horizontal";return b.useEffect(()=>(v?p(!0):y(!0),()=>{v?p(!1):y(!1)}),[v,p,y]),m.type==="hover"?o.jsx(iw,{...d,ref:u,forceMount:c}):m.type==="scroll"?o.jsx(ow,{...d,ref:u,forceMount:c}):m.type==="auto"?o.jsx(yg,{...d,ref:u,forceMount:c}):m.type==="always"?o.jsx(Rd,{...d,ref:u,"data-state":"visible"}):null},"ScrollAreaScrollbar")),iw=b.forwardRef(Ue(function(i,u){const{forceMount:c,...d}=i,m=on(gl,i.__scopeScrollArea),[p,y]=b.useState(!1);return b.useEffect(()=>{const v=m.scrollArea;let h=0;if(v){const S=Ue(()=>{window.clearTimeout(h),y(!0)},"handlePointerEnter"),g=Ue(()=>{h=window.setTimeout(()=>y(!1),m.scrollHideDelay)},"handlePointerLeave");return v.addEventListener("pointerenter",S),v.addEventListener("pointerleave",g),()=>{window.clearTimeout(h),v.removeEventListener("pointerenter",S),v.removeEventListener("pointerleave",g)}}},[m.scrollArea,m.scrollHideDelay]),o.jsx(Xo,{present:c||p,children:o.jsx(yg,{"data-state":p?"visible":"hidden",...d,ref:u})})},"ScrollAreaScrollbarHover")),ow=b.forwardRef(Ue(function(i,u){const{forceMount:c,...d}=i,m=on(gl,i.__scopeScrollArea),p=i.orientation==="horizontal",y=Si(()=>h("SCROLL_END"),100),[v,h]=pg("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(v==="idle"){const S=window.setTimeout(()=>h("HIDE"),m.scrollHideDelay);return()=>window.clearTimeout(S)}},[v,m.scrollHideDelay,h]),b.useEffect(()=>{const S=m.viewport,g=p?"scrollLeft":"scrollTop";if(S){let w=S[g];const E=Ue(()=>{const j=S[g];w!==j&&(h("SCROLL"),y()),w=j},"handleScroll");return S.addEventListener("scroll",E),()=>S.removeEventListener("scroll",E)}},[m.viewport,p,h,y]),o.jsx(Xo,{present:c||v!=="hidden",children:o.jsx(Rd,{"data-state":v==="hidden"?"hidden":"visible",...d,ref:u,onPointerEnter:Il(i.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Il(i.onPointerLeave,()=>h("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),yg=b.forwardRef(Ue(function(i,u){const c=on(gl,i.__scopeScrollArea),{forceMount:d,...m}=i,[p,y]=b.useState(!1),v=i.orientation==="horizontal",h=Si(()=>{if(c.viewport){const S=c.viewport.offsetWidth<c.viewport.scrollWidth,g=c.viewport.offsetHeight<c.viewport.scrollHeight;y(v?S:g)}},10);return Ar(c.viewport,h),Ar(c.content,h),o.jsx(Xo,{present:d||p,children:o.jsx(Rd,{"data-state":p?"visible":"hidden",...m,ref:u})})},"ScrollAreaScrollbarAuto")),Rd=b.forwardRef(Ue(function(i,u){const{orientation:c="vertical",...d}=i,m=on(gl,i.__scopeScrollArea),p=b.useRef(null),y=b.useRef(0),[v,h]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),S=Md(v.viewport,v.content),g={...d,sizes:v,onSizesChange:h,hasThumb:S>0&&S<1,onThumbChange:Ue(E=>p.current=E,"onThumbChange"),onThumbPointerUp:Ue(()=>y.current=0,"onThumbPointerUp"),onThumbPointerDown:Ue(E=>y.current=E,"onThumbPointerDown")};function w(E,j){return wg(E,y.current,v,j)}return Ue(w,"getScrollPosition"),c==="horizontal"?o.jsx(cw,{...g,ref:u,onThumbPositionChange:()=>{if(m.viewport&&p.current){const E=m.viewport.scrollLeft,j=md(E,v,m.dir);p.current.style.transform=`translate3d(${j}px, 0, 0)`}},onWheelScroll:E=>{m.viewport&&(m.viewport.scrollLeft=E)},onDragScroll:E=>{m.viewport&&(m.viewport.scrollLeft=w(E,m.dir))}}):c==="vertical"?o.jsx(uw,{...g,ref:u,onThumbPositionChange:()=>{if(m.viewport&&p.current){const E=m.viewport.scrollTop,j=md(E,v);p.current.style.transform=`translate3d(0, ${j}px, 0)`}},onWheelScroll:E=>{m.viewport&&(m.viewport.scrollTop=E)},onDragScroll:E=>{m.viewport&&(m.viewport.scrollTop=w(E))}}):null},"ScrollAreaScrollbarVisible")),cw=b.forwardRef(Ue(function(i,u){const{sizes:c,onSizesChange:d,...m}=i,p=on(gl,i.__scopeScrollArea),[y,v]=b.useState(),h=b.useRef(null),S=er(u,h,p.onScrollbarXChange);return b.useEffect(()=>{h.current&&v(getComputedStyle(h.current))},[h]),o.jsx(bg,{"data-orientation":"horizontal",...m,ref:S,sizes:c,style:{bottom:0,left:p.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:p.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":bi(c)+"px",...i.style},onThumbPointerDown:g=>i.onThumbPointerDown(g.x),onDragScroll:g=>i.onDragScroll(g.x),onWheelScroll:(g,w)=>{if(p.viewport){const E=p.viewport.scrollLeft+g.deltaX;i.onWheelScroll(E),Dd(E,w)&&g.preventDefault()}},onResize:()=>{h.current&&p.viewport&&y&&d({content:p.viewport.scrollWidth,viewport:p.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:hi(y.paddingLeft),paddingEnd:hi(y.paddingRight)}})}})},"ScrollAreaScrollbarX")),uw=b.forwardRef(Ue(function(i,u){const{sizes:c,onSizesChange:d,...m}=i,p=on(gl,i.__scopeScrollArea),[y,v]=b.useState(),h=b.useRef(null),S=er(u,h,p.onScrollbarYChange);return b.useEffect(()=>{h.current&&v(getComputedStyle(h.current))},[h]),o.jsx(bg,{"data-orientation":"vertical",...m,ref:S,sizes:c,style:{top:0,right:p.dir==="ltr"?0:void 0,left:p.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":bi(c)+"px",...i.style},onThumbPointerDown:g=>i.onThumbPointerDown(g.y),onDragScroll:g=>i.onDragScroll(g.y),onWheelScroll:(g,w)=>{if(p.viewport){const E=p.viewport.scrollTop+g.deltaY;i.onWheelScroll(E),Dd(E,w)&&g.preventDefault()}},onResize:()=>{h.current&&p.viewport&&y&&d({content:p.viewport.scrollHeight,viewport:p.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:hi(y.paddingTop),paddingEnd:hi(y.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[dw,xg]=vg(gl),bg=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,sizes:d,hasThumb:m,onThumbChange:p,onThumbPointerUp:y,onThumbPointerDown:v,onThumbPositionChange:h,onDragScroll:S,onWheelScroll:g,onResize:w,...E}=i,j=on(gl,c),[C,_]=b.useState(null),z=er(u,_),L=b.useRef(null),K=b.useRef(""),ee=j.viewport,J=d.content-d.viewport,I=Wl(g),Z=Wl(h),Q=Si(w,10);function pe(xe){if(L.current){const Ee=xe.clientX-L.current.left,Re=xe.clientY-L.current.top;S({x:Ee,y:Re})}}return Ue(pe,"handleDragScroll"),b.useEffect(()=>{const xe=Ue(Ee=>{const Re=Ee.target;(C==null?void 0:C.contains(Re))&&I(Ee,J)},"handleWheel");return document.addEventListener("wheel",xe,{passive:!1}),()=>document.removeEventListener("wheel",xe,{passive:!1})},[ee,C,J,I]),b.useEffect(Z,[d,Z]),Ar(C,Q),Ar(j.content,Q),o.jsx(dw,{scope:c,scrollbar:C,hasThumb:m,onThumbChange:Wl(p),onThumbPointerUp:Wl(y),onThumbPositionChange:Z,onThumbPointerDown:Wl(v),children:o.jsx(xi.div,{...E,ref:z,style:{position:"absolute",...E.style},onPointerDown:Il(i.onPointerDown,xe=>{xe.button===0&&(xe.target.setPointerCapture(xe.pointerId),L.current=C.getBoundingClientRect(),K.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",j.viewport&&(j.viewport.style.scrollBehavior="auto"),pe(xe))}),onPointerMove:Il(i.onPointerMove,pe),onPointerUp:Il(i.onPointerUp,xe=>{const Ee=xe.target;Ee.hasPointerCapture(xe.pointerId)&&Ee.releasePointerCapture(xe.pointerId),document.body.style.webkitUserSelect=K.current,j.viewport&&(j.viewport.style.scrollBehavior=""),L.current=null})})})},"ScrollAreaScrollbarImpl")),fd="ScrollAreaThumb",fw=b.forwardRef(Ue(function(i,u){const{forceMount:c,...d}=i,m=xg(fd,i.__scopeScrollArea);return o.jsx(Xo,{present:c||m.hasThumb,children:o.jsx(mw,{ref:u,...d})})},"ScrollAreaThumb")),mw=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,style:d,...m}=i,p=on(fd,c),y=xg(fd,c),{onThumbPositionChange:v}=y,h=er(u,y.onThumbChange),S=b.useRef(void 0),g=Si(()=>{S.current&&(S.current(),S.current=void 0)},100);return b.useEffect(()=>{const w=p.viewport;if(w){const E=Ue(()=>{if(g(),!S.current){const j=gw(w,v);S.current=j,v()}},"handleScroll");return v(),w.addEventListener("scroll",E),()=>w.removeEventListener("scroll",E)}},[p.viewport,g,v]),o.jsx(xi.div,{"data-state":y.hasThumb?"visible":"hidden",...m,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...d},onPointerDownCapture:Il(i.onPointerDownCapture,w=>{const j=w.target.getBoundingClientRect(),C=w.clientX-j.left,_=w.clientY-j.top;y.onThumbPointerDown({x:C,y:_})}),onPointerUp:Il(i.onPointerUp,y.onThumbPointerUp)})},"ScrollAreaThumbImpl")),Sg="ScrollAreaCorner",hw=b.forwardRef(Ue(function(i,u){const c=on(Sg,i.__scopeScrollArea),d=!!(c.scrollbarX&&c.scrollbarY);return c.type!=="scroll"&&d?o.jsx(pw,{...i,ref:u}):null},"ScrollAreaCorner")),pw=b.forwardRef(Ue(function(i,u){const{__scopeScrollArea:c,...d}=i,m=on(Sg,c),[p,y]=b.useState(0),[v,h]=b.useState(0),S=!!(p&&v),{onCornerWidthChange:g,onCornerHeightChange:w}=m;return Ar(m.scrollbarX,()=>{var j;const E=((j=m.scrollbarX)==null?void 0:j.offsetHeight)||0;m.onCornerHeightChange(E),h(E)}),Ar(m.scrollbarY,()=>{var j;const E=((j=m.scrollbarY)==null?void 0:j.offsetWidth)||0;m.onCornerWidthChange(E),y(E)}),b.useEffect(()=>()=>{g(0),w(0)},[g,w]),S?o.jsx(xi.div,{...d,ref:u,style:{width:p,height:v,position:"absolute",right:m.dir==="ltr"?0:void 0,left:m.dir==="rtl"?0:void 0,bottom:0,...i.style}}):null},"ScrollAreaCornerImpl"));function hi(l){return l?parseInt(l,10):0}Ue(hi,"toInt");function Md(l,i){const u=l/i;return isNaN(u)?0:u}Ue(Md,"getThumbRatio");function bi(l){const i=Md(l.viewport,l.content),u=l.scrollbar.paddingStart+l.scrollbar.paddingEnd,c=(l.scrollbar.size-u)*i;return Math.max(c,18)}Ue(bi,"getThumbSize");function wg(l,i,u,c="ltr"){const d=bi(u),m=d/2,p=i||m,y=d-p,v=u.scrollbar.paddingStart+p,h=u.scrollbar.size-u.scrollbar.paddingEnd-y,S=u.content-u.viewport,g=c==="ltr"?[0,S]:[S*-1,0];return kd([v,h],g)(l)}Ue(wg,"getScrollPositionFromPointer");function md(l,i,u="ltr"){const c=bi(i),d=i.scrollbar.paddingStart+i.scrollbar.paddingEnd,m=i.scrollbar.size-d,p=i.content-i.viewport,y=m-c,v=u==="ltr"?[0,p]:[p*-1,0],h=hg(l,v);return kd([0,p],[0,y])(h)}Ue(md,"getThumbOffsetFromScroll");function kd(l,i){return u=>{if(l[0]===l[1]||i[0]===i[1])return i[0];const c=(i[1]-i[0])/(l[1]-l[0]);return i[0]+c*(u-l[0])}}Ue(kd,"linearScale");function Dd(l,i){return l>0&&l<i}Ue(Dd,"isScrollingWithinScrollbarBounds");var gw=Ue((l,i=()=>{})=>{let u={left:l.scrollLeft,top:l.scrollTop},c=0;return Ue((function d(){const m={left:l.scrollLeft,top:l.scrollTop},p=u.left!==m.left,y=u.top!==m.top;(p||y)&&i(),u=m,c=window.requestAnimationFrame(d)}),"loop")(),()=>window.cancelAnimationFrame(c)},"addUnlinkedScrollListener");function Si(l,i){const u=Wl(l),c=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(c.current),[]),b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(u,i)},[u,i])}Ue(Si,"useDebounceCallback");function Ar(l,i){const u=Wl(i);ud(()=>{let c=0;if(l){const d=new ResizeObserver(()=>{cancelAnimationFrame(c),c=window.requestAnimationFrame(u)});return d.observe(l),()=>{window.cancelAnimationFrame(c),d.unobserve(l)}}},[l,u])}Ue(Ar,"useResizeObserver");var vw=aw,yw=lw,xw=hw;const bw=Zp("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Jt({className:l,variant:i="default",asChild:u=!1,...c}){const d=u?Fp:"span";return o.jsx(d,{"data-slot":"badge","data-variant":i,className:Pt(bw({variant:i}),l),...c})}function qn({isConnected:l}){const{projects:i,selectedProjectId:u,setSelectedProjectId:c,projectApiKey:d}=Hn(),{apiUrl:m,token:p}=ya(),[y,v]=b.useState(!1);return b.useEffect(()=>{const h=d||p;if(!h)return;const S=async()=>{try{const w={Authorization:`Bearer ${h}`};u&&(w["x-project-id"]=u);const E=await fetch(`${m}/v1/system/metrics`,{headers:w});if(E.ok){const C=(await E.json()).streams||{},_=Math.max(...Object.values(C),0);v(_>8e4)}}catch{}};S();const g=setInterval(()=>void S(),1e4);return()=>clearInterval(g)},[m,d,u,p]),o.jsx("header",{className:"sticky top-0 z-40 w-full border-b border-border bg-background",children:o.jsxs("div",{className:"container mx-auto flex h-14 items-center justify-between px-4",children:[o.jsxs("div",{className:"flex items-center gap-2 font-bold text-lg tracking-tight",children:[o.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted text-foreground border border-border",children:o.jsx(bp,{className:"h-4 w-4 text-foreground"})}),"Notifkit ",o.jsx("span",{className:"text-muted-foreground font-normal",children:"Observability"})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[y&&o.jsxs(Jt,{variant:"destructive",className:"flex items-center gap-1.5 px-2.5 py-1 text-xs",children:[o.jsx(Go,{className:"h-3.5 w-3.5"}),"Queue Backpressure Warning (>80% Cap)"]}),i.length>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ed,{className:"h-4 w-4 text-muted-foreground"}),o.jsx("select",{className:"bg-muted border border-border text-sm rounded-md px-2.5 py-1.5 outline-none cursor-pointer text-foreground max-w-[200px] truncate",value:u,onChange:h=>c(h.target.value),children:i.map(h=>o.jsx("option",{value:h.id,children:h.name},h.id))})]}),o.jsxs(Jt,{variant:l?"default":"destructive",className:"flex items-center gap-1.5 px-3 py-1",children:[o.jsx(Nd,{className:"h-3.5 w-3.5"}),l?"Live Stream Active":"Disconnected"]})]})]})})}function Tt({className:l,...i}){return o.jsx("div",{"data-slot":"card",className:Pt("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",l),...i})}function zt({className:l,...i}){return o.jsx("div",{"data-slot":"card-header",className:Pt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",l),...i})}function _t({className:l,...i}){return o.jsx("div",{"data-slot":"card-title",className:Pt("leading-none font-semibold",l),...i})}function rn({className:l,...i}){return o.jsx("div",{"data-slot":"card-description",className:Pt("text-sm text-muted-foreground",l),...i})}function Rt({className:l,...i}){return o.jsx("div",{"data-slot":"card-content",className:Pt("px-6",l),...i})}function Sw({className:l,children:i,...u}){return o.jsxs(vw,{"data-slot":"scroll-area",className:Pt("relative",l),...u,children:[o.jsx(yw,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:i}),o.jsx(ww,{}),o.jsx(xw,{})]})}function ww({className:l,orientation:i="vertical",...u}){return o.jsx(sw,{"data-slot":"scroll-area-scrollbar",orientation:i,className:Pt("flex touch-none p-px transition-colors select-none",i==="vertical"&&"h-full w-2.5 border-l border-l-transparent",i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",l),...u,children:o.jsx(fw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function jw({setIsConnected:l}){const[i,u]=b.useState([]),{projects:c,selectedProjectId:d,projectApiKey:m,isLoadingProjects:p}=Hn(),{apiUrl:y}=ya();return b.useEffect(()=>{if(!m||!d)return;l(!1);const v=new EventSource(`${y}/v1/events/stream?token=${encodeURIComponent(m)}&projectId=${encodeURIComponent(d)}`);v.onopen=()=>{l(!0),Ge.success("Connected to real-time feed")},v.onerror=()=>{l(!1)};const h=g=>{try{const w=JSON.parse(g.data),E={id:crypto.randomUUID(),type:"delivered",taskId:w.taskId,channel:w.channel,providerMessageId:w.providerMessageId,timestamp:new Date};u(j=>[E,...j].slice(0,100))}catch(w){console.error("Failed to parse delivered event",w)}},S=g=>{try{const w=JSON.parse(g.data),E={id:crypto.randomUUID(),type:"failed",taskId:w.taskId,channel:w.channel,error:w.error,timestamp:new Date};u(j=>[E,...j].slice(0,100))}catch(w){console.error("Failed to parse failed event",w)}};return v.addEventListener("delivery:delivered",h),v.addEventListener("delivery:failed",S),()=>{v.removeEventListener("delivery:delivered",h),v.removeEventListener("delivery:failed",S),v.close()}},[y,m,d,l]),o.jsxs(Tt,{className:"h-full flex flex-col border-border bg-card",children:[o.jsxs(zt,{className:"pb-3 border-b border-border flex flex-row items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(_t,{className:"text-xl flex items-center gap-2",children:[o.jsx(Nw,{}),"Live Activity Feed"]}),o.jsx(rn,{children:"Real-time delivery events from the notification pipeline"})]}),o.jsxs("div",{className:"flex items-center gap-2 text-sm bg-muted p-1.5 rounded-md border border-border px-3",children:[o.jsx(jb,{className:"w-4 h-4 text-muted-foreground"}),o.jsx("span",{className:"text-xs font-medium text-foreground",children:"Instant Stream"})]})]}),o.jsx(Rt,{className:"flex-1 p-0 overflow-hidden",children:o.jsx(Sw,{className:"h-full min-h-[500px] w-full px-6 py-4",children:p?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"Loading projects..."})]}):c.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No projects exist. Create one in the Projects & Keys tab."})]}):m?i.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"Waiting for events..."})]}):o.jsx("div",{className:"flex flex-col gap-3",children:i.map(v=>o.jsxs("div",{className:"rounded-lg border border-border p-4 bg-card hover:bg-muted/50 transition-colors shadow-xs",children:[o.jsxs("div",{className:"flex justify-between items-start mb-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[v.type==="delivered"?o.jsx(hs,{className:"h-4 w-4 text-foreground"}):o.jsx(Yo,{className:"h-4 w-4 text-destructive"}),o.jsx("span",{className:"font-semibold text-sm capitalize",children:v.type})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:v.timestamp.toLocaleTimeString()})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm mt-3",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Channel"}),o.jsx(Jt,{variant:"secondary",className:"w-fit mt-1 text-xs capitalize font-normal",children:v.channel})]}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Task ID"}),o.jsx("span",{className:"font-mono text-xs truncate mt-1 text-foreground",children:v.taskId})]})]}),v.error&&o.jsx("div",{className:"mt-3 text-xs bg-destructive/10 text-destructive p-2.5 rounded-md border border-destructive/20 font-mono",children:v.error})]},v.id))}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No API key found for this project."})]})})})]})}function Nw(){return o.jsxs("div",{className:"relative flex h-2.5 w-2.5",children:[o.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),o.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-primary"})]})}function G0(){const[l,i]=b.useState(!1);return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:l}),o.jsx("main",{className:"flex-1 container mx-auto p-4 md:p-6",children:o.jsx("div",{className:"pb-4",children:o.jsx("div",{className:"min-h-[500px]",children:o.jsx(jw,{setIsConnected:i})})})})]})}const Ew=Zp("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ke({className:l,variant:i="default",size:u="default",asChild:c=!1,...d}){const m=c?Fp:"button";return o.jsx(m,{"data-slot":"button","data-variant":i,"data-size":u,className:Pt(Ew({variant:i,size:u,className:l})),...d})}function pi({className:l,type:i,...u}){return o.jsx("input",{type:i,"data-slot":"input",className:Pt("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",l),...u})}function Aw(){const{login:l}=ya(),[i,u]=b.useState(""),[c,d]=b.useState(""),[m,p]=b.useState(!1),[y,v]=b.useState(null),h=async S=>{if(S.preventDefault(),!i.trim()||!c){v("Please enter both your email/user ID and password.");return}p(!0),v(null);const g=await l(i.trim(),c);p(!1),g.success?Ge.success("Welcome back!",{description:"Logged in successfully."}):(v(g.error||"Invalid email/user ID or password."),Ge.error("Authentication failed",{description:g.error}))};return o.jsx("div",{className:"min-h-screen w-full flex items-center justify-center p-4 bg-background",children:o.jsxs("div",{className:"w-full max-w-md",children:[o.jsxs("div",{className:"flex flex-col items-center mb-8 text-center",children:[o.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-primary text-primary-foreground mb-4",children:o.jsx(bp,{className:"h-6 w-6"})}),o.jsx("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Notifkit Admin"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sign in to access your notification engine and observability suite."})]}),o.jsxs(Tt,{className:"border-border bg-card shadow-sm",children:[o.jsxs(zt,{className:"space-y-1 pb-4",children:[o.jsx(_t,{className:"text-lg font-semibold",children:"Admin Login"}),o.jsx(rn,{className:"text-xs",children:"Enter your admin credentials below"})]}),o.jsxs(Rt,{children:[y&&o.jsxs("div",{className:"mb-4 flex items-center gap-2 p-3 text-xs rounded-md bg-destructive/10 text-destructive border border-destructive/20",children:[o.jsx(qo,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{children:y})]}),o.jsxs("form",{onSubmit:S=>{S.preventDefault(),h(S)},className:"space-y-4",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"text-xs font-medium text-foreground flex items-center gap-1.5",children:[o.jsx(Rb,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Email or Username"]}),o.jsx(pi,{type:"text",required:!0,autoFocus:!0,placeholder:"admin@example.com",value:i,onChange:S=>u(S.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"text-xs font-medium text-foreground flex items-center gap-1.5",children:[o.jsx(ab,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Password"]}),o.jsx(pi,{type:"password",required:!0,placeholder:"••••••••••••",value:c,onChange:S=>d(S.target.value)})]}),o.jsx(Ke,{type:"submit",disabled:m,className:"w-full mt-2",children:m?o.jsxs(o.Fragment,{children:[o.jsx(mi,{className:"h-4 w-4 animate-spin mr-2"}),o.jsx("span",{children:"Signing in..."})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{children:"Sign In"}),o.jsx(Nx,{className:"h-4 w-4 ml-2"})]})})]}),o.jsxs("div",{className:"mt-6 pt-4 border-t border-border flex items-center justify-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Eb,{className:"h-3.5 w-3.5 text-foreground"}),o.jsx("span",{children:"Protected by salted Scrypt & Redis session auth"})]})]})]})]})})}function xs({className:l,...i}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:Pt("w-full caption-bottom text-sm",l),...i})})}function bs({className:l,...i}){return o.jsx("thead",{"data-slot":"table-header",className:Pt("[&_tr]:border-b",l),...i})}function Ss({className:l,...i}){return o.jsx("tbody",{"data-slot":"table-body",className:Pt("[&_tr:last-child]:border-0",l),...i})}function qt({className:l,...i}){return o.jsx("tr",{"data-slot":"table-row",className:Pt("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",l),...i})}function Je({className:l,...i}){return o.jsx("th",{"data-slot":"table-head",className:Pt("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...i})}function ke({className:l,...i}){return o.jsx("td",{"data-slot":"table-cell",className:Pt("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",l),...i})}function Cw(){const[l,i]=b.useState([]),[u,c]=b.useState(null),[d,m]=b.useState([null]),[p,y]=b.useState(0),[v,h]=b.useState(!1),[S,g]=b.useState(""),[w,E]=b.useState(""),[j,C]=b.useState(""),[_,z]=b.useState(null),[L,K]=b.useState([]),[ee,J]=b.useState(!1),{projects:I,selectedProjectId:Z,projectApiKey:Q,isLoadingProjects:pe}=Hn(),{apiUrl:xe}=ya(),Ee=b.useCallback(async(ne,ge,M)=>{h(!0);try{const G=new URLSearchParams({limit:"25"});M&&G.set("cursor",M),S&&G.set("search",S),w&&G.set("channel",w),j&&G.set("status",j);const re=await fetch(`${xe}/v1/notifications/logs?${G.toString()}`,{headers:{Authorization:`Bearer ${ne}`,"x-project-id":ge}});if(!re.ok)throw new Error(`Failed to fetch: ${re.statusText}`);const Se=await re.json();i(Se.logs||[]),c(Se.nextCursor||null)}catch(G){console.error(G),Ge.error("Failed to fetch logs")}finally{h(!1)}},[xe,S,w,j]);b.useEffect(()=>{Q&&Z?(m([null]),y(0),Ee(Q,Z,null)):i([])},[Q,Z,S,w,j,Ee]),b.useEffect(()=>{_&&Q&&Z?(J(!0),fetch(`${xe}/v1/notifications/${_.taskId}`,{headers:{Authorization:`Bearer ${Q}`,"x-project-id":Z}}).then(ne=>ne.ok?ne.json():null).then(ne=>{if(ne&&ne.logs){const ge=[...ne.logs].sort((M,G)=>new Date(M.timestamp).getTime()-new Date(G.timestamp).getTime());K(ge)}else K([_])}).catch(()=>K([_])).finally(()=>J(!1))):K([])},[xe,_,Q,Z]);const Re=()=>{if(u&&Q&&Z){const ne=[...d.slice(0,p+1),u];m(ne),y(p+1),Ee(Q,Z,u)}},Xe=()=>{if(p>0&&Q&&Z){const ne=d[p-1]??null;y(p-1),Ee(Q,Z,ne)}};return o.jsxs(Tt,{className:"h-full flex flex-col border-border bg-card",children:[o.jsxs(zt,{className:"pb-3 border-b border-border space-y-3",children:[o.jsxs("div",{className:"flex flex-row items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(_t,{className:"text-xl flex items-center gap-2",children:[o.jsx(wp,{className:"h-5 w-5 text-foreground"}),"Historical Dispatches & Audit Logs"]}),o.jsx(rn,{children:"Comprehensive notification audit trail with payload context"})]}),o.jsx(Ke,{variant:"outline",size:"icon",onClick:()=>{Q&&Z&&Ee(Q,Z,d[p])},disabled:v||!Q||!Z,className:"h-8 w-8 rounded-md border-border",children:o.jsx(Cr,{className:`h-4 w-4 ${v?"animate-spin":""}`})})]}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 pt-2",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Tp,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(pi,{type:"text",placeholder:"Search Task ID or Template...",value:S,onChange:ne=>g(ne.target.value),className:"pl-9 text-xs font-mono"})]}),o.jsxs("select",{value:w,onChange:ne=>E(ne.target.value),className:"px-3 py-1.5 bg-background border border-input rounded-md text-xs focus:outline-none focus:ring-1 focus:ring-ring text-foreground",children:[o.jsx("option",{value:"",children:"All Channels"}),o.jsx("option",{value:"email",children:"Email"}),o.jsx("option",{value:"sms",children:"SMS"}),o.jsx("option",{value:"push",children:"Push"})]}),o.jsxs("select",{value:j,onChange:ne=>C(ne.target.value),className:"px-3 py-1.5 bg-background border border-input rounded-md text-xs focus:outline-none focus:ring-1 focus:ring-ring text-foreground",children:[o.jsx("option",{value:"",children:"All Statuses"}),o.jsx("option",{value:"delivered",children:"Delivered"}),o.jsx("option",{value:"failed",children:"Failed"}),o.jsx("option",{value:"dispatched",children:"Dispatched"}),o.jsx("option",{value:"pending",children:"Pending"})]})]})]}),o.jsx(Rt,{className:"flex-1 p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50 sticky top-0",children:o.jsxs(qt,{children:[o.jsx(Je,{className:"font-medium",children:"Timestamp"}),o.jsx(Je,{className:"font-medium",children:"Task ID"}),o.jsx(Je,{className:"font-medium",children:"Template"}),o.jsx(Je,{className:"font-medium",children:"Channel"}),o.jsx(Je,{className:"font-medium",children:"Status"}),o.jsx(Je,{className:"font-medium text-right",children:"Details"})]})}),o.jsx(Ss,{children:pe?o.jsx(qt,{children:o.jsx(ke,{colSpan:6,className:"h-24 text-center text-muted-foreground",children:"Loading projects..."})}):I.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:6,className:"h-24 text-center text-muted-foreground",children:"No projects exist. Create one in Projects & Keys tab."})}):l.length===0&&!v?o.jsx(qt,{children:o.jsx(ke,{colSpan:6,className:"h-24 text-center text-muted-foreground",children:"No log entries match your filter."})}):Array.from(l.reduce((ne,ge)=>(ne.has(ge.taskId)?ne.get(ge.taskId).status==="dispatched"&&ge.status!=="dispatched"&&ne.set(ge.taskId,ge):ne.set(ge.taskId,ge),ne),new Map).values()).map(ne=>o.jsxs(qt,{className:"hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>z(ne),children:[o.jsx(ke,{className:"text-muted-foreground whitespace-nowrap text-xs",children:new Date(ne.timestamp).toLocaleString()}),o.jsx(ke,{className:"font-mono text-xs font-semibold text-foreground",children:ne.taskId}),o.jsx(ke,{className:"font-medium text-xs",children:ne.templateId}),o.jsx(ke,{children:o.jsx(Jt,{variant:"secondary",className:"capitalize font-normal text-xs",children:ne.channel})}),o.jsx(ke,{children:o.jsx(V0,{status:ne.status})}),o.jsx(ke,{className:"text-right",children:o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",children:o.jsx(vs,{className:"h-4 w-4"})})})]},ne.id))})]})}),o.jsxs("div",{className:"p-3 border-t border-border flex items-center justify-between text-xs text-muted-foreground bg-muted/20",children:[o.jsxs("span",{children:["Page ",p+1]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(Ke,{variant:"outline",size:"sm",onClick:Xe,disabled:p===0||v,className:"h-7 text-xs border-border",children:[o.jsx(Tx,{className:"h-3.5 w-3.5 mr-1"})," Previous"]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:Re,disabled:!u||v,className:"h-7 text-xs border-border",children:["Next ",o.jsx(_x,{className:"h-3.5 w-3.5 ml-1"})]})]})]}),_&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-bold text-foreground",children:"Event Lifecycle & Detail"}),o.jsxs("p",{className:"text-xs text-muted-foreground font-mono",children:["Task ID: ",_.taskId]})]}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>z(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-1.5",children:[o.jsx(Zx,{className:"h-4 w-4 text-foreground"}),"Notification Event Lifecycle"]}),ee?o.jsx("div",{className:"p-4 rounded-lg bg-muted text-xs text-muted-foreground animate-pulse",children:"Loading complete event lifecycle logs..."}):L.length===0?o.jsx("div",{className:"p-4 rounded-lg bg-muted text-xs text-muted-foreground",children:"No lifecycle history recorded."}):o.jsx("div",{className:"relative pl-6 space-y-4 before:absolute before:left-2.5 before:top-2 before:bottom-2 before:w-px before:bg-border",children:L.map(ne=>{const ge=new Date(L[0].timestamp).getTime(),G=new Date(ne.timestamp).getTime()-ge;return o.jsxs("div",{className:"relative group",children:[o.jsx("div",{className:"absolute -left-6 top-0.5 h-5 w-5 rounded-full bg-background border border-border flex items-center justify-center",children:ne.status==="delivered"?o.jsx(hs,{className:"h-3 w-3 text-foreground"}):ne.status==="failed"?o.jsx(qo,{className:"h-3 w-3 text-destructive"}):o.jsx(xb,{className:"h-2.5 w-2.5 text-muted-foreground"})}),o.jsxs("div",{className:"p-3 rounded-lg bg-muted/40 border border-border text-xs space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(V0,{status:ne.status}),o.jsx("span",{className:"font-semibold capitalize text-foreground",children:ne.kind==="attempt"?`Attempt #${ne.attempt||1}`:ne.kind})]}),o.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:G>0?`+${G}ms`:"Start"})]}),o.jsxs("div",{className:"flex items-center justify-between text-muted-foreground text-[11px]",children:[o.jsxs("span",{children:["Channel:"," ",o.jsx("strong",{className:"text-foreground capitalize",children:ne.channel})]}),o.jsx("span",{children:new Date(ne.timestamp).toLocaleTimeString()})]}),ne.providerMessageId&&o.jsxs("div",{className:"text-[11px] text-muted-foreground font-mono",children:["Provider Msg ID:"," ",o.jsx("span",{className:"text-foreground",children:ne.providerMessageId})]})]})]},ne.id)})})]}),o.jsxs("div",{className:"space-y-2 text-xs border-t border-border pt-4",children:[o.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Selected Log Record Metadata"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 p-3 rounded-lg bg-muted/40 border border-border",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Log UUID:"}),o.jsx("div",{className:"font-mono text-foreground truncate",children:_.id})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Template ID:"}),o.jsx("div",{className:"font-semibold text-foreground",children:_.templateId})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Provider Message ID:"}),o.jsx("div",{className:"font-mono text-foreground truncate",children:_.providerMessageId||"N/A"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Workflow Instance:"}),o.jsx("div",{className:"font-mono text-foreground truncate",children:_.workflowInstanceId||"Direct Send"})]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-semibold text-muted-foreground",children:"Full JSON Context"}),o.jsx("pre",{className:"mt-1 p-4 rounded-lg bg-muted border border-border text-xs font-mono overflow-x-auto text-foreground",children:JSON.stringify(_,null,2)})]})]})})]})}function V0({status:l}){let i="outline";switch(l){case"delivered":i="default";break;case"failed":i="destructive";break;case"pending":case"dispatched":i="secondary";break;case"canceled":case"skipped":i="outline";break}return o.jsx(Jt,{variant:i,className:"capitalize text-[10px] font-medium",children:l})}function Tw(){return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsx("main",{className:"flex-1 container mx-auto p-4 md:p-6",children:o.jsx("div",{className:"pb-4",children:o.jsx("div",{className:"min-h-[500px]",children:o.jsx(Cw,{})})})})]})}function zw(){var S,g,w,E,j,C;const[l,i]=b.useState(null),[u,c]=b.useState(!0),{projectApiKey:d,selectedProjectId:m}=Hn(),{apiUrl:p,token:y}=ya(),v=b.useCallback(async()=>{const _=d||y;if(!_){c(!1);return}try{const z={Authorization:`Bearer ${_}`};m&&(z["x-project-id"]=m);const L=await fetch(`${p}/v1/system/health`,{headers:z});if(!L.ok)throw new Error(`HTTP ${L.status}`);const K=await L.json();i(K)}catch(z){console.error(z),Ge.error("Failed to fetch system health")}finally{c(!1)}},[p,d,m,y]);b.useEffect(()=>{if(d||y){v();const z=setInterval(()=>void v(),5e3);return()=>clearInterval(z)}},[d,y,v]);const h=["enricher","engine","scheduler","delivery","ai","workflow","events"];return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:(l==null?void 0:l.status)==="healthy"}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(Ep,{className:"h-6 w-6 text-foreground"}),"System Infrastructure & Worker Health"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Real-time heartbeats, database/Redis latencies, and microservice status"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>{c(!0),v()},disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Redis Connection"}),o.jsx(Sb,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Rt,{children:u&&!l?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(mi,{className:"h-4 w-4 animate-spin"})," Checking..."]}):o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-2xl font-bold",children:[((S=l==null?void 0:l.redis)==null?void 0:S.latencyMs)??0," ms"]}),o.jsx(Jt,{variant:(g=l==null?void 0:l.redis)!=null&&g.ok?"default":"destructive",children:(w=l==null?void 0:l.redis)!=null&&w.ok?"Connected":"Disconnected"})]})})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"PostgreSQL Database"}),o.jsx(wp,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Rt,{children:u&&!l?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(mi,{className:"h-4 w-4 animate-spin"})," Checking..."]}):o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"text-2xl font-bold",children:[((E=l==null?void 0:l.db)==null?void 0:E.latencyMs)??0," ms"]}),o.jsx(Jt,{variant:(j=l==null?void 0:l.db)!=null&&j.ok?"default":"destructive",children:(C=l==null?void 0:l.db)!=null&&C.ok?"Healthy":"Unreachable"})]})})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Overall Cluster State"}),o.jsx(Hx,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Rt,{children:u&&!l?o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(mi,{className:"h-4 w-4 animate-spin"})," Checking..."]}):o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-2xl font-bold capitalize",children:(l==null?void 0:l.status)??"Checking"}),o.jsx(_w,{status:l==null?void 0:l.status})]})})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsx(_t,{className:"text-lg",children:"Worker Heartbeats & Concurrency"}),o.jsx(rn,{children:"Monitored active workers in the event pipeline"})]}),o.jsx(Rt,{children:o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:h.map(_=>{var ee;const z=(ee=l==null?void 0:l.workers)==null?void 0:ee[_],L=!!(z&&z.status!=="error"&&z.status!=="unknown"&&(z.redis!==!1||z.status==="active"||z.status==="healthy"||z.state)),K=(z==null?void 0:z.state)||(z!=null&&z.status&&z.status!=="unknown"?z.status:null)||(z!=null&&z.redis?"Active":"Idle / Standby");return o.jsxs("div",{className:"p-4 rounded-lg border border-border bg-muted/40 flex flex-col justify-between space-y-3 hover:border-border transition-colors",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"font-semibold text-sm capitalize",children:[_," Worker"]}),o.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${L?"bg-foreground":"bg-muted-foreground/40"}`})]}),o.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{children:"Status:"}),o.jsx("span",{className:"font-medium text-foreground capitalize",children:K})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{children:"Active Concurrency:"}),o.jsxs("span",{className:"font-mono text-foreground font-semibold",children:[(z==null?void 0:z.activeTasks)??0," tasks"]})]})]})]},_)})})})]})]})]})}function _w({status:l}){return l==="healthy"?o.jsx(hs,{className:"h-5 w-5 text-foreground"}):l==="degraded"?o.jsx(qo,{className:"h-5 w-5 text-muted-foreground"}):o.jsx(Yo,{className:"h-5 w-5 text-destructive"})}function Rw(){var S,g,w,E;const[l,i]=b.useState(null),[u,c]=b.useState(!0),{projectApiKey:d,selectedProjectId:m}=Hn(),{apiUrl:p,token:y}=ya(),v=b.useCallback(async()=>{const j=d||y;if(!j){c(!1);return}c(!0);try{const C={Authorization:`Bearer ${j}`};m&&(C["x-project-id"]=m);const _=await fetch(`${p}/v1/system/metrics`,{headers:C});if(!_.ok)throw new Error(`HTTP ${_.status}`);const z=await _.json();i(z)}catch(C){console.error(C),Ge.error("Failed to fetch analytics & queue metrics")}finally{c(!1)}},[p,d,m,y]);b.useEffect(()=>{if(d||y){v();const C=setInterval(()=>void v(),5e3);return()=>clearInterval(C)}},[d,y,v]);const h=[{key:"INBOUND_CRITICAL",label:"Inbound Critical Stream"},{key:"INBOUND_NORMAL",label:"Inbound Normal Stream"},{key:"INBOUND_LOW",label:"Inbound Low Stream"},{key:"OUTBOUND_CRITICAL",label:"Outbound Critical Stream"},{key:"OUTBOUND_NORMAL",label:"Outbound Normal Stream"},{key:"OUTBOUND_LOW",label:"Outbound Low Stream"},{key:"WORKFLOW_INBOUND",label:"Workflow Inbound Stream"},{key:"EVENTS_INBOUND",label:"Events Inbound Stream"}];return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(Sp,{className:"h-6 w-6 text-foreground"}),"Pipeline Analytics & Queue Depths"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Delivery success rate SLA, dispatch throughput, and Redis stream queue depths"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void v(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Delivery Success Rate"}),o.jsx(hs,{className:"h-4 w-4 text-foreground"})]}),o.jsxs(Rt,{children:[o.jsxs("div",{className:"text-3xl font-bold text-foreground",children:[((S=l==null?void 0:l.deliveryStats)==null?void 0:S.successRate)??100,"%"]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"SLA Target > 99.0%"})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Total Dispatches"}),o.jsx(Nd,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Rt,{children:[o.jsx("div",{className:"text-3xl font-bold",children:((g=l==null?void 0:l.deliveryStats)==null?void 0:g.total)??0}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Processed across channels"})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Delivered Messages"}),o.jsx(hs,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs(Rt,{children:[o.jsx("div",{className:"text-3xl font-bold text-foreground",children:((w=l==null?void 0:l.deliveryStats)==null?void 0:w.delivered)??0}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Confirmed provider handoffs"})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-2 flex flex-row items-center justify-between",children:[o.jsx(_t,{className:"text-sm font-medium text-muted-foreground",children:"Permanent Failures"}),o.jsx(Yo,{className:"h-4 w-4 text-destructive"})]}),o.jsxs(Rt,{children:[o.jsx("div",{className:"text-3xl font-bold text-destructive",children:((E=l==null?void 0:l.deliveryStats)==null?void 0:E.failed)??0}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Routed to DLQ"})]})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg flex items-center gap-2",children:[o.jsx(Ap,{className:"h-5 w-5 text-foreground"}),"Stream Queue Depths & Backlog Meters"]}),o.jsx(rn,{children:"Real-time item count inside Redis Streams"})]}),o.jsx(Rt,{children:o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:h.map(j=>{var L;const C=((L=l==null?void 0:l.streams)==null?void 0:L[j.key])??0,z=Math.min(100,Math.round(C/1e5*100));return o.jsxs("div",{className:"space-y-2 p-4 rounded-lg bg-muted/40 border border-border",children:[o.jsxs("div",{className:"flex justify-between items-center text-sm",children:[o.jsx("span",{className:"font-semibold text-foreground",children:j.label}),o.jsxs("span",{className:"font-mono text-xs font-bold text-muted-foreground",children:[C," items"]})]}),o.jsx("div",{className:"w-full h-2.5 rounded-full bg-muted overflow-hidden relative",children:o.jsx("div",{className:"h-full bg-primary transition-all duration-300 rounded-full",style:{width:`${C===0?0:Math.max(4,z)}%`}})}),o.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[o.jsx("span",{children:"0"}),o.jsx("span",{children:"Cap: 100,000"})]})]},j.key)})})})]})]})]})}function Mw(){const[l,i]=b.useState([]),[u,c]=b.useState(!0),[d,m]=b.useState(null),{projectApiKey:p,selectedProjectId:y}=Hn(),{apiUrl:v,token:h}=ya(),S=b.useCallback(async()=>{const E=p||h;if(!E){c(!1);return}c(!0);try{const j={Authorization:`Bearer ${E}`};y&&(j["x-project-id"]=y);const C=await fetch(`${v}/v1/dlq`,{headers:j});if(!C.ok)throw new Error(`HTTP ${C.status}`);const _=await C.json();i(_.messages||[])}catch(j){console.error(j),Ge.error("Failed to fetch Dead Letter Queue messages")}finally{c(!1)}},[v,p,y,h]);b.useEffect(()=>{(p||h)&&S()},[p,h,S]);const g=async E=>{const j=p||h;if(j)try{const C={"Content-Type":"application/json",Authorization:`Bearer ${j}`};if(y&&(C["x-project-id"]=y),!(await fetch(`${v}/v1/dlq/replay`,{method:"POST",headers:C,body:JSON.stringify({id:E})})).ok)throw new Error("Replay request failed");Ge.success(`Message ${E} replayed into queue`),S()}catch{Ge.error("Failed to replay message")}},w=async E=>{const j=p||h;if(j)try{const C={Authorization:`Bearer ${j}`};if(y&&(C["x-project-id"]=y),!(await fetch(`${v}/v1/dlq/${E}`,{method:"DELETE",headers:C})).ok)throw new Error("Delete failed");Ge.success(`Message ${E} purged from DLQ`),S()}catch{Ge.error("Failed to delete message")}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(Go,{className:"h-6 w-6 text-destructive"}),"Dead Letter Queue (DLQ) & Failure Diagnostics"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Inspect undeliverable messages, review failure context, and execute stream replays"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void S(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg",children:["Poison & Failed Stream Messages (",l.length,")"]}),o.jsx(rn,{children:"Messages routed to STREAMS.DEAD_LETTER after exhausting retry limits"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"Timestamp"}),o.jsx(Je,{children:"Stream Message ID"}),o.jsx(Je,{children:"Event Type"}),o.jsx(Je,{children:"Failure Reason"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:"No dead-letter messages found. Pipeline is operating smoothly!"})}):l.map(E=>o.jsxs(qt,{className:"hover:bg-muted/50",children:[o.jsx(ke,{className:"text-muted-foreground text-xs whitespace-nowrap",children:new Date(E.timestamp).toLocaleString()}),o.jsx(ke,{className:"font-mono text-xs text-foreground font-medium",children:E.id}),o.jsx(ke,{children:o.jsx(Jt,{variant:"secondary",className:"font-mono text-[11px]",children:E.eventType})}),o.jsx(ke,{className:"text-destructive text-xs truncate max-w-[250px] font-mono",children:E.error}),o.jsxs(ke,{className:"text-right space-x-1",children:[o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>m(E),children:o.jsx(vs,{className:"h-4 w-4"})}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground",onClick:()=>void g(E.id),title:"Replay Message",children:o.jsx(gb,{className:"h-4 w-4"})}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:bg-destructive/10",onClick:()=>void w(E.id),title:"Purge Message",children:o.jsx(Ad,{className:"h-4 w-4"})})]})]},E.id))})]})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-4 flex flex-col justify-between",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsx("h2",{className:"text-lg font-bold text-foreground",children:"DLQ Message Payload"}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>m(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"ID:"})," ",o.jsx("span",{className:"font-mono text-foreground font-medium",children:d.id})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Error:"})," ",o.jsx("span",{className:"font-mono text-destructive",children:d.error})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-semibold text-muted-foreground",children:"Raw Data Payload"}),o.jsx("pre",{className:"mt-1 p-4 rounded-md bg-muted border border-border text-xs font-mono overflow-x-auto text-foreground",children:JSON.stringify(d.payload,null,2)})]})]}),o.jsx("div",{className:"flex gap-2 justify-end pt-4 border-t border-border",children:o.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>{g(d.id),m(null)},children:"Replay Message"})})]})})]})}function kw(){const[l,i]=b.useState([]),[u,c]=b.useState(!0),{projectApiKey:d,selectedProjectId:m}=Hn(),{apiUrl:p}=ya(),y=b.useCallback(async()=>{c(!0);try{const h=await fetch(`${p}/v1/notifications/scheduled`,{headers:{Authorization:`Bearer ${d}`,"x-project-id":m}});if(!h.ok)throw new Error(`HTTP ${h.status}`);const S=await h.json();i(S.scheduled||[])}catch(h){console.error(h),Ge.error("Failed to fetch scheduled notifications")}finally{c(!1)}},[p,d,m]);b.useEffect(()=>{d&&m&&y()},[d,m,y]);const v=async h=>{try{if(!(await fetch(`${p}/v1/notifications/${h}`,{method:"DELETE",headers:{Authorization:`Bearer ${d}`,"x-project-id":m}})).ok)throw new Error("Cancel failed");Ge.success(`Task ${h} canceled`),y()}catch{Ge.error("Failed to cancel scheduled task")}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(fl,{className:"h-6 w-6 text-foreground"}),"Scheduled & Deferred Notification Pipeline"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Notifications queued for future timestamps or deferred due to recipient quiet hours"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void y(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg",children:["Pending Scheduled Messages (",l.length,")"]}),o.jsx(rn,{children:"Managed via Redis Sorted Sets (ZSET) and persistent storage"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"Created At"}),o.jsx(Je,{children:"Task ID"}),o.jsx(Je,{children:"Template"}),o.jsx(Je,{children:"Target"}),o.jsx(Je,{children:"Scheduled Send At"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:6,className:"h-32 text-center text-muted-foreground",children:"No pending scheduled or deferred messages found."})}):l.map(h=>{var w,E,j,C,_,z,L,K,ee;const S=(w=h.payload)==null?void 0:w.scheduledAt,g=((E=h.payload)==null?void 0:E.recipientId)||((C=(j=h.payload)==null?void 0:j.recipient)==null?void 0:C.id)||(typeof((_=h.payload)==null?void 0:_.target)=="object"?JSON.stringify((z=h.payload)==null?void 0:z.target):String(((L=h.payload)==null?void 0:L.target)||"N/A"));return o.jsxs(qt,{className:"hover:bg-muted/50",children:[o.jsx(ke,{className:"text-muted-foreground text-xs whitespace-nowrap",children:new Date(h.createdAt).toLocaleString()}),o.jsx(ke,{className:"font-mono text-xs font-semibold text-foreground max-w-[180px] truncate",title:h.taskId,children:h.taskId}),o.jsx(ke,{className:"font-medium text-xs",children:((K=h.payload)==null?void 0:K.templateId)||((ee=h.payload)==null?void 0:ee.template)||"N/A"}),o.jsx(ke,{className:"font-mono text-xs text-muted-foreground truncate max-w-[150px]",children:g}),o.jsx(ke,{children:o.jsx(Jt,{variant:"outline",className:"font-mono text-[11px]",children:S?new Date(S).toLocaleString():"Pending Dispatch"})}),o.jsx(ke,{className:"text-right",children:o.jsxs(Ke,{variant:"ghost",size:"sm",className:"h-8 text-destructive hover:bg-destructive/10",onClick:()=>void v(h.taskId),children:[o.jsx(Yo,{className:"h-4 w-4 mr-1"}),"Cancel Task"]})})]},h.taskId)})})]})})]})]})]})}function Dw(){const[l,i]=b.useState([]),[u,c]=b.useState(!0),[d,m]=b.useState(null),[p,y]=b.useState(""),[v,h]=b.useState(null),[S,g]=b.useState(!1),{projectApiKey:w,selectedProjectId:E}=Hn(),{apiUrl:j}=ya(),C=b.useCallback(async()=>{c(!0);try{const L=await fetch(`${j}/v1/workflows`,{headers:{Authorization:`Bearer ${w}`,"x-project-id":E}});if(!L.ok)throw new Error(`HTTP ${L.status}`);const K=await L.json();i(K.workflows||[])}catch(L){console.error(L),Ge.error("Failed to fetch workflows")}finally{c(!1)}},[j,w,E]);b.useEffect(()=>{w&&E&&C()},[w,E,C]);const _=async L=>{try{const K=await fetch(`${j}/v1/workflows/trigger`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`,"x-project-id":E},body:JSON.stringify({name:L,input:{}})});if(!K.ok)throw new Error("Trigger failed");const ee=await K.json();Ge.success(`Workflow "${L}" triggered! Instance ID: ${ee.instanceId}`),ee.instanceId&&(y(ee.instanceId),z(ee.instanceId))}catch{Ge.error("Failed to trigger workflow")}},z=async L=>{const K=L||p.trim();if(K){g(!0);try{const ee=await fetch(`${j}/v1/workflows/instances/${encodeURIComponent(K)}`,{headers:{Authorization:`Bearer ${w}`,"x-project-id":E}});if(!ee.ok)throw new Error("Instance not found");const J=await ee.json();h(J)}catch{Ge.error("Workflow instance not found"),h(null)}finally{g(!1)}}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(Np,{className:"h-6 w-6 text-foreground"}),"Workflows & Event Orchestration"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Multi-step notification orchestration definitions, step execution history, and instance tracing"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void C(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{className:"pb-3",children:[o.jsxs(_t,{className:"text-sm font-semibold flex items-center gap-2",children:[o.jsx(Tp,{className:"h-4 w-4 text-muted-foreground"}),"Workflow Instance Lookup & Step Execution Visualizer"]}),o.jsx(rn,{className:"text-xs",children:"Search by instance UUID to view step-by-step execution state and payload progress"})]}),o.jsxs(Rt,{className:"space-y-4",children:[o.jsxs("div",{className:"flex gap-2 max-w-lg",children:[o.jsx(pi,{type:"text",placeholder:"Enter Workflow Instance ID...",value:p,onChange:L=>y(L.target.value),className:"text-xs font-mono"}),o.jsx(Ke,{variant:"secondary",size:"sm",className:"text-xs",onClick:()=>void z(),disabled:S,children:S?"Searching...":"Trace Instance"})]}),v&&o.jsxs("div",{className:"p-4 rounded-lg bg-muted/40 border border-border space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Instance ID:"})," ",o.jsx("span",{className:"font-mono text-foreground font-bold",children:v.id})]}),o.jsx(Jt,{variant:v.status==="completed"?"default":"secondary",className:"capitalize",children:v.status})]}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:["Workflow Name:"," ",o.jsx("strong",{className:"text-foreground",children:v.workflowName})," | Step Pointer:"," ",o.jsx("strong",{className:"text-foreground",children:v.currentStepIndex??0})]})]})]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg",children:["Registered Workflows (",l.length,")"]}),o.jsx(rn,{children:"Definitions registered for background execution"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"Created At"}),o.jsx(Je,{children:"Workflow Name"}),o.jsx(Je,{children:"Steps Count"}),o.jsx(Je,{children:"Definition Structure"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:"No registered workflows found. Register workflows using POST /v1/workflows"})}):l.map(L=>o.jsxs(qt,{className:"hover:bg-muted/50",children:[o.jsx(ke,{className:"text-muted-foreground text-xs whitespace-nowrap",children:new Date(L.createdAt).toLocaleString()}),o.jsx(ke,{className:"font-bold text-sm font-mono text-foreground",children:L.name}),o.jsx(ke,{children:o.jsxs(Jt,{variant:"secondary",className:"font-mono text-[11px]",children:[Array.isArray(L.steps)?L.steps.length:0," steps"]})}),o.jsx(ke,{className:"font-mono text-xs text-muted-foreground truncate max-w-[300px]",children:JSON.stringify(L.steps)}),o.jsxs(ke,{className:"text-right space-x-2",children:[o.jsxs(Ke,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:()=>m(L),children:[o.jsx(vs,{className:"h-4 w-4 mr-1"}),"View Diagram"]}),o.jsxs(Ke,{variant:"outline",size:"sm",className:"h-8",onClick:()=>void _(L.name),children:[o.jsx(ub,{className:"h-3.5 w-3.5 mr-1"}),"Trigger Now"]})]})]},L.id))})]})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"text-lg font-bold text-foreground",children:["Workflow Diagram: ",d.name]}),o.jsxs("p",{className:"text-xs text-muted-foreground font-mono",children:["ID: ",d.id]})]}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>m(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-1.5",children:[o.jsx(Ap,{className:"h-4 w-4 text-foreground"}),"Execution Step Graph Flow"]}),o.jsx("div",{className:"space-y-3 relative pl-4 before:absolute before:left-2 before:top-2 before:bottom-2 before:w-px before:bg-border",children:(d.steps||[]).map((L,K)=>o.jsxs("div",{className:"p-3 rounded-lg bg-muted/40 border border-border text-xs space-y-1",children:[o.jsxs("div",{className:"flex items-center justify-between font-semibold",children:[o.jsxs("span",{className:"text-foreground",children:["Step ",K+1,": ",L.type||L.name||"Action"]}),o.jsx(Jt,{variant:"outline",className:"text-[10px] font-mono",children:L.channel||L.action||"Step Node"})]}),o.jsx("pre",{className:"text-[11px] text-muted-foreground overflow-x-auto font-mono",children:JSON.stringify(L,null,2)})]},K))})]})]})})]})}function Ow(){const[l,i]=b.useState([]),[u,c]=b.useState(!0),[d,m]=b.useState(null),{projectApiKey:p,selectedProjectId:y}=Hn(),{apiUrl:v}=ya(),h=b.useCallback(async()=>{c(!0);try{const g=await fetch(`${v}/v1/templates`,{headers:{Authorization:`Bearer ${p}`,"x-project-id":y}});if(!g.ok)throw new Error(`HTTP ${g.status}`);const w=await g.json();i(w.templates||[])}catch(g){console.error(g),Ge.error("Failed to fetch templates")}finally{c(!1)}},[v,p,y]);b.useEffect(()=>{p&&y&&h()},[p,y,h]);const S=async g=>{try{if(!(await fetch(`${v}/v1/templates/${g}`,{method:"DELETE",headers:{Authorization:`Bearer ${p}`,"x-project-id":y}})).ok)throw new Error("Delete failed");Ge.success(`Template ${g} deleted`),h()}catch{Ge.error("Failed to delete template")}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[o.jsx(jp,{className:"h-6 w-6 text-foreground"}),"Template Directory & Channel Bindings"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Registered notification templates, topic bindings, and AI prompts"})]}),o.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>void h(),disabled:u,children:[o.jsx(Cr,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]})]}),o.jsxs(Tt,{className:"border-border bg-card",children:[o.jsxs(zt,{children:[o.jsxs(_t,{className:"text-lg",children:["Notification Templates (",l.length,")"]}),o.jsx(rn,{children:"Managed via PUT /v1/templates API endpoint"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"Template ID"}),o.jsx(Je,{children:"Channel"}),o.jsx(Je,{children:"Topics"}),o.jsx(Je,{children:"Last Updated"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.length===0?o.jsx(qt,{children:o.jsx(ke,{colSpan:5,className:"h-32 text-center text-muted-foreground",children:"No templates synced for this project. Sync using initializeApp() or PUT /v1/templates"})}):l.map(g=>o.jsxs(qt,{className:"hover:bg-muted/50",children:[o.jsx(ke,{className:"font-mono text-sm font-bold text-foreground",children:g.id}),o.jsx(ke,{children:o.jsx(Jt,{variant:"secondary",className:"capitalize font-normal text-xs",children:g.channel})}),o.jsx(ke,{children:o.jsx("div",{className:"flex gap-1 flex-wrap",children:(g.topics||[]).map(w=>o.jsx(Jt,{variant:"outline",className:"text-[10px]",children:w},w))})}),o.jsx(ke,{className:"text-muted-foreground text-xs whitespace-nowrap",children:new Date(g.updatedAt).toLocaleString()}),o.jsxs(ke,{className:"text-right space-x-1",children:[o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>m(g),children:o.jsx(vs,{className:"h-4 w-4"})}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:bg-destructive/10",onClick:()=>void S(g.id),children:o.jsx(Ad,{className:"h-4 w-4"})})]})]},g.id))})]})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsxs("h2",{className:"text-lg font-bold text-foreground",children:["Template: ",d.id]}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>m(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Channel:"})," ",o.jsx("span",{className:"font-semibold capitalize text-foreground",children:d.channel})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Topics:"})," ",o.jsx("span",{className:"font-mono text-foreground",children:(d.topics||[]).join(", ")})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-semibold text-muted-foreground",children:"Template Content"}),o.jsx("pre",{className:"mt-1 p-4 rounded-md bg-muted border border-border text-xs font-mono overflow-x-auto text-foreground",children:JSON.stringify(d.content,null,2)})]})]})})]})}function Uw(){var E;const[l,i]=b.useState([]),[u,c]=b.useState(!1),[d,m]=b.useState(null),{projects:p,selectedProjectId:y,projectApiKey:v,isLoadingProjects:h}=Hn(),{apiUrl:S}=ya(),g=b.useCallback(async(j,C)=>{c(!0);try{const _=await fetch(`${S}/v1/users`,{headers:{Authorization:`Bearer ${j}`,"x-project-id":C}});if(_.ok){const z=await _.json();i(z.users||[])}else Ge.error("Failed to load users")}catch(_){console.error(_),Ge.error("Failed to load users")}finally{c(!1)}},[S]);b.useEffect(()=>{v&&y?g(v,y):i([])},[v,y,g]);const w=async j=>{const C=j.externalId||j.userId||j.id;if(C)try{const _=await fetch(`${S}/v1/users/${encodeURIComponent(C)}/details`,{headers:{Authorization:`Bearer ${v}`,"x-project-id":y}});if(_.ok){const z=await _.json();m(z)}else m({...j,contacts:[],logs:[]})}catch{m({...j,contacts:[],logs:[]})}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6 space-y-6",children:[o.jsx("div",{className:"flex justify-between items-center",children:o.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[o.jsx(zp,{className:"w-6 h-6 text-foreground"}),"User Directory & Contact Preferences"]})}),o.jsxs(Tt,{className:"bg-card border-border",children:[o.jsxs(zt,{children:[o.jsx(_t,{children:"Registered End-Users"}),o.jsx(rn,{children:"Recipient profiles, channel addresses, and preference overrides"})]}),o.jsx(Rt,{className:"p-0 overflow-auto",children:h?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"Loading projects..."})]}):p.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No projects exist. Create one in the Projects & Keys tab."})]}):v?u?o.jsx("div",{className:"text-muted-foreground text-sm p-6 text-center",children:"Loading users..."}):l.length===0?o.jsx("div",{className:"text-muted-foreground text-sm text-center p-8",children:"No users found."}):o.jsxs(xs,{children:[o.jsx(bs,{className:"bg-muted/50",children:o.jsxs(qt,{children:[o.jsx(Je,{children:"External User ID"}),o.jsx(Je,{children:"Primary Contact"}),o.jsx(Je,{children:"Created At"}),o.jsx(Je,{className:"text-right",children:"Actions"})]})}),o.jsx(Ss,{children:l.map((j,C)=>{const _=j.externalId||j.userId||j.id||`user-${C}`;return o.jsxs(qt,{className:"hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>void w(j),children:[o.jsx(ke,{className:"font-mono font-bold text-foreground",children:_}),o.jsx(ke,{className:"text-muted-foreground",children:j.email?j.email:o.jsx("span",{className:"italic opacity-50",children:"Not provided"})}),o.jsx(ke,{className:"text-muted-foreground text-xs",children:new Date(j.createdAt).toLocaleDateString()}),o.jsx(ke,{className:"text-right",children:o.jsxs(Ke,{variant:"outline",size:"sm",className:"h-7",onClick:z=>{z.stopPropagation(),w(j)},children:[o.jsx(vs,{className:"h-3.5 w-3.5 mr-1"})," View Profile"]})})]},_)})})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-muted-foreground gap-3",children:[o.jsx(fl,{className:"h-8 w-8 opacity-50"}),o.jsx("p",{className:"text-sm",children:"No API key found for this project."})]})})]})]}),d&&o.jsx("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs flex justify-end",children:o.jsxs("div",{className:"w-full max-w-xl bg-card border-l border-border p-6 overflow-y-auto space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"text-xl font-bold font-mono text-foreground",children:["User: ",d.externalId||d.userId||d.id]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Registered contact endpoints and preferences"})]}),o.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>m(null),children:"Close"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[o.jsx(sb,{className:"h-4 w-4 text-muted-foreground"}),"Contact Channels (",((E=d.contacts)==null?void 0:E.length)??0,")"]}),!d.contacts||d.contacts.length===0?o.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No contact endpoints registered for this user."}):o.jsx("div",{className:"space-y-2",children:d.contacts.map(j=>o.jsxs("div",{className:"p-3 rounded-md bg-muted/40 border border-border flex items-center justify-between text-xs",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Jt,{variant:"outline",className:"capitalize font-mono text-[10px]",children:j.channel}),o.jsx("span",{className:"font-mono text-foreground",children:j.target})]}),o.jsx(Jt,{variant:j.enabled!==!1?"default":"destructive",children:j.enabled!==!1?"Active":"Opted-out"})]},j.id))})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[o.jsx(Cp,{className:"h-4 w-4 text-muted-foreground"}),"Per-User Delivery Audit Trail"]}),!d.logs||d.logs.length===0?o.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No recent notifications logged for this user."}):o.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:d.logs.map(j=>o.jsxs("div",{className:"p-2.5 rounded-md bg-muted/40 border border-border flex items-center justify-between text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-mono text-foreground font-semibold",children:j.taskId}),o.jsxs("span",{className:"text-muted-foreground ml-2",children:["(",j.templateId,")"]})]}),o.jsx(Jt,{variant:"secondary",className:"capitalize text-[10px]",children:j.status})]},j.id))})]})]})})]})}function Lw(){const{apiUrl:l,token:i}=ya(),[u,c]=b.useState([]),[d,m]=b.useState(!0),[p,y]=b.useState(""),[v,h]=b.useState(null),[S,g]=b.useState([]),[w,E]=b.useState(null),[j,C]=b.useState(!1),_=async()=>{try{const J=await fetch(`${l}/v1/projects`,{headers:{Authorization:`Bearer ${i}`}});if(J.ok){const I=await J.json();c(I.projects||[])}}catch(J){console.error(J),Ge.error("Failed to load projects")}finally{m(!1)}},z=async J=>{try{const I=await fetch(`${l}/v1/projects/${J}/keys`,{headers:{Authorization:`Bearer ${i}`}});if(I.ok){const Z=await I.json();g(Z.keys||[])}}catch(I){console.error(I),Ge.error("Failed to load API keys")}};b.useEffect(()=>{_()},[]),b.useEffect(()=>{v?(z(v),E(null),C(!1)):g([])},[v]);const L=async J=>{if(J.preventDefault(),!!p.trim())try{const I=await fetch(`${l}/v1/projects`,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify({name:p})});if(I.ok){const Z=await I.json();Ge.success("Project created!"),y(""),_(),Z.apiKey&&(E(Z.apiKey),C(!1))}else{const Z=await I.json();Ge.error(`Error: ${Z.message||"Failed to create project"}`)}}catch{Ge.error("Failed to create project")}},K=async()=>{if(v)try{const J=await fetch(`${l}/v1/projects/${v}/keys`,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify({role:"admin"})});if(J.ok){const I=await J.json();E(I.apiKey),C(!1),Ge.success("New API Key generated successfully"),z(v)}else Ge.error("Failed to generate key")}catch{Ge.error("Failed to generate key")}},ee=async J=>{if(v&&confirm("Are you sure you want to revoke this API key? Systems using it will immediately stop working."))try{(await fetch(`${l}/v1/projects/${v}/keys/${J}`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}})).ok?(Ge.success("API Key revoked"),z(v)):Ge.error("Failed to revoke key")}catch{Ge.error("Failed to revoke key")}};return o.jsxs("div",{className:"min-h-full flex flex-col w-full",children:[o.jsx(qn,{isConnected:!0}),o.jsxs("main",{className:"flex-1 container mx-auto p-4 md:p-6",children:[o.jsx("div",{className:"flex justify-between items-center mb-6",children:o.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[o.jsx(Ed,{className:"w-6 h-6 text-foreground"}),"Projects & API Keys"]})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[o.jsxs(Tt,{className:"lg:col-span-1 bg-card border-border h-fit",children:[o.jsxs(zt,{children:[o.jsx(_t,{children:"Create Project"}),o.jsx(rn,{children:"Add a new tenant to Notifkit"})]}),o.jsx(Rt,{children:o.jsxs("form",{onSubmit:J=>{L(J)},className:"space-y-4",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("label",{htmlFor:"name",className:"text-sm font-medium",children:"Project Name"}),o.jsx(pi,{id:"name",type:"text",value:p,onChange:J=>y(J.target.value),placeholder:"My Project"})]}),o.jsxs(Ke,{type:"submit",className:"w-full gap-2",children:[o.jsx(fb,{className:"w-4 h-4"}),"Create"]})]})})]}),o.jsxs(Tt,{className:"lg:col-span-2 bg-card border-border",children:[o.jsx(zt,{children:o.jsx(_t,{children:"Existing Projects"})}),o.jsxs(Rt,{children:[d?o.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading projects..."}):u.length===0?o.jsx("div",{className:"text-muted-foreground text-sm text-center py-8",children:"No projects found. Create one to get started."}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-3 text-xs font-semibold text-muted-foreground uppercase pb-2 border-b border-border",children:[o.jsx("div",{children:"Name"}),o.jsx("div",{children:"Rate Limit"}),o.jsx("div",{children:"Created"})]}),u.map(J=>o.jsxs("div",{className:`grid grid-cols-3 text-sm py-2 px-3 rounded-md cursor-pointer transition-colors ${v===J.id?"bg-muted text-foreground border border-border":"hover:bg-muted/50"}`,onClick:()=>h(J.id),children:[o.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:[J.name,v===J.id&&o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-foreground"})]}),o.jsx("div",{className:"text-muted-foreground font-mono text-xs flex flex-col gap-1 justify-center",children:o.jsx("span",{children:J.rateLimitRpm?`${J.rateLimitRpm} RPM`:"600 RPM"})}),o.jsx("div",{className:"text-muted-foreground text-xs",children:new Date(J.createdAt).toLocaleDateString()})]},J.id))]}),v&&o.jsxs("div",{className:"mt-8 pt-6 border-t border-border",children:[o.jsxs("div",{className:"flex justify-between items-center mb-4",children:[o.jsx("h3",{className:"font-semibold text-base",children:"API Keys"}),o.jsx(Ke,{variant:"outline",size:"sm",onClick:()=>{K()},children:"Generate New Key"})]}),w&&o.jsxs("div",{className:"mb-6 p-4 rounded-lg bg-muted border border-border space-y-3",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(qo,{className:"w-4 h-4 mt-0.5 text-foreground"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm text-foreground",children:"Please copy your new API key"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"For security reasons, this key will not be shown again. Make sure to copy it now."})]})]}),o.jsxs("div",{className:"flex items-center gap-2 bg-background rounded-md p-2 border border-border",children:[o.jsx("code",{className:"flex-1 text-xs font-mono break-all text-foreground",children:j?w:w.replace(new RegExp("(?<=^nk_live_).*"),"********************************")}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>C(!j),children:j?o.jsx(Yx,{className:"w-4 h-4"}):o.jsx(vs,{className:"w-4 h-4"})}),o.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>{navigator.clipboard.writeText(w),Ge.success("Copied to clipboard!")},children:o.jsx(Ux,{className:"w-4 h-4"})})]})]}),S.length===0?o.jsx("div",{className:"text-sm text-muted-foreground",children:"No API keys found for this project."}):o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"grid grid-cols-4 text-xs font-semibold text-muted-foreground uppercase pb-2",children:[o.jsx("div",{className:"col-span-2",children:"Key ID"}),o.jsx("div",{children:"Role"}),o.jsx("div",{className:"text-right",children:"Actions"})]}),S.map(J=>o.jsxs("div",{className:"grid grid-cols-4 text-sm py-2 items-center group",children:[o.jsx("div",{className:"col-span-2 font-mono text-muted-foreground truncate pr-4 text-xs",children:J.id}),o.jsx("div",{className:"capitalize text-muted-foreground text-xs",children:J.role}),o.jsx("div",{className:"text-right",children:o.jsxs(Ke,{variant:"ghost",size:"sm",className:"h-8 text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{ee(J.id)},children:[o.jsx(Ad,{className:"w-4 h-4 mr-1.5"}),"Revoke"]})})]},J.id))]})]})]})]})]})]})]})}function Hw(){return o.jsxs("div",{className:"h-screen flex bg-background text-foreground overflow-hidden",children:[o.jsx(E1,{}),o.jsx("main",{className:"flex-1 overflow-y-auto",children:o.jsxs(ky,{children:[o.jsx(Ua,{path:"/",element:o.jsx(G0,{})}),o.jsx(Ua,{path:"/login",element:o.jsx(Aw,{})}),o.jsx(Ua,{path:"/logs",element:o.jsx(Tw,{})}),o.jsx(Ua,{path:"/system",element:o.jsx(zw,{})}),o.jsx(Ua,{path:"/analytics",element:o.jsx(Rw,{})}),o.jsx(Ua,{path:"/dlq",element:o.jsx(Mw,{})}),o.jsx(Ua,{path:"/scheduled",element:o.jsx(kw,{})}),o.jsx(Ua,{path:"/workflows",element:o.jsx(Dw,{})}),o.jsx(Ua,{path:"/templates",element:o.jsx(Ow,{})}),o.jsx(Ua,{path:"/users",element:o.jsx(Uw,{})}),o.jsx(Ua,{path:"/projects",element:o.jsx(Lw,{})}),o.jsx(Ua,{path:"*",element:o.jsx(G0,{})})]})}),o.jsx(nS,{theme:"dark"})]})}const Bw=window.location.pathname.startsWith("/admin")?"/admin":"/";kv.createRoot(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx(nx,{basename:Bw,children:o.jsx(hx,{children:o.jsx(px,{children:o.jsx(Hw,{})})})})}));
|