import{c as g,J as S,aU as v,D as o,a7 as I,a2 as w,aV as x,a8 as y,Y as T,t as B,aP as O,L as D,w as K}from"./index-ae60edf9.js";import{d as N,$ as a,am as _,n as E}from"./@vue-cb50a1c4.js";const[H,t]=g("action-sheet"),L=S({},v,{title:String,round:o,actions:I(),closeIcon:w("cross"),closeable:o,cancelText:String,description:String,closeOnPopstate:o,closeOnClickAction:Boolean,safeAreaInsetBottom:o}),U=[...x,"round","closeOnPopstate","safeAreaInsetBottom"];var V=N({name:H,props:L,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(B,{name:n.closeIcon,class:[t("close"),O],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(D,{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:P,loading:d,callback:u,disabled:p,className:k}=e,A=()=>{p||d||(u&&u(e),n.closeOnClickAction&&i(!1),E(()=>r("select",e,s)))};return a("button",{type:"button",style:{color:P},class:[t("item",{loading:d,disabled:p}),k],onClick:A},[b(e,s)])},C=()=>{if(n.description||c.description){const e=c.description?c.description():n.description;return a("div",{class:t("description")},[e])}};return()=>a(T,_({class:t(),position:"bottom","onUpdate:show":i},y(n,U)),{default:()=>{var e;return[m(),C(),a("div",{class:t("content")},[n.actions.map(h),(e=c.default)==null?void 0:e.call(c)]),f()]}})}});const Y=K(V);export{Y as A};
