import{bc as g,aI as p,bg as h,p as y,ao as r,aF as S,L as k,v as f}from"./app-k0jcl5PQ.js";import{D as L}from"./BEA7dEaU.chunk.js";import{u as I}from"./CX-R8N_3.chunk.js";import{u as v,g as x}from"./C8ys3yUG.chunk.js";import"./Boh3c6zT.chunk.js";import"./q-a0Zpry.chunk.js";import"./BHfFK47N.chunk.js";import"./D-iHOjjO.chunk.js";import"./C5n0s02L.chunk.js";import"./CqF9ND51.chunk.js";import"./9ZqmMPFe.chunk.js";const A="sharev2.deleteShareLinkConfirmation",t=k.encloseNamespace(A);function R(e){const i=g(),[c,n]=p.useState(!1),{share:a,entity:o}=v({entityId:e.entityId,entityType:e.entityType}),{deleteShareLink:l}=I({entityId:e.entityId}),{log:d}=x({data:{entity:{id:e.entityId,type:e.entityType}},analyticsOptions:{location:y.Popup,eventVersion:h.V3}});function m(){var s;n(!0),l((s=a.data)==null?void 0:s.shareId).then(()=>{d({type:"delete-share-link",share:a.data}),n(!1),i.success(t("deleteSuccess")),e.closePopup(),e.returnAppLink&&f.trigger(e.returnAppLink)}).catch(()=>{i.error(t("deleteFailed",{name:o.data.name,escapeText:!0}))}).finally(()=>{n(!1)})}const u=!!a.data&&!!o.data;return r.jsx(S,{title:t("title"),closePopup:e.closePopup,showLoadingSpinner:!u||e.loading,animation:e.animate,children:r.jsx(L,{loading:c,phrases:{leadingSentence:t("intro"),bulletPoints:[t("loseAccessInfo"),t("loseAccessUsage")],acknowledgement:t("acknowledgement"),backButton:t("back"),deleteButton:t("delete")},onDelete:m,onBack:e.goToSettingsStep?e.goToSettingsStep:void 0})})}export{R as DeleteShareLinkConfirmationView};
//# sourceMappingURL=8I8u6UXQ.chunk.js.map
