1import{r as a,M,j as o}from"./CZzrexQa.production.bundle.min.js";import{A as R}from"./BkFsgW6T.production.bundle.min.js";import{c as E}from"./C_cH1u9D.production.bundle.min.js";import{u as P}from"./9eHdvLN4.production.bundle.min.js";import{G as D}from"./B2jjARHc.production.bundle.min.js";import{cv as A,cw as B,cx as O,cy as q,cz as F,aI as G,aJ as K}from"./DeceMiF-.production.bundle.min.js";import{F as $}from"./DFn2u8qh.production.bundle.min.js";import{T as z}from"./oN3AJijl.production.bundle.min.js";import{h,D as U,P as J}from"./3wIbuO__.production.bundle.min.js";import"./CLBsRoPD.production.bundle.min.js";import"./DGYQp8fe.production.bundle.min.js";import"./DGAisTA8.production.bundle.min.js";import"./E6csxmgU.production.bundle.min.js";import"./D8sKcCdJ.production.bundle.min.js";import"./kkIr59yR.production.bundle.min.js";import"./BmBjCq8D.production.bundle.min.js";import"./CHClG9UV.production.bundle.min.js";import"./Dsqj8S3w.production.bundle.min.js";import"./tkddr5kZ.production.bundle.min.js";import"./Bm1LOIPR.production.bundle.min.js";import"./DtpVAsok.production.bundle.min.js";import"./2mZBARql.production.bundle.min.js";import"./vhNSgALD.production.bundle.min.js";import"./YCM_kEyP.production.bundle.min.js";import"./D4lvmK5r.production.bundle.min.js";import"./DWUNlcjA.production.bundle.min.js";import"./CUZmxn9S.production.bundle.min.js";import"./DvLd3evF.production.bundle.min.js";import"./Ci_hGDFV.production.bundle.min.js";import"./CiD4UJCU.production.bundle.min.js";import"./D0x1Z4HE.production.bundle.min.js";import"./b2Mkg01q.production.bundle.min.js";import"./DwmhJbxl.production.bundle.min.js";import"./D-90pMQ7.production.bundle.min.js";import"./B0uEge7d.production.bundle.min.js";import"./DQegFpUo.production.bundle.min.js";import"./Y4Ob0Is8.production.bundle.min.js";import"./CXT9N8xZ.production.bundle.min.js";import"./C_Ln3svq.production.bundle.min.js";import"./7LcJfZNO.production.bundle.min.js";import"./CNsPFEJO.production.bundle.min.js";import"./CJIgguc4.production.bundle.min.js";import"./zzLyrqbE.production.bundle.min.js";import"./CpVN2k6O.production.bundle.min.js";import"./B7Fri_dM.production.bundle.min.js";import"./Ch78CD0x.production.bundle.min.js";import"./D1TNtnEv.production.bundle.min.js";import"./DnQqxH0F.production.bundle.min.js";const k="LOGS_CUSTOM_METRICS_CALLER",Ge=()=>{const r=a.useContext(M),s=P(),m=a.useMemo(()=>({fromTs:(r==null?void 0:r.params.dateRange.fromTs)||0,toTs:(r==null?void 0:r.params.dateRange.toTs)||0}),[r]),d=r.params.query.get(k)||"",[c,x]=a.useState(1),[g,N]=a.useState([]),[v,C]=a.useState(0),[j,u]=a.useState(!0),[S,n]=a.useState(!1),[f,T]=a.useState(0),i=a.useCallback(()=>{u(!0),s(A({search:d,page:c,starred:r.params.query.get("starred")||"false"},(e,t)=>{t!=null&&t.notebooks&&(N(t.notebooks),C(t.total)),u(!1)}))},[s,d,c]);a.useEffect(()=>{i()},[i,,r.params.query.get("starred")]);const p=a.useCallback(e=>{const t=new URL(`${window.location.origin}/dashboards/notebook/${e}?live=false&from_ts=${m.fromTs}&to_ts=${m.toTs}&range=custom&trail=false`);window.open(t.toString(),"_blank")},[m]),b=a.useCallback(e=>{s(B(e.id,!e.fav,t=>t&&i()))},[s,i]),w=a.useCallback(()=>{s(O({name:`Notebook ${new Date().toLocaleString()}`},(e,t)=>{e&&t&&(p(t.id),i())}))},[s,i,p]),y=a.useCallback(()=>{s(q(f,e=>{e&&i()})),n(!1)},[s,f,i]),L=a.useMemo(()=>[{title:"Favourite",columnKey:"fav",width:80,fixed:!0,render:(e,t)=>{const l=t;return o.jsx("div",{className:"favourite-icon",onClick:_=>{_.stopPropagation(),b(l)},children:o.jsx(h,{filled:!!l.fav})})}},{title:"Name",columnKey:"name",width:300,fixed:!0,render:e=>o.jsx("div",{className:"text-value",children:e})},{title:"Author",columnKey:"user",width:200,fixed:!0,render:e=>o.jsxs("div",{className:"author-name",children:[o.jsx(R,{size:20,seed:e}),o.jsx("span",{className:"text-value",children:e})]})},{title:"Date Modified",columnKey:"updated_at",width:500,fixed:!0,render:(e,t)=>o.jsxs("div",{className:"notebook-modified",children:[o.jsx("span",{className:"text-value",children:F(e)}),o.jsx("div",{className:"delete-notebook-actions",onClick:l=>{l.stopPropagation(),T(t.id),n(!0)},children:o.jsx(U,{color:"var(--color-error)"})})]})}],[b]),I=()=>
1o.jsx($,{checked:r.params.query.get("starred")==="true",onChange:e=>{r.params.query.set("starred",e?"true":"false"),r.params.query.redirect()},suffixLabelIcon:o.jsx(h,{filled:!0,size:14}),label:"Filter Starred Notebooks",id:"notebooks-filter-starred"});return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"logs-custom-metrics logs-pipeline-main-wrapper",children:[o.jsx("div",{className:"common-search-area logs-search-area",children:o.jsx(D,{placeholder:"Search by name",hideGroupByLabel:!0,caller:k,extraBtnLabel:"New Notebook",extraBtnPrefixIcon:o.jsx(J,{color:"var(--color-primary)"}),onExtraBtnClick:w})}),o.jsx("div",{className:"notebooks-container",children:o.jsx(z,{titleChild:I(),children:o.jsx(E,{columns:L,dataProvider:g,loading:j,uniqId:"logs-pipeline-list-view",rowOnClick:e=>p(e==null?void 0:e.id),pagination:{totalRecords:v,page:c,recordsPerPage:50,recordsLabel:"Notebooks",onChange:x}})})})]}),o.jsx(G,{type:K.Delete,title:"Confirm Action",description:"This will permanently delete the notebook. Are you sure?",isOpen:S,confirmBtnText:"Yes, Delete Notebook",cancelBtnText:"No, Keep it",onClose:()=>n(!1),handleConfirmEvent:y,handleCancelEvent:()=>n(!1)})]})};export{Ge as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.