import{h as p,b as r,j as e}from"./vendor-react-MMGRhO7K.js";import{H as x,B as d}from"./index-D1QJ5Bag.js";const m=({handleCalculateShipping:t})=>{const{t:s}=p(),[i,a]=r.useState(!1),{isShippingAddressModalOpen:o,setShippingAddressModalOpen:c}=x(),l=()=>{c(!1)},n=async()=>{a(!0);try{await t(),l()}finally{a(!1)}};return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50 backdrop-blur-sm",onClick:l}),e.jsxs("div",{className:"relative bg-white w-full max-w-[400px] max-h-[90vh] m-[16px] flex flex-col",children:[e.jsxs("header",{className:"flex justify-center items-center p-[24px] pb-[16px] relative",children:[e.jsx("button",{onClick:l,className:"absolute top-[24px] right-[24px]","aria-label":s("global.close","Close dialog"),children:e.jsx("img",{src:"/icons/close-icon.svg",alt:s("global.close","Close"),className:"w-[14px] h-[14px]"})}),e.jsx("h2",{className:"text-[16px] font-semibold",children:s("global.shippingaddress","Shipping Address")})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[24px] pb-[24px] flex flex-col gap-[16px] items-center text-center",children:[e.jsx("p",{className:"text-[16px] leading-[140%]",children:s("error.pleaseCalculateShippingCost","Please calculate shipping cost")}),e.jsx(d,{type:"button",onClick:n,disabled:i,size:"fill",classes:{buttonModifier:"md:w-auto"},children:s("checkout.calculateShipping","Calculate shipping costs")})]})]})]}):null};export{m as default};
