import{Bn as e,In as t,Or as n,Tr as r,hn as i,ht as a,pn as o,pt as s,wn as c}from"./jsx-runtime-NwRKtVrk.js";var l=n(r()),u=e=>{if(!e)return;let{closable:t,closeIcon:n}=e;return{closable:t,closeIcon:n}},d={},f=(e,t)=>{if(!e&&(e===!1||t===!1||t===null))return!1;if(!o(e)&&!o(t))return null;let n={closeIcon:typeof t!=`boolean`&&o(t)?t:void 0};return i(e)&&(n={...n,...e}),n},p=(e,n,r)=>e===!1?!1:e?t(r,n,e):n===!1?!1:n?t(r,n):r.closable?r:!1,m=(t,n,r)=>{let{closeIconRender:i}=n,{closeIcon:a,...s}=t,c=a,u=e(s,!0);return o(c)&&(i&&(c=i(c)),c=l.isValidElement(c)?l.cloneElement(c,{"aria-label":r,...c.props,...u}):l.createElement(`span`,{"aria-label":r,...u},c)),[c,u]},h=(e,t,n=d,r=`Close`)=>{let i=f(e?.closable,e?.closeIcon),a=f(t?.closable,t?.closeIcon),o={closeIcon:l.createElement(c,null),...n},s=p(i,a,o),u=typeof s==`boolean`?!1:!!s?.disabled;if(s===!1)return[!1,null,u,{}];let[h,g]=m(s,o,r);return[!0,h,u,g]},g=(e,t,n=d)=>{let[r]=s(`global`,a.global);return l.useMemo(()=>h(e,t,{closeIcon:l.createElement(c,null),...n},r.close),[e,t,n,r.close])};export{u as n,g as r,h as t};