import{A as S,I as g,aW as v,G as o,aX as I,$ as x,aY as y,d as T,j as a,a7 as w,aA as B,aR as N,M as O,aT as K,aS as _,W as D,N as E}from"./index.3bfa6a0e.js";const[H,t]=S("action-sheet"),W=g({},v,{title:String,round:o,actions:I(),closeIcon:x("cross"),closeable:o,cancelText:String,description:String,closeOnPopstate:o,closeOnClickAction:Boolean,safeAreaInsetBottom:o}),j=[...y,"round","closeOnPopstate","safeAreaInsetBottom"];var F=T({name:H,props:W,emits:["select","cancel","update:show"],setup(n,{slots:c,emit:r}){const i=e=>r("update:show",e),l=()=>{i(!1),r("cancel")},m=()=>{if(n.title)return a("div",{class:t("header")},[n.title,n.closeable&&a(O,{name:n.closeIcon,class:[t("close"),K],onClick:l},null)])},f=()=>{if(c.cancel||n.cancelText)return[a("div",{class:t("gap")},null),a("button",{type:"button",class:t("cancel"),onClick:l},[c.cancel?c.cancel():n.cancelText])]},b=(e,s)=>e.loading?a(_,{class:t("loading-icon")},null):c.action?c.action({action:e,index:s}):[a("span",{class:t("name")},[e.name]),e.subname&&a("div",{class:t("subname")},[e.subname])],h=(e,s)=>{const{color:C,loading:d,callback:u,disabled:p,className:k}=e,P=()=>{p||d||(u&&u(e),n.closeOnClickAction&&i(!1),D(()=>r("select",e,s)))};return a("button",{type:"button",style:{color:C},class:[t("item",{loading:d,disabled:p}),k],onClick:P},[b(e,s)])},A=()=>{if(n.description||c.description){const e=c.description?c.description():n.description;return a("div",{class:t("description")},[e])}};return()=>a(N,w({class:t(),position:"bottom","onUpdate:show":i},B(n,j)),{default:()=>{var e;return[m(),A(),a("div",{class:t("content")},[n.actions.map(h),(e=c.default)==null?void 0:e.call(c)]),f()]}})}});const L=E(F);export{L as A};
