PageSourceSearch

https://web.mobileinventory.net/static/js/4527.b01341ee.chunk.js

js mobileinventory.net collected 2026-09-24 13:29:38 UTC 36,289 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunkmobileinventory=self.webpackChunkmobileinventory||[]).push([[4527],{60766:(e,s,i)=>{i.d(s,{A:()=>d});var n=i(9950),t=i(97516),a=i(8459),l=i(90373),c=i(40616),r=i(44414);const d=e=>{let{isOpen:s,onClose:i,onSubmit:d,isAuthenticating:o}=e;const[m,u]=(0,n.useState)(""),h=async()=>{m.trim()&&(await d(m),u(""))};return(0,r.jsxs)(t.Ay,{isOpen:s,setIsOpen:i,size:"md",titleId:"su-password-modal-title",children:[(0,r.jsx)(t.rQ,{setIsOpen:i,children:(0,r.jsx)(t.wt,{id:"su-password-modal-title",children:"Admin Authentication Required"})}),(0,r.jsxs)(t.cw,{children:[(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("p",{className:"text-muted mb-3",children:"This page requires admin authentication. Please enter the admin password to continue."}),(0,r.jsx)("label",{htmlFor:"su-admin-password",className:"form-label",children:"Admin Password"}),(0,r.jsx)(l.A,{type:"password",id:"su-admin-password",name:"su-admin-password",placeholder:"Enter admin password",value:m,onChange:e=>u(e.target.value),onKeyPress:e=>{"Enter"===e.key&&!o&&m.trim()&&h()},disabled:o,autoComplete:"off"})]}),o&&(0,r.jsxs)("div",{className:"text-center mt-3",children:[(0,r.jsx)(c.A,{color:"primary",size:"2em"}),(0,r.jsx)("p",{className:"text-muted mt-2",children:"Authenticating..."})]})]}),(0,r.jsxs)(t.jl,{children:[(0,r.jsx)(a.A,{color:"secondary",onClick:()=>{u(""),i()},isDisable:o,children:"Cancel"}),(0,r.jsx)(a.A,{color:"primary",onClick:h,isDisable:o||!m.trim(),children:o?"Authenticating...":"Submit"})]})]})}},234:(e,s,i)=>{i.d(s,{A:()=>r});i(9950);var n=i(48738),t=i.n(n),a=i(74172),l=i(44414);const c=e=>{let{children:s,className:i,color:n,shadow:c,rounded:r,isLight:d,...o}=e;const{darkModeStatus:m}=(0,a.A)();return(0,l.jsx)("span",{className:t()("badge",{["bg-".concat(n)]:!d,["bg-l".concat(m?"o25":"10","-").concat(n)]:d,["text-".concat(n)]:d,["shadow".concat("default"!==c?"-".concat(c):"")]:!!c,["rounded".concat("default"!==r?"-".concat(r):"")]:r,"rounded-0":"bottom"===r||"top"===r||"end"===r||"start"===r||0===r},i),...o,children:s})};c.defaultProps={className:void 0,color:"primary",rounded:null,shadow:null,isLight:!1};const r=c},82612:(e,s,i)=>{i.d(s,{A:()=>o,v:()=>r});var n=i(9950),t=i(48738),a=i.n(t),l=i(10034),c=i(44414);const r=(0,n.forwardRef)(((e,s)=>{let{id:i,className:t,children:r,isInline:d=!1,isValid:o=!1,isTouched:m=!1,invalidFeedback:u,validFeedback:h,isTooltipFeedback:x=!1,...j}=e;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{ref:s,id:i,className:a()({"is-invalid":!o&&m&&u,"is-valid":!o&&m&&!u},t),...j,children:n.Children.map(r,(e=>(0,n.cloneElement)(e,{isInline:e.props.isInline||d,isValid:o,isTouched:m,invalidFeedback:u,validFeedback:h,isTooltipFeedback:x,isValidMessage:!1})))}),(0,c.jsx)(l.A,{isTouched:m,invalidFeedback:u,validFeedback:h,isTooltip:x})]})}));r.displayName="ChecksGroup";const d=(0,n.forwardRef)(((e,s)=>{let{id:i,className:n,name:t=null,type:r="checkbox",label:d=null,value:o,checked:m=!1,disabled:u=!1,isInline:h=!1,isFormCheckInput:x=!1,isValid:j=!1,isTouched:p=!1,invalidFeedback:v,validFeedback:y,isValidMessage:g=!0,isTooltipFeedback:f=!1,onBlur:N,onChange:A,onFocus:w,onInput:S,onInvalid:b,onSelect:L,ariaLabel:F,...k}=e;const C=(0,c.jsx)("input",{ref:s,className:a()("form-check-input",{"mt-0":x,"is-invalid":!j&&p&&v,"is-valid":!j&&p&&!v},n),name:null===t?i:t,type:"radio"===r?"radio":"checkbox",id:i,value:o,checked:"radio"===r?m===o:!!m,disabled:u,onBlur:N,onChange:A,onFocus:w,onInput:S,onInvalid:b,onSelect:L,"aria-label":F,...k});return x?C:(0,c.jsxs)("div",{className:a()("form-check",{"form-switch":"switch"===r,"form-check-inline":h}),children:[C,d&&(0,c.jsx)("label",{className:"form-check-label",htmlFor:i,children:d}),g&&(0,c.jsx)(l.A,{isTouched:p,invalidFeedback:v,validFeedback:y,isTooltip:f})]})}));d.displayName="Checks";const o=d},87733:(e,s,i)=>{i.d(s,{AX:()=>A,U_:()=>f,YK:()=>j,e8:()=>a,gK:()=>x,l:()=>c,lL:()=>l,rc:()=>o,sX:()=>r,tS:()=>N,uI:()=>m});var n=i(1658);const t="suAdminPasswordHash",a=async e=>{const s=(new TextEncoder).encode(e),i=await crypto.subtle.digest("SHA-1",s);return Array.from(new Uint8Array(i)).map((e=>e.toString(16).padStart(2,"0"))).join("")},l=e=>{localStorage.setItem(t,e)},c=()=>localStorage.getItem(t),r=()=>{localStorage.removeItem(t)},d="lastLocation_",o=(e,s)=>{const i="".concat(d).concat(e);localStorage.setItem(i,s)},m=e=>{const s="".concat(d).concat(e);return localStorage.getItem(s)},u="shouldPersistProductFilters",h="productFilters_",x=()=>"true"===localStorage.getItem(u),j=e=>{localStorage.setItem(u,e.toString())},p=e=>{if("string"===typeof e||"number"===typeof e)return String(e)},v=/^\d{4}-\d{2}-\d{2}$/,y=e=>{var s;const i=null===(s=p(e))||void 0===s?void 0:s.trim();return i&&v.test(i)?i:void 0},g=e=>{if(!e||"object"!==typeof e||Array.isArray(e))return{};const s=e,i={};["idLocation","idCategory","idTag","idCustomField","customFieldValue","minStockFieldId","lastUserFilter","searchQuery"].forEach((e=>(e=>{const n=p(s[e]);void 0!==n&&(i[e]=n)})(e))),Object.assign(i,(e=>{const s=y(e.dateFilterFrom),i=y(e.dateFilterTo);if(s||i)return{dateFilterFrom:s,dateFilterTo:i};const n=y(e.dateFilterValue);if(!n)return{};switch(e.dateFilterOperatorType){case"le":return{dateFilterTo:n};case"ge":return{dateFilterFrom:n};default:return{dateFilterFrom:n,dateFilterTo:n}}}
1)(s)),["all","with_stock","without_stock"].includes(String(s.stockFilter))&&(i.stockFilter=s.stockFilter),["less_than","greater_than_or_equal"].includes(String(s.minStockComparison))&&(i.minStockComparison=s.minStockComparison);const t=(0,n.Vj)(s.transactionFieldId);return t&&(i.transactionFieldId=t,(0,n.EO)(s.transactionFieldValue)&&(i.transactionFieldValue=(0,n.nI)(s.transactionFieldValue))),i},f=(e,s)=>{const i="".concat(h).concat(e);localStorage.setItem(i,JSON.stringify(s))},N=e=>{const s="".concat(h).concat(e),i=localStorage.getItem(s);if(!i)return null;try{const e=JSON.parse(i);return!e||"object"!==typeof e||Array.isArray(e)?(localStorage.removeItem(s),null):g(e)}catch(n){return localStorage.removeItem(s),null}},A=e=>{const s="".concat(h).concat(e);localStorage.removeItem(s)}},4642:(e,s,i)=>{i.d(s,{B:()=>l});var n=i(9950),t=i(87733),a=i(59538);const l=()=>{const[e,s]=(0,n.useState)(""),[i,l]=(0,n.useState)(!1),[c,r]=(0,n.useState)(!1),[d,o]=(0,n.useState)(!1),m=(0,n.useCallback)((()=>{const e=(0,t.l)();e?s(e):l(!0),o(!0)}),[]),u=(0,n.useCallback)((()=>{const s=(0,t.l)();return!(!e&&!s)}),[e]),h=(0,n.useCallback)((()=>{const s=e||(0,t.l)();return s?{"X-Admin-Password":s}:{}}),[e]),x=(0,n.useCallback)((()=>{l(!0)}),[]),j=(0,n.useCallback)((()=>{l(!1)}),[]),p=(0,n.useCallback)((()=>{s(""),(0,t.sX)()}),[]),v=(0,n.useCallback)((async e=>{if(e.trim())try{r(!0);const i=await(0,t.e8)(e);s(i),(0,t.lL)(i),l(!1),(0,a.A)("Authentication Successful","Admin authentication completed successfully.","success")}catch(i){console.error("Error hashing password:",i),(0,a.A)("Authentication Error","Failed to process authentication. Please try again.","danger")}finally{r(!1)}else(0,a.A)("Password Required","Please enter the admin password to continue.","warning")}),[]);return(0,n.useEffect)((()=>{m()}),[m]),{adminPassword:e,isPasswordModalOpen:i,isAuthenticating:c,openPasswordModal:x,closePasswordModal:j,handlePasswordSubmit:v,clearAuthentication:p,getAuthHeaders:h,isAuthenticated:u,isInitialized:d}}},4527:(e,s,i)=>{i.r(s),i.d(s,{default:()=>ee});var n=i(9950),t=i(28429),a=i(67818),l=i(75475),c=i(68635),r=i(97976),d=i(81095),o=i(67360),m=i(54203),u=i(72528),h=i(16335),x=i(25102),j=i(80294),p=i(60158),v=i(44813),y=i(85706),g=i(225),f=i(14664),N=i(19571),A=i(29126),w=i(3907),S=i(55096),b=i(36391),L=i(81064),F=i(29975),k=i(83592),C=i(74172),I=i(67527),T=i(3317),_=i(84486),U=i(8459),O=i(97516),P=i(23884),E=i(90373),D=i(24201),R=i(82612),B=i(69004),M=i(44414);const z=e=>{let{isOpen:s,onClose:i,onLicenseAdded:t,adminPassword:l}=e;const{t:c}=(0,a.Bd)(),[r,d]=(0,n.useState)(!1),o=(0,n.useRef)(null),[m,u]=(0,n.useState)({}),[h,x]=(0,n.useState)({}),[j,p]=(0,n.useState)({email:"",licenseType:"sync",validUntil:(()=>{const e=new Date;return e.setMonth(e.getMonth()+1),e.toISOString().split("T")[0]})(),proSyncLicenses:"",proScannerLicenses:"",premiumLicenses:""});(0,n.useEffect)((()=>{s&&o.current&&o.current.focus()}),[s]);const v=e=>{const{name:s,value:i,type:n}=e.target;p((e=>({...e,[s]:"number"===n?Number(i):i}))),u((e=>({...e,[s]:!0})))},y=e=>{p((s=>({...s,licenseType:e}))),u((e=>({...e,licenseType:!0})))};return(0,M.jsxs)(O.Ay,{id:"addLicenseModal",titleId:"addLicenseTitle",isOpen:s,setIsOpen:i,isCentered:!0,isAnimation:!1,children:[(0,M.jsx)(O.rQ,{setIsOpen:i,children:(0,M.jsx)(O.wt,{id:"addLicenseTitle",children:c("trans_AddLicense")})}),(0,M.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),(()=>{const e={};return j.email||(e.email="Required"),j.licenseType.length>15&&(e.licenseType="Required"),j.validUntil||(e.validUntil="Required"),x(e),0===Object.keys(e).length})()){d(!0);const e={email:j.email.trim().toLocaleLowerCase(),licenseType:j.licenseType,validUntil:j.validUntil,..."admin"===j.licenseType&&{proSyncLicenses:Number(j.proSyncLicenses),proScannerLicenses:Number(j.proScannerLicenses),premiumLicenses:Number(j.premiumLicenses)}};try{let s=T.vZ.insertSuLicense(e,l);1==(await(0,T.w$)(s)).status&&(t(),i())}catch(s){(0,B.c)(s),console.error("Error inserting license:",s)}finally{d(!1)}}},children:[(0,M.jsxs)(O.cw,{children:[(0,M.jsxs)(P.A,{tag:"div",children:[(0,M.jsx)(D.A,{htmlFor:"email",style:{fontWeight:"bold"},children:"Email"}),(0,M.jsx)(E.A,{ref:o,id:"email",name:"email",type:"email",value:j.email,onChange:v}),m.email&&h.email?(0,M.jsx)("div",{children:h.email}):(0,M.jsx)(M.Fragment,{})]}),(0,M.jsxs)(R.v,{id:"licenseTypeGroup",style:{marginTop:"16px"},children:[(0,M.jsx)(D.A,{style:{fontWeight:"bold"},children:c("trans_LicenseType")}),(0,M.jsx)(R.A,{id:"syncRadio",type:"radio",label:"PRO",value:"sync",name:"licenseType",checked:j.licenseType,onCh
1ange:()=>y("sync")}),(0,M.jsx)(R.A,{id:"scannerRadio",type:"radio",label:"Scanner+",value:"pro_scanner",name:"licenseType",checked:j.licenseType,onChange:()=>y("pro_scanner")}),(0,M.jsx)(R.A,{id:"premiumRadio",type:"radio",label:c("trans_Premium"),value:"premium",name:"licenseType",checked:j.licenseType,onChange:()=>y("premium")}),(0,M.jsx)(R.A,{id:"adminRadio",type:"radio",label:"Admin of licenses",value:"admin",name:"licenseType",checked:j.licenseType,onChange:()=>y("admin")})]}),"admin"===j.licenseType&&(0,M.jsxs)("div",{style:{marginTop:"16px"},children:[(0,M.jsxs)(P.A,{tag:"div",children:[(0,M.jsx)(D.A,{htmlFor:"proSyncLicenses",style:{fontWeight:"bold"},children:"PRO licenses"}),(0,M.jsx)(E.A,{id:"proSyncLicenses",name:"proSyncLicenses",type:"number",min:0,value:j.proSyncLicenses,onChange:v}),m.proSyncLicenses&&h.proSyncLicenses?(0,M.jsx)("div",{children:h.proSyncLicenses}):(0,M.jsx)(M.Fragment,{})]}),(0,M.jsxs)(P.A,{tag:"div",children:[(0,M.jsx)(D.A,{htmlFor:"proScannerLicenses",style:{fontWeight:"bold"},children:"Scanner+ licenses"}),(0,M.jsx)(E.A,{id:"proScannerLicenses",name:"proScannerLicenses",type:"number",min:0,value:j.proScannerLicenses,onChange:v}),m.proScannerLicenses&&h.proScannerLicenses?(0,M.jsx)("div",{children:h.proScannerLicenses}):(0,M.jsx)(M.Fragment,{})]}),(0,M.jsxs)(P.A,{tag:"div",children:[(0,M.jsx)(D.A,{htmlFor:"premiumLicenses",style:{fontWeight:"bold"},children:"Premium licenses"}),(0,M.jsx)(E.A,{id:"premiumLicenses",name:"premiumLicenses",type:"number",min:0,value:j.premiumLicenses,onChange:v}),m.premiumLicenses&&h.premiumLicenses?(0,M.jsx)("div",{children:h.premiumLicenses}):(0,M.jsx)(M.Fragment,{})]})]}),(0,M.jsxs)(P.A,{tag:"div",style:{marginTop:"16px"},children:[(0,M.jsx)(D.A,{htmlFor:"validUntil",style:{fontWeight:"bold"},children:"Valid until"}),(0,M.jsx)(E.A,{id:"validUntil",name:"validUntil",type:"date",value:j.validUntil,onChange:v}),m.validUntil&&h.validUntil?(0,M.jsx)("div",{children:h.validUntil}):(0,M.jsx)(M.Fragment,{})]})]}),(0,M.jsx)(O.jl,{children:r?(0,M.jsxs)(U.A,{isDisable:!0,color:"primary",size:"lg",children:[(0,M.jsx)(a.x6,{children:"trans_loading"}),"..."]}):(0,M.jsx)(U.A,{icon:"Add",color:"primary",size:"lg",type:"submit",children:c("trans_add")})})]})]})};var V=i(59538),Z=i(60766),q=i(4642),W=i(87733),$=i(234),K=i(15924),Q=i(27453),G=i(90983),H=i(81850),X=i(45833);const J=e=>{let{isOpen:s,onClose:i,data:t}=e;
1const[a,l]=(0,n.useState)(new Set),[c,d]=(0,n.useState)(new Set);if(!t)return null;const o=e=>(0,M.jsxs)("div",{className:"d-flex gap-2 flex-wrap",children:[e.sync&&(0,M.jsx)($.A,{color:"info",children:"Sync"}),e.premium&&(0,M.jsx)($.A,{color:"success",children:"Premium"}),e.pro_scanner&&(0,M.jsx)($.A,{color:"primary",children:"Scanner+"}),e.unlimited_export&&(0,M.jsx)($.A,{color:"warning",children:"Unlimited Export"})]}),m=e=>{if(!e)return"N/A";try{return new Date(e).toLocaleString()}catch{return e}};return(0,M.jsxs)(O.Ay,{isOpen:s,setIsOpen:i,size:"xl",isScrollable:!0,children:[(0,M.jsx)(O.rQ,{setIsOpen:i,children:(0,M.jsx)(O.wt,{id:"license-anomaly-report-modal",children:"License Anomaly Report"})}),(0,M.jsxs)(O.cw,{children:[(0,M.jsxs)(r.Ay,{className:"mb-4",children:[(0,M.jsx)(r.aR,{children:(0,M.jsx)(r.Bh,{children:(0,M.jsx)(r.ZB,{children:"Summary"})})}),(0,M.jsx)(r.bw,{children:(0,M.jsxs)("div",{className:"row g-3",children:[(0,M.jsx)("div",{className:"col-6 col-md-3",children:(0,M.jsxs)("div",{className:"text-center",children:[(0,M.jsx)("div",{className:"h3 text-primary",children:t.summary.totalUsersWithEntitlements}),(0,M.jsx)("div",{className:"text-muted small",children:"Total Users with Entitlements"})]})}),(0,M.jsx)("div",{className:"col-6 col-md-3",children:(0,M.jsxs)("div",{className:"text-center",children:[(0,M.jsx)("div",{className:"h3 text-warning",children:t.summary.usersWithDuplicateLicenses}),(0,M.jsx)("div",{className:"text-muted small",children:"Users with Duplicates"})]})}),(0,M.jsx)("div",{className:"col-6 col-md-3",children:(0,M.jsxs)("div",{className:"text-center",children:[(0,M.jsx)("div",{className:"h3 text-danger",children:t.summary.totalRedundantLicenses}),(0,M.jsx)("div",{className:"text-muted small",children:"Redundant Licenses"})]})}),(0,M.jsx)("div",{className:"col-6 col-md-3",children:(0,M.jsxs)("div",{className:"text-center",children:[(0,M.jsx)("div",{className:"h3 text-info",children:t.summary.usersMissingActiveLicenses}),(0,M.jsx)("div",{className:"text-muted small",children:"Missing Active Licenses"})]})})]})})]}),t.duplicates.length>0&&(0,M.jsxs)(r.Ay,{className:"mb-4",children:[(0,M.jsx)(r.aR,{children:(0,M.jsx)(r.Bh,{children:(0,M.jsxs)(r.ZB,{className:"d-flex align-items-center gap-2",children:[(0,M.jsx)(K.A,{size:20,className:"text-warning"}),"Users with Duplicate Licenses (",t.duplicates.length,")"]})})}),(0,M.jsx)(r.bw,{children:t.duplicates.map((e=>{const s=a.has(e.uid);return(0,M.jsxs)("div",{className:"border rounded p-3 mb-3",children:[(0,M.jsx)("div",{className:"d-flex justify-content-between align-items-start cursor-pointer",onClick:()=>{return s=e.uid,void l((e=>{const i=new Set(e);return i.has(s)?i.delete(s):i.add(s),i}));var s},style:{cursor:"pointer"},children:(0,M.jsxs)("div",{className:"flex-grow-1",children:[(0,M.jsxs)("div",{className:"d-flex align-items-center gap-2 mb-2",children:[s?(0,M.jsx)(Q.A,{size:20}):(0,M.jsx)(G.A,{size:20}),(0,M.jsx)("strong",{children:e.name||e.email}),(0,M.jsxs)($.A,{color:"danger",children:[e.redundantLicenseCount," redundant"]})]}),(0,M.jsxs)("div",{className:"text-muted small mb-2",children:[e.email&&(0,M.jsxs)("div",{children:["Email: ",e.email]}),(0,M.jsxs)("div",{children:["UID: ",e.uid]}),(0,M.jsxs)("div",{children:["Total Active Licenses: ",e.totalActiveLicenses]})]}),o(e.flags)]})}),s&&(0,M.jsx)("div",{className:"mt-3 ps-4",children:e.duplicateGroups.map(((s,i)=>{const n="".concat(e.uid,"-").concat(i),t=c.has(n);return(0,M.jsxs)("div",{className:"border-start border-3 border-warning ps-3 mb-3",children:[(0,M.jsxs)("div",{className:"d-flex align-items-center gap-2 mb-2 cursor-pointer",onClick:e=>{var s;e.stopPropagation(),s=n,d((e=>{const i=new Set(e);return i.has(s)?i.delete(s):i.add(s),i}))},style:{cursor:"pointer"},children:[t?(0,M.jsx)(Q.A,{size:16}):(0,M.jsx)(G.A,{size:16}),(0,M.jsxs)("strong",{children:["Duplicate Group: ",s.signature]}),(0,M.jsxs)($.A,{color:"warning",children:[s.count," copies (",s.redundantCount," ","redundant)"]})]}),t&&(0,M.jsxs)("div",{className:"ms-4",children:[(0,M.jsxs)("div",{className:"small text-muted mb-2",children:[(0,M.jsxs)("div",{children:["License Type:"," ",s.license.license]}),(0,M.jsxs)("div",{children:["License Key:"," ",s.license.licenseKey]}),(0,M.jsxs)("div",{children:["Source:"," ",s.license.licenseSource]})]}),(0,M.jsxs)("div",{className:"mt-2",children:[(0,M.jsx)("strong",{className:"small",children:"Occurrences:"}),(0,M.jsx)("div",{className:"mt-2",children:s.occurrences.map(((e,s)=>{var i;return(0,M.jsxs)("div",{className:"small border rounded p-2 mb-2 bg-light",children:[(0,M.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,M.jsxs)("span",{children:["Index:"," ",e.arrayIndex]}),(0,M.jsxs)("span",{className:"text-muted",children:["ID:"," ",null===(i=e.id)||void 0===i?void 0:i.substring(0,8),"..."]})]}),(0,M.jsxs)("div",{className:"text-muted",children:["Added:"," ",m(e.added)]}),e.licenseObjectIdentifier&&(0,M.jsxs)("div",{className:"text-muted",children:["Object ID:"," ",e.licenseObjectIdentifier]})]},s)}))})]})]})]},i)}))})]},e.uid)}))})]}),t.missingLicenses.length>0&&(0,M.jsxs)(r.Ay,{children:[(0,M.jsx)(r.aR,{children:(0,M.jsx)(r.Bh,{children:(0,M.jsxs)(r.ZB,{className:"d-flex align-items-center gap-2",children:[(0,M.jsx)(H.A,{size:20,className:"text-danger"}),"Users Missing Active Licenses (",t.missingLicenses.length,")"]})})}),(0,M.jsx)(r.bw,{children:t.missingLicenses.map((e=>(0,M.jsx)("div",{className:"border rounded p-3 mb-3",children:(0,M.jsx)("div",{className:"d-flex justify-content-between align-items-start",children:(0,M.jsxs)("div",{className:"flex-grow-1",children:[(0,M.jsx)("strong",{children:e.name||e.email}),(0,M.jsxs)("div",{className:"text-muted small mb-2",children:[e.email&&(0,M.jsxs)("div",{children:["Email: ",e.email]}),(0,M.jsxs)("div",{children:["UID: ",e.uid]}),(0,M.jsxs)("div",{children:["Active Licenses (v1): ",e.activeLicensesCount]}),(0,M.jsxs)("div",{children:["Active Licenses (v2): ",e.activeLicensesV2Count]})]}),o(e.flags)]})})},e.uid)))})]}),0===t.duplicates.length&&0===t.missingLicenses.length&&(0,M.jsx)(r.Ay,{children:(0,M.jsx)(r.bw,{children:(0,M.jsxs)("div",{className:"text-center py-5",children:[(0,M.jsx)(X.A,{size:48,className:"text-success mb-3"}),(0,M.jsx)("h4",{children:"No Anomalies Detected"}),(0,M.jsx)("p",{className:"text-muted",children:"All licenses are properly configured."})]})})})]}),(0,M.jsx)(O.jl,{children:(0,M.jsx)(U.A,{color:"light",onClick:i,children:"Close"})})]})};var Y=i(94962);const ee=()=>{var e,s,i;const{darkModeStatus:O}=(0,C.A)(),{i18n:P,t:E}=((0,t.Zp)(),(0,a.Bd)()),{user:D,setUser:R}=(0,n.useContext)(I.A),{userInfo:B,fetchUserInfo:$,isLoading:K}
1=(0,n.useContext)(_.A),[Q,G]=(0,n.useState)(null),[H,X]=(0,n.useState)(null),[ee,se]=(0,n.useState)(!1),[ie,ne]=(0,n.useState)(!1),[te,ae]=(0,n.useState)(!1),[le,ce]=(0,n.useState)(!1),[re,de]=(0,n.useState)(!1),[oe,me]=(0,n.useState)(!1),[ue,he]=(0,n.useState)(!1),[xe,je]=(0,n.useState)(!1),[pe,ve]=(0,n.useState)(null),{adminPassword:ye,isPasswordModalOpen:ge,isAuthenticating:fe,openPasswordModal:Ne,closePasswordModal:Ae,handlePasswordSubmit:we,clearAuthentication:Se,getAuthHeaders:be,isAuthenticated:Le,isInitialized:Fe}=(0,q.B)();(0,n.useEffect)((()=>{$&&$()}),[$]);const ke=e=>{const s=null===Q||void 0===Q?void 0:Q[e];return null!==s&&void 0!==s&&s.byOS?Object.entries(s.byOS).filter((e=>{let[s,i]=e;return void 0!==i&&i>0})).map((e=>{let[s,i]=e;return{name:s,value:i}})):[]},Ce=e=>{const s=null===Q||void 0===Q?void 0:Q[e];return null!==s&&void 0!==s&&s.bySeatType?[{name:"Individual",value:s.bySeatType.individual||0},{name:"Team",value:s.bySeatType.team||0}]:[]},Ie=e=>{let{title:s,total:i,osData:n,seatData:t}=e;const a=(e=>{const s=["#0088FE","#00C49F","#FFBB28","#FF8042","#8884d8","#82ca9d","#ffc658","#ff7c43","#665191","#a05195"];if(e<=s.length)return s.slice(0,e);const i=[...s];for(;i.length<e;)i.push(s[i.length%s.length]);return i})(n.length);return(0,M.jsxs)(r.Ay,{className:"mb-4",children:[(0,M.jsx)(r.aR,{children:(0,M.jsx)(r.Bh,{children:(0,M.jsx)(r.ZB,{children:s})})}),(0,M.jsxs)(r.bw,{children:[(0,M.jsxs)("div",{className:"row g-4",children:[(0,M.jsxs)("div",{className:"col-12 col-md-4 text-center",children:[(0,M.jsx)("div",{className:"h2 mb-2",children:i}),(0,M.jsx)("div",{className:"text-muted",children:"Total Licenses"})]}),(0,M.jsx)("div",{className:"col-12 col-md-4",children:(0,M.jsx)("div",{style:{height:"200px"},children:n.length>0&&(0,M.jsx)(d.u,{width:"100%",height:"100%",children:(0,M.jsxs)(o.r,{children:[(0,M.jsx)(m.F,{data:n,innerRadius:40,outerRadius:80,paddingAngle:5,dataKey:"value",children:n.map(((e,s)=>(0,M.jsx)(u.f,{fill:a[s%a.length]},"cell-".concat(s))))}),(0,M.jsx)(h.m,{}),(0,M.jsx)(x.s,{})]})})})}),(0,M.jsx)("div",{className:"col-12 col-md-4",children:(0,M.jsx)("div",{style:{height:"200px"},children:t.length>0&&(0,M.jsx)(d.u,{width:"100%",height:"100%",children:(0,M.jsxs)(j.E,{data:t,children:[(0,M.jsx)(p.W,{dataKey:"name"}),(0,M.jsx)(v.h,{}),(0,M.jsx)(h.m,{}),(0,M.jsx)(y.y,{dataKey:"value",fill:"#8884d8"})]})})})})]}),(0,M.jsxs)("div",{className:"row mt-4",children:[(0,M.jsxs)("div",{className:"col-6",children:[(0,M.jsx)("h5",{className:"mb-3",children:"Operating Systems"}),n.map(((e,s)=>{let{name:i,value:n}=e;return(0,M.jsxs)("div",{className:"d-flex align-items-center mb-2",children:[(t=i,{mac:(0,M.jsx)(g.A,{className:"w-4 h-4"}),macos:(0,M.jsx)(g.A,{className:"w-4 h-4"}),android:(0,M.jsx)(f.A,{className:"w-4 h-4"}),ios:(0,M.jsx)(f.A,{className:"w-4 h-4"}),windows:(0,M.jsx)(N.A,{className:"w-4 h-4"}),linux:(0,M.jsx)(A.A,{className:"w-4 h-4"}),tablet:(0,M.jsx)(w.A,{className:"w-4 h-4"}),tv:(0,M.jsx)(N.A,{className:"w-4 h-4"}),watch:(0,M.jsx)(S.A,{className:"w-4 h-4"}),unknown:(0,M.jsx)(b.A,{className:"w-4 h-4"})}[t.toLowerCase().replace(/[\s-_]/g,"")]||(0,M.jsx)(b.A,{className:"w-4 h-4"})),(0,M.jsxs)("span",{className:"ms-2",style:{color:a[s%a.length]},children:[i,": ",n]})]},i);var t}))]}),(0,M.jsxs)("div",{className:"col-6",children:[(0,M.jsx)("h5",{className:"mb-3",children:"Seat Types"}),t.map((e=>{let{name:s,value:i}=e;return(0,M.jsxs)("div",{className:"d-flex align-items-center mb-2",children:["Individual"===s?(0,M.jsx)(L.A,{className:"w-4 h-4"}):(0,M.jsx)(F.A,{className:"w-4 h-4"}),(0,M.jsxs)("span",{className:"ms-2",children:[s,": ",i]})]},s)}))]})]})]})]})};return(0,M.jsx)(l.A,{title:E(k.Tb.myprofile.text).toString(),children:(0,M.jsxs)(c.A,{container:"fluid",children:[(0,M.jsx)("div",{className:"display-5 fw-bold py-2",children:"Licenses"}),(0,M.jsxs)(r.Ay,{children:[(0,M.jsx)(r.aR,{children:(0,M.jsx)(r.ZB,{children:"Admin Actions"})}),(0,M.jsx)(r.bw,{children:(0,M.jsxs)("div",{className:"row g-4 mb-4",children:[(0,M.jsx)("div",{className:"col-12 col-md-2",children:(0,M.jsx)(U.A,{color:"light",className:"w-full justify-start",onClick:async()=>{(async()=>
1{if(Fe&&Le())try{se(!0),X(null);const e=ye||(0,W.l)();if(!e)return Se(),X("Authentication required. Please re-authenticate."),void Ne();let s=await T.vZ.getLicensesSummary(e);const i=await(0,T.w$)(s);G(i.data)}catch(i){var e,s;if(console.error("Error fetching licenses:",i),null!==(e=i.message)&&void 0!==e&&e.includes("401")||null!==(s=i.message)&&void 0!==s&&s.includes("Unauthorized"))return Se(),X("Authentication failed. Please re-authenticate."),void Ne();X(i.message||"Failed to fetch license data")}finally{se(!1)}})()},children:"Show licenses summary \u25bc"})}),(0,M.jsx)("div",{className:"col-12 col-md-2",children:(0,M.jsxs)("div",{className:"space-y-2",children:[(0,M.jsx)(U.A,{color:"danger",className:"w-full justify-start",onClick:async()=>{if(Le())try{ne(!0);const e=ye||(0,W.l)();if(!e)return Se(),void Ne();let s=await T.vZ.validateLicenses(e);await(0,T.w$)(s);(0,V.A)("Success","License validation completed successfully.","success")}catch(i){var e,s;if(null!==(e=i.message)&&void 0!==e&&e.includes("401")||null!==(s=i.message)&&void 0!==s&&s.includes("Unauthorized"))return Se(),void Ne();(0,V.A)("Error",i.message||"Failed to validate licenses","danger")}finally{ne(!1)}},children:ie?"Loading...":"Revalidate the current license state"}),(0,M.jsx)("p",{className:"text-sm text-gray-500 px-2",children:"This action will iterate through all the licenses and verify their license state. (G Play, Stripe, Apple Pay, Internal licenses)"})]})}),(0,M.jsx)("div",{className:"col-12 col-md-2",children:(0,M.jsxs)("div",{className:"space-y-2",children:[(0,M.jsx)(U.A,{color:"success",className:"w-full justify-start",onClick:async()=>{me(!0)},children:"Add license"}),(0,M.jsx)(U.A,{color:"primary",className:"w-full justify-start mt-2",onClick:async()=>{je(!0)},children:"Restore Stripe licenses"})]})}),(0,M.jsx)("div",{className:"col-12 col-md-2",children:(0,M.jsxs)("div",{className:"space-y-2",children:[(0,M.jsx)(U.A,{color:"info",className:"w-full justify-start",onClick:async()=>{if(Le()){ae(!0);try{const e=ye||(0,W.l)();if(!e)return Se(),void Ne();let s=await T.vZ.sendMonthlyIosLicenseReport(e);await(0,T.w$)(s);(0,V.A)("Success","Monthly report sent successfully","success")}catch(H){var e,s;if(console.error("Error sending monthly report:",H),null!==(e=H.message)&&void 0!==e&&e.includes("401")||null!==(s=H.message)&&void 0!==s&&s.includes("Unauthorized"))return Se(),void Ne();(0,V.A)("Error","Failed to send monthly report","danger")}finally{ae(!1)}}},children:te?"Sending...":"Send monthly iOS license report"}),(0,M.jsx)("p",{className:"text-sm text-gray-500 px-2",children:"Send a monthly iOS license report to administrators"})]})}),(0,M.jsx)("div",{className:"col-12 col-md-2",children:(0,M.jsxs)("div",{className:"space-y-2",children:[(0,M.jsx)(U.A,{color:"warning",className:"w-full justify-start",onClick:async()=>{if(Le()){ce(!0);try{const e=ye||(0,W.l)();if(!e)return Se(),void Ne();let s=await T.vZ.sendCurrentPaidLicenseUsageReport(e);await(0,T.w$)(s);(0,V.A)("Success","Current license usage report sent successfully","success")}catch(H){var e,s;if(console.error("Error sending usage report:",H),null!==(e=H.message)&&void 0!==e&&e.includes("401")||null!==(s=H.message)&&void 0!==s&&s.includes("Unauthorized"))return Se(),void Ne();(0,V.A)("Error","Failed to send usage report","danger")}finally{ce(!1)}}},children:le?"Sending...":"Send usage report"}),(0,M.jsx)("p",{className:"text-sm text-gray-500 px-2",children:"Send current PAID license usage report to administrators"})]})}),(0,M.jsx)("div",{className:"col-12 col-md-2",children:(0,M.jsxs)("div",{className:"space-y-2",children:[(0,M.jsx)(U.A,{color:"primary",className:"w-full justify-start",onClick:async()=>{if(Le()){de(!0);try{const e=ye||(0,W.l)();if(!e)return Se(),void Ne();let s=await T.vZ.detectLicenseAnomalies(e);const i=await(0,T.w$)(s);ve(i.data),he(!0),(0,V.A)("Success","License anomaly detection completed successfully","success")}catch(H){var e,s;if(console.error("Error detecting license anomalies:",H),null!==(e=H.message)&&void 0!==e&&e.includes("401")||null!==(s=H.message)&&void 0!==s&&s.includes("Unauthorized"))return Se(),void Ne();
1(0,V.A)("Error","Failed to detect license anomalies","danger")}finally{de(!1)}}},children:re?"Detecting...":"Detect anomalies"}),(0,M.jsx)("p",{className:"text-sm text-gray-500 px-2",children:"Detect and report license anomalies in the system"})]})})]})})]}),(0,M.jsx)("br",{}),ee&&(0,M.jsx)("div",{className:"d-flex justify-content-center py-4",children:(0,M.jsx)("div",{className:"spinner-border text-primary",role:"status",children:(0,M.jsx)("span",{className:"visually-hidden",children:"Loading..."})})}),H&&(0,M.jsx)("div",{className:"alert alert-danger",role:"alert",children:H}),Q&&!ee&&!H&&(0,M.jsxs)("div",{className:"p-4",children:[(0,M.jsxs)("div",{className:"row g-4 mb-4",children:[(0,M.jsx)("div",{className:"col-12 col-md-6",children:(0,M.jsxs)(r.Ay,{children:[(0,M.jsx)(r.aR,{children:(0,M.jsx)(r.Bh,{children:(0,M.jsx)(r.ZB,{children:"Total Paying Users"})})}),(0,M.jsxs)(r.bw,{children:[(0,M.jsx)("div",{className:"row text-center g-4 mb-5",children:(0,M.jsxs)("div",{className:"col-12",children:[(0,M.jsx)("div",{className:"display-4 text-center",children:Q.total_users||0}),(0,M.jsx)("div",{className:"text-muted",children:"Total paying users"})]})}),(0,M.jsxs)("div",{className:"row text-center g-4",children:[(0,M.jsxs)("div",{className:"col-4",children:[(0,M.jsx)("div",{className:"h4",children:(null===(e=Q.sync)||void 0===e?void 0:e.total)||0}),(0,M.jsx)("div",{className:"text-muted",children:"Sync Licenses"})]}),(0,M.jsxs)("div",{className:"col-4",children:[(0,M.jsx)("div",{className:"h4",children:(null===(s=Q.pro_scanner)||void 0===s?void 0:s.total)||0}),(0,M.jsx)("div",{className:"text-muted",children:"Scanner+ Licenses"})]}),(0,M.jsxs)("div",{className:"col-4",children:[(0,M.jsx)("div",{className:"h4",children:(null===(i=Q.premium)||void 0===i?void 0:i.total)||0}),(0,M.jsx)("div",{className:"text-muted",children:"Premium Licenses"})]})]})]})]})}),Q.admin&&(0,M.jsx)("div",{className:"col-12 col-md-6",children:(0,M.jsxs)(r.Ay,{children:[(0,M.jsx)(r.aR,{children:(0,M.jsx)(r.Bh,{children:(0,M.jsx)(r.ZB,{children:"Admin Users Overview"})})}),(0,M.jsxs)(r.bw,{children:[(0,M.jsx)("div",{className:"row text-center g-4 mb-5",children:(0,M.jsxs)("div",{className:"col-12",children:[(0,M.jsx)("div",{className:"display-4 text-center",children:Q.admin_users_count||0}),(0,M.jsx)("div",{className:"text-muted",children:"Total Admin Users"})]})}),(0,M.jsxs)("div",{className:"row text-center g-4",children:[(0,M.jsxs)("div",{className:"col-4",children:[(0,M.jsx)("div",{className:"h3",children:Q.admin.sync_licences||0}),(0,M.jsx)("div",{className:"text-muted",children:"Sync Licenses"})]}),(0,M.jsxs)("div",{className:"col-4",children:[(0,M.jsx)("div",{className:"h3",children:Q.admin.pro_scanner_licences||0}),(0,M.jsx)("div",{className:"text-muted",children:"Scanner+ Licenses"})]}),(0,M.jsxs)("div",{className:"col-4",children:[(0,M.jsx)("div",{className:"h3",children:Q.admin.premium_licences||0}),(0,M.jsx)("div",{className:"text-muted",children:"Premium Licenses"})]})]})]})]})})]}),Q.sync&&(0,M.jsx)(Ie,{title:"Sync",total:Q.sync.total,osData:ke("sync"),seatData:Ce("sync")}),Q.pro_scanner&&(0,M.jsx)(Ie,{title:"Scanner+",total:Q.pro_scanner.total,osData:ke("pro_scanner"),seatData:Ce("pro_scanner")}),Q.premium&&(0,M.jsx)(Ie,{title:"Premium",total:Q.premium.total,osData:ke("premium"),seatData:Ce("premium")})]}),(0,M.jsx)(z,{isOpen:oe,onClose:()=>{me(!1)},onLicenseAdded:()=>{(0,V.A)("License added","")},adminPassword:ye||(0,W.l)()||""}),(0,M.jsx)(J,{isOpen:ue,onClose:()=>{he(!1)},data:pe}),(0,M.jsx)(Y.A,{isOpen:xe,onClose:()=>{je(!1)},adminPassword:ye||(0,W.l)()||""}),(0,M.jsx)(Z.A,{isOpen:ge,onClose:Ae,onSubmit:we,isAuthenticating:fe})]})})}},94962:(e,s,i)=>{i.d(s,{A:()=>x});var n=i(9950),t=i(97516),a=i(23884),l=i(90373),c=i(24201),r=i(8459),d=i(3317),o=i(67818),m=i(69004),u=i(59538),h=i(44414);const x=e=>{let{isOpen:s,onClose:i,adminPassword:x,initialEmail:j="",initialUid:p=""}=e;const{t:v}=(0,o.Bd)(),[y,g]=(0,n.useState)(!1),[f,N]=(0,n.useState)(j),[A,w]=(0,n.useState)(p),[S,b]=(0,n.useState)(null);(0,n.useEffect)((()=>{N(j),w(p)}),[j,p]);return(0,h.jsxs)(t.Ay,{id:"restoreStripeLicensesModal",titleId:"restoreStripeLicensesTitle",isOpen:s,setIsOpen:i,isCentered:!0,isAnimation:!1,children:[(0,h.jsx)(t.rQ,{setIsOpen:i,children:(0,h.jsx)(t.wt,{id:"restoreStripeLicensesTitle",children:"Restore Stripe Licenses"})}),(0,h.jsxs)(t.cw,{children:[(0,h.jsx)("p",{className:"text-muted mb-4",children:"This will search for all Stripe customers associated with the provided email or UID and restore any active subscriptions as licenses in the system."}),(0,h.jsxs)(a.A,{className:"mb-3",children:[(0,h.jsx)(c.A,{htmlFor:"restoreEmail",children:"User Email"}),(0,h.jsx)(l.A,{id:"restoreEmail",type:"email",value:f,onChange:e=>{N(e.target.value),e.target.value&&w("")},placeholder:"Enter user email",disabled:y})]}),(0,h.jsx)("div",{className:"text-center my-2",children:"- OR -"}),(0,h.jsxs)(a.A,{className:"mb-3",children:[(0,h.jsx)(c.A,{htmlFor:"restoreUid",children:"User UID"}),(0,h.jsx)(l.A,{id:"restoreUid",type:"text",value:A,onChange:e=>{w(e.target.value),e.target.value&&N("")},placeholder:"Enter user UID",disabled:y})]}),S&&(0,h.jsx)("div",{className:"alert alert-danger mt-3",role:"alert",children:S})]}),(0,h.jsxs)(t.jl,{children:[(0,h.jsx)(r.A,{color:"secondary",onClick:i,isDisable:y,children:"Cancel"}),(0,h.jsx)(r.A,{color:"primary",onClick:async()=>
1{if(f.trim()||A.trim()){g(!0),b(null);try{const e={};f.trim()?e.email=f.trim():A.trim()&&(e.uid=A.trim());const s=d.vZ.restoreStripeLicensesForUser(e,x),n=await(0,d.w$)(s);1===n.status?((0,u.A)("Success",n.message||"Licenses restored successfully","success"),i()):b(n.message||"Failed to restore licenses")}catch(e){(0,m.c)(e),b(e.message||"An unexpected error occurred")}finally{g(!1)}}else b("Please enter either an email or a UID")},isDisable:y||!f.trim()&&!A.trim(),children:y?"Restoring...":"Restore Licenses"})]})]})}},1658:(e,s,i)=>{i.d(s,{BI:()=>x,EO:()=>u,Le:()=>a,Vj:()=>m,nI:()=>o,q_:()=>c,sh:()=>v,vS:()=>p,yn:()=>j});const n=["category","location","stock","min_stock","user","date","tags","custom_field"],t=(e,s,i)=>{const n=e(s);return"string"===typeof n&&n!==s?n:i},a=e=>(e=>"string"===typeof e&&n.includes(e))(e)?e:"category",l=(e,s)=>{switch(e){case"location":return t(s,"pinned_filter_option_location","Location");case"stock":return t(s,"pinned_filter_option_stock","Stock");case"min_stock":return t(s,"pinned_filter_option_min_stock","Minimum stock");case"user":return t(s,"pinned_filter_option_user","User");case"date":return t(s,"pinned_filter_option_date","Date");case"tags":return t(s,"pinned_filter_option_tags","Tags");case"custom_field":return t(s,"pinned_filter_option_custom_field","Custom field");default:return t(s,"pinned_filter_option_category","Category")}},c=e=>n.map((s=>({value:s,label:l(s,e)}))),r=/^[1-9]\d*$/,d=/[\u0000-\u001f\u007f-\u009f]/,o=e=>"string"===typeof e?e.trim():"",m=e=>{if("number"===typeof e&&Number.isSafeInteger(e)&&e>0)return e.toString();if("string"===typeof e){const s=e.trim();return r.test(s)?s:""}return""},u=e=>{const s=o(e);return s.length>0&&!d.test(s)},h=e=>{return s=e.transactionFieldId,m(s).length>0&&u(e.transactionFieldValue);var s},x=e=>{const s=Number("function"===typeof e.getType?e.getType():e.idType);return!("function"===typeof e.getIsSystemField?e.getIsSystemField():1===Number(e.isSystemField))&&2005!==s&&2008!==s},j=(e,s)=>{if(!e.transactionFieldId||s.includes(e.transactionFieldId))return e;const{transactionFieldId:i,transactionFieldValue:n,...t}=e;return t},p=e=>Boolean(e.idLocation||e.idCategory||e.idTag||e.stockFilter&&"all"!==e.stockFilter||e.idCustomField&&e.customFieldValue||h(e)||e.minStockFieldId||e.lastUserFilter||e.dateFilterFrom||e.dateFilterTo||e.searchQuery),v=e=>{var s;if(null===e||void 0===e||!e.rows)return{all:0,withStock:0,withoutStock:0};let i=null===(s=e.columns)||void 0===s?void 0:s.findIndex((e=>{var s;return null===(s=e.className)||void 0===s?void 0:s.includes("c_totalstock")}));var n;-1===i&&(i=null===(n=e.columns)||void 0===n?void 0:n.findIndex((e=>{var s;return"totalStock"===e.data||"TotalStock"===e.data||(null===(s=e.data)||void 0===s?void 0:s.toLowerCase().includes("stock"))})));if(-1===i)return{all:e.rows.length,withStock:0,withoutStock:0};const t=e.rows[0];let a=null;if(Array.isArray(t))a=e=>e[i];else if("object"===typeof t){const s=e.columns[i].data;a=e=>e[s]}if(!a)return{all:e.rows.length,withStock:0,withoutStock:0};const l=e.rows.filter((e=>parseFloat(a(e)||0)>0)).length;return{all:e.rows.length,withStock:l,withoutStock:e.rows.length-l}}}}]);
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e594d2da-1805-5dc9-a363-6fb9f94f91bb")}catch(e){}}();
3//# debugId=e594d2da-1805-5dc9-a363-6fb9f94f91bb

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.