1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`webapp@d21cada7bbed695928b108d9f05036e91b75a758`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`d4821910-7d26-41d0-9da3-4e61a6922664`,e._sentryDebugIdIdentifier=`sentry-dbid-d4821910-7d26-41d0-9da3-4e61a6922664`)})()}catch{}import{a as e,t}from"./rolldown-runtime-BuNlBr8y.js";import{A as n,B as r,C as i,D as a,F as o,Ft as s,Gt as c,Lt as l,M as u,O as d,Ot as f,S as p,T as m,Z as h,a as g,an as _,b as v,bt as y,et as b,g as x,ln as S,mt as C,p as w,st as T,w as E,x as D,z as O}from"./vue.runtime.esm-bundler-bT8iuKCP.js";import{Gn as k,Nn as A,c as j,d as M,l as N}from"./src-DDrIpH_T.js";import{t as P}from"./i18n-CzJYCgab.js";import{t as F}from"./_baseIteratee-DeOLA9sz.js";import{d as I}from"./analytics-2lyjWOyK.js";import{i as L,r as R}from"./text-QUDHXg2s.js";import{t as z}from"./en-Dan1xrEE.js";import{t as B}from"./DeleteConfirmForm-BBcQtXhR.js";var V=t(((e,t)=>{function n(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==void 0&&(n=n===void 0?a:n+a)}return n}t.exports=n})),H=t(((e,t)=>{var n=F(),r=V();function i(e,t){return e&&e.length?r(e,n(t,2)):0}t.exports=i}));o(),c(),y(),g();var U={class:`space-y-gap-large`},W={class:`space-y-gap-base`},G={class:`mt-6 flex w-full justify-end gap-gap-base`},K=n({inheritAttrs:!1,__name:`ConfirmDeleteDialog`,props:O({title:{},showArchiveOption:{type:Boolean},archiveLabel:{},cancelLabel:{},confirmDeleteLabel:{},confirmationText:{},isDeleting:{type:Boolean,default:void 0}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:O([`confirm`,`archive`,`cancel`,`dismiss`,`open`,`close`],[`update:open`]),setup(e,{expose:t,emit:n}){let{t:o}=P({fallback:Object.assign({"./translations/en.json":z}),loaders:Object.assign({})}),s=e,c=n,m=T(e,`open`),g=f(!1),y=f(!0),O=v(()=>s.confirmationText&&y.value),F=e=>{y.value=e},I=()=>{m.value=!0},L=()=>{m.value=!1},R=e=>{let t=m.value;t!==e&&(m.value=e,e?(y.value=!0,c(`open`),g.value=!1):(t&&!g.value&&c(`dismiss`),g.value=!1,c(`close`)))},V=()=>{O.value||(g.value=!0,c(`confirm`),s.isDeleting===void 0&&(L(),c(`close`)))},H=()=>{g.value=!0,c(`archive`),L(),c(`close`)},K=()=>{g.value=!0,c(`cancel`),L(),c(`close`)};return t({show:I,hide:L}),(t,n)=>(h(),p(l(N),{open:m.value,"onUpdate:open":R},{default:C(()=>[t.$slots.default?(h(),p(l(j),_(r({key:0},t.$attrs)),{default:C(()=>[b(t.$slots,`default`,_(u({popoverActive:m.value,"popover-active":m.value})))]),_:3},16)):i(``,!0),d(l(M),{title:e.title},{default:C(()=>[D(`div`,U,[e.isDeleting?(h(),p(l(k),{key:0},{default:C(()=>[a(S(l(o)(`deletingInProgress`)),1)]),_:1})):(h(),E(x,{key:1},[D(`div`,W,[b(t.$slots,`body`)]),b(t.$slots,`content`),e.confirmationText?(h(),p(B,{key:0,"confirmation-text":e.confirmationText,"has-button":!1,onKeyup:w(V,[`enter`]),onValidation:F},null,8,[`confirmation-text`])):i(``,!0),D(`div`,G,[e.showArchiveOption?(h(),p(l(A),{key:0,variant:`outline`,onClick:H},{default:C(()=>[a(S(e.archiveLabel??l(o)(`archive`)),1)]),_:1})):(h(),p(l(A),{key:1,variant:`outline`,onClick:K},{default:C(()=>[a(S(e.cancelLabel??l(o)(`common.actions.cancel`)),1)]),_:1})),d(l(A),{"data-e2e-id":`molecule-popover__confirm-entity-delete-button`,"is-disabled":O.value,variant:`destructive`,onClick:V},{default:C(()=>[a(S(e.confirmDeleteLabel??l(o)(`common.actions.delete`)),1)]),_:1},8,[`is-disabled`])])],64))])]),_:3},8,[`title`])]),_:3},8,[`open`]))}}),q=e(H(),1);o(),y();var J=(e,t,n)=>{let r=L(n,{singular:`journey`,plural:`journeys`});return t>1?`You're about to delete these ${R(e)} from your workspace. <strong>This action will permanently remove them from the ${r} that they're linked to.</strong><br><br>Consider archiving, instead of deleting to be able to relink in the future.`:`You're about to delete this ${e} from your workspace. <strong>This action will permanently remove it from the ${r} that it's linked to.</strong><br><br>Consider archiving, instead of deleting to be able to relink in the future.`};function Y(e){return`entityCount`in e&&`totalJourneyCount`in e}function X(e){return(0,q.default)(e,e=>e?.journeys||0)}var Z=e=>{let t=v(()=>{let t=s(e);return t?Y(t)?t.totalJourneyCount??0:t.journeyCount??0:0}),n=v(()=>(t.value??0)>0);return{journeyCount:t,hasLinkedEntities:n,shouldShowArchiveOption:v(()=>!!s(e)?.isArchivable),linkedEntityWarning:v(()=>{if(!n.value)return``;let r=s(e);if(!r)return``;let i=Y(r)?r.entityCount:1;return J(r.entityType,i,t.value??0)})}};o(),y(),c();var Q=[`innerHTML`],$={class:`font-semibold`},ee=[`innerHTML`],te=n({inheritAttrs:!1,__name:`DeleteEntityConfirmationDialog`,props:O({itemLabel:{},entityCount:{default:1},confirmDeleteText:{},confirmMessage:{},title:{},bulkTitle:{},entityDeleteInfo:{},shiftToEndOfBody:{type:Boolean,default:!0},confirmationText:{},isDeleting:{type:Boolean,default:void 0}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:O([`confirm`,`archive`,`open`,`close`],[`update:open`]),setup(e,{expose:t,emit:n}){let{t:o}=P({fallback:Object.assign({"./translations/en.json":z}),loaders:Object.assign({})}),s=(e,t)=>`Deleting ${t>1?R(e.toLowerCase()):e.toLowerCase()}`,c=(e,t)=>{let n=e.toLowerCase();return`You're about to delete ${t>1?`these ${R(n)}`:`this ${n}`} from your workspace.`},d=(e,t)=>{let n=e.toLowerCase();return`You can archive ${t>1?`these items`:`this ${n}`} instead to preserve ${t>1?`their`:`its`} connections while removing ${t>1?`them`:`it`} from active use.`},f=e,g=n,y=T(e,`open`),{hasLinkedEntities:x,shouldShowArchiveOption:w,linkedEntityWarning:E,journeyCount:O}=Z(()=>f.entityDeleteInfo),A=v(()=>
1f.title||f.bulkTitle||s(f.itemLabel,f.entityCount)),j=v(()=>w.value?o(`deleteForever`):f.confirmDeleteText??o(`confirmDeleteEverywhere`)),M=()=>f.entityDeleteInfo?.entityType||f.itemLabel.toLowerCase()||`unknown`,N=()=>({entityType:M(),entityCount:f.entityCount,hasLinkedJourneys:x.value,linkedJourneyCount:O.value>0?O.value:void 0}),F=()=>{I(`Delete Dialog Triggered`,{...N(),isArchivable:w.value}),g(`open`)},L=()=>{I(`Delete Dialog Delete Button Clicked`,N()),g(`confirm`)},B=()=>{I(`Delete Dialog Archive Button Clicked`,N()),g(`archive`)},V=()=>{I(`Delete Dialog Dismissed`,{entityType:M(),entityCount:f.entityCount,dismissalMethod:`cancel_button`})},H=()=>{I(`Delete Dialog Dismissed`,{entityType:M(),entityCount:f.entityCount,dismissalMethod:`outside_click`})};return t({show:()=>{y.value=!0},hide:()=>{y.value=!1}}),(t,n)=>(h(),p(K,r(t.$attrs,{open:y.value,"onUpdate:open":n[0]||=e=>y.value=e,"archive-label":l(o)(`archiveEverywhere`),"confirm-delete-label":j.value,"confirmation-text":e.confirmationText,"is-deleting":e.isDeleting,"show-archive-option":l(w),title:A.value,onArchive:B,onCancel:V,onClose:n[1]||=()=>g(`close`),onConfirm:L,onDismiss:H,onOpen:F}),m({body:C(()=>[e.confirmMessage&&!l(x)?(h(),p(l(k),{key:0},{default:C(()=>[D(`span`,{innerHTML:e.confirmMessage},null,8,Q)]),_:1})):l(x)?i(``,!0):(h(),p(l(k),{key:1},{default:C(()=>[a(S(c(e.itemLabel,e.entityCount))+` `,1),D(`span`,$,S(l(o)(`permanentRemovalWarning`,{count:e.entityCount})),1)]),_:1})),l(x)?(h(),p(l(k),{key:2,class:`text-orange-600`},{default:C(()=>[D(`span`,{innerHTML:l(E)},null,8,ee)]),_:1})):i(``,!0),l(w)&&!l(x)?(h(),p(l(k),{key:3},{default:C(()=>[a(S(d(e.itemLabel,e.entityCount)),1)]),_:1})):i(``,!0),!l(w)&&!e.confirmMessage?(h(),p(l(k),{key:4},{default:C(()=>[a(S(l(o)(`confirmProceed`)),1)]),_:1})):i(``,!0)]),content:C(()=>[b(t.$slots,`content`)]),_:2},[t.$slots.default?{name:`default`,fn:C(e=>[b(t.$slots,`default`,_(u(e)))]),key:`0`}:void 0]),1040,[`open`,`archive-label`,`confirm-delete-label`,`confirmation-text`,`is-deleting`,`show-archive-option`,`title`]))}});export{V as i,X as n,H as r,te as t}; 2//# sourceMappingURL=confirmation-B56dUNcD.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.