PageSourceSearch

https://dashboard.xfa.tech/static/js/7025.1728daae.chunk.js

js xfa.tech collected 2026-09-24 09:29:53 UTC 71,069 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkxfa_dashboard=self.webpackChunkxfa_dashboard||[]).push([[7025],{98(e,n,i){i.d(n,{A:()=>l});i(9950);var t=i(44414);const l=e=>{let n=e.className,i=e.text,l=void 0===i?"beta":i;return(0,t.jsxs)("span",{className:n?"beta-tag ".concat(n):"beta-tag","aria-hidden":"true","data-testid":"beta-badge",children:["(",l,")"]})}},497(e,n,i){i.d(n,{D6:()=>u,f9:()=>s,iP:()=>o,ku:()=>c,p0:()=>l,pz:()=>a,w5:()=>r,y9:()=>d});var t=i(89379);const l=10,r=1e4,s=e=>{var n;return null!==(n=null===e||void 0===e?void 0:e.trim().toLowerCase())&&void 0!==n?n:""},a=e=>Number.isInteger(e)&&e>=1&&e<=r,o=e=>{const n=null===e||void 0===e?void 0:e.TrialUserLimit;return void 0!==n&&a(n)?n:l},c=(e,n)=>(e=>{const n=new Set;for(const i of null!==e&&void 0!==e?e:[]){const e=s(i.email);e&&n.add(e)}return n.size})(e)>n,d=(e,n)=>{const i=new Set;for(const t of e){const e=s(t.email);if(e&&i.add(e),i.size>=n)break}return Array.from(i)},u=e=>{const n=[],i=new Map;for(const l of e){const e=s(l.email),r=e?i.get(e):void 0;if(!r){const r=(0,t.A)((0,t.A)({},l),{},{devices:[...l.devices]});n.push(r),e&&i.set(e,r);continue}const a=new Set(r.devices.map(e=>e.device_id).filter(Boolean));r.devices.push(...l.devices.filter(e=>!e.device_id||!a.has(e.device_id)))}return n}},17025(e,n,i){i.r(n),i.d(n,{default:()=>Se});var t=i(89379),l=i(5544),r=i(9950),s=i(55030),a=i(87233),o=i(20032),c=i(8145),d=i(2046),u=i(16497),m=i(93038),g=i(65429),h=i(25277),x=i(21923),y=i(46639),v=i(83274),p=i(49715),A=i(82259),f=i(71172),j=i(54992),b=i(4159),P=i.n(b),B=i(1320),C=i(70693),L=i(15769),D=i(69780),M=i(9213),_=i(21671),N=i(34075),T=i(23935),S=i(62852),E=i(40379),I=i(20760),O=i(74987),U=i(25235),Y=i(65029),k=i(96583),F=i(40033),w=i(28170),z=i(25979),R=i(60899),W=i(92743),H=i(79739),q=i(10226),G=i(24494),K=i(81134),V=i(77195);const Q=e=>Math.round(100*e)/100,$=e=>"number"===typeof e&&Number.isFinite(e)&&e>0,J=e=>e&&e.isValid()?e.startOf("day"):void 0;function X(e){return"monthly-fixed"===e||"yearly-per-user"===e}function Z(e){return"monthly-fixed"===e.billingModel?e.nrOfMonthlyLicenses:e.nrOfYearlyLicenses}function ee(e){return X(e.billingModel)&&(e.freeUsers||0)>(Z(e)||0)}function ne(e,n){const i=e.startOf("month");return i.date(Math.min(n,i.daysInMonth()))}function ie(e,n,i,t,l){if(!$(e)||!$(n)||!i)return;const r=i.add(n,"month");return!l.isBefore(i)&&l.isBefore(r)?{percentage:e,endsOn:r,amount:Q(t*e/100)}:void 0}function te(e,n){const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:P()()).startOf("day"),l=e.billingModel,r={model:l,reasons:[],monthlyWithoutStartDate:!1,endDateRecentlyPassed:!1,freeExceedsLicenses:ee(e)};if("trial"===l)return r.reasons.push("notBilled"),r;const s=J(e.startDate),a=J(e.trialEnds),o=J(e.endDate),c="yearly"===l||"yearly-per-user"===l;if(e.payingCustomer||r.reasons.push("notPayingCustomer"),a&&i.isBefore(a)&&r.reasons.push("trialRunning"),s&&i.isBefore(s)&&r.reasons.push("startDateInFuture"),!s&&c&&r.reasons.push("startDateMissing"),o&&o.isBefore(i)&&(o.isBefore(i.startOf("month").subtract(2,"month"))?r.reasons.push("contractEnded"):r.endDateRecentlyPassed=!0),"monthly-fixed"===l||c){const n="monthly-fixed"===l?e.perUserPrice:"yearly"===l?e.totalYearlyPrice:e.perUserYearlyPrice;$(n)||r.reasons.push("priceMissing"),X(l)&&(Z(e)||0)<=0&&r.reasons.push("licensesMissing")}else("monthly-per-user"!==l||$(e.perUserPrice))&&("monthly-per-device"!==l||$(e.insightPrice)||$(e.connectPrice))||r.reasons.push("priceMissing");return r.calculation=function(e,n,i){let l;if(X(e.billingModel)){const n="monthly-fixed"===e.billingModel?e.perUserPrice:e.perUserYearlyPrice,i=Z(e)||0;if(!$(n)||i<=0)return;const t=Math.max(e.freeUsers||0,0),r=Math.max(i-t,0);l={licenses:i,freeLicenses:t,billedLicenses:r,unitPrice:n,subtotal:Q(r*n)}}else{if("yearly"!==e.billingModel)return;if(!$(e.totalYearlyPrice))return;l={subtotal:Q(e.totalYearlyPrice)}}const r=[ie(e.discountPercentage,e.discountDurationMonths,J(e.discountStartDate),l.subtotal,i),ie(n.DiscountCodePercentage,n.DiscountCodeDurationMonths,n.DiscountCodeStartDate?J(P()(n.DiscountCodeStartDate,"YYYYMMDD")):void 0,l.subtotal,i)].filter(e=>void 0!==e),s=Math.max(Q(l.subtotal-r.reduce((e,n)=>
1e+n.amount,0)),0);return(0,t.A)((0,t.A)({},l),{},{discounts:r,total:s})}(e,n,i),r.calculation&&r.calculation.total<=0&&r.reasons.push("zeroAmount"),s&&"monthly-fixed"===l?r.renewal=function(e,n){if(e.isAfter(n))return{cadence:"monthly",anchor:e,next:e};const i=ne(n,e.date()),t=i.isAfter(n)?ne(n.subtract(1,"month"),e.date()):i;return{cadence:"monthly",anchor:e,next:ne(t.add(1,"month"),e.date()),currentPeriodStart:t}}(s,i):s&&c&&(r.renewal=function(e,n){if(e.isAfter(n))return{cadence:"yearly",anchor:e,next:e};const i=i=>ne(n.date(1).year(i).month(e.month()),e.date()),t=i(n.year()),l=t.isAfter(n)?i(n.year()-1):t;return{cadence:"yearly",anchor:e,next:i(l.year()+1),currentPeriodStart:l}}(s,i)),r.monthlyWithoutStartDate="monthly-fixed"===l&&!s,c&&e.billExtraLicenses&&(r.extraLicenses={licenses:e.nrOfYearlyLicenses||0,pricePerUser:$(e.perUserPrice)?e.perUserPrice:void 0}),r}var le=i(44414);const re="D MMM YYYY",se=e=>{let n=e.state,i=e.billingSettings,t=e.now;const l=(0,s.Bd)(),r=l.t,o=l.i18n,c=te(n,i,t),d=e=>new Intl.NumberFormat((null===o||void 0===o?void 0:o.language)||"en",{style:"currency",currency:n.currency||"EUR"}).format(e),u=e=>{var i,t;switch(e){case"notBilled":return r("Billing.summaryNotBilled");case"notPayingCustomer":return r("Billing.summaryReasonNotPayingCustomer");case"trialRunning":return r("Billing.summaryReasonTrialRunning",{date:n.trialEnds.format(re)});case"startDateInFuture":return r("Billing.summaryReasonStartDateInFuture",{date:null===(i=n.startDate)||void 0===i?void 0:i.format(re)});case"startDateMissing":return r("Billing.summaryReasonStartDateMissing");case"contractEnded":return r("Billing.summaryReasonContractEnded",{date:null===(t=n.endDate)||void 0===t?void 0:t.format(re)});case"priceMissing":return r("Billing.summaryReasonPriceMissing");case"licensesMissing":return r("Billing.summaryReasonLicensesMissing");case"zeroAmount":return r("Billing.summaryReasonZeroAmount",{amount:d(0)})}},m=c.calculation,h=c.renewal,x=c.reasons,y="trial"===c.model,v=0===x.length,p="yearly"===c.model||"yearly-per-user"===c.model;let A;A=y?r("Billing.summaryNotBilledTitle"):v?m?r(p?"Billing.summaryInvoiceTitleYearly":"Billing.summaryInvoiceTitleMonthly",{total:d(m.total)}):r("Billing.summaryInvoiceTitleUsageBased"):r("Billing.summaryNoInvoiceTitle");const f=[];var j;(!m||v||x.includes("zeroAmount")||f.push(r(p?"Billing.summaryOnceStartedYearly":"Billing.summaryOnceStartedMonthly",{total:d(m.total)})),void 0!==(null===m||void 0===m?void 0:m.licenses)&&void 0!==m.unitPrice&&f.push(m.freeLicenses?r("Billing.summaryCalculation",{licenses:m.licenses,free:m.freeLicenses,billed:m.billedLicenses,price:d(m.unitPrice),subtotal:d(m.subtotal)}):r("Billing.summaryCalculationNoFree",{licenses:m.licenses,price:d(m.unitPrice),subtotal:d(m.subtotal)})),null===m||void 0===m||m.discounts.forEach(e=>f.push(r("Billing.summaryDiscount",{percentage:e.percentage,amount:d(e.amount),date:e.endsOn.format(re)}))),"monthly-per-user"===c.model&&f.push(r("Billing.summaryUsageBasedPerUser",{minimum:n.minimumMonthlyLicenses||0,free:n.freeUsers||0})),"monthly-per-device"===c.model&&f.push(r("Billing.summaryUsageBasedPerDevice",{free:n.freeDevices||0})),h&&(f.push("yearly"===h.cadence?r("Billing.summaryRenewalYearly",{anniversary:h.anchor.format("D MMMM"),date:h.next.format(re)}):r("Billing.summaryRenewalMonthly",{day:h.anchor.date(),date:h.next.format(re)})),v&&h.currentPeriodStart&&f.push(r("Billing.summaryCurrentPeriod",{date:h.currentPeriodStart.format(re)}))),c.extraLicenses&&!x.includes("zeroAmount")&&f.push(void 0!==c.extraLicenses.pricePerUser?r("Billing.summaryExtraLicenses",{licenses:c.extraLicenses.licenses,price:d(c.extraLicenses.pricePerUser)}):r("Billing.summaryExtraLicensesNoPrice")),c.monthlyWithoutStartDate&&f.push(r("Billing.summaryNoStartDateMonthly")),c.endDateRecentlyPassed)&&f.push(r("Billing.summaryEndDateRecentlyPassed",{date:null===(j=n.endDate)||void 0===j?void 0:j.format(re)}));return X(c.model)&&f.push(r("Billing.summaryAdditionsNote")),(0,le.jsxs)(g.A,{role:"status",severity:y?"info":v?"success":"warning",sx:{position:"sticky",top:0,zIndex:2,mb:2,border:1,borderColor:"divider"},children:[(0,le.jsx)(W.A,{children:A}),x.map(e=>(0,le.jsx)(a.A,{variant:"body2",sx:{mt:.5,fontWeight:600,color:"inherit"},children:u(e)},e)),!y&&f.map((e,n)=>(0,le.jsx)(a.A,{variant:"body2",sx:{mt:.5},children:e},n))]})};var ae=i(74745),oe=i(29277),ce=i(23114),de=i(77966),ue=i(67378),me=i(81831),ge=i(95359),he=i(83250),xe=i(497);const ye=e=>{var n,i,t,l,r,m;
1let x=e.state,y=e.onChange,v=e.offerUsageBased,p=void 0!==v&&v,A=e.offerFixedYearlyTotal,f=void 0!==A&&A;const j=(0,s.Bd)().t,b=(0,V.Qn)(x.currency),P=(0,V._M)(x.billingModel),B=ee(x),C=B?j("Billing.freeLicensesExceedLicenses",{free:x.freeUsers,licenses:Z(x)}):j("Billing.freeLicensesHint"),L=x.billExtraLicenses&&!((null!==(n=x.perUserPrice)&&void 0!==n?n:0)>0),D=(0,le.jsx)(R.Ay,{item:!0,xs:12,children:(0,le.jsxs)(o.A,{sx:{border:1,borderColor:"divider",borderRadius:1,p:2},children:[(0,le.jsxs)(o.A,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:[(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{checked:x.billExtraLicenses,onChange:e=>y({billExtraLicenses:e.target.checked})}),label:j("Billing.billExtraLicenses")}),(0,le.jsx)(h.A,{size:"small",color:"warning",variant:"outlined",label:j("Billing.billExtraLicensesNotRecommendedTitle")})]}),(0,le.jsx)(a.A,{variant:"caption",color:"text.secondary",display:"block",children:j("Billing.billExtraLicensesHint")}),x.billExtraLicenses&&(0,le.jsx)(c.A,{sx:{mt:2,width:{xs:"100%",md:"50%"}},InputLabelProps:{shrink:!0},required:!0,id:"extraUserPrice",value:null!==(i=x.perUserPrice)&&void 0!==i?i:"",type:"number",inputProps:{step:"0.01",min:0},label:j("Billing.extraUserPriceMonthly"),error:L,helperText:j(L?"Billing.extraUserPriceMissing":"Billing.extraUserPriceMonthlyHint"),variant:"outlined",onChange:e=>y({perUserPrice:(0,V.$J)(e.target.value)}),InputProps:{startAdornment:(0,le.jsx)(d.A,{position:"start",children:b})}})]})}),M=e=>{const n={billingModel:e};switch(e){case"trial":n.totalYearlyPrice=void 0,n.perUserYearlyPrice=void 0,n.nrOfYearlyLicenses=0,n.nrOfMonthlyLicenses=0,n.perUserPrice=void 0,n.insightPrice=0,n.connectPrice=0,n.freeDevices=0,n.minimumMonthlyLicenses=0,n.billExtraLicenses=!1;break;case"monthly-per-device":n.totalYearlyPrice=void 0,n.perUserYearlyPrice=void 0,n.nrOfYearlyLicenses=0,n.nrOfMonthlyLicenses=0,n.perUserPrice=void 0,n.billExtraLicenses=!1;break;case"monthly-per-user":n.totalYearlyPrice=void 0,n.perUserYearlyPrice=void 0,n.nrOfYearlyLicenses=0,n.nrOfMonthlyLicenses=0,n.insightPrice=0,n.connectPrice=0,n.freeDevices=0,n.billExtraLicenses=!1;break;case"monthly-fixed":n.totalYearlyPrice=void 0,n.perUserYearlyPrice=void 0,n.nrOfYearlyLicenses=0,n.insightPrice=0,n.connectPrice=0,n.freeDevices=0,n.minimumMonthlyLicenses=0,n.billExtraLicenses=!1;break;case"yearly":n.perUserYearlyPrice=void 0,n.nrOfMonthlyLicenses=0,n.minimumMonthlyLicenses=0,n.insightPrice=0,n.connectPrice=0,n.freeDevices=0,n.perUserPrice=void 0;break;case"yearly-per-user":n.totalYearlyPrice=void 0,n.nrOfMonthlyLicenses=0,n.minimumMonthlyLicenses=0,n.insightPrice=0,n.connectPrice=0,n.freeDevices=0,n.perUserPrice=void 0}y(n)};return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(a.A,{variant:"h6",sx:{mt:1},children:j("Billing.billingModelTitle")}),(0,le.jsx)(a.A,{variant:"body2",color:"text.secondary",sx:{mb:1},children:j("Billing.billingModelHint")}),(0,le.jsx)(ae.A,{})]}),(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(oe.A,{id:"billing-period-question",children:j("Billing.billingPeriodQuestion")}),(0,le.jsxs)(ce.A,{row:!0,"aria-labelledby":"billing-period-question",value:P,onChange:e=>M((0,V.Gh)(e.target.value)),children:[(0,le.jsx)(u.A,{value:"none",control:(0,le.jsx)(de.A,{}),label:j("Billing.billingPeriodNone")}),(0,le.jsx)(u.A,{value:"monthly",control:(0,le.jsx)(de.A,{}),label:j("Billing.billingPeriodMonthly")}),(0,le.jsx)(u.A,{value:"yearly",control:(0,le.jsx)(de.A,{}),label:j("Billing.billingPeriodYearly")}),(p||"legacy"===P)&&(0,le.jsx)(u.A,{value:"legacy",control:(0,le.jsx)(de.A,{}),label:j("Billing.billingPeriodLegacy")})]})]}),("legacy"===P||"yearly"===P&&(f||"yearly"===x.billingModel))&&(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(oe.A,{id:"billing-pricing-question",children:j("Billing.billingPricingQuestion")}),(0,le.jsx)(ce.A,{row:!0,"aria-labelledby":"billing-pricing-question",value:x.billingModel,onChange:e=>M(e.target.value),children:"yearly"===P?(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(u.A,{value:"yearly-per-user",control:(0,le.jsx)(de.A,{}),label:j("Billing.billingPricingPerLicense")}),(0,le.jsx)(u.A,{value:"yearly",control:(0,le.jsx)(de.A,{}),label:j("Billing.billingPricingFixedTotal")})]}):(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(u.A,{value:"monthly-per-user",control:(0,le.jsx)(de.A,{}),label:j("Billing.billingLegacyPerUser")}),(0,le.jsx)(u.A,{value:"monthly-per-device",control:(0,le.jsx)(de.A,{}),label:j("Billing.billingLegacyPerDevice")})]})}),"legacy"===P&&(0,le.jsx)(g.A,{severity:"warning",sx:{mt:1},children:j("Billing.usageBasedDeprecationWarning")}),"yearly"===x.billingModel&&(0,le.jsx)(g.A,{severity:"warning",role:"note",sx:{mt:1},children:j("Billing.fixedYearlyDeprecationWarning")})]}),"trial"!==x.billingModel&&(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsxs)(c.A,{fullWidth:!0,select:!0,InputLabelProps:{shrink:!0},required:!0,id:"currency",value:x.currency,label:j("Billing.currency"),variant:"outlined",onChange:e=>y({currency:e.target.value}),SelectProps:{native:!0},children:[(0,le.jsx)("option",{value:"USD",children:"USD"}),(0,le.jsx)("option",{value:"EUR",children:"EUR"}),(0,le.jsx)("option",{value:"GBP",children:"GBP"})]})}),"trial"===x.billingModel&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(me.$,{dateAdapter:ge.R,children:(0,le.jsx)(ue.l,{label:j("Billing.trialEndDate"),value:x.trialEnds,onChange:e=>e&&y({trialEnds:e}),slotProps:{textField:{helperText:j("Billing.trialEndsHint")}}})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,required:!0,InputLabelProps:{shrink:!0},id:"trialUserLimit",type:"number",value:x.trialUserLimit,label:j("Billing.trialUserLimit"),helperText:j("Billing.trialUserLimitHint",{max:xe.w5}),error:!(0,xe.pz)(x.trialUserLimit),inputProps:{min:1,max:xe.w5,step:1},onChange:e=>
1y({trialUserLimit:Number(e.target.value)})})})]}),"monthly-per-device"===x.billingModel&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"insightPrice",value:x.insightPrice,type:"number",inputProps:{step:"0.01"},label:j("Billing.insightPrice"),helperText:j("Billing.insightPriceHint"),variant:"outlined",onChange:e=>{var n;return y({insightPrice:null!==(n=(0,V.$J)(e.target.value))&&void 0!==n?n:0})},InputProps:{startAdornment:(0,le.jsx)(d.A,{position:"start",children:b})}})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"connectPrice",value:x.connectPrice,type:"number",inputProps:{step:"0.01"},label:j("Billing.connectPrice"),helperText:j("Billing.connectPriceHint"),variant:"outlined",onChange:e=>{var n;return y({connectPrice:null!==(n=(0,V.$J)(e.target.value))&&void 0!==n?n:0})},InputProps:{startAdornment:(0,le.jsx)(d.A,{position:"start",children:b})}})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"freeDevices",value:x.freeDevices,type:"number",label:j("Billing.freeDevicesForm"),helperText:j("Billing.freeDevicesHint"),variant:"outlined",onChange:e=>y({freeDevices:(0,V.cG)(e.target.value)})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"minimumMonthlyLicenses",type:"number",label:j("Billing.minimumMonthlyLicenses"),helperText:j("Billing.minimumMonthlyLicensesHint"),value:x.minimumMonthlyLicenses,onChange:e=>y({minimumMonthlyLicenses:parseInt(e.target.value)||0}),variant:"outlined"})})]}),"monthly-per-user"===x.billingModel&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"perUserPrice",value:null!==(t=x.perUserPrice)&&void 0!==t?t:"",type:"number",inputProps:{step:"0.01"},label:j("Billing.perUserPrice"),helperText:j("Billing.perUserPriceHint"),variant:"outlined",onChange:e=>y({perUserPrice:(0,V.$J)(e.target.value)}),InputProps:{startAdornment:(0,le.jsx)(d.A,{position:"start",children:b})}})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"freeUsers",value:x.freeUsers,type:"number",label:j("Billing.freeLicenses"),helperText:j("Billing.freeLicensesUsageHint"),variant:"outlined",onChange:e=>y({freeUsers:parseInt(e.target.value)||0})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"minimumMonthlyLicenses",type:"number",label:j("Billing.minimumMonthlyLicenses"),helperText:j("Billing.minimumMonthlyLicensesHint"),value:x.minimumMonthlyLicenses,onChange:e=>y({minimumMonthlyLicenses:parseInt(e.target.value)||0}),variant:"outlined"})})]}),"monthly-fixed"===x.billingModel&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"perUserPrice",value:null!==(l=x.perUserPrice)&&void 0!==l?l:"",type:"number",inputProps:{step:"0.01"},label:j("Billing.pricePerLicenseMonthly"),helperText:j("Billing.pricePerLicenseMonthlyHint"),variant:"outlined",onChange:e=>y({perUserPrice:(0,V.$J)(e.target.value)}),InputProps:{startAdornment:(0,le.jsx)(d.A,{position:"start",children:b})}})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"nrOfMonthlyLicenses",value:x.nrOfMonthlyLicenses,type:"number",inputProps:{min:0},label:j("Billing.licenseCount"),helperText:j("Billing.licensesMonthlyHint"),variant:"outlined",onChange:e=>y({nrOfMonthlyLicenses:parseInt(e.target.value)||0})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"freeUsers",value:x.freeUsers,type:"number",inputProps:{min:0},label:j("Billing.freeLicenses"),error:B,helperText:C,variant:"outlined",onChange:e=>y({freeUsers:parseInt(e.target.value)||0})})})]}),"yearly"===x.billingModel&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"totalYearlyPrice",value:null!==(r=x.totalYearlyPrice)&&void 0!==r?r:"",type:"number",inputProps:{step:"0.01"},label:j("Billing.totalYearlyPrice"),helperText:j("Billing.totalYearlyPriceHint"),variant:"outlined",onChange:e=>y({totalYearlyPrice:(0,V.$J)(e.target.value)}),InputProps:{startAdornment:(0,le.jsx)(d.A,{position:"start",children:b})}})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"nrOfYearlyLicenses",value:x.nrOfYearlyLicenses,type:"number",inputProps:{min:0},label:j("Billing.licenseCount"),helperText:j("Billing.licensesFixedTotalHint"),variant:"outlined",onChange:e=>y({nrOfYearlyLicenses:parseInt(e.target.value)||0})})}),D]}),"yearly-per-user"===x.billingModel&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"perUserYearlyPrice",value:null!==(m=x.perUserYearlyPrice)&&void 0!==m?m:"",type:"number",inputProps:{step:"0.01"},label:j("Billing.pricePerLicenseYearly"),helperText:j("Billing.pricePerLicenseYearlyHint"),variant:"outlined",onChange:e=>y({perUserYearlyPrice:(0,V.$J)(e.target.value)}),InputProps:{startAdornment:(0,le.jsx)(d.A,{position:"start",children:b})}})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"nrOfYearlyLicenses",value:x.nrOfYearlyLicenses,type:"number",inputProps:{min:0},label:j("Billing.licenseCount"),helperText:j("Billing.licensesYearlyHint"),variant:"outlined",onChange:e=>y({nrOfYearlyLicenses:parseInt(e.target.value)||0})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"freeUsers",value:x.freeUsers,type:"number",inputProps:{min:0},label:j("Billing.freeLicenses"),error:B,helperText:C,variant:"outlined",onChange:e=>y({freeUsers:parseInt(e.target.value)||0})})}),D]})]})},ve=e=>
1{let n=e.state,i=e.onChange;const t=(0,s.Bd)().t,l=(0,V._M)(n.billingModel),r="yearly"===l,o=t("yearly"===l?"Billing.startDateHintYearly":"monthly"===l?"Billing.startDateHintMonthly":"Billing.startDateHint");return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(a.A,{variant:"h6",sx:{mt:2},children:t("Billing.sectionContract")}),(0,le.jsx)(a.A,{variant:"body2",color:"text.secondary",sx:{mb:1},children:t("Billing.sectionContractHint")}),(0,le.jsx)(ae.A,{})]}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"paymentTermInDays",value:n.paymentTermInDays,type:"number",label:t("Billing.paymentTermInDays"),helperText:t("Billing.paymentTermInDaysHint"),variant:"outlined",onChange:e=>i({paymentTermInDays:(0,V.cG)(e.target.value)})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"partner",value:n.partner,label:t("Billing.partner"),helperText:t("Billing.partnerHint"),variant:"outlined",onChange:e=>i({partner:e.target.value})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"poNumber",value:n.poNumber,label:t("Billing.poNumber"),helperText:t("Billing.poNumberHint"),variant:"outlined",onChange:e=>i({poNumber:e.target.value})})}),"trial"!==n.billingModel&&(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(me.$,{dateAdapter:ge.R,children:(0,le.jsx)(ue.l,{label:t("Billing.trialEndDate"),value:n.trialEnds,onChange:e=>e&&i({trialEnds:e}),slotProps:{textField:{helperText:t("Billing.trialEndsHint")}}})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(me.$,{dateAdapter:ge.R,children:(0,le.jsx)(ue.l,{label:t("Billing.startDate"),value:n.startDate,onChange:e=>i({startDate:e}),slotProps:{textField:{required:r,error:r&&!n.startDate,helperText:o}}})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(me.$,{dateAdapter:ge.R,children:(0,le.jsx)(ue.l,{label:t("Billing.endDate"),value:n.endDate,onChange:e=>i({endDate:e}),slotProps:{textField:{helperText:t("Billing.endDateHint")}}})})}),(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(a.A,{variant:"h6",sx:{mt:2},children:t("Billing.sectionAccountStatus")}),(0,le.jsx)(ae.A,{})]}),(0,le.jsxs)(R.Ay,{item:!0,xs:12,md:6,children:[(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{checked:n.payingCustomer,onChange:e=>i({payingCustomer:e.target.checked})}),label:t("Billing.payingCustomer")}),(0,le.jsx)(a.A,{variant:"caption",color:"text.secondary",display:"block",children:t("Billing.payingCustomerHint")})]}),(0,le.jsxs)(R.Ay,{item:!0,xs:12,md:6,children:[(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{checked:n.blockedAccess,onChange:e=>i({blockedAccess:e.target.checked})}),label:t("Billing.blockedAccess")}),(0,le.jsx)(a.A,{variant:"caption",color:"text.secondary",display:"block",children:t("Billing.blockedAccessHint")})]})]})};var pe=i(23266),Ae=i(44426),fe=i(38028);const je=new Set(Object.values(Ae.T)),be=e=>e.filter(e=>je.has(e)),Pe=e=>{var n,i,l,o,d,m;let h=e.state,x=e.onChange,y=e.globalPlans,v=e.plansStatus;const p=(0,s.Bd)().t,A="loaded"===v,f=r.useMemo(()=>new Set(y.map(e=>e.planName)),[y]),j=r.useMemo(()=>new Set(y.flatMap(e=>be(e.featureFlags))),[y]),b=e=>{const n=h.featureFlags.filter(e=>!j.has(e));for(const i of e)n.includes(i)||n.push(i);return n},P=e=>{x({paymentPlan:(0,t.A)((0,t.A)({},h.paymentPlan),e)})};return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(a.A,{variant:"h6",sx:{mt:4,mb:2},children:"Feature flags"}),(0,le.jsx)(ae.A,{})]}),(0,le.jsx)(fe.Ay,{selectedFlags:h.featureFlags,onToggle:(e,n)=>{const i=n?h.featureFlags.includes(e)?h.featureFlags:[...h.featureFlags,e]:h.featureFlags.filter(n=>n!==e);x({featureFlags:i})}}),(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(a.A,{variant:"h6",sx:{mt:4,mb:2},children:p("Billing.paymentPlan")}),(0,le.jsx)(a.A,{variant:"body2",color:"text.secondary",sx:{mb:1},children:p("Billing.sectionPaymentPlanHint")}),(0,le.jsx)(ae.A,{})]}),"error"===v&&(0,le.jsx)(R.Ay,{item:!0,xs:12,children:(0,le.jsx)(g.A,{severity:"error",children:p("Billing.planLoadError")})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsxs)(c.A,{fullWidth:!0,select:!0,InputLabelProps:{shrink:!0},required:!0,id:"paymentPlanName",value:h.planNameOption,label:p("Billing.paymentPlanName"),disabled:!A,helperText:p("loading"===v?"Billing.paymentPlanNameLoading":"Billing.paymentPlanNameHint"),variant:"outlined",onChange:e=>(e=>{if(e===V.__){var n,i;const e=(0,V.Kf)(null!==(n=h.paymentPlan.Name)&&void 0!==n?n:"")?"":null!==(i=h.paymentPlan.Name)&&void 0!==i?i:"";x({planNameOption:V.__,customPlanName:e,paymentPlan:(0,t.A)((0,t.A)({},h.paymentPlan),{},{Name:e})})}else{const n=y.find(n=>n.planName===e);if(!n)return;x({planNameOption:e,customPlanName:"",paymentPlan:(0,t.A)((0,t.A)({},n.paymentPlan),{},{Name:e}),featureFlags:b(be(n.featureFlags))})}})(e.target.value),children:[V.PB.map(e=>(0,le.jsx)(pe.A,{value:e,disabled:!f.has(e),children:e},e)),(0,le.jsx)(pe.A,{value:V.__,children:p("Billing.paymentPlanCustomOption")})]})}),h.planNameOption===V.__&&(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,id:"customPaymentPlanName",value:h.customPlanName,label:p("Billing.paymentPlanCustomLabel"),variant:"outlined",onChange:e=>x({customPlanName:e.target.value,paymentPlan:(0,t.A)((0,t.A)({},h.paymentPlan),{},{Name:e.target.value})})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,type:"number",id:"nrOfPolicies",value:null!==(n=h.paymentPlan.NrOfPolicies)&&void 0!==n?n:0,label:p("Billing.nrOfPolicies"),helperText:p("Billing.nrOfPoliciesHint"),variant:"outlined",onChange:e=>P({NrOfPolicies:parseInt(e.target.value)})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,type:"number",id:"nrOfDiscovery",value:null!==(i=h.paymentPlan.NrOfDiscovery)&&void 0!==i?i:0,label:p("Billing.nrOfDiscovery"),helperText:p("Billing.nrOfDiscoveryHint"),variant:"outlined",onChange:e=>P({NrOfDiscovery:parseInt(e.target.value)})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},required:!0,type:"number",id:"nrOfEnforcement",value:null!==(l=h.paymentPlan.NrOfEnforcement)&&void 0!==l?l:0,label:p("Billing.nrOfEnforcement"),helperText:p("Billing.nrOfEnforcementHint"),variant:"outlined",onChange:e=>P({NrOfEnforcement:parseInt(e.target.value)})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,select:!0,InputLabelProps:{shrink:!0},required:!0,id:"awarenessVerificationFrequency",value:null!==(o=h.paymentPlan.AwarenessVerificationFrequency)&&void 0!==o?o:"none",label:p("Billing.awarenessVerificationFrequency"),helperText:p("Billing.awarenessVerificationFrequencyHint"),variant:"outlined",onChange:e=>P({AwarenessVerificationFrequency:e.target.value}),children:V.Mx.map(e=>(0,le.jsx)(pe.A,{value:e.value,children:p(e.translationKey)},e.value))})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,select:!0,InputLabelProps:{shrink:!0},required:!0,id:"awarenessRiskFrequency",value:null!==(d=h.paymentPlan.AwarenessRiskFrequency)&&void 0!==d?d:"none",label:p("Billing.awarenessRiskFrequency"),helperText:p("Billing.awarenessRiskFrequencyHint"),variant:"outlined",onChange:e=>P({AwarenessRiskFrequency:e.target.value}),children:V.Mx.map(e=>(0,le.jsx)(pe.A,{value:e.value,children:p(e.translationKey)},e.value))})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,select:!0,InputLabelProps:{shrink:!0},required:!0,id:"adminSecurityReports",value:null!==(m=h.paymentPlan.AdminSecurityReports)&&void 0!==m?m:"none",label:p("Billing.adminSecurityReports"),helperText:p("Billing.adminSecurityReportsHint"),variant:"outlined",onChange:e=>P({AdminSecurityReports:e.target.value}),children:V.Mx.map(e=>(0,le.jsx)(pe.A,{value:e.value,children:p(e.translationKey)},e.value))})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{
1checked:h.paymentPlan.CustomIntegration||!1,onChange:e=>P({CustomIntegration:e.target.checked})}),label:p("Billing.customIntegration")})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{checked:h.paymentPlan.Cves||!1,onChange:e=>P({Cves:e.target.checked})}),label:p("Billing.cves")})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{checked:h.paymentPlan.Mfa||!1,onChange:e=>P({Mfa:e.target.checked})}),label:p("Billing.mfa")})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{checked:h.paymentPlan.AdvancedMfa||!1,onChange:e=>P({AdvancedMfa:e.target.checked})}),label:p("Billing.advancedMfa")})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{checked:h.paymentPlan.ExportToGRC||!1,onChange:e=>P({ExportToGRC:e.target.checked})}),label:p("Billing.exportToGRC")})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(u.A,{control:(0,le.jsx)(he.w,{checked:h.paymentPlan.ApplyDuringTrial||!1,onChange:e=>P({ApplyDuringTrial:e.target.checked})}),label:p("Billing.applyDuringTrial")})})]})},Be=e=>{var n,i;let t=e.state,l=e.billingSettings,r=e.onChange;const o=(0,s.Bd)().t;return(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(a.A,{variant:"h6",sx:{mt:2},children:o("Billing.sectionDiscounts")}),(0,le.jsx)(a.A,{variant:"body2",color:"text.secondary",sx:{mb:1},children:o("Billing.sectionDiscountsHint")}),(0,le.jsx)(ae.A,{})]}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:4,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"discountPercentage",value:null!==(n=t.discountPercentage)&&void 0!==n?n:"",type:"number",inputProps:{step:"0.1",min:0,max:100},label:o("Billing.discountPercentageField"),helperText:o("Billing.discountPercentageFieldHint"),variant:"outlined",onChange:e=>r({discountPercentage:e.target.value?parseFloat(e.target.value):void 0}),InputProps:{endAdornment:(0,le.jsx)(d.A,{position:"end",children:"%"})}})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:4,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"discountDurationMonths",value:null!==(i=t.discountDurationMonths)&&void 0!==i?i:"",type:"number",inputProps:{min:0},label:o("Billing.discountDurationMonthsField"),helperText:o("Billing.discountDurationMonthsFieldHint"),variant:"outlined",onChange:e=>r({discountDurationMonths:e.target.value?parseInt(e.target.value):void 0})})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:4,children:(0,le.jsx)(me.$,{dateAdapter:ge.R,children:(0,le.jsx)(ue.l,{label:o("Billing.discountStartDateField"),value:t.discountStartDate,onChange:e=>r({discountStartDate:e}),slotProps:{textField:{helperText:o("Billing.discountStartDateFieldHint")}}})})}),l.DiscountCodeID&&(0,le.jsx)(R.Ay,{item:!0,xs:12,children:(0,le.jsxs)(a.A,{variant:"body2",color:"text.secondary",children:[o("Billing.discountCodeApplied"),":"," ",(0,le.jsx)("strong",{children:l.DiscountCodeID})," \u2014 ",l.DiscountCodePercentage,"%"," ",o("Billing.forDuration",{months:l.DiscountCodeDurationMonths})]})})]})},Ce=e=>{let n=e.organizationId,i=e.billingSettings,t=e.state,o=e.onChange;const d=(0,s.Bd)().t,u=r.useState(!1),m=(0,l.A)(u,2),h=m[0],x=m[1],v=r.useState(!1),p=(0,l.A)(v,2),f=p[0],j=p[1],b=r.useState(""),P=(0,l.A)(b,2),T=P[0],S=P[1],E=(0,V._o)(t.billingModel);return(0,le.jsxs)(le.Fragment,{children:[i.MidCycleLicenseAdditions&&i.MidCycleLicenseAdditions.length>0&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsx)(R.Ay,{item:!0,xs:12,children:(0,le.jsx)(a.A,{variant:"subtitle2",sx:{mt:1},children:d("Billing.midCycleLicenses")})}),(0,le.jsx)(R.Ay,{item:!0,xs:12,children:(0,le.jsx)(B.A,{component:C.A,variant:"outlined",children:(0,le.jsxs)(L.A,{size:"small",children:[(0,le.jsx)(D.A,{children:(0,le.jsxs)(M.A,{children:[(0,le.jsx)(_.A,{children:d("Billing.midCycleDate")}),(0,le.jsx)(_.A,{children:d("Billing.midCycleQuantity")}),(0,le.jsx)(_.A,{children:d("Billing.midCyclePrice")}),(0,le.jsx)(_.A,{children:d("Billing.midCycleBillingCycle")}),(0,le.jsx)(_.A,{children:d("Billing.midCycleBilled")})]})}),(0,le.jsx)(N.A,{children:i.MidCycleLicenseAdditions.map((e,n)=>(0,le.jsxs)(M.A,{children:[(0,le.jsx)(_.A,{children:e.AddedDate}),(0,le.jsx)(_.A,{children:e.Quantity}),(0,le.jsx)(_.A,{children:e.PricePerLicense}),(0,le.jsx)(_.A,{children:e.BillingCycle}),(0,le.jsx)(_.A,{children:e.Billed?"\u2713":"\u2014"})]},n))})]})})})]}),E&&(0,le.jsxs)(le.Fragment,{children:[(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[(0,le.jsx)(a.A,{variant:"h6",sx:{mt:2},children:d("Billing.addLicensesTitle")}),(0,le.jsx)(a.A,{variant:"body2",color:"text.secondary",sx:{mb:1},children:d("Billing.addLicensesHint")}),(0,le.jsx)(ae.A,{})]}),(0,le.jsx)(R.Ay,{item:!0,xs:12,md:6,children:(0,le.jsx)(c.A,{fullWidth:!0,InputLabelProps:{shrink:!0},id:"addLicenseQuantity",type:"number",inputProps:{min:1},label:d("Billing.addLicensesQuantity"),value:t.addLicenseQuantity||"",onChange:e=>o({addLicenseQuantity:parseInt(e.target.value)||0}),variant:"outlined"})}),(0,le.jsxs)(R.Ay,{item:!0,xs:12,children:[T&&(0,le.jsx)(g.A,{severity:"error",sx:{mb:1},children:T}),f&&(0,le.jsx)(g.A,{severity:"success",sx:{mb:1},children:d("Billing.addLicensesSuccess")}),(0,le.jsx)(q.A,{variant:"contained",size:"small",disabled:h||t.addLicenseQuantity<=0,onClick:async()=>
1{if(!(t.addLicenseQuantity<=0)&&E){x(!0),S(""),j(!1);try{await A.Ay.addMidCycleLicenses(n,{quantity:t.addLicenseQuantity}),j(!0),o({addLicenseQuantity:0})}catch(e){S(d("Billing.addLicensesError"))}finally{x(!1)}}},children:h?(0,le.jsx)(y.A,{size:20}):d("Billing.addLicensesButton")})]})]})]})};const Le=e=>{const n=(0,s.Bd)().t,i=(0,K.d)().addToast,o=e=>"".concat("billing"===e.part?n("Billing.saveBillingSettingsFailed"):n("Billing.saveOrganizationSettingsFailed")).concat(e.serverMessage?" ".concat(n("Billing.saveSettingsServerResponse",{message:e.serverMessage})):""),c=r.useState(()=>function(e,n){var i,t,l,r,s,a,o,c,d,u,m,g,h,x,y,v,p,A,f;const j=(null!==(i=null===(t=e.PaymentPlan)||void 0===t?void 0:t.Name)&&void 0!==i?i:"").trim(),b=(0,V.Kf)(j)?j:V.__;return{billingModel:(0,V.l1)(e),insightPrice:null!==(l=e.InsightPrice)&&void 0!==l?l:0,connectPrice:null!==(r=e.ConnectPrice)&&void 0!==r?r:0,freeDevices:null!==(s=e.FreeDevices)&&void 0!==s?s:0,perUserPrice:e.PerUserPrice,freeUsers:e.FreeUsers||0,trialUserLimit:(0,xe.iP)(e),currency:e.Currency||"EUR",totalYearlyPrice:e.TotalYearlyPrice,perUserYearlyPrice:null!==(a=e.PerUserYearlyPrice)&&void 0!==a?a:void 0,nrOfYearlyLicenses:e.NrOfYearlyLicenses||0,billExtraLicenses:e.BillExtraLicenses||!1,minimumMonthlyLicenses:e.MinimumMonthlyLicenses||0,nrOfMonthlyLicenses:e.NrOfMonthlyLicenses||0,trialEnds:P()(e.TrialEndDate,"YYYYMMDD"),startDate:e.StartDate?P()(e.StartDate,"YYYYMMDD"):null,endDate:e.EndDate?P()(e.EndDate,"YYYYMMDD"):null,paymentTermInDays:e.PaymentTermInDays||30,poNumber:e.PONumber||"",partner:e.Partner||"",payingCustomer:e.PayingCustomer||!1,blockedAccess:e.BlockedAccess||!1,discountPercentage:e.DiscountPercentage,discountDurationMonths:e.DiscountDurationMonths,discountStartDate:e.DiscountStartDate?P()(e.DiscountStartDate,"YYYYMMDD"):null,paymentPlan:{Name:(null===(o=e.PaymentPlan)||void 0===o?void 0:o.Name)||"",NrOfPolicies:(null===(c=e.PaymentPlan)||void 0===c?void 0:c.NrOfPolicies)||0,NrOfDiscovery:(null===(d=e.PaymentPlan)||void 0===d?void 0:d.NrOfDiscovery)||0,AwarenessVerificationFrequency:(0,G.kR)(null===(u=e.PaymentPlan)||void 0===u?void 0:u.AwarenessVerificationFrequency),AwarenessRiskFrequency:(0,G.kR)(null===(m=e.PaymentPlan)||void 0===m?void 0:m.AwarenessRiskFrequency),NrOfEnforcement:(null===(g=e.PaymentPlan)||void 0===g?void 0:g.NrOfEnforcement)||0,CustomIntegration:(null===(h=e.PaymentPlan)||void 0===h?void 0:h.CustomIntegration)||!1,AdminSecurityReports:(0,G.kR)(null===(x=e.PaymentPlan)||void 0===x?void 0:x.AdminSecurityReports),Cves:(null===(y=e.PaymentPlan)||void 0===y?void 0:y.Cves)||!1,Mfa:(null===(v=e.PaymentPlan)||void 0===v?void 0:v.Mfa)||!1,AdvancedMfa:(null===(p=e.PaymentPlan)||void 0===p?void 0:p.AdvancedMfa)||!1,ExportToGRC:(null===(A=e.PaymentPlan)||void 0===A?void 0:A.ExportToGRC)||!1,ApplyDuringTrial:(null===(f=e.PaymentPlan)||void 0===f?void 0:f.ApplyDuringTrial)||!1},planNameOption:b,customPlanName:b===V.__?j:"",featureFlags:n.feature_flags||[],addLicenseQuantity:0}}(e.billingSettings,e.organization)),d=(0,l.A)(c,2),u=d[0],m=d[1],h=r.useState([]),x=(0,l.A)(h,2),y=x[0],v=x[1],p=r.useState("loading"),f=(0,l.A)(p,2),j=f[0],b=f[1],B=r.useState(!1),C=(0,l.A)(B,2),L=C[0],D=C[1],M=r.useState([]),_=(0,l.A)(M,2),N=_[0],T=_[1],S="trial"===u.billingModel&&!(0,xe.pz)(u.trialUserLimit),E=ee(u),I="yearly"===(0,V._M)(u.billingModel)&&!u.startDate,O=(0,V.JG)(e.billingSettings),U=e=>{m(n=>(0,t.A)((0,t.A)({},n),e))};r.useEffect(()=>{let e=!0;return A.Ay.getPricingPlans().then(n=>{e&&(v(n),b("loaded"))}).catch(n=>{console.error("Failed to load global pricing plans",n),e&&b("error")}),()=>{e=!1}},[]);return(0,le.jsxs)(k.A,{sx:{"& .MuiDialog-paper":{width:"80%",maxHeight:"90vh"}},maxWidth:"md",open:!0,onClose:e.onClose,children:[(0,le.jsx)(F.A,{children:n("Billing.changeBillingSettingsTitle")}),(0,le.jsxs)(w.A,{children:[(0,le.jsx)(se,{state:u,billingSettings:e.billingSettings}),(0,le.jsx)(z.A,{fullWidth:!0,children:(0,le.jsxs)(R.Ay,{container:!0,spacing:2,children:[(0,le.jsx)(ye,{state:u,onChange:U,offerUsageBased:O.usageBased,offerFixedYearlyTotal:O.fixedYearlyTotal}),(0,le.jsx)(ve,{state:u,onChange:U}),(0,le.jsx)(Pe,{state:u,onChange:U,globalPlans:y,plansStatus:j}),(0,le.jsx)(Be,{state:u,billingSettings:e.billingSettings,onChange:U}),(0,le.jsx)(Ce,{organizationId:e.organizationId,billingSettings:e.billingSettings,state:u,onChange:U})]})}),N.length>0&&(0,le.jsxs)(g.A,{severity:"error",role:"alert",sx:{mt:2},children:[(0,le.jsx)(W.A,{children:n("Billing.saveSettingsFailedTitle")}),N.map(e=>(0,le.jsx)(a.A,{variant:"body2",children:o(e)},e.part))]})]}),(0,le.jsxs)(H.A,{children:[(0,le.jsx)(q.A,{onClick:e.onClose,children:n("Users.delete.cancel")}),(0,le.jsx)(q.A,{onClick:async()=>{const t=function(e,n){var i,t,l,r,s,a,o,c;const d={OrganizationID:n,InsightPrice:0,ConnectPrice:0,FreeDevices:0,FreeUsers:0,TrialEndDate:null!==(i=null===(t=e.trialEnds)||void 0===t?void 0:t.format("YYYYMMDD"))&&void 0!==i?i:"",EndDate:null!==(l=null===(r=e.endDate)||void 0===r?void 0:r.format("YYYYMMDD"))&&void 0!==l?l:"",StartDate:null!==(s=null===(a=e.startDate)||void 0===a?void 0:a.format("YYYYMMDD"))&&void 0!==s?s:"",Currency:e.currency,BlockedAccess:e.blockedAccess,Partner:e.partner,PayingCustomer:e.payingCustomer,PaymentPlan:e.paymentPlan,PaymentTermInDays:e.paymentTermInDays,PONumber:e.poNumber,NrOfYearlyLicenses:0,BillExtraLicenses:!1,MinimumMonthlyLicenses:0,NrOfMonthlyLicenses:0,DiscountPercentage:e.discountPercentage,DiscountDurationMonths:e.discountDurationMonths,DiscountStartDate:null!==(o=null===(c=e.discountStartDate)||void 0===c?void 0:c.format("YYYYMMDD"))&&void 0!==o?o:""};
1switch((0,xe.pz)(e.trialUserLimit)&&(d.TrialUserLimit=e.trialUserLimit),e.billingModel){case"monthly-per-device":d.InsightPrice=e.insightPrice,d.ConnectPrice=e.connectPrice,d.FreeDevices=e.freeDevices,d.MinimumMonthlyLicenses=e.minimumMonthlyLicenses;break;case"monthly-per-user":d.PerUserPrice=e.perUserPrice,d.FreeUsers=e.freeUsers,d.MinimumMonthlyLicenses=e.minimumMonthlyLicenses;break;case"monthly-fixed":d.PerUserPrice=e.perUserPrice,d.FreeUsers=e.freeUsers,d.NrOfMonthlyLicenses=e.nrOfMonthlyLicenses;break;case"yearly":d.TotalYearlyPrice=e.totalYearlyPrice,d.NrOfYearlyLicenses=e.nrOfYearlyLicenses,d.BillExtraLicenses=e.billExtraLicenses;break;case"yearly-per-user":d.PerUserYearlyPrice=e.perUserYearlyPrice,d.NrOfYearlyLicenses=e.nrOfYearlyLicenses,d.BillExtraLicenses=e.billExtraLicenses,d.FreeUsers=e.freeUsers}return d.BillExtraLicenses&&(d.PerUserPrice=e.perUserPrice),d}(u,e.organizationId),r={name:e.organization.name,feature_flags:u.featureFlags,tax_number:e.organization.tax_number,phone_number:e.organization.phone_number,notify_discovered_devices:e.organization.notify_discovered_devices,invite_discovered_devices:e.organization.invite_discovered_devices,notify_unsafe_devices:e.organization.notify_unsafe_devices,use_user_agent_and_client_hints:e.organization.use_user_agent_and_client_hints,use_discovery_data:e.organization.use_discovery_data,google_chrome_device_trust:e.organization.google_chrome_device_trust,microsoft_edge_device_trust:e.organization.microsoft_edge_device_trust};D(!0),T([]);const s=await Promise.allSettled([A.Ay.updateBillingSettings(e.organizationId,t),A.Ay.updateOrganization(e.organizationId,r)]),a=(0,l.A)(s,2),c=a[0],d=a[1],m=[];if("rejected"===c.status&&(console.error("Failed to update billing settings",c.reason),m.push({part:"billing",serverMessage:(0,A.r7)(c.reason)})),"rejected"===d.status&&(console.error("Failed to update organization settings",d.reason),m.push({part:"organization",serverMessage:(0,A.r7)(d.reason)})),D(!1),m.length>0)return T(m),void i({isSaved:!1,title:n("Billing.saveSettingsFailedTitle"),message:m.map(o).join(" ")});e.onClose()},disabled:S||E||I||L,children:n("Billing.updateSettings")})]})]})};var De=i(73847);const Me=((new Date).getMonth()+1).toString().padStart(2,"0"),_e=(()=>{const e=new Date;return 0===e.getMonth()?"12":e.getMonth().toString().padStart(2,"0")})();function Ne(){return Me}function Te(){return _e}const Se=e=>{let n=e.onViewOrganization;const i=(0,s.Bd)().t,b=(0,U.Q)(),k=b.organizations,F=b.setOrganizations,w=b.loading,z=b.error,R=(0,K.d)().addToast,W=r.useState(""),H=(0,l.A)(W,2),q=H[0],G=H[1],V=r.useState(null),Q=(0,l.A)(V,2),$=Q[0],J=Q[1],X=r.useState(!1),Z=(0,l.A)(X,2),ee=Z[0],ne=Z[1],ie=r.useState(!1),te=(0,l.A)(ie,2),re=te[0],se=te[1],ae=r.useState(!1),oe=(0,l.A)(ae,2),ce=oe[0],de=oe[1],ue=r.useState(void 0),me=(0,l.A)(ue,2),ge=me[0],he=me[1],xe=r.useState(""),ye=(0,l.A)(xe,2),ve=ye[0],pe=ye[1],Ae=r.useState(),fe=(0,l.A)(Ae,2),je=fe[0],be=fe[1],Pe=r.useState(),Be=(0,l.A)(Pe,2),Ce=Be[0],Me=Be[1],_e=r.useState(0),Se=(0,l.A)(_e,2),Ee=Se[0],Ie=Se[1],Oe=r.useState(0),Ue=(0,l.A)(Oe,2),Ye=Ue[0],ke=Ue[1],Fe=r.useState(0),we=(0,l.A)(Fe,2),ze=we[0],Re=we[1],We=r.useState(0),He=(0,l.A)(We,2),qe=He[0],Ge=He[1],Ke=r.useState(0),Ve=(0,l.A)(Ke,2),Qe=Ve[0],$e=Ve[1],Je=r.useState(0),Xe=(0,l.A)(Je,2),Ze=Xe[0],en=Xe[1],nn=r.useState(0),tn=(0,l.A)(nn,2),ln=tn[0],rn=tn[1],sn=r.useState(0),an=(0,l.A)(sn,2),on=an[0],cn=an[1],dn=r.useState(0),un=(0,l.A)(dn,2),mn=un[0],gn=un[1],hn=r.useState(0),xn=(0,l.A)(hn,2),yn=xn[0],vn=xn[1],pn=r.useState(0),An=(0,l.A)(pn,2),fn=An[0],jn=An[1],bn=r.useState(0),Pn=(0,l.A)(bn,2),Bn=Pn[0],Cn=Pn[1],Ln=r.useState(""),Dn=(0,l.A)(Ln,2),Mn=Dn[0],_n=Dn[1],Nn=r.useState(1),Tn=(0,l.A)(Nn,2),Sn=Tn[0],En=Tn[1],In=r.useState(50),On=(0,l.A)(In,2),Un=On[0],Yn=On[1],kn=r.useState(!1),Fn=(0,l.A)(kn,2),wn=Fn[0],zn=Fn[1],Rn=r.useState(!1),Wn=(0,l.A)(Rn,2),Hn=Wn[0],qn=Wn[1],Gn=r.useMemo(()=>{if(!k)return[];let e=k;wn||(e=e.filter(e=>!e.deleted)),Hn&&(e=e.filter(e=>{var n;return null===(n=e.settings)||void 0===n?void 0:n.PayingCustomer}));const n=Mn.trim().toLowerCase();return""===n?e:e.filter(e=>{var i,t;return[e.name,e.organization_id,e.billing_email,e.billing_name,e.city,e.country,e.vat,null!==(i=e.invoice)&&void 0!==i&&i.Number?String(e.invoice.Number):void 0,null===(t=e.invoice)||void 0===t?void 0:t.Date,e.referred_by].some(e=>null===e||void 0===e?void 0:e.toLowerCase().includes(n))})},[k,Mn,wn,Hn]),Kn=Gn.length,Vn=Math.max(1,Math.ceil(Kn/Un));r.useEffect(()=>{Sn>Vn?En(Vn):Sn<1&&En(1)},[Sn,Vn]);const Qn=r.useMemo(()=>{const e=(Sn-1)*Un;return Gn.slice(e,e+Un)},[Gn,Sn,Un]),$n=re||w||ce;return r.useEffect(()=>{En(1)},[Mn]),r.useEffect(()=>{En(1)},[k]),r.useEffect(()=>{if(k){se(!0);try{const e=function(e){const n={totalDevices:0,totalDevicesLastMonth:0,totalUsers:0,totalUsersLastMonth:0};
1return e.forEach(e=>{n.totalDevices+=e.active_users.current_connect+e.active_users.current_insight,n.totalDevicesLastMonth+=e.active_users.last_connect+e.active_users.last_insight,n.totalUsers+=e.active_users.current_user_count,n.totalUsersLastMonth+=e.active_users.last_user_count}),n}(k.filter(e=>!e.deleted));Ie(e.totalDevices),ke(e.totalDevicesLastMonth),Re(e.totalUsers),Ge(e.totalUsersLastMonth);let n=0,i=0,t=0,l=0,r=0,s=0,a=0,o=0;const c=P()().format("YYYYMM"),d=P()().subtract(1,"month").format("YYYYMM");k.filter(e=>!e.deleted).forEach(e=>{var u,m,g,h,x,y,v,p;const A=(null===(u=e.settings)||void 0===u?void 0:u.PayingCustomer)||(null===(m=e.settings)||void 0===m?void 0:m.EndDate)&&(null===(g=e.settings)||void 0===g?void 0:g.EndDate.substring(0,6))===c,j=(null===(h=e.settings)||void 0===h?void 0:h.PayingCustomer)||(null===(x=e.settings)||void 0===x?void 0:x.EndDate)&&(null===(y=e.settings)||void 0===y?void 0:y.EndDate.substring(0,6))===d;var b,B,C,L;A&&(n++,t+=e.active_users.current_insight+e.active_users.current_connect,r+=e.active_users.current_user_count,(0,f.U)(e.settings)?a+=null!==(C=null===(L=e.settings)||void 0===L?void 0:L.NrOfYearlyLicenses)&&void 0!==C?C:0:(null!==(b=null===(B=e.settings)||void 0===B?void 0:B.NrOfMonthlyLicenses)&&void 0!==b?b:0)>0?a+=e.settings.NrOfMonthlyLicenses:a+=e.active_users.current_user_count);var D,M,_,N;null!==(v=e.settings)&&void 0!==v&&v.StartDate&&!P()(null===(p=e.settings)||void 0===p?void 0:p.StartDate,"YYYYMMDD").isBefore(P()().subtract(1,"month").startOf("month"))||!j||(i++,l+=e.active_users.last_insight+e.active_users.last_connect,s+=e.active_users.last_user_count,(0,f.U)(e.settings)?o+=null!==(_=null===(N=e.settings)||void 0===N?void 0:N.NrOfYearlyLicenses)&&void 0!==_?_:0:(null!==(D=null===(M=e.settings)||void 0===M?void 0:M.NrOfMonthlyLicenses)&&void 0!==D?D:0)>0?o+=e.settings.NrOfMonthlyLicenses:o+=e.active_users.last_user_count)}),$e(n),en(i),rn(t),cn(l),gn(r),vn(s),jn(a),Cn(o),se(!1)}catch(q){se(!1),G(i("organization.error"))}}},[k,i]),(0,le.jsxs)("div",{children:[(0,le.jsx)(a.A,{variant:"body1",children:(0,le.jsx)("div",{className:"flex-row",style:{display:"flex"},children:(0,le.jsx)("div",{className:"flex-1",children:(0,le.jsxs)(L.A,{className:"countTable",children:[(0,le.jsx)(D.A,{children:(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{style:{minWidth:"120px"}}),(0,le.jsx)(_.A,{style:{minWidth:"90px"},className:"countCellCenter",children:i("months."+Te())}),(0,le.jsx)(_.A,{style:{minWidth:"140px"},className:"countCellCenter",children:i("months."+Ne())})]})}),(0,le.jsxs)(N.A,{children:[(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{className:"countCellRight",children:"Total devices"}),(0,le.jsx)(_.A,{className:"countCellLeft",children:Ye}),(0,le.jsxs)(_.A,{className:"countCellLeft",children:[Ee," (",(100*(Ee/Ye-1)).toFixed(0)+"%",")"]})]}),(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{className:"countCellRight",children:"Total users"}),(0,le.jsx)(_.A,{className:"countCellLeft",children:qe}),(0,le.jsxs)(_.A,{className:"countCellLeft",children:[ze," (",(100*(ze/qe-1)).toFixed(0)+"%",")"]})]})]})]})})})}),(0,le.jsx)(a.A,{children:(0,le.jsx)("div",{className:"flex-row",style:{display:"flex",marginTop:"20px"},children:(0,le.jsx)("div",{className:"flex-1",children:(0,le.jsxs)(L.A,{className:"countTable",children:[(0,le.jsx)(D.A,{children:(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{style:{minWidth:"120px"}}),(0,le.jsx)(_.A,{style:{minWidth:"90px"},className:"countCellCenter",children:i("months."+Te())}),(0,le.jsx)(_.A,{style:{minWidth:"140px"},className:"countCellCenter",children:i("months."+Ne())})]})}),(0,le.jsxs)(N.A,{children:[(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{className:"countCellRight",children:"Paying Customers"}),(0,le.jsx)(_.A,{className:"countCellLeft",children:Ze}),(0,le.jsxs)(_.A,{className:"countCellLeft",children:[Qe," (",(100*(Qe/Ze-1)).toFixed(0)+"%",")"]})]}),(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{className:"countCellRight",children:"Paying Customers Devices"}),(0,le.jsx)(_.A,{className:"countCellLeft",children:on}),(0,le.jsxs)(_.A,{className:"countCellLeft",children:[ln," (",(100*(ln/on-1)).toFixed(0)+"%",")"]})]}),(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{className:"countCellRight",children:"Paying Customers Users"}),(0,le.jsx)(_.A,{className:"countCellLeft",children:yn}),(0,le.jsxs)(_.A,{className:"countCellLeft",children:[mn," (",(100*(mn/yn-1)).toFixed(0)+"%",")"]})]}),(0,le.jsxs)(M.A,{children:[(0,le.jsx)(_.A,{className:"countCellRight",children:"Licensed Users"}),(0,le.jsx)(_.A,{className:"countCellLeft",children:Bn}),(0,le.jsxs)(_.A,{className:"countCellLeft",children:[fn," (",(100*(fn/Bn-1)).toFixed(0)+"%",")"]})]})]})]})})})}),(0,le.jsxs)(o.A,{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",ga
1p:2,mb:2,mt:2,children:[(0,le.jsx)(c.A,{value:Mn,onChange:e=>_n(e.target.value),placeholder:i("organization.searchPlaceholder"),label:i("organization.search"),size:"small",variant:"outlined",InputProps:{startAdornment:(0,le.jsx)(d.A,{position:"start",children:(0,le.jsx)(p.A,{fontSize:"small",color:"action"})})},style:{width:320}}),(0,le.jsx)(u.A,{control:(0,le.jsx)(m.A,{checked:wn,onChange:e=>zn(e.target.checked),size:"small"}),label:i("organization.showDeleted")}),(0,le.jsx)(u.A,{control:(0,le.jsx)(m.A,{checked:Hn,onChange:e=>qn(e.target.checked),size:"small"}),label:i("organization.showOnlyPaying")})]}),(0,le.jsxs)("div",{className:"table w-full","data-cy":"users",children:[q&&(0,le.jsx)("div",{style:{marginBottom:15},children:(0,le.jsx)(g.A,{severity:"error",children:q})}),z&&(0,le.jsx)(g.A,{severity:"error",children:z}),(0,le.jsx)(B.A,{component:C.A,sx:{marginBottom:0},children:(0,le.jsxs)(L.A,{sx:{minWidth:650},"aria-label":"simple table",children:[(0,le.jsx)(D.A,{children:(0,le.jsxs)(M.A,{children:[(0,le.jsx)(_.A,{style:{maxWidth:"500px"},children:i("organization.id")}),(0,le.jsx)(_.A,{children:i("organization.name")}),(0,le.jsx)(_.A,{children:i("Billing.payingCustomer")}),(0,le.jsx)(_.A,{children:i("Billing.partner")}),(0,le.jsx)(_.A,{children:i("Billing.billingType")}),(0,le.jsx)(_.A,{children:i("Billing.paymentPlan")}),(0,le.jsx)(_.A,{children:i("Billing.pricingModel")}),(0,le.jsx)(_.A,{children:i("Billing.accessEnabled")}),(0,le.jsx)(_.A,{children:i("organization.activeUsers")}),(0,le.jsx)(_.A,{children:i("organization.latestInvoice")}),(0,le.jsx)(_.A,{children:i("applications.actionsTitle")})]})}),(0,le.jsxs)(N.A,{children:[Qn.map(e=>{var r,s,a,o,c,d,u,m,g,p,b,P,B,C,U,Y,k,w,z;return(0,le.jsxs)(M.A,{className:"stripedRows",sx:{opacity:e.deleted?.5:1,transition:"opacity 250ms ease"},children:[(0,le.jsx)(_.A,{style:{maxWidth:"500px"},children:e.organization_id}),(0,le.jsxs)(_.A,{component:"th",scope:"row",children:[(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{className:n?"org-name-link":void 0,style:{cursor:n?"pointer":"default",fontWeight:500},onClick:()=>null===n||void 0===n?void 0:n(e),children:e.name}),e.deleted&&(0,le.jsx)(h.A,{label:i("organization.softDeleted"),size:"small",color:"error",variant:"outlined",sx:{ml:1}})]}),e.referred_by&&(0,le.jsx)("div",{className:"referred-by",children:i("organization.referredBy",{email:e.referred_by})}),(0,le.jsxs)("div",{className:"address",children:[e.billing_name,e.billing_name&&""!==e.billing_name&&","," ",e.billing_first_name," ",e.billing_last_name,(e.billing_first_name&&""!==e.billing_first_name||e.billing_last_name&&""!==e.billing_last_name)&&","," ",e.address,""!==e.address&&","," ",e.zip_code," ",e.city,""!==e.city&&","," ",e.country,""!==e.country&&","," ",e.vat,""!==e.vat&&","," ",e.billing_email]})]}),(0,le.jsx)(_.A,{className:"countCellCenter",children:null!==(r=e.settings)&&void 0!==r&&r.PayingCustomer?"\u2713":""}),(0,le.jsx)(_.A,{className:"countCellCenter",children:(null===(s=e.settings)||void 0===s?void 0:s.Partner)||""}),(0,le.jsx)(_.A,{className:"countCellCenter",children:null!==(a=e.settings)&&void 0!==a&&a.PayingCustomer?null!=(null===(o=e.settings)||void 0===o?void 0:o.PerUserYearlyPrice)?i("Billing.yearlyPerUser"):(0,f.U)(e.settings)?i("Billing.yearly"):i("Billing.monthly"):""}),(0,le.jsx)(_.A,{className:"countCellCenter",children:(null===(c=e.settings)||void 0===c||null===(d=c.PaymentPlan)||void 0===d||null===(u=d.Name)||void 0===u?void 0:u.trim())||""}),(0,le.jsx)(_.A,{className:"countCellCenter",children:null!==(m=e.settings)&&void 0!==m&&m.PayingCustomer?(0,f.U)(e.settings)?"":null!==(g=e.settings)&&void 0!==g&&g.PerUserPrice?i("Billing.perUser"):i("Billing.perDevice"):""}),(0,le.jsx)(_.A,{className:"countCellCenter",children:null!==(p=e.settings)&&void 0!==p&&p.BlockedAccess?"":"\u2713"}),(0,le.jsx)(_.A,{children:e.active_users&&(0,le.jsxs)(L.A,{className:"countTable",children:[(0,le.jsx)(D.A,{children:(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{style:{minWidth:"70px"}}),(0,le.jsx)(_.A,{style:{minWidth:"35px"},className:"countCellCenter",children:i("months."+Te())}),(0,le.jsx)(_.A,{style:{minWidth:"35px"},className:"countCellCenter",children:i("months."+Ne())})]})}),(0,le.jsxs)(N.A,{children:[(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{className:"countCellRight",children:i("organization.deviceCount")}),(0,le.jsx)(_.A,{className:"countCellCenter",children:e.active_users.last_insight+e.active_users.last_connect}),(0,le.jsx)(_.A,{className:"countCellCenter",children:e.active_users.current_insight+e.active_users.current_connect})]}),(0,le.jsxs)(M.A,{sx:{borderBottom:1},children:[(0,le.jsx)(_.A,{className:"countCellRight",children:i("organization.userCount")}),(0,le.jsx)(_.A,{className:"countCellCenter",children:e.active_users.last_user_count}),(0,le.jsx)(_.A,{className:"countCellCenter",children:e.active_users.current_user_count})]}),(null===(b=e.settings)||void 0===b?void 0:b.PayingCustomer)&&(0,le.jsxs)(M.A,{children:[(0,le.jsx)(_.A,{className:"countCellRight",children:"Licensed users"}),(0,le.jsx)(_.A,{className:"countCellCenter",children:(0,f.U)(e.settings)?null!==(P=null===(B=e.settings)||void 0===B?void 0:B.NrOfYearlyLicenses)&&void 0!==P?P:0:(null!==(C=null===(U=e.settings)||void 0===U?void 0:U.NrOfMonthlyLicenses)&&void 0!==C?C:0)>0?e.settings.NrOfMonthlyLicenses:e.active_users.last_user_count}),(0,le.jsx)(_.A,{className:"countCellCenter",children:(0,f.U)(e.settings)?null!==(Y=null===(k=e.settings)||void 0===k?void 0:k.NrOfYearlyLicenses)&&void 0!==Y?Y:0:(null!==(w=null===(z=e.settings)||void 0===z?void 0:z.NrOfMonthlyLicenses)&&void 0!==w?w:0)>0?e.settings.NrOfMonthlyLicenses:e.active_users.current_user_count})]})]})]})}),(0,le.jsx)(_.A,{children:e.invoice&&(0,le.jsxs)(le.Fragment,{children:[i("organization.amount")," \u20ac",(0,j.ej)(e.invoice.Amount)," ",(0,le.jsxs)(x.A,{sx:{marginLeft:2},onClick:n=>{he(e.invoice.Number),A.Ay.getInvoice(e.organization_id,e.invoice.Date,String(e.invoice.Number)).then(e=>{he(void 0),(0,S.Vv)(e)})},disabled:ge===e.invoice.Number,children:[ge===e.invoice.Number&&(0,le.jsx)(y.A,{size:"20px",style:{marginRight:"10px"},color:"primary"}),(0,le.jsx)(T.A,{color:"primary"})]})]})}),(0,le.jsxs)(_.A,{style:{textAlign:"right",whiteSpace:"nowrap"},children:[(0,le.jsx)(v.A,{title:i("applications.edit.tooltip")||"",arrow:!0,placement:"bottom",children:(0,le.jsx)(x.A,{onClick:async()=>{G(""),de(!0);try{const n=await Promise.all([A.Ay.getBillingSettings(e.organization_id),A.Ay.getOrganizationFull(e.organization_id)]),i=(0,l.A)(n,2),t=i[0],r=i[1];Me(t),pe(e.organization_id),be(null!==r&&void 0!==r?r:e)}catch(n){console.error("Failed to load billing settings",n),pe(""),be(void 0),Me(void 0),G(i("organization.billingSettingsError"))}finally{de(!1)}},children:(0,le.jsx)(E.A,{color:"primary"})})}),e.deleted?(0,le.jsx)(v.A,{title:i("organization.restore")||"",arrow:!0,placement:"bottom",children:(0,le.jsx)(x.A,{sx:{ml:1},onClick:async()=>{try{await A.Ay.restoreOrganization(e.organization_id),F(n=>null===n||void 0===n?void 0:n.map(n=>n.organization_id===e.organization_id?(0,t.A)((0,t.A)({},n),{},{deleted:!1}):n)),R({isSaved:!0,title:i("organization.restoreSuccess")})}catch(n){R({isSaved:!1,title:i("organization.restoreError")})}},children:(0,le.jsx)(O.A,{color:"primary"})})}):(0,le.jsx)(v.A,{title:i("organization.delete")||"",arrow:!0,placement:"bottom",children:(0,le.jsx)(x.A,{sx:{ml:1},onClick:()=>J(e),children:(0,le.jsx)(I.A,{color:"error"})})})]})]},e.organization_id)}),$n&&(0,le.jsx)(M.A,{children:(0,le.jsx)(_.A,{colSpan:10,align:"center",children:(0,le.jsx)(y.A,{size:20})})}),!$n&&0===Qn.length&&(0,le.jsx)(M.A,{children:(0,le.jsx)(_.A,{colSpan:10,align:"center",children:i("organization.noOrganizations")})})]})]})}),(0,le.jsx)(o.A,{mt:0,children:(0,le.jsx)(Y.A,{currentPage:Sn,totalPages:Vn,totalItems:Kn,pageSize:Un,pageSizeOptions:[50,100],onPageChange:e=>{En(e),window.scrollTo({top:0,behavior:"smooth"})},onPageSizeChange:e=>{Yn(e),En(1)}})})]}),""!==ve&&Ce&&je&&(0,le.jsx)(Le,{organizationId:ve,organization:je,billingSettings:Ce,onClose:()=>{pe(""),be(void 0)}}),$&&(0,le.jsx)(De.A,{title:i("organization.deleteConfirmTitle"),content:i("organization.deleteConfirmContent",{name:$.name}),cancelText:i("Users.delete.cancel"),confirmText:i("organization.delete"),inProgress:ee,onCancel:()=>J(null),onConfirm:async()=>{ne(!0);try{await A.Ay.deleteOrganization($.organization_id),F(e=>null===e||void 0===e?void 0:e.map(e=>e.organization_id===$.organization_id?(0,t.A)((0,t.A)({},e),{},{deleted:!0}
1):e)),R({isSaved:!0,title:i("organization.deleteSuccess")})}catch(e){R({isSaved:!1,title:i("organization.deleteError")})}finally{ne(!1),J(null)}}})]})}},38028(e,n,i){i.d(n,{Ay:()=>g});var t=i(9950),l=i(60899),r=i(87233),s=i(16497),a=i(83250),o=i(44426),c=i(98),d=i(51392),u=(i(21924),i(44414));const m=[{title:"Features",flags:[{flag:o.T.PHISHING_LAB,label:"Phishing lab"},{flag:o.T.MEM_EXPORT,label:"MEM export"},{flag:o.T.TEAMS,label:"Microsoft Teams"},{flag:o.T.IDP,label:"Identity provider (SAML)"},{flag:o.T.GOOGLE_ENFORCEMENT,label:"Google Workspace enforcement"},{flag:o.T.DESKTOP_AWARENESS_NOTIFICATIONS,label:"Desktop notifications for failing checks"},{flag:o.T.MDM_ENROLLMENT,label:"MDM enrollment"},{flag:o.T.PASSKEYS,label:"Passkeys"},{flag:o.T.FIX_FROM_WEB,label:"Fix from the sign-in page"}]},{title:"Device checks",flags:[{flag:o.T.OS_UPDATES,label:"Operating system updates"},{flag:o.T.BROWSER_VERSIONS,label:"Browser versions"},{flag:o.T.BROWSER_PRIVACY,label:"Browser privacy"},{flag:o.T.DISK_ENCRYPTION,label:"Disk encryption"},{flag:o.T.SCREEN_LOCK,label:"Screen lock"},{flag:o.T.ANTIVIRUS,label:"Antivirus"},{flag:o.T.FIREWALL,label:"Firewall"},{flag:o.T.PASSWORD_MANAGER,label:"Password manager"},{flag:o.T.REBOOT,label:"Reboot"},{flag:o.T.OS_INTEGRITY,label:"Operating system integrity"},{flag:o.T.REMOTE_ACCESS,label:"Remote login and screen sharing"},{flag:o.T.FIND_MY_DEVICE,label:"Find my device"},{flag:o.T.DNS,label:"DNS"},{flag:o.T.WINDOWS_RECALL,label:"Windows Recall"},{flag:o.T.PDF_READERS,label:"PDF readers"},{flag:o.T.DEVICE_MANAGEMENT,label:"Device management"},{flag:o.T.SAFE_BROWSING,label:"Safe browsing"},{flag:o.T.EDR_DETECTION,label:"EDR detection"},{flag:o.T.RUNAWAY_AI,label:"Runaway AI"},{flag:o.T.APPLICATION_CHECKS_ENABLED,label:"Application checks"},{flag:o.T.AIKIDO_ENABLED,label:"Aikido device checks"},{flag:o.T.PLAY_PROTECT,label:"Play Protect"},{flag:o.T.UNATTENDED_REMOTE_ACCESS,label:"Unattended remote access tools"}]}],g=(m.flatMap(e=>e.flags),e=>{let n=e.selectedFlags,i=e.onToggle;return(0,u.jsx)(u.Fragment,{children:m.map(e=>{let o=e.title,m=e.flags;return(0,u.jsxs)(t.Fragment,{children:[(0,u.jsx)(l.Ay,{item:!0,xs:12,children:(0,u.jsx)(r.A,{variant:"subtitle2",color:"text.secondary",mt:1,children:o})}),m.map(e=>{let t=e.flag,r=e.label;return(0,u.jsx)(l.Ay,{item:!0,xs:12,md:6,children:(0,u.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,u.jsx)(s.A,{control:(0,u.jsx)(a.w,{checked:n.includes(t),onChange:e=>i(t,e.target.checked)}),label:r}),(0,d.JY)(t)&&(0,u.jsx)(c.A,{})]})},t)})]},o)})})})},51392(e,n,i){i.d(n,{JY:()=>o,Om:()=>c,m6:()=>u,uX:()=>d});var t=i(44426),l=i(84730),r=i(48091),s=i(60927);const a=new Set([t.T.PLAY_PROTECT,t.T.DESKTOP_AWARENESS_NOTIFICATIONS,t.T.RUNAWAY_AI,t.T.AIKIDO_ENABLED,t.T.SELF_INVITE,t.T.PASSKEYS,t.T.FIX_FROM_WEB,t.T.IDP,t.T.GOOGLE_ENFORCEMENT]),o=e=>a.has(e),c=()=>o(t.T.SELF_INVITE),d=(e,n,i)=>{if(((e,n,i)=>"antivirus_enabled"===e?!!(0,r.m0)(null!==n&&void 0!==n?n:void 0)&&!!o(t.T.PLAY_PROTECT)&&(0,s.st)(i,t.T.PLAY_PROTECT):l.rd.includes(e)?!!o(t.T.RUNAWAY_AI)&&(0,s.st)(i,t.T.RUNAWAY_AI):!!l.aJ.includes(e)&&!!o(t.T.AIKIDO_ENABLED)&&(0,s.st)(i,t.T.AIKIDO_ENABLED))(e,n,i))return"antivirus_enabled"===e?"devices.checks.androidBeta":"devices.checks.beta"},u=e=>(0,s.st)(e,t.T.PLAY_PROTECT)?"discovery.Antivirus.tooltip_extra_play_protect":"discovery.Antivirus.tooltip_extra"},54992(e,n,i){function t(e,n){if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==n[i])return!1;return!0}function l(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"nl-BE";return e.toLocaleString(n,{minimumFractionDigits:2,maximumFractionDigits:2})}function r(e){return/^team$/i.test(e)||/^team@.*$/i.test(e)}i.d(n,{ej:()=>l,ke:()=>r,r1:()=>t})},62852(e,n,i){i.d(n,{Ay:()=>T,Vv:()=>_});var t=i(5544),l=i(9950),r=i(55030),s=i(65429),a=i(25277),o=i(46639),c=i(82259),d=i(54992),u=i(1320),m=i(70693),g=i(15769),h=i(69780),x=i(9213),y=i(21671),v=i(34075),p=i(68179),A=i(23935),f=i(73759),j=i(83520),b=i(96564),P=i(51790),B=i(42167),C=i(83274),L=i(21923),D=i(44414);const M=e=>{let n=e.icon,i=e.label,t=e.loading,l=e.onClick;return(0,D.jsx)(C.A,{title:i,children:(0,D.jsx)("span",{className:"invoice-action-tooltip",children:(0,D.jsx)(L.A,{className:"invoice-action",onClick:l,disabled:t,"aria-label":i,children:t?(0,D.jsx)(o.A,{size:"20px"}):n})})})};function _(e){const n=N(e),i=URL.createObjectURL(n);window.open(i),window.setTimeout(()=>{URL.revokeObjectURL(i)},6e4)}function N(e){const n=1024,i=atob(e),t=i.length,l=Math.ceil(t/n),r=new Array(l);for(let s=0;s<l;++s){const e=s*n,l=Math.min(e+n,t),a=new Array(l-e);for(let n=e,t=0;n<l;
1++t,++n)a[t]=i[n].charCodeAt(0);r[s]=new Uint8Array(a)}return new Blob(r,{type:"application/pdf"})}const T=e=>{const n=l.useState(!0),i=(0,t.A)(n,2),C=i[0],L=i[1],T=l.useState(void 0),S=(0,t.A)(T,2),E=S[0],I=S[1],O=l.useState(void 0),U=(0,t.A)(O,2),Y=U[0],k=U[1],F=l.useState([]),w=(0,t.A)(F,2),z=w[0],R=w[1],W=l.useState(""),H=(0,t.A)(W,2),q=H[0],G=H[1],K=(0,B.g)().settings,V=(0,r.Bd)(),Q=V.t,$=V.i18n,J=l.useCallback(async(n,i,t)=>{try{i(await c.Ay.getInvoice(e.role.organization.organization_id,n.Date,String(n.Number)))}catch(q){t()}},[e.role.organization.organization_id]),X=l.useCallback(async()=>{try{const n=await c.Ay.getInvoices(e.role.organization.organization_id);L(!1),R(n)}catch(q){L(!1),G(Q("Billing.invoicesLoadError"))}},[e.role.organization.organization_id]);l.useEffect(()=>{X()},[X]);const Z=l.useMemo(()=>(0,P.Hi)(K,z),[K,z]),ee=l.useCallback(e=>e.toLocaleDateString($.resolvedLanguage||$.language,{day:"numeric",month:"short",year:"numeric"}),[$.resolvedLanguage,$.language]);return(0,D.jsx)("div",{children:(0,D.jsxs)("div",{className:"table w-full","data-cy":"users",children:[q&&(0,D.jsx)("div",{style:{marginBottom:15},children:(0,D.jsx)(s.A,{severity:"error",children:q})}),(0,D.jsxs)(u.A,{component:m.A,sx:{maxWidth:890},children:[(0,D.jsxs)(g.A,{sx:{minWidth:650},"aria-label":"simple table",children:[(0,D.jsx)(h.A,{style:{background:"var(--color-gray-100)"},children:(0,D.jsxs)(x.A,{children:[(0,D.jsx)(y.A,{children:Q("Billing.invoiceNumber")}),(0,D.jsx)(y.A,{children:Q("Billing.date")}),(0,D.jsx)(y.A,{children:Q("Billing.invoiceDate")}),(0,D.jsx)(y.A,{align:"right",className:"invoice-number-cell",children:Q("Billing.Amount")}),(0,D.jsx)(y.A,{children:Q("Billing.Status")}),(0,D.jsx)(y.A,{children:Q("Billing.File")})]})}),(0,D.jsx)(v.A,{children:z&&z.sort((e,n)=>e.Timestamp<n.Timestamp?1:-1).map((e,n)=>(0,D.jsxs)(x.A,{className:"stripedRows",children:[(0,D.jsx)(y.A,{component:"th",scope:"row",className:"invoice-number-cell",children:e.Number}),(0,D.jsx)(y.A,{component:"th",scope:"row",className:"invoice-number-cell",children:(()=>{const n=Z.get(e);return n?"".concat(ee(n.start)," \u2013 ").concat(ee(n.end)):4===e.Date.length?e.Date:Q("months."+e.Date.substring(4,6))+" "+e.Date.substring(0,4)})()}),(0,D.jsx)(y.A,{component:"th",scope:"row",className:"invoice-number-cell",children:new Date(1e3*e.Timestamp).toLocaleDateString($.resolvedLanguage||$.language)}),(0,D.jsxs)(y.A,{component:"th",scope:"row",align:"right",className:"invoice-number-cell",children:[(0,c.Qn)(null===K||void 0===K?void 0:K.Currency)," ",(0,d.ej)(e.Amount)]}),(0,D.jsx)(y.A,{component:"th",scope:"row",children:(0,P.Fr)(e)?(0,D.jsx)(a.A,{icon:(0,D.jsx)(b.A,{}),size:"small",className:"invoice-status invoice-status--cancelled",label:Q("Billing.cancelledStatus")}):"paid"===e.Status?(0,D.jsx)(a.A,{icon:(0,D.jsx)(f.A,{}),size:"small",className:"invoice-status invoice-status--paid",label:Q("Billing.paidStatus")}):(0,D.jsx)(a.A,{icon:(0,D.jsx)(j.A,{}),size:"small",className:"invoice-status invoice-status--open",label:Q("Billing.openStatus")})}),(0,D.jsx)(y.A,{component:"th",scope:"row",children:(0,D.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[(0,D.jsx)(M,{label:Q("Billing.view"),loading:Y===e.Number,icon:(0,D.jsx)(p.A,{}),onClick:()=>{k(e.Number),J(e,e=>{k(void 0),_(e)},()=>{k(void 0),G(Q("Billing.invoiceViewError"))})}}),(0,D.jsx)(M,{label:Q("Billing.download"),loading:E===e.Number,icon:(0,D.jsx)(A.A,{}),onClick:()=>{I(e.Number),J(e,n=>{I(void 0);!function(e,n){const i=N(e),t=URL.createObjectURL(i),l=document.createElement("a");l.href=t,l.download=n,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(t)}(n,"invoice-".concat(e.Number,".pdf"))},()=>{I(void 0),G(Q("Billing.invoiceDownloadError"))})}})]})})]},e.Date))})]}),q&&(0,D.jsx)(s.A,{onClose:()=>{G("")},severity:"error",children:q}),C&&(0,D.jsx)("div",{className:"invoice-loading",children:(0,D.jsx)(o.A,{size:30})})]})]})})}},65029(e,n,i){i.d(n,{A:()=>m});i(9950);var t=i(20032),l=i(70006),r=i(23266),s=i(87233),a=i(10226),o=i(99320),c=i(40635),d=i(55030),u=i(44414);const m=e=>{let n=e.currentPage,i=e.totalPages,m=e.pageSize,g=e.totalItems,h=e.onPageChange,x=e.onPageSizeChange,y=e.pageSizeOptions,v=void 0===y?[50,100]:y;const p=(0,d.Bd)().t;if(i<=1)return null;const A=(n-1)*m+1,f=Math.min(n*m,g);return(0,u.jsxs)(t.A,{className:"pagination-container",children:[(0,u.jsx)(t.A,{className:"pagination-info",children:(0,u.jsx)(t.A,{className:"page-size-selector",children:(0,u.jsx)(l.A,{value:m,onChange:e=>x(Number(e.target.value)),size:"small",className:"page-size-select",children:v.map(e=>(0,u.jsxs)(r.A,{value:e,children:[e," ",p("pagination.itemsPerPage")]},e))})})}),(0,u.jsxs)(t.A,{className:"pagination-controls",children:[(0,u.jsx)(s.A,{variant:"body2",className:"pagination-text",children:(0,u.jsx)(d.x6,{i18nKey:"pagination.showing",values:{start:A,end:f,total:g},components:{bold:(0,u.jsx)("strong",{})}})}),(0,u.jsx)(a.A,{onClick:()=>{n>1&&h(n-1)},disabled:1===n,className:"pagination-nav-button","aria-label":p("pagination.previous"),children:(0,u.jsx)(o.A,{})}),(0,u.jsx)(a.A,{onClick:()=>{n<i&&h(n+1)},disabled:n===i,className:"pagination-nav-button","aria-label":p("pagination.next"),children:(0,u.jsx)(c.A,{})})]})]})}},73847(e,n,i){i.d(n,{A:()=>a});i(9950);var t=i(87233),l=i(65429),r=i(22056),s=i(44414);const a=e=>{let n=e.title,i=e.content,a=e.error,o=e.cancelText,c=e.confirmText,d=e.inProgress,u=e.confirmDisabled,m=void 0!==u&&u,g=e.confirmColor,h=e.onCancel,x=e.onConfirm;return(0,s.jsxs)(r._T,{open:!0,onClose:h,title:n,maxWidth:"xs",actions:(0,s.jsx)(r.d_,{onCancel:h,onConfirm:x,cancelText:o,confirmText:c,inProgress:d,confirmDisabled:m,confirmColor:g}),children:[i&&(0,s.jsx)(t.A,{sx:{color:"var(--color-gray-700)",fontSize:"14px",lineHeight:"20px"},children:i}),a&&(0,s.jsx)(l.A,{severity:"error",sx:{marginTop:i?"12px":0},children:a})]})}}
1,77195(e,n,i){i.d(n,{$J:()=>p,Gh:()=>y,JG:()=>h,Kf:()=>a,Mx:()=>o,PB:()=>r,Qn:()=>f,_M:()=>x,__:()=>s,_o:()=>v,cG:()=>A,l1:()=>g});var t=i(27072),l=i(71172);const r=t.rL,s="custom",a=e=>(0,t.Et)(e),o=[{value:"none",translationKey:"Billing.frequencyNone"},{value:"on_demand",translationKey:"Billing.frequencyOnDemand"},{value:"limited",translationKey:"Billing.frequencyLimited"},{value:"weekly",translationKey:"Billing.frequencyWeekly"},{value:"monthly",translationKey:"Billing.frequencyMonthly"},{value:"quarterly",translationKey:"Billing.frequencyQuarterly"}],c=7.9,d=3,u=3,m=10;function g(e){var n;return void 0!==e.PerUserYearlyPrice&&null!==e.PerUserYearlyPrice?"yearly-per-user":(0,l.e)(e.TotalYearlyPrice)?"yearly":(null!==(n=e.NrOfMonthlyLicenses)&&void 0!==n?n:0)>0?"monthly-fixed":!e.PayingCustomer&&function(e){var n,i,t,l;const r=null!==(n=e.PerUserPrice)&&void 0!==n?n:void 0,s=r===c&&e.InsightPrice===d&&e.ConnectPrice===u&&(null!==(i=e.FreeDevices)&&void 0!==i?i:0)===m,a=void 0===r&&!(e.InsightPrice>0)&&!(e.ConnectPrice>0);return(s||a)&&!((null!==(t=e.FreeUsers)&&void 0!==t?t:0)>0)&&!((null!==(l=e.MinimumMonthlyLicenses)&&void 0!==l?l:0)>0)}(e)?"trial":void 0!==e.PerUserPrice&&null!==e.PerUserPrice?"monthly-per-user":e.InsightPrice>0||e.ConnectPrice>0?"monthly-per-device":"trial"}function h(e){const n=g(e);return{usageBased:"legacy"===x(n),fixedYearlyTotal:"yearly"===n}}function x(e){switch(e){case"trial":return"none";case"monthly-fixed":return"monthly";case"yearly":case"yearly-per-user":return"yearly";case"monthly-per-user":case"monthly-per-device":return"legacy"}}function y(e){switch(e){case"none":return"trial";case"monthly":return"monthly-fixed";case"yearly":return"yearly-per-user";case"legacy":return"monthly-per-user"}}function v(e){switch(e){case"yearly":case"yearly-per-user":return"yearly";case"monthly-per-device":case"monthly-per-user":case"monthly-fixed":return"monthly";case"trial":return null}}function p(e){const n=parseFloat(e);return Number.isFinite(n)?n:void 0}function A(e){const n=parseInt(e,10);return Number.isFinite(n)?n:0}function f(e){switch(e){case"EUR":return"\u20ac";case"GBP":return"\xa3";default:return"$"}}}}]);

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.