1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[13297,16054,46938],{482:e=>{var n=Object.prototype.hasOwnProperty;e.exports=function(e,t){return null!=e&&n.call(e,t)}},1322:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Badge=c,n.badgeTypes=void 0;var r=l(t(95062)),o=l(t(14232)),i=t(5702),a=["size","title","type","children","customCSS","id"];function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function c(e){var n=e.size,t=void 0===n?"lg":n,r=e.title,l=void 0===r?null:r,c=e.type,u=e.children,d=e.customCSS,p=e.id,f=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,a),m={lg:28,sm:22}[t];return o.default.createElement(i.StyledBadge,s({},l&&{"aria-label":"This item is ".concat(l,"."),title:l},{customCSS:void 0===d?null:d,id:void 0===p?"":p,style:{height:"".concat(m,"px")},size:t,type:void 0===c?"price":c},f,{"data-sui":!0}),u)}var u=n.badgeTypes=["product","stock","price","primary","premium","select","new","sale","contract","ars"];c.propTypes={type:r.default.oneOf(u),title:r.default.string,size:r.default.oneOf(["sm","lg"]),children:r.default.string.isRequired,customCSS:r.default.string,id:r.default.string}},1425:(e,n,t)=>{"use strict";function r(e){if(null===e||!0===e||!1===e)return NaN;var n=Number(e);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}t.d(n,{A:()=>r})},2752:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.WithoutIconStyleWrapedit=n.WithoutIconStyleWrap=n.SubText=n.StyledFlex=n.StyledDropdownMenu=n.StyledDropdownItemWrapper=n.StyledDropdownItem=n.BoldSpan=n.AddEntryIcon=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626)),o=t(64741),i=t(98811),a=t(88728);n.StyledDropdownMenu=r.default.div.withConfig({componentId:"sc-t8qtf6-0"})(["font-family:",";margin-top:8px;flex-flow:column nowrap;box-shadow:0 0 6px rgba(155,155,155,0.7);position:absolute;z-index:9999;background-color:",";overflow-y:auto;overscroll-behavior:contain;width:100%;display:",";&:focus{outline:none;}",""],o.typography.type.motiva_light,i.tokens.color_white,function(e){return e.isOpen?"flex":"none"},function(e){return"right"===e.align?"right: 0px;":""}),n.StyledDropdownItemWrapper=r.default.div.withConfig({componentId:"sc-t8qtf6-1"})(["display:flex;justify-content:space-between;&:hover{background:",";}&:focus{outline:none;}"],function(e){return e.disabled?"transparent":i.tokens.color_blue_100}),n.StyledDropdownItem=r.default.div.withConfig({componentId:"sc-t8qtf6-2"})(["border:none;cursor:",";text-align:left;font-size:",";font-family:inherit;padding:7px 9px;background:",";color:",";opacity:",";pointer-events:",";& > span{padding:6px;}display:flex;width:100%;span{padding:0 6px;}"],function(e){return e.disabled?"not-allowed":"pointer"},function(e){return"sm"===e.size?"14px":"16px"},function(e){return e.disabled?i.tokens.color_gray_100:e.index===e.dropdownIndex?i.tokens.color_blue_100:"transparent"},function(e){return e.disabled?i.tokens.color_gray_500:"inherit"},function(e){return e.disabled?.6:1},function(e){return e.disabled?"none":"auto"}),n.WithoutIconStyleWrapedit=r.default.div.withConfig({componentId:"sc-t8qtf6-3"})(["min-width:28px;background-color:",";"],function(e){return e.index===e.dropdownIndex?i.tokens.color_blue_100:"transparent"}),n.WithoutIconStyleWrap=r.default.div.withConfig({componentId:"sc-t8qtf6-4"})(["min-width:28px;"]),n.BoldSpan=r.default.span.withConfig({componentId:"sc-t8qtf6-5"})(["padding:0;span{padding:0;font-family:",";}"],o.typography.type.motiva_medium),n.AddEntryIcon=r.default.span.withConfig({componentId:"sc-t8qtf6-6"})(["margin-top:-2px;transform:rotateZ(45deg);"]),n.SubText=r.default.div.withConfig({componentId:"sc-t8qtf6-7"})(["font-size:14px;color:",";padding-left:10px;@media all and (max-width:","px){padding:0 6px;}"],i.tokens.color_gray_500,a.BREAKPOINTS.xs),n.StyledFlex=r.default.div.withConfig({componentId:"sc-t8qtf6-8"})(["align-items:center;display:flex;@media all and (max-width:","px){flex-direction:column;}"],a.BREAKPOINTS.xs)},3153:(e,n,t)=>{"use strict";t.d(n,{A:()=>c});var r,o=new Uint8Array(16);let i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var a=[],l=0;l<256;++l)a.push((l+256).toString(16).substr(1));let s=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(a[e[n+0]]+a[e[n+1]]+a[e[n+2]]+a[e[n+3]]+"-"+a[e[n+4]]+a[e[n+5]]+"-"+a[e[n+6]]+a[e[n+7]]+"-"+a[e[n+8]]+a[e[n+9]]+"-"+a[e[n+10]]+a[e[n+11]]+a[e[n+12]]+a[e[n+13]]+a[e[n+14]]+a[e[n+15]]).toLowerCase();if(!("string"==typeof t&&i.test(t)))throw TypeError("Stringified UUID is invali
1d");return t},c=function(e,n,t){var i=(e=e||{}).random||(e.rng||function(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)})();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){t=t||0;for(var a=0;a<16;++a)n[t+a]=i[a];return n}return s(i)}},4008:(e,n,t)=>{"use strict";t.d(n,{A:()=>C5});var r,o,i,a,l,s,c,u,d,p,f,m,h,g,y,v,x,b,j,w,C,_,S,I,E,P,O,T,k,N,D,R,A,M,F,z,L,B,U,V,H,W,G,q,K,J,X,$,Z,Y,Q,ee,en,et,er,eo,ei,ea,el,es,ec,eu,ed,ep,ef,em,eh,eg,ey,ev,ex,eb,ej,ew,eC,e_,eS,eI,eE,eP,eO,eT,ek,eN,eD,eR,eA,eM,eF,ez,eL,eB,eU,eV,eH,eW,eG,eq,eK,eJ,eX,e$,eZ,eY,eQ,e0,e1,e2,e6,e5,e4,e3,e8,e9,e7,ne,nn,nt,nr,no,ni,na,nl,ns,nc,nu,nd,np,nf,nm,nh,ng,ny,nv,nx,nb,nj,nw,nC,n_,nS,nI,nE,nP,nO,nT,nk,nN,nD,nR,nA,nM,nF,nz,nL,nB,nU,nV,nH,nW,nG,nq,nK,nJ,nX,n$,nZ,nY,nQ,n0,n1,n2,n6,n5,n4,n3,n8,n9,n7,te,tn,tt,tr,to,ti,ta,tl,ts,tc,tu,td,tp,tf,tm,th,tg,ty,tv,tx,tb,tj,tw,tC,t_,tS,tI,tE,tP,tO,tT,tk,tN,tD,tR,tA,tM,tF,tz,tL,tB,tU,tV,tH,tW,tG,tq,tK,tJ,tX,t$,tZ,tY,tQ,t0,t1,t2,t6,t5,t4,t3,t8,t9,t7,re,rn,rt,rr,ro,ri,ra,rl,rs,rc,ru,rd,rp,rf,rm,rh,rg,ry,rv,rx,rb,rj,rw,rC,r_,rS,rI,rE,rP,rO,rT,rk,rN,rD,rR,rA,rM,rF,rz,rL,rB,rU,rV,rH,rW,rG,rq,rK,rJ,rX,r$,rZ,rY,rQ,r0,r1,r2,r6,r5,r4,r3,r8,r9,r7,oe,on,ot,or,oo,oi,oa,ol,os,oc,ou,od,op,of,om,oh,og,oy,ov,ox,ob,oj,ow,oC,o_,oS,oI,oE,oP,oO,oT,ok,oN,oD,oR,oA,oM,oF,oz,oL,oB,oU,oV,oH,oW,oG,oq,oK,oJ,oX,o$,oZ,oY,oQ,o0,o1,o2,o6,o5,o4,o3,o8,o9,o7,ie,it,ir,io,ii,ia,il,is,ic,iu,id,ip,im,ih,ig,iy,iv,ix,ib,ij,iw,iC,i_,iS,iI,iE,iP,iO,iT,ik,iN,iD,iR,iA,iM,iF,iz,iL,iB,iU,iV,iH,iW,iG=t(55562),iq=t(14232),iK=t(28468),iJ=t(85414),iX=t(68193),i$=t(20294),iZ=t(98477),iY=t(48011),iQ=t(37876);function i0(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function i1(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i0(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var i2=e=>(0,iQ.jsx)("svg",i1(i1({xmlns:"http://www.w3.org/2000/svg"},e),{},{viewBox:"0 -960 960 960",children:(0,iQ.jsx)("path",{d:"M600-320h160v-160h-60v100H600v60ZM200-560h60v-100h100v-60H200v160Zm120 440v-80H160q-33 0-56.5-23.5T80-280v-480q0-33 23.5-56.5T160-840h640q33 0 56.5 23.5T880-760v480q0 33-23.5 56.5T800-200H640v80H320ZM160-280h640v-480H160v480Zm0 0v-480 480Z"})})),i6=t(15602),i5=t(28888),i4=t(21626),i3=t(73357),i8={extend:{colors:{brand:{50:"hsl(var(--brand-50))",100:"hsl(var(--brand-100))",200:"hsl(var(--brand-200))",500:"hsl(var(--brand-500))",600:"hsl(var(--brand-600))",700:"hsl(var(--brand-700))"}}}};function i9(){var e=(0,i5._)(["\n position: absolute;\n top: -7px;\n right: 0px;\n background-color: ",";\n color: white;\n font-size: 10px;\n font-weight: 700;\n border-radius: 10px;\n min-width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 4px;\n border: 2px solid ",";\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n"]);return i9=function(){return e},e}function i7(){var e=(0,i5._)(["\n overflow: hidden;\n white-space: nowrap;\n align-self: center;\n opacity: ",";\n max-width: ",";\n transition:\n opacity "," ease-in-out ",",\n max-width 300ms ease-in-out;\n"]);return i7=function(){return e},e}function ae(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function an(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?ae(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ae(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var at=(e,n,t)=>an(an({borderRadius:"0px",margin:"0px",width:"100%",backgroundColor:"".concat(i8.extend.colors.brand["700"]),justifyContent:"flex-start",gap:e?"0.75rem":"0",paddingLeft:e?"1rem":"calc(50% - 12px)",paddingRight:e?"1rem":"calc(50% - 12px)",paddingTop:e?"0.625rem":"1rem",paddingBottom:e?"0.625rem":"1rem",transition:"padding-left 300ms ease-in-out, padding-right 300ms ease-in-out, padding-top 300ms ease-in-out, padding-bottom 300ms ease-in-out, gap 300ms ease-in-out"},n?{backgroundColor:"".concat(i8.extend.colors.brand["500"]),"&:hover:not(:active)":{backgroundColor:"".concat(i8.extend.colors.brand["500"])}}:{"&:hover:not(:active)":{backgroundColor:"".concat(i8.extend.colors.brand["500"])},":active":{backgroundColor:"".concat(i8.extend.colors.brand["500"])}}),t),ar=i4.default.span.withConfig({displayName:"PrintBrokerButton.styles__NotificationBadge",componentId:"sc-3f3bba28-0"})(r||(r=i9()),i3.colors.brand,i8.extend.colors.brand["700"]),ao=i4.default.span.withConfig({displayName:"PrintBrokerButton.styles__LabelText",componentId:"sc-3f3bba28-1"})(o||(o=i7()),e=>+!!e.isVisible,e=>e.isVisible?"160px":"0",e=>e.isVisible?"150ms":"100ms",e=>e.isVisible?"200ms":"0ms"),ai=e=>{var n=e.label,t=e.icon,r=e.onClick,o=e.size,i=e.isActive,a=e.customCSS,l=e.children,s=e.iconOnly,c=e.type,u=e.badgeCount,d=void 0===u?0:u,p=e.showBadge;return(0,iQ.jsxs)(i6.Button,{onClickHandler:r,customCSS:at(!s,void 0!==i&&i,a),label:n||l,title:n||l,size:o,type:void 0===c?"button":c,children:[(0,iQ.jsxs)("div",{style:{position:"relative",display:"inline-flex"},children:[t&&(0,iQ.jsx)(i6.Icon,{name:t,size:24}),void 0!==p&&p&&d>0&&(0,iQ.jsx)(ar,{children:d>99?"99+":d})]}),(0,iQ.jsx)(ao,{isVisible:!s,children:n||l})]})};function aa(){var e=(0,i5._)(["\n flex-shrink: 0;\n flex-direction: column;\n position: relative;\n z-index: 30;\n color: white;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);\n transition: width 300ms ease-in-out;\n background-color: ",";\n width: ",";\n display: ",";\n overflow-y:auto;\n"]);return aa=function(){return e},e}function al(){var e=(0,i5._)(["\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 1rem;\n & > * + * {\n margin-top: 0.5rem;\n }\n"]);return al=function(){return e},e}function as(){var e=(0,i5._)(["\n width: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 1rem;\n & > * + * {\n margin-top: 0.5rem;\n }\n"]);return as=function(){return e},e}function ac(){var e=(0,i5._)(["\n border-top: 1px solid ","80;\n padding: 0.5rem;\n"]);return ac=function(){return e},e}function au(){var e=(0,i5._)(["\n text-align: left;\n overflow: hidden;\n white-space: normal;\n opacity: ",";\n max-width: ",";\n transition:\n opacity "," ease-in-out ",",\n max-width 300ms ease-in-out;\n"]);return au=function(){return e},e}function ad(){var e=(0,i5._)(["\n font-size: 14px;\n color: ",";\n line-height: 1.25;\n"]);return ad=function(){return e},e}function ap(){var e=(0,i5._)(["\n position: relative;\n width: 100%;\n"]);return ap=function(){return e},e}var af=e=>({homeButton:{backgroundColor:"white",margin:"0px",borderRadius:"0px",paddingTop:"1.5rem",paddingBottom:"1.5rem",paddingLeft:e?"1rem":"calc(50% - 21px)",paddingRight:e?"1rem":"calc(50% - 21px)",borderBottom:"1px solid ".concat(i8.extend.colors.brand["200"]),flexShrink:0,width:"100%",justifyContent:"flex-start",ga
1p:e?"0.75rem":"0",transition:"padding-left 300ms ease-in-out, padding-right 300ms ease-in-out, gap 300ms ease-in-out","&:hover:not(:active)":{backgroundColor:"white"},":active":{backgroundColor:"white"}},chevronButton:{width:"100%",height:"3rem"}}),am=i4.default.div.withConfig({displayName:"Sidebar.styles__SideBarContainer",componentId:"sc-8aed7523-0"})(i||(i=aa()),i8.extend.colors.brand["700"],e=>e.isExpanded?"224px":"84px",e=>"lg"===e.size?"flex":"none"),ah=i4.default.nav.withConfig({displayName:"Sidebar.styles__SideBarFlexContainer",componentId:"sc-8aed7523-1"})(a||(a=al())),ag=i4.default.div.withConfig({displayName:"Sidebar.styles__SideBarButtonContainer",componentId:"sc-8aed7523-2"})(l||(l=as())),ay=i4.default.div.withConfig({displayName:"Sidebar.styles__ChevronContainer",componentId:"sc-8aed7523-3"})(s||(s=ac()),i8.extend.colors.brand["500"]),av=i4.default.div.withConfig({displayName:"Sidebar.styles__CompanyNameContainer",componentId:"sc-8aed7523-4"})(c||(c=au()),e=>+!!e.isExpanded,e=>e.isExpanded?"200px":"0",e=>e.isExpanded?"150ms":"100ms",e=>e.isExpanded?"200ms":"0ms"),ax=i4.default.h1.withConfig({displayName:"Sidebar.styles__CompanyName",componentId:"sc-8aed7523-5"})(u||(u=ad()),i8.extend.colors.brand["600"]),ab=i4.default.div.withConfig({displayName:"Sidebar.styles__ProfileButtonWrapper",componentId:"sc-8aed7523-6"}
1)(d||(d=ap())),aj={Dashboard:"dashboard",Projects:"projects",Clients:"clients",Printers:"printers",Profile:"profile",Settings:"settings",Notifications:"notifications",Project:"project",Templates:"templates"},aw={Draft:"Draft",Intake:"Intake",Review:"Review",Production:"Production",Shipping:"Shipping",Complete:"Complete",Cancelled:"Cancelled"},aC={SHIPPED:"Shipped",DELIVERED:"Delivered",ISSUE:"Issue",PENDING_SHIPMENT:"Pending Shipment"},a_={SUP:"PBPSUP",ASC:"PBPASC",AMN:"PBPSYS"},aS={BROKER:"broker",CLIENT:"client",PRINTER:"printer",DEVELOPER:"developer",ADMIN:"admin"},aI={BROKER:"broker",CLIENT:"client",PRINTER:"printer",DEVELOPER:"developer",ADMIN:"admin"},aE="Admin",aP="Inactive User",aO=[{value:aI.PRINTER,text:"Printer",optionHTML:"Printer"},{value:aI.BROKER,text:"Broker",optionHTML:"Broker"},{value:aI.CLIENT,text:"Client",optionHTML:"Client"}],aT={GENERAL_ERROR:"ERROR",FORBIDDEN:"FORBIDDEN"},ak={TITLE_PAGE:"Print Broker",PRINT_BROKER_ROUTE:"/services/easyprint",PRINT_BROKER_API_BASE_URL:"/tpv/session/api/easyPrintProxy/print-broker",PRINT_BROKER_REDIRECT_URL_LOGIN:"/idm/tpsLogin?brokerCode=ADV",PRINT_BROKER_REDIRECT_URL_GENERAL_ERROR:"/services/easyprint?errorCode=".concat(aT.GENERAL_ERROR),PRINT_BROKER_REDIRECT_URL_FORBIDDEN:"/services/easyprint?errorCode=".concat(aT.FORBIDDEN),PRINT_BROKER_REDIRECT_URL_LOGOUT:"/idm/api/identityProxy/logout"},aN={CREATE:"create",EDIT:"edit",VIEW:"view"}
1,aD={CREATE:"create",UPDATE:"update",DELETE:"delete",ADD_PRINT_JOB:"addPrintJob"},aR={CANCEL:"cancel",EDIT:"edit",PUBLISH:"Publish",RESTORE:"Restore",UN_PUBLISH:"Unpublish"},aA={jobId:"",clientId:"",jobName:"",quantity:"",dimensions:"",paperType:"",colors:"",finishing:"",overageNeededVal:"",notes:"",templateId:"-1",printerId:"-1",projectId:"",shippingDelivery:{status:"PENDING_SHIPMENT"},projectFiles:[],sourceFiles:[]},aM={name:"",description:"",status:"",dueDate:"",projectId:""},aF=[{text:"AL",value:"AL"},{text:"AK",value:"AK"},{text:"AZ",value:"AZ"},{text:"AR",value:"AR"},{text:"CA",value:"CA"},{text:"CO",value:"CO"},{text:"CT",value:"CT"},{text:"DE",value:"DE"},{text:"FL",value:"FL"},{text:"GA",value:"GA"},{text:"ID",value:"ID"},{text:"IL",value:"IL"},{text:"IN",value:"IN"},{text:"IA",value:"IA"},{text:"KS",value:"KS"},{text:"KY",value:"KY"},{text:"LA",value:"LA"},{text:"ME",value:"ME"},{text:"MD",value:"MD"},{text:"MA",value:"MA"},{text:"MI",value:"MI"},{text:"MN",value:"MN"},{text:"MS",value:"MS"},{text:"MO",value:"MO"},{text:"MT",value:"MT"},{text:"NE",value:"NE"},{text:"NV",value:"NV"},{text:"NH",value:"NH"},{text:"NJ",value:"NJ"},{text:"NM",value:"NM"},{text:"NY",value:"NY"},{text:"NC",value:"NC"},{text:"ND",value:"ND"},{text:"OH",value:"OH"},{text:"OK",value:"OK"},{text:"OR",value:"OR"},{text:"PA",value:"PA"},{text:"RI",value:"RI"},{text:"SC",value:"SC"},{text:"SD",value:"SD"},{text:"TN",value:"TN"},{text:"TX",value:"TX"},{text:"UT",value:"UT"},{text:"VT",value:"VT"},{text:"VA",value:"VA"},{text:"WA",value:"WA"},{text:"DC",value:"DC"},{text:"WV",value:"WV"},{text:"WI",value:"WI"},{text:"WY",value:"WY"}],az=[{value:"Open Projects",text:(0,iQ.jsx)("span",{children:"Open Projects"}),optionHTML:(0,iQ.jsx)("span",{children:"Open Projects"})},{value:"Recent",text:(0,iQ.jsx)("span",{children:"Recent"}),optionHTML:(0,iQ.jsx)("span",{children:"Recent"})},{value:"Oldest",text:(0,iQ.jsx)("span",{children:"Oldest"}),optionHTML:(0,iQ.jsx)("span",{children:"Oldest"})},{value:"A-Z",text:(0,iQ.jsx)("span",{children:"A-Z"}),optionHTML:(0,iQ.jsx)("span",{children:"A-Z"})},{value:"Z-A",text:(0,iQ.jsx)("span",{children:"Z-A"}),optionHTML:(0,iQ.jsx)("span",{children:"Z-A"})}],aL=[{value:"Newest",text:(0,iQ.jsx)("span",{children:"Newest"}),optionHTML:(0,iQ.jsx)("span",{children:"Newest"})},{value:"Oldest",text:(0,iQ.jsx)("span",{children:"Oldest"}),optionHTML:(0,iQ.jsx)("span",{children:"Oldest"})},{value:"Due Date (asc)",text:(0,iQ.jsx)("span",{children:"Due Date (asc)"}),optionHTML:(0,iQ.jsx)("span",{children:"Due Date (asc)"})},{value:"Due Date (desc)",text:(0,iQ.jsx)("span",{children:"Due Date (desc)"}),optionHTML:(0,iQ.jsx)("span",{children:"Due Date (desc)"})},{value:"A-Z",text:(0,iQ.jsx)("span",{children:"A-Z"}),optionHTML:(0,iQ.jsx)("span",{children:"A-Z"})},{value:"Z-A",text:(0,iQ.jsx)("span",{children:"Z-A"}),optionHTML:(0,iQ.jsx)("span",{children:"Z-A"})}],aB={[aw.Draft]:"price",[aw.Intake]:"contract",[aw.Review]:"contract",[aw.Production]:"new",[aw.Shipping]:"new",[aw.Complete]:"new",[aw.Cancelled]:"product"},aU={FedEx:"FedEx",UPS:"UPS",USPS:"USPS",Courier:"Courier",Other:"Other"},aV=["JPG","PNG","GIF","BMP","TIFF","TIF","EPS","SVG","DOC","DOCX","PPT","PPTX","PDF","ZIP"],aH=e=>{if(!e||!e.includes("."))return!1;var n=e.split(".").pop().toUpperCase();return aV.includes(n)},aW=e=>{try{if("string"==typeof e&&/^\d{2}\/\d{2}\/\d{4}$/.test(e))return e;var n=new Date(e);if(isNaN(n.getTime()))return e;var t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0"),o=n.getFullYear();return"".concat(t,"/").concat(r,"/").concat(o)}catch(n){return e}},aG=[aw.Intake,aw.Review,aw.Production,aw.Shipping,aw.Complete,aw.Draft,aw.Cancelled],aq=[aw.Intake,aw.Review,aw.Production,aw.Shipping,aw.Complete],aK=[aw.Production,aw.Shipping,aw.Complete,aw.Cancelled],aJ={[aw.Draft]:"".concat(i3.colors.dark_gray_2),[aw.Intake]:"".concat(i8.extend.colors.brand["500"]),[aw.Review]:"".concat(i3.colors.medium_yellow_1),[aw.Production]:"".concat(i3.colors.medium_purple_2),[aw.Shipping]:"".concat(i3.colors.link_blue),[aw.Complete]:"".concat(i3.colors.positive),[aw.Cancelled]:"".concat(i3.colors.negative)},aX=["application/pdf","image/jpeg","image/png","image/gif","text/plain"],a$={pdf:"application/pdf",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",txt:"text/plain"},aZ={firstName:"First name is required.",lastName:"Last name is required."},aY={PLACEHOLDER_FIRSTNAME_REGEXP:/^(?=.*[a-zA-Z])[0-9a-zA-Z\s-]+$|^[0-9\s]+$/,PLACEHOLDER_LASTNAME_REGEXP:/^(?=.*[a-zA-Z])[0-9a-zA-Z\s-]+$|^[0-9\s]+$/},aQ=t(43623),a0=t(7766),a1=t.n(a0),a2=e=>a1()(e,"printBroker",{}),a6=(0,aQ.createSelector)([a2],e=>e.projects),a5=(0,aQ.createSelector)([a2],e=>e.templates),a4=(0,aQ.createSelector)([a2],e=>e.settings),a3=(0,aQ.createSelector)([a2],e=>e.project),a8=(0,aQ.createSelector)([a2],e=>e.users),a9=(0,aQ.createSelector)([a2],e=>e.currentUser),a7=(0,aQ.createSelector)([a2],e=>e.config),le=(0,aQ.createSelector)([a2],e=>e.printers),ln=(0,aQ.createSelector)([a2],e=>e.clients),lt=(0,aQ.createSelector)([a2],e=>e.notifications||[]),lr=(0,aQ.createSelector)([a2],e=>e.notificationsCount||0),lo=(0,aQ.createSelector)([a2],e=>e.sessionExpired||!1);function li(){var e=(0,i5._)(["\n position: fixed;\n bottom: 2rem;\n left: ",";\n margin-left: 0.1rem;\n width: 220px;\n background-color: white;\n border-radius: 8px;\n box-shadow:\n 0 10px 25px ",",\n 0 4px 6px ",";\n z-index: 1000;\n overflow: hidden;\n"]);return li=function(){return e},e}function la(){var e=(0,i5._)(["\n padding: 1rem;\n background-color: white;\n border-bottom: 0.5px solid ",";\n"]);return la=function(){return e},e}function ll(){var e=(0,i5._)(["\n font-size: 14px;\n font-weight: 600;\n color: ",";\n margin-bottom: 0.1rem;\n word-break: break-word;\n"]);return ll=function(){return e},e}function ls(){var e=(0,i5._)(["\n font-size: 12px;\n color: ",";\n word-break: break-word;\n"]);return ls=function(){return e},e}function lc(){var e=(0,i5._)(["\n height: 0.1px;\n background-color: ",";\n"]);return lc=function(){return e},e}function lu(){var e=(0,i5._)(["\n width: 100%;\n display: flex;\n flex-direction: column;\n padding: 0.5rem 0;\n"]);return lu=function(){return e},e}function ld(){var e=(0,i5._)(["\n width: 100%;\n display: flex;\n align-items: center;\n padding: 0.75rem 1rem;\n gap: 0.75rem;\n background: none;\n border: none;\n cursor: pointer;\n transition: background-color 0.15s ease;\n margin: 0;\n\n &:hover {\n background-color: ",";\n }\n\n &:active {\n background-color: ",";\n }\n\n &:focus {\n outline: none;\n }\n"]);return ld=function(){return e},e}function lp(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: center;
1\n color: ",";\n flex-shrink: 0;\n width: 20px;\n height: 20px;\n"]);return lp=function(){return e},e}function lf(){var e=(0,i5._)(["\n font-size: 12px;\n font-weight: 400;\n color: ",";\n text-align: left;\n line-height: 1.5;\n"]);return lf=function(){return e},e}var lm=i4.default.div.withConfig({displayName:"ProfileFlyout.styles__FlyoutContainer",componentId:"sc-7478aea5-0"})(p||(p=li()),e=>e.sidebarWidth||"224px",i3.colors.gray_transparent,i3.colors.light_gray_transparent),lh=i4.default.div.withConfig({displayName:"ProfileFlyout.styles__FlyoutHeader",componentId:"sc-7478aea5-1"})(f||(f=la()),i8.extend.colors.brand["200"]),lg=i4.default.div.withConfig({displayName:"ProfileFlyout.styles__UserName",componentId:"sc-7478aea5-2"})(m||(m=ll()),i8.extend.colors.brand["700"]),ly=i4.default.div.withConfig({displayName:"ProfileFlyout.styles__UserEmail",componentId:"sc-7478aea5-3"})(h||(h=ls()),i3.colors.dark_gray_1),lv=i4.default.div.withConfig({displayName:"ProfileFlyout.styles__FlyoutDivider",componentId:"sc-7478aea5-4"})(g||(g=lc()),i3.colors.light_gray_1),lx=i4.default.div.withConfig({displayName:"ProfileFlyout.styles__MenuItemContainer",componentId:"sc-7478aea5-5"})(y||(y=lu())),lb=i4.default.button.withConfig({displayName:"ProfileFlyout.styles__FlyoutMenuItem",componentId:"sc-7478aea5-6"})(v||(v=ld()),i3.colors.alice_blue,i3.colors.alice_blue),lj=i4.default.div.withConfig({displayName:"ProfileFlyout.styles__MenuItemIcon",componentId:"sc-7478aea5-7"})(x||(x=lp()),i3.colors.dark_gray_1),lw=i4.default.span.withConfig({displayName:"ProfileFlyout.styles__MenuItemText",componentId:"sc-7478aea5-8"})(b||(b=lf()),i3.colors.dark_gray_1),lC=()=>(0,iQ.jsx)("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:{color:i3.colors.dark_gray_1},children:(0,iQ.jsx)("path",{d:"M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5-5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"})});let l_=e=>{var n=e.isOpen,t=e.onClose,r=e.userName,o=e.userEmail,i=e.onViewProfile,a=e.onSignOut,l=e.sidebarWidth,s=(0,iq.useRef)(null);return((0,iq.useEffect)(()=>{var e=e=>{s.current&&!s.current.contains(e.target)&&(e.target.closest('button[aria-label*="Profile"]')||t())};return n&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[n,t]),n)?(0,iQ.jsxs)(lm,{ref:s,sidebarWidth:l,children:[(0,iQ.jsxs)(lh,{children:[(0,iQ.jsx)(lg,{children:r||"User"}),(0,iQ.jsx)(ly,{children:o||""})]}),(0,iQ.jsx)(lv,{}),(0,iQ.jsxs)(lx,{children:[(0,iQ.jsxs)(lb,{onClick:i,children:[(0,iQ.jsx)(lj,{children:(0,iQ.jsx)(i6.Icon,{name:"account",size:18})}),(0,iQ.jsx)(lw,{children:"View Profile"})]}),(0,iQ.jsxs)(lb,{onClick:a,children:[(0,iQ.jsx)(lj,{children:(0,iQ.jsx)(lC,{})}),(0,iQ.jsx)(lw,{children:"Sign Out"})]})]})]}):null};function lS(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let lI=e=>
1{var n,t,r,o=e.companyName,i=e.viewMode,a=e.size,l=e.onNavigate,s=e.isExpanded,c=e.onToggleExpand,u=e.handleSignOut,d=af(s),p=(0,iY.useSelector)(lr),f=(0,iY.useSelector)(a9),m=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||function(e,n){if(e){if("string"==typeof e)return lS(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lS(e,n):void 0}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)(!1),2),h=m[0],g=m[1],y=null!=f&&null!=(n=f.contact)&&n.firstName&&null!=f&&null!=(t=f.contact)&&t.lastName?"".concat(f.contact.firstName," ").concat(f.contact.lastName):(null==f?void 0:f.displayName)||"User",v=(null==f||null==(r=f.contact)?void 0:r.email)||(null==f?void 0:f.email)||"";return(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(am,{isExpanded:s,size:a,children:[(0,iQ.jsxs)(i6.Button,{onClick:()=>
1l("dashboard"),customCSS:d.homeButton,label:"Go to dashboard",disabled:i===aS.CLIENT,children:[(0,iQ.jsx)(i2,{style:{height:"42px",width:"42px",fill:"".concat(i8.extend.colors.brand["600"]," !important"),flexShrink:0}}),(0,iQ.jsx)(av,{isExpanded:s,children:(0,iQ.jsx)(ax,{children:o})})]}),(0,iQ.jsxs)(ah,{children:[(i===aS.BROKER||i===aS.DEVELOPER||i===aS.ADMIN)&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(ai,{label:"Clients",icon:"shared-user",iconOnly:!s,size:"md",onClick:()=>l("clients")}),(0,iQ.jsx)(ai,{label:"Printers",icon:"print",iconOnly:!s,size:"md",onClick:()=>l("printers")}),(0,iQ.jsx)(ai,{label:"Templates",icon:"material",iconOnly:!s,size:"md",customCSS:{"& svg":{transform:"rotate(90deg)"}},onClick:()=>l("templates")})]}),(0,iQ.jsx)(ai,{label:"Projects",icon:"weekly-ad",iconOnly:!s,size:"md",onClick:()=>l("projects")})]}),(0,iQ.jsxs)(ag,{children:[(0,iQ.jsx)(ai,{label:"Notifications",icon:"notification-bell",iconOnly:!s,size:"md",onClick:()=>l("notifications"),showBadge:!0,badgeCount:p}),(i===aS.BROKER||i===aS.DEVELOPER||i===aS.ADMIN)&&(0,iQ.jsx)(ai,{label:"Settings",icon:"cog",iconOnly:!s,size:"md",onClick:()=>l("settings")}),(0,iQ.jsx)(ab,{children:(0,iQ.jsx)(ai,{label:"Profile",icon:"account",iconOnly:!s,size:"md",isActive:h,onClick:()=>g(!h)})})]}),(0,iQ.jsx)(ay,{children:(0,iQ.jsx)(ai,{label:s?"Collapse sidebar":"Expand sidebar",icon:s?"caret_left":"caret_right",iconOnly:!0,size:"xs",onClick:c,customCSS:d.chevronButton})})]}),(0,iQ.jsx)(l_,{isOpen:h,onClose:()=>g(!1),userName:y,userEmail:v,sidebarWidth:s?"224px":"84px",onViewProfile:()=>{g(!1),l("profile")},onSignOut:()=>{g(!1),u()}})]})},lE=e=>{var n=e.items.map(e=>({title:e.label,link:e.link}));return(0,iQ.jsx)(i6.Breadcrumbs,{customCSS:"padding:0",routes:n,backBtnText:"Back"})};function lP(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n color: ",";\n background-color: ",";\n height:100vh;\n overflow:auto;\n ","\n "]);return lP=function(){return e},e}function lO(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n flex: 1 1 0%;\n padding: 20px 0px;\n gap: 20px;\n"]);return lO=function(){return e},e}function lT(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n flex: 1 1 0%;\n padding: 20px;\n"]);return lT=function(){return e},e}function lk(){var e=(0,i5._)(["\n flex-shrink: 0;\n ul > li {\n padding-left: 0 !important;\n display: flex !important;\n align-items: center !important;\n }\n ul > li:last-child {\n font-weight: 600 !important;\n margin-bottom: 2px !important;\n }\n ul > span {\n display: flex !important;\n align-items: center !important;\n }\n ul {\n margin: 0px 0px 0px 5px;\n }\n"]);return lk=function(){return e},e}function lN(){var e=(0,i5._)(["\n width: 100%;\n border-collapse: collapse;\n background-color: white;\n\n overflow-x: auto;\n\n @media (max-width: 600px) {\n display: block;\n -webkit-overflow-scrolling: touch;\n\n table {\n min-width: 600px;\n }\n }\n"]);return lN=function(){return e},e}function lD(){var e=(0,i5._)(["\n background-color: rgb(249 250 251);\n"]);return lD=function(){return e},e}function lR(){var e=(0,i5._)(["\n padding: 8px 16px;\n border-top: 1px solid #ddd;\n text-align: left;\n font-size: 14px;\n line-height: 1.25rem;\n color:",";\n text-transform: uppercase;\n}\n"]);return lR=function(){return e},e}function lA(){var e=(0,i5._)(["\n font-size: 14px !important;\n padding: 12px 16px;\n font-size: 13px;\n line-height: 1.25rem;\n color: ",";\n"]);return lA=function(){return e},e}function lM(){var e=(0,i5._)(["\n background-color: white;\n border-top: 1px solid #ddd;\n"]);return lM=function(){return e},e}function lF(){var e=(0,i5._)(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n"]);return lF=function(){return e},e}function lz(){var e=(0,i5._)(["\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: #e5e7eb;\n color: rgb(107 114 128);\n text-align: center;\n // padding: 20px;\n"]);return lz=function(){return e},e}function lL(){var e=(0,i5._)(["\n text-align: center;\n margin: auto;\n padding-bottom: 10px;\n width: 40px;\n"]);return lL=function(){return e},e}function lB(){var e=(0,i5._)(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n width: 100vw;\n z-index: 99999 !important;\n pointer-events: none;\n\n & > * {\n pointer-events: auto;\n }\n"]);return lB=function(){return e},e}var lU=i4.default.div.withConfig({displayName:"PrintBrokerHome.styles__LayoutContainer",componentId:"sc-2ea45cfa-0"})(j||(j=lP()),i8.extend.colors.brand[800],i8.extend.colors.brand[100],e=>"lg"===e.size&&"flex-direction: row;\n ");i4.default.div.withConfig({displayName:"PrintBrokerHome.styles__MainContainer",componentId:"sc-2ea45cfa-1"})(w||(w=lO()));var lV=i4.default.main.withConfig({displayName:"PrintBrokerHome.styles__ComponentContainer",componentId:"sc-2ea45cfa-2"})(C||(C=lT())),lH=i4.default.div.withConfig({displayName:"PrintBrokerHome.styles__BreadcrumbsContainer",componentId:"sc-2ea45cfa-3"})(_||(_=lk())),lW=i4.default.table.withConfig({displayName:"PrintBrokerHome.styles__StyledTable",componentId:"sc-2ea45cfa-4"})(S||(S=lN())),lG=i4.default.thead.withConfig({displayName:"PrintBrokerHome.styles__StyledThead",componentId:"sc-2ea45cfa-5"})(I||(I=lD())),lq=i4.default.th.withConfig({displayName:"PrintBrokerHome.styles__StyledTh",componentId:"sc-2ea45cfa-6"})(E||(E=lR()),i3.colors.dark_gray_2),lK=i4.default.td.withConfig({displayName:"PrintBrokerHome.styles__StyledTd",componentId:"sc-2ea45cfa-7"})(P||(P=lA()),e=>e.primary?i8.extend.colors.brand["600"]:i3.colors.dark_gray_2),lJ=i4.default.tr.withConfig({displayName:"PrintBrokerHome.styles__StyledTr",componentId:"sc-2ea45cfa-8"})(O||(O=lM())),lX=i4.default.div.withConfig({displayName:"PrintBrokerHome.styles__CenterContainer",componentId:"sc-2ea45cfa-9"})(T||(T=lF())),l$=i4.default.div.withConfig({displayName:"PrintBrokerHome.styles__EmptyProject",componentId:"sc-2ea45cfa-10"})(k||(k=lz())),lZ=i4.default.div.withConfig({displayName:"PrintBrokerHome.styles__EmptyProjectIcon",componentId:"sc-2ea45cfa-11"})(N||(N=lL())),lY=i4.default.div.withConfig({displayName:"PrintBrokerHome.styles__ToastWrapper",componentId:"sc-2ea45cfa-12"})(D||(D=lB())),lQ=t(64741),l0=t(88728);function l1(){var e=(0,i5._)(["\n padding: 24px;\n\n @media screen and (max-width: ","px) {\n padding: 16px;\n }\n"]);return l1=function(){return e},e}function l2(){var e=(0,i5._)(["\n border-top: 1px solid #ddd;\n padding: 24px;\n\n @media screen and (max-width: ","px) {\n padding: 16px;\n }\n"]);return l2=function(){return e},e}function l6(){var e=(0,i5._)(["\n width: 100%;\n\n @media screen and (max-width: ","px) {\n margin-bottom: 16px;\n }\n"]);return l6=function(){return e},e}function l5(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n font-weight: 700;\n margin: 0 0 8px 0;\n color: ",";\n line-height: 32px;\n\n @media screen and (max-width: ","px) {\n font-size: 18px;\n line-height: 28px;\n margin: 0 0 6px 0;\n }\n"]);return l5=function(){return e},e}function l4(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin: 0;\n\n @media screen and (max-width: ","px) {\n font-size: 13px;\n line-height: 18px;\n }\n"]);
1return l4=function(){return e},e}function l3(){var e=(0,i5._)(["\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 32px 40px;\n padding: 16px;\n\n @media screen and (max-width: ","px) {\n grid-template-columns: 1fr;\n gap: 14px;\n }\n"]);return l3=function(){return e},e}function l8(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"]);return l8=function(){return e},e}function l9(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 13px;\n font-weight: 500;\n color: ",";\n line-height: 18px;\n"]);return l9=function(){return e},e}function l7(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 16px;\n font-weight: 400;\n color: ",";\n line-height: 24px;\n\n @media screen and (max-width: ","px) {\n font-size: 14px;\n line-height: 20px;\n }\n"]);return l7=function(){return e},e}function se(){var e=(0,i5._)(["\n display: flex;\n justify-content: flex-end;\n border-top: 1px solid #ddd;\n gap: 12px;\n padding: 16px;\n margin-top: 32px;\n border-top: 1px solid #ddd;\n\n @media screen and (max-width: ","px) {\n padding: 16px 0 0;\n margin-top: 24px;\n }\n"]);return se=function(){return e},e}var sn=(0,i4.default)(i6.Row).withConfig({displayName:"UserProfile.styles__HeaderRow",componentId:"sc-275dd45f-0"})(R||(R=l1()),l0.BREAKPOINTS.sm),st=(0,i4.default)(i6.Column).withConfig({displayName:"UserProfile.styles__DetailsColumn",componentId:"sc-275dd45f-1"})(A||(A=l2()),l0.BREAKPOINTS.sm),sr=i4.default.div.withConfig({displayName:"UserProfile.styles__HeaderContent",componentId:"sc-275dd45f-2"})(M||(M=l6()),l0.BREAKPOINTS.sm),so=i4.default.h1.withConfig({displayName:"UserProfile.styles__ProfileTitle",componentId:"sc-275dd45f-3"})(F||(F=l5()),lQ.typography.type.motiva_bold,i3.colors.black,l0.BREAKPOINTS.sm),si=i4.default.p.withConfig({displayName:"UserProfile.styles__ProfileDescription",componentId:"sc-275dd45f-4"})(z||(z=l4()),lQ.typography.type.motiva,i3.colors.dark_gray_1,l0.BREAKPOINTS.sm),sa=i4.default.div.withConfig({displayName:"UserProfile.styles__ProfileGrid",componentId:"sc-275dd45f-5"})(L||(L=l3()),l0.BREAKPOINTS.md),sl=i4.default.div.withConfig({displayName:"UserProfile.styles__ProfileField",componentId:"sc-275dd45f-6"})(B||(B=l8())),ss=i4.default.label.withConfig({displayName:"UserProfile.styles__FieldLabel",componentId:"sc-275dd45f-7"})(U||(U=l9()),lQ.typography.type.motiva,i3.colors.dark_gray_1),sc=i4.default.div.withConfig({displayName:"UserProfile.styles__FieldValue",componentId:"sc-275dd45f-8"})(V||(V=l7()),lQ.typography.type.motiva,i3.colors.black,l0.BREAKPOINTS.sm),su=i4.default.div.withConfig({displayName:"UserProfile.styles__EditModeActions",componentId:"sc-275dd45f-9"})(H||(H=se()),l0.BREAKPOINTS.sm);function sd(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return sp(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(sp(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,sp(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,sp(u,"constructor",c),sp(c,"constructor",s),s.displayName="GeneratorFunction",sp(c,o,"GeneratorFunction"),sp(u),sp(u,o,"Generator"),sp(u,r,function(){return this}),sp(u,"toString",function(){return"[object Generator]"}),(sd=function(){return{w:i,m:d}})()}function sp(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(sp=function(e,n,t,r){function i(n,t){sp(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function sf(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}let sm=e=>{var n=e.user,t=e.isEditMode,r=e.onEditProfile,o=e.onCancelEdit,i=e.onSaveProfile,a=e.clientCompany,l=e.brokerCompany,s=(0,iq.useRef)(),c=(null==n?void 0:n.contact)||{},u=null==n?void 0:n.userType,d="admin"===u,p="broker"===u,f=(0,iq.useMemo)(()=>({firstName:c.firstName||"",lastName:c.lastName||"",email:c.email||(null==n?void 0:n.email)||"",phone:c.phone||"",username:(null==n?void 0:n.username)||"",company:
1p?(null==l?void 0:l.name)||"":(null==a?void 0:a.company)||""}),[c,null==n?void 0:n.email,p,null==l?void 0:l.name,null==a?void 0:a.company]),m=function(){var e,n=(e=sd().m(function e(n){return sd().w(function(e){for(;;)switch(e.n){case 0:if(!i){e.n=1;break}return e.n=1,i(n);case 1:return e.a(2)}},e)}),function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){sf(i,r,o,a,l,"next",e)}function l(e){sf(i,r,o,a,l,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}();return(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(sn,{children:[(0,iQ.jsx)(i6.Column,{span:t?12:6,spanSM:t?12:6,spanXS:t?12:8,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(sr,{children:[(0,iQ.jsx)(so,{children:"My Profile"}),(0,iQ.jsx)(si,{children:"Manage your personal and contact information."})]})}),!t&&(0,iQ.jsx)(i6.Column,{span:6,spanSM:6,spanXS:4,customCSS:{textAlign:"end",marginLeft:"6px"},children:(0,iQ.jsx)(ai,{size:"sm",label:"Edit Profile",icon:"edit",onClick:r,customCSS:{width:"auto",borderRadius:"5px"}})})]}),(0,iQ.jsx)(i6.Row,{customCSS:{padding:0},children:(0,iQ.jsxs)(st,{span:12,customCSS:{margin:0},children:[t?(0,iQ.jsx)(i6.FormikWrapper,{initialValues:f,onSubmit:m,callbackFnToFormikRef:e=>{s.current=e},enableReinitialize:!0,validateOnMount:!1,validateOnBlur:!1,validateOnChange:!1,children:(0,iQ.jsxs)(sa,{children:[(0,iQ.jsx)(sl,{children:(0,iQ.jsx)(i6.FormikElement,{name:"firstName",component:i6.TextInput,label:"First Name",placeholder:"Enter first name",maxLength:128,isRequired:!0,ariaLabel:"first name"})}),(0,iQ.jsx)(sl,{children:(0,iQ.jsx)(i6.FormikElement,{name:"lastName",component:i6.TextInput,label:"Last Name",placeholder:"Enter last name",maxLength:128,isRequired:!0,ariaLabel:"last name"})}),!d&&(0,iQ.jsx)(sl,{children:(0,iQ.jsx)(i6.FormikElement,{name:"company",component:i6.TextInput,label:"Company",placeholder:"Company name",ariaLabel:"company",disabled:!0})}),(0,iQ.jsx)(sl,{children:(0,iQ.jsx)(i6.FormikElement,{name:"username",component:i6.TextInput,label:"Username",placeholder:"Username",ariaLabel:"username",disabled:!0})}),(0,iQ.jsx)(sl,{children:(0,iQ.jsx)(i6.FormikElement,{name:"phone",component:i6.TextInput,label:"Contact Phone",placeholder:"Enter phone",isRequired:!0,type:"phone",ariaLabel:"phone"})}),(0,iQ.jsx)(sl,{children:(0,iQ.jsx)(i6.FormikElement,{name:"email",component:i6.TextInput,label:"Email Address",placeholder:"Enter email address",isRequired:!0,type:"email",ariaLabel:"email address",disabled:!0})})]})}):(0,iQ.jsxs)(sa,{children:[(0,iQ.jsxs)(sl,{children:[(0,iQ.jsx)(ss,{children:"First Name"}),(0,iQ.jsx)(sc,{children:f.firstName})]}),(0,iQ.jsxs)(sl,{children:[(0,iQ.jsx)(ss,{children:"Last Name"}),(0,iQ.jsx)(sc,{children:f.lastName})]}),!d&&(0,iQ.jsxs)(sl,{children:[(0,iQ.jsx)(ss,{children:"Company"}),(0,iQ.jsx)(sc,{children:f.company||"N/A"})]}),(0,iQ.jsxs)(sl,{children:[(0,iQ.jsx)(ss,{children:"Username"}),(0,iQ.jsx)(sc,{children:f.username})]}),(0,iQ.jsxs)(sl,{children:[(0,iQ.jsx)(ss,{children:"Contact Phone"}),(0,iQ.jsx)(sc,{children:f.phone})]}),(0,iQ.jsxs)(sl,{children:[(0,iQ.jsx)(ss,{children:"Email Address"}),(0,iQ.jsx)(sc,{children:f.email})]})]}),t&&(0,iQ.jsxs)(su,{children:[(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:o,customCSS:"margin: 0; border-radius: 5px;",children:"Cancel"}),(0,iQ.jsx)(ai,{size:"sm",onClick:()=>{var e;null==(e=s.current)||e.submitForm()},customCSS:{width:"auto",borderRadius:"5px",padding:"7px 19px"},children:"Save Changes"})]})]})})]})};function sh(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return sg(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");
1if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(sg(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,sg(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,sg(u,"constructor",c),sg(c,"constructor",s),s.displayName="GeneratorFunction",sg(c,o,"GeneratorFunction"),sg(u),sg(u,o,"Generator"),sg(u,r,function(){return this}),sg(u,"toString",function(){return"[object Generator]"}),(sh=function(){return{w:i,m:d}})()}function sg(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(sg=function(e,n,t,r){function i(n,t){sg(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function sy(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function sv(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let sx=e=>{e._onNavigateBack;var n=e.user,t=e.brokerCompany,r=e.clientCompany,o=e.onUpdateProfile,i=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||function(e,n){if(e){if("string"==typeof e)return sv(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?sv(e,n):void 0}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)(!1),2),a=i[0],l=i[1],s=function(){var e,n=(e=sh().m(function e(n){return sh().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!o){e.n=1;break}return e.n=1,o(n);case 1:l(!1),e.n=3;break;case 2:e.p=2,console.error("Error saving profile:",e.v);case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){sy(i,r,o,a,l,"next",e)}function l(e){sy(i,r,o,a,l,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}();return(0,iQ.jsxs)(i6.Container,{customCSS:"max-width: none; overflow-y: auto; ",children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(lH,{children:(0,iQ.jsx)(lE,{items:[{label:"Dashboard",link:"./easyprint?action=dashboard"},{label:"My Profile"}]})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:0},children:(0,iQ.jsx)(i6.Card,{customCSS:{padding:"0px"},isClickable:!1,isHover:!1,children:(0,iQ.jsx)(sm,{user:n,isEditMode:a,brokerCompany:t,clientCompany:r,onEditProfile:()=>{l(!0)},onCancelEdit:()=>{l(!1)},onSaveProfile:s})})})})]})};function sb(){var e=(0,i5._)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 24px;\n gap: 12px;\n\n @media screen and (max-width: ","px) {\n flex-wrap: wrap;\n align-items: center;\n }\n"]);return sb=function(){return e},e}function sj(){var e=(0,i5._)(["\n flex: 1;\n min-width: 0;\n"]);return sj=function(){return e},e}function sw(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n font-weight: 600;\n margin: 0 0 8px 0;\n"]);return sw=function(){return e},e}function sC(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n line-height: 20px;\n color: ",";\n margin: 0;\n"]);return sC=function(){return e},e}function s_(){var e=(0,i5._)(["\n margin-bottom: 24px;\n"]);return s_=function(){return e},e}function sS(){var e=(0,i5._)(["\n display: flex;\n gap: 12px;\n align-items: center;\n"]);return sS=function(){return e},e}function sI(){var e=(0,i5._)(["\n flex: 1;\n position: relative;\n display: flex;\n align-items: center;\n\n svg {\n position: absolute;\n left: 12px;\n color: ",";\n pointer-events: none;\n }\n"]);return sI=function(){return e},e}function sE(){var e=(0,i5._)(["\n width: 100%;\n padding: 10px 16px 10px 40px;\n font-size: 14px;\n font-family: ",";\n border: 1px solid ",";\n border-radius: 4px;\n outline: none;\n transition: border-color 0.2s ease;\n\n &:focus {\n border-color: ",";\n }\n\n &::placeholder {\n color: ",";\n }\n\n @media screen and (max-width: ","px) {\n font-size: 12px;\n }\n"]);return sE=function(){return e},e}function sP(){var e=(0,i5._)(["\n padding: 16px;\n font-size: 13px;\n font-family: ",";\n"]);return sP=function(){return e},e}function sO(){var e=(0,i5._)(["\n display: inline-block;\n padding: 4px 12px;\n font-family: ",";\n background: ",";\n color: ",";\n border-radius: 12px;\n font-size: 12px;\n font-weight: 600;\n white-space: nowrap;\n"]);return sO=function(){return e},e}function sT(){var e=(0,i5._)(["\n gap: 6px;\n display: flex;\n flex-direction: column;\n"]);return sT=function(){return e},e}function sk(){var e=(0,i5._)(["\n gap: 8px;\n display: flex;\n align-items: center;\n"]);return sk=function(){return e},e}function sN(){var e=(0,i5._)(["\n font-size: 14px;\n line-height: 20px;\n font-family: ",";\n"]);return sN=function(){return e},e}function sD(){var e=(0,i5._)(["\n font-family: ",";\n"]);return sD=function(){return e},e}function sR(){var e=(0,i5._)(["\n font-size: 16px;\n @media screen and (max-width: ","px) {\n font-size: 14px;\n }\n"]);return sR=function(){return e},e}var sA=i4.default.div.withConfig({displayName:"UserManagement.styles__ContentHeader",componentId:"sc-8d0893b2-0"})(W||(W=sb()),l0.BREAKPOINTS.sm),sM=i4.default.div.withConfig({displayName:"UserManagement.styles__HeaderLeft",componentId:"sc-8d0893b2-1"})(G||(G=sj())),sF=i4.default.h1.withConfig({displayName:"UserManagement.styles__ContentTitle",componentId:"sc-8d0893b2-2"})(q||(q=sw()),lQ.typography.type.motiva_bold),sz=i4.default.p.withConfig({displayName:"UserManagement.styles__ContentDescription",componentId:"sc-8d0893b2-3"})(K||(K=sC()),lQ.typography.type.motiva,i3.colors.dark_gray_1),sL=i4.default.div.withConfig({displayName:"UserManagement.styles__SearchWra
1pper",componentId:"sc-8d0893b2-4"})(J||(J=s_())),sB=i4.default.div.withConfig({displayName:"UserManagement.styles__SearchContainer",componentId:"sc-8d0893b2-5"})(X||(X=sS())),sU=i4.default.div.withConfig({displayName:"UserManagement.styles__SearchInputWrapper",componentId:"sc-8d0893b2-6"})($||($=sI()),i3.colors.dark_gray_1),sV=i4.default.input.withConfig({displayName:"UserManagement.styles__SearchInput",componentId:"sc-8d0893b2-7"})(Z||(Z=sE()),lQ.typography.type.motiva,i3.colors.ink_light_gray,i8.extend.colors.brand["500"],i3.colors.dark_gray_1,l0.BREAKPOINTS.sm),sH=i4.default.td.withConfig({displayName:"UserManagement.styles__NameCell",componentId:"sc-8d0893b2-8"})(Y||(Y=sP()),lQ.typography.type.motiva),sW=i4.default.span.withConfig({displayName:"UserManagement.styles__Badge",componentId:"sc-8d0893b2-9"})(Q||(Q=sO()),lQ.typography.type.motiva_bold,e=>e.$backgroundColor||i3.colors.light_gray_1,e=>e.$textColor||i3.colors.dark_gray_1),sG=i4.default.div.withConfig({displayName:"UserManagement.styles__PopoverContainer",componentId:"sc-8d0893b2-10"})(ee||(ee=sT())),sq=i4.default.div.withConfig({displayName:"UserManagement.styles__PopoverActionItem",componentId:"sc-8d0893b2-11"})(en||(en=sk())),sK=i4.default.div.withConfig({displayName:"UserManagement.styles__PopoverActionItemText",componentId:"sc-8d0893b2-12"})(et||(et=sN()),lQ.typography.type.motiva),sJ=i4.default.span.withConfig({displayName:"UserManagement.styles__MotivaBold",componentId:"sc-8d0893b2-13"})(er||(er=sD()),lQ.typography.type.motiva_bold),sX=i4.default.div.withConfig({displayName:"UserManagement.styles__ModalPopupContent",componentId:"sc-8d0893b2-14"})(eo||(eo=sR()),l0.BREAKPOINTS.xxs);function s$(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 12px;"]);return s$=function(){return e},e}function sZ(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 0.5rem; /* gap-2 */\n flex-grow: 1;\n min-width: 0;\n padding-left: ","rem;"]);return sZ=function(){return e},e}function sY(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n min-width: 0;"]);return sY=function(){return e},e}function sQ(){var e=(0,i5._)(["\n padding:0;\n &::before {\n content: none;\n }"]);return sQ=function(){return e},e}function s0(){var e=(0,i5._)(["\n list-style: none;\n margin: 0;\n padding: 0;\n\n > li {\n border-top: 1px solid #e5e7eb; /* gray-200 */\n }"]);return s0=function(){return e},e}function s1(){var e=(0,i5._)(["\n font-size: 14px;\n font-weight: 700;\n font-family: ",";\n margin: 5px 0px;\n color:rgb(107 114 128);\n @media screen and (max-width: ","px) {\n font-size: 12px;\n }\n"]);return s1=function(){return e},e}function s2(){var e=(0,i5._)(["\n margin: 20px auto 20px;\n text-align: center;\n"]);return s2=function(){return e},e}function s6(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 16px;\n cursor: pointer;\n overflow-wrap: break-word;\n overflow: hidden;\n font-weight: 500;\n color: ",";\n @media screen and (max-width: ","px) {\n font-size: 14px;\n }\n &:hover {\n text-decoration: underline;\n }\n"]);return s6=function(){return e},e}function s5(){var e=(0,i5._)(["\n font-family: ",";\n color: ",";\n font-size: 14px;\n overflow-wrap: break-word;\n overflow: hidden;\n @media screen and (max-width: ","px) {\n font-size: 12px;\n }\n"]);return s5=function(){return e},e}function s4(){var e=(0,i5._)(["\n display:flex;\n align-items:center;\n gap:12px;\n"]);return s4=function(){return e},e}function s3(){var e=(0,i5._)(["\n margin:0;\n font-size: 18px;\n line-height: 28px;\n font-family: ",";\n @media screen and (max-width: ","px) {\n font-size: 18px;\n line-height: 20px;\n }\n"]);return s3=function(){return e},e}function s8(){var e=(0,i5._)(["\n svg {\n fill: black !important;\n }\n"]);return s8=function(){return e},e}function s9(){var e=(0,i5._)(["\n cursor: pointer;\n svg {\n fill: black !important;\n }\n"]);return s9=function(){return e},e}function s7(){var e=(0,i5._)(["\n gap: 6px;\n display: flex;\n flex-direction: column;\n"]);return s7=function(){return e},e}function ce(){var e=(0,i5._)(["\n gap: 8px;\n display: flex;\n align-items: center;\n"]);return ce=function(){return e},e}function cn(){var e=(0,i5._)(["\n font-size: 14px;\n line-height: 20px;\n font-family: ",";\n"]);return cn=function(){return e},e}function ct(){var e=(0,i5._)(["\n font-family: ",";\n"]);return ct=function(){return e},e}function cr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}var co=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__ClientRowContainer",componentId:"sc-466e30b6-0"})(ei||(ei=s$())),ci=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__RowWrapper",componentId:"sc-466e30b6-1"})(ea||(ea=sZ()),e=>1.5*e.level),ca=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__ClientDetailsWrapper",componentId:"sc-466e30b6-2"})(el||(el=sY())),cl=i4.default.li.withConfig({displayName:"ClientManagementHomePage.styles__LI",componentId:"sc-466e30b6-3"})(es||(es=sQ())),cs=i4.default.ul.withConfig({displayName:"ClientManagementHomePage.styles__UL",componentId:"sc-466e30b6-4"})(ec||(ec=s0())),cc=i4.default.h3.withConfig({displayName:"ClientManagementHomePage.styles__EmptyStateText",componentId:"sc-466e30b6-5"})(eu||(eu=s1()),lQ.typography.type.motiva,l0.BREAKPOINTS.sm),cu=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__EmptyStateContainer",componentId:"sc-466e30b6-6"})(ed||(ed=s2())),cd=i4.default.span.withConfig({displayName:"ClientManagementHomePage.styles__ClientName",componentId:"sc-466e30b6-7"})(ep||(ep=s6()),lQ.typography.type.motiva,i8.extend.colors.brand["600"],l0.BREAKPOINTS.sm),cp=i4.default.span.withConfig({displayName:"ClientManagementHomePage.styles__ClientDetails",componentId:"sc-466e30b6-8"})(ef||(ef=s5()),lQ.typography.type.motiva,i3.colors.dark_gray_2,l0.BREAKPOINTS.sm),cf=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__SubTitleContainer",componentId:"sc-466e30b6-9"})(em||(em=s4())),cm=i4.default.h3.withConfig({displayName:"ClientManagementHomePage.styles__SubTitle",componentId:"sc-466e30b6-10"})(eh||(eh=s3()),lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm),ch=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__IconContainer",componentId:"sc-466e30b6-11"})(eg||(eg=s8()));i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__ActionIconContainer",componentId:"sc-466e30b6-12"})(ey||(ey=s9()));var cg=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__PopoverContainer",componentId:"sc-466e30b6-13"})(ev||(ev=s7())),cy=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__PopoverActionItem",componentId:"sc-466e30b6-14"})(ex||(ex=ce())),cv=i4.default.div.withConfig({displayName:"ClientManagementHomePage.styles__PopoverActionItemText",componentId:"sc-466e30b6-15"})(eb||(eb=cn()),lQ.typography.type.motiva),cx=e=>(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?cr(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cr(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e})({backgroundColor:"inherit !important",margin:0,flexShrink:0,"&:hover":{boxShadow:"none !important"},"& svg":{height:"12px",width:"12px"}},!e&&{visibility:"hidden"});i4.default.span.withConfig({displayName:"ClientManagementHomePage.styles__MotivaBold",componentId:"sc-466e30b6-16"})(ej||(ej=ct()),lQ.typography.type.motiva_bold);var cb={Active:{text:i3.colors.forest,background:i3.colors.light_forest_2},"Awaiting Access":{text:i3.colors.link_blue,background:i3.colors.light_info},"Pending Invitation":{text:i3.colors.ink_light_black,background:i3.colors.ink_light_gray},"Pending Activation":{text:i3.colors.warning,background:i3.colors.light_warning},Inactive:{text:i3.colors.dark_gray_1,background:i3.colors.light_gray_1},Admin:{text:i3.colors.staples_red,background:i3.colors.light_negative},"Project Manager":{text:i3.colors.link_blue,background:i3.colors.light_info},Client:{text:i3.colors.forest,background:i3.colors.light_forest_2},Printer:{text:i3.colors.link_blue,background:i3.colors.light_info},"View Only":{text:i3.colors.warning,background:i3.colors.light_warning}},cj=e=>cb[e]||{text:i3.colors.dark_gray_1,background:i3.colors.light_gray_1};function cw(){var e=(0,i5._)(["\n font-size: 20px;\n line-height: 24px;\n font-family: ",";\n margin: 0;\n padding: 0;\n"]);return cw=function(){return e},e}function cC(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n text-align: left;\n gap: 5px;\n"]);return cC=function(){return e},e}function c_(){var e=(0,i5._)(["\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n font-family: ",";\n margin-bottom: 12px;\n"]);return c_=function(){return e},e}function cS(){var e=(0,i5._)(["\n font-size: 16px;\n font-family: ",";\n display: flex;\n align-items: center;\n gap: 0.75rem;\n cursor: pointer;\n"]);return cS=function(){return e},e}function cI(){var e=(0,i5._)(["\n height: 1rem;\n width: 1rem;\n border-radius: 0.25rem;\n border: 1px solid #d1d5db;\n"]);return cI=function(){return e},e}function cE(){var e=(0,i5._)(["\n font-size: 16px;\n font-family: ",";\n color: ",";\n"]);return cE=function(){return e},e}var cP=i4.default.h1.withConfig({displayName:"FilterDrawer.styles__FilterProject",componentId:"sc-429f5317-0"})(ew||(ew=cw()),lQ.typography.type.motiva_medium),cO=i4.default.div.withConfig({displayName:"FilterDrawer.styles__DrawerViewHeader",componentId:"sc-429f5317-1"})(eC||(eC=cC())),cT=i4.default.h3.withConfig({displayName:"FilterDrawer.styles__Heading",componentId:"sc-429f5317-2"})(e_||(e_=c_()),lQ.typography.type.motiva_bold),ck=i4.default.label.withConfig({displayName:"FilterDrawer.styles__Label",componentId:"sc-429f5317-3"})(eS||(eS=cS()),lQ.typography.type.motiva),cN=i4.default.input.withConfig({displayName:"FilterDrawer.styles__Checkbox",componentId:"sc-429f5317-4"})(eI||(eI=cI())),cD=i4.default.span.withConfig({displayName:"FilterDrawer.styles__StatusText",componentId:"sc-429f5317-5"})(eE||(eE=cE()),lQ.typography.type.motiva,i3.colors.black);function cR(){var e=(0,i5._)(["\n padding: 24px 20px;\n"]);return cR=function(){return e},e}function cA(){var e=(0,i5._)(["\n margin-bottom: 28px;\n\n &:last-child {\n margin-bottom: 0;\n }\n"]);return cA=function(){return e},e}function cM(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n margin-bottom: 12px;\n gap: 10px;\n\n &:last-child {\n margin-bottom: 0;\n }\n"]);return cM=function(){return e},e}function cF(){var e=(0,i5._)(["\n display: flex;\n gap: 12px;\n padding: 4px;\n"]);return cF=function(){return e},e}function cz(){var e=(0,i5._)(["\n flex: 1;\n padding: 10px 24px;\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius: 4px;\n font-size: 14px;\n font-family: ",";\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s ease;\n\n &:hover {\n background: ",";\n }\n\n &:active {\n background: ",";\n }\n"]);return cz=function(){return e},e}function cL(){var e=(0,i5._)(["\n flex: 1;\n padding: 10px 24px;\n background: ",";\n color: ",";\n border: none;\n border-radius: 4px;\n font-size: 14px;\n font-family: ",";\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s ease;\n white-space: nowrap;\n\n &:hover {\n background: ",";\n }\n\n &:active {\n background: ",";\n }\n"]);return cL=function(){return e},e}var cB=i4.default.div.withConfig({displayName:"UserFilterDrawer.styles__DrawerContent",componentId:"sc-d9605f37-0"})(eP||(eP=cR())),cU=i4.default.div.withConfig({displayName:"UserFilterDrawer.styles__FilterSection",componentId:"sc-d9605f37-1"})(eO||(eO=cA())),cV=i4.default.div.withConfig({displayName:"UserFilterDrawer.styles__CheckboxContainer",componentId:"sc-d9605f37-2"})(eT||(eT=cM())),cH=i4.default.div.withConfig({displayName:"UserFilterDrawer.styles__ButtonContainer",componentId:"sc-d9605f37-3"})(ek||(ek=cF())),cW=i4.default.button.withConfig({displayName:"UserFilterDrawer.styles__ClearButton",componentId:"sc-d9605f37-4"})(eN||(eN=cz()),i3.colors.white,i3.colors.dark_gray_2,i3.colors.ink_light_gray,lQ.typography.type.motiva_medium,i3.colors.light_gray_1,i3.colors.ink_light_gray),cG=i4.default.button.withConfig({displayName:"UserFilterDrawer.styles__ApplyButton",componentId:"sc-d9605f37-5"})(eD||(eD=cL()),i8.extend.colors.brand["600"],i3.colors.white,lQ.typography.type.motiva_medium,i8.extend.colors.brand["700"],i8.extend.colors.brand["800"]);function cq(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function cK(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?cq(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cq(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function cJ(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var cX=[{value:"EasyPrint",label:"EasyPrint"}],c$=[{value:"PrintShop",label:"PrintShop"}],cZ=[{value:"Apex Industries",label:"Apex Industries"},{value:"Black Rifle Coffee",label:"Black Rifle Coffee"},{value:"Evergreen Co.",label:"Evergreen Co."},{value:"Innovate Corp",label:"Innovate Corp"},{value:"Innovate Marketing",label:"Innovate Marketing"},{value:"Innovate R&D",label:"Innovate R&D"},{value:"Nexus Digital",label:"Nexus Digital"},{value:"Quantum Analytics",label:"Quantum Analytics"},{value:"Quantum Solutions",label:"Quantum Solutions"},{value:"Starlight Media",label:"Starlight Media"}],cY=[{value:"Admin",label:"Admin"},{value:"Project Manager",label:"Project Manager"},{value:"Developer",label:"Developer"},{value:"Client",label:"Client"},{value:"Printer",label:"Printer"},{value:"View Only",label:"View Only"}];let cQ=e=>{var n=e.showDrawer,t=e.onDrawerClose,r=e.currentFilters,o=e.onApplyFilters,i=e.onClearFilters,a=(0,iq.useRef)(),l=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||function(e,n){if(e){if("string"==typeof e)return cJ(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?cJ(e,n):void 0}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)({organizations:(null==r?void 0:r.organizations)||[],printers:(null==r?void 0:r.printers)||[],clients:(null==r?void 0:r.clients)||[],roles:(null==r?void 0:r.roles)||[]}),2),s=l[0],c=l[1];(0,iq.useEffect)(()=>{n?a.current&&a.current.open():a.current&&a.current.close()},[n]);var u=e=>{c(n=>{var t=n.organizations.includes(e)?n.organizations.filter(n=>n!==e):[...n.organizations,e];return cK(cK({},n),{},{organizations:t})})},d=e=>{c(n=>{var t=n.printers.includes(e)?n.printers.filter(n=>n!==e):[...n.printers,e];return cK(cK({},n),{},{printers:t})})},p=e=>{c(n=>{var t=n.clients.includes(e)?n.clients.filter(n=>n!==e):[...n.clients,e];return cK(cK({},n),{},{clients:t})})},f=e=>{c(n=>{var t=n.roles.includes(e)?n.roles.filter(n=>n!==e):[...n.roles,e];return cK(cK({},n),{},{roles:t})})};return(0,iQ.jsxs)(i6.Drawer,{ref:a,centerTitle:!1,size:"sm",onClose:()=>{t&&t()},children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{children:[(0,iQ.jsx)("div",{}),(0,iQ.jsx)(cP,{children:"Filter Users"}),(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{children:(0,iQ.jsxs)(cB,{children:[(0,iQ.jsxs)(cU,{children:[(0,iQ.jsx)(cT,{children:"Organization"}),cX.map(e=>(0,iQ.jsxs)(cV,{children:[(0,iQ.jsx)(cN,{type:"checkbox",id:"org-".concat(e.value),checked:s.organizations.includes(e.value),onChange:()=>u(e.value)}),(0,iQ.jsx)(ck,{htmlFor:"org-".concat(e.value),children:e.label})]},e.value))]}),(0,iQ.jsxs)(cU,{children:[(0,iQ.jsx)(cT,{children:"Printers"}),c$.map(e=>(0,iQ.jsxs)(cV,{children:[(0,iQ.jsx)(cN,{type:"checkbox",id:"printer-".concat(e.value),checked:s.printers.includes(e.value),onChange:()=>d(e.value)}),(0,iQ.jsx)(ck,{htmlFor:"printer-".concat(e.value),children:e.label})]},e.value))]}),(0,iQ.jsxs)(cU,{children:[(0,iQ.jsx)(cT,{children:"Clients"}),cZ.map(e=>(0,iQ.jsxs)(cV,{children:[(0,iQ.jsx)(cN,{type:"checkbox",id:"client-".concat(e.value),checked:s.clients.includes(e.value),onChange:()=>p(e.value)}),(0,iQ.jsx)(ck,{htmlFor:"client-".concat(e.value),children:e.label})]},e.value))]}),(0,iQ.jsxs)(cU,{children:[(0,iQ.jsx)(cT,{children:"Role"}),cY.map(e=>(0,iQ.jsxs)(cV,{children:[(0,iQ.jsx)(cN,{type:"checkbox",id:"role-".concat(e.value),checked:s.roles.includes(e.value),onChange:()=>f(e.value)}),(0,iQ.jsx)(ck,{htmlFor:"role-".concat(e.value),children:e.label})]},e.value))]})]})}),(0,iQ.jsx)(i6.Drawer.Footer,{children:(0,iQ.jsxs)(cH,{children:[(0,iQ.jsx)(cW,{onClick:()=>{var e={organizations:[],printers:[],clients:[],roles:[]};c(e),i(e)},children:"Clear All"}),(0,iQ.jsx)(cG,{onClick:()=>{o(s)},children:"Apply Filters"})]})})]})]})};function c0(){var e=(0,i5._)(["\n font-family: ",";\n white-space : pre-wrap;\n font-weight: bold;\n"]);return c0=function(){return e},e}function c1(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n gap: 15px;
1\n align-items: center;\n justify-content: center;\n overflow-wrap: break-word;\n font-family: ",";\n ","\n"]);return c1=function(){return e},e}var c2=(e,n)=>"\n width: ".concat({md:648,sm:478,xs:288}[e],"px;\n ").concat(n?"":"min-height: ".concat({md:240,sm:208,xs:204}[e],"px;"),"\n "),c6=i4.default.pre.withConfig({displayName:"BrokerModal.styles__LoadingContainerText",componentId:"sc-1fdf8848-0"})(eR||(eR=c0()),lQ.typography.type.motiva),c5=i4.default.div.withConfig({displayName:"BrokerModal.styles__LoadingContainer",componentId:"sc-1fdf8848-1"})(eA||(eA=c1()),lQ.typography.type.motiva,e=>"lg"===e.size?"font-size: 16px;":"font-size: 14px;");function c4(){var e=(0,i5._)(["\n margin: 2px 36px 0 36px;\n @media screen and (max-width: ","px) {\n margin: -4px 12px 0 12px;\n }\n"]);return c4=function(){return e},e}function c3(){var e=(0,i5._)(["\n font-size: 26px;\n margin: 7px 0 16px;\n line-height: 36px;\n @media screen and (max-width: ","px) {\n font-size: 20px;\n line-height: 28px;\n }\n"]);return c3=function(){return e},e}function c8(){var e=(0,i5._)(["\n font-size: 16px;\n margin-bottom: 18px;\n line-height: 24px;\n @media screen and (max-width: ","px) {\n margin-bottom: 14px;\n }\n"]);return c8=function(){return e},e}function c9(){var e=(0,i5._)(["\n padding-top: 16px;\n"]);return c9=function(){return e},e}function c7(){var e=(0,i5._)(["\n float: right;\n @media screen and (min-width: 601px) {\n margin-top: 16px;\n }\n"]);return c7=function(){return e},e}function ue(){var e=(0,i5._)(["\n font-size: 18px;\n padding: 5px 0px 0px 0px;\n clear: both;\n font-family: ",";\n"]);return ue=function(){return e},e}function un(){var e=(0,i5._)(["\n height: 1px;\n width: 100%;\n background-color ",";\n"]);return un=function(){return e},e}function ut(){var e=(0,i5._)(["\n font-size: 16px;\n @media screen and (max-width: ","px) {\n font-size: 14px;\n }\n"]);return ut=function(){return e},e}function ur(){var e=(0,i5._)(["\n font-family: ",";\n"]);return ur=function(){return e},e}var uo=i4.default.div.withConfig({displayName:"BrokerModalContent.styles__ModalContainer",componentId:"sc-87285c87-0"})(eM||(eM=c4()),l0.BREAKPOINTS.xs),ui=i4.default.h2.withConfig({displayName:"BrokerModalContent.styles__Heading",componentId:"sc-87285c87-1"})(eF||(eF=c3()),l0.BREAKPOINTS.xs),ua=i4.default.div.withConfig({displayName:"BrokerModalContent.styles__ContentSpan",componentId:"sc-87285c87-2"})(ez||(ez=c8()),l0.BREAKPOINTS.xs);i4.default.div.withConfig({displayName:"BrokerModalContent.styles__CopyTextInput",componentId:"sc-87285c87-3"})(eL||(eL=c9()));var ul=i4.default.div.withConfig({displayName:"BrokerModalContent.styles__ModalContainerFooter",componentId:"sc-87285c87-4"})(eB||(eB=c7())),us=i4.default.div.withConfig({displayName:"BrokerModalContent.styles__NotificationContainer",componentId:"sc-87285c87-5"})(eU||(eU=ue()),lQ.typography.type.motiva),uc=i4.default.div.withConfig({displayName:"BrokerModalContent.styles__HorizontalDivider",componentId:"sc-87285c87-6"})(eV||(eV=un()),i3.colors.ink_light_gray),uu=i4.default.div.withConfig({displayName:"BrokerModalContent.styles__ModalPopupContent",componentId:"sc-87285c87-7"})(eH||(eH=ut()),l0.BREAKPOINTS.xxs),ud=i4.default.span.withConfig({displayName:"BrokerModalContent.styles__MotivaBold",componentId:"sc-87285c87-8"})(eW||(eW=ur()),lQ.typography.type.motiva_bold);let up=e=>{var n=e.title,t=e.content,r=e.backButtonText,o=e.backCallback,i=e.submitButtonText,a=e.submitCallback,l=e.hasNotification,s=e.notificationText,c=e.notificationCallBack,u=(0,i6.useBreakpoint)();return(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(uo,{children:[(0,iQ.jsx)(ui,{children:n}),(0,iQ.jsx)(ua,{children:t}),(0,iQ.jsxs)(ul,{children:[(0,iQ.jsx)(i6.Link,{onClick:o,color:"black",size:"xxs"===u?"sm":"md",customCSS:"xs"===u||"xxs"===u?{margin:"0px"}:{},children:r}),(0,iQ.jsx)(i6.Button,{variant:"primary",size:"xxs"===u||"xs"===u?"xs":"md",customCSS:"xs"===u||"xxs"===u?{padding:"4px 10px"}:{},onClickHandler:a,children:i})]})]}),l&&(0,iQ.jsxs)(us,{children:[(0,iQ.jsx)(uc,{}),(0,iQ.jsx)(i6.NotificationBubble,{variant:"warning",textColor:"dark_red",noBorder:!0,customCSS:"margin:5px 0px 5px 0px;padding:0px;",children:(0,iQ.jsx)(i6.Link,{onClick:c,color:"red",size:"xs"===u||"xxs"===u?"md":"lg",children:s})})]})]})};var uf=["content","onClose","backBtnText","submitBtnText","submitHandler","backHandler","title","hasNotification","notificationText","notificationCallBack","loader","message"];function um(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function uh(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?um(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):um(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}let ug=e=>{var n=e.isOpen,t=e.modalData||{},r=t.content,o=t.onClose,i=t.backBtnText,a=t.submitBtnText,l=t.submitHandler,s=t.backHandler,c=t.title,u=t.hasNotification,d=t.notificationText,p=t.notificationCallBack,f=t.loader,m=t.message,h=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(t,uf),g=(0,i6.useBreakpoint)();return n&&(0,iQ.jsx)(i6.Modal,uh(uh({showModal:!0,customCSS:c2("lg"===g||"md"===g||"sm"===g?"md":"xs"===g?"sm":"xs",f),onClose:o},h),{},{children:f?(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Modal.Header,{}),(0,iQ.jsx)(i6.Modal.Body,{children:(0,iQ.jsx)(c5,{size:"lg"===g||"md"===g||"sm"===g?"lg":"sm",children:(0,iQ.jsx)(c6,{children:m})})}),(0,iQ.jsx)(i6.Modal.Footer,{})]}):(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Modal.Header,{children:(0,iQ.jsx)("div",{})}),(0,iQ.jsx)(up,{title:c,content:r,backButtonText:i,submitButtonText:a,submitCallback:l,backCallback:s,hasNotification:u,notificationText:d,notificationCallBack:p})]})}))};var uy=t(8145),uv=t.n(uy);function ux(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return ub(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(ub(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ub(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,ub(u,"constructor",c),ub(c,"constructor",s),s.displayName="GeneratorFunction",ub(c,o,"GeneratorFunction"),ub(u),ub(u,o,"Generator"),ub(u,r,function(){return this}),ub(u,"toString",function(){return"[object Generator]"}),(ux=function(){return{w:i,m:d}})()}function ub(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(ub=function(e,n,t,r){function i(n,t){ub(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function uj(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function uw(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?uj(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):uj(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function uC(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}var u_="/tpv/session/api/easyPrintProxy/print-broker",uS=uv().create();function uI(e,n){return uS.post("".concat(u_,"/profile?type=").concat(e),n)}function uE(e){return uS.get("".concat(u_,"/project"),{params:{projectId:e}})}function uP(e,n){return uS.post("".concat(u_,"/project"),n,{params:{projectId:e},headers:{"X-HTTP-Method-Override":"PATCH"}})}function uO(e){return uS.post("".concat(u_,"/project"),e)}function uT(e,n){return uS.post("".concat(u_,"/job"),n,{params:{jobId:e},headers:{"X-HTTP-Method-Override":"PUT"}})}function uk(e){return uS.post("".concat(u_,"/template"),e)}function uN(e,n){return uS.post("".concat(u_,"/template"),n,{params:{templateId:e},headers:{"X-HTTP-Method-Override":"PUT"}})}function uD(){var e;return e=ux().m(function e(n){var t,r,o,i,a,l,s=n.file,c=n.fileName,u=n.seqId,d=n.projectId,p=n.jobId,f=n.type,m=n.templateId;return ux().w(function(e){for(;;)switch(e.n){case 0:t=Math.ceil(s.size/0x1400000),r=0;case 1:if(!(r<t)){e.n=3;break}return i=Math.min((o=0x1400000*r)+0x1400000,s.size),a=s.slice(o,i),(l=new FormData).append("file",a),l.append("seqId",u),l.append("projectId",d),l.append("jobId",p),l.append("type",f),l.append("templateId",m),l.append("fileName",c),l.append("chunkIndex",r),l.append("totalChunks",t),l.append("originalFileSize",s.size),e.n=2,uS.post("".concat(u_,"/uploadFile"),l,{withCredentials:!0});case 2:r++,e.n=1;break;case 3:return e.a(2)}},e)}),(uD=function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){uC(i,r,o,a,l,"next",e)}function l(e){uC(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}function uR(e,n,t,r,o,i,a){if(e.size<=0x1400000){var l=new FormData;return l.append("file",e),l.append("seqId",t),l.append("projectId",r),l.append("jobId",o),l.append("type",i),l.append("templateId",a),l.append("fileName",n),uS.post("".concat(u_,"/uploadFile"),l,{withCredentials:!0})}return function(e){return uD.apply(this,arguments)}({file:e,fileName:n,seqId:t,projectId:r,jobId:o,type:i,templateId:a})}function uA(e,n,t,r,o,i){return uS.post("".concat(u_,"/deleteFile"),{seqId:e,fileName:n,projectId:t,jobId:r,type:o,templateId:i},{headers:{"X-HTTP-Method-Override":"DELETE"}})}var uM=e=>e&&(null==e?void 0:e.length)!==0?Promise.all(e.map(e=>uT(e.jobId,e))):Promise.resolve([]),uF=(e,n)=>uS.post("".concat(u_,"/downloadFiles"),{sourceFilesIds:n},{responseType:"blob",params:{projectId:e},headers:{"X-HTTP-Method-Override":"GET"}}),uz=(e,n,t,r,o,i,a)=>uS.post("".concat(u_,"/downloadFile"),{seqId:e,fileName:n,projectId:t,disposition:a,jobId:r,type:o,templateId:i},{responseType:"blob"});function uL(e,n){return uS.post("".concat(u_,"/project/comment"),n,{params:{projectId:e},headers:{"X-HTTP-Method-Override":"PATCH"}})}var uB=e=>uS.post("".concat(u_,"/template"),{},{params:{templateId:e},headers:{"X-HTTP-Method-Override":"DELETE"}});function uU(e){return uS.post("".concat(u_,"/user"),e)}function uV(e,n,t){return uS.post("".concat(u_,"/user"),t,{params:{userId:e,brokerCode:n},headers:{"X-HTTP-Method-Override":"PATCH"}})}function uH(e,n,t){return uS.post("".concat(u_,"/profile"),t,{params:{id:e,type:n},headers:{"X-HTTP-Method-Override":"PUT"}})}function uW(e,n,t){return uS.post("".concat(u_,"/profile"),{},{params:{id:e,type:n,childProfileIds:t},headers:{"X-HTTP-Method-Override":"DELETE"}})}function uG(e){var n=uw(uw(uw({},(null==e?void 0:e.userType)&&{userType:String(e.userType).toUpperCase()}),(null==e?void 0:e.profileId)&&{profileId:e.profileId}),(null==e?void 0:e.fetchNotificationCountFl)===!0&&{fetchNotificationCountFl:!0});return uS.get("".concat(u_,"/notification"),{params:n})}function uq(e,n){return uS.post("".concat(u_,"/job"),n,{params:{jobId:e},headers:{"X-HTTP-Method-Override":"PATCH"}})}function uK(){return uS.get("".concat(u_,"/roles"))}function uJ(e){return uS.post("".concat(u_,"/user/mail"),e)}function uX(){var e=(0,i5._)(["\n background: ",";\n height: 1px;\n border: none;\n margin: 20px 0px 20px 0px;\n"]);return uX=function(){return e},e}function u$(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n line-height: 24px;\n font-weight: bold;\n margin: 0;\n"]);return u$=function(){return e},e}function uZ(){var e=(0,i5._)(["\n font-family: ",";\n"]);return uZ=function(){return e},e}function uY(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: flex-start;\n text-align: left;\n"]);return uY=function(){return e},e}function uQ(){var e=(0,i5._)(["\n font-size: 14px;\n font-weight: normal;\n margin-top: 4px;\n color: ",";\n text-align: left;\n"]);return uQ=function(){return e},e}function u0(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 16px;\n line-height: 20px;\n"]);return u0=function(){return e},e}function u1(){var e=(0,i5._)(["\n font-family: ",";\n color: ",";\n font-size: 16px;\n line-height: 20px;\n"]);return u1=function(){return e},e}i4.default.hr.withConfig({displayName:"ManageUserDrawer.styles__Divider",componentId:"sc-14d93bda-0"})(eG||(eG=uX()),i3.colors.light_gray_1),i4.default.h4.withConfig({displayName:"ManageUserDrawer.styles__SectionTitle",componentId:"sc-14d93bda-1"})(eq||(eq=u$()),lQ.typography.type.motiva);var u2=i4.default.span.withConfig({displayName:"ManageUserDrawer.styles__StatusText",componentId:"sc-14d93bda-2"})(eK||(eK=uZ()),lQ.typography.type.motiva),u6=i4.default.div.withConfig({displayName:"ManageUserDrawer.styles__HeaderContainer",componentId:"sc-14d93bda-3"})(eJ||(eJ=uY())),u5=i4.default.div.withConfig({displayName:"ManageUserDrawer.styles__HeaderSubtitle",componentId:"sc-14d93bda-4"})(eX||(eX=uQ()),i3.colors.dark_gray_1),u4=i4.default.div.withConfig({displayName:"ManageUserDrawer.styles__CheckboxHeading",componentId:"sc-14d93bda-5"})(e$||(e$=u0()),lQ.typography.type.motiva),u3=i4.default.div.withConfig({displayName:"ManageUserDrawer.styles__CheckboxText",componentId:"sc-14d93bda-6"})(eZ||(eZ=u1()),lQ.typography.type.motiva,i3.colors.medium_gray_1),u8=t(46556);function u9(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function u7(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?u9(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u9(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function de(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return dn(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?dn(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function dn(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var dt=e=>{var n=[e.id];if(e.children&&e.children.length>0){var t,r=de(e.children);try{for(r.s();!(t=r.n()).done;){var o=t.value;n=n.concat(dt(o))}}catch(e){r.e(e)}finally{r.f()}}return n},dr=e=>{if(!e||"string"!=typeof e)return"";var n=e.split("-");if(3!==n.length)return e;var t=parseInt(n[0],10),r=parseInt(n[1],10),o=parseInt(n[2],10);if(isNaN(t)||isNaN(r)||isNaN(o))return e;var i=new Date(Date.UTC(t,r-1,o));if(i.getUTCFullYear()!==t||i.getUTCMonth()!==r-1||i.getUTCDate()!==o)return e;var a=String(i.getUTCMonth()+1).padStart(2,"0"),l=String(i.getUTCDate()).padStart(2,"0"),s=String(i.getUTCFullYear()).slice(-2);return"".concat(a,"/").concat(l,"/").concat(s)},di=e=>{if(null==e||""===e)return null;var n=Number(e);return isNaN(n)?null:n},da=e=>{var n=di(e);return null!=n&&n>0},dl=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200;if(!(null!=e&&e.current)||null==t)return null;var o="number"==typeof t?t:di(t);return null==o||o<=0?null:setTimeout(()=>{if(e.current){var t=e.current;t.setFieldValue(n,o,!1),t.setFieldTouched(n,!0,!1),t.setFieldError(n,void 0)}},r)},ds=e=>{if(0===e)return"0 Bytes";var n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))," ").concat(["Bytes","KB","MB","GB","TB"][n])},dc=(e,n)=>{for(var t=new Date(e),r=0;r<n;)t.setDate(t.getDate()+1),0!==t.getDay()&&6!==t.getDay()&&r++;return t},du=(e,n)=>{var t=(e,r)=>{var o,i=de(e);try{for(i.s();!(o=i.n()).done;){var a=o.value,l=[...r,a];if(a.id===n)return l;if(a.children&&a.children.length>0){var s=t(a.children,l);if(s)return s}}}catch(e){i.e(e)}finally{i.f()}return null};return t(e,[])},dd=e=>{var n;return u7(u7({},null!==e.parentId&&{parentId:e.parentId}),{},{id:e.id,name:e.name,primaryUser:e.primaryUser,notes:e.notes,location:{address1:e.address1,address2:null!=(n=e.address2)?n:"",city:e.city,state:e.state,zipCode:e.zipCode},status:"ACTIVE"})},dp=()=>Math.floor(1e7+9e7*Math.random()),df=(e,n,t,r)=>{var o,i;return{user:{contact:{firstName:e.firstName,lastName:e.lastName,email:e.email,phone:null!=(o=null==e||null==(i=e.phone)?void 0:i.replace(/\D/g,""))?o:"",jobTitle:null==e?void 0:e.role},profilename:e.email,userType:t,username:e.email,defaultOrgEntity:n},brokerCode:r}},dm=(e,n)=>({active:e,contact:{firstName:n.firstName,lastName:n.lastName,phone:n.phone},username:n.username}),dh=(e,n)=>{var t,r,o;return{active:e,contact:{firstName:null==n||null==(t=n.contact)?void 0:t.firstName,lastName:null==n||null==(r=n.contact)?void 0:r.lastName,phone:null==n||null==(o=n.contact)?void 0:o.phone},username:n.username}},dg=e=>e===a_.SUP?aI.BROKER:e===a_.ASC?aI.CLIENT:e===a_.AMN?aI.PRINTER:e,dy=(e,n)=>e===aI.BROKER?{userType:a_.SUP,gusUserType:a_.SUP,defaultOrgEntity:null}:e===aI.PRINTER||e===aI.CLIENT?{userType:a_.ASC,gusUserType:a_.ASC,defaultOrgEntity:n||null}:null,dv=e=>String(e||"").toLowerCase(),dx=e=>dv(e)===aI.ADMIN,db=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=(Array.isArray(r)?r:[]).find(e=>String(null==e?void 0:e.id)===String(t));if(!o)return aP;if(dx(null==o?void 0:o.userType))return aE;var i=(null==o||null==(e=o.contact)?void 0:e.firstName)||"",a=(null==o||null==(n=o.contact)?void 0:n.lastName)||"",l="".concat(i," ").concat(a).trim();return(null==o?void 0:o.active)===!1||(null==o?void 0:o.isActive)===!1?"".concat(l," (Inactive)"):l},dj=e=>{if(!Array.isArray(e)||0===e.length)return[];var n={},t=[];
1return e.forEach(e=>{n[e.id]=u7(u7({},e),{},{children:[]})}),e.forEach(e=>{e.parentId&&n[e.parentId]?n[e.parentId].children.push(n[e.id]):t.push(n[e.id])}),t},dw=(e,n,t)=>e.map(e=>e.id==n?u7(u7({},t),e.projectCount&&{projectCount:e.projectCount}):e),dC=(e,n)=>e.map(e=>n.includes(e.id)?u7(u7({},e),{},{status:"INACTIVE"}):e),d_=e=>Array.isArray(e)?e:[],dS=(e,n)=>{var t,r=null,o=(e,t)=>{if(e.id===n){r=t;return}if(e.children){var i,a=de(e.children);try{for(a.s();!(i=a.n()).done;){var l=i.value;if(o(l,t),r)return}}catch(e){a.e(e)}finally{a.f()}}},i=de(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;if(o(a,a),r)break}}catch(e){i.e(e)}finally{i.f()}return r},dI=e=>null==e?void 0:e.replace(/[\\/:*?"<>|]/g,"_"),dE=(e,n)=>{var t,r,o,i="".concat(window.location.host);return{user:{contact:{firstName:null==e||null==(t=e.contact)?void 0:t.firstName,lastName:null==e||null==(r=e.contact)?void 0:r.lastName,email:null==e||null==(o=e.contact)?void 0:o.email},masterAccountNumber:null==e?void 0:e.masterAccountNumber},domainName:i,userId:null==e?void 0:e.username,brokerCode:n}},dP=u8.object().shape({firstName:u8.string().required(aZ.firstName).matches(aY.PLACEHOLDER_FIRSTNAME_REGEXP,"Invalid First name."),lastName:u8.string().required(aZ.lastName).matches(aY.PLACEHOLDER_LASTNAME_REGEXP,"Invalid Last name.")});function dO(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return dT(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(dT(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,dT(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,dT(u,"constructor",c),dT(c,"constructor",s),s.displayName="GeneratorFunction",dT(c,o,"GeneratorFunction"),dT(u),dT(u,o,"Generator"),dT(u,r,function(){return this}),dT(u,"toString",function(){return"[object Generator]"}),(dO=function(){return{w:i,m:d}})()}function dT(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(dT=function(e,n,t,r){function i(n,t){dT(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function dk(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function dN(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||dD(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}
1function dD(e,n){if(e){if("string"==typeof e)return dR(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?dR(e,n):void 0}}function dR(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var dA={username:"",firstName:"",lastName:"",email:"",phone:"",role:"",organizationId:""},dM=e=>{var n,t,r=e.showDrawer,o=e.onDrawerClose,i=e.action,a=e.clients,l=e.printers,s=e.selectedUser,c=e.onSubmit,u=e.onSwitchToEdit,d=e.handleWelcomeMail,p=(0,iq.useRef)(),f=(0,iq.useRef)(),m=dN((0,iq.useState)(dA),2),h=m[0],g=m[1],y=dN((0,iq.useState)(""),2),v=y[0],x=y[1],b=dN((0,iq.useState)(0),2),j=b[0],w=b[1],C=dN((0,iq.useState)(""),2),_=C[0],S=C[1],I=dN((0,iq.useState)(!1),2),E=I[0],P=I[1],O=(0,iq.useMemo)(()=>{if(!a||0===a.length)return[];var e=[],n=(t,r)=>{var o,i=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=dD(e))){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;e.push({value:a.id,text:(0,iQ.jsxs)(u2,{children:["— ".repeat(r),a.name]}),optionHTML:(0,iQ.jsxs)(u2,{children:["— ".repeat(r),a.name]})}),a.children&&a.children.length>0&&n(a.children,r+1)}}catch(e){i.e(e)}finally{i.f()}};return n(a,0),e},[a]),T=(null!=l?l:[]).map(e=>({value:e.id,text:e.name,optionHTML:e.name})),k=i===aN.VIEW&&(null==s?void 0:s.id),N=i===aN.EDIT&&(null==s?void 0:s.id);(0,iq.useEffect)(()=>{if(r){var e,n=setTimeout(()=>{var e;null==(e=p.current)||e.open()},0);if(P(!1),i===aN.CREATE)g(dA),x("");else if((i===aN.EDIT||i===aN.VIEW)&&s){var t,o,a,l,c,u=dg(s.userType||""),d=s.orgId||s.defaultOrgEntity||"",m=s.username||(null==(t=s.contact)?void 0:t.email)||"";g({username:m,firstName:(null==(o=s.contact)?void 0:o.firstName)||"",lastName:(null==(a=s.contact)?void 0:a.lastName)||"",email:(null==(l=s.contact)?void 0:l.email)||"",phone:(null==(c=s.contact)?void 0:c.phone)||"",role:u,organizationId:d?String(d):""}),S(m),x(u)}w(e=>e+1);var h=setTimeout(()=>{f.current&&(f.current.setTouched({},!1),f.current.setErrors({}),f.current.setSubmitting(!1))},250);return()=>{clearTimeout(n),clearTimeout(h)}}null==(e=p.current)||e.close(),g(dA),x(""),S(""),f.current&&f.current.resetForm()},[r,s,i]);var D=(0,iq.useCallback)(function(){var e,n=(e=dO().m(function e(n){return dO().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!c){e.n=5;break}return e.p=1,e.n=2,c(n,i);case 2:o(),e.n=4;break;case 3:e.p=3,console.error("Error submitting user form:",e.v);case 4:e.n=6;break;case 5:o();case 6:return e.a(2)}},e,null,[[1,3]])}),function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){dk(i,r,o,a,l,"next",e)}function l(e){dk(i,r,o,a,l,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}(),[c,i,o]),R=()=>{g(dA),o&&o()},A=v===aI.CLIENT||v===aI.PRINTER,M=(0,iq.useMemo)(()=>v===aI.CLIENT?O:v===aI.PRINTER?T:[],[v,O,T]);return(0,iQ.jsxs)(i6.Drawer,{ref:p,centerTitle:!1,size:"lg",onClose:R,children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{children:[k&&s?(0,iQ.jsxs)(u6,{children:[(0,iQ.jsx)("div",{children:"".concat((null==(n=s.contact)?void 0:n.firstName)||""," ").concat((null==(t=s.contact)?void 0:t.lastName)||"").trim()||"User Profile"}),_&&(0,iQ.jsx)(u5,{children:_})]}):N&&s?(0,iQ.jsxs)(u6,{children:[(0,iQ.jsx)("div",{children:"Edit User"}),_&&(0,iQ.jsx)(u5,{children:_})]}):"Add New User",(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{children:(0,iQ.jsxs)(i6.FormikWrapper,{initialValues:h,onSubmit:D,callbackFnToFormikRef:e=>{f.current=e},enableReinitialize:!1,validateOnMount:!1,validateOnBlur:!1,validateOnChange:!1,validationSchema:dP,children:[(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"firstName",component:i6.TextInput,label:"First Name",placeholder:"Enter first name",maxLength:15,isRequired:!0,ariaLabel:"first name",disabled:k})}),(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"lastName",component:i6.TextInput,label:"Last Name",placeholder:"Enter last name",maxLength:20,isRequired:!0,ariaLabel:"last name",disabled:k})})]}),(0,iQ.jsxs)(i6.Row,{children:[k||N?(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"username",component:i6.TextInput,label:"Username",placeholder:"Username",isRequired:!0,ariaLabel:"username",disabled:!0})}),(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"email",component:i6.TextInput,label:"Email Address",placeholder:"Enter email address",isRequired:!0,type:"email",ariaLabel:"email address",disabled:!0})})]}):(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"email",component:i6.TextInput,label:"Email Address",placeholder:"Enter email address",isRequired:!0,type:"email",ariaLabel:"email address"})}),(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"phone",component:i6.TextInput,label:"Phone",placeholder:"Enter phone",isRequired:!0,type:"phone",ariaLabel:"phone",disabled:k})})]}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,label:"Role",placeholder:"Select role",width:"100%",customCSS:"width: 100%; margin-top: 3px;",name:"role",isRequired:!0,options:aO,onChange:(e,n)=>{f.current&&(f.current.setFieldValue("role",n),f.current.setFieldValue("organizationId",""),x(n))},disabled:k||N})}),A&&(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,label:v===aI.CLIENT?"Organization / Client":"Printer",placeholder:v===aI.CLIENT?"Select a client...":"Select a printer...",width:"100%",customCSS:"width: 100%; margin-top: 3px;",name:"organizationId",isRequired:!0,options:M,disabled:k||N})})]}
1),k&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{spanLG:12,spanMD:12,spanSM:12,spanXS:12,children:(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.CheckBox,label:(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(u4,{children:"Resend activation email now"}),(0,iQ.jsx)(u3,{children:"The user will receive an email to set up their password and log in."})]}),width:"100%",customCSS:"width: 100%; margin-top: 3px;",onChange:(e,n)=>{P(n)},name:"sendActivationEmail"})})})})})]},"user-form-".concat(j,"-").concat(r,"-").concat(i))}),(0,iQ.jsx)(i6.Drawer.Footer,{children:k?(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:R,customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Close"}),E?(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"100%","border-radius":"5px"},onClick:()=>{d(s)},children:"Send mail"}):(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"100%","border-radius":"5px"},onClick:u,icon:"edit",children:"Edit User"})]}):(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:R,customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Cancel"}),(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"100%","border-radius":"5px"},onClick:()=>{f.current&&f.current.submitForm()},children:N?"Save User":"Add User"})]})})]})]})};function dF(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return dz(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(dz(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,dz(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,dz(u,"constructor",c),dz(c,"constructor",s),s.displayName="GeneratorFunction",dz(c,o,"GeneratorFunction"),dz(u),dz(u,o,"Generator"),dz(u,r,function(){return this}),dz(u,"toString",function(){return"[object Generator]"}),(dF=function(){return{w:i,m:d}})()}function dz(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(dz=function(e,n,t,r){function i(n,t){dz(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function dL(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function dB(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function dU(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?dB(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):dB(Object(t)).forEac
1h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function dV(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return dH(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?dH(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dH(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var dW=[{value:"A-Z",text:(0,iQ.jsx)("span",{children:"A-Z"}),optionHTML:(0,iQ.jsx)("span",{children:"A-Z"})},{value:"Z-A",text:(0,iQ.jsx)("span",{children:"Z-A"}),optionHTML:(0,iQ.jsx)("span",{children:"Z-A"})}];let dG=e=>{var n=e.userList,t=e.clientList,r=e.printerList,o=e.handleUpdateUsers,i=e.addUserHandler,a=e.editUserHandler,l=dV((0,iq.useState)(""),2),s=l[0],c=l[1],u=dV((0,iq.useState)("A-Z"),2),d=u[0],p=u[1],f=dV((0,iq.useState)(!1),2),m=f[0],h=f[1],g=dV((0,iq.useState)({organizations:[],printers:[],clients:[],roles:[]}),2),y=g[0],v=g[1],x=dV((0,iq.useState)(!1),2),b=x[0],j=x[1],w=dV((0,iq.useState)({}),2),C=w[0],_=w[1],S=dV((0,iq.useState)(!1),2),I=S[0],E=S[1],P=dV((0,iq.useState)({message:"",type:""}),2),O=P[0],T=P[1],k=dV((0,iq.useState)(!1),2),N=k[0],D=k[1],R=dV((0,iq.useState)(aN.CREATE),2),A=R[0],M=R[1],F=dV((0,iq.useState)(null),2),z=F[0],L=F[1],B=(0,iY.useSelector)(e=>a9(e)),U=(0,iY.useSelector)(e=>a7(e)),V=(0,iq.useMemo)(()=>new Set([...t,...r].map(e=>e.primaryUser)),[t,r]),H=(0,iq.useMemo)(()=>{var e=new Map;return t.forEach(n=>e.set(Number(n.id),n)),e},[t]),W=(0,iq.useMemo)(()=>{var e=new Map;return r.forEach(n=>e.set(Number(n.id),n)),e},[r]),G=(0,iq.useMemo)(()=>[...n.filter(e=>{if(e.userType===aI.ADMIN)return!1;if(e.orgId){var n=H.get(e.orgId),t=W.get(e.orgId);if(!n&&!t)return!1}return!0}).map(e=>{var n=H.get(e.orgId),t=W.get(e.orgId),r=(null==n?void 0:n.name)||(null==t?void 0:t.name)||"-",o=n?"Client":t?"Printer":"Broker",i=!1!==e.active;return{id:e.id,name:"".concat(e.contact.firstName," ").concat(e.contact.lastName),firstName:e.contact.firstName,lastName:e.contact.lastName,username:e.contact.email,phone:e.contact.phone||"",organization:r,status:i?"Active":"Inactive",role:o,isActive:i}})].sort((e,n)=>"A-Z"===d?e.name.localeCompare(n.name):n.name.localeCompare(e.name)).filter(e=>{if(y.organizations.length>0&&!y.organizations.includes(e.organization)||y.roles.length>0&&!y.roles.includes(e.role))return!1;if(s){var n=s.toLowerCase();if(!(e.name.toLowerCase().includes(n)||e.username.toLowerCase().includes(n)||e.organization.toLowerCase().includes(n)))return!1}return!0}),[n,H,W,d,y,s]),q=e=>{var n=H.get(Number(e.orgId||e.defaultOrgEntity)),t=W.get(Number(e.orgId||e.defaultOrgEntity));return dU(dU({},e),{},{orgId:e.orgId||e.defaultOrgEntity||null,userType:e.userType||(n?aI.CLIENT:t?aI.PRINTER:aI.BROKER)})},K=(e,t)=>{var r=n.find(n=>n.id===e.id);if(r){var o=q(r);M(t),L(o),D(!0)}},J=e=>{e.isActive&&K(e,aN.VIEW)},X=e=>{e.isActive&&K(e,aN.EDIT)},$=e=>{J(e)},Z=()=>{D(!1),L(null)},Y=function(){var e,n=(e=dF().m(function e(n,t){var r;return dF().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(t===aN.CREATE&&i)){e.n=5;break}return e.p=1,e.n=2,i(n);case 2:Z(),e.n=4;break;case 3:e.p=3,console.error("Error creating user:",e.v);case 4:e.n=9;break;case 5:if(!(t===aN.EDIT&&a&&z)){e.n=9;break}return e.p=6,r=z.userType||n.role,e.n=7,a(z.id,n,r);case 7:Z(),e.n=9;break;case 8:e.p=8,console.error("Error updating user:",e.v);case 9:return e.a(2)}},e,null,[[6,8],[1,3]])}),function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){dL(i,r,o,a,l,"next",e)}function l(e){dL(i,r,o,a,l,"throw",e)}a(void 0)})});return function(e,t){return n.apply(this,arguments)}}(),Q=e=>(0,iQ.jsx)(sX,{children:(0,iQ.jsxs)("p",{children:['Are you sure you want to deactivate "',(0,iQ.jsx)(sJ,{children:e.name}),'"? This action can be undone by reactivating the user later.']})}),ee=e=>{var n={title:"Confirm User Deactivation",content:Q(e),backBtnText:"Cancel",submitBtnText:"Deactivate",hasCloseButton:!0,onClose:()=>{j(!1),_({})},backHandler:()=>{j(!1),_({})},submitHandler:()=>en(e)};_(n),j(!0)},en=e=>{var n=dm(!1,e);return uV(e.id,U.code,n).then(()=>{j(!1),T({message:"".concat(e.name," has been deactivated successfully"),type:"success"}),E(!0),o&&o(dU(dU({},e),{},{active:!1}),aD.UPDATE)}).catch(e=>{console.error("ERROR",e),j(!1),T({message:"Failed to deactivate user. Please try again.",type:"failure"}),E(!0)}).finally(()=>{_({})})},et=e=>{var n=dm(!0,e);return uV(e.id,U.code,n).then(()=>{T({message:"".concat(e.name," has been activated successfully"),type:"success"}),E(!0),o&&o(dU(dU({},e),{},{active:!0}),aD.UPDATE)}).catch(e=>{console.error("ERROR",e),T({message:"Failed to activate user. Please try again.",type:"failure"}),E(!0)})};return(0,iQ.jsxs)(iQ.Fragment,{children:[I&&O&&(0,iQ.jsx)(i6.ToastBar,{onClose:()=>{E(!1),T(null)},variant:null==O?void 0:O.type,children:null==O?void 0:O.message}),(0,iQ.jsxs)(sA,{children:[(0,iQ.jsxs)(sM,{children:[(0,iQ.jsx)(sF,{children:"User Management"}),(0,iQ.jsx)(sz,{children:"Add, edit, activate, or deactivate user accounts."})]}),(0,iQ.jsx)(ai,{size:"sm",label:"Add User",icon:"plus",customCSS:{width:"auto",borderRadius:"5px",whiteSpace:"nowrap"},onClick:()=>{M(aN.CREATE),L(null),D(!0)}})]}),(0,iQ.jsx)(sL,{children:(0,iQ.jsxs)(sB,{children:[(0,iQ.jsxs)(sU,{children:[(0,iQ.jsx)(i6.Icon,{name:"search",size:20}),(0,iQ.jsx)(sV,{type:"text",placeholder:"Search by name, username, email, or company...",value:s,onChange:e=>c(e.target.value)})]}),(0,iQ.jsx)(i6.Dropdown,{tabIndex:"0",size:"sm",width:"100px",height:"38px",dropdownDirection:"down",options:dW,defaultValue:"A-Z",onChange:(e,n)=>{p(n.value)},ariaLabel:"Sort users"}),(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",onClick:()=>h(!0),customCSS:{margin:"0px",borderRadius:"6px",padding:"10px",border:"1px solid rgb(229, 231, 235)",flexShrink:0},children:(0,iQ.jsx)(i6.Icon,{name:"filters",color:"black"})})]})}),G.length>0?(0,iQ.jsxs)(lW,{children:[(0,iQ.jsx)(lG,{children:(0,iQ.jsxs)("tr",{children:[(0,iQ.jsx)(lq,{children:"NAME"}),(0,iQ.jsx)(lq,{children:"ORGANIZATION"}),(0,iQ.jsx)(lq,{children:"USER ROLE"}),(0,iQ.jsx)(lq,{})]})}),(0,iQ.jsx)("tbody",{children:G.map(e=>{var n=cj(e.role),t=e.id!==B.id&&!V.has(String(e.id));return(0,iQ.jsxs)(lJ,{children:[(0,iQ.jsxs)(sH,{children:[(0,iQ.jsxs)("div",{style:{fontWeight:600,color:e.isActive?i8.extend.colors.brand["600"]:i3.colors.dark_gray_1,cursor:e.isActive?"pointer":"not-allowed",opacity:e.isActive?1:.6},onClick:()=>e.isActive&&$(e),children:[e.name,!e.isActive&&(0,iQ.jsx)("span",{style:{fontWeight:400,color:i3.colors.dark_gray_1},children:" (Inactive)"})]}),(0,iQ.jsx)("div",{style:{fontSize:"13px",color:i3.colors.dark_gray_1,marginTop:"2px"},children:e.username})]}
1),(0,iQ.jsx)(lK,{children:e.organization}),(0,iQ.jsx)(lK,{children:(0,iQ.jsx)(sW,{$textColor:n.text,$backgroundColor:n.background,children:e.role})}),(0,iQ.jsx)(lK,{children:(0,iQ.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,iQ.jsx)(i6.Popover,{minWidth:212,showCaret:!1,id:e.id,"aria-label":"more",position:"right",triggerElement:(0,iQ.jsx)(i6.Button,{customCSS:"padding:0px; margin:0px;",size:"xs",tabIndex:0,iconOnly:!0,variant:"text",children:(0,iQ.jsx)(i6.Icon,{name:"more-top",color:"black"})}),children:(0,iQ.jsxs)(sG,{children:[e.isActive&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"View profile ".concat(e.name),onClick:()=>J(e),children:(0,iQ.jsxs)(sq,{children:[(0,iQ.jsx)(i6.Icon,{name:"view-on",size:16}),(0,iQ.jsx)(sK,{children:"View Profile"})]})}),(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Edit user ".concat(e.name),onClick:()=>X(e),children:(0,iQ.jsxs)(sq,{children:[(0,iQ.jsx)(i6.Icon,{name:"edit",size:16}),(0,iQ.jsx)(sK,{children:"Edit User"})]})})]}),t&&e.isActive&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Deactivate user ".concat(e.name),onClick:()=>ee(e),children:(0,iQ.jsxs)(sq,{children:[(0,iQ.jsx)(i6.Icon,{name:"delete",size:16}),(0,iQ.jsx)(sK,{children:"Deactivate User"})]})}),t&&!e.isActive&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Activate user ".concat(e.name),onClick:()=>et(e),children:(0,iQ.jsxs)(sq,{children:[(0,iQ.jsx)(i6.Icon,{name:"account",size:16}),(0,iQ.jsx)(sK,{children:"Activate User"})]})})]})})})})]},e.id)})})]}):(0,iQ.jsxs)(cu,{children:[(0,iQ.jsx)(cc,{children:"No users found"}),(0,iQ.jsx)(cc,{children:s?'Your search for "'.concat(s,'" did not match any users.'):'Click "Add User" to get started.'})]}),(0,iQ.jsx)(cQ,{showDrawer:m,onDrawerClose:()=>h(!1),currentFilters:y,onApplyFilters:e=>{v(e),h(!1)},onClearFilters:e=>{v(e)}}),(0,iQ.jsx)(ug,{isOpen:b,modalData:C}),(0,iQ.jsx)(dM,{showDrawer:N,onDrawerClose:Z,action:A,clients:t,printers:r,selectedUser:z,onSubmit:Y,onSwitchToEdit:()=>{z&&M(aN.EDIT)},handleWelcomeMail:e=>{var n=dE(e,U.code);return D(!1),uJ(n).then(()=>{T({message:"Activation email send successfully",type:"success"}),E(!0)}).catch(e=>{console.error("ERROR",e),T({message:"Error has occurred",type:"failure"}),E(!0)})}})]})};function dq(){var e=(0,i5._)(["\n display: flex;\n gap: 16px;\n height: 100%;\n overflow: hidden;\n margin-top: 16px;\n \n @media screen and (max-width: ","px) {\n flex-direction: column;\n overflow-y: auto;\n }\n"]);return dq=function(){return e},e}function dK(){var e=(0,i5._)(["\n width: 280px;\n flex-shrink: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n \n @media screen and (max-width: ","px) {\n width: 100%;\n height: auto;\n }\n"]);return dK=function(){return e},e}function dJ(){var e=(0,i5._)(["\n padding: 4px;\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n"]);return dJ=function(){return e},e}function dX(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n font-weight: 600;\n margin: 0 0 16px 0;\n"]);return dX=function(){return e},e}function d$(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n margin-top: 4px;\n"]);return d$=function(){return e},e}function dZ(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 18px;\n cursor: pointer;\n font-size: 14px;\n font-family: ",";\n border-radius: 4px;\n color: ",";\n background: ",";\n transition: all 0.2s ease;\n \n &:hover {\n background: ",";\n }\n"]);return dZ=function(){return e},e}function dY(){var e=(0,i5._)(["\n flex: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n height: 100%;\n"]);return dY=function(){return e},e}function dQ(){var e=(0,i5._)(["\n padding: 8px;\n overflow-y: auto;\n height: 100%;\n flex: 1;\n"]);return dQ=function(){return e},e}var d0=i4.default.div.withConfig({displayName:"SettingsPage.styles__SettingsContainer",componentId:"sc-82e1bc47-0"}
1)(eY||(eY=dq()),l0.BREAKPOINTS.sm),d1=i4.default.div.withConfig({displayName:"SettingsPage.styles__SidebarCard",componentId:"sc-82e1bc47-1"})(eQ||(eQ=dK()),l0.BREAKPOINTS.sm),d2=i4.default.div.withConfig({displayName:"SettingsPage.styles__SettingsSidebar",componentId:"sc-82e1bc47-2"})(e0||(e0=dJ())),d6=i4.default.h2.withConfig({displayName:"SettingsPage.styles__SidebarTitle",componentId:"sc-82e1bc47-3"})(e1||(e1=dX()),lQ.typography.type.motiva_bold),d5=i4.default.nav.withConfig({displayName:"SettingsPage.styles__SidebarNav",componentId:"sc-82e1bc47-4"})(e2||(e2=d$())),d4=i4.default.div.withConfig({displayName:"SettingsPage.styles__NavItem",componentId:"sc-82e1bc47-5"})(e6||(e6=dZ()),lQ.typography.type.motiva,e=>e.$isActive?i8.extend.colors.brand["600"]:i3.colors.dark_gray_1,e=>e.$isActive?i8.extend.colors.brand["50"]:"transparent",e=>e.$isActive?i8.extend.colors.brand["50"]:i3.colors.light_gray_1),d3=i4.default.div.withConfig({displayName:"SettingsPage.styles__ContentCard",componentId:"sc-82e1bc47-6"})(e5||(e5=dY())),d8=i4.default.div.withConfig({displayName:"SettingsPage.styles__SettingsContent",componentId:"sc-82e1bc47-7"})(e4||(e4=dQ()));function d9(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let d7=e=>{var n=e.users,t=e.clients,r=e.printers,o=e.handleUpdateUsers,i=e.addUserHandler,a=e.editUserHandler,l=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||function(e,n){if(e){if("string"==typeof e)return d9(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d9(e,n):void 0}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)("users"),2),s=l[0],c=l[1];return(0,iQ.jsxs)(lV,{children:[(0,iQ.jsx)(lH,{children:(0,iQ.jsx)(lE,{items:[{label:"Dashboard",link:"./easyprint?action=dashboard"},{label:"Settings"}]})}),(0,iQ.jsxs)(d0,{children:[(0,iQ.jsx)(d1,{children:(0,iQ.jsx)(i6.Card,{customCSS:"height: 100%; display: flex; flex-direction: column;",isClickable:!1,isHover:!1,children:(0,iQ.jsxs)(d2,{children:[(0,iQ.jsx)(d6,{children:"Settings"}),(0,iQ.jsx)(d5,{children:(0,iQ.jsxs)(d4,{$isActive:"users"===s,onClick:()=>c("users"),children:[(0,iQ.jsx)(i6.Icon,{name:"account",size:20}),"Users"]})})]})})}),(0,iQ.jsx)(d3,{children:(0,iQ.jsx)(i6.Card,{customCSS:"height: 100%;",isClickable:!1,isHover:!1,children:(0,iQ.jsx)(d8,{children:(0,iQ.jsx)(dG,{userList:n,clientList:t,printerList:r,handleUpdateUsers:o,addUserHandler:i,editUserHandler:a})})})})]})]})};var pe=[{name:"Indigo",color:{50:"216 43% 96%",100:"218 67% 94%",200:"217 34% 75%",500:"212 80% 30%",600:"213 81% 24%",700:"215 81% 19%"}},{name:"Slate",color:{50:"220 14% 96%",100:"220 13% 91%",200:"215 20% 65%",500:"215 28% 44%",600:"215 25% 34%",700:"217 33% 27%"}},{name:"Crimson",color:{50:"343 100% 97%",100:"341 100% 95%",200:"340 100% 86%",500:"344 84% 41%",600:"341 78% 36%",700:"341 84% 28%"}},{name:"Forest",color:{50:"142 76% 97%",100:"143 85% 94%",200:"145 63% 79%",500:"145 69% 30%",600:"146 72% 25%",700:"147 80% 20%"}},{name:"Violet",color:{50:"265 92% 97%",100:"265 100% 95%",200:"264 91% 83%",500:"262 70% 50%",600:"263 70% 42%",700:"264 79% 34%"}},{name:"Teal",color:{50:"174 80% 97%",100:"173 85% 94%",200:"174 65% 80%",500:"173, 80%, 35%",600:"173 75% 29%",700:"174 84% 23%"}},{name:"Stone",color:{50:"35 14% 96%",100:"35 13% 91%",200:"35 10% 65%",500:"35 9% 43%",600:"35 10% 33%",700:"35 15% 26%"}},{name:"Zinc",color:{50:"240 10% 97%",100:"240 8% 95%",200:"240 6% 84%",500:"240, 5%, 44%",600:"240 5% 34%",700:"240 6% 26%"}},{name:"Amber",color:{50:"32 100% 97%",100:"30 100% 95%",200:"29 97% 82%",500:"25 95% 47%",600:"21 94% 40%",700:"18 96% 34%"}},{name:"Sky",color:{50:"204 100% 97%",100:"204 100% 94%",200:"203 94% 83%",500:"203, 98%, 39%",600:"202 91% 33%",700:"202 81% 29%"}}];function pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function pt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?pn(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function pr(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||po(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function po(e,n){if(e){if("string"==typeof e)return pi(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?pi(e,n):void 0}}function pi(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let pa=e=>{var n=e.size,t=e.clientList,r=e.addClientClickHandler,o=e.handleEditClient,i=e.handleViewClient,a=e.handleChildClient,l=e.openDeleteClientModal,s=pr((0,iq.useState)(""),2),c=s[0],u=s[1],d=pr((0,iq.useState)(new Set),2),p=d[0],f=d[1],m=(0,iq.useMemo)(()=>{if(!c.trim())return t;var e=c.toLowerCase(),n=t=>t.reduce((t,r)=>{var o,i="".concat(null==r||null==(o=r.primaryContact)?void 0:o.firstName," ").concat(r.primaryContact.lastName),a=r.name.toLowerCase().includes(e)||i.toLowerCase().includes(e),l=r.children?n(r.children):[];return(a||l.length>0)&&t.push(pt(pt({},r),{},{children:l})),t},[]);return n(t)},[t,c]);(0,iq.useEffect)(()=>{if(c.trim()){var e=n=>{var t,r=[],o=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=po(e))){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i.children&&i.children.length>0&&(r.push(i.id),r=r.concat(e(i.children)))}}catch(e){o.e(e)}finally{o.f()}return r};f(new Set(e(m)))}else f(new Set)},[c,m]);var h=e=>{f(n=>{var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},g=e=>{var n,t,r,s=e.client,c=e.level,u=e.isExpanded,d=e.onToggle,p=s.children&&s.children.length>0;return(0,iQ.jsx)(cl,{children:(0,iQ.jsxs)(co,{children:[(0,iQ.jsxs)(ci,{level:c,children:[(0,iQ.jsx)(i6.Button,{iconOnly:!0,label:u?"Collapse":"Expand",size:"xs",onClick:()=>p&&d(s.id),customCSS:cx(p),children:(0,iQ.jsx)(ch,{children:(0,iQ.jsx)(i6.Icon,{name:u?"caret_down":"caret_right",size:24})})}),(0,iQ.jsxs)(ca,{children:[(0,iQ.jsx)(cd,{onClick:()=>i(s),children:s.name}),(0,iQ.jsxs)(cp,{children:[null==s||null==(n=s.primaryContact)?void 0:n.firstName," ",null==s||null==(t=s.primaryContact)?void 0:t.lastName," - ",null==s||null==(r=s.primaryContact)?void 0:r.email]})]})]}),(0,iQ.jsx)(i6.Popover,{minWidth:212,showCaret:!1,id:s.id,"aria-label":"more",position:"left",triggerElement:(0,iQ.jsx)(i6.Button,{customCSS:"padding:0px; margin:0px;",size:"xs",tabIndex:0,iconOnly:!0,variant:"text",children:(0,iQ.jsx)(i6.Icon,{name:"more-top",color:"black"})}),children:(0,iQ.jsxs)(cg,{children:[(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Edit Client ".concat(null==s?void 0:s.name),"aria-disabled":"false",onClick:()=>o(s),children:(0,iQ.jsxs)(cy,{children:[(0,iQ.jsx)(i6.Icon,{name:"edit",size:16}),(0,iQ.jsx)(cv,{children:"Edit Client"})]})}),c<2&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Add Child Company for ".concat(null==s?void 0:s.name),"aria-disabled":"false",onClick:()=>a(s),children:(0,iQ.jsxs)(cy,{children:[(0,iQ.jsx)(i6.Icon,{name:"plus",size:16}),(0,iQ.jsx)(cv,{children:"Add Child Company"})]})}),(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto; ","aria-label":"Delete Client ".concat(null==s?void 0:s.name),"aria-disabled":"false",onClick:()=>l(s),children:(0,iQ.jsxs)(cy,{children:[(0,iQ.jsx)(i6.Icon,{name:"delete",size:16}),(0,iQ.jsx)(cv,{children:"Delete Client"})]})})]})})]})})},y=(e,n)=>e.map(e=>(0,iQ.jsxs)(iq.Fragment,{children:[(0,iQ.jsx)(g,{client:e,level:n,isExpanded:p.has(e.id),onToggle:h}),e.children&&p.has(e.id)&&y(e.children,n+1)]},e.id));return(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsxs)(i6.Container,{customCSS:"max-width: none;overflow-y: auto;",children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(lH,{children:(0,iQ.jsx)(lE,{items:[{label:"Dashboard",link:"./easyprint?action=dashboard"},{label:"Clients"}]})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:0},children:(0,iQ.jsxs)(i6.Card,{customCSS:{padding:0},isClickable:!1,isHover:!1,children:[(0,iQ.jsxs)(i6.Row,{customCSS:"lg"===n?{padding:"20px"}:{padding:"14px"},children:[(0,iQ.jsx)(i6.Column,{span:6,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(cf,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"shared-user",size:24}),(0,iQ.jsx)(cm,{children:"Clients"})]})}),(0,iQ.jsx)(i6.Column,{span:6,customCSS:{textAlign:"end",marginLeft:"6px"},children:(0,iQ.jsx)(ai,{size:"sm",label:"Add Client",onClick:r,icon:"plus",customCSS:{width:"auto",borderRadius:"5px"}})}),(0,iQ.jsx)(i6.Column,{span:"lg"===n?6:12,customCSS:{margin:0},children:(0,iQ.jsx)(i6.SubSearch,{size:"sm",customCSS:{marginTop:"15p
1x"},placeHolder:"Search by company or contact...",textValue:c,onSearch:e=>{var n;return u(null!=(n=e.target.value)?n:"")},onSelect:e=>{var n;return u(null!=(n=e.target.value)?n:"")},handleChange:e=>{var n;return u(null!=(n=e.target.value)?n:"")},onClearInput:e=>u("")})}),(0,iQ.jsx)(i6.Column,{span:6*("lg"===n),customCSS:{margin:0}})]}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:0},children:m.length>0?(0,iQ.jsx)(cs,{children:y(m,0)}):(0,iQ.jsxs)(cu,{children:[(0,iQ.jsx)(cc,{children:"No clients found"}),(0,iQ.jsx)(cc,{children:c?'Your search for "'.concat(c,'" did not match any clients.'):'Click "Add Client" to get started.'})]})})})]})})})]})})};function pl(){var e=(0,i5._)(["\n display:flex;\n align-items:center;\n gap:12px;\n padding: 0px 5px;\n"]);return pl=function(){return e},e}function ps(){var e=(0,i5._)(["\n margin:0;\n font-size: 18px;\n line-height: 28px;\n font-family: ",";\n @media screen and (max-width: ","px) {\n font-size: 18px;\n line-height: 20px;\n }\n"]);return ps=function(){return e},e}function pc(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n"]);return pc=function(){return e},e}function pu(){var e=(0,i5._)(["\n position: relative;\n display: inline-block;\n"]);return pu=function(){return e},e}function pd(){var e=(0,i5._)(["\n position: absolute;\n top: -6px;\n right: -6px;\n background-color: ",";\n color: white;\n border-radius: 50%;\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n font-weight: 500;\n font-family: ",";\n pointer-events: none;\n z-index: 1;\n"]);return pd=function(){return e},e}function pp(){var e=(0,i5._)(["\n margin-right: -12px;\n padding-right: 12px;\n overflow-y: auto;\n ","\n & > * + * {\n margin-top: 8px;\n }\n"]);return pp=function(){return e},e}function pf(){var e=(0,i5._)(["\n padding: 10px;\n border-radius: 6px;\n transition: all 150ms;\n border-width: 1px;\n cursor: pointer;\n border-color: transparent;\n &:hover {\n background-color: #f3f4f6;\n border-color: #e5e7eb;\n }\n &::before {\n content: none;\n }\n ","\n"]);return pf=function(){return e},e}function pm(){var e=(0,i5._)(["\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n"]);return pm=function(){return e},e}function ph(){var e=(0,i5._)(["\n flex-grow: 1;\n min-width: 0;\n"]);return ph=function(){return e},e}function pg(){var e=(0,i5._)(["\n margin:0;\n font-size: 14px;\n font-weight: 700;\n font-family: ",";\n color: ",";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return pg=function(){return e},e}function py(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 4px;\n"]);return py=function(){return e},e}function pv(){var e=(0,i5._)(["\n margin:0;\n font-size: 12px;\n font-weight: 500;\n font-family: ",";\n color: ",";\n"]);return pv=function(){return e},e}function px(){var e=(0,i5._)(["\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px solid rgba(229, 231, 235, 0.8);\n"]);return px=function(){return e},e}function pb(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n font-size: 12px;\n line-height: 0px;\n flex-wrap: wrap;\n font-family: ",";\n color: ",";\n & > * + * {\n margin-left: 8px;\n }\n"]);return pb=function(){return e},e}function pj(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n"]);return pj=function(){return e},e}function pw(){var e=(0,i5._)(["\n gap: 6px;\n display: flex;\n flex-direction: column;\n"]);return pw=function(){return e},e}function pC(){var e=(0,i5._)(["\n gap: 8px;\n display: flex;\n align-items: center;\n"]);return pC=function(){return e},e}function p_(){var e=(0,i5._)(["\n font-size: 12px;\n line-height: 20px;\n font-family: ",";\n"]);return p_=function(){return e},e}function pS(){var e=(0,i5._)(["\n font-size: 14px;\n line-height: 20px;\n font-family: ",";\n text-align: center;\n display:flex;\n flex-direction: column;\n gap: 12px;\n"]);return pS=function(){return e},e}function pI(){var e=(0,i5._)(["\n padding: 1.5rem;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;
1\n color: #6b7280;\n"]);return pI=function(){return e},e}function pE(){var e=(0,i5._)(["\n margin-top: 0.5rem; /* Tailwind mt-2 */\n"]);return pE=function(){return e},e}var pP=i4.default.div.withConfig({displayName:"ProjectList.styles__SubTitleContainer",componentId:"sc-35b1f6bd-0"})(e3||(e3=pl())),pO=i4.default.h3.withConfig({displayName:"ProjectList.styles__SubTitle",componentId:"sc-35b1f6bd-1"})(e8||(e8=ps()),lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm),pT=i4.default.div.withConfig({displayName:"ProjectList.styles__FilterContainer",componentId:"sc-35b1f6bd-2"})(e9||(e9=pc())),pk=i4.default.div.withConfig({displayName:"ProjectList.styles__FilterButtonContainer",componentId:"sc-35b1f6bd-3"})(e7||(e7=pu())),pN=i4.default.div.withConfig({displayName:"ProjectList.styles__FilterCountBadge",componentId:"sc-35b1f6bd-4"})(ne||(ne=pd()),i8.extend.colors.brand["700"],lQ.typography.type.motiva_bold),pD=i4.default.ul.withConfig({displayName:"ProjectList.styles__UL",componentId:"sc-35b1f6bd-5"})(nn||(nn=pp()),e=>e.viewportOffset?"max-height: calc(50vh - ".concat(e.viewportOffset,"px);"):"max-height: calc(100vh - 250px);"),pR=i4.default.li.withConfig({displayName:"ProjectList.styles__LI",componentId:"sc-35b1f6bd-6"})(nt||(nt=pf()),e=>e.isSelected?"border: 1px solid ".concat(i8.extend.colors.brand["700"],";box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);"):""),pA=i4.default.div.withConfig({displayName:"ProjectList.styles__ProjectDetailsContainer",componentId:"sc-35b1f6bd-7"})(nr||(nr=pm())),pM=i4.default.div.withConfig({displayName:"ProjectList.styles__LeftContainer",componentId:"sc-35b1f6bd-8"})(no||(no=ph())),pF=i4.default.p.withConfig({displayName:"ProjectList.styles__ProjectTitle",componentId:"sc-35b1f6bd-9"})(ni||(ni=pg()),lQ.typography.type.motiva_bold,i3.colors.dark_gray_1),pz=i4.default.div.withConfig({displayName:"ProjectList.styles__ClientNameContainer",componentId:"sc-35b1f6bd-10"})(na||(na=py())),pL=i4.default.p.withConfig({displayName:"ProjectList.styles__ClientName",componentId:"sc-35b1f6bd-11"})(nl||(nl=pv()),lQ.typography.type.motiva,i8.extend.colors.brand["700"]),pB=i4.default.div.withConfig({displayName:"ProjectList.styles__BottomContainer",componentId:"sc-35b1f6bd-12"})(ns||(ns=px())),pU=i4.default.div.withConfig({displayName:"ProjectList.styles__ProjectMetaContainer",componentId:"sc-35b1f6bd-13"})(nc||(nc=pb()),lQ.typography.type.motiva,i3.colors.dark_gray_2),pV=i4.default.div.withConfig({displayName:"ProjectList.styles__RightContainer",componentId:"sc-35b1f6bd-14"})(nu||(nu=pj())),pH=i4.default.div.withConfig({displayName:"ProjectList.styles__PopoverContainer",componentId:"sc-35b1f6bd-15"})(nd||(nd=pw())),pW=i4.default.div.withConfig({displayName:"ProjectList.styles__PopoverActionItem",componentId:"sc-35b1f6bd-16"})(np||(np=pC())),pG=i4.default.div.withConfig({displayName:"ProjectList.styles__PopoverActionItemText",componentId:"sc-35b1f6bd-17"})(nf||(nf=p_()),lQ.typography.type.motiva),pq=i4.default.div.withConfig({displayName:"ProjectList.styles__EmptyStateContainer",componentId:"sc-35b1f6bd-18"})(nm||(nm=pS()),lQ.typography.type.motiva);i4.default.div.withConfig({displayName:"ProjectList.styles__EmptyContainer",componentId:"sc-35b1f6bd-19"})(nh||(nh=pI())),i4.default.p.withConfig({displayName:"ProjectList.styles__Paragraph",componentId:"sc-35b1f6bd-20"})(ng||(ng=pE()));var pK=t(99941);function pJ(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function pX(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function p$(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pX(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pX(Object(t)).forEac
1h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var pZ=e=>{var n=e.showDrawer,t=e.onDrawerClose,r=e.selectedClient,o=e.clients,i=e.currentFilters,a=e.onApplyFilters,l=e.handleCurrentFilters,s=e.handleClearFilters,c=e.isDashboardView,u=e.size,d=(0,iq.useRef)();(0,iq.useEffect)(()=>{n?d.current&&d.current.open():d.current&&d.current.close()},[n,r]);var p=(0,iq.useMemo)(()=>{var e=[];e.push({value:"All Clients",text:(0,iQ.jsx)(cD,{children:"All Clients"}),optionHTML:(0,iQ.jsx)(cD,{children:"All Clients"})});var n=(t,r)=>{var o,i=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return pJ(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?pJ(e,n):void 0}}(e))){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;e.push({value:a.id,text:(0,iQ.jsxs)(cD,{children:["— ".repeat(r),a.name]}),optionHTML:(0,iQ.jsxs)(cD,{children:["— ".repeat(r),a.name]})}),a.children&&n(a.children,r+1)}}catch(e){i.e(e)}finally{i.f()}};return n(null!=o?o:[],0),e},[o]),f=e=>{l(n=>p$(p$({},n),{},{clientId:e||void 0}))},m=e=>{l(n=>p$(p$({},n),{},{sortOption:e||void 0}))},h=e=>{l(n=>{var t,r=null!=n&&null!=(t=n.statuses)&&t.includes(e)?n.statuses.filter(n=>n!==e):[...n.statuses,e];return p$(p$({},n),{},{statuses:r})})};return(0,iQ.jsxs)(i6.Drawer,{ref:d,centerTitle:!1,size:"sm",onClose:()=>{t&&t()},children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{children:[(0,iQ.jsx)("div",{}),(0,iQ.jsx)(cO,{children:(0,iQ.jsx)(cP,{children:"Filter Projects"})}),(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{children:(0,iQ.jsxs)(i6.Row,{children:[c?(0,iQ.jsx)(iQ.Fragment,{}):(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(cT,{children:"Client"})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(i6.Dropdown,{tabIndex:"0",width:"250px",height:"38px",dropdownDirection:"down",options:p,defaultValue:i.clientId||"All Clients",onChange:(e,n)=>f(n.value),ariaLabel:"Sort projects by client"})})]}),"lg"===u?(0,iQ.jsx)(iQ.Fragment,{}):(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(cT,{children:"Sort by"})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(i6.Dropdown,{tabIndex:"0",width:"250px",height:"38px",dropdownDirection:"down",options:aL,defaultValue:i.sortOption||"All Clients",onChange:(e,n)=>m(n.value),ariaLabel:"Sort projects by"})})]}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(cT,{children:"Status"})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:Object.values(aw).map(e=>{var n;return(0,iQ.jsxs)(ck,{children:[(0,iQ.jsx)(cN,{type:"checkbox",checked:null==i||null==(n=i.statuses)?void 0:n.includes(e),onChange:()=>h(e)}),(0,iQ.jsx)(cD,{children:e})]},e)})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(cT,{children:"Due Date"})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(ck,{children:[(0,iQ.jsx)(cN,{type:"checkbox",checked:null==i?void 0:i.overdue,onChange:e=>{l(n=>{var t;return p$(p$({},n),{},{overdue:null==e||null==(t=e.target)?void 0:t.checked})})}}),(0,iQ.jsx)(cD,{children:"Show Overdue Only"})]})})]})}),(0,iQ.jsxs)(i6.Drawer.Footer,{children:[(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:()=>{var e=p$({statuses:[],overdue:!1,clientId:void 0},"lg"===u?{sortOption:i.sortOption}:{sortOption:"Newest"});l(e),s(e)},customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Clear All"}),(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"100%","border-radius":"5px"},onClick:()=>{a(i)},children:"Apply Filters"})]})]})]})};function pY(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function pQ(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?pY(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pY(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function p0(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return p1(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?p1(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p1(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let p2=e=>{var n=e.size,t=e.projects,r=e.clients,o=e.clientNameLookup,i=e.client,a=void 0===i?null:i,l=e.onViewProjectPage,s=e.handleProjectDrawer,c=e.selectedProjectId,u=e.onSelectProject,d=e.openProjectDetailsDrawer,p=e.viewMode,f=e.activeFilters,m=e.resetStatusFilter,h=e.isDashboardView,g=e.viewportOffset,y=p0((0,iq.useState)(""),2),v=y[0],x=y[1],b=p0((0,iq.useState)(!1),2),j=b[0],w=b[1],C=p0((0,iq.useState)({statuses:[],overdue:!1,clientId:void 0,sortOption:"Newest"}),2),_=C[0],S=C[1],I=(0,iq.useMemo)(()=>{var e=[...t];if(null!=_&&_.clientId&&"All Clients"!=_.clientId&&(e=e.filter(e=>e.clientId===_.clientId)),v.trim()&&(e=e.filter(e=>e.name.toLowerCase().includes(v.toLowerCase()))),_.statuses.length>0&&(e=e.filter(e=>_.statuses.includes(e.status))),_.overdue){var n=new Date;n.setHours(0,0,0,0),e=e.filter(e=>!!e.dueDate&&new Date(e.dueDate)<n&&e.status!==aw.Complete)}switch(_.sortOption){case"Newest":e.sort((e,n)=>new Date(n.creationTs).getTime()-new Date(e.creationTs).getTime());break;case"Oldest":e.sort((e,n)=>new Date(e.creationTs).getTime()-new Date(n.creationTs).getTime());break;case"Due Date (asc)":e.sort((e,n)=>e.dueDate?n.dueDate?new Date(e.dueDate).getTime()-new Date(n.dueDate).getTime():-1:1);break;case"Due Date (desc)":e.sort((e,n)=>e.dueDate?n.dueDate?new Date(n.dueDate).getTime()-new Date(e.dueDate).getTime():-1:1);break;case"A-Z":e.sort((e,n)=>e.name.localeCompare(n.name));break;case"Z-A":e.sort((e,n)=>n.name.localeCompare(e.name))}return e},[t,v,_]),E=(0,iq.useMemo)(()=>_.clientId?o.get(_.clientId)||"All Projects":a?a.name:"All Projects",[_.clientId,a,o]),P=(0,iq.useMemo)(()=>{var e=0;return _.clientId&&"All Clients"!==_.clientId&&!h&&e++,_.statuses&&_.statuses.length>0&&(e+=_.statuses.length),_.overdue&&e++,e},[_]);(0,iq.useEffect)(()=>{S(f)},[f]);var O=e=>{S(n=>pQ(pQ({},n),{},{sortOption:e||void 0}))};return(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(i6.Row,{customCSS:"lg"===n?{padding:"20px"}:{padding:"14px"},children:[(0,iQ.jsxs)(i6.Column,{span:12,customCSS:{margin:"auto 0",display:"flex",justifyContent:"space-between"},children:[(0,iQ.jsxs)(pP,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"weekly-ad",size:24}),(0,iQ.jsx)(pO,{children:E})]}),(p===aS.BROKER||p===aS.DEVELOPER||p===aS.ADMIN)&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",id:"create_new_project",onClick:()=>{s()},customCSS:{margin:"0px",borderRadius:"6px",padding:"10px",border:"1px solid rgb(229, 231, 235)"},children:(0,iQ.jsx)(i6.Icon,{name:"plus",color:"black"})})]}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"28px 0px 0px 0px"},children:(0,iQ.jsxs)(pT,{children:[(0,iQ.jsx)(i6.SubSearch,{size:"sm",maxLength:"30",placeHolder:"Search projects...",textValue:v,onSearch:e=>{var n;return x(null!=(n=e.target.value)?n:"")},onSelect:e=>{var n;return x(null!=(n=e.target.value)?n:"")},handleChange:e=>{var n;return x(null!=(n=e.target.value)?n:"")},onClearInput:e=>x("")}),"lg"===n?(0,iQ.jsx)(i6.Dropdown,{tabIndex:"0",size:"sm",width:"150px",height:"38px",dropdownDirection:"down",options:aL,defaultValue:_.sortOption,onChange:(e,n)=>O(n.value),ariaLabel:"Sort projects by"}):(0,iQ.jsx)(iQ.Fragment,{}),(0,iQ.jsxs)(pk,{children:[P>0&&(0,iQ.jsx)(pN,{children:P}),(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",onClick:()=>{w(!0)},customCSS:{margin:"0px",borderRadius:"6px",padding:"10px",border:"1px solid rgb(229, 231, 235)",flexShrink:"0"},children:(0,iQ.jsx)(i6.Icon,{name:"filters",color:"black"})})]})]})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(pD,{viewportOffset:g,children:I.length>0?I.map(e=>{var n=a?void 0:o.get(e.clientId),t=c===e.projectId;return(0,iQ.jsxs)(pR,{isSelected:t,onClick:()=>{u(e.projectId),d(!0)},children:[(0,iQ.jsxs)(pA,{children:[(0,iQ.jsxs)(pM,{children:[(0,iQ.jsx)(pF,{title:e.name,children:e.name}),n&&p!==aS.PRINTER&&(0,iQ.jsxs)(pz,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"shared-user",size:16}),(0,iQ.jsx)(pL,{children:n})]})]}),(0,iQ.jsxs)(pV,{children:[(0,iQ.jsx)(i6.Badge,{type:aB[e.status],size:"sm",children:e.status}),(0,iQ.jsx)(i6.Popover,{minWidth:220,showCaret:!1,id:e.projectId,"aria-label":"more",position:"left",shouldStopPropagation:!0,triggerElement:(0,iQ.jsx)(i6.Button,{customCSS:"padding:0px; margin:0px;justify-content: center;display: flex;",size:"xs",tabIndex:0,iconOnly:!0,variant:"text",children:(0,iQ.jsx)(i6.Icon,{name:"more-top",color:"black"})}),children:(0,iQ.jsxs)(pH,{children:[(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto; ","aria-label":"View / Manage Project ".concat(null==e?void 0:e.name),"aria-disabled":"false",onClick:()=>l(e),children:(0,iQ.jsxs)(pW,{children:[(0,iQ.jsx)(i6.Icon,{name:"view-on",size:16}),(0,iQ.jsx)(pG,{children:"View / Manage Project"})]})}),(p===aS.BROKER||p===aS.ADMIN||p===aS.DEVELOPER)&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Edit Project ".concat(null==e?void 0:e.name),"aria-disabled":"false",onClick:()=>s(e),children:(0,iQ.jsxs)(pW,{children:[(0,iQ.jsx)(i6.Icon,{name:"edit",size:16}),(0,iQ.jsx)(pG,{children:"Edit Project"})]})})]})})]})]}),(0,iQ.jsx)(pB,{children:(0,iQ.jsxs)(pU,{children:[(0,iQ.jsxs)("p",{children:["Files: ",null!=e&&e.projectFiles?e.projectFiles.length:0]}),(0,iQ.jsx)("span",{children:"\xb7"}),e.dueDate&&(0,iQ.jsxs)("p",{children:["Due: ",dr(e.dueDate)]}),e.dueDate&&(0,iQ.jsx)("span",{children:"\xb7"}),e.updationTs&&(0,iQ.jsxs)("p",{children:["Updated: ",(0,pK.default)(new Date(e.updationTs),"MM/dd/yyyy")]})]})})]},e.projectId)}):(0,iQ.jsx)(pq,{children:t.length>0?(0,iQ.jsx)("p",{children:"No projects match your search or filter criteria."}):a?(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsxs)("p",{children:["No projects for ",a.name,"."]})}):(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsx)("p",{children:"You do not have any projects assigned to you."})})})})})]}),(0,iQ.jsx)(pZ,{showDrawer:j,onDrawerClose:()=>{w(!1)},selectedClient:{},currentFilters:_,handleCurrentFilters:S,onApplyFilters:e=>{S(e),w(!1)},handleClearFilters:e=>{S(e),w(!1),h&&m(!0)},size:n,clients:r,isDashboardView:h})]})};function p6(){var e=(0,i5._)(["\n display:flex;
1\n align-items:center;\n gap:10px;\n"]);return p6=function(){return e},e}function p5(){var e=(0,i5._)(["\n margin:0;\n font-size: ",";\n line-height: 28px;\n cursor: ",";\n font-family: ",";\n @media screen and (max-width: ","px) {\n font-size: 18px;\n line-height: 20px;\n }\n"]);return p5=function(){return e},e}function p4(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n overflow-wrap: break-word;\n overflow: hidden;\n"]);return p4=function(){return e},e}function p3(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n overflow-wrap: break-word;\n overflow: hidden;\n"]);return p3=function(){return e},e}var p8=i4.default.div.withConfig({displayName:"ProjectPage.styles__SubTitleContainer",componentId:"sc-8053994b-0"})(ny||(ny=p6())),p9=i4.default.h3.withConfig({displayName:"ProjectPage.styles__SubTitle",componentId:"sc-8053994b-1"})(nv||(nv=p5()),e=>e.size?"".concat(e.size,"px"):"18px",e=>e.pointer?"pointer":"default",lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm),p7=i4.default.span.withConfig({displayName:"ProjectPage.styles__ClientName",componentId:"sc-8053994b-2"})(nx||(nx=p4()),lQ.typography.type.motiva_medium),fe=i4.default.span.withConfig({displayName:"ProjectPage.styles__Text",componentId:"sc-8053994b-3"})(nb||(nb=p3()),lQ.typography.type.motiva);function fn(){var e=(0,i5._)(["\n display: flex;\n flex-wrap: wrap;\n gap: 24px;\n margin: 10px 0px 0px 0px;\n"]);return fn=function(){return e},e}function ft(){var e=(0,i5._)(["\n flex: 1;\n min-width: 200px;\n"]);return ft=function(){return e},e}function fr(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 112px;\n padding: 16px;\n border: 2px dashed;\n border-radius: 8px;\n cursor: pointer;\n border-color: ",";\n ","\n"]);return fr=function(){return e},e}function fo(){var e=(0,i5._)(["\n font-size: 14px;\n text-align: center;\n font-family: ",";\n margin: 0 0 8px 0;\n"]);return fo=function(){return e},e}function fi(){var e=(0,i5._)(["\n font-weight: 600;\n color: ",";\n font-family: ",";\n"]);return fi=function(){return e},e}function fa(){var e=(0,i5._)(["\n font-size: 12px;\n font-family: ",";\n margin: 0;\n text-align: center;\n overflow-wrap: break-word;\n word-break: break-word;\n padding: 0 8px;\n"]);return fa=function(){return e},e}function fl(){var e=(0,i5._)(["\n display: none;\n"]);return fl=function(){return e},e}function fs(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"]);return fs=function(){return e},e}function fc(){var e=(0,i5._)(["\n width: 1px;\n height: 64px;\n background-color: ",";\n"]);return fc=function(){return e},e}function fu(){var e=(0,i5._)(["\n height: 1px;\n width: 100%;\n background-color: ",";\n"]);return fu=function(){return e},e}function fd(){var e=(0,i5._)(["\n font-size: 25px;\n font-family: ",";\n font-weight: bold;\n color: ",";\n"]);return fd=function(){return e},e}function fp(){var e=(0,i5._)(["\n font-size: 14px;\n font-weight: 600;\n margin-top: 0px;\n"]);return fp=function(){return e},e}function ff(){var e=(0,i5._)(["\n background: ",";\n color: ",";\n font-weight: bold;\n border-radius: 100%;\n align-items: center;\n font-size: 14px;\n padding: 7px 9px;\n"]);return ff=function(){return e},e}function fm(){var e=(0,i5._)(["\n display: flex;\n gap: 10px;\n align-items: flex-start;\n margin-top: 14px;\n"]);return fm=function(){return e},e}function fh(){var e=(0,i5._)(["\n flex-grow: 1;\n"]);return fh=function(){return e},e}function fg(){var e=(0,i5._)(["\n text-align: right;\n display: flex;\n"]);return fg=function(){return e},e}function fy(){var e=(0,i5._)(["\n padding: 10px;\n background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));\n border: 1px solid #e5e7eb;\n margin-bottom: 8px;\n"]);return fy=function(){return e},e}function fv(){var e=(0,i5._)(["\n display: flex;\n gap: 7px;\n align-items: center;\n"]);return fv=function(){return e},e}function fx(){var e=(0,i5._)(["\n font-weight: bold;\n"]);return fx=function(){return e},e}function fb(){var e=(0,i5._)(["\n font-size: 11px;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n"]);return fb=function(){return e},e}function fj(){var e=(0,i5._)(["\n margin-right: 15px;\n cursor: pointer;
1\n color: #4d4d4f;\n"]);return fj=function(){return e},e}function fw(){var e=(0,i5._)(["\n label {\n text-transform: none;\n }\n"]);return fw=function(){return e},e}function fC(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: center;\n"]);return fC=function(){return e},e}function f_(){var e=(0,i5._)(["\n display: flex;\n gap: 10px;\n margin-top: 10px;\n justify-content: flex-end;\n"]);return f_=function(){return e},e}function fS(){var e=(0,i5._)(["\n margin-left: auto;\n"]);return fS=function(){return e},e}function fI(){var e=(0,i5._)(["\n position: fixed;\n z-index: 99999 !important;\n background: ",";\n border: 1px solid ",";\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);\n max-height: 200px;\n min-width: 250px;\n max-width: 320px;\n overflow: hidden;\n transition: opacity 0.15s ease-in-out;\n will-change: transform;\n\n @media (max-width: 768px) {\n min-width: 200px;\n max-width: calc(100vw - 40px);\n max-height: 180px;\n }\n\n @media (max-width: 480px) {\n min-width: 150px;\n max-width: calc(100vw - 20px);\n max-height: 160px;\n border-radius: 6px;\n }\n"]);return fI=function(){return e},e}function fE(){var e=(0,i5._)(["\n max-height: 200px;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 4px 0;\n\n &::-webkit-scrollbar {\n width: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n background: ",";\n border-radius: 3px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: ",";\n }\n\n @media (max-width: 768px) {\n max-height: 180px;\n }\n\n @media (max-width: 480px) {\n max-height: 160px;\n }\n"]);return fE=function(){return e},e}function fP(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n cursor: pointer;\n background-color: ",";\n transition: background-color 0.1s ease-in-out;\n user-select: none;\n\n &:hover {\n background-color: ",";\n }\n\n &:active {\n background-color: ",";\n }\n\n @media (max-width: 768px) {\n padding: 10px 12px;\n gap: 10px;\n }\n\n @media (max-width: 480px) {\n padding: 12px;\n gap: 8px;\n }\n"]);return fP=function(){return e},e}function fO(){var e=(0,i5._)(["\n background: #aabad5;\n color: #0c386f;\n font-weight: bold;\n border-radius: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n width: 28px;\n height: 28px;\n flex-shrink: 0;\n\n @media (max-width: 480px) {\n width: 32px;\n height: 32px;\n font-size: 13px;\n }\n"]);return fO=function(){return e},e}function fT(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n color: ",";\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n\n @media (max-width: 768px) {\n font-size: 15px;\n }\n\n @media (max-width: 480px) {\n font-size: 16px;\n }\n"]);return fT=function(){return e},e}function fk(){var e=(0,i5._)(["\n padding: 16px;\n text-align: center;\n color: ",";\n font-family: ",";\n font-size: 14px;\n font-style: italic;\n"]);return fk=function(){return e},e}function fN(){var e=(0,i5._)(["\n display: inline-block;\n background-color: ",";\n color: ",";\n font-weight: 700;\n font-family: ",";\n padding: 3px 6px;\n border-radius: 6px;\n margin: 0 2px;\n font-size: 14px;\n white-space: nowrap;\n line-height: 1.4;\n"]);return fN=function(){return e},e}function fD(){var e=(0,i5._)(["\n position: relative;\n width: 100%;\n"]);return fD=function(){return e},e}function fR(){var e=(0,i5._)(["\n color: ",";\n font-weight: 500;\n background-color: transparent;\n"]);return fR=function(){return e},e}var fA=i4.default.div.withConfig({displayName:"ProjectDetails.styles__ProjectDetailsContainer",componentId:"sc-2ecf3f8d-0"})(nj||(nj=fn())),fM=i4.default.div.withConfig({displayName:"ProjectDetails.styles__Wrapper",componentId:"sc-2ecf3f8d-1"})(nw||(nw=ft())),fF=i4.default.div.withConfig({displayName:"ProjectDetails.styles__DragDropWrapper",componentId:"sc-2ecf3f8d-2"})(nC||(nC=fr()),i3.colors.ink_light_gray,e=>e.isDragging&&"\n border-color: ".concat(i8.extend.colors.brand["500"],";\n background-color: ").concat(i8.extend.colors.brand["50"],";\n ")),fz=i4.default.p.withConfig({displayName:"ProjectDetails.styles__UploadText",componentId:"sc-2ecf3f8d-3"})(n_||(n_=fo()),lQ.typography.type.motiva),fL=i4.default.span.withConfig({displayName:"ProjectDetails.styles__Highlight",componentId:"sc-2ecf3f8d-4"})(nS||(nS=fi()),i8.extend.colors.brand["600"],lQ.typography.type.motiva_medium),fB=i4.default.p.withConfig({displayName:"ProjectDetails.styles__FileTypeInfo",componentId:"sc-2ecf3f8d-5"})(nI||(nI=fa()),lQ.typography.type.motiva),fU=i4.default.input.withConfig({displayName:"ProjectDetails.styles__HiddenFileInput",componentId:"sc-2ecf3f8d-6"})(nE||(nE=fl())),fV=i4.default.div.withConfig({displayName:"ProjectDetails.styles__FileCountContainer",componentId:"sc-2ecf3f8d-7"})(nP||(nP=fs())),fH=i4.default.div.withConfig({displayName:"ProjectDetails.styles__VerticalDivider",componentId:"sc-2ecf3f8d-8"})(nO||(nO=fc()),i3.colors.ink_light_gray),fW=i4.default.div.withConfig({displayName:"ProjectDetails.styles__HorizontalDivider",componentId:"sc-2ecf3f8d-9"}
1)(nT||(nT=fu()),i3.colors.ink_light_gray),fG=i4.default.p.withConfig({displayName:"ProjectDetails.styles__NumberText",componentId:"sc-2ecf3f8d-10"})(nk||(nk=fd()),lQ.typography.type.motiva_medium,i8.extend.colors.brand["600"]),fq=i4.default.p.withConfig({displayName:"ProjectDetails.styles__LabelText",componentId:"sc-2ecf3f8d-11"})(nN||(nN=fp())),fK=i4.default.div.withConfig({displayName:"ProjectDetails.styles__UserNameWrapper",componentId:"sc-2ecf3f8d-12"})(nD||(nD=ff()),i8.extend.colors.brand["100"],i8.extend.colors.brand["700"]),fJ=i4.default.div.withConfig({displayName:"ProjectDetails.styles__CommentContainter",componentId:"sc-2ecf3f8d-13"})(nR||(nR=fm())),fX=i4.default.div.withConfig({displayName:"ProjectDetails.styles__CommentBoxWrapper",componentId:"sc-2ecf3f8d-14"})(nA||(nA=fh())),f$=i4.default.div.withConfig({displayName:"ProjectDetails.styles__SubmitCOmmentWrapper",componentId:"sc-2ecf3f8d-15"})(nM||(nM=fg())),fZ=i4.default.div.withConfig({displayName:"ProjectDetails.styles__CommentBox",componentId:"sc-2ecf3f8d-16"})(nF||(nF=fy())),fY=i4.default.div.withConfig({displayName:"ProjectDetails.styles__CommentBoxNameWrapper",componentId:"sc-2ecf3f8d-17"})(nz||(nz=fv())),fQ=i4.default.div.withConfig({displayName:"ProjectDetails.styles__CommentName",componentId:"sc-2ecf3f8d-18"})(nL||(nL=fx())),f0=i4.default.div.withConfig({displayName:"ProjectDetails.styles__CommentText",componentId:"sc-2ecf3f8d-19"})(nB||(nB=fb())),f1=i4.default.span.withConfig({displayName:"ProjectDetails.styles__CommentBtn",componentId:"sc-2ecf3f8d-20"})(nU||(nU=fj()));i4.default.div.withConfig({displayName:"ProjectDetails.styles__DateComponentWrapper",componentId:"sc-2ecf3f8d-21"})(nV||(nV=fw()));var f2=i4.default.div.withConfig({displayName:"ProjectDetails.styles__CommentBtnWrapper",componentId:"sc-2ecf3f8d-22"})(nH||(nH=fC())),f6=i4.default.div.withConfig({displayName:"ProjectDetails.styles__ReplyBtnWrapper",componentId:"sc-2ecf3f8d-23"})(nW||(nW=f_())),f5=i4.default.div.withConfig({displayName:"ProjectDetails.styles__TopCommentBtnWrapper",componentId:"sc-2ecf3f8d-24"})(nG||(nG=fS())),f4=i4.default.div.withConfig({displayName:"ProjectDetails.styles__MentionDropdownContainer",componentId:"sc-2ecf3f8d-25"})(nq||(nq=fI()),i3.colors.white,i3.colors.ink_light_gray),f3=i4.default.div.withConfig({displayName:"ProjectDetails.styles__MentionDropdownList",componentId:"sc-2ecf3f8d-26"})(nK||(nK=fE()),i3.colors.ink_light_gray,i3.colors.dark_gray_2),f8=i4.default.div.withConfig({displayName:"ProjectDetails.styles__MentionDropdownItem",componentId:"sc-2ecf3f8d-27"})(nJ||(nJ=fP()),e=>e.isSelected?i8.extend.colors.brand["50"]:"transparent",e=>e.isSelected?i8.extend.colors.brand["100"]:i3.colors.light_gray_1,i8.extend.colors.brand["100"]),f9=i4.default.div.withConfig({displayName:"ProjectDetails.styles__MentionUserAvatar",componentId:"sc-2ecf3f8d-28"})(nX||(nX=fO())),f7=i4.default.div.withConfig({displayName:"ProjectDetails.styles__MentionUserName",componentId:"sc-2ecf3f8d-29"})(n$||(n$=fT()),lQ.typography.type.motiva,i3.colors.dark_gray_2),me=i4.default.div.withConfig({displayName:"ProjectDetails.styles__MentionNoResults",componentId:"sc-2ecf3f8d-30"})(nZ||(nZ=fk()),i3.colors.dark_gray_2,lQ.typography.type.motiva),mn=i4.default.span.withConfig({displayName:"ProjectDetails.styles__MentionPill",componentId:"sc-2ecf3f8d-31"})(nY||(nY=fN()),i8.extend.colors.brand["100"],i8.extend.colors.brand["700"],lQ.typography.type.motiva_medium),mt=i4.default.div.withConfig({displayName:"ProjectDetails.styles__MentionInputWrapper",componentId:"sc-2ecf3f8d-32"})(nQ||(nQ=fD()));i4.default.span.withConfig({displayName:"ProjectDetails.styles__MentionHighlight",componentId:"sc-2ecf3f8d-33"})(n0||(n0=fR()),i8.extend.colors.brand["600"]);var mr="@euf/ele-app-tpv",mo={GET_PRINT_BROKER_PROJECTS:"".concat(mr,"/GET_PRINT_BROKER_PROJECTS"),GET_PRINT_BROKER_TEMPLATES:"".concat(mr,"/GET_PRINT_BROKER_TEMPLATES"),GET_PRINT_BROKER_SETTING:"".concat(mr,"/GET_PRINT_BROKER_SETTING"),GET_PRINT_BROKER_PROJECT:"".concat(mr,"/GET_PRINT_BROKER_PROJECT"),GET_PRINT_BROKER_USERS:"".concat(mr,"/GET_PRINT_BROKER_USERS"),GET_CURRENT_USER:"".concat(mr,"/GET_CURRENT_USER"),GET_PRINT_BROKER_CONFIG:"".concat(mr,"/GET_PRINT_BROKER_CONFIG"),GET_PRINT_BROKER_PRINTERS:"".concat(mr,"/GET_PRINT_BROKER_PRINTERS"),GET_PRINT_BROKER_CLIENTS:"".concat(mr,"/GET_PRINT_BROKER_CLIENTS"),GET_NOTIFICATIONS:"".concat(mr,"/GET_NOTIFICATIONS"),SET_NOTIFICATIONS_COUNT:"".concat(mr,"/SET_NOTIFICATIONS_COUNT"),MARK_NOTIFICATION_AS_READ:"".concat(mr,"/MARK_NOTIFICATION_AS_READ"),SET_SESSION_EXPIRED:"".concat(mr,"/SET_SESSION_EXPIRED")},mi=["tenant"];function ma(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return ml(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");
1if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(ml(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ml(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,ml(u,"constructor",c),ml(c,"constructor",s),s.displayName="GeneratorFunction",ml(c,o,"GeneratorFunction"),ml(u),ml(u,o,"Generator"),ml(u,r,function(){return this}),ml(u,"toString",function(){return"[object Generator]"}),(ma=function(){return{w:i,m:d}})()}function ml(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(ml=function(e,n,t,r){function i(n,t){ml(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function ms(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function mc(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){ms(i,r,o,a,l,"next",e)}function l(e){ms(i,r,o,a,l,"throw",e)}a(void 0)})}}var mu=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_PRINT_BROKER_PROJECTS,payload:{projects:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),md=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_PRINT_BROKER_TEMPLATES,payload:{templates:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mp=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_PRINT_BROKER_SETTING,payload:{settings:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mf=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_PRINT_BROKER_PROJECTS,payload:{project:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mm=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_PRINT_BROKER_USERS,payload:{users:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mh=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_PRINT_BROKER_PRINTERS,payload:{printers:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mg=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_PRINT_BROKER_CLIENTS,payload:{clients:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),my=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_CURRENT_USER,payload:{currentUser:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mv=e=>(function(){var n=mc(ma().m(function n(t){var r;return ma().w(function(n){for(;;)switch(n.n){case 0:e.tenant,r=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,mi),t({type:mo.GET_PRINT_BROKER_CONFIG,payload:{config:r}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mx=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.GET_NOTIFICATIONS,payload:{notifications:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mb=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.SET_NOTIFICATIONS_COUNT,payload:{notificationsCount:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mj=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.MARK_NOTIFICATION_AS_READ,payload:{notificationId:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})(),mw=e=>(function(){var n=mc(ma().m(function n(t){return ma().w(function(n){for(;;)switch(n.n){case 0:t({type:mo.SET_SESSION_EXPIRED,payload:{sessionExpired:e}});case 1:return n.a(2)}},n)}));return function(e){return n.apply(this,arguments)}})();function mC(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function m_(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?mC(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mC(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function mS(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var mI=e=>{var n=e.text,t=e.allUsers,r=void 0===t?[]:t,o=e.currentUserType,i=e.currentUser,a=e.onTextChange,l=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}
1(e,2)||function(e,n){if(e){if("string"==typeof e)return mS(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?mS(e,n):void 0}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)({isActive:!1,query:"",startIndex:-1,endIndex:-1,selectedIndex:0,position:{top:0,left:0},direction:"down"}),2),s=l[0],c=l[1],u=(0,iq.useRef)(null),d=(0,iq.useRef)(n),p=(0,iq.useRef)(!1);(0,iq.useEffect)(()=>{d.current=n},[n]);var f=(0,iq.useMemo)(()=>{if(!Array.isArray(r)||0===r.length)return[];var e=(o||aS.BROKER).toLowerCase(),n=null==i?void 0:i.orgId;return e===aS.BROKER||e===aS.ADMIN?r:e===aS.CLIENT?r.filter(e=>{var t,r=null==e||null==(t=e.userType)?void 0:t.toLowerCase();return r===aS.BROKER||r===aS.CLIENT&&(null==e?void 0:e.orgId)===n}):e===aS.PRINTER?r.filter(e=>{var t,r=null==e||null==(t=e.userType)?void 0:t.toLowerCase();return r===aS.BROKER||r===aS.PRINTER&&(null==e?void 0:e.orgId)===n}):r},[r,o,null==i?void 0:i.orgId]),m=(0,iq.useMemo)(()=>{if(!f||0===f.length)return[];if(!s.query||""===s.query.trim())return f.slice(0,10);var e=s.query.toLowerCase().trim(),n=e.split(/\s+/).filter(e=>e.length>0);return f.filter(t=>{var r,o,i=((null==t||null==(r=t.contact)?void 0:r.firstName)||"").toLowerCase(),a=((null==t||null==(o=t.contact)?void 0:o.lastName)||"").toLowerCase(),l="".concat(i," ").concat(a);return n.some(e=>i.includes(e)||a.includes(e))||l.includes(e)}).slice(0,10)},[f,s.query]),h=(e,n)=>n>0&&e[n-1]&&!/\s/.test(e[n-1]),g=(0,iq.useCallback)((e,n)=>{try{var t=e.getBoundingClientRect(),r=window.getComputedStyle(e),o=parseFloat(r.lineHeight),i=parseFloat(r.fontSize),a=Number.isFinite(o)?o:Number.isFinite(i)?1.2*i:16,l=document.createElement("div");l.style.position="absolute",l.style.visibility="hidden",l.style.whiteSpace="pre-wrap",l.style.wordWrap="break-word",l.style.font=r.font,l.style.padding=r.padding,l.style.border=r.border,l.style.boxSizing=r.boxSizing,l.style.width="".concat(e.clientWidth,"px"),l.style.height="auto",l.style.lineHeight="".concat(a,"px"),l.style.letterSpacing=r.letterSpacing,l.style.overflow="auto",l.style.top="".concat(t.top+window.scrollY,"px"),l.style.left="".concat(t.left+window.scrollX,"px");var s=e.scrollTop||0,c=e.scrollLeft||0,u=e.value.substring(0,n),d=e.value.substring(n),p=document.createElement("span");p.textContent="​",l.textContent=u,l.appendChild(p),l.appendChild(document.createTextNode(d)),document.body.appendChild(l),l.scrollTop=s,l.scrollLeft=c;var f=p.getBoundingClientRect();document.body.removeChild(l);var m=f.bottom+12,h=f.left,g="down",y=window.innerHeight,v=window.innerWidth,x=y-m-200,b=f.top-200-12;return x<8&&b>8&&(g="up",m=f.top-200-12),m<8&&(m=8),m+200>y-8&&(m=y-200-8),h<8&&(h=8),h+250>v-8&&(h=v-250-8),{top:m,left:h,direction:g}}catch(e){return console.error("Error calculating dropdown position:",e),{top:100,left:100,direction:"down"}}},[]),y=(0,iq.useCallback)((e,n,t,r)=>{null==n&&(n=e.length);var o=e.substring(0,n),i=o.lastIndexOf("@");if(-1===i||h(e,i))return void c(e=>m_(m_({},e),{},{isActive:!1}));var a=i>0?o[i-1]:null;if(a&&!/\s/.test(a))return void c(e=>m_(m_({},e),{},{isActive:!1}));var l=o.substring(i+1).match(/^[\w\s]+/),s=l?l[0].trim():"",d=o.substring(i);if(/^@[\w\s]+\s/.test(d)&&n>i+d.indexOf(" ",1)||n-i>s.length+20)return void c(e=>m_(m_({},e),{},{isActive:!1}));var p=e.substring(n).match(/^[\w]*/),f=n+(p?p[0].length:0),m=r||u.current;if(r&&(u.current=r),m){var y=g(m,Math.min(null!=n?n:e.length,e.length)),v=y.top,x=y.left,b=y.direction;c(e=>e.isActive&&e.query===s&&e.startIndex===i&&e.endIndex===f&&e.position.top===v&&e.position.left===x&&e.direction===b?e:m_(m_({},e),{},{isActive:!0,query:s,startIndex:i,endIndex:f,selectedIndex:0,position:{top:v,left:x},direction:b}))}else console.warn("Textarea ref not available for mention positioning"),c(e=>m_(m_({},e),{},{isActive:!0,query:s,startIndex:i,endIndex:f,selectedIndex:0,position:{top:100,left:100}
1,direction:"down"}))},[f,g]),v=(0,iq.useCallback)(function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(t&&(u.current=t),p.current){p.current=!1,a&&!r.skipPropagate&&a(e),y(e,n,f,t);return}y(e,n,f,t),a&&!r.skipPropagate&&a(e)},[y,f,a]);(0,iq.useEffect)(()=>{!n&&s.isActive&&c(e=>m_(m_({},e),{},{isActive:!1}))},[n,s.isActive]);var x=(0,iq.useCallback)(e=>{if(e){var n,t,r=(null==e||null==(n=e.contact)?void 0:n.firstName)||"",o=(null==e||null==(t=e.contact)?void 0:t.lastName)||"",i="".concat(r," ").concat(o).trim()||e.id||aP,l="@".concat(i," "),s=d.current;c(e=>{if(-1!==e.startIndex){var n=s.substring(0,e.startIndex),t=n+l+s.substring(e.endIndex);return setTimeout(()=>{if(u.current){var e=n.length+l.length;u.current.setSelectionRange(e,e),u.current.focus()}},0),p.current=!0,a&&a(t),m_(m_({},e),{},{isActive:!1,query:"",selectedIndex:0,startIndex:-1,endIndex:-1})}return e})}},[a]),b=e=>{if(s.isActive){var n=m.length>0,t=n?Math.min(s.selectedIndex,m.length-1):0;if("ArrowDown"===e.key){if(e.preventDefault(),!n)return;c(e=>m_(m_({},e),{},{selectedIndex:Math.min(e.selectedIndex+1,m.length-1)}))}else if("ArrowUp"===e.key){if(e.preventDefault(),!n)return;c(e=>m_(m_({},e),{},{selectedIndex:Math.max(e.selectedIndex-1,0)}))}else"Enter"===e.key||"Tab"===e.key?n&&m[t]&&(e.preventDefault(),x(m[t])):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),c(e=>m_(m_({},e),{},{isActive:!1})))}};return(0,iq.useEffect)(()=>{if(s.isActive){var e=e=>b(e);return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)}},[s.isActive,s.selectedIndex,m,x]),{mentionState:s,matchingUsers:m,textareaRef:u,handleTextChange:v,handleKeyDown:b,handleHoverIndex:e=>{s.isActive&&c(n=>m_(m_({},n),{},{selectedIndex:e}))},selectUser:x,closeMention:()=>c(e=>m_(m_({},e),{},{isActive:!1}))}};function mE(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let mP=e=>{var n=e.users,t=void 0===n?[]:n,r=e.query,o=void 0===r?"":r,i=e.position,a=void 0===i?{top:0,left:0}:i,l=e.isVisible,s=void 0!==l&&l,c=e.selectedIndex,u=void 0===c?0:c,d=e.onSelectUser,p=e.onClose,f=e.onHoverIndex,m=(0,iq.useRef)(null),h=(0,iq.useRef)(null),g=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||function(e,n){if(e){if("string"==typeof e)return mE(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?mE(e,n):void 0}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)(null),2),y=g[0],v=g[1];if((0,iq.useEffect)(()=>{if(h.current&&m.current){var e=m.current,n=h.current,t=e.getBoundingClientRect(),r=n.getBoundingClientRect();(r.top<t.top||r.bottom>t.bottom)&&n.scrollIntoView({block:"nearest",behavior:"smooth"})}},[u]),(0,iq.useEffect)(()=>{if(s){var e=e=>{if(m.current&&!m.current.contains(e.target)){var n=document.querySelector("textarea");n&&n.contains(e.target)||p()}},n=setTimeout(()=>{document.addEventListener("mousedown",e)},100);return()=>{clearTimeout(n),document.removeEventListener("mousedown",e)}}},[s,p]),!s)return null;var x=e=>{var n,t,r=(null==e||null==(n=e.contact)?void 0:n.firstName)||"",o=(null==e||null==(t=e.contact)?void 0:t.lastName)||"";return r&&o?"".concat(r[0]).concat(o[0]).toUpperCase():"NA"},b=e=>{var n,t,r=(null==e||null==(n=e.contact)?void 0:n.firstName)||"",o=(null==e||null==(t=e.contact)?void 0:t.lastName)||"";return"".concat(r," ").concat(o).trim()||e.id||aP};
1return(0,iQ.jsx)(f4,{ref:m,style:{top:"".concat(a.top,"px"),left:"".concat(a.left,"px")},children:0===t.length&&o?(0,iQ.jsxs)(me,{children:['No users found matching "',o,'"']}):(0,iQ.jsx)(f3,{children:t.map((e,n)=>{var t=n===u,r=b(e),o=x(e);return(0,iQ.jsxs)(f8,{ref:t?h:null,isSelected:t||y===n,onClick:()=>d(e),onMouseEnter:()=>{v(n),f&&f(n)},onMouseLeave:()=>{v(null)},children:[(0,iQ.jsx)(f9,{children:o}),(0,iQ.jsx)(f7,{children:r})]},e.id||n)})})})};function mO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var mT=(0,iq.memo)(e=>{var n=e.parentId,t=e.initialText,r=e.onCancel,o=e.onSubmit,i=e.users,a=e.currentUserType,l=e.projectClientId,s=e.userInitials,c=e.fullName,u=e.currentUser,d=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||function(e,n){if(e){if("string"==typeof e)return mO(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?mO(e,n):void 0}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)(t||""),2),p=d[0],f=d[1],m=(0,iq.useRef)(n);(0,iq.useEffect)(()=>{m.current!==n&&(f(t||""),m.current=n)},[n,t]);var h=mI({text:p,allUsers:((void 0===i?[]:i)||[]).filter(e=>!1!==e.active),currentUserType:a||aS.BROKER,projectClientId:l,currentUser:u,onTextChange:f});return(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(fJ,{children:[(0,iQ.jsx)(fK,{children:s}),(0,iQ.jsxs)(fX,{style:{position:"relative"},children:[(0,iQ.jsx)(mt,{children:(0,iQ.jsx)(i6.TextArea,{ref:h.textareaRef,customCSS:"width:100%;",placeholder:"Replying to ".concat(c,"..."),value:p,onChange:(e,n)=>{var t,r,o,i,a,l=null!=(t=null!=(r=null==e||null==(o=e.target)?void 0:o.value)?r:n)?t:"",s=null!=(i=null==e||null==(a=e.target)?void 0:a.selectionStart)?i:l.length;f(l),h.handleTextChange(l,s,null==e?void 0:e.target,{skipPropagate:!0})},onKeyDown:e=>{h.handleKeyDown(e)},height:60})}),h.mentionState.isActive&&(0,iZ.createPortal)((0,iQ.jsx)(mP,{users:h.matchingUsers,query:h.mentionState.query,position:h.mentionState.position,isVisible:h.mentionState.isActive,selectedIndex:h.mentionState.selectedIndex,onSelectUser:h.selectUser,onClose:h.closeMention,onHoverIndex:h.handleHoverIndex}),document.body)]})]}),(0,iQ.jsxs)(f6,{children:[(0,iQ.jsx)(f2,{children:(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",customCSS:"margin:0;border-radius:0;height:100%;",onClick:()=>{h.closeMention(),f(""),r()},children:"Cancel"})}),(0,iQ.jsx)(f2,{children:(0,iQ.jsx)(ai,{label:"Post Reply",size:"sm",onClick:()=>{h.closeMention(),o(p),f("")}})})]})]})},(e,n)=>e.parentId===n.parentId);function mk(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return mN(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(mN(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,mN(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,mN(u,"constructor",c),mN(c,"constructor",s),s.displayName="GeneratorFunction",mN(c,o,"GeneratorFunction"),mN(u),mN(u,o,"Generator"),mN(u,r,function(){return this}),mN(u,"toString",function(){return"[object Generator]"}),(mk=function(){return{w:i,m:d}})()}function mN(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(mN=function(e,n,t,r){function i(n,t){mN(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function mD(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function mR(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){mD(i,r,o,a,l,"next",e)}function l(e){mD(i,r,o,a,l,"throw",e)}a(void 0)})}}function mA(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function mM(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?mA(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mA(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function mF(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return mz(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?mz(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mz(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}mT.displayName="ReplyInput";let mL=e=>{var n,t=e.project,r=e.onShowToast,o=e.onSetToastNotification,i=e.onUpdateProjects,a=e.viewMode,l=(0,iY.useDispatch)(),s=(0,iY.useSelector)(a8),c=(0,iY.useSelector)(a6),u=(0,iY.useSelector)(a9),d=null==u?void 0:u.id,p=null==u?void 0:u.userType,f=(0,iq.useMemo)(()=>s||[],[s]),m=null==f?void 0:f.filter(e=>e.userType===aI.PRINTER),h=null==f?void 0:f.filter(e=>e.userType===aI.CLIENT),g=mF((0,iq.useState)([]),2),y=g[0],v=g[1],x=mF((0,iq.useState)(null),2),b=x[0],j=x[1],w=mF((0,iq.useState)(""),2),C=w[0],_=w[1],S=mF((0,iq.useState)({}),2),I=S[0],E=S[1],P=mF((0,iq.useState)(!1),2),O=P[0],T=P[1],k=mF((0,iq.useState)(null),2),N=k[0],D=k[1],R=(0,iq.useRef)(null);(0,iq.useEffect)(()=>()=>{R.current&&clearTimeout(R.current)},[]);var A=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"failure";if(o&&r){o({message:e,type:n}),r(!0);return}R.current&&clearTimeout(R.current),D({message:e,variant:n}),R.current=setTimeout(()=>{D(null)},4e3)},M=mI({text:C,allUsers:(f||[]).filter(e=>!1!==e.active),currentUser:u,currentUserType:p||aS.BROKER,projectClientId:null==(n=t)?void 0:n.clientId,onTextChange:e=>_(e)}),F=e=>e&&"admin"!==e.toLowerCase()?e.toUpperCase():"BROKER",z=e=>e&&f&&0!==f.length?e.replaceAll(/@([A-Za-z]+)\s+([A-Za-z]+)/g,(e,n,t)=>{var r=f.find(e=>{var r,o;return(null==e||null==(r=e.contact)||null==(r=r.firstName)?void 0:r.toLowerCase())===n.toLowerCase()&&(null==e||null==(o=e.contact)||null==(o=o.lastName)?void 0:o.toLowerCase())===t.toLowerCase()});return r?"~".concat(r.id,"||").concat(r.userType.toUpperCase(),"~"):e}):e,L=e=>{if(!e||!f||0===f.length)return[];var n=[],t=new Set;return e.replace(/@([A-Za-z]+)\s+([A-Za-z]+)/g,(e,r,o)=>{var i,a,l,s,c,u=f.find(e=>{var n,t,i;return(null==e||null==(n=e.contact)||null==(n=n.firstName)?void 0:n.toLowerCase())===r.toLowerCase()&&(null==e||null==(t=e.contact)||null==(t=t.lastName)?void 0:t.toLowerCase())===o.toLowerCase()&&(null==e||null==(i=e.userType)?void 0:i.toUpperCase())===aI.BROKER.toUpperCase()&&(null==e?void 0:e.active)===!0});u&&!t.has(u.id)&&(n.push({userId:null!=(i=null==u?void 0:u.id)?i:"",email:null!=(a=null==u||null==(l=u.contact)?void 0:l.email)?a:"",firstName:null!=(s=null==u||null==(c=u.contact)?void 0:c.firstName)?s:""}),t.add(u.id))}),n},B=e=>{if(!e)return(0,iQ.jsx)("p",{});for(var n,t=/~(\d+)(?:\|\|([A-Z_]+))?~/g,r=[],o=0;null!==(n=t.exec(e));)!function(){n.index>o&&r.push({type:"text",content:e.substring(o,n.index)});var t=n[1],i=f.find(e=>String(e.id)===t);if(i){var a,l,s=(null==i||null==(a=i.contact)?void 0:a.firstName)||"",c=(null==i||null==(l=i.contact)?void 0:l.lastName)||"",u="".concat(s," ").concat(c).trim(),d=!1===i.active;r.push({type:"mention",content:d?"".concat(u," (Inactive)"):u})}else r.push({type:"mention",content:aP});o=n.index+n[0].length}();if(o<e.length&&r.push({type:"text",content:e.substring(o)}),0===r.length){var i=e.split("\n");return(0,iQ.jsx)("p",{children:i.map((e,n)=>(0,iQ.jsxs)(iq.Fragment,{children:[e,n<i.length-1&&(0,iQ.jsx)("br",{})]},"line-".concat(n)))})}return(0,iQ.jsx)("p",{children:r.map((e,n)=>{if("mention"===e.type)return(0,iQ.jsx)(mn,{children:e.content},"mention-".concat(n));var t=e.content.split("\n");return(0,iQ.jsx)(iq.Fragment,{children:t.map((e,r)=>(0,iQ.jsxs)(iq.Fragment,{children:[e,r<t.length-1&&(0,iQ.jsx)("br",{})]},"".concat(n,"-").concat(r)))},"text-".concat(n))})})},U=e=>Array.isArray(f)?f.find(n=>String(n.id)===String(e)):null;t=Array.isArray(c)?c.find(e=>String(e.projectId)===String(t.projectId)):t,(0,iq.useEffect)(()=>{var e;v((Array.isArray(null==(e=t)?void 0:e.comments)?t.comments:[]).map(e=>({id:e.id,parentId:"undefined"===e.parentId?"0":e.parentId,author:e.commentAuthorId,commentAuthorType:e.commentAuthorType,date:e.commentedAt?new Date(e.commentedAt).toLocaleStr
1ing():"",text:e.commentText})))},[t]);var V=e=>{if(a===aS.BROKER||a===aS.ADMIN||a===aS.DEVELOPER)return!1;var n=null==e?void 0:e.commentAuthorType;if(a===aS.CLIENT&&n===aI.PRINTER.toUpperCase()||a===aS.PRINTER&&n===aI.CLIENT.toUpperCase())return!0;if([aS.CLIENT,aS.PRINTER].includes(a)&&[aI.BROKER.toUpperCase(),aI.ADMIN.toUpperCase(),aI.DEVELOPER.toUpperCase()].includes(n)){for(var t,r,o=a===aS.CLIENT?m:h,i=/~(\d+)(?:\|\|([A-Z_]+))?~/g;null!==(r=i.exec(e.text));)if(o.find(e=>String(e.id)===r[1]))return!0;return!1}return(null==(t=e.replies)?void 0:t.some(e=>V(e)))||!1},H=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";return e.filter(e=>!V(e)).filter(e=>e.parentId===n).map(n=>mM(mM({},n),{},{replies:H(e,n.id)}))},W=e=>{if(e){var n=e.data||e;if(i)return void i(n);l(mu(c.map(e=>String(e.projectId)===String(n.projectId)?n:e)))}},G=function(){var e=mR(mk().m(function e(){var n,r,o,i,a,l,s;return mk().w(function(e){for(;;)switch(e.p=e.n){case 0:if(C.trim()){e.n=1;break}return e.a(2);case 1:return M.closeMention(),n=z(C),r=L(C),o={commentData:{parentId:"0",commentAuthorId:d,commentAuthorType:F(p),commentedAt:Date.now(),commentText:n},gnpInfo:r},e.p=2,e.n=3,uL(t.projectId,o);case 3:W(e.v),_(""),A("Comment posted successfully!","success"),e.n=5;break;case 4:e.p=4,console.error(s=e.v),A((l=(null==s||null==(i=s.response)||null==(i=i.data)||null==(i=i.error)?void 0:i.description)||(null==s||null==(a=s.response)||null==(a=a.data)?void 0:a.message)||(null==s?void 0:s.message))?"Failed to post comment: ".concat(l):"Failed to post comment, please try again","failure");case 5:return e.a(2)}},e,null,[[2,4]])}));return function(){return e.apply(this,arguments)}}(),q=function(){var e=mR(mk().m(function e(n,r){var o,i,a,l,s,c,u,m,h,g,y,v,x;return mk().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!=r&&r.trim()){e.n=1;break}return e.a(2);case 1:return o=z(r),i=L(r),(a=f.find(e=>{var t;return String(e.id)===String(null==n?void 0:n.author)&&(null==e||null==(t=e.userType)?void 0:t.toUpperCase())===aI.BROKER.toUpperCase()&&(null==e?void 0:e.active)===!0}))&&(i.some(e=>String(e.userId)===String(a.id))||i.push({userId:null!=(l=null==a?void 0:a.id)?l:"",email:null!=(s=null==a||null==(c=a.contact)?void 0:c.email)?s:"",firstName:null!=(u=null==a||null==(m=a.contact)?void 0:m.firstName)?u:""})),h={commentData:{parentId:null==n?void 0:n.id,commentAuthorId:d,commentAuthorType:F(p),commentedAt:Date.now(),commentText:o},gnpInfo:i},e.p=2,e.n=3,uL(t.projectId,h);case 3:W(e.v),j(null),A("Reply posted successfully!","success"),e.n=5;break;case 4:e.p=4,console.error(x=e.v),A((v=(null==x||null==(g=x.response)||null==(g=g.data)||null==(g=g.error)?void 0:g.description)||(null==x||null==(y=x.response)||null==(y=y.data)?void 0:y.message)||(null==x?void 0:x.message))?"Failed to post reply: ".concat(v):"Failed to post reply, please try again","failure");case 5:return e.a(2)}},e,null,[[2,4]])}));return function(n,t){return e.apply(this,arguments)}}(),K=function(){var e=mR(mk().m(function e(n){var r;return mk().w(function(e){for(;;)switch(e.p=e.n){case 0:var o,i;return e.p=0,e.n=1,o=t.projectId,i=n.id,uS.post("".concat(u_,"/project/comment"),{},{params:{projectId:o,commentId:i},headers:{"X-HTTP-Method-Override":"DELETE"}});case 1:r=Array.isArray(t.comments)?t.comments.filter(e=>String(e.id)!==String(n.id)):[],W(mM(mM({},t),{},{comments:r})),T(!1),A("Comment deleted successfully!","success"),e.n=3;break;case 2:e.p=2,console.error(e.v),T(!1),A("Failed to delete comment, please try again");case 3:return e.a(2)}},e,null,[[0,2]])}));return function(n){return e.apply(this,arguments)}}(),J=e=>{var n,r=e.data,o=e.depth,i=void 0===o?0:o,l=U(r.author),s=l&&!1===l.active,c=l?"".concat(l.contact.firstName," ").concat(l.contact.lastName):r.author,d=s?"".concat(c," (Inactive)"):c,m=l?"".concat(l.contact.firstName[0]).concat(l.contact.lastName[0]).toUpperCase():"NA";return(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsxs)(i6.Column,{span:12,customCSS:{marginLeft:"".concat(40*i,"px")},children:[(0,iQ.jsxs)(fJ,{children:[(0,iQ.jsx)(fK,{children:m}),(0,iQ.jsxs)(fX,{children:[(0,iQ.jsxs)(fZ,{children:[(0,iQ.jsxs)(fY,{children:[(0,iQ.jsx)(fQ,{children:d}),(0,iQ.jsx)(f0,{children:r.date})]}),B(r.text)]}),u&&a!==aS.ADMIN&&(0,iQ.jsxs)(iQ.Fragment,{children:[i<3&&(0,iQ.jsx)(f1,{onClick:()=>j(r.id),children:"Reply"}),(null==r?void 0:r.author)&&(null==u?void 0:u.id)&&String(r.author)===String(u.id)&&(0,iQ.jsx)(f1,{onClick:()=>X(r),children:"Delete"})]}),u&&i<3&&b===r.id&&(0,iQ.jsx)(mT,{parentId:r.id,initialText:"",onCancel:()=>{j(null)},onSubmit:e=>{q(r,e)},users:f,currentUserType:p,projectClientId:null==(n=t)?void 0:n.clientId,userInitials:m,fullName:d,currentUser:u},"reply-".concat(r.id))]})]}),r.replies.map(e=>(0,iQ.jsx)(J,{data:e,depth:i+1},e.id))]})})},X=e=>{E({title:"Confirm Comment Deletion",content:"Are you sure you want to delete comment? This action cannot be undone.",backBtnText:"Cancel",submitBtnText:"Delete",hasCloseButton:!0,hasNotification:!1,onClose:()=>T(!1),backHandler:()=>T(!1),submitHandler:()=>K(e)}),T(!0)},$=H(y);return(0,iQ.jsxs)(iQ.Fragment,{children:[N&&(0,iQ.jsx)(i6.ToastBar,{onClose:()=>D(null),variant:N.variant,children:N.message}),(0,iQ.jsxs)(i6.Column,{span:12,customCSS:"overflow-x:auto",children:[(0,iQ.jsx)(p9,{children:"Comments"}),(0,iQ.jsx)(fe,{children:"Discuss project details with clients and team members."}),u&&a!==aS.ADMIN&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(fJ,{children:[(0,iQ.jsx)(fK,{children:(()=>{var e,n;return null!=u&&null!=(e=u.contact)&&e.firstName&&null!=u&&null!=(n=u.contact)&&n.lastName?"".concat(u.contact.firstName[0]).concat(u.contact.lastName[0]).toUpperCase():"JD"})()}),(0,iQ.jsxs)(fX,{style:{position:"relative"},children:[(0,iQ.jsx)(mt,{children:(0,iQ.jsx)(i6.TextArea,{ref:M.textareaRef,placeholder:"Add a comment...",customCSS:"width:100%;",value:C,onChange:(e,n)=>{var t,r,o,i,a,l=null!=(t=null!=(r=null==e||null==(o=e.target)?void 0:o.value)?r:n)?t:"",s=null!=(i=null==e||null==(a=e.target)?void 0:a.selectionStart)?i:l.length;_(l),M.handleTextChange(l,s,null==e?void 0:e.target,{skipPropagate:!0})},onKeyDown:e=>{M.handleKeyDown(e),"Enter"!==e.key||M.mentionState.isActive||e.shiftKey||(e.preventDefault(),G())},height:75})}),M.mentionState.isActive&&(0,iZ.createPortal)((0,iQ.jsx)(mP,{users:M.matchingUsers,query:M.mentionState.query,position:M.mentionState.position,isVisible:M.mentionState.isActive,selectedIndex:M.mentionState.selectedIndex,onSelectUser:M.selectUser,onClose:M.closeMention,onHoverIndex:M.handleHoverIndex}),document.body)]})]}),(0,iQ.jsx)(f$,{children:(0,iQ.jsx)(f5,{children:(0,iQ.jsx)(ai,{size:"sm",label:"Post Comment",customCSS:"width:150px;",onClick:G})})})]}),$.length>0?$.map(e=>(0,iQ.jsx)(J,{data:e},e.id)):(0,iQ.jsx)("div",{style:{marginTop:"16px",color:"#6b7280",fontStyle:"italic"},children:(0,iQ.jsxs)(fe,{children:["No comments yet."," ",u?"Be the first to comment!":"Log in to add a comment."]})})]}),(0,iQ.jsx)(ug,{isOpen:O,modalData:I})]})};var mB=t(3153);
1function mU(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return mV(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?mV(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mV(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let mH=e=>{var n,t,r,o,i=e.project,a=e.onViewProjectPage,l=e.handleEditProject,s=e.handleProjectDrawer,c=e.openJobDrawer,u=e.handleProjectFiles,d=e.viewMode,p=e.viewportOffset,f=e.config,m=mU((0,iq.useState)(!1),2),h=m[0],g=m[1],y=(0,iq.useRef)(null),v=mU((0,iq.useState)(!1),2),x=v[0],b=v[1],j=(e,n)=>{e.preventDefault(),e.stopPropagation(),g(n)},w=e=>({seqId:(0,mB.A)(),fileName:e.name,fileSize:ds(e.size),fileObj:e}),C=(e,n,t)=>{var r,o=(null==f?void 0:f.maxFileSize)||0x6400000,a=(null==f?void 0:f.maxUploadFileLimit)||15,l=!aH(e.name),s=e.size>o,c=((null==i||null==(r=i.projectFiles)?void 0:r.length)||0)+t>a;return!(l||s||c)},_=e=>{if(e){var n=Array.from(e);if(n.some((e,t)=>!C(e,t,n.length)))return void b(!0);b(!1),u(n.map(w),i)}},S=e=>{_(e.target.files),e.target.value=""},I="Cancelled"!==i.status&&d!==aS.PRINTER,E=(d===aS.BROKER||d===aS.DEVELOPER||d===aS.ADMIN)&&(i.status===aw.Draft||i.status===aw.Intake||i.status===aw.Review||i.status===aw.Production);return(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(i6.Row,{customCSS:{padding:"20px 20px 0px 20px"},children:[(0,iQ.jsx)(i6.Column,{span:i.status===aw.Draft||i.status===aw.Cancelled?6:12,customCSS:{margin:"auto"},children:(0,iQ.jsxs)(p8,{children:[(0,iQ.jsx)(p9,{pointer:!0,onClick:()=>a(i),children:i.name}),"Cancelled"!==i.status&&(d===aS.BROKER||d===aS.DEVELOPER||d===aS.ADMIN)&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"text",onClick:()=>s(i),customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"edit",color:"black"})}),E&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",onClick:()=>c(!0),customCSS:{margin:"0px",borderRadius:"50%",border:"1px solid rgb(229, 231, 235)"},children:(0,iQ.jsx)(i6.Icon,{name:"plus",color:"black"})})]})}),(0,iQ.jsxs)(i6.Column,{span:6*(i.status===aw.Draft||i.status===aw.Cancelled),customCSS:{margin:"auto",textAlign:"end"},children:["Draft"===i.status&&(d===aS.BROKER||d===aS.DEVELOPER||d===aS.ADMIN)&&(0,iQ.jsx)(ai,{size:"sm",label:"Publish Project",onClick:()=>l(i,aR.PUBLISH),icon:"upload",customCSS:{width:"auto",borderRadius:"5px"}}),"Cancelled"===i.status&&(d===aS.BROKER||d===aS.DEVELOPER||d===aS.ADMIN)&&(0,iQ.jsx)(ai,{size:"sm",label:"Restore Project",onClick:()=>l(i,aR.RESTORE),icon:"return",customCSS:{width:"auto",borderRadius:"5px"}})]}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto",marginTop:"8px"},children:(0,iQ.jsx)(fe,{children:i.description})}),"Cancelled"===i.status&&(d===aS.BROKER||d===aS.DEVELOPER||d===aS.ADMIN)&&(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto"},children:(0,iQ.jsx)(i6.NotificationBubble,{maxWidth:!0,variant:"failure",textSize:"md",isCustomIcon:!0,customCSS:"margin-top: 14px;padding: 10px;",children:"This project is cancelled."})}),"Cancelled"!==i.status&&"Draft"!==i.status&&(d===aS.BROKER||d===aS.DEVELOPER||d===aS.ADMIN)&&(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto"},children:(0,iQ.jsx)(i6.ProgressIndicator,{version:"2",fontSize:"12px",progressSteps:aG,customCSS:"margin: 20px 0 0 0; width: 100%",selectedStep:(e=>{var n=aG.indexOf(e);return -1!==n?n+1:-1})(i.status)})}),(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(fW,{})})]}),(0,iQ.jsxs)(i6.Row,{customCSS:{padding:"0px 20px 20px 20px",overflowY:"auto",maxHeight:p?"calc(50vh - ".concat(p,"px)"):"calc(100vh - 250px)"},children:[x&&(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto"},children:(0,iQ.jsx)(i6.NotificationBubble,{maxWidth:!0,variant:"failure",textSize:"md",isCustomIcon:!0,customCSS:"margin-top: 14px;padding: 10px;",children:"The file you uploaded doesn't meet our requirements. Please ensure that the file is no larger than ".concat(ds((null==f?void 0:f.maxFileSize)||0x6400000),", is one of the supported file formats and does not exceed ").concat((null==f?void 0:f.maxUploadFileLimit)||15," files total.")})}),(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsxs)(fA,{children:[I&&(0,iQ.jsxs)(fM,{children:[(0,iQ.jsx)(fU,{type:"file",ref:y,onChange:e=>S(e),multiple:!0,"aria-hidden":"true"}),(0,iQ.jsxs)(fF,{onDragEnter:e=>j(e,!0),onDragOver:e=>j(e,!0),onDragLeave:e=>j(e,!1),onDrop:e=>{j(e,!1),_(e.dataTransfer.files)},onClick:()=>{var e;null==(e=y.current)||e.click()},isDragging:h,"aria-label":"File upload dropzone",children:[(0,iQ.jsxs)(fz,{children:[(0,iQ.jsx)(fL,{children:"Click to upload"})," or drag and drop"]}),(0,iQ.jsx)(fB,{children:"Files should be no larger than 100 MB."}),(0,iQ.jsx)(fB,{children:"We support the following file formats: ".concat(aV.join(","))})]})]}),(0,iQ.jsx)(fM,{children:(0,iQ.jsxs)(i6.Card,{customCSS:"\n display: flex;\n height: 112px;\n align-items: center;\n justify-content: space-around;\n","aria-label":"View and manage ".concat((null==i||null==(n=i.files)?void 0:n.length)||0," client files and ").concat((null==i||null==(t=i.printJobs)?void 0:t.length)||0," print jobs for project ").concat(i.name),onClick:()=>
1a(i),isClickable:!0,children:[(0,iQ.jsxs)(fV,{children:[(0,iQ.jsx)(fG,{children:(null==i||null==(r=i.projectFiles)?void 0:r.length)||0}),(0,iQ.jsx)(fq,{children:"Client Files"})]}),(0,iQ.jsx)(fH,{}),(0,iQ.jsxs)(fV,{children:[(0,iQ.jsx)(fG,{children:(null==i||null==(o=i.jobs)?void 0:o.length)||0}),(0,iQ.jsx)(fq,{children:"Print Jobs"})]})]})})]})}),(0,iQ.jsx)(mL,{project:i,viewMode:d})]})]})};function mW(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return mG(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?mG(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mG(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let mq=e=>{var n=e.size,t=e.clients,r=e.clientNameLookup,o=e.onViewProjectPage,i=e.projects,a=e.openJobDrawer,l=e.selectedProjectId,s=e.setSelectedProjectId,c=e.handleProjectDrawer,u=e.handleEditProject,d=e.handleProjectFiles,p=e.showProjectDetailsDrawer,f=e.activeFilters,m=e.viewMode,h=e.config,g=mW((0,iq.useState)(!1),2),y=g[0],v=g[1],x=mW((0,iq.useState)({message:"",type:""}),2),b=x[0],j=x[1],w=(0,iq.useRef)(),C=e=>{e?w.current&&w.current.open():w.current&&w.current.close()},_=(0,iq.useMemo)(()=>null==i?void 0:i.find(e=>e.projectId===l),[i,l]);(0,iq.useEffect)(()=>{p?C(!0):C(!1)},[p,_]);var S=()=>_?(0,iQ.jsx)(mH,{project:_,onViewProjectPage:o,handleEditProject:u,handleProjectDrawer:c,openJobDrawer:a,handleProjectFiles:d,viewMode:m,config:h}):(0,iQ.jsx)(lX,{children:(0,iQ.jsxs)(l$,{children:[(0,iQ.jsx)(lZ,{children:(0,iQ.jsx)(i6.Icon,{block:!0,color:"#e5e7eb",name:"weekly-ad"})}),(0,iQ.jsx)("div",{children:"Select a project to view its details and files."})]})});return(0,iQ.jsxs)(iQ.Fragment,{children:[y&&b&&(0,iQ.jsx)(i6.ToastBar,{onClose:()=>{v(!1),j(null)},variant:null==b?void 0:b.type,children:null==b?void 0:b.message}),(0,iQ.jsxs)(i6.Container,{customCSS:"max-width: none;overflow-y: auto;",children:[m!==aS.CLIENT&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(lH,{children:(0,iQ.jsx)(lE,{items:[{label:"Dashboard",link:"./easyprint?action=dashboard"},{label:"All Projects"}]})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:0},children:(0,iQ.jsx)(i6.Card,{customCSS:{padding:0},isClickable:!1,isHover:!1,children:(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{span:"lg"===n?5:12,customCSS:"lg"===n?{margin:"0",borderRight:"1px solid rgb(229, 231, 235)"}:{margin:"auto 0"},children:(0,iQ.jsx)(p2,{size:n,clients:t,clientNameLookup:r,projects:i,onViewProjectPage:o,viewMode:m,onSelectProject:s,handleProjectDrawer:c,selectedProjectId:l,openProjectDetailsDrawer:C,activeFilters:f})}),(0,iQ.jsx)(i6.Column,{span:7*("lg"===n),customCSS:{margin:"0"},children:"lg"===n?S():l?(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsxs)(i6.Drawer,{ref:w,centerTitle:!1,size:l?"md":"sm",onClose:()=>{},children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsx)(i6.Drawer.Close,{}),(0,iQ.jsx)(i6.Drawer.Body,{customCSS:"padding:0;",children:S()}),(0,iQ.jsx)(i6.Drawer.Footer,{})]})]})}):(0,iQ.jsx)(iQ.Fragment,{})})]})})})})]})]})};var mK=e=>{if(!e)return"";var n=new Date(e);if(Number.isNaN(n.getTime()))return"";var t=new Date-n,r=Math.floor(t/6e4),o=Math.floor(t/36e5),i=Math.floor(t/864e5);return r<1?"Just now":r<60?"".concat(r," min").concat(r>1?"s":""," ago"):o<24?"".concat(o," hour").concat(o>1?"s":""," ago"):i<=3?"".concat(i," day").concat(i>
11?"s":""," ago"):n.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})},mJ=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("admin"===String((null==t?void 0:t.userType)||"").toLowerCase())return aE;var r=(null==t||null==(e=t.contact)?void 0:e.firstName)||"",o=(null==t||null==(n=t.contact)?void 0:n.lastName)||"";return"".concat(r," ").concat(o).trim()||aP},mX=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t={},r={},o={};return(Array.isArray(n)?n:[]).forEach(e=>{var n=null==e?void 0:e.id;null!=n&&(r[String(n)]=mJ(e))}),(Array.isArray(e)?e:[]).forEach(e=>{null!=e&&e.projectId&&null!=e&&e.name&&(t[String(e.projectId)]=e.name),Array.isArray(null==e?void 0:e.jobs)&&e.jobs.forEach(e=>{null!=e&&e.jobId&&null!=e&&e.jobName&&(o[String(e.jobId)]=e.jobName)})}),{projectNames:t,userNames:r,jobNames:o}},m$=e=>'"'.concat(e,'"'),mZ=function(){var e,n,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r,a=o.projectNames,l=void 0===a?{}:a,s=o.userNames,c=void 0===s?{}:s,u=o.jobNames,d=void 0===u?{}:u;return{message:i=i.replace(/~([UPJ])-([^~]+)~/g,(r,o,i)=>{"U"!==o||n||(n=i),"P"!==o||e||(e=i),"J"!==o||t||(t=i);var a=String(i);return"U"===o?c[a]||aP:"P"===o?l[a]?m$(l[a]):'"Cancelled Project"':"J"===o?d[a]?m$(d[a]):'"deleted Job"':r}),projectId:e,projectName:e?l[String(e)]||"Cancelled Project":void 0,userId:n,jobId:t}},mY=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?e.map(e=>{var t,r=null==e?void 0:e.createTs,o=r?new Date(r).toISOString():null,i=mZ((null==e?void 0:e.description)||"",n);return{notificationId:null==e?void 0:e.id,message:i.message||"",projectId:i.projectId,projectName:i.projectName,userId:i.userId,jobId:i.jobId,timestamp:o,isRead:null!=(t=null==e?void 0:e.read)&&t,isUserNotification:null==e?void 0:e.isUserNotification,raw:e}}).filter(e=>null!=e.notificationId):[]},mQ=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&0!==e.length?mY(e,n):[]},m0=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(r=>{var o,i=t.duration,a=void 0===i?1e3:i,l=t.offset,s=void 0===l?20:l;if(!e)return void r(!1);var c=n===window?window.scrollY:n.scrollTop;if(n===window)o=e.getBoundingClientRect().top+window.scrollY-s;else{var u=n.getBoundingClientRect(),d=e.getBoundingClientRect();o=n.scrollTop+(d.top-u.top)-s}var p=o-c;if(0===p)return void r(!0);var f=performance.now(),m=e=>e<.5?2*e*e:-1+(4-2*e)*e,h=e=>{try{var t=Math.min((e-f)/a,1),o=m(t),i=c+p*o;n===window?window.scrollTo(0,i):n.scrollTop=i,t<1?requestAnimationFrame(h):r(!0)}catch(e){r(!1)}};requestAnimationFrame(h)})},m1=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return window;if(n&&e.closest('[style*="overflow"]')===n)return n;for(var t=e.parentElement;t;){if(t.scrollHeight>t.clientHeight&&("auto"===t.style.overflowY||"scroll"===t.style.overflowY||"auto"===window.getComputedStyle(t).overflowY||"scroll"===window.getComputedStyle(t).overflowY))return t;t=t.parentElement}return e.closest('[style*="overflow"]')||window};function m2(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n gap: 0;\n background-color: ",";\n border-radius: 0;\n overflow-y: auto;\n overflow-x: hidden;\n flex: 1 1 auto;\n"]);return m2=function(){return e},e}function m6(){var e=(0,i5._)(["\n display: flex;\n align-items: flex-start;\n padding: 20px;\n border-bottom: 1px solid ",";\n background-color: ",";\n cursor: ",";\n transition: background-color 0.2s ease;\n \n &:hover {\n background-color: ",";\n }\n\n &:last-child {\n border-bottom: none;\n }\n"]);return m6=function(){return e},e}function m5(){var e=(0,i5._)(["\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin-right: 12px;\n position: relative;
1\n \n svg {\n width: 20px;\n height: 20px;\n color: ",";\n }\n \n span {\n font-size: 14px;\n font-weight: 600;\n color: ",";\n text-transform: uppercase;\n }\n"]);return m5=function(){return e},e}function m4(){var e=(0,i5._)(["\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: ",";\n margin-right: 12px;\n margin-top: 4px;\n flex-shrink: 0;\n opacity: ",";\n"]);return m4=function(){return e},e}function m3(){var e=(0,i5._)(["\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 0;\n"]);return m3=function(){return e},e}function m8(){var e=(0,i5._)(["\n font-size: 14px;\n line-height: 1.5;\n color: ",";\n"]);return m8=function(){return e},e}function m9(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 6px;\n font-size: 12px;\n color: ",";\n"]);return m9=function(){return e},e}function m7(){var e=(0,i5._)(["\n display: inline-flex;\n align-items: center;\n gap: 6px;\n"]);return m7=function(){return e},e}function he(){var e=(0,i5._)(["\n color: ",';\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: text-decoration 0.2s ease;\n \n &:hover {\n text-decoration: underline;\n }\n \n &[aria-disabled="true"] {\n cursor: default;\n color: ',";\n \n &:hover {\n text-decoration: none;\n }\n }\n"]);return he=function(){return e},e}function hn(){var e=(0,i5._)(["\n color: ",";\n"]);return hn=function(){return e},e}function ht(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 60px 20px;\n gap: 6px;\n flex: 1;\n min-height: 400px;\n"]);return ht=function(){return e},e}function hr(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0;\n padding: 0;\n line-height: 1;\n \n svg {\n width: 100px;\n height: 100px;\n display: block;\n margin: 0;\n padding: 0;\n }\n"]);return hr=function(){return e},e}function ho(){var e=(0,i5._)(["\n font-size: 20px;\n font-weight: 600;\n color: ",";\n margin: 0;\n"]);return ho=function(){return e},e}function hi(){var e=(0,i5._)(["\n font-size: 14px;\n color: ",";\n margin: 0;\n text-align: center;\n max-width: 400px;\n"]);return hi=function(){return e},e}function ha(){var e=(0,i5._)(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding: 12px;\n background-color: ",";\n margin-top: 8px;\n flex-shrink: 0;\n"]);return ha=function(){return e},e}function hl(){var e=(0,i5._)(["\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: 14px;\n color: ",";\n font-weight: 500;\n text-decoration: none;\n transition: color 0.2s ease;\n outline: none;\n \n &:hover {\n color: ",";\n text-decoration: underline;\n }\n \n &:focus {\n outline: none;\n }\n \n &:active {\n outline: none;\n }\n \n &:disabled {\n opacity: 0;\n cursor: default;\n pointer-events: none;\n }\n"]);return hl=function(){return e},e}function hs(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 8px 12px;\n border: 1px solid ",";\n border-radius: 4px;\n background-color: ",";\n color: ",";\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s ease;\n \n &:hover:not(:disabled) {\n background-color: ",";\n border-color: ",";\n }\n \n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"]);return hs=function(){return e},e}function hc(){var e=(0,i5._)(["\n font-size: 14px;\n color: ",";\n padding: 0 12px;\n"]);return hc=function(){return e},e}function hu(){var e=(0,i5._)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 12px;\n padding: 20px;\n background-color: ",";\n border-bottom: 1px solid ",";\n \n svg {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n margin-top: 2px;\n color: ",";\n }\n \n > div {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n"]);return hu=function(){return e},e}function hd(){var e=(0,i5._)(["\n font-size: 18px;\n font-weight: 600;\n color: ",";\n margin: 0;\n padding: 0;\n"]);return hd=function(){return e},e}function hp(){var e=(0,i5._)(["\n font-size: 14px;\n color: ",";\n font-weight: 400;\n padding: 0;\n background-color: transparent;\n border-bottom: none;\n box-shadow: none;\n margin: 0;\n"]);return hp=function(){return e},e}function hf(){var e=(0,i5._)(["\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 40px;\n"]);return hf=function(){return e},e}var hm=i4.default.div.withConfig({displayName:"NotificationsPage.styles__NotificationsContainer",componentId:"sc-b76f1ea9-0"})(n1||(n1=m2()),i3.colors.white),hh=i4.default.div.withConfig({displayName:"NotificationsPage.styles__NotificationItem",componentId:"sc-b76f1ea9-1"})(n2||(n2=m6()),i3.colors.light_gray_1,e=>e.isRead?"".concat(i3.colors.white):"".concat(i3.colors.alice_blue),e=>e.isRead?"default":"pointer",e=>e.isRead?"".concat(i3.colors.white):"".concat(i3.colors.light_blue));i4.default.div.withConfig({displayName:"NotificationsPage.styles__NotificationAvatar",componentId:"sc-b76f1ea9-2"})(n6||(n6=m5()),e=>e.bgColor||"linear-gradient(135deg, ".concat(i3.colors.staples_blue," 0%, ").concat(i3.colors.ink_violet," 100%)"),i3.colors.white,i3.colors.white);var hg=i4.default.div.withConfig({displayName:"NotificationsPage.styles__UnreadIndicator",componentId:"sc-b76f1ea9-3"})(n5||(n5=m4()),e=>e.isRead?i3.colors.dark_gray_2:i8.extend.colors.brand[600],e=>e.isRead?.6:1),hy=i4.default.div.withConfig({displayName:"NotificationsPage.styles__NotificationContent",componentId:"sc-b76f1ea9-4"})(n4||(n4=m3())),hv=i4.default.div.withConfig({displayName:"NotificationsPage.styles__NotificationMessage",componentId:"sc-b76f1ea9-5"})(n3||(n3=m8()),i3.colors.dark_gray_1),hx=i4.default.div.withConfig({displayName:"NotificationsPage.styles__NotificationMeta",componentId:"sc-b76f1ea9-6"})(n8||(n8=m9()),i3.colors.dark_gray_2),hb=i4.default.div.withConfig({displayName:"NotificationsPage.styles__NotificationMetaRow",componentId:"sc-b76f1ea9-7"})(n9||(n9=m7())),hj=i4.default.span.withConfig({displayName:"NotificationsPage.styles__ProjectLink",componentId:"sc-b76f1ea9-8"})(n7||(n7=he()),i8.extend.colors.brand[600],i3.colors.dark_gray_1),hw=i4.default.span.withConfig({displayName:"NotificationsPage.styles__Timestamp",componentId:"sc-b76f1ea9-9"})(te||(te=hn()),i3.colors.dark_gray_3),hC=i4.default.div.withConfig({displayName:"NotificationsPage.styles__EmptyStateContainer",componentId:"sc-b76f1ea9-10"})(tn||(tn=ht())),h_=i4.default.div.withConfig({displayName:"NotificationsPage.styles__EmptyStateIcon",componentId:"sc-b76f1ea9-11"})(tt||(tt=hr())),hS=i4.default.h3.withConfig({displayName:"NotificationsPage.styles__EmptyStateTitle",componentId:"sc-b76f1ea9-12"})(tr||(tr=ho()),i3.colors.dark_gray_2),hI=i4.default.p.withConfig({displayName:"NotificationsPage.styles__EmptyStateMessage",componentId:"sc-b76f1ea9-13"})(to||(to=hi()),i3.colors.dark_gray_1),hE=i4.default.div.withConfig({displayName:"NotificationsPage.styles__PaginationContainer",componentId:"sc-b76f1ea9-14"})(ti||(ti=ha()),i3.colors.white),hP=i4.default.button.withConfig({displayName:"NotificationsPage.styles__SeeMoreLink",componentId:"sc-b76f1ea9-15"})(ta||(ta=hl()),i8.extend.colors.brand[600],i8.extend.colors.brand[700]);i4.default.button.withConfig({displayName:"NotificationsPage.styles__PaginationButton",componentId:"sc-b76f1ea9-16"})(tl||(tl=hs()),i3.colors.light_gray_2,i3.colors.white,i3.colors.dark_gray_2,i3.colors.light_gray_4,i3.colors.light_gray_1),i4.default.span.withConfig({displayName:"NotificationsPage.styles__PaginationInfo",componentId:"sc-b76f1ea9-17"})(ts||(ts=hc()),i3.colors.dark_gray_1);var hO=i4.default.div.withConfig({displayName:"NotificationsPage.styles__Notifications
1Header",componentId:"sc-b76f1ea9-18"})(tc||(tc=hu()),i3.colors.white,i3.colors.light_gray_1,i3.colors.dark_gray_2),hT=i4.default.h2.withConfig({displayName:"NotificationsPage.styles__NotificationsTitle",componentId:"sc-b76f1ea9-19"})(tu||(tu=hd()),i3.colors.black),hk=i4.default.div.withConfig({displayName:"NotificationsPage.styles__NotificationsSubtitle",componentId:"sc-b76f1ea9-20"})(td||(td=hp()),i3.colors.dark_gray_1),hN=i4.default.div.withConfig({displayName:"NotificationsPage.styles__LoadingContainer",componentId:"sc-b76f1ea9-21"})(tp||(tp=hf())),hD=e=>(0,iQ.jsxs)("svg",{viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,iQ.jsx)("path",{d:"M100 30c-16.569 0-30 13.431-30 30v20.803c0 5.891-2.344 11.538-6.514 15.708L50 110h100l-13.486-13.489A22.195 22.195 0 0 1 130 80.803V60c0-16.569-13.431-30-30-30z",fill:"#E0E7FF",stroke:"#818CF8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,iQ.jsx)("path",{d:"M85 110v5c0 8.284 6.716 15 15 15s15-6.716 15-15v-5",stroke:"#818CF8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,iQ.jsx)("circle",{cx:"140",cy:"60",r:"25",fill:"#10B981",stroke:"white",strokeWidth:"4"}),(0,iQ.jsx)("path",{d:"M130 60l7 7 13-14",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,iQ.jsx)("circle",{cx:"40",cy:"50",r:"4",fill:"#C7D2FE"}),(0,iQ.jsx)("circle",{cx:"160",cy:"120",r:"3",fill:"#C7D2FE"}),(0,iQ.jsx)("circle",{cx:"50",cy:"140",r:"3",fill:"#C7D2FE"})]});function hR(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return hA(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?hA(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hA(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let hM=e=>{var n=e.notifications,t=void 0===n?[]:n,r=e.projects,o=void 0===r?[]:r,i=e.isLoading,a=e.viewMode,l=void 0===a?aS.CLIENT:a,s=e.onMarkAsRead,c=e.onViewProject,u=hR((0,iq.useState)([]),2),d=u[0],p=u[1],f=hR((0,iq.useState)(1),2),m=f[0],h=f[1],g=hR((0,iq.useState)(!1),2),y=g[0],v=g[1];(0,iq.useEffect)(()=>{h(1)},[t]),(0,iq.useEffect)(()=>{var e=t.slice(0,10*m);p(e),v(e.length<t.length)},[t,m]);var x=(0,iq.useCallback)(e=>{s&&"function"==typeof s&&s(e)},[s]),b=e=>{var n=((null==e?void 0:e.message)||"").toLowerCase();return n.includes("job")||n.includes("print")?"print-jobs-section":n.includes("file")||n.includes("upload")||n.includes("document")?"project-files-section":n.includes("comment")||n.includes("feedback")||n.includes("note")?"comments-section":"print-jobs-section"},j=(0,iq.useCallback)((e,n)=>{e.preventDefault(),null!=n&&n.projectId&&o.some(e=>e.projectId===n.projectId)&&c({projectId:n.projectId,scrollTarget:b(n)})},[o]),w=(0,iq.useCallback)(()=>{y&&h(e=>e+1)},[y]);return(0,iQ.jsxs)(lV,{children:[(0,iQ.jsx)(lH,{children:(0,iQ.jsx)(lE,{items:[...l===aS.CLIENT?[{label:"All Projects",link:"./easyprint?action=projects"}]:[{label:"Dashboard",link:"./easyprint?action=dashboard"}],{label:"Notifications"}]})}),(0,iQ.jsxs)(i6.Card,{customCSS:"height: 100%; display: flex; flex-direction: column; overflow: hidden; padding: 0; margin-top: 12px;",isClickable:!1,isHover:!1,children:[(0,iQ.jsxs)(hO,{children:[(0,iQ.jsx)(i6.Icon,{name:"notification-bell",size:12}),(0,iQ.jsxs)("div",{children:[(0,iQ.jsx)(hT,{children:"Notifications"}),(0,iQ.jsx)(hk,{children:"Showing activity from the last 14 days."})]})]}),void 0!==i&&i?(0,iQ.jsx)(hN,{children:(0,iQ.jsx)(i6.Spinner,{size:"lg"})}):0===t.length?(0,iQ.jsxs)(hC,{children:[(0,iQ.jsx)(h_,{children:(0,iQ.jsx)(hD,{})}),(0,iQ.jsx)(hS,{children:"All caught up!"}),(0,iQ.jsx)(hI,{children:"You have no notifications at the moment. We'll notify you when there's important activity on your projects."})]}):(0,iQ.jsxs)(hm,{children:[d.map(e=>{var n=o.some(n=>n.projectId===(null==e?void 0:e.projectId));return(0,iQ.jsxs)(hh,{isRead:e.isRead,onClick:()=>x(e),children:[(0,iQ.jsx)(hg,{isRead:e.isRead}),(0,iQ.jsxs)(hy,{children:[(0,iQ.jsx)(hv,{isRead:e.isRead,children:e.message}),(0,iQ.jsxs)(hx,{children:[(0,iQ.jsxs)(hb,{children:[(0,iQ.jsx)(i6.Icon,{name:"weekly-ad",size:12}),(0,iQ.jsx)("span",{style:{fontSize:"12px",color:i3.colors.dark_gray_1},children:"Project:"}),(0,iQ.jsx)(hj,{onClick:t=>{t.stopPropagation(),n&&j(t,e)},style:n?{cursor:"pointer"}:{color:i3.colors.dark_gray_2,cursor:"default"},"aria-disabled":!n,children:null==e?void 0:e.projectName})]}),(0,iQ.jsx)(hw,{children:mK(e.timestamp)})]})]})]},e.notificationId)}),y&&0!==d.length?(0,iQ.jsx)(hE,{children:(0,iQ.jsx)(hP,{onClick:w,role:"button",tabIndex:0,children:"See more..."})}):null]})]})]})};function hF(){var e=(0,i5._)(["\n display:flex;
1\n align-items:center;\n gap:12px;\n"]);return hF=function(){return e},e}function hz(){var e=(0,i5._)(["\n margin:0;\n font-size: 18px;\n line-height: 28px;\n font-family: ",";\n @media screen and (max-width: ","px) {\n font-size: 18px;\n line-height: 20px;\n }\n"]);return hz=function(){return e},e}function hL(){var e=(0,i5._)(["\n background: transparent;\n border: none;\n color: #999;\n font-size: 18px;\n cursor: pointer;\n padding: 4px;\n line-height: 1;\n\n &:hover {\n color: #333;\n }\n"]);return hL=function(){return e},e}function hB(){var e=(0,i5._)(["\n gap: 6px;\n display: flex;\n flex-direction: column;\n"]);return hB=function(){return e},e}function hU(){var e=(0,i5._)(["\n gap: 8px;\n display: flex;\n align-items: center;\n"]);return hU=function(){return e},e}function hV(){var e=(0,i5._)(["\n font-size: 14px;\n line-height: 20px;\n font-family: ",";\n"]);return hV=function(){return e},e}function hH(){var e=(0,i5._)(["\n font-family: ",";\n"]);return hH=function(){return e},e}function hW(){var e=(0,i5._)(["\n font-size: 16px;\n @media screen and (max-width: ","px) {\n font-size: 14px;\n }\n"]);return hW=function(){return e},e}i4.default.div.withConfig({displayName:"PrinterManagementPage.styles__SubTitleContainer",componentId:"sc-c57a0561-0"})(tf||(tf=hF())),i4.default.h3.withConfig({displayName:"PrinterManagementPage.styles__SubTitle",componentId:"sc-c57a0561-1"})(tm||(tm=hz()),lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm),i4.default.button.withConfig({displayName:"PrinterManagementPage.styles__MenuButton",componentId:"sc-c57a0561-2"})(th||(th=hL()));var hG=i4.default.div.withConfig({displayName:"PrinterManagementPage.styles__PopoverContainer",componentId:"sc-c57a0561-3"})(tg||(tg=hB())),hq=i4.default.div.withConfig({displayName:"PrinterManagementPage.styles__PopoverActionItem",componentId:"sc-c57a0561-4"})(ty||(ty=hU())),hK=i4.default.div.withConfig({displayName:"PrinterManagementPage.styles__PopoverActionItemText",componentId:"sc-c57a0561-5"})(tv||(tv=hV()),lQ.typography.type.motiva),hJ=i4.default.span.withConfig({displayName:"PrinterManagementPage.styles__MotivaBold",componentId:"sc-c57a0561-6"})(tx||(tx=hH()),lQ.typography.type.motiva_bold),hX=i4.default.div.withConfig({displayName:"PrinterManagementPage.styles__ModalPopupContent",componentId:"sc-c57a0561-7"})(tb||(tb=hW()),l0.BREAKPOINTS.xxs),h$=()=>({margin:"0px 0px 20px 0px",flex:"0 0 100% !important",maxWidth:"100% !important"});function hZ(){var e=(0,i5._)(["\n color: ",";\n font-size: 12px;\n line-height: 18px;\n"]);return hZ=function(){return e},e}function hY(){var e=(0,i5._)(["\n font-size: 12px;\n color: #0a3161;\n line-height: 18px;\n"]);return hY=function(){return e},e}function hQ(){var e=(0,i5._)(["\n font-size: 20px;\n line-height: 24px;\n margin: 0;\n padding: 0;\n"]);return hQ=function(){return e},e}function h0(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n text-align: left;\n gap: 5px;\n"]);return h0=function(){return e},e}function h1(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n text-align: left;\n gap: 5px;\n"]);return h1=function(){return e},e}function h2(){var e=(0,i5._)(["\n display: flex;\n justify-content: space-between;\n gap: 40px;\n @media (max-width: 600px) {\n flex-direction: column;\n }\n"]);return h2=function(){return e},e}function h6(){var e=(0,i5._)(["\n flex: 1;\n"]);return h6=function(){return e},e}function h5(){var e=(0,i5._)(["\n font-size: 14px;\n color: #6b7280;\n margin-bottom: 4px;\n"]);return h5=function(){return e},e}function h4(){var e=(0,i5._)(["\n font-size: 16px;\n font-weight: 500;\n margin-bottom: 16px;\n"]);return h4=function(){return e},e}function h3(){var e=(0,i5._)(["\n font-size: 16px;\n font-weight: 500;\n color: #1a73e8;\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n"]);return h3=function(){return e},e}function h8(){var e=(0,i5._)(["\n width: 100%;\n border-top: 1px solid lightgrey;\n margin-top: 7px;\n"]);return h8=function(){return e},e}function h9(){var e=(0,i5._)(["\n font-size: 16px;\n font-weight: 500;\n"]);return h9=function(){return e},e}function h7(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 16px;\n line-height: 20px;\n"]);return h7=function(){return e},e}function ge(){var e=(0,i5._)(["\n font-family: ",";\n color: ",";\n font-size: 16px;\n line-height: 20px;\n"]);return ge=function(){return e},e}function gn(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n line-height: 18px;\n display: flex;\n align-items: center;\n margin: 12px 0;\n justify-content: space-between;\n @media screen and (max-width: ","px) {\n font-size: 12px;\n flex-direction: column;\n gap: 12px;\n }\n"]);return gn=function(){return e},e}function gt(){var e=(0,i5._)(["\n background: ",";\n height: 1px;\n border: none;\n margin: 20px 0px 20px 0px;\n"]);return gt=function(){return e},e}function gr(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n line-height: 24px;\n font-weight: bold;\n margin: 0;\n"]);return gr=function(){return e},e}function go(){var e=(0,i5._)(["\n background: #f9fafb;\n padding: 12px 16px;\n border-radius: 5px;\n border: 1px solid #e5e7eb;\n margin-top: 12px;\n"]);return go=function(){return e},e}function gi(){var e=(0,i5._)(["\n font-family: ",";\n color: ",";\n font-size: 12px;\n line-height: 16px;\n"]);return gi=function(){return e},e}function ga(){var e=(0,i5._)(["\n & input::placeholder,\n & textarea::placeholder {\n color: #4d4d4f !important;\n }\n"]);return ga=function(){return e},e}function gl(){var e=(0,i5._)(["\n color: rgb(229 231 235);\n border: 1px solid;\n margin-bottom: 20px;\n margin-top: 10px;\n"]);return gl=function(){return e},e}function gs(){var e=(0,i5._)(["\n display: flex;\n justify-content: space-evenly;\n"]);return gs=function(){return e},e}function gc(){var e=(0,i5._)(["\n margin: 0px;\n"]);return gc=function(){return e},e}i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__ClientSince",componentId:"sc-259a34e3-0"})(tj||(tj=hZ()),i3.colors.medium_gray_1),i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__ProjectLink",componentId:"sc-259a34e3-1"})(tw||(tw=hY()));var gu=i4.default.h1.withConfig({displayName:"ManagePrinterDrawer.styles__ProjectTitle",componentId:"sc-259a34e3-2"}
1)(tC||(tC=hQ())),gd=i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__DrawerViewHeader",componentId:"sc-259a34e3-3"})(t_||(t_=h0()));i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__DrawerDetailsSection",componentId:"sc-259a34e3-4"})(tS||(tS=h1())),i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__TwoColumnLayout",componentId:"sc-259a34e3-5"})(tI||(tI=h2())),i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__InfoColumn",componentId:"sc-259a34e3-6"})(tE||(tE=h6()));var gp=i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__InfoLabel",componentId:"sc-259a34e3-7"})(tP||(tP=h5()));i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__InfoValue",componentId:"sc-259a34e3-8"})(tO||(tO=h4())),i4.default.a.withConfig({displayName:"ManagePrinterDrawer.styles__EmailLink",componentId:"sc-259a34e3-9"})(tT||(tT=h3())),i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__LineBreak",componentId:"sc-259a34e3-10"})(tk||(tk=h8())),i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__LocationText",componentId:"sc-259a34e3-11"})(tN||(tN=h9())),i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__CheckboxHeading",componentId:"sc-259a34e3-12"})(tD||(tD=h7()),lQ.typography.type.motiva),i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__CheckboxText",componentId:"sc-259a34e3-13"})(tR||(tR=ge()),lQ.typography.type.motiva,i3.colors.medium_gray_1),i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__ContactHeadingContainer",componentId:"sc-259a34e3-14"})(tA||(tA=gn()),lQ.typography.type.motiva,l0.BREAKPOINTS.sm);var gf=i4.default.hr.withConfig({displayName:"ManagePrinterDrawer.styles__Divider",componentId:"sc-259a34e3-15"})(tM||(tM=gt()),i3.colors.light_gray_1),gm=i4.default.h4.withConfig({displayName:"ManagePrinterDrawer.styles__SectionTitle",componentId:"sc-259a34e3-16"})(tF||(tF=gr()),lQ.typography.type.motiva),gh=i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__SectionContainer",componentId:"sc-259a34e3-17"})(tz||(tz=go()));i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__ParentClientContainer",componentId:"sc-259a34e3-18"})(tL||(tL=gi()),lQ.typography.type.motiva,i3.colors.medium_gray_1);var gg=i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__FormInputWrapper",componentId:"sc-259a34e3-19"})(tB||(tB=ga())),gy=i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__DividerGray",componentId:"sc-259a34e3-20"})(tU||(tU=gl()));i4.default.div.withConfig({displayName:"ManagePrinterDrawer.styles__WrapperDiv",componentId:"sc-259a34e3-21"})(tV||(tV=gs()));var gv=i4.default.h3.withConfig({displayName:"ManagePrinterDrawer.styles__SubHeading",componentId:"sc-259a34e3-22"})(tH||(tH=gc()));function gx(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return gb(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gb(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gb(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var gj=e=>{var n,t,r,o,i,a,l,s,c,u=e.details,d=e.viewDetails,p=e.setViewDetails,f=e.showDrawer,m=e.onDrawerClose,h=e.action,g=e.addPrinterHandler,y=e.selectedPrinter,v=(e._parentClients,e.editPrinterHandler),x=e.handleEditPrinter,b=(0,iq.useRef)(),j=(0,iq.useRef)(),w=gx((0,iq.useState)({}),2),C=w[0],_=w[1],S=gx((0,iq.useState)("newContact"),2),I=S[0],E=S[1],P=gx((0,iq.useState)([]),2),O=P[0],T=P[1];(0,iq.useEffect)(()=>
1{if(f){if(b.current&&b.current.open(),h===aN.CREATE)_({primaryUser:"",name:"",firstName:"",lastName:"",role:"",email:"",phone:"",address1:"",address2:"",city:"",state:"",zipCode:"",notes:"",permissions:""});else if(h===aN.EDIT&&y){var e,n,t,r,o,i,a,l,s,c;_({id:null==y?void 0:y.id,primaryUser:(null==y?void 0:y.primaryUser)||"",name:(null==y?void 0:y.name)||"",firstName:(null==y||null==(e=y.primaryContact)?void 0:e.firstName)||"",lastName:(null==y||null==(n=y.primaryContact)?void 0:n.lastName)||"",role:(null==y||null==(t=y.primaryContact)?void 0:t.jobTitle)||"",email:(null==y||null==(r=y.primaryContact)?void 0:r.email)||"",phone:(null==y||null==(o=y.primaryContact)?void 0:o.phone)||"",address1:(null==y||null==(i=y.location)?void 0:i.address1)||"",address2:(null==y||null==(a=y.location)?void 0:a.address2)||"",city:(null==y||null==(l=y.location)?void 0:l.city)||"",state:(null==y||null==(s=y.location)?void 0:s.state)||"",zipCode:(null==y||null==(c=y.location)?void 0:c.zipCode)||"",notes:(null==y?void 0:y.notes)||"",username:null==y?void 0:y.primaryUserName})}}else b.current&&b.current.close()},[f,y,h]),(0,iq.useEffect)(()=>{uK().then(e=>{var n;T((null==e||null==(n=e.data)||null==(n=n.roles)?void 0:n.map(e=>({value:e.id,text:e.name,optionHTML:e.name})))||[])}).catch(e=>{console.log("ERROR ",e)})},[]);var k=()=>{_({}),p(!1),E("newContact"),m&&m()};return(0,iQ.jsxs)(i6.Drawer,{ref:b,centerTitle:!1,size:"lg",onClose:k,children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{customCSS:h==aN.VIEW&&"height: 130px;",children:[(0,iQ.jsx)("div",{}),(()=>{var e=new Date(null==u?void 0:u.creationTs).toLocaleDateString("en-US");return(0,iQ.jsx)(gd,{children:d&&u?(0,iQ.jsxs)(iQ.Fragment,{children:[" ",(0,iQ.jsx)(gu,{children:null==u?void 0:u.name}),(0,iQ.jsxs)(gp,{children:["Vendor since: ",e," "]})]}):(0,iQ.jsx)(gu,{children:h===aN.EDIT?"Edit Printer":"Add New Printer"})})})(),(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{children:(0,iQ.jsx)(gg,{children:u&&d?(0,iQ.jsxs)(iQ.Fragment,{children:[" ",(0,iQ.jsx)(gv,{children:"Primary Information"}),(0,iQ.jsx)(gy,{}),(0,iQ.jsxs)(i6.Card,{padding:"sm",isClickable:!1,customCSS:"border-radius:10px; background-color:#f9fafb; margin-bottom:15px;",isHover:!1,children:[(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsxs)(i6.Column,{spanXS:6,spanSM:6,spanMD:6,spanLG:6,gap:12,children:[(0,iQ.jsx)(gp,{children:"Primary Contact"}),null==u||null==(n=u.primaryContact)?void 0:n.firstName," ",null==u||null==(t=u.primaryContact)?void 0:t.lastName]}),(0,iQ.jsxs)(i6.Column,{spanXS:6,spanSM:6,spanMD:6,spanLG:6,children:[(0,iQ.jsx)(gp,{children:"Primary Contact Role "}),null==u||null==(r=u.primaryContact)?void 0:r.role]})]}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsxs)(i6.Column,{spanXS:6,spanSM:6,spanMD:6,spanLG:6,gap:12,children:[(0,iQ.jsx)(gp,{children:"Primary Contact Phone"}),null==u||null==(o=u.primaryContact)?void 0:o.phone]}),(0,iQ.jsxs)(i6.Column,{spanXS:6,spanSM:6,spanMD:6,spanLG:6,children:[(0,iQ.jsx)(gp,{children:" Primary Contact Email "}),null==u||null==(i=u.primaryContact)?void 0:i.email]})," "]})]}),(0,iQ.jsx)(gv,{children:"Location"}),(0,iQ.jsx)(gy,{}),(0,iQ.jsx)(i6.Card,{padding:"sm",isClickable:!1,customCSS:"border-radius:10px; background-color:#f9fafb; margin-bottom:15px;",isHover:!1,children:(0,iQ.jsx)(i6.Row,{gap:"10px",children:(0,iQ.jsxs)(i6.Column,{spanXS:6,spanSM:6,spanMD:6,spanLG:6,children:[(0,iQ.jsx)("div",{children:null==u||null==(a=u.location)?void 0:a.address1}),(0,iQ.jsxs)("div",{children:[" ",null==u||null==(l=u.location)?void 0:l.city,",",null==u||null==(s=u.location)?void 0:s.state," ",null==u||null==(c=u.location)?void 0:c.zipCode]})]})})}),(null==u?void 0:u.notes)&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(gv,{children:"Notes"}),(0,iQ.jsx)(gy,{}),(0,iQ.jsx)(i6.Card,{padding:"sm",isClickable:!1,customCSS:"border-radius:10px; background-color:#f9fafb; margin-bottom:15px;",isHover:!1,children:(0,iQ.jsx)(gp,{children:null==u?void 0:u.notes})})]})]}):(0,iQ.jsxs)(i6.FormikWrapper,{initialValues:C,onSubmit:e=>{h===aN.EDIT&&y?v(y.id,e):g(e),k()},callbackFnToFormikRef:e=>{j.current=e},enableReinitialize:!0,validationSchema:dP,children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"name",component:i6.TextInput,label:"Printer Name",placeholder:"Enter printer name",isRequired:!0,ariaLabel:"printer name"})})}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"firstName",component:i6.TextInput,label:"Primary Contact First Name",maxLength:15,disabled:h===aN.EDIT&&"useExisting"===I,placeholder:h===aN.EDIT&&"useExisting"===I?"Choose user":"Enter first name",isRequired:h===aN.CREATE||h===aN.EDIT&&"newContact"===I,ariaLabel:"first name"})}),(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"lastName",component:i6.TextInput,label:"Primary Contact Last Name",maxLength:20,disabled:h===aN.EDIT&&"useExisting"===I,placeholder:h===aN.EDIT&&"useExisting"===I?"Choose user":"Enter last name",isRequired:h===aN.CREATE||h===aN.EDIT&&"newContact"===I,ariaLabel:"last name"})})]}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,label:"Primary Contact Role",placeholder:"Select role",width:"100%",customCSS:"width: 100%; margin-top: 3px;",name:"role",isRequired:!0,options:O})}),(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"phone",component:i6.TextInput,label:"Primary Contact Phone",disabled:h===aN.EDIT&&"useExisting"===I,placeholder:h===aN.EDIT&&"useExisting"===I?"Choose user":"Enter phone",isRequired:!0,type:"phone",ariaLabel:"Phone"})})]}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"email",component:i6.TextInput,label:"Primary Contact Email",disabled:h===aN.EDIT,placeholder:"Enter Email",isRequired:!0,type:"email",ariaLabel:"Email"})})}),(0,iQ.jsx)(gf,{}),(0,iQ.jsx)(gm,{children:"Location"}),(0,iQ.jsxs)(gh,{children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"address1",component:i6.LocationSearchInput,label:"Address 1",placeholder:"Enter address 1",isRequired:!0,ariaLabel:"address 1",fieldsToPopulate:["zipCode","city","state"]})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"address2",component:i6.TextInput,label:"Address 2",placeholder:"Enter address 2",isRequired:!1,ariaLabel:"address 2"})})}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"city",component:i6.TextInput,label:"City",placeholder:"Enter city",isRequired:!0,ariaLabel:"city"})}),(0,iQ.jsx)(i6.Column,{spanLG:3,spanMD:3,spanSM:3,spanXS:6,children:(0,iQ.jsx)(i6.FormikElement,{name:"state",component:i6.Dropdown,label:"State",isRequired:!0,options:aF,customCSS:"width: 100%; margin-top: 3px; background: white;",ariaLabel:"state",width:"100%"})}),(0,iQ.jsx)(i6.Column,{spanLG:3,spanMD:3,spanSM:3,spanXS:6,children:(0,iQ.jsx)(i6.FormikElement,{name:"zipCode",component:i6.TextInput,label:"Zip Code",placeholder:"Enter zip code",isRequired:!0,type:"text",validate:e=>{var n=e&&e.trim().length>0?e.trim():null;if(n&&(!new RegExp(/^[0-9]{5}$|[0-9]{5}[-][0-9]{4}$/).test(n)||n.length<5))return"Invalid ZIP code"},fieldsToPopulate:["city","state"],maxLength:10,ariaLabel:"zip code"})})]})]}),(0,iQ.jsx)(gf,{}),(0,iQ.jsx)(gm,{children:"Notes"}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.TextArea,placeholder:"Add any relevant notes for this printer",label:"",isRequired:!1,maxLength:1e3,name:"notes",customCSS:"width: 100%;",height:115})}),(0,iQ.jsx)(i6.Column,{spanLG:2,spanMD:2,spanSM:2,spanXS:0})]})]})})}),(0,iQ.jsxs)(i6.Drawer.Footer,{children:[(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:m,customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Cancel"}),(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"100%","border-radius":"5px"},onClick:()=>
1h===aN.VIEW?x(y):j.current&&j.current.submitForm(),children:h===aN.VIEW?"Edit Printer":h===aN.EDIT?"Save & Close":"Add Printer"})]})]})]})};function gw(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function gC(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?gw(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gw(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function g_(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return gS(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gS(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gS(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let gI=e=>{var n=e.size,t=e.printers,r=e.handlePrinters,o=e.handleUpdateUsers,i=g_((0,iq.useState)(t),2),a=i[0],l=i[1],s=g_((0,iq.useState)(""),2),c=s[0],u=s[1],d=g_((0,iq.useState)(!1),2),p=d[0],f=d[1],m=g_((0,iq.useState)(!1),2),h=m[0],g=m[1],y=g_((0,iq.useState)(null),2),v=y[0],x=y[1],b=g_((0,iq.useState)(null),2),j=b[0],w=b[1],C=g_((0,iq.useState)({}),2),_=C[0],S=C[1],I=g_((0,iq.useState)(!1),2),E=I[0],P=I[1],O=g_((0,iq.useState)(null),2),T=O[0],k=O[1],N=g_((0,iq.useState)(!1),2),D=N[0],R=N[1],A=g_((0,iq.useState)({message:"",type:""}),2),M=A[0],F=A[1],z=(0,iY.useSelector)(e=>a8(e)),L=(0,iY.useSelector)(e=>a7(e));(0,iq.useEffect)(()=>{var e=c.toLowerCase();l(t.filter(n=>{var t,r,o=n.name.toLowerCase().includes(e),i="".concat(null==n||null==(t=n.primaryContact)?void 0:t.firstName," ").concat(null==n||null==(r=n.primaryContact)?void 0:r.lastName).toLowerCase().includes(e);return o||i}))},[c,t]);var B=()=>{w(null),x(null),f(!1)},U=e=>{w(aN.EDIT),f(!0),x(e)},V=e=>{k(e),g(!0),x(e),w(aN.VIEW),f(!0)},H=e=>(0,iQ.jsx)(hX,{children:(0,iQ.jsxs)("p",{children:['Are you sure you want to delete "',(0,iQ.jsx)(hJ,{children:e.name}),'"? This action cannot be undone.']})}),W=e=>{var n={title:"Confirm Printer Deletion",content:H(e),backBtnText:"Cancel",submitBtnText:"Delete",hasCloseButton:!0,onClose:()=>{P(!1),S({})},backHandler:()=>{P(!1),S({})},submitHandler:()=>G(e)};S(n),P(!0)},G=e=>{var n=aI.PRINTER;return Promise.all([...(Array.isArray(z)?z.filter(n=>String(null==n?void 0:n.orgId)===(null==e?void 0:e.id)):[]).map(e=>uV(null==e?void 0:e.id,L.code,dh(!1,e))),uW(e.id,n)]).then(()=>{P(!1),F({message:"".concat(e.name," deleted successfully"),type:"success"}),R(!0),r(dC(t,e.id))}).catch(e=>{console.error("ERROR",e),P(!1),F({message:"Error has occurred",type:"failure"}),R(!0)})};return(0,iQ.jsxs)(iQ.Fragment,{children:[D&&M&&(0,iQ.jsx)(i6.ToastBar,{onClose:()=>{R(!1),F(null)},variant:null==M?void 0:M.type,children:null==M?void 0:M.message}),(0,iQ.jsxs)(i6.Container,{customCSS:"max-width: none;overflow-y: auto;",children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(lH,{children:(0,iQ.jsx)(lE,{items:[{label:"Dashboard",link:"./easyprint?action=dashboard"},{label:"Printers"}]})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:0},children:(0,iQ.jsxs)(i6.Card,{customCSS:{padding:0},isClickable:!1,isHover:!1,children:[(0,iQ.jsxs)(i6.Row,{customCSS:"lg"===n?{padding:"20px"}:{padding:"14px"},children:[(0,iQ.jsx)(i6.Column,{span:6,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(cf,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"print",size:24}),(0,iQ.jsx)(cm,{children:"Printers"})]})}),(0,iQ.jsx)(i6.Column,{span:6,customCSS:{textAlign:"end",marginLeft:"6px"},children:(0,iQ.jsx)(ai,{size:"sm",label:"Add Printer",onClick:()=>{w(aN.CREATE),f(!0)},icon:"plus",customCSS:{width:"auto",borderRadius:"5px"}})}),(0,iQ.jsx)(i6.Column,{span:"lg"===n?6:12,customCSS:{margin:0},children:(0,iQ.jsx)(i6.SubSearch,{size:"sm",customCSS:{marginTop:"15p
1x"},placeHolder:"Search by company or contact...",textValue:c,onSearch:e=>{var n;return u(null!=(n=e.target.value)?n:"")},onSelect:e=>{var n;return u(null!=(n=e.target.value)?n:"")},handleChange:e=>{var n;return u(null!=(n=e.target.value)?n:"")},onClearInput:e=>u("")})}),(0,iQ.jsx)(i6.Column,{span:6*("lg"===n),customCSS:{margin:0}})]}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:h$,children:a.length>0?(0,iQ.jsxs)(lW,{children:[(0,iQ.jsx)(lG,{children:(0,iQ.jsxs)("tr",{children:[(0,iQ.jsx)(lq,{children:"Printer"}),(0,iQ.jsx)(lq,{children:"Location"}),(0,iQ.jsx)(lq,{children:"Notifications Contact"}),(0,iQ.jsx)(lq,{children:"Active Projects"}),(0,iQ.jsx)(lq,{})]})}),(0,iQ.jsx)("tbody",{children:a.map(e=>{var n,t,r,o;return(0,iQ.jsxs)(lJ,{children:[(0,iQ.jsxs)(i6.Link,{underline:!1,onClick:()=>V(e),children:[" ",(0,iQ.jsx)(lK,{primary:!0,children:e.name})]}),(0,iQ.jsxs)(lK,{children:[e.location.city,",",e.location.state]}),(0,iQ.jsxs)(lK,{children:[null==e||null==(n=e.primaryContact)?void 0:n.firstName," ",null==e||null==(t=e.primaryContact)?void 0:t.lastName]}),(0,iQ.jsx)(lK,{children:null!=(r=e.projectCount)?r:0}),(0,iQ.jsx)(lK,{children:(0,iQ.jsx)(i6.Popover,{minWidth:212,showCaret:!1,id:e.id,"aria-label":"more",position:"left",triggerElement:(0,iQ.jsx)(i6.Button,{customCSS:"padding:0px; margin:0px;",size:"xs",tabIndex:0,iconOnly:!0,variant:"text",children:(0,iQ.jsx)(i6.Icon,{name:"more-top",color:"black"})}),children:(0,iQ.jsxs)(hG,{children:[(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Edit Printer ".concat(null==e?void 0:e.name),"aria-disabled":"false",onClick:()=>U(e),children:(0,iQ.jsxs)(hq,{children:[(0,iQ.jsx)(i6.Icon,{name:"edit",size:16}),(0,iQ.jsx)(hK,{children:"Edit Printer"})]})}),(null!=(o=e.projectCount)?o:0)===0&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto; ","aria-label":"Delete printer ".concat(null==e?void 0:e.name),"aria-disabled":"false",onClick:()=>{W(e)},children:(0,iQ.jsxs)(hq,{children:[(0,iQ.jsx)(i6.Icon,{name:"delete",size:16}),(0,iQ.jsx)(hK,{children:"Delete Printer"})]})})]})})})]},e.id)})})]}):(0,iQ.jsxs)(cu,{children:[(0,iQ.jsx)(cc,{children:"No printers found"}),(0,iQ.jsx)(cc,{children:c?'Your search for "'.concat(c,'" did not match any printers.'):'Click "Add printer" to get started.'})]})})}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(gj,{viewDetails:h,details:T,setViewDetails:g,action:j,showDrawer:p,selectedPrinter:v,onDrawerClose:B,addPrinterHandler:e=>{var n=aI.PRINTER,i=dp();return uU(df(e,i,a_.ASC,L.code)).then(t=>{var r,o,a=null!=(r=null==t||null==(o=t.data)?void 0:o.user)?r:{},l={id:i,name:e.name,primaryUser:a.id,notes:e.notes,location:{address1:e.address1,address2:e.address2,city:e.city,state:e.state,zipCode:e.zipCode}};return Promise.all([a,uI(n,l)])}).then(e=>{var i=(0,i$._)(e,2),a=i[0];r([...t,gC(gC({},i[1].data),{},{projectCount:0})]),o(gC(gC({},a),{},{type:n}),aD.CREATE),F({message:"Printer added successfully",type:"success"}),R(!0),B()}).catch(e=>{var n,t;console.error("ERROR",e),F({message:(null==e||null==(n=e.response)||null==(n=n.data)||null==(n=n.error)?void 0:n.code)==="USER_ALREADY_EXISTS"?null==e||null==(t=e.response)||null==(t=t.data)||null==(t=t.error)?void 0:t.description:"Error has occurred",type:"failure"}),R(!0),B()})},editPrinterHandler:(e,n)=>{var i,a,l=aI.PRINTER,s={contact:{firstName:n.firstName,lastName:n.lastName,phone:null!=(i=null==n||null==(a=n.phone)?void 0:a.replace(/\D/g,""))?i:"",jobTitle:null==n?void 0:n.role},username:null==n?void 0:n.username};return Promise.all([uV(n.primaryUser,L.code,s),uH(n.id,l,dd(n))]).then(n=>{var i,a,s=(0,i$._)(n,2),c=s[0],u=s[1],d=gC(gC({},null!=(i=null==c||null==(a=c.data)?void 0:a.user)?i:{}),{},{type:l}),p=u.data;F({message:'Printer "'.concat(p.name,'" updated successfully'),type:"success"}),R(!0),r(dw(t,e,p)),o(d,aD.UPDATE),B()}).catch(e=>{console.error("ERROR",e),F({message:"Error has occurred",type:"failure"}),R(!0)})},handleEditPrinter:e=>{g(!1),w(aN.EDIT),x(e)}}),(0,iQ.jsx)(ug,{isOpen:E,modalData:_})]})]})})})]})]})};function gE(){var e=(0,i5._)(["\n position: absolute;\n right: 16px;\n top: 50%;\n transform: translateY(-50%);\n background-color: ",";\n color: white;\n font-size: 11px;\n font-weight: 700;\n border-radius: 10px;\n min-width: 18px;\n height: 18px;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 4px;\n"]);return gE=function(){return e},e}function gP(){var e=(0,i5._)(["\n font-size: 20px;\n line-height: 24px;\n margin: 0;\n padding: 0;\n"]);return gP=function(){return e},e}function gO(){var e=(0,i5._)(["\n padding: 16px;\n border-bottom: 1px solid ",";\n background-color: ",";\n display: flex;\n flex-direction: column;\n"]);return gO=function(){return e},e}function gT(){var e=(0,i5._)(["\n font-weight: 600;\n font-size: 14px;\n font-family: ",";\n"]);return gT=function(){return e},e}function gk(){var e=(0,i5._)(["\n font-size: 14px;\n color: ",";\n"]);return gk=function(){return e},e}function gN(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}var gD=e=>
1({header:{backgroundColor:i8.extend.colors.brand[600],color:"".concat(i3.colors.white),flexShrink:0,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",zIndex:40,display:"lg"===e?"none":"block"},container:{display:"flex",alignItems:"center",justifyContent:"space-between",height:"56px",paddingLeft:"14px",paddingRight:"14px"},leftAlign:{margin:"0px",padding:"0px",borderRadius:"0px",display:"flex",alignItems:"center",gap:"6px",textAlign:"left",backgroundColor:i8.extend.colors.brand[600],"&:hover:not(:active)":{backgroundColor:"".concat(i8.extend.colors.brand["500"])},":active":{backgroundColor:"".concat(i8.extend.colors.brand["500"])},"&:disabled":{backgroundColor:i8.extend.colors.brand[600],opacity:"1",cursor:"not-allowed"},"& svg":{fill:"".concat(i3.colors.white," !important"),opacity:"1"},"& h1":{color:"".concat(i3.colors.white)}},textCompanyName:{fontSize:"15.75px",fontWeight:600,letterSpacing:"-0.01562em"},rightAlign:{borderRadius:"0px",padding:"6px",marginRight:"-6px",backgroundColor:i8.extend.colors.brand[600],"&:hover:not(:active)":{backgroundColor:"".concat(i8.extend.colors.brand["500"])},":active":{backgroundColor:"".concat(i8.extend.colors.brand["500"])}}}),gR=i4.default.span.withConfig({displayName:"MobileHeader.styles__NotificationBadge",componentId:"sc-13fcca53-0"})(tW||(tW=gE()),i3.colors.brand),gA=i4.default.h1.withConfig({displayName:"MobileHeader.styles__Title",componentId:"sc-13fcca53-1"})(tG||(tG=gP())),gM=i4.default.div.withConfig({displayName:"MobileHeader.styles__UserHeader",componentId:"sc-13fcca53-2"})(tq||(tq=gO()),i3.colors.light_gray_1,i3.colors.alice_blue),gF=i4.default.span.withConfig({displayName:"MobileHeader.styles__UserName",componentId:"sc-13fcca53-3"})(tK||(tK=gT()),lQ.typography.type.motiva_bold),gz=i4.default.span.withConfig({displayName:"MobileHeader.styles__UserEmail",componentId:"sc-13fcca53-4"})(tJ||(tJ=gk()),i3.colors.dark_gray_2),gL=e=>(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?gN(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gN(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e})({margin:"0px",justifyContent:"space-between",alignItems:"center",width:"100%",padding:"12px 16px",borderRadius:"0","& svg":{color:"".concat(i3.colors.dark_gray_1)},"& svg path":{fill:"currentColor"}},e);let gB=e=>{var n,t,r,o=e.user,i=e.viewMode,a=e.size,l=e.onNavigate,s=e.companyName,c=e.handleSignOut,u=gD(a),d=(0,iq.useRef)(),p=(0,iY.useSelector)(lr),f=e=>{e?d.current&&d.current.open():d.current&&d.current.close()},m=e=>{f(!1),l(e)};return(0,iq.useEffect)(()=>{"lg"===a&&f(!1)},[a]),(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)("header",{style:u.header,children:(0,iQ.jsxs)("div",{style:u.container,children:[(0,iQ.jsxs)(i6.Button,{onClick:()=>
1m("dashboard"),customCSS:u.leftAlign,disabled:i===aS.CLIENT,"aria-label":"Go to dashboard",children:[(0,iQ.jsx)(i2,{style:{height:"26.25px",width:"31.5px",fill:"#FFFFFF"}}),(0,iQ.jsx)("h1",{style:u.textCompanyName,children:s})]}),(0,iQ.jsx)(i6.Button,{onClick:()=>f(!0),customCSS:u.rightAlign,"aria-label":"Open menu","aria-expanded":!1,children:(0,iQ.jsx)(i6.Icon,{size:24,name:"hamburger"})})]})}),(0,iQ.jsxs)(i6.Drawer,{ref:d,centerTitle:!1,size:"sm",onClose:()=>{},children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{children:[(0,iQ.jsx)(gA,{children:"Menu"}),(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{customCSS:{padding:0},children:(0,iQ.jsxs)(i6.Row,{customCSS:{gap:"14px"},children:[(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsxs)(gM,{children:[(0,iQ.jsxs)(gF,{children:[null==o||null==(n=o.contact)?void 0:n.firstName," ",null==o||null==(t=o.contact)?void 0:t.lastName]}),(0,iQ.jsx)(gz,{children:null==o||null==(r=o.contact)?void 0:r.email})]})}),(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsxs)(i6.Button,{textColor:"dark_gray_1",label:"Notifications",variant:"text",size:"md",customCSS:gL({position:"relative"}),onClick:()=>m("notifications"),children:[(0,iQ.jsx)(i6.Icon,{name:"notification-bell"}),(0,iQ.jsx)("span",{children:"Notifications"}),p>0&&(0,iQ.jsx)(gR,{children:p>99?"99+":p})]})}),(i===aS.BROKER||i===aS.DEVELOPER||i===aS.ADMIN)&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsxs)(i6.Button,{textColor:"dark_gray_1",label:"Clients",variant:"text",size:"md",customCSS:gL(),onClick:()=>m("clients"),children:[(0,iQ.jsx)(i6.Icon,{name:"shared-user"}),(0,iQ.jsx)("span",{children:"Clients"})]})}),(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsxs)(i6.Button,{textColor:"dark_gray_1",label:"Printers",variant:"text",size:"md",customCSS:gL(),onClick:()=>m("printers"),children:[(0,iQ.jsx)(i6.Icon,{name:"print"}),(0,iQ.jsx)("span",{children:"Printers"})]})}),(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsxs)(i6.Button,{textColor:"dark_gray_1",label:"Templates",variant:"text",size:"md",customCSS:gL({"& svg":{transform:"rotate(90deg)"}}),onClick:()=>m("templates"),children:[(0,iQ.jsx)(i6.Icon,{name:"material"}),(0,iQ.jsx)("span",{children:"Templates"})]})})]}),(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsxs)(i6.Button,{textColor:"dark_gray_1",label:"Projects",variant:"text",size:"md",customCSS:gL(),onClick:()=>m("projects"),children:[(0,iQ.jsx)(i6.Icon,{name:"account"}),(0,iQ.jsx)("span",{children:"Projects"})]})}),(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsxs)(i6.Button,{textColor:"dark_gray_1",label:"View Profile",variant:"text",size:"md",customCSS:gL(),onClick:()=>m("profile"),children:[(0,iQ.jsx)(i6.Icon,{name:"account"}),(0,iQ.jsx)("span",{children:"View Profile"})]})}),(i===aS.BROKER||i===aS.DEVELOPER||i===aS.ADMIN)&&(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsxs)(i6.Button,{textColor:"dark_gray_1",label:"Settings",variant:"text",size:"md",customCSS:gL(),onClick:()=>m("settings"),children:[(0,iQ.jsx)(i6.Icon,{name:"cog"}),(0,iQ.jsx)("span",{children:"Settings"})]})})]})}),(0,iQ.jsx)(i6.Drawer.Footer,{customCSS:{padding:"12px 0px"},children:(0,iQ.jsxs)(i6.Button,{textColor:"dark_gray_1",label:"Sign out",variant:"text",size:"md",customCSS:gL({borderRadius:"6px"}),onClick:c,children:[(0,iQ.jsx)(i6.Icon,{name:"account"}),(0,iQ.jsx)("span",{children:"Sign Out"})]})})]})]})]})};function gU(){var e=(0,i5._)(["\n padding: 0;\n margin: 0 auto;\n width: 100%;\n min-height: ",";\n border-radius: ",";\n background-color: #ffffff;\n border: 1px solid #e0e0e0;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n position: relative;\n overflow: visible;\n"]);return gU=function(){return e},e}function gV(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0;\n padding: ",";\n padding-top: ",";\n width: 100%;\n"]);return gV=function(){return e},e}function gH(){var e=(0,i5._)(["\n margin: auto 0;\n"]);return gH=function(){return e},e}function gW(){var e=(0,i5._)(["\n margin: 3px 0 0 0;\n color: ",";\n font-size: 14px;\n font-family: ",";\n \n @media screen and (max-width: ","px) {\n font-size: 12px;\n }\n"]);return gW=function(){return e},e}function gG(){var e=(0,i5._)(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding: 0;\n margin: 0;\n position: relative;\n z-index: 10;\n"]);return gG=function(){return e},e}function gq(){var e=(0,i5._)(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding-right: 8px;\n margin: 0;\n box-sizing: border-box;\n position: relative;\n"]);return gq=function(){return e},e}function gK(){var e=(0,i5._)(["\n padding: 6px;\n border-radius: 50%;\n min-width: 36px;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: ",";\n box-shadow: ",";\n background: white;\n cursor: pointer;\n margin: 0;\n \n &:hover {\n background-color: #f5f5f5;\n }\n\n &:focus {\n outline: 2px solid #1976d2;\n outline-offset: 2px;\n }\n"]);return gK=function(){return e},e}function gJ(){var e=(0,i5._)(["\n display: flex;\n gap: 10px;\n align-items: center;\n flex-wrap: nowrap;\n"]);return gJ=function(){return e},e}function gX(){var e=(0,i5._)(["\n width: auto;\n border-radius: 5px;\n white-space: nowrap;\n flex-shrink: 0;\n padding: 8px 16px;\n font-family: ",";\n font-size: 14px;\n cursor: pointer;\n border: 1px solid #ccc;\n background: white;\n \n &:hover {\n background-color: #f5f5f5;\n }\n \n &:focus {\n outline: 2px solid #1976d2;\n outline-offset: 2px;\n }\n"]);return gX=function(){return e},e}function g$(){var e=(0,i5._)(["\n gap: 6px;\n display: flex;\n flex-direction: column;\n"]);return g$=function(){return e},e}function gZ(){var e=(0,i5._)(["\n justify-content: flex-start;\n padding: 8px 12px;\n white-space: nowrap;\n border: none;\n background: none;\n cursor: pointer;\n font-family: ",";\n font-size: 14px;\n display: flex;\n align-items: center;\n width: 100%;\n text-align: left;\n \n &:hover {\n background-color: #f5f5f5;\n }\n \n &:focus {\n outline: 2px solid #1976d2;\n outline-offset: -2px;\n }\n"]);return gZ=function(){return e},e}function gY(){var e=(0,i5._)(["\n padding: ",";\n margin-top: ",";\n"]);return gY=function(){return e},e}function gQ(){var e=(0,i5._)(["\n width: 100%;\n"]);return gQ=function(){return e},e}function g0(){var e=(0,i5._)(["\n font-family: ",";\n color: #666;\n margin: 0;\n"]);return g0=function(){return e},e}function g1(){var e=(0,i5._)(["\n border: 2px dotted #ccc;\n padding: ",";\n border-radius: ",";\n width: 100%;\n margin: 0 auto;\n min-height: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n"]);return g1=function(){return e},e}function g2(){var e=(0,i5._)(["\n font-weight: 300;\n font-family: ",";\n font-size: ",";\n text-align: center;\n line-height: ",";\n color: #666;\n"]);return g2=function(){return e},e}function g6(){var e=(0,i5._)(["\n margin-right: 8px;\n display: inline-flex;\n align-items: center;\n"]);return g6=function(){return e},e}function g5(){var e=(0,i5._)(["\n font-size: 14px;\n color: ",";\n margin-bottom: 4px;\n margin-left: 25px !important;\n margin:0px;\n"]);return g5=function(){return e},e}function g4(){var e=(0,i5._)(["\n font-size: 14px;\n color: rgb(55 65 81);\n margin-bottom: 4px;\n margin:0px;\n \n"]);return g4=function(){return e},e}function g3(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 7px;\n margin-top: ",";\n ","\n"]);return g3=function(){return e},e}function g8(){var e=(0,i5._)(["\n display: flex;\n flex-direction: unset;\n gap: 7px;\n"]);return g8=function(){return e},e}function g9(){var e=(0,i5._)(["\n margin:0px 14px 0px 14px;\n border:1px solid #e5e7eb;\n border-radius:8px;\n padding:14px;\n margin-top:20px;\n margin-bottom:20px;\n"]);return g9=function(){return e},e}function g7(){var e=(0,i5._)(["\n font-size: 12px;\n color:#888;\n // font-family: ",";\n\n margin-bottom: 7px;\n margin:0px;\n margin-top:",";\n margin-left: ",";\n"]);return g7=function(){return e},e}function ye(){var e=(0,i5._)(["\n font-size: 14px;\n color:rgb(55 65 81);\n margin-bottom: 4px;\n margin-left: 25px;\n margin:0px;\n margin-top:4px;\n"]);return ye=function(){return e},e}function yn(){var e=(0,i5._)(["\n padding:8px;\n border:1px solid #e5e7eb;\n border-radius:10px;\n margin-top: 7px;\n"]);return yn=function(){return e},e}function yt(){var e=(0,i5._)(["\n padding:8px;\n border:1px solid #e5e7eb;\n border-radius:10px;\n margin-top: 10px;\n"]);return yt=function(){return e},e}function yr(){var e=(0,i5._)(["\n color: rgb(229 231 235);\n border:1px solid;\n margin-bottom: 20px;\n margin-top: 20px;\n"]);return yr=function(){return e},e}function yo(){var e=(0,i5._)(["\n margin:0px;\n font-size:18px;\n margin-top: 10px;\n\n"]);return yo=function(){return e},e}function yi(){var e=(0,i5._)(["\n display:flex;
1\n align-items:center;\n gap:12px;\n"]);return yi=function(){return e},e}function ya(){var e=(0,i5._)(["\n margin:0;\n font-size: ",";\n line-height: 28px;\n font-family: ",";\n @media screen and (max-width: ","px) {\n font-size: 18px;\n line-height: 20px;\n }\n"]);return ya=function(){return e},e}function yl(){var e=(0,i5._)(["\n display:flex;\n flex-direction:column;\n gap:6px;\n"]);return yl=function(){return e},e}function ys(){var e=(0,i5._)(["\n display:flex;\n justify-content:space-between;\n align-items: center;\n"]);return ys=function(){return e},e}function yc(){var e=(0,i5._)(["\n margin-left:5px;\n"]);return yc=function(){return e},e}function yu(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin:0;\n"]);return yu=function(){return e},e}function yd(){var e=(0,i5._)(['\n display: flex;\n flex-direction: row;\n gap:7px;\n align-items:"center;\n']);return yd=function(){return e},e}function yp(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n flex-shrink: 0;\n opacity: 0;\n gap:5px;\n transition: opacity 0.2s ease-in-out;\n ",":hover & {\n opacity: 1;\n }\n"]);return yp=function(){return e},e}function yf(){var e=(0,i5._)(["\n border: 2px dotted;\n border-color: ",";\n padding: 25px 0px;\n border-radius: 5px;\n text-align:center;\n margin: 16px 24px;\n"]);return yf=function(){return e},e}function ym(){var e=(0,i5._)(["\n font-size:14px;\n font-weight: 300;\n font-family: ",";\n"]);return ym=function(){return e},e}function yh(){var e=(0,i5._)(["\n & input::placeholder,\n & textarea::placeholder {\n color: #4d4d4f !important;\n }\n"]);return yh=function(){return e},e}function yg(){var e=(0,i5._)(["\n padding-left: 25px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n"]);return yg=function(){return e},e}function yy(){var e=(0,i5._)(["\n font-size: 14px;\n color: ",";\n margin-bottom: 4px;\n cursor: pointer;\n &:hover {\n text-decoration: underline;\n }\n"]);return yy=function(){return e},e}var yv=i4.default.div.withConfig({displayName:"PrintJob.styles__PrintJobCard",componentId:"sc-c9d1b9cc-0"})(tX||(tX=gU()),e=>e.isSmallBreakpoint?"auto":"160px",e=>e.isSmallBreakpoint?"8px":"12px"),yx=i4.default.div.withConfig({displayName:"PrintJob.styles__HeaderRow",componentId:"sc-c9d1b9cc-1"})(t$||(t$=gV()),e=>"lg"===e.size?"16px 24px":"14px 20px",e=>"lg"===e.size?"16px":"14px"),yb=i4.default.div.withConfig({displayName:"PrintJob.styles__TitleSection",componentId:"sc-c9d1b9cc-2"})(tZ||(tZ=gH())),yj=i4.default.p.withConfig({displayName:"PrintJob.styles__SubtitleText",componentId:"sc-c9d1b9cc-3"})(tY||(tY=gW()),i3.colors.medium_gray_1,lQ.typography.type.motiva,l0.BREAKPOINTS.sm),yw=i4.default.div.withConfig({displayName:"PrintJob.styles__ActionSection",componentId:"sc-c9d1b9cc-4"})(tQ||(tQ=gG())),yC=i4.default.div.withConfig({displayName:"PrintJob.styles__MobileMenuContainer",componentId:"sc-c9d1b9cc-5"})(t0||(t0=gq())),y_=i4.default.button.withConfig({displayName:"PrintJob.styles__MobileActionButton",componentId:"sc-c9d1b9cc-6"})(t1||(t1=gK()),e=>e.isActive?"2px solid #1976d2":"1px solid #ccc",e=>e.isActive?"0 0 0 1px #1976d2":"none"),yS=i4.default.div.withConfig({displayName:"PrintJob.styles__DesktopButtonContainer",componentId:"sc-c9d1b9cc-7"})(t2||(t2=gJ()));i4.default.button.withConfig({displayName:"PrintJob.styles__ActionButton",componentId:"sc-c9d1b9cc-8"})(t6||(t6=gX()),lQ.typography.type.motiva);var yI=i4.default.div.withConfig({displayName:"PrintJob.styles__PopoverContent",componentId:"sc-c9d1b9cc-9"})(t5||(t5=g$())),yE=i4.default.button.withConfig({displayName:"PrintJob.styles__PopoverActionButton",componentId:"sc-c9d1b9cc-10"})(t4||(t4=gZ()),lQ.typography.type.motiva);i4.default.div.withConfig({displayName:"PrintJob.styles__ContentRow",componentId:"sc-c9d1b9cc-11"})(t3||(t3=gY()),e=>e.isSmallBreakpoint?"0px 16px 16px 16px":"0px 24px 20px 24px",e=>e.isSmallBreakpoint?"8px":"-10px"),i4.default.div.withConfig({displayName:"PrintJob.styles__PrintJobsList",componentId:"sc-c9d1b9cc-12"})(t8||(t8=gQ())),i4.default.p.withConfig({displayName:"PrintJob.styles__PlaceholderText",componentId:"sc-c9d1b9cc-13"})(t9||(t9=g0()),lQ.typography.type.motiva),i4.default.div.withConfig({displayName:"PrintJob.styles__EmptyStateWrapper",componentId:"sc-c9d1b9cc-14"})(t7||(t7=g1()),e=>e.isSmallBreakpoint?"24px 16px":"32px 20px",e=>e.isSmallBreakpoint?"6px":"8px",e=>
1e.isSmallBreakpoint?"80px":"100px"),i4.default.div.withConfig({displayName:"PrintJob.styles__EmptyStateMessage",componentId:"sc-c9d1b9cc-15"})(re||(re=g2()),lQ.typography.type.motiva,e=>e.isSmallBreakpoint?"14px":"16px",e=>e.isSmallBreakpoint?"1.4":"1.5");var yP=i4.default.span.withConfig({displayName:"PrintJob.styles__IconWrapper",componentId:"sc-c9d1b9cc-16"})(rn||(rn=g6())),yO={width:"auto",borderRadius:"5px",whiteSpace:"nowrap",flexShrink:0},yT=i4.default.p.withConfig({displayName:"PrintJob.styles__DetailsPara",componentId:"sc-c9d1b9cc-17"})(rt||(rt=g5()),i3.colors.medium_gray_1),yk=i4.default.h4.withConfig({displayName:"PrintJob.styles__InfoLabel",componentId:"sc-c9d1b9cc-18"})(rr||(rr=g4())),yN=i4.default.div.withConfig({displayName:"PrintJob.styles__FlexContainer",componentId:"sc-c9d1b9cc-19"})(ro||(ro=g3()),e=>e.nomargin?"0":"20px",e=>e.spaceBetween?"justify-content: space-between;":""),yD=i4.default.div.withConfig({displayName:"PrintJob.styles__ProofFilesContainer",componentId:"sc-c9d1b9cc-20"})(ri||(ri=g8())),yR=i4.default.div.withConfig({displayName:"PrintJob.styles__WrapperDiv",componentId:"sc-c9d1b9cc-21"})(ra||(ra=g9())),yA=i4.default.h4.withConfig({displayName:"PrintJob.styles__InfoLabelSpecifications",componentId:"sc-c9d1b9cc-22"})(rl||(rl=g7()),lQ.typography.type.mini,e=>e.marginTop?"15px":"0",e=>e.withMargin?"25px":"0"),yM=i4.default.p.withConfig({displayName:"PrintJob.styles__DetailsParaSmall",componentId:"sc-c9d1b9cc-23"})(rs||(rs=ye())),yF=i4.default.div.withConfig({displayName:"PrintJob.styles__FileName",componentId:"sc-c9d1b9cc-24"})(rc||(rc=yn())),yz=i4.default.div.withConfig({displayName:"PrintJob.styles__Notes",componentId:"sc-c9d1b9cc-25"})(ru||(ru=yt())),yL=i4.default.div.withConfig({displayName:"PrintJob.styles__DividerGray",componentId:"sc-c9d1b9cc-26"})(rd||(rd=yr())),yB=i4.default.h4.withConfig({displayName:"PrintJob.styles__CardHeading",componentId:"sc-c9d1b9cc-27"})(rp||(rp=yo()));i4.default.div.withConfig({displayName:"PrintJob.styles__SubTitleContainer",componentId:"sc-c9d1b9cc-28"})(rf||(rf=yi())),i4.default.h3.withConfig({displayName:"PrintJob.styles__SubTitle",componentId:"sc-c9d1b9cc-29"})(rm||(rm=ya()),e=>e.size?"".concat(e.size,"px"):"18px",lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm);var yU=i4.default.div.withConfig({displayName:"PrintJob.styles__DropdownItem",componentId:"sc-c9d1b9cc-30"})(rh||(rh=yl())),yV=i4.default.div.withConfig({displayName:"PrintJob.styles__ContainerDiv",componentId:"sc-c9d1b9cc-31"})(rg||(rg=ys())),yH=i4.default.span.withConfig({displayName:"PrintJob.styles__DropdownItemText",componentId:"sc-c9d1b9cc-32"})(ry||(ry=yc())),yW=i4.default.div.withConfig({displayName:"PrintJob.styles__FileContainer",componentId:"sc-c9d1b9cc-33"})(rv||(rv=yu())),yG=i4.default.div.withConfig({displayName:"PrintJob.styles__FileNameContainer",componentId:"sc-c9d1b9cc-34"})(rx||(rx=yd())),yq=i4.default.div.withConfig({displayName:"PrintJob.styles__HoverContainer",componentId:"sc-c9d1b9cc-35"})(rb||(rb=yp()),yW),yK=i4.default.div.withConfig({displayName:"PrintJob.styles__EmptyStateContainer",componentId:"sc-c9d1b9cc-36"})(rj||(rj=yf()),i3.colors.ink_light_gray),yJ=i4.default.div.withConfig({displayName:"PrintJob.styles__EmptyStateText",componentId:"sc-c9d1b9cc-37"})(rw||(rw=ym()),lQ.typography.type.motiva);i4.default.div.withConfig({displayName:"PrintJob.styles__FormInputWrapper",componentId:"sc-c9d1b9cc-38"})(rC||(rC=yh()));var yX=i4.default.ul.withConfig({displayName:"PrintJob.styles__SourceFileList",componentId:"sc-c9d1b9cc-39"})(r_||(r_=yg())),y$=i4.default.li.withConfig({displayName:"PrintJob.styles__SourceFileItem",componentId:"sc-c9d1b9cc-40"})(rS||(rS=yy()),i3.colors.medium_gray_1),yZ=()=>({margin:"0px",backgroundColor:"transparent","&:hover":{background:"transparent !important",boxShadow:"none !important"},"& span":{color:i8.extend.colors.brand["600"]},"& svg":{fill:"".concat(i8.extend.colors.brand["600"]," !important")}});function yY(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return yQ(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?yQ(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yQ(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let y0=e=>{var n,t=e.size,r=e.project,o=e.viewMode,i=e.handleProjectJob,a=e.handleDeleteJob,l=e.printers,s=e.handleProofFiles,c=e.handleViewProofFile,u=e.handleDownloadProofFile,d=e.handleDeleteProofFile,p=e.handleDeleteJobTemplateFile,f=e.config,m=yY((0,iq.useState)(!1),2),h=m[0],g=m[1],y=yY((0,iq.useState)(!1),2),v=y[0],x=y[1],b=yY((0,iq.useState)({message:"",type:""}),2),j=b[0],w=b[1],C=yY((0,iq.useState)(!1),2),_=C[0],S=C[1],I=yY((0,iq.useState)(null),2),E=I[0],P=I[1],O=yY((0,iq.useState)(Array(null==r||null==(n=r.jobs)?void 0:n.length).fill(!1)),2),T=O[0],k=O[1],N=(0,iY.useSelector)(a9),D=(0,iq.useRef)(null),R=(0,iq.useRef)([]),A=(0,i6.useBreakpoint)(),M="sm"===A||"xs"===A||"xxs"===A,F=o===aS.PRINTER&&(r.status===aw.Draft||r.status===aw.Intake||r.status===aw.Review||r.status===aw.Production),z=(o===aS.BROKER||o===aS.DEVELOPER||o===aS.ADMIN)&&(r.status===aw.Draft||r.status===aw.Intake||r.status===aw.Review||r.status===aw.Production),L=(0,iq.useMemo)(()=>(null==r?void 0:r.jobs)||[],[null==r?void 0:r.jobs]),B=L.length>0,U=()=>
1{if(!B){w({message:"No print jobs to export.",type:"warning"}),x(!0);return}try{var e=V();H(e),w({message:"Print specifications exported successfully",type:"success"}),x(!0)}catch(e){w({message:"Failed to export specifications",type:"error"}),x(!0)}},V=()=>{var e="Project Specifications\n";return e+="========================\n",e+="Project Name: ".concat(r.name,"\n"),e+="Export Date: ".concat(new Date().toISOString().split("T")[0],"\n\n"),L.forEach((n,t)=>{e+="--- Print Job ".concat(t+1,": ").concat(n.jobName," ---\n"),e+=" Quantity: ".concat(n.quantity,"\n"),n.dimensions&&(e+=" Dimensions: ".concat(n.dimensions,"\n")),n.paperType&&(e+=" Paper Type: ".concat(n.paperType,"\n")),n.colors&&(e+=" Colors: ".concat(n.colors,"\n")),n.finishing&&(e+=" Finishing: ".concat(n.finishing,"\n")),n.notes&&(e+=" Notes: ".concat(n.notes.replace(/\n/g,"\n "),"\n"));var o,i=(null==(o=n.sourceFiles)?void 0:o.map(e=>{var n;return null==(n=r.projectFiles)||null==(n=n.find(n=>n.seqId===e))?void 0:n.fileName}).filter(Boolean))||[];e+=" Source Files: ".concat(i.length>0?i.join(", "):"None specified","\n\n")}),e},H=e=>{var n,t=new Blob([e],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(t),i=document.createElement("a");i.href=o;var a=(null==(n=r.name)?void 0:n.replace(/[^a-z0-9]/gi,"_").toLowerCase())||"project";i.download="".concat(a,"_print_specs.txt"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)},W=()=>{U(),g(!1)},G=e=>{a&&(P(e),S(!0))},q=()=>{S(!1),P(null)},K=E?{title:"Delete Print Job?",content:'Are you sure you want to delete "'.concat(null==E?void 0:E.jobName,'"? This action cannot be undone.'),backBtnText:"Cancel",submitBtnText:"Delete Job",submitHandler:()=>{E&&a(E.jobId,E.jobName),S(!1),P(null)},backHandler:q,onClose:q}:null,J=e=>{var n;null==(n=R.current[e])||n.click()},X=e=>({seqId:(0,mB.A)(),fileName:e.name,fileSize:ds(e.size),fileObj:e}),$=(e,n,t,r)=>{var o=(null==f?void 0:f.maxFileSize)||0x6400000,i=(null==f?void 0:f.maxUploadFileLimit)||15,a=!aH(e.name),l=e.size>o,s=((null==r?void 0:r.length)||0)+t>i;return!(a||l||s)},Z=(e,n,t,o)=>{if(e){var i,a=null==r||null==(i=r.jobs)?void 0:i.find(e=>e.jobId===o),l=Array.from(e);if(l.some((e,n)=>!$(e,n,l.length,null==a?void 0:a.proofFiles))){t[n]=!0,k(t);return}t[n]=!1,k(t),s({files:l.map(X),job:a,type:"proofs"})}},Y=(e,n,t)=>{var r=[...T];Z(n.target.files,e,r,t),n.target.value=""};return(0,iQ.jsxs)(iQ.Fragment,{children:[K&&(0,iQ.jsx)(ug,{isOpen:_,modalData:K}),v&&j.message&&(0,iQ.jsx)(i6.ToastBar,{onClose:()=>{x(!1),w({message:"",type:""})},variant:j.type,children:j.message}),(0,iQ.jsxs)(yv,{isSmallBreakpoint:M,children:[(0,iQ.jsxs)(yx,{size:t,children:[(0,iQ.jsxs)(yb,{children:[(0,iQ.jsx)(p9,{children:"Print Jobs"}),(0,iQ.jsx)(yj,{isSmallBreakpoint:M,children:"Manage print jobs for this project."})]}),(0,iQ.jsx)(yw,{children:M?(0,iQ.jsx)(()=>(0,iQ.jsx)(yC,{ref:D,children:(0,iQ.jsx)(i6.Popover,{minWidth:212,showCaret:!1,id:"print-job-actions","aria-label":"Print job actions",position:"bottom-left",customCSS:{marginRight:"auto",transform:"translateX(-40px)"},triggerElement:(0,iQ.jsx)(y_,{isActive:h,"aria-label":"More actions","aria-expanded":h,children:(0,iQ.jsx)(i6.Icon,{name:"more-top",size:14})}),children:(0,iQ.jsxs)(yI,{children:[B&&(0,iQ.jsxs)(yE,{onClick:W,"aria-label":"Export print job specifications",children:[(0,iQ.jsx)(yP,{children:(0,iQ.jsx)(i6.Icon,{name:"upload",size:16})}),"Export Specs"]}),z&&(0,iQ.jsxs)(yE,{onClick:()=>i(null),"aria-label":"Add new print job",children:[(0,iQ.jsx)(yP,{children:(0,iQ.jsx)(i6.Icon,{name:"plus",size:16})}),"Add Print Job"]})]})})}),{}):(0,iQ.jsx)(()=>(0,iQ.jsxs)(yS,{children:[B&&(0,iQ.jsxs)(i6.Button,{size:"sm",variant:"outline",onClick:U,customCSS:yO,"aria-label":"Export print job specifications",children:[(0,iQ.jsx)(yP,{children:(0,iQ.jsx)(i6.Icon,{name:"upload",size:16})}),"Export Specs"]}),z&&(0,iQ.jsx)(ai,{size:"sm",label:"Add Print Job",onClick:()=>{i(null)},icon:"plus",customCSS:yO,"aria-label":"Add new print job"})]}),{})})]}),null!=r&&r.jobs&&r.jobs.length>0?null==r?void 0:r.jobs.filter(e=>o!==aS.PRINTER||e.printerId===String(N.orgId)).map((e,n)=>{var t,a,s,f,m,h,g,y=null==l?void 0:l.filter(n=>n.id===e.printerId).map(e=>e.name);return(0,iQ.jsxs)(yR,{children:[(0,iQ.jsxs)(yV,{children:[(0,iQ.jsx)(yB,{children:null==e?void 0:e.jobName}),(0,iQ.jsxs)(yV,{children:[(null==r?void 0:r.status)&&(0,iQ.jsx)(i6.Badge,{badgeStyle:"solid",variant:"sale",size:"sm",children:aC[null==e||null==(t=e.shippingDelivery)?void 0:t.status]}),(z||F)&&(0,iQ.jsx)(i6.Popover,{position:"bottom",minWidth:120,maxWidth:300,customCSS:"cursor:pointer;",triggerElement:(0,iQ.jsx)(i6.Button,{variant:"text",customCSS:"padding:0px;
1",children:(0,iQ.jsx)(i6.Icon,{name:"more",height:"24px"})}),tabIndex:"0",ariaLabel:"More",children:(0,iQ.jsxs)(yU,{tabIndex:0,children:[(0,iQ.jsxs)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Edit Job ".concat(null==e?void 0:e.jobName),"aria-disabled":"false",onClick:()=>i(e),children:[(0,iQ.jsx)(i6.Icon,{name:"edit",size:16,"aria-label":"Edit Job"}),(0,iQ.jsx)(yH,{children:"Edit Job"})]}),z&&(0,iQ.jsxs)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Delete Job ".concat(null==e?void 0:e.jobName),"aria-disabled":"false",onClick:()=>G(e),children:[(0,iQ.jsx)(i6.Icon,{name:"delete",size:16,"aria-label":"Delete Job"}),(0,iQ.jsx)(yH,{children:"Delete Job"})]})]})})]})]}),(0,iQ.jsx)(yL,{}),(0,iQ.jsxs)(i6.Row,{customCSS:"gap:21px; margin-bottom:50px;",children:[(0,iQ.jsxs)(i6.Column,{spanXS:12,spanSM:7,spanMD:7,spanLG:7,children:[o!==aS.CLIENT&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(yN,{nomargin:!0,children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"print",size:20}),(0,iQ.jsx)(yk,{children:"Assigned Printer"})]}),(0,iQ.jsx)(yT,{children:y})]}),(0,iQ.jsxs)(yN,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"design-tool",size:20}),(0,iQ.jsx)(yk,{children:"Die Lines & Templates"})]}),null==(a=e.templateFiles)?void 0:a.map(n=>(0,iQ.jsxs)(yF,{children:[(0,iQ.jsxs)(yW,{children:[(0,iQ.jsxs)(yG,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"paper-supplies",size:20}),(0,iQ.jsx)(yM,{children:n.fileName})]}),(0,iQ.jsxs)(yq,{children:[(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{c(n.seqId,n.fileName,e.projectId,e.jobId,"templates")},"aria-label":"View Die Lines & Templates",customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"view-on"})}),(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{u(n.seqId,n.fileName,e.projectId,e.jobId,"templates")},"aria-label":"Download Die Lines & Templates",customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"download"})}),z&&(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{p(n.seqId,n.fileName,e,"templates")},"aria-label":"Delete Die Lines & Templates",customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"delete"})})]})]}),(0,iQ.jsxs)(yA,{withMargin:!0,children:["(",n.fileSize,")"]})]},n.seqId)),(0,iQ.jsxs)(yN,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"material",size:20}),(0,iQ.jsx)(yk,{children:"Source Files"})]}),(0,iQ.jsx)(yX,{children:null==e||null==(s=e.sourceFiles)?void 0:s.map(e=>{var n,t=null==r||null==(n=r.projectFiles)?void 0:n.find(n=>(null==n?void 0:n.seqId)===e);return(0,iQ.jsx)(y$,{children:t.fileName},t.seqId)})}),T[n]&&(0,iQ.jsx)(i6.NotificationBubble,{variant:"failure",textSize:"md",customCSS:"padding:9px;margin:8px 0px;",maxWidth:!0,children:"The file you uploaded doesn't meet our requirements. Please try again."}),(0,iQ.jsxs)(yN,{spaceBetween:!0,children:[(0,iQ.jsxs)(yD,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"approval-promotion",size:20}),(0,iQ.jsx)(yk,{children:"Proof Files"})]}),(z||F)&&(0,iQ.jsxs)(i6.Button,{size:"xs",tabIndex:0,variant:"text",onClick:()=>J(n),textColor:!0,customCSS:yZ(),children:[(0,iQ.jsx)(i6.Icon,{name:"upload",color:"black"}),"Upload Proof"]})]}),(0,iQ.jsx)("input",{type:"file",ref:e=>R.current[n]=e,multiple:!0,onChange:t=>Y(n,t,e.jobId),style:{display:"none"}}),null!=e&&e.proofFiles&&(null==e?void 0:e.proofFiles.length)>0?null==e?void 0:e.proofFiles.map(n=>(0,iQ.jsxs)(yF,{children:[(0,iQ.jsxs)(yW,{nomargin:!0,spaceBetween:!0,children:[(0,iQ.jsxs)(yG,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"paper-supplies",size:20}),(0,iQ.jsx)(yM,{children:n.fileName})]}),(0,iQ.jsxs)(yq,{children:[(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{c(n.seqId,n.fileName,e.projectId,e.jobId,"proofs")},"aria-label":"View Proof Files",customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"view-on"})}),(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{u(n.seqId,n.fileName,e.projectId,e.jobId,"proofs")},"aria-label":"Download Proof Files",customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"download"})}),(z||F)&&(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{d(n.seqId,n.fileName,e,"proofs")},"aria-label":"Delete Proof Files",customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"delete"})})]})]}),(0,iQ.jsxs)(yA,{withMargin:!0,children:["(",n.fileSize,")"]})]},n.seqId)):(0,iQ.jsxs)(yF,{children:[(0,iQ.jsxs)(yN,{nomargin:!0,children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"paper-supplies",size:20}),(0,iQ.jsx)(yM,{children:"No proofs uploaded yet."})]}),(0,iQ.jsx)(yA,{withMargin:!0,children:"(—)"})]}),(0,iQ.jsxs)(yN,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"paper-supplies",size:20}),(0,iQ.jsx)(yk,{children:"Notes"})]}),(0,iQ.jsx)(yz,{children:e.notes||"No notes available"})]}),(0,iQ.jsxs)(i6.Column,{spanXS:12,spanSM:4,spanMD:4,spanLG:4,children:[(0,iQ.jsxs)(yN,{nomargin:!0,children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"shield-check",size:20}),(0,iQ.jsx)(yk,{children:"Specifications"})]}),(0,iQ.jsx)(yA,{marginTop:!0,children:"Quantity"}),(0,iQ.jsx)(yM,{children:e.quantity}),(0,iQ.jsx)(yA,{marginTop:!0,children:"Overage Needed"}),(0,iQ.jsx)(yM,{children:e.overageNeededVal}),(0,iQ.jsx)(yA,{marginTop:!0,children:"Dimensions"}),(0,iQ.jsx)(yM,{children:e.dimensions}),(0,iQ.jsx)(yA,{marginTop:!0,children:"Paper Type"}),(0,iQ.jsx)(yM,{children:e.paperType}),(0,iQ.jsx)(yA,{marginTop:!0,children:"Colors"}),(0,iQ.jsx)(yM,{children:e.colors}),(0,iQ.jsx)(yA,{marginTop:!0,children:"Finishing"}),(0,iQ.jsx)(yM,{children:e.finishing}),(0,iQ.jsx)(yL,{}),(0,iQ.jsxs)(yN,{nomargin:!0,children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"delivery-truck",size:20}),(0,iQ.jsx)(yk,{children:"Shipping"})]}),(0,iQ.jsx)(yM,{children:(null==e||null==(f=e.shippingDelivery)?void 0:f.status)==="DELIVERED"||(null==e||null==(m
1=e.shippingDelivery)?void 0:m.status)==="SHIPPED"?null==e||null==(h=e.shippingDelivery)?void 0:h.trackingNumber:aC[null==e||null==(g=e.shippingDelivery)?void 0:g.status]})]})]},e.jobId)]},(null==e?void 0:e.jobName)||n)}):(0,iQ.jsx)(yK,{children:(0,iQ.jsx)(yJ,{children:"No print jobs have been created for this project yet."})})]})]})};function y1(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]);return y1=function(){return e},e}function y2(){var e=(0,i5._)(["\n margin: auto 0;\n"]);return y2=function(){return e},e}function y6(){var e=(0,i5._)(["\n margin: 3px 0 0 0;\n color: ",";\n font-size: 14px;\n font-family: ",";\n @media screen and (max-width: ","px) {\n font-size: 12px;\n }\n"]);return y6=function(){return e},e}function y5(){var e=(0,i5._)(["\n margin:0;\n font-size: ",";\n line-height: 28px;\n cursor: ",";\n font-family: ",";\n @media screen and (max-width: ","px) {\n font-size: 18px;\n line-height: 20px;\n }\n"]);return y5=function(){return e},e}function y4(){var e=(0,i5._)(["\n flex: 1;\n min-width: 200px;\n margin-top: 14px;\n"]);return y4=function(){return e},e}function y3(){var e=(0,i5._)(["\n display: none;\n"]);return y3=function(){return e},e}function y8(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 112px;\n padding:16px;\n border: 2px dashed;\n border-radius: 8px;\n cursor: pointer;\n border-color: ",";\n ","\n"]);return y8=function(){return e},e}function y9(){var e=(0,i5._)(["\n font-size: 14px;\n text-align: center;\n font-family: ",";\n margin: 0 0 8px 0;\n"]);return y9=function(){return e},e}function y7(){var e=(0,i5._)(["\n font-weight: 600;\n color: ",";\n font-family: ",";\n"]);return y7=function(){return e},e}function ve(){var e=(0,i5._)(["\n font-size: 12px;\n font-family: ",";\n margin: 0;\n text-align: center;\n overflow-wrap: break-word;\n word-break: break-all;\n padding: 0 8px;\n @media screen and (max-width: ","px) {\n font-size: 11px;\n line-height: 16px;\n }\n"]);return ve=function(){return e},e}function vn(){var e=(0,i5._)(["\n margin-top: 24px;\n"]);return vn=function(){return e},e}function vt(){var e=(0,i5._)(["\n margin-top: 8px;\n border: 1px solid #e5e7eb; /* border-gray-200 */\n border-radius: 8px;\n overflow: hidden;\n"]);return vt=function(){return e},e}function vr(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n color: ",";\n padding: 30px 0;\n border: 1px dashed #d1d5db;\n border-radius: 8px;\n margin-top: 8px;\n"]);return vr=function(){return e},e}function vo(){var e=(0,i5._)(["\n margin-top: 8px;\n font-size: 14px;\n"]);return vo=function(){return e},e}function vi(){var e=(0,i5._)(["\n list-style: none;\n margin: 0;\n padding: 0;\n & > *:not(:last-child) {\n border-bottom: 1px solid ",";\n }\n"]);return vi=function(){return e},e}function va(){var e=(0,i5._)(["\n &::before {\n content: none;\n }\n padding:10px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: white;\n"]);return va=function(){return e},e}function vl(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n flex-grow: 1;\n min-width: 0;\n ","\n"]);return vl=function(){return e},e}function vs(){var e=(0,i5._)(["\n flex-grow: 1;\n min-width: 0;\n"]);return vs=function(){return e},e}function vc(){var e=(0,i5._)(["\n font-size: 14px;\n font-weight: 500;\n color: ",";\n font-family: ",";\n white-space: nowrap;\n overflow: hidden;\n margin: 0;\n text-overflow: ellipsis;\n"]);return vc=function(){return e},e}function vu(){var e=(0,i5._)(["\n font-size: 12px;\n margin: 0;\n color: ",";\n font-family: ",";\n"]);return vu=function(){return e},e}function vd(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n flex-shrink: 0;\n ","\n"]);return vd=function(){return e},e}function vp(){var e=(0,i5._)(["\n font-size: 14px;\n color: ",";\n"]);return vp=function(){return e},e}var vf=i4.default.div.withConfig({displayName:"ProjectFiles.styles__HeaderRow",componentId:"sc-67b00b6b-0"})(rI||(rI=y1())),vm=i4.default.div.withConfig({displayName:"ProjectFiles.styles__SubTitleSection",componentId:"sc-67b00b6b-1"})(rE||(rE=y2())),vh=i4.default.p.withConfig({displayName:"ProjectFiles.styles__SubtitleText",componentId:"sc-67b00b6b-2"})(rP||(rP=y6()),i3.colors.medium_gray_1,lQ.typography.type.motiva,l0.BREAKPOINTS.sm),vg=i4.default.h3.withConfig({displayName:"ProjectFiles.styles__SubTitle",componentId:"sc-67b00b6b-3"})(rO||(rO=y5()),e=>e.size?"".concat(e.size,"px"):"18px",e=>e.pointer?"pointer":"default",lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm),vy=i4.default.div.withConfig({displayName:"ProjectFiles.styles__Wrapper",componentId:"sc-67b00b6b-4"})(rT||(rT=y4())),vv=i4.default.input.withConfig({displayName:"ProjectFiles.styles__HiddenFileInput",componentId:"sc-67b00b6b-5"})(rk||(rk=y3())),vx=i4.default.div.withConfig({displayName:"ProjectFiles.styles__DragDropWrapper",componentId:"sc-67b00b6b-6"})(rN||(rN=y8()),i3.colors.ink_light_gray,e=>e.isDragging&&"\n border-color: ".concat(i8.extend.colors.brand["500"],"\n background-color: ").concat(i8.extend.colors.brand["50"],"\n ")),vb=i4.default.p.withConfig({displayName:"ProjectFiles.styles__UploadText",componentId:"sc-67b00b6b-7"})(rD||(rD=y9()),lQ.typography.type.motiva),vj=i4.default.span.withConfig({displayName:"ProjectFiles.styles__Highlight",componentId:"sc-67b00b6b-8"})(rR||(rR=y7()),i8.extend.colors.brand["600"],lQ.typography.type.motiva_medium),vw=i4.default.p.withConfig({displayName:"ProjectFiles.styles__FileTypeInfo",componentId:"sc-67b00b6b-9"})(rA||(rA=ve()),lQ.typography.type.motiva,l0.BREAKPOINTS.sm),vC=i4.default.div.withConfig({displayName:"ProjectFiles.styles__FileSection",componentId:"sc-67b00b6b-10"})(rM||(rM=vn())),v_=i4.default.div.withConfig({displayName:"ProjectFiles.styles__FileContainer",componentId:"sc-67b00b6b-11"})(rF||(rF=vt())),vS=i4.default.div.withConfig({displayName:"ProjectFiles.styles__EmptyStateContainer",componentId:"sc-67b00b6b-12"})(rz||(rz=vr()),i3.colors.dark_gray_2),vI=i4.default.p.withConfig({displayName:"ProjectFiles.styles__EmptyMessage",componentId:"sc-67b00b6b-13"})(rL||(rL=vo())),vE=i4.default.ul.withConfig({displayName:"ProjectFiles.styles__FileList",componentId:"sc-67b00b6b-14"})(rB||(rB=vi()),i3.colors.ink_light_gray),vP=i4.default.li.withConfig({displayName:"ProjectFiles.styles__ListItem",componentId:"sc-67b00b6b-15"})(rU||(rU=va())),vO=i4.default.div.withConfig({displayName:"ProjectFiles.styles__FileInfoContainer",componentId:"sc-67b00b6b-16"})(rV||(rV=vl()),e=>"lg"===e.size||"md"===e.size?"gap: 12px;":"sm"===e.size?"gap: 8px;":"gap: 6px;"),vT=i4.default.div.withConfig({displayName:"ProjectFiles.styles__FileTextContainer",componentId:"sc-67b00b6b-17"})(rH||(rH=vs())),vk=i4.default.p.withConfig({displayName:"ProjectFiles.styles__FileName",componentId:"sc-67b00b6b-18"})(rW||(rW=vc()),i3.colors.dark_gray_1,lQ.typography.type.motiva),vN=i4.default.p.withConfig({displayName:"ProjectFiles.styles__FileMeta",componentId:"sc-67b00b6b-19"})(rG||(rG=vu()),i3.colors.dark_gray_2,lQ.typography.type.motiva),vD=i4.default.div.withConfig({displayName:"ProjectFiles.styles__ActionContainer",componentId:"sc-67b00b6b-20"})(rq||(rq=vd()),e=>"lg"===e.size||"md"===e.size?"gap: 20px;":"sm"===e.size?"gap: 10px;":"gap: 5px;"),vR=i4.default.div.withConfig({displayName:"ProjectFiles.styles__FileSize",componentId:"sc-67b00b6b-21"})(rK||(rK=vp()),i3.colors.dark_gray_2);function vA(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return vM(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vM(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vM(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var vF=e=>{var n,t=e.id,r=e.size,o=e.showUpload,i=e.handleProjectFiles,a=e.projectFiles,l=e.viewMode,s=e.handleDeleteProjectFile,c=e.handleDownloadProjectFile,u=e.handleDownloadAllProjectFiles,d=e.handleViewProjectFile,p=e.config,f=e.users,m=void 0===f?[]:f,h=(0,i6.useBreakpoint)(),g=vA((0,iq.useState)(!1),2),y=g[0],v=g[1],x=vA((0,iq.useState)(!1),2),b=x[0],j=x[1],w=(0,iq.useRef)(null),C=(e,n)=>{e.preventDefault(),e.stopPropagation(),v(n)},_=e=>({seqId:(0,mB.A)(),fileName:e.name,fileSize:ds(e.size),fileObj:e}),S=(e,n,t)=>{var r=(null==p?void 0:p.maxFileSize)||0x6400000,o=(null==p?void 0:p.maxUploadFileLimit)||15,i=!aH(e.name),l=e.size>r,s=((null==a?void 0:a.length)||0)+t>o;return!(i||l||s)},I=e=>{if(e){var n=Array.from(e);if(n.some((e,t)=>!S(e,t,n.length)))return void j(!0);j(!1),i(n.map(_))}},E=e=>{I(e.target.files),e.target.value=""},P=e=>{var n=e.file,t=e.viewMode,r=e.handleDeleteProjectFile,o=e.handleDownloadProjectFile,i=e.handleViewProjectFile;return(0,iQ.jsxs)(vP,{children:[(0,iQ.jsxs)(vO,{size:h,children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"paper-supplies",size:24}),(0,iQ.jsxs)(vT,{children:[(0,iQ.jsx)(vk,{title:n.fileName,children:n.fileName}),(0,iQ.jsxs)(vN,{children:["Uploaded: ",aW(null==n?void 0:n.uploadedTs)," by ",db(null==n?void 0:n.uploadedBy,m)]})]})]}),(0,iQ.jsxs)(vD,{size:h,children:[(0,iQ.jsx)(vR,{children:n.fileSize}),(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{i(n.seqId,n.fileName)},"aria-label":"Preview ".concat(n.name),customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"view-on"})}),(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{o(n.seqId,n.fileName)},"aria-label":"Download ".concat(n.name),customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"download"})}),(t===aS.BROKER||t===aS.CLIENT||t===aS.ADMIN)&&(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsx)(i6.Button,{size:"xs",variant:"outline",iconOnly:!0,onClick:()=>{r(n.seqId,n.fileName)},"aria-label":"Delete ".concat(n.name),customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"delete"})})})]})]})};return(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsxs)(i6.Card,{id:t,isClickable:!1,isHover:!1,children:[(0,iQ.jsx)(vf,{size:r,children:(0,iQ.jsxs)(vm,{children:[(0,iQ.jsx)(vg,{children:"Project Files"}),(0,iQ.jsx)(vh,{children:"Manage all source files for this project."})]})}),b&&(0,iQ.jsx)(i6.NotificationBubble,{variant:"failure",textSize:"md",customCSS:"padding:9px;margin:8px 0px;width:100%",children:"The file you uploaded doesn't meet our requirements. Please ensure that the file is no larger than ".concat(ds((null==p?void 0:p.maxFileSize)||0x6400000),", is one of the supported file formats and does not exceed ").concat((null==p?void 0:p.maxUploadFileLimit)||15," files total.")}),o&&(0,iQ.jsxs)(vy,{children:[(0,iQ.jsx)(vv,{type:"file",ref:w,onChange:e=>E(e),multiple:!0,"aria-hidden":"true"}),(0,iQ.jsxs)(vx,{onDragEnter:e=>C(e,!0),onDragOver:e=>C(e,!0),onDragLeave:e=>C(e,!1),onDrop:e=>{C(e,!1),I(e.dataTransfer.files)},onClick:()=>{var e;null==(e=w.current)||e.click()},isDragging:y,"aria-label":"File upload dropzone",children:[(0,iQ.jsxs)(vb,{children:[(0,iQ.jsx)(vj,{children:"Click to upload"})," or drag and drop"]}),(0,iQ.jsx)(vw,{children:"Files should be no larger than 100 MB."}),(0,iQ.jsx)(vw,{children:"We support the following file formats: ".concat(aV.join(","))})]})]}),(0,iQ.jsxs)(vC,{children:[(0,iQ.jsxs)(vf,{children:[(0,iQ.jsxs)(vg,{children:["Uploaded Files (",null!=(n=null==a?void 0:a.length)?n:0,")"]}),(null==a?void 0:a.length)>0&&(0,iQ.jsxs)(i6.Button,{size:"xs",tabIndex:0,variant:"text",onClick:u,customCSS:{margin:"0px"},children:[(0,iQ.jsx)(i6.Icon,{name:"download",color:"black"}),"Download All"]})]}),(null==a?void 0:a.length)>0&&(0,iQ.jsx)(v_,{children:(0,iQ.jsx)(vE,{children:a.map(e=>(0,iQ.jsx)(P,{viewMode:l,file:e,handleDeleteProjectFile:s,handleDownloadProjectFile:c,handleViewProjectFile:d,disabled:!1},e.seqId))})})]}),!o&&!(null!=a&&a.length)&&(0,iQ.jsxs)(vS,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"rgb(55 65 81)",name:"paper-supplies",size:30}),(0,iQ.jsx)(vI,{children:"No files have been uploaded for this project yet."})]})]})})};let vz=e=>
1{var n,t,r,o,i,a=e.clientNameLookup,l=e.project,s=e.viewMode,c=e.handleProjectJob,u=e.handleDeleteJob,d=e.handleEditProject,p=e.handleProjectDrawer,f=e.printers,m=e.handleProjectFiles,h=e.handleDeleteProjectFile,g=e.handleDownloadProjectFile,y=e.handleViewProjectFile,v=e.handleDownloadAllProjectFiles,x=e.onShowToast,b=e.onSetToastNotification,j=e.onUpdateProjects,w=e.size,C=e.pendingScrollTarget,_=e.onClearScrollTarget,S=e.projectSource,I=e.handleProofFiles,E=e.handleViewProofFile,P=e.handleDownloadProofFile,O=e.handleDeleteProofFile,T=e.handleDeleteJobTemplateFile,k=e.config,N=e.users,D=(0,iq.useRef)(null),R=(0,iq.useRef)(null),A=(0,iq.useRef)({retryTimers:new Set,scrollInitiated:!1});null!=l&&l.projectId&&(R.current=l);var M=null!=l&&l.projectId?l:R.current,F=(0,iY.useSelector)(a9);(0,iq.useEffect)(()=>{if(null!=l&&l.projectId&&C){var e=A.current.retryTimers,n=setTimeout(()=>{var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=document.getElementById(C),o=m1(r,null==D?void 0:D.current);if(r&&o){m0(r,o,{duration:1200,offset:20}).then(()=>{_&&_()}),A.current.scrollInitiated=!1;return}if(!r)if(t<10){var i=setTimeout(()=>n(t+1),150);e.add(i)}else _&&_(),A.current.scrollInitiated=!1};requestAnimationFrame(()=>{requestAnimationFrame(()=>{n(0)})})},600);return()=>{clearTimeout(n),e.forEach(clearTimeout),e.clear()}}},[null==l?void 0:l.projectId,C,_]);var z=(null==M?void 0:M.status)!=="Cancelled"&&s!==aS.PRINTER,L=[...s!==aS.CLIENT?[{label:"Dashboard",link:"./easyprint?action=dashboard"}]:[],{label:"notifications"===S?"Notifications":"All Projects",link:"notifications"===S?"./easyprint?action=notifications":"./easyprint?action=projects"},{label:null==M?void 0:M.name}];if(!(null!=M&&M.projectId))return null;var B=new Set(null==(n=null!=(t=null==l?void 0:l.jobs)?t:[])||null==(n=n.filter(e=>s!==aS.PRINTER||e.printerId===String(F.orgId)))?void 0:n.flatMap(e=>e.sourceFiles)),U=null!=(r=null==M||null==(o=M.projectFiles)?void 0:o.filter(e=>s!==aS.PRINTER||B.has(null==e?void 0:e.seqId)))?r:[];return(0,iQ.jsxs)(i6.Container,{ref:D,customCSS:"max-width: none;overflow-y: auto;",children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(lH,{children:(0,iQ.jsx)(lE,{items:L})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.Card,{isClickable:!1,isHover:!1,children:(0,iQ.jsxs)(i6.Row,{customCSS:{padding:"0"},children:[(0,iQ.jsx)(i6.Column,{span:6,customCSS:{margin:"auto"},children:(0,iQ.jsxs)(p8,{children:[(0,iQ.jsx)(p9,{size:20,children:null==M?void 0:M.name}),(null==M?void 0:M.status)!=="Cancelled"&&(s===aS.BROKER||s===aS.DEVELOPER||s===aS.ADMIN)&&(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"text",onClick:()=>p(M),customCSS:{margin:"0px"},children:(0,iQ.jsx)(i6.Icon,{name:"edit",color:"black"})})]})}),(0,iQ.jsxs)(i6.Column,{span:6,customCSS:{margin:"auto",textAlign:"end"},children:[(null==M?void 0:M.status)==="Draft"&&(s===aS.BROKER||s===aS.DEVELOPER||s===aS.ADMIN)&&(0,iQ.jsx)(ai,{size:"sm",label:"Publish Project",onClick:()=>d(M,aR.PUBLISH),icon:"upload",customCSS:{width:"auto",borderRadius:"5px"}}),(null==M?void 0:M.status)==="Cancelled"&&(s===aS.BROKER||s===aS.DEVELOPER||s===aS.ADMIN)&&(0,iQ.jsx)(ai,{size:"sm",label:"Restore Project",onClick:()=>d(M,aR.RESTORE),icon:"return",customCSS:{width:"auto",borderRadius:"5px"}})]}),s!==aS.PRINTER&&(0,iQ.jsxs)(i6.Column,{span:12,customCSS:{margin:"auto"},children:[(0,iQ.jsx)(fe,{children:"For "}),(0,iQ.jsx)(p7,{children:null!=(i=a.get(null==M?void 0:M.clientId))?i:""})]}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto",marginTop:"8px"},children:(0,iQ.jsx)(fe,{children:null==M?void 0:M.description})}),(null==M?void 0:M.status)==="Cancelled"&&(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto"},children:(0,iQ.jsx)(i6.NotificationBubble,{maxWidth:!0,variant:"failure",textSize:"md",isCustomIcon:!0,customCSS:"margin-top: 14px;padding: 10px;",children:"This project is cancelled."})}),(null==M?void 0:M.status)!=="Cancelled"&&(null==M?void 0:M.status)!=="Draft"&&(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto"},children:(0,iQ.jsx)(i6.ProgressIndicator,{version:"2",fontSize:"12px",progressSteps:aq,customCSS:"margin: 20px 0 0 0; width: 100%",selectedStep:(e=>{var n=aq.indexOf(e);return -1!==n?n+1:-1})(null==M?void 0:M.status)})})]})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)("div",{children:(0,iQ.jsx)(y0,{id:"print-jobs-section",size:"lg",project:M,viewMode:s,handleProjectJob:c,handleDeleteJob:u,printers:f,handleProofFiles:I,handleDeleteProofFile:O,handleDownloadProofFile:P,handleViewProofFile:E,handleDeleteJobTemplateFile:T,config:k})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)("div",{children:(0,iQ.jsx)(vF,{id:"project-files-section",size:w,showUpload:z,projectId:null==M?void 0:M.projectId,viewMode:s,projectFiles:U,handleProjectFiles:e=>m(e,M),handleDeleteProjectFile:(e,n)=>h(e,n,M),handleDownloadProjectFile:(e,n)=>g(e,n,null==M?void 0:M.projectId),handleViewProjectFile:(e,n)=>y(e,n,null==M?void 0:M.projectId),handleDownloadAllProjectFiles:()=>v(null==M?void 0:M.projectId,null==M?void 0:M.name,s===aS.PRINTER?B:[]),config:k,users:N})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)("div",{children:(0,iQ.jsx)(i6.Card,{id:"comments-section",customCSS:"min-height:232px",isClickable:!1,isHover:!1,children:(0,iQ.jsx)(mL,{project:M,onShowToast:x,onSetToastNotification:b,onUpdateProjects:j,viewMode:s})})})})})]})};function vL(){var e=(0,i5._)(["\n padding: 16px;\n border: 2px dashed ",";\n border-radius: 6px;\n margin: 8px 0px;\n background-color: #f9fafb;\n"]);return vL=function(){return e},e}function vB(){var e=(0,i5._)(["\n font-size: 16px;\n margin:0px;\n font-family: ",";\n"]);return vB=function(){return e},e}function vU(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 12px;\n font-weight: 500;\n margin-bottom: 4px;\n text-transform: none;\n"]);return vU=function(){return e},e}function vV(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n font-size: 14px;\n text-transform: none;\n"]);return vV=function(){return e},e}function vH(){var e=(0,i5._)(["\n background: ",";\n height: 1px;\n border: none;\n margin: 20px 0px 20px 0px;\n"]);return vH=function(){return e},e}function vW(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n line-height: 24px;\n font-weight: bold;\n margin: 0;\n"]);return vW=function(){return e},e}function vG(){var e=(0,i5._)(["\n color: ",";\n font-family: ",";\n font-size: 14px;\n line-height: 24px;\n font-weight: bold;\n margin: 0;\n"]);return vG=function(){return e},e}function vq(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 112px;\n padding:16px;\n border: 2px dashed;\n border-radius: 8px;\n cursor: pointer;\n margin: 8px 0px;\n border-color: ",";\n ","\n"]);return vq=function(){return e},e}function vK(){var e=(0,i5._)(["\n font-size: 14px;\n text-align: center;\n font-family: ",";\n margin: 0 0 8px 0;\n"]);return vK=function(){return e},e}function vJ(){var e=(0,i5._)(["\n font-size: 12px;\n font-family: ",";\n margin: 0;\n text-align: center;\n overflow-wrap: break-word;\n word-break: break-word;\n padding: 0 8px;\n"]);return vJ=function(){return e},e}function vX(){var e=(0,i5._)(["\n font-weight: 600;\n color: ",";\n font-family: ",";\n"]);return vX=function(){return e},e}function v$(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px;\n border-radius: 6px;\n ","\n"]);return v$=function(){return e},e}function vZ(){var e=(0,i5._)(["\n height: 14px;\n width: 14px;\n border-radius: 4px;\n border: 1px solid ",";\n color: ","\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ",");\n }\n"]);return vZ=function(){return e},e}function vY(){var e=(0,i5._)(["\n font-size: 14px;\n font-family: ",";\n text-transform: none;\n"]);return vY=function(){return e},e}function vQ(){var e=(0,i5._)(["\n display: none;\n"]);return vQ=function(){return e},e}function v0(){var e=(0,i5._)(["\n & input::placeholder,\n & textarea::placeholder {\n color: #4d4d4f !important;\n }\n"]);return v0=function(){return e},e}var v1=i4.default.div.withConfig({displayName:"ManageJobDrawer.styles__CreateTemplateWrapper",componentId:"sc-cb519082-0"})(rJ||(rJ=vL()),i3.colors.ink_light_gray),v2=i4.default.h4.withConfig({displayName:"ManageJobDrawer.styles__Heading",componentId:"sc-cb519082-1"}
1)(rX||(rX=vB()),lQ.typography.type.motiva),v6=i4.default.label.withConfig({displayName:"ManageJobDrawer.styles__Label",componentId:"sc-cb519082-2"})(r$||(r$=vU()),lQ.typography.type.motiva_medium),v5=i4.default.label.withConfig({displayName:"ManageJobDrawer.styles__RadioLabel",componentId:"sc-cb519082-3"})(rZ||(rZ=vV())),v4=i4.default.hr.withConfig({displayName:"ManageJobDrawer.styles__Divider",componentId:"sc-cb519082-4"})(rY||(rY=vH()),i3.colors.light_gray_1),v3=i4.default.h4.withConfig({displayName:"ManageJobDrawer.styles__SectionTitle",componentId:"sc-cb519082-5"})(rQ||(rQ=vW()),lQ.typography.type.motiva),v8=i4.default.div.withConfig({displayName:"ManageJobDrawer.styles__Title",componentId:"sc-cb519082-6"})(r0||(r0=vG()),i3.colors.dark_gray_1,lQ.typography.type.motiva),v9=i4.default.div.withConfig({displayName:"ManageJobDrawer.styles__DragDropWrapper",componentId:"sc-cb519082-7"})(r1||(r1=vq()),i3.colors.ink_light_gray,e=>e.isDragging&&"\n border-color: ".concat(i8.extend.colors.brand["500"],"\n background-color: ").concat(i8.extend.colors.brand["50"],"\n ")),v7=i4.default.p.withConfig({displayName:"ManageJobDrawer.styles__UploadText",componentId:"sc-cb519082-8"})(r2||(r2=vK()),lQ.typography.type.motiva),xe=i4.default.p.withConfig({displayName:"ManageJobDrawer.styles__FileTypeInfo",componentId:"sc-cb519082-9"})(r6||(r6=vJ()),lQ.typography.type.motiva),xn=i4.default.span.withConfig({displayName:"ManageJobDrawer.styles__Highlight",componentId:"sc-cb519082-10"})(r5||(r5=vX()),i8.extend.colors.brand["600"],lQ.typography.type.motiva_medium),xt=i4.default.label.withConfig({displayName:"ManageJobDrawer.styles__FileLabel",componentId:"sc-cb519082-11"})(r4||(r4=v$()),e=>e.isTemplateFile?"\n background-color: ".concat(i3.colors.white,";\n cursor: text;\n "):"\n cursor: pointer;\n transition: background 0.15s ease;\n\n &:hover {\n background-color: #f3f4f6;\n }\n "),xr=i4.default.input.withConfig({displayName:"ManageJobDrawer.styles__FileCheckbox",componentId:"sc-cb519082-12"})(r3||(r3=vZ()),i3.colors.ink_light_gray,i8.extend.colors.brand["600"],i8.extend.colors.brand["500"]),xo=i4.default.span.withConfig({displayName:"ManageJobDrawer.styles__FileName",componentId:"sc-cb519082-13"})(r8||(r8=vY()),lQ.typography.type.motiva_medium),xi=i4.default.input.withConfig({displayName:"ManageJobDrawer.styles__HiddenFileInput",componentId:"sc-cb519082-14"})(r9||(r9=vQ())),xa=i4.default.div.withConfig({displayName:"ManageJobDrawer.styles__FormInputWrapper",componentId:"sc-cb519082-15"})(r7||(r7=v0())),xl=["status","carrier","trackingNumber","sourceFiles"],xs=["fileObj"],xc=["shippingDelivery"];function xu(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return xd(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(xd(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,xd(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,xd(u,"constructor",c),xd(c,"constructor",s),s.displayName="GeneratorFunction",xd(c,o,"GeneratorFunction"),xd(u),xd(u,o,"Generator"),xd(u,r,function(){return this}),xd(u,"toString",function(){return"[object Generator]"}),(xu=function(){return{w:i,m:d}})()}function xd(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(xd=function(e,n,t,r){function i(n,t){xd(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function xp(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function xf(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){xp(i,r,o,a,l,"next",e)}function l(e){xp(i,r,o,a,l,"throw",e)}a(void 0)})}}function xm(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function xh(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?xm(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xm(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function xg(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function xy(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return xv(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xv(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xv(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var xx=e=>{var n,t,r=e.showJobDrawer,o=e.onDrawerClose,i=e.printers,a=e.templates,l=e.action,s=e.submitJob,c=e.setJobDetails,u=e.setTemplateTypeId,d=e.size,p=e.selectedJob,f=e.onDeleteJob,m=e.viewMode,h=e.handleJobFiles,g=e.config,y=(0,iq.useRef)(),v=(0,iq.useRef)(),x=xy((0,iq.useState)({}),2),b=x[0],j=x[1],w=xy((0,iq.useState)("PENDING_SHIPMENT"),2),C=w[0],_=w[1],S=xy((0,iq.useState)(""),2),I=S[0],E=S[1],P=xy((0,iq.useState)([]),2),O=P[0],T=P[1],k=xy((0,iq.useState)([]),2),N=k[0],D=k[1],R=xy((0,iq.useState)(!1),2),A=R[0],M=R[1],F=xy((0,iq.useState)(!1),2),z=F[0],L=F[1],B=xy((0,iq.useState)(!1),2),U=B[0],V=B[1],H=(0,iq.useRef)(null),W=m===aS.BROKER||m===aS.ADMIN,G=m===aS.PRINTER,q=(0,iq.useMemo)(()=>{var e,n;return[{value:"-1",text:"No Template"},{value:"saveAsNewTemplate",text:"+ Save as new template"},...(null==a||null==(e=a.client)?void 0:e.filter(e=>e.clientId===p.parentClientId).map(e=>({value:e.templateId,text:e.name})))||[],...(null==a||null==(n=a.generic)?void 0:n.map(e=>({value:e.templateId,text:e.name})))||[]]},[a,p]),K=(0,iq.useMemo)(()=>[{value:"-1",text:"Unassigned"},...(null==i?void 0:i.map(e=>({value:e.id,text:e.name})))||[]],[i]),J=Object.entries(aC).map(e=>{var n=(0,i$._)(e,2);return{value:n[0],text:n[1]}}),X=Object.entries(aU).map(e=>{var n=(0,i$._)(e,2),t=(n[0],n[1]);return{value:t,text:t}}),$=e=>{e.status,e.carrier;var n=e.trackingNumber,t=(e.sourceFiles,xg(e,xl)),r=N.map(e=>(e.fileObj,xg(e,xs))),o=N.filter(e=>e.fileObj),i="DELIVERED"===C||"SHIPPED"===C;s(xh(xh({},t),{},{sourceFiles:O,templateFiles:r,newTemplateFiles:o,shippingDelivery:{status:C,carrier:I&&i?I:"",trackingNumber:n&&i?n:""}}))},Z=(e,n)=>{e.preventDefault(),e.stopPropagation(),M(n)},Y=()=>{L(!1),o()},Q=(0,iq.useCallback)((e,n)=>{var t=di(n);null!=t&&t>0&&(e.setFieldValue("quantity",t,!1),e.setFieldTouched("quantity",!0,!1),e.setFieldError("quantity",void 0))},[]),ee=(0,iq.useCallback)(e=>{var n;return!!da(null==(n=e.values)?void 0:n.quantity)||(e.setFieldTouched("quantity",!0,!1),e.setFieldError("quantity","Required"),!1)},[]),en=(0,iq.useCallback)(function(){var e=xf(xu().m(function e(n){var t,r;return xu().w(function(e){for(;;)switch(e.p=e.n){case 0:return Q(n,null==(t=n.values)?void 0:t.quantity),e.n=1,new Promise(e=>setTimeout(e,0));case 1:return e.n=2,n.validateForm();case 2:if((r=e.v).quantity&&(delete r.quantity,n.setErrors(r)),0!==Object.keys(r).length){e.n=6;break}return n.setSubmitting(!0),e.p=3,e.n=4,$(n.values);case 4:return e.p=4,n.setSubmitting(!1),e.f(4);case 5:return e.a(2,!0);case 6:return e.a(2,!1)}},e,null,[[3,,4,5]])}));return function(n){return e.apply(this,arguments)}}(),[$,Q]),et=(0,iq.useMemo)(()=>!!(null!=p&&p.jobId),[null==p?void 0:p.jobId]),er=(0,iq.useCallback)(xf(xu().m(function e(){return xu().w(function(e){for(;;)switch(e.n){case 0:if(v.current){e.n=1;break}return e.a(2);case 1:if(ee(v.current)){e.n=2;break}return e.a(2);case 2:if(!et){e.n=4;break}return e.n=3,en(v.current);case 3:if(!e.v){e.n=4;break}return e.a(2);
1case 4:return e.n=5,v.current.submitForm();case 5:return e.a(2)}},e)})),[et,ee,en]),eo=b.jobName?{title:"Delete Print Job?",content:'Are you sure you want to delete "'.concat(b.jobName,'"? This action cannot be undone.'),backBtnText:"Cancel",submitBtnText:"Delete Job",submitHandler:()=>{b.jobId&&b.jobName&&f(b.jobId,b.jobName),L(!1)},backHandler:Y,onClose:Y}:null,ei=e=>({seqId:(0,mB.A)(),fileName:e.name,fileSize:ds(e.size),fileObj:e}),ea=e=>{if(e){var n=(null==g?void 0:g.maxFileSize)||0x6400000,t=(null==g?void 0:g.maxUploadFileLimit)||15,r=!aH(e.name),o=e.size>n,i=(null==N?void 0:N.length)+1>t;if(r||o||i)return void V(!0);V(!1);var a=ei(e);h(a,p),D(e=>[...e,a])}},el=e=>{ea(e.target.files[0]),e.target.value=""},es=e=>{T(n=>n.includes(e)?n.filter(n=>n!==e):[...n,e])};return(0,iq.useEffect)(()=>{if(!r){null==(t=y.current)||t.close(),j({});return}null==(e=y.current)||e.open();var e,n,t,o=p||{},i=o.shippingDelivery,a=xg(o,xc),l=xh(xh({},a),{},{status:null==i?void 0:i.status,trackingNumber:null==i?void 0:i.trackingNumber,carrier:null==i?void 0:i.carrier});j(l),T((null==a?void 0:a.sourceFiles)||[]),D(null!=(n=null==a?void 0:a.templateFiles)?n:[]),_((null==i?void 0:i.status)||"PENDING_SHIPMENT"),E((null==i?void 0:i.carrier)||"");var s=null;return null!=p&&p.jobId&&null!=l.quantity&&(s=dl(v,"quantity",l.quantity)),()=>{s&&clearTimeout(s)}},[r,p]),(0,iQ.jsxs)(iQ.Fragment,{children:[eo&&(0,iQ.jsx)(ug,{isOpen:z,modalData:eo}),(0,iQ.jsxs)(i6.Drawer,{ref:y,centerTitle:!1,size:"md",onClose:()=>{},children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{children:[b.jobId?"Edit Print Job":"Add New Print Job",(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{children:(0,iQ.jsx)(xa,{children:(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(i6.FormikWrapper,{initialValues:b,onSubmit:$,callbackFnToFormikRef:e=>{v.current=e},enableReinitialize:!0,children:[(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,onChange:(e,n)=>c(e,n),defaultValue:b.templateId,label:"Job Template",placeholder:"Select template",width:"100%",height:"43px",customCSS:"width: 100%; margin-top: 3px;",name:"templateId",options:q,disabled:G})}),(null==b?void 0:b.templateId)==="saveAsNewTemplate"&&(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsxs)(v1,{children:[(0,iQ.jsx)(v2,{children:"New Template Details"}),(0,iQ.jsx)(i6.FormikElement,{name:"templateName",component:i6.TextInput,label:"Template Name",placeholder:"Enter template name",isRequired:!0,ariaLabel:"Template Name",customCSS:"margin-top:20px"}),(0,iQ.jsx)(v6,{children:"Available For"}),(0,iQ.jsx)(i6.Radio,{id:"sparqId",onChange:e=>{u(e)},orientation:"horizontal",customCSS:"margin:0px",options:[{id:0,text:(0,iQ.jsx)(v5,{children:"All Clients (Generic)"}),value:""},{id:1,text:(0,iQ.jsx)(v5,{children:"This Client Only"}),value:b.clientId}],selectedValue:0})]})}),(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"jobName",component:i6.TextInput,label:"Job Name",placeholder:"e.g, Brochure Interior",isRequired:!0,ariaLabel:"Job Name",disabled:G})}),(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,defaultValue:b.printerId,label:"Printer",placeholder:"Select Printer",width:"100%",height:"43px",customCSS:"width: 100%; margin-top: 3px;",name:"printerId",options:K,disabled:G})}),(0,iQ.jsx)(i6.Column,{span:"lg"===d?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"quantity",component:i6.TextInput,label:"Quantity",placeholder:"Enter quantity",ariaLabel:"quantity",type:"number",isRequired:!0,disabled:G})}),(0,iQ.jsx)(i6.Column,{span:"lg"===d?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"dimensions",component:i6.TextInput,label:"Dimensions",placeholder:"e.g., 8.5 x 11",ariaLabel:"Dimensions",disabled:G})}),(0,iQ.jsx)(i6.Column,{span:"lg"===d?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"paperType",component:i6.TextInput,label:"Paper Type",placeholder:"e.g., 100# Gloss Cover",ariaLabel:"Paper Type",disabled:G})}),(0,iQ.jsx)(i6.Column,{span:"lg"===d?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"colors",component:i6.TextInput,label:"Colors",placeholder:"e.g., 4/4 CMYK",ariaLabel:"Colors",disabled:G})}),(0,iQ.jsx)(i6.Column,{span:"lg"===d?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"finishing",component:i6.TextInput,label:"Finishing",placeholder:"e.g., Saddle-stitch, UV Coat",ariaLabel:"Finishing",disabled:G})}),(0,iQ.jsx)(i6.Column,{span:"lg"===d?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"overageNeededVal",component:i6.TextInput,label:"Overage Needed",placeholder:"e.g., 50",type:"number",ariaLabel:"Overage Needed",disabled:G})}),(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"notes",component:i6.TextArea,label:"Notes",placeholder:"Enter notes",ariaLabel:"Notes",disabled:G})})]}),W&&et&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsxs)(i6.Column,{span:12,children:[(0,iQ.jsx)(v4,{}),(0,iQ.jsx)(v3,{children:"Die Lines & Templates"}),(0,iQ.jsx)(v8,{children:"Upload any die lines, templates, or other guiding files for the printer. Files should be no larger than 100 MB. We support the following file formats: ".concat(aV.join(","))}),U&&(0,iQ.jsx)(i6.NotificationBubble,{variant:"failure",textSize:"md",customCSS:"padding:9px;margin:8px 0px;",children:"The file you uploaded doesn't meet our requirements. Please try again."}),(0,iQ.jsx)(xi,{type:"file",ref:H,onChange:e=>el(e),"aria-hidden":"true"}),(0,iQ.jsxs)(v9,{onDragEnter:e=>Z(e,!0),onDragOver:e=>Z(e,!0),onDragLeave:e=>Z(e,!1),onDrop:e=>{var n;Z(e,!1),ea(null==e||null==(n=e.dataTransfer)?void 0:n.files[0])},onClick:()=>{var e;null==(e=H.current)||e.click()},isDragging:A,"aria-label":"File upload dropzone",children:[(0,iQ.jsxs)(v7,{children:[(0,iQ.jsx)(xn,{children:"Click to upload"})," or drag and drop"]}),(0,iQ.jsx)(xe,{children:"Files should be no larger than 100 MB."}),(0,iQ.jsx)(xe,{children:"We support the following file formats: ".concat(aV.join(","))})]})]})}),N.length>0&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.Card,{padding:"sm",isClickable:!1,customCSS:"\n border-radius:8px;\n background-color:#f9fafb;\n display:flex;\n flex-direction: column;\n gap:8px;\n",isHover:!1,children:null==N?void 0:N.map(e=>(0,iQ.jsxs)(xt,{isTemplateFile:!0,children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"paper-supplies",size:22,customCSS:{flexShrink:0}}),(0,iQ.jsx)(xo,{children:e.fileName})]},e.seqId))})})}),(null==p||null==(n=p.projectFiles)?void 0:n.length)>0&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsxs)(i6.Column,{span:12,children:[(0,iQ.jsx)(v4,{}),(0,iQ.jsx)(v3,{children:"Source Files"}),(0,iQ.jsx)(v8,{children:"Select the project files to associate with this print job."}),(0,iQ.jsx)(i6.Card,{padding:"sm",isClickable:!1,customCSS:"\n border-radius:8px;\n background-color:#f9fafb;\n margin:8px 0px;\n",isHover:!1,children:null==p||null==(t=p.projectFiles)?void 0:t.map(e=>(0,iQ.jsxs)(xt,{children:[(0,iQ.jsx)(xr,{type:"checkbox",checked:null==O?void 0:O.includes(e.seqId),onChange:()=>es(e.seqId),disabled:G}),(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"paper-supplies",size:22,customCSS:{flexShrink:0}}),(0,iQ.jsx)(xo,{children:e.fileName})]},e.seqId))})]})}),l===aN.EDIT&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsxs)(i6.Column,{span:12,children:[(0,iQ.jsx)(v4,{}),(0,iQ.jsx)(v3,{children:"Shipping & Delivery"})]})}),(0,iQ.jsxs)(i6.Row,{customCSS:"margin: 12px 0px",children:[(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,onChange:(e,n)=>_(n),defaultValue:null==b?void 0:b.status,label:"Shipping Status",placeholder:"Shipping Status",width:"100%",height:"43px",customCSS:"width: 100%; margin-top: 3px;",name:"status",options:J})}),("DELIVERED"===C||"SHIPPED"===C)&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Column,{span:"lg"===d?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"trackingNumber",component:i6.TextInput,isRequired:!0,label:"Tracking Number",placeholder:"Enter tracking number",type:"string",ariaLabel:"Tracking Number"})}),(0,iQ.jsx)(i6.Column,{span:"lg"===d?6:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,onChange:(e,n)=>E(n),defaultValue:null==b?void 0:b.carrier,label:"Carrier",placeholder:"Carrier",isRequired:!0,width:"100%",height:"43px",customCSS:"width: 100%; margin-top: 3px;",name:"carrier",options:X})})]})]})]})]})})})})}),(0,iQ.jsxs)(i6.Drawer.Footer,{children:[l===aN.EDIT&&(0,iQ.jsx)(i6.Button,{variant:"primary",size:"sm",onClick:()=>{f&&(y.current&&y.current.close(),L(!0))},customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Delete Job"}),(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:o,customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Cancel"}),(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"auto","border-radius":"5px"},onClick:er,children:l===aN.EDIT?"Save Changes":"Save Job"})]})]})]})]})},xb=e=>{var n;return(null==e||null==(n=e.response)?void 0:n.status)===401};let xj=()=>{var e=(0,iY.useDispatch)();(0,iq.useEffect)(()=>{var n=uS.interceptors.response.use(e=>e,n=>(xb(n)&&e(mw(!0)),Promise.reject(n)));return()=>{uS.interceptors.response.eject(n)}},[e])};function xw(){var e=(0,i5._)(["\n label {\n text-transform: none !important;\n margin-left: 0 !important;\n padding: 2px 4px !important;\n color: #666666 !important;\n background: #ffffff !important;\n z-index: 99 !important;\n position: absolute !important;\n left: 5px !important;\n top: -8px !important;\n display: inline-block;\n white-space: nowrap;\n }\n\n label::after {\n content: '*' !important;\n color: #d32f2f !important;\n font-weight: 300 !important;\n font-size: 20px;\n vertical-align: super;\n margin-left: 65px;\n top: 3px;\n }\n"]);return xw=function(){return e},e}function xC(){var e=(0,i5._)(["\n font-size: 16px;\n font-family: ",";\n color: ",";\n"]);return xC=function(){return e},e}function x_(){var e=(0,i5._)(["\n display: flex;\n justify-content: flex-end;\n flex-wrap: wrap;\n gap: 12px 0;\n width: 100%;\n"]);return x_=function(){return e},e}function xS(){var e=(0,i5._)(["\n & input::placeholder,\n & textarea::placeholder {\n color: #4d4d4f !important;\n }\n\n & div[role='button'] {\n padding-left: 0 !important;\n }\n\n & div[role='button'] span {\n padding-left: 12px !important;\n }\n"]);return xS=function(){return e},e}var xI=i4.default.div.withConfig({displayName:"ManageProjectDrawer.styles__DateComponentWrapper",componentId:"sc-56a631e3-0"})(oe||(oe=xw())),xE=i4.default.span.withConfig({displayName:"ManageProjectDrawer.styles__StatusText",componentId:"sc-56a631e3-1"})(on||(on=xC()),lQ.typography.type.motiva,i3.colors.black),xP=i4.default.div.withConfig({displayName:"ManageProjectDrawer.styles__FooterWrapper",componentId:"sc-56a631e3-2"})(ot||(ot=x_())),xO=i4.default.div.withConfig({displayName:"ManageProjectDrawer.styles__FormInputWrapper",componentId:"sc-56a631e3-3"})(or||(or=xS()));function xT(e,n){if(e){if("string"==typeof e)return xk(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xk(e,n):void 0}}function xk(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var xN=e=>{var n=e.showProjectDrawer,t=e.onDrawerClose,r=e.selectedProject,o=e.clients,i=e.handleEditProject,a=e.handleCreateProject,l=e.handleCancelProject,s=e.handleAddJob,c=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||xT(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)({}),2),u=c[0],d=c[1],p=(0,iq.useRef)(),f=(0,iq.useRef)(),m=(0,iq.useMemo)(()=>r.projectId?aN.EDIT:aN.CREATE,[r]),h=(0,iq.useMemo)(()=>{var e=[],n=(t,r)=>{var o,i=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=xT(e))){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;e.push({value:a.id,text:(0,iQ.jsxs)(xE,{children:["— ".repeat(r),a.name]}),optionHTML:(0,iQ.jsxs)(xE,{children:["— ".repeat(r),a.name]})}),a.children&&n(a.children,r+1)}}catch(e){i.e(e)}finally{i.f()}};return n(null!=o?o:[],0),e},[o]);return(0,iq.useEffect)(()=>{if(n){var e,t,o,i,a,l;p.current&&p.current.open(),d({clientId:null!=(e=null==r?void 0:r.clientId)?e:"",projectId:null!=(t=null==r?void 0:r.projectId)?t:"",name:null!=(o=null==r?void 0:r.name)?o:"",description:null!=(i=null==r?void 0:r.description)?i:"",status:null!=(a=null==r?void 0:r.status)?a:"",dueDate:null!=(l=null==r?void 0:r.dueDate)?l:dc(new Date,5)})}else p.current&&p.current.close(),d(aM)},[n,r]),(0,iQ.jsxs)(i6.Drawer,{ref:p,centerTitle:!1,size:m===aN.EDIT?"md":"sm",onClose:()=>{},children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{children:[m===aN.EDIT?"Edit Project":"Add New Project",(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{children:(0,iQ.jsx)(xO,{children:(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(i6.FormikWrapper,{initialValues:u,onSubmit:e=>{if(r.projectId){var n;e.projectId=r.projectId,e.dueDate=aW(e.dueDate),e.clientId=null!=(n=null==r?void 0:r.clientId)?n:"",i(e,aR.EDIT)}else aD.ADD_PRINT_JOB===e.action?s(e):(e.status=aw.Draft,e.dueDate=aW(e.dueDate),a(e))},callbackFnToFormikRef:e=>{f.current=e},enableReinitialize:!0,children:[m===aN.CREATE&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{isRequired:!0,disabled:!!(null==r?void 0:r.clientId),component:i6.Dropdown,label:"Client",placeholder:"Select client",width:"100%",height:"43px",defaultValue:"",customCSS:"width: 100%; padding: 0;",name:"clientId",onChange:(e,n)=>f.current.setFieldValue("clientId",n),options:h})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"name",component:i6.TextInput,label:"Project Name",placeholder:"Enter project name",isRequired:!0,ariaLabel:"project name"})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"description",component:i6.TextArea,label:"Description",placeholder:"Enter description",ariaLabel:"project description",customCSS:"width: 100%; label { color: #666666; } textarea { border-color: #969696; }"})})}),(0,iQ.jsxs)(i6.Row,{children:[m===aN.EDIT&&(0,iQ.jsx)(i6.Column,{span:6,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,label:"Status",placeholder:"Select Status",width:"100%",height:"43px",defaultValue:u.status,customCSS:"width: 100%; margin-top: 3px;",name:"status",options:aG})}),(0,iQ.jsx)(i6.Column,{customCSS:"position:relative",span:m===aN.EDIT?6:12,children:(0,iQ.jsx)(xI,{isNewProject:m===aN.CREATE,children:(0,iQ.jsx)(i6.SingleDatePicker,{name:"dueDate",title:"Due Date",isRequired:!0,customCSS:"height:40px; width:100%; label { color: #666666; }",defaultDate:new Date(u.dueDate),id:"SingleDatePicker_Story",onSelect:e=>f.current.setFieldValue("dueDate",e),isCenter:!0,ariaLabel:"Due date"})})})]})]})})})})}),(0,iQ.jsx)(i6.Drawer.Footer,{children:(0,iQ.jsxs)(xP,{children:[m===aN.EDIT&&"Cancelled"!==u.status&&(0,iQ.jsx)(i6.Button,{variant:"primary",size:"sm",onClick:()=>l({projectId:r.projectId,name:u.name}),customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Cancel Project"}),m===aN.EDIT&&u&&"Draft"!==u.status&&"Cancelled"!==u.status&&(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:()=>{i({projectId:r.projectId,name:u.name},aR.UN_PUBLISH)},customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Unpublish"}),(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:t,customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Cancel"}),m===aN.EDIT&&(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"auto","border-radius":"5px"},onClick:()=>
1{f.current.submitForm()},children:"Save Changes"}),m===aN.CREATE&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:()=>{f.current.submitForm()},customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Add & Close"}),(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"auto","border-radius":"5px"},onClick:e=>{f.current.setFieldValue("action",aD.ADD_PRINT_JOB),f.current.submitForm(e)},children:"Add Print Job"})]})]})})]})]})};function xD(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n svg {\n transform: rotate(90deg);\n }\n"]);return xD=function(){return e},e}function xR(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n line-height: 28px;\n margin: 0;\n @media screen and (max-width: ","px) {\n font-size: 18px;\n line-height: 20px;\n }\n"]);return xR=function(){return e},e}function xA(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n padding: 12px 12px;\n background-color: rgba(249, 250, 251, 0.7);\n cursor: pointer;\n gap:8px;\n"]);return xA=function(){return e},e}function xM(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n margin: 0px;\n"]);return xM=function(){return e},e}function xF(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n margin: 0px;\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n }\n"]);return xF=function(){return e},e}function xz(){var e=(0,i5._)(["\n padding-top: 4px;\n padding-bottom: 4px\n & > * + * {\n margin-top: 4px;\n }\n"]);return xz=function(){return e},e}function xL(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 4px;\n opacity: 0;\n transition: opacity 0.2s;\n"]);return xL=function(){return e},e}function xB(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 7px 14px 7px 42px;\n &:hover "," {\n opacity: 1;\n }\n"]);return xB=function(){return e},e}function xU(){var e=(0,i5._)(["\n"]);return xU=function(){return e},e}function xV(){var e=(0,i5._)(["\n font-size: 12px;\n color: ",";\n line-height:14px;\n margin: 6px 0px;\n"]);return xV=function(){return e},e}function xH(){var e=(0,i5._)(["\n padding:0;\n &::before {\n content: none;\n }"]);return xH=function(){return e},e}function xW(){var e=(0,i5._)(["\n list-style: none;\n margin: 0;\n padding: 0;\n max-height: calc(100vh - 250px);\n overflow-y: auto;\n > li {\n border-top: 1px solid #e5e7eb;\n }"]);return xW=function(){return e},e}function xG(){var e=(0,i5._)(["\n font-size: 14px;\n font-weight: 700;\n font-family: ",";\n margin: 5px 0px;\n color: rgb(107 114 128);\n @media screen and (max-width: ","px) {\n font-size: 12px;\n }\n"]);return xG=function(){return e},e}function xq(){var e=(0,i5._)(["\n margin: 20px auto 20px;\n text-align: center;\n"]);return xq=function(){return e},e}var xK=i4.default.div.withConfig({displayName:"TemplatesManagementHomePage.styles__SubTitleContainer",componentId:"sc-4ad49e21-0"})(oo||(oo=xD())),xJ=i4.default.h3.withConfig({displayName:"TemplatesManagementHomePage.styles__SubTitle",componentId:"sc-4ad49e21-1"})(oi||(oi=xR()),lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm),xX=i4.default.div.withConfig({displayName:"TemplatesManagementHomePage.styles__GenericItem",componentId:"sc-4ad49e21-2"})(oa||(oa=xA())),x$=i4.default.h4.withConfig({displayName:"TemplatesManagementHomePage.styles__Title",componentId:"sc-4ad49e21-3"})(ol||(ol=xM()),lQ.typography.type.motiva_medium),xZ=i4.default.h4.withConfig({displayName:"TemplatesManagementHomePage.styles__TemplateName",componentId:"sc-4ad49e21-4"})(os||(os=xF()),lQ.typography.type.motiva_medium),xY=i4.default.div.withConfig({displayName:"TemplatesManagementHomePage.styles__TemplateContainer",componentId:"sc-4ad49e21-5"})(oc||(oc=xz())),xQ=i4.default.div.withConfig({displayName:"TemplatesManagementHomePage.styles__ButtonContainer",componentId:"sc-4ad49e21-6"})(ou||(ou=xL())),x0=i4.default.div.withConfig({displayName:"TemplatesManagementHomePage.styles__TemplateRow",componentId:"sc-4ad49e21-7"})(od||(od=xB()),xQ),x1=i4.default.div.withConfig({displayName:"TemplatesManagementHomePage.styles__TemplateContent",componentId:"sc-4ad49e21-8"})(op||(op=xU())),x2=i4.default.p.withConfig({displayName:"TemplatesManagementHomePage.styles__TemplateMeta",componentId:"sc-4ad49e21-9"})(of||(of=xV()),i3.colors.dark_gray_2),x6=e=>({backgroundColor:"inherit !important",margin:0,flexShrink:0,"& svg":{height:e?"12px":"14px",width:e?"12px":"14px"}}),x5=i4.default.li.withConfig({displayName:"TemplatesManagementHomePage.styles__LI",componentId:"sc-4ad49e21-10"})(om||(om=xH())),x4=i4.default.ul.withConfig({displayName:"TemplatesManagementHomePage.styles__UL",componentId:"sc-4ad49e21-11"})(oh||(oh=xW())),x3=i4.default.h3.withConfig({displayName:"TemplatesManagementHomePage.styles__EmptyStateText",componentId:"sc-4ad49e21-12"})(og||(og=xG()),lQ.typography.type.motiva,l0.BREAKPOINTS.sm),x8=i4.default.div.withConfig({displayName:"TemplatesManagementHomePage.styles__EmptyStateContainer",componentId:"sc-4ad49e21-13"})(oy||(oy=xq())),x9=()=>({margin:"0px 0px 20px 0px",flex:"0 0 100% !important",maxWidth:"100% !important"});function x7(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return be(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?be(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function be(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var bn=e=>{var n=e.size,t=e.onAddTemplate,r=e.clients,o=e.templates,i=e.handleDeleteTemplate,a=e.onViewTemplate,l=e.onEditTemplate,s=x7((0,iq.useState)(""),2),c=s[0],u=s[1],d=x7((0,iq.useState)(new Set(["generic"])),2),p=d[0],f=d[1],m=(0,i6.useBreakpoint)(),h=(0,iq.useRef)(!0),g=(0,iq.useMemo)(()=>new Map(r.map(e=>[e.id,e.name])),[r]),y=(0,iq.useMemo)(()=>{var e=e=>{if(!c)return!0;var n,t,r=c.toLowerCase(),o=null==(n=e.name)?void 0:n.toLowerCase().includes(r),i=(e.clientId&&""!==e.clientId?(null==(t=g.get(e.clientId))?void 0:t.toLowerCase())||"":"generic").includes(r);return o||i},n=((null==o?void 0:o.generic)||[]).filter(e),t=((null==o?void 0:o.client)||[]).filter(e),r=new Map([...t.map(e=>[e.clientId,e])]),i=new Map;return t.forEach(e=>{var n,t=null!=(n=i.get(e.clientId))?n:[];t.push(e),i.set(e.clientId,t)}),{generic:n,byClient:i,sortedClientIds:[...r.keys()].sort((e,n)=>(g.get(e)||"").localeCompare(g.get(n)||""))}},[o,r,c,g]),v=(0,iq.useMemo)(()=>{if(!c.trim())return y;var e=c.toLowerCase(),n="generic".includes(e),t=y.generic.filter(n=>n.name.toLowerCase().includes(e)),r=n?y.generic:t,o=new Map,i=[],a=[];return y.sortedClientIds.forEach(n=>{var t=g.get(n)||"",r=y.byClient.get(n)||[],l=t.toLowerCase().includes(e),s=r.filter(n=>n.name.toLowerCase().includes(e));(l||s.length>0)&&(i.push(n),o.set(n,l?r:s)),s.length>0&&a.push(n)}),{generic:r,byClient:o,sortedClientIds:i,templateMatchedClientIds:a,genericMatchedCount:t.length}},[y,c,g]);(0,iq.useEffect)(()=>{if(h.current){h.current=!1;return}if(c.trim()){var e=new Set;v.generic.length>0&&e.add("generic"),v.sortedClientIds.forEach(n=>{e.add(n)}),f(e)}else f(new Set)},[c,v]);var x=v.generic.length>0||v.sortedClientIds.length>0,b=e=>{f(n=>{var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},j=e=>(0,iQ.jsxs)(x0,{children:[(0,iQ.jsxs)(x1,{children:[(0,iQ.jsx)(xZ,{onClick:()=>w(e),children:e.name}),(0,iQ.jsxs)(x2,{children:[e.paperType," \xb7 ",e.dimensions," \xb7 ",e.colors]})]}),(0,iQ.jsxs)(xQ,{children:[(0,iQ.jsx)(i6.Button,{iconOnly:!0,label:"",size:"xs",id:"template_edit_".concat(e.templateId),onClick:n=>C(n,e),customCSS:x6(),children:(0,iQ.jsx)(i6.Icon,{name:"edit"})}),(0,iQ.jsx)(i6.Button,{iconOnly:!0,label:"",size:"xs",id:"template_delete_".concat(e.templateId),onClick:n=>{n.stopPropagation(),i(e.templateId,e.name)},customCSS:x6(),children:(0,iQ.jsx)(i6.Icon,{name:"delete"})})]})]},e.templateId||e.id),w=e=>{a&&a(e)},C=(e,n)=>{e.stopPropagation(),l&&l(n)};return(0,iQ.jsxs)(i6.Container,{customCSS:"max-width: none;overflow-y: auto;",children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(lH,{children:(0,iQ.jsx)(lE,{items:[{label:"Dashboard",link:"./easyprint?action=dashboard"},{label:"Templates"}]})})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:0},children:(0,iQ.jsxs)(i6.Card,{customCSS:{padding:0},isClickable:!1,isHover:!1,children:[(0,iQ.jsxs)(i6.Row,{customCSS:"lg"===(n||("lg"===m||"md"===m?"lg":"sm"))?{padding:"20px"}:{padding:"14px"},children:[(0,iQ.jsx)(i6.Column,{span:6,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(xK,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"material",size:24}),(0,iQ.jsx)(xJ,{children:"Print Job Templates"})]})}),(0,iQ.jsx)(i6.Column,{span:6,customCSS:{textAlign:"end",marginLeft:"6px"},children:(0,iQ.jsx)(ai,{size:"sm",label:"Add Template",onClick:t,icon:"plus",customCSS:{width:"auto",borderRadius:"5px"}})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:0},children:(0,iQ.jsx)(i6.SubSearch,{size:"sm",customCSS:{marginTop:"15p
1x"},placeHolder:"Search templates by name or client...",textValue:c,onSearch:e=>{var n;return u(null!=(n=e.target.value)?n:"")},onSelect:e=>{var n;return u(null!=(n=e.target.value)?n:"")},handleChange:e=>{var n;return u(null!=(n=e.target.value)?n:"")},onClearInput:e=>u("")})})]}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:x9,children:x?(0,iQ.jsxs)(x4,{children:[v.generic.length>0&&(0,iQ.jsxs)(x5,{children:[(0,iQ.jsx)(xX,{children:(0,iQ.jsxs)(i6.Button,{variant:"text",label:p.has("generic")?"Expand":"Collapse",size:"xs",onClick:()=>b("generic"),customCSS:x6(!0),children:[(0,iQ.jsx)(i6.Icon,{name:p.has("generic")?"caret_down":"caret_right",size:14}),(0,iQ.jsx)(x$,{children:"Generic Templates"})]})}),p.has("generic")&&(0,iQ.jsx)(xY,{children:v.generic.map(j)})]}),v.sortedClientIds.map(e=>{var n;return(0,iQ.jsxs)(x5,{children:[(0,iQ.jsx)(xX,{children:(0,iQ.jsxs)(i6.Button,{variant:"text",label:p.has(e)?"Expand":"Collapse",size:"xs",onClick:()=>b(e),customCSS:x6(!0),children:[(0,iQ.jsx)(i6.Icon,{name:p.has(e)?"caret_down":"caret_right",size:14}),(0,iQ.jsx)(x$,{children:g.get(e)})]})}),p.has(e)&&(0,iQ.jsx)(xY,{children:null==v||null==(n=v.byClient.get(e))?void 0:n.map(j)})]},e)})]}):(0,iQ.jsx)(x8,{children:(0,iQ.jsx)(x3,{children:c?'No templates match "'.concat(c,'"'):"No templates created yet."})})})})]})})})]})};function bt(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 12px;\n font-weight: 500;\n margin-bottom: 4px;\n text-transform: none;\n \n ","\n"]);return bt=function(){return e},e}function br(){var e=(0,i5._)(["\n background: ",";\n height: 1px;\n border: none;\n margin: 0px 0px 6px 0px;\n"]);return br=function(){return e},e}function bo(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n line-height: 24px;\n font-weight: bold;\n margin: 0;\n"]);return bo=function(){return e},e}function bi(){var e=(0,i5._)(["\n color: ",";\n font-family: ",";\n font-size: 14px;\n line-height: 24px;\n font-weight: normal;\n margin: 8px 0px;\n"]);return bi=function(){return e},e}function ba(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 112px;\n padding: 16px;\n border: 2px dashed;\n border-radius: 8px;\n cursor: pointer;\n margin: 8px 0px;\n border-color: ",";\n ","\n"]);return ba=function(){return e},e}function bl(){var e=(0,i5._)(["\n font-size: 14px;\n text-align: center;\n font-family: ",";\n margin: 0 0 8px 0;\n"]);return bl=function(){return e},e}function bs(){var e=(0,i5._)(["\n font-size: 12px;\n font-family: ",";\n margin: 0;\n text-align: center;\n overflow-wrap: break-word;\n word-break: break-word;\n padding: 0 8px;\n"]);return bs=function(){return e},e}function bc(){var e=(0,i5._)(["\n font-weight: 600;\n color: ",";\n font-family: ",";\n"]);return bc=function(){return e},e}function bu(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px;\n border-radius: 6px;\n user-select: none;\n ","\n"]);return bu=function(){return e},e}function bd(){var e=(0,i5._)(["\n font-size: 14px;\n font-family: ",";\n text-transform: none;\n"]);return bd=function(){return e},e}function bp(){var e=(0,i5._)(["\n margin-top: 12px;\n"]);return bp=function(){return e},e}function bf(){var e=(0,i5._)(["\n width: 100%;\n border-collapse: collapse;\n margin-bottom: 8px;\n"]);return bf=function(){return e},e}function bm(){var e=(0,i5._)(["\n background-color: #f9fafb;\n \n th {\n padding: 8px 12px;\n text-align: left;\n font-family: ",";\n font-size: 12px;\n font-weight: 600;\n text-transform: uppercase;\n color: ",";\n border-bottom: 1px solid ",";\n white-space: nowrap;\n }\n \n th:nth-child(1) {\n width: 15%;\n min-width: 80px;\n }\n \n th:nth-child(2) {\n width: 20%;\n min-width: 100px;\n }\n \n th:nth-child(3) {\n width: 20%;\n min-width: 100px;\n }\n \n th:nth-child(4) {\n width: 25%;\n min-width: 120px;\n }\n \n th:nth-child(5) {\n width: 5%;\n min-width: 40px;\n }\n"]);return bm=function(){return e},e}function bh(){var e=(0,i5._)(["\n td {\n padding: 8px 12px;\n border-bottom: 1px solid ",";\n }\n \n td:nth-child(4) {\n white-space: nowrap;\n min-width: 120px;\n }\n \n &:last-child td {\n border-bottom: none;\n }\n"]);return bh=function(){return e},e}function bg(){var e=(0,i5._)(["\n display: block;\n font-weight: 600;\n font-family: ",";\n font-size: 14px;\n color: ",";\n white-space: nowrap;\n"]);return bg=function(){return e},e}function by(){var e=(0,i5._)(["\n padding: 4px;\n min-width: auto;\n"]);return by=function(){return e},e}function bv(){var e=(0,i5._)(["\n margin-top: 8px;\n color: "," !important;\n padding: 4px 8px;\n background: transparent !important;\n background-color: transparent !important;\n border: none !important;\n font-weight: 500;\n box-shadow: none !important;\n \n & span,\n & > *,\n & * {\n color: "," !important;\n }\n"]);return bv=function(){return e},e}function bx(){var e=(0,i5._)(["\n & :global(.dropdown-menu),\n & :global([class*=\"dropdown-menu\"]),\n & :global([class*=\"Dropdown-menu\"]) {\
1n max-height: 400px !important;\n overflow-y: auto;\n }\n\n && div[role='button'][aria-disabled='true'] {\n color: rgb(84, 84, 84) !important;\n }\n\n && :global(input::placeholder),\n && input::placeholder {\n color: #4d4d4f !important;\n }\n"]);return bx=function(){return e},e}function bb(){var e=(0,i5._)(["\n background-color: #f9fafb;\n border-radius: 8px;\n padding: 16px;\n margin-top: 8px;\n"]);return bb=function(){return e},e}function bj(){var e=(0,i5._)(["\n display: inline-block;\n margin-bottom: 0;\n margin-right: 12px;\n"]);return bj=function(){return e},e}function bw(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n margin-bottom: 12px;\n"]);return bw=function(){return e},e}function bC(){var e=(0,i5._)(["\n display: inline-flex;\n border-radius: 6px;\n background-color: ",";\n border: 1px solid ",';\n overflow: hidden;\n margin: 0;\n position: relative;\n \n button[data-is-active="false"]:not(:last-child) + button[data-is-active="true"] {\n border-right: n
1one !important;\n }\n \n button:focus {\n z-index: 1;\n position: relative;\n }\n']);return bC=function(){return e},e}function b_(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n font-weight: 500;\n padding: 8px 16px;\n border: none;\n background-color: ",";\n color: ",";\n cursor: ",";\n transition: all 0.2s ease-in-out;\n outline: none;\n position: relative;\n opacity: ",";\n pointer-events: ",';\n \n &[data-is-active="true"] {\n border-left: none;\n border-right: none;\n }\n\n &[data-is-active="false"]:not(:last-child) {\n border-right: 1px solid ',';\n }\n\n &[data-is-active="false"]:not(:last-child) + button[data-is-active="true"] {\n border-left: none;\n }\n \n &:hover:not(:disabled) {\n background-color: ',";\n }\n \n &:active:not(:disabled) {\n background-color: ",";\n }\n \n &:disabled {\n opacity: 0.5;\n }\n \n &:focus-visible {\n box-shadow: 0 0 0 2px ",";\n z-index: 1;\n }\n \n &:focus:not(:focus-visible) {\n outline: none;\n box-shadow: none;\n }\n"]);return b_=function(){return e},e}function bS(){var e=(0,i5._)(['\n & input::placeholder,\n & textarea::placeholder {\n color: #4d4d4f !important;\n }\n\n & input:disabled,\n & input[disabled],\n & textarea:disabled,\n & textarea[disabled] {\n color: rgb(84, 84, 84) !important;\n }\n\n /* Hide clear icon only when inputs are disabled (view mode) */\n & input[disabled] ~ button,\n & input[disabled] ~ span button,\n & input[disabled] + button,\n & input[disabled] ~ svg,\n & input[disabled] ~ * button {\n display: none !important;\n visibility: hidden !important;\n pointer-events: none !important;\n }\n \n /* Hide clear buttons/icons that are siblings of disabled inputs */\n & input[disabled] ~ * button[class*="clear"],\n & input[disabled] ~ * button[class*="Clear"],\n & input[disabled] ~ * [class*="clear"],\n & input[disabled] ~ * [class*="Clear"],\n & input[disabled] ~ button[aria-label*="clear" i],\n & input[disabled] ~ button[aria-label*="Clear" i] {\n display: none !important;\n visibility: hidden !important;\n pointer-events: none !important;\n }\n \n & input[disabled] {\n pointer-events: none;\n }\n']);return bS=function(){return e},e}function bI(){var e=(0,i5._)(["\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 99999 !important;\n width: auto;\n max-width: 90%;\n pointer-events: auto;\n"]);return bI=function(){return e},e}var bE=i4.default.label.withConfig({displayName:"ManageTemplateDrawer.styles__Label",componentId:"sc-95baaf2f-0"})(ov||(ov=bt()),lQ.typography.type.motiva_medium,e=>e.hasSpacing&&"\n display: block;\n margin-bottom: 12px;\n "),bP=i4.default.hr.withConfig({displayName:"ManageTemplateDrawer.styles__Divider",componentId:"sc-95baaf2f-1"})(ox||(ox=br()),i3.colors.light_gray_1),bO=i4.default.h4.withConfig({displayName:"ManageTemplateDrawer.styles__SectionTitle",componentId:"sc-95baaf2f-2"})(ob||(ob=bo()),lQ.typography.type.motiva),bT=i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__Title",componentId:"sc-95baaf2f-3"})(oj||(oj=bi()),i3.colors.dark_gray_1,lQ.typography.type.motiva),bk=i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__DragDropWrapper",componentId:"sc-95baaf2f-4"})(ow||(ow=ba()),i3.colors.ink_light_gray,e=>e.isDragging&&"\n border-color: ".concat(i8.extend.colors.brand["500"],";\n background-color: ").concat(i8.extend.colors.brand["50"],";\n ")),bN=i4.default.p.withConfig({displayName:"ManageTemplateDrawer.styles__UploadText",componentId:"sc-95baaf2f-5"})(oC||(oC=bl()),lQ.typography.type.motiva),bD=i4.default.p.withConfig({displayName:"ManageTemplateDrawer.styles__FileTypeInfo",componentId:"sc-95baaf2f-6"})(o_||(o_=bs()),lQ.typography.type.motiva),bR=i4.default.span.withConfig({displayName:"ManageTemplateDrawer.styles__Highlight",componentId:"sc-95baaf2f-7"})(oS||(oS=bc()),i8.extend.colors.brand["600"],lQ.typography.type.motiva_medium),bA=i4.default.label.withConfig({displayName:"ManageTemplateDrawer.styles__FileLabel",componentId:"sc-95baaf2f-8"})(oI||(oI=bu()),e=>e.isTemplateFile?"\n background-color: ".concat(i3.colors.white,";\n cursor: default;\n pointer-events: auto;\n "):"\n cursor: pointer;\n transition: background 0.15s ease;\n &:hover {\n background-color: #f3f4f6;\n }\n "),bM=i4.default.span.withConfig({displayName:"ManageTemplateDrawer.styles__FileName",componentId:"sc-95baaf2f-9"})(oE||(oE=bd()),lQ.typography.type.motiva_medium),bF=i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__PricingTableWrapper",componentId:"sc-95baaf2f-10"})(oP||(oP=bp())),bz=i4.default.table.withConfig({displayName:"ManageTemplateDrawer.styles__PricingTable",componentId:"sc-95baaf2f-11"})(oO||(oO=bf())),bL=i4.default.thead.withConfig({displayName:"ManageTemplateDrawer.styles__PricingTableHeader",componentId:"sc-95baaf2f-12"})(oT||(oT=bm()),lQ.typography.type.motiva_medium,i3.colors.dark_gray_2,i3.colors.light_gray_1),bB=i4.default.tr.withConfig({displayName:"ManageTemplateDrawer.styles__PricingRow",componentId:"sc-95baaf2f-13"})(ok||(ok=bh()),i3.colors.light_gray_1),bU=i4.default.span.withConfig({displayName:"ManageTemplateDrawer.styles__SellPriceText",componentId:"sc-95baaf2f-14"})(oN||(oN=bg()),lQ.typography.type.motiva_medium,i3.colors.dark_gray_2),bV=(0,i4.default)(i6.Button).withConfig({displayName:"ManageTemplateDrawer.styles__RemoveButton",componentId:"sc-95baaf2f-15"})(oD||(oD=by())),bH=(0,i4.default)(i6.Button).withConfig({displayName:"ManageTemplateDrawer.styles__AddQuantityButton",componentId:"sc-95baaf2f-16"})(oR||(oR=bv()),i8.extend.colors.brand[600],i8.extend.colors.brand[600]),bW=i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__ClientDropdownWrapper",componentId:"sc-95baaf2f-17"})(oA||(oA=bx())),bG=i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__PricingSectionWrapper",componentId:"sc-95baaf2f-18"})(oM||(oM=bb())),bq=(0,i4.default)(bE).withConfig({displayName:"ManageTemplateDrawer.styles__MarkupTypeLabel",componentId:"sc-95baaf2f-19"}
1)(oF||(oF=bj())),bK=i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__MarkupTypeWrapper",componentId:"sc-95baaf2f-20"})(oz||(oz=bw())),bJ=i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__ToggleButtonGroup",componentId:"sc-95baaf2f-21"})(oL||(oL=bC()),i3.colors.white,i3.colors.ink_light_gray),bX=i4.default.button.withConfig({displayName:"ManageTemplateDrawer.styles__ToggleButton",componentId:"sc-95baaf2f-22"})(oB||(oB=b_()),lQ.typography.type.motiva_medium,e=>e.isActive?i8.extend.colors.brand[600]:i3.colors.white,e=>e.isActive?i3.colors.white:i3.colors.dark_gray_2,e=>e.disabled?"not-allowed":"pointer",e=>e.disabled?"0.6":"1",e=>e.disabled?"none":"auto",i3.colors.ink_light_gray,e=>e.isActive?i8.extend.colors.brand[700]:i3.colors.light_gray_1,e=>e.isActive?i8.extend.colors.brand[700]:i3.colors.light_gray_2,i8.extend.colors.brand[500]),b$=i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__ViewModeInputWrapper",componentId:"sc-95baaf2f-23"})(oU||(oU=bS()));i4.default.div.withConfig({displayName:"ManageTemplateDrawer.styles__DrawerToastBarWrapper",componentId:"sc-95baaf2f-24"})(oV||(oV=bI()));var bZ=["fileObj"];function bY(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return bQ(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(bQ(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,bQ(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,bQ(u,"constructor",c),bQ(c,"constructor",s),s.displayName="GeneratorFunction",bQ(c,o,"GeneratorFunction"),bQ(u),bQ(u,o,"Generator"),bQ(u,r,function(){return this}),bQ(u,"toString",function(){return"[object Generator]"}),(bY=function(){return{w:i,m:d}})()}function bQ(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(bQ=function(e,n,t,r){function i(n,t){bQ(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function b0(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function b1(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function b2(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?b1(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b1(Object(t)).forEac
1h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function b6(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||b5(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b5(e,n){if(e){if("string"==typeof e)return b4(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?b4(e,n):void 0}}function b4(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var b3={templateName:"",clientId:"Generic",paperType:"",dimensions:"",colors:"",finishing:"",notes:"",markupType:"PERCENT",markupDataList:[{qty:"",markupValue:""}]},b8=e=>{var n=e.config,t=e.showTemplateDrawer,r=e.onDrawerClose,o=e.clients,i=e.action,a=e.submitTemplate,l=e.selectedTemplate,s=e.size,c=e.onActionChange,u=e.handleDeleteTemplateFile,d=e.handleToastNotification,p=e.handleViewTemplateFile,f=e.handleTemplateFiles,m=(0,iq.useRef)(),h=(0,iq.useRef)(),g=(0,iq.useRef)(null),y=(0,iq.useRef)(null),v=b6((0,iq.useState)(b3),2),x=v[0],b=v[1],j=b6((0,iq.useState)([]),2),w=j[0],C=j[1],_=b6((0,iq.useState)(!1),2),S=_[0],I=_[1],E=b6((0,iq.useState)(!1),2),P=E[0],O=E[1],T=b6((0,iq.useState)("PERCENT"),2),k=T[0],N=T[1],D=b6((0,iq.useState)([{qty:"",cost:"",markupValue:"",sell:""}]),2),R=D[0],A=D[1],M=b6((0,iq.useState)(0),2),F=M[0],z=M[1],L=(0,iq.useMemo)(()=>{var e=[{value:"Generic",text:"Generic (All Clients)",optionHTML:"Generic (All Clients)"}];return(n=>{var t,r=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=b5(e))){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;e.push({value:o.id,text:o.name,optionHTML:o.name})}}catch(e){r.e(e)}finally{r.f()}})(null!=o?o:[]),e},[o]),B=(e,n,t)=>{if(!e||!n)return 0;var r=parseFloat(e),o=parseFloat(n);return isNaN(r)||isNaN(o)?0:t?r*(1+o/100):r+o},U=e=>{if(""===e)return"";var n=e.replace(/[^\d.]/g,""),t=n.split(".");return t.length>2?n="".concat(t[0],".").concat(t.slice(1).join("")):2===t.length&&t[1].length>2&&(n="".concat(t[0],".").concat(t[1].substring(0,2))),n},V=e=>""===e?"":e.replace(/[^\d]/g,""),H=new Set([8,9,27,13,46,35,36,37,38,39,40]),W=new Set([65,67,86,88]),G=e=>H.has(e.keyCode)||W.has(e.keyCode)&&e.ctrlKey,q=e=>{!G(e)&&(e.shiftKey||e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&e.preventDefault()},K=(e,n)=>{if(!G(e)){if(e.shiftKey&&e.keyCode>=48&&e.keyCode<=57)return void e.preventDefault();var t=e.target.selectionStart||0,r=n?n.indexOf("."):-1;if((190===e.keyCode||110===e.keyCode)&&!e.shiftKey){n&&-1!==r&&e.preventDefault();return}if(!e.shiftKey&&(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105)){n&&-1!==r&&t>r&&n.substring(r+1).length>=2&&e.preventDefault();return}e.preventDefault()}},J=(e,n,t)=>{var r=[...R];if("cost"===n){var o=U(t);r[e]=b2(b2({},r[e]),{},{[n]:o})}else if("qty"===n||"markupValue"===n){var i=V(t);r[e]=b2(b2({},r[e]),{},{[n]:i})}else r[e]=b2(b2({},r[e]),{},{[n]:t});if("cost"===n||"markupValue"===n){var a=B(r[e].cost,r[e].markupValue,"PERCENT"===k);r[e].sell=a.toFixed(2)}A(r),h.current&&h.current.setFieldValue("markupDataList",r.map(e=>({qty:e.qty,markupValue:e.markupValue})))},X=e=>{if(R.length>1){var n=R.filter((n,t)=>t!==e);A(n),h.current&&h.current.setFieldValue("markupDataList",n.map(e=>({qty:e.qty,markupValue:e.markupValue})))}},$=(e,n)=>{e.preventDefault(),e.stopPropagation(),I(n)},Z=(e,n,t,r,o,i)=>uz(e,n,t,r,o,i,"attachment").then(e=>{var t=window.URL.createObjectURL(new Blob([e.data])),r=document.createElement("a");r.href=t,r.setAttribute("download","".concat(n)),document.body.appendChild(r),r.click(),r.remove(),window.URL.revokeObjectURL(t),d("Download started successfully","success")}
1).catch(e=>{d("Error has occurred","failure"),console.error("File download error:",e)}),Y=e=>({seqId:(0,mB.A)(),fileName:e.name,fileSize:ds(e.size),fileObj:e}),Q=e=>{if(e){var t=(null==n?void 0:n.maxFileSize)||0x6400000,r=(null==n?void 0:n.maxUploadFileLimit)||15,o=!aH(e.name),i=e.size>t,a=(null==w?void 0:w.length)+1>r;if(o||i||a)return void O(!0);O(!1),f(Y(e),l)}},ee=(e,n,t,r)=>{i!==aN.VIEW&&u(e,n,t,w,r)},en=function(){var e,n=(e=bY().m(function e(n,t,r,o){return bY().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Z(n,t,"","",r,o);case 1:e.n=3;break;case 2:e.p=2,console.error("Template File download error:",e.v);case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){b0(i,r,o,a,l,"next",e)}function l(e){b0(i,r,o,a,l,"throw",e)}a(void 0)})});return function(e,t,r,o){return n.apply(this,arguments)}}(),et=R.some(e=>e.qty&&e.markupValue),er=i!==aN.VIEW||et;return(0,iq.useEffect)(()=>{if(t){var e=setTimeout(()=>{m.current&&m.current.open()},0);y.current=e=>{if("submit"===e.type||"keydown"===e.type&&"Enter"===e.key&&"FORM"===e.target.tagName)return e.preventDefault(),e.stopPropagation(),!1};var n=setTimeout(()=>{var e=document.querySelector("form");e&&y.current&&(e.addEventListener("submit",y.current,{capture:!0}),e.addEventListener("keydown",y.current,{capture:!0}))},100),r=setTimeout(()=>{var e,n,t=document.querySelector('[class*="Drawer-body"], [class*="drawer-body"], [class*="DrawerBody"]');t&&(t.scrollTop=0);var r=null==(e=m.current)||null==(n=e.querySelector)?void 0:n.call(e,'[class*="Drawer-content"], [class*="drawer-content"]');r&&(r.scrollTop=0)},200);if(l&&(i===aN.EDIT||i===aN.VIEW)){var o,a,s,c=l.clientId,u=(null==(o=l.pricing)?void 0:o.markupType)||"PERCENT";b({templateName:l.name||"",clientId:c&&""!==c?c:"Generic",paperType:l.paperType||"",dimensions:(l.dimensions||"").replace(/[×✕✖**]/g,"x"),colors:l.colors||"",finishing:l.finishing||"",notes:l.notes||"",markupType:u,markupDataList:(null==(a=l.pricing)?void 0:a.markupDataList)||[{qty:"",markupValue:""}]}),N(u);var d="PERCENT"===u;A((null==(s=l.pricing)||null==(s=s.markupDataList)?void 0:s.map(e=>{var n=e.cost||"",t=e.markupValue||e.markupVal||"",r=n&&t?B(n,t,d).toFixed(2):"";return{qty:e.qty||"",cost:n,markupValue:t,sell:r}}))||[{qty:"",cost:"",markupValue:"",sell:""}]),C(l.templateFiles||[])}else b(b3),N("PERCENT"),A([{qty:"",cost:"",markupValue:"",sell:""}]),C([]);z(e=>e+1);var p=setTimeout(()=>{h.current&&(h.current.setTouched({},!1),h.current.setErrors({}),h.current.setSubmitting(!1))},250);return()=>{clearTimeout(e),clearTimeout(n),clearTimeout(r),clearTimeout(p);var t=document.querySelector("form");t&&y.current&&(t.removeEventListener("submit",y.current,{capture:!0}),t.removeEventListener("keydown",y.current,{capture:!0})),y.current=null}}m.current&&m.current.close(),b(b3),C([]),O(!1),h.current&&h.current.resetForm()},[t,l,i]),(0,iQ.jsxs)(i6.Drawer,{ref:m,centerTitle:!1,size:"md",onClose:r,children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{children:[i===aN.VIEW?"Print Job Template":i===aN.EDIT?"Update Print Job Template":"Add New Print Job Template",(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsxs)(i6.Drawer.Body,{customCSS:i===aN.VIEW?"\n padding: 16px;\n ":"padding: 16px;",children:[i===aN.VIEW&&(0,iQ.jsx)("style",{children:'\n input[disabled] ~ button,\n input[disabled] ~ span button,\n input[disabled] + button,\n input[disabled] ~ svg,\n input[disabled] ~ * button,\n [class*="clear"][class*="icon"],\n [class*="Clear"][class*="icon"],\n button[aria-label*="clear" i],\n button[aria-label*="Clear" i] {\n display: none !important;\n visibility: hidden !important;\n pointer-events: none !important;\n }\n '}),(0,iQ.jsx)(b$,{children:(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(i6.FormikWrapper,{initialValues:x,onSubmit:e=>{var n=!e.clientId||"Generic"===e.clientId||""===e.clientId,t={templateType:n?"GENERIC":"CLIENT",clientId:n?"":e.clientId,name:e.templateName,paperType:e.paperType,dimensions:e.dimensions,colors:e.colors,finishing:e.finishing,notes:e.notes,type:"template",pricing:{markupType:k,markupDataList:R.filter(e=>e.qty&&e.markupValue).map(e=>({qty:e.qty,cost:e.cost||"",markupValue:e.markupValue}))},templateFiles:w.map(e=>(e.fileObj,function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,bZ)))};i===aN.EDIT&&null!=l&&l.templateId&&(t.templateId=l.templateId),a(t).catch(e=>{console.log("Template submission error:",e)})},callbackFnToFormikRef:e=>{h.current=e},enableReinitialize:!1,validateOnMount:!1,validateOnBlur:!1,validateOnChange:!1,children:[(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{span:"lg"===s?6:12,children:(0,iQ.jsx)(bW,{children:(0,iQ.jsx)(i6.FormikElement,{name:"clientId",component:i6.Dropdown,label:"Client",isRequired:!0,width:"100%",height:"43px",ariaLabel:"Client Name",customCSS:"width: 100%;",onChange:(e,n)=>{h.current&&h.current.setFieldValue("clientId",null!=n?n:"Generic")},options:L,disabled:i===aN.VIEW})})}),(0,iQ.jsx)(i6.Column,{span:"lg"===s?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"templateName",component:i6.TextInput,label:"Template Name",placeholder:"e.g., Standard Brochure",isRequired:!0,ariaLabel:"Template Name",disabled:i===aN.VIEW,autoFocus:!1,clearable:i!==aN.VIEW,allowClear:i!==aN.VIEW})})]}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(bP,{})})}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{span:"lg"===s?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"paperType",component:i6.TextInput,label:"Paper Type",placeholder:"e.g., 100# Gloss Cover",isRequired:!0,ariaLabel:"Paper Type",disabled:i===aN.VIEW,clearable:i!==aN.VIEW,allowClear:i!==aN.VIEW})}),(0,iQ.jsx)(i6.Column,{span:"lg"===s?6:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"dimensions",component:i6.TextInput,label:"Dimensions",placeholder:"8.5x11",isRequired:!0,ariaLabel:"Dimensions",disabled:i===aN.VIEW,clearable:i!==aN.VIEW,allowClear:i!==aN.VIEW})}),(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"colors",component:i6.TextInput,label:"Colors",placeholder:"e.g., 4/4 CMYK",isRequired:!0,ariaLabel:"Colors",disabled:i===aN.VIEW,clearable:i!==aN.VIEW,allowClear:i!==aN.VIEW})}),(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"finishing",component:i6.TextArea,label:"Finishing",placeholder:"e.g., Saddle-stitch, UV Coat, Tri-fold...",isRequired:!0,ariaLabel:"Finishing",disabled:i===aN.VIEW})})]}),(![aN.VIEW,aN.CREATE].includes(i)||w.length>0)&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(bP,{})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsxs)(i6.Column,{span:12,children:[(0,iQ.jsx)(bO,{children:"Die Lines & Templates"}),i!==aN.VIEW&&(0,iQ.jsx)(bT,{children:"Upload any die lines or templates to be included with this job template."}),P&&(0,iQ.jsx)(i6.NotificationBubble,{variant:"failure",textSize:"md",customCSS:"padding:9px;margin:8px 0px;",children:"The file you uploaded doesn't meet our requirements. Please ensure that the file is no larger than ".concat(ds((null==n?void 0:n.maxFileSize)||0x6400000),", is one of the supported file formats and does not exceed ").concat((null==n?void 0:n.maxUploadFileLimit)||15," files total.")}),(0,iQ.jsx)("input",{type:"file",ref:g,onChange:e=>{var n=e.target.files[0];n&&(Q(n),e.target.value="")},style:{display:"none"}}),i!==aN.VIEW&&(0,iQ.jsxs)(bk,{onDragEnter:e=>$(e,!0),onDragOver:e=>$(e,!0),onDragLeave:e=>$(e,!1),onDrop:e=>{$(e,!1),Q(e.dataTransfer.files[0])},onClick:()=>{var e;null==(e=g.current)||e.click()},isDragging:S,"aria-label":"File upload dropzone",children:[(0,iQ.jsxs)(bN,{children:[(0,iQ.jsx)(bR,{children:"Click to upload"})," or drag and drop"]}),(0,iQ.jsx)(bD,{children:"Files should be no larger than 100 MB."}),(0,iQ.jsx)(bD,{children:"We support the following file formats: ".concat(aV.join(","))})]})]})}),w.length>0&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.Card,{padding:"sm",isClickable:!1,customCSS:"\n border-radius: 8px;\n background-color: #f9fafb;\n display: flex;\n flex-direction: column;\n gap: 8px;\n",isHover:!1,children:w.map(e=>(0,iQ.jsxs)(bA,{isTemplateFile:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"paper-supplies",size:22,customCSS:{flexShrink:0}}),(0,iQ.jsx)(bM,{children:e.fileName}),(0,iQ.jsxs)("div",{style:{display:"flex",gap:"4px",marginLeft:"auto",alignItems:"center"},children:[(0,iQ.jsx)(i6.Button,{size:"xs",iconOnly:!0,variant:"text",onClick:n=>{n.stopPropagation(),n.preventDefault(),p(e.seqId,e.fileName,"","","DIE_TEMPLATE",null==l?void 0:l.templateId)},title:"View file",customCSS:{padding:"4px"},children:(0,iQ.jsx)(i6.Icon,{name:"view-on",size:16})}),(0,iQ.jsx)(i6.Button,{size:"xs",iconOnly:!0,variant:"text",onClick:n=>{n.stopPropagation(),n.preventDefault(),en(e.seqId,e.fileName,"DIE_TEMPLATE",null==l?void 0:l.templateId)},title:"Download file",customCSS:{padding:"4px"},children:(0,iQ.jsx)(i6.Icon,{name:"download",size:16})}),i!==aN.VIEW&&(0,iQ.jsx)(i6.Button,{size:"xs",iconOnly:!0,variant:"text",onClick:n=>{n.stopPropagation(),n.preventDefault(),ee(e.seqId,e.fileName,l,"DIE_TEMPLATE")},title:"Delete file",customCSS:{padding:"4px"},children:(0,iQ.jsx)(i6.Icon,{name:"delete",size:16})})]})]},e.seqId))})})})]}),er&&(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(bP,{})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsxs)(i6.Column,{span:12,children:[(0,iQ.jsx)(bO,{children:"Pricing"}),(0,iQ.jsxs)(bG,{children:[i!==aN.VIEW&&(0,iQ.jsxs)(bK,{children:[(0,iQ.jsx)(bq,{children:"Markup Type"}),(0,iQ.jsxs)(bJ,{children:[(0,iQ.jsx)(bX,{type:"button",isActive:"PERCENT"===k,"data-is-active":"PERCENT"===k,onClick:()=>{N("PERCENT"),h.current&&h.current.setFieldValue("markupType","PERCENT"),A(R.map(e=>{if(e.cost&&e.markupValue){var n=B(e.cost,e.markupValue,!0);return b2(b2({},e),{},{sell:n.toFixed(2)})}return e}))},"aria-label":"Percentage markup",children:"%"}),(0,iQ.jsx)(bX,{type:"button",isActive:"AMOUNT"===k,"data-is-active":"AMOUNT"===k,onClick:()=>{N("AMOUNT"),h.current&&h.current.setFieldValue("markupType","AMOUNT"),A(R.map(e=>{if(e.cost&&e.markupValue){var n=B(e.cost,e.markupValue,!1);return b2(b2({},e),{},{sell:n.toFixed(2)})}return e}))},"aria-label":"Amount markup",children:"$"})]})]}),i===aN.VIEW&&(0,iQ.jsxs)(bK,{children:[(0,iQ.jsx)(bq,{children:"Markup Type"}),(0,iQ.jsxs)(bJ,{children:[(0,iQ.jsx)(bX,{type:"button",isActive:"PERCENT"===k,"data-is-active":"PERCENT"===k,disabled:!0,onClick:()=>{},"aria-label":"Percentage markup",children:"%"}),(0,iQ.jsx)(bX,{type:"button",isActive:"AMOUNT"===k,"data-is-active":"AMOUNT"===k,disabled:!0,onClick:()=>{},"aria-label":"Amount markup",children:"$"})]})]}),(0,iQ.jsxs)(bF,{children:[(0,iQ.jsxs)(bz,{children:[(0,iQ.jsxs)(bL,{children:[(0,iQ.jsx)("th",{children:"QTY"}),(0,iQ.jsx)("th",{children:"COST"}),(0,iQ.jsx)("th",{children:"MARKUP"}),(0,iQ.jsx)("th",{children:"SELL"}),(0,iQ.jsx)("th",{})]}),(0,iQ.jsx)("tbody",{children:(i===aN.VIEW?R.filter(e=>e.qty&&e.markupValue):R).map((e,n)=>{var t=i===aN.VIEW?R.findIndex(n=>n===e):n;return(0,iQ.jsxs)(bB,{children:[(0,iQ.jsx)("td",{children:(0,iQ.jsx)(i6.TextInput,{value:e.qty,onChange:e=>J(t,"qty",e.target.value),onKeyDown:q,placeholder:"1000",type:"text",inputMode:"numeric",customCSS:"width: 100%; height: 36px;",disabled:i===aN.VIEW,clearable:i!==aN.VIEW,allowClear:i!==aN.VIEW})}),(0,iQ.jsx)("td",{children:(0,iQ.jsx)(i6.TextInput,{value:e.cost,onChange:e=>J(t,"cost",e.target.value),onKeyDown:n=>K(n,e.cost),placeholder:"0.00",type:"text",inputMode:"decimal",customCSS:"width: 100%; height: 36px;",disabled:i===aN.VIEW,clearable:i!==aN.VIEW,allowClear:i!==aN.VIEW})}),(0,iQ.jsx)("td",{children:(0,iQ.jsx)(i6.TextInput,{value:e.markupValue,onChange:e=>J(t,"markupValue",e.target.value),onKeyDown:q,placeholder:"PERCENT"===k?"50":"0",type:"text",inputMode:"numeric",customCSS:"width: 100%; height: 36px;",disabled:i===aN.VIEW,clearable:i!==aN.VIEW,allowClear:i!==aN.VIEW})}),(0,iQ.jsx)("td",{children:(0,iQ.jsx)(bU,{children:e.sell?"≈ $".concat(parseFloat(e.sell).toFixed(2)):"≈ $0.00"})}),(0,iQ.jsx)("td",{children:R.length>1&&i!==aN.VIEW&&(0,iQ.jsx)(bV,{size:"xs",iconOnly:!0,variant:"text",onClick:()=>X(t),"aria-label":"Delete quantity row",children:(0,iQ.jsx)(i6.Icon,{name:"delete",size:16})})})]},t)})})]}),i!==aN.VIEW&&(0,iQ.jsx)(bH,{variant:"text",size:"sm",onClick:()=>{A([...R,{qty:"",cost:"",markupValue:"",sell:""}])},children:"+ Add Quantity"})]})]})]})})]}),(0,iQ.jsx)(i6.Row,{customCSS:{margin:"0px !important"},children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(bP,{})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"notes",component:i6.TextArea,label:"Notes",placeholder:"Internal notes for this template...",ariaLabel:"Notes",disabled:i===aN.VIEW})})})]},"template-form-".concat(F,"-").concat(t,"-").concat(i))})})})]}),(0,iQ.jsxs)(i6.Drawer.Footer,{children:[(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:r,customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;
1",children:i===aN.VIEW?"Close":"Cancel"}),(0,iQ.jsx)(ai,{size:"sm",type:"button",customCSS:{width:"auto",padding:"7px 19px",height:"auto","border-radius":"5px"},onClick:()=>{i===aN.VIEW?c&&c(aN.EDIT):h.current&&h.current.submitForm()},children:i===aN.VIEW?"Edit Template":i===aN.EDIT?"Update Template":"Save Template"})]})]})]})};function b9(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}var b7=e=>{var n=e.size,t=e.clients,r=e.clientNameLookup,o=e.selectedClientId,i=e.onViewProjectPage,a=e.projects,l=e.openJobDrawer,s=e.selectedProjectId,c=e.setSelectedProjectId,u=e.handleProjectDrawer,d=e.handleEditProject,p=e.handleProjectFiles,f=e.showProjectDetailsDrawer,m=e.activeFilters,h=e.resetStatusFilter,g=e.viewMode,y=(0,iq.useRef)(),v=e=>{e?y.current&&y.current.open():y.current&&y.current.close()},x=(0,iq.useMemo)(()=>{if(!o)return null;var e=du(t,o);return e&&0!==e.length?e[e.length-1]:null},[t,o]),b=(0,iq.useMemo)(()=>null==a?void 0:a.find(e=>e.projectId===s),[a,s]);(0,iq.useEffect)(()=>{f?v(!0):v(!1)},[f,b]);var j=e=>b?(0,iQ.jsx)(mH,{project:b,onViewProjectPage:i,handleEditProject:d,handleProjectDrawer:u,openJobDrawer:l,handleProjectFiles:p,viewMode:g,viewportOffset:e}):(0,iQ.jsx)(lX,{children:(0,iQ.jsxs)(l$,{children:[(0,iQ.jsx)(lZ,{children:(0,iQ.jsx)(i6.Icon,{block:!0,color:"#e5e7eb",name:"weekly-ad"})}),(0,iQ.jsx)("div",{children:"Select a project to view its details and files."})]})}),w=g===aS.BROKER||g===aS.DEVELOPER||g===aS.ADMIN?"sm"!==n||o?120:5:5*(g===aS.PRINTER);return(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsx)(i6.Card,{customCSS:{padding:0,height:"100%"},isClickable:!1,isHover:!1,children:(0,iQ.jsxs)(i6.Row,{customCSS:{height:"100%"},children:[(0,iQ.jsx)(i6.Column,{span:"lg"===n?5:12,customCSS:function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?b9(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b9(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}({margin:"0"},"lg"===n&&{borderRight:"1px solid rgb(229, 231, 235)"}),children:(0,iQ.jsx)(p2,{size:n,clients:t,clientNameLookup:r,client:x,projects:a,onViewProjectPage:i,viewMode:g,onSelectProject:c,handleProjectDrawer:u,selectedProjectId:s,openProjectDetailsDrawer:v,activeFilters:m,resetStatusFilter:h,viewportOffset:w,isDashboardView:!0})}),(0,iQ.jsx)(i6.Column,{span:7*("lg"===n),customCSS:{margin:"0"},children:"lg"===n?j(w):s?(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsxs)(i6.Drawer,{ref:y,centerTitle:!1,size:s?"md":"sm",onClose:()=>{},children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsx)(i6.Drawer.Close,{}),(0,iQ.jsx)(i6.Drawer.Body,{customCSS:"padding:0;",children:j(null)}),(0,iQ.jsx)(i6.Drawer.Footer,{})]})]})}):(0,iQ.jsx)(iQ.Fragment,{})})]})})})})};function je(){var e=(0,i5._)(["\n margin-right: -12px;\n padding-right: 12px;\n overflow-y: auto;\n max-height:calc(40vh - 200px);\n & > * + * {\n margin-top: 8px;\n }\n"]);return je=function(){return e},e}function jn(){var e=(0,i5._)(["\n padding: 10px;\n border-radius: 6px;\n transition: all 150ms ease-in-out;\n border-width: 1px;\n cursor: pointer;\n border-color: transparent;\n ","\n &::before {\n content: none;\n }\n"]);return jn=function(){return e},e}function jt(){var e=(0,i5._)(["\n margin:0;\n font-size: 14px;\n font-weight: 700;\n font-family: ",";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ","\n"]);return jt=function(){return e},e}function jr(){var e=(0,i5._)(["\n font-size: ",";\n margin: 0;\n color:",";\n padding: 0px 5px;\n line-height:24px;\n"]);return jr=function(){return e},e}function jo(){var e=(0,i5._)(["\n font-size: 14px;\n padding: 0px 5px;\n margin: 0;\n color: ",";\n line-height:24px;\n &:hover {\n text-decoration: underline;\n }\n"]);return jo=function(){return e},e}function ji(){var e=(0,i5._)(["\n flex-shrink: 0;\n padding: 2px 8px;\n font-size: 10px;\n font-weight: 600;\n border-radius: 20px;\n line-height:14px;\n background-color:",";
1\n color: ",";\n"]);return ji=function(){return e},e}function ja(){var e=(0,i5._)(["\n margin-top: 32px;\n"]);return ja=function(){return e},e}function jl(){var e=(0,i5._)(["\n padding: 0px 5px;\n font-size: 12px;\n font-weight: 500;\n text-transform: uppercase;\n letter-spacing: 0.6px;\n color:",";\n margin-bottom: 16px;\n"]);return jl=function(){return e},e}function js(){var e=(0,i5._)(["\n display: flex;\n align-items: flex-start;\n"]);return js=function(){return e},e}function jc(){var e=(0,i5._)(["\n width:",";\n height: ",";\n border-radius: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n font-size: ",";\n font-weight: 700;\n background-color: ",";\n"]);return jc=function(){return e},e}function ju(){var e=(0,i5._)(["\n margin-top: 8px;\n font-size: 12px;\n color:",";\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return ju=function(){return e},e}function jd(){var e=(0,i5._)(["\n flex: 1;\n height: 2px;\n background-color:",";\n margin-top: 24px;\n"]);return jd=function(){return e},e}function jp(){var e=(0,i5._)(["\n gap: 6px;\n display: flex;\n flex-direction: column;\n"]);return jp=function(){return e},e}function jf(){var e=(0,i5._)(["\n gap: 8px;\n display: flex;\n align-items: center;\n"]);return jf=function(){return e},e}function jm(){var e=(0,i5._)(["\n font-size: 14px;\n line-height: 20px;\n font-family: ",";\n"]);return jm=function(){return e},e}function jh(){var e=(0,i5._)(["\n font-size: 14px;\n line-height: 20px;\n font-family: ",";\n text-align: center;\n display:flex;\n flex-direction: column;\n gap: 12px;\n"]);return jh=function(){return e},e}function jg(){var e=(0,i5._)(["\n padding: 1.5rem;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n color: #6b7280;\n"]);return jg=function(){return e},e}function jy(){var e=(0,i5._)(["\n margin:0;\n font-size: ",";\n line-height: 28px;\n font-family: ",";\n @media screen and (max-width: ","px) {\n line-height: 20px;\n }\n"]);return jy=function(){return e},e}function jv(){var e=(0,i5._)(["\n margin:0;\n font-size: ",";\n line-height: 28px;\n font-family: ",";\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n }\n @media screen and (max-width: ","px) {\n line-height: 20px;\n }\n"]);return jv=function(){return e},e}function jx(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n"]);return jx=function(){return e},e}function jb(){var e=(0,i5._)(["\n gap:6px;\n display: flex;\n"]);return jb=function(){return e},e}function jj(){var e=(0,i5._)(["\n flex-grow: 1;\n min-width: 0;\n"]);return jj=function(){return e},e}function jw(){var e=(0,i5._)(["\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n"]);return jw=function(){return e},e}function jC(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n"]);return jC=function(){return e},e}function j_(){var e=(0,i5._)(["\n display:flex;\n align-items:center;\n gap:12px;\n padding: 0px 5px;\n"]);return j_=function(){return e},e}function jS(){var e=(0,i5._)(["\n margin: 16px 0px;\n border-bottom: 1px solid rgb(229, 231, 235);\n"]);return jS=function(){return e},e}function jI(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}var jE=i4.default.ul.withConfig({displayName:"ClientView.styles__UL",componentId:"sc-cd8c1c90-0"})(oH||(oH=je())),jP=i4.default.li.withConfig({displayName:"ClientView.styles__LI",componentId:"sc-cd8c1c90-1"})(oW||(oW=jn()),e=>e.isSelected?"\n background-color: ".concat(i8.extend.colors.brand[700],";\n border-color: ").concat(i8.extend.colors.brand[700],";\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n "):"\n &:hover {\n background-color: #f3f4f6;\n border-color: #e5e7eb;\n }\n "),jO=i4.default.p.withConfig({displayName:"ClientView.styles__ClientName",componentId:"sc-cd8c1c90-2"})(oG||(oG=jt()),lQ.typography.type.motiva_bold,e=>e.isSelected?"color: ".concat(i3.colors.white):"color: ".concat(i3.colors.dark_gray_1)),jT=i4.default.p.withConfig({displayName:"ClientView.styles__ClientContact",componentId:"sc-cd8c1c90-3"}
1)(oq||(oq=jr()),e=>"lg"===e.size?"16px":"14px",i3.colors.dark_gray_1),jk=i4.default.a.withConfig({displayName:"ClientView.styles__ClientEmail",componentId:"sc-cd8c1c90-4"})(oK||(oK=jo()),i8.extend.colors.brand["600"]),jN=i4.default.span.withConfig({displayName:"ClientView.styles__ProjectCountBadge",componentId:"sc-cd8c1c90-5"})(oJ||(oJ=ji()),e=>e.isSelected?"#ffffff":"".concat(i8.extend.colors.brand["100"]),e=>e.isSelected?"".concat(i8.extend.colors.brand["600"]):"".concat(i8.extend.colors.brand["700"]));i4.default.div.withConfig({displayName:"ClientView.styles__StatusSection",componentId:"sc-cd8c1c90-6"})(oX||(oX=ja()));var jD=i4.default.h3.withConfig({displayName:"ClientView.styles__StatusTitle",componentId:"sc-cd8c1c90-7"})(o$||(o$=jl()),i3.colors.dark_gray_2);i4.default.div.withConfig({displayName:"ClientView.styles__StatusRow",componentId:"sc-cd8c1c90-8"})(oZ||(oZ=js())),i4.default.div.withConfig({displayName:"ClientView.styles__StatusCircle",componentId:"sc-cd8c1c90-9"})(oY||(oY=jc()),e=>"lg"===e.size?"42px":"35px",e=>"lg"===e.size?"42px":"35px",e=>"lg"===e.size?"18px":"16px",e=>e.bg),i4.default.p.withConfig({displayName:"ClientView.styles__StatusLabel",componentId:"sc-cd8c1c90-10"})(oQ||(oQ=ju()),i3.colors.dark_gray_2),i4.default.div.withConfig({displayName:"ClientView.styles__StatusLine",componentId:"sc-cd8c1c90-11"})(o0||(o0=jd()),i3.colors.light_gray_1);var jR=i4.default.div.withConfig({displayName:"ClientView.styles__PopoverContainer",componentId:"sc-cd8c1c90-12"})(o1||(o1=jp())),jA=i4.default.div.withConfig({displayName:"ClientView.styles__PopoverActionItem",componentId:"sc-cd8c1c90-13"})(o2||(o2=jf())),jM=i4.default.div.withConfig({displayName:"ClientView.styles__PopoverActionItemText",componentId:"sc-cd8c1c90-14"})(o6||(o6=jm()),lQ.typography.type.motiva),jF=i4.default.div.withConfig({displayName:"ClientView.styles__EmptyStateContainer",componentId:"sc-cd8c1c90-15"})(o5||(o5=jh()),lQ.typography.type.motiva);i4.default.div.withConfig({displayName:"ClientView.styles__EmptyContainer",componentId:"sc-cd8c1c90-16"})(o4||(o4=jg()));var jz=i4.default.h3.withConfig({displayName:"ClientView.styles__SubTitle",componentId:"sc-cd8c1c90-17"})(o3||(o3=jy()),e=>"sm"===e.size?"14px":"18px",lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm),jL=i4.default.h3.withConfig({displayName:"ClientView.styles__Name",componentId:"sc-cd8c1c90-18"})(o8||(o8=jv()),e=>"sm"===e.size?"14px":"18px",lQ.typography.type.motiva_bold,l0.BREAKPOINTS.sm),jB=i4.default.div.withConfig({displayName:"ClientView.styles__FilterContainer",componentId:"sc-cd8c1c90-19"})(o9||(o9=jx())),jU=i4.default.div.withConfig({displayName:"ClientView.styles__FilterButtonContainer",componentId:"sc-cd8c1c90-20"})(o7||(o7=jb())),jV=i4.default.div.withConfig({displayName:"ClientView.styles__LeftContainer",componentId:"sc-cd8c1c90-21"})(ie||(ie=jj())),jH=i4.default.div.withConfig({displayName:"ClientView.styles__ClientDetailsContainer",componentId:"sc-cd8c1c90-22"})(it||(it=jw())),jW=i4.default.div.withConfig({displayName:"ClientView.styles__RightContainer",componentId:"sc-cd8c1c90-23"})(ir||(ir=jC())),jG=i4.default.div.withConfig({displayName:"ClientView.styles__SubTitleContainer",componentId:"sc-cd8c1c90-24"})(io||(io=j_())),jq=i4.default.div.withConfig({displayName:"ClientView.styles__Divider",componentId:"sc-cd8c1c90-25"})(ii||(ii=jS())),jK=e=>(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?jI(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jI(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e})({margin:"0px",borderRadius:"6px",padding:"10px",border:"1px solid rgb(229, 231, 235)"},e);function jJ(){var e=(0,i5._)(["\n width:",";\n height: ",";\n border-radius: 20px;\n display: flex;\n align-items: center;\n justify-content: center;
1\n color: white;\n font-size: ",";\n font-weight: 700;\n background-color: ",";\n"]);return jJ=function(){return e},e}function jX(){var e=(0,i5._)(["\n margin-top: 8px;\n font-size: 12px;\n color:",";\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"]);return jX=function(){return e},e}function j$(){var e=(0,i5._)(["\n flex: 1;\n height: 2px;\n background-color:",";\n margin-top: 24px;\n"]);return j$=function(){return e},e}function jZ(){var e=(0,i5._)(["\n display: flex;\n align-items: flex-start;\n"]);return jZ=function(){return e},e}function jY(){var e=(0,i5._)(["\n margin-top: 32px;\n"]);return jY=function(){return e},e}var jQ=e=>({flex:1,minWidth:"0",padding:"8px 4px",borderRadius:"8px",backgroundColor:e?i8.extend.colors.brand["50"]:"transparent",margin:"0",overflow:"visible","&:hover":{background:"".concat(i8.extend.colors.brand["50"]," !important"),boxShadow:"none !important"},"& span":{display:"flex",flexDirection:"column",overflow:"visible"}}),j0=i4.default.div.withConfig({displayName:"DashboardManagementHomePage.styles__StatusCircle",componentId:"sc-bca99b60-0"})(ia||(ia=jJ()),e=>"lg"===e.size?"42px":"35px",e=>"lg"===e.size?"42px":"35px",e=>"lg"===e.size?"18px":"16px",e=>e.bg),j1=i4.default.p.withConfig({displayName:"DashboardManagementHomePage.styles__StatusLabel",componentId:"sc-bca99b60-1"})(il||(il=jX()),i3.colors.dark_gray_2),j2=i4.default.div.withConfig({displayName:"DashboardManagementHomePage.styles__StatusLine",componentId:"sc-bca99b60-2"})(is||(is=j$()),i3.colors.light_gray_1),j6=i4.default.div.withConfig({displayName:"DashboardManagementHomePage.styles__StatusRow",componentId:"sc-bca99b60-3"})(ic||(ic=jZ())),j5=i4.default.div.withConfig({displayName:"DashboardManagementHomePage.styles__StatusSection",componentId:"sc-bca99b60-4"})(iu||(iu=jY()));function j4(){var e=(0,i5._)(["\n font-size: 20px;\n line-height: 24px;\n font-family: ",";\n margin: 0;\n padding: 0;\n"]);return j4=function(){return e},e}function j3(){var e=(0,i5._)(["\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n font-family: ",";\n margin-bottom: 12px;\n padding: 0 5px;\n"]);return j3=function(){return e},e}function j8(){var e=(0,i5._)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]);return j8=function(){return e},e}function j9(){var e=(0,i5._)(["\n max-height: 40vh;\n overflow-y: auto;\n padding: 0 5px;\n"]);return j9=function(){return e},e}function j7(){var e=(0,i5._)(["\n padding :0px;\n border: 1px solid transparent;\n border-radius: 6px;\n cursor: pointer;\n background-color: ",";\n border-color: ",";\n &:hover {\n background-color: ",";\n }\n &::before {\n content: none;\n }\n"]);return j7=function(){return e},e}function we(){var e=(0,i5._)(["\n margin:0;\n font-size: 14px;\n font-weight: 600;\n font-family: ",";\n"]);return we=function(){return e},e}function wn(){var e=(0,i5._)(["\n font-size: 12px;\n padding: 2px 0px;\n margin: 0;\n color:",";\n line-height:20px;\n"]);return wn=function(){return e},e}function wt(){var e=(0,i5._)(["\n flex-shrink: 0;\n padding: 2px 8px;\n font-size: 10px;\n font-weight: 600;\n border-radius: 20px;\n line-height:14px;\n background-color: ",";\n color: ",";\n"]);return wt=function(){return e},e}function wr(){var e=(0,i5._)(["\n flex-grow: 1;\n min-width: 0;\n"]);return wr=function(){return e},e}function wo(){var e=(0,i5._)(["\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n"]);return wo=function(){return e},e}function wi(){var e=(0,i5._)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 4px;\n"]);return wi=function(){return e},e}function wa(){var e=(0,i5._)(["\n font-size: 14px;\n line-height: 20px;\n font-family: ",";\n text-align: center;\n display:flex;\n flex-direction: column;\n padding: 32px;\n"]);return wa=function(){return e},e}var wl=i4.default.h1.withConfig({displayName:"ClientFilterDrawer.styles__Title",componentId:"sc-adbe3904-0"})(id||(id=j4()),lQ.typography.type.motiva_medium),ws=i4.default.h3.withConfig({displayName:"ClientFilterDrawer.styles__SubTitle",componentId:"sc-adbe3904-1"})(ip||(ip=j3()),lQ.typography.type.motiva_bold),wc=i4.default.div.withConfig({displayName:"ClientFilterDrawer.styles__SubTitleContainer",componentId:"sc-adbe3904-2"})(im||(im=j8())),wu=()=>({padding:0,margin:0,"&:hover":{boxShadow:"none !important",background:"none !important"},"& span":{fontSize:"12px"},"& svg":{height:"12px",width:"12px"}}),wd=i4.default.ul.withConfig({displayName:"ClientFilterDrawer.styles__ClientList",componentId:"sc-adbe3904-3"})(ih||(ih=j9())),wp=i4.default.li.withConfig({displayName:"ClientFilterDrawer.styles__ClientItem",componentId:"sc-adbe3904-4"})(ig||(ig=j7()),e=>e.isSelected?"".concat(i8.extend.colors.brand[50]):"transparent",e=>e.isSelected?"".concat(i8.extend.colors.brand[500]):"transparent",e=>e.isSelected?"".concat(i8.extend.colors.brand[50]):"#f3f4f6"),wf=i4.default.p.withConfig({displayName:"ClientFilterDrawer.styles__ClientName",componentId:"sc-adbe3904-5"})(iy||(iy=we()),lQ.typography.type.motiva),wm=i4.default.span.withConfig({displayName:"ClientFilterDrawer.styles__ClientContact",componentId:"sc-adbe3904-6"})(iv||(iv=wn()),i3.colors.dark_gray_2),wh=i4.default.span.withConfig({displayName:"ClientFilterDrawer.styles__ProjectCountBadge",componentId:"sc-adbe3904-7"})(ix||(ix=wt()),i8.extend.colors.brand["100"],i8.extend.colors.brand["700"]),wg=i4.default.div.withConfig({displayName:"ClientFilterDrawer.styles__LeftContainer",componentId:"sc-adbe3904-8"})(ib||(ib=wr())),wy=i4.default.div.withConfig({displayName:"ClientFilterDrawer.styles__RightContainer",componentId:"sc-adbe3904-9"}
1)(ij||(ij=wo())),wv=i4.default.div.withConfig({displayName:"ClientFilterDrawer.styles__ClientDetailsContainer",componentId:"sc-adbe3904-10"})(iw||(iw=wi())),wx=i4.default.div.withConfig({displayName:"ClientFilterDrawer.styles__EmptyState",componentId:"sc-adbe3904-11"})(iC||(iC=wa()),lQ.typography.type.motiva);function wb(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||wj(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wj(e,n){if(e){if("string"==typeof e)return ww(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ww(e,n):void 0}}function ww(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var wC=e=>{var n=e.showDrawer,t=e.onDrawerClose,r=e.clients,o=e.selectedClientId,i=e.projects,a=e.handleSelectClient,l=(0,iq.useRef)(),s=wb((0,iq.useState)(""),2),c=s[0],u=s[1],d=wb((0,iq.useState)("A-Z"),2),p=d[0],f=d[1];(0,iq.useEffect)(()=>{n?l.current&&l.current.open():l.current&&l.current.close()},[n]);var m=(0,iq.useMemo)(()=>{var e=[],n=t=>{var r,o=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=wj(e))){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;e.push(i),i.children&&n(i.children)}}catch(e){o.e(e)}finally{o.f()}};return n(r),e},[r]),h=(0,iq.useMemo)(()=>[...c.trim()?m.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())):m].sort((e,n)=>"A-Z"===p?e.name.localeCompare(n.name):n.name.localeCompare(e.name)),[m,c,p]);return(0,iQ.jsxs)(i6.Drawer,{ref:l,centerTitle:!1,size:"sm",onClose:()=>{t&&t()},children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{children:[(0,iQ.jsx)("div",{}),(0,iQ.jsx)(wl,{children:"Select Client"}),(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{children:(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(ws,{children:"Search"})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(i6.SubSearch,{size:"sm",maxLength:"30",placeHolder:"Search clients...",textValue:c,onSearch:e=>{var n;return u(null!=(n=e.target.value)?n:"")},onSelect:e=>{var n;return u(null!=(n=e.target.value)?n:"")},handleChange:e=>{var n;return u(null!=(n=e.target.value)?n:"")},onClearInput:e=>u("")})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(wc,{children:[(0,iQ.jsxs)(ws,{children:["Clients (",h.length,")"]}),(0,iQ.jsxs)(i6.Button,{onClick:()=>{f(e=>"A-Z"===e?"Z-A":"A-Z")},size:"xs",variant:"text",customCSS:wu,children:[(0,iQ.jsxs)("span",{children:[p," "]}),"A-Z"===p?(0,iQ.jsx)(i6.Icon,{name:"arrow-down",color:"black"}):(0,iQ.jsx)(i6.Icon,{name:"arrow-up",color:"black"})]})]})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(wd,{children:h.length>0?h.map(e=>{var n,t,r=i.filter(n=>n.clientId===e.id&&n.status!==aw.Complete).length,l=o===e.id;return(0,iQ.jsx)(wp,{isSelected:l,onClick:()=>a(e.id),children:(0,iQ.jsxs)(wv,{children:[(0,iQ.jsxs)(wg,{children:[(0,iQ.jsx)(wf,{isSelected:l,title:e.name,children:e.name}),(0,iQ.jsxs)(wm,{children:[null==e||null==(n=e.primaryContact)?void 0:n.firstName," ",null==e||null==(t=e.primaryContact)?void 0:t.lastName]})]}),(0,iQ.jsx)(wy,{children:r>0&&(0,iQ.jsx)(wh,{isSelected:l,children:r})})]})},e.id)}):(0,iQ.jsx)(wx,{children:r.length>0&&c.trim()?(0,iQ.jsxs)("p",{children:['No clients match your search for "',c,'".']}):(0,iQ.jsx)("p",{children:"No clients match the current filters."})})})})]})})]})]})};function w_(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}
1finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||wS(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wS(e,n){if(e){if("string"==typeof e)return wI(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?wI(e,n):void 0}}function wI(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var wE=e=>{var n=e.size,t=e.clients,r=e.clientNameLookup,o=e.addClientClickHandler,i=e.handleEditClient,a=e.handleViewClient,l=e.projects,s=e.selectedClientId,c=e.onSelectClient,u=e.statusFilter,d=e.onStatusFilterChange,p=w_((0,iq.useState)(""),2),f=p[0],m=p[1],h=w_((0,iq.useState)("A-Z"),2),g=h[0],y=h[1],v=w_((0,iq.useState)(!1),2),x=v[0],b=v[1],j=e=>{y(e)},w=(0,iq.useMemo)(()=>{var e=[],n=t=>{var r,o=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=wS(e))){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;e.push(i),i.children&&n(i.children)}}catch(e){o.e(e)}finally{o.f()}};return n(t),e},[t]),C=(0,iq.useMemo)(()=>{var e=[...w],n=[];if(n.length>0){new Date().setHours(0,0,0,0);var t=new Set;l.forEach(e=>{(0===n.length||n.includes(e.status))&&t.add(e.clientId)}),e=e.filter(e=>t.has(e.id))}if(f.trim()){var r=f.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(r))}var o=e=>{var n=l.filter(n=>n.clientId===e);return 0===n.length?0:Math.max(...n.map(e=>new Date(e.updationTs).getTime()))},i=[...e];switch(g){case"Open Projects":return i.sort((e,n)=>{var t=l.filter(n=>n.clientId===e.id&&n.status!==aw.Complete).length,r=l.filter(e=>e.clientId===n.id&&e.status!==aw.Complete).length;return r!==t?r-t:e.name.localeCompare(n.name)});case"Recent":return i.sort((e,n)=>{var t=o(e.id),r=o(n.id);return r!==t?r-t:e.name.localeCompare(n.name)});case"Oldest":return i.sort((e,n)=>{var t=o(e.id),r=o(n.id);return t!==r?t-r:e.name.localeCompare(n.name)});case"Z-A":return i.sort((e,n)=>n.name.localeCompare(e.name));default:return i.sort((e,n)=>e.name.localeCompare(n.name))}},[r,l,f,g]),_=(0,iq.useMemo)(()=>{if(!s)return{selectedClient:null,parentClient:null};var e=du(t,s);return e&&0!==e.length?{selectedClient:e[e.length-1],parentClient:e.length>1?e[e.length-2]:null}:{selectedClient:null,parentClient:null}},[t,s]),S=_.selectedClient,I=_.parentClient,E=(0,iq.useMemo)(()=>{if(!s)return null;var e=Object.fromEntries(Object.values(aw).map(e=>[e,0]));return l.forEach(n=>{n.clientId===s&&e[n.status]++}),e},[l,s]);return(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsx)(i6.Card,{customCSS:{padding:0,height:"100%"},isClickable:!1,isHover:!1,children:(0,iQ.jsxs)(i6.Row,{customCSS:{height:"100%"},children:["lg"===n&&(0,iQ.jsx)(i6.Column,{span:5,customCSS:{margin:"0",borderRight:"1px solid rgb(229, 231, 235)",overflowY:"auto"},children:(0,iQ.jsxs)(i6.Row,{customCSS:{padding:"20px"},children:[(0,iQ.jsxs)(i6.Column,{span:12,customCSS:{margin:"auto 0",display:"flex",justifyContent:"space-between"},children:[(0,iQ.jsxs)(jG,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"shared-user",size:24}),(0,iQ.jsx)(jz,{size:n,children:"Clients"})]}),(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",onClick:o,customCSS:jK,children:(0,iQ.jsx)(i6.Icon,{name:"plus",color:"black"})})]}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"28px 0px 0px 0px"},children:(0,iQ.jsxs)(jB,{children:[(0,iQ.jsx)(i6.SubSearch,{size:"sm",maxLength:"30",placeHolder:"Search clients...",textValue:f,onSearch:e=>{var n;return m(null!=(n=e.target.value)?n:"")},onSelect:e=>{var n;return m(null!=(n=e.target.value)?n:"")},handleChange:e=>{var n;return m(null!=(n=e.target.value)?n:"")},onClearInput:e=>m("")}),(0,iQ.jsx)(i6.Dropdown,{tabIndex:"0",size:"sm",width:"150px",height:"38px",dropdownDirection:"down",options:az,defaultValue:"A-Z",onChange:(e,n)=>j(n.value),ariaLabel:"Sort projects by"}),(0,iQ.jsx)(jU,{children:(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",onClick:()=>{b(!0)},customCSS:jK,children:(0,iQ.jsx)(i6.Icon,{name:"filters",color:"black"})})})]})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(jE,{children:(null==C?void 0:C.length)>0?C.map(e=>{var n=l.filter(n=>n.clientId===e.id&&n.status!==aw.Complete).length,t=s===e.id;return(0,iQ.jsx)(jP,{isSelected:t,onClick:()=>c(e.id),children:(0,iQ.jsxs)(jH,{children:[(0,iQ.jsx)(jV,{children:(0,iQ.jsx)(jO,{isSelected:t,title:e.name,children:e.name})}),(0,iQ.jsx)(jW,{children:(0,iQ.jsx)(jN,{isSelected:t,children:n})})]})},e.id)}):(0,iQ.jsx)(jF,{children:"No clients found."})})})]})}),(0,iQ.jsx)(i6.Column,{span:"lg"===n?7:12,noMargin:!0,children:"lg"===n&&S?(()=>{var e,t,r,o;return(0,iQ.jsxs)(i6.Row,{customCSS:{padding:"20px 0px 20px 20px"},children:[(0,iQ.jsxs)(i6.Column,{span:12,customCSS:{margin:"auto 0",display:"flex",justifyContent:"space-between"},children:[(0,iQ.jsx)(jG,{children:(0,iQ.jsxs)(jL,{size:n,onClick:()=>a(S),children:[" ",I?"".concat(I.name," / ").concat(S.name):S.name]})}),(0,iQ.jsx)(i6.Popover,{minWidth:150,showCaret:!1,id:S.id,"aria-label":"more",position:"left",triggerElement:(0,iQ.jsx)(i6.Button,{customCSS:"margin:0px;",size:"xs",tabIndex:0,iconOnly:!0,variant:"text",children:(0,iQ.jsx)(i6.Icon,{name:"more-top",color:"black"})}),children:(0,iQ.jsx)(jR,{children:(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,variant:"text",customCSS:"margin:auto 0px auto auto;","aria-label":"Edit Client ".concat(null==S?void 0:S.name),"aria-disabled":"false",onClick:()=>i(S),children:(0,iQ.jsxs)(jA,{children:[(0,iQ.jsx)(i6.Icon,{name:"edit",size:16}),(0,iQ.jsx)(jM,{children:"Edit Client"})]})})})})]}),(0,iQ.jsxs)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:[(0,iQ.jsxs)(jT,{size:n,children:[null==S||null==(e=S.primaryContact)?void 0:e.firstName," ",null==S||null==(t=S.primaryContact)?void 0:t.lastName]}),(0,iQ.jsx)(jk,{href:"mailto:".concat(null==S||null==(r=S.primaryContact)?void 0:r.email),children:null==S||null==(o=S.primaryContact)?void 0:o.email})]}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(j5,{children:[(0,iQ.jsx)(jD,{children:"Project Statuses"}),(0,iQ.jsx)(j6,{children:aq.map((e,t)=>(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(i6.Button,{onClick:()=>d(e),customCSS:jQ(u===e),children:[(0,iQ.jsx)(j0,{bg:aJ[e],size:n,children:E[e]}),(0,iQ.jsx)(j1,{children:e})]}),t<aq.length-1&&(0,iQ.jsx)(j2,{})]}))})]})})]})})():"sm"===n?(()=>{var e,t;return(0,iQ.jsx)(iQ.Fragment,{children:(0,iQ.jsxs)(i6.Row,{customCSS:{padding:"14px 0px 14px 14px"},children:[(0,iQ.jsxs)(i6.Column,{span:12,customCSS:{margin:"auto 0",display:"flex",justifyContent:"space-between"},children:[(0,iQ.jsxs)(jG,{children:[(0,iQ.jsx)(i6.Icon,{block:!0,color:"black",name:"shared-user",size:24}),(0,iQ.jsx)(jz,{children:"Clients"})]}),(0,iQ.jsxs)(jU,{children:[(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",onClick:()=>{b(!0)},customCSS:jK,children:(0,iQ.jsx)(i6.Icon,{name:"search",color:"black"})}),(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",onClick:o,customCSS:jK,children:(0,iQ.jsx)(i6.Icon,{name:"plus",color:"black"})})]})]}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(jq,{})}),S?(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0",backgroundColor:"rgb(249 250 251)",borderRadius:"6px"},children:(0,iQ.jsxs)(i6.Row,{customCSS:{padding:"6px"},children:[(0,iQ.jsxs)(i6.Column,{span:12,customCSS:{margin:"auto 0",display:"flex",justifyContent:"space-between"},children:[(0,iQ.jsx)(jG,{children:(0,iQ.jsxs)(jL,{size:n,onClick:()=>a(S),children:[" ",I?"".concat(I.name," / ").concat(S.name):S.name]})}),(0,iQ.jsx)(i6.Button,{size:"xs",tabIndex:0,iconOnly:!0,variant:"outlined",onClick:()=>a(S),customCSS:jK({backgroundColor:"inherit"}),children:(0,iQ.jsx)(i6.Icon,{name:"view-on",color:"black"})})]}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(jT,{size:n,children:[null==S||null==(e=S.primaryContact)?void 0:e.firstName," ",null==S||null==(t=S.primaryContact)?void 0:t.lastName]})}),(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsxs)(j5,{children:[(0,iQ.jsx)(jD,{children:"Project Statuses"}),(0,iQ.jsx)(j6,{children:aq.map((e,t)=>(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(i6.Button,{onClick:()=>d(e),customCSS:jQ(u===e),children:[(0,iQ.jsx)(j0,{bg:aJ[e],size:n,children:E[e]}),(0,iQ.jsx)(j1,{children:e})]}),t<aq.length-1&&(0,iQ.jsx)(j2,{})]}))})]})})]})}):(0,iQ.jsx)(iQ.Fragment,{})]})})})():(0,iQ.jsx)(lX,{children:(0,iQ.jsxs)(l$,{children:[(0,iQ.jsx)(lZ,{children:(0,iQ.jsx)(i6.Icon,{block:!0,color:"#e5e7eb",name:"shared-user"})}),(0,iQ.jsx)("div",{children:"Select a client to view their details and projects."})]})})})]})})})}),(0,iQ.jsx)(wC,{showDrawer:x,onDrawerClose:()=>{b(!1)},clients:t,selectedClientId:s,projects:l,handleSelectClient:e=>{b(!1),c(e)}})]})},wP=e=>{var n=e.size,t=e.projects,r=e.statusFilter,o=e.onStatusFilterChange,i=(0,iq.useMemo)(()=>{var e=Object.fromEntries(Object.values(aw).map(e=>[e,0]));return t.forEach(n=>{e[n.status]++}),e},[t]);return(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,noMargin:!0,children:(0,iQ.jsx)(i6.Card,{customCSS:{padding:0},isClickable:!1,isHover:!1,children:(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Row,{customCSS:{padding:"20px 0px 20px 20px"},children:(0,iQ.jsx)(i6.Column,{span:12,customCSS:{margin:"auto 0"},children:(0,iQ.jsx)(j5,{children:(0,iQ.jsx)(j6,{children:aK.map((e,t)=>(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(i6.Button,{onClick:()=>o(e),customCSS:jQ(r===e),children:[(0,iQ.jsx)(j0,{bg:aJ[e],size:n,children:i[e]}),(0,iQ.jsx)(j1,{children:e})]}),t<aK.length-1&&(0,iQ.jsx)(j2,{})]}))})})})})})})})})},wO=e=>{var n=e.size,t=e.clients,r=e.clientNameLookup,o=e.addClientClickHandler,i=e.handleEditClient,a=e.handleViewClient,l=e.projects,s=e.filteredProjects,c=e.handleEditProject,u=e.onViewProjectPage,d=e.handleProjectJob,p=e.selectedProjectId,f=e.selectedClientId,m=e.setSelectedProjectId,h=e.handleProjectDrawer,g=e.handleProjectFiles,y=e.showProjectDetailsDrawer,v=e.onSelectClient,x=e.handleStatusFilterChange,b=e.statusFilter,j=e.activeFilters,w=e.resetStatusFilter,C=e.viewM
1ode,_="max-width: none; display: grid; gap: 12px",S=C===aS.BROKER||C===aS.DEVELOPER||C===aS.ADMIN?"sm"!==n||f?"".concat(_,"; grid-template-rows: 2fr 3fr"):"".concat(_,"; grid-template-rows: 1fr 4fr"):C===aS.PRINTER?"".concat(_,"; grid-template-rows: 1fr 4fr"):_;return(0,iQ.jsxs)(i6.Container,{customCSS:S,children:[(C===aS.BROKER||C===aS.DEVELOPER||C===aS.ADMIN)&&(0,iQ.jsx)(wE,{size:n,clients:t,clientNameLookup:r,addClientClickHandler:o,handleEditClient:i,handleViewClient:a,projects:l,selectedClientId:f,onSelectClient:v,statusFilter:b,onStatusFilterChange:x}),C===aS.PRINTER&&(0,iQ.jsx)(wP,{size:n,projects:l,statusFilter:b,onStatusFilterChange:x}),(0,iQ.jsx)(b7,{size:n,clients:t,clientNameLookup:r,selectedClientId:f,projects:s,handleEditProject:c,onViewProjectPage:u,openJobDrawer:d,selectedProjectId:p,setSelectedProjectId:m,handleProjectDrawer:h,handleProjectFiles:g,showProjectDetailsDrawer:y,activeFilters:j,resetStatusFilter:w,viewMode:C})]})};function wT(){var e=(0,i5._)(["\n color: ",";\n font-size: 12px;\n line-height: 18px;\n"]);return wT=function(){return e},e}function wk(){var e=(0,i5._)(["\n font-size: 12px;\n color: #0a3161;\n line-height: 18px;\n &:hover {\n text-decoration: underline;\n cursor: pointer;\n }\n"]);return wk=function(){return e},e}function wN(){var e=(0,i5._)(["\n font-size: 20px;\n line-height: 24px;\n margin: 0;\n padding: 0;\n"]);return wN=function(){return e},e}function wD(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n text-align: left;\n gap: 5px;\n"]);return wD=function(){return e},e}function wR(){var e=(0,i5._)(["\n display: flex;\n flex-direction: column;\n text-align: left;\n gap: 5px;\n"]);return wR=function(){return e},e}function wA(){var e=(0,i5._)(["\n display: flex;\n justify-content: space-between;\n gap: 40px;\n @media (max-width: 600px) {\n flex-direction: column;\n }\n"]);return wA=function(){return e},e}function wM(){var e=(0,i5._)(["\n flex: 1;\n"]);return wM=function(){return e},e}function wF(){var e=(0,i5._)(["\n font-size: 14px;\n color: #888;\n margin-bottom: 4px;\n"]);return wF=function(){return e},e}function wz(){var e=(0,i5._)(["\n font-size: 16px;\n font-weight: 500;\n margin-bottom: 16px;\n"]);return wz=function(){return e},e}function wL(){var e=(0,i5._)(["\n font-size: 16px;\n font-weight: 500;\n color: #1a73e8;\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n"]);return wL=function(){return e},e}function wB(){var e=(0,i5._)(["\n width: 100%;\n border-top: 1px solid lightgrey;\n margin-top: 7px;\n"]);return wB=function(){return e},e}function wU(){var e=(0,i5._)(["\n font-size: 16px;\n font-weight: 500;\n"]);return wU=function(){return e},e}function wV(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 16px;\n line-height: 20px;\n"]);return wV=function(){return e},e}function wH(){var e=(0,i5._)(["\n font-family: ",";\n color: ",";\n font-size: 16px;\n line-height: 20px;\n"]);return wH=function(){return e},e}function wW(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 14px;\n line-height: 18px;\n display: flex;\n align-items: center;\n margin: 12px 0;\n justify-content: space-between;\n @media screen and (max-width: ","px) {\n font-size: 12px;\n flex-direction: column;\n gap: 12px;\n }\n"]);return wW=function(){return e},e}function wG(){var e=(0,i5._)(["\n background: ",";\n height: 1px;\n border: none;\n margin: 20px 0px 20px 0px;\n"]);return wG=function(){return e},e}function wq(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 18px;\n line-height: 24px;\n font-weight: bold;\n margin: 0;\n"]);return wq=function(){return e},e}function wK(){var e=(0,i5._)(["\n background: #f9fafb;\n padding: 12px 16px;\n border-radius: 5px;\n border: 1px solid #e5e7eb;\n margin-top: 12px;\n"]);return wK=function(){return e},e}function wJ(){var e=(0,i5._)(["\n font-family: ",";\n color: ",";\n font-size: 12px;\n line-height: 16px;\n"]);return wJ=function(){return e},e}function wX(){var e=(0,i5._)(["\n & input::placeholder,\n & textarea::placeholder {\n color: #4d4d4f !important;\n }\n"]);return wX=function(){return e},e}var w$=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__ClientSince",componentId:"sc-9ea500ca-0"})(i_||(i_=wT()),i3.colors.medium_gray_1),wZ=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__ProjectLink",componentId:"sc-9ea500ca-1"})(iS||(iS=wk())),wY=i4.default.h1.withConfig({displayName:"ManageClientDrawer.styles__ProjectTitle",componentId:"sc-9ea500ca-2"})(iI||(iI=wN())),wQ=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__DrawerViewHeader",componentId:"sc-9ea500ca-3"})(iE||(iE=wD())),w0=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__DrawerDetailsSection",componentId:"sc-9ea500ca-4"})(iP||(iP=wR())),w1=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__TwoColumnLayout",componentId:"sc-9ea500ca-5"})(iO||(iO=wA())),w2=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__InfoColumn",componentId:"sc-9ea500ca-6"})(iT||(iT=wM())),w6=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__InfoLabel",componentId:"sc-9ea500ca-7"})(ik||(ik=wF())),w5=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__InfoValue",componentId:"sc-9ea500ca-8"})(iN||(iN=wz())),w4=i4.default.a.withConfig({displayName:"ManageClientDrawer.styles__EmailLink",componentId:"sc-9ea500ca-9"})(iD||(iD=wL())),w3=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__LineBreak",componentId:"sc-9ea500ca-10"})(iR||(iR=wB())),w8=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__LocationText",componentId:"sc-9ea500ca-11"})(iA||(iA=wU()));i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__CheckboxHeading",componentId:"sc-9ea500ca-12"})(iM||(iM=wV()),lQ.typography.type.motiva),i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__CheckboxText",componentId:"sc-9ea500ca-13"})(iF||(iF=wH()),lQ.typography.type.motiva,i3.colors.medium_gray_1);var w9=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__ContactHeadingContainer",componentId:"sc-9ea500ca-14"})(iz||(iz=wW()),lQ.typography.type.motiva,l0.BREAKPOINTS.sm),w7=i4.default.hr.withConfig({displayName:"ManageClientDrawer.styles__Divider",componentId:"sc-9ea500ca-15"})(iL||(iL=wG()),i3.colors.light_gray_1),Ce=i4.default.h4.withConfig({displayName:"ManageClientDrawer.styles__SectionTitle",componentId:"sc-9ea500ca-16"})(iB||(iB=wq()),lQ.typography.type.motiva),Cn=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__SectionContainer",componentId:"sc-9ea500ca-17"})(iU||(iU=wK())),Ct=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__ParentClientContainer",componentId:"sc-9ea500ca-18"})(iV||(iV=wJ()),lQ.typography.type.motiva,i3.colors.medium_gray_1),Cr=i4.default.div.withConfig({displayName:"ManageClientDrawer.styles__FormInputWrapper",componentId:"sc-9ea500ca-19"})(iH||(iH=wX()));function Co(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return Ci(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");
1if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(Ci(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ci(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ci(u,"constructor",c),Ci(c,"constructor",s),s.displayName="GeneratorFunction",Ci(c,o,"GeneratorFunction"),Ci(u),Ci(u,o,"Generator"),Ci(u,r,function(){return this}),Ci(u,"toString",function(){return"[object Generator]"}),(Co=function(){return{w:i,m:d}})()}function Ci(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(Ci=function(e,n,t,r){function i(n,t){Ci(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function Ca(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function Cl(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){Ca(i,r,o,a,l,"next",e)}function l(e){Ca(i,r,o,a,l,"throw",e)}a(void 0)})}}function Cs(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function Cc(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Cs(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Cs(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Cu(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return Cd(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Cd(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cd(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var Cp=e=>{var n,t,r,o,i,a,l,s,c,u,d=e.showDrawer,p=e.onDrawerClose,f=e.action,m=e.addClientHandler,h=e.selectedClient,g=e.parentClients,y=e.editClientHandler,v=e.handleEditClient,x=e.handleViewProject,b=e.users,j=e.clients,w=(0,iq.useRef)(),C=(0,iq.useRef)(),_=(0,i6.useBreakpoint)(),S=Cu((0,iq.useState)({}),2),I=S[0],E=S[1],P=Cu((0,iq.useState)(!1),2),O=P[0],T=P[1],k=Cu((0,iq.useState)("newContact"),2),N=k[0],D=k[1],R=Cu((0,iq.useState)([]),2),A=R[0],M=R[1];(0,iq.useEffect)(()=>{if(d){if(w.current&&w.current.open(),f===aN.CREATE)E({primaryUser:"",name:"",firstName:"",lastName:"",role:"",email:"",ph
1one:"",address1:"",address2:"",city:"",state:"",zipCode:"",notes:""});else if(f===aN.EDIT&&h){var e,n,t,r,o,i,a,l,s,c;E({id:h.id,primaryUser:h.primaryUser||"",userId:h.primaryUser||"",name:h.name||"",firstName:(null==h||null==(e=h.primaryContact)?void 0:e.firstName)||"",lastName:(null==h||null==(n=h.primaryContact)?void 0:n.lastName)||"",role:(null==h||null==(t=h.primaryContact)?void 0:t.jobTitle)||"",email:(null==h||null==(r=h.primaryContact)?void 0:r.email)||"",phone:(null==h||null==(o=h.primaryContact)?void 0:o.phone)||"",address1:(null==h||null==(i=h.location)?void 0:i.address1)||"",address2:(null==h||null==(a=h.location)?void 0:a.address2)||"",city:(null==h||null==(l=h.location)?void 0:l.city)||"",state:(null==h||null==(s=h.location)?void 0:s.state)||"",zipCode:(null==h||null==(c=h.location)?void 0:c.zipCode)||"",notes:h.notes||"",username:h.primaryUserName})}}else w.current&&w.current.close()},[d,h,f]);var F=(0,iq.useMemo)(()=>{if(!h||!(null!=j&&j.length)||!(null!=b&&b.length))return[];var e=function(e,n){for(var t=new Map(e.map(e=>[e.id,e])),r=[],o=n;o;){r.push(o);var i=t.get(o);if(!i)break;o=(null==i?void 0:i.parentId)||null}return r}(j,null==h?void 0:h.id);return b.filter(n=>e.includes(String(n.orgId))).map(e=>{var n,t,r;return{text:"".concat(null==e||null==(n=e.contact)?void 0:n.firstName," ").concat(null==e||null==(t=e.contact)?void 0:t.lastName," (").concat(null==e||null==(r=e.contact)?void 0:r.email,")"),value:e.id}})},[j,h]);(0,iq.useEffect)(()=>{if(f===aN.EDIT&&O){var e,n={firstName:"",lastName:"",role:"",email:"",phone:"",userId:"",primaryUser:""};E(Cc(Cc({},(null==(e=C.current)?void 0:e.values)||I),n)),C.current&&Object.entries(n).forEach(e=>{var n,t,r,o,i,a,l=(0,i$._)(e,2),s=l[0],c=l[1];null==(n=C.current)||null==(t=n.setFieldValue)||t.call(n,s,c,!1),null==(r=C.current)||null==(o=r.setFieldError)||o.call(r,s,void 0),null==(i=C.current)||null==(a=i.setFieldTouched)||a.call(i,s,!1,!1)})}},[O,N]),(0,iq.useEffect)(()=>{uK().then(e=>{var n;M((null==e||null==(n=e.data)||null==(n=n.roles)?void 0:n.map(e=>({value:e.id,text:e.name,optionHTML:e.name})))||[])}).catch(e=>{console.log("ERROR ",e)})},[]);var z=e=>{f===aN.EDIT&&h?(O&&"newContact"==N&&(e.isNewContact=!0),O&&"useExisting"==N&&(e.primaryUser=e.userId||e.primaryUser),e.parentId=g&&g.length>0?g[g.length-1].id:null,y(h.id,e)):(e.parentId=g&&g.length>0?g[g.length-1].id:null,m(e)),H()},L=(0,iq.useCallback)((e,n)=>{n&&(e.setFieldValue("userId",n,!1),e.setFieldTouched("userId",!0,!1),e.setFieldError("userId",void 0))},[]),B=(0,iq.useCallback)(e=>{var n;return!!(null!=(n=e.values)&&n.userId)||(e.setFieldTouched("userId",!0,!1),e.setFieldError("userId","Required"),!1)},[]),U=(0,iq.useCallback)(function(){var e=Cl(Co().m(function e(n){var t,r;return Co().w(function(e){for(;;)switch(e.p=e.n){case 0:return L(n,null==(t=n.values)?void 0:t.userId),e.n=1,new Promise(e=>setTimeout(e,0));case 1:return e.n=2,n.validateForm();case 2:if((r=e.v).userId&&(delete r.userId,n.setErrors(r)),0!==Object.keys(r).length){e.n=6;break}return n.setSubmitting(!0),e.p=3,e.n=4,z(n.values);case 4:return e.p=4,n.setSubmitting(!1),e.f(4);case 5:return e.a(2,!0);case 6:return e.a(2,!1)}},e,null,[[3,,4,5]])}));return function(n){return e.apply(this,arguments)}}(),[L,z]),V=(0,iq.useCallback)(Cl(Co().m(function e(){return Co().w(function(e){for(;;)switch(e.n){case 0:if(C.current){e.n=1;break}return e.a(2);case 1:if(!(f===aN.EDIT&&O&&"useExisting"===N)){e.n=4;break}if(B(C.current)){e.n=2;break}return e.a(2);case 2:return e.n=3,U(C.current);case 3:if(!e.v){e.n=4;break}return e.a(2);case 4:return e.n=5,C.current.submitForm();case 5:return e.a(2)}},e)})),[f,O,N,B,U]),H=()=>{E({}),T(!1),D("newContact"),p&&p()};return(0,iQ.jsxs)(i6.Drawer,{ref:w,centerTitle:!1,size:"lg",onClose:H,children:[(0,iQ.jsx)(iq.Fragment,{}),(0,iQ.jsxs)(i6.Drawer.Content,{children:[(0,iQ.jsxs)(i6.Drawer.Title,{customCSS:f==aN.VIEW&&"height: 130px;",children:[(0,iQ.jsx)("div",{}),f==aN.CREATE?(0,iQ.jsxs)(wQ,{children:[g&&g.length>0&&(0,iQ.jsx)(Ct,{children:null==g?void 0:g.map(e=>"".concat(e.name," / ")).join("")}),(0,iQ.jsx)(wY,{children:"Add New Client"})]}
1):f==aN.EDIT?(0,iQ.jsxs)(wQ,{children:[g&&g.length>0&&(0,iQ.jsx)(Ct,{children:null==g?void 0:g.map(e=>"".concat(e.name," / ")).join("")}),(0,iQ.jsx)(wY,{children:"Edit Client"})]}):f==aN.VIEW?(0,iQ.jsxs)(wQ,{children:[g&&g.length>0&&(0,iQ.jsx)(Ct,{children:null==g?void 0:g.map(e=>"".concat(e.name," / ")).join("")}),(0,iQ.jsx)(wY,{children:null==h?void 0:h.name}),(0,iQ.jsxs)(w$,{children:["Client Since: ",(null==h?void 0:h.dateAdded)||"08/15/22"]}),(0,iQ.jsx)(wZ,{onClick:()=>x(null==h?void 0:h.id),children:"View Projects"})]}):"",(0,iQ.jsx)(i6.Drawer.Close,{})]}),(0,iQ.jsx)(i6.Drawer.Body,{children:(0,iQ.jsx)(Cr,{children:f==aN.CREATE||f==aN.EDIT?(0,iQ.jsxs)(i6.FormikWrapper,{initialValues:I,onSubmit:z,callbackFnToFormikRef:e=>{C.current=e},enableReinitialize:!0,validationSchema:dP,children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"name",component:i6.TextInput,label:"Client Name",placeholder:"Enter client name",isRequired:!0,ariaLabel:"client name"})})}),(0,iQ.jsx)(w7,{}),(0,iQ.jsx)(Ce,{children:"Primary Contact"}),f===aN.EDIT&&(0,iQ.jsxs)(w9,{children:[(0,iQ.jsx)("div",{children:"The primary contact is an existing user. Changes will update their profile."}),(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:()=>{if(O){var e,n,t,r,o,i={firstName:(null==h||null==(e=h.primaryContact)?void 0:e.firstName)||"",lastName:(null==h||null==(n=h.primaryContact)?void 0:n.lastName)||"",role:(null==h||null==(t=h.primaryContact)?void 0:t.jobTitle)||"",email:(null==h||null==(r=h.primaryContact)?void 0:r.email)||"",phone:(null==h||null==(o=h.primaryContact)?void 0:o.phone)||""};C.current&&Object.entries(i).forEach(e=>{var n,t,r=(0,i$._)(e,2),o=r[0],i=r[1];null==(n=C.current)||null==(t=n.setFieldValue)||t.call(n,o,i,!1)}),D("newContact")}T(!O)},customCSS:"white-space: nowrap; margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:O?"Cancel Change":"Change Primary Contact"})]}),O&&(0,iQ.jsx)(i6.Radio,{id:"sparqId",onChange:e=>D(e),options:[{id:0,text:"Create new contact",value:"newContact"},{id:1,text:"Assign existing user",value:"useExisting"}],orientation:"xs"==_?"vertical":"horizontal",selectedValue:N,customCSS:"margin:".concat("xs"==_?"0 0 10px":"0","; padding: 0")}),(f!=aN.EDIT||O&&"newContact"==N)&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.NotificationBubble,{variant:"info",maxWidth:!0,customCSS:"margin: 0 0 10px; padding: 10px;",children:"This will create a new user account for this person."})})}),f===aN.EDIT&&O&&"useExisting"===N&&(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,label:"Select User",placeholder:"Select User",width:"100%",onChange:(e,n)=>{var t,r,o,i,a,l=n||(null==e?void 0:e.value)||e;if(l){var s=b.find(e=>e.id===l);if(s){var c=(null==s||null==(t=s.contact)?void 0:t.jobTitle)||"";if(A.length>0){var u=A.find(e=>e.value===c||e.text===c||e.optionHTML===c);u&&(c=u.value)}C.current&&(C.current.setFieldValue("userId",l,!1),C.current.setFieldTouched("userId",!1,!1),C.current.setFieldError("userId",void 0),C.current.setFieldValue("primaryUser",l,!1),C.current.setFieldValue("firstName",(null==s||null==(r=s.contact)?void 0:r.firstName)||"",!1),C.current.setFieldValue("lastName",(null==s||null==(o=s.contact)?void 0:o.lastName)||"",!1),C.current.setFieldValue("email",(null==s||null==(i=s.contact)?void 0:i.email)||"",!1),C.current.setFieldValue("phone",(null==s||null==(a=s.contact)?void 0:a.phone)||"",!1),C.current.setFieldValue("role",c,!1))}}},customCSS:"width: 100%; margin-top: 3px;",name:"userId",isRequired:!0,options:F})})}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"firstName",component:i6.TextInput,label:"First Name",maxLength:15,disabled:f===aN.EDIT&&"useExisting"===N,placeholder:f===aN.EDIT&&"useExisting"===N?"Choose user":"Enter first name",isRequired:f===aN.CREATE||f===aN.EDIT&&"newContact"===N,ariaLabel:"first name"})}),(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"lastName",component:i6.TextInput,label:"Last Name",maxLength:20,disabled:f===aN.EDIT&&"useExisting"===N,placeholder:f===aN.EDIT&&"useExisting"===N?"Choose user":"Enter last name",isRequired:f===aN.CREATE||f===aN.EDIT&&"newContact"===N,ariaLabel:"last name"})})]}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"email",component:i6.TextInput,label:"Email",disabled:f===aN.EDIT&&("useExisting"===N||!O),placeholder:f===aN.EDIT&&"useExisting"===N?"Choose user":"Enter Email",isRequired:f===aN.CREATE||f===aN.EDIT&&"newContact"===N,type:"email",ariaLabel:"Email"})}),(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"phone",component:i6.TextInput,label:"Phone",disabled:f===aN.EDIT&&"useExisting"===N,placeholder:f===aN.EDIT&&"useExisting"===N?"Choose user":"Enter phone",isRequired:!0,type:"phone",ariaLabel:"Phone"})})]}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.Dropdown,label:"Client Role",placeholder:"Select role",width:"100%",customCSS:"width: 100%; margin-top: 3px;",name:"role",isRequired:!0,options:A})}),(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:0})]}),(0,iQ.jsx)(w7,{}),(0,iQ.jsx)(Ce,{children:"Location"}),(0,iQ.jsxs)(Cn,{children:[(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"address1",component:i6.LocationSearchInput,label:"Address 1",placeholder:"Enter address 1",isRequired:!0,ariaLabel:"address 1",fieldsToPopulate:["zipCode","city","state"]})})}),(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{span:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"address2",component:i6.TextInput,label:"Address 2",placeholder:"Enter address 2",isRequired:!1,ariaLabel:"address 2"})})}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:6,spanMD:6,spanSM:6,spanXS:12,children:(0,iQ.jsx)(i6.FormikElement,{name:"city",component:i6.TextInput,label:"City",placeholder:"Enter city",isRequired:!0,ariaLabel:"city"})}),(0,iQ.jsx)(i6.Column,{spanLG:3,spanMD:3,spanSM:3,spanXS:6,children:(0,iQ.jsx)(i6.FormikElement,{name:"state",component:i6.Dropdown,label:"State",isRequired:!0,options:aF,customCSS:"width: 100%; margin-top: 3px; background: white;",ariaLabel:"state",width:"100%"})}),(0,iQ.jsx)(i6.Column,{spanLG:3,spanMD:3,spanSM:3,spanXS:6,children:(0,iQ.jsx)(i6.FormikElement,{name:"zipCode",component:i6.TextInput,label:"Zip Code",placeholder:"Enter zip code",isRequired:!0,type:"text",validate:e=>{var n=e&&e.trim().length>0?e.trim():null;if(n&&(!new RegExp(/^[0-9]{5}$|[0-9]{5}[-][0-9]{4}$/).test(n)||n.length<5))return"Invalid ZIP code"},fieldsToPopulate:["city","state"],maxLength:10,ariaLabel:"zip code"})})]})]}),(0,iQ.jsx)(w7,{}),(0,iQ.jsx)(Ce,{children:"Notes"}),(0,iQ.jsxs)(i6.Row,{children:[(0,iQ.jsx)(i6.Column,{spanLG:12,children:(0,iQ.jsx)(i6.FormikElement,{component:i6.TextArea,placeholder:"Add any relevant notes for this client",label:"",isRequired:!1,maxLength:1e3,name:"notes",customCSS:"width: 100%;",height:115})}),(0,iQ.jsx)(i6.Column,{spanLG:2,spanMD:2,spanSM:2,spanXS:0})]})]}):(0,iQ.jsxs)(iQ.Fragment,{children:[(0,iQ.jsxs)(w0,{children:[(0,iQ.jsx)(Ce,{children:"Primary Information"}),(0,iQ.jsx)(w3,{}),(0,iQ.jsx)(Cn,{children:(0,iQ.jsxs)(w1,{children:[(0,iQ.jsxs)(w2,{children:[(0,iQ.jsx)(w6,{children:"Primary Contact"}),(0,iQ.jsxs)(w5,{children:[null==h||null==(n=h.primaryContact)?void 0:n.firstName," ",null==h||null==(t=h.primaryContact)?void 0:t.lastName]}),(0,iQ.jsx)(w6,{children:"Primary Contact Phone"}),(0,iQ.jsx)(w5,{children:null==h||null==(r=h.primaryContact)?void 0:r.phone})]}),(0,iQ.jsxs)(w2,{children:[(0,iQ.jsx)(w6,{children:"Primary Contact Role"}),(0,iQ.jsx)(w5,{children:null==h||null==(o=h.primaryContact)?void 0:o.role}),(0,iQ.jsx)(w6,{children:"Primary Contact Email"}),(0,iQ.jsx)(w4,{href:"mailto:".concat(null==h||null==(i=h.primaryContact)?void 0:i.email),children:null==h||null==(a=h.primaryContact)?void 0:a.email})]})]})})]}),(0,iQ.jsx)("br",{}),(0,iQ.jsx)("br",{}),(0,iQ.jsxs)(w0,{children:[(0,iQ.jsx)(Ce,{children:"Location"}),(0,iQ.jsx)(w3,{}),(0,iQ.jsx)(Cn,{children:(0,iQ.jsx)(w1,{children:(0,iQ.jsxs)(w2,{children:[(0,iQ.jsx)(w8,{children:null==h||null==(l=h.location)?void 0:l.address1}),(0,iQ.jsxs)(w8,{children:[null==h||null==(s=h.location)?void 0:s.city,", ",null==h||null==(c=h.location)?void 0:c.state," ",null==h||null==(u=h.location)?void 0:u.zipCode]})]})})})]}),(0,iQ.jsx)("br",{}),(0,iQ.jsx)("br",{}),(null==h?void 0:h.notes)&&(0,iQ.jsxs)(w0,{children:[(0,iQ.jsx)(Ce,{children:"Notes"}),(0,iQ.jsx)(w3,{}),(0,iQ.jsx)(Cn,{children:(0,iQ.jsx)(w1,{children:(0,iQ.jsx)(w2,{children:(0,iQ.jsx)(w8,{children:null==h?void 0:h.notes})})})})]})]})})}),(0,iQ.jsxs)(i6.Drawer.Footer,{children:[(0,iQ.jsx)(i6.Button,{variant:"secondary",size:"sm",onClick:p,customCSS:"margin-top: 0; margin-bottom: 0; border-radius: 5px;",children:"Cancel"}),(0,iQ.jsx)(ai,{size:"sm",customCSS:{width:"auto",padding:"7px 19px",height:"100%","border-radius":"5px"},onClick:()=>f===aN.VIEW?v(h):V(),children:f===aN.VIEW?"Edit Client":f===aN.EDIT?"Save & Close":"Add Client"})]})]})]})};function Cf(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return Cm(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");
1if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(Cm(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Cm(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Cm(u,"constructor",c),Cm(c,"constructor",s),s.displayName="GeneratorFunction",Cm(c,o,"GeneratorFunction"),Cm(u),Cm(u,o,"Generator"),Cm(u,r,function(){return this}),Cm(u,"toString",function(){return"[object Generator]"}),(Cf=function(){return{w:i,m:d}})()}function Cm(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(Cm=function(e,n,t,r){function i(n,t){Cm(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function Ch(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function Cg(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){Ch(i,r,o,a,l,"next",e)}function l(e){Ch(i,r,o,a,l,"throw",e)}a(void 0)})}}function Cy(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}var Cv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=String((null==e?void 0:e.userType)||"BROKER").toUpperCase(),r=null==e?void 0:e.profileId,o=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Cy(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Cy(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}({userType:t},("PRINTER"===t||"CLIENT"===t)&&r&&{profileId:r});return n&&(o.fetchNotificationCountFl=!0),o},Cx=e=>(function(){var n=Cg(Cf().m(function n(t){var r,o,i,a,l,s;return Cf().w(function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,a=Cv(e,!0),n.n=1,uG(a);case 1:return t(mb((null==(l=n.v)||null==(r=l.data)?void 0:r.unreadNotificationsCount)||(null==l||null==(o=l.data)?void 0:o.count)||(null==l||null==(i=l.data)?void 0:i.notificationsCount)||0)),n.a(2,l);case 2:throw n.p=2,console.error("Error fetching notification count:",s=n.v),s;case 3:return n.a(2)}},n,null,[[0,2]])}));return function(e){return n.apply(this,arguments)}})(),Cb=e=>(function(){var n=Cg(Cf().m(function n(t){var r,o,i,a,l,s;return Cf().w(function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,r=Cv(e),n.n=1,uG(r);case 1:return o=n.v,i=[],null!=o&&o.data&&(a=Object.keys(o.data)).length>0&&(i=o.data[a[0]]),Array.isArray(i)&&0!==i.length||(i=(null==o||null==(l=o.data)?void 0:l.notifications)||(null==o?void 0:o.data)||[]),t(mx(Array.isArray(i)?i:[])),n.a(2,o);case 2:throw n.p=2,console.error("Error fetching notifications:",s=n.v),s;case 3:return n.a(2)}},n,null,[[0,2]])}));return function(e){return n.apply(this,arguments)}})(),Cj=(e,n)=>(function(){var t=Cg(Cf().m(function t(r){var o,i,a;return Cf().w(function(t){for(;;)switch(t.p=t.n){case 0:if(null!=e&&e.notificationId){t.n=1;break}return console.warn("Notification ID is required to mark as read"),t.a(2);case 1:return o=Cv(n,!1),i={id:e.notificationId,projectId:e.projectId,userType:o.userType,isUserNotification:e.isUserNotification},o.profileId&&(i.profileId=o.profileId),t.p=2,t.n=3,uS.post("".concat(u_,"/notification"),i,{headers:{"X-HTTP-Method-Override":"PATCH"}});case 3:return r(mj(e.notificationId)),t.n=4,Promise.all([r(Cx(o)),r(Cb(o))]);case 4:t.n=6;break;case 5:throw t.p=5,console.error("Error marking notification as read:",a=t.v),a;case 6:return t.a(2)}},t,null,[[2,5]])}));return function(e){return t.apply(this,arguments)}})(),Cw=t(34993),CC=t.n(Cw),C_=["name","description","status","dueDate"],CS=["newTemplateFiles"],CI=["newTemplateFiles","templateId"],CE=["newTemplateFiles","templateId"],CP=["templateId"],CO=["primaryContact"];function CT(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=CL(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function Ck(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function CN(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function CD(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?CN(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):CN(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function CR(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return CA(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(CA(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,CA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,CA(u,"constructor",c),CA(c,"constructor",s),s.displayName="GeneratorFunction",CA(c,o,"GeneratorFunction"),CA(u),CA(u,o,"Generator"),CA(u,r,function(){return this}),CA(u,"toString",function(){return"[object Generator]"}),(CR=function(){return{w:i,m:d}})()}function CA(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(CA=function(e,n,t,r){function i(n,t){CA(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function CM(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function CF(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){CM(i,r,o,a,l,"next",e)}function l(e){CM(i,r,o,a,l,"throw",e)}a(void 0)})}}function Cz(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||CL(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CL(e,n){if(e){if("string"==typeof e)return CB(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?CB(e,n):void 0}}function CB(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}let CU=()=>{var e,n=(0,iY.useDispatch)();xj();var t=Cz((0,iq.useState)(null),2),r=t[0],o=t[1],i=Cz((0,iq.useState)(!1),2),a=i[0],l=i[1],s=Cz((0,iq.useState)(null),2),c=s[0],u=s[1],d=Cz((0,iq.useState)(!1),2),p=d[0],f=d[1],m=Cz((0,iq.useState)(!1),2),h=m[0],g=m[1],y=Cz((0,iq.useState)({message:"",type:""}),2),v=y[0],x=y[1],b=Cz((0,iq.useState)(aA),2),j=b[0],w=b[1],C=Cz((0,iq.useState)(""),2),_=C[0],S=C[1],I=Cz((0,iq.useState)(!1),2),E=I[0],P=I[1],O
1=Cz((0,iq.useState)({}),2),T=O[0],k=O[1],N=Cz((0,iq.useState)(aM),2),D=N[0],R=N[1],A=Cz((0,iq.useState)(!1),2),M=A[0],F=A[1],z=Cz((0,iq.useState)(!1),2),L=z[0],B=z[1],U=Cz((0,iq.useState)(null),2),V=U[0],H=U[1],W=Cz((0,iq.useState)(aN.CREATE),2),G=W[0],q=W[1],K=Cz((0,iq.useState)(null),2),J=K[0],X=K[1],$=Cz((0,iq.useState)(null),2),Z=$[0],Y=$[1],Q=Cz((0,iq.useState)(!1),2),ee=Q[0],en=Q[1],et=Cz((0,iq.useState)(null),2),er=et[0],eo=et[1],ei=Cz((0,iq.useState)([]),2),ea=ei[0],el=ei[1],es=Cz((0,iq.useState)(null),2),ec=es[0],eu=es[1],ed=Cz((0,iq.useState)(null),2),ep=ed[0],ef=ed[1],em=Cz((0,iq.useState)(null),2),eh=em[0],eg=em[1],ey=(0,iY.useSelector)(e=>{var n;return null==e||null==(n=e.headerState)||null==(n=n.JWT)?void 0:n.sub}),ev=(0,iY.useSelector)(e=>a6(e)),ex=(0,iY.useSelector)(e=>a5(e)),eb=(0,iY.useSelector)(e=>a4(e)),ej=(0,iY.useSelector)(e=>a3(e)),ew=null!=eb&&eb.theme&&Object.keys(null==eb?void 0:eb.theme).length>0?null==eb?void 0:eb.theme:pe[0],eC=(0,iY.useSelector)(e=>le(e)),e_=(0,iY.useSelector)(e=>a8(e)),eS=(0,iY.useSelector)(e=>ln(e)),eI=(0,iY.useSelector)(e=>a9(e)),eE=null!=(e=null==eI?void 0:eI.userType)?e:aS.BROKER,eP=(0,iY.useSelector)(e=>a7(e)),eO=(0,iY.useSelector)(e=>lo(e)),eT=d_(ev),ek=d_(eC),eN=d_(e_),eD=d_(eS),eR=(0,iY.useSelector)(lt),eA=Cz((0,iq.useState)(!1),2),eM=eA[0],eF=eA[1],ez=(0,iq.useRef)(!1),eL=CC()(3),eB=(0,iq.useMemo)(()=>mX(eT,eN),[eT,eN]),eU=(0,iq.useMemo)(()=>mQ(eR,eB),[eR,eB]),eV=function(){var e=CF(CR().m(function e(){var t;return CR().w(function(e){for(;;)switch(e.p=e.n){case 0:return t={userType:null==eI?void 0:eI.userType,profileId:null==eI?void 0:eI.orgId},eF(!0),e.p=1,e.n=2,Promise.all([n(Cx(t)),n(Cb(t))]);case 2:e.n=4;break;case 3:e.p=3,console.error("Error loading notifications:",e.v);case 4:return e.p=4,eF(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(){return e.apply(this,arguments)}}();(0,iq.useEffect)(()=>{if(r===aj.Notifications){ez.current||(ez.current=!0,eV());return}ez.current=!1},[r]);var eH=e=>{e&&!e.isRead&&eI&&n(Cj(e,{userType:null==eI?void 0:eI.userType,profileId:null==eI?void 0:eI.orgId}))},eW=e=>{var n=e&&Object.values(aj).includes(e)?e:eE===aS.CLIENT?aj.Projects:aj.Dashboard;o(n);var t=new URLSearchParams;t.set("action",n);var r="".concat(window.location.protocol,"//").concat(window.location.host,"/services/easyprint?").concat(t.toString());window.location.href!==r&&window.history.pushState({path:r,previousUrl:window.location.href},"",r)},eG=e=>{n(mf({})),eW(e),X(null),Y(null),o(e)},eq=()=>{var e=ak.PRINT_BROKER_REDIRECT_URL_LOGOUT,n="".concat(e,"?brokerCode=").concat(eP.code);window.location.href=n},eK=e=>{var t=e||{},r=t.projectId,i=t.scrollTarget,a=t.source;i&&ef(i),a&&eg(a),uE(r).then(e=>{n(mf(e.data)),o(aj.Project)}).catch(e=>{n(mf({})),console.log("ERROR ",e)})},eJ=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(t){case aD.CREATE:n(mu([...eT,e])),r&&n(mf(e));break;case aD.ADD_PRINT_JOB:var o=CD(CD({},e),null!=e&&e.jobs?{jobs:e.jobs.map(e=>CD(CD({jobId:e.jobId},(null==e?void 0:e.printerId)!=null&&""!==e.printerId&&"-1"!==e.printerId&&{printerId:e.printerId}),{},{type:"printjob"}))}:{jobs:[]});n(mu([...eT,o])),r&&n(mf(o));break;case aD.UPDATE:n(mu(eT.map(n=>n.projectId===e.projectId?CD(CD({},e),null!=e&&e.jobs?{jobs:e.jobs.map(e=>CD(CD({jobId:e.jobId},(null==e?void 0:e.printerId)!=null&&""!==e.printerId&&"-1"!==e.printerId&&{printerId:e.printerId}),{},{type:"printjob"}))}:{jobs:[]}):n))),r&&n(mf(e));break;case aD.DELETE:n(mu(eT.filter(n=>n.projectId!==e.projectId))),r&&n(mf({}))}},eX=e=>{if(ej&&Object.keys(ej).length>0){var t,r;ej.name,ej.description,ej.status,ej.dueDate,n(mf(CD(CD({},Ck(ej,C_)),{},{name:null==e?void 0:e.name,description:null==e?void 0:e.description,status:null==e?void 0:e.status,dueDate:null==e?void 0:e.dueDate,comments:null!=(t=null==e?void 0:e.comments)?t:[],projectFiles:null!=(r=null==e?void 0:e.projectFiles)?r:[]})))}},e$=e=>{n(md(e))},eZ=e=>{g(e)},eY=()=>Array.isArray(eN)?eN.filter(e=>e.userType===aI.BROKER&&(null==e?void 0:e.active)===!0).map(e=>{var n,t,r,o,i;return{userId:null!=(n=null==e?void 0:e.id)?n:"",email:null!=(t=null==e||null==(r=e.contact)?void 0:r.email)?t:"",firstName:null!=(o=null==e||null==(i=e.contact)?void 0:i.firstName)?o:""}}):[],eQ=e=>Array.isArray(eN)?eN.filter(n=>String(null==n?void 0:n.orgId)===String(null==e?void 0:e.clientId)&&(null==n?void 0:n.active)===!0).map(e=>{var n,t,r,o,i;return{userId:null!=(n=null==e?void 0:e.id)?n:"",email:null!=(t=null==e||null==(r=e.contact)?void 0:r.email)?t:"",firstName:null!=(o=null==e||null==(i=e.contact)?void 0:i.firstName)?o:""}}):[],e0=e=>{var n=new Set;return Array.isArray(null==e?void 0:e.jobs)?e.jobs.flatMap(e=>eN.filter(n=>String(n.orgId)===String(e.printerId)&&(null==n?void 0:n.active)===!0)).filter(e=>!n.has(null==e?void 0:e.id)&&(n.add(null==e?void 0:e.id),!0)).map(e=>{var n,t,r,o,i;return{userId:null!=(n=null==e?void 0:e.id)?n:"",email:null!=(t=null==e||null==(r=e.contact)?void 0:r.email)?t:"",firstName:null!=(o=null==e||null==(i=e.contact)?void 0:i.firstName)?o:""}}):[]},e1=e=>{var n,t,r,o,i,a;R({clientId:null!=(n=null==e?void 0:e.clientId)?n:"",projectId:null!=(t=null==e?void 0:e.projectId)?t:"",name:null!=(r=null==e?void 0:e.name)?r:"",description:null!=(o=null==e?void 0:e.description)?o:"",status:null!=(i=null==e?void 0:e.status)?i:"",dueDate:null!=(a=null==e?void 0:e.dueDate)?a:dc(new Date,5)}),u(null!=e&&e.projectId?null==e?void 0:e.projectId:null),F(!0)},e2=e=>{var n,t,r,o,i,a,l=ej&&Object.keys(ej).length>0?ej:null==eT?void 0:eT.find(e=>e.projectId===c),s=dS(nL,l.clientId),u=[...null!=(n=null==ex?void 0:ex.generic)?n:[],...null!=(t=null==ex?void 0:ex.client)?t:[]].find(n=>n.templateId===(null==e?void 0:e.templateId));null!=e&&e.jobId?w(CD(CD({},e),{},{projectFiles:null!=(r=l.projectFiles)?r:[],sourceFiles:null!=(o=e.sourceFiles)?o:[],clientId:l.clientId,templateId:null!=(i=null==u?void 0:u.templateId)?i:"-1",parentClientId:s?s.id:""})):w(CD(CD({},aA),{},{projectId:l.projectId,clientId:l.clientId,projectFiles:null!=(a=l.projectFiles)?a:[],parentClientId:s?s.id:""})),eZ(!0)},e6=e=>{var n=dS(nL,_);return{templateType:n?"CLIENT":"GENERIC",clientId:n?n.id:"",name:e.templateName,paperType:e.paperType,dimensions:e.dimensions,type:"template",notes:e.notes,pricing:{markupType:"PERCENT",markupDataList:[{qty:e.quantity,markupVal:e.overageNeededVal}]}}},e5=(e,t)=>{P(!1),uB(e).then(()=>{n(md(Object.fromEntries(Object.entries(null!=ex?ex:{}).map(n=>{var t=(0,i$._)(n,2),r=t[0],o=t[1];return[r,Array.isArray(o)?o.filter(n=>n.templateId!==e):[]]}
1)))),x({message:'Template "'.concat(t,'" deleted successfully'),type:"success"}),f(!0)}).catch(e=>{x({message:'Failed to delete template "'.concat(t,'"'),type:"failure"}),f(!0),console.log("ERROR ",e)})},e4=e=>(0,iQ.jsx)(uu,{children:(0,iQ.jsxs)("p",{children:['Are you sure you want to delete the template "',(0,iQ.jsx)(ud,{children:e}),"? This action cannot be undone."]})}),e3=(e,n)=>{var t={title:"Confirm Template Deletion",content:e4(n),backBtnText:"Cancel",submitBtnText:"Delete",hasCloseButton:!0,hasNotification:!1,onClose:()=>{P(!1),k({})},backHandler:()=>{P(!1),k({})},submitHandler:()=>e5(e,n)};k(t),P(!0)},e8=(e,t)=>{eZ(!1);var r=ej.projectId;uS.post("".concat(u_,"/job"),{},{params:{jobId:e,projectId:r},headers:{"X-HTTP-Method-Override":"DELETE"}}).then(e=>uE(r)).then(e=>{var r=e.data;ej&&Object.keys(ej).length>0&&n(mf(r)),eJ(r,aD.UPDATE),x({message:'Job "'.concat(t,'" deleted successfully'),type:"success"}),f(!0)}).catch(e=>{x({message:"Failed to delete job",type:"failure"}),f(!0),console.log("ERROR ",e)})},e9=(e,n,t,r)=>uR(e.fileObj,e.fileName,e.seqId,n,t,r),e7=e=>{k(no),P(!0);var t=e.job,r=e.type,o=e.files,i=null==eT?void 0:eT.find(e=>String(e.projectId)===String(t.projectId)),a=eQ(i),l="Files added successfully to ".concat(t.jobName);return Promise.all(o.map(e=>eL(()=>e9(e,t.projectId,t.jobId,r)))).then(e=>{var n,r=o.map(e=>({seqId:e.seqId,fileName:e.fileName,fileSize:e.fileSize,uploadedTs:Date.now(),uploadedBy:ey})),i=[...null!=(n=null==t?void 0:t.proofFiles)?n:[],...r];return uq(t.jobId,CD({proofFiles:i},eI.userType===aI.BROKER&&{gnpInfo:a}))}).then(e=>{var t=null==e?void 0:e.data;P(!1),k({}),x({message:l,type:"success"}),f(!0),i&&Object.keys(i).length>0&&n(mf(CD(CD({},i),{},{jobs:i.jobs.map(e=>e.jobId===t.jobId?t:e)})))}).catch(e=>{P(!1),k({}),x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},ne=(e,n)=>(k(no),P(!0),Promise.all(e.map(e=>eL(()=>e9(e,n.projectId)))).then(t=>{var r,o=e.map(e=>({seqId:e.seqId,fileName:e.fileName,fileSize:e.fileSize,uploadedTs:Date.now(),uploadedBy:ey})),i=[...null!=(r=null==n?void 0:n.projectFiles)?r:[],...o],a=eY();return uP(n.projectId,CD({projectFiles:i},eI.userType===aI.CLIENT&&{gnpInfo:a}))}).then(e=>{P(!1),k({}),x({message:"Files added successfully",type:"success"}),f(!0),eJ(e.data,aD.UPDATE),eX(e.data)}).catch(e=>{P(!1),k({}),x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})),nn=(e,t,r,o)=>{var i,a,l="".concat(t," removed successfully"),s=null!=(i=null==r||null==(a=r.templateFiles)?void 0:a.filter(n=>n.seqId!==e))?i:[];return Promise.all([uA(e,t,r.projectId,r.jobId,o),uq(r.jobId,{templateFiles:s})]).then(e=>{var t=(0,i$._)(e,2),r=(t[0],t[1]),o=null==r?void 0:r.data;x({message:l,type:"success"}),f(!0),ej&&Object.keys(ej).length>0&&n(mf(CD(CD({},ej),{},{jobs:ej.jobs.map(e=>e.jobId===o.jobId?o:e)})))}).catch(e=>{x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},nt=(e,t,r,o)=>{var i,a,l="".concat(t," removed successfully"),s=null!=(i=null==r||null==(a=r.proofFiles)?void 0:a.filter(n=>n.seqId!==e))?i:[];return Promise.all([uA(e,t,r.projectId,r.jobId,o),uq(r.jobId,{proofFiles:s})]).then(e=>{var t=(0,i$._)(e,2),r=(t[0],t[1]),o=null==r?void 0:r.data;x({message:l,type:"success"}),f(!0),ej&&Object.keys(ej).length>0&&n(mf(CD(CD({},ej),{},{jobs:ej.jobs.map(e=>e.jobId===o.jobId?o:e)})))}).catch(e=>{x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},nr=(e,t,r)=>{var o,i,a="".concat(t," removed successfully"),l=r.projectId,s=null==r||null==(o=r.projectFiles)?void 0:o.filter(n=>n.seqId!==e),c=null==r||null==(i=r.jobs)||null==(i=i.filter(e=>e.sourceFiles))?void 0:i.map(n=>{var t;return CD(CD({},n),{},{sourceFiles:(null==(t=n.sourceFiles)?void 0:t.filter(n=>n!==e))||[]})});return Promise.all([uA(e,t,l),uP(l,{projectFiles:s}),uM(c)]).then(()=>uE(l)).then(e=>{var t=null==e?void 0:e.data;console.log("projectDetails projectDetails ",t),x({message:a,type:"success"}),f(!0),eJ(t,aD.UPDATE),ej&&Object.keys(ej).length>0&&n(mf(t))}).catch(e=>{x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},no={loader:!0,closeOnBackdropClick:!1,message:"Your request is being processed, please remain on this page."},ni=(e,n,t)=>{var r=[...t||new Set];return P(!0),k(no),uF(e,r).then(e=>{P(!1),k({});var t=dI(n),r=window.URL.createObjectURL(new Blob([e.data])),o=document.createElement("a");o.href=r,o.setAttribute("download","".concat(t?"Project_".concat(t,".zip"):"Project.zip")),document.body.appendChild(o),o.click(),o.remove(),window.URL.revokeObjectURL(r)}).catch(e=>{P(!1),k({}),x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},na=(e,n,t,r,o)=>(P(!0),k(no),uz(e,n,t,r,o,"","attachment").then(e=>{P(!1),k({});var t=window.URL.createObjectURL(new Blob([e.data])),r=document.createElement("a");r.href=t,r.setAttribute("download","".concat(n)),document.body.appendChild(r),r.click(),r.remove(),window.URL.revokeObjectURL(t)}).catch(e=>{P(!1),k({}),x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})),nl=(e,n,t,r,o,i)=>{var a;return(a="inline",uS.post("".concat(u_,"/downloadFile"),{seqId:e,fileName:n,projectId:t,disposition:a,jobId:r,type:o,templateId:i},{responseType:"blob"})).then(e=>{var t=e.headers["content-type"]||"application/octet-stream";
1if("application/octet-stream"===t&&n){var r=n.split(".").pop().toLowerCase();a$[r]&&(t=a$[r])}var o=new Blob([e.data],{type:t}),i=window.URL.createObjectURL(o);if(aX.includes(t)){if(!window.open(i,"_blank")){var a=document.createElement("a");a.href=i,a.download=n||"download",document.body.appendChild(a),a.click(),document.body.removeChild(a)}}else{var l=document.createElement("a");l.href=i,l.download=n||"download",document.body.appendChild(l),l.click(),document.body.removeChild(l)}setTimeout(()=>window.URL.revokeObjectURL(i),5e3)}).catch(e=>{x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},ns=e=>(0,iQ.jsx)(uu,{children:(0,iQ.jsxs)("p",{children:['Are you sure you want to cancel the project "',(0,iQ.jsx)(ud,{children:e.name}),'"?']})}),nc=e=>(0,iQ.jsx)(uu,{children:(0,iQ.jsxs)("p",{children:['Are you sure you want to delete the project "',(0,iQ.jsx)(ud,{children:e.name}),'"?']})}),nu=e=>{var t;(t=e.projectId,uS.post("".concat(u_,"/project"),{},{params:{projectId:t},headers:{"X-HTTP-Method-Override":"DELETE"}})).then(t=>{P(!1),x({message:"".concat(e.name," deleted successfully"),type:"success"}),f(!0),eJ(e,aD.DELETE),o(aj.Projects),n(mf({}))}).catch(e=>{x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},nd=e=>{var n={title:"Confirm Project deletion",content:nc(e),backBtnText:"Back to Project",submitBtnText:"delete Project",hasCloseButton:!0,hasNotification:!1,onClose:()=>{P(!1),k({})},backHandler:()=>{P(!1),k({}),F(!0)},submitHandler:()=>nu(e)};k(n)},np=(e,n)=>{var t,r=Array.isArray(eT)?eT.find(n=>String(n.projectId)===String(e.projectId)):null,o=eQ(e),i=e0(r);t=n===aR.CANCEL?{status:aw.Cancelled}:n===aR.UN_PUBLISH?{status:aw.Draft}:n===aR.PUBLISH||n===aR.RESTORE?{status:aw.Intake,gnpInfo:o}:e.status===aw.Production?CD(CD({},e),{},{gnpInfo:i}):e.status===aw.Shipping||e.status===aw.Complete||e.status===aw.Intake?CD(CD({},e),{},{gnpInfo:o}):e;var a="".concat(e.name," ").concat(n===aR.CANCEL?"cancelled":n===aR.PUBLISH?"published":n===aR.RESTORE?"restored":n===aR.UN_PUBLISH?"unpublished":"saved"," successfully");uP(e.projectId,t).then(e=>{P(!1),F(!1),x({message:a,type:"success"}),f(!0),eJ(e.data,aD.UPDATE),eX(e.data)}).catch(e=>{P(!1),F(!1),x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},nf=e=>{e?X(n=>n===e?null:e):X(null),u(null),Y(null)},nm=e=>{Y(n=>n===e?null:e)},nh=e=>{e&&Y(null)},ng=e=>{var n=dt(e),t=eT.filter(e=>n.includes(e.clientId)).length,r=eT.filter(e=>n.includes(e.clientId)&&e.status!==aw.Complete).length;return(0,iQ.jsxs)("div",{children:[(0,iQ.jsxs)("p",{children:['Are you sure you want to delete "',(0,iQ.jsx)(ud,{children:e.name}),'" and all its child companies?']}),(0,iQ.jsxs)("div",{children:[(0,iQ.jsx)("p",{children:"This will permanently delete:"}),(0,iQ.jsxs)("ul",{children:[(0,iQ.jsxs)("li",{children:[(0,iQ.jsx)(ud,{children:t})," project record(s)"]}),(0,iQ.jsxs)("li",{children:[(0,iQ.jsx)(ud,{children:r})," of which are not complete"]})]})]}),(0,iQ.jsx)("p",{children:"This action cannot be undone."})]})},ny=e=>{var t=aI.CLIENT,r=Array.isArray(eN)?eN.filter(n=>String(null==n?void 0:n.orgId)===(null==e?void 0:e.id)):[],o=dt(e);return Promise.all([...r.map(e=>uV(null==e?void 0:e.id,eP.code,dh(!1,e))),uW(e.id,t,o),uS.post("".concat(u_,"/projects"),{},{params:{profileIds:o},headers:{"X-HTTP-Method-Override":"DELETE"}}),...null==e.parentId?[uS.post("".concat(u_,"/templates"),{},{params:{profileIds:o},headers:{"X-HTTP-Method-Override":"DELETE"}})]:[]]).then(()=>{P(!1),x({message:"".concat(e.name," deleted successfully"),type:"success"}),f(!0),nT(dC(eD,o)),null==e.parentId&&n(md(Object.fromEntries(Object.entries(null!=ex?ex:{}).map(n=>{var t=(0,i$._)(n,2),r=t[0],o=t[1];return[r,Array.isArray(o)?o.filter(n=>n.clientId!==e.client):[]]})))),n(mu(eT.filter(e=>e.clientId&&!o.includes(e.clientId))))}).catch(e=>{console.error("ERROR",e),P(!1),x({message:"Error has occurred",type:"failure"}),f(!0)})},nv=e=>{var n={title:"Confirm Client Deletion",content:ng(e),backBtnText:"Cancel",submitBtnText:"Delete",hasCloseButton:!0,onClose:()=>{P(!1),k({})},backHandler:()=>{P(!1),k({})},submitHandler:()=>ny(e)};k(n),P(!0)},nx=e=>{var n=e.firstName,t=e.lastName,r=e.email,o=e.phone,i=e.role,a=dy(i,e.organizationId);if(!a)return Promise.reject(Error("Invalid user role"));var l=a.userType,s=a.gusUserType,c=a.defaultOrgEntity,u=df({firstName:n,lastName:t,email:r,phone:o},c,s,eP.code);return u.user.defaultOrgEntity=c,u.user.userType=l,uU(u).then(e=>{var n,t,r=null!=(n=null==e||null==(t=e.data)?void 0:t.user)?n:{};uJ(dE(r,eP.code)).catch(e=>{console.error("ERROR",e)}),nN(CD(CD({},r),{},{type:i}),aD.CREATE),x({message:"User added successfully",type:"success"}),f(!0)}).catch(e=>{var n,t;throw console.error("ERROR",e),x({message:(null==e||null==(n=e.response)||null==(n=n.data)||null==(n=n.error)?void 0:n.code)==="USER_ALREADY_EXISTS"?null==e||null==(t=e.response)||null==(t=t.data)||null==(t=t.error)?void 0:t.description:"Error occurred while adding user",type:"failure"}),f(!0),e})},nb=(e,t,r)=>{var o,i=t.firstName,a=t.lastName,l=t.phone,s=t.username,c={contact:{firstName:i,lastName:a,phone:null!=(o=null==l?void 0:l.replace(/\D/g,""))?o:""},username:s};return uV(e,eP.code,c).then(t=>{var o,i=null==t||null==(o=t.data)?void 0:o.user;nN(CD(CD({},i),{},{type:r}),aD.UPDATE),(null==eI?void 0:eI.id)===e&&n(my(CD(CD({},eI),{},{contact:i.contact}
1))),x({message:"User updated successfully",type:"success"}),f(!0)}).catch(e=>{throw console.error("ERROR",e),x({message:"Error occurred while updating user",type:"failure"}),f(!0),e})},nj=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];console.log("Searching for childId:",n,"in clients:",e," with path:",t);var r,o=CT(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(i.children){var a,l=CT(i.children);try{for(l.s();!(a=l.n()).done;){if(a.value.id===n)return[...t,{id:i.id,name:i.name}];var s=nj(i.children,n,[...t,{id:i.id,name:i.name}]);if(s.length)return s}}catch(e){l.e(e)}finally{l.f()}}}}catch(e){o.e(e)}finally{o.f()}return[]},nw=e=>{eo(aN.EDIT),en(!0),eu(e),el(nj(nL,e.id))},nC=()=>{eo(aN.CREATE),en(!0),eu(null)},n_=e=>{eo(aN.VIEW),en(!0),eu(e),el(nj(nL,e.id))},nS=e=>{eo(aN.CREATE),en(!0),el(nj(nL,e.id).concat({id:e.id,name:e.name}))},nI=()=>{B(!1),H(null),q(aN.CREATE)},nE=(e,n)=>{x({message:e,type:n}),f(!0)},nP=function(){var e=CF(CR().m(function e(n,t,r,o,i){var a,l,s,c,u,d,p;return CR().w(function(e){for(;;)if(0===e.n)return s=void 0===(l=(null!=r?r:{}).templateId)?"":l,c=null!=(a=null==o?void 0:o.filter(e=>e.seqId!==n))?a:[],u=CD(CD({},r),{},{templateFiles:c}),d=()=>{nE("".concat(t," file deleted successfully"),"success")},p=e=>{var n;console.error("Error deleting template file:",e),nE((null==e||null==(n=e.response)||null==(n=n.data)||null==(n=n.error)?void 0:n.message)||(null==e?void 0:e.message)||"Error deleting template file","failure")},e.a(2,Promise.all([uA(n,t,"","",i,s),nO(u,!1,!1)]).then(e=>{var n=(0,i$._)(e,2),t=(n[0],n[1]),r=null==t?void 0:t.data;e$({generic:((null==ex?void 0:ex.generic)||[]).map(e=>e.templateId===s?r:e),client:((null==ex?void 0:ex.client)||[]).map(e=>e.templateId===s?r:e)}),H(r),d()}).catch(e=>{throw p(e),e}))},e)}));return function(n,t,r,o,i){return e.apply(this,arguments)}}(),nO=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=!(arguments.length>2)||void 0===arguments[2]||arguments[2];e.newTemplateFiles;var r=e.templateId,o=Ck(e,CE);if(!r)return Promise.reject(Error("Template ID is required for update"));o.templateId;var i=Ck(o,CP);return uN(r,i).then(e=>{var o=null==e?void 0:e.status,a=null==e?void 0:e.data;if(o>=200&&o<300){n&&nI(),t&&(x({message:'Template "'.concat(i.name,'" updated successfully'),type:"success"}),f(!0));var l=a||CD(CD({},i),{},{templateId:r});return e$({generic:((null==ex?void 0:ex.generic)||[]).map(e=>e.templateId===r?l:e),client:((null==ex?void 0:ex.client)||[]).map(e=>e.templateId===r?l:e)}),e}throw Error("Template update failed: HTTP ".concat(o))}).catch(e=>{var n,r,o,i=(null==e||null==(n=e.response)||null==(n=n.data)||null==(n=n.error)?void 0:n.description)||(null==e||null==(r=e.response)||null==(r=r.data)||null==(r=r.error)?void 0:r.message)||(null==e||null==(o=e.response)||null==(o=o.data)?void 0:o.message)||(null==e?void 0:e.message)||"Error Occurred";throw t&&(x({message:"Update Template: ".concat(i),type:"failure"}),f(!0)),e})},nT=e=>{n(mg(e))},nk=e=>{n(mh(e.map(e=>(e.primaryContact,Ck(e,CO)))))},nN=(e,t)=>{switch(t){case aD.CREATE:n(mm([...eN,{id:e.id,userType:null==e?void 0:e.type,orgId:null==e?void 0:e.defaultOrgEntity,contact:null==e?void 0:e.contact,active:(null==e?void 0:e.active)===void 0||e.active,masterAccountNumber:null==e?void 0:e.masterAccountNumber,username:null==e?void 0:e.username}]));break;case aD.UPDATE:n(mm(eN.map(n=>n.id===e.id?CD(CD({},n),{},{contact:(null==e?void 0:e.contact)||(null==n?void 0:n.contact),type:(null==e?void 0:e.type)||(null==n?void 0:n.userType),active:(null==e?void 0:e.active)!==void 0?e.active:null==n?void 0:n.active}):n)));break;case aD.DELETE:n(mm(eN.filter(n=>n.id!==e.id)))}},nD=(0,i6.useBreakpoint)(),nR="lg"===nD||"md"===nD?"lg":"sm";(0,iq.useEffect)(()=>{if(ew){var e=document.documentElement;e.style.setProperty("--brand-50",ew.color[50]),e.style.setProperty("--brand-100",ew.color[100]),e.style.setProperty("--brand-200",ew.color[200]),e.style.setProperty("--brand-500",ew.color[500]),e.style.setProperty("--brand-600",ew.color[600]),e.style.setProperty("--brand-700",ew.c
1olor[700])}},[ew]),(0,iq.useEffect)(()=>{eW(new URLSearchParams(window.location.search).get("action"))},[]),(0,iq.useEffect)(()=>{eO&&(x({message:"Your session has expired. Please log in again.",type:"failure"}),f(!0))},[eO]),(0,iq.useEffect)(()=>{if(eI){var e={userType:null==eI?void 0:eI.userType,profileId:null==eI?void 0:eI.orgId},t=setInterval(()=>{n(Cx(e))},3e4);return()=>clearInterval(t)}},[n,eI]),(0,iq.useEffect)(()=>{if(r===aj.Printers){var e;(e={type:"printer",fetchProjectCountFl:!0},uS.get("".concat(u_,"/profiles"),{params:e})).then(e=>{var t,r=null==e||null==(t=e.data)?void 0:t.printers;r&&n(mh(r))}).catch(e=>{console.log("ERROR ",e)})}},[r]);var nA=(0,iq.useMemo)(()=>!M&&!h&&!E&&"lg"!==nR,[nR,M,h,E]),nM=(0,iq.useMemo)(()=>({filteredProjects:eT.filter(e=>(!J||e.clientId===J)&&(!Z||e.status===Z)),activeFilters:{statuses:Z?[Z]:[],overdue:!1,clientId:J,sortOption:"Newest"}}),[eT,J,Z]),nF=nM.filteredProjects,nz=nM.activeFilters,nL=(0,iq.useMemo)(()=>Array.isArray(eD)&&0!==eD.length?dj(eD.filter(e=>"ACTIVE"===e.status).map(e=>{var n=eN.find(n=>{var t;return String(n.id)===(null==(t=e.primaryUser)?void 0:t.trim())});return CD(CD({},e),(null==n?void 0:n.contact)&&{primaryContact:n.contact,primaryUserName:n.username})})):[],[eD,eN]),nB=(0,iq.useMemo)(()=>{var e=new Map,n=t=>{var r,o=CT(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;e.set(i.id,i.name),i.children&&n(i.children)}}catch(e){o.e(e)}finally{o.f()}};return n(null!=nL?nL:[]),e},[nL]),nU=(0,iq.useMemo)(()=>{var e;return Array.isArray(ek)&&0!==ek.length?null==ek||null==(e=ek.filter(e=>"ACTIVE"===e.status))?void 0:e.map(e=>{var n=eN.find(n=>String(n.id)===e.primaryUser.trim());return CD(CD({},e),n&&n.contact?{primaryContact:n.contact,primaryUserName:n.username}:{})}):[]},[ek,eN]),nV=(0,iq.useMemo)(()=>({name:null==eb?void 0:eb.companyName}),[eb]),nH=(0,iq.useMemo)(()=>{if(!(null!=eI&&eI.orgId))return{company:""};var e=String(eI.orgId),n=null==ek?void 0:ek.find(n=>String(n.id)===e);if(n)return{company:n.name};var t=null==eD?void 0:eD.find(n=>String(n.id)===e);return t?{company:t.name}:{company:""}},[eI,eD,ek]);return(0,iQ.jsxs)(lU,{size:nR,children:[(0,iQ.jsx)(gB,{user:eI,viewMode:eE,size:nR,onNavigate:eG,companyName:nV.name,handleSignOut:eq}),(0,iQ.jsx)(lI,{companyName:nV.name,viewMode:eE,size:nR,onNavigate:eG,isExpanded:a,onToggleExpand:()=>l(e=>!e),handleSignOut:eq}),p&&v?(0,iZ.createPortal)((0,iQ.jsx)(lY,{children:(0,iQ.jsx)(i6.ToastBar,{onClose:()=>{f(!1),x(null),eO&&(n(mw(!1)),window.location.href=ak.PRINT_BROKER_REDIRECT_URL_LOGIN)},variant:null==v?void 0:v.type,children:null==v?void 0:v.message})}),document.body):null,(0,iQ.jsx)(ug,{isOpen:E,modalData:T}),(()=>{switch(r){case aj.Dashboard:return(0,iQ.jsx)(wO,{onSelectClient:nf,size:nR,clients:nL,clientNameLookup:nB,addClientClickHandler:nC,handleEditClient:nw,handleViewClient:n_,projects:eT,filteredProjects:nF,handleEditProject:np,onViewProjectPage:eK,handleProjectJob:e2,selectedProjectId:c,selectedClientId:J,setSelectedProjectId:u,handleProjectDrawer:e1,handleProjectFiles:ne,showProjectDetailsDrawer:nA,viewMode:eE,handleStatusFilterChange:nm,statusFilter:Z,activeFilters:nz,resetStatusFilter:nh});case aj.Project:return(0,iQ.jsx)(vz,{clientNameLookup:nB,project:ej,onNavigateBack:eG,handleProjectJob:e2,handleDeleteJob:e8,handleEditProject:np,handleProjectDrawer:e1,handleProjectFiles:ne,handleDownloadProjectFile:na,handleDownloadAllProjectFiles:ni,handleDeleteProjectFile:nr,handleViewProjectFile:nl,viewMode:eE,printers:nU,size:nR,onShowToast:f,onSetToastNotification:x,onUpdateProjects:e=>eJ(e,aD.UPDATE,!0),pendingScrollTarget:ep,onClearScrollTarget:()=>ef(null),projectSource:eh,handleProofFiles:e7,handleViewProofFile:nl,handleDownloadProofFile:na,handleDeleteProofFile:nt,handleDeleteJobTemplateFile:nn,config:eP,users:eN});case aj.Projects:return(0,iQ.jsx)(mq,{size:nR,clients:nL,clientNameLookup:nB,projects:nF,handleEditProject:np,onViewProjectPage:e=>eK(CD(CD({},e),{},{source:"projects"})),openJobDrawer:e2,selectedProjectId:c,setSelectedProjectId:u,handleProjectDrawer:e1,handleProjectFiles:ne,showProjectDetailsDrawer:nA,activeFilters:nz,viewMode:eE,config:eP});case aj.Clients:return(0,iQ.jsx)(pa,{size:nR,clientList:nL,addClientClickHandler:nC,handleEditClient:nw,handleViewClient:n_,handleChildClient:nS,openDeleteClientModal:nv});case aj.Printers:return(0,iQ.jsx)(gI,{size:nR,printers:nU,handlePrinters:nk,handleUpdateUsers:nN});case aj.Profile:return(0,iQ.jsx)(sx,{onNavigateBack:()=>eG("dashboard"),user:eI,brokerCompany:nV,clientCompany:nH,onUpdateProfile:e=>nb(eI.id,e,eI.userType)});case aj.Settings:return(0,iQ.jsx)(d7,{users:eN,clients:nL,printers:nU,handleUpdateUsers:nN,addUserHandler:nx,editUserHandler:nb});case aj.Notifications:return(0,iQ.jsx)(hM,{notifications:eU,projects:eT,isLoading:eM,viewMode:eE,onMarkAsRead:eH,onViewProject:e=>eK(CD(CD({},e),{},{source:"notifications"}))});case aj.Templates:return(0,iQ.jsx)(bn,{clients:nL,templates:ex,size:nR,handleDeleteTemplate:e3,onAddTemplate:()=>{H(null),q(aN.CREATE),B(!0)},onViewTemplate:e=>{H(e),q(aN.VIEW),B(!0)},onEditTemplate:e=>{H(e),q(aN.EDIT),B(!0)}});default:return(0,iQ.jsx)(iQ.Fragment,{})}})(),(0,iQ.jsx)(xx,{selectedJob:j,showJobDrawer:h,onDrawerClose:()=>{w(aA),g(!1)},printers:nU,templates:ex,action:j.jobId?aN.EDIT:aN.CREATE,submitJob:e=>{e.newTemplateFiles;var t=Ck(e,CS);eZ(!1);var r=null==t?void 0:t.jobId;return("saveAsNewTemplate"===j.templateId?uk(e6(t)):Promise.resolve({})).then(e=>{if(null!=e&&e.data){var n=e.data;t.templateId=n.templateId;var r={generic:[...(null==ex?void 0:ex.generic)||[]],client:[...(null==ex?void 0:ex.client)||[]]};"GENERIC"===n.templateType?r.generic.push(n):r.client.push(n),e$(r)}return aD.ADD_PRINT_JOB===(null==D?void 0:D.action)?(D.status=aw.Draft,D.dueDate=aW(null==D?void 0:D.dueDate),uO(D)):Promise.resolve({})}).then(e=>{var n,o;return null!=e&&null!=(n=e.data)&&n.projectId&&(t.projectId=null==e||null==(o=e.data)?void 0:o.projectId),r?uT(r,t):uS.post("".concat(u_,"/job"),t)}).then(e=>{var n,t,r,o=null==e?void 0:e.data,i=null==j?void 0:j.isTemplateChanged,a=(null==j||null==(r=j.templateFiles)?void 0:r.length)>0,l="projects/".concat(j.projectId,"/jobs/").concat(o.jobId,"/templates/"),s=i?a?(n={sourcePrefix:"templates/".concat(j.templateId,"/"),destPrefix:l},uS.post("".concat(u_,"/copyFolder"),n)):(t={prefix:l},uS.post("".concat(u_,"/deleteFolder"),t)):Promise.resolve(null);return Promise.all([Promise.resolve(o),s])}).then(e=>uE((0,i$._)(e,1)[0].projectId)).then(e=>{var o=e.data;ej&&Object.keys(ej).length>0&&n(mf(o)),aD.ADD_PRINT_JOB===(null==D?void 0:D.action)?eJ(o,aD.ADD_PRINT_JOB):eJ(o,aD.UPDATE),x({message:'Job "'.concat(t.jobName,'" ').concat(r?"updated":"created"," successfully"),type:"success"}),f(!0)}).catch(e=>{x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},setJobDetails:(e,n)=>{var t,r,o=[...null!=(t=null==ex?void 0:ex.generic)?t:[],...null!=(r=null==ex?void 0:ex.client)?r:[]].find(e=>e.templateId===n);w(e=>{var t,r,i,a,l,s,u,d,p,f,m;return CD(CD(CD({}
1,e),c&&{projectId:c}),{},{jobName:null!=(t=null==o?void 0:o.name)?t:"",quantity:(null==o||null==(r=o.pricing)||null==(r=r.markupDataList)?void 0:r.length)>0?null==o||null==(i=o.pricing)||null==(i=i.markupDataList[0])?void 0:i.qty:"",dimensions:null!=(a=null==o?void 0:o.dimensions)?a:"",paperType:null!=(l=null==o?void 0:o.paperType)?l:"",colors:null!=(s=null==o?void 0:o.colors)?s:"",finishing:null!=(u=null==o?void 0:o.finishing)?u:"",overageNeededVal:(null==o||null==(d=o.pricing)||null==(d=d.markupDataList)?void 0:d.length)>0?null==o||null==(p=o.pricing)||null==(p=p.markupDataList[0])?void 0:p.markupVal:"",notes:null!=(f=null==o?void 0:o.notes)?f:"",templateId:n,templateFiles:null!=(m=null==o?void 0:o.templateFiles)?m:[],isTemplateChanged:!0})})},setTemplateTypeId:S,size:nR,onDeleteJob:e8,viewMode:eE,handleJobFiles:(e,t)=>{var r="".concat(e.fileName," added successfully to ").concat(t.jobName);return uR(e.fileObj,e.fileName,e.seqId,t.projectId,t.jobId,"templates").then(n=>{var r,o={seqId:e.seqId,fileName:e.fileName,fileSize:e.fileSize,uploadedTs:Date.now(),uploadedBy:ey},i=null!=(r=null==t?void 0:t.templateFiles)?r:[];return i.push(o),uq(t.jobId,{templateFiles:i})}).then(e=>{var t=null==e?void 0:e.data;x({message:r,type:"success"}),f(!0),ej&&Object.keys(ej).length>0&&n(mf(CD(CD({},ej),{},{jobs:ej.jobs.map(e=>e.jobId===t.jobId?t:e)})))}).catch(e=>{x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},config:eP}),(0,iQ.jsx)(xN,{showProjectDrawer:M,onDrawerClose:()=>{F(!1)},selectedProject:D,clients:nL,handleEditProject:np,handleCreateProject:e=>{uO(e).then(n=>{P(!1),F(!1),x({message:"".concat(e.name," created successfully"),type:"success"}),f(!0),eJ(n.data,aD.CREATE)}).catch(e=>{P(!1),x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})},handleCancelProject:e=>{F(!1);var n={title:"Confirm Project Cancellation",content:ns(e),backBtnText:"Back to Project",submitBtnText:"Cancel Project",hasCloseButton:!0,hasNotification:!0,notificationText:"Permanently Delete Project (cannot be undone)",onClose:()=>{P(!1),k({})},backHandler:()=>{P(!1),k({}),F(!0)},submitHandler:()=>np(e,aR.CANCEL),notificationCallBack:()=>{k({}),nd(e)}};k(n),P(!0)},handleAddJob:e=>{R(e),F(!1),g(!0)}}),(0,iQ.jsx)(b8,{config:eP,showTemplateDrawer:L,onDrawerClose:nI,clients:nL,action:G,submitTemplate:G===aN.EDIT?nO:e=>{e.newTemplateFiles,e.templateId;var n=Ck(e,CI);return uk(n).then(e=>{var t=null==e?void 0:e.status,r=(null==e?void 0:e.data)||e;if(200===t||r){nI(),x({message:'Template "'.concat(n.name,'" created successfully'),type:"success"}),f(!0);var o="GENERIC"===n.templateType||!n.clientId||""===n.clientId,i={generic:[...(null==ex?void 0:ex.generic)||[]],client:[...(null==ex?void 0:ex.client)||[]]};return o?i.generic.push(r):i.client.push(r),e$(i),e}throw Error("Template creation failed: No data in response")}).catch(e=>{var n,t,r,o=(null==e||null==(n=e.response)||null==(n=n.data)||null==(n=n.error)?void 0:n.description)||(null==e||null==(t=e.response)||null==(t=t.data)||null==(t=t.error)?void 0:t.message)||(null==e||null==(r=e.response)||null==(r=r.data)?void 0:r.message)||(null==e?void 0:e.message)||"Error Occurred";throw x({message:"Save Template: ".concat(o),type:"failure"}),f(!0),e})},selectedTemplate:V,size:nR,onActionChange:e=>{q(e)},handleDeleteTemplateFile:nP,handleToastNotification:nE,handleViewTemplateFile:nl,handleTemplateFiles:(e,n)=>{var t="".concat(e.fileName," added successfully.");return uR(e.fileObj,e.fileName,e.seqId,"","","DIE_TEMPLATE",n.templateId).then(t=>{var r,o={seqId:e.seqId,fileName:e.fileName,fileSize:e.fileSize,uploadedTs:Date.now(),uploadedBy:ey};return n.templateFiles=[...null!=(r=null==n?void 0:n.templateFiles)?r:[],o],uN(null==n?void 0:n.templateId,n)}).then(e=>{x({message:t,type:"success"}),f(!0);var r=null==e?void 0:e.data;e$({generic:((null==ex?void 0:ex.generic)||[]).map(e=>e.templateId===(null==n?void 0:n.templateId)?r:e),client:((null==ex?void 0:ex.client)||[]).map(e=>e.templateId===(null==n?void 0:n.templateId)?r:e)}),H(r)}).catch(e=>{x({message:"Error has occurred",type:"failure"}),f(!0),console.log("ERROR ",e)})}}),(0,iQ.jsx)(Cp,{showDrawer:ee,onDrawerClose:()=>{en(!1),eo(null),eu(null),el([])},addClientHandler:e=>{var n=aI.CLIENT,t=dp();return uU(df(e,t,a_.ASC,eP.code)).then(r=>{var o,i,a=null!=(o=null==r||null==(i=r.data)?void 0:i.user)?o:{},l=CD(CD({},null!==e.parentId&&{parentId:e.parentId}),{}
1,{id:t,name:e.name,primaryUser:a.id,notes:e.notes,location:{address1:e.address1,address2:e.address2,city:e.city,state:e.state,zipCode:e.zipCode}});return uJ(dE(a,eP.code)).catch(e=>{console.error("ERROR",e)}),Promise.all([a,uI(n,l)])}).then(e=>{var t=(0,i$._)(e,2),r=t[0];nT([...eD,t[1].data]),nN(CD(CD({},r),{},{type:n}),aD.CREATE),x({message:"Client added successfully",type:"success"}),f(!0)}).catch(e=>{var n,t;console.error("ERROR",e),x({message:(null==e||null==(n=e.response)||null==(n=n.data)||null==(n=n.error)?void 0:n.code)==="USER_ALREADY_EXISTS"?null==e||null==(t=e.response)||null==(t=t.data)||null==(t=t.error)?void 0:t.description:"Error has occurred",type:"failure"}),f(!0)})},editClientHandler:(e,n)=>{var t,r,o=aI.CLIENT,i=null!=n&&n.isNewContact?df(n,e,a_.ASC,eP.code):{contact:{firstName:n.firstName,lastName:n.lastName,phone:null!=(t=null==n||null==(r=n.phone)?void 0:r.replace(/\D/g,""))?t:"",jobTitle:n.role},username:n.username};return null!=n&&n.isNewContact?uU(i):uV(n.primaryUser,eP.code,i).then(t=>{var r;return n.primaryUser=null==t||null==(r=t.data)||null==(r=r.user)?void 0:r.id,Promise.all([Promise.resolve(t),uH(e,o,dd(n))])}).then(t=>{var r,i,a=(0,i$._)(t,2),l=a[0],s=a[1],c=CD(CD({},null!=(r=null==l||null==(i=l.data)?void 0:i.user)?r:{}),{},{type:o});null!=n&&n.isNewContact&&uJ(dE(c,eP.code)).catch(e=>{console.error("ERROR",e)});var u=s.data;x({message:'Client "'.concat(u.name,'" updated successfully'),type:"success"}),f(!0),nT(dw(eD,e,u)),nN(c,null!=n&&n.isNewContact?aD.CREATE:aD.UPDATE)}).catch(e=>{console.error("ERROR",e),x({message:"Error has occurred",type:"failure"}),f(!0)})},handleEditClient:nw,handleViewProject:e=>{en(!1),X(e),Y(null),eW(aj.Projects),o(aj.Projects)},selectedClient:ec,parentClients:ea,action:er,clients:eD,users:eN})]})};function CV(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function CH(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?CV(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):CV(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var CW={notificationsCount:0,notifications:[],sessionExpired:!1},CG=t(42150),Cq=t(89099);function CK(){var e=(0,i5._)(["\n font-family: ",";\n font-size: 16px;\n color: ",";\n margin-bottom: 20px;\n"]);return CK=function(){return e},e}var CJ=i4.default.p.withConfig({displayName:"PrintBrokerError.styles__Message",componentId:"sc-8cce7e3c-0"})(iW||(iW=CK()),lQ.typography.type.motiva_medium,i3.colors.dark_gray_2);function CX(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var C$=e=>{var n=e.errorCode,t=function(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||function(e,n){if(e){if("string"==typeof e)return CX(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?CX(e,n):void 0}}
1(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,iq.useState)(""),2),r=t[0],o=t[1],i=(0,Cq.useRouter)();return(0,iq.useEffect)(()=>{n===aT.GENERAL_ERROR&&o("We are unable to process your request at this time. Please try again later."),n===aT.FORBIDDEN&&o("You do not have access to this application. Contact your account manager with any questions.")},[n]),(0,iQ.jsx)(i6.Container,{children:(0,iQ.jsx)(i6.Row,{children:(0,iQ.jsx)(i6.Column,{children:(0,iQ.jsxs)(i6.Card,{customCSS:"text-align: center;",isClickable:!1,isHover:!1,children:[(0,iQ.jsx)(CJ,{children:r}),(0,iQ.jsx)(i6.Button,{size:"md",onClickHandler:()=>i.push(ak.PRINT_BROKER_REDIRECT_URL_LOGIN),children:"Go Home"})]})})})})};function CZ(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var s=Object.create((r&&r.prototype instanceof l?r:l).prototype);return CY(s,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),s}var a={};function l(){}function s(){}function c(){}n=Object.getPrototypeOf;var u=c.prototype=l.prototype=Object.create([][r]?n(n([][r]())):(CY(n={},r,function(){return this}),n));function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,CY(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,CY(u,"constructor",c),CY(c,"constructor",s),s.displayName="GeneratorFunction",CY(c,o,"GeneratorFunction"),CY(u),CY(u,o,"Generator"),CY(u,r,function(){return this}),CY(u,"toString",function(){return"[object Generator]"}),(CZ=function(){return{w:i,m:d}})()}function CY(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(CY=function(e,n,t,r){function i(n,t){CY(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function CQ(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function C0(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return C1(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?C1(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C1(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var C2=[{id:"@euf/ele-app-tpv/printBroker",reducerMap:{printBroker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:CW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case mo.GET_PRINT_BROKER_TEMPLATES:case mo.GET_PRINT_BROKER_PROJECTS:case mo.GET_PRINT_BROKER_SETTING:case mo.GET_PRINT_BROKER_PROJECT:case mo.GET_PRINT_BROKER_USERS:case mo.GET_CURRENT_USER:case mo.GET_PRINT_BROKER_CONFIG:case mo.GET_PRINT_BROKER_PRINTERS:case mo.GET_PRINT_BROKER_CLIENTS:case mo.GET_NOTIFICATIONS:case mo.SET_NOTIFICATIONS_COUNT:return CH(CH({},e),n.payload);case mo.MARK_NOTIFICATION_AS_READ:return CH(CH({},e),{},{notifications:e.notifications.map(e=>e.notificationId===n.payload.notificationId?CH(CH({},e),{},{isRead:!0}):e),notificationsCount:Math.max(0,e.notificationsCount-1)});case mo.SET_SESSION_EXPIRED:return CH(CH({},e),{},{sessionExpired:n.payload.sessionExpired});default:return e}}}}],C6=(0,iX.withRouter)(e=>{var n=C0((0,iq.useState)(!1),2),t=n[0],r=n[1],o=C0((0,iq.useState)(null),2),i=o[0],a=o[1];return(iG.default.set("/tpv"),(0,iq.useEffect)(()=>{e.renderComponent&&r(e.renderComponent),e.errorCode&&a(e.errorCode)},[e.renderComponent,e.errorCode]),t)?(0,iQ.jsxs)(iq.Fragment,{children:[(0,iQ.jsx)(iK.mg,{children:(0,iQ.jsx)("title",{children:ak.TITLE_PAGE})}),(0,iQ.jsx)(iJ.A,{pageName:"printBroker"}),(0,iQ.jsx)(CU,{})]}):i?(0,iQ.jsxs)(iq.Fragment,{children:[(0,iQ.jsx)(iJ.A,{pageName:"printBrokerError"}),(0,iQ.jsx)(C$,{errorCode:i}
1)]}):null});C6.layout={header:!1,footer:!1},C6.getInitialProps=function(){var e,n=(e=CZ().m(function e(n){var t,r,o,i,a,l,s,c;return CZ().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=!1,r="",o=e=>new Promise((t,r)=>{(0,CG.A)(n,e,(e,n)=>e?r(e):t(n))}),e.p=1,e.n=2,o("".concat(ak.PRINT_BROKER_API_BASE_URL,"/config"));case 2:return i=e.v,n.store.dispatch(mv(i)),e.n=3,o("".concat(ak.PRINT_BROKER_API_BASE_URL,"/_ssr?tenant=").concat(i.tenant));case 3:a=e.v,n.store.dispatch(mu(a.projects)),n.store.dispatch(md(a.templates)),n.store.dispatch(mp(a.settings)),n.store.dispatch(mm(a.users)),n.store.dispatch(my(a.currentUser)),n.store.dispatch(mh(a.printers)),n.store.dispatch(mg(a.clients)),n.store.dispatch(mb(a.unreadNotificationsCount)),t=!0,e.n=5;break;case 4:e.p=4,console.log("Error fetching ssr:",c=e.v),401===(s=c.status||(null==(l=c.response)?void 0:l.status))?null!=n&&n.res&&(n.res.writeHead(302,{Location:ak.PRINT_BROKER_REDIRECT_URL_LOGIN}),n.res.end()):r=403===s?aT.FORBIDDEN:aT.GENERAL_ERROR;case 5:return e.a(2,{renderComponent:t,errorCode:r})}},e,null,[[1,4]])}),function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){CQ(i,r,o,a,l,"next",e)}function l(e){CQ(i,r,o,a,l,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}(),C6.reduxModules=C2;let C5=C6},4510:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var r=t(99922);function o(e){(0,r.A)(1,arguments);var n=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===n?new Date(e.getTime()):"number"==typeof e||"[object Number]"===n?new Date(e):(("string"==typeof e||"[object String]"===n)&&"undefined"!=typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(Error().stack)),new Date(NaN))}},4518:(e,n,t)=>{e.exports=t(46013)(function(e,n,t){return e+(t?"_":"")+n.toLowerCase()})},5702:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StyledBadge=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626)),o=t(64741),i=t(98811),a=function(e){switch(e){case"sale":case"ars":return i.tokens.color_white;case"price":return i.tokens.color_pink_700;case"stock":return i.tokens.color_orange_500;case"primary":return i.tokens.color_green_600;case"premium":return i.tokens.brand_premium;case"select":return i.tokens.brand_select;case"product":default:return i.tokens.color_red_600;case"contract":return i.tokens.brand_contract;case"new":return i.tokens.ink_blue}},l=function(e){switch(e){case"sale":case"product":default:return i.tokens.color_red_600;case"ars":return i.tokens.brand_ars_blue;case"price":return i.tokens.color_pink_700;case"stock":return i.tokens.color_orange_500;case"primary":return i.tokens.color_green_600;case"premium":return i.tokens.brand_premium;case"select":return i.tokens.brand_select;case"contract":return i.tokens.brand_contract;case"new":return i.tokens.ink_blue}};n.StyledBadge=r.default.div.withConfig({componentId:"sc-3bqfgt-0"})(["display:inline-block;font-family:",";line-height:",";border-radius:3px;font-size:",";padding:",";margin:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background-color:",";color:",";border:1px solid ",";",";"],o.typography.type.motiva_medium,function(e){return"sm"===e.size?"12px":"18px"},function(e){return"sm"===e.size?"10px":"12px"},function(e){return"sm"===e.size?"4px 6px":"4px 8px"},function(e){return"sale"===e.type?i.tokens.color_red_600:"ars"===e.type?i.tokens.brand_ars_blue:i.tokens.color_white},function(e){return a(e.type)},function(e){return l(e.type)},function(e){return e.customCSS?e.customCSS:""})},8878:e=>{"use strict";function n(e){return Array.prototype.slice.apply(e)}var t="pending",r="resolved",o="rejected";function i(e){this.status=t,this._continuations=[],this._parent=null,this._paused=!1,e&&e.call(this,this._continueWith.bind(this),this._failWith.bind(this))}function a(e){return e&&"function"==typeof e.then}function l(e){return e}function s(e){return"undefined"!=typeof window&&"AggregateError"in window?new window.AggregateError(e):{errors:e}}if(i.prototype={then:function(e,n){var t=i.unresolved()._setParent(this);
1if(this._isRejected()){if(this._paused)return this._continuations.push({promise:t,nextFn:e,catchFn:n}),t;if(n)try{var r=n(this._error);if(a(r))return this._chainPromiseData(r,t),t;return i.resolve(r)._setParent(this)}catch(e){return i.reject(e)._setParent(this)}return i.reject(this._error)._setParent(this)}return this._continuations.push({promise:t,nextFn:e,catchFn:n}),this._runResolutions(),t},catch:function(e){if(this._isResolved())return i.resolve(this._data)._setParent(this);var n=i.unresolved()._setParent(this);return this._continuations.push({promise:n,catchFn:e}),this._runRejections(),n},finally:function(e){var n=!1;function t(t,r){if(!n){n=!0,e||(e=l);var o=e(t);if(a(o))return o.then(function(){if(r)throw r;return t});if(r)throw r;return t}}return this.then(function(e){return t(e)}).catch(function(e){return t(null,e)})},pause:function(){return this._paused=!0,this},resume:function(){var e=this._findFirstPaused();return e&&(e._paused=!1,e._runResolutions(),e._runRejections()),this},_findAncestry:function(){return this._continuations.reduce(function(e,n){if(n.promise){var t={promise:n.promise,children:n.promise._findAncestry()};e.push(t)}return e},[])},_setParent:function(e){if(this._parent)throw Error("parent already set");return this._parent=e,this},_continueWith:function(e){var n=this._findFirstPending();n&&(n._data=e,n._setResolved())},_findFirstPending:function(){return this._findFirstAncestor(function(e){return e._isPending&&e._isPending()})},_findFirstPaused:function(){return this._findFirstAncestor(function(e){return e._paused})},_findFirstAncestor:function(e){for(var n,t=this;t;)e(t)&&(n=t),t=t._parent;return n},_failWith:function(e){var n=this._findFirstPending();n&&(n._error=e,n._setRejected())},_takeContinuations:function(){return this._continuations.splice(0,this._continuations.length)},_runRejections:function(){if(!this._paused&&this._isRejected()){var e=this._error,n=this._takeContinuations(),t=this;n.forEach(function(n){if(n.catchFn)try{var r=n.catchFn(e);t._handleUserFunctionResult(r,n.promise)}catch(e){n.promise.reject(e)}else n.promise.reject(e)})}},_runResolutions:function(){if(!(this._paused||!this._isResolved()||this._isPending())){var e=this._takeContinuations(),n=this._data,t=this;if(e.forEach(function(e){if(e.nextFn)try{var r=e.nextFn(n);t._handleUserFunctionResult(r,e.promise)}catch(n){t._handleResolutionError(n,e)}else e.promise&&e.promise.resolve(n)}),a(this._data))return this._handleWhenResolvedDataIsPromise(this._data)}},_handleResolutionError:function(e,n){if(this._setRejected(),n.catchFn)try{n.catchFn(e);return}catch(n){e=n}n.promise&&n.promise.reject(e)},_handleWhenResolvedDataIsPromise:function(e){var n=this;return e.then(function(e){n._data=e,n._runResolutions()}).catch(function(e){n._error=e,n._setRejected(),n._runRejections()})},_handleUserFunctionResult:function(e,n){a(e)?this._chainPromiseData(e,n):n.resolve(e)},_chainPromiseData:function(e,n){e.then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)})},_setResolved:function(){this.status=r,this._paused||this._runResolutions()},_setRejected:function(){this.status=o,this._paused||this._runRejections()},_isPending:function(){return this.status===t},_isResolved:function(){return this.status===r},_isRejected:function(){return this.status===o}},i.resolve=function(e){return new i(function(n,t){a(e)?e.then(function(e){n(e)}).catch(function(e){t(e)}):n(e)})},i.reject=function(e){return new i(function(n,t){t(e)})},i.unresolved=function(){return new i(function(e,n){this.resolve=e,this.reject=n})},i.all=function(){var e=n(arguments);return(Array.isArray(e[0])&&(e=e[0]),e.length)?new i(function(n,t){var r=[],o=0,a=function(){o===e.length&&n(r)},l=!1,s=function(e){l||(l=!0,t(e))};e.forEach(function(e,n){i.resolve(e).then(function(e){r[n]=e,o+=1,a()}).catch(function(e){s(e)})})}):i.resolve([])},i.any=function(){var e=n(arguments);return(Array.isArray(e[0])&&(e=e[0]),e.length)?new i(function(n,t){var r=[],o=0,a=function(){o===e.length&&t(s(r))}
1,l=!1,c=function(e){l||(l=!0,n(e))};e.forEach(function(e,n){i.resolve(e).then(function(e){c(e)}).catch(function(e){r[n]=e,o+=1,a()})})}):i.reject(s([]))},i.allSettled=function(){var e=n(arguments);return(Array.isArray(e[0])&&(e=e[0]),e.length)?new i(function(n){var t=[],r=0,o=function(){(r+=1)===e.length&&n(t)};e.forEach(function(e,n){i.resolve(e).then(function(e){t[n]={status:"fulfilled",value:e},o()}).catch(function(e){t[n]={status:"rejected",reason:e},o()})})}):i.resolve([])},Promise===i)throw Error("Please use SynchronousPromise.installGlobally() to install globally");var c=Promise;i.installGlobally=function(e){if(Promise===i)return e;var t=function(e){if(void 0===e||e.__patched)return e;var t=e;return(e=function(){t.apply(this,n(arguments))}).__patched=!0,e}(e);return Promise=i,t},i.uninstallGlobally=function(){Promise===i&&(Promise=c)},e.exports={SynchronousPromise:i}},10186:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ResponsiveImage=g;var r=d(t(95062)),o=d(t(14232)),i=t(15625),a=t(31499),l=d(t(91251)),s=d(t(67146)),c=t(72806),u=["images","lazyload","altText","id","customCSS","onImgLoad","className"];function d(e){return e&&e.__esModule?e:{default:e}}function p(){return(p=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function f(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return m(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m(e,n):void 0}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var h=s.default["responsive-image"];function g(e){var n=e.images,t=void 0===n?[]:n,r=e.lazyload,s=void 0!==r&&r,d=e.altText,m=void 0===d?"":d,g=e.id,y=void 0===g?"":g,v=e.customCSS,x=void 0===v?null:v,b=e.onImgLoad,j=void 0===b?null:b,w=e.className,C=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,u),_=(0,i.shouldUseMigratedComponentStyles)(),S=(0,a.useScopedCustomCSS)(h,_?x:null),I=[h,void 0===w?"":w,S].filter(Boolean).join(" ");return _?o.default.createElement("div",{id:y,className:I,"data-sui":!0},o.default.createElement(l.default,p({},C,{altText:m,lazyload:s,srcMedia:["(max-width: 500px)","(max-width: 800px)",""],images:f(t),onImgLoad:j}))):o.default.createElement(c.ResponsiveImageWrapper,{id:y,"data-sui":!0,customCSS:x},o.default.createElement(l.default,p({},C,{altText:m,lazyload:s,srcMedia:["(max-width: 500px)","(max-width: 800px)",""],images:f(t),onImgLoad:j})))}g.propTypes={images:r.default.array,lazyload:r.default.bool,altText:r.default.string,id:r.default.string,customCSS:r.default.oneOfType([r.default.string,r.default.object,r.default.array]),className:r.default.string,onImgLoad:r.default.func}},11098:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.NotificationBubble=v;var o=function(e){return e&&e.__esModule?e:{default:e}}(t(95062)),i=u(t(14232)),a=t(88728),l=t(53482),s=t(69558),c=["alignItem","maxWidth","showCloseBtn","onClose","id","customCSS","textSize","isCustomIcon","textColor","isAnimate","noBorder"];function u(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;
1return(u=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function f(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return m(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var h=function(e){switch(e){case"success":return"color_green_600";case"warning":return"color_orange_500";case"failure":return"color_red_600";default:return"color_blue_500"}},g=function(e){switch(e){case"success":return"check-circle";case"warning":return"warning-triangle";case"failure":return"error-square-outline";default:return"info-bubble"}},y=function(e){switch(e){case"success":return"positive-filled";case"warning":return"warning-triangle-filled";case"failure":return"error-square";default:return"info-bubble-filled"}};function v(e){var n=e.alignItem,t=e.maxWidth,o=e.showCloseBtn,u=e.onClose,m=void 0===u?function(){}:u,v=e.id,x=void 0===v?null:v,b=e.customCSS,j=void 0===b?null:b,w=e.textSize,C=void 0===w?"lg":w,_=e.isCustomIcon,S=e.textColor,I=e.isAnimate,E=void 0!==I&&I,P=e.noBorder,O=void 0!==P&&P,T=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,c),k=T.variant,N=T.children,D=(0,i.useRef)(null),R=f((0,i.useState)(0),2),A=R[0],M=R[1],F=f((0,i.useState)(0),2),z=F[0],L=F[1];return(0,i.useEffect)(function(){E&&(setTimeout(function(){L(A)},1e3),M(D&&D.current&&2*D.current.clientHeight))},[A,E]),i.default.createElement(s.StyledWrapper,{"data-sui":!0,role:"alert","aria-label":"Notification Bubble",isAnimate:E,style:function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach(function(n){var o,i,a;o=e,i=n,a=t[n],(i=function(e){var n=function(e,n){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,n||"default");if("object"!=r(o))return o;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==r(n)?n:n+""}(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}({},E?{maxHeight:"".concat(z,"px")}:null)},i.default.createElement(s.StyledNotificationBubble,d({},T,x&&{id:x},j&&{customCSS:j},{color:void 0===S?"color_text_primary":S,variant:k,textSize:C,maxWidth:void 0!==t&&t,alignItem:void 0===n?"center":n,ref:D},O&&{noBorder:O}),void 0!==_&&_?N:i.default.createElement(i.default.Fragment,null,i.default.createElement(s.StyledIconWrapper,null,i.default.createElement(l.Icon,{name:O?y(k):g(k),size:18,color:h(k)})),i.default.createElement(s.StyledContent,{textSize:C},N)),void 0!==o&&o&&i.default.createElement(s.StyledBtn,{"aria-label":"Close Notification",onClick:function(e){(0,a.stopProp)(e),m()}},i.default.createElement(l.Icon,{name:"close",size:16,color:"color_gray_400"}))))}
1v.propTypes={variant:o.default.oneOf(["info","success","warning","failure"]).isRequired,children:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node]),maxWidth:o.default.bool,showCloseBtn:o.default.bool,onClose:o.default.func,id:o.default.string,customCSS:o.default.string,textSize:o.default.oneOf(["lg","md"]),isCustomIcon:o.default.bool,textColor:o.default.string,isAnimate:o.default.bool,noBorder:o.default.bool}},11892:(e,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getTypeAhead=void 0,n.getTypeAhead=function(e,n){return e.filter(function(t,r){return e[r].toLowerCase().indexOf(n.toLowerCase())>-1})}},13578:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.spacing=n.pageMargins=n.pageMargin=n.mixinBreakpoint=n.breakpoint=void 0;var r=t(21626),o=t(88728),i=n.spacing={padding:{small:10,medium:20,large:30},borderRadius:{small:5,default:10}},a=n.breakpoint=600,l=n.pageMargin="5.55555";n.pageMargins=(0,r.css)(["padding:0 ","px;@media (min-width:","px){margin:0 ","%;}@media (min-width:","px){margin:0 ","%;}@media (min-width:","px){margin:0 ","%;}@media (min-width:","px){margin:0 ","%;}"],i.padding.medium,+a,+l,2*a,2*l,3*a,3*l,4*a,4*l),n.mixinBreakpoint=function(e,n){return"@media all and (max-width: ".concat(o.BREAKPOINTS[e],"px) {\n ").concat(n,"\n }")}},14710:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.RadioWrapper=n.RadioIcon=n.RadioGroupWrapper=n.RadioContentWrapper=n.LabelWrapper=n.Input=n.CustomRadio=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626)),o=t(98811);n.RadioGroupWrapper=r.default.div.withConfig({componentId:"sc-1asg7y8-0"})(["display:flex;margin:2px;flex-direction:",";",";"],function(e){return"vertical"===e.orientation?"column":"row"},function(e){return e.customCSS?e.customCSS:""}),n.Input=r.default.input.withConfig({componentId:"sc-1asg7y8-1"})(["display:block;width:100%;max-width:100%;border:1px solid ",";padding:8px 10px;margin:3px 0;font-size:16px;line-height:1em;color:",";background:",";transition:border-color 0.5s;box-shadow:none;border-radius:3px;"],o.tokens.color_gray_100,o.tokens.color_gray_600,o.tokens.color_white),n.CustomRadio=r.default.div.withConfig({componentId:"sc-1asg7y8-2"})(["width:auto;display:flex;padding:6px 6px 6px 0px;",";&:focus{outline:",";}&:focus-visible{outline:",";}"],function(e){return e.disabled&&{pointerEvents:"none"}},function(e){return e.disableOutline?"none":void 0},function(e){return e.disableOutline?"none":"1px dashed ".concat(o.tokens.color_black)}),n.RadioContentWrapper=r.default.div.withConfig({componentId:"sc-1asg7y8-3"})(["width:100%;display:flex;padding:",";",""],function(e){return"gray"===e.variant?"8px":"6px"},function(e){return"gray"===e.variant&&"background-color: ".concat(o.tokens.color_gray_100,";\n border-radius: 12px;\n ")}),n.RadioWrapper=r.default.div.withConfig({componentId:"sc-1asg7y8-4"})(["cursor:pointer;display:flex;align-items:center;justify-content:center;position:relative;height:28px;width:16px;z-index:1;min-width:16px;"]),n.LabelWrapper=r.default.div.withConfig({componentId:"sc-1asg7y8-5"})(["margin-top:auto;margin-bottom:auto;font-size:",";font-weight:",";padding:2px 0 0 10px;word-wrap:break-word;width:100%;color:",";"],function(e){return"lg"===e.size?"16px":"14px"},function(e){return e.fontWeight},function(e){return e.disabled?o.tokens.color_gray_400:"dark"===e.variant?o.tokens.color_white:o.tokens.color_black});var i=function(e){var n=e.disabled?o.tokens.color_gray_100:o.tokens.color_white,t=e.disabled?o.tokens.color_gray_400:e.error?o.tokens.color_red_600:o.tokens.color_gray_600;return e.selected?(t=e.error?o.tokens.color_red_600:o.tokens.color_blue_500,"dark"===e.variant&&(n=t,t=o.tokens.color_white)):"dark"===e.variant&&(t=o.tokens.color_gray_600),"background-color: ".concat(n,"; border-color: ").concat(t,";")};n.RadioIcon=r.default.div.withConfig({componentId:"sc-1asg7y8-6"}
1)(["height:16px;width:16px;border-style:solid;border-radius:50%;border-width:","px;",""],function(e){return e.selected?4:1},function(e){return i(e)})},15574:(e,n,t)=>{var r=t(95616),o=t(71747),i=t(47871);e.exports=function(e,n){var t={};return n=i(n,3),o(e,function(e,o,i){r(t,o,n(e,o,i))}),t}},17204:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.useCustomContext=n.VisualFilterContext=n.ToggleContext=n.TabsContext=n.QuantityContext=n.LinearThermometerContext=n.DropdownContext=n.CustomProvider=n.CustomContext=n.AccordionItemContext=n.AccordionContext=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(t(95062)),i=a(t(14232));function a(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;return(a=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}var l=n.CustomContext=(0,i.createContext)();n.TabsContext=(0,i.createContext)(),n.AccordionContext=(0,i.createContext)(),n.AccordionItemContext=(0,i.createContext)(),n.LinearThermometerContext=(0,i.createContext)(),n.ToggleContext=(0,i.createContext)(),n.QuantityContext=(0,i.createContext)(),n.DropdownContext=(0,i.createContext)(),n.VisualFilterContext=(0,i.createContext)();var s=n.CustomProvider=function(e){var n=e.children,t=e.value;return i.default.createElement(l.Provider,{value:void 0===t?{}:t},void 0===n?null:n)};n.useCustomContext=function(e){var n=(0,i.useContext)(e);if(void 0===n)throw Error("useCustomContext must be used within a component");return n},s.propTypes={value:o.default.oneOfType([o.default.array,o.default.object]),children:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node])}},19754:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ErrorMessage=c;var r=l(t(95062)),o=l(t(14232)),i=t(53482),a=t(49414);function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function c(e){var n=e.size,t=void 0===n?"sm":n,r=e.children,l=e.customCSS,c=e.id,u=e.color,d=void 0===u?"color_red_600":u,p=e.errorRef,f=e.ariaHidden,m=e.fieldNotificationType,h=void 0===m?"error":m,g=e.height,y=void 0===g?null:g;return o.default.createElement(a.ErrorWrapper,s({customCSS:void 0===l?"":l,size:t,color:d,id:void 0===c?null:c,ref:void 0===p?null:p},void 0===f||f?{"aria-hidden":"true"}:{tabIndex:"0",role:"alert"},{"data-sui":!0,style:y?{height:"".concat(y,"px")}:{}}),o.default.createElement("div",null,o.default.createElement(i.Icon,{name:"error"===h?"error-square":"warning-triangle",size:15,color:h?"error"===h?"color_red_600":"color_yellow_600":"".concat(d)})),o.default.createElement(a.ErrorText,{color:d,size:t},void 0===r?"":r))}c.propTypes={children:r.default.oneOfType([r.default.arrayOf(r.default.node),r.default.node,r.default.string]),ariaHidden:r.default.bool,customCSS:r.default.string,id:r.default.string,color:r.default.string,errorRef:r.default.oneOfType([r.default.func,r.default.shape({current:r.default.elementType})]),fieldNotificationType:r.default.oneOf(["error","warning"]),size:r.default.oneOf(["sm","md","lg"]),height:r.default.number}},20772:(e,n,t)=>{var r=t(52076);e.exports=t(46013)(function(e,n,t){return n=n.toLowerCase(),e+(t?r(n):n)})},22685:e=>{class n{constructor(e){this.value=e,this.next=void 0}}class t{constructor(){this.clear()}enqueue(e){let t=new n(e);this._head?this._tail.next=t:this._head=t,this._tail=t,this._size++}dequeue(){let e=this._head;if(e)return this._head=this._head.next,this._size--,e.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e.value,e=e.next}}e.exports=t},27627:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.FormikWrapper=b;var o=t(78206),i=m(t(4917)),a=m(t(40123)),l=m(t(98825)),s=m(t(95062)),c=f(t(14232)),u=t(88728),d=t(62660),p=["isSubmitting"];function f(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;
1return(f=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}function m(e){return e&&e.__esModule?e:{default:e}}function h(){return(h=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function g(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,n){if(e){if("string"==typeof e)return v(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?v(e,n):void 0}}function v(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var x=function(e){var n=e.focusOnFirstElement,t=void 0===n||n,r=e.focusOnFirstError,i=void 0===r||r,s=(0,o.useFormikContext)(),d=s.isValid,p=s.submitCount,f=s.isSubmitting,m=s.errors,h=s.dirty,y=s.values,v=s.touched,x=s.setFieldTouched,b=Object.keys(y)[0],j=(0,c.useCallback)(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=Object.keys(e)[0];return(0,l.default)(e[t])?j(e[t],[].concat(g(n),[t])):[].concat(g(n),[t]).join(".")});return(0,c.useEffect)(function(){if((0,u.checkWindow)())if(!d&&0!==p&&f&&i){var e=j(m);window.document.getElementsByName(e).length&&window.document.getElementsByName(e)[0].focus()}else!h&&(0,a.default)(v)&&t&&window.document.getElementsByName(b).length&&(x(b,!0,!1),window.document.getElementsByName(b)[0].focus())},[p,d,m,f,h,b,v,j,x,t,i]),null};function b(e){var n,t=e.initialValues,r=e.onSubmit,l=e.children,s=e.validationSchema,f=void 0===s?null:s,m=e.footerContent,g=void 0===m?null:m,v=e.enableReinitialize,b=void 0!==v&&v,j=e.defineSubmitOnForm,w=void 0!==j&&j,C=e.defineResetOnForm,_=void 0!==C&&C,S=e.disableSubmit,I=void 0!==S&&S,E=e.preventEnterKey,P=void 0!==E&&E,O=e.callbackFnOnErrors,T=e.callbackFnToFormikRef,k=e.customCSS,N=void 0===k?null:k,D=e.focusOnFirstElement,R=void 0===D||D,A=e.focusOnFirstError,M=void 0===A||A,F=e.formMethod,z=void 0===F?"GET":F,L=function(e){(0,u.getEventKey)(e)===u.CANON_TO_EVENT_KEY.enter&&e.preventDefault()},B=(0,c.useCallback)(function(e){e.preventDefault()},[]),U=function(e){if(Array.isArray(e))return e}(n=(0,c.useState)(!1))||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(n,2)||y(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),V=U[0],H=U[1];(0,c.useEffect)(function(){H(!0)},[]);var W=(0,i.default)(void 0===O?function(){}:O,200),G=(0,i.default)(void 0===T?function(){}:T,200);return c.default.createElement(o.Formik,h({initialValues:t,onSubmit:void 0===r?null:r},b&&{enableReinitialize:b},f&&{validationSchema:f}),function(e){var n=e.isSubmitting,t=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,p);return c.default.createElement("form",h({},w&&{onSubmit:t.handleSubmit},P&&{onKeyDown:L},n&&!(0,a.default)(t.errors)&&W&&W(t.errors,t),G&&G(t),_&&{onReset:t.handleReset},{method:z},!V&&{onSubmit:B},{"data-sui":!0}),c.default.createElement(c.default.Fragment,null,l),g&&c.default.createElement(d.ButtonWrapper,{customCSS:N,style:g.style},g.components.map(function(e,n){return c.default.createElement(e.component,h({isFormik:!0,key:e.props.id?e.props.id:n},e.props,"Submit"===e.type&&{onClickHandler:t.handleSubmit},"Submit"===e.type&&I&&{disabled:!t.dirty},"Reset"===e.type&&{onClickHandler:t.handleReset}),e.btnLabel)})),c.default.createElement(x,{focusOnFirstElement:R,focusOnFirstError:M}))})}x.propTypes={focusOnFirstElement:s.default.bool,focusOnFirstError:s.default.bool}
1,b.propTypes={children:s.default.oneOfType([s.default.arrayOf(s.default.node),s.default.node]).isRequired,initialValues:s.default.object.isRequired,onSubmit:s.default.func,validationSchema:s.default.object,footerContent:s.default.shape({style:s.default.object,components:s.default.arrayOf(s.default.shape({component:s.default.object,btnLabel:s.default.string,props:s.default.object}))}),enableReinitialize:s.default.bool,defineSubmitOnForm:s.default.bool,defineResetOnForm:s.default.bool,disableSubmit:s.default.bool,callbackFnOnErrors:s.default.func,preventEnterKey:s.default.bool,callbackFnToFormikRef:s.default.func,customCSS:s.default.string,focusOnFirstElement:s.default.bool,focusOnFirstError:s.default.bool,formMethod:s.default.oneOf(["POST","GET"])}},33836:(e,n,t)=>{var r=t(64451),o=t(79699),i=t(24015),a=t(27136),l=t(36827),s=t(62909),c=t(19887),u=t(44577),d=t(82180),p=t(65048),f=r?r.iterator:void 0;e.exports=function(e){if(!e)return[];if(a(e))return l(e)?d(e):o(e);if(f&&e[f])return s(e[f]());var n=i(e);return("[object Map]"==n?c:"[object Set]"==n?u:p)(e)}},34246:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StyledReviewCount=n.StyledRatingLabel=n.RatingWrapper=n.RatingStarWrapper=n.RatingCaret=n.NoReviewsText=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626)),o=t(98811),i={lg:"14px",md:"12px",sm:"10px"};n.RatingWrapper=r.default.div.withConfig({componentId:"sc-mad84n-0"})(["display:inline-flex;align-items:baseline;",";"],function(e){return e.customCSS?e.customCSS:""}),n.StyledRatingLabel=r.default.div.withConfig({componentId:"sc-mad84n-1"})(["font-size:",";margin-right:5px;"],function(e){return i[e.size]}),n.StyledReviewCount=r.default.div.withConfig({componentId:"sc-mad84n-2"})(["font-size:",";margin:0 10px;cursor:",";text-decoration:",";color:",";&:hover{color:",";}"],function(e){return i[e.size]},function(e){return e.reviewCallback&&0!==e.noOfReviews?"pointer":"initial"},function(e){return e.reviewCallback&&0!==e.noOfReviews?"underline":"none"},o.tokens.color_black,o.tokens.color_black),n.RatingStarWrapper=r.default.div.withConfig({componentId:"sc-mad84n-3"})(["display:flex;align-items:baseline;"]),n.RatingCaret=r.default.div.withConfig({componentId:"sc-mad84n-4"})(["margin-left:5px;display:flex;"]),n.NoReviewsText=r.default.div.withConfig({componentId:"sc-mad84n-5"})(["font-size:",";color:",";"],function(e){return i[e.size]},o.tokens.color_gray_500)},34993:(e,n,t)=>{"use strict";let r=t(22685);e.exports=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up");let n=new r,t=0,o=()=>{t--,n.size>0&&n.dequeue()()},i=async(e,n,...r)=>{t++;let i=(async()=>e(...r))();n(i);try{await i}catch{}o()},a=(r,o,...a)=>{n.enqueue(i.bind(null,r,o,...a)),(async()=>{await Promise.resolve(),t<e&&n.size>0&&n.dequeue()()})()},l=(e,...n)=>new Promise(t=>{a(e,t,...n)});return Object.defineProperties(l,{activeCount:{get:()=>t},pendingCount:{get:()=>n.size},clearQueue:{value:()=>{n.clear()}}}),l}},35264:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Stars=c;var r=s(t(95062)),o=s(t(14232)),i=t(25939),a=t(53482),l=t(84684);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){for(var n=e.rating,t=void 0===n?0:n,r=e.size,i=void 0===r?16:r,a=e.emptyStarBgColor,s=void 0===a?"white":a,c=Math.floor(t),p=[],f=1;f<=c;f++)p.push(1);if(t<d){var m=t-c;if(m>0){var h,g=(h=Number(m.toFixed(2)))>=0&&h<=.14?0:h>=.15&&h<=.34?.37:h>=.35&&h<=.64?.5:h>=.65&&h<=.84?.68:100;p.push(g)}for(var y=d-p.length,v=1;v<=y;v++)p.push(0)}return o.default.createElement(l.StarsContainer,{"data-sui":!0},p.map(function(e,n){return o.default.createElement(u,{key:n,size:i,percent:100*e,emptyStarBgColor:s})}))}function u(e){var n=e.size,t=void 0===n?16:n,r=e.percent,s=e.emptyStarBgColor;return o.default.createElement(i.DoubleIcon,{"data-sui":!0,size:t},o.default.createElement(a.Icon,{name:"star",color:"color_yellow_600",size:t}),o.default.createElement(l.Square,{size:t,percent:void 0===r?100:r,emptyStarBgColor:void 0===s?"white":s}),o.default.createElement(a.Icon,{name:"star-empty",color:"color_yellow_600",size:t}))}var d=5;u.propTypes={size:r.default.number,percent:r.default.number,emptyStarBgColor:r.default.string},c.propTypes={size:r.default.number,rating:r.default.number,emptyStarBgColor:r.default.string}},37070:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SubSearch=s;var r=l(t(95062)),o=l(t(14232)),i=t(73174),a=t(70258);
1function l(e){return e&&e.__esModule?e:{default:e}}function s(e){var n=e.onSearch,t=e.onSelect,r=e.onClearInput,l=e.autoResults,s=e.inputType,c=e.resetInput,u=e.maxLength,d=e.id,p=e.customCSS,f=e.placeHolder,m=e.onFilter,h=e.handleChange,g=e.showDropdown,y=e.size,v=e.textValue,x=e.ariaLabel,b=e.errorMsg;return o.default.createElement(a.StyledWrapper,{"data-sui":!0},o.default.createElement(i.TextInput,{textInputType:"typeAhead",options:void 0===l?[]:l,showCloseBtn:!0,showSearchBtn:!0,placeholder:void 0===f?null:f,id:"subSearchInput".concat((void 0===d?null:d)||""),maxLength:void 0===u?20:u,onSearch:void 0===n?function(){}:n,onSelect:void 0===t?function(){}:t,clearInput:void 0===r?function(){}:r,type:void 0===s?"text":s,onFilter:void 0===m?function(){}:m,onChange:void 0===h?function(){}:h,resetInput:void 0!==c&&c,customCSS:void 0===p?null:p,ariaLabel:void 0===x?"":x,autoComplete:"off",size:void 0===y?"md":y,showDropdown:void 0===g||g,value:void 0===v?"":v,errorMsg:void 0===b?"":b}))}s.propTypes={maxLength:r.default.number,resetInput:r.default.bool,id:r.default.string,inputType:r.default.oneOf(["text","number"]),autoResults:r.default.oneOfType([r.default.arrayOf(r.default.object),r.default.arrayOf(r.default.string)]),onSelect:r.default.func,onSearch:r.default.func,onClearInput:r.default.func,customCSS:r.default.string,placeHolder:r.default.string,onFilter:r.default.func,handleChange:r.default.func,showDropdown:r.default.bool,size:r.default.oneOf(["sm","md"]),textValue:r.default.string,ariaLabel:r.default.string,errorMsg:r.default.string}},39904:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.TextArea=m;var o=function(e){return e&&e.__esModule?e:{default:e}}(t(95062)),i=u(t(14232)),a=t(88728),l=t(19754),s=t(53482),c=t(90732);function u(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;return(u=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function p(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return f(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function m(e){var n=this,t=e.name,r=void 0===t?"text-area":t,o=e.placeholder,u=void 0===o?"":o,f=e.height,m=void 0===f?null:f,g=e.maxLength,y=void 0===g?null:g,v=e.disabled,x=void 0!==v&&v,b=e.isRequired,j=void 0!==b&&b,w=e.label,C=void 0===w?"":w,_=e.id,S=e.customCSS,I=e.onChange,E=void 0===I?function(){}:I,P=e.onBlur,O=void 0===P?function(){}:P,T=e.errorMsg,k=void 0===T?null:T,N=e.labelBGColor,D=e.ariaLabel,R=void 0===D?"":D,A=e.value,M=void 0===A?"":A,F=e.clearClickHandler,z=void 0===F?function(){}:F,L=(0,i.useRef)(),B=p((0,i.useState)("3px"),2),U=B[0],V=B[1],H=p((0,i.useState)(M),2),W=H[0],G=H[1],q=function(){L.current&&L.current.clientHeight<L.current.scrollHeight?V("15px"):V("3px")};return(0,i.useEffect)(function(){G(M),q()},[M]),i.default.createElement(i.default.Fragment,null,i.default.createElement(c.TextAreaWrapper,{"data-sui":!0,id:void 0===_?null:_,customCSS:void 0===S?null:S},C&&i.default.createElement(c.TextAreaLabel,{htmlFor:r,disabled:x,labelBGColor:void 0===N?"white":N},C,j&&i.default.createElement("span",{"aria-hidden":!0},"*")),i.default.createElement(c.TextAreaComp,d({ref:L,error:k,onChange:function(e){(0,a.stopProp)(e);var t=e.currentTarget.value;y&&t&&(t=t.substring(0,y)),G(t),E&&E.call(n,e,e.currentTarget.value),q()},onBlur:function(e){(0,a.stopProp)(e),O&&O.call(n,e,e.currentTarget.value)},disabled:x,id:r,cols:h,height:m},j&&{required:!0,"aria-required":!0},R&&{"aria-label":R},u&&{placeholder:u},{style:{height:"".concat(m,"px")}},x&&{disabled:!0},{maxLength:y,value:W})),!x&&i.default.createElement(c.ButtonWrapper,{rightPadding:U},i.default.createElement(c.Button,{"aria-label":"Clear text area value",onClick:function(e){L.current.value="",G(""),V("3px"),z(),E&&E.call(n,e,e.currentTarget.value)},type:"button"},i.default.createElement(s.Icon,{name:"close",size:16,color:"color_icon_subtle"}))),y&&(!x||W.length>0)&&i.default.createElement(c.CountTextBox,{tabIndex:0,"aria-label":"characters to ".concat(W.length," / ").concat(y," text")},i.default.createElement("span",{"aria-hidden":!0},W.length,"/",y))),k&&i.default.createElement(l.ErrorMessage,null,k))}var h=180;m.propTypes={name:o.default.string,placeholder:o.default.string,height:o.default.number,maxLength:o.default.number,isRequired:o.default.bool,disabled:o.default.bool,label:o.default.string,customCSS:o.default.string,id:o.default.string,errorMsg:o.default.string,onChange:o.default.func,onBlur:o.default.func,labelBGColor:o.default.string,ariaLabel:o.default.string,value:o.default.string,clearClickHandler:o.default.func}},42252:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DropdownMenu=void 0;
1var r=c(t(18270)),o=c(t(95062)),i=c(t(14232)),a=t(17204),l=t(53482),s=t(2752);function c(e){return e&&e.__esModule?e:{default:e}}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}(n.DropdownMenu=function(e){var n=e.options,t=void 0===n?[]:n,o=e.dropdownHeight,c=e.withoutIcons,d=void 0!==c&&c,p=e.withEditIcon,f=void 0!==p&&p,m=e.align,h=e.size,g=void 0===h?"md":h,y=e.allowNewEntry,v=void 0!==y&&y,x=e.onHoverDropdown,b=void 0===x?function(){}:x,j=e.onEditIconClick,w=void 0===j?function(){}:j,C=e.multilineLabel,_=function(e,n){var t;return t=e.replace(n,function(e){return"<span>".concat(e,"</span>")}),r.default.sanitize(t)},S=(0,a.useCustomContext)(a.DropdownContext),I=S.currValue,E=S.dropdownIndex,P=S.open,O=S.selectOption,T=S.handleKeyDown,k=S.dropdownPosition,N=S.dropdownRef,D=S.filteredResults,R=S.activeState,A=S.inputValue,M=S.listboxId,F=S.dropdownListboxId,z=S.selectedOptions,L=S.dropDownType,B=!!(D||"typeAhead"===L),U=!!(P&&!B||t.length>0&&(P||D&&R)),V=function(e){return e&&e.optionHTML?e.optionHTML:e&&e.text?e.text:e},H=function(e,n,t){if(n&&"object"===u(n)&&n.disabled){e&&"function"==typeof e.preventDefault&&e.preventDefault();return}O(e,n,t)},W=function(e){return e&&"object"===u(e)?e.id||e.value||e.text:e},G=t.map(function(e,n){var t,r=e&&e.text?e.text:e,o=I&&I.text?I.text:I,a=z?z.some(function(n){return W(n)===W(e)}):r===o,c=e&&"object"===u(e)&&!0===e.disabled;return i.default.createElement(s.StyledDropdownItemWrapper,{key:n,"aria-selected":a},i.default.createElement(s.StyledDropdownItem,{value:I||A,item:e,index:n,dropdownIndex:E,role:"option",id:"itemQty_".concat(M,"_").concat(n),onClick:c?void 0:function(t){return H(t,e,n)},onMouseDown:c?void 0:function(t){return H(t,e,n)},onMouseEnter:c?void 0:function(n){return null==b?void 0:b(n,e)},size:g,"aria-label":(t=e)&&"object"===u(t)?"string"==typeof t.ariaLabel?t.ariaLabel:"string"==typeof t.text?t.text:"":"string"==typeof t||"number"==typeof t?String(t):"","aria-selected":a,"aria-disabled":c,disabled:c},!d&&!f&&i.default.createElement(s.WithoutIconStyleWrap,null,a&&i.default.createElement("span",null,i.default.createElement(l.Icon,{name:"check",size:16}))),v&&0===D.length&&i.default.createElement(s.AddEntryIcon,null,i.default.createElement(l.Icon,{name:"cancel",size:22})),D?i.default.createElement(s.StyledFlex,null,e.iconLeft,i.default.createElement(s.BoldSpan,null,i.default.createElement("div",{dangerouslySetInnerHTML:{__html:"".concat(_(V(e),A))}})),e.subText&&i.default.createElement(s.SubText,null,e.subText),e.iconRight):V(e)),f&&i.default.createElement(s.WithoutIconStyleWrapedit,{role:"button",index:n,dropdownIndex:E,onClick:function(){return w(V(e).props)}},i.default.createElement("span",null,i.default.createElement(l.Icon,{name:"edit",size:12}))))});return i.default.createElement(s.StyledDropdownMenu,{"data-sui":!0,id:F||M,role:"listbox",tabIndex:"-1","aria-live":"assertive","aria-atomic":"true","aria-label":"dropdown","aria-activedescendant":E>=0&&U?"itemQty_".concat(M,"_").concat(E):void 0,style:{maxHeight:void 0===o?"40vh":o,bottom:"".concat("up"!==k||void 0!==C&&C?"initial":"calc(100% + 8px)")},isOpen:U,ref:N,align:void 0===m?"left":m,onKeyDown:function(e){return T(e)}},U?G:null)}).propTypes={options:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node,o.default.arrayOf(o.default.shape({value:o.default.string,text:o.default.any,optionHTML:o.default.any,disabled:o.default.bool}))]),dropdownHeight:o.default.string,withoutIcons:o.default.bool,withEditIcon:o.default.bool,align:o.default.oneOf(["left","right"]),size:o.default.oneOf(["md","sm"]),allowNewEntry:o.default.bool}},43745:(e,n,t)=>{var r=t(24127);e.exports=function(e,n){return r(e,5,n="function"==typeof n?n:void 0)}},44714:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.CheckBox=f;
1var o=function(e){return e&&e.__esModule?e:{default:e}}(t(95062)),i=u(t(14232)),a=t(88728),l=t(53482),s=t(61830),c=["isChecked","size","customLabelCSS","disabled","label","id","customCSS","className","ariaLabel","error","tabIndex","variant","onChange","name","isRequired","onBlur"];function u(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;return(u=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function f(e){var n,t=e.isChecked,r=void 0!==t&&t,o=e.size,u=e.customLabelCSS,f=e.disabled,h=void 0!==f&&f,g=e.label,y=e.id,v=e.customCSS,x=e.className,b=void 0===x?"custom-checkbox":x,j=e.ariaLabel,w=e.error,C=e.tabIndex,_=e.variant,S=void 0===_?"light":_,I=e.onChange,E=void 0===I?null:I,P=e.name,O=void 0===P?"checkbox":P,T=e.isRequired,k=e.onBlur,N=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,c),D=function(e){if(Array.isArray(e))return e}(n=(0,i.useState)(r))||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(n,2)||function(e,n){if(e){if("string"==typeof e)return p(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?p(e,n):void 0}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),R=D[0],A=D[1],M=function(e){if(e.preventDefault&&(e.preventDefault(),e.stopPropagation()),!h){var n=!R;A(n),E&&(e.target=e.target||{},e.target.value=n,E(e,n,O))}};(0,i.useEffect)(function(){A(r)},[r]);var F=void 0!==w&&w?"brand_primary":S===m?"color_white":h?"color_gray_400":"";return i.default.createElement(s.CheckBoxWrpper,d({},N,{"data-sui":!0}),i.default.createElement(s.Input,{name:O,value:R,type:"hidden"}),i.default.createElement(s.CustomCheckBox,d({onClick:M,onKeyDown:function(e){if(!h){if((0,a.getEventKey)(e)===a.CANON_TO_EVENT_KEY.space||(0,a.getEventKey)(e)===a.CANON_TO_EVENT_KEY.enter)M(e);else if((0,a.getEventKey)(e)===a.CANON_TO_EVENT_KEY.up||(0,a.getEventKey)(e)===a.CANON_TO_EVENT_KEY.down){e.preventDefault();var n=(0,a.getEventKey)(e)===a.CANON_TO_EVENT_KEY.up?-1:1,t=document.querySelectorAll("."+b+":not([disabled])"),r=Array.from(t).findIndex(function(n){return n===e.target})+n;r>=0&&r<t.length?t[r].focus():r===t.length?t[0].focus():r<0&&t[t.length-1].focus()}}}},h&&{"aria-disabled":!0},{id:void 0===y?null:y,className:b,tabIndex:h?-1:void 0===C?0:C,"aria-label":void 0===j?"":j,role:"checkbox","aria-checked":R,disabled:h,customCSS:void 0===v?null:v,onBlur:function(e){k&&k(e,R)}}),i.default.createElement(s.IconWrapper,null,i.default.createElement(s.IconGroup,null,R?i.default.createElement(i.default.Fragment,null,i.default.createElement("span",null,i.default.createElement(l.Icon,{name:"check-filled",size:16,color:F||"color_blue_500"})),i.default.createElement(s.SecondIcon,null,i.default.createElement(l.Icon,{name:"check",size:16,color:S===m?"color_blue_500":"color_white"}))):i.default.createElement(s.UnCheckedIcon,{disabled:h},i.default.createElement(l.Icon,{name:"check-outline",size:16,color:F||"dark_gray"})))),i.default.createElement(s.LabelWrapper,{customLabelCSS:(void 0===u?null:u)||"",size:void 0===o?"lg":o,disabled:h,variant:S},void 0!==T&&T&&i.default.createElement("span",{"aria-hidden":!0},"*"),void 0===g?"":g)))}var m="dark";
1f.propTypes={isChecked:o.default.bool,size:o.default.oneOf(["lg","sm"]),disabled:o.default.bool,label:o.default.string,id:o.default.string,customCSS:o.default.string,customLabelCSS:o.default.string,className:o.default.string,ariaLabel:o.default.string,error:o.default.bool,tabIndex:o.default.number,variant:o.default.oneOf(["light","dark"]),onChange:o.default.func,name:o.default.string,isRequired:o.default.bool}},48738:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StyledText=n.StyledStep=n.StyledSegment=n.StyledProgress=n.StyledLine=n.StyledDot=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626)),o=t(64741),i=t(98811),a=t(88728);n.StyledProgress=r.default.div.withConfig({componentId:"sc-1wlk8wp-0"})(["display:flex;flex-direction:row;justify-content:space-between;margin:20px 0;",";"],function(e){return e.customCSS?e.customCSS:""}),n.StyledStep=r.default.div.withConfig({componentId:"sc-1wlk8wp-1"})(["font-size:",";display:flex;flex-direction:column;align-content:center;flex:1 1 0;width:100%;&:first-child{border-color:transparent;.segment:first-child{border-color:transparent;}}&:last-child{border-color:transparent;.segment:last-child{border-color:transparent;}}"],function(e){return e.fontSize}),n.StyledLine=r.default.div.withConfig({componentId:"sc-1wlk8wp-2"})(["width:100%;display:flex;flex-direction:row;"]),n.StyledSegment=r.default.div.withConfig({componentId:"sc-1wlk8wp-3"})(["border-bottom:"," solid;@media all and (max-width:","px){border-bottom:"," solid;}width:100%;"],function(e){return 1===e.version&&"complete"===e.type||"completedIcon"===e.type?"2px ".concat(i.tokens.color_pink_700):"2px ".concat(i.tokens.color_gray_400)},a.BREAKPOINTS.sm,function(e){return 1===e.version&&"complete"===e.type||"completedIcon"===e.type?"1px ".concat(i.tokens.color_pink_700):"1px ".concat(i.tokens.color_gray_400)}),n.StyledDot=r.default.div.withConfig({componentId:"sc-1wlk8wp-4"})(["width:100%;height:16px;display:flex;flex-direction:row;justify-content:center;align-items:center;margin-top:-9px;z-index:1;position:relative;&:after{position:absolute;content:'';height:16px;width:16px;background:#fff;border-radius:50%;z-index:-1;@media all and (max-width:","px){height:12px;width:12px;}}> div{display:flex;align-items:center;justify-content:center;height:",";width:",";@media all and (max-width:","px){height:",";width:",";}border-radius:50%;background:",";"," span{aspect-ratio:1;display:block;height:12px;width:12px;@media all and (max-width:","px){height:8px;width:8px;}background:",";border:2px "," solid;border-radius:50%;}}"],a.BREAKPOINTS.sm,function(e){return"selectedIcon"===e.type||"targetIcon"===e.type||"checkIcon"===e.type?"16px":"8px"},function(e){return"selectedIcon"===e.type||"targetIcon"===e.type||"checkIcon"===e.type?"16px":"8px"},a.BREAKPOINTS.sm,function(e){return"selectedIcon"===e.type||"targetIcon"===e.type||"checkIcon"===e.type?"12px":"5px"},function(e){return"selectedIcon"===e.type||"targetIcon"===e.type||"checkIcon"===e.type?"12px":"5px"},function(e){var n="blue"===e.currentStatusColor?i.tokens.color_blue_500:"orange"===e.currentStatusColor?i.tokens.color_orange_400:i.tokens.color_pink_700;return"baseIcon"===e.type?i.tokens.color_white:"targetIcon"===e.type?n:"checkIcon"===e.type?i.tokens.color_green_600:"selectedIcon"===e.type?n:i.tokens.color_pink_700},function(e){return"baseIcon"===e.type&&{border:"2px ".concat(i.tokens.color_gray_400," solid")}},a.BREAKPOINTS.sm,function(e){var n="blue"===e.currentStatusColor?i.tokens.color_blue_500:"orange"===e.currentStatusColor?i.tokens.color_orange_400:i.tokens.color_pink_700;return"targetIcon"===e.type?n:"checkIcon"===e.type?i.tokens.color_green_600:"selectedIcon"===e.type?n:i.tokens.color_pink_700},i.tokens.color_white),n.StyledText=r.default.div.withConfig({componentId:"sc-1wlk8wp-5"})(["width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:5px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:",";max-width:","px;"," :focus{outline-offset:2px;}"],function(e){return"label"===e.type?i.tokens.color_gray_300:i.tokens.color_black},function(e){return e.maxWidth},function(e){return"selectedLabel"===e.type&&{"font-family":"".concat(o.typography.type.motiva_bold)}})},49414:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ErrorWrapper=n.ErrorText=void 0;
1var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626)),o=t(73357),i=t(98811);n.ErrorWrapper=r.default.div.withConfig({componentId:"sc-yw7kzd-0"})(["display:inline-flex;width:inherit;"]),n.ErrorText=r.default.div.withConfig({componentId:"sc-yw7kzd-1"})(["font-size:",";font-weight:300;color:",";margin-left:6px;margin-top:4px;line-height:16px;letter-spacing:0.43px;word-break:break-word;",""],function(e){return"sm"===e.size?"12px":"md"===e.size?"14px":"16px"},function(e){return i.tokens[e.color]||o.colors[e.color]},function(e){return e.customCSS?e.customCSS:""})},49940:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.Link=void 0;var o=c(t(25552)),i=c(t(95062)),a=s(t(14232)),l=t(98024);function s(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;return(s=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}function c(e){return e&&e.__esModule?e:{default:e}}(n.Link=(0,a.forwardRef)(function(e,n){var t=e.size,r=void 0===t?"md":t,i=e.href,s=e.ariaLabel,c=void 0===s?"":s,u=e.target,d=e.role,p=e.onClick,f=void 0===p?function(){}:p,m=e.color,h=e.underline,g=e.rel,y=e.disabled,v=void 0!==y&&y,x=e.focusable,b=e.id,j=e.customCSS,w=e.children,C=void 0===w?null:w,_=(0,a.useRef)(null),S={lg:24,md:20,sm:18}[r];return(0,a.useImperativeHandle)(n,function(){var e,n;return(null==(e=_.current)?void 0:e.querySelector("a"))||(null==(n=_.current)?void 0:n.querySelector("[aria-label]"))||_.current}),a.default.createElement(l.StyledLink,{"data-sui":!0,ref:_,size:r,color:void 0===m?"color_blue_500":m,underline:void 0!==h&&h,disabled:v,id:void 0===b?null:b,customCSS:void 0===j?null:j,style:{minHeight:"".concat(S,"px")}},v?a.default.createElement("div",{"aria-label":c},C):a.default.createElement(o.default,{href:void 0===i?null:i,"aria-label":c,role:void 0===d?"link":d,tabIndex:void 0===x||x?"0":"-1",onClick:f,target:void 0===u?"_self":u,onKeyPress:f,rel:void 0===g?null:g},C))})).propTypes={size:i.default.oneOf(["sm","md","lg"]),href:i.default.string,children:i.default.oneOfType([i.default.arrayOf(i.default.node),i.default.node,i.default.string]),ariaLabel:i.default.string,onClick:i.default.func,target:i.default.oneOf(["_blank","_self"]),role:i.default.oneOf(["link","button"]),color:i.default.oneOf(["color_blue_500","color_black","color_white","color_red_600"]),underline:i.default.bool,rel:i.default.string,disabled:i.default.bool,focusable:i.default.bool,id:i.default.string,customCSS:i.default.string}},52638:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.ProgressIndicator=f,n.default=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(t(95062)),i=c(t(14232)),a=t(53482),l=t(48738),s=["progressSteps","selectedStep","id","fontSize","customCSS","height","ver
1sion","currentStatusColor"];function c(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;return(c=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function d(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var p={1:{completedIcon:"completedIcon",selectedIcon:"selectedIcon",baseIcon:"baseIcon"},2:{completedIcon:"checkIcon",selectedIcon:"targetIcon",baseIcon:"baseIcon"}};function f(e){var n,t=e.progressSteps,r=void 0===t?[]:t,o=e.selectedStep,c=void 0===o?1:o,f=e.id,m=e.fontSize,h=void 0===m?"12px":m,g=e.customCSS,y=e.height,v=void 0===y?37:y,x=e.version,b=void 0===x?1:x,j=e.currentStatusColor,w=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,s),C=p[b]||p[1],_=C.selectedIcon,S=C.completedIcon,I=C.baseIcon,E=j||(2===b?"orange":"pink"),P=function(e){if(Array.isArray(e))return e}(n=(0,i.useState)("200px"))||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(n,2)||function(e,n){if(e){if("string"==typeof e)return d(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d(e,n):void 0}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),O=P[0],T=P[1],k=(0,i.useRef)(null);return(0,i.useLayoutEffect)(function(){if(k.current&&r.length>0){var e=k.current.clientWidth/r.length-20;T("".concat(e,"px"))}},[r]),i.default.createElement("div",u({ref:k},w,{"data-sui":!0}),i.default.createElement(l.StyledProgress,{id:void 0===f?"":f,customCSS:void 0===g?null:g,style:v?{height:"".concat(v,"px")}:{}},r.map(function(e,n){var t=n+1===c,o=n+1<c;return i.default.createElement(l.StyledStep,{key:n,fontSize:h,role:"progressbar","aria-current":t?"step":void 0,"aria-valuenow":n+1,"aria-valuemin":1,"aria-valuemax":r.length,"aria-label":"".concat(e,", step ").concat(n+1," of ").concat(r.length)},i.default.createElement(l.StyledLine,null,i.default.createElement(l.StyledSegment,u({className:"segment",version:b},0!==n&&(o||t)?{type:"complete"}:{})),i.default.createElement(l.StyledSegment,u({className:"segment",version:b},o?{type:"complete"}:{}))),i.default.createElement(l.StyledDot,{currentStatusColor:E,type:t?_:o?S:I},i.default.createElement("div",null,t?i.default.createElement("span",null):o&&"checkIcon"===S?i.default.createElement(a.Icon,{color:"white",size:32,name:"check"}):null)),i.default.createElement(l.StyledText,{type:t?"selectedLabel":o?"completedLabel":"label",maxWidth:O},e))})))}f.propTypes={progressSteps:o.default.arrayOf(o.default.string),selectedStep:function(e,n,t){var r=e[n];if(e.progressSteps&&0!==e.progressSteps.length&&(!Number.isInteger(r)||r<1||r>e.progressSteps.length+1))return Error("Invalid prop '".concat(n,"' supplied to '").concat(t,"'. It must be an integer between 1 and ").concat(e.progressSteps.length+1,"."))},customCSS:o.default.string,id:o.default.string,fontSize:o.default.string,height:o.default.number,version:o.default.oneOf([1,2]),currentStatusColor:o.default.oneOf([void 0,"pink","orange","blue"])},n.default=f},55562:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>m});var r=t(50513),o=t.n(r),i=t(8145),a=t.n(i);function l(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var l=Object.create((r&&r.prototype instanceof c?r:c).prototype);return s(l,"_invoke",function(t,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return i=n,l=0,s=e,p.n=t,a}};function f(t,r){for(l=t,s=r,n=0;!d&&c&&!o&&n<u.length;n++){var o,i=u[n],f=p.p,m=i[2];t>3?(o=m===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=t<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,p.n=m,l=0))}if(o||t>1)return a;throw d=!0,r}return function(o,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),l=u,s=m;(n=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");
1if(!n.done)return n;s=n.value,l<2&&(l=0)}else 1===l&&(n=i.return)&&n.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((n=(d=p.n<0)?s:t.call(r,p))!==a)break}catch(n){i=e,l=1,s=n}finally{c=1}}return{value:n,done:d}}}(t,o,i),!0),l}var a={};function c(){}function u(){}function d(){}n=Object.getPrototypeOf;var p=d.prototype=c.prototype=Object.create([][r]?n(n([][r]())):(s(n={},r,function(){return this}),n));function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return u.prototype=d,s(p,"constructor",d),s(d,"constructor",u),u.displayName="GeneratorFunction",s(d,o,"GeneratorFunction"),s(p),s(p,o,"Generator"),s(p,r,function(){return this}),s(p,"toString",function(){return"[object Generator]"}),(l=function(){return{w:i,m:f}})()}function s(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(s=function(e,n,t,r){function i(n,t){s(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))})(e,n,t,r)}function c(e,n,t,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(r,o)}function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach(function(n){var r,o,i;r=e,o=n,i=t[n],(o=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var p=Symbol.for("@euf/core/ClientContext.baseProxyUrl");class f{getUrl(e){return o()[p]+e}set(e){o()[p]=e}generateHeaders(e,n){var t={};return n&&(t["Content-Type"]="application/json"),d(d({},null==e?{}:e),t)}_fetch(e,n){var t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=d(d({},r),{},{headers:r.headers||{},withCredentials:null==(t=r.withCredentials)||t,method:e,url:n});return a().request(o).then(e=>(null==e?void 0:e.data)!==void 0?e.data:e).catch(e=>{throw e})}getJSON(e,n,t){return this.get(e,n,this.generateHeaders(t,!0))}putJSON(e,n,t){return this.put(e,n,this.generateHeaders(t,!0))}postJSON(e,n,t){return this.post(e,n,this.generateHeaders(t,!0))}get(e,n,t){var r=this.generateHeaders(t,!1);return this._fetch("GET",this.getUrl(e),{headers:r,params:n})}put(e,n,t){return this._fetch("PUT",this.getUrl(e),{headers:this.generateHeaders(t,!1),data:n})}post(e,n,t){return this._fetch("POST",this.getUrl(e),{headers:this.generateHeaders(t,!1),data:n})}request(){var e;return(e=l().m(function e(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l().w(function(e){for(;;)if(0===e.n)return(n=d({},t)).headers=n.headers||{},n.headers["Content-Type"]||(n.headers["Content-Type"]="application/json"),e.a(2,a()(n))},e)}),function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){c(i,r,o,a,l,"next",e)}function l(e){c(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}}let m=new f},61830:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnCheckedIcon=n.SecondIcon=n.LabelWrapper=n.Input=n.IconWrapper=n.IconGroup=n.CustomCheckBox=n.CheckBoxWrpper=void 0;var o=a(t(21626)),i=t(98811);function a(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;
1return(a=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}n.CheckBoxWrpper=o.default.div.withConfig({componentId:"sc-1nqal5c-0"})(["display:flex;margin:2px;flex-direction:row;align-items:center;"]),n.Input=o.default.input.withConfig({componentId:"sc-1nqal5c-1"})(["display:block;width:100%;max-width:100%;border:1px solid ",";padding:8px 10px;margin:3px 0;font-size:16px;line-height:1em;color:",";background:",";transition:border-color 0.5s;box-shadow:none;border-radius:3px;"],i.tokens.color_gray_100,i.tokens.color_gray_600,i.tokens.color_white),n.CustomCheckBox=o.default.div.withConfig({componentId:"sc-1nqal5c-2"})(["width:100%;display:flex;margin:2px;"," ",";"],function(e){return e.disabled&&{pointerEvents:"none"}},function(e){return e.customCSS?e.customCSS:""}),n.IconWrapper=o.default.div.withConfig({componentId:"sc-1nqal5c-3"})(["cursor:pointer;display:flex;align-items:center;justify-content:center;position:relative;height:28px;width:16px;z-index:1;min-width:16px;"]),n.LabelWrapper=o.default.div.withConfig({componentId:"sc-1nqal5c-4"})(["margin-top:auto;margin-bottom:auto;font-size:",";font-weight:400;padding:2px 0 0 10px;word-wrap:break-word;width:100%;color:",";position:relative;",";span{color:",";width:9px;height:8px;font-size:20px;letter-spacing:0;line-height:14px;position:absolute;background:none;left:1px;top:5px;}"],function(e){return"lg"===e.size?"16px":"14px"},function(e){return e.disabled?i.tokens.color_gray_400:"dark"===e.variant?i.tokens.color_white:i.tokens.color_black},function(e){return e.customLabelCSS&&(0,o.css)(["",""],e.customLabelCSS)},i.tokens.color_red_600),n.IconGroup=o.default.div.withConfig({componentId:"sc-1nqal5c-5"})(["display:inline-flex;position:relative;width:fit-content;> span{height:16px;width:16px;display:flex;}"]),n.SecondIcon=o.default.span.withConfig({componentId:"sc-1nqal5c-6"})(["position:absolute;top:0;left:0;"]),n.UnCheckedIcon=o.default.span.withConfig({componentId:"sc-1nqal5c-7"})(["height:16px;width:16px;background:",";display:flex;border-radius:4px;"],function(e){return e.disabled?i.tokens.color_gray_100:i.tokens.color_white})},62660:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ButtonWrapper=void 0,n.ButtonWrapper=(function(e){return e&&e.__esModule?e:{default:e}})(t(21626)).default.div.withConfig({componentId:"sc-1tlna7a-0"})(["display:flex;flex-direction:row;& > *{margin:5px;}",""],function(e){return e.customCSS?e.customCSS:""})},62909:e=>{e.exports=function(e){for(var n,t=[];!(n=e.next()).done;)t.push(n.value);return t}},67146:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>r});let r={"responsive-image":"ResponsiveImage-module__responsive-image"}},69558:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StyledWrapper=n.StyledNotificationBubble=n.StyledIconWrapper=n.StyledContent=n.StyledBtn=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626)),o=t(56477),i=t(73357),a=t(98811),l=t(88728),s=function(e){switch(e){case"success":return a.tokens.color_border_success;case"warning":return a.tokens.color_border_warning;case"failure":return a.tokens.color_border_danger;default:return a.tokens.color_border_info}},c=function(e){switch(e){case"success":return a.tokens.background_success;case"info":return a.tokens.color_blue_100;case"warning":return a.tokens.background_warning;case"failure":return a.tokens.background_danger;default:return a.tokens.background_primary}};n.StyledWrapper=r.default.div.withConfig({componentId:"sc-qyoigz-0"})([""," animation:"," 1s 1s ease-out forwards;"],function(e){return e.isAnimate&&{transition:"max-height 1s",overflow:"hidden"}},function(e){return e.isAnimate?o.fadeIn:"auto"}),n.StyledNotificationBubble=r.default.div.withConfig({componentId:"sc-qyoigz-1"})(["line-height:24px;color:",";border-radius:4px;padding:",";display:inline-flex;position:relative;border:",";border-left-width:12px;align-items:baseline;background-color:",";width:",";@media all and (max-width:","px){line-height:20px;padding:",";}",";"],function(e){return"failure"===e.variant&&e.noBorder?a.tokens.color_text_danger:a.tokens[e.color]||i.colors[e.color]},function(e){return"lg"===e.textSize?"15px 12px 15px 12px":"9px 12px 9px 12px"},function(e){return e.noBorder?"0":"1px solid ".concat(s(e.variant))},function(e){return e.noBorder?"":c(e.variant)},function(e){return e.maxWidth?"100%":""},l.BREAKPOINTS.sm,function(e){return"lg"===e.textSize?"17px 12px 17px 12px":"11px 12px 11px 12px"},function(e){return e.customCSS?e.customCSS:""}),n.StyledBtn=r.default.button.withConfig({componentId:"sc-qyoigz-2"})(["display:flex;align-items:center;height:20px;background:transparent;border:0;min-width:40px;padding-left:15px;margin-left:auto;cursor:pointer;"]),n.StyledIconWrapper=r.default.div.withConfig({componentId:"sc-qyoigz-3"})(["display:block;min-width:21px;"]),n.StyledContent=r.default.div.withConfig({componentId:"sc-qyoigz-4"})(["padding-left:12px;width:100%;font-size:",";@media all and (max-width:","px){font-size :14px;}"],function(e){return"md"===e.textSize?"14px":"16px"},l.BREAKPOINTS.sm)},70258:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StyledWrapper=void 0,n.StyledWrapper=(function(e){return e&&e.__esMo
1dule?e:{default:e}})(t(21626)).default.div.withConfig({componentId:"sc-zznepg-0"})(["position:relative;width:100%;padding:0 5px;"])},72806:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ResponsiveImageWrapper=void 0,n.ResponsiveImageWrapper=(function(e){return e&&e.__esModule?e:{default:e}})(t(21626)).default.div.withConfig({componentId:"sc-mstd0m-0"})(["width:100%;margin:0 auto;position:relative;img{display:block;width:100%;height:auto;transition:opacity 0.2s;}",";"],function(e){return e.customCSS?e.customCSS:""})},75705:(e,n,t)=>{"use strict";function r(e){var n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),e.getTime()-n.getTime()}t.d(n,{A:()=>r})},77450:(e,n,t)=>{var r=t(482),o=t(95318);e.exports=function(e,n){return null!=e&&o(e,n,r)}},79924:(e,n,t)=>{var r=t(95616),o=t(71747),i=t(47871);e.exports=function(e,n){var t={};return n=i(n,3),o(e,function(e,o,i){r(t,n(e,o,i),e)}),t}},82420:e=>{"use strict";function n(e){this._maxSize=e,this.clear()}n.prototype.clear=function(){this._size=0,this._values=Object.create(null)},n.prototype.get=function(e){return this._values[e]},n.prototype.set=function(e,n){return this._size>=this._maxSize&&this.clear(),!(e in this._values)&&this._size++,this._values[e]=n};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,o=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,l=new n(512),s=new n(512),c=new n(512);function u(e){return l.get(e)||l.set(e,d(e).map(function(e){return e.replace(a,"$2")}))}function d(e){return e.match(t)||[""]}function p(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}e.exports={Cache:n,split:d,normalizePath:u,setter:function(e){var n=u(e);return s.get(e)||s.set(e,function(e,t){for(var r=0,o=n.length,i=e;r<o-1;){var a=n[r];if("__proto__"===a||"constructor"===a||"prototype"===a)return e;i=i[n[r++]]}i[n[r]]=t})},getter:function(e,n){var t=u(e);return c.get(e)||c.set(e,function(e){for(var r=0,o=t.length;r<o;)if(null==e&&n)return;else e=e[t[r++]];return e})},join:function(e){return e.reduce(function(e,n){return e+(p(n)||r.test(n)?"["+n+"]":(e?".":"")+n)},"")},forEach:function(e,n,t){!function(e,n,t){var a,l,s,c,u=e.length;for(l=0;l<u;l++)(a=e[l])&&(function(e){return!p(e)&&(e.match(o)&&!e.match(r)||i.test(e))}(a)&&(a='"'+a+'"'),s=!(c=p(a))&&/^\d+$/.test(a),n.call(t,a,c,s,l,e))}(Array.isArray(e)?e:d(e),n,t)}}},84684:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StarsContainer=n.Square=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626));n.StarsContainer=r.default.div.withConfig({componentId:"sc-fpni1r-0"})(["display:grid;display:-ms-flexbox;gap:2px;grid-template-rows:1fr;grid-template-columns:repeat(5,1fr);"]),n.Square=r.default.div.withConfig({componentId:"sc-fpni1r-1"})(["height:","px;width:","px;background:linear-gradient( to right,"," );"],function(e){return e.size},function(e){return e.size},function(e){return"transparent 0%, transparent ".concat(e.percent,"%, ").concat(e.emptyStarBgColor," ").concat(e.percent,"%, ").concat(e.emptyStarBgColor," 100%")})},85414:(e,n,t)=>{"use strict";t.d(n,{A:()=>d});var r=t(14232),o=t(95062),i=t.n(o),a=t(2885),l=t(47085),s=t(39529),c=t(37876),u=e=>{var n=(0,r.useRef)(!1);if((0,r.useEffect)(()=>{(0,a.uV)(),(0,l.JV)()},[e.pageName,e.expandedPageName]),!n.current&&window&&window.newrelic){newrelic.pageGroup=e.pageName,newrelic.setCustomAttribute("pageGroup",e.pageName);var t=(e=>{for(var n=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(n))return o.substring(n.length,o.length)}return null})("MMXOS");newrelic.setCustomAttribute("MMXOS",t),(0,l.wl)("MMXOS",t),(0,l.wl)("pageGroup",e.pageName),n.current=!0}var o="if (window.newrelic) {\n newrelic.pageGroup = '".concat(e.pageName,"';\n newrelic.setCustomAttribute('pageGroup', '").concat(e.pageName,"');\n }");return(0,c.jsx)(s.A,{children:(0,c.jsx)("script",{dangerouslySetInnerHTML:{__html:o}})})};u.defaultProps={pageName:"",expandedPageName:""},u.propTypes={pageName:i().string,expandedPageName:i().string};let d=u}
1,90732:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.TextAreaWrapper=n.TextAreaLabel=n.TextAreaComp=n.CountTextBox=n.ButtonWrapper=n.Button=void 0;var o=l(t(21626)),i=t(64741),a=t(98811);function l(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;return(l=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}n.TextAreaWrapper=o.default.div.withConfig({componentId:"sc-1l2e012-0"})(["display:inline-block;flex-flow:column nowrap;align-items:flex-start;position:relative;max-width:100%;",""],function(e){return e.customCSS?e.customCSS:""}),n.CountTextBox=o.default.div.withConfig({componentId:"sc-1l2e012-1"})(["font-family:",";font-style:normal;font-weight:300;font-size:12px;line-height:12px;text-align:right;color:",";"],i.typography.type.motiva,a.tokens.color_text_primary),n.ButtonWrapper=o.default.div.withConfig({componentId:"sc-1l2e012-2"})(["position:absolute;right:",";top:3px;"],function(e){return e.rightPadding}),n.Button=o.default.button.withConfig({componentId:"sc-1l2e012-3"})(["border:0;background:transparent;cursor:pointer;padding:1px 8px;"]),n.TextAreaComp=o.default.textarea.withConfig({componentId:"sc-1l2e012-4"})(["height:68px;margin:0 0 3px;background:",";border:1px solid ",";max-width:100%;width:100%;color:",";font-size:16px;font-weight:300;letter-spacing:0;line-height:24px;border-radius:4px;padding-right:40px;display:flex;",";resize:none;&label && ","{background:linear-gradient( to bottom,transparent 0%,transparent 58%,"," 58%,"," 100% );}&::placeholder{color:",";}"," ",""],function(e){return e.disabled?a.tokens.color_gray_100:a.tokens.background_primary},a.tokens.color_gray_300,function(e){return e.disabled?a.tokens.color_gray_300:a.tokens.color_text_primary},function(e){return e.height&&"\n min-height: ".concat(e.height,"px;\n ")},function(e){return e.disabled},a.tokens.color_gray_100,a.tokens.color_gray_100,a.tokens.color_gray_300,function(e){return!e.disabled&&(0,o.css)(["&:hover{border:1px solid ",";}&:active,&:focus{border:2px solid ",";outline:none;}"],a.tokens.brand_staples_blue,a.tokens.brand_staples_blue)},function(e){return e.error&&(0,o.css)(["background:",";border:1px solid ",";"],a.tokens.background_primary,a.tokens.color_border_danger)}),n.TextAreaLabel=o.default.label.withConfig({componentId:"sc-1l2e012-5"})(["font-family:",";font-size:14px;line-height:14px;font-weight:300;position:absolute;top:-12px;z-index:99;padding:2px 4px;left:5px;text-transform:inherit;margin:0;background:transparent;color:",";&::after{position:absolute;content:'';width:100%;height:3px;transform:translate(-50%,-50%);left:50%;top:72%;background:",";z-index:-1;}span{color:",";width:9px;height:8px;font-size:20px;letter-spacing:0;line-height:14px;position:absolute;background:none;right:-5px;top:2px;}"],i.typography.type.motiva_light,function(e){return e.disabled?a.tokens.color_gray_300:a.tokens.color_text_primary},function(e){return(0,a.getLabelBGColors)(e.disabled,e.labelBGColor)},a.tokens.color_text_danger)},91251:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=s(t(95062)),o=l(t(14232)),i=t(86582),a=s(t(93587));function l(e,n){if("function"==typeof WeakMap)var t=new WeakMap,r=new WeakMap;return(l=function(e,n){if(!n&&e&&e.__esModule)return e;var o,i,a={__proto__:null,default:e};if(null===e||"object"!=c(e)&&"function"!=typeof e)return a;
1if(o=n?r:t){if(o.has(e))return o.get(e);o.set(e,a)}for(var l in e)"default"!==l&&({}).hasOwnProperty.call(e,l)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,l))&&(i.get||i.set)?o(a,l,i):a[l]=e[l]);return a})(e,n)}function s(e){return e&&e.__esModule?e:{default:e}}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function p(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach(function(n){f(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function f(e,n,t){var r;return(r=function(e,n){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=c(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(n,"string"),(n="symbol"==c(r)?r:r+"")in e)?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var m=function(e){var n=e.isVisible,t=e.item,r=void 0===t?"":t,i=e.srcMedia,a=e.config,l=void 0===a?{}:a,s=void 0!==n&&n?"srcSet":"data-srcset";return r?o.default.createElement("source",u({media:void 0===i?"":i},p(p(f({},s,r),l.width&&{width:l.width}),l.height&&{height:l.height}),{"data-sui":!0})):o.default.createElement("source",u({media:l.media},p(p(f({},s,l.srcset.join(", ")),l.width&&{width:l.width}),l.height&&{height:l.height}),{"data-sui":!0}))},h=function(e){var n=e.altText,t=e.defaultImageStyle,r=e.srcMedia,l=void 0===r?["(max-width: 500px)","(max-width: 800px)",""]:r,s=e.images,c=void 0===s?[]:s,u=e.lazyload,d=void 0===u||u,p=e.srcConfig,f=void 0===p?[]:p,h=e.imageClass,g=e.onImgLoad,y=(0,o.useRef)(null),v=(0,a.default)(),x=!d||v;return(0,o.useEffect)(function(){window.picturefill&&y.current&&window.picturefill({reevaluate:!0,elements:[y.current]})},[c,f]),o.default.createElement("picture",{"data-sui":!0},c.map(function(e,n){return o.default.createElement(m,{key:"picA".concat(n),isVisible:x,srcMedia:l[n],item:e})}),f.map(function(e,n){return o.default.createElement(m,{key:"picB".concat(n),isVisible:x,config:e})}),o.default.createElement(i.Image,{onImgLoad:void 0===g?null:g,ref:y,lazyload:d,src:c[c.length-1],imageClass:void 0===h?"":h,style:void 0===t?{aspectRatio:"",display:"block",width:"100%",height:"auto"}:t,altText:void 0===n?"":n,isInPictureTag:!0,parentLoaded:x}))};m.propTypes={item:r.default.string,srcMedia:r.default.string,config:r.default.object,isVisible:r.default.bool},h.propTypes={srcConfig:r.default.array,images:function(e,n){return e.images||e.srcConfig?(e.image&&r.default.checkPropTypes({images:r.default.array},e,"images","Picture"),e.srcConfig&&r.default.checkPropTypes({srcConfig:r.default.arrayOf(r.default.object)},e,"srcConfig","Picture"),null):Error("One of srcConfig or images is required by '".concat(n,"' component."))},lazyload:r.default.bool,srcMedia:r.default.array,imageClass:r.default.string,altText:r.default.string,defaultImageStyle:r.default.shape({aspectRatio:r.default.string,display:r.default.string,width:r.default.string,height:r.default.string}),onImgLoad:r.default.func},n.default=h},94279:e=>{function n(e,n){var t=e.length,r=Array(t),o={},i=t,a=function(e){for(var n=new Map,t=0,r=e.length;t<r;t++){var o=e[t];n.has(o[0])||n.set(o[0],new Set),n.has(o[1])||n.set(o[1],new Set),n.get(o[0]).add(o[1])}return n}(n),l=function(e){for(var n=new Map,t=0,r=e.length;t<r;t++)n.set(e[t],t);return n}(e);for(n.forEach(function(e){if(!l.has(e[0])||!l.has(e[1]))throw Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)o[i]||function e(n,i,s){if(s.has(n)){var c;try{c=", node was:"+JSON.stringify(n)}catch(e){c=""}throw Error("Cyclic dependency"+c)}if(!l.has(n))throw Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(n));if(!o[i]){o[i]=!0;var u=a.get(n)||new Set;if(i=(u=Array.from(u)).length){s.add(n);do{var d=u[--i];e(d,l.get(d),s)}while(i);s.delete(n)}r[--t]=n}}(e[i],i,new Set);return r}e.exports=function(e){return n(function(e){for(var n=new Set,t=0,r=e.length;t<r;t++){var o=e[t];n.add(o[0]),n.add(o[1])}return Array.from(n)}(e),e)},e.exports.array=n},95610:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.Radio=m;
1var o=function(e){return e&&e.__esModule?e:{default:e}}(t(95062)),i=u(t(14232)),a=t(44316),l=t(88728),s=t(14710),c=["selectedValue","size","ariaLabel","role","tabIndex","variant","options","onChange","id","customCSS","fontWeight","orientation"];function u(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;return(u=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function p(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;s=!1}else for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,n)||function(e,n){if(e){if("string"==typeof e)return f(e,n);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,n):void 0}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function m(e){var n=e.selectedValue,t=void 0===n?null:n,r=e.size,o=void 0===r?"lg":r,u=e.ariaLabel,f=void 0===u?"":u,m=e.role,h=void 0===m?"radio":m,g=e.tabIndex,y=void 0===g?0:g,v=e.variant,x=void 0===v?"light":v,b=e.options,j=e.onChange,w=void 0===j?null:j,C=e.id,_=e.customCSS,S=e.fontWeight,I=void 0===S?"normal":S,E=e.orientation,P=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,c),O=p((0,i.useState)(t),2),T=O[0],k=O[1],N=p((0,i.useState)(b),2),D=N[0],R=N[1],A=p((0,i.useState)(!1),2),M=A[0],F=A[1],z=[];(0,i.useEffect)(function(){k(t)},[t]),(0,i.useEffect)(function(){R(b)},[b]),(0,i.useEffect)(function(){F(D.some(function(e){return e.value===T||e.id===T}))},[D,T]);var L=function(e,n){(0,l.stopProp)(e);var t=D[n].value;k(D[n].value),R(D),w&&w(t,n)},B=function(e){z.push(e)},U=(0,a.useCustomKeypress)({itemList:D,clickHandler:L,optRef:z}).handleKeypressEvent;return i.default.createElement(s.RadioGroupWrapper,d({role:"radiogroup",id:void 0===C?"":C,customCSS:void 0===_?null:_,orientation:void 0===E?"vertical":E},P,{"data-sui":!0}),i.default.createElement(s.Input,{name:"Radio",value:null!=T?T:"",type:"hidden"}),D&&D.map(function(e,n){var t=T===e.value||T===e.id;return i.default.createElement(s.CustomRadio,d({onClick:function(e){return L(e,n)},onKeyDown:function(t){return U({e:t,index:n,isDisabled:e.disabled})}},e.disabled&&{"aria-disabled":!0},{id:e.id,tabIndex:null!=y?y:t||!M&&0===n?0:-1,disableOutline:-1===y,"aria-label":f,role:h,"aria-checked":t,disabled:e.disabled,key:e.id||n,ref:B}),i.default.createElement(s.RadioContentWrapper,{variant:x},i.default.createElement(s.RadioWrapper,null,i.default.createElement(s.RadioIcon,{selected:t,error:e.error,variant:x,disabled:e.disabled})),i.default.createElement(s.LabelWrapper,{size:o,disabled:e.disabled,variant:x,fontWeight:I},e.text)))}))}m.propTypes={selectedValue:o.default.oneOfType([o.default.string,o.default.number]),size:o.default.oneOf(["lg","sm"]),ariaLabel:o.default.string,role:o.default.string,tabIndex:o.default.number,variant:o.default.oneOf(["light","dark","gray"]),options:o.default.array.isRequired,onChange:o.default.func,customCSS:o.default.string,id:o.default.string,fontWeight:o.default.oneOf(["normal","lighter","bold"]),orientation:o.default.oneOf(["vertical","horizontal"])}},98024:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StyledLink=void 0;
1var r=function(e){return e&&e.__esModule?e:{default:e}}(t(21626)),o=t(73357),i=t(98811);n.StyledLink=r.default.div.withConfig({componentId:"sc-izol8d-0"})(["display:inline-block;"," letter-spacing:0;margin:0 6px;"," font-size:",";line-height:",";a,a:link,a:visited,a:active{color:",";text-decoration:",";&:hover{color:",";text-decoration:",";}}a:focus{outline:1px dashed ",";}a:focus:not(:focus-visible){outline:1px dashed ",";}",";"],function(e){return e.disabled?"":"cursor: pointer;"},function(e){return e.disabled?"color: ".concat(i.tokens.color_gray_500,";"):""},function(e){return"sm"===e.size?"12px":"md"===e.size?"14px":"16px"},function(e){return"sm"===e.size?"18px":"md"===e.size?"20px":"24px"},function(e){return i.tokens[e.color]||o.colors[e.color]},function(e){return e.underline?"underline":"none"},function(e){return i.tokens[e.color]||o.colors[e.color]},function(e){return e.underline?"none":"underline"},i.tokens.color_black,i.tokens.color_black,function(e){return e.customCSS?e.customCSS:""})},98730:(e,n,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.Rating=h;var o=function(e){return e&&e.__esModule?e:{default:e}}(t(95062)),i=p(t(14232)),a=t(88728),l=t(53482),s=t(78786),c=t(34246),u=t(35264),d=["rating","size","reviewCallback","showLabel","position","ratingTooltipContent","id","reviewAriaLabel","noOfReviews","customCSS","showCaret","tooltipMinWidth","reviewsText","reviewsURL","tabIndex","showPopover","emptyStarBgColor"];function p(e,n){if("function"==typeof WeakMap)var t=new WeakMap,o=new WeakMap;return(p=function(e,n){if(!n&&e&&e.__esModule)return e;var i,a,l={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return l;if(i=n?o:t){if(i.has(e))return i.get(e);i.set(e,l)}for(var s in e)"default"!==s&&({}).hasOwnProperty.call(e,s)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,s))&&(a.get||a.set)?i(l,s,a):l[s]=e[s]);return l})(e,n)}function f(){return(f=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(null,arguments)}function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function h(e){var n,t=e.rating,r=void 0===t?0:t,o=e.size,p=void 0===o?"md":o,h=e.reviewCallback,g=void 0===h?null:h,y=e.showLabel,v=void 0!==y&&y,x=e.position,b=e.ratingTooltipContent,j=void 0===b?null:b,w=e.id,C=void 0===w?"":w,_=e.reviewAriaLabel,S=void 0===_?"":_,I=e.noOfReviews,E=void 0===I?null:I,P=e.customCSS,O=e.showCaret,T=e.tooltipMinWidth,k=e.reviewsText,N=void 0===k?"":k,D=e.reviewsURL,R=void 0===D?"":D,A=e.tabIndex,M=e.showPopover,F=void 0===M||M,z=e.emptyStarBgColor,L=void 0===z?"white":z,B=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&({}).propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,d),U=function(e){if(Array.isArray(e))return e}(n=(0,i.useState)(!1))||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(n,2)||function(e,n){if(e){if("string"==typeof e)return m(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m(e,n):void 0}}
1(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),V=U[0],H=U[1],W="lg"===p?16:"md"===p?12:10,G=function(){return v&&i.default.createElement(c.StyledRatingLabel,f({size:p},B),r)},q=function(e){e&&("click"===e.type||"keydown"===e.type&&(0,a.getEventKey)(e)===a.CANON_TO_EVENT_KEY.enter)&&g&&g(e)},K="Rating ".concat(r," stars, ").concat(V?"expanded":"collapsed",", button, rating details"),J={lg:22,md:18,sm:16}[p];return i.default.createElement(c.RatingWrapper,f({id:C,customCSS:void 0===P?null:P,style:{height:"".concat(J,"px")},showPopover:F},B,{"data-sui":!0}),0===r?i.default.createElement(c.NoReviewsText,{size:p},"No reviews yet"):i.default.createElement(i.default.Fragment,null,j&&F?i.default.createElement(s.Popover,{position:void 0===x?"top":x,openModal:V,ariaLabel:"Rating tooltip: ".concat(r," stars"),id:"rating_popover_".concat(C),backgroundColor:"color_blue_500",minWidth:void 0===T?0:T,onHoverPopover:!0,triggerElement:i.default.createElement(c.RatingStarWrapper,{tabIndex:void 0===A?0:A,role:"button",onKeyDown:function(e){e&&("keydown"===e.type&&(0,a.getEventKey)(e)===a.CANON_TO_EVENT_KEY.enter||(0,a.getEventKey)(e)===a.CANON_TO_EVENT_KEY.space)&&H(!V)},"aria-label":K},i.default.createElement(G,null),i.default.createElement(u.Stars,{size:W,rating:r,emptyStarBgColor:L}),(void 0===O||O)&&i.default.createElement(c.RatingCaret,null,i.default.createElement(l.Icon,{name:"caret_down",size:12,color:"color_gray_400"})))},j):i.default.createElement(i.default.Fragment,null,i.default.createElement(G,null),i.default.createElement(u.Stars,{size:W,rating:r,emptyStarBgColor:L})),null!==E?i.default.createElement(function(){return i.default.createElement(c.StyledReviewCount,f({size:p,reviewCallback:g,noOfReviews:E,as:0!==E?"a":"div",role:g&&0!==E?"link":"text",tabIndex:g&&0!==E?"0":"-1","aria-label":S||"Link, ".concat(E," Reviews, Navigate to details")},R&&{href:R},g&&{onClick:q,onKeyDown:q},{"data-sui":!0}),E," ",N)},null):null))}h.propTypes={rating:function(e,n,t){if(e[n]<0||e[n]>5)return Error("Invalid prop `".concat(n,"` supplied to")+" `".concat(t,"`. Value must be between 0 and 5."))},size:o.default.oneOf(["lg","md","sm"]),reviewCallback:o.default.func,showLabel:o.default.bool,position:o.default.oneOf(["top","bottom","left","right"]),ratingTooltipContent:o.default.oneOfType([o.default.arrayOf(o.default.node),o.default.node,o.default.string]),id:o.default.string,reviewAriaLabel:o.default.string,noOfReviews:o.default.oneOfType([o.default.string,o.default.number]),tooltipMinWidth:o.default.number,customCSS:o.default.string,showCaret:o.default.bool,reviewsText:o.default.string,reviewsURL:o.default.string,tabIndex:o.default.number,showPopover:o.default.bool,emptyStarBgColor:o.default.string}},99922:(e,n,t)=>{"use strict";function r(e,n){if(n.length<e)throw TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+n.length+" present")}t.d(n,{A:()=>r})}}]);
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.