var ge=Object.defineProperty,we=Object.defineProperties;var he=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var Q=(e,o,t)=>o in e?ge(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,v=(e,o)=>{for(var t in o||(o={}))me.call(o,t)&&Q(e,t,o[t]);if(J)for(var t of J(o))ye.call(o,t)&&Q(e,t,o[t]);return e},A=(e,o)=>we(e,he(o));var W=(e,o,t)=>new Promise((l,a)=>{var p=u=>{try{s(t.next(u))}catch(c){a(c)}},r=u=>{try{s(t.throw(u))}catch(c){a(c)}},s=u=>u.done?l(u.value):Promise.resolve(u.value).then(p,r);s((t=t.apply(e,o)).next())});import{m as S,ad as ve,b as ee,d as R,a as E,e as w,_ as M,P as b,o as d,f as B,F as be,T as g,i as P,s as h,x as j,t as T,Q as L,k as O,n as C,ax as te,bK as De,W as V,h as G,aP as Ce,r as D,bS as $e,c2 as K,j as i,L as k,bu as ke,E as X,K as oe,M as _,O as re,a$ as Be,R as Y,w as Oe,S as Pe,U as Se,V as Te,q as se,J as Le,N as ne,bN as _e,bP as ae,H as Fe}from"./index.600742c0.js";import{Drawer as He}from"ant-design-vue";import{i as Ae}from"./isEqual.8095f8fc.js";var Ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"},je=Ve;function Z(e){for(var o=1;o{const r=`${e.height}`;return{height:r,lineHeight:`calc(${r} - 1px)`}});function a(){o("ok")}function p(){o("close")}return{handleOk:a,prefixCls:t,handleClose:p,getStyle:l}}});function Ie(e,o,t,l,a,p){const r=b("a-button");return e.showFooter||e.$slots.footer?(d(),B("div",{key:0,class:C(e.prefixCls),style:te(e.getStyle)},[e.$slots.footer?g(e.$slots,"footer",{key:1}):(d(),B(be,{key:0},[g(e.$slots,"insertFooter"),e.showCancelBtn?(d(),P(r,L({key:0},e.cancelButtonProps,{onClick:e.handleClose,class:"mr-2"}),{default:h(()=>[j(T(e.cancelText),1)]),_:1},16,["onClick"])):O("",!0),g(e.$slots,"centerFooter"),e.showOkBtn?(d(),P(r,L({key:1,type:e.okType,onClick:e.handleOk},e.okButtonProps,{class:"mr-2",loading:e.confirmLoading}),{default:h(()=>[j(T(e.okText),1)]),_:1},16,["type","onClick","loading"])):O("",!0),g(e.$slots,"appendFooter")],64))],6)):O("",!0)}var qe=M(Me,[["render",Ie]]);const ze=R({name:"BasicDrawerHeader",components:{BasicTitle:De,ArrowLeftOutlined:Re},props:{isDetail:V.bool,showDetailBack:V.bool,title:V.string},emits:["close"],setup(e,{emit:o}){const{prefixCls:t}=E("basic-drawer-header");function l(){o("close")}return{prefixCls:t,handleClose:l}}}),Ue={key:1};function Je(e,o,t,l,a,p){const r=b("BasicTitle"),s=b("ArrowLeftOutlined");return e.isDetail?(d(),B("div",{key:1,class:C([e.prefixCls,`${e.prefixCls}--detail`])},[G("span",{class:C(`${e.prefixCls}__twrap`)},[e.showDetailBack?(d(),B("span",{key:0,onClick:o[0]||(o[0]=(...u)=>e.handleClose&&e.handleClose(...u))},[S(s,{class:C(`${e.prefixCls}__back`)},null,8,["class"])])):O("",!0),e.title?(d(),B("span",Ue,T(e.title),1)):O("",!0)],2),G("span",{class:C(`${e.prefixCls}__toolbar`)},[g(e.$slots,"titleToolbar")],2)],2)):(d(),P(r,{key:0,class:C(e.prefixCls)},{default:h(()=>[g(e.$slots,"title"),j(" "+T(e.$slots.title?"":e.title),1)]),_:3},8,["class"]))}var Qe=M(ze,[["render",Je]]);const We=R({components:{Drawer:He,ScrollContainer:Ce,DrawerFooter:qe,DrawerHeader:Qe},inheritAttrs:!1,props:Ee,emits:["visible-change","ok","close","register"],setup(e,{emit:o}){const t=D(!1),l=$e(),a=D(null),{t:p}=ee(),{prefixVar:r,prefixCls:s}=E("basic-drawer"),u={setDrawerProps:pe,emitVisible:void 0},c=_();c&&o("register",u,c.uid);const y=w(()=>K(k(e),i(a))),m=w(()=>{const n=A(v(v({placement:"right"},i(l)),i(y)),{visible:i(t)});n.title=void 0;const{isDetail:f,width:H,wrapClassName:z,getContainer:de}=n;if(f){H||(n.width="100%");const U=`${s}__detail`;n.class=z?`${z} ${U}`:U,de||(n.getContainer=`.${r}-layout-content`)}return n}),F=w(()=>v(v({},l),i(m))),q=w(()=>{const{footerHeight:n,showFooter:f}=i(m);return f&&n?ke(n)?`${n}px`:`${n.replace("px","")}px`:"0px"}),ie=w(()=>{const n=i(q);return{position:"relative",height:`calc(100% - ${n})`}}),ue=w(()=>{var n;return!!((n=i(m))!=null&&n.loading)});X(()=>e.visible,(n,f)=>{n!==f&&(t.value=n)},{deep:!0}),X(()=>t.value,n=>{oe(()=>{var f;o("visible-change",n),c&&((f=u.emitVisible)==null||f.call(u,n,c.uid))})});function ce(n){return W(this,null,function*(){const{closeFunc:f}=i(m);if(o("close",n),f&&re(f)){const H=yield f();t.value=!H;return}t.value=!1})}function pe(n){a.value=K(i(a)||{},n),Reflect.has(n,"visible")&&(t.value=!!n.visible)}function fe(){o("ok")}return{onClose:ce,t:p,prefixCls:s,getMergeProps:y,getScrollContentStyle:ie,getProps:m,getLoading:ue,getBindValues:F,getFooterHeight:q,handleOk:fe}}});function Ge(e,o,t,l,a,p){const r=b("DrawerHeader"),s=b("ScrollContainer"),u=b("DrawerFooter"),c=b("Drawer"),y=Be("loading");return d(),P(c,L({class:e.prefixCls,onClose:e.onClose},e.getBindValues),Y({default:h(()=>[Oe((d(),P(s,{style:te(e.getScrollContentStyle),"loading-tip":e.loadingText||e.t("common.loadingText")},{default:h(()=>[g(e.$slots,"default")]),_:3},8,["style","loading-tip"])),[[y,e.getLoading]]),S(u,L(e.getProps,{onClose:e.onClose,onOk:e.handleOk,height:e.getFooterHeight}),Y({_:2},[Pe(Object.keys(e.$slots),m=>({name:m,fn:h(F=>[g(e.$slots,m,Se(Te(F||{})))])}))]),1040,["onClose","onOk","height"])]),_:2},[e.$slots.title?{name:"title",fn:h(()=>[g(e.$slots,"title")]),key:"1"}:{name:"title",fn:h(()=>[S(r,{title:e.getMergeProps.title,isDetail:e.isDetail,showDetailBack:e.showDetailBack,onClose:e.onClose},{titleToolbar:h(()=>[g(e.$slots,"titleToolbar")]),_:3},8,["title","isDetail","showDetailBack","onClose"])]),key:"0"}]),1040,["class","onClose"])}var Ke=M(We,[["render",Ge]]);const $=se({}),N=se({});function et(){if(!_())throw new Error("useDrawer() can only be used inside setup() or functional components!");const e=D(null),o=D(!1),t=D("");function l(r,s){ne(()=>{e.value=null,o.value=null,$[i(t)]=null}),!(i(o)&&_e()&&r===i(e))&&(t.value=s,e.value=r,o.value=!0,r.emitVisible=(u,c)=>{N[c]=u})}const a=()=>{const r=i(e);return r||ae("useDrawer instance is undefined!"),r},p={setDrawerProps:r=>{var s;(s=a())==null||s.setDrawerProps(r)},getVisible:w(()=>N[~~i(t)]),openDrawer:(r=!0,s,u=!0)=>{var y;if((y=a())==null||y.setDrawerProps({visible:r}),!s)return;if(u){$[i(t)]=null,$[i(t)]=k(s);return}Ae(k($[i(t)]),k(s))||($[i(t)]=k(s))},closeDrawer:()=>{var r;(r=a())==null||r.setDrawerProps({visible:!1})}};return[l,p]}const tt=e=>{const o=D(null),t=_(),l=D("");if(!_())throw new Error("useDrawerInner() can only be used inside setup() or functional components!");const a=()=>{const r=i(o);if(!r){ae("useDrawerInner instance is undefined!");return}return r},p=(r,s)=>{ne(()=>{o.value=null}),l.value=s,o.value=r,t==null||t.emit("register",r,s)};return Le(()=>{const r=$[i(l)];!r||!e||!re(e)||oe(()=>{e(r)})}),[p,{changeLoading:(r=!0)=>{var s;(s=a())==null||s.setDrawerProps({loading:r})},changeOkLoading:(r=!0)=>{var s;(s=a())==null||s.setDrawerProps({confirmLoading:r})},getVisible:w(()=>N[~~i(l)]),closeDrawer:()=>{var r;(r=a())==null||r.setDrawerProps({visible:!1})},setDrawerProps:r=>{var s;(s=a())==null||s.setDrawerProps(r)}}]},ot=Fe(Ke);export{ot as B,tt as a,et as u};