@lunora/studio 1.0.0-alpha.391 → 1.0.0-alpha.393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/packem_chunks/SchemaViewer.mjs +1 -1
- package/dist/packem_chunks/ai-knowledge.mjs +1 -1
- package/dist/packem_chunks/architecture-panel.mjs +1 -1
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
- package/dist/packem_chunks/migrations-route.mjs +1 -1
- package/dist/packem_shared/diagram-export-panel-CleSOm6J.mjs +2 -0
- package/dist/packem_shared/{schema-diagram-Dbs7-jSJ.mjs → schema-diagram-BpIBRUm6.mjs} +1 -1
- package/dist/standalone/{chunk-NNKVZBKP.js → chunk-26RNXTU3.js} +1 -1
- package/dist/standalone/{chunk-E7QYOQWH.js → chunk-2Q4WVEPB.js} +1 -1
- package/dist/standalone/{chunk-7WGZSDRS.js → chunk-2ZNMZPPZ.js} +1 -1
- package/dist/standalone/{chunk-3WYPRZY3.js → chunk-3BDGZAZD.js} +1 -1
- package/dist/standalone/{chunk-UL5XVKGR.js → chunk-3GBBYV7C.js} +1 -1
- package/dist/standalone/{chunk-FKF2BRRN.js → chunk-4OWWWAMB.js} +1 -1
- package/dist/standalone/{chunk-MKH4V2DR.js → chunk-4WFEKKAZ.js} +1 -1
- package/dist/standalone/{chunk-V5TGDG6U.js → chunk-4Z2GLDF7.js} +1 -1
- package/dist/standalone/{chunk-K2LXQ3LS.js → chunk-5BTQ4VV2.js} +1 -1
- package/dist/standalone/{chunk-VQQEDEHH.js → chunk-5FHGTA7V.js} +1 -1
- package/dist/standalone/chunk-5J2UX2CO.js +1 -0
- package/dist/standalone/{chunk-EYSF4DHD.js → chunk-5XQM44J7.js} +1 -1
- package/dist/standalone/{chunk-23MMGFHI.js → chunk-5YEMXXQZ.js} +1 -1
- package/dist/standalone/chunk-6KIDLGYM.js +1 -0
- package/dist/standalone/{chunk-BULGXI7X.js → chunk-7URG6FZD.js} +1 -1
- package/dist/standalone/{chunk-Y5QMX4YG.js → chunk-7XZENNML.js} +1 -1
- package/dist/standalone/{chunk-4ZEERXMN.js → chunk-A33FOU2H.js} +1 -1
- package/dist/standalone/{chunk-EHU26D2V.js → chunk-A7L3PZEL.js} +1 -1
- package/dist/standalone/{chunk-3IGIBOCF.js → chunk-ADOZBBJC.js} +1 -1
- package/dist/standalone/{chunk-Z3AINTU6.js → chunk-AFUJCRWR.js} +1 -1
- package/dist/standalone/{chunk-CFQQHZYU.js → chunk-AWMHWVF7.js} +1 -1
- package/dist/standalone/chunk-B5YCFPYG.js +1 -0
- package/dist/standalone/{chunk-PPC2ESMI.js → chunk-BADHCM45.js} +1 -1
- package/dist/standalone/{chunk-NAGIOR23.js → chunk-BCT3KY76.js} +1 -1
- package/dist/standalone/{chunk-LIZUJ6AU.js → chunk-BFV46XUH.js} +1 -1
- package/dist/standalone/chunk-BMGMBZAW.js +1 -0
- package/dist/standalone/{chunk-FR22DHUN.js → chunk-BTHVLHPT.js} +1 -1
- package/dist/standalone/{chunk-ZLAVM2NT.js → chunk-BUYKTV27.js} +1 -1
- package/dist/standalone/{chunk-W7CLOQOU.js → chunk-BZP4FOID.js} +1 -1
- package/dist/standalone/{chunk-KRSQ6N4R.js → chunk-C4PC3TVC.js} +1 -1
- package/dist/standalone/chunk-C57KLL4U.js +1 -0
- package/dist/standalone/{chunk-GERWUNAM.js → chunk-CBFVQCWS.js} +1 -1
- package/dist/standalone/{chunk-ZQ7KYIN6.js → chunk-D4CP2AUO.js} +1 -1
- package/dist/standalone/chunk-DMQVY5L7.js +1 -0
- package/dist/standalone/{chunk-I2XT2POX.js → chunk-DRSX6KR3.js} +1 -1
- package/dist/standalone/{chunk-QJFCK6J4.js → chunk-DUICFFES.js} +1 -1
- package/dist/standalone/{chunk-BBJJJI7F.js → chunk-E32WBVTB.js} +1 -1
- package/dist/standalone/{chunk-SQ3M7JDP.js → chunk-EBGXOUAO.js} +1 -1
- package/dist/standalone/{chunk-CBTPJPCZ.js → chunk-ECXQQPVU.js} +1 -1
- package/dist/standalone/{chunk-Y34WXKCA.js → chunk-EEDAK4NS.js} +1 -1
- package/dist/standalone/{chunk-TS4CMM2L.js → chunk-EH53XOVI.js} +1 -1
- package/dist/standalone/chunk-EOHXBC4U.js +1 -0
- package/dist/standalone/chunk-EOTHFTZG.js +1 -0
- package/dist/standalone/{chunk-QHVUXMRV.js → chunk-EUNTXABP.js} +1 -1
- package/dist/standalone/{chunk-MAWEZEX6.js → chunk-EYFAYJYD.js} +1 -1
- package/dist/standalone/{chunk-N7FOBAV3.js → chunk-F4NZZ3LK.js} +1 -1
- package/dist/standalone/chunk-FRKRT73U.js +1 -0
- package/dist/standalone/chunk-FSY7UKMG.js +1 -0
- package/dist/standalone/chunk-G4H5DPO6.js +33 -0
- package/dist/standalone/chunk-GATWEWRW.js +1 -0
- package/dist/standalone/{chunk-APCHI5CD.js → chunk-HCLUIJMW.js} +1 -1
- package/dist/standalone/{chunk-HQZ7B5EU.js → chunk-HE2XT2P7.js} +1 -1
- package/dist/standalone/{chunk-LOEVTOKP.js → chunk-HLN47VMG.js} +1 -1
- package/dist/standalone/{chunk-EAYN3IGE.js → chunk-HPCOC223.js} +1 -1
- package/dist/standalone/chunk-HPQLTLIE.js +1 -0
- package/dist/standalone/chunk-HQJXQWJM.js +1 -0
- package/dist/standalone/{chunk-LLD7TMBV.js → chunk-HXWW3XML.js} +1 -1
- package/dist/standalone/{chunk-EMZ7RPR3.js → chunk-IC2PEYF7.js} +1 -1
- package/dist/standalone/chunk-J2SIGUHW.js +8 -0
- package/dist/standalone/chunk-JCJCUWVN.js +1 -0
- package/dist/standalone/chunk-JEJV6SVN.js +1 -0
- package/dist/standalone/chunk-JSVT5VBU.js +1 -0
- package/dist/standalone/chunk-JXW6H6LE.js +1 -0
- package/dist/standalone/{chunk-2G7JHC6S.js → chunk-K3HWPNON.js} +1 -1
- package/dist/standalone/{chunk-MNN3YCKF.js → chunk-KEHWNM7Q.js} +1 -1
- package/dist/standalone/chunk-KJHVB5KM.js +1 -0
- package/dist/standalone/{chunk-73D52JHL.js → chunk-KQ6YQP3Z.js} +1 -1
- package/dist/standalone/{chunk-6C555TU5.js → chunk-LUHBGCMO.js} +1 -1
- package/dist/standalone/{chunk-W5BTAOHO.js → chunk-M6WDFEUZ.js} +1 -1
- package/dist/standalone/{chunk-HB6ABGZU.js → chunk-MEYZIZGX.js} +1 -1
- package/dist/standalone/{chunk-FKAOFBS3.js → chunk-MLX6ME3Q.js} +1 -1
- package/dist/standalone/{chunk-KZXAVLQ4.js → chunk-N3MKRANL.js} +1 -1
- package/dist/standalone/{chunk-H6VTIXVB.js → chunk-N7TSSCGF.js} +1 -1
- package/dist/standalone/{chunk-FGHKL42J.js → chunk-NFIFRB3W.js} +2 -2
- package/dist/standalone/{chunk-WXZ334CL.js → chunk-OEPNNICC.js} +1 -1
- package/dist/standalone/chunk-OZUPOUHR.js +1 -0
- package/dist/standalone/chunk-PLCYDHU3.js +7 -0
- package/dist/standalone/{chunk-DRFBJBEN.js → chunk-PT4GNZU7.js} +1 -1
- package/dist/standalone/chunk-PVQDT47U.js +1 -0
- package/dist/standalone/{chunk-V3DOKU22.js → chunk-PWHUPKZB.js} +1 -1
- package/dist/standalone/{chunk-YYJGL32M.js → chunk-QJ3M3IQW.js} +1 -1
- package/dist/standalone/{chunk-LQWEU5ZI.js → chunk-QRXJTY2S.js} +1 -1
- package/dist/standalone/chunk-R76ATTPC.js +1 -0
- package/dist/standalone/{chunk-WMKSIEJP.js → chunk-RIRXDYLA.js} +1 -1
- package/dist/standalone/{chunk-UYW53K2N.js → chunk-RRIRWVQY.js} +1 -1
- package/dist/standalone/{chunk-WODOEE2A.js → chunk-S3HFNWDK.js} +1 -1
- package/dist/standalone/{chunk-O66HDCZT.js → chunk-S3WL3QZ2.js} +1 -1
- package/dist/standalone/{chunk-LMCBMC2V.js → chunk-SOESES7K.js} +1 -1
- package/dist/standalone/chunk-SQO3WGXH.js +3 -0
- package/dist/standalone/chunk-T6YZEXZO.js +1 -0
- package/dist/standalone/{chunk-W6UUGZH7.js → chunk-TAZRDWQE.js} +1 -1
- package/dist/standalone/{chunk-KYZZGUIG.js → chunk-TDF4VVIF.js} +1 -1
- package/dist/standalone/{chunk-VJGP3BTD.js → chunk-TIFTYP3Z.js} +1 -1
- package/dist/standalone/{chunk-WLMTK3FN.js → chunk-TNQHMR76.js} +1 -1
- package/dist/standalone/{chunk-NMZ34D2Z.js → chunk-U4ZQVQZA.js} +1 -1
- package/dist/standalone/{chunk-BHUWAGFN.js → chunk-UB6S6VYI.js} +1 -1
- package/dist/standalone/chunk-UG6ZNYWH.js +167 -0
- package/dist/standalone/{chunk-H54J65DJ.js → chunk-UHFZV34O.js} +1 -1
- package/dist/standalone/{chunk-HMMALUXM.js → chunk-V5ZKAZR6.js} +1 -1
- package/dist/standalone/chunk-VEG327ST.js +63 -0
- package/dist/standalone/{chunk-4RII5S3H.js → chunk-VLQU4G6O.js} +1 -1
- package/dist/standalone/{chunk-SKK6PGQ3.js → chunk-VND72OIC.js} +1 -1
- package/dist/standalone/{chunk-XV2XEUUB.js → chunk-VUMS4VIV.js} +1 -1
- package/dist/standalone/{chunk-2QYMVMYR.js → chunk-VUWHTKLJ.js} +1 -1
- package/dist/standalone/{chunk-LLSK6QBX.js → chunk-WARWYT4K.js} +1 -1
- package/dist/standalone/{chunk-ZJIYJZ6F.js → chunk-WVAWKCNQ.js} +1 -1
- package/dist/standalone/{chunk-ZPQBVYNN.js → chunk-WY23EROJ.js} +1 -1
- package/dist/standalone/{chunk-Q6VRHDZJ.js → chunk-XWLURY4U.js} +1 -1
- package/dist/standalone/{chunk-ADS4BJ7K.js → chunk-Y4KOJPOW.js} +1 -1
- package/dist/standalone/chunk-YC3TUO5H.js +1 -0
- package/dist/standalone/{chunk-7Z5MTBZB.js → chunk-YQEIOEEC.js} +1 -1
- package/dist/standalone/{chunk-GTJYJW4A.js → chunk-YQI2YAD7.js} +1 -1
- package/dist/standalone/{chunk-PTL32GA6.js → chunk-YREHZBTG.js} +1 -1
- package/dist/standalone/chunk-YWGOETFP.js +1 -0
- package/dist/standalone/chunk-ZARTCW6W.js +1 -0
- package/dist/standalone/chunk-ZBMHFOK2.js +1 -0
- package/dist/standalone/{chunk-NTVQ4PWU.js → chunk-ZG6VEBVA.js} +1 -1
- package/dist/standalone/{chunk-SKMAKUOG.js → chunk-ZSXJJYWN.js} +1 -1
- package/dist/standalone/chunk-ZUFBUWT4.js +1 -0
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +2 -2
- package/package.json +11 -11
- package/dist/packem_shared/diagram-export-panel-miFPsocM.mjs +0 -2
- package/dist/standalone/chunk-24N5RZRI.js +0 -1
- package/dist/standalone/chunk-2D4WBSDO.js +0 -3
- package/dist/standalone/chunk-2ZJJH4YN.js +0 -33
- package/dist/standalone/chunk-3K56NZDT.js +0 -1
- package/dist/standalone/chunk-4SY2N2RS.js +0 -1
- package/dist/standalone/chunk-4YWFAODW.js +0 -1
- package/dist/standalone/chunk-ATBPQT7F.js +0 -1
- package/dist/standalone/chunk-B3GOYA2R.js +0 -1
- package/dist/standalone/chunk-BWHVY6L6.js +0 -1
- package/dist/standalone/chunk-C6FOSG2A.js +0 -7
- package/dist/standalone/chunk-CDJMXV45.js +0 -1
- package/dist/standalone/chunk-CP3LCFFM.js +0 -8
- package/dist/standalone/chunk-CQDENTSP.js +0 -1
- package/dist/standalone/chunk-EGUFPKS4.js +0 -1
- package/dist/standalone/chunk-EZMAQE3T.js +0 -59
- package/dist/standalone/chunk-IL64HWFW.js +0 -1
- package/dist/standalone/chunk-IPDJJHZK.js +0 -1
- package/dist/standalone/chunk-IQ5CIBXJ.js +0 -1
- package/dist/standalone/chunk-JQBVRWFN.js +0 -1
- package/dist/standalone/chunk-L27FKJTG.js +0 -1
- package/dist/standalone/chunk-MHZNDDGI.js +0 -1
- package/dist/standalone/chunk-O5QATFN3.js +0 -159
- package/dist/standalone/chunk-OG7AJWFV.js +0 -1
- package/dist/standalone/chunk-OZID3UYF.js +0 -1
- package/dist/standalone/chunk-PDBW6GTJ.js +0 -1
- package/dist/standalone/chunk-QF743FSL.js +0 -1
- package/dist/standalone/chunk-R3RIZDUS.js +0 -1
- package/dist/standalone/chunk-SCTYLLJT.js +0 -1
- package/dist/standalone/chunk-Y6OVSHPH.js +0 -1
- package/dist/standalone/chunk-YDFZA3T4.js +0 -1
- package/dist/standalone/chunk-YLC2ZYCL.js +0 -1
- package/dist/standalone/chunk-YNCZVYCO.js +0 -1
- /package/dist/standalone/{chunk-OWRWDDJT.js → chunk-HXFXD5EP.js} +0 -0
- /package/dist/standalone/{chunk-T7UKRA6J.js → chunk-QBBNGQJA.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as o}from"./chunk-DMQVY5L7.js";import{a as p}from"./chunk-ADABTCDI.js";import{a as r,d as i}from"./chunk-5PEAXTYQ.js";var a=i(p(),1);var R=a.forwardRef(r(function(e,n){let{className:l,render:m,orientation:t="horizontal",style:f,...s}=e;return o("div",e,{state:{orientation:t},ref:n,props:[{role:"separator","aria-orientation":t},s]})},"SeparatorComponent"));export{R as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{F as ve,L as Ze,M as xe,N as et,O as tt,Q as rt,c as Q,g as Xe,h as Ge,n as Qe}from"./chunk-R76ATTPC.js";import{f as $e,g as Je,u as V,v as T,w as be,x as qe}from"./chunk-JEJV6SVN.js";import{a as ie,b as He,f as O,h as ge,i as J}from"./chunk-DMQVY5L7.js";import{x as ze}from"./chunk-G4H5DPO6.js";import{a as wt}from"./chunk-A6TVTNKO.js";import{a as k,b as ae}from"./chunk-ADABTCDI.js";import{a as t,c as Ot,d as E}from"./chunk-5PEAXTYQ.js";var Nt=E(wt(),1);var Dt=E(k(),1);var Me={};Ot(Me,{Control:()=>It,Description:()=>Ft,Error:()=>vt,Item:()=>ht,Label:()=>gt,Root:()=>bt,Validity:()=>Vt});var w=E(k(),1);var Fe=E(k(),1);var ot="data-valid",it="data-invalid";var se={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},At={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},at={disabled:!1,...At},H={valid(r){return r===null?null:r?{[ot]:""}:{[it]:""}}};var _t={invalid:void 0,name:void 0,validityData:{state:se,errors:[],error:"",value:"",initialValue:null},setValidityData:O,disabled:void 0,setTouched:O,setDirty:O,setFilled:O,setFocused:O,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:t(()=>!1,"shouldValidateOnChange"),state:at,registerFieldControl:O,validation:{getValidationProps:t((r,e=ge)=>e,"getValidationProps"),inputRef:{current:null},registeredInputs:new Map,registerInput:O,getInputControl:t(()=>null,"getInputControl"),commit:t(async()=>{},"commit"),change:O}},Oe=Fe.createContext(_t);function j(r=!0){let e=Fe.useContext(Oe);if(e.setValidityData===O&&!r)throw new Error(be(28));return e}t(j,"useFieldRootContext");var Ce=E(k(),1);var Pt=Ce.createContext(void 0);function st(r=!1){let e=Ce.useContext(Pt);if(!e&&!r)throw new Error(be(86));return e}t(st,"useFieldsetRootContext");var ye=E(k(),1);var kt=ye.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:O,validationMode:"onSubmit",submitCountRef:{current:0}});function Z(){return ye.useContext(kt)}t(Z,"useFormContext");var ne=E(k(),1);var Ie=E(k(),1);var we=Ie.createContext({controlId:void 0,registerControlId:O,resetControlId:O,labelId:void 0,setLabelId:O,messageIds:[],setMessageIds:O,getDescriptionProps:t(r=>r,"getDescriptionProps")});function B(){return Ie.useContext(we)}t(B,"useLabelableContext");var lt=E(ae(),1);var Ee=t(function(e){let o=Q(),[a,u]=ne.useState(o),[s,i]=ne.useState(),[f,p]=ne.useState([]),c=a===void 0?o:a,l=ie(()=>new Map),{messageIds:b}=B(),x=V((h,y)=>{let v=l.current;y===void 0?v.delete(h):v.set(h,y),u(A=>{if(v.size===0)return A;let U;for(let n of v.values()){if(n===A)return A;U===void 0&&(U=n)}return U})}),R=V(()=>{l.current.size===0&&u(o)}),g=ne.useCallback(h=>{let y=h["aria-describedby"]?h["aria-describedby"].split(" "):[];return y.push(...b,...f),{...h,"aria-describedby":Array.from(new Set(y)).join(" ")||void 0}},[b,f]),S=ne.useMemo(()=>({controlId:c,registerControlId:x,resetControlId:R,labelId:s,setLabelId:i,messageIds:f,setMessageIds:p,getDescriptionProps:g}),[c,x,R,s,i,f,p,g]);return(0,lt.jsx)(we.Provider,{value:S,children:e.children})},"LabelableProvider");var Ae=E(k(),1);function dt(r={}){let{id:e,enabled:o=!0}=r,{controlId:a,registerControlId:u,resetControlId:s}=B(),i=Q(),f=ie(()=>Symbol()),p=Ae.useRef(!1),c=Ae.useRef(!1),l=V(()=>{!p.current||u===O||(p.current=!1,u(f.current,void 0))});return T(()=>{if(!o||u===O){l();return}let b;if(e!==void 0)c.current=!0,b=e;else if(c.current)b=i;else{s();return}if(b===void 0){l();return}p.current=!0,u(f.current,b)},[e,o,u,s,i,f,l]),T(()=>l,[l]),(o?a:void 0)??e??i}t(dt,"useLabelableId");function ut(r,e){let o=Q(r);return T(()=>(e(o),()=>{e(a=>a===o?void 0:a)}),[o,e]),o}t(ut,"useRegisteredLabelId");function ct(r={}){let{id:e,fallbackControlId:o,native:a=!1,setLabelId:u,focusControl:s}=r,{controlId:i,setLabelId:f}=B(),p=V(R=>{f(R),u?.(R)}),c=ut(e,p),l=i??o;function b(R){if(s){s(R,l);return}if(!l)return;let g=Ut(R.currentTarget,l);$e(g)&&jt(g)}t(b,"focusControl");function x(R){let g=Ge(R.nativeEvent);Xe(g,"button,input,select,textarea")||(!R.defaultPrevented&&R.detail>1&&R.preventDefault(),!a&&b(R))}return t(x,"handleInteraction"),a?{id:c,htmlFor:l,onMouseDown:x}:{id:c,onClick:x,onPointerDown(R){R.preventDefault()}}}t(ct,"useLabel");function Ut(r,e){let o=r.getRootNode();for(;Je(o);){let a=o.getElementById(e);if(a)return a;o=o.host.getRootNode()}return qe(r).getElementById(e)}t(Ut,"getControlById");function jt(r){r.focus({focusVisible:!0})}t(jt,"focusElementWithVisible");var re=E(k(),1);function le(r,e){return{...r,state:{...r.state,valid:!e&&r.state.valid}}}t(le,"getCombinedFieldValidityData");var _e=Object.keys(se);function Bt(r,e){return r.matches(":disabled")?!1:!e||r.form===e?!0:r.form===null&&!r.hasAttribute("form")}t(Bt,"isEligibleInput");function ft(r,e){let o=null;for(let a of r.keys())if(Bt(a,e)){if(!a.validity.valid)return a;o??=a}return o}t(ft,"findRepresentativeInput");function mt(r){return{...se,valid:!r,customError:r}}t(mt,"makeState");function Pe(r){return r&&r.validationMessage?[r.validationMessage]:[]}t(Pe,"getNativeErrors");function pt(r){let{elementRef:e,formRef:o}=Z(),{setValidityData:a,validate:u,validityData:s,validationDebounceTime:i,invalid:f,markedDirtyRef:p,state:c,shouldValidateOnChange:l,validationMode:b,registeredFieldIdRef:x}=r,{controlId:R,getDescriptionProps:g}=B(),S=ve(),h=re.useRef(null),y=ie(()=>new Map).current,v=re.useRef(0),A=re.useRef(null),U=re.useCallback((M,_)=>(y.set(M,_),()=>{y.delete(M)}),[y]),n=V(()=>{let M=ft(y,e.current);return M&&y.get(M)?.controlRef.current||null}),m=V(async(M,_=!1)=>{v.current+=1;let D=v.current;function X(d,C=f){let N=x.current??R;if(N==null)return;let I=o.current.fields.get(N);if(!I)return;let z=le(d,C);o.current.fields.set(N,{...I,validityData:z})}t(X,"updateRegisteredFieldValidity");function ee(d,C){let N=d.valid===!1?C:[];return{value:M,state:d,error:N[0]??"",errors:N,initialValue:s.initialValue}}t(ee,"makeValidityData");function oe(d,C){let N=d.validity.customError?d.validationMessage:"",I=C.replace(/\r\n?/g,`
|
|
2
|
+
`);d.setCustomValidity(I),A.current=[d,I,N]}t(oe,"setCustomValidity");function $(){let d=A.current;A.current=null,d&&(!d[0].willValidate||d[0].validationMessage===d[1])&&d[0].setCustomValidity(d[2])}t($,"clearCustomValidity");function L(d,C,N){let I=ee(d,C);X(I,N),a(I)}t(L,"publish");function G(d){let C=_e.reduce((I,z)=>(I[z]=d.validity[z],I),{}),N=!1;for(let I of _e)if(I!=="valid"){if(I==="valueMissing"&&C[I])N=!0;else if(C[I])return C}return N&&!p.current&&(C.valid=!0,C.valueMissing=!1),C}t(G,"getState");function te(){return y.size>0?ft(y,e.current):h.current}t(te,"resolveRepresentativeInput");let W=te();function ue(){return W=te(),W?.willValidate?G(W):mt(!1)}if(t(ue,"refreshState"),_){if(c.valid!==!1||!W)return;if(!W.validity.valueMissing){$();let d=te(),C=d?.validity.customError?Pe(d):[];L(mt(C.length>0),C,!1);return}for(let d of _e)if(d!=="valid"&&d!=="valueMissing"&&d!=="customError"&&W.validity[d])return}S.clear(),$();let Y=ue(),F=Pe(W),K=l();if(F.length===0||K){let d=Array.from(o.current.fields.values()).reduce((I,z)=>(z.name&&(I[z.name]=z.getValue()),I),{}),C=u(M,d),N;if(typeof C=="object"&&C!==null&&"then"in C){if(Y.valid===!1?L(Y,F):(b==="onSubmit"||!s.state.customError)&&(Y.valid=null,L(Y,F)),N=await C,D!==v.current)return;Y=ue()}else N=C;F=N?[].concat(N).filter(Boolean):[],F.length>0?(Y.valid=!1,Y.customError=!0,W?.willValidate&&oe(W,F.join(`
|
|
3
|
+
`))):F=Pe(W)}L(Y,F)}),P=V((M,_=!1)=>{if(S.clear(),v.current+=1,_)return;let D=l();D&&M!==""&&i?S.start(i,()=>{m(M)}):m(M,!D)}),q=re.useCallback((M,_={})=>He(g(_),c.valid===!1&&!c.disabled&&!M?{"aria-invalid":!0}:ge),[g,c.disabled,c.valid]);return re.useMemo(()=>({getValidationProps:q,inputRef:h,registeredInputs:y,registerInput:U,getInputControl:n,commit:m,change:P}),[q,y,U,n,m,P])}t(pt,"useFieldValidation");var Ve=E(k(),1);function Rt(r){let{change:e,commit:o,invalid:a,markedDirtyRef:u,name:s,setRegisteredFieldName:i,registeredFieldIdRef:f,setValidityData:p,validityData:c}=r,{formRef:l}=Z(),b=Ve.useRef(null),x=Ve.useRef(null),R=Ve.useRef(!1),g=V(()=>{let n=x.current;if(n)return n.getValue?n.getValue():n.value});function S(n){return n.value===void 0?g():n.value}t(S,"getRegistrationValue");let h=V(()=>{let n=x.current;if(u.current=!0,!n){o(c.value);return}o(S(n))});function y(){let n=x.current;!n||!n.id||l.current.fields.set(n.id,{getValue:g,name:s??n.name,controlRef:n.controlRef,validityData:le(c,a),validate:h})}t(y,"refreshRegistration");function v(n=x.current?.id){n&&l.current.fields.delete(n)}t(v,"deleteRegistration");function A(n){if(R.current)return;R.current=!0;let m=S(n);p(P=>P.initialValue===m?P:{...P,initialValue:m})}t(A,"captureInitialValue"),T(()=>{let n=x.current;!n||!n.id||(i(s?void 0:n.name),l.current.fields.set(n.id,{getValue:g,name:s??n.name,controlRef:n.controlRef,validityData:le(c,a),validate:h}))},[l,g,a,s,i,h,c]),T(()=>{let n=l.current.fields;return()=>{let m=x.current?.id;m&&n.delete(m)}},[l]);let U=V((n,m)=>{if(!m){b.current===n&&(b.current=null,e(void 0,!0),v(),x.current=null,i(void 0),f.current=void 0);return}let P=x.current?.id,q=b.current;q&&q!==n&&e(void 0,!0),b.current=n,x.current=m,s||i(m.name),f.current=m.id,P&&P!==m.id&&v(P),A(m),y()});return[h,U]}t(Rt,"useFieldControlRegistration");var he=E(ae(),1);var Wt=w.forwardRef(t(function(e,o){let{errors:a,validationMode:u,submitCountRef:s}=Z(),{render:i,className:f,validate:p,validationDebounceTime:c=0,validationMode:l=u,name:b,disabled:x=!1,invalid:R,dirty:g,touched:S,actionsRef:h,style:y,...v}=e,A=st(!0)?.disabled,U=V(p||(()=>null)),n=A||x,[m,P]=w.useState(!1),[q,M]=w.useState(!1),[_,D]=w.useState(!1),[X,ee]=w.useState(!1),oe=w.useRef(void 0),$=g??q,L=S??m,G=w.useRef($),te=w.useRef(void 0),[W,ue]=w.useState(),Y=b??W;T(()=>{g!==void 0&&(G.current=g)},[g]);let F=V(Re=>{g===void 0&&(Re&&(G.current=!0),M(Re))}),K=V(Re=>{S===void 0&&P(Re)}),d=V(()=>l==="onChange"||l==="onSubmit"&&s.current>0),C=Y&&Object.hasOwn(a,Y)?a[Y]:null,N=!!(Array.isArray(C)?C.length:C),I=R===!0||N,[z,Te]=w.useState({state:se,error:"",errors:[],value:null,initialValue:null}),We=!I&&(n?null:z.state.valid),me=w.useMemo(()=>({disabled:n,touched:L,dirty:$,valid:We,filled:_,focused:X}),[n,L,$,We,_,X]),pe=pt({setValidityData:Te,validate:U,validityData:z,validationDebounceTime:c,invalid:I,markedDirtyRef:G,state:me,shouldValidateOnChange:d,validationMode:l,registeredFieldIdRef:te}),[Ye,Ke]=Rt({change:pe.change,commit:pe.commit,invalid:I,markedDirtyRef:G,name:b,setRegisteredFieldName:ue,registeredFieldIdRef:te,setValidityData:Te,validityData:z});w.useImperativeHandle(h,()=>({validate:Ye}),[Ye]);let Mt=w.useMemo(()=>({invalid:I,name:Y,validityData:z,setValidityData:Te,disabled:n,setTouched:K,setDirty:F,setFilled:D,setFocused:ee,focusOwnerRef:oe,validationMode:l,shouldValidateOnChange:d,state:me,registerFieldControl:Ke,validation:pe}),[I,Y,z,n,K,F,D,ee,l,d,me,Ke,pe]),Tt=J("div",e,{ref:o,state:me,props:v,stateAttributesMapping:H});return(0,he.jsx)(Oe.Provider,{value:Mt,children:Tt})},"FieldRootInner")),bt=w.forwardRef(t(function(e,o){return(0,he.jsx)(Ee,{children:(0,he.jsx)(Wt,{...e,ref:o})})},"FieldRoot"));var ce=E(k(),1);var De=E(k(),1);var ke=De.createContext({disabled:!1});function Le(){return De.useContext(ke)}t(Le,"useFieldItemContext");var gt=ce.forwardRef(t(function(e,o){let{render:a,className:u,style:s,id:i,nativeLabel:f=!0,...p}=e,c=j(!1),l=Le(),{labelId:b}=B(),x={...c.state,disabled:c.disabled||l.disabled},R=ce.useRef(null),g=ct({id:b??i,native:f});return J("label",e,{ref:[o,R],state:x,props:[g,p],stateAttributesMapping:H})},"FieldLabel"));var de=E(k(),1);var Ue=E(ae(),1);var Yt={...H,...Qe},vt=de.forwardRef(t(function(e,o){let{render:a,id:u,className:s,match:i,style:f,...p}=e,c=Q(u),{validityData:l,state:b,name:x}=j(!1),{setMessageIds:R}=B(),{errors:g}=Z(),S=x&&Object.hasOwn(g,x)?g[x]:null,h=!!(Array.isArray(S)?S.length:S),y=typeof i=="string",v=!1;i===!0?v=!0:b.disabled?v=!1:y?v=!!l.state[i]:v=h||l.state.valid===!1;let{mounted:A,transitionStatus:U,setMounted:n}=xe(v);T(()=>{if(!(!v||!c))return R(L=>L.concat(c)),()=>{R(L=>L.filter(G=>G!==c))}},[v,c,R]);let m=de.useRef(null),[P,q]=de.useState(null),[M,_]=de.useState(null),D=l.error;!y&&h?D=S:l.errors.length>1&&(D=l.errors);let X=D;Array.isArray(D)&&(X=D.length>1?(0,Ue.jsx)("ul",{children:D.map(L=>(0,Ue.jsx)("li",{children:L},L))}):D[0]);let ee=Array.isArray(D)?JSON.stringify(D):D;v&&ee!==M&&(_(ee),q(X)),Ze({open:v,ref:m,onComplete(){v||n(!1)}});let oe={...b,transitionStatus:U},$=J("div",e,{ref:[o,m],state:oe,props:[{id:c,children:v?X:P},p],stateAttributesMapping:Yt,enabled:A});return A?$:null},"FieldError"));var xt=E(k(),1);var Ft=xt.forwardRef(t(function(e,o){let{render:a,id:u,className:s,style:i,...f}=e,p=Q(u),c=j(!1),l=Le(),{setMessageIds:b}=B(),x={...c.state,disabled:c.disabled||l.disabled};return T(()=>{if(p)return b(g=>g.concat(p)),()=>{b(g=>g.filter(S=>S!==p))}},[p,b]),J("p",e,{ref:o,state:x,props:[{id:p},f],stateAttributesMapping:H})},"FieldDescription"));var Ne=E(k(),1);function Ct(r,e,o){let{setFocused:a,focusOwnerRef:u}=j(),s=V(i=>{(i?!r:u.current===s)&&(u.current=i&&s,o?.(i),a(i))});return T(()=>{let i=e.current;return i?.getRootNode()?.activeElement===i&&s(!0),()=>s(!1)},[r,e,s]),s}t(Ct,"useSetFieldFocused");function yt(r,e,o,a,u=!0,s){let{registerFieldControl:i}=j(),f=ie(()=>Symbol());T(()=>{let p=f.current;if(!u){i(p,void 0);return}i(p,{controlRef:r,getValue:a,id:e,name:s,value:o})},[r,u,a,e,s,i,f,o]),T(()=>{let p=f.current;return()=>{i(p,void 0)}},[i,f])}t(yt,"useRegisterFieldControl");var It=Ne.forwardRef(t(function(e,o){let{render:a,className:u,id:s,name:i,value:f,disabled:p=!1,onValueChange:c,defaultValue:l,autoFocus:b=!1,style:x,...R}=e,{state:g,name:S,disabled:h,setTouched:y,setDirty:v,validityData:A,setFilled:U,validationMode:n,validation:m}=j(),{clearErrors:P,elementRef:q,submitCountRef:M}=Z(),_=h||p,D=S??i,X={...g,disabled:_},{labelId:ee}=B(),oe=dt({id:s}),$=f!==void 0,L=f==null?void 0:String(f),G=V(()=>m.inputRef.current?.value);yt(m.inputRef,oe,L,G,!_,i),T(()=>{let F=L??m.inputRef.current?.value;F!==void 0&&U(F!=="")},[L,l,m.inputRef,U]),et(L,()=>{L!==void 0&&(P(D),v(L!==(A.initialValue??"")),m.change(L))});let te=Ne.useRef(null),W=Ct(_,te),ue=ve();return J("input",e,{ref:[o,te],state:X,props:[{id:oe,disabled:_,name:D,ref:m.inputRef,"aria-labelledby":ee,autoFocus:b,...$?{value:f}:{defaultValue:l},onChange(F){let K=F.currentTarget.value,d=tt(rt.none,F.nativeEvent);c?.(K,d),!$&&(v(K!==(A.initialValue??"")),U(K!==""),!F.nativeEvent.defaultPrevented&&!d.isCanceled&&(P(D),m.change(K)))},onFocus(){W(!0)},onBlur(F){if(y(!0),W(!1),n==="onBlur"){let K=F.currentTarget.value;m.commit(K),$&&queueMicrotask(()=>{let d=m.inputRef.current?.value;d!==void 0&&d!==K&&d!==(A.initialValue??"")&&m.commit(d)})}},onKeyDown(F){if(F.currentTarget.tagName==="INPUT"&&F.key==="Enter"){y(!0);let K=F.currentTarget.value,d=F.currentTarget.form;if(d&&d===q.current&&!F.defaultPrevented){let C=F.currentTarget,N=M.current;ue.start(0,()=>{M.current===N&&m.commit(C.value)})}else m.commit(K)}}},R,F=>m.getValidationProps(_,F)],stateAttributesMapping:H})},"FieldControl"));var fe=E(k(),1);var Et=E(ae(),1);var Vt=t(function(e){let{children:o}=e,{validityData:a,invalid:u}=j(!1),s=fe.useMemo(()=>le(a,u),[a,u]),i=s.state.valid===!1,{transitionStatus:f}=xe(i),p=fe.useMemo(()=>({...s,validity:s.state,transitionStatus:f}),[s,f]);return(0,Et.jsx)(fe.Fragment,{children:o(p)})},"FieldValidity");var Se=E(k(),1);var je=E(ae(),1);var ht=Se.forwardRef(t(function(e,o){let{render:a,className:u,style:s,disabled:i=!1,...f}=e,{state:p,disabled:c}=j(!1),l=c||i,b={...p,disabled:l},x=Se.useMemo(()=>({disabled:l}),[l]),R=J("div",e,{ref:o,state:b,props:f,stateAttributesMapping:H});return(0,je.jsx)(Ee,{children:(0,je.jsx)(ke.Provider,{value:x,children:R})})},"FieldItem"));var Lt=E(ae(),1);var Be=Dt.forwardRef(t(function(e,o){return(0,Lt.jsx)(Me.Control,{ref:o,...e})},"Input"));var St=E(ae(),1);function Hi(r){let e=(0,Nt.c)(10),o,a,u;e[0]!==r?({className:o,type:u,...a}=r,e[0]=r,e[1]=o,e[2]=a,e[3]=u):(o=e[1],a=e[2],u=e[3]);let s;e[4]!==o?(s=ze("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",o),e[4]=o,e[5]=s):s=e[5];let i;return e[6]!==a||e[7]!==s||e[8]!==u?(i=(0,St.jsx)(Be,{type:u,"data-slot":"input",className:s,...a}),e[6]=a,e[7]=s,e[8]=u,e[9]=i):i=e[9],i}t(Hi,"m");export{H as a,j as b,Z as c,B as d,dt as e,ct as f,Le as g,Ct as h,yt as i,Hi as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as le,d as ae,e as ke,i as Ne,j as we,l as Se}from"./chunk-J2SIGUHW.js";import"./chunk-Y2YLTUMD.js";import"./chunk-JXW6H6LE.js";import"./chunk-SOESES7K.js";import"./chunk-YWGOETFP.js";import"./chunk-6KIDLGYM.js";import{a as ye}from"./chunk-MLX6ME3Q.js";import"./chunk-GATWEWRW.js";import"./chunk-ZUFBUWT4.js";import"./chunk-HXFXD5EP.js";import"./chunk-EUNTXABP.js";import{a as ne}from"./chunk-7XZENNML.js";import"./chunk-2NUCBQFU.js";import{i as ue}from"./chunk-2ZNMZPPZ.js";import"./chunk-F4NZZ3LK.js";import"./chunk-R76ATTPC.js";import"./chunk-4AG356VE.js";import"./chunk-EOHXBC4U.js";import"./chunk-JEJV6SVN.js";import{a as re}from"./chunk-V5ZKAZR6.js";import{b as oe}from"./chunk-UB6S6VYI.js";import"./chunk-DMQVY5L7.js";import{a as be,b as xe,c as ve,d as J,e as T,f as _}from"./chunk-WVAWKCNQ.js";import{a as pe,e as ge}from"./chunk-VUMS4VIV.js";import{n as fe}from"./chunk-PLCYDHU3.js";import"./chunk-WY23EROJ.js";import{B as Y,s as me,x as he}from"./chunk-G4H5DPO6.js";import"./chunk-JSVT5VBU.js";import{a as qe}from"./chunk-A6TVTNKO.js";import{a as Ae,b as je}from"./chunk-ADABTCDI.js";import{a as c,d as te}from"./chunk-5PEAXTYQ.js";var z=te(qe(),1);var E=te(Ae(),1);var o=te(je(),1);var Le=["call","schedule","read","write","enqueue","publish","subscribe","start","trigger","invoke"],Me=new Set(["enqueue","publish","schedule","start","subscribe","trigger"]),$e={cron:1,function:2,http:0,queue:4,service:7,table:6,topic:3,workflow:5},Be={stroke:"var(--muted-foreground)"},De={fill:"var(--muted-foreground)",fontSize:10},Fe={fill:"var(--background)"},Q="",se=260,Oe=120,Ce=44,de=40,_e=12,ie=16,Re=c(r=>{if(typeof r!="object"||r===null)return;let e=r;return["edges","nodes","modules","unresolved"].every(d=>Array.isArray(e[d]))?e:void 0},"Ge"),ze={cron:c(()=>({to:"/schedule"}),"cron"),function:c(()=>({to:"/functions"}),"function"),http:c(()=>({to:"/api"}),"http"),queue:c(()=>({to:"/queues"}),"queue"),service:c(()=>({to:"/functions"}),"service"),table:c(r=>({search:{table:r.name},to:"/data"}),"table"),topic:c(()=>({to:"/queues"}),"topic"),workflow:c(()=>({to:"/workflows"}),"workflow")},Pe=c(r=>ze[r.kind](r),"Me"),H=c(r=>r.module??Q,"R"),Te=c((r,e,d)=>{let t=new Set;for(let a of r.nodes)(e===void 0||H(a)===e)&&t.add(a.id);if(e===void 0)return t;let l=new Set(t);for(let a of r.edges)d.has(a.kind)&&(t.has(a.from)&&l.add(a.to),t.has(a.to)&&l.add(a.from));return l},"Pe"),Ee=c((r,e,d,t)=>{let l=`lane:${r}`;return[{data:{label:e},id:l,position:{x:d*(se+Oe),y:0},selectable:!1,style:{height:Ce+t.length*(de+_e)+ie,width:se},type:"lane"},...t.map((a,i)=>({className:"flex cursor-pointer items-center truncate rounded-md border border-border bg-card px-2 text-xs text-foreground hover:border-ring",data:{label:`${a.detail??a.kind} \xB7 ${a.name}`,link:Pe(a)},extent:"parent",id:a.id,parentId:l,position:{x:ie,y:Ce+i*(de+_e)},style:{height:de,width:se-ie*2},type:"member"}))]},"Re"),He=c((r,e)=>{let d=Te(r,e.lane,e.kinds),t=new Map;for(let n of r.nodes)d.has(n.id)&&t.set(H(n),[...t.get(H(n))??[],n]);let l=[...r.modules.map(n=>({label:n.installed===!0?`${n.name} \xB7 ${e.componentLabel}`:n.name,lane:n.name})),{label:e.appLaneLabel,lane:Q}],a=[],i=0;for(let{label:n,lane:f}of l){let m=(t.get(f)??[]).toSorted((h,s)=>$e[h.kind]-$e[s.kind]||h.name.localeCompare(s.name));m.length>0&&(a.push(...Ee(f,n,i,m)),i+=1)}let u=[];for(let n of r.edges)e.kinds.has(n.kind)&&d.has(n.from)&&d.has(n.to)&&u.push({animated:Me.has(n.kind),id:`${n.from}|${n.kind}|${n.to}`,label:n.kind,labelBgStyle:Fe,labelStyle:De,source:n.from,style:Be,target:n.to,type:"smoothstep"});return{edges:u,nodes:a}},"Fe"),ce="*",Ve=c(r=>{let e=(0,z.c)(2),{data:d}=r,t=String(d.label),l;return e[0]!==t?(l=(0,o.jsx)("div",{className:"size-full rounded-lg border border-dashed border-border bg-background/60 px-3 py-2 text-xs font-medium text-muted-foreground",children:t}),e[0]=t,e[1]=l):l=e[1],l},"qe"),Ie={opacity:0},Ze=c(r=>{let e=(0,z.c)(10),{data:d}=r,t=ue(),{label:l,link:a}=d,i;e[0]!==a||e[1]!==t?(i=c(()=>{me(t(a))},"u"),e[0]=a,e[1]=t,e[2]=i):i=e[2];let u=i,n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,o.jsx)(ae,{isConnectable:!1,position:le.Left,style:Ie,type:"target"}),e[3]=n):n=e[3];let f;e[4]!==l||e[5]!==u?(f=(0,o.jsx)("button",{className:"size-full cursor-pointer truncate rounded-md text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",onClick:u,type:"button",children:l}),e[4]=l,e[5]=u,e[6]=f):f=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=(0,o.jsx)(ae,{isConnectable:!1,position:le.Right,style:Ie,type:"source"}),e[7]=m):m=e[7];let h;return e[8]!==f?(h=(0,o.jsxs)(o.Fragment,{children:[n,f,m]}),e[8]=f,e[9]=h):h=e[9],h},"je"),Ge={lane:Ve,member:Ze},Ke=c(r=>{let e=Re(r);return e===void 0?{kind:"error",message:"the response is not an architecture manifest"}:e.modules.length===0?{kind:"empty"}:{kind:"ready",spec:e}},"ze"),We=c(r=>{let e=(0,z.c)(54),{manifest:d}=r,t=Y(),l,a,i,u,n,f,m,h,s,p;if(e[0]!==d.modules||e[1]!==d.nodes||e[2]!==t){let P=new Map;for(let g of d.nodes)g.kind==="function"&&P.set(H(g),(P.get(H(g))??0)+1);let j=c(g=>P.get(g)??0,"I");n=j(Q),u=pe,p="overflow-hidden py-0",i=ge,s="px-0",a=be,m="architecture-catalog";let I;e[13]!==t?(I=t("Module"),e[13]=t,e[14]=I):I=e[14];let L;e[15]!==I?(L=(0,o.jsx)(T,{children:I}),e[15]=I,e[16]=L):L=e[16];let A;e[17]!==t?(A=t("Description"),e[17]=t,e[18]=A):A=e[18];let q;e[19]!==A?(q=(0,o.jsx)(T,{children:A}),e[19]=A,e[20]=q):q=e[20];let v;e[21]!==t?(v=t("Owned tables"),e[21]=t,e[22]=v):v=e[22];let y;e[23]!==v?(y=(0,o.jsx)(T,{children:v}),e[23]=v,e[24]=y):y=e[24];let k;e[25]!==t?(k=t("Functions"),e[25]=t,e[26]=k):k=e[26];let N;e[27]!==k?(N=(0,o.jsx)(T,{children:k}),e[27]=k,e[28]=N):N=e[28],e[29]!==y||e[30]!==N||e[31]!==L||e[32]!==q?(h=(0,o.jsx)(xe,{children:(0,o.jsxs)(J,{children:[L,q,y,N]})}),e[29]=y,e[30]=N,e[31]=L,e[32]=q,e[33]=h):h=e[33],l=ve,f=d.modules.map(g=>(0,o.jsxs)(J,{"data-testid":`architecture-module-${g.name}`,children:[(0,o.jsxs)(_,{className:"font-mono text-xs",children:[g.name,g.installed===!0&&(0,o.jsx)(oe,{className:"ml-2","data-testid":`architecture-component-${g.name}`,variant:"outline",children:t("Component")})]}),(0,o.jsx)(_,{className:"text-xs text-muted-foreground",children:g.description??(g.installed===!0?t("Installed component"):"\u2014")}),(0,o.jsx)(_,{className:"font-mono text-xs text-muted-foreground",children:g.tables.length===0?"\u2014":g.tables.join(", ")}),(0,o.jsx)(_,{className:"text-xs",children:j(g.name)})]},g.name)),e[0]=d.modules,e[1]=d.nodes,e[2]=t,e[3]=l,e[4]=a,e[5]=i,e[6]=u,e[7]=n,e[8]=f,e[9]=m,e[10]=h,e[11]=s,e[12]=p}else l=e[3],a=e[4],i=e[5],u=e[6],n=e[7],f=e[8],m=e[9],h=e[10],s=e[11],p=e[12];let b;e[34]!==n||e[35]!==t?(b=n>0&&(0,o.jsxs)(J,{"data-testid":"architecture-module-app",children:[(0,o.jsx)(_,{className:"text-xs italic text-muted-foreground",children:t("Outside any module")}),(0,o.jsx)(_,{className:"text-xs text-muted-foreground",children:"\u2014"}),(0,o.jsx)(_,{className:"text-xs text-muted-foreground",children:"\u2014"}),(0,o.jsx)(_,{className:"text-xs",children:n})]}),e[34]=n,e[35]=t,e[36]=b):b=e[36];let x;e[37]!==l||e[38]!==f||e[39]!==b?(x=(0,o.jsxs)(l,{children:[f,b]}),e[37]=l,e[38]=f,e[39]=b,e[40]=x):x=e[40];let S;e[41]!==a||e[42]!==m||e[43]!==h||e[44]!==x?(S=(0,o.jsxs)(a,{"data-testid":m,children:[h,x]}),e[41]=a,e[42]=m,e[43]=h,e[44]=x,e[45]=S):S=e[45];let $;e[46]!==i||e[47]!==s||e[48]!==S?($=(0,o.jsx)(i,{className:s,children:S}),e[46]=i,e[47]=s,e[48]=S,e[49]=$):$=e[49];let C;return e[50]!==u||e[51]!==p||e[52]!==$?(C=(0,o.jsx)(u,{className:p,children:$}),e[50]=u,e[51]=p,e[52]=$,e[53]=C):C=e[53],C},"Ye"),Ye=c(r=>{let e=(0,z.c)(52),{manifest:d}=r,t=Y(),[l,a]=(0,E.useState)(ce),[i,u]=(0,E.useState)(Je),n;e[0]!==d.edges?(n=c(w=>d.edges.some(X=>X.kind===w),"s"),e[0]=d.edges,e[1]=n):n=e[1];let f=Le.filter(n),m;e[2]!==t?(m=t("Outside any module"),e[2]=t,e[3]=m):m=e[3];let h=m,s;e[4]!==t?(s=t("Component"),e[4]=t,e[5]=s):s=e[5];let p=s,b;e[6]!==h||e[7]!==p||e[8]!==i||e[9]!==l||e[10]!==d?(b=He(d,{appLaneLabel:h,componentLabel:p,kinds:i,...l===ce?{}:{lane:l}}),e[6]=h,e[7]=p,e[8]=i,e[9]=l,e[10]=d,e[11]=b):b=e[11];let{edges:x,nodes:S}=b,$=(0,E.useRef)(null),C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=c(w=>{a(w.target.value)},"_"),e[12]=C):C=e[12];let P=C,j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=c(w=>{u(X=>{let ee=new Set(X);return ee.delete(w)||ee.add(w),ee})},"I"),e[13]=j):j=e[13];let I=j,L="flex flex-col gap-2",A="architecture-diagram",q="flex flex-wrap items-center gap-2",v;e[14]!==t?(v=t("Module"),e[14]=t,e[15]=v):v=e[15];let y;e[16]!==t?(y=t("All modules"),e[16]=t,e[17]=y):y=e[17];let k;e[18]!==y?(k=(0,o.jsx)("option",{value:ce,children:y}),e[18]=y,e[19]=k):k=e[19];let N;e[20]!==d.modules?(N=d.modules.map(Qe),e[20]=d.modules,e[21]=N):N=e[21];let g;e[22]!==t?(g=t("Outside any module"),e[22]=t,e[23]=g):g=e[23];let M;e[24]!==g?(M=(0,o.jsx)("option",{value:Q,children:g}),e[24]=g,e[25]=M):M=e[25];let B;e[26]!==l||e[27]!==v||e[28]!==k||e[29]!==N||e[30]!==M?(B=(0,o.jsxs)("select",{"aria-label":v,className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"architecture-module-filter",onChange:P,value:l,children:[k,N,M]}),e[26]=l,e[27]=v,e[28]=k,e[29]=N,e[30]=M,e[31]=B):B=e[31];let D;e[32]!==x.length||e[33]!==t?(D=t("{count} edges shown",{count:x.length}),e[32]=x.length,e[33]=t,e[34]=D):D=e[34];let F;e[35]!==D?(F=(0,o.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"architecture-edge-count",children:D}),e[35]=D,e[36]=F):F=e[36];let V;e[37]!==i?(V=c(w=>(0,o.jsx)("button",{"aria-pressed":i.has(w),className:he("rounded-full border border-border px-2.5 py-0.5 text-xs",i.has(w)?"bg-muted":"text-muted-foreground line-through"),"data-testid":`architecture-kind-${w}`,onClick:c(()=>{I(w)},"onClick"),type:"button",children:w},w),"q"),e[37]=i,e[38]=V):V=e[38];let U=f.map(V),O;e[39]!==B||e[40]!==F||e[41]!==U?(O=(0,o.jsxs)("div",{className:q,children:[B,F,U]}),e[39]=B,e[40]=F,e[41]=U,e[42]=O):O=e[42];let Z,G,K;e[43]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,o.jsx)(Ne,{}),G=(0,o.jsx)(we,{showInteractive:!1}),K=(0,o.jsx)(Se,{containerRef:$,filenameBase:"architecture",testIdPrefix:"architecture"}),e[43]=Z,e[44]=G,e[45]=K):(Z=e[43],G=e[44],K=e[45]);let R;e[46]!==x||e[47]!==S?(R=(0,o.jsx)("div",{className:"h-[600px] w-full overflow-hidden border border-border bg-muted/20","data-testid":"architecture-canvas",ref:$,children:(0,o.jsxs)(ke,{edges:x,edgesFocusable:!1,fitView:!0,minZoom:.1,nodes:S,nodesConnectable:!1,nodesDraggable:!1,nodeTypes:Ge,children:[Z,G,K]})}),e[46]=x,e[47]=S,e[48]=R):R=e[48];let W;return e[49]!==O||e[50]!==R?(W=(0,o.jsxs)("section",{className:L,"data-testid":A,children:[O,R]}),e[49]=O,e[50]=R,e[51]=W):W=e[51],W},"Ve"),mt=c(r=>{let e=(0,z.c)(28),{manifest:d}=r,t=Y(),l=fe(),a;e[0]!==l?(a=c(()=>l.fetchArchitecture(),"r"),e[0]=l,e[1]=a):a=e[1];let i=ye(d,a,Ke);if(i.kind==="loading"){let s;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,o.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"architecture-loading",children:[(0,o.jsx)(ne,{className:"h-8 w-48"}),(0,o.jsx)(ne,{className:"h-64 w-full"})]}),e[2]=s):s=e[2],s}if(i.kind==="error"){let s;e[3]!==i.message||e[4]!==t?(s=t("Couldn't load the architecture manifest: {message}",{message:i.message}),e[3]=i.message,e[4]=t,e[5]=s):s=e[5];let p;e[6]!==t?(p=t("Architecture unavailable"),e[6]=t,e[7]=p):p=e[7];let b;return e[8]!==s||e[9]!==p?(b=(0,o.jsx)(re,{description:s,testId:"architecture-error",title:p}),e[8]=s,e[9]=p,e[10]=b):b=e[10],b}if(i.kind==="empty"){let s;e[11]!==t?(s=t("Add a lunora/<folder>/module.ts that default-exports defineModule(...) and run lunora codegen to map your modules here. Installed components join the map once you declare one."),e[11]=t,e[12]=s):s=e[12];let p;e[13]!==t?(p=t("No modules declared"),e[13]=t,e[14]=p):p=e[14];let b;return e[15]!==s||e[16]!==p?(b=(0,o.jsx)(re,{description:s,testId:"architecture-empty",title:p}),e[15]=s,e[16]=p,e[17]=b):b=e[17],b}let{spec:u}=i,n,f;e[18]!==u?(n=(0,o.jsx)(We,{manifest:u}),f=(0,o.jsx)(Ye,{manifest:u}),e[18]=u,e[19]=n,e[20]=f):(n=e[19],f=e[20]);let m;e[21]!==u.unresolved||e[22]!==t?(m=u.unresolved.length>0&&(0,o.jsxs)("details",{className:"text-sm","data-testid":"architecture-unresolved",children:[(0,o.jsxs)("summary",{className:"cursor-pointer text-muted-foreground",children:[t("{count} call sites could not be drawn",{count:u.unresolved.length})," ",(0,o.jsx)(oe,{variant:"outline",children:u.unresolved.length})]}),(0,o.jsx)("ul",{className:"mt-2 flex flex-col gap-1 font-mono text-xs",children:u.unresolved.map(Ue)})]}),e[21]=u.unresolved,e[22]=t,e[23]=m):m=e[23];let h;return e[24]!==n||e[25]!==f||e[26]!==m?(h=(0,o.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"architecture-panel",children:[n,f,m]}),e[24]=n,e[25]=f,e[26]=m,e[27]=h):h=e[27],h},"mt");function Je(){return new Set(Le)}c(Je,"We");function Qe(r){return(0,o.jsx)("option",{value:r.name,children:r.name},r.name)}c(Qe,"Ze");function Ue(r){return(0,o.jsxs)("li",{children:[r.file,":",r.line," \xB7 ",r.kind," \xB7 ",r.reason]},`${r.file}:${String(r.line)}:${r.kind}:${r.reason}`)}c(Ue,"Je");export{mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $e}from"./chunk-GERWUNAM.js";import{g as Le}from"./chunk-24N5RZRI.js";import"./chunk-AFLNQEZ5.js";import"./chunk-HQZ7B5EU.js";import"./chunk-CL3JOU6F.js";import{a as ae}from"./chunk-ZLAVM2NT.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-Y5QMX4YG.js";import"./chunk-2NUCBQFU.js";import{a as ge}from"./chunk-2KTN53PK.js";import{a as be}from"./chunk-YLC2ZYCL.js";import"./chunk-EDL46BPM.js";import"./chunk-DA2CAFXI.js";import{a as ue}from"./chunk-W5BTAOHO.js";import"./chunk-4KPATTV6.js";import"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import{i as Je}from"./chunk-2D4WBSDO.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as ce}from"./chunk-CBTPJPCZ.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as se}from"./chunk-HMMALUXM.js";import{b as oe}from"./chunk-BHUWAGFN.js";import"./chunk-L27FKJTG.js";import{a as ee,b as te,c as re,d as z,e as L,f as K}from"./chunk-ZJIYJZ6F.js";import"./chunk-4RII5S3H.js";import"./chunk-EOFWXI3T.js";import{a as me}from"./chunk-LYVYUTQY.js";import{b as ne,c as ve}from"./chunk-6C555TU5.js";import{a as Z,e as H}from"./chunk-XV2XEUUB.js";import{l as je,n as de}from"./chunk-C6FOSG2A.js";import"./chunk-ZPQBVYNN.js";import{B as V,h as fe,i as Ae,j as ie,k as xe,s as Y,w as le,x as Ie}from"./chunk-2ZJJH4YN.js";import"./chunk-PDBW6GTJ.js";import{a as Ce}from"./chunk-A6TVTNKO.js";import{a as we,b as Se}from"./chunk-ADABTCDI.js";import{a as y,d as he}from"./chunk-5PEAXTYQ.js";var G=he(Ce(),1),Q=he(we(),1);var t=he(Se(),1);var Fe=he(Ce(),1),pe=he(we(),1);var D=he(Se(),1);var Me=y(r=>Number.isFinite(r)?le(r,"\u2014"):"\u2014","X"),Ke=y(r=>r.toSorted((e,o)=>e.scheduledFor-o.scheduledFor),"F"),Be=y((r,e,o)=>e!==void 0?e:o===void 0?n=>r.cancelScheduledJob(n):void 0,"Y"),Te=y(r=>{let e=(0,Fe.c)(16),{cancelJob:o,loadJobs:n}=r===void 0?{}:r,l=de(),s=V(),a=n===void 0,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["lunora-scheduled-jobs"],e[0]=i):i=e[0];let c=ne(i,async()=>{let x=await(n??(()=>l.listScheduledJobs()))();return Ke(x)}),[N,p]=(0,pe.useState)(void 0),[h,m]=(0,pe.useState)(void 0),k,f;e[1]!==l||e[2]!==a?(k=y(()=>{if(a)return l.subscribeScheduledJobs(x=>{m(void 0),p(Ke(x))})},"v"),f=[a,l],e[1]=l,e[2]=a,e[3]=k,e[4]=f):(k=e[3],f=e[4]),(0,pe.useEffect)(k,f);let d;e[5]!==c?(d=y(()=>c.poll(),"y"),e[5]=c,e[6]=d):d=e[6],ae(d,!a);let u=Be(l,o,n),v=N??c.data,b=h??c.error,S=y(async x=>{if(u!==void 0){m(void 0);try{await u(x),a||c.refetch()}catch(A){m(ie(A))}}},"E"),I="flex flex-col gap-3",w="lunora-scheduled-jobs",C;e[7]!==b?(C=b!==null&&(0,D.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:b}),e[7]=b,e[8]=C):C=e[8];let J;e[9]!==v?.length||e[10]!==s?(J=v?.length===0&&(0,D.jsx)(se,{description:s("Jobs queued with runAfter / runAt will appear here."),icon:(0,D.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,D.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,D.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:s("No scheduled jobs.")}),e[9]=v?.length,e[10]=s,e[11]=J):J=e[11];let $=v!==void 0&&v.length>0&&(0,D.jsx)(Z,{className:"overflow-hidden py-0",children:(0,D.jsx)(H,{className:"px-0",children:(0,D.jsxs)(ee,{"data-testid":"sj-table",children:[(0,D.jsx)(te,{children:(0,D.jsxs)(z,{children:[(0,D.jsx)(L,{children:s("function")}),(0,D.jsx)(L,{children:s("scheduled for")}),(0,D.jsx)(L,{children:s("pool")}),(0,D.jsx)(L,{children:s("attempts")}),(0,D.jsx)(L,{children:s("shard")}),(0,D.jsx)(L,{children:s("id")}),u!==void 0&&(0,D.jsx)(L,{"aria-label":s("Actions")})]})}),(0,D.jsx)(re,{children:v.map(x=>(0,D.jsxs)(z,{"data-testid":`sj-row-${x.id}`,children:[(0,D.jsx)(K,{className:"font-mono text-xs",children:x.workflow??x.functionPath}),(0,D.jsx)(K,{className:"text-muted-foreground tabular-nums",children:Me(x.scheduledFor)}),(0,D.jsx)(K,{className:"font-mono text-xs",children:x.pool??""}),(0,D.jsx)(K,{className:"tabular-nums",children:x.attempts??0}),(0,D.jsx)(K,{children:x.shardKey??""}),(0,D.jsx)(K,{className:"font-mono text-xs",children:x.id}),u!==void 0&&(0,D.jsx)(K,{className:"text-right",children:(0,D.jsx)(ue,{confirmLabel:s("Cancel job?"),onConfirm:y(()=>{Y(S(x.id))},"onConfirm"),testId:`sj-cancel-${x.id}`,children:s("Cancel")})})]},x.id))})]})})}),j;return e[12]!==$||e[13]!==C||e[14]!==J?(j=(0,D.jsxs)("div",{className:I,"data-testid":w,children:[C,J,$]}),e[12]=$,e[13]=C,e[14]=J,e[15]=j):j=e[15],j},"he");var _e={failed:"destructive",skipped:"warning",succeeded:"success"},Re=25,Pe=y(r=>r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(1)} s`,"Ee"),Oe=y(r=>{let e=(0,G.c)(39),{inFlight:o,last:n}=r,l=V();if(o!==void 0){let u;e[0]!==l?(u=l("running"),e[0]=l,e[1]=u):u=e[1];let v;e[2]!==u?(v=(0,t.jsx)(oe,{variant:"info",children:u}),e[2]=u,e[3]=v):v=e[3];let b;e[4]!==o.startedAt?(b=le(o.startedAt,"\u2014"),e[4]=o.startedAt,e[5]=b):b=e[5];let S;e[6]!==b?(S=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:b}),e[6]=b,e[7]=S):S=e[7];let I;e[8]!==o.skipped||e[9]!==l?(I=o.skipped>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l("{count} ticks skipped",{count:o.skipped})}),e[8]=o.skipped,e[9]=l,e[10]=I):I=e[10];let w;return e[11]!==v||e[12]!==S||e[13]!==I?(w=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[v,S,I]}),e[11]=v,e[12]=S,e[13]=I,e[14]=w):w=e[14],w}if(n===void 0){let u;e[15]!==l?(u=l("never"),e[15]=l,e[16]=u):u=e[16];let v;return e[17]!==u?(v=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:u}),e[17]=u,e[18]=v):v=e[18],v}let s;e[19]!==l?(s=l("failed"),e[19]=l,e[20]=s):s=e[20];let a;e[21]!==l?(a=l("skipped"),e[21]=l,e[22]=a):a=e[22];let i;e[23]!==l?(i=l("succeeded"),e[23]=l,e[24]=i):i=e[24];let c;e[25]!==s||e[26]!==a||e[27]!==i?(c={failed:s,skipped:a,succeeded:i},e[25]=s,e[26]=a,e[27]=i,e[28]=c):c=e[28];let N=c,p=_e[n.status],h=N[n.status],m;e[29]!==p||e[30]!==h?(m=(0,t.jsx)(oe,{variant:p,children:h}),e[29]=p,e[30]=h,e[31]=m):m=e[31];let k;e[32]!==n.startedAt?(k=le(n.startedAt,"\u2014"),e[32]=n.startedAt,e[33]=k):k=e[33];let f;e[34]!==k?(f=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:k}),e[34]=k,e[35]=f):f=e[35];let d;return e[36]!==m||e[37]!==f?(d=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[m,f]}),e[36]=m,e[37]=f,e[38]=d):d=e[38],d},"Re"),Ee=y(r=>{let e=(0,G.c)(80),{runs:o}=r,n=V();if(o.length===0)return;let l,s,a,i,c,N,p,h,m,k,f;if(e[0]!==o||e[1]!==n){let I=o.toSorted(Ue).slice(0,Re),w;e[13]!==n?(w=n("failed"),e[13]=n,e[14]=w):w=e[14];let C;e[15]!==n?(C=n("skipped"),e[15]=n,e[16]=C):C=e[16];let J;e[17]!==n?(J=n("succeeded"),e[17]=n,e[18]=J):J=e[18];let $;e[19]!==J||e[20]!==w||e[21]!==C?($={failed:w,skipped:C,succeeded:J},e[19]=J,e[20]=w,e[21]=C,e[22]=$):$=e[22];let j=$;m="flex flex-col gap-2",k="cron-run-history";let x;e[23]!==n?(x=n("Recent runs"),e[23]=n,e[24]=x):x=e[24],e[25]!==x?(f=(0,t.jsx)("h3",{className:"text-sm font-medium",children:x}),e[25]=x,e[26]=f):f=e[26],i=Z,h="overflow-hidden py-0",a=H,p="px-0",s=ee;let A;e[27]!==n?(A=n("name"),e[27]=n,e[28]=A):A=e[28];let g;e[29]!==A?(g=(0,t.jsx)(L,{children:A}),e[29]=A,e[30]=g):g=e[30];let F;e[31]!==n?(F=n("status"),e[31]=n,e[32]=F):F=e[32];let _;e[33]!==F?(_=(0,t.jsx)(L,{children:F}),e[33]=F,e[34]=_):_=e[34];let T;e[35]!==n?(T=n("started"),e[35]=n,e[36]=T):T=e[36];let M;e[37]!==T?(M=(0,t.jsx)(L,{children:T}),e[37]=T,e[38]=M):M=e[38];let R;e[39]!==n?(R=n("duration"),e[39]=n,e[40]=R):R=e[40];let W;e[41]!==R?(W=(0,t.jsx)(L,{children:R}),e[41]=R,e[42]=W):W=e[42];let B;e[43]!==n?(B=n("skipped"),e[43]=n,e[44]=B):B=e[44];let E;e[45]!==B?(E=(0,t.jsx)(L,{children:B}),e[45]=B,e[46]=E):E=e[46];let U;e[47]!==n?(U=n("error"),e[47]=n,e[48]=U):U=e[48];let P;e[49]!==U?(P=(0,t.jsx)(L,{children:U}),e[49]=U,e[50]=P):P=e[50],e[51]!==g||e[52]!==_||e[53]!==M||e[54]!==W||e[55]!==E||e[56]!==P?(N=(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[g,_,M,W,E,P]})}),e[51]=g,e[52]=_,e[53]=M,e[54]=W,e[55]=E,e[56]=P,e[57]=N):N=e[57],l=re;let X;e[58]!==j?(X=y(q=>(0,t.jsxs)(z,{"data-testid":`cron-run-row-${q.runId}`,children:[(0,t.jsx)(K,{children:q.name}),(0,t.jsx)(K,{children:(0,t.jsx)(oe,{variant:_e[q.status],children:j[q.status]})}),(0,t.jsx)(K,{className:"text-muted-foreground tabular-nums",children:le(q.startedAt,"\u2014")}),(0,t.jsx)(K,{className:"tabular-nums",children:q.status==="skipped"?"":Pe(q.durationMs)}),(0,t.jsx)(K,{className:"tabular-nums",children:q.skipped>0?q.skipped:""}),(0,t.jsx)(K,{className:"text-xs text-destructive",children:q.error??""})]},q.runId),"W"),e[58]=j,e[59]=X):X=e[59],c=I.map(X),e[0]=o,e[1]=n,e[2]=l,e[3]=s,e[4]=a,e[5]=i,e[6]=c,e[7]=N,e[8]=p,e[9]=h,e[10]=m,e[11]=k,e[12]=f}else l=e[2],s=e[3],a=e[4],i=e[5],c=e[6],N=e[7],p=e[8],h=e[9],m=e[10],k=e[11],f=e[12];let d;e[60]!==l||e[61]!==c?(d=(0,t.jsx)(l,{children:c}),e[60]=l,e[61]=c,e[62]=d):d=e[62];let u;e[63]!==s||e[64]!==N||e[65]!==d?(u=(0,t.jsxs)(s,{children:[N,d]}),e[63]=s,e[64]=N,e[65]=d,e[66]=u):u=e[66];let v;e[67]!==a||e[68]!==p||e[69]!==u?(v=(0,t.jsx)(a,{className:p,children:u}),e[67]=a,e[68]=p,e[69]=u,e[70]=v):v=e[70];let b;e[71]!==i||e[72]!==v||e[73]!==h?(b=(0,t.jsx)(i,{className:h,children:v}),e[71]=i,e[72]=v,e[73]=h,e[74]=b):b=e[74];let S;return e[75]!==b||e[76]!==m||e[77]!==k||e[78]!==f?(S=(0,t.jsxs)("div",{className:m,"data-testid":k,children:[f,b]}),e[75]=b,e[76]=m,e[77]=k,e[78]=f,e[79]=S):S=e[79],S},"Le");function Ue(r,e){return e.startedAt-r.startedAt}y(Ue,"Oe");var We=y(()=>{let r=(0,G.c)(50),e=V(),o=$e(""),[n,l]=(0,Q.useState)(""),[s,a]=(0,Q.useState)(void 0),[i,c]=(0,Q.useState)(!1);if(o.unavailable)return null;let N;r[0]!==o?(N=o.pending("cron"),r[0]=o,r[1]=N):N=r[1];let p=N,h;r[2]!==o?(h=o.reason("cron"),r[2]=o,r[3]=h):h=r[3];let m=h,k;r[4]!==n||r[5]!==o?(k=y(()=>{let T=n.trim();T!==""&&Y((async()=>{let M=await o.suggestCron(T);c(!1),a(M)})())},"y"),r[4]=n,r[5]=o,r[6]=k):k=r[6];let f=k,d;r[7]!==s?(d=y(()=>{let T="navigator"in globalThis?globalThis.navigator.clipboard:void 0;T===void 0||s===void 0||Y((async()=>{try{await T.writeText(s),c(!0)}catch{c(!1)}})())},"d"),r[7]=s,r[8]=d):d=r[8];let u=d,v;r[9]!==e?(v=e("Describe a schedule"),r[9]=e,r[10]=v):v=r[10];let b;r[11]===Symbol.for("react.memo_cache_sentinel")?(b=y(T=>{l(T.target.value)},"b"),r[11]=b):b=r[11];let S;r[12]!==f?(S=y(T=>{T.key==="Enter"&&(T.preventDefault(),f())},"w"),r[12]=f,r[13]=S):S=r[13];let I;r[14]!==e?(I=e("Describe a schedule"),r[14]=e,r[15]=I):I=r[15];let w;r[16]!==p||r[17]!==n||r[18]!==v||r[19]!==S||r[20]!==I?(w=(0,t.jsx)(Je,{"aria-label":v,className:"h-7 flex-1 text-xs","data-testid":"cron-assistant-prompt",disabled:p,onChange:b,onKeyDown:S,placeholder:I,value:n}),r[16]=p,r[17]=n,r[18]=v,r[19]=S,r[20]=I,r[21]=w):w=r[21];let C=p&&"opacity-60",J;r[22]!==C?(J=Ie("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",C),r[22]=C,r[23]=J):J=r[23];let $;r[24]!==p||r[25]!==n?($=p||n.trim()==="",r[24]=p,r[25]=n,r[26]=$):$=r[26];let j;r[27]!==p||r[28]!==e?(j=e(p?"Thinking\u2026":"Suggest schedule"),r[27]=p,r[28]=e,r[29]=j):j=r[29];let x;r[30]!==f||r[31]!==J||r[32]!==$||r[33]!==j?(x=(0,t.jsx)("button",{className:J,"data-testid":"cron-assistant-generate",disabled:$,onClick:f,type:"button",children:j}),r[30]=f,r[31]=J,r[32]=$,r[33]=j,r[34]=x):x=r[34];let A;r[35]!==x||r[36]!==w?(A=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[w,x]}),r[35]=x,r[36]=w,r[37]=A):A=r[37];let g;r[38]!==i||r[39]!==u||r[40]!==s||r[41]!==e?(g=s!==void 0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs tabular-nums","data-testid":"cron-assistant-result",children:s}),(0,t.jsx)("button",{className:"rounded-md border border-border px-2 py-0.5 text-[11px] outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cron-assistant-copy",onClick:u,type:"button",children:e(i?"Copied":"Copy")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e("Add it to lunora/crons.ts \u2014 triggers are compiled into the worker.")})]}),r[38]=i,r[39]=u,r[40]=s,r[41]=e,r[42]=g):g=r[42];let F;r[43]!==m||r[44]!==e?(F=m!==void 0&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"cron-assistant-reason",role:"status",children:e(m==="ai-error"?"The model could not be reached.":"The model did not return a schedule Cron Triggers accept.")}),r[43]=m,r[44]=e,r[45]=F):F=r[45];let _;return r[46]!==A||r[47]!==g||r[48]!==F?(_=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"cron-assistant",children:[A,g,F]}),r[46]=A,r[47]=g,r[48]=F,r[49]=_):_=r[49],_},"Ke"),ze={kind:"idle"},qe="SCHEDULER_NOT_CONFIGURED",ye={inFlight:[],runs:[]},Ve=y((r,e,o)=>o!==void 0?o:e===void 0?n=>r.runCronJob(n):void 0,"Fe"),Ge=y(({loadCronJobs:r,loadCronRuns:e,runCronJob:o}={})=>{let n=de(),l=V(),[s,a]=(0,Q.useState)({}),i=ne(["lunora-cron-jobs",r?"custom":"default"],()=>(r??(()=>n.getCronJobs()))()),{data:c,error:N}=i,p=e??(r===void 0?()=>n.listCronRuns():void 0),h=ne(["lunora-cron-runs",e?"custom":"default"],async()=>p===void 0?ye:p().catch(d=>{if(xe(d)===qe)return ye;throw d})),m=h.data??ye;ae(()=>h.poll(),p!==void 0);let k=Ve(n,r,o),f=y(async d=>{if(k!==void 0){a(u=>({...u,[d]:{kind:"running"}}));try{await k(d),a(u=>({...u,[d]:{kind:"ok"}})),i.refetch(),h.refetch()}catch(u){a(v=>({...v,[d]:{kind:"error",message:ie(u)}}))}}},"p");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[(0,t.jsx)(We,{}),N!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:N}),h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-runs-error",role:"alert",children:h.error}),c?.length===0&&(0,t.jsx)(se,{description:l("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:l("No cron triggers.")}),c!==void 0&&c.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"cron-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:l("name")}),(0,t.jsx)(L,{children:l("schedule")}),(0,t.jsx)(L,{children:l("target")}),(0,t.jsx)(L,{children:l("shard")}),(0,t.jsx)(L,{children:l("last run")}),k!==void 0&&(0,t.jsx)(L,{"aria-label":l("Actions")})]})}),(0,t.jsx)(re,{children:c.map(d=>{let u=s[d.name]??ze;return(0,t.jsxs)(z,{"data-testid":`cron-row-${d.name}`,children:[(0,t.jsx)(K,{children:d.name}),(0,t.jsx)(K,{className:"font-mono text-xs tabular-nums",children:d.cron}),(0,t.jsx)(K,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[d.workflow===void 0?(0,t.jsx)(oe,{variant:"outline",children:l("function")}):(0,t.jsx)(oe,{variant:"secondary",children:l("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:d.workflow??d.functionPath})]})}),(0,t.jsx)(K,{children:d.shardKey??""}),(0,t.jsx)(K,{"data-testid":`cron-last-run-${d.name}`,children:(0,t.jsx)(Oe,{inFlight:m.inFlight.find(v=>v.name===d.name),last:m.runs.find(v=>v.name===d.name)})}),k!==void 0&&(0,t.jsx)(K,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[u.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${d.name}`,children:l("ran")}),u.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${d.name}`,role:"alert",children:u.message}),(0,t.jsx)(ue,{confirmLabel:l("Run now?"),disabled:u.kind==="running",onConfirm:y(()=>{Y(f(d.name))},"onConfirm"),testId:`cron-run-${d.name}`,children:u.kind==="running"?l("Running\u2026"):l("Run now")})]})})]},`${d.cron}:${d.name}`)})})]})})}),(0,t.jsx)(Ee,{runs:m.runs})]})},"Je"),Qe=y(r=>Number.isFinite(r)?le(r,"\u2014"):"\u2014","Me"),Xe=y(r=>{let e=(0,G.c)(34),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{loadJobs:n,removeJob:l,retryJob:s}=o,a=de(),i=V(),c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["lunora-dead-jobs"],e[2]=c):c=e[2];let N;e[3]!==a||e[4]!==n?(N=y(async()=>(await(n??(()=>a.listDeadJobs()))()).toSorted(Ye),"v"),e[3]=a,e[4]=n,e[5]=N):N=e[5];let p=ne(c,N),h=p.data,[m,k]=(0,Q.useState)(void 0),f=p.error??m,d=n===void 0,u;e[6]!==a||e[7]!==d||e[8]!==s?(u=s??(d?g=>a.retryDeadJob(g):void 0),e[6]=a,e[7]=d,e[8]=s,e[9]=u):u=e[9];let v=u,b;e[10]!==a||e[11]!==d||e[12]!==l?(b=l??(d?g=>a.removeDeadJob(g):void 0),e[10]=a,e[11]=d,e[12]=l,e[13]=b):b=e[13];let S=b,I;e[14]!==p?(I=y(()=>p.poll(),"S"),e[14]=p,e[15]=I):I=e[15],ae(I,!0);let w;e[16]!==p?(w=y(async g=>{k(void 0);try{await g,p.refetch()}catch(F){k(ie(F))}},"N"),e[16]=p,e[17]=w):w=e[17];let C=w,J=v!==void 0||S!==void 0,$;e[18]!==f?($=f!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:f}),e[18]=f,e[19]=$):$=e[19];let j;e[20]!==h?.length||e[21]!==i?(j=h?.length===0&&(0,t.jsx)(se,{description:i("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:i("No dead-letter jobs.")}),e[20]=h?.length,e[21]=i,e[22]=j):j=e[22];let x;e[23]!==C||e[24]!==J||e[25]!==h||e[26]!==S||e[27]!==v||e[28]!==i?(x=h!==void 0&&h.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"dlq-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:i("function")}),(0,t.jsx)(L,{children:i("attempts")}),(0,t.jsx)(L,{children:i("last tried")}),(0,t.jsx)(L,{children:i("pool")}),(0,t.jsx)(L,{children:i("shard")}),(0,t.jsx)(L,{children:i("id")}),J&&(0,t.jsx)(L,{"aria-label":i("Actions")})]})}),(0,t.jsx)(re,{children:h.map(g=>(0,t.jsxs)(z,{"data-testid":`dlq-row-${g.id}`,children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:g.workflow??g.functionPath}),(0,t.jsx)(K,{className:"tabular-nums",children:g.attempts??0}),(0,t.jsx)(K,{className:"text-muted-foreground tabular-nums",children:Qe(g.scheduledFor)}),(0,t.jsx)(K,{className:"font-mono text-xs",children:g.pool??""}),(0,t.jsx)(K,{children:g.shardKey??""}),(0,t.jsx)(K,{className:"font-mono text-xs",children:g.id}),J&&(0,t.jsx)(K,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[v!==void 0&&(0,t.jsx)(ce,{"data-testid":`dlq-retry-${g.id}`,onClick:y(()=>{Y(C(v(g.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:i("Retry")}),S!==void 0&&(0,t.jsx)(ue,{confirmLabel:i("Drop job?"),onConfirm:y(()=>{Y(C(S(g.id)))},"onConfirm"),testId:`dlq-remove-${g.id}`,children:i("Drop")})]})})]},g.id))})]})})}),e[23]=C,e[24]=J,e[25]=h,e[26]=S,e[27]=v,e[28]=i,e[29]=x):x=e[29];let A;return e[30]!==x||e[31]!==$||e[32]!==j?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[$,j,x]}),e[30]=x,e[31]=$,e[32]=j,e[33]=A):A=e[33],A},"Pe");function Ye(r,e){return(e.attempts??0)-(r.attempts??0)}y(Ye,"qe");var Ze={canceled:"secondary",failed:"destructive",pending:"outline",running:"info",succeeded:"success"},He=y(r=>{let e=(0,G.c)(47),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{loadJobs:n}=o,l=de(),s=V(),a;e[2]!==l||e[3]!==n?(a=n??(async O=>l.listScheduledHistory(O===void 0?{}:{cursor:O})),e[2]=l,e[3]=n,e[4]=a):a=e[4];let i=a,c=n?"custom":"default",N;e[5]!==c?(N=["lunora-job-history",c],e[5]=c,e[6]=N):N=e[6];let p;e[7]!==i?(p=y(async()=>i(),"f"),e[7]=i,e[8]=p):p=e[8];let h=ne(N,p),[m,k]=(0,Q.useState)(void 0),[f,d]=(0,Q.useState)(!1),[u,v]=(0,Q.useState)(void 0),b=h.data?.records,S;e[9]!==b?(S=new Set(b?.map(et)),e[9]=b,e[10]=S):S=e[10];let I=S,w=b===void 0?void 0:[...b,...(m?.records??[]).filter(O=>!I.has(O.id))],C=m===void 0?h.data?.cursor:m.cursor,J;e[11]!==i||e[12]!==C?(J=y(async()=>{d(!0),v(void 0);try{let O=await i(C);k(De=>({cursor:O.cursor,records:[...De?.records??[],...O.records]})),d(!1)}catch(O){v(ie(O)),d(!1)}},"L"),e[11]=i,e[12]=C,e[13]=J):J=e[13];let $=J,j;e[14]!==s?(j=s("canceled"),e[14]=s,e[15]=j):j=e[15];let x;e[16]!==s?(x=s("failed"),e[16]=s,e[17]=x):x=e[17];let A;e[18]!==s?(A=s("pending"),e[18]=s,e[19]=A):A=e[19];let g;e[20]!==s?(g=s("running"),e[20]=s,e[21]=g):g=e[21];let F;e[22]!==s?(F=s("succeeded"),e[22]=s,e[23]=F):F=e[23];let _;e[24]!==A||e[25]!==g||e[26]!==F||e[27]!==j||e[28]!==x?(_={canceled:j,failed:x,pending:A,running:g,succeeded:F},e[24]=A,e[25]=g,e[26]=F,e[27]=j,e[28]=x,e[29]=_):_=e[29];let T=_,M;e[30]!==h?(M=y(()=>h.poll(),"_"),e[30]=h,e[31]=M):M=e[31],ae(M,m===void 0);let R="flex flex-col gap-3",W="lunora-job-history",B;e[32]!==h.error?(B=h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"job-history-error",role:"alert",children:h.error}),e[32]=h.error,e[33]=B):B=e[33];let E=w?.length===0&&(0,t.jsx)(se,{description:s("Jobs that succeed, fail or are cancelled stay here for seven days."),testId:"job-history-empty",title:s("No finished jobs.")}),U=w!==void 0&&w.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"job-history-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:s("function")}),(0,t.jsx)(L,{children:s("state")}),(0,t.jsx)(L,{children:s("finished")}),(0,t.jsx)(L,{children:s("error")}),(0,t.jsx)(L,{children:s("id")})]})}),(0,t.jsx)(re,{children:w.map(O=>(0,t.jsxs)(z,{"data-testid":`job-history-row-${O.id}`,children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:O.workflow??O.functionPath}),(0,t.jsx)(K,{children:(0,t.jsx)(oe,{"data-testid":`job-history-state-${O.id}`,variant:Ze[O.state],children:T[O.state]})}),(0,t.jsx)(K,{className:"text-muted-foreground tabular-nums",children:le(O.completedAt,"\u2014")}),(0,t.jsx)(K,{className:"text-xs text-destructive",children:O.error??""}),(0,t.jsx)(K,{className:"font-mono text-xs",children:O.id})]},O.id))})]})})}),P;e[34]!==u?(P=u!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:u}),e[34]=u,e[35]=P):P=e[35];let X;e[36]!==f||e[37]!==C||e[38]!==$||e[39]!==s?(X=C!==void 0&&(0,t.jsx)("div",{children:(0,t.jsx)(ce,{"data-testid":"job-history-load-more",disabled:f,onClick:y(()=>{Y($())},"onClick"),variant:"outline",children:s(f?"Loading\u2026":"Load more")})}),e[36]=f,e[37]=C,e[38]=$,e[39]=s,e[40]=X):X=e[40];let q;return e[41]!==B||e[42]!==E||e[43]!==U||e[44]!==P||e[45]!==X?(q=(0,t.jsxs)("div",{className:R,"data-testid":W,children:[B,E,U,P,X]}),e[41]=B,e[42]=E,e[43]=U,e[44]=P,e[45]=X,e[46]=q):q=e[46],q},"Be");function et(r){return r.id}y(et,"He");var tt=fe(me.dropOutboxEntry),rt=fe(me.retryOutboxEntry),lt=y(()=>{let r=(0,G.c)(8),e=V(),o;r[0]!==e?(o=e("Jobs whose mutation committed but that the scheduler has not accepted yet wait here."),r[0]=e,r[1]=o):o=r[1];let n;r[2]===Symbol.for("react.memo_cache_sentinel")?(n=(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 4h16v12H4zM4 16l4 4h8l4-4"})}),r[2]=n):n=r[2];let l;r[3]!==e?(l=e("Nothing is waiting for the scheduler."),r[3]=e,r[4]=l):l=r[4];let s;return r[5]!==o||r[6]!==l?(s=(0,t.jsx)(se,{description:o,icon:n,testId:"outbox-empty",title:l}),r[5]=o,r[6]=l,r[7]=s):s=r[7],s},"ze"),at=y(r=>{let e=(0,G.c)(58),{entry:o,onAct:n}=r,l=V(),s=`outbox-row-${o.id}`,a;e[0]!==o.target||e[1]!==l?(a=o.target??l("unreadable"),e[0]=o.target,e[1]=l,e[2]=a):a=e[2];let i;e[3]!==a?(i=(0,t.jsx)(K,{className:"font-mono text-xs",children:a}),e[3]=a,e[4]=i):i=e[4];let c=o.parked?"destructive":"secondary",N;e[5]!==o.parked||e[6]!==l?(N=o.parked?l("parked"):l("retrying"),e[5]=o.parked,e[6]=l,e[7]=N):N=e[7];let p;e[8]!==c||e[9]!==N?(p=(0,t.jsx)(oe,{variant:c,children:N}),e[8]=c,e[9]=N,e[10]=p):p=e[10];let h;e[11]!==o.forever||e[12]!==l?(h=o.forever&&(0,t.jsx)(oe,{variant:"outline",children:l("forever")}),e[11]=o.forever,e[12]=l,e[13]=h):h=e[13];let m;e[14]!==p||e[15]!==h?(m=(0,t.jsx)(K,{children:(0,t.jsxs)("div",{className:"flex gap-1",children:[p,h]})}),e[14]=p,e[15]=h,e[16]=m):m=e[16];let k;e[17]!==o.attempts?(k=(0,t.jsx)(K,{className:"tabular-nums",children:o.attempts}),e[17]=o.attempts,e[18]=k):k=e[18];let f;e[19]!==o.nextAttemptAt||e[20]!==o.parked?(f=o.parked?"\u2014":le(o.nextAttemptAt,"\u2014"),e[19]=o.nextAttemptAt,e[20]=o.parked,e[21]=f):f=e[21];let d;e[22]!==f?(d=(0,t.jsx)(K,{className:"text-muted-foreground tabular-nums",children:f}),e[22]=f,e[23]=d):d=e[23];let u;e[24]!==o.id?(u=(0,t.jsx)(K,{className:"font-mono text-xs",children:o.id}),e[24]=o.id,e[25]=u):u=e[25];let v=`outbox-retry-${o.id}`,b;e[26]!==o.id||e[27]!==n?(b=y(()=>{Y(n(rt,o.id))},"b"),e[26]=o.id,e[27]=n,e[28]=b):b=e[28];let S;e[29]!==l?(S=l("Retry now"),e[29]=l,e[30]=S):S=e[30];let I;e[31]!==v||e[32]!==b||e[33]!==S?(I=(0,t.jsx)(ce,{"data-testid":v,onClick:b,size:"sm",type:"button",variant:"outline",children:S}),e[31]=v,e[32]=b,e[33]=S,e[34]=I):I=e[34];let w;e[35]!==l?(w=l("Drop job?"),e[35]=l,e[36]=w):w=e[36];let C;e[37]!==o.id||e[38]!==n?(C=y(()=>{Y(n(tt,o.id))},"T"),e[37]=o.id,e[38]=n,e[39]=C):C=e[39];let J=`outbox-drop-${o.id}`,$;e[40]!==l?($=l("Drop"),e[40]=l,e[41]=$):$=e[41];let j;e[42]!==w||e[43]!==C||e[44]!==J||e[45]!==$?(j=(0,t.jsx)(ue,{confirmLabel:w,onConfirm:C,testId:J,children:$}),e[42]=w,e[43]=C,e[44]=J,e[45]=$,e[46]=j):j=e[46];let x;e[47]!==I||e[48]!==j?(x=(0,t.jsx)(K,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[I,j]})}),e[47]=I,e[48]=j,e[49]=x):x=e[49];let A;return e[50]!==s||e[51]!==d||e[52]!==u||e[53]!==x||e[54]!==i||e[55]!==m||e[56]!==k?(A=(0,t.jsxs)(z,{"data-testid":s,children:[i,m,k,d,u,x]}),e[50]=s,e[51]=d,e[52]=u,e[53]=x,e[54]=i,e[55]=m,e[56]=k,e[57]=A):A=e[57],A},"We"),ot=y(r=>{let e=(0,G.c)(41),{entries:o,onAct:n}=r,l=V(),s;e[0]!==l?(s=l("function"),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==s?(a=(0,t.jsx)(L,{children:s}),e[2]=s,e[3]=a):a=e[3];let i;e[4]!==l?(i=l("state"),e[4]=l,e[5]=i):i=e[5];let c;e[6]!==i?(c=(0,t.jsx)(L,{children:i}),e[6]=i,e[7]=c):c=e[7];let N;e[8]!==l?(N=l("attempts"),e[8]=l,e[9]=N):N=e[9];let p;e[10]!==N?(p=(0,t.jsx)(L,{children:N}),e[10]=N,e[11]=p):p=e[11];let h;e[12]!==l?(h=l("next attempt"),e[12]=l,e[13]=h):h=e[13];let m;e[14]!==h?(m=(0,t.jsx)(L,{children:h}),e[14]=h,e[15]=m):m=e[15];let k;e[16]!==l?(k=l("id"),e[16]=l,e[17]=k):k=e[17];let f;e[18]!==k?(f=(0,t.jsx)(L,{children:k}),e[18]=k,e[19]=f):f=e[19];let d;e[20]!==l?(d=l("Actions"),e[20]=l,e[21]=d):d=e[21];let u;e[22]!==d?(u=(0,t.jsx)(L,{"aria-label":d}),e[22]=d,e[23]=u):u=e[23];let v;e[24]!==f||e[25]!==u||e[26]!==a||e[27]!==c||e[28]!==p||e[29]!==m?(v=(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[a,c,p,m,f,u]})}),e[24]=f,e[25]=u,e[26]=a,e[27]=c,e[28]=p,e[29]=m,e[30]=v):v=e[30];let b;if(e[31]!==o||e[32]!==n){let w;e[34]!==n?(w=y(C=>(0,t.jsx)(at,{entry:C,onAct:n},C.id),"N"),e[34]=n,e[35]=w):w=e[35],b=o.map(w),e[31]=o,e[32]=n,e[33]=b}else b=e[33];let S;e[36]!==b?(S=(0,t.jsx)(re,{children:b}),e[36]=b,e[37]=S):S=e[37];let I;return e[38]!==v||e[39]!==S?(I=(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"outbox-table",children:[v,S]})})}),e[38]=v,e[39]=S,e[40]=I):I=e[40],I},"Ge"),nt=y(r=>{let e=(0,G.c)(11),{cursor:o,nextCursor:n,onFirst:l,onNext:s}=r,a=V();if(o===void 0&&n===void 0)return;let i;e[0]!==o||e[1]!==l||e[2]!==a?(i=o!==void 0&&(0,t.jsx)(ce,{"data-testid":"outbox-first-page",onClick:l,size:"sm",type:"button",variant:"outline",children:a("First page")}),e[0]=o,e[1]=l,e[2]=a,e[3]=i):i=e[3];let c;e[4]!==n||e[5]!==s||e[6]!==a?(c=n!==void 0&&(0,t.jsx)(ce,{"data-testid":"outbox-next-page",onClick:y(()=>{s(n)},"onClick"),size:"sm",type:"button",variant:"outline",children:a("Next page")}),e[4]=n,e[5]=s,e[6]=a,e[7]=c):c=e[7];let N;return e[8]!==i||e[9]!==c?(N=(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[i,c]}),e[8]=i,e[9]=c,e[10]=N):N=e[10],N},"Ye"),st=y(r=>{let e=(0,G.c)(38),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{initialShardKey:n}=o,l=je(),s=V(),{queryShardKey:a,setShardKey:i,shardKey:c}=ge(n),N;e[2]!==a?(N={cursor:void 0,shardKey:a},e[2]=a,e[3]=N):N=e[3];let[p,h]=(0,Q.useState)(N);p.shardKey!==a&&h({cursor:void 0,shardKey:a});let m=p.shardKey===a?p.cursor:void 0,k=c.trim()!==a,f;e[4]!==m?(f=m===void 0?{}:{cursor:m},e[4]=m,e[5]=f):f=e[5];let d;e[6]!==a?(d={shardKey:a},e[6]=a,e[7]=d):d=e[7];let{data:u,error:v,poll:b,refetch:S}=ve(me.getScheduleOutbox,f,d),I=k?void 0:u?.entries,w=k?void 0:u?.nextCursor,[C,J]=(0,Q.useState)(void 0),$=v??(C?.shardKey===a?C.message:void 0);ae(b,!0);let j;e[8]!==l||e[9]!==a||e[10]!==S||e[11]!==s?(j=y(async(B,E)=>{J(void 0);try{(await l.query(B,{id:E},Ae(a))).retried===!1&&J({message:s("That job is no longer in the outbox."),shardKey:a}),S()}catch(U){J({message:ie(U),shardKey:a})}},"A"),e[8]=l,e[9]=a,e[10]=S,e[11]=s,e[12]=j):j=e[12];let x=j,A;e[13]!==i||e[14]!==c?(A=(0,t.jsx)(be,{onChange:i,testId:"outbox-shard-input",value:c}),e[13]=i,e[14]=c,e[15]=A):A=e[15];let g;e[16]!==$?(g=$!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"outbox-error",role:"alert",children:$}),e[16]=$,e[17]=g):g=e[17];let F;e[18]!==m||e[19]!==I?.length?(F=I?.length===0&&m===void 0&&(0,t.jsx)(lt,{}),e[18]=m,e[19]=I?.length,e[20]=F):F=e[20];let _;e[21]!==x||e[22]!==I?(_=I!==void 0&&I.length>0&&(0,t.jsx)(ot,{entries:I,onAct:x}),e[21]=x,e[22]=I,e[23]=_):_=e[23];let T,M;e[24]!==a?(T=y(()=>{h({cursor:void 0,shardKey:a})},"E"),M=y(B=>{h({cursor:B,shardKey:a})},"_"),e[24]=a,e[25]=T,e[26]=M):(T=e[25],M=e[26]);let R;e[27]!==m||e[28]!==w||e[29]!==T||e[30]!==M?(R=(0,t.jsx)(nt,{cursor:m,nextCursor:w,onFirst:T,onNext:M}),e[27]=m,e[28]=w,e[29]=T,e[30]=M,e[31]=R):R=e[31];let W;return e[32]!==R||e[33]!==A||e[34]!==g||e[35]!==F||e[36]!==_?(W=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-schedule-outbox",children:[A,g,F,_,R]}),e[32]=R,e[33]=A,e[34]=g,e[35]=F,e[36]=_,e[37]=W):W=e[37],W},"je"),it="scheduler.lag_ms",Ne=y(r=>{let e=r.attributes?.function;return typeof e=="string"?e:r.functionPath},"he"),ke=y(r=>{let e=(0,G.c)(8),{label:o,testId:n,value:l}=r,s;e[0]!==o?(s=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=s):s=e[1];let a;e[2]!==n||e[3]!==l?(a=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":n,children:l}),e[2]=n,e[3]=l,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=(0,t.jsx)(Z,{className:"flex-1 py-0",children:(0,t.jsxs)(H,{className:"flex flex-col gap-1 p-4",children:[s,a]})}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i},"fe"),dt=y(r=>{let e=(0,G.c)(65),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{initialShardKey:n,loadStatus:l}=o,s=de(),a=V(),i=l===void 0,c;e[2]!==i?(c=["lunora-scheduler-status",i],e[2]=i,e[3]=c):c=e[3];let N;e[4]!==s||e[5]!==l?(N=y(async()=>{let B=await(l??(()=>s.schedulerStatus()))();return{...B,pools:B.pools.toSorted(ct)}},"v"),e[4]=s,e[5]=l,e[6]=N):N=e[6];let p=ne(c,N),{data:h,error:m}=p,{queryShardKey:k,setShardKey:f,shardKey:d}=ge(n),u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u={},e[7]=u):u=e[7];let v;e[8]!==k?(v={shardKey:k},e[8]=k,e[9]=v):v=e[9];let b=ve(me.getMetricSeries,u,v),{data:S,errorSource:I}=b,w;e[10]!==I||e[11]!==b.error?(w=xe(I)==="FUNCTION_NOT_FOUND"?null:b.error,e[10]=I,e[11]=b.error,e[12]=w):w=e[12];let C=w,J;e[13]!==p?(J=y(()=>p.poll(),"L"),e[13]=p,e[14]=J):J=e[14],ae(J,!0);let $;e[15]!==b?($=y(()=>b.poll(),"$"),e[15]=b,e[16]=$):$=e[16],ae($,!0);let j,x,A,g,F,_,T,M;if(e[17]!==m||e[18]!==S||e[19]!==C||e[20]!==f||e[21]!==d||e[22]!==h||e[23]!==a){let B=(Array.isArray(S?.series)?S.series:[]).filter(ht).toSorted(ut);j="flex flex-col gap-3",x="lunora-scheduler-pools",e[32]!==m?(A=m!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:m}),e[32]=m,e[33]=A):A=e[33],e[34]!==h||e[35]!==a?(g=h!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(ke,{label:a("backlog"),testId:"pools-backlog",value:h.backlog}),(0,t.jsx)(ke,{label:a("in flight"),testId:"pools-inflight",value:h.inFlight}),(0,t.jsx)(ke,{label:a("pools"),testId:"pools-count",value:h.pools.length})]}),e[34]=h,e[35]=a,e[36]=g):g=e[36],e[37]!==h?.pools.length||e[38]!==a?(F=h?.pools.length===0&&(0,t.jsx)(se,{description:a("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:a("No workpools.")}),e[37]=h?.pools.length,e[38]=a,e[39]=F):F=e[39];let E;e[40]!==f||e[41]!==d?(E=(0,t.jsx)(be,{onChange:f,testId:"lag-shard-input",value:d}),e[40]=f,e[41]=d,e[42]=E):E=e[42];let U;e[43]!==a?(U=a("Start lag per job on this shard since it last woke; the series reset when the shard hibernates."),e[43]=a,e[44]=U):U=e[44];let P;e[45]!==U?(P=(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"lag-scope",children:U}),e[45]=U,e[46]=P):P=e[46],e[47]!==E||e[48]!==P?(_=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[E,P]}),e[47]=E,e[48]=P,e[49]=_):_=e[49],e[50]!==C?(T=C!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"lag-error",role:"alert",children:C}),e[50]=C,e[51]=T):T=e[51],M=C===null&&B.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"lag-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:a("function")}),(0,t.jsx)(L,{children:a("runs")}),(0,t.jsx)(L,{children:a("mean lag (ms)")}),(0,t.jsx)(L,{children:a("max lag (ms)")}),(0,t.jsx)(L,{children:a("last lag (ms)")})]})}),(0,t.jsx)(re,{children:B.map(mt)})]})})}),e[17]=m,e[18]=S,e[19]=C,e[20]=f,e[21]=d,e[22]=h,e[23]=a,e[24]=j,e[25]=x,e[26]=A,e[27]=g,e[28]=F,e[29]=_,e[30]=T,e[31]=M}else j=e[24],x=e[25],A=e[26],g=e[27],F=e[28],_=e[29],T=e[30],M=e[31];let R;e[52]!==h||e[53]!==a?(R=h!==void 0&&h.pools.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"pools-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:a("pool")}),(0,t.jsx)(L,{children:a("queued")}),(0,t.jsx)(L,{children:a("in flight")}),(0,t.jsx)(L,{children:a("max concurrency")})]})}),(0,t.jsx)(re,{children:h.pools.map(pt)})]})})}),e[52]=h,e[53]=a,e[54]=R):R=e[54];let W;return e[55]!==j||e[56]!==x||e[57]!==A||e[58]!==g||e[59]!==F||e[60]!==_||e[61]!==T||e[62]!==M||e[63]!==R?(W=(0,t.jsxs)("div",{className:j,"data-testid":x,children:[A,g,F,_,T,M,R]}),e[55]=j,e[56]=x,e[57]=A,e[58]=g,e[59]=F,e[60]=_,e[61]=T,e[62]=M,e[63]=R,e[64]=W):W=e[64],W},"Ze");function ct(r,e){return e.queued-r.queued}y(ct,"et");function ht(r){return r.name===it&&r.kind==="histogram"&&r.count>0}y(ht,"tt");function ut(r,e){return e.max-r.max}y(ut,"st");function mt(r){return(0,t.jsxs)(z,{"data-testid":`lag-row-${Ne(r)}`,children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:Ne(r)}),(0,t.jsx)(K,{className:"tabular-nums",children:r.count}),(0,t.jsx)(K,{className:"tabular-nums",children:Math.round(r.sum/r.count)}),(0,t.jsx)(K,{className:"tabular-nums",children:r.max}),(0,t.jsx)(K,{className:"tabular-nums",children:r.last})]},Ne(r))}y(mt,"lt");function pt(r){return(0,t.jsxs)(z,{"data-testid":`pools-row-${r.name}`,children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:r.name}),(0,t.jsx)(K,{className:"tabular-nums",children:r.queued}),(0,t.jsxs)(K,{className:"tabular-nums",children:[r.inFlight," / ",r.maxConcurrency]}),(0,t.jsx)(K,{className:"tabular-nums",children:r.maxConcurrency})]},r.name)}y(pt,"rt");var ft=["jobs","outbox","history","dead","pools","cron"],Vt=y(r=>{let e=(0,G.c)(55),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{initialShardKey:n,loadCronJobs:l,scheduledCancel:s,scheduledLoad:a}=o,i=V(),[c,N]=(0,Q.useState)("jobs"),p;e[2]!==i?(p=i("Cron triggers"),e[2]=i,e[3]=p):p=e[3];let h;e[4]!==i?(h=i("Dead letter"),e[4]=i,e[5]=h):h=e[5];let m;e[6]!==i?(m=i("History"),e[6]=i,e[7]=m):m=e[7];let k;e[8]!==i?(k=i("Scheduled jobs"),e[8]=i,e[9]=k):k=e[9];let f;e[10]!==i?(f=i("Outbox"),e[10]=i,e[11]=f):f=e[11];let d;e[12]!==i?(d=i("Pools"),e[12]=i,e[13]=d):d=e[13];let u;e[14]!==p||e[15]!==h||e[16]!==m||e[17]!==k||e[18]!==f||e[19]!==d?(u={cron:p,dead:h,history:m,jobs:k,outbox:f,pools:d},e[14]=p,e[15]=h,e[16]=m,e[17]=k,e[18]=f,e[19]=d,e[20]=u):u=e[20];let v=u,b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=y(T=>{N(T.currentTarget.dataset.view)},"b"),e[21]=b):b=e[21];let S=b,I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=(0,t.jsx)(Le,{}),e[22]=I):I=e[22];let w;e[23]!==i?(w=i("Schedule view"),e[23]=i,e[24]=w):w=e[24];let C;e[25]!==c||e[26]!==v?(C=ft.map(T=>(0,t.jsx)(ce,{"aria-selected":c===T,"data-testid":`schedule-view-${T}`,"data-view":T,onClick:S,role:"tab",size:"sm",type:"button",variant:c===T?"default":"outline",children:v[T]},T)),e[25]=c,e[26]=v,e[27]=C):C=e[27];let J;e[28]!==w||e[29]!==C?(J=(0,t.jsx)("div",{"aria-label":w,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:C}),e[28]=w,e[29]=C,e[30]=J):J=e[30];let $;e[31]!==s||e[32]!==a||e[33]!==c?($=c==="jobs"&&(0,t.jsx)(Te,{cancelJob:s,loadJobs:a}),e[31]=s,e[32]=a,e[33]=c,e[34]=$):$=e[34];let j;e[35]!==c?(j=c==="outbox"&&(0,t.jsx)(st,{}),e[35]=c,e[36]=j):j=e[36];let x;e[37]!==c?(x=c==="history"&&(0,t.jsx)(He,{}),e[37]=c,e[38]=x):x=e[38];let A;e[39]!==c?(A=c==="dead"&&(0,t.jsx)(Xe,{}),e[39]=c,e[40]=A):A=e[40];let g;e[41]!==n||e[42]!==c?(g=c==="pools"&&(0,t.jsx)(dt,{initialShardKey:n}),e[41]=n,e[42]=c,e[43]=g):g=e[43];let F;e[44]!==l||e[45]!==c?(F=c==="cron"&&(0,t.jsx)(Ge,{loadCronJobs:l}),e[44]=l,e[45]=c,e[46]=F):F=e[46];let _;return e[47]!==J||e[48]!==$||e[49]!==j||e[50]!==x||e[51]!==A||e[52]!==g||e[53]!==F?(_=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[I,J,$,j,x,A,g,F]}),e[47]=J,e[48]=$,e[49]=j,e[50]=x,e[51]=A,e[52]=g,e[53]=F,e[54]=_):_=e[54],_},"It");export{Vt as SchedulePanel};
|
|
1
|
+
import{a as $e}from"./chunk-CBFVQCWS.js";import{g as Le}from"./chunk-BMGMBZAW.js";import"./chunk-AFLNQEZ5.js";import"./chunk-HE2XT2P7.js";import"./chunk-CL3JOU6F.js";import{a as ae}from"./chunk-BUYKTV27.js";import"./chunk-GATWEWRW.js";import"./chunk-ZUFBUWT4.js";import"./chunk-HXFXD5EP.js";import"./chunk-EUNTXABP.js";import"./chunk-7XZENNML.js";import"./chunk-2NUCBQFU.js";import{a as ge}from"./chunk-2KTN53PK.js";import{a as be}from"./chunk-YC3TUO5H.js";import"./chunk-EDL46BPM.js";import"./chunk-DA2CAFXI.js";import{a as ue}from"./chunk-M6WDFEUZ.js";import"./chunk-4KPATTV6.js";import"./chunk-2ZNMZPPZ.js";import"./chunk-F4NZZ3LK.js";import{j as Je}from"./chunk-SQO3WGXH.js";import"./chunk-R76ATTPC.js";import"./chunk-4AG356VE.js";import{a as ce}from"./chunk-ECXQQPVU.js";import"./chunk-EOHXBC4U.js";import"./chunk-JEJV6SVN.js";import{a as se}from"./chunk-V5ZKAZR6.js";import{b as oe}from"./chunk-UB6S6VYI.js";import"./chunk-DMQVY5L7.js";import{a as ee,b as te,c as re,d as z,e as L,f as K}from"./chunk-WVAWKCNQ.js";import"./chunk-VLQU4G6O.js";import"./chunk-EOFWXI3T.js";import{a as me}from"./chunk-LYVYUTQY.js";import{b as ne,c as ve}from"./chunk-LUHBGCMO.js";import{a as Z,e as H}from"./chunk-VUMS4VIV.js";import{l as je,n as de}from"./chunk-PLCYDHU3.js";import"./chunk-WY23EROJ.js";import{B as V,h as fe,i as Ae,j as ie,k as xe,s as Y,w as le,x as Ie}from"./chunk-G4H5DPO6.js";import"./chunk-JSVT5VBU.js";import{a as Ce}from"./chunk-A6TVTNKO.js";import{a as we,b as Se}from"./chunk-ADABTCDI.js";import{a as y,d as he}from"./chunk-5PEAXTYQ.js";var G=he(Ce(),1),Q=he(we(),1);var t=he(Se(),1);var Fe=he(Ce(),1),pe=he(we(),1);var D=he(Se(),1);var Me=y(r=>Number.isFinite(r)?le(r,"\u2014"):"\u2014","X"),Ke=y(r=>r.toSorted((e,o)=>e.scheduledFor-o.scheduledFor),"F"),Be=y((r,e,o)=>e!==void 0?e:o===void 0?n=>r.cancelScheduledJob(n):void 0,"Y"),Te=y(r=>{let e=(0,Fe.c)(16),{cancelJob:o,loadJobs:n}=r===void 0?{}:r,l=de(),s=V(),a=n===void 0,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["lunora-scheduled-jobs"],e[0]=i):i=e[0];let c=ne(i,async()=>{let x=await(n??(()=>l.listScheduledJobs()))();return Ke(x)}),[N,p]=(0,pe.useState)(void 0),[h,m]=(0,pe.useState)(void 0),k,f;e[1]!==l||e[2]!==a?(k=y(()=>{if(a)return l.subscribeScheduledJobs(x=>{m(void 0),p(Ke(x))})},"v"),f=[a,l],e[1]=l,e[2]=a,e[3]=k,e[4]=f):(k=e[3],f=e[4]),(0,pe.useEffect)(k,f);let d;e[5]!==c?(d=y(()=>c.poll(),"y"),e[5]=c,e[6]=d):d=e[6],ae(d,!a);let u=Be(l,o,n),v=N??c.data,b=h??c.error,S=y(async x=>{if(u!==void 0){m(void 0);try{await u(x),a||c.refetch()}catch(A){m(ie(A))}}},"E"),I="flex flex-col gap-3",w="lunora-scheduled-jobs",C;e[7]!==b?(C=b!==null&&(0,D.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:b}),e[7]=b,e[8]=C):C=e[8];let J;e[9]!==v?.length||e[10]!==s?(J=v?.length===0&&(0,D.jsx)(se,{description:s("Jobs queued with runAfter / runAt will appear here."),icon:(0,D.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,D.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,D.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:s("No scheduled jobs.")}),e[9]=v?.length,e[10]=s,e[11]=J):J=e[11];let $=v!==void 0&&v.length>0&&(0,D.jsx)(Z,{className:"overflow-hidden py-0",children:(0,D.jsx)(H,{className:"px-0",children:(0,D.jsxs)(ee,{"data-testid":"sj-table",children:[(0,D.jsx)(te,{children:(0,D.jsxs)(z,{children:[(0,D.jsx)(L,{children:s("function")}),(0,D.jsx)(L,{children:s("scheduled for")}),(0,D.jsx)(L,{children:s("pool")}),(0,D.jsx)(L,{children:s("attempts")}),(0,D.jsx)(L,{children:s("shard")}),(0,D.jsx)(L,{children:s("id")}),u!==void 0&&(0,D.jsx)(L,{"aria-label":s("Actions")})]})}),(0,D.jsx)(re,{children:v.map(x=>(0,D.jsxs)(z,{"data-testid":`sj-row-${x.id}`,children:[(0,D.jsx)(K,{className:"font-mono text-xs",children:x.workflow??x.functionPath}),(0,D.jsx)(K,{className:"text-muted-foreground tabular-nums",children:Me(x.scheduledFor)}),(0,D.jsx)(K,{className:"font-mono text-xs",children:x.pool??""}),(0,D.jsx)(K,{className:"tabular-nums",children:x.attempts??0}),(0,D.jsx)(K,{children:x.shardKey??""}),(0,D.jsx)(K,{className:"font-mono text-xs",children:x.id}),u!==void 0&&(0,D.jsx)(K,{className:"text-right",children:(0,D.jsx)(ue,{confirmLabel:s("Cancel job?"),onConfirm:y(()=>{Y(S(x.id))},"onConfirm"),testId:`sj-cancel-${x.id}`,children:s("Cancel")})})]},x.id))})]})})}),j;return e[12]!==$||e[13]!==C||e[14]!==J?(j=(0,D.jsxs)("div",{className:I,"data-testid":w,children:[C,J,$]}),e[12]=$,e[13]=C,e[14]=J,e[15]=j):j=e[15],j},"he");var _e={failed:"destructive",skipped:"warning",succeeded:"success"},Re=25,Pe=y(r=>r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(1)} s`,"Ee"),Oe=y(r=>{let e=(0,G.c)(39),{inFlight:o,last:n}=r,l=V();if(o!==void 0){let u;e[0]!==l?(u=l("running"),e[0]=l,e[1]=u):u=e[1];let v;e[2]!==u?(v=(0,t.jsx)(oe,{variant:"info",children:u}),e[2]=u,e[3]=v):v=e[3];let b;e[4]!==o.startedAt?(b=le(o.startedAt,"\u2014"),e[4]=o.startedAt,e[5]=b):b=e[5];let S;e[6]!==b?(S=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:b}),e[6]=b,e[7]=S):S=e[7];let I;e[8]!==o.skipped||e[9]!==l?(I=o.skipped>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l("{count} ticks skipped",{count:o.skipped})}),e[8]=o.skipped,e[9]=l,e[10]=I):I=e[10];let w;return e[11]!==v||e[12]!==S||e[13]!==I?(w=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[v,S,I]}),e[11]=v,e[12]=S,e[13]=I,e[14]=w):w=e[14],w}if(n===void 0){let u;e[15]!==l?(u=l("never"),e[15]=l,e[16]=u):u=e[16];let v;return e[17]!==u?(v=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:u}),e[17]=u,e[18]=v):v=e[18],v}let s;e[19]!==l?(s=l("failed"),e[19]=l,e[20]=s):s=e[20];let a;e[21]!==l?(a=l("skipped"),e[21]=l,e[22]=a):a=e[22];let i;e[23]!==l?(i=l("succeeded"),e[23]=l,e[24]=i):i=e[24];let c;e[25]!==s||e[26]!==a||e[27]!==i?(c={failed:s,skipped:a,succeeded:i},e[25]=s,e[26]=a,e[27]=i,e[28]=c):c=e[28];let N=c,p=_e[n.status],h=N[n.status],m;e[29]!==p||e[30]!==h?(m=(0,t.jsx)(oe,{variant:p,children:h}),e[29]=p,e[30]=h,e[31]=m):m=e[31];let k;e[32]!==n.startedAt?(k=le(n.startedAt,"\u2014"),e[32]=n.startedAt,e[33]=k):k=e[33];let f;e[34]!==k?(f=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:k}),e[34]=k,e[35]=f):f=e[35];let d;return e[36]!==m||e[37]!==f?(d=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[m,f]}),e[36]=m,e[37]=f,e[38]=d):d=e[38],d},"Re"),Ee=y(r=>{let e=(0,G.c)(80),{runs:o}=r,n=V();if(o.length===0)return;let l,s,a,i,c,N,p,h,m,k,f;if(e[0]!==o||e[1]!==n){let I=o.toSorted(Ue).slice(0,Re),w;e[13]!==n?(w=n("failed"),e[13]=n,e[14]=w):w=e[14];let C;e[15]!==n?(C=n("skipped"),e[15]=n,e[16]=C):C=e[16];let J;e[17]!==n?(J=n("succeeded"),e[17]=n,e[18]=J):J=e[18];let $;e[19]!==J||e[20]!==w||e[21]!==C?($={failed:w,skipped:C,succeeded:J},e[19]=J,e[20]=w,e[21]=C,e[22]=$):$=e[22];let j=$;m="flex flex-col gap-2",k="cron-run-history";let x;e[23]!==n?(x=n("Recent runs"),e[23]=n,e[24]=x):x=e[24],e[25]!==x?(f=(0,t.jsx)("h3",{className:"text-sm font-medium",children:x}),e[25]=x,e[26]=f):f=e[26],i=Z,h="overflow-hidden py-0",a=H,p="px-0",s=ee;let A;e[27]!==n?(A=n("name"),e[27]=n,e[28]=A):A=e[28];let g;e[29]!==A?(g=(0,t.jsx)(L,{children:A}),e[29]=A,e[30]=g):g=e[30];let F;e[31]!==n?(F=n("status"),e[31]=n,e[32]=F):F=e[32];let _;e[33]!==F?(_=(0,t.jsx)(L,{children:F}),e[33]=F,e[34]=_):_=e[34];let T;e[35]!==n?(T=n("started"),e[35]=n,e[36]=T):T=e[36];let M;e[37]!==T?(M=(0,t.jsx)(L,{children:T}),e[37]=T,e[38]=M):M=e[38];let R;e[39]!==n?(R=n("duration"),e[39]=n,e[40]=R):R=e[40];let W;e[41]!==R?(W=(0,t.jsx)(L,{children:R}),e[41]=R,e[42]=W):W=e[42];let B;e[43]!==n?(B=n("skipped"),e[43]=n,e[44]=B):B=e[44];let E;e[45]!==B?(E=(0,t.jsx)(L,{children:B}),e[45]=B,e[46]=E):E=e[46];let U;e[47]!==n?(U=n("error"),e[47]=n,e[48]=U):U=e[48];let P;e[49]!==U?(P=(0,t.jsx)(L,{children:U}),e[49]=U,e[50]=P):P=e[50],e[51]!==g||e[52]!==_||e[53]!==M||e[54]!==W||e[55]!==E||e[56]!==P?(N=(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[g,_,M,W,E,P]})}),e[51]=g,e[52]=_,e[53]=M,e[54]=W,e[55]=E,e[56]=P,e[57]=N):N=e[57],l=re;let X;e[58]!==j?(X=y(q=>(0,t.jsxs)(z,{"data-testid":`cron-run-row-${q.runId}`,children:[(0,t.jsx)(K,{children:q.name}),(0,t.jsx)(K,{children:(0,t.jsx)(oe,{variant:_e[q.status],children:j[q.status]})}),(0,t.jsx)(K,{className:"text-muted-foreground tabular-nums",children:le(q.startedAt,"\u2014")}),(0,t.jsx)(K,{className:"tabular-nums",children:q.status==="skipped"?"":Pe(q.durationMs)}),(0,t.jsx)(K,{className:"tabular-nums",children:q.skipped>0?q.skipped:""}),(0,t.jsx)(K,{className:"text-xs text-destructive",children:q.error??""})]},q.runId),"W"),e[58]=j,e[59]=X):X=e[59],c=I.map(X),e[0]=o,e[1]=n,e[2]=l,e[3]=s,e[4]=a,e[5]=i,e[6]=c,e[7]=N,e[8]=p,e[9]=h,e[10]=m,e[11]=k,e[12]=f}else l=e[2],s=e[3],a=e[4],i=e[5],c=e[6],N=e[7],p=e[8],h=e[9],m=e[10],k=e[11],f=e[12];let d;e[60]!==l||e[61]!==c?(d=(0,t.jsx)(l,{children:c}),e[60]=l,e[61]=c,e[62]=d):d=e[62];let u;e[63]!==s||e[64]!==N||e[65]!==d?(u=(0,t.jsxs)(s,{children:[N,d]}),e[63]=s,e[64]=N,e[65]=d,e[66]=u):u=e[66];let v;e[67]!==a||e[68]!==p||e[69]!==u?(v=(0,t.jsx)(a,{className:p,children:u}),e[67]=a,e[68]=p,e[69]=u,e[70]=v):v=e[70];let b;e[71]!==i||e[72]!==v||e[73]!==h?(b=(0,t.jsx)(i,{className:h,children:v}),e[71]=i,e[72]=v,e[73]=h,e[74]=b):b=e[74];let S;return e[75]!==b||e[76]!==m||e[77]!==k||e[78]!==f?(S=(0,t.jsxs)("div",{className:m,"data-testid":k,children:[f,b]}),e[75]=b,e[76]=m,e[77]=k,e[78]=f,e[79]=S):S=e[79],S},"Le");function Ue(r,e){return e.startedAt-r.startedAt}y(Ue,"Oe");var We=y(()=>{let r=(0,G.c)(50),e=V(),o=$e(""),[n,l]=(0,Q.useState)(""),[s,a]=(0,Q.useState)(void 0),[i,c]=(0,Q.useState)(!1);if(o.unavailable)return null;let N;r[0]!==o?(N=o.pending("cron"),r[0]=o,r[1]=N):N=r[1];let p=N,h;r[2]!==o?(h=o.reason("cron"),r[2]=o,r[3]=h):h=r[3];let m=h,k;r[4]!==n||r[5]!==o?(k=y(()=>{let T=n.trim();T!==""&&Y((async()=>{let M=await o.suggestCron(T);c(!1),a(M)})())},"y"),r[4]=n,r[5]=o,r[6]=k):k=r[6];let f=k,d;r[7]!==s?(d=y(()=>{let T="navigator"in globalThis?globalThis.navigator.clipboard:void 0;T===void 0||s===void 0||Y((async()=>{try{await T.writeText(s),c(!0)}catch{c(!1)}})())},"d"),r[7]=s,r[8]=d):d=r[8];let u=d,v;r[9]!==e?(v=e("Describe a schedule"),r[9]=e,r[10]=v):v=r[10];let b;r[11]===Symbol.for("react.memo_cache_sentinel")?(b=y(T=>{l(T.target.value)},"b"),r[11]=b):b=r[11];let S;r[12]!==f?(S=y(T=>{T.key==="Enter"&&(T.preventDefault(),f())},"w"),r[12]=f,r[13]=S):S=r[13];let I;r[14]!==e?(I=e("Describe a schedule"),r[14]=e,r[15]=I):I=r[15];let w;r[16]!==p||r[17]!==n||r[18]!==v||r[19]!==S||r[20]!==I?(w=(0,t.jsx)(Je,{"aria-label":v,className:"h-7 flex-1 text-xs","data-testid":"cron-assistant-prompt",disabled:p,onChange:b,onKeyDown:S,placeholder:I,value:n}),r[16]=p,r[17]=n,r[18]=v,r[19]=S,r[20]=I,r[21]=w):w=r[21];let C=p&&"opacity-60",J;r[22]!==C?(J=Ie("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",C),r[22]=C,r[23]=J):J=r[23];let $;r[24]!==p||r[25]!==n?($=p||n.trim()==="",r[24]=p,r[25]=n,r[26]=$):$=r[26];let j;r[27]!==p||r[28]!==e?(j=e(p?"Thinking\u2026":"Suggest schedule"),r[27]=p,r[28]=e,r[29]=j):j=r[29];let x;r[30]!==f||r[31]!==J||r[32]!==$||r[33]!==j?(x=(0,t.jsx)("button",{className:J,"data-testid":"cron-assistant-generate",disabled:$,onClick:f,type:"button",children:j}),r[30]=f,r[31]=J,r[32]=$,r[33]=j,r[34]=x):x=r[34];let A;r[35]!==x||r[36]!==w?(A=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[w,x]}),r[35]=x,r[36]=w,r[37]=A):A=r[37];let g;r[38]!==i||r[39]!==u||r[40]!==s||r[41]!==e?(g=s!==void 0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs tabular-nums","data-testid":"cron-assistant-result",children:s}),(0,t.jsx)("button",{className:"rounded-md border border-border px-2 py-0.5 text-[11px] outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cron-assistant-copy",onClick:u,type:"button",children:e(i?"Copied":"Copy")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e("Add it to lunora/crons.ts \u2014 triggers are compiled into the worker.")})]}),r[38]=i,r[39]=u,r[40]=s,r[41]=e,r[42]=g):g=r[42];let F;r[43]!==m||r[44]!==e?(F=m!==void 0&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"cron-assistant-reason",role:"status",children:e(m==="ai-error"?"The model could not be reached.":"The model did not return a schedule Cron Triggers accept.")}),r[43]=m,r[44]=e,r[45]=F):F=r[45];let _;return r[46]!==A||r[47]!==g||r[48]!==F?(_=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"cron-assistant",children:[A,g,F]}),r[46]=A,r[47]=g,r[48]=F,r[49]=_):_=r[49],_},"Ke"),ze={kind:"idle"},qe="SCHEDULER_NOT_CONFIGURED",ye={inFlight:[],runs:[]},Ve=y((r,e,o)=>o!==void 0?o:e===void 0?n=>r.runCronJob(n):void 0,"Fe"),Ge=y(({loadCronJobs:r,loadCronRuns:e,runCronJob:o}={})=>{let n=de(),l=V(),[s,a]=(0,Q.useState)({}),i=ne(["lunora-cron-jobs",r?"custom":"default"],()=>(r??(()=>n.getCronJobs()))()),{data:c,error:N}=i,p=e??(r===void 0?()=>n.listCronRuns():void 0),h=ne(["lunora-cron-runs",e?"custom":"default"],async()=>p===void 0?ye:p().catch(d=>{if(xe(d)===qe)return ye;throw d})),m=h.data??ye;ae(()=>h.poll(),p!==void 0);let k=Ve(n,r,o),f=y(async d=>{if(k!==void 0){a(u=>({...u,[d]:{kind:"running"}}));try{await k(d),a(u=>({...u,[d]:{kind:"ok"}})),i.refetch(),h.refetch()}catch(u){a(v=>({...v,[d]:{kind:"error",message:ie(u)}}))}}},"p");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[(0,t.jsx)(We,{}),N!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:N}),h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-runs-error",role:"alert",children:h.error}),c?.length===0&&(0,t.jsx)(se,{description:l("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:l("No cron triggers.")}),c!==void 0&&c.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"cron-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:l("name")}),(0,t.jsx)(L,{children:l("schedule")}),(0,t.jsx)(L,{children:l("target")}),(0,t.jsx)(L,{children:l("shard")}),(0,t.jsx)(L,{children:l("last run")}),k!==void 0&&(0,t.jsx)(L,{"aria-label":l("Actions")})]})}),(0,t.jsx)(re,{children:c.map(d=>{let u=s[d.name]??ze;return(0,t.jsxs)(z,{"data-testid":`cron-row-${d.name}`,children:[(0,t.jsx)(K,{children:d.name}),(0,t.jsx)(K,{className:"font-mono text-xs tabular-nums",children:d.cron}),(0,t.jsx)(K,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[d.workflow===void 0?(0,t.jsx)(oe,{variant:"outline",children:l("function")}):(0,t.jsx)(oe,{variant:"secondary",children:l("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:d.workflow??d.functionPath})]})}),(0,t.jsx)(K,{children:d.shardKey??""}),(0,t.jsx)(K,{"data-testid":`cron-last-run-${d.name}`,children:(0,t.jsx)(Oe,{inFlight:m.inFlight.find(v=>v.name===d.name),last:m.runs.find(v=>v.name===d.name)})}),k!==void 0&&(0,t.jsx)(K,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[u.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${d.name}`,children:l("ran")}),u.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${d.name}`,role:"alert",children:u.message}),(0,t.jsx)(ue,{confirmLabel:l("Run now?"),disabled:u.kind==="running",onConfirm:y(()=>{Y(f(d.name))},"onConfirm"),testId:`cron-run-${d.name}`,children:u.kind==="running"?l("Running\u2026"):l("Run now")})]})})]},`${d.cron}:${d.name}`)})})]})})}),(0,t.jsx)(Ee,{runs:m.runs})]})},"Je"),Qe=y(r=>Number.isFinite(r)?le(r,"\u2014"):"\u2014","Me"),Xe=y(r=>{let e=(0,G.c)(34),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{loadJobs:n,removeJob:l,retryJob:s}=o,a=de(),i=V(),c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["lunora-dead-jobs"],e[2]=c):c=e[2];let N;e[3]!==a||e[4]!==n?(N=y(async()=>(await(n??(()=>a.listDeadJobs()))()).toSorted(Ye),"v"),e[3]=a,e[4]=n,e[5]=N):N=e[5];let p=ne(c,N),h=p.data,[m,k]=(0,Q.useState)(void 0),f=p.error??m,d=n===void 0,u;e[6]!==a||e[7]!==d||e[8]!==s?(u=s??(d?g=>a.retryDeadJob(g):void 0),e[6]=a,e[7]=d,e[8]=s,e[9]=u):u=e[9];let v=u,b;e[10]!==a||e[11]!==d||e[12]!==l?(b=l??(d?g=>a.removeDeadJob(g):void 0),e[10]=a,e[11]=d,e[12]=l,e[13]=b):b=e[13];let S=b,I;e[14]!==p?(I=y(()=>p.poll(),"S"),e[14]=p,e[15]=I):I=e[15],ae(I,!0);let w;e[16]!==p?(w=y(async g=>{k(void 0);try{await g,p.refetch()}catch(F){k(ie(F))}},"N"),e[16]=p,e[17]=w):w=e[17];let C=w,J=v!==void 0||S!==void 0,$;e[18]!==f?($=f!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:f}),e[18]=f,e[19]=$):$=e[19];let j;e[20]!==h?.length||e[21]!==i?(j=h?.length===0&&(0,t.jsx)(se,{description:i("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:i("No dead-letter jobs.")}),e[20]=h?.length,e[21]=i,e[22]=j):j=e[22];let x;e[23]!==C||e[24]!==J||e[25]!==h||e[26]!==S||e[27]!==v||e[28]!==i?(x=h!==void 0&&h.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"dlq-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:i("function")}),(0,t.jsx)(L,{children:i("attempts")}),(0,t.jsx)(L,{children:i("last tried")}),(0,t.jsx)(L,{children:i("pool")}),(0,t.jsx)(L,{children:i("shard")}),(0,t.jsx)(L,{children:i("id")}),J&&(0,t.jsx)(L,{"aria-label":i("Actions")})]})}),(0,t.jsx)(re,{children:h.map(g=>(0,t.jsxs)(z,{"data-testid":`dlq-row-${g.id}`,children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:g.workflow??g.functionPath}),(0,t.jsx)(K,{className:"tabular-nums",children:g.attempts??0}),(0,t.jsx)(K,{className:"text-muted-foreground tabular-nums",children:Qe(g.scheduledFor)}),(0,t.jsx)(K,{className:"font-mono text-xs",children:g.pool??""}),(0,t.jsx)(K,{children:g.shardKey??""}),(0,t.jsx)(K,{className:"font-mono text-xs",children:g.id}),J&&(0,t.jsx)(K,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[v!==void 0&&(0,t.jsx)(ce,{"data-testid":`dlq-retry-${g.id}`,onClick:y(()=>{Y(C(v(g.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:i("Retry")}),S!==void 0&&(0,t.jsx)(ue,{confirmLabel:i("Drop job?"),onConfirm:y(()=>{Y(C(S(g.id)))},"onConfirm"),testId:`dlq-remove-${g.id}`,children:i("Drop")})]})})]},g.id))})]})})}),e[23]=C,e[24]=J,e[25]=h,e[26]=S,e[27]=v,e[28]=i,e[29]=x):x=e[29];let A;return e[30]!==x||e[31]!==$||e[32]!==j?(A=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[$,j,x]}),e[30]=x,e[31]=$,e[32]=j,e[33]=A):A=e[33],A},"Pe");function Ye(r,e){return(e.attempts??0)-(r.attempts??0)}y(Ye,"qe");var Ze={canceled:"secondary",failed:"destructive",pending:"outline",running:"info",succeeded:"success"},He=y(r=>{let e=(0,G.c)(47),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{loadJobs:n}=o,l=de(),s=V(),a;e[2]!==l||e[3]!==n?(a=n??(async O=>l.listScheduledHistory(O===void 0?{}:{cursor:O})),e[2]=l,e[3]=n,e[4]=a):a=e[4];let i=a,c=n?"custom":"default",N;e[5]!==c?(N=["lunora-job-history",c],e[5]=c,e[6]=N):N=e[6];let p;e[7]!==i?(p=y(async()=>i(),"f"),e[7]=i,e[8]=p):p=e[8];let h=ne(N,p),[m,k]=(0,Q.useState)(void 0),[f,d]=(0,Q.useState)(!1),[u,v]=(0,Q.useState)(void 0),b=h.data?.records,S;e[9]!==b?(S=new Set(b?.map(et)),e[9]=b,e[10]=S):S=e[10];let I=S,w=b===void 0?void 0:[...b,...(m?.records??[]).filter(O=>!I.has(O.id))],C=m===void 0?h.data?.cursor:m.cursor,J;e[11]!==i||e[12]!==C?(J=y(async()=>{d(!0),v(void 0);try{let O=await i(C);k(De=>({cursor:O.cursor,records:[...De?.records??[],...O.records]})),d(!1)}catch(O){v(ie(O)),d(!1)}},"L"),e[11]=i,e[12]=C,e[13]=J):J=e[13];let $=J,j;e[14]!==s?(j=s("canceled"),e[14]=s,e[15]=j):j=e[15];let x;e[16]!==s?(x=s("failed"),e[16]=s,e[17]=x):x=e[17];let A;e[18]!==s?(A=s("pending"),e[18]=s,e[19]=A):A=e[19];let g;e[20]!==s?(g=s("running"),e[20]=s,e[21]=g):g=e[21];let F;e[22]!==s?(F=s("succeeded"),e[22]=s,e[23]=F):F=e[23];let _;e[24]!==A||e[25]!==g||e[26]!==F||e[27]!==j||e[28]!==x?(_={canceled:j,failed:x,pending:A,running:g,succeeded:F},e[24]=A,e[25]=g,e[26]=F,e[27]=j,e[28]=x,e[29]=_):_=e[29];let T=_,M;e[30]!==h?(M=y(()=>h.poll(),"_"),e[30]=h,e[31]=M):M=e[31],ae(M,m===void 0);let R="flex flex-col gap-3",W="lunora-job-history",B;e[32]!==h.error?(B=h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"job-history-error",role:"alert",children:h.error}),e[32]=h.error,e[33]=B):B=e[33];let E=w?.length===0&&(0,t.jsx)(se,{description:s("Jobs that succeed, fail or are cancelled stay here for seven days."),testId:"job-history-empty",title:s("No finished jobs.")}),U=w!==void 0&&w.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"job-history-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:s("function")}),(0,t.jsx)(L,{children:s("state")}),(0,t.jsx)(L,{children:s("finished")}),(0,t.jsx)(L,{children:s("error")}),(0,t.jsx)(L,{children:s("id")})]})}),(0,t.jsx)(re,{children:w.map(O=>(0,t.jsxs)(z,{"data-testid":`job-history-row-${O.id}`,children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:O.workflow??O.functionPath}),(0,t.jsx)(K,{children:(0,t.jsx)(oe,{"data-testid":`job-history-state-${O.id}`,variant:Ze[O.state],children:T[O.state]})}),(0,t.jsx)(K,{className:"text-muted-foreground tabular-nums",children:le(O.completedAt,"\u2014")}),(0,t.jsx)(K,{className:"text-xs text-destructive",children:O.error??""}),(0,t.jsx)(K,{className:"font-mono text-xs",children:O.id})]},O.id))})]})})}),P;e[34]!==u?(P=u!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:u}),e[34]=u,e[35]=P):P=e[35];let X;e[36]!==f||e[37]!==C||e[38]!==$||e[39]!==s?(X=C!==void 0&&(0,t.jsx)("div",{children:(0,t.jsx)(ce,{"data-testid":"job-history-load-more",disabled:f,onClick:y(()=>{Y($())},"onClick"),variant:"outline",children:s(f?"Loading\u2026":"Load more")})}),e[36]=f,e[37]=C,e[38]=$,e[39]=s,e[40]=X):X=e[40];let q;return e[41]!==B||e[42]!==E||e[43]!==U||e[44]!==P||e[45]!==X?(q=(0,t.jsxs)("div",{className:R,"data-testid":W,children:[B,E,U,P,X]}),e[41]=B,e[42]=E,e[43]=U,e[44]=P,e[45]=X,e[46]=q):q=e[46],q},"Be");function et(r){return r.id}y(et,"He");var tt=fe(me.dropOutboxEntry),rt=fe(me.retryOutboxEntry),lt=y(()=>{let r=(0,G.c)(8),e=V(),o;r[0]!==e?(o=e("Jobs whose mutation committed but that the scheduler has not accepted yet wait here."),r[0]=e,r[1]=o):o=r[1];let n;r[2]===Symbol.for("react.memo_cache_sentinel")?(n=(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 4h16v12H4zM4 16l4 4h8l4-4"})}),r[2]=n):n=r[2];let l;r[3]!==e?(l=e("Nothing is waiting for the scheduler."),r[3]=e,r[4]=l):l=r[4];let s;return r[5]!==o||r[6]!==l?(s=(0,t.jsx)(se,{description:o,icon:n,testId:"outbox-empty",title:l}),r[5]=o,r[6]=l,r[7]=s):s=r[7],s},"ze"),at=y(r=>{let e=(0,G.c)(58),{entry:o,onAct:n}=r,l=V(),s=`outbox-row-${o.id}`,a;e[0]!==o.target||e[1]!==l?(a=o.target??l("unreadable"),e[0]=o.target,e[1]=l,e[2]=a):a=e[2];let i;e[3]!==a?(i=(0,t.jsx)(K,{className:"font-mono text-xs",children:a}),e[3]=a,e[4]=i):i=e[4];let c=o.parked?"destructive":"secondary",N;e[5]!==o.parked||e[6]!==l?(N=o.parked?l("parked"):l("retrying"),e[5]=o.parked,e[6]=l,e[7]=N):N=e[7];let p;e[8]!==c||e[9]!==N?(p=(0,t.jsx)(oe,{variant:c,children:N}),e[8]=c,e[9]=N,e[10]=p):p=e[10];let h;e[11]!==o.forever||e[12]!==l?(h=o.forever&&(0,t.jsx)(oe,{variant:"outline",children:l("forever")}),e[11]=o.forever,e[12]=l,e[13]=h):h=e[13];let m;e[14]!==p||e[15]!==h?(m=(0,t.jsx)(K,{children:(0,t.jsxs)("div",{className:"flex gap-1",children:[p,h]})}),e[14]=p,e[15]=h,e[16]=m):m=e[16];let k;e[17]!==o.attempts?(k=(0,t.jsx)(K,{className:"tabular-nums",children:o.attempts}),e[17]=o.attempts,e[18]=k):k=e[18];let f;e[19]!==o.nextAttemptAt||e[20]!==o.parked?(f=o.parked?"\u2014":le(o.nextAttemptAt,"\u2014"),e[19]=o.nextAttemptAt,e[20]=o.parked,e[21]=f):f=e[21];let d;e[22]!==f?(d=(0,t.jsx)(K,{className:"text-muted-foreground tabular-nums",children:f}),e[22]=f,e[23]=d):d=e[23];let u;e[24]!==o.id?(u=(0,t.jsx)(K,{className:"font-mono text-xs",children:o.id}),e[24]=o.id,e[25]=u):u=e[25];let v=`outbox-retry-${o.id}`,b;e[26]!==o.id||e[27]!==n?(b=y(()=>{Y(n(rt,o.id))},"b"),e[26]=o.id,e[27]=n,e[28]=b):b=e[28];let S;e[29]!==l?(S=l("Retry now"),e[29]=l,e[30]=S):S=e[30];let I;e[31]!==v||e[32]!==b||e[33]!==S?(I=(0,t.jsx)(ce,{"data-testid":v,onClick:b,size:"sm",type:"button",variant:"outline",children:S}),e[31]=v,e[32]=b,e[33]=S,e[34]=I):I=e[34];let w;e[35]!==l?(w=l("Drop job?"),e[35]=l,e[36]=w):w=e[36];let C;e[37]!==o.id||e[38]!==n?(C=y(()=>{Y(n(tt,o.id))},"T"),e[37]=o.id,e[38]=n,e[39]=C):C=e[39];let J=`outbox-drop-${o.id}`,$;e[40]!==l?($=l("Drop"),e[40]=l,e[41]=$):$=e[41];let j;e[42]!==w||e[43]!==C||e[44]!==J||e[45]!==$?(j=(0,t.jsx)(ue,{confirmLabel:w,onConfirm:C,testId:J,children:$}),e[42]=w,e[43]=C,e[44]=J,e[45]=$,e[46]=j):j=e[46];let x;e[47]!==I||e[48]!==j?(x=(0,t.jsx)(K,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[I,j]})}),e[47]=I,e[48]=j,e[49]=x):x=e[49];let A;return e[50]!==s||e[51]!==d||e[52]!==u||e[53]!==x||e[54]!==i||e[55]!==m||e[56]!==k?(A=(0,t.jsxs)(z,{"data-testid":s,children:[i,m,k,d,u,x]}),e[50]=s,e[51]=d,e[52]=u,e[53]=x,e[54]=i,e[55]=m,e[56]=k,e[57]=A):A=e[57],A},"We"),ot=y(r=>{let e=(0,G.c)(41),{entries:o,onAct:n}=r,l=V(),s;e[0]!==l?(s=l("function"),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==s?(a=(0,t.jsx)(L,{children:s}),e[2]=s,e[3]=a):a=e[3];let i;e[4]!==l?(i=l("state"),e[4]=l,e[5]=i):i=e[5];let c;e[6]!==i?(c=(0,t.jsx)(L,{children:i}),e[6]=i,e[7]=c):c=e[7];let N;e[8]!==l?(N=l("attempts"),e[8]=l,e[9]=N):N=e[9];let p;e[10]!==N?(p=(0,t.jsx)(L,{children:N}),e[10]=N,e[11]=p):p=e[11];let h;e[12]!==l?(h=l("next attempt"),e[12]=l,e[13]=h):h=e[13];let m;e[14]!==h?(m=(0,t.jsx)(L,{children:h}),e[14]=h,e[15]=m):m=e[15];let k;e[16]!==l?(k=l("id"),e[16]=l,e[17]=k):k=e[17];let f;e[18]!==k?(f=(0,t.jsx)(L,{children:k}),e[18]=k,e[19]=f):f=e[19];let d;e[20]!==l?(d=l("Actions"),e[20]=l,e[21]=d):d=e[21];let u;e[22]!==d?(u=(0,t.jsx)(L,{"aria-label":d}),e[22]=d,e[23]=u):u=e[23];let v;e[24]!==f||e[25]!==u||e[26]!==a||e[27]!==c||e[28]!==p||e[29]!==m?(v=(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[a,c,p,m,f,u]})}),e[24]=f,e[25]=u,e[26]=a,e[27]=c,e[28]=p,e[29]=m,e[30]=v):v=e[30];let b;if(e[31]!==o||e[32]!==n){let w;e[34]!==n?(w=y(C=>(0,t.jsx)(at,{entry:C,onAct:n},C.id),"N"),e[34]=n,e[35]=w):w=e[35],b=o.map(w),e[31]=o,e[32]=n,e[33]=b}else b=e[33];let S;e[36]!==b?(S=(0,t.jsx)(re,{children:b}),e[36]=b,e[37]=S):S=e[37];let I;return e[38]!==v||e[39]!==S?(I=(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"outbox-table",children:[v,S]})})}),e[38]=v,e[39]=S,e[40]=I):I=e[40],I},"Ge"),nt=y(r=>{let e=(0,G.c)(11),{cursor:o,nextCursor:n,onFirst:l,onNext:s}=r,a=V();if(o===void 0&&n===void 0)return;let i;e[0]!==o||e[1]!==l||e[2]!==a?(i=o!==void 0&&(0,t.jsx)(ce,{"data-testid":"outbox-first-page",onClick:l,size:"sm",type:"button",variant:"outline",children:a("First page")}),e[0]=o,e[1]=l,e[2]=a,e[3]=i):i=e[3];let c;e[4]!==n||e[5]!==s||e[6]!==a?(c=n!==void 0&&(0,t.jsx)(ce,{"data-testid":"outbox-next-page",onClick:y(()=>{s(n)},"onClick"),size:"sm",type:"button",variant:"outline",children:a("Next page")}),e[4]=n,e[5]=s,e[6]=a,e[7]=c):c=e[7];let N;return e[8]!==i||e[9]!==c?(N=(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[i,c]}),e[8]=i,e[9]=c,e[10]=N):N=e[10],N},"Ye"),st=y(r=>{let e=(0,G.c)(38),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{initialShardKey:n}=o,l=je(),s=V(),{queryShardKey:a,setShardKey:i,shardKey:c}=ge(n),N;e[2]!==a?(N={cursor:void 0,shardKey:a},e[2]=a,e[3]=N):N=e[3];let[p,h]=(0,Q.useState)(N);p.shardKey!==a&&h({cursor:void 0,shardKey:a});let m=p.shardKey===a?p.cursor:void 0,k=c.trim()!==a,f;e[4]!==m?(f=m===void 0?{}:{cursor:m},e[4]=m,e[5]=f):f=e[5];let d;e[6]!==a?(d={shardKey:a},e[6]=a,e[7]=d):d=e[7];let{data:u,error:v,poll:b,refetch:S}=ve(me.getScheduleOutbox,f,d),I=k?void 0:u?.entries,w=k?void 0:u?.nextCursor,[C,J]=(0,Q.useState)(void 0),$=v??(C?.shardKey===a?C.message:void 0);ae(b,!0);let j;e[8]!==l||e[9]!==a||e[10]!==S||e[11]!==s?(j=y(async(B,E)=>{J(void 0);try{(await l.query(B,{id:E},Ae(a))).retried===!1&&J({message:s("That job is no longer in the outbox."),shardKey:a}),S()}catch(U){J({message:ie(U),shardKey:a})}},"A"),e[8]=l,e[9]=a,e[10]=S,e[11]=s,e[12]=j):j=e[12];let x=j,A;e[13]!==i||e[14]!==c?(A=(0,t.jsx)(be,{onChange:i,testId:"outbox-shard-input",value:c}),e[13]=i,e[14]=c,e[15]=A):A=e[15];let g;e[16]!==$?(g=$!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"outbox-error",role:"alert",children:$}),e[16]=$,e[17]=g):g=e[17];let F;e[18]!==m||e[19]!==I?.length?(F=I?.length===0&&m===void 0&&(0,t.jsx)(lt,{}),e[18]=m,e[19]=I?.length,e[20]=F):F=e[20];let _;e[21]!==x||e[22]!==I?(_=I!==void 0&&I.length>0&&(0,t.jsx)(ot,{entries:I,onAct:x}),e[21]=x,e[22]=I,e[23]=_):_=e[23];let T,M;e[24]!==a?(T=y(()=>{h({cursor:void 0,shardKey:a})},"E"),M=y(B=>{h({cursor:B,shardKey:a})},"_"),e[24]=a,e[25]=T,e[26]=M):(T=e[25],M=e[26]);let R;e[27]!==m||e[28]!==w||e[29]!==T||e[30]!==M?(R=(0,t.jsx)(nt,{cursor:m,nextCursor:w,onFirst:T,onNext:M}),e[27]=m,e[28]=w,e[29]=T,e[30]=M,e[31]=R):R=e[31];let W;return e[32]!==R||e[33]!==A||e[34]!==g||e[35]!==F||e[36]!==_?(W=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-schedule-outbox",children:[A,g,F,_,R]}),e[32]=R,e[33]=A,e[34]=g,e[35]=F,e[36]=_,e[37]=W):W=e[37],W},"je"),it="scheduler.lag_ms",Ne=y(r=>{let e=r.attributes?.function;return typeof e=="string"?e:r.functionPath},"he"),ke=y(r=>{let e=(0,G.c)(8),{label:o,testId:n,value:l}=r,s;e[0]!==o?(s=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=s):s=e[1];let a;e[2]!==n||e[3]!==l?(a=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":n,children:l}),e[2]=n,e[3]=l,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=(0,t.jsx)(Z,{className:"flex-1 py-0",children:(0,t.jsxs)(H,{className:"flex flex-col gap-1 p-4",children:[s,a]})}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i},"fe"),dt=y(r=>{let e=(0,G.c)(65),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{initialShardKey:n,loadStatus:l}=o,s=de(),a=V(),i=l===void 0,c;e[2]!==i?(c=["lunora-scheduler-status",i],e[2]=i,e[3]=c):c=e[3];let N;e[4]!==s||e[5]!==l?(N=y(async()=>{let B=await(l??(()=>s.schedulerStatus()))();return{...B,pools:B.pools.toSorted(ct)}},"v"),e[4]=s,e[5]=l,e[6]=N):N=e[6];let p=ne(c,N),{data:h,error:m}=p,{queryShardKey:k,setShardKey:f,shardKey:d}=ge(n),u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u={},e[7]=u):u=e[7];let v;e[8]!==k?(v={shardKey:k},e[8]=k,e[9]=v):v=e[9];let b=ve(me.getMetricSeries,u,v),{data:S,errorSource:I}=b,w;e[10]!==I||e[11]!==b.error?(w=xe(I)==="FUNCTION_NOT_FOUND"?null:b.error,e[10]=I,e[11]=b.error,e[12]=w):w=e[12];let C=w,J;e[13]!==p?(J=y(()=>p.poll(),"L"),e[13]=p,e[14]=J):J=e[14],ae(J,!0);let $;e[15]!==b?($=y(()=>b.poll(),"$"),e[15]=b,e[16]=$):$=e[16],ae($,!0);let j,x,A,g,F,_,T,M;if(e[17]!==m||e[18]!==S||e[19]!==C||e[20]!==f||e[21]!==d||e[22]!==h||e[23]!==a){let B=(Array.isArray(S?.series)?S.series:[]).filter(ht).toSorted(ut);j="flex flex-col gap-3",x="lunora-scheduler-pools",e[32]!==m?(A=m!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:m}),e[32]=m,e[33]=A):A=e[33],e[34]!==h||e[35]!==a?(g=h!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(ke,{label:a("backlog"),testId:"pools-backlog",value:h.backlog}),(0,t.jsx)(ke,{label:a("in flight"),testId:"pools-inflight",value:h.inFlight}),(0,t.jsx)(ke,{label:a("pools"),testId:"pools-count",value:h.pools.length})]}),e[34]=h,e[35]=a,e[36]=g):g=e[36],e[37]!==h?.pools.length||e[38]!==a?(F=h?.pools.length===0&&(0,t.jsx)(se,{description:a("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:a("No workpools.")}),e[37]=h?.pools.length,e[38]=a,e[39]=F):F=e[39];let E;e[40]!==f||e[41]!==d?(E=(0,t.jsx)(be,{onChange:f,testId:"lag-shard-input",value:d}),e[40]=f,e[41]=d,e[42]=E):E=e[42];let U;e[43]!==a?(U=a("Start lag per job on this shard since it last woke; the series reset when the shard hibernates."),e[43]=a,e[44]=U):U=e[44];let P;e[45]!==U?(P=(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"lag-scope",children:U}),e[45]=U,e[46]=P):P=e[46],e[47]!==E||e[48]!==P?(_=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[E,P]}),e[47]=E,e[48]=P,e[49]=_):_=e[49],e[50]!==C?(T=C!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"lag-error",role:"alert",children:C}),e[50]=C,e[51]=T):T=e[51],M=C===null&&B.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"lag-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:a("function")}),(0,t.jsx)(L,{children:a("runs")}),(0,t.jsx)(L,{children:a("mean lag (ms)")}),(0,t.jsx)(L,{children:a("max lag (ms)")}),(0,t.jsx)(L,{children:a("last lag (ms)")})]})}),(0,t.jsx)(re,{children:B.map(mt)})]})})}),e[17]=m,e[18]=S,e[19]=C,e[20]=f,e[21]=d,e[22]=h,e[23]=a,e[24]=j,e[25]=x,e[26]=A,e[27]=g,e[28]=F,e[29]=_,e[30]=T,e[31]=M}else j=e[24],x=e[25],A=e[26],g=e[27],F=e[28],_=e[29],T=e[30],M=e[31];let R;e[52]!==h||e[53]!==a?(R=h!==void 0&&h.pools.length>0&&(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(H,{className:"px-0",children:(0,t.jsxs)(ee,{"data-testid":"pools-table",children:[(0,t.jsx)(te,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(L,{children:a("pool")}),(0,t.jsx)(L,{children:a("queued")}),(0,t.jsx)(L,{children:a("in flight")}),(0,t.jsx)(L,{children:a("max concurrency")})]})}),(0,t.jsx)(re,{children:h.pools.map(pt)})]})})}),e[52]=h,e[53]=a,e[54]=R):R=e[54];let W;return e[55]!==j||e[56]!==x||e[57]!==A||e[58]!==g||e[59]!==F||e[60]!==_||e[61]!==T||e[62]!==M||e[63]!==R?(W=(0,t.jsxs)("div",{className:j,"data-testid":x,children:[A,g,F,_,T,M,R]}),e[55]=j,e[56]=x,e[57]=A,e[58]=g,e[59]=F,e[60]=_,e[61]=T,e[62]=M,e[63]=R,e[64]=W):W=e[64],W},"Ze");function ct(r,e){return e.queued-r.queued}y(ct,"et");function ht(r){return r.name===it&&r.kind==="histogram"&&r.count>0}y(ht,"tt");function ut(r,e){return e.max-r.max}y(ut,"st");function mt(r){return(0,t.jsxs)(z,{"data-testid":`lag-row-${Ne(r)}`,children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:Ne(r)}),(0,t.jsx)(K,{className:"tabular-nums",children:r.count}),(0,t.jsx)(K,{className:"tabular-nums",children:Math.round(r.sum/r.count)}),(0,t.jsx)(K,{className:"tabular-nums",children:r.max}),(0,t.jsx)(K,{className:"tabular-nums",children:r.last})]},Ne(r))}y(mt,"lt");function pt(r){return(0,t.jsxs)(z,{"data-testid":`pools-row-${r.name}`,children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:r.name}),(0,t.jsx)(K,{className:"tabular-nums",children:r.queued}),(0,t.jsxs)(K,{className:"tabular-nums",children:[r.inFlight," / ",r.maxConcurrency]}),(0,t.jsx)(K,{className:"tabular-nums",children:r.maxConcurrency})]},r.name)}y(pt,"rt");var ft=["jobs","outbox","history","dead","pools","cron"],Vt=y(r=>{let e=(0,G.c)(55),o;e[0]!==r?(o=r===void 0?{}:r,e[0]=r,e[1]=o):o=e[1];let{initialShardKey:n,loadCronJobs:l,scheduledCancel:s,scheduledLoad:a}=o,i=V(),[c,N]=(0,Q.useState)("jobs"),p;e[2]!==i?(p=i("Cron triggers"),e[2]=i,e[3]=p):p=e[3];let h;e[4]!==i?(h=i("Dead letter"),e[4]=i,e[5]=h):h=e[5];let m;e[6]!==i?(m=i("History"),e[6]=i,e[7]=m):m=e[7];let k;e[8]!==i?(k=i("Scheduled jobs"),e[8]=i,e[9]=k):k=e[9];let f;e[10]!==i?(f=i("Outbox"),e[10]=i,e[11]=f):f=e[11];let d;e[12]!==i?(d=i("Pools"),e[12]=i,e[13]=d):d=e[13];let u;e[14]!==p||e[15]!==h||e[16]!==m||e[17]!==k||e[18]!==f||e[19]!==d?(u={cron:p,dead:h,history:m,jobs:k,outbox:f,pools:d},e[14]=p,e[15]=h,e[16]=m,e[17]=k,e[18]=f,e[19]=d,e[20]=u):u=e[20];let v=u,b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=y(T=>{N(T.currentTarget.dataset.view)},"b"),e[21]=b):b=e[21];let S=b,I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=(0,t.jsx)(Le,{}),e[22]=I):I=e[22];let w;e[23]!==i?(w=i("Schedule view"),e[23]=i,e[24]=w):w=e[24];let C;e[25]!==c||e[26]!==v?(C=ft.map(T=>(0,t.jsx)(ce,{"aria-selected":c===T,"data-testid":`schedule-view-${T}`,"data-view":T,onClick:S,role:"tab",size:"sm",type:"button",variant:c===T?"default":"outline",children:v[T]},T)),e[25]=c,e[26]=v,e[27]=C):C=e[27];let J;e[28]!==w||e[29]!==C?(J=(0,t.jsx)("div",{"aria-label":w,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:C}),e[28]=w,e[29]=C,e[30]=J):J=e[30];let $;e[31]!==s||e[32]!==a||e[33]!==c?($=c==="jobs"&&(0,t.jsx)(Te,{cancelJob:s,loadJobs:a}),e[31]=s,e[32]=a,e[33]=c,e[34]=$):$=e[34];let j;e[35]!==c?(j=c==="outbox"&&(0,t.jsx)(st,{}),e[35]=c,e[36]=j):j=e[36];let x;e[37]!==c?(x=c==="history"&&(0,t.jsx)(He,{}),e[37]=c,e[38]=x):x=e[38];let A;e[39]!==c?(A=c==="dead"&&(0,t.jsx)(Xe,{}),e[39]=c,e[40]=A):A=e[40];let g;e[41]!==n||e[42]!==c?(g=c==="pools"&&(0,t.jsx)(dt,{initialShardKey:n}),e[41]=n,e[42]=c,e[43]=g):g=e[43];let F;e[44]!==l||e[45]!==c?(F=c==="cron"&&(0,t.jsx)(Ge,{loadCronJobs:l}),e[44]=l,e[45]=c,e[46]=F):F=e[46];let _;return e[47]!==J||e[48]!==$||e[49]!==j||e[50]!==x||e[51]!==A||e[52]!==g||e[53]!==F?(_=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[I,J,$,j,x,A,g,F]}),e[47]=J,e[48]=$,e[49]=j,e[50]=x,e[51]=A,e[52]=g,e[53]=F,e[54]=_):_=e[54],_},"It");export{Vt as SchedulePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-
|
|
1
|
+
import{a as re}from"./chunk-BCT3KY76.js";import{a as X}from"./chunk-2KTN53PK.js";import{a as V}from"./chunk-YC3TUO5H.js";import"./chunk-EDL46BPM.js";import"./chunk-4KPATTV6.js";import"./chunk-SQO3WGXH.js";import"./chunk-R76ATTPC.js";import"./chunk-4AG356VE.js";import{a as W}from"./chunk-ECXQQPVU.js";import"./chunk-EOHXBC4U.js";import"./chunk-JEJV6SVN.js";import{a as Q}from"./chunk-V5ZKAZR6.js";import{b as G}from"./chunk-UB6S6VYI.js";import"./chunk-DMQVY5L7.js";import{a as Y}from"./chunk-4OWWWAMB.js";import"./chunk-5XQM44J7.js";import{a as Z,b as ee,c as te,d as P,e as n,f as o}from"./chunk-WVAWKCNQ.js";import"./chunk-VND72OIC.js";import"./chunk-VLQU4G6O.js";import"./chunk-EOFWXI3T.js";import{a as R}from"./chunk-LYVYUTQY.js";import{c as O}from"./chunk-LUHBGCMO.js";import{a as H,e as J}from"./chunk-VUMS4VIV.js";import"./chunk-PLCYDHU3.js";import"./chunk-WY23EROJ.js";import{B as U,w as z,x as L}from"./chunk-G4H5DPO6.js";import"./chunk-JSVT5VBU.js";import{a as me}from"./chunk-A6TVTNKO.js";import{a as de,b as he}from"./chunk-ADABTCDI.js";import{a as l,d as B}from"./chunk-5PEAXTYQ.js";var se=B(me(),1),le=B(de(),1);var t=B(he(),1);var ue={action:"outline",mutation:"default",query:"secondary"},ae=l(r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,"q"),fe=l(r=>r.calls===0?"\u2014":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,"de"),pe=l(r=>{let e=r.conflicts??0;return r.calls===0?"\u2014":e===0?"0":`${e.toString()} (${(e/r.calls*100).toFixed(1)}%)`},"me"),xe={calls:l((r,e)=>e.calls-r.calls,"calls"),recent:l((r,e)=>e.lastCalledAt-r.lastCalledAt,"recent"),slowest:l((r,e)=>e.maxDurationMs-r.maxDurationMs,"slowest")},De=l(r=>{let e=(0,se.c)(49),{functions:_,initialShardKey:ne}=r,s=U(),{queryShardKey:i,setShardKey:v,shardKey:S}=X(ne),[c,oe]=(0,le.useState)("recent"),C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C={},e[0]=C):C=e[0];let $;e[1]!==i?($={live:!0,shardKey:i},e[1]=i,e[2]=$):$=e[2];let{data:ie,error:d,errorSource:b,liveError:k}=O(R.getFunctionStats,C,$),M=ie?.functions??null,F;e[3]!==_?(F=new Map((_??[]).map(ge)),e[3]=_,e[4]=F):F=e[4];let T=F,I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=l(w=>{oe(w.currentTarget.dataset.sort)},"E"),e[5]=I):I=e[5];let ce=I,K;if(e[6]!==d||e[7]!==b||e[8]!==T||e[9]!==k||e[10]!==i||e[11]!==v||e[12]!==S||e[13]!==c||e[14]!==M||e[15]!==s){let w=M===null?[]:M.toSorted(xe[c]),m;e[17]!==s?(m=s("Recent"),e[17]=s,e[18]=m):m=e[18];let h;e[19]!==m?(h={key:"recent",label:m},e[19]=m,e[20]=h):h=e[20];let u;e[21]!==s?(u=s("Most called"),e[21]=s,e[22]=u):u=e[22];let f;e[23]!==u?(f={key:"calls",label:u},e[23]=u,e[24]=f):f=e[24];let p;e[25]!==s?(p=s("Slowest"),e[25]=s,e[26]=p):p=e[26];let x;e[27]!==p?(x={key:"slowest",label:p},e[27]=p,e[28]=x):x=e[28];let A;e[29]!==x||e[30]!==h||e[31]!==f?(A=[h,f,x],e[29]=x,e[30]=h,e[31]=f,e[32]=A):A=e[32];let j=A,g;e[33]!==v||e[34]!==S?(g=(0,t.jsx)(V,{onChange:v,testId:"fs-shard-input",value:S}),e[33]=v,e[34]=S,e[35]=g):g=e[35];let y;e[36]!==k?(y=(0,t.jsx)(re,{message:k,prefix:"fs"}),e[36]=k,e[37]=y):y=e[37];let N;e[38]!==j||e[39]!==c?(N=(0,t.jsx)("div",{className:"ml-auto flex items-center gap-1",role:"group",children:j.map(a=>(0,t.jsx)(W,{"data-sort":a.key,"data-testid":`fs-sort-${a.key}`,onClick:ce,size:"sm",type:"button",variant:c===a.key?"secondary":"ghost",children:a.label},a.key))}),e[38]=j,e[39]=c,e[40]=N):N=e[40];let D;e[41]!==g||e[42]!==y||e[43]!==N?(D=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[g,y,N]}),e[41]=g,e[42]=y,e[43]=N,e[44]=D):D=e[44];let E;e[45]!==d||e[46]!==b||e[47]!==i?(E=d!==null&&(0,t.jsx)(Y,{error:b,shardKey:i,testId:"fs-error"}),e[45]=d,e[46]=b,e[47]=i,e[48]=E):E=e[48],K=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[D,E,M!==null&&w.length===0&&d===null&&(0,t.jsx)(Q,{description:s("Per-function call counts, error rates, and latency land here after your first request."),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)("path",{d:"M3 3v18h18"}),(0,t.jsx)("path",{d:"M7 14l4-4 3 3 5-6"})]}),testId:"fs-empty",title:s("No functions have run on this shard yet.")}),w.length>0&&(0,t.jsx)(H,{className:"overflow-hidden py-0",children:(0,t.jsx)(J,{className:"px-0",children:(0,t.jsxs)(Z,{"data-testid":"fs-table",children:[(0,t.jsx)(ee,{children:(0,t.jsxs)(P,{children:[(0,t.jsx)(n,{children:s("function")}),(0,t.jsx)(n,{children:s("kind")}),(0,t.jsx)(n,{className:"text-right",children:s("calls")}),(0,t.jsx)(n,{className:"text-right",children:s("errors")}),(0,t.jsx)(n,{className:"text-right",children:s("conflicts")}),(0,t.jsx)(n,{className:"text-right",children:s("avg")}),(0,t.jsx)(n,{className:"text-right",children:s("max")}),(0,t.jsx)(n,{children:s("last run")}),(0,t.jsx)(n,{children:s("last error")})]})}),(0,t.jsx)(te,{children:w.map(a=>{let q=T.get(a.path);return(0,t.jsxs)(P,{"data-testid":`fs-row-${a.path}`,children:[(0,t.jsx)(o,{className:"font-medium",children:a.path}),(0,t.jsx)(o,{children:q===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,t.jsx)(G,{variant:ue[q],children:q})}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls}),(0,t.jsx)(o,{className:L("text-right tabular-nums",a.errors>0&&"text-destructive"),children:fe(a)}),(0,t.jsx)(o,{className:L("text-right tabular-nums",(a.conflicts??0)>0&&"text-warning"),children:pe(a)}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls===0?"\u2014":ae(a.totalDurationMs/a.calls)}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls===0?"\u2014":ae(a.maxDurationMs)}),(0,t.jsx)(o,{className:"text-muted-foreground",children:z(a.lastCalledAt,"\u2014")}),(0,t.jsx)(o,{className:"max-w-[24ch] truncate text-destructive",title:a.lastErrorMessage??void 0,children:a.lastErrorMessage??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},a.path)})})]})})})]}),e[6]=d,e[7]=b,e[8]=T,e[9]=k,e[10]=i,e[11]=v,e[12]=S,e[13]=c,e[14]=M,e[15]=s,e[16]=K}else K=e[16];return K},"Ae");function ge(r){return[r.path,r.kind]}l(ge,"fe");export{De as FunctionStatsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"./chunk-
|
|
1
|
+
import{a as v}from"./chunk-3BDGZAZD.js";import{a as A}from"./chunk-BUYKTV27.js";import{a as W}from"./chunk-2KTN53PK.js";import{a as L}from"./chunk-YC3TUO5H.js";import"./chunk-EDL46BPM.js";import"./chunk-4KPATTV6.js";import"./chunk-SQO3WGXH.js";import"./chunk-R76ATTPC.js";import"./chunk-4AG356VE.js";import"./chunk-JEJV6SVN.js";import{a as G}from"./chunk-V5ZKAZR6.js";import{b as $}from"./chunk-UB6S6VYI.js";import"./chunk-DMQVY5L7.js";import{a as q}from"./chunk-4OWWWAMB.js";import"./chunk-5XQM44J7.js";import{a as H,b as O,c as Q,d as D,e as T,f as K}from"./chunk-WVAWKCNQ.js";import"./chunk-VND72OIC.js";import"./chunk-VLQU4G6O.js";import"./chunk-EOFWXI3T.js";import{a as _}from"./chunk-LYVYUTQY.js";import{c as j}from"./chunk-LUHBGCMO.js";import{a as E}from"./chunk-VUMS4VIV.js";import"./chunk-PLCYDHU3.js";import"./chunk-WY23EROJ.js";import{B}from"./chunk-G4H5DPO6.js";import"./chunk-JSVT5VBU.js";import{a as J}from"./chunk-A6TVTNKO.js";import{b as V}from"./chunk-ADABTCDI.js";import{a as S,d as F}from"./chunk-5PEAXTYQ.js";var R=F(J(),1);var t=F(V(),1);var U=S(c=>`${c.toString()} ms`,"D"),X=S(c=>c.totalConnections===0&&c.shapePoke.passes===0&&c.whisper.passes===0&&c.shapeProbe.run===0&&c.shapeProbe.served===0&&c.globalPoll.drains===0&&c.globalPoll.pairsSkipped===0,"J"),z=S(c=>{let e=(0,R.c)(48),{counters:o,includeTiming:a,prefix:r,t:l,title:u}=c,d=`${r}-section`,n;e[0]!==u?(n=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:u}),e[0]=u,e[1]=n):n=e[1];let s=`${r}-stats`,i;e[2]!==l?(i=l("Passes"),e[2]=l,e[3]=i):i=e[3];let m=`${r}-passes`,I;e[4]!==o.passes||e[5]!==i||e[6]!==m?(I=(0,t.jsx)(v,{label:i,testId:m,value:o.passes}),e[4]=o.passes,e[5]=i,e[6]=m,e[7]=I):I=e[7];let g;e[8]!==l?(g=l("Sockets iterated"),e[8]=l,e[9]=g):g=e[9];let k=`${r}-iterated`,p;e[10]!==o.socketsIterated||e[11]!==g||e[12]!==k?(p=(0,t.jsx)(v,{label:g,testId:k,value:o.socketsIterated}),e[10]=o.socketsIterated,e[11]=g,e[12]=k,e[13]=p):p=e[13];let f;e[14]!==l?(f=l("Delivered"),e[14]=l,e[15]=f):f=e[15];let y=`${r}-delivered`,h;e[16]!==o.socketsDelivered||e[17]!==f||e[18]!==y?(h=(0,t.jsx)(v,{label:f,testId:y,value:o.socketsDelivered}),e[16]=o.socketsDelivered,e[17]=f,e[18]=y,e[19]=h):h=e[19];let x;e[20]!==l?(x=l("Peak width"),e[20]=l,e[21]=x):x=e[21];let N=`${r}-peak`,b;e[22]!==o.peakSocketsIterated||e[23]!==x||e[24]!==N?(b=(0,t.jsx)(v,{label:x,testId:N,value:o.peakSocketsIterated}),e[22]=o.peakSocketsIterated,e[23]=x,e[24]=N,e[25]=b):b=e[25];let C;e[26]!==o.totalMs||e[27]!==a||e[28]!==r||e[29]!==l?(C=a&&(0,t.jsx)(v,{label:l("Total time"),testId:`${r}-total-ms`,value:U(o.totalMs)}),e[26]=o.totalMs,e[27]=a,e[28]=r,e[29]=l,e[30]=C):C=e[30];let P;e[31]!==o.maxMs||e[32]!==a||e[33]!==r||e[34]!==l?(P=a&&(0,t.jsx)(v,{label:l("Max time"),testId:`${r}-max-ms`,value:U(o.maxMs)}),e[31]=o.maxMs,e[32]=a,e[33]=r,e[34]=l,e[35]=P):P=e[35];let M;e[36]!==h||e[37]!==b||e[38]!==C||e[39]!==P||e[40]!==s||e[41]!==I||e[42]!==p?(M=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":s,children:[I,p,h,b,C,P]}),e[36]=h,e[37]=b,e[38]=C,e[39]=P,e[40]=s,e[41]=I,e[42]=p,e[43]=M):M=e[43];let w;return e[44]!==d||e[45]!==M||e[46]!==n?(w=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":d,children:[n,M]}),e[44]=d,e[45]=M,e[46]=n,e[47]=w):w=e[47],w},"F"),Y=S(c=>{let e=(0,R.c)(20),{counters:o,t:a}=c,r;e[0]!==a?(r=a("Membership probes"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==a?(u=a("Queries run"),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==o.run||e[7]!==u?(d=(0,t.jsx)(v,{label:u,testId:"fanout-probe-run",value:o.run}),e[6]=o.run,e[7]=u,e[8]=d):d=e[8];let n;e[9]!==a?(n=a("Shared from cache"),e[9]=a,e[10]=n):n=e[10];let s;e[11]!==o.served||e[12]!==n?(s=(0,t.jsx)(v,{label:n,testId:"fanout-probe-served",value:o.served}),e[11]=o.served,e[12]=n,e[13]=s):s=e[13];let i;e[14]!==d||e[15]!==s?(i=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"fanout-probe-stats",children:[d,s]}),e[14]=d,e[15]=s,e[16]=i):i=e[16];let m;return e[17]!==l||e[18]!==i?(m=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-probe-section",children:[l,i]}),e[17]=l,e[18]=i,e[19]=m):m=e[19],m},"V"),Z=S(c=>{let e=(0,R.c)(20),{counters:o,t:a}=c,r;e[0]!==a?(r=a("Global shape polls"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==a?(u=a("Global reads"),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==o.drains||e[7]!==u?(d=(0,t.jsx)(v,{label:u,testId:"fanout-global-poll-drains",value:o.drains}),e[6]=o.drains,e[7]=u,e[8]=d):d=e[8];let n;e[9]!==a?(n=a("Pairs skipped"),e[9]=a,e[10]=n):n=e[10];let s;e[11]!==o.pairsSkipped||e[12]!==n?(s=(0,t.jsx)(v,{label:n,testId:"fanout-global-poll-pairs-skipped",value:o.pairsSkipped}),e[11]=o.pairsSkipped,e[12]=n,e[13]=s):s=e[13];let i;e[14]!==d||e[15]!==s?(i=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"fanout-global-poll-stats",children:[d,s]}),e[14]=d,e[15]=s,e[16]=i):i=e[16];let m;return e[17]!==l||e[18]!==i?(m=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-global-poll-section",children:[l,i]}),e[17]=l,e[18]=i,e[19]=m):m=e[19],m},"X"),pe=S(c=>{let e=(0,R.c)(32),{initialShardKey:o}=c,a=B(),{queryShardKey:r,setShardKey:l,shardKey:u}=W(o),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={},e[0]=d):d=e[0];let n;e[1]!==r?(n={keepPreviousData:!0,shardKey:r},e[1]=r,e[2]=n):n=e[2];let{data:s,error:i,errorSource:m,poll:I}=j(_.getFanoutMetrics,d,n);A(I,!0);let g;e[3]!==s?(g=s!==void 0&&X(s),e[3]=s,e[4]=g):g=e[4];let k=g,p;e[5]!==l||e[6]!==u?(p=(0,t.jsx)(L,{onChange:l,testId:"fanout-shard-input",value:u}),e[5]=l,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==s||e[9]!==a?(f=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"fanout-count",children:[s.promoted&&(0,t.jsx)($,{"data-testid":"fanout-promoted",variant:s.relayCount>=s.maxRelays?"destructive":"default",children:s.relayCount>=s.maxRelays?a("auto-scaled: {relayCount}/{maxRelays} relays (at ceiling)",{maxRelays:s.maxRelays,relayCount:s.relayCount}):a("auto-scaled: {relayCount}/{maxRelays} relays",{maxRelays:s.maxRelays,relayCount:s.relayCount})}),(0,t.jsx)($,{variant:"secondary",children:a("{count} connections",{count:s.totalConnections})}),(0,t.jsx)($,{variant:"secondary",children:a("peak {count} subscribers",{count:s.peakSubscribers})})]}),e[8]=s,e[9]=a,e[10]=f):f=e[10];let y;e[11]!==p||e[12]!==f?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13];let h;e[14]!==i||e[15]!==m||e[16]!==r?(h=i!==null&&(0,t.jsx)(q,{error:m,shardKey:r,testId:"fanout-error"}),e[14]=i,e[15]=m,e[16]=r,e[17]=h):h=e[17];let x;e[18]!==i||e[19]!==k||e[20]!==a?(x=i===null&&k&&(0,t.jsx)(G,{description:a("Realtime fan-out cost and per-topic subscriber counts for this shard."),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 12h4l3 7 4-14 3 7h2"})}),testId:"fanout-empty",title:a("No fan-out activity yet.")}),e[18]=i,e[19]=k,e[20]=a,e[21]=x):x=e[21];let N;e[22]!==i||e[23]!==k||e[24]!==s||e[25]!==a?(N=i===null&&s!==void 0&&!k&&(0,t.jsxs)(t.Fragment,{children:[s.topics.length>0&&(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-topics-section",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:a("Hot topics")}),(0,t.jsx)(E,{className:"overflow-hidden py-0",children:(0,t.jsxs)(H,{"data-testid":"fanout-topics-table",children:[(0,t.jsx)(O,{children:(0,t.jsxs)(D,{children:[(0,t.jsx)(T,{children:a("Topic")}),(0,t.jsx)(T,{children:a("Kind")}),(0,t.jsx)(T,{className:"text-right",children:a("Subscribers")})]})}),(0,t.jsx)(Q,{children:s.topics.map(ee)})]})})]}),(0,t.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"fanout-cost",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:a("Fan-out cost since this instance woke")}),(0,t.jsx)(z,{counters:s.shapePoke,includeTiming:!0,prefix:"fanout-poke",t:a,title:a("Shape pokes")}),(0,t.jsx)(z,{counters:s.whisper,includeTiming:!1,prefix:"fanout-whisper",t:a,title:a("Whisper broadcasts")}),(0,t.jsx)(Y,{counters:s.shapeProbe,t:a}),(0,t.jsx)(Z,{counters:s.globalPoll,t:a})]})]}),e[22]=i,e[23]=k,e[24]=s,e[25]=a,e[26]=N):N=e[26];let b;return e[27]!==y||e[28]!==h||e[29]!==x||e[30]!==N?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"fanout-panel",children:[y,h,x,N]}),e[27]=y,e[28]=h,e[29]=x,e[30]=N,e[31]=b):b=e[31],b},"me");function ee(c){return(0,t.jsxs)(D,{"data-testid":"fanout-topic-row",children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:c.topic}),(0,t.jsx)(K,{children:(0,t.jsx)($,{variant:"outline",children:c.kind})}),(0,t.jsx)(K,{className:"text-right font-medium tabular-nums",children:c.subscribers})]},`${c.kind}:${c.topic}`)}S(ee,"Y");export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as z}from"./chunk-
|
|
1
|
+
import{a as z}from"./chunk-BUYKTV27.js";import{a as _}from"./chunk-V5ZKAZR6.js";import{b as x}from"./chunk-UB6S6VYI.js";import"./chunk-DMQVY5L7.js";import{a as B,b as E,c as L,d as S,e as i,f as s}from"./chunk-WVAWKCNQ.js";import{b as W}from"./chunk-LUHBGCMO.js";import{a as A,e as q}from"./chunk-VUMS4VIV.js";import{n as O}from"./chunk-PLCYDHU3.js";import"./chunk-WY23EROJ.js";import{B as H}from"./chunk-G4H5DPO6.js";import"./chunk-JSVT5VBU.js";import{a as $}from"./chunk-A6TVTNKO.js";import{b as D}from"./chunk-ADABTCDI.js";import{a as R,d as M}from"./chunk-5PEAXTYQ.js";var I=M($(),1);var n=M(D(),1);var F=2e3,G=new Set(["open"]),ie=R(Q=>{let e=(0,I.c)(41),{read:y}=Q,t=H(),j=O(),v;e[0]!==j||e[1]!==y?(v=R(()=>Promise.resolve(y?y():j.debug()),"T"),e[0]=j,e[1]=y,e[2]=v):v=e[2];let V=v,K=y?"injected":"live",b;e[3]!==K?(b=["lunora-studio","sync-client-debug",K],e[3]=K,e[4]=b):b=e[4];let{data:c,poll:Y}=W(b,V);if(z(Y,!0,F),!c){let r;e[5]!==t?(r=t("Reading the sync client's state\u2026"),e[5]=t,e[6]=r):r=e[6];let g;e[7]!==t?(g=t("Sync client"),e[7]=t,e[8]=g):g=e[8];let T;return e[9]!==r||e[10]!==g?(T=(0,n.jsx)(A,{children:(0,n.jsx)(q,{children:(0,n.jsx)(_,{description:r,title:g})})}),e[9]=r,e[10]=g,e[11]=T):T=e[11],T}let{pendingWrites:k,shards:N,subscriptions:w}=c,l;e[12]!==t?(l=t("This Studio session's sync client"),e[12]=t,e[13]=l):l=e[13];let a;e[14]!==l?(a=(0,n.jsx)("span",{className:"text-sm font-medium",children:l}),e[14]=l,e[15]=a):a=e[15];let P=c.connectionStatus==="connected"?"default":"secondary",o;e[16]!==c.connectionStatus||e[17]!==P?(o=(0,n.jsx)(x,{variant:P,children:c.connectionStatus}),e[16]=c.connectionStatus,e[17]=P,e[18]=o):o=e[18];let d;e[19]!==k||e[20]!==t?(d=k>0?(0,n.jsx)(x,{variant:"secondary",children:t("{count} pending writes",{count:k})}):null,e[19]=k,e[20]=t,e[21]=d):d=e[21];let h;e[22]!==a||e[23]!==o||e[24]!==d?(h=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a,o,d]}),e[22]=a,e[23]=o,e[24]=d,e[25]=h):h=e[25];let u;e[26]!==t?(u=t("Reads client.debug() for the client running in this page \u2014 not your application's client. Call client.debug() in your app to diagnose a specific stuck overlay there."),e[26]=t,e[27]=u):u=e[27];let m;e[28]!==u?(m=(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:u}),e[28]=u,e[29]=m):m=e[29];let p;e[30]!==N||e[31]!==t?(p=N.length===0?(0,n.jsx)(_,{description:t("No shard connection has been opened yet."),title:t("No shards")}):(0,n.jsxs)(B,{children:[(0,n.jsx)(E,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(i,{children:t("Shard")}),(0,n.jsx)(i,{children:t("Socket")}),(0,n.jsx)(i,{children:t("Confirmed watermark")})]})}),(0,n.jsx)(L,{children:N.map(r=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{children:r.shardKey??t("(default)")}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:G.has(r.wsState)?"default":"secondary",children:r.wsState})}),(0,n.jsx)(s,{children:r.confirmedMutationWatermark})]},r.shardKey??"__default__"))})]}),e[30]=N,e[31]=t,e[32]=p):p=e[32];let f;e[33]!==w||e[34]!==t?(f=w.length===0?(0,n.jsx)(_,{description:t("This client holds no live queries or shapes."),title:t("No subscriptions")}):(0,n.jsxs)(B,{children:[(0,n.jsx)(E,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(i,{children:t("Subscription")}),(0,n.jsx)(i,{children:t("Kind")}),(0,n.jsx)(i,{children:t("Acked")}),(0,n.jsx)(i,{children:t("Cursor")}),(0,n.jsx)(i,{children:t("Pending overlays")})]})}),(0,n.jsx)(L,{children:w.map(r=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{className:"font-mono text-xs",children:r.functionPath}),(0,n.jsx)(s,{children:r.kind}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:r.acked?"default":"secondary",children:r.acked?t("yes"):t("no")})}),(0,n.jsx)(s,{children:r.serverCursor??"\u2014"}),(0,n.jsx)(s,{children:r.pendingOptimisticLayers})]},r.id))})]}),e[33]=w,e[34]=t,e[35]=f):f=e[35];let C;return e[36]!==m||e[37]!==p||e[38]!==f||e[39]!==h?(C=(0,n.jsx)(A,{children:(0,n.jsxs)(q,{className:"flex flex-col gap-4",children:[h,m,p,f]})}),e[36]=m,e[37]=p,e[38]=f,e[39]=h,e[40]=C):C=e[40],C},"ie");export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-5FHGTA7V.js";import{a as C}from"./chunk-KEHWNM7Q.js";import{a as c}from"./chunk-V5ZKAZR6.js";import{b as N}from"./chunk-UB6S6VYI.js";import"./chunk-DMQVY5L7.js";import{a as k}from"./chunk-4OWWWAMB.js";import"./chunk-5XQM44J7.js";import{a as w,b as T,c as A,d as f,e as s,f as l}from"./chunk-WVAWKCNQ.js";import"./chunk-VND72OIC.js";import"./chunk-VLQU4G6O.js";import"./chunk-EOFWXI3T.js";import{a as v}from"./chunk-LYVYUTQY.js";import{c as p}from"./chunk-LUHBGCMO.js";import{a as b,e as S}from"./chunk-VUMS4VIV.js";import"./chunk-PLCYDHU3.js";import"./chunk-WY23EROJ.js";import{B as y}from"./chunk-G4H5DPO6.js";import"./chunk-JSVT5VBU.js";import"./chunk-A6TVTNKO.js";import{a as R,b as V}from"./chunk-ADABTCDI.js";import{a as n,d as x}from"./chunk-5PEAXTYQ.js";var F=x(R(),1);var e=x(V(),1);var $=n(a=>{let t=a.trim();if(t.length===0)return{context:void 0,error:null};try{let o=JSON.parse(t);return o===null||typeof o!="object"||Array.isArray(o)?{context:void 0,error:"Targeting context must be a JSON object."}:{context:o,error:null}}catch{return{context:void 0,error:"Targeting context is not valid JSON."}}},"H"),q='{ "targetingKey": "user-123", "plan": "premium" }',D=n(a=>a.type==="object"?JSON.stringify(a.value):String(a.value),"R"),Y=n(({initialShardKey:a=""})=>{let t=y(),[o,j]=(0,F.useState)(""),{context:g,error:m}=$(o),I=g===void 0?{}:{context:g},{data:i,error:J,errorSource:K,liveError:E}=p(v.listFlags,I,{live:!0,shardKey:a}),u=i!==void 0,L=i?.configured??!1,h=Array.isArray(i?.flags)?[...i.flags].toSorted((r,B)=>r.key.localeCompare(B.key)):[],d;return u&&!L?d=(0,e.jsx)(c,{description:t("No @lunora/flags provider is wired in this deployment. Add lunora/flags.ts with defineFlags({ provider }) to gate code paths on feature flags."),testId:"flags-unconfigured",title:t("No flags provider configured")}):u&&h.length===0?d=(0,e.jsx)(c,{description:t('A flags provider is configured, but no handler reads a flag yet. Call ctx.flags.boolean("key", false) in a query, mutation, or action.'),testId:"flags-empty",title:t("No flags read")}):d=(0,e.jsx)(b,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(w,{"data-testid":"flags-table",children:[(0,e.jsx)(T,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(s,{children:t("Key")}),(0,e.jsx)(s,{children:t("Type")}),(0,e.jsx)(s,{children:t("Value")}),(0,e.jsx)(s,{children:t("Reason")}),(0,e.jsx)(s,{children:t("Variant")})]})}),(0,e.jsx)(A,{children:h.map(r=>(0,e.jsxs)(f,{"data-testid":`flags-row-${r.key}`,children:[(0,e.jsx)(l,{className:"font-mono text-xs",children:r.key}),(0,e.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:r.type}),(0,e.jsx)(l,{className:"font-mono text-xs",children:D(r)}),(0,e.jsx)(l,{children:r.errorCode===void 0?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:r.reason??"\u2014"}):(0,e.jsx)(N,{"data-testid":`flags-error-${r.key}`,variant:"destructive",children:r.errorCode})}),(0,e.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:r.variant??"\u2014"})]},r.key))})]})})}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-flags-panel",children:[J!==null&&(0,e.jsx)(k,{error:K,shardKey:a,testId:"flags-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t('Feature flags are read in code with ctx.flags.<type>("key", default). They evaluate through the OpenFeature provider configured in lunora/flags.ts; edit the targeting context below to see how each flag resolves for a given audience.')}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(C,{htmlFor:"flags-targeting-context",children:t("Targeting context (JSON)")}),(0,e.jsx)(O,{className:"font-mono text-xs","data-testid":"flags-context-input",id:"flags-targeting-context",onChange:n(r=>{j(r.target.value)},"onChange"),placeholder:q,rows:3,value:o}),m!==null&&(0,e.jsx)("p",{className:"text-xs text-destructive","data-testid":"flags-context-error",role:"alert",children:t(m)}),E!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"flags-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")})]}),d]})},"W");export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,
|
|
1
|
+
import{b as i,i as a}from"./chunk-DMQVY5L7.js";import{a as o}from"./chunk-WY23EROJ.js";import{x as n}from"./chunk-G4H5DPO6.js";import{a as r}from"./chunk-5PEAXTYQ.js";function s(e){return a(e.defaultTagName??"div",e,e)}r(s,"useRender");var g=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function x({className:e,variant:t="default",render:d,...u}){return s({defaultTagName:"span",props:i({className:n(g({variant:t}),e)},u),render:d,state:{slot:"badge",variant:t}})}r(x,"f");export{s as a,x as b};
|