k5web/assets/dialog.7f7b3cca.js
2024-06-15 16:36:02 +08:00

51 lines
22 KiB
JavaScript

import{t as Qe,_,u as ae}from"./useConfig.d689d74c.js";import{h as qe,c as d,d as F,f as k,p as en,bC as nn,aI as p,bB as x,g as tn,w as Oe,o as _e,b as we,z as an,n as rn,bx as on,bn as re,bo as ln,bD as cn,bE as sn}from"./arco.949c921a.js";import{d as Se,Q as un,S as fn,T as vn,U as dn,V as mn,M as gn,W as pn,X as hn,Y as yn,Z as bn,$ as Cn,a0 as On,c as Ee,e as oe,N as W,F as K,b as _n}from"./index.4219fe2e.js";import{_ as Pe,a as wn,b as Sn,u as En}from"./index.eba1bd6c.js";import{B as U}from"./index.af0e1938.js";import{b as Pn}from"./helper.bfb5c524.js";function N(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function le(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,a)}return t}function ie(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?le(Object(t),!0).forEach(function(a){N(n,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):le(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))})}return n}function Bn(n){var e=["fillOpacity","fillRule","clipRule"];return e.includes(n)?n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():n}function D(n,e){var t=Object.keys(n.attrs).reduce((a,r)=>(a[Bn(r)]=n.attrs[r],a),{});return qe(n.tag,ie(ie({},t),e),(n.children||[]).map(a=>D(a,{})))}var kn="t",jn="zh-CN",Fn={classPrefix:kn,locale:jn};const Nn=Fn;function Dn(){var{classPrefix:n}=Nn;return{SIZE:{default:"",xs:"".concat(n,"-size-xs"),small:"".concat(n,"-size-s"),medium:"".concat(n,"-size-m"),large:"".concat(n,"-size-l"),xl:"".concat(n,"-size-xl"),block:"".concat(n,"-size-full-width")},STATUS:{loading:"".concat(n,"-is-loading"),disabled:"".concat(n,"-is-disabled"),focused:"".concat(n,"-is-focused"),success:"".concat(n,"-is-success"),error:"".concat(n,"-is-error"),warning:"".concat(n,"-is-warning"),selected:"".concat(n,"-is-selected"),active:"".concat(n,"-is-active"),checked:"".concat(n,"-is-checked"),current:"".concat(n,"-is-current"),hidden:"".concat(n,"-is-hidden"),visible:"".concat(n,"-is-visible"),expanded:"".concat(n,"-is-expanded"),indeterminate:"".concat(n,"-is-indeterminate")}}}function M(n){var e=Dn().SIZE,t=d(()=>n.value in e?e[n.value]:""),a=d(()=>n.value===void 0||n.value in e?{}:{fontSize:n.value});return{style:a,className:t}}function ce(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,a)}return t}function se(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ce(Object(t),!0).forEach(function(a){N(n,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ce(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))})}return n}var Ln={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 23a11 11 0 100-22 11 11 0 000 22zM7.5 10.59l3 3 6-6L17.91 9l-7.41 7.41L6.09 12l1.41-1.41z"}}]},xn=F({name:"CheckCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(n,e){var{attrs:t}=e,a=d(()=>n.size),{className:r,style:i}=M(a),m=d(()=>["t-icon","t-icon-check-circle-filled",r.value]),u=d(()=>se(se({},i.value),t.style)),f=d(()=>({class:m.value,style:u.value,onClick:c=>{var o;return(o=n.onClick)===null||o===void 0?void 0:o.call(n,{e:c})}}));return()=>D(Ln,f.value)}});const Mn=xn;function ue(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,a)}return t}function fe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ue(Object(t),!0).forEach(function(a){N(n,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ue(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))})}return n}var An={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7.05 5.64L12 10.59l4.95-4.95 1.41 1.41L13.41 12l4.95 4.95-1.41 1.41L12 13.41l-4.95 4.95-1.41-1.41L10.59 12 5.64 7.05l1.41-1.41z"}}]},In=F({name:"CloseIcon",props:{size:{type:String},onClick:{type:Function}},setup(n,e){var{attrs:t}=e,a=d(()=>n.size),{className:r,style:i}=M(a),m=d(()=>["t-icon","t-icon-close",r.value]),u=d(()=>fe(fe({},i.value),t.style)),f=d(()=>({class:m.value,style:u.value,onClick:c=>{var o;return(o=n.onClick)===null||o===void 0?void 0:o.call(n,{e:c})}}));return()=>D(An,f.value)}});const Tn=In;function ve(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,a)}return t}function de(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ve(Object(t),!0).forEach(function(a){N(n,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ve(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))})}return n}var $n={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 1a11 11 0 110 22 11 11 0 010-22zm-1 13h2V6.5h-2V14zm2 1.5h-2v2h2v-2z"}}]},zn=F({name:"ErrorCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(n,e){var{attrs:t}=e,a=d(()=>n.size),{className:r,style:i}=M(a),m=d(()=>["t-icon","t-icon-error-circle-filled",r.value]),u=d(()=>de(de({},i.value),t.style)),f=d(()=>({class:m.value,style:u.value,onClick:c=>{var o;return(o=n.onClick)===null||o===void 0?void 0:o.call(n,{e:c})}}));return()=>D($n,f.value)}});const Wn=zn;function me(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,a)}return t}function ge(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?me(Object(t),!0).forEach(function(a){N(n,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):me(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))})}return n}var Kn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 23a11 11 0 100-22 11 11 0 000 22zM11 8.5v-2h2v2h-2zm2 1.5v7.5h-2V10h2z"}}]},Un=F({name:"InfoCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(n,e){var{attrs:t}=e,a=d(()=>n.size),{className:r,style:i}=M(a),m=d(()=>["t-icon","t-icon-info-circle-filled",r.value]),u=d(()=>ge(ge({},i.value),t.style)),f=d(()=>({class:m.value,style:u.value,onClick:c=>{var o;return(o=n.onClick)===null||o===void 0?void 0:o.call(n,{e:c})}}));return()=>D(Kn,f.value)}});const Hn=Un;/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function Xn(n){var e=Se("icon"),t=e.globalConfig,a={};return Object.keys(n).forEach(function(r){var i;a[r]=((i=t.value)===null||i===void 0?void 0:i[r])||n[r]}),a}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Gn="t-display-none-element-refresh";function Rn(){var n=k(0);en(Gn,n),nn(function(){n.value+=1})}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function Zn(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}var Vn=Zn;/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var pe=un,Yn=mn,Jn=gn,he=pe?pe.isConcatSpreadable:void 0;function Qn(n){return Jn(n)||Yn(n)||!!(he&&n&&n[he])}var qn=Qn,et=dn,nt=qn;function Be(n,e,t,a,r){var i=-1,m=n.length;for(t||(t=nt),r||(r=[]);++i<m;){var u=n[i];e>0&&t(u)?e>1?Be(u,e-1,t,a,r):et(r,u):a||(r[r.length]=u)}return r}var tt=Be,at=tt;function rt(n){var e=n==null?0:n.length;return e?at(n,1):[]}var ot=rt,lt=ot,it=fn,ct=vn;function st(n){return ct(it(n,void 0,lt),n+"")}var ut=st;/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var ft=Sn,vt=Cn;function dt(n,e){return e.length<2?n:ft(n,vt(e,0,-1))}var mt=dt,gt=Pe,pt=Vn,ht=mt,yt=wn;function bt(n,e){return e=gt(e,n),n=ht(n,e),n==null||delete n[yt(pt(e))]}var Ct=bt,Ot=On;function _t(n){return Ot(n)?void 0:n}var wt=_t,St=pn,Et=bn,Pt=Ct,Bt=Pe,kt=hn,jt=wt,Ft=ut,Nt=yn,Dt=1,Lt=2,xt=4,Mt=Ft(function(n,e){var t={};if(n==null)return t;var a=!1;e=St(e,function(i){return i=Bt(i,n),a||(a=i.length>1),i}),kt(n,Nt(n),t),a&&(t=Et(t,Dt|Lt|xt,jt));for(var r=e.length;r--;)Pt(t,e[r]);return t}),At=Mt;/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function It(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function ye(n,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,Qe(a.key),a)}}function Tt(n,e,t){return e&&ye(n.prototype,e),t&&ye(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var $t={attach:{type:[String,Function]},body:{type:[String,Function]},cancelBtn:{type:[String,Object,Function]},closeBtn:{type:[String,Boolean,Function],default:!0},closeOnEscKeydown:{type:Boolean,default:void 0},closeOnOverlayClick:{type:Boolean,default:void 0},confirmBtn:{type:[String,Object,Function]},confirmLoading:{type:Boolean,default:void 0},confirmOnEnter:Boolean,default:{type:[String,Function]},destroyOnClose:Boolean,draggable:Boolean,footer:{type:[Boolean,Function],default:!0},header:{type:[String,Boolean,Function],default:!0},mode:{type:String,default:"modal",validator:function(e){return e?["modal","modeless","normal","full-screen"].includes(e):!0}},placement:{type:String,default:"top",validator:function(e){return e?["top","center"].includes(e):!0}},preventScrollThrough:{type:Boolean,default:!0},showInAttachedElement:Boolean,showOverlay:{type:Boolean,default:!0},theme:{type:String,default:"default",validator:function(e){return e?["default","info","warning","danger","success"].includes(e):!0}},top:{type:[String,Number]},visible:Boolean,width:{type:[String,Number]},zIndex:{type:Number},onCancel:Function,onClose:Function,onCloseBtnClick:Function,onClosed:Function,onConfirm:Function,onEscKeydown:Function,onOpened:Function,onOverlayClick:Function};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function be(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,a)}return t}function E(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?be(Object(t),!0).forEach(function(a){_(n,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):be(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))})}return n}function zt(n){var e=tn(),t=Ee(),a=function(c){var o,g=c.globalConfirm,h=c.theme,y=c.globalConfirmBtnTheme,O=((o=At(y,["info"]))===null||o===void 0?void 0:o[h])||"primary",w={theme:O,size:c.size,onClick:function(A){n.confirmBtnAction(A)}};return W(g)?w.content=g:K(g)&&(w=E(E({},w),g)),w},r=function(c){var o=c.globalCancel,g={theme:"default",size:c.size,onClick:function(y){n.cancelBtnAction(y)}};return W(o)?g.content=o:K(o)&&(g=E(E({},g),o)),g},i=function(c,o){var g=o.defaultButtonProps,h=o.className,y=o.confirmLoading,O=g;return W(c)?O.content=c:K(c)&&(O=E(E({},O),c)),y!==void 0&&(O.loading=y),p(U,x({class:h},O),null)},m=function(c){var o=c.confirmBtn,g=c.className,h=c.confirmLoading;if(o===null)return null;o&&e.slots.confirmBtn&&console.warn("Both $props.confirmBtn and $scopedSlots.confirmBtn exist, $props.confirmBtn is preferred.");var y=a(c);return!o&&!e.slots.confirmBtn?p(U,x({class:g,loading:h},y),null):o&&["string","object"].includes(oe(o))?i(o,{defaultButtonProps:y,className:g,confirmLoading:h}):t("confirmBtn")},u=function(c){var o=c.cancelBtn,g=c.className;if(o===null)return null;o&&e.slots.cancelBtn&&console.warn("Both $props.cancelBtn and $scopedSlots.cancelBtn exist, $props.cancelBtn is preferred.");var h=r(c);return!o&&!e.slots.cancelBtn?p(U,x({class:g},h),null):o&&["string","object"].includes(oe(o))?i(o,{defaultButtonProps:h}):t("cancelBtn")};return{getConfirmBtn:m,getCancelBtn:u}}function Wt(n){var e=!1,t=!1,a=function(u){e&&t&&n(u),e=!1,t=!1},r=function(u){e=u.target===u.currentTarget},i=function(u){t=u.target===u.currentTarget};return{onClick:a,onMousedown:r,onMouseup:i}}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function ra(){var n=6;if(typeof navigator>"u"||!navigator||/(Chrome|Safari)/i.test(navigator.userAgent))return n;var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),/Firefox/.test(navigator.userAgent)&&(t-=4),Pn()<=11&&(t=12),t}function Kt(){var n=document.createElement("div");n.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(n);var e=n.offsetWidth-n.clientWidth;return document.body.removeChild(n),e}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Ut=1e3,Ht=5e3,Xt=1,Gt=Tt(function n(){var e=this;It(this,n),_(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set}),_(this,"getNextZIndex",function(t){var a=t==="message"?Array.from(e.popupStack.message).pop()||Ht:Array.from(e.popupStack.popup).pop()||Ut;return a+Xt}),_(this,"add",function(t){var a=e.getNextZIndex(t);return e.popupStack[t].add(a),t==="dialog"&&e.popupStack.popup.add(a),a}),_(this,"delete",function(t,a){e.popupStack[a].delete(t),a==="dialog"&&e.popupStack.popup.delete(t)}),_(this,"isLastDialog",function(t){return e.popupStack.dialog.size>1?t===Array.from(e.popupStack.dialog).pop():!0})}),H=new Gt;function Rt(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.visible,a=e.runOnMounted,r=k(0),i=function(){r.value=H.add(n)},m=function(){H.delete(r.value,n)},u=function(){return n==="dialog"?H.isLastDialog(r.value):!1};return Oe(function(){return t==null?void 0:t.value},function(f){f?i():m()},{immediate:!0}),a&&(_e(function(){i()}),we(function(){m()})),{zIndex:an(r),open:i,close:m,isLastDialog:u}}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function Ce(n){return Number.isNaN(Number(n))?n:"".concat(Number(n),"px")}var j,Zt=function(e){j={x:e.clientX,y:e.clientY},setTimeout(function(){j=null},100)};typeof window<"u"&&window.document&&window.document.documentElement&&document.documentElement.addEventListener("click",Zt,!0);function Vt(n){var e=n,t=window.innerWidth||document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;e.addEventListener("mousedown",function(r){var i=r.clientX-e.offsetLeft,m=r.clientY-e.offsetTop,u=e.offsetWidth,f=e.offsetHeight;if(u>t||f>a)return;function c(g){var h=g.clientX-i,y=g.clientY-m;h<0&&(h=0),y<0&&(y=0),t-e.offsetWidth-h<0&&(h=t-e.offsetWidth),a-e.offsetHeight-y<0&&(y=a-e.offsetHeight),e.style.position="absolute",e.style.left="".concat(h,"px"),e.style.top="".concat(y,"px")}function o(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",o)}document.addEventListener("mousemove",c),document.addEventListener("mouseup",o),document.addEventListener("dragend",o)})}var Yt=1,oa=F({name:"TDialog",directives:{draggable:function(e,t){e&&t&&t.value&&Vt(e)}},inheritAttrs:!1,props:$t,emits:["update:visible"],setup:function(e,t){var a=this,r=ae("dialog"),i=ae(),m=_n(),u=Ee(),f=k(null),c=Se("dialog"),o=c.globalConfig,g=Xn({CloseIcon:Tn,InfoCircleFilledIcon:Hn,CheckCircleFilledIcon:Mn,ErrorCircleFilledIcon:Wn}),h=g.CloseIcon,y=g.InfoCircleFilledIcon,O=g.CheckCircleFilledIcon,w=g.ErrorCircleFilledIcon,X=function(l){var s;(s=e.onConfirm)===null||s===void 0||s.call(e,{e:l})},A=function(l){var s;(s=e.onCancel)===null||s===void 0||s.call(e,{e:l}),L({e:l,trigger:"cancel"})},G=zt({confirmBtnAction:X,cancelBtnAction:A}),ke=G.getConfirmBtn,je=G.getCancelBtn,Fe=En(function(){return e.attach});Rn();var R=k(),S=k(),Z=d(function(){return e.mode==="modal"}),P=d(function(){return e.mode==="modeless"}),V=d(function(){return e.mode==="normal"}),C=d(function(){return e.mode==="full-screen"}),Ne=d(function(){return e.visible}),De=d(function(){return["".concat(r.value,"__mask"),!e.showOverlay&&"".concat(i.value,"-is-hidden")]}),Le=d(function(){return V.value?[]:C.value?["".concat(r.value,"__position_fullscreen")]:["".concat(r.value,"__position"),!!e.top&&"".concat(r.value,"--top"),"".concat(e.placement&&!e.top?"".concat(r.value,"--").concat(e.placement):"")]}),xe=d(function(){return[!V.value&&"".concat(r.value,"__wrap")]}),Me=d(function(){if(C.value)return{};var v=e.top,l={};if(v!==void 0){var s=Ce(v);l={paddingTop:s}}return l}),Y=d(function(){var v=["".concat(r.value),"".concat(r.value,"__modal-").concat(e.theme),P.value&&e.draggable&&"".concat(r.value,"--draggable")];return C.value?v.push("".concat(r.value,"__fullscreen")):v.push.apply(v,["".concat(r.value,"--default"),"".concat(r.value,"--").concat(e.placement)]),v}),J=d(function(){return C.value?{}:{width:Ce(e.width)}}),Ae=Rt("dialog",{visible:Ne}),Q=Ae.isLastDialog;Oe(function(){return e.visible},function(v){if(v){var l;(Z.value&&!e.showInAttachedElement||C.value)&&(e.preventScrollThrough&&document.body.appendChild(S.value),rn(function(){j&&f.value&&(f.value.style.transformOrigin="".concat(j.x-f.value.offsetLeft,"px ").concat(j.y-f.value.offsetTop,"px"))})),(l=document.activeElement)===null||l===void 0||l.blur()}else Ie();ee(v)});function q(){var v,l;(v=S.value.parentNode)===null||v===void 0||(l=v.removeChild)===null||l===void 0||l.call(v,S.value)}function Ie(){clearTimeout(R.value),R.value=setTimeout(function(){q()},150)}var ee=function(l){l?(document.addEventListener("keydown",te),e.confirmOnEnter&&document.addEventListener("keydown",ne)):(document.removeEventListener("keydown",te),e.confirmOnEnter&&document.removeEventListener("keydown",ne))},ne=function(l){var s=l.target;if(s.tagName.toLowerCase()!=="input"){var b=l.code;if((b==="Enter"||b==="NumpadEnter")&&Q()){var B;(B=e.onConfirm)===null||B===void 0||B.call(e,{e:l})}}},te=function(l){if(l.code==="Escape"&&Q()){var s,b;(s=e.onEscKeydown)===null||s===void 0||s.call(e,{e:l}),((b=e.closeOnEscKeydown)!==null&&b!==void 0?b:o.value.closeOnEscKeydown)&&L({e:l,trigger:"esc"})}},Te=function(l){var s;if(e.showOverlay&&((s=e.closeOnOverlayClick)!==null&&s!==void 0?s:o.value.closeOnOverlayClick)){var b;(b=e.onOverlayClick)===null||b===void 0||b.call(e,{e:l}),L({e:l,trigger:"overlay"})}},I=Wt(Te),$e=I.onClick,ze=I.onMousedown,We=I.onMouseup,Ke=function(l){var s;(s=e.onCloseBtnClick)===null||s===void 0||s.call(e,{e:l}),L({trigger:"close-btn",e:l})},Ue=function(){var l;(l=e.onOpened)===null||l===void 0||l.call(e)},He=function(){var l;P.value&&e.draggable&&f.value&&(f.value.style.position="relative",f.value.style.left="unset",f.value.style.top="unset"),(l=e.onClosed)===null||l===void 0||l.call(e)},L=function(l){var s;(s=e.onClose)===null||s===void 0||s.call(e,l),t.emit("update:visible",!1)},Xe=function(l){var s,b=(s=a._events)===null||s===void 0?void 0:s[l];return!!(b!=null&&b.length)},Ge=function(){var l={info:p(y,{class:"".concat(i.value,"-is-info")},null),warning:p(w,{class:"".concat(i.value,"-is-warning")},null),danger:p(w,{class:"".concat(i.value,"-is-error")},null),success:p(O,{class:"".concat(i.value,"-is-success")},null)};return l[e.theme]},Re=function(){var l=p("h5",{class:"title"},null),s=p(h,null,null),b=m("default","body"),B=p("div",null,[je({cancelBtn:e.cancelBtn,globalCancel:o.value.cancel,className:"".concat(r.value,"__cancel")}),ke({theme:e.theme,confirmBtn:e.confirmBtn,globalConfirm:o.value.confirm,globalConfirmBtnTheme:o.value.confirmBtnTheme,className:"".concat(r.value,"__confirm"),confirmLoading:e.confirmLoading})]),Ze=C.value?["".concat(r.value,"__header"),"".concat(r.value,"__header--fullscreen")]:"".concat(r.value,"__header"),Ve=C.value?["".concat(r.value,"__close"),"".concat(r.value,"__close--fullscreen")]:"".concat(r.value,"__close"),T=e.theme==="default"?["".concat(r.value,"__body")]:["".concat(r.value,"__body__icon")],$=u("footer",B);C.value&&$?T.push("".concat(r.value,"__body--fullscreen")):C.value&&T.push("".concat(r.value,"__body--fullscreen--without-footer"));var Ye=C.value?["".concat(r.value,"__footer"),"".concat(r.value,"__footer--fullscreen")]:"".concat(r.value,"__footer"),z=function(Je){P.value&&e.draggable&&Je.stopPropagation()};return p("div",{class:xe.value},[p("div",{class:Le.value,style:Me.value,onClick:$e,onMousedown:ze,onMouseup:We},[re(p("div",{key:"dialog",class:Y.value,style:J.value,ref:f},[p("div",{class:Ze,onMousedown:z},[p("div",{class:"".concat(r.value,"__header-content")},[Ge(),u("header",l)]),e.closeBtn?p("span",{class:Ve,onClick:Ke},[u("closeBtn",s)]):null]),p("div",{class:T,onMousedown:z},[b]),$&&p("div",{class:Ye,onMousedown:z},[$])]),[[sn("draggable"),P.value&&e.draggable]])])])};return _e(function(){var v=document.documentElement.scrollHeight>document.documentElement.clientHeight,l=v?Kt():0;S.value=document.createElement("style"),S.value.dataset.id="td_dialog_".concat(+new Date,"_").concat(Yt+=1),S.value.innerHTML=`
html body {
overflow-y: hidden;
width: calc(100% - `.concat(l,`px);
}
`)}),we(function(){ee(!1),q()}),{COMPONENT_NAME:r,isModal:Z,isModeLess:P,isFullScreen:C,maskClass:De,dialogClass:Y,dialogStyle:J,dialogEle:f,afterEnter:Ue,afterLeave:He,hasEventOn:Xe,renderDialog:Re,teleportElement:Fe}},render:function(){var e=this,t=this.COMPONENT_NAME,a=(this.isModal||this.isFullScreen)&&p("div",{key:"mask",class:this.maskClass},null),r=this.renderDialog(),i=[a,r],m={zIndex:this.zIndex},u=["".concat(t,"__ctx"),_(_(_({},"".concat(t,"__ctx--fixed"),this.isModal||this.isFullScreen),"".concat(t,"__ctx--absolute"),this.isModal&&this.showInAttachedElement),"".concat(t,"__ctx--modeless"),this.isModeLess)];return p(cn,{disabled:!this.attach||!this.teleportElement,to:this.teleportElement},{default:function(){return[p(on,{duration:300,name:"".concat(t,"-zoom__vue"),onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave},{default:function(){return[(!e.destroyOnClose||e.visible)&&re(p("div",x({class:u,style:m},e.$attrs),[i]),[[ln,e.visible]])]}})]}})}});export{Mn as C,Wn as E,N as _,Xn as a,oa as b,ut as c,Tn as d,tt as e,Tt as f,ra as g,It as h,Rt as i,zt as j,Kt as k,Vn as l,At as o,D as r,M as u};