import{t as g,N as v,b4 as S,u as o,av as I,y,b5 as x,d as w,c as t,v as T,am as B,P as N,a5 as O,as as _,L as K,_ as D,x as E}from"./index.27735e87.js";const[H,a]=g("action-sheet"),L=v({},S,{title:String,round:o,actions:I(),closeIcon:y("cross"),closeable:o,cancelText:String,description:String,closeOnPopstate:o,closeOnClickAction:Boolean,safeAreaInsetBottom:o}),F=[...x,"round","closeOnPopstate","safeAreaInsetBottom"];var U=w({name:H,props:L,emits:["select","cancel","update:show"],setup(n,{slots:c,emit:l}){const r=e=>l("update:show",e),i=()=>{r(!1),l("cancel")},m=()=>{if(n.title)return t("div",{class:a("header")},[n.title,n.closeable&&t(O,{name:n.closeIcon,class:[a("close"),_],onClick:i},null)])},f=()=>{if(c.cancel||n.cancelText)return[t("div",{class:a("gap")},null),t("button",{type:"button",class:a("cancel"),onClick:i},[c.cancel?c.cancel():n.cancelText])]},b=(e,s)=>e.loading?t(K,{class:a("loading-icon")},null):c.action?c.action({action:e,index:s}):[t("span",{class:a("name")},[e.name]),e.subname&&t("div",{class:a("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&&r(!1),D(()=>l("select",e,s)))};return t("button",{type:"button",style:{color:P},class:[a("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 t("div",{class:a("description")},[e])}};return()=>t(N,T({class:a(),position:"bottom","onUpdate:show":r},B(n,F)),{default:()=>{var e;return[m(),C(),t("div",{class:a("content")},[n.actions.map(h),(e=c.default)==null?void 0:e.call(c)]),f()]}})}});const j=E(U);export{j as A};
