@lunora/studio 1.0.0-alpha.183 → 1.0.0-alpha.184

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.
Files changed (63) hide show
  1. package/dist/standalone/{chunk-KX3YZ3TC.js → chunk-26L63KFY.js} +1 -1
  2. package/dist/standalone/{chunk-3PZNTIBM.js → chunk-2KM4MU7U.js} +1 -1
  3. package/dist/standalone/{chunk-IP7YCJUN.js → chunk-37CLUREK.js} +1 -1
  4. package/dist/standalone/{chunk-XKP3TSCE.js → chunk-3GJKDNXE.js} +1 -1
  5. package/dist/standalone/{chunk-FI6N7XWP.js → chunk-4P4DE3XL.js} +1 -1
  6. package/dist/standalone/{chunk-H43JNQM6.js → chunk-4PLYQWKJ.js} +1 -1
  7. package/dist/standalone/{chunk-TIIEZS24.js → chunk-4X5HAX5N.js} +1 -1
  8. package/dist/standalone/{chunk-QQ3CS3FX.js → chunk-55K64SUB.js} +1 -1
  9. package/dist/standalone/{chunk-5XRNQ732.js → chunk-56XCNBO4.js} +1 -1
  10. package/dist/standalone/{chunk-DAD33Q2T.js → chunk-5AQVGRDR.js} +1 -1
  11. package/dist/standalone/{chunk-I6FR5UAK.js → chunk-5TV5EBCO.js} +1 -1
  12. package/dist/standalone/{chunk-JYT34NQM.js → chunk-6VNVVY4F.js} +1 -1
  13. package/dist/standalone/{chunk-VWXJAY7R.js → chunk-724ZBLVZ.js} +1 -1
  14. package/dist/standalone/{chunk-AULH6SZB.js → chunk-75OWNJEY.js} +2 -2
  15. package/dist/standalone/{chunk-TTIBDOV6.js → chunk-7E4PCEOO.js} +1 -1
  16. package/dist/standalone/{chunk-KIW73EIK.js → chunk-7MF5C3Z6.js} +1 -1
  17. package/dist/standalone/{chunk-SDHFSBNM.js → chunk-7TRN7FQ4.js} +1 -1
  18. package/dist/standalone/{chunk-BAAPQWFF.js → chunk-AO5ROTB4.js} +1 -1
  19. package/dist/standalone/{chunk-A6S4TULR.js → chunk-BMVSHGFK.js} +1 -1
  20. package/dist/standalone/{chunk-B3JY36UV.js → chunk-CLELTQYS.js} +1 -1
  21. package/dist/standalone/{chunk-AX24JD2G.js → chunk-CZIPGHIR.js} +1 -1
  22. package/dist/standalone/{chunk-5LZJ5JBB.js → chunk-DVXDMRWA.js} +1 -1
  23. package/dist/standalone/{chunk-B6RRRJP5.js → chunk-EAQZEXBX.js} +1 -1
  24. package/dist/standalone/{chunk-IXNOQYEE.js → chunk-ETHN2RZR.js} +1 -1
  25. package/dist/standalone/{chunk-CBNGOAD4.js → chunk-FAFNOIJX.js} +1 -1
  26. package/dist/standalone/{chunk-ITMXIPQ7.js → chunk-FDB7QVEC.js} +1 -1
  27. package/dist/standalone/{chunk-GZAXFXZE.js → chunk-FGMA2GGM.js} +1 -1
  28. package/dist/standalone/{chunk-GAPFZFIL.js → chunk-FRMJ5VVM.js} +1 -1
  29. package/dist/standalone/{chunk-5MKG6RW3.js → chunk-FZ45WJQK.js} +1 -1
  30. package/dist/standalone/{chunk-2Y6PXGIS.js → chunk-GETL6R4M.js} +14 -14
  31. package/dist/standalone/{chunk-3TXB4AKZ.js → chunk-GKUDJ3RC.js} +1 -1
  32. package/dist/standalone/{chunk-AODYDAXY.js → chunk-HATH336U.js} +1 -1
  33. package/dist/standalone/{chunk-D4ZGY3II.js → chunk-IYUIJLIW.js} +1 -1
  34. package/dist/standalone/{chunk-66Z7ZIZZ.js → chunk-J6JOGFVB.js} +1 -1
  35. package/dist/standalone/{chunk-Y2I6GYEG.js → chunk-JM6U3CQE.js} +1 -1
  36. package/dist/standalone/{chunk-QWJQUQY3.js → chunk-JP6RVFCJ.js} +1 -1
  37. package/dist/standalone/{chunk-PGMASM2T.js → chunk-JYVJ2OWH.js} +1 -1
  38. package/dist/standalone/{chunk-DI34YDBW.js → chunk-LP7ELDUL.js} +1 -1
  39. package/dist/standalone/{chunk-L2CWAQUO.js → chunk-M3ANC2JI.js} +1 -1
  40. package/dist/standalone/{chunk-PZVVEPIN.js → chunk-MKRJGSYF.js} +1 -1
  41. package/dist/standalone/{chunk-URBHAYYZ.js → chunk-MWSNVNHE.js} +1 -1
  42. package/dist/standalone/{chunk-E2X625P3.js → chunk-N6LSV246.js} +1 -1
  43. package/dist/standalone/{chunk-RM4TNBYG.js → chunk-NRZ5MBPS.js} +1 -1
  44. package/dist/standalone/{chunk-4PRXEO3C.js → chunk-O337Z6XI.js} +1 -1
  45. package/dist/standalone/{chunk-WRZTTZFV.js → chunk-PVAE535J.js} +1 -1
  46. package/dist/standalone/{chunk-AFSPF2R4.js → chunk-PVV6LALL.js} +1 -1
  47. package/dist/standalone/{chunk-GZ6GAFM2.js → chunk-QZHPUFML.js} +1 -1
  48. package/dist/standalone/{chunk-MH2NGGUC.js → chunk-SDBOAPOT.js} +1 -1
  49. package/dist/standalone/{chunk-HGT5U6GD.js → chunk-SGL3ZV4P.js} +1 -1
  50. package/dist/standalone/{chunk-INXSZE5I.js → chunk-T57JAZCX.js} +1 -1
  51. package/dist/standalone/{chunk-WIXX2VWE.js → chunk-UZHJM2CX.js} +1 -1
  52. package/dist/standalone/{chunk-GP2GJRJ3.js → chunk-VCOPIBKL.js} +1 -1
  53. package/dist/standalone/{chunk-V7G6YTQ5.js → chunk-VG34EBBT.js} +1 -1
  54. package/dist/standalone/{chunk-QDHXQ56K.js → chunk-VICAUTXQ.js} +1 -1
  55. package/dist/standalone/{chunk-WD4WHTAV.js → chunk-WDJ4CHIO.js} +1 -1
  56. package/dist/standalone/{chunk-EBU3TTYR.js → chunk-XBKABVCJ.js} +1 -1
  57. package/dist/standalone/{chunk-NVKY4CIW.js → chunk-Y6SKU4M7.js} +1 -1
  58. package/dist/standalone/{chunk-5B6TTEP6.js → chunk-YBZYUPAG.js} +1 -1
  59. package/dist/standalone/{chunk-Z2XS4ZOO.js → chunk-Z2CLSELV.js} +1 -1
  60. package/dist/standalone/{chunk-J3LCGEBD.js → chunk-ZGMGMEFM.js} +1 -1
  61. package/dist/standalone/{chunk-TXHTSFLO.js → chunk-ZWJGQACG.js} +1 -1
  62. package/dist/standalone/studio.js +1 -1
  63. package/package.json +6 -6
