1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="164be4fc-0768-535e-816b-7e9f89619e9d")}catch(e){}}(); 3import{a as d,c as y,j as e,i as c,r as f}from"./vendor-DUCtYsFH.js";import{H as j}from"./hostPublicStatus-BCqn6-N7.js";import{bh as x,e as b,a7 as w,M as k,w as S,bn as R,a2 as P,L as F}from"./index-BjDcYlu5.js";import{u as T}from"./useHostStatus-Bjf1d4Rt.js";import"./vendor-capacitor-DDW69Cdi.js";import{A as O}from"./index-fhjguOjk.js";import{B as V}from"./BoltIcon-Beeyrdsc.js";import{S as I}from"./HostHome-BybDZcuY.js";import{S as A,H}from"./index-CnzweDMc.js";import{S as W}from"./index-DQ75nx8E.js";import"./vendor-sentry-C0-CjQzI.js";import"./index-Cuq78-CF.js";import"./index-r5k0_4Vg.js";import"./index-B2bka-ZM.js";import"./LoadingOverlay-DVhvMUrm.js";import"./useActionsRequired-CQxbPFbB.js";import"./eventTypePerDay-BRxOKCTC.js";import"./agendaEventFilters-BJK1qAZ3.js";import"./EventsClient-CwiL45VJ.js";import"./constants-Dy7g3Xmn.js";import"./index-CPqcVyye.js";import"./index-CmJhNIyV.js";import"./StopWatchIcon-_hvYDNfl.js";import"./ExternalLink-De46ECXs.js";import"./openExternalLink-CMqRRxaA.js";import"./ChevronIcon-CTnp7O5t.js";import"./duoTone.module-DxF0z6vF.js";import"./outlined.module-C1og58_C.js";import"./useGroupSize-BqS1_3CP.js";import"./departureTitleLabel-C24YtGwf.js";import"./departureLifecycle-BM0XI3-z.js";import"./index-DFgdAoqO.js";import"./PersonOutlineIcon-CR7cQGMN.js";import"./scheduleItem-BZdF1uSS.js";import"./usePersonalizedOfferRequest-Bo-rQLu6.js";import"./personalizedOfferRequests-Yh7_L55U.js";import"./usePersonalisedOffer-CAqlvEWX.js";import"./StarIcon-Dnqwozzs.js";import"./useViewport-CfMiBDuZ.js";import"./useWindowSize-aZXk4KRw.js";import"./useRafState-BOx0TNe4.js";import"./index-5upoSYsy.js";import"./index-CFH8oT0h.js";import"./Top-CCTEnFNi.js";import"./FamilyIcon-TuHWYDGE.js";import"./CalendarIcon-BgGAcOeE.js";import"./CancelBookingIcon-BCL_776Y.js";import"./MoneyBagIcon-C1qdVq0N.js";import"./TextBubbleWithStarIcon-MeMOc8EI.js";import"./formatPrice-DgBcPM0D.js";import"./index-CI9mB83T.js";import"./useScroll-D2kruZl2.js";import"./useNavButtonsDisabled-Ckl-C8Fx.js";import"./useExperienceChangelog-DZol4LSN.js";import"./index-CGJDW0BG.js";import"./date-Czb5BGFu.js";import"./index-DaG8Vjev.js";import"./index-DcUUdxNV.js";import"./BadgeWithStarIcon-SV9TgQLQ.js";import"./useHostLocation-CrH9ZInz.js";import"./index-BWgOtdxw.js";import"./index-D4MUTjfA.js";import"./departureLanguage-Dyxv9TTr.js";import"./parseTripDate-DkT8uxbn.js";import"./AnchorButton-PHN-GWWS.js";import"./NotificationBellSnoozedIcon-D48woF3P.js";import"./PersonWithSparkleIcon-CPBgfHD6.js";import"./useConsumeSearchParamFlag-DqjwhQkX.js";import"./useSearchParams-DY81TN9Y.js";import"./PersonWithExclamationMarkIcon-CuB9IFuj.js";import"./CalendarIcon-CPaCeOyL.js";import"./TextBubbleWithStarIcon-BHPq5g6m.js";import"./index-DcCDFVlL.js";import"./AppUpdateBanner-BnuIKgCx.js";import"./DeviceWithExclamationMarkIcon-D278Z8Yf.js";import"./index-xV-g6FJW.js";import"./useSafeAreaBackground-Boa33Leb.js";function _({actions:n,onBackToDashboard:s}){const{t:o}=d(),i=y({mutationFn:async()=>{await n.setHostStatus({status:{type:w.ACTIVE}}),await k(S.getState(),{silent:!0})},onSuccess:()=>s(),onError:a=>{var l;const r=((l=a==null?void 0:a.responseJson)==null?void 0:l.message)||o("host-status.failedToSwitchOnline",{defaultValue:"Failed to switch your profile online, please try again."});x({text:r,variant:"error"}),b.error("Failed to go back online",a)}});return e.jsx(O,{testId:"host-status-confirmed-dialog",title:o("host.yourProfileIsNowOffline",{defaultValue:"Your profile is now offline"}),text:o("host.youWillNotAbleToReceiveNewBookingsAndYou",{defaultValue:"You will not able to receive new bookings and you will not be visible on the platform."}),icon:{children:e.jsx(V,{variant:"error"}),variant:"red"},actions:[{key:"backToDashboard",children:o("host-status.backToDashboard",{defaultValue:"Back to dashboard"}),onClick:s},{key:"switchOnline",children:o("host-status.switchMyProfileBackOnline",{defaultValue:"Switch my profile back online"}),onClick:()=>i.mutate(),action:"secondary",disabled:i.isPending}],onClose:s,hideClose:!1,closeOnOverlayClick:!0})}function B({actions:n,onComplete:s,onCancel:o}){const{t:i}=d(),a=y({mutationFn:async()=>{await n.setHostStatus({status:{type:w.ACTIVE}}),await k(S.getState(),{silent:!0})},onSuccess:()=>s(),onError:r=>{var u;
3const l=((u=r==null?void 0:r.responseJson)==null?void 0:u.message)||i("host-status.failedToSwitchOnline",{defaultValue:"Failed to switch your profile online, please try again."});x({text:l,variant:"error"}),b.error("Failed to go online",r)}});return e.jsx(O,{testId:"host-status-dialog",title:i("host.wantToStartAgain",{defaultValue:"Want to start again?"}),text:i("host.yourAgendaWillBeOpenedYourProfileWillBeV",{defaultValue:"Your agenda will be opened, your profile will be visible and you can receive new chats."}),icon:{children:e.jsx(I,{variant:"bright-green"}),variant:"green"},actions:[{key:"switchOnline",children:i("host-status.yesSwitchMyProfileOnline",{defaultValue:"Yes, switch my profile online"}),onClick:()=>a.mutate(),disabled:a.isPending},{key:"keepOffline",children:i("host-status.noKeepMyProfileOffline",{defaultValue:"No, keep my profile offline"}),onClick:o,action:"secondary"}],onClose:o,hideClose:!1,closeOnOverlayClick:!0})}const v=()=>[{name:c.t("HostPage.offlineReason.otherJob",{defaultValue:"I have another job or time commitment"}),value:"other-job-or-time-commitment"},{name:c.t("HostPage.offlineReason.parentalLeave",{defaultValue:"I'm on parental leave"}),value:"parental-leave"},{name:c.t("HostPage.offlineReason.longBreak",{defaultValue:"I'm taking a break of more than 90 days"}),value:"break-more-than-90-days"},{name:c.t("HostPage.offlineReason.notEnoughBookings",{defaultValue:"I'm not getting enough bookings on Withlocals"}),value:"not-enough-bookings"},{name:c.t("HostPage.offlineReason.notRightFit",{defaultValue:"Withlocals isn't the right fit for me"}),value:"not-the-right-fit"},{name:c.t("HostPage.offlineReason.negativeExperience",{defaultValue:"I had a negative experience on Withlocals"}),value:"negative-experience"}],L="_Text_usc5x_1",M="_Flex_usc5x_10",N="_RadioLabel_usc5x_15",E="_LabelWrapper_usc5x_24",p={Text:L,Flex:M,RadioLabel:N,LabelWrapper:E},Y=()=>[...v(),{name:c.t("common.other",{defaultValue:"Other"}),value:"other"}],D=({onChange:n,initialReason:s})=>{const{t:o}=d(),i=Y(),[a,r]=f.useState(s),[l,u]=f.useState(),m=t=>{u(t),n(t)},h=t=>{r(t),t==="other"?m(""):n(t)};return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:p.Text,children:o("HostPage.offlinePrompt",{defaultValue:"Please tell us why you are putting your Withlocals profile offline."})}),e.jsx("div",{className:p.Flex,children:e.jsxs(A,{children:[i.map(({value:t,name:g})=>e.jsxs("label",{className:p.RadioLabel,htmlFor:t,children:[e.jsx(R,{id:t,checked:a===t,value:t,name:t,onClick:()=>h(t),required:!0}),e.jsx("div",{className:p.LabelWrapper,children:g},`reason-label-${t}`)]},`reason-label-${t}`)),a==="other"&&e.jsx("textarea",{className:p.TextArea,placeholder:o("common.pleaseSpecify",{defaultValue:"Please specify"}),value:l,onChange:t=>{m(t.target.value)}})]})})]})};function J({actions:n,onComplete:s,onClose:o}){const{t:i}=d(),[a,r]=f.useState(v()[0].value),[l,u]=f.useState(!1),m=y({mutationFn:async()=>{await n.setHostStatus({status:{type:w.OUT_OF_OFFICE},reason:a}),await k(S.getState(),{silent:!0})},onSuccess:()=>s(),onError:t=>{var C;const g=((C=t==null?void 0:t.responseJson)==null?void 0:C.message)||"Failed to switch your profile offline, please try again.";x({text:g,variant:"error"}),b.error("Failed to go offline",t)}}),h=f.useMemo(()=>l&&a&&!m.isPending,[l,a,m.isPending]);return e.jsxs(W,{testId:"go-offline-sheet",title:i("host.goOffline",{defaultValue:"Go offline"}),onClose:o,showClose:!1,children:[e.jsx(D,{onChange:r,initialReason:a}),e.jsx(H,{text:i("host.iAcknowledgeThatIAmResponsibleForFulfill",{defaultValue:"I acknowledge that I am responsible for fulfilling upcoming bookings & maintaining communication with guests."}),buttonText:i("host.switchMyProfileOffline",{defaultValue:"Switch my profile offline"}),onChange:u,onButtonClick:()=>m.mutate(),buttonDisabled:!h,testIdPrefix:"go-offline"})]})}function G({onConfirm:n,onCancel:s}){const{t:o}=d();return e.jsx(O,{testId:"host-status-dialog",title:o("host.switchingOffline",{defaultValue:"Switching offline?"}),text:o("host.youWontReceiveNewBookingsAndYourProfileW",{defaultValue:"You won't receive new bookings and your profile will be hidden from the platform. Are you sure you want to switch offline temporarily?"}),icon:{children:e.jsx(V,{variant:"error"}),variant:"red"},actions:[{key:"switchOffline",children:o("host-status.yesSwitchMyProfileOffline",{defaultValue:"Yes, switch my profile offline"}),onClick:n,action:"danger"},{key:"cancel",children:o("host-status.noTakeMeBack",{defaultValue:"No, take me back"}),onClick:s,action:"secondary"}],onClose:s,hideClose:!1,closeOnOverlayClick:!0})}function ht({onClose:n}){const{actions:s}=T(),{loading:o,account:i}=P(),a=(i==null?void 0:i.hostPublicStatus)===j.Offline,[r,l]=f.useState(a?"go-online":"warning");if(o)return e.jsx(F,{});switch(r){case"select-reason":return e.jsx(J,{actions:s,onComplete:()=>l("confirmed"),onClose:n});case"confirmed":return e.jsx(_,{actions:s,onBackToDashboard:n});case"go-online":return e.jsx(B,{actions:s,onComplete:n,onCancel:n});default:return e.jsx(G,{onConfirm:()=>l("select-reason"),onCancel:n})}}export{ht as default}; 4//# sourceMappingURL=HostStatusFlow-_TN3c6M-.js.map 5 6//# debugId=164be4fc-0768-535e-816b-7e9f89619e9d
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.