bitsnap-react 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -7
- package/dist/CartProvider-ONIOELW5.mjs +2 -0
- package/dist/CartProvider-Q3CIVK5K.js +2 -0
- package/dist/CartProvider-Q3CIVK5K.js.map +1 -0
- package/dist/analytics.d.mts +22 -5
- package/dist/analytics.d.ts +22 -5
- package/dist/analytics.js +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/analytics.mjs +1 -1
- package/dist/catalog.d.mts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +1 -1
- package/dist/catalog.js.map +1 -1
- package/dist/catalog.mjs +1 -1
- package/dist/chunk-7RGH57QG.js +2 -0
- package/dist/chunk-7RGH57QG.js.map +1 -0
- package/dist/chunk-ADYVTMGH.mjs +2 -0
- package/dist/chunk-ADYVTMGH.mjs.map +1 -0
- package/dist/{chunk-FHDFLSPW.js → chunk-ASNUY3EU.js} +2 -2
- package/dist/chunk-ASNUY3EU.js.map +1 -0
- package/dist/{chunk-HKVMSMDF.mjs → chunk-C5Q7DGCD.mjs} +2 -2
- package/dist/{chunk-LJWS6ZRJ.mjs → chunk-C5RMHUOG.mjs} +2 -2
- package/dist/{chunk-KG6RU37U.js → chunk-CUQ2PNCJ.js} +3 -3
- package/dist/chunk-CUQ2PNCJ.js.map +1 -0
- package/dist/{chunk-VXB7LA4E.js → chunk-ELGNOAH4.js} +2 -2
- package/dist/chunk-ELGNOAH4.js.map +1 -0
- package/dist/chunk-EZWH6BB2.mjs +2 -0
- package/dist/chunk-EZWH6BB2.mjs.map +1 -0
- package/dist/{chunk-SLLBTQTW.mjs → chunk-GPNALARZ.mjs} +2 -2
- package/dist/chunk-GT3OH55Y.js +2 -0
- package/dist/chunk-GT3OH55Y.js.map +1 -0
- package/dist/{chunk-SZ256RCC.mjs → chunk-H3YP2QPV.mjs} +2 -2
- package/dist/chunk-HG4YOJWE.mjs +4 -0
- package/dist/chunk-HG4YOJWE.mjs.map +1 -0
- package/dist/chunk-JSDGZ4NY.js.map +1 -1
- package/dist/chunk-KOYBZORL.js.map +1 -1
- package/dist/{chunk-VM6JEJFZ.js → chunk-PUYK4YHE.js} +2 -2
- package/dist/chunk-PUYK4YHE.js.map +1 -0
- package/dist/chunk-T57337WD.mjs +2 -0
- package/dist/chunk-T57337WD.mjs.map +1 -0
- package/dist/{chunk-3IMJALBX.js → chunk-VQQBBSK2.js} +2 -2
- package/dist/chunk-VQQBBSK2.js.map +1 -0
- package/dist/chunk-XIHGWNTS.js +2 -0
- package/dist/chunk-XIHGWNTS.js.map +1 -0
- package/dist/{chunk-GN63ITLA.mjs → chunk-XQ43IC4M.mjs} +2 -2
- package/dist/{chunk-V4U2PTKN.js → chunk-YFETPEI6.js} +2 -2
- package/dist/chunk-YFETPEI6.js.map +1 -0
- package/dist/consent.d.mts +7 -0
- package/dist/consent.d.ts +7 -0
- package/dist/consent.js +29 -15
- package/dist/consent.js.map +1 -1
- package/dist/consent.mjs +29 -15
- package/dist/consent.mjs.map +1 -1
- package/dist/course.d.mts +2 -2
- package/dist/course.d.ts +2 -2
- package/dist/course.js +1 -1
- package/dist/course.js.map +1 -1
- package/dist/course.mjs +1 -1
- package/dist/course.mjs.map +1 -1
- package/dist/embed/analytics.js +1 -1
- package/dist/embed/consent.js +27 -13
- package/dist/errors.js.map +1 -1
- package/dist/index.d.mts +40 -8
- package/dist/index.d.ts +40 -8
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{instrument-C_abZLHk.d.ts → instrument-CmxK7S4T.d.mts} +22 -5
- package/dist/{instrument-C_abZLHk.d.mts → instrument-CmxK7S4T.d.ts} +22 -5
- package/dist/internal.js.map +1 -1
- package/dist/methods-C5HWYPPN.mjs +2 -0
- package/dist/methods-CHNMFVFV.js +2 -0
- package/dist/methods-CHNMFVFV.js.map +1 -0
- package/dist/models.js.map +1 -1
- package/dist/returns.d.mts +1 -1
- package/dist/returns.d.ts +1 -1
- package/dist/returns.js +1 -1
- package/dist/returns.js.map +1 -1
- package/dist/returns.mjs +1 -1
- package/dist/{types-D_WnqwR_.d.mts → types-BnVWLcoB.d.mts} +1 -1
- package/dist/{types-BaqLJYuq.d.ts → types-i-IuN4Im.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/CartProvider-XWTLBIZ5.js +0 -2
- package/dist/CartProvider-XWTLBIZ5.js.map +0 -1
- package/dist/CartProvider-ZURLJNBW.mjs +0 -2
- package/dist/chunk-3IMJALBX.js.map +0 -1
- package/dist/chunk-3UHPJ6NK.js +0 -2
- package/dist/chunk-3UHPJ6NK.js.map +0 -1
- package/dist/chunk-CO2P4FR5.js +0 -2
- package/dist/chunk-CO2P4FR5.js.map +0 -1
- package/dist/chunk-E6QVQEGZ.mjs +0 -2
- package/dist/chunk-E6QVQEGZ.mjs.map +0 -1
- package/dist/chunk-FHDFLSPW.js.map +0 -1
- package/dist/chunk-KG6RU37U.js.map +0 -1
- package/dist/chunk-LZE2E4TE.mjs +0 -4
- package/dist/chunk-LZE2E4TE.mjs.map +0 -1
- package/dist/chunk-QZJGNLCZ.js +0 -2
- package/dist/chunk-QZJGNLCZ.js.map +0 -1
- package/dist/chunk-RA452LXZ.mjs +0 -2
- package/dist/chunk-RA452LXZ.mjs.map +0 -1
- package/dist/chunk-V4U2PTKN.js.map +0 -1
- package/dist/chunk-VM6JEJFZ.js.map +0 -1
- package/dist/chunk-VXB7LA4E.js.map +0 -1
- package/dist/chunk-XVQKEGPO.mjs +0 -2
- package/dist/chunk-XVQKEGPO.mjs.map +0 -1
- package/dist/methods-CYARZTYL.mjs +0 -2
- package/dist/methods-DAPEWVI6.js +0 -2
- package/dist/methods-DAPEWVI6.js.map +0 -1
- /package/dist/{CartProvider-ZURLJNBW.mjs.map → CartProvider-ONIOELW5.mjs.map} +0 -0
- /package/dist/{chunk-HKVMSMDF.mjs.map → chunk-C5Q7DGCD.mjs.map} +0 -0
- /package/dist/{chunk-LJWS6ZRJ.mjs.map → chunk-C5RMHUOG.mjs.map} +0 -0
- /package/dist/{chunk-SLLBTQTW.mjs.map → chunk-GPNALARZ.mjs.map} +0 -0
- /package/dist/{chunk-SZ256RCC.mjs.map → chunk-H3YP2QPV.mjs.map} +0 -0
- /package/dist/{chunk-GN63ITLA.mjs.map → chunk-XQ43IC4M.mjs.map} +0 -0
- /package/dist/{methods-CYARZTYL.mjs.map → methods-C5HWYPPN.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as gi,D as ye,E as lt,F as Rt,G as Dt,H as xe,a as Oe,b as zt,c as Et,d as ft,e as je,f as It,g as Me,h as qe,i as xt,j as Ja,k as tr,l as er,m as ar,n as rr,o as At,p as Pr,q as Nr,r as we,s as kt,t as ct,u as F,v as Ke,w as di,x as ui,y as bi,z as mi}from"./chunk-LZE2E4TE.mjs";import{a as Tr}from"./chunk-GN63ITLA.mjs";import{A as Sr,a as fe,b as K,c as or,d as ir,e as nr,f as sr,i as cr,k as lr,l as pr,m as dr,n as ur,o as br,p as mr,q as gr,r as hr,t as fr,u as vr,v as wr,w as yr,x as xr,y as kr,z as Cr}from"./chunk-SZ256RCC.mjs";import{a as hi,b as fi,c as vi,d as wi}from"./chunk-SLLBTQTW.mjs";import{a as He,b as Ve}from"./chunk-KOVKUJAW.mjs";import{a as Fa,b as Ha,c as Va,d as Wa,e as Ka,f as Qa,g as $a,h as Za,i as Xa,j as Ya}from"./chunk-LJWS6ZRJ.mjs";import{g as ge,h as qa,j as et,k as te,l as st,o as he,q as D,r as jt,u as Fe}from"./chunk-HKVMSMDF.mjs";import{d as r,f as Tt,g as Ma,j as We,l as ve,m as Mt}from"./chunk-RA452LXZ.mjs";import{j as Pt,k as Nt,l as ht,o as Ge}from"./chunk-XVQKEGPO.mjs";import"./chunk-E6QVQEGZ.mjs";import"./chunk-U6FLIRIV.mjs";import Qe from"apple-pay-button";function _t(){try{return lt()}catch{return}}import{useQuery as zr}from"@tanstack/react-query";import{jsx as ee}from"react/jsx-runtime";var Er=Qe.default??Qe;function Ir({style:t,buttonType:e,colorType:a,items:o,onClick:c}){let{checkIfApplePayIsAvailable:d,getApplePayPaymentRequest:i,completeApplePayPayment:w,setCountry:h,setCouponCodeIfPossible:u,setDeliveryMethod:v,setEmail:k,setPostalCode:S,clearCart:y}=Rt(),b=Nt(),{data:g}=zr({queryKey:["is-apple-pay-available"],queryFn:d});if(g!=!0)return null;let C=o.map(p=>({productID:p.id,quantity:p.quantity,metadata:p.metadata}));async function x(){let p=!1,s=n=>{p||(p=!0,b.track("apple_pay_result",{outcome:n}))};b.track("apple_pay_clicked",{}),b.track("payment_method_selected",{gateway:"apple_pay",method:"apple_pay"}),ct({event:"initiateCheckout",items:o.map(n=>({id:n.id,name:n.name,price:n.price,quantity:n.quantity,currency:"PLN"}))});let P=o.find(n=>n.isDeliverable===!0)!=null,f=new ApplePaySession(14,{countryCode:"PL",merchantCapabilities:["supports3DS"],supportedNetworks:["visa","masterCard"],currencyCode:"PLN",total:{amount:`${we(o.reduce((n,l)=>n+l.price*l.quantity,0)/100,2)}`,label:"P\u0142atno\u015B\u0107 za koszyk",type:"pending"},lineItems:[...o.map(n=>({amount:`${we(n.price*n.quantity/100,2)}`,label:n.name,type:"final"})),P?{amount:"16.99",type:"pending",label:"Dostawa"}:void 0].filter(n=>n!=null),...P?{shippingMethods:[],supportsCouponCode:!0,requiredBillingContactFields:["name","email","postalAddress","phone"],requiredShippingContactFields:["name","email","postalAddress","phone"]}:{}});await c?.();let O=await i({expectedItems:C});if(F(O)){console.error("Error creating ApplePaySession:",O.error),s("fail");return}f.oncancel=n=>{console.log("ApplePaySession cancelled",n),s("cancel")},f.onvalidatemerchant=async n=>{try{let l=await Oe.get(Tt).applePayValidateMerchant({validationUrl:n.validationURL,projectId:lt()});console.log("merchantSession",l.merchantSession),l.merchantSession.length>0?(console.log("completing merchant session"),f.completeMerchantValidation(JSON.parse(l.merchantSession))):f.abort()}catch{f.abort}},f.onshippingmethodselected=async n=>{console.log("shipping method selected",n),b.track("delivery_method_selected",{method:n.shippingMethod.identifier}),await v(n.shippingMethod.identifier);let l=await i({expectedItems:C});if(console.log("apRequest",l),F(l))throw f.abort(),new Error("Failed to get Apple Pay payment request");f.completeShippingMethodSelection({newTotal:l.total,newLineItems:l.lineItems,newShippingMethods:l.shippingMethods})},f.onshippingcontactselected=async n=>{try{n.shippingContact.countryCode!=null&&await h(n.shippingContact.countryCode),n.shippingContact.postalCode!=null&&await S(n.shippingContact.postalCode),n.shippingContact.phoneNumber!=null&&await k(n.shippingContact.emailAddress);let l=await i({expectedItems:C});if(F(l))throw f.abort(),new Error("Failed to get Apple Pay payment request");console.log("apRequest",l),f.completeShippingContactSelection({newLineItems:l.lineItems,newTotal:l.total,newShippingMethods:l.shippingMethods})}catch(l){console.log("shipping contact selected error",l),f.abort()}},f.oncouponcodechanged=async n=>{try{console.log("coupon code changed",n);let l=await u(n.couponCode),N=await i({expectedItems:C});if(console.log("apRequest",N),F(N))throw f.abort(),new Error("Failed to get Apple Pay payment request");f.completeCouponCodeChange({errors:F(l)?[new ApplePayError("couponCodeInvalid")]:void 0,newTotal:N.total,newLineItems:N.lineItems,newShippingMethods:N.shippingMethods})}catch(l){console.log("coupon code changed error",l),f.abort()}},f.onpaymentauthorized=async n=>{b.track("payment_submitted",{gateway:"apple_pay",method:"apple_pay"});try{let l=await w({token:n.payment.token,billingContact:n.payment.billingContact,shippingContact:n.payment.shippingContact});if(F(l)){console.log("apple pay error",l),s("fail"),f.completePayment({status:ApplePaySession.STATUS_FAILURE});return}l.redirectURL&&setTimeout(()=>{open(l.redirectURL,"_self")},2e3),s(l.isSuccess?"success":"fail"),f.completePayment({status:l.isSuccess?ApplePaySession.STATUS_SUCCESS:ApplePaySession.STATUS_FAILURE}),l.isSuccess&&y()}catch{s("fail"),f.completePayment({status:ApplePaySession.STATUS_FAILURE})}},f.begin()}return ee(Er,{style:t,buttonStyle:a,type:e,onClick:x})}function Ar(t){let e=ht(_t(),t.analytics,"cart");return ee(Pt,{value:e,children:ee(Dt,{children:ee(Ir,{...t})})})}var ke=Ar;import{useEffect as Ht}from"react";import Z from"zod";import{useAutoAnimate as mo}from"@formkit/auto-animate/react";import{createPortal as go}from"react-dom";import{createContext as Br,useContext as Or,useMemo as Gr}from"react";var Rr=["root","overlay","panel","header","title","closeButton","productList","product","productImage","productName","productPrice","quantityControl","quantityInput","quantityButton","removeButton","summary","totalLabel","totalValue","deliveryText","countryLabel","countryTrigger","countryDropdown","countrySearch","countryOption","paymentButtons","checkoutButton","emptyState","error","skeleton"],Dr={fontFamily:"--bitsnap-checkout-font-family",fontSize:"--bitsnap-checkout-font-size",background:"--bitsnap-checkout-background",surface:"--bitsnap-checkout-surface",foreground:"--bitsnap-checkout-foreground",mutedForeground:"--bitsnap-checkout-muted-foreground",border:"--bitsnap-checkout-border",buttonBackground:"--bitsnap-checkout-button-background",buttonForeground:"--bitsnap-checkout-button-foreground",buttonHoverBackground:"--bitsnap-checkout-button-hover-background",hoverSurface:"--bitsnap-checkout-hover-surface",focusRing:"--bitsnap-checkout-focus-ring",error:"--bitsnap-checkout-error",overlay:"--bitsnap-checkout-overlay",radius:"--bitsnap-checkout-radius"},_r={dark:{},light:{background:"#ffffff",surface:"#f9fafb",foreground:"#18181b",mutedForeground:"#71717a",border:"#e4e4e7",buttonBackground:"#18181b",buttonForeground:"#fafafa",buttonHoverBackground:"#000000",hoverSurface:"#e4e4e7",focusRing:"#71717a",error:"#dc2626",overlay:"rgb(0 0 0 / 0.35)"}},Lr=[{token:"background",variable:"--background"},{token:"foreground",variable:"--foreground"},{token:"surface",variable:"--card"},{token:"surface",variable:"--popover"},{token:"foreground",variable:"--popover-foreground"},{token:"mutedForeground",variable:"--muted-foreground"},{token:"border",variable:"--border"},{token:"border",variable:"--input"},{token:"focusRing",variable:"--ring"},{token:"error",variable:"--destructive"},{token:"radius",variable:"--radius"}];function Ur(t){return{"--popover":t.surface??"var(--color-neutral-800)","--popover-foreground":t.foreground??"var(--color-neutral-200)"}}function Ce(t){let e=He(t,{defaultTheme:"dark",presets:_r,variables:Dr,shadcnVariables:Lr});return{theme:e.theme,isCustomized:e.isCustomized,tokens:e.tokens,elements:e.elements,boundaryClassName:e.theme,boundaryStyle:e.boundaryStyle,dropdownStyle:Ur(e.tokens)}}function $e(t,e){return Ve(t.elements,e)}import{jsx as jr}from"react/jsx-runtime";var Ze=Br(Ce());function Xe({appearance:t,children:e}){let a=Gr(()=>Ce(t),[t]);return jr(Ze.Provider,{value:a,children:e})}function qt(){return Or(Ze)}function T(t){let e=qt();return $e(e,t)??{}}import{useAutoAnimate as po}from"@formkit/auto-animate/react";import ut from"react";import{useEffect as Wr,useState as Kr}from"react";import*as I from"@radix-ui/react-select";import{CheckIcon as Mr,ChevronDownIcon as Ye,ChevronUpIcon as qr}from"lucide-react";import{jsx as V,jsxs as Se}from"react/jsx-runtime";function Je({...t}){return V(I.Root,{"data-slot":"select",...t})}function ta({...t}){return V(I.Value,{"data-slot":"select-value",...t})}var Fr="border-input dark:bg-input/30 dark:hover:bg-input/50 bg-transparent";function ea({className:t,size:e="default",theme:a="default",children:o,...c}){return Se(I.Trigger,{"data-slot":"select-trigger","data-size":e,className:r("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a==="bare"?"":Fr,t),...c,children:[o,V(I.Icon,{asChild:!0,children:V(Ye,{className:"size-4 opacity-50"})})]})}function aa({className:t,children:e,position:a="popper",align:o="center",...c}){return V(I.Portal,{children:Se(I.Content,{"data-slot":"select-content",className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,align:o,...c,children:[V(Hr,{}),V(I.Viewport,{className:r("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),V(Vr,{})]})})}function ra({className:t,children:e,...a}){return Se(I.Item,{"data-slot":"select-item",className:r("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[V("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:V(I.ItemIndicator,{children:V(Mr,{className:"size-4"})})}),V(I.ItemText,{children:e})]})}function Hr({className:t,...e}){return V(I.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",t),...e,children:V(qr,{className:"size-4"})})}function Vr({className:t,...e}){return V(I.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",t),...e,children:V(Ye,{className:"size-4"})})}import{jsx as pt,jsxs as ae}from"react/jsx-runtime";function Qr({id:t,open:e,disabled:a=!1,onToggle:o,onChange:c,selectedValue:d,countries:i}){let[w,h]=Kr(""),{isCustomized:u,boundaryClassName:v,boundaryStyle:k,dropdownStyle:S}=qt(),y=T("countryTrigger"),b=T("countryDropdown"),g=T("countrySearch"),C=T("countryOption");Wr(()=>{d==null&&i.length>0&&c(i[0].code)},[]);let x=i.filter(s=>s.name.toLowerCase().startsWith(w.toLowerCase())),p=i.find(s=>s.code===d);return ae(Je,{value:d,onValueChange:s=>{c(s),h("")},open:e,onOpenChange:s=>{s!==e&&o(),s||h("")},disabled:a,children:[pt(ea,{"data-bitsnap-checkout-slot":"countryTrigger",theme:"bare",className:r(a?"bg-neutral-100 dark:bg-neutral-800 dark:border-neutral-700":"","w-full rounded-md",y.className),style:y.style,children:pt(ta,{children:p&&ae("span",{className:"truncate flex items-center",children:[pt("img",{alt:d,src:`https://purecatamphetamine.github.io/country-flag-icons/3x2/${d}.svg`,className:"inline mr-2 h-4 rounded-sm"}),p.name]})})}),ae(aa,{"data-bitsnap-checkout":u?"dropdown":void 0,"data-bitsnap-checkout-slot":u?"countryDropdown":void 0,className:r(u?"bitsnap-react":"",v,"w-full max-h-80 max-w-[350px] z-[999999]",b.className),style:{...u?{...k,...S}:void 0,...b.style},position:"popper",children:[pt("div",{"data-bitsnap-checkout-slot":"countrySearch",className:r("sticky top-0 z-10 p-1 border-b",g.className),style:g.style,children:pt("input",{type:"search",name:"search",autoComplete:"off",className:"block w-full outline-none sm:text-body-regular bg-transparent rounded-md px-2 py-1.5",placeholder:"Znajd\u017A kraj",value:w,onChange:s=>h(s.target.value),onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation()})}),pt("div",{className:"max-h-64 overflow-y-auto",children:x.length===0?pt("div",{className:"cursor-default select-none relative py-2 pl-3 pr-9 text-sm",children:"No countries found"}):x.map(s=>ae(ra,{"data-bitsnap-checkout-slot":"countryOption",value:s.code,className:r("cursor-default select-none relative py-2 pl-3 pr-9 flex items-center transition",C.className),style:C.style,children:[pt("img",{alt:s.code,src:`https://purecatamphetamine.github.io/country-flag-icons/3x2/${s.code}.svg`,className:"inline mr-2 h-4 rounded-sm"}),pt("span",{className:"font-normal truncate",children:s.name})]},`${t}-${s.code}`))})]})]})}var oa=Qr;import{useEffect as to,useState as sa}from"react";import{MinusIcon as eo,PlusIcon as ao}from"lucide-react";import{Slot as nn}from"@radix-ui/react-slot";import{cva as $r}from"class-variance-authority";import{jsx as Xr}from"react/jsx-runtime";var Zr=$r("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function ia({className:t,orientation:e,...a}){return Xr("div",{role:"group","data-slot":"button-group","data-orientation":e,className:r(Zr({orientation:e}),t),...a})}import{Fragment as Yr,jsx as re,jsxs as Jr}from"react/jsx-runtime";function na({price:t,currency:e,pricing:a,quantity:o=1}){let c=a?.regularPrice??t,d=a?.effectivePrice??t,i=a?.discount?.status==="ACTIVE"&&d<c;return re("span",{children:i?Jr(Yr,{children:[re("span",{className:"mr-2 text-neutral-500 line-through",children:kt(c*o,e)}),re("span",{className:"font-semibold text-red-700",children:kt(d*o,e)}),re("span",{className:"mt-1 block text-xs text-neutral-600",children:a?.referencePrice.historyAvailable&&a.referencePrice.amount!=null?`Najni\u017Csza cena z 30 dni: ${kt(a.referencePrice.amount,e)}`:"Brak danych o cenie z ostatnich 30 dni"})]}):kt(d*o,e)})}import{jsx as Y,jsxs as oe}from"react/jsx-runtime";var ro=({isNotAvailable:t,quantity:e,details:a,shouldUpdate:o})=>{let c=T("product"),d=T("productImage"),i=T("productName"),w=T("productPrice"),h=T("removeButton");return oe("div",{"data-bitsnap-checkout-slot":"product","data-bitsnap-checkout-unavailable":t?"":void 0,className:r("flex items-center gap-3 mx-3",t?"outline outline-1 rounded-md m-1":"",c.className),style:c.style,children:[Y("img",{"data-bitsnap-checkout-slot":"productImage",className:r("aspect-auto max-w-[30%] max-w-32 max-h-32 py-2 overflow-hidden",d.className),style:d.style,src:a.image_url??"",alt:a.name}),oe("div",{className:"flex flex-col w-full",children:[Y("p",{"data-bitsnap-checkout-slot":"productName",className:r("font-medium",i.className),style:i.style,children:a.name}),Y("p",{"data-bitsnap-checkout-slot":"productPrice",className:r("text-sm",w.className),style:w.style,suppressHydrationWarning:!0,children:Y(na,{price:a.price,currency:a.currency,pricing:a.pricing,quantity:e})}),oe("div",{className:"flex justify-between",children:[Y(oo,{className:"",quantity:e,shouldUpdate:o}),Y(D,{"data-bitsnap-checkout-slot":"removeButton",variant:"ghost",size:"sm",className:h.className,style:h.style,onClick:()=>o(0),children:"Usu\u0144"})]})]})]})},ca=ro,oo=({quantity:t,shouldUpdate:e,className:a})=>{let[o,c]=sa(t.toString()),[d,i]=sa(t),w=T("quantityControl"),h=T("quantityInput"),u=T("quantityButton");to(()=>{e(d)},[d]);function v(y){if(c(y),y.length==0)return;let b=parseInt(y);if(isNaN(b)){i(1),c("");return}if(b==0||b<0){i(1),c("1");return}i(b),c(b.toString())}function k(){i(t+1),c((t+1).toString())}function S(){if(t>1){c((t-1).toString()),i(t-1);return}c(t.toString()),i(t)}return Y("div",{"data-bitsnap-checkout-slot":"quantityControl",className:r("flex",a,w.className),style:w.style,children:oe(ia,{"aria-label":"Ilo\u015B\u0107",children:[Y(D,{"data-bitsnap-checkout-slot":"quantityButton",className:u.className,style:u.style,onClick:S,children:Y(eo,{})}),Y("input",{"data-bitsnap-checkout-slot":"quantityInput",className:r("w-8 bg-transparent text-center",h.className),style:h.style,value:o,onInput:y=>{v(y.currentTarget.value)},type:"text"}),Y(D,{"data-bitsnap-checkout-slot":"quantityButton",className:u.className,style:u.style,onClick:k,children:Y(ao,{})})]})})};import{jsx as io}from"react/jsx-runtime";function Pe({className:t,...e}){return io("div",{"data-slot":"skeleton",className:"bg-neutral-700 animate-pulse rounded-md "+t,...e})}import{useMutation as Ft,useQuery as ie}from"@tanstack/react-query";import{createContext as no,useContext as so,useMemo as co}from"react";import{jsx as lo}from"react/jsx-runtime";var la=no({});function pa({texts:t,locale:e,children:a}){let o=co(()=>({texts:t,locale:e}),[t,e]);return lo(la.Provider,{value:o,children:a})}function dt(t){let{texts:e,locale:a}=so(la);return We(t,a??Mt(),e)}import{Fragment as bo,jsx as U,jsxs as vt}from"react/jsx-runtime";var uo=({className:t,locale:e})=>{let a=Rt(),o=Nt(),c=e??Mt(),d=T("productList"),i=T("summary"),w=T("totalLabel"),h=T("totalValue"),u=T("deliveryText"),v=T("countryLabel"),k=T("paymentButtons"),S=T("checkoutButton"),y=T("emptyState"),b=T("error"),g=T("skeleton"),C=dt("unavailableProducts"),x=dt("emptyCart"),p=dt("total"),s=dt("delivery"),P=dt("chooseCountry"),f=dt("nextStep"),{mutateAsync:O}=Ft({mutationFn:a.removeProductFromCart}),{mutateAsync:n}=Ft({mutationFn:a.updateQuantity}),{mutateAsync:l}=Ft({mutationFn:a.setCountry}),{mutateAsync:N}=Ft({mutationFn:a.clearCart}),[z,H]=ut.useState(""),[M,G]=ut.useState([]),[q,de]=ut.useState(!1),{mutateAsync:ue,isPending:Zt}=Ft({mutationFn:a.redirectToNextStep}),{data:Xt}=ie({queryKey:["cart-available-countries"],queryFn:a.getAvailableCountries}),{data:Yt}=ie({queryKey:["cart-one-click-payment"],queryFn:a.checkIfApplePayIsAvailable}),{data:Bt,isLoading:L,refetch:j}=ie({queryKey:["cart",c],queryFn:a.getProducts}),{data:$,refetch:Da}=ie({queryKey:["cart-country"],queryFn:a.getCountry}),[_a]=po(),B=F(Bt)?void 0:Bt,be=F(Xt)?[]:Xt,Ot=B?.reduce((m,R)=>R.details==null?m:m+(R.details.pricing?.effectivePrice??R.details.price)*R.quantity,0)??0,Gt=B?.[0]?.details?.currency??"PLN",La=B?.some(m=>m.details?.isDeliverable===!0)??!1,_e=$!=null&&!F($)&&$!=""?$:void 0,Le=ut.useRef(!1);ut.useEffect(()=>{Le.current||L||(Le.current=!0,o.track("cart_opened",{item_count:B?.reduce((m,R)=>m+R.quantity,0)??0,value_minor:Ot,currency:Gt}))},[L,o,B,Ot,Gt]);let me=ut.useRef(new Map);ut.useEffect(()=>{me.current.clear()},[B]);function Ua(m,R){let tt=B?.find(ja=>ja.id===m);if(tt?.details==null)return;let Jt=R-(me.current.get(m)??tt.quantity);if(me.current.set(m,R),Jt===0)return;let Ga=tt.details.pricing?.effectivePrice??tt.details.price,Be=tt.catalogProductID??tt.productID;o.track(Jt>0?"add_to_cart":"remove_from_cart",{qty:Math.abs(Jt),value_minor:Math.round(Ga*Math.abs(Jt)),currency:tt.details.currency},{product_id:Be,variant_id:Be!==tt.productID?tt.productID:null})}let Ue=ut.useRef(!1);async function Ba(m,R){if(R!=null){if(Ua(m,Math.max(0,R)),R<=0){await O({id:m}),await j();return}await n({id:m,quantity:R}),await j();return}}async function Oa(){try{if(H(""),B!=null){!Ue.current&&B.length>0&&(Ue.current=!0,o.track("checkout_started",{item_count:B.reduce((R,tt)=>R+tt.quantity,0),checkout_type:"cart",value_minor:Ot,currency:Gt}));try{ct({event:"initiateCheckout",items:B?.map(R=>({id:R.productID,name:R.details?.name??"",price:R.details?.price??0,quantity:R.quantity,currency:R.details?.currency??"PLN"}))})}catch{}}let m=await ue();if(F(m)){m.error=="item-ids-not-found"?(H(C),"data"in m&&Array.isArray(m.data)&&G(m.data)):H(`${m.error}`);return}await N(),window.location.href=m.url}catch(m){H(`${m}`)}}return vt("div",{className:`${t} flex flex-col`,ref:_a,children:[L&&vt("div",{className:"relative flex w-full justify-center flex-col gap-4",children:[U(Pe,{"data-bitsnap-checkout-slot":"skeleton",className:r("w-full h-32",g.className),style:g.style}),U(Pe,{"data-bitsnap-checkout-slot":"skeleton",className:r("w-full h-32",g.className),style:g.style})]}),!L&&(B==null||B.length==0)&&U("div",{className:"flex flex-col gap-4 p-4",children:U("p",{"data-bitsnap-checkout-slot":"emptyState",className:r(y.className),style:y.style,children:x})}),U("div",{"data-bitsnap-checkout-slot":"productList",className:r("max-h-[70vh] overflow-clip overflow-y-scroll",d.className),style:d.style,children:B!=null&&B.length>0&&U("ul",{className:"mt-5",children:B.map(m=>U(ut.Fragment,{children:m.details!=null&&vt("li",{className:"mb-3",children:[U(ca,{isNotAvailable:M.includes(m.productID),quantity:m.quantity,details:m.details,shouldUpdate:R=>{Ba(m.id,R).then().catch()}}),U("hr",{className:"h-1"})]})},m.id))})}),U("div",{className:"grow"}),Ot>0&&Gt!=null&&vt(bo,{children:[U("div",{"data-bitsnap-checkout-slot":"summary",className:r("mx-3 flex flex-col",i.className),style:i.style,children:vt("div",{className:"flex flex-row justify-between text-lg",children:[U("p",{"data-bitsnap-checkout-slot":"totalLabel",className:r("text-xl",w.className),style:w.style,children:p}),vt("div",{className:"flex flex-col items-end",children:[U("p",{"data-bitsnap-checkout-slot":"totalValue",className:r("font-medium",h.className),style:h.style,children:kt(Ot,Gt)}),La&&U("p",{"data-bitsnap-checkout-slot":"deliveryText",className:r("opacity-70 text-right text-base",u.className),style:u.style,children:s})]})]})}),be&&be?.length>1&&vt("div",{children:[U("h4",{"data-bitsnap-checkout-slot":"countryLabel",className:r("ml-3 text-sm",v.className),style:v.style,children:P}),U(oa,{id:Math.random().toString(),open:q,onToggle:()=>{de(!q)},onChange:m=>{l(m).then(()=>{Da().then().catch()})},selectedValue:_e??"",countries:be})]}),vt("div",{className:"mb-3 flex flex-col",children:[Yt&&B!=null&&B.length>0&&U("div",{"data-bitsnap-checkout-slot":"paymentButtons",className:r("w-full px-2",k.className),style:k.style,children:U(ke,{colorType:"white",style:{width:"100%"},items:B?.map(m=>({name:m.details?.name??"",id:m.productID,price:m.details?.pricing?.effectivePrice??m.details?.price??0,quantity:m.quantity,isDeliverable:m.details?.isDeliverable??!1,metadata:m.metadata}))})}),B!=null&&B.length>0&&U("div",{"data-bitsnap-checkout-slot":"paymentButtons",className:r("w-full px-2",k.className),style:k.style,children:U(Ne,{buttonSizeMode:"fill",buttonColor:"white",style:{width:"100%"},items:B?.map(m=>({name:m.details?.name??"",id:m.productID,price:m.details?.pricing?.effectivePrice??m.details?.price??0,quantity:m.quantity,isDeliverable:m.details?.isDeliverable??!1,metadata:m.metadata}))})}),U("button",{"data-bitsnap-checkout-slot":"checkoutButton",onClick:Oa,disabled:L||Zt||_e==null,className:r("px-3 py-2 my-2 mx-2 rounded-md disabled:opacity-40 disabled:cursor-not-allowed transition font-bold",S.className),style:S.style,children:Zt?U(K,{}):f}),z.length>0&&U("p",{"data-bitsnap-checkout-slot":"error",className:r("text-sm text-center",b.className),style:b.style,children:z})]})]})]})},da=uo;import{Fragment as vo,jsx as at,jsxs as ne}from"react/jsx-runtime";function ho({isVisible:t,shouldHide:e,locale:a}){let[o]=mo(),{boundaryClassName:c,boundaryStyle:d}=qt(),i=T("root"),w=T("overlay"),h=T("panel"),u=T("header"),v=T("title"),k=T("closeButton"),S=dt("cart");return at("div",{ref:o,"data-bitsnap-checkout":"root","data-bitsnap-checkout-slot":"root",className:r("bitsnap-react",c,i.className),style:{zIndex:999999,...d,...i.style},children:t&&ne(vo,{children:[at("div",{"data-bitsnap-checkout-slot":"overlay",className:r("fixed top-0 right-0 left-0 bottom-0 cursor-pointer z-10",w.className),style:w.style,onClick:e}),ne("div",{"data-bitsnap-checkout-slot":"panel",className:r("fixed z-20 top-0 right-0 bottom-0 w-full md:w-[350px] xl:w-[420px] flex flex-col",h.className),style:h.style,children:[ne("div",{"data-bitsnap-checkout-slot":"header",className:r("mx-3 mt-7 flex justify-between items-center",u.className),style:u.style,children:[at("h1",{"data-bitsnap-checkout-slot":"title",className:r("text-2xl font-medium",v.className),style:v.style,children:S}),at("button",{"data-bitsnap-checkout-slot":"closeButton",className:r("rounded-xl p-2 transition",k.className),style:k.style,onClick:e,children:ne("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-x",children:[at("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),at("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),at(da,{className:"grow",locale:a})]})]})})}var fo=t=>typeof window>"u"?null:go(at(Xe,{appearance:t.appearance,children:at(pa,{texts:t.texts,locale:t.locale,children:at(Dt,{locale:t.locale,children:at(ho,{...t})})})}),document.body),ua=fo;import{Fragment as ba,jsx as Ct,jsxs as Te}from"react/jsx-runtime";var wo=Z.object({id:Z.string(),isSubscription:Z.boolean().default(!1),quantity:Z.number(),metadata:Z.record(Z.string(),Z.string().optional()).optional()});function yo({projectID:t,locale:e,children:a,onVisibleChange:o,className:c,numberOfProductsInCartOptions:d,appearance:i,texts:w,analytics:h}){let u=ht(t,h,"cart");Ge(u);let{isCartVisible:v,showCart:k,hideCart:S,numberOfProductsInCart:y}=Ke();function b(p){document.querySelectorAll("iframe").forEach(P=>{P.contentWindow?.postMessage(p,"*")})}Ht(()=>{o?.(v),v&&ct({event:"viewCart"})},[v]),Ht(()=>{ye(t)},[t]),Ht(()=>{ve(e)},[e]),Ht(()=>{if(!("cart"in window)){let p=lt();if(p==null){console.warn("There is no project ID configured.");return}window.cart={buyProduct:async s=>{try{let P=Z.object({productID:Z.string(),email:Z.string().optional(),name:Z.string().optional(),country:Z.string().optional(),marketingAgreement:Z.boolean().optional(),locale:Z.string().optional()}).parse(s),f=xe(p);try{let n=await f.getProducts();F(n)==!1&&ct({event:"initiateCheckout",items:n.map(l=>({id:l.productID,name:l.details?.name??"",price:l.details?.price??0,quantity:l.quantity,currency:l.details?.currency??"PLN"}))})}catch{}let O=await f.justRedirectToPayment(P);console.log("result",O),F(O)==!1?window.location.href=O.url:alert("Nie uda\u0142o si\u0119 przekierowa\u0107 do p\u0142atno\u015Bci. Spr\xF3buj ponownie p\xF3\u017Aniej.")}catch(P){console.warn(P)}}}}},[]);async function g(p,s){let P=lt();if(P==null){console.warn("There is no project ID configured.");return}try{let f=wo.parse(s);if(f.isSubscription){await C(P,f);return}await xe(P).addProduct({productID:f.id,quantity:f.quantity,metadata:f.metadata}),b({id:p,type:"ADD_TO_CART",success:!0}),k()}catch(f){console.warn("cannot add item to cart",f)}}async function C(p,s){alert(`TODO, nie jest to jeszcze zrobione ${p} ${s.id} ${s.quantity}`)}function x(){"__cart_is_listening"in window||(window.__cart_is_listening=!0,window.addEventListener("message",p=>{if(typeof p.data.id<"u"&&typeof p.data.type<"u"){let{id:s,type:P}=p.data;switch(P){case"ADD_TO_CART".toString():g(s,p.data.payload).then().catch();break;default:break}}}))}return Ht(()=>{if(x(),typeof window<"u")try{let p=new URLSearchParams(window.location.search),s=p.get("ref")??p.get("utm-source");typeof localStorage<"u"&&s&&s.length>0&&localStorage.setItem("bitsnap-ref",s)}catch{return}},[]),Te(ba,{children:[Te("button",{onClick:()=>v?S():k(),style:{position:"relative"},className:["bitsnap-react",c??"rounded-full hover:bg-neutral-300 transition p-1"].join(" "),children:[a?Ct(ba,{children:a}):Te("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-shopping-cart",children:[Ct("circle",{cx:"8",cy:"21",r:"1"}),Ct("circle",{cx:"19",cy:"21",r:"1"}),Ct("path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"})]}),d?.isVisible!=!1&&y>0&&Ct("div",{style:{position:"absolute",bottom:-5,right:-5,background:"black",color:"white",borderRadius:"50%",width:"22px",height:"22px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"13px",fontWeight:600,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.25)",...d?.style},children:y})]}),Ct(Pt,{value:u,children:Ct(ua,{isVisible:v,locale:e,appearance:i,texts:w,shouldHide:()=>{S()}})})]})}var xo=yo;import ko from"@google-pay/button-react";import{useQuery as Co,useMutation as So}from"@tanstack/react-query";import{Fragment as To,jsx as Vt,jsxs as zo}from"react/jsx-runtime";function Po({items:t,style:e,buttonColor:a,buttonSizeMode:o,test:c}){let{getGooglePayConfiguration:d,completeGooglePayPayment:i,setCountry:w,setCouponCodeIfPossible:h,setDeliveryMethod:u,setEmail:v,setPostalCode:k,clearCart:S}=Rt(),y=Nt(),{data:b}=Co({queryKey:["get-google-pay-configuration",t.map(x=>x.id).join(",")],queryFn:()=>d({items:t.map(x=>({...x,id:void 0,productID:x.id}))})}),{mutateAsync:g,isPending:C}=So({mutationFn:i});return b==null||b.isAvailable!=!0?(console.log("google pay configuration is not available",b),null):zo(To,{children:[Vt(ko,{buttonSizeMode:o,buttonColor:a,style:e,existingPaymentMethodRequired:!0,onClick:()=>y.track("payment_method_selected",{gateway:"google_pay",method:"google_pay"}),environment:c===!0?"TEST":"PRODUCTION",onPaymentDataChanged:async x=>{ct({event:"initiateCheckout",items:t.map(s=>({id:s.id,name:s.name,price:s.price,quantity:s.quantity,currency:"PLN"}))}),console.log("payment data changed",x),x.shippingAddress?.postalCode!=null&&await k(x.shippingAddress?.postalCode),x.shippingAddress?.countryCode!=null&&await w(x.shippingAddress?.countryCode),x.shippingOptionData?.id!=null&&await u(x.shippingOptionData.id);let p=await d({items:[]});return console.log("PAYMENT DATA CHANGED CONFIG",p),p.isAvailable?{error:void 0,newShippingOptionParameters:p.config.shippingOptionParameters,newTransactionInfo:p.config.transactionInfo}:{error:void 0}},paymentRequest:b.config,onLoadPaymentData:async x=>{y.track("payment_submitted",{gateway:"google_pay",method:"google_pay"});try{let p=await g({paymentData:x});if(F(p)){console.log("apple pay error",p);return}p.isSuccess&&S(),p.redirectURL&&open(p.redirectURL,"_self")}catch(p){console.warn("error completing google pay payment",p)}}}),C?Vt(K,{}):null]})}function No(t){let e=ht(_t(),t.analytics,"cart");return Vt(Pt,{value:e,children:Vt(Dt,{children:Vt(Po,{...t})})})}var Ne=No;import{useReducer as ai,useRef as ri,useEffect as $t}from"react";import{useQuery as oi}from"@tanstack/react-query";import{Settings as ii}from"lucide-react";import{Fragment as Eo,jsx as ze,jsxs as Io}from"react/jsx-runtime";var E={title:null,description:null,managingDescription:"Zarz\u0105dzaj rodzajami powiadomie\u0144 i sposobem dostarczania.",formTitle:"Podaj Email aby zapisa\u0107 si\u0119\xA0do powiadomie\u0144",formEmailLabel:"Email",formPhoneLabel:"Numer telefonu",formPhoneOptional:"(opcjonalnie)",formEmailPlaceholder:"np. mail@gmail...",formPhonePlaceholder:"np. 663...",formSubmitButton:"Zapisz si\u0119",formSuccessMessage:"Zapisa\u0142e\u015B si\u0119 do powiadomie\u0144.",agreementText:Io(Eo,{children:[ze("span",{style:{color:"red"},children:"*"}),"Wyra\u017Cam zgod\u0119 na przetwarzanie moich danych w celach marketingowych zgodnie z"," ",ze("a",{href:"/regulations/polityka-prywatnosci",target:"_blank",className:"cursor-alias font-bold hover:font-medium",children:"regulaminem"})," ",ze("span",{className:"text-xs font-light",children:"(zgod\u0119 mo\u017Cna w ka\u017Cdej chwili wycofa\u0107)"})]}),qrCodeTitle:"lub zainstaluj aplikacj\u0119 mobiln\u0105",qrCodeSubtitle:"Aplikacja mobilna",qrCodeScanText:"zeskanuj kod QR",groupsNoSelectionWarning:"Je\u015Bli \u017Cadna z grup nie jest zaznaczona, nie otrzymasz \u017Cadnych powiadomie\u0144.",groupsSelectAllButton:"Zaznacz wszystkie",groupsUpdateButton:"Aktualizuj",groupsUpdateSuccess:"Zaktualizowano pomy\u015Blnie.",groupsTitle:"Zarz\u0105dzaj grupami z kt\xF3rych chcesz otrzymywa\u0107 powiadomienia",manageDataTitle:"Ustawienia powiadomie\u0144",manageDataDescription:"W jaki spos\xF3b chcesz otrzymywa\u0107 powiadomienia?",manageDataUnsubscribeButton:"Odsubskrybuj",manageDataUpdatedMessage:"Zaktualizowano",manageDataUnsubscribeDescription:"Wypisz mnie z wszystkich powiadomie\u0144 i grup.",loginEmailLabel:"Email",loginEmailPlaceholder:"Wprowad\u017A sw\xF3j email",loginSendCodeButton:"Wy\u015Blij kod weryfikacyjny",loginSendingButton:"Wysy\u0142anie...",loginCodeLabel:"Wprowad\u017A kod weryfikacyjny",loginCodeSentMessage:"Wys\u0142ali\u015Bmy kod weryfikacyjny na adres",loginChangeEmailButton:"Popraw email",loginResendCodeButton:"Wy\u015Blij kod ponownie",loginInvalidEmailError:"Wprowad\u017A prawid\u0142owy adres email",loginSlugRequiredError:"Wymagany jest identyfikator projektu",loginInvalidCodeError:"Nieprawid\u0142owy kod weryfikacyjny",loginVerificationFailedError:"Weryfikacja nie powiod\u0142a si\u0119. Sprawd\u017A sw\xF3j kod.",loginSendEmailError:"Nie uda\u0142o si\u0119 wys\u0142a\u0107 kodu weryfikacyjnego",loginVerifyCodeError:"Nie uda\u0142o si\u0119 zweryfikowa\u0107 kodu",loginResendEmailError:"Nie uda\u0142o si\u0119 ponownie wys\u0142a\u0107 kodu weryfikacyjnego",loginTitle:"Wpisz email aby zarz\u0105dza\u0107 powiadomieniami",loginDescription:"Dostaniesz kod weryfikacyjny na email.",loginIHaveCode:"Mam ju\u017C kod"};import{LogOutIcon as Ao}from"lucide-react";import{Fragment as ma,jsx as St,jsxs as se}from"react/jsx-runtime";function ga({projectName:t,projectLogo:e,projectLogoDark:a,description:o,className:c,onLogout:d}){return se(ma,{children:[e!=null||t!=null&&se("h2",{className:r("flex max-w-44 items-center gap-3 text-lg font-medium text-black sm:max-w-none md:text-xl lg:text-2xl xl:text-3xl dark:text-neutral-100",c?.headerTitle),children:[e!=null&&se(ma,{children:[St("img",{src:e,alt:"",className:r("h-12 w-auto dark:hidden",c?.headerLogo)}),St("img",{src:a??e,alt:"",className:r("hidden h-12 w-auto dark:inline",c?.headerLogo)})]}),St("span",{children:t})]}),se("div",{className:"flex items-center gap-2",children:[o&&St("p",{className:r("mt-4 font-medium text-left",c?.headerDescription),children:o}),St("div",{className:"grow"}),d&&St(D,{variant:"ghost",size:"icon-sm",onClick:d,children:St(Ao,{className:"h-5 w-5"})})]})]})}import{useAutoAnimate as ya}from"@formkit/auto-animate/react";import{CheckCircleIcon as Do,TriangleAlertIcon as _o}from"lucide-react";import*as bt from"@radix-ui/react-popover";import{jsx as ce}from"react/jsx-runtime";function ha({...t}){return ce(bt.Root,{"data-slot":"popover",...t})}function fa({...t}){return ce(bt.Trigger,{"data-slot":"popover-trigger",...t})}function va({className:t,align:e="center",sideOffset:a=4,...o}){return ce(bt.Portal,{children:ce(bt.Content,{"data-slot":"popover-content",align:e,sideOffset:a,className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...o})})}import{ClockIcon as Ro}from"lucide-react";import{jsx as mt,jsxs as wt}from"react/jsx-runtime";function wa({regularity:t}){let e="";switch(t){case"rarely":e="rzadko";break;case"often":e="cz\u0119sto";break;case"very_often":e="codzienne";break}return wt(ha,{children:[mt(fa,{onClick:a=>{a.stopPropagation()},children:wt("button",{type:"button",className:"flex w-[30%] cursor-help flex-col items-center justify-center text-xs md:w-[25%] xl:w-[20%]",children:[mt(Ro,{size:12}),mt("span",{children:e})]})}),mt(va,{className:"w-80",children:wt("div",{className:"grid gap-4",children:[wt("div",{className:"space-y-2",children:[mt("h4",{className:"leading-none font-medium",children:"Co to oznacza?"}),wt("ul",{className:"list-inside list-disc text-sm",children:[wt("li",{children:[mt("span",{className:"font-semibold",children:"Rzadko"})," \u2013 powiadomienia b\u0119d\u0105 wysy\u0142ane maksymalnie kilka razy w miesi\u0105cu."]}),wt("li",{children:[mt("span",{className:"font-semibold",children:"Cz\u0119sto"})," \u2013 powiadomienia mog\u0119 by\u0107 wysy\u0142ane kilka razy w tygodniu."]}),wt("li",{children:[mt("span",{className:"font-semibold",children:"Codzienne"})," \u2013 powiadomienia b\u0119d\u0105 wysy\u0142ane nawet codziennie."]})]})]}),mt("div",{className:"grid gap-2"})]})})]})}import{Fragment as Lo,jsx as Q,jsxs as it}from"react/jsx-runtime";function le({groups:t=[],isManaging:e,onToggle:a,onCheckAll:o,onUpdate:c,isUpdating:d,wasChanged:i,isUserGroupsUpdated:w,className:h,texts:u}){let[v]=ya(),[k]=ya(),S=t.filter(g=>g.isOn===!1).length>0,y=t.filter(g=>g.isOn===!1).length>0;if(t.length<=1&&e!=!0)return null;let b=it("div",{ref:v,className:r("my-5 flex flex-col gap-3",h?.groupsList),children:[t.map(g=>it("div",{id:g.id,role:"button",className:r(g.isOn?"bg-neutral-50 hover:bg-transparent shadow-sm border-transparent dark:bg-neutral-800":"border-neutral-200 hover:bg-neutral-50 dark:hover:border-neutral-800 shadow-sm dark:border-neutral-800","active:bg-beige-300 flex w-full cursor-pointer items-center gap-3 rounded-xl border px-3 py-2 transition active:dark:bg-neutral-900",h?.groupItem),onClick:C=>{C.target instanceof HTMLButtonElement||a(g.id)},children:[Q(At,{checked:g.isOn,className:"data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-700",onCheckedChange:()=>{a(g.id)}}),it("div",{className:"flex flex-col items-start justify-start",children:[Q("p",{className:"font-medium text-sm",children:g.name}),g.description&&Q("p",{className:"text-xs font-light",children:g.description})]}),Q("div",{className:"grow"}),g.howOften&&Q(wa,{regularity:g.howOften})]},g.id)),it("div",{className:"flex gap-2",children:[e===!0&&it(Lo,{children:[it("div",{ref:k,className:"flex flex-col items-start justify-start",children:[i&&it(D,{variant:"default",size:"sm",className:"relative",disabled:d,onClick:c,children:[u?.groupsUpdateButton??E.groupsUpdateButton,d&&Q("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:Q(K,{})})]}),w&&it("p",{className:"mt-3 flex items-center gap-2 text-sm text-green-500",children:[Q(Do,{color:"var(--color-green-500",size:16})," ",u?.groupsUpdateSuccess??E.groupsUpdateSuccess]})]}),Q("div",{className:"grow"})]}),y&&Q("div",{className:"flex justify-start",children:Q(D,{className:"cursor-pointer dark:bg-neutral-700",onClick:o,size:"sm",variant:"secondary",type:"button",children:u?.groupsSelectAllButton??E.groupsSelectAllButton})})]}),S&&it("div",{className:"flex text-left gap-2 text-xs text-yellow-500",children:[Q(_o,{color:"orange",size:16}),u?.groupsNoSelectionWarning??E.groupsNoSelectionWarning]})]});return e==!0?it(zt,{className:"mt-5 text-left",children:[Q(Et,{children:Q(ft,{children:u?.groupsTitle??E.groupsTitle})}),Q(It,{children:b})]}):b}import{jsx as yt,jsxs as Wt}from"react/jsx-runtime";function xa({showQRCode:t=!0,isManaging:e,className:a,texts:o}){let c=typeof window<"u",d=c?!!window.matchMedia?.("(prefers-color-scheme: dark)").matches:!1;function i(w){return w?window.location.href:""}return t?Wt(zt,{className:r("bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",a?.qrCodeSection),children:[yt(Et,{children:Wt(ft,{className:r("mb-3 text-base font-medium lg:text-lg",a?.qrCodeTitle),children:[o?.qrCodeSubtitle??E.qrCodeSubtitle," "+(o?.qrCodeTitle??E.qrCodeTitle)]})}),Wt(It,{className:"flex flex-col items-center gap-2",children:[Wt("div",{className:"mt-1.5 mb-3 flex items-center gap-x-2",children:[yt("a",{href:"https://apps.apple.com/us/app/bitsnap/id6741902807",target:"_blank",className:"max-w-28 flex-1 basis-1/2 lg:max-w-36",children:yt("img",{className:"h-auto w-full",src:Tt+"/app-store-logo.png",alt:"Download on App Store"})}),yt("a",{href:"https://play.google.com/store/apps/details?id=com.bitsnap.Bitsnap&pli=1",target:"_blank",className:"max-w-28 flex-1 basis-1/2 lg:max-w-36",children:yt("img",{className:"h-auto w-full",src:Tt+"/google-play-logo.png",alt:"Get in on Google Play"})})]}),c&&yt("div",{className:"flex items-center justify-center",children:Wt("div",{className:r("flex min-w-[40%] flex-col items-center gap-2 rounded-xl bg-white p-2 dark:bg-neutral-900",a?.qrCodeContainer),children:[yt("img",{className:"mt-3 w-[80%] p-1 pt-3",src:Tt+`/api/qr-gen?url=${i(c)}&bgColor=${d?"171717":"F6F4F0"}&textColor=${d?"ffffff":"000000"}&margin=0`}),yt("p",{className:"text-xs md:text-sm",children:o?.qrCodeScanText??E.qrCodeScanText})]})})]})]}):null}import{useState as Kt}from"react";import{isValidPhoneNumber as jo}from"react-phone-number-input";import{useAutoAnimate as Uo}from"@formkit/auto-animate/react";import{Label as ka}from"@radix-ui/react-label";import{CheckCircleIcon as Bo,CircleAlertIcon as Oo,TriangleAlertIcon as Go}from"lucide-react";import{useState as Ee}from"react";import{jsx as J,jsxs as gt}from"react/jsx-runtime";function Ca({submit:t,isLoading:e,errMsg:a,emailLack:o,warnMsg:c,isSubmited:d,agreementLack:i,showPhoneInput:w=!1,agreementText:h,className:u,texts:v}){let[k,S]=Ee(""),[y,b]=Ee(""),[g,C]=Ee(!1),[x]=Uo();function p(s){s.preventDefault(),t(k,y,g)}return gt("form",{ref:x,onSubmit:p,className:r("flex flex-col gap-3 text-left",u?.formContainer),children:[gt("div",{className:"flex flex-col gap-1 text-left",children:[J(ka,{className:"text-sm",htmlFor:"bts-notifications-form-email",children:v?.formEmailLabel??E.formEmailLabel}),J(jt,{value:k,onChange:s=>{S(s.currentTarget.value)},id:"bts-notifications-form-email",className:r(o===!0?"border-red-400":""),type:"email",placeholder:v?.formEmailPlaceholder??E.formEmailPlaceholder})]}),w&>("div",{className:"flex flex-col gap-1 text-left",children:[gt(ka,{className:"text-sm",htmlFor:"bts-notifications-form-phone",children:[v?.formPhoneLabel??E.formPhoneLabel," ",J("span",{className:"text-neutral-500 dark:text-neutral-500",children:v?.formPhoneOptional??E.formPhoneOptional})]}),J(jt,{value:y,onChange:s=>{b(s.currentTarget.value)},id:"bts-notifications-form-phone",className:"",type:"tel",autoComplete:"tel",autoCorrect:"off",placeholder:v?.formPhonePlaceholder??E.formPhonePlaceholder})]}),gt("div",{className:"flex items-start gap-x-1.5",children:[J("input",{className:"cursor-pointer",id:"bts-notifications-form-marketing-consent",type:"checkbox",checked:g,onChange:()=>{C(!g)}}),J("label",{htmlFor:"bts-notifications-form-marketing-consent",className:r("cursor-pointer text-xs leading-4 transition-colors md:text-sm md:leading-4",i===!0?"text-yellow-700":""),children:h})]}),a.length>0&>("p",{className:"mb-3 flex items-center gap-1 text-sm text-red-400",children:[J(Go,{color:"#ff6467",size:16})," ",a]}),c.length>0&>("p",{className:"mb-3 flex items-center gap-1 text-sm text-amber-400",children:[J(Oo,{color:"var(--color-amber-400)",size:16})," ",c]}),d==!1&&J("div",{className:"flex justify-start",children:gt(D,{variant:"default",disabled:e,className:r(e?"cursor-not-allowed text-transparent":"","relative"),children:[v?.formSubmitButton??E.formSubmitButton,e&&J("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:J(K,{})})]})}),d&>("div",{className:"flex items-center gap-3 text-sm text-green-400",children:[J(Bo,{size:16})," ",v?.formSuccessMessage??E.formSuccessMessage]})]})}import{jsx as Ie,jsxs as qo}from"react/jsx-runtime";var Mo=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;function Sa({groups:t,onToggle:e,onCheckAll:a,slug:o,showPhoneInput:c=!1,agreementText:d,className:i,texts:w,isUpdating:h,wasChanged:u,onSuccess:v}){let[k,S]=Kt(""),[y,b]=Kt(""),[g,C]=Kt(!1),[x,p]=Kt(!1),[s,P]=Kt(!1),{mutateAsync:f,isPending:O}=st(et.notifications.createNotificationUser);function n(z){return z==null?!1:jo(z,"PL")}async function l(z,H,M){if(S(""),b(""),P(!1),C(!1),p(!1),!M){p(!0),S("Zgoda w tym przypadku jest wymagana.");return}if(Mo.test(z)===!1){S("Email jest nieprawid\u0142owy."),P(!0);return}H.length>0&&n(H)===!1&&b("Numer telefonu mo\u017Ce by\u0107 nieprawid\u0142owy. Zapisali\u015Bmy go ale je\u015Bli jest nieprawid\u0142owy to wpisz jeszcze raz i kliknij przycisk.");try{let G=await f({slug:o,email:z,phone:H,groups:t.filter(q=>q.isOn==!0).map(q=>q.id),mobileNotificationEnabled:!0,emailNotificationEnabled:!0,smsNotificationEnabled:!0});if(G.result.case==="success"){C(!0),setTimeout(()=>{v?.(!1,G.userId,G.accessToken)},1e3);return}else{C(!0);let q=G.result.value;if(q!=null){if(q==32){v?.(!0,void 0,void 0);return}console.log(`Code error: ${ge[q]}`),S("Wyst\u0105pi\u0142 b\u0142\u0105d: "+ge[q]);return}return}}catch(G){S("Wyst\u0105pi\u0142 b\u0142\u0105d podczas zapisywania. Spr\xF3buj ponownie."),console.log(`Error: ${G}`)}}let N=w?.formTitle??E.formTitle;return qo("div",{className:r("bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",i?.formSection),children:[N.length>0&&Ie("h3",{className:r("mb-3 text-base font-medium lg:text-lg",i?.formTitle),children:N}),Ie(le,{groups:t,isManaging:!1,onToggle:e??(()=>{}),onCheckAll:a??(()=>{}),isUpdating:h??!1,wasChanged:u??!1,isUserGroupsUpdated:!1,className:i,texts:w}),Ie(Ca,{errMsg:k,emailLack:s,warnMsg:y,submit:l,isLoading:O,isSubmited:g,agreementLack:x,showPhoneInput:c,agreementText:d??w?.agreementText??E.agreementText,className:i,texts:w})]})}import{useEffect as Ko,useState as Qt}from"react";import{Label as Ae}from"@radix-ui/react-label";import{MessageCircleWarningIcon as Qo}from"lucide-react";import{useDebouncedCallback as $o}from"use-debounce";import{TriangleAlertIcon as Fo,XIcon as Ho}from"lucide-react";import{createPortal as Vo}from"react-dom";import{useEffect as Pa,useState as Wo}from"react";import{jsx as rt,jsxs as Lt}from"react/jsx-runtime";function Na({open:t,onOpenChange:e,onConfirm:a,isDeleting:o=!1}){let[c,d]=Wo(!1);if(Pa(()=>(d(!0),()=>d(!1)),[]),Pa(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),!c||!t)return null;let i=h=>{h.target===h.currentTarget&&e(!1)},w=()=>{a()};return Vo(rt("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/50 p-4",onClick:i,children:Lt("div",{className:r("relative w-full max-w-md rounded-2xl bg-white p-6 shadow-lg","dark:bg-neutral-800","animate-in fade-in-0 zoom-in-95 duration-200"),onClick:h=>h.stopPropagation(),children:[Lt("button",{onClick:()=>e(!1),className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none dark:ring-offset-neutral-950 dark:focus:ring-neutral-300",disabled:o,children:[rt(Ho,{className:"h-4 w-4"}),rt("span",{className:"sr-only",children:"Zamknij"})]}),Lt("div",{className:"flex flex-col gap-4",children:[Lt("div",{className:"flex items-start gap-3",children:[rt("div",{className:"flex-shrink-0",children:rt(Fo,{className:"h-6 w-6 text-amber-500","aria-hidden":"true"})}),rt("div",{className:"flex-1",children:rt("h2",{className:"text-lg font-semibold text-black dark:text-neutral-100",children:"Czy na pewno chcesz si\u0119 wypisa\u0107?"})})]}),rt("p",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Klikni\u0119cie tego przycisku spowoduje wypisanie z wszelkich powiadomie\u0144 i grup, kt\xF3re zapisa\u0142e\u015B."}),Lt("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[rt(D,{type:"button",variant:"ghost",onClick:()=>e(!1),disabled:o,className:"sm:min-w-[100px]",children:"Anuluj"}),Lt(D,{type:"button",variant:"destructive",onClick:w,disabled:o,className:r(o&&"cursor-not-allowed text-transparent","relative sm:min-w-[100px]"),children:["Usu\u0144",o&&rt("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:rt("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})})]})]})]})]})}),document.body)}import{useAutoAnimate as Ta}from"@formkit/auto-animate/react";import{Fragment as Zo,jsx as _,jsxs as ot}from"react/jsx-runtime";function za({accessToken:t,slug:e,userID:a,className:o,texts:c}){let[d]=Ta(),[i]=Ta(),{mutateAsync:w,isPending:h}=st(et.notifications.deleteNotificationUser),{mutateAsync:u,isPending:v}=st(et.notifications.updateNotificationUser),{data:k,isFetching:S}=te(et.notifications.getNotificationUserSettings,{userId:a,slug:e,accessToken:t}),[y,b]=Qt(!1),[g,C]=Qt(!1),[x,p]=Qt(!1),[s,P]=Qt(!1),[f,O]=Qt(!1),n=k?.result.case==="success"?k?.result?.value:void 0;function l(){O(!0)}async function N(){await w({accessToken:t,slug:e,userId:a}),O(!1)}async function z(){await u({accessToken:t,slug:e,notificationUserId:a,mobileNotificationEnabled:s,emailNotificationEnabled:y,smsNotificationEnabled:g}),p(!0),setTimeout(()=>{p(!1)},3e3)}let H=$o(G=>{z()},300);Ko(()=>{let G=k?.result.case==="success"?k?.result?.value:void 0;b(G?.emailNotificationEnabled??!1),C(G?.smsNotificationEnabled??!1),P(G?.mobileNotificationEnabled??!1)},[k]);function M(G,q){G==="email"&&b(q),G==="phone"&&C(q),G==="push"&&P(q),H(!0)}return ot("div",{className:r("bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",o?.manageDataSection),children:[_("div",{className:"flex justify-start",children:_("h3",{className:r("mb-3 text-base font-medium lg:text-lg",o?.manageDataTitle),children:c?.manageDataTitle??E.manageDataTitle})}),S?_(Fe,{className:"h-64 w-full"}):ot(zt,{ref:i,className:r(v&&"relative"),children:[_(Et,{children:_(ft,{children:_("p",{className:"text-sm text-left",children:c?.manageDataDescription??E.manageDataDescription})})}),ot(It,{ref:d,children:[_("div",{className:r(v&&"opacity-50 pointer-events-none","flex flex-col gap-2"),children:ot("div",{className:"flex flex-col items-start gap-5 gap-x-2",children:[n?.emailNotificationAvailable&&ot("div",{className:"flex items-center gap-3",children:[_(At,{id:"email-enabled",className:"data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",checked:y,onCheckedChange:()=>{M("email",!y)}}),_(Ae,{htmlFor:"email-enabled",className:"text-sm",children:"Email"})]}),n?.smsNotificationAvailable&&ot("div",{className:"flex items-center gap-3",children:[_(At,{id:"sms-enabled",className:"data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",checked:g,onCheckedChange:()=>{M("phone",!g)}}),_(Ae,{htmlFor:"sms-enabled",className:"text-sm",children:"SMS"})]}),n?.mobileNotificationAvailable&&ot(Zo,{children:[ot("div",{className:"flex items-center gap-3",children:[_(At,{id:"push-enabled",className:"data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",checked:s,onCheckedChange:()=>{M("push",!s)}}),_(Ae,{htmlFor:"push-enabled",className:"text-sm",children:"Powiadomienia na telefon"})]}),n?.hasUserInstalledApp===!1&&ot("div",{className:"flex items-center gap-3",children:[_(Qo,{color:"var(--color-amber-500)",size:26}),_("p",{className:"text-xs text-amber-500",children:"Wygl\u0105da na to, \u017Ce nie masz zainstalowanej aplikacji mobilnej. Zainstaluj i wyra\u017A zgod\u0119 na otrzymywanie powiadomie\u0144 na telefon."})]})]})]})}),ot("div",{className:"mt-5 flex flex-col gap-2 text-left",children:[_("hr",{}),x&&_("p",{className:"text-xs text-green-500",children:c?.manageDataUpdatedMessage??E.manageDataUpdatedMessage}),_("div",{className:"flex items-center gap-x-2",children:ot(D,{size:"sm",variant:"link",className:r("pl-0 ml-0",h&&"cursor-not-allowed"),onClick:l,children:[c?.manageDataUnsubscribeButton??E.manageDataUnsubscribeButton,h&&_("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:_(K,{})})]})})]})]}),v&&_("div",{className:"bg-black/30 absolute inset-0 rounded-xl",children:_("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:_(K,{})})})]}),_(Na,{open:f,onOpenChange:O,onConfirm:N,isDeleting:h})]})}import{useState as pe}from"react";import{ArrowLeft as ti}from"lucide-react";import{useAutoAnimate as Aa}from"@formkit/auto-animate/react";import*as X from"@radix-ui/react-dialog";import{XIcon as Xo}from"lucide-react";import{jsx as Ut,jsxs as Re}from"react/jsx-runtime";function Ea({...t}){return Ut(X.Root,{"data-slot":"dialog",...t})}function Yo({...t}){return Ut(X.Portal,{"data-slot":"dialog-portal",...t})}function Jo({className:t,...e}){return Ut(X.Overlay,{"data-slot":"dialog-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function Ia({className:t,children:e,showCloseButton:a=!0,...o}){return Re(Yo,{"data-slot":"dialog-portal",children:[Ut(Jo,{}),Re(X.Content,{"data-slot":"dialog-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...o,children:[e,a&&Re(X.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[Ut(Xo,{}),Ut("span",{className:"sr-only",children:"Close"})]})]})]})}import{Fragment as ei,jsx as A,jsxs as nt}from"react/jsx-runtime";function Ra({slug:t,onSuccess:e,onError:a,className:o,isOpen:c,onClose:d,texts:i}){let[w]=Aa(),[h]=Aa(),[u,v]=pe(""),[k,S]=pe(""),[y,b]=pe(!1),[g,C]=pe(null),{mutateAsync:x,isPending:p}=st(et.notifications.verifyUserEmail),s=async n=>{if(n.preventDefault(),C(null),!u||!u.includes("@")){C(i.loginInvalidEmailError??"");return}try{await x({email:u,slug:t}),b(!0)}catch(l){let N=l instanceof Error?l:new Error(i.loginSendEmailError);C(N.message),a?.(N)}},P=async n=>{if(S(n),C(null),n.length===6)try{let l=await x({email:void 0,code:n,slug:t});l.ok&&l.accessToken?e?.(l.userId,l.accessToken):(C(i.loginVerificationFailedError??""),a?.(new Error(i.loginVerificationFailedError)))}catch(l){let N=l instanceof Error?l:new Error(i.loginVerifyCodeError);if(N.message.includes("Invalid code")){C(i.loginInvalidCodeError??N.message),S("");return}C(N.message),a?.(N),S("")}},f=async()=>{if(S(""),C(null),!u||!t){C(i.loginSlugRequiredError??"");return}try{await x({email:u,slug:t})}catch(n){let l=n instanceof Error?n:new Error(i.loginResendEmailError);C(l.message),a?.(l)}},O=()=>{b(!1),S(""),C(null)};return A(Ea,{open:c,onOpenChange:d,children:A(Ia,{className:"sm:max-w-[425px] min-h-[250px]",children:nt("div",{className:"flex flex-col min-h-[250px] h-full",children:[nt("div",{ref:h,className:"flex items-start gap-2 mb-2",children:[y&&A(D,{variant:"ghost",size:"icon-sm",onClick:()=>{b(!1)},children:A(ti,{className:"h-5 w-5"})}),A("div",{children:A(ft,{children:y?i.loginCodeLabel??"":i.loginTitle??""})})]}),A(je,{className:"mb-4",children:y?nt(ei,{children:[i.loginCodeSentMessage??""," ",u]}):i.loginDescription??""}),A("div",{className:"flex-1 flex flex-col",children:y?nt("form",{onSubmit:n=>n.preventDefault(),className:"flex flex-col flex-1",children:[nt("div",{className:"space-y-2",children:[A(fe,{children:i.loginCodeLabel??""}),A(Me,{maxLength:6,value:k,onChange:P,disabled:p,children:nt(qe,{children:[A(xt,{index:0}),A(xt,{index:1}),A(xt,{index:2}),A(xt,{index:3}),A(xt,{index:4}),A(xt,{index:5})]})}),p&&A(K,{})]}),g&&A("div",{className:"text-sm text-destructive mt-2 mb-1",role:"alert",children:g}),A("div",{className:"grow"}),nt("div",{className:"flex flex-col items-start gap-2 pt-2",children:[u.length>0&&A(D,{variant:"link",size:"sm",onClick:f,disabled:p,className:"flex-1 ml-0 pl-0",children:i.loginResendCodeButton??""}),A(D,{variant:"link",size:"sm",onClick:O,disabled:p,className:"flex-1 ml-0 pl-0",children:i.loginChangeEmailButton??""})]})]}):nt("form",{onSubmit:s,className:"flex flex-col flex-1",children:[nt("div",{className:"space-y-2",children:[A(fe,{htmlFor:"email",children:i.loginEmailLabel??""}),A(jt,{id:"email",type:"email",placeholder:i.loginEmailPlaceholder??"",value:u,onChange:n=>v(n.target.value),required:!0,disabled:p,"aria-invalid":g?"true":"false"})]}),g&&A("div",{className:"text-sm text-destructive mt-2 mb-1",role:"alert",children:g}),A("div",{className:"grow"}),nt("div",{className:"flex flex-col items-start gap-0 pt-2",children:[A(D,{type:"submit",size:"sm",disabled:p,children:p?i.loginSendingButton??"":i.loginSendCodeButton??""}),A(D,{type:"button",variant:"link",className:"ml-0 pl-0",size:"sm",onClick:()=>{b(!0)},children:i.loginIHaveCode??""})]})]})})]})})})}import{useAutoAnimate as ni}from"@formkit/auto-animate/react";import{jsx as W,jsxs as De}from"react/jsx-runtime";function si(t,e){switch(e.type){case"SET_IS_LOGGED_IN":return{...t,isLoggedIn:e.value};case"SET_USER_ID":return{...t,userID:e.value};case"SET_LOADING":return{...t,isLoading:e.value};case"SET_PUBLIC_GROUPS":return{...t,groupsProvided:e.value,groups:e.value!=null&&e.value.length>0?t.groups.filter(a=>e.value?.find(o=>o.id===a.id)!=null):t.groups};case"SET_GROUPS":{let a=t.isLoggedIn==!1||t.groupsProvided!=null,o=e.value.map(c=>t.isLoggedIn==!0?c:{...c,isOn:t.groupsProvided?.find(d=>d.id===c.id)?.isOn??a});return{...t,groups:o}}case"TOGGLE_GROUP":{let a=t.groups.map(o=>o.id===e.groupID?{...o,isOn:!o.isOn}:o);return{...t,wasChanged:!0,groups:a}}case"CHECK_ALL_GROUPS":{let a=t.groups.map(o=>({...o,isOn:!0}));return{...t,groups:a,wasChanged:!0}}case"SET_WAS_CHANGED":return{...t,wasChanged:e.value};case"SET_IS_USER_GROUPS_UPDATED":return{...t,isUserGroupsUpdated:e.value};case"RESET_UPDATE_STATE":return{...t,wasChanged:!1,isUserGroupsUpdated:!0};case"SHOW_SETTINGS":return{...t,showSettings:!0};case"HIDE_SETTINGS":return{...t,showSettings:!1};default:return t}}function ci({slug:t,userID:e,productID:a,projectID:o,analytics:c,projectName:d,projectLogo:i,projectLogoDark:w,groups:h,isManaging:u=!1,texts:v,showQRCode:k=!1,showPhoneInput:S=!1,hiddenGroupIds:y=[],className:b}){let[g]=ni(),C=ht(o??_t(),c),x=t??lt()??(typeof window<"u"?window.location.hostname:""),{mutateAsync:p,isPending:s}=st(et.notifications.updateUserGroups),{data:P,refetch:f}=oi({queryKey:["notifications_accessToken"],queryFn:()=>{if(typeof window<"u")return{accessToken:localStorage.getItem("notifications_accessToken")??void 0,userID:localStorage.getItem("notifications_userID")??void 0}}}),{data:O,isPending:n,refetch:l}=te(et.notifications.getUserGroups,{slug:x,accessToken:P?.accessToken}),[N,z]=ai(si,{isLoading:n,isUserGroupsUpdated:!1,wasChanged:!1,groupsProvided:h,groups:[],showSettings:P!=null&&u==!0,isLoggedIn:P!=null,userID:void 0});$t(()=>{z({type:"SET_LOADING",value:s||n})},[s,n]),$t(()=>{z({type:"SET_IS_LOGGED_IN",value:P?.accessToken!=null}),z({type:"SET_USER_ID",value:P?.userID}),P?.accessToken!=null&&u==!0&&z({type:"SHOW_SETTINGS"})},[P,u]),$t(()=>{if(O==null)return;let L=O.groups.map(j=>{let $="rarely";switch(j.howOften){case 0:$="rarely";break;case 1:$="often";break;case 2:$="veryOften";break}return{id:j.id,name:j.name,description:j.description,howOften:$,isOn:j.isOn??void 0}});z({type:"SET_GROUPS",value:L})},[O,n,h]);let H=ri(null);$t(()=>{let L=h?.map(j=>(j.id.startsWith("group_")||(j.id=`group_${j.id}`),j));z({type:"SET_PUBLIC_GROUPS",value:L})},[h]);let M={...E,...v};async function G(){await p({accessToken:P?.accessToken,slug:x,userId:e,groupIds:N.groups.filter(L=>L.isOn===!0).map(L=>L.id)}),z({type:"RESET_UPDATE_STATE"}),H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{z({type:"SET_IS_USER_GROUPS_UPDATED",value:!1})},2e3)}function q(L){z({type:"TOGGLE_GROUP",groupID:L})}function de(){z({type:"CHECK_ALL_GROUPS"})}function ue(){z({type:"SHOW_SETTINGS"})}function Zt(){z({type:"HIDE_SETTINGS"})}function Xt(){localStorage.removeItem("notifications_accessToken"),localStorage.removeItem("notifications_userID"),f(),z({type:"SET_USER_ID",value:void 0}),z({type:"SET_IS_LOGGED_IN",value:!1}),z({type:"HIDE_SETTINGS"})}async function Yt(L,j){typeof window<"u"&&(localStorage.setItem("notifications_accessToken",j),L!=null&&localStorage.setItem("notifications_userID",L)),z({type:"SET_USER_ID",value:L});try{await f(),l().then().catch().finally(()=>{u==!0&&z({type:"SHOW_SETTINGS"})})}catch($){console.log(`Error: ${$}`)}}$t(()=>()=>{H.current&&clearTimeout(H.current)},[]);let Bt=u==!0&&N.userID!=null&&P?.accessToken!=null;return De("main",{className:r("bitsnap-react relative",b?.container),children:[M.title!=null&&W("h1",{className:"text-2xl font-semibold text-black md:text-3xl lg:text-4xl xl:text-5xl dark:text-neutral-100",children:M.title}),!N.showSettings&&u&&W(D,{onClick:ue,variant:"outline",size:"icon",className:"absolute bottom-6 right-6 z-50 h-12 w-12 rounded-full shadow-lg hover:shadow-xl md:bottom-8 md:right-8","aria-label":"Settings",children:W(ii,{className:"h-5 w-5"})}),W("div",{className:r("md:pt8 relative z-0 mt-6 overflow-hidden rounded-2xl bg-white px-3 pt-6 pb-3 md:px-5 md:pb-5 dark:bg-neutral-800",b?.header),children:N.showSettings?W("div",{className:"space-y-6",children:N.isLoggedIn&&De("div",{className:r("grid grid-cols-1 gap-3 lg:gap-6",Bt?"md:grid-cols-2":""),children:[De("div",{className:b?.groupsContainer,children:[W(ga,{projectName:d,projectLogo:i,projectLogoDark:w,description:M.managingDescription,className:b,onLogout:Xt}),n&&W("div",{className:"flex justify-center items-center py-8",children:W(K,{})}),W(le,{groups:N.groups,hiddenGroupIds:y,isManaging:u,onToggle:q,onCheckAll:de,onUpdate:G,isUpdating:s,wasChanged:N.wasChanged,isUserGroupsUpdated:N.isUserGroupsUpdated,className:b,texts:M})]}),Bt&&W(za,{accessToken:P.accessToken??"",slug:x,userID:N.userID??"",className:b,texts:M}),k!=!1&&W(xa,{showQRCode:k,isManaging:!0,className:b,texts:M})]})}):W("div",{className:r("grid grid-cols-1 gap-3 lg:gap-6"),children:W(Sa,{slug:x,onToggle:L=>{z({type:"TOGGLE_GROUP",groupID:L})},onCheckAll:()=>{z({type:"CHECK_ALL_GROUPS"})},onSuccess:(L,j,$)=>{C.track("availability_signup",{},{product_id:a??null}),$!=null&&Yt(j,$),L&&z({type:"SHOW_SETTINGS"})},groups:N.groups,showPhoneInput:S,agreementText:M.agreementText,className:b,texts:M,wasChanged:N.wasChanged,isUpdating:s})})}),W(Ra,{isOpen:N.showSettings&&!N.isLoggedIn,slug:x,onSuccess:Yt,texts:M,onClose:Zt})]})}function li({slug:t,userID:e,productID:a,projectID:o,analytics:c,projectName:d,projectLogo:i,projectLogoDark:w,groups:h,isManaging:u,texts:v,showQRCode:k,showPhoneInput:S,hiddenGroupIds:y,className:b}){return W(he,{children:W(ci,{slug:t,userID:e,productID:a,projectID:o,analytics:c,projectName:d,projectLogo:i,projectLogoDark:w,groups:h,isManaging:u,texts:v,showQRCode:k,showPhoneInput:S,hiddenGroupIds:y,className:b})})}var pi=li;export{ke as ApplePayButton,di as Bitsnap,xo as BitsnapCheckout,Tr as BitsnapReturns,pr as BitsnapReturnsProvider,Rr as CHECKOUT_SLOT_NAMES,qa as Environment,Ne as GooglePayButton,pi as NotificationsComponent,hi as PRODUCT_LIST_SLOT_NAMES,Nr as Panel,rr as PanelLogin,Xa as PanelProvider,wi as ProductList,Pr as PublicOrderPage,or as RETURNS_SLOT_NAMES,ir as ReturnsAppearanceProvider,vr as ReturnsCodeStep,xr as ReturnsConfirmation,fr as ReturnsEmailStep,Sr as ReturnsMyReturnDetail,Cr as ReturnsMyReturnsList,yr as ReturnsOrderDetail,wr as ReturnsOrderList,lr as ReturnsProvider,kr as ReturnsResult,ar as buildAccessTokenRedirect,bi as createCheckout,ui as createPaymentURL,fi as formatProductPrice,Za as getAllowedReturnOrigins,Mt as getLocale,Ha as getPanelConfig,mi as getReferenceIfPossible,Ja as getReturnURLFromSearch,gi as injectReferenceToRequestIfNeeded,tr as persistReturnURL,er as readPersistedReturnURL,$a as setAllowedReturnOrigins,Ma as setCustomHost,Qa as setHost,ve as setLocale,Ka as setLoginURL,Fa as setPanelConfig,Va as setPanelProjectID,ye as setProjectID,Wa as setTheme,mr as useCreateReturn,hr as useMyReturn,gr as useMyReturns,Ya as usePanelConfig,vi as useProducts,ur as useReturnOrders,dr as useReturnSession,br as useReturnableOrder,nr as useReturnsAppearance,sr as useReturnsSlot,cr as useReturnsText};
|
|
1
|
+
import{A as fi,B as vi,C as wi,F as ke,G as lt,H as Dt,I as _t,J as Ce,a as Me,b as zt,c as Et,d as ft,e as Fe,f as It,g as He,h as Ve,i as xt,j as or,k as ir,l as nr,m as sr,n as cr,o as At,p as Ir,q as Ar,r as xe,s as kt,t as ct,u as F,v as Rr,w as $e,x as Ze,y as gi,z as hi}from"./chunk-HG4YOJWE.mjs";import{a as Dr}from"./chunk-XQ43IC4M.mjs";import{A as Er,a as ve,b as W,c as lr,d as pr,e as dr,f as ur,i as br,k as mr,l as gr,m as hr,n as fr,o as vr,p as wr,q as yr,r as xr,t as kr,u as Cr,v as Sr,w as Pr,x as Nr,y as Tr,z as zr}from"./chunk-H3YP2QPV.mjs";import{a as yi,b as xi,c as ki,d as Ci}from"./chunk-GPNALARZ.mjs";import{a as Ke,b as Qe}from"./chunk-KOVKUJAW.mjs";import{a as Qa,b as $a,c as Za,d as Xa,e as Ya,f as Ja,g as tr,h as er,i as ar,j as rr}from"./chunk-C5RMHUOG.mjs";import{g as he,h as Ka,j as et,k as ee,l as st,o as fe,q as D,r as Mt,u as We}from"./chunk-C5Q7DGCD.mjs";import{d as r,f as Tt,g as Wa,j as we,l as ye,m as Rt}from"./chunk-EZWH6BB2.mjs";import{l as Pt,m as Nt,n as ht,q as qe}from"./chunk-T57337WD.mjs";import"./chunk-ADYVTMGH.mjs";import"./chunk-U6FLIRIV.mjs";import Xe from"apple-pay-button";function Lt(){try{return lt()}catch{return}}import{useQuery as _r}from"@tanstack/react-query";import{jsx as ae}from"react/jsx-runtime";var Lr=Xe.default??Xe;function Ur({style:t,buttonType:e,colorType:a,items:o,onClick:c}){let{checkIfApplePayIsAvailable:d,getApplePayPaymentRequest:i,completeApplePayPayment:w,setCountry:h,setCouponCodeIfPossible:u,setDeliveryMethod:v,setEmail:k,setPostalCode:S,clearCart:x}=Dt(),b=Nt(),{data:g}=_r({queryKey:["is-apple-pay-available"],queryFn:d});if(g!=!0)return null;let C=o.map(p=>({productID:p.id,quantity:p.quantity,metadata:p.metadata}));async function y(){let p=!1,s=n=>{p||(p=!0,b.track("apple_pay_result",{outcome:n}))};b.track("apple_pay_clicked",{}),b.track("payment_method_selected",{gateway:"apple_pay",method:"apple_pay"}),ct({event:"initiateCheckout",items:o.map(n=>({id:n.id,name:n.name,price:n.price,quantity:n.quantity,currency:"PLN"}))});let P=o.find(n=>n.isDeliverable===!0)!=null,f=new ApplePaySession(14,{countryCode:"PL",merchantCapabilities:["supports3DS"],supportedNetworks:["visa","masterCard"],currencyCode:"PLN",total:{amount:`${xe(o.reduce((n,l)=>n+l.price*l.quantity,0)/100,2)}`,label:"P\u0142atno\u015B\u0107 za koszyk",type:"pending"},lineItems:[...o.map(n=>({amount:`${xe(n.price*n.quantity/100,2)}`,label:n.name,type:"final"})),P?{amount:"16.99",type:"pending",label:"Dostawa"}:void 0].filter(n=>n!=null),...P?{shippingMethods:[],supportsCouponCode:!0,requiredBillingContactFields:["name","email","postalAddress","phone"],requiredShippingContactFields:["name","email","postalAddress","phone"]}:{}});await c?.();let B=await i({expectedItems:C});if(F(B)){console.error("Error creating ApplePaySession:",B.error),s("fail");return}f.oncancel=n=>{console.log("ApplePaySession cancelled",n),s("cancel")},f.onvalidatemerchant=async n=>{try{let l=await Me.get(Tt).applePayValidateMerchant({validationUrl:n.validationURL,projectId:lt()});console.log("merchantSession",l.merchantSession),l.merchantSession.length>0?(console.log("completing merchant session"),f.completeMerchantValidation(JSON.parse(l.merchantSession))):f.abort()}catch{f.abort}},f.onshippingmethodselected=async n=>{console.log("shipping method selected",n),b.track("delivery_method_selected",{method:n.shippingMethod.identifier}),await v(n.shippingMethod.identifier);let l=await i({expectedItems:C});if(console.log("apRequest",l),F(l))throw f.abort(),new Error("Failed to get Apple Pay payment request");f.completeShippingMethodSelection({newTotal:l.total,newLineItems:l.lineItems,newShippingMethods:l.shippingMethods})},f.onshippingcontactselected=async n=>{try{n.shippingContact.countryCode!=null&&await h(n.shippingContact.countryCode),n.shippingContact.postalCode!=null&&await S(n.shippingContact.postalCode),n.shippingContact.phoneNumber!=null&&await k(n.shippingContact.emailAddress);let l=await i({expectedItems:C});if(F(l))throw f.abort(),new Error("Failed to get Apple Pay payment request");console.log("apRequest",l),f.completeShippingContactSelection({newLineItems:l.lineItems,newTotal:l.total,newShippingMethods:l.shippingMethods})}catch(l){console.log("shipping contact selected error",l),f.abort()}},f.oncouponcodechanged=async n=>{try{console.log("coupon code changed",n);let l=await u(n.couponCode),N=await i({expectedItems:C});if(console.log("apRequest",N),F(N))throw f.abort(),new Error("Failed to get Apple Pay payment request");f.completeCouponCodeChange({errors:F(l)?[new ApplePayError("couponCodeInvalid")]:void 0,newTotal:N.total,newLineItems:N.lineItems,newShippingMethods:N.shippingMethods})}catch(l){console.log("coupon code changed error",l),f.abort()}},f.onpaymentauthorized=async n=>{b.track("payment_submitted",{gateway:"apple_pay",method:"apple_pay"});try{let l=await w({token:n.payment.token,billingContact:n.payment.billingContact,shippingContact:n.payment.shippingContact});if(F(l)){console.log("apple pay error",l),s("fail"),f.completePayment({status:ApplePaySession.STATUS_FAILURE});return}l.redirectURL&&setTimeout(()=>{open(l.redirectURL,"_self")},2e3),s(l.isSuccess?"success":"fail"),f.completePayment({status:l.isSuccess?ApplePaySession.STATUS_SUCCESS:ApplePaySession.STATUS_FAILURE}),l.isSuccess&&x()}catch{s("fail"),f.completePayment({status:ApplePaySession.STATUS_FAILURE})}},f.begin()}return ae(Lr,{style:t,buttonStyle:a,type:e,onClick:y})}function Br(t){let e=ht(Lt(),t.analytics,"cart");return ae(Pt,{value:e,children:ae(_t,{children:ae(Ur,{...t})})})}var Se=Br;import{useEffect as Ht}from"react";import $ from"zod";import{useAutoAnimate as vo}from"@formkit/auto-animate/react";import{createPortal as wo}from"react-dom";import{createContext as Fr,useContext as Hr,useMemo as Vr}from"react";var Or=["root","overlay","panel","header","title","closeButton","productList","product","productImage","productName","productPrice","quantityControl","quantityInput","quantityButton","removeButton","summary","totalLabel","totalValue","deliveryText","countryLabel","countryTrigger","countryDropdown","countrySearch","countryOption","paymentButtons","checkoutButton","emptyState","error","skeleton"],Gr={fontFamily:"--bitsnap-checkout-font-family",fontSize:"--bitsnap-checkout-font-size",background:"--bitsnap-checkout-background",surface:"--bitsnap-checkout-surface",foreground:"--bitsnap-checkout-foreground",mutedForeground:"--bitsnap-checkout-muted-foreground",border:"--bitsnap-checkout-border",buttonBackground:"--bitsnap-checkout-button-background",buttonForeground:"--bitsnap-checkout-button-foreground",buttonHoverBackground:"--bitsnap-checkout-button-hover-background",hoverSurface:"--bitsnap-checkout-hover-surface",focusRing:"--bitsnap-checkout-focus-ring",error:"--bitsnap-checkout-error",overlay:"--bitsnap-checkout-overlay",radius:"--bitsnap-checkout-radius"},jr={dark:{},light:{background:"#ffffff",surface:"#f9fafb",foreground:"#18181b",mutedForeground:"#71717a",border:"#e4e4e7",buttonBackground:"#18181b",buttonForeground:"#fafafa",buttonHoverBackground:"#000000",hoverSurface:"#e4e4e7",focusRing:"#71717a",error:"#dc2626",overlay:"rgb(0 0 0 / 0.35)"}},Mr=[{token:"background",variable:"--background"},{token:"foreground",variable:"--foreground"},{token:"surface",variable:"--card"},{token:"surface",variable:"--popover"},{token:"foreground",variable:"--popover-foreground"},{token:"mutedForeground",variable:"--muted-foreground"},{token:"border",variable:"--border"},{token:"border",variable:"--input"},{token:"focusRing",variable:"--ring"},{token:"error",variable:"--destructive"},{token:"radius",variable:"--radius"}];function qr(t){return{"--popover":t.surface??"var(--color-neutral-800)","--popover-foreground":t.foreground??"var(--color-neutral-200)"}}function Pe(t){let e=Ke(t,{defaultTheme:"dark",presets:jr,variables:Gr,shadcnVariables:Mr});return{theme:e.theme,isCustomized:e.isCustomized,tokens:e.tokens,elements:e.elements,boundaryClassName:e.theme,boundaryStyle:e.boundaryStyle,dropdownStyle:qr(e.tokens)}}function Ye(t,e){return Qe(t.elements,e)}import{jsx as Wr}from"react/jsx-runtime";var Je=Fr(Pe());function ta({appearance:t,children:e}){let a=Vr(()=>Pe(t),[t]);return Wr(Je.Provider,{value:a,children:e})}function qt(){return Hr(Je)}function T(t){let e=qt();return Ye(e,t)??{}}import{useAutoAnimate as go}from"@formkit/auto-animate/react";import ut from"react";import{useEffect as Yr,useState as Jr}from"react";import*as I from"@radix-ui/react-select";import{CheckIcon as Kr,ChevronDownIcon as ea,ChevronUpIcon as Qr}from"lucide-react";import{jsx as H,jsxs as Ne}from"react/jsx-runtime";function aa({...t}){return H(I.Root,{"data-slot":"select",...t})}function ra({...t}){return H(I.Value,{"data-slot":"select-value",...t})}var $r="border-input dark:bg-input/30 dark:hover:bg-input/50 bg-transparent";function oa({className:t,size:e="default",theme:a="default",children:o,...c}){return Ne(I.Trigger,{"data-slot":"select-trigger","data-size":e,className:r("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a==="bare"?"":$r,t),...c,children:[o,H(I.Icon,{asChild:!0,children:H(ea,{className:"size-4 opacity-50"})})]})}function ia({className:t,children:e,position:a="popper",align:o="center",...c}){return H(I.Portal,{children:Ne(I.Content,{"data-slot":"select-content",className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,align:o,...c,children:[H(Zr,{}),H(I.Viewport,{className:r("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),H(Xr,{})]})})}function na({className:t,children:e,...a}){return Ne(I.Item,{"data-slot":"select-item",className:r("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[H("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:H(I.ItemIndicator,{children:H(Kr,{className:"size-4"})})}),H(I.ItemText,{children:e})]})}function Zr({className:t,...e}){return H(I.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:r("flex cursor-default items-center justify-center py-1",t),...e,children:H(Qr,{className:"size-4"})})}function Xr({className:t,...e}){return H(I.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:r("flex cursor-default items-center justify-center py-1",t),...e,children:H(ea,{className:"size-4"})})}import{jsx as pt,jsxs as re}from"react/jsx-runtime";function to({id:t,open:e,disabled:a=!1,onToggle:o,onChange:c,selectedValue:d,countries:i}){let[w,h]=Jr(""),{isCustomized:u,boundaryClassName:v,boundaryStyle:k,dropdownStyle:S}=qt(),x=T("countryTrigger"),b=T("countryDropdown"),g=T("countrySearch"),C=T("countryOption");Yr(()=>{d==null&&i.length>0&&c(i[0].code)},[]);let y=i.filter(s=>s.name.toLowerCase().startsWith(w.toLowerCase())),p=i.find(s=>s.code===d);return re(aa,{value:d,onValueChange:s=>{c(s),h("")},open:e,onOpenChange:s=>{s!==e&&o(),s||h("")},disabled:a,children:[pt(oa,{"data-bitsnap-checkout-slot":"countryTrigger",theme:"bare",className:r(a?"bg-neutral-100 dark:bg-neutral-800 dark:border-neutral-700":"","w-full rounded-md",x.className),style:x.style,children:pt(ra,{children:p&&re("span",{className:"truncate flex items-center",children:[pt("img",{alt:d,src:`https://purecatamphetamine.github.io/country-flag-icons/3x2/${d}.svg`,className:"inline mr-2 h-4 rounded-sm"}),p.name]})})}),re(ia,{"data-bitsnap-checkout":u?"dropdown":void 0,"data-bitsnap-checkout-slot":u?"countryDropdown":void 0,className:r(u?"bitsnap-react":"",v,"w-full max-h-80 max-w-[350px] z-[999999]",b.className),style:{...u?{...k,...S}:void 0,...b.style},position:"popper",children:[pt("div",{"data-bitsnap-checkout-slot":"countrySearch",className:r("sticky top-0 z-10 p-1 border-b",g.className),style:g.style,children:pt("input",{type:"search",name:"search",autoComplete:"off",className:"block w-full outline-none sm:text-body-regular bg-transparent rounded-md px-2 py-1.5",placeholder:"Znajd\u017A kraj",value:w,onChange:s=>h(s.target.value),onClick:s=>s.stopPropagation(),onKeyDown:s=>s.stopPropagation()})}),pt("div",{className:"max-h-64 overflow-y-auto",children:y.length===0?pt("div",{className:"cursor-default select-none relative py-2 pl-3 pr-9 text-sm",children:"No countries found"}):y.map(s=>re(na,{"data-bitsnap-checkout-slot":"countryOption",value:s.code,className:r("cursor-default select-none relative py-2 pl-3 pr-9 flex items-center transition",C.className),style:C.style,children:[pt("img",{alt:s.code,src:`https://purecatamphetamine.github.io/country-flag-icons/3x2/${s.code}.svg`,className:"inline mr-2 h-4 rounded-sm"}),pt("span",{className:"font-normal truncate",children:s.name})]},`${t}-${s.code}`))})]})]})}var sa=to;import{useEffect as no,useState as pa}from"react";import{MinusIcon as so,PlusIcon as co}from"lucide-react";import{Slot as pn}from"@radix-ui/react-slot";import{cva as eo}from"class-variance-authority";import{jsx as ro}from"react/jsx-runtime";var ao=eo("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function ca({className:t,orientation:e,...a}){return ro("div",{role:"group","data-slot":"button-group","data-orientation":e,className:r(ao({orientation:e}),t),...a})}import{Fragment as oo,jsx as oe,jsxs as io}from"react/jsx-runtime";function la({price:t,currency:e,pricing:a,quantity:o=1}){let c=a?.regularPrice??t,d=a?.effectivePrice??t,i=a?.discount?.status==="ACTIVE"&&d<c;return oe("span",{children:i?io(oo,{children:[oe("span",{className:"mr-2 text-neutral-500 line-through",children:kt(c*o,e)}),oe("span",{className:"font-semibold text-red-700",children:kt(d*o,e)}),oe("span",{className:"mt-1 block text-xs text-neutral-600",children:a?.referencePrice.historyAvailable&&a.referencePrice.amount!=null?`Najni\u017Csza cena z 30 dni: ${kt(a.referencePrice.amount,e)}`:"Brak danych o cenie z ostatnich 30 dni"})]}):kt(d*o,e)})}import{jsx as Y,jsxs as ie}from"react/jsx-runtime";var lo=({isNotAvailable:t,quantity:e,details:a,shouldUpdate:o})=>{let c=T("product"),d=T("productImage"),i=T("productName"),w=T("productPrice"),h=T("removeButton");return ie("div",{"data-bitsnap-checkout-slot":"product","data-bitsnap-checkout-unavailable":t?"":void 0,className:r("flex items-center gap-3 mx-3",t?"outline outline-1 rounded-md m-1":"",c.className),style:c.style,children:[Y("img",{"data-bitsnap-checkout-slot":"productImage",className:r("aspect-auto max-w-[30%] max-w-32 max-h-32 py-2 overflow-hidden",d.className),style:d.style,src:a.image_url??"",alt:a.name}),ie("div",{className:"flex flex-col w-full",children:[Y("p",{"data-bitsnap-checkout-slot":"productName",className:r("font-medium",i.className),style:i.style,children:a.name}),Y("p",{"data-bitsnap-checkout-slot":"productPrice",className:r("text-sm",w.className),style:w.style,suppressHydrationWarning:!0,children:Y(la,{price:a.price,currency:a.currency,pricing:a.pricing,quantity:e})}),ie("div",{className:"flex justify-between",children:[Y(po,{className:"",quantity:e,shouldUpdate:o}),Y(D,{"data-bitsnap-checkout-slot":"removeButton",variant:"ghost",size:"sm",className:h.className,style:h.style,onClick:()=>o(0),children:"Usu\u0144"})]})]})]})},da=lo,po=({quantity:t,shouldUpdate:e,className:a})=>{let[o,c]=pa(t.toString()),[d,i]=pa(t),w=T("quantityControl"),h=T("quantityInput"),u=T("quantityButton");no(()=>{e(d)},[d]);function v(x){if(c(x),x.length==0)return;let b=parseInt(x);if(isNaN(b)){i(1),c("");return}if(b==0||b<0){i(1),c("1");return}i(b),c(b.toString())}function k(){i(t+1),c((t+1).toString())}function S(){if(t>1){c((t-1).toString()),i(t-1);return}c(t.toString()),i(t)}return Y("div",{"data-bitsnap-checkout-slot":"quantityControl",className:r("flex",a,w.className),style:w.style,children:ie(ca,{"aria-label":"Ilo\u015B\u0107",children:[Y(D,{"data-bitsnap-checkout-slot":"quantityButton",className:u.className,style:u.style,onClick:S,children:Y(so,{})}),Y("input",{"data-bitsnap-checkout-slot":"quantityInput",className:r("w-8 bg-transparent text-center",h.className),style:h.style,value:o,onInput:x=>{v(x.currentTarget.value)},type:"text"}),Y(D,{"data-bitsnap-checkout-slot":"quantityButton",className:u.className,style:u.style,onClick:k,children:Y(co,{})})]})})};import{jsx as uo}from"react/jsx-runtime";function Te({className:t,...e}){return uo("div",{"data-slot":"skeleton",className:"bg-neutral-700 animate-pulse rounded-md "+t,...e})}import{useMutation as Ft,useQuery as ne}from"@tanstack/react-query";import{createContext as bo,useContext as ua,useMemo as ba}from"react";import{jsx as mo}from"react/jsx-runtime";var ze=bo({});function ma({texts:t,locale:e,children:a}){let o=ba(()=>({texts:t,locale:e}),[t,e]);return mo(ze.Provider,{value:o,children:a})}function dt(t){let{texts:e,locale:a}=ua(ze);return we(t,a??Rt(),e)}function ga(){let{texts:t,locale:e}=ua(ze),a=e??Rt();return ba(()=>o=>we(o,a,t),[a,t])}import{Fragment as fo,jsx as L,jsxs as vt}from"react/jsx-runtime";var ho=({className:t,locale:e})=>{let a=Dt(),o=Nt(),c=e??Rt(),d=T("productList"),i=T("summary"),w=T("totalLabel"),h=T("totalValue"),u=T("deliveryText"),v=T("countryLabel"),k=T("paymentButtons"),S=T("checkoutButton"),x=T("emptyState"),b=T("error"),g=T("skeleton"),C=dt("unavailableProducts"),y=ga(),p=dt("emptyCart"),s=dt("total"),P=dt("delivery"),f=dt("chooseCountry"),B=dt("nextStep"),{mutateAsync:n}=Ft({mutationFn:a.removeProductFromCart}),{mutateAsync:l}=Ft({mutationFn:a.updateQuantity}),{mutateAsync:N}=Ft({mutationFn:a.setCountry}),{mutateAsync:z}=Ft({mutationFn:a.clearCart}),[Q,j]=ut.useState(""),[O,q]=ut.useState([]),[Zt,ue]=ut.useState(!1),{mutateAsync:be,isPending:Xt}=Ft({mutationFn:a.redirectToNextStep}),{data:Ot}=ne({queryKey:["cart-available-countries"],queryFn:a.getAvailableCountries}),{data:Yt}=ne({queryKey:["cart-one-click-payment"],queryFn:a.checkIfApplePayIsAvailable}),{data:M,isLoading:G,refetch:X}=ne({queryKey:["cart",c],queryFn:a.getProducts}),{data:Jt,refetch:Oa}=ne({queryKey:["cart-country"],queryFn:a.getCountry}),[Ga]=go(),U=F(M)?void 0:M,me=F(Ot)?[]:Ot,Gt=U?.reduce((m,R)=>R.details==null?m:m+(R.details.pricing?.effectivePrice??R.details.price)*R.quantity,0)??0,jt=U?.[0]?.details?.currency??"PLN",ja=U?.some(m=>m.details?.isDeliverable===!0)??!1,Be=Jt!=null&&!F(Jt)&&Jt!=""?Jt:void 0,Oe=ut.useRef(!1);ut.useEffect(()=>{Oe.current||G||(Oe.current=!0,o.track("cart_opened",{item_count:U?.reduce((m,R)=>m+R.quantity,0)??0,value_minor:Gt,currency:jt}))},[G,o,U,Gt,jt]);let ge=ut.useRef(new Map);ut.useEffect(()=>{ge.current.clear()},[U]);function Ma(m,R){let tt=U?.find(Va=>Va.id===m);if(tt?.details==null)return;let te=R-(ge.current.get(m)??tt.quantity);if(ge.current.set(m,R),te===0)return;let Ha=tt.details.pricing?.effectivePrice??tt.details.price,je=tt.catalogProductID??tt.productID;o.track(te>0?"add_to_cart":"remove_from_cart",{qty:Math.abs(te),value_minor:Math.round(Ha*Math.abs(te)),currency:tt.details.currency},{product_id:je,variant_id:je!==tt.productID?tt.productID:null})}let Ge=ut.useRef(!1);async function qa(m,R){if(R!=null){if(Ma(m,Math.max(0,R)),R<=0){await n({id:m}),await X();return}await l({id:m,quantity:R}),await X();return}}async function Fa(){try{if(j(""),q([]),U!=null){!Ge.current&&U.length>0&&(Ge.current=!0,o.track("checkout_started",{item_count:U.reduce((R,tt)=>R+tt.quantity,0),checkout_type:"cart",value_minor:Gt,currency:jt}));try{ct({event:"initiateCheckout",items:U?.map(R=>({id:R.productID,name:R.details?.name??"",price:R.details?.price??0,quantity:R.quantity,currency:R.details?.currency??"PLN"}))})}catch{}}let m=await be();if(F(m)){m.error=="item-ids-not-found"?(j(C),"data"in m&&Array.isArray(m.data)&&q(m.data)):j($e(m,y));return}await z(),window.location.href=m.url}catch(m){console.warn("checkout failed",m),j(y("checkoutFailed"))}}return vt("div",{className:`${t} flex flex-col`,ref:Ga,children:[G&&vt("div",{className:"relative flex w-full justify-center flex-col gap-4",children:[L(Te,{"data-bitsnap-checkout-slot":"skeleton",className:r("w-full h-32",g.className),style:g.style}),L(Te,{"data-bitsnap-checkout-slot":"skeleton",className:r("w-full h-32",g.className),style:g.style})]}),!G&&(U==null||U.length==0)&&L("div",{className:"flex flex-col gap-4 p-4",children:L("p",{"data-bitsnap-checkout-slot":"emptyState",className:r(x.className),style:x.style,children:p})}),L("div",{"data-bitsnap-checkout-slot":"productList",className:r("max-h-[70vh] overflow-clip overflow-y-scroll",d.className),style:d.style,children:U!=null&&U.length>0&&L("ul",{className:"mt-5",children:U.map(m=>L(ut.Fragment,{children:m.details!=null&&vt("li",{className:"mb-3",children:[L(da,{isNotAvailable:O.includes(m.productID),quantity:m.quantity,details:m.details,shouldUpdate:R=>{qa(m.id,R).then().catch()}}),L("hr",{className:"h-1"})]})},m.id))})}),L("div",{className:"grow"}),Gt>0&&jt!=null&&vt(fo,{children:[L("div",{"data-bitsnap-checkout-slot":"summary",className:r("mx-3 flex flex-col",i.className),style:i.style,children:vt("div",{className:"flex flex-row justify-between text-lg",children:[L("p",{"data-bitsnap-checkout-slot":"totalLabel",className:r("text-xl",w.className),style:w.style,children:s}),vt("div",{className:"flex flex-col items-end",children:[L("p",{"data-bitsnap-checkout-slot":"totalValue",className:r("font-medium",h.className),style:h.style,children:kt(Gt,jt)}),ja&&L("p",{"data-bitsnap-checkout-slot":"deliveryText",className:r("opacity-70 text-right text-base",u.className),style:u.style,children:P})]})]})}),me&&me?.length>1&&vt("div",{children:[L("h4",{"data-bitsnap-checkout-slot":"countryLabel",className:r("ml-3 text-sm",v.className),style:v.style,children:f}),L(sa,{id:Math.random().toString(),open:Zt,onToggle:()=>{ue(!Zt)},onChange:m=>{N(m).then(()=>{Oa().then().catch()})},selectedValue:Be??"",countries:me})]}),vt("div",{className:"mb-3 flex flex-col",children:[Yt&&U!=null&&U.length>0&&L("div",{"data-bitsnap-checkout-slot":"paymentButtons",className:r("w-full px-2",k.className),style:k.style,children:L(Se,{colorType:"white",style:{width:"100%"},items:U?.map(m=>({name:m.details?.name??"",id:m.productID,price:m.details?.pricing?.effectivePrice??m.details?.price??0,quantity:m.quantity,isDeliverable:m.details?.isDeliverable??!1,metadata:m.metadata}))})}),U!=null&&U.length>0&&L("div",{"data-bitsnap-checkout-slot":"paymentButtons",className:r("w-full px-2",k.className),style:k.style,children:L(Ee,{buttonSizeMode:"fill",buttonColor:"white",style:{width:"100%"},items:U?.map(m=>({name:m.details?.name??"",id:m.productID,price:m.details?.pricing?.effectivePrice??m.details?.price??0,quantity:m.quantity,isDeliverable:m.details?.isDeliverable??!1,metadata:m.metadata}))})}),L("button",{"data-bitsnap-checkout-slot":"checkoutButton",onClick:Fa,disabled:G||Xt||Be==null,className:r("px-3 py-2 my-2 mx-2 rounded-md disabled:opacity-40 disabled:cursor-not-allowed transition font-bold",S.className),style:S.style,children:Xt?L(W,{}):B}),Q.length>0&&L("p",{"data-bitsnap-checkout-slot":"error",className:r("text-sm text-center",b.className),style:b.style,children:Q})]})]})]})},ha=ho;import{Fragment as ko,jsx as at,jsxs as se}from"react/jsx-runtime";function yo({isVisible:t,shouldHide:e,locale:a}){let[o]=vo(),{boundaryClassName:c,boundaryStyle:d}=qt(),i=T("root"),w=T("overlay"),h=T("panel"),u=T("header"),v=T("title"),k=T("closeButton"),S=dt("cart");return at("div",{ref:o,"data-bitsnap-checkout":"root","data-bitsnap-checkout-slot":"root",className:r("bitsnap-react",c,i.className),style:{zIndex:999999,...d,...i.style},children:t&&se(ko,{children:[at("div",{"data-bitsnap-checkout-slot":"overlay",className:r("fixed top-0 right-0 left-0 bottom-0 cursor-pointer z-10",w.className),style:w.style,onClick:e}),se("div",{"data-bitsnap-checkout-slot":"panel",className:r("fixed z-20 top-0 right-0 bottom-0 w-full md:w-[350px] xl:w-[420px] flex flex-col",h.className),style:h.style,children:[se("div",{"data-bitsnap-checkout-slot":"header",className:r("mx-3 mt-7 flex justify-between items-center",u.className),style:u.style,children:[at("h1",{"data-bitsnap-checkout-slot":"title",className:r("text-2xl font-medium",v.className),style:v.style,children:S}),at("button",{"data-bitsnap-checkout-slot":"closeButton",className:r("rounded-xl p-2 transition",k.className),style:k.style,onClick:e,children:se("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-x",children:[at("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),at("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),at(ha,{className:"grow",locale:a})]})]})})}var xo=t=>typeof window>"u"?null:wo(at(ta,{appearance:t.appearance,children:at(ma,{texts:t.texts,locale:t.locale,children:at(_t,{locale:t.locale,children:at(yo,{...t})})})}),document.body),fa=xo;import{Fragment as va,jsx as Ct,jsxs as Ie}from"react/jsx-runtime";var Co=$.object({id:$.string(),isSubscription:$.boolean().default(!1),quantity:$.number(),metadata:$.record($.string(),$.string().optional()).optional()});function So({projectID:t,locale:e,children:a,onVisibleChange:o,className:c,numberOfProductsInCartOptions:d,appearance:i,texts:w,analytics:h}){let u=ht(t,h,"cart");qe(u);let{isCartVisible:v,showCart:k,hideCart:S,numberOfProductsInCart:x}=Ze();function b(p){document.querySelectorAll("iframe").forEach(P=>{P.contentWindow?.postMessage(p,"*")})}Ht(()=>{o?.(v),v&&ct({event:"viewCart"})},[v]),Ht(()=>{ke(t)},[t]),Ht(()=>{ye(e)},[e]),Ht(()=>{if(!("cart"in window)){let p=lt();if(p==null){console.warn("There is no project ID configured.");return}window.cart={buyProduct:async s=>{try{let P=$.object({productID:$.string(),email:$.string().optional(),name:$.string().optional(),country:$.string().optional(),marketingAgreement:$.boolean().optional(),locale:$.string().optional()}).parse(s),f=Ce(p);try{let n=await f.getProducts();F(n)==!1&&ct({event:"initiateCheckout",items:n.map(l=>({id:l.productID,name:l.details?.name??"",price:l.details?.price??0,quantity:l.quantity,currency:l.details?.currency??"PLN"}))})}catch{}let B=await f.justRedirectToPayment(P);console.log("result",B),F(B)==!1?window.location.href=B.url:alert("Nie uda\u0142o si\u0119 przekierowa\u0107 do p\u0142atno\u015Bci. Spr\xF3buj ponownie p\xF3\u017Aniej.")}catch(P){console.warn(P)}}}}},[]);async function g(p,s){let P=lt();if(P==null){console.warn("There is no project ID configured.");return}try{let f=Co.parse(s);if(f.isSubscription){await C(P,f);return}await Ce(P).addProduct({productID:f.id,quantity:f.quantity,metadata:f.metadata}),b({id:p,type:"ADD_TO_CART",success:!0}),k()}catch(f){console.warn("cannot add item to cart",f)}}async function C(p,s){alert(`TODO, nie jest to jeszcze zrobione ${p} ${s.id} ${s.quantity}`)}function y(){"__cart_is_listening"in window||(window.__cart_is_listening=!0,window.addEventListener("message",p=>{if(typeof p.data.id<"u"&&typeof p.data.type<"u"){let{id:s,type:P}=p.data;switch(P){case"ADD_TO_CART".toString():g(s,p.data.payload).then().catch();break;default:break}}}))}return Ht(()=>{if(y(),typeof window<"u")try{let p=new URLSearchParams(window.location.search),s=p.get("ref")??p.get("utm-source");typeof localStorage<"u"&&s&&s.length>0&&localStorage.setItem("bitsnap-ref",s)}catch{return}},[]),Ie(va,{children:[Ie("button",{onClick:()=>v?S():k(),style:{position:"relative"},className:["bitsnap-react",c??"rounded-full hover:bg-neutral-300 transition p-1"].join(" "),children:[a?Ct(va,{children:a}):Ie("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-shopping-cart",children:[Ct("circle",{cx:"8",cy:"21",r:"1"}),Ct("circle",{cx:"19",cy:"21",r:"1"}),Ct("path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"})]}),d?.isVisible!=!1&&x>0&&Ct("div",{style:{position:"absolute",bottom:-5,right:-5,background:"black",color:"white",borderRadius:"50%",width:"22px",height:"22px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"13px",fontWeight:600,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.25)",...d?.style},children:x})]}),Ct(Pt,{value:u,children:Ct(fa,{isVisible:v,locale:e,appearance:i,texts:w,shouldHide:()=>{S()}})})]})}var Po=So;import No from"@google-pay/button-react";import{useQuery as To,useMutation as zo}from"@tanstack/react-query";import{Fragment as Ao,jsx as Vt,jsxs as Ro}from"react/jsx-runtime";function Eo({items:t,style:e,buttonColor:a,buttonSizeMode:o,test:c}){let{getGooglePayConfiguration:d,completeGooglePayPayment:i,setCountry:w,setCouponCodeIfPossible:h,setDeliveryMethod:u,setEmail:v,setPostalCode:k,clearCart:S}=Dt(),x=Nt(),{data:b}=To({queryKey:["get-google-pay-configuration",t.map(y=>y.id).join(",")],queryFn:()=>d({items:t.map(y=>({...y,id:void 0,productID:y.id}))})}),{mutateAsync:g,isPending:C}=zo({mutationFn:i});return b==null||b.isAvailable!=!0?(console.log("google pay configuration is not available",b),null):Ro(Ao,{children:[Vt(No,{buttonSizeMode:o,buttonColor:a,style:e,existingPaymentMethodRequired:!0,onClick:()=>x.track("payment_method_selected",{gateway:"google_pay",method:"google_pay"}),environment:c===!0?"TEST":"PRODUCTION",onPaymentDataChanged:async y=>{ct({event:"initiateCheckout",items:t.map(s=>({id:s.id,name:s.name,price:s.price,quantity:s.quantity,currency:"PLN"}))}),console.log("payment data changed",y),y.shippingAddress?.postalCode!=null&&await k(y.shippingAddress?.postalCode),y.shippingAddress?.countryCode!=null&&await w(y.shippingAddress?.countryCode),y.shippingOptionData?.id!=null&&await u(y.shippingOptionData.id);let p=await d({items:[]});return console.log("PAYMENT DATA CHANGED CONFIG",p),p.isAvailable?{error:void 0,newShippingOptionParameters:p.config.shippingOptionParameters,newTransactionInfo:p.config.transactionInfo}:{error:void 0}},paymentRequest:b.config,onLoadPaymentData:async y=>{x.track("payment_submitted",{gateway:"google_pay",method:"google_pay"});try{let p=await g({paymentData:y});if(F(p)){console.log("apple pay error",p);return}p.isSuccess&&S(),p.redirectURL&&open(p.redirectURL,"_self")}catch(p){console.warn("error completing google pay payment",p)}}}),C?Vt(W,{}):null]})}function Io(t){let e=ht(Lt(),t.analytics,"cart");return Vt(Pt,{value:e,children:Vt(_t,{children:Vt(Eo,{...t})})})}var Ee=Io;import{useReducer as ni,useRef as si,useEffect as $t}from"react";import{useQuery as ci}from"@tanstack/react-query";import{Settings as li}from"lucide-react";import{Fragment as Do,jsx as Ae,jsxs as _o}from"react/jsx-runtime";var E={title:null,description:null,managingDescription:"Zarz\u0105dzaj rodzajami powiadomie\u0144 i sposobem dostarczania.",formTitle:"Podaj Email aby zapisa\u0107 si\u0119\xA0do powiadomie\u0144",formEmailLabel:"Email",formPhoneLabel:"Numer telefonu",formPhoneOptional:"(opcjonalnie)",formEmailPlaceholder:"np. mail@gmail...",formPhonePlaceholder:"np. 663...",formSubmitButton:"Zapisz si\u0119",formSuccessMessage:"Zapisa\u0142e\u015B si\u0119 do powiadomie\u0144.",agreementText:_o(Do,{children:[Ae("span",{style:{color:"red"},children:"*"}),"Wyra\u017Cam zgod\u0119 na przetwarzanie moich danych w celach marketingowych zgodnie z"," ",Ae("a",{href:"/regulations/polityka-prywatnosci",target:"_blank",className:"cursor-alias font-bold hover:font-medium",children:"regulaminem"})," ",Ae("span",{className:"text-xs font-light",children:"(zgod\u0119 mo\u017Cna w ka\u017Cdej chwili wycofa\u0107)"})]}),qrCodeTitle:"lub zainstaluj aplikacj\u0119 mobiln\u0105",qrCodeSubtitle:"Aplikacja mobilna",qrCodeScanText:"zeskanuj kod QR",groupsNoSelectionWarning:"Je\u015Bli \u017Cadna z grup nie jest zaznaczona, nie otrzymasz \u017Cadnych powiadomie\u0144.",groupsSelectAllButton:"Zaznacz wszystkie",groupsUpdateButton:"Aktualizuj",groupsUpdateSuccess:"Zaktualizowano pomy\u015Blnie.",groupsTitle:"Zarz\u0105dzaj grupami z kt\xF3rych chcesz otrzymywa\u0107 powiadomienia",manageDataTitle:"Ustawienia powiadomie\u0144",manageDataDescription:"W jaki spos\xF3b chcesz otrzymywa\u0107 powiadomienia?",manageDataUnsubscribeButton:"Odsubskrybuj",manageDataUpdatedMessage:"Zaktualizowano",manageDataUnsubscribeDescription:"Wypisz mnie z wszystkich powiadomie\u0144 i grup.",loginEmailLabel:"Email",loginEmailPlaceholder:"Wprowad\u017A sw\xF3j email",loginSendCodeButton:"Wy\u015Blij kod weryfikacyjny",loginSendingButton:"Wysy\u0142anie...",loginCodeLabel:"Wprowad\u017A kod weryfikacyjny",loginCodeSentMessage:"Wys\u0142ali\u015Bmy kod weryfikacyjny na adres",loginChangeEmailButton:"Popraw email",loginResendCodeButton:"Wy\u015Blij kod ponownie",loginInvalidEmailError:"Wprowad\u017A prawid\u0142owy adres email",loginSlugRequiredError:"Wymagany jest identyfikator projektu",loginInvalidCodeError:"Nieprawid\u0142owy kod weryfikacyjny",loginVerificationFailedError:"Weryfikacja nie powiod\u0142a si\u0119. Sprawd\u017A sw\xF3j kod.",loginSendEmailError:"Nie uda\u0142o si\u0119 wys\u0142a\u0107 kodu weryfikacyjnego",loginVerifyCodeError:"Nie uda\u0142o si\u0119 zweryfikowa\u0107 kodu",loginResendEmailError:"Nie uda\u0142o si\u0119 ponownie wys\u0142a\u0107 kodu weryfikacyjnego",loginTitle:"Wpisz email aby zarz\u0105dza\u0107 powiadomieniami",loginDescription:"Dostaniesz kod weryfikacyjny na email.",loginIHaveCode:"Mam ju\u017C kod"};import{LogOutIcon as Lo}from"lucide-react";import{Fragment as wa,jsx as St,jsxs as ce}from"react/jsx-runtime";function ya({projectName:t,projectLogo:e,projectLogoDark:a,description:o,className:c,onLogout:d}){return ce(wa,{children:[e!=null||t!=null&&ce("h2",{className:r("flex max-w-44 items-center gap-3 text-lg font-medium text-black sm:max-w-none md:text-xl lg:text-2xl xl:text-3xl dark:text-neutral-100",c?.headerTitle),children:[e!=null&&ce(wa,{children:[St("img",{src:e,alt:"",className:r("h-12 w-auto dark:hidden",c?.headerLogo)}),St("img",{src:a??e,alt:"",className:r("hidden h-12 w-auto dark:inline",c?.headerLogo)})]}),St("span",{children:t})]}),ce("div",{className:"flex items-center gap-2",children:[o&&St("p",{className:r("mt-4 font-medium text-left",c?.headerDescription),children:o}),St("div",{className:"grow"}),d&&St(D,{variant:"ghost",size:"icon-sm",onClick:d,children:St(Lo,{className:"h-5 w-5"})})]})]})}import{useAutoAnimate as Pa}from"@formkit/auto-animate/react";import{CheckCircleIcon as Bo,TriangleAlertIcon as Oo}from"lucide-react";import*as bt from"@radix-ui/react-popover";import{jsx as le}from"react/jsx-runtime";function xa({...t}){return le(bt.Root,{"data-slot":"popover",...t})}function ka({...t}){return le(bt.Trigger,{"data-slot":"popover-trigger",...t})}function Ca({className:t,align:e="center",sideOffset:a=4,...o}){return le(bt.Portal,{children:le(bt.Content,{"data-slot":"popover-content",align:e,sideOffset:a,className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...o})})}import{ClockIcon as Uo}from"lucide-react";import{jsx as mt,jsxs as wt}from"react/jsx-runtime";function Sa({regularity:t}){let e="";switch(t){case"rarely":e="rzadko";break;case"often":e="cz\u0119sto";break;case"very_often":e="codzienne";break}return wt(xa,{children:[mt(ka,{onClick:a=>{a.stopPropagation()},children:wt("button",{type:"button",className:"flex w-[30%] cursor-help flex-col items-center justify-center text-xs md:w-[25%] xl:w-[20%]",children:[mt(Uo,{size:12}),mt("span",{children:e})]})}),mt(Ca,{className:"w-80",children:wt("div",{className:"grid gap-4",children:[wt("div",{className:"space-y-2",children:[mt("h4",{className:"leading-none font-medium",children:"Co to oznacza?"}),wt("ul",{className:"list-inside list-disc text-sm",children:[wt("li",{children:[mt("span",{className:"font-semibold",children:"Rzadko"})," \u2013 powiadomienia b\u0119d\u0105 wysy\u0142ane maksymalnie kilka razy w miesi\u0105cu."]}),wt("li",{children:[mt("span",{className:"font-semibold",children:"Cz\u0119sto"})," \u2013 powiadomienia mog\u0119 by\u0107 wysy\u0142ane kilka razy w tygodniu."]}),wt("li",{children:[mt("span",{className:"font-semibold",children:"Codzienne"})," \u2013 powiadomienia b\u0119d\u0105 wysy\u0142ane nawet codziennie."]})]})]}),mt("div",{className:"grid gap-2"})]})})]})}import{Fragment as Go,jsx as K,jsxs as it}from"react/jsx-runtime";function pe({groups:t=[],isManaging:e,onToggle:a,onCheckAll:o,onUpdate:c,isUpdating:d,wasChanged:i,isUserGroupsUpdated:w,className:h,texts:u}){let[v]=Pa(),[k]=Pa(),S=t.filter(g=>g.isOn===!1).length>0,x=t.filter(g=>g.isOn===!1).length>0;if(t.length<=1&&e!=!0)return null;let b=it("div",{ref:v,className:r("my-5 flex flex-col gap-3",h?.groupsList),children:[t.map(g=>it("div",{id:g.id,role:"button",className:r(g.isOn?"bg-neutral-50 hover:bg-transparent shadow-sm border-transparent dark:bg-neutral-800":"border-neutral-200 hover:bg-neutral-50 dark:hover:border-neutral-800 shadow-sm dark:border-neutral-800","active:bg-beige-300 flex w-full cursor-pointer items-center gap-3 rounded-xl border px-3 py-2 transition active:dark:bg-neutral-900",h?.groupItem),onClick:C=>{C.target instanceof HTMLButtonElement||a(g.id)},children:[K(At,{checked:g.isOn,className:"data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-700",onCheckedChange:()=>{a(g.id)}}),it("div",{className:"flex flex-col items-start justify-start",children:[K("p",{className:"font-medium text-sm",children:g.name}),g.description&&K("p",{className:"text-xs font-light",children:g.description})]}),K("div",{className:"grow"}),g.howOften&&K(Sa,{regularity:g.howOften})]},g.id)),it("div",{className:"flex gap-2",children:[e===!0&&it(Go,{children:[it("div",{ref:k,className:"flex flex-col items-start justify-start",children:[i&&it(D,{variant:"default",size:"sm",className:"relative",disabled:d,onClick:c,children:[u?.groupsUpdateButton??E.groupsUpdateButton,d&&K("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:K(W,{})})]}),w&&it("p",{className:"mt-3 flex items-center gap-2 text-sm text-green-500",children:[K(Bo,{color:"var(--color-green-500",size:16})," ",u?.groupsUpdateSuccess??E.groupsUpdateSuccess]})]}),K("div",{className:"grow"})]}),x&&K("div",{className:"flex justify-start",children:K(D,{className:"cursor-pointer dark:bg-neutral-700",onClick:o,size:"sm",variant:"secondary",type:"button",children:u?.groupsSelectAllButton??E.groupsSelectAllButton})})]}),S&&it("div",{className:"flex text-left gap-2 text-xs text-yellow-500",children:[K(Oo,{color:"orange",size:16}),u?.groupsNoSelectionWarning??E.groupsNoSelectionWarning]})]});return e==!0?it(zt,{className:"mt-5 text-left",children:[K(Et,{children:K(ft,{children:u?.groupsTitle??E.groupsTitle})}),K(It,{children:b})]}):b}import{jsx as yt,jsxs as Wt}from"react/jsx-runtime";function Na({showQRCode:t=!0,isManaging:e,className:a,texts:o}){let c=typeof window<"u",d=c?!!window.matchMedia?.("(prefers-color-scheme: dark)").matches:!1;function i(w){return w?window.location.href:""}return t?Wt(zt,{className:r("bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",a?.qrCodeSection),children:[yt(Et,{children:Wt(ft,{className:r("mb-3 text-base font-medium lg:text-lg",a?.qrCodeTitle),children:[o?.qrCodeSubtitle??E.qrCodeSubtitle," "+(o?.qrCodeTitle??E.qrCodeTitle)]})}),Wt(It,{className:"flex flex-col items-center gap-2",children:[Wt("div",{className:"mt-1.5 mb-3 flex items-center gap-x-2",children:[yt("a",{href:"https://apps.apple.com/us/app/bitsnap/id6741902807",target:"_blank",className:"max-w-28 flex-1 basis-1/2 lg:max-w-36",children:yt("img",{className:"h-auto w-full",src:Tt+"/app-store-logo.png",alt:"Download on App Store"})}),yt("a",{href:"https://play.google.com/store/apps/details?id=com.bitsnap.Bitsnap&pli=1",target:"_blank",className:"max-w-28 flex-1 basis-1/2 lg:max-w-36",children:yt("img",{className:"h-auto w-full",src:Tt+"/google-play-logo.png",alt:"Get in on Google Play"})})]}),c&&yt("div",{className:"flex items-center justify-center",children:Wt("div",{className:r("flex min-w-[40%] flex-col items-center gap-2 rounded-xl bg-white p-2 dark:bg-neutral-900",a?.qrCodeContainer),children:[yt("img",{className:"mt-3 w-[80%] p-1 pt-3",src:Tt+`/api/qr-gen?url=${i(c)}&bgColor=${d?"171717":"F6F4F0"}&textColor=${d?"ffffff":"000000"}&margin=0`}),yt("p",{className:"text-xs md:text-sm",children:o?.qrCodeScanText??E.qrCodeScanText})]})})]})]}):null}import{useState as Kt}from"react";import{isValidPhoneNumber as Ho}from"react-phone-number-input";import{useAutoAnimate as jo}from"@formkit/auto-animate/react";import{Label as Ta}from"@radix-ui/react-label";import{CheckCircleIcon as Mo,CircleAlertIcon as qo,TriangleAlertIcon as Fo}from"lucide-react";import{useState as Re}from"react";import{jsx as J,jsxs as gt}from"react/jsx-runtime";function za({submit:t,isLoading:e,errMsg:a,emailLack:o,warnMsg:c,isSubmited:d,agreementLack:i,showPhoneInput:w=!1,agreementText:h,className:u,texts:v}){let[k,S]=Re(""),[x,b]=Re(""),[g,C]=Re(!1),[y]=jo();function p(s){s.preventDefault(),t(k,x,g)}return gt("form",{ref:y,onSubmit:p,className:r("flex flex-col gap-3 text-left",u?.formContainer),children:[gt("div",{className:"flex flex-col gap-1 text-left",children:[J(Ta,{className:"text-sm",htmlFor:"bts-notifications-form-email",children:v?.formEmailLabel??E.formEmailLabel}),J(Mt,{value:k,onChange:s=>{S(s.currentTarget.value)},id:"bts-notifications-form-email",className:r(o===!0?"border-red-400":""),type:"email",placeholder:v?.formEmailPlaceholder??E.formEmailPlaceholder})]}),w&>("div",{className:"flex flex-col gap-1 text-left",children:[gt(Ta,{className:"text-sm",htmlFor:"bts-notifications-form-phone",children:[v?.formPhoneLabel??E.formPhoneLabel," ",J("span",{className:"text-neutral-500 dark:text-neutral-500",children:v?.formPhoneOptional??E.formPhoneOptional})]}),J(Mt,{value:x,onChange:s=>{b(s.currentTarget.value)},id:"bts-notifications-form-phone",className:"",type:"tel",autoComplete:"tel",autoCorrect:"off",placeholder:v?.formPhonePlaceholder??E.formPhonePlaceholder})]}),gt("div",{className:"flex items-start gap-x-1.5",children:[J("input",{className:"cursor-pointer",id:"bts-notifications-form-marketing-consent",type:"checkbox",checked:g,onChange:()=>{C(!g)}}),J("label",{htmlFor:"bts-notifications-form-marketing-consent",className:r("cursor-pointer text-xs leading-4 transition-colors md:text-sm md:leading-4",i===!0?"text-yellow-700":""),children:h})]}),a.length>0&>("p",{className:"mb-3 flex items-center gap-1 text-sm text-red-400",children:[J(Fo,{color:"#ff6467",size:16})," ",a]}),c.length>0&>("p",{className:"mb-3 flex items-center gap-1 text-sm text-amber-400",children:[J(qo,{color:"var(--color-amber-400)",size:16})," ",c]}),d==!1&&J("div",{className:"flex justify-start",children:gt(D,{variant:"default",disabled:e,className:r(e?"cursor-not-allowed text-transparent":"","relative"),children:[v?.formSubmitButton??E.formSubmitButton,e&&J("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:J(W,{})})]})}),d&>("div",{className:"flex items-center gap-3 text-sm text-green-400",children:[J(Mo,{size:16})," ",v?.formSuccessMessage??E.formSuccessMessage]})]})}import{jsx as De,jsxs as Wo}from"react/jsx-runtime";var Vo=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;function Ea({groups:t,onToggle:e,onCheckAll:a,slug:o,showPhoneInput:c=!1,agreementText:d,className:i,texts:w,isUpdating:h,wasChanged:u,onSuccess:v}){let[k,S]=Kt(""),[x,b]=Kt(""),[g,C]=Kt(!1),[y,p]=Kt(!1),[s,P]=Kt(!1),{mutateAsync:f,isPending:B}=st(et.notifications.createNotificationUser);function n(z){return z==null?!1:Ho(z,"PL")}async function l(z,Q,j){if(S(""),b(""),P(!1),C(!1),p(!1),!j){p(!0),S("Zgoda w tym przypadku jest wymagana.");return}if(Vo.test(z)===!1){S("Email jest nieprawid\u0142owy."),P(!0);return}Q.length>0&&n(Q)===!1&&b("Numer telefonu mo\u017Ce by\u0107 nieprawid\u0142owy. Zapisali\u015Bmy go ale je\u015Bli jest nieprawid\u0142owy to wpisz jeszcze raz i kliknij przycisk.");try{let O=await f({slug:o,email:z,phone:Q,groups:t.filter(q=>q.isOn==!0).map(q=>q.id),mobileNotificationEnabled:!0,emailNotificationEnabled:!0,smsNotificationEnabled:!0});if(O.result.case==="success"){C(!0),setTimeout(()=>{v?.(!1,O.userId,O.accessToken)},1e3);return}else{C(!0);let q=O.result.value;if(q!=null){if(q==32){v?.(!0,void 0,void 0);return}console.log(`Code error: ${he[q]}`),S("Wyst\u0105pi\u0142 b\u0142\u0105d: "+he[q]);return}return}}catch(O){S("Wyst\u0105pi\u0142 b\u0142\u0105d podczas zapisywania. Spr\xF3buj ponownie."),console.log(`Error: ${O}`)}}let N=w?.formTitle??E.formTitle;return Wo("div",{className:r("bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",i?.formSection),children:[N.length>0&&De("h3",{className:r("mb-3 text-base font-medium lg:text-lg",i?.formTitle),children:N}),De(pe,{groups:t,isManaging:!1,onToggle:e??(()=>{}),onCheckAll:a??(()=>{}),isUpdating:h??!1,wasChanged:u??!1,isUserGroupsUpdated:!1,className:i,texts:w}),De(za,{errMsg:k,emailLack:s,warnMsg:x,submit:l,isLoading:B,isSubmited:g,agreementLack:y,showPhoneInput:c,agreementText:d??w?.agreementText??E.agreementText,className:i,texts:w})]})}import{useEffect as Xo,useState as Qt}from"react";import{Label as _e}from"@radix-ui/react-label";import{MessageCircleWarningIcon as Yo}from"lucide-react";import{useDebouncedCallback as Jo}from"use-debounce";import{TriangleAlertIcon as Ko,XIcon as Qo}from"lucide-react";import{createPortal as $o}from"react-dom";import{useEffect as Ia,useState as Zo}from"react";import{jsx as rt,jsxs as Ut}from"react/jsx-runtime";function Aa({open:t,onOpenChange:e,onConfirm:a,isDeleting:o=!1}){let[c,d]=Zo(!1);if(Ia(()=>(d(!0),()=>d(!1)),[]),Ia(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),!c||!t)return null;let i=h=>{h.target===h.currentTarget&&e(!1)},w=()=>{a()};return $o(rt("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/50 p-4",onClick:i,children:Ut("div",{className:r("relative w-full max-w-md rounded-2xl bg-white p-6 shadow-lg","dark:bg-neutral-800","animate-in fade-in-0 zoom-in-95 duration-200"),onClick:h=>h.stopPropagation(),children:[Ut("button",{onClick:()=>e(!1),className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none dark:ring-offset-neutral-950 dark:focus:ring-neutral-300",disabled:o,children:[rt(Qo,{className:"h-4 w-4"}),rt("span",{className:"sr-only",children:"Zamknij"})]}),Ut("div",{className:"flex flex-col gap-4",children:[Ut("div",{className:"flex items-start gap-3",children:[rt("div",{className:"flex-shrink-0",children:rt(Ko,{className:"h-6 w-6 text-amber-500","aria-hidden":"true"})}),rt("div",{className:"flex-1",children:rt("h2",{className:"text-lg font-semibold text-black dark:text-neutral-100",children:"Czy na pewno chcesz si\u0119 wypisa\u0107?"})})]}),rt("p",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Klikni\u0119cie tego przycisku spowoduje wypisanie z wszelkich powiadomie\u0144 i grup, kt\xF3re zapisa\u0142e\u015B."}),Ut("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[rt(D,{type:"button",variant:"ghost",onClick:()=>e(!1),disabled:o,className:"sm:min-w-[100px]",children:"Anuluj"}),Ut(D,{type:"button",variant:"destructive",onClick:w,disabled:o,className:r(o&&"cursor-not-allowed text-transparent","relative sm:min-w-[100px]"),children:["Usu\u0144",o&&rt("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:rt("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})})]})]})]})]})}),document.body)}import{useAutoAnimate as Ra}from"@formkit/auto-animate/react";import{Fragment as ti,jsx as _,jsxs as ot}from"react/jsx-runtime";function Da({accessToken:t,slug:e,userID:a,className:o,texts:c}){let[d]=Ra(),[i]=Ra(),{mutateAsync:w,isPending:h}=st(et.notifications.deleteNotificationUser),{mutateAsync:u,isPending:v}=st(et.notifications.updateNotificationUser),{data:k,isFetching:S}=ee(et.notifications.getNotificationUserSettings,{userId:a,slug:e,accessToken:t}),[x,b]=Qt(!1),[g,C]=Qt(!1),[y,p]=Qt(!1),[s,P]=Qt(!1),[f,B]=Qt(!1),n=k?.result.case==="success"?k?.result?.value:void 0;function l(){B(!0)}async function N(){await w({accessToken:t,slug:e,userId:a}),B(!1)}async function z(){await u({accessToken:t,slug:e,notificationUserId:a,mobileNotificationEnabled:s,emailNotificationEnabled:x,smsNotificationEnabled:g}),p(!0),setTimeout(()=>{p(!1)},3e3)}let Q=Jo(O=>{z()},300);Xo(()=>{let O=k?.result.case==="success"?k?.result?.value:void 0;b(O?.emailNotificationEnabled??!1),C(O?.smsNotificationEnabled??!1),P(O?.mobileNotificationEnabled??!1)},[k]);function j(O,q){O==="email"&&b(q),O==="phone"&&C(q),O==="push"&&P(q),Q(!0)}return ot("div",{className:r("bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",o?.manageDataSection),children:[_("div",{className:"flex justify-start",children:_("h3",{className:r("mb-3 text-base font-medium lg:text-lg",o?.manageDataTitle),children:c?.manageDataTitle??E.manageDataTitle})}),S?_(We,{className:"h-64 w-full"}):ot(zt,{ref:i,className:r(v&&"relative"),children:[_(Et,{children:_(ft,{children:_("p",{className:"text-sm text-left",children:c?.manageDataDescription??E.manageDataDescription})})}),ot(It,{ref:d,children:[_("div",{className:r(v&&"opacity-50 pointer-events-none","flex flex-col gap-2"),children:ot("div",{className:"flex flex-col items-start gap-5 gap-x-2",children:[n?.emailNotificationAvailable&&ot("div",{className:"flex items-center gap-3",children:[_(At,{id:"email-enabled",className:"data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",checked:x,onCheckedChange:()=>{j("email",!x)}}),_(_e,{htmlFor:"email-enabled",className:"text-sm",children:"Email"})]}),n?.smsNotificationAvailable&&ot("div",{className:"flex items-center gap-3",children:[_(At,{id:"sms-enabled",className:"data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",checked:g,onCheckedChange:()=>{j("phone",!g)}}),_(_e,{htmlFor:"sms-enabled",className:"text-sm",children:"SMS"})]}),n?.mobileNotificationAvailable&&ot(ti,{children:[ot("div",{className:"flex items-center gap-3",children:[_(At,{id:"push-enabled",className:"data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",checked:s,onCheckedChange:()=>{j("push",!s)}}),_(_e,{htmlFor:"push-enabled",className:"text-sm",children:"Powiadomienia na telefon"})]}),n?.hasUserInstalledApp===!1&&ot("div",{className:"flex items-center gap-3",children:[_(Yo,{color:"var(--color-amber-500)",size:26}),_("p",{className:"text-xs text-amber-500",children:"Wygl\u0105da na to, \u017Ce nie masz zainstalowanej aplikacji mobilnej. Zainstaluj i wyra\u017A zgod\u0119 na otrzymywanie powiadomie\u0144 na telefon."})]})]})]})}),ot("div",{className:"mt-5 flex flex-col gap-2 text-left",children:[_("hr",{}),y&&_("p",{className:"text-xs text-green-500",children:c?.manageDataUpdatedMessage??E.manageDataUpdatedMessage}),_("div",{className:"flex items-center gap-x-2",children:ot(D,{size:"sm",variant:"link",className:r("pl-0 ml-0",h&&"cursor-not-allowed"),onClick:l,children:[c?.manageDataUnsubscribeButton??E.manageDataUnsubscribeButton,h&&_("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:_(W,{})})]})})]})]}),v&&_("div",{className:"bg-black/30 absolute inset-0 rounded-xl",children:_("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:_(W,{})})})]}),_(Aa,{open:f,onOpenChange:B,onConfirm:N,isDeleting:h})]})}import{useState as de}from"react";import{ArrowLeft as oi}from"lucide-react";import{useAutoAnimate as Ua}from"@formkit/auto-animate/react";import*as Z from"@radix-ui/react-dialog";import{XIcon as ei}from"lucide-react";import{jsx as Bt,jsxs as Le}from"react/jsx-runtime";function _a({...t}){return Bt(Z.Root,{"data-slot":"dialog",...t})}function ai({...t}){return Bt(Z.Portal,{"data-slot":"dialog-portal",...t})}function ri({className:t,...e}){return Bt(Z.Overlay,{"data-slot":"dialog-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function La({className:t,children:e,showCloseButton:a=!0,...o}){return Le(ai,{"data-slot":"dialog-portal",children:[Bt(ri,{}),Le(Z.Content,{"data-slot":"dialog-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...o,children:[e,a&&Le(Z.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[Bt(ei,{}),Bt("span",{className:"sr-only",children:"Close"})]})]})]})}import{Fragment as ii,jsx as A,jsxs as nt}from"react/jsx-runtime";function Ba({slug:t,onSuccess:e,onError:a,className:o,isOpen:c,onClose:d,texts:i}){let[w]=Ua(),[h]=Ua(),[u,v]=de(""),[k,S]=de(""),[x,b]=de(!1),[g,C]=de(null),{mutateAsync:y,isPending:p}=st(et.notifications.verifyUserEmail),s=async n=>{if(n.preventDefault(),C(null),!u||!u.includes("@")){C(i.loginInvalidEmailError??"");return}try{await y({email:u,slug:t}),b(!0)}catch(l){let N=l instanceof Error?l:new Error(i.loginSendEmailError);C(N.message),a?.(N)}},P=async n=>{if(S(n),C(null),n.length===6)try{let l=await y({email:void 0,code:n,slug:t});l.ok&&l.accessToken?e?.(l.userId,l.accessToken):(C(i.loginVerificationFailedError??""),a?.(new Error(i.loginVerificationFailedError)))}catch(l){let N=l instanceof Error?l:new Error(i.loginVerifyCodeError);if(N.message.includes("Invalid code")){C(i.loginInvalidCodeError??N.message),S("");return}C(N.message),a?.(N),S("")}},f=async()=>{if(S(""),C(null),!u||!t){C(i.loginSlugRequiredError??"");return}try{await y({email:u,slug:t})}catch(n){let l=n instanceof Error?n:new Error(i.loginResendEmailError);C(l.message),a?.(l)}},B=()=>{b(!1),S(""),C(null)};return A(_a,{open:c,onOpenChange:d,children:A(La,{className:"sm:max-w-[425px] min-h-[250px]",children:nt("div",{className:"flex flex-col min-h-[250px] h-full",children:[nt("div",{ref:h,className:"flex items-start gap-2 mb-2",children:[x&&A(D,{variant:"ghost",size:"icon-sm",onClick:()=>{b(!1)},children:A(oi,{className:"h-5 w-5"})}),A("div",{children:A(ft,{children:x?i.loginCodeLabel??"":i.loginTitle??""})})]}),A(Fe,{className:"mb-4",children:x?nt(ii,{children:[i.loginCodeSentMessage??""," ",u]}):i.loginDescription??""}),A("div",{className:"flex-1 flex flex-col",children:x?nt("form",{onSubmit:n=>n.preventDefault(),className:"flex flex-col flex-1",children:[nt("div",{className:"space-y-2",children:[A(ve,{children:i.loginCodeLabel??""}),A(He,{maxLength:6,value:k,onChange:P,disabled:p,children:nt(Ve,{children:[A(xt,{index:0}),A(xt,{index:1}),A(xt,{index:2}),A(xt,{index:3}),A(xt,{index:4}),A(xt,{index:5})]})}),p&&A(W,{})]}),g&&A("div",{className:"text-sm text-destructive mt-2 mb-1",role:"alert",children:g}),A("div",{className:"grow"}),nt("div",{className:"flex flex-col items-start gap-2 pt-2",children:[u.length>0&&A(D,{variant:"link",size:"sm",onClick:f,disabled:p,className:"flex-1 ml-0 pl-0",children:i.loginResendCodeButton??""}),A(D,{variant:"link",size:"sm",onClick:B,disabled:p,className:"flex-1 ml-0 pl-0",children:i.loginChangeEmailButton??""})]})]}):nt("form",{onSubmit:s,className:"flex flex-col flex-1",children:[nt("div",{className:"space-y-2",children:[A(ve,{htmlFor:"email",children:i.loginEmailLabel??""}),A(Mt,{id:"email",type:"email",placeholder:i.loginEmailPlaceholder??"",value:u,onChange:n=>v(n.target.value),required:!0,disabled:p,"aria-invalid":g?"true":"false"})]}),g&&A("div",{className:"text-sm text-destructive mt-2 mb-1",role:"alert",children:g}),A("div",{className:"grow"}),nt("div",{className:"flex flex-col items-start gap-0 pt-2",children:[A(D,{type:"submit",size:"sm",disabled:p,children:p?i.loginSendingButton??"":i.loginSendCodeButton??""}),A(D,{type:"button",variant:"link",className:"ml-0 pl-0",size:"sm",onClick:()=>{b(!0)},children:i.loginIHaveCode??""})]})]})})]})})})}import{useAutoAnimate as pi}from"@formkit/auto-animate/react";import{jsx as V,jsxs as Ue}from"react/jsx-runtime";function di(t,e){switch(e.type){case"SET_IS_LOGGED_IN":return{...t,isLoggedIn:e.value};case"SET_USER_ID":return{...t,userID:e.value};case"SET_LOADING":return{...t,isLoading:e.value};case"SET_PUBLIC_GROUPS":return{...t,groupsProvided:e.value,groups:e.value!=null&&e.value.length>0?t.groups.filter(a=>e.value?.find(o=>o.id===a.id)!=null):t.groups};case"SET_GROUPS":{let a=t.isLoggedIn==!1||t.groupsProvided!=null,o=e.value.map(c=>t.isLoggedIn==!0?c:{...c,isOn:t.groupsProvided?.find(d=>d.id===c.id)?.isOn??a});return{...t,groups:o}}case"TOGGLE_GROUP":{let a=t.groups.map(o=>o.id===e.groupID?{...o,isOn:!o.isOn}:o);return{...t,wasChanged:!0,groups:a}}case"CHECK_ALL_GROUPS":{let a=t.groups.map(o=>({...o,isOn:!0}));return{...t,groups:a,wasChanged:!0}}case"SET_WAS_CHANGED":return{...t,wasChanged:e.value};case"SET_IS_USER_GROUPS_UPDATED":return{...t,isUserGroupsUpdated:e.value};case"RESET_UPDATE_STATE":return{...t,wasChanged:!1,isUserGroupsUpdated:!0};case"SHOW_SETTINGS":return{...t,showSettings:!0};case"HIDE_SETTINGS":return{...t,showSettings:!1};default:return t}}function ui({slug:t,userID:e,productID:a,projectID:o,analytics:c,projectName:d,projectLogo:i,projectLogoDark:w,groups:h,isManaging:u=!1,texts:v,showQRCode:k=!1,showPhoneInput:S=!1,hiddenGroupIds:x=[],className:b}){let[g]=pi(),C=ht(o??Lt(),c),y=t??lt()??(typeof window<"u"?window.location.hostname:""),{mutateAsync:p,isPending:s}=st(et.notifications.updateUserGroups),{data:P,refetch:f}=ci({queryKey:["notifications_accessToken"],queryFn:()=>{if(typeof window<"u")return{accessToken:localStorage.getItem("notifications_accessToken")??void 0,userID:localStorage.getItem("notifications_userID")??void 0}}}),{data:B,isPending:n,refetch:l}=ee(et.notifications.getUserGroups,{slug:y,accessToken:P?.accessToken}),[N,z]=ni(di,{isLoading:n,isUserGroupsUpdated:!1,wasChanged:!1,groupsProvided:h,groups:[],showSettings:P!=null&&u==!0,isLoggedIn:P!=null,userID:void 0});$t(()=>{z({type:"SET_LOADING",value:s||n})},[s,n]),$t(()=>{z({type:"SET_IS_LOGGED_IN",value:P?.accessToken!=null}),z({type:"SET_USER_ID",value:P?.userID}),P?.accessToken!=null&&u==!0&&z({type:"SHOW_SETTINGS"})},[P,u]),$t(()=>{if(B==null)return;let M=B.groups.map(G=>{let X="rarely";switch(G.howOften){case 0:X="rarely";break;case 1:X="often";break;case 2:X="veryOften";break}return{id:G.id,name:G.name,description:G.description,howOften:X,isOn:G.isOn??void 0}});z({type:"SET_GROUPS",value:M})},[B,n,h]);let Q=si(null);$t(()=>{let M=h?.map(G=>(G.id.startsWith("group_")||(G.id=`group_${G.id}`),G));z({type:"SET_PUBLIC_GROUPS",value:M})},[h]);let j={...E,...v};async function O(){await p({accessToken:P?.accessToken,slug:y,userId:e,groupIds:N.groups.filter(M=>M.isOn===!0).map(M=>M.id)}),z({type:"RESET_UPDATE_STATE"}),Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{z({type:"SET_IS_USER_GROUPS_UPDATED",value:!1})},2e3)}function q(M){z({type:"TOGGLE_GROUP",groupID:M})}function Zt(){z({type:"CHECK_ALL_GROUPS"})}function ue(){z({type:"SHOW_SETTINGS"})}function be(){z({type:"HIDE_SETTINGS"})}function Xt(){localStorage.removeItem("notifications_accessToken"),localStorage.removeItem("notifications_userID"),f(),z({type:"SET_USER_ID",value:void 0}),z({type:"SET_IS_LOGGED_IN",value:!1}),z({type:"HIDE_SETTINGS"})}async function Ot(M,G){typeof window<"u"&&(localStorage.setItem("notifications_accessToken",G),M!=null&&localStorage.setItem("notifications_userID",M)),z({type:"SET_USER_ID",value:M});try{await f(),l().then().catch().finally(()=>{u==!0&&z({type:"SHOW_SETTINGS"})})}catch(X){console.log(`Error: ${X}`)}}$t(()=>()=>{Q.current&&clearTimeout(Q.current)},[]);let Yt=u==!0&&N.userID!=null&&P?.accessToken!=null;return Ue("main",{className:r("bitsnap-react relative",b?.container),children:[j.title!=null&&V("h1",{className:"text-2xl font-semibold text-black md:text-3xl lg:text-4xl xl:text-5xl dark:text-neutral-100",children:j.title}),!N.showSettings&&u&&V(D,{onClick:ue,variant:"outline",size:"icon",className:"absolute bottom-6 right-6 z-50 h-12 w-12 rounded-full shadow-lg hover:shadow-xl md:bottom-8 md:right-8","aria-label":"Settings",children:V(li,{className:"h-5 w-5"})}),V("div",{className:r("md:pt8 relative z-0 mt-6 overflow-hidden rounded-2xl bg-white px-3 pt-6 pb-3 md:px-5 md:pb-5 dark:bg-neutral-800",b?.header),children:N.showSettings?V("div",{className:"space-y-6",children:N.isLoggedIn&&Ue("div",{className:r("grid grid-cols-1 gap-3 lg:gap-6",Yt?"md:grid-cols-2":""),children:[Ue("div",{className:b?.groupsContainer,children:[V(ya,{projectName:d,projectLogo:i,projectLogoDark:w,description:j.managingDescription,className:b,onLogout:Xt}),n&&V("div",{className:"flex justify-center items-center py-8",children:V(W,{})}),V(pe,{groups:N.groups,hiddenGroupIds:x,isManaging:u,onToggle:q,onCheckAll:Zt,onUpdate:O,isUpdating:s,wasChanged:N.wasChanged,isUserGroupsUpdated:N.isUserGroupsUpdated,className:b,texts:j})]}),Yt&&V(Da,{accessToken:P.accessToken??"",slug:y,userID:N.userID??"",className:b,texts:j}),k!=!1&&V(Na,{showQRCode:k,isManaging:!0,className:b,texts:j})]})}):V("div",{className:r("grid grid-cols-1 gap-3 lg:gap-6"),children:V(Ea,{slug:y,onToggle:M=>{z({type:"TOGGLE_GROUP",groupID:M})},onCheckAll:()=>{z({type:"CHECK_ALL_GROUPS"})},onSuccess:(M,G,X)=>{C.track("availability_signup",{},{product_id:a??null}),X!=null&&Ot(G,X),M&&z({type:"SHOW_SETTINGS"})},groups:N.groups,showPhoneInput:S,agreementText:j.agreementText,className:b,texts:j,wasChanged:N.wasChanged,isUpdating:s})})}),V(Ba,{isOpen:N.showSettings&&!N.isLoggedIn,slug:y,onSuccess:Ot,texts:j,onClose:be})]})}function bi({slug:t,userID:e,productID:a,projectID:o,analytics:c,projectName:d,projectLogo:i,projectLogoDark:w,groups:h,isManaging:u,texts:v,showQRCode:k,showPhoneInput:S,hiddenGroupIds:x,className:b}){return V(fe,{children:V(ui,{slug:t,userID:e,productID:a,projectID:o,analytics:c,projectName:d,projectLogo:i,projectLogoDark:w,groups:h,isManaging:u,texts:v,showQRCode:k,showPhoneInput:S,hiddenGroupIds:x,className:b})})}var mi=bi;export{Se as ApplePayButton,gi as Bitsnap,Po as BitsnapCheckout,Dr as BitsnapReturns,gr as BitsnapReturnsProvider,Or as CHECKOUT_SLOT_NAMES,Ka as Environment,Ee as GooglePayButton,Rr as ITEM_IDS_NOT_FOUND,mi as NotificationsComponent,yi as PRODUCT_LIST_SLOT_NAMES,Ar as Panel,cr as PanelLogin,ar as PanelProvider,Ci as ProductList,Ir as PublicOrderPage,lr as RETURNS_SLOT_NAMES,pr as ReturnsAppearanceProvider,Cr as ReturnsCodeStep,Nr as ReturnsConfirmation,kr as ReturnsEmailStep,Er as ReturnsMyReturnDetail,zr as ReturnsMyReturnsList,Pr as ReturnsOrderDetail,Sr as ReturnsOrderList,mr as ReturnsProvider,Tr as ReturnsResult,sr as buildAccessTokenRedirect,fi as createCheckout,hi as createPaymentURL,xi as formatProductPrice,er as getAllowedReturnOrigins,Rt as getLocale,$a as getPanelConfig,vi as getReferenceIfPossible,or as getReturnURLFromSearch,wi as injectReferenceToRequestIfNeeded,ir as persistReturnURL,nr as readPersistedReturnURL,tr as setAllowedReturnOrigins,Wa as setCustomHost,Ja as setHost,ye as setLocale,Ya as setLoginURL,Qa as setPanelConfig,Za as setPanelProjectID,ke as setProjectID,Xa as setTheme,wr as useCreateReturn,xr as useMyReturn,yr as useMyReturns,rr as usePanelConfig,ki as useProducts,fr as useReturnOrders,hr as useReturnSession,vr as useReturnableOrder,dr as useReturnsAppearance,ur as useReturnsSlot,br as useReturnsText};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|