PageSourceSearch

https://worksmanager.com/assets/index-BWCfCWO8.js

js worksmanager.com collected 2026-10-06 18:05:43 UTC 163,222 bytes, 4 lines download raw bytes

1var wo=Object.defineProperty;var Do=(c,i,t)=>i in c?wo(c,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[i]=t;var ge=(c,i,t)=>Do(c,typeof i!="symbol"?i+"":i,t);import{o as ie,j as e,M as n,u as Jt,a as m,b as Us,P as u,cs as E,A as he,al as Ve,I as ue,J as de,dX as Fs,dD as Is,ao as xt,ep as Co,eq as Te,er as eo,dZ as st,es as to,aa as Kt,R as I,ee as ws,c5 as St,ai as Ps,aP as ot,am as we,cR as No,cw as ve,et as _o,eu as Ls,bb as yo,ak as jt,bc as Po,b7 as Fo,ah as Io,ev as Ro,ew as ko,v as H,T as Rs,K as Mo,e2 as Ao,ex as To,U as so,ey as Eo,ez as Oo,eA as Uo,eB as Lo,aL as Bo,aM as $o,cE as Vo,eC as zo,X as oo,aN as Ds,aO as le,S as ae,b4 as G,L as qt,bn as Wo,b5 as qo,eD as Yo,eE as Bs,eF as Ho,eG as ao,eH as $s,eI as Go,eJ as Jo,W as vt,cu as Cs,eK as Ko,$ as Yt,eL as Vs,cF as Xo,V as Zo,Z as Ns,af as Qo,Y as ea}from"./index-CdaOVUJg.js";import{I as ta}from"./index-ejFp7YXP.js";import{L as sa}from"./index-CPRHlIbJ.js";import{f as oa,P as ne,R as aa,j as ia}from"./filternull-D3zAe-C8.js";import{B as io,M as na,d as ca,F as ra,O as ks,R as la,f as zs,g as Ws,a as da,b as pa,c as ha}from"./index-0HvrsMjF.js";import{s as Xt,F as no,V as ua}from"./index-BSUwfD69.js";import{f as Ms}from"./file_grey-BsAYw91y.js";import{I as Zt,E as Qt,d as ma,A as fa,L as ga,h as va}from"./index-EYO2t0Jb.js";import{M as Ne,b as Sa}from"./index-CZpy4y5r.js";import{f as ja,a as xa,i as ba,I as wa}from"./accounts-ibss-active-oKmy30im.js";import{a as Da,S as Ca,M as Ht,g as Na,b as _a,A as ya}from"./AccountSidePanelNav-4PItUNrF.js";import{S as As}from"./Select-CfWleVIF.js";import{d as Pa}from"./devices_grey-ylVW82im.js";import{d as Fa}from"./index-B9FqzGVN.js";import"./Grid-DrIgwYQT.js";import"./Modal-Bgf7xN89.js";import"./Backdrop-HMZ0XVhc.js";import"./Menu-oeFW6mDt.js";import"./CircularProgress-CFj_9cGx.js";import"./index-DTZRcMg8.js";import"./accounts-trimble-logo-collapsed-D-p14eNR.js";import"./members_grey-BXarPCJm.js";import"./index-HIHDdnqB.js";import"./index-DEqqwH04.js";import"./removeduplicatesfromarray-Np0dLZSc.js";import"./index-BTMjU5lK.js";import"./index-d2LdyksW.js";import"./index-DMSmYjwi.js";import"./contributorHelpers-D8ZapESx.js";import"./iconUtils-DvY_Pyqo.js";import"./geospatialutils-tcULmRSo.js";import"./useQuery-_GVTcE5h.js";import"./index-BJav2OSZ.js";import"./accounts-projects-DVXdYzFO.js";const $=Object.freeze({COPY:"Copy",MOVE:"Move",DELETE:"Delete",DOWNLOAD:"Download",UPLOAD:"Upload",UPLOAD_FOLDER:"UploadFolder"}),Ia=Object.freeze(["Machine Control Data","Trimble SCS900 Data","Trimble GeoData","Archived","Archive","Trimble Siteworks Diagnostic Data"]),Ra=c=>c.isFolder&&Ia.some(i=>i.toLowerCase()===(c.entryName||"").toLowerCase()),Ee=Object.freeze({[$.COPY]:"common.copy",[$.MOVE]:"common.move",[$.DELETE]:"common.delete",[$.DOWNLOAD]:"common.download",[$.UPLOAD]:"common.upload"}),Gt=Object.freeze({[$.COPY]:"connectedsite.copyprogresswithcount",[$.MOVE]:"connectedsite.moveprogresswithcount",[$.DELETE]:"connectedsite.deleteprogresswithcount",[$.DOWNLOAD]:"connectedsite.downloadprogresswithcount",[$.UPLOAD]:"connectedsite.uploadprogresswithcount"}),Pe=Object.freeze({[$.MOVE]:"MOVE_IN_PROGRESS",[$.COPY]:"COPY_IN_PROGRESS",[$.DELETE]:"DELETE_IN_PROGRESS",[$.DOWNLOAD]:"DOWNLOAD_IN_PROGRESS",[$.UPLOAD]:"UPLOAD_IN_PROGRESS",[$.UPLOAD_FOLDER]:"UPLOAD_FOLDER_IN_PROGRESS"});function co(c){const i=c.filter(o=>!o.isFolder).length,t=c.filter(o=>o.isFolder).length;let s="filesOnly";return i>0&&t>0?s="both":t>0&&(s="foldersOnly"),{fileCount:i,folderCount:t,deleteType:s}}const ka=({path:c,onPathClick:i,maxLevel:t})=>{let s=c.split("/"),o=[];for(let a=0;a<s.length;a++)o[a]=s.slice(0,a+1).join("/");if(t&&s.length>t+1){const a=s.slice(0,2);a.push("...");const r=s.slice(-(t-1)),l=o.slice(0,2);l.push("...");const h=o.slice(-(t-1));
1s=a.concat(r),o=l.concat(h)}return e.jsx("div",{className:"path-link",children:s.map((a,r)=>r>0?e.jsxs("div",{children:[r>1?e.jsx("div",{className:"path-split",children:">"}):"",e.jsx("div",{className:"path-value",disabled:a==="..."||r===s.length-1,onClick:()=>i(o[r]),children:a})]},r):"")})},Ma=ie(ka);function Aa({entries:c,getData:i,currentPath:t,status:s,onPathClick:o,sortConfig:a,onSort:r,columns:l,bulkActions:h,multiSelectionConfig:f,maxLevel:v,onRowSelect:w,isFolderDelete:F,isFolderOperationEnabled:g,headerAction:M}){return c=c.map(S=>{const y=S.uploadFileStatus==="UPLOAD_IN_PROGRESS"||S.uploadFileStatus==="NEW"||S.fileOperationStatus===Pe.UploadFolder,b=S.deleteFileStatus==="IN_PROGRESS"||S.deleteFileStatus==="NEW"||S.fileOperationStatus===Pe.Delete,_=S.fileOperationStatus===Pe.Move,P=S.fileOperationStatus===Pe.Copy,T=S.fileOperationStatus===Pe.Download;return{...S,fileType:S.isFolder?"folder":"file",isDisabled:S.isFolder&&(y||b||_),isProcessing:y||b||_||T,tooltipText:y?"connectedsite.backgroundjobsend":b?"connectedsite.backgroundjobdelete":_?"connectedsite.backgroundjobmove":P?"connectedsite.backgroundjobcopy":T?"connectedsite.backgroundjobdownload":"",tooltipPlacement:"right"}}),e.jsx("div",{className:"file-explorer modal-add-container",children:e.jsxs("div",{children:[e.jsxs("div",{className:"file-explorer-header",children:[t!==""?e.jsx(Ma,{path:t,onPathClick:o,maxLevel:v}):"",e.jsx(io,{actions:h,className:"bulk-actions",isPopupOpen:!0}),M]}),e.jsx(Zt,{viewName:"explorer",items:c,viewDetails:l,isInfoPanel:!1,type:"list",onSelect:w,onSort:r,initialSort:a,loadingStatus:s,onDoubleClick:i,rowHeight:60,noItemFoundHTML:e.jsx(Qt,{icon:Ms,buttons:[],children:e.jsx(n,{id:"connectedsite.nodevicedata"})}),...f},t)]})})}const ro=ie(Aa),Ta=()=>({displayColumn:[{propertyName:"fileType",iconMapping:{folder:{iconMapping:"folder-blue-icon"},file:{iconMapping:"file-blue-icon"}},defaultIcon:"file-blue-icon",type:"icon-column"},{title:"connectedsite.name",propertyName:"entryName",defaultSort:"asc"},{title:"common.dateUtc",propertyName:"modifyTime",defaultSort:"asc",type:"date",format:"MMM D, YYYY h:mm a"},{title:"connectedsite.size",propertyName:"size",defaultSort:"asc",type:"size"}],sort:{by:"entryName",type:"asc"}}),Ts=({isOpen:c=!1,headerText:i="",confirmButtonText:t="",cancelButtonText:s="",folders:o=[],breadcrumbs:a=[],currentFolderName:r="",showBackButton:l=!1,onFolderClick:h=()=>{},onFolderSelect:f=()=>{},onBackClick:v=()=>{},onBreadcrumbClick:w=()=>{},onConfirm:F=()=>{},onCancel:g=()=>{},onClose:M=()=>{},confirmDisabled:S=!1,isLoading:y=!1,disabledFolderIds:b=[]})=>{const _=Jt(),[P,T]=m.useState(null),x=t||_.formatMessage({id:"connectedsite.confirm"}),A=s||_.formatMessage({id:"common.cancel"});m.useEffect(()=>{c&&T(null)},[c]);const V=m.useCallback(U=>{const Z=U==null?void 0:U.detail,q=(Z==null?void 0:Z.id)!==void 0?Z.id:Z;q!=null&&(T(null),w(q))},[w]),L=U=>{P===U.id?(T(null),f(null)):(T(U.id),f(U))},Se=U=>{T(null),h(U)},je=()=>{T(null),v()};return e.jsx(Ne,{isOpen:c,headerText:i,acceptButtonText:x,declineButtonText:A,onAccept:F,onDecline:g,onClose:M,primaryButtonDisabled:S,primaryButtonAriaLabel:x,secondaryButtonAriaLabel:A,children:e.jsxs("div",{className:"folder-navigator-modal-wrapper",children:[e.jsxs("div",{className:"folder-navigator-modal","data-testid":"folder-navigator-modal",onClick:U=>{U.target.closest(".folder-navigator-modal__folder-item")||(T(null),f(null))},children:[l&&e.jsxs("div",{className:"folder-navigator-modal__navigator","data-testid":"folder-navigator-back",children:[e.jsx("button",{className:"folder-navigator-modal__back-btn",onClick:je,"aria-label":"Go back","data-testid":"folder-navigator-back-btn",children:e.jsx(Us,{name:"arrow_back",size:"20"})}),e.jsx("span",{className:"folder-navigator-modal__folder-title",children:r})]}),a.length>0&&e.jsx("div",{className:"folder-navigator-modal__breadcrumbs","data-testid":"folder-navigator-breadcrumbs",children:e.jsx(na,{crumbs:a,onCrumbClick:V})}),e.jsx("div",{className:"folder-navigator-modal__folder-list","data-testid":"folder-navigator-folder-list",children:y?e.jsx("div",{className:"folder-navigator-modal__loading-state",children:e.jsx("span",{className:"folder-navigator-modal__loading-spinner"})}):o.length>0?o.map(U=>{const Z=b.includes(U.id);return e.jsxs("div",{className:`folder-navigator-modal__folder-item${P===U.id?" folder-navigator-modal__folder-item--selected":""}${Z?" folder-navigator-modal__folder-item--disabled":""}`,onClick:()=>!Z&&L(U),onDoubleClick:()=>!Z&&Se(U),role:"button",tabIndex:Z?-1:0,onKeyDown:q=>{Z||(q.key==="Enter"?Se(U):q.key===" "&&(q.preventDefault(),L(U)))},"data-testid":`folder-navigator-folder-${U.id}`,children:[e.jsxs("div",{className:"folder-navigator-modal__folder-info",children:[e.jsx("span",{className:"icon i24 folder-grey-icon folder-navigator-modal__folder-icon"}),e.jsx("span",{className:"folder-navigator-modal__folder-name",children:U.name})]}),e.jsx("button",{className:"folder-navigator-modal__chevron-btn",onClick:q=>{q.stopPropagation(),Se(U)},"aria-label":`Open ${U.name}`,"data-testid":`folder-navigator-chevron-${U.id}`,children:e.jsx(Us,{name:"chevron_right",size:"20",className:"folder-navigator-modal__chevron-icon"})})]},U.id)}):e.jsx("div",{className:"folder-navigator-modal__empty-state",children:e.jsx(n,{id:"connectedsite.nofoldersavailable"})})})]}),e.jsx("p",{className:"folder-navigator-modal__note",children:e.jsx(n,{id:"common.folderNavigatorNote"})})]})})};Ts.propTypes={isOpen:u.bool,headerText:u.string.isRequired,confirmButtonText:u.string,cancelButtonText:u.string,folders:u.arrayOf(u.shape({id:u.oneOfType([u.string,u.number]).isRequired,name:u.string.isRequired})),breadcrumbs:u.arrayOf(u.shape({id:u.string.isRequired,display:u.string.isRequired}
1)),currentFolderName:u.string,showBackButton:u.bool,onFolderClick:u.func,onBackClick:u.func,onBreadcrumbClick:u.func,onConfirm:u.func,onCancel:u.func,onClose:u.func,confirmDisabled:u.bool,isLoading:u.bool,disabledFolderIds:u.arrayOf(u.oneOfType([u.string,u.number]))};const Wt=c=>c.entryId||c.fieldDataId,Ea=c=>c.isFolder?ja:xa,lo=({file:c,action:i,onActionChange:t})=>{const s=c.entryName||c.fileName||"",o=c.fileType,a=c.icon||Ea(c);return e.jsxs("div",{className:"file-conflict-card",children:[e.jsxs("div",{className:"file-conflict-card__info",children:[e.jsx("img",{src:a,className:"file-conflict-card__icon"}),e.jsxs("div",{className:"file-conflict-card__details",children:[e.jsx("span",{className:"file-conflict-card__name",children:s}),e.jsx("span",{className:"file-conflict-card__type",children:o})]})]}),e.jsxs("div",{className:"file-conflict-card__actions",children:[e.jsxs("label",{className:"file-conflict-card__radio",children:[e.jsx("input",{type:"radio",value:"replace",checked:i==="replace",onChange:()=>t("replace")}),e.jsx("span",{className:"file-conflict-card__radio-label",children:e.jsx(n,{id:"common.replace"})})]}),e.jsxs("label",{className:"file-conflict-card__radio",children:[e.jsx("input",{type:"radio",value:"skip",checked:i==="skip",onChange:()=>t("skip")}),e.jsx("span",{className:"file-conflict-card__radio-label",children:e.jsx(n,{id:"common.skip"})})]})]})]})};lo.propTypes={file:u.object.isRequired,action:u.oneOf(["replace","skip"]).isRequired,onActionChange:u.func.isRequired};const po=({value:c,onChange:i})=>e.jsxs("div",{className:"apply-to-all",children:[e.jsx("h4",{className:"apply-to-all__title",children:e.jsx(n,{id:"common.applytoall"})}),e.jsxs("label",{className:"apply-to-all__option",children:[e.jsx("input",{type:"radio",name:"apply-to-all",value:"replaceAll",checked:c==="replaceAll",onChange:()=>i("replaceAll")}),e.jsxs("div",{className:"apply-to-all__option-content",children:[e.jsx("span",{className:"apply-to-all__option-label",children:e.jsx(n,{id:"common.replaceall"})}),e.jsx("span",{className:"apply-to-all__option-desc",children:e.jsx(n,{id:"common.replcealldescription"})})]})]}),e.jsxs("label",{className:"apply-to-all__option",children:[e.jsx("input",{type:"radio",name:"apply-to-all",value:"skipAll",checked:c==="skipAll",onChange:()=>i("skipAll")}),e.jsxs("div",{className:"apply-to-all__option-content",children:[e.jsx("span",{className:"apply-to-all__option-label",children:e.jsx(n,{id:"common.skipall"})}),e.jsx("span",{className:"apply-to-all__option-desc",children:e.jsx(n,{id:"common.skipalldescription"})})]})]})]});po.propTypes={value:u.string,onChange:u.func.isRequired};const Es=({isOpen:c=!1,onReplace:i,onCancel:t,onClose:s,message:o="",files:a=[],children:r=null,primaryButtonDisabled:l=!1})=>{const h=Jt(),f=s||t,[v,w]=m.useState({}),[F,g]=m.useState(null),M=x=>v[Wt(x)]||"replace",S=(x,A)=>{g(null),w(V=>({...V,[Wt(x)]:A}))},y=x=>{g(x);const A=x==="replaceAll"?"replace":"skip",V={};a.forEach(L=>{V[Wt(L)]=A}),w(V)},b=()=>{const x=a.filter(V=>M(V)==="replace"),A=a.filter(V=>M(V)==="skip");i({replaceFiles:x,skipFiles:A})},_=()=>{w({}),g(null)};m.useEffect(()=>{c&&_()},[c]);const P=()=>{_(),t()},T=()=>{_(),f&&f()};return e.jsx(Ne,{isOpen:c,onAccept:b,onDecline:P,onClose:T,headerText:h.formatMessage({id:"connectedsite.fileconflictdetected"}),acceptButtonText:h.formatMessage({id:"common.continue"}),declineButtonText:h.formatMessage({id:"common.cancel"}),primaryButtonDisabled:l,children:e.jsxs("div",{className:"replace-confirmation-content",children:[o&&e.jsx("p",{className:"replace-confirmation-message",children:o}),a.length>0&&e.jsx("div",{className:"file-conflict-list",children:a.map(x=>e.jsx(lo,{file:x,action:M(x),onActionChange:A=>S(x,A)},Wt(x)))}),a.length>1&&e.jsx(po,{value:F,onChange:y}),r]})})};Es.propTypes={isOpen:u.bool,onReplace:u.func.isRequired,onCancel:u.func.isRequired,onClose:u.func,message:u.oneOfType([u.string,u.node]),files:u.arrayOf(u.object),children:u.node,primaryButtonDisabled:u.bool};const Oa=({folderContentsDelete:c,isReadOnly:i,isFileExplorerDelete:t,deletedItems:s,onRefreshClick:o,onUploadClick:a,onUploadFolderClick:r,onDownloadClick:l,onDeleteClick:h,onCopyClick:f,onMoveClick:v,onCreateNewFolderClick:w,onDeletedItemsClick:F,selectedItems:g,hasSystemDefinedFolder:M,showFolderOperationActions:S=!0,isDeviceDataLoading:y=!1})=>{const b=g.length>0,_=g.some(P=>P.isFolder&&!P.leaf);return[{key:"refresh-action",icon:"refresh-modus-icon",disable:!1,featureEnabled:!b,onClick:o,title:"common.refresh",size:24},{key:"newfolder-action",icon:"newfolder-modus-icon",disable:!1,featureEnabled:!i&&!b,onClick:w,title:"common.newfolder",size:24,permissions:[E.account_fielddata_download]},{key:"upload-menu-action",icon:"upload-modus-icon",disable:!1,featureEnabled:!b&&!i,title:"common.upload",size:24,permissions:[E.account_fielddata_download],submenuItems:[{key:"upload-files",title:"common.uploadfiles",onClick:a,featureEnabled:!0},{key:"upload-folder",title:"common.uploadfolder",secondary:"common.uploadfolderdescription",onClick:r,featureEnabled:!b}]},{key:"download-action",icon:"download-modus-icon",disable:!1,featureEnabled:b,onClick:l,title:"common.download",size:24,permissions:[E.account_fielddata_download]},{key:"move-action",icon:"move-modus-icon",disable:!b||M,featureEnabled:!i&&b&&S,onClick:v,title:"common.move",disabledTooltip:M?"connectedsite.systemfoldermovenotallowed":"",size:24,permissions:[E.account_fielddata_download]},{key:"copy-action",icon:"copy-modus-icon",disable:!b||M,featureEnabled:!i&&b&&S,onClick:f,title:"common.copy",disabledTooltip:M?"connectedsite.systemfoldercopynotallowed":"",size:24,permissions:[E.account_fielddata_download]},{key:"delete-action",icon:"delete-modus-icon",disable:!b||!c&&_||M,featureEnabled:t&&!i&&b&&S,onClick:h,title:"common.delete",disabledTooltip:M?"connectedsite.systemfolderdeletenotallowed":!c&&_?"connectedsite.deletenonemptyfoldernotallowed":"",size:24,permissions:[E.account_fielddata_download]},{key:"deleted-items-action",icon:"deleted-items-modus-icon",disable:y,featureEnabled:!!s&&!i&&!b,onClick:F,title:"connectedsite.deletedItems",size:24}]},qs=c=>{const i=c||"-";return e.jsx("p",{className:"deleted-items-truncated-text",title:c||void 0,children:i})},Ua=()=>({viewDetails:[{propertyName:"type",type:"icon-column",iconMapping:{folder:{iconMapping:"folder-blue-icon"},file:{iconMapping:"file-blue-icon"}},defaultIcon:"file-blue-icon"},{title:"connectedsite.name",propertyName:"name",isSortEnabled:!0,renderer:qs},{title:"connectedsite.deletedItemsOriginalLocation",propertyName:"originalLocation",isSortEnabled:!1,renderer:qs},{title:"connectedsite.deletedItemsDeletedDate",propertyName:"deletedDate",isSortEnabled:!0,type:"date",format:"MMM D, YYYY h:mm a"}],sort:{by:"deletedDate",type:"desc"}}),Os=({open:c,onClose:i,items:t=[],onMultiSelect:s,checkedSelectedItems:o=[],loadingStatus:a,loadM
1ore:r,onDownload:l})=>{const h=Ua(),[f,v]=m.useState(h.sort),w=({sortBy:S,sortOrder:y})=>{v({by:S,type:y})},F=m.useMemo(()=>{var y;const S=(y=h.viewDetails.find(b=>b.propertyName===f.by))==null?void 0:y.customPropertyValue;return Xt(f.by,f.type,t,S)},[t,f,h.viewDetails]),g=a===he.WAITING?he.COMPLETED:a,M=m.useCallback(S=>{if(S.isDisabled)return;const b=o.some(_=>_.entryId===S.entryId)?o.filter(_=>_.entryId!==S.entryId):[...o,S];s==null||s(b)},[o,s]);return e.jsxs(Ve,{open:c,onClose:i,title:e.jsx(n,{id:"connectedsite.deletedItems"}),hideScroll:!0,className:"deleted-items-popup",children:[e.jsxs("div",{className:"deleted-items-list-view",children:[e.jsxs("p",{className:"deleted-items-info-message",children:[e.jsx("img",{src:ba,alt:"","aria-hidden":"true",className:"deleted-items-info-icon"}),e.jsx(n,{id:"connectedsite.deletedItemsInfoMessage"})]}),c&&e.jsx(Zt,{type:"list",viewName:"deleted-items",itemKey:"entryId",items:F,viewDetails:h.viewDetails,initialSort:f,onSort:w,isBulkSelectable:!0,onMultiSelect:s,onSelect:M,checkedSelectedItems:o,loadingStatus:g,loadMore:({stopIndex:S}={})=>r==null?void 0:r(S),rowHeight:48,noItemFoundHTML:e.jsx(Qt,{icon:Ms,buttons:[],children:e.jsx(n,{id:"connectedsite.deletedItemsNoData"})})})]}),e.jsx("div",{className:"deleted-items-footer",children:e.jsx("button",{className:"button primary",disabled:o.length===0,onClick:()=>l==null?void 0:l(),children:e.jsx(n,{id:"common.download"})})})]})};Os.propTypes={open:u.bool,onClose:u.func,items:u.arrayOf(u.shape({id:u.oneOfType([u.string,u.number]),name:u.string,originalLocation:u.string,deletedDate:u.string})),onMultiSelect:u.func,checkedSelectedItems:u.array,loadingStatus:u.symbol,loadMore:u.func,onDownload:u.func};const La=200*1024*1024;function Ba(c){return c!=null&&c.length?[...c].reduce((i,t)=>i+(Number(t.size)||0),0):0}function ho(c){return Ba(c)>La}const Ys=(c,i=[])=>new no({searchItems:["entryName","modifyTime"],searchValue:c}).filterItems(c,[],i),Hs=new Fs({pollingInterval:5*1e3}),ft={DeviceData:"deviceData",TrimbleSynchronizerData:"trimbleSynchronizerData"};function $a({fileManagerStore:c,accountRootStore:i,onClosePopup:t,appStore:s,selectionStore:o}){let a=Ta();const[r,l]=m.useState([]),[h,f]=m.useState([]),[v,w]=m.useState(a.sort.by),[F,g]=m.useState(a.sort.type),[M,S]=m.useState({by:a.sort.by,type:a.sort.type}),[y,b]=m.useState(""),[_,P]=m.useState([]),[T,x]=m.useState(!1),[A,V]=m.useState(!1),[L,Se]=m.useState(!1),[je,U]=m.useState(""),[Z,q]=m.useState(!1),[Fe,ze]=m.useState([]),xe=m.useRef(null),Oe=m.useRef(null),[se,me]=m.useState(!1),[ee,K]=m.useState(""),[Ie,Re]=m.useState([]),[at,pe]=m.useState(!1),[es,it]=m.useState([]),[X,We]=m.useState(""),[bt,J]=m.useState(""),[oe,De]=m.useState(!1),[Ce,nt]=m.useState(null),[ct,qe]=m.useState(null),[rt,wt]=m.useState([]),[Dt,Ue]=m.useState([]),[Ye,ts]=m.useState(ft.DeviceData),ce=Jt(),ke=ce.formatMessage({id:"connectedsite.deletedevicedata"}),He=ce.formatMessage({id:"common.delete"}),Ct=ce.formatMessage({id:"common.cancel"}),Nt=ce.formatMessage({id:"connectedsite.create"}),ss=ce.formatMessage({id:"common.createNewFolder"}),Le="/",Q=i.accountStore.account.accountId,te=i.accountSelectionStore.selectedDevice.deviceId,Be=i.accountSelectionStore.selectedDevice.deviceName,_e=i.accountSelectionStore.selectedDevice.deviceType,_t=i.accountSelectionStore.selectedDevice.rentorName,[z,Ge]=m.useState(`/${Be}`),fe=Ye===ft.TrimbleSynchronizerData,$e=`/${ce.formatMessage({id:"common.trimblesynchronizerdata"})}`,be=(fe?z.slice($e.length):z)||"/",Je=Ye===ft.DeviceData&&z===`/${Be}`&&!_t,yt=!(fe&&z===$e),Ke=m.useCallback(d=>{const j=d.split("/").slice(2);return j.length>0?"/"+j.join("/")+"/":"/"},[]),os=m.useCallback(d=>{if(!fe)return d;const j=Ke(d);return j==="/"?j:j.replace(/\/$/,"")},[Ke,fe]),Pt=d=>((d==null?void 0:d.webkitRelativePath)||(d==null?void 0:d.name)||"").split("/").filter(Boolean)[0]||(d==null?void 0:d.name)||"",as=(d=[])=>[...new Set(d.map(Pt))].map(N=>N==null?void 0:N.trim()).filter(Boolean).map(N=>({entryName:N,fieldDataId:N,isFolder:!0}));m.useEffect(()=>{const d=j=>{(T||Hs.isPolling||c.downloadJobsPolling.isPolling||c.pendingDownloadJobs.length>0)&&(j.preventDefault(),j.returnValue="")};return window.addEventListener("beforeunload",d),()=>window.removeEventListener("beforeunload",d)},[T,Hs.isPolling]),m.useEffect(()=>{if(!se||!X)return;const d=new AbortController;return(async()=>{pe(!0),Re([]);try{const B=(await c.getDeviceFiles(Q,te,c.formatPathForApi(X),!0,d.signal)).filter(R=>R.isFolder&&R.fileOperationStatus!=="UPLOAD_FOLDER_IN_PROGRESS").map(R=>({id:R.entryId||R.entryName,name:R.entryName}));Re(B)}
1catch(N){if(console.log("error",N),(N==null?void 0:N.code)==="ERR_CANCELED"||(N==null?void 0:N.name)==="CanceledError"||(N==null?void 0:N.name)==="AbortError")return;Re([])}finally{d.signal.aborted||pe(!1)}})(),()=>{d.abort()}},[Q,X,te,c,se]);const Ft=d=>{f(Ys(d,r)),b(d)},It=()=>{Xe({sortBy:v,sortOrder:F,entryValues:r}),b("")},Xe=m.useCallback(({sortBy:d,sortOrder:j,entryValues:N})=>{d&&j&&(w(d),g(j),S({by:d,type:j}));const B=d||v,R=j||F;f(Y=>{const ye=N||Y;if(ye.length===0)return ye;const Ae=Xt(B,R,ye),zt=Ae.filter(bs=>bs.isFolder),bo=Ae.filter(bs=>!bs.isFolder);return[...zt,...bo]})},[v,F]);m.useEffect(()=>{f(Ys(y,r)),Xe({sortBy:v,sortOrder:F})},[r,y,v,Xe,F]);const is=async d=>{if(d.isFolder){const j=`${z}/${d.entryName}`;l([]),f([]),Ge(j),P([]),o.setSelectedItems([])}},Rt=async d=>{d!==""&&(l([]),f([]),Ge(d),P([]),o.setSelectedItems([]))},Me=!!(be!=="/"&&!be.slice(1).includes("/")&&_.some(Ra)),kt=()=>{Me||V(!0)},cs=()=>{Se(!0)},lt=()=>{q(!0),c.getDeletedContent(Q),to(_e)},rs=()=>{q(!1),ze([]),c.resetDeletedItems()},dt=async()=>{const d=`${ce.formatMessage({id:"connectedsite.deletedItemsFolderName"})}.zip`;eo(_e,Fe.length),s.setAlertMessages("connectedsite.downloadprogress",{},"","success","",!0);const j=await c.downloadDeletedFiles(Q,te,Fe),N=j==null?void 0:j.downloadFileJobId;if(!N){s.setAlertMessages("connectedsite.downloadfailure");return}c.enqueueDownloadJob({jobId:N,accountId:Q,onComplete:B=>{const R=B==null?void 0:B.url;R&&new st().downloadFromUrl(R,d),s.setAlertMessages()},onFailure:()=>{s.setAlertMessages("connectedsite.downloadfailure")}})},Mt=d=>{const j=os(z||Le),N=c.getCurrentFolderName(j);K(d),Re([]),We(j),J(N),it(c.buildFolderBreadcrumbs(j)),me(!0)},ls=()=>{Me||Mt($.COPY)},ds=()=>{Me||Mt($.MOVE)},pt=()=>{De(!1),qe(null),wt([]),Ue([])},At=async d=>{x(!0);try{await c.uploadFolder(Q,te,d,{path:be}),Te($.UPLOAD_FOLDER,d.length,_e),s.setAlertMessages("connectedsite.uploadfolderinprogress"),et()}catch{s.setAlertMessages("connectedsite.uploadfolersfailed")}finally{x(!1)}},Tt=async({skipFiles:d})=>{const j=rt,N=ct;if(pt(),N){const B=d.map(ye=>ye.entryName),R=N.path.filter(ye=>!B.some(Ae=>ye.endsWith(`/${Ae}`)));if(R.length===0)return;const Y={...N,path:R};await Lt(Y);return}if(j.length>0){const B=new Set(d.map(Y=>Y.entryName)),R=j.filter(Y=>!B.has(Pt(Y)));if(R.length===0)return;await At(R)}},Ze=()=>{me(!1),K(""),Re([]),pe(!1),it([]),We(""),J(""),nt(null)},ps=d=>{nt(d)},ht=d=>{nt(null),Re([]),We(d),J(c.getCurrentFolderName(d)),it(c.buildFolderBreadcrumbs(d))},hs=d=>{const j=X===Le?`/${d.name}`:`${X}/${d.name}`;ht(j)},us=()=>{const d=X.split("/").filter(Boolean);d.pop();const j=d.length>0?`/${d.join("/")}`:"/";ht(j)},Et=d=>{ht(d||Le)},Ot=()=>{const d=ee.toUpperCase(),j=c.formatPathForApi(be),N=_.map(Y=>`${j}${Y.entryName}`),B={operation:d,parentEntryId:c.parentEntryId,path:N,deviceId:te},R=Ce?`${X==="/"?"":X}/${Ce.name}`:X;return B.targetPath=c.formatPathForApi(R),B},Ut=(d,j=[])=>{const N=new Set(j.map(R=>R.split("/").filter(Boolean).pop()).filter(Boolean)),B=N.size===0?_.map(R=>R.entryId):_.filter(R=>N.has(R.entryName)).map(R=>R.entryId);l(R=>R.map(Y=>B.includes(Y.entryId)?{...Y,fileOperationStatus:d}:Y))},Lt=async d=>{var R;const j=Gt[ee],N=Pe[ee],B=((R=d==null?void 0:d.path)==null?void 0:R.length)||_.length;x(!0),Ze(),Ut(N,(d==null?void 0:d.path)||[]),s.setAlertMessages(j,{fileCount:B}),Te(ee,B,_e),await c.manageFolderEntries(Q,d),x(!1),P([]),o.setSelectedItems([])},Bt=async()=>{const d=Ot();me(!1),x(!0);try{const j=Ce?`${X==="/"?"":X}/${Ce.name}`:X,N=await c.checkForConflicts(Q,te,_,c.formatPathForApi(j));if(N.length>0){x(!1),qe(d),Ue(N),De(!0);return}await Lt(d)}catch{x(!1)}},ms=()=>{V(!1)},$t=()=>{U(""),Se(!1)},Vt=async()=>{Se(!1),x(!0);const d=await c.createFolder(Q,te,je,c.formatPathForApi(be));x(!1),U(""),d?et():s.setAlertMessages("connectedsite.createfolderfailure")},fs=async()=>{var N;V(!1),x(!0),Ut(Pe[$.DELETE]),s.setAlertMessages(Gt[$.DELETE],co(_));let d;d=await c.deleteFolderEntries(Q,te,_,be),x(!1);const j=((N=d==null?void 0:d.processedFilesList)==null?void 0:N.length)??_.length;Te($.DELETE,j,_e),P([]),o.setSelectedItems([])},Qe=async()=>{x(!0),s.setAlertMessages("connectedsite.downloadprogress",{},"","success","",!0);const d=await c.downloadDeviceFiles(Q,te,_,be),j=d==null?void 0:d.downloadFileJobId;
1if(j){const N=z.split("/").filter(Boolean),B=N.length>1?N.pop():"",R=fe?$e.slice(1):Be,Y=B?`${R}-${B}.zip`:`${R}.zip`,ye=_.length;c.enqueueDownloadJob({jobId:j,fileName:Y,accountId:Q,deviceId:te,onComplete:Ae=>{const zt=Ae==null?void 0:Ae.url;zt&&(new st().downloadFromUrl(zt,Y),Te($.DOWNLOAD,ye,_e),s.setAlertMessages(),P([]),o.setSelectedItems([]))},onFailure:()=>{s.setAlertMessages("connectedsite.downloadfailure")}})}x(!1)},gs=()=>{var d;(d=xe.current)==null||d.click()},vs=()=>{var d;(d=Oe.current)==null||d.click()},et=()=>{mt(),l([]),P([]),o.setSelectedItems([])},ut=()=>{ts(ft.TrimbleSynchronizerData),Ge($e),l([]),P([]),o.setSelectedItems([]),b("")},mt=m.useCallback(async()=>{l([]),f([]);try{const d=fe?Ke(z):z,j=await c.getDeviceFiles(Q,te,d);l(j)}catch{l([]),f([])}},[Q,te,c,Ke,fe,z]);m.useEffect(()=>{mt()},[mt]);const Ss=d=>{P([...d]),o.setSelectedItems(d)},p=yt,D=d=>{if(d.isProcessing||d.isFolder&&!p)return;const j=_.find(B=>B.entryId===d.entryId);let N=[];j?N=_.filter(B=>B.entryId!==d.entryId):N=[..._,d],P([...N]),o.setSelectedItems(N)},C=Ye===ft.DeviceData&&z===`/${Be}`,O=fe&&z===$e,k=Oa({folderContentsDelete:s.features.folderContentsDelete,isFileExplorerDelete:s.features.fileExplorerDelete,deletedItems:s.features.deletedItems,isReadOnly:!!_t,onRefreshClick:et,onUploadClick:gs,onUploadFolderClick:vs,onDownloadClick:Qe,onDeleteClick:kt,onCopyClick:ls,onMoveClick:ds,onCreateNewFolderClick:cs,onDeletedItemsClick:lt,selectedItems:_,hasSystemDefinedFolder:Me,showFolderOperationActions:yt,isDeviceDataLoading:(C||O)&&c.status!==he.COMPLETED}),W={isBulkSelectable:!0,onMultiSelect:Ss,itemKey:"entryId",checkedSelectedItems:_,disableProperty:"isProcessing"},re=async d=>{var B;const j=d==null?void 0:d.target,N=(B=j==null?void 0:j.files)!=null&&B.length?[...j.files]:null;if((N==null?void 0:N.length)>0){x(!0);const R=await c.uploadFiles(Q,te,N,c.formatPathForApi(be));x(!1);const Y=R.processedFilesList;Co(_e,Y.length),s.setAlertMessages("connectedsite.uploadprogresswithcount",{fileCount:Y.length}),et()}j&&(j.value="")},tt=async d=>{var B;const j=d==null?void 0:d.target,N=(B=j==null?void 0:j.files)!=null&&B.length?[...j.files]:null;try{if((N==null?void 0:N.length)>0){if(ho(N)){s.setAlertMessages("connectedsite.folderuploadmaxsizeexceeded",{},"","error"),j&&(j.value="");return}x(!0);const R=as(N);if(R.length>0){const Y=await c.checkForConflicts(Q,te,R,be,!0);if(Y.length>0){x(!1),wt(N),Ue(Y),De(!0),j&&(j.value="");return}}await At(N)}}catch(R){const Y=(R==null?void 0:R.message)==="connectedsite.foldernameconflictswithfile"?R.message:"connectedsite.uploadfolersfailed";s.setAlertMessages(Y,{},"","error")}finally{x(!1),j&&(j.value="")}},js=Ee[ee]?ce.formatMessage({id:"common.folderNavigatorOperationHeader"},{operation:ce.formatMessage({id:Ee[ee]}),count:_.length}):"",xs=()=>{const d=c.normalizeFolderPath(Ce?`${X==="/"?"":X}/${Ce.name}`:X),j=c.normalizeFolderPath(z);return d==="/"||d===j||_.some(N=>Ce&&N.entryId===Ce.id)};return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{type:"pagepopup",open:!0,title:e.jsx(n,{id:fe?"common.trimblesynchronizerdata":"connectedsite.devicedata"}),subtitle:fe?"":Be,onClose:t,className:"field-data-popup",children:e.jsxs("div",{className:"popup-container",children:[e.jsx("div",{className:"search-container",children:e.jsx(Is,{placeholder:"connectedsite.searchplaceholder",onChange:Ft,onSearch:Ft,onClear:It})}),e.jsx(ro,{columns:a.displayColumn,bulkActions:k,entries:h,currentPath:z,maxLevel:3,getData:is,status:c.status,onPathClick:Rt,sortConfig:M,onSort:Xe,multiSelectionConfig:W,onRowSelect:D,isFolderDelete:s.features.fileExplorerDelete,isFolderOperationEnabled:p,headerAction:Je?e.jsx("div",{className:"link_text view-trimble-synchronizer-data",onClick:ut,children:e.jsx(n,{id:"common.viewtrimblesynchronizerdata"})}):null}),e.jsx("input",{type:"file",className:"upload-input",ref:xe,multiple:"multiple",onChange:re}),e.jsx("input",{type:"file",className:"upload-input",ref:Oe,multiple:"multiple",webkitdirectory:"",directory:"",onCh
1ange:tt}),e.jsx(xt,{dimension:{width:"50px",height:"50px"},show:T}),e.jsx(Ne,{isOpen:A,onDecline:ms,onAccept:fs,headerText:ke,acceptButtonText:He,declineButtonText:Ct,onClose:ms,zIndex:10,dangerPrimaryButton:!0,children:e.jsxs("div",{className:"delete-confirmation-message",children:[e.jsx(n,{id:"connectedsite.deleteDataCommand"}),e.jsxs("ul",{children:[e.jsx("li",{children:e.jsx(n,{id:"connectedsite.deleteDataFromCloud"})}),e.jsx("li",{children:e.jsx(n,{id:"connectedsite.deleteDataFromDevice"})})]})]})}),e.jsxs(Ne,{isOpen:L,onAccept:Vt,onDecline:$t,headerText:ss,acceptButtonText:Nt,declineButtonText:Ct,onClose:$t,zIndex:10,primaryButtonDisabled:!je,children:[e.jsx("label",{children:e.jsx(n,{id:"common.foldername"})}),e.jsx("input",{type:"text",value:je,onChange:d=>U(d.target.value)})]}),e.jsx(Ts,{isOpen:se,headerText:js,confirmButtonText:Ee[ee]?ce.formatMessage({id:Ee[ee]}):ee,folders:Ie,isLoading:at,breadcrumbs:es,currentFolderName:bt,showBackButton:!!X&&X!==Le,onFolderClick:hs,onFolderSelect:ps,onBackClick:us,onBreadcrumbClick:Et,onConfirm:Bt,onCancel:Ze,onClose:Ze,disabledFolderIds:_.map(d=>d.entryId),confirmDisabled:xs()}),e.jsx(Es,{isOpen:oe,message:ce.formatMessage({id:"connectedsite.replaceconfirmationmessage"}),files:Dt,onReplace:Tt,onCancel:pt,onClose:pt})]})}),e.jsx(Os,{open:Z,onClose:rs,items:c.deletedItems,loadingStatus:c.deletedItemsStatus,checkedSelectedItems:Fe,onMultiSelect:d=>ze(d),loadMore:d=>c.getDeletedContent(Q,d),onDownload:dt})]})}const Va=ue(de("fileManagerStore","accountRootStore","appStore","selectionStore"),ie)($a);function Gs(c){return!c||isNaN(c)?null:c>=1099511627776?`${Math.floor(c/1099511627776*100)/100} TB`:c>=1073741824?`${Math.floor(c/1073741824*100)/100} GB`:c>=1048576?`${Math.floor(c/1048576*100)/100} MB`:`${Math.floor(c/1024*100)/100} KB`}const za={account_devices_select:{marginBottom:"28px",width:"100%",height:"48px",border:"1px",boxSizing:"border - box",borderRadius:"2px",fontSize:"18px",fontWeight:300,fontFamily:['"Open Sans"',"sans-serif"].join(", "),background:"#FFFFFF",padding:"10px"},devices_input:{paddingLeft:"8px",marginLeft:"-8px","&:focus":{backgroundColor:"transparent"}},dropdown_icon:{marginRight:"10px"}};class Wa extends I.Component{constructor(t){super(t);ge(this,"rowRenderer",({index:t,isScrolling:s,key:o,parent:a,style:r})=>{let l;if(this.state.selectedtab==="available"?l=t<this.state.availableDevices.length&&this.state.allDevices.find(h=>h.deviceSerialNumber===this.state.availableDevices[t]):l=t<this.state.selectedDevices.length&&this.state.allDevices.find(h=>h.deviceSerialNumber===this.state.selectedDevices[t]),l){const{addIcon:h,deviceName:f,serialNumber:v,displayFirmwareVersion:w,isAddDisabled:F}=this.renderDevice(l),g=F?"disabled":"";return e.jsxs("div",{style:r,children:[e.jsx("div",{children:e.jsx("p",{className:`icon i32 ${St[l.deviceType.toUpperCase()].iconMapping}`})}),e.jsx("div",{className:"name text-wrap",children:f}),e.jsx("div",{className:"name text-wrap",children:v}),e.jsx("div",{className:"name text-wrap",children:w}),e.jsx("div",{className:`status ${g}`,onClick:()=>!F&&this.renderClickFunctionality(l),children:e.jsx("span",{className:h})})]},t)}return e.jsx("div",{className:"list-loader",style:r,children:e.jsx("img",{src:Ps,alt:"loading icon"})},t)});ge(this,"renderDevice",t=>{var f;let s,o,a,r,l;const h=((f=t==null?void 0:t.displayFirmwareVersion)==null?void 0:f.indexOf("Pending"))>-1;return this.state.availableDevices.indexOf(t.deviceSerialNumber)!==-1&&this.state.selectedDevices.indexOf(t.deviceSerialNumber)!==-1?(r="tick-circled-icon",s=`icon i32 ${r}`):(r="plus-circled-icon",s=`icon i32 ${r}`,h&&(s=s+" disabled")),this.state.selectedtab==="selected"&&this.state.selectedDevices.indexOf(t.deviceSerialNumber)!==-1&&(r="close-icon",s=`icon i24 ${r}`),o=t.deviceName,a=t.deviceSerialNumber,l=t.displayFirmwareVersion,{addIcon:s,deviceName:o,serialNumber:a,displayFirmwareVersion:l,isAddDisabled:h}});ge(this,"handleScroll",({target:t})=>{const{scrollTop:s,scrollLeft:o}=t,{Grid:a}=this.List;a.handleScrollEvent({scrollTop:s,scrollLeft:o})});this.state={isLoading:!1,allDevices:[],availableDevices:[],selectedDevices:[],firmwareVersions:[],selectedtab:"selected",showNotification:!1,showUpdateConfirmation:!1,showLicenseCheckConfirmation:!1,selectedFirmwareVersion:null},this.changeSelectedTab=this.changeSelectedTab.bind(this),this.updateDeviceFirmware=this.updateDeviceFirmware.bind(this),this.isRowLoaded=this.isRowLoaded.bind(this),this.renderDevice=this.renderDevice.bind(this),this.filterByTab=this.filterByTab.bind(this),this.escFunction=this.escFunction.bind(this),this.rowRenderer=this.rowRenderer.bind(this),this.showConfirmation=this.showConfirmation.bind(this),this.closeConfirmation=this.closeConfirmation.bind(this),this.closeUpdateFirmwarePopup=this.closeUpdateFirmwarePopup.bind(this),this.showUpdateFirmwareConfirmation=this.showUpdateFirmwareConfirmation.bind(this),this.closeUpdateFirmwareConfirmation=this.closeUpdateFirmwareConfirmation.bind(this)}async componentDidMount(){this.setState({isLoading:!0}),document.addEventListener("keydown",this.escFunction,!1),await this.props.accountRootStore.accountDeviceStore.getAllEarthworksAccountDevices();let t=this.props.accountRootStore.accountDeviceStore.earthworksDevices;this.props.appStore.features.otaSupportForRW&&(t=this.props.accountRootStore.accountDeviceStore.earthworksDevices.filter(l=>l.isRWDevice===this.props.isRWDevice||!this.props.isRWDevice&&l.isRWDevice===void 0)),this.setState({allDevices:t});let s=this.state.allDevices.map(l=>l.firmwareVersion);s=s.sort(ws);let o=await this.props.accountRootStore.accountDeviceStore.getFirmwareListInfo(this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceType,s[0]);const a=[this.props.selectedDevice.serialNumber];this.props.appStore.features.otaSupportForRW&&(this.props.isRWDevice?o=o.filter(l=>l.firmwareVersion.includes("RoadWorks")||l.firmwareVersion.includes("Roadworks")):o=o.filter(l=>!l.firmwareVersion.includes("RoadWorks")&&!l.firmwareVersion.includes("Roadworks"))),s=o.map(l
1=>l.firmwareVersion),s=s.sort(ws);const r=this.addAvailabledevices(s[s.length-1]);o.sort((l,h)=>ws(h.firmwareVersion,l.firmwareVersion)),this.setState({firmwareVersions:o,selectedDevices:a,availableDevices:r,isLoading:!1,selectedFirmwareVersion:s.includes(this.props.selectedDevice.currentFirmwareVersion)?this.props.selectedDevice.currentFirmwareVersion:s[s.length-1]})}escFunction(t){t.keyCode===27&&this.showConfirmation()}showConfirmation(){this.setState({showNotification:!0})}closeConfirmation(){this.setState({showNotification:!1})}closeUpdateFirmwarePopup(){this.closeConfirmation(),this.props.closeFirmwareUpdate()}async updateDeviceFirmware(){const t=this.state.firmwareVersions.filter(o=>o.firmwareVersion===this.state.selectedFirmwareVersion),s=await this.props.accountRootStore.accountDeviceStore.updateFirmwareForDevices(t[0].firmwareId,this.state.selectedDevices);if(this.closeUpdateFirmwareConfirmation(),s.status===200){this.props.closeFirmwareUpdate(),this.props.refreshDeviceFirmwareVersion();const o=s.data.length;this.props.appStore.setAlertMessages("accountpage.firmwareupdateinitiated",{deviceCount:o})}else this.props.appStore.setAlertMessages("accountpage.unabletoupdatefirmware")}showUpdateFirmwareConfirmation(){this.setState({showUpdateConfirmation:!0})}closeUpdateFirmwareConfirmation(){this.setState({showUpdateConfirmation:!1,showLicenseCheckConfirmation:!1})}renderClickFunctionality(t){this.toggleDeviceSelection(t.deviceSerialNumber)}toggleDeviceSelection(t){const s=this.state.selectedDevices.indexOf(t);s>-1?this.setState(o=>(o.selectedDevices.splice(s,1),{selectedDevices:o.selectedDevices,availableDevices:o.availableDevices}),()=>{this.filterByTab(this.state.allDevices)}):this.setState(o=>(o.selectedDevices.push(t),{selectedDevices:o.selectedDevices,availableDevices:o.availableDevices}),()=>{this.filterByTab(this.state.allDevices)})}refreshDeviceSelection(t){const s=t.target.value,o=this.addAvailabledevices(s),a=[this.props.selectedDevice.serialNumber];this.setState({availableDevices:o,selectedFirmwareVersion:s,selectedDevices:a})}changeSelectedTab(){const t=this.state.selectedtab==="available"?"selected":"available";this.setState({selectedtab:t},()=>{this.filterByTab(this.state.allDevices)})}isRowLoaded({index:t}){return t<this.state.allDevices.length&&!!this.state.allDevices[t]}addAvailabledevices(t){return this.state.allDevices.filter(o=>ca(o.firmwareVersion,t,"<")).map(o=>o.deviceSerialNumber)}filterByTab(t){let s=t;return this.state.selectedtab==="available"?s=s.filter(o=>this.state.availableDevices.indexOf(o.deviceSerialNumber)>-1):s=s.filter(o=>this.state.selectedDevices.indexOf(o.deviceSerialNumber)>-1),s}render(){const o={overflowX:!1,overflowY:!1},a=!(this.state.selectedDevices.length&&!this.state.isLoading),r=this.state.selectedtab==="selected"?this.state.selectedDevices.length:this.state.availableDevices.length,l=e.jsx("div",{className:"tab-content",children:e.jsx("div",{className:"select-devices-list",children:e.jsx(ot,{onScroll:this.handleScroll,children:e.jsx(ma,{isRowLoaded:this.isRowLoaded,loadMoreRows:()=>{},rowCount:1e4,minimumBatchSize:10,threshold:5,children:({onRowsRendered:f,registerChild:v})=>e.jsx(fa,{children:({height:w,width:F})=>e.jsx(ga,{height:this.props.height||w-17,onRowsRendered:f,ref:g=>{v(g),this.List=g},rowCount:r,rowRenderer:this.rowRenderer,width:this.props.width||F-17,style:o,rowHeight:40})})})})})}),h=e.jsxs("div",{className:"tabs",children:[e.jsxs("div",{className:"tab",children:[e.jsx("input",{type:"radio",id:"tab-1",name:"tab-group-1",value:"available",onChange:this.changeSelectedTab,checked:this.state.selectedtab==="available"}),e.jsx("label",{htmlFor:"tab-1",children:e.jsx(n,{id:"connectedsite.available"})})]}),e.jsxs("div",{className:"tab",children:[e.jsx("input",{type:"radio",id:"tab-2",name:"tab-group-1",value:"selected",onChange:this.changeSelectedTab,checked:this.state.selectedtab==="selected"}),e.jsxs("label",{htmlFor:"tab-2",children:[e.jsx(n,{id:"connectedsite.selected"})," (",this.state.selectedDevices.length,")"]})]}),l]});return e.jsxs("div",{className:"firmware-device-container",children:[e.jsxs(Ve,{type:"pagepopup",open:!0,title:e.jsx(n,{id:"accountpage.earthworksfirmware"}),onClose:this.showConfirmation,className:"device-page",children:[e.jsx(xt,{attachmentType:"absolute",dimension:{width:"50px",height:"50px"},show:this.state.isLoading,id:"process-loader"}),e.jsx(ot,{children:e.jsx("div",{className:"firmware-device-container",children:e.jsxs("div",{className:"edit-devices",children:[e.jsxs("div",{className:"select-devices editdevices",children:[e.jsxs("div",{className:"",children:[e.jsx("label",{className:"text",children:e.jsx(n,{id:"accountpage.firmwarelabel"})}),e.jsx(As,{value:this.state.selectedFirmwareVersion,native:!0,disableUnderline:!0,classes:{select:this.props.classes.devices_input},className:this.props.classes.account_devices_select,onClick:f=>f.stopPropagation(),onChange:f=>this.refreshDeviceSelection(f),IconComponent:f=>e.jsx("i",{className:`icon i24 accounts-list-down-arrow ${f.className} dropdown_icon `}),children:this.state.firmwareVersions.map(f=>e.jsx("option",{value:f.firmwareVersion,children:f.firmwareVersion},f.firmwareId))})]}),e.jsx(I.Fragment,{children:h})]}),e.jsx("div",{className:"update-div",children:e.jsx("button",{className:"button primary update-btn",disabled:a,onClick:this.showUpdateFirmwareConfirmation,children:e.jsx(n,{id:"common.update"})})})]})})})]}),e.jsx(we,{message:e.jsx(n,{id:"accountpage.cancelfirmwareupdate"}),show:this.state.showNotification,imgCls:"delete-device-icon",isCancel:!0,isBackbtn:!1,onAccept:this.closeUpdateFirmwarePopup,onDecline:this.closeConfirmation,declineMsg:e.jsx(n,{id:"common.no"})}),e.jsx(we,{message:e.jsx(I.Fragment,{children:e.jsx(n,{id:"accountpage.updatefirmwareconfirmation"})}),show:this.state.showUpdateConfirmation,isCancel:!0,isBackbtn:!1,onAccept:()=>this.setState({showUpdateConfirmation:!1,showLicenseCheckConfirmation:!0}),onDecline:()=>this.closeUpdateFirmwareConfirmation(),customFooterBlock:e.jsx("div",{className:"custom-footer",children:"1/2"}),acceptMsg:e.jsx(n,{id:"common.next"}),declineMsg:e.jsx(n,{id:"common.close"}),title:e.jsx(I.Fragment,{children:e.jsx(n,{id:"accountpage.updatefirmware"})}),className:"update-firmware"}),e.jsx(we,{message:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"message-header",children:e.jsx(n,{id:"accountpage.softwaremaintenancecheck"})}),e.jsx(n,{id:"accountpage.softwaremaintenancecheckconfirmation",values:{strong:f=>e.jsx("strong",{children:f})}})]}),show:this.state.showLicenseCheckConfirmation,isCancel:!0,isBackbtn:!1,onAccept:()=>this.updateDeviceFirmware(),onDecline:()=>this.closeUpdateFirmwareConfirmation(),customFooterBlock:e.jsx("div",{className:"custom-footer",children:"2/2"}),acceptMsg:e.jsx(n,{id:"common.update"}),declineMsg:e.jsx(n,{id:"common.close"}),title:e.jsx(e.Fragment,{children:e.jsx(n,{id:"accountpage.updatefirmware"})}),className:"update-firmware"})]})}}const qa=ue(de("accountRootStore","appStore"),Kt(za),ie)(Wa);class Ya{static getDisplayColumns(){return[{propertyName:"fileType",iconMapping:{folder:{iconMapping:"folder-blue-icon"},file:{iconMapping:"file-blue-icon"}},defaultIcon:"file-blue-icon",type:"icon-column"},{title:"connectedsite.name",propertyName:"fileName",defaultSort:"asc",searchHighlight:!0},{title:"common.date",propertyName:"modifiedDate",defaultSort:"asc",type:"date",format:"MMM D, YYYY h:mm a",availableSize:["m","l","xl"]},{title:"common.date",propertyName:"modifiedDate",defaultSort:"asc",type:"date",format:"MMM D, YYYY",availableSize:["s","xs"]}]}}const Ha=({isFileExplorerDelete:c,isReadOnly:i,onRefreshClick:t,onUploadClick:s,onDownloadClick:o,onDeleteClick:a,selectedItems:r})=>[{key:"refresh-action",icon:"refresh-modus-icon",disable:!1,featureEnabled:!0,onClick:t,title:"common.refresh",size:24},{key:"upload-action",icon:"upload-modus-icon",disable:r.length>0,featureEnabled:!i,onClick:s,title:"common.upload",size:24,permissions:[E.project_fielddata_download]},{key:"download-action",icon:"download-modus-icon",disable:r.length===0,featureEnabled:!0,onClick:o,title:"common.download",size:24,permissions:[E.project_fielddata_download]},{key:"delete-action",icon:"delete-modus-icon",disable:r.length===0,featureEnabled:c&&!i,onClick:a,title:"common.delete",size:24,permissions:[E.project_fielddata_download]}];class uo extends I.Component{constructor(t){super(t);ge(this,"onMultipleFilesSelect",t=>{this.selectedItems=t.map(s=>({...s,selected:!0})),this.setState({selectedItems:t}),this.props.selectionStore.setSelectedItems(t)});ge(this,"onFileUpload",t=>{var o,a;const s=(a=(o=t==null?void 0:t.target)==null?void 0:o.files)!=null&&a.length?[...t.target.files]:null;this.uploadMachineData(s)});ge(this,"handleClick",t=>{this.hiddenFileInput.current.click()});ge(this,"onProjectLibraryClick",()=>{this.props.openProjectLibrary()});this.closePopup=this.closePopup.bind(this),this.getMCData=this.getMCData.bind(this),this.filterMCData=this.filterMCData.bind(this),this.clearSearch=this.clearSearch.bind(this),this.highlightText=this.highlightText.bind(this),this.sortItems=this.sortItems.bind(this),this.downloadMCData=this.downloadMCData.bind(this),this.showDeleteConfirmation=this.showDeleteConfirmation.bind(this),this.onFileUpload=this.onFileUpload.bind(this),this.handleClick=this.handleClick.bind(this),this.handleModalClose=this.handleModalClose.bind(this),this.sort={by:"modifiedDate",type:"desc"},this.selectedItems=[],this.state={machineControlData:[],status:he.NOTSTARTED,isDownloadInProgress:!1,isUploadInProgress:!1,isDeleteInProgress:!1,downloadRequestId:null,showDeleteFilesConfirmation:!1,searchValue:"",sortBy:this.sort.by,sortOrder:this.sort.type,selectedItems:[]},this.downloadStatusInterval=5*1e3,this.polling=new Fs({pollingFunction:()=>this.downloadMachineControlData(),pollingInterval:this.downloadStatusInterval}),this.controller=new AbortController,this.hiddenFileInput=I.createRef()}componentDidMount(){this.getMCData()}componentWillUnmount(){this.props.selectionStore.setSelectedItems([])}async downloadMCData(){const t=this.getSelectedMachineControlData();this.setState({isDownloadInProgress:!0}),this.props.appStore.setAlertMessages("connectedsite.machinedatadowload",{},"","success","",!0);let o,a;o=await this.props.devicesStore.createMachineDataDownload(this.props.accountRootStore.accountStore.account.accountId,this.props.device.deviceId,t),a=o==null?void 0:o.fieldDataJobId,a&&(this.setState({downloadRequestId:a}),this.polling.startPolling()),this.setState({isDownloadInProgress:!1})}getSelectedMachineControlData(){return[...this.selectedItems]}async downloadMachineControlData(){if(this.state.downloadRequestId){const t=this.getSelectedMachineControlData();let s,o,a,r,l;if(s=await this.props.devicesStore.getFieldDataDownload(this.state.downloadRequestId),a=s.jobStatus.toUpperCase(),o=a==="COMPLETED"||a==="FAILED",r=s.url,t.length===1?(l=t[0].fileName,l.indexOf(".zsnap")>-1&&r&&r.indexOf(".zip")>-1&&(l=l.replace(".zsnap",".zip"))):l=t[0].fieldDataType+".zip",o){if(this.polling.stopPolling(),a==="COMPLETED"){if(document.documentMode||/Edge/.test(navigator.userAgent)){const v=await new st().downloadFile(r);window.navigator.msSaveOrOpenBlob(v,l)}else No.saveAs(r,l);const h=ve.Earthworks.includes(this.props.device.deviceType)?"Earthworks":"GCS";_o(h,t.length),this.props.appStore.setAlertMessages()}else if(a==="FAILED"){let h;h="errormsg.machinedatadownloadfailure",this.props.appStore.setAlertMessages(h,{},"","error")}}}}async deleteMachineData(){const t=this.getSelectedMachineControlData();this.setState({showDeleteFilesConfirmation:!1,isDeleteInProgress:!0});const s=await this.props.devicesStore.deleteMachineData(this.props.accountRootStore.accountStore.account.accountId,this.props.device.deviceId,t),o=ve.Earthworks.includes(this.props.device.deviceType)?"Earthworks":"GCS";switch(s.status){case 204:this.props.appStore.setAlertMessages("connectedsite.machinedatadelete",{noOfFiles:t.length,deviceName:this.props.device.deviceName}),Ls(o,t.length);break;case 207:this.props.appStore.setAlertMessages("connectedsite.machinedatadelete",{noOfFiles:s.data.processedFilesList.length,deviceName:this.props.device.deviceName}),Ls(o,s.data.processedFilesList.length);break;default:this.props.appStore.setAlertMessages("connectedsite.machinedatadeletefailed",{noOfFiles:t.length,deviceName:this.props.device.deviceName},"","error");break}this.setState({isDeleteInProgress:!1,selectedItems:[]}),this.props.selectionStore.setSelectedItems([]),this.selectedItems=[],await this.getMCData()}async clearSearch(){this.setState({searchValue:""}),await this.getMCData()}async filterMCData(t){this.setState({searchValue:t}),await this.getMCData(t),yo(t,jt.search.actions.account,jt.search.labels.machinedatasearch)}highlightText(t){const s=this.state.searchValue.replace(/[\^$\\.*+?()[\]{}|]/g,"\\$&");return e.jsx(Po,{searchWords:[s],caseSensitive:!1,textToHighlight:t,highlightClassName:"highlighted-text"})}sortItems({sortBy:t,sortOrder:s,mcData:o}){(t||s)&&(this.setState({sortBy:t,sortOrder:s}),Fo("Sort Machine Data",t,s));const a=t||this.state.sortBy,r=s||this.state.sortOrder,l=o||this.state.machineControlData,h=Xt(a,r,l);this.setState({machineControlData:h})}async getMCData(t=""){this.setState({status:he.INPROGRESS,machineControlData:[]});const s=ve.Earthworks.includes(this.props.device.deviceType)?"Earthworks":"GCS";let o;if(o=await this.props.deviceService.getMachineData(this.props.accountRootStore.accountStore.account.accountId,this.props.device.deviceId,s,null,this.controller.signal,!1,t,this.sort.by,this.sort.type),o){const a=o.map(r=>new ra(r));this.sortItems({sortBy:this.state.sortBy,sortOrder:this.state.sortOrder,mcData:a}),this.setState({status:he.COMPLETED})}}
1closePopup(){this.props.closeMCData()}async uploadMachineData(t){let s=[];const o=new st;this.setState({isUploadInProgress:!0}),t&&(s=s.concat(t.map(r=>o.uploadMachineFile(this.props.device.deviceId,r))));const a=await Io.all(s);await this.props.deviceService.uploadMachineData(this.props.device.deviceId,this.props.accountRootStore.accountStore.account.accountId,a),this.getMCData(),this.setState({isUploadInProgress:!1}),this.props.appStore.setAlertMessages("connectedsite.machinedataupload",{deviceName:this.props.device.deviceName})}showDeleteConfirmation(){this.setState({showDeleteFilesConfirmation:!0})}handleModalClose(){this.setState({showDeleteFilesConfirmation:!1})}render(){const{selectedItems:t}=this.state;this.displayColumns=Ya.getDisplayColumns();const s=Ha({isFileExplorerDelete:this.props.appStore.features.fileExplorerDelete,isReadOnly:!!this.props.device.rentorName,onRefreshClick:()=>this.getMCData(),onUploadClick:this.handleClick,onDownloadClick:this.downloadMCData,onDeleteClick:this.showDeleteConfirmation,selectedItems:t});return e.jsx(I.Fragment,{children:e.jsxs(Ve,{type:"pagepopup",open:!0,title:e.jsx(n,{id:"connectedsite.machinedata"}),subtitle:this.props.device.deviceName,onClose:this.closePopup,className:`field-data-popup ${this.props.device.deviceType}`,children:[e.jsx("div",{className:"modal-add-container",children:e.jsxs("div",{children:[e.jsx("div",{className:"search-container",children:e.jsx(Is,{placeholder:"connectedsite.searchplaceholder",onSearch:this.filterMCData,onClear:this.clearSearch})}),e.jsxs("div",{className:"bulk-action-control",children:[e.jsx("input",{type:"file",className:"upload-input",ref:this.hiddenFileInput,multiple:"multiple",onChange:this.onFileUpload}),e.jsx(io,{actions:s,className:"bulk-actions-earthworks",isPopupOpen:!0}),this.props.device.rentorName?"":e.jsx("div",{className:"link_text view-project-library",onClick:this.onProjectLibraryClick,children:e.jsx(n,{id:"common.viewprojectlibrary"})})]}),e.jsx(Zt,{viewName:"fielddata",items:this.state.machineControlData,viewDetails:this.displayColumns,type:"list",initialSort:this.sort,loadingStatus:this.state.status,onSort:this.sortItems,highlightText:this.highlightText,noItemFoundHTML:e.jsx(Qt,{icon:Ms,buttons:[],children:e.jsx(n,{id:"connectedsite.nomachinedata"})}),isBulkSelectable:!0,onMultiSelect:this.onMultipleFilesSelect,itemKey:"fieldDataId",checkedSelectedItems:t,disableProperty:"isProcessing"})]})}),e.jsx(xt,{attachmentType:"",dimension:{width:"50px",height:"50px"},show:this.state.isUploadInProgress||this.state.isDeleteInProgress||this.state.isDownloadInProgress,id:"file-upload-loader"}),e.jsx(Ne,{isOpen:this.state.showDeleteFilesConfirmation,onDecline:()=>this.handleModalClose(),onAccept:()=>this.deleteMachineData(),headerText:this.props.appStore.localeMessages["connectedsite.deletedata"],acceptButtonText:this.props.appStore.localeMessages["common.delete"],declineButtonText:this.props.appStore.localeMessages["common.cancel"],onClose:()=>this.handleModalClose(),zIndex:10,children:e.jsx("p",{className:"delete-confirmation-message",children:this.props.appStore.localeMessages["connectedsite.deletedataconfirmation"]})})]})})}}uo.propTypes={closeFieldData:u.func,device:u.object,deviceService:u.object};const Ga=ue(de("accountRootStore","appStore","permissionStore","devicesStore","selectionStore"),ie)(uo),Ja=()=>({displayColumn:[{propertyName:"fileType",iconMapping:{folder:{iconMapping:"folder-blue-icon"},file:{iconMapping:"file-blue-icon"}},defaultIcon:"file-blue-icon",type:"icon-column"},{title:"connectedsite.name",propertyName:"entryName",defaultSort:"asc"},{title:"common.dateUtc",propertyName:"modifyTime",defaultSort:"asc",type:"date",format:"MMM D, YYYY h:mm a"},{title:"connectedsite.size",propertyName:"size",defaultSort:"asc",type:"size"}],sort:{by:"entryName",type:"asc"}}),Ka=({isFileExplorerDelete:c,folderContentsDelete:i,isReadOnly:t,deletedItems:s,onRefreshClick:o,onUploadClick:a,onUploadFolderClick:r,onDownloadClick:l,onDeleteClick:h,onCopyClick:f,onMoveClick:v,onCreateNewFolderClick:w,onDeletedItemsClick:F,selectedItems:g,showFolderOperationActions:M=!0,isProjectsDirectory:S=!1,isDeviceDataLoading:y=!1})=>{const b=g.length>0,_=g.some(A=>A.isFolder),P=M&&b,T=g.some(A=>A.isFolder&&!A.leaf),x=S&&_;return[{key:"refresh-action",icon:"refresh-modus-icon",disable:_,featureEnabled:!b,onClick:o,title:"common.refresh",size:24},{key:"newfolder-action",icon:"newfolder-modus-icon",disable:_,featureEnabled:!b,onClick:w,title:"common.newfolder",size:24,permissions:[E.project_fielddata_download]},{key:"upload-menu-action",icon:"upload-modus-icon",disable:!1,featureEnabled:!b,title:"common.upload",size:24,permissions:[E.project_fielddata_download],submenuItems:[{key:"upload-files",title:"common.uploadfiles",onClick:a,featureEnabled:!0},{key:"upload-folder",title:"common.uploadfolder",secondary:"common.uploadfolderdescription",onClick:r,featureEnabled:!b}]},{key:"download-action",icon:"download-modus-icon",disable:!1,featureEnabled:b,onClick:l,title:"common.download",size:24,permissions:[E.project_fielddata_download]},{key:"move-action",icon:"move-modus-icon",disable:!1,featureEnabled:P,onClick:v,title:"common.move",size:24,permissions:[E.project_fielddata_download]},{key:"copy-action",icon:"copy-modus-icon",disable:!1,featureEnabled:P,onClick:f,title:"common.copy",size:24,permissions:[E.project_fielddata_download]},{key:"delete-action",icon:"delete-modus-icon",disable:x||!i&&T,featureEnabled:c&&b&&P,onClick:h,title:"common.delete",disabledTooltip:x?"connectedsite.deletefoldersnotallowedInProjects":!i&&T?"connectedsite.deletenonemptyfoldernotallowed":"",size:24,permissions:[E.project_fielddata_download]},{key:"deleted-items-action",icon:"deleted-items-modus-icon",disable:y,featureEnabled:!!s&&!t&&!b,onClick:F,title:"connectedsite.deletedItems",size:24}]},Js=(c,i)=>new no({searchItems:["entryName","modifyTime"],searchValue:c}).filterItems(c,[],i),Ks=new Fs({pollingInterval:5*1e3});function Xa({onClosePopup:c,appStore:i,selectionStore:t,accountRootStore:s,projectLibraryStore:o,fileManagerStore:a}){let r=Ja();const[l,h]=m.useState([]),[f,v]=m.useState([]),[w,F]=m.useState(r.sort.by),[g,M]=m.useState(r.sort.type),[S,y]=m.useState({by:r.sort.by,type:r.sort.type}),[b,_]=m.useState(""),[P,T]=m.useState("/Project Library"),[x,A]=m.useState([]),[V,L]=m.useState(!1),[Se,je]=m.useState(!1),[U,Z]=m.useState(!1),[q,Fe]=m.useState(null),[ze,xe]=m.useState([]),[Oe,se]=m.useState(!1),[me,ee]=m.useState([]),[K,Ie]=m.useState("/"),[Re,at]=m.useState(""),pe=Jt(),es=pe.formatMessage({id:"connectedsite.deletedata"}),it=pe.formatMessage({id:"common.delete"}),X=pe.formatMessage({id:"common.cancel"}),We=m.useRef(null),bt=m.useRef(null),J=s.accountStore.account.accountId,oe=s.accountSelectionStore.selectedDevice.deviceId,De=s.accountSelectionStore.selectedDevice.deviceType,Ce=s.accountSelectionStore.selectedDevice.rentorName,[nt,ct]=m.useState(!1),[qe,rt]=m.useState(""),[wt,Dt]=m.useState(!1),[Ue,Ye]=m.useState([]),[ts,ce]=m.useState(!1),[ke,He]=m.useState(null),[Ct,Nt]=m.useState(null),[ss,Le]=m.useState([]),[Q,te]=m.useState([]),Be=pe.formatMessage({id:"connectedsite.create"}),_e=pe.formatMessage({id:"common.createNewFolder"}),_t=Ee[q]?pe.formatMessage({id:"common.folderNavigatorOperationHeader"},{operation:pe.formatMessage({id:Ee[q]}),count:x.length}):"",z=p=>{const D=p.split("/").slice(2);return D.length>0?"/"+D.join("/")+"/":"/"},Ge=p=>((p==null?void 0:p.webkitRelativePath)||(p==null?void 0:p.name)||"").split("/").filter(
1Boolean)[0]||(p==null?void 0:p.name)||"",fe=(p=[])=>[...new Set(p.map(Ge))].map(C=>C==null?void 0:C.trim()).filter(Boolean).map(C=>({entryName:C,fieldDataId:C,isFolder:!0})),$e=()=>a.formatPathForApi(a.normalizeFolderPath(z(P))),be=()=>{const p=a.normalizeFolderPath(ke?`${K==="/"?"":K}/${ke.name}`:K),D=a.normalizeFolderPath(z(P));return p==="/"||p===D||x.some(C=>ke&&C.entryId===ke.id)};m.useEffect(()=>{if(!U||!K)return;const p=new AbortController;return(async()=>{se(!0),xe([]);try{const O=(await a.getDeviceFiles(J,oe,a.formatPathForApi(K),!0,p.signal)||[]).filter(k=>k.isFolder&&k.fileOperationStatus!=="UPLOAD_FOLDER_IN_PROGRESS").map(k=>({id:k.entryId||k.entryName,name:k.entryName}));xe(O)}catch(C){if((C==null?void 0:C.code)==="ERR_CANCELED"||(C==null?void 0:C.name)==="CanceledError"||(C==null?void 0:C.name)==="AbortError")return;xe([])}finally{p.signal.aborted||se(!1)}})(),()=>{p.abort()}},[J,K,oe,a,U]),m.useEffect(()=>{const p=D=>{(V||Ks.isPolling||a.downloadJobsPolling.isPolling||a.pendingDownloadJobs.length>0)&&(D.preventDefault(),D.returnValue="")};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[V,Ks.isPolling]);const Je=()=>{ut(),h([]),A([]),t.setSelectedItems([])},yt=async()=>{L(!0),i.setAlertMessages("connectedsite.downloadprogress",{},"","success","",!0);const p=await a.downloadDeviceFiles(J,oe,x,z(P)),D=p==null?void 0:p.downloadFileJobId;if(D){const O=`${P.split("/").filter(Boolean).pop()||"ProjectLibrary"}.zip`,k=x.length;a.enqueueDownloadJob({jobId:D,fileName:O,accountId:J,deviceId:oe,onComplete:W=>{const re=W==null?void 0:W.url;re&&(new st().downloadFromUrl(re,O),Te($.DOWNLOAD,k,De),i.setAlertMessages(),A([]),t.setSelectedItems([]))},onFailure:()=>{i.setAlertMessages("connectedsite.downloadfailure")}})}L(!1)},Ke=()=>{je(!0)},os=()=>{ct(!0)},Pt=()=>{Dt(!0),a.getDeletedContent(J),to(De)},as=()=>{Dt(!1),Ye([]),a.resetDeletedItems()},Ft=async()=>{eo(De,Ue.length),i.setAlertMessages("connectedsite.downloadprogress",{},"","success","",!0);const p=await a.downloadDeletedFiles(J,oe,Ue),D=p==null?void 0:p.downloadFileJobId;if(!D){i.setAlertMessages("connectedsite.downloadfailure");return}a.enqueueDownloadJob({jobId:D,fileName:"deleted-items.zip",accountId:J,deviceId:oe,onComplete:C=>{const O=C==null?void 0:C.url;O&&new st().downloadFromUrl(O,"deleted-items.zip"),i.setAlertMessages()},onFailure:()=>{i.setAlertMessages("connectedsite.downloadfailure")}})},It=m.useCallback(p=>{const D="/",C=z(P),O=a.getCurrentFolderName(C,D);Fe(p),Ie(C),at(O),ee(a.buildFolderBreadcrumbs(C,D)),xe([]),He(null),Z(!0)},[a,P]),Xe=()=>{It($.MOVE)},is=()=>{It($.COPY)},Rt=(p,D=[])=>{const C=new Set(D.map(k=>k.split("/").filter(Boolean).pop()).filter(Boolean)),O=C.size===0?x.map(k=>k.entryId):x.filter(k=>C.has(k.entryName)).map(k=>k.entryId);h(k=>k.map(W=>O.includes(W.entryId)?{...W,fileOperationStatus:p}:W))},ns=async p=>{var k;const D=Gt[q],C=Pe[q],O=((k=p==null?void 0:p.path)==null?void 0:k.length)||x.length;lt(),Rt(C,(p==null?void 0:p.path)||[]),i.setAlertMessages(D,{fileCount:O}),Te(q,O,De),await a.manageFolderEntries(J,p),L(!1),A([]),t.setSelectedItems([])},Me=()=>{ce(!1),Nt(null),Le([]),te([])},kt=async p=>{L(!0);try{await a.uploadFolder(J,oe,p,{path:z(P)}),Te($.UPLOAD_FOLDER,p.length,De)}catch{i.setAlertMessages("connectedsite.uploadfolersfailed")}finally{Je(),L(!1)}},cs=async({skipFiles:p})=>{const D=ss,C=Ct;if(Me(),C){const O=p.map(re=>re.entryName),k=C.path.filter(re=>!O.some(tt=>re.endsWith(`/${tt}`)));if(k.length===0)return;const W={...C,path:k};await ns(W);return}if(D.length>0){const O=new Set(p.map(W=>W.entryName)),k=D.filter(W=>!O.has(Ge(W)));if(k.length===0)return;await kt(k)}},lt=()=>{Z(!1),Fe(null),xe([]),se(!1),ee([]),Ie("/"),at(""),He(null)},rs=p=>{He(p)},dt=p=>{He(null),Ie(p),at(a.getCurrentFolderName(p,"/")),ee(a.buildFolderBreadcrumbs(p,"/"))},Mt=p=>{const D=K==="/"?`/${p.name}`:`${K}/${p.name}`;dt(D)},ls=()=>{const p=K.split("/").filter(Boolean);p.pop(),dt(`/${p.join("/")}`)},ds=p=>{dt(p||"/")},pt=()=>{const p=q.toUpperCase(),D=z(P),C=x.map(W=>`${D}${W.entryName}`),O={operation:p,parentEntryId:a.parentEntryId,path:C,deviceId:oe},k=ke?`${K==="/"?"":K}/${ke.name}`:K;return O.targetPath=a.formatPathForApi(k),O},At=async()=>{const p=pt();Z(!1),L(!0);try{const D=await a.checkForConflicts(J,oe,x,p.targetPath);if(D.length>0){L(!1),Nt(p),te(D),ce(!0);return}await ns(p)}catch{L(!1)}},Tt=()=>{je(!1)},Ze=()=>{rt(""),ct(!1)},ps=async()=>{ct(!1),L(!0);const p=await o.createFolder(J,oe,qe,z(P));L(!1),rt(""),p?Je():i.setAlertMessages("connectedsite.createfolderfailure")},ht=async()=>{var C;
1je(!1),L(!0),Rt(Pe[$.DELETE]),i.setAlertMessages(Gt[$.DELETE],co(x));let p;p=await o.deleteFolderEntries(J,oe,x,z(P)),L(!1);const D=((C=p==null?void 0:p.processedFilesList)==null?void 0:C.length)??x.length;Te($.DELETE,D,De),A([]),t.setSelectedItems([])},hs=()=>{var p;(p=We.current)==null||p.click()},us=()=>{var p;(p=bt.current)==null||p.click()},Et=z(P)==="/",Ot=!Et,Ut=P==="/Project Library/Projects",Lt=Ka({isFileExplorerDelete:i.features.fileExplorerDelete,folderContentsDelete:i.features.folderContentsDelete,isReadOnly:!!Ce,deletedItems:i.features.deletedItems,onRefreshClick:Je,onUploadClick:hs,onUploadFolderClick:us,onDownloadClick:yt,onDeleteClick:Ke,onCopyClick:is,onMoveClick:Xe,onCreateNewFolderClick:os,onDeletedItemsClick:Pt,selectedItems:x,showFolderOperationActions:Ot,isProjectsDirectory:Ut,isDeviceDataLoading:Et&&o.status!==he.COMPLETED}),Bt=Ot,$t={isBulkSelectable:!0,onMultiSelect:p=>{A([...p]),t.setSelectedItems(p)},itemKey:"entryId",checkedSelectedItems:x,disableProperty:"isProcessing"},Vt=p=>{v(Js(p,l)),_(p)},fs=()=>{Qe({sortBy:w,sortOrder:g,entryValues:l}),_("")},Qe=m.useCallback(({sortBy:p,sortOrder:D,entryValues:C})=>{p&&D&&(F(p),M(D),y({by:p,type:D}));const O=p||w,k=D||g;v(W=>{const re=C||W||[];if(re.length===0)return re;const tt=Xt(O,k,re),js=tt.filter(d=>d.isFolder),xs=tt.filter(d=>!d.isFolder);return[...js,...xs]})},[w,g]);m.useEffect(()=>{v(Js(b,l)),Qe({sortBy:w,sortOrder:g})},[l,b,w,Qe,g]);const gs=async p=>{if(p.isFolder){const D=`${P}/${p.entryName}`;h([]),v([]),T(D),A([]),t.setSelectedItems([])}},vs=async p=>{p!==""&&(h([]),v([]),T(p),A([]),t.setSelectedItems([]))},et=p=>{if(p.isProcessing||p.isFolder&&!Bt)return;const D=x.find(O=>O.entryId===p.entryId);let C=[];D?C=x.filter(O=>O.entryId!==p.entryId):C=[...x,p],A([...C]),t.setSelectedItems(C)},ut=m.useCallback(async()=>{h([]),v([]);try{const p=z(P),D=await o.getDeviceFiles(J,oe,p);h(D),a.fileSpaceId=o.fileSpaceId,a.parentEntryId=o.parentEntryId,Ro()}catch{h([]),v([])}},[J,oe,o,a,P]);m.useEffect(()=>{ut()},[ut]);const mt=async p=>{var O;const D=p==null?void 0:p.target,C=(O=D==null?void 0:D.files)!=null&&O.length?[...D.files]:null;if((C==null?void 0:C.length)>0){L(!0);const k=await o.uploadFiles(J,oe,C,z(P));L(!1);const W=k.processedFilesList;i.setAlertMessages("connectedsite.uploadprogresswithcount",{fileCount:W.length}),ko(C.length),Je()}D&&(D.value="")},Ss=async p=>{var O;const D=p==null?void 0:p.target,C=(O=D==null?void 0:D.files)!=null&&O.length?[...D.files]:null;try{if((C==null?void 0:C.length)>0){if(ho(C)){i.setAlertMessages("connectedsite.folderuploadmaxsizeexceeded",{},"","error"),D&&(D.value="");return}L(!0);const k=fe(C);if(k.length>0){const W=$e(),re=await a.checkForConflicts(J,oe,k,W,!0);if(re.length>0){L(!1),Le(C),te(re),ce(!0),D&&(D.value="");return}}await kt(C)}}catch(k){const W=(k==null?void 0:k.message)==="connectedsite.foldernameconflictswithfile"?k.message:"connectedsite.uploadfolersfailed";i.setAlertMessages(W,{},"","error")}finally{L(!1),D&&(D.value="")}};return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{type:"pagepopup",open:!0,title:e.jsx(n,{id:"common.projectlibrary"}),subtitle:e.jsx(n,{id:"common.allearthworkmachines"}),onClose:c,className:"project-library-popup",children:e.jsxs("div",{className:"popup-container",children:[e.jsx("div",{className:"search-container",children:e.jsx(Is,{placeholder:"connectedsite.searchplaceholder",onChange:Vt,onSearch:Vt,onClear:fs})}),e.jsx(ro,{columns:r.displayColumn,bulkActions:Lt,entries:f,currentPath:P,maxLevel:3,getData:gs,onPathClick:vs,status:o.status,sortConfig:S,onSort:Qe,multiSelectionConfig:$t,onRowSelect:et,isFolderDelete:i.features.fileExplorerDelete,isFolderOperationEnabled:Bt}),e.jsx("input",{type:"file",className:"upload-input",ref:We,multiple:"multiple",onChange:mt}),e.jsx("input",{type:"file",className:"upload-input",ref:bt,multiple:"multiple",webkitdirectory:"",directory:"",onCh
1ange:Ss}),e.jsx(xt,{attachmentType:"absolute",dimension:{width:"50px",height:"50px"},show:V}),e.jsx(Ne,{isOpen:Se,onDecline:Tt,onAccept:ht,headerText:es,acceptButtonText:it,declineButtonText:X,onClose:Tt,zIndex:10,dangerPrimaryButton:!0,children:e.jsxs("div",{className:"delete-confirmation-message",children:[e.jsx(n,{id:"connectedsite.deleteDataCommand"}),e.jsxs("ul",{children:[e.jsx("li",{children:e.jsx(n,{id:"connectedsite.deleteDataFromCloud"})}),e.jsx("li",{children:e.jsx(n,{id:"connectedsite.deleteDataFromDevice"})})]})]})}),e.jsxs(Ne,{isOpen:nt,onAccept:ps,onDecline:Ze,headerText:_e,acceptButtonText:Be,declineButtonText:X,onClose:Ze,zIndex:10,primaryButtonDisabled:!qe,children:[e.jsx("label",{children:e.jsx(n,{id:"common.foldername"})}),e.jsx("input",{type:"text",value:qe,onChange:p=>rt(p.target.value)})]}),e.jsx(Ts,{isOpen:U,headerText:_t,confirmButtonText:Ee[q]?pe.formatMessage({id:Ee[q]}):q,folders:ze,isLoading:Oe,breadcrumbs:me,currentFolderName:Re,showBackButton:K!=="/",onFolderClick:Mt,onFolderSelect:rs,onBackClick:ls,onBreadcrumbClick:ds,onConfirm:At,onCancel:lt,onClose:lt,disabledFolderIds:x.map(p=>p.entryId),confirmDisabled:be()}),e.jsx(Es,{isOpen:ts,message:pe.formatMessage({id:"connectedsite.replaceconfirmationmessage"}),files:Q,onReplace:cs,onCancel:Me,onClose:Me})]})}),e.jsx(Os,{open:wt,onClose:as,items:a.deletedItems,loadingStatus:a.deletedItemsStatus,checkedSelectedItems:Ue,onMultiSelect:p=>Ye(p),loadMore:p=>a.getDeletedContent(J,p),onDownload:Ft})]})}const Za=ue(de("appStore","selectionStore","accountRootStore","projectLibraryStore","fileManagerStore"),ie)(Xa);class mo extends I.Component{constructor(i){super(i),this.state={deviceStatus:oa(this.props.deviceStatus)},this.closePopup=this.closePopup.bind(this),this.notifyCopy=this.notifyCopy.bind(this)}closePopup(){this.props.closeAddDevice(),this.setState({deviceStatus:null})}notifyCopy(){ks(JSON.stringify(this.state.deviceStatus,null,4)),this.props.appStore.setAlertMessages("accountpage.infocopied",{},"accounts-copy","copied")}render(){return e.jsx(I.Fragment,{children:e.jsx(Ve,{type:"pagepopup",open:!0,title:`${this.props.appStore.localeMessages["connectedsite.devicestatus"]}: 
2            ${this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceName}`,onClose:this.closePopup,className:"device-status-info",children:e.jsxs("section",{children:[e.jsx(ot,{className:"json-container",children:this.state.deviceStatus?e.jsx(la,{src:this.state.deviceStatus,name:!1,iconStyle:"square",enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,sortKeys:!0}):""}),e.jsx("div",{children:e.jsxs("button",{onClick:this.notifyCopy,children:[e.jsx("i",{className:"icon i32 accounts-copy"}),"Copy"]})})]})})})}}mo.propTypes={closeAddDevice:u.func};const Qa=ue(de("appStore","accountRootStore"),ie)(mo),ei={account_device_info_panel_select:{fontSize:"12px",fontWeight:400,fontFamily:['"Open Sans"',"sans-serif"].join(", "),color:H.csgray2,"&:focus":{backgroundColor:"transparent"}},account_device_info_panel_input:{marginTop:"2px",paddingRight:"28px",paddingTop:0,paddingBottom:0,paddingLeft:"8px",marginLeft:"-8px","&:focus":{backgroundColor:"transparent"}},account_device_info_panel_icon:{top:"-2px"},account_device_info_panel_htmlTooltip:{backgroundColor:H.csgray2,color:"white",border:`1px solid ${H.csgray2}`,maxWidth:"none","& b":{fontWeight:700},"& .account_device_info_panel_warning":{color:H.cssecondarycolor,lineHeight:"16px",fontWeight:600},"& .account_device_info_panel_default":{lineHeight:"16px"}},account_device_info_panel_htmlTooltipArrow:{color:`${H.csgray2}`},account_device_info_panel_root:{width:240,marginTop:0,marginBottom:3,"& p":{marginTop:2,color:H.cswarningred2,fontSize:"0.75rem",textAlign:"left"}},account_device_info_panel_container:{display:"flex",flexWrap:"wrap"},account_device_info_panel_textInput:{width:"100%",height:"32px !important",background:"transparent !important"},account_device_info_panel_animated:{margin:"0 16px",color:H.csgray6,fontStyle:"italic",fontSize:14,lineHeight:1.2},account_device_info_panel_shrink:{color:`${H.csgray6} !important`,fontStyle:"normal"},account_device_info_panel_headerSection:{marginBottom:"0px !important",display:"flex",flexDirection:"column",alignItems:"center"},account_device_info_panel_cardAvatar:{backgroundColor:"transparent",marginBottom:0},account_device_info_panel_deviceAvatar:{img:{borderRadius:"0%"}},account_device_info_panel_avatarIcon:{"& .ec520-icon":{margin:"0 4px 2px 0px"},"& .warning-icon-light":{margin:"0 4px 12px 4px"}},account_device_info_panel_textarea:{resize:"none",border:`solid 1px ${H.csgray7}`,paddingLeft:"4px",paddingRight:"4px"},account_device_info_panel_deviceName:{display:"flex",marginTop:"1rem",width:"90%","&> h2":{display:"flex",flexDirection:"column",width:"100%",fontSize:"20px",fontWeight:"300 !important",color:H.csgray51},"&> div":{position:"absolute",right:"20px","&> i":{cursor:"pointer"}}},account_device_info_panel_name:{whiteSpace:"normal !important",wordWrap:"break-word"},account_device_info_panel_iconSection:{padding:"0 12px !important"},account_device_info_panel_loadingIcon:{width:"24px",height:"24px",position:"relative",curs
2or:"not-allowed",opacity:1},account_device_info_panel_accountDeviceIcon:{width:"28px !important",height:"28px !important",margin:"0 6px",padding:0,"&:hover":{cursor:"pointer"}},account_device_info_panel_deviceNotRegistered:{width:"100%",display:"flex",justifyContent:"center",marginTop:"24px"},account_device_info_panel_box:{height:"auto",width:"90%",border:`2px solid ${H.cswarningorange}`,borderRadius:"3px",backgroundColor:"rgba(255, 139, 0, 0.1)",padding:"14px 16px 16px 16px",color:H.csgray9,fontSize:"14px",lineHeight:"19px",fontWeight:300,whiteSpace:"pre-line"},account_device_info_panel_warn:{fontWeight:600,backgroundColor:`${H.cssecondarycolor} !important`,"&> label":{"&> span":{color:`${H.csgray2} !important`}}},account_device_info_panel_descriptionContainer:{padding:"0 12px",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",flex:1,backgroundColor:H.cswhite1,"&> button":{minWidth:"92%",left:"12px",[`@media ${H.breakmobile}`]:{minWidth:"94%"}}},account_device_info_panel_descriptionLabel:{fontSize:"12px",marginBottom:"4px","&> label":{"&> span":{color:H.csgray6}}},account_device_info_panel_descriptionArea:{marginBottom:"48px",[`@media ${H.breakmobile}`]:{marginBottom:"56px"},"&> textarea":{width:"100%"}},account_device_info_panel_expansionRoot:{padding:0,minHeight:17,boxShadow:"none",color:H.csgray2,width:"100%","&:not(:last-child)":{borderBottom:0},"&:before":{display:"none"},"&$expanded":{margin:"auto"}},root:{marginBottom:-1,minHeight:"17px !important",padding:0,"&$expanded":{minHeight:"17px !important"}},content:{margin:0,"&$expanded":{margin:0}},expanded:{margin:"0px !important"},account_device_info_panel_expansionDetailsRoot:{padding:"4px 0 0 0",flexDirection:"column",color:"red"},expandIcon:{transform:"rotate(0deg) !important",padding:"0",top:"-4px","&.Mui-expanded":{top:"-5px",transform:"rotate(180deg) !important"}}},Xs=734003200;class ti extends I.Component{constructor(t){super(t);ge(this,"cookie",new Mo);ge(this,"viewProjectLibrary",()=>{this.setState({isMCDataOpen:!1,isProjectLibraryOpen:!0})});ge(this,"closeProjectLibrary",()=>{this.setState({isProjectLibraryOpen:!1})});const{selectedDevice:s}=this.props.accountRootStore.accountSelectionStore;this.state={showNotification:!1,isEditEnabled:!1,showRemoveDeviceConfirmation:!1,acceptDisabled:!0,showStatusInfo:!1,formOpen:!1,deviceStatus:{},isRegistered:s.accountRegistrationStatus==="ACTIVE",tccStatus:null,selectedDevice:s,emptyText:"required",inputValue:"",warrantyOpen:!1,softwareOpen:!1,isMap:null,versions:{isUpToDate:!0},isLoading:!1,activeProjects:[],assignedProjectCount:null,assignedProjectsHasMore:!1,isAssignedProjectsLoading:!1,assignedProjectsDeviceId:null,showFirmareUpdate:!1,isFirmwareUpdateOpen:!1,scheduledFirmwareId:null,currentFirmwareVersion:null,scheduledFirmwareVersion:null,updateErrorDetails:null,displayCancelUpdateConfirmation:!1,isMCDataOpen:!1,showUnshareDeviceConfirmation:!1,showShareDevice:!1,isDeviceTccStatusChangeNotAllowed:!1,unshareInProgress:!1,showFileManager:!1,availableStorage:null,availableStorageFormatted:null,showMenu:!1,isProjectLibraryOpen:!1,menuOptions:{onClick:()=>{localStorage.setItem("device",JSON.stringify(this.props.accountRootStore.accountSelectionStore.selectedDevice)),this.cookie.get("redirectUri")&&this.cookie.remove("redirectUri",{path:"/"});const o=`${window.location.origin}/user/accounts/${this.props.accountRootStore.accountStore.account.accountId}/map?device=${this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceId}`;window.open(o,"_blank")}}},this.openStatusInfo=this.openStatusInfo.bind(this),this.closeStatusInfo=this.closeStatusInfo.bind(this),this.openRemoveDeviceConfirmation=this.openRemoveDeviceConfirmation.bind(this),this.closeRemoveDeviceConfirmation=this.closeRemoveDeviceConfirmation.bind(this),this.showCancelUpdateConfirmation=this.showCancelUpdateConfirmation.bind(this),this.closeCancelUpdateConfirmation=this.closeCancelUpdateConfirmation.bind(this),this.cancelUpdateFirmware=this.cancelUpdateFirmware.bind(this),this.onEnterPress=this.onEnterPress.bind(this),this.removeDevice=this.removeDevice.bind(this),this.checkSerialNumber=this.checkSerialNumber.bind(this),this.openEditDevice=this.openEditDevice.bind(this),this.closeEditDevice=this.closeEditDevice.bind(this),this.getFieldSoftware=this.getFieldSoftware.bind(this),this.toggleRegisteredStatus=this.toggleRegisteredStatus.bind(this),this.setTCCStatus=this.setTCCStatus.bind(this),this.checkDeviceName=this.checkDeviceName.bind(this),this.onNameChange=this.onNameChange.bind(this),this.getEntitlementStatus=this.getEntitlementStatus.bind(this),this.getDataForSelectedDevice=this.getDataForSelectedDevice.bind(this),this.getAssignedProjects=this.getAssignedProjects.bind(this),this.navigateToDevice=this.navigateToDevice.bind(this),this.navigateToManageProjects=this.navigateToManageProjects.bind(this),this.navigateToStatusMessage=this.navigateToStatusMessage.bind(this),this.handleStatusMessageClick=this.handleStatusMessageClick.bind(this),this.beginLoading=this.beginLoading.bind(this),this.finishLoading=this.finishLoading.bind(this),this.copySerialNumber=this.copySerialNumber.bind(this),this.show
2FirmareUpdateOption=this.showFirmareUpdateOption.bind(this),this.openFirmwareUpdate=this.openFirmwareUpdate.bind(this),this.closeFirmwareUpdate=this.closeFirmwareUpdate.bind(this),this.refreshDeviceFirmwareVersion=this.refreshDeviceFirmwareVersion.bind(this),this.openUnshareConfirmation=this.openUnshareConfirmation.bind(this),this.closeUnshareConfirmation=this.closeUnshareConfirmation.bind(this),this.unshareDevice=this.unshareDevice.bind(this),this.closeShareAccountDevice=this.closeShareAccountDevice.bind(this),this.openShareAccountDevice=this.openShareAccountDevice.bind(this),this.clearSelectedDevice=this.clearSelectedDevice.bind(this),this.deviceService=new Ao,this.openMCData=this.openMCData.bind(this),this.closeMCData=this.closeMCData.bind(this),this.openFileManager=this.openFileManager.bind(this),this.closeFileManager=this.closeFileManager.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.closeMenu=this.closeMenu.bind(this),this.assignedProjectsRequestId=0,this.assignedProjectsAbortController=null}openFileManager(){this.setState({showFileManager:!0}),To(this.state.selectedDevice.deviceType)}closeFileManager(){this.setState({showFileManager:!1})}openUnshareConfirmation(){this.setState({showUnshareDeviceConfirmation:!0})}closeUnshareConfirmation(){this.setState({showUnshareDeviceConfirmation:!1})}closeShareAccountDevice({sharedDevices:t=[],renteeName:s}={}){this.setState({showShareDevice:!1}),t.length>0&&this.props.accountRootStore.accountDeviceStore.setDeviceShareStatus(t,s)}openShareAccountDevice(){this.setState({showShareDevice:!0})}clearSelectedDevice(){this.props.accountRootStore.accountSelectionStore.setSelectedDevice(null)}componentDidMount(){const t=this.props.location.pathname,s=t.split("/")[t.split("/").length-1]==="map";this.setState({isMap:s}),s?this.setTCCStatus():this.getDataForSelectedDevice(this.props.accountRootStore.accountSelectionStore.selectedDevice),this.connectURLObserve=so(this.props.accountRootStore.accountSelectionStore,"selectedDevice",o=>{if(o.newValue){this.getDataForSelectedDevice(o.newValue);const a=this.props.location.pathname,r=a.split("/")[a.split("/").length-1]==="map";this.setState({isRegistered:o.newValue.accountRegistrationStatus==="ACTIVE",isMap:r})}}),this.props.appStore.features.otaFirmwareUpdate&&this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceType==="EC520"&&this.getDeviceFirmwareVersion()}async getDataForSelectedDevice(t){var r;const s=!!(t!=null&&t.deviceId);this.setState({deviceStatus:{},isRegistered:this.props.accountRootStore.accountSelectionStore.selectedDevice.accountRegistrationStatus==="ACTIVE",versions:{isUpToDate:!0,isWarrantyExpired:!1},assignedProjectCount:null,assignedProjectsHasMore:!1,isAssignedProjectsLoading:s,assignedProjectsDeviceId:s?t.deviceId:null}),s&&this.getAssignedProjects(t.deviceId);const o=await this.setTCCStatus(),a=o==null?void 0:o.swWarrantyExpUtc;if(this.setState({availableStorage:o==null?void 0:o.freeSpace,antennaType:o==null?void 0:o.antennaType,baseStationName:o==null?void 0:o.baseStationName,noOfSatellites:(r=o==null?void 0:o.gnss)==null?void 0:r.length}),t.deviceType==="Tablet"||t.deviceType==="EM"||t.deviceType==="TSC3")this.getEntitlementStatus(t,o);else if(t.deviceType==="EC520"&&a){let l=!1;+new Date(a)<=+new Date&&(l=!0);let h={warrantyDate:zs(a),isWarrantyExpired:l};this.setState({versions:h})}}componentDidUpdate(t){var o,a;const{selectedDevice:s}=this.props.accountRootStore.accountSelectionStore;s&&s.deviceId!==((o=this.state.selectedDevice)==null?void 0:o.deviceId)?(this.setState({selectedDevice:s,helperText:"required",inputValue:"",activeProjects:[],assignedProjectCount:null,assignedProjectsHasMore:!1,scheduledFirmwareVersion:null,showFirmareUpdate:!1}),this.refreshDeviceFirmwareVersion()):s&&s.tccDeviceStatus!==((a=this.state.selectedDevice)==null?void 0:a.tccDeviceStatus)&&this.setState({selectedDevice:s})}async getAssignedProjects(t){var a,r;const s=this.assignedProjectsRequestId+1;this.assignedProjectsRequestId=s,this.assignedProjectsAbortController&&this.assignedProjectsAbortController.abort();const o=new AbortController;this.assignedProjectsAbortController=o,this.setState({assignedProjectCount:null,assignedProjectsHasMore:!1,isAssignedProjectsLoading:!0,assignedProjectsDeviceId:t});try{const l=await this.props.accountRootStore.accountDeviceStore.loadDeviceProjects(t,o.signal),h=(a=this.props.accountRootStore.accountSelectionStore.selectedDevice)==null?void 0:a.deviceId;if(s!==this.assignedProjectsRequestId||h!==t)return;this.setState({assignedProjectCount:((r=l==null?void 0:l.projects)==null?void 0:r.length)||0,assignedProjectsHasMore:(l==null?void 0:l.hasMore)||!1,isAssignedProjectsLoading:!1,assignedProjectsDeviceId:t})}catch{if(s!==this.assignedProjectsRequestId||o.signal.aborted)return;this.setState({assignedProjectCount:null,assignedProjectsHasMore:!1,isAssignedProjectsLoading:!1,assignedProjectsDeviceId:t})}}refreshDeviceFirmwareVersion(){this.props.appStore.features.otaFirmwareUpdate&&this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceType==="EC520"&&this.getDeviceFirmwareVersion()}openRemoveDeviceConfirmation(){this.setState({showRemoveDeviceConfirmation:!0,acceptDisabled:!0})}closeRemoveDeviceConfirmation(){this.setState({showRemoveDeviceConfirmation:!1,acceptDisabled:!0,serialNumber:""})}openMCData(){this.setState({isMCDataOpen:!0}),Eo(this.state.selectedDevice.deviceType)}closeMCData(){this.setState({isMCDataOpen:!1})}async getDeviceFirmwareVersion(){const t=this.props.accountRootStore.accountSelectionStore.selectedDevice,s=`${t.deviceType}-${t.serialNumber}`,o=await this.props.accountRootStore.accountDeviceStore.getFirmwareVersionForDevices([s]);if(o&&o.length){const{currentFirmwareVersion:a,scheduledFirmwareVersion:r,scheduledFirmwareId:l,updateErrorDetails:h}=o[0];this.setState({currentFirmwareVersion:a,scheduledFirmwareVersion:r,scheduledFirmwareId:l,updateErrorDetails:h}
2),a&&!r?this.showFirmareUpdateOption(a):this.setState({showFirmareUpdate:!1})}}async showFirmareUpdateOption(t){(await this.props.accountRootStore.accountDeviceStore.getFirmwareListInfo(this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceType,t)).length>0&&this.setState({showFirmareUpdate:!0})}openFirmwareUpdate(){this.setState({isFirmwareUpdateOpen:!0})}closeFirmwareUpdate(){this.setState({isFirmwareUpdateOpen:!1})}showCancelUpdateConfirmation(){this.setState({displayCancelUpdateConfirmation:!0})}closeCancelUpdateConfirmation(){this.setState({displayCancelUpdateConfirmation:!1})}async cancelUpdateFirmware(){const t=this.state.selectedDevice,s=await this.props.accountRootStore.accountDeviceStore.cancelUpdateFirmware(this.state.scheduledFirmwareId,t.deviceType,[t.serialNumber]);this.closeCancelUpdateConfirmation(),s.status===200?(this.props.appStore.setAlertMessages("accountpage.firmwareupdatecanceled"),this.refreshDeviceFirmwareVersion()):this.props.appStore.setAlertMessages("accountpage.unabletocancelupdate")}async removeDevice(){this.closeRemoveDeviceConfirmation(),this.beginLoading();const t=ve.receiver.includes(this.props.accountRootStore.accountDeviceStore.accountSelectionStore.selectedDevice.deviceType);await this.props.accountRootStore.accountDeviceStore.acceptRemoveDevice(),this.finishLoading(),t?Oo():Uo()}checkSerialNumber(t){const s=t.target.value.replace(/ /g,"");s===this.state.selectedDevice.serialNumber?this.setState({acceptDisabled:!1,serialNumber:s}):s!==this.state.selectedDevice.serialNumber&&!this.state.acceptDisabled?this.setState({acceptDisabled:!0,serialNumber:s}):this.setState({serialNumber:s})}async unshareDevice(){const t=this.state.selectedDevice.deviceId,s=this.state.selectedDevice.deviceName,o=this.state.selectedDevice.renteeName;this.setState({unshareInProgress:!0}),this.closeUnshareConfirmation();try{await this.props.accountRootStore.accountDeviceStore.unshareDevice(t,s,o),this.props.accountRootStore.accountDeviceStore.setDeviceUnshareStatus(t),Lo()}catch{}this.setState({unshareInProgress:!1})}formatVersion(t,s){if(s==="Tablet"&&t)return{major:+t.split(".").splice(0,1)[0],minor:+t.split(".").splice(1,1)[0],patch:+t.split(".").splice(3,1)[0]}}async getEntitlementStatus(t,s){const o=await this.props.accountRootStore.accountDeviceStore.getEntitlementStatus(t);let a=!1,{maxVersionAllowed:r,releasedVersion:l,warrantyDate:h}=Bo(o,$o(t));h&&+new Date(h)<=+new Date&&(a=!0);let f={max:r,released:l,warrantyDate:zs(h),isWarrantyExpired:a};if(s&&l){let v=!0;const w=this.formatVersion(l,t.deviceType),F=this.formatVersion(s.appVersion,t.deviceType),g=s.appName.replace("Trimble ","");F.major===w.major&&F.minor===w.minor?F.patch<w.patch&&(v=!1):v=!1,f.deviceVersion=s.appVersion,f.isUpToDate=v,f.firmware=g}this.setState({versions:f})}async setTCCStatus(){const t=await this.props.accountRootStore.accountDeviceStore.getDeviceStatusInfo();if(this.setState({deviceStatus:t,tccStatus:this.props.accountRootStore.accountSelectionStore.selectedDevice.tccDeviceStatus}),t.projects){const{accountProjects:s}=this.props.accountRootStore.accountDeviceStore,o=await this.props.accountRootStore.accountDeviceStore.getActiveProjects(t,s);this.setState({activeProjects:o})}return t}componentWillUnmount(){this.assignedProjectsRequestId+=1,this.assignedProjectsAbortController&&(this.assignedProjectsAbortController.abort(),this.assignedProjectsAbortController=null),this.connectURLObserve(),this.observeDeviceStatus&&this.observeDeviceStatus(),this.props.accountRootStore.accountSelectionStore.setSelectedDevice(null)}openStatusInfo(){this.setState({showStatusInfo:!0})}closeStatusInfo(){this.setState({showStatusInfo:!1})}openEditDevice(){this.setState({formOpen:!0})}closeEditDevice(){this.setState({formOpen:!1})}beginLoading(){this.setState({isLoading:!0})}finishLoading(){this.setState({isLoading:!1})}getFieldSoftware(){let t={version:"-",fieldName:e.jsx(n,{id:"connectedsite.fieldsoftware"})},s;return this.props.appStore.features.otaFirmwareUpdate&&this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceType==="EC520"&&(s=this.state.scheduledFirmwareVersion?this.state.updateErrorDetails===null?`${this.state.scheduledFirmwareVersion} (Pending)`:this.state.scheduledFirmwareVersion:this.state.currentFirmwareVersion),s?t.version=`${s}`:this.state.deviceStatus.appVersion?t.version=`${this.state.deviceStatus.appVersion}
2`:this.state.versions.max&&(t={version:`${this.state.versions.max}`,fieldName:e.jsx(n,{id:"connectedsite.entitledversion"})}),t}async toggleRegisteredStatus(t){if(t.item.isShared)this.setState({isDeviceTccStatusChangeNotAllowed:!0});else{this.setState({tccStatus:t.value});const s=await this.props.accountRootStore.accountDeviceStore.toggleRegisteredStatus(t);s.status===204||s.status===201?(this.props.appStore.setAlertMessages("accountpage.tccstatussuccessful",{status:t.value==="Registered"?"Licensed":"Not Licensed",deviceName:t.item.deviceName},null),Vo(t.value==="Registered")):this.props.appStore.setAlertMessages("errormsg.tccstatusfailed",{},null,"error")}}onEnterPress(t){t.key==="Enter"&&(t.preventDefault(),this.checkDeviceName())}async checkDeviceName(){const t=this.state.inputValue,s=this.state.selectedDevice.deviceName;let o=null;if(!t)o="required";else if(!va(t))o="invalid";else{this.setState(a=>({selectedDevice:{...a.selectedDevice,unnamed:!1,deviceName:t}}));try{await this.props.accountRootStore.accountDeviceStore.updateDevice({deviceName:t})}catch{this.setState(r=>({selectedDevice:{...r.selectedDevice,unnamed:!0,deviceName:s}}))}}this.setState({emptyText:o})}onNameChange(t){this.setState({inputValue:t.target.value})}navigateToDevice(){this.props.appStore.navigateToDevice(this.props.accountRootStore.accountSelectionStore.selectedDevice),zo()}navigateToManageProjects(){const t=this.props.accountRootStore.accountStore.account.accountId,s=this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceId;this.props.navigate(`/user/accounts/${t}/devices/${s}/projects`)}navigateToStatusMessage(){const t=this.props.accountRootStore.accountStore.account.accountId,s=this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceId,o=this.props.accountRootStore.accountDeviceStore.searchValue;this.props.navigate(`/user/accounts/${t}/devices/${s}/status`,o?{state:{searchHighlight:o}}:void 0)}handleStatusMessageClick(){if(this.props.appStore.features.deviceStatusMessage){this.navigateToStatusMessage();return}this.openStatusInfo()}handleContextMenu(t){t.preventDefault(),this.setState({showMenu:!0})}closeMenu(){this.setState({showMenu:!1})}renderTooltip(t){const s=new oo(window.navigator.userAgent),o=s.tablet(),a=s.mobile(),{deviceVersion:r,max:l,released:h,firmware:f}=this.state.versions;let v,w,F,g;if(t==="warranty")return w=()=>this.setState({warrantyOpen:!1}),F=()=>this.setState({warrantyOpen:!this.state.warrantyOpen,softwareOpen:!1}),g=this.state.warrantyOpen,v=e.jsxs(I.Fragment,{children:[e.jsx(n,{id:"connectedsite.expiredwarranty",className:"account_device_info_panel_default"}),e.jsx("br",{}),e.jsx(n,{id:"connectedsite.contactdealer",className:"account_device_info_panel_default"})]}),a||o?e.jsx(Ds,{onClickAway:w,children:e.jsx(le,{open:g,onClick:F,classes:{tooltip:this.props.classes.account_device_info_panel_htmlTooltip,arrow:this.props.classes.account_device_info_panel_htmlTooltipArrow},arrow:!0,title:v,placement:"left",children:e.jsx("span",{className:"icon i24 information-icon"})})}):e.jsx(le,{classes:{tooltip:this.props.classes.account_device_info_panel_htmlTooltip,arrow:this.props.classes.account_device_info_panel_htmlTooltipArrow},arrow:!0,title:v,placement:"left",children:e.jsx("span",{className:"icon i24 information-icon"})});if(t==="storage")return w=()=>this.setState({storageTooltipOpen:!1}),F=()=>this.setState({warrantyOpen:!1,storageTooltipOpen:!this.state.storageTooltipOpen,softwareOpen:!1}),g=this.state.storageTooltipOpen,v=e.jsx(n,{id:"accountpage.availablestoragewarning",className:"account_device_info_panel_default"}),a||o?e.jsx(Ds,{onClickAway:w,children:e.jsx(le,{open:g,onClick:F,classes:{tooltip:this.props.classes.account_device_info_panel_htmlTooltip,arrow:this.props.classes.account_device_info_panel_htmlTooltipArrow},arrow:!0,title:v,placement:"left",children:e.jsx("span",{className:"icon i24 information-icon"})})}):e.jsx(le,{classes:{tooltip:this.props.classes.account_device_info_panel_htmlTooltip,arrow:this.props.classes.account_device_info_panel_htmlTooltipArrow},arrow:!0,title:v,placement:"left",children:e.jsx("span",{className:"icon i24 information-icon"})});if(r&&l&&h&&t!=="warranty")return w=()=>this.setState({softwareOpen:!1}),F=()=>this.setState({softwareOpen:!this.state.softwareOpen,warrantyOpen:!1}),g=this.state.softwareOpen,v=e.jsxs(I.Fragment,{children:[e.jsxs("span",{className:`${this.state.ver
2sions.isUpToDate?"":"account_device_info_panel_warning"}`,children:[e.jsx(n,{id:"connectedsite.reporting"}),` - ${f} ${r}`]}),e.jsx("br",{}),e.jsxs("span",{className:"account_device_info_panel_default",children:[e.jsx(n,{id:"connectedsite.warranty"}),` - ${f} ${l}`]}),e.jsx("br",{}),e.jsxs("span",{className:"account_device_info_panel_default",children:[e.jsx(n,{id:"connectedsite.latest"}),` - ${f} ${h}`]})]}),a||o?e.jsx(Ds,{onClickAway:w,children:e.jsx(le,{open:g,onClick:F,classes:{tooltip:this.props.classes.account_device_info_panel_htmlTooltip,arrow:this.props.classes.account_device_info_panel_htmlTooltipArrow},arrow:!0,title:v,placement:"left",children:e.jsx("span",{className:"icon i24 information-icon"})})}):e.jsx(le,{classes:{tooltip:this.props.classes.account_device_info_panel_htmlTooltip,arrow:this.props.classes.account_device_info_panel_htmlTooltipArrow},arrow:!0,title:v,placement:"left",children:e.jsx("span",{className:"icon i24 information-icon"})})}renderInfo(t){var a,r,l,h,f;const s=ve.receiver.includes(t.deviceType),o=t.rentorName;if(this.state.isRegistered||o){let v;if(this.state.activeProjects.length===1){const b=this.state.activeProjects[0];v=e.jsxs(I.Fragment,{children:[e.jsx("label",{children:e.jsx(n,{id:"accountpage.activeproject"})}),b.projectRole!=="notMember"?e.jsx("span",{className:"value",children:e.jsx("a",{className:"value",title:b.projectName,href:`/user/projects/${b.projectId}/dashboard`,children:b.projectName})}):e.jsx("span",{className:"value",title:b.projectName,children:b.projectName})]})}else if(this.state.activeProjects.length>1){const b=e.jsx("ul",{className:"active-projects-tooltip__list",children:this.state.activeProjects.map((_,P)=>e.jsx("li",{children:_.projectRole!=="notMember"?e.jsx("a",{className:"active-projects-tooltip__link",title:_.projectName,href:`/user/projects/${_.projectId}/dashboard`,children:_.projectName}):_.projectName},_.projectId||P))});v=e.jsxs(I.Fragment,{children:[e.jsx("label",{children:e.jsx(n,{id:"accountpage.activeproject"})}),e.jsxs("span",{className:"value active-projects-count",children:[e.jsx("span",{className:"active-projects-count__number",children:this.state.activeProjects.length}),e.jsx(le,{arrow:!0,interactive:!0,placement:"top",leaveDelay:300,classes:{tooltip:`${this.props.classes.account_device_info_panel_htmlTooltip} active-projects-tooltip`,arrow:`${this.props.classes.account_device_info_panel_htmlTooltipArrow} active-projects-tooltip-arrow`},title:b,children:e.jsx("span",{className:"icon i20 information-icon-grey active-projects-count__icon","aria-hidden":"true"})})]})]})}else v=e.jsxs(I.Fragment,{children:[e.jsx("label",{children:e.jsx(n,{id:"accountpage.activeproject"})}),e.jsx("span",{className:"value",title:"-",children:"-"})]});const w=(r=(a=this.state)==null?void 0:a.versions)!=null&&r.warrantyDate?ae(this.state.versions.warrantyDate).format("MMM D, YYYY"):"-",F=(l=this.state.updateErrorDetails)!=null&&l.errorMessage?e.jsx(le,{title:e.jsxs("div",{className:"status-message",children:[e.jsx(n,{id:"errormsg.erroroccurredforfirmwareupgrade",values:{error:(h=this.state.updateErrorDetails)==null?void 0:h.errorMessage}}),this.state.scheduledFirmwareVersion?"":e.jsx(n,{id:"errormsg.firmwarehasbeenreset"})]}),placement:"bottom",arrow:!0,children:e.jsx("span",{className:"icon i24 warning-icon"})}):"",g=e.jsx(n,{id:"connectedsite.talicensenotrequired"}),M=e.jsx(le,{classes:{tooltip:this.props.classes.account_device_info_panel_htmlTooltip},title:g,placement:"left",children:e.jsx("span",{className:"icon i24 information-icon ta-info"})}),S=this.state.selectedDevice.rentorName;let y=!1;return(this.props.accountRootStore.accountDeviceStore.licenseInfo.licenseCount===this.props.accountRootStore.accountDeviceStore.licenseInfo.licensesUsed&&this.props.accountRootStore.accountSelectionStore.selectedDevice.tccDeviceStatus==="Pending"||S)&&(y=!0),e.jsx(ot,{children:e.jsx("section",{className:"info-data",children:e.jsxs("ul",{children:[this.state.isMap?null:e.jsxs(I.Fragment,{children:[e.jsxs("li",{className:"list-item",children:[e.jsx("label",{children:e.jsx(n,{id:"common.status"})}),this.props.accountRootStore.accountSelectionStore.selectedDevice.deviceType!=="TA"?e.jsxs(As,{native:!0,disableUnderline:!0,value:this.state.tccStatus||"",inputProps:{name:"tccStatus",id:"tcc-status"},classes:{select:this.props.classes.account_device_info_panel_input},disabled:y,className:this.props.classes.account_device_info_panel_select,onChange:b=>this.toggleRegisteredStatus({value:b.target.value,item:this.props.accountRootStore.accountSelectionStore.selectedDevice}),IconComponent:b=>e.jsx("i",{className:`icon i24 accounts-list-down-arrow ${b.className}
3                    ${this.props.classes.account_device_info_panel_icon}`}),children:[e.jsx(n,{id:"accountpage.licensed",children:b=>e.jsx("option",{value:"Registered",children:b[0]})}),e.jsx(n,{id:"accountpage.notlicensed",children:b=>e.jsx("option",{value:"Pending",children:b[0]})})]}):e.jsxs("div",{className:"license-not-possible",children:[e.jsx("p",{children:e.jsx(n,{id:"accountpage.notlicensed"})}),M]})]}),S?"":e.jsx("li",{className:"list-item",children:v||"-"}),this.renderProjectAssigned()]}),this.props.appStore.features.sharedevices&&t.isShared&&t.renteeName?e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"accountpage.sharedaccount"})}),e.jsxs("span",{className:"value",children:[e.jsx("span",{title:t.renteeName,children:t.renteeName}),e.jsx("div",{className:"value link_text",onClick:this.openUnshareConfirmation,children:e.jsx(n,{id:"accountpage.unsharedevice"})})]})]}):"",this.props.appStore.features.sharedevices&&S?e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.ownedby"})}),e.jsx("span",{className:"value",title:S,children:S})]}):"",e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"common.devicetype"})}),e.jsx("span",{className:"value",title:Ws(t),children:Ws(t)})]}),s?e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"accountpage.antennatype"})}),e.jsx("span",{className:"value",title:this.state.antennaType||"-",children:this.state.antennaType||"-"})]}):"",e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.serialnumber"})}),e.jsx("span",{className:"value",title:t.serialNumber||"-",children:t.serialNumber||"-"})]}),s?e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"accountpage.basename"})}),e.jsx("span",{className:"value",title:this.state.baseStationName||"-",children:this.state.baseStationName||"-"})]}):"",s?e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"accountpage.noofsatellites"})}),e.jsx("span",{className:"value",children:this.state.noOfSatellites||"-"})]}):"",S?"":e.jsxs("li",{className:"list-item",children:[e.jsx("label",{children:e.jsx(n,{id:"connectedsite.lastreported"})}),e.jsx("span",{className:"value",children:t.lastReported?e.jsxs("span",{children:[ae(t.lastReported).format("MMM D, YYYY"),e.jsx("br",{}),ae(t.lastReported).format("h:mm a")]}):"-"})]}
3),S?"":e.jsxs("li",{className:`list-item ${this.state.versions.isUpToDate===!1?this.props.classes.account_device_info_panel_warn:""}`,children:[e.jsx("label",{className:G.field,children:this.getFieldSoftware().fieldName}),e.jsxs("span",{className:"value",children:[e.jsxs("span",{className:"fieldsoftware",children:[this.getFieldSoftware().version,F]}),t.deviceType==="EC520"&&this.state.scheduledFirmwareVersion?e.jsx("button",{className:"button cancel-update-btn",onClick:this.showCancelUpdateConfirmation,children:e.jsx(n,{id:"accountpage.cancelupdate"})}):t.deviceType==="EC520"&&this.state.showFirmareUpdate&&(this.props.appStore.features.otaSupportForRW||((f=this.state.deviceStatus)==null?void 0:f.appName)!=="Roadworks")?e.jsx("span",{className:"value link_text update-link-text",onClick:this.openFirmwareUpdate,children:e.jsx(n,{id:"accountpage.firmwareupdate"})}):""]}),this.renderTooltip("firmware")]}),!S&&t.deviceType==="Tablet"||w!=="-"&&t.deviceType==="EC520"?e.jsxs("li",{className:`list-item ${this.state.versions.isWarrantyExpired?this.props.classes.account_device_info_panel_warn:""}`,children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.warrantydate"})}),e.jsx("span",{className:"value warranty-value",title:w,children:w}),this.state.versions.isWarrantyExpired?this.renderTooltip("warranty"):""]}):"",this.state.availableStorage&&e.jsxs("li",{className:`list-item ${this.state.availableStorage<Xs?this.props.classes.account_device_info_panel_warn:""}`,children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"accountpage.availablestorage"})}),e.jsx("span",{className:"value available-space-value",title:Gs(this.state.availableStorage),children:Gs(this.state.availableStorage)}),this.state.availableStorage<Xs?this.renderTooltip("storage"):""]})]})})})}return e.jsx(ot,{children:e.jsxs("section",{className:"info-data",children:[e.jsxs("ul",{children:[e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"common.devicetype"})}),e.jsx("span",{className:"value",title:t.deviceType||"-",children:t.deviceType||"-"})]}),e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.serialnumber"})}),e.jsx("span",{className:"value",title:t.serialNumber||"-",children:t.serialNumber||"-"})]}),e.jsxs("li",{className:"list-item",children:[e.jsx("label",{children:e.jsx(n,{id:"connectedsite.lastreported"})}),e.jsx("span",{className:"value",children:e.jsx(n,{id:"accountpage.devicenotclaimed"})})]})]}),e.jsx("div",{className:this.props.classes.account_device_info_panel_deviceNotRegistered,children:e.jsx("div",{className:this.props.classes.account_device_info_panel_box,children:e.jsx(n,{id:"accountpage.devicenotregistered"})})})]})})}renderProjectAssigned(){var w;const{assignedProjectCount:t,assignedProjectsHasMore:s,isAssignedProjectsLoading:o,assignedProjectsDeviceId:a}=this.state,r=(w=this.props.accountRootStore.accountSelectionStore.selectedDevice)==null?void 0:w.deviceId,l=o||r&&a!==r,h=t>0,f=h?`${t}${s?"+":""}`:"-",v=!l&&h;return e.jsxs("li",{className:"list-item project-assigned-row",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"accountpage.projectassigned"})}),e.jsxs("span",{className:"value project-assigned-value",title:l?"":f,children:[l?e.jsx("img",{src:Ps,alt:"loading icon",className:`project-assigned-loading-icon ${this.props.classes.account_device_info_panel_loadingIcon||""}`}):e.jsx("span",{children:f}),v&&e.jsx(ne,{scopes:[E.account_device_update],children:e.jsx(n,{id:"accountpage.editprojectassigned",children:F=>e.jsx(qt,{text:F[0],position:"top",children:e.jsx("span",{className:`icon i16 accounts-edit project-assigned-edit-icon ${this.props.classes.account_device_info_panel_accountDeviceIcon}`,onClick:this.navigateToManageProjects})})})})]})]})}renderDeviceIcon(t){let s;return t.accountRegistrationStatus==="PENDING"||t.unnamed?s="WARNING":s=t.iconType,St[s]?St[s].iconMapping:St[t.deviceType.toUpperCase()].iconMapping}renderFormField(){const{classes:t}=this.props;let s;switch(this.state.emptyText){case"required":s=e.jsx(n,{id:"connectedsite.required"});break;
3case"invalid":s=e.jsx(n,{id:"errormsg.devicenamevalidation"});break;default:s=null;break}return e.jsx(ua,{label:e.jsx(n,{id:"connectedsite.deviceawaitingstatus"}),classes:{root:t.account_device_info_panel_root},margin:"normal",InputProps:{classes:{input:t.account_device_info_panel_textInput},disableUnderline:!0},InputLabelProps:{classes:{animated:t.account_device_info_panel_animated,shrink:t.account_device_info_panel_shrink}},helperText:s,onBlur:this.checkDeviceName,onChange:this.onNameChange,onKeyPress:o=>{this.onEnterPress(o)}})}copySerialNumber(t){ks(t),this.props.appStore.setAlertMessages("accountpage.serialnumbercopied",{},"accounts-copy","success")}render(){const t=this.state.selectedDevice,s=this.renderDeviceIcon(t),o=this.state.deviceStatus&&Object.entries(this.state.deviceStatus).length===0,a=this.state.isRegistered&&t.tccDeviceStatus==="Registered",r=t.rentorName;let l="",h="",f="",v="",w="",F="",g="",M="",S="",y="";this.props.appStore.features.sharedevices&&t.isShared&&(g="share-overlay-icon");const{showMenu:b,menuOptions:_}=this.state;if(this.state.isMCDataOpen&&(F=e.jsx(Ga,{closeMCData:this.closeMCData,device:t,deviceService:this.deviceService,openProjectLibrary:this.viewProjectLibrary})),this.state.showStatusInfo&&(l=e.jsx(Qa,{closeAddDevice:this.closeStatusInfo,deviceStatus:this.state.deviceStatus})),this.state.formOpen&&(h=e.jsx(Da,{closePopup:this.closeEditDevice,beginLoading:this.beginLoading,finishLoading:this.finishLoading,updatedName:this.state.selectedDevice.deviceName,reloadAfterAdd:!1,formType:"edit",isMap:this.state.isMap})),this.state.showShareDevice&&(S=e.jsx(Ca,{onClosePopup:this.closeShareAccountDevice,selectedDevices:[this.state.selectedDevice]})),this.state.showFileManager&&(M=e.jsx(Va,{onClosePopup:this.closeFileManager})),this.state.isProjectLibraryOpen&&(y=e.jsx(Za,{onClosePopup:this.closeProjectLibrary})),t.unnamed?f=this.renderFormField():f=e.jsx("section",{className:`${this.props.classes.account_device_info_panel_deviceName} ${this.state.isEditEnabled?"hide":""}`,children:e.jsx("h2",{className:this.props.classes.account_device_info_panel_name,children:t.deviceName||"-"})}),this.state.isFirmwareUpdateOpen){const P={...this.state.selectedDevice,currentFirmwareVersion:this.state.currentFirmwareVersion};let T=!1;const x=this.state.deviceStatus.assetType;if(x){const A=x.replaceAll(" ","").toUpperCase();T=ve.RoadWorksAssets.indexOf(A)>-1||this.state.deviceStatus.appName==="Roadworks"}w=e.jsx(qa,{closeFirmwareUpdate:this.closeFirmwareUpdate,selectedDevice:P,refreshDeviceFirmwareVersion:this.refreshDeviceFirmwareVersion,isRWDevice:T})}if(t){const P=ve.GCS900.includes(t.deviceType),T=ve.Earthworks.includes(t.deviceType),x=ve.SiteCollectorDevices.includes(t.deviceType),A=ve.GroundworkDevices.includes(t.deviceType);v=e.jsxs(I.Fragment,{children:[l,h,w,F,S,M,y,e.jsxs("section",{className:this.props.classes.account_device_info_panel_headerSection,children:[e.jsx("div",{className:"avatar-wrapper",children:e.jsxs("div",{className:`${this.props.classes.account_device_info_panel_cardAvatar} card-avatar`,children:[e.jsx(Wo,{baseIcon:s,baseIconSize:"i88",overlayIcon:g,overlayIconSize:"i32"}),e.jsx("img",{src:Ps,alt:"loading icon",className:`device-info-panel-icon loading-icon ${this.state.isLoading?"":"hide"}`})]})}),f]}),e.jsx(ne,{scopes:[E.account_device_view,E.account_device_update,E.account_device_delete,E.account_device_support],children:e.jsxs("section",{className:`icon-section ${this.props.classes.account_device_info_panel_iconSection}`,children:[!r&&this.props.appStore.features.sharedevices&&this.state.selectedDevice.isShareAllowed&&!this.state.selectedDevice.isShared?e.jsx(ne,{scopes:[E.account_device_update],children:e.jsx(le,{arrow:!0,title:this.props.appStore.localeMessages["accountpage.sharedevice"],children:e.jsx("span",{className:`icon i24 account-device-icon ${this.props.accountRootStore.accountDeviceStore.tccLoaderCompleted&&a?"share-blue-icon":"share-disabled-icon"}  ${this.props.classes.account_device_info_panel_accountDeviceIcon}`,onClick:this.props.accountRootStore.accountDeviceStore.tccLoaderCompleted&&a?this.openShareAccountDevice:null,disabled:!this.props.accountRootStore.accountDeviceStore.tccLoaderCompleted||!a})})}):null,x&&t.deviceType!=="TSC7"||A||P?e.jsx(ne,{scopes:[E.account_device_view],children:e.jsx(n,{id:"connectedsite.viewdevicedata",children:V=>e.jsx(le,{arrow:!0,title:V[0],children:e.jsx("span",{className:`icon i24 device-icon folder-blue-icon
4                                } ${this.props.classes.account_device_info_panel_accountDeviceIcon}`,onClick:this.openFileManager})})})}):"",T&&(!r||r&&this.props.appStore.features.sharedevices)?e.jsx(ne,{scopes:[E.project_fielddata_view],children:e.jsx(le,{arrow:!0,title:this.props.appStore.localeMessages["connectedsite.viewmachinedata"],children:e.jsx("span",{className:`icon i24 folder-blue-icon ${this.props.classes.account_device_info_panel_accountDeviceIcon}`,onClick:this.openMCData})})}):null,!r&&e.jsxs(e.Fragment,{children:[e.jsx(ne,{scopes:[E.account_device_view],children:this.state.isMap?null:e.jsx(n,{id:"connectedsite.viewonmap",children:V=>e.jsx(le,{arrow:!0,title:V[0],children:e.jsx("span",{className:`icon i24 device-icon ${t.lastReported?"map-view-blue-icon":"map-view-icon"} ${this.props.classes.account_device_info_panel_accountDeviceIcon}`,disabled:!t.lastReported,onClick:t.lastReported?this.navigateToDevice:null,onContextMenu:t.lastReported?this.handleContextMenu:null,children:e.jsx(da,{show:b,options:_,onClose:this.closeMenu})})})})}),e.jsx(ne,{scopes:[E.account_device_update],children:e.jsx(le,{arrow:!0,title:this.props.appStore.localeMessages["connectedsite.editdevice"],children:e.jsx("span",{className:`icon i24 account-device-icon accounts-edit ${this.props.classes.account_device_info_panel_accountDeviceIcon}`,onClick:this.openEditDevice})})}),e.jsx(ne,{scopes:[E.account_device_delete],children:e.jsx(le,{arrow:!0,title:this.props.appStore.localeMessages["accountpage.deletedevicefromaccount"],children:e.jsx("span",{className:`icon i24 account-device-icon accounts-trash ${this.props.classes.account_device_info_panel_accountDeviceIcon}`,onClick:()=>this.openRemoveDeviceConfirmation()})})}),e.jsx(ne,{scopes:[E.account_device_support],children:e.jsx(pa,{selectedDevice:this.props.accountRootStore.accountSelectionStore.selectedDevice,pageName:qo.ACCOUNT_DEVICES,deviceStatusMessage:this.state.deviceStatus})})]})]})}),this.renderInfo(t),r?"":e.jsxs("div",{className:`description-container ${this.props.classes.account_device_info_panel_descriptionContainer}`,children:[e.jsx("li",{className:`list-item description-label ${this.props.classes.account_device_info_panel_descriptionLabel}`,children:e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.devicedescription"})})}),e.jsx("li",{className:`list-item description-area ${this.props.classes.account_device_info_panel_descriptionArea}`,children:e.jsx("textarea",{rows:"4",cols:"40",value:t.description||"",readOnly:!0,className:this.props.classes.account_device_info_panel_textarea})}),e.jsx("button",{className:"button no-margin status-info-button",onClick:this.handleStatusMessageClick,disabled:!this.props.appStore.features.deviceStatusMessage&&o,children:e.jsx(n,{id:"connectedsite.devicestatus"})}),o?e.jsx("span",{className:"awaiting-status-message",children:e.jsx(n,{id:"connectedsite.awaitingstatusmessage"})}):null]}),e.jsx(we,{message:e.jsxs(I.Fragment,{children:[e.jsx(n,{id:"accountpage.thiscommand"}),":",e.jsxs("ul",{className:"delete-list",children:[e.jsx("li",{children:e.jsx(n,{id:"accountpage.removefromsharedaccount"})}),e.jsx("li",{children:e.jsx(n,{id:"accountpage.deleteprojectsanddata"})}),e.jsx("li",{children:e.jsx(n,{id:"accountpage.removefromsharedpartner"})})]})]}),show:this.state.showUnshareDeviceConfirmation,isCancel:!0,isBackbtn:!1,onAccept:()=>this.unshareDevice(),onDecline:()=>this.closeUnshareConfirmation(),acceptMsg:e.jsx(n,{id:"accountpage.unshare"}),declineMsg:e.jsx(n,{id:"accountpage.cancel"}),title:e.jsxs(I.Fragment,{children:[e.jsx("div",{children:e.jsx(n,{id:"accountpage.unsharedevicetitle",values:{deviceName:t.deviceName}})}),e.jsx("div",{className:"copy-container",children:e.jsx("span",{className:"item-text",children:e.jsx(n,{id:"accountpage.serialnumberinfo",values:{serialNumber:t.serialNumber}})})})]}),className:"account-delete-device"}),e.jsx(xt,{dimension:{width:"50px",height:"50px"},show:this.state.unshareInProgress,id:"unshare-device-loader"}),e.jsx(we,{message:e.jsxs(I.Fragment,{children:[e.jsx(n,{id:"accountpage.thiscommand"}),":",e.jsxs("ul",{className:"delete-list",children:[t.isShared?e.jsx("li",{children:e.jsx(n,{id:"accountpage.deletedeviceunshare"})}):"",e.jsx("li",{children:e.jsx(n,{id:"accountpage.removedevice"})}),e.jsx("li",{children:e.jsx(n,{id:"accountpage.deletedevicedata"})}),e.jsx("li",{children:e.jsx(n,{id:"accountpage.deletedevice"})})]})]}),show:this.state.showRemoveDeviceConfirmation,isCancel:!0,isBackbtn:!1,onAccept:()=>this.removeDevice(),onDecline:()=>this.closeRemoveDeviceConfirmation(),customBlock:e.jsx(n,{id:"accountpage.enter
4serialnumber",children:V=>e.jsx("input",{className:"confirm-input delete-device",placeholder:V[0],onChange:this.checkSerialNumber,value:this.state.serialNumber})}),acceptDisabled:this.state.acceptDisabled,acceptMsg:e.jsx(n,{id:"accountpage.delete"}),declineMsg:e.jsx(n,{id:"accountpage.cancel"}),title:e.jsxs(I.Fragment,{children:[e.jsx("div",{children:e.jsx(n,{id:"accountpage.deletedevicetitle",values:{deviceName:t.deviceName}})}),e.jsxs("div",{className:"copy-container",children:[e.jsx("span",{className:"item-text",children:e.jsx(n,{id:"accountpage.deleteserialnumber",values:{serialNumber:t.serialNumber}})}),e.jsx("span",{className:"icon i24 copy-grey",onClick:()=>this.copySerialNumber(t.serialNumber)})]})]}),className:"account-delete-device"}),e.jsx(we,{message:e.jsx(I.Fragment,{children:e.jsx(n,{id:"accountpage.cancelfirmwareupdateconfirmation"})}),show:this.state.displayCancelUpdateConfirmation,isCancel:!0,isBackbtn:!1,onAccept:()=>this.cancelUpdateFirmware(),onDecline:()=>this.closeCancelUpdateConfirmation(),acceptMsg:e.jsx(n,{id:"accountpage.cancel"}),declineMsg:e.jsx(n,{id:"common.close"}),title:e.jsx(I.Fragment,{children:e.jsx(n,{id:"accountpage.cancelfirmwareupdate"})}),className:"update-device-firmware"}),e.jsx(we,{message:e.jsx(n,{id:"connectedsite.unlicenseshareddevice",values:{sharedAccountName:t.renteeName}}),show:this.state.isDeviceTccStatusChangeNotAllowed,isCancel:!1,isBackbtn:!1,onAccept:()=>{this.setState({isDeviceTccStatusChangeNotAllowed:!1})},onDecline:()=>{this.setState({isDeviceTccStatusChangeNotAllowed:!1})},acceptMsg:e.jsx(n,{id:"common.okgotit"}),title:e.jsx(n,{id:"common.headsup"}),className:"unlicenseshareddevice-dialog"})]})}return e.jsx(I.Fragment,{children:v})}}const _s=Rs(ue(de("accountRootStore","appStore"),Kt(ei),ie)(ti));class fo extends I.Component{constructor(i){super(i),this.closePopup=this.closePopup.bind(this)}closePopup(){this.props.closeConnectedDevices()}getConnectionTime(i){const t=ae.now(),s=i?new ae(i):null;return i?ae.duration(t-s):null}render(){let t=this.props.accountRootStore.accountSelectionStore.selectedIBSS.connectedDevices;t=t.map(function(l){const h=Object.assign({},l),f=h.deviceName.split("-")[0].toUpperCase();return h.deviceType=ve.roverFormat.filter(v=>f.indexOf(v)===-1).length?f:"SPS-ROVER",h});const s=t.filter(l=>l.owner===Yo).length,o=s>=Bs,a=[{propertyName:"deviceType",iconMapping:St,type:"icon-column",defaultSort:"asc"},{title:"connectedsite.devicename",propertyName:"deviceName",defaultSort:"asc"},{title:"connectedsite.description",propertyName:"description",defaultSort:"asc"},{title:"accountpage.company",propertyName:"owner",availableSize:["m","l","xl"],defaultSort:"asc"},{title:"accountpage.sessionstarted",propertyName:"connectionTime",defaultSort:"asc",availableSize:["m","l","xl"],renderer:l=>{const h=ae.utc(l).local().format("MMM D, YYYY h:mm a");return e.jsx("p",{className:"name",children:h})}},{title:"accountpage.connectiontime",propertyName:"connectionTime",defaultSort:"asc",renderer:(l,h)=>{const f=ae.now(),v=h.connectionTime?ae.utc(h.connectionTime):null,w=h.connectionTime?ae.duration(f-v).humanize():null;return e.jsx("p",{className:"name",children:w})}}],r={by:"deviceName",type:"asc"};return e.jsx(I.Fragment,{children:e.jsxs(Ve,{type:"pagepopup",open:!0,title:e.jsx(n,{id:"accountpage.connecteddevices"}),onClose:this.closePopup,className:"connected-device-popup",children:[o&&e.jsxs("div",{className:"connected-devices-warning",role:"alert",children:[e.jsx("p",{className:"icon i16 warning-icon-black"}),e.jsx(n,{id:"accountpage.connecteddeviceswarning",values:{shownCount:s,totalCount:Bs}})]}),e.jsx("div",{className:"modal-add-container",children:e.jsx("div",{children:e.jsx(Zt,{viewName:"connecteddevices",items:t,viewDetails:a,type:"list",initialSort:r,loadingStatus:this.props.accountRootStore.accountBaseStore.connecteddevicesstatus,noItemFoundHTML:e.jsx(Qt,{icon:Pa,buttons:[],children:e.jsx(n,{id:"accountpage.noconnecteddevices"})})})})})]})})}}fo.propTypes={closeConnectedDevices:u.func};const si=ue(de("accountRootStore","appStore"),ie)(fo),Zs=window.appdata,go=({isOpen:c,onClose:i,appStore:t,isThirdPartyAccessEnabled:s,enableThirdParty:o,username:a,password:r,passwordResetSuccess:l,passwordManuallyOverridden:h,submitting:f,onCheckboxChange:v,onRequestResetPassword:w,onDone:F})=>{const g=t.localeMessages,M=!o,S=o,y=M?"":g["connectedsite.ibsssharingusernameplaceholder"],b=M?"":g["connectedsite.ibsssharingpasswordplaceholder"],_=o&&!s?g["connectedsite.ibsssharingusernamehelper"]:"",P=o,T=l?g["connectedsite.ibsssharingresetpasswordsuccess"]:!s&&!h?g["connectedsite.ibsssharingpasswordhelpergenerated"]:"",x=l?"ibss-sharing-password-reset-success":T?"ibss-sharing-password-helper":"ibss-sharing-password-helper
4-empty",A=f||s&&o?!0:o?!a.trim()||!r.trim():!s;return e.jsx(Ne,{isOpen:c,headerText:g["connectedsite.ibsssharingmodalheading"],ariaLabel:g["connectedsite.ibsssharingmodalheading"],acceptButtonText:g["common.done"],declineButtonText:"",onAccept:F,onDecline:i,onClose:i,runOnCloseAfterAccept:!1,runOnCloseAfterDecline:!1,primaryButtonAriaLabel:g["common.done"],primaryButtonDisabled:A,className:"ibss-sharing-v2__modal",children:e.jsxs("div",{className:"ibss-sharing-v2__modal-form",children:[e.jsx("p",{className:"ibss-sharing-v2__modal-desc",children:g["connectedsite.ibsssharingmodalbody"]}),e.jsxs("div",{className:"ibss-sharing-v2__server-info","data-testid":"ibss-sharing-server-info",children:[e.jsx("span",{className:"ibss-sharing-v2__server-info-title",children:g["connectedsite.ibsssharingserverandport"]}),e.jsx("span",{className:"ibss-sharing-v2__server-info-value",children:`${Zs.ibss_sharing_server_address}:${Zs.ibss_sharing_server_port}`})]}),e.jsx("div",{className:"ibss-sharing-v2__checkbox-container",children:e.jsx(Sa,{label:g["connectedsite.ibsssharingenablethirdparty"],checked:o,onCheckboxClick:v,size:"large",className:"ibss-sharing-v2__checkbox-component",shadowLabelFontSize:"16px"})}),e.jsx("div",{className:"ibss-sharing-v2__modal-field",children:e.jsx(qt,{text:o?_:g["connectedsite.ibsssharingenablethirdpartytoview"],position:"bottom",children:e.jsx("div",{children:e.jsx(Ht,{label:g["connectedsite.ibsssharingusernamefield"],placeholder:y,value:a,type:"text",size:"large",readOnly:S,disabled:M,autocomplete:"username",ariaLabel:g["connectedsite.ibsssharingusernamefield"],name:"ibss-sharing-v2-username"})})})}),e.jsx("div",{className:"ibss-sharing-v2__modal-field ibss-sharing-v2__password-block",children:e.jsx(qt,{text:o?"":g["connectedsite.ibsssharingenablethirdpartytoview"],position:"bottom",children:e.jsxs("div",{children:[e.jsx(Ht,{label:g["connectedsite.ibsssharingpasswordfield"],placeholder:b,value:o?r:"",type:"password",size:"large",readOnly:o,disabled:M,includePasswordTextToggle:o&&!!r,autocomplete:"current-password",ariaLabel:g["connectedsite.ibsssharingpasswordfield"],name:"ibss-sharing-v2-password",maxLength:"16"}),P&&e.jsxs("div",{className:"ibss-sharing-v2__password-reset-row",children:[e.jsx("span",{className:l?"ibss-sharing-v2__field-helper ibss-sharing-v2__field-helper--success":"ibss-sharing-v2__field-helper","data-testid":x,children:T}),e.jsx("button",{type:"button",className:"ibss-sharing-v2__password-reset","aria-label":g["connectedsite.ibsssharingresetpassword"],"data-testid":"ibss-sharing-password-reset",onClick:w,children:g["connectedsite.ibsssharingresetpassword"]})]})]})})})]})})};go.propTypes={isOpen:u.bool.isRequired,onClose:u.func.isRequired,appStore:u.shape({localeMessages:u.object}).isRequired,isThirdPartyAccessEnabled:u.bool,enableThirdParty:u.bool.isRequired,username:u.string.isRequired,password:u.string.isRequired,passwordResetSuccess:u.bool,passwordManuallyOverridden:u.bool,submitting:u.bool,onCheckboxChange:u.func.isRequired,onRequestResetPassword:u.func.isRequired,onDone:u.func.isRequired};const vo=({isOpen:c,onConfirm:i,onCancel:t,appStore:s})=>{const o=s.localeMessages;return e.jsx(Ne,{isOpen:c,headerText:o["connectedsite.ibsssharingdisableconfirmtitle"],ariaLabel:o["connectedsite.ibsssharingdisableconfirmtitle"],acceptButtonText:o["connectedsite.confirm"],declineButtonText:o["common.cancel"],onAccept:i,onDecline:t,onClose:t,runOnCloseAfterAccept:!1,runOnCloseAfterDecline:!1,primaryButtonAriaLabel:o["connectedsite.confirm"],secondaryButtonAriaLabel:o["common.cancel"],className:"ibss-sharing-v2__modal",children:e.jsxs("div",{className:"ibss-sharing-v2__modal-form",children:[e.jsx("p",{className:"ibss-sharing-v2__confirm-desc",children:o["connectedsite.ibsssharingdisableconfirmbody"]}),e.jsx("p",{className:"ibss-sharing-v2__confirm-prompt",children:o["connectedsite.ibsssharingdisableconfirmprompt"]})]})})};vo.propTypes={isOpen:u.bool.isRequired,onConfirm:u.func.isRequired,onCancel:u.func.isRequired,appStore:u.shape({localeMessages:u.object}).isRequired};const So=({isOpen:c,onReset:i,onCancel:t,appStore:s,submitting:o=!1})=>{const a=s.localeMessages,[r,l]=m.useState(""),[h,f]=m.useState(""),[v,w]=m.useState(!1),[F,g]=m.useState(!1),[M,S]=m.useState(!1);m.useEffect(()=>{c&&(l(""),f(""),w(!1),g(!1),S(!1))},[c]);const y=()=>{const L=ao();l(L),f(""),S(!0),w(!1),g(!1)},b=L=>{l(L.target.value),S(!1)},_=Ho(r),P=r.trim()===h.trim(),T=!_||!P||o,x=v&&r.trim()&&!_,A=F&&h.trim()&&!P,V=()=>{T||i(r.trim())};return e.jsx(Ne,{isOpen:c,headerText:a["connectedsite.ibsssharingresetpasswordtitle"],ariaLabel:a["connectedsite.ibsssharingresetpasswordtitle"],acceptButtonText:a["common.reset"],declineButtonText:a["common.cancel"],onAccept:V,onDecline:t,onClose:t,runOnCloseAfterAccept:!1,runOnCloseAfterDecline:!1,primaryButtonAriaLabel:a["common.reset"],secondaryButtonAriaLabel:a["common.cancel"],primaryButtonDisabled:T,className:"ibss-sharing-v2__modal",allowOverflow:!0,children:e.jsxs("div",{className:"ibss-sharing-v2__modal-form",children:[e.jsx("p",{className:"ibss-sharing-v2__confirm-desc",children:a["connectedsite.ibsssharingresetpassworddesc"]}),e.jsx("div",{className:"ibss-sharing-v2__modal-field",children:e.jsx(qt,{text:M?a["connectedsite.ibsssharingpasswordhelpergenerated"]:a["connectedsite.ibsssharingpasswordhelper"],position:"bottom",children:e.jsxs("div",{className:"ibss-sharing-v2__modal-field__autogenerate-wrapper",children:[e.jsx("div",{className:"ibss-sharing-v2__autogenerate-row",children:e.jsx("button",{type:"button",className:"ibss-sharing-v2__autogenerate-btn","aria-label":a["connectedsite.ibsssharingautogeneratepassword"],"data-testid":"ibss-sharing-generate-password",onClick:y,children:a["connectedsite.ibsssharingautogeneratepassword"]})}),e.jsx("div",{className:"ibss-sharing-v2__password-input-wrapper",children:e.jsx(Ht,{label:a["connectedsite.ibsssharingnewpasswordfield"],placeholder:a["connectedsite.ibsssharingpasswordplaceholder"],value:r,valueChange:b,onFocus:()=>w(!1),onBlur:()=>w(!0),type:"password",size:"large",includePasswordTextToggle:!0,autocomplete:"new-password",ariaLabel:a["connectedsite.ibsssharingnewpasswordfield"],name:"ibss-sharing-v2-new-password",maxLength:"16",errorText:x?a["connectedsite.ibsssharingpasswordinvalid"]:""})})]})})}),e.jsx("div",{className:"ibss-sharing-v2__modal-field",children:e.jsx(Ht,{label:a["connectedsite.ibsssharingreenterpasswordfield"],placeholder:a["connectedsite.ibsssharingpasswordplaceholder"],value:h,valueChange:L=>
4f(L.target.value),onFocus:()=>g(!1),onBlur:()=>g(!0),type:"password",size:"large",includePasswordTextToggle:!0,autocomplete:"new-password",ariaLabel:a["connectedsite.ibsssharingreenterpasswordfield"],name:"ibss-sharing-v2-confirm-password",maxLength:"16",errorText:A?a["connectedsite.ibsssharingpasswordmismatch"]:""})})]})})};So.propTypes={isOpen:u.bool.isRequired,onReset:u.func.isRequired,onCancel:u.func.isRequired,appStore:u.shape({localeMessages:u.object}).isRequired,submitting:u.bool};const Qs=(c,i)=>{if(!i)return!1;const t=i.trim();return!t||!(c!=null&&c.length)?!1:c.some(s=>s.mountpointName.trim()===t)},jo=({isOpen:c,onClose:i,isThirdPartyAccessEnabled:t,baseName:s,mountpointId:o,accountRootStore:a,appStore:r})=>{var xe,Oe;const l=((Oe=(xe=a.accountStore)==null?void 0:xe.account)==null?void 0:Oe.tccOrgName)??"",[h,f]=m.useState(!1),[v,w]=m.useState(""),[F,g]=m.useState(!1),[M,S]=m.useState(!1),[y,b]=m.useState(!1),[_,P]=m.useState(!1),[T,x]=m.useState(!1),A=m.useRef(!1);m.useEffect(()=>{var me,ee;if(!c){A.current&&(f(!1),w(""),g(!1),S(!1),b(!1),P(!1),x(!1),A.current=!1);return}if(A.current)return;f(!!t);const se=t?(ee=(me=a.accountBaseStore)==null?void 0:me.mountpointDelegations)==null?void 0:ee.find(K=>{var Ie;return((Ie=K==null?void 0:K.mountpointName)==null?void 0:Ie.trim())===(s??"").trim()}):null;w((se==null?void 0:se.password)??""),g(!1),S(!1),b(!1),A.current=!0},[c,t,s,a]);const V=h?$s(l,s):"",L=c&&!_&&!T,Se=m.useCallback(se=>{if(se.target.checked){f(!0),t||w(ee=>ee||ao());return}f(!1),t||(w(""),S(!1))},[t]),je=m.useCallback(()=>{g(!1),P(!0)},[]),U=m.useCallback(se=>{const me=se.trim();if(P(!1),g(!1),w(me),S(!0),!!t){if(o==null||o===""){r.setAlertMessages("connectedsite.ibsssharingmissingmountpoint",{},"","error");return}a.accountBaseStore.resetMountpointPassword(o,me).then(()=>{g(!0)}).catch(()=>{r.setAlertMessages("connectedsite.ibsssharingdelegationfailed",{},"","error")})}},[t,o,a,r]),Z=m.useCallback(()=>{P(!1)},[]),q=m.useCallback(()=>{x(!1)},[]),Fe=m.useCallback(()=>{if(x(!1),o==null||o===""){i==null||i();return}b(!0),a.accountBaseStore.revokeMountpointDelegation(o).then(()=>{r.setAlertMessages("connectedsite.ibsssharingthirdpartydisabledsuccess",{},"information-icon-white","success")}).catch(()=>{r.setAlertMessages("connectedsite.ibsssharingdelegationfailed",{},"","error")}).finally(()=>b(!1)),i==null||i()},[o,a,r,i]),ze=m.useCallback(()=>{if(!y){if(!h&&t){x(!0);return}if(o==null||o===""){r.setAlertMessages("connectedsite.ibsssharingmissingmountpoint",{},"","error");return}if(h&&!t){const se=$s(l,s).trim();b(!0),a.accountBaseStore.submitMountpointDelegation(o,se,v.trim()).then(()=>{r.setAlertMessages("connectedsite.ibsssharingthirdpartyenabledsuccess",{},"information-icon-white","success")}).catch(()=>{r.setAlertMessages("connectedsite.ibsssharingdelegationfailed",{},"","error")}).finally(()=>b(!1)),i==null||i();return}i==null||i()}},[y,h,t,v,l,s,o,a,r,i]);return e.jsxs(e.Fragment,{children:[L&&e.jsx(go,{isOpen:!0,onClose:i,appStore:r,isThirdPartyAccessEnabled:!!t,enableThirdParty:h,username:V,password:v,passwordResetSuccess:F,passwordManuallyOverridden:M,submitting:y,onCheckboxChange:Se,onRequestResetPassword:je,onDone:ze}),T&&e.jsx(vo,{isOpen:!0,onConfirm:Fe,onCancel:q,appStore:r}),_&&e.jsx(So,{isOpen:!0,onReset:U,onCancel:Z,appStore:r})]})};jo.propTypes={isOpen:u.bool.isRequired,onClose:u.func.isRequired,isThirdPartyAccessEnabled:u.bool,baseName:u.string,mountpointId:u.oneOfType([u.string,u.number]),accountRootStore:u.shape({accountBaseStore:u.shape({submitMountpointDelegation:u.func,revokeMountpointDelegation:u.func,resetMountpointPassword:u.func}).isRequired,accountStore:u.shape({account:u.shape({tccOrgName:u.string})})}).isRequired,appStore:u.shape({setAlertMessages:u.func,localeMessages:u.object}).isRequired};const oi=de("accountRootStore","appStore")(ie(jo)),ai={account_ibss_not_connected:{width:"100%",display:"flex",justifyContent:"center",marginTop:"24px"},account_ibss_info_panel_box:{height:"auto",width:"90%",border:`2px solid ${H.cswarningorange}`,borderRadius:"3px",backgroundColor:"rgba(255, 139, 0, 0.1)",padding:"14px 16px 16px 16px",color:H.csgray9,fontSize:"14px",lineHeight:"19px",fontWeight:300}};class ii extends I.Component{constructor(i){super(i),this.state={showConnectedDevices:!1,isThirdPartyModalOpen:!1},this.openConnectedDevices=this.openConnectedDevices.bind(this),this.closeConnectedDevices=this.closeConnectedDevices.bind(this),this.openThirdPartyModal=this.openThirdPartyModal.bind(this),this.closeThirdPartyModal=this.closeThirdPartyModal.bind(this)}openThirdPartyModal(){var t,s;const i=Qs((t=this.props.accountRootStore.accountBaseStore)==null?void 0:t.mountpointDelegations,(s=this.props.accountRootStore.accountSelectionStore.selectedIBSS)==null?void 0:s.baseName);typeof window<"u"&&typeof window.aptrinsic=="function"&&window.aptrinsic("track","IBSS Info Panel",{action:i?"third_party_access_enabled_edit_click":"third_party_access_disabled_edit_click"}),this.setState({isThirdPartyModalOpen:!0})}closeThirdPartyModal(){this.setState({isThirdPartyModalOpen:!1})}openConnectedDevices(){const i=this.props.accountRootStore.accountSelectionStore.selectedIBSS;this.props.accountRootStore.accountBaseStore.getConnectedDevices(i),this.setState({showConnectedDevices:!0})}closeConnectedDevices(){this.setState({showConnectedDevices:!1})}componentWillUnmount(){this.props.accountRootStore.accountSelectionStore.setSelectedIBSS(null)}render(){var M;let i="",t="",s="",o=[];const a=this.props.accountRootStore.accountSelectionStore.selectedIBSS,r=a.deviceName?ve.receiver.filter(S=>a.deviceName.indexOf(S)!==-1)[0]:null,l=a.deviceName?a.deviceName.replace(`${r}-`,""):null,h=ae.now(),f=a.connectionTime?ae.utc(a.connectionTime).local():null,v=a.connectionTime?ae.duration(h-f):null;this.state.showConnectedDevices&&(s=e.jsx(si,{closeConnectedDevices:this.closeConnectedDevices}));const w=Qs((M=this.props.accountRootStore.accountBaseStore)==null?void 0:M.mountpointDelegations,a.baseName),F=[{label:"accountpage.thirdpartyaccess",value:e.jsx(n,{id:w?"connectedsite.enabledlabel":"connectedsite.disabledlabelibss"}),action:e.jsx("button",{type:"button",className:"info-data__row-action","aria-label":"accountpage.thirdpartyaccess",onClick:this.openThirdPartyModal,children:e.jsx("i",{className:"icon i16 edit-icon info-data__row-action-icon","aria-hidden":"true"})})}];a.isConnected?(o=[{label:"accountpage.basetype",value:r},{label:"connectedsite.serialnumber",value:l},...F,{label:"accountpage.connectionduration",value:v?v.humanize():null},{label:"accountpage.connectionstart",value:f?f.format("MMM D, YYYY hh:mm a"):null},{label:"accountpage.addressandport",value:a.addressAndPort},{label:"accountpage.mountpoint",value:a.mountpoint},{label:"accountpage.identifier",value:a.identifier},{label:"accountpage.correctionformat",value:a.format},{label:"accountpage.formatdetails",value:a.formatDetails},{label:"accountpage.carrierfrequencies",value:a.carrierFrequencies},{label:"accountpage.navsystem",value:a.navSystem},{label:"accountpage.latitude",value:a.latitude},{label:"accountpage.longitude",value:a.longitude},{label:"common.status",value:e.jsx(n,{id:"common.connected"})}],t=e.jsx("div",{className:" no-margin connected-devices-button",children:e.jsx("button",{className:"button",onClick:this.openConnectedDevices,children:e.jsx(n,{id:"accountpage.connecteddevices"})})})):(o=[{label:"common.status",value:e.jsx(n,{id:"common.offline"})},{label:"common.lastactive",value:a.lastActiveDateTime?ae(a.lastActiveDateTime).format("MMM D, YYYY h:mm a"):null},...F],i=e.jsx("div",{className:this.props.classes.account_ibss_not_connected,children:e.jsx("div",{className:this.props.classes.account_ibss_info_panel_box,children:e.jsx(n,{id:"accountpage.ibssoffline"})})}));const g=e.jsxs(I.Fragment,{children:[e.jsxs("section",{className:"info-data",children:[e.jsxs(ot,{children:[e.jsx("ul",{children:o.map(S=>S.value?e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:S.label})}),e.jsxs("span",{className:"value",title:S.action?void 0:S.value,children:[S.value,S.action?e.jsx("span",{className:"action",children:S.action}):null]})]},S.label):"")}),i]}),s]}),t]});return e.jsxs("section",{children:[e.jsx("div",{className:"avatar-wrapper",children:e.jsx("div",{className:"card-avatar",children:e.jsx("img",{width:"32",height:"32",src:wa,alt:""})})}),e.jsx("section",{className:"basename",children:e.jsx("h2",{className:"name",children:this.props.accountRootStore.accountSelectionStore.selectedIBSS.baseName||"-"})}),g,e.jsx(oi,{isOpen:this.state.isThirdPartyModalOpen,onClose:this.closeThirdPartyModal,baseName:a.baseName,mountpointId:a.mou
4ntpointId,isThirdPartyAccessEnabled:w})]})}}const ni=ue(de("appStore","accountRootStore"),Kt(ai),ie)(ii),gt=c=>e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:c.label})}),e.jsx("span",{className:"value",children:c.value||"-"})]}),ci=c=>{var o,a;const i=c.partner.myDevicesShared?e.jsxs("div",{className:"deviceshared-content",id:"mydevices-shared",children:[e.jsx("span",{className:"device-count",children:c.partner.myDevicesShared}),e.jsx(n,{id:"connectedsite.viewmydeviceshared",children:r=>e.jsx("span",{onClick:()=>c.accountPartnerStore.setShowSharedDevices(!0),children:e.jsx("i",{title:r[0],className:"icon i24 view-icon infopanel-viewdevices"})})})]}):null,t=c.partner.devicesSharedWithMe?e.jsxs("div",{className:"deviceshared-content",id:"devices-SharedWithMe",children:[e.jsx("span",{className:"device-count",children:c.partner.devicesSharedWithMe}),e.jsx(n,{id:"accountpage.devicessharedwithme",children:r=>e.jsx("span",{onClick:()=>c.accountPartnerStore.setShowDevicesSharedWithMe(!0),children:e.jsx("i",{title:r[0],className:"icon i24 view-icon infopanel-viewdevices"})})})]}):null,s=e.jsx(Jo,{partner:c.partner});return e.jsx("section",{className:"info-data",children:e.jsxs("ul",{children:[e.jsx(gt,{label:"connectedsite.partnershortorg",value:c.partner.partnerShortOrgName}),(o=c.accountPartnerStore)!=null&&o.isMyDevicesShared?e.jsx(gt,{label:"accountpage.mydevicesshared",value:i}):null,(a=c.accountPartnerStore)!=null&&a.isDevicesSharedWithMe?e.jsx(gt,{label:"accountpage.sharedwithme",value:t}):null,e.jsx(gt,{label:"accountpage.partneringstatus",value:s}),c.partner.status==="ACTIVE"?e.jsx(gt,{label:"accountpage.partnersince",value:ae(new Date(c.partner.updatedAt)).format("MMM D, YYYY")}):""]})})},ri=c=>e.jsx("span",{className:"icon i24 accounts-trash delete-partner-icon",onClick:c.showConfirmation,title:c.appStore.localeMessages["accountpage.deletepartner"]}),li=c=>e.jsxs("section",{children:[e.jsx("div",{className:"avatar-wrapper",children:e.jsx("div",{className:"card-avatar",children:e.jsx("img",{width:"32",height:"32",src:c.partner.profileImage,alt:""})})}),e.jsx("h2",{className:"name",children:c.partner.partnerAccountName})]}),di=({appStore:c,showConfirmation:i,partner:t,accountPartnerStore:s})=>e.jsxs(I.Fragment,{children:[e.jsx(li,{partner:t}),c.features.deletepartners?e.jsx(ri,{appStore:c,showConfirmation:i}):null,e.jsx(ci,{partner:t,accountPartnerStore:s})]});function pi({appStore:c,accountRootStore:i}){const[t,s]=m.useState(!1),o=()=>{s(!0)},a=()=>{s(!1)},r=async()=>{a(),Go("Delete"),await i.accountPartnerStore.removePartners({accountId:i.accountStore.account.accountId,partnerIds:[i.accountSelectionStore.selectedPartner.partnerId]}),i.accountSelectionStore.setSelectedPartner(null)};return e.jsxs(I.Fragment,{children:[e.jsx(di,{id:"partner-info",partner:i.accountSelectionStore.selectedPartner,appStore:c,accountPartnerStore:i.accountPartnerStore,showConfirmation:o}),e.jsx(we,{message:e.jsxs(I.Fragment,{children:[i.accountSelectionStore.selectedPartner.status==="ACTIVE"?e.jsxs(e.Fragment,{children:[e.jsx(n,{id:"accountpage.thiscommand"}),e.jsxs("ul",{className:"delete-partner-list",children:[e.jsx("li",{children:e.jsx(n,{id:"connectedsite.removepartnerdevice"})}),e.jsx("li",{children:e.jsx(n,{id:"connectedsite.removepartnerdata"})}),e.jsx("li",{children:e.jsx(n,{id:"connectedsite.removepartnerfromaccount"})})]})]}):"",e.jsx(n,{id:"connectedsite.confirmremovepartner"})]}),show:t,onAccept:r,onDecline:a,isCancel:!0,isBackbtn:!1,acceptMsg:e.jsx(n,{id:"common.delete"}),declineMsg:e.jsx(n,{id:"common.cancel"}),title:e.jsx(I.Fragment,{children:e.jsx("div",{children:e.jsx(n,{id:"accountpage.deletepartner"})})}),className:"account-delete-device"})]})}const hi=Fa(de("appStore","accountRootStore"),ie)(pi),ui={account_projects_info_panel_select:{fontSize:"12px",fontWeight:400,fontFamily:['"Open Sans"',"sans-serif"].join(", "),color:H.csgray5,"&:focus":{backgroundColor:"transparent"},"&:not([multiple])":{"& option":{backgroundColor:H.cswhite1,color:H.csgray5}}}
4,account_projects_info_panel_input:{paddingLeft:"8px",marginLeft:"-8px","&:focus":{backgroundColor:"transparent"}},account_projects_info_panel_icon:{right:"-4px"}};class mi extends I.Component{constructor(i){super(i),this.navigateToProject=this.navigateToProject.bind(this),this.navigateToProjectSettings=this.navigateToProjectSettings.bind(this),this.deleteProject=this.deleteProject.bind(this),this.archiveProject=this.archiveProject.bind(this),this.showConfirmation=this.showConfirmation.bind(this),this.showArchiveConfirmation=this.showArchiveConfirmation.bind(this),this.closeConfirmation=this.closeConfirmation.bind(this),this.closeArchiveConfirmation=this.closeArchiveConfirmation.bind(this),this.checkProjectName=this.checkProjectName.bind(this),this.copyProjectName=this.copyProjectName.bind(this),this.projectRoles=this.props.rolesStore.project,this.state={showRemoveProject:!1,showArchiveProject:!1,acceptDisabled:!0,projectRole:"notMember",isMap:null,navigateToProject:!1,navigateToProjectSettings:!1,isConnectedProject:null,vendorConnections:0,tcProjectId:null}}componentDidMount(){const i=this.props.location.pathname,t=i.split("/")[i.split("/").length-1]==="map";this.setState({projectRole:this.props.accountRootStore.accountSelectionStore.selectedProject.projectRole,tcProjectId:this.props.accountRootStore.accountSelectionStore.selectedProject.tcProjectId,isMap:t}),this.checkConnectedProject(this.props.accountRootStore.accountSelectionStore.selectedProject.projectId),this.observer=vt(()=>this.props.accountRootStore.accountSelectionStore.selectedProject,s=>{s&&(this.checkConnectedProject(s.projectId),this.setState({projectRole:s.projectRole}),this.setState({tcProjectId:s.tcProjectId}),this.props.appStore.features.iso&&s.fleetType==="SMS"&&this.getVendorConnections(s.projectId))})}componentWillUnmount(){this.props.accountRootStore.accountSelectionStore.setSelectedProject(null),this.observer()}async getVendorConnections(i){const t=await this.props.accountRootStore.accountProjectStore.getVendorConnections(i);this.setState({vendorConnections:t.totalItems})}showConfirmation(i){i.stopPropagation(),this.state.isConnectedProject===!1&&this.setState({showRemoveProject:!0})}showArchiveConfirmation(i){i.stopPropagation(),this.props.accountRootStore.accountSelectionStore.selectedProject.archivingStatus!==he.INPROGRESS&&this.setState({showArchiveProject:!0})}closeConfirmation(){this.setState({showRemoveProject:!1,acceptDisabled:!0})}closeArchiveConfirmation(i){this.setState({showArchiveProject:!1}),this.props.accountRootStore.accountProjectStore.setShowArchiveDeleteProject(!1)}navigateToProject(){this.props.accountRootStore.accountSelectionStore.selectedProject.isArchived&&Cs(jt.archiveproject.actions.viewarchivedproject),this.setState({navigateToProject:!0})}navigateToProjectSettings(){this.setState({navigateToProjectSettings:!0})}deleteProject(){this.closeConfirmation(),this.props.accountRootStore.accountProjectStore.deleteProject(this.props.accountRootStore.accountSelectionStore.selectedProject,{isMap:this.state.isMap}),Ko()}async archiveProject(){this.closeArchiveConfirmation(),await this.props.accountRootStore.accountProjectStore.archiveProject(this.props.accountRootStore.accountSelectionStore.selectedProject,{isMap:this.state.isMap}),Cs(jt.archiveproject.actions.archiveproject)}async unarchiveProject(){this.props.accountRootStore.accountSelectionStore.selectedProject.archivingStatus!==he.INPROGRESS&&(await this.props.accountRootStore.accountProjectStore.unarchiveProject(this.props.accountRootStore.accountSelectionStore.selectedProject,{isMap:this.state.isMap}),Cs(jt.archiveproject.actions.unarchiveproject))}checkProjectName(i){const{projectName:t}=this.props.accountRootStore.accountSelectionStore.selectedProject;i.target.value===t?this.setState({acceptDisabled:!1}):i.target.value!==t&&!this.state.acceptDisabled&&this.setState({acceptDisabled:!0})}copyProjectName(i){ks(i),this.props.appStore.setAlertMessages("accountpage.projectnamecopied",{},"accounts-copy","success")}async toggleRole(i){const{selectedProject:t}=this.props.accountRootStore.accountSelectionStore,{me:s}=this.props.userStore,{accountId:o}=this.props.accountRootStore.accountStore.account,a=t.projectRole,r=await this.props.accountRootStore.accountProjectStore.toggleProjectRole(t.projectId,s,i,a,o,this.state.isMap);r&&(r.status===200||r.status===204)&&this.setState({projectRole:i})}async checkConnectedProject(i){this.setState({isConnectedProject:null});try{const t=await this.props.projectStore.findTcProject(i);this.props.accountRootStore.accountSelectionStore.selectedProject.projectId===i&&this.setState({isConnectedProject:!!t})}catch(t){let s=null;(t==null?void 0:t.errorCode)==="USER_HAS_NO_ACCESS"?s=!0:(t==null?void 0:t.errorCode)==="TCONNECT_PROJECT_NOT_FOUND"?s=!1:(t==null?void 0:t.status)===403&&(t==null?void 0:t.code)===11e3&&(s=!0),this.setState({isConnectedProject:s})}}render(){var M,S;const i=this.props.accountRootStore.accountSelectionStore.selectedProject.isArchived,t=this.props.accountRootStore.accountSelectionStore.selectedProject.archivingStatus,s=e.jsx("span",{className:"icon i24 project-delete-icon accounts-trash",disabled:this.state.isConnectedProject!==!1||t===he.INPROGRESS,onClick:y=>this.showConfirmation(y),title:this.state.isConnectedProject?this.props.appStore.localeMessages["accountpage.cannotdeleteconnectedproject"]:this.props.appStore.localeMessages["accountpage.deleteproject"]}),o=e.jsx("span",{className:"icon i24 archive-icon",onClick:y=>this.showArchiveConfirmation(y),disabled:t===he.INPROGRESS,title:this.props.appStore.localeMessages["accountpage.archiveproject"]}),a=e.jsx("span",{className:"icon i24 unarchive-icon",onClick:y=>this.unarchiveProject(y),disabled:t===he.INPROGRESS,title:this.props.appStore.localeMessages["accountpage.unarchiveproject"]}),r=e.jsxs(I.Fragment,{children:[e.jsxs("section",{className:"info-header",children:[e.jsx("div",{className:"avatar-wrapper",children:e.jsx("div",{className:"card-avatar",children:e.jsx("img",{width:"32",height:"32",src:this.props.accountRootStore.accountSelectionStore.selectedProject&&this.props.accountRootStore.accountSelectionStore.selectedProject.thumbnail,alt:""})})}),e.jsx("section",{className:"name",children:e.jsx("h2",{children:this.props.accountRootStore.accountSelectionStore.selectedProject&&this.props.accountRootStore.accountSelectionStore.selectedProject.projectName})})]}),e.jsx(ne,{scopes:[E.account_project_delete,E.account_project_archive],children:e.jsxs("section",{className:"icon-section",children:[e.jsx(ne,{scopes:[E.account_project_delete],children:i?"":s}),e.jsx(ne,{scopes:[E.account_project_archive],children:i?a:o})]})})]}),l=this.props.appStore.features.iso,h=((M=this.props.accountRootStore.accountSelectionStore.selectedProject)==null?void 0:M.fleetType)==="VIS",f=((S=this.props.accountRootStore.accountSelectionStore.selectedProject)==null?void 0:S.fleetType)==="SMS",v=this.props.accountRootStore.accountSelectionStore.selectedProject.projectRole==="notMember",w=e.jsx("section",{className:"info-data",children:e.jsxs("ul",{children:[e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.managedby"})}),e.jsx("span",{className:"value",title:this.props.accountRootStore.accountStore.account.accountName||"-",children:this.props.accountRootStore.accountStore.account.accountName||"-"})]}),e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.devices"})}),e.jsx("span",{className:"value",title:this.props.accountRootStore.accountSelectionStore.selectedProject.deviceCount||"-",children:this.props.accountRootStore.accountSelectionStore.selectedProject.deviceCount||"-"})]}),e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.members"})}),e.jsx("span",{className:"value",title:this.props.accountRootStore.accountSelectionStore.selectedProject.userCount||"-",children:this.props.accountRootStore.accountSelectionStore.selectedProject.userCount||"-"})]}),e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.datecreated"})}),e.jsx("span",{className:"value",title:ae(new Date(this.props.accountRootStore.accountSelectionStore.selectedProject.createdAt)).format("MMM D, YYYY")||"-",children:ae(new Date(this.props.accountRootStore.accountSelectionStore.selectedProject.createdAt)).format("MMM D, YYYY")||"-"})]}),e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"accountpage.createdby"})}),e.jsx("span",{className:"value",title:this.props.accountRootStore.accountSelectionStore.selectedProject.createdByEmail||"-",children:this.props.accountRootStore.accountSelectionStore.selectedProject.createdByEmail||"-"})]}),i?"":e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"accountpage.projectRole"})}),this.props.appStore.features.revokeselfinvite&&this.state.tcProjectId?this.state.projectRole==="notMember"?e.jsx(n,{id:"accountpage.notamember"}):e.jsx("span",{children:this.props.appStore.localeMessages[`connectedsite.${this.state.projectRole}`]}):e.jsxs(As,{native:!0,disableUnderline:!0,value:this.state.projectRole,inputProps:{name:"projectRole",id:"project-role"},classes:{select:this.props.classes.account_projects_info_panel_input},className:this.props.classes.account_projects_info_panel_select,onClick:y=>y.stopPropagation(),onChange:y=>this.toggleRole(y.target.value),IconComponent:y=>e.jsx("i",{className:`icon i24 accounts-list-down-arrow ${y.className} ${this.props.classes.account_projects_info_panel_icon}`}),children:[this.projectRoles.map(y=>e.jsx("option",{value:y.keyName,children:this.props.appStore.localeMessages[`connectedsite.${y.keyName}`]},y.keyName)),e.jsx(n,{id:"accountpage.notamember",children:y=>e.jsx("option",{value:"notMember",children:y[0]})})]})]}),l&&h?e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.sitemanager"})}),e.jsx("span",{className:"value",title:this.props.accountRootStore.accountSelectionStore.selectedProject.siteManager||"-",children:this.props.accountRootStore.accountSelectionStore.selectedProject.siteManager||"-"})]}):"",l&&f&&this.state.vendorConnections>0?e.jsxs("li",{className:"list-item",children:[e.jsx("label",{className:G.field,children:e.jsx(n,{id:"connectedsite.linkedvendorsites"})}),v?e.jsx("span",{className:"value",children:this.state.vendorConnections}):e.jsx("span",{className:"value link_text",onClick:()=>this.navigateToProjectSettings(),children:this.state.vendorConnections})]}):""]})});let F="";if(this.props.accountRootStore.accountSelectionStore.selectedProject.projectRole){const y=v||t===he.INPROGRESS;F=e.jsx(ne,{scopes:[E.account_project_view],children:e.jsxs("div",{className:"fix-bottom",children:[v?e.jsx("span",{className:"warning-label",children:e.jsx(n,{id:"accountpage.notprojectmember"})}):null,e.jsx("button",{disabled:y,className:"button primary expanded project-button",onClick:()=>this.navigateToProject(),children:e.jsx(n,{id:"connectedsite.view"})})]})})}const{projectName:g}=this.props.accountRootStore.accountSelectionStore.selectedProject;return e.jsxs(I.Fragment,{children:[this.state.navigateToProject?e.jsx(Yt,{to:`/user/projects/${this.props.accountRootStore.accountSelectionStore.selectedProject.projectId}/dashboard`}):"",this.state.navigateToProjectSettings?e.jsx(Yt,{to:`/user/projects/${this.props.accountRootStore.accountSelectionStore.selectedProject.projectId}/settings`}):"",r,w,F,e.jsx(we,{message:e.jsx(I.Fragment,{children:h?e.jsx(n,{id:"accountpage.removevisconnection"}):e.jsxs(e.Fragment,{children:[e.jsx(n,{id:"accountpage.thiscommand"}),":",e.jsxs("ul",{className:"delete-list",children:[e.jsx("li",{children:e.jsx(n,{id:"accountpage.removeproject"})}),e.jsx("li",{children:e.jsx(n,{id:"accountpage.willremovedesigns"})}),e.jsx("li",{children:e.jsx(n,{id:"accountpage.deleteprojectdata"})})]})]})}),show:this.state.showRemoveProject,isCancel:!0,isBackbtn:!1,onAccept:this.deleteProject,onDecline:this.closeConfirmation,acceptDisabled:this.state.acceptDisabled,acceptMsg:e.jsx(n,{id:"accountpage.delete"}),declineMsg:e.jsx(n,{id:"accountpage.cancel"}),title:e.jsxs(I.Fragment,{children:[e.jsx(n,{id:"accountpage.deleteprojectname"}),e.jsxs("div",{className:"copy-container",children:[e.jsx("span",{className:"item-text",children:g}),e.jsx("span",{className:"icon i24 copy-grey",onClick:()=>this.copyProjectName(g)})]})]}),customBlock:e.jsx(n,{id:"accountpage.enterprojectname",children:y=>e.jsx("input",{className:"confirm-input delete-project",placeholder:y[0],onChange:this.checkProjectName})}),className:"account-delete-user"}),e.jsx(we,{message:e.jsx(I.Fragment,{children:h?e.jsx(n,{id:"accountpage.removevisconnection"}):this.props.accountRootStore.accountProjectStore.showArchiveDeleteProject?e.jsx(n,{id:"accountpage.archiveprojectdeletedata"}):e.jsx(n,{id:"accountpage.archiveprojectdata"})}),show:this.state.showArchiveProject||this.props.accountRootStore.accountProjectStore.showArchiveDeleteProject,isCancel:!0,isBackbtn:!1,onAccept:this.archiveProject,onDecline:this.closeArchiveConfirmation,acceptMsg:e.jsx(n,{id:"accountpage.archive"}),declineMsg:e.jsx(n,{id:"accountpage.cancel"}),title:e.jsx(I.Fragment,{children:e.jsx(n,{id:"accountpage.archiveprojectname",values:{projectName:g}})}),className:"account-archive-user"})]})}}const ys=Rs(ue(de("accountRootStore","appStore","userStore","rolesStore","projectStore"),Kt(ui),ie)(mi));class xo extends I.Component{constructor(i){super(i),this.saveUser=this.saveUser.bind(this),this.cancelEditUser=this.cancelEditUser.bind(this),this.closeEditUser=this.closeEditUser.bind(this),this.updateRole=this.updateRole.bind(this),this.showEditConfirmation=this.showEditConfirmation.bind(this),this.closeEditConfirmation=this.closeEditConfirmation.bind(this),this.state={roleUid:this.props.users[0].roleUid,showEditConfirmation:!1},this.accountRoles=this.props.rolesStore.account||[],this.saveDisabled=!0}updateRole(i){this.setState({roleUid:i.target.value})}async saveUser(){const i=this.props.users.some(o=>o.userId===this.props.userStore.me.userId),t=this.props.accountRootStore.accountStore.account.accountId,s=await this.props.accountRootStore.accountUserStore.updateUsers(t,this.props.users.map(o=>({userId:o.userId,roleUid:this.state.roleUid})));if(s.failed&&s.failed.length>0)this.props.appStore.setAlertMessages("accountpage.accountuserupdatefailure",{userCount:s.failed.length},null,"error");else{const o=this.accountRoles.filter(a=>a.roleUid===this.state.roleUid);this.props.users.length===1&&this.props.accountRootStore.accountSelectionStore.selectedUser?(Vs(o[0].name,"Indiv
4idual"),this.props.accountRootStore.accountSelectionStore.selectedUser.setRole(o[0])):(this.props.accountRootStore.accountSelectionStore.selectedUsers.forEach(a=>{a.setRole(o[0]),Vs(o[0].name,"Bulk")}),this.props.accountRootStore.accountSelectionStore.setSelectedUsers([]),Xo("Account User Edit",this.props.users.length)),this.props.appStore.setAlertMessages("connectedsite.roleupdated",{userCount:this.props.users.length,role:o[0].name}),this.props.accountRootStore.accountUserStore.setAccountUsers(),i&&(this.props.permissionsStore.getAccountPermissions(t),this.props.userStore.getHasAdminAccessInAccounts())}this.closeEditUser()}cancelEditUser(){this.closeEditUser()}closeEditUser(){this.setState({roleUid:null}),this.props.accountRootStore.accountSelectionStore.setSelectedUsers([]),this.props.closeEditUser()}showEditConfirmation(i){i.stopPropagation(),this.setState({showEditConfirmation:!0})}closeEditConfirmation(i){this.setState({showEditConfirmation:!1})}render(){const i=[{name:"accountpage.ACCOUNT_ADMIN",description:"accountpage.ACCOUNT_ADMIN_desc"},{name:"accountpage.ACCOUNT_USER",description:"accountpage.ACCOUNT_USER_desc"}],t=e.jsxs(I.Fragment,{children:[e.jsx(n,{id:"connectedsite.fulldocumentationhelp"}),e.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:window.appdata.account_roles_link,children:e.jsx(n,{id:"accountpage.accountroles"})}),e.jsx(n,{id:"connectedsite.helptopic"})]});return this.props.users.length===1&&this.state.roleUid&&this.state.roleUid===this.props.users[0].roleUid?this.saveDisabled=!0:this.saveDisabled=!1,this.props.users.length?e.jsxs(I.Fragment,{children:[e.jsx("section",{className:"infopanel-header",children:e.jsx("span",{className:"header-title",children:e.jsx(n,{id:"accountpage.edituserinfo"})})}),e.jsxs("section",{className:"infopanel-content",children:[e.jsxs("div",{className:"input-group item-wrapper",children:[e.jsx(n,{id:"common.multipleemails",children:s=>e.jsx("input",{className:"disabled",value:this.props.users.length===1?this.props.users[0].email:s[0],disabled:!0})}),e.jsx("label",{children:e.jsx(n,{id:"connectedsite.useremail"})})]}),e.jsxs("div",{className:"input-group item-wrapper",children:[e.jsx("select",{onChange:s=>this.updateRole(s),defaultValue:this.props.users[0].roleUid,children:this.accountRoles.map(s=>e.jsx("option",{value:s.roleUid,children:this.props.appStore.localeMessages[`accountpage.${s.keyName}`]},s.roleUid))}),e.jsxs("label",{children:[e.jsx(n,{id:"accountpage.accountrole"}),e.jsx(aa,{title:"accountpage.accountroles",roles:i,helpText:t})]})]})]}),e.jsxs("section",{className:"infopanel-footer",children:[e.jsx("button",{className:"button secondary-button",onClick:this.cancelEditUser,children:e.jsx(n,{id:"common.cancel"})}),e.jsx("button",{className:"button save-button",disabled:this.saveDisabled,onClick:this.showEditConfirmation,children:e.jsx(n,{id:"common.save"})})]}),e.jsx(we,{message:e.jsxs(I.Fragment,{children:[e.jsx(n,{id:"accountpage.editaccountuserconfirmation"}),e.jsx("a",{className:"documentation_link",target:"_blank",rel:"noopener noreferrer",href:window.appdata.account_roles_link,children:e.jsx(n,{id:"accountpage.rolespermissionsdocumentation"})}),e.jsx(n,{id:"accountpage.forfulldetails"})]}),show:this.state.showEditConfirmation,isCancel:!0,isBackbtn:!1,onAccept:this.saveUser,onDecline:this.closeEditConfirmation,acceptMsg:e.jsx(n,{id:"common.save"}),declineMsg:e.jsx(n,{id:"accountpage.cancel"}),title:e.jsx(I.Fragment,{children:e.jsx(n,{id:"accountpage.editaccountuser"})})})]}):""}}xo.propTypes={closeEditUser:u.func,users:u.array};const fi=ue(de("accountRootStore","appStore","rolesStore","permissionsStore","userStore"),ie)(xo);class gi extends I.Component{constructor(i){super(i),this.closeEditUser=this.closeEditUser.bind(this)}closeEditUser(){this.props.accountRootStore.accountUserStore.closeEditUser()}render(){const i=this.props.accountRootStore.accountSelectionStore.selectedUser,t=this.props.accountRootStore.accountSelectionStore.selectedUsers,s=this.props.accountRootStore.accountUserStore.accountUsers.filter(h=>h.roleKey==="ACCOUNT_ADMIN").length;let o=!1;
4i&&!(i.roleKey!=="ACCOUNT_ADMIN"||s>1)&&(o=!0);const a=e.jsx(ne,{scopes:[E.account_user_update],refreshOnRender:!0,children:e.jsx("span",{className:"icon i24 accounts-edit",onClick:()=>this.props.accountRootStore.accountUserStore.openEditUser(),title:this.props.appStore.localeMessages["accountpage.edituser"]})}),r=e.jsx(ne,{scopes:[E.account_user_delete],refreshOnRender:!0,children:e.jsx("span",{className:"icon i24 accounts-trash",disabled:o,onClick:o?null:()=>this.props.accountRootStore.accountUserStore.openRemoveUser(),title:this.props.appStore.localeMessages["accountpage.deleteuser"]})});let l="";return this.props.accountRootStore.accountUserStore.showEditUser?l=e.jsx(fi,{users:t.length?t:[i],closeEditUser:this.closeEditUser}):i?l=e.jsxs(I.Fragment,{children:[e.jsxs("section",{className:"avatar-container",children:[e.jsx("div",{className:"avatar-wrapper",children:e.jsx("div",{className:"card-avatar small",children:e.jsx("img",{width:"32",height:"32",src:i.profileImage,alt:"profile"})})}),e.jsx("h2",{className:"name",children:i.fullName}),e.jsx("p",{children:e.jsx(n,{id:`accountpage.${i.roleKey}`})}),e.jsx("p",{className:"email-text",children:i.email})]}),e.jsx(ne,{scopes:[E.account_user_update,E.account_user_delete],children:e.jsxs("section",{className:"icon-section",children:[a,r]})}),e.jsx("section",{className:"list-container",children:e.jsxs("div",{children:[e.jsx("span",{children:e.jsx(n,{id:"accountpage.accountrole"})}),e.jsx("div",{className:"item-value",children:e.jsx("span",{children:e.jsx(n,{id:`accountpage.${i.roleKey}`})})})]})})]}):l="",l}}const vi=ue(de("accountRootStore","appStore"),ie)(gi);class Si extends I.Component{constructor(t){super(t);ge(this,"closeInfoPanel",t=>{this.state.dynamicColPanelOpen?this.props.listViewSettingsStore.setIsInfoPanelOpen(!1):this.state.filterOpen&&this.props.listFilterStore.toggleFilterPanel(),t=this.state.selectedNav;const s=ha(t);s?(this.props.accountRootStore.accountSelectionStore.setSelected(s,null),this.props.accountRootStore.accountSelectionStore.setSelected(t,[])):this.props.accountRootStore.accountSelectionStore.setSelected(t,null),this.setState({currentInfoPanel:null})});this.state={searchValue:"",selectedNav:"",navLinks:[],pageLinks:[],dynamicColPanelOpen:!1,filterOpen:!1},this.updateLocation=this.updateLocation.bind(this),this.closeInfoPanel=this.closeInfoPanel.bind(this),this.getPermissionBasedRouting=this.getPermissionBasedRouting.bind(this),this.lastInfoPanel=null,this.deviceObserver=so(this.props.appStore,"deviceToNavigate",s=>{if(s.newValue){const a=this.props.location.pathname.split("/")[3];this.props.accountRootStore.accountSelectionStore.setSelectedDevice(null),this.setState({selectedNav:"map"}),new URLSearchParams(this.props.location.search).get("device")||this.props.navigate(`/user/accounts/${a}/map`)}}),this.accountObserve=vt(()=>this.props.accountRootStore.accountStore.account,s=>{this.setAccountDetails(s),s&&s.accountId&&this.props.permissionsStore.getAccountPermissions(s.accountId)}),this.accountContextObserver=vt(()=>{var s;return(s=this.props.accountRootStore.accountStore.account)==null?void 0:s.accountId},()=>{this.updateAgentPageContext()})}setAccountDetails(t){if(t.accountId){const s=Na(t.accountId),o=_a(t.accountId);this.setState({navLinks:s,pageLinks:o}),Zo({email:this.props.userStore.me&&this.props.userStore.me.email},{id:t.accountId,name:t.accountName,fchid:t.fchId})}}async componentDidMount(){const t=new oo(window.navigator.userAgent),s=t.mobile(),o=t.tablet(),a=this.props.location.pathname.split("/"),r=a[3],l=a[4];this.props.accountRootStore.accountStore.init(r),this.fetchSubscriptionData(r),this.setState({selectedNav:l}),this.dynamicColObserver=vt(()=>this.props.listViewSettingsStore.getIsInfoPanelOpen(),h=>{this.setState({dynamicColPanelOpen:h}),h&&this.state.filterOpen&&this.props.listFilterStore.toggleFilterPanel()}),this.filterObserver=vt(()=>this.props.listFilterStore.showFilterPanel,h=>{this.setState({filterOpen:h}),h&&this.state.dynamicColPanelOpen&&this.props.listViewSettingsStore.setIsInfoPanelOpen(!1)}),!s&&!o&&this.props.appStore.toggleNavPanel(!0),this.updateAgentPageContext()}componentDidUpdate(t,s){var o,a,r,l;if(((o=t.location)==null?void 0:o.pathname)!==((a=this.props.location)==null?void 0:a.pathname)){const f=this.props.location.pathname.split("/")[4];f&&f!==this.state.selectedNav&&this.setState({selectedNav:f})}(s.selectedNav!==this.state.selectedNav||s.dynamicColPanelOpen!==this.state.dynamicColPanelOpen||s.filterOpen!==this.state.filterOpen||((r=t.location)==null?void 0:r.pathname)!==((l=this.props.location)==null?void 0:l.pathname))&&this.updateAgentPageContext()}componentWillUnmount(){var t,s,o;
4this.deviceObserver(),this.accountObserve(),(t=this.accountContextObserver)==null||t.call(this),this.dynamicColObserver(),this.filterObserver(),this.props.accountRootStore.accountProjectStore.reset(),this.props.accountRootStore.accountStore.setAccount({}),this.props.tierManagementStore.reset(),(o=(s=this.props.agentPageContextStore)==null?void 0:s.removeContext)==null||o.call(s,"account.sidepanel")}updateAgentPageContext(){var r,l,h,f,v;const t=(l=(r=this.props.accountRootStore)==null?void 0:r.accountStore)==null?void 0:l.account,s=t==null?void 0:t.accountId,o=this.state.selectedNav||null,a=this.state.dynamicColPanelOpen?"column_settings":this.state.filterOpen?"filter_panel":"info_panel";(v=(h=this.props.agentPageContextStore)==null?void 0:h.setContext)==null||v.call(h,"account.sidepanel",[{category:"screen",priority:1,payload:{area:"account",section:o||"account_root",accountId:s,pathname:(f=this.props.location)==null?void 0:f.pathname}},{category:"menu",priority:1,payload:{selectedNav:o,overlayMode:a}}])}updateLocation(t){const s=t.currentTarget.id;this.setState({selectedNav:s})}getPermissionBasedRouting(t,s){var r;const o=!t.feature||this.props.appStore.features[t.feature],a=this.props.permissionsStore.isAuthorized(t.permissions);if(o&&a)return e.jsx(Ns,{path:t.path,element:t.element},`accountnav${s}`);if(!o&&t.featureDisabledRedirect&&a){const l=(r=this.props.accountRootStore.accountStore.account)==null?void 0:r.accountId;return e.jsx(Ns,{path:t.path,element:e.jsx(Yt,{to:l?`/user/accounts/${l}/${t.featureDisabledRedirect}`:"/user/accounts",replace:!0})},`accountnav${s}`)}else return t.name===this.state.selectedNav?(this.props.appStore.setAlertMessages("errormsg.noaccesstoaccount",{},"","error","",!0),e.jsx(Ns,{path:"*",element:e.jsx(Yt,{to:"/user/accounts",replace:!0})},`accountnav${s}`)):e.jsx(e.Fragment,{})}async fetchSubscriptionData(t){await this.props.tierManagementStore.init(t)}render(){let t=null,s=this.state.selectedNav;switch(s){case"users":(this.props.accountRootStore.accountSelectionStore.selectedUser||this.props.accountRootStore.accountSelectionStore.selectedUsers.length)&&(t=e.jsx(vi,{}));break;case"devices":this.props.accountRootStore.accountSelectionStore.selectedDevice&&(t=e.jsx(_s,{}));break;case"ibss":this.props.accountRootStore.accountSelectionStore.selectedIBSS&&(t=e.jsx(ni,{}));break;case"projects":this.props.accountRootStore.accountSelectionStore.selectedProject&&(t=e.jsx(ys,{}));break;case"partners":this.props.accountRootStore.accountSelectionStore.selectedPartner&&(t=e.jsx(hi,{}));break;case"map":this.props.accountRootStore.accountSelectionStore.selectedProject?t=e.jsx(ys,{}):this.props.accountRootStore.accountSelectionStore.selectedDevice&&(t=e.jsx(_s,{}));break;case"analytics":this.props.accountRootStore.accountSelectionStore.selectedProject?t=e.jsx(ys,{}):this.props.accountRootStore.accountSelectionStore.selectedDevice&&(t=e.jsx(_s,{}));break}this.state.dynamicColPanelOpen?(t=e.jsx(ia,{}),s="dynamic-columns"):this.props.listFilterStore.showFilterPanel&&(t=e.jsx(sa,{}),s+="-filter"),this.props.listViewSettingsStore.setIsAnyInfoPanelOpen(!!t);const o=this.props.accountRootStore.accountStore.account,a=o==null?void 0:o.accountId,r=(o==null?void 0:o.accountName)||"";return e.jsxs(I.Fragment,{children:[e.jsx(ya,{accountId:a,accountName:r,selectedNav:this.state.selectedNav,onNavClick:this.updateLocation}),e.jsx(Qo,{className:"account-page",children:e.jsx(ea,{children:this.state.pageLinks.map((l,h)=>this.getPermissionBasedRouting(l,h))})}),e.jsx(ta,{show:!!t,viewName:`accounts-${s}`,onClose:()=>this.closeInfoPanel(s),children:t})]})}}const ji=Rs(ue(de("appStore","accountRootStore","userStore","permissionsStore","listViewSettingsStore","listFilterStore","tierManagementStore","agentPageContextStore"),ie)(Si));class xi extends I.Component{componentDidMount(){this.props.accountRootStore.accountsStore.init(),this.props.accountRootStore.accountsStore.getAllAccounts()}componentWillUnmount(){this.props.accountRootStore.accountProjectStore.setSearchValue(""),this.props.accountRootStore.accountUserStore.setSearchValue(""),this.props.accountRootStore.accountDeviceStore.setSearchValue(""),this.props.accountRootStore.accountMapStore.setSearchValue(""),this.props.accountRootStore.accountPartnerStore.setSearchValue(""),this.props.accountRootStore.accountsStore.reset()}render(){const i=e.jsx(ji,{languageProvider:this.props.languageProvider});return e.jsx(I.Fragment,{children:i})}}const sn=ue(de("accountRootStore"),ie)(xi);export{sn 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.