PageSourceSearch

https://www.3bee.com/_next/static/chunks/pages/checkout/success-db9abaa3dd210d19.js

js 3bee.com collected 2026-10-03 22:07:10 UTC 24,478 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[53076,76187],{3121:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d,a:()=>c});var n=s(2997),r=s(56005),i=s(24047),a=s(57956);let l="3bee:checkout-snapshot";function o(e,t){var s;return null!=(s=t.byImageId.get(e.image_id))?s:t.bySiteId.get(e.site_id)}function c(e,t){var s,c,d,u;if(!e)return;let m=function(e){let t=new Map;if(!e)return t;for(let[,n]of e.getQueriesData(["hive"])){var s;let e=null==n||null==(s=n.data)?void 0:s[0];(null==e?void 0:e.id)&&t.set(e.id,e)}return t}(t),p=function(e,t,s,r){var i,a,l;let c=[],d=e=>{let{months:t,amountCents:s,...r}=e;c.push({...r,plan:t&&!(t<=0)?1===t?"monthly":12===t?"annual":t%12==0?"".concat(t/12,"-years"):"".concat(t,"-months"):"",amount:(0,n.V)((null!=s?s:0)/100),amountCents:null!=s?s:0})};return null==(i=e.cart_adoptions)||i.forEach(e=>{var s,n;let r,i=t.get(e.hive_id),a=e.custom_bee_name||(null==i?void 0:i.name)||"";!a&&e.flowering_name&&(a=e.flowering_name,r="alveareOf"),d({productKey:"alveare",emoji:"\uD83D\uDC1D",name:a,displayPrefix:r,imageUrl:function(e,t){var s,n,r;let i=t.get(e.hive_id);if(null==i?void 0:i.main_image)return i.main_image;let a=null==i||null==(n=i.gallery)||null==(s=n[0])?void 0:s.url_image;return a||(null!=(r=e.image_url)?r:null)}(e,t),months:null!=(s=e.duration_in_months)?s:0,amountCents:null!=(n=e.amount_cents)?n:0})}),null==(a=e.cart_trees)||a.forEach(e=>{var t,n;let r=s.get(e.adoptable_tree_id);d({productKey:"albero",emoji:"\uD83C\uDF33",name:e.custom_tree_name||(null==r?void 0:r.name)||e.tree_name||"",imageUrl:function(e,t){var s;let n=t.get(e.adoptable_tree_id);return(null==n?void 0:n.image_url)?n.image_url:null!=(s=e.image_url)?s:null}(e,s),months:null!=(t=e.duration_in_months)?t:0,amountCents:null!=(n=e.amount_cents)?n:0})}),null==(l=e.cart_species)||l.forEach(e=>{var t,s,n,i;return d({productKey:"specie",emoji:"\uD83E\uDD8A",name:e.species_name?e.species_name:null!=(i=null==(n=o(e,r))?void 0:n.name)?i:"",imageUrl:function(e,t){if(e.image_url)return e.image_url;if(e.species_image_url)return e.species_image_url;let s=o(e,t);return(null==s?void 0:s.observation_image_url)||(null==s?void 0:s.taxon_image_url)||null}(e,r),months:null!=(t=e.duration_in_months)?t:0,amountCents:null!=(s=e.amount_cents)?s:0})}),c}(e,m,function(e){let t=new Map;if(!e)return t;for(let[,s]of e.getQueriesData(["tree"]))(null==s?void 0:s.adoptable_tree_id)&&t.set(s.adoptable_tree_id,s);return t}(t),function(e){let t=new Map,s=new Map;if(!e)return{byImageId:t,bySiteId:s};for(let[,r]of e.getQueriesData(["/v1/adoptions/species/cards"])){var n;for(let e of null!=(n=null==r?void 0:r.species)?n:[])e.observation_image_id&&t.set(e.observation_image_id,e),e.site_id&&!s.has(e.site_id)&&s.set(e.site_id,e)}return{byImageId:t,bySiteId:s}}(t)),h=null!=(u=e.amount_cents)?u:p.reduce((e,t)=>e+t.amountCents,0),x={cartId:e.id,hasAlveare:!!(null==(s=e.cart_adoptions)?void 0:s.length),hasAlbero:!!(null==(c=e.cart_trees)?void 0:c.length),hasSpecie:!!(null==(d=e.cart_species)?void 0:d.length),items:p,totalAmountCents:h,totalAmount:(0,n.V)(h/100),honeyShipping:(0,r.r)(e),receipt:((e,t)=>{try{var s=e,n=t;let r=((e,t)=>{var s,n,r,i,a,l;if(!t)return{};let o=new Map;for(let i of null!=(s=e.cart_adoptions)?s:[]){let e=null==(r=t.getQueryData(["hive",i.hive_id]))||null==(n=r.data)?void 0:n[0];e&&o.set(i.hive_id,e)}let c=new Map;for(let s of null!=(i=e.cart_trees)?i:[]){let e=t.getQueryData(["tree",s.adoptable_tree_id]);e&&c.set(s.adoptable_tree_id,e)}let d=new Map;for(let s of new Set((null!=(a=e.cart_adoptions)?a:[]).map(e=>e.adoption_plan_id)))for(let e of null!=(l=t.getQueryData(["addons",s]))?l:[])d.set(e.id,e.name);return{hives:o,trees:c,addonNames:d}})(s,n),l=null==n?void 0:n.getQueryData(["cartSpecies",s.id,s.token]),o={};for(let e of(0,i.rK)(s,r,l))o[e.id]=e.photoSrc;return{summary:(0,a.H)(s,{lookups:r,species:l}),photos:o}}catch(e){return}})(e,t)};try{sessionStorage.setItem(l,JSON.stringify(x))}catch(e){}}function d(){try{let e=sessionStorage.getItem(l);if(!e)return null;return JSON.parse(e)}catch(e){return null}}},56005:(e,t,s)=>{"use strict";s.d(t,{V:()=>n,r:()=>i});let n={needed:!1,adoptionIds:[],countryIds:[]},r=e=>!0===e||"number"==typeof e&&e>0,i=e=>{var t;if(!e)return n;let s=(null!=(t=e.cart_adoptions)?t:[]).filter(t=>((e,t)=>!r(e.is_gift)&&e.shipment_amount_cents>0&&(t.cart_honeys?t.cart_honeys.some(t=>t.cart_adoption_id===e.id&&r(t.main)):e.honey_id>0))(t,e));if(0===s.length)return n;let i=[];for(let e of s){let t=e.destination_country_id;t&&!i.includes(t)&&i.push(t)}return{needed:!0,adoptionIds:s.map(e=>e.id),countryIds:i}}},59421:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>q});
1var n=s(83815),r=s(3121),i=s(52375);let a={alveare:"alveari",albero:"alberi",specie:"specie"};var l=s(45027),o=s(602),c=s(99888),d=s(70679),u=s(2997),m=s(60938),p=s(86666),h=s.n(p),x=s(54002),f=s(95001),v=s(98572),b=s(87317),g=s(88536),k=s(90829),y=s(36525),_=s(68714),j=s(54569);let N={street:120,zip:10,city:80,province:40},w=/\d|\bsnc\b/i,C=/^(.*?\S)[\s,]+(\d+[\w/-]*|snc)$/i,S=/^(\d+[\w/-]*)[\s,]+(\S.*)$/,A=e=>{var t,s,n,r,i;let a=[null==(t=e.street1)?void 0:t.trim(),null==(s=e.street_number)?void 0:s.trim()].filter(Boolean).join(" "),l=[null==(n=e.zip)?void 0:n.trim(),null==(r=e.city)?void 0:r.trim()].filter(Boolean).join(" "),o=(null==(i=e.state)?void 0:i.trim())?" (".concat(e.state.trim(),")"):"";return"".concat(a,", ").concat(l).concat(o)},I="m-0 mb-1.5 block text-[14.5px] font-bold text-checkout-n600";function z(e){let{country:t,countryLabel:s,defaultValues:r,onSubmit:i,isSaving:a,saveFailed:l,onSkip:o,onUseSaved:c,autoFocus:u=!1}=e,{t:p}=(0,x.A)("checkout-v2/success"),h=(0,d.useId)(),C=(0,d.useMemo)(()=>(e=>{let t="IT"===e.toUpperCase(),s=e=>({message:e});return j.z.object({street:j.z.string().trim().min(1,s("street")).max(N.street,s("tooLong")).refine(e=>!t||w.test(e),s("streetNumber")),zip:t?j.z.string().trim().regex(/^\d{5}$/,s("zipIt")):j.z.string().trim().min(1,s("zip")).max(N.zip,s("tooLong")),city:j.z.string().trim().min(1,s("city")).max(N.city,s("tooLong")),province:t?j.z.string().trim().regex(/^[A-Za-z]{2}$/,s("provinceIt")).transform(e=>e.toUpperCase()):j.z.string().trim().max(N.province,s("tooLong"))})})(t),[t]),{register:S,handleSubmit:A,setFocus:z,formState:{errors:F}}=(0,b.mN)({resolver:(0,v.u)(C),defaultValues:r,mode:"onSubmit",reValidateMode:"onChange"});(0,d.useEffect)(()=>{u&&z("street")},[u,z]);let E=A(async e=>{try{await i(e)}catch(e){}}),L=e=>"".concat(h,"-").concat(e),O=e=>"".concat(h,"-").concat(e,"-error"),T=(e,t,s,n)=>({id:L(e),"data-testid":t,autoComplete:s,maxLength:n,"aria-invalid":!!F[e]||void 0,"aria-describedby":F[e]?O(e):void 0,className:(0,f.cn)("box-border block min-h-12 w-full rounded-xl border-[1.5px] border-solid border-checkout-n300 bg-checkout-surface px-3.5 py-3 font-[inherit] text-[16.5px] text-checkout-n1000 outline-none placeholder:text-checkout-n400 focus-visible:border-checkout-n600 focus-visible:ring-2 focus-visible:ring-checkout-focus",_.lO.control,F[e]?"border-checkout-negative bg-checkout-negative-soft":null),...S(e)}),K=["street","zip","city","province"].filter(e=>F[e]),U="IT"===t.toUpperCase();return(0,n.jsxs)("form",{noValidate:!0,onSubmit:E,className:"mt-3.5",children:[(0,n.jsx)("label",{htmlFor:L("street"),className:I,children:p("address.fields.street")}),(0,n.jsx)("input",{type:"text",placeholder:p("address.placeholders.street"),...T("street",k.b3.successAddressStreet,"shipping street-address",N.street)}),(0,n.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-[1_1_0]",children:[(0,n.jsx)("label",{htmlFor:L("zip"),className:I,children:p("address.fields.zip")}),(0,n.jsx)("input",{type:"text",inputMode:U?"numeric":"text",placeholder:p("address.placeholders.zip"),...T("zip",k.b3.successAddressZip,"shipping postal-code",U?5:N.zip)})]}),(0,n.jsxs)("div",{className:"min-w-0 flex-[2_1_0]",children:[(0,n.jsx)("label",{htmlFor:L("city"),className:I,children:p("address.fields.city")}),(0,n.jsx)("input",{type:"text",placeholder:p("address.placeholders.city"),...T("city",k.b3.successAddressCity,"shipping address-level2",N.city)})]}),(0,n.jsxs)("div",{className:"min-w-0 flex-[0.8_1_0]",children:[(0,n.jsx)("label",{htmlFor:L("province"),className:I,children:p("address.fields.province")}),(0,n.jsx)("input",{type:"text",autoCapitalize:"characters",placeholder:U?p("address.placeholders.province"):void 0,...T("province",k.b3.successAddressProvince,"shipping address-level1",U?2:N.province)})]})]}),K.map(e=>{let t;return(0,n.jsxs)("p",{id:O(e),className:"m-0 mt-2 flex items-start gap-1.5 text-[14.5px] font-semibold text-checkout-negative",children:[(0,n.jsx)(m.In,{icon:"mdi:alert-circle-outline",width:14,height:14,"aria-hidden":"true",className:"mt-px shrink-0"}),(null==(t=F[e])?void 0:t.message)?p("address.errors.".concat(t.message)):""]},e)}),(0,n.jsx)("p",{className:"m-0 mb-4 mt-3 text-[14px] text-checkout-n500",children:p("address.country",{country:s})}
1),(0,n.jsx)(y.L,{type:"submit",fullWidth:!0,loading:a,"data-testid":k.b3.successAddressSave,children:p("address.save")}),l?(0,n.jsxs)("div",{role:"alert",[g.BP]:"",className:(0,f.cn)("mt-2.5 flex items-start gap-2 rounded-xl border border-checkout-n200 bg-checkout-n100 px-3.5 py-3 text-[15px] font-semibold leading-relaxed text-checkout-n600",_.lO.enter),children:[(0,n.jsx)(m.In,{icon:"mdi:alert-circle-outline",width:16,height:16,"aria-hidden":"true",className:"mt-0.5 shrink-0 text-checkout-n500"}),(0,n.jsxs)("span",{children:[p("address.saveError")," ",(0,n.jsx)("button",{type:"submit",disabled:a,className:"cursor-pointer border-0 bg-transparent p-0 font-[inherit] font-extrabold text-[inherit] text-checkout-n600 underline underline-offset-2 outline-none focus-visible:ring-2 focus-visible:ring-checkout-focus",children:p("address.retry")}),(0,n.jsx)("br",{}),p("address.saveErrorHint")]})]}):null,c?(0,n.jsx)(y.L,{variant:"link",fullWidth:!0,className:"mt-1",onClick:c,children:p("address.useSaved")}):null,(0,n.jsx)(y.L,{variant:"link",fullWidth:!0,className:"mt-1",onClick:o,"data-testid":k.b3.successAddressSkip,children:p("address.skip")})]})}var F=s(33635),E=s(24552);let L="m-0 text-[14.5px] leading-normal text-checkout-n500";function O(e){var t,s,r,i,a,l,o,u;let{honeyShipping:p}=e,{t:h}=(0,x.A)("checkout-v2/success"),{locale:v="it"}=(0,c.useRouter)(),{status:b,profile:g,save:j,isSaving:N}=(()=>{var e;let{data:t,status:s}=(0,E.useSession)(),n=null==t?void 0:t.accessToken,r=(0,F.agZ)(n?{authorization:"Bearer ".concat(n)}:void 0,{query:{enabled:!!n,retry:1,refetchOnWindowFocus:!1,staleTime:1/0}}),{mutateAsync:i,isLoading:a}=(0,F.Wxl)(),l=(0,d.useCallback)(async e=>{await i({data:e,headers:n?{authorization:"Bearer ".concat(n)}:void 0})},[i,n]);return{status:"loading"===s||n&&r.isInitialLoading?"loading":n?"ready":"signedOut",profile:null!=(e=r.data)?e:null,save:l,isSaving:a}})(),w=null!=(t=p.countryIds[0])?t:"IT",I=((e,t)=>{try{var s;return null!=(s=new Intl.DisplayNames([t],{type:"region"}).of(e.toUpperCase()))?s:e}catch(t){return e}})(w,v),O=(null==g||null==(s=g.street1)?void 0:s.trim())&&(null==(r=g.zip)?void 0:r.trim())&&(null==(i=g.city)?void 0:i.trim())&&(!g.country_code||!w||g.country_code.toUpperCase()===w.toUpperCase())?g:null,[T,K]=(0,d.useState)(null),[U,M]=(0,d.useState)(!1),P=(0,d.useId)(),Q=null!=T?T:O?{kind:"confirm"}:{kind:"form",prefill:null},D=(null==T?void 0:T.kind)==="form",R=(0,d.useCallback)(e=>null==e?void 0:e.focus({preventScroll:!0}),[]),V=(0,d.useCallback)(async e=>{M(!1);let t=((e,t)=>{let{street1:s,street_number:n}=(e=>{let t=e.trim().replace(/\s+/g," "),s=C.exec(t);if(s)return{street1:s[1].replace(/,$/,""),street_number:s[2]};let n=S.exec(t);return n?{street1:n[2],street_number:n[1]}:{street1:t}})(e.street);return{street1:s,...n?{street_number:n}:{},zip:e.zip.trim(),city:e.city.trim(),...e.province.trim()?{state:e.province.trim()}:{},...t?{country_code:t.toUpperCase()}:{}}})(e,w);try{await j(t)}catch(e){throw M(!0),e}K({kind:"done",how:"saved",address:t})},[w,j]);if("skipped"===Q.kind)return(0,n.jsx)("p",{ref:R,tabIndex:-1,role:"status",className:"m-0 mb-4 text-center text-[14.5px] text-checkout-n500 outline-none",children:h("address.skipped")});if("done"===Q.kind)return(0,n.jsxs)("div",{ref:R,tabIndex:-1,role:"status","data-testid":k.b3.successAddressSaved,className:(0,f.cn)("mb-4 flex items-center gap-2 rounded-xl bg-checkout-positive-soft px-3 py-2 text-[15px] font-bold text-checkout-positive outline-none",_.lO.enter),children:[(0,n.jsx)(m.In,{icon:"mdi:check-bold",width:16,height:16,"aria-hidden":"true",className:"shrink-0"}),(0,n.jsx)("span",{className:"min-w-0 flex-1",children:h("saved"===Q.how?"address.savedRow":"address.confirmedRow",{address:A(Q.address)})}),(0,n.jsx)("button",{type:"button",onClick:()=>K({kind:"form",prefill:Q.address}),className:"min-h-11 shrink-0 cursor-pointer border-0 bg-transparent px-1 font-[inherit] text-[15px] font-extrabold text-checkout-positive underline outline-none focus-visible:ring-2 focus-visible:ring-checkout-focus",children:h("address.edit")})]});let W="form"===Q.kind;return(0,n.jsxs)("section",{"data-testid":k.b3.successAddressCard,"aria-labelledby":P,"aria-busy":"loading"===b||void 0,className:"mx-auto mb-4 box-border w-full rounded-2xl border border-checkout-n200 bg-checkout-surface p-4",children:[(0,n.jsxs)("h2",{id:P,className:"m-0 mb-1 flex items-center gap-2 text-[17px] font-extrabold text-checkout-n1000",children:[(0,n.jsx)("span",{"aria-hidden":"true",children:"\uD83C\uDF6F"}),h(W||"ready"!==b?"address.askTitle":"address.confirmTitle")]}),"loading"===b?(0,n.jsx)("p",{className:L,children:h("address.loading")}
1):null,"signedOut"===b?(0,n.jsx)("p",{className:L,children:h("address.signedOut")}):null,"ready"===b&&"confirm"===Q.kind&&O?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:(0,f.cn)(L,"mb-3.5"),children:h("address.confirmSub")}),(0,n.jsxs)("p",{className:"m-0 mb-3.5 rounded-xl border border-checkout-n200 bg-checkout-n100 px-3.5 py-3 text-[15px] font-bold text-checkout-n600",children:[(0,n.jsx)("small",{className:"mb-0.5 block text-[12.5px] font-extrabold uppercase tracking-[0.08em] text-checkout-n500",children:h("address.savedLabel")}),A(O)]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)(y.L,{"data-testid":k.b3.successAddressConfirmYes,fullWidth:!0,onClick:()=>K({kind:"done",how:"confirmed",address:O}),children:h("address.confirmYes")}),(0,n.jsx)(y.L,{variant:"secondary","data-testid":k.b3.successAddressUseOther,fullWidth:!0,onClick:()=>{M(!1),K({kind:"form",prefill:null})},children:h("address.useOther")})]})]}):null,"ready"===b&&"form"===Q.kind?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:L,children:h("address.askSub")}),(0,n.jsx)(z,{country:w,countryLabel:I,defaultValues:{street:(a=Q.prefill)?[a.street1,a.street_number].filter(Boolean).join(" "):"",zip:null!=(l=null==a?void 0:a.zip)?l:"",city:null!=(o=null==a?void 0:a.city)?o:"",province:null!=(u=null==a?void 0:a.state)?u:""},onSubmit:V,isSaving:N,saveFailed:U,onSkip:()=>K({kind:"skipped"}),onUseSaved:O&&D?()=>K({kind:"confirm"}):void 0,autoFocus:D})]}):null]})}var T=s(56005);let K={alveare:"hive",albero:"tree",specie:"species"},U=e=>"mista"===e?null:K[e];var M=s(3399);function P(e){let{productKey:t}=e,{t:s}=(0,x.A)("checkout-v2/success"),r=U(t),i=s("title.".concat(t)).split("\n");return(0,n.jsxs)("div",{className:"flex flex-col items-center pt-10 text-center md:pt-14",children:[(0,n.jsx)("div",{"aria-hidden":"true",className:(0,f.cn)("mb-5 flex h-14 w-14 items-center justify-center rounded-[18px] text-white",r?M.L[r].accentSolid:"bg-checkout-n600",_.lO.pop),children:(0,n.jsx)(m.In,{icon:"mdi:check-bold",width:28,height:28})}),(0,n.jsx)("h1",{"data-testid":k.b3.successTitle,className:"m-0 mb-2 text-balance text-[24px] font-extrabold leading-[1.3] text-checkout-n1000 md:text-[28px]",children:i.map((e,t)=>(0,n.jsxs)(d.Fragment,{children:[t>0?(0,n.jsx)("br",{}):null,e]},t))}),(0,n.jsx)("p",{className:"m-0 mb-7 max-w-[520px] text-[15.5px] leading-normal text-checkout-n500 md:text-[16.5px]",children:s("description.".concat(t))})]})}var Q=s(32671),D=s(84771),R=s(4079);let V="flex items-center gap-2.5 border-0 border-t border-solid border-checkout-n200 py-2.5 first:border-t-0",W="text-[15px] font-extrabold text-checkout-n1000";function B(e){var t;let{snapshot:s,amountFormatted:r,cartId:i}=e,{t:a}=(0,x.A)("checkout-v2/success"),{t:l}=(0,x.A)("checkout-v2/common"),{t:o}=(0,x.A)("checkout-v2/cart"),c=(0,d.useMemo)(()=>(e=>{let t=e.receipt;if(!t)return e.items.map((e,t)=>({kind:"line",key:"item:".concat(t),type:K[e.productKey],name:e.name,namePrefix:e.displayPrefix,photoSrc:e.imageUrl,amountText:e.amount||void 0,isFree:!1}));let{summary:s,photos:n}=t,r=s.consistent,i=[];for(let e of s.groups)for(let t of e.rows){var a,l;i.push({kind:"line",key:t.lineId,type:t.type,name:t.name,customName:null!=(a=t.customName)?a:null,photoSrc:null!=(l=n[t.lineId])?l:null,isFree:t.isFree,...r?t.isFree?{cents:t.amountCents,wasCents:t.valueCents}:{cents:t.valueCents}:{}}),r&&t.extras.forEach((e,s)=>i.push({kind:"sub",key:"".concat(t.lineId,":extra:").concat(s),label:e.label,extraKind:e.kind,cents:t.isFree?e.priceCents:e.valueCents,isFree:t.isFree}))}if(!r)return i;s.unassignedExtras.forEach((e,t)=>i.push({kind:"row",key:"unassigned:".concat(t),labelKey:"honey"===e.kind?"honey":"extra",cents:e.valueCents})),s.giftCards.forEach(e=>i.push({kind:"row",key:"gift:".concat(e.id),labelKey:"giftCard",cents:e.amountCents})),s.shipping&&s.shipping.valueCents>0&&i.push({kind:"row",key:"shipping",labelKey:"shipping",cents:s.shipping.valueCents});let o=s.discount;return o&&0!==o.discountCents&&i.push({kind:"row",key:"discount",labelKey:o.code?"discountCode":"discount",values:o.code?{code:o.code}:void 0,cents:Math.abs(o.discountCents),negative:o.discountCents>0}),i})(s),[s]),u=null==(t=s.receipt)?void 0:t.summary.totalCents;return(0,n.jsxs)("section",{"data-testid":k.b3.successReceipt,"aria-labelledby":"success-receipt-title",className:"mb-4 rounded-2xl border border-checkout-n200 bg-checkout-surface p-4",children:[(0,n.jsx)("h2",{id:"success-receipt-title",className:"sr-only",children:a("receipt.title")}),(0,n.jsxs)("ul",{className:"m-0 list-none p-0",children:[c.map(e=>{var t;return"line"===e.kind?(0,n.jsxs)("li",{className:V,children:[(0,n.jsx)(R.c,{type:e.type,src:e.photoSrc,size:38,radiusClassName:"rounded-[9px]"}),(0,n.jsxs)("span",{className:"min-w-0 flex-1 text-[15px] font-bold text-checkout-n1000",children:[e.name&&e.namePrefix?a("receipt.".concat(e.namePrefix),{value:e.name}):e.name||l((0,M.T)(e.type)),e.customName?(0,n.jsx)("span",{className:"block text-[14px] font-semibold text-checkout-n500",children:(0,Q.Hn)(o,{customName:e.customName})}):null]}),void 0!==e.cents?(0,n.jsx)(D.v,{cents:e.cents,wasCents:e.wasCents,className:(0,f.cn)(W,e.isFree?"text-checkout-positive":null),wasClassName:"text-[14px]"}):e.amountText?(0,n.jsx)("span",{className:W,children:e.amountText}):null]},e.key):"sub"===e.kind?(0,n.jsxs)("li",{className:"-mt-1.5 flex items-center gap-2.5 py-1.5 pl-12",children:[(0,n.jsxs)("span",{className:"min-w-0 flex-1 text-[14px] font-semibold text-checkout-n500",children:[(0,n.jsx)("span",{"aria-hidden":"true",children:"↳ "}),null!=(t=e.label)?t:a("honey"===e.extraKind?"receipt.honey":"receipt.extra")]}),(0,n.jsx)(D.v,{cents:e.cents,className:(0,f.cn)("text-[14px] font-bold text-checkout-n600",e.is
1Free?"text-checkout-positive":null)})]},e.key):(0,n.jsxs)("li",{className:(0,f.cn)(V,"text-[15px]",e.negative?"font-bold text-checkout-positive":"text-checkout-n600"),children:[(0,n.jsx)("span",{className:"min-w-0 flex-1",children:a("receipt.".concat(e.labelKey),e.values)}),(0,n.jsx)(D.v,{cents:e.cents,negative:e.negative,className:"font-bold"})]},e.key)}),i?(0,n.jsxs)("li",{className:(0,f.cn)(V,"text-[15px] text-checkout-n600"),children:[(0,n.jsx)("span",{className:"min-w-0 flex-1",children:a("receipt.order")}),(0,n.jsxs)("span",{className:"font-bold",children:["#",i]})]}):null]}),(0,n.jsxs)("p",{className:"m-0 mt-1 flex justify-between border-0 border-t-[1.5px] border-solid border-checkout-n1000 pt-3 text-[17px] font-extrabold text-checkout-n1000",children:[(0,n.jsx)("span",{children:a("receipt.total")}),void 0!==u?(0,n.jsx)(D.v,{cents:u}):(0,n.jsx)("span",{children:r})]})]})}var H=s(78454);function $(e){var t;let{snapshot:s,productKey:r,amountFormatted:i,cartId:a,ctaHref:l,showReceipt:o}=e,{t:c}=(0,x.A)("checkout-v2/success"),d=null!=(t=s.honeyShipping)?t:T.V,u=U(r);return(0,n.jsxs)("div",{"data-testid":k.b3.successRoot,className:(0,f.cn)(H.J,"min-h-screen bg-checkout-n100 text-checkout-n600"),children:[(0,n.jsx)("header",{className:"flex justify-center border-0 border-b border-solid border-checkout-n200 bg-checkout-surface px-4 py-3 md:px-8 md:py-3.5",children:(0,n.jsx)(h(),{src:"/images/logo.svg",alt:"3Bee",width:72,height:36,priority:!0})}),(0,n.jsxs)("main",{className:"mx-auto box-border w-full max-w-[600px] px-4 pb-10 md:pb-14",children:[(0,n.jsx)(P,{productKey:r}),d.needed?(0,n.jsx)(O,{honeyShipping:d}):null,o?(0,n.jsx)(B,{snapshot:s,amountFormatted:i,cartId:a}):null,(0,n.jsxs)("a",{href:l,rel:/^https?:\/\//i.test(l)?"noopener noreferrer":void 0,"data-testid":k.b3.successOasiCta,className:(0,f.cn)("box-border flex min-h-12 w-full items-center justify-center gap-2 rounded-[14px] px-4 py-3.5 text-center text-[16.5px] font-extrabold text-white no-underline outline-none focus-visible:ring-2 focus-visible:ring-checkout-focus focus-visible:ring-offset-2",u?M.L[u].accentSolid:"bg-checkout-n600"),children:[c("cta"),(0,n.jsx)(m.In,{icon:"mdi:arrow-right",width:18,height:18,"aria-hidden":"true"})]}),(0,n.jsxs)("p",{className:"m-0 mt-3.5 text-center text-[15px] text-checkout-n500",children:[c("support.question")," ",(0,n.jsx)("a",{href:"mailto:[email protected]",className:"inline-block py-2 font-bold text-checkout-n600 underline underline-offset-2 outline-none focus-visible:ring-2 focus-visible:ring-checkout-focus",children:c("support.link")})]})]})]})}let Z=e=>Array.isArray(e)?e[0]:e,J=["it","en","de","es","fr"];function q(){var e,t;let s,m=(0,l.jE)(),{locale:p="it",query:h}=(0,c.useRouter)(),x=!!Z(h.self),[f,v]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=(0,r.Z)();if(e)v(e);else{var t,s,n,i;let e=null==(t=m.getQueriesData(["cart"]).find(e=>{let[,t]=e;return!!t}))?void 0:t[1];v({hasAlveare:!!(null==e||null==(s=e.cart_adoptions)?void 0:s.length),hasAlbero:!!(null==e||null==(n=e.cart_trees)?void 0:n.length),hasSpecie:!!(null==e||null==(i=e.cart_species)?void 0:i.length),items:[],totalAmountCents:0,totalAmount:""})}},[m]),(0,d.useEffect)(()=>{m.removeQueries(["cart"]),m.removeQueries(["cartAdoptions"]),m.removeQueries(["cartHoneys"]),m.removeQueries(["cartCoupons"]),(0,o.removeCookies)(x?"self_cartToken":"cartToken")},[x,m]);let b=f?function(e){var t;let s=new Set;return(e.hasAlveare&&s.add("alveare"),e.hasAlbero&&s.add("albero"),e.hasSpecie&&s.add("specie"),s.size>1)?"mista":null!=(t=[...s][0])?t:"alveare"}(f):"alveare",g=f?(s=0,f.hasAlveare&&s++,f.hasAlbero&&s++,f.hasSpecie&&s++,s):0,k=null!=(e=Z(h.cart_id))?e:"",y=Z(h.amount),_=parseFloat((null!=y?y:"0").replace(",",".")),j=(null==f?void 0:f.totalAmount)||(0,u.V)(Number.isFinite(_)?_:0),N=!!(f&&(f.hasAlveare||f.hasAlbero||f.hasSpecie))||!!k,w=f?function(e){let t={};for(let n of e.items){var s;let e=a[n.productKey];t[e]=(null!=(s=t[e])?s:0)+n.amountCents}return e.hasAlveare&&void 0===t.alveari&&(t.alveari=0),e.hasAlbero&&void 0===t.alberi&&(t.alberi=0),e.hasSpecie&&void 0===t.specie&&(t.specie=0),(0,i.SS)(t)}(f):"ecommerce",C=null!=(t=null==f?void 0:f.cartId)?t:/^\d+$/.test(k)?Number(k):void 0,S=J.includes(p)?p:"it";
1return f?(0,n.jsx)($,{snapshot:f,productKey:b,productCount:g,amountFormatted:j,cartId:k,ctaHref:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ecommerce",s=arguments.length>2?arguments[2]:void 0,n=new URL("https://adotta.3bee.com/".concat(e));return n.searchParams.set(i._c.src,i.Pw),"ecommerce"!==t&&n.searchParams.set(i._c.product,t.slice(10)),void 0!==s&&Number.isSafeInteger(s)&&s>0&&n.searchParams.set(i._c.order,String(s)),n.toString()}(S,w,C),showReceipt:N,isSelfAdopt:x}):(0,n.jsx)("div",{"aria-busy":"true",className:"min-h-screen bg-white",suppressHydrationWarning:!0})}},82808:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout/success",function(){return s(59421)}])}},e=>{e.O(0,[54569,87317,57052,33635,53483,22919,90636,46593,38792],()=>e(e.s=82808)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.