@zeniai/web-cockpit-ui 2.0.97-qa → 2.0.98-next

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/assets/{CreditAgentRoutes-CuV-GBGt.js → CreditAgentRoutes-CkPggWDx.js} +3 -3
  2. package/dist/assets/{Preview-BpBMJc-6.js → Preview-DtaG6euw.js} +1 -1
  3. package/dist/assets/{ScreenRoutes-Dm2e-diw.js → ScreenRoutes-rDHoDcWf.js} +42 -42
  4. package/dist/assets/SignInScreen-CaJmwZpQ.js +1 -0
  5. package/dist/assets/{analytics-D0Nyq2J3.js → analytics-BsgsSMM6.js} +1 -1
  6. package/dist/assets/{analyticsHelper-BIfUIHUE.js → analyticsHelper-Cc3rsVqO.js} +1 -1
  7. package/dist/assets/{core-q1ZGCxQ8.js → core-B4u1RKLz.js} +1 -1
  8. package/dist/assets/{dash.all.min-BLGWqs2-.js → dash.all.min-CPJDDHCH.js} +1 -1
  9. package/dist/assets/{empty-1ZVxaDdT.js → empty-B-qNPnZu.js} +1 -1
  10. package/dist/assets/{empty-CvAgRh9z.js → empty-CWiz34LT.js} +1 -1
  11. package/dist/assets/epic-FUSjXmrA.js +2 -0
  12. package/dist/assets/{index-Bxw349eT.js → index-CXgohh1r.js} +5508 -5516
  13. package/dist/assets/{index-zFNZGgMo.js → index-CjVSF_sm.js} +1 -1
  14. package/dist/assets/{index-CMhEQscW.js → index-DArfhUXI.js} +2 -2
  15. package/dist/assets/{index-tzMzG_T4.js → index-DOxadJ1K.js} +1 -1
  16. package/dist/assets/{index-CNxTfPiI.js → index-DULg34Gn.js} +1 -1
  17. package/dist/assets/{index-BBrkdHqS.js → index-DrQ_akeA.js} +1 -1
  18. package/dist/assets/{index-CpFNIzpM.js → index-sty7miuV.js} +1 -1
  19. package/dist/assets/{lexical-Bnu2T6Q_.js → lexical-CwaNnmIL.js} +1 -1
  20. package/dist/assets/{liveblocks-16S-leVn.js → liveblocks-t1sMjHqg.js} +1 -1
  21. package/dist/assets/{lottie-BYvka23e.js → lottie-BM5ZKuM7.js} +1 -1
  22. package/dist/assets/{mui-B8gx2XKd.js → mui-B9ZtTBAX.js} +1 -1
  23. package/dist/assets/{react-DQd4Zpvn.js → react-B-oEMZn7.js} +1 -1
  24. package/dist/assets/{react-OdTGrvWT.js → react-BStnRG0v.js} +1 -1
  25. package/dist/assets/{react-Bn99cg9b.js → react-BVLm0PHT.js} +1 -1
  26. package/dist/assets/{react-Dy4jfccu.js → react-BlriPM3T.js} +1 -1
  27. package/dist/assets/{react-6Hna18F3.js → react-CTrSA2KU.js} +2 -2
  28. package/dist/assets/{react-1OP3scz2.js → react-CePLoa5D.js} +1 -1
  29. package/dist/assets/{react-CxkFB9kw.js → react-CzPArpBw.js} +1 -1
  30. package/dist/assets/{react-BbLaunPr.js → react-Dbg3fyBt.js} +1 -1
  31. package/dist/assets/{recharts-CMtXSNxt.js → recharts-Kkegqrua.js} +1 -1
  32. package/dist/assets/{sentry-BPdK0nLb.js → sentry-nyV1cMnR.js} +1 -1
  33. package/dist/assets/{url-CkQqqI5Z.js → url-BBBg3su2.js} +1 -1
  34. package/dist/assets/{url-k1m-VXGx.js → url-DpWCVMSj.js} +1 -1
  35. package/dist/assets/{utils-C8NzI3ou.js → utils-DTvulS7a.js} +1 -1
  36. package/dist/assets/{zeni-epic-state-94mXURSd.js → zeni-epic-state-QJu5k6Dh.js} +4 -4
  37. package/dist/index.html +1 -1
  38. package/package.json +4 -4
  39. package/dist/assets/SignInScreen-DfVw3DHC.js +0 -1
  40. package/dist/assets/epic-Bfsdk5MY.js +0 -2
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-16S-leVn.js";import{u as D,P as k}from"./ScreenRoutes-Dm2e-diw.js";import{a as f}from"./sentry-BPdK0nLb.js";import{i as v,n as P,g as m,h as j,k as C,l as I,N as R}from"./core-q1ZGCxQ8.js";import{Ka as T,Kb as N,kd as M,Kc as E,kX as L,k_ as $,kM as _,Kd as K,Ke as O,kU as B,kQ as F}from"./zeni-epic-state-94mXURSd.js";import{z as J,$ as q,d as V,e as Q,a0 as X,U as Z,J as G,b as H,g as W,h as Y}from"./index-Bxw349eT.js";import{n as ee}from"./mui-B8gx2XKd.js";import"./recharts-CMtXSNxt.js";import"./analyticsHelper-BIfUIHUE.js";import"./utils-C8NzI3ou.js";import"./empty-CvAgRh9z.js";import"./index-CNxTfPiI.js";import"./url-k1m-VXGx.js";import"./index-tzMzG_T4.js";import"./analytics-D0Nyq2J3.js";import"./lottie-BYvka23e.js";import"./lexical-Bnu2T6Q_.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="6ba5ce7e-a5f7-48e1-b989-ff7106153451",a._sentryDebugIdIdentifier="sentry-dbid-6ba5ce7e-a5f7-48e1-b989-ff7106153451")}catch{}})();function te(a,t){return{headerData:{allTabOptions:Z,selectedTabOption:G("creditAgent")},creditAgentPageData:{macroData:{data:t.macroCombined.data,fetchState:t.macroCombined.fetchStatus.fetchState,updateState:t.macroCombined.updateStatus.fetchState},cardProfilesData:t.cardProfilesData}}}function ne(a,t){return{headerActions:{onTabChange:n=>{const g=Y(n),c=W(n);H.trackCockpitTabClicked(c),t.navigate(`../../${g}`,{replace:!0})}},creditAgentPageActions:{onFetchMacro:()=>{a(F())},onSaveMacro:n=>{a(B(n))},onResetSaveMacro:()=>{a(O())},onUIStateChange:n=>{a(K(n))},cardProfilesActions:t.cardProfilesActions}}}const ae=j(te,ne)(X),oe=ee.div`
2
- padding: ${Q.sp5};
1
+ import{j as s}from"./liveblocks-t1sMjHqg.js";import{u as D,P as k}from"./ScreenRoutes-rDHoDcWf.js";import{a as f}from"./sentry-nyV1cMnR.js";import{i as v,n as P,g as m,h as R,k as C,l as I,N as j}from"./core-B4u1RKLz.js";import{Kb as N,Kc as T,ke as E,Kd as M,kY as L,k$ as $,kN as _,Ke as K,Kf as O,kV as B,kR as F}from"./zeni-epic-state-QJu5k6Dh.js";import{z as J,_ as V,d as q,e as Y,a0 as Z,U as G,J as H,b as Q,g as W,h as X}from"./index-CXgohh1r.js";import{n as ee}from"./mui-B9ZtTBAX.js";import"./recharts-Kkegqrua.js";import"./analyticsHelper-Cc3rsVqO.js";import"./utils-DTvulS7a.js";import"./empty-CWiz34LT.js";import"./index-DULg34Gn.js";import"./url-DpWCVMSj.js";import"./index-DOxadJ1K.js";import"./analytics-BsgsSMM6.js";import"./lottie-BM5ZKuM7.js";import"./lexical-CwaNnmIL.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="88daefa2-038c-4fa4-bf82-f683b7e5415b",a._sentryDebugIdIdentifier="sentry-dbid-88daefa2-038c-4fa4-bf82-f683b7e5415b")}catch{}})();function te(a,t){return{headerData:{allTabOptions:G,selectedTabOption:H("creditAgent")},creditAgentPageData:{macroData:{data:t.macroCombined.data,fetchState:t.macroCombined.fetchStatus.fetchState,updateState:t.macroCombined.updateStatus.fetchState},cardProfilesData:t.cardProfilesData}}}function ne(a,t){return{headerActions:{onTabChange:n=>{const g=X(n),c=W(n);Q.trackCockpitTabClicked(c),t.navigate(`../../${g}`,{replace:!0})}},creditAgentPageActions:{onFetchMacro:()=>{a(F())},onSaveMacro:n=>{a(B(n))},onResetSaveMacro:()=>{a(O())},onUIStateChange:n=>{a(K(n))},cardProfilesActions:t.cardProfilesActions}}}const ae=R(te,ne)(Z),oe=ee.div`
2
+ padding: ${Y.sp5};
3
3
  text-align: center;
