PageSourceSearch

https://app.sellermate.ai/assets/ListCustomDashboard-nHb2hiyM.js

js sellermate.ai collected 2026-10-05 12:36:27 UTC 54,605 bytes, 1 lines download raw bytes

1import{r as ce,i as xe,j as e,u as te,c as Ee,U as Je,cC as Kt,cP as Qt,ei as Ho,k as To,y as a,x as Xt,aw as Po,D as Ae,n as et,T as h,o as _e,aa as Zt,aj as Vo,ak as Go,ae as Yo,al as Uo,a9 as M,B as s,v as qo,b as H,z as de,F as k,I as V,K as tt,M as oe,S as ae,X as Xe,g as Jt,C as Ko,H as Ze,bx as Qo,eT as Be,eC as Xo,p as eo,q as to,t as Zo,N as ot,R as ke,G as Jo,e as er,m as tr,d as or,eU as rr,cR as ir,eV as Fe,eW as Nt,eX as Ht,eY as nr,aq as sr,eZ as ar,a5 as ee,ce as lr,a8 as Tt,af as dr,e_ as cr}from"./index-Ypozs0vX.js";import{d as oo,A as xr}from"./constants-lGGiuA6w.js";import"./index-Za-nke9D.js";import{A as pr,R as hr}from"./ReportTables-nKUesL88.js";import{d as Pt}from"./Delete-JnIxhHWU.js";import{a as le,d as ro,F as ur,S as fr,b2 as Vt}from"./index-011gqqKf.js";import{H as mr}from"./index-Nz0VxxO9.js";import{d as Gt}from"./Edit-9PTbA6jg.js";import{d as io,a as gr,b as Yt}from"./DriveFileRenameOutline-rPA6KvN3.js";import{b as br,d as jr,S as Sr,C as yr,a as Cr,c as Fr}from"./ShareLinksDialog-HFJNMxKf.js";import{d as wr}from"./MoreHoriz-lAvo_-np.js";import{d as we}from"./ContentCopy-0ND6HgJS.js";import{d as vr}from"./TableChart-CKrfiWdg.js";import{d as no}from"./Dashboard-_g65tsM9.js";import{g as so,u as Dr,a as Ut}from"./useCustomDashboard-XPc8Ef1y.js";import{u as kr}from"./useHasWorkspaceRole-ZpIztW_5.js";import{W as ve}from"./workspace-rLbBI_cf.js";import{g as Ir}from"./countries-_bYbxs6n.js";import{C as Br}from"./Checkbox-HJ3IUwy4.js";import{D as Er}from"./index-VTWTpEQT.js";import{u as Ar,D as _r,A as zr}from"./useManageBoard-XwoA3BRP.js";import{d as Mr}from"./GroupAddOutlined-B7he959Z.js";import{L as rt}from"./Link-iScKr6i1.js";import{d as Rr}from"./MoreVert-Ix4VxBat.js";import{d as Wr}from"./CalendarTodayOutlined-1OcmyShd.js";import{d as Lr}from"./AccessTimeOutlined-w2OLaqeG.js";import{d as $r}from"./FiberManualRecord-uFmtbjwS.js";import{E as Or}from"./Edit-iSxZw4vp.js";import{u as Nr}from"./useTemplates-ItnPp73l.js";import{S as Hr}from"./StarIcon-ZEkX12ak.js";import{d as Tr}from"./EmojiObjectsOutlined-0e0yXTar.js";import{A as Pr}from"./useImageDisplayUrls-dW8CdHu1.js";import{a as Vr}from"./useGridApiContext-ZQgV-IKW.js";import{S as Gr}from"./Skeleton--t-Z7OgK.js";import{S as Qe}from"./Switch-FpMGFEqp.js";import"./react-error-boundary.esm-HIhRa8BR.js";import"./DataGridPro-zl3cM6FL.js";import"./index-Ul3OjKpc.js";import"./LinearProgress-r-h_7pxb.js";import"./FirstPage-wgytJ0r_.js";import"./TableCell-ZTG1gmDP.js";import"./FormControlLabel-giL-2lEN.js";import"./useThemeProps-ERKQ9jSZ.js";import"./date-range-picker-SEPrxtX4.js";import"./currency-symbol--NGSXlcy.js";import"./AutoAwesome-gdfomUyY.js";import"./InfoOutlined-rLFmhss_.js";import"./Add-EWtzxRYX.js";import"./KeyboardArrowDown-hgyBospT.js";import"./date-range-picker-field-DN_viYNb.js";import"./Event-fF8QT8-Z.js";import"./index-Xj1cuN43.js";import"./useGridApiRef-wrqM6ZeV.js";import"./SwitchBase-qvPxkoHk.js";import"./DialogContentText-Z-jXbIWM.js";import"./sortable.esm-lNZWq8C5.js";import"./ErrorOutline-iEprricj.js";import"./EmptyStateIcon-CDdQ_CL3.js";import"./WarningAmberOutlined-LHWlj4hb.js";import"./Tabs-Y_rxNpzS.js";import"./Tab-7Pk2ftl9.js";var it={},Yr=xe;Object.defineProperty(it,"__esModule",{value:!0});var Ie=it.default=void 0,Ur=Yr(ce()),qr=e,Kr=(0,Ur.default)((0,qr.jsx)("path",{d:"M5 11h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2zm0 10h4c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2zm8-16v4c0 1.1.9 2 2 2h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-4c-1.1 0-2 .9-2 2zm2 16h4c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2h-4c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2z"}),"GridViewRounded");Ie=it.default=Kr;const Qr=()=>{var x,d,b,y;const n=te(Ee),[r]=Je(),g=r.get("aid"),l=Kt(),u=((x=n==null?void 0:n.selectedWorkspace)==null?void 0:x.workspaceRole)===Qt.WhiteLabelClient,m=kr([ve.Owner,ve.Admin,ve.SellerMateAdmin,ve.SellerMateManager]),F=g===Ho||To(n==null?void 0:n.selectedAmazonAccount);return a.useMemo(()=>{var p;const _=l||u,w=!_,R=w&&!F,B=n==null?void 0:n.workspaceUsers,$=(((p=n==null?void 0:n.accessControl)==null?void 0:p.hasWhiteLabelClientAccess)||(B==null?void 0:B.isSuperUser)||(B==null?void 0:B.isSellermateAdmin)||m)??!1;
1return{isViewOnlyAccess:_,canManageBoard:w,canShareBoard:R,canUpdateWhiteLabelSettings:w&&!F&&$,isDemoMode:F}},[l,u,F,(d=n==null?void 0:n.accessControl)==null?void 0:d.hasWhiteLabelClientAccess,(b=n==null?void 0:n.workspaceUsers)==null?void 0:b.isSuperUser,(y=n==null?void 0:n.workspaceUsers)==null?void 0:y.isSellermateAdmin])},Xr=({dashboardToClone:n,cloneDashboard:r,goToDashboards:g,setDashboardToClone:l})=>{const C=te(Ee),u=Xt(),[m,F]=Je(),x=m.get("aid"),{selectedAmazonAccount:d,amazonAccounts:b}=C,y=a.useMemo(()=>Po(b,d==null?void 0:d._id),[b,d==null?void 0:d._id]),[_,w]=a.useState(!0),[R,B]=a.useState(n==null?void 0:n.name),[$,S]=a.useState((n==null?void 0:n.description)||""),[p,v]=a.useState(!1),[U,G]=a.useState(!1);a.useEffect(()=>{n!=null&&n.advanceMode?G(!0):G(!1)},[n==null?void 0:n.advanceMode]);const[I,K]=a.useState([]),[T,Y]=a.useState(!1);a.useEffect(()=>{n&&(B(n==null?void 0:n.name),S((n==null?void 0:n.description)||""))},[n]);const W=()=>{l(null),w(!1)},re=async()=>{if(!R.trim()){v(!0),u(k({message:"Board name is required.",position:"bottom",severity:"error"}));return}Y(!0);try{await r(U?I:[x],n.dashboardId,R.trim(),$.trim(),U?void 0:x,n.options),u(k({message:"Board cloned successfully!",position:"bottom",severity:"success"})),w(!1),g()}catch(j){console.error("Clone Error:",j),u(k({message:"Failed to clone board!",position:"bottom",severity:"error"}))}finally{Y(!1),l(null)}},E=j=>{K(j.target.value)};return e.jsxs(Ae,{open:_,onClose:W,maxWidth:"sm",fullWidth:!0,children:[e.jsxs(et,{sx:{display:"flex",alignItems:"center",gap:"8px",padding:"16px",borderBottom:"1px solid #D4D5D5",backgroundColor:"#F7F8F8"},children:[e.jsx(no,{sx:{color:"#036A58"}}),e.jsx(h,{sx:{fontFamily:"Helvetica",fontSize:"16px",fontWeight:700,color:"#036A58"},children:"Clone Board"})]}),e.jsxs(_e,{sx:{my:2},children:[e.jsx(Zt,{label:"New Board Name",type:"text",size:"small",fullWidth:!0,margin:"dense",value:R,onChange:j=>{B(j.target.value),p&&v(!1)},error:p,helperText:p?"Name cannot be empty":""}),U&&e.jsx(e.Fragment,{children:e.jsxs(Vo,{sx:{mt:1,width:"100%"},children:[e.jsx(Go,{id:"select-amazon-account-label",children:"Select Amazon Accounts"}),e.jsx(Yo,{multiple:!0,fullWidth:!0,value:I,onChange:E,input:e.jsx(Uo,{label:"Amazon Accounts"}),label:"Amazon Accounts",labelId:"select-amazon-account-label",placeholder:"Amazon Accounts",renderValue:j=>y.filter(q=>j.includes(q._id)).map(q=>q.accountName).join(", "),size:"small",sx:{mt:1},children:(y==null?void 0:y.length)>0?y.map(j=>e.jsxs(M,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:0},value:j==null?void 0:j._id,children:[e.jsxs(s,{display:"flex",alignItems:"center",children:[e.jsx(Br,{checked:I.includes(j._id)}),e.jsx(h,{variant:"body2",children:j==null?void 0:j.accountName})]}),e.jsx("img",{src:Ir(j==null?void 0:j.countryCode),height:16,width:16,alt:j==null?void 0:j.countryCode})]},j==null?void 0:j._id)):e.jsx(M,{disabled:!0,children:"No accounts found"})})]})})]}),e.jsxs(qo,{sx:{display:"flex",justifyContent:"flex-end",padding:"16px",borderTop:"1px solid #D4D5D5"},children:[e.jsx(H,{variant:"outlined",size:"small",onClick:W,children:"Cancel"}),e.jsx(le,{children:e.jsx(H,{onClick:re,variant:"contained",size:"small",disabled:T,startIcon:T?e.jsx(de,{size:17,color:"success"}):null,sx:{textTransform:"none"},children:T?"Cloning...":"Clone"})})]})]})},Zr=({title:n,onClick:r})=>e.jsxs(H,{onClick:r,sx:{backgroundColor:"#FFFFFF",border:"1px solid #E3E7ED",color:"#6C7689","&:hover":{backgroundColor:"#F8F9FC",border:"1px solid #E3E7ED",color:"#6C7689"},textTransform:"none",borderRadius:"6px",px:"8px",py:"4px",height:"28px",minHeight:"28px",fontWeight:500,fontSize:"13px",lineHeight:"20px",boxShadow:"none",display:"flex",alignItems:"center",gap:"6px",overflow:"hidden",flexShrink:0},children:[e.jsx(ro,{sx:{fontSize:"15px",color:"#6C7689"}}),e.jsx(h,{sx:{fontWeight:500,fontSize:"13px",lineHeight:"20px",color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:n})]});var nt={},Jr=xe;Object.defineProperty(nt,"__esModule",{value:!0});var ao=nt.default=void 0,ei=Jr(ce()),ti=e,oi=(0,ei.default)((0,ti.jsx)("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3
1-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92c0-1.61-1.31-2.92-2.92-2.92zM18 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 13c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm12 7.02c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}),"ShareOutlined");ao=nt.default=oi;const ri=({onClick:n})=>e.jsxs(H,{onClick:n,sx:{backgroundColor:"#FFFFFF",border:"1px solid #0E8A75",color:"#0E8A75","&:hover":{backgroundColor:"#E9F6F3",color:"#0E8A75",border:"1px solid #0E8A75"},textTransform:"none",borderRadius:"6px",px:"8px",py:"4px",height:"28px",minHeight:"28px",fontWeight:500,fontSize:"13px",lineHeight:"20px",boxShadow:"none",display:"flex",alignItems:"center",gap:"6px",overflow:"hidden",flexShrink:0},children:[e.jsx(ao,{sx:{fontSize:"15px",color:"#0E8A75"}}),e.jsx(h,{sx:{fontWeight:500,fontSize:"13px",lineHeight:"20px",color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:"Board Sharing"})]}),ii=()=>{const[n,r]=a.useState(!1);return{openShareBoardModal:n,setOpenShareBoardModal:r,BoardVisibilityUserList:(l,C)=>C==null?void 0:C.filter(m=>{var F;return((F=m==null?void 0:m.amazonAccounts)==null?void 0:F.some(x=>(x==null?void 0:x.amazonAccountId)===l))&&((m==null?void 0:m.workspaceRole)==="WhiteLabel Client"||(m==null?void 0:m.workspaceRole)==="Client")})}};var st={},ni=xe;Object.defineProperty(st,"__esModule",{value:!0});var lo=st.default=void 0,si=ni(ce()),ai=e,li=(0,si.default)((0,ai.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"LaunchOutlined");lo=st.default=li;function di({open:n,onClose:r,selectedWorkspace:g,selectedAmazonAccount:l,hasWhiteLabelFeatureAccess:C}){console.log("Selected AmazonAccount:::::",l),console.log("selected workspace",g);const u=()=>{const F=`wid=${g==null?void 0:g._id}&aid=${l==null?void 0:l._id}`,x=`${window.location.origin}/profile/whitelabel?${F}`;r(),window.open(x,"_blank","noopener,noreferrer")},m=()=>{const F=`wid=${g==null?void 0:g._id}&aid=${l==null?void 0:l._id}`,x=`${window.location.origin}/profile/workspace?${F}`;r(),window.open(x,"_blank","noopener,noreferrer")};return e.jsxs(Ae,{open:n,onClose:r,maxWidth:"md",PaperProps:{sx:{borderRadius:2,height:"324px",width:"546px",display:"flex",flexDirection:"column"}},children:[e.jsxs(et,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:.5},children:[e.jsx(h,{fontWeight:600,fontSize:15,children:"Board Sharing"}),e.jsx(V,{onClick:r,size:"small",children:e.jsx(tt,{})})]}),e.jsx(oe,{}),e.jsx(_e,{sx:{py:1,px:2,flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:C?e.jsxs(e.Fragment,{children:[e.jsxs(ae,{spacing:2,alignItems:"center",sx:{flex:1,justifyContent:"center",px:1},children:[e.jsx(s,{sx:{width:52,height:52,borderRadius:"50%",bgcolor:"#E8F5F2",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Mr,{sx:{color:"#0F766E"}})}),e.jsx(h,{fontSize:17,fontWeight:700,textAlign:"center",children:"Add White Label Clients to share board"}),e.jsx(h,{color:"text.secondary",textAlign:"center",fontSize:15,children:"You haven't added any white-label clients yet. Add one to start sharing Smart Boards with them"}),e.jsx(H,{variant:"contained",startIcon:e.jsx(lo,{}),onClick:m,sx:{textTransform:"none",bgcolor:"#0F766E",px:3,py:1.2,borderRadius:2,"&:hover":{bgcolor:"#0B5E57"}},children:"Add white label client"})]}),e.jsx(oe,{sx:{my:2}}),e.jsxs(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e.jsx(Xe,{fontSize:"inherit"}),e.jsx(h,{variant:"body2",color:"text.secondary",children:"To share boards in your own branding, configure your"}),e.jsx(rt,{component:"button",underline:"always",onClick:u,sx:{fontWeight:600,color:"#0F766E"},children:"white label set up."})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ae,{spacing:2,alignItems:"center",sx:{flex:1,justifyContent:"center",px:1},children:[e.jsx(s,{sx:{width:52,height:52,borderRadius:"50%",bgcolor:"#E8F5F2",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ur,{sx:{color:"#0F766E"}})}),e.jsx(h,{fontSize:17,fontWeight:700,textAlign:"center",children:"No white label clients added to share boards!"}),e.jsx(h,{color:"text.secondary",textAlign:"center",fontSize:15,children:"Boards are shared with your white label clients. No white label clients added yet. Owner or Admin has access to add them."})]}),e.jsx(oe,{sx:{my:1}}),e.jsxs(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e.jsx(Xe,{fontSize:"inherit"}),e.jsx(h,{variant:"body2",color:"text.secondary",children:"Only an Owner or Admin can add white label clients."})]})]})})]})}var at={},ci=xe;
1Object.defineProperty(at,"__esModule",{value:!0});var lt=at.default=void 0,xi=ci(ce()),qt=e,pi=(0,xi.default)([(0,qt.jsx)("path",{d:"m12 5.5 6 4.5v1c.7 0 1.37.1 2 .29V9l-8-6-8 6v12h7.68c-.3-.62-.5-1.29-.6-2H6v-9l6-4.5z"},"0"),(0,qt.jsx)("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm3 5.5h-2.5V21h-1v-2.5H15v-1h2.5V15h1v2.5H21v1z"},"1")],"AddHomeOutlined");lt=at.default=pi;var dt={},hi=xe;Object.defineProperty(dt,"__esModule",{value:!0});var ct=dt.default=void 0,ui=hi(ce()),fi=e,mi=(0,ui.default)((0,fi.jsx)("path",{d:"M12 6.5c3.79 0 7.17 2.13 8.82 5.5-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12C4.83 8.63 8.21 6.5 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5c1.38 0 2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5-2.5-1.12-2.5-2.5 1.12-2.5 2.5-2.5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"}),"RemoveRedEyeOutlined");ct=dt.default=mi;const gi=n=>{const{dashboard:r,url:g,isClient:l,isViewOnlyAccess:C,canShareBoard:u,canManageBoard:m,primaryColor:F,dynamicColors:x,goToDashboards:d,onClientShareAbleStatusChange:b,onBoardStateChange:y,boardStateLoadingId:_,onScheduleReportChange:w,onManageBoardAction:R,isMaxBoardsReached:B,manageBoardLoadingId:$,handleActionMenuOpen:S,setDashboardIdToSchedule:p,setOpenScheduler:v,setScheduler:U}=n,G=Jt(),I=F??G.palette.primary.main??"#036A58",K=(r==null?void 0:r._id)??(r==null?void 0:r.id),T=!!$&&$===K,Y=!!(r!=null&&r.isBoardSelected),W=!B&&!Y,re=!1,E={background:"#1F1F1F"},j=so(r==null?void 0:r.scheduler),[pe,q]=(j==null?void 0:j.split(" • "))??[];return e.jsxs(Ko,{sx:{boxShadow:"none",height:"100%",display:"flex",flexDirection:"column",gap:"12px",p:"12px",borderRadius:"10px",border:"1px solid #E3E7ED",bgcolor:"#FFFFFF",position:"relative",overflow:"hidden",transition:"all 0.3s ease",opacity:1,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.1)",transform:"translateY(-2px)"}},children:[e.jsxs(s,{sx:{flexGrow:C?0:1,display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[e.jsxs(s,{sx:{display:"flex",flexDirection:"column",gap:"10px",minWidth:0},children:[e.jsxs(s,{sx:{position:"relative",width:"100%",display:"flex",alignItems:"center",minWidth:0},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:"6px",minWidth:0,pr:r.isAiGenerated?"28px":0},children:[e.jsx(h,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"13px",fontWeight:500,lineHeight:"20px",cursor:"pointer",color:C?I:"#036A58","&:hover":{color:G.palette.primary.dark??I}},onClick:()=>d(r.id),noWrap:!0,title:r.name,children:r.name||"N/A"}),e.jsx(Ze,{title:"Open in new tab",children:e.jsx(V,{size:"small",onClick:c=>{c.stopPropagation(),window.open(g,"_blank")},sx:{width:"22px",height:"22px",p:"4px",flexShrink:0,backgroundColor:"transparent",color:I,"&:hover":{backgroundColor:Qo(I,.08)}},children:e.jsx(oo,{sx:{fontSize:13}})})})]}),r.isAiGenerated&&e.jsx(s,{sx:{position:"absolute",top:"-12px",right:"-12px",width:"45px",height:"45px",pointerEvents:"none"},children:e.jsx(s,{component:"img",src:"https://res.cloudinary.com/dt4ivydms/image/upload/v1774014200/Ribbon_
1nbomvv.svg",alt:"AI",sx:{width:45,height:45}})})]}),e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",gap:"12px",fontSize:"11px",fontWeight:500},children:[e.jsxs(s,{sx:{width:"122px",display:"flex",flexDirection:"column",gap:"3px"},children:[e.jsx(h,{sx:{fontSize:"11px",color:"#969FB0",lineHeight:1.5,fontWeight:500},children:"Last Modified"}),e.jsx(h,{sx:{fontSize:"11px",color:"#4D576A",lineHeight:"normal",fontWeight:500},children:r.updatedAt?Be(r.updatedAt).format("MMMM Do, YYYY"):"N/A"})]}),e.jsxs(s,{sx:{width:"122px",display:"flex",flexDirection:"column",gap:"3px"},children:[e.jsx(h,{sx:{fontSize:"11px",color:"#969FB0",lineHeight:1.5,fontWeight:500},children:"Created On"}),e.jsx(h,{sx:{fontSize:"11px",color:"#4D576A",lineHeight:"normal",fontWeight:500},children:Be(r.createdAt).format("MMMM Do, YYYY")})]})]})]}),re,u&&e.jsxs(s,{display:"flex",alignItems:"center",gap:"6px",children:[e.jsx(h,{sx:{fontSize:"11px",color:"#4D576A",lineHeight:"normal",fontWeight:500,whiteSpace:"nowrap"},children:"Shared with Client"}),e.jsx(s,{role:"switch","aria-checked":r.clientShareAble,tabIndex:0,onClick:c=>{c.stopPropagation(),b(r._id,!r.clientShareAble)},onKeyDown:c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),c.stopPropagation(),b(r._id,!r.clientShareAble))},sx:{width:"28px",height:"14px",borderRadius:"7px",border:"1px solid #CED3DE",backgroundColor:r.clientShareAble?x.tableMainCell:"#E3E7ED",display:"flex",alignItems:"center",justifyContent:r.clientShareAble?"flex-end":"flex-start",px:"1px",flexShrink:0,cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.15s ease, border-color 0.15s ease"},children:e.jsx(s,{sx:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#fff",boxShadow:"0px 1px 2px rgba(0,0,0,0.18)"}})})]})]}),e.jsx(s,{sx:{width:"100%",borderBottom:"1px dashed #CED3DE"}}),e.jsx(Xo,{sx:{p:0,minHeight:0,display:"block"},children:e.jsx(s,{sx:{display:"flex",alignItems:"flex-start",gap:C?0:"8px",width:"100%"},children:C?e.jsxs(s,{role:"button",tabIndex:0,onClick:c=>{c.stopPropagation(),d(r.id)},onKeyDown:c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),c.stopPropagation(),d(r.id))},sx:{flex:"1 0 0",height:"28px",border:"1px solid #CED3DE",borderRadius:"6px",display:"flex",alignItems:"center",justifyContent:"center",px:"8px",py:"4px",gap:"8px",cursor:"pointer",backgroundColor:"#fff",transition:"background-color 0.2s ease, border-color 0.2s ease","&:hover":{backgroundColor:"#F8F9FC"}},children:[e.jsx(ct,{sx:{fontSize:15,color:"#6C7689",flexShrink:0}}),e.jsx(h,{sx:{fontSize:"13px",fontWeight:500,lineHeight:"20px",color:"#30394B",whiteSpace:"nowrap"},children:"View"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(s,{sx:{flex:"1 0 0",minHeight:"28px",height:"28px",border:"1px solid #CED3DE",borderRadius:"6px",display:"flex",alignItems:"center",justifyContent:"space-between",px:"8px",py:"4px",backgroundColor:"#fff",overflow:"hidden",cursor:r!=null&&r.scheduler?"default":"pointer",transition:"background-color 0.2s ease, border-color 0.2s ease","&:hover":{backgroundColor:"#F8F9FC",borderColor:"#CED3DE"}},onClick:c=>{c.stopPropagation(),r!=null&&r.scheduler||w({dashboardId:r._id,hasScheduler:!1,status:"active"})},onKeyDown:c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),c.stopPropagation(),r!=null&&r.scheduler||w({dashboardId:r._id,hasScheduler:!1,status:"active"}))},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(s,{role:"switch","aria-checked":r.scheduleReport==="active",tabIndex:0,sx:{width:"28px",height:"14px",borderRadius:"7px",border:"1px solid #CED3DE",backgroundColor:r.scheduleReport==="active"?x.tableMainCell:"#E3E7ED",display:"flex",alignItems:"center",justifyContent:r.scheduleReport==="active"?"flex-end":"flex-start",px:"1px",flexShrink:0,cursor:"pointer"},onClick:c=>{c.preventDefault(),c.stopPropagation();const ie=!!r.scheduler,ne=r.scheduleReport==="active"?"inactive":"active";w({dashboardId:r._id,hasScheduler:ie,status:ne})},onKeyDown:c=>{if(c.key!=="Enter"&&c.key!==" ")return;c.preventDefault(),c.stopPropagation();const ie=!!r.scheduler,ne=r.scheduleReport==="active"?"inactive":"active";w({dashboardId:r._id,hasScheduler:ie,status:ne})},children:e.jsx(s,{sx:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#fff",boxShadow:"0px 1px 2px rgba(0,0,0,0.18)"}})}),e.jsx(h,{sx:{fontSize:"13px",fontWeight:500,lineHeight:"20px",color:"#30394B",whiteSpace:"nowrap"},children:"Schedule Report"})]}),r.scheduler&&e.jsx(Ze,{arrow:!0,placement:"top",enterTouchDelay:0,leaveTouchDelay:3e3,title:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:"3px"},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:[e.jsx(s,{sx:{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Wr,{sx:{fontSize:8,color:"#FFFFFF",display:"block"}})}),e.jsx(h,{sx:{fontSize:"9px",fontWeight:500,lineHeight:"normal",whiteSpace:"nowrap"},children:pe??"Weekly"})]}),e.jsx(s,{sx:{width:"3px",height:"3px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx($r,{sx:{fontSize:3,color:"#FFFFFF",display:"block"}})}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:[e.jsx(s,{sx:{width:"8px",height:"8px",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Lr,{sx:{fontSize:8,color:"#FFFFFF",display:"block"}})}),e.jsx(h,{sx:{fontSize:"9px",fontWeight:500,lineHeight:"normal",whiteSpace:"nowrap"},children:q??""})]})]}),PopperProps:{sx:{"& .MuiTooltip-tooltip":{bgcolor:E.background,color:"#FFFFFF",boxShadow:"none",padding:"2.561px 5.854px",borderRadius:"4.39px"},"& .MuiTooltip-arrow":{color:E.background}}},children:e.jsx(Or,{sx:{fontSize:15,color:"#6C7689",flexShrink:0,cursor:"pointer","&:hover":{color:x.iconColor}},onClick:c=>{c.stopPropagation(),p(r._id),v(!0),U(r.scheduler??null)}})})]}),m&&(Y?e.jsx(V,{size:"small",onClick:c=>{c.stopPropagation(),!W&&R(r)},disabled:W,sx:{width:"28px",height:"28px",borderRadius:"6px",border:"1px solid #B6E4CB",color:"#1DA056",backgroundColor:"#DBF2E7",p:"7px",flexShrink:0,"&:hover":{backgroundColor:"#DBF2E7",borderColor:"#B6E4CB"}},children:T?e.jsx(de,{size:13,sx:{color:"#1DA056"}}):e.jsx(io,{sx:{fontSize:15}})}):e.jsx(le,{children:e.jsx(V,{size:"small",onClick:c=>{c.stopPropagation(),!W&&R(r)},disabled:W,sx:{width:"28px",height:"28px",borderRadius:"6px",border:"1px solid #E3E7ED",color:"#6C7689",backgroundColor:"#fff",p:"7px",flexShrink:0,cursor:W?"not-allowed":"pointer","&:hover":{backgroundColor:W?"#fff":"#F8F9FC"}},children:T?e.jsx(de,{size:13,sx:{color:"#6C7689"}}):e.jsx(lt,{sx:{fontSize:15}})})})),!l&&e.jsx(V,{size:"small",onClick:c=>
1{c.stopPropagation(),S(c,r._id)},sx:{width:"28px",height:"28px",borderRadius:"6px",border:"1px solid #E3E7ED",color:"#6C7689",backgroundColor:"#fff",p:"7px",flexShrink:0},children:e.jsx(Rr,{sx:{fontSize:15}})})]})})})]})},bi=({availableBoards:n,tempSelectedSharedBoardIDs:r,setTempSelectedSharedBoardIDs:g,onShareBoards:l,initialSelectedBoardIDs:C})=>{const u=(x,d)=>{if(x.length!==d.length)return!1;const b=[...x].sort(),y=[...d].sort();return b.every((_,w)=>_===y[w])},m=a.useMemo(()=>!u(r,C),[r,C]),F=x=>{g(d=>d.includes(x)?d.filter(b=>b!==x):[...d,x])};return e.jsxs(s,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[e.jsx(s,{sx:{display:"flex"},children:e.jsx(h,{sx:{fontWeight:600,fontSize:"13px",color:"#212A3B",mb:1.5,letterSpacing:"0.5px"},children:"Select Boards to share"})}),e.jsx(s,{sx:{flex:1,overflowY:"auto",pt:0,pr:1},children:n.length>0&&e.jsx(eo,{sx:{p:0},children:n.map(x=>{const d=r.includes(x.id),b=()=>F(x.id||"");return e.jsx(to,{disablePadding:!0,sx:{mb:1,backgroundColor:d?"#E9F6F3":"#FFFFFF",border:d?"1px solid #83CEBF":"1px solid  #E3E7ED",borderRadius:"8px"},children:e.jsxs(s,{onClick:()=>{b()},sx:{display:"flex",px:1,borderRadius:"8px",gap:0,alignItems:"center",height:"30px",width:"100%"},children:[e.jsx(s,{onClick:y=>{y.stopPropagation(),b()},sx:{width:"14px",height:"14px",borderRadius:"3px",border:d?"":"1px solid var(--Cool-Gray-40, #CED3DE)",background:d?"#036A58":"var(--Base-White, #FFF)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",opacity:1,mr:1,"&:hover":{borderColor:"var(--Cool-Gray-40, #CED3DE)"}},children:d&&e.jsx(Pr,{width:10,height:10})}),e.jsx(Zo,{primary:e.jsx(h,{variant:"body2",sx:{fontWeight:500,color:d?"#212A3B":"#30394B",fontSize:"13px",lineHeight:"20px"},children:x.name}),sx:{"& .MuiListItemText-primary":{marginBottom:"2px"}}})]})},x.id)})})}),e.jsxs(s,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",mt:1,pr:1},children:[e.jsxs(ot,{severity:"info",sx:{backgroundColor:"white",m:0,p:0},children:["Shared with all white label clients"," "]}),e.jsx(H,{variant:"contained",onClick:()=>l(r),size:"small",disabled:!m,children:"Save"})]})]})},ji=()=>{const g=Math.floor(Math.random()*64),l=Math.floor(Math.random()*64);return`#${g.toString(16).padStart(2,"0")}${Math.floor(Math.random()*48+80).toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}`},Si=({userList:n,handleWorkSpaceNavigation:r})=>e.jsxs(s,{sx:{display:"flex",flexDirection:"column",p:2,height:"100%",gap:"10px"},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(h,{sx:{fontWeight:600,fontSize:"13px",color:"#2f353f",letterSpacing:"0.5px"},children:"Who can view"}),e.jsxs(rt,{component:"button",underline:"none",onClick:r,sx:{fontSize:"13px",verticalAlign:"baseline",cursor:"pointer",p:0,border:"none",background:"none",display:"inline-flex",alignItems:"center",gap:.5,textDecoration:"none","&:hover":{textDecoration:"none"}},children:[e.jsx(gr,{sx:{fontSize:"inherit"}}),"Manage access"]})]}),e.jsx(ot,{severity:"info",sx:{mb:2,flexShrink:0,borderRadius:"8px",backgroundColor:"#EBF2FF",border:"1px solid #C2D8FE"},children:"Owners, admins and managers already see every board as they're part of your workspace. ."}),e.jsx(h,{sx:{fontWeight:600,fontSize:"13px",color:"#6C7689",mb:1.5,textTransform:"uppercase"},children:"White-label clients"}),e.jsx(s,{sx:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column"},children:n.length>0&&e.jsx(eo,{sx:{p:0,m:0,display:"flex",flexDirection:"column",gap:2},children:n.map(g=>e.jsxs(to,{sx:{display:"flex",width:"100%",justifyContent:"space-between",gap:1,p:0},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1.25,minWidth:0,width:"100%"},children:[e.jsx(xr,{alt:"profile-image",sx:{bgcolor:g.profileImage?"transparent":ji(),width:"24px",height:"24px",flexShrink:0}}),e.jsxs(s,{sx:{minWidth:0},children:[e.jsx(h,{sx:{fontFamily:"Inter, sans-serif",fontWeight:600,fontSize:"12px",lineHeight:"15px",color:"#212A3B",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.name}),e.jsx(h,{sx:{fontFamily:"Inter, sans-serif",fontWeight:400,fontSize:"12px",lineHeight:"15px",color:"#6C7689",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.email})]})]}),e.jsx(h,{sx:{flexShrink:0,textAlign:"right",fontFamily:"Inter, sans-serif",fontWeight:500,fontSize:"12px",color:"#30394B"},children:g.workspaceRole})]},g._id??g.id))})})]}),yi=({open:n,onClose:r,availableBoards:g,selectedSharedBoardIDs:l,userList:C,onShareBoards:u,hasWhiteLabelFeatureAccess:m})=>{var B,$,S;
1const[F,x]=a.useState([...l]);ke.useEffect(()=>{n&&x([...l])},[n,l]);const{selectedWorkspace:d,selectedAmazonAccount:b}=te(Ee),y=d==null?void 0:d.whiteLabel,_=!!((B=y==null?void 0:y.companyName)!=null&&B.trim()||($=y==null?void 0:y.logoUrl)!=null&&$.trim()||(S=y==null?void 0:y.primaryColor)!=null&&S.trim()),w=()=>{const p=`wid=${d==null?void 0:d._id}&aid=${b==null?void 0:b._id}`,v=`${window.location.origin}/profile/workspace?${p}`;r(),window.open(v,"_blank","noopener,noreferrer")},R=()=>{const p=`wid=${d==null?void 0:d._id}&aid=${b==null?void 0:b._id}`,v=`${window.location.origin}/profile/workspace?${p}`;window.open(v,"_blank","noopener,noreferrer")};return e.jsxs(Ae,{open:n,onClose:r,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{borderRadius:"8px",maxHeight:"90vh",color:"rgb(24, 24, 24)"}},children:[e.jsxs(et,{sx:{...Jo.DIALOG_TITLE,backgroundColor:"#FFFFFF",borderBottomColor:"#D4D5D5",padding:"9px 16px"},children:[e.jsx(h,{sx:{fontWeight:600,fontSize:"16px",lineHeight:"24px",color:"#111827",mb:.5},children:"Board Sharing"}),e.jsx(V,{onClick:r,size:"small",sx:{color:"#6B7280"},children:e.jsx(tt,{fontSize:"small"})})]}),e.jsxs(_e,{sx:{p:0,display:"flex",flexDirection:"column",height:"calc(90vh - 120px)",overflow:"hidden",padding:"2",gap:2},children:[!_&&m?e.jsxs(ot,{icon:e.jsx(Tr,{fontSize:"inherit"}),severity:"info",sx:{borderRadius:"8px",mt:"16px",backgroundColor:"#EBF2FF",border:"1px solid #C2D8FE"},children:["Boards appear under your branding once you complete your"," ",e.jsx(rt,{component:"button",variant:"body2",onClick:w,sx:{fontWeight:600,verticalAlign:"baseline",textDecoration:"underline",cursor:"pointer",p:0,border:"none",background:"none"},children:"white label set up"}),"."," "]}):e.jsx(e.Fragment,{}),e.jsxs(s,{sx:{p:0,display:"flex",flexDirection:"row",overflow:"hidden",alignItems:"center"},children:[e.jsx(s,{sx:{flex:1,minWidth:0,height:"100%"},children:e.jsx(bi,{availableBoards:g,tempSelectedSharedBoardIDs:F,setTempSelectedSharedBoardIDs:x,onShareBoards:u,initialSelectedBoardIDs:l||[]})}),e.jsx(s,{sx:{flex:1,minWidth:0,height:"100%",m:1,backgroundColor:"#FAFAFA",borderRadius:"12px",border:"1px solid #E3E7ED",boxShadow:"0px 1px 3px rgba(0, 0, 0, 0.05)"},children:e.jsx(Si,{userList:C,handleWorkSpaceNavigation:R})})]})]})]})},De=!1,An=()=>{var zt,Mt,Rt,Wt,Lt,$t,Ot;const n=er(),r=tr(),[g]=Je(),l=g.get("aid"),C=g.get("wid"),u=Kt(),{isViewOnlyAccess:m,canManageBoard:F,canShareBoard:x,canUpdateWhiteLabelSettings:d,isDemoMode:b}=Qr(),[y,_]=a.useState(null),[w,R]=a.useState(null),[B,$]=a.useState(""),S=Xt(),p=te(Ee),v=te(or),U=te(rr),G=Jt(),{primaryColor:I}=ir(),K=(zt=p==null?void 0:p.workspaceUsers)==null?void 0:zt.users,T=((Mt=p==null?void 0:p.selectedWorkspace)==null?void 0:Mt.workspaceRole)===Qt.WhiteLabelClient,Y=dr.TABLE_MAIN_CELL,W=a.useMemo(()=>T&&I?{tableMainCell:I,iconColor:I}:{tableMainCell:Y,iconColor:G.palette.primary.main||Y},[T,I,G.palette.primary.main]),re=(p==null?void 0:p.authenticated)??!1,E=p==null?void 0:p.selectedAmazonAccount,j=((Rt=p==null?void 0:p.selectedWorkspace)==null?void 0:Rt.workspaceName)??"",pe=p==null?void 0:p.selectedWorkspace,q=((Wt=p==null?void 0:p.user)==null?void 0:Wt.name)??"",c=((Lt=v==null?void 0:v.utm)==null?void 0:Lt.utm_campaign)??"",ie=(($t=v==null?void 0:v.utm)==null?void 0:$t.utm_medium)??"",ne=((Ot=v==null?void 0:v.utm)==null?void 0:Ot.utm_source)??"",co=()=>{r("/connect")},{createDashboard:xo,cloneDashboard:po,goToDashboards:O}=Dr(),{allBoards:ho,createdManageBoardId:he,orderedBoards:uo,isBoardSelected:fo,toggleBoardSelection:mo,removeBoard:go,handleDragEnd:bo,handleSave:xt,handleUpdate:ze,canSelectMore:jo,selectedCount:So,createUpdateLoading:pt,openAddManageBoardModal:ht,maxBoards:Me,setOpenAddManageBoardModal:ut,handleManageBoardState:yo,manageBoardTabs:P}=Ar({}),[Re,ft]=a.useState(null),[N,Co]=a.useState([]),[mt,gt]=a.useState(!1),[Fo,bt]=a.useState(!1),[wo,ue]=a.useState(!1),{BoardVisibilityUserList:jt,openShareBoardModal:We,setOpenShareBoardModal:Q}=ii(),[vo,Do]=a.useState([]),Le=a.useMemo(()=>jt((E==null?void 0:E._id)??"",K??[]),[jt,E==null?void 0:E._id,K]),{templates:ko,loading:Io,refetch:Bo}=Nr({type:"smartboard",autoFetch:!1}),X=a.useMemo(()=>{var i;return((i=P.filter(t=>t.id!=="manage-board"))==null?void 0:i.length)!==Me},[P,Me]),$e=async i=>{const t=[{id:i._id,title:i.name,description:i.description,type:"smart",module:"",boardId:i._id,options:i.options}],o=P==null?void 0:P.filter(f=>f.id!=="manage-board");try{if(ft(i._id),!he){await xt({selectedBoards:t});return}if(o!=null&&o.some(f=>f.boardId===i._id)){const f=o==null?void 0:o.filter(D=>D.boardId!==i._id);await ze({boardId:he,selectedBoard:f})}else{const f=[...o,...t];await ze({boardId:he,selectedBoard:f})}}finally{ft(null)}},Eo=a.useCallback(i=>{if(!X&&!(i!=null&&i.isBoardSelected)){S(k({message:"You have reached the maximum limit of 7 boards.",severity:"warning",position:"bottom"}));return}$e(i)},[S,$e,X]),{dashboards:Ao,demoDashboards:_o,loadingDashboards:St}=U,fe=b?_o:Ao;a.useEffect(()=>{b||l&&n(Fe({amazonAccountId:l,isClient:u}))},[l,b]);const[me,yt]=a.useState(null),[L,Ct]=a.useState(null),[Ft,ge]=a.useState(!1),[zo,be]=a.useState(null),[Mo,Oe]=a.useState(null),[Ro,wt]=a.useState(!1),[Ne,vt]=a.useState(null),[je,He]=a.useState(""),Dt=(i,t)=>{yt(i.currentTarget),Ct(t)},z=()=>{yt(null),Ct(null)},kt=a.useCallback((i,t)=>{vt(i),He(t??""),wt(!0)},[]),Z=a.useCallback(()=>{wt(!1),vt(null),He("")},[]),It=a.useCallback(async()=>
1{if(!Ne)return;const i=je.trim();if(i)try{await n(Nt({_id:Ne,data:{name:i,amazonAccountId:l}})).unwrap(),S(k({message:"Board renamed successfully",position:"bottom",severity:"success"})),Z(),l&&n(Fe({amazonAccountId:l,isClient:u}))}catch(t){console.error("Failed to rename board:",t),S(k({message:"Failed to rename board",position:"bottom",severity:"error"}))}},[l,n,Z,S,u,Ne,je]),Te=a.useCallback(async({dashboardId:i,hasScheduler:t,status:o})=>{if(!t){be(i),ge(!0);return}try{gt(!0),await br.updateSchedulerStatus(i,o),S(k({message:"Scheduler status updated successfully",position:"bottom",severity:"success"})),l&&n(Fe({amazonAccountId:l,isClient:u}))}catch(f){console.error("Failed to set scheduler inactive:",f),S(k({message:"Failed to update scheduler",position:"bottom",severity:"error"}))}finally{gt(!1)}},[l,n,S,u]),Pe=a.useCallback((i,t)=>{if(Le.length===0){Q(!0);return}n(Nt({_id:i,data:{clientShareAble:t,amazonAccountId:l}})).unwrap().then(()=>{S(k({message:"Board updated successfully",position:"bottom",severity:"success"}))}).catch(f=>{console.error("Failed to update board:",f),S(k({message:"Failed to update board",position:"bottom",severity:"error"}))})},[l]),[Ve,Bt]=a.useState(null),Ge=a.useCallback(async(i,t)=>{var o;Bt(i);try{if(t){const f=(o=N.find(D=>D._id===i))==null?void 0:o.name;await Ht.activateDashboard(i,f)}else await Ht.deactivateDashboard(i);S(k({message:t?"Board activated successfully":"Board deactivated successfully",position:"bottom",severity:"success"})),n(nr({_id:i,state:t?"ACTIVE":"INACTIVE"}))}catch(f){sr(f)||(console.error("Failed to update board state:",f),S(k({message:t?"Failed to activate board":"Failed to deactivate board",position:"bottom",severity:"error"})))}finally{Bt(null)}},[n,S,N]),Wo=a.useCallback(i=>{l&&n(ar({amazonAccountId:l,selectedDashboardIDs:i})).unwrap().then(()=>{S(k({message:"Boards shared successfully",position:"bottom",severity:"success"}))}).catch(t=>{console.error("Failed to update board sharing:",t),S(k({message:"Failed to update board sharing",position:"bottom",severity:"error"}))})},[l,n,S,Q]),[Se,Lo]=a.useState(""),[Ye,Ue]=a.useState("table"),[A,qe]=a.useState("all");a.useEffect(()=>{const t=((fe==null?void 0:fe.filter(o=>{const f=o.name.toLowerCase().includes(Se.toLowerCase());return A==="ai"?f&&o.isAiGenerated:A==="manual"?f&&!o.isAiGenerated:f}))||[]).map(o=>{const f=P==null?void 0:P.some(Ce=>Ce.boardId===o._id),D=o==null?void 0:o.scheduler,J=so(D);return{id:o._id,_id:o._id,name:o.name||"N/A",state:(o==null?void 0:o.state)??"ACTIVE",createdAt:o.createdAt||"N/A",updatedAt:o.updatedAt,clientShareAble:(o==null?void 0:o.clientShareAble)??!1,description:(o==null?void 0:o.description)??"",options:(o==null?void 0:o.options)??{},isBoardSelected:f,scheduleReport:o==null?void 0:o.scheduler_status,scheduleDetails:J,scheduler:D,isAiGenerated:(o==null?void 0:o.isAiGenerated)??!1}});Co(t),Do(t.filter(o=>o.clientShareAble).map(o=>o.id))},[fe,Se,A,P]),a.useEffect(()=>{(b||m)&&Ue("grid")},[b,m]);const[Et,ye]=a.useState(!1),[At,Ke]=a.useState(null),[$o,_t]=a.useState(!1),Oo=async()=>{if(At){_t(!0);try{await n(cr({id:At,amazonAccountId:{amazonAccountId:l}})).unwrap(),ye(!1),Ke(null),S(k({message:"Board deleted successfully",position:"bottom",severity:"success"}))}catch(i){console.error("Failed to delete dashboard:",i),S(k({message:"Failed to delete board",position:"bottom",severity:"error"}))}finally{_t(!1)}}},No=a.useMemo(()=>{let i=[{field:"state",headerName:"Status",width:90,renderCell:t=>Ve===t.row._id?e.jsx(s,{sx:{width:"100%",py:1.5},display:"flex",alignItems:"center",justifyContent:"center",children:e.jsx(de,{size:20,thickness:5})}):e.jsx(s,{sx:{width:"100%",py:1.5},display:"flex",alignItems:"center",children:e.jsx(Qe,{checked:t.value==="ACTIVE",onChange:o=>{o.stopPropagation(),Ge(t.row._id,t.value!=="ACTIVE")},onClick:o=>o.stopPropagation(),color:"primary",size:"medium"})})},{field:"name",headerName:"Board Name",width:m?void 0:450,minWidth:m?250:void 0,flex:m?1:void 0,renderCell:t=>{const o=Ut(l,C,t.row.id);return e.jsxs(s,{display:"flex",alignItems:"center",overflow:"hidden",gap:1,children:[e.jsxs(h,{variant:"body2",sx:{cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",color:W.tableMainCell,fontWeight:600},onClick:()=>
1O(t.row.id),title:t.formattedValue,children:[e.jsx(oo,{onClick:f=>{f.stopPropagation(),window.open(o,"_blank")},sx:{cursor:"pointer",fontSize:"medium",mr:"8px",mb:"-3px",color:W.iconColor}}),t.formattedValue!=null&&t.formattedValue!==""?t.formattedValue:"N/A"]}),!u&&t.row.isAiGenerated&&e.jsx(s,{component:"img",src:"https://res.cloudinary.com/dt4ivydms/image/upload/v1774014197/Tableribon_afbmth.svg",alt:"AI",sx:{width:25,height:22,opacity:1}})]})}},{field:"createdAt",headerName:"Created On",width:200,renderCell:t=>{const o=t.value;return e.jsx(h,{variant:"body2",children:Be(o).format("MMMM Do, YYYY")})}},{field:"updatedAt",headerName:"Last Modified",width:200,renderCell:t=>{const o=t.value;return e.jsx(h,{variant:"body2",children:o?Be(o).format("MMMM Do, YYYY"):"N/A"})}},{field:"scheduleReport",headerName:"Schedule Report",width:140,renderCell:t=>{const o=De;return e.jsx(s,{sx:{width:"100%",py:1.5},display:"flex",alignItems:"center",children:e.jsx(Qe,{checked:t.value==="active",disabled:o,onChange:f=>{f.stopPropagation();const D=t.row.scheduler,J=t.value==="active"?"inactive":"active";Te({dashboardId:t.row._id,hasScheduler:D,status:J})},color:"primary",size:"medium",onClick:f=>f.stopPropagation()})})}},{field:"scheduleDetails",headerName:"Schedule Details",width:250,renderCell:t=>e.jsxs(s,{sx:{width:"100%"},display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsx(h,{variant:"body2",title:t.value??"—",sx:{overflow:"hidden",textOverflow:"ellipsis",color:void 0},children:t.value!=null&&t.value!==""?t.value:"—"}),t.row.scheduler&&t.row.state!=="INACTIVE"&&e.jsx(V,{size:"small",onClick:o=>{o.stopPropagation(),be(t.row._id),ge(!0),Oe(t.row.scheduler??null)},children:e.jsx(ro,{sx:{fontSize:16}})})]})},{field:"actions",type:"actions",headerName:"Actions",width:140,getActions:t=>{const o=t.row._id,f=De;if(m)return[e.jsx(Vt,{icon:e.jsx(ct,{sx:{fontSize:15,color:"#6C7689"}}),label:"View",onClick:()=>O(o),sx:{width:"24px",height:"24px",p:"2px 6px",borderRadius:"4px",border:"1px solid #E3E7ED",mr:0,"&:hover":{backgroundColor:"#F8F9FC"},cursor:"pointer"}},"view")];const D=t.row.isBoardSelected,J=Re===o,Ce=e.jsx(Vt,{icon:J?e.jsx(de,{size:13}):D?e.jsx(io,{sx:{width:"11px",height:"11px",color:"#1DA056"}}):e.jsx(lt,{sx:{width:"11px",height:"11px",color:"#6C7689"}}),label:D?"Remove from Board":"Add to Board",onClick:()=>{if(!X&&!D){S(k({message:"You have reached the maximum limit of 7 boards.",severity:"warning",position:"bottom"}));return}$e(t.row)},sx:{width:"24px",height:"24px",p:"2px 6px",borderRadius:"4px",border:"1px solid #E3E7ED",mr:0,...D&&{border:"1px solid #B6E4CB",backgroundColor:"#DBF2E7"},"&:hover":{backgroundColor:D?"#DBF2E7":"#F8F9FC"},cursor:!X&&!D?"not-allowed":"pointer",...J&&{display:"flex",alignItems:"center",justifyContent:"center"}}});return[D?e.jsx(ke.Fragment,{children:Ce},"manage-board"):e.jsx(le,{children:Ce},"manage-board"),e.jsxs(ke.Fragment,{children:[e.jsx(V,{onClick:se=>Dt(se,o),sx:{width:"24px",height:"24px",p:"2px 6px",borderRadius:"4px",border:"1px solid #E3E7ED"},children:e.jsx(wr,{sx:{width:"11px",height:"11px",color:"#6C7689"}})}),e.jsxs(Tt,{anchorEl:me,open:!!me&&L===o,onClose:z,children:[e.jsxs(M,{disabled:f,onClick:()=>{O(o),z()},children:[e.jsx(Ie,{fontSize:"small",sx:{mr:1}}),"View"]}),!u&&e.jsxs(s,{children:[e.jsxs(M,{disabled:f,onClick:()=>{O(o,"edit"),z()},children:[e.jsx(Gt,{fontSize:"small",sx:{mr:1}}),"Edit"]}),e.jsxs(M,{onClick:()=>{kt(o,t.row.name),z()},children:[e.jsx(Yt,{fontSize:"small",sx:{mr:1}}),"Rename"]}),e.jsxs(M,{onClick:()=>{const se={dashboardId:o,name:`${t.row.name} Clone`,description:t.row.description??""};_(se),z()},children:[e.jsx(we,{fontSize:"small",sx:{mr:1}}),"Duplicate to same Account"]}),e.jsxs(M,{onClick:()=>{const se={dashboardId:o,name:`${t.row.name} Clone`,description:t.row.description??"",advanceMode:!0};_(se),z()},children:[e.jsx(we,{fontSize:"small",sx:{mr:1}}),"Duplicate to other Accounts"]}),e.jsx(oe,{}),e.jsxs(M,{onClick:()=>{Ke(o),ye(!0),z()},children:[e.jsx(Pt,{fontSize:"small",sx:{mr:1}}),"Delete"]})]})]})]},"more-actions")]}}];if(i=i.filter(t=>t.field!=="state"),m&&(i=i.filter(t=>t.field!=="scheduleReport"&&t.field!=="scheduleDetails")),x){const t={field:"clientShareAble",headerName:"Shared with Client",width:140,renderCell:f=>e.jsx(s,{sx:{width:200,py:3},display:"flex",alignItems:"center",children:e.jsx(Qe,{checked:f.value,disabled:De,onCh
1ange:D=>Pe(f.row._id,D.target.checked),size:"medium"})})},o=i.length;i.splice(o-1,0,t)}return i},[pt,u,m,x,l,C,O,Pe,Te,Ge,Ve,Re,X,b]);return e.jsxs(ke.Fragment,{children:[e.jsx(ee,{container:!0,spacing:3,children:e.jsxs(ee,{item:!0,xs:12,mt:u?1:0,children:[u&&e.jsx(_r,{authenticated:re,selectedAmazonAccount:E,workspaceName:j,connectHandler:co,userName:q,utm_campaign:c,utm_medium:ie,utm_source:ne}),e.jsxs(fr,{sx:{padding:u?1:3,marginTop:u?2:0},children:[e.jsxs(s,{display:"flex",flexDirection:"column",children:[!u&&e.jsxs(s,{display:"flex",alignItems:"flex-start",justifyContent:"space-between",children:[e.jsx(mr,{title:"Your Smart Boards",subtitle:`The Smart Board feature allows users to ${u?"":"create, manage, and"} view tailored boards for monitoring and analyzing key metrics. Manage your boards here.`}),e.jsxs(s,{display:"flex",gap:1,alignItems:"center",justifyContent:"flex-end",children:[d&&e.jsx(Ze,{title:"Share each Smart Board dashboards as your own branding to your clients via unique link or adding them as white label client",arrow:!0,placement:"top",componentsProps:{tooltip:{sx:{bgcolor:"#1F1F1F",color:"#FFFFFF",fontSize:"12px",maxWidth:219,p:"3.5px 8px",borderRadius:"6px",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.12)",textAlign:"center"}},arrow:{sx:{color:"#1F1F1F"}}},children:e.jsx(H,{variant:"text",onClick:()=>{var i;return r(`/profile/whitelabel?wid=${(i=p==null?void 0:p.selectedWorkspace)==null?void 0:i._id}&aid=${E==null?void 0:E._id}`)},sx:{textTransform:"none",fontSize:"13px",fontWeight:500,px:1.5,py:"5px",flexShrink:0,color:"#036A58",backgroundColor:"#E9F6F3"},endIcon:e.jsx(Xe,{sx:{fontSize:"inherit"}}),children:"White Label Sharing Settings"})}),!u&&!b&&e.jsx(le,{children:e.jsx(H,{variant:"contained",disableElevation:!0,onClick:()=>{Bo(),ue(!0)},startIcon:e.jsx(pr,{sx:{fontSize:13,color:"#FFFFFF"}}),sx:{backgroundColor:"#036A58","&:hover":{backgroundColor:"#036A58"},textTransform:"none",borderRadius:"6px",height:"28px",minHeight:"28px",px:"8px",py:"4px",fontFamily:"Inter, sans-serif",fontSize:"13px",lineHeight:"20px",fontWeight:500,color:"#FFFFFF","& .MuiButton-startIcon":{marginRight:"6px",marginLeft:0}},children:"Create New"})})]})]}),e.jsxs(s,{display:"flex",justifyContent:"space-between",alignItems:"center",mt:3,mb:2,width:"100%",children:[e.jsx(s,{sx:{bgcolor:"#FCFCFC",border:"1px solid #E8E8E8",borderRadius:"6px",height:"28px",p:"3px",display:"flex",alignItems:"center"},children:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:"2px"},children:[e.jsx(s,{component:"button",type:"button",onClick:()=>qe("all"),sx:{border:"none",backgroundColor:A==="all"?"#FFFFFF":"transparent",borderRadius:A==="all"?"5px":"6px",boxShadow:A==="all"?"0px 0px 4px rgba(0,0,0,0.23)":"none",cursor:"pointer",px:"8px",py:"3px",fontFamily:"Inter, sans-serif",fontSize:"14px",fontWeight:500,color:A==="all"?"#1F1F1F":"#4D576A",whiteSpace:"nowrap"},children:"All"}),e.jsxs(s,{component:"button",type:"button",onClick:()=>qe("ai"),sx:{border:"none",backgroundColor:A==="ai"?"#FFFFFF":"transparent",borderRadius:A==="ai"?"5px":"6px",boxShadow:A==="ai"?"0px 0px 4px rgba(0,0,0,0.23)":"none",cursor:"pointer",px:"8px",py:"3px",display:"flex",alignItems:"center",gap:"4px",fontFamily:"Inter, sans-serif",fontSize:"14px",fontWeight:500,color:A==="ai"?"#1F1F1F":"#4D576A",whiteSpace:"nowrap"},children:[e.jsx(s,{sx:{width:"12px",height:"12px",transform:"rotate(-0.22deg)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Hr,{width:"12",height:"12",color:"#6C7689"})}),"AI Generated"]}),e.jsx(oe,{orientation:"vertical",flexItem:!0,sx:{m:.5}}),e.jsx(s,{component:"button",type:"button",onClick:()=>qe("manual"),sx:{border:"none",backgroundColor:A==="manual"?"#FFFFFF":"transparent",borderRadius:A==="manual"?"5px":"6px",boxShadow:A==="manual"?"0px 0px 4px rgba(0,0,0,0.23)":"none",cursor:"pointer",px:"8px",py:"3px",fontFamily:"Inter, sans-serif",fontSize:"14px",fontWeight:500,color:A==="manual"?"#1F1F1F":"#4D576A",whiteSpace:"nowrap"},children:"Manual"})]})}),e.jsxs(s,{display:"flex",alignItems:"center",gap:1,sx:{justifyContent:"flex-end"},children:[e.jsx(s,{sx:{width:"50px",height:"28px",bgcolor:"#F8F9FC",border:"1px solid #E3E7ED",borderRadius:"6px",p:"4px",display:"flex",alignItems:"center",justifyContent:"center",gap:"2.279px"},children:(()=>{const i=Ye==="grid";return e.jsxs(e.Fragment,{children:[e.jsx(s,{component:"button",type:"button",onClick:()=>Ue("grid"),"aria-pressed":i,sx:{border:"none",background:"transparent",curs
1or:"pointer",width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:i?"4px":"10.093px",backgroundColor:i?"#FFFFFF":"transparent",boxShadow:i?"0px 0.642px 1.927px rgba(16,24,40,0.1),0px 0.642px 1.285px rgba(16,24,40,0.06)":"none",padding:0},children:e.jsx(Ie,{sx:{fontSize:12,color:i?"#1F1F1F":"#4D576A"}})}),e.jsx(s,{component:"button",type:"button",onClick:()=>Ue("table"),"aria-pressed":!i,sx:{border:"none",background:"transparent",cursor:"pointer",width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:i?"10.093px":"4px",backgroundColor:i?"transparent":"#FFFFFF",boxShadow:i?"none":"0px 0.642px 1.927px rgba(16,24,40,0.1),0px 0.642px 1.285px rgba(16,24,40,0.06)",padding:0},children:e.jsx(vr,{sx:{fontSize:12,color:i?"#4D576A":"#1F1F1F"}})})]})})()}),e.jsxs(s,{sx:{width:"247px",height:"28px",bgcolor:"#FFFFFF",border:"1px solid #E3E7ED",borderRadius:"6px",boxShadow:"0px 1px 2px 0px rgba(24,16,40,0.05)",px:"8px",py:"4px",display:"flex",alignItems:"center",gap:"6px",overflow:"hidden"},children:[e.jsx(Vr,{sx:{fontSize:13,color:"#6C7689"}}),e.jsx(lr,{value:Se,onChange:i=>Lo(i.target.value),placeholder:"Search",sx:{flex:1,fontFamily:"Inter, sans-serif",fontSize:"13px",lineHeight:"20px",color:"#1F1F1F","& input":{padding:0},"& input::placeholder":{color:"#969FB0",opacity:1}}})]}),F&&e.jsx(Zr,{title:"Manage Board",onClick:()=>{yo(),ut(!0)}}),x&&e.jsx(ri,{onClick:()=>{Q(!0)}})]})]})]}),e.jsx(s,{sx:{flexGrow:1},children:Ye==="table"?e.jsx(hr,{rowHeight:40,dataGridSx:{border:"1px solid #E8E8E8"},sx:{height:"calc(100vh - 280px)"},showCellVerticalBorder:!0,showColumnVerticalBorder:!0,rows:N,columns:No,loading:St||mt,pageSizeOptions:[10,25,50],fullScreenEnabled:!1,isFullheight:!0,pinColumns:m?{left:[],right:[]}:{left:[],right:["actions"]}}):e.jsx(s,{sx:{p:2},children:St||mt?e.jsx(ee,{container:!0,spacing:3,children:[1,2,3,4].map(i=>e.jsx(ee,{item:!0,xs:12,sm:6,md:4,lg:3,children:e.jsx(Gr,{variant:"rectangular",height:200})},i))}):N.length===0?e.jsxs(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"calc(100vh - 280px)",color:"text.secondary"},children:[e.jsx(no,{sx:{fontSize:64,mb:2,opacity:.5}}),e.jsx(h,{variant:"h6",children:"No boards found"}),e.jsx(h,{variant:"body2",children:Se?"Try adjusting your search":A!=="all"?"Try changing the filter":"Create your first board to get started"})]}):e.jsx(ee,{container:!0,spacing:3,children:N.map(i=>{const t=Ut(l,C,i.id);return e.jsx(ee,{item:!0,xs:12,sm:6,md:4,lg:3,children:e.jsx(gi,{dashboard:i,url:t,isClient:u,isViewOnlyAccess:m,canShareBoard:x,canManageBoard:F,primaryColor:I,dynamicColors:W,goToDashboards:O,onClientShareAbleStatusChange:Pe,onBoardStateChange:Ge,boardStateLoadingId:Ve,onScheduleReportChange:Te,onManageBoardAction:Eo,isMaxBoardsReached:X,manageBoardLoadingId:Re,handleActionMenuOpen:Dt,setDashboardIdToSchedule:be,setOpenScheduler:ge,setScheduler:Oe})},i.id)})})})})]})]})}),Ye==="grid"&&e.jsx(Tt,{anchorEl:me,open:!!me,onClose:z,children:L&&(()=>{const i=De;return e.jsxs(e.Fragment,{children:[e.jsxs(M,{disabled:i,onClick:()=>{L&&!i&&O(L),z()},children:[e.jsx(Ie,{fontSize:"small",sx:{mr:1}}),"View"]}),!u&&e.jsxs(s,{children:[e.jsxs(M,{disabled:i,onClick:()=>{L&&!i&&O(L,"edit"),z()},children:[e.jsx(Gt,{fontSize:"small",sx:{mr:1}}),"Edit"]}),e.jsxs(M,{onClick:()=>{const t=N.find(o=>o._id===L);kt(L,(t==null?void 0:t.name)??""),z()},children:[e.jsx(Yt,{fontSize:"small",sx:{mr:1}}),"Rename"]}),e.jsxs(M,{onClick:()=>{const t=N.find(o=>o._id===L);if(t){const o={dashboardId:t._id,name:`${t.name} Clone`,description:t.description??""};_(o)}z()},children:[e.jsx(we,{fontSize:"small",sx:{mr:1}}),"Duplicate to same Account"]}),e.jsxs(M,{onClick:()=>{const t=N.find(o=>o._id===L);if(t){const o={dashboardId:t._id,name:`${t.name} Clone`,description:t.description??"",advanceMode:!0};_(o)}z()},children:[e.jsx(we,{fontSize:"small",sx:{mr:1}}),"Duplicate to other Accounts"]}),e.jsxs(M,{onClick:()=>{const t=N.find(o=>o._id===L);t&&(R(t._id),$(t.name??"")),z()},children:[e.jsx(jr,{fontSize:"small",sx:{mr:1}}),"Share link…"]}),e.jsx(oe,{}),e.jsxs(M,{onClick:()=>{L&&(Ke(L),ye(!0)),z()},children:[e.jsx(Pt,{fontSize:"small",sx:{mr:1}}),"Delete"]})]})]})})()}),y&&e.jsx(Xr,{dashboardToClone:y,setDashboardToClone:_,cloneDashboard:po,goToDashboards:O}),e.jsx(Sr,{open:w!==null,onClose:()=>{R(null),$("")},dashboardId:w,dashboardName:B}),!u&&e.jsxs(e.Fragment,{children:[e.jsx(yr,{createDashboard:xo,goToDashboards:O,isCreateNewBtn:!1,openOverride:Fo,onClose:()=>bt(!1)}),e.jsx(Cr,{open:wo,onClose:()=>ue(!1),templates:ko,loading:Io,includeCreateFromScratchCard:!0,onTemplateSelect:i=>{if(i._id==="__create_from_scratch__"){ue(!1),bt(!0);return}
1const o=i.smartboard_id;if(!o){S(k({message:"Unable to open template. Smart Board reference is missing.",position:"bottom",severity:"error"}));return}ue(!1),r(`/smart-board/${o}?wid=${C}&aid=${l}&mode=template`)}})]}),Et&&e.jsx(Er,{open:Et,onClose:()=>ye(!1),onConfirm:Oo,title:"Delete Board",message:"Are you sure you want to delete this board?",cancelButtonText:"No",confirmButtonText:"Yes, Delete",loading:$o}),ht&&e.jsx(zr,{isOpenBoardBtn:!1,defaultBoardType:"smart",createUpdateLoading:pt,createdManageBoardId:he,open:ht,onClose:()=>ut(!1),onSave:xt,allBoards:ho,orderedBoards:uo,isBoardSelected:fo,toggleBoardSelection:mo,removeBoard:go,canSelectMore:jo,selectedCount:So,handleDragEnd:bo,onUpdate:ze,maxBoards:Me}),We&&(Le.length<=0?e.jsx(di,{open:We,onClose:()=>Q(!1),selectedWorkspace:pe,selectedAmazonAccount:E,hasWhiteLabelFeatureAccess:d}):e.jsx(yi,{open:We,onClose:()=>Q(!1),availableBoards:N,selectedSharedBoardIDs:vo,userList:Le,onShareBoards:i=>{Q(!1),Wo(i)},hasWhiteLabelFeatureAccess:d})),Ft&&e.jsx(Fr,{open:Ft,onClose:()=>{ge(!1),Oe(null),be(null)},onSave:()=>{l&&n(Fe({amazonAccountId:l,isClient:u}))},dashboardIdToSchedule:zo,scheduler:Mo}),e.jsxs(Ae,{open:Ro,onClose:Z,maxWidth:!1,PaperProps:{sx:{borderRadius:"12px",overflow:"hidden",width:"100%",maxWidth:400,m:2,bgcolor:"#FFFFFF"}},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:"16px",py:"9px",borderBottom:"1px solid #CED3DE",bgcolor:"#FFFFFF"},children:[e.jsx(h,{component:"h2",sx:{fontSize:15,fontWeight:600,lineHeight:"23px",color:"#141B2A"},children:"Rename Board"}),e.jsx(V,{onClick:Z,"aria-label":"Close rename dialog",size:"small",sx:{p:"2px",color:"#141B2A"},children:e.jsx(tt,{sx:{fontSize:20}})})]}),e.jsx(_e,{sx:{p:2,bgcolor:"#FFFFFF"},children:e.jsxs(ae,{sx:{gap:"6px",width:"100%"},children:[e.jsx(h,{sx:{fontSize:13,fontWeight:500,lineHeight:"20px",color:"#6C7689"},children:"Board Name"}),e.jsx(Zt,{autoFocus:!0,fullWidth:!0,variant:"outlined",hiddenLabel:!0,value:je,onChange:i=>He(i.target.value),onKeyDown:i=>{i.key==="Enter"&&It(),i.key==="Escape"&&Z()},sx:{"& .MuiOutlinedInput-root":{borderRadius:"6px",fontSize:13,fontWeight:500,color:"#4D576A",bgcolor:"#FFFFFF","& fieldset":{borderColor:"#CED3DE"},"&:hover fieldset":{borderColor:"#CED3DE"},"&.Mui-focused fieldset":{borderColor:I}},"& .MuiOutlinedInput-input":{py:"6px",px:"8px",lineHeight:"20px"}}})]})}),e.jsxs(s,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"10px",px:"16px",py:"9px",borderTop:"1px solid #CED3DE",bgcolor:"#FFFFFF"},children:[e.jsx(H,{onClick:Z,variant:"outlined",sx:{height:28,minHeight:28,px:"8px",py:"4px",borderRadius:"6px",fontSize:13,fontWeight:500,lineHeight:"20px",textTransform:"none",color:"#30394B",borderColor:"#CED3DE",bgcolor:"#FFFFFF",boxShadow:"none","&:hover":{borderColor:"#CED3DE",bgcolor:"#F8F9FB",boxShadow:"none"}},children:"Cancel"}),e.jsx(le,{children:e.jsx(H,{onClick:It,variant:"contained",disabled:!je.trim(),sx:{height:28,minHeight:28,px:"8px",py:"4px",borderRadius:"6px",fontSize:13,fontWeight:500,lineHeight:"20px",textTransform:"none",bgcolor:I,color:"#FFFFFF",boxShadow:"none","&:hover":{bgcolor:I,filter:"brightness(0.92)",boxShadow:"none"},"&.Mui-disabled":{bgcolor:"#CED3DE",color:"#FFFFFF"}},children:"Save"})})]})]})]})};export{An 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.