1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9439],{22096:function(e,t,a){var s=a(18618);a.o(s,"Button")&&a.d(t,{Button:function(){return s.Button}})},99439:function(e,t,a){a.r(t);var s=a(57437),l=a(2265),r=a(22096),o=a(95907),c=a(45202),n=a(94242);t.default=e=>{let{isOpen:t,onClose:a,getShareToken:i,shareToken:u,setShareToken:d}=e,[x,f]=(0,l.useState)(!1);(0,l.useEffect)(()=>{(async()=>{if(t&&!u)try{let e=await i();d(e)}catch(e){console.error("Failed to get share token",e),n.toast.error("Error al generar enlace")}})()},[t,u]);let h=u?"".concat(window.location.origin,"/cart/share?token=").concat(u):"",p=()=>{h&&navigator.clipboard.writeText(h).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)}).catch(e=>{console.error("Failed to copy URL",e),f(!1)})};return t?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 font-satoshi backdrop-blur-sm",onClick:a,children:(0,s.jsxs)("div",{className:"w-[80%] space-y-4 rounded-lg bg-white p-6 shadow-lg md:w-[30%]",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-xl font-bold",children:"Compartir Carrito"}),(0,s.jsx)("button",{onClick:a,className:"text-2xl font-bold",children:"\xd7"})]}),(0,s.jsxs)("p",{className:"text-base text-gray-600",children:["Cualquier persona que ingrese a este enlace podr\xe1 ver y copiar los productos de tu carrito actual. ",(0,s.jsx)("br",{}),"El enlace es una copia del carrito tal como est\xe1 ahora, por lo que si hac\xe9s cambios despu\xe9s, no se ver\xe1n reflejados."]}),(0,s.jsxs)("div",{className:"flex h-10 flex-row items-center space-x-2",children:[(0,s.jsx)("input",{type:"text",value:u?h:"Generando enlace...",readOnly:!0,className:"h-full flex-grow rounded border bg-gray-100 p-2 outline-none"}),(0,s.jsx)(o.Z,{title:u&&!x?"Copiar":"",placement:"top",className:"aspect-square h-full",children:(0,s.jsx)(r.Button,{onClick:()=>u&&p(),className:"h-full w-8 bg-gray-100 p-2 text-black ".concat(u&&!x?"cursor-pointer":"cursor-default"),children:x?(0,s.jsx)(c.Qo6,{className:"h-full w-full text-green-500"}):(0,s.jsx)(c.ef8,{className:"h-full w-full text-gray-600"})})})]})]})}):null}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.