import{J as r,R as m,p as C}from"./main-few-lands-burn.js";function E(s){if(s)return{closable:s.closable,closeIcon:s.closeIcon}}function g(s){const{closable:l,closeIcon:n}=s||{};return r.useMemo(()=>{if(!l&&(l===!1||n===!1||n===null))return!1;if(l===void 0&&n===void 0)return null;let e={closeIcon:typeof n!="boolean"&&n!==null?n:void 0};return l&&typeof l=="object"&&(e=Object.assign(Object.assign({},e),l)),e},[l,n])}function b(){const s={};for(var l=arguments.length,n=new Array(l),e=0;e<l;e++)n[e]=arguments[e];return n.forEach(o=>{o&&Object.keys(o).forEach(a=>{o[a]!==void 0&&(s[a]=o[a])})}),s}const p={};function h(s,l){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p;const e=g(s),o=g(l),a=typeof e!="boolean"?!!e?.disabled:!1,c=r.useMemo(()=>Object.assign({closeIcon:r.createElement(m,null)},n),[n]),f=r.useMemo(()=>e===!1?!1:e?b(c,o,e):o===!1?!1:o?b(c,o):c.closable?c:!1,[e,o,c]);return r.useMemo(()=>{if(f===!1)return[!1,null,a];const{closeIconRender:u}=c,{closeIcon:d}=f;let t=d;if(t!=null){u&&(t=u(d));const i=C(f,!0);Object.keys(i).length&&(t=r.isValidElement(t)?r.cloneElement(t,i):r.createElement("span",Object.assign({},i),t))}return[!0,t,a]},[f,c])}export{E as p,h as u};