@@ -1 +1 @@
1
- import{a as x}from"./chunk-4ZEL6BYL.js";import{c as S}from"./chunk-SDHFSBNM.js";import{f as q}from"./chunk-B6RRRJP5.js";import{d as _,f as g,g as y,n as C}from"./chunk-FODLDLE2.js";import{a as u,d as w,e as L,f as T,g as F}from"./chunk-YKXDMIHQ.js";var v=w(L(),1);var j={},A=g(x.aiGenerateSql),I=g(x.aiTableFilter),O=g(x.aiChartConfig),R=u(s=>{let e=q(),[i,d]=(0,v.useState)({}),[n,r]=(0,v.useState)({}),a=S(x.aiAvailable,j,{shardKey:s}),[f,l]=(0,v.useState)(!1),b=f||a.data?.available===!1,p=u(t=>{d(o=>({...o,[t]:!0})),r(o=>({...o,[t]:void 0}))},"i"),h=u((t,o)=>{d(c=>({...c,[t]:!1})),o!==void 0&&r(c=>({...c,[t]:o})),o==="no-ai-binding"&&l(!0)},"a");return{generate:u(async(t,o)=>{p("sql");try{let{result:c}=await e.query(A,{failedError:o?.error,failedSql:o?.sql,prompt:t},y(s));return h("sql",c.degraded?c.reason:void 0),c.degraded?void 0:c.sql}catch{h("sql","ai-error");return}},"generate"),inferChart:u(async t=>{p("chart");try{let{result:o}=await e.query(O,t,y(s));return h("chart",o.degraded?o.reason:void 0),o.degraded?void 0:o.chart}catch{h("chart","ai-error");return}},"inferChart"),pending:u(t=>i[t]===!0,"pending"),reason:u(t=>n[t],"reason"),suggestFilter:u(async(t,o)=>{p("filter");try{let{result:c}=await e.query(I,{prompt:t,table:o},y(s));return h("filter",c.degraded?c.reason:void 0),c.degraded?void 0:c.clauses}catch{h("filter","ai-error");return}},"suggestFilter"),unavailable:b}},"w");var N=w(T(),1);var m=w(F(),1);var G=u((s,e)=>{if(e==="")return[{match:!1,offset:0,text:s}];let i=[],d=s.toLowerCase(),n=e.toLowerCase(),r=0;for(let a=d.indexOf(n);a!==-1;a=d.indexOf(n,r))a>r&&i.push({match:!1,offset:r,text:s.slice(r,a)}),i.push({match:!0,offset:a,text:s.slice(a,a+e.length)}),r=a+e.length;return r<s.length&&i.push({match:!1,offset:r,text:s.slice(r)}),i},"N"),U=u(s=>{let e=(0,N.c)(9),{highlight:i,value:d}=s;if(d==null){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,m.jsx)("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=l):l=e[0],l}let n,r,a;if(e[1]!==i||e[2]!==d){a=Symbol.for("react.early_return_sentinel");e:{let l=C(d);if(i===void 0||i===""){a=(0,m.jsx)("span",{title:l,children:l});break e}n=l,r=G(l,i).map(z)}e[1]=i,e[2]=d,e[3]=n,e[4]=r,e[5]=a}else n=e[3],r=e[4],a=e[5];if(a!==Symbol.for("react.early_return_sentinel"))return a;let f;return e[6]!==n||e[7]!==r?(f=(0,m.jsx)("span",{title:n,children:r}),e[6]=n,e[7]=r,e[8]=f):f=e[8],f},"v"),Q=u(s=>{let e=(0,N.c)(22),{columns:i,rows:d}=s,n=_(),r;e[0]!==n?(r=n("Field"),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==r?(a=(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let f;if(e[4]!==d||e[5]!==n){let t;e[7]!==n?(t=u((o,c)=>(0,m.jsx)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:n("Row {n}",{n:c+1})},c),"c"),e[7]=n,e[8]=t):t=e[8],f=d.map(t),e[4]=d,e[5]=n,e[6]=f}else f=e[6];let l;e[9]!==a||e[10]!==f?(l=(0,m.jsx)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,m.jsxs)("tr",{children:[a,f]})}),e[9]=a,e[10]=f,e[11]=l):l=e[11];let b;if(e[12]!==i||e[13]!==d){let t;e[15]!==d?(t=u(o=>(0,m.jsxs)("tr",{className:"hover:bg-muted/40",children:[(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:o}),d.map((c,k)=>(0,m.jsx)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,m.jsx)(U,{value:c[o]})},k))]},o),"c"),e[15]=d,e[16]=t):t=e[16],b=i.map(t),e[12]=i,e[13]=d,e[14]=b}else b=e[14];let p;e[17]!==b?(p=(0,m.jsx)("tbody",{children:b}),e[17]=b,e[18]=p):p=e[18];let h;return e[19]!==l||e[20]!==p?(h=(0,m.jsx)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,m.jsxs)("table",{className:"border-collapse text-xs",children:[l,p]})}),e[19]=l,e[20]=p,e[21]=h):h=e[21],h},"T"),V=u(({children:s,layout:e="card",testId:i})=>(0,m.jsx)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":i,children:s}),"j");function z(s){return(0,m.jsx)("mark",{className:s.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:s.text},s.offset)}u(z,"_");export{R as a,U as b,Q as c,V as d};
1
+ import{a as x}from"./chunk-4ZEL6BYL.js";import{c as S}from"./chunk-7TRN7FQ4.js";import{f as q}from"./chunk-EAQZEXBX.js";import{d as _,f as g,g as y,n as C}from"./chunk-FODLDLE2.js";import{a as u,d as w,e as L,f as T,g as F}from"./chunk-YKXDMIHQ.js";var v=w(L(),1);var j={},A=g(x.aiGenerateSql),I=g(x.aiTableFilter),O=g(x.aiChartConfig),R=u(s=>{let e=q(),[i,d]=(0,v.useState)({}),[n,r]=(0,v.useState)({}),a=S(x.aiAvailable,j,{shardKey:s}),[f,l]=(0,v.useState)(!1),b=f||a.data?.available===!1,p=u(t=>{d(o=>({...o,[t]:!0})),r(o=>({...o,[t]:void 0}))},"i"),h=u((t,o)=>{d(c=>({...c,[t]:!1})),o!==void 0&&r(c=>({...c,[t]:o})),o==="no-ai-binding"&&l(!0)},"a");return{generate:u(async(t,o)=>{p("sql");try{let{result:c}=await e.query(A,{failedError:o?.error,failedSql:o?.sql,prompt:t},y(s));return h("sql",c.degraded?c.reason:void 0),c.degraded?void 0:c.sql}catch{h("sql","ai-error");return}},"generate"),inferChart:u(async t=>{p("chart");try{let{result:o}=await e.query(O,t,y(s));return h("chart",o.degraded?o.reason:void 0),o.degraded?void 0:o.chart}catch{h("chart","ai-error");return}},"inferChart"),pending:u(t=>i[t]===!0,"pending"),reason:u(t=>n[t],"reason"),suggestFilter:u(async(t,o)=>{p("filter");try{let{result:c}=await e.query(I,{prompt:t,table:o},y(s));return h("filter",c.degraded?c.reason:void 0),c.degraded?void 0:c.clauses}catch{h("filter","ai-error");return}},"suggestFilter"),unavailable:b}},"w");var N=w(T(),1);var m=w(F(),1);var G=u((s,e)=>{if(e==="")return[{match:!1,offset:0,text:s}];let i=[],d=s.toLowerCase(),n=e.toLowerCase(),r=0;for(let a=d.indexOf(n);a!==-1;a=d.indexOf(n,r))a>r&&i.push({match:!1,offset:r,text:s.slice(r,a)}),i.push({match:!0,offset:a,text:s.slice(a,a+e.length)}),r=a+e.length;return r<s.length&&i.push({match:!1,offset:r,text:s.slice(r)}),i},"N"),U=u(s=>{let e=(0,N.c)(9),{highlight:i,value:d}=s;if(d==null){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,m.jsx)("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=l):l=e[0],l}let n,r,a;if(e[1]!==i||e[2]!==d){a=Symbol.for("react.early_return_sentinel");e:{let l=C(d);if(i===void 0||i===""){a=(0,m.jsx)("span",{title:l,children:l});break e}n=l,r=G(l,i).map(z)}e[1]=i,e[2]=d,e[3]=n,e[4]=r,e[5]=a}else n=e[3],r=e[4],a=e[5];if(a!==Symbol.for("react.early_return_sentinel"))return a;let f;return e[6]!==n||e[7]!==r?(f=(0,m.jsx)("span",{title:n,children:r}),e[6]=n,e[7]=r,e[8]=f):f=e[8],f},"v"),Q=u(s=>{let e=(0,N.c)(22),{columns:i,rows:d}=s,n=_(),r;e[0]!==n?(r=n("Field"),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==r?(a=(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let f;if(e[4]!==d||e[5]!==n){let t;e[7]!==n?(t=u((o,c)=>(0,m.jsx)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:n("Row {n}",{n:c+1})},c),"c"),e[7]=n,e[8]=t):t=e[8],f=d.map(t),e[4]=d,e[5]=n,e[6]=f}else f=e[6];let l;e[9]!==a||e[10]!==f?(l=(0,m.jsx)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,m.jsxs)("tr",{children:[a,f]})}),e[9]=a,e[10]=f,e[11]=l):l=e[11];let b;if(e[12]!==i||e[13]!==d){let t;e[15]!==d?(t=u(o=>(0,m.jsxs)("tr",{className:"hover:bg-muted/40",children:[(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:o}),d.map((c,k)=>(0,m.jsx)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,m.jsx)(U,{value:c[o]})},k))]},o),"c"),e[15]=d,e[16]=t):t=e[16],b=i.map(t),e[12]=i,e[13]=d,e[14]=b}else b=e[14];let p;e[17]!==b?(p=(0,m.jsx)("tbody",{children:b}),e[17]=b,e[18]=p):p=e[18];let h;return e[19]!==l||e[20]!==p?(h=(0,m.jsx)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,m.jsxs)("table",{className:"border-collapse text-xs",children:[l,p]})}),e[19]=l,e[20]=p,e[21]=h):h=e[21],h},"T"),V=u(({children:s,layout:e="card",testId:i})=>(0,m.jsx)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":i,children:s}),"j");function z(s){return(0,m.jsx)("mark",{className:s.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:s.text},s.offset)}u(z,"_");export{R as a,U as b,Q as c,V as d};
@@ -1,4 +1,4 @@
1
- import{c as wh,e as pi,f as mi,j as Sh}from"./chunk-5JDWLCSH.js";import{a as bh,b as Ah}from"./chunk-EVTM6Q43.js";import{b as JE}from"./chunk-Y6CXU7T4.js";import{a as xh}from"./chunk-4L4WTGN5.js";import{d as rl}from"./chunk-2Y6PXGIS.js";import{a as i,b as X,c as XE,d as M,e as z,f as ZE,g as QE,h as re,i as Xr}from"./chunk-YKXDMIHQ.js";var Oh=X(Ph=>{function eI(e,t,{signal:r,edges:n}={}){let a,o=null,l=n!=null&&n.includes("leading"),s=n==null||n.includes("trailing"),u=i(()=>{o!==null&&(e.apply(a,o),a=void 0,o=null)},"invoke"),c=i(()=>{s&&u(),m()},"onTimerEnd"),f=null,d=i(()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,c()},t)},"schedule"),p=i(()=>{f!==null&&(clearTimeout(f),f=null)},"cancelTimer"),m=i(()=>{p(),a=void 0,o=null},"cancel"),h=i(()=>{u()},"flush"),v=i(function(...g){if(r?.aborted)return;a=this,o=g;let y=f==null;d(),l&&y&&u()},"debounced");return v.schedule=d,v.cancel=m,v.flush=h,r?.addEventListener("abort",m,{once:!0}),v}i(eI,"debounce");Ph.debounce=eI});var Ih=X(Eh=>{var tI=Oh();function rI(e,t=0,r={}){typeof r!="object"&&(r={});let{leading:n=!1,trailing:a=!0,maxWait:o}=r,l=Array(2);n&&(l[0]="leading"),a&&(l[1]="trailing");let s,u=null,c=tI.debounce(function(...p){s=e.apply(this,p),u=null},t,{edges:l}),f=i(function(...p){return o!=null&&(u===null&&(u=Date.now()),Date.now()-u>=o)?(s=e.apply(this,p),u=Date.now(),c.cancel(),c.schedule(),s):(c.apply(this,p),s)},"debounced"),d=i(()=>(c.flush(),s),"flush");return f.cancel=c.cancel,f.flush=d,f}i(rI,"debounce");Eh.debounce=rI});var kh=X(Ch=>{var nI=Ih();function iI(e,t=0,r={}){let{leading:n=!0,trailing:a=!0}=r;return nI.debounce(e,t,{leading:n,maxWait:t,trailing:a})}i(iI,"throttle");Ch.throttle=iI});var Th=X((m$,_h)=>{_h.exports=kh().throttle});var Rh=X(Dh=>{function aI(e){return e==="__proto__"}i(aI,"isUnsafeProperty");Dh.isUnsafeProperty=aI});var tf=X(Mh=>{function oI(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}i(oI,"isDeepKey");Mh.isDeepKey=oI});var nl=X(Nh=>{function lI(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}i(lI,"toKey");Nh.toKey=lI});var Bh=X(Lh=>{function jh(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(jh).join(",");let t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}i(jh,"toString");Lh.toString=jh});var il=X(zh=>{var sI=nl(),uI=Bh();function cI(e){if(Array.isArray(e))return e.map(sI.toKey);if(typeof e=="symbol")return[e];e=uI.toString(e);let t=[],r=e.length;if(r===0)return t;let n=0,a="",o="",l=!1;for(e.charCodeAt(0)===46&&(t.push(""),n++);n<r;){let s=e[n];o?s==="\\"&&n+1<r?(n++,a+=e[n]):s===o?o="":a+=s:l?s==='"'||s==="'"?o=s:s==="]"?(l=!1,t.push(a),a=""):a+=s:s==="["?(l=!0,a&&(t.push(a),a="")):s==="."?a&&(t.push(a),a=""):a+=s,n++}return a&&t.push(a),t}i(cI,"toPath");zh.toPath=cI});var al=X(Wh=>{var rf=Rh(),fI=tf(),dI=nl(),pI=il();function Fh(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(rf.isUnsafeProperty(t))return r;let n=e[t];return n===void 0?fI.isDeepKey(t)?Fh(e,pI.toPath(t),r):r:n}case"number":case"symbol":{typeof t=="number"&&(t=dI.toKey(t));let n=e[t];return n===void 0?r:n}default:{if(Array.isArray(t))return mI(e,t,r);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),rf.isUnsafeProperty(t))return r;let n=e[t];return n===void 0?r:n}}}i(Fh,"get");function mI(e,t,r){if(t.length===0)return r;let n=e;for(let a=0;a<t.length;a++){if(n==null||rf.isUnsafeProperty(t[a]))return r;n=n[t[a]]}return n===void 0?r:n}i(mI,"getWithPath");Wh.get=Fh});var _a=X((I$,Vh)=>{Vh.exports=al().get});var Jh=X(Qh=>{function NI(e,t=1){let r=[],n=Math.floor(t),a=i((o,l)=>{for(let s=0;s<o.length;s++){let u=o[s];Array.isArray(u)&&l<n?a(u,l+1):r.push(u)}},"recursive");return a(e,0),r}i(NI,"flatten");Qh.flatten=NI});var Da=X(ev=>{function jI(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}i(jI,"isEqualsSameValueZero");ev.isEqualsSameValueZero=jI});var sl=X(()=>{Da()});var rv=X(tv=>{function LI(e){return Number.isSafeInteger(e)&&e>=0}i(LI,"isLength");tv.isLength=LI});var lf=X(nv=>{var BI=rv();function zI(e){return e!=null&&typeof e!="function"&&BI.isLength(e.length)}i(zI,"isArrayLike");nv.isArrayLike=zI});var sf=X(iv=>{function FI(e){return e!==null&&(typeof e=="object"||typeof e=="function")}i(FI,"isObject");iv.isObject=FI});var uf=X(av=>{var WI=/^(?:0|[1-9]\d*)$/;function VI(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return WI.test(e)}}i(VI,"isIndex");av.isIndex=VI});var cf=X(ov=>{var qI=Da();sl();var $I=lf(),KI=sf(),UI=uf();function HI(e,t,r){return KI.isObject(r)&&(typeof t=="number"&&$I.isArrayLike(r)&&UI.isIndex(t)&&t<r.length||typeof t=="string"&&t in r)?qI.isEqualsSameValueZero(r[t],e):!1}i(HI,"isIterateeCall");ov.isIterateeCall=HI});var uv=X(sv=>{function lv(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}i(lv,"getPriority");var YI=i((e,t,r)=>{if(e!==t){let n=lv(e),a=lv(t);if(n===a&&n===0){if(e<t)return r==="desc"?1:-1;if(e>t)return r==="desc"?-1:1}return r==="desc"?a-n:n-a}return 0},"compareValues");sv.compareValues=YI});var ff=X(cv=>{function GI(e){return typeof e=="symbol"||e instanceof Symbol}i(GI,"isSymbol");cv.isSymbol=GI});var dv=X(fv=>{var XI=ff(),ZI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,QI=/^\w*$/;function JI(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||XI.isSymbol(e)?!0:typeof e=="string"&&(QI.test(e)||!ZI.test(e))||t!=null&&Object.hasOwn(t,e)}i(JI,"isKey");fv.isKey=JI});var mv=X(pv=>{var e1=il(),t1=uv(),r1=dv();function n1(e,t,r,n){if(e==null)return[];r=n?void 0:r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(s=>String(s));let a=i((s,u)=>{let c=s;for(let f=0;f<u.length&&c!=null;++f)c=c[u[f]];return c},"getValueByNestedPath"),o=i((s,u)=>u==null||s==null?u:typeof s=="object"&&"key"in s?Object.hasOwn(u,s.key)?u[s.key]:a(u,s.path):typeof s=="function"?s(u):Array.isArray(s)?a(u,s):typeof u=="object"?u[s]:u,"getValueByCriterion"),l=t.map(s=>(Array.isArray(s)&&s.length===1&&(s=s[0]),s==null||typeof s=="function"||Array.isArray(s)||r1.isKey(s)?s:{key:s,path:e1.toPath(s)}));return e.map(s=>({original:s,criteria:l.map(u=>o(u,s))})).slice().sort((s,u)=>{for(let c=0;c<l.length;c++){let f=t1.compareValues(s.criteria[c],u.criteria[c],r[c]);if(f!==0)return f}return 0}).map(s=>s.original)}i(n1,"orderBy");pv.orderBy=n1});var yv=X(vv=>{var i1=Jh(),hv=cf(),a1=mv();function o1(e,...t){let r=t.length;return r>1&&hv.isIterateeCall(e,t[0],t[1])?t=[]:r>2&&hv.isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),a1.orderBy(e,i1.flatten(t),["asc"])}i(o1,"sortBy");vv.sortBy=o1});var Ra=X((xK,gv)=>{gv.exports=yv().sortBy});var _v=X(kv=>{function j1(e,t){let r=new Map;for(let n=0;n<e.length;n++){let a=e[n],o=t(a,n,e);r.has(o)||r.set(o,a)}return Array.from(r.values())}i(j1,"uniqBy");kv.uniqBy=j1});var Dv=X(Tv=>{function L1(e,t){return function(...r){return e.apply(this,r.slice(0,t))}}i(L1,"ary");Tv.ary=L1});var pf=X(Rv=>{function B1(e){return e}i(B1,"identity");Rv.identity=B1});var Nv=X(Mv=>{var z1=al();function F1(e){return function(t){return z1.get(t,e)}}i(F1,"property");Mv.property=F1});var mf=X(jv=>{function W1(e){return e==null||typeof e!="object"&&typeof e!="function"}i(W1,"isPrimitive");jv.isPrimitive=W1});var Bv=X(Lv=>{function V1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}i(V1,"isTypedArray");Lv.isTypedArray=V1});var hf=X(zv=>{function q1(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}i(q1,"getSymbols");zv.getSymbols=q1});var ja=X(Fv=>{function $1(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}i($1,"getTag");Fv.getTag=$1});var fl=X(Oe=>{var K1="[object RegExp]",U1="[object String]",H1="[object Number]",Y1="[object Boolean]",G1="[object Arguments]",X1="[object Symbol]",Z1="[object Date]",Q1="[object Map]",J1="[object Set]",eC="[object Array]",tC="[object Function]",rC="[object ArrayBuffer]",nC="[object Object]",iC="[object Error]",aC="[object DataView]",oC="[object Uint8Array]",lC="[object Uint8ClampedArray]",sC="[object Uint16Array]",uC="[object Uint32Array]",cC="[object BigUint64Array]",fC="[object Int8Array]",dC="[object Int16Array]",pC="[object Int32Array]",mC="[object BigInt64Array]",hC="[object Float32Array]",vC="[object Float64Array]";Oe.argumentsTag=G1;Oe.arrayBufferTag=rC;Oe.arrayTag=eC;Oe.bigInt64ArrayTag=mC;Oe.bigUint64ArrayTag=cC;Oe.booleanTag=Y1;Oe.dataViewTag=aC;Oe.dateTag=Z1;Oe.errorTag=iC;Oe.float32ArrayTag=hC;Oe.float64ArrayTag=vC;Oe.functionTag=tC;Oe.int16ArrayTag=dC;Oe.int32ArrayTag=pC;Oe.int8ArrayTag=fC;Oe.mapTag=Q1;Oe.numberTag=H1;Oe.objectTag=nC;Oe.regexpTag=K1;Oe.setTag=J1;Oe.stringTag=U1;Oe.symbolTag=X1;Oe.uint16ArrayTag=sC;Oe.uint32ArrayTag=uC;Oe.uint8ArrayTag=oC;Oe.uint8ClampedArrayTag=lC});var Vv=X(Wv=>{var yC=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();Wv.globalThis_=yC});var vf=X($v=>{var qv=Vv();function gC(e){return typeof qv.globalThis_.Buffer<"u"&&qv.globalThis_.Buffer.isBuffer(e)}i(gC,"isBuffer");$v.isBuffer=gC});var yf=X(dl=>{var xC=mf(),bC=Bv(),AC=hf(),wC=ja(),Le=fl(),SC=vf();function PC(e,t){return xn(e,void 0,e,new Map,t)}i(PC,"cloneDeepWith");function xn(e,t,r,n=new Map,a=void 0){let o=a?.(e,t,r,n);if(o!==void 0)return o;if(xC.isPrimitive(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){let l=new Array(e.length);n.set(e,l);for(let s=0;s<e.length;s++)l[s]=xn(e[s],s,r,n,a);return Object.hasOwn(e,"index")&&(l.index=e.index),Object.hasOwn(e,"input")&&(l.input=e.input),l}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let l=new RegExp(e.source,e.flags);return l.lastIndex=e.lastIndex,l}if(e instanceof Map){let l=new Map;n.set(e,l);for(let[s,u]of e)l.set(s,xn(u,s,r,n,a));return l}if(e instanceof Set){let l=new Set;n.set(e,l);for(let s of e)l.add(xn(s,void 0,r,n,a));return l}if(SC.isBuffer(e))return e.subarray();if(bC.isTypedArray(e)){let l=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,l);for(let s=0;s<e.length;s++)l[s]=xn(e[s],s,r,n,a);return l}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let l=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,l),Ir(l,e,r,n,a),l}if(typeof File<"u"&&e instanceof File){let l=new File([e],e.name,{type:e.type});return n.set(e,l),Ir(l,e,r,n,a),l}if(typeof Blob<"u"&&e instanceof Blob){let l=new Blob([e],{type:e.type});return n.set(e,l),Ir(l,e,r,n,a),l}if(e instanceof Error){let l=structuredClone(e);return n.set(e,l),l.message=e.message,l.name=e.name,l.stack=e.stack,l.cause=e.cause,l.constructor=e.constructor,Ir(l,e,r,n,a),l}if(e instanceof Boolean){let l=new Boolean(e.valueOf());return n.set(e,l),Ir(l,e,r,n,a),l}if(e instanceof Number){let l=new Number(e.valueOf());return n.set(e,l),Ir(l,e,r,n,a),l}if(e instanceof String){let l=new String(e.valueOf());return n.set(e,l),Ir(l,e,r,n,a),l}if(typeof e=="object"&&OC(e)){let l=Object.create(Object.getPrototypeOf(e));return n.set(e,l),Ir(l,e,r,n,a),l}return e}i(xn,"cloneDeepWithImpl");function Ir(e,t,r=e,n,a){let o=[...Object.keys(t),...AC.getSymbols(t)];for(let l=0;l<o.length;l++){let s=o[l],u=Object.getOwnPropertyDescriptor(e,s);(u==null||u.writable)&&(e[s]=xn(t[s],s,r,n,a))}}i(Ir,"copyProperties");function OC(e){switch(wC.getTag(e)){case Le.argumentsTag:case Le.arrayTag:case Le.arrayBufferTag:case Le.dataViewTag:case Le.booleanTag:case Le.dateTag:case Le.float32ArrayTag:case Le.float64ArrayTag:case Le.int8ArrayTag:case Le.int16ArrayTag:case Le.int32ArrayTag:case Le.mapTag:case Le.numberTag:case Le.objectTag:case Le.regexpTag:case Le.setTag:case Le.stringTag:case Le.symbolTag:case Le.uint8ArrayTag:case Le.uint8ClampedArrayTag:case Le.uint16ArrayTag:case Le.uint32ArrayTag:return!0;default:return!1}}i(OC,"isCloneableObject");dl.cloneDeepWith=PC;dl.cloneDeepWithImpl=xn;dl.copyProperties=Ir});var Uv=X(Kv=>{var EC=yf();function IC(e){return EC.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}i(IC,"cloneDeep");Kv.cloneDeep=IC});var Qv=X(Zv=>{var Hv=mf(),Yv=Da();sl();var CC=sf();function Gv(e,t,r){return typeof r!="function"?Gv(e,t,()=>{}):gf(e,t,i(function n(a,o,l,s,u,c){let f=r(a,o,l,s,u,c);return f!==void 0?!!f:gf(a,o,n,c)},"doesMatch"),new Map)}i(Gv,"isMatchWith");function gf(e,t,r,n){if(t===e)return!0;switch(typeof t){case"object":return kC(e,t,r,n);case"function":return Object.keys(t).length>0?gf(e,{...t},r,n):Yv.isEqualsSameValueZero(e,t);default:return CC.isObject(e)?typeof t=="string"?t==="":!0:Yv.isEqualsSameValueZero(e,t)}}i(gf,"isMatchWithInternal");function kC(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return Xv(e,t,r,n);if(t instanceof Map)return _C(e,t,r,n);if(t instanceof Set)return TC(e,t,r,n);let a=Object.keys(t);if(e==null||Hv.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(n?.has(t))return n.get(t)===e;n?.set(t,e);try{for(let o=0;o<a.length;o++){let l=a[o];if(!Hv.isPrimitive(e)&&!(l in e)||t[l]===void 0&&e[l]!==void 0||t[l]===null&&e[l]!==null||!r(e[l],t[l],l,e,t,n))return!1}return!0}finally{n?.delete(t)}}i(kC,"isObjectMatch");function _C(e,t,r,n){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[a,o]of t.entries())if(r(e.get(a),o,a,e,t,n)===!1)return!1;return!0}i(_C,"isMapMatch");function Xv(e,t,r,n){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let a=new Set;for(let o=0;o<t.length;o++){let l=t[o],s=!1;for(let u=0;u<e.length;u++){if(a.has(u))continue;let c=e[u],f=!1;if(r(c,l,o,e,t,n)&&(f=!0),f){a.add(u),s=!0;break}}if(!s)return!1}return!0}i(Xv,"isArrayMatch");function TC(e,t,r,n){return t.size===0?!0:e instanceof Set?Xv([...e],[...t],r,n):!1}i(TC,"isSetMatch");Zv.isMatchWith=Gv});var xf=X(Jv=>{var DC=Qv();function RC(e,t){return DC.isMatchWith(e,t,()=>{})}i(RC,"isMatch");Jv.isMatch=RC});var ty=X(ey=>{var MC=Uv(),NC=xf();function jC(e){return e=MC.cloneDeep(e),t=>NC.isMatch(t,e)}i(jC,"matches");ey.matches=jC});var ny=X(ry=>{var LC=ja(),pl=fl(),ml=yf();function BC(e,t){return ml.cloneDeepWith(e,(r,n,a,o)=>{let l=t?.(r,n,a,o);if(l!==void 0)return l;if(typeof e=="object"){if(LC.getTag(e)==="[object Object]"&&typeof e.constructor!="function"){let s={};return o.set(e,s),ml.copyProperties(s,e,a,o),s}switch(Object.prototype.toString.call(e)){case pl.numberTag:case pl.stringTag:case pl.booleanTag:{let s=new e.constructor(e?.valueOf());return ml.copyProperties(s,e),s}case pl.argumentsTag:{let s={};return ml.copyProperties(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}i(BC,"cloneDeepWith");ry.cloneDeepWith=BC});var ay=X(iy=>{var zC=ny();function FC(e){return zC.cloneDeepWith(e)}i(FC,"cloneDeep");iy.cloneDeep=FC});var ly=X(oy=>{var WC=ja();function VC(e){return e!==null&&typeof e=="object"&&WC.getTag(e)==="[object Arguments]"}i(VC,"isArguments");oy.isArguments=VC});var uy=X(sy=>{var qC=tf(),$C=il(),KC=uf(),UC=ly();function HC(e,t){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&qC.isDeepKey(t)&&e?.[t]==null?r=$C.toPath(t):r=[t],r.length===0)return!1;let n=e;for(let a=0;a<r.length;a++){let o=r[a];if((n==null||!Object.hasOwn(n,o))&&!((Array.isArray(n)||UC.isArguments(n))&&KC.isIndex(o)&&o<n.length))return!1;n=n[o]}return!0}i(HC,"has");sy.has=HC});var fy=X(cy=>{var YC=nl(),GC=al(),XC=xf(),ZC=ay(),QC=uy();function JC(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=YC.toKey(e);break}return t=ZC.cloneDeep(t),function(r){let n=GC.get(r,e);return n===void 0?QC.has(r,e):t===void 0?n===void 0:XC.isMatch(n,t)}}i(JC,"matchesProperty");cy.matchesProperty=JC});var py=X(dy=>{var ek=pf(),tk=Nv(),rk=ty(),nk=fy();function ik(e){if(e==null)return ek.identity;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?nk.matchesProperty(e[0],e[1]):rk.matches(e);case"string":case"symbol":case"number":return tk.property(e)}}i(ik,"iteratee");dy.iteratee=ik});var hy=X(my=>{function ak(e){return typeof e=="object"&&e!==null}i(ak,"isObjectLike");my.isObjectLike=ak});var yy=X(vy=>{var ok=lf(),lk=hy();function sk(e){return lk.isObjectLike(e)&&ok.isArrayLike(e)}i(sk,"isArrayLikeObject");vy.isArrayLikeObject=sk});var xy=X(gy=>{var uk=_v(),ck=Dv(),fk=pf(),dk=py(),pk=yy();function mk(e,t=fk.identity){return pk.isArrayLikeObject(e)?uk.uniqBy(Array.from(e),ck.ary(dk.iteratee(t),1)):[]}i(mk,"uniqBy");gy.uniqBy=mk});var Ay=X((TU,by)=>{by.exports=xy().uniqBy});var xb=X(gb=>{var uD=ff();function cD(e){return uD.isSymbol(e)?NaN:Number(e)}i(cD,"toNumber");gb.toNumber=cD});var Ab=X(bb=>{var fD=xb();function dD(e){return e?(e=fD.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}i(dD,"toFinite");bb.toFinite=dD});var Sb=X(wb=>{var yd=Ab(),pD=cf();function mD(e,t,r){r&&typeof r!="number"&&pD.isIterateeCall(e,t,r)&&(t=r=void 0),e=yd.toFinite(e),t===void 0?(t=e,e=0):t=yd.toFinite(t),r=r===void 0?e<t?1:-1:yd.toFinite(r);let n=Math.max(Math.ceil((t-e)/(r||1)),0),a=new Array(n);for(let o=0;o<n;o++)a[o]=e,e+=r;return a}i(mD,"range");wb.range=mD});var Ob=X((TX,Pb)=>{Pb.exports=Sb().range});var bd=X((Tb,Cs)=>{(function(e){"use strict";var t=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},n=!0,a="[DecimalError] ",o=a+"Invalid argument: ",l=a+"Exponent out of range: ",s=Math.floor,u=Math.pow,c=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,f,d=1e7,p=7,m=9007199254740991,h=s(m/p),v={};v.absoluteValue=v.abs=function(){var b=new this.constructor(this);return b.s&&(b.s=1),b},v.comparedTo=v.cmp=function(b){var S,k,O,I,C=this;if(b=new C.constructor(b),C.s!==b.s)return C.s||-b.s;if(C.e!==b.e)return C.e>b.e^C.s<0?1:-1;for(O=C.d.length,I=b.d.length,S=0,k=O<I?O:I;S<k;++S)if(C.d[S]!==b.d[S])return C.d[S]>b.d[S]^C.s<0?1:-1;return O===I?0:O>I^C.s<0?1:-1},v.decimalPlaces=v.dp=function(){var b=this,S=b.d.length-1,k=(S-b.e)*p;if(S=b.d[S],S)for(;S%10==0;S/=10)k--;return k<0?0:k},v.dividedBy=v.div=function(b){return A(this,new this.constructor(b))},v.dividedToIntegerBy=v.idiv=function(b){var S=this,k=S.constructor;return R(A(S,new k(b),0,1),k.precision)},v.equals=v.eq=function(b){return!this.cmp(b)},v.exponent=function(){return E(this)},v.greaterThan=v.gt=function(b){return this.cmp(b)>0},v.greaterThanOrEqualTo=v.gte=function(b){return this.cmp(b)>=0},v.isInteger=v.isint=function(){return this.e>this.d.length-2},v.isNegative=v.isneg=function(){return this.s<0},v.isPositive=v.ispos=function(){return this.s>0},v.isZero=function(){return this.s===0},v.lessThan=v.lt=function(b){return this.cmp(b)<0},v.lessThanOrEqualTo=v.lte=function(b){return this.cmp(b)<1},v.logarithm=v.log=function(b){var S,k=this,O=k.constructor,I=O.precision,C=I+5;if(b===void 0)b=new O(10);else if(b=new O(b),b.s<1||b.eq(f))throw Error(a+"NaN");if(k.s<1)throw Error(a+(k.s?"NaN":"-Infinity"));return k.eq(f)?new O(0):(n=!1,S=A(D(k,C),D(b,C),C),n=!0,R(S,I))},v.minus=v.sub=function(b){var S=this;return b=new S.constructor(b),S.s==b.s?V(S,b):g(S,(b.s=-b.s,b))},v.modulo=v.mod=function(b){var S,k=this,O=k.constructor,I=O.precision;if(b=new O(b),!b.s)throw Error(a+"NaN");return k.s?(n=!1,S=A(k,b,0,1).times(b),n=!0,k.minus(S)):R(new O(k),I)},v.naturalExponential=v.exp=function(){return P(this)},v.naturalLogarithm=v.ln=function(){return D(this)},v.negated=v.neg=function(){var b=new this.constructor(this);return b.s=-b.s||0,b},v.plus=v.add=function(b){var S=this;return b=new S.constructor(b),S.s==b.s?g(S,b):V(S,(b.s=-b.s,b))},v.precision=v.sd=function(b){var S,k,O,I=this;if(b!==void 0&&b!==!!b&&b!==1&&b!==0)throw Error(o+b);if(S=E(I)+1,O=I.d.length-1,k=O*p+1,O=I.d[O],O){for(;O%10==0;O/=10)k--;for(O=I.d[0];O>=10;O/=10)k++}return b&&S>k?S:k},v.squareRoot=v.sqrt=function(){var b,S,k,O,I,C,j,N=this,W=N.constructor;if(N.s<1){if(!N.s)return new W(0);throw Error(a+"NaN")}for(b=E(N),n=!1,I=Math.sqrt(+N),I==0||I==1/0?(S=w(N.d),(S.length+b)%2==0&&(S+="0"),I=Math.sqrt(S),b=s((b+1)/2)-(b<0||b%2),I==1/0?S="5e"+b:(S=I.toExponential(),S=S.slice(0,S.indexOf("e")+1)+b),O=new W(S)):O=new W(I.toString()),k=W.precision,I=j=k+3;;)if(C=O,O=C.plus(A(N,C,j+2)).times(.5),w(C.d).slice(0,j)===(S=w(O.d)).slice(0,j)){if(S=S.slice(j-3,j+1),I==j&&S=="4999"){if(R(C,k+1,0),C.times(C).eq(N)){O=C;break}}else if(S!="9999")break;j+=4}return n=!0,R(O,k)},v.times=v.mul=function(b){var S,k,O,I,C,j,N,W,Y,U=this,G=U.constructor,Re=U.d,F=(b=new G(b)).d;if(!U.s||!b.s)return new G(0);for(b.s*=U.s,k=U.e+b.e,W=Re.length,Y=F.length,W<Y&&(C=Re,Re=F,F=C,j=W,W=Y,Y=j),C=[],j=W+Y,O=j;O--;)C.push(0);for(O=Y;--O>=0;){for(S=0,I=W+O;I>O;)N=C[I]+F[O]*Re[I-O-1]+S,C[I--]=N%d|0,S=N/d|0;C[I]=(C[I]+S)%d|0}for(;!C[--j];)C.pop();return S?++k:C.shift(),b.d=C,b.e=k,n?R(b,G.precision):b},v.toDecimalPlaces=v.todp=function(b,S){var k=this,O=k.constructor;return k=new O(k),b===void 0?k:(y(b,0,t),S===void 0?S=O.rounding:y(S,0,8),R(k,b+E(k)+1,S))},v.toExponential=function(b,S){var k,O=this,I=O.constructor;return b===void 0?k=B(O,!0):(y(b,0,t),S===void 0?S=I.rounding:y(S,0,8),O=R(new I(O),b+1,S),k=B(O,!0,b+1)),k},v.toFixed=function(b,S){var k,O,I=this,C=I.constructor;return b===void 0?B(I):(y(b,0,t),S===void 0?S=C.rounding:y(S,0,8),O=R(new C(I),b+E(I)+1,S),k=B(O.abs(),!1,b+E(O)+1),I.isneg()&&!I.isZero()?"-"+k:k)},v.toInteger=v.toint=function(){var b=this,S=b.constructor;return R(new S(b),E(b)+1,S.rounding)},v.toNumber=function(){return+this},v.toPower=v.pow=function(b){var S,k,O,I,C,j,N=this,W=N.constructor,Y=12,U=+(b=new W(b));if(!b.s)return new W(f);if(N=new W(N),!N.s){if(b.s<1)throw Error(a+"Infinity");return N}if(N.eq(f))return N;if(O=W.precision,b.eq(f))return R(N,O);if(S=b.e,k=b.d.length-1,j=S>=k,C=N.s,j){if((k=U<0?-U:U)<=m){for(I=new W(f),S=Math.ceil(O/p+4),n=!1;k%2&&(I=I.times(N),Q(I.d,S)),k=s(k/2),k!==0;)N=N.times(N),Q(N.d,S);return n=!0,b.s<0?new W(f).div(I):R(I,O)}}else if(C<0)throw Error(a+"NaN");return C=C<0&&b.d[Math.max(S,k)]&1?-1:1,N.s=1,n=!1,I=b.times(D(N,O+Y)),n=!0,I=P(I),I.s=C,I},v.toPrecision=function(b,S){var k,O,I=this,C=I.constructor;return b===void 0?(k=E(I),O=B(I,k<=C.toExpNeg||k>=C.toExpPos)):(y(b,1,t),S===void 0?S=C.rounding:y(S,0,8),I=R(new C(I),b,S),k=E(I),O=B(I,b<=k||k<=C.toExpNeg,b)),O},v.toSignificantDigits=v.tosd=function(b,S){var k=this,O=k.constructor;return b===void 0?(b=O.precision,S=O.rounding):(y(b,1,t),S===void 0?S=O.rounding:y(S,0,8)),R(new O(k),b,S)},v.toString=v.valueOf=v.val=v.toJSON=function(){var b=this,S=E(b),k=b.constructor;return B(b,S<=k.toExpNeg||S>=k.toExpPos)};function g(b,S){var k,O,I,C,j,N,W,Y,U=b.constructor,G=U.precision;if(!b.s||!S.s)return S.s||(S=new U(b)),n?R(S,G):S;if(W=b.d,Y=S.d,j=b.e,I=S.e,W=W.slice(),C=j-I,C){for(C<0?(O=W,C=-C,N=Y.length):(O=Y,I=j,N=W.length),j=Math.ceil(G/p),N=j>N?j+1:N+1,C>N&&(C=N,O.length=1),O.reverse();C--;)O.push(0);O.reverse()}for(N=W.length,C=Y.length,N-C<0&&(C=N,O=Y,Y=W,W=O),k=0;C;)k=(W[--C]=W[C]+Y[C]+k)/d|0,W[C]%=d;for(k&&(W.unshift(k),++I),N=W.length;W[--N]==0;)W.pop();return S.d=W,S.e=I,n?R(S,G):S}i(g,"add");function y(b,S,k){if(b!==~~b||b<S||b>k)throw Error(o+b)}i(y,"checkInt32");function w(b){var S,k,O,I=b.length-1,C="",j=b[0];if(I>0){for(C+=j,S=1;S<I;S++)O=b[S]+"",k=p-O.length,k&&(C+=_(k)),C+=O;j=b[S],O=j+"",k=p-O.length,k&&(C+=_(k))}else if(j===0)return"0";for(;j%10===0;)j/=10;return C+j}i(w,"digitsToString");var A=(function(){function b(O,I){var C,j=0,N=O.length;for(O=O.slice();N--;)C=O[N]*I+j,O[N]=C%d|0,j=C/d|0;return j&&O.unshift(j),O}i(b,"multiplyInteger");function S(O,I,C,j){var N,W;if(C!=j)W=C>j?1:-1;else for(N=W=0;N<C;N++)if(O[N]!=I[N]){W=O[N]>I[N]?1:-1;break}return W}i(S,"compare");function k(O,I,C){for(var j=0;C--;)O[C]-=j,j=O[C]<I[C]?1:0,O[C]=j*d+O[C]-I[C];for(;!O[0]&&O.length>1;)O.shift()}return i(k,"subtract"),function(O,I,C,j){var N,W,Y,U,G,Re,F,ne,H,L,qe,ue,te,rt,Ft,di,ar,el,tl=O.constructor,GE=O.s==I.s?1:-1,hr=O.d,Ye=I.d;if(!O.s)return new tl(O);if(!I.s)throw Error(a+"Division by zero");for(W=O.e-I.e,ar=Ye.length,Ft=hr.length,F=new tl(GE),ne=F.d=[],Y=0;Ye[Y]==(hr[Y]||0);)++Y;if(Ye[Y]>(hr[Y]||0)&&--W,C==null?ue=C=tl.precision:j?ue=C+(E(O)-E(I))+1:ue=C,ue<0)return new tl(0);if(ue=ue/p+2|0,Y=0,ar==1)for(U=0,Ye=Ye[0],ue++;(Y<Ft||U)&&ue--;Y++)te=U*d+(hr[Y]||0),ne[Y]=te/Ye|0,U=te%Ye|0;else{for(U=d/(Ye[0]+1)|0,U>1&&(Ye=b(Ye,U),hr=b(hr,U),ar=Ye.length,Ft=hr.length),rt=ar,H=hr.slice(0,ar),L=H.length;L<ar;)H[L++]=0;el=Ye.slice(),el.unshift(0),di=Ye[0],Ye[1]>=d/2&&++di;do U=0,N=S(Ye,H,ar,L),N<0?(qe=H[0],ar!=L&&(qe=qe*d+(H[1]||0)),U=qe/di|0,U>1?(U>=d&&(U=d-1),G=b(Ye,U),Re=G.length,L=H.length,N=S(G,H,Re,L),N==1&&(U--,k(G,ar<Re?el:Ye,Re))):(U==0&&(N=U=1),G=Ye.slice()),Re=G.length,Re<L&&G.unshift(0),k(H,G,L),N==-1&&(L=H.length,N=S(Ye,H,ar,L),N<1&&(U++,k(H,ar<L?el:Ye,L))),L=H.length):N===0&&(U++,H=[0]),ne[Y++]=U,N&&H[0]?H[L++]=hr[rt]||0:(H=[hr[rt]],L=1);while((rt++<Ft||H[0]!==void 0)&&ue--)}return ne[0]||ne.shift(),F.e=W,R(F,j?C+E(F)+1:C)}})();function P(b,S){var k,O,I,C,j,N,W=0,Y=0,U=b.constructor,G=U.precision;if(E(b)>16)throw Error(l+E(b));if(!b.s)return new U(f);for(S==null?(n=!1,N=G):N=S,j=new U(.03125);b.abs().gte(.1);)b=b.times(j),Y+=5;for(O=Math.log(u(2,Y))/Math.LN10*2+5|0,N+=O,k=I=C=new U(f),U.precision=N;;){if(I=R(I.times(b),N),k=k.times(++W),j=C.plus(A(I,k,N)),w(j.d).slice(0,N)===w(C.d).slice(0,N)){for(;Y--;)C=R(C.times(C),N);return U.precision=G,S==null?(n=!0,R(C,G)):C}C=j}}i(P,"exp");function E(b){for(var S=b.e*p,k=b.d[0];k>=10;k/=10)S++;return S}i(E,"getBase10Exponent");function x(b,S,k){if(S>b.LN10.sd())throw n=!0,k&&(b.precision=k),Error(a+"LN10 precision limit exceeded");return R(new b(b.LN10),S)}i(x,"getLn10");function _(b){for(var S="";b--;)S+="0";return S}i(_,"getZeroString");function D(b,S){var k,O,I,C,j,N,W,Y,U,G=1,Re=10,F=b,ne=F.d,H=F.constructor,L=H.precision;if(F.s<1)throw Error(a+(F.s?"NaN":"-Infinity"));if(F.eq(f))return new H(0);if(S==null?(n=!1,Y=L):Y=S,F.eq(10))return S==null&&(n=!0),x(H,Y);if(Y+=Re,H.precision=Y,k=w(ne),O=k.charAt(0),C=E(F),Math.abs(C)<15e14){for(;O<7&&O!=1||O==1&&k.charAt(1)>3;)F=F.times(b),k=w(F.d),O=k.charAt(0),G++;C=E(F),O>1?(F=new H("0."+k),C++):F=new H(O+"."+k.slice(1))}else return W=x(H,Y+2,L).times(C+""),F=D(new H(O+"."+k.slice(1)),Y-Re).plus(W),H.precision=L,S==null?(n=!0,R(F,L)):F;for(N=j=F=A(F.minus(f),F.plus(f),Y),U=R(F.times(F),Y),I=3;;){if(j=R(j.times(U),Y),W=N.plus(A(j,new H(I),Y)),w(W.d).slice(0,Y)===w(N.d).slice(0,Y))return N=N.times(2),C!==0&&(N=N.plus(x(H,Y+2,L).times(C+""))),N=A(N,new H(G),Y),H.precision=L,S==null?(n=!0,R(N,L)):N;N=W,I+=2}}i(D,"ln");function $(b,S){var k,O,I;for((k=S.indexOf("."))>-1&&(S=S.replace(".","")),(O=S.search(/e/i))>0?(k<0&&(k=O),k+=+S.slice(O+1),S=S.substring(0,O)):k<0&&(k=S.length),O=0;S.charCodeAt(O)===48;)++O;for(I=S.length;S.charCodeAt(I-1)===48;)--I;if(S=S.slice(O,I),S){if(I-=O,k=k-O-1,b.e=s(k/p),b.d=[],O=(k+1)%p,k<0&&(O+=p),O<I){for(O&&b.d.push(+S.slice(0,O)),I-=p;O<I;)b.d.push(+S.slice(O,O+=p));S=S.slice(O),O=p-S.length}else O-=I;for(;O--;)S+="0";if(b.d.push(+S),n&&(b.e>h||b.e<-h))throw Error(l+k)}else b.s=0,b.e=0,b.d=[0];return b}i($,"parseDecimal");function R(b,S,k){var O,I,C,j,N,W,Y,U,G=b.d;for(j=1,C=G[0];C>=10;C/=10)j++;if(O=S-j,O<0)O+=p,I=S,Y=G[U=0];else{if(U=Math.ceil((O+1)/p),C=G.length,U>=C)return b;for(Y=C=G[U],j=1;C>=10;C/=10)j++;O%=p,I=O-p+j}if(k!==void 0&&(C=u(10,j-I-1),N=Y/C%10|0,W=S<0||G[U+1]!==void 0||Y%C,W=k<4?(N||W)&&(k==0||k==(b.s<0?3:2)):N>5||N==5&&(k==4||W||k==6&&(O>0?I>0?Y/u(10,j-I):0:G[U-1])%10&1||k==(b.s<0?8:7))),S<1||!G[0])return W?(C=E(b),G.length=1,S=S-C-1,G[0]=u(10,(p-S%p)%p),b.e=s(-S/p)||0):(G.length=1,G[0]=b.e=b.s=0),b;if(O==0?(G.length=U,C=1,U--):(G.length=U+1,C=u(10,p-O),G[U]=I>0?(Y/u(10,j-I)%u(10,I)|0)*C:0),W)for(;;)if(U==0){(G[0]+=C)==d&&(G[0]=1,++b.e);break}else{if(G[U]+=C,G[U]!=d)break;G[U--]=0,C=1}for(O=G.length;G[--O]===0;)G.pop();if(n&&(b.e>h||b.e<-h))throw Error(l+E(b));return b}i(R,"round");function V(b,S){var k,O,I,C,j,N,W,Y,U,G,Re=b.constructor,F=Re.precision;if(!b.s||!S.s)return S.s?S.s=-S.s:S=new Re(b),n?R(S,F):S;if(W=b.d,G=S.d,O=S.e,Y=b.e,W=W.slice(),j=Y-O,j){for(U=j<0,U?(k=W,j=-j,N=G.length):(k=G,O=Y,N=W.length),I=Math.max(Math.ceil(F/p),N)+2,j>I&&(j=I,k.length=1),k.reverse(),I=j;I--;)k.push(0);k.reverse()}else{for(I=W.length,N=G.length,U=I<N,U&&(N=I),I=0;I<N;I++)if(W[I]!=G[I]){U=W[I]<G[I];break}j=0}for(U&&(k=W,W=G,G=k,S.s=-S.s),N=W.length,I=G.length-N;I>0;--I)W[N++]=0;for(I=G.length;I>j;){if(W[--I]<G[I]){for(C=I;C&&W[--C]===0;)W[C]=d-1;--W[C],W[I]+=d}W[I]-=G[I]}for(;W[--N]===0;)W.pop();for(;W[0]===0;W.shift())--O;return W[0]?(S.d=W,S.e=O,n?R(S,F):S):new Re(0)}i(V,"subtract");function B(b,S,k){var O,I=E(b),C=w(b.d),j=C.length;return S?(k&&(O=k-j)>0?C=C.charAt(0)+"."+C.slice(1)+_(O):j>1&&(C=C.charAt(0)+"."+C.slice(1)),C=C+(I<0?"e":"e+")+I):I<0?(C="0."+_(-I-1)+C,k&&(O=k-j)>0&&(C+=_(O))):I>=j?(C+=_(I+1-j),k&&(O=k-I-1)>0&&(C=C+"."+_(O))):((O=I+1)<j&&(C=C.slice(0,O)+"."+C.slice(O)),k&&(O=k-j)>0&&(I+1===j&&(C+="."),C+=_(O))),b.s<0?"-"+C:C}i(B,"toString");function Q(b,S){if(b.length>S)return b.length=S,!0}i(Q,"truncate");function Z(b){var S,k,O;function I(C){var j=this;if(!(j instanceof I))return new I(C);if(j.constructor=I,C instanceof I){j.s=C.s,j.e=C.e,j.d=(C=C.d)?C.slice():C;return}if(typeof C=="number"){if(C*0!==0)throw Error(o+C);if(C>0)j.s=1;else if(C<0)C=-C,j.s=-1;else{j.s=0,j.e=0,j.d=[0];return}if(C===~~C&&C<1e7){j.e=0,j.d=[C];return}return $(j,C.toString())}else if(typeof C!="string")throw Error(o+C);if(C.charCodeAt(0)===45?(C=C.slice(1),j.s=-1):j.s=1,c.test(C))$(j,C);else throw Error(o+C)}if(i(I,"Decimal"),I.prototype=v,I.ROUND_UP=0,I.ROUND_DOWN=1,I.ROUND_CEIL=2,I.ROUND_FLOOR=3,I.ROUND_HALF_UP=4,I.ROUND_HALF_DOWN=5,I.ROUND_HALF_EVEN=6,I.ROUND_HALF_CEIL=7,I.ROUND_HALF_FLOOR=8,I.clone=Z,I.config=I.set=J,b===void 0&&(b={}),b)for(O=["precision","rounding","toExpNeg","toExpPos","LN10"],S=0;S<O.length;)b.hasOwnProperty(k=O[S++])||(b[k]=this[k]);return I.config(b),I}i(Z,"clone");function J(b){if(!b||typeof b!="object")throw Error(a+"Object expected");var S,k,O,I=["precision",1,t,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(S=0;S<I.length;S+=3)if((O=b[k=I[S]])!==void 0)if(s(O)===O&&O>=I[S+1]&&O<=I[S+2])this[k]=O;else throw Error(o+k+": "+O);if((O=b[k="LN10"])!==void 0)if(O==Math.LN10)this[k]=new this(O);else throw Error(o+k+": "+O);return this}i(J,"config"),r=Z(r),r.default=r.Decimal=r,f=new r(1),typeof define=="function"&&define.amd?define(function(){return r}):typeof Cs<"u"&&Cs.exports?Cs.exports=r:(e||(e=typeof self<"u"&&self&&self.self==self?self:Function("return this")()),e.Decimal=r)})(Tb)});var aw=X((bee,um)=>{"use strict";var Fj=Object.prototype.hasOwnProperty,St="~";function Io(){}i(Io,"Events");Object.create&&(Io.prototype=Object.create(null),new Io().__proto__||(St=!1));function Wj(e,t,r){this.fn=e,this.context=t,this.once=r||!1}i(Wj,"EE");function iw(e,t,r,n,a){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new Wj(r,n||e,a),l=St?St+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}i(iw,"addListener");function Hu(e,t){--e._eventsCount===0?e._events=new Io:delete e._events[t]}i(Hu,"clearEvent");function mt(){this._events=new Io,this._eventsCount=0}i(mt,"EventEmitter");mt.prototype.eventNames=i(function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)Fj.call(r,n)&&t.push(St?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t},"eventNames");mt.prototype.listeners=i(function(t){var r=St?St+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,o=n.length,l=new Array(o);a<o;a++)l[a]=n[a].fn;return l},"listeners");mt.prototype.listenerCount=i(function(t){var r=St?St+t:t,n=this._events[r];return n?n.fn?1:n.length:0},"listenerCount");mt.prototype.emit=i(function(t,r,n,a,o,l){var s=St?St+t:t;if(!this._events[s])return!1;var u=this._events[s],c=arguments.length,f,d;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,n),!0;case 4:return u.fn.call(u.context,r,n,a),!0;case 5:return u.fn.call(u.context,r,n,a,o),!0;case 6:return u.fn.call(u.context,r,n,a,o,l),!0}for(d=1,f=new Array(c-1);d<c;d++)f[d-1]=arguments[d];u.fn.apply(u.context,f)}else{var p=u.length,m;for(d=0;d<p;d++)switch(u[d].once&&this.removeListener(t,u[d].fn,void 0,!0),c){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,r);break;case 3:u[d].fn.call(u[d].context,r,n);break;case 4:u[d].fn.call(u[d].context,r,n,a);break;default:if(!f)for(m=1,f=new Array(c-1);m<c;m++)f[m-1]=arguments[m];u[d].fn.apply(u[d].context,f)}}return!0},"emit");mt.prototype.on=i(function(t,r,n){return iw(this,t,r,n,!1)},"on");mt.prototype.once=i(function(t,r,n){return iw(this,t,r,n,!0)},"once");mt.prototype.removeListener=i(function(t,r,n,a){var o=St?St+t:t;if(!this._events[o])return this;if(!r)return Hu(this,o),this;var l=this._events[o];if(l.fn)l.fn===r&&(!a||l.once)&&(!n||l.context===n)&&Hu(this,o);else{for(var s=0,u=[],c=l.length;s<c;s++)(l[s].fn!==r||a&&!l[s].once||n&&l[s].context!==n)&&u.push(l[s]);u.length?this._events[o]=u.length===1?u[0]:u:Hu(this,o)}return this},"removeListener");mt.prototype.removeAllListeners=i(function(t){var r;return t?(r=St?St+t:t,this._events[r]&&Hu(this,r)):(this._events=new Io,this._eventsCount=0),this},"removeAllListeners");mt.prototype.off=mt.prototype.removeListener;mt.prototype.addListener=mt.prototype.on;mt.prefixed=St;mt.EventEmitter=mt;typeof um<"u"&&(um.exports=mt)});var Bw=X(Lw=>{function IL(){}i(IL,"noop");Lw.noop=IL});var Fw=X(zw=>{function CL(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}i(CL,"isPlainObject");zw.isPlainObject=CL});var Uw=X(Kw=>{var Ww=hf(),Vw=ja(),Ce=fl(),qw=vf(),$w=Fw(),kL=Da();sl();function _L(e,t,r){return _o(e,t,void 0,void 0,void 0,void 0,r)}i(_L,"isEqualWith");function _o(e,t,r,n,a,o,l){let s=l(e,t,r,n,a,o);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return To(e,t,o,l)}return To(e,t,o,l)}i(_o,"isEqualWithImpl");function To(e,t,r,n){if(Object.is(e,t))return!0;let a=Vw.getTag(e),o=Vw.getTag(t);if(a==="[object Arguments]"&&(a=Ce.objectTag),o==="[object Arguments]"&&(o=Ce.objectTag),a!==o)return!1;switch(a){case Ce.stringTag:return e.toString()===t.toString();case Ce.numberTag:{let u=e.valueOf(),c=t.valueOf();return kL.isEqualsSameValueZero(u,c)}case Ce.booleanTag:case Ce.dateTag:case Ce.symbolTag:return Object.is(e.valueOf(),t.valueOf());case Ce.regexpTag:return e.source===t.source&&e.flags===t.flags;case Ce.functionTag:return e===t}r=r??new Map;let l=r.get(e),s=r.get(t);if(l!=null&&s!=null)return l===t;r.set(e,t),r.set(t,e);try{switch(a){case Ce.mapTag:if(e.size!==t.size)return!1;for(let[u,c]of e.entries())if(!t.has(u)||!_o(c,t.get(u),u,e,t,r,n))return!1;return!0;case Ce.setTag:{if(e.size!==t.size)return!1;let u=Array.from(e.values()),c=Array.from(t.values());for(let f=0;f<u.length;f++){let d=u[f],p=c.findIndex(m=>_o(d,m,void 0,e,t,r,n));if(p===-1)return!1;c.splice(p,1)}return!0}case Ce.arrayTag:case Ce.uint8ArrayTag:case Ce.uint8ClampedArrayTag:case Ce.uint16ArrayTag:case Ce.uint32ArrayTag:case Ce.bigUint64ArrayTag:case Ce.int8ArrayTag:case Ce.int16ArrayTag:case Ce.int32ArrayTag:case Ce.bigInt64ArrayTag:case Ce.float32ArrayTag:case Ce.float64ArrayTag:if(qw.isBuffer(e)!==qw.isBuffer(t)||e.length!==t.length)return!1;for(let u=0;u<e.length;u++)if(!_o(e[u],t[u],u,e,t,r,n))return!1;return!0;case Ce.arrayBufferTag:return e.byteLength!==t.byteLength?!1:To(new Uint8Array(e),new Uint8Array(t),r,n);case Ce.dataViewTag:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:To(new Uint8Array(e),new Uint8Array(t),r,n);case Ce.errorTag:return e.name===t.name&&e.message===t.message;case Ce.objectTag:{if(!(To(e.constructor,t.constructor,r,n)||$w.isPlainObject(e)&&$w.isPlainObject(t)))return!1;let u=[...Object.keys(e),...Ww.getSymbols(e)],c=[...Object.keys(t),...Ww.getSymbols(t)];if(u.length!==c.length)return!1;for(let f=0;f<u.length;f++){let d=u[f],p=e[d];if(!Object.hasOwn(t,d))return!1;let m=t[d];if(!_o(p,m,d,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}i(To,"areObjectsEqual");Kw.isEqualWith=_L});var Yw=X(Hw=>{var TL=Bw(),DL=Uw();function RL(e,t){return DL.isEqualWith(e,t,TL.noop)}i(RL,"isEqual");Hw.isEqual=RL});var Xw=X((Vte,Gw)=>{Gw.exports=Yw().isEqual});var KS=X(Pe=>{"use strict";var bm=Symbol.for("react.element"),Am=Symbol.for("react.portal"),uc=Symbol.for("react.fragment"),cc=Symbol.for("react.strict_mode"),fc=Symbol.for("react.profiler"),dc=Symbol.for("react.provider"),pc=Symbol.for("react.context"),bB=Symbol.for("react.server_context"),mc=Symbol.for("react.forward_ref"),hc=Symbol.for("react.suspense"),vc=Symbol.for("react.suspense_list"),yc=Symbol.for("react.memo"),gc=Symbol.for("react.lazy"),AB=Symbol.for("react.offscreen"),$S;$S=Symbol.for("react.module.reference");function Jt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case bm:switch(e=e.type,e){case uc:case fc:case cc:case hc:case vc:return e;default:switch(e=e&&e.$$typeof,e){case bB:case pc:case mc:case gc:case yc:case dc:return e;default:return t}}case Am:return t}}}i(Jt,"v");Pe.ContextConsumer=pc;Pe.ContextProvider=dc;Pe.Element=bm;Pe.ForwardRef=mc;Pe.Fragment=uc;Pe.Lazy=gc;Pe.Memo=yc;Pe.Portal=Am;Pe.Profiler=fc;Pe.StrictMode=cc;Pe.Suspense=hc;Pe.SuspenseList=vc;Pe.isAsyncMode=function(){return!1};Pe.isConcurrentMode=function(){return!1};Pe.isContextConsumer=function(e){return Jt(e)===pc};Pe.isContextProvider=function(e){return Jt(e)===dc};Pe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===bm};Pe.isForwardRef=function(e){return Jt(e)===mc};Pe.isFragment=function(e){return Jt(e)===uc};Pe.isLazy=function(e){return Jt(e)===gc};Pe.isMemo=function(e){return Jt(e)===yc};Pe.isPortal=function(e){return Jt(e)===Am};Pe.isProfiler=function(e){return Jt(e)===fc};Pe.isStrictMode=function(e){return Jt(e)===cc};Pe.isSuspense=function(e){return Jt(e)===hc};Pe.isSuspenseList=function(e){return Jt(e)===vc};Pe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===uc||e===fc||e===cc||e===hc||e===vc||e===AB||typeof e=="object"&&e!==null&&(e.$$typeof===gc||e.$$typeof===yc||e.$$typeof===dc||e.$$typeof===pc||e.$$typeof===mc||e.$$typeof===$S||e.getModuleId!==void 0)};Pe.typeOf=Jt});var HS=X((Vne,US)=>{"use strict";US.exports=KS()});var KP=X($P=>{"use strict";var $o=z();function Cz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}i(Cz,"is");var kz=typeof Object.is=="function"?Object.is:Cz,_z=$o.useSyncExternalStore,Tz=$o.useRef,Dz=$o.useEffect,Rz=$o.useMemo,Mz=$o.useDebugValue;$P.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var o=Tz(null);if(o.current===null){var l={hasValue:!1,value:null};o.current=l}else l=o.current;o=Rz(function(){function u(m){if(!c){if(c=!0,f=m,m=n(m),a!==void 0&&l.hasValue){var h=l.value;if(a(h,m))return d=h}return d=m}if(h=d,kz(f,m))return h;var v=n(m);return a!==void 0&&a(h,v)?(f=m,h):(f=m,d=v)}i(u,"memoizedSelector");var c=!1,f,d,p=r===void 0?null:r;return[function(){return u(t())},p===null?void 0:function(){return u(p())}]},[t,r,n,a]);var s=_z(e,o[0],o[1]);return Dz(function(){l.hasValue=!0,l.value=s},[s]),Mz(s),s}});var HP=X((Yae,UP)=>{"use strict";UP.exports=KP()});var gn=M(z()),Ge=M(z()),Gh=M(Th());var qh=M(_a());var hI=4;function Wt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hI,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}i(Wt,"round");function Ze(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((a,o,l)=>{var s=r[l-1];return typeof s=="string"?a+s+o:s!==void 0?a+Wt(s)+o:a+o},"")}i(Ze,"roundTemplateLiteral");var je=i(e=>e===0?0:e>0?1:-1,"mathSign"),nt=i(e=>typeof e=="number"&&e!=+e,"isNan"),Or=i(e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,"isPercent"),q=i(e=>(typeof e=="number"||e instanceof Number)&&!nt(e),"isNumber"),it=i(e=>q(e)||typeof e=="string","isNumOrStr"),vI=0,Er=i(e=>{var t=++vI;return"".concat(e||"").concat(t)},"uniqueId"),lt=i(function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!q(t)&&typeof t!="string")return n;var o;if(Or(t)){if(r==null)return n;var l=t.indexOf("%");o=r*parseFloat(t.slice(0,l))/100}else o=+t;return nt(o)&&(o=n),a&&r!=null&&o>r&&(o=r),o},"getPercentValue"),nf=i(e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1},"hasDuplicate");function we(e,t,r){return q(e)&&q(t)?Wt(e+r*(t-e)):t}i(we,"interpolate");function ol(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):(0,qh.default)(n,t))===r)}i(ol,"findEntryInArray");var ce=i(e=>e===null||typeof e>"u","isNullish"),hi=i(e=>ce(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),"upperFirst");function Qe(e){return e!=null}i(Qe,"isNotNil");function xt(){}i(xt,"noop");var yI=!0,vi=i(function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),o=2;o<n;o++)a[o-2]=arguments[o];if(yI&&typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>a[l++]))}},"warn");var or={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},af=i((e,t,r)=>{var n=r.width,a=n===void 0?or.width:n,o=r.height,l=o===void 0?or.height:o,s=r.aspect,u=r.maxHeight,c=Or(a)?e:Number(a),f=Or(l)?t:Number(l);return s&&s>0&&(c?f=c/s:f&&(c=f*s),u&&f!=null&&f>u&&(f=u)),{calculatedWidth:c,calculatedHeight:f}},"calculateChartDimensions"),gI={width:0,height:0,overflow:"visible"},xI={width:0,overflowX:"visible"},bI={height:0,overflowY:"visible"},AI={},$h=i(e=>{var t=e.width,r=e.height,n=Or(t),a=Or(r);return n&&a?gI:n?xI:a?bI:AI},"getInnerDivStyle");function Kh(e){var t=e.width,r=e.height,n=e.aspect,a=t,o=r;return a===void 0&&o===void 0?(a=or.width,o=or.height):a===void 0?a=n&&n>0?void 0:or.width:o===void 0&&(o=n&&n>0?void 0:or.height),{width:a,height:o}}i(Kh,"getDefaultWidthAndHeight");function ee(e){return Number.isFinite(e)}i(ee,"isWellBehavedNumber");function Ot(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}i(Ot,"isPositiveNumber");var wI=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function ll(){return ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ll.apply(null,arguments)}i(ll,"_extends");function Uh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}i(Uh,"ownKeys");function Hh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Uh(Object(r),!0).forEach(function(n){SI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(Hh,"_objectSpread");function SI(e,t,r){return(t=PI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(SI,"_defineProperty");function PI(e){var t=OI(e,"string");return typeof t=="symbol"?t:t+""}i(PI,"_toPropertyKey");function OI(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(OI,"_toPrimitive");function EI(e,t){return _I(e)||kI(e,t)||CI(e,t)||II()}i(EI,"_slicedToArray");function II(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{c as wh,e as pi,f as mi,j as Sh}from"./chunk-5JDWLCSH.js";import{a as bh,b as Ah}from"./chunk-EVTM6Q43.js";import{b as JE}from"./chunk-Y6CXU7T4.js";import{a as xh}from"./chunk-4L4WTGN5.js";import{d as rl}from"./chunk-GETL6R4M.js";import{a as i,b as X,c as XE,d as M,e as z,f as ZE,g as QE,h as re,i as Xr}from"./chunk-YKXDMIHQ.js";var Oh=X(Ph=>{function eI(e,t,{signal:r,edges:n}={}){let a,o=null,l=n!=null&&n.includes("leading"),s=n==null||n.includes("trailing"),u=i(()=>{o!==null&&(e.apply(a,o),a=void 0,o=null)},"invoke"),c=i(()=>{s&&u(),m()},"onTimerEnd"),f=null,d=i(()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,c()},t)},"schedule"),p=i(()=>{f!==null&&(clearTimeout(f),f=null)},"cancelTimer"),m=i(()=>{p(),a=void 0,o=null},"cancel"),h=i(()=>{u()},"flush"),v=i(function(...g){if(r?.aborted)return;a=this,o=g;let y=f==null;d(),l&&y&&u()},"debounced");return v.schedule=d,v.cancel=m,v.flush=h,r?.addEventListener("abort",m,{once:!0}),v}i(eI,"debounce");Ph.debounce=eI});var Ih=X(Eh=>{var tI=Oh();function rI(e,t=0,r={}){typeof r!="object"&&(r={});let{leading:n=!1,trailing:a=!0,maxWait:o}=r,l=Array(2);n&&(l[0]="leading"),a&&(l[1]="trailing");let s,u=null,c=tI.debounce(function(...p){s=e.apply(this,p),u=null},t,{edges:l}),f=i(function(...p){return o!=null&&(u===null&&(u=Date.now()),Date.now()-u>=o)?(s=e.apply(this,p),u=Date.now(),c.cancel(),c.schedule(),s):(c.apply(this,p),s)},"debounced"),d=i(()=>(c.flush(),s),"flush");return f.cancel=c.cancel,f.flush=d,f}i(rI,"debounce");Eh.debounce=rI});var kh=X(Ch=>{var nI=Ih();function iI(e,t=0,r={}){let{leading:n=!0,trailing:a=!0}=r;return nI.debounce(e,t,{leading:n,maxWait:t,trailing:a})}i(iI,"throttle");Ch.throttle=iI});var Th=X((m$,_h)=>{_h.exports=kh().throttle});var Rh=X(Dh=>{function aI(e){return e==="__proto__"}i(aI,"isUnsafeProperty");Dh.isUnsafeProperty=aI});var tf=X(Mh=>{function oI(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}i(oI,"isDeepKey");Mh.isDeepKey=oI});var nl=X(Nh=>{function lI(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}i(lI,"toKey");Nh.toKey=lI});var Bh=X(Lh=>{function jh(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(jh).join(",");let t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}i(jh,"toString");Lh.toString=jh});var il=X(zh=>{var sI=nl(),uI=Bh();function cI(e){if(Array.isArray(e))return e.map(sI.toKey);if(typeof e=="symbol")return[e];e=uI.toString(e);let t=[],r=e.length;if(r===0)return t;let n=0,a="",o="",l=!1;for(e.charCodeAt(0)===46&&(t.push(""),n++);n<r;){let s=e[n];o?s==="\\"&&n+1<r?(n++,a+=e[n]):s===o?o="":a+=s:l?s==='"'||s==="'"?o=s:s==="]"?(l=!1,t.push(a),a=""):a+=s:s==="["?(l=!0,a&&(t.push(a),a="")):s==="."?a&&(t.push(a),a=""):a+=s,n++}return a&&t.push(a),t}i(cI,"toPath");zh.toPath=cI});var al=X(Wh=>{var rf=Rh(),fI=tf(),dI=nl(),pI=il();function Fh(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(rf.isUnsafeProperty(t))return r;let n=e[t];return n===void 0?fI.isDeepKey(t)?Fh(e,pI.toPath(t),r):r:n}case"number":case"symbol":{typeof t=="number"&&(t=dI.toKey(t));let n=e[t];return n===void 0?r:n}default:{if(Array.isArray(t))return mI(e,t,r);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),rf.isUnsafeProperty(t))return r;let n=e[t];return n===void 0?r:n}}}i(Fh,"get");function mI(e,t,r){if(t.length===0)return r;let n=e;for(let a=0;a<t.length;a++){if(n==null||rf.isUnsafeProperty(t[a]))return r;n=n[t[a]]}return n===void 0?r:n}i(mI,"getWithPath");Wh.get=Fh});var _a=X((I$,Vh)=>{Vh.exports=al().get});var Jh=X(Qh=>{function NI(e,t=1){let r=[],n=Math.floor(t),a=i((o,l)=>{for(let s=0;s<o.length;s++){let u=o[s];Array.isArray(u)&&l<n?a(u,l+1):r.push(u)}},"recursive");return a(e,0),r}i(NI,"flatten");Qh.flatten=NI});var Da=X(ev=>{function jI(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}i(jI,"isEqualsSameValueZero");ev.isEqualsSameValueZero=jI});var sl=X(()=>{Da()});var rv=X(tv=>{function LI(e){return Number.isSafeInteger(e)&&e>=0}i(LI,"isLength");tv.isLength=LI});var lf=X(nv=>{var BI=rv();function zI(e){return e!=null&&typeof e!="function"&&BI.isLength(e.length)}i(zI,"isArrayLike");nv.isArrayLike=zI});var sf=X(iv=>{function FI(e){return e!==null&&(typeof e=="object"||typeof e=="function")}i(FI,"isObject");iv.isObject=FI});var uf=X(av=>{var WI=/^(?:0|[1-9]\d*)$/;function VI(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return WI.test(e)}}i(VI,"isIndex");av.isIndex=VI});var cf=X(ov=>{var qI=Da();sl();var $I=lf(),KI=sf(),UI=uf();function HI(e,t,r){return KI.isObject(r)&&(typeof t=="number"&&$I.isArrayLike(r)&&UI.isIndex(t)&&t<r.length||typeof t=="string"&&t in r)?qI.isEqualsSameValueZero(r[t],e):!1}i(HI,"isIterateeCall");ov.isIterateeCall=HI});var uv=X(sv=>{function lv(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}i(lv,"getPriority");var YI=i((e,t,r)=>{if(e!==t){let n=lv(e),a=lv(t);if(n===a&&n===0){if(e<t)return r==="desc"?1:-1;if(e>t)return r==="desc"?-1:1}return r==="desc"?a-n:n-a}return 0},"compareValues");sv.compareValues=YI});var ff=X(cv=>{function GI(e){return typeof e=="symbol"||e instanceof Symbol}i(GI,"isSymbol");cv.isSymbol=GI});var dv=X(fv=>{var XI=ff(),ZI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,QI=/^\w*$/;function JI(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||XI.isSymbol(e)?!0:typeof e=="string"&&(QI.test(e)||!ZI.test(e))||t!=null&&Object.hasOwn(t,e)}i(JI,"isKey");fv.isKey=JI});var mv=X(pv=>{var e1=il(),t1=uv(),r1=dv();function n1(e,t,r,n){if(e==null)return[];r=n?void 0:r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(s=>String(s));let a=i((s,u)=>{let c=s;for(let f=0;f<u.length&&c!=null;++f)c=c[u[f]];return c},"getValueByNestedPath"),o=i((s,u)=>u==null||s==null?u:typeof s=="object"&&"key"in s?Object.hasOwn(u,s.key)?u[s.key]:a(u,s.path):typeof s=="function"?s(u):Array.isArray(s)?a(u,s):typeof u=="object"?u[s]:u,"getValueByCriterion"),l=t.map(s=>(Array.isArray(s)&&s.length===1&&(s=s[0]),s==null||typeof s=="function"||Array.isArray(s)||r1.isKey(s)?s:{key:s,path:e1.toPath(s)}));return e.map(s=>({original:s,criteria:l.map(u=>o(u,s))})).slice().sort((s,u)=>{for(let c=0;c<l.length;c++){let f=t1.compareValues(s.criteria[c],u.criteria[c],r[c]);if(f!==0)return f}return 0}).map(s=>s.original)}i(n1,"orderBy");pv.orderBy=n1});var yv=X(vv=>{var i1=Jh(),hv=cf(),a1=mv();function o1(e,...t){let r=t.length;return r>1&&hv.isIterateeCall(e,t[0],t[1])?t=[]:r>2&&hv.isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),a1.orderBy(e,i1.flatten(t),["asc"])}i(o1,"sortBy");vv.sortBy=o1});var Ra=X((xK,gv)=>{gv.exports=yv().sortBy});var _v=X(kv=>{function j1(e,t){let r=new Map;for(let n=0;n<e.length;n++){let a=e[n],o=t(a,n,e);r.has(o)||r.set(o,a)}return Array.from(r.values())}i(j1,"uniqBy");kv.uniqBy=j1});var Dv=X(Tv=>{function L1(e,t){return function(...r){return e.apply(this,r.slice(0,t))}}i(L1,"ary");Tv.ary=L1});var pf=X(Rv=>{function B1(e){return e}i(B1,"identity");Rv.identity=B1});var Nv=X(Mv=>{var z1=al();function F1(e){return function(t){return z1.get(t,e)}}i(F1,"property");Mv.property=F1});var mf=X(jv=>{function W1(e){return e==null||typeof e!="object"&&typeof e!="function"}i(W1,"isPrimitive");jv.isPrimitive=W1});var Bv=X(Lv=>{function V1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}i(V1,"isTypedArray");Lv.isTypedArray=V1});var hf=X(zv=>{function q1(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}i(q1,"getSymbols");zv.getSymbols=q1});var ja=X(Fv=>{function $1(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}i($1,"getTag");Fv.getTag=$1});var fl=X(Oe=>{var K1="[object RegExp]",U1="[object String]",H1="[object Number]",Y1="[object Boolean]",G1="[object Arguments]",X1="[object Symbol]",Z1="[object Date]",Q1="[object Map]",J1="[object Set]",eC="[object Array]",tC="[object Function]",rC="[object ArrayBuffer]",nC="[object Object]",iC="[object Error]",aC="[object DataView]",oC="[object Uint8Array]",lC="[object Uint8ClampedArray]",sC="[object Uint16Array]",uC="[object Uint32Array]",cC="[object BigUint64Array]",fC="[object Int8Array]",dC="[object Int16Array]",pC="[object Int32Array]",mC="[object BigInt64Array]",hC="[object Float32Array]",vC="[object Float64Array]";Oe.argumentsTag=G1;Oe.arrayBufferTag=rC;Oe.arrayTag=eC;Oe.bigInt64ArrayTag=mC;Oe.bigUint64ArrayTag=cC;Oe.booleanTag=Y1;Oe.dataViewTag=aC;Oe.dateTag=Z1;Oe.errorTag=iC;Oe.float32ArrayTag=hC;Oe.float64ArrayTag=vC;Oe.functionTag=tC;Oe.int16ArrayTag=dC;Oe.int32ArrayTag=pC;Oe.int8ArrayTag=fC;Oe.mapTag=Q1;Oe.numberTag=H1;Oe.objectTag=nC;Oe.regexpTag=K1;Oe.setTag=J1;Oe.stringTag=U1;Oe.symbolTag=X1;Oe.uint16ArrayTag=sC;Oe.uint32ArrayTag=uC;Oe.uint8ArrayTag=oC;Oe.uint8ClampedArrayTag=lC});var Vv=X(Wv=>{var yC=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();Wv.globalThis_=yC});var vf=X($v=>{var qv=Vv();function gC(e){return typeof qv.globalThis_.Buffer<"u"&&qv.globalThis_.Buffer.isBuffer(e)}i(gC,"isBuffer");$v.isBuffer=gC});var yf=X(dl=>{var xC=mf(),bC=Bv(),AC=hf(),wC=ja(),Le=fl(),SC=vf();function PC(e,t){return xn(e,void 0,e,new Map,t)}i(PC,"cloneDeepWith");function xn(e,t,r,n=new Map,a=void 0){let o=a?.(e,t,r,n);if(o!==void 0)return o;if(xC.isPrimitive(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){let l=new Array(e.length);n.set(e,l);for(let s=0;s<e.length;s++)l[s]=xn(e[s],s,r,n,a);return Object.hasOwn(e,"index")&&(l.index=e.index),Object.hasOwn(e,"input")&&(l.input=e.input),l}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let l=new RegExp(e.source,e.flags);return l.lastIndex=e.lastIndex,l}if(e instanceof Map){let l=new Map;n.set(e,l);for(let[s,u]of e)l.set(s,xn(u,s,r,n,a));return l}if(e instanceof Set){let l=new Set;n.set(e,l);for(let s of e)l.add(xn(s,void 0,r,n,a));return l}if(SC.isBuffer(e))return e.subarray();if(bC.isTypedArray(e)){let l=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,l);for(let s=0;s<e.length;s++)l[s]=xn(e[s],s,r,n,a);return l}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let l=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,l),Ir(l,e,r,n,a),l}if(typeof File<"u"&&e instanceof File){let l=new File([e],e.name,{type:e.type});return n.set(e,l),Ir(l,e,r,n,a),l}if(typeof Blob<"u"&&e instanceof Blob){let l=new Blob([e],{type:e.type});return n.set(e,l),Ir(l,e,r,n,a),l}if(e instanceof Error){let l=structuredClone(e);return n.set(e,l),l.message=e.message,l.name=e.name,l.stack=e.stack,l.cause=e.cause,l.constructor=e.constructor,Ir(l,e,r,n,a),l}if(e instanceof Boolean){let l=new Boolean(e.valueOf());return n.set(e,l),Ir(l,e,r,n,a),l}if(e instanceof Number){let l=new Number(e.valueOf());return n.set(e,l),Ir(l,e,r,n,a),l}if(e instanceof String){let l=new String(e.valueOf());return n.set(e,l),Ir(l,e,r,n,a),l}if(typeof e=="object"&&OC(e)){let l=Object.create(Object.getPrototypeOf(e));return n.set(e,l),Ir(l,e,r,n,a),l}return e}i(xn,"cloneDeepWithImpl");function Ir(e,t,r=e,n,a){let o=[...Object.keys(t),...AC.getSymbols(t)];for(let l=0;l<o.length;l++){let s=o[l],u=Object.getOwnPropertyDescriptor(e,s);(u==null||u.writable)&&(e[s]=xn(t[s],s,r,n,a))}}i(Ir,"copyProperties");function OC(e){switch(wC.getTag(e)){case Le.argumentsTag:case Le.arrayTag:case Le.arrayBufferTag:case Le.dataViewTag:case Le.booleanTag:case Le.dateTag:case Le.float32ArrayTag:case Le.float64ArrayTag:case Le.int8ArrayTag:case Le.int16ArrayTag:case Le.int32ArrayTag:case Le.mapTag:case Le.numberTag:case Le.objectTag:case Le.regexpTag:case Le.setTag:case Le.stringTag:case Le.symbolTag:case Le.uint8ArrayTag:case Le.uint8ClampedArrayTag:case Le.uint16ArrayTag:case Le.uint32ArrayTag:return!0;default:return!1}}i(OC,"isCloneableObject");dl.cloneDeepWith=PC;dl.cloneDeepWithImpl=xn;dl.copyProperties=Ir});var Uv=X(Kv=>{var EC=yf();function IC(e){return EC.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}i(IC,"cloneDeep");Kv.cloneDeep=IC});var Qv=X(Zv=>{var Hv=mf(),Yv=Da();sl();var CC=sf();function Gv(e,t,r){return typeof r!="function"?Gv(e,t,()=>{}):gf(e,t,i(function n(a,o,l,s,u,c){let f=r(a,o,l,s,u,c);return f!==void 0?!!f:gf(a,o,n,c)},"doesMatch"),new Map)}i(Gv,"isMatchWith");function gf(e,t,r,n){if(t===e)return!0;switch(typeof t){case"object":return kC(e,t,r,n);case"function":return Object.keys(t).length>0?gf(e,{...t},r,n):Yv.isEqualsSameValueZero(e,t);default:return CC.isObject(e)?typeof t=="string"?t==="":!0:Yv.isEqualsSameValueZero(e,t)}}i(gf,"isMatchWithInternal");function kC(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return Xv(e,t,r,n);if(t instanceof Map)return _C(e,t,r,n);if(t instanceof Set)return TC(e,t,r,n);let a=Object.keys(t);if(e==null||Hv.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(n?.has(t))return n.get(t)===e;n?.set(t,e);try{for(let o=0;o<a.length;o++){let l=a[o];if(!Hv.isPrimitive(e)&&!(l in e)||t[l]===void 0&&e[l]!==void 0||t[l]===null&&e[l]!==null||!r(e[l],t[l],l,e,t,n))return!1}return!0}finally{n?.delete(t)}}i(kC,"isObjectMatch");function _C(e,t,r,n){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[a,o]of t.entries())if(r(e.get(a),o,a,e,t,n)===!1)return!1;return!0}i(_C,"isMapMatch");function Xv(e,t,r,n){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let a=new Set;for(let o=0;o<t.length;o++){let l=t[o],s=!1;for(let u=0;u<e.length;u++){if(a.has(u))continue;let c=e[u],f=!1;if(r(c,l,o,e,t,n)&&(f=!0),f){a.add(u),s=!0;break}}if(!s)return!1}return!0}i(Xv,"isArrayMatch");function TC(e,t,r,n){return t.size===0?!0:e instanceof Set?Xv([...e],[...t],r,n):!1}i(TC,"isSetMatch");Zv.isMatchWith=Gv});var xf=X(Jv=>{var DC=Qv();function RC(e,t){return DC.isMatchWith(e,t,()=>{})}i(RC,"isMatch");Jv.isMatch=RC});var ty=X(ey=>{var MC=Uv(),NC=xf();function jC(e){return e=MC.cloneDeep(e),t=>NC.isMatch(t,e)}i(jC,"matches");ey.matches=jC});var ny=X(ry=>{var LC=ja(),pl=fl(),ml=yf();function BC(e,t){return ml.cloneDeepWith(e,(r,n,a,o)=>{let l=t?.(r,n,a,o);if(l!==void 0)return l;if(typeof e=="object"){if(LC.getTag(e)==="[object Object]"&&typeof e.constructor!="function"){let s={};return o.set(e,s),ml.copyProperties(s,e,a,o),s}switch(Object.prototype.toString.call(e)){case pl.numberTag:case pl.stringTag:case pl.booleanTag:{let s=new e.constructor(e?.valueOf());return ml.copyProperties(s,e),s}case pl.argumentsTag:{let s={};return ml.copyProperties(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}i(BC,"cloneDeepWith");ry.cloneDeepWith=BC});var ay=X(iy=>{var zC=ny();function FC(e){return zC.cloneDeepWith(e)}i(FC,"cloneDeep");iy.cloneDeep=FC});var ly=X(oy=>{var WC=ja();function VC(e){return e!==null&&typeof e=="object"&&WC.getTag(e)==="[object Arguments]"}i(VC,"isArguments");oy.isArguments=VC});var uy=X(sy=>{var qC=tf(),$C=il(),KC=uf(),UC=ly();function HC(e,t){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&qC.isDeepKey(t)&&e?.[t]==null?r=$C.toPath(t):r=[t],r.length===0)return!1;let n=e;for(let a=0;a<r.length;a++){let o=r[a];if((n==null||!Object.hasOwn(n,o))&&!((Array.isArray(n)||UC.isArguments(n))&&KC.isIndex(o)&&o<n.length))return!1;n=n[o]}return!0}i(HC,"has");sy.has=HC});var fy=X(cy=>{var YC=nl(),GC=al(),XC=xf(),ZC=ay(),QC=uy();function JC(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=YC.toKey(e);break}return t=ZC.cloneDeep(t),function(r){let n=GC.get(r,e);return n===void 0?QC.has(r,e):t===void 0?n===void 0:XC.isMatch(n,t)}}i(JC,"matchesProperty");cy.matchesProperty=JC});var py=X(dy=>{var ek=pf(),tk=Nv(),rk=ty(),nk=fy();function ik(e){if(e==null)return ek.identity;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?nk.matchesProperty(e[0],e[1]):rk.matches(e);case"string":case"symbol":case"number":return tk.property(e)}}i(ik,"iteratee");dy.iteratee=ik});var hy=X(my=>{function ak(e){return typeof e=="object"&&e!==null}i(ak,"isObjectLike");my.isObjectLike=ak});var yy=X(vy=>{var ok=lf(),lk=hy();function sk(e){return lk.isObjectLike(e)&&ok.isArrayLike(e)}i(sk,"isArrayLikeObject");vy.isArrayLikeObject=sk});var xy=X(gy=>{var uk=_v(),ck=Dv(),fk=pf(),dk=py(),pk=yy();function mk(e,t=fk.identity){return pk.isArrayLikeObject(e)?uk.uniqBy(Array.from(e),ck.ary(dk.iteratee(t),1)):[]}i(mk,"uniqBy");gy.uniqBy=mk});var Ay=X((TU,by)=>{by.exports=xy().uniqBy});var xb=X(gb=>{var uD=ff();function cD(e){return uD.isSymbol(e)?NaN:Number(e)}i(cD,"toNumber");gb.toNumber=cD});var Ab=X(bb=>{var fD=xb();function dD(e){return e?(e=fD.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}i(dD,"toFinite");bb.toFinite=dD});var Sb=X(wb=>{var yd=Ab(),pD=cf();function mD(e,t,r){r&&typeof r!="number"&&pD.isIterateeCall(e,t,r)&&(t=r=void 0),e=yd.toFinite(e),t===void 0?(t=e,e=0):t=yd.toFinite(t),r=r===void 0?e<t?1:-1:yd.toFinite(r);let n=Math.max(Math.ceil((t-e)/(r||1)),0),a=new Array(n);for(let o=0;o<n;o++)a[o]=e,e+=r;return a}i(mD,"range");wb.range=mD});var Ob=X((TX,Pb)=>{Pb.exports=Sb().range});var bd=X((Tb,Cs)=>{(function(e){"use strict";var t=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},n=!0,a="[DecimalError] ",o=a+"Invalid argument: ",l=a+"Exponent out of range: ",s=Math.floor,u=Math.pow,c=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,f,d=1e7,p=7,m=9007199254740991,h=s(m/p),v={};v.absoluteValue=v.abs=function(){var b=new this.constructor(this);return b.s&&(b.s=1),b},v.comparedTo=v.cmp=function(b){var S,k,O,I,C=this;if(b=new C.constructor(b),C.s!==b.s)return C.s||-b.s;if(C.e!==b.e)return C.e>b.e^C.s<0?1:-1;for(O=C.d.length,I=b.d.length,S=0,k=O<I?O:I;S<k;++S)if(C.d[S]!==b.d[S])return C.d[S]>b.d[S]^C.s<0?1:-1;return O===I?0:O>I^C.s<0?1:-1},v.decimalPlaces=v.dp=function(){var b=this,S=b.d.length-1,k=(S-b.e)*p;if(S=b.d[S],S)for(;S%10==0;S/=10)k--;return k<0?0:k},v.dividedBy=v.div=function(b){return A(this,new this.constructor(b))},v.dividedToIntegerBy=v.idiv=function(b){var S=this,k=S.constructor;return R(A(S,new k(b),0,1),k.precision)},v.equals=v.eq=function(b){return!this.cmp(b)},v.exponent=function(){return E(this)},v.greaterThan=v.gt=function(b){return this.cmp(b)>0},v.greaterThanOrEqualTo=v.gte=function(b){return this.cmp(b)>=0},v.isInteger=v.isint=function(){return this.e>this.d.length-2},v.isNegative=v.isneg=function(){return this.s<0},v.isPositive=v.ispos=function(){return this.s>0},v.isZero=function(){return this.s===0},v.lessThan=v.lt=function(b){return this.cmp(b)<0},v.lessThanOrEqualTo=v.lte=function(b){return this.cmp(b)<1},v.logarithm=v.log=function(b){var S,k=this,O=k.constructor,I=O.precision,C=I+5;if(b===void 0)b=new O(10);else if(b=new O(b),b.s<1||b.eq(f))throw Error(a+"NaN");if(k.s<1)throw Error(a+(k.s?"NaN":"-Infinity"));return k.eq(f)?new O(0):(n=!1,S=A(D(k,C),D(b,C),C),n=!0,R(S,I))},v.minus=v.sub=function(b){var S=this;return b=new S.constructor(b),S.s==b.s?V(S,b):g(S,(b.s=-b.s,b))},v.modulo=v.mod=function(b){var S,k=this,O=k.constructor,I=O.precision;if(b=new O(b),!b.s)throw Error(a+"NaN");return k.s?(n=!1,S=A(k,b,0,1).times(b),n=!0,k.minus(S)):R(new O(k),I)},v.naturalExponential=v.exp=function(){return P(this)},v.naturalLogarithm=v.ln=function(){return D(this)},v.negated=v.neg=function(){var b=new this.constructor(this);return b.s=-b.s||0,b},v.plus=v.add=function(b){var S=this;return b=new S.constructor(b),S.s==b.s?g(S,b):V(S,(b.s=-b.s,b))},v.precision=v.sd=function(b){var S,k,O,I=this;if(b!==void 0&&b!==!!b&&b!==1&&b!==0)throw Error(o+b);if(S=E(I)+1,O=I.d.length-1,k=O*p+1,O=I.d[O],O){for(;O%10==0;O/=10)k--;for(O=I.d[0];O>=10;O/=10)k++}return b&&S>k?S:k},v.squareRoot=v.sqrt=function(){var b,S,k,O,I,C,j,N=this,W=N.constructor;if(N.s<1){if(!N.s)return new W(0);throw Error(a+"NaN")}for(b=E(N),n=!1,I=Math.sqrt(+N),I==0||I==1/0?(S=w(N.d),(S.length+b)%2==0&&(S+="0"),I=Math.sqrt(S),b=s((b+1)/2)-(b<0||b%2),I==1/0?S="5e"+b:(S=I.toExponential(),S=S.slice(0,S.indexOf("e")+1)+b),O=new W(S)):O=new W(I.toString()),k=W.precision,I=j=k+3;;)if(C=O,O=C.plus(A(N,C,j+2)).times(.5),w(C.d).slice(0,j)===(S=w(O.d)).slice(0,j)){if(S=S.slice(j-3,j+1),I==j&&S=="4999"){if(R(C,k+1,0),C.times(C).eq(N)){O=C;break}}else if(S!="9999")break;j+=4}return n=!0,R(O,k)},v.times=v.mul=function(b){var S,k,O,I,C,j,N,W,Y,U=this,G=U.constructor,Re=U.d,F=(b=new G(b)).d;if(!U.s||!b.s)return new G(0);for(b.s*=U.s,k=U.e+b.e,W=Re.length,Y=F.length,W<Y&&(C=Re,Re=F,F=C,j=W,W=Y,Y=j),C=[],j=W+Y,O=j;O--;)C.push(0);for(O=Y;--O>=0;){for(S=0,I=W+O;I>O;)N=C[I]+F[O]*Re[I-O-1]+S,C[I--]=N%d|0,S=N/d|0;C[I]=(C[I]+S)%d|0}for(;!C[--j];)C.pop();return S?++k:C.shift(),b.d=C,b.e=k,n?R(b,G.precision):b},v.toDecimalPlaces=v.todp=function(b,S){var k=this,O=k.constructor;return k=new O(k),b===void 0?k:(y(b,0,t),S===void 0?S=O.rounding:y(S,0,8),R(k,b+E(k)+1,S))},v.toExponential=function(b,S){var k,O=this,I=O.constructor;return b===void 0?k=B(O,!0):(y(b,0,t),S===void 0?S=I.rounding:y(S,0,8),O=R(new I(O),b+1,S),k=B(O,!0,b+1)),k},v.toFixed=function(b,S){var k,O,I=this,C=I.constructor;return b===void 0?B(I):(y(b,0,t),S===void 0?S=C.rounding:y(S,0,8),O=R(new C(I),b+E(I)+1,S),k=B(O.abs(),!1,b+E(O)+1),I.isneg()&&!I.isZero()?"-"+k:k)},v.toInteger=v.toint=function(){var b=this,S=b.constructor;return R(new S(b),E(b)+1,S.rounding)},v.toNumber=function(){return+this},v.toPower=v.pow=function(b){var S,k,O,I,C,j,N=this,W=N.constructor,Y=12,U=+(b=new W(b));if(!b.s)return new W(f);if(N=new W(N),!N.s){if(b.s<1)throw Error(a+"Infinity");return N}if(N.eq(f))return N;if(O=W.precision,b.eq(f))return R(N,O);if(S=b.e,k=b.d.length-1,j=S>=k,C=N.s,j){if((k=U<0?-U:U)<=m){for(I=new W(f),S=Math.ceil(O/p+4),n=!1;k%2&&(I=I.times(N),Q(I.d,S)),k=s(k/2),k!==0;)N=N.times(N),Q(N.d,S);return n=!0,b.s<0?new W(f).div(I):R(I,O)}}else if(C<0)throw Error(a+"NaN");return C=C<0&&b.d[Math.max(S,k)]&1?-1:1,N.s=1,n=!1,I=b.times(D(N,O+Y)),n=!0,I=P(I),I.s=C,I},v.toPrecision=function(b,S){var k,O,I=this,C=I.constructor;return b===void 0?(k=E(I),O=B(I,k<=C.toExpNeg||k>=C.toExpPos)):(y(b,1,t),S===void 0?S=C.rounding:y(S,0,8),I=R(new C(I),b,S),k=E(I),O=B(I,b<=k||k<=C.toExpNeg,b)),O},v.toSignificantDigits=v.tosd=function(b,S){var k=this,O=k.constructor;return b===void 0?(b=O.precision,S=O.rounding):(y(b,1,t),S===void 0?S=O.rounding:y(S,0,8)),R(new O(k),b,S)},v.toString=v.valueOf=v.val=v.toJSON=function(){var b=this,S=E(b),k=b.constructor;return B(b,S<=k.toExpNeg||S>=k.toExpPos)};function g(b,S){var k,O,I,C,j,N,W,Y,U=b.constructor,G=U.precision;if(!b.s||!S.s)return S.s||(S=new U(b)),n?R(S,G):S;if(W=b.d,Y=S.d,j=b.e,I=S.e,W=W.slice(),C=j-I,C){for(C<0?(O=W,C=-C,N=Y.length):(O=Y,I=j,N=W.length),j=Math.ceil(G/p),N=j>N?j+1:N+1,C>N&&(C=N,O.length=1),O.reverse();C--;)O.push(0);O.reverse()}for(N=W.length,C=Y.length,N-C<0&&(C=N,O=Y,Y=W,W=O),k=0;C;)k=(W[--C]=W[C]+Y[C]+k)/d|0,W[C]%=d;for(k&&(W.unshift(k),++I),N=W.length;W[--N]==0;)W.pop();return S.d=W,S.e=I,n?R(S,G):S}i(g,"add");function y(b,S,k){if(b!==~~b||b<S||b>k)throw Error(o+b)}i(y,"checkInt32");function w(b){var S,k,O,I=b.length-1,C="",j=b[0];if(I>0){for(C+=j,S=1;S<I;S++)O=b[S]+"",k=p-O.length,k&&(C+=_(k)),C+=O;j=b[S],O=j+"",k=p-O.length,k&&(C+=_(k))}else if(j===0)return"0";for(;j%10===0;)j/=10;return C+j}i(w,"digitsToString");var A=(function(){function b(O,I){var C,j=0,N=O.length;for(O=O.slice();N--;)C=O[N]*I+j,O[N]=C%d|0,j=C/d|0;return j&&O.unshift(j),O}i(b,"multiplyInteger");function S(O,I,C,j){var N,W;if(C!=j)W=C>j?1:-1;else for(N=W=0;N<C;N++)if(O[N]!=I[N]){W=O[N]>I[N]?1:-1;break}return W}i(S,"compare");function k(O,I,C){for(var j=0;C--;)O[C]-=j,j=O[C]<I[C]?1:0,O[C]=j*d+O[C]-I[C];for(;!O[0]&&O.length>1;)O.shift()}return i(k,"subtract"),function(O,I,C,j){var N,W,Y,U,G,Re,F,ne,H,L,qe,ue,te,rt,Ft,di,ar,el,tl=O.constructor,GE=O.s==I.s?1:-1,hr=O.d,Ye=I.d;if(!O.s)return new tl(O);if(!I.s)throw Error(a+"Division by zero");for(W=O.e-I.e,ar=Ye.length,Ft=hr.length,F=new tl(GE),ne=F.d=[],Y=0;Ye[Y]==(hr[Y]||0);)++Y;if(Ye[Y]>(hr[Y]||0)&&--W,C==null?ue=C=tl.precision:j?ue=C+(E(O)-E(I))+1:ue=C,ue<0)return new tl(0);if(ue=ue/p+2|0,Y=0,ar==1)for(U=0,Ye=Ye[0],ue++;(Y<Ft||U)&&ue--;Y++)te=U*d+(hr[Y]||0),ne[Y]=te/Ye|0,U=te%Ye|0;else{for(U=d/(Ye[0]+1)|0,U>1&&(Ye=b(Ye,U),hr=b(hr,U),ar=Ye.length,Ft=hr.length),rt=ar,H=hr.slice(0,ar),L=H.length;L<ar;)H[L++]=0;el=Ye.slice(),el.unshift(0),di=Ye[0],Ye[1]>=d/2&&++di;do U=0,N=S(Ye,H,ar,L),N<0?(qe=H[0],ar!=L&&(qe=qe*d+(H[1]||0)),U=qe/di|0,U>1?(U>=d&&(U=d-1),G=b(Ye,U),Re=G.length,L=H.length,N=S(G,H,Re,L),N==1&&(U--,k(G,ar<Re?el:Ye,Re))):(U==0&&(N=U=1),G=Ye.slice()),Re=G.length,Re<L&&G.unshift(0),k(H,G,L),N==-1&&(L=H.length,N=S(Ye,H,ar,L),N<1&&(U++,k(H,ar<L?el:Ye,L))),L=H.length):N===0&&(U++,H=[0]),ne[Y++]=U,N&&H[0]?H[L++]=hr[rt]||0:(H=[hr[rt]],L=1);while((rt++<Ft||H[0]!==void 0)&&ue--)}return ne[0]||ne.shift(),F.e=W,R(F,j?C+E(F)+1:C)}})();function P(b,S){var k,O,I,C,j,N,W=0,Y=0,U=b.constructor,G=U.precision;if(E(b)>16)throw Error(l+E(b));if(!b.s)return new U(f);for(S==null?(n=!1,N=G):N=S,j=new U(.03125);b.abs().gte(.1);)b=b.times(j),Y+=5;for(O=Math.log(u(2,Y))/Math.LN10*2+5|0,N+=O,k=I=C=new U(f),U.precision=N;;){if(I=R(I.times(b),N),k=k.times(++W),j=C.plus(A(I,k,N)),w(j.d).slice(0,N)===w(C.d).slice(0,N)){for(;Y--;)C=R(C.times(C),N);return U.precision=G,S==null?(n=!0,R(C,G)):C}C=j}}i(P,"exp");function E(b){for(var S=b.e*p,k=b.d[0];k>=10;k/=10)S++;return S}i(E,"getBase10Exponent");function x(b,S,k){if(S>b.LN10.sd())throw n=!0,k&&(b.precision=k),Error(a+"LN10 precision limit exceeded");return R(new b(b.LN10),S)}i(x,"getLn10");function _(b){for(var S="";b--;)S+="0";return S}i(_,"getZeroString");function D(b,S){var k,O,I,C,j,N,W,Y,U,G=1,Re=10,F=b,ne=F.d,H=F.constructor,L=H.precision;if(F.s<1)throw Error(a+(F.s?"NaN":"-Infinity"));if(F.eq(f))return new H(0);if(S==null?(n=!1,Y=L):Y=S,F.eq(10))return S==null&&(n=!0),x(H,Y);if(Y+=Re,H.precision=Y,k=w(ne),O=k.charAt(0),C=E(F),Math.abs(C)<15e14){for(;O<7&&O!=1||O==1&&k.charAt(1)>3;)F=F.times(b),k=w(F.d),O=k.charAt(0),G++;C=E(F),O>1?(F=new H("0."+k),C++):F=new H(O+"."+k.slice(1))}else return W=x(H,Y+2,L).times(C+""),F=D(new H(O+"."+k.slice(1)),Y-Re).plus(W),H.precision=L,S==null?(n=!0,R(F,L)):F;for(N=j=F=A(F.minus(f),F.plus(f),Y),U=R(F.times(F),Y),I=3;;){if(j=R(j.times(U),Y),W=N.plus(A(j,new H(I),Y)),w(W.d).slice(0,Y)===w(N.d).slice(0,Y))return N=N.times(2),C!==0&&(N=N.plus(x(H,Y+2,L).times(C+""))),N=A(N,new H(G),Y),H.precision=L,S==null?(n=!0,R(N,L)):N;N=W,I+=2}}i(D,"ln");function $(b,S){var k,O,I;for((k=S.indexOf("."))>-1&&(S=S.replace(".","")),(O=S.search(/e/i))>0?(k<0&&(k=O),k+=+S.slice(O+1),S=S.substring(0,O)):k<0&&(k=S.length),O=0;S.charCodeAt(O)===48;)++O;for(I=S.length;S.charCodeAt(I-1)===48;)--I;if(S=S.slice(O,I),S){if(I-=O,k=k-O-1,b.e=s(k/p),b.d=[],O=(k+1)%p,k<0&&(O+=p),O<I){for(O&&b.d.push(+S.slice(0,O)),I-=p;O<I;)b.d.push(+S.slice(O,O+=p));S=S.slice(O),O=p-S.length}else O-=I;for(;O--;)S+="0";if(b.d.push(+S),n&&(b.e>h||b.e<-h))throw Error(l+k)}else b.s=0,b.e=0,b.d=[0];return b}i($,"parseDecimal");function R(b,S,k){var O,I,C,j,N,W,Y,U,G=b.d;for(j=1,C=G[0];C>=10;C/=10)j++;if(O=S-j,O<0)O+=p,I=S,Y=G[U=0];else{if(U=Math.ceil((O+1)/p),C=G.length,U>=C)return b;for(Y=C=G[U],j=1;C>=10;C/=10)j++;O%=p,I=O-p+j}if(k!==void 0&&(C=u(10,j-I-1),N=Y/C%10|0,W=S<0||G[U+1]!==void 0||Y%C,W=k<4?(N||W)&&(k==0||k==(b.s<0?3:2)):N>5||N==5&&(k==4||W||k==6&&(O>0?I>0?Y/u(10,j-I):0:G[U-1])%10&1||k==(b.s<0?8:7))),S<1||!G[0])return W?(C=E(b),G.length=1,S=S-C-1,G[0]=u(10,(p-S%p)%p),b.e=s(-S/p)||0):(G.length=1,G[0]=b.e=b.s=0),b;if(O==0?(G.length=U,C=1,U--):(G.length=U+1,C=u(10,p-O),G[U]=I>0?(Y/u(10,j-I)%u(10,I)|0)*C:0),W)for(;;)if(U==0){(G[0]+=C)==d&&(G[0]=1,++b.e);break}else{if(G[U]+=C,G[U]!=d)break;G[U--]=0,C=1}for(O=G.length;G[--O]===0;)G.pop();if(n&&(b.e>h||b.e<-h))throw Error(l+E(b));return b}i(R,"round");function V(b,S){var k,O,I,C,j,N,W,Y,U,G,Re=b.constructor,F=Re.precision;if(!b.s||!S.s)return S.s?S.s=-S.s:S=new Re(b),n?R(S,F):S;if(W=b.d,G=S.d,O=S.e,Y=b.e,W=W.slice(),j=Y-O,j){for(U=j<0,U?(k=W,j=-j,N=G.length):(k=G,O=Y,N=W.length),I=Math.max(Math.ceil(F/p),N)+2,j>I&&(j=I,k.length=1),k.reverse(),I=j;I--;)k.push(0);k.reverse()}else{for(I=W.length,N=G.length,U=I<N,U&&(N=I),I=0;I<N;I++)if(W[I]!=G[I]){U=W[I]<G[I];break}j=0}for(U&&(k=W,W=G,G=k,S.s=-S.s),N=W.length,I=G.length-N;I>0;--I)W[N++]=0;for(I=G.length;I>j;){if(W[--I]<G[I]){for(C=I;C&&W[--C]===0;)W[C]=d-1;--W[C],W[I]+=d}W[I]-=G[I]}for(;W[--N]===0;)W.pop();for(;W[0]===0;W.shift())--O;return W[0]?(S.d=W,S.e=O,n?R(S,F):S):new Re(0)}i(V,"subtract");function B(b,S,k){var O,I=E(b),C=w(b.d),j=C.length;return S?(k&&(O=k-j)>0?C=C.charAt(0)+"."+C.slice(1)+_(O):j>1&&(C=C.charAt(0)+"."+C.slice(1)),C=C+(I<0?"e":"e+")+I):I<0?(C="0."+_(-I-1)+C,k&&(O=k-j)>0&&(C+=_(O))):I>=j?(C+=_(I+1-j),k&&(O=k-I-1)>0&&(C=C+"."+_(O))):((O=I+1)<j&&(C=C.slice(0,O)+"."+C.slice(O)),k&&(O=k-j)>0&&(I+1===j&&(C+="."),C+=_(O))),b.s<0?"-"+C:C}i(B,"toString");function Q(b,S){if(b.length>S)return b.length=S,!0}i(Q,"truncate");function Z(b){var S,k,O;function I(C){var j=this;if(!(j instanceof I))return new I(C);if(j.constructor=I,C instanceof I){j.s=C.s,j.e=C.e,j.d=(C=C.d)?C.slice():C;return}if(typeof C=="number"){if(C*0!==0)throw Error(o+C);if(C>0)j.s=1;else if(C<0)C=-C,j.s=-1;else{j.s=0,j.e=0,j.d=[0];return}if(C===~~C&&C<1e7){j.e=0,j.d=[C];return}return $(j,C.toString())}else if(typeof C!="string")throw Error(o+C);if(C.charCodeAt(0)===45?(C=C.slice(1),j.s=-1):j.s=1,c.test(C))$(j,C);else throw Error(o+C)}if(i(I,"Decimal"),I.prototype=v,I.ROUND_UP=0,I.ROUND_DOWN=1,I.ROUND_CEIL=2,I.ROUND_FLOOR=3,I.ROUND_HALF_UP=4,I.ROUND_HALF_DOWN=5,I.ROUND_HALF_EVEN=6,I.ROUND_HALF_CEIL=7,I.ROUND_HALF_FLOOR=8,I.clone=Z,I.config=I.set=J,b===void 0&&(b={}),b)for(O=["precision","rounding","toExpNeg","toExpPos","LN10"],S=0;S<O.length;)b.hasOwnProperty(k=O[S++])||(b[k]=this[k]);return I.config(b),I}i(Z,"clone");function J(b){if(!b||typeof b!="object")throw Error(a+"Object expected");var S,k,O,I=["precision",1,t,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(S=0;S<I.length;S+=3)if((O=b[k=I[S]])!==void 0)if(s(O)===O&&O>=I[S+1]&&O<=I[S+2])this[k]=O;else throw Error(o+k+": "+O);if((O=b[k="LN10"])!==void 0)if(O==Math.LN10)this[k]=new this(O);else throw Error(o+k+": "+O);return this}i(J,"config"),r=Z(r),r.default=r.Decimal=r,f=new r(1),typeof define=="function"&&define.amd?define(function(){return r}):typeof Cs<"u"&&Cs.exports?Cs.exports=r:(e||(e=typeof self<"u"&&self&&self.self==self?self:Function("return this")()),e.Decimal=r)})(Tb)});var aw=X((bee,um)=>{"use strict";var Fj=Object.prototype.hasOwnProperty,St="~";function Io(){}i(Io,"Events");Object.create&&(Io.prototype=Object.create(null),new Io().__proto__||(St=!1));function Wj(e,t,r){this.fn=e,this.context=t,this.once=r||!1}i(Wj,"EE");function iw(e,t,r,n,a){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new Wj(r,n||e,a),l=St?St+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}i(iw,"addListener");function Hu(e,t){--e._eventsCount===0?e._events=new Io:delete e._events[t]}i(Hu,"clearEvent");function mt(){this._events=new Io,this._eventsCount=0}i(mt,"EventEmitter");mt.prototype.eventNames=i(function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)Fj.call(r,n)&&t.push(St?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t},"eventNames");mt.prototype.listeners=i(function(t){var r=St?St+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,o=n.length,l=new Array(o);a<o;a++)l[a]=n[a].fn;return l},"listeners");mt.prototype.listenerCount=i(function(t){var r=St?St+t:t,n=this._events[r];return n?n.fn?1:n.length:0},"listenerCount");mt.prototype.emit=i(function(t,r,n,a,o,l){var s=St?St+t:t;if(!this._events[s])return!1;var u=this._events[s],c=arguments.length,f,d;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,n),!0;case 4:return u.fn.call(u.context,r,n,a),!0;case 5:return u.fn.call(u.context,r,n,a,o),!0;case 6:return u.fn.call(u.context,r,n,a,o,l),!0}for(d=1,f=new Array(c-1);d<c;d++)f[d-1]=arguments[d];u.fn.apply(u.context,f)}else{var p=u.length,m;for(d=0;d<p;d++)switch(u[d].once&&this.removeListener(t,u[d].fn,void 0,!0),c){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,r);break;case 3:u[d].fn.call(u[d].context,r,n);break;case 4:u[d].fn.call(u[d].context,r,n,a);break;default:if(!f)for(m=1,f=new Array(c-1);m<c;m++)f[m-1]=arguments[m];u[d].fn.apply(u[d].context,f)}}return!0},"emit");mt.prototype.on=i(function(t,r,n){return iw(this,t,r,n,!1)},"on");mt.prototype.once=i(function(t,r,n){return iw(this,t,r,n,!0)},"once");mt.prototype.removeListener=i(function(t,r,n,a){var o=St?St+t:t;if(!this._events[o])return this;if(!r)return Hu(this,o),this;var l=this._events[o];if(l.fn)l.fn===r&&(!a||l.once)&&(!n||l.context===n)&&Hu(this,o);else{for(var s=0,u=[],c=l.length;s<c;s++)(l[s].fn!==r||a&&!l[s].once||n&&l[s].context!==n)&&u.push(l[s]);u.length?this._events[o]=u.length===1?u[0]:u:Hu(this,o)}return this},"removeListener");mt.prototype.removeAllListeners=i(function(t){var r;return t?(r=St?St+t:t,this._events[r]&&Hu(this,r)):(this._events=new Io,this._eventsCount=0),this},"removeAllListeners");mt.prototype.off=mt.prototype.removeListener;mt.prototype.addListener=mt.prototype.on;mt.prefixed=St;mt.EventEmitter=mt;typeof um<"u"&&(um.exports=mt)});var Bw=X(Lw=>{function IL(){}i(IL,"noop");Lw.noop=IL});var Fw=X(zw=>{function CL(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}i(CL,"isPlainObject");zw.isPlainObject=CL});var Uw=X(Kw=>{var Ww=hf(),Vw=ja(),Ce=fl(),qw=vf(),$w=Fw(),kL=Da();sl();function _L(e,t,r){return _o(e,t,void 0,void 0,void 0,void 0,r)}i(_L,"isEqualWith");function _o(e,t,r,n,a,o,l){let s=l(e,t,r,n,a,o);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return To(e,t,o,l)}return To(e,t,o,l)}i(_o,"isEqualWithImpl");function To(e,t,r,n){if(Object.is(e,t))return!0;let a=Vw.getTag(e),o=Vw.getTag(t);if(a==="[object Arguments]"&&(a=Ce.objectTag),o==="[object Arguments]"&&(o=Ce.objectTag),a!==o)return!1;switch(a){case Ce.stringTag:return e.toString()===t.toString();case Ce.numberTag:{let u=e.valueOf(),c=t.valueOf();return kL.isEqualsSameValueZero(u,c)}case Ce.booleanTag:case Ce.dateTag:case Ce.symbolTag:return Object.is(e.valueOf(),t.valueOf());case Ce.regexpTag:return e.source===t.source&&e.flags===t.flags;case Ce.functionTag:return e===t}r=r??new Map;let l=r.get(e),s=r.get(t);if(l!=null&&s!=null)return l===t;r.set(e,t),r.set(t,e);try{switch(a){case Ce.mapTag:if(e.size!==t.size)return!1;for(let[u,c]of e.entries())if(!t.has(u)||!_o(c,t.get(u),u,e,t,r,n))return!1;return!0;case Ce.setTag:{if(e.size!==t.size)return!1;let u=Array.from(e.values()),c=Array.from(t.values());for(let f=0;f<u.length;f++){let d=u[f],p=c.findIndex(m=>_o(d,m,void 0,e,t,r,n));if(p===-1)return!1;c.splice(p,1)}return!0}case Ce.arrayTag:case Ce.uint8ArrayTag:case Ce.uint8ClampedArrayTag:case Ce.uint16ArrayTag:case Ce.uint32ArrayTag:case Ce.bigUint64ArrayTag:case Ce.int8ArrayTag:case Ce.int16ArrayTag:case Ce.int32ArrayTag:case Ce.bigInt64ArrayTag:case Ce.float32ArrayTag:case Ce.float64ArrayTag:if(qw.isBuffer(e)!==qw.isBuffer(t)||e.length!==t.length)return!1;for(let u=0;u<e.length;u++)if(!_o(e[u],t[u],u,e,t,r,n))return!1;return!0;case Ce.arrayBufferTag:return e.byteLength!==t.byteLength?!1:To(new Uint8Array(e),new Uint8Array(t),r,n);case Ce.dataViewTag:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:To(new Uint8Array(e),new Uint8Array(t),r,n);case Ce.errorTag:return e.name===t.name&&e.message===t.message;case Ce.objectTag:{if(!(To(e.constructor,t.constructor,r,n)||$w.isPlainObject(e)&&$w.isPlainObject(t)))return!1;let u=[...Object.keys(e),...Ww.getSymbols(e)],c=[...Object.keys(t),...Ww.getSymbols(t)];if(u.length!==c.length)return!1;for(let f=0;f<u.length;f++){let d=u[f],p=e[d];if(!Object.hasOwn(t,d))return!1;let m=t[d];if(!_o(p,m,d,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}i(To,"areObjectsEqual");Kw.isEqualWith=_L});var Yw=X(Hw=>{var TL=Bw(),DL=Uw();function RL(e,t){return DL.isEqualWith(e,t,TL.noop)}i(RL,"isEqual");Hw.isEqual=RL});var Xw=X((Vte,Gw)=>{Gw.exports=Yw().isEqual});var KS=X(Pe=>{"use strict";var bm=Symbol.for("react.element"),Am=Symbol.for("react.portal"),uc=Symbol.for("react.fragment"),cc=Symbol.for("react.strict_mode"),fc=Symbol.for("react.profiler"),dc=Symbol.for("react.provider"),pc=Symbol.for("react.context"),bB=Symbol.for("react.server_context"),mc=Symbol.for("react.forward_ref"),hc=Symbol.for("react.suspense"),vc=Symbol.for("react.suspense_list"),yc=Symbol.for("react.memo"),gc=Symbol.for("react.lazy"),AB=Symbol.for("react.offscreen"),$S;$S=Symbol.for("react.module.reference");function Jt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case bm:switch(e=e.type,e){case uc:case fc:case cc:case hc:case vc:return e;default:switch(e=e&&e.$$typeof,e){case bB:case pc:case mc:case gc:case yc:case dc:return e;default:return t}}case Am:return t}}}i(Jt,"v");Pe.ContextConsumer=pc;Pe.ContextProvider=dc;Pe.Element=bm;Pe.ForwardRef=mc;Pe.Fragment=uc;Pe.Lazy=gc;Pe.Memo=yc;Pe.Portal=Am;Pe.Profiler=fc;Pe.StrictMode=cc;Pe.Suspense=hc;Pe.SuspenseList=vc;Pe.isAsyncMode=function(){return!1};Pe.isConcurrentMode=function(){return!1};Pe.isContextConsumer=function(e){return Jt(e)===pc};Pe.isContextProvider=function(e){return Jt(e)===dc};Pe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===bm};Pe.isForwardRef=function(e){return Jt(e)===mc};Pe.isFragment=function(e){return Jt(e)===uc};Pe.isLazy=function(e){return Jt(e)===gc};Pe.isMemo=function(e){return Jt(e)===yc};Pe.isPortal=function(e){return Jt(e)===Am};Pe.isProfiler=function(e){return Jt(e)===fc};Pe.isStrictMode=function(e){return Jt(e)===cc};Pe.isSuspense=function(e){return Jt(e)===hc};Pe.isSuspenseList=function(e){return Jt(e)===vc};Pe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===uc||e===fc||e===cc||e===hc||e===vc||e===AB||typeof e=="object"&&e!==null&&(e.$$typeof===gc||e.$$typeof===yc||e.$$typeof===dc||e.$$typeof===pc||e.$$typeof===mc||e.$$typeof===$S||e.getModuleId!==void 0)};Pe.typeOf=Jt});var HS=X((Vne,US)=>{"use strict";US.exports=KS()});var KP=X($P=>{"use strict";var $o=z();function Cz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}i(Cz,"is");var kz=typeof Object.is=="function"?Object.is:Cz,_z=$o.useSyncExternalStore,Tz=$o.useRef,Dz=$o.useEffect,Rz=$o.useMemo,Mz=$o.useDebugValue;$P.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var o=Tz(null);if(o.current===null){var l={hasValue:!1,value:null};o.current=l}else l=o.current;o=Rz(function(){function u(m){if(!c){if(c=!0,f=m,m=n(m),a!==void 0&&l.hasValue){var h=l.value;if(a(h,m))return d=h}return d=m}if(h=d,kz(f,m))return h;var v=n(m);return a!==void 0&&a(h,v)?(f=m,h):(f=m,d=v)}i(u,"memoizedSelector");var c=!1,f,d,p=r===void 0?null:r;return[function(){return u(t())},p===null?void 0:function(){return u(p())}]},[t,r,n,a]);var s=_z(e,o[0],o[1]);return Dz(function(){l.hasValue=!0,l.value=s},[s]),Mz(s),s}});var HP=X((Yae,UP)=>{"use strict";UP.exports=KP()});var gn=M(z()),Ge=M(z()),Gh=M(Th());var qh=M(_a());var hI=4;function Wt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hI,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}i(Wt,"round");function Ze(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((a,o,l)=>{var s=r[l-1];return typeof s=="string"?a+s+o:s!==void 0?a+Wt(s)+o:a+o},"")}i(Ze,"roundTemplateLiteral");var je=i(e=>e===0?0:e>0?1:-1,"mathSign"),nt=i(e=>typeof e=="number"&&e!=+e,"isNan"),Or=i(e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,"isPercent"),q=i(e=>(typeof e=="number"||e instanceof Number)&&!nt(e),"isNumber"),it=i(e=>q(e)||typeof e=="string","isNumOrStr"),vI=0,Er=i(e=>{var t=++vI;return"".concat(e||"").concat(t)},"uniqueId"),lt=i(function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!q(t)&&typeof t!="string")return n;var o;if(Or(t)){if(r==null)return n;var l=t.indexOf("%");o=r*parseFloat(t.slice(0,l))/100}else o=+t;return nt(o)&&(o=n),a&&r!=null&&o>r&&(o=r),o},"getPercentValue"),nf=i(e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1},"hasDuplicate");function we(e,t,r){return q(e)&&q(t)?Wt(e+r*(t-e)):t}i(we,"interpolate");function ol(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):(0,qh.default)(n,t))===r)}i(ol,"findEntryInArray");var ce=i(e=>e===null||typeof e>"u","isNullish"),hi=i(e=>ce(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),"upperFirst");function Qe(e){return e!=null}i(Qe,"isNotNil");function xt(){}i(xt,"noop");var yI=!0,vi=i(function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),o=2;o<n;o++)a[o-2]=arguments[o];if(yI&&typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>a[l++]))}},"warn");var or={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},af=i((e,t,r)=>{var n=r.width,a=n===void 0?or.width:n,o=r.height,l=o===void 0?or.height:o,s=r.aspect,u=r.maxHeight,c=Or(a)?e:Number(a),f=Or(l)?t:Number(l);return s&&s>0&&(c?f=c/s:f&&(c=f*s),u&&f!=null&&f>u&&(f=u)),{calculatedWidth:c,calculatedHeight:f}},"calculateChartDimensions"),gI={width:0,height:0,overflow:"visible"},xI={width:0,overflowX:"visible"},bI={height:0,overflowY:"visible"},AI={},$h=i(e=>{var t=e.width,r=e.height,n=Or(t),a=Or(r);return n&&a?gI:n?xI:a?bI:AI},"getInnerDivStyle");function Kh(e){var t=e.width,r=e.height,n=e.aspect,a=t,o=r;return a===void 0&&o===void 0?(a=or.width,o=or.height):a===void 0?a=n&&n>0?void 0:or.width:o===void 0&&(o=n&&n>0?void 0:or.height),{width:a,height:o}}i(Kh,"getDefaultWidthAndHeight");function ee(e){return Number.isFinite(e)}i(ee,"isWellBehavedNumber");function Ot(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}i(Ot,"isPositiveNumber");var wI=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function ll(){return ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ll.apply(null,arguments)}i(ll,"_extends");function Uh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}i(Uh,"ownKeys");function Hh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Uh(Object(r),!0).forEach(function(n){SI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(Hh,"_objectSpread");function SI(e,t,r){return(t=PI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(SI,"_defineProperty");function PI(e){var t=OI(e,"string");return typeof t=="symbol"?t:t+""}i(PI,"_toPropertyKey");function OI(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(OI,"_toPrimitive");function EI(e,t){return _I(e)||kI(e,t)||CI(e,t)||II()}i(EI,"_slicedToArray");function II(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}i(II,"_nonIterableRest");function CI(e,t){if(e){if(typeof e=="string")return Yh(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yh(e,t):void 0}}i(CI,"_unsupportedIterableToArray");function Yh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}i(Yh,"_arrayLikeToArray");function kI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,o,l,s=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(f){c=!0,a=f}finally{try{if(!u&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw a}}return s}}i(kI,"_iterableToArrayLimit");function _I(e){if(Array.isArray(e))return e}i(_I,"_arrayWithHoles");function TI(e,t){if(e==null)return{};var r,n,a=DI(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}i(TI,"_objectWithoutProperties");function DI(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}i(DI,"_objectWithoutPropertiesLoose");var Xh=(0,Ge.createContext)(or.initialDimension);function RI(e){return Ot(e.width)&&Ot(e.height)}i(RI,"isAcceptableSize");function Zh(e){var t=e.children,r=e.width,n=e.height,a=(0,Ge.useMemo)(()=>({width:r,height:n}),[r,n]);return RI(a)?gn.createElement(Xh.Provider,{value:a},t):null}i(Zh,"ResponsiveContainerContextProvider");var Ta=i(()=>(0,Ge.useContext)(Xh),"useResponsiveContainerContext"),MI=(0,Ge.forwardRef)((e,t)=>{var r=e.aspect,n=e.initialDimension,a=n===void 0?or.initialDimension:n,o=e.width,l=e.height,s=e.minWidth,u=s===void 0?or.minWidth:s,c=e.minHeight,f=e.maxHeight,d=e.children,p=e.debounce,m=p===void 0?or.debounce:p,h=e.id,v=e.className,g=e.onResize,y=e.style,w=y===void 0?{}:y,A=TI(e,wI),P=(0,Ge.useRef)(null),E=(0,Ge.useRef)();E.current=g,(0,Ge.useImperativeHandle)(t,()=>P.current);var x=(0,Ge.useState)({containerWidth:a.width,containerHeight:a.height}),_=EI(x,2),D=_[0],$=_[1],R=(0,Ge.useCallback)((b,S)=>{$(k=>{var O=Math.round(b),I=Math.round(S);return k.containerWidth===O&&k.containerHeight===I?k:{containerWidth:O,containerHeight:I}})},[]);(0,Ge.useEffect)(()=>{if(P.current==null||typeof ResizeObserver>"u")return xt;var b=i(C=>{var j,N=C[0];if(N!=null){var W=N.contentRect,Y=W.width,U=W.height;R(Y,U),(j=E.current)===null||j===void 0||j.call(E,Y,U)}},"callback");m>0&&(b=(0,Gh.default)(b,m,{trailing:!0,leading:!1}));var S=new ResizeObserver(b),k=P.current.getBoundingClientRect(),O=k.width,I=k.height;return R(O,I),S.observe(P.current),()=>{S.disconnect()}},[R,m]);var V=D.containerWidth,B=D.containerHeight;vi(!r||r>0,"The aspect(%s) must be greater than zero.",r);var Q=af(V,B,{width:o,height:l,aspect:r,maxHeight:f}),Z=Q.calculatedWidth,J=Q.calculatedHeight;return vi(V<0||B<0||Z!=null&&Z>0||J!=null&&J>0,`The width(%s) and height(%s) of chart should be greater than 0,
3
3
  please check the style of container, or the props width(%s) and height(%s),
4
4
  or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
@@ -1 +1 @@
1
- import{b as h}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as A}from"./chunk-SDHFSBNM.js";import{f as k}from"./chunk-B6RRRJP5.js";import"./chunk-FSRSK4LY.js";import"./chunk-2Y6PXGIS.js";import{a as y,e as S}from"./chunk-WUWBZPUK.js";import{d as I}from"./chunk-FODLDLE2.js";import{a as u,d as w,f as z,g as P}from"./chunk-YKXDMIHQ.js";var N=w(z(),1);var a=w(P(),1);var j=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),p=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:n}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let s;i[2]!==t?(s=(0,a.jsx)(S,{className:"p-3",children:t}),i[2]=t,i[3]=s):s=i[3];let c;return i[4]!==l||i[5]!==s||i[6]!==n?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":n,children:[l,s]}),i[4]=l,i[5]=s,i[6]=n,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,n;i[0]!==t?(n=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=n):n=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let s;return i[4]!==n||i[5]!==l?(s=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[n,l]}),i[4]=n,i[5]=l,i[6]=s):s=i[6],s},"c"),M=u(()=>{let e=(0,N.c)(20),i=k(),t=I(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let n;e[1]!==i?(n=u(()=>i.getAuthConfig(),"r"),e[1]=i,e[2]=n):n=e[2];let{data:l,error:s}=A(d,n),c;e[3]!==t?(c=u(r=>(0,a.jsx)(h,{variant:r?"success":"outline",children:t(r?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,g;e[5]!==s?(g=s!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:s}),e[5]=s,e[6]=g):g=e[6];let f;e[7]!==l||e[8]!==s||e[9]!==t?(f=s===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=s,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==s||e[13]!==m||e[14]!==t?(x=s===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:j.map(r=>{let $=l.capabilities[r.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${r.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(r.label)}),m($)]},r.key)})})}),(0,a.jsx)(p,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(C)})}),(0,a.jsx)(p,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(L)})})]})}),l.organization.enabled&&(0,a.jsx)(p,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(p,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(p,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(p,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(r=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${r.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:r.name}),r.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:r.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:r.type}),r.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),r.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},r.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=s,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==g||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[g,f,x]}),e[16]=g,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"O");function C(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(C,"P");function L(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(L,"z");export{M as default};
1
+ import{b as h}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as A}from"./chunk-7TRN7FQ4.js";import{f as k}from"./chunk-EAQZEXBX.js";import"./chunk-FSRSK4LY.js";import"./chunk-GETL6R4M.js";import{a as y,e as S}from"./chunk-WUWBZPUK.js";import{d as I}from"./chunk-FODLDLE2.js";import{a as u,d as w,f as z,g as P}from"./chunk-YKXDMIHQ.js";var N=w(z(),1);var a=w(P(),1);var j=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),p=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:n}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let s;i[2]!==t?(s=(0,a.jsx)(S,{className:"p-3",children:t}),i[2]=t,i[3]=s):s=i[3];let c;return i[4]!==l||i[5]!==s||i[6]!==n?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":n,children:[l,s]}),i[4]=l,i[5]=s,i[6]=n,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,n;i[0]!==t?(n=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=n):n=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let s;return i[4]!==n||i[5]!==l?(s=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[n,l]}),i[4]=n,i[5]=l,i[6]=s):s=i[6],s},"c"),M=u(()=>{let e=(0,N.c)(20),i=k(),t=I(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let n;e[1]!==i?(n=u(()=>i.getAuthConfig(),"r"),e[1]=i,e[2]=n):n=e[2];let{data:l,error:s}=A(d,n),c;e[3]!==t?(c=u(r=>(0,a.jsx)(h,{variant:r?"success":"outline",children:t(r?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,g;e[5]!==s?(g=s!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:s}),e[5]=s,e[6]=g):g=e[6];let f;e[7]!==l||e[8]!==s||e[9]!==t?(f=s===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=s,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==s||e[13]!==m||e[14]!==t?(x=s===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:j.map(r=>{let $=l.capabilities[r.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${r.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(r.label)}),m($)]},r.key)})})}),(0,a.jsx)(p,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(C)})}),(0,a.jsx)(p,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(L)})})]})}),l.organization.enabled&&(0,a.jsx)(p,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(p,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(p,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(p,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(r=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${r.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:r.name}),r.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:r.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:r.type}),r.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),r.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},r.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=s,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==g||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[g,f,x]}),e[16]=g,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"O");function C(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(C,"P");function L(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(L,"z");export{M as default};
@@ -1 +1 @@
1
- import{a as f}from"./chunk-IMOHEGMV.js";import{a as j}from"./chunk-66UGPQVC.js";import{a as C}from"./chunk-PD6WIDY6.js";import{W as v}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as U}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as q}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as w}from"./chunk-4ZEL6BYL.js";import{f as L}from"./chunk-B6RRRJP5.js";import"./chunk-FSRSK4LY.js";import"./chunk-2Y6PXGIS.js";import{d as P,f as y,g as p,h,o as u}from"./chunk-FODLDLE2.js";import{a as s,d as S,e as W,g as X}from"./chunk-YKXDMIHQ.js";var a=S(W(),1);var e=S(X(),1);var B=y(w.getPitrBookmark),Y=y(w.pitrRestore),de=s(({initialShardKey:z})=>{let m=L(),t=P(),o=z??"",[A,x]=(0,a.useState)(null),[l,O]=(0,a.useState)(""),[R,I]=(0,a.useState)(null),[c,D]=(0,a.useState)(""),[k,E]=(0,a.useState)(!1),[i,K]=(0,a.useState)(null),[T,n]=(0,a.useState)(null),[b,d]=(0,a.useState)(!1),g=(0,a.useCallback)(async()=>{d(!0),n(null);try{let r=await m.query(B,{},p(o));x(r.current)}catch(r){n(h(r))}d(!1)},[m,o]);(0,a.useEffect)(()=>{u(g())},[g]),j(()=>{u((async()=>{try{let r=await m.query(B,{},p(o));x(r.current)}catch{}})())},!0);let M=s(r=>{O(r.target.value)},"A"),Z=s(r=>{D(r.target.value)},"U"),_=s(r=>{E(r.target.checked)},"q"),G=s(()=>{l.trim()!==""&&u((async()=>{d(!0),n(null);try{let r=await m.query(B,{time:l.trim()},p(o));I(r.forTime??null),x(r.current)}catch(r){I(null),n(h(r))}d(!1)})())},"K"),F=s(r=>{u((async()=>{d(!0),n(null);try{let N=await m.mutation(Y,r,p(o));K(N),await g()}catch(N){n(h(N))}d(!1)})())},"C"),H=c.trim()!==""||l.trim()!=="",J=t("Restore {shard} to {target}?",{shard:o===""?t("root"):o,target:c.trim()===""?l.trim():t("the given bookmark")}),Q=s(()=>{let r=k?{restart:!0}:{};c.trim()===""?r.time=l.trim():r.bookmark=c.trim(),F(r)},"z"),V=s(()=>{i!==null&&F(k?{bookmark:i.undoBookmark,restart:!0}:{bookmark:i.undoBookmark})},"D");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[t("Shard"),": ",(0,e.jsx)("span",{className:"font-mono",children:o===""?t("root"):o})]})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:t("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier.")}),T!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:T}),(0,e.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:t("Current bookmark")}),(0,e.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:A??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]}),(0,e.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore")}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-time",children:t("Time (ISO or epoch-ms, last 30 days)")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(v,{"data-testid":"pitr-time",id:"pitr-time",onChange:M,placeholder:"2026-06-01T00:00:00.000Z",value:l}),(0,e.jsx)(U,{"data-testid":"pitr-preview",disabled:b||l.trim()==="",onClick:G,size:"sm",type:"button",variant:"outline",children:t("Preview")})]}),R!==null&&(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[t("Bookmark for that time"),": ",R]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-bookmark",children:t("Or an explicit bookmark (wins over time)")}),(0,e.jsx)(v,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:Z,placeholder:t("bookmark string"),value:c})]}),(0,e.jsxs)(f,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[(0,e.jsx)("input",{checked:k,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:_,type:"checkbox"}),t("Restart the shard now so recovery applies immediately")]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:J,disabled:b||!H,onConfirm:Q,testId:"pitr-restore",children:t("Restore")})})]}),i!==null&&(0,e.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore armed")}),(0,e.jsx)(q,{variant:i.restarted?"destructive":"secondary",children:i.restarted?t("restarted now"):t("on next restart")})]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[t("Restored to"),": ",i.restoredTo]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[t("Undo bookmark"),": ",i.undoBookmark]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:t("Confirm undo"),disabled:b,onConfirm:V,testId:"pitr-undo",children:t("Undo restore")})})]})]})},"ce");export{de as PitrPanel};
1
+ import{a as f}from"./chunk-IMOHEGMV.js";import{a as j}from"./chunk-66UGPQVC.js";import{a as C}from"./chunk-PD6WIDY6.js";import{W as v}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as U}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as q}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as w}from"./chunk-4ZEL6BYL.js";import{f as L}from"./chunk-EAQZEXBX.js";import"./chunk-FSRSK4LY.js";import"./chunk-GETL6R4M.js";import{d as P,f as y,g as p,h,o as u}from"./chunk-FODLDLE2.js";import{a as s,d as S,e as W,g as X}from"./chunk-YKXDMIHQ.js";var a=S(W(),1);var e=S(X(),1);var B=y(w.getPitrBookmark),Y=y(w.pitrRestore),de=s(({initialShardKey:z})=>{let m=L(),t=P(),o=z??"",[A,x]=(0,a.useState)(null),[l,O]=(0,a.useState)(""),[R,I]=(0,a.useState)(null),[c,D]=(0,a.useState)(""),[k,E]=(0,a.useState)(!1),[i,K]=(0,a.useState)(null),[T,n]=(0,a.useState)(null),[b,d]=(0,a.useState)(!1),g=(0,a.useCallback)(async()=>{d(!0),n(null);try{let r=await m.query(B,{},p(o));x(r.current)}catch(r){n(h(r))}d(!1)},[m,o]);(0,a.useEffect)(()=>{u(g())},[g]),j(()=>{u((async()=>{try{let r=await m.query(B,{},p(o));x(r.current)}catch{}})())},!0);let M=s(r=>{O(r.target.value)},"A"),Z=s(r=>{D(r.target.value)},"U"),_=s(r=>{E(r.target.checked)},"q"),G=s(()=>{l.trim()!==""&&u((async()=>{d(!0),n(null);try{let r=await m.query(B,{time:l.trim()},p(o));I(r.forTime??null),x(r.current)}catch(r){I(null),n(h(r))}d(!1)})())},"K"),F=s(r=>{u((async()=>{d(!0),n(null);try{let N=await m.mutation(Y,r,p(o));K(N),await g()}catch(N){n(h(N))}d(!1)})())},"C"),H=c.trim()!==""||l.trim()!=="",J=t("Restore {shard} to {target}?",{shard:o===""?t("root"):o,target:c.trim()===""?l.trim():t("the given bookmark")}),Q=s(()=>{let r=k?{restart:!0}:{};c.trim()===""?r.time=l.trim():r.bookmark=c.trim(),F(r)},"z"),V=s(()=>{i!==null&&F(k?{bookmark:i.undoBookmark,restart:!0}:{bookmark:i.undoBookmark})},"D");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[t("Shard"),": ",(0,e.jsx)("span",{className:"font-mono",children:o===""?t("root"):o})]})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:t("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier.")}),T!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:T}),(0,e.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:t("Current bookmark")}),(0,e.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:A??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]}),(0,e.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore")}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-time",children:t("Time (ISO or epoch-ms, last 30 days)")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(v,{"data-testid":"pitr-time",id:"pitr-time",onChange:M,placeholder:"2026-06-01T00:00:00.000Z",value:l}),(0,e.jsx)(U,{"data-testid":"pitr-preview",disabled:b||l.trim()==="",onClick:G,size:"sm",type:"button",variant:"outline",children:t("Preview")})]}),R!==null&&(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[t("Bookmark for that time"),": ",R]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-bookmark",children:t("Or an explicit bookmark (wins over time)")}),(0,e.jsx)(v,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:Z,placeholder:t("bookmark string"),value:c})]}),(0,e.jsxs)(f,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[(0,e.jsx)("input",{checked:k,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:_,type:"checkbox"}),t("Restart the shard now so recovery applies immediately")]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:J,disabled:b||!H,onConfirm:Q,testId:"pitr-restore",children:t("Restore")})})]}),i!==null&&(0,e.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore armed")}),(0,e.jsx)(q,{variant:i.restarted?"destructive":"secondary",children:i.restarted?t("restarted now"):t("on next restart")})]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[t("Restored to"),": ",i.restoredTo]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[t("Undo bookmark"),": ",i.undoBookmark]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:t("Confirm undo"),disabled:b,onConfirm:V,testId:"pitr-undo",children:t("Undo restore")})})]})]})},"ce");export{de as PitrPanel};
@@ -1,4 +1,4 @@
1
- import{a as Pe}from"./chunk-EA2JKR5D.js";import{a as he}from"./chunk-IMOHEGMV.js";import{d as Ne,f as ke,g as we,k as oe}from"./chunk-V3VJAA4D.js";import{a as V}from"./chunk-5WJXVZMZ.js";import{a as $e}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as ye}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as B}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as ve}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as Oe}from"./chunk-4ZEL6BYL.js";import{f as F}from"./chunk-B6RRRJP5.js";import"./chunk-FSRSK4LY.js";import{d as be}from"./chunk-2Y6PXGIS.js";import{a as U}from"./chunk-FKVZRPV5.js";import{d as M,e as Se,f as se,g as ie,h as le,o as Ie,q as ae}from"./chunk-FODLDLE2.js";import{a as u,d as z,e as ue,f as te,g as re,i as fe}from"./chunk-YKXDMIHQ.js";var He=z(te(),1),xe=z(ue(),1);var Y=z(te(),1);var X=z(ue(),1);var C=z(re(),1);var Qe=se(Oe.listTables),Ve=["react","client","cli"],Xe={action:"action",mutation:"mutation",query:"query"},_e=u(t=>{let e=t.indexOf(":");return e===-1?{file:"",fn:t}:{file:t.slice(0,e),fn:t.slice(e+1)}},"Q"),Ye=u(({file:t,fn:e,kind:a})=>`await client.${Xe[a]}(api.${t}.${e}, { /* args */ });`,"ie"),Ze=u(t=>{let e=`api.${t.file}.${t.fn}`;switch(t.kind){case"action":return`const { call: ${t.fn} } = useAction(${e});`;case"mutation":return`const ${t.fn} = useMutation(${e});`;default:return`const data = useQuery(${e}, { /* args */ });`}},"se"),et=u(({file:t,fn:e})=>`lunora run ${t}:${e} --args '{ }'`,"oe"),tt=u(t=>["// Read rows",`const rows = await ctx.db.query("${t}").collect();`,"","// Insert a row",`const id = await ctx.db.insert("${t}", { /* fields */ });`,"","// Generated types",`type Row = Doc<"${t}">;`,`type RowId = Id<"${t}">;`].join(`
1
+ import{a as Pe}from"./chunk-EA2JKR5D.js";import{a as he}from"./chunk-IMOHEGMV.js";import{d as Ne,f as ke,g as we,k as oe}from"./chunk-V3VJAA4D.js";import{a as V}from"./chunk-5WJXVZMZ.js";import{a as $e}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as ye}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as B}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as ve}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as Oe}from"./chunk-4ZEL6BYL.js";import{f as F}from"./chunk-EAQZEXBX.js";import"./chunk-FSRSK4LY.js";import{d as be}from"./chunk-GETL6R4M.js";import{a as U}from"./chunk-FKVZRPV5.js";import{d as M,e as Se,f as se,g as ie,h as le,o as Ie,q as ae}from"./chunk-FODLDLE2.js";import{a as u,d as z,e as ue,f as te,g as re,i as fe}from"./chunk-YKXDMIHQ.js";var He=z(te(),1),xe=z(ue(),1);var Y=z(te(),1);var X=z(ue(),1);var C=z(re(),1);var Qe=se(Oe.listTables),Ve=["react","client","cli"],Xe={action:"action",mutation:"mutation",query:"query"},_e=u(t=>{let e=t.indexOf(":");return e===-1?{file:"",fn:t}:{file:t.slice(0,e),fn:t.slice(e+1)}},"Q"),Ye=u(({file:t,fn:e,kind:a})=>`await client.${Xe[a]}(api.${t}.${e}, { /* args */ });`,"ie"),Ze=u(t=>{let e=`api.${t.file}.${t.fn}`;switch(t.kind){case"action":return`const { call: ${t.fn} } = useAction(${e});`;case"mutation":return`const ${t.fn} = useMutation(${e});`;default:return`const data = useQuery(${e}, { /* args */ });`}},"se"),et=u(({file:t,fn:e})=>`lunora run ${t}:${e} --args '{ }'`,"oe"),tt=u(t=>["// Read rows",`const rows = await ctx.db.query("${t}").collect();`,"","// Insert a row",`const id = await ctx.db.insert("${t}", { /* fields */ });`,"","// Generated types",`type Row = Doc<"${t}">;`,`type RowId = Id<"${t}">;`].join(`
2
2
  `),"ce"),rt=u((t,e)=>{switch(t){case"cli":return et(e);case"client":return Ye(e);default:return Ze(e)}},"re"),Te=u(t=>{let e=(0,Y.c)(19),{code:a,label:r,testId:n}=t,s=M(),o;e[0]!==a?(o=u(()=>{ae(a)},"c"),e[0]=a,e[1]=o):o=e[1];let i=o,d;e[2]!==r?(d=(0,C.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let m=`${n}-copy`,l;e[4]!==s?(l=s("Copy"),e[4]=s,e[5]=l):l=e[5];let c;e[6]!==i||e[7]!==m||e[8]!==l?(c=(0,C.jsx)(B,{"data-testid":m,onClick:i,size:"xs",type:"button",variant:"ghost",children:l}),e[6]=i,e[7]=m,e[8]=l,e[9]=c):c=e[9];let f;e[10]!==d||e[11]!==c?(f=(0,C.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[d,c]}),e[10]=d,e[11]=c,e[12]=f):f=e[12];let h;e[13]!==a||e[14]!==n?(h=(0,C.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":n,children:a}),e[13]=a,e[14]=n,e[15]=h):h=e[15];let g;return e[16]!==f||e[17]!==h?(g=(0,C.jsxs)("div",{className:"flex flex-col gap-1.5",children:[f,h]}),e[16]=f,e[17]=h,e[18]=g):g=e[18],g},"U"),at=u(t=>{let e=(0,Y.c)(46),{file:a,fn:r,kind:n}=t,s=M(),[o,i]=(0,X.useState)("react"),d,m,l;if(e[0]!==a||e[1]!==r||e[2]!==n||e[3]!==s||e[4]!==o){let w={file:a,fn:r,kind:n},j;e[8]!==s?(j=s("CLI"),e[8]=s,e[9]=j):j=e[9];let O;e[10]!==s?(O=s("Client"),e[10]=s,e[11]=O):O=e[11];let S;e[12]!==s?(S=s("React"),e[12]=s,e[13]=S):S=e[13];let T;e[14]!==j||e[15]!==O||e[16]!==S?(T={cli:j,client:O,react:S},e[14]=j,e[15]=O,e[16]=S,e[17]=T):T=e[17],l=T;let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=u(R=>{i(R.currentTarget.dataset.tab)},"B"),e[18]=A):A=e[18],d=A,m=rt(o,w),e[0]=a,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=d,e[6]=m,e[7]=l}else d=e[5],m=e[6],l=e[7];let c=m,f=`api.${a}.${r}`,h;e[19]!==f?(h=(0,C.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"api-fn-title",children:f}),e[19]=f,e[20]=h):h=e[20];let g;e[21]!==n||e[22]!==s?(g=s("Call this {kind} from your app.",{kind:n}),e[21]=n,e[22]=s,e[23]=g):g=e[23];let x;e[24]!==g?(x=(0,C.jsx)("p",{className:"text-xs text-muted-foreground",children:g}),e[24]=g,e[25]=x):x=e[25];let y;e[26]!==h||e[27]!==x?(y=(0,C.jsxs)("div",{children:[h,x]}),e[26]=h,e[27]=x,e[28]=y):y=e[28];let N;e[29]!==s?(N=s("Snippet flavour"),e[29]=s,e[30]=N):N=e[30];let v;e[31]!==d||e[32]!==o||e[33]!==l?(v=Ve.map(w=>(0,C.jsx)(B,{"aria-selected":o===w,"data-tab":w,"data-testid":`api-tab-${w}`,onClick:d,role:"tab",size:"xs",type:"button",variant:o===w?"default":"outline",children:l[w]},w)),e[31]=d,e[32]=o,e[33]=l,e[34]=v):v=e[34];let b;e[35]!==N||e[36]!==v?(b=(0,C.jsx)("div",{"aria-label":N,className:"flex gap-1.5","data-testid":"api-tabs",role:"tablist",children:v}),e[35]=N,e[36]=v,e[37]=b):b=e[37];let I=l[o],P=`api-snippet-${o}`,$;e[38]!==c||e[39]!==I||e[40]!==P?($=(0,C.jsx)(Te,{code:c,label:I,testId:P}),e[38]=c,e[39]=I,e[40]=P,e[41]=$):$=e[41];let k;return e[42]!==$||e[43]!==y||e[44]!==b?(k=(0,C.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"api-fn-doc",children:[y,b,$]}),e[42]=$,e[43]=y,e[44]=b,e[45]=k):k=e[45],k},"de"),nt=u(t=>{let e=(0,Y.c)(19),{name:a}=t,r=M(),n;e[0]!==a?(n=tt(a),e[0]=a,e[1]=n):n=e[1];let s=n,o;e[2]!==a?(o=(0,C.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"api-table-title",children:a}),e[2]=a,e[3]=o):o=e[3];let i;e[4]!==r?(i=r("Read and write this table through the typed data model."),e[4]=r,e[5]=i):i=e[5];let d;e[6]!==i?(d=(0,C.jsx)("p",{className:"text-xs text-muted-foreground",children:i}),e[6]=i,e[7]=d):d=e[7];let m;e[8]!==o||e[9]!==d?(m=(0,C.jsxs)("div",{children:[o,d]}),e[8]=o,e[9]=d,e[10]=m):m=e[10];let l;e[11]!==r?(l=r("Data model"),e[11]=r,e[12]=l):l=e[12];let c;e[13]!==s||e[14]!==l?(c=(0,C.jsx)(Te,{code:s,label:l,testId:"api-snippet-table"}),e[13]=s,e[14]=l,e[15]=c):c=e[15];let f;return e[16]!==m||e[17]!==c?(f=(0,C.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"api-table-doc",children:[m,c]}),e[16]=m,e[17]=c,e[18]=f):f=e[18],f},"fe"),je=u(t=>{let e=(0,Y.c)(8),{active:a,label:r,onSelect:n,testId:s,value:o}=t,i;e[0]!==n||e[1]!==o?(i=u(()=>{n(o)},"m"),e[0]=n,e[1]=o,e[2]=i):i=e[2];let d=i,m=a?"page":void 0,l;return e[3]!==r||e[4]!==d||e[5]!==m||e[6]!==s?(l=(0,C.jsx)("button",{"aria-current":m,className:"w-full truncate rounded-md px-2 py-1 text-start font-mono text-xs text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-testid":s,onClick:d,type:"button",children:r}),e[3]=r,e[4]=d,e[5]=m,e[6]=s,e[7]=l):l=e[7],l},"G"),ot=u(t=>{let e=new Map;for(let a of t){let{file:r,fn:n}=_e(a.path),s=e.get(r)??[];s.push({fn:n,kind:a.kind,path:a.path}),e.set(r,s)}return[...e.entries()].map(([a,r])=>({file:a,items:r.toSorted((n,s)=>n.fn.localeCompare(s.fn))})).toSorted((a,r)=>a.file.localeCompare(r.file))},"pe"),Ce=u(t=>{let e=(0,Y.c)(58),{functions:a,initialShardKey:r}=t,n=M(),s=F(),[o,i]=(0,X.useState)(null),[d,m]=(0,X.useState)(null),l,c;e[0]!==s||e[1]!==r?(l=u(()=>{let R=!1;return s.query(Qe,{},ie(r??"")).then(_=>(R||i(_),_)).catch(()=>{R||i([])}),()=>{R=!0}},"o"),c=[s,r],e[0]=s,e[1]=r,e[2]=l,e[3]=c):(l=e[2],c=e[3]),(0,X.useEffect)(l,c);let f,h,g,x,y,N,v,b,I,P;if(e[4]!==a||e[5]!==d||e[6]!==n||e[7]!==o){let R=a??[],_=ot(R),L=(o??[]).map(st).toSorted(it),E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=u(q=>{m({kind:"fn",path:q})},"P"),e[18]=E):E=e[18];let W=E,Q;e[19]===Symbol.for("react.memo_cache_sentinel")?(Q=u(q=>{m({kind:"table",name:q})},"j"),e[19]=Q):Q=e[19];let Ge=Q;h=d?.kind==="fn"?R.find(q=>q.path===d.path):void 0,f=R.length>0||L.length>0,g=h===void 0?void 0:_e(h.path),I="grid min-h-0 gap-6 md:grid-cols-[16rem_minmax(0,1fr)]",P="lunora-api-docs",e[20]!==n?(x=n("API resources"),e[20]=n,e[21]=x):x=e[21],y="flex flex-col gap-4 overflow-y-auto",N="api-rail";let ne;e[22]!==d||e[23]!==n?(ne=u(q=>(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:q.file||n("(root)")}),q.items.map(ee=>(0,C.jsx)(je,{active:d?.kind==="fn"&&d.path===ee.path,label:ee.fn,onSelect:W,testId:`api-rail-fn-${ee.path}`,value:ee.path},ee.path))]},q.file),"q"),e[22]=d,e[23]=n,e[24]=ne):ne=e[24],v=_.map(ne),b=L.length>0&&(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Tables")}),L.map(q=>(0,C.jsx)(je,{active:d?.kind==="table"&&d.name===q,label:q,onSelect:Ge,testId:`api-rail-table-${q}`,value:q},q))]}),e[4]=a,e[5]=d,e[6]=n,e[7]=o,e[8]=f,e[9]=h,e[10]=g,e[11]=x,e[12]=y,e[13]=N,e[14]=v,e[15]=b,e[16]=I,e[17]=P}else f=e[8],h=e[9],g=e[10],x=e[11],y=e[12],N=e[13],v=e[14],b=e[15],I=e[16],P=e[17];let $;e[25]!==f||e[26]!==n?($=!f&&(0,C.jsx)("p",{className:"px-2 text-xs text-muted-foreground","data-testid":"api-rail-empty",children:n("No functions or tables to document yet.")}),e[25]=f,e[26]=n,e[27]=$):$=e[27];let k;e[28]!==$||e[29]!==x||e[30]!==y||e[31]!==N||e[32]!==v||e[33]!==b?(k=(0,C.jsxs)("nav",{"aria-label":x,className:y,"data-testid":N,children:[v,b,$]}),e[28]=$,e[29]=x,e[30]=y,e[31]=N,e[32]=v,e[33]=b,e[34]=k):k=e[34];let w;e[35]!==d||e[36]!==n?(w=d===null&&(0,C.jsx)(U,{description:n("Select a function or table to see how to call it from your app."),testId:"api-empty",title:n("API usage snippets")}),e[35]=d,e[36]=n,e[37]=w):w=e[37];let j;e[38]!==d?.kind||e[39]!==h||e[40]!==g?(j=d?.kind==="fn"&&h!==void 0&&g!==void 0&&(0,C.jsx)(at,{file:g.file,fn:g.fn,kind:h.kind},h.path),e[38]=d?.kind,e[39]=h,e[40]=g,e[41]=j):j=e[41];let O;e[42]!==d?.kind||e[43]!==h||e[44]!==n?(O=d?.kind==="fn"&&h===void 0&&(0,C.jsx)(U,{testId:"api-empty",title:n("API usage snippets")}),e[42]=d?.kind,e[43]=h,e[44]=n,e[45]=O):O=e[45];let S;e[46]!==d?(S=d?.kind==="table"&&(0,C.jsx)(nt,{name:d.name}),e[46]=d,e[47]=S):S=e[47];let T;e[48]!==w||e[49]!==j||e[50]!==O||e[51]!==S?(T=(0,C.jsxs)("div",{className:"min-w-0",children:[w,j,O,S]}),e[48]=w,e[49]=j,e[50]=O,e[51]=S,e[52]=T):T=e[52];let A;return e[53]!==k||e[54]!==T||e[55]!==I||e[56]!==P?(A=(0,C.jsxs)("div",{className:I,"data-testid":P,children:[k,T]}),e[53]=k,e[54]=T,e[55]=I,e[56]=P,e[57]=A):A=e[57],A},"ke");function st(t){return t.name}u(st,"ue");function it(t,e){return t.localeCompare(e)}u(it,"me");var De=z(te(),1);var K=z(te(),1),J=z(ue(),1);var p=z(re(),1);var pe=u(function(t,e,a){let r=(0,K.c)(15),n;r[0]===Symbol.for("react.memo_cache_sentinel")?(n={kind:"loading"},r[0]=n):n=r[0];let[s,o]=(0,J.useState)(n),i;r[1]!==e?(i=u(async()=>e(),"a"),r[1]=e,r[2]=i):i=r[2];let d=(0,J.useEffectEvent)(i),m;r[3]!==a?(m=u(g=>a(g),"d"),r[3]=a,r[4]=m):m=r[4];let l=(0,J.useEffectEvent)(m),c;r[5]!==l||r[6]!==d||r[7]!==t?(c=u(()=>{if(t!==void 0)return;let g=!1;return d().then(x=>(g||o(l(x)),x)).catch(x=>{g||o({kind:"error",message:le(x)})}),()=>{g=!0}},"u"),r[5]=l,r[6]=d,r[7]=t,r[8]=c):c=r[8];let f;r[9]!==t?(f=[t],r[9]=t,r[10]=f):f=r[10],(0,J.useEffect)(c,f);let h;return r[11]!==a||r[12]!==s||r[13]!==t?(h=t===void 0?s:a(t),r[11]=a,r[12]=s,r[13]=t,r[14]=h):h=r[14],h},"wt"),lt=u(t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string","we"),Ee=u(t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},"Z"),ce=u(t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>ce(e)).join(" | "):t.type==="array"?`array<${ce(t.items)}>`:t.type??"any","F"),dt=u(t=>{let e=Ee(t);return e!==void 0?t.type??lt(e[0]):ce(t)},"Oe"),ct=u(t=>{let e=Ee(t);return e===void 0?void 0:e.map(a=>JSON.stringify(a)).join(" | ")},"$e"),pt=u(t=>{let e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} \u2264`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);let a=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`\u2264 ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);let r=e.length>(a?2:1);return a||r?e.join(" "):void 0},"Te"),mt=u(t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},"Ee"),Z=u(t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return Z(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{let e={};for(let[a,r]of Object.entries(t.properties??{}))e[a]=Z(r);return e}case"string":return"";default:return null}},"D"),de=u(t=>{let e=(0,K.c)(7),{label:a,value:r}=t,n;e[0]!==a?(n=(0,p.jsx)("span",{className:"text-muted-foreground",children:a}),e[0]=a,e[1]=n):n=e[1];let s;e[2]!==r?(s=(0,p.jsx)("span",{className:"text-foreground",children:r}),e[2]=r,e[3]=s):s=e[3];let o;return e[4]!==n||e[5]!==s?(o=(0,p.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,s]}),e[4]=n,e[5]=s,e[6]=o):o=e[6],o},"K"),ut=u(t=>{let e=(0,K.c)(40),{name:a,required:r,schema:n}=t,s=M(),o;e[0]!==n?(o=pt(n),e[0]=n,e[1]=o):o=e[1];let i=o,d;e[2]!==n?(d=ct(n),e[2]=n,e[3]=d):d=e[3];let m=d,l=n["x-lunora-table"],c=n.format!==void 0||i!==void 0||m!==void 0||l!==void 0,f;e[4]!==n?(f=mt(n),e[4]=n,e[5]=f):f=e[5];let h=f,g=r?"*":"?",x;e[6]!==g?(x=(0,p.jsx)("span",{className:"text-muted-foreground",children:g}),e[6]=g,e[7]=x):x=e[7];let y;e[8]!==a||e[9]!==x?(y=(0,p.jsxs)("span",{className:"font-mono text-foreground",children:[a,x]}),e[8]=a,e[9]=x,e[10]=y):y=e[10];let N;e[11]!==n?(N=dt(n),e[11]=n,e[12]=N):N=e[12];let v;e[13]!==N?(v=(0,p.jsx)("span",{className:"font-mono text-muted-foreground",children:N}),e[13]=N,e[14]=v):v=e[14];let b;e[15]!==y||e[16]!==v?(b=(0,p.jsxs)("div",{className:"flex items-baseline gap-2",children:[y,v]}),e[15]=y,e[16]=v,e[17]=b):b=e[17];let I;e[18]!==n.description?(I=n.description!==void 0&&(0,p.jsx)("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=I):I=e[19];let P;e[20]!==c||e[21]!==i||e[22]!==l||e[23]!==n.format||e[24]!==s||e[25]!==m?(P=c&&(0,p.jsxs)("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&(0,p.jsx)(de,{label:s("Format"),value:n.format}),i!==void 0&&(0,p.jsx)(de,{label:s("Range"),value:i}),m!==void 0&&(0,p.jsx)(de,{label:s("Value in"),value:m}),l!==void 0&&(0,p.jsx)(de,{label:s("relation"),value:l})]}),e[20]=c,e[21]=i,e[22]=l,e[23]=n.format,e[24]=s,e[25]=m,e[26]=P):P=e[26];let $;e[27]!==I||e[28]!==P||e[29]!==b?($=(0,p.jsxs)("div",{className:"flex flex-col gap-1 py-2",children:[b,I,P]}),e[27]=I,e[28]=P,e[29]=b,e[30]=$):$=e[30];let k=$;if(h===void 0){let S;return e[31]!==k?(S=(0,p.jsx)("div",{className:"border-b border-border/50 last:border-b-0",children:k}),e[31]=k,e[32]=S):S=e[32],S}let w;e[33]!==k?(w=(0,p.jsx)("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k}),e[33]=k,e[34]=w):w=e[34];let j;e[35]!==h?(j=(0,p.jsx)("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:(0,p.jsx)(Je,{schema:h})}),e[35]=h,e[36]=j):j=e[36];let O;return e[37]!==w||e[38]!==j?(O=(0,p.jsxs)("details",{className:"border-b border-border/50 last:border-b-0",children:[w,j]}),e[37]=w,e[38]=j,e[39]=O):O=e[39],O},"Ce"),Je=u(t=>{let e=(0,K.c)(7),{schema:a}=t,r;e[0]!==a.required?(r=new Set(a.required),e[0]=a.required,e[1]=r):r=e[1];let n=r,s;e[2]!==a.properties?(s=Object.entries(a.properties??{}),e[2]=a.properties,e[3]=s):s=e[3];let o=s,i;return e[4]!==n||e[5]!==o?(i=(0,p.jsx)("div",{className:"flex flex-col",children:o.map(d=>{let[m,l]=d;return(0,p.jsx)(ut,{name:m,required:n.has(m),schema:l},m)})}),e[4]=n,e[5]=o,e[6]=i):i=e[6],i},"ee"),Ae=u(t=>{let e=(0,K.c)(10),{schema:a,testId:r}=t;if(a?.type!=="object"||Object.keys(a.properties??{}).length===0){let o;e[0]!==a?(o=ce(a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==o||e[3]!==r?(i=(0,p.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":r,children:o}),e[2]=o,e[3]=r,e[4]=i):i=e[4],i}let n;e[5]!==a?(n=(0,p.jsx)(Je,{schema:a}),e[5]=a,e[6]=n):n=e[6];let s;return e[7]!==n||e[8]!==r?(s=(0,p.jsx)("div",{className:"text-xs","data-testid":r,children:n}),e[7]=n,e[8]=r,e[9]=s):s=e[9],s},"G"),ft=["curl","javascript","lunora"],ht={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},gt=u(t=>`api.${t.replaceAll(/[/:]/g,".")}`,"Re"),xt=u(t=>{let e=Z(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},"je"),bt=u((t,e,a)=>{let r=`${a}${e.httpPath}`,n=JSON.stringify(xt(e),void 0,2),s=JSON.stringify(Z(e.argsSchema)??{},void 0,2);switch(t){case"curl":{let o=e.method!=="GET"&&e.method!=="HEAD",i=[`curl -X ${e.method} ${JSON.stringify(r)}`];return o&&i.push(' -H "Content-Type: application/json"',` -d '${n}'`),i.join(` \\
3
3
  `)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
4
4
  import { api } from "./_generated/api";
@@ -1 +1 @@
1
- import{a as O}from"./chunk-66UGPQVC.js";import{a as H}from"./chunk-PD6WIDY6.js";import{a as ee}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as Z}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as E}from"./chunk-SDHFSBNM.js";import{f as R}from"./chunk-B6RRRJP5.js";import"./chunk-FSRSK4LY.js";import"./chunk-2Y6PXGIS.js";import{a as _}from"./chunk-FKVZRPV5.js";import{a as K,b as V,c as z,d as F,e as u,f as p}from"./chunk-HEAQVSNS.js";import{a as A,e as T}from"./chunk-WUWBZPUK.js";import{d as M,h as G,o as W,r as X}from"./chunk-FODLDLE2.js";import{a as c,d as P,e as oe,f as re,g as ae}from"./chunk-YKXDMIHQ.js";var U=P(re(),1),Y=P(oe(),1);var t=P(ae(),1);var se=P(re(),1);var Q=P(oe(),1);var h=P(ae(),1);var ie=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","X"),le=c(a=>a.toSorted((e,i)=>e.scheduledFor-i.scheduledFor),"F"),ce=c((a,e,i)=>e!==void 0?e:i===void 0?d=>a.cancelScheduledJob(d):void 0,"Y"),de=c(a=>{let e=(0,se.c)(16),{cancelJob:i,loadJobs:d}=a===void 0?{}:a,f=R(),r=M(),l=d===void 0,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["lunora-scheduled-jobs"],e[0]=o):o=e[0];let N=E(o,async()=>{let v=await(d??(()=>f.listScheduledJobs()))();return le(v)}),[x,n]=(0,Q.useState)(void 0),[s,m]=(0,Q.useState)(void 0),y,k;e[1]!==f||e[2]!==l?(y=c(()=>{if(l)return f.subscribeScheduledJobs(v=>{m(void 0),n(le(v))})},"v"),k=[l,f],e[1]=f,e[2]=l,e[3]=y,e[4]=k):(y=e[3],k=e[4]),(0,Q.useEffect)(y,k);let g;e[5]!==N?(g=c(()=>{N.refetch()},"y"),e[5]=N,e[6]=g):g=e[6],O(g,!l);let J=ce(f,i,d),b=x??N.data,j=s??N.error,I=c(async v=>{if(J!==void 0){m(void 0);try{await J(v),l||N.refetch()}catch(D){m(G(D))}}},"A"),q="flex flex-col gap-3",B="lunora-scheduled-jobs",S;e[7]!==j?(S=j!==null&&(0,h.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:j}),e[7]=j,e[8]=S):S=e[8];let L;e[9]!==b?.length||e[10]!==r?(L=b?.length===0&&(0,h.jsx)(_,{description:r("Jobs queued with runAfter / runAt will appear here."),icon:(0,h.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,h.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,h.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:r("No scheduled jobs.")}),e[9]=b?.length,e[10]=r,e[11]=L):L=e[11];let $=b!==void 0&&b.length>0&&(0,h.jsx)(A,{className:"overflow-hidden py-0",children:(0,h.jsx)(T,{className:"px-0",children:(0,h.jsxs)(K,{"data-testid":"sj-table",children:[(0,h.jsx)(V,{children:(0,h.jsxs)(F,{children:[(0,h.jsx)(u,{children:r("function")}),(0,h.jsx)(u,{children:r("scheduled for")}),(0,h.jsx)(u,{children:r("pool")}),(0,h.jsx)(u,{children:r("attempts")}),(0,h.jsx)(u,{children:r("shard")}),(0,h.jsx)(u,{children:r("id")}),J!==void 0&&(0,h.jsx)(u,{"aria-label":r("Actions")})]})}),(0,h.jsx)(z,{children:b.map(v=>(0,h.jsxs)(F,{"data-testid":`sj-row-${v.id}`,children:[(0,h.jsx)(p,{className:"font-mono text-xs",children:v.workflow??v.functionPath}),(0,h.jsx)(p,{className:"text-muted-foreground tabular-nums",children:ie(v.scheduledFor)}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.pool??""}),(0,h.jsx)(p,{className:"tabular-nums",children:v.attempts??0}),(0,h.jsx)(p,{children:v.shardKey??""}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.id}),J!==void 0&&(0,h.jsx)(p,{className:"text-right",children:(0,h.jsx)(H,{confirmLabel:r("Cancel job?"),onConfirm:c(()=>{W(I(v.id))},"onConfirm"),testId:`sj-cancel-${v.id}`,children:r("Cancel")})})]},v.id))})]})})}),w;return e[12]!==$||e[13]!==S||e[14]!==L?(w=(0,h.jsxs)("div",{className:q,"data-testid":B,children:[S,L,$]}),e[12]=$,e[13]=S,e[14]=L,e[15]=w):w=e[15],w},"he");var he={kind:"idle"},me=c((a,e,i)=>i!==void 0?i:e===void 0?d=>a.runCronJob(d):void 0,"re"),ue=c(({loadCronJobs:a,runCronJob:e}={})=>{let i=R(),d=M(),[f,r]=(0,Y.useState)({}),l=E(["lunora-cron-jobs",a?"custom":"default"],()=>(a??(()=>i.getCronJobs()))()),{data:o,error:N}=l,x=me(i,a,e),n=c(async s=>{if(x!==void 0){r(m=>({...m,[s]:{kind:"running"}}));try{await x(s),r(m=>({...m,[s]:{kind:"ok"}})),l.refetch()}catch(m){r(y=>({...y,[s]:{kind:"error",message:G(m)}}))}}},"i");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[N!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:N}),o?.length===0&&(0,t.jsx)(_,{description:d("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:d("No cron triggers.")}),o!==void 0&&o.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"cron-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:d("name")}),(0,t.jsx)(u,{children:d("schedule")}),(0,t.jsx)(u,{children:d("target")}),(0,t.jsx)(u,{children:d("shard")}),x!==void 0&&(0,t.jsx)(u,{"aria-label":d("Actions")})]})}),(0,t.jsx)(z,{children:o.map(s=>{let m=f[s.name]??he;return(0,t.jsxs)(F,{"data-testid":`cron-row-${s.name}`,children:[(0,t.jsx)(p,{children:s.name}),(0,t.jsx)(p,{className:"font-mono text-xs tabular-nums",children:s.cron}),(0,t.jsx)(p,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[s.workflow===void 0?(0,t.jsx)(Z,{variant:"outline",children:d("function")}):(0,t.jsx)(Z,{variant:"secondary",children:d("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.workflow??s.functionPath})]})}),(0,t.jsx)(p,{children:s.shardKey??""}),x!==void 0&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[m.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${s.name}`,children:d("ran")}),m.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${s.name}`,role:"alert",children:m.message}),(0,t.jsx)(H,{confirmLabel:d("Run now?"),disabled:m.kind==="running",onConfirm:c(()=>{W(n(s.name))},"onConfirm"),testId:`cron-run-${s.name}`,children:m.kind==="running"?d("Running\u2026"):d("Run now")})]})})]},`${s.cron}:${s.name}`)})})]})})})]})},"le"),pe=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","se"),fe=c(a=>{let e=(0,U.c)(34),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadJobs:d,removeJob:f,retryJob:r}=i,l=R(),o=M(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let x;e[3]!==l||e[4]!==d?(x=c(async()=>(await(d??(()=>l.listDeadJobs()))()).toSorted(be),"h"),e[3]=l,e[4]=d,e[5]=x):x=e[5];let n=E(N,x),s=n.data,[m,y]=(0,Y.useState)(void 0),k=n.error??m,g=d===void 0,J;e[6]!==l||e[7]!==g||e[8]!==r?(J=r??(g?C=>l.retryDeadJob(C):void 0),e[6]=l,e[7]=g,e[8]=r,e[9]=J):J=e[9];let b=J,j;e[10]!==l||e[11]!==g||e[12]!==f?(j=f??(g?C=>l.removeDeadJob(C):void 0),e[10]=l,e[11]=g,e[12]=f,e[13]=j):j=e[13];let I=j,q;e[14]!==n?(q=c(()=>{n.refetch()},"$"),e[14]=n,e[15]=q):q=e[15],O(q,!0);let B;e[16]!==n?(B=c(async C=>{y(void 0);try{await C,n.refetch()}catch(ne){y(G(ne))}},"I"),e[16]=n,e[17]=B):B=e[17];let S=B,L=b!==void 0||I!==void 0,$;e[18]!==k?($=k!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:k}),e[18]=k,e[19]=$):$=e[19];let w;e[20]!==s?.length||e[21]!==o?(w=s?.length===0&&(0,t.jsx)(_,{description:o("Jobs that exhaust their retry budget are parked here instead of being dropped."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:o("No dead-letter jobs.")}),e[20]=s?.length,e[21]=o,e[22]=w):w=e[22];let v;e[23]!==S||e[24]!==L||e[25]!==s||e[26]!==I||e[27]!==b||e[28]!==o?(v=s!==void 0&&s.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"dlq-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:o("function")}),(0,t.jsx)(u,{children:o("attempts")}),(0,t.jsx)(u,{children:o("last tried")}),(0,t.jsx)(u,{children:o("pool")}),(0,t.jsx)(u,{children:o("shard")}),(0,t.jsx)(u,{children:o("id")}),L&&(0,t.jsx)(u,{"aria-label":o("Actions")})]})}),(0,t.jsx)(z,{children:s.map(C=>(0,t.jsxs)(F,{"data-testid":`dlq-row-${C.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:C.workflow??C.functionPath}),(0,t.jsx)(p,{className:"tabular-nums",children:C.attempts??0}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:pe(C.scheduledFor)}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.pool??""}),(0,t.jsx)(p,{children:C.shardKey??""}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.id}),L&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[b!==void 0&&(0,t.jsx)(ee,{"data-testid":`dlq-retry-${C.id}`,onClick:c(()=>{W(S(b(C.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:o("Retry")}),I!==void 0&&(0,t.jsx)(H,{confirmLabel:o("Drop job?"),onConfirm:c(()=>{W(S(I(C.id)))},"onConfirm"),testId:`dlq-remove-${C.id}`,children:o("Drop")})]})})]},C.id))})]})})}),e[23]=S,e[24]=L,e[25]=s,e[26]=I,e[27]=b,e[28]=o,e[29]=v):v=e[29];let D;return e[30]!==v||e[31]!==$||e[32]!==w?(D=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[$,w,v]}),e[30]=v,e[31]=$,e[32]=w,e[33]=D):D=e[33],D},"ne");function be(a,e){return(e.attempts??0)-(a.attempts??0)}c(be,"oe");var te=c(a=>{let e=(0,U.c)(8),{label:i,testId:d,value:f}=a,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==d||e[3]!==f?(l=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":d,children:f}),e[2]=d,e[3]=f,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o=(0,t.jsx)(A,{className:"flex-1 py-0",children:(0,t.jsxs)(T,{className:"flex flex-col gap-1 p-4",children:[r,l]})}),e[5]=r,e[6]=l,e[7]=o):o=e[7],o},"E"),ve=c(a=>{let e=(0,U.c)(25),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadStatus:d}=i,f=R(),r=M(),l=d===void 0,o;e[2]!==l?(o=["lunora-scheduler-status",l],e[2]=l,e[3]=o):o=e[3];let N;e[4]!==f||e[5]!==d?(N=c(async()=>{let j=await(d??(()=>f.schedulerStatus()))();return{...j,pools:j.pools.toSorted(xe)}},"y"),e[4]=f,e[5]=d,e[6]=N):N=e[6];let x=E(o,N),{data:n,error:s}=x,m;e[7]!==x?(m=c(()=>{x.refetch()},"d"),e[7]=x,e[8]=m):m=e[8],O(m,!0);let y;e[9]!==s?(y=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:s}),e[9]=s,e[10]=y):y=e[10];let k;e[11]!==n||e[12]!==r?(k=n!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(te,{label:r("backlog"),testId:"pools-backlog",value:n.backlog}),(0,t.jsx)(te,{label:r("in flight"),testId:"pools-inflight",value:n.inFlight}),(0,t.jsx)(te,{label:r("pools"),testId:"pools-count",value:n.pools.length})]}),e[11]=n,e[12]=r,e[13]=k):k=e[13];let g;e[14]!==n?.pools.length||e[15]!==r?(g=n?.pools.length===0&&(0,t.jsx)(_,{description:r("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:r("No workpools.")}),e[14]=n?.pools.length,e[15]=r,e[16]=g):g=e[16];let J;e[17]!==n||e[18]!==r?(J=n!==void 0&&n.pools.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"pools-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:r("pool")}),(0,t.jsx)(u,{children:r("queued")}),(0,t.jsx)(u,{children:r("in flight")}),(0,t.jsx)(u,{children:r("max concurrency")})]})}),(0,t.jsx)(z,{children:n.pools.map(ge)})]})})}),e[17]=n,e[18]=r,e[19]=J):J=e[19];let b;return e[20]!==y||e[21]!==k||e[22]!==g||e[23]!==J?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[y,k,g,J]}),e[20]=y,e[21]=k,e[22]=g,e[23]=J,e[24]=b):b=e[24],b},"ae");function xe(a,e){return e.queued-a.queued}c(xe,"ie");function ge(a){return(0,t.jsxs)(F,{"data-testid":`pools-row-${a.name}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:a.name}),(0,t.jsx)(p,{className:"tabular-nums",children:a.queued}),(0,t.jsxs)(p,{className:"tabular-nums",children:[a.inFlight," / ",a.maxConcurrency]}),(0,t.jsx)(p,{className:"tabular-nums",children:a.maxConcurrency})]},a.name)}c(ge,"de");var Ne=["jobs","dead","pools","cron"],Ve=c(a=>{let e=(0,U.c)(41),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadCronJobs:d,scheduledCancel:f,scheduledLoad:r}=i,l=M(),[o,N]=(0,Y.useState)("jobs"),x;e[2]!==l?(x=l("Cron triggers"),e[2]=l,e[3]=x):x=e[3];let n;e[4]!==l?(n=l("Dead letter"),e[4]=l,e[5]=n):n=e[5];let s;e[6]!==l?(s=l("Scheduled jobs"),e[6]=l,e[7]=s):s=e[7];let m;e[8]!==l?(m=l("Pools"),e[8]=l,e[9]=m):m=e[9];let y;e[10]!==x||e[11]!==n||e[12]!==s||e[13]!==m?(y={cron:x,dead:n,jobs:s,pools:m},e[10]=x,e[11]=n,e[12]=s,e[13]=m,e[14]=y):y=e[14];let k=y,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=c(w=>{N(w.currentTarget.dataset.view)},"f"),e[15]=g):g=e[15];let J=g,b;e[16]!==l?(b=l("Schedule view"),e[16]=l,e[17]=b):b=e[17];let j;e[18]!==o||e[19]!==k?(j=Ne.map(w=>(0,t.jsx)(ee,{"aria-selected":o===w,"data-testid":`schedule-view-${w}`,"data-view":w,onClick:J,role:"tab",size:"sm",type:"button",variant:o===w?"default":"outline",children:k[w]},w)),e[18]=o,e[19]=k,e[20]=j):j=e[20];let I;e[21]!==b||e[22]!==j?(I=(0,t.jsx)("div",{"aria-label":b,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:j}),e[21]=b,e[22]=j,e[23]=I):I=e[23];let q;e[24]!==f||e[25]!==r||e[26]!==o?(q=o==="jobs"&&(0,t.jsx)(de,{cancelJob:f,loadJobs:r}),e[24]=f,e[25]=r,e[26]=o,e[27]=q):q=e[27];let B;e[28]!==o?(B=o==="dead"&&(0,t.jsx)(fe,{}),e[28]=o,e[29]=B):B=e[29];let S;e[30]!==o?(S=o==="pools"&&(0,t.jsx)(ve,{}),e[30]=o,e[31]=S):S=e[31];let L;e[32]!==d||e[33]!==o?(L=o==="cron"&&(0,t.jsx)(ue,{loadCronJobs:d}),e[32]=d,e[33]=o,e[34]=L):L=e[34];let $;return e[35]!==I||e[36]!==q||e[37]!==B||e[38]!==S||e[39]!==L?($=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[I,q,B,S,L]}),e[35]=I,e[36]=q,e[37]=B,e[38]=S,e[39]=L,e[40]=$):$=e[40],$},"Ie");export{Ve as SchedulePanel};
1
+ import{a as O}from"./chunk-66UGPQVC.js";import{a as H}from"./chunk-PD6WIDY6.js";import{a as ee}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as Z}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as E}from"./chunk-7TRN7FQ4.js";import{f as R}from"./chunk-EAQZEXBX.js";import"./chunk-FSRSK4LY.js";import"./chunk-GETL6R4M.js";import{a as _}from"./chunk-FKVZRPV5.js";import{a as K,b as V,c as z,d as F,e as u,f as p}from"./chunk-HEAQVSNS.js";import{a as A,e as T}from"./chunk-WUWBZPUK.js";import{d as M,h as G,o as W,r as X}from"./chunk-FODLDLE2.js";import{a as c,d as P,e as oe,f as re,g as ae}from"./chunk-YKXDMIHQ.js";var U=P(re(),1),Y=P(oe(),1);var t=P(ae(),1);var se=P(re(),1);var Q=P(oe(),1);var h=P(ae(),1);var ie=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","X"),le=c(a=>a.toSorted((e,i)=>e.scheduledFor-i.scheduledFor),"F"),ce=c((a,e,i)=>e!==void 0?e:i===void 0?d=>a.cancelScheduledJob(d):void 0,"Y"),de=c(a=>{let e=(0,se.c)(16),{cancelJob:i,loadJobs:d}=a===void 0?{}:a,f=R(),r=M(),l=d===void 0,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["lunora-scheduled-jobs"],e[0]=o):o=e[0];let N=E(o,async()=>{let v=await(d??(()=>f.listScheduledJobs()))();return le(v)}),[x,n]=(0,Q.useState)(void 0),[s,m]=(0,Q.useState)(void 0),y,k;e[1]!==f||e[2]!==l?(y=c(()=>{if(l)return f.subscribeScheduledJobs(v=>{m(void 0),n(le(v))})},"v"),k=[l,f],e[1]=f,e[2]=l,e[3]=y,e[4]=k):(y=e[3],k=e[4]),(0,Q.useEffect)(y,k);let g;e[5]!==N?(g=c(()=>{N.refetch()},"y"),e[5]=N,e[6]=g):g=e[6],O(g,!l);let J=ce(f,i,d),b=x??N.data,j=s??N.error,I=c(async v=>{if(J!==void 0){m(void 0);try{await J(v),l||N.refetch()}catch(D){m(G(D))}}},"A"),q="flex flex-col gap-3",B="lunora-scheduled-jobs",S;e[7]!==j?(S=j!==null&&(0,h.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:j}),e[7]=j,e[8]=S):S=e[8];let L;e[9]!==b?.length||e[10]!==r?(L=b?.length===0&&(0,h.jsx)(_,{description:r("Jobs queued with runAfter / runAt will appear here."),icon:(0,h.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,h.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,h.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:r("No scheduled jobs.")}),e[9]=b?.length,e[10]=r,e[11]=L):L=e[11];let $=b!==void 0&&b.length>0&&(0,h.jsx)(A,{className:"overflow-hidden py-0",children:(0,h.jsx)(T,{className:"px-0",children:(0,h.jsxs)(K,{"data-testid":"sj-table",children:[(0,h.jsx)(V,{children:(0,h.jsxs)(F,{children:[(0,h.jsx)(u,{children:r("function")}),(0,h.jsx)(u,{children:r("scheduled for")}),(0,h.jsx)(u,{children:r("pool")}),(0,h.jsx)(u,{children:r("attempts")}),(0,h.jsx)(u,{children:r("shard")}),(0,h.jsx)(u,{children:r("id")}),J!==void 0&&(0,h.jsx)(u,{"aria-label":r("Actions")})]})}),(0,h.jsx)(z,{children:b.map(v=>(0,h.jsxs)(F,{"data-testid":`sj-row-${v.id}`,children:[(0,h.jsx)(p,{className:"font-mono text-xs",children:v.workflow??v.functionPath}),(0,h.jsx)(p,{className:"text-muted-foreground tabular-nums",children:ie(v.scheduledFor)}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.pool??""}),(0,h.jsx)(p,{className:"tabular-nums",children:v.attempts??0}),(0,h.jsx)(p,{children:v.shardKey??""}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.id}),J!==void 0&&(0,h.jsx)(p,{className:"text-right",children:(0,h.jsx)(H,{confirmLabel:r("Cancel job?"),onConfirm:c(()=>{W(I(v.id))},"onConfirm"),testId:`sj-cancel-${v.id}`,children:r("Cancel")})})]},v.id))})]})})}),w;return e[12]!==$||e[13]!==S||e[14]!==L?(w=(0,h.jsxs)("div",{className:q,"data-testid":B,children:[S,L,$]}),e[12]=$,e[13]=S,e[14]=L,e[15]=w):w=e[15],w},"he");var he={kind:"idle"},me=c((a,e,i)=>i!==void 0?i:e===void 0?d=>a.runCronJob(d):void 0,"re"),ue=c(({loadCronJobs:a,runCronJob:e}={})=>{let i=R(),d=M(),[f,r]=(0,Y.useState)({}),l=E(["lunora-cron-jobs",a?"custom":"default"],()=>(a??(()=>i.getCronJobs()))()),{data:o,error:N}=l,x=me(i,a,e),n=c(async s=>{if(x!==void 0){r(m=>({...m,[s]:{kind:"running"}}));try{await x(s),r(m=>({...m,[s]:{kind:"ok"}})),l.refetch()}catch(m){r(y=>({...y,[s]:{kind:"error",message:G(m)}}))}}},"i");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[N!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:N}),o?.length===0&&(0,t.jsx)(_,{description:d("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:d("No cron triggers.")}),o!==void 0&&o.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"cron-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:d("name")}),(0,t.jsx)(u,{children:d("schedule")}),(0,t.jsx)(u,{children:d("target")}),(0,t.jsx)(u,{children:d("shard")}),x!==void 0&&(0,t.jsx)(u,{"aria-label":d("Actions")})]})}),(0,t.jsx)(z,{children:o.map(s=>{let m=f[s.name]??he;return(0,t.jsxs)(F,{"data-testid":`cron-row-${s.name}`,children:[(0,t.jsx)(p,{children:s.name}),(0,t.jsx)(p,{className:"font-mono text-xs tabular-nums",children:s.cron}),(0,t.jsx)(p,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[s.workflow===void 0?(0,t.jsx)(Z,{variant:"outline",children:d("function")}):(0,t.jsx)(Z,{variant:"secondary",children:d("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.workflow??s.functionPath})]})}),(0,t.jsx)(p,{children:s.shardKey??""}),x!==void 0&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[m.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${s.name}`,children:d("ran")}),m.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${s.name}`,role:"alert",children:m.message}),(0,t.jsx)(H,{confirmLabel:d("Run now?"),disabled:m.kind==="running",onConfirm:c(()=>{W(n(s.name))},"onConfirm"),testId:`cron-run-${s.name}`,children:m.kind==="running"?d("Running\u2026"):d("Run now")})]})})]},`${s.cron}:${s.name}`)})})]})})})]})},"le"),pe=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","se"),fe=c(a=>{let e=(0,U.c)(34),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadJobs:d,removeJob:f,retryJob:r}=i,l=R(),o=M(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let x;e[3]!==l||e[4]!==d?(x=c(async()=>(await(d??(()=>l.listDeadJobs()))()).toSorted(be),"h"),e[3]=l,e[4]=d,e[5]=x):x=e[5];let n=E(N,x),s=n.data,[m,y]=(0,Y.useState)(void 0),k=n.error??m,g=d===void 0,J;e[6]!==l||e[7]!==g||e[8]!==r?(J=r??(g?C=>l.retryDeadJob(C):void 0),e[6]=l,e[7]=g,e[8]=r,e[9]=J):J=e[9];let b=J,j;e[10]!==l||e[11]!==g||e[12]!==f?(j=f??(g?C=>l.removeDeadJob(C):void 0),e[10]=l,e[11]=g,e[12]=f,e[13]=j):j=e[13];let I=j,q;e[14]!==n?(q=c(()=>{n.refetch()},"$"),e[14]=n,e[15]=q):q=e[15],O(q,!0);let B;e[16]!==n?(B=c(async C=>{y(void 0);try{await C,n.refetch()}catch(ne){y(G(ne))}},"I"),e[16]=n,e[17]=B):B=e[17];let S=B,L=b!==void 0||I!==void 0,$;e[18]!==k?($=k!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:k}),e[18]=k,e[19]=$):$=e[19];let w;e[20]!==s?.length||e[21]!==o?(w=s?.length===0&&(0,t.jsx)(_,{description:o("Jobs that exhaust their retry budget are parked here instead of being dropped."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:o("No dead-letter jobs.")}),e[20]=s?.length,e[21]=o,e[22]=w):w=e[22];let v;e[23]!==S||e[24]!==L||e[25]!==s||e[26]!==I||e[27]!==b||e[28]!==o?(v=s!==void 0&&s.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"dlq-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:o("function")}),(0,t.jsx)(u,{children:o("attempts")}),(0,t.jsx)(u,{children:o("last tried")}),(0,t.jsx)(u,{children:o("pool")}),(0,t.jsx)(u,{children:o("shard")}),(0,t.jsx)(u,{children:o("id")}),L&&(0,t.jsx)(u,{"aria-label":o("Actions")})]})}),(0,t.jsx)(z,{children:s.map(C=>(0,t.jsxs)(F,{"data-testid":`dlq-row-${C.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:C.workflow??C.functionPath}),(0,t.jsx)(p,{className:"tabular-nums",children:C.attempts??0}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:pe(C.scheduledFor)}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.pool??""}),(0,t.jsx)(p,{children:C.shardKey??""}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.id}),L&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[b!==void 0&&(0,t.jsx)(ee,{"data-testid":`dlq-retry-${C.id}`,onClick:c(()=>{W(S(b(C.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:o("Retry")}),I!==void 0&&(0,t.jsx)(H,{confirmLabel:o("Drop job?"),onConfirm:c(()=>{W(S(I(C.id)))},"onConfirm"),testId:`dlq-remove-${C.id}`,children:o("Drop")})]})})]},C.id))})]})})}),e[23]=S,e[24]=L,e[25]=s,e[26]=I,e[27]=b,e[28]=o,e[29]=v):v=e[29];let D;return e[30]!==v||e[31]!==$||e[32]!==w?(D=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[$,w,v]}),e[30]=v,e[31]=$,e[32]=w,e[33]=D):D=e[33],D},"ne");function be(a,e){return(e.attempts??0)-(a.attempts??0)}c(be,"oe");var te=c(a=>{let e=(0,U.c)(8),{label:i,testId:d,value:f}=a,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==d||e[3]!==f?(l=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":d,children:f}),e[2]=d,e[3]=f,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o=(0,t.jsx)(A,{className:"flex-1 py-0",children:(0,t.jsxs)(T,{className:"flex flex-col gap-1 p-4",children:[r,l]})}),e[5]=r,e[6]=l,e[7]=o):o=e[7],o},"E"),ve=c(a=>{let e=(0,U.c)(25),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadStatus:d}=i,f=R(),r=M(),l=d===void 0,o;e[2]!==l?(o=["lunora-scheduler-status",l],e[2]=l,e[3]=o):o=e[3];let N;e[4]!==f||e[5]!==d?(N=c(async()=>{let j=await(d??(()=>f.schedulerStatus()))();return{...j,pools:j.pools.toSorted(xe)}},"y"),e[4]=f,e[5]=d,e[6]=N):N=e[6];let x=E(o,N),{data:n,error:s}=x,m;e[7]!==x?(m=c(()=>{x.refetch()},"d"),e[7]=x,e[8]=m):m=e[8],O(m,!0);let y;e[9]!==s?(y=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:s}),e[9]=s,e[10]=y):y=e[10];let k;e[11]!==n||e[12]!==r?(k=n!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(te,{label:r("backlog"),testId:"pools-backlog",value:n.backlog}),(0,t.jsx)(te,{label:r("in flight"),testId:"pools-inflight",value:n.inFlight}),(0,t.jsx)(te,{label:r("pools"),testId:"pools-count",value:n.pools.length})]}),e[11]=n,e[12]=r,e[13]=k):k=e[13];let g;e[14]!==n?.pools.length||e[15]!==r?(g=n?.pools.length===0&&(0,t.jsx)(_,{description:r("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:r("No workpools.")}),e[14]=n?.pools.length,e[15]=r,e[16]=g):g=e[16];let J;e[17]!==n||e[18]!==r?(J=n!==void 0&&n.pools.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"pools-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:r("pool")}),(0,t.jsx)(u,{children:r("queued")}),(0,t.jsx)(u,{children:r("in flight")}),(0,t.jsx)(u,{children:r("max concurrency")})]})}),(0,t.jsx)(z,{children:n.pools.map(ge)})]})})}),e[17]=n,e[18]=r,e[19]=J):J=e[19];let b;return e[20]!==y||e[21]!==k||e[22]!==g||e[23]!==J?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[y,k,g,J]}),e[20]=y,e[21]=k,e[22]=g,e[23]=J,e[24]=b):b=e[24],b},"ae");function xe(a,e){return e.queued-a.queued}c(xe,"ie");function ge(a){return(0,t.jsxs)(F,{"data-testid":`pools-row-${a.name}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:a.name}),(0,t.jsx)(p,{className:"tabular-nums",children:a.queued}),(0,t.jsxs)(p,{className:"tabular-nums",children:[a.inFlight," / ",a.maxConcurrency]}),(0,t.jsx)(p,{className:"tabular-nums",children:a.maxConcurrency})]},a.name)}c(ge,"de");var Ne=["jobs","dead","pools","cron"],Ve=c(a=>{let e=(0,U.c)(41),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadCronJobs:d,scheduledCancel:f,scheduledLoad:r}=i,l=M(),[o,N]=(0,Y.useState)("jobs"),x;e[2]!==l?(x=l("Cron triggers"),e[2]=l,e[3]=x):x=e[3];let n;e[4]!==l?(n=l("Dead letter"),e[4]=l,e[5]=n):n=e[5];let s;e[6]!==l?(s=l("Scheduled jobs"),e[6]=l,e[7]=s):s=e[7];let m;e[8]!==l?(m=l("Pools"),e[8]=l,e[9]=m):m=e[9];let y;e[10]!==x||e[11]!==n||e[12]!==s||e[13]!==m?(y={cron:x,dead:n,jobs:s,pools:m},e[10]=x,e[11]=n,e[12]=s,e[13]=m,e[14]=y):y=e[14];let k=y,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=c(w=>{N(w.currentTarget.dataset.view)},"f"),e[15]=g):g=e[15];let J=g,b;e[16]!==l?(b=l("Schedule view"),e[16]=l,e[17]=b):b=e[17];let j;e[18]!==o||e[19]!==k?(j=Ne.map(w=>(0,t.jsx)(ee,{"aria-selected":o===w,"data-testid":`schedule-view-${w}`,"data-view":w,onClick:J,role:"tab",size:"sm",type:"button",variant:o===w?"default":"outline",children:k[w]},w)),e[18]=o,e[19]=k,e[20]=j):j=e[20];let I;e[21]!==b||e[22]!==j?(I=(0,t.jsx)("div",{"aria-label":b,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:j}),e[21]=b,e[22]=j,e[23]=I):I=e[23];let q;e[24]!==f||e[25]!==r||e[26]!==o?(q=o==="jobs"&&(0,t.jsx)(de,{cancelJob:f,loadJobs:r}),e[24]=f,e[25]=r,e[26]=o,e[27]=q):q=e[27];let B;e[28]!==o?(B=o==="dead"&&(0,t.jsx)(fe,{}),e[28]=o,e[29]=B):B=e[29];let S;e[30]!==o?(S=o==="pools"&&(0,t.jsx)(ve,{}),e[30]=o,e[31]=S):S=e[31];let L;e[32]!==d||e[33]!==o?(L=o==="cron"&&(0,t.jsx)(ue,{loadCronJobs:d}),e[32]=d,e[33]=o,e[34]=L):L=e[34];let $;return e[35]!==I||e[36]!==q||e[37]!==B||e[38]!==S||e[39]!==L?($=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[I,q,B,S,L]}),e[35]=I,e[36]=q,e[37]=B,e[38]=S,e[39]=L,e[40]=$):$=e[40],$},"Ie");export{Ve as SchedulePanel};