4
- `;function re(){const a=v(),t=P(),n=m(T),g=m(N),[c,h]=f.useState(new Set),p=f.useRef(new Set),b=m(e=>e.tenantState.currentTenantId),y=m(e=>e.companyViewState.zeniUsers.fetchState);f.useEffect(()=>{y==="Not-Started"&&t(M())},[t,y]);const d=J.getSignedInUser(),A=d!=null&&[d.firstName,d.lastName].filter(Boolean).join(" ")||void 0,z=f.useMemo(()=>({onFetch:()=>{t(_())},onUpdateProfile:(e,o,r)=>{const i=r.updatedByName??A;t($({tenantId:o,tenantEmailDomain:e,update:{...r,updatedByName:i}}))},onAnalyse:e=>{h(o=>new Set(o).add(e)),t(L(e))},onDownloadReport:()=>{const e=E(n.rows),o=d?.userId??"",r=d?.zeniSessionId??"",i=b??"";if(!o||!r||!i)return;const x=encodeURIComponent(JSON.stringify(e)),U=`${q}/tableDownload?query=${x}`;fetch(U,{headers:{"zeni-user-id":o,"zeni-session-id":r,"zeni-tenant-id":i}}).then(async l=>{if(!l.ok){const u=await l.text();throw new Error(`Download failed: ${l.status} ${u}`)}return l.blob()}).then(l=>{const u=URL.createObjectURL(l),S=document.createElement("a");S.href=u,S.download=`${e.file_name}.xlsx`,S.click(),URL.revokeObjectURL(u)}).catch(()=>{})}}),[t,A,d,b,n.rows]);f.useEffect(()=>{if(c.size===0)return;const e=new Set;for(const o of c){const r=n.rows.find(i=>i.tenantId===o);r!=null&&r.isAnalyzing?p.current.add(o):r!=null&&!r.isAnalyzing&&p.current.has(o)&&(e.add(o),p.current.delete(o))}e.size>0&&h(o=>{const r=new Set(o);for(const i of e)r.delete(i);return r})},[n.rows,c]);const w=f.useMemo(()=>({fetchState:n.fetchStatus.fetchState,rows:n.rows.map(e=>e.isAnalyzing||e.tenantId!=null&&c.has(e.tenantId)?{...e,isAnalyzing:!0}:e),uiState:n.uiState}),[n,c]);return d==null?s.jsx(oe,{children:V.getLocalizedStrings().cockpit.creditAgent.notSignedIn}):s.jsx(ae,{macroCombined:g,navigate:a,cardProfilesActions:z,cardProfilesData:w})}function ze(){const{isAllowed:a,isLoading:t}=D();return t?null:a?s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(k,{element:s.jsx(re,{})})})}):s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(R,{to:"/management",replace:!0})})})}export{ze as default};
4
+ `;function re(){const a=v(),t=P(),n=m(N),g=m(T),[c,h]=f.useState(new Set),p=f.useRef(new Set),b=m(e=>e.tenantState.currentTenantId),y=m(e=>e.companyViewState.zeniUsers.fetchState);f.useEffect(()=>{y==="Not-Started"&&t(E())},[t,y]);const d=J.getSignedInUser(),A=d!=null&&[d.firstName,d.lastName].filter(Boolean).join(" ")||void 0,z=f.useMemo(()=>({onFetch:()=>{t(_())},onUpdateProfile:(e,o,r)=>{const i=r.updatedByName??A;t($({tenantId:o,tenantEmailDomain:e,update:{...r,updatedByName:i}}))},onAnalyse:e=>{h(o=>new Set(o).add(e)),t(L(e))},onDownloadReport:()=>{const e=M(n.rows),o=d?.userId??"",r=d?.zeniSessionId??"",i=b??"";if(!o||!r||!i)return;const x=encodeURIComponent(JSON.stringify(e)),U=`${V}/tableDownload?query=${x}`;fetch(U,{headers:{"zeni-user-id":o,"zeni-session-id":r,"zeni-tenant-id":i}}).then(async l=>{if(!l.ok){const u=await l.text();throw new Error(`Download failed: ${l.status} ${u}`)}return l.blob()}).then(l=>{const u=URL.createObjectURL(l),S=document.createElement("a");S.href=u,S.download=`${e.file_name}.xlsx`,S.click(),URL.revokeObjectURL(u)}).catch(()=>{})}}),[t,A,d,b,n.rows]);f.useEffect(()=>{if(c.size===0)return;const e=new Set;for(const o of c){const r=n.rows.find(i=>i.tenantId===o);r!=null&&r.isAnalyzing?p.current.add(o):r!=null&&!r.isAnalyzing&&p.current.has(o)&&(e.add(o),p.current.delete(o))}e.size>0&&h(o=>{const r=new Set(o);for(const i of e)r.delete(i);return r})},[n.rows,c]);const w=f.useMemo(()=>({fetchState:n.fetchStatus.fetchState,rows:n.rows.map(e=>e.isAnalyzing||e.tenantId!=null&&c.has(e.tenantId)?{...e,isAnalyzing:!0}:e),uiState:n.uiState}),[n,c]);return d==null?s.jsx(oe,{children:q.getLocalizedStrings().cockpit.creditAgent.notSignedIn}):s.jsx(ae,{macroCombined:g,navigate:a,cardProfilesActions:z,cardProfilesData:w})}function ze(){const{isAllowed:a,isLoading:t}=D();return t?null:a?s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(k,{element:s.jsx(re,{})})})}):s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(j,{to:"/management",replace:!0})})})}export{ze as default};
@@ -1 +1 @@
1
- import{a as h,b as a}from"./sentry-BPdK0nLb.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="6d600b3f-6c40-4b9e-8892-371ff81f1c30",t._sentryDebugIdIdentifier="sentry-dbid-6d600b3f-6c40-4b9e-8892-371ff81f1c30")}catch{}})();const c="64px",f={},k=({src:t,light:n,oEmbedUrl:r,onClickPreview:s,playIcon:m,previewTabIndex:I,previewAriaLabel:u})=>{const[p,o]=h.useState(null);h.useEffect(()=>{!t||!n||!r||_({src:t,light:n,oEmbedUrl:r})},[t,n,r]);const _=async({src:e,light:i,oEmbedUrl:E})=>{if(a.isValidElement(i))return;if(typeof i=="string"){o(i);return}if(f[e]){o(f[e]);return}o(null);const b=await(await fetch(E.replace("{url}",e))).json();if(b.thumbnail_url){const g=b.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");o(g),f[e]=g}},w=e=>{(e.key==="Enter"||e.key===" ")&&s?.(e)},v=e=>{s?.(e)},l=a.isValidElement(n),y={display:"flex",alignItems:"center",justifyContent:"center"},d={preview:{width:"100%",height:"100%",backgroundImage:p&&!l?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:l?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},x=a.createElement("div",{style:d.shadow,className:"react-player__shadow"},a.createElement("div",{style:d.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:d.preview,className:"react-player__preview",tabIndex:I,onClick:v,onKeyDown:w,...u?{"aria-label":u}:{}},l?n:null,m||x)};var S=k;export{S as default};
1
+ import{a as h,b as a}from"./sentry-nyV1cMnR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="6d600b3f-6c40-4b9e-8892-371ff81f1c30",t._sentryDebugIdIdentifier="sentry-dbid-6d600b3f-6c40-4b9e-8892-371ff81f1c30")}catch{}})();const c="64px",f={},k=({src:t,light:n,oEmbedUrl:r,onClickPreview:s,playIcon:m,previewTabIndex:I,previewAriaLabel:u})=>{const[p,o]=h.useState(null);h.useEffect(()=>{!t||!n||!r||_({src:t,light:n,oEmbedUrl:r})},[t,n,r]);const _=async({src:e,light:i,oEmbedUrl:E})=>{if(a.isValidElement(i))return;if(typeof i=="string"){o(i);return}if(f[e]){o(f[e]);return}o(null);const b=await(await fetch(E.replace("{url}",e))).json();if(b.thumbnail_url){const g=b.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");o(g),f[e]=g}},w=e=>{(e.key==="Enter"||e.key===" ")&&s?.(e)},v=e=>{s?.(e)},l=a.isValidElement(n),y={display:"flex",alignItems:"center",justifyContent:"center"},d={preview:{width:"100%",height:"100%",backgroundImage:p&&!l?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:l?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},x=a.createElement("div",{style:d.shadow,className:"react-player__shadow"},a.createElement("div",{style:d.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:d.preview,className:"react-player__preview",tabIndex:I,onClick:v,onKeyDown:w,...u?{"aria-label":u}:{}},l?n:null,m||x)};var S=k;export{S as default};