1import{jsxRuntimeExports as e,reactExports as i}from"./react-core-chunk-B2r03cU8.js";import{connect as R}from"./redux-core-chunk-DgWMjMkF.js";import{Box_default as n,Button_default as j,Text_default as l,useTrackUxHandler as y,Pill_default as O,Icon_default as B,getCurrentCompanyLocations as G,selectEmployeeCapLimit as M,getCurrentLocationId as V,getCurrentLocationName as U,removeLocations as $,actions$3 as z,withUxRoot as F,showGlobalLoader as H,changeCurrentLocation as K,hideGlobalLoader as b,actions$2 as w,refreshPage as W,BottomDrawer as Y,cxHelpers as Z}from"./app-init-chunk-kk_CZVyp.js";import{toI18n as t}from"./tracking-chunk-Cdw_Cfie.js";import{TRACK_ACTION_TYPES as T,EVENT_ACTIONS as I,EVENT_CATEGORIES as q,PRODUCT_AREAS as J}from"./app-bundle-B0YfsjKz.js";import{LocationMap as Q}from"./LocationMap-chunk-tOOhNfbU.js";import{ContactInformation as X}from"./ContactInformation-chunk-BEi3iAVT.js";try{(function(){var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new r.Error().stack;o&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[o]="0d02e1ae-2fae-4138-b2c8-21cee64c680a",r._sentryDebugIdIdentifier="sentry-dbid-0d02e1ae-2fae-4138-b2c8-21cee64c680a")})()}catch{}const ee=({primaryText:r,onClickPrimary:o,secondaryText:c,onClickSecondary:s,primaryDisabled:m})=>e.jsxs(n,{hright:!0,vcenter:!0,bgcolor:"mono0",pt:20,pr:24,pb:40,row:!0,gap:16,children:[c&&e.jsx(j,{onClick:s,variant:"secondary",uxElement:c,children:c}),r&&e.jsx(j,{disabled:m,onClick:o,variant:"primaryDestructive",uxElement:r,children:r})]}),re=({currentLocationName:r})=>e.jsxs(n,{column:!0,vcenter:!0,w:560,bgcolor:"mono0",p:40,bradiusm:!0,children:[e.jsx(n,{p:24,children:e.jsx(l,{variant:"heading2",color:"mono900",children:t("enforcement_drawer.location_archival_confirmation_message",{props:{currentLocationName:r}})})}),e.jsx(n,{p:24,children:e.jsx(l,{color:"mono900",children:t("enforcement_drawer.location_archival_confirmation_description")})})]}),oe=({cxEl:r,currentLocationName:o,employeeCapLimit:c})=>{const s={view_name:"enforcement_drawer"},m=y(I.PAGE_VIEWED,T.VIEW,s);return i.useEffect(()=>{m()},[]),e.jsx(n,{w:560,bgcolor:"mono0",p:40,className:r("offer-discount"),bradiusm:!0,children:e.jsxs(n,{w:520,children:[e.jsxs(n,{row:!0,children:[e.jsx(Q,{className:r("cups-coffee-sizes"),w:140}),e.jsxs(n,{ml:12,vcenter:!0,column:!0,gap:8,w:330,children:[e.jsx(O,{variant:"info",children:t("enforcement_drawer.pill")}),e.jsx(l,{variant:"heading2",color:"mono900",children:t("enforcement_drawer.new_title",{props:{employee_count:c}})})]})]}),e.jsx("hr",{}),e.jsx(n,{mt:24,mb:24,children:e.jsx(l,{variant:"bodyBold",color:"mono900",children:t("enforcement_drawer.new_subtitle",{props:{employee_count:c}})})}),e.jsxs(n,{row:!0,vcenter:!0,mt:24,children:[e.jsx(B,{iconName:"Location",size:"small",mr:8}),e.jsx(l,{children:o})]}),e.jsx(n,{row:!0,vcenter:!0,mt:24,children:e.jsx(l,{children:t("enforcement_drawer.remove_location_message")})}),e.jsx(n,{row:!0,vcenter:!0,mt:24,children:e.jsx(l,{children:t("enforcement_drawer.need_support_message")})}),e.jsx(X,{})]})})},{cx:ne,cxEl:te}=Z("EnforcementBottomDrawer"),ae=({animations:r,removeBottomDrawer:o,currentLocationName:c,currentLocationId:s,employeeCapLimit:m,companyLocations:h,onRemoveLocations:x,dispatch:d})=>{const[a,g]=i.useState(0),[u,_]=i.useState(!1),[L,C]=i.useState(!1);i.useEffect(()=>{_(!1)},[a]);const v=y(I.ENFORCEMENT_STAY_ON_PLAN_CLICKED,T.CLICK,{view_name:"enforcement_drawer"}),E=i.useMemo(()=>async()=>{const p=h.filter(f=>f?.get("id")!==s);if(p.size>0){const S=p.first().get("id");try{H(),await d(K(S)),b()}catch{b(),d(w.openGlobalToast({content:t("enforcement_drawer.location_archival_error_message"),toastProps:{variant:"error"}}))}}else{const f=new URL(window.location.href);f.searchParams.delete("current_location_id"),window.history.replaceState({},"",f),W()}},[h,s,d]),N=i.useCallback(async()=>{if(!u){if(a===0)_(!0),g(1);else if(a===1){C(!0);try{await x({locations:[{id:s}]}),d(w.openGlobalToast({content:t("enforcement_drawer.location_removed_toast_message"),toastProps:{variant:"success"}})),o(),await E()}catch{C(!1),d(w.openGlobalToast({content:t("enforcement_drawer.location_archival_error_message"),toastProps:{variant:"error"}}))}}}},[a,o,u,d,s,x,E]),k=i.useCallback(()=>{u||(a===1?(_(!0),g(0)):(v(),o()))},[v,o,a,u]),A=t("enforcement_drawer.remove_location"),P=()=>a===1?t("enforcement_drawer.back"):t("enforcement_drawer.keep_location"),D=()=>a===0?"enforcement_drawer.new_header_title":"enforcement_drawer.confirm_location_archival";return e.jsx(Y,{animations:r,top:40,headerTitle:D(),footerComponent:ee,footerComponentProps:{primaryText:A,secondaryText:P(),onClickPrimary:N,onClickSecondary:k,primaryDisabled:L},children:()=>e.jsxs(n,{hcenter:!0,pt:40,className:ne(),children:[a===0&&e.jsx(oe,{cxEl:te,currentLocationName:c,employeeCapLimit:m}),a===1&&e.jsx(re,{currentLocationName:c})]})})},_e=R(r=>({currentLocationName:U(r),currentLocationId:V(r),employeeCapLimit:M(r),companyLocations:G(r)}),r=>({dispatch:r,removeBottomDrawer:()=>r(z.removeBottomDrawer()),onRemoveLocations:o=>r($(o))}))(F({productArea:J.MONETIZATION,eventCategory:q.ENFORCEMENT_DRAWER})(ae));export{_e as default}; 2//# sourceMappingURL=index-chunk-BWM7xWWK.js.map
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.