import{N as h,a as N}from"./NcModal-kwRcir5Z.chunk.mjs";import{u as w}from"./video-B2Zidy_E.chunk.mjs";import{d as L,m as u,i}from"./dav-D-0Zsvk_.chunk.mjs";import{G as B}from"./GenRandomId-F5ebeBB_-DI-yuh7g.chunk.mjs";import{n as T}from"./index-VDTWCae_.chunk.mjs";const q=L({name:"NcDialog",components:{NcDialogButton:N,NcModal:h},props:{name:{type:String,required:!0},message:{type:String,default:""},additionalTrapElements:{type:Array,validator:a=>Array.isArray(a)&&a.every(t=>typeof t=="string"||t instanceof HTMLElement),default:()=>[]},container:{type:String,required:!1,default:"body"},open:{type:Boolean,default:!0},size:{type:String,required:!1,default:"small",validator:a=>typeof a=="string"&&["small","normal","large","full"].includes(a)},buttons:{type:Array,required:!1,default:()=>[],validator:a=>Array.isArray(a)&&a.every(t=>typeof t=="object")},noClose:{type:Boolean,default:!1},canClose:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!1},isForm:{type:Boolean,default:!1},outTransition:{type:Boolean,default:!1},navigationClasses:{type:[String,Array,Object],required:!1,default:""},navigationAriaLabel:{type:String,required:!1,default:""},navigationAriaLabelledby:{type:String,required:!1,default:""},contentClasses:{type:[String,Array,Object],required:!1,default:""},dialogClasses:{type:[String,Array,Object],required:!1,default:""}},emits:["closing","update:open","submit"],setup(a,{emit:t,slots:o}){const l=u(),{width:p}=w(l,{width:900}),n=i(()=>p.value<876),c=i(()=>o?.navigation!==void 0),s=B(),f=i(()=>a.navigationAriaLabel||void 0),y=i(()=>{if(!a.navigationAriaLabel)return a.navigationAriaLabelledby||s}),g=u(),r=i(()=>a.isForm&&!c.value?"form":"div"),b=i(()=>r.value==="form"?{submit(e){e.preventDefault(),t("submit",e)},reset(e){e.preventDefault(),t("reset",e)}}:{}),d=u(!0);function C(e,A){(e.type==="submit"||e.nativeType==="submit")&&r.value==="form"&&!g.value.reportValidity()||(v(A),window.setTimeout(()=>m(),300))}function v(e){d.value=!1,t("closing",e)}function m(){d.value=!0,t("update:open",!1)}const _=i(()=>({noClose:a.noClose||!a.canClose,container:a.container===void 0?"body":a.container,labelId:s,size:a.size,show:a.open&&d.value,outTransition:a.outTransition,closeOnClickOutside:a.closeOnClickOutside,additionalTrapElements:a.additionalTrapElements}));return{dialogElement:g,dialogListeners:b,dialogTagName:r,handleButtonClose:C,handleClosing:v,handleClosed:m,hasNavigation:c,navigationId:s,navigationAriaLabelAttr:f,navigationAriaLabelledbyAttr:y,isNavigationCollapsed:n,modalProps:_,wrapper:l}}});var O=function(){var a=this,t=a._self._c;return a._self._setupProxy,a.open?t("NcModal",a._b({staticClass:"dialog__modal",attrs:{"enable-slideshow":!1,"enable-swipe":!1},on:{close:a.handleClosed,"update:show":function(o){return a.handleClosing()}}},"NcModal",a.modalProps,!1),[t("h2",{staticClass:"dialog__name",attrs:{id:a.navigationId},domProps:{textContent:a._s(a.name)}}),t(a.dialogTagName,a._g({ref:"dialogElement",tag:"component",staticClass:"dialog",class:a.dialogClasses},a.dialogListeners),[t("div",{ref:"wrapper",staticClass:"dialog__wrapper",class:{"dialog__wrapper--collapsed":a.isNavigationCollapsed}},[a.hasNavigation?t("nav",{staticClass:"dialog__navigation",class:a.navigationClasses,attrs:{"aria-label":a.navigationAriaLabelAttr,"aria-labelledby":a.navigationAriaLabelledbyAttr}},[a._t("navigation",null,{isCollapsed:a.isNavigationCollapsed})],2):a._e(),t("div",{staticClass:"dialog__content",class:a.contentClasses},[a._t("default",function(){return[t("p",{staticClass:"dialog__text"},[a._v(" "+a._s(a.message)+" ")])]})],2)]),t("div",{staticClass:"dialog__actions"},[a._t("actions",function(){return a._l(a.buttons,function(o,l){return t("NcDialogButton",a._b({key:l,on:{click:(p,n)=>a.handleButtonClose(o,n)}},"NcDialogButton",o,!1))})})],2)])],1):a._e()},S=[],D=T(q,O,S,!1,null,"66c29e13");const P=D.exports;export{P as N};
//# sourceMappingURL=NcDialog-DmRqcm3W-CIMtFI-h.chunk.mjs.map